theoplayer
Version:
THEOplayer is the universal video player solution, enabling you to quickly deliver cross-platform content playback.
40 lines (32 loc) • 2.44 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: 9.10.1
Created: 2025-08-13T16:11:29.716Z
*/
!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,y=t.clearInterval,p=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),N=b.create,P=b.defineProperty,x=b.getOwnPropertyDescriptor,D=b.getOwnPropertyNames,B=b.getPrototypeOf,M=b.prototype.hasOwnProperty,L=function(t,i){return function(){return t&&(i=t(t=0)),i}},O=function(t,i){return function(){return i||t((i={exports:{}}).exports,i),i.exports}},V=function(t,i,n,r){if(i&&"object"==typeof i||"function"==typeof i)for(var e,s=D(i),u=0,o=s.length;u<o;u++)e=s[u],M.call(t,e)||e===n||P(t,e,{get:function(t){return i[t]}.bind(null,e),enumerable:!(r=x(i,e))||r.enumerable});return t},F=function(t,i,n){return n=null!=t?N(B(t)):{},V(!i&&t&&t.__esModule?n:P(n,"default",{value:t,enumerable:!0}),t)},U=L(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 W(t,n){return null!=n&&void 0!==i&&n[i.hasInstance]?!!n[i.hasInstance](t):t instanceof n}var X=L(function(){U(),It()});function Z(t){return t&&void 0!==i&&t.constructor===i?"symbol":typeof t}var G,j,H,z,Y,K,q,J,Q,tt,it,nt,rt,et,st,ut,ot,ht,at,ct,ft=L(function(){U(),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":Z(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":Z(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(!W(this,wt))throw new _("Promises must be constructed via new");if("function"!=typeof t)throw new _("not a function");this.Ra=0,this.tki=!1,this.iTt=void 0,this.iki=[],bt(t,this)}function mt(t,i){for(;3===t.Ra;)t=t.iTt;0!==t.Ra?(t.tki=!0,wt.nki(function(){var n=1===t.Ra?i.onFulfilled:i.onRejected;if(null!==n){var r;try{r=n(t.iTt)}catch(t){return void pt(i.promise,t)}yt(i.promise,r)}else(1===t.Ra?yt:pt)(i.promise,t.iTt)})):t.iki.push(i)}function yt(t,i){try{if(i===t)throw new _("A promise cannot be resolved with itself.");if(i&&("object"===(void 0===i?"undefined":Z(i))||"function"==typeof i)){var n=i.then;if(W(i,wt))return t.Ra=3,t.iTt=i,void _t(t);if("function"==typeof n)return void bt(function(t,i){return function(){t.apply(i,arguments)}}(n,i),t)}t.Ra=1,t.iTt=i,_t(t)}catch(i){pt(t,i)}}function pt(t,i){t.Ra=2,t.iTt=i,_t(t)}function _t(t){2===t.Ra&&0===t.iki.length&&wt.nki(function(){t.tki||wt.rki(t.iTt)});for(var i=0,n=t.iki.length;i<n;i++)mt(t,t.iki[i]);t.iki=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,yt(i,t))},function(t){n||(n=!0,pt(i,t))})}catch(t){if(n)return;n=!0,pt(i,t)}}function At(t){return new nt(it,{reason:t,promise:j.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=L(function(){var t,i,n,r;U(),It(),X(),ft(),G=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":Z(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":Z(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.nki="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){G(t,0)},wt.rki=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},j=function(){var t=self.Promise;if(void 0!==t)try{if(-1!==t.toString().indexOf("[native code]"))return t}catch(t){}}(),H=l?l.userAgent:"",z=H.match(/Firefox\/([0-9]+)/i),Y=null!=z,K=z?Number(z[1]):0,q=H.match(/(Version)\/((\d+)\.(\d+)(?:\.(\d+))?).*Safari/),J=null!=q,Q=q?Number(q[3]):0,tt=function(){function t(t){this.hb=0,this.Ld=0,this.qm=[],this.eki=t}return t.prototype.ski=function(t){var i=this.length();this.uki(i+1);var n=this.Ld+i&this.eki-1;this.qm[n]=t,this.hb=i+1},t.prototype.push=function(t){var i=this.length()+1;if(this.eki<i)this.ski(t);else{var n=this.Ld+i-1,r=this.eki-1;this.qm[n&r]=t,this.hb=i}},t.prototype.shift=function(){var t=this.Ld,i=this.qm[t];return this.qm[t]=void 0,this.Ld=t+1&this.eki-1,this.hb--,i},t.prototype.length=function(){return this.hb},t.prototype.uki=function(t){this.eki<t&&this.oki(this.eki<<1)},t.prototype.oki=function(t){var i=this.eki;this.eki=t;var n=this.Ld+this.hb&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.qm,0,i,n)},t}(),it="unhandledrejection",nt=self.PromiseRejectionEvent,rt=self.CustomEvent,et=function(t){return et=function(){try{var t=j.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=Y&&K<60||J&&Q<15,j&&!ut?(ot=j,ht=function(){}):(ot=wt,at=null!==(st=function(){var t=self.queueMicrotask;if("function"==typeof t)return function(i){return t(i)};var i=j;if(i&&"function"==typeof i.resolve){var n=i.resolve();return function(t){return n.then(t)}}}())&&void 0!==st?st:wt.nki,t=at,i=new tt(16),n=!1,ht=(ct={l6:function(e){i.push(e),n||(n=!0,t(r))},qY:r=function(){for(;i.length()>0;)i.shift()();n=!1}}).qY,wt.nki=ct.l6,wt.rki=function(t){try{var i=et(t);if(!self.dispatchEvent(i)||i.defaultPrevented)return}catch(t){}g(function(){throw new p("Unhandled promise rejection: ".concat(t))},0)})}),It=L(function(){Et()});function Rt(t,i){return(Rt=b.setPrototypeOf||function(t,i){return t.__proto__=i,t})(t,i)}var Ct=L(function(){U(),It()});function Nt(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 Pt=L(function(){U(),It(),Ct()});function xt(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 Dt(t,i,n){return i&&xt(t.prototype,i),n&&xt(t,n),t}var Bt=L(function(){U(),It()});function Mt(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 Lt=L(function(){U(),It()});var Ot=L(function(){U(),It(),Lt()});function Vt(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 Mt(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)?Mt(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 Ft=L(function(){U(),It(),Ot()});function Ut(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 Wt(t){return function(){var i=this,n=arguments;return new ot(function(r,e){var s=t.apply(i,n);function u(t){Ut(s,r,e,u,o,"next",t)}function o(t){Ut(s,r,e,u,o,"throw",t)}u(void 0)})}}var Xt,Zt=L(function(){U(),It()});function Gt(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 jt(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 Ht(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 zt(t){function i(i){t.error=t.hasError?new Xt(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 Yt=L(function(){U(),It(),Xt="function"==typeof SuppressedError?SuppressedError:function(t,i,n){var r=new p(n);return r.name="SuppressedError",r.error=t,r.suppressed=i,r}}),Kt=L(function(){U(),It(),Yt()}),qt=O(function(t,n){var e,s;U(),It(),ft(),e=t,s=function(t){var n="function"==typeof i&&"symbol"===Z(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":Z(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,y=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 y.call(t,i,n)}function N(t,i,n){C(C(t,i,n),void 0,u)}function P(t,i){N(t,i)}function x(t,i){N(t,void 0,i)}function D(t,i,n){return C(t,i,n)}function B(t){C(t,void 0,u)}var M=function(){function t(){this.Rd=0,this.Dd=0,this.Ld={Od:[],Fd:void 0},this.Vd=this.Ld,this.Rd=0,this.Dd=0}return b.defineProperty(t.prototype,"length",{get:function(){return this.Dd},enumerable:!0,configurable:!0}),t.prototype.push=function(t){var i=this.Vd,n=i;16383===i.Od.length&&(n={Od:[],Fd:void 0}),i.Od.push(t),n!==i&&(this.Vd=n,i.Fd=n),++this.Dd},t.prototype.shift=function(){var t=this.Ld,i=t,n=this.Rd,r=n+1,e=t.Od,s=e[n];return 16384===r&&(i=t.Fd,r=0),--this.Dd,this.Rd=r,t!==i&&(this.Ld=i),e[n]=void 0,s},t.prototype.forEach=function(t){for(var i=this.Rd,n=this.Ld,r=n.Od;!(i===r.length&&void 0===n.Fd||i===r.length&&(i=0,0===(r=(n=n.Fd).Od).length));)t(r[i]),++i},t.prototype.peek=function(){var t=this.Ld,i=this.Rd;return t.Od[i]},t}();function L(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 O(t,i){t.Wd=!0,t.Ud=i,i.Gd=t,"readable"===i.Ra?W(t):"closed"===i.Ra?function(t){W(t),j(t)}(t):X(t,i.Xd)}function V(t,i){return qi(t.Ud,i)}function F(t){"readable"===t.Ud.Ra?G(t,new _("Reader was released and can no longer be used to monitor the stream's closedness")):function(t,i){X(t,i)}(t,new _("Reader was released and can no longer be used to monitor the stream's closedness")),t.Ud.Gd=void 0,t.Ud=void 0}function U(t){return new _("Cannot "+t+" a stream using a released reader")}function W(t){t.Zd=S(function(i,n){t.Hd=i,t.zd=n})}function X(t,i){W(t),G(t,i)}function G(t,i){B(t.Zd),t.zd(i),t.Hd=void 0,t.zd=void 0}function j(t){t.Hd(void 0),t.Hd=void 0,t.zd=void 0}var H=n("[[CancelSteps]]"),z=n("[[PullSteps]]");function Y(t,i){void 0===i&&(i=!1);var n=new it(t);return n.Wd=i,n}function K(t){return S(function(i,n){var r={Yd:i,Kd:n};t.Gd.qd.push(r)})}function q(t,i,n){var r=t.Gd;r.qd.shift().Yd(L(i,n,r.Wd))}function J(t){return t.Gd.qd.length}function Q(t){var i=t.Gd;return void 0!==i&&!!nt(i)}var $,tt,it=function(){function t(t){if(!1===Yi(t))throw new _("ReadableStreamDefaultReader can only be constructed with a ReadableStream instance");if(!0===Ki(t))throw new _("This stream has already been locked for exclusive reading by another reader");O(this,t),this.qd=new M}return b.defineProperty(t.prototype,"closed",{get:function(){return nt(this)?this.Zd:R(et("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return nt(this)?void 0===this.Ud?R(U("cancel")):V(this,t):R(et("cancel"))},t.prototype.read=function(){return nt(this)?void 0===this.Ud?R(U("read from")):rt(this):R(et("read"))},t.prototype.releaseLock=function(){if(!nt(this))throw et("releaseLock");if(void 0!==this.Ud){if(this.qd.length>0)throw new _("Tried to release a reader lock when that reader has pending read() calls un-settled");F(this)}},t}();function nt(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"qd")}function rt(t){var i=t.Ud;return i.Qd=!0,"closed"===i.Ra?E(L(void 0,!0,t.Wd)):"errored"===i.Ra?R(i.Xd):i.Jd[z]()}function et(t){return new _("ReadableStreamDefaultReader.prototype."+t+" can only be used on a ReadableStreamDefaultReader")}"symbol"===Z(n.asyncIterator)&&(($={})[n.asyncIterator]=function(){return this},tt=$,b.defineProperty(tt,n.asyncIterator,{enumerable:!1}));var st={next:function(){if(!1===ut(this))return R(ht("next"));var t=this.$d;return void 0===t.Ud?R(U("iterate")):D(rt(t),function(i){var n=i.done;return n&&F(t),L(i.value,n,!0)})},return:function(t){if(!1===ut(this))return R(ht("next"));var i=this.$d;if(void 0===i.Ud)return R(U("finish iterating"));if(i.qd.length>0)return R(new _("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this.ul){var n=V(i,t);return F(i),D(n,function(){return L(t,!0,!0)})}return F(i),E(L(t,!0,!0))}};function ut(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"$d")}function ht(t){return new _("ReadableStreamAsyncIterator."+t+" can only be used on a ReadableSteamAsyncIterator")}function at(t){var i=t.tf.shift();return t.if-=i.size,t.if<0&&(t.if=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.tf.push({value:i,size:n}),t.if+=n}function ft(t){t.tf=new M,t.if=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,[]);Mt(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 Xt("locked");return yt(this)},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===mt(this)?R(Xt("abort")):!0===yt(this)?R(new _("Cannot abort a stream that already has a writer")):pt(this,t)},t.prototype.close=function(){return!1===mt(this)?R(Xt("close")):!0===yt(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 Xt("getWriter");return gt(this)},t}();function gt(t){return new It(t)}function wt(t){t.Ra="writable",t.Xd=void 0,t.ef=void 0,t.nf=void 0,t.rf=new M,t.hf=void 0,t.uf=void 0,t.cf=void 0,t.df=void 0,t.lf=!1}function mt(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"nf")}function yt(t){return void 0!==t.ef}function pt(t,i){var n=t.Ra;if("closed"===n||"errored"===n)return E(void 0);if(void 0!==t.df)return t.df.vf;var r=!1;"erroring"===n&&(r=!0,i=void 0);var e=S(function(n,e){t.df={vf:void 0,Yd:n,Kd:e,_f:i,gf:r}});return t.df.vf=e,!1===r&&bt(t,i),e}function _t(t){var i=t.Ra;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={Yd:i,Kd:n};t.uf=r}),r=t.ef;return void 0!==r&&!0===t.lf&&"writable"===i&&$t(r),function(t){ct(t,"close",0),Vt(t)}(t.nf),n}function kt(t,i){"writable"!==t.Ra?At(t):bt(t,i)}function bt(t,i){var n=t.nf;t.Ra="erroring",t.Xd=i;var r=t.ef;void 0!==r&&Pt(r,i),!1===function(t){return void 0!==t.hf||void 0!==t.cf}(t)&&!0===n.mf&&At(t)}function At(t){t.Ra="errored",t.nf[dt]();var i=t.Xd;if(t.rf.forEach(function(t){t.Kd(i)}),t.rf=new M,void 0!==t.df){var n=t.df;if(t.df=void 0,!0===n.gf)return n.Kd(i),void St(t);N(t.nf[vt](n._f),function(){n.Yd(),St(t)},function(i){n.Kd(i),St(t)})}else St(t)}function Tt(t){return void 0!==t.uf||void 0!==t.cf}function St(t){void 0!==t.uf&&(t.uf.Kd(t.Xd),t.uf=void 0);var i=t.ef;void 0!==i&&zt(i,t.Xd)}function Et(t,i){var n=t.ef;void 0!==n&&i!==t.lf&&(!0===i?function(t){Kt(t)}(n):$t(n)),t.lf=i}var It=function(){function t(t){if(!1===mt(t))throw new _("WritableStreamDefaultWriter can only be constructed with a WritableStream instance");if(!0===yt(t))throw new _("This stream has already been locked for exclusive writing by another writer");this.pf=t,t.ef=this;var i=t.Ra;if("writable"===i)!1===Tt(t)&&!0===t.lf?Kt(this):Jt(this),jt(this);else if("erroring"===i)qt(this,t.Xd),jt(this);else if("closed"===i)Jt(this),function(t){jt(t),Yt(t)}(this);else{var n=t.Xd;qt(this,n),Ht(this,n)}}return b.defineProperty(t.prototype,"closed",{get:function(){return!1===Rt(this)?R(Zt("closed")):this.Zd},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===Rt(this))throw Zt("desiredSize");if(void 0===this.pf)throw Gt("desiredSize");return function(t){var i=t.pf,n=i.Ra;return"errored"===n||"erroring"===n?null:"closed"===n?0:Ot(i.nf)}(this)},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"ready",{get:function(){return!1===Rt(this)?R(Zt("ready")):this.wf},enumerable:!0,configurable:!0}),t.prototype.abort=function(t){return!1===Rt(this)?R(Zt("abort")):void 0===this.pf?R(Gt("abort")):function(t,i){var n=t.pf;return pt(n,i)}(this,t)},t.prototype.close=function(){if(!1===Rt(this))return R(Zt("close"));var t=this.pf;return void 0===t?R(Gt("close")):!0===Tt(t)?R(new _("Cannot close an already-closing stream")):Ct(this)},t.prototype.releaseLock=function(){if(!1===Rt(this))throw Zt("releaseLock");void 0!==this.pf&&xt(this)},t.prototype.write=function(t){return!1===Rt(this)?R(Zt("write")):void 0===this.pf?R(Gt("write to")):Dt(this,t)},t}();function Rt(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"pf")}function Ct(t){return _t(t.pf)}function Nt(t,i){"pending"===t.yf?zt(t,i):function(t,i){Ht(t,i)}(t,i)}function Pt(t,i){"pending"===t.bf?Qt(t,i):function(t,i){qt(t,i)}(t,i)}function xt(t){var i=t.pf,n=new _("Writer was released and can no longer be used to monitor the stream's closedness");Pt(t,n),Nt(t,n),i.ef=void 0,t.pf=void 0}function Dt(t,i){var n=t.pf,r=n.nf,e=function(t,i){try{return t.Af(i)}catch(i){return Ft(t,i),1}}(r,i);if(n!==t.pf)return R(Gt("write to"));var s=n.Ra;if("errored"===s)return R(n.Xd);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.Xd);var u=function(t){return S(function(i,n){var r={Yd:i,Kd:n};t.rf.push(r)})}(n);return function(t,i,n){var r={chunk:i};try{ct(t,r,n)}catch(i){return void Ft(t,i)}var e=t.Sf;!1===Tt(e)&&"writable"===e.Ra&&Et(e,Ut(t)),Vt(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,"Sf")}(this))throw new _("WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController");"writable"===this.Sf.Ra&&Wt(this,t)},t.prototype[vt]=function(t){var i=this.Tf(t);return Lt(this),i},t.prototype[dt]=function(){ft(this)},t}();function Mt(t,i,n,r,e,s,u,o){i.Sf=t,t.nf=i,i.tf=void 0,i.if=void 0,ft(i),i.mf=!1,i.Af=o,i.kf=u,i.Ef=r,i.Rf=e,i.Tf=s;var h=Ut(i);Et(t,h),N(E(n()),function(){i.mf=!0,Vt(i)},function(n){i.mf=!0,kt(t,n)})}function Lt(t){t.Ef=void 0,t.Rf=void 0,t.Tf=void 0,t.Af=void 0}function Ot(t){return t.kf-t.if}function Vt(t){var i=t.Sf;if(!1!==t.mf&&void 0===i.hf)if("erroring"!==i.Ra){if(0!==t.tf.length){var n=function(t){return t.tf.peek().value}(t);"close"===n?function(t){var i=t.Sf;(function(t){t.cf=t.uf,t.uf=void 0})(i),at(t);var n=t.Rf();Lt(t),N(n,function(){!function(t){t.cf.Yd(void 0),t.cf=void 0,"erroring"===t.Ra&&(t.Xd=void 0,void 0!==t.df&&(t.df.Yd(),t.df=void 0)),t.Ra="closed";var i=t.ef;void 0!==i&&Yt(i)}(i)},function(t){!function(t,i){t.cf.Kd(i),t.cf=void 0,void 0!==t.df&&(t.df.Kd(i),t.df=void 0),kt(t,i)}(i,t)})}(t):function(t,i){var n=t.Sf;!function(t){t.hf=t.rf.shift()}(n);var r=t.Ef(i);N(r,function(){!function(t){t.hf.Yd(void 0),t.hf=void 0}(n);var i=n.Ra;if(at(t),!1===Tt(n)&&"writable"===i){var r=Ut(t);Et(n,r)}Vt(t)},function(i){"writable"===n.Ra&&Lt(t),function(t,i){t.hf.Kd(i),t.hf=void 0,kt(t,i)}(n,i)})}(t,n.chunk)}}else At(i)}function Ft(t,i){"writable"===t.Sf.Ra&&Wt(t,i)}function Ut(t){return Ot(t)<=0}function Wt(t,i){var n=t.Sf;Lt(t),bt(n,i)}function Xt(t){return new _("WritableStream.prototype."+t+" can only be used on a WritableStream")}function Zt(t){return new _("WritableStreamDefaultWriter.prototype."+t+" can only be used on a WritableStreamDefaultWriter")}function Gt(t){return new _("Cannot "+t+" a stream using a released writer")}function jt(t){t.Zd=S(function(i,n){t.Hd=i,t.zd=n,t.yf="pending"})}function Ht(t,i){jt(t),zt(t,i)}function zt(t,i){B(t.Zd),t.zd(i),t.Hd=void 0,t.zd=void 0,t.yf="rejected"}function Yt(t){t.Hd(void 0),t.Hd=void 0,t.zd=void 0,t.yf="resolved"}function Kt(t){t.wf=S(function(i,n){t.If=i,t.xf=n}),t.bf="pending"}function qt(t,i){Kt(t),Qt(t,i)}function Jt(t){Kt(t),$t(t)}function Qt(t,i){B(t.wf),t.xf(i),t.If=void 0,t.xf=void 0,t.bf="rejected"}function $t(t){t.If(void 0),t.If=void 0,t.xf=void 0,t.bf="fulfilled"}function ti(t){if("object"!==(void 0===t?"undefined":Z(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":Z(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",p.captureStackTrace&&p.captureStackTrace(this,this.constructor)}).prototype=b.create(p.prototype),b.defineProperty(ii.prototype,"constructor",{value:ii,writable:!0,configurable:!0}),ii);function ei(t,i,n,r,s,u){var o=Y(t),h=gt(i);t.Qd=!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.Ra?pt(i,n):E(void 0)}),!1===s&&e.push(function(){return"readable"===t.Ra?qi(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(p(t,o.Zd,function(t){!1===r?k(function(){return pt(i,t)},!0,t):b(!0,t)}),p(i,h.Zd,function(i){!1===s?k(function(){return qi(t,i)},!0,i):b(!0,i)}),l=t,g=o.Zd,w=function(){!1===n?k(function(){return function(t){var i=t.pf,n=i.Ra;return!0===Tt(i)||"closed"===n?E(void 0):"errored"===n?R(i.Xd):Ct(t)}(h)}):b()},"closed"===l.Ra?w():P(g,w),!0===Tt(i)||"closed"===i.Ra){var m=new _("the destination writable stream closed before all data could be piped to it");!1===s?k(function(){return qi(t,m)},!0,m):b(!0,m)}function y(){var t=c;return C(c,function(){return t!==c?y():void 0})}function p(t,i,n){"errored"===t.Ra?n(t.Xd):x(i,n)}function k(t,n,r){function e(){N(t(),function(){return A(n,r)},function(t){return A(!0,t)})}!0!==a&&(a=!0,"writable"===i.Ra&&!1===Tt(i)?P(y(),e):e())}function b(t,n){!0!==a&&(a=!0,"writable"===i.Ra&&!1===Tt(i)?P(y(),function(){return A(t,n)}):A(t,n))}function A(t,i){xt(h),F(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.wf,function(){return C(rt(o),function(t){return!0===t.done||(c=C(Dt(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[H]=function(t){ft(this);var i=this.Cf(t);return ai(this),i},t.prototype[z]=function(){var t=this.Pf;if(this.tf.length>0){var i=at(this);return!0===this.Nf&&0===this.tf.length?(ai(this),Ji(t)):oi(this),E(L(i,!1,t.Gd.Wd))}var n=K(t);return oi(this),n},t}();function ui(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Pf")}function oi(t){!1!==hi(t)&&(!0!==t.Df?(t.Df=!0,N(t.Bf(),function(){t.Df=!1,!0===t.Lf&&(t.Lf=!1,oi(t))},function(i){vi(t,i)})):t.Lf=!0)}function hi(t){var i=t.Pf;return!1!==li(t)&&!1!==t.mf&&(!0===Ki(i)&&J(i)>0||di(t)>0)}function ai(t){t.Bf=void 0,t.Cf=void 0,t.Af=void 0}function ci(t){var i=t.Pf;t.Nf=!0,0===t.tf.length&&(ai(t),Ji(i))}function fi(t,i){var n=t.Pf;if(!0===Ki(n)&&J(n)>0)q(n,i,!1);else{var r=void 0;try{r=t.Af(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.Pf;"readable"===n.Ra&&(ft(t),ai(t),Qi(n,i))}function di(t){var i=t.Pf.Ra;return"errored"===i?null:"closed"===i?0:t.kf-t.if}function li(t){var i=t.Pf.Ra;return!1===t.Nf&&"readable"===i}function gi(t,i,n,r,e,s,u){i.Pf=t,i.tf=void 0,i.if=void 0,ft(i),i.mf=!1,i.Nf=!1,i.Lf=!1,i.Df=!1,i.Af=u,i.kf=s,i.Bf=r,i.Cf=e,t.Jd=i,N(E(n()),function(){i.mf=!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},yi=function(){function t(){throw new _("ReadableStreamBYOBRequest cannot be used directly")}return b.defineProperty(t.prototype,"view",{get:function(){if(!1===ki(this))throw Oi("view");return this.Mf},enumerable:!0,configurable:!0}),t.prototype.respond=function(t){if(!1===ki(this))throw Oi("respond");if(void 0===this.Of)throw new _("This BYOB request has been invalidated");this.Mf.buffer,function(t,i){if(!1===c(i=Number(i)))throw new RangeError("bytesWritten must be a finite");Pi(t,i)}(this.Of,t)},t.prototype.respondWithNewView=function(t){if(!1===ki(this))throw Oi("respond");if(void 0===this.Of)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.Ff.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,Pi(t,i.byteLength)}(this.Of,t)},t}(),pi=function(){function t(){throw new _("ReadableByteStreamController constructor cannot be used directly")}return b.defineProperty(t.prototype,"byobRequest",{get:function(){if(!1===_i(this))throw Vi("byobRequest");if(void 0===this.Vf&&this.Ff.length>0){var t=this.Ff.peek(),i=new I(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=b.create(yi.prototype);!function(t,i,n){t.Of=i,t.Mf=n}(n,this,i),this.Vf=n}return this.Vf},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"desiredSize",{get:function(){if(!1===_i(this))throw Vi("desiredSize");return Mi(this)},enumerable:!0,configurable:!0}),t.prototype.close=function(){if(!1===_i(this))throw Vi("close");if(!0===this.Nf)throw new _("The stream has already been closed; do not close it again!");var t=this.Wf.Ra;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.Wf;if(t.if>0)t.Nf=!0;else{if(t.Ff.length>0&&t.Ff.peek().bytesFilled>0){var n=new _("Insufficient bytes to fill elements in the given buffer");throw Bi(t,n),n}Di(t),Ji(i)}}(this)},t.prototype.enqueue=function(t){if(!1===_i(this))throw Vi("enqueue");if(!0===this.Nf)throw new _("stream is closed or draining");var i=this.Wf.Ra;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.Wf,r=i.buffer,e=i.byteOffset,s=i.byteLength,u=r;!0===Q(n)?0===J(n)?Si(t,u,e,s):q(n,new I(u,e,s),!1):!0===Wi(n)?(Si(t,u,e,s),Ni(t)):Si(t,u,e,s),bi(t)}(this,t)},t.prototype.error=function(t){if(!1===_i(this))throw Vi("error");Bi(this,t)},t.prototype[H]=function(t){this.Ff.length>0&&(this.Ff.peek().bytesFilled=0),ft(this);var i=this.Cf(t);return Di(this),i},t.prototype[z]=function(){var t=this.Wf;if(this.if>0){var i=this.tf.shift();this.if-=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(L(n,!1,t.Gd.Wd))}var r=this.Uf;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.Ff.push(s)}var u=K(t);return bi(this),u},t}();function _i(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Wf")}function ki(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Of")}function bi(t){var i=function(t){var i=t.Wf;if("readable"!==i.Ra)return!1;if(!0===t.Nf)return!1;if(!1===t.mf)return!1;if(!0===Q(i)&&J(i)>0)return!0;if(!0===Wi(i)&&Ui(i)>0)return!0;var n=Mi(t);return n>0}(t);!1!==i&&(!0!==t.Df?(t.Df=!0,N(t.Bf(),function(){t.Df=!1,!0===t.Lf&&(t.Lf=!1,bi(t))},function(i){Bi(t,i)})):t.Lf=!0)}function Ai(t,i){var n=!1;"closed"===t.Ra&&(n=!0);var r=Ti(i);"default"===i.readerType?q(t,r,n):function(t,i,n){var r=t.Gd,e=r.Gf.shift();e.Yd(L(i,n,r.Wd))}(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.tf.push({buffer:i,byteOffset:n,byteLength:r}),t.if+=r}function Ei(t,i){var n=i.elementSize,r=i.bytesFilled-i.bytesFilled%n,e=A.min(t.if,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.tf;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.if-=v,Ii(t,v,i),o-=v}return h}function Ii(t,i,n){Ci(t),n.bytesFilled+=i}function Ri(t){0===t.if&&!0===t.Nf?(Di(t),Ji(t.Wf)):bi(t)}function Ci(t){void 0!==t.Vf&&(t.Vf.Of=void 0,t.Vf.Mf=void 0,t.Vf=void 0)}function Ni(t){for(;t.Ff.length>0;){if(0===t.if)return;var i=t.Ff.peek();!0===Ei(t,i)&&(xi(t),Ai(t.Wf,i))}}function Pi(t,i){var n=t.Ff.peek();if("closed"===t.Wf.Ra){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.Wf;if(!0===Wi(n))for(;Ui(n)>0;)Ai(n,xi(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)){xi(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.Wf,n),Ni(t)}}(t,i,n);bi(t)}function xi(t){var i=t.Ff.shift();return Ci(t),i}function Di(t){t.Bf=void 0,t.Cf=void 0}function Bi(t,i){var n=t.Wf;"readable"===n.Ra&&(function(t){Ci(t),t.Ff=new M}(t),ft(t),Di(t),Qi(n,i))}function Mi(t){var i=t.Wf.Ra;return"errored"===i?null:"closed"===i?0:t.kf-t.if}function Li(t,i,n){var r=b.create(pi.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.Wf=t,i.Lf=!1,i.Df=!1,i.Vf=void 0,i.tf=i.if=void 0,ft(i),i.Nf=!1,i.mf=!1,i.kf=g(s),i.Bf=r,i.Cf=e,i.Uf=u,i.Ff=new M,t.Jd=i,N(E(n()),function(){i.mf=!0,bi(i)},function(t){Bi(i,t)})}(t,r,function(){return d(i,"start",[r])},e,s,n,u)}function Oi(t){return new _("ReadableStreamBYOBRequest.prototype."+t+" can only be used on a ReadableStreamBYOBRequest")}function Vi(t){return new _("ReadableByteStreamController.prototype."+t+" can only be used on a ReadableByteStreamController")}function Fi(t){return S(function(i,n){var r={Yd:i,Kd:n};t.Gd.Gf.push(r)})}function Ui(t){return t.Gd.Gf.length}function Wi(t){var i=t.Gd;return void 0!==i&&!!Zi(i)}var Xi=function(){function t(t){if(!Yi(t))throw new _("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===_i(t.Jd))throw new _("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(Ki(t))throw new _("This stream has already been locked for exclusive reading by another reader");O(this,t),this.Gf=new M}return b.defineProperty(t.prototype,"closed",{get:function(){return Zi(this)?this.Zd:R(Gi("closed"))},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return Zi(this)?void 0===this.Ud?R(U("cancel")):V(this,t):R(Gi("cancel"))},t.prototype.read=function(t){return Zi(this)?void 0===this.Ud?R(U("read from")):ArrayBuffer.isView(t)?(t.buffer,0===t.byteLength?R(new _("view must have non-zero byteLength")):function(t,i){var n=t.Ud;return n.Qd=!0,"errored"===n.Ra?R(n.Xd):function(t,i){var n=t.Wf,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.Ff.length>0)return t.Ff.push(s),Fi(n);if("closed"===n.Ra)return E(L(new e(s.buffer,s.byteOffset,0),!0,n.Gd.Wd));if(t.if>0){if(!0===Ei(t,s)){var u=Ti(s);return Ri(t),E(L(u,!1,n.Gd.Wd))}if(!0===t.Nf){var o=new _("Insufficient bytes to fill elements in the given buffer");return Bi(t,o),R(o)}}t.Ff.push(s);var h=Fi(n);return bi(t),h}(n.Jd,i)}(this,t)):R(new _("view must be an array buffer view")):R(Gi("read"))},t.prototype.releaseLock=function(){if(!Zi(this))throw Gi("releaseLock");if(void 0!==this.Ud){if(this.Gf.length>0)throw new _("Tried to release a reader lock when that reader has pending read() calls un-settled");F(this)}},t}();function Zi(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Gf")}function Gi(t){return new _("ReadableStreamBYOBReader.prototype."+t+" can only be used on a ReadableStreamBYOBReader")}var ji=function(){function t(t,i){void 0===t&&(t={}),void 0===i&&(i={}),zi(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),Li(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===Yi(this))throw $i("locked");return Ki(this)},enumerable:!0,configurable:!0}),t.prototype.cancel=function(t){return!1===Yi(this)?R($i("cancel")):!0===Ki(this)?R(new _("Cannot cancel a stream that already has a reader")):qi(this,t)},t.prototype.getReader=function(t){var i=(void 0===t?{}:t).mode;if(!1===Yi(this))throw $i("getReader");if(void 0===i)return Y(this,!0);if("byob"===(i=String(i)))return function(t,i){void 0===i&&(i=!1);var n=new Xi(t);return n.Wd=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===Yi(this))throw $i("pipeThrough");if(!1===mt(n))throw new _("writable argument to pipeThrough must be a WritableStream");if(!1===Yi(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===Ki(this))throw new _("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(!0===yt(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===Yi(this)?R($i("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===Ki(this)?R(new _("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):!0===yt(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===Yi(this))throw $i("tee");var t=function(t){var i,n,r,e,s,u=Y(t),o=!1,a=!1,c=!1,f=S(function(t){s=t});function v(){return!0===o||(o=!0,B(D(rt(u),function(t){if(o=!1,!0===t.done)return!1===a&&ci(r.Jd),void(!1===c&&ci(e.Jd));var i=t.value,n=i,s=i;!1===a&&fi(r.Jd,n),!1===c&&fi(e.Jd,s)}))),E(void 0)}function d(){}return r=Hi(d,v,function(r){if(a=!0,i=r,!0===c){var e=h([i,n]),u=qi(t,e);s(u)}return f}),e=Hi(d,v,function(r){if(c=!0,n=r,!0===a){var e=h([i,n]),u=qi(t,e);s(u)}return f}),x(u.Zd,function(t){vi(r.Jd,t),vi(e.Jd,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===Yi(this))throw $i("getIterator");return function(t,i){void 0===i&&(i=!1);var n=Y(t),r=b.create(st);return r.$d=n,r.ul=Boolean(i),r}(this,n)},t}();function Hi(t,i,n,r,e){void 0===r&&(r=1),void 0===e&&(e=function(){return 1});var s=b.create(ji.prototype);return zi(s),gi(s,b.create(si.prototype),t,i,n,r,e),s}function zi(t){t.Ra="readable",t.Gd=void 0,t.Xd=void 0,t.Qd=!1}function Yi(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Jd")}function Ki(t){return void 0!==t.Gd}function qi(t,i){return t.Qd=!0,"closed"===t.Ra?E(void 0):"errored"===t.Ra?R(t.Xd):(Ji(t),D(t.Jd[H](i),e))}function Ji(t){t.Ra="closed";var i=t.Gd;void 0!==i&&(nt(i)&&(i.qd.forEach(function(t){t.Yd(L(void 0,!0,i.Wd))}),i.qd=new M),j(i))}function Qi(t,i){t.Ra="errored",t.Xd=i;var n=t.Gd;void 0!==n&&(nt(n)?(n.qd.forEach(function(t){t.Kd(i)}),n.qd=new M):(n.Gf.forEach(function(t){t.Kd(i)}),n.Gf=new M),G(n,i))}function $i(t){return new _("ReadableStream.prototype."+t+" can only be used on a ReadableStream")}"symbol"===Z(n.asyncIterator)&&b.defineProperty(ji.prototype,n.asyncIterator,{value:ji.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.Xf;return!0===t.lf?D(t.Zf,function(){var r=t.Hf;if("erroring"===r.Ra)throw r.Xd;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.zf,n=t.Xf,r=n.Yf();return cn(n),D(r,function(){if("errored"===i.Ra)throw i.Xd;var t=i.Jd;!0===li(t)&&ci(t)},function(n){throw sn(t,n),i.Xd})}(t)}function c(){return function(t){return on(t,!1),t.Zf}(t)}function f(i){return un(t,i),E(void 0)}t.Hf=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),Mt(u,b.create(Bt.prototype),t,i,n,r,e,s),u}(u,o,a,h,n,r),t.zf=Hi(u,c,f,e,s),t.lf=void 0,t.Zf=void 0,t.Kf=void 0,on(t,!0),t.Xf=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.qf=t,t.Xf=i,i.jf=n,i.Yf=r}(t,n,r,s)}(this,t);var c=d(t,"start",[this.Xf]);h(c)}return b.defineProperty(t.prototype,"readable",{get:function(){if(!1===en(this))throw ln("readable");return this.zf},enumerable:!0,configurable:!0}),b.defineProperty(t.prototype,"writable",{get:function(){if(!1===en(this))throw ln("writable");return this.Hf},enumerable:!0,configurable:!0}),t}();function en(t){return!!o(t)&&!!b.prototype.hasOwnProperty.call(t,"Xf")}function sn(t,i){vi(t.zf.Jd,i),un(t,i)}function un(t,i){cn(t.Xf),Ft(t.Hf.nf,i),!0===t.lf&&on(t,!1)}function on(t,i){void 0!==t.Zf&&t.Kf(),t.Zf=S(function(i){t.Kf=i}),t.lf=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.qf.zf.Jd)},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.qf,i)}(this,t)},t.prototype.terminate=function(){if(!1===an(this))throw dn("terminate");!function(t){var i=t.qf,n=i.zf.Jd;!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,"qf")}function cn(t){t.jf=void 0,t.Yf=void 0}function fn(t,i){var n=t.qf,r=n.zf.Jd;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.zf.Xd}var e=function(t){return!0!==hi(t)}(r);e!==n.lf&&on(n,!0)}function vn(t,i){return D(t.jf(i),void 0,function(i){throw sn(t.qf,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=ji,t.TransformStream=rn,t.WritableStream=lt,b.defineProperty(t,"__esModule",{value:!0})},"object"===(void 0===t?"undefined":Z(t))&&void 0!==n?s(t):"function"==typeof define&&define.amd?define(["exports"],s):s((e=e||self).WebStreamsPolyfill={})}),Jt=O(function(t){function i(){var t=qt();return i=function(){return t},t}U(),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 Qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qt=function(){return!!t})()}var $t=L(function(){U(),It()});function ti(t,i,n){return(ti=Qt()?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=L(function(){U(),It(),$t(),Ct()});function ni(t){return(ni=b.setPrototypeOf?b.getPrototypeOf:function(t){return t.__proto__||b.getPrototypeOf(t)})(t)}var ri=L(function(){U(),It()});var ei=L(function(){U(),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=L(function(){U(),It(),ii(),ri(),ei(),Ct()}),hi=O(function(t,r){var e,s;U(),I