From 7e63a94be49016937fff71f7fc3d33d7e80eb75e Mon Sep 17 00:00:00 2001 From: iOS Date: Sat, 24 Feb 2024 07:12:27 +0100 Subject: [PATCH] lyon push --- .obsidian/plugins/cron/data.json | 2 +- .obsidian/plugins/media-extended/main.js | 222 +++++- .../plugins/media-extended/manifest.json | 8 +- .obsidian/plugins/media-extended/styles.css | 2 +- .../obsidian-activity-history/data.json | 36 +- .../plugins/obsidian-admonition/data.json | 2 +- .obsidian/plugins/obsidian-admonition/main.js | 2 +- .../plugins/obsidian-admonition/manifest.json | 2 +- .../plugins/obsidian-admonition/styles.css | 2 +- .obsidian/plugins/obsidian-commits/data.json | 302 +++++--- .../plugins/obsidian-dice-roller/main.js | 6 +- .../obsidian-dice-roller/manifest.json | 2 +- .../plugins/obsidian-dice-roller/styles.css | 2 +- .../obsidian-reminder-plugin/data.json | 139 ++-- .obsidian/plugins/obsidian-tts/data.json | 20 + .obsidian/plugins/obsidian-tts/main.js | 693 +++++++++++------- .obsidian/plugins/obsidian-tts/manifest.json | 6 +- .obsidian/plugins/quickadd/data.json | 2 +- .obsidian/plugins/quickadd/main.js | 157 ++-- .obsidian/plugins/quickadd/manifest.json | 3 +- .obsidian/plugins/templater-obsidian/main.js | 88 ++- .../plugins/templater-obsidian/manifest.json | 4 +- .obsidian/themes/Minimal/manifest.json | 4 +- .obsidian/themes/Minimal/theme.css | 61 +- .obsidian/themes/Things/manifest.json | 2 +- .obsidian/themes/Things/theme.css | 102 ++- .obsidian/workspace-mobile.json | 62 +- 00.01 Admin/Calendars/2023-12-28.md | 2 +- 00.01 Admin/Calendars/2024-02-09.md | 2 +- 00.01 Admin/Calendars/2024-02-14.md | 2 +- 00.01 Admin/Calendars/2024-02-16.md | 4 +- 00.01 Admin/Calendars/2024-02-17.md | 134 ++++ 00.01 Admin/Calendars/2024-02-18.md | 134 ++++ 00.01 Admin/Calendars/2024-02-19.md | 136 ++++ 00.01 Admin/Calendars/2024-02-20.md | 136 ++++ 00.01 Admin/Calendars/2024-02-21.md | 134 ++++ 00.01 Admin/Calendars/2024-02-22.md | 136 ++++ 00.01 Admin/Calendars/2024-02-23.md | 134 ++++ 00.01 Admin/Calendars/2024-02-24.md | 134 ++++ .../2022-03-19 🏠 Arrivée Meggi-mo.md | 12 + .../2022-03-24 🎡 Départ de Meggi-mo.md | 11 + .../2022-03-31 🏠 Arrivée de Papa.md | 9 + .../Events/2022-04-04 🗼 Départ Papa.md | 9 + ...-04-10 🗳️ 1er tour Présidentielle.md | 11 + ... 2nd tour élections présidentielles.md | 8 + .../2022-04-27 📍 Arrivée à Lisbonne.md | 9 + .../2022-05-01 🏠 Départ de Lisbonne.md | 9 + ... Definite arrival of Meggi-mo to Züzü.md | 9 + .../Events/2022-10-14 📍 Weekend à GVA.md | 17 + .../2022-10-21 🗼 Weekend à Paris.md | 16 + ...9 💍 Fiançailles Marguerite & Arnold.md | 10 + .../Events/2022-12-26 🏠 Papa à Zürich.md | 12 + .../2022-12-30 🏠 Stef & Kyna in Zürich.md | 12 + .../Events/2023-01-23 🩺 Médecin.md | 13 + .../Events/2023-02-06 📍 Genève.md | 12 + .../Events/2023-02-09 🩺 Médecin.md | 13 + .../2023-02-11 💍 Mariage Eloi & Zélie.md | 91 +++ .../2023-02-19 🎞️ Tár @ Riff Raff.md | 13 + .../Events/2023-03-06 🩺 Médecin.md | 12 + ...023-03-11 🏠 Marg & Arnold à Zürich.md | 13 + ...8 🇨🇭 Molly & boyfriend in Zürich.md | 12 + .../Events/2023-04-14 🩺 Médecin.md | 13 + .../Events/2023-12-21 🏠 Arrivée Papa.md | 10 + .../Events/2023-12-27 🗼 Départ Papa.md | 10 + 00.02 Inbox/Zoo Station.md | 2 +- ...Cillian Murphy Is the Man of the Moment.md | 258 +++++++ ...US Responds to Threats Around the Globe.md | 182 +++++ ...n den USA mit Fasnacht und Urdemokratie.md | 134 ++++ 00.03 News/In the Land of the Very Old.md | 6 +- ... AI to Translate the Herculaneum Papyri.md | 8 +- ...an Conflict and the Long Shadow of 1948.md | 142 ++++ ...tch found the answer to burnout culture.md | 79 ++ 00.03 News/The rise and fall of robots.txt.md | 100 +++ ... a professional bridesmaid - The Hustle.md | 171 +++++ 00.08 Bookmarks/Bookmarks - Art.md | 3 +- .../Bookmarks - Selfhosted Apps.md | 3 +- 01.02 Home/@Main Dashboard.md | 2 +- 01.02 Home/@Shopping list.md | 10 +- 01.02 Home/Household.md | 9 +- 02.03 Zürich/@@Zürich.md | 5 +- 02.03 Zürich/Juan Bautista Bossio.md | 3 +- .../Seven Pillars of Wisdom.md | 4 +- 03.03 Food & Wine/Sesame Seared Tuna Steak.md | 152 ++++ 04.01 lebv.org/lebv Research Tasks.md | 2 +- 05.02 Networks/Configuring UFW.md | 8 +- 05.02 Networks/Server Tools.md | 3 +- 06.01 Finances/2024.ledger | 146 +++- 87 files changed, 4054 insertions(+), 765 deletions(-) create mode 100644 .obsidian/plugins/obsidian-tts/data.json create mode 100644 00.01 Admin/Calendars/2024-02-17.md create mode 100644 00.01 Admin/Calendars/2024-02-18.md create mode 100644 00.01 Admin/Calendars/2024-02-19.md create mode 100644 00.01 Admin/Calendars/2024-02-20.md create mode 100644 00.01 Admin/Calendars/2024-02-21.md create mode 100644 00.01 Admin/Calendars/2024-02-22.md create mode 100644 00.01 Admin/Calendars/2024-02-23.md create mode 100644 00.01 Admin/Calendars/2024-02-24.md create mode 100644 00.01 Admin/Calendars/Events/2022-03-19 🏠 Arrivée Meggi-mo.md create mode 100644 00.01 Admin/Calendars/Events/2022-03-24 🎡 Départ de Meggi-mo.md create mode 100644 00.01 Admin/Calendars/Events/2022-03-31 🏠 Arrivée de Papa.md create mode 100644 00.01 Admin/Calendars/Events/2022-04-04 🗼 Départ Papa.md create mode 100644 00.01 Admin/Calendars/Events/2022-04-10 🗳️ 1er tour Présidentielle.md create mode 100644 00.01 Admin/Calendars/Events/2022-04-24 🗳️ 2nd tour élections présidentielles.md create mode 100644 00.01 Admin/Calendars/Events/2022-04-27 📍 Arrivée à Lisbonne.md create mode 100644 00.01 Admin/Calendars/Events/2022-05-01 🏠 Départ de Lisbonne.md create mode 100644 00.01 Admin/Calendars/Events/2022-05-15 🏠 Definite arrival of Meggi-mo to Züzü.md create mode 100644 00.01 Admin/Calendars/Events/2022-10-14 📍 Weekend à GVA.md create mode 100644 00.01 Admin/Calendars/Events/2022-10-21 🗼 Weekend à Paris.md create mode 100644 00.01 Admin/Calendars/Events/2022-11-19 💍 Fiançailles Marguerite & Arnold.md create mode 100644 00.01 Admin/Calendars/Events/2022-12-26 🏠 Papa à Zürich.md create mode 100644 00.01 Admin/Calendars/Events/2022-12-30 🏠 Stef & Kyna in Zürich.md create mode 100644 00.01 Admin/Calendars/Events/2023-01-23 🩺 Médecin.md create mode 100644 00.01 Admin/Calendars/Events/2023-02-06 📍 Genève.md create mode 100644 00.01 Admin/Calendars/Events/2023-02-09 🩺 Médecin.md create mode 100644 00.01 Admin/Calendars/Events/2023-02-11 💍 Mariage Eloi & Zélie.md create mode 100644 00.01 Admin/Calendars/Events/2023-02-19 🎞️ Tár @ Riff Raff.md create mode 100644 00.01 Admin/Calendars/Events/2023-03-06 🩺 Médecin.md create mode 100644 00.01 Admin/Calendars/Events/2023-03-11 🏠 Marg & Arnold à Zürich.md create mode 100644 00.01 Admin/Calendars/Events/2023-03-18 🇨🇭 Molly & boyfriend in Zürich.md create mode 100644 00.01 Admin/Calendars/Events/2023-04-14 🩺 Médecin.md create mode 100644 00.01 Admin/Calendars/Events/2023-12-21 🏠 Arrivée Papa.md create mode 100644 00.01 Admin/Calendars/Events/2023-12-27 🗼 Départ Papa.md create mode 100644 00.03 News/Cillian Murphy Is the Man of the Moment.md create mode 100644 00.03 News/Exclusive Life Aboard a Nuclear Submarine as the US Responds to Threats Around the Globe.md create mode 100644 00.03 News/Helvetia ein Schweizer Dorf in den USA mit Fasnacht und Urdemokratie.md create mode 100644 00.03 News/The Israeli-Palestinian Conflict and the Long Shadow of 1948.md create mode 100644 00.03 News/The art of doing nothing have the Dutch found the answer to burnout culture.md create mode 100644 00.03 News/The rise and fall of robots.txt.md create mode 100644 00.03 News/The surreal life of a professional bridesmaid - The Hustle.md rename {00.02 Inbox => 03.01 Reading list}/Seven Pillars of Wisdom.md (94%) create mode 100644 03.03 Food & Wine/Sesame Seared Tuna Steak.md diff --git a/.obsidian/plugins/cron/data.json b/.obsidian/plugins/cron/data.json index 901aec01..bf9e1c49 100644 --- a/.obsidian/plugins/cron/data.json +++ b/.obsidian/plugins/cron/data.json @@ -19,7 +19,7 @@ "601d1cc7-a4f3-4f19-aa9f-3bddd7ab6b1d": { "locked": false, "lockedDeviceName": "iPhone", - "lastRun": "2024-02-16T07:42:36+01:00" + "lastRun": "2024-02-24T07:01:59+01:00" } } } \ No newline at end of file diff --git a/.obsidian/plugins/media-extended/main.js b/.obsidian/plugins/media-extended/main.js index fd39c947..df44c64b 100644 --- a/.obsidian/plugins/media-extended/main.js +++ b/.obsidian/plugins/media-extended/main.js @@ -3,41 +3,187 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source visit the plugins github repository */ -var As=Object.create;var Dr=Object.defineProperty,Ms=Object.defineProperties,Rs=Object.getOwnPropertyDescriptor,Cs=Object.getOwnPropertyDescriptors,bs=Object.getOwnPropertyNames,Kn=Object.getOwnPropertySymbols,Is=Object.getPrototypeOf,Yn=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var Wn=(e,g,r)=>g in e?Dr(e,g,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[g]=r,rr=(e,g)=>{for(var r in g||(g={}))Yn.call(g,r)&&Wn(e,r,g[r]);if(Kn)for(var r of Kn(g))ws.call(g,r)&&Wn(e,r,g[r]);return e},Nr=(e,g)=>Ms(e,Cs(g)),zn=e=>Dr(e,"__esModule",{value:!0});var _o=typeof require!="undefined"?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};var sr=(e,g)=>()=>(g||e((g={exports:{}}).exports,g),g.exports),Ds=(e,g)=>{zn(e);for(var r in g)Dr(e,r,{get:g[r],enumerable:!0})},Ns=(e,g,r)=>{if(g&&typeof g=="object"||typeof g=="function")for(let t of bs(g))!Yn.call(e,t)&&t!=="default"&&Dr(e,t,{get:()=>g[t],enumerable:!(r=Rs(g,t))||r.enumerable});return e},Jt=e=>Ns(zn(Dr(e!=null?As(Is(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var Bt=(e,g,r)=>new Promise((t,p)=>{var i=f=>{try{n(r.next(f))}catch(h){p(h)}},o=f=>{try{n(r.throw(f))}catch(h){p(h)}},n=f=>f.done?t(f.value):Promise.resolve(f.value).then(i,o);n((r=r.apply(e,g)).next())});var Pr=sr(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});function qn(e,g){if(g)return e;throw new Error("Unhandled discriminated union member: "+JSON.stringify(e))}Gr.assertNever=qn;Gr.default=qn});var Kr=sr((Vr,Xn)=>{(function(e,g){typeof Vr=="object"&&typeof Xn!="undefined"?g(Vr):typeof define=="function"&&define.amd?define(["exports"],g):(e=typeof globalThis!="undefined"?globalThis:e||self,g(e["@tinyfe/parseUnit"]={}))})(Vr,function(e){"use strict";let g="(v[h|w|min|max]|p[c|t|x]|[re|e|c|m]m|[l|c]h|%|in|Q|ex)",r=new RegExp(g),t=["auto","revert","unset","inherit","initial","max-content","min-content","fit-content","-webkit-fill-available"];function p(o){return r.test(i(o)[1])}function i(o,n={}){let{onlyValue:f=!1,onlyUnit:h=!1}=n;if(typeof o=="number")return f?o:h?"":[o,""];let m=[0,""];if(t.includes(o))return[o,""];o=String(o);let u=parseFloat(o),_=o.match(/[\d.\-\+]*\s*(.*)/)[1];return m=[u,_],f?u:h?_:m}e.cssUnit=g,e.cssUnitRegex=r,e.default=i,e.isCssValue=p,Object.defineProperty(e,"__esModule",{value:!0})})});var na=sr((ko,ra)=>{"use strict";ra.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,g=>`%${g.charCodeAt(0).toString(16).toUpperCase()}`)});var la=sr((Bo,oa)=>{"use strict";var aa="%[a-f0-9]{2}",ia=new RegExp(aa,"gi"),sa=new RegExp("("+aa+")+","gi");function cn(e,g){try{return decodeURIComponent(e.join(""))}catch(p){}if(e.length===1)return e;g=g||1;var r=e.slice(0,g),t=e.slice(g);return Array.prototype.concat.call([],cn(r),cn(t))}function Ps(e){try{return decodeURIComponent(e)}catch(t){for(var g=e.match(ia),r=1;r{"use strict";ua.exports=(e,g)=>{if(!(typeof e=="string"&&typeof g=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(g==="")return[e];let r=e.indexOf(g);return r===-1?[e]:[e.slice(0,r),e.slice(r+g.length)]}});var ca=sr((Ho,da)=>{"use strict";da.exports=function(e,g){for(var r={},t=Object.keys(e),p=Array.isArray(g),i=0;i{"use strict";var Ls=na(),Fs=la(),ha=fa(),xs=ca(),ks=e=>e==null,hn=Symbol("encodeFragmentIdentifier");function Bs(e){switch(e.arrayFormat){case"index":return g=>(r,t)=>{let p=r.length;return t===void 0||e.skipNull&&t===null||e.skipEmptyString&&t===""?r:t===null?[...r,[tr(g,e),"[",p,"]"].join("")]:[...r,[tr(g,e),"[",tr(p,e),"]=",tr(t,e)].join("")]};case"bracket":return g=>(r,t)=>t===void 0||e.skipNull&&t===null||e.skipEmptyString&&t===""?r:t===null?[...r,[tr(g,e),"[]"].join("")]:[...r,[tr(g,e),"[]=",tr(t,e)].join("")];case"comma":case"separator":case"bracket-separator":{let g=e.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(t,p)=>p===void 0||e.skipNull&&p===null||e.skipEmptyString&&p===""?t:(p=p===null?"":p,t.length===0?[[tr(r,e),g,tr(p,e)].join("")]:[[t,tr(p,e)].join(e.arrayFormatSeparator)])}default:return g=>(r,t)=>t===void 0||e.skipNull&&t===null||e.skipEmptyString&&t===""?r:t===null?[...r,tr(g,e)]:[...r,[tr(g,e),"=",tr(t,e)].join("")]}}function Us(e){let g;switch(e.arrayFormat){case"index":return(r,t,p)=>{if(g=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!g){p[r]=t;return}p[r]===void 0&&(p[r]={}),p[r][g[1]]=t};case"bracket":return(r,t,p)=>{if(g=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!g){p[r]=t;return}if(p[r]===void 0){p[r]=[t];return}p[r]=[].concat(p[r],t)};case"comma":case"separator":return(r,t,p)=>{let i=typeof t=="string"&&t.includes(e.arrayFormatSeparator),o=typeof t=="string"&&!i&&Er(t,e).includes(e.arrayFormatSeparator);t=o?Er(t,e):t;let n=i||o?t.split(e.arrayFormatSeparator).map(f=>Er(f,e)):t===null?t:Er(t,e);p[r]=n};case"bracket-separator":return(r,t,p)=>{let i=/(\[\])$/.test(r);if(r=r.replace(/\[\]$/,""),!i){p[r]=t&&Er(t,e);return}let o=t===null?[]:t.split(e.arrayFormatSeparator).map(n=>Er(n,e));if(p[r]===void 0){p[r]=o;return}p[r]=[].concat(p[r],o)};default:return(r,t,p)=>{if(p[r]===void 0){p[r]=t;return}p[r]=[].concat(p[r],t)}}}function ga(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function tr(e,g){return g.encode?g.strict?Ls(e):encodeURIComponent(e):e}function Er(e,g){return g.decode?Fs(e):e}function ma(e){return Array.isArray(e)?e.sort():typeof e=="object"?ma(Object.keys(e)).sort((g,r)=>Number(g)-Number(r)).map(g=>e[g]):e}function pa(e){let g=e.indexOf("#");return g!==-1&&(e=e.slice(0,g)),e}function Hs(e){let g="",r=e.indexOf("#");return r!==-1&&(g=e.slice(r)),g}function va(e){e=pa(e);let g=e.indexOf("?");return g===-1?"":e.slice(g+1)}function ya(e,g){return g.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):g.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function Ea(e,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),ga(g.arrayFormatSeparator);let r=Us(g),t=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return t;for(let p of e.split("&")){if(p==="")continue;let[i,o]=ha(g.decode?p.replace(/\+/g," "):p,"=");o=o===void 0?null:["comma","separator","bracket-separator"].includes(g.arrayFormat)?o:Er(o,g),r(Er(i,g),o,t)}for(let p of Object.keys(t)){let i=t[p];if(typeof i=="object"&&i!==null)for(let o of Object.keys(i))i[o]=ya(i[o],g);else t[p]=ya(i,g)}return g.sort===!1?t:(g.sort===!0?Object.keys(t).sort():Object.keys(t).sort(g.sort)).reduce((p,i)=>{let o=t[i];return Boolean(o)&&typeof o=="object"&&!Array.isArray(o)?p[i]=ma(o):p[i]=o,p},Object.create(null))}or.extract=va;or.parse=Ea;or.stringify=(e,g)=>{if(!e)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),ga(g.arrayFormatSeparator);let r=o=>g.skipNull&&ks(e[o])||g.skipEmptyString&&e[o]==="",t=Bs(g),p={};for(let o of Object.keys(e))r(o)||(p[o]=e[o]);let i=Object.keys(p);return g.sort!==!1&&i.sort(g.sort),i.map(o=>{let n=e[o];return n===void 0?"":n===null?tr(o,g):Array.isArray(n)?n.length===0&&g.arrayFormat==="bracket-separator"?tr(o,g)+"[]":n.reduce(t(o),[]).join("&"):tr(o,g)+"="+tr(n,g)}).filter(o=>o.length>0).join("&")};or.parseUrl=(e,g)=>{g=Object.assign({decode:!0},g);let[r,t]=ha(e,"#");return Object.assign({url:r.split("?")[0]||"",query:Ea(va(e),g)},g&&g.parseFragmentIdentifier&&t?{fragmentIdentifier:Er(t,g)}:{})};or.stringifyUrl=(e,g)=>{g=Object.assign({encode:!0,strict:!0,[hn]:!0},g);let r=pa(e.url).split("?")[0]||"",t=or.extract(e.url),p=or.parse(t,{sort:!1}),i=Object.assign(p,e.query),o=or.stringify(i,g);o&&(o=`?${o}`);let n=Hs(e.url);return e.fragmentIdentifier&&(n=`#${g[hn]?tr(e.fragmentIdentifier,g):e.fragmentIdentifier}`),`${r}${o}${n}`};or.pick=(e,g,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[hn]:!1},r);let{url:t,query:p,fragmentIdentifier:i}=or.parseUrl(e,r);return or.stringifyUrl({url:t,query:xs(p,g),fragmentIdentifier:i},r)};or.exclude=(e,g,r)=>{let t=Array.isArray(g)?p=>!g.includes(p):(p,i)=>!g(p,i);return or.pick(e,t,r)}});var Ta=sr((Vo,_a)=>{"use strict";_a.exports=function(g,r){if(r=r.split(":")[0],g=+g,!g)return!1;switch(r){case"http":case"ws":return g!==80;case"https":case"wss":return g!==443;case"ftp":return g!==21;case"gopher":return g!==70;case"file":return!1}return g!==0}});var Ma=sr(gn=>{"use strict";var Gs=Object.prototype.hasOwnProperty,Vs;function Sa(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(g){return null}}function Aa(e){try{return encodeURIComponent(e)}catch(g){return null}}function Ks(e){for(var g=/([^=?#&]+)=?([^&]*)/g,r={},t;t=g.exec(e);){var p=Sa(t[1]),i=Sa(t[2]);p===null||i===null||p in r||(r[p]=i)}return r}function Ys(e,g){g=g||"";var r=[],t,p;typeof g!="string"&&(g="?");for(p in e)if(Gs.call(e,p)){if(t=e[p],!t&&(t===null||t===Vs||isNaN(t))&&(t=""),p=Aa(p),t=Aa(t),p===null||t===null)continue;r.push(p+"="+t)}return r.length?g+r.join("&"):""}gn.stringify=Ys;gn.parse=Ks});var Da=sr((Yo,wa)=>{"use strict";var Ra=Ta(),qr=Ma(),Ws=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,zs=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,qs=/^[a-zA-Z]:/,Xs="[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]",js=new RegExp("^"+Xs+"+");function mn(e){return(e||"").toString().replace(js,"")}var pn=[["#","hash"],["?","query"],function(g,r){return _r(r.protocol)?g.replace(/\\/g,"/"):g},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Ca={hash:1,query:1};function ba(e){var g;typeof window!="undefined"?g=window:typeof global!="undefined"?g=global:typeof self!="undefined"?g=self:g={};var r=g.location||{};e=e||r;var t={},p=typeof e,i;if(e.protocol==="blob:")t=new mr(unescape(e.pathname),{});else if(p==="string"){t=new mr(e,{});for(i in Ca)delete t[i]}else if(p==="object"){for(i in e)i in Ca||(t[i]=e[i]);t.slashes===void 0&&(t.slashes=Ws.test(e.href))}return t}function _r(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Ia(e,g){e=mn(e),g=g||{};var r=zs.exec(e),t=r[1]?r[1].toLowerCase():"",p=!!r[2],i=!!r[3],o=0,n;return p?i?(n=r[2]+r[3]+r[4],o=r[2].length+r[3].length):(n=r[2]+r[4],o=r[2].length):i?(n=r[3]+r[4],o=r[3].length):n=r[4],t==="file:"?o>=2&&(n=n.slice(2)):_r(t)?n=r[4]:t?p&&(n=n.slice(2)):o>=2&&_r(g.protocol)&&(n=r[4]),{protocol:t,slashes:p||_r(t),slashesCount:o,rest:n}}function Qs(e,g){if(e==="")return g;for(var r=(g||"/").split("/").slice(0,-1).concat(e.split("/")),t=r.length,p=r[t-1],i=!1,o=0;t--;)r[t]==="."?r.splice(t,1):r[t]===".."?(r.splice(t,1),o++):o&&(t===0&&(i=!0),r.splice(t,1),o--);return i&&r.unshift(""),(p==="."||p==="..")&&r.push(""),r.join("/")}function mr(e,g,r){if(e=mn(e),!(this instanceof mr))return new mr(e,g,r);var t,p,i,o,n,f,h=pn.slice(),m=typeof g,u=this,_=0;for(m!=="object"&&m!=="string"&&(r=g,g=null),r&&typeof r!="function"&&(r=qr.parse),g=ba(g),p=Ia(e||"",g),t=!p.protocol&&!p.slashes,u.slashes=p.slashes||t&&g.slashes,u.protocol=p.protocol||g.protocol||"",e=p.rest,(p.protocol==="file:"&&(p.slashesCount!==2||qs.test(e))||!p.slashes&&(p.protocol||p.slashesCount<2||!_r(u.protocol)))&&(h[3]=[/(.*)/,"pathname"]);_{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});var eo=function(){function e(g,r){for(var t=0;t").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat(`\r -\r -`)}},{key:"toTypedArray",value:function(r){var t=[];return r.split("").forEach(function(p){t.push(parseInt(p.charCodeAt(),16))}),Uint8Array.from(t)}}]),e}();window.WebVTTConverter=Na;vn.default=Na});var Ua=sr((An,Mn)=>{typeof navigator=="object"&&function(e,g){typeof An=="object"&&typeof Mn!="undefined"?Mn.exports=g():typeof define=="function"&&define.amd?define("Plyr",g):(e=typeof globalThis!="undefined"?globalThis:e||self).Plyr=g()}(An,function(){"use strict";function e(S,z,F){return z in S?Object.defineProperty(S,z,{value:F,enumerable:!0,configurable:!0,writable:!0}):S[z]=F,S}function g(S,z){for(var F=0;Fz){var F=function(q){var fe="".concat(q).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return fe?Math.max(0,(fe[1]?fe[1].length:0)-(fe[2]?+fe[2]:0)):0}(z);return parseFloat(S.toFixed(F))}return Math.round(S/z)*z}var M=function(){function S(z,F){(function(q,fe){if(!(q instanceof fe))throw new TypeError("Cannot call a class as a function")})(this,S),w(z)?this.element=z:k(z)&&(this.element=document.querySelector(z)),w(this.element)&&N(this.element.rangeTouch)&&(this.config=p({},i,{},F),this.init())}return function(z,F,q){F&&g(z.prototype,F),q&&g(z,q)}(S,[{key:"init",value:function(){S.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(){S.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(z){var F=this,q=z?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(fe){F.element[q](fe,function(ge){return F.set(ge)},!1)})}},{key:"get",value:function(z){if(!S.enabled||!H(z))return null;var F,q=z.target,fe=z.changedTouches[0],ge=parseFloat(q.getAttribute("min"))||0,Me=parseFloat(q.getAttribute("max"))||100,ke=parseFloat(q.getAttribute("step"))||1,$e=q.getBoundingClientRect(),gt=100/$e.width*(this.config.thumbWidth/2)/100;return 0>(F=100/$e.width*(fe.clientX-$e.left))?F=0:100F?F-=(100-2*F)*gt:50S!=null?S.constructor:null,D=(S,z)=>Boolean(S&&z&&S instanceof z),v=S=>S==null,T=S=>I(S)===Object,W=S=>I(S)===String,O=S=>I(S)===Function,B=S=>Array.isArray(S),L=S=>D(S,NodeList),K=S=>v(S)||(W(S)||B(S)||L(S))&&!S.length||T(S)&&!Object.keys(S).length;var x=v,U=T,Y=S=>I(S)===Number&&!Number.isNaN(S),oe=W,ue=S=>I(S)===Boolean,re=O,ve=B,ce=L,se=S=>S!==null&&typeof S=="object"&&S.nodeType===1&&typeof S.style=="object"&&typeof S.ownerDocument=="object",J=S=>D(S,Event),ee=S=>D(S,KeyboardEvent),ie=S=>D(S,TextTrack)||!v(S)&&W(S.kind),me=S=>D(S,Promise)&&O(S.then),de=S=>{if(D(S,window.URL))return!0;if(!W(S))return!1;let z=S;S.startsWith("http://")&&S.startsWith("https://")||(z=`http://${S}`);try{return!K(new URL(z).hostname)}catch(F){return!1}},Q=K;let X=(()=>{let S=document.createElement("span"),z={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},F=Object.keys(z).find(q=>S.style[q]!==void 0);return!!oe(F)&&z[F]})();function j(S,z){setTimeout(()=>{try{S.hidden=!0,S.offsetHeight,S.hidden=!1}catch(F){}},z)}let le={isIE:Boolean(window.document.documentMode),isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function G(S,z){return z.split(".").reduce((F,q)=>F&&F[q],S)}function c(S={},...z){if(!z.length)return S;let F=z.shift();return U(F)?(Object.keys(F).forEach(q=>{U(F[q])?(Object.keys(S).includes(q)||Object.assign(S,{[q]:{}}),c(S[q],F[q])):Object.assign(S,{[q]:F[q]})}),c(S,...z)):S}function E(S,z){let F=S.length?S:[S];Array.from(F).reverse().forEach((q,fe)=>{let ge=fe>0?z.cloneNode(!0):z,Me=q.parentNode,ke=q.nextSibling;ge.appendChild(q),ke?Me.insertBefore(ge,ke):Me.appendChild(ge)})}function b(S,z){se(S)&&!Q(z)&&Object.entries(z).filter(([,F])=>!x(F)).forEach(([F,q])=>S.setAttribute(F,q))}function l(S,z,F){let q=document.createElement(S);return U(z)&&b(q,z),oe(F)&&(q.innerText=F),q}function d(S,z,F,q){se(z)&&z.appendChild(l(S,F,q))}function y(S){ce(S)||ve(S)?Array.from(S).forEach(y):se(S)&&se(S.parentNode)&&S.parentNode.removeChild(S)}function V(S){if(!se(S))return;let{length:z}=S.childNodes;for(;z>0;)S.removeChild(S.lastChild),z-=1}function te(S,z){return se(z)&&se(z.parentNode)&&se(S)?(z.parentNode.replaceChild(S,z),S):null}function $(S,z){if(!oe(S)||Q(S))return{};let F={},q=c({},z);return S.split(",").forEach(fe=>{let ge=fe.trim(),Me=ge.replace(".",""),ke=ge.replace(/[[\]]/g,"").split("="),[$e]=ke,gt=ke.length>1?ke[1].replace(/["']/g,""):"";switch(ge.charAt(0)){case".":oe(q.class)?F.class=`${q.class} ${Me}`:F.class=Me;break;case"#":F.id=ge.replace("#","");break;case"[":F[$e]=gt}}),c(q,F)}function ae(S,z){if(!se(S))return;let F=z;ue(F)||(F=!S.hidden),S.hidden=F}function ne(S,z,F){if(ce(S))return Array.from(S).map(q=>ne(q,z,F));if(se(S)){let q="toggle";return F!==void 0&&(q=F?"add":"remove"),S.classList[q](z),S.classList.contains(z)}return!1}function Se(S,z){return se(S)&&S.classList.contains(z)}function Ie(S,z){let{prototype:F}=Element;return(F.matches||F.webkitMatchesSelector||F.mozMatchesSelector||F.msMatchesSelector||function(){return Array.from(document.querySelectorAll(z)).includes(this)}).call(S,z)}function he(S){return this.elements.container.querySelectorAll(S)}function ye(S){return this.elements.container.querySelector(S)}function _e(S=null,z=!1){se(S)&&(S.focus({preventScroll:!0}),z&&ne(S,this.config.classNames.tabFocus))}let pe={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},De={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(S,z,F){let q=le.isIPhone&&F&&De.playsinline,fe=De[S]||z!=="html5";return{api:fe,ui:fe&&De.rangeInput&&(S!=="video"||!le.isIPhone||q)}},pip:!(le.isIPhone||!re(l("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||l("video").disablePictureInPicture)),airplay:re(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(S){if(Q(S))return!1;let[z]=S.split("/"),F=S;if(!this.isHTML5||z!==this.type)return!1;Object.keys(pe).includes(F)&&(F+=`; codecs="${pe[S]}"`);try{return Boolean(F&&this.media.canPlayType(F).replace(/no/,""))}catch(q){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{let S=document.createElement("input");return S.type="range",S.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:X!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},je=(()=>{let S=!1;try{let z=Object.defineProperty({},"passive",{get:()=>(S=!0,null)});window.addEventListener("test",null,z),window.removeEventListener("test",null,z)}catch(z){}return S})();function Fe(S,z,F,q=!1,fe=!0,ge=!1){if(!S||!("addEventListener"in S)||Q(z)||!re(F))return;let Me=z.split(" "),ke=ge;je&&(ke={passive:fe,capture:ge}),Me.forEach($e=>{this&&this.eventListeners&&q&&this.eventListeners.push({element:S,type:$e,callback:F,options:ke}),S[q?"addEventListener":"removeEventListener"]($e,F,ke)})}function Le(S,z="",F,q=!0,fe=!1){Fe.call(this,S,z,F,!0,q,fe)}function Ve(S,z="",F,q=!0,fe=!1){Fe.call(this,S,z,F,!1,q,fe)}function Ge(S,z="",F,q=!0,fe=!1){let ge=(...Me)=>{Ve(S,z,ge,q,fe),F.apply(this,Me)};Fe.call(this,S,z,ge,!0,q,fe)}function we(S,z="",F=!1,q={}){if(!se(S)||Q(z))return;let fe=new CustomEvent(z,{bubbles:F,detail:{...q,plyr:this}});S.dispatchEvent(fe)}function at(){this&&this.eventListeners&&(this.eventListeners.forEach(S=>{let{element:z,type:F,callback:q,options:fe}=S;z.removeEventListener(F,q,fe)}),this.eventListeners=[])}function Re(){return new Promise(S=>this.ready?setTimeout(S,0):Le.call(this,this.elements.container,"ready",S)).then(()=>{})}function Xe(S){me(S)&&S.then(null,()=>{})}function lt(S){return ve(S)?S.filter((z,F)=>S.indexOf(z)===F):S}function ct(S,z){return ve(S)&&S.length?S.reduce((F,q)=>Math.abs(q-z)({...S,[z/F]:[z,F]}),{});function Ct(S){return ve(S)||oe(S)&&S.includes(":")?(ve(S)?S:S.split(":")).map(Number).every(Y):!1}function wt(S){if(!ve(S)||!S.every(Y))return null;let[z,F]=S,q=(ge,Me)=>Me===0?ge:q(Me,ge%Me),fe=q(z,F);return[z/fe,F/fe]}function We(S){let z=q=>Ct(q)?q.split(":").map(Number):null,F=z(S);if(F===null&&(F=z(this.config.ratio)),F===null&&!Q(this.embed)&&ve(this.embed.ratio)&&({ratio:F}=this.embed),F===null&&this.isHTML5){let{videoWidth:q,videoHeight:fe}=this.media;F=[q,fe]}return wt(F)}function He(S){if(!this.isVideo)return{};let{wrapper:z}=this.elements,F=We.call(this,S);if(!ve(F))return{};let[q,fe]=wt(F),ge=100/q*fe;if(tt(`aspect-ratio: ${q}/${fe}`)?z.style.aspectRatio=`${q}/${fe}`:z.style.paddingBottom=`${ge}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){let Me=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),ke=(Me-ge)/(Me/50);this.fullscreen.active?z.style.paddingBottom=null:this.media.style.transform=`translateY(-${ke}%)`}else this.isHTML5&&z.classList.add(this.config.classNames.videoFixedRatio);return{padding:ge,ratio:F}}function ze(S,z,F=.05){let q=S/z,fe=ct(Object.keys(St),q);return Math.abs(fe-q)<=F?St[fe]:[S,z]}let mt={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(S=>{let z=S.getAttribute("type");return!!Q(z)||De.mime.call(this,z)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:mt.getSources.call(this).map(S=>Number(S.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;let S=this;S.options.speed=S.config.speed.options,Q(this.config.ratio)||He.call(S),Object.defineProperty(S.media,"quality",{get(){let z=mt.getSources.call(S).find(F=>F.getAttribute("src")===S.source);return z&&Number(z.getAttribute("size"))},set(z){if(S.quality!==z){if(S.config.quality.forced&&re(S.config.quality.onChange))S.config.quality.onChange(z);else{let F=mt.getSources.call(S).find($e=>Number($e.getAttribute("size"))===z);if(!F)return;let{currentTime:q,paused:fe,preload:ge,readyState:Me,playbackRate:ke}=S.media;S.media.src=F.getAttribute("src"),(ge!=="none"||Me)&&(S.once("loadedmetadata",()=>{S.speed=ke,S.currentTime=q,fe||Xe(S.play())}),S.media.load())}we.call(S,S.media,"qualitychange",!1,{quality:z})}}})},cancelRequests(){this.isHTML5&&(y(mt.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function vt(S,...z){return Q(S)?S:S.toString().replace(/{(\d+)}/g,(F,q)=>z[q].toString())}let pt=(S="",z="",F="")=>S.replace(new RegExp(z.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),F.toString()),Rt=(S="")=>S.toString().replace(/\w\S*/g,z=>z.charAt(0).toUpperCase()+z.substr(1).toLowerCase());function Ce(S=""){let z=S.toString();return z=function(F=""){let q=F.toString();return q=pt(q,"-"," "),q=pt(q,"_"," "),q=Rt(q),pt(q," ","")}(z),z.charAt(0).toLowerCase()+z.slice(1)}function Pe(S){let z=document.createElement("div");return z.appendChild(S),z.innerHTML}let Ye={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Ze={get(S="",z={}){if(Q(S)||Q(z))return"";let F=G(z.i18n,S);if(Q(F))return Object.keys(Ye).includes(S)?Ye[S]:"";let q={"{seektime}":z.seekTime,"{title}":z.title};return Object.entries(q).forEach(([fe,ge])=>{F=pt(F,fe,ge)}),F}};class ut{constructor(z){e(this,"get",F=>{if(!ut.supported||!this.enabled)return null;let q=window.localStorage.getItem(this.key);if(Q(q))return null;let fe=JSON.parse(q);return oe(F)&&F.length?fe[F]:fe}),e(this,"set",F=>{if(!ut.supported||!this.enabled||!U(F))return;let q=this.get();Q(q)&&(q={}),c(q,F),window.localStorage.setItem(this.key,JSON.stringify(q))}),this.enabled=z.config.storage.enabled,this.key=z.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;let z="___test";return window.localStorage.setItem(z,z),window.localStorage.removeItem(z),!0}catch(z){return!1}}}function Ue(S,z="text"){return new Promise((F,q)=>{try{let fe=new XMLHttpRequest;if(!("withCredentials"in fe))return;fe.addEventListener("load",()=>{if(z==="text")try{F(JSON.parse(fe.responseText))}catch(ge){F(fe.responseText)}else F(fe.response)}),fe.addEventListener("error",()=>{throw new Error(fe.status)}),fe.open("GET",S,!0),fe.responseType=z,fe.send()}catch(fe){q(fe)}})}function Je(S,z){if(!oe(S))return;let F=oe(z),q=!1,fe=()=>document.getElementById(z)!==null,ge=(Me,ke)=>{Me.innerHTML=ke,F&&fe()||document.body.insertAdjacentElement("afterbegin",Me)};if(!F||!fe()){let Me=ut.supported,ke=document.createElement("div");if(ke.setAttribute("hidden",""),F&&ke.setAttribute("id",z),Me){let $e=window.localStorage.getItem(`cache-${z}`);if(q=$e!==null,q){let gt=JSON.parse($e);ge(ke,gt.content)}}Ue(S).then($e=>{Q($e)||(Me&&window.localStorage.setItem(`cache-${z}`,JSON.stringify({content:$e})),ge(ke,$e))}).catch(()=>{})}}let ht=S=>Math.trunc(S/60/60%60,10);function Et(S=0,z=!1,F=!1){if(!Y(S))return Et(void 0,z,F);let q=$e=>`0${$e}`.slice(-2),fe=ht(S),ge=(Me=S,Math.trunc(Me/60%60,10));var Me;let ke=($e=>Math.trunc($e%60,10))(S);return fe=z||fe>0?`${fe}:`:"",`${F&&S>0?"-":""}${fe}${q(ge)}:${q(ke)}`}let rt={getIconUrl(){let S=new URL(this.config.iconUrl,window.location).host!==window.location.host||le.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:S}},findElements(){try{return this.elements.controls=ye.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:he.call(this,this.config.selectors.buttons.play),pause:ye.call(this,this.config.selectors.buttons.pause),restart:ye.call(this,this.config.selectors.buttons.restart),rewind:ye.call(this,this.config.selectors.buttons.rewind),fastForward:ye.call(this,this.config.selectors.buttons.fastForward),mute:ye.call(this,this.config.selectors.buttons.mute),pip:ye.call(this,this.config.selectors.buttons.pip),airplay:ye.call(this,this.config.selectors.buttons.airplay),settings:ye.call(this,this.config.selectors.buttons.settings),captions:ye.call(this,this.config.selectors.buttons.captions),fullscreen:ye.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=ye.call(this,this.config.selectors.progress),this.elements.inputs={seek:ye.call(this,this.config.selectors.inputs.seek),volume:ye.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:ye.call(this,this.config.selectors.display.buffer),currentTime:ye.call(this,this.config.selectors.display.currentTime),duration:ye.call(this,this.config.selectors.display.duration)},se(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(S){return this.debug.warn("It looks like there is a problem with your custom controls HTML",S),this.toggleNativeControls(!0),!1}},createIcon(S,z){let F="http://www.w3.org/2000/svg",q=rt.getIconUrl.call(this),fe=`${q.cors?"":q.url}#${this.config.iconPrefix}`,ge=document.createElementNS(F,"svg");b(ge,c(z,{"aria-hidden":"true",focusable:"false"}));let Me=document.createElementNS(F,"use"),ke=`${fe}-${S}`;return"href"in Me&&Me.setAttributeNS("http://www.w3.org/1999/xlink","href",ke),Me.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",ke),ge.appendChild(Me),ge},createLabel(S,z={}){let F=Ze.get(S,this.config);return l("span",{...z,class:[z.class,this.config.classNames.hidden].filter(Boolean).join(" ")},F)},createBadge(S){if(Q(S))return null;let z=l("span",{class:this.config.classNames.menu.value});return z.appendChild(l("span",{class:this.config.classNames.menu.badge},S)),z},createButton(S,z){let F=c({},z),q=Ce(S),fe={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(Me=>{Object.keys(F).includes(Me)&&(fe[Me]=F[Me],delete F[Me])}),fe.element!=="button"||Object.keys(F).includes("type")||(F.type="button"),Object.keys(F).includes("class")?F.class.split(" ").some(Me=>Me===this.config.classNames.control)||c(F,{class:`${F.class} ${this.config.classNames.control}`}):F.class=this.config.classNames.control,S){case"play":fe.toggle=!0,fe.label="play",fe.labelPressed="pause",fe.icon="play",fe.iconPressed="pause";break;case"mute":fe.toggle=!0,fe.label="mute",fe.labelPressed="unmute",fe.icon="volume",fe.iconPressed="muted";break;case"captions":fe.toggle=!0,fe.label="enableCaptions",fe.labelPressed="disableCaptions",fe.icon="captions-off",fe.iconPressed="captions-on";break;case"fullscreen":fe.toggle=!0,fe.label="enterFullscreen",fe.labelPressed="exitFullscreen",fe.icon="enter-fullscreen",fe.iconPressed="exit-fullscreen";break;case"play-large":F.class+=` ${this.config.classNames.control}--overlaid`,q="play",fe.label="play",fe.icon="play";break;default:Q(fe.label)&&(fe.label=q),Q(fe.icon)&&(fe.icon=S)}let ge=l(fe.element);return fe.toggle?(ge.appendChild(rt.createIcon.call(this,fe.iconPressed,{class:"icon--pressed"})),ge.appendChild(rt.createIcon.call(this,fe.icon,{class:"icon--not-pressed"})),ge.appendChild(rt.createLabel.call(this,fe.labelPressed,{class:"label--pressed"})),ge.appendChild(rt.createLabel.call(this,fe.label,{class:"label--not-pressed"}))):(ge.appendChild(rt.createIcon.call(this,fe.icon)),ge.appendChild(rt.createLabel.call(this,fe.label))),c(F,$(this.config.selectors.buttons[q],F)),b(ge,F),q==="play"?(ve(this.elements.buttons[q])||(this.elements.buttons[q]=[]),this.elements.buttons[q].push(ge)):this.elements.buttons[q]=ge,ge},createRange(S,z){let F=l("input",c($(this.config.selectors.inputs[S]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Ze.get(S,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},z));return this.elements.inputs[S]=F,rt.updateRangeFill.call(this,F),M.setup(F),F},createProgress(S,z){let F=l("progress",c($(this.config.selectors.display[S]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},z));if(S!=="volume"){F.appendChild(l("span",null,"0"));let q={played:"played",buffer:"buffered"}[S],fe=q?Ze.get(q,this.config):"";F.innerText=`% ${fe.toLowerCase()}`}return this.elements.display[S]=F,F},createTime(S,z){let F=$(this.config.selectors.display[S],z),q=l("div",c(F,{class:`${F.class?F.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Ze.get(S,this.config)}),"00:00");return this.elements.display[S]=q,q},bindMenuItemShortcuts(S,z){Le.call(this,S,"keydown keyup",F=>{if(![32,38,39,40].includes(F.which)||(F.preventDefault(),F.stopPropagation(),F.type==="keydown"))return;let q=Ie(S,'[role="menuitemradio"]');if(!q&&[32,39].includes(F.which))rt.showMenuPanel.call(this,z,!0);else{let fe;F.which!==32&&(F.which===40||q&&F.which===39?(fe=S.nextElementSibling,se(fe)||(fe=S.parentNode.firstElementChild)):(fe=S.previousElementSibling,se(fe)||(fe=S.parentNode.lastElementChild)),_e.call(this,fe,!0))}},!1),Le.call(this,S,"keyup",F=>{F.which===13&&rt.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:S,list:z,type:F,title:q,badge:fe=null,checked:ge=!1}){let Me=$(this.config.selectors.inputs[F]),ke=l("button",c(Me,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${Me.class?Me.class:""}`.trim(),"aria-checked":ge,value:S})),$e=l("span");$e.innerHTML=q,se(fe)&&$e.appendChild(fe),ke.appendChild($e),Object.defineProperty(ke,"checked",{enumerable:!0,get:()=>ke.getAttribute("aria-checked")==="true",set(gt){gt&&Array.from(ke.parentNode.children).filter(Nt=>Ie(Nt,'[role="menuitemradio"]')).forEach(Nt=>Nt.setAttribute("aria-checked","false")),ke.setAttribute("aria-checked",gt?"true":"false")}}),this.listeners.bind(ke,"click keyup",gt=>{if(!ee(gt)||gt.which===32){switch(gt.preventDefault(),gt.stopPropagation(),ke.checked=!0,F){case"language":this.currentTrack=Number(S);break;case"quality":this.quality=S;break;case"speed":this.speed=parseFloat(S)}rt.showMenuPanel.call(this,"home",ee(gt))}},F,!1),rt.bindMenuItemShortcuts.call(this,ke,F),z.appendChild(ke)},formatTime(S=0,z=!1){return Y(S)?Et(S,ht(this.duration)>0,z):S},updateTimeDisplay(S=null,z=0,F=!1){se(S)&&Y(z)&&(S.innerText=rt.formatTime(z,F))},updateVolume(){this.supported.ui&&(se(this.elements.inputs.volume)&&rt.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),se(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(S,z=0){se(S)&&(S.value=z,rt.updateRangeFill.call(this,S))},updateProgress(S){if(!this.supported.ui||!J(S))return;let z=0,F=(ge,Me)=>{let ke=Y(Me)?Me:0,$e=se(ge)?ge:this.elements.display.buffer;if(se($e)){$e.value=ke;let gt=$e.getElementsByTagName("span")[0];se(gt)&&(gt.childNodes[0].nodeValue=ke)}};if(S)switch(S.type){case"timeupdate":case"seeking":case"seeked":q=this.currentTime,fe=this.duration,z=q===0||fe===0||Number.isNaN(q)||Number.isNaN(fe)?0:(q/fe*100).toFixed(2),S.type==="timeupdate"&&rt.setRange.call(this,this.elements.inputs.seek,z);break;case"playing":case"progress":F(this.elements.display.buffer,100*this.buffered)}var q,fe},updateRangeFill(S){let z=J(S)?S.target:S;if(se(z)&&z.getAttribute("type")==="range"){if(Ie(z,this.config.selectors.inputs.seek)){z.setAttribute("aria-valuenow",this.currentTime);let F=rt.formatTime(this.currentTime),q=rt.formatTime(this.duration),fe=Ze.get("seekLabel",this.config);z.setAttribute("aria-valuetext",fe.replace("{currentTime}",F).replace("{duration}",q))}else if(Ie(z,this.config.selectors.inputs.volume)){let F=100*z.value;z.setAttribute("aria-valuenow",F),z.setAttribute("aria-valuetext",`${F.toFixed(1)}%`)}else z.setAttribute("aria-valuenow",z.value);le.isWebkit&&z.style.setProperty("--value",z.value/z.max*100+"%")}},updateSeekTooltip(S){if(!this.config.tooltips.seek||!se(this.elements.inputs.seek)||!se(this.elements.display.seekTooltip)||this.duration===0)return;let z=`${this.config.classNames.tooltip}--visible`,F=ge=>ne(this.elements.display.seekTooltip,z,ge);if(this.touch)return void F(!1);let q=0,fe=this.elements.progress.getBoundingClientRect();if(J(S))q=100/fe.width*(S.pageX-fe.left);else{if(!Se(this.elements.display.seekTooltip,z))return;q=parseFloat(this.elements.display.seekTooltip.style.left,10)}q<0?q=0:q>100&&(q=100),rt.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*q),this.elements.display.seekTooltip.style.left=`${q}%`,J(S)&&["mouseenter","mouseleave"].includes(S.type)&&F(S.type==="mouseenter")},timeUpdate(S){let z=!se(this.elements.display.duration)&&this.config.invertTime;rt.updateTimeDisplay.call(this,this.elements.display.currentTime,z?this.duration-this.currentTime:this.currentTime,z),S&&S.type==="timeupdate"&&this.media.seeking||rt.updateProgress.call(this,S)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ae(this.elements.display.currentTime,!0),void ae(this.elements.progress,!0);se(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);let S=se(this.elements.display.duration);!S&&this.config.displayDuration&&this.paused&&rt.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),S&&rt.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),rt.updateSeekTooltip.call(this)},toggleMenuButton(S,z){ae(this.elements.settings.buttons[S],!z)},updateSetting(S,z,F){let q=this.elements.settings.panels[S],fe=null,ge=z;if(S==="captions")fe=this.currentTrack;else{if(fe=Q(F)?this[S]:F,Q(fe)&&(fe=this.config[S].default),!Q(this.options[S])&&!this.options[S].includes(fe))return void this.debug.warn(`Unsupported value of '${fe}' for ${S}`);if(!this.config[S].options.includes(fe))return void this.debug.warn(`Disabled value of '${fe}' for ${S}`)}if(se(ge)||(ge=q&&q.querySelector('[role="menu"]')),!se(ge))return;this.elements.settings.buttons[S].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=rt.getLabel.call(this,S,fe);let Me=ge&&ge.querySelector(`[value="${fe}"]`);se(Me)&&(Me.checked=!0)},getLabel(S,z){switch(S){case"speed":return z===1?Ze.get("normal",this.config):`${z}×`;case"quality":if(Y(z)){let F=Ze.get(`qualityLabel.${z}`,this.config);return F.length?F:`${z}p`}return Rt(z);case"captions":return ft.getLabel.call(this);default:return null}},setQualityMenu(S){if(!se(this.elements.settings.panels.quality))return;let z="quality",F=this.elements.settings.panels.quality.querySelector('[role="menu"]');ve(S)&&(this.options.quality=lt(S).filter(ge=>this.config.quality.options.includes(ge)));let q=!Q(this.options.quality)&&this.options.quality.length>1;if(rt.toggleMenuButton.call(this,z,q),V(F),rt.checkMenu.call(this),!q)return;let fe=ge=>{let Me=Ze.get(`qualityBadge.${ge}`,this.config);return Me.length?rt.createBadge.call(this,Me):null};this.options.quality.sort((ge,Me)=>{let ke=this.config.quality.options;return ke.indexOf(ge)>ke.indexOf(Me)?1:-1}).forEach(ge=>{rt.createMenuItem.call(this,{value:ge,list:F,type:z,title:rt.getLabel.call(this,"quality",ge),badge:fe(ge)})}),rt.updateSetting.call(this,z,F)},setCaptionsMenu(){if(!se(this.elements.settings.panels.captions))return;let S="captions",z=this.elements.settings.panels.captions.querySelector('[role="menu"]'),F=ft.getTracks.call(this),q=Boolean(F.length);if(rt.toggleMenuButton.call(this,S,q),V(z),rt.checkMenu.call(this),!q)return;let fe=F.map((ge,Me)=>({value:Me,checked:this.captions.toggled&&this.currentTrack===Me,title:ft.getLabel.call(this,ge),badge:ge.language&&rt.createBadge.call(this,ge.language.toUpperCase()),list:z,type:"language"}));fe.unshift({value:-1,checked:!this.captions.toggled,title:Ze.get("disabled",this.config),list:z,type:"language"}),fe.forEach(rt.createMenuItem.bind(this)),rt.updateSetting.call(this,S,z)},setSpeedMenu(){if(!se(this.elements.settings.panels.speed))return;let S="speed",z=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(q=>q>=this.minimumSpeed&&q<=this.maximumSpeed);let F=!Q(this.options.speed)&&this.options.speed.length>1;rt.toggleMenuButton.call(this,S,F),V(z),rt.checkMenu.call(this),F&&(this.options.speed.forEach(q=>{rt.createMenuItem.call(this,{value:q,list:z,type:S,title:rt.getLabel.call(this,"speed",q)})}),rt.updateSetting.call(this,S,z))},checkMenu(){let{buttons:S}=this.elements.settings,z=!Q(S)&&Object.values(S).some(F=>!F.hidden);ae(this.elements.settings.menu,!z)},focusFirstMenuItem(S,z=!1){if(this.elements.settings.popup.hidden)return;let F=S;se(F)||(F=Object.values(this.elements.settings.panels).find(fe=>!fe.hidden));let q=F.querySelector('[role^="menuitem"]');_e.call(this,q,z)},toggleMenu(S){let{popup:z}=this.elements.settings,F=this.elements.buttons.settings;if(!se(z)||!se(F))return;let{hidden:q}=z,fe=q;if(ue(S))fe=S;else if(ee(S)&&S.which===27)fe=!1;else if(J(S)){let ge=re(S.composedPath)?S.composedPath()[0]:S.target,Me=z.contains(ge);if(Me||!Me&&S.target!==F&&fe)return}F.setAttribute("aria-expanded",fe),ae(z,!fe),ne(this.elements.container,this.config.classNames.menu.open,fe),fe&&ee(S)?rt.focusFirstMenuItem.call(this,null,!0):fe||q||_e.call(this,F,ee(S))},getMenuSize(S){let z=S.cloneNode(!0);z.style.position="absolute",z.style.opacity=0,z.removeAttribute("hidden"),S.parentNode.appendChild(z);let F=z.scrollWidth,q=z.scrollHeight;return y(z),{width:F,height:q}},showMenuPanel(S="",z=!1){let F=this.elements.container.querySelector(`#plyr-settings-${this.id}-${S}`);if(!se(F))return;let q=F.parentNode,fe=Array.from(q.children).find(ge=>!ge.hidden);if(De.transitions&&!De.reducedMotion){q.style.width=`${fe.scrollWidth}px`,q.style.height=`${fe.scrollHeight}px`;let ge=rt.getMenuSize.call(this,F),Me=ke=>{ke.target===q&&["width","height"].includes(ke.propertyName)&&(q.style.width="",q.style.height="",Ve.call(this,q,X,Me))};Le.call(this,q,X,Me),q.style.width=`${ge.width}px`,q.style.height=`${ge.height}px`}ae(fe,!0),ae(F,!1),rt.focusFirstMenuItem.call(this,F,z)},setDownloadUrl(){let S=this.elements.buttons.download;se(S)&&S.setAttribute("href",this.download)},create(S){let{bindMenuItemShortcuts:z,createButton:F,createProgress:q,createRange:fe,createTime:ge,setQualityMenu:Me,setSpeedMenu:ke,showMenuPanel:$e}=rt;this.elements.controls=null,ve(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(F.call(this,"play-large"));let gt=l("div",$(this.config.selectors.controls.wrapper));this.elements.controls=gt;let Nt={class:"plyr__controls__item"};return lt(ve(this.config.controls)?this.config.controls:[]).forEach(Lt=>{if(Lt==="restart"&>.appendChild(F.call(this,"restart",Nt)),Lt==="rewind"&>.appendChild(F.call(this,"rewind",Nt)),Lt==="play"&>.appendChild(F.call(this,"play",Nt)),Lt==="fast-forward"&>.appendChild(F.call(this,"fast-forward",Nt)),Lt==="progress"){let At=l("div",{class:`${Nt.class} plyr__progress__container`}),Ht=l("div",$(this.config.selectors.progress));if(Ht.appendChild(fe.call(this,"seek",{id:`plyr-seek-${S.id}`})),Ht.appendChild(q.call(this,"buffer")),this.config.tooltips.seek){let xe=l("span",{class:this.config.classNames.tooltip},"00:00");Ht.appendChild(xe),this.elements.display.seekTooltip=xe}this.elements.progress=Ht,At.appendChild(this.elements.progress),gt.appendChild(At)}if(Lt==="current-time"&>.appendChild(ge.call(this,"currentTime",Nt)),Lt==="duration"&>.appendChild(ge.call(this,"duration",Nt)),Lt==="mute"||Lt==="volume"){let{volume:At}=this.elements;if(se(At)&>.contains(At)||(At=l("div",c({},Nt,{class:`${Nt.class} plyr__volume`.trim()})),this.elements.volume=At,gt.appendChild(At)),Lt==="mute"&&At.appendChild(F.call(this,"mute")),Lt==="volume"&&!le.isIos){let Ht={max:1,step:.05,value:this.config.volume};At.appendChild(fe.call(this,"volume",c(Ht,{id:`plyr-volume-${S.id}`})))}}if(Lt==="captions"&>.appendChild(F.call(this,"captions",Nt)),Lt==="settings"&&!Q(this.config.settings)){let At=l("div",c({},Nt,{class:`${Nt.class} plyr__menu`.trim(),hidden:""}));At.appendChild(F.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${S.id}`,"aria-expanded":!1}));let Ht=l("div",{class:"plyr__menu__container",id:`plyr-settings-${S.id}`,hidden:""}),xe=l("div"),et=l("div",{id:`plyr-settings-${S.id}-home`}),Mt=l("div",{role:"menu"});et.appendChild(Mt),xe.appendChild(et),this.elements.settings.panels.home=et,this.config.settings.forEach(nt=>{let It=l("button",c($(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));z.call(this,It,nt),Le.call(this,It,"click",()=>{$e.call(this,nt,!1)});let Ft=l("span",null,Ze.get(nt,this.config)),Wt=l("span",{class:this.config.classNames.menu.value});Wt.innerHTML=S[nt],Ft.appendChild(Wt),It.appendChild(Ft),Mt.appendChild(It);let zt=l("div",{id:`plyr-settings-${S.id}-${nt}`,hidden:""}),qt=l("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});qt.appendChild(l("span",{"aria-hidden":!0},Ze.get(nt,this.config))),qt.appendChild(l("span",{class:this.config.classNames.hidden},Ze.get("menuBack",this.config))),Le.call(this,zt,"keydown",er=>{er.which===37&&(er.preventDefault(),er.stopPropagation(),$e.call(this,"home",!0))},!1),Le.call(this,qt,"click",()=>{$e.call(this,"home",!1)}),zt.appendChild(qt),zt.appendChild(l("div",{role:"menu"})),xe.appendChild(zt),this.elements.settings.buttons[nt]=It,this.elements.settings.panels[nt]=zt}),Ht.appendChild(xe),At.appendChild(Ht),gt.appendChild(At),this.elements.settings.popup=Ht,this.elements.settings.menu=At}if(Lt==="pip"&&De.pip&>.appendChild(F.call(this,"pip",Nt)),Lt==="airplay"&&De.airplay&>.appendChild(F.call(this,"airplay",Nt)),Lt==="download"){let At=c({},Nt,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(At.download="");let{download:Ht}=this.config.urls;!de(Ht)&&this.isEmbed&&c(At,{icon:`logo-${this.provider}`,label:this.provider}),gt.appendChild(F.call(this,"download",At))}Lt==="fullscreen"&>.appendChild(F.call(this,"fullscreen",Nt))}),this.isHTML5&&Me.call(this,mt.getQualityOptions.call(this)),ke.call(this),gt},inject(){if(this.config.loadSprite){let fe=rt.getIconUrl.call(this);fe.cors&&Je(fe.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let S=null;this.elements.controls=null;let z={id:this.id,seektime:this.config.seekTime,title:this.config.title},F=!0;re(this.config.controls)&&(this.config.controls=this.config.controls.call(this,z)),this.config.controls||(this.config.controls=[]),se(this.config.controls)||oe(this.config.controls)?S=this.config.controls:(S=rt.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:ft.getLabel.call(this)}),F=!1);let q;if(F&&oe(this.config.controls)&&(S=(fe=>{let ge=fe;return Object.entries(z).forEach(([Me,ke])=>{ge=pt(ge,`{${Me}}`,ke)}),ge})(S)),oe(this.config.selectors.controls.container)&&(q=document.querySelector(this.config.selectors.controls.container)),se(q)||(q=this.elements.container),q[se(S)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",S),se(this.elements.controls)||rt.findElements.call(this),!Q(this.elements.buttons)){let fe=ge=>{let Me=this.config.classNames.controlPressed;Object.defineProperty(ge,"pressed",{enumerable:!0,get:()=>Se(ge,Me),set(ke=!1){ne(ge,Me,ke)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(ge=>{ve(ge)||ce(ge)?Array.from(ge).filter(Boolean).forEach(fe):fe(ge)})}if(le.isEdge&&j(q),this.config.tooltips.controls){let{classNames:fe,selectors:ge}=this.config,Me=`${ge.controls.wrapper} ${ge.labels} .${fe.hidden}`,ke=he.call(this,Me);Array.from(ke).forEach($e=>{ne($e,this.config.classNames.hidden,!1),ne($e,this.config.classNames.tooltip,!0)})}}};function Dt(S,z=!0){let F=S;if(z){let q=document.createElement("a");q.href=F,F=q.href}try{return new URL(F)}catch(q){return null}}function kt(S){let z=new URLSearchParams;return U(S)&&Object.entries(S).forEach(([F,q])=>{z.set(F,q)}),z}let ft={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!De.textTracks)return void(ve(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&rt.setCaptionsMenu.call(this));var S,z;if(se(this.elements.captions)||(this.elements.captions=l("div",$(this.config.selectors.captions)),S=this.elements.captions,z=this.elements.wrapper,se(S)&&se(z)&&z.parentNode.insertBefore(S,z.nextSibling)),le.isIE&&window.URL){let ge=this.media.querySelectorAll("track");Array.from(ge).forEach(Me=>{let ke=Me.getAttribute("src"),$e=Dt(ke);$e!==null&&$e.hostname!==window.location.href.hostname&&["http:","https:"].includes($e.protocol)&&Ue(ke,"blob").then(gt=>{Me.setAttribute("src",window.URL.createObjectURL(gt))}).catch(()=>{y(Me)})})}let F=lt((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(ge=>ge.split("-")[0])),q=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();q==="auto"&&([q]=F);let fe=this.storage.get("captions");if(ue(fe)||({active:fe}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:fe,language:q,languages:F}),this.isHTML5){let ge=this.config.captions.update?"addtrack removetrack":"removetrack";Le.call(this,this.media.textTracks,ge,ft.update.bind(this))}setTimeout(ft.update.bind(this),0)},update(){let S=ft.getTracks.call(this,!0),{active:z,language:F,meta:q,currentTrackNode:fe}=this.captions,ge=Boolean(S.find(Me=>Me.language===F));this.isHTML5&&this.isVideo&&S.filter(Me=>!q.get(Me)).forEach(Me=>{this.debug.log("Track added",Me),q.set(Me,{default:Me.mode==="showing"}),Me.mode==="showing"&&(Me.mode="hidden"),Le.call(this,Me,"cuechange",()=>ft.updateCues.call(this))}),(ge&&this.language!==F||!S.includes(fe))&&(ft.setLanguage.call(this,F),ft.toggle.call(this,z&&ge)),ne(this.elements.container,this.config.classNames.captions.enabled,!Q(S)),ve(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&rt.setCaptionsMenu.call(this)},toggle(S,z=!0){if(!this.supported.ui)return;let{toggled:F}=this.captions,q=this.config.classNames.captions.active,fe=x(S)?!F:S;if(fe!==F){if(z||(this.captions.active=fe,this.storage.set({captions:fe})),!this.language&&fe&&!z){let ge=ft.getTracks.call(this),Me=ft.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=Me.language,void ft.set.call(this,ge.indexOf(Me))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=fe),ne(this.elements.container,q,fe),this.captions.toggled=fe,rt.updateSetting.call(this,"captions"),we.call(this,this.media,fe?"captionsenabled":"captionsdisabled")}setTimeout(()=>{fe&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(S,z=!0){let F=ft.getTracks.call(this);if(S!==-1)if(Y(S))if(S in F){if(this.captions.currentTrack!==S){this.captions.currentTrack=S;let q=F[S],{language:fe}=q||{};this.captions.currentTrackNode=q,rt.updateSetting.call(this,"captions"),z||(this.captions.language=fe,this.storage.set({language:fe})),this.isVimeo&&this.embed.enableTextTrack(fe),we.call(this,this.media,"languagechange")}ft.toggle.call(this,!0,z),this.isHTML5&&this.isVideo&&ft.updateCues.call(this)}else this.debug.warn("Track not found",S);else this.debug.warn("Invalid caption argument",S);else ft.toggle.call(this,!1,z)},setLanguage(S,z=!0){if(!oe(S))return void this.debug.warn("Invalid language argument",S);let F=S.toLowerCase();this.captions.language=F;let q=ft.getTracks.call(this),fe=ft.findTrack.call(this,[F]);ft.set.call(this,q.indexOf(fe),z)},getTracks(S=!1){return Array.from((this.media||{}).textTracks||[]).filter(z=>!this.isHTML5||S||this.captions.meta.has(z)).filter(z=>["captions","subtitles"].includes(z.kind))},findTrack(S,z=!1){let F=ft.getTracks.call(this),q=Me=>Number((this.captions.meta.get(Me)||{}).default),fe=Array.from(F).sort((Me,ke)=>q(ke)-q(Me)),ge;return S.every(Me=>(ge=fe.find(ke=>ke.language===Me),!ge)),ge||(z?fe[0]:void 0)},getCurrentTrack(){return ft.getTracks.call(this)[this.currentTrack]},getLabel(S){let z=S;return!ie(z)&&De.textTracks&&this.captions.toggled&&(z=ft.getCurrentTrack.call(this)),ie(z)?Q(z.label)?Q(z.language)?Ze.get("enabled",this.config):S.language.toUpperCase():z.label:Ze.get("disabled",this.config)},updateCues(S){if(!this.supported.ui)return;if(!se(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!x(S)&&!Array.isArray(S))return void this.debug.warn("updateCues: Invalid input",S);let z=S;if(!z){let q=ft.getCurrentTrack.call(this);z=Array.from((q||{}).activeCues||[]).map(fe=>fe.getCueAsHTML()).map(Pe)}let F=z.map(q=>q.trim()).join(` -`);if(F!==this.elements.captions.innerHTML){V(this.elements.captions);let q=l("span",$(this.config.selectors.caption));q.innerHTML=F,this.elements.captions.appendChild(q),we.call(this,this.media,"cuechange")}}},Gt={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.6.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",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",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"},tabFocus:"plyr__tab-focus",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"}},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}},Kt="picture-in-picture",Vt="inline",Pt={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ee="audio",Z="video",Ae=()=>{};class Te{constructor(z=!1){this.enabled=window.console&&z,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Ae}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Ae}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Ae}}class be{constructor(z){e(this,"onChange",()=>{if(!this.enabled)return;let F=this.player.elements.buttons.fullscreen;se(F)&&(F.pressed=this.active);let q=this.target===this.player.media?this.target:this.player.elements.container;we.call(this.player,q,this.active?"enterfullscreen":"exitfullscreen",!0)}),e(this,"toggleFallback",(F=!1)=>{if(F?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=F?"hidden":"",ne(this.target,this.player.config.classNames.fullscreen.fallback,F),le.isIos){let q=document.head.querySelector('meta[name="viewport"]'),fe="viewport-fit=cover";q||(q=document.createElement("meta"),q.setAttribute("name","viewport"));let ge=oe(q.content)&&q.content.includes(fe);F?(this.cleanupViewport=!ge,ge||(q.content+=`,${fe}`)):this.cleanupViewport&&(q.content=q.content.split(",").filter(Me=>Me.trim()!==fe).join(","))}this.onChange()}),e(this,"trapFocus",F=>{if(le.isIos||!this.active||F.key!=="Tab"||F.keyCode!==9)return;let q=document.activeElement,fe=he.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[ge]=fe,Me=fe[fe.length-1];q!==Me||F.shiftKey?q===ge&&F.shiftKey&&(Me.focus(),F.preventDefault()):(ge.focus(),F.preventDefault())}),e(this,"update",()=>{if(this.enabled){let F;F=this.forceFallback?"Fallback (forced)":be.native?"Native":"Fallback",this.player.debug.log(`${F} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");ne(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}),e(this,"enter",()=>{this.enabled&&(le.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!be.native||this.forceFallback?this.toggleFallback(!0):this.prefix?Q(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),e(this,"exit",()=>{if(this.enabled)if(le.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Xe(this.player.play());else if(!be.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!Q(this.prefix)){let F=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${F}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),e(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=z,this.prefix=be.prefix,this.property=be.property,this.scrollPosition={x:0,y:0},this.forceFallback=z.config.fullscreen.fallback==="force",this.player.elements.fullscreen=z.config.fullscreen.container&&function(F,q){let{prototype:fe}=Element;return(fe.closest||function(){let ge=this;do{if(Ie.matches(ge,q))return ge;ge=ge.parentElement||ge.parentNode}while(ge!==null&&ge.nodeType===1);return null}).call(F,q)}(this.player.elements.container,z.config.fullscreen.container),Le.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),Le.call(this.player,this.player.elements.container,"dblclick",F=>{se(this.player.elements.controls)&&this.player.elements.controls.contains(F.target)||this.player.listeners.proxy(F,this.toggle,"fullscreen")}),Le.call(this,this.player.elements.container,"keydown",F=>this.trapFocus(F)),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return be.native&&!this.forceFallback}static get prefix(){if(re(document.exitFullscreen))return"";let z="";return["webkit","moz","ms"].some(F=>!(!re(document[`${F}ExitFullscreen`])&&!re(document[`${F}CancelFullScreen`]))&&(z=F,!0)),z}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get enabled(){return(be.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!be.native||this.forceFallback)return Se(this.target,this.player.config.classNames.fullscreen.fallback);let z=this.prefix?document[`${this.prefix}${this.property}Element`]:document.fullscreenElement;return z&&z.shadowRoot?z===this.target.getRootNode().host:z===this.target}get target(){return le.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function Oe(S,z=1){return new Promise((F,q)=>{let fe=new Image,ge=()=>{delete fe.onload,delete fe.onerror,(fe.naturalWidth>=z?F:q)(fe)};Object.assign(fe,{onload:ge,onerror:ge,src:S})})}let Qe={addStyleHook(){ne(this.elements.container,this.config.selectors.container.replace(".",""),!0),ne(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(S=!1){S&&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 Qe.toggleNativeControls.call(this,!0);se(this.elements.controls)||(rt.inject.call(this),this.listeners.controls()),Qe.toggleNativeControls.call(this),this.isHTML5&&ft.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,rt.updateVolume.call(this),rt.timeUpdate.call(this),Qe.checkPlaying.call(this),ne(this.elements.container,this.config.classNames.pip.supported,De.pip&&this.isHTML5&&this.isVideo),ne(this.elements.container,this.config.classNames.airplay.supported,De.airplay&&this.isHTML5),ne(this.elements.container,this.config.classNames.isIos,le.isIos),ne(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{we.call(this,this.media,"ready")},0),Qe.setTitle.call(this),this.poster&&Qe.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&rt.durationUpdate.call(this)},setTitle(){let S=Ze.get("play",this.config);if(oe(this.config.title)&&!Q(this.config.title)&&(S+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(z=>{z.setAttribute("aria-label",S)}),this.isEmbed){let z=ye.call(this,"iframe");if(!se(z))return;let F=Q(this.config.title)?"video":this.config.title,q=Ze.get("frameTitle",this.config);z.setAttribute("title",q.replace("{title}",F))}},togglePoster(S){ne(this.elements.container,this.config.classNames.posterEnabled,S)},setPoster(S,z=!0){return z&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",S),this.elements.poster.removeAttribute("hidden"),Re.call(this).then(()=>Oe(S)).catch(F=>{throw S===this.poster&&Qe.togglePoster.call(this,!1),F}).then(()=>{if(S!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${S}')`,backgroundSize:""}),Qe.togglePoster.call(this,!0),S)))},checkPlaying(S){ne(this.elements.container,this.config.classNames.playing,this.playing),ne(this.elements.container,this.config.classNames.paused,this.paused),ne(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(z=>{Object.assign(z,{pressed:this.playing}),z.setAttribute("aria-label",Ze.get(this.playing?"pause":"play",this.config))}),J(S)&&S.type==="timeupdate"||Qe.toggleControls.call(this)},checkLoading(S){this.loading=["stalled","waiting"].includes(S.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{ne(this.elements.container,this.config.classNames.loading,this.loading),Qe.toggleControls.call(this)},this.loading?250:0)},toggleControls(S){let{controls:z}=this.elements;if(z&&this.config.hideControls){let F=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(S||this.loading||this.paused||z.pressed||z.hover||F))}},migrateStyles(){Object.values({...this.media.style}).filter(S=>!Q(S)&&oe(S)&&S.startsWith("--plyr")).forEach(S=>{this.elements.container.style.setProperty(S,this.media.style.getPropertyValue(S)),this.media.style.removeProperty(S)}),Q(this.media.style)&&this.media.removeAttribute("style")}};class Tt{constructor(z){e(this,"firstTouch",()=>{let{player:F}=this,{elements:q}=F;F.touch=!0,ne(q.container,F.config.classNames.isTouch,!0)}),e(this,"setTabFocus",F=>{let{player:q}=this,{elements:fe}=q;if(clearTimeout(this.focusTimer),F.type==="keydown"&&F.which!==9)return;F.type==="keydown"&&(this.lastKeyDown=F.timeStamp);let ge=F.timeStamp-this.lastKeyDown<=20;(F.type!=="focus"||ge)&&((()=>{let Me=q.config.classNames.tabFocus;ne(he.call(q,`.${Me}`),Me,!1)})(),F.type!=="focusout"&&(this.focusTimer=setTimeout(()=>{let Me=document.activeElement;fe.container.contains(Me)&&ne(document.activeElement,q.config.classNames.tabFocus,!0)},10)))}),e(this,"global",(F=!0)=>{let{player:q}=this;q.config.keyboard.global&&Fe.call(q,window,"keydown keyup",this.handleKey,F,!1),Fe.call(q,document.body,"click",this.toggleMenu,F),Ge.call(q,document.body,"touchstart",this.firstTouch),Fe.call(q,document.body,"keydown focus blur focusout",this.setTabFocus,F,!1,!0)}),e(this,"container",()=>{let{player:F}=this,{config:q,elements:fe,timers:ge}=F;!q.keyboard.global&&q.keyboard.focused&&Le.call(F,fe.container,"keydown keyup",this.handleKey,!1),Le.call(F,fe.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",$e=>{let{controls:gt}=fe;gt&&$e.type==="enterfullscreen"&&(gt.pressed=!1,gt.hover=!1);let Nt=0;["touchstart","touchmove","mousemove"].includes($e.type)&&(Qe.toggleControls.call(F,!0),Nt=F.touch?3e3:2e3),clearTimeout(ge.controls),ge.controls=setTimeout(()=>Qe.toggleControls.call(F,!1),Nt)});let Me=()=>{if(!F.isVimeo||F.config.vimeo.premium)return;let $e=fe.wrapper,{active:gt}=F.fullscreen,[Nt,Lt]=We.call(F),At=tt(`aspect-ratio: ${Nt} / ${Lt}`);if(!gt)return void(At?($e.style.width=null,$e.style.height=null):($e.style.maxWidth=null,$e.style.margin=null));let[Ht,xe]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],et=Ht/xe>Nt/Lt;At?($e.style.width=et?"auto":"100%",$e.style.height=et?"100%":"auto"):($e.style.maxWidth=et?xe/Lt*Nt+"px":null,$e.style.margin=et?"0 auto":null)},ke=()=>{clearTimeout(ge.resized),ge.resized=setTimeout(Me,50)};Le.call(F,fe.container,"enterfullscreen exitfullscreen",$e=>{let{target:gt}=F.fullscreen;gt===fe.container&&(!F.isEmbed&&Q(F.config.ratio)||(Me(),($e.type==="enterfullscreen"?Le:Ve).call(F,window,"resize",ke)))})}),e(this,"media",()=>{let{player:F}=this,{elements:q}=F;if(Le.call(F,F.media,"timeupdate seeking seeked",ge=>rt.timeUpdate.call(F,ge)),Le.call(F,F.media,"durationchange loadeddata loadedmetadata",ge=>rt.durationUpdate.call(F,ge)),Le.call(F,F.media,"ended",()=>{F.isHTML5&&F.isVideo&&F.config.resetOnEnd&&(F.restart(),F.pause())}),Le.call(F,F.media,"progress playing seeking seeked",ge=>rt.updateProgress.call(F,ge)),Le.call(F,F.media,"volumechange",ge=>rt.updateVolume.call(F,ge)),Le.call(F,F.media,"playing play pause ended emptied timeupdate",ge=>Qe.checkPlaying.call(F,ge)),Le.call(F,F.media,"waiting canplay seeked playing",ge=>Qe.checkLoading.call(F,ge)),F.supported.ui&&F.config.clickToPlay&&!F.isAudio){let ge=ye.call(F,`.${F.config.classNames.video}`);if(!se(ge))return;Le.call(F,q.container,"click",Me=>{([q.container,ge].includes(Me.target)||ge.contains(Me.target))&&(F.touch&&F.config.hideControls||(F.ended?(this.proxy(Me,F.restart,"restart"),this.proxy(Me,()=>{Xe(F.play())},"play")):this.proxy(Me,()=>{Xe(F.togglePlay())},"play")))})}F.supported.ui&&F.config.disableContextMenu&&Le.call(F,q.wrapper,"contextmenu",ge=>{ge.preventDefault()},!1),Le.call(F,F.media,"volumechange",()=>{F.storage.set({volume:F.volume,muted:F.muted})}),Le.call(F,F.media,"ratechange",()=>{rt.updateSetting.call(F,"speed"),F.storage.set({speed:F.speed})}),Le.call(F,F.media,"qualitychange",ge=>{rt.updateSetting.call(F,"quality",null,ge.detail.quality)}),Le.call(F,F.media,"ready qualitychange",()=>{rt.setDownloadUrl.call(F)});let fe=F.config.events.concat(["keyup","keydown"]).join(" ");Le.call(F,F.media,fe,ge=>{let{detail:Me={}}=ge;ge.type==="error"&&(Me=F.media.error),we.call(F,q.container,ge.type,!0,Me)})}),e(this,"proxy",(F,q,fe)=>{let{player:ge}=this,Me=ge.config.listeners[fe],ke=!0;re(Me)&&(ke=Me.call(ge,F)),ke!==!1&&re(q)&&q.call(ge,F)}),e(this,"bind",(F,q,fe,ge,Me=!0)=>{let{player:ke}=this,$e=ke.config.listeners[ge],gt=re($e);Le.call(ke,F,q,Nt=>this.proxy(Nt,fe,ge),Me&&!gt)}),e(this,"controls",()=>{let{player:F}=this,{elements:q}=F,fe=le.isIE?"change":"input";if(q.buttons.play&&Array.from(q.buttons.play).forEach(ge=>{this.bind(ge,"click",()=>{Xe(F.togglePlay())},"play")}),this.bind(q.buttons.restart,"click",F.restart,"restart"),this.bind(q.buttons.rewind,"click",()=>{F.lastSeekTime=Date.now(),F.rewind()},"rewind"),this.bind(q.buttons.fastForward,"click",()=>{F.lastSeekTime=Date.now(),F.forward()},"fastForward"),this.bind(q.buttons.mute,"click",()=>{F.muted=!F.muted},"mute"),this.bind(q.buttons.captions,"click",()=>F.toggleCaptions()),this.bind(q.buttons.download,"click",()=>{we.call(F,F.media,"download")},"download"),this.bind(q.buttons.fullscreen,"click",()=>{F.fullscreen.toggle()},"fullscreen"),this.bind(q.buttons.pip,"click",()=>{F.pip="toggle"},"pip"),this.bind(q.buttons.airplay,"click",F.airplay,"airplay"),this.bind(q.buttons.settings,"click",ge=>{ge.stopPropagation(),ge.preventDefault(),rt.toggleMenu.call(F,ge)},null,!1),this.bind(q.buttons.settings,"keyup",ge=>{let Me=ge.which;[13,32].includes(Me)&&(Me!==13?(ge.preventDefault(),ge.stopPropagation(),rt.toggleMenu.call(F,ge)):rt.focusFirstMenuItem.call(F,null,!0))},null,!1),this.bind(q.settings.menu,"keydown",ge=>{ge.which===27&&rt.toggleMenu.call(F,ge)}),this.bind(q.inputs.seek,"mousedown mousemove",ge=>{let Me=q.progress.getBoundingClientRect(),ke=100/Me.width*(ge.pageX-Me.left);ge.currentTarget.setAttribute("seek-value",ke)}),this.bind(q.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",ge=>{let Me=ge.currentTarget,ke=ge.keyCode?ge.keyCode:ge.which,$e="play-on-seeked";if(ee(ge)&&ke!==39&&ke!==37)return;F.lastSeekTime=Date.now();let gt=Me.hasAttribute($e),Nt=["mouseup","touchend","keyup"].includes(ge.type);gt&&Nt?(Me.removeAttribute($e),Xe(F.play())):!Nt&&F.playing&&(Me.setAttribute($e,""),F.pause())}),le.isIos){let ge=he.call(F,'input[type="range"]');Array.from(ge).forEach(Me=>this.bind(Me,fe,ke=>j(ke.target)))}this.bind(q.inputs.seek,fe,ge=>{let Me=ge.currentTarget,ke=Me.getAttribute("seek-value");Q(ke)&&(ke=Me.value),Me.removeAttribute("seek-value"),F.currentTime=ke/Me.max*F.duration},"seek"),this.bind(q.progress,"mouseenter mouseleave mousemove",ge=>rt.updateSeekTooltip.call(F,ge)),this.bind(q.progress,"mousemove touchmove",ge=>{let{previewThumbnails:Me}=F;Me&&Me.loaded&&Me.startMove(ge)}),this.bind(q.progress,"mouseleave touchend click",()=>{let{previewThumbnails:ge}=F;ge&&ge.loaded&&ge.endMove(!1,!0)}),this.bind(q.progress,"mousedown touchstart",ge=>{let{previewThumbnails:Me}=F;Me&&Me.loaded&&Me.startScrubbing(ge)}),this.bind(q.progress,"mouseup touchend",ge=>{let{previewThumbnails:Me}=F;Me&&Me.loaded&&Me.endScrubbing(ge)}),le.isWebkit&&Array.from(he.call(F,'input[type="range"]')).forEach(ge=>{this.bind(ge,"input",Me=>rt.updateRangeFill.call(F,Me.target))}),F.config.toggleInvert&&!se(q.display.duration)&&this.bind(q.display.currentTime,"click",()=>{F.currentTime!==0&&(F.config.invertTime=!F.config.invertTime,rt.timeUpdate.call(F))}),this.bind(q.inputs.volume,fe,ge=>{F.volume=ge.target.value},"volume"),this.bind(q.controls,"mouseenter mouseleave",ge=>{q.controls.hover=!F.touch&&ge.type==="mouseenter"}),q.fullscreen&&Array.from(q.fullscreen.children).filter(ge=>!ge.contains(q.container)).forEach(ge=>{this.bind(ge,"mouseenter mouseleave",Me=>{q.controls.hover=!F.touch&&Me.type==="mouseenter"})}),this.bind(q.controls,"mousedown mouseup touchstart touchend touchcancel",ge=>{q.controls.pressed=["mousedown","touchstart"].includes(ge.type)}),this.bind(q.controls,"focusin",()=>{let{config:ge,timers:Me}=F;ne(q.controls,ge.classNames.noTransition,!0),Qe.toggleControls.call(F,!0),setTimeout(()=>{ne(q.controls,ge.classNames.noTransition,!1)},0);let ke=this.touch?3e3:4e3;clearTimeout(Me.controls),Me.controls=setTimeout(()=>Qe.toggleControls.call(F,!1),ke)}),this.bind(q.inputs.volume,"wheel",ge=>{let Me=ge.webkitDirectionInvertedFromDevice,[ke,$e]=[ge.deltaX,-ge.deltaY].map(Lt=>Me?-Lt:Lt),gt=Math.sign(Math.abs(ke)>Math.abs($e)?ke:$e);F.increaseVolume(gt/50);let{volume:Nt}=F.media;(gt===1&&Nt<1||gt===-1&&Nt>0)&&ge.preventDefault()},"volume",!1)}),this.player=z,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(z){let{player:F}=this,{elements:q}=F,fe=z.keyCode?z.keyCode:z.which,ge=z.type==="keydown",Me=ge&&fe===this.lastKey;if(!(z.altKey||z.ctrlKey||z.metaKey||z.shiftKey)&&!!Y(fe))if(ge){let ke=document.activeElement;if(se(ke)){let{editable:$e}=F.config.selectors,{seek:gt}=q.inputs;if(ke!==gt&&Ie(ke,$e)||z.which===32&&Ie(ke,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(fe)&&(z.preventDefault(),z.stopPropagation()),fe){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:Me||(F.currentTime=F.duration/10*(fe-48));break;case 32:case 75:Me||Xe(F.togglePlay());break;case 38:F.increaseVolume(.1);break;case 40:F.decreaseVolume(.1);break;case 77:Me||(F.muted=!F.muted);break;case 39:F.forward();break;case 37:F.rewind();break;case 70:F.fullscreen.toggle();break;case 67:Me||F.toggleCaptions();break;case 76:F.loop=!F.loop}fe===27&&!F.fullscreen.usingNative&&F.fullscreen.active&&F.fullscreen.toggle(),this.lastKey=fe}else this.lastKey=null}toggleMenu(z){rt.toggleMenu.call(this.player,z)}}typeof globalThis!="undefined"||typeof window!="undefined"||typeof global!="undefined"&&global;var dt=function(S,z){return S(z={exports:{}},z.exports),z.exports}(function(S,z){S.exports=function(){var F=function(){},q={},fe={},ge={};function Me(At,Ht){At=At.push?At:[At];var xe,et,Mt,nt=[],It=At.length,Ft=It;for(xe=function(Wt,zt){zt.length&&nt.push(Wt),--Ft||Ht(nt)};It--;)et=At[It],(Mt=fe[et])?xe(et,Mt):(ge[et]=ge[et]||[]).push(xe)}function ke(At,Ht){if(At){var xe=ge[At];if(fe[At]=Ht,xe)for(;xe.length;)xe[0](At,Ht),xe.splice(0,1)}}function $e(At,Ht){At.call&&(At={success:At}),Ht.length?(At.error||F)(Ht):(At.success||F)(At)}function gt(At,Ht,xe,et){var Mt,nt,It=document,Ft=xe.async,Wt=(xe.numRetries||0)+1,zt=xe.before||F,qt=At.replace(/[\?|#].*$/,""),er=At.replace(/^(css|img)!/,"");et=et||0,/(^css!|\.css$)/.test(qt)?((nt=It.createElement("link")).rel="stylesheet",nt.href=er,(Mt="hideFocus"in nt)&&nt.relList&&(Mt=0,nt.rel="preload",nt.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(qt)?(nt=It.createElement("img")).src=er:((nt=It.createElement("script")).src=At,nt.async=Ft===void 0||Ft),nt.onload=nt.onerror=nt.onbeforeload=function(dr){var cr=dr.type[0];if(Mt)try{nt.sheet.cssText.length||(cr="e")}catch(yr){yr.code!=18&&(cr="e")}if(cr=="e"){if((et+=1){dt(S,{success:z,error:F})})}function bt(S){S&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===S&&(this.media.paused=!S,we.call(this,this.media,S?"play":"pause"))}let Yt={setup(){let S=this;ne(S.elements.wrapper,S.config.classNames.embed,!0),S.options.speed=S.config.speed.options,He.call(S),U(window.Vimeo)?Yt.ready.call(S):st(S.config.urls.vimeo.sdk).then(()=>{Yt.ready.call(S)}).catch(z=>{S.debug.warn("Vimeo SDK (player.js) failed to load",z)})},ready(){let S=this,z=S.config.vimeo,{premium:F,referrerPolicy:q,...fe}=z;F&&Object.assign(fe,{controls:!1,sidedock:!1});let ge=kt({loop:S.config.loop.active,autoplay:S.autoplay,muted:S.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...fe}),Me=S.media.getAttribute("src");Q(Me)&&(Me=S.media.getAttribute(S.config.attributes.embed.id));let ke=Q($e=Me)?null:Y(Number($e))?$e:$e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:$e;var $e;let gt=l("iframe"),Nt=vt(S.config.urls.vimeo.iframe,ke,ge);if(gt.setAttribute("src",Nt),gt.setAttribute("allowfullscreen",""),gt.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),Q(q)||gt.setAttribute("referrerPolicy",q),F||!z.customControls)gt.setAttribute("data-poster",S.poster),S.media=te(gt,S.media);else{let nt=l("div",{class:S.config.classNames.embedContainer,"data-poster":S.poster});nt.appendChild(gt),S.media=te(nt,S.media)}z.customControls||Ue(vt(S.config.urls.vimeo.api,Nt)).then(nt=>{!Q(nt)&&nt.thumbnail_url&&Qe.setPoster.call(S,nt.thumbnail_url).catch(()=>{})}),S.embed=new window.Vimeo.Player(gt,{autopause:S.config.autopause,muted:S.muted}),S.media.paused=!0,S.media.currentTime=0,S.supported.ui&&S.embed.disableTextTrack(),S.media.play=()=>(bt.call(S,!0),S.embed.play()),S.media.pause=()=>(bt.call(S,!1),S.embed.pause()),S.media.stop=()=>{S.pause(),S.currentTime=0};let{currentTime:Lt}=S.media;Object.defineProperty(S.media,"currentTime",{get:()=>Lt,set(nt){let{embed:It,media:Ft,paused:Wt,volume:zt}=S,qt=Wt&&!It.hasPlayed;Ft.seeking=!0,we.call(S,Ft,"seeking"),Promise.resolve(qt&&It.setVolume(0)).then(()=>It.setCurrentTime(nt)).then(()=>qt&&It.pause()).then(()=>qt&&It.setVolume(zt)).catch(()=>{})}});let At=S.config.speed.selected;Object.defineProperty(S.media,"playbackRate",{get:()=>At,set(nt){S.embed.setPlaybackRate(nt).then(()=>{At=nt,we.call(S,S.media,"ratechange")}).catch(()=>{S.options.speed=[1]})}});let{volume:Ht}=S.config;Object.defineProperty(S.media,"volume",{get:()=>Ht,set(nt){S.embed.setVolume(nt).then(()=>{Ht=nt,we.call(S,S.media,"volumechange")})}});let{muted:xe}=S.config;Object.defineProperty(S.media,"muted",{get:()=>xe,set(nt){let It=!!ue(nt)&&nt;S.embed.setVolume(It?0:S.config.volume).then(()=>{xe=It,we.call(S,S.media,"volumechange")})}});let et,{loop:Mt}=S.config;Object.defineProperty(S.media,"loop",{get:()=>Mt,set(nt){let It=ue(nt)?nt:S.config.loop.active;S.embed.setLoop(It).then(()=>{Mt=It})}}),S.embed.getVideoUrl().then(nt=>{et=nt,rt.setDownloadUrl.call(S)}).catch(nt=>{this.debug.warn(nt)}),Object.defineProperty(S.media,"currentSrc",{get:()=>et}),Object.defineProperty(S.media,"ended",{get:()=>S.currentTime===S.duration}),Promise.all([S.embed.getVideoWidth(),S.embed.getVideoHeight()]).then(nt=>{let[It,Ft]=nt;S.embed.ratio=ze(It,Ft),He.call(this)}),S.embed.setAutopause(S.config.autopause).then(nt=>{S.config.autopause=nt}),S.embed.getVideoTitle().then(nt=>{S.config.title=nt,Qe.setTitle.call(this)}),S.embed.getCurrentTime().then(nt=>{Lt=nt,we.call(S,S.media,"timeupdate")}),S.embed.getDuration().then(nt=>{S.media.duration=nt,we.call(S,S.media,"durationchange")}),S.embed.getTextTracks().then(nt=>{S.media.textTracks=nt,ft.setup.call(S)}),S.embed.on("cuechange",({cues:nt=[]})=>{let It=nt.map(Ft=>function(Wt){let zt=document.createDocumentFragment(),qt=document.createElement("div");return zt.appendChild(qt),qt.innerHTML=Wt,zt.firstChild.innerText}(Ft.text));ft.updateCues.call(S,It)}),S.embed.on("loaded",()=>{S.embed.getPaused().then(nt=>{bt.call(S,!nt),nt||we.call(S,S.media,"playing")}),se(S.embed.element)&&S.supported.ui&&S.embed.element.setAttribute("tabindex",-1)}),S.embed.on("bufferstart",()=>{we.call(S,S.media,"waiting")}),S.embed.on("bufferend",()=>{we.call(S,S.media,"playing")}),S.embed.on("play",()=>{bt.call(S,!0),we.call(S,S.media,"playing")}),S.embed.on("pause",()=>{bt.call(S,!1)}),S.embed.on("timeupdate",nt=>{S.media.seeking=!1,Lt=nt.seconds,we.call(S,S.media,"timeupdate")}),S.embed.on("progress",nt=>{S.media.buffered=nt.percent,we.call(S,S.media,"progress"),parseInt(nt.percent,10)===1&&we.call(S,S.media,"canplaythrough"),S.embed.getDuration().then(It=>{It!==S.media.duration&&(S.media.duration=It,we.call(S,S.media,"durationchange"))})}),S.embed.on("seeked",()=>{S.media.seeking=!1,we.call(S,S.media,"seeked")}),S.embed.on("ended",()=>{S.media.paused=!0,we.call(S,S.media,"ended")}),S.embed.on("error",nt=>{S.media.error=nt,we.call(S,S.media,"error")}),z.customControls&&setTimeout(()=>Qe.build.call(S),0)}};function xt(S){S&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===S&&(this.media.paused=!S,we.call(this,this.media,S?"play":"pause"))}function Qt(S){return S.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}let Xt={setup(){if(ne(this.elements.wrapper,this.config.classNames.embed,!0),U(window.YT)&&re(window.YT.Player))Xt.ready.call(this);else{let S=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{re(S)&&S(),Xt.ready.call(this)},st(this.config.urls.youtube.sdk).catch(z=>{this.debug.warn("YouTube API failed to load",z)})}},getTitle(S){Ue(vt(this.config.urls.youtube.api,S)).then(z=>{if(U(z)){let{title:F,height:q,width:fe}=z;this.config.title=F,Qe.setTitle.call(this),this.embed.ratio=ze(fe,q)}He.call(this)}).catch(()=>{He.call(this)})},ready(){let S=this,z=S.config.youtube,F=S.media&&S.media.getAttribute("id");if(!Q(F)&&F.startsWith("youtube-"))return;let q=S.media.getAttribute("src");Q(q)&&(q=S.media.getAttribute(this.config.attributes.embed.id));let fe=Q(ge=q)?null:ge.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:ge;var ge;let Me=l("div",{id:`${S.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":z.customControls?S.poster:void 0});if(S.media=te(Me,S.media),z.customControls){let ke=$e=>`https://i.ytimg.com/vi/${fe}/${$e}default.jpg`;Oe(ke("maxres"),121).catch(()=>Oe(ke("sd"),121)).catch(()=>Oe(ke("hq"))).then($e=>Qe.setPoster.call(S,$e.src)).then($e=>{$e.includes("maxres")||(S.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}S.embed=new window.YT.Player(S.media,{videoId:fe,host:Qt(z),playerVars:c({},{autoplay:S.config.autoplay?1:0,hl:S.config.hl,controls:S.supported.ui&&z.customControls?0:1,disablekb:1,playsinline:S.config.fullscreen.iosNative?0:1,cc_load_policy:S.captions.active?1:0,cc_lang_pref:S.config.captions.language,widget_referrer:window?window.location.href:null},z),events:{onError(ke){if(!S.media.error){let $e=ke.data,gt={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."}[$e]||"An unknown error occured";S.media.error={code:$e,message:gt},we.call(S,S.media,"error")}},onPlaybackRateChange(ke){let $e=ke.target;S.media.playbackRate=$e.getPlaybackRate(),we.call(S,S.media,"ratechange")},onReady(ke){if(re(S.media.play))return;let $e=ke.target;Xt.getTitle.call(S,fe),S.media.play=()=>{xt.call(S,!0),$e.playVideo()},S.media.pause=()=>{xt.call(S,!1),$e.pauseVideo()},S.media.stop=()=>{$e.stopVideo()},S.media.duration=$e.getDuration(),S.media.paused=!0,S.media.currentTime=0,Object.defineProperty(S.media,"currentTime",{get:()=>Number($e.getCurrentTime()),set(At){S.paused&&!S.embed.hasPlayed&&S.embed.mute(),S.media.seeking=!0,we.call(S,S.media,"seeking"),$e.seekTo(At)}}),Object.defineProperty(S.media,"playbackRate",{get:()=>$e.getPlaybackRate(),set(At){$e.setPlaybackRate(At)}});let{volume:gt}=S.config;Object.defineProperty(S.media,"volume",{get:()=>gt,set(At){gt=At,$e.setVolume(100*gt),we.call(S,S.media,"volumechange")}});let{muted:Nt}=S.config;Object.defineProperty(S.media,"muted",{get:()=>Nt,set(At){let Ht=ue(At)?At:Nt;Nt=Ht,$e[Ht?"mute":"unMute"](),$e.setVolume(100*gt),we.call(S,S.media,"volumechange")}}),Object.defineProperty(S.media,"currentSrc",{get:()=>$e.getVideoUrl()}),Object.defineProperty(S.media,"ended",{get:()=>S.currentTime===S.duration});let Lt=$e.getAvailablePlaybackRates();S.options.speed=Lt.filter(At=>S.config.speed.options.includes(At)),S.supported.ui&&z.customControls&&S.media.setAttribute("tabindex",-1),we.call(S,S.media,"timeupdate"),we.call(S,S.media,"durationchange"),clearInterval(S.timers.buffering),S.timers.buffering=setInterval(()=>{S.media.buffered=$e.getVideoLoadedFraction(),(S.media.lastBuffered===null||S.media.lastBufferedQe.build.call(S),50)},onStateChange(ke){let $e=ke.target;switch(clearInterval(S.timers.playing),S.media.seeking&&[1,2].includes(ke.data)&&(S.media.seeking=!1,we.call(S,S.media,"seeked")),ke.data){case-1:we.call(S,S.media,"timeupdate"),S.media.buffered=$e.getVideoLoadedFraction(),we.call(S,S.media,"progress");break;case 0:xt.call(S,!1),S.media.loop?($e.stopVideo(),$e.playVideo()):we.call(S,S.media,"ended");break;case 1:z.customControls&&!S.config.autoplay&&S.media.paused&&!S.embed.hasPlayed?S.media.pause():(xt.call(S,!0),we.call(S,S.media,"playing"),S.timers.playing=setInterval(()=>{we.call(S,S.media,"timeupdate")},50),S.media.duration!==$e.getDuration()&&(S.media.duration=$e.getDuration(),we.call(S,S.media,"durationchange")));break;case 2:S.muted||S.embed.unMute(),xt.call(S,!1);break;case 3:we.call(S,S.media,"waiting")}we.call(S,S.elements.container,"statechange",!1,{code:ke.data})}}})}},Ut={setup(){this.media?(ne(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),ne(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&ne(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=l("div",{class:this.config.classNames.video}),E(this.media,this.elements.wrapper),this.elements.poster=l("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?mt.setup.call(this):this.isYouTube?Xt.setup.call(this):this.isVimeo&&Yt.setup.call(this)):this.debug.warn("No media element found!")}};class Zt{constructor(z){e(this,"load",()=>{this.enabled&&(U(window.google)&&U(window.google.ima)?this.ready():st(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),e(this,"ready",()=>{var F;this.enabled||((F=this).manager&&F.manager.destroy(),F.elements.displayContainer&&F.elements.displayContainer.destroy(),F.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),e(this,"setupIMA",()=>{this.elements.container=l("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,F=>this.onAdsManagerLoaded(F),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,F=>this.onAdError(F),!1),this.requestAds()}),e(this,"requestAds",()=>{let{container:F}=this.player.elements;try{let q=new google.ima.AdsRequest;q.adTagUrl=this.tagUrl,q.linearAdSlotWidth=F.offsetWidth,q.linearAdSlotHeight=F.offsetHeight,q.nonLinearAdSlotWidth=F.offsetWidth,q.nonLinearAdSlotHeight=F.offsetHeight,q.forceNonLinearFullSlot=!1,q.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(q)}catch(q){this.onAdError(q)}}),e(this,"pollCountdown",(F=!1)=>{if(!F)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{let q=Et(Math.max(this.manager.getRemainingTime(),0)),fe=`${Ze.get("advertisement",this.player.config)} - ${q}`;this.elements.container.setAttribute("data-badge-text",fe)},100)}),e(this,"onAdsManagerLoaded",F=>{if(!this.enabled)return;let q=new google.ima.AdsRenderingSettings;q.restoreCustomPlaybackStateOnAdBreakComplete=!0,q.enablePreloading=!0,this.manager=F.getAdsManager(this.player,q),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,fe=>this.onAdError(fe)),Object.keys(google.ima.AdEvent.Type).forEach(fe=>{this.manager.addEventListener(google.ima.AdEvent.Type[fe],ge=>this.onAdEvent(ge))}),this.trigger("loaded")}),e(this,"addCuePoints",()=>{Q(this.cuePoints)||this.cuePoints.forEach(F=>{if(F!==0&&F!==-1&&F{let{container:q}=this.player.elements,fe=F.getAd(),ge=F.getAdData();switch((Me=>{we.call(this.player,this.player.media,`ads${Me.replace(/_/g,"").toLowerCase()}`)})(F.type),F.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),fe.isLinear()||(fe.width=q.offsetWidth,fe.height=q.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:ge.adError&&this.player.debug.warn(`Non-fatal ad error: ${ge.adError.getMessage()}`)}}),e(this,"onAdError",F=>{this.cancel(),this.player.debug.warn("Ads error",F)}),e(this,"listeners",()=>{let{container:F}=this.player.elements,q;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{q=this.player.currentTime}),this.player.on("seeked",()=>{let fe=this.player.currentTime;Q(this.cuePoints)||this.cuePoints.forEach((ge,Me)=>{q{this.manager&&this.manager.resize(F.offsetWidth,F.offsetHeight,google.ima.ViewMode.NORMAL)})}),e(this,"play",()=>{let{container:F}=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(F.offsetWidth,F.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(q){this.onAdError(q)}}).catch(()=>{})}),e(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,Xe(this.player.media.play())}),e(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),e(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),e(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(F=>{this.on("loaded",F),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),e(this,"trigger",(F,...q)=>{let fe=this.events[F];ve(fe)&&fe.forEach(ge=>{re(ge)&&ge.apply(this,q)})}),e(this,"on",(F,q)=>(ve(this.events[F])||(this.events[F]=[]),this.events[F].push(q),this)),e(this,"startSafetyTimer",(F,q)=>{this.player.debug.log(`Safety timer invoked from: ${q}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},F)}),e(this,"clearSafetyTimer",F=>{x(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${F}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=z,this.config=z.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((F,q)=>{this.on("loaded",F),this.on("error",q)}),this.load()}get enabled(){let{config:z}=this;return this.player.isHTML5&&this.player.isVideo&&z.enabled&&(!Q(z.publisherId)||de(z.tagUrl))}get tagUrl(){let{config:z}=this;return de(z.tagUrl)?z.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${kt({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:z.publisherId})}`}}let qe=S=>{let z=[];return S.split(/\r\n\r\n|\n\n|\r\r/).forEach(F=>{let q={};F.split(/\r\n|\n|\r/).forEach(fe=>{if(Y(q.startTime)){if(!Q(fe.trim())&&Q(q.text)){let ge=fe.trim().split("#xywh=");[q.text]=ge,ge[1]&&([q.x,q.y,q.w,q.h]=ge[1].split(","))}}else{let ge=fe.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})/);ge&&(q.startTime=60*Number(ge[1]||0)*60+60*Number(ge[2])+Number(ge[3])+Number(`0.${ge[4]}`),q.endTime=60*Number(ge[6]||0)*60+60*Number(ge[7])+Number(ge[8])+Number(`0.${ge[9]}`))}}),q.text&&z.push(q)}),z},ot=(S,z)=>{let F={};return S>z.width/z.height?(F.width=z.width,F.height=1/S*z.width):(F.height=z.height,F.width=S*z.height),F};class yt{constructor(z){e(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.loaded=!0)})}),e(this,"getThumbnails",()=>new Promise(F=>{let{src:q}=this.player.config.previewThumbnails;if(Q(q))throw new Error("Missing previewThumbnails.src config attribute");let fe=()=>{this.thumbnails.sort((ge,Me)=>ge.height-Me.height),this.player.debug.log("Preview thumbnails",this.thumbnails),F()};if(re(q))q(ge=>{this.thumbnails=ge,fe()});else{let ge=(oe(q)?[q]:q).map(Me=>this.getThumbnail(Me));Promise.all(ge).then(fe)}})),e(this,"getThumbnail",F=>new Promise(q=>{Ue(F).then(fe=>{let ge={frames:qe(fe),height:null,urlPrefix:""};ge.frames[0].text.startsWith("/")||ge.frames[0].text.startsWith("http://")||ge.frames[0].text.startsWith("https://")||(ge.urlPrefix=F.substring(0,F.lastIndexOf("/")+1));let Me=new Image;Me.onload=()=>{ge.height=Me.naturalHeight,ge.width=Me.naturalWidth,this.thumbnails.push(ge),q()},Me.src=ge.urlPrefix+ge.frames[0].text})})),e(this,"startMove",F=>{if(this.loaded&&J(F)&&["touchmove","mousemove"].includes(F.type)&&this.player.media.duration){if(F.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{let q=this.player.elements.progress.getBoundingClientRect(),fe=100/q.width*(F.pageX-q.left);this.seekTime=this.player.media.duration*(fe/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=F.pageX,this.elements.thumb.time.innerText=Et(this.seekTime)}this.showImageAtCurrentTime()}}),e(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),e(this,"startScrubbing",F=>{(x(F.button)||F.button===!1||F.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),e(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Ge.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),e(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})}),e(this,"render",()=>{this.elements.thumb.container=l("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=l("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);let F=l("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=l("span",{},"00:00"),F.appendChild(this.elements.thumb.time),this.elements.thumb.container.appendChild(F),se(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=l("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),e(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),e(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();let F=this.thumbnails[0].frames.findIndex(ge=>this.seekTime>=ge.startTime&&this.seekTime<=ge.endTime),q=F>=0,fe=0;this.mouseDown||this.toggleThumbContainer(q),q&&(this.thumbnails.forEach((ge,Me)=>{this.loadedImages.includes(ge.frames[F].text)&&(fe=Me)}),F!==this.showingThumb&&(this.showingThumb=F,this.loadImage(fe)))}),e(this,"loadImage",(F=0)=>{let q=this.showingThumb,fe=this.thumbnails[F],{urlPrefix:ge}=fe,Me=fe.frames[q],ke=fe.frames[q].text,$e=ge+ke;if(this.currentImageElement&&this.currentImageElement.dataset.filename===ke)this.showImage(this.currentImageElement,Me,F,q,ke,!1),this.currentImageElement.dataset.index=q,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);let gt=new Image;gt.src=$e,gt.dataset.index=q,gt.dataset.filename=ke,this.showingThumbFilename=ke,this.player.debug.log(`Loading image: ${$e}`),gt.onload=()=>this.showImage(gt,Me,F,q,ke,!0),this.loadingImage=gt,this.removeOldImages(gt)}}),e(this,"showImage",(F,q,fe,ge,Me,ke=!0)=>{this.player.debug.log(`Showing thumb: ${Me}. num: ${ge}. qual: ${fe}. newimg: ${ke}`),this.setImageSizeAndOffset(F,q),ke&&(this.currentImageContainer.appendChild(F),this.currentImageElement=F,this.loadedImages.includes(Me)||this.loadedImages.push(Me)),this.preloadNearby(ge,!0).then(this.preloadNearby(ge,!1)).then(this.getHigherQuality(fe,F,q,Me))}),e(this,"removeOldImages",F=>{Array.from(this.currentImageContainer.children).forEach(q=>{if(q.tagName.toLowerCase()!=="img")return;let fe=this.usingSprites?500:1e3;if(q.dataset.index!==F.dataset.index&&!q.dataset.deleting){q.dataset.deleting=!0;let{currentImageContainer:ge}=this;setTimeout(()=>{ge.removeChild(q),this.player.debug.log(`Removing thumb: ${q.dataset.filename}`)},fe)}})}),e(this,"preloadNearby",(F,q=!0)=>new Promise(fe=>{setTimeout(()=>{let ge=this.thumbnails[0].frames[F].text;if(this.showingThumbFilename===ge){let Me;Me=q?this.thumbnails[0].frames.slice(F):this.thumbnails[0].frames.slice(0,F).reverse();let ke=!1;Me.forEach($e=>{let gt=$e.text;if(gt!==ge&&!this.loadedImages.includes(gt)){ke=!0,this.player.debug.log(`Preloading thumb filename: ${gt}`);let{urlPrefix:Nt}=this.thumbnails[0],Lt=Nt+gt,At=new Image;At.src=Lt,At.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${gt}`),this.loadedImages.includes(gt)||this.loadedImages.push(gt),fe()}}}),ke||fe()}},300)})),e(this,"getHigherQuality",(F,q,fe,ge)=>{if(F{this.showingThumbFilename===ge&&(this.player.debug.log(`Showing higher quality thumb for: ${ge}`),this.loadImage(F+1))},300)}}),e(this,"toggleThumbContainer",(F=!1,q=!1)=>{let fe=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(fe,F),!F&&q&&(this.showingThumb=null,this.showingThumbFilename=null)}),e(this,"toggleScrubbingContainer",(F=!1)=>{let q=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(q,F),F||(this.showingThumb=null,this.showingThumbFilename=null)}),e(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),e(this,"setThumbContainerSizeAndPos",()=>{if(this.sizeSpecifiedInCSS){if(this.elements.thumb.imageContainer.clientHeight>20&&this.elements.thumb.imageContainer.clientWidth<20){let F=Math.floor(this.elements.thumb.imageContainer.clientHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.width=`${F}px`}else if(this.elements.thumb.imageContainer.clientHeight<20&&this.elements.thumb.imageContainer.clientWidth>20){let F=Math.floor(this.elements.thumb.imageContainer.clientWidth/this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height=`${F}px`}}else{let F=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);this.elements.thumb.imageContainer.style.height=`${this.thumbContainerHeight}px`,this.elements.thumb.imageContainer.style.width=`${F}px`}this.setThumbContainerPos()}),e(this,"setThumbContainerPos",()=>{let F=this.player.elements.progress.getBoundingClientRect(),q=this.player.elements.container.getBoundingClientRect(),{container:fe}=this.elements.thumb,ge=q.left-F.left+10,Me=q.right-F.left-fe.clientWidth-10,ke=this.mousePosX-F.left-fe.clientWidth/2;keMe&&(ke=Me),fe.style.left=`${ke}px`}),e(this,"setScrubbingContainerSize",()=>{let{width:F,height:q}=ot(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${F}px`,this.elements.scrubbing.container.style.height=`${q}px`}),e(this,"setImageSizeAndOffset",(F,q)=>{if(!this.usingSprites)return;let fe=this.thumbContainerHeight/q.h;F.style.height=F.naturalHeight*fe+"px",F.style.width=F.naturalWidth*fe+"px",F.style.left=`-${q.x*fe}px`,F.style.top=`-${q.y*fe}px`}),this.player=z,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){let{height:z}=ot(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return z}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(z){this.mouseDown?this.currentScrubbingImageElement=z:this.currentThumbnailImageElement=z}}let Ke={insertElements(S,z){oe(z)?d(S,this.media,{src:z}):ve(z)&&z.forEach(F=>{d(S,this.media,F)})},change(S){G(S,"sources.length")?(mt.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],y(this.media),this.media=null,se(this.elements.container)&&this.elements.container.removeAttribute("class");let{sources:z,type:F}=S,[{provider:q=Pt.html5,src:fe}]=z,ge=q==="html5"?F:"div",Me=q==="html5"?{}:{src:fe};Object.assign(this,{provider:q,type:F,supported:De.check(F,q,this.config.playsinline),media:l(ge,Me)}),this.elements.container.appendChild(this.media),ue(S.autoplay)&&(this.config.autoplay=S.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),Q(S.poster)||(this.poster=S.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Qe.addStyleHook.call(this),this.isHTML5&&Ke.insertElements.call(this,"source",z),this.config.title=S.title,Ut.setup.call(this),this.isHTML5&&Object.keys(S).includes("tracks")&&Ke.insertElements.call(this,"track",S.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.isHTML5&&this.media.load(),Q(S.previewThumbnails)||(Object.assign(this.config.previewThumbnails,S.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new yt(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class it{constructor(z,F){if(e(this,"play",()=>re(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>Xe(this.media.play())),this.media.play()):null),e(this,"pause",()=>this.playing&&re(this.media.pause)?this.media.pause():null),e(this,"togglePlay",ke=>(ue(ke)?ke:!this.playing)?this.play():this.pause()),e(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):re(this.media.stop)&&this.media.stop()}),e(this,"restart",()=>{this.currentTime=0}),e(this,"rewind",ke=>{this.currentTime-=Y(ke)?ke:this.config.seekTime}),e(this,"forward",ke=>{this.currentTime+=Y(ke)?ke:this.config.seekTime}),e(this,"increaseVolume",ke=>{let $e=this.media.muted?0:this.volume;this.volume=$e+(Y(ke)?ke:0)}),e(this,"decreaseVolume",ke=>{this.increaseVolume(-ke)}),e(this,"airplay",()=>{De.airplay&&this.media.webkitShowPlaybackTargetPicker()}),e(this,"toggleControls",ke=>{if(this.supported.ui&&!this.isAudio){let $e=Se(this.elements.container,this.config.classNames.hideControls),gt=ke===void 0?void 0:!ke,Nt=ne(this.elements.container,this.config.classNames.hideControls,gt);if(Nt&&ve(this.config.controls)&&this.config.controls.includes("settings")&&!Q(this.config.settings)&&rt.toggleMenu.call(this,!1),Nt!==$e){let Lt=Nt?"controlshidden":"controlsshown";we.call(this,this.media,Lt)}return!Nt}return!1}),e(this,"on",(ke,$e)=>{Le.call(this,this.elements.container,ke,$e)}),e(this,"once",(ke,$e)=>{Ge.call(this,this.elements.container,ke,$e)}),e(this,"off",(ke,$e)=>{Ve(this.elements.container,ke,$e)}),e(this,"destroy",(ke,$e=!1)=>{if(!this.ready)return;let gt=()=>{document.body.style.overflow="",this.embed=null,$e?(Object.keys(this.elements).length&&(y(this.elements.buttons.play),y(this.elements.captions),y(this.elements.controls),y(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),re(ke)&&ke()):(at.call(this),mt.cancelRequests.call(this),te(this.elements.original,this.elements.container),we.call(this,this.elements.original,"destroyed",!0),re(ke)&&ke.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?(Qe.toggleNativeControls.call(this,!0),gt()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&re(this.embed.destroy)&&this.embed.destroy(),gt()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(gt),setTimeout(gt,200))}),e(this,"supports",ke=>De.mime.call(this,ke)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=De.touch,this.media=z,oe(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||ce(this.media)||ve(this.media))&&(this.media=this.media[0]),this.config=c({},Gt,it.defaults,F||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(ke){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 Te(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",De),x(this.media)||!se(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(!De.check().api)return void this.debug.error("Setup failed: no support");let q=this.media.cloneNode(!0);q.autoplay=!1,this.elements.original=q;let fe=this.media.tagName.toLowerCase(),ge=null,Me=null;switch(fe){case"div":if(ge=this.media.querySelector("iframe"),se(ge)){if(Me=Dt(ge.getAttribute("src")),this.provider=function(ke){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(ke)?Pt.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(ke)?Pt.vimeo:null}(Me.toString()),this.elements.container=this.media,this.media=ge,this.elements.container.className="",Me.search.length){let ke=["1","true"];ke.includes(Me.searchParams.get("autoplay"))&&(this.config.autoplay=!0),ke.includes(Me.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=ke.includes(Me.searchParams.get("playsinline")),this.config.youtube.hl=Me.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(Q(this.provider)||!Object.values(Pt).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Z;break;case"video":case"audio":this.type=fe,this.provider=Pt.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=De.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new Tt(this),this.storage=new ut(this),this.media.plyr=this,se(this.elements.container)||(this.elements.container=l("div",{tabindex:0}),E(this.media,this.elements.container)),Qe.migrateStyles.call(this),Qe.addStyleHook.call(this),Ut.setup.call(this),this.config.debug&&Le.call(this,this.elements.container,this.config.events.join(" "),ke=>{this.debug.log(`event: ${ke.type}`)}),this.fullscreen=new be(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Qe.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Zt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>Xe(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new yt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Pt.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Pt.youtube}get isVimeo(){return this.provider===Pt.vimeo}get isVideo(){return this.type===Z}get isAudio(){return this.type===Ee}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&this.currentTime===0)}get ended(){return Boolean(this.media.ended)}set currentTime(z){if(!this.duration)return;let F=Y(z)&&z>0;this.media.currentTime=F?Math.min(z,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){let{buffered:z}=this.media;return Y(z)?z:z&&z.length&&this.duration>0?z.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){let z=parseFloat(this.config.duration),F=(this.media||{}).duration,q=Y(F)&&F!==1/0?F:0;return z||q}set volume(z){let F=z;oe(F)&&(F=Number(F)),Y(F)||(F=this.storage.get("volume")),Y(F)||({volume:F}=this.config),F>1&&(F=1),F<0&&(F=0),this.config.volume=F,this.media.volume=F,!Q(z)&&this.muted&&F>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(z){let F=z;ue(F)||(F=this.storage.get("muted")),ue(F)||(F=this.config.muted),this.config.muted=F,this.media.muted=F}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(z){let F=null;Y(z)&&(F=z),Y(F)||(F=this.storage.get("speed")),Y(F)||(F=this.config.speed.selected);let{minimumSpeed:q,maximumSpeed:fe}=this;F=function(ge=0,Me=0,ke=255){return Math.min(Math.max(ge,Me),ke)}(F,q,fe),this.config.speed.selected=F,setTimeout(()=>{this.media.playbackRate=F},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(z){let F=this.config.quality,q=this.options.quality;if(!q.length)return;let fe=[!Q(z)&&Number(z),this.storage.get("quality"),F.selected,F.default].find(Y),ge=!0;if(!q.includes(fe)){let Me=ct(q,fe);this.debug.warn(`Unsupported quality option: ${fe}, using ${Me} instead`),fe=Me,ge=!1}F.selected=fe,this.media.quality=fe,ge&&this.storage.set({quality:fe})}get quality(){return this.media.quality}set loop(z){let F=ue(z)?z:this.config.loop.active;this.config.loop.active=F,this.media.loop=F}get loop(){return Boolean(this.media.loop)}set source(z){Ke.change.call(this,z)}get source(){return this.media.currentSrc}get download(){let{download:z}=this.config.urls;return de(z)?z:this.source}set download(z){de(z)&&(this.config.urls.download=z,rt.setDownloadUrl.call(this))}set poster(z){this.isVideo?Qe.setPoster.call(this,z,!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;let z=wt(We.call(this));return ve(z)?z.join(":"):z}set ratio(z){this.isVideo?oe(z)&&Ct(z)?(this.config.ratio=wt(z),He.call(this)):this.debug.error(`Invalid aspect ratio specified (${z})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(z){let F=ue(z)?z:this.config.autoplay;this.config.autoplay=F}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(z){ft.toggle.call(this,z,!1)}set currentTrack(z){ft.set.call(this,z,!1)}get currentTrack(){let{toggled:z,currentTrack:F}=this.captions;return z?F:-1}set language(z){ft.setLanguage.call(this,z,!1)}get language(){return(ft.getCurrentTrack.call(this)||{}).language}set pip(z){if(!De.pip)return;let F=ue(z)?z:!this.pip;re(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(F?Kt:Vt),re(this.media.requestPictureInPicture)&&(!this.pip&&F?this.media.requestPictureInPicture():this.pip&&!F&&document.exitPictureInPicture())}get pip(){return De.pip?Q(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Kt:null}static supported(z,F,q){return De.check(z,F,q)}static loadSprite(z,F){return Je(z,F)}static setup(z,F={}){let q=null;return oe(z)?q=Array.from(document.querySelectorAll(z)):ce(z)?q=Array.from(z):ve(z)&&(q=z.filter(se)),Q(q)?null:q.map(fe=>new it(fe,F))}}var Ne;return it.defaults=(Ne=Gt,JSON.parse(JSON.stringify(Ne))),it})});var Qa=sr((Vl,ja)=>{ja.exports=function e(g,r,t){return r===void 0?function(p,i){return e(g,p,i)}:(t===void 0&&(t="0"),g-=r.toString().length,g>0?new Array(g+(/\./.test(r)?2:1)).join(t)+r:r+"")}});var Pn=sr((Kl,ei)=>{"use strict";ei.exports={fromMs:Ja,fromS:vo,toMs:Za,toS:yo};var Zr=Qa(),Dn=36e5,Nn=6e4,kr=1e3,$a="Time format error";function Ja(e,g="mm:ss"){if(typeof e!="number"||Number.isNaN(e))throw new Error("NaN error");let r=Math.abs(e),t=e<0,p=Math.floor(r/Dn),i=Math.floor(r%Dn/Nn),o=Math.floor(r%Nn/kr),n=Math.floor(r%kr);return Eo({negative:t,hours:p,minutes:i,seconds:o,miliseconds:n},g)}function vo(e,g="mm:ss"){if(typeof e!="number"||Number.isNaN(e))throw new Error("NaN error");let r=e*kr;return Ja(r,g)}function Za(e,g="mm:ss"){let r;if(["mm:ss","mm:ss.sss","hh:mm:ss","hh:mm:ss.sss"].includes(g))r=/^(-)?(?:(\d\d+):)?(\d\d):(\d\d)(\.\d+)?$/;else if(g==="hh:mm")r=/^(-)?(\d\d):(\d\d)(?::(\d\d)(?:(\.\d+))?)?$/;else throw new Error($a);let t=r.exec(e);if(!t)throw new Error;let p=t[1]==="-",i=t[2]|0,o=t[3]|0,n=t[4]|0,f=Math.floor(1e3*t[5]|0);if(o>60||n>60)throw new Error;return(p?-1:1)*(i*Dn+o*Nn+n*kr+f)}function yo(e,g="mm:ss"){let r=Za(e,g);return Math.floor(r/kr)}function Eo(e,g){let r,t,p;switch(g.toLowerCase()){case"hh:mm:ss.sss":r=!0,t=!0,p=!0;break;case"hh:mm:ss":r=!!e.miliseconds,t=!0,p=!0;break;case"hh:mm":r=!!e.miliseconds,t=r||!!e.seconds,p=!0;break;case"mm:ss":r=!!e.miliseconds,t=!0,p=!!e.hours;break;case"mm:ss.sss":r=!0,t=!0,p=!!e.hours;break;default:throw new Error($a)}let i=Zr(2,e.hours),o=Zr(2,e.minutes),n=Zr(2,e.seconds),f=Zr(3,e.miliseconds);return(e.negative?"-":"")+(p?r?`${i}:${o}:${n}.${f}`:t?`${i}:${o}:${n}`:`${i}:${o}`:r?`${o}:${n}.${f}`:`${o}:${n}`)}});Ds(exports,{default:()=>Fn});var oi=Jt(Pr()),li=Jt(require("obsidian"));var Xa=Jt(Kr());var jn=Jt(Kr()),Qn=Jt(require("obsidian"));var Yr=e=>e.hash?e.href.slice(0,-e.hash.length):e.href,Or=(e,g,r)=>{let[t,p]=(0,jn.default)(g);e.style.setProperty("--max-ratio-width",t*r+p)},Wr=(e,g)=>{let{editor:r,app:t}=g,p=r.getCursor("to");r.replaceRange(e,p,p),t.isMobile&&r.setCursor(r.offsetToPos(r.posToOffset(p)+e.length))},$n=e=>new Promise((g,r)=>{if(Qn.Platform.isDesktopApp){let t=require("https").request({hostname:"b23.tv",port:443,path:"/"+e,method:"GET"},p=>p.headers.location?g(p.headers.location):r(new Error("No redirect location found")));t.on("error",p=>r(p)),t.end()}else r(new TypeError("Calling node https in non-electron environment"))});var gr=e=>e.plugins.plugins["mx-bili-plugin"]!==void 0,Jn=e=>{let g=e.plugins.plugins["mx-bili-plugin"];if(gr(e))return g.settings.port;throw new Error("bili plugin not available")},Zn=e=>{let g=e.plugins.plugins["mx-bili-plugin"];if(gr(e))return g.portSetting;throw new Error("bili plugin not available")},ea=e=>{let g=e.plugins.plugins["mx-bili-plugin"];if(gr(e))return g.fetchPoster;throw new Error("bili plugin not available")};var ta=e=>createEl("iframe",{cls:"bili-iframe",attr:{src:e.iframe.toString(),scrolling:"no",border:"0",frameborder:"no",framespacing:"0",allowfullscreen:!1,sandbox:"allow-forms allow-presentation allow-same-origin allow-scripts allow-modals"}});var pr=Jt(require("obsidian")),En=Jt(zr()),xa=Jt(Da());var Zs={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"\u0430\u04A7\u0441\u0443\u0430 \u0431\u044B\u0437\u0448\u04D9\u0430"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"\u12A0\u121B\u122D\u129B"},an:{name:"Aragonese",nativeName:"aragon\xE9s"},ar:{name:"Arabic",nativeName:"\u0627\u0644\u0644\u063A\u0629 \u0627\u0644\u0639\u0631\u0628\u064A\u0629"},as:{name:"Assamese",nativeName:"\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE"},av:{name:"Avaric",nativeName:"\u0430\u0432\u0430\u0440 \u043C\u0430\u0446\u04C0"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"az\u0259rbaycan dili"},ba:{name:"Bashkir",nativeName:"\u0431\u0430\u0448\u04A1\u043E\u0440\u0442 \u0442\u0435\u043B\u0435"},be:{name:"Belarusian",nativeName:"\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F \u043C\u043E\u0432\u0430"},bg:{name:"Bulgarian",nativeName:"\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438 \u0435\u0437\u0438\u043A"},bh:{name:"Bihari",nativeName:"\u092D\u094B\u091C\u092A\u0941\u0930\u0940"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"\u09AC\u09BE\u0982\u09B2\u09BE"},bo:{name:"Tibetan",nativeName:"\u0F56\u0F7C\u0F51\u0F0B\u0F61\u0F72\u0F42"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Catal\xE0"},ce:{name:"Chechen",nativeName:"\u043D\u043E\u0445\u0447\u0438\u0439\u043D \u043C\u043E\u0442\u0442"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"\u14C0\u1426\u1403\u152D\u140D\u140F\u1423"},cs:{name:"Czech",nativeName:"\u010De\u0161tina"},cu:{name:"Old Church Slavonic",nativeName:"\u0469\u0437\u044B\u043A\u044A \u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A"},cv:{name:"Chuvash",nativeName:"\u0447\u04D1\u0432\u0430\u0448 \u0447\u04D7\u043B\u0445\u0438"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"Dhivehi"},dz:{name:"Dzongkha",nativeName:"\u0F62\u0FAB\u0F7C\u0F44\u0F0B\u0F41"},ee:{name:"Ewe",nativeName:"E\u028Begbe"},el:{name:"Greek",nativeName:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Espa\xF1ol"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"\u0641\u0627\u0631\u0633\u06CC"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"Vakaviti"},fo:{name:"Faroese",nativeName:"f\xF8royskt"},fr:{name:"French",nativeName:"Fran\xE7ais"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"G\xE0idhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaran\xED",nativeName:"Ava\xF1e'\u1EBD"},gu:{name:"Gujarati",nativeName:"\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"\u0647\u064E\u0648\u064F\u0633\u064E"},he:{name:"Hebrew",nativeName:"\u05E2\u05D1\u05E8\u05D9\u05EA"},hi:{name:"Hindi",nativeName:"\u0939\u093F\u0928\u094D\u0926\u0940"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Krey\xF2l ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"\u0540\u0561\u0575\u0565\u0580\u0565\u0576"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"As\u1EE5s\u1EE5 Igbo"},ii:{name:"Nuosu",nativeName:"\uA188\uA320\uA4BF Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"I\xF1upiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"\xCDslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"\u1403\u14C4\u1483\u144E\u1450\u1466"},ja:{name:"Japanese",nativeName:"\u65E5\u672C\u8A9E"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"G\u0129k\u0169y\u0169"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"\u049B\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"\u1781\u17C1\u1798\u179A\u1797\u17B6\u179F\u17B6"},kn:{name:"Kannada",nativeName:"\u0C95\u0CA8\u0CCD\u0CA8\u0CA1"},ko:{name:"Korean",nativeName:"\uD55C\uAD6D\uC5B4"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"\u0915\u0936\u094D\u092E\u0940\u0930\u0940"},ku:{name:"Kurdish",nativeName:"Kurd\xEE"},kv:{name:"Komi",nativeName:"\u043A\u043E\u043C\u0438 \u043A\u044B\u0432"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"\u041A\u044B\u0440\u0433\u044B\u0437\u0447\u0430"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"L\xEBtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Ling\xE1la"},lo:{name:"Lao",nativeName:"\u0E9E\u0EB2\u0EAA\u0EB2"},lt:{name:"Lithuanian",nativeName:"lietuvi\u0173 kalba"},lu:{name:"Luba-Katanga",nativeName:"Tshiluba"},lv:{name:"Latvian",nativeName:"latvie\u0161u valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M\u0327aje\u013C"},mi:{name:"M\u0101ori",nativeName:"te reo M\u0101ori"},mk:{name:"Macedonian",nativeName:"\u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438 \u0458\u0430\u0437\u0438\u043A"},ml:{name:"Malayalam",nativeName:"\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02"},mn:{name:"Mongolian",nativeName:"\u041C\u043E\u043D\u0433\u043E\u043B \u0445\u044D\u043B"},mr:{name:"Marathi",nativeName:"\u092E\u0930\u093E\u0920\u0940"},ms:{name:"Malay",nativeName:"Bahasa Malaysia"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"\u1017\u1019\u102C\u1005\u102C"},na:{name:"Nauru",nativeName:"Ekakair\u0169 Naoero"},nb:{name:"Norwegian Bokm\xE5l",nativeName:"Norsk bokm\xE5l"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"\u0928\u0947\u092A\u093E\u0932\u0940"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Din\xE9 bizaad"},ny:{name:"Chichewa",nativeName:"chiChe\u0175a"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"\u140A\u14C2\u1511\u14C8\u142F\u14A7\u140E\u14D0"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"\u0B13\u0B21\u0B3C\u0B3F\u0B06"},os:{name:"Ossetian",nativeName:"\u0438\u0440\u043E\u043D \xE6\u0432\u0437\u0430\u0433"},pa:{name:"Panjabi",nativeName:"\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40"},pi:{name:"P\u0101li",nativeName:"\u092A\u093E\u0934\u093F"},pl:{name:"Polish",nativeName:"j\u0119zyk polski"},ps:{name:"Pashto",nativeName:"\u067E\u069A\u062A\u0648"},pt:{name:"Portuguese",nativeName:"Portugu\xEAs"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Rom\xE2n\u0103"},ru:{name:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"\u0938\u093F\u0928\u094D\u0927\u0940"},se:{name:"Northern Sami",nativeName:"Davvis\xE1megiella"},sg:{name:"Sango",nativeName:"y\xE2ng\xE2 t\xEE s\xE4ng\xF6"},si:{name:"Sinhala",nativeName:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD"},sk:{name:"Slovak",nativeName:"sloven\u010Dina"},sl:{name:"Slovenian",nativeName:"slovenski jezik"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"\u0441\u0440\u043F\u0441\u043A\u0438 \u0458\u0435\u0437\u0438\u043A"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD"},te:{name:"Telugu",nativeName:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41"},tg:{name:"Tajik",nativeName:"\u0442\u043E\u04B7\u0438\u043A\u04E3"},th:{name:"Thai",nativeName:"\u0E44\u0E17\u0E22"},ti:{name:"Tigrinya",nativeName:"\u1275\u130D\u122D\u129B"},tk:{name:"Turkmen",nativeName:"T\xFCrkmen"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"T\xFCrk\xE7e"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"\u0442\u0430\u0442\u0430\u0440 \u0442\u0435\u043B\u0435"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"\u0626\u06C7\u064A\u063A\u06C7\u0631\u0686\u06D5\u200E"},uk:{name:"Ukrainian",nativeName:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"},ur:{name:"Urdu",nativeName:"\u0627\u0631\u062F\u0648"},uz:{name:"Uzbek",nativeName:"\u040E\u0437\u0431\u0435\u043A"},ve:{name:"Venda",nativeName:"Tshiven\u1E13a"},vi:{name:"Vietnamese",nativeName:"Ti\u1EBFng Vi\u1EC7t"},vo:{name:"Volap\xFCk",nativeName:"Volap\xFCk"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9"},yo:{name:"Yoruba",nativeName:"Yor\xF9b\xE1"},za:{name:"Zhuang",nativeName:"Sa\u026F cue\u014B\u0185"},zh:{name:"Chinese",nativeName:"\u4E2D\u6587"},zu:{name:"Zulu",nativeName:"isiZulu"}},Tr=Zs;var fr=class{static getLanguages(g=[]){return g.map(r=>({code:r,name:fr.getName(r),nativeName:fr.getNativeName(r)}))}static getName(g){return fr.validate(g)?Tr[g].name:""}static getAllNames(){return Object.values(Tr).map(g=>g.name)}static getNativeName(g){return fr.validate(g)?Tr[g].nativeName:""}static getAllNativeNames(){return Object.values(Tr).map(g=>g.nativeName)}static getCode(g){return Object.keys(Tr).find(t=>{let p=Tr[t];return p.name.toLowerCase()===g.toLowerCase()||p.nativeName.toLowerCase()===g.toLowerCase()})||""}static getAllCodes(){return Object.keys(Tr)}static validate(g){return Tr.hasOwnProperty(g)}};var Lr=Jt(require("obsidian")),Oa=Jt(Pa()),La=e=>{let{basename:g,parent:r}=e,t=r.children.filter(p=>{if(!(p instanceof Lr.TFile))return!1;let i=p.extension==="srt"||p.extension==="vtt",o=p.basename.startsWith(g);return i&&o});if(t.length>1&&(t=t.filter(p=>{let i=p.basename.slice(g.length);return i.startsWith(".")&&fr.validate(i.substring(1))})),t.length===0)return null;{let p=t.filter(i=>i.extension==="vtt").map(i=>i.basename);for(let i=t.length-1;i>=0;i--){let o=t[i];o.extension===".srt"&&p.includes(o.basename)&&t.splice(i,1)}return console.log("found subtitle(s): %o",t.map(i=>i.name)),t}},ro=(e,g)=>Bt(void 0,null,function*(){let r=yield g.read(e);return new Oa.default(new Blob([r])).getURL()}),no=(e,g)=>Bt(void 0,null,function*(){let r=new Blob([yield g.read(e)],{type:"text/vtt"});return URL.createObjectURL(r)}),Fa=(e,g)=>Bt(void 0,null,function*(){let r=new Map;for(let i of e){let o,n;if(typeof i=="string")if((n=g.getAbstractFileByPath(i))&&n instanceof Lr.TFile)o=n;else{console.warn("no subFile found for path: %s",i);continue}else o=i;o.extension==="srt"?r.set(o,yield ro(o,g)):r.set(o,yield no(o,g))}let t=[],p=[];for(let i of r.keys()){let o=i.basename.split(".").pop(),n=null,f=null;if(r.size>1){if(!o||!fr.validate(o))throw new Error("languageCode unable to parse, problem with getSubtitles()? ");n=fr.getNativeName(o),f=o}let h={kind:"captions",label:n!=null?n:"default",srcLang:f!=null?f:void 0,src:r.get(i)},m=createEl("track",{attr:{kind:"captions",label:n,srclang:f,src:r.get(i)}},u=>{navigator.language.substring(0,2)===o&&u.setAttr("default","")});p.push(m),t.push(h)}return{objUrls:[...r.values()],trackEls:p,tracks:t}}),yn=class extends Lr.MarkdownRenderChild{constructor(g,r,t){super(g);this.objectUrls=t!=null?t:[],this.player=r}unload(){this.objectUrls&&this.objectUrls.forEach(g=>URL.revokeObjectURL(g)),this.player.destroy()}};var $t;(function(t){t[t.youtube=0]="youtube",t[t.bili=1]="bili",t[t.vimeo=2]="vimeo"})($t||($t={}));var Xr=new Map([["audio",["mp3","wav","m4a","ogg","3gp","flac"]],["video",["mp4","ogv"]],["media",["webm"]]]),ao=e=>{let g=/\.[^/]+?$/,r,t;if(e instanceof URL)r=e.pathname,t=(0,En.parse)(e.search);else{let p=(0,xa.default)(e,!1);r=p.pathname,t=(0,En.parse)(p.query)}return g.test(r)?r:r==="/api"&&t.raw==="true"&&typeof t.path=="string"&&g.test(t.path)?t.path:null},_n=e=>{let g=null;if(e instanceof pr.TFile)g=e.extension;else{let t=ao(e);t&&(g=t.split(".").pop())}if(!g)return null;let r=null;for(let[t,p]of Xr)p.includes(g)&&(r=t);return r},nr=e=>Array.isArray(e.subtitles),Sr=e=>!nr(e)&&!ar(e),ar=e=>e.host!==void 0&&e.id!==void 0,vr=(...e)=>Bt(void 0,null,function*(){var p;let[g,r]=e;if(typeof g=="string")try{g=new URL(g)}catch(i){return null}let t=_n(g);if(t){if(g instanceof pr.TFile){r?r.startsWith("#")||(r="#"+r):r="";let o=La(g);return{type:t,filename:g.name,src:g.path,subtitles:o?o.map(n=>n.path):[],hash:r,updateTrackInfo:Tn,getSrcFile:Sn}}let i=(p=decodeURI(g.pathname).split("/").pop())!=null?p:"";return{type:t,filename:decodeURI(i),src:g,hash:g.hash}}else if(g instanceof pr.TFile)return null;switch(g.hostname){case"b23.tv":try{if(!pr.Platform.isDesktopApp)return null;let n=yield $n(g.pathname.split("/")[1]);g=new URL(n)}catch(n){return console.error(n),null}case"www.bilibili.com":if(g.pathname.startsWith("/video")){let n=g.pathname.replace("/video/",""),f;if(/^bv/i.test(n))f=`?bvid=${n}`;else if(/^av/i.test(n))n=n.substring(2),f=`?aid=${n}`;else return console.log(`invaild video id: ${n}`),null;let h=g.searchParams.get("p");return h&&(f+=`&page=${h}`),{host:1,id:n,src:g,iframe:new URL(`https://player.bilibili.com/player.html${f}&high_quality=1&danmaku=0`),hash:g.hash}}else return console.log("bilibili video url not supported or invalid"),null;break;case"youtube.com":case"www.youtube.com":case"youtu.be":if(g.pathname==="/watch"){let n=g.searchParams.get("v");return n?{host:0,id:n,iframe:new URL(`https://www.youtube.com/embed/${n}`),src:g,hash:g.hash}:(console.log(`invalid video id: ${g.toString()}`),null)}else if(g.host==="youtu.be")if(/^\/[^\/]+$/.test(g.pathname)){let n=g.pathname.substring(1);return{host:0,id:n,iframe:new URL(`https://www.youtube.com/embed/${n}`),src:g,hash:g.hash}}else return console.log(`invalid video id: ${g.toString()}`),null;else return console.log("youtube video url not supported or invalid"),null;break;case"vimeo.com":let i=g.pathname,o;if(o=i.match(/^\/(\d+)$/)){let n=o[1];return{host:2,id:n,iframe:new URL(`https://player.vimeo.com/video/${n}`),src:g,hash:g.hash}}else return console.log("vimeo video url not supported or invalid"),null;default:return null}}),Rr=(...e)=>{let[g,r]=e;if(nr(g)){if(!r)throw new Error("vault not provided");let{src:t,hash:p}=g,i=r.getAbstractFileByPath(t);if(i&&i instanceof pr.TFile){let o=r.getResourcePath(i);return new URL(o+p)}else throw new Error("no file found for path: "+t)}else{let{src:t}=g;return t.protocol==="file:"?new URL(t.href.replace(/^file:\/\/\//,"app://local/")):t}},jr=(e,g,r,t)=>Bt(void 0,null,function*(){if(g==="internal"){let p=e instanceof HTMLAnchorElement?e.dataset.href:e.getAttr("src");if(!p)return console.error("no linktext in internal embed: %o, escaping",e),null;let{subpath:i,path:o}=(0,pr.parseLinktext)(p),n=r.metadataCache.getFirstLinkpathDest(o,t.sourcePath);return n?vr(n,i):null}else{let p=e instanceof HTMLAnchorElement?e.href:e.getAttr("src");return p?vr(p):(console.info("fail to get embed src: %o, escaping",e),null)}});function Tn(e){return Bt(this,null,function*(){if(this.subtitles.length>0){let g=yield Fa(this.subtitles,e);return this.trackInfo=g,g}else return null})}function Sn(e){let g=e.getAbstractFileByPath(this.src);if(g&&g instanceof pr.TFile)return g;throw new Error("src file not found for path: "+this.src)}var ka=Jt(Pr());var io='Play',Ba=(e,g,r)=>Bt(void 0,null,function*(){let t=yield so(e),p=createDiv({cls:["placeholder","plyr plyr--full-ui plyr--video"]});return t&&(p.style.backgroundImage=`url("${t}")`),Or(p,g,16/9),p.createEl("button",{cls:"plyr__control plyr__control--overlaid",attr:{type:"button","data-plyr":"play","aria-label":"Play"}},i=>{i.innerHTML=io,i.onClickEvent(()=>Bt(void 0,null,function*(){return p.replaceWith(yield r())}))}),p}),so=e=>Bt(void 0,null,function*(){let{id:g}=e;switch(e.host){case $t.youtube:return`https://i.ytimg.com/vi/${g}/maxresdefault.jpg`;case $t.bili:return null;case $t.vimeo:return yield oo(e.src);default:(0,ka.default)(e.host)}}),oo=e=>Bt(void 0,null,function*(){let g=new URL("https://vimeo.com/api/oembed.json");return typeof e=="string"?g.searchParams.append("url",e):g.searchParams.append("url",e.href),fetch(g.href).then(r=>{if(r.ok)return r.json();throw new Error(r.statusText)}).then(r=>{var t;return(t=r.thumbnail_url)!=null?t:null}).catch(r=>(console.error(r),null))});(function(){function e(g,r,t){function p(n,f){if(!r[n]){if(!g[n]){var h=typeof require=="function"&&require;if(!f&&h)return h(n,!0);if(i)return i(n,!0);var m=new Error("Cannot find module '"+n+"'");throw m.code="MODULE_NOT_FOUND",m}var u=r[n]={exports:{}};g[n][0].call(u.exports,function(_){var C=g[n][1][_];return p(C||_)},u,u.exports,e,g,r,t)}return r[n].exports}for(var i=typeof require=="function"&&require,o=0;o>6),o.push(128|63&f)):f<65536?(o.push(224|f>>12),o.push(128|63&f>>6),o.push(128|63&f)):(o.push(240|f>>18),o.push(128|63&f>>12),o.push(128|63&f>>6),o.push(128|63&f))}return o},t.decode=function(i){for(var o=[],n=0;n>18)),C.push(i.charAt(63&R>>12)),C.push(i.charAt(63&R>>6)),C.push(i.charAt(63&R))}if(u.length-_==2){var R=(u[_]<<16)+(u[_+1]<<8);C.push(i.charAt(63&R>>18)),C.push(i.charAt(63&R>>12)),C.push(i.charAt(63&R>>6)),C.push("=")}else if(u.length-_==1){var R=u[_]<<16;C.push(i.charAt(63&R>>18)),C.push(i.charAt(63&R>>12)),C.push("==")}return C.join("")},n=function(){for(var m=[],u=0;u=W&&console.log(this.time+" ["+v+"] "+T)}},k=function(v){for(var T=[],W=0;Wn&&(C.log("ERROR","Too large cursor position "+this.pos),this.pos=n)},moveCursor:function(v){var T=this.pos+v;if(v>1)for(var W=this.pos+1;W=144&&this.backSpace();var T=i(v);if(this.pos>=n){C.log("ERROR","Cannot insert "+v.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},clearFromPos:function(v){var T;for(T=v;T0&&(v?W="["+T.join(" | ")+"]":W=T.join(` -`)),W},getTextAndFormat:function(){return this.rows}};var N=function(v,T){this.chNr=v,this.outputFilter=T,this.mode=null,this.verbose=0,this.displayedMemory=new H,this.nonDisplayedMemory=new H,this.lastOutputScreen=new H,this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};N.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[o-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(v){this.outputFilter=v},setPAC:function(v){this.writeScreen.setPAC(v)},setBkgData:function(v){this.writeScreen.setBkgData(v)},setMode:function(v){v!==this.mode&&(this.mode=v,C.log("INFO","MODE="+v),this.mode=="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=v)},insertChars:function(v){for(var T=0;T=46,T.italics)T.foreground="white";else{var W=Math.floor(v/2)-16,O=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=O[W]}C.log("INFO","MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},outputDataUpdate:function(){var v=C.time;v!==null&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(v,this.displayedMemory),this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=v:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,v,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:v),this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(v){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,v,this.displayedMemory),this.cueStartTime=v))}};var A=function(v,T,W){this.field=v||1,this.outputs=[T,W],this.channels=[new N(1,T),new N(2,W)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};A.prototype={getHandler:function(v){return this.channels[v].getHandler()},setHandler:function(v,T){this.channels[v].setHandler(T)},addData:function(v,T){var W,O,B,L=!1;this.lastTime=v,C.setTime(v);for(var K=0;K=16&&O<=31&&O===this.lastCmdA&&B===this.lastCmdB){this.lastCmdA=null,this.lastCmdB=null,C.log("DEBUG","Repeated command ("+k([O,B])+") is dropped");continue}if(O===0&&B===0){this.dataCounters.padding+=2;continue}else C.log("DATA","["+k([T[K],T[K+1]])+"] -> ("+k([O,B])+")");if(W=this.parseCmd(O,B),W||(W=this.parseMidrow(O,B)),W||(W=this.parsePAC(O,B)),W||(W=this.parseBackgroundAttributes(O,B)),!W&&(L=this.parseChars(O,B),L))if(this.currChNr&&this.currChNr>=0){var x=this.channels[this.currChNr-1];x.insertChars(L)}else C.log("WARNING","No channel found yet. TEXT-MODE?");W?this.dataCounters.cmd+=2:L?this.dataCounters.char+=2:(this.dataCounters.other+=2,C.log("WARNING","Couldn't parse cleaned data "+k([O,B])+" orig: "+k([T[K],T[K+1]])))}},parseCmd:function(v,T){var W=null,O=(v===20||v===21||v===28||v===29)&&32<=T&&T<=47,B=(v===23||v===31)&&33<=T&&T<=35;if(!(O||B))return!1;v===20||v===21||v===23?W=1:W=2;var L=this.channels[W-1];return v===20||v===21||v===28||v===29?T===32?L.cc_RCL():T===33?L.cc_BS():T===34?L.cc_AOF():T===35?L.cc_AON():T===36?L.cc_DER():T===37?L.cc_RU(2):T===38?L.cc_RU(3):T===39?L.cc_RU(4):T===40?L.cc_FON():T===41?L.cc_RDC():T===42?L.cc_TR():T===43?L.cc_RTD():T===44?L.cc_EDM():T===45?L.cc_CR():T===46?L.cc_ENM():T===47&&L.cc_EOC():L.cc_TO(T-32),this.lastCmdA=v,this.lastCmdB=T,this.currChNr=W,!0},parseMidrow:function(v,T){var W=null;if((v===17||v===25)&&32<=T&&T<=47){if(v===17?W=1:W=2,W!==this.currChNr)return C.log("ERROR","Mismatch channel in midrow parsing"),!1;var O=this.channels[W-1];return O.insertChars([32]),O.cc_MIDROW(T),C.log("DEBUG","MIDROW ("+k([v,T])+")"),this.lastCmdA=v,this.lastCmdB=T,!0}return!1},parsePAC:function(v,T){var W=null,O=null,B=(17<=v&&v<=23||25<=v&&v<=31)&&64<=T&&T<=127,L=(v===16||v===24)&&64<=T&&T<=95;if(!(B||L))return!1;W=v<=23?1:2,64<=T&&T<=95?O=W===1?f[v]:m[v]:O=W===1?h[v]:u[v];var K=this.interpretPAC(O,T),x=this.channels[W-1];return x.setPAC(K),this.lastCmdA=v,this.lastCmdB=T,this.currChNr=W,!0},interpretPAC:function(v,T){var W=T,O={color:null,italics:!1,indent:null,underline:!1,row:v};return T>95?W=T-96:W=T-64,O.underline=(W&1)==1,W<=13?O.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(W/2)]:W<=15?(O.italics=!0,O.color="white"):O.indent=Math.floor((W-16)/2)*4,O},parseChars:function(v,T){var W=null,O=null,B=null,L=null;if(v>=25?(W=2,B=v-8):(W=1,B=v),17<=B&&B<=19){var K=T;B===17?K=T+80:B===18?K=T+112:K=T+144,C.log("INFO","Special char '"+i(K)+"' in channel "+W),O=[K],this.lastCmdA=v,this.lastCmdB=T}else 32<=v&&v<=127&&(O=T===0?[v]:[v,T],this.lastCmdA=null,this.lastCmdB=null);if(O){var x=k(O);C.log("DEBUG","Char codes = "+x.join(","))}return O},parseBackgroundAttributes:function(v,T){var W,O,B,L,K=(v===16||v===24)&&32<=T&&T<=47,x=(v===23||v===31)&&45<=T&&T<=47;return K||x?(W={},v===16||v===24?(O=Math.floor((T-32)/2),W.background=_[O],T%2==1&&(W.background=W.background+"_semi")):T===45?W.background="transparent":(W.foreground="black",T===47&&(W.underline=!0)),B=v<24?1:2,L=this.channels[B-1],L.setBkgData(W),this.lastCmdA=v,this.lastCmdB=T,!0):!1},reset:function(){for(var v=0;v/g,">").replace(/"/g,""").replace(/'/g,"'"):x}function _(x){return x.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function C(x,U,Y,oe){for(var ue=0;ue0&&C(p.arrayAccessFormPaths,x,U,Y)&&(x[U]=[x[U]])}function R(x){var U=x.split(/[-T:+Z]/g),Y=new Date(U[0],U[1]-1,U[2]),oe=U[5].split(".");if(Y.setHours(U[3],U[4],oe[0]),oe.length>1&&Y.setMilliseconds(oe[1]),U[6]&&U[7]){var ue=U[6]*60+Number(U[7]),re=/\d\d-\d\d:\d\d$/.test(x)?"-":"+";ue=0+(re=="-"?-1*ue:ue),Y.setMinutes(Y.getMinutes()-ue-Y.getTimezoneOffset())}else x.indexOf("Z",x.length-1)!==-1&&(Y=new Date(Date.UTC(Y.getFullYear(),Y.getMonth(),Y.getDate(),Y.getHours(),Y.getMinutes(),Y.getSeconds(),Y.getMilliseconds())));return Y}function P(x,U,Y){if(p.datetimeAccessFormPaths.length>0){var oe=Y.split(".#")[0];return C(p.datetimeAccessFormPaths,x,U,oe)?R(x):x}else return x}function w(x,U,Y,oe){return U==n.ELEMENT_NODE&&p.xmlElementsFilter.length>0?C(p.xmlElementsFilter,x,Y,oe):!0}function H(x,U){if(x.nodeType==n.DOCUMENT_NODE){for(var Y=new Object,oe=x.childNodes,ue=0;ue1&&Y.__text!=null&&p.skipEmptyTextNodesForObj&&(p.stripWhitespaces&&Y.__text==""||Y.__text.trim()=="")&&delete Y.__text,delete Y.__cnt,p.enableToStringFunc&&(Y.__text!=null||Y.__cdata!=null)&&(Y.toString=function(){return(this.__text!=null?this.__text:"")+(this.__cdata!=null?this.__cdata:"")}),Y}else if(x.nodeType==n.TEXT_NODE||x.nodeType==n.CDATA_SECTION_NODE)return x.nodeValue}function N(x,U,Y,oe){var ue="<"+(x!=null&&x.__prefix!=null?x.__prefix+":":"")+U;if(Y!=null)for(var re=0;re"}function M(x,U){return x.indexOf(U,x.length-U.length)!==-1}function I(x,U){return!!(p.arrayAccessForm=="property"&&M(U.toString(),"_asArray")||U.toString().indexOf(p.attributePrefix)==0||U.toString().indexOf("__")==0||x[U]instanceof Function)}function D(x){var U=0;if(x instanceof Object)for(var Y in x)I(x,Y)||U++;return U}function v(x,U,Y){return p.jsonPropertiesFilter.length==0||Y==""||C(p.jsonPropertiesFilter,x,U,Y)}function T(x){var U=[];if(x instanceof Object)for(var Y in x)Y.toString().indexOf("__")==-1&&Y.toString().indexOf(p.attributePrefix)==0&&U.push(Y);return U}function W(x){var U="";return x.__cdata!=null&&(U+=""),x.__text!=null&&(p.escapeMode?U+=u(x.__text):U+=x.__text),U}function O(x){var U="";return x instanceof Object?U+=W(x):x!=null&&(p.escapeMode?U+=u(x):U+=x),U}function B(x,U){return x===""?U:x+"."+U}function L(x,U,Y,oe){var ue="";if(x.length==0)ue+=N(x,U,Y,!0);else for(var re=0;re0){for(var ue in x)if(!(I(x,ue)||U!=""&&!v(x,ue,B(U,ue)))){var re=x[ue],ve=T(re);if(re==null||re==null)Y+=N(re,ue,ve,!0);else if(re instanceof Object)if(re instanceof Array)Y+=L(re,ue,ve,U);else if(re instanceof Date)Y+=N(re,ue,ve,!1),Y+=re.toISOString(),Y+=A(re,ue);else{var ce=D(re);ce>0||re.__text!=null||re.__cdata!=null?(Y+=N(re,ue,ve,!1),Y+=K(re,B(U,ue)),Y+=A(re,ue)):Y+=N(re,ue,ve,!0)}else Y+=N(re,ue,ve,!1),Y+=O(re),Y+=A(re,ue)}}return Y+=O(x),Y}this.parseXmlString=function(x){var U=window.ActiveXObject||"ActiveXObject"in window;if(x===void 0)return null;var Y;if(window.DOMParser){var oe=new window.DOMParser,ue=null;try{Y=oe.parseFromString(x,"text/xml"),Y.getElementsByTagNameNS("*","parsererror").length>0&&(Y=null)}catch(re){Y=null}}else x.indexOf("")+2)),Y=new ActiveXObject("Microsoft.XMLDOM"),Y.async="false",Y.loadXML(x);return Y},this.asArray=function(x){return x===void 0||x==null?[]:x instanceof Array?x:[x]},this.toXmlDateTime=function(x){return x instanceof Date?x.toISOString():typeof x=="number"?new Date(x).toISOString():null},this.asDateTime=function(x){return typeof x=="string"?R(x):x},this.xml2json=function(x){return H(x)},this.xml_str2json=function(x){var U=this.parseXmlString(x);return U!=null?this.xml2json(U):null},this.json2xml_str=function(x){return K(x,"")},this.json2xml=function(x){var U=this.json2xml_str(x);return this.parseXmlString(U)},this.getVersion=function(){return i}}r.default=t,g.exports=r.default},{}],4:[function(e,g,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function t(k){return k&&k.__esModule?k:{default:k}}var p=e(5),i=e(220),o=e(129),n=t(o),f=e(166),h=t(f),m=e(105),u=t(m),_=e(45),C=t(_);dashjs.Protection=h.default,dashjs.MetricsReporting=n.default,dashjs.MediaPlayerFactory=u.default,dashjs.Debug=C.default,dashjs.supportsMediaSource=i.supportsMediaSource,r.default=dashjs,r.MediaPlayer=p.MediaPlayer,r.Protection=h.default,r.MetricsReporting=n.default,r.MediaPlayerFactory=u.default,r.Debug=C.default,r.supportsMediaSource=i.supportsMediaSource},{"105":105,"129":129,"166":166,"220":220,"45":45,"5":5}],5:[function(e,g,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function p(k){return k&&k.__esModule?k:{default:k}}var i=e(103),o=p(i),n=e(47),f=p(n),h=e(45),m=p(h),u=e(50),_=typeof window!="undefined"&&window||t,C=_.dashjs;C||(C=_.dashjs={}),C.MediaPlayer=o.default,C.FactoryMaker=f.default,C.Debug=m.default,C.Version=(0,u.getVersionString)(),r.default=C,r.MediaPlayer=o.default,r.FactoryMaker=f.default,r.Debug=m.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"103":103,"45":45,"47":47,"50":50}],6:[function(e,g,r){"use strict";r.byteLength=m,r.toByteArray=_,r.fromByteArray=R;for(var t=[],p=[],i=typeof Uint8Array!="undefined"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,f=o.length;n0)throw new Error("Invalid string. Length must be a multiple of 4");var H=P.indexOf("=");H===-1&&(H=w);var N=H===w?0:4-H%4;return[H,N]}function m(P){var w=h(P),H=w[0],N=w[1];return(H+N)*3/4-N}function u(P,w,H){return(w+H)*3/4-H}function _(P){for(var w,H=h(P),N=H[0],A=H[1],M=new i(u(P,N,A)),I=0,D=A>0?N-4:N,v=0;v>16&255,M[I++]=w>>8&255,M[I++]=w&255;return A===2&&(w=p[P.charCodeAt(v)]<<2|p[P.charCodeAt(v+1)]>>4,M[I++]=w&255),A===1&&(w=p[P.charCodeAt(v)]<<10|p[P.charCodeAt(v+1)]<<4|p[P.charCodeAt(v+2)]>>2,M[I++]=w>>8&255,M[I++]=w&255),M}function C(P){return t[P>>18&63]+t[P>>12&63]+t[P>>6&63]+t[P&63]}function k(P,w,H){for(var N,A=[],M=w;MD?D:I+M));return N===1?(w=P[H-1],A.push(t[w>>2]+t[w<<4&63]+"==")):N===2&&(w=(P[H-2]<<8)+P[H-1],A.push(t[w>>10]+t[w>>4&63]+t[w<<2&63]+"=")),A.join("")}},{}],7:[function(e,g,r){},{}],8:[function(e,g,r){"use strict";var t=e(6),p=e(13);r.Buffer=f,r.SlowBuffer=H,r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,f.TYPED_ARRAY_SUPPORT=o(),!f.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var l=new Uint8Array(1);return l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},l.foo()===42}catch(d){return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(!!f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(!!f.isBuffer(this))return this.byteOffset}});function n(l){if(l>i)throw new RangeError('The value "'+l+'" is invalid for option "size"');var d=new Uint8Array(l);return d.__proto__=f.prototype,d}function f(l,d,y){if(typeof l=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(l)}return h(l,d,y)}typeof Symbol!="undefined"&&Symbol.species!=null&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),f.poolSize=8192;function h(l,d,y){if(typeof l=="string")return C(l,d);if(ArrayBuffer.isView(l))return k(l);if(l==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(E(l,ArrayBuffer)||l&&E(l.buffer,ArrayBuffer))return R(l,d,y);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var V=l.valueOf&&l.valueOf();if(V!=null&&V!==l)return f.from(V,d,y);var te=P(l);if(te)return te;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return f.from(l[Symbol.toPrimitive]("string"),d,y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}f.from=function(l,d,y){return h(l,d,y)},f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array;function m(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function u(l,d,y){return m(l),l<=0?n(l):d!==void 0?typeof y=="string"?n(l).fill(d,y):n(l).fill(d):n(l)}f.alloc=function(l,d,y){return u(l,d,y)};function _(l){return m(l),n(l<0?0:w(l)|0)}f.allocUnsafe=function(l){return _(l)},f.allocUnsafeSlow=function(l){return _(l)};function C(l,d){if((typeof d!="string"||d==="")&&(d="utf8"),!f.isEncoding(d))throw new TypeError("Unknown encoding: "+d);var y=N(l,d)|0,V=n(y),te=V.write(l,d);return te!==y&&(V=V.slice(0,te)),V}function k(l){for(var d=l.length<0?0:w(l.length)|0,y=n(d),V=0;V=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return l|0}function H(l){return+l!=l&&(l=0),f.alloc(+l)}f.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==f.prototype},f.compare=function(d,y){if(E(d,Uint8Array)&&(d=f.from(d,d.offset,d.byteLength)),E(y,Uint8Array)&&(y=f.from(y,y.offset,y.byteLength)),!f.isBuffer(d)||!f.isBuffer(y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===y)return 0;for(var V=d.length,te=y.length,$=0,ae=Math.min(V,te);$2&&arguments[2]===!0;if(!V&&y===0)return 0;for(var te=!1;;)switch(d){case"ascii":case"latin1":case"binary":return y;case"utf8":case"utf-8":return X(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y*2;case"hex":return y>>>1;case"base64":return G(l).length;default:if(te)return V?-1:X(l).length;d=(""+d).toLowerCase(),te=!0}}f.byteLength=N;function A(l,d,y){var V=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((y===void 0||y>this.length)&&(y=this.length),y<=0)||(y>>>=0,d>>>=0,y<=d))return"";for(l||(l="utf8");;)switch(l){case"hex":return re(this,d,y);case"utf8":case"utf-8":return x(this,d,y);case"ascii":return oe(this,d,y);case"latin1":case"binary":return ue(this,d,y);case"base64":return K(this,d,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ve(this,d,y);default:if(V)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),V=!0}}f.prototype._isBuffer=!0;function M(l,d,y){var V=l[d];l[d]=l[y],l[y]=V}f.prototype.swap16=function(){var d=this.length;if(d%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var y=0;yy&&(d+=" ... "),""},f.prototype.compare=function(d,y,V,te,$){if(E(d,Uint8Array)&&(d=f.from(d,d.offset,d.byteLength)),!f.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(y===void 0&&(y=0),V===void 0&&(V=d?d.length:0),te===void 0&&(te=0),$===void 0&&($=this.length),y<0||V>d.length||te<0||$>this.length)throw new RangeError("out of range index");if(te>=$&&y>=V)return 0;if(te>=$)return-1;if(y>=V)return 1;if(y>>>=0,V>>>=0,te>>>=0,$>>>=0,this===d)return 0;for(var ae=$-te,ne=V-y,Se=Math.min(ae,ne),Ie=this.slice(te,$),he=d.slice(y,V),ye=0;ye2147483647?y=2147483647:y<-2147483648&&(y=-2147483648),y=+y,b(y)&&(y=te?0:l.length-1),y<0&&(y=l.length+y),y>=l.length){if(te)return-1;y=l.length-1}else if(y<0)if(te)y=0;else return-1;if(typeof d=="string"&&(d=f.from(d,V)),f.isBuffer(d))return d.length===0?-1:D(l,d,y,V,te);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(l,d,y):Uint8Array.prototype.lastIndexOf.call(l,d,y):D(l,[d],y,V,te);throw new TypeError("val must be string, number or Buffer")}function D(l,d,y,V,te){var $=1,ae=l.length,ne=d.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(l.length<2||d.length<2)return-1;$=2,ae/=2,ne/=2,y/=2}function Se(pe,De){return $===1?pe[De]:pe.readUInt16BE(De*$)}var Ie;if(te){var he=-1;for(Ie=y;Ieae&&(y=ae-ne),Ie=y;Ie>=0;Ie--){for(var ye=!0,_e=0;_ete&&(V=te)):V=te;var $=d.length;V>$/2&&(V=$/2);for(var ae=0;ae>>0,isFinite(V)?(V=V>>>0,te===void 0&&(te="utf8")):(te=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var $=this.length-y;if((V===void 0||V>$)&&(V=$),d.length>0&&(V<0||y<0)||y>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");for(var ae=!1;;)switch(te){case"hex":return v(this,d,y,V);case"utf8":case"utf-8":return T(this,d,y,V);case"ascii":return W(this,d,y,V);case"latin1":case"binary":return O(this,d,y,V);case"base64":return B(this,d,y,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,d,y,V);default:if(ae)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),ae=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function K(l,d,y){return d===0&&y===l.length?t.fromByteArray(l):t.fromByteArray(l.slice(d,y))}function x(l,d,y){y=Math.min(l.length,y);for(var V=[],te=d;te239?4:$>223?3:$>191?2:1;if(te+ne<=y){var Se,Ie,he,ye;switch(ne){case 1:$<128&&(ae=$);break;case 2:Se=l[te+1],(Se&192)==128&&(ye=($&31)<<6|Se&63,ye>127&&(ae=ye));break;case 3:Se=l[te+1],Ie=l[te+2],(Se&192)==128&&(Ie&192)==128&&(ye=($&15)<<12|(Se&63)<<6|Ie&63,ye>2047&&(ye<55296||ye>57343)&&(ae=ye));break;case 4:Se=l[te+1],Ie=l[te+2],he=l[te+3],(Se&192)==128&&(Ie&192)==128&&(he&192)==128&&(ye=($&15)<<18|(Se&63)<<12|(Ie&63)<<6|he&63,ye>65535&&ye<1114112&&(ae=ye))}}ae===null?(ae=65533,ne=1):ae>65535&&(ae-=65536,V.push(ae>>>10&1023|55296),ae=56320|ae&1023),V.push(ae),te+=ne}return Y(V)}var U=4096;function Y(l){var d=l.length;if(d<=U)return String.fromCharCode.apply(String,l);for(var y="",V=0;VV)&&(y=V);for(var te="",$=d;$V&&(d=V),y<0?(y+=V,y<0&&(y=0)):y>V&&(y=V),yy)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function(d,y,V){d=d>>>0,y=y>>>0,V||ce(d,y,this.length);for(var te=this[d],$=1,ae=0;++ae>>0,y=y>>>0,V||ce(d,y,this.length);for(var te=this[d+--y],$=1;y>0&&($*=256);)te+=this[d+--y]*$;return te},f.prototype.readUInt8=function(d,y){return d=d>>>0,y||ce(d,1,this.length),this[d]},f.prototype.readUInt16LE=function(d,y){return d=d>>>0,y||ce(d,2,this.length),this[d]|this[d+1]<<8},f.prototype.readUInt16BE=function(d,y){return d=d>>>0,y||ce(d,2,this.length),this[d]<<8|this[d+1]},f.prototype.readUInt32LE=function(d,y){return d=d>>>0,y||ce(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},f.prototype.readUInt32BE=function(d,y){return d=d>>>0,y||ce(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},f.prototype.readIntLE=function(d,y,V){d=d>>>0,y=y>>>0,V||ce(d,y,this.length);for(var te=this[d],$=1,ae=0;++ae=$&&(te-=Math.pow(2,8*y)),te},f.prototype.readIntBE=function(d,y,V){d=d>>>0,y=y>>>0,V||ce(d,y,this.length);for(var te=y,$=1,ae=this[d+--te];te>0&&($*=256);)ae+=this[d+--te]*$;return $*=128,ae>=$&&(ae-=Math.pow(2,8*y)),ae},f.prototype.readInt8=function(d,y){return d=d>>>0,y||ce(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},f.prototype.readInt16LE=function(d,y){d=d>>>0,y||ce(d,2,this.length);var V=this[d]|this[d+1]<<8;return V&32768?V|4294901760:V},f.prototype.readInt16BE=function(d,y){d=d>>>0,y||ce(d,2,this.length);var V=this[d+1]|this[d]<<8;return V&32768?V|4294901760:V},f.prototype.readInt32LE=function(d,y){return d=d>>>0,y||ce(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},f.prototype.readInt32BE=function(d,y){return d=d>>>0,y||ce(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},f.prototype.readFloatLE=function(d,y){return d=d>>>0,y||ce(d,4,this.length),p.read(this,d,!0,23,4)},f.prototype.readFloatBE=function(d,y){return d=d>>>0,y||ce(d,4,this.length),p.read(this,d,!1,23,4)},f.prototype.readDoubleLE=function(d,y){return d=d>>>0,y||ce(d,8,this.length),p.read(this,d,!0,52,8)},f.prototype.readDoubleBE=function(d,y){return d=d>>>0,y||ce(d,8,this.length),p.read(this,d,!1,52,8)};function se(l,d,y,V,te,$){if(!f.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>te||d<$)throw new RangeError('"value" argument is out of bounds');if(y+V>l.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function(d,y,V,te){if(d=+d,y=y>>>0,V=V>>>0,!te){var $=Math.pow(2,8*V)-1;se(this,d,y,V,$,0)}var ae=1,ne=0;for(this[y]=d&255;++ne>>0,V=V>>>0,!te){var $=Math.pow(2,8*V)-1;se(this,d,y,V,$,0)}var ae=V-1,ne=1;for(this[y+ae]=d&255;--ae>=0&&(ne*=256);)this[y+ae]=d/ne&255;return y+V},f.prototype.writeUInt8=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,1,255,0),this[y]=d&255,y+1},f.prototype.writeUInt16LE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,2,65535,0),this[y]=d&255,this[y+1]=d>>>8,y+2},f.prototype.writeUInt16BE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,2,65535,0),this[y]=d>>>8,this[y+1]=d&255,y+2},f.prototype.writeUInt32LE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,4,4294967295,0),this[y+3]=d>>>24,this[y+2]=d>>>16,this[y+1]=d>>>8,this[y]=d&255,y+4},f.prototype.writeUInt32BE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,4,4294967295,0),this[y]=d>>>24,this[y+1]=d>>>16,this[y+2]=d>>>8,this[y+3]=d&255,y+4},f.prototype.writeIntLE=function(d,y,V,te){if(d=+d,y=y>>>0,!te){var $=Math.pow(2,8*V-1);se(this,d,y,V,$-1,-$)}var ae=0,ne=1,Se=0;for(this[y]=d&255;++ae>0)-Se&255;return y+V},f.prototype.writeIntBE=function(d,y,V,te){if(d=+d,y=y>>>0,!te){var $=Math.pow(2,8*V-1);se(this,d,y,V,$-1,-$)}var ae=V-1,ne=1,Se=0;for(this[y+ae]=d&255;--ae>=0&&(ne*=256);)d<0&&Se===0&&this[y+ae+1]!==0&&(Se=1),this[y+ae]=(d/ne>>0)-Se&255;return y+V},f.prototype.writeInt8=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,1,127,-128),d<0&&(d=255+d+1),this[y]=d&255,y+1},f.prototype.writeInt16LE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,2,32767,-32768),this[y]=d&255,this[y+1]=d>>>8,y+2},f.prototype.writeInt16BE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,2,32767,-32768),this[y]=d>>>8,this[y+1]=d&255,y+2},f.prototype.writeInt32LE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,4,2147483647,-2147483648),this[y]=d&255,this[y+1]=d>>>8,this[y+2]=d>>>16,this[y+3]=d>>>24,y+4},f.prototype.writeInt32BE=function(d,y,V){return d=+d,y=y>>>0,V||se(this,d,y,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[y]=d>>>24,this[y+1]=d>>>16,this[y+2]=d>>>8,this[y+3]=d&255,y+4};function J(l,d,y,V,te,$){if(y+V>l.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("Index out of range")}function ee(l,d,y,V,te){return d=+d,y=y>>>0,te||J(l,d,y,4,34028234663852886e22,-34028234663852886e22),p.write(l,d,y,V,23,4),y+4}f.prototype.writeFloatLE=function(d,y,V){return ee(this,d,y,!0,V)},f.prototype.writeFloatBE=function(d,y,V){return ee(this,d,y,!1,V)};function ie(l,d,y,V,te){return d=+d,y=y>>>0,te||J(l,d,y,8,17976931348623157e292,-17976931348623157e292),p.write(l,d,y,V,52,8),y+8}f.prototype.writeDoubleLE=function(d,y,V){return ie(this,d,y,!0,V)},f.prototype.writeDoubleBE=function(d,y,V){return ie(this,d,y,!1,V)},f.prototype.copy=function(d,y,V,te){if(!f.isBuffer(d))throw new TypeError("argument should be a Buffer");if(V||(V=0),!te&&te!==0&&(te=this.length),y>=d.length&&(y=d.length),y||(y=0),te>0&&te=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),d.length-y=0;--ae)d[ae+y]=this[ae+V];else Uint8Array.prototype.set.call(d,this.subarray(V,te),y);return $},f.prototype.fill=function(d,y,V,te){if(typeof d=="string"){if(typeof y=="string"?(te=y,y=0,V=this.length):typeof V=="string"&&(te=V,V=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!f.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(d.length===1){var $=d.charCodeAt(0);(te==="utf8"&&$<128||te==="latin1")&&(d=$)}}else typeof d=="number"&&(d=d&255);if(y<0||this.length>>0,V=V===void 0?this.length:V>>>0,d||(d=0);var ae;if(typeof d=="number")for(ae=y;ae55295&&y<57344){if(!te){if(y>56319){(d-=3)>-1&&$.push(239,191,189);continue}else if(ae+1===V){(d-=3)>-1&&$.push(239,191,189);continue}te=y;continue}if(y<56320){(d-=3)>-1&&$.push(239,191,189),te=y;continue}y=(te-55296<<10|y-56320)+65536}else te&&(d-=3)>-1&&$.push(239,191,189);if(te=null,y<128){if((d-=1)<0)break;$.push(y)}else if(y<2048){if((d-=2)<0)break;$.push(y>>6|192,y&63|128)}else if(y<65536){if((d-=3)<0)break;$.push(y>>12|224,y>>6&63|128,y&63|128)}else if(y<1114112){if((d-=4)<0)break;$.push(y>>18|240,y>>12&63|128,y>>6&63|128,y&63|128)}else throw new Error("Invalid code point")}return $}function j(l){for(var d=[],y=0;y>8,te=y%256,$.push(te),$.push(V);return $}function G(l){return t.toByteArray(de(l))}function c(l,d,y,V){for(var te=0;te=d.length||te>=l.length);++te)d[te+y]=l[te];return te}function E(l,d){return l instanceof d||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===d.name}function b(l){return l!==l}},{"13":13,"6":6}],9:[function(e,g,r){var t={};t.parseBuffer=function(o){return new p(o).parse()},t.addBoxProcessor=function(o,n){typeof o!="string"||typeof n!="function"||(i.prototype._boxProcessors[o]=n)},t.createFile=function(){return new p},t.createBox=function(o,n,f){var h=i.create(o);return n&&n.append(h,f),h},t.createFullBox=function(o,n,f){var h=t.createBox(o,n,f);return h.version=0,h.flags=0,h},t.Utils={},t.Utils.dataViewToString=function(o,n){var f=n||"utf-8";if(typeof TextDecoder!="undefined")return new TextDecoder(f).decode(o);var h=[],m=0;if(f==="utf-8")for(;m>6),n.push(128|63&h)):h<65536?(n.push(224|h>>12),n.push(128|63&h>>6),n.push(128|63&h)):(n.push(240|h>>18),n.push(128|63&h>>12),n.push(128|63&h>>6),n.push(128|63&h))}return n},t.Utils.appendBox=function(o,n,f){if(n._offset=o._cursor.offset,n._root=o._root?o._root:o,n._raw=o._raw,n._parent=o,f!==-1){if(f==null){o.boxes.push(n);return}var h=-1,m;if(typeof f=="number")h=f;else{if(typeof f=="string")m=f;else if(typeof f=="object"&&f.type)m=f.type;else{o.boxes.push(n);return}for(var u=0;u>3,n},i.prototype._readUint=function(o){var n=null,f=this._cursor.offset-this._raw.byteOffset,h,m;switch(o){case 8:n=this._raw.getUint8(f);break;case 16:n=this._raw.getUint16(f);break;case 24:h=this._raw.getUint16(f),m=this._raw.getUint8(f+2),n=(h<<8)+m;break;case 32:n=this._raw.getUint32(f);break;case 64:h=this._raw.getUint32(f),m=this._raw.getUint32(f+4),n=h*Math.pow(2,32)+m;break}return this._cursor.offset+=o>>3,n},i.prototype._readString=function(o){for(var n="",f=0;f0?o:this._raw.byteLength-(this._cursor.offset-this._offset);if(n>0){var f=new Uint8Array(this._raw.buffer,this._cursor.offset,n);return this._cursor.offset+=n,f}else return null},i.prototype._readUTF8String=function(){var o=this._raw.byteLength-(this._cursor.offset-this._offset),n=null;return o>0&&(n=new DataView(this._raw.buffer,this._cursor.offset,o),this._cursor.offset+=o),n&&t.Utils.dataViewToString(n)},i.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength){this._root._incomplete=!0;return}switch(this._procField("size","uint",32),this._procField("type","string",4),this.size===1&&this._procField("largesize","uint",64),this.type==="uuid"&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),this._boxContainers.indexOf(this.type)!==-1?this._parseContainerBox():this._data=this._readData())},i.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},i.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=o>>3},i.prototype._writeUint=function(o,n){if(this._rawo){var f=this._cursor.offset-this._rawo.byteOffset,h,m;switch(o){case 8:this._rawo.setUint8(f,n);break;case 16:this._rawo.setUint16(f,n);break;case 24:h=(n&16776960)>>8,m=n&255,this._rawo.setUint16(f,h),this._rawo.setUint8(f+2,m);break;case 32:this._rawo.setUint32(f,n);break;case 64:h=Math.floor(n/Math.pow(2,32)),m=n-h*Math.pow(2,32),this._rawo.setUint32(f,h),this._rawo.setUint32(f+4,m);break}this._cursor.offset+=o>>3}else this.size+=o>>3},i.prototype._writeString=function(o,n){for(var f=0;f>10&31)+96,(this.language>>5&31)+96,(this.language&31)+96)),this._procField("pre_defined","uint",16)},i.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",this.version==1?64:32)},i.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},i.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},i.prototype._boxProcessors.mp4a=i.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},i.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",this.version==1?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},i.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},i.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},i.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),this.flags&1&&this._procField("scheme_uri","string",-1)},i.prototype._boxProcessors.sdtp=function(){this._procFullBox();var o=-1;this._parsing&&(o=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",o,"uint",8)},i.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",this.version==1?64:32),this._procField("first_offset","uint",this.version==1?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,function(o){this._parsing||(o.reference=(o.reference_type&1)<<31,o.reference|=o.referenced_size&2147483647,o.sap=(o.starts_with_SAP&1)<<31,o.sap|=(o.SAP_type&3)<<28,o.sap|=o.SAP_delta_time&268435455),this._procEntryField(o,"reference","uint",32),this._procEntryField(o,"subsegment_duration","uint",32),this._procEntryField(o,"sap","uint",32),this._parsing&&(o.reference_type=o.reference>>31&1,o.referenced_size=o.reference&2147483647,o.starts_with_SAP=o.sap>>31&1,o.SAP_type=o.sap>>28&7,o.SAP_delta_time=o.sap&268435455)})},i.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},i.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,function(o){this._procEntryField(o,"ranges_count","uint",32),this._procSubEntries(o,"ranges",o.ranges_count,function(n){this._procEntryField(n,"level","uint",8),this._procEntryField(n,"range_size","uint",24)})})},i.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},i.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,function(o){this._procEntryField(o,"sample_delta","uint",32),this._procEntryField(o,"subsample_count","uint",16),this._procSubEntries(o,"subsamples",o.subsample_count,function(n){this._procEntryField(n,"subsample_size","uint",this.version===1?32:16),this._procEntryField(n,"subsample_priority","uint",8),this._procEntryField(n,"discardable","uint",8),this._procEntryField(n,"codec_specific_parameters","uint",32)})})},i.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},i.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",this.version==1?64:32)},i.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),this.flags&1&&this._procField("base_data_offset","uint",64),this.flags&2&&this._procField("sample_description_offset","uint",32),this.flags&8&&this._procField("default_sample_duration","uint",32),this.flags&16&&this._procField("default_sample_size","uint",32),this.flags&32&&this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(this.length_size_of_traf_num&48)<<4,this.reserved|=(this.length_size_of_trun_num&12)<<2,this.reserved|=this.length_size_of_sample_num&3),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(this.reserved&48)>>4,this.length_size_of_trun_num=(this.reserved&12)>>2,this.length_size_of_sample_num=this.reserved&3),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,function(o){this._procEntryField(o,"time","uint",this.version===1?64:32),this._procEntryField(o,"moof_offset","uint",this.version===1?64:32),this._procEntryField(o,"traf_number","uint",(this.length_size_of_traf_num+1)*8),this._procEntryField(o,"trun_number","uint",(this.length_size_of_trun_num+1)*8),this._procEntryField(o,"sample_number","uint",(this.length_size_of_sample_num+1)*8)})},i.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",this.version==1?64:32),this._procField("modification_time","uint",this.version==1?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",this.version==1?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},i.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},i.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),this.flags&1&&this._procField("data_offset","int",32),this.flags&4&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,function(o){this.flags&256&&this._procEntryField(o,"sample_duration","uint",32),this.flags&512&&this._procEntryField(o,"sample_size","uint",32),this.flags&1024&&this._procEntryField(o,"sample_flags","uint",32),this.flags&2048&&this._procEntryField(o,"sample_composition_time_offset",this.version===1?"int":"uint",32)})},i.prototype._boxProcessors["url "]=i.prototype._boxProcessors["urn "]=function(){this._procFullBox(),this.type==="urn "&&this._procField("name","string",-1),this._procField("location","string",-1)},i.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},i.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},i.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},i.prototype._boxProcessors.vtte=function(){}},{}],10:[function(e,g,r){(function(t){function p(N){return Array.isArray?Array.isArray(N):H(N)==="[object Array]"}r.isArray=p;function i(N){return typeof N=="boolean"}r.isBoolean=i;function o(N){return N===null}r.isNull=o;function n(N){return N==null}r.isNullOrUndefined=n;function f(N){return typeof N=="number"}r.isNumber=f;function h(N){return typeof N=="string"}r.isString=h;function m(N){return typeof N=="symbol"}r.isSymbol=m;function u(N){return N===void 0}r.isUndefined=u;function _(N){return H(N)==="[object RegExp]"}r.isRegExp=_;function C(N){return typeof N=="object"&&N!==null}r.isObject=C;function k(N){return H(N)==="[object Date]"}r.isDate=k;function R(N){return H(N)==="[object Error]"||N instanceof Error}r.isError=R;function P(N){return typeof N=="function"}r.isFunction=P;function w(N){return N===null||typeof N=="boolean"||typeof N=="number"||typeof N=="string"||typeof N=="symbol"||typeof N=="undefined"}r.isPrimitive=w,r.isBuffer=t.isBuffer;function H(N){return Object.prototype.toString.call(N)}}).call(this,{isBuffer:e(22)})},{"22":22}],11:[function(e,g,r){var t=Object.create||v,p=Object.keys||T,i=Function.prototype.bind||W;function o(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=t(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var n=10,f;try{var h={};Object.defineProperty&&Object.defineProperty(h,"x",{value:0}),f=h.x===0}catch(O){f=!1}f?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(O){if(typeof O!="number"||O<0||O!==O)throw new TypeError('"defaultMaxListeners" must be a positive number');n=O}}):o.defaultMaxListeners=n,o.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||isNaN(B))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=B,this};function m(O){return O._maxListeners===void 0?o.defaultMaxListeners:O._maxListeners}o.prototype.getMaxListeners=function(){return m(this)};function u(O,B,L){if(B)O.call(L);else for(var K=O.length,x=I(O,K),U=0;U1&&(L=arguments[1]),L instanceof Error)throw L;var re=new Error('Unhandled "error" event. ('+L+")");throw re.context=L,re;return!1}if(K=oe[B],!K)return!1;var ve=typeof K=="function";switch(x=arguments.length,x){case 1:u(K,ve,this);break;case 2:_(K,ve,this,arguments[1]);break;case 3:C(K,ve,this,arguments[1],arguments[2]);break;case 4:k(K,ve,this,arguments[1],arguments[2],arguments[3]);break;default:for(U=new Array(x-1),Y=1;Y0&&Y.length>x)){Y.warned=!0;var oe=new Error("Possible EventEmitter memory leak detected. "+Y.length+' "'+String(B)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');oe.name="MaxListenersExceededWarning",oe.emitter=O,oe.type=B,oe.count=Y.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",oe.name,oe.message)}return O}o.prototype.addListener=function(B,L){return P(this,B,L,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(B,L){return P(this,B,L,!0)};function w(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var O=new Array(arguments.length),B=0;B=0;Y--)if(K[Y]===L||K[Y].listener===L){oe=K[Y].listener,U=Y;break}if(U<0)return this;U===0?K.shift():M(K,U),K.length===1&&(x[B]=K[0]),x.removeListener&&this.emit("removeListener",B,oe||L)}return this},o.prototype.removeAllListeners=function(B){var L,K,x;if(K=this._events,!K)return this;if(!K.removeListener)return arguments.length===0?(this._events=t(null),this._eventsCount=0):K[B]&&(--this._eventsCount==0?this._events=t(null):delete K[B]),this;if(arguments.length===0){var U=p(K),Y;for(x=0;x=0;x--)this.removeListener(B,L[x]);return this};function N(O,B,L){var K=O._events;if(!K)return[];var x=K[B];return x?typeof x=="function"?L?[x.listener||x]:[x]:L?D(x):I(x,x.length):[]}o.prototype.listeners=function(B){return N(this,B,!0)},o.prototype.rawListeners=function(B){return N(this,B,!1)},o.listenerCount=function(O,B){return typeof O.listenerCount=="function"?O.listenerCount(B):A.call(O,B)},o.prototype.listenerCount=A;function A(O){var B=this._events;if(B){var L=B[O];if(typeof L=="function")return 1;if(L)return L.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function M(O,B){for(var L=B,K=L+1,x=O.length;K>1,C=-7,k=i?n-1:0,R=i?-1:1,P=t[p+k];for(k+=R,f=P&(1<<-C)-1,P>>=-C,C+=m;C>0;f=f*256+t[p+k],k+=R,C-=8);for(h=f&(1<<-C)-1,f>>=-C,C+=o;C>0;h=h*256+t[p+k],k+=R,C-=8);if(f===0)f=1-_;else{if(f===u)return h?NaN:(P?-1:1)*(1/0);h=h+Math.pow(2,o),f=f-_}return(P?-1:1)*h*Math.pow(2,f-o)},r.write=function(t,p,i,o,n,f){var h,m,u,_=f*8-n-1,C=(1<<_)-1,k=C>>1,R=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=o?0:f-1,w=o?1:-1,H=p<0||p===0&&1/p<0?1:0;for(p=Math.abs(p),isNaN(p)||p===1/0?(m=isNaN(p)?1:0,h=C):(h=Math.floor(Math.log(p)/Math.LN2),p*(u=Math.pow(2,-h))<1&&(h--,u*=2),h+k>=1?p+=R/u:p+=R*Math.pow(2,1-k),p*u>=2&&(h++,u/=2),h+k>=C?(m=0,h=C):h+k>=1?(m=(p*u-1)*Math.pow(2,n),h=h+k):(m=p*Math.pow(2,k-1)*Math.pow(2,n),h=0));n>=8;t[i+P]=m&255,P+=w,m/=256,n-=8);for(h=h<0;t[i+P]=h&255,P+=w,h/=256,_-=8);t[i+P-w]|=H*128}},{}],14:[function(e,g,r){(function(t,p,i,o,n){t.fromXML=function(c,E,b){var l=p.parser(!0,{xmlns:!0}),d=[],y=[],V=[],te=0,$=null;l.onclosetag=function(he){if(d[0]instanceof _)for(var ye in d[0].styles)ie(d[0],d[0].styles[ye],E);else if(d[0]instanceof v||d[0]instanceof T){if(d[0].contents.length>1){var _e=[d[0].contents[0]],pe;for(pe=1;pe0&&b&&"onCloseTag"in b&&b.onCloseTag());V.shift(),y.shift(),d.shift()},l.ontext=function(he){if(d[0]!==void 0)if(d[0]instanceof T||d[0]instanceof v){var ye=new W;ye.initFromText($,d[0],he,V[0],E),d[0].contents.push(ye)}else d[0]instanceof h&&te>0&&b&&"onText"in b&&b.onText(he)},l.onopentag=function(he){var ye=he.attributes["xml:space"];ye?V.unshift(ye.value):V.length===0?V.unshift("default"):V.unshift(V[0]);var _e=he.attributes["xml:lang"];if(_e?y.unshift(_e.value):y.length===0?y.unshift(""):y.unshift(y[0]),he.uri===i.ns_tt)if(he.local==="tt")$!==null&&le(E,"Two elements at ("+this.line+","+this.column+")"),$=new m,$.initFromNode(he,E),d.unshift($);else if(he.local==="head")d[0]instanceof m||le(E,"Parent of element is not at ("+this.line+","+this.column+")"),$.head!==null&&le("Second element at ("+this.line+","+this.column+")"),$.head=new u,d.unshift($.head);else if(he.local==="styling")d[0]instanceof u||le(E,"Parent of element is not at ("+this.line+","+this.column+")"),$.head.styling!==null&&le("Second element at ("+this.line+","+this.column+")"),$.head.styling=new _,d.unshift($.head.styling);else if(he.local==="style"){var pe;d[0]instanceof _?(pe=new C,pe.initFromNode(he,E),pe.id?$.head.styling.styles[pe.id]=pe:j(E,"