theoplayer
Version:
THEOplayer is the universal video player solution, enabling you to quickly deliver cross-platform content playback.
40 lines (32 loc) • 2.52 MB
JavaScript
/*!
THEOplayer
Usage of this software is limited by the THEOplayer License.
It is prohibited to reverse engineer, decompile, translate,
disassemble, decipher, decrypt, or otherwise attempt to
discover the source code of this software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, visit https://www.theoplayer.com or contact
contact @ theoplayer . com
This product makes use of Open Source Software: video.js
(Apache 2.0 - Copyright Brightcove, Inc.), long.js (Apache 2.0),
nodejs-langs (MIT - Copyright Andrew Lawson), promise-polyfill
(MIT - Copyright (c) 2014 Taylor Hakes & Forbes Lindesay),
shaka-player (Apache 2.0 - Copyright 2016 Google LLC)
The code of these projects has been heavily modified during
integration.
More information on the licenses can be found here: Apache 2.0
(http://www.apache.org/licenses/LICENSE-2.0), MIT
(https://opensource.org/licenses/MIT)
THEOplayer is based on patented technology developed by
THEO Technologies (https://www.theoplayer.com).
Version: 10.8.0
Created: 2026-01-15T14:16:26.308Z
*/
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i(t):"function"==typeof define&&define.amd?define([],function(){return i(t)}):t.THEOplayer=i(t)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof s?s:"undefined"!=typeof global?global:this,function(t){"use strict";var i,n,r,e,s,u,o,h,a,c={exports:{}},f=(c.exports,t.window),v=t.document,d=t.location,l=t.navigator,g=t.setTimeout,w=t.clearTimeout,m=t.setInterval,p=t.clearInterval,y=t.Error,_=t.TypeError,k=t.SyntaxError,b=t.Object,A=t.Math,T=t.parseInt,S=t.parseFloat,E=t.isNaN,I=t.Uint8Array,R=t.Worker,C=(t.WorkerGlobalScope,t.XMLHttpRequest),P=b.create,N=b.defineProperty,D=b.getOwnPropertyDescriptor,x=b.getOwnPropertyNames,B=b.getPrototypeOf,O=b.prototype.hasOwnProperty,M=function(t,i){return function(){return t&&(i=t(t=0)),i}},L=function(t,i){return function(){return i||t((i={exports:{}}).exports,i),i.exports}},F=function(t,i,n,r){if(i&&"object"==typeof i||"function"==typeof i)for(var e,s=x(i),u=0,o=s.length;u<o;u++)e=s[u],O.call(t,e)||e===n||N(t,e,{get:function(t){return i[t]}.bind(null,e),enumerable:!(r=D(i,e))||r.enumerable});return t},U=function(t,i,n){return n=null!=t?P(B(t)):{},F(!i&&t&&t.__esModule?n:N(n,"default",{value:t,enumerable:!0}),t)},V=M(function(){"function"==typeof Symbol&&Symbol.iterator?(i=Symbol,n=null!=(u=Symbol.for)?u:Symbol,r=Symbol.iterator,e=null!=(o=Symbol.dispose)?o:n("Symbol.dispose"),s=null!=(h=Symbol.asyncDispose)?h:n("Symbol.asyncDispose")):(a=0,i=function(t){return"hd"+t+"_"+ ++a},r=(n=function(t){return"hd"+t})("Symbol.iterator"),e=n("Symbol.dispose"),s=n("Symbol.asyncDispose"),i.for=n,i.iterator=r,i.dispose=e,i.asyncDispose=s)});function j(t,n){return null!=n&&void 0!==i&&n[i.hasInstance]?!!n[i.hasInstance](t):t instanceof n}var H=M(function(){V(),It()});function W(t){return t&&void 0!==i&&t.constructor===i?"symbol":typeof t}var z,q,X,G,Q,Y,K,J,Z,tt,it,nt,rt,et,st,ut,ot,ht,at,ct,ft=M(function(){V(),It()});function vt(t){var i=this.constructor;return this.then(function(n){return i.resolve(t()).then(function(){return n})},function(n){return i.resolve(t()).then(function(){return i.reject(n)})})}function dt(t){return new this(function(i,n){if(!t||void 0===t.length)return n(new _((void 0===t?"undefined":W(t))+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return i([]);var e=r.length;function s(t,n){if(n&&("object"===(void 0===n?"undefined":W(n))||"function"==typeof n)){var u=n.then;if("function"==typeof u)return void u.call(n,function(i){s(t,i)},function(n){r[t]={status:"rejected",reason:n},0===--e&&i(r)})}r[t]={status:"fulfilled",value:n},0===--e&&i(r)}for(var u=0;u<r.length;u++)s(u,r[u])})}function lt(t){return Boolean(t&&void 0!==t.length)}function gt(){}function wt(t){if(!j(this,wt))throw new _("Promises must be constructed via new");if("function"!=typeof t)throw new _("not a function");this.Ua=0,this.IEi=!1,this.fkt=void 0,this.REi=[],bt(t,this)}function mt(t,i){for(;3===t.Ua;)t=t.fkt;0!==t.Ua?(t.IEi=!0,wt.CEi(function(){var n=1===t.Ua?i.onFulfilled:i.onRejected;if(null!==n){var r;try{r=n(t.fkt)}catch(t){return void yt(i.promise,t)}pt(i.promise,r)}else(1===t.Ua?pt:yt)(i.promise,t.fkt)})):t.REi.push(i)}function pt(t,i){try{if(i===t)throw new _("A promise cannot be resolved with itself.");if(i&&("object"===(void 0===i?"undefined":W(i))||"function"==typeof i)){var n=i.then;if(j(i,wt))return t.Ua=3,t.fkt=i,void _t(t);if("function"==typeof n)return void bt(function(t,i){return function(){t.apply(i,arguments)}}(n,i),t)}t.Ua=1,t.fkt=i,_t(t)}catch(i){yt(t,i)}}function yt(t,i){t.Ua=2,t.fkt=i,_t(t)}function _t(t){2===t.Ua&&0===t.REi.length&&wt.CEi(function(){t.IEi||wt.PEi(t.fkt)});for(var i=0,n=t.REi.length;i<n;i++)mt(t,t.REi[i]);t.REi=null}function kt(t,i,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof i?i:null,this.promise=n}function bt(t,i){var n=!1;try{t(function(t){n||(n=!0,pt(i,t))},function(t){n||(n=!0,yt(i,t))})}catch(t){if(n)return;n=!0,yt(i,t)}}function At(t){return new nt(it,{reason:t,promise:q.reject(t).catch(function(){}),cancelable:!0})}function Tt(t){var i=new rt(it,{detail:{reason:t},cancelable:!0});return b.defineProperty(i,"reason",{value:t}),i}function St(t){var i=v.createEvent("CustomEvent");return i.initCustomEvent(it,!1,!0,{reason:t}),i}var Et=M(function(){var t,i,n,r;V(),It(),H(),ft(),z=g,wt.prototype.catch=function(t){return this.then(null,t)},wt.prototype.then=function(t,i){var n=new this.constructor(gt);return mt(this,new kt(t,i,n)),n},wt.prototype.finally=vt,wt.all=function(t){return new wt(function(i,n){if(!lt(t))return n(new _("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return i([]);var e=r.length;function s(t,u){try{if(u&&("object"===(void 0===u?"undefined":W(u))||"function"==typeof u)){var o=u.then;if("function"==typeof o)return void o.call(u,function(i){s(t,i)},n)}r[t]=u,0===--e&&i(r)}catch(t){n(t)}}for(var u=0;u<r.length;u++)s(u,r[u])})},wt.allSettled=dt,wt.resolve=function(t){return t&&"object"===(void 0===t?"undefined":W(t))&&t.constructor===wt?t:new wt(function(i){i(t)})},wt.reject=function(t){return new wt(function(i,n){n(t)})},wt.race=function(t){return new wt(function(i,n){if(!lt(t))return n(new _("Promise.race accepts an array"));for(var r=0,e=t.length;r<e;r++)wt.resolve(t[r]).then(i,n)})},wt.CEi="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){z(t,0)},wt.PEi=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},q=function(){var t=self.Promise;if(void 0!==t)try{if(-1!==t.toString().indexOf("[native code]"))return t}catch(t){}}(),X=l?l.userAgent:"",G=X.match(/Firefox\/([0-9]+)/i),Q=null!=G,Y=G?Number(G[1]):0,K=X.match(/(Version)\/((\d+)\.(\d+)(?:\.(\d+))?).*Safari/),J=null!=K,Z=K?Number(K[3]):0,tt=function(){function t(t){this.Ab=0,this.Wd=0,this.Kp=[],this.DEi=t}return t.prototype.NEi=function(t){var i=this.length();this.xEi(i+1);var n=this.Wd+i&this.DEi-1;this.Kp[n]=t,this.Ab=i+1},t.prototype.push=function(t){var i=this.length()+1;if(this.DEi<i)this.NEi(t);else{var n=this.Wd+i-1,r=this.DEi-1;this.Kp[n&r]=t,this.Ab=i}},t.prototype.shift=function(){var t=this.Wd,i=this.Kp[t];return this.Kp[t]=void 0,this.Wd=t+1&this.DEi-1,this.Ab--,i},t.prototype.length=function(){return this.Ab},t.prototype.xEi=function(t){this.DEi<t&&this.BEi(this.DEi<<1)},t.prototype.BEi=function(t){var i=this.DEi;this.DEi=t;var n=this.Wd+this.Ab&i-1;!function(t,i,n,r){for(var e=0;e<r;++e)t[e+n]=t[e+i],t[e+i]=void 0}(this.Kp,0,i,n)},t}(),it="unhandledrejection",nt=self.PromiseRejectionEvent,rt=self.CustomEvent,et=function(t){return et=function(){try{var t=q.resolve(),i="error",n=new nt(it,{reason:i,promise:t});return it===n.type&&i===n.reason}catch(t){}return!1}()?At:function(){try{var t="error",i=new rt(it,{detail:{reason:t}});return it===i.type&&t===i.detail.reason}catch(t){}return!1}()?Tt:St,et(t)},ut=Q&&Y<60||J&&Z<15,q&&!ut?(ot=q,ht=function(){}):(ot=wt,at=null!==(st=function(){var t=self.queueMicrotask;if("function"==typeof t)return function(i){return t(i)};var i=q;if(i&&"function"==typeof i.resolve){var n=i.resolve();return function(t){return n.then(t)}}}())&&void 0!==st?st:wt.CEi,t=at,i=new tt(16),n=!1,ht=(ct={n8:function(e){i.push(e),n||(n=!0,t(r))},UQ:r=function(){for(;i.length()>0;)i.shift()();n=!1}}).UQ,wt.CEi=ct.n8,wt.PEi=function(t){try{var i=et(t);if(!self.dispatchEvent(i)||i.defaultPrevented)return}catch(t){}g(function(){throw new y("Unhandled promise rejection: ".concat(t))},0)})}),It=M(function(){Et()});function Rt(t,i){return(Rt=b.setPrototypeOf||function(t,i){return t.__proto__=i,t})(t,i)}var Ct=M(function(){V(),It()});function Pt(t,i){if("function"!=typeof i&&null!==i)throw new _("Super expression must either be null or a function");t.prototype=b.create(i&&i.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),i&&Rt(t,i)}var Nt=M(function(){V(),It(),Ct()});function Dt(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),b.defineProperty(t,r.key,r)}}function xt(t,i,n){return i&&Dt(t.prototype,i),n&&Dt(t,n),t}var Bt=M(function(){V(),It()});function Ot(t,i){(null==i||i>t.length)&&(i=t.length);for(var n=0,r=new Array(i);n<i;n++)r[n]=t[n];return r}var Mt=M(function(){V(),It()});var Lt=M(function(){V(),It(),Mt()});function Ft(t,n){var e=void 0!==i&&t[r]||t["@@iterator"];if(e)return(e=e.call(t)).next.bind(e);if(Array.isArray(t)||(e=function(t,i){if(t){if("string"==typeof t)return Ot(t,i);var n=b.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ot(t,i):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var s=0;return function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}}}throw new _("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Ut=M(function(){V(),It(),Lt()});function Vt(t,i,n,r,e,s,u){try{var o=t[s](u),h=o.value}catch(t){return void n(t)}o.done?i(h):ot.resolve(h).then(r,e)}function jt(t){return function(){var i=this,n=arguments;return new ot(function(r,e){var s=t.apply(i,n);function u(t){Vt(s,r,e,u,o,"next",t)}function o(t){Vt(s,r,e,u,o,"throw",t)}u(void 0)})}}var Ht,Wt=M(function(){V(),It()});function zt(t,n){var e,s,u,o={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},h=b.create(("function"==typeof Iterator?Iterator:b).prototype);return h.next=a(0),h.throw=a(1),h.return=a(2),"function"==typeof i&&(h[r]=function(){return this}),h;function a(i){return function(r){return function(i){if(e)throw new _("Generator is already executing.");for(;h&&(h=0,i[0]&&(o=0)),o;)try{if(e=1,s&&(u=2&i[0]?s.return:i[0]?s.throw||((u=s.return)&&u.call(s),0):s.next)&&!(u=u.call(s,i[1])).done)return u;switch(s=0,u&&(i=[2&i[0],u.value]),i[0]){case 0:case 1:u=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,s=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(u=o.trys,(u=u.length>0&&u[u.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!u||i[1]>u[0]&&i[1]<u[3])){o.label=i[1];break}if(6===i[0]&&o.label<u[1]){o.label=u[1],u=i;break}if(u&&o.label<u[2]){o.label=u[2],o.ops.push(i);break}u[2]&&o.ops.pop(),o.trys.pop();continue}i=n.call(t,o)}catch(t){i=[6,t],s=0}finally{e=u=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,r])}}}function qt(t){var n="function"==typeof i&&r,e=n&&t[n],s=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new _(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(t,i,n){if(null!=i){if("object"!=typeof i&&"function"!=typeof i)throw new _("Object expected.");var r,u;if(n){if(!s)throw new _("Symbol.asyncDispose is not defined.");r=i[s]}if(void 0===r){if(!e)throw new _("Symbol.dispose is not defined.");r=i[e],n&&(u=r)}if("function"!=typeof r)throw new _("Object not disposable.");u&&(r=function(){try{u.call(this)}catch(t){return ot.reject(t)}}),t.stack.push({value:i,dispose:r,async:n})}else n&&t.stack.push({async:!0});return i}function Gt(t){function i(i){t.error=t.hasError?new Ht(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),ot.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,ot.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(t){i(t)}if(1===r)return t.hasError?ot.reject(t.error):ot.resolve();if(t.hasError)throw t.error}()}var Qt=M(function(){V(),It(),Ht="function"==typeof SuppressedError?SuppressedError:function(t,i,n){var r=new y(n);return r.name="SuppressedError",r.error=t,r.suppressed=i,r}}),Yt=M(function(){V(),It(),Qt()}),$t=L(function(t,n){var e,s;V(),It(),ft(),e=t,s=function(t){var n="function"==typeof i&&"symbol"===W(r)?i:function(t){return"Symbol("+t+")"};function e(){}var s=Number.isNaN||function(t){return t!=t},u=e;function o(t){return"object"===(void 0===t?"undefined":W(t))&&null!==t||"function"==typeof t}function h(t){return t.slice()}function a(t,i,n,r,e){new I(t).set(new I(n,r,e),i)}function c(t){return!1!==function(t){return"number"==typeof t&&(!s(t)&&!(t<0))}(t)&&t!==1/0}function f(t,i,n){if("function"!=typeof t)throw new _("Argument is not a function");return Function.prototype.apply.call(t,i,n)}function v(t,i,n,r){var e=t[i];if(void 0!==e){if("function"!=typeof e)throw new _(e+" is not a method");switch(n){case 0:return function(){return l(e,t,r)};case 1:return function(i){var n=[i].concat(r);return l(e,t,n)}}}return function(){return E(void 0)}}function d(t,i,n){var r=t[i];if(void 0!==r)return f(r,t,n)}function l(t,i,n){try{return E(f(t,i,n))}catch(t){return R(t)}}function g(t){if(t=Number(t),s(t)||t<0)throw new RangeError("highWaterMark property of a queuing strategy must be non-negative and non-NaN");return t}function w(t){if(void 0===t)return function(){return 1};if("function"!=typeof t)throw new _("size property of a queuing strategy must be a function");return function(i){return t(i)}}var m=ot,p=ot.prototype.then,k=ot.resolve.bind(m),T=ot.reject.bind(m);function S(t){return new m(t)}function E(t){return k(t)}function R(t){return T(t)}function C(t,i,n){return p.call(t,i,n)}function P(t,i,n){C(C(t,i,n),void 0,u)}function N(t,i){P(t,i)}function D(t,i){P(t,void 0,i)}function x(t,i,n){return C(t,i,n)}function B(t){C(t,void 0,u)}var O=function(){function t(){this.Ld=0,this.Hd=0,this.Wd={qd:[],zd:void 0},this.Gd=this.Wd,this.Ld=0,this.Hd=0}return b.defineProperty(t.prototype,"length",{get:function(){return this.Hd},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var i=this.Gd,n=i;16383===i.qd.length&&(n={qd:[],zd:void 0}),i.qd.push(t),n!==i&&(this.Gd=n,i.zd=n),++this.Hd},t.prototype.shift=function(){var t=this.Wd,i=t,n=this.Ld,r=n+1,e=t.qd,s=e[n];return 16384===r&&(i=t.zd,r=0),--this.Hd,this.Ld=r,t!==i&&(this.Wd=i),e[n]=void 0,s},t.prototype.forEach=function(t){for(var i=this.Ld,n=this.Wd,r=n.qd;!(i===r.length&&void 0===n.zd||i===r.length&&(i=0,0===(r=(n=n.zd).qd).length));)t(r[i]),++i},t.prototype.peek=function(){var t=this.Wd,i=this.Ld;return t.qd[i]},t}();function M(t,i,n){var r=null;!0===n&&(r=b.prototype);var e=b.create(r);return e.value=t,e.done=i,e}function L(t,i){t.Xd=!0,t.Qd=i,i.Kd=t,"readable"===i.Ua?j(t):"closed"===i.Ua?function(t){j(t),q(t)}(t):H(t,i.Yd)}function F(t,i){return $i(t.Qd,i)}function U(t){"readable"===t.Qd.Ua?z(t,new _("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){H(t,i)}(t,new _("Reader was released and can no longer be used to monitor the stream's closedness")),t.Qd.Kd=void 0,t.Qd=void 0}function V(t){return new _("Cannot "+t+" a stream using a released reader")}function j(t){t.Jd=S(function(i,n){t.Zd=i,t.ul=n})}function H(t,i){j(t),z(t,i)}function z(t,i){B(t.Jd),t.ul(i),t.Zd=void 0,t.ul=void 0}function q(t){t.Zd(void 0),t.Zd=void 0,t.ul=void 0}var X=n("[[CancelSteps]]"),G=n("[[PullSteps]]");function Q(t,i){void 0===i&&(i=!1);var n=new it(t);return n.Xd=i,n}function Y(t){return S(function(i,n){var r={tf:i,if:n};t.Kd.ef.push(r)})}function $(t,i,n){var r=t.Kd;r.ef.shift().tf(M(i,n,r.Xd))}function K(t){return t.Kd.ef.length}function J(t){var i=t.Kd;return void 0!==i&&!!nt(i)}var Z,tt,it=function(){function t(t){if(!1===Qi(t))throw new _("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Yi(t))throw new _("This stream has already been locked for exclusive reading by another reader");L(this,t),this.ef=new O}return b.defineProperty(t.prototype,"closed",{get:function(){return nt(this)?this.Jd:R(et("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return nt(this)?void 0===this.Qd?R(V("cancel")):F(this,t):R(et("cancel"))},t.prototype.read=function(){return nt(this)?void 0===this.Qd?R(V("read from")):rt(this):R(et("read"))},t.prototype.releaseLock=function(){if(!nt(this))throw et("releaseLock");if(void 0!==this.Qd){if(this.ef.length>0)throw new _("Tried to release a reader lock when that reader has pending read() calls un-settled");U(this)}},t}();function nt(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"ef")}function rt(t){var i=t.Qd;return i.nf=!0,"closed"===i.Ua?E(M(void 0,!0,t.Xd)):"errored"===i.Ua?R(i.Yd):i.rf[G]()}function et(t){return new _("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"===W(n.asyncIterator)&&((Z={})[n.asyncIterator]=function(){return this},tt=Z,b.defineProperty(tt,n.asyncIterator,{enumerable:!1}));var st={next:function(){if(!1===ut(this))return R(ht("next"));var t=this.hf;return void 0===t.Qd?R(V("iterate")):x(rt(t),function(i){var n=i.done;return n&&U(t),M(i.value,n,!0)})},return:function(t){if(!1===ut(this))return R(ht("next"));var i=this.hf;if(void 0===i.Qd)return R(V("finish iterating"));if(i.ef.length>0)return R(new _("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this.uf){var n=F(i,t);return U(i),x(n,function(){return M(t,!0,!0)})}return U(i),E(M(t,!0,!0))}};function ut(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"hf")}function ht(t){return new _("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function at(t){var i=t.cf.shift();return t.df-=i.size,t.df<0&&(t.df=0),i.value}function ct(t,i,n){if(!c(n=Number(n)))throw new RangeError("Size must be a finite, non-NaN, non-negative number.");t.cf.push({value:i,size:n}),t.df+=n}function ft(t){t.cf=new O,t.df=0}void 0!==tt&&b.setPrototypeOf(st,tt),b.defineProperty(st,"next",{enumerable:!1}),b.defineProperty(st,"return",{enumerable:!1});var vt=n("[[AbortSteps]]"),dt=n("[[ErrorSteps]]"),lt=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),wt(this);var n=i.size,r=i.highWaterMark;if(void 0!==t.type)throw new RangeError("Invalid type is specified");var e=w(n);void 0===r&&(r=1),function(t,i,n,r){var e=b.create(Bt.prototype);function s(){return d(i,"start",[e])}var u=v(i,"write",1,[e]),o=v(i,"close",0,[]),h=v(i,"abort",1,[]);Ot(t,e,s,u,o,h,n,r)}(this,t,r=g(r),e)}return b.defineProperty(t.prototype,"locked",{get:function(){if(!1===mt(this))throw Ht("locked");return pt(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===mt(this)?R(Ht("abort")):!0===pt(this)?R(new _("Cannot abort a stream that already has a writer")):yt(this,t)},t.prototype.close=function(){return!1===mt(this)?R(Ht("close")):!0===pt(this)?R(new _("Cannot close a stream that already has a writer")):!0===Tt(this)?R(new _("Cannot close an already-closing stream")):_t(this)},t.prototype.getWriter=function(){if(!1===mt(this))throw Ht("getWriter");return gt(this)},t}();function gt(t){return new It(t)}function wt(t){t.Ua="writable",t.Yd=void 0,t.lf=void 0,t.vf=void 0,t._f=new O,t.gf=void 0,t.pf=void 0,t.mf=void 0,t.wf=void 0,t.yf=!1}function mt(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"vf")}function pt(t){return void 0!==t.lf}function yt(t,i){var n=t.Ua;if("closed"===n||"errored"===n)return E(void 0);if(void 0!==t.wf)return t.wf.bf;var r=!1;"erroring"===n&&(r=!0,i=void 0);var e=S(function(n,e){t.wf={bf:void 0,tf:n,if:e,Af:i,Sf:r}});return t.wf.bf=e,!1===r&&bt(t,i),e}function _t(t){var i=t.Ua;if("closed"===i||"errored"===i)return R(new _("The stream (in "+i+" state) is not in the writable state and cannot be closed"));var n=S(function(i,n){var r={tf:i,if:n};t.pf=r}),r=t.lf;return void 0!==r&&!0===t.yf&&"writable"===i&&Zt(r),function(t){ct(t,"close",0),Ft(t)}(t.vf),n}function kt(t,i){"writable"!==t.Ua?At(t):bt(t,i)}function bt(t,i){var n=t.vf;t.Ua="erroring",t.Yd=i;var r=t.lf;void 0!==r&&Nt(r,i),!1===function(t){return void 0!==t.gf||void 0!==t.mf}(t)&&!0===n.Tf&&At(t)}function At(t){t.Ua="errored",t.vf[dt]();var i=t.Yd;if(t._f.forEach(function(t){t.if(i)}),t._f=new O,void 0!==t.wf){var n=t.wf;if(t.wf=void 0,!0===n.Sf)return n.if(i),void St(t);P(t.vf[vt](n.Af),function(){n.tf(),St(t)},function(i){n.if(i),St(t)})}else St(t)}function Tt(t){return void 0!==t.pf||void 0!==t.mf}function St(t){void 0!==t.pf&&(t.pf.if(t.Yd),t.pf=void 0);var i=t.lf;void 0!==i&&Gt(i,t.Yd)}function Et(t,i){var n=t.lf;void 0!==n&&i!==t.yf&&(!0===i?function(t){Yt(t)}(n):Zt(n)),t.yf=i}var It=function(){function t(t){if(!1===mt(t))throw new _("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===pt(t))throw new _("This stream has already been locked for exclusive writing by another writer");this.kf=t,t.lf=this;var i=t.Ua;if("writable"===i)!1===Tt(t)&&!0===t.yf?Yt(this):Kt(this),qt(this);else if("erroring"===i)$t(this,t.Yd),qt(this);else if("closed"===i)Kt(this),function(t){qt(t),Qt(t)}(this);else{var n=t.Yd;$t(this,n),Xt(this,n)}}return b.defineProperty(t.prototype,"closed",{get:function(){return!1===Rt(this)?R(Wt("closed")):this.Jd},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Rt(this))throw Wt("desiredSize");if(void 0===this.kf)throw zt("desiredSize");return function(t){var i=t.kf,n=i.Ua;return"errored"===n||"erroring"===n?null:"closed"===n?0:Lt(i.vf)}(this)},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"ready",{get:function(){return!1===Rt(this)?R(Wt("ready")):this.Ef},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===Rt(this)?R(Wt("abort")):void 0===this.kf?R(zt("abort")):function(t,i){var n=t.kf;return yt(n,i)}(this,t)},t.prototype.close=function(){if(!1===Rt(this))return R(Wt("close"));var t=this.kf;return void 0===t?R(zt("close")):!0===Tt(t)?R(new _("Cannot close an already-closing stream")):Ct(this)},t.prototype.releaseLock=function(){if(!1===Rt(this))throw Wt("releaseLock");void 0!==this.kf&&Dt(this)},t.prototype.write=function(t){return!1===Rt(this)?R(Wt("write")):void 0===this.kf?R(zt("write to")):xt(this,t)},t}();function Rt(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"kf")}function Ct(t){return _t(t.kf)}function Pt(t,i){"pending"===t.xf?Gt(t,i):function(t,i){Xt(t,i)}(t,i)}function Nt(t,i){"pending"===t.Pf?Jt(t,i):function(t,i){$t(t,i)}(t,i)}function Dt(t){var i=t.kf,n=new _("Writer was released and can no longer be used to monitor the stream's closedness");Nt(t,n),Pt(t,n),i.lf=void 0,t.kf=void 0}function xt(t,i){var n=t.kf,r=n.vf,e=function(t,i){try{return t.If(i)}catch(i){return Ut(t,i),1}}(r,i);if(n!==t.kf)return R(zt("write to"));var s=n.Ua;if("errored"===s)return R(n.Yd);if(!0===Tt(n)||"closed"===s)return R(new _("The stream is closing or closed and cannot be written to"));if("erroring"===s)return R(n.Yd);var u=function(t){return S(function(i,n){var r={tf:i,if:n};t._f.push(r)})}(n);return function(t,i,n){var r={chunk:i};try{ct(t,r,n)}catch(i){return void Ut(t,i)}var e=t.Cf;!1===Tt(e)&&"writable"===e.Ua&&Et(e,Vt(t)),Ft(t)}(r,i,e),u}var Bt=function(){function t(){throw new _("WritableStreamDefaultController cannot be constructed explicitly")}return t.prototype.error=function(t){if(!1===function(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Cf")}(this))throw new _("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this.Cf.Ua&&jt(this,t)},t.prototype[vt]=function(t){var i=this.Rf(t);return Mt(this),i},t.prototype[dt]=function(){ft(this)},t}();function Ot(t,i,n,r,e,s,u,o){i.Cf=t,t.vf=i,i.cf=void 0,i.df=void 0,ft(i),i.Tf=!1,i.If=o,i.Df=u,i.Bf=r,i.Nf=e,i.Rf=s;var h=Vt(i);Et(t,h),P(E(n()),function(){i.Tf=!0,Ft(i)},function(n){i.Tf=!0,kt(t,n)})}function Mt(t){t.Bf=void 0,t.Nf=void 0,t.Rf=void 0,t.If=void 0}function Lt(t){return t.Df-t.df}function Ft(t){var i=t.Cf;if(!1!==t.Tf&&void 0===i.gf)if("erroring"!==i.Ua){if(0!==t.cf.length){var n=function(t){return t.cf.peek().value}(t);"close"===n?function(t){var i=t.Cf;(function(t){t.mf=t.pf,t.pf=void 0})(i),at(t);var n=t.Nf();Mt(t),P(n,function(){!function(t){t.mf.tf(void 0),t.mf=void 0,"erroring"===t.Ua&&(t.Yd=void 0,void 0!==t.wf&&(t.wf.tf(),t.wf=void 0)),t.Ua="closed";var i=t.lf;void 0!==i&&Qt(i)}(i)},function(t){!function(t,i){t.mf.if(i),t.mf=void 0,void 0!==t.wf&&(t.wf.if(i),t.wf=void 0),kt(t,i)}(i,t)})}(t):function(t,i){var n=t.Cf;!function(t){t.gf=t._f.shift()}(n);var r=t.Bf(i);P(r,function(){!function(t){t.gf.tf(void 0),t.gf=void 0}(n);var i=n.Ua;if(at(t),!1===Tt(n)&&"writable"===i){var r=Vt(t);Et(n,r)}Ft(t)},function(i){"writable"===n.Ua&&Mt(t),function(t,i){t.gf.if(i),t.gf=void 0,kt(t,i)}(n,i)})}(t,n.chunk)}}else At(i)}function Ut(t,i){"writable"===t.Cf.Ua&&jt(t,i)}function Vt(t){return Lt(t)<=0}function jt(t,i){var n=t.Cf;Mt(t),bt(n,i)}function Ht(t){return new _("WritableStream.prototype."+t+" can only be used on a WritableStream")}function Wt(t){return new _("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function zt(t){return new _("Cannot "+t+" a stream using a released writer")}function qt(t){t.Jd=S(function(i,n){t.Zd=i,t.ul=n,t.xf="pending"})}function Xt(t,i){qt(t),Gt(t,i)}function Gt(t,i){B(t.Jd),t.ul(i),t.Zd=void 0,t.ul=void 0,t.xf="rejected"}function Qt(t){t.Zd(void 0),t.Zd=void 0,t.ul=void 0,t.xf="resolved"}function Yt(t){t.Ef=S(function(i,n){t.Mf=i,t.Lf=n}),t.Pf="pending"}function $t(t,i){Yt(t),Jt(t,i)}function Kt(t){Yt(t),Zt(t)}function Jt(t,i){B(t.Ef),t.Lf(i),t.Mf=void 0,t.Lf=void 0,t.Pf="rejected"}function Zt(t){t.Mf(void 0),t.Mf=void 0,t.Lf=void 0,t.Pf="fulfilled"}function ti(t){if("object"!==(void 0===t?"undefined":W(t))||null===t)return!1;try{return"boolean"==typeof t.aborted}catch(t){return!1}}var ii,ni="undefined"!=typeof DOMException?DOMException:void 0,ri=function(t){if("function"!=typeof t&&"object"!==(void 0===t?"undefined":W(t)))return!1;try{return new t,!0}catch(t){return!1}}(ni)?ni:((ii=function(t,i){this.message=t||"",this.name=i||"Error",y.captureStackTrace&&y.captureStackTrace(this,this.constructor)}).prototype=b.create(y.prototype),b.defineProperty(ii.prototype,"constructor",{value:ii,writable:!0,configurable:!0}),ii);function ei(t,i,n,r,s,u){var o=Q(t),h=gt(i);t.nf=!0;var a=!1,c=E(void 0);return S(function(f,v){var d,l,g,w;if(void 0!==u){if(d=function(){var n=new ri("Aborted","AbortError"),e=[];!1===r&&e.push(function(){return"writable"===i.Ua?yt(i,n):E(void 0)}),!1===s&&e.push(function(){return"readable"===t.Ua?$i(t,n):E(void 0)}),k(function(){return ot.all(e.map(function(t){return t()}))},!0,n)},!0===u.aborted)return void d();u.addEventListener("abort",d)}if(y(t,o.Jd,function(t){!1===r?k(function(){return yt(i,t)},!0,t):b(!0,t)}),y(i,h.Jd,function(i){!1===s?k(function(){return $i(t,i)},!0,i):b(!0,i)}),l=t,g=o.Jd,w=function(){!1===n?k(function(){return function(t){var i=t.kf,n=i.Ua;return!0===Tt(i)||"closed"===n?E(void 0):"errored"===n?R(i.Yd):Ct(t)}(h)}):b()},"closed"===l.Ua?w():N(g,w),!0===Tt(i)||"closed"===i.Ua){var m=new _("the destination writable stream closed before all data could be piped to it");!1===s?k(function(){return $i(t,m)},!0,m):b(!0,m)}function p(){var t=c;return C(c,function(){return t!==c?p():void 0})}function y(t,i,n){"errored"===t.Ua?n(t.Yd):D(i,n)}function k(t,n,r){function e(){P(t(),function(){return A(n,r)},function(t){return A(!0,t)})}!0!==a&&(a=!0,"writable"===i.Ua&&!1===Tt(i)?N(p(),e):e())}function b(t,n){!0!==a&&(a=!0,"writable"===i.Ua&&!1===Tt(i)?N(p(),function(){return A(t,n)}):A(t,n))}function A(t,i){Dt(h),U(o),void 0!==u&&u.removeEventListener("abort",d),t?v(i):f(void 0)}B(S(function(t,i){!function n(r){r?t():C(!0===a?E(!0):C(h.Ef,function(){return C(rt(o),function(t){return!0===t.done||(c=C(xt(h,t.value),void 0,e),!1)})}),n,i)}(!1)}))})}var si=function(){function t(){throw new _}return b.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===ui(this))throw wi("desiredSize");return di(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===ui(this))throw wi("close");if(!1===li(this))throw new _("The stream is not in a state that permits close");ci(this)},t.prototype.enqueue=function(t){if(!1===ui(this))throw wi("enqueue");if(!1===li(this))throw new _("The stream is not in a state that permits enqueue");return fi(this,t)},t.prototype.error=function(t){if(!1===ui(this))throw wi("error");vi(this,t)},t.prototype[X]=function(t){ft(this);var i=this.Of(t);return ai(this),i},t.prototype[G]=function(){var t=this.Ff;if(this.cf.length>0){var i=at(this);return!0===this.Uf&&0===this.cf.length?(ai(this),Ki(t)):oi(this),E(M(i,!1,t.Kd.Xd))}var n=Y(t);return oi(this),n},t}();function ui(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Ff")}function oi(t){!1!==hi(t)&&(!0!==t.Vf?(t.Vf=!0,P(t.Hf(),function(){t.Vf=!1,!0===t.Wf&&(t.Wf=!1,oi(t))},function(i){vi(t,i)})):t.Wf=!0)}function hi(t){var i=t.Ff;return!1!==li(t)&&!1!==t.Tf&&(!0===Yi(i)&&K(i)>0||di(t)>0)}function ai(t){t.Hf=void 0,t.Of=void 0,t.If=void 0}function ci(t){var i=t.Ff;t.Uf=!0,0===t.cf.length&&(ai(t),Ki(i))}function fi(t,i){var n=t.Ff;if(!0===Yi(n)&&K(n)>0)$(n,i,!1);else{var r=void 0;try{r=t.If(i)}catch(i){throw vi(t,i),i}try{ct(t,i,r)}catch(i){throw vi(t,i),i}}oi(t)}function vi(t,i){var n=t.Ff;"readable"===n.Ua&&(ft(t),ai(t),Ji(n,i))}function di(t){var i=t.Ff.Ua;return"errored"===i?null:"closed"===i?0:t.Df-t.df}function li(t){var i=t.Ff.Ua;return!1===t.Uf&&"readable"===i}function gi(t,i,n,r,e,s,u){i.Ff=t,i.cf=void 0,i.df=void 0,ft(i),i.Tf=!1,i.Uf=!1,i.Wf=!1,i.Vf=!1,i.If=u,i.Df=s,i.Hf=r,i.Of=e,t.rf=i,P(E(n()),function(){i.Tf=!0,oi(i)},function(t){vi(i,t)})}function wi(t){return new _("ReadableStreamDefaultController.prototype."+t+" can only be used on a ReadableStreamDefaultController")}var mi=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&A.floor(t)===t},pi=function(){function t(){throw new _("ReadableStreamBYOBRequest cannot be used directly")}return b.defineProperty(t.prototype,"view",{get:function(){if(!1===ki(this))throw Li("view");return this.qf},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===ki(this))throw Li("respond");if(void 0===this.zf)throw new _("This BYOB request has been invalidated");this.qf.buffer,function(t,i){if(!1===c(i=Number(i)))throw new RangeError("bytesWritten must be a finite");Ni(t,i)}(this.zf,t)},t.prototype.respondWithNewView=function(t){if(!1===ki(this))throw Li("respond");if(void 0===this.zf)throw new _("This BYOB request has been invalidated");if(!ArrayBuffer.isView(t))throw new _("You can only respond with array buffer views");t.buffer,function(t,i){var n=t.Gf.peek();if(n.byteOffset+n.bytesFilled!==i.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(n.byteLength!==i.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");n.buffer=i.buffer,Ni(t,i.byteLength)}(this.zf,t)},t}(),yi=function(){function t(){throw new _("ReadableByteStreamController constructor cannot be used directly")}return b.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===_i(this))throw Fi("byobRequest");if(void 0===this.Xf&&this.Gf.length>0){var t=this.Gf.peek(),i=new I(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=b.create(pi.prototype);!function(t,i,n){t.zf=i,t.qf=n}(n,this,i),this.Xf=n}return this.Xf},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===_i(this))throw Fi("desiredSize");return Oi(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===_i(this))throw Fi("close");if(!0===this.Uf)throw new _("The stream has already been closed; do not close it again!");var t=this.jf.Ua;if("readable"!==t)throw new _("The stream (in "+t+" state) is not in the readable state and cannot be closed");!function(t){var i=t.jf;if(t.df>0)t.Uf=!0;else{if(t.Gf.length>0&&t.Gf.peek().bytesFilled>0){var n=new _("Insufficient bytes to fill elements in the given buffer");throw Bi(t,n),n}xi(t),Ki(i)}}(this)},t.prototype.enqueue=function(t){if(!1===_i(this))throw Fi("enqueue");if(!0===this.Uf)throw new _("stream is closed or draining");var i=this.jf.Ua;if("readable"!==i)throw new _("The stream (in "+i+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(t))throw new _("You can only enqueue array buffer views when using a ReadableByteStreamController");t.buffer,function(t,i){var n=t.jf,r=i.buffer,e=i.byteOffset,s=i.byteLength,u=r;!0===J(n)?0===K(n)?Si(t,u,e,s):$(n,new I(u,e,s),!1):!0===ji(n)?(Si(t,u,e,s),Pi(t)):Si(t,u,e,s),bi(t)}(this,t)},t.prototype.error=function(t){if(!1===_i(this))throw Fi("error");Bi(this,t)},t.prototype[X]=function(t){this.Gf.length>0&&(this.Gf.peek().bytesFilled=0),ft(this);var i=this.Of(t);return xi(this),i},t.prototype[G]=function(){var t=this.jf;if(this.df>0){var i=this.cf.shift();this.df-=i.byteLength,Ri(this);var n=void 0;try{n=new I(i.buffer,i.byteOffset,i.byteLength)}catch(t){return R(t)}return E(M(n,!1,t.Kd.Xd))}var r=this.Qf;if(void 0!==r){var e=void 0;try{e=new ArrayBuffer(r)}catch(t){return R(t)}var s={buffer:e,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,ctor:I,readerType:"default"};this.Gf.push(s)}var u=Y(t);return bi(this),u},t}();function _i(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"jf")}function ki(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"zf")}function bi(t){var i=function(t){var i=t.jf;if("readable"!==i.Ua)return!1;if(!0===t.Uf)return!1;if(!1===t.Tf)return!1;if(!0===J(i)&&K(i)>0)return!0;if(!0===ji(i)&&Vi(i)>0)return!0;var n=Oi(t);return n>0}(t);!1!==i&&(!0!==t.Vf?(t.Vf=!0,P(t.Hf(),function(){t.Vf=!1,!0===t.Wf&&(t.Wf=!1,bi(t))},function(i){Bi(t,i)})):t.Wf=!0)}function Ai(t,i){var n=!1;"closed"===t.Ua&&(n=!0);var r=Ti(i);"default"===i.readerType?$(t,r,n):function(t,i,n){var r=t.Kd,e=r.Kf.shift();e.tf(M(i,n,r.Xd))}(t,r,n)}function Ti(t){var i=t.bytesFilled,n=t.elementSize;return new t.ctor(t.buffer,t.byteOffset,i/n)}function Si(t,i,n,r){t.cf.push({buffer:i,byteOffset:n,byteLength:r}),t.df+=r}function Ei(t,i){var n=i.elementSize,r=i.bytesFilled-i.bytesFilled%n,e=A.min(t.df,i.byteLength-i.bytesFilled),s=i.bytesFilled+e,u=s-s%n,o=e,h=!1;u>r&&(o=u-i.bytesFilled,h=!0);for(var c=t.cf;o>0;){var f=c.peek(),v=A.min(o,f.byteLength),d=i.byteOffset+i.bytesFilled;a(i.buffer,d,f.buffer,f.byteOffset,v),f.byteLength===v?c.shift():(f.byteOffset+=v,f.byteLength-=v),t.df-=v,Ii(t,v,i),o-=v}return h}function Ii(t,i,n){Ci(t),n.bytesFilled+=i}function Ri(t){0===t.df&&!0===t.Uf?(xi(t),Ki(t.jf)):bi(t)}function Ci(t){void 0!==t.Xf&&(t.Xf.zf=void 0,t.Xf.qf=void 0,t.Xf=void 0)}function Pi(t){for(;t.Gf.length>0;){if(0===t.df)return;var i=t.Gf.peek();!0===Ei(t,i)&&(Di(t),Ai(t.jf,i))}}function Ni(t,i){var n=t.Gf.peek();if("closed"===t.jf.Ua){if(0!==i)throw new _("bytesWritten must be 0 when calling respond() on a closed stream");!function(t,i){i.buffer=i.buffer;var n=t.jf;if(!0===ji(n))for(;Vi(n)>0;)Ai(n,Di(t))}(t,n)}else!function(t,i,n){if(n.bytesFilled+i>n.byteLength)throw new RangeError("bytesWritten out of range");if(Ii(t,i,n),!(n.bytesFilled<n.elementSize)){Di(t);var r=n.bytesFilled%n.elementSize;if(r>0){var e=n.byteOffset+n.bytesFilled,s=n.buffer.slice(e-r,e);Si(t,s,0,s.byteLength)}n.buffer=n.buffer,n.bytesFilled-=r,Ai(t.jf,n),Pi(t)}}(t,i,n);bi(t)}function Di(t){var i=t.Gf.shift();return Ci(t),i}function xi(t){t.Hf=void 0,t.Of=void 0}function Bi(t,i){var n=t.jf;"readable"===n.Ua&&(function(t){Ci(t),t.Gf=new O}(t),ft(t),xi(t),Ji(n,i))}function Oi(t){var i=t.jf.Ua;return"errored"===i?null:"closed"===i?0:t.Df-t.df}function Mi(t,i,n){var r=b.create(yi.prototype),e=v(i,"pull",0,[r]),s=v(i,"cancel",1,[]),u=i.autoAllocateChunkSize;if(void 0!==u&&(u=Number(u),!1===mi(u)||u<=0))throw new RangeError("autoAllocateChunkSize must be a positive integer");!function(t,i,n,r,e,s,u){i.jf=t,i.Wf=!1,i.Vf=!1,i.Xf=void 0,i.cf=i.df=void 0,ft(i),i.Uf=!1,i.Tf=!1,i.Df=g(s),i.Hf=r,i.Of=e,i.Qf=u,i.Gf=new O,t.rf=i,P(E(n()),function(){i.Tf=!0,bi(i)},function(t){Bi(i,t)})}(t,r,function(){return d(i,"start",[r])},e,s,n,u)}function Li(t){return new _("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Fi(t){return new _("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Ui(t){return S(function(i,n){var r={tf:i,if:n};t.Kd.Kf.push(r)})}function Vi(t){return t.Kd.Kf.length}function ji(t){var i=t.Kd;return void 0!==i&&!!Wi(i)}var Hi=function(){function t(t){if(!Qi(t))throw new _("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===_i(t.rf))throw new _("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Yi(t))throw new _("This stream has already been locked for exclusive reading by another reader");L(this,t),this.Kf=new O}return b.defineProperty(t.prototype,"closed",{get:function(){return Wi(this)?this.Jd:R(zi("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return Wi(this)?void 0===this.Qd?R(V("cancel")):F(this,t):R(zi("cancel"))},t.prototype.read=function(t){return Wi(this)?void 0===this.Qd?R(V("read from")):ArrayBuffer.isView(t)?(t.buffer,0===t.byteLength?R(new _("view must have non-zero byteLength")):function(t,i){var n=t.Qd;return n.nf=!0,"errored"===n.Ua?R(n.Yd):function(t,i){var n=t.jf,r=1;i.constructor!==DataView&&(r=i.constructor.BYTES_PER_ELEMENT);var e=i.constructor,s={buffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength,bytesFilled:0,elementSize:r,ctor:e,readerType:"byob"};if(t.Gf.length>0)return t.Gf.push(s),Ui(n);if("closed"===n.Ua)return E(M(new e(s.buffer,s.byteOffset,0),!0,n.Kd.Xd));if(t.df>0){if(!0===Ei(t,s)){var u=Ti(s);return Ri(t),E(M(u,!1,n.Kd.Xd))}if(!0===t.Uf){var o=new _("Insufficient bytes to fill elements in the given buffer");return Bi(t,o),R(o)}}t.Gf.push(s);var h=Ui(n);return bi(t),h}(n.rf,i)}(this,t)):R(new _("view must be an array buffer view")):R(zi("read"))},t.prototype.releaseLock=function(){if(!Wi(this))throw zi("releaseLock");if(void 0!==this.Qd){if(this.Kf.length>0)throw new _("Tried to release a reader lock when that reader has pending read() calls un-settled");U(this)}},t}();function Wi(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Kf")}function zi(t){return new _("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var qi=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),Gi(this);var n=i.size,r=i.highWaterMark,e=t.type;if("bytes"===String(e)){if(void 0!==n)throw new RangeError("The strategy for a byte stream cannot have a size function");void 0===r&&(r=0),Mi(this,t,r=g(r))}else{if(void 0!==e)throw new RangeError("Invalid type is specified");var s=w(n);void 0===r&&(r=1),function(t,i,n,r){var e=b.create(si.prototype),s=v(i,"pull",0,[e]),u=v(i,"cancel",1,[]);gi(t,e,function(){return d(i,"start",[e])},s,u,n,r)}(this,t,r=g(r),s)}}return b.defineProperty(t.prototype,"locked",{get:function(){if(!1===Qi(this))throw Zi("locked");return Yi(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===Qi(this)?R(Zi("cancel")):!0===Yi(this)?R(new _("Cannot cancel a stream that already has a reader")):$i(this,t)},t.prototype.getReader=function(t){var i=(void 0===t?{}:t).mode;if(!1===Qi(this))throw Zi("getReader");if(void 0===i)return Q(this,!0);if("byob"===(i=String(i)))return function(t,i){void 0===i&&(i=!1);var n=new Hi(t);return n.Xd=i,n}(this,!0);throw new RangeError("Invalid mode is specified")},t.prototype.pipeThrough=function(t,i){var n=t.writable,r=t.readable,e=void 0===i?{}:i,s=e.preventClose,u=e.preventAbort,o=e.preventCancel,h=e.signal;if(!1===Qi(this))throw Zi("pipeThrough");if(!1===mt(n))throw new _("writable argument to pipeThrough must be a WritableStream");if(!1===Qi(r))throw new _("readable argument to pipeThrough must be a ReadableStream");if(s=Boolean(s),u=Boolean(u),o=Boolean(o),void 0!==h&&!ti(h))throw new _("ReadableStream.prototype.pipeThrough's signal option must be an AbortSignal");if(!0===Yi(this))throw new _("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===pt(n))throw new _("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return B(ei(this,n,s,u,o,h)),r},t.prototype.pipeTo=function(t,i){var n=void 0===i?{}:i,r=n.preventClose,e=n.preventAbort,s=n.preventCancel,u=n.signal;return!1===Qi(this)?R(Zi("pipeTo")):!1===mt(t)?R(new _("ReadableStream.prototype.pipeTo's first argument must be a WritableStream")):(r=Boolean(r),e=Boolean(e),s=Boolean(s),void 0===u||ti(u)?!0===Yi(this)?R(new _("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===pt(t)?R(new _("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):ei(this,t,r,e,s,u):R(new _("ReadableStream.prototype.pipeTo's signal option must be an AbortSignal")))},t.prototype.tee=function(){if(!1===Qi(this))throw Zi("tee");var t=function(t){var i,n,r,e,s,u=Q(t),o=!1,a=!1,c=!1,f=S(function(t){s=t});function v(){return!0===o||(o=!0,B(x(rt(u),function(t){if(o=!1,!0===t.done)return!1===a&&ci(r.rf),void(!1===c&&ci(e.rf));var i=t.value,n=i,s=i;!1===a&&fi(r.rf,n),!1===c&&fi(e.rf,s)}))),E(void 0)}function d(){}return r=Xi(d,v,function(r){if(a=!0,i=r,!0===c){var e=h([i,n]),u=$i(t,e);s(u)}return f}),e=Xi(d,v,function(r){if(c=!0,n=r,!0===a){var e=h([i,n]),u=$i(t,e);s(u)}return f}),D(u.Jd,function(t){vi(r.rf,t),vi(e.rf,t)}),[r,e]}(this);return h(t)},t.prototype.getIterator=function(t){var i=(void 0===t?{}:t).preventCancel,n=void 0!==i&&i;if(!1===Qi(this))throw Zi("getIterator");return function(t,i){void 0===i&&(i=!1);var n=Q(t),r=b.create(st);return r.hf=n,r.uf=Boolean(i),r}(this,n)},t}();function Xi(t,i,n,r,e){void 0===r&&(r=1),void 0===e&&(e=function(){return 1});var s=b.create(qi.prototype);return Gi(s),gi(s,b.create(si.prototype),t,i,n,r,e),s}function Gi(t){t.Ua="readable",t.Kd=void 0,t.Yd=void 0,t.nf=!1}function Qi(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"rf")}function Yi(t){return void 0!==t.Kd}function $i(t,i){return t.nf=!0,"closed"===t.Ua?E(void 0):"errored"===t.Ua?R(t.Yd):(Ki(t),x(t.rf[X](i),e))}function Ki(t){t.Ua="closed";var i=t.Kd;void 0!==i&&(nt(i)&&(i.ef.forEach(function(t){t.tf(M(void 0,!0,i.Xd))}),i.ef=new O),q(i))}function Ji(t,i){t.Ua="errored",t.Yd=i;var n=t.Kd;void 0!==n&&(nt(n)?(n.ef.forEach(function(t){t.if(i)}),n.ef=new O):(n.Kf.forEach(function(t){t.if(i)}),n.Kf=new O),z(n,i))}function Zi(t){return new _("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"===W(n.asyncIterator)&&b.defineProperty(qi.prototype,n.asyncIterator,{value:qi.prototype.getIterator,enumerable:!1,writable:!0,configurable:!0});var tn=function(){function t(t){var i=t.highWaterMark;this.highWaterMark=i}return t.prototype.size=function(t){return t.byteLength},t}(),nn=function(){function t(t){var i=t.highWaterMark;this.highWaterMark=i}return t.prototype.size=function(){return 1},t}(),rn=function(){function t(t,i,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===n&&(n={});var r=i.size,e=i.highWaterMark,s=n.size,u=n.highWaterMark;if(void 0!==t.writableType)throw new RangeError("Invalid writable type specified");var o=w(r);if(void 0===e&&(e=1),e=g(e),void 0!==t.readableType)throw new RangeError("Invalid readable type specified");var h,a=w(s);void 0===u&&(u=0),u=g(u),function(t,i,n,r,e,s){function u(){return i}function o(i){return function(t,i){var n=t.Yf;return!0===t.yf?x(t.Jf,function(){var r=t.Zf;if("erroring"===r.Ua)throw r.Yd;return vn(n,i)}):vn(n,i)}(t,i)}function h(i){return function(t,i){return sn(t,i),E(void 0)}(t,i)}function a(){return function(t){var i=t.$f,n=t.Yf,r=n.rv();return cn(n),x(r,function(){if("errored"===i.Ua)throw i.Yd;var t=i.rf;!0===li(t)&&ci(t)},function(n){throw sn(t,n),i.Yd})}(t)}function c(){return function(t){return on(t,!1),t.Jf}(t)}function f(i){return un(t,i),E(void 0)}t.Zf=function(t,i,n,r,e,s){void 0===e&&(e=1),void 0===s&&(s=function(){return 1});var u=b.create(lt.prototype);return wt(u),Ot(u,b.create(Bt.prototype),t,i,n,r,e,s),u}(u,o,a,h,n,r),t.$f=Xi(u,c,f,e,s),t.yf=void 0,t.Jf=void 0,t.hv=void 0,on(t,!0),t.Yf=void 0}(this,S(function(t){h=t}),e,o,u,a),function(t,i){var n=b.create(hn.prototype),r=function(t){try{return fn(n,t),E(void 0)}catch(t){return R(t)}},e=i.transform;if(void 0!==e){if("function"!=typeof e)throw new _("transform is not a method");r=function(t){return l(e,i,[t,n])}}var s=v(i,"flush",0,[n]);!function(t,i,n,r){i.ov=t,t.Yf=i,i.uv=n,i.rv=r}(t,n,r,s)}(this,t);var c=d(t,"start",[this.Yf]);h(c)}return b.defineProperty(t.prototype,"readable",{get:function(){if(!1===en(this))throw ln("readable");return this.$f},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"writable",{get:function(){if(!1===en(this))throw ln("writable");return this.Zf},enumerable:!0,configurable:!0}),t}();function en(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Yf")}function sn(t,i){vi(t.$f.rf,i),un(t,i)}function un(t,i){cn(t.Yf),Ut(t.Zf.vf,i),!0===t.yf&&on(t,!1)}function on(t,i){void 0!==t.Jf&&t.hv(),t.Jf=S(function(i){t.hv=i}),t.yf=i}var hn=function(){function t(){throw new _("TransformStreamDefaultController instances cannot be created directly")}return b.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===an(this))throw dn("desiredSize");return di(this.ov.$f.rf)},enumerable:!0,configurable:!0}),t.prototype.enqueue=function(t){if(!1===an(this))throw dn("enqueue");fn(this,t)},t.prototype.error=function(t){if(!1===an(this))throw dn("error");!function(t,i){sn(t.ov,i)}(this,t)},t.prototype.terminate=function(){if(!1===an(this))throw dn("terminate");!function(t){var i=t.ov,n=i.$f.rf;!0===li(n)&&ci(n);var r=new _("TransformStream terminated");un(i,r)}(this)},t}();function an(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"ov")}function cn(t){t.uv=void 0,t.rv=void 0}function fn(t,i){var n=t.ov,r=n.$f.rf;if(!1===li(r))throw new _("Readable side is not in a state that permits enqueue");try{fi(r,i)}catch(t){throw un(n,t),n.$f.Yd}var e=function(t){return!0!==hi(t)}(r);e!==n.yf&&on(n,!0)}function vn(t,i){return x(t.uv(i),void 0,function(i){throw sn(t.ov,i),i})}function dn(t){return new _("TransformStreamDefaultController.prototype."+t+" can only be used on a TransformStreamDefaultController")}function ln(t){return new _("TransformStream.prototype."+t+" can only be used on a TransformStream")}t.ByteLengthQueuingStrategy=tn,t.CountQueuingStrategy=nn,t.ReadableStream=qi,t.TransformStream=rn,t.WritableStream=lt,b.defineProperty(t,"__esModule",{value:!0})},"object"===(void 0===t?"undefined":W(t))&&void 0!==n?s(t):"function"==typeof define&&define.amd?define(["exports"],s):s((e=e||self).WebStreamsPolyfill={})}),Kt=L(function(t){function i(){var t=$t();return i=function(){return t},t}V(),It(),b.defineProperty(t,"__esModule",{value:!0}),function(t,i){for(var n in i)b.defineProperty(t,n,{enumerable:!0,get:b.getOwnPropertyDescriptor(i,n).get})}(t,{get ByteLengthQueuingStrategy(){return i().ByteLengthQueuingStrategy},get CountQueuingStrategy(){return i().CountQueuingStrategy},get ReadableStream(){return i().ReadableStream},get TransformStream(){return i().TransformStream},get WritableStream(){return i().WritableStream}})});function Jt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jt=function(){return!!t})()}var Zt=M(function(){V(),It()});function ti(t,i,n){return(ti=Jt()?Reflect.construct:function(t,i,n){var r=[null];r.push.apply(r,i);var e=new(Function.bind.apply(t,r));return n&&Rt(e,n.prototype),e}).apply(null,arguments)}var ii=M(function(){V(),It(),Zt(),Ct()});function ni(t){return(ni=b.setPrototypeOf?b.getPrototypeOf:function(t){return t.__proto__||b.getPrototypeOf(t)})(t)}var ri=M(function(){V(),It()});var ei=M(function(){V(),It()});function si(t){var i="function"==typeof Map?new Map:void 0;return si=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new _("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,n)}function n(){return ti(t,arguments,ni(this).constructor)}return n.prototype=b.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Rt(n,t)},si(t)}var ui,oi=M(function(){V(),It(),ii(),ri(),ei(),Ct()}),hi=L(function(t,r){var e,s;V(),I