@webitel/ui-sdk 25.10.7 → 25.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui-sdk.umd.cjs
CHANGED
|
@@ -4666,120 +4666,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4666
4666
|
}
|
|
4667
4667
|
}
|
|
4668
4668
|
`);this.styleElement.innerHTML=a}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},onOverlayClick:function(i){er.emit("overlay-click",{originalEvent:i,target:this.target})}},directives:{focustrap:tZ,ripple:g2},components:{Portal:m2}},rZ=["aria-modal"];function lZ(o,i,a,r,s,c){var p=l.resolveComponent("Portal"),f=l.resolveDirective("focustrap");return l.openBlock(),l.createBlock(p,{appendTo:o.appendTo},{default:l.withCtx(function(){return[l.createVNode(l.Transition,l.mergeProps({name:"p-popover",onEnter:c.onEnter,onLeave:c.onLeave,onAfterLeave:c.onAfterLeave},o.ptm("transition")),{default:l.withCtx(function(){return[s.visible?l.withDirectives((l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref:c.containerRef,role:"dialog","aria-modal":s.visible,onClick:i[3]||(i[3]=function(){return c.onOverlayClick&&c.onOverlayClick.apply(c,arguments)}),class:o.cx("root")},o.ptmi("root")),[o.$slots.container?l.renderSlot(o.$slots,"container",{key:0,closeCallback:c.hide,keydownCallback:function(b){return c.onButtonKeydown(b)}}):(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:1,class:o.cx("content"),onClick:i[0]||(i[0]=function(){return c.onContentClick&&c.onContentClick.apply(c,arguments)}),onMousedown:i[1]||(i[1]=function(){return c.onContentClick&&c.onContentClick.apply(c,arguments)}),onKeydown:i[2]||(i[2]=function(){return c.onContentKeydown&&c.onContentKeydown.apply(c,arguments)})},o.ptm("content")),[l.renderSlot(o.$slots,"default")],16))],16,rZ)),[[f]]):l.createCommentVNode("",!0)]}),_:3},16,["onEnter","onLeave","onAfterLeave"])]}),_:3},8,["appendTo"])}m9.render=lZ;var sZ=Ht`
|
|
4669
|
-
.p-toggleswitch {
|
|
4670
|
-
display: inline-block;
|
|
4671
|
-
width: dt('toggleswitch.width');
|
|
4672
|
-
height: dt('toggleswitch.height');
|
|
4673
|
-
}
|
|
4674
|
-
|
|
4675
|
-
.p-toggleswitch-input {
|
|
4676
|
-
cursor: pointer;
|
|
4677
|
-
appearance: none;
|
|
4678
|
-
position: absolute;
|
|
4679
|
-
top: 0;
|
|
4680
|
-
inset-inline-start: 0;
|
|
4681
|
-
width: 100%;
|
|
4682
|
-
height: 100%;
|
|
4683
|
-
padding: 0;
|
|
4684
|
-
margin: 0;
|
|
4685
|
-
opacity: 0;
|
|
4686
|
-
z-index: 1;
|
|
4687
|
-
outline: 0 none;
|
|
4688
|
-
border-radius: dt('toggleswitch.border.radius');
|
|
4689
|
-
}
|
|
4690
|
-
|
|
4691
|
-
.p-toggleswitch-slider {
|
|
4692
|
-
cursor: pointer;
|
|
4693
|
-
width: 100%;
|
|
4694
|
-
height: 100%;
|
|
4695
|
-
border-width: dt('toggleswitch.border.width');
|
|
4696
|
-
border-style: solid;
|
|
4697
|
-
border-color: dt('toggleswitch.border.color');
|
|
4698
|
-
background: dt('toggleswitch.background');
|
|
4699
|
-
transition:
|
|
4700
|
-
background dt('toggleswitch.transition.duration'),
|
|
4701
|
-
color dt('toggleswitch.transition.duration'),
|
|
4702
|
-
border-color dt('toggleswitch.transition.duration'),
|
|
4703
|
-
outline-color dt('toggleswitch.transition.duration'),
|
|
4704
|
-
box-shadow dt('toggleswitch.transition.duration');
|
|
4705
|
-
border-radius: dt('toggleswitch.border.radius');
|
|
4706
|
-
outline-color: transparent;
|
|
4707
|
-
box-shadow: dt('toggleswitch.shadow');
|
|
4708
|
-
}
|
|
4709
|
-
|
|
4710
|
-
.p-toggleswitch-handle {
|
|
4711
|
-
position: absolute;
|
|
4712
|
-
top: 50%;
|
|
4713
|
-
display: flex;
|
|
4714
|
-
justify-content: center;
|
|
4715
|
-
align-items: center;
|
|
4716
|
-
background: dt('toggleswitch.handle.background');
|
|
4717
|
-
color: dt('toggleswitch.handle.color');
|
|
4718
|
-
width: dt('toggleswitch.handle.size');
|
|
4719
|
-
height: dt('toggleswitch.handle.size');
|
|
4720
|
-
inset-inline-start: dt('toggleswitch.gap');
|
|
4721
|
-
margin-block-start: calc(-1 * calc(dt('toggleswitch.handle.size') / 2));
|
|
4722
|
-
border-radius: dt('toggleswitch.handle.border.radius');
|
|
4723
|
-
transition:
|
|
4724
|
-
background dt('toggleswitch.transition.duration'),
|
|
4725
|
-
color dt('toggleswitch.transition.duration'),
|
|
4726
|
-
inset-inline-start dt('toggleswitch.slide.duration'),
|
|
4727
|
-
box-shadow dt('toggleswitch.slide.duration');
|
|
4728
|
-
}
|
|
4729
|
-
|
|
4730
|
-
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {
|
|
4731
|
-
background: dt('toggleswitch.checked.background');
|
|
4732
|
-
border-color: dt('toggleswitch.checked.border.color');
|
|
4733
|
-
}
|
|
4734
|
-
|
|
4735
|
-
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-handle {
|
|
4736
|
-
background: dt('toggleswitch.handle.checked.background');
|
|
4737
|
-
color: dt('toggleswitch.handle.checked.color');
|
|
4738
|
-
inset-inline-start: calc(dt('toggleswitch.width') - calc(dt('toggleswitch.handle.size') + dt('toggleswitch.gap')));
|
|
4739
|
-
}
|
|
4740
|
-
|
|
4741
|
-
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {
|
|
4742
|
-
background: dt('toggleswitch.hover.background');
|
|
4743
|
-
border-color: dt('toggleswitch.hover.border.color');
|
|
4744
|
-
}
|
|
4745
|
-
|
|
4746
|
-
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-handle {
|
|
4747
|
-
background: dt('toggleswitch.handle.hover.background');
|
|
4748
|
-
color: dt('toggleswitch.handle.hover.color');
|
|
4749
|
-
}
|
|
4750
|
-
|
|
4751
|
-
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider {
|
|
4752
|
-
background: dt('toggleswitch.checked.hover.background');
|
|
4753
|
-
border-color: dt('toggleswitch.checked.hover.border.color');
|
|
4754
|
-
}
|
|
4755
|
-
|
|
4756
|
-
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-handle {
|
|
4757
|
-
background: dt('toggleswitch.handle.checked.hover.background');
|
|
4758
|
-
color: dt('toggleswitch.handle.checked.hover.color');
|
|
4759
|
-
}
|
|
4760
|
-
|
|
4761
|
-
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {
|
|
4762
|
-
box-shadow: dt('toggleswitch.focus.ring.shadow');
|
|
4763
|
-
outline: dt('toggleswitch.focus.ring.width') dt('toggleswitch.focus.ring.style') dt('toggleswitch.focus.ring.color');
|
|
4764
|
-
outline-offset: dt('toggleswitch.focus.ring.offset');
|
|
4765
|
-
}
|
|
4766
|
-
|
|
4767
|
-
.p-toggleswitch.p-invalid > .p-toggleswitch-slider {
|
|
4768
|
-
border-color: dt('toggleswitch.invalid.border.color');
|
|
4769
|
-
}
|
|
4770
|
-
|
|
4771
|
-
.p-toggleswitch.p-disabled {
|
|
4772
|
-
opacity: 1;
|
|
4773
|
-
}
|
|
4774
|
-
|
|
4775
|
-
.p-toggleswitch.p-disabled .p-toggleswitch-slider {
|
|
4776
|
-
background: dt('toggleswitch.disabled.background');
|
|
4777
|
-
}
|
|
4778
|
-
|
|
4779
|
-
.p-toggleswitch.p-disabled .p-toggleswitch-handle {
|
|
4780
|
-
background: dt('toggleswitch.handle.disabled.background');
|
|
4781
|
-
}
|
|
4782
|
-
`,cZ={root:{position:"relative"}},dZ={root:function(i){var a=i.instance,r=i.props;return["p-toggleswitch p-component",{"p-toggleswitch-checked":a.checked,"p-disabled":r.disabled,"p-invalid":a.$invalid}]},input:"p-toggleswitch-input",slider:"p-toggleswitch-slider",handle:"p-toggleswitch-handle"},pZ=et.extend({name:"toggleswitch",style:sZ,classes:dZ,inlineStyles:cZ}),uZ={name:"BaseToggleSwitch",extends:u2,props:{trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},readonly:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:pZ,provide:function(){return{$pcToggleSwitch:this,$parentInstance:this}}},h9={name:"ToggleSwitch",extends:uZ,inheritAttrs:!1,emits:["change","focus","blur"],methods:{getPTOptions:function(i){var a=i==="root"?this.ptmi:this.ptm;return a(i,{context:{checked:this.checked,disabled:this.disabled}})},onChange:function(i){if(!this.disabled&&!this.readonly){var a=this.checked?this.falseValue:this.trueValue;this.writeValue(a,i),this.$emit("change",i)}},onFocus:function(i){this.$emit("focus",i)},onBlur:function(i){var a,r;this.$emit("blur",i),(a=(r=this.formField).onBlur)===null||a===void 0||a.call(r,i)}},computed:{checked:function(){return this.d_value===this.trueValue},dataP:function(){return co({checked:this.checked,disabled:this.disabled,invalid:this.$invalid})}}},fZ=["data-p-checked","data-p-disabled","data-p"],mZ=["id","checked","tabindex","disabled","readonly","aria-checked","aria-labelledby","aria-label","aria-invalid"],hZ=["data-p"],bZ=["data-p"];function gZ(o,i,a,r,s,c){return l.openBlock(),l.createElementBlock("div",l.mergeProps({class:o.cx("root"),style:o.sx("root")},c.getPTOptions("root"),{"data-p-checked":c.checked,"data-p-disabled":o.disabled,"data-p":c.dataP}),[l.createElementVNode("input",l.mergeProps({id:o.inputId,type:"checkbox",role:"switch",class:[o.cx("input"),o.inputClass],style:o.inputStyle,checked:c.checked,tabindex:o.tabindex,disabled:o.disabled,readonly:o.readonly,"aria-checked":c.checked,"aria-labelledby":o.ariaLabelledby,"aria-label":o.ariaLabel,"aria-invalid":o.invalid||void 0,onFocus:i[0]||(i[0]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)}),onBlur:i[1]||(i[1]=function(){return c.onBlur&&c.onBlur.apply(c,arguments)}),onChange:i[2]||(i[2]=function(){return c.onChange&&c.onChange.apply(c,arguments)})},c.getPTOptions("input")),null,16,mZ),l.createElementVNode("div",l.mergeProps({class:o.cx("slider")},c.getPTOptions("slider"),{"data-p":c.dataP}),[l.createElementVNode("div",l.mergeProps({class:o.cx("handle")},c.getPTOptions("handle"),{"data-p":c.dataP}),[l.renderSlot(o.$slots,"handle",{checked:c.checked})],16,bZ)],16,hZ)],16,fZ)}h9.render=gZ;var yZ=Ht`
|
|
4783
4669
|
.p-radiobutton {
|
|
4784
4670
|
position: relative;
|
|
4785
4671
|
display: inline-flex;
|
|
@@ -4923,7 +4809,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4923
4809
|
width: dt('radiobutton.icon.lg.size');
|
|
4924
4810
|
height: dt('radiobutton.icon.lg.size');
|
|
4925
4811
|
}
|
|
4926
|
-
`,
|
|
4812
|
+
`,cZ={root:function(i){var a=i.instance,r=i.props;return["p-radiobutton p-component",{"p-radiobutton-checked":a.checked,"p-disabled":r.disabled,"p-invalid":a.$pcRadioButtonGroup?a.$pcRadioButtonGroup.$invalid:a.$invalid,"p-variant-filled":a.$variant==="filled","p-radiobutton-sm p-inputfield-sm":r.size==="small","p-radiobutton-lg p-inputfield-lg":r.size==="large"}]},box:"p-radiobutton-box",input:"p-radiobutton-input",icon:"p-radiobutton-icon"},dZ=et.extend({name:"radiobutton",style:sZ,classes:cZ}),pZ={name:"BaseRadioButton",extends:Ql,props:{value:null,binary:Boolean,readonly:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:dZ,provide:function(){return{$pcRadioButton:this,$parentInstance:this}}};function fr(o){"@babel/helpers - typeof";return fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},fr(o)}function uZ(o,i,a){return(i=fZ(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}function fZ(o){var i=mZ(o,"string");return fr(i)=="symbol"?i:i+""}function mZ(o,i){if(fr(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var r=a.call(o,i);if(fr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}var h9={name:"RadioButton",extends:pZ,inheritAttrs:!1,emits:["change","focus","blur"],inject:{$pcRadioButtonGroup:{default:void 0}},methods:{getPTOptions:function(i){var a=i==="root"?this.ptmi:this.ptm;return a(i,{context:{checked:this.checked,disabled:this.disabled}})},onChange:function(i){if(!this.disabled&&!this.readonly){var a=this.binary?!this.checked:this.value;this.$pcRadioButtonGroup?this.$pcRadioButtonGroup.writeValue(a,i):this.writeValue(a,i),this.$emit("change",i)}},onFocus:function(i){this.$emit("focus",i)},onBlur:function(i){var a,r;this.$emit("blur",i),(a=(r=this.formField).onBlur)===null||a===void 0||a.call(r,i)}},computed:{groupName:function(){return this.$pcRadioButtonGroup?this.$pcRadioButtonGroup.groupName:this.$formName},checked:function(){var i=this.$pcRadioButtonGroup?this.$pcRadioButtonGroup.d_value:this.d_value;return i!=null&&(this.binary?!!i:Zl(i,this.value))},dataP:function(){return co(uZ({invalid:this.$invalid,checked:this.checked,disabled:this.disabled,filled:this.$variant==="filled"},this.size,this.size))}}},hZ=["data-p-checked","data-p-disabled","data-p"],bZ=["id","value","name","checked","tabindex","disabled","readonly","aria-labelledby","aria-label","aria-invalid"],gZ=["data-p"],yZ=["data-p"];function vZ(o,i,a,r,s,c){return l.openBlock(),l.createElementBlock("div",l.mergeProps({class:o.cx("root")},c.getPTOptions("root"),{"data-p-checked":c.checked,"data-p-disabled":o.disabled,"data-p":c.dataP}),[l.createElementVNode("input",l.mergeProps({id:o.inputId,type:"radio",class:[o.cx("input"),o.inputClass],style:o.inputStyle,value:o.value,name:c.groupName,checked:c.checked,tabindex:o.tabindex,disabled:o.disabled,readonly:o.readonly,"aria-labelledby":o.ariaLabelledby,"aria-label":o.ariaLabel,"aria-invalid":o.invalid||void 0,onFocus:i[0]||(i[0]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)}),onBlur:i[1]||(i[1]=function(){return c.onBlur&&c.onBlur.apply(c,arguments)}),onChange:i[2]||(i[2]=function(){return c.onChange&&c.onChange.apply(c,arguments)})},c.getPTOptions("input")),null,16,bZ),l.createElementVNode("div",l.mergeProps({class:o.cx("box")},c.getPTOptions("box"),{"data-p":c.dataP}),[l.createElementVNode("div",l.mergeProps({class:o.cx("icon")},c.getPTOptions("icon"),{"data-p":c.dataP}),null,16,yZ)],16,gZ)],16,hZ)}h9.render=vZ;var wZ=Ht`
|
|
4927
4813
|
.p-slider {
|
|
4928
4814
|
position: relative;
|
|
4929
4815
|
background: dt('slider.track.background');
|
|
@@ -5013,8 +4899,122 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5013
4899
|
inset-inline-start: 0;
|
|
5014
4900
|
width: 100%;
|
|
5015
4901
|
}
|
|
5016
|
-
`,
|
|
5017
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
4902
|
+
`,CZ={handle:{position:"absolute"},range:{position:"absolute"}},kZ={root:function(i){var a=i.instance,r=i.props;return["p-slider p-component",{"p-disabled":r.disabled,"p-invalid":a.$invalid,"p-slider-horizontal":r.orientation==="horizontal","p-slider-vertical":r.orientation==="vertical"}]},range:"p-slider-range",handle:"p-slider-handle"},xZ=et.extend({name:"slider",style:wZ,classes:kZ,inlineStyles:CZ}),_Z={name:"BaseSlider",extends:u2,props:{min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:xZ,provide:function(){return{$pcSlider:this,$parentInstance:this}}};function mr(o){"@babel/helpers - typeof";return mr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},mr(o)}function IZ(o,i,a){return(i=SZ(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}function SZ(o){var i=AZ(o,"string");return mr(i)=="symbol"?i:i+""}function AZ(o,i){if(mr(o)!="object"||!o)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var r=a.call(o,i);if(mr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}function TZ(o){return RZ(o)||OZ(o)||DZ(o)||EZ()}function EZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4903
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DZ(o,i){if(o){if(typeof o=="string")return C2(o,i);var a={}.toString.call(o).slice(8,-1);return a==="Object"&&o.constructor&&(a=o.constructor.name),a==="Map"||a==="Set"?Array.from(o):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?C2(o,i):void 0}}function OZ(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function RZ(o){if(Array.isArray(o))return C2(o)}function C2(o,i){(i==null||i>o.length)&&(i=o.length);for(var a=0,r=Array(i);a<i;a++)r[a]=o[a];return r}var b9={name:"Slider",extends:_Z,inheritAttrs:!1,emits:["change","slideend"],dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount:function(){this.unbindDragListeners()},methods:{updateDomData:function(){var i=this.$el.getBoundingClientRect();this.initX=i.left+Xp(),this.initY=i.top+Qp(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue:function(i){var a,r=i.touches?i.touches[0].pageX:i.pageX,s=i.touches?i.touches[0].pageY:i.pageY;this.orientation==="horizontal"?nb(this.$el)?a=(this.initX+this.barWidth-r)*100/this.barWidth:a=(r-this.initX)*100/this.barWidth:a=(this.initY+this.barHeight-s)*100/this.barHeight;var c=(this.max-this.min)*(a/100)+this.min;if(this.step){var p=this.range?this.value[this.handleIndex]:this.value,f=c-p;f<0?c=p+Math.ceil(c/this.step-p/this.step)*this.step:f>0&&(c=p+Math.floor(c/this.step-p/this.step)*this.step)}else c=Math.floor(c);this.updateModel(i,c)},updateModel:function(i,a){var r=Math.round(a*100)/100,s;this.range?(s=this.value?TZ(this.value):[],this.handleIndex==0?(r<this.min?r=this.min:r>=this.max&&(r=this.max),s[0]=r):(r>this.max?r=this.max:r<=this.min&&(r=this.min),s[1]=r)):(r<this.min?r=this.min:r>this.max&&(r=this.max),s=r),this.writeValue(s,i),this.$emit("change",s)},onDragStart:function(i,a){this.disabled||(this.$el.setAttribute("data-p-sliding",!0),this.dragging=!0,this.updateDomData(),this.range&&this.value[0]===this.max?this.handleIndex=0:this.handleIndex=a,i.currentTarget.focus())},onDrag:function(i){this.dragging&&this.setValue(i)},onDragEnd:function(i){this.dragging&&(this.dragging=!1,this.$el.setAttribute("data-p-sliding",!1),this.$emit("slideend",{originalEvent:i,value:this.value}))},onBarClick:function(i){this.disabled||ji(i.target,"data-pc-section")!=="handle"&&(this.updateDomData(),this.setValue(i))},onMouseDown:function(i,a){this.bindDragListeners(),this.onDragStart(i,a)},onKeyDown:function(i,a){switch(this.handleIndex=a,i.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(i,a),i.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(i,a),i.preventDefault();break;case"PageDown":this.decrementValue(i,a,!0),i.preventDefault();break;case"PageUp":this.incrementValue(i,a,!0),i.preventDefault();break;case"Home":this.updateModel(i,this.min),i.preventDefault();break;case"End":this.updateModel(i,this.max),i.preventDefault();break}},onBlur:function(i,a){var r,s;(r=(s=this.formField).onBlur)===null||r===void 0||r.call(s,i)},decrementValue:function(i,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s;this.range?this.step?s=this.value[a]-this.step:s=this.value[a]-1:this.step?s=this.value-this.step:!this.step&&r?s=this.value-10:s=this.value-1,this.updateModel(i,s),i.preventDefault()},incrementValue:function(i,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s;this.range?this.step?s=this.value[a]+this.step:s=this.value[a]+1:this.step?s=this.value+this.step:!this.step&&r?s=this.value+10:s=this.value+1,this.updateModel(i,s),i.preventDefault()},bindDragListeners:function(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners:function(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)},rangeStyle:function(){if(this.range){var i=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,a=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{"inset-inline-start":a+"%",width:i+"%"}:{bottom:a+"%",height:i+"%"}}else return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle:function(){return this.horizontal?{"inset-inline-start":this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},rangeStartHandleStyle:function(){return this.horizontal?{"inset-inline-start":this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle:function(){return this.horizontal?{"inset-inline-start":this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}},computed:{value:function(){var i;if(this.range){var a,r,s,c;return[(a=(r=this.d_value)===null||r===void 0?void 0:r[0])!==null&&a!==void 0?a:this.min,(s=(c=this.d_value)===null||c===void 0?void 0:c[1])!==null&&s!==void 0?s:this.max]}return(i=this.d_value)!==null&&i!==void 0?i:this.min},horizontal:function(){return this.orientation==="horizontal"},vertical:function(){return this.orientation==="vertical"},handlePosition:function(){return this.value<this.min?0:this.value>this.max?100:(this.value-this.min)*100/(this.max-this.min)},rangeStartPosition:function(){return this.value&&this.value[0]!==void 0?this.value[0]<this.min?0:(this.value[0]-this.min)*100/(this.max-this.min):0},rangeEndPosition:function(){return this.value&&this.value.length===2&&this.value[1]!==void 0?this.value[1]>this.max?100:(this.value[1]-this.min)*100/(this.max-this.min):100},dataP:function(){return co(IZ({},this.orientation,this.orientation))}}},BZ=["data-p"],LZ=["data-p"],NZ=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation","data-p"],PZ=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation","data-p"],$Z=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation","data-p"];function MZ(o,i,a,r,s,c){return l.openBlock(),l.createElementBlock("div",l.mergeProps({class:o.cx("root"),onClick:i[18]||(i[18]=function(){return c.onBarClick&&c.onBarClick.apply(c,arguments)})},o.ptmi("root"),{"data-p-sliding":!1,"data-p":c.dataP}),[l.createElementVNode("span",l.mergeProps({class:o.cx("range"),style:[o.sx("range"),c.rangeStyle()]},o.ptm("range"),{"data-p":c.dataP}),null,16,LZ),o.range?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:0,class:o.cx("handle"),style:[o.sx("handle"),c.handleStyle()],onTouchstartPassive:i[0]||(i[0]=function(p){return c.onDragStart(p)}),onTouchmovePassive:i[1]||(i[1]=function(p){return c.onDrag(p)}),onTouchend:i[2]||(i[2]=function(p){return c.onDragEnd(p)}),onMousedown:i[3]||(i[3]=function(p){return c.onMouseDown(p)}),onKeydown:i[4]||(i[4]=function(p){return c.onKeyDown(p)}),onBlur:i[5]||(i[5]=function(p){return c.onBlur(p)}),tabindex:o.tabindex,role:"slider","aria-valuemin":o.min,"aria-valuenow":o.d_value,"aria-valuemax":o.max,"aria-labelledby":o.ariaLabelledby,"aria-label":o.ariaLabel,"aria-orientation":o.orientation},o.ptm("handle"),{"data-p":c.dataP}),null,16,NZ)),o.range?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:1,class:o.cx("handle"),style:[o.sx("handle"),c.rangeStartHandleStyle()],onTouchstartPassive:i[6]||(i[6]=function(p){return c.onDragStart(p,0)}),onTouchmovePassive:i[7]||(i[7]=function(p){return c.onDrag(p)}),onTouchend:i[8]||(i[8]=function(p){return c.onDragEnd(p)}),onMousedown:i[9]||(i[9]=function(p){return c.onMouseDown(p,0)}),onKeydown:i[10]||(i[10]=function(p){return c.onKeyDown(p,0)}),onBlur:i[11]||(i[11]=function(p){return c.onBlur(p,0)}),tabindex:o.tabindex,role:"slider","aria-valuemin":o.min,"aria-valuenow":o.d_value?o.d_value[0]:null,"aria-valuemax":o.max,"aria-labelledby":o.ariaLabelledby,"aria-label":o.ariaLabel,"aria-orientation":o.orientation},o.ptm("startHandler"),{"data-p":c.dataP}),null,16,PZ)):l.createCommentVNode("",!0),o.range?(l.openBlock(),l.createElementBlock("span",l.mergeProps({key:2,class:o.cx("handle"),style:[o.sx("handle"),c.rangeEndHandleStyle()],onTouchstartPassive:i[12]||(i[12]=function(p){return c.onDragStart(p,1)}),onTouchmovePassive:i[13]||(i[13]=function(p){return c.onDrag(p)}),onTouchend:i[14]||(i[14]=function(p){return c.onDragEnd(p)}),onMousedown:i[15]||(i[15]=function(p){return c.onMouseDown(p,1)}),onKeydown:i[16]||(i[16]=function(p){return c.onKeyDown(p,1)}),onBlur:i[17]||(i[17]=function(p){return c.onBlur(p,1)}),tabindex:o.tabindex,role:"slider","aria-valuemin":o.min,"aria-valuenow":o.d_value?o.d_value[1]:null,"aria-valuemax":o.max,"aria-labelledby":o.ariaLabelledby,"aria-label":o.ariaLabel,"aria-orientation":o.orientation},o.ptm("endHandler"),{"data-p":c.dataP}),null,16,$Z)):l.createCommentVNode("",!0)],16,BZ)}b9.render=MZ;var jZ=Ht`
|
|
4904
|
+
.p-toggleswitch {
|
|
4905
|
+
display: inline-block;
|
|
4906
|
+
width: dt('toggleswitch.width');
|
|
4907
|
+
height: dt('toggleswitch.height');
|
|
4908
|
+
}
|
|
4909
|
+
|
|
4910
|
+
.p-toggleswitch-input {
|
|
4911
|
+
cursor: pointer;
|
|
4912
|
+
appearance: none;
|
|
4913
|
+
position: absolute;
|
|
4914
|
+
top: 0;
|
|
4915
|
+
inset-inline-start: 0;
|
|
4916
|
+
width: 100%;
|
|
4917
|
+
height: 100%;
|
|
4918
|
+
padding: 0;
|
|
4919
|
+
margin: 0;
|
|
4920
|
+
opacity: 0;
|
|
4921
|
+
z-index: 1;
|
|
4922
|
+
outline: 0 none;
|
|
4923
|
+
border-radius: dt('toggleswitch.border.radius');
|
|
4924
|
+
}
|
|
4925
|
+
|
|
4926
|
+
.p-toggleswitch-slider {
|
|
4927
|
+
cursor: pointer;
|
|
4928
|
+
width: 100%;
|
|
4929
|
+
height: 100%;
|
|
4930
|
+
border-width: dt('toggleswitch.border.width');
|
|
4931
|
+
border-style: solid;
|
|
4932
|
+
border-color: dt('toggleswitch.border.color');
|
|
4933
|
+
background: dt('toggleswitch.background');
|
|
4934
|
+
transition:
|
|
4935
|
+
background dt('toggleswitch.transition.duration'),
|
|
4936
|
+
color dt('toggleswitch.transition.duration'),
|
|
4937
|
+
border-color dt('toggleswitch.transition.duration'),
|
|
4938
|
+
outline-color dt('toggleswitch.transition.duration'),
|
|
4939
|
+
box-shadow dt('toggleswitch.transition.duration');
|
|
4940
|
+
border-radius: dt('toggleswitch.border.radius');
|
|
4941
|
+
outline-color: transparent;
|
|
4942
|
+
box-shadow: dt('toggleswitch.shadow');
|
|
4943
|
+
}
|
|
4944
|
+
|
|
4945
|
+
.p-toggleswitch-handle {
|
|
4946
|
+
position: absolute;
|
|
4947
|
+
top: 50%;
|
|
4948
|
+
display: flex;
|
|
4949
|
+
justify-content: center;
|
|
4950
|
+
align-items: center;
|
|
4951
|
+
background: dt('toggleswitch.handle.background');
|
|
4952
|
+
color: dt('toggleswitch.handle.color');
|
|
4953
|
+
width: dt('toggleswitch.handle.size');
|
|
4954
|
+
height: dt('toggleswitch.handle.size');
|
|
4955
|
+
inset-inline-start: dt('toggleswitch.gap');
|
|
4956
|
+
margin-block-start: calc(-1 * calc(dt('toggleswitch.handle.size') / 2));
|
|
4957
|
+
border-radius: dt('toggleswitch.handle.border.radius');
|
|
4958
|
+
transition:
|
|
4959
|
+
background dt('toggleswitch.transition.duration'),
|
|
4960
|
+
color dt('toggleswitch.transition.duration'),
|
|
4961
|
+
inset-inline-start dt('toggleswitch.slide.duration'),
|
|
4962
|
+
box-shadow dt('toggleswitch.slide.duration');
|
|
4963
|
+
}
|
|
4964
|
+
|
|
4965
|
+
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {
|
|
4966
|
+
background: dt('toggleswitch.checked.background');
|
|
4967
|
+
border-color: dt('toggleswitch.checked.border.color');
|
|
4968
|
+
}
|
|
4969
|
+
|
|
4970
|
+
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-handle {
|
|
4971
|
+
background: dt('toggleswitch.handle.checked.background');
|
|
4972
|
+
color: dt('toggleswitch.handle.checked.color');
|
|
4973
|
+
inset-inline-start: calc(dt('toggleswitch.width') - calc(dt('toggleswitch.handle.size') + dt('toggleswitch.gap')));
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4976
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {
|
|
4977
|
+
background: dt('toggleswitch.hover.background');
|
|
4978
|
+
border-color: dt('toggleswitch.hover.border.color');
|
|
4979
|
+
}
|
|
4980
|
+
|
|
4981
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-handle {
|
|
4982
|
+
background: dt('toggleswitch.handle.hover.background');
|
|
4983
|
+
color: dt('toggleswitch.handle.hover.color');
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4986
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider {
|
|
4987
|
+
background: dt('toggleswitch.checked.hover.background');
|
|
4988
|
+
border-color: dt('toggleswitch.checked.hover.border.color');
|
|
4989
|
+
}
|
|
4990
|
+
|
|
4991
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-handle {
|
|
4992
|
+
background: dt('toggleswitch.handle.checked.hover.background');
|
|
4993
|
+
color: dt('toggleswitch.handle.checked.hover.color');
|
|
4994
|
+
}
|
|
4995
|
+
|
|
4996
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {
|
|
4997
|
+
box-shadow: dt('toggleswitch.focus.ring.shadow');
|
|
4998
|
+
outline: dt('toggleswitch.focus.ring.width') dt('toggleswitch.focus.ring.style') dt('toggleswitch.focus.ring.color');
|
|
4999
|
+
outline-offset: dt('toggleswitch.focus.ring.offset');
|
|
5000
|
+
}
|
|
5001
|
+
|
|
5002
|
+
.p-toggleswitch.p-invalid > .p-toggleswitch-slider {
|
|
5003
|
+
border-color: dt('toggleswitch.invalid.border.color');
|
|
5004
|
+
}
|
|
5005
|
+
|
|
5006
|
+
.p-toggleswitch.p-disabled {
|
|
5007
|
+
opacity: 1;
|
|
5008
|
+
}
|
|
5009
|
+
|
|
5010
|
+
.p-toggleswitch.p-disabled .p-toggleswitch-slider {
|
|
5011
|
+
background: dt('toggleswitch.disabled.background');
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
.p-toggleswitch.p-disabled .p-toggleswitch-handle {
|
|
5015
|
+
background: dt('toggleswitch.handle.disabled.background');
|
|
5016
|
+
}
|
|
5017
|
+
`,qZ={root:{position:"relative"}},FZ={root:function(i){var a=i.instance,r=i.props;return["p-toggleswitch p-component",{"p-toggleswitch-checked":a.checked,"p-disabled":r.disabled,"p-invalid":a.$invalid}]},input:"p-toggleswitch-input",slider:"p-toggleswitch-slider",handle:"p-toggleswitch-handle"},VZ=et.extend({name:"toggleswitch",style:jZ,classes:FZ,inlineStyles:qZ}),UZ={name:"BaseToggleSwitch",extends:u2,props:{trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},readonly:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:VZ,provide:function(){return{$pcToggleSwitch:this,$parentInstance:this}}},g9={name:"ToggleSwitch",extends:UZ,inheritAttrs:!1,emits:["change","focus","blur"],methods:{getPTOptions:function(i){var a=i==="root"?this.ptmi:this.ptm;return a(i,{context:{checked:this.checked,disabled:this.disabled}})},onChange:function(i){if(!this.disabled&&!this.readonly){var a=this.checked?this.falseValue:this.trueValue;this.writeValue(a,i),this.$emit("change",i)}},onFocus:function(i){this.$emit("focus",i)},onBlur:function(i){var a,r;this.$emit("blur",i),(a=(r=this.formField).onBlur)===null||a===void 0||a.call(r,i)}},computed:{checked:function(){return this.d_value===this.trueValue},dataP:function(){return co({checked:this.checked,disabled:this.disabled,invalid:this.$invalid})}}},zZ=["data-p-checked","data-p-disabled","data-p"],HZ=["id","checked","tabindex","disabled","readonly","aria-checked","aria-labelledby","aria-label","aria-invalid"],WZ=["data-p"],ZZ=["data-p"];function YZ(o,i,a,r,s,c){return l.openBlock(),l.createElementBlock("div",l.mergeProps({class:o.cx("root"),style:o.sx("root")},c.getPTOptions("root"),{"data-p-checked":c.checked,"data-p-disabled":o.disabled,"data-p":c.dataP}),[l.createElementVNode("input",l.mergeProps({id:o.inputId,type:"checkbox",role:"switch",class:[o.cx("input"),o.inputClass],style:o.inputStyle,checked:c.checked,tabindex:o.tabindex,disabled:o.disabled,readonly:o.readonly,"aria-checked":c.checked,"aria-labelledby":o.ariaLabelledby,"aria-label":o.ariaLabel,"aria-invalid":o.invalid||void 0,onFocus:i[0]||(i[0]=function(){return c.onFocus&&c.onFocus.apply(c,arguments)}),onBlur:i[1]||(i[1]=function(){return c.onBlur&&c.onBlur.apply(c,arguments)}),onChange:i[2]||(i[2]=function(){return c.onChange&&c.onChange.apply(c,arguments)})},c.getPTOptions("input")),null,16,HZ),l.createElementVNode("div",l.mergeProps({class:o.cx("slider")},c.getPTOptions("slider"),{"data-p":c.dataP}),[l.createElementVNode("div",l.mergeProps({class:o.cx("handle")},c.getPTOptions("handle"),{"data-p":c.dataP}),[l.renderSlot(o.$slots,"handle",{checked:c.checked})],16,ZZ)],16,WZ)],16,zZ)}g9.render=YZ;var KZ=Ht`
|
|
5018
5018
|
.p-tooltip {
|
|
5019
5019
|
position: absolute;
|
|
5020
5020
|
display: none;
|
|
@@ -5215,14 +5215,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5215
5215
|
width: ${o("chip.removeIcon.size")};
|
|
5216
5216
|
height: ${o("chip.removeIcon.size")};
|
|
5217
5217
|
}
|
|
5218
|
-
`},Nie={...F9.sizes,colorScheme:F9.colorScheme},Pie={...P9.sizes,colorScheme:P9.colorScheme},$ie={...
|
|
5218
|
+
`},Nie={...F9.sizes,colorScheme:F9.colorScheme},Pie={...P9.sizes,colorScheme:P9.colorScheme},$ie={...z9.sizes,colorScheme:z9.colorScheme,css:({dt:o})=>`
|
|
5219
5219
|
.p-radiobutton {
|
|
5220
5220
|
width: ${o("radiobutton.root.wrapperWidth")};
|
|
5221
5221
|
height: ${o("radiobutton.root.wrapperHeight")};
|
|
5222
5222
|
align-items: center;
|
|
5223
5223
|
justify-content: center;
|
|
5224
5224
|
}
|
|
5225
|
-
`},
|
|
5225
|
+
`},Mie={...V9.sizes,colorScheme:V9.colorScheme},jie={...q9.sizes,colorScheme:q9.colorScheme},qie={...$9.sizes,colorScheme:$9.colorScheme,css:({dt:o})=>`
|
|
5226
5226
|
.p-tooltip-text {
|
|
5227
5227
|
white-space: pre-line;
|
|
5228
5228
|
word-break: normal;
|
|
@@ -5232,5 +5232,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5232
5232
|
box-shadow: ${o("tooltip.shadow")};
|
|
5233
5233
|
border-radius: ${o("tooltip.border.radius")};
|
|
5234
5234
|
}
|
|
5235
|
-
`},Fie=lY(Iie,{semantic:Eie,components:{button:Rie,autocomplete:Die,popover:Pie,tooltip:qie,chip:Lie,checkbox:Bie,toggleswitch:$ie,breadcrumb:Oie,slider:jie,divider:Nie,radiobutton:Mie},extend:{spacings:{multiplicator:"8px","3xs":"calc({spacings.multiplicator} / 4)","2xs":"calc({spacings.multiplicator} / 2)",xs:"calc({spacings.multiplicator} * 1)",sm:"calc({spacings.multiplicator} * 2)",md:"calc({spacings.multiplicator} * 3)",lg:"calc({spacings.multiplicator} * 4)",xl:"calc({spacings.multiplicator} * 5)","2xl":"calc({spacings.multiplicator} * 6)","3xl":"calc({spacings.multiplicator} * 7)"}}}),Mo=o=>(o.compatConfig={MODE:3},o),Vie=o=>{o.use(jW,{theme:{preset:Fie,options:{darkModeSelector:".theme--dark"}}}),o.component("PButton",Mo(r9)),o.component("PAutoComplete",Mo(Qb)),o.component("PInputText",Mo(f2)),o.component("PPopover",Mo(m9)),o.component("PCheckbox",Mo(c9)),o.component("PRadio",Mo(b9)),o.component("PChip",Mo(p2)),o.component("PToggleSwitch",Mo(h9)),o.component("PBreadcrumb",Mo(i9)),o.component("PSlider",Mo(g9)),o.component("PDivider",Mo(p9)),o.directive("tooltip",rY)},Uie={install(o,{eventBus:i,router:a,globals:r={}}){Object.keys(tb).forEach(s=>{o.directive(s,tb[s])}),Object.keys(G5).forEach(s=>{o.component(s,G5[s])}),Object.keys(r).forEach(s=>{o.provide(s,r[s])}),o.provide("$eventBus",i),a&&o.use(a),Vie(o)},generateInstance:I1};function Te(o,i,a){return(i=Hie(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}function zie(o,i){if(typeof o!="object"||o===null)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var r=a.call(o,i);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}function Hie(o){var i=zie(o,"string");return typeof i=="symbol"?i:String(i)}function Wie(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")}function H9(o,i){for(var a=0;a<i.length;a++){var r=i[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function Zie(o,i,a){return i&&H9(o.prototype,i),a&&H9(o,a),o}function Yie(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}function W9(o,i){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);i&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable})),a.push.apply(a,r)}return a}function Z9(o){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};i%2?W9(Object(a),!0).forEach(function(r){Yie(o,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):W9(Object(a)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(a,r))})}return o}var Y9={addCSS:!0,thumbWidth:15,watch:!0};function Kie(o,i){return(function(){return Array.from(document.querySelectorAll(i)).includes(this)}).call(o,i)}function Gie(o,i){if(o&&i){var a=new Event(i,{bubbles:!0});o.dispatchEvent(a)}}var hr=function(o){return o!=null?o.constructor:null},x2=function(o,i){return!!(o&&i&&o instanceof i)},K9=function(o){return o==null},G9=function(o){return hr(o)===Object},Xie=function(o){return hr(o)===Number&&!Number.isNaN(o)},X9=function(o){return hr(o)===String},Qie=function(o){return hr(o)===Boolean},Jie=function(o){return hr(o)===Function},Q9=function(o){return Array.isArray(o)},J9=function(o){return x2(o,NodeList)},ene=function(o){return x2(o,Element)},tne=function(o){return x2(o,Event)},one=function(o){return K9(o)||(X9(o)||Q9(o)||J9(o))&&!o.length||G9(o)&&!Object.keys(o).length},no={nullOrUndefined:K9,object:G9,number:Xie,string:X9,boolean:Qie,function:Jie,array:Q9,nodeList:J9,element:ene,event:tne,empty:one};function ine(o){var i="".concat(o).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return i?Math.max(0,(i[1]?i[1].length:0)-(i[2]?+i[2]:0)):0}function nne(o,i){if(1>i){var a=ine(i);return parseFloat(o.toFixed(a))}return Math.round(o/i)*i}var ane=function(){function o(i,a){Wie(this,o),no.element(i)?this.element=i:no.string(i)&&(this.element=document.querySelector(i)),no.element(this.element)&&no.empty(this.element.rangeTouch)&&(this.config=Z9({},Y9,{},a),this.init())}return Zie(o,[{key:"init",value:function(){o.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){o.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(i){var a=this,r=i?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(s){a.element[r](s,function(c){return a.set(c)},!1)})}},{key:"get",value:function(i){if(!o.enabled||!no.event(i))return null;var a,r=i.target,s=i.changedTouches[0],c=parseFloat(r.getAttribute("min"))||0,p=parseFloat(r.getAttribute("max"))||100,f=parseFloat(r.getAttribute("step"))||1,h=r.getBoundingClientRect(),b=100/h.width*(this.config.thumbWidth/2)/100;return 0>(a=100/h.width*(s.clientX-h.left))?a=0:100<a&&(a=100),50>a?a-=(100-2*a)*b:50<a&&(a+=2*(a-50)*b),c+nne(a/100*(p-c),f)}},{key:"set",value:function(i){o.enabled&&no.event(i)&&!i.target.disabled&&(i.preventDefault(),i.target.value=this.get(i),Gie(i.target,i.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(i){var a=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},r=null;if(no.empty(i)||no.string(i)?r=Array.from(document.querySelectorAll(no.string(i)?i:'input[type="range"]')):no.element(i)?r=[i]:no.nodeList(i)?r=Array.from(i):no.array(i)&&(r=i.filter(no.element)),no.empty(r))return null;var s=Z9({},Y9,{},a);if(no.string(i)&&s.watch){var c=new MutationObserver(function(p){Array.from(p).forEach(function(f){Array.from(f.addedNodes).forEach(function(h){no.element(h)&&Kie(h,i)&&new o(h,s)})})});c.observe(document.body,{childList:!0,subtree:!0})}return r.map(function(p){return new o(p,a)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),o}();const br=o=>o!=null?o.constructor:null,Ii=(o,i)=>!!(o&&i&&o instanceof i),_2=o=>o==null,e6=o=>br(o)===Object,rne=o=>br(o)===Number&&!Number.isNaN(o),es=o=>br(o)===String,lne=o=>br(o)===Boolean,t6=o=>typeof o=="function",o6=o=>Array.isArray(o),sne=o=>Ii(o,WeakMap),i6=o=>Ii(o,NodeList),cne=o=>br(o)===Text,dne=o=>Ii(o,Event),pne=o=>Ii(o,KeyboardEvent),une=o=>Ii(o,window.TextTrackCue)||Ii(o,window.VTTCue),fne=o=>Ii(o,TextTrack)||!_2(o)&&es(o.kind),mne=o=>Ii(o,Promise)&&t6(o.then),hne=o=>o!==null&&typeof o=="object"&&o.nodeType===1&&typeof o.style=="object"&&typeof o.ownerDocument=="object",n6=o=>_2(o)||(es(o)||o6(o)||i6(o))&&!o.length||e6(o)&&!Object.keys(o).length;var z={nullOrUndefined:_2,object:e6,number:rne,string:es,boolean:lne,function:t6,array:o6,weakMap:sne,nodeList:i6,element:hne,textNode:cne,event:dne,keyboardEvent:pne,cue:une,track:fne,promise:mne,url:o=>{if(Ii(o,window.URL))return!0;if(!es(o))return!1;let i=o;o.startsWith("http://")&&o.startsWith("https://")||(i=`http://${o}`);try{return!n6(new URL(i).hostname)}catch{return!1}},empty:n6};const I2=(()=>{const o=document.createElement("span"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},a=Object.keys(i).find(r=>o.style[r]!==void 0);return!!z.string(a)&&i[a]})();function a6(o,i){setTimeout(()=>{try{o.hidden=!0,o.offsetHeight,o.hidden=!1}catch{}},i)}const bne=!!window.document.documentMode,gne=/Edge/g.test(navigator.userAgent),yne="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),vne=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,wne=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Cne=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var Wt={isIE:bne,isEdge:gne,isWebKit:yne,isIPhone:vne,isIPadOS:wne,isIos:Cne};function kne(o){return JSON.parse(JSON.stringify(o))}function r6(o,i){return i.split(".").reduce((a,r)=>a&&a[r],o)}function Nt(o={},...i){if(!i.length)return o;const a=i.shift();return z.object(a)?(Object.keys(a).forEach(r=>{z.object(a[r])?(Object.keys(o).includes(r)||Object.assign(o,{[r]:{}}),Nt(o[r],a[r])):Object.assign(o,{[r]:a[r]})}),Nt(o,...i)):o}function l6(o,i){const a=o.length?o:[o];Array.from(a).reverse().forEach((r,s)=>{const c=s>0?i.cloneNode(!0):i,p=r.parentNode,f=r.nextSibling;c.appendChild(r),f?p.insertBefore(c,f):p.appendChild(c)})}function S2(o,i){z.element(o)&&!z.empty(i)&&Object.entries(i).filter(([,a])=>!z.nullOrUndefined(a)).forEach(([a,r])=>o.setAttribute(a,r))}function Ue(o,i,a){const r=document.createElement(o);return z.object(i)&&S2(r,i),z.string(a)&&(r.innerText=a),r}function xne(o,i){z.element(o)&&z.element(i)&&i.parentNode.insertBefore(o,i.nextSibling)}function s6(o,i,a,r){z.element(i)&&i.appendChild(Ue(o,a,r))}function Si(o){z.nodeList(o)||z.array(o)?Array.from(o).forEach(Si):z.element(o)&&z.element(o.parentNode)&&o.parentNode.removeChild(o)}function ts(o){if(!z.element(o))return;let{length:i}=o.childNodes;for(;i>0;)o.removeChild(o.lastChild),i-=1}function os(o,i){return z.element(i)&&z.element(i.parentNode)&&z.element(o)?(i.parentNode.replaceChild(o,i),o):null}function si(o,i){if(!z.string(o)||z.empty(o))return{};const a={},r=Nt({},i);return o.split(",").forEach(s=>{const c=s.trim(),p=c.replace(".",""),f=c.replace(/[[\]]/g,"").split("="),[h]=f,b=f.length>1?f[1].replace(/["']/g,""):"";switch(c.charAt(0)){case".":z.string(r.class)?a.class=`${r.class} ${p}`:a.class=p;break;case"#":a.id=c.replace("#","");break;case"[":a[h]=b}}),Nt(r,a)}function Tn(o,i){if(!z.element(o))return;let a=i;z.boolean(a)||(a=!o.hidden),o.hidden=a}function dt(o,i,a){if(z.nodeList(o))return Array.from(o).map(r=>dt(r,i,a));if(z.element(o)){let r="toggle";return a!==void 0&&(r=a?"add":"remove"),o.classList[r](i),o.classList.contains(i)}return!1}function is(o,i){return z.element(o)&&o.classList.contains(i)}function En(o,i){const{prototype:a}=Element;return(a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||function(){return Array.from(document.querySelectorAll(i)).includes(this)}).call(o,i)}function _ne(o,i){const{prototype:a}=Element;return(a.closest||function(){let r=this;do{if(En.matches(r,i))return r;r=r.parentElement||r.parentNode}while(r!==null&&r.nodeType===1);return null}).call(o,i)}function gr(o){return this.elements.container.querySelectorAll(o)}function Vt(o){return this.elements.container.querySelector(o)}function A2(o=null,i=!1){z.element(o)&&o.focus({preventScroll:!0,focusVisible:i})}const c6={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Pt={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(o,i){const a=Pt[o]||i!=="html5";return{api:a,ui:a&&Pt.rangeInput}},pip:!(Wt.isIPhone||!z.function(Ue("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Ue("video").disablePictureInPicture)),airplay:z.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(o){if(z.empty(o))return!1;const[i]=o.split("/");let a=o;if(!this.isHTML5||i!==this.type)return!1;Object.keys(c6).includes(a)&&(a+=`; codecs="${c6[o]}"`);try{return!!(a&&this.media.canPlayType(a).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const o=document.createElement("input");return o.type="range",o.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:I2!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Ine=(()=>{let o=!1;try{const i=Object.defineProperty({},"passive",{get:()=>(o=!0,null)});window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch{}return o})();function yr(o,i,a,r=!1,s=!0,c=!1){if(!o||!("addEventListener"in o)||z.empty(i)||!z.function(a))return;const p=i.split(" ");let f=c;Ine&&(f={passive:s,capture:c}),p.forEach(h=>{this&&this.eventListeners&&r&&this.eventListeners.push({element:o,type:h,callback:a,options:f}),o[r?"addEventListener":"removeEventListener"](h,a,f)})}function nt(o,i="",a,r=!0,s=!1){yr.call(this,o,i,a,!0,r,s)}function ns(o,i="",a,r=!0,s=!1){yr.call(this,o,i,a,!1,r,s)}function T2(o,i="",a,r=!0,s=!1){const c=(...p)=>{ns(o,i,c,r,s),a.apply(this,p)};yr.call(this,o,i,c,!0,r,s)}function ze(o,i="",a=!1,r={}){if(!z.element(o)||z.empty(i))return;const s=new CustomEvent(i,{bubbles:a,detail:{...r,plyr:this}});o.dispatchEvent(s)}function Sne(){this&&this.eventListeners&&(this.eventListeners.forEach(o=>{const{element:i,type:a,callback:r,options:s}=o;i.removeEventListener(a,r,s)}),this.eventListeners=[])}function Ane(){return new Promise(o=>this.ready?setTimeout(o,0):nt.call(this,this.elements.container,"ready",o)).then(()=>{})}function ci(o){z.promise(o)&&o.then(null,()=>{})}function E2(o){return z.array(o)?o.filter((i,a)=>o.indexOf(i)===a):o}function d6(o,i){return z.array(o)&&o.length?o.reduce((a,r)=>Math.abs(r-i)<Math.abs(a-i)?r:a):null}function p6(o){return!(!window||!window.CSS)&&window.CSS.supports(o)}const u6=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((o,[i,a])=>({...o,[i/a]:[i,a]}),{});function f6(o){return z.array(o)||z.string(o)&&o.includes(":")?(z.array(o)?o:o.split(":")).map(Number).every(z.number):!1}function as(o){if(!z.array(o)||!o.every(z.number))return null;const[i,a]=o,r=(c,p)=>p===0?c:r(p,c%p),s=r(i,a);return[i/s,a/s]}function D2(o){const i=r=>f6(r)?r.split(":").map(Number):null;let a=i(o);if(a===null&&(a=i(this.config.ratio)),a===null&&!z.empty(this.embed)&&z.array(this.embed.ratio)&&({ratio:a}=this.embed),a===null&&this.isHTML5){const{videoWidth:r,videoHeight:s}=this.media;a=[r,s]}return as(a)}function ia(o){if(!this.isVideo)return{};const{wrapper:i}=this.elements,a=D2.call(this,o);if(!z.array(a))return{};const[r,s]=as(a),c=100/r*s;if(p6(`aspect-ratio: ${r}/${s}`)?i.style.aspectRatio=`${r}/${s}`:i.style.paddingBottom=`${c}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const p=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),f=(p-c)/(p/50);this.fullscreen.active?i.style.paddingBottom=null:this.media.style.transform=`translateY(-${f}%)`}else this.isHTML5&&i.classList.add(this.config.classNames.videoFixedRatio);return{padding:c,ratio:a}}function m6(o,i,a=.05){const r=o/i,s=d6(Object.keys(u6),r);return Math.abs(s-r)<=a?u6[s]:[o,i]}function Tne(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const Hi={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(o=>{const i=o.getAttribute("type");return!!z.empty(i)||Pt.mime.call(this,i)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Hi.getSources.call(this).map(o=>Number(o.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const o=this;o.options.speed=o.config.speed.options,z.empty(this.config.ratio)||ia.call(o),Object.defineProperty(o.media,"quality",{get(){const i=Hi.getSources.call(o).find(a=>a.getAttribute("src")===o.source);return i&&Number(i.getAttribute("size"))},set(i){if(o.quality!==i){if(o.config.quality.forced&&z.function(o.config.quality.onChange))o.config.quality.onChange(i);else{const a=Hi.getSources.call(o).find(h=>Number(h.getAttribute("size"))===i);if(!a)return;const{currentTime:r,paused:s,preload:c,readyState:p,playbackRate:f}=o.media;o.media.src=a.getAttribute("src"),(c!=="none"||p)&&(o.once("loadedmetadata",()=>{o.speed=f,o.currentTime=r,s||ci(o.play())}),o.media.load())}ze.call(o,o.media,"qualitychange",!1,{quality:i})}}})},cancelRequests(){this.isHTML5&&(Si(Hi.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Ene(o){return`${o}-${Math.floor(1e4*Math.random())}`}function O2(o,...i){return z.empty(o)?o:o.toString().replace(/{(\d+)}/g,(a,r)=>i[r].toString())}function Dne(o,i){return o===0||i===0||Number.isNaN(o)||Number.isNaN(i)?0:(o/i*100).toFixed(2)}const vr=(o="",i="",a="")=>o.replace(new RegExp(i.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),a.toString()),h6=(o="")=>o.toString().replace(/\w\S*/g,i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase());function One(o=""){let i=o.toString();return i=vr(i,"-"," "),i=vr(i,"_"," "),i=h6(i),vr(i," ","")}function Rne(o=""){let i=o.toString();return i=One(i),i.charAt(0).toLowerCase()+i.slice(1)}function Bne(o){const i=document.createDocumentFragment(),a=document.createElement("div");return i.appendChild(a),a.innerHTML=o,i.firstChild.innerText}function Lne(o){const i=document.createElement("div");return i.appendChild(o),i.innerHTML}const b6={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Zt={get(o="",i={}){if(z.empty(o)||z.empty(i))return"";let a=r6(i.i18n,o);if(z.empty(a))return Object.keys(b6).includes(o)?b6[o]:"";const r={"{seektime}":i.seekTime,"{title}":i.title};return Object.entries(r).forEach(([s,c])=>{a=vr(a,s,c)}),a}};class wr{constructor(i){Te(this,"get",a=>{if(!wr.supported||!this.enabled)return null;const r=window.localStorage.getItem(this.key);if(z.empty(r))return null;const s=JSON.parse(r);return z.string(a)&&a.length?s[a]:s}),Te(this,"set",a=>{if(!wr.supported||!this.enabled||!z.object(a))return;let r=this.get();z.empty(r)&&(r={}),Nt(r,a);try{window.localStorage.setItem(this.key,JSON.stringify(r))}catch{}}),this.enabled=i.config.storage.enabled,this.key=i.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const i="___test";return window.localStorage.setItem(i,i),window.localStorage.removeItem(i),!0}catch{return!1}}}function Cr(o,i="text"){return new Promise((a,r)=>{try{const s=new XMLHttpRequest;if(!("withCredentials"in s))return;s.addEventListener("load",()=>{if(i==="text")try{a(JSON.parse(s.responseText))}catch{a(s.responseText)}else a(s.response)}),s.addEventListener("error",()=>{throw new Error(s.status)}),s.open("GET",o,!0),s.responseType=i,s.send()}catch(s){r(s)}})}function g6(o,i){if(!z.string(o))return;const a="cache",r=z.string(i);let s=!1;const c=()=>document.getElementById(i)!==null,p=(f,h)=>{f.innerHTML=h,r&&c()||document.body.insertAdjacentElement("afterbegin",f)};if(!r||!c()){const f=wr.supported,h=document.createElement("div");if(h.setAttribute("hidden",""),r&&h.setAttribute("id",i),f){const b=window.localStorage.getItem(`${a}-${i}`);if(s=b!==null,s){const g=JSON.parse(b);p(h,g.content)}}Cr(o).then(b=>{if(!z.empty(b)){if(f)try{window.localStorage.setItem(`${a}-${i}`,JSON.stringify({content:b}))}catch{}p(h,b)}}).catch(()=>{})}}const y6=o=>Math.trunc(o/60/60%60,10),Nne=o=>Math.trunc(o/60%60,10),Pne=o=>Math.trunc(o%60,10);function rs(o=0,i=!1,a=!1){if(!z.number(o))return rs(void 0,i,a);const r=f=>`0${f}`.slice(-2);let s=y6(o);const c=Nne(o),p=Pne(o);return s=i||s>0?`${s}:`:"",`${a&&o>0?"-":""}${s}${r(c)}:${r(p)}`}const Se={getIconUrl(){const o=new URL(this.config.iconUrl,window.location),i=window.location.host?window.location.host:window.top.location.host,a=o.host!==i||Wt.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:a}},findElements(){try{return this.elements.controls=Vt.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:gr.call(this,this.config.selectors.buttons.play),pause:Vt.call(this,this.config.selectors.buttons.pause),restart:Vt.call(this,this.config.selectors.buttons.restart),rewind:Vt.call(this,this.config.selectors.buttons.rewind),fastForward:Vt.call(this,this.config.selectors.buttons.fastForward),mute:Vt.call(this,this.config.selectors.buttons.mute),pip:Vt.call(this,this.config.selectors.buttons.pip),airplay:Vt.call(this,this.config.selectors.buttons.airplay),settings:Vt.call(this,this.config.selectors.buttons.settings),captions:Vt.call(this,this.config.selectors.buttons.captions),fullscreen:Vt.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Vt.call(this,this.config.selectors.progress),this.elements.inputs={seek:Vt.call(this,this.config.selectors.inputs.seek),volume:Vt.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Vt.call(this,this.config.selectors.display.buffer),currentTime:Vt.call(this,this.config.selectors.display.currentTime),duration:Vt.call(this,this.config.selectors.display.duration)},z.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(o){return this.debug.warn("It looks like there is a problem with your custom controls HTML",o),this.toggleNativeControls(!0),!1}},createIcon(o,i){const a="http://www.w3.org/2000/svg",r=Se.getIconUrl.call(this),s=`${r.cors?"":r.url}#${this.config.iconPrefix}`,c=document.createElementNS(a,"svg");S2(c,Nt(i,{"aria-hidden":"true",focusable:"false"}));const p=document.createElementNS(a,"use"),f=`${s}-${o}`;return"href"in p&&p.setAttributeNS("http://www.w3.org/1999/xlink","href",f),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f),c.appendChild(p),c},createLabel(o,i={}){const a=Zt.get(o,this.config);return Ue("span",{...i,class:[i.class,this.config.classNames.hidden].filter(Boolean).join(" ")},a)},createBadge(o){if(z.empty(o))return null;const i=Ue("span",{class:this.config.classNames.menu.value});return i.appendChild(Ue("span",{class:this.config.classNames.menu.badge},o)),i},createButton(o,i){const a=Nt({},i);let r=Rne(o);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(p=>{Object.keys(a).includes(p)&&(s[p]=a[p],delete a[p])}),s.element!=="button"||Object.keys(a).includes("type")||(a.type="button"),Object.keys(a).includes("class")?a.class.split(" ").some(p=>p===this.config.classNames.control)||Nt(a,{class:`${a.class} ${this.config.classNames.control}`}):a.class=this.config.classNames.control,o){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":a.class+=` ${this.config.classNames.control}--overlaid`,r="play",s.label="play",s.icon="play";break;default:z.empty(s.label)&&(s.label=r),z.empty(s.icon)&&(s.icon=o)}const c=Ue(s.element);return s.toggle?(c.appendChild(Se.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),c.appendChild(Se.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),c.appendChild(Se.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),c.appendChild(Se.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(c.appendChild(Se.createIcon.call(this,s.icon)),c.appendChild(Se.createLabel.call(this,s.label))),Nt(a,si(this.config.selectors.buttons[r],a)),S2(c,a),r==="play"?(z.array(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(c)):this.elements.buttons[r]=c,c},createRange(o,i){const a=Ue("input",Nt(si(this.config.selectors.inputs[o]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Zt.get(o,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},i));return this.elements.inputs[o]=a,Se.updateRangeFill.call(this,a),ane.setup(a),a},createProgress(o,i){const a=Ue("progress",Nt(si(this.config.selectors.display[o]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},i));if(o!=="volume"){a.appendChild(Ue("span",null,"0"));const r={played:"played",buffer:"buffered"}[o],s=r?Zt.get(r,this.config):"";a.innerText=`% ${s.toLowerCase()}`}return this.elements.display[o]=a,a},createTime(o,i){const a=si(this.config.selectors.display[o],i),r=Ue("div",Nt(a,{class:`${a.class?a.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Zt.get(o,this.config),role:"timer"}),"00:00");return this.elements.display[o]=r,r},bindMenuItemShortcuts(o,i){nt.call(this,o,"keydown keyup",a=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(a.key)||(a.preventDefault(),a.stopPropagation(),a.type==="keydown"))return;const r=En(o,'[role="menuitemradio"]');if(!r&&[" ","ArrowRight"].includes(a.key))Se.showMenuPanel.call(this,i,!0);else{let s;a.key!==" "&&(a.key==="ArrowDown"||r&&a.key==="ArrowRight"?(s=o.nextElementSibling,z.element(s)||(s=o.parentNode.firstElementChild)):(s=o.previousElementSibling,z.element(s)||(s=o.parentNode.lastElementChild)),A2.call(this,s,!0))}},!1),nt.call(this,o,"keyup",a=>{a.key==="Return"&&Se.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:o,list:i,type:a,title:r,badge:s=null,checked:c=!1}){const p=si(this.config.selectors.inputs[a]),f=Ue("button",Nt(p,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${p.class?p.class:""}`.trim(),"aria-checked":c,value:o})),h=Ue("span");h.innerHTML=r,z.element(s)&&h.appendChild(s),f.appendChild(h),Object.defineProperty(f,"checked",{enumerable:!0,get:()=>f.getAttribute("aria-checked")==="true",set(b){b&&Array.from(f.parentNode.children).filter(g=>En(g,'[role="menuitemradio"]')).forEach(g=>g.setAttribute("aria-checked","false")),f.setAttribute("aria-checked",b?"true":"false")}}),this.listeners.bind(f,"click keyup",b=>{if(!z.keyboardEvent(b)||b.key===" "){switch(b.preventDefault(),b.stopPropagation(),f.checked=!0,a){case"language":this.currentTrack=Number(o);break;case"quality":this.quality=o;break;case"speed":this.speed=parseFloat(o)}Se.showMenuPanel.call(this,"home",z.keyboardEvent(b))}},a,!1),Se.bindMenuItemShortcuts.call(this,f,a),i.appendChild(f)},formatTime(o=0,i=!1){return z.number(o)?rs(o,y6(this.duration)>0,i):o},updateTimeDisplay(o=null,i=0,a=!1){z.element(o)&&z.number(i)&&(o.innerText=Se.formatTime(i,a))},updateVolume(){this.supported.ui&&(z.element(this.elements.inputs.volume)&&Se.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),z.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(o,i=0){z.element(o)&&(o.value=i,Se.updateRangeFill.call(this,o))},updateProgress(o){if(!this.supported.ui||!z.event(o))return;let i=0;const a=(r,s)=>{const c=z.number(s)?s:0,p=z.element(r)?r:this.elements.display.buffer;if(z.element(p)){p.value=c;const f=p.getElementsByTagName("span")[0];z.element(f)&&(f.childNodes[0].nodeValue=c)}};if(o)switch(o.type){case"timeupdate":case"seeking":case"seeked":i=Dne(this.currentTime,this.duration),o.type==="timeupdate"&&Se.setRange.call(this,this.elements.inputs.seek,i);break;case"playing":case"progress":a(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(o){const i=z.event(o)?o.target:o;if(z.element(i)&&i.getAttribute("type")==="range"){if(En(i,this.config.selectors.inputs.seek)){i.setAttribute("aria-valuenow",this.currentTime);const a=Se.formatTime(this.currentTime),r=Se.formatTime(this.duration),s=Zt.get("seekLabel",this.config);i.setAttribute("aria-valuetext",s.replace("{currentTime}",a).replace("{duration}",r))}else if(En(i,this.config.selectors.inputs.volume)){const a=100*i.value;i.setAttribute("aria-valuenow",a),i.setAttribute("aria-valuetext",`${a.toFixed(1)}%`)}else i.setAttribute("aria-valuenow",i.value);(Wt.isWebKit||Wt.isIPadOS)&&i.style.setProperty("--value",i.value/i.max*100+"%")}},updateSeekTooltip(o){var i,a;if(!this.config.tooltips.seek||!z.element(this.elements.inputs.seek)||!z.element(this.elements.display.seekTooltip)||this.duration===0)return;const r=this.elements.display.seekTooltip,s=`${this.config.classNames.tooltip}--visible`,c=g=>dt(r,s,g);if(this.touch)return void c(!1);let p=0;const f=this.elements.progress.getBoundingClientRect();if(z.event(o))p=100/f.width*(o.pageX-f.left);else{if(!is(r,s))return;p=parseFloat(r.style.left,10)}p<0?p=0:p>100&&(p=100);const h=this.duration/100*p;r.innerText=Se.formatTime(h);const b=(i=this.config.markers)===null||i===void 0||(a=i.points)===null||a===void 0?void 0:a.find(({time:g})=>g===Math.round(h));b&&r.insertAdjacentHTML("afterbegin",`${b.label}<br>`),r.style.left=`${p}%`,z.event(o)&&["mouseenter","mouseleave"].includes(o.type)&&c(o.type==="mouseenter")},timeUpdate(o){const i=!z.element(this.elements.display.duration)&&this.config.invertTime;Se.updateTimeDisplay.call(this,this.elements.display.currentTime,i?this.duration-this.currentTime:this.currentTime,i),o&&o.type==="timeupdate"&&this.media.seeking||Se.updateProgress.call(this,o)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return Tn(this.elements.display.currentTime,!0),void Tn(this.elements.progress,!0);z.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const o=z.element(this.elements.display.duration);!o&&this.config.displayDuration&&this.paused&&Se.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),o&&Se.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Se.setMarkers.call(this),Se.updateSeekTooltip.call(this)},toggleMenuButton(o,i){Tn(this.elements.settings.buttons[o],!i)},updateSetting(o,i,a){const r=this.elements.settings.panels[o];let s=null,c=i;if(o==="captions")s=this.currentTrack;else{if(s=z.empty(a)?this[o]:a,z.empty(s)&&(s=this.config[o].default),!z.empty(this.options[o])&&!this.options[o].includes(s))return void this.debug.warn(`Unsupported value of '${s}' for ${o}`);if(!this.config[o].options.includes(s))return void this.debug.warn(`Disabled value of '${s}' for ${o}`)}if(z.element(c)||(c=r&&r.querySelector('[role="menu"]')),!z.element(c))return;this.elements.settings.buttons[o].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Se.getLabel.call(this,o,s);const p=c&&c.querySelector(`[value="${s}"]`);z.element(p)&&(p.checked=!0)},getLabel(o,i){switch(o){case"speed":return i===1?Zt.get("normal",this.config):`${i}×`;case"quality":if(z.number(i)){const a=Zt.get(`qualityLabel.${i}`,this.config);return a.length?a:`${i}p`}return h6(i);case"captions":return lt.getLabel.call(this);default:return null}},setQualityMenu(o){if(!z.element(this.elements.settings.panels.quality))return;const i="quality",a=this.elements.settings.panels.quality.querySelector('[role="menu"]');z.array(o)&&(this.options.quality=E2(o).filter(c=>this.config.quality.options.includes(c)));const r=!z.empty(this.options.quality)&&this.options.quality.length>1;if(Se.toggleMenuButton.call(this,i,r),ts(a),Se.checkMenu.call(this),!r)return;const s=c=>{const p=Zt.get(`qualityBadge.${c}`,this.config);return p.length?Se.createBadge.call(this,p):null};this.options.quality.sort((c,p)=>{const f=this.config.quality.options;return f.indexOf(c)>f.indexOf(p)?1:-1}).forEach(c=>{Se.createMenuItem.call(this,{value:c,list:a,type:i,title:Se.getLabel.call(this,"quality",c),badge:s(c)})}),Se.updateSetting.call(this,i,a)},setCaptionsMenu(){if(!z.element(this.elements.settings.panels.captions))return;const o="captions",i=this.elements.settings.panels.captions.querySelector('[role="menu"]'),a=lt.getTracks.call(this),r=!!a.length;if(Se.toggleMenuButton.call(this,o,r),ts(i),Se.checkMenu.call(this),!r)return;const s=a.map((c,p)=>({value:p,checked:this.captions.toggled&&this.currentTrack===p,title:lt.getLabel.call(this,c),badge:c.language&&Se.createBadge.call(this,c.language.toUpperCase()),list:i,type:"language"}));s.unshift({value:-1,checked:!this.captions.toggled,title:Zt.get("disabled",this.config),list:i,type:"language"}),s.forEach(Se.createMenuItem.bind(this)),Se.updateSetting.call(this,o,i)},setSpeedMenu(){if(!z.element(this.elements.settings.panels.speed))return;const o="speed",i=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(r=>r>=this.minimumSpeed&&r<=this.maximumSpeed);const a=!z.empty(this.options.speed)&&this.options.speed.length>1;Se.toggleMenuButton.call(this,o,a),ts(i),Se.checkMenu.call(this),a&&(this.options.speed.forEach(r=>{Se.createMenuItem.call(this,{value:r,list:i,type:o,title:Se.getLabel.call(this,"speed",r)})}),Se.updateSetting.call(this,o,i))},checkMenu(){const{buttons:o}=this.elements.settings,i=!z.empty(o)&&Object.values(o).some(a=>!a.hidden);Tn(this.elements.settings.menu,!i)},focusFirstMenuItem(o,i=!1){if(this.elements.settings.popup.hidden)return;let a=o;z.element(a)||(a=Object.values(this.elements.settings.panels).find(s=>!s.hidden));const r=a.querySelector('[role^="menuitem"]');A2.call(this,r,i)},toggleMenu(o){const{popup:i}=this.elements.settings,a=this.elements.buttons.settings;if(!z.element(i)||!z.element(a))return;const{hidden:r}=i;let s=r;if(z.boolean(o))s=o;else if(z.keyboardEvent(o)&&o.key==="Escape")s=!1;else if(z.event(o)){const c=z.function(o.composedPath)?o.composedPath()[0]:o.target,p=i.contains(c);if(p||!p&&o.target!==a&&s)return}a.setAttribute("aria-expanded",s),Tn(i,!s),dt(this.elements.container,this.config.classNames.menu.open,s),s&&z.keyboardEvent(o)?Se.focusFirstMenuItem.call(this,null,!0):s||r||A2.call(this,a,z.keyboardEvent(o))},getMenuSize(o){const i=o.cloneNode(!0);i.style.position="absolute",i.style.opacity=0,i.removeAttribute("hidden"),o.parentNode.appendChild(i);const a=i.scrollWidth,r=i.scrollHeight;return Si(i),{width:a,height:r}},showMenuPanel(o="",i=!1){const a=this.elements.container.querySelector(`#plyr-settings-${this.id}-${o}`);if(!z.element(a))return;const r=a.parentNode,s=Array.from(r.children).find(c=>!c.hidden);if(Pt.transitions&&!Pt.reducedMotion){r.style.width=`${s.scrollWidth}px`,r.style.height=`${s.scrollHeight}px`;const c=Se.getMenuSize.call(this,a),p=f=>{f.target===r&&["width","height"].includes(f.propertyName)&&(r.style.width="",r.style.height="",ns.call(this,r,I2,p))};nt.call(this,r,I2,p),r.style.width=`${c.width}px`,r.style.height=`${c.height}px`}Tn(s,!0),Tn(a,!1),Se.focusFirstMenuItem.call(this,a,i)},setDownloadUrl(){const o=this.elements.buttons.download;z.element(o)&&o.setAttribute("href",this.download)},create(o){const{bindMenuItemShortcuts:i,createButton:a,createProgress:r,createRange:s,createTime:c,setQualityMenu:p,setSpeedMenu:f,showMenuPanel:h}=Se;this.elements.controls=null,z.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(a.call(this,"play-large"));const b=Ue("div",si(this.config.selectors.controls.wrapper));this.elements.controls=b;const g={class:"plyr__controls__item"};return E2(z.array(this.config.controls)?this.config.controls:[]).forEach(v=>{if(v==="restart"&&b.appendChild(a.call(this,"restart",g)),v==="rewind"&&b.appendChild(a.call(this,"rewind",g)),v==="play"&&b.appendChild(a.call(this,"play",g)),v==="fast-forward"&&b.appendChild(a.call(this,"fast-forward",g)),v==="progress"){const y=Ue("div",{class:`${g.class} plyr__progress__container`}),C=Ue("div",si(this.config.selectors.progress));if(C.appendChild(s.call(this,"seek",{id:`plyr-seek-${o.id}`})),C.appendChild(r.call(this,"buffer")),this.config.tooltips.seek){const T=Ue("span",{class:this.config.classNames.tooltip},"00:00");C.appendChild(T),this.elements.display.seekTooltip=T}this.elements.progress=C,y.appendChild(this.elements.progress),b.appendChild(y)}if(v==="current-time"&&b.appendChild(c.call(this,"currentTime",g)),v==="duration"&&b.appendChild(c.call(this,"duration",g)),v==="mute"||v==="volume"){let{volume:y}=this.elements;if(z.element(y)&&b.contains(y)||(y=Ue("div",Nt({},g,{class:`${g.class} plyr__volume`.trim()})),this.elements.volume=y,b.appendChild(y)),v==="mute"&&y.appendChild(a.call(this,"mute")),v==="volume"&&!Wt.isIos&&!Wt.isIPadOS){const C={max:1,step:.05,value:this.config.volume};y.appendChild(s.call(this,"volume",Nt(C,{id:`plyr-volume-${o.id}`})))}}if(v==="captions"&&b.appendChild(a.call(this,"captions",g)),v==="settings"&&!z.empty(this.config.settings)){const y=Ue("div",Nt({},g,{class:`${g.class} plyr__menu`.trim(),hidden:""}));y.appendChild(a.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${o.id}`,"aria-expanded":!1}));const C=Ue("div",{class:"plyr__menu__container",id:`plyr-settings-${o.id}`,hidden:""}),T=Ue("div"),S=Ue("div",{id:`plyr-settings-${o.id}-home`}),I=Ue("div",{role:"menu"});S.appendChild(I),T.appendChild(S),this.elements.settings.panels.home=S,this.config.settings.forEach(k=>{const x=Ue("button",Nt(si(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));i.call(this,x,k),nt.call(this,x,"click",()=>{h.call(this,k,!1)});const E=Ue("span",null,Zt.get(k,this.config)),A=Ue("span",{class:this.config.classNames.menu.value});A.innerHTML=o[k],E.appendChild(A),x.appendChild(E),I.appendChild(x);const D=Ue("div",{id:`plyr-settings-${o.id}-${k}`,hidden:""}),P=Ue("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});P.appendChild(Ue("span",{"aria-hidden":!0},Zt.get(k,this.config))),P.appendChild(Ue("span",{class:this.config.classNames.hidden},Zt.get("menuBack",this.config))),nt.call(this,D,"keydown",R=>{R.key==="ArrowLeft"&&(R.preventDefault(),R.stopPropagation(),h.call(this,"home",!0))},!1),nt.call(this,P,"click",()=>{h.call(this,"home",!1)}),D.appendChild(P),D.appendChild(Ue("div",{role:"menu"})),T.appendChild(D),this.elements.settings.buttons[k]=x,this.elements.settings.panels[k]=D}),C.appendChild(T),y.appendChild(C),b.appendChild(y),this.elements.settings.popup=C,this.elements.settings.menu=y}if(v==="pip"&&Pt.pip&&b.appendChild(a.call(this,"pip",g)),v==="airplay"&&Pt.airplay&&b.appendChild(a.call(this,"airplay",g)),v==="download"){const y=Nt({},g,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(y.download="");const{download:C}=this.config.urls;!z.url(C)&&this.isEmbed&&Nt(y,{icon:`logo-${this.provider}`,label:this.provider}),b.appendChild(a.call(this,"download",y))}v==="fullscreen"&&b.appendChild(a.call(this,"fullscreen",g))}),this.isHTML5&&p.call(this,Hi.getQualityOptions.call(this)),f.call(this),b},inject(){if(this.config.loadSprite){const s=Se.getIconUrl.call(this);s.cors&&g6(s.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let o=null;this.elements.controls=null;const i={id:this.id,seektime:this.config.seekTime,title:this.config.title};let a=!0;z.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),z.element(this.config.controls)||z.string(this.config.controls)?o=this.config.controls:(o=Se.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:lt.getLabel.call(this)}),a=!1);let r;if(a&&z.string(this.config.controls)&&(o=(s=>{let c=s;return Object.entries(i).forEach(([p,f])=>{c=vr(c,`{${p}}`,f)}),c})(o)),z.string(this.config.selectors.controls.container)&&(r=document.querySelector(this.config.selectors.controls.container)),z.element(r)||(r=this.elements.container),r[z.element(o)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",o),z.element(this.elements.controls)||Se.findElements.call(this),!z.empty(this.elements.buttons)){const s=c=>{const p=this.config.classNames.controlPressed;c.setAttribute("aria-pressed","false"),Object.defineProperty(c,"pressed",{configurable:!0,enumerable:!0,get:()=>is(c,p),set(f=!1){dt(c,p,f),c.setAttribute("aria-pressed",f?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(c=>{z.array(c)||z.nodeList(c)?Array.from(c).filter(Boolean).forEach(s):s(c)})}if(Wt.isEdge&&a6(r),this.config.tooltips.controls){const{classNames:s,selectors:c}=this.config,p=`${c.controls.wrapper} ${c.labels} .${s.hidden}`,f=gr.call(this,p);Array.from(f).forEach(h=>{dt(h,this.config.classNames.hidden,!1),dt(h,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var o,i;if(!this.duration||this.elements.markers)return;const a=(o=this.config.markers)===null||o===void 0||(i=o.points)===null||i===void 0?void 0:i.filter(({time:h})=>h>0&&h<this.duration);if(a==null||!a.length)return;const r=document.createDocumentFragment(),s=document.createDocumentFragment();let c=null;const p=`${this.config.classNames.tooltip}--visible`,f=h=>dt(c,p,h);a.forEach(h=>{const b=Ue("span",{class:this.config.classNames.marker},""),g=h.time/this.duration*100+"%";c&&(b.addEventListener("mouseenter",()=>{h.label||(c.style.left=g,c.innerHTML=h.label,f(!0))}),b.addEventListener("mouseleave",()=>{f(!1)})),b.addEventListener("click",()=>{this.currentTime=h.time}),b.style.left=g,s.appendChild(b)}),r.appendChild(s),this.config.tooltips.seek||(c=Ue("span",{class:this.config.classNames.tooltip},""),r.appendChild(c)),this.elements.markers={points:s,tip:c},this.elements.progress.appendChild(r)}};function v6(o,i=!0){let a=o;if(i){const r=document.createElement("a");r.href=a,a=r.href}try{return new URL(a)}catch{return null}}function w6(o){const i=new URLSearchParams;return z.object(o)&&Object.entries(o).forEach(([a,r])=>{i.set(a,r)}),i}const lt={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Pt.textTracks)return void(z.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Se.setCaptionsMenu.call(this));if(z.element(this.elements.captions)||(this.elements.captions=Ue("div",si(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),xne(this.elements.captions,this.elements.wrapper)),Wt.isIE&&window.URL){const r=this.media.querySelectorAll("track");Array.from(r).forEach(s=>{const c=s.getAttribute("src"),p=v6(c);p!==null&&p.hostname!==window.location.href.hostname&&["http:","https:"].includes(p.protocol)&&Cr(c,"blob").then(f=>{s.setAttribute("src",window.URL.createObjectURL(f))}).catch(()=>{Si(s)})})}const o=E2((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(r=>r.split("-")[0]));let i=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();i==="auto"&&([i]=o);let a=this.storage.get("captions");if(z.boolean(a)||({active:a}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:a,language:i,languages:o}),this.isHTML5){const r=this.config.captions.update?"addtrack removetrack":"removetrack";nt.call(this,this.media.textTracks,r,lt.update.bind(this))}setTimeout(lt.update.bind(this),0)},update(){const o=lt.getTracks.call(this,!0),{active:i,language:a,meta:r,currentTrackNode:s}=this.captions,c=!!o.find(p=>p.language===a);this.isHTML5&&this.isVideo&&o.filter(p=>!r.get(p)).forEach(p=>{this.debug.log("Track added",p),r.set(p,{default:p.mode==="showing"}),p.mode==="showing"&&(p.mode="hidden"),nt.call(this,p,"cuechange",()=>lt.updateCues.call(this))}),(c&&this.language!==a||!o.includes(s))&&(lt.setLanguage.call(this,a),lt.toggle.call(this,i&&c)),this.elements&&dt(this.elements.container,this.config.classNames.captions.enabled,!z.empty(o)),z.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Se.setCaptionsMenu.call(this)},toggle(o,i=!0){if(!this.supported.ui)return;const{toggled:a}=this.captions,r=this.config.classNames.captions.active,s=z.nullOrUndefined(o)?!a:o;if(s!==a){if(i||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!i){const c=lt.getTracks.call(this),p=lt.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=p.language,void lt.set.call(this,c.indexOf(p))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),dt(this.elements.container,r,s),this.captions.toggled=s,Se.updateSetting.call(this,"captions"),ze.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout(()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(o,i=!0){const a=lt.getTracks.call(this);if(o!==-1)if(z.number(o))if(o in a){if(this.captions.currentTrack!==o){this.captions.currentTrack=o;const r=a[o],{language:s}=r||{};this.captions.currentTrackNode=r,Se.updateSetting.call(this,"captions"),i||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),ze.call(this,this.media,"languagechange")}lt.toggle.call(this,!0,i),this.isHTML5&&this.isVideo&<.updateCues.call(this)}else this.debug.warn("Track not found",o);else this.debug.warn("Invalid caption argument",o);else lt.toggle.call(this,!1,i)},setLanguage(o,i=!0){if(!z.string(o))return void this.debug.warn("Invalid language argument",o);const a=o.toLowerCase();this.captions.language=a;const r=lt.getTracks.call(this),s=lt.findTrack.call(this,[a]);lt.set.call(this,r.indexOf(s),i)},getTracks(o=!1){return Array.from((this.media||{}).textTracks||[]).filter(i=>!this.isHTML5||o||this.captions.meta.has(i)).filter(i=>["captions","subtitles"].includes(i.kind))},findTrack(o,i=!1){const a=lt.getTracks.call(this),r=p=>Number((this.captions.meta.get(p)||{}).default),s=Array.from(a).sort((p,f)=>r(f)-r(p));let c;return o.every(p=>(c=s.find(f=>f.language===p),!c)),c||(i?s[0]:void 0)},getCurrentTrack(){return lt.getTracks.call(this)[this.currentTrack]},getLabel(o){let i=o;return!z.track(i)&&Pt.textTracks&&this.captions.toggled&&(i=lt.getCurrentTrack.call(this)),z.track(i)?z.empty(i.label)?z.empty(i.language)?Zt.get("enabled",this.config):o.language.toUpperCase():i.label:Zt.get("disabled",this.config)},updateCues(o){if(!this.supported.ui)return;if(!z.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!z.nullOrUndefined(o)&&!Array.isArray(o))return void this.debug.warn("updateCues: Invalid input",o);let i=o;if(!i){const r=lt.getCurrentTrack.call(this);i=Array.from((r||{}).activeCues||[]).map(s=>s.getCueAsHTML()).map(Lne)}const a=i.map(r=>r.trim()).join(`
|
|
5235
|
+
`},Fie=lY(Iie,{semantic:Eie,components:{button:Rie,autocomplete:Die,popover:Pie,tooltip:qie,chip:Lie,checkbox:Bie,toggleswitch:jie,breadcrumb:Oie,slider:Mie,divider:Nie,radiobutton:$ie},extend:{spacings:{multiplicator:"8px","3xs":"calc({spacings.multiplicator} / 4)","2xs":"calc({spacings.multiplicator} / 2)",xs:"calc({spacings.multiplicator} * 1)",sm:"calc({spacings.multiplicator} * 2)",md:"calc({spacings.multiplicator} * 3)",lg:"calc({spacings.multiplicator} * 4)",xl:"calc({spacings.multiplicator} * 5)","2xl":"calc({spacings.multiplicator} * 6)","3xl":"calc({spacings.multiplicator} * 7)"}}}),Mo=o=>(o.compatConfig={MODE:3},o),Vie=o=>{o.use(jW,{theme:{preset:Fie,options:{darkModeSelector:".theme--dark"}}}),o.component("PButton",Mo(r9)),o.component("PAutoComplete",Mo(Qb)),o.component("PInputText",Mo(f2)),o.component("PPopover",Mo(m9)),o.component("PCheckbox",Mo(c9)),o.component("PRadio",Mo(h9)),o.component("PChip",Mo(p2)),o.component("PToggleSwitch",Mo(g9)),o.component("PBreadcrumb",Mo(i9)),o.component("PSlider",Mo(b9)),o.component("PDivider",Mo(p9)),o.directive("tooltip",rY)},Uie={install(o,{eventBus:i,router:a,globals:r={}}){Object.keys(tb).forEach(s=>{o.directive(s,tb[s])}),Object.keys(G5).forEach(s=>{o.component(s,G5[s])}),Object.keys(r).forEach(s=>{o.provide(s,r[s])}),o.provide("$eventBus",i),a&&o.use(a),Vie(o)},generateInstance:I1};function Te(o,i,a){return(i=Hie(i))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}function zie(o,i){if(typeof o!="object"||o===null)return o;var a=o[Symbol.toPrimitive];if(a!==void 0){var r=a.call(o,i);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(o)}function Hie(o){var i=zie(o,"string");return typeof i=="symbol"?i:String(i)}function Wie(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")}function H9(o,i){for(var a=0;a<i.length;a++){var r=i[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function Zie(o,i,a){return i&&H9(o.prototype,i),a&&H9(o,a),o}function Yie(o,i,a){return i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o}function W9(o,i){var a=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);i&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable})),a.push.apply(a,r)}return a}function Z9(o){for(var i=1;i<arguments.length;i++){var a=arguments[i]!=null?arguments[i]:{};i%2?W9(Object(a),!0).forEach(function(r){Yie(o,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):W9(Object(a)).forEach(function(r){Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(a,r))})}return o}var Y9={addCSS:!0,thumbWidth:15,watch:!0};function Kie(o,i){return(function(){return Array.from(document.querySelectorAll(i)).includes(this)}).call(o,i)}function Gie(o,i){if(o&&i){var a=new Event(i,{bubbles:!0});o.dispatchEvent(a)}}var hr=function(o){return o!=null?o.constructor:null},x2=function(o,i){return!!(o&&i&&o instanceof i)},K9=function(o){return o==null},G9=function(o){return hr(o)===Object},Xie=function(o){return hr(o)===Number&&!Number.isNaN(o)},X9=function(o){return hr(o)===String},Qie=function(o){return hr(o)===Boolean},Jie=function(o){return hr(o)===Function},Q9=function(o){return Array.isArray(o)},J9=function(o){return x2(o,NodeList)},ene=function(o){return x2(o,Element)},tne=function(o){return x2(o,Event)},one=function(o){return K9(o)||(X9(o)||Q9(o)||J9(o))&&!o.length||G9(o)&&!Object.keys(o).length},no={nullOrUndefined:K9,object:G9,number:Xie,string:X9,boolean:Qie,function:Jie,array:Q9,nodeList:J9,element:ene,event:tne,empty:one};function ine(o){var i="".concat(o).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return i?Math.max(0,(i[1]?i[1].length:0)-(i[2]?+i[2]:0)):0}function nne(o,i){if(1>i){var a=ine(i);return parseFloat(o.toFixed(a))}return Math.round(o/i)*i}var ane=function(){function o(i,a){Wie(this,o),no.element(i)?this.element=i:no.string(i)&&(this.element=document.querySelector(i)),no.element(this.element)&&no.empty(this.element.rangeTouch)&&(this.config=Z9({},Y9,{},a),this.init())}return Zie(o,[{key:"init",value:function(){o.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){o.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(i){var a=this,r=i?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(s){a.element[r](s,function(c){return a.set(c)},!1)})}},{key:"get",value:function(i){if(!o.enabled||!no.event(i))return null;var a,r=i.target,s=i.changedTouches[0],c=parseFloat(r.getAttribute("min"))||0,p=parseFloat(r.getAttribute("max"))||100,f=parseFloat(r.getAttribute("step"))||1,h=r.getBoundingClientRect(),b=100/h.width*(this.config.thumbWidth/2)/100;return 0>(a=100/h.width*(s.clientX-h.left))?a=0:100<a&&(a=100),50>a?a-=(100-2*a)*b:50<a&&(a+=2*(a-50)*b),c+nne(a/100*(p-c),f)}},{key:"set",value:function(i){o.enabled&&no.event(i)&&!i.target.disabled&&(i.preventDefault(),i.target.value=this.get(i),Gie(i.target,i.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(i){var a=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},r=null;if(no.empty(i)||no.string(i)?r=Array.from(document.querySelectorAll(no.string(i)?i:'input[type="range"]')):no.element(i)?r=[i]:no.nodeList(i)?r=Array.from(i):no.array(i)&&(r=i.filter(no.element)),no.empty(r))return null;var s=Z9({},Y9,{},a);if(no.string(i)&&s.watch){var c=new MutationObserver(function(p){Array.from(p).forEach(function(f){Array.from(f.addedNodes).forEach(function(h){no.element(h)&&Kie(h,i)&&new o(h,s)})})});c.observe(document.body,{childList:!0,subtree:!0})}return r.map(function(p){return new o(p,a)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),o}();const br=o=>o!=null?o.constructor:null,Ii=(o,i)=>!!(o&&i&&o instanceof i),_2=o=>o==null,e6=o=>br(o)===Object,rne=o=>br(o)===Number&&!Number.isNaN(o),es=o=>br(o)===String,lne=o=>br(o)===Boolean,t6=o=>typeof o=="function",o6=o=>Array.isArray(o),sne=o=>Ii(o,WeakMap),i6=o=>Ii(o,NodeList),cne=o=>br(o)===Text,dne=o=>Ii(o,Event),pne=o=>Ii(o,KeyboardEvent),une=o=>Ii(o,window.TextTrackCue)||Ii(o,window.VTTCue),fne=o=>Ii(o,TextTrack)||!_2(o)&&es(o.kind),mne=o=>Ii(o,Promise)&&t6(o.then),hne=o=>o!==null&&typeof o=="object"&&o.nodeType===1&&typeof o.style=="object"&&typeof o.ownerDocument=="object",n6=o=>_2(o)||(es(o)||o6(o)||i6(o))&&!o.length||e6(o)&&!Object.keys(o).length;var z={nullOrUndefined:_2,object:e6,number:rne,string:es,boolean:lne,function:t6,array:o6,weakMap:sne,nodeList:i6,element:hne,textNode:cne,event:dne,keyboardEvent:pne,cue:une,track:fne,promise:mne,url:o=>{if(Ii(o,window.URL))return!0;if(!es(o))return!1;let i=o;o.startsWith("http://")&&o.startsWith("https://")||(i=`http://${o}`);try{return!n6(new URL(i).hostname)}catch{return!1}},empty:n6};const I2=(()=>{const o=document.createElement("span"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},a=Object.keys(i).find(r=>o.style[r]!==void 0);return!!z.string(a)&&i[a]})();function a6(o,i){setTimeout(()=>{try{o.hidden=!0,o.offsetHeight,o.hidden=!1}catch{}},i)}const bne=!!window.document.documentMode,gne=/Edge/g.test(navigator.userAgent),yne="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),vne=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,wne=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Cne=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var Wt={isIE:bne,isEdge:gne,isWebKit:yne,isIPhone:vne,isIPadOS:wne,isIos:Cne};function kne(o){return JSON.parse(JSON.stringify(o))}function r6(o,i){return i.split(".").reduce((a,r)=>a&&a[r],o)}function Nt(o={},...i){if(!i.length)return o;const a=i.shift();return z.object(a)?(Object.keys(a).forEach(r=>{z.object(a[r])?(Object.keys(o).includes(r)||Object.assign(o,{[r]:{}}),Nt(o[r],a[r])):Object.assign(o,{[r]:a[r]})}),Nt(o,...i)):o}function l6(o,i){const a=o.length?o:[o];Array.from(a).reverse().forEach((r,s)=>{const c=s>0?i.cloneNode(!0):i,p=r.parentNode,f=r.nextSibling;c.appendChild(r),f?p.insertBefore(c,f):p.appendChild(c)})}function S2(o,i){z.element(o)&&!z.empty(i)&&Object.entries(i).filter(([,a])=>!z.nullOrUndefined(a)).forEach(([a,r])=>o.setAttribute(a,r))}function Ue(o,i,a){const r=document.createElement(o);return z.object(i)&&S2(r,i),z.string(a)&&(r.innerText=a),r}function xne(o,i){z.element(o)&&z.element(i)&&i.parentNode.insertBefore(o,i.nextSibling)}function s6(o,i,a,r){z.element(i)&&i.appendChild(Ue(o,a,r))}function Si(o){z.nodeList(o)||z.array(o)?Array.from(o).forEach(Si):z.element(o)&&z.element(o.parentNode)&&o.parentNode.removeChild(o)}function ts(o){if(!z.element(o))return;let{length:i}=o.childNodes;for(;i>0;)o.removeChild(o.lastChild),i-=1}function os(o,i){return z.element(i)&&z.element(i.parentNode)&&z.element(o)?(i.parentNode.replaceChild(o,i),o):null}function si(o,i){if(!z.string(o)||z.empty(o))return{};const a={},r=Nt({},i);return o.split(",").forEach(s=>{const c=s.trim(),p=c.replace(".",""),f=c.replace(/[[\]]/g,"").split("="),[h]=f,b=f.length>1?f[1].replace(/["']/g,""):"";switch(c.charAt(0)){case".":z.string(r.class)?a.class=`${r.class} ${p}`:a.class=p;break;case"#":a.id=c.replace("#","");break;case"[":a[h]=b}}),Nt(r,a)}function Tn(o,i){if(!z.element(o))return;let a=i;z.boolean(a)||(a=!o.hidden),o.hidden=a}function dt(o,i,a){if(z.nodeList(o))return Array.from(o).map(r=>dt(r,i,a));if(z.element(o)){let r="toggle";return a!==void 0&&(r=a?"add":"remove"),o.classList[r](i),o.classList.contains(i)}return!1}function is(o,i){return z.element(o)&&o.classList.contains(i)}function En(o,i){const{prototype:a}=Element;return(a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||function(){return Array.from(document.querySelectorAll(i)).includes(this)}).call(o,i)}function _ne(o,i){const{prototype:a}=Element;return(a.closest||function(){let r=this;do{if(En.matches(r,i))return r;r=r.parentElement||r.parentNode}while(r!==null&&r.nodeType===1);return null}).call(o,i)}function gr(o){return this.elements.container.querySelectorAll(o)}function Vt(o){return this.elements.container.querySelector(o)}function A2(o=null,i=!1){z.element(o)&&o.focus({preventScroll:!0,focusVisible:i})}const c6={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Pt={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(o,i){const a=Pt[o]||i!=="html5";return{api:a,ui:a&&Pt.rangeInput}},pip:!(Wt.isIPhone||!z.function(Ue("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Ue("video").disablePictureInPicture)),airplay:z.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(o){if(z.empty(o))return!1;const[i]=o.split("/");let a=o;if(!this.isHTML5||i!==this.type)return!1;Object.keys(c6).includes(a)&&(a+=`; codecs="${c6[o]}"`);try{return!!(a&&this.media.canPlayType(a).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const o=document.createElement("input");return o.type="range",o.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:I2!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Ine=(()=>{let o=!1;try{const i=Object.defineProperty({},"passive",{get:()=>(o=!0,null)});window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch{}return o})();function yr(o,i,a,r=!1,s=!0,c=!1){if(!o||!("addEventListener"in o)||z.empty(i)||!z.function(a))return;const p=i.split(" ");let f=c;Ine&&(f={passive:s,capture:c}),p.forEach(h=>{this&&this.eventListeners&&r&&this.eventListeners.push({element:o,type:h,callback:a,options:f}),o[r?"addEventListener":"removeEventListener"](h,a,f)})}function nt(o,i="",a,r=!0,s=!1){yr.call(this,o,i,a,!0,r,s)}function ns(o,i="",a,r=!0,s=!1){yr.call(this,o,i,a,!1,r,s)}function T2(o,i="",a,r=!0,s=!1){const c=(...p)=>{ns(o,i,c,r,s),a.apply(this,p)};yr.call(this,o,i,c,!0,r,s)}function ze(o,i="",a=!1,r={}){if(!z.element(o)||z.empty(i))return;const s=new CustomEvent(i,{bubbles:a,detail:{...r,plyr:this}});o.dispatchEvent(s)}function Sne(){this&&this.eventListeners&&(this.eventListeners.forEach(o=>{const{element:i,type:a,callback:r,options:s}=o;i.removeEventListener(a,r,s)}),this.eventListeners=[])}function Ane(){return new Promise(o=>this.ready?setTimeout(o,0):nt.call(this,this.elements.container,"ready",o)).then(()=>{})}function ci(o){z.promise(o)&&o.then(null,()=>{})}function E2(o){return z.array(o)?o.filter((i,a)=>o.indexOf(i)===a):o}function d6(o,i){return z.array(o)&&o.length?o.reduce((a,r)=>Math.abs(r-i)<Math.abs(a-i)?r:a):null}function p6(o){return!(!window||!window.CSS)&&window.CSS.supports(o)}const u6=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((o,[i,a])=>({...o,[i/a]:[i,a]}),{});function f6(o){return z.array(o)||z.string(o)&&o.includes(":")?(z.array(o)?o:o.split(":")).map(Number).every(z.number):!1}function as(o){if(!z.array(o)||!o.every(z.number))return null;const[i,a]=o,r=(c,p)=>p===0?c:r(p,c%p),s=r(i,a);return[i/s,a/s]}function D2(o){const i=r=>f6(r)?r.split(":").map(Number):null;let a=i(o);if(a===null&&(a=i(this.config.ratio)),a===null&&!z.empty(this.embed)&&z.array(this.embed.ratio)&&({ratio:a}=this.embed),a===null&&this.isHTML5){const{videoWidth:r,videoHeight:s}=this.media;a=[r,s]}return as(a)}function ia(o){if(!this.isVideo)return{};const{wrapper:i}=this.elements,a=D2.call(this,o);if(!z.array(a))return{};const[r,s]=as(a),c=100/r*s;if(p6(`aspect-ratio: ${r}/${s}`)?i.style.aspectRatio=`${r}/${s}`:i.style.paddingBottom=`${c}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const p=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),f=(p-c)/(p/50);this.fullscreen.active?i.style.paddingBottom=null:this.media.style.transform=`translateY(-${f}%)`}else this.isHTML5&&i.classList.add(this.config.classNames.videoFixedRatio);return{padding:c,ratio:a}}function m6(o,i,a=.05){const r=o/i,s=d6(Object.keys(u6),r);return Math.abs(s-r)<=a?u6[s]:[o,i]}function Tne(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const Hi={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(o=>{const i=o.getAttribute("type");return!!z.empty(i)||Pt.mime.call(this,i)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Hi.getSources.call(this).map(o=>Number(o.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const o=this;o.options.speed=o.config.speed.options,z.empty(this.config.ratio)||ia.call(o),Object.defineProperty(o.media,"quality",{get(){const i=Hi.getSources.call(o).find(a=>a.getAttribute("src")===o.source);return i&&Number(i.getAttribute("size"))},set(i){if(o.quality!==i){if(o.config.quality.forced&&z.function(o.config.quality.onChange))o.config.quality.onChange(i);else{const a=Hi.getSources.call(o).find(h=>Number(h.getAttribute("size"))===i);if(!a)return;const{currentTime:r,paused:s,preload:c,readyState:p,playbackRate:f}=o.media;o.media.src=a.getAttribute("src"),(c!=="none"||p)&&(o.once("loadedmetadata",()=>{o.speed=f,o.currentTime=r,s||ci(o.play())}),o.media.load())}ze.call(o,o.media,"qualitychange",!1,{quality:i})}}})},cancelRequests(){this.isHTML5&&(Si(Hi.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Ene(o){return`${o}-${Math.floor(1e4*Math.random())}`}function O2(o,...i){return z.empty(o)?o:o.toString().replace(/{(\d+)}/g,(a,r)=>i[r].toString())}function Dne(o,i){return o===0||i===0||Number.isNaN(o)||Number.isNaN(i)?0:(o/i*100).toFixed(2)}const vr=(o="",i="",a="")=>o.replace(new RegExp(i.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),a.toString()),h6=(o="")=>o.toString().replace(/\w\S*/g,i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase());function One(o=""){let i=o.toString();return i=vr(i,"-"," "),i=vr(i,"_"," "),i=h6(i),vr(i," ","")}function Rne(o=""){let i=o.toString();return i=One(i),i.charAt(0).toLowerCase()+i.slice(1)}function Bne(o){const i=document.createDocumentFragment(),a=document.createElement("div");return i.appendChild(a),a.innerHTML=o,i.firstChild.innerText}function Lne(o){const i=document.createElement("div");return i.appendChild(o),i.innerHTML}const b6={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Zt={get(o="",i={}){if(z.empty(o)||z.empty(i))return"";let a=r6(i.i18n,o);if(z.empty(a))return Object.keys(b6).includes(o)?b6[o]:"";const r={"{seektime}":i.seekTime,"{title}":i.title};return Object.entries(r).forEach(([s,c])=>{a=vr(a,s,c)}),a}};class wr{constructor(i){Te(this,"get",a=>{if(!wr.supported||!this.enabled)return null;const r=window.localStorage.getItem(this.key);if(z.empty(r))return null;const s=JSON.parse(r);return z.string(a)&&a.length?s[a]:s}),Te(this,"set",a=>{if(!wr.supported||!this.enabled||!z.object(a))return;let r=this.get();z.empty(r)&&(r={}),Nt(r,a);try{window.localStorage.setItem(this.key,JSON.stringify(r))}catch{}}),this.enabled=i.config.storage.enabled,this.key=i.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const i="___test";return window.localStorage.setItem(i,i),window.localStorage.removeItem(i),!0}catch{return!1}}}function Cr(o,i="text"){return new Promise((a,r)=>{try{const s=new XMLHttpRequest;if(!("withCredentials"in s))return;s.addEventListener("load",()=>{if(i==="text")try{a(JSON.parse(s.responseText))}catch{a(s.responseText)}else a(s.response)}),s.addEventListener("error",()=>{throw new Error(s.status)}),s.open("GET",o,!0),s.responseType=i,s.send()}catch(s){r(s)}})}function g6(o,i){if(!z.string(o))return;const a="cache",r=z.string(i);let s=!1;const c=()=>document.getElementById(i)!==null,p=(f,h)=>{f.innerHTML=h,r&&c()||document.body.insertAdjacentElement("afterbegin",f)};if(!r||!c()){const f=wr.supported,h=document.createElement("div");if(h.setAttribute("hidden",""),r&&h.setAttribute("id",i),f){const b=window.localStorage.getItem(`${a}-${i}`);if(s=b!==null,s){const g=JSON.parse(b);p(h,g.content)}}Cr(o).then(b=>{if(!z.empty(b)){if(f)try{window.localStorage.setItem(`${a}-${i}`,JSON.stringify({content:b}))}catch{}p(h,b)}}).catch(()=>{})}}const y6=o=>Math.trunc(o/60/60%60,10),Nne=o=>Math.trunc(o/60%60,10),Pne=o=>Math.trunc(o%60,10);function rs(o=0,i=!1,a=!1){if(!z.number(o))return rs(void 0,i,a);const r=f=>`0${f}`.slice(-2);let s=y6(o);const c=Nne(o),p=Pne(o);return s=i||s>0?`${s}:`:"",`${a&&o>0?"-":""}${s}${r(c)}:${r(p)}`}const Se={getIconUrl(){const o=new URL(this.config.iconUrl,window.location),i=window.location.host?window.location.host:window.top.location.host,a=o.host!==i||Wt.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:a}},findElements(){try{return this.elements.controls=Vt.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:gr.call(this,this.config.selectors.buttons.play),pause:Vt.call(this,this.config.selectors.buttons.pause),restart:Vt.call(this,this.config.selectors.buttons.restart),rewind:Vt.call(this,this.config.selectors.buttons.rewind),fastForward:Vt.call(this,this.config.selectors.buttons.fastForward),mute:Vt.call(this,this.config.selectors.buttons.mute),pip:Vt.call(this,this.config.selectors.buttons.pip),airplay:Vt.call(this,this.config.selectors.buttons.airplay),settings:Vt.call(this,this.config.selectors.buttons.settings),captions:Vt.call(this,this.config.selectors.buttons.captions),fullscreen:Vt.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Vt.call(this,this.config.selectors.progress),this.elements.inputs={seek:Vt.call(this,this.config.selectors.inputs.seek),volume:Vt.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Vt.call(this,this.config.selectors.display.buffer),currentTime:Vt.call(this,this.config.selectors.display.currentTime),duration:Vt.call(this,this.config.selectors.display.duration)},z.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(o){return this.debug.warn("It looks like there is a problem with your custom controls HTML",o),this.toggleNativeControls(!0),!1}},createIcon(o,i){const a="http://www.w3.org/2000/svg",r=Se.getIconUrl.call(this),s=`${r.cors?"":r.url}#${this.config.iconPrefix}`,c=document.createElementNS(a,"svg");S2(c,Nt(i,{"aria-hidden":"true",focusable:"false"}));const p=document.createElementNS(a,"use"),f=`${s}-${o}`;return"href"in p&&p.setAttributeNS("http://www.w3.org/1999/xlink","href",f),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f),c.appendChild(p),c},createLabel(o,i={}){const a=Zt.get(o,this.config);return Ue("span",{...i,class:[i.class,this.config.classNames.hidden].filter(Boolean).join(" ")},a)},createBadge(o){if(z.empty(o))return null;const i=Ue("span",{class:this.config.classNames.menu.value});return i.appendChild(Ue("span",{class:this.config.classNames.menu.badge},o)),i},createButton(o,i){const a=Nt({},i);let r=Rne(o);const s={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(p=>{Object.keys(a).includes(p)&&(s[p]=a[p],delete a[p])}),s.element!=="button"||Object.keys(a).includes("type")||(a.type="button"),Object.keys(a).includes("class")?a.class.split(" ").some(p=>p===this.config.classNames.control)||Nt(a,{class:`${a.class} ${this.config.classNames.control}`}):a.class=this.config.classNames.control,o){case"play":s.toggle=!0,s.label="play",s.labelPressed="pause",s.icon="play",s.iconPressed="pause";break;case"mute":s.toggle=!0,s.label="mute",s.labelPressed="unmute",s.icon="volume",s.iconPressed="muted";break;case"captions":s.toggle=!0,s.label="enableCaptions",s.labelPressed="disableCaptions",s.icon="captions-off",s.iconPressed="captions-on";break;case"fullscreen":s.toggle=!0,s.label="enterFullscreen",s.labelPressed="exitFullscreen",s.icon="enter-fullscreen",s.iconPressed="exit-fullscreen";break;case"play-large":a.class+=` ${this.config.classNames.control}--overlaid`,r="play",s.label="play",s.icon="play";break;default:z.empty(s.label)&&(s.label=r),z.empty(s.icon)&&(s.icon=o)}const c=Ue(s.element);return s.toggle?(c.appendChild(Se.createIcon.call(this,s.iconPressed,{class:"icon--pressed"})),c.appendChild(Se.createIcon.call(this,s.icon,{class:"icon--not-pressed"})),c.appendChild(Se.createLabel.call(this,s.labelPressed,{class:"label--pressed"})),c.appendChild(Se.createLabel.call(this,s.label,{class:"label--not-pressed"}))):(c.appendChild(Se.createIcon.call(this,s.icon)),c.appendChild(Se.createLabel.call(this,s.label))),Nt(a,si(this.config.selectors.buttons[r],a)),S2(c,a),r==="play"?(z.array(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(c)):this.elements.buttons[r]=c,c},createRange(o,i){const a=Ue("input",Nt(si(this.config.selectors.inputs[o]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Zt.get(o,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},i));return this.elements.inputs[o]=a,Se.updateRangeFill.call(this,a),ane.setup(a),a},createProgress(o,i){const a=Ue("progress",Nt(si(this.config.selectors.display[o]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},i));if(o!=="volume"){a.appendChild(Ue("span",null,"0"));const r={played:"played",buffer:"buffered"}[o],s=r?Zt.get(r,this.config):"";a.innerText=`% ${s.toLowerCase()}`}return this.elements.display[o]=a,a},createTime(o,i){const a=si(this.config.selectors.display[o],i),r=Ue("div",Nt(a,{class:`${a.class?a.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Zt.get(o,this.config),role:"timer"}),"00:00");return this.elements.display[o]=r,r},bindMenuItemShortcuts(o,i){nt.call(this,o,"keydown keyup",a=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(a.key)||(a.preventDefault(),a.stopPropagation(),a.type==="keydown"))return;const r=En(o,'[role="menuitemradio"]');if(!r&&[" ","ArrowRight"].includes(a.key))Se.showMenuPanel.call(this,i,!0);else{let s;a.key!==" "&&(a.key==="ArrowDown"||r&&a.key==="ArrowRight"?(s=o.nextElementSibling,z.element(s)||(s=o.parentNode.firstElementChild)):(s=o.previousElementSibling,z.element(s)||(s=o.parentNode.lastElementChild)),A2.call(this,s,!0))}},!1),nt.call(this,o,"keyup",a=>{a.key==="Return"&&Se.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:o,list:i,type:a,title:r,badge:s=null,checked:c=!1}){const p=si(this.config.selectors.inputs[a]),f=Ue("button",Nt(p,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${p.class?p.class:""}`.trim(),"aria-checked":c,value:o})),h=Ue("span");h.innerHTML=r,z.element(s)&&h.appendChild(s),f.appendChild(h),Object.defineProperty(f,"checked",{enumerable:!0,get:()=>f.getAttribute("aria-checked")==="true",set(b){b&&Array.from(f.parentNode.children).filter(g=>En(g,'[role="menuitemradio"]')).forEach(g=>g.setAttribute("aria-checked","false")),f.setAttribute("aria-checked",b?"true":"false")}}),this.listeners.bind(f,"click keyup",b=>{if(!z.keyboardEvent(b)||b.key===" "){switch(b.preventDefault(),b.stopPropagation(),f.checked=!0,a){case"language":this.currentTrack=Number(o);break;case"quality":this.quality=o;break;case"speed":this.speed=parseFloat(o)}Se.showMenuPanel.call(this,"home",z.keyboardEvent(b))}},a,!1),Se.bindMenuItemShortcuts.call(this,f,a),i.appendChild(f)},formatTime(o=0,i=!1){return z.number(o)?rs(o,y6(this.duration)>0,i):o},updateTimeDisplay(o=null,i=0,a=!1){z.element(o)&&z.number(i)&&(o.innerText=Se.formatTime(i,a))},updateVolume(){this.supported.ui&&(z.element(this.elements.inputs.volume)&&Se.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),z.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(o,i=0){z.element(o)&&(o.value=i,Se.updateRangeFill.call(this,o))},updateProgress(o){if(!this.supported.ui||!z.event(o))return;let i=0;const a=(r,s)=>{const c=z.number(s)?s:0,p=z.element(r)?r:this.elements.display.buffer;if(z.element(p)){p.value=c;const f=p.getElementsByTagName("span")[0];z.element(f)&&(f.childNodes[0].nodeValue=c)}};if(o)switch(o.type){case"timeupdate":case"seeking":case"seeked":i=Dne(this.currentTime,this.duration),o.type==="timeupdate"&&Se.setRange.call(this,this.elements.inputs.seek,i);break;case"playing":case"progress":a(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(o){const i=z.event(o)?o.target:o;if(z.element(i)&&i.getAttribute("type")==="range"){if(En(i,this.config.selectors.inputs.seek)){i.setAttribute("aria-valuenow",this.currentTime);const a=Se.formatTime(this.currentTime),r=Se.formatTime(this.duration),s=Zt.get("seekLabel",this.config);i.setAttribute("aria-valuetext",s.replace("{currentTime}",a).replace("{duration}",r))}else if(En(i,this.config.selectors.inputs.volume)){const a=100*i.value;i.setAttribute("aria-valuenow",a),i.setAttribute("aria-valuetext",`${a.toFixed(1)}%`)}else i.setAttribute("aria-valuenow",i.value);(Wt.isWebKit||Wt.isIPadOS)&&i.style.setProperty("--value",i.value/i.max*100+"%")}},updateSeekTooltip(o){var i,a;if(!this.config.tooltips.seek||!z.element(this.elements.inputs.seek)||!z.element(this.elements.display.seekTooltip)||this.duration===0)return;const r=this.elements.display.seekTooltip,s=`${this.config.classNames.tooltip}--visible`,c=g=>dt(r,s,g);if(this.touch)return void c(!1);let p=0;const f=this.elements.progress.getBoundingClientRect();if(z.event(o))p=100/f.width*(o.pageX-f.left);else{if(!is(r,s))return;p=parseFloat(r.style.left,10)}p<0?p=0:p>100&&(p=100);const h=this.duration/100*p;r.innerText=Se.formatTime(h);const b=(i=this.config.markers)===null||i===void 0||(a=i.points)===null||a===void 0?void 0:a.find(({time:g})=>g===Math.round(h));b&&r.insertAdjacentHTML("afterbegin",`${b.label}<br>`),r.style.left=`${p}%`,z.event(o)&&["mouseenter","mouseleave"].includes(o.type)&&c(o.type==="mouseenter")},timeUpdate(o){const i=!z.element(this.elements.display.duration)&&this.config.invertTime;Se.updateTimeDisplay.call(this,this.elements.display.currentTime,i?this.duration-this.currentTime:this.currentTime,i),o&&o.type==="timeupdate"&&this.media.seeking||Se.updateProgress.call(this,o)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return Tn(this.elements.display.currentTime,!0),void Tn(this.elements.progress,!0);z.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const o=z.element(this.elements.display.duration);!o&&this.config.displayDuration&&this.paused&&Se.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),o&&Se.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Se.setMarkers.call(this),Se.updateSeekTooltip.call(this)},toggleMenuButton(o,i){Tn(this.elements.settings.buttons[o],!i)},updateSetting(o,i,a){const r=this.elements.settings.panels[o];let s=null,c=i;if(o==="captions")s=this.currentTrack;else{if(s=z.empty(a)?this[o]:a,z.empty(s)&&(s=this.config[o].default),!z.empty(this.options[o])&&!this.options[o].includes(s))return void this.debug.warn(`Unsupported value of '${s}' for ${o}`);if(!this.config[o].options.includes(s))return void this.debug.warn(`Disabled value of '${s}' for ${o}`)}if(z.element(c)||(c=r&&r.querySelector('[role="menu"]')),!z.element(c))return;this.elements.settings.buttons[o].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Se.getLabel.call(this,o,s);const p=c&&c.querySelector(`[value="${s}"]`);z.element(p)&&(p.checked=!0)},getLabel(o,i){switch(o){case"speed":return i===1?Zt.get("normal",this.config):`${i}×`;case"quality":if(z.number(i)){const a=Zt.get(`qualityLabel.${i}`,this.config);return a.length?a:`${i}p`}return h6(i);case"captions":return lt.getLabel.call(this);default:return null}},setQualityMenu(o){if(!z.element(this.elements.settings.panels.quality))return;const i="quality",a=this.elements.settings.panels.quality.querySelector('[role="menu"]');z.array(o)&&(this.options.quality=E2(o).filter(c=>this.config.quality.options.includes(c)));const r=!z.empty(this.options.quality)&&this.options.quality.length>1;if(Se.toggleMenuButton.call(this,i,r),ts(a),Se.checkMenu.call(this),!r)return;const s=c=>{const p=Zt.get(`qualityBadge.${c}`,this.config);return p.length?Se.createBadge.call(this,p):null};this.options.quality.sort((c,p)=>{const f=this.config.quality.options;return f.indexOf(c)>f.indexOf(p)?1:-1}).forEach(c=>{Se.createMenuItem.call(this,{value:c,list:a,type:i,title:Se.getLabel.call(this,"quality",c),badge:s(c)})}),Se.updateSetting.call(this,i,a)},setCaptionsMenu(){if(!z.element(this.elements.settings.panels.captions))return;const o="captions",i=this.elements.settings.panels.captions.querySelector('[role="menu"]'),a=lt.getTracks.call(this),r=!!a.length;if(Se.toggleMenuButton.call(this,o,r),ts(i),Se.checkMenu.call(this),!r)return;const s=a.map((c,p)=>({value:p,checked:this.captions.toggled&&this.currentTrack===p,title:lt.getLabel.call(this,c),badge:c.language&&Se.createBadge.call(this,c.language.toUpperCase()),list:i,type:"language"}));s.unshift({value:-1,checked:!this.captions.toggled,title:Zt.get("disabled",this.config),list:i,type:"language"}),s.forEach(Se.createMenuItem.bind(this)),Se.updateSetting.call(this,o,i)},setSpeedMenu(){if(!z.element(this.elements.settings.panels.speed))return;const o="speed",i=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(r=>r>=this.minimumSpeed&&r<=this.maximumSpeed);const a=!z.empty(this.options.speed)&&this.options.speed.length>1;Se.toggleMenuButton.call(this,o,a),ts(i),Se.checkMenu.call(this),a&&(this.options.speed.forEach(r=>{Se.createMenuItem.call(this,{value:r,list:i,type:o,title:Se.getLabel.call(this,"speed",r)})}),Se.updateSetting.call(this,o,i))},checkMenu(){const{buttons:o}=this.elements.settings,i=!z.empty(o)&&Object.values(o).some(a=>!a.hidden);Tn(this.elements.settings.menu,!i)},focusFirstMenuItem(o,i=!1){if(this.elements.settings.popup.hidden)return;let a=o;z.element(a)||(a=Object.values(this.elements.settings.panels).find(s=>!s.hidden));const r=a.querySelector('[role^="menuitem"]');A2.call(this,r,i)},toggleMenu(o){const{popup:i}=this.elements.settings,a=this.elements.buttons.settings;if(!z.element(i)||!z.element(a))return;const{hidden:r}=i;let s=r;if(z.boolean(o))s=o;else if(z.keyboardEvent(o)&&o.key==="Escape")s=!1;else if(z.event(o)){const c=z.function(o.composedPath)?o.composedPath()[0]:o.target,p=i.contains(c);if(p||!p&&o.target!==a&&s)return}a.setAttribute("aria-expanded",s),Tn(i,!s),dt(this.elements.container,this.config.classNames.menu.open,s),s&&z.keyboardEvent(o)?Se.focusFirstMenuItem.call(this,null,!0):s||r||A2.call(this,a,z.keyboardEvent(o))},getMenuSize(o){const i=o.cloneNode(!0);i.style.position="absolute",i.style.opacity=0,i.removeAttribute("hidden"),o.parentNode.appendChild(i);const a=i.scrollWidth,r=i.scrollHeight;return Si(i),{width:a,height:r}},showMenuPanel(o="",i=!1){const a=this.elements.container.querySelector(`#plyr-settings-${this.id}-${o}`);if(!z.element(a))return;const r=a.parentNode,s=Array.from(r.children).find(c=>!c.hidden);if(Pt.transitions&&!Pt.reducedMotion){r.style.width=`${s.scrollWidth}px`,r.style.height=`${s.scrollHeight}px`;const c=Se.getMenuSize.call(this,a),p=f=>{f.target===r&&["width","height"].includes(f.propertyName)&&(r.style.width="",r.style.height="",ns.call(this,r,I2,p))};nt.call(this,r,I2,p),r.style.width=`${c.width}px`,r.style.height=`${c.height}px`}Tn(s,!0),Tn(a,!1),Se.focusFirstMenuItem.call(this,a,i)},setDownloadUrl(){const o=this.elements.buttons.download;z.element(o)&&o.setAttribute("href",this.download)},create(o){const{bindMenuItemShortcuts:i,createButton:a,createProgress:r,createRange:s,createTime:c,setQualityMenu:p,setSpeedMenu:f,showMenuPanel:h}=Se;this.elements.controls=null,z.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(a.call(this,"play-large"));const b=Ue("div",si(this.config.selectors.controls.wrapper));this.elements.controls=b;const g={class:"plyr__controls__item"};return E2(z.array(this.config.controls)?this.config.controls:[]).forEach(v=>{if(v==="restart"&&b.appendChild(a.call(this,"restart",g)),v==="rewind"&&b.appendChild(a.call(this,"rewind",g)),v==="play"&&b.appendChild(a.call(this,"play",g)),v==="fast-forward"&&b.appendChild(a.call(this,"fast-forward",g)),v==="progress"){const y=Ue("div",{class:`${g.class} plyr__progress__container`}),C=Ue("div",si(this.config.selectors.progress));if(C.appendChild(s.call(this,"seek",{id:`plyr-seek-${o.id}`})),C.appendChild(r.call(this,"buffer")),this.config.tooltips.seek){const T=Ue("span",{class:this.config.classNames.tooltip},"00:00");C.appendChild(T),this.elements.display.seekTooltip=T}this.elements.progress=C,y.appendChild(this.elements.progress),b.appendChild(y)}if(v==="current-time"&&b.appendChild(c.call(this,"currentTime",g)),v==="duration"&&b.appendChild(c.call(this,"duration",g)),v==="mute"||v==="volume"){let{volume:y}=this.elements;if(z.element(y)&&b.contains(y)||(y=Ue("div",Nt({},g,{class:`${g.class} plyr__volume`.trim()})),this.elements.volume=y,b.appendChild(y)),v==="mute"&&y.appendChild(a.call(this,"mute")),v==="volume"&&!Wt.isIos&&!Wt.isIPadOS){const C={max:1,step:.05,value:this.config.volume};y.appendChild(s.call(this,"volume",Nt(C,{id:`plyr-volume-${o.id}`})))}}if(v==="captions"&&b.appendChild(a.call(this,"captions",g)),v==="settings"&&!z.empty(this.config.settings)){const y=Ue("div",Nt({},g,{class:`${g.class} plyr__menu`.trim(),hidden:""}));y.appendChild(a.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${o.id}`,"aria-expanded":!1}));const C=Ue("div",{class:"plyr__menu__container",id:`plyr-settings-${o.id}`,hidden:""}),T=Ue("div"),S=Ue("div",{id:`plyr-settings-${o.id}-home`}),I=Ue("div",{role:"menu"});S.appendChild(I),T.appendChild(S),this.elements.settings.panels.home=S,this.config.settings.forEach(k=>{const x=Ue("button",Nt(si(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));i.call(this,x,k),nt.call(this,x,"click",()=>{h.call(this,k,!1)});const E=Ue("span",null,Zt.get(k,this.config)),A=Ue("span",{class:this.config.classNames.menu.value});A.innerHTML=o[k],E.appendChild(A),x.appendChild(E),I.appendChild(x);const D=Ue("div",{id:`plyr-settings-${o.id}-${k}`,hidden:""}),P=Ue("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});P.appendChild(Ue("span",{"aria-hidden":!0},Zt.get(k,this.config))),P.appendChild(Ue("span",{class:this.config.classNames.hidden},Zt.get("menuBack",this.config))),nt.call(this,D,"keydown",R=>{R.key==="ArrowLeft"&&(R.preventDefault(),R.stopPropagation(),h.call(this,"home",!0))},!1),nt.call(this,P,"click",()=>{h.call(this,"home",!1)}),D.appendChild(P),D.appendChild(Ue("div",{role:"menu"})),T.appendChild(D),this.elements.settings.buttons[k]=x,this.elements.settings.panels[k]=D}),C.appendChild(T),y.appendChild(C),b.appendChild(y),this.elements.settings.popup=C,this.elements.settings.menu=y}if(v==="pip"&&Pt.pip&&b.appendChild(a.call(this,"pip",g)),v==="airplay"&&Pt.airplay&&b.appendChild(a.call(this,"airplay",g)),v==="download"){const y=Nt({},g,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(y.download="");const{download:C}=this.config.urls;!z.url(C)&&this.isEmbed&&Nt(y,{icon:`logo-${this.provider}`,label:this.provider}),b.appendChild(a.call(this,"download",y))}v==="fullscreen"&&b.appendChild(a.call(this,"fullscreen",g))}),this.isHTML5&&p.call(this,Hi.getQualityOptions.call(this)),f.call(this),b},inject(){if(this.config.loadSprite){const s=Se.getIconUrl.call(this);s.cors&&g6(s.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let o=null;this.elements.controls=null;const i={id:this.id,seektime:this.config.seekTime,title:this.config.title};let a=!0;z.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),z.element(this.config.controls)||z.string(this.config.controls)?o=this.config.controls:(o=Se.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:lt.getLabel.call(this)}),a=!1);let r;if(a&&z.string(this.config.controls)&&(o=(s=>{let c=s;return Object.entries(i).forEach(([p,f])=>{c=vr(c,`{${p}}`,f)}),c})(o)),z.string(this.config.selectors.controls.container)&&(r=document.querySelector(this.config.selectors.controls.container)),z.element(r)||(r=this.elements.container),r[z.element(o)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",o),z.element(this.elements.controls)||Se.findElements.call(this),!z.empty(this.elements.buttons)){const s=c=>{const p=this.config.classNames.controlPressed;c.setAttribute("aria-pressed","false"),Object.defineProperty(c,"pressed",{configurable:!0,enumerable:!0,get:()=>is(c,p),set(f=!1){dt(c,p,f),c.setAttribute("aria-pressed",f?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(c=>{z.array(c)||z.nodeList(c)?Array.from(c).filter(Boolean).forEach(s):s(c)})}if(Wt.isEdge&&a6(r),this.config.tooltips.controls){const{classNames:s,selectors:c}=this.config,p=`${c.controls.wrapper} ${c.labels} .${s.hidden}`,f=gr.call(this,p);Array.from(f).forEach(h=>{dt(h,this.config.classNames.hidden,!1),dt(h,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var o,i;if(!this.duration||this.elements.markers)return;const a=(o=this.config.markers)===null||o===void 0||(i=o.points)===null||i===void 0?void 0:i.filter(({time:h})=>h>0&&h<this.duration);if(a==null||!a.length)return;const r=document.createDocumentFragment(),s=document.createDocumentFragment();let c=null;const p=`${this.config.classNames.tooltip}--visible`,f=h=>dt(c,p,h);a.forEach(h=>{const b=Ue("span",{class:this.config.classNames.marker},""),g=h.time/this.duration*100+"%";c&&(b.addEventListener("mouseenter",()=>{h.label||(c.style.left=g,c.innerHTML=h.label,f(!0))}),b.addEventListener("mouseleave",()=>{f(!1)})),b.addEventListener("click",()=>{this.currentTime=h.time}),b.style.left=g,s.appendChild(b)}),r.appendChild(s),this.config.tooltips.seek||(c=Ue("span",{class:this.config.classNames.tooltip},""),r.appendChild(c)),this.elements.markers={points:s,tip:c},this.elements.progress.appendChild(r)}};function v6(o,i=!0){let a=o;if(i){const r=document.createElement("a");r.href=a,a=r.href}try{return new URL(a)}catch{return null}}function w6(o){const i=new URLSearchParams;return z.object(o)&&Object.entries(o).forEach(([a,r])=>{i.set(a,r)}),i}const lt={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!Pt.textTracks)return void(z.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Se.setCaptionsMenu.call(this));if(z.element(this.elements.captions)||(this.elements.captions=Ue("div",si(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),xne(this.elements.captions,this.elements.wrapper)),Wt.isIE&&window.URL){const r=this.media.querySelectorAll("track");Array.from(r).forEach(s=>{const c=s.getAttribute("src"),p=v6(c);p!==null&&p.hostname!==window.location.href.hostname&&["http:","https:"].includes(p.protocol)&&Cr(c,"blob").then(f=>{s.setAttribute("src",window.URL.createObjectURL(f))}).catch(()=>{Si(s)})})}const o=E2((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(r=>r.split("-")[0]));let i=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();i==="auto"&&([i]=o);let a=this.storage.get("captions");if(z.boolean(a)||({active:a}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:a,language:i,languages:o}),this.isHTML5){const r=this.config.captions.update?"addtrack removetrack":"removetrack";nt.call(this,this.media.textTracks,r,lt.update.bind(this))}setTimeout(lt.update.bind(this),0)},update(){const o=lt.getTracks.call(this,!0),{active:i,language:a,meta:r,currentTrackNode:s}=this.captions,c=!!o.find(p=>p.language===a);this.isHTML5&&this.isVideo&&o.filter(p=>!r.get(p)).forEach(p=>{this.debug.log("Track added",p),r.set(p,{default:p.mode==="showing"}),p.mode==="showing"&&(p.mode="hidden"),nt.call(this,p,"cuechange",()=>lt.updateCues.call(this))}),(c&&this.language!==a||!o.includes(s))&&(lt.setLanguage.call(this,a),lt.toggle.call(this,i&&c)),this.elements&&dt(this.elements.container,this.config.classNames.captions.enabled,!z.empty(o)),z.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Se.setCaptionsMenu.call(this)},toggle(o,i=!0){if(!this.supported.ui)return;const{toggled:a}=this.captions,r=this.config.classNames.captions.active,s=z.nullOrUndefined(o)?!a:o;if(s!==a){if(i||(this.captions.active=s,this.storage.set({captions:s})),!this.language&&s&&!i){const c=lt.getTracks.call(this),p=lt.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=p.language,void lt.set.call(this,c.indexOf(p))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=s),dt(this.elements.container,r,s),this.captions.toggled=s,Se.updateSetting.call(this,"captions"),ze.call(this,this.media,s?"captionsenabled":"captionsdisabled")}setTimeout(()=>{s&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(o,i=!0){const a=lt.getTracks.call(this);if(o!==-1)if(z.number(o))if(o in a){if(this.captions.currentTrack!==o){this.captions.currentTrack=o;const r=a[o],{language:s}=r||{};this.captions.currentTrackNode=r,Se.updateSetting.call(this,"captions"),i||(this.captions.language=s,this.storage.set({language:s})),this.isVimeo&&this.embed.enableTextTrack(s),ze.call(this,this.media,"languagechange")}lt.toggle.call(this,!0,i),this.isHTML5&&this.isVideo&<.updateCues.call(this)}else this.debug.warn("Track not found",o);else this.debug.warn("Invalid caption argument",o);else lt.toggle.call(this,!1,i)},setLanguage(o,i=!0){if(!z.string(o))return void this.debug.warn("Invalid language argument",o);const a=o.toLowerCase();this.captions.language=a;const r=lt.getTracks.call(this),s=lt.findTrack.call(this,[a]);lt.set.call(this,r.indexOf(s),i)},getTracks(o=!1){return Array.from((this.media||{}).textTracks||[]).filter(i=>!this.isHTML5||o||this.captions.meta.has(i)).filter(i=>["captions","subtitles"].includes(i.kind))},findTrack(o,i=!1){const a=lt.getTracks.call(this),r=p=>Number((this.captions.meta.get(p)||{}).default),s=Array.from(a).sort((p,f)=>r(f)-r(p));let c;return o.every(p=>(c=s.find(f=>f.language===p),!c)),c||(i?s[0]:void 0)},getCurrentTrack(){return lt.getTracks.call(this)[this.currentTrack]},getLabel(o){let i=o;return!z.track(i)&&Pt.textTracks&&this.captions.toggled&&(i=lt.getCurrentTrack.call(this)),z.track(i)?z.empty(i.label)?z.empty(i.language)?Zt.get("enabled",this.config):o.language.toUpperCase():i.label:Zt.get("disabled",this.config)},updateCues(o){if(!this.supported.ui)return;if(!z.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!z.nullOrUndefined(o)&&!Array.isArray(o))return void this.debug.warn("updateCues: Invalid input",o);let i=o;if(!i){const r=lt.getCurrentTrack.call(this);i=Array.from((r||{}).activeCues||[]).map(s=>s.getCueAsHTML()).map(Lne)}const a=i.map(r=>r.trim()).join(`
|
|
5236
5236
|
`);if(a!==this.elements.captions.innerHTML){ts(this.elements.captions);const r=Ue("span",si(this.config.selectors.caption));r.innerHTML=a,this.elements.captions.appendChild(r),ze.call(this,this.media,"cuechange")}}},C6={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},R2={active:"picture-in-picture",inactive:"inline"},Wi={html5:"html5",youtube:"youtube",vimeo:"vimeo"},B2={audio:"audio",video:"video"};function $ne(o){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(o)?Wi.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(o)?Wi.vimeo:null}const L2=()=>{};class Mne{constructor(i=!1){this.enabled=window.console&&i,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):L2}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):L2}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):L2}}class jo{constructor(i){Te(this,"onChange",()=>{if(!this.supported)return;const a=this.player.elements.buttons.fullscreen;z.element(a)&&(a.pressed=this.active);const r=this.target===this.player.media?this.target:this.player.elements.container;ze.call(this.player,r,this.active?"enterfullscreen":"exitfullscreen",!0)}),Te(this,"toggleFallback",(a=!1)=>{if(a?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=a?"hidden":"",dt(this.target,this.player.config.classNames.fullscreen.fallback,a),Wt.isIos){let r=document.head.querySelector('meta[name="viewport"]');const s="viewport-fit=cover";r||(r=document.createElement("meta"),r.setAttribute("name","viewport"));const c=z.string(r.content)&&r.content.includes(s);a?(this.cleanupViewport=!c,c||(r.content+=`,${s}`)):this.cleanupViewport&&(r.content=r.content.split(",").filter(p=>p.trim()!==s).join(","))}this.onChange()}),Te(this,"trapFocus",a=>{if(Wt.isIos||Wt.isIPadOS||!this.active||a.key!=="Tab")return;const r=document.activeElement,s=gr.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[c]=s,p=s[s.length-1];r!==p||a.shiftKey?r===c&&a.shiftKey&&(p.focus(),a.preventDefault()):(c.focus(),a.preventDefault())}),Te(this,"update",()=>{if(this.supported){let a;a=this.forceFallback?"Fallback (forced)":jo.nativeSupported?"Native":"Fallback",this.player.debug.log(`${a} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");dt(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),Te(this,"enter",()=>{this.supported&&(Wt.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!jo.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?z.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),Te(this,"exit",()=>{if(this.supported)if(Wt.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),ci(this.player.play());else if(!jo.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!z.empty(this.prefix)){const a=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${a}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),Te(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=i,this.prefix=jo.prefix,this.property=jo.property,this.scrollPosition={x:0,y:0},this.forceFallback=i.config.fullscreen.fallback==="force",this.player.elements.fullscreen=i.config.fullscreen.container&&_ne(this.player.elements.container,i.config.fullscreen.container),nt.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),nt.call(this.player,this.player.elements.container,"dblclick",a=>{z.element(this.player.elements.controls)&&this.player.elements.controls.contains(a.target)||this.player.listeners.proxy(a,this.toggle,"fullscreen")}),nt.call(this,this.player.elements.container,"keydown",a=>this.trapFocus(a)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return jo.nativeSupported&&!this.forceFallback}static get prefix(){if(z.function(document.exitFullscreen))return"";let i="";return["webkit","moz","ms"].some(a=>!(!z.function(document[`${a}ExitFullscreen`])&&!z.function(document[`${a}CancelFullScreen`]))&&(i=a,!0)),i}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,jo.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||jo.nativeSupported||!Wt.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!jo.nativeSupported||this.forceFallback)return is(this.target,this.player.config.classNames.fullscreen.fallback);const i=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return i&&i.shadowRoot?i===this.target.getRootNode().host:i===this.target}get target(){return Wt.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}function ls(o,i=1){return new Promise((a,r)=>{const s=new Image,c=()=>{delete s.onload,delete s.onerror,(s.naturalWidth>=i?a:r)(s)};Object.assign(s,{onload:c,onerror:c,src:o})})}const bt={addStyleHook(){dt(this.elements.container,this.config.selectors.container.replace(".",""),!0),dt(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(o=!1){o&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void bt.toggleNativeControls.call(this,!0);z.element(this.elements.controls)||(Se.inject.call(this),this.listeners.controls()),bt.toggleNativeControls.call(this),this.isHTML5&<.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Se.updateVolume.call(this),Se.timeUpdate.call(this),Se.durationUpdate.call(this),bt.checkPlaying.call(this),dt(this.elements.container,this.config.classNames.pip.supported,Pt.pip&&this.isHTML5&&this.isVideo),dt(this.elements.container,this.config.classNames.airplay.supported,Pt.airplay&&this.isHTML5),dt(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{ze.call(this,this.media,"ready")},0),bt.setTitle.call(this),this.poster&&bt.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&Se.durationUpdate.call(this),this.config.mediaMetadata&&Se.setMediaMetadata.call(this)},setTitle(){let o=Zt.get("play",this.config);if(z.string(this.config.title)&&!z.empty(this.config.title)&&(o+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(i=>{i.setAttribute("aria-label",o)}),this.isEmbed){const i=Vt.call(this,"iframe");if(!z.element(i))return;const a=z.empty(this.config.title)?"video":this.config.title,r=Zt.get("frameTitle",this.config);i.setAttribute("title",r.replace("{title}",a))}},togglePoster(o){dt(this.elements.container,this.config.classNames.posterEnabled,o)},setPoster(o,i=!0){return i&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",o),this.elements.poster.removeAttribute("hidden"),Ane.call(this).then(()=>ls(o)).catch(a=>{throw o===this.poster&&bt.togglePoster.call(this,!1),a}).then(()=>{if(o!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${o}')`,backgroundSize:""}),bt.togglePoster.call(this,!0),o)))},checkPlaying(o){dt(this.elements.container,this.config.classNames.playing,this.playing),dt(this.elements.container,this.config.classNames.paused,this.paused),dt(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(i=>{Object.assign(i,{pressed:this.playing}),i.setAttribute("aria-label",Zt.get(this.playing?"pause":"play",this.config))}),z.event(o)&&o.type==="timeupdate"||bt.toggleControls.call(this)},checkLoading(o){this.loading=["stalled","waiting"].includes(o.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{dt(this.elements.container,this.config.classNames.loading,this.loading),bt.toggleControls.call(this)},this.loading?250:0)},toggleControls(o){const{controls:i}=this.elements;if(i&&this.config.hideControls){const a=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(!!(o||this.loading||this.paused||i.pressed||i.hover||a))}},migrateStyles(){Object.values({...this.media.style}).filter(o=>!z.empty(o)&&z.string(o)&&o.startsWith("--plyr")).forEach(o=>{this.elements.container.style.setProperty(o,this.media.style.getPropertyValue(o)),this.media.style.removeProperty(o)}),z.empty(this.media.style)&&this.media.removeAttribute("style")}};class jne{constructor(i){Te(this,"firstTouch",()=>{const{player:a}=this,{elements:r}=a;a.touch=!0,dt(r.container,a.config.classNames.isTouch,!0)}),Te(this,"global",(a=!0)=>{const{player:r}=this;r.config.keyboard.global&&yr.call(r,window,"keydown keyup",this.handleKey,a,!1),yr.call(r,document.body,"click",this.toggleMenu,a),T2.call(r,document.body,"touchstart",this.firstTouch)}),Te(this,"container",()=>{const{player:a}=this,{config:r,elements:s,timers:c}=a;!r.keyboard.global&&r.keyboard.focused&&nt.call(a,s.container,"keydown keyup",this.handleKey,!1),nt.call(a,s.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",h=>{const{controls:b}=s;b&&h.type==="enterfullscreen"&&(b.pressed=!1,b.hover=!1);let g=0;["touchstart","touchmove","mousemove"].includes(h.type)&&(bt.toggleControls.call(a,!0),g=a.touch?3e3:2e3),clearTimeout(c.controls),c.controls=setTimeout(()=>bt.toggleControls.call(a,!1),g)});const p=()=>{if(!a.isVimeo||a.config.vimeo.premium)return;const h=s.wrapper,{active:b}=a.fullscreen,[g,v]=D2.call(a),y=p6(`aspect-ratio: ${g} / ${v}`);if(!b)return void(y?(h.style.width=null,h.style.height=null):(h.style.maxWidth=null,h.style.margin=null));const[C,T]=Tne(),S=C/T>g/v;y?(h.style.width=S?"auto":"100%",h.style.height=S?"100%":"auto"):(h.style.maxWidth=S?T/v*g+"px":null,h.style.margin=S?"0 auto":null)},f=()=>{clearTimeout(c.resized),c.resized=setTimeout(p,50)};nt.call(a,s.container,"enterfullscreen exitfullscreen",h=>{const{target:b}=a.fullscreen;b===s.container&&(!a.isEmbed&&z.empty(a.config.ratio)||(p(),(h.type==="enterfullscreen"?nt:ns).call(a,window,"resize",f)))})}),Te(this,"media",()=>{const{player:a}=this,{elements:r}=a;if(nt.call(a,a.media,"timeupdate seeking seeked",c=>Se.timeUpdate.call(a,c)),nt.call(a,a.media,"durationchange loadeddata loadedmetadata",c=>Se.durationUpdate.call(a,c)),nt.call(a,a.media,"ended",()=>{a.isHTML5&&a.isVideo&&a.config.resetOnEnd&&(a.restart(),a.pause())}),nt.call(a,a.media,"progress playing seeking seeked",c=>Se.updateProgress.call(a,c)),nt.call(a,a.media,"volumechange",c=>Se.updateVolume.call(a,c)),nt.call(a,a.media,"playing play pause ended emptied timeupdate",c=>bt.checkPlaying.call(a,c)),nt.call(a,a.media,"waiting canplay seeked playing",c=>bt.checkLoading.call(a,c)),a.supported.ui&&a.config.clickToPlay&&!a.isAudio){const c=Vt.call(a,`.${a.config.classNames.video}`);if(!z.element(c))return;nt.call(a,r.container,"click",p=>{([r.container,c].includes(p.target)||c.contains(p.target))&&(a.touch&&a.config.hideControls||(a.ended?(this.proxy(p,a.restart,"restart"),this.proxy(p,()=>{ci(a.play())},"play")):this.proxy(p,()=>{ci(a.togglePlay())},"play")))})}a.supported.ui&&a.config.disableContextMenu&&nt.call(a,r.wrapper,"contextmenu",c=>{c.preventDefault()},!1),nt.call(a,a.media,"volumechange",()=>{a.storage.set({volume:a.volume,muted:a.muted})}),nt.call(a,a.media,"ratechange",()=>{Se.updateSetting.call(a,"speed"),a.storage.set({speed:a.speed})}),nt.call(a,a.media,"qualitychange",c=>{Se.updateSetting.call(a,"quality",null,c.detail.quality)}),nt.call(a,a.media,"ready qualitychange",()=>{Se.setDownloadUrl.call(a)});const s=a.config.events.concat(["keyup","keydown"]).join(" ");nt.call(a,a.media,s,c=>{let{detail:p={}}=c;c.type==="error"&&(p=a.media.error),ze.call(a,r.container,c.type,!0,p)})}),Te(this,"proxy",(a,r,s)=>{const{player:c}=this,p=c.config.listeners[s];let f=!0;z.function(p)&&(f=p.call(c,a)),f!==!1&&z.function(r)&&r.call(c,a)}),Te(this,"bind",(a,r,s,c,p=!0)=>{const{player:f}=this,h=f.config.listeners[c],b=z.function(h);nt.call(f,a,r,g=>this.proxy(g,s,c),p&&!b)}),Te(this,"controls",()=>{const{player:a}=this,{elements:r}=a,s=Wt.isIE?"change":"input";if(r.buttons.play&&Array.from(r.buttons.play).forEach(c=>{this.bind(c,"click",()=>{ci(a.togglePlay())},"play")}),this.bind(r.buttons.restart,"click",a.restart,"restart"),this.bind(r.buttons.rewind,"click",()=>{a.lastSeekTime=Date.now(),a.rewind()},"rewind"),this.bind(r.buttons.fastForward,"click",()=>{a.lastSeekTime=Date.now(),a.forward()},"fastForward"),this.bind(r.buttons.mute,"click",()=>{a.muted=!a.muted},"mute"),this.bind(r.buttons.captions,"click",()=>a.toggleCaptions()),this.bind(r.buttons.download,"click",()=>{ze.call(a,a.media,"download")},"download"),this.bind(r.buttons.fullscreen,"click",()=>{a.fullscreen.toggle()},"fullscreen"),this.bind(r.buttons.pip,"click",()=>{a.pip="toggle"},"pip"),this.bind(r.buttons.airplay,"click",a.airplay,"airplay"),this.bind(r.buttons.settings,"click",c=>{c.stopPropagation(),c.preventDefault(),Se.toggleMenu.call(a,c)},null,!1),this.bind(r.buttons.settings,"keyup",c=>{[" ","Enter"].includes(c.key)&&(c.key!=="Enter"?(c.preventDefault(),c.stopPropagation(),Se.toggleMenu.call(a,c)):Se.focusFirstMenuItem.call(a,null,!0))},null,!1),this.bind(r.settings.menu,"keydown",c=>{c.key==="Escape"&&Se.toggleMenu.call(a,c)}),this.bind(r.inputs.seek,"mousedown mousemove",c=>{const p=r.progress.getBoundingClientRect(),f=100/p.width*(c.pageX-p.left);c.currentTarget.setAttribute("seek-value",f)}),this.bind(r.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",c=>{const p=c.currentTarget,f="play-on-seeked";if(z.keyboardEvent(c)&&!["ArrowLeft","ArrowRight"].includes(c.key))return;a.lastSeekTime=Date.now();const h=p.hasAttribute(f),b=["mouseup","touchend","keyup"].includes(c.type);h&&b?(p.removeAttribute(f),ci(a.play())):!b&&a.playing&&(p.setAttribute(f,""),a.pause())}),Wt.isIos){const c=gr.call(a,'input[type="range"]');Array.from(c).forEach(p=>this.bind(p,s,f=>a6(f.target)))}this.bind(r.inputs.seek,s,c=>{const p=c.currentTarget;let f=p.getAttribute("seek-value");z.empty(f)&&(f=p.value),p.removeAttribute("seek-value"),a.currentTime=f/p.max*a.duration},"seek"),this.bind(r.progress,"mouseenter mouseleave mousemove",c=>Se.updateSeekTooltip.call(a,c)),this.bind(r.progress,"mousemove touchmove",c=>{const{previewThumbnails:p}=a;p&&p.loaded&&p.startMove(c)}),this.bind(r.progress,"mouseleave touchend click",()=>{const{previewThumbnails:c}=a;c&&c.loaded&&c.endMove(!1,!0)}),this.bind(r.progress,"mousedown touchstart",c=>{const{previewThumbnails:p}=a;p&&p.loaded&&p.startScrubbing(c)}),this.bind(r.progress,"mouseup touchend",c=>{const{previewThumbnails:p}=a;p&&p.loaded&&p.endScrubbing(c)}),Wt.isWebKit&&Array.from(gr.call(a,'input[type="range"]')).forEach(c=>{this.bind(c,"input",p=>Se.updateRangeFill.call(a,p.target))}),a.config.toggleInvert&&!z.element(r.display.duration)&&this.bind(r.display.currentTime,"click",()=>{a.currentTime!==0&&(a.config.invertTime=!a.config.invertTime,Se.timeUpdate.call(a))}),this.bind(r.inputs.volume,s,c=>{a.volume=c.target.value},"volume"),this.bind(r.controls,"mouseenter mouseleave",c=>{r.controls.hover=!a.touch&&c.type==="mouseenter"}),r.fullscreen&&Array.from(r.fullscreen.children).filter(c=>!c.contains(r.container)).forEach(c=>{this.bind(c,"mouseenter mouseleave",p=>{r.controls&&(r.controls.hover=!a.touch&&p.type==="mouseenter")})}),this.bind(r.controls,"mousedown mouseup touchstart touchend touchcancel",c=>{r.controls.pressed=["mousedown","touchstart"].includes(c.type)}),this.bind(r.controls,"focusin",()=>{const{config:c,timers:p}=a;dt(r.controls,c.classNames.noTransition,!0),bt.toggleControls.call(a,!0),setTimeout(()=>{dt(r.controls,c.classNames.noTransition,!1)},0);const f=this.touch?3e3:4e3;clearTimeout(p.controls),p.controls=setTimeout(()=>bt.toggleControls.call(a,!1),f)}),this.bind(r.inputs.volume,"wheel",c=>{const p=c.webkitDirectionInvertedFromDevice,[f,h]=[c.deltaX,-c.deltaY].map(v=>p?-v:v),b=Math.sign(Math.abs(f)>Math.abs(h)?f:h);a.increaseVolume(b/50);const{volume:g}=a.media;(b===1&&g<1||b===-1&&g>0)&&c.preventDefault()},"volume",!1)}),this.player=i,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(i){const{player:a}=this,{elements:r}=a,{key:s,type:c,altKey:p,ctrlKey:f,metaKey:h,shiftKey:b}=i,g=c==="keydown",v=g&&s===this.lastKey;if(!(p||f||h||b)&&s){if(g){const C=document.activeElement;if(z.element(C)){const{editable:T}=a.config.selectors,{seek:S}=r.inputs;if(C!==S&&En(C,T)||i.key===" "&&En(C,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(s)&&(i.preventDefault(),i.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":v||(y=parseInt(s,10),a.currentTime=a.duration/10*y);break;case" ":case"k":v||ci(a.togglePlay());break;case"ArrowUp":a.increaseVolume(.1);break;case"ArrowDown":a.decreaseVolume(.1);break;case"m":v||(a.muted=!a.muted);break;case"ArrowRight":a.forward();break;case"ArrowLeft":a.rewind();break;case"f":a.fullscreen.toggle();break;case"c":v||a.toggleCaptions();break;case"l":a.loop=!a.loop}s==="Escape"&&!a.fullscreen.usingNative&&a.fullscreen.active&&a.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null;var y}}toggleMenu(i){Se.toggleMenu.call(this.player,i)}}function qne(o,i){return o(i={exports:{}},i.exports),i.exports}var Fne=qne(function(o,i){o.exports=function(){var a=function(){},r={},s={},c={};function p(y,C){y=y.push?y:[y];var T,S,I,k=[],x=y.length,E=x;for(T=function(A,D){D.length&&k.push(A),--E||C(k)};x--;)S=y[x],(I=s[S])?T(S,I):(c[S]=c[S]||[]).push(T)}function f(y,C){if(y){var T=c[y];if(s[y]=C,T)for(;T.length;)T[0](y,C),T.splice(0,1)}}function h(y,C){y.call&&(y={success:y}),C.length?(y.error||a)(C):(y.success||a)(y)}function b(y,C,T,S){var I,k,x=document,E=T.async,A=(T.numRetries||0)+1,D=T.before||a,P=y.replace(/[\?|#].*$/,""),R=y.replace(/^(css|img)!/,"");S=S||0,/(^css!|\.css$)/.test(P)?((k=x.createElement("link")).rel="stylesheet",k.href=R,(I="hideFocus"in k)&&k.relList&&(I=0,k.rel="preload",k.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(P)?(k=x.createElement("img")).src=R:((k=x.createElement("script")).src=y,k.async=E===void 0||E),k.onload=k.onerror=k.onbeforeload=function(M){var q=M.type[0];if(I)try{k.sheet.cssText.length||(q="e")}catch(Q){Q.code!=18&&(q="e")}if(q=="e"){if((S+=1)<A)return b(y,C,T,S)}else if(k.rel=="preload"&&k.as=="style")return k.rel="stylesheet";C(y,q,M.defaultPrevented)},D(y,k)!==!1&&x.head.appendChild(k)}function g(y,C,T){var S,I,k=(y=y.push?y:[y]).length,x=k,E=[];for(S=function(A,D,P){if(D=="e"&&E.push(A),D=="b"){if(!P)return;E.push(A)}--k||C(E)},I=0;I<x;I++)b(y[I],S,T)}function v(y,C,T){var S,I;if(C&&C.trim&&(S=C),I=(S?T:C)||{},S){if(S in r)throw"LoadJS";r[S]=!0}function k(x,E){g(y,function(A){h(I,A),x&&h({success:x,error:E},A),f(S,A)},I)}if(I.returnPromise)return new Promise(k);k()}return v.ready=function(y,C){return p(y,function(T){h(C,T)}),v},v.done=function(y){f(y,[])},v.reset=function(){r={},s={},c={}},v.isDefined=function(y){return y in r},v}()});function N2(o){return new Promise((i,a)=>{Fne(o,{success:i,error:a})})}function Vne(o){return z.empty(o)?null:z.number(Number(o))?o:o.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:o}function Une(o){const i=o.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return i&&i.length===5?i[4]:null}function kr(o){o&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===o&&(this.media.paused=!o,ze.call(this,this.media,o?"play":"pause"))}const P2={setup(){const o=this;dt(o.elements.wrapper,o.config.classNames.embed,!0),o.options.speed=o.config.speed.options,ia.call(o),z.object(window.Vimeo)?P2.ready.call(o):N2(o.config.urls.vimeo.sdk).then(()=>{P2.ready.call(o)}).catch(i=>{o.debug.warn("Vimeo SDK (player.js) failed to load",i)})},ready(){const o=this,i=o.config.vimeo,{premium:a,referrerPolicy:r,...s}=i;let c=o.media.getAttribute("src"),p="";z.empty(c)?(c=o.media.getAttribute(o.config.attributes.embed.id),p=o.media.getAttribute(o.config.attributes.embed.hash)):p=Une(c);const f=p?{h:p}:{};a&&Object.assign(s,{controls:!1,sidedock:!1});const h=w6({loop:o.config.loop.active,autoplay:o.autoplay,muted:o.muted,gesture:"media",playsinline:o.config.playsinline,...f,...s}),b=Vne(c),g=Ue("iframe"),v=O2(o.config.urls.vimeo.iframe,b,h);if(g.setAttribute("src",v),g.setAttribute("allowfullscreen",""),g.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),z.empty(r)||g.setAttribute("referrerPolicy",r),a||!i.customControls)g.setAttribute("data-poster",o.poster),o.media=os(g,o.media);else{const x=Ue("div",{class:o.config.classNames.embedContainer,"data-poster":o.poster});x.appendChild(g),o.media=os(x,o.media)}i.customControls||Cr(O2(o.config.urls.vimeo.api,v)).then(x=>{!z.empty(x)&&x.thumbnail_url&&bt.setPoster.call(o,x.thumbnail_url).catch(()=>{})}),o.embed=new window.Vimeo.Player(g,{autopause:o.config.autopause,muted:o.muted}),o.media.paused=!0,o.media.currentTime=0,o.supported.ui&&o.embed.disableTextTrack(),o.media.play=()=>(kr.call(o,!0),o.embed.play()),o.media.pause=()=>(kr.call(o,!1),o.embed.pause()),o.media.stop=()=>{o.pause(),o.currentTime=0};let{currentTime:y}=o.media;Object.defineProperty(o.media,"currentTime",{get:()=>y,set(x){const{embed:E,media:A,paused:D,volume:P}=o,R=D&&!E.hasPlayed;A.seeking=!0,ze.call(o,A,"seeking"),Promise.resolve(R&&E.setVolume(0)).then(()=>E.setCurrentTime(x)).then(()=>R&&E.pause()).then(()=>R&&E.setVolume(P)).catch(()=>{})}});let C=o.config.speed.selected;Object.defineProperty(o.media,"playbackRate",{get:()=>C,set(x){o.embed.setPlaybackRate(x).then(()=>{C=x,ze.call(o,o.media,"ratechange")}).catch(()=>{o.options.speed=[1]})}});let{volume:T}=o.config;Object.defineProperty(o.media,"volume",{get:()=>T,set(x){o.embed.setVolume(x).then(()=>{T=x,ze.call(o,o.media,"volumechange")})}});let{muted:S}=o.config;Object.defineProperty(o.media,"muted",{get:()=>S,set(x){const E=!!z.boolean(x)&&x;o.embed.setMuted(!!E||o.config.muted).then(()=>{S=E,ze.call(o,o.media,"volumechange")})}});let I,{loop:k}=o.config;Object.defineProperty(o.media,"loop",{get:()=>k,set(x){const E=z.boolean(x)?x:o.config.loop.active;o.embed.setLoop(E).then(()=>{k=E})}}),o.embed.getVideoUrl().then(x=>{I=x,Se.setDownloadUrl.call(o)}).catch(x=>{this.debug.warn(x)}),Object.defineProperty(o.media,"currentSrc",{get:()=>I}),Object.defineProperty(o.media,"ended",{get:()=>o.currentTime===o.duration}),Promise.all([o.embed.getVideoWidth(),o.embed.getVideoHeight()]).then(x=>{const[E,A]=x;o.embed.ratio=m6(E,A),ia.call(this)}),o.embed.setAutopause(o.config.autopause).then(x=>{o.config.autopause=x}),o.embed.getVideoTitle().then(x=>{o.config.title=x,bt.setTitle.call(this)}),o.embed.getCurrentTime().then(x=>{y=x,ze.call(o,o.media,"timeupdate")}),o.embed.getDuration().then(x=>{o.media.duration=x,ze.call(o,o.media,"durationchange")}),o.embed.getTextTracks().then(x=>{o.media.textTracks=x,lt.setup.call(o)}),o.embed.on("cuechange",({cues:x=[]})=>{const E=x.map(A=>Bne(A.text));lt.updateCues.call(o,E)}),o.embed.on("loaded",()=>{o.embed.getPaused().then(x=>{kr.call(o,!x),x||ze.call(o,o.media,"playing")}),z.element(o.embed.element)&&o.supported.ui&&o.embed.element.setAttribute("tabindex",-1)}),o.embed.on("bufferstart",()=>{ze.call(o,o.media,"waiting")}),o.embed.on("bufferend",()=>{ze.call(o,o.media,"playing")}),o.embed.on("play",()=>{kr.call(o,!0),ze.call(o,o.media,"playing")}),o.embed.on("pause",()=>{kr.call(o,!1)}),o.embed.on("timeupdate",x=>{o.media.seeking=!1,y=x.seconds,ze.call(o,o.media,"timeupdate")}),o.embed.on("progress",x=>{o.media.buffered=x.percent,ze.call(o,o.media,"progress"),parseInt(x.percent,10)===1&&ze.call(o,o.media,"canplaythrough"),o.embed.getDuration().then(E=>{E!==o.media.duration&&(o.media.duration=E,ze.call(o,o.media,"durationchange"))})}),o.embed.on("seeked",()=>{o.media.seeking=!1,ze.call(o,o.media,"seeked")}),o.embed.on("ended",()=>{o.media.paused=!0,ze.call(o,o.media,"ended")}),o.embed.on("error",x=>{o.media.error=x,ze.call(o,o.media,"error")}),i.customControls&&setTimeout(()=>bt.build.call(o),0)}};function zne(o){return z.empty(o)?null:o.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:o}function xr(o){o&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===o&&(this.media.paused=!o,ze.call(this,this.media,o?"play":"pause"))}function Hne(o){return o.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const ss={setup(){if(dt(this.elements.wrapper,this.config.classNames.embed,!0),z.object(window.YT)&&z.function(window.YT.Player))ss.ready.call(this);else{const o=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{z.function(o)&&o(),ss.ready.call(this)},N2(this.config.urls.youtube.sdk).catch(i=>{this.debug.warn("YouTube API failed to load",i)})}},getTitle(o){Cr(O2(this.config.urls.youtube.api,o)).then(i=>{if(z.object(i)){const{title:a,height:r,width:s}=i;this.config.title=a,bt.setTitle.call(this),this.embed.ratio=m6(s,r)}ia.call(this)}).catch(()=>{ia.call(this)})},ready(){const o=this,i=o.config.youtube,a=o.media&&o.media.getAttribute("id");if(!z.empty(a)&&a.startsWith("youtube-"))return;let r=o.media.getAttribute("src");z.empty(r)&&(r=o.media.getAttribute(this.config.attributes.embed.id));const s=zne(r),c=Ue("div",{id:Ene(o.provider),"data-poster":i.customControls?o.poster:void 0});if(o.media=os(c,o.media),i.customControls){const p=f=>`https://i.ytimg.com/vi/${s}/${f}default.jpg`;ls(p("maxres"),121).catch(()=>ls(p("sd"),121)).catch(()=>ls(p("hq"))).then(f=>bt.setPoster.call(o,f.src)).then(f=>{f.includes("maxres")||(o.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}o.embed=new window.YT.Player(o.media,{videoId:s,host:Hne(i),playerVars:Nt({},{autoplay:o.config.autoplay?1:0,hl:o.config.hl,controls:o.supported.ui&&i.customControls?0:1,disablekb:1,playsinline:o.config.playsinline&&!o.config.fullscreen.iosNative?1:0,cc_load_policy:o.captions.active?1:0,cc_lang_pref:o.config.captions.language,widget_referrer:window?window.location.href:null},i),events:{onError(p){if(!o.media.error){const f=p.data,h={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[f]||"An unknown error occurred";o.media.error={code:f,message:h},ze.call(o,o.media,"error")}},onPlaybackRateChange(p){const f=p.target;o.media.playbackRate=f.getPlaybackRate(),ze.call(o,o.media,"ratechange")},onReady(p){if(z.function(o.media.play))return;const f=p.target;ss.getTitle.call(o,s),o.media.play=()=>{xr.call(o,!0),f.playVideo()},o.media.pause=()=>{xr.call(o,!1),f.pauseVideo()},o.media.stop=()=>{f.stopVideo()},o.media.duration=f.getDuration(),o.media.paused=!0,o.media.currentTime=0,Object.defineProperty(o.media,"currentTime",{get:()=>Number(f.getCurrentTime()),set(v){o.paused&&!o.embed.hasPlayed&&o.embed.mute(),o.media.seeking=!0,ze.call(o,o.media,"seeking"),f.seekTo(v)}}),Object.defineProperty(o.media,"playbackRate",{get:()=>f.getPlaybackRate(),set(v){f.setPlaybackRate(v)}});let{volume:h}=o.config;Object.defineProperty(o.media,"volume",{get:()=>h,set(v){h=v,f.setVolume(100*h),ze.call(o,o.media,"volumechange")}});let{muted:b}=o.config;Object.defineProperty(o.media,"muted",{get:()=>b,set(v){const y=z.boolean(v)?v:b;b=y,f[y?"mute":"unMute"](),f.setVolume(100*h),ze.call(o,o.media,"volumechange")}}),Object.defineProperty(o.media,"currentSrc",{get:()=>f.getVideoUrl()}),Object.defineProperty(o.media,"ended",{get:()=>o.currentTime===o.duration});const g=f.getAvailablePlaybackRates();o.options.speed=g.filter(v=>o.config.speed.options.includes(v)),o.supported.ui&&i.customControls&&o.media.setAttribute("tabindex",-1),ze.call(o,o.media,"timeupdate"),ze.call(o,o.media,"durationchange"),clearInterval(o.timers.buffering),o.timers.buffering=setInterval(()=>{o.media.buffered=f.getVideoLoadedFraction(),(o.media.lastBuffered===null||o.media.lastBuffered<o.media.buffered)&&ze.call(o,o.media,"progress"),o.media.lastBuffered=o.media.buffered,o.media.buffered===1&&(clearInterval(o.timers.buffering),ze.call(o,o.media,"canplaythrough"))},200),i.customControls&&setTimeout(()=>bt.build.call(o),50)},onStateChange(p){const f=p.target;switch(clearInterval(o.timers.playing),o.media.seeking&&[1,2].includes(p.data)&&(o.media.seeking=!1,ze.call(o,o.media,"seeked")),p.data){case-1:ze.call(o,o.media,"timeupdate"),o.media.buffered=f.getVideoLoadedFraction(),ze.call(o,o.media,"progress");break;case 0:xr.call(o,!1),o.media.loop?(f.stopVideo(),f.playVideo()):ze.call(o,o.media,"ended");break;case 1:i.customControls&&!o.config.autoplay&&o.media.paused&&!o.embed.hasPlayed?o.media.pause():(xr.call(o,!0),ze.call(o,o.media,"playing"),o.timers.playing=setInterval(()=>{ze.call(o,o.media,"timeupdate")},50),o.media.duration!==f.getDuration()&&(o.media.duration=f.getDuration(),ze.call(o,o.media,"durationchange")));break;case 2:o.muted||o.embed.unMute(),xr.call(o,!1);break;case 3:ze.call(o,o.media,"waiting")}ze.call(o,o.elements.container,"statechange",!1,{code:p.data})}}})}},k6={setup(){this.media?(dt(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),dt(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&dt(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Ue("div",{class:this.config.classNames.video}),l6(this.media,this.elements.wrapper),this.elements.poster=Ue("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Hi.setup.call(this):this.isYouTube?ss.setup.call(this):this.isVimeo&&P2.setup.call(this)):this.debug.warn("No media element found!")}};class Wne{constructor(i){Te(this,"load",()=>{this.enabled&&(z.object(window.google)&&z.object(window.google.ima)?this.ready():N2(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),Te(this,"ready",()=>{var a;this.enabled||((a=this).manager&&a.manager.destroy(),a.elements.displayContainer&&a.elements.displayContainer.destroy(),a.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),Te(this,"setupIMA",()=>{this.elements.container=Ue("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,a=>this.onAdsManagerLoaded(a),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,a=>this.onAdError(a),!1),this.requestAds()}),Te(this,"requestAds",()=>{const{container:a}=this.player.elements;try{const r=new google.ima.AdsRequest;r.adTagUrl=this.tagUrl,r.linearAdSlotWidth=a.offsetWidth,r.linearAdSlotHeight=a.offsetHeight,r.nonLinearAdSlotWidth=a.offsetWidth,r.nonLinearAdSlotHeight=a.offsetHeight,r.forceNonLinearFullSlot=!1,r.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(r)}catch(r){this.onAdError(r)}}),Te(this,"pollCountdown",(a=!1)=>{if(!a)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const r=rs(Math.max(this.manager.getRemainingTime(),0)),s=`${Zt.get("advertisement",this.player.config)} - ${r}`;this.elements.container.setAttribute("data-badge-text",s)},100)}),Te(this,"onAdsManagerLoaded",a=>{if(!this.enabled)return;const r=new google.ima.AdsRenderingSettings;r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.enablePreloading=!0,this.manager=a.getAdsManager(this.player,r),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,s=>this.onAdError(s)),Object.keys(google.ima.AdEvent.Type).forEach(s=>{this.manager.addEventListener(google.ima.AdEvent.Type[s],c=>this.onAdEvent(c))}),this.trigger("loaded")}),Te(this,"addCuePoints",()=>{z.empty(this.cuePoints)||this.cuePoints.forEach(a=>{if(a!==0&&a!==-1&&a<this.player.duration){const r=this.player.elements.progress;if(z.element(r)){const s=100/this.player.duration*a,c=Ue("span",{class:this.player.config.classNames.cues});c.style.left=`${s.toString()}%`,r.appendChild(c)}}})}),Te(this,"onAdEvent",a=>{const{container:r}=this.player.elements,s=a.getAd(),c=a.getAdData();switch((p=>{ze.call(this.player,this.player.media,`ads${p.replace(/_/g,"").toLowerCase()}`)})(a.type),a.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),s.isLinear()||(s.width=r.offsetWidth,s.height=r.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:c.adError&&this.player.debug.warn(`Non-fatal ad error: ${c.adError.getMessage()}`)}}),Te(this,"onAdError",a=>{this.cancel(),this.player.debug.warn("Ads error",a)}),Te(this,"listeners",()=>{const{container:a}=this.player.elements;let r;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{r=this.player.currentTime}),this.player.on("seeked",()=>{const s=this.player.currentTime;z.empty(this.cuePoints)||this.cuePoints.forEach((c,p)=>{r<c&&c<s&&(this.manager.discardAdBreak(),this.cuePoints.splice(p,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(a.offsetWidth,a.offsetHeight,google.ima.ViewMode.NORMAL)})}),Te(this,"play",()=>{const{container:a}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(a.offsetWidth,a.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(r){this.onAdError(r)}}).catch(()=>{})}),Te(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,ci(this.player.media.play())}),Te(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),Te(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),Te(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(a=>{this.on("loaded",a),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),Te(this,"trigger",(a,...r)=>{const s=this.events[a];z.array(s)&&s.forEach(c=>{z.function(c)&&c.apply(this,r)})}),Te(this,"on",(a,r)=>(z.array(this.events[a])||(this.events[a]=[]),this.events[a].push(r),this)),Te(this,"startSafetyTimer",(a,r)=>{this.player.debug.log(`Safety timer invoked from: ${r}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},a)}),Te(this,"clearSafetyTimer",a=>{z.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${a}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=i,this.config=i.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((a,r)=>{this.on("loaded",a),this.on("error",r)}),this.load()}get enabled(){const{config:i}=this;return this.player.isHTML5&&this.player.isVideo&&i.enabled&&(!z.empty(i.publisherId)||z.url(i.tagUrl))}get tagUrl(){const{config:i}=this;return z.url(i.tagUrl)?i.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${w6({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:i.publisherId})}`}}function x6(o=0,i=0,a=255){return Math.min(Math.max(o,i),a)}const Zne=o=>{const i=[];return o.split(/\r\n\r\n|\n\n|\r\r/).forEach(a=>{const r={};a.split(/\r\n|\n|\r/).forEach(s=>{if(z.number(r.startTime)){if(!z.empty(s.trim())&&z.empty(r.text)){const c=s.trim().split("#xywh=");[r.text]=c,c[1]&&([r.x,r.y,r.w,r.h]=c[1].split(","))}}else{const c=s.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);c&&(r.startTime=60*Number(c[1]||0)*60+60*Number(c[2])+Number(c[3])+ +`0.${c[4]}`,r.endTime=60*Number(c[6]||0)*60+60*Number(c[7])+Number(c[8])+ +`0.${c[9]}`)}}),r.text&&i.push(r)}),i},_6=(o,i)=>{const a={};return o>i.width/i.height?(a.width=i.width,a.height=1/o*i.width):(a.height=i.height,a.width=o*i.height),a};class $2{constructor(i){Te(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),Te(this,"getThumbnails",()=>new Promise(a=>{const{src:r}=this.player.config.previewThumbnails;if(z.empty(r))throw new Error("Missing previewThumbnails.src config attribute");const s=()=>{this.thumbnails.sort((c,p)=>c.height-p.height),this.player.debug.log("Preview thumbnails",this.thumbnails),a()};if(z.function(r))r(c=>{this.thumbnails=c,s()});else{const c=(z.string(r)?[r]:r).map(p=>this.getThumbnail(p));Promise.all(c).then(s)}})),Te(this,"getThumbnail",a=>new Promise(r=>{Cr(a).then(s=>{const c={frames:Zne(s),height:null,urlPrefix:""};c.frames[0].text.startsWith("/")||c.frames[0].text.startsWith("http://")||c.frames[0].text.startsWith("https://")||(c.urlPrefix=a.substring(0,a.lastIndexOf("/")+1));const p=new Image;p.onload=()=>{c.height=p.naturalHeight,c.width=p.naturalWidth,this.thumbnails.push(c),r()},p.src=c.urlPrefix+c.frames[0].text})})),Te(this,"startMove",a=>{if(this.loaded&&z.event(a)&&["touchmove","mousemove"].includes(a.type)&&this.player.media.duration){if(a.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var r,s;const c=this.player.elements.progress.getBoundingClientRect(),p=100/c.width*(a.pageX-c.left);this.seekTime=this.player.media.duration*(p/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=a.pageX,this.elements.thumb.time.innerText=rs(this.seekTime);const f=(r=this.player.config.markers)===null||r===void 0||(s=r.points)===null||s===void 0?void 0:s.find(({time:h})=>h===Math.round(this.seekTime));f&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${f.label}<br>`)}this.showImageAtCurrentTime()}}),Te(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),Te(this,"startScrubbing",a=>{(z.nullOrUndefined(a.button)||a.button===!1||a.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),Te(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):T2.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),Te(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),Te(this,"render",()=>{this.elements.thumb.container=Ue("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=Ue("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const a=Ue("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=Ue("span",{},"00:00"),a.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(a),z.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=Ue("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),Te(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),Te(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const a=this.thumbnails[0].frames.findIndex(c=>this.seekTime>=c.startTime&&this.seekTime<=c.endTime),r=a>=0;let s=0;this.mouseDown||this.toggleThumbContainer(r),r&&(this.thumbnails.forEach((c,p)=>{this.loadedImages.includes(c.frames[a].text)&&(s=p)}),a!==this.showingThumb&&(this.showingThumb=a,this.loadImage(s)))}),Te(this,"loadImage",(a=0)=>{const r=this.showingThumb,s=this.thumbnails[a],{urlPrefix:c}=s,p=s.frames[r],f=s.frames[r].text,h=c+f;if(this.currentImageElement&&this.currentImageElement.dataset.filename===f)this.showImage(this.currentImageElement,p,a,r,f,!1),this.currentImageElement.dataset.index=r,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const b=new Image;b.src=h,b.dataset.index=r,b.dataset.filename=f,this.showingThumbFilename=f,this.player.debug.log(`Loading image: ${h}`),b.onload=()=>this.showImage(b,p,a,r,f,!0),this.loadingImage=b,this.removeOldImages(b)}}),Te(this,"showImage",(a,r,s,c,p,f=!0)=>{this.player.debug.log(`Showing thumb: ${p}. num: ${c}. qual: ${s}. newimg: ${f}`),this.setImageSizeAndOffset(a,r),f&&(this.currentImageContainer.appendChild(a),this.currentImageElement=a,this.loadedImages.includes(p)||this.loadedImages.push(p)),this.preloadNearby(c,!0).then(this.preloadNearby(c,!1)).then(this.getHigherQuality(s,a,r,p))}),Te(this,"removeOldImages",a=>{Array.from(this.currentImageContainer.children).forEach(r=>{if(r.tagName.toLowerCase()!=="img")return;const s=this.usingSprites?500:1e3;if(r.dataset.index!==a.dataset.index&&!r.dataset.deleting){r.dataset.deleting=!0;const{currentImageContainer:c}=this;setTimeout(()=>{c.removeChild(r),this.player.debug.log(`Removing thumb: ${r.dataset.filename}`)},s)}})}),Te(this,"preloadNearby",(a,r=!0)=>new Promise(s=>{setTimeout(()=>{const c=this.thumbnails[0].frames[a].text;if(this.showingThumbFilename===c){let p;p=r?this.thumbnails[0].frames.slice(a):this.thumbnails[0].frames.slice(0,a).reverse();let f=!1;p.forEach(h=>{const b=h.text;if(b!==c&&!this.loadedImages.includes(b)){f=!0,this.player.debug.log(`Preloading thumb filename: ${b}`);const{urlPrefix:g}=this.thumbnails[0],v=g+b,y=new Image;y.src=v,y.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${b}`),this.loadedImages.includes(b)||this.loadedImages.push(b),s()}}}),f||s()}},300)})),Te(this,"getHigherQuality",(a,r,s,c)=>{if(a<this.thumbnails.length-1){let p=r.naturalHeight;this.usingSprites&&(p=s.h),p<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===c&&(this.player.debug.log(`Showing higher quality thumb for: ${c}`),this.loadImage(a+1))},300)}}),Te(this,"toggleThumbContainer",(a=!1,r=!1)=>{const s=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(s,a),!a&&r&&(this.showingThumb=null,this.showingThumbFilename=null)}),Te(this,"toggleScrubbingContainer",(a=!1)=>{const r=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(r,a),a||(this.showingThumb=null,this.showingThumbFilename=null)}),Te(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),Te(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:a}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(a.clientHeight>20&&a.clientWidth<20){const r=Math.floor(a.clientHeight*this.thumbAspectRatio);a.style.width=`${r}px`}else if(a.clientHeight<20&&a.clientWidth>20){const r=Math.floor(a.clientWidth/this.thumbAspectRatio);a.style.height=`${r}px`}}else{const r=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);a.style.height=`${this.thumbContainerHeight}px`,a.style.width=`${r}px`}this.setThumbContainerPos()}),Te(this,"setThumbContainerPos",()=>{const a=this.player.elements.progress.getBoundingClientRect(),r=this.player.elements.container.getBoundingClientRect(),{container:s}=this.elements.thumb,c=r.left-a.left+10,p=r.right-a.left-s.clientWidth-10,f=this.mousePosX-a.left-s.clientWidth/2,h=x6(f,c,p);s.style.left=`${h}px`,s.style.setProperty("--preview-arrow-offset",f-h+"px")}),Te(this,"setScrubbingContainerSize",()=>{const{width:a,height:r}=_6(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${a}px`,this.elements.scrubbing.container.style.height=`${r}px`}),Te(this,"setImageSizeAndOffset",(a,r)=>{if(!this.usingSprites)return;const s=this.thumbContainerHeight/r.h;a.style.height=a.naturalHeight*s+"px",a.style.width=a.naturalWidth*s+"px",a.style.left=`-${r.x*s}px`,a.style.top=`-${r.y*s}px`}),this.player=i,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:i}=_6(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return i}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(i){this.mouseDown?this.currentScrubbingImageElement=i:this.currentThumbnailImageElement=i}}const M2={insertElements(o,i){z.string(i)?s6(o,this.media,{src:i}):z.array(i)&&i.forEach(a=>{s6(o,this.media,a)})},change(o){r6(o,"sources.length")?(Hi.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],Si(this.media),this.media=null,z.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:i,type:a}=o,[{provider:r=Wi.html5,src:s}]=i,c=r==="html5"?a:"div",p=r==="html5"?{}:{src:s};Object.assign(this,{provider:r,type:a,supported:Pt.check(a,r,this.config.playsinline),media:Ue(c,p)}),this.elements.container.appendChild(this.media),z.boolean(o.autoplay)&&(this.config.autoplay=o.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),z.empty(o.poster)||(this.poster=o.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),bt.addStyleHook.call(this),this.isHTML5&&M2.insertElements.call(this,"source",i),this.config.title=o.title,k6.setup.call(this),this.isHTML5&&Object.keys(o).includes("tracks")&&M2.insertElements.call(this,"track",o.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&bt.build.call(this),this.isHTML5&&this.media.load(),z.empty(o.previewThumbnails)||(Object.assign(this.config.previewThumbnails,o.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new $2(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class _r{constructor(i,a){if(Te(this,"play",()=>z.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>ci(this.media.play())),this.media.play()):null),Te(this,"pause",()=>this.playing&&z.function(this.media.pause)?this.media.pause():null),Te(this,"togglePlay",f=>(z.boolean(f)?f:!this.playing)?this.play():this.pause()),Te(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):z.function(this.media.stop)&&this.media.stop()}),Te(this,"restart",()=>{this.currentTime=0}),Te(this,"rewind",f=>{this.currentTime-=z.number(f)?f:this.config.seekTime}),Te(this,"forward",f=>{this.currentTime+=z.number(f)?f:this.config.seekTime}),Te(this,"increaseVolume",f=>{const h=this.media.muted?0:this.volume;this.volume=h+(z.number(f)?f:0)}),Te(this,"decreaseVolume",f=>{this.increaseVolume(-f)}),Te(this,"airplay",()=>{Pt.airplay&&this.media.webkitShowPlaybackTargetPicker()}),Te(this,"toggleControls",f=>{if(this.supported.ui&&!this.isAudio){const h=is(this.elements.container,this.config.classNames.hideControls),b=f===void 0?void 0:!f,g=dt(this.elements.container,this.config.classNames.hideControls,b);if(g&&z.array(this.config.controls)&&this.config.controls.includes("settings")&&!z.empty(this.config.settings)&&Se.toggleMenu.call(this,!1),g!==h){const v=g?"controlshidden":"controlsshown";ze.call(this,this.media,v)}return!g}return!1}),Te(this,"on",(f,h)=>{nt.call(this,this.elements.container,f,h)}),Te(this,"once",(f,h)=>{T2.call(this,this.elements.container,f,h)}),Te(this,"off",(f,h)=>{ns(this.elements.container,f,h)}),Te(this,"destroy",(f,h=!1)=>{if(!this.ready)return;const b=()=>{document.body.style.overflow="",this.embed=null,h?(Object.keys(this.elements).length&&(Si(this.elements.buttons.play),Si(this.elements.captions),Si(this.elements.controls),Si(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),z.function(f)&&f()):(Sne.call(this),Hi.cancelRequests.call(this),os(this.elements.original,this.elements.container),ze.call(this,this.elements.original,"destroyed",!0),z.function(f)&&f.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(bt.toggleNativeControls.call(this,!0),b()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&z.function(this.embed.destroy)&&this.embed.destroy(),b()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(b),setTimeout(b,200))}),Te(this,"supports",f=>Pt.mime.call(this,f)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Pt.touch,this.media=i,z.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||z.nodeList(this.media)||z.array(this.media))&&(this.media=this.media[0]),this.config=Nt({},C6,_r.defaults,a||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Mne(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Pt),z.nullOrUndefined(this.media)||!z.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!Pt.check().api)return void this.debug.error("Setup failed: no support");const r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;const s=this.media.tagName.toLowerCase();let c=null,p=null;switch(s){case"div":if(c=this.media.querySelector("iframe"),z.element(c)){if(p=v6(c.getAttribute("src")),this.provider=$ne(p.toString()),this.elements.container=this.media,this.media=c,this.elements.container.className="",p.search.length){const f=["1","true"];f.includes(p.searchParams.get("autoplay"))&&(this.config.autoplay=!0),f.includes(p.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=f.includes(p.searchParams.get("playsinline")),this.config.youtube.hl=p.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(z.empty(this.provider)||!Object.values(Wi).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=B2.video;break;case"video":case"audio":this.type=s,this.provider=Wi.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Pt.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new jne(this),this.storage=new wr(this),this.media.plyr=this,z.element(this.elements.container)||(this.elements.container=Ue("div"),l6(this.media,this.elements.container)),bt.migrateStyles.call(this),bt.addStyleHook.call(this),k6.setup.call(this),this.config.debug&&nt.call(this,this.elements.container,this.config.events.join(" "),f=>{this.debug.log(`event: ${f.type}`)}),this.fullscreen=new jo(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&bt.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Wne(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>ci(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new $2(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Wi.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Wi.youtube}get isVimeo(){return this.provider===Wi.vimeo}get isVideo(){return this.type===B2.video}get isAudio(){return this.type===B2.audio}get playing(){return!!(this.ready&&!this.paused&&!this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(i){if(!this.duration)return;const a=z.number(i)&&i>0;this.media.currentTime=a?Math.min(i,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:i}=this.media;return z.number(i)?i:i&&i.length&&this.duration>0?i.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){const i=parseFloat(this.config.duration),a=(this.media||{}).duration,r=z.number(a)&&a!==1/0?a:0;return i||r}set volume(i){let a=i;z.string(a)&&(a=Number(a)),z.number(a)||(a=this.storage.get("volume")),z.number(a)||({volume:a}=this.config),a>1&&(a=1),a<0&&(a=0),this.config.volume=a,this.media.volume=a,!z.empty(i)&&this.muted&&a>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(i){let a=i;z.boolean(a)||(a=this.storage.get("muted")),z.boolean(a)||(a=this.config.muted),this.config.muted=a,this.media.muted=a}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||!!this.isAudio||!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(i){let a=null;z.number(i)&&(a=i),z.number(a)||(a=this.storage.get("speed")),z.number(a)||(a=this.config.speed.selected);const{minimumSpeed:r,maximumSpeed:s}=this;a=x6(a,r,s),this.config.speed.selected=a,setTimeout(()=>{this.media&&(this.media.playbackRate=a)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(i){const a=this.config.quality,r=this.options.quality;if(!r.length)return;let s=[!z.empty(i)&&Number(i),this.storage.get("quality"),a.selected,a.default].find(z.number),c=!0;if(!r.includes(s)){const p=d6(r,s);this.debug.warn(`Unsupported quality option: ${s}, using ${p} instead`),s=p,c=!1}a.selected=s,this.media.quality=s,c&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(i){const a=z.boolean(i)?i:this.config.loop.active;this.config.loop.active=a,this.media.loop=a}get loop(){return!!this.media.loop}set source(i){M2.change.call(this,i)}get source(){return this.media.currentSrc}get download(){const{download:i}=this.config.urls;return z.url(i)?i:this.source}set download(i){z.url(i)&&(this.config.urls.download=i,Se.setDownloadUrl.call(this))}set poster(i){this.isVideo?bt.setPoster.call(this,i,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const i=as(D2.call(this));return z.array(i)?i.join(":"):i}set ratio(i){this.isVideo?z.string(i)&&f6(i)?(this.config.ratio=as(i),ia.call(this)):this.debug.error(`Invalid aspect ratio specified (${i})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(i){this.config.autoplay=z.boolean(i)?i:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(i){lt.toggle.call(this,i,!1)}set currentTrack(i){lt.set.call(this,i,!1),lt.setup.call(this)}get currentTrack(){const{toggled:i,currentTrack:a}=this.captions;return i?a:-1}set language(i){lt.setLanguage.call(this,i,!1)}get language(){return(lt.getCurrentTrack.call(this)||{}).language}set pip(i){if(!Pt.pip)return;const a=z.boolean(i)?i:!this.pip;z.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(a?R2.active:R2.inactive),z.function(this.media.requestPictureInPicture)&&(!this.pip&&a?this.media.requestPictureInPicture():this.pip&&!a&&document.exitPictureInPicture())}get pip(){return Pt.pip?z.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===R2.active:null}setPreviewThumbnails(i){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,i),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new $2(this))}static supported(i,a){return Pt.check(i,a)}static loadSprite(i,a){return g6(i,a)}static setup(i,a={}){let r=null;return z.string(i)?r=Array.from(document.querySelectorAll(i)):z.nodeList(i)?r=Array.from(i):z.array(i)&&(r=i.filter(z.element)),z.empty(r)?null:r.map(s=>new _r(s,a))}}_r.defaults=kne(C6);const Yne=Object.freeze(Object.defineProperty({__proto__:null,default:_r},Symbol.toStringTag,{value:"Module"}));return Uie});
|