@eluvio/elv-player-js 2.0.21 → 2.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -323,7 +323,7 @@ ${o} ${$Z(e)}
323
323
  * @author Feross Aboukhadijeh <https://feross.org>
324
324
  * @license MIT
325
325
  */(function(n){const e=YP(),t=JP(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=c,n.SlowBuffer=L,n.INSPECT_MAX_BYTES=50;const i=2147483647;n.kMaxLength=i,c.TYPED_ARRAY_SUPPORT=o(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const Z=new Uint8Array(1),H={foo:function(){return 42}};return Object.setPrototypeOf(H,Uint8Array.prototype),Object.setPrototypeOf(Z,H),Z.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function u(Z){if(Z>i)throw new RangeError('The value "'+Z+'" is invalid for option "size"');const H=new Uint8Array(Z);return Object.setPrototypeOf(H,c.prototype),H}function c(Z,H,G){if(typeof Z=="number"){if(typeof H=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(Z)}return p(Z,H,G)}c.poolSize=8192;function p(Z,H,G){if(typeof Z=="string")return b(Z,H);if(ArrayBuffer.isView(Z))return S(Z);if(Z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Z);if(Ne(Z,ArrayBuffer)||Z&&Ne(Z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ne(Z,SharedArrayBuffer)||Z&&Ne(Z.buffer,SharedArrayBuffer)))return A(Z,H,G);if(typeof Z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ge=Z.valueOf&&Z.valueOf();if(ge!=null&&ge!==Z)return c.from(ge,H,G);const xe=T(Z);if(xe)return xe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Z[Symbol.toPrimitive]=="function")return c.from(Z[Symbol.toPrimitive]("string"),H,G);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Z)}c.from=function(Z,H,G){return p(Z,H,G)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function h(Z){if(typeof Z!="number")throw new TypeError('"size" argument must be of type number');if(Z<0)throw new RangeError('The value "'+Z+'" is invalid for option "size"')}function m(Z,H,G){return h(Z),Z<=0?u(Z):H!==void 0?typeof G=="string"?u(Z).fill(H,G):u(Z).fill(H):u(Z)}c.alloc=function(Z,H,G){return m(Z,H,G)};function w(Z){return h(Z),u(Z<0?0:R(Z)|0)}c.allocUnsafe=function(Z){return w(Z)},c.allocUnsafeSlow=function(Z){return w(Z)};function b(Z,H){if((typeof H!="string"||H==="")&&(H="utf8"),!c.isEncoding(H))throw new TypeError("Unknown encoding: "+H);const G=D(Z,H)|0;let ge=u(G);const xe=ge.write(Z,H);return xe!==G&&(ge=ge.slice(0,xe)),ge}function g(Z){const H=Z.length<0?0:R(Z.length)|0,G=u(H);for(let ge=0;ge<H;ge+=1)G[ge]=Z[ge]&255;return G}function S(Z){if(Ne(Z,Uint8Array)){const H=new Uint8Array(Z);return A(H.buffer,H.byteOffset,H.byteLength)}return g(Z)}function A(Z,H,G){if(H<0||Z.byteLength<H)throw new RangeError('"offset" is outside of buffer bounds');if(Z.byteLength<H+(G||0))throw new RangeError('"length" is outside of buffer bounds');let ge;return H===void 0&&G===void 0?ge=new Uint8Array(Z):G===void 0?ge=new Uint8Array(Z,H):ge=new Uint8Array(Z,H,G),Object.setPrototypeOf(ge,c.prototype),ge}function T(Z){if(c.isBuffer(Z)){const H=R(Z.length)|0,G=u(H);return G.length===0||Z.copy(G,0,0,H),G}if(Z.length!==void 0)return typeof Z.length!="number"||Qe(Z.length)?u(0):g(Z);if(Z.type==="Buffer"&&Array.isArray(Z.data))return g(Z.data)}function R(Z){if(Z>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Z|0}function L(Z){return+Z!=Z&&(Z=0),c.alloc(+Z)}c.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==c.prototype},c.compare=function(H,G){if(Ne(H,Uint8Array)&&(H=c.from(H,H.offset,H.byteLength)),Ne(G,Uint8Array)&&(G=c.from(G,G.offset,G.byteLength)),!c.isBuffer(H)||!c.isBuffer(G))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===G)return 0;let ge=H.length,xe=G.length;for(let Re=0,Be=Math.min(ge,xe);Re<Be;++Re)if(H[Re]!==G[Re]){ge=H[Re],xe=G[Re];break}return ge<xe?-1:xe<ge?1:0},c.isEncoding=function(H){switch(String(H).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(H,G){if(!Array.isArray(H))throw new TypeError('"list" argument must be an Array of Buffers');if(H.length===0)return c.alloc(0);let ge;if(G===void 0)for(G=0,ge=0;ge<H.length;++ge)G+=H[ge].length;const xe=c.allocUnsafe(G);let Re=0;for(ge=0;ge<H.length;++ge){let Be=H[ge];if(Ne(Be,Uint8Array))Re+Be.length>xe.length?(c.isBuffer(Be)||(Be=c.from(Be)),Be.copy(xe,Re)):Uint8Array.prototype.set.call(xe,Be,Re);else if(c.isBuffer(Be))Be.copy(xe,Re);else throw new TypeError('"list" argument must be an Array of Buffers');Re+=Be.length}return xe};function D(Z,H){if(c.isBuffer(Z))return Z.length;if(ArrayBuffer.isView(Z)||Ne(Z,ArrayBuffer))return Z.byteLength;if(typeof Z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Z);const G=Z.length,ge=arguments.length>2&&arguments[2]===!0;if(!ge&&G===0)return 0;let xe=!1;for(;;)switch(H){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":return P(Z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G*2;case"hex":return G>>>1;case"base64":return oe(Z).length;default:if(xe)return ge?-1:P(Z).length;H=(""+H).toLowerCase(),xe=!0}}c.byteLength=D;function q(Z,H,G){let ge=!1;if((H===void 0||H<0)&&(H=0),H>this.length||((G===void 0||G>this.length)&&(G=this.length),G<=0)||(G>>>=0,H>>>=0,G<=H))return"";for(Z||(Z="utf8");;)switch(Z){case"hex":return Q(this,H,G);case"utf8":case"utf-8":return _(this,H,G);case"ascii":return F(this,H,G);case"latin1":case"binary":return j(this,H,G);case"base64":return C(this,H,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,H,G);default:if(ge)throw new TypeError("Unknown encoding: "+Z);Z=(Z+"").toLowerCase(),ge=!0}}c.prototype._isBuffer=!0;function W(Z,H,G){const ge=Z[H];Z[H]=Z[G],Z[G]=ge}c.prototype.swap16=function(){const H=this.length;if(H%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let G=0;G<H;G+=2)W(this,G,G+1);return this},c.prototype.swap32=function(){const H=this.length;if(H%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let G=0;G<H;G+=4)W(this,G,G+3),W(this,G+1,G+2);return this},c.prototype.swap64=function(){const H=this.length;if(H%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let G=0;G<H;G+=8)W(this,G,G+7),W(this,G+1,G+6),W(this,G+2,G+5),W(this,G+3,G+4);return this},c.prototype.toString=function(){const H=this.length;return H===0?"":arguments.length===0?_(this,0,H):q.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(H){if(!c.isBuffer(H))throw new TypeError("Argument must be a Buffer");return this===H?!0:c.compare(this,H)===0},c.prototype.inspect=function(){let H="";const G=n.INSPECT_MAX_BYTES;return H=this.toString("hex",0,G).replace(/(.{2})/g,"$1 ").trim(),this.length>G&&(H+=" ... "),"<Buffer "+H+">"},r&&(c.prototype[r]=c.prototype.inspect),c.prototype.compare=function(H,G,ge,xe,Re){if(Ne(H,Uint8Array)&&(H=c.from(H,H.offset,H.byteLength)),!c.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(G===void 0&&(G=0),ge===void 0&&(ge=H?H.length:0),xe===void 0&&(xe=0),Re===void 0&&(Re=this.length),G<0||ge>H.length||xe<0||Re>this.length)throw new RangeError("out of range index");if(xe>=Re&&G>=ge)return 0;if(xe>=Re)return-1;if(G>=ge)return 1;if(G>>>=0,ge>>>=0,xe>>>=0,Re>>>=0,this===H)return 0;let Be=Re-xe,wt=ge-G;const yt=Math.min(Be,wt),gt=this.slice(xe,Re),Et=H.slice(G,ge);for(let Rt=0;Rt<yt;++Rt)if(gt[Rt]!==Et[Rt]){Be=gt[Rt],wt=Et[Rt];break}return Be<wt?-1:wt<Be?1:0};function de(Z,H,G,ge,xe){if(Z.length===0)return-1;if(typeof G=="string"?(ge=G,G=0):G>2147483647?G=2147483647:G<-2147483648&&(G=-2147483648),G=+G,Qe(G)&&(G=xe?0:Z.length-1),G<0&&(G=Z.length+G),G>=Z.length){if(xe)return-1;G=Z.length-1}else if(G<0)if(xe)G=0;else return-1;if(typeof H=="string"&&(H=c.from(H,ge)),c.isBuffer(H))return H.length===0?-1:ce(Z,H,G,ge,xe);if(typeof H=="number")return H=H&255,typeof Uint8Array.prototype.indexOf=="function"?xe?Uint8Array.prototype.indexOf.call(Z,H,G):Uint8Array.prototype.lastIndexOf.call(Z,H,G):ce(Z,[H],G,ge,xe);throw new TypeError("val must be string, number or Buffer")}function ce(Z,H,G,ge,xe){let Re=1,Be=Z.length,wt=H.length;if(ge!==void 0&&(ge=String(ge).toLowerCase(),ge==="ucs2"||ge==="ucs-2"||ge==="utf16le"||ge==="utf-16le")){if(Z.length<2||H.length<2)return-1;Re=2,Be/=2,wt/=2,G/=2}function yt(Et,Rt){return Re===1?Et[Rt]:Et.readUInt16BE(Rt*Re)}let gt;if(xe){let Et=-1;for(gt=G;gt<Be;gt++)if(yt(Z,gt)===yt(H,Et===-1?0:gt-Et)){if(Et===-1&&(Et=gt),gt-Et+1===wt)return Et*Re}else Et!==-1&&(gt-=gt-Et),Et=-1}else for(G+wt>Be&&(G=Be-wt),gt=G;gt>=0;gt--){let Et=!0;for(let Rt=0;Rt<wt;Rt++)if(yt(Z,gt+Rt)!==yt(H,Rt)){Et=!1;break}if(Et)return gt}return-1}c.prototype.includes=function(H,G,ge){return this.indexOf(H,G,ge)!==-1},c.prototype.indexOf=function(H,G,ge){return de(this,H,G,ge,!0)},c.prototype.lastIndexOf=function(H,G,ge){return de(this,H,G,ge,!1)};function me(Z,H,G,ge){G=Number(G)||0;const xe=Z.length-G;ge?(ge=Number(ge),ge>xe&&(ge=xe)):ge=xe;const Re=H.length;ge>Re/2&&(ge=Re/2);let Be;for(Be=0;Be<ge;++Be){const wt=parseInt(H.substr(Be*2,2),16);if(Qe(wt))return Be;Z[G+Be]=wt}return Be}function Se(Z,H,G,ge){return Ee(P(H,Z.length-G),Z,G,ge)}function Ce(Z,H,G,ge){return Ee(U(H),Z,G,ge)}function ne(Z,H,G,ge){return Ee(oe(H),Z,G,ge)}function ke(Z,H,G,ge){return Ee(ee(H,Z.length-G),Z,G,ge)}c.prototype.write=function(H,G,ge,xe){if(G===void 0)xe="utf8",ge=this.length,G=0;else if(ge===void 0&&typeof G=="string")xe=G,ge=this.length,G=0;else if(isFinite(G))G=G>>>0,isFinite(ge)?(ge=ge>>>0,xe===void 0&&(xe="utf8")):(xe=ge,ge=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Re=this.length-G;if((ge===void 0||ge>Re)&&(ge=Re),H.length>0&&(ge<0||G<0)||G>this.length)throw new RangeError("Attempt to write outside buffer bounds");xe||(xe="utf8");let Be=!1;for(;;)switch(xe){case"hex":return me(this,H,G,ge);case"utf8":case"utf-8":return Se(this,H,G,ge);case"ascii":case"latin1":case"binary":return Ce(this,H,G,ge);case"base64":return ne(this,H,G,ge);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,H,G,ge);default:if(Be)throw new TypeError("Unknown encoding: "+xe);xe=(""+xe).toLowerCase(),Be=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(Z,H,G){return H===0&&G===Z.length?e.fromByteArray(Z):e.fromByteArray(Z.slice(H,G))}function _(Z,H,G){G=Math.min(Z.length,G);const ge=[];let xe=H;for(;xe<G;){const Re=Z[xe];let Be=null,wt=Re>239?4:Re>223?3:Re>191?2:1;if(xe+wt<=G){let yt,gt,Et,Rt;switch(wt){case 1:Re<128&&(Be=Re);break;case 2:yt=Z[xe+1],(yt&192)===128&&(Rt=(Re&31)<<6|yt&63,Rt>127&&(Be=Rt));break;case 3:yt=Z[xe+1],gt=Z[xe+2],(yt&192)===128&&(gt&192)===128&&(Rt=(Re&15)<<12|(yt&63)<<6|gt&63,Rt>2047&&(Rt<55296||Rt>57343)&&(Be=Rt));break;case 4:yt=Z[xe+1],gt=Z[xe+2],Et=Z[xe+3],(yt&192)===128&&(gt&192)===128&&(Et&192)===128&&(Rt=(Re&15)<<18|(yt&63)<<12|(gt&63)<<6|Et&63,Rt>65535&&Rt<1114112&&(Be=Rt))}}Be===null?(Be=65533,wt=1):Be>65535&&(Be-=65536,ge.push(Be>>>10&1023|55296),Be=56320|Be&1023),ge.push(Be),xe+=wt}return z(ge)}const O=4096;function z(Z){const H=Z.length;if(H<=O)return String.fromCharCode.apply(String,Z);let G="",ge=0;for(;ge<H;)G+=String.fromCharCode.apply(String,Z.slice(ge,ge+=O));return G}function F(Z,H,G){let ge="";G=Math.min(Z.length,G);for(let xe=H;xe<G;++xe)ge+=String.fromCharCode(Z[xe]&127);return ge}function j(Z,H,G){let ge="";G=Math.min(Z.length,G);for(let xe=H;xe<G;++xe)ge+=String.fromCharCode(Z[xe]);return ge}function Q(Z,H,G){const ge=Z.length;(!H||H<0)&&(H=0),(!G||G<0||G>ge)&&(G=ge);let xe="";for(let Re=H;Re<G;++Re)xe+=st[Z[Re]];return xe}function ae(Z,H,G){const ge=Z.slice(H,G);let xe="";for(let Re=0;Re<ge.length-1;Re+=2)xe+=String.fromCharCode(ge[Re]+ge[Re+1]*256);return xe}c.prototype.slice=function(H,G){const ge=this.length;H=~~H,G=G===void 0?ge:~~G,H<0?(H+=ge,H<0&&(H=0)):H>ge&&(H=ge),G<0?(G+=ge,G<0&&(G=0)):G>ge&&(G=ge),G<H&&(G=H);const xe=this.subarray(H,G);return Object.setPrototypeOf(xe,c.prototype),xe};function N(Z,H,G){if(Z%1!==0||Z<0)throw new RangeError("offset is not uint");if(Z+H>G)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(H,G,ge){H=H>>>0,G=G>>>0,ge||N(H,G,this.length);let xe=this[H],Re=1,Be=0;for(;++Be<G&&(Re*=256);)xe+=this[H+Be]*Re;return xe},c.prototype.readUintBE=c.prototype.readUIntBE=function(H,G,ge){H=H>>>0,G=G>>>0,ge||N(H,G,this.length);let xe=this[H+--G],Re=1;for(;G>0&&(Re*=256);)xe+=this[H+--G]*Re;return xe},c.prototype.readUint8=c.prototype.readUInt8=function(H,G){return H=H>>>0,G||N(H,1,this.length),this[H]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(H,G){return H=H>>>0,G||N(H,2,this.length),this[H]|this[H+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(H,G){return H=H>>>0,G||N(H,2,this.length),this[H]<<8|this[H+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(H,G){return H=H>>>0,G||N(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+this[H+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(H,G){return H=H>>>0,G||N(H,4,this.length),this[H]*16777216+(this[H+1]<<16|this[H+2]<<8|this[H+3])},c.prototype.readBigUInt64LE=xt(function(H){H=H>>>0,ue(H,"offset");const G=this[H],ge=this[H+7];(G===void 0||ge===void 0)&&te(H,this.length-8);const xe=G+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24,Re=this[++H]+this[++H]*2**8+this[++H]*2**16+ge*2**24;return BigInt(xe)+(BigInt(Re)<<BigInt(32))}),c.prototype.readBigUInt64BE=xt(function(H){H=H>>>0,ue(H,"offset");const G=this[H],ge=this[H+7];(G===void 0||ge===void 0)&&te(H,this.length-8);const xe=G*2**24+this[++H]*2**16+this[++H]*2**8+this[++H],Re=this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+ge;return(BigInt(xe)<<BigInt(32))+BigInt(Re)}),c.prototype.readIntLE=function(H,G,ge){H=H>>>0,G=G>>>0,ge||N(H,G,this.length);let xe=this[H],Re=1,Be=0;for(;++Be<G&&(Re*=256);)xe+=this[H+Be]*Re;return Re*=128,xe>=Re&&(xe-=Math.pow(2,8*G)),xe},c.prototype.readIntBE=function(H,G,ge){H=H>>>0,G=G>>>0,ge||N(H,G,this.length);let xe=G,Re=1,Be=this[H+--xe];for(;xe>0&&(Re*=256);)Be+=this[H+--xe]*Re;return Re*=128,Be>=Re&&(Be-=Math.pow(2,8*G)),Be},c.prototype.readInt8=function(H,G){return H=H>>>0,G||N(H,1,this.length),this[H]&128?(255-this[H]+1)*-1:this[H]},c.prototype.readInt16LE=function(H,G){H=H>>>0,G||N(H,2,this.length);const ge=this[H]|this[H+1]<<8;return ge&32768?ge|4294901760:ge},c.prototype.readInt16BE=function(H,G){H=H>>>0,G||N(H,2,this.length);const ge=this[H+1]|this[H]<<8;return ge&32768?ge|4294901760:ge},c.prototype.readInt32LE=function(H,G){return H=H>>>0,G||N(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},c.prototype.readInt32BE=function(H,G){return H=H>>>0,G||N(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},c.prototype.readBigInt64LE=xt(function(H){H=H>>>0,ue(H,"offset");const G=this[H],ge=this[H+7];(G===void 0||ge===void 0)&&te(H,this.length-8);const xe=this[H+4]+this[H+5]*2**8+this[H+6]*2**16+(ge<<24);return(BigInt(xe)<<BigInt(32))+BigInt(G+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24)}),c.prototype.readBigInt64BE=xt(function(H){H=H>>>0,ue(H,"offset");const G=this[H],ge=this[H+7];(G===void 0||ge===void 0)&&te(H,this.length-8);const xe=(G<<24)+this[++H]*2**16+this[++H]*2**8+this[++H];return(BigInt(xe)<<BigInt(32))+BigInt(this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+ge)}),c.prototype.readFloatLE=function(H,G){return H=H>>>0,G||N(H,4,this.length),t.read(this,H,!0,23,4)},c.prototype.readFloatBE=function(H,G){return H=H>>>0,G||N(H,4,this.length),t.read(this,H,!1,23,4)},c.prototype.readDoubleLE=function(H,G){return H=H>>>0,G||N(H,8,this.length),t.read(this,H,!0,52,8)},c.prototype.readDoubleBE=function(H,G){return H=H>>>0,G||N(H,8,this.length),t.read(this,H,!1,52,8)};function k(Z,H,G,ge,xe,Re){if(!c.isBuffer(Z))throw new TypeError('"buffer" argument must be a Buffer instance');if(H>xe||H<Re)throw new RangeError('"value" argument is out of bounds');if(G+ge>Z.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(H,G,ge,xe){if(H=+H,G=G>>>0,ge=ge>>>0,!xe){const wt=Math.pow(2,8*ge)-1;k(this,H,G,ge,wt,0)}let Re=1,Be=0;for(this[G]=H&255;++Be<ge&&(Re*=256);)this[G+Be]=H/Re&255;return G+ge},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(H,G,ge,xe){if(H=+H,G=G>>>0,ge=ge>>>0,!xe){const wt=Math.pow(2,8*ge)-1;k(this,H,G,ge,wt,0)}let Re=ge-1,Be=1;for(this[G+Re]=H&255;--Re>=0&&(Be*=256);)this[G+Re]=H/Be&255;return G+ge},c.prototype.writeUint8=c.prototype.writeUInt8=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,1,255,0),this[G]=H&255,G+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,2,65535,0),this[G]=H&255,this[G+1]=H>>>8,G+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,2,65535,0),this[G]=H>>>8,this[G+1]=H&255,G+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,4,4294967295,0),this[G+3]=H>>>24,this[G+2]=H>>>16,this[G+1]=H>>>8,this[G]=H&255,G+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,4,4294967295,0),this[G]=H>>>24,this[G+1]=H>>>16,this[G+2]=H>>>8,this[G+3]=H&255,G+4};function Y(Z,H,G,ge,xe){pe(H,ge,xe,Z,G,7);let Re=Number(H&BigInt(4294967295));Z[G++]=Re,Re=Re>>8,Z[G++]=Re,Re=Re>>8,Z[G++]=Re,Re=Re>>8,Z[G++]=Re;let Be=Number(H>>BigInt(32)&BigInt(4294967295));return Z[G++]=Be,Be=Be>>8,Z[G++]=Be,Be=Be>>8,Z[G++]=Be,Be=Be>>8,Z[G++]=Be,G}function ie(Z,H,G,ge,xe){pe(H,ge,xe,Z,G,7);let Re=Number(H&BigInt(4294967295));Z[G+7]=Re,Re=Re>>8,Z[G+6]=Re,Re=Re>>8,Z[G+5]=Re,Re=Re>>8,Z[G+4]=Re;let Be=Number(H>>BigInt(32)&BigInt(4294967295));return Z[G+3]=Be,Be=Be>>8,Z[G+2]=Be,Be=Be>>8,Z[G+1]=Be,Be=Be>>8,Z[G]=Be,G+8}c.prototype.writeBigUInt64LE=xt(function(H,G=0){return Y(this,H,G,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=xt(function(H,G=0){return ie(this,H,G,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(H,G,ge,xe){if(H=+H,G=G>>>0,!xe){const yt=Math.pow(2,8*ge-1);k(this,H,G,ge,yt-1,-yt)}let Re=0,Be=1,wt=0;for(this[G]=H&255;++Re<ge&&(Be*=256);)H<0&&wt===0&&this[G+Re-1]!==0&&(wt=1),this[G+Re]=(H/Be>>0)-wt&255;return G+ge},c.prototype.writeIntBE=function(H,G,ge,xe){if(H=+H,G=G>>>0,!xe){const yt=Math.pow(2,8*ge-1);k(this,H,G,ge,yt-1,-yt)}let Re=ge-1,Be=1,wt=0;for(this[G+Re]=H&255;--Re>=0&&(Be*=256);)H<0&&wt===0&&this[G+Re+1]!==0&&(wt=1),this[G+Re]=(H/Be>>0)-wt&255;return G+ge},c.prototype.writeInt8=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,1,127,-128),H<0&&(H=255+H+1),this[G]=H&255,G+1},c.prototype.writeInt16LE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,2,32767,-32768),this[G]=H&255,this[G+1]=H>>>8,G+2},c.prototype.writeInt16BE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,2,32767,-32768),this[G]=H>>>8,this[G+1]=H&255,G+2},c.prototype.writeInt32LE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,4,2147483647,-2147483648),this[G]=H&255,this[G+1]=H>>>8,this[G+2]=H>>>16,this[G+3]=H>>>24,G+4},c.prototype.writeInt32BE=function(H,G,ge){return H=+H,G=G>>>0,ge||k(this,H,G,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[G]=H>>>24,this[G+1]=H>>>16,this[G+2]=H>>>8,this[G+3]=H&255,G+4},c.prototype.writeBigInt64LE=xt(function(H,G=0){return Y(this,H,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=xt(function(H,G=0){return ie(this,H,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(Z,H,G,ge,xe,Re){if(G+ge>Z.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("Index out of range")}function be(Z,H,G,ge,xe){return H=+H,G=G>>>0,xe||$(Z,H,G,4),t.write(Z,H,G,ge,23,4),G+4}c.prototype.writeFloatLE=function(H,G,ge){return be(this,H,G,!0,ge)},c.prototype.writeFloatBE=function(H,G,ge){return be(this,H,G,!1,ge)};function Ie(Z,H,G,ge,xe){return H=+H,G=G>>>0,xe||$(Z,H,G,8),t.write(Z,H,G,ge,52,8),G+8}c.prototype.writeDoubleLE=function(H,G,ge){return Ie(this,H,G,!0,ge)},c.prototype.writeDoubleBE=function(H,G,ge){return Ie(this,H,G,!1,ge)},c.prototype.copy=function(H,G,ge,xe){if(!c.isBuffer(H))throw new TypeError("argument should be a Buffer");if(ge||(ge=0),!xe&&xe!==0&&(xe=this.length),G>=H.length&&(G=H.length),G||(G=0),xe>0&&xe<ge&&(xe=ge),xe===ge||H.length===0||this.length===0)return 0;if(G<0)throw new RangeError("targetStart out of bounds");if(ge<0||ge>=this.length)throw new RangeError("Index out of range");if(xe<0)throw new RangeError("sourceEnd out of bounds");xe>this.length&&(xe=this.length),H.length-G<xe-ge&&(xe=H.length-G+ge);const Re=xe-ge;return this===H&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(G,ge,xe):Uint8Array.prototype.set.call(H,this.subarray(ge,xe),G),Re},c.prototype.fill=function(H,G,ge,xe){if(typeof H=="string"){if(typeof G=="string"?(xe=G,G=0,ge=this.length):typeof ge=="string"&&(xe=ge,ge=this.length),xe!==void 0&&typeof xe!="string")throw new TypeError("encoding must be a string");if(typeof xe=="string"&&!c.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);if(H.length===1){const Be=H.charCodeAt(0);(xe==="utf8"&&Be<128||xe==="latin1")&&(H=Be)}}else typeof H=="number"?H=H&255:typeof H=="boolean"&&(H=Number(H));if(G<0||this.length<G||this.length<ge)throw new RangeError("Out of range index");if(ge<=G)return this;G=G>>>0,ge=ge===void 0?this.length:ge>>>0,H||(H=0);let Re;if(typeof H=="number")for(Re=G;Re<ge;++Re)this[Re]=H;else{const Be=c.isBuffer(H)?H:c.from(H,xe),wt=Be.length;if(wt===0)throw new TypeError('The value "'+H+'" is invalid for argument "value"');for(Re=0;Re<ge-G;++Re)this[Re+G]=Be[Re%wt]}return this};const Me={};function Ue(Z,H,G){Me[Z]=class extends G{constructor(){super(),Object.defineProperty(this,"message",{value:H.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Z}]`,this.stack,delete this.name}get code(){return Z}set code(xe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:xe,writable:!0})}toString(){return`${this.name} [${Z}]: ${this.message}`}}}Ue("ERR_BUFFER_OUT_OF_BOUNDS",function(Z){return Z?`${Z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ue("ERR_INVALID_ARG_TYPE",function(Z,H){return`The "${Z}" argument must be of type number. Received type ${typeof H}`},TypeError),Ue("ERR_OUT_OF_RANGE",function(Z,H,G){let ge=`The value of "${Z}" is out of range.`,xe=G;return Number.isInteger(G)&&Math.abs(G)>2**32?xe=se(String(G)):typeof G=="bigint"&&(xe=String(G),(G>BigInt(2)**BigInt(32)||G<-(BigInt(2)**BigInt(32)))&&(xe=se(xe)),xe+="n"),ge+=` It must be ${H}. Received ${xe}`,ge},RangeError);function se(Z){let H="",G=Z.length;const ge=Z[0]==="-"?1:0;for(;G>=ge+4;G-=3)H=`_${Z.slice(G-3,G)}${H}`;return`${Z.slice(0,G)}${H}`}function fe(Z,H,G){ue(H,"offset"),(Z[H]===void 0||Z[H+G]===void 0)&&te(H,Z.length-(G+1))}function pe(Z,H,G,ge,xe,Re){if(Z>G||Z<H){const Be=typeof H=="bigint"?"n":"";let wt;throw H===0||H===BigInt(0)?wt=`>= 0${Be} and < 2${Be} ** ${(Re+1)*8}${Be}`:wt=`>= -(2${Be} ** ${(Re+1)*8-1}${Be}) and < 2 ** ${(Re+1)*8-1}${Be}`,new Me.ERR_OUT_OF_RANGE("value",wt,Z)}fe(ge,xe,Re)}function ue(Z,H){if(typeof Z!="number")throw new Me.ERR_INVALID_ARG_TYPE(H,"number",Z)}function te(Z,H,G){throw Math.floor(Z)!==Z?(ue(Z,G),new Me.ERR_OUT_OF_RANGE("offset","an integer",Z)):H<0?new Me.ERR_BUFFER_OUT_OF_BOUNDS:new Me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${H}`,Z)}const ye=/[^+/0-9A-Za-z-_]/g;function J(Z){if(Z=Z.split("=")[0],Z=Z.trim().replace(ye,""),Z.length<2)return"";for(;Z.length%4!==0;)Z=Z+"=";return Z}function P(Z,H){H=H||1/0;let G;const ge=Z.length;let xe=null;const Re=[];for(let Be=0;Be<ge;++Be){if(G=Z.charCodeAt(Be),G>55295&&G<57344){if(!xe){if(G>56319){(H-=3)>-1&&Re.push(239,191,189);continue}else if(Be+1===ge){(H-=3)>-1&&Re.push(239,191,189);continue}xe=G;continue}if(G<56320){(H-=3)>-1&&Re.push(239,191,189),xe=G;continue}G=(xe-55296<<10|G-56320)+65536}else xe&&(H-=3)>-1&&Re.push(239,191,189);if(xe=null,G<128){if((H-=1)<0)break;Re.push(G)}else if(G<2048){if((H-=2)<0)break;Re.push(G>>6|192,G&63|128)}else if(G<65536){if((H-=3)<0)break;Re.push(G>>12|224,G>>6&63|128,G&63|128)}else if(G<1114112){if((H-=4)<0)break;Re.push(G>>18|240,G>>12&63|128,G>>6&63|128,G&63|128)}else throw new Error("Invalid code point")}return Re}function U(Z){const H=[];for(let G=0;G<Z.length;++G)H.push(Z.charCodeAt(G)&255);return H}function ee(Z,H){let G,ge,xe;const Re=[];for(let Be=0;Be<Z.length&&!((H-=2)<0);++Be)G=Z.charCodeAt(Be),ge=G>>8,xe=G%256,Re.push(xe),Re.push(ge);return Re}function oe(Z){return e.toByteArray(J(Z))}function Ee(Z,H,G,ge){let xe;for(xe=0;xe<ge&&!(xe+G>=H.length||xe>=Z.length);++xe)H[xe+G]=Z[xe];return xe}function Ne(Z,H){return Z instanceof H||Z!=null&&Z.constructor!=null&&Z.constructor.name!=null&&Z.constructor.name===H.name}function Qe(Z){return Z!==Z}const st=function(){const Z="0123456789abcdef",H=new Array(256);for(let G=0;G<16;++G){const ge=G*16;for(let xe=0;xe<16;++xe)H[ge+xe]=Z[G]+Z[xe]}return H}();function xt(Z){return typeof BigInt>"u"?St:Z}function St(){throw new Error("BigInt not supported")}})(Bd);var ma={ArrayIsArray(n){return Array.isArray(n)},ArrayPrototypeIncludes(n,e){return n.includes(e)},ArrayPrototypeIndexOf(n,e){return n.indexOf(e)},ArrayPrototypeJoin(n,e){return n.join(e)},ArrayPrototypeMap(n,e){return n.map(e)},ArrayPrototypePop(n,e){return n.pop(e)},ArrayPrototypePush(n,e){return n.push(e)},ArrayPrototypeSlice(n,e,t){return n.slice(e,t)},Error,FunctionPrototypeCall(n,e,...t){return n.call(e,...t)},FunctionPrototypeSymbolHasInstance(n,e){return Function.prototype[Symbol.hasInstance].call(n,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(n,e){return Object.defineProperties(n,e)},ObjectDefineProperty(n,e,t){return Object.defineProperty(n,e,t)},ObjectGetOwnPropertyDescriptor(n,e){return Object.getOwnPropertyDescriptor(n,e)},ObjectKeys(n){return Object.keys(n)},ObjectSetPrototypeOf(n,e){return Object.setPrototypeOf(n,e)},Promise,PromisePrototypeCatch(n,e){return n.catch(e)},PromisePrototypeThen(n,e,t){return n.then(e,t)},PromiseReject(n){return Promise.reject(n)},PromiseResolve(n){return Promise.resolve(n)},ReflectApply:Reflect.apply,RegExpPrototypeTest(n,e){return n.test(e)},SafeSet:Set,String,StringPrototypeSlice(n,e,t){return n.slice(e,t)},StringPrototypeToLowerCase(n){return n.toLowerCase()},StringPrototypeToUpperCase(n){return n.toUpperCase()},StringPrototypeTrim(n){return n.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(n,e,t){return n.set(e,t)},Boolean,Uint8Array},CF={exports:{}},zv={exports:{}},cN;function Tb(){if(cN)return zv.exports;cN=1;const{AbortController:n,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return zv.exports=n,zv.exports.AbortSignal=e,zv.exports.default=n,zv.exports}var F4={exports:{}},Hy=typeof Reflect=="object"?Reflect:null,fN=Hy&&typeof Hy.apply=="function"?Hy.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},N_;Hy&&typeof Hy.ownKeys=="function"?N_=Hy.ownKeys:Object.getOwnPropertySymbols?N_=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:N_=function(e){return Object.getOwnPropertyNames(e)};function rae(n){console&&console.warn&&console.warn(n)}var EF=Number.isNaN||function(e){return e!==e};function Ar(){Ar.init.call(this)}F4.exports=Ar;F4.exports.once=oae;Ar.EventEmitter=Ar;Ar.prototype._events=void 0;Ar.prototype._eventsCount=0;Ar.prototype._maxListeners=void 0;var dN=10;function F2(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Ar,"defaultMaxListeners",{enumerable:!0,get:function(){return dN},set:function(n){if(typeof n!="number"||n<0||EF(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");dN=n}});Ar.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Ar.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||EF(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function AF(n){return n._maxListeners===void 0?Ar.defaultMaxListeners:n._maxListeners}Ar.prototype.getMaxListeners=function(){return AF(this)};Ar.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var c=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw c.context=u,c}var p=o[e];if(p===void 0)return!1;if(typeof p=="function")fN(p,this,t);else for(var h=p.length,m=OF(p,h),r=0;r<h;++r)fN(m[r],this,t);return!0};function kF(n,e,t,r){var i,o,u;if(F2(t),o=n._events,o===void 0?(o=n._events=Object.create(null),n._eventsCount=0):(o.newListener!==void 0&&(n.emit("newListener",e,t.listener?t.listener:t),o=n._events),u=o[e]),u===void 0)u=o[e]=t,++n._eventsCount;else if(typeof u=="function"?u=o[e]=r?[t,u]:[u,t]:r?u.unshift(t):u.push(t),i=AF(n),i>0&&u.length>i&&!u.warned){u.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=n,c.type=e,c.count=u.length,rae(c)}return n}Ar.prototype.addListener=function(e,t){return kF(this,e,t,!1)};Ar.prototype.on=Ar.prototype.addListener;Ar.prototype.prependListener=function(e,t){return kF(this,e,t,!0)};function aae(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function MF(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},i=aae.bind(r);return i.listener=t,r.wrapFn=i,i}Ar.prototype.once=function(e,t){return F2(t),this.on(e,MF(this,e,t)),this};Ar.prototype.prependOnceListener=function(e,t){return F2(t),this.prependListener(e,MF(this,e,t)),this};Ar.prototype.removeListener=function(e,t){var r,i,o,u,c;if(F2(t),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(o=-1,u=r.length-1;u>=0;u--)if(r[u]===t||r[u].listener===t){c=r[u].listener,o=u;break}if(o<0)return this;o===0?r.shift():iae(r,o),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this};Ar.prototype.off=Ar.prototype.removeListener;Ar.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var o=Object.keys(r),u;for(i=0;i<o.length;++i)u=o[i],u!=="removeListener"&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function TF(n,e,t){var r=n._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?sae(i):OF(i,i.length)}Ar.prototype.listeners=function(e){return TF(this,e,!0)};Ar.prototype.rawListeners=function(e){return TF(this,e,!1)};Ar.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):RF.call(n,e)};Ar.prototype.listenerCount=RF;function RF(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ar.prototype.eventNames=function(){return this._eventsCount>0?N_(this._events):[]};function OF(n,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=n[r];return t}function iae(n,e){for(;e+1<n.length;e++)n[e]=n[e+1];n.pop()}function sae(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}function oae(n,e){return new Promise(function(t,r){function i(u){n.removeListener(e,o),r(u)}function o(){typeof n.removeListener=="function"&&n.removeListener("error",i),t([].slice.call(arguments))}LF(n,e,o,{once:!0}),e!=="error"&&uae(n,i,{once:!0})})}function uae(n,e,t){typeof n.on=="function"&&LF(n,"error",e,t)}function LF(n,e,t,r){if(typeof n.on=="function")r.once?n.once(e,t):n.on(e,t);else if(typeof n.addEventListener=="function")n.addEventListener(e,function i(o){r.once&&n.removeEventListener(e,i),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}var Gb=F4.exports;(function(n){const e=Bd,{kResistStopPropagation:t,SymbolDispose:r}=ma,i=globalThis.AbortSignal||Tb().AbortSignal,o=globalThis.AbortController||Tb().AbortController,u=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||e.Blob,p=typeof c<"u"?function(g){return g instanceof c}:function(g){return!1},h=(b,g)=>{if(b!==void 0&&(b===null||typeof b!="object"||!("aborted"in b)))throw new ERR_INVALID_ARG_TYPE(g,"AbortSignal",b)},m=(b,g)=>{if(typeof b!="function")throw new ERR_INVALID_ARG_TYPE(g,"Function",b)};class w extends Error{constructor(g){if(!Array.isArray(g))throw new TypeError(`Expected input to be an Array, got ${typeof g}`);let S="";for(let A=0;A<g.length;A++)S+=` ${g[A].stack}
326
- `;super(S),this.name="AggregateError",this.errors=g}}n.exports={AggregateError:w,kEmptyObject:Object.freeze({}),once(b){let g=!1;return function(...S){g||(g=!0,b.apply(this,S))}},createDeferredPromise:function(){let b,g;return{promise:new Promise((A,T)=>{b=A,g=T}),resolve:b,reject:g}},promisify(b){return new Promise((g,S)=>{b((A,...T)=>A?S(A):g(...T))})},debuglog(){return function(){}},format(b,...g){return b.replace(/%([sdifj])/g,function(...[S,A]){const T=g.shift();return A==="f"?T.toFixed(6):A==="j"?JSON.stringify(T):A==="s"&&typeof T=="object"?`${T.constructor!==Object?T.constructor.name:""} {}`.trim():T.toString()})},inspect(b){switch(typeof b){case"string":if(b.includes("'"))if(b.includes('"')){if(!b.includes("`")&&!b.includes("${"))return`\`${b}\``}else return`"${b}"`;return`'${b}'`;case"number":return isNaN(b)?"NaN":Object.is(b,-0)?String(b):b;case"bigint":return`${String(b)}n`;case"boolean":case"undefined":return String(b);case"object":return"{}"}},types:{isAsyncFunction(b){return b instanceof u},isArrayBufferView(b){return ArrayBuffer.isView(b)}},isBlob:p,deprecate(b,g){return b},addAbortListener:Gb.addAbortListener||function(g,S){if(g===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",g);h(g,"signal"),m(S,"listener");let A;return g.aborted?queueMicrotask(()=>S()):(g.addEventListener("abort",S,{__proto__:null,once:!0,[t]:!0}),A=()=>{g.removeEventListener("abort",S)}),{__proto__:null,[r](){var T;(T=A)===null||T===void 0||T()}}},AbortSignalAny:i.any||function(g){if(g.length===1)return g[0];const S=new o,A=()=>S.abort();return g.forEach(T=>{h(T,"signals"),T.addEventListener("abort",A,{once:!0})}),S.signal.addEventListener("abort",()=>{g.forEach(T=>T.removeEventListener("abort",A))},{once:!0}),S.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(CF);var _s=CF.exports,B4={};const{format:lae,inspect:X_,AggregateError:cae}=_s,fae=globalThis.AggregateError||cae,dae=Symbol("kIsNodeError"),pae=["string","function","number","object","Function","Object","boolean","bigint","symbol"],hae=/^([A-Z][a-z0-9]*)+$/,yae="__node_internal_",B2={};function oh(n,e){if(!n)throw new B2.ERR_INTERNAL_ASSERTION(e)}function pN(n){let e="",t=n.length;const r=n[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${n.slice(t-3,t)}${e}`;return`${n.slice(0,t)}${e}`}function mae(n,e,t){if(typeof e=="function")return oh(e.length<=t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${e.length}).`),e(...t);const r=(e.match(/%[dfijoOs]/g)||[]).length;return oh(r===t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${r}).`),t.length===0?e:lae(e,...t)}function Mi(n,e,t){t||(t=Error);class r extends t{constructor(...o){super(mae(n,e,o))}toString(){return`${this.name} [${n}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:t.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${n}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=n,r.prototype[dae]=!0,B2[n]=r}function hN(n){const e=yae+n.name;return Object.defineProperty(n,"name",{value:e}),n}function gae(n,e){if(n&&e&&n!==e){if(Array.isArray(e.errors))return e.errors.push(n),e;const t=new fae([e,n],e.message);return t.code=e.code,t}return n||e}let vae=class extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!="object")throw new B2.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};Mi("ERR_ASSERTION","%s",Error);Mi("ERR_INVALID_ARG_TYPE",(n,e,t)=>{oh(typeof n=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";n.endsWith(" argument")?r+=`${n} `:r+=`"${n}" ${n.includes(".")?"property":"argument"} `,r+="must be ";const i=[],o=[],u=[];for(const p of e)oh(typeof p=="string","All expected entries have to be of type string"),pae.includes(p)?i.push(p.toLowerCase()):hae.test(p)?o.push(p):(oh(p!=="object",'The value "object" should be written as "Object"'),u.push(p));if(o.length>0){const p=i.indexOf("object");p!==-1&&(i.splice(i,p,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:r+=`of type ${i[0]}`;break;case 2:r+=`one of type ${i[0]} or ${i[1]}`;break;default:{const p=i.pop();r+=`one of type ${i.join(", ")}, or ${p}`}}(o.length>0||u.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const p=o.pop();r+=`an instance of ${o.join(", ")}, or ${p}`}}u.length>0&&(r+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(r+="an "),r+=`${u[0]}`;break;case 2:r+=`one of ${u[0]} or ${u[1]}`;break;default:{const p=u.pop();r+=`one of ${u.join(", ")}, or ${p}`}}if(t==null)r+=`. Received ${t}`;else if(typeof t=="function"&&t.name)r+=`. Received function ${t.name}`;else if(typeof t=="object"){var c;if((c=t.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${t.constructor.name}`;else{const p=X_(t,{depth:-1});r+=`. Received ${p}`}}else{let p=X_(t,{colors:!1});p.length>25&&(p=`${p.slice(0,25)}...`),r+=`. Received type ${typeof t} (${p})`}return r},TypeError);Mi("ERR_INVALID_ARG_VALUE",(n,e,t="is invalid")=>{let r=X_(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${n.includes(".")?"property":"argument"} '${n}' ${t}. Received ${r}`},TypeError);Mi("ERR_INVALID_RETURN_VALUE",(n,e,t)=>{var r;const i=t!=null&&(r=t.constructor)!==null&&r!==void 0&&r.name?`instance of ${t.constructor.name}`:`type ${typeof t}`;return`Expected ${n} to be returned from the "${e}" function but got ${i}.`},TypeError);Mi("ERR_MISSING_ARGS",(...n)=>{oh(n.length>0,"At least one arg needs to be specified");let e;const t=n.length;switch(n=(Array.isArray(n)?n:[n]).map(r=>`"${r}"`).join(" or "),t){case 1:e+=`The ${n[0]} argument`;break;case 2:e+=`The ${n[0]} and ${n[1]} arguments`;break;default:{const r=n.pop();e+=`The ${n.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);Mi("ERR_OUT_OF_RANGE",(n,e,t)=>{oh(e,'Missing "range" argument');let r;return Number.isInteger(t)&&Math.abs(t)>2**32?r=pN(String(t)):typeof t=="bigint"?(r=String(t),(t>2n**32n||t<-(2n**32n))&&(r=pN(r)),r+="n"):r=X_(t),`The value of "${n}" is out of range. It must be ${e}. Received ${r}`},RangeError);Mi("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Mi("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Mi("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Mi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Mi("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Mi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Mi("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Mi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Mi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Mi("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Mi("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var Xs={AbortError:vae,aggregateTwoErrors:hN(gae),hideStackFrames:hN,codes:B2};const{ArrayIsArray:z4,ArrayPrototypeIncludes:NF,ArrayPrototypeJoin:PF,ArrayPrototypeMap:bae,NumberIsInteger:j4,NumberIsNaN:wae,NumberMAX_SAFE_INTEGER:xae,NumberMIN_SAFE_INTEGER:_ae,NumberParseInt:Sae,ObjectPrototypeHasOwnProperty:Cae,RegExpPrototypeExec:IF,String:Eae,StringPrototypeToUpperCase:Aae,StringPrototypeTrim:kae}=ma,{hideStackFrames:Ko,codes:{ERR_SOCKET_BAD_PORT:Mae,ERR_INVALID_ARG_TYPE:rs,ERR_INVALID_ARG_VALUE:bm,ERR_OUT_OF_RANGE:yh,ERR_UNKNOWN_SIGNAL:yN}}=Xs,{normalizeEncoding:Tae}=_s,{isAsyncFunction:Rae,isArrayBufferView:Oae}=_s.types,mN={};function Lae(n){return n===(n|0)}function Nae(n){return n===n>>>0}const Pae=/^[0-7]+$/,Iae="must be a 32-bit unsigned integer or an octal string";function Dae(n,e,t){if(typeof n>"u"&&(n=t),typeof n=="string"){if(IF(Pae,n)===null)throw new bm(e,n,Iae);n=Sae(n,8)}return DF(n,e),n}const Uae=Ko((n,e,t=_ae,r=xae)=>{if(typeof n!="number")throw new rs(e,"number",n);if(!j4(n))throw new yh(e,"an integer",n);if(n<t||n>r)throw new yh(e,`>= ${t} && <= ${r}`,n)}),Fae=Ko((n,e,t=-2147483648,r=2147483647)=>{if(typeof n!="number")throw new rs(e,"number",n);if(!j4(n))throw new yh(e,"an integer",n);if(n<t||n>r)throw new yh(e,`>= ${t} && <= ${r}`,n)}),DF=Ko((n,e,t=!1)=>{if(typeof n!="number")throw new rs(e,"number",n);if(!j4(n))throw new yh(e,"an integer",n);const r=t?1:0,i=4294967295;if(n<r||n>i)throw new yh(e,`>= ${r} && <= ${i}`,n)});function $4(n,e){if(typeof n!="string")throw new rs(e,"string",n)}function Bae(n,e,t=void 0,r){if(typeof n!="number")throw new rs(e,"number",n);if(t!=null&&n<t||r!=null&&n>r||(t!=null||r!=null)&&wae(n))throw new yh(e,`${t!=null?`>= ${t}`:""}${t!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,n)}const zae=Ko((n,e,t)=>{if(!NF(t,n)){const i="must be one of: "+PF(bae(t,o=>typeof o=="string"?`'${o}'`:Eae(o)),", ");throw new bm(e,n,i)}});function UF(n,e){if(typeof n!="boolean")throw new rs(e,"boolean",n)}function h5(n,e,t){return n==null||!Cae(n,e)?t:n[e]}const jae=Ko((n,e,t=null)=>{const r=h5(t,"allowArray",!1),i=h5(t,"allowFunction",!1);if(!h5(t,"nullable",!1)&&n===null||!r&&z4(n)||typeof n!="object"&&(!i||typeof n!="function"))throw new rs(e,"Object",n)}),$ae=Ko((n,e)=>{if(n!=null&&typeof n!="object"&&typeof n!="function")throw new rs(e,"a dictionary",n)}),z2=Ko((n,e,t=0)=>{if(!z4(n))throw new rs(e,"Array",n);if(n.length<t){const r=`must be longer than ${t}`;throw new bm(e,n,r)}});function Hae(n,e){z2(n,e);for(let t=0;t<n.length;t++)$4(n[t],`${e}[${t}]`)}function qae(n,e){z2(n,e);for(let t=0;t<n.length;t++)UF(n[t],`${e}[${t}]`)}function Vae(n,e){z2(n,e);for(let t=0;t<n.length;t++){const r=n[t],i=`${e}[${t}]`;if(r==null)throw new rs(i,"AbortSignal",r);FF(r,i)}}function Gae(n,e="signal"){if($4(n,e),mN[n]===void 0)throw mN[Aae(n)]!==void 0?new yN(n+" (signals must use all capital letters)"):new yN(n)}const Wae=Ko((n,e="buffer")=>{if(!Oae(n))throw new rs(e,["Buffer","TypedArray","DataView"],n)});function Kae(n,e){const t=Tae(e),r=n.length;if(t==="hex"&&r%2!==0)throw new bm("encoding",e,`is invalid for data of length ${r}`)}function Yae(n,e="Port",t=!0){if(typeof n!="number"&&typeof n!="string"||typeof n=="string"&&kae(n).length===0||+n!==+n>>>0||n>65535||n===0&&!t)throw new Mae(e,n,t);return n|0}const FF=Ko((n,e)=>{if(n!==void 0&&(n===null||typeof n!="object"||!("aborted"in n)))throw new rs(e,"AbortSignal",n)}),Jae=Ko((n,e)=>{if(typeof n!="function")throw new rs(e,"Function",n)}),Qae=Ko((n,e)=>{if(typeof n!="function"||Rae(n))throw new rs(e,"Function",n)}),Zae=Ko((n,e)=>{if(n!==void 0)throw new rs(e,"undefined",n)});function Xae(n,e,t){if(!NF(t,n))throw new rs(e,`('${PF(t,"|")}')`,n)}const eie=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function gN(n,e){if(typeof n>"u"||!IF(eie,n))throw new bm(e,n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function tie(n){if(typeof n=="string")return gN(n,"hints"),n;if(z4(n)){const e=n.length;let t="";if(e===0)return t;for(let r=0;r<e;r++){const i=n[r];gN(i,"hints"),t+=i,r!==e-1&&(t+=", ")}return t}throw new bm("hints",n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var Wb={isInt32:Lae,isUint32:Nae,parseFileMode:Dae,validateArray:z2,validateStringArray:Hae,validateBooleanArray:qae,validateAbortSignalArray:Vae,validateBoolean:UF,validateBuffer:Wae,validateDictionary:$ae,validateEncoding:Kae,validateFunction:Jae,validateInt32:Fae,validateInteger:Uae,validateNumber:Bae,validateObject:jae,validateOneOf:zae,validatePlainFunction:Qae,validatePort:Yae,validateSignalName:Gae,validateString:$4,validateUint32:DF,validateUndefined:Zae,validateUnion:Xae,validateAbortSignal:FF,validateLinkHeaderValue:tie},H4={exports:{}},y5={exports:{}},vN;function zd(){if(vN)return y5.exports;vN=1;var n=y5.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function o(A){if(e===setTimeout)return setTimeout(A,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch{try{return e.call(null,A,0)}catch{return e.call(this,A,0)}}}function u(A){if(t===clearTimeout)return clearTimeout(A);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(A);try{return t(A)}catch{try{return t.call(null,A)}catch{return t.call(this,A)}}}var c=[],p=!1,h,m=-1;function w(){!p||!h||(p=!1,h.length?c=h.concat(c):m=-1,c.length&&b())}function b(){if(!p){var A=o(w);p=!0;for(var T=c.length;T;){for(h=c,c=[];++m<T;)h&&h[m].run();m=-1,T=c.length}h=null,p=!1,u(A)}}n.nextTick=function(A){var T=new Array(arguments.length-1);if(arguments.length>1)for(var R=1;R<arguments.length;R++)T[R-1]=arguments[R];c.push(new g(A,T)),c.length===1&&!p&&o(b)};function g(A,T){this.fun=A,this.array=T}g.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function S(){}return n.on=S,n.addListener=S,n.once=S,n.off=S,n.removeListener=S,n.removeAllListeners=S,n.emit=S,n.prependListener=S,n.prependOnceListener=S,n.listeners=function(A){return[]},n.binding=function(A){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(A){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},y5.exports}const{SymbolAsyncIterator:bN,SymbolIterator:wN,SymbolFor:kh}=ma,BF=kh("nodejs.stream.destroyed"),zF=kh("nodejs.stream.errored"),C8=kh("nodejs.stream.readable"),E8=kh("nodejs.stream.writable"),jF=kh("nodejs.stream.disturbed"),nie=kh("nodejs.webstream.isClosedPromise"),rie=kh("nodejs.webstream.controllerErrorFunction");function j2(n,e=!1){var t;return!!(n&&typeof n.pipe=="function"&&typeof n.on=="function"&&(!e||typeof n.pause=="function"&&typeof n.resume=="function")&&(!n._writableState||((t=n._readableState)===null||t===void 0?void 0:t.readable)!==!1)&&(!n._writableState||n._readableState))}function $2(n){var e;return!!(n&&typeof n.write=="function"&&typeof n.on=="function"&&(!n._readableState||((e=n._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function aie(n){return!!(n&&typeof n.pipe=="function"&&n._readableState&&typeof n.on=="function"&&typeof n.write=="function")}function Yl(n){return n&&(n._readableState||n._writableState||typeof n.write=="function"&&typeof n.on=="function"||typeof n.pipe=="function"&&typeof n.on=="function")}function $F(n){return!!(n&&!Yl(n)&&typeof n.pipeThrough=="function"&&typeof n.getReader=="function"&&typeof n.cancel=="function")}function HF(n){return!!(n&&!Yl(n)&&typeof n.getWriter=="function"&&typeof n.abort=="function")}function qF(n){return!!(n&&!Yl(n)&&typeof n.readable=="object"&&typeof n.writable=="object")}function iie(n){return $F(n)||HF(n)||qF(n)}function sie(n,e){return n==null?!1:e===!0?typeof n[bN]=="function":e===!1?typeof n[wN]=="function":typeof n[bN]=="function"||typeof n[wN]=="function"}function H2(n){if(!Yl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!!(n.destroyed||n[BF]||r!=null&&r.destroyed)}function VF(n){if(!$2(n))return null;if(n.writableEnded===!0)return!0;const e=n._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function oie(n,e){if(!$2(n))return null;if(n.writableFinished===!0)return!0;const t=n._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.finished)!="boolean"?null:!!(t.finished||e===!1&&t.ended===!0&&t.length===0)}function uie(n){if(!j2(n))return null;if(n.readableEnded===!0)return!0;const e=n._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function GF(n,e){if(!j2(n))return null;const t=n._readableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.endEmitted)!="boolean"?null:!!(t.endEmitted||e===!1&&t.ended===!0&&t.length===0)}function WF(n){return n&&n[C8]!=null?n[C8]:typeof(n==null?void 0:n.readable)!="boolean"?null:H2(n)?!1:j2(n)&&n.readable&&!GF(n)}function KF(n){return n&&n[E8]!=null?n[E8]:typeof(n==null?void 0:n.writable)!="boolean"?null:H2(n)?!1:$2(n)&&n.writable&&!VF(n)}function lie(n,e){return Yl(n)?H2(n)?!0:!((e==null?void 0:e.readable)!==!1&&WF(n)||(e==null?void 0:e.writable)!==!1&&KF(n)):null}function cie(n){var e,t;return Yl(n)?n.writableErrored?n.writableErrored:(e=(t=n._writableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function fie(n){var e,t;return Yl(n)?n.readableErrored?n.readableErrored:(e=(t=n._readableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function die(n){if(!Yl(n))return null;if(typeof n.closed=="boolean")return n.closed;const e=n._writableState,t=n._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(t==null?void 0:t.closed)=="boolean"?(e==null?void 0:e.closed)||(t==null?void 0:t.closed):typeof n._closed=="boolean"&&YF(n)?n._closed:null}function YF(n){return typeof n._closed=="boolean"&&typeof n._defaultKeepAlive=="boolean"&&typeof n._removedConnection=="boolean"&&typeof n._removedContLen=="boolean"}function JF(n){return typeof n._sent100=="boolean"&&YF(n)}function pie(n){var e;return typeof n._consuming=="boolean"&&typeof n._dumped=="boolean"&&((e=n.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function hie(n){if(!Yl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!r&&JF(n)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function yie(n){var e;return!!(n&&((e=n[jF])!==null&&e!==void 0?e:n.readableDidRead||n.readableAborted))}function mie(n){var e,t,r,i,o,u,c,p,h,m;return!!(n&&((e=(t=(r=(i=(o=(u=n[zF])!==null&&u!==void 0?u:n.readableErrored)!==null&&o!==void 0?o:n.writableErrored)!==null&&i!==void 0?i:(c=n._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(p=n._writableState)===null||p===void 0?void 0:p.errorEmitted)!==null&&t!==void 0?t:(h=n._readableState)===null||h===void 0?void 0:h.errored)!==null&&e!==void 0?e:!((m=n._writableState)===null||m===void 0)&&m.errored))}var Xc={isDestroyed:H2,kIsDestroyed:BF,isDisturbed:yie,kIsDisturbed:jF,isErrored:mie,kIsErrored:zF,isReadable:WF,kIsReadable:C8,kIsClosedPromise:nie,kControllerErrorFunction:rie,kIsWritable:E8,isClosed:die,isDuplexNodeStream:aie,isFinished:lie,isIterable:sie,isReadableNodeStream:j2,isReadableStream:$F,isReadableEnded:uie,isReadableFinished:GF,isReadableErrored:fie,isNodeStream:Yl,isWebStream:iie,isWritable:KF,isWritableNodeStream:$2,isWritableStream:HF,isWritableEnded:VF,isWritableFinished:oie,isWritableErrored:cie,isServerRequest:pie,isServerResponse:JF,willEmitClose:hie,isTransformStream:qF};const vd=zd(),{AbortError:QF,codes:gie}=Xs,{ERR_INVALID_ARG_TYPE:vie,ERR_STREAM_PREMATURE_CLOSE:xN}=gie,{kEmptyObject:A8,once:k8}=_s,{validateAbortSignal:bie,validateFunction:wie,validateObject:xie,validateBoolean:_ie}=Wb,{Promise:Sie,PromisePrototypeThen:Cie,SymbolDispose:ZF}=ma,{isClosed:Eie,isReadable:_N,isReadableNodeStream:m5,isReadableStream:Aie,isReadableFinished:SN,isReadableErrored:CN,isWritable:EN,isWritableNodeStream:AN,isWritableStream:kie,isWritableFinished:kN,isWritableErrored:MN,isNodeStream:Mie,willEmitClose:Tie,kIsClosedPromise:Rie}=Xc;let qy;function Oie(n){return n.setHeader&&typeof n.abort=="function"}const M8=()=>{};function XF(n,e,t){var r,i;if(arguments.length===2?(t=e,e=A8):e==null?e=A8:xie(e,"options"),wie(t,"callback"),bie(e.signal,"options.signal"),t=k8(t),Aie(n)||kie(n))return Lie(n,e,t);if(!Mie(n))throw new vie("stream",["ReadableStream","WritableStream","Stream"],n);const o=(r=e.readable)!==null&&r!==void 0?r:m5(n),u=(i=e.writable)!==null&&i!==void 0?i:AN(n),c=n._writableState,p=n._readableState,h=()=>{n.writable||b()};let m=Tie(n)&&m5(n)===o&&AN(n)===u,w=kN(n,!1);const b=()=>{w=!0,n.destroyed&&(m=!1),!(m&&(!n.readable||o))&&(!o||g)&&t.call(n)};let g=SN(n,!1);const S=()=>{g=!0,n.destroyed&&(m=!1),!(m&&(!n.writable||u))&&(!u||w)&&t.call(n)},A=W=>{t.call(n,W)};let T=Eie(n);const R=()=>{T=!0;const W=MN(n)||CN(n);if(W&&typeof W!="boolean")return t.call(n,W);if(o&&!g&&m5(n,!0)&&!SN(n,!1))return t.call(n,new xN);if(u&&!w&&!kN(n,!1))return t.call(n,new xN);t.call(n)},L=()=>{T=!0;const W=MN(n)||CN(n);if(W&&typeof W!="boolean")return t.call(n,W);t.call(n)},D=()=>{n.req.on("finish",b)};Oie(n)?(n.on("complete",b),m||n.on("abort",R),n.req?D():n.on("request",D)):u&&!c&&(n.on("end",h),n.on("close",h)),!m&&typeof n.aborted=="boolean"&&n.on("aborted",R),n.on("end",S),n.on("finish",b),e.error!==!1&&n.on("error",A),n.on("close",R),T?vd.nextTick(R):c!=null&&c.errorEmitted||p!=null&&p.errorEmitted?m||vd.nextTick(L):(!o&&(!m||_N(n))&&(w||EN(n)===!1)||!u&&(!m||EN(n))&&(g||_N(n)===!1)||p&&n.req&&n.aborted)&&vd.nextTick(L);const q=()=>{t=M8,n.removeListener("aborted",R),n.removeListener("complete",b),n.removeListener("abort",R),n.removeListener("request",D),n.req&&n.req.removeListener("finish",b),n.removeListener("end",h),n.removeListener("close",h),n.removeListener("finish",b),n.removeListener("end",S),n.removeListener("error",A),n.removeListener("close",R)};if(e.signal&&!T){const W=()=>{const de=t;q(),de.call(n,new QF(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)vd.nextTick(W);else{qy=qy||_s.addAbortListener;const de=qy(e.signal,W),ce=t;t=k8((...me)=>{de[ZF](),ce.apply(n,me)})}}return q}function Lie(n,e,t){let r=!1,i=M8;if(e.signal)if(i=()=>{r=!0,t.call(n,new QF(void 0,{cause:e.signal.reason}))},e.signal.aborted)vd.nextTick(i);else{qy=qy||_s.addAbortListener;const u=qy(e.signal,i),c=t;t=k8((...p)=>{u[ZF](),c.apply(n,p)})}const o=(...u)=>{r||vd.nextTick(()=>t.apply(n,u))};return Cie(n[Rie].promise,o,o),M8}function Nie(n,e){var t;let r=!1;return e===null&&(e=A8),(t=e)!==null&&t!==void 0&&t.cleanup&&(_ie(e.cleanup,"cleanup"),r=e.cleanup),new Sie((i,o)=>{const u=XF(n,e,c=>{r&&u(),c?o(c):i()})})}H4.exports=XF;H4.exports.finished=Nie;var jd=H4.exports;const Bl=zd(),{aggregateTwoErrors:Pie,codes:{ERR_MULTIPLE_CALLBACK:Iie},AbortError:Die}=Xs,{Symbol:eB}=ma,{kIsDestroyed:Uie,isDestroyed:Fie,isFinished:Bie,isServerRequest:zie}=Xc,tB=eB("kDestroy"),T8=eB("kConstruct");function nB(n,e,t){n&&(n.stack,e&&!e.errored&&(e.errored=n),t&&!t.errored&&(t.errored=n))}function jie(n,e){const t=this._readableState,r=this._writableState,i=r||t;return r!=null&&r.destroyed||t!=null&&t.destroyed?(typeof e=="function"&&e(),this):(nB(n,r,t),r&&(r.destroyed=!0),t&&(t.destroyed=!0),i.constructed?TN(this,n,e):this.once(tB,function(o){TN(this,Pie(o,n),e)}),this)}function TN(n,e,t){let r=!1;function i(o){if(r)return;r=!0;const u=n._readableState,c=n._writableState;nB(o,c,u),c&&(c.closed=!0),u&&(u.closed=!0),typeof t=="function"&&t(o),o?Bl.nextTick($ie,n,o):Bl.nextTick(rB,n)}try{n._destroy(e||null,i)}catch(o){i(o)}}function $ie(n,e){R8(n,e),rB(n)}function rB(n){const e=n._readableState,t=n._writableState;t&&(t.closeEmitted=!0),e&&(e.closeEmitted=!0),(t!=null&&t.emitClose||e!=null&&e.emitClose)&&n.emit("close")}function R8(n,e){const t=n._readableState,r=n._writableState;r!=null&&r.errorEmitted||t!=null&&t.errorEmitted||(r&&(r.errorEmitted=!0),t&&(t.errorEmitted=!0),n.emit("error",e))}function Hie(){const n=this._readableState,e=this._writableState;n&&(n.constructed=!0,n.closed=!1,n.closeEmitted=!1,n.destroyed=!1,n.errored=null,n.errorEmitted=!1,n.reading=!1,n.ended=n.readable===!1,n.endEmitted=n.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function O8(n,e,t){const r=n._readableState,i=n._writableState;if(i!=null&&i.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||i!=null&&i.autoDestroy?n.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),r&&!r.errored&&(r.errored=e),t?Bl.nextTick(R8,n,e):R8(n,e))}function qie(n,e){if(typeof n._construct!="function")return;const t=n._readableState,r=n._writableState;t&&(t.constructed=!1),r&&(r.constructed=!1),n.once(T8,e),!(n.listenerCount(T8)>1)&&Bl.nextTick(Vie,n)}function Vie(n){let e=!1;function t(r){if(e){O8(n,r??new Iie);return}e=!0;const i=n._readableState,o=n._writableState,u=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),u.destroyed?n.emit(tB,r):r?O8(n,r,!0):Bl.nextTick(Gie,n)}try{n._construct(r=>{Bl.nextTick(t,r)})}catch(r){Bl.nextTick(t,r)}}function Gie(n){n.emit(T8)}function RN(n){return(n==null?void 0:n.setHeader)&&typeof n.abort=="function"}function aB(n){n.emit("close")}function Wie(n,e){n.emit("error",e),Bl.nextTick(aB,n)}function Kie(n,e){!n||Fie(n)||(!e&&!Bie(n)&&(e=new Die),zie(n)?(n.socket=null,n.destroy(e)):RN(n)?n.abort():RN(n.req)?n.req.abort():typeof n.destroy=="function"?n.destroy(e):typeof n.close=="function"?n.close():e?Bl.nextTick(Wie,n,e):Bl.nextTick(aB,n),n.destroyed||(n[Uie]=!0))}var wm={construct:qie,destroyer:Kie,destroy:jie,undestroy:Hie,errorOrDestroy:O8};const{ArrayIsArray:Yie,ObjectSetPrototypeOf:iB}=ma,{EventEmitter:q2}=Gb;function V2(n){q2.call(this,n)}iB(V2.prototype,q2.prototype);iB(V2,q2);V2.prototype.pipe=function(n,e){const t=this;function r(m){n.writable&&n.write(m)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}n.on("drain",i),!n._isStdio&&(!e||e.end!==!1)&&(t.on("end",u),t.on("close",c));let o=!1;function u(){o||(o=!0,n.end())}function c(){o||(o=!0,typeof n.destroy=="function"&&n.destroy())}function p(m){h(),q2.listenerCount(this,"error")===0&&this.emit("error",m)}L8(t,"error",p),L8(n,"error",p);function h(){t.removeListener("data",r),n.removeListener("drain",i),t.removeListener("end",u),t.removeListener("close",c),t.removeListener("error",p),n.removeListener("error",p),t.removeListener("end",h),t.removeListener("close",h),n.removeListener("close",h)}return t.on("end",h),t.on("close",h),n.on("close",h),n.emit("pipe",t),n};function L8(n,e,t){if(typeof n.prependListener=="function")return n.prependListener(e,t);!n._events||!n._events[e]?n.on(e,t):Yie(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]}var q4={Stream:V2,prependListener:L8},sB={exports:{}};(function(n){const{SymbolDispose:e}=ma,{AbortError:t,codes:r}=Xs,{isNodeStream:i,isWebStream:o,kControllerErrorFunction:u}=Xc,c=jd,{ERR_INVALID_ARG_TYPE:p}=r;let h;const m=(w,b)=>{if(typeof w!="object"||!("aborted"in w))throw new p(b,"AbortSignal",w)};n.exports.addAbortSignal=function(b,g){if(m(b,"signal"),!i(g)&&!o(g))throw new p("stream",["ReadableStream","WritableStream","Stream"],g);return n.exports.addAbortSignalNoValidate(b,g)},n.exports.addAbortSignalNoValidate=function(w,b){if(typeof w!="object"||!("aborted"in w))return b;const g=i(b)?()=>{b.destroy(new t(void 0,{cause:w.reason}))}:()=>{b[u](new t(void 0,{cause:w.reason}))};if(w.aborted)g();else{h=h||_s.addAbortListener;const S=h(w,g);c(b,S[e])}return b}})(sB);var G2=sB.exports;const{StringPrototypeSlice:ON,SymbolIterator:Jie,TypedArrayPrototypeSet:m_,Uint8Array:Qie}=ma,{Buffer:g5}=Bd,{inspect:Zie}=_s;var Xie=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;const e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let t=this.head,r=""+t.data;for(;(t=t.next)!==null;)r+=e+t.data;return r}concat(e){if(this.length===0)return g5.alloc(0);const t=g5.allocUnsafe(e>>>0);let r=this.head,i=0;for(;r;)m_(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const i=r.slice(0,e);return this.head.data=r.slice(e),i}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Jie](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=ON(o,0,e),this.head=r,r.data=ON(o,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){const t=g5.allocUnsafe(e),r=e;let i=this.head,o=0;do{const u=i.data;if(e>u.length)m_(t,u,r-e),e-=u.length;else{e===u.length?(m_(t,u,r-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(m_(t,new Qie(u.buffer,u.byteOffset,e),r-e),this.head=i,i.data=u.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return Zie(this,{...t,depth:0,customInspect:!1})}};const{MathFloor:ese,NumberIsInteger:tse}=ma,{validateInteger:nse}=Wb,{ERR_INVALID_ARG_VALUE:rse}=Xs.codes;let oB=16*1024,uB=16;function ase(n,e,t){return n.highWaterMark!=null?n.highWaterMark:e?n[t]:null}function lB(n){return n?uB:oB}function ise(n,e){nse(e,"value",0),n?uB=e:oB=e}function sse(n,e,t,r){const i=ase(e,r,t);if(i!=null){if(!tse(i)||i<0){const o=r?`options.${t}`:"options.highWaterMark";throw new rse(o,i)}return ese(i)}return lB(n.objectMode)}var W2={getHighWaterMark:sse,getDefaultHighWaterMark:lB,setDefaultHighWaterMark:ise},V4={},G4=iU.Buffer,LN=G4.isEncoding||function(n){switch(n=""+n,n&&n.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ose(n){if(!n)return"utf8";for(var e;;)switch(n){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}function use(n){var e=ose(n);if(typeof e!="string"&&(G4.isEncoding===LN||!LN(n)))throw new Error("Unknown encoding: "+n);return e||n}V4.StringDecoder=Kb;function Kb(n){this.encoding=use(n);var e;switch(this.encoding){case"utf16le":this.text=hse,this.end=yse,e=4;break;case"utf8":this.fillLast=fse,e=4;break;case"base64":this.text=mse,this.end=gse,e=3;break;default:this.write=vse,this.end=bse;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=G4.allocUnsafe(e)}Kb.prototype.write=function(n){if(n.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(n),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<n.length?e?e+this.text(n,t):this.text(n,t):e||""};Kb.prototype.end=pse;Kb.prototype.text=dse;Kb.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function v5(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function lse(n,e,t){var r=e.length-1;if(r<t)return 0;var i=v5(e[r]);return i>=0?(i>0&&(n.lastNeed=i-1),i):--r<t||i===-2?0:(i=v5(e[r]),i>=0?(i>0&&(n.lastNeed=i-2),i):--r<t||i===-2?0:(i=v5(e[r]),i>=0?(i>0&&(i===2?i=0:n.lastNeed=i-3),i):0))}function cse(n,e,t){if((e[0]&192)!==128)return n.lastNeed=0,"�";if(n.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return n.lastNeed=1,"�";if(n.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return n.lastNeed=2,"�"}}function fse(n){var e=this.lastTotal-this.lastNeed,t=cse(this,n);if(t!==void 0)return t;if(this.lastNeed<=n.length)return n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,e,0,n.length),this.lastNeed-=n.length}function dse(n,e){var t=lse(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var r=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",e,r)}function pse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+"�":e}function hse(n,e){if((n.length-e)%2===0){var t=n.toString("utf16le",e);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function yse(n){var e=n&&n.length?this.write(n):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function mse(n,e){var t=(n.length-e)%3;return t===0?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function gse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function vse(n){return n.toString(this.encoding)}function bse(n){return n&&n.length?this.write(n):""}const NN=zd(),{PromisePrototypeThen:wse,SymbolAsyncIterator:PN,SymbolIterator:IN}=ma,{Buffer:xse}=Bd,{ERR_INVALID_ARG_TYPE:_se,ERR_STREAM_NULL_VALUES:Sse}=Xs.codes;function Cse(n,e,t){let r;if(typeof e=="string"||e instanceof xse)return new n({objectMode:!0,...t,read(){this.push(e),this.push(null)}});let i;if(e&&e[PN])i=!0,r=e[PN]();else if(e&&e[IN])i=!1,r=e[IN]();else throw new _se("iterable",["Iterable"],e);const o=new n({objectMode:!0,highWaterMark:1,...t});let u=!1;o._read=function(){u||(u=!0,p())},o._destroy=function(h,m){wse(c(h),()=>NN.nextTick(m,h),w=>NN.nextTick(m,w||h))};async function c(h){const m=h!=null,w=typeof r.throw=="function";if(m&&w){const{value:b,done:g}=await r.throw(h);if(await b,g)return}if(typeof r.return=="function"){const{value:b}=await r.return();await b}}async function p(){for(;;){try{const{value:h,done:m}=i?await r.next():r.next();if(m)o.push(null);else{const w=h&&typeof h.then=="function"?await h:h;if(w===null)throw u=!1,new Sse;if(o.push(w))continue;u=!1}}catch(h){o.destroy(h)}break}}return o}var cB=Cse,b5,DN;function K2(){if(DN)return b5;DN=1;const n=zd(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:p,SafeSet:h,SymbolAsyncDispose:m,SymbolAsyncIterator:w,Symbol:b}=ma;b5=Ne,Ne.ReadableState=Ee;const{EventEmitter:g}=Gb,{Stream:S,prependListener:A}=q4,{Buffer:T}=Bd,{addAbortSignal:R}=G2,L=jd;let D=_s.debuglog("stream",ve=>{D=ve});const q=Xie,W=wm,{getHighWaterMark:de,getDefaultHighWaterMark:ce}=W2,{aggregateTwoErrors:me,codes:{ERR_INVALID_ARG_TYPE:Se,ERR_METHOD_NOT_IMPLEMENTED:Ce,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:ke,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C},AbortError:_}=Xs,{validateObject:O}=Wb,z=b("kPaused"),{StringDecoder:F}=V4,j=cB;c(Ne.prototype,S.prototype),c(Ne,S);const Q=()=>{},{errorOrDestroy:ae}=W,N=1,k=2,Y=4,ie=8,$=16,be=32,Ie=64,Me=128,Ue=256,se=512,fe=1024,pe=2048,ue=4096,te=8192,ye=16384,J=32768,P=65536,U=1<<17,ee=1<<18;function oe(ve){return{enumerable:!1,get(){return(this.state&ve)!==0},set(_e){_e?this.state|=ve:this.state&=~ve}}}o(Ee.prototype,{objectMode:oe(N),ended:oe(k),endEmitted:oe(Y),reading:oe(ie),constructed:oe($),sync:oe(be),needReadable:oe(Ie),emittedReadable:oe(Me),readableListening:oe(Ue),resumeScheduled:oe(se),errorEmitted:oe(fe),emitClose:oe(pe),autoDestroy:oe(ue),destroyed:oe(te),closed:oe(ye),closeEmitted:oe(J),multiAwaitDrain:oe(P),readingMore:oe(U),dataEmitted:oe(ee)});function Ee(ve,_e,ct){typeof ct!="boolean"&&(ct=_e instanceof Kc()),this.state=pe|ue|$|be,ve&&ve.objectMode&&(this.state|=N),ct&&ve&&ve.readableObjectMode&&(this.state|=N),this.highWaterMark=ve?de(this,ve,"readableHighWaterMark",ct):ce(!1),this.buffer=new q,this.length=0,this.pipes=[],this.flowing=null,this[z]=null,ve&&ve.emitClose===!1&&(this.state&=~pe),ve&&ve.autoDestroy===!1&&(this.state&=~ue),this.errored=null,this.defaultEncoding=ve&&ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ve&&ve.encoding&&(this.decoder=new F(ve.encoding),this.encoding=ve.encoding)}function Ne(ve){if(!(this instanceof Ne))return new Ne(ve);const _e=this instanceof Kc();this._readableState=new Ee(ve,this,_e),ve&&(typeof ve.read=="function"&&(this._read=ve.read),typeof ve.destroy=="function"&&(this._destroy=ve.destroy),typeof ve.construct=="function"&&(this._construct=ve.construct),ve.signal&&!_e&&R(ve.signal,this)),S.call(this,ve),W.construct(this,()=>{this._readableState.needReadable&&xe(this,this._readableState)})}Ne.prototype.destroy=W.destroy,Ne.prototype._undestroy=W.undestroy,Ne.prototype._destroy=function(ve,_e){_e(ve)},Ne.prototype[g.captureRejectionSymbol]=function(ve){this.destroy(ve)},Ne.prototype[m]=function(){let ve;return this.destroyed||(ve=this.readableEnded?null:new _,this.destroy(ve)),new p((_e,ct)=>L(this,at=>at&&at!==ve?ct(at):_e(null)))},Ne.prototype.push=function(ve,_e){return Qe(this,ve,_e,!1)},Ne.prototype.unshift=function(ve,_e){return Qe(this,ve,_e,!0)};function Qe(ve,_e,ct,at){D("readableAddChunk",_e);const ft=ve._readableState;let Un;if(ft.state&N||(typeof _e=="string"?(ct=ct||ft.defaultEncoding,ft.encoding!==ct&&(at&&ft.encoding?_e=T.from(_e,ct).toString(ft.encoding):(_e=T.from(_e,ct),ct=""))):_e instanceof T?ct="":S._isUint8Array(_e)?(_e=S._uint8ArrayToBuffer(_e),ct=""):_e!=null&&(Un=new Se("chunk",["string","Buffer","Uint8Array"],_e))),Un)ae(ve,Un);else if(_e===null)ft.state&=~ie,H(ve,ft);else if(ft.state&N||_e&&_e.length>0)if(at)if(ft.state&Y)ae(ve,new C);else{if(ft.destroyed||ft.errored)return!1;st(ve,ft,_e,!0)}else if(ft.ended)ae(ve,new ke);else{if(ft.destroyed||ft.errored)return!1;ft.state&=~ie,ft.decoder&&!ct?(_e=ft.decoder.write(_e),ft.objectMode||_e.length!==0?st(ve,ft,_e,!1):xe(ve,ft)):st(ve,ft,_e,!1)}else at||(ft.state&=~ie,xe(ve,ft));return!ft.ended&&(ft.length<ft.highWaterMark||ft.length===0)}function st(ve,_e,ct,at){_e.flowing&&_e.length===0&&!_e.sync&&ve.listenerCount("data")>0?(_e.state&P?_e.awaitDrainWriters.clear():_e.awaitDrainWriters=null,_e.dataEmitted=!0,ve.emit("data",ct)):(_e.length+=_e.objectMode?1:ct.length,at?_e.buffer.unshift(ct):_e.buffer.push(ct),_e.state&Ie&&G(ve)),xe(ve,_e)}Ne.prototype.isPaused=function(){const ve=this._readableState;return ve[z]===!0||ve.flowing===!1},Ne.prototype.setEncoding=function(ve){const _e=new F(ve);this._readableState.decoder=_e,this._readableState.encoding=this._readableState.decoder.encoding;const ct=this._readableState.buffer;let at="";for(const ft of ct)at+=_e.write(ft);return ct.clear(),at!==""&&ct.push(at),this._readableState.length=at.length,this};const xt=1073741824;function St(ve){if(ve>xt)throw new ne("size","<= 1GiB",ve);return ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++,ve}function Z(ve,_e){return ve<=0||_e.length===0&&_e.ended?0:_e.state&N?1:r(ve)?_e.flowing&&_e.length?_e.buffer.first().length:_e.length:ve<=_e.length?ve:_e.ended?_e.length:0}Ne.prototype.read=function(ve){D("read",ve),ve===void 0?ve=NaN:t(ve)||(ve=i(ve,10));const _e=this._readableState,ct=ve;if(ve>_e.highWaterMark&&(_e.highWaterMark=St(ve)),ve!==0&&(_e.state&=~Me),ve===0&&_e.needReadable&&((_e.highWaterMark!==0?_e.length>=_e.highWaterMark:_e.length>0)||_e.ended))return D("read: emitReadable",_e.length,_e.ended),_e.length===0&&_e.ended?Wt(this):G(this),null;if(ve=Z(ve,_e),ve===0&&_e.ended)return _e.length===0&&Wt(this),null;let at=(_e.state&Ie)!==0;if(D("need readable",at),(_e.length===0||_e.length-ve<_e.highWaterMark)&&(at=!0,D("length less than watermark",at)),_e.ended||_e.reading||_e.destroyed||_e.errored||!_e.constructed)at=!1,D("reading, ended or constructing",at);else if(at){D("do read"),_e.state|=ie|be,_e.length===0&&(_e.state|=Ie);try{this._read(_e.highWaterMark)}catch(Un){ae(this,Un)}_e.state&=~be,_e.reading||(ve=Z(ct,_e))}let ft;return ve>0?ft=Zt(ve,_e):ft=null,ft===null?(_e.needReadable=_e.length<=_e.highWaterMark,ve=0):(_e.length-=ve,_e.multiAwaitDrain?_e.awaitDrainWriters.clear():_e.awaitDrainWriters=null),_e.length===0&&(_e.ended||(_e.needReadable=!0),ct!==ve&&_e.ended&&Wt(this)),ft!==null&&!_e.errorEmitted&&!_e.closeEmitted&&(_e.dataEmitted=!0,this.emit("data",ft)),ft};function H(ve,_e){if(D("onEofChunk"),!_e.ended){if(_e.decoder){const ct=_e.decoder.end();ct&&ct.length&&(_e.buffer.push(ct),_e.length+=_e.objectMode?1:ct.length)}_e.ended=!0,_e.sync?G(ve):(_e.needReadable=!1,_e.emittedReadable=!0,ge(ve))}}function G(ve){const _e=ve._readableState;D("emitReadable",_e.needReadable,_e.emittedReadable),_e.needReadable=!1,_e.emittedReadable||(D("emitReadable",_e.flowing),_e.emittedReadable=!0,n.nextTick(ge,ve))}function ge(ve){const _e=ve._readableState;D("emitReadable_",_e.destroyed,_e.length,_e.ended),!_e.destroyed&&!_e.errored&&(_e.length||_e.ended)&&(ve.emit("readable"),_e.emittedReadable=!1),_e.needReadable=!_e.flowing&&!_e.ended&&_e.length<=_e.highWaterMark,Rt(ve)}function xe(ve,_e){!_e.readingMore&&_e.constructed&&(_e.readingMore=!0,n.nextTick(Re,ve,_e))}function Re(ve,_e){for(;!_e.reading&&!_e.ended&&(_e.length<_e.highWaterMark||_e.flowing&&_e.length===0);){const ct=_e.length;if(D("maybeReadMore read 0"),ve.read(0),ct===_e.length)break}_e.readingMore=!1}Ne.prototype._read=function(ve){throw new Ce("_read()")},Ne.prototype.pipe=function(ve,_e){const ct=this,at=this._readableState;at.pipes.length===1&&(at.multiAwaitDrain||(at.multiAwaitDrain=!0,at.awaitDrainWriters=new h(at.awaitDrainWriters?[at.awaitDrainWriters]:[]))),at.pipes.push(ve),D("pipe count=%d opts=%j",at.pipes.length,_e);const Un=(!_e||_e.end!==!1)&&ve!==n.stdout&&ve!==n.stderr?Sn:Bt;at.endEmitted?n.nextTick(Un):ct.once("end",Un),ve.on("unpipe",hn);function hn(Dt,Kt){D("onunpipe"),Dt===ct&&Kt&&Kt.hasUnpiped===!1&&(Kt.hasUnpiped=!0,Fn())}function Sn(){D("onend"),ve.end()}let fr,On=!1;function Fn(){D("cleanup"),ve.removeListener("close",Nt),ve.removeListener("finish",Ft),fr&&ve.removeListener("drain",fr),ve.removeListener("error",rt),ve.removeListener("unpipe",hn),ct.removeListener("end",Sn),ct.removeListener("end",Bt),ct.removeListener("data",et),On=!0,fr&&at.awaitDrainWriters&&(!ve._writableState||ve._writableState.needDrain)&&fr()}function Te(){On||(at.pipes.length===1&&at.pipes[0]===ve?(D("false write response, pause",0),at.awaitDrainWriters=ve,at.multiAwaitDrain=!1):at.pipes.length>1&&at.pipes.includes(ve)&&(D("false write response, pause",at.awaitDrainWriters.size),at.awaitDrainWriters.add(ve)),ct.pause()),fr||(fr=Be(ct,ve),ve.on("drain",fr))}ct.on("data",et);function et(Dt){D("ondata");const Kt=ve.write(Dt);D("dest.write",Kt),Kt===!1&&Te()}function rt(Dt){if(D("onerror",Dt),Bt(),ve.removeListener("error",rt),ve.listenerCount("error")===0){const Kt=ve._writableState||ve._readableState;Kt&&!Kt.errorEmitted?ae(ve,Dt):ve.emit("error",Dt)}}A(ve,"error",rt);function Nt(){ve.removeListener("finish",Ft),Bt()}ve.once("close",Nt);function Ft(){D("onfinish"),ve.removeListener("close",Nt),Bt()}ve.once("finish",Ft);function Bt(){D("unpipe"),ct.unpipe(ve)}return ve.emit("pipe",ct),ve.writableNeedDrain===!0?Te():at.flowing||(D("pipe resume"),ct.resume()),ve};function Be(ve,_e){return function(){const at=ve._readableState;at.awaitDrainWriters===_e?(D("pipeOnDrain",1),at.awaitDrainWriters=null):at.multiAwaitDrain&&(D("pipeOnDrain",at.awaitDrainWriters.size),at.awaitDrainWriters.delete(_e)),(!at.awaitDrainWriters||at.awaitDrainWriters.size===0)&&ve.listenerCount("data")&&ve.resume()}}Ne.prototype.unpipe=function(ve){const _e=this._readableState,ct={hasUnpiped:!1};if(_e.pipes.length===0)return this;if(!ve){const ft=_e.pipes;_e.pipes=[],this.pause();for(let Un=0;Un<ft.length;Un++)ft[Un].emit("unpipe",this,{hasUnpiped:!1});return this}const at=e(_e.pipes,ve);return at===-1?this:(_e.pipes.splice(at,1),_e.pipes.length===0&&this.pause(),ve.emit("unpipe",this,ct),this)},Ne.prototype.on=function(ve,_e){const ct=S.prototype.on.call(this,ve,_e),at=this._readableState;return ve==="data"?(at.readableListening=this.listenerCount("readable")>0,at.flowing!==!1&&this.resume()):ve==="readable"&&!at.endEmitted&&!at.readableListening&&(at.readableListening=at.needReadable=!0,at.flowing=!1,at.emittedReadable=!1,D("on readable",at.length,at.reading),at.length?G(this):at.reading||n.nextTick(yt,this)),ct},Ne.prototype.addListener=Ne.prototype.on,Ne.prototype.removeListener=function(ve,_e){const ct=S.prototype.removeListener.call(this,ve,_e);return ve==="readable"&&n.nextTick(wt,this),ct},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(ve){const _e=S.prototype.removeAllListeners.apply(this,arguments);return(ve==="readable"||ve===void 0)&&n.nextTick(wt,this),_e};function wt(ve){const _e=ve._readableState;_e.readableListening=ve.listenerCount("readable")>0,_e.resumeScheduled&&_e[z]===!1?_e.flowing=!0:ve.listenerCount("data")>0?ve.resume():_e.readableListening||(_e.flowing=null)}function yt(ve){D("readable nexttick read 0"),ve.read(0)}Ne.prototype.resume=function(){const ve=this._readableState;return ve.flowing||(D("resume"),ve.flowing=!ve.readableListening,gt(this,ve)),ve[z]=!1,this};function gt(ve,_e){_e.resumeScheduled||(_e.resumeScheduled=!0,n.nextTick(Et,ve,_e))}function Et(ve,_e){D("resume",_e.reading),_e.reading||ve.read(0),_e.resumeScheduled=!1,ve.emit("resume"),Rt(ve),_e.flowing&&!_e.reading&&ve.read(0)}Ne.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[z]=!0,this};function Rt(ve){const _e=ve._readableState;for(D("flow",_e.flowing);_e.flowing&&ve.read()!==null;);}Ne.prototype.wrap=function(ve){let _e=!1;ve.on("data",at=>{!this.push(at)&&ve.pause&&(_e=!0,ve.pause())}),ve.on("end",()=>{this.push(null)}),ve.on("error",at=>{ae(this,at)}),ve.on("close",()=>{this.destroy()}),ve.on("destroy",()=>{this.destroy()}),this._read=()=>{_e&&ve.resume&&(_e=!1,ve.resume())};const ct=u(ve);for(let at=1;at<ct.length;at++){const ft=ct[at];this[ft]===void 0&&typeof ve[ft]=="function"&&(this[ft]=ve[ft].bind(ve))}return this},Ne.prototype[w]=function(){return nn(this)},Ne.prototype.iterator=function(ve){return ve!==void 0&&O(ve,"options"),nn(this,ve)};function nn(ve,_e){typeof ve.read!="function"&&(ve=Ne.wrap(ve,{objectMode:!0}));const ct=Mr(ve,_e);return ct.stream=ve,ct}async function*Mr(ve,_e){let ct=Q;function at(hn){this===ve?(ct(),ct=Q):ct=hn}ve.on("readable",at);let ft;const Un=L(ve,{writable:!1},hn=>{ft=hn?me(ft,hn):null,ct(),ct=Q});try{for(;;){const hn=ve.destroyed?null:ve.read();if(hn!==null)yield hn;else{if(ft)throw ft;if(ft===null)return;await new p(at)}}}catch(hn){throw ft=me(ft,hn),ft}finally{(ft||(_e==null?void 0:_e.destroyOnReturn)!==!1)&&(ft===void 0||ve._readableState.autoDestroy)?W.destroyer(ve,null):(ve.off("readable",at),Un())}}o(Ne.prototype,{readable:{__proto__:null,get(){const ve=this._readableState;return!!ve&&ve.readable!==!1&&!ve.destroyed&&!ve.errorEmitted&&!ve.endEmitted},set(ve){this._readableState&&(this._readableState.readable=!!ve)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(ve){this._readableState&&(this._readableState.flowing=ve)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(ve){this._readableState&&(this._readableState.destroyed=ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Ee.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[z]!==!1},set(ve){this[z]=!!ve}}}),Ne._fromList=Zt;function Zt(ve,_e){if(_e.length===0)return null;let ct;return _e.objectMode?ct=_e.buffer.shift():!ve||ve>=_e.length?(_e.decoder?ct=_e.buffer.join(""):_e.buffer.length===1?ct=_e.buffer.first():ct=_e.buffer.concat(_e.length),_e.buffer.clear()):ct=_e.buffer.consume(ve,_e.decoder),ct}function Wt(ve){const _e=ve._readableState;D("endReadable",_e.endEmitted),_e.endEmitted||(_e.ended=!0,n.nextTick(Xr,_e,ve))}function Xr(ve,_e){if(D("endReadableNT",ve.endEmitted,ve.length),!ve.errored&&!ve.closeEmitted&&!ve.endEmitted&&ve.length===0){if(ve.endEmitted=!0,_e.emit("end"),_e.writable&&_e.allowHalfOpen===!1)n.nextTick(Mn,_e);else if(ve.autoDestroy){const ct=_e._writableState;(!ct||ct.autoDestroy&&(ct.finished||ct.writable===!1))&&_e.destroy()}}}function Mn(ve){ve.writable&&!ve.writableEnded&&!ve.destroyed&&ve.end()}Ne.from=function(ve,_e){return j(Ne,ve,_e)};let Dn;function Ma(){return Dn===void 0&&(Dn={}),Dn}return Ne.fromWeb=function(ve,_e){return Ma().newStreamReadableFromReadableStream(ve,_e)},Ne.toWeb=function(ve,_e){return Ma().newReadableStreamFromStreamReadable(ve,_e)},Ne.wrap=function(ve,_e){var ct,at;return new Ne({objectMode:(ct=(at=ve.readableObjectMode)!==null&&at!==void 0?at:ve.objectMode)!==null&&ct!==void 0?ct:!0,..._e,destroy(ft,Un){W.destroyer(ve,ft),Un(ft)}}).wrap(ve)},b5}var w5,UN;function W4(){if(UN)return w5;UN=1;const n=zd(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:h}=ma;w5=O,O.WritableState=C;const{EventEmitter:m}=Gb,w=q4.Stream,{Buffer:b}=Bd,g=wm,{addAbortSignal:S}=G2,{getHighWaterMark:A,getDefaultHighWaterMark:T}=W2,{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:D,ERR_STREAM_CANNOT_PIPE:q,ERR_STREAM_DESTROYED:W,ERR_STREAM_ALREADY_FINISHED:de,ERR_STREAM_NULL_VALUES:ce,ERR_STREAM_WRITE_AFTER_END:me,ERR_UNKNOWN_ENCODING:Se}=Xs.codes,{errorOrDestroy:Ce}=g;u(O.prototype,w.prototype),u(O,w);function ne(){}const ke=p("kOnFinished");function C(ue,te,ye){typeof ye!="boolean"&&(ye=te instanceof Kc()),this.objectMode=!!(ue&&ue.objectMode),ye&&(this.objectMode=this.objectMode||!!(ue&&ue.writableObjectMode)),this.highWaterMark=ue?A(this,ue,"writableHighWaterMark",ye):T(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const J=!!(ue&&ue.decodeStrings===!1);this.decodeStrings=!J,this.defaultEncoding=ue&&ue.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ae.bind(void 0,te),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,_(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ue||ue.emitClose!==!1,this.autoDestroy=!ue||ue.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ke]=[]}function _(ue){ue.buffered=[],ue.bufferedIndex=0,ue.allBuffers=!0,ue.allNoop=!0}C.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(C.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(ue){const te=this instanceof Kc();if(!te&&!r(O,this))return new O(ue);this._writableState=new C(ue,this,te),ue&&(typeof ue.write=="function"&&(this._write=ue.write),typeof ue.writev=="function"&&(this._writev=ue.writev),typeof ue.destroy=="function"&&(this._destroy=ue.destroy),typeof ue.final=="function"&&(this._final=ue.final),typeof ue.construct=="function"&&(this._construct=ue.construct),ue.signal&&S(ue.signal,this)),w.call(this,ue),g.construct(this,()=>{const ye=this._writableState;ye.writing||ie(this,ye),Me(this,ye)})}i(O,h,{__proto__:null,value:function(ue){return r(this,ue)?!0:this!==O?!1:ue&&ue._writableState instanceof C}}),O.prototype.pipe=function(){Ce(this,new q)};function z(ue,te,ye,J){const P=ue._writableState;if(typeof ye=="function")J=ye,ye=P.defaultEncoding;else{if(!ye)ye=P.defaultEncoding;else if(ye!=="buffer"&&!b.isEncoding(ye))throw new Se(ye);typeof J!="function"&&(J=ne)}if(te===null)throw new ce;if(!P.objectMode)if(typeof te=="string")P.decodeStrings!==!1&&(te=b.from(te,ye),ye="buffer");else if(te instanceof b)ye="buffer";else if(w._isUint8Array(te))te=w._uint8ArrayToBuffer(te),ye="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],te);let U;return P.ending?U=new me:P.destroyed&&(U=new W("write")),U?(n.nextTick(J,U),Ce(ue,U,!0),U):(P.pendingcb++,F(ue,P,te,ye,J))}O.prototype.write=function(ue,te,ye){return z(this,ue,te,ye)===!0},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){const ue=this._writableState;ue.corked&&(ue.corked--,ue.writing||ie(this,ue))},O.prototype.setDefaultEncoding=function(te){if(typeof te=="string"&&(te=c(te)),!b.isEncoding(te))throw new Se(te);return this._writableState.defaultEncoding=te,this};function F(ue,te,ye,J,P){const U=te.objectMode?1:ye.length;te.length+=U;const ee=te.length<te.highWaterMark;return ee||(te.needDrain=!0),te.writing||te.corked||te.errored||!te.constructed?(te.buffered.push({chunk:ye,encoding:J,callback:P}),te.allBuffers&&J!=="buffer"&&(te.allBuffers=!1),te.allNoop&&P!==ne&&(te.allNoop=!1)):(te.writelen=U,te.writecb=P,te.writing=!0,te.sync=!0,ue._write(ye,J,te.onwrite),te.sync=!1),ee&&!te.errored&&!te.destroyed}function j(ue,te,ye,J,P,U,ee){te.writelen=J,te.writecb=ee,te.writing=!0,te.sync=!0,te.destroyed?te.onwrite(new W("write")):ye?ue._writev(P,te.onwrite):ue._write(P,U,te.onwrite),te.sync=!1}function Q(ue,te,ye,J){--te.pendingcb,J(ye),Y(te),Ce(ue,ye)}function ae(ue,te){const ye=ue._writableState,J=ye.sync,P=ye.writecb;if(typeof P!="function"){Ce(ue,new D);return}ye.writing=!1,ye.writecb=null,ye.length-=ye.writelen,ye.writelen=0,te?(te.stack,ye.errored||(ye.errored=te),ue._readableState&&!ue._readableState.errored&&(ue._readableState.errored=te),J?n.nextTick(Q,ue,ye,te,P):Q(ue,ye,te,P)):(ye.buffered.length>ye.bufferedIndex&&ie(ue,ye),J?ye.afterWriteTickInfo!==null&&ye.afterWriteTickInfo.cb===P?ye.afterWriteTickInfo.count++:(ye.afterWriteTickInfo={count:1,cb:P,stream:ue,state:ye},n.nextTick(N,ye.afterWriteTickInfo)):k(ue,ye,1,P))}function N({stream:ue,state:te,count:ye,cb:J}){return te.afterWriteTickInfo=null,k(ue,te,ye,J)}function k(ue,te,ye,J){for(!te.ending&&!ue.destroyed&&te.length===0&&te.needDrain&&(te.needDrain=!1,ue.emit("drain"));ye-- >0;)te.pendingcb--,J();te.destroyed&&Y(te),Me(ue,te)}function Y(ue){if(ue.writing)return;for(let P=ue.bufferedIndex;P<ue.buffered.length;++P){var te;const{chunk:U,callback:ee}=ue.buffered[P],oe=ue.objectMode?1:U.length;ue.length-=oe,ee((te=ue.errored)!==null&&te!==void 0?te:new W("write"))}const ye=ue[ke].splice(0);for(let P=0;P<ye.length;P++){var J;ye[P]((J=ue.errored)!==null&&J!==void 0?J:new W("end"))}_(ue)}function ie(ue,te){if(te.corked||te.bufferProcessing||te.destroyed||!te.constructed)return;const{buffered:ye,bufferedIndex:J,objectMode:P}=te,U=ye.length-J;if(!U)return;let ee=J;if(te.bufferProcessing=!0,U>1&&ue._writev){te.pendingcb-=U-1;const oe=te.allNoop?ne:Ne=>{for(let Qe=ee;Qe<ye.length;++Qe)ye[Qe].callback(Ne)},Ee=te.allNoop&&ee===0?ye:e(ye,ee);Ee.allBuffers=te.allBuffers,j(ue,te,!0,te.length,Ee,"",oe),_(te)}else{do{const{chunk:oe,encoding:Ee,callback:Ne}=ye[ee];ye[ee++]=null;const Qe=P?1:oe.length;j(ue,te,!1,Qe,oe,Ee,Ne)}while(ee<ye.length&&!te.writing);ee===ye.length?_(te):ee>256?(ye.splice(0,ee),te.bufferedIndex=0):te.bufferedIndex=ee}te.bufferProcessing=!1}O.prototype._write=function(ue,te,ye){if(this._writev)this._writev([{chunk:ue,encoding:te}],ye);else throw new L("_write()")},O.prototype._writev=null,O.prototype.end=function(ue,te,ye){const J=this._writableState;typeof ue=="function"?(ye=ue,ue=null,te=null):typeof te=="function"&&(ye=te,te=null);let P;if(ue!=null){const U=z(this,ue,te);U instanceof t&&(P=U)}return J.corked&&(J.corked=1,this.uncork()),P||(!J.errored&&!J.ending?(J.ending=!0,Me(this,J,!0),J.ended=!0):J.finished?P=new de("end"):J.destroyed&&(P=new W("end"))),typeof ye=="function"&&(P||J.finished?n.nextTick(ye,P):J[ke].push(ye)),this};function $(ue){return ue.ending&&!ue.destroyed&&ue.constructed&&ue.length===0&&!ue.errored&&ue.buffered.length===0&&!ue.finished&&!ue.writing&&!ue.errorEmitted&&!ue.closeEmitted}function be(ue,te){let ye=!1;function J(P){if(ye){Ce(ue,P??D());return}if(ye=!0,te.pendingcb--,P){const U=te[ke].splice(0);for(let ee=0;ee<U.length;ee++)U[ee](P);Ce(ue,P,te.sync)}else $(te)&&(te.prefinished=!0,ue.emit("prefinish"),te.pendingcb++,n.nextTick(Ue,ue,te))}te.sync=!0,te.pendingcb++;try{ue._final(J)}catch(P){J(P)}te.sync=!1}function Ie(ue,te){!te.prefinished&&!te.finalCalled&&(typeof ue._final=="function"&&!te.destroyed?(te.finalCalled=!0,be(ue,te)):(te.prefinished=!0,ue.emit("prefinish")))}function Me(ue,te,ye){$(te)&&(Ie(ue,te),te.pendingcb===0&&(ye?(te.pendingcb++,n.nextTick((J,P)=>{$(P)?Ue(J,P):P.pendingcb--},ue,te)):$(te)&&(te.pendingcb++,Ue(ue,te))))}function Ue(ue,te){te.pendingcb--,te.finished=!0;const ye=te[ke].splice(0);for(let J=0;J<ye.length;J++)ye[J]();if(ue.emit("finish"),te.autoDestroy){const J=ue._readableState;(!J||J.autoDestroy&&(J.endEmitted||J.readable===!1))&&ue.destroy()}}o(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ue){this._writableState&&(this._writableState.destroyed=ue)}},writable:{__proto__:null,get(){const ue=this._writableState;return!!ue&&ue.writable!==!1&&!ue.destroyed&&!ue.errored&&!ue.ending&&!ue.ended},set(ue){this._writableState&&(this._writableState.writable=!!ue)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const ue=this._writableState;return ue?!ue.destroyed&&!ue.ending&&ue.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const se=g.destroy;O.prototype.destroy=function(ue,te){const ye=this._writableState;return!ye.destroyed&&(ye.bufferedIndex<ye.buffered.length||ye[ke].length)&&n.nextTick(Y,ye),se.call(this,ue,te),this},O.prototype._undestroy=g.undestroy,O.prototype._destroy=function(ue,te){te(ue)},O.prototype[m.captureRejectionSymbol]=function(ue){this.destroy(ue)};let fe;function pe(){return fe===void 0&&(fe={}),fe}return O.fromWeb=function(ue,te){return pe().newStreamWritableFromWritableStream(ue,te)},O.toWeb=function(ue){return pe().newWritableStreamFromStreamWritable(ue)},w5}var x5,FN;function Ese(){if(FN)return x5;FN=1;const n=zd(),e=Bd,{isReadable:t,isWritable:r,isIterable:i,isNodeStream:o,isReadableNodeStream:u,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:h,isWritableStream:m}=Xc,w=jd,{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:S}}=Xs,{destroyer:A}=wm,T=Kc(),R=K2(),L=W4(),{createDeferredPromise:D}=_s,q=cB,W=globalThis.Blob||e.Blob,de=typeof W<"u"?function(C){return C instanceof W}:function(C){return!1},ce=globalThis.AbortController||Tb().AbortController,{FunctionPrototypeCall:me}=ma;class Se extends T{constructor(C){super(C),(C==null?void 0:C.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(C==null?void 0:C.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}x5=function ke(C,_){if(p(C))return C;if(u(C))return ne({readable:C});if(c(C))return ne({writable:C});if(o(C))return ne({writable:!1,readable:!1});if(h(C))return ne({readable:R.fromWeb(C)});if(m(C))return ne({writable:L.fromWeb(C)});if(typeof C=="function"){const{value:z,write:F,final:j,destroy:Q}=Ce(C);if(i(z))return q(Se,z,{objectMode:!0,write:F,final:j,destroy:Q});const ae=z==null?void 0:z.then;if(typeof ae=="function"){let N;const k=me(ae,z,Y=>{if(Y!=null)throw new S("nully","body",Y)},Y=>{A(N,Y)});return N=new Se({objectMode:!0,readable:!1,write:F,final(Y){j(async()=>{try{await k,n.nextTick(Y,null)}catch(ie){n.nextTick(Y,ie)}})},destroy:Q})}throw new S("Iterable, AsyncIterable or AsyncFunction",_,z)}if(de(C))return ke(C.arrayBuffer());if(i(C))return q(Se,C,{objectMode:!0,writable:!1});if(h(C==null?void 0:C.readable)&&m(C==null?void 0:C.writable))return Se.fromWeb(C);if(typeof(C==null?void 0:C.writable)=="object"||typeof(C==null?void 0:C.readable)=="object"){const z=C!=null&&C.readable?u(C==null?void 0:C.readable)?C==null?void 0:C.readable:ke(C.readable):void 0,F=C!=null&&C.writable?c(C==null?void 0:C.writable)?C==null?void 0:C.writable:ke(C.writable):void 0;return ne({readable:z,writable:F})}const O=C==null?void 0:C.then;if(typeof O=="function"){let z;return me(O,C,F=>{F!=null&&z.push(F),z.push(null)},F=>{A(z,F)}),z=new Se({objectMode:!0,writable:!1,read(){}})}throw new g(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],C)};function Ce(ke){let{promise:C,resolve:_}=D();const O=new ce,z=O.signal;return{value:ke(async function*(){for(;;){const j=C;C=null;const{chunk:Q,done:ae,cb:N}=await j;if(n.nextTick(N),ae)return;if(z.aborted)throw new b(void 0,{cause:z.reason});({promise:C,resolve:_}=D()),yield Q}}(),{signal:z}),write(j,Q,ae){const N=_;_=null,N({chunk:j,done:!1,cb:ae})},final(j){const Q=_;_=null,Q({done:!0,cb:j})},destroy(j,Q){O.abort(),Q(j)}}}function ne(ke){const C=ke.readable&&typeof ke.readable.read!="function"?R.wrap(ke.readable):ke.readable,_=ke.writable;let O=!!t(C),z=!!r(_),F,j,Q,ae,N;function k(Y){const ie=ae;ae=null,ie?ie(Y):Y&&N.destroy(Y)}return N=new Se({readableObjectMode:!!(C!=null&&C.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:O,writable:z}),z&&(w(_,Y=>{z=!1,Y&&A(C,Y),k(Y)}),N._write=function(Y,ie,$){_.write(Y,ie)?$():F=$},N._final=function(Y){_.end(),j=Y},_.on("drain",function(){if(F){const Y=F;F=null,Y()}}),_.on("finish",function(){if(j){const Y=j;j=null,Y()}})),O&&(w(C,Y=>{O=!1,Y&&A(C,Y),k(Y)}),C.on("readable",function(){if(Q){const Y=Q;Q=null,Y()}}),C.on("end",function(){N.push(null)}),N._read=function(){for(;;){const Y=C.read();if(Y===null){Q=N._read;return}if(!N.push(Y))return}}),N._destroy=function(Y,ie){!Y&&ae!==null&&(Y=new b),Q=null,F=null,j=null,ae===null?ie(Y):(ae=ie,A(_,Y),A(C,Y))},N}return x5}var _5,BN;function Kc(){if(BN)return _5;BN=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=ma;_5=u;const i=K2(),o=W4();r(u.prototype,i.prototype),r(u,i);{const m=t(o.prototype);for(let w=0;w<m.length;w++){const b=m[w];u.prototype[b]||(u.prototype[b]=o.prototype[b])}}function u(m){if(!(this instanceof u))return new u(m);i.call(this,m),o.call(this,m),m?(this.allowHalfOpen=m.allowHalfOpen!==!1,m.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),m.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(u.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(m){this._readableState&&this._writableState&&(this._readableState.destroyed=m,this._writableState.destroyed=m)}}});let c;function p(){return c===void 0&&(c={}),c}u.fromWeb=function(m,w){return p().newStreamDuplexFromReadableWritablePair(m,w)},u.toWeb=function(m){return p().newReadableWritablePairFromDuplex(m)};let h;return u.from=function(m){return h||(h=Ese()),h(m,"body")},_5}const{ObjectSetPrototypeOf:fB,Symbol:Ase}=ma;var dB=Yc;const{ERR_METHOD_NOT_IMPLEMENTED:kse}=Xs.codes,K4=Kc(),{getHighWaterMark:Mse}=W2;fB(Yc.prototype,K4.prototype);fB(Yc,K4);const pb=Ase("kCallback");function Yc(n){if(!(this instanceof Yc))return new Yc(n);const e=n?Mse(this,n,"readableHighWaterMark",!0):null;e===0&&(n={...n,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:n.writableHighWaterMark||0}),K4.call(this,n),this._readableState.sync=!1,this[pb]=null,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",Tse)}function N8(n){typeof this._flush=="function"&&!this.destroyed?this._flush((e,t)=>{if(e){n?n(e):this.destroy(e);return}t!=null&&this.push(t),this.push(null),n&&n()}):(this.push(null),n&&n())}function Tse(){this._final!==N8&&N8.call(this)}Yc.prototype._final=N8;Yc.prototype._transform=function(n,e,t){throw new kse("_transform()")};Yc.prototype._write=function(n,e,t){const r=this._readableState,i=this._writableState,o=r.length;this._transform(n,e,(u,c)=>{if(u){t(u);return}c!=null&&this.push(c),i.ended||o===r.length||r.length<r.highWaterMark?t():this[pb]=t})};Yc.prototype._read=function(){if(this[pb]){const n=this[pb];this[pb]=null,n()}};const{ObjectSetPrototypeOf:pB}=ma;var hB=tm;const Y4=dB;pB(tm.prototype,Y4.prototype);pB(tm,Y4);function tm(n){if(!(this instanceof tm))return new tm(n);Y4.call(this,n)}tm.prototype._transform=function(n,e,t){t(null,n)};const eb=zd(),{ArrayIsArray:Rse,Promise:Ose,SymbolAsyncIterator:Lse,SymbolDispose:Nse}=ma,e2=jd,{once:Pse}=_s,Ise=wm,zN=Kc(),{aggregateTwoErrors:Dse,codes:{ERR_INVALID_ARG_TYPE:P8,ERR_INVALID_RETURN_VALUE:S5,ERR_MISSING_ARGS:Use,ERR_STREAM_DESTROYED:Fse,ERR_STREAM_PREMATURE_CLOSE:Bse},AbortError:zse}=Xs,{validateFunction:jse,validateAbortSignal:$se}=Wb,{isIterable:Jp,isReadable:C5,isReadableNodeStream:P_,isNodeStream:jN,isTransformStream:Py,isWebStream:Hse,isReadableStream:E5,isReadableFinished:qse}=Xc,Vse=globalThis.AbortController||Tb().AbortController;let A5,k5,M5;function $N(n,e,t){let r=!1;n.on("close",()=>{r=!0});const i=e2(n,{readable:e,writable:t},o=>{r=!o});return{destroy:o=>{r||(r=!0,Ise.destroyer(n,o||new Fse("pipe")))},cleanup:i}}function Gse(n){return jse(n[n.length-1],"streams[stream.length - 1]"),n.pop()}function T5(n){if(Jp(n))return n;if(P_(n))return Wse(n);throw new P8("val",["Readable","Iterable","AsyncIterable"],n)}async function*Wse(n){k5||(k5=K2()),yield*k5.prototype[Lse].call(n)}async function g_(n,e,t,{end:r}){let i,o=null;const u=h=>{if(h&&(i=h),o){const m=o;o=null,m()}},c=()=>new Ose((h,m)=>{i?m(i):o=()=>{i?m(i):h()}});e.on("drain",u);const p=e2(e,{readable:!1},u);try{e.writableNeedDrain&&await c();for await(const h of n)e.write(h)||await c();r&&(e.end(),await c()),t()}catch(h){t(i!==h?Dse(i,h):h)}finally{p(),e.off("drain",u)}}async function R5(n,e,t,{end:r}){Py(e)&&(e=e.writable);const i=e.getWriter();try{for await(const o of n)await i.ready,i.write(o).catch(()=>{});await i.ready,r&&await i.close(),t()}catch(o){try{await i.abort(o),t(o)}catch(u){t(u)}}}function Kse(...n){return yB(n,Pse(Gse(n)))}function yB(n,e,t){if(n.length===1&&Rse(n[0])&&(n=n[0]),n.length<2)throw new Use("streams");const r=new Vse,i=r.signal,o=t==null?void 0:t.signal,u=[];$se(o,"options.signal");function c(){S(new zse)}M5=M5||_s.addAbortListener;let p;o&&(p=M5(o,c));let h,m;const w=[];let b=0;function g(L){S(L,--b===0)}function S(L,D){var q;if(L&&(!h||h.code==="ERR_STREAM_PREMATURE_CLOSE")&&(h=L),!(!h&&!D)){for(;w.length;)w.shift()(h);(q=p)===null||q===void 0||q[Nse](),r.abort(),D&&(h||u.forEach(W=>W()),eb.nextTick(e,h,m))}}let A;for(let L=0;L<n.length;L++){const D=n[L],q=L<n.length-1,W=L>0,de=q||(t==null?void 0:t.end)!==!1,ce=L===n.length-1;if(jN(D)){let me=function(Se){Se&&Se.name!=="AbortError"&&Se.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(Se)};if(de){const{destroy:Se,cleanup:Ce}=$N(D,q,W);w.push(Se),C5(D)&&ce&&u.push(Ce)}D.on("error",me),C5(D)&&ce&&u.push(()=>{D.removeListener("error",me)})}if(L===0)if(typeof D=="function"){if(A=D({signal:i}),!Jp(A))throw new S5("Iterable, AsyncIterable or Stream","source",A)}else Jp(D)||P_(D)||Py(D)?A=D:A=zN.from(D);else if(typeof D=="function"){if(Py(A)){var T;A=T5((T=A)===null||T===void 0?void 0:T.readable)}else A=T5(A);if(A=D(A,{signal:i}),q){if(!Jp(A,!0))throw new S5("AsyncIterable",`transform[${L-1}]`,A)}else{var R;A5||(A5=hB);const me=new A5({objectMode:!0}),Se=(R=A)===null||R===void 0?void 0:R.then;if(typeof Se=="function")b++,Se.call(A,ke=>{m=ke,ke!=null&&me.write(ke),de&&me.end(),eb.nextTick(g)},ke=>{me.destroy(ke),eb.nextTick(g,ke)});else if(Jp(A,!0))b++,g_(A,me,g,{end:de});else if(E5(A)||Py(A)){const ke=A.readable||A;b++,g_(ke,me,g,{end:de})}else throw new S5("AsyncIterable or Promise","destination",A);A=me;const{destroy:Ce,cleanup:ne}=$N(A,!1,!0);w.push(Ce),ce&&u.push(ne)}}else if(jN(D)){if(P_(A)){b+=2;const me=Yse(A,D,g,{end:de});C5(D)&&ce&&u.push(me)}else if(Py(A)||E5(A)){const me=A.readable||A;b++,g_(me,D,g,{end:de})}else if(Jp(A))b++,g_(A,D,g,{end:de});else throw new P8("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=D}else if(Hse(D)){if(P_(A))b++,R5(T5(A),D,g,{end:de});else if(E5(A)||Jp(A))b++,R5(A,D,g,{end:de});else if(Py(A))b++,R5(A.readable,D,g,{end:de});else throw new P8("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=D}else A=zN.from(D)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&eb.nextTick(c),A}function Yse(n,e,t,{end:r}){let i=!1;if(e.on("close",()=>{i||t(new Bse)}),n.pipe(e,{end:!1}),r){let o=function(){i=!0,e.end()};qse(n)?eb.nextTick(o):n.once("end",o)}else t();return e2(n,{readable:!0,writable:!1},o=>{const u=n._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?n.once("end",t).once("error",t):t(o)}),e2(e,{readable:!1,writable:!0},t)}var J4={pipelineImpl:yB,pipeline:Kse};const{pipeline:Jse}=J4,v_=Kc(),{destroyer:Qse}=wm,{isNodeStream:b_,isReadable:HN,isWritable:qN,isWebStream:O5,isTransformStream:Wp,isWritableStream:VN,isReadableStream:GN}=Xc,{AbortError:Zse,codes:{ERR_INVALID_ARG_VALUE:WN,ERR_MISSING_ARGS:Xse}}=Xs,eoe=jd;var mB=function(...e){if(e.length===0)throw new Xse("streams");if(e.length===1)return v_.from(e[0]);const t=[...e];if(typeof e[0]=="function"&&(e[0]=v_.from(e[0])),typeof e[e.length-1]=="function"){const g=e.length-1;e[g]=v_.from(e[g])}for(let g=0;g<e.length;++g)if(!(!b_(e[g])&&!O5(e[g]))){if(g<e.length-1&&!(HN(e[g])||GN(e[g])||Wp(e[g])))throw new WN(`streams[${g}]`,t[g],"must be readable");if(g>0&&!(qN(e[g])||VN(e[g])||Wp(e[g])))throw new WN(`streams[${g}]`,t[g],"must be writable")}let r,i,o,u,c;function p(g){const S=u;u=null,S?S(g):g?c.destroy(g):!b&&!w&&c.destroy()}const h=e[0],m=Jse(e,p),w=!!(qN(h)||VN(h)||Wp(h)),b=!!(HN(m)||GN(m)||Wp(m));if(c=new v_({writableObjectMode:!!(h!=null&&h.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:w,readable:b}),w){if(b_(h))c._write=function(S,A,T){h.write(S,A)?T():r=T},c._final=function(S){h.end(),i=S},h.on("drain",function(){if(r){const S=r;r=null,S()}});else if(O5(h)){const A=(Wp(h)?h.writable:h).getWriter();c._write=async function(T,R,L){try{await A.ready,A.write(T).catch(()=>{}),L()}catch(D){L(D)}},c._final=async function(T){try{await A.ready,A.close().catch(()=>{}),i=T}catch(R){T(R)}}}const g=Wp(m)?m.readable:m;eoe(g,()=>{if(i){const S=i;i=null,S()}})}if(b){if(b_(m))m.on("readable",function(){if(o){const g=o;o=null,g()}}),m.on("end",function(){c.push(null)}),c._read=function(){for(;;){const g=m.read();if(g===null){o=c._read;return}if(!c.push(g))return}};else if(O5(m)){const S=(Wp(m)?m.readable:m).getReader();c._read=async function(){for(;;)try{const{value:A,done:T}=await S.read();if(!c.push(A))return;if(T){c.push(null);return}}catch{return}}}}return c._destroy=function(g,S){!g&&u!==null&&(g=new Zse),o=null,r=null,i=null,u===null?S(g):(u=S,b_(m)&&Qse(m,g))},c};const toe=globalThis.AbortController||Tb().AbortController,{codes:{ERR_INVALID_ARG_VALUE:noe,ERR_INVALID_ARG_TYPE:Yb,ERR_MISSING_ARGS:roe,ERR_OUT_OF_RANGE:aoe},AbortError:Vl}=Xs,{validateAbortSignal:Mh,validateInteger:KN,validateObject:Th}=Wb,ioe=ma.Symbol("kWeak"),soe=ma.Symbol("kResistStopPropagation"),{finished:ooe}=jd,uoe=mB,{addAbortSignalNoValidate:loe}=G2,{isWritable:coe,isNodeStream:foe}=Xc,{deprecate:doe}=_s,{ArrayPrototypePush:poe,Boolean:hoe,MathFloor:YN,Number:yoe,NumberIsNaN:moe,Promise:JN,PromiseReject:QN,PromiseResolve:goe,PromisePrototypeThen:ZN,Symbol:gB}=ma,t2=gB("kEmpty"),XN=gB("kEof");function voe(n,e){if(e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal"),foe(n)&&!coe(n))throw new noe("stream",n,"must be writable");const t=uoe(this,n);return e!=null&&e.signal&&loe(e.signal,t),t}function Y2(n,e){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal");let t=1;(e==null?void 0:e.concurrency)!=null&&(t=YN(e.concurrency));let r=t-1;return(e==null?void 0:e.highWaterMark)!=null&&(r=YN(e.highWaterMark)),KN(t,"options.concurrency",1),KN(r,"options.highWaterMark",0),r+=t,(async function*(){const o=_s.AbortSignalAny([e==null?void 0:e.signal].filter(hoe)),u=this,c=[],p={signal:o};let h,m,w=!1,b=0;function g(){w=!0,S()}function S(){b-=1,A()}function A(){m&&!w&&b<t&&c.length<r&&(m(),m=null)}async function T(){try{for await(let R of u){if(w)return;if(o.aborted)throw new Vl;try{if(R=n(R,p),R===t2)continue;R=goe(R)}catch(L){R=QN(L)}b+=1,ZN(R,S,g),c.push(R),h&&(h(),h=null),!w&&(c.length>=r||b>=t)&&await new JN(L=>{m=L})}c.push(XN)}catch(R){const L=QN(R);ZN(L,S,g),c.push(L)}finally{w=!0,h&&(h(),h=null)}}T();try{for(;;){for(;c.length>0;){const R=await c[0];if(R===XN)return;if(o.aborted)throw new Vl;R!==t2&&(yield R),c.shift(),A()}await new JN(R=>{h=R})}}finally{w=!0,m&&(m(),m=null)}}).call(this)}function boe(n=void 0){return n!=null&&Th(n,"options"),(n==null?void 0:n.signal)!=null&&Mh(n.signal,"options.signal"),(async function*(){let t=0;for await(const i of this){var r;if(n!=null&&(r=n.signal)!==null&&r!==void 0&&r.aborted)throw new Vl({cause:n.signal.reason});yield[t++,i]}}).call(this)}async function vB(n,e=void 0){for await(const t of Q4.call(this,n,e))return!0;return!1}async function woe(n,e=void 0){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);return!await vB.call(this,async(...t)=>!await n(...t),e)}async function xoe(n,e){for await(const t of Q4.call(this,n,e))return t}async function _oe(n,e){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i),t2}for await(const r of Y2.call(this,t,e));}function Q4(n,e){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i)?r:t2}return Y2.call(this,t,e)}class Soe extends roe{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Coe(n,e,t){var r;if(typeof n!="function")throw new Yb("reducer",["Function","AsyncFunction"],n);t!=null&&Th(t,"options"),(t==null?void 0:t.signal)!=null&&Mh(t.signal,"options.signal");let i=arguments.length>1;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted){const h=new Vl(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await ooe(this.destroy(h)),h}const o=new toe,u=o.signal;if(t!=null&&t.signal){const h={once:!0,[ioe]:this,[soe]:!0};t.signal.addEventListener("abort",()=>o.abort(),h)}let c=!1;try{for await(const h of this){var p;if(c=!0,t!=null&&(p=t.signal)!==null&&p!==void 0&&p.aborted)throw new Vl;i?e=await n(e,h,{signal:u}):(e=h,i=!0)}if(!c&&!i)throw new Soe}finally{o.abort()}return e}async function Eoe(n){n!=null&&Th(n,"options"),(n==null?void 0:n.signal)!=null&&Mh(n.signal,"options.signal");const e=[];for await(const r of this){var t;if(n!=null&&(t=n.signal)!==null&&t!==void 0&&t.aborted)throw new Vl(void 0,{cause:n.signal.reason});poe(e,r)}return e}function Aoe(n,e){const t=Y2.call(this,n,e);return(async function*(){for await(const i of t)yield*i}).call(this)}function bB(n){if(n=yoe(n),moe(n))return 0;if(n<0)throw new aoe("number",">= 0",n);return n}function koe(n,e=void 0){return e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal"),n=bB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Vl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Vl;n--<=0&&(yield o)}}).call(this)}function Moe(n,e=void 0){return e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal"),n=bB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Vl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Vl;if(n-- >0&&(yield o),n<=0)return}}).call(this)}B4.streamReturningOperators={asIndexedPairs:doe(boe,"readable.asIndexedPairs will be removed in a future version."),drop:koe,filter:Q4,flatMap:Aoe,map:Y2,take:Moe,compose:voe};B4.promiseReturningOperators={every:woe,forEach:_oe,reduce:Coe,toArray:Eoe,some:vB,find:xoe};var L5,eP;function wB(){if(eP)return L5;eP=1;const{ArrayPrototypePop:n,Promise:e}=ma,{isIterable:t,isNodeStream:r,isWebStream:i}=Xc,{pipelineImpl:o}=J4,{finished:u}=jd;xB();function c(...p){return new e((h,m)=>{let w,b;const g=p[p.length-1];if(g&&typeof g=="object"&&!r(g)&&!t(g)&&!i(g)){const S=n(p);w=S.signal,b=S.end}o(p,(S,A)=>{S?m(S):h(A)},{signal:w,end:b})})}return L5={finished:u,pipeline:c},L5}var tP;function xB(){if(tP)return p5.exports;tP=1;const{Buffer:n}=Bd,{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=ma,{promisify:{custom:i}}=_s,{streamReturningOperators:o,promiseReturningOperators:u}=B4,{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Xs,p=mB,{setDefaultHighWaterMark:h,getDefaultHighWaterMark:m}=W2,{pipeline:w}=J4,{destroyer:b}=wm,g=jd,S=wB(),A=Xc,T=p5.exports=q4.Stream;T.isDestroyed=A.isDestroyed,T.isDisturbed=A.isDisturbed,T.isErrored=A.isErrored,T.isReadable=A.isReadable,T.isWritable=A.isWritable,T.Readable=K2();for(const L of t(o)){let q=function(...W){if(new.target)throw c();return T.Readable.from(r(D,this,W))};const D=o[L];e(q,"name",{__proto__:null,value:D.name}),e(q,"length",{__proto__:null,value:D.length}),e(T.Readable.prototype,L,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}for(const L of t(u)){let q=function(...W){if(new.target)throw c();return r(D,this,W)};const D=u[L];e(q,"name",{__proto__:null,value:D.name}),e(q,"length",{__proto__:null,value:D.length}),e(T.Readable.prototype,L,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}T.Writable=W4(),T.Duplex=Kc(),T.Transform=dB,T.PassThrough=hB,T.pipeline=w;const{addAbortSignal:R}=G2;return T.addAbortSignal=R,T.finished=g,T.destroy=b,T.compose=p,T.setDefaultHighWaterMark=h,T.getDefaultHighWaterMark=m,e(T,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),e(w,i,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return S.finished}}),T.Stream=T,T._isUint8Array=function(D){return D instanceof Uint8Array},T._uint8ArrayToBuffer=function(D){return n.from(D.buffer,D.byteOffset,D.byteLength)},p5.exports}(function(n){const e=xB(),t=wB(),r=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=r,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(SF);var Toe=SF.exports;typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Lb().Buffer);const ky=sU,nP=Toe,Roe=ki;globalThis.process||(globalThis.process=zd());if(typeof crypto>"u"){const n=p2;n.getRandomValues=e=>n.randomBytes(e.length),globalThis.crypto=n}const ii={ElvCrypto:async()=>{try{if(!ii.elvCrypto){const n=(await Promise.resolve().then(()=>require("./index-MQ4UPeZq.js"))).default;ii.elvCrypto=await new n().init()}return ii.elvCrypto}catch(n){console.error("Error initializing ElvCrypto:"),console.error(n)}},EncryptedSize:n=>{const t=Math.floor(n/1e6);let r=ii.EncryptedBlockSize(1e6),i=t*r;return n%1e6!==0&&(i+=ii.EncryptedBlockSize(n%1e6)),i},EncryptedBlockSize:(n,e=!1)=>{let c=Math.floor(n/564)*576;return n%564!==0&&(c+=576),e?c+608:c+129},async EncryptConk(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=new Uint8Array(Buffer.from(JSON.stringify(n)));const{data:r,ephemeralKey:i,tag:o}=await t.encryptECIES(n,e),u=Buffer.concat([Buffer.from(i),Buffer.from(o),Buffer.from(r)]);return Roe.B64(u)},async DecryptCap(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=Buffer.from(n,"base64");const r=n.slice(0,65),i=n.slice(65,81),o=n.slice(81),u=t.decryptECIES(new Uint8Array(o),e,new Uint8Array(r),new Uint8Array(i));return JSON.parse(Buffer.from(u).toString())},async GeneratePrimaryConk({spaceId:n,objectId:e}){const t=await ii.ElvCrypto(),{secretKey:r,publicKey:i}=t.generatePrimaryKeys(),o=t.generateSymmetricKey().key;return{symm_key:`kpsy${ky.encode(Buffer.from(o))}`,secret_key:`kpsk${ky.encode(Buffer.from(r))}`,public_key:`kppk${ky.encode(Buffer.from(i))}`,sid:n,qid:e}},async GenerateTargetConk(){const n=await ii.ElvCrypto(),{secretKey:e,publicKey:t}=n.generateTargetKeys();return{secret_key:`kpsk${ky.encode(Buffer.from(e))}`,public_key:`ktpk${ky.encode(Buffer.from(t))}`}},CapToConk(n){const e=t=>new Uint8Array(ky.decode(t.slice(4)));return{symmetricKey:e(n.symm_key),secretKey:e(n.secret_key),publicKey:e(n.public_key)}},async EncryptionContext(n){const e=await ii.ElvCrypto(),{symmetricKey:t,secretKey:r,publicKey:i}=ii.CapToConk(n);let o,u;return i.length===e.PRIMARY_PK_KEY_SIZE?(u=e.CRYPTO_TYPE_PRIMARY,o=e.newPrimaryContext(i,r,t)):(u=e.CRYPTO_TYPE_TARGET,o=e.newTargetDecryptionContext(r,t)),{context:o,type:u}},Encrypt:async(n,e)=>{const t=await ii.OpenEncryptionStream(n);!Buffer.isBuffer(e)&&!(e instanceof ArrayBuffer)&&(e=Buffer.from(await new Response(e).arrayBuffer()));const r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenEncryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t}=await ii.EncryptionContext(n),r=new nP.PassThrough,i=e.createCipher(t);return r.pipe(i).on("finish",()=>{t.free()}).on("error",o=>{throw Error(o)})},Decrypt:async(n,e)=>{const t=await ii.OpenDecryptionStream(n),r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenDecryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t,type:r}=await ii.EncryptionContext(n),i=new nP.PassThrough,o=e.createDecipher(r,t);return i.pipe(o).on("finish",()=>{t.free()}).on("error",u=>{throw Error(u)})}};var _B=ii,Qr={},rP;function SB(){if(rP)return Qr;rP=1;const n=ki;let e;n.Platform()===n.PLATFORM_NODE&&(globalThis.Response=C4().Response,e=p2);const t=xs,{ValidatePresence:r,ValidateWriteToken:i,ValidatePartHash:o,ValidateParameters:u}=Wo;return Qr.ListFiles=async function({libraryId:c,objectId:p,path:h="",versionHash:m,writeToken:w}){u({libraryId:c,objectId:p,versionHash:m,writeToken:w}),m&&(p=this.utils.DecodeVersionHash(m).objectId);let b=t("q",w||m||p,"files_list",h);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:m}),method:"GET",path:b})},Qr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:h,region:m,bucket:w,fileInfo:b,accessKey:g,secret:S,signedUrl:A,encryption:T="none",copy:R=!1,callback:L}){u({libraryId:c,objectId:p}),i(h);const D=/^s3:\/\/([^/]+)\//i;for(let Se=0;Se<b.length;Se++){const Ce=b[Se].source,ne=D.exec(Ce);if(ne){if(ne[1]!==w)throw Error('Full S3 file path "'+Ce+`" specified, but does not match provided bucket name '`+w+"'");b[Se].source=Ce.replace(D,"")}}R?this.Log(`Copying files from S3: ${c} ${p} ${h}`):this.Log(`Adding links to files in S3: ${c} ${p} ${h}`);let q;if(T==="cgck"){let Se=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h});Se={...Se,secret_key:""},q=`kp__${this.utils.B58(Buffer.from(JSON.stringify(Se)))}`}let W={access_key_id:g,secret_access_key:S};A&&(W={signed_url:A});const de={encryption_key:q,access:{protocol:"s3",platform:"aws",path:w,storage_endpoint:{region:m},cloud_credentials:W}},ce=b.map(Se=>R?{op:"ingest-copy",path:Se.path,encryption:{scheme:T==="cgck"?"cgck":"none"},ingest:{type:"key",path:Se.source}}:{op:"add-reference",path:Se.path,reference:{type:"key",path:Se.source}}),{id:me}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:ce,defaults:de});for(;;){await new Promise(ne=>setTimeout(ne,1e3));const Se=await this.UploadStatus({libraryId:c,objectId:p,writeToken:h,uploadId:me});if(Se.errors&&Se.errors.length>1)throw Se.errors.join(`
326
+ `;super(S),this.name="AggregateError",this.errors=g}}n.exports={AggregateError:w,kEmptyObject:Object.freeze({}),once(b){let g=!1;return function(...S){g||(g=!0,b.apply(this,S))}},createDeferredPromise:function(){let b,g;return{promise:new Promise((A,T)=>{b=A,g=T}),resolve:b,reject:g}},promisify(b){return new Promise((g,S)=>{b((A,...T)=>A?S(A):g(...T))})},debuglog(){return function(){}},format(b,...g){return b.replace(/%([sdifj])/g,function(...[S,A]){const T=g.shift();return A==="f"?T.toFixed(6):A==="j"?JSON.stringify(T):A==="s"&&typeof T=="object"?`${T.constructor!==Object?T.constructor.name:""} {}`.trim():T.toString()})},inspect(b){switch(typeof b){case"string":if(b.includes("'"))if(b.includes('"')){if(!b.includes("`")&&!b.includes("${"))return`\`${b}\``}else return`"${b}"`;return`'${b}'`;case"number":return isNaN(b)?"NaN":Object.is(b,-0)?String(b):b;case"bigint":return`${String(b)}n`;case"boolean":case"undefined":return String(b);case"object":return"{}"}},types:{isAsyncFunction(b){return b instanceof u},isArrayBufferView(b){return ArrayBuffer.isView(b)}},isBlob:p,deprecate(b,g){return b},addAbortListener:Gb.addAbortListener||function(g,S){if(g===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",g);h(g,"signal"),m(S,"listener");let A;return g.aborted?queueMicrotask(()=>S()):(g.addEventListener("abort",S,{__proto__:null,once:!0,[t]:!0}),A=()=>{g.removeEventListener("abort",S)}),{__proto__:null,[r](){var T;(T=A)===null||T===void 0||T()}}},AbortSignalAny:i.any||function(g){if(g.length===1)return g[0];const S=new o,A=()=>S.abort();return g.forEach(T=>{h(T,"signals"),T.addEventListener("abort",A,{once:!0})}),S.signal.addEventListener("abort",()=>{g.forEach(T=>T.removeEventListener("abort",A))},{once:!0}),S.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(CF);var _s=CF.exports,B4={};const{format:lae,inspect:X_,AggregateError:cae}=_s,fae=globalThis.AggregateError||cae,dae=Symbol("kIsNodeError"),pae=["string","function","number","object","Function","Object","boolean","bigint","symbol"],hae=/^([A-Z][a-z0-9]*)+$/,yae="__node_internal_",B2={};function oh(n,e){if(!n)throw new B2.ERR_INTERNAL_ASSERTION(e)}function pN(n){let e="",t=n.length;const r=n[0]==="-"?1:0;for(;t>=r+4;t-=3)e=`_${n.slice(t-3,t)}${e}`;return`${n.slice(0,t)}${e}`}function mae(n,e,t){if(typeof e=="function")return oh(e.length<=t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${e.length}).`),e(...t);const r=(e.match(/%[dfijoOs]/g)||[]).length;return oh(r===t.length,`Code: ${n}; The provided arguments length (${t.length}) does not match the required ones (${r}).`),t.length===0?e:lae(e,...t)}function Mi(n,e,t){t||(t=Error);class r extends t{constructor(...o){super(mae(n,e,o))}toString(){return`${this.name} [${n}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:t.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${n}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=n,r.prototype[dae]=!0,B2[n]=r}function hN(n){const e=yae+n.name;return Object.defineProperty(n,"name",{value:e}),n}function gae(n,e){if(n&&e&&n!==e){if(Array.isArray(e.errors))return e.errors.push(n),e;const t=new fae([e,n],e.message);return t.code=e.code,t}return n||e}let vae=class extends Error{constructor(e="The operation was aborted",t=void 0){if(t!==void 0&&typeof t!="object")throw new B2.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};Mi("ERR_ASSERTION","%s",Error);Mi("ERR_INVALID_ARG_TYPE",(n,e,t)=>{oh(typeof n=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let r="The ";n.endsWith(" argument")?r+=`${n} `:r+=`"${n}" ${n.includes(".")?"property":"argument"} `,r+="must be ";const i=[],o=[],u=[];for(const p of e)oh(typeof p=="string","All expected entries have to be of type string"),pae.includes(p)?i.push(p.toLowerCase()):hae.test(p)?o.push(p):(oh(p!=="object",'The value "object" should be written as "Object"'),u.push(p));if(o.length>0){const p=i.indexOf("object");p!==-1&&(i.splice(i,p,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:r+=`of type ${i[0]}`;break;case 2:r+=`one of type ${i[0]} or ${i[1]}`;break;default:{const p=i.pop();r+=`one of type ${i.join(", ")}, or ${p}`}}(o.length>0||u.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const p=o.pop();r+=`an instance of ${o.join(", ")}, or ${p}`}}u.length>0&&(r+=" or ")}switch(u.length){case 0:break;case 1:u[0].toLowerCase()!==u[0]&&(r+="an "),r+=`${u[0]}`;break;case 2:r+=`one of ${u[0]} or ${u[1]}`;break;default:{const p=u.pop();r+=`one of ${u.join(", ")}, or ${p}`}}if(t==null)r+=`. Received ${t}`;else if(typeof t=="function"&&t.name)r+=`. Received function ${t.name}`;else if(typeof t=="object"){var c;if((c=t.constructor)!==null&&c!==void 0&&c.name)r+=`. Received an instance of ${t.constructor.name}`;else{const p=X_(t,{depth:-1});r+=`. Received ${p}`}}else{let p=X_(t,{colors:!1});p.length>25&&(p=`${p.slice(0,25)}...`),r+=`. Received type ${typeof t} (${p})`}return r},TypeError);Mi("ERR_INVALID_ARG_VALUE",(n,e,t="is invalid")=>{let r=X_(e);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${n.includes(".")?"property":"argument"} '${n}' ${t}. Received ${r}`},TypeError);Mi("ERR_INVALID_RETURN_VALUE",(n,e,t)=>{var r;const i=t!=null&&(r=t.constructor)!==null&&r!==void 0&&r.name?`instance of ${t.constructor.name}`:`type ${typeof t}`;return`Expected ${n} to be returned from the "${e}" function but got ${i}.`},TypeError);Mi("ERR_MISSING_ARGS",(...n)=>{oh(n.length>0,"At least one arg needs to be specified");let e;const t=n.length;switch(n=(Array.isArray(n)?n:[n]).map(r=>`"${r}"`).join(" or "),t){case 1:e+=`The ${n[0]} argument`;break;case 2:e+=`The ${n[0]} and ${n[1]} arguments`;break;default:{const r=n.pop();e+=`The ${n.join(", ")}, and ${r} arguments`}break}return`${e} must be specified`},TypeError);Mi("ERR_OUT_OF_RANGE",(n,e,t)=>{oh(e,'Missing "range" argument');let r;return Number.isInteger(t)&&Math.abs(t)>2**32?r=pN(String(t)):typeof t=="bigint"?(r=String(t),(t>2n**32n||t<-(2n**32n))&&(r=pN(r)),r+="n"):r=X_(t),`The value of "${n}" is out of range. It must be ${e}. Received ${r}`},RangeError);Mi("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Mi("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Mi("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Mi("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Mi("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Mi("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Mi("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Mi("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Mi("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Mi("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Mi("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var Xs={AbortError:vae,aggregateTwoErrors:hN(gae),hideStackFrames:hN,codes:B2};const{ArrayIsArray:z4,ArrayPrototypeIncludes:NF,ArrayPrototypeJoin:PF,ArrayPrototypeMap:bae,NumberIsInteger:j4,NumberIsNaN:wae,NumberMAX_SAFE_INTEGER:xae,NumberMIN_SAFE_INTEGER:_ae,NumberParseInt:Sae,ObjectPrototypeHasOwnProperty:Cae,RegExpPrototypeExec:IF,String:Eae,StringPrototypeToUpperCase:Aae,StringPrototypeTrim:kae}=ma,{hideStackFrames:Ko,codes:{ERR_SOCKET_BAD_PORT:Mae,ERR_INVALID_ARG_TYPE:rs,ERR_INVALID_ARG_VALUE:bm,ERR_OUT_OF_RANGE:yh,ERR_UNKNOWN_SIGNAL:yN}}=Xs,{normalizeEncoding:Tae}=_s,{isAsyncFunction:Rae,isArrayBufferView:Oae}=_s.types,mN={};function Lae(n){return n===(n|0)}function Nae(n){return n===n>>>0}const Pae=/^[0-7]+$/,Iae="must be a 32-bit unsigned integer or an octal string";function Dae(n,e,t){if(typeof n>"u"&&(n=t),typeof n=="string"){if(IF(Pae,n)===null)throw new bm(e,n,Iae);n=Sae(n,8)}return DF(n,e),n}const Uae=Ko((n,e,t=_ae,r=xae)=>{if(typeof n!="number")throw new rs(e,"number",n);if(!j4(n))throw new yh(e,"an integer",n);if(n<t||n>r)throw new yh(e,`>= ${t} && <= ${r}`,n)}),Fae=Ko((n,e,t=-2147483648,r=2147483647)=>{if(typeof n!="number")throw new rs(e,"number",n);if(!j4(n))throw new yh(e,"an integer",n);if(n<t||n>r)throw new yh(e,`>= ${t} && <= ${r}`,n)}),DF=Ko((n,e,t=!1)=>{if(typeof n!="number")throw new rs(e,"number",n);if(!j4(n))throw new yh(e,"an integer",n);const r=t?1:0,i=4294967295;if(n<r||n>i)throw new yh(e,`>= ${r} && <= ${i}`,n)});function $4(n,e){if(typeof n!="string")throw new rs(e,"string",n)}function Bae(n,e,t=void 0,r){if(typeof n!="number")throw new rs(e,"number",n);if(t!=null&&n<t||r!=null&&n>r||(t!=null||r!=null)&&wae(n))throw new yh(e,`${t!=null?`>= ${t}`:""}${t!=null&&r!=null?" && ":""}${r!=null?`<= ${r}`:""}`,n)}const zae=Ko((n,e,t)=>{if(!NF(t,n)){const i="must be one of: "+PF(bae(t,o=>typeof o=="string"?`'${o}'`:Eae(o)),", ");throw new bm(e,n,i)}});function UF(n,e){if(typeof n!="boolean")throw new rs(e,"boolean",n)}function h5(n,e,t){return n==null||!Cae(n,e)?t:n[e]}const jae=Ko((n,e,t=null)=>{const r=h5(t,"allowArray",!1),i=h5(t,"allowFunction",!1);if(!h5(t,"nullable",!1)&&n===null||!r&&z4(n)||typeof n!="object"&&(!i||typeof n!="function"))throw new rs(e,"Object",n)}),$ae=Ko((n,e)=>{if(n!=null&&typeof n!="object"&&typeof n!="function")throw new rs(e,"a dictionary",n)}),z2=Ko((n,e,t=0)=>{if(!z4(n))throw new rs(e,"Array",n);if(n.length<t){const r=`must be longer than ${t}`;throw new bm(e,n,r)}});function Hae(n,e){z2(n,e);for(let t=0;t<n.length;t++)$4(n[t],`${e}[${t}]`)}function qae(n,e){z2(n,e);for(let t=0;t<n.length;t++)UF(n[t],`${e}[${t}]`)}function Vae(n,e){z2(n,e);for(let t=0;t<n.length;t++){const r=n[t],i=`${e}[${t}]`;if(r==null)throw new rs(i,"AbortSignal",r);FF(r,i)}}function Gae(n,e="signal"){if($4(n,e),mN[n]===void 0)throw mN[Aae(n)]!==void 0?new yN(n+" (signals must use all capital letters)"):new yN(n)}const Wae=Ko((n,e="buffer")=>{if(!Oae(n))throw new rs(e,["Buffer","TypedArray","DataView"],n)});function Kae(n,e){const t=Tae(e),r=n.length;if(t==="hex"&&r%2!==0)throw new bm("encoding",e,`is invalid for data of length ${r}`)}function Yae(n,e="Port",t=!0){if(typeof n!="number"&&typeof n!="string"||typeof n=="string"&&kae(n).length===0||+n!==+n>>>0||n>65535||n===0&&!t)throw new Mae(e,n,t);return n|0}const FF=Ko((n,e)=>{if(n!==void 0&&(n===null||typeof n!="object"||!("aborted"in n)))throw new rs(e,"AbortSignal",n)}),Jae=Ko((n,e)=>{if(typeof n!="function")throw new rs(e,"Function",n)}),Qae=Ko((n,e)=>{if(typeof n!="function"||Rae(n))throw new rs(e,"Function",n)}),Zae=Ko((n,e)=>{if(n!==void 0)throw new rs(e,"undefined",n)});function Xae(n,e,t){if(!NF(t,n))throw new rs(e,`('${PF(t,"|")}')`,n)}const eie=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function gN(n,e){if(typeof n>"u"||!IF(eie,n))throw new bm(e,n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function tie(n){if(typeof n=="string")return gN(n,"hints"),n;if(z4(n)){const e=n.length;let t="";if(e===0)return t;for(let r=0;r<e;r++){const i=n[r];gN(i,"hints"),t+=i,r!==e-1&&(t+=", ")}return t}throw new bm("hints",n,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}var Wb={isInt32:Lae,isUint32:Nae,parseFileMode:Dae,validateArray:z2,validateStringArray:Hae,validateBooleanArray:qae,validateAbortSignalArray:Vae,validateBoolean:UF,validateBuffer:Wae,validateDictionary:$ae,validateEncoding:Kae,validateFunction:Jae,validateInt32:Fae,validateInteger:Uae,validateNumber:Bae,validateObject:jae,validateOneOf:zae,validatePlainFunction:Qae,validatePort:Yae,validateSignalName:Gae,validateString:$4,validateUint32:DF,validateUndefined:Zae,validateUnion:Xae,validateAbortSignal:FF,validateLinkHeaderValue:tie},H4={exports:{}},y5={exports:{}},vN;function zd(){if(vN)return y5.exports;vN=1;var n=y5.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function o(A){if(e===setTimeout)return setTimeout(A,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch{try{return e.call(null,A,0)}catch{return e.call(this,A,0)}}}function u(A){if(t===clearTimeout)return clearTimeout(A);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(A);try{return t(A)}catch{try{return t.call(null,A)}catch{return t.call(this,A)}}}var c=[],p=!1,h,m=-1;function w(){!p||!h||(p=!1,h.length?c=h.concat(c):m=-1,c.length&&b())}function b(){if(!p){var A=o(w);p=!0;for(var T=c.length;T;){for(h=c,c=[];++m<T;)h&&h[m].run();m=-1,T=c.length}h=null,p=!1,u(A)}}n.nextTick=function(A){var T=new Array(arguments.length-1);if(arguments.length>1)for(var R=1;R<arguments.length;R++)T[R-1]=arguments[R];c.push(new g(A,T)),c.length===1&&!p&&o(b)};function g(A,T){this.fun=A,this.array=T}g.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function S(){}return n.on=S,n.addListener=S,n.once=S,n.off=S,n.removeListener=S,n.removeAllListeners=S,n.emit=S,n.prependListener=S,n.prependOnceListener=S,n.listeners=function(A){return[]},n.binding=function(A){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(A){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},y5.exports}const{SymbolAsyncIterator:bN,SymbolIterator:wN,SymbolFor:kh}=ma,BF=kh("nodejs.stream.destroyed"),zF=kh("nodejs.stream.errored"),C8=kh("nodejs.stream.readable"),E8=kh("nodejs.stream.writable"),jF=kh("nodejs.stream.disturbed"),nie=kh("nodejs.webstream.isClosedPromise"),rie=kh("nodejs.webstream.controllerErrorFunction");function j2(n,e=!1){var t;return!!(n&&typeof n.pipe=="function"&&typeof n.on=="function"&&(!e||typeof n.pause=="function"&&typeof n.resume=="function")&&(!n._writableState||((t=n._readableState)===null||t===void 0?void 0:t.readable)!==!1)&&(!n._writableState||n._readableState))}function $2(n){var e;return!!(n&&typeof n.write=="function"&&typeof n.on=="function"&&(!n._readableState||((e=n._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function aie(n){return!!(n&&typeof n.pipe=="function"&&n._readableState&&typeof n.on=="function"&&typeof n.write=="function")}function Yl(n){return n&&(n._readableState||n._writableState||typeof n.write=="function"&&typeof n.on=="function"||typeof n.pipe=="function"&&typeof n.on=="function")}function $F(n){return!!(n&&!Yl(n)&&typeof n.pipeThrough=="function"&&typeof n.getReader=="function"&&typeof n.cancel=="function")}function HF(n){return!!(n&&!Yl(n)&&typeof n.getWriter=="function"&&typeof n.abort=="function")}function qF(n){return!!(n&&!Yl(n)&&typeof n.readable=="object"&&typeof n.writable=="object")}function iie(n){return $F(n)||HF(n)||qF(n)}function sie(n,e){return n==null?!1:e===!0?typeof n[bN]=="function":e===!1?typeof n[wN]=="function":typeof n[bN]=="function"||typeof n[wN]=="function"}function H2(n){if(!Yl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!!(n.destroyed||n[BF]||r!=null&&r.destroyed)}function VF(n){if(!$2(n))return null;if(n.writableEnded===!0)return!0;const e=n._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function oie(n,e){if(!$2(n))return null;if(n.writableFinished===!0)return!0;const t=n._writableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.finished)!="boolean"?null:!!(t.finished||e===!1&&t.ended===!0&&t.length===0)}function uie(n){if(!j2(n))return null;if(n.readableEnded===!0)return!0;const e=n._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function GF(n,e){if(!j2(n))return null;const t=n._readableState;return t!=null&&t.errored?!1:typeof(t==null?void 0:t.endEmitted)!="boolean"?null:!!(t.endEmitted||e===!1&&t.ended===!0&&t.length===0)}function WF(n){return n&&n[C8]!=null?n[C8]:typeof(n==null?void 0:n.readable)!="boolean"?null:H2(n)?!1:j2(n)&&n.readable&&!GF(n)}function KF(n){return n&&n[E8]!=null?n[E8]:typeof(n==null?void 0:n.writable)!="boolean"?null:H2(n)?!1:$2(n)&&n.writable&&!VF(n)}function lie(n,e){return Yl(n)?H2(n)?!0:!((e==null?void 0:e.readable)!==!1&&WF(n)||(e==null?void 0:e.writable)!==!1&&KF(n)):null}function cie(n){var e,t;return Yl(n)?n.writableErrored?n.writableErrored:(e=(t=n._writableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function fie(n){var e,t;return Yl(n)?n.readableErrored?n.readableErrored:(e=(t=n._readableState)===null||t===void 0?void 0:t.errored)!==null&&e!==void 0?e:null:null}function die(n){if(!Yl(n))return null;if(typeof n.closed=="boolean")return n.closed;const e=n._writableState,t=n._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(t==null?void 0:t.closed)=="boolean"?(e==null?void 0:e.closed)||(t==null?void 0:t.closed):typeof n._closed=="boolean"&&YF(n)?n._closed:null}function YF(n){return typeof n._closed=="boolean"&&typeof n._defaultKeepAlive=="boolean"&&typeof n._removedConnection=="boolean"&&typeof n._removedContLen=="boolean"}function JF(n){return typeof n._sent100=="boolean"&&YF(n)}function pie(n){var e;return typeof n._consuming=="boolean"&&typeof n._dumped=="boolean"&&((e=n.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function hie(n){if(!Yl(n))return null;const e=n._writableState,t=n._readableState,r=e||t;return!r&&JF(n)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function yie(n){var e;return!!(n&&((e=n[jF])!==null&&e!==void 0?e:n.readableDidRead||n.readableAborted))}function mie(n){var e,t,r,i,o,u,c,p,h,m;return!!(n&&((e=(t=(r=(i=(o=(u=n[zF])!==null&&u!==void 0?u:n.readableErrored)!==null&&o!==void 0?o:n.writableErrored)!==null&&i!==void 0?i:(c=n._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&r!==void 0?r:(p=n._writableState)===null||p===void 0?void 0:p.errorEmitted)!==null&&t!==void 0?t:(h=n._readableState)===null||h===void 0?void 0:h.errored)!==null&&e!==void 0?e:!((m=n._writableState)===null||m===void 0)&&m.errored))}var Xc={isDestroyed:H2,kIsDestroyed:BF,isDisturbed:yie,kIsDisturbed:jF,isErrored:mie,kIsErrored:zF,isReadable:WF,kIsReadable:C8,kIsClosedPromise:nie,kControllerErrorFunction:rie,kIsWritable:E8,isClosed:die,isDuplexNodeStream:aie,isFinished:lie,isIterable:sie,isReadableNodeStream:j2,isReadableStream:$F,isReadableEnded:uie,isReadableFinished:GF,isReadableErrored:fie,isNodeStream:Yl,isWebStream:iie,isWritable:KF,isWritableNodeStream:$2,isWritableStream:HF,isWritableEnded:VF,isWritableFinished:oie,isWritableErrored:cie,isServerRequest:pie,isServerResponse:JF,willEmitClose:hie,isTransformStream:qF};const vd=zd(),{AbortError:QF,codes:gie}=Xs,{ERR_INVALID_ARG_TYPE:vie,ERR_STREAM_PREMATURE_CLOSE:xN}=gie,{kEmptyObject:A8,once:k8}=_s,{validateAbortSignal:bie,validateFunction:wie,validateObject:xie,validateBoolean:_ie}=Wb,{Promise:Sie,PromisePrototypeThen:Cie,SymbolDispose:ZF}=ma,{isClosed:Eie,isReadable:_N,isReadableNodeStream:m5,isReadableStream:Aie,isReadableFinished:SN,isReadableErrored:CN,isWritable:EN,isWritableNodeStream:AN,isWritableStream:kie,isWritableFinished:kN,isWritableErrored:MN,isNodeStream:Mie,willEmitClose:Tie,kIsClosedPromise:Rie}=Xc;let qy;function Oie(n){return n.setHeader&&typeof n.abort=="function"}const M8=()=>{};function XF(n,e,t){var r,i;if(arguments.length===2?(t=e,e=A8):e==null?e=A8:xie(e,"options"),wie(t,"callback"),bie(e.signal,"options.signal"),t=k8(t),Aie(n)||kie(n))return Lie(n,e,t);if(!Mie(n))throw new vie("stream",["ReadableStream","WritableStream","Stream"],n);const o=(r=e.readable)!==null&&r!==void 0?r:m5(n),u=(i=e.writable)!==null&&i!==void 0?i:AN(n),c=n._writableState,p=n._readableState,h=()=>{n.writable||b()};let m=Tie(n)&&m5(n)===o&&AN(n)===u,w=kN(n,!1);const b=()=>{w=!0,n.destroyed&&(m=!1),!(m&&(!n.readable||o))&&(!o||g)&&t.call(n)};let g=SN(n,!1);const S=()=>{g=!0,n.destroyed&&(m=!1),!(m&&(!n.writable||u))&&(!u||w)&&t.call(n)},A=W=>{t.call(n,W)};let T=Eie(n);const R=()=>{T=!0;const W=MN(n)||CN(n);if(W&&typeof W!="boolean")return t.call(n,W);if(o&&!g&&m5(n,!0)&&!SN(n,!1))return t.call(n,new xN);if(u&&!w&&!kN(n,!1))return t.call(n,new xN);t.call(n)},L=()=>{T=!0;const W=MN(n)||CN(n);if(W&&typeof W!="boolean")return t.call(n,W);t.call(n)},D=()=>{n.req.on("finish",b)};Oie(n)?(n.on("complete",b),m||n.on("abort",R),n.req?D():n.on("request",D)):u&&!c&&(n.on("end",h),n.on("close",h)),!m&&typeof n.aborted=="boolean"&&n.on("aborted",R),n.on("end",S),n.on("finish",b),e.error!==!1&&n.on("error",A),n.on("close",R),T?vd.nextTick(R):c!=null&&c.errorEmitted||p!=null&&p.errorEmitted?m||vd.nextTick(L):(!o&&(!m||_N(n))&&(w||EN(n)===!1)||!u&&(!m||EN(n))&&(g||_N(n)===!1)||p&&n.req&&n.aborted)&&vd.nextTick(L);const q=()=>{t=M8,n.removeListener("aborted",R),n.removeListener("complete",b),n.removeListener("abort",R),n.removeListener("request",D),n.req&&n.req.removeListener("finish",b),n.removeListener("end",h),n.removeListener("close",h),n.removeListener("finish",b),n.removeListener("end",S),n.removeListener("error",A),n.removeListener("close",R)};if(e.signal&&!T){const W=()=>{const de=t;q(),de.call(n,new QF(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)vd.nextTick(W);else{qy=qy||_s.addAbortListener;const de=qy(e.signal,W),ce=t;t=k8((...me)=>{de[ZF](),ce.apply(n,me)})}}return q}function Lie(n,e,t){let r=!1,i=M8;if(e.signal)if(i=()=>{r=!0,t.call(n,new QF(void 0,{cause:e.signal.reason}))},e.signal.aborted)vd.nextTick(i);else{qy=qy||_s.addAbortListener;const u=qy(e.signal,i),c=t;t=k8((...p)=>{u[ZF](),c.apply(n,p)})}const o=(...u)=>{r||vd.nextTick(()=>t.apply(n,u))};return Cie(n[Rie].promise,o,o),M8}function Nie(n,e){var t;let r=!1;return e===null&&(e=A8),(t=e)!==null&&t!==void 0&&t.cleanup&&(_ie(e.cleanup,"cleanup"),r=e.cleanup),new Sie((i,o)=>{const u=XF(n,e,c=>{r&&u(),c?o(c):i()})})}H4.exports=XF;H4.exports.finished=Nie;var jd=H4.exports;const Bl=zd(),{aggregateTwoErrors:Pie,codes:{ERR_MULTIPLE_CALLBACK:Iie},AbortError:Die}=Xs,{Symbol:eB}=ma,{kIsDestroyed:Uie,isDestroyed:Fie,isFinished:Bie,isServerRequest:zie}=Xc,tB=eB("kDestroy"),T8=eB("kConstruct");function nB(n,e,t){n&&(n.stack,e&&!e.errored&&(e.errored=n),t&&!t.errored&&(t.errored=n))}function jie(n,e){const t=this._readableState,r=this._writableState,i=r||t;return r!=null&&r.destroyed||t!=null&&t.destroyed?(typeof e=="function"&&e(),this):(nB(n,r,t),r&&(r.destroyed=!0),t&&(t.destroyed=!0),i.constructed?TN(this,n,e):this.once(tB,function(o){TN(this,Pie(o,n),e)}),this)}function TN(n,e,t){let r=!1;function i(o){if(r)return;r=!0;const u=n._readableState,c=n._writableState;nB(o,c,u),c&&(c.closed=!0),u&&(u.closed=!0),typeof t=="function"&&t(o),o?Bl.nextTick($ie,n,o):Bl.nextTick(rB,n)}try{n._destroy(e||null,i)}catch(o){i(o)}}function $ie(n,e){R8(n,e),rB(n)}function rB(n){const e=n._readableState,t=n._writableState;t&&(t.closeEmitted=!0),e&&(e.closeEmitted=!0),(t!=null&&t.emitClose||e!=null&&e.emitClose)&&n.emit("close")}function R8(n,e){const t=n._readableState,r=n._writableState;r!=null&&r.errorEmitted||t!=null&&t.errorEmitted||(r&&(r.errorEmitted=!0),t&&(t.errorEmitted=!0),n.emit("error",e))}function Hie(){const n=this._readableState,e=this._writableState;n&&(n.constructed=!0,n.closed=!1,n.closeEmitted=!1,n.destroyed=!1,n.errored=null,n.errorEmitted=!1,n.reading=!1,n.ended=n.readable===!1,n.endEmitted=n.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function O8(n,e,t){const r=n._readableState,i=n._writableState;if(i!=null&&i.destroyed||r!=null&&r.destroyed)return this;r!=null&&r.autoDestroy||i!=null&&i.autoDestroy?n.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),r&&!r.errored&&(r.errored=e),t?Bl.nextTick(R8,n,e):R8(n,e))}function qie(n,e){if(typeof n._construct!="function")return;const t=n._readableState,r=n._writableState;t&&(t.constructed=!1),r&&(r.constructed=!1),n.once(T8,e),!(n.listenerCount(T8)>1)&&Bl.nextTick(Vie,n)}function Vie(n){let e=!1;function t(r){if(e){O8(n,r??new Iie);return}e=!0;const i=n._readableState,o=n._writableState,u=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),u.destroyed?n.emit(tB,r):r?O8(n,r,!0):Bl.nextTick(Gie,n)}try{n._construct(r=>{Bl.nextTick(t,r)})}catch(r){Bl.nextTick(t,r)}}function Gie(n){n.emit(T8)}function RN(n){return(n==null?void 0:n.setHeader)&&typeof n.abort=="function"}function aB(n){n.emit("close")}function Wie(n,e){n.emit("error",e),Bl.nextTick(aB,n)}function Kie(n,e){!n||Fie(n)||(!e&&!Bie(n)&&(e=new Die),zie(n)?(n.socket=null,n.destroy(e)):RN(n)?n.abort():RN(n.req)?n.req.abort():typeof n.destroy=="function"?n.destroy(e):typeof n.close=="function"?n.close():e?Bl.nextTick(Wie,n,e):Bl.nextTick(aB,n),n.destroyed||(n[Uie]=!0))}var wm={construct:qie,destroyer:Kie,destroy:jie,undestroy:Hie,errorOrDestroy:O8};const{ArrayIsArray:Yie,ObjectSetPrototypeOf:iB}=ma,{EventEmitter:q2}=Gb;function V2(n){q2.call(this,n)}iB(V2.prototype,q2.prototype);iB(V2,q2);V2.prototype.pipe=function(n,e){const t=this;function r(m){n.writable&&n.write(m)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}n.on("drain",i),!n._isStdio&&(!e||e.end!==!1)&&(t.on("end",u),t.on("close",c));let o=!1;function u(){o||(o=!0,n.end())}function c(){o||(o=!0,typeof n.destroy=="function"&&n.destroy())}function p(m){h(),q2.listenerCount(this,"error")===0&&this.emit("error",m)}L8(t,"error",p),L8(n,"error",p);function h(){t.removeListener("data",r),n.removeListener("drain",i),t.removeListener("end",u),t.removeListener("close",c),t.removeListener("error",p),n.removeListener("error",p),t.removeListener("end",h),t.removeListener("close",h),n.removeListener("close",h)}return t.on("end",h),t.on("close",h),n.on("close",h),n.emit("pipe",t),n};function L8(n,e,t){if(typeof n.prependListener=="function")return n.prependListener(e,t);!n._events||!n._events[e]?n.on(e,t):Yie(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]}var q4={Stream:V2,prependListener:L8},sB={exports:{}};(function(n){const{SymbolDispose:e}=ma,{AbortError:t,codes:r}=Xs,{isNodeStream:i,isWebStream:o,kControllerErrorFunction:u}=Xc,c=jd,{ERR_INVALID_ARG_TYPE:p}=r;let h;const m=(w,b)=>{if(typeof w!="object"||!("aborted"in w))throw new p(b,"AbortSignal",w)};n.exports.addAbortSignal=function(b,g){if(m(b,"signal"),!i(g)&&!o(g))throw new p("stream",["ReadableStream","WritableStream","Stream"],g);return n.exports.addAbortSignalNoValidate(b,g)},n.exports.addAbortSignalNoValidate=function(w,b){if(typeof w!="object"||!("aborted"in w))return b;const g=i(b)?()=>{b.destroy(new t(void 0,{cause:w.reason}))}:()=>{b[u](new t(void 0,{cause:w.reason}))};if(w.aborted)g();else{h=h||_s.addAbortListener;const S=h(w,g);c(b,S[e])}return b}})(sB);var G2=sB.exports;const{StringPrototypeSlice:ON,SymbolIterator:Jie,TypedArrayPrototypeSet:m_,Uint8Array:Qie}=ma,{Buffer:g5}=Bd,{inspect:Zie}=_s;var Xie=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;const e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let t=this.head,r=""+t.data;for(;(t=t.next)!==null;)r+=e+t.data;return r}concat(e){if(this.length===0)return g5.alloc(0);const t=g5.allocUnsafe(e>>>0);let r=this.head,i=0;for(;r;)m_(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const i=r.slice(0,e);return this.head.data=r.slice(e),i}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Jie](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(e>o.length)t+=o,e-=o.length;else{e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=ON(o,0,e),this.head=r,r.data=ON(o,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){const t=g5.allocUnsafe(e),r=e;let i=this.head,o=0;do{const u=i.data;if(e>u.length)m_(t,u,r-e),e-=u.length;else{e===u.length?(m_(t,u,r-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(m_(t,new Qie(u.buffer,u.byteOffset,e),r-e),this.head=i,i.data=u.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return Zie(this,{...t,depth:0,customInspect:!1})}};const{MathFloor:ese,NumberIsInteger:tse}=ma,{validateInteger:nse}=Wb,{ERR_INVALID_ARG_VALUE:rse}=Xs.codes;let oB=16*1024,uB=16;function ase(n,e,t){return n.highWaterMark!=null?n.highWaterMark:e?n[t]:null}function lB(n){return n?uB:oB}function ise(n,e){nse(e,"value",0),n?uB=e:oB=e}function sse(n,e,t,r){const i=ase(e,r,t);if(i!=null){if(!tse(i)||i<0){const o=r?`options.${t}`:"options.highWaterMark";throw new rse(o,i)}return ese(i)}return lB(n.objectMode)}var W2={getHighWaterMark:sse,getDefaultHighWaterMark:lB,setDefaultHighWaterMark:ise},V4={},G4=iU.Buffer,LN=G4.isEncoding||function(n){switch(n=""+n,n&&n.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function ose(n){if(!n)return"utf8";for(var e;;)switch(n){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return n;default:if(e)return;n=(""+n).toLowerCase(),e=!0}}function use(n){var e=ose(n);if(typeof e!="string"&&(G4.isEncoding===LN||!LN(n)))throw new Error("Unknown encoding: "+n);return e||n}V4.StringDecoder=Kb;function Kb(n){this.encoding=use(n);var e;switch(this.encoding){case"utf16le":this.text=hse,this.end=yse,e=4;break;case"utf8":this.fillLast=fse,e=4;break;case"base64":this.text=mse,this.end=gse,e=3;break;default:this.write=vse,this.end=bse;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=G4.allocUnsafe(e)}Kb.prototype.write=function(n){if(n.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(n),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<n.length?e?e+this.text(n,t):this.text(n,t):e||""};Kb.prototype.end=pse;Kb.prototype.text=dse;Kb.prototype.fillLast=function(n){if(this.lastNeed<=n.length)return n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,this.lastTotal-this.lastNeed,0,n.length),this.lastNeed-=n.length};function v5(n){return n<=127?0:n>>5===6?2:n>>4===14?3:n>>3===30?4:n>>6===2?-1:-2}function lse(n,e,t){var r=e.length-1;if(r<t)return 0;var i=v5(e[r]);return i>=0?(i>0&&(n.lastNeed=i-1),i):--r<t||i===-2?0:(i=v5(e[r]),i>=0?(i>0&&(n.lastNeed=i-2),i):--r<t||i===-2?0:(i=v5(e[r]),i>=0?(i>0&&(i===2?i=0:n.lastNeed=i-3),i):0))}function cse(n,e,t){if((e[0]&192)!==128)return n.lastNeed=0,"�";if(n.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return n.lastNeed=1,"�";if(n.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return n.lastNeed=2,"�"}}function fse(n){var e=this.lastTotal-this.lastNeed,t=cse(this,n);if(t!==void 0)return t;if(this.lastNeed<=n.length)return n.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);n.copy(this.lastChar,e,0,n.length),this.lastNeed-=n.length}function dse(n,e){var t=lse(this,n,e);if(!this.lastNeed)return n.toString("utf8",e);this.lastTotal=t;var r=n.length-(t-this.lastNeed);return n.copy(this.lastChar,0,r),n.toString("utf8",e,r)}function pse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+"�":e}function hse(n,e){if((n.length-e)%2===0){var t=n.toString("utf16le",e);if(t){var r=t.charCodeAt(t.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=n[n.length-1],n.toString("utf16le",e,n.length-1)}function yse(n){var e=n&&n.length?this.write(n):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function mse(n,e){var t=(n.length-e)%3;return t===0?n.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=n[n.length-1]:(this.lastChar[0]=n[n.length-2],this.lastChar[1]=n[n.length-1]),n.toString("base64",e,n.length-t))}function gse(n){var e=n&&n.length?this.write(n):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function vse(n){return n.toString(this.encoding)}function bse(n){return n&&n.length?this.write(n):""}const NN=zd(),{PromisePrototypeThen:wse,SymbolAsyncIterator:PN,SymbolIterator:IN}=ma,{Buffer:xse}=Bd,{ERR_INVALID_ARG_TYPE:_se,ERR_STREAM_NULL_VALUES:Sse}=Xs.codes;function Cse(n,e,t){let r;if(typeof e=="string"||e instanceof xse)return new n({objectMode:!0,...t,read(){this.push(e),this.push(null)}});let i;if(e&&e[PN])i=!0,r=e[PN]();else if(e&&e[IN])i=!1,r=e[IN]();else throw new _se("iterable",["Iterable"],e);const o=new n({objectMode:!0,highWaterMark:1,...t});let u=!1;o._read=function(){u||(u=!0,p())},o._destroy=function(h,m){wse(c(h),()=>NN.nextTick(m,h),w=>NN.nextTick(m,w||h))};async function c(h){const m=h!=null,w=typeof r.throw=="function";if(m&&w){const{value:b,done:g}=await r.throw(h);if(await b,g)return}if(typeof r.return=="function"){const{value:b}=await r.return();await b}}async function p(){for(;;){try{const{value:h,done:m}=i?await r.next():r.next();if(m)o.push(null);else{const w=h&&typeof h.then=="function"?await h:h;if(w===null)throw u=!1,new Sse;if(o.push(w))continue;u=!1}}catch(h){o.destroy(h)}break}}return o}var cB=Cse,b5,DN;function K2(){if(DN)return b5;DN=1;const n=zd(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:p,SafeSet:h,SymbolAsyncDispose:m,SymbolAsyncIterator:w,Symbol:b}=ma;b5=Ne,Ne.ReadableState=Ee;const{EventEmitter:g}=Gb,{Stream:S,prependListener:A}=q4,{Buffer:T}=Bd,{addAbortSignal:R}=G2,L=jd;let D=_s.debuglog("stream",ve=>{D=ve});const q=Xie,W=wm,{getHighWaterMark:de,getDefaultHighWaterMark:ce}=W2,{aggregateTwoErrors:me,codes:{ERR_INVALID_ARG_TYPE:Se,ERR_METHOD_NOT_IMPLEMENTED:Ce,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:ke,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C},AbortError:_}=Xs,{validateObject:O}=Wb,z=b("kPaused"),{StringDecoder:F}=V4,j=cB;c(Ne.prototype,S.prototype),c(Ne,S);const Q=()=>{},{errorOrDestroy:ae}=W,N=1,k=2,Y=4,ie=8,$=16,be=32,Ie=64,Me=128,Ue=256,se=512,fe=1024,pe=2048,ue=4096,te=8192,ye=16384,J=32768,P=65536,U=1<<17,ee=1<<18;function oe(ve){return{enumerable:!1,get(){return(this.state&ve)!==0},set(_e){_e?this.state|=ve:this.state&=~ve}}}o(Ee.prototype,{objectMode:oe(N),ended:oe(k),endEmitted:oe(Y),reading:oe(ie),constructed:oe($),sync:oe(be),needReadable:oe(Ie),emittedReadable:oe(Me),readableListening:oe(Ue),resumeScheduled:oe(se),errorEmitted:oe(fe),emitClose:oe(pe),autoDestroy:oe(ue),destroyed:oe(te),closed:oe(ye),closeEmitted:oe(J),multiAwaitDrain:oe(P),readingMore:oe(U),dataEmitted:oe(ee)});function Ee(ve,_e,ct){typeof ct!="boolean"&&(ct=_e instanceof Kc()),this.state=pe|ue|$|be,ve&&ve.objectMode&&(this.state|=N),ct&&ve&&ve.readableObjectMode&&(this.state|=N),this.highWaterMark=ve?de(this,ve,"readableHighWaterMark",ct):ce(!1),this.buffer=new q,this.length=0,this.pipes=[],this.flowing=null,this[z]=null,ve&&ve.emitClose===!1&&(this.state&=~pe),ve&&ve.autoDestroy===!1&&(this.state&=~ue),this.errored=null,this.defaultEncoding=ve&&ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,ve&&ve.encoding&&(this.decoder=new F(ve.encoding),this.encoding=ve.encoding)}function Ne(ve){if(!(this instanceof Ne))return new Ne(ve);const _e=this instanceof Kc();this._readableState=new Ee(ve,this,_e),ve&&(typeof ve.read=="function"&&(this._read=ve.read),typeof ve.destroy=="function"&&(this._destroy=ve.destroy),typeof ve.construct=="function"&&(this._construct=ve.construct),ve.signal&&!_e&&R(ve.signal,this)),S.call(this,ve),W.construct(this,()=>{this._readableState.needReadable&&xe(this,this._readableState)})}Ne.prototype.destroy=W.destroy,Ne.prototype._undestroy=W.undestroy,Ne.prototype._destroy=function(ve,_e){_e(ve)},Ne.prototype[g.captureRejectionSymbol]=function(ve){this.destroy(ve)},Ne.prototype[m]=function(){let ve;return this.destroyed||(ve=this.readableEnded?null:new _,this.destroy(ve)),new p((_e,ct)=>L(this,at=>at&&at!==ve?ct(at):_e(null)))},Ne.prototype.push=function(ve,_e){return Qe(this,ve,_e,!1)},Ne.prototype.unshift=function(ve,_e){return Qe(this,ve,_e,!0)};function Qe(ve,_e,ct,at){D("readableAddChunk",_e);const ft=ve._readableState;let Un;if(ft.state&N||(typeof _e=="string"?(ct=ct||ft.defaultEncoding,ft.encoding!==ct&&(at&&ft.encoding?_e=T.from(_e,ct).toString(ft.encoding):(_e=T.from(_e,ct),ct=""))):_e instanceof T?ct="":S._isUint8Array(_e)?(_e=S._uint8ArrayToBuffer(_e),ct=""):_e!=null&&(Un=new Se("chunk",["string","Buffer","Uint8Array"],_e))),Un)ae(ve,Un);else if(_e===null)ft.state&=~ie,H(ve,ft);else if(ft.state&N||_e&&_e.length>0)if(at)if(ft.state&Y)ae(ve,new C);else{if(ft.destroyed||ft.errored)return!1;st(ve,ft,_e,!0)}else if(ft.ended)ae(ve,new ke);else{if(ft.destroyed||ft.errored)return!1;ft.state&=~ie,ft.decoder&&!ct?(_e=ft.decoder.write(_e),ft.objectMode||_e.length!==0?st(ve,ft,_e,!1):xe(ve,ft)):st(ve,ft,_e,!1)}else at||(ft.state&=~ie,xe(ve,ft));return!ft.ended&&(ft.length<ft.highWaterMark||ft.length===0)}function st(ve,_e,ct,at){_e.flowing&&_e.length===0&&!_e.sync&&ve.listenerCount("data")>0?(_e.state&P?_e.awaitDrainWriters.clear():_e.awaitDrainWriters=null,_e.dataEmitted=!0,ve.emit("data",ct)):(_e.length+=_e.objectMode?1:ct.length,at?_e.buffer.unshift(ct):_e.buffer.push(ct),_e.state&Ie&&G(ve)),xe(ve,_e)}Ne.prototype.isPaused=function(){const ve=this._readableState;return ve[z]===!0||ve.flowing===!1},Ne.prototype.setEncoding=function(ve){const _e=new F(ve);this._readableState.decoder=_e,this._readableState.encoding=this._readableState.decoder.encoding;const ct=this._readableState.buffer;let at="";for(const ft of ct)at+=_e.write(ft);return ct.clear(),at!==""&&ct.push(at),this._readableState.length=at.length,this};const xt=1073741824;function St(ve){if(ve>xt)throw new ne("size","<= 1GiB",ve);return ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,ve++,ve}function Z(ve,_e){return ve<=0||_e.length===0&&_e.ended?0:_e.state&N?1:r(ve)?_e.flowing&&_e.length?_e.buffer.first().length:_e.length:ve<=_e.length?ve:_e.ended?_e.length:0}Ne.prototype.read=function(ve){D("read",ve),ve===void 0?ve=NaN:t(ve)||(ve=i(ve,10));const _e=this._readableState,ct=ve;if(ve>_e.highWaterMark&&(_e.highWaterMark=St(ve)),ve!==0&&(_e.state&=~Me),ve===0&&_e.needReadable&&((_e.highWaterMark!==0?_e.length>=_e.highWaterMark:_e.length>0)||_e.ended))return D("read: emitReadable",_e.length,_e.ended),_e.length===0&&_e.ended?Wt(this):G(this),null;if(ve=Z(ve,_e),ve===0&&_e.ended)return _e.length===0&&Wt(this),null;let at=(_e.state&Ie)!==0;if(D("need readable",at),(_e.length===0||_e.length-ve<_e.highWaterMark)&&(at=!0,D("length less than watermark",at)),_e.ended||_e.reading||_e.destroyed||_e.errored||!_e.constructed)at=!1,D("reading, ended or constructing",at);else if(at){D("do read"),_e.state|=ie|be,_e.length===0&&(_e.state|=Ie);try{this._read(_e.highWaterMark)}catch(Un){ae(this,Un)}_e.state&=~be,_e.reading||(ve=Z(ct,_e))}let ft;return ve>0?ft=Zt(ve,_e):ft=null,ft===null?(_e.needReadable=_e.length<=_e.highWaterMark,ve=0):(_e.length-=ve,_e.multiAwaitDrain?_e.awaitDrainWriters.clear():_e.awaitDrainWriters=null),_e.length===0&&(_e.ended||(_e.needReadable=!0),ct!==ve&&_e.ended&&Wt(this)),ft!==null&&!_e.errorEmitted&&!_e.closeEmitted&&(_e.dataEmitted=!0,this.emit("data",ft)),ft};function H(ve,_e){if(D("onEofChunk"),!_e.ended){if(_e.decoder){const ct=_e.decoder.end();ct&&ct.length&&(_e.buffer.push(ct),_e.length+=_e.objectMode?1:ct.length)}_e.ended=!0,_e.sync?G(ve):(_e.needReadable=!1,_e.emittedReadable=!0,ge(ve))}}function G(ve){const _e=ve._readableState;D("emitReadable",_e.needReadable,_e.emittedReadable),_e.needReadable=!1,_e.emittedReadable||(D("emitReadable",_e.flowing),_e.emittedReadable=!0,n.nextTick(ge,ve))}function ge(ve){const _e=ve._readableState;D("emitReadable_",_e.destroyed,_e.length,_e.ended),!_e.destroyed&&!_e.errored&&(_e.length||_e.ended)&&(ve.emit("readable"),_e.emittedReadable=!1),_e.needReadable=!_e.flowing&&!_e.ended&&_e.length<=_e.highWaterMark,Rt(ve)}function xe(ve,_e){!_e.readingMore&&_e.constructed&&(_e.readingMore=!0,n.nextTick(Re,ve,_e))}function Re(ve,_e){for(;!_e.reading&&!_e.ended&&(_e.length<_e.highWaterMark||_e.flowing&&_e.length===0);){const ct=_e.length;if(D("maybeReadMore read 0"),ve.read(0),ct===_e.length)break}_e.readingMore=!1}Ne.prototype._read=function(ve){throw new Ce("_read()")},Ne.prototype.pipe=function(ve,_e){const ct=this,at=this._readableState;at.pipes.length===1&&(at.multiAwaitDrain||(at.multiAwaitDrain=!0,at.awaitDrainWriters=new h(at.awaitDrainWriters?[at.awaitDrainWriters]:[]))),at.pipes.push(ve),D("pipe count=%d opts=%j",at.pipes.length,_e);const Un=(!_e||_e.end!==!1)&&ve!==n.stdout&&ve!==n.stderr?Sn:Bt;at.endEmitted?n.nextTick(Un):ct.once("end",Un),ve.on("unpipe",hn);function hn(Dt,Kt){D("onunpipe"),Dt===ct&&Kt&&Kt.hasUnpiped===!1&&(Kt.hasUnpiped=!0,Fn())}function Sn(){D("onend"),ve.end()}let fr,On=!1;function Fn(){D("cleanup"),ve.removeListener("close",Nt),ve.removeListener("finish",Ft),fr&&ve.removeListener("drain",fr),ve.removeListener("error",rt),ve.removeListener("unpipe",hn),ct.removeListener("end",Sn),ct.removeListener("end",Bt),ct.removeListener("data",et),On=!0,fr&&at.awaitDrainWriters&&(!ve._writableState||ve._writableState.needDrain)&&fr()}function Te(){On||(at.pipes.length===1&&at.pipes[0]===ve?(D("false write response, pause",0),at.awaitDrainWriters=ve,at.multiAwaitDrain=!1):at.pipes.length>1&&at.pipes.includes(ve)&&(D("false write response, pause",at.awaitDrainWriters.size),at.awaitDrainWriters.add(ve)),ct.pause()),fr||(fr=Be(ct,ve),ve.on("drain",fr))}ct.on("data",et);function et(Dt){D("ondata");const Kt=ve.write(Dt);D("dest.write",Kt),Kt===!1&&Te()}function rt(Dt){if(D("onerror",Dt),Bt(),ve.removeListener("error",rt),ve.listenerCount("error")===0){const Kt=ve._writableState||ve._readableState;Kt&&!Kt.errorEmitted?ae(ve,Dt):ve.emit("error",Dt)}}A(ve,"error",rt);function Nt(){ve.removeListener("finish",Ft),Bt()}ve.once("close",Nt);function Ft(){D("onfinish"),ve.removeListener("close",Nt),Bt()}ve.once("finish",Ft);function Bt(){D("unpipe"),ct.unpipe(ve)}return ve.emit("pipe",ct),ve.writableNeedDrain===!0?Te():at.flowing||(D("pipe resume"),ct.resume()),ve};function Be(ve,_e){return function(){const at=ve._readableState;at.awaitDrainWriters===_e?(D("pipeOnDrain",1),at.awaitDrainWriters=null):at.multiAwaitDrain&&(D("pipeOnDrain",at.awaitDrainWriters.size),at.awaitDrainWriters.delete(_e)),(!at.awaitDrainWriters||at.awaitDrainWriters.size===0)&&ve.listenerCount("data")&&ve.resume()}}Ne.prototype.unpipe=function(ve){const _e=this._readableState,ct={hasUnpiped:!1};if(_e.pipes.length===0)return this;if(!ve){const ft=_e.pipes;_e.pipes=[],this.pause();for(let Un=0;Un<ft.length;Un++)ft[Un].emit("unpipe",this,{hasUnpiped:!1});return this}const at=e(_e.pipes,ve);return at===-1?this:(_e.pipes.splice(at,1),_e.pipes.length===0&&this.pause(),ve.emit("unpipe",this,ct),this)},Ne.prototype.on=function(ve,_e){const ct=S.prototype.on.call(this,ve,_e),at=this._readableState;return ve==="data"?(at.readableListening=this.listenerCount("readable")>0,at.flowing!==!1&&this.resume()):ve==="readable"&&!at.endEmitted&&!at.readableListening&&(at.readableListening=at.needReadable=!0,at.flowing=!1,at.emittedReadable=!1,D("on readable",at.length,at.reading),at.length?G(this):at.reading||n.nextTick(yt,this)),ct},Ne.prototype.addListener=Ne.prototype.on,Ne.prototype.removeListener=function(ve,_e){const ct=S.prototype.removeListener.call(this,ve,_e);return ve==="readable"&&n.nextTick(wt,this),ct},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(ve){const _e=S.prototype.removeAllListeners.apply(this,arguments);return(ve==="readable"||ve===void 0)&&n.nextTick(wt,this),_e};function wt(ve){const _e=ve._readableState;_e.readableListening=ve.listenerCount("readable")>0,_e.resumeScheduled&&_e[z]===!1?_e.flowing=!0:ve.listenerCount("data")>0?ve.resume():_e.readableListening||(_e.flowing=null)}function yt(ve){D("readable nexttick read 0"),ve.read(0)}Ne.prototype.resume=function(){const ve=this._readableState;return ve.flowing||(D("resume"),ve.flowing=!ve.readableListening,gt(this,ve)),ve[z]=!1,this};function gt(ve,_e){_e.resumeScheduled||(_e.resumeScheduled=!0,n.nextTick(Et,ve,_e))}function Et(ve,_e){D("resume",_e.reading),_e.reading||ve.read(0),_e.resumeScheduled=!1,ve.emit("resume"),Rt(ve),_e.flowing&&!_e.reading&&ve.read(0)}Ne.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[z]=!0,this};function Rt(ve){const _e=ve._readableState;for(D("flow",_e.flowing);_e.flowing&&ve.read()!==null;);}Ne.prototype.wrap=function(ve){let _e=!1;ve.on("data",at=>{!this.push(at)&&ve.pause&&(_e=!0,ve.pause())}),ve.on("end",()=>{this.push(null)}),ve.on("error",at=>{ae(this,at)}),ve.on("close",()=>{this.destroy()}),ve.on("destroy",()=>{this.destroy()}),this._read=()=>{_e&&ve.resume&&(_e=!1,ve.resume())};const ct=u(ve);for(let at=1;at<ct.length;at++){const ft=ct[at];this[ft]===void 0&&typeof ve[ft]=="function"&&(this[ft]=ve[ft].bind(ve))}return this},Ne.prototype[w]=function(){return nn(this)},Ne.prototype.iterator=function(ve){return ve!==void 0&&O(ve,"options"),nn(this,ve)};function nn(ve,_e){typeof ve.read!="function"&&(ve=Ne.wrap(ve,{objectMode:!0}));const ct=Mr(ve,_e);return ct.stream=ve,ct}async function*Mr(ve,_e){let ct=Q;function at(hn){this===ve?(ct(),ct=Q):ct=hn}ve.on("readable",at);let ft;const Un=L(ve,{writable:!1},hn=>{ft=hn?me(ft,hn):null,ct(),ct=Q});try{for(;;){const hn=ve.destroyed?null:ve.read();if(hn!==null)yield hn;else{if(ft)throw ft;if(ft===null)return;await new p(at)}}}catch(hn){throw ft=me(ft,hn),ft}finally{(ft||(_e==null?void 0:_e.destroyOnReturn)!==!1)&&(ft===void 0||ve._readableState.autoDestroy)?W.destroyer(ve,null):(ve.off("readable",at),Un())}}o(Ne.prototype,{readable:{__proto__:null,get(){const ve=this._readableState;return!!ve&&ve.readable!==!1&&!ve.destroyed&&!ve.errorEmitted&&!ve.endEmitted},set(ve){this._readableState&&(this._readableState.readable=!!ve)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(ve){this._readableState&&(this._readableState.flowing=ve)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(ve){this._readableState&&(this._readableState.destroyed=ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Ee.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[z]!==!1},set(ve){this[z]=!!ve}}}),Ne._fromList=Zt;function Zt(ve,_e){if(_e.length===0)return null;let ct;return _e.objectMode?ct=_e.buffer.shift():!ve||ve>=_e.length?(_e.decoder?ct=_e.buffer.join(""):_e.buffer.length===1?ct=_e.buffer.first():ct=_e.buffer.concat(_e.length),_e.buffer.clear()):ct=_e.buffer.consume(ve,_e.decoder),ct}function Wt(ve){const _e=ve._readableState;D("endReadable",_e.endEmitted),_e.endEmitted||(_e.ended=!0,n.nextTick(Xr,_e,ve))}function Xr(ve,_e){if(D("endReadableNT",ve.endEmitted,ve.length),!ve.errored&&!ve.closeEmitted&&!ve.endEmitted&&ve.length===0){if(ve.endEmitted=!0,_e.emit("end"),_e.writable&&_e.allowHalfOpen===!1)n.nextTick(Mn,_e);else if(ve.autoDestroy){const ct=_e._writableState;(!ct||ct.autoDestroy&&(ct.finished||ct.writable===!1))&&_e.destroy()}}}function Mn(ve){ve.writable&&!ve.writableEnded&&!ve.destroyed&&ve.end()}Ne.from=function(ve,_e){return j(Ne,ve,_e)};let Dn;function Ma(){return Dn===void 0&&(Dn={}),Dn}return Ne.fromWeb=function(ve,_e){return Ma().newStreamReadableFromReadableStream(ve,_e)},Ne.toWeb=function(ve,_e){return Ma().newReadableStreamFromStreamReadable(ve,_e)},Ne.wrap=function(ve,_e){var ct,at;return new Ne({objectMode:(ct=(at=ve.readableObjectMode)!==null&&at!==void 0?at:ve.objectMode)!==null&&ct!==void 0?ct:!0,..._e,destroy(ft,Un){W.destroyer(ve,ft),Un(ft)}}).wrap(ve)},b5}var w5,UN;function W4(){if(UN)return w5;UN=1;const n=zd(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:h}=ma;w5=O,O.WritableState=C;const{EventEmitter:m}=Gb,w=q4.Stream,{Buffer:b}=Bd,g=wm,{addAbortSignal:S}=G2,{getHighWaterMark:A,getDefaultHighWaterMark:T}=W2,{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:L,ERR_MULTIPLE_CALLBACK:D,ERR_STREAM_CANNOT_PIPE:q,ERR_STREAM_DESTROYED:W,ERR_STREAM_ALREADY_FINISHED:de,ERR_STREAM_NULL_VALUES:ce,ERR_STREAM_WRITE_AFTER_END:me,ERR_UNKNOWN_ENCODING:Se}=Xs.codes,{errorOrDestroy:Ce}=g;u(O.prototype,w.prototype),u(O,w);function ne(){}const ke=p("kOnFinished");function C(ue,te,ye){typeof ye!="boolean"&&(ye=te instanceof Kc()),this.objectMode=!!(ue&&ue.objectMode),ye&&(this.objectMode=this.objectMode||!!(ue&&ue.writableObjectMode)),this.highWaterMark=ue?A(this,ue,"writableHighWaterMark",ye):T(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const J=!!(ue&&ue.decodeStrings===!1);this.decodeStrings=!J,this.defaultEncoding=ue&&ue.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ae.bind(void 0,te),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,_(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ue||ue.emitClose!==!1,this.autoDestroy=!ue||ue.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ke]=[]}function _(ue){ue.buffered=[],ue.bufferedIndex=0,ue.allBuffers=!0,ue.allNoop=!0}C.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(C.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function O(ue){const te=this instanceof Kc();if(!te&&!r(O,this))return new O(ue);this._writableState=new C(ue,this,te),ue&&(typeof ue.write=="function"&&(this._write=ue.write),typeof ue.writev=="function"&&(this._writev=ue.writev),typeof ue.destroy=="function"&&(this._destroy=ue.destroy),typeof ue.final=="function"&&(this._final=ue.final),typeof ue.construct=="function"&&(this._construct=ue.construct),ue.signal&&S(ue.signal,this)),w.call(this,ue),g.construct(this,()=>{const ye=this._writableState;ye.writing||ie(this,ye),Me(this,ye)})}i(O,h,{__proto__:null,value:function(ue){return r(this,ue)?!0:this!==O?!1:ue&&ue._writableState instanceof C}}),O.prototype.pipe=function(){Ce(this,new q)};function z(ue,te,ye,J){const P=ue._writableState;if(typeof ye=="function")J=ye,ye=P.defaultEncoding;else{if(!ye)ye=P.defaultEncoding;else if(ye!=="buffer"&&!b.isEncoding(ye))throw new Se(ye);typeof J!="function"&&(J=ne)}if(te===null)throw new ce;if(!P.objectMode)if(typeof te=="string")P.decodeStrings!==!1&&(te=b.from(te,ye),ye="buffer");else if(te instanceof b)ye="buffer";else if(w._isUint8Array(te))te=w._uint8ArrayToBuffer(te),ye="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],te);let U;return P.ending?U=new me:P.destroyed&&(U=new W("write")),U?(n.nextTick(J,U),Ce(ue,U,!0),U):(P.pendingcb++,F(ue,P,te,ye,J))}O.prototype.write=function(ue,te,ye){return z(this,ue,te,ye)===!0},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){const ue=this._writableState;ue.corked&&(ue.corked--,ue.writing||ie(this,ue))},O.prototype.setDefaultEncoding=function(te){if(typeof te=="string"&&(te=c(te)),!b.isEncoding(te))throw new Se(te);return this._writableState.defaultEncoding=te,this};function F(ue,te,ye,J,P){const U=te.objectMode?1:ye.length;te.length+=U;const ee=te.length<te.highWaterMark;return ee||(te.needDrain=!0),te.writing||te.corked||te.errored||!te.constructed?(te.buffered.push({chunk:ye,encoding:J,callback:P}),te.allBuffers&&J!=="buffer"&&(te.allBuffers=!1),te.allNoop&&P!==ne&&(te.allNoop=!1)):(te.writelen=U,te.writecb=P,te.writing=!0,te.sync=!0,ue._write(ye,J,te.onwrite),te.sync=!1),ee&&!te.errored&&!te.destroyed}function j(ue,te,ye,J,P,U,ee){te.writelen=J,te.writecb=ee,te.writing=!0,te.sync=!0,te.destroyed?te.onwrite(new W("write")):ye?ue._writev(P,te.onwrite):ue._write(P,U,te.onwrite),te.sync=!1}function Q(ue,te,ye,J){--te.pendingcb,J(ye),Y(te),Ce(ue,ye)}function ae(ue,te){const ye=ue._writableState,J=ye.sync,P=ye.writecb;if(typeof P!="function"){Ce(ue,new D);return}ye.writing=!1,ye.writecb=null,ye.length-=ye.writelen,ye.writelen=0,te?(te.stack,ye.errored||(ye.errored=te),ue._readableState&&!ue._readableState.errored&&(ue._readableState.errored=te),J?n.nextTick(Q,ue,ye,te,P):Q(ue,ye,te,P)):(ye.buffered.length>ye.bufferedIndex&&ie(ue,ye),J?ye.afterWriteTickInfo!==null&&ye.afterWriteTickInfo.cb===P?ye.afterWriteTickInfo.count++:(ye.afterWriteTickInfo={count:1,cb:P,stream:ue,state:ye},n.nextTick(N,ye.afterWriteTickInfo)):k(ue,ye,1,P))}function N({stream:ue,state:te,count:ye,cb:J}){return te.afterWriteTickInfo=null,k(ue,te,ye,J)}function k(ue,te,ye,J){for(!te.ending&&!ue.destroyed&&te.length===0&&te.needDrain&&(te.needDrain=!1,ue.emit("drain"));ye-- >0;)te.pendingcb--,J();te.destroyed&&Y(te),Me(ue,te)}function Y(ue){if(ue.writing)return;for(let P=ue.bufferedIndex;P<ue.buffered.length;++P){var te;const{chunk:U,callback:ee}=ue.buffered[P],oe=ue.objectMode?1:U.length;ue.length-=oe,ee((te=ue.errored)!==null&&te!==void 0?te:new W("write"))}const ye=ue[ke].splice(0);for(let P=0;P<ye.length;P++){var J;ye[P]((J=ue.errored)!==null&&J!==void 0?J:new W("end"))}_(ue)}function ie(ue,te){if(te.corked||te.bufferProcessing||te.destroyed||!te.constructed)return;const{buffered:ye,bufferedIndex:J,objectMode:P}=te,U=ye.length-J;if(!U)return;let ee=J;if(te.bufferProcessing=!0,U>1&&ue._writev){te.pendingcb-=U-1;const oe=te.allNoop?ne:Ne=>{for(let Qe=ee;Qe<ye.length;++Qe)ye[Qe].callback(Ne)},Ee=te.allNoop&&ee===0?ye:e(ye,ee);Ee.allBuffers=te.allBuffers,j(ue,te,!0,te.length,Ee,"",oe),_(te)}else{do{const{chunk:oe,encoding:Ee,callback:Ne}=ye[ee];ye[ee++]=null;const Qe=P?1:oe.length;j(ue,te,!1,Qe,oe,Ee,Ne)}while(ee<ye.length&&!te.writing);ee===ye.length?_(te):ee>256?(ye.splice(0,ee),te.bufferedIndex=0):te.bufferedIndex=ee}te.bufferProcessing=!1}O.prototype._write=function(ue,te,ye){if(this._writev)this._writev([{chunk:ue,encoding:te}],ye);else throw new L("_write()")},O.prototype._writev=null,O.prototype.end=function(ue,te,ye){const J=this._writableState;typeof ue=="function"?(ye=ue,ue=null,te=null):typeof te=="function"&&(ye=te,te=null);let P;if(ue!=null){const U=z(this,ue,te);U instanceof t&&(P=U)}return J.corked&&(J.corked=1,this.uncork()),P||(!J.errored&&!J.ending?(J.ending=!0,Me(this,J,!0),J.ended=!0):J.finished?P=new de("end"):J.destroyed&&(P=new W("end"))),typeof ye=="function"&&(P||J.finished?n.nextTick(ye,P):J[ke].push(ye)),this};function $(ue){return ue.ending&&!ue.destroyed&&ue.constructed&&ue.length===0&&!ue.errored&&ue.buffered.length===0&&!ue.finished&&!ue.writing&&!ue.errorEmitted&&!ue.closeEmitted}function be(ue,te){let ye=!1;function J(P){if(ye){Ce(ue,P??D());return}if(ye=!0,te.pendingcb--,P){const U=te[ke].splice(0);for(let ee=0;ee<U.length;ee++)U[ee](P);Ce(ue,P,te.sync)}else $(te)&&(te.prefinished=!0,ue.emit("prefinish"),te.pendingcb++,n.nextTick(Ue,ue,te))}te.sync=!0,te.pendingcb++;try{ue._final(J)}catch(P){J(P)}te.sync=!1}function Ie(ue,te){!te.prefinished&&!te.finalCalled&&(typeof ue._final=="function"&&!te.destroyed?(te.finalCalled=!0,be(ue,te)):(te.prefinished=!0,ue.emit("prefinish")))}function Me(ue,te,ye){$(te)&&(Ie(ue,te),te.pendingcb===0&&(ye?(te.pendingcb++,n.nextTick((J,P)=>{$(P)?Ue(J,P):P.pendingcb--},ue,te)):$(te)&&(te.pendingcb++,Ue(ue,te))))}function Ue(ue,te){te.pendingcb--,te.finished=!0;const ye=te[ke].splice(0);for(let J=0;J<ye.length;J++)ye[J]();if(ue.emit("finish"),te.autoDestroy){const J=ue._readableState;(!J||J.autoDestroy&&(J.endEmitted||J.readable===!1))&&ue.destroy()}}o(O.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ue){this._writableState&&(this._writableState.destroyed=ue)}},writable:{__proto__:null,get(){const ue=this._writableState;return!!ue&&ue.writable!==!1&&!ue.destroyed&&!ue.errored&&!ue.ending&&!ue.ended},set(ue){this._writableState&&(this._writableState.writable=!!ue)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const ue=this._writableState;return ue?!ue.destroyed&&!ue.ending&&ue.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const se=g.destroy;O.prototype.destroy=function(ue,te){const ye=this._writableState;return!ye.destroyed&&(ye.bufferedIndex<ye.buffered.length||ye[ke].length)&&n.nextTick(Y,ye),se.call(this,ue,te),this},O.prototype._undestroy=g.undestroy,O.prototype._destroy=function(ue,te){te(ue)},O.prototype[m.captureRejectionSymbol]=function(ue){this.destroy(ue)};let fe;function pe(){return fe===void 0&&(fe={}),fe}return O.fromWeb=function(ue,te){return pe().newStreamWritableFromWritableStream(ue,te)},O.toWeb=function(ue){return pe().newWritableStreamFromStreamWritable(ue)},w5}var x5,FN;function Ese(){if(FN)return x5;FN=1;const n=zd(),e=Bd,{isReadable:t,isWritable:r,isIterable:i,isNodeStream:o,isReadableNodeStream:u,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:h,isWritableStream:m}=Xc,w=jd,{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:S}}=Xs,{destroyer:A}=wm,T=Kc(),R=K2(),L=W4(),{createDeferredPromise:D}=_s,q=cB,W=globalThis.Blob||e.Blob,de=typeof W<"u"?function(C){return C instanceof W}:function(C){return!1},ce=globalThis.AbortController||Tb().AbortController,{FunctionPrototypeCall:me}=ma;class Se extends T{constructor(C){super(C),(C==null?void 0:C.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(C==null?void 0:C.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}x5=function ke(C,_){if(p(C))return C;if(u(C))return ne({readable:C});if(c(C))return ne({writable:C});if(o(C))return ne({writable:!1,readable:!1});if(h(C))return ne({readable:R.fromWeb(C)});if(m(C))return ne({writable:L.fromWeb(C)});if(typeof C=="function"){const{value:z,write:F,final:j,destroy:Q}=Ce(C);if(i(z))return q(Se,z,{objectMode:!0,write:F,final:j,destroy:Q});const ae=z==null?void 0:z.then;if(typeof ae=="function"){let N;const k=me(ae,z,Y=>{if(Y!=null)throw new S("nully","body",Y)},Y=>{A(N,Y)});return N=new Se({objectMode:!0,readable:!1,write:F,final(Y){j(async()=>{try{await k,n.nextTick(Y,null)}catch(ie){n.nextTick(Y,ie)}})},destroy:Q})}throw new S("Iterable, AsyncIterable or AsyncFunction",_,z)}if(de(C))return ke(C.arrayBuffer());if(i(C))return q(Se,C,{objectMode:!0,writable:!1});if(h(C==null?void 0:C.readable)&&m(C==null?void 0:C.writable))return Se.fromWeb(C);if(typeof(C==null?void 0:C.writable)=="object"||typeof(C==null?void 0:C.readable)=="object"){const z=C!=null&&C.readable?u(C==null?void 0:C.readable)?C==null?void 0:C.readable:ke(C.readable):void 0,F=C!=null&&C.writable?c(C==null?void 0:C.writable)?C==null?void 0:C.writable:ke(C.writable):void 0;return ne({readable:z,writable:F})}const O=C==null?void 0:C.then;if(typeof O=="function"){let z;return me(O,C,F=>{F!=null&&z.push(F),z.push(null)},F=>{A(z,F)}),z=new Se({objectMode:!0,writable:!1,read(){}})}throw new g(_,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],C)};function Ce(ke){let{promise:C,resolve:_}=D();const O=new ce,z=O.signal;return{value:ke(async function*(){for(;;){const j=C;C=null;const{chunk:Q,done:ae,cb:N}=await j;if(n.nextTick(N),ae)return;if(z.aborted)throw new b(void 0,{cause:z.reason});({promise:C,resolve:_}=D()),yield Q}}(),{signal:z}),write(j,Q,ae){const N=_;_=null,N({chunk:j,done:!1,cb:ae})},final(j){const Q=_;_=null,Q({done:!0,cb:j})},destroy(j,Q){O.abort(),Q(j)}}}function ne(ke){const C=ke.readable&&typeof ke.readable.read!="function"?R.wrap(ke.readable):ke.readable,_=ke.writable;let O=!!t(C),z=!!r(_),F,j,Q,ae,N;function k(Y){const ie=ae;ae=null,ie?ie(Y):Y&&N.destroy(Y)}return N=new Se({readableObjectMode:!!(C!=null&&C.readableObjectMode),writableObjectMode:!!(_!=null&&_.writableObjectMode),readable:O,writable:z}),z&&(w(_,Y=>{z=!1,Y&&A(C,Y),k(Y)}),N._write=function(Y,ie,$){_.write(Y,ie)?$():F=$},N._final=function(Y){_.end(),j=Y},_.on("drain",function(){if(F){const Y=F;F=null,Y()}}),_.on("finish",function(){if(j){const Y=j;j=null,Y()}})),O&&(w(C,Y=>{O=!1,Y&&A(C,Y),k(Y)}),C.on("readable",function(){if(Q){const Y=Q;Q=null,Y()}}),C.on("end",function(){N.push(null)}),N._read=function(){for(;;){const Y=C.read();if(Y===null){Q=N._read;return}if(!N.push(Y))return}}),N._destroy=function(Y,ie){!Y&&ae!==null&&(Y=new b),Q=null,F=null,j=null,ae===null?ie(Y):(ae=ie,A(_,Y),A(C,Y))},N}return x5}var _5,BN;function Kc(){if(BN)return _5;BN=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=ma;_5=u;const i=K2(),o=W4();r(u.prototype,i.prototype),r(u,i);{const m=t(o.prototype);for(let w=0;w<m.length;w++){const b=m[w];u.prototype[b]||(u.prototype[b]=o.prototype[b])}}function u(m){if(!(this instanceof u))return new u(m);i.call(this,m),o.call(this,m),m?(this.allowHalfOpen=m.allowHalfOpen!==!1,m.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),m.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(u.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(m){this._readableState&&this._writableState&&(this._readableState.destroyed=m,this._writableState.destroyed=m)}}});let c;function p(){return c===void 0&&(c={}),c}u.fromWeb=function(m,w){return p().newStreamDuplexFromReadableWritablePair(m,w)},u.toWeb=function(m){return p().newReadableWritablePairFromDuplex(m)};let h;return u.from=function(m){return h||(h=Ese()),h(m,"body")},_5}const{ObjectSetPrototypeOf:fB,Symbol:Ase}=ma;var dB=Yc;const{ERR_METHOD_NOT_IMPLEMENTED:kse}=Xs.codes,K4=Kc(),{getHighWaterMark:Mse}=W2;fB(Yc.prototype,K4.prototype);fB(Yc,K4);const pb=Ase("kCallback");function Yc(n){if(!(this instanceof Yc))return new Yc(n);const e=n?Mse(this,n,"readableHighWaterMark",!0):null;e===0&&(n={...n,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:n.writableHighWaterMark||0}),K4.call(this,n),this._readableState.sync=!1,this[pb]=null,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",Tse)}function N8(n){typeof this._flush=="function"&&!this.destroyed?this._flush((e,t)=>{if(e){n?n(e):this.destroy(e);return}t!=null&&this.push(t),this.push(null),n&&n()}):(this.push(null),n&&n())}function Tse(){this._final!==N8&&N8.call(this)}Yc.prototype._final=N8;Yc.prototype._transform=function(n,e,t){throw new kse("_transform()")};Yc.prototype._write=function(n,e,t){const r=this._readableState,i=this._writableState,o=r.length;this._transform(n,e,(u,c)=>{if(u){t(u);return}c!=null&&this.push(c),i.ended||o===r.length||r.length<r.highWaterMark?t():this[pb]=t})};Yc.prototype._read=function(){if(this[pb]){const n=this[pb];this[pb]=null,n()}};const{ObjectSetPrototypeOf:pB}=ma;var hB=tm;const Y4=dB;pB(tm.prototype,Y4.prototype);pB(tm,Y4);function tm(n){if(!(this instanceof tm))return new tm(n);Y4.call(this,n)}tm.prototype._transform=function(n,e,t){t(null,n)};const eb=zd(),{ArrayIsArray:Rse,Promise:Ose,SymbolAsyncIterator:Lse,SymbolDispose:Nse}=ma,e2=jd,{once:Pse}=_s,Ise=wm,zN=Kc(),{aggregateTwoErrors:Dse,codes:{ERR_INVALID_ARG_TYPE:P8,ERR_INVALID_RETURN_VALUE:S5,ERR_MISSING_ARGS:Use,ERR_STREAM_DESTROYED:Fse,ERR_STREAM_PREMATURE_CLOSE:Bse},AbortError:zse}=Xs,{validateFunction:jse,validateAbortSignal:$se}=Wb,{isIterable:Jp,isReadable:C5,isReadableNodeStream:P_,isNodeStream:jN,isTransformStream:Py,isWebStream:Hse,isReadableStream:E5,isReadableFinished:qse}=Xc,Vse=globalThis.AbortController||Tb().AbortController;let A5,k5,M5;function $N(n,e,t){let r=!1;n.on("close",()=>{r=!0});const i=e2(n,{readable:e,writable:t},o=>{r=!o});return{destroy:o=>{r||(r=!0,Ise.destroyer(n,o||new Fse("pipe")))},cleanup:i}}function Gse(n){return jse(n[n.length-1],"streams[stream.length - 1]"),n.pop()}function T5(n){if(Jp(n))return n;if(P_(n))return Wse(n);throw new P8("val",["Readable","Iterable","AsyncIterable"],n)}async function*Wse(n){k5||(k5=K2()),yield*k5.prototype[Lse].call(n)}async function g_(n,e,t,{end:r}){let i,o=null;const u=h=>{if(h&&(i=h),o){const m=o;o=null,m()}},c=()=>new Ose((h,m)=>{i?m(i):o=()=>{i?m(i):h()}});e.on("drain",u);const p=e2(e,{readable:!1},u);try{e.writableNeedDrain&&await c();for await(const h of n)e.write(h)||await c();r&&(e.end(),await c()),t()}catch(h){t(i!==h?Dse(i,h):h)}finally{p(),e.off("drain",u)}}async function R5(n,e,t,{end:r}){Py(e)&&(e=e.writable);const i=e.getWriter();try{for await(const o of n)await i.ready,i.write(o).catch(()=>{});await i.ready,r&&await i.close(),t()}catch(o){try{await i.abort(o),t(o)}catch(u){t(u)}}}function Kse(...n){return yB(n,Pse(Gse(n)))}function yB(n,e,t){if(n.length===1&&Rse(n[0])&&(n=n[0]),n.length<2)throw new Use("streams");const r=new Vse,i=r.signal,o=t==null?void 0:t.signal,u=[];$se(o,"options.signal");function c(){S(new zse)}M5=M5||_s.addAbortListener;let p;o&&(p=M5(o,c));let h,m;const w=[];let b=0;function g(L){S(L,--b===0)}function S(L,D){var q;if(L&&(!h||h.code==="ERR_STREAM_PREMATURE_CLOSE")&&(h=L),!(!h&&!D)){for(;w.length;)w.shift()(h);(q=p)===null||q===void 0||q[Nse](),r.abort(),D&&(h||u.forEach(W=>W()),eb.nextTick(e,h,m))}}let A;for(let L=0;L<n.length;L++){const D=n[L],q=L<n.length-1,W=L>0,de=q||(t==null?void 0:t.end)!==!1,ce=L===n.length-1;if(jN(D)){let me=function(Se){Se&&Se.name!=="AbortError"&&Se.code!=="ERR_STREAM_PREMATURE_CLOSE"&&g(Se)};if(de){const{destroy:Se,cleanup:Ce}=$N(D,q,W);w.push(Se),C5(D)&&ce&&u.push(Ce)}D.on("error",me),C5(D)&&ce&&u.push(()=>{D.removeListener("error",me)})}if(L===0)if(typeof D=="function"){if(A=D({signal:i}),!Jp(A))throw new S5("Iterable, AsyncIterable or Stream","source",A)}else Jp(D)||P_(D)||Py(D)?A=D:A=zN.from(D);else if(typeof D=="function"){if(Py(A)){var T;A=T5((T=A)===null||T===void 0?void 0:T.readable)}else A=T5(A);if(A=D(A,{signal:i}),q){if(!Jp(A,!0))throw new S5("AsyncIterable",`transform[${L-1}]`,A)}else{var R;A5||(A5=hB);const me=new A5({objectMode:!0}),Se=(R=A)===null||R===void 0?void 0:R.then;if(typeof Se=="function")b++,Se.call(A,ke=>{m=ke,ke!=null&&me.write(ke),de&&me.end(),eb.nextTick(g)},ke=>{me.destroy(ke),eb.nextTick(g,ke)});else if(Jp(A,!0))b++,g_(A,me,g,{end:de});else if(E5(A)||Py(A)){const ke=A.readable||A;b++,g_(ke,me,g,{end:de})}else throw new S5("AsyncIterable or Promise","destination",A);A=me;const{destroy:Ce,cleanup:ne}=$N(A,!1,!0);w.push(Ce),ce&&u.push(ne)}}else if(jN(D)){if(P_(A)){b+=2;const me=Yse(A,D,g,{end:de});C5(D)&&ce&&u.push(me)}else if(Py(A)||E5(A)){const me=A.readable||A;b++,g_(me,D,g,{end:de})}else if(Jp(A))b++,g_(A,D,g,{end:de});else throw new P8("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=D}else if(Hse(D)){if(P_(A))b++,R5(T5(A),D,g,{end:de});else if(E5(A)||Jp(A))b++,R5(A,D,g,{end:de});else if(Py(A))b++,R5(A.readable,D,g,{end:de});else throw new P8("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],A);A=D}else A=zN.from(D)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&eb.nextTick(c),A}function Yse(n,e,t,{end:r}){let i=!1;if(e.on("close",()=>{i||t(new Bse)}),n.pipe(e,{end:!1}),r){let o=function(){i=!0,e.end()};qse(n)?eb.nextTick(o):n.once("end",o)}else t();return e2(n,{readable:!0,writable:!1},o=>{const u=n._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&u&&u.ended&&!u.errored&&!u.errorEmitted?n.once("end",t).once("error",t):t(o)}),e2(e,{readable:!1,writable:!0},t)}var J4={pipelineImpl:yB,pipeline:Kse};const{pipeline:Jse}=J4,v_=Kc(),{destroyer:Qse}=wm,{isNodeStream:b_,isReadable:HN,isWritable:qN,isWebStream:O5,isTransformStream:Wp,isWritableStream:VN,isReadableStream:GN}=Xc,{AbortError:Zse,codes:{ERR_INVALID_ARG_VALUE:WN,ERR_MISSING_ARGS:Xse}}=Xs,eoe=jd;var mB=function(...e){if(e.length===0)throw new Xse("streams");if(e.length===1)return v_.from(e[0]);const t=[...e];if(typeof e[0]=="function"&&(e[0]=v_.from(e[0])),typeof e[e.length-1]=="function"){const g=e.length-1;e[g]=v_.from(e[g])}for(let g=0;g<e.length;++g)if(!(!b_(e[g])&&!O5(e[g]))){if(g<e.length-1&&!(HN(e[g])||GN(e[g])||Wp(e[g])))throw new WN(`streams[${g}]`,t[g],"must be readable");if(g>0&&!(qN(e[g])||VN(e[g])||Wp(e[g])))throw new WN(`streams[${g}]`,t[g],"must be writable")}let r,i,o,u,c;function p(g){const S=u;u=null,S?S(g):g?c.destroy(g):!b&&!w&&c.destroy()}const h=e[0],m=Jse(e,p),w=!!(qN(h)||VN(h)||Wp(h)),b=!!(HN(m)||GN(m)||Wp(m));if(c=new v_({writableObjectMode:!!(h!=null&&h.writableObjectMode),readableObjectMode:!!(m!=null&&m.readableObjectMode),writable:w,readable:b}),w){if(b_(h))c._write=function(S,A,T){h.write(S,A)?T():r=T},c._final=function(S){h.end(),i=S},h.on("drain",function(){if(r){const S=r;r=null,S()}});else if(O5(h)){const A=(Wp(h)?h.writable:h).getWriter();c._write=async function(T,R,L){try{await A.ready,A.write(T).catch(()=>{}),L()}catch(D){L(D)}},c._final=async function(T){try{await A.ready,A.close().catch(()=>{}),i=T}catch(R){T(R)}}}const g=Wp(m)?m.readable:m;eoe(g,()=>{if(i){const S=i;i=null,S()}})}if(b){if(b_(m))m.on("readable",function(){if(o){const g=o;o=null,g()}}),m.on("end",function(){c.push(null)}),c._read=function(){for(;;){const g=m.read();if(g===null){o=c._read;return}if(!c.push(g))return}};else if(O5(m)){const S=(Wp(m)?m.readable:m).getReader();c._read=async function(){for(;;)try{const{value:A,done:T}=await S.read();if(!c.push(A))return;if(T){c.push(null);return}}catch{return}}}}return c._destroy=function(g,S){!g&&u!==null&&(g=new Zse),o=null,r=null,i=null,u===null?S(g):(u=S,b_(m)&&Qse(m,g))},c};const toe=globalThis.AbortController||Tb().AbortController,{codes:{ERR_INVALID_ARG_VALUE:noe,ERR_INVALID_ARG_TYPE:Yb,ERR_MISSING_ARGS:roe,ERR_OUT_OF_RANGE:aoe},AbortError:Vl}=Xs,{validateAbortSignal:Mh,validateInteger:KN,validateObject:Th}=Wb,ioe=ma.Symbol("kWeak"),soe=ma.Symbol("kResistStopPropagation"),{finished:ooe}=jd,uoe=mB,{addAbortSignalNoValidate:loe}=G2,{isWritable:coe,isNodeStream:foe}=Xc,{deprecate:doe}=_s,{ArrayPrototypePush:poe,Boolean:hoe,MathFloor:YN,Number:yoe,NumberIsNaN:moe,Promise:JN,PromiseReject:QN,PromiseResolve:goe,PromisePrototypeThen:ZN,Symbol:gB}=ma,t2=gB("kEmpty"),XN=gB("kEof");function voe(n,e){if(e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal"),foe(n)&&!coe(n))throw new noe("stream",n,"must be writable");const t=uoe(this,n);return e!=null&&e.signal&&loe(e.signal,t),t}function Y2(n,e){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal");let t=1;(e==null?void 0:e.concurrency)!=null&&(t=YN(e.concurrency));let r=t-1;return(e==null?void 0:e.highWaterMark)!=null&&(r=YN(e.highWaterMark)),KN(t,"options.concurrency",1),KN(r,"options.highWaterMark",0),r+=t,(async function*(){const o=_s.AbortSignalAny([e==null?void 0:e.signal].filter(hoe)),u=this,c=[],p={signal:o};let h,m,w=!1,b=0;function g(){w=!0,S()}function S(){b-=1,A()}function A(){m&&!w&&b<t&&c.length<r&&(m(),m=null)}async function T(){try{for await(let R of u){if(w)return;if(o.aborted)throw new Vl;try{if(R=n(R,p),R===t2)continue;R=goe(R)}catch(L){R=QN(L)}b+=1,ZN(R,S,g),c.push(R),h&&(h(),h=null),!w&&(c.length>=r||b>=t)&&await new JN(L=>{m=L})}c.push(XN)}catch(R){const L=QN(R);ZN(L,S,g),c.push(L)}finally{w=!0,h&&(h(),h=null)}}T();try{for(;;){for(;c.length>0;){const R=await c[0];if(R===XN)return;if(o.aborted)throw new Vl;R!==t2&&(yield R),c.shift(),A()}await new JN(R=>{h=R})}}finally{w=!0,m&&(m(),m=null)}}).call(this)}function boe(n=void 0){return n!=null&&Th(n,"options"),(n==null?void 0:n.signal)!=null&&Mh(n.signal,"options.signal"),(async function*(){let t=0;for await(const i of this){var r;if(n!=null&&(r=n.signal)!==null&&r!==void 0&&r.aborted)throw new Vl({cause:n.signal.reason});yield[t++,i]}}).call(this)}async function vB(n,e=void 0){for await(const t of Q4.call(this,n,e))return!0;return!1}async function woe(n,e=void 0){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);return!await vB.call(this,async(...t)=>!await n(...t),e)}async function xoe(n,e){for await(const t of Q4.call(this,n,e))return t}async function _oe(n,e){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i),t2}for await(const r of Y2.call(this,t,e));}function Q4(n,e){if(typeof n!="function")throw new Yb("fn",["Function","AsyncFunction"],n);async function t(r,i){return await n(r,i)?r:t2}return Y2.call(this,t,e)}class Soe extends roe{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Coe(n,e,t){var r;if(typeof n!="function")throw new Yb("reducer",["Function","AsyncFunction"],n);t!=null&&Th(t,"options"),(t==null?void 0:t.signal)!=null&&Mh(t.signal,"options.signal");let i=arguments.length>1;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted){const h=new Vl(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await ooe(this.destroy(h)),h}const o=new toe,u=o.signal;if(t!=null&&t.signal){const h={once:!0,[ioe]:this,[soe]:!0};t.signal.addEventListener("abort",()=>o.abort(),h)}let c=!1;try{for await(const h of this){var p;if(c=!0,t!=null&&(p=t.signal)!==null&&p!==void 0&&p.aborted)throw new Vl;i?e=await n(e,h,{signal:u}):(e=h,i=!0)}if(!c&&!i)throw new Soe}finally{o.abort()}return e}async function Eoe(n){n!=null&&Th(n,"options"),(n==null?void 0:n.signal)!=null&&Mh(n.signal,"options.signal");const e=[];for await(const r of this){var t;if(n!=null&&(t=n.signal)!==null&&t!==void 0&&t.aborted)throw new Vl(void 0,{cause:n.signal.reason});poe(e,r)}return e}function Aoe(n,e){const t=Y2.call(this,n,e);return(async function*(){for await(const i of t)yield*i}).call(this)}function bB(n){if(n=yoe(n),moe(n))return 0;if(n<0)throw new aoe("number",">= 0",n);return n}function koe(n,e=void 0){return e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal"),n=bB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Vl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Vl;n--<=0&&(yield o)}}).call(this)}function Moe(n,e=void 0){return e!=null&&Th(e,"options"),(e==null?void 0:e.signal)!=null&&Mh(e.signal,"options.signal"),n=bB(n),(async function*(){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Vl;for await(const o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Vl;if(n-- >0&&(yield o),n<=0)return}}).call(this)}B4.streamReturningOperators={asIndexedPairs:doe(boe,"readable.asIndexedPairs will be removed in a future version."),drop:koe,filter:Q4,flatMap:Aoe,map:Y2,take:Moe,compose:voe};B4.promiseReturningOperators={every:woe,forEach:_oe,reduce:Coe,toArray:Eoe,some:vB,find:xoe};var L5,eP;function wB(){if(eP)return L5;eP=1;const{ArrayPrototypePop:n,Promise:e}=ma,{isIterable:t,isNodeStream:r,isWebStream:i}=Xc,{pipelineImpl:o}=J4,{finished:u}=jd;xB();function c(...p){return new e((h,m)=>{let w,b;const g=p[p.length-1];if(g&&typeof g=="object"&&!r(g)&&!t(g)&&!i(g)){const S=n(p);w=S.signal,b=S.end}o(p,(S,A)=>{S?m(S):h(A)},{signal:w,end:b})})}return L5={finished:u,pipeline:c},L5}var tP;function xB(){if(tP)return p5.exports;tP=1;const{Buffer:n}=Bd,{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=ma,{promisify:{custom:i}}=_s,{streamReturningOperators:o,promiseReturningOperators:u}=B4,{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=Xs,p=mB,{setDefaultHighWaterMark:h,getDefaultHighWaterMark:m}=W2,{pipeline:w}=J4,{destroyer:b}=wm,g=jd,S=wB(),A=Xc,T=p5.exports=q4.Stream;T.isDestroyed=A.isDestroyed,T.isDisturbed=A.isDisturbed,T.isErrored=A.isErrored,T.isReadable=A.isReadable,T.isWritable=A.isWritable,T.Readable=K2();for(const L of t(o)){let q=function(...W){if(new.target)throw c();return T.Readable.from(r(D,this,W))};const D=o[L];e(q,"name",{__proto__:null,value:D.name}),e(q,"length",{__proto__:null,value:D.length}),e(T.Readable.prototype,L,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}for(const L of t(u)){let q=function(...W){if(new.target)throw c();return r(D,this,W)};const D=u[L];e(q,"name",{__proto__:null,value:D.name}),e(q,"length",{__proto__:null,value:D.length}),e(T.Readable.prototype,L,{__proto__:null,value:q,enumerable:!1,configurable:!0,writable:!0})}T.Writable=W4(),T.Duplex=Kc(),T.Transform=dB,T.PassThrough=hB,T.pipeline=w;const{addAbortSignal:R}=G2;return T.addAbortSignal=R,T.finished=g,T.destroy=b,T.compose=p,T.setDefaultHighWaterMark=h,T.getDefaultHighWaterMark=m,e(T,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return S}}),e(w,i,{__proto__:null,enumerable:!0,get(){return S.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return S.finished}}),T.Stream=T,T._isUint8Array=function(D){return D instanceof Uint8Array},T._uint8ArrayToBuffer=function(D){return n.from(D.buffer,D.byteOffset,D.byteLength)},p5.exports}(function(n){const e=xB(),t=wB(),r=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=r,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(SF);var Toe=SF.exports;typeof globalThis.Buffer>"u"&&(globalThis.Buffer=Lb().Buffer);const ky=sU,nP=Toe,Roe=ki;globalThis.process||(globalThis.process=zd());if(typeof crypto>"u"){const n=p2;n.getRandomValues=e=>n.randomBytes(e.length),globalThis.crypto=n}const ii={ElvCrypto:async()=>{try{if(!ii.elvCrypto){const n=(await Promise.resolve().then(()=>require("./index-M64Z5q4j.js"))).default;ii.elvCrypto=await new n().init()}return ii.elvCrypto}catch(n){console.error("Error initializing ElvCrypto:"),console.error(n)}},EncryptedSize:n=>{const t=Math.floor(n/1e6);let r=ii.EncryptedBlockSize(1e6),i=t*r;return n%1e6!==0&&(i+=ii.EncryptedBlockSize(n%1e6)),i},EncryptedBlockSize:(n,e=!1)=>{let c=Math.floor(n/564)*576;return n%564!==0&&(c+=576),e?c+608:c+129},async EncryptConk(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=new Uint8Array(Buffer.from(JSON.stringify(n)));const{data:r,ephemeralKey:i,tag:o}=await t.encryptECIES(n,e),u=Buffer.concat([Buffer.from(i),Buffer.from(o),Buffer.from(r)]);return Roe.B64(u)},async DecryptCap(n,e){const t=await ii.ElvCrypto();e=new Uint8Array(Buffer.from(e.replace("0x",""),"hex")),n=Buffer.from(n,"base64");const r=n.slice(0,65),i=n.slice(65,81),o=n.slice(81),u=t.decryptECIES(new Uint8Array(o),e,new Uint8Array(r),new Uint8Array(i));return JSON.parse(Buffer.from(u).toString())},async GeneratePrimaryConk({spaceId:n,objectId:e}){const t=await ii.ElvCrypto(),{secretKey:r,publicKey:i}=t.generatePrimaryKeys(),o=t.generateSymmetricKey().key;return{symm_key:`kpsy${ky.encode(Buffer.from(o))}`,secret_key:`kpsk${ky.encode(Buffer.from(r))}`,public_key:`kppk${ky.encode(Buffer.from(i))}`,sid:n,qid:e}},async GenerateTargetConk(){const n=await ii.ElvCrypto(),{secretKey:e,publicKey:t}=n.generateTargetKeys();return{secret_key:`kpsk${ky.encode(Buffer.from(e))}`,public_key:`ktpk${ky.encode(Buffer.from(t))}`}},CapToConk(n){const e=t=>new Uint8Array(ky.decode(t.slice(4)));return{symmetricKey:e(n.symm_key),secretKey:e(n.secret_key),publicKey:e(n.public_key)}},async EncryptionContext(n){const e=await ii.ElvCrypto(),{symmetricKey:t,secretKey:r,publicKey:i}=ii.CapToConk(n);let o,u;return i.length===e.PRIMARY_PK_KEY_SIZE?(u=e.CRYPTO_TYPE_PRIMARY,o=e.newPrimaryContext(i,r,t)):(u=e.CRYPTO_TYPE_TARGET,o=e.newTargetDecryptionContext(r,t)),{context:o,type:u}},Encrypt:async(n,e)=>{const t=await ii.OpenEncryptionStream(n);!Buffer.isBuffer(e)&&!(e instanceof ArrayBuffer)&&(e=Buffer.from(await new Response(e).arrayBuffer()));const r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenEncryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t}=await ii.EncryptionContext(n),r=new nP.PassThrough,i=e.createCipher(t);return r.pipe(i).on("finish",()=>{t.free()}).on("error",o=>{throw Error(o)})},Decrypt:async(n,e)=>{const t=await ii.OpenDecryptionStream(n),r=new Uint8Array(e);for(let o=0;o<r.length;o+=1e6){const u=Math.min(r.length,o+1e6);t.write(r.slice(o,u))}t.end();let i=[];return await new Promise((o,u)=>{t.on("data",c=>{i.push(c)}).on("finish",()=>{o()}).on("error",c=>{u(c)})}),Buffer.concat(i)},OpenDecryptionStream:async n=>{const e=await ii.ElvCrypto(),{context:t,type:r}=await ii.EncryptionContext(n),i=new nP.PassThrough,o=e.createDecipher(r,t);return i.pipe(o).on("finish",()=>{t.free()}).on("error",u=>{throw Error(u)})}};var _B=ii,Qr={},rP;function SB(){if(rP)return Qr;rP=1;const n=ki;let e;n.Platform()===n.PLATFORM_NODE&&(globalThis.Response=C4().Response,e=p2);const t=xs,{ValidatePresence:r,ValidateWriteToken:i,ValidatePartHash:o,ValidateParameters:u}=Wo;return Qr.ListFiles=async function({libraryId:c,objectId:p,path:h="",versionHash:m,writeToken:w}){u({libraryId:c,objectId:p,versionHash:m,writeToken:w}),m&&(p=this.utils.DecodeVersionHash(m).objectId);let b=t("q",w||m||p,"files_list",h);return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:m}),method:"GET",path:b})},Qr.UploadFilesFromS3=async function({libraryId:c,objectId:p,writeToken:h,region:m,bucket:w,fileInfo:b,accessKey:g,secret:S,signedUrl:A,encryption:T="none",copy:R=!1,callback:L}){u({libraryId:c,objectId:p}),i(h);const D=/^s3:\/\/([^/]+)\//i;for(let Se=0;Se<b.length;Se++){const Ce=b[Se].source,ne=D.exec(Ce);if(ne){if(ne[1]!==w)throw Error('Full S3 file path "'+Ce+`" specified, but does not match provided bucket name '`+w+"'");b[Se].source=Ce.replace(D,"")}}R?this.Log(`Copying files from S3: ${c} ${p} ${h}`):this.Log(`Adding links to files in S3: ${c} ${p} ${h}`);let q;if(T==="cgck"){let Se=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h});Se={...Se,secret_key:""},q=`kp__${this.utils.B58(Buffer.from(JSON.stringify(Se)))}`}let W={access_key_id:g,secret_access_key:S};A&&(W={signed_url:A});const de={encryption_key:q,access:{protocol:"s3",platform:"aws",path:w,storage_endpoint:{region:m},cloud_credentials:W}},ce=b.map(Se=>R?{op:"ingest-copy",path:Se.path,encryption:{scheme:T==="cgck"?"cgck":"none"},ingest:{type:"key",path:Se.source}}:{op:"add-reference",path:Se.path,reference:{type:"key",path:Se.source}}),{id:me}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:ce,defaults:de});for(;;){await new Promise(ne=>setTimeout(ne,1e3));const Se=await this.UploadStatus({libraryId:c,objectId:p,writeToken:h,uploadId:me});if(Se.errors&&Se.errors.length>1)throw Se.errors.join(`
327
327
  `);if(Se.error)throw this.Log(`S3 file upload failed:
328
328
  ${JSON.stringify(Se,null,2)}`),Se.error;if(Se.status.toLowerCase()==="failed")throw"File upload failed";let Ce=!1;if(R){if(Ce=Se.ingest_copy.done,L){const ne=Se.ingest_copy.progress;L({done:Ce,uploaded:ne.bytes.completed,total:ne.bytes.total,uploadedFiles:ne.files.completed,totalFiles:ne.files.total,fileStatus:ne.files.details})}}else if(Ce=Se.add_reference.done,L){const ne=Se.add_reference.progress;L({done:Ce,uploadedFiles:ne.completed,totalFiles:ne.total})}if(Ce)break}},Qr.UploadFiles=async function({libraryId:c,objectId:p,writeToken:h,fileInfo:m,encryption:w="none",callback:b}){u({libraryId:c,objectId:p}),i(h),r("fileInfo",m),this.Log(`Uploading files: ${c} ${p} ${h}`);let g;w==="cgck"&&(g=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h}));let S={},A={},T=m;m=[];for(let C=0;C<T.length;C++){let _={...T[C],data:void 0};_.path=_.path.replace(/^\/+/,""),w==="cgck"&&(_.encryption={scheme:"cgck"}),A[_.path]=T[C].data,_.type="file",S[_.path]={uploaded:0,total:_.size},m.push(_)}this.Log(m),b&&b(S);const{id:R,jobs:L}=await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:m,encryption:w});this.Log(`Upload ID: ${R}`),this.Log(L);const D=500*1024*1024;let q=[],W=0,de=0;const ce=async()=>{for(let C=0;C<L.length;C++){for(;W-de>D;)await new Promise(z=>setTimeout(z,500));const _=L[C];let O=await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:h,uploadId:R,jobId:_});for(let z=0;z<O.files.length;z++){const F=O.files[z];let j;typeof A[F.path]=="number"?(j=Buffer.alloc(F.len),e.readSync(A[F.path],j,0,F.len,F.off)):j=A[F.path].slice(F.off,F.off+F.len),w==="cgck"&&(j=await this.Crypto.Encrypt(g,j)),O.files[z].data=j,W+=F.len}q[C]=O,await new Promise(z=>setTimeout(z,50))}},me=async(C,_)=>{for(;!q[_];)await new Promise(F=>setTimeout(F,500));const z=q[_].files;for(let F=0;F<z.length;F++){const j=z[F];let Q=0,ae=!1;do try{await this.UploadFileData({libraryId:c,objectId:p,writeToken:h,uploadId:R,jobId:C,filePath:j.path,fileData:j.data,encryption:w}),ae=!0}catch(N){if(this.Log(N,!0),Q+=1,Q>=10)throw N;await new Promise(k=>setTimeout(k,10*Q*1e3))}while(!ae&&Q<10);delete q[_].files[F].data,de+=j.len,b&&(S[j.path]={...S[j.path],uploaded:S[j.path].uploaded+j.len},b(S))}};ce().catch(C=>{throw C});const Se=Math.min(3,L.length);let Ce=[];for(let C=0;C<Se;C++){const _=new Date().getTime();await me(L[C],C);const O=(new Date().getTime()-_)/1e3,z=q[C].files.map(F=>F.len).reduce((F,j)=>F+j,0);Ce.push(z/O/(1024*1024))}const ne=Ce.reduce((C,_)=>C+_,0)/Se,ke=Math.min(5,Math.ceil(ne/2));await this.utils.LimitedMap(ke,L,async(C,_)=>{_<Se||await me(C,_)})},Qr.CreateFileUploadJob=async function({libraryId:c,objectId:p,writeToken:h,ops:m,defaults:w={},encryption:b="none"}){u({libraryId:c,objectId:p}),i(h),this.Log(`Creating file upload job: ${c} ${p} ${h}`),this.Log(m),b==="cgck"&&(w.encryption={scheme:"cgck"});const g={seq:0,seq_complete:!0,defaults:w,ops:m},S=t("q",h,"file_jobs");return this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:b}),method:"POST",path:S,body:g,allowFailover:!1})},Qr.UploadStatus=async function({libraryId:c,objectId:p,writeToken:h,uploadId:m}){u({libraryId:c,objectId:p}),i(h);const w=t("q",h,"file_jobs",m);return this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:w,allowFailover:!1}))},Qr.UploadJobStatus=async function({libraryId:c,objectId:p,writeToken:h,uploadId:m,jobId:w}){u({libraryId:c,objectId:p}),i(h);const b=t("q",h,"file_jobs",m,"uploads",w);let g=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:b,allowFailover:!1,queryParams:{start:0,limit:1e4}}));for(;g.next!==g.total&&g.next>=0;){const S=await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"GET",path:b,allowFailover:!1,queryParams:{start:g.next}}));g.files=[...g.files,...S.files],g.next=S.next}return g},Qr.UploadFileData=async function({libraryId:c,objectId:p,writeToken:h,encryption:m,uploadId:w,jobId:b,filePath:g,fileData:S}){u({libraryId:c,objectId:p}),i(h);let T=(await this.UploadJobStatus({libraryId:c,objectId:p,writeToken:h,uploadId:w,jobId:b})).files.find(L=>L.path===g);if(m&&m!=="none"&&(T=T.encrypted),T.rem===0)return;T.skip&&(S=S.slice(T.skip));let R=t("q",h,"file_jobs",w,b);return await this.utils.ResponseToJson(this.HttpClient.Request({method:"POST",path:R,body:S,bodyType:"BINARY",headers:{"Content-type":"application/octet-stream",...await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0})},allowFailover:!1,allowRetry:!1}))},Qr.FinalizeUploadJob=async function({libraryId:c,objectId:p,writeToken:h}){u({libraryId:c,objectId:p}),i(h),this.Log(`Finalizing upload job: ${c} ${p} ${h}`);const m=t("q",h,"files");await this.HttpClient.Request({method:"POST",path:m,bodyType:"BINARY",headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),allowFailover:!1})},Qr.CreateFileDirectories=async function({libraryId:c,objectId:p,writeToken:h,filePaths:m}){u({libraryId:c,objectId:p}),i(h),this.Log(`Creating Directories: ${c} ${p} ${h}`),this.Log(m);const w=m.map(b=>({op:"add",type:"directory",path:b}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:w})},Qr.MoveFiles=async function({libraryId:c,objectId:p,writeToken:h,filePaths:m}){u({libraryId:c,objectId:p}),i(h),this.Log(`Moving Files: ${c} ${p} ${h}`),this.Log(m);const w=m.map(({path:b,to:g})=>({op:"move",copy_move_source_path:b,path:g}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:w})},Qr.DeleteFiles=async function({libraryId:c,objectId:p,writeToken:h,filePaths:m}){u({libraryId:c,objectId:p}),i(h),this.Log(`Deleting Files: ${c} ${p} ${h}`),this.Log(m);const w=m.map(b=>({op:"del",path:b}));await this.CreateFileUploadJob({libraryId:c,objectId:p,writeToken:h,ops:w})},Qr.DownloadFile=async function({libraryId:c,objectId:p,versionHash:h,writeToken:m,filePath:w,format:b="arrayBuffer",chunked:g=!1,chunkSize:S,clientSideDecryption:A=!1,callback:T}){u({libraryId:c,objectId:p,versionHash:h}),r("filePath",w),h&&(p=this.utils.DecodeVersionHash(h).objectId);const R=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:h,writeToken:m,metadataSubtree:t("files",w)}),L=R&&R["."].encryption&&R["."].encryption.scheme==="cgck",D=L?"cgck":void 0,q=L&&!A?t("q",m||h||p,"rep","files_download",w):t("q",m||h||p,"files",w),W=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h,encryption:D,makeAccessRequest:D==="cgck"});W.Accept="*/*";const de=`eluv.caps.iusr${this.utils.AddressToHash(this.signer.address)}`,ce=await this.ContentObjectMetadata({libraryId:c,objectId:p,versionHash:h,metadataSubtree:de});L&&!this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))&&!ce&&(W["X-Content-Fabric-Decryption-Mode"]="reencrypt"),L&&!A&&(W["X-Content-Fabric-Decryption-Mode"]="decrypt",S=Number.MAX_SAFE_INTEGER);const me=R["."].size;if(L&&A)return await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,versionHash:h,download:!0}),downloadPath:q,bytesTotal:me,headers:W,callback:T,format:b,clientSideDecryption:A,chunked:g});S||(S=1e7);try{return await this.Download({downloadPath:q,bytesTotal:me,headers:W,callback:T,format:b,chunked:g,chunkSize:S})}catch(Se){if(L&&!A)return this.DownloadFile({...arguments[0],clientSideDecryption:!0});throw Se}},Qr.ContentParts=async function({libraryId:c,objectId:p,versionHash:h}){u({libraryId:c,objectId:p,versionHash:h}),this.Log(`Retrieving parts: ${c} ${p||h}`),h&&(p=this.utils.DecodeVersionHash(h).objectId);const m=t("q",h||p,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h}),method:"GET",path:m})).parts},Qr.ContentPart=async function({libraryId:c,objectId:p,versionHash:h,partHash:m}){u({libraryId:c,objectId:p,versionHash:h}),o(m),this.Log(`Retrieving part: ${c} ${p||h} ${m}`),h&&(p=this.utils.DecodeVersionHash(h).objectId);let w=t("q",h||p,"parts",m);return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h}),method:"GET",path:w})},Qr.DownloadPart=async function({libraryId:c,objectId:p,versionHash:h,writeToken:m,partHash:w,format:b="arrayBuffer",chunked:g=!1,chunkSize:S=1e7,callback:A}){u({libraryId:c,objectId:p,versionHash:h}),o(w),h&&(p=this.utils.DecodeVersionHash(h).objectId);const T=w.startsWith("hqpe"),R=T?"cgck":void 0,L=t("q",m||h||p,"data",w);let D=await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,versionHash:h,encryption:R,makeAccessRequest:!0});const q=(await this.ContentPart({libraryId:c,objectId:p,versionHash:h,partHash:w})).part.size;return T?(this.utils.EqualAddress(this.signer.address,await this.ContentObjectOwner({objectId:p}))||(D["X-Content-Fabric-Decryption-Mode"]="reencrypt"),await this.DownloadEncrypted({conk:await this.EncryptionConk({libraryId:c,objectId:p,download:!0}),downloadPath:L,bytesTotal:q,headers:D,callback:A,format:b,chunked:g})):await this.Download({downloadPath:L,bytesTotal:q,headers:D,callback:A,format:b,chunked:g,chunkSize:S})},Qr.Download=async function({downloadPath:c,headers:p,bytesTotal:h,chunked:m=!1,chunkSize:w=2e6,callback:b,format:g="arrayBuffer"}){if(m&&!b)throw Error("No callback specified for chunked download");let S;m||(S=[]);let A=0;const T=Math.ceil(h/w);for(let R=0;R<T;R++){p.Range=`bytes=${A}-${A+w-1}`;const L=await this.HttpClient.Request({path:c,headers:p,method:"GET"});A=Math.min(A+w,h),m?b({bytesFinished:A,bytesTotal:h,chunk:await this.utils.ResponseToFormat(g,L)}):(S.push(Buffer.from(await L.arrayBuffer())),b&&b({bytesFinished:A,bytesTotal:h}))}if(!m)return await this.utils.ResponseToFormat(g,new Response(Buffer.concat(S)))},Qr.DownloadEncrypted=async function({conk:c,downloadPath:p,bytesTotal:h,headers:m,callback:w,format:b="arrayBuffer",chunked:g=!1}){if(g&&!w)throw Error("No callback specified for chunked download");const S=c.public_key.startsWith("ktpk"),A=this.Crypto.EncryptedBlockSize(1e6,S);let T=0;b=b.toLowerCase();let R=[];const L=await this.Crypto.OpenDecryptionStream(c);L.on("data",async q=>{if(g){if(b!=="buffer"){const W=q.buffer.slice(q.byteOffset,q.byteOffset+q.byteLength);b==="arraybuffer"?q=W:q=await this.utils.ResponseToFormat(b,new Response(W))}w({bytesFinished:T,bytesTotal:h,chunk:q})}else w&&w({bytesFinished:T,bytesTotal:h}),R.push(q)});const D=Math.ceil(h/A);for(let q=0;q<D;q++){m.Range=`bytes=${T}-${T+A-1}`;const W=await this.HttpClient.Request({headers:m,method:"GET",path:p});T=Math.min(T+A,h),L.write(new Uint8Array(await W.arrayBuffer()))}if(L.end(),await new Promise(q=>L.on("finish",()=>{q()})),!g)return await this.utils.ResponseToFormat(b,new Response(Buffer.concat(R)))},Qr.CreatePart=async function({libraryId:c,objectId:p,writeToken:h,encryption:m}){u({libraryId:c,objectId:p}),i(h);const w=t("q",h,"parts");return(await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:m}),method:"POST",path:w,bodyType:"BINARY",body:"",allowFailover:!1})).part.write_token},Qr.UploadPartChunk=async function({libraryId:c,objectId:p,writeToken:h,partWriteToken:m,chunk:w,encryption:b}){if(u({libraryId:c,objectId:p}),i(h),b&&b!=="none"){const S=await this.EncryptionConk({libraryId:c,objectId:p,writeToken:h});w=await this.Crypto.Encrypt(S,w)}const g=t("q",h,"parts");await this.utils.ResponseToJson(this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:b}),method:"POST",path:t(g,m),body:w,bodyType:"BINARY",allowFailover:!1}))},Qr.FinalizePart=async function({libraryId:c,objectId:p,writeToken:h,partWriteToken:m,encryption:w}){u({libraryId:c,objectId:p}),i(h);const b=t("q",h,"parts");return await this.HttpClient.RequestJsonBody({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0,encryption:w}),method:"POST",path:t(b,m),bodyType:"BINARY",body:"",allowFailover:!1})},Qr.UploadPart=async function({libraryId:c,objectId:p,writeToken:h,data:m,encryption:w="none",chunkSize:b=1e7,callback:g}){u({libraryId:c,objectId:p}),i(h);const S=await this.CreatePart({libraryId:c,objectId:p,writeToken:h,encryption:w}),A=m.length||m.byteLength||m.size;g&&g({bytesFinished:0,bytesTotal:A});for(let T=0;T<A;T+=b){const R=m.slice(T,T+b);await this.UploadPartChunk({libraryId:c,objectId:p,writeToken:h,partWriteToken:S,chunk:R,encryption:w}),g&&g({bytesFinished:Math.min(T+b,A),bytesTotal:A})}return await this.FinalizePart({libraryId:c,objectId:p,writeToken:h,partWriteToken:S,encryption:w})},Qr.DeletePart=async function({libraryId:c,objectId:p,writeToken:h,partHash:m}){u({libraryId:c,objectId:p}),i(h),o(m);let w=t("q",h,"parts",m);await this.HttpClient.Request({headers:await this.authClient.AuthorizationHeader({libraryId:c,objectId:p,update:!0}),method:"DELETE",path:w,allowFailover:!1})},Qr}const aP=_ne,Ooe=ki,Loe=_F().permissionLevels,{LogMessage:Noe}=fm,Poe=_B;let CB=class I8{Log(e,t=!1){Noe(this,e,t)}constructor({target:e,timeout:t=30}={}){this.permissionLevels=Loe,!e&&typeof window<"u"&&window.parent&&(e=window.parent),this.target=e,this.timeout=t,this.utils=Ooe,this.Crypto=Poe,this.Crypto.ElvCrypto();for(const r of this.AllowedMethods())this[r]=async i=>{let o=i&&i.callback;return o&&delete i.callback,await this.SendMessage({options:{calledMethod:r,args:this.utils.MakeClonable(i)},callback:o})};this.userProfileClient={};for(const r of this.AllowedUserProfileMethods())this.userProfileClient[r]=async i=>{let o=i&&i.callback;return o&&delete i.callback,await this.SendMessage({options:{module:"userProfileClient",calledMethod:r,args:this.utils.MakeClonable(i),prompted:I8.PromptedMethods().includes(r)},callback:o})};this.walletClient={};for(const r of this.AllowedWalletClientMethods())this.walletClient[r]=async i=>{let o=i&&i.callback;return o&&delete i.callback,await this.SendMessage({options:{module:"walletClient",calledMethod:r,args:this.utils.MakeClonable(i)},callback:o})}}async PassRequest({request:e,Respond:t}){let r,i;try{let o;e.callbackId&&(o=u=>t({type:"ElvFrameResponse",requestId:e.callbackId,response:u})),r=await this.SendMessage({options:e,callback:o})}catch(o){i=o}return{type:"ElvFrameResponse",requestId:e.requestId,response:r,error:i}}async SendMessage({options:e={},callback:t,noResponse:r=!1}){const i=aP.next();let o;if(t&&(o=aP.next()),this.target.postMessage({...e,type:"ElvFrameRequest",requestId:i,callbackId:o},"*"),r)return;const u=e.calledMethod||e.operation,c=I8.FileMethods().includes(e.calledMethod);let p=this.timeout;return e.prompted||c?p=0:e.args&&e.args.fcTimeout&&(p=e.args.fcTimeout),await this.AwaitMessage(i,p,t,o,u)}async AwaitMessage(e,t,r,i,o){return await new Promise((u,c)=>{let p,h;const m=()=>{h&&clearTimeout(h),t>0&&(h=setTimeout(()=>{typeof window<"u"&&(window.removeEventListener("message",p),w&&window.removeEventListener("message",w)),c(`Request ${e} timed out (${o})`)},t*1e3))};let w;i&&(w=b=>{try{m();const g=b.data;if(g.type!=="ElvFrameResponse"||g.requestId!==i)return;r(g.response)}catch(g){console.error(g)}},window.addEventListener("message",w)),p=async b=>{try{const g=b.data;if(g.type!=="ElvFrameResponse"||g.requestId!==e)return;clearTimeout(h),window.removeEventListener("message",p),w&&window.removeEventListener("message",w),g.error?c(g.error):u(g.response)}catch(g){clearTimeout(h),window.removeEventListener("message",p),w&&window.removeEventListener("message",w),c(g)}},m(),window.addEventListener("message",p)})}static PromptedMethods(){return["CollectedTags","DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}static MetadataMethods(){return["DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}static FileMethods(){return["CreateFileUploadJob","DownloadEncrypted","DownloadFile","DownloadPart","FinalizeUploadJob","UpdateContentObjectGraph","UploadFileData","UploadFiles","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus"]}OverriddenMethods(){return["UploadFiles"]}AllowedMethods(){return["AccessGroupManagers","AccessGroupMembers","AccessGroupOwner","AccessInfo","AccessRequest","AccessType","AddAccessGroupManager","AddAccessGroupMember","AddContentLibraryGroup","AddContentObjectGroupPermission","AddLibraryContentType","AssetMetadata","AuditContentObject","AuditStream","AvailableDRMs","AvailableOfferings","AwaitPending","BitmovinPlayoutOptions","BlockNumber","CallBitcodeMethod","CallContractMethod","CallContractMethodAndWait","ClearCache","ClearStaticToken","Collection","CollectionTransactions","ConfigUrl","ContentLibraries","ContentLibrary","ContentLibraryGroupPermissions","ContentLibraryOwner","ContentObject","ContentObjectAccessComplete","ContentObjectGraph","ContentObjectGroupPermissions","ContentObjectImageUrl","ContentObjectLibraryId","ContentObjectMetadata","ContentObjectOwner","ContentObjectTenantId","ContentObjectVersions","ContentObjects","ContentPart","ContentParts","ContentSpaceId","ContentType","ContentTypeOwner","ContentTypes","ContractAbi","ContractEvents","ContractInfo","ContractMetadata","ContractName","CopyContentObject","CreateABRMezzanine","CreateAccessGroup","CreateAndFinalizeContentObject","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateSignedToken","CurrentAccountAddress","CustomContractAddress","Decrypt","DecryptECIES","DefaultKMSAddress","DeleteAccessGroup","DeleteContentLibrary","DeleteContentObject","DeleteContentVersion","DeleteFiles","DeleteMetadata","DeleteNTPInstance","DeletePart","DeleteWriteToken","DeployContract","Download","DownloadEncrypted","DownloadFile","DownloadPart","EditAndFinalizeContentObject","EditContentObject","EmbedUrl","Encrypt","EncryptECIES","EncryptionConk","Events","ExtractEventFromLogs","ExtractValueFromEvent","FabricUrl","FileUrl","FinalizeABRMezzanine","FinalizeContentObject","FinalizePart","FinalizeStateChannelAccess","FinalizeUploadJob","FormatContractArguments","GenerateStateChannelToken","GenerateSignedLinkToken","GetBalance","InitializeAuthPolicy","IssueNTPCode","IssueSignedNTPCode","LatestVersionHash","LibraryContentTypes","LinkAccessGroupToOauth","LinkData","LinkTarget","LinkUrl","ListAccessGroups","ListFiles","ListNTPInstances","LRODraftInfo","LROStatus","MakeAuthServiceRequest","MergeContractMetadata","MergeMetadata","MetadataAuth","MintNFT","MoveFiles","NetworkInfo","NodeId","Nodes","NTPInstance","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RecordWriteToken","RedeemCode","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetVisibility","SetPermission","SpaceNodes","StartABRMezzanineJobs","StreamAddWatermark","StreamConfig","StreamCopyToVod","StreamCreate","StreamInitialize","StreamInsertion","StreamListUrls","StreamRemoveWatermark","StreamStatus","StreamStartOrStopOrReset","StreamStopSession","SuspendNTPInstance","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","Visibility","WriteTokenNodeUrl"]}AllowedUserProfileMethods(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","TenantContractId","TenantId","UserMetadata","UserProfileImage","UserWalletAddress","UserWalletObjectInfo","WalletAddress"]}AllowedWalletClientMethods(){return["AcceptMarketplaceOffer","AddNotificationListener","AvailableMarketplaces","CanSign","CastVote","ClaimItem","ClaimStatus","CollectionRedemptionStatus","CreateListing","CreateMarketplaceOffer","DeployTenant","DropStatus","ExchangeRate","FilteredQuery","LatestMarketplaceHash","Leaderboard","Listing","ListingAttributes","ListingEditionNames","ListingNames","ListingPurchaseStatus","ListingStats","ListingStatus","Listings","LoadAvailableMarketplaces","LoadDrop","LoadMarketplace","Marketplace","MarketplaceCSS","MarketplaceInfo","MarketplaceOffers","MarketplaceStock","MintingStatus","NFT","NFTContractStats","Notifications","PackOpenStatus","Profile","ProfileMetadata","PurchaseStatus","PushNotification","RejectMarketplaceOffer","RemoveListing","RemoveMarketplaceOffer","RemoveProfileMetadata","RevokeVote","Sales","SalesNames","SalesStats","SetProfileMetadata","SubmitDropVote","TenantConfiguration","TransferNFT","Transfers","UserAddress","UserInfo","UserItemAttributes","UserItemEditionNames","UserItemNames","UserItems","UserListings","UserNameToAddress","UserSales","UserTransfers","UserWalletBalance","VoteStatus"]}};const{UploadFiles:Ioe}=SB();CB.prototype.UploadFiles=Ioe;XU.FrameClient=CB;const Zi=ki,N5=xs,{FrameClient:iP}=XU,{LogMessage:Doe}=fm;let Uoe=class{Log(e,t=!1){Doe(this,e,t)}constructor({client:e,debug:t}){this.client=e,this.debug=t,this.userWalletAddresses={},this.walletAddress=void 0,this.walletAddressRetrieved=!1}async CreateWallet(){if(this.creatingWallet)for(;this.creatingWallet;)await new Promise(e=>setTimeout(e,500));this.creatingWallet=!0;try{if(!this.walletAddress||Zi.EqualAddress(this.walletAddress,Zi.nullAddress)){if(this.Log(`Creating user wallet for user ${this.client.signer.address}`),await this.client.GetBalance({address:this.client.signer.address})<.1)return;const i=await this.client.CallContractMethodAndWait({contractAddress:Zi.HashToAddress(this.client.contentSpaceId),methodName:"createAccessWallet",methodArgs:[]}),o=await this.client.ContractAbi({contractAddress:this.client.contentSpaceAddress});this.walletAddress=this.client.ExtractValueFromEvent({abi:o,event:i,eventName:"CreateAccessWallet",eventValue:"wallet"}),this.userWalletAddresses[Zi.FormatAddress(this.client.signer.address)]=this.walletAddress}const e=this.client.contentSpaceLibraryId,t=Zi.AddressToObjectId(this.walletAddress);try{await this.client.ContentObject({libraryId:e,objectId:t})}catch(r){if(r.status===404){this.Log(`Creating wallet object for user ${this.client.signer.address}`);const i=await this.client.CreateContentObject({libraryId:e,objectId:t});await this.client.FinalizeContentObject({libraryId:e,objectId:t,writeToken:i.write_token,commitMessage:"Create user wallet object"})}}}catch(e){console.error("Failed to create wallet contract:"),console.error(e)}finally{this.creatingWallet=!1}}async WalletAddress(e=!0){if(this.walletAddress||this.walletAddressRetrieved)return this.walletAddress;this.walletAddressPromise||(this.walletAddressPromise=this.client.CallContractMethod({contractAddress:Zi.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[this.client.signer.address]}));const t=await this.walletAddressPromise;return Zi.EqualAddress(t,Zi.nullAddress)||(this.walletAddress=t),!this.walletAddress&&e&&await this.CreateWallet(),this.walletAddressRetrieved=!0,this.walletAddress}async UserWalletAddress({address:e}){if(Zi.EqualAddress(e,this.client.signer.address))return await this.WalletAddress();if(!this.userWalletAddresses[e]){this.Log(`Retrieving user wallet address for user ${e}`);const t=await this.client.CallContractMethod({contractAddress:Zi.HashToAddress(this.client.contentSpaceId),methodName:"userWallets",methodArgs:[e]});Zi.EqualAddress(t,Zi.nullAddress)||(this.userWalletAddresses[e]=t)}return this.userWalletAddresses[e]}async UserWalletObjectInfo({address:e}={}){const t=e?await this.UserWalletAddress({address:e}):await this.WalletAddress();return{libraryId:this.client.contentSpaceLibraryId,objectId:t?Zi.AddressToObjectId(t):""}}async PublicUserMetadata({address:e,metadataSubtree:t="/",queryParams:r={},select:i=[],resolveLinks:o=!1,resolveIncludeSource:u=!1,resolveIgnoreErrors:c=!1,linkDepthLimit:p=1}){if(!e||!await this.UserWalletAddress({address:e}))return;t=N5("public",t||"/");const{libraryId:m,objectId:w}=await this.UserWalletObjectInfo({address:e});if(w)return await this.client.ContentObjectMetadata({libraryId:m,objectId:w,queryParams:r,select:i,metadataSubtree:t,resolveLinks:o,resolveIncludeSource:u,resolveIgnoreErrors:c,linkDepthLimit:p})}async UserMetadata({metadataSubtree:e="/",queryParams:t={},select:r=[],resolveLinks:i=!1,resolveIncludeSource:o=!1,resolveIgnoreErrors:u=!1,linkDepthLimit:c=1}={}){this.Log(`Accessing private user metadata at ${e}`);const{libraryId:p,objectId:h}=await this.UserWalletObjectInfo();return await this.client.ContentObjectMetadata({libraryId:p,objectId:h,metadataSubtree:e,queryParams:t,select:r,resolveLinks:i,resolveIncludeSource:o,resolveIgnoreErrors:u,linkDepthLimit:c})}async MergeUserMetadata({metadataSubtree:e="/",metadata:t={}}){this.Log(`Merging user metadata at ${e}`);const{libraryId:r,objectId:i}=await this.UserWalletObjectInfo(),o=await this.client.EditContentObject({libraryId:r,objectId:i});await this.client.MergeMetadata({libraryId:r,objectId:i,writeToken:o.write_token,metadataSubtree:e,metadata:t}),await this.client.FinalizeContentObject({libraryId:r,objectId:i,writeToken:o.write_token,commitMessage:"Merge user metadata"})}async ReplaceUserMetadata({metadataSubtree:e="/",metadata:t={}}){this.Log(`Replacing user metadata at ${e}`);const{libraryId:r,objectId:i}=await this.UserWalletObjectInfo(),o=await this.client.EditContentObject({libraryId:r,objectId:i});await this.client.ReplaceMetadata({libraryId:r,objectId:i,writeToken:o.write_token,metadataSubtree:e,metadata:t}),await this.client.FinalizeContentObject({libraryId:r,objectId:i,writeToken:o.write_token,commitMessage:"Replace user metadata"})}async DeleteUserMetadata({metadataSubtree:e="/"}){this.Log(`Deleting user metadata at ${e}`);const{libraryId:t,objectId:r}=await this.UserWalletObjectInfo(),i=await this.client.EditContentObject({libraryId:t,objectId:r});await this.client.DeleteMetadata({libraryId:t,objectId:r,writeToken:i.write_token,metadataSubtree:e}),await this.client.FinalizeContentObject({libraryId:t,objectId:r,writeToken:i.write_token,commitMessage:"Delete user metadata"})}async AccessLevel(){return await this.UserMetadata({metadataSubtree:"access_level"})||"prompt"}async SetAccessLevel({level:e}){if(e=e.toLowerCase(),!["private","prompt","public"].includes(e))throw new Error("Invalid access level: "+e);await this.ReplaceUserMetadata({metadataSubtree:"access_level",metadata:e})}async TenantId(){return this.tenantId||(this.tenantId=await this.UserMetadata({metadataSubtree:"tenantId"})),this.tenantId}async SetTenantId({id:e,address:t}){if(e&&(!e.startsWith("iten")||!Zi.ValidHash(e)))throw Error(`Invalid tenant ID: ${e}`);if(t){if(!Zi.ValidAddress(t))throw Error(`Invalid address: ${t}`);e=`iten${Zi.AddressToHash(t)}`}try{if(await this.client.AccessType({id:e})!==this.client.authClient.ACCESS_TYPES.GROUP)throw Error("Invalid tenant ID: "+e)}catch{throw Error("Invalid tenant ID: "+e)}await this.ReplaceUserMetadata({metadataSubtree:"tenantId",metadata:e}),this.tenantId=e}async TenantContractId(){if(!this.tenantContractId){const{objectId:e}=await this.UserWalletObjectInfo();this.tenantContractId=await this.client.TenantContractId({contractAddress:this.client.utils.HashToAddress(e)})}return this.tenantContractId}async SetTenantContractId({tenantContractId:e}){const{objectId:t}=await this.UserWalletObjectInfo(),r=await this.client.SetTenantContractId({objectId:t,tenantContractId:e});this.tenantContractId=r.tenantContractId}async UserProfileImage({address:e,height:t}={}){let r;if(e?r=await this.UserWalletAddress({address:e}):(e=this.client.signer.address,r=this.walletAddress),!r)return;const{libraryId:i,objectId:o}=await this.UserWalletObjectInfo({address:e});return this.client.ContentObjectImageUrl({libraryId:i,objectId:o,height:t,imagePath:"public/profile_image"})}async SetUserProfileImage({image:e}){if(this.Log(`Setting profile image for user ${this.client.signer.address}`),(e.length||e.byteLength||e.size)>5e6)throw Error("Maximum profile image size is 5MB");const{libraryId:r,objectId:i}=await this.UserWalletObjectInfo(),o=await this.client.EditContentObject({libraryId:r,objectId:i});await this.client.SetContentObjectImage({libraryId:r,objectId:i,writeToken:o.write_token,image:e,imageName:"profile_image",imagePath:"public/profile_image"}),await this.client.FinalizeContentObject({libraryId:r,objectId:i,writeToken:o.write_token,commitMessage:"Set user profile image"})}async CollectedTags(){return await this.UserMetadata({metadataSubtree:"collected_data"})||{}}async RecordTags({libraryId:e,objectId:t,versionHash:r}){try{await this.__RecordTags({libraryId:e,objectId:t,versionHash:r})}catch(i){console.error(i)}}async __RecordTags({libraryId:e,objectId:t,versionHash:r}){if(await this.client.AccessType({id:t})!=="object"||(!r&&!e&&(e=await this.client.ContentObjectLibraryId({objectId:t})),r||(r=(await this.client.ContentObject({libraryId:e,objectId:t})).hash),await this.UserMetadata({metadataSubtree:N5("accessed_content",r)})))return;const u=await this.UserWalletObjectInfo(),c=u.libraryId,p=u.objectId,h=await this.client.EditContentObject({libraryId:c,objectId:p});await this.client.ReplaceMetadata({libraryId:c,objectId:p,writeToken:h.write_token,metadataSubtree:N5("accessed_content",r),metadata:Date.now()});const m=await this.client.ContentObjectMetadata({libraryId:e,objectId:t,versionHash:r,metadataSubtree:"video_tags"});if(m&&m.length>0){let w=await this.CollectedTags();const b=this.__FormatVideoTags(m);Object.keys(b).forEach(g=>{w[g]?(w[g].occurrences+=1,w[g].aggregate+=b[g]):w[g]={occurrences:1,aggregate:b[g]}}),await this.client.ReplaceMetadata({libraryId:c,objectId:p,writeToken:h.write_token,metadataSubtree:"collected_data",metadata:w})}await this.client.FinalizeContentObject({libraryId:c,objectId:p,writeToken:h.write_token,commitMessage:"Record user tags",awaitCommitConfirmation:!1})}__FormatVideoTags(e){let t={};e.forEach(i=>{i.tags.forEach(u=>{t[u.tag]?(t[u.tag].occurrences+=1,t[u.tag].aggregate+=u.score):t[u.tag]={occurrences:1,aggregate:u.score}})});let r={};return Object.keys(t).forEach(i=>{r[i]=t[i].aggregate/t[i].occurrences}),r}PromptedMethods(){return iP.PromptedMethods()}MetadataMethods(){return iP.MetadataMethods()}FrameAllowedMethods(){const e=["constructor","FrameAllowedMethods","Log","MetadataMethods","PromptedMethods","RecordTags","SetAccessLevel","SetTenantId","SetUserProfileImage","__IsLibraryCreated","__TouchLibrary","__FormatVideoTags","__RecordTags"];return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(t=>!e.includes(t))}};var Foe=Uoe;const hd=Wl,Cl=ki,Boe=Fd,My=xs,sP=N4;let zoe=class extends hd.Signer{constructor({signerURIs:e,idToken:t,authToken:r,tenantId:i,provider:o,extraData:u={},unsignedPublicAuth:c=!1}){super(),this.remoteSigner=!0,this.unsignedPublicAuth=c,this.HttpClient=new Boe({uris:e}),this.idToken=t,this.tenantId=i,this.authToken=r,this.extraLoginData=u||{},this.provider=o,this.signatureCache={}}async Initialize(){if(!this.authToken){const{addr:e,eth:t,token:r}=await Cl.ResponseToJson(this.HttpClient.Request({path:My("as","wlt","login","jwt"),method:"POST",body:this.tenantId?{tid:this.tenantId,ext:this.extraLoginData||{}}:{ext:this.extraLoginData||{}},headers:{Authorization:`Bearer ${this.idToken}`}}));this.authToken=r,this.address=Cl.FormatAddress(e),this.id=t}if(!this.address){const e=await Cl.ResponseToJson(this.HttpClient.Request({method:"GET",path:My("as","wlt","keys"),headers:{Authorization:`Bearer ${this.authToken}`}})),t=e.eth[0];t&&t.startsWith("0x")?this.address=t:this.address=Cl.HashToAddress(e.eth[0])}this.id=this.address?`ikms${Cl.AddressToHash(this.address)}`:void 0,this.signer=this.provider.getSigner(this.address)}async RetrieveCSAT({email:e,nonce:t,force:r=!1}){t=t||Cl.B58(sP.parse(sP.v4()));let i=await Cl.ResponseToJson(this.HttpClient.Request({method:"POST",body:{email:e,nonce:t,force:r},path:My("as","wlt","sign","csat"),headers:{Authorization:`Bearer ${this.authToken}`}}));return i.nonce=t,i}async CSATStatus({accessToken:e}){try{const t=await Cl.ResponseToJson(this.HttpClient.Request({method:"POST",path:My("as","wlt","login","status"),headers:{Authorization:`Bearer ${e}`}}));return t&&t.is_active}catch(t){return!t||t.status!==403}}async ReleaseCSAT({accessToken:e}){return await Cl.ResponseToJson(this.HttpClient.Request({method:"POST",path:My("as","wlt","login","release"),headers:{Authorization:`Bearer ${e}`}}))}getAddress(){return this.address}async signDigest(e){return this.signatureCache[e]||(this.signatureCache[e]=new Promise(async(t,r)=>{try{let i=await Cl.ResponseToJson(this.HttpClient.Request({method:"POST",path:My("as","wlt","sign","eth",this.id),headers:{Authorization:`Bearer ${this.authToken}`},body:{hash:e}}));i.v=parseInt(i.v,16),i.recoveryParam=i.v-27,t(i)}catch(i){r(i)}})),await this.signatureCache[e]}async signMessage(e){return Promise.resolve(hd.utils.joinSignature(`0x${await this.signDigest(hd.utils.hashMessage(e))}`))}async sign(e){e=await hd.utils.resolveProperties(e);const t=await this.signDigest(hd.utils.keccak256(hd.utils.serializeTransaction(e)));return hd.utils.serializeTransaction(e,t)}async sendTransaction(e){return e.nonce==null&&(e=hd.utils.shallowCopy(e),e.nonce=await this.provider.getTransactionCount(this.address,"pending")),this.populateTransaction(e,this.provider,this.address).then(t=>this.sign(t).then(r=>this.provider.sendTransaction(r)))}connect(){}};var joe=zoe,fa={},oP;function $oe(){if(oP)return fa;oP=1;const{ValidatePresence:n,ValidateLibrary:e,ValidateObject:t,ValidateAddress:r,ValidateUserWallet:i}=Wo;return fa.ListAccessGroups=async function(){const o=(await this.Collection({collectionType:"accessGroups"})).map(c=>this.utils.FormatAddress(c));return(await this.utils.LimitedMap(5,o,async c=>{try{const p=this.utils.AddressToHash(c),h=await this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:`iq__${p}`})||{};return{address:c,id:`igrp${p}`,meta:h}}catch(p){this.Log(p,!0)}})).filter(c=>c).sort((c,p)=>{const h=(c.meta.public||{}).name||`zz__${c.address}`,m=(p.meta.public||{}).name||`zz__${p.address}`;return h<m?-1:1})},fa.SetGroupPermission=async function({groupAddress:o,objectId:u,permission:c,remove:p=!1}){const h=await this.authClient.ContractInfo({address:o}),m=await this.authClient.ContractInfo({id:u});if(Object.keys(h).length===0)throw Error(`No information returned for group address ${o}`);let w;if(!m.isV3&&m.accessType===this.authClient.ACCESS_TYPES.GROUP){if(h.isV3)throw Error("Unable to map V3 group to V2 object");w=await this.CallContractMethodAndWait({contractAddress:o,methodName:"setAccessGroupRights",methodArgs:[this.utils.HashToAddress(u),c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]})}else w=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(u),methodName:"setRights",methodArgs:[o,c==="manage"?2:c==="access"?1:0,c==="none"||p?0:2]});return await this.ExtractEventFromLogs({abi:h.abi,event:w,eventName:"RightsChanged"})},fa.AccessGroupOwner=async function({contractAddress:o}){return o=r(o),this.Log(`Retrieving owner of access group ${o}`),await this.authClient.Owner({address:o})},fa.AccessGroupMembers=async function({contractAddress:o}){if(o=r(o),this.Log(`Retrieving members for group ${o}`),await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"})){const c=(await this.CallContractMethod({contractAddress:o,methodName:"membersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,h)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:o,methodName:"membersList",methodArgs:[h]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:o,methodName:"getMeta",methodArgs:["members"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},fa.AccessGroupManagers=async function({contractAddress:o}){if(o=r(o),this.Log(`Retrieving managers for group ${o}`),await this.authClient.ContractHasMethod({contractAddress:o,methodName:"managersList"})){const c=(await this.CallContractMethod({contractAddress:o,methodName:"managersNum"})).toNumber();return await Promise.all([...Array(c)].map(async(p,h)=>this.utils.FormatAddress(await this.CallContractMethod({contractAddress:o,methodName:"managersList",methodArgs:[h]}))))}else{const c=this.utils.FromHex(await this.CallContractMethod({contractAddress:o,methodName:"getMeta",methodArgs:["managers"]}));return c&&JSON.parse(c)?JSON.parse(c):[]}},fa.CreateAccessGroup=async function({name:o,description:u,metadata:c={},visibility:p=1}={}){this.Log(`Creating access group: ${o||""} ${u||""}`);let{contractAddress:h}=await this.authClient.CreateAccessGroup();h=this.utils.FormatAddress(h);const m=this.utils.AddressToObjectId(h),w=await this.userProfileClient.TenantContractId();this.Log(`Access group: ${h} ${m}`);const b=await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:m}),g={public:{name:o,description:u},name:o,description:u,...c};if(await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:m,writeToken:b.write_token,metadata:g}),await this.CallContractMethodAndWait({contractAddress:h,methodName:"setVisibility",methodArgs:[p]}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:m,writeToken:b.write_token,commitMessage:"Create access group"}),w){const S=await this.SetTenantContractId({contractAddress:h,tenantContractId:w});if(S.tenantId){let A=this.utils.HashToAddress(S.tenantId);await this.AddContentObjectGroupPermission({objectId:m,groupAddress:A,permission:"manage"})}else console.warn("No tenant ID associated with current tenant.")}return h},fa.DeleteAccessGroup=async function({contractAddress:o}){throw Error("Not supported")},fa.AccessGroupMembershipMethod=async function({contractAddress:o,memberAddress:u,methodName:c,eventName:p}){if(o=r(o),u=r(u),!this.utils.EqualAddress(this.signer.address,u)&&!await this.CallContractMethod({contractAddress:o,methodName:"hasManagerAccess",methodArgs:[this.utils.FormatAddress(this.signer.address)]}))throw Error("Manager access required");this.Log(`Calling ${c} on group ${o} for user ${u}`);const h=await this.CallContractMethodAndWait({contractAddress:o,methodName:c,methodArgs:[u],eventName:p,eventValue:"candidate"}),m=await this.ContractAbi({contractAddress:o}),w=this.ExtractValueFromEvent({abi:m,event:h,eventName:p,eventValue:"candidate"});if(this.utils.FormatAddress(w)!==this.utils.FormatAddress(u))throw console.error("Mismatch: "+w+" :: "+u),console.error("Is target user address wallet created?"),Error("Access group method "+c+" failed. Is target user address wallet created?");return h.transactionHash},fa.AddAccessGroupMember=async function({contractAddress:o,memberAddress:u}){o=r(o),u=r(u),await i({address:u,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"grantAccess",eventName:"MemberAdded"});if(!c){let h=await this.AccessGroupMembers({contractAddress:o});h.push(u),h=h.filter((m,w,b)=>b.indexOf(m)===w),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"members",metadata:h})}return p},fa.RemoveAccessGroupMember=async function({contractAddress:o,memberAddress:u}){o=r(o),u=r(u);const c=await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"revokeAccess",eventName:"MemberRevoked"});if(!c){let h=await this.AccessGroupMembers({contractAddress:o});return h=h.filter(m=>m!==u),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"members",metadata:h})}return p},fa.AddAccessGroupManager=async function({contractAddress:o,memberAddress:u}){o=r(o),u=r(u),await i({address:u,client:this});const c=await this.authClient.ContractHasMethod({contractAddress:o,methodName:"membersList"}),p=await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"grantManagerAccess",eventName:"ManagerAccessGranted"});if(!c){let h=await this.AccessGroupManagers({contractAddress:o});h.push(u),h=h.filter((m,w,b)=>b.indexOf(m)===w),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"managers",metadata:h})}return p},fa.RemoveAccessGroupManager=async function({contractAddress:o,memberAddress:u}){if(o=r(o),u=r(u),!await this.authClient.ContractHasMethod({contractAddress:o,methodName:"managersList"})){let h=await this.AccessGroupManagers({contractAddress:o});h=h.filter(m=>m!==u),await this.ReplaceContractMetadata({contractAddress:o,metadataKey:"managers",metadata:h})}return await this.AccessGroupMembershipMethod({contractAddress:o,memberAddress:u,methodName:"revokeManagerAccess",eventName:"ManagerAccessRevoked"})},fa.ContentLibraryGroupPermissions=async function({libraryId:o,permissions:u=[]}){e(o);let c={};return!u||u.length===0?u=["accessor","contributor","reviewer"]:u=u.map(p=>{if(p=p.toLowerCase(),!["accessor","contributor","reviewer"].includes(p))throw Error(`Invalid permission: ${p}`);return p}),this.Log(`Retrieving ${u.join(", ")} group(s) for library ${o}`),await Promise.all(u.map(async p=>{let h=await this.CallContractMethod({contractAddress:this.utils.HashToAddress(o),methodName:p+"GroupsLength"});h=parseInt(h._hex,16),(await this.utils.LimitedMap(3,[...Array(h).keys()],async w=>{try{return this.utils.FormatAddress(await this.CallContractMethod({contractAddress:this.utils.HashToAddress(o),methodName:p+"Groups",methodArgs:[w]}))}catch(b){console.error(b)}})).forEach(w=>c[w]=[...c[w]||[],p].sort())})),c},fa.AddContentLibraryGroup=async function({libraryId:o,groupAddress:u,permission:c}){if(e(o),u=r(u),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Adding ${c} group ${u} to library ${o}`),(await this.ContentLibraryGroupPermissions({libraryId:o,permissions:[c]}))[u])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const h=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(o),methodName:`add${c}Group`,methodArgs:[u]}),m=await this.ContractAbi({id:o});await this.ExtractEventFromLogs({abi:m,event:h,eventName:`${c}GroupAdded`})},fa.RemoveContentLibraryGroup=async function({libraryId:o,groupAddress:u,permission:c}){if(e(o),u=r(u),!["accessor","contributor","reviewer"].includes(c.toLowerCase()))throw Error(`Invalid group type: ${c}`);if(this.Log(`Removing ${c} group ${u} from library ${o}`),!(await this.ContentLibraryGroupPermissions({libraryId:o,permissions:[c]}))[u])return;c=c.charAt(0).toUpperCase()+c.substr(1).toLowerCase();const h=await this.CallContractMethodAndWait({contractAddress:this.utils.HashToAddress(o),methodName:`remove${c}Group`,methodArgs:[u]}),m=await this.ContractAbi({id:o});await this.ExtractEventFromLogs({abi:m,event:h,eventName:`${c}GroupRemoved`})},fa.ContentObjectGroupPermissions=async function({objectId:o}){t(o),this.Log(`Retrieving group permissions for object ${o}`);const u=this.utils.HashToAddress(o),c=await this.Collection({collectionType:"accessGroups"});let p;switch(await this.AccessType({id:o})){case this.authClient.ACCESS_TYPES.OBJECT:p="getContentObjectRights";break;case this.authClient.ACCESS_TYPES.TYPE:p="getContentTypeRights";break;case this.authClient.ACCESS_TYPES.GROUP:p="getAccessGroupRights";break;case this.authClient.ACCESS_TYPES.LIBRARY:p="getLibraryRights"}const h={};return await Promise.all(c.map(async m=>{try{m=this.utils.FormatAddress(m);let w=await this.CallContractMethod({contractAddress:m,methodName:p,methodArgs:[u]});if(w===0)return;let b=[];w>=100&&b.push("manage"),w%100>=10&&b.push("access"),w%10>0&&b.push("see"),h[m]=b}catch(w){this.Log(`Failed to retrieve group permissions for ${m}`,!0),this.Log(w,!0)}})),h},fa.AddContentObjectGroupPermission=async function({objectId:o,groupAddress:u,permission:c}){if(n("permission",c),t(o),u=r(u),this.utils.EqualAddress(u,this.utils.HashToAddress(o)))throw Error("Group rights cannot be set on the same group");if(c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Adding ${c} permission to group ${u} for ${o}`),await this.SetGroupPermission({groupAddress:u,objectId:o,permission:c})},fa.RemoveContentObjectGroupPermission=async function({objectId:o,groupAddress:u,permission:c}){if(n("permission",c),t(o),u=r(u),c=c.toLowerCase(),!["see","access","manage"].includes(c))throw Error(`Invalid permission type: ${c}`);return this.Log(`Removing ${c} permission from group ${u} for ${o}`),await this.SetGroupPermission({groupAddress:u,objectId:o,permission:c,remove:!0})},fa.LinkAccessGroupToOauth=async function({groupAddress:o,kmsId:u,oauthConfig:c}){r(o),n("kmsId",u),n("oauthConfig",c),typeof c=="string"&&(c=JSON.parse(c));const{publicKey:p}=await this.authClient.KMSInfo({kmsId:u}),h=`eluv.jwtv.${u}`,m=await this.Crypto.EncryptConk(c,p),w=`eluv.jwtv.iusr${this.utils.AddressToHash(this.signer.address)}`,b=await this.EncryptECIES({message:c}),g=this.utils.AddressToObjectId(o),S=(await this.EditContentObject({libraryId:this.contentSpaceLibraryId,objectId:g})).write_token;await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:g,writeToken:S,metadataSubtree:h,metadata:m}),await this.ReplaceMetadata({libraryId:this.contentSpaceLibraryId,objectId:g,writeToken:S,metadataSubtree:w,metadata:b}),await this.FinalizeContentObject({libraryId:this.contentSpaceLibraryId,objectId:g,writeToken:S,commitMessage:"Bind access group to OAuth"}),await this.CallContractMethodAndWait({contractAddress:o,methodName:"setOAuthEnabled",methodArgs:[!1]}),await this.CallContractMethodAndWait({contractAddress:o,methodName:"setOAuthEnabled",methodArgs:[!0]})},fa.UnlinkAccessGroupFromOauth=async function({groupAddress:o}){r(o),await this.CallContractMethodAndWait({contractAddress:o,methodName:"setOAuthEnabled",methodArgs:[!1]})},fa}var Zr={},uP;function Hoe(){if(uP)return Zr;uP=1;const n=Wl,{ValidateAddress:e,ValidateParameters:t,ValidatePresence:r,ValidateObject:i,ValidateVersion:o}=Wo,u=ki;return Zr.ContractName=async function({contractAddress:c}){return c=e(c),await this.ethClient.ContractName(c)},Zr.ContractAbi=async function({contractAddress:c,id:p}){const h=await this.authClient.ContractInfo({address:c,id:p});if(!h)throw Error(`Unable to determine contract info for ${c}`);return h.abi},Zr.ContractInfo=async function({id:c,address:p}){return this.authClient.ContractInfo({id:c,address:p})},Zr.FormatContractArguments=function({abi:c,methodName:p,args:h}){return this.ethClient.FormatContractArguments({abi:c,methodName:p,args:h})},Zr.DeployContract=async function({abi:c,bytecode:p,constructorArgs:h,overrides:m={}}){return await this.ethClient.DeployContract({abi:c,bytecode:p,constructorArgs:h,overrides:m,signer:this.signer})},Zr.ContractEvents=async function({contractAddress:c,abi:p,fromBlock:h=0,toBlock:m,count:w=1e3,topics:b,includeTransaction:g=!1}){c=e(c),p||(p=await this.ContractAbi({contractAddress:c}));const S=await this.FormatBlockNumbers({fromBlock:h,toBlock:m,count:w});return this.Log(`Querying contract events ${c} - Blocks ${S.fromBlock} to ${S.toBlock}`),await this.ethClient.ContractEvents({contractAddress:c,abi:p,fromBlock:S.fromBlock,toBlock:S.toBlock,topics:b,includeTransaction:g})},Zr.CallContractMethod=async function({contractAddress:c,abi:p,methodName:h,methodArgs:m=[],value:w,overrides:b={},formatArguments:g=!0,cacheContract:S=!0,overrideCachedContract:A=!1}){return c=e(c),c=this.utils.FormatAddress(c),h==="setVisibility"&&this.visibilityInfo[c]&&delete this.visibilityInfo[c],p||(p=await this.ContractAbi({contractAddress:c})),await this.ethClient.CallContractMethod({contractAddress:c,abi:p,methodName:h,methodArgs:m,value:w,overrides:b,formatArguments:g,cacheContract:S,overrideCachedContract:A})},Zr.CallContractMethodAndWait=async function({contractAddress:c,abi:p,methodName:h,methodArgs:m,value:w,overrides:b={},formatArguments:g=!0,cacheContract:S=!0,overrideCachedContract:A=!1}){return c=e(c),c=this.utils.FormatAddress(c),h==="setVisibility"&&this.visibilityInfo[c]&&delete this.visibilityInfo[c],p||(p=await this.ContractAbi({contractAddress:c})),await this.ethClient.CallContractMethodAndWait({contractAddress:c,abi:p,methodName:h,methodArgs:m,value:w,overrides:b,formatArguments:g,cacheContract:S,overrideCachedContract:A})},Zr.ContractMetadata=async function({contractAddress:c,metadataKey:p}){r("contractAddress",c),r("metadataKey",p);try{const h=await this.CallContractMethod({contractAddress:c,methodName:"getMeta",methodArgs:[p]}),m=Buffer.from((h||"").replace("0x",""),"hex").toString("utf-8");try{return JSON.parse(m)}catch{return m}}catch{return""}},Zr.MergeContractMetadata=async function({contractAddress:c,metadataKey:p,metadata:h}){r("contractAddress",c),r("metadataKey",p);const m=await this.ContractMetadata({contractAddress:c,metadataKey:p})||{};typeof m=="object"&&(h={...m,...h}),await this.CallContractMethodAndWait({contractAddress:c,methodName:"putMeta",methodArgs:[p,JSON.stringify(h)]})},Zr.ReplaceContractMetadata=async function({contractAddress:c,metadataKey:p,metadata:h}){r("contractAddress",c),r("metadataKey",p),typeof h=="object"&&(h=JSON.stringify(h)),await this.CallContractMethodAndWait({contractAddress:c,methodName:"putMeta",methodArgs:[p,h]})},Zr.CustomContractAddress=async function({libraryId:c,objectId:p,versionHash:h}){if(t({libraryId:c,objectId:p,versionHash:h}),h&&(p=this.utils.DecodeVersionHash(h).objectId),c===this.contentSpaceLibraryId||this.utils.EqualHash(c,p))return;this.Log(`Retrieving custom contract address: ${p}`);const m=await this.ContractAbi({id:p}),w=await this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(p),abi:m,methodName:"contentContractAddress",methodArgs:[]});if(w!==this.utils.nullAddress)return this.utils.FormatAddress(w)},Zr.SetCustomContentContract=async function({libraryId:c,objectId:p,customContractAddress:h,name:m,description:w,abi:b,factoryAbi:g,overrides:S={}}){t({libraryId:c,objectId:p}),h=e(h),h=this.utils.FormatAddress(h),this.Log(`Setting custom contract address: ${p} ${h}`);const A=await this.ethClient.SetCustomContentContract({contentContractAddress:this.utils.HashToAddress(p),customContractAddress:h,overrides:S,signer:this.signer}),T=(await this.EditContentObject({libraryId:c,objectId:p})).write_token;return await this.ReplaceMetadata({libraryId:c,objectId:p,writeToken:T,metadataSubtree:"custom_contract",metadata:{name:m,description:w,address:h,abi:b,factoryAbi:g}}),await this.FinalizeContentObject({libraryId:c,objectId:p,writeToken:T,commitMessage:"Set custom contract"}),A},Zr.ExtractEventFromLogs=function({abi:c,event:p,eventName:h}){return this.ethClient.ExtractEventFromLogs({abi:c,event:p,eventName:h})},Zr.ExtractValueFromEvent=function({abi:c,event:p,eventName:h,eventValue:m}){const w=this.ethClient.ExtractEventFromLogs({abi:c,event:p,eventName:h,eventValue:m});return w?w.args[m]:void 0},Zr.FormatBlockNumbers=async function({fromBlock:c,toBlock:p,count:h=10}){const m=await this.BlockNumber();return p?c||(c=p-h+1):c?p=c+h-1:(p=m,c=p-h+1),p>m&&(p=m),c<0&&(c=0),{fromBlock:c,toBlock:p}},Zr.Events=async function({toBlock:c,fromBlock:p,count:h=10,includeTransaction:m=!1}={}){const w=await this.FormatBlockNumbers({fromBlock:p,toBlock:c,count:h});return this.Log(`Querying events - Blocks ${w.fromBlock} to ${w.toBlock}`),await this.ethClient.Events({fromBlock:w.fromBlock,toBlock:w.toBlock,includeTransaction:m})},Zr.BlockNumber=async function(){return await this.ethClient.MakeProviderCall({methodName:"getBlockNumber"})},Zr.GetBalance=async function({address:c}){c=e(c);const p=await this.ethClient.MakeProviderCall({methodName:"getBalance",args:[c]});return n.utils.formatEther(p)},Zr.SendFunds=async function({recipient:c,ether:p}){return c=e(c),await(await this.signer.sendTransaction({to:c,value:n.utils.parseEther(p.toString())})).wait()},Zr.TenantContractId=async function({contractAddress:c,objectId:p,versionHash:h}){if(c)e(c),p=u.AddressToObjectId(c);else if(h)o(h),p=this.utils.DecodeVersionHash(h).objectId,c=u.HashToAddress(p);else if(p)i(p),c=u.HashToAddress(p);else throw Error("contractAddress or objectId or versionHash not specified");if(await this.authClient.ContractHasMethod({contractAddress:c,methodName:"getMeta"})){const b=await this.ContractMetadata({contractAddress:c,metadataKey:"_ELV_TENANT_ID"});if(b!=="")return b}const w=await this.ContentObjectLibraryId({objectId:p});return await this.ContentObjectMetadata({libraryId:w,objectId:p,metadataSubtree:"tenantContractId"})},Zr.SetTenantContractId=async function({contractAddress:c,objectId:p,versionHash:h,tenantContractId:m}){if(c)e(c),p=u.AddressToObjectId(c);else if(h)o(h),p=this.utils.DecodeVersionHash(h).objectId,c=u.HashToAddress(p);else if(p)i(p),c=u.HashToAddress(p);else throw Error("contractAddress or objectId or versionHash not specified");if(i(m),m&&(!m.startsWith("iten")||!u.ValidHash(m)))throw Error(`Invalid tenant ID: ${m}`);const w=u.HashToAddress(m);if(await this.authClient.AccessType(m)!==this.authClient.ACCESS_TYPES.TENANT)throw Error("Invalid tenant ID: "+m);const g=await this.CallContractMethod({contractAddress:w,methodName:"groupsMapping",methodArgs:["tenant_admin",0],formatArguments:!0});if(await this.authClient.ContractHasMethod({contractAddress:c,methodName:"putMeta"}))await this.ReplaceContractMetadata({contractAddress:c,metadataKey:"_ELV_TENANT_ID",metadata:m}),g?await this.ReplaceContractMetadata({contractAddress:c,metadataKey:"_tenantId",metadata:`iten${u.AddressToHash(g)}`}):console.warn("No tenant ID associated with current tenant.");else{const A=await this.ContentObjectLibraryId({objectId:p}),T=await this.EditContentObject({libraryId:A,objectId:p});await this.MergeMetadata({libraryId:A,objectId:p,writeToken:T.write_token,metadata:{tenantContractId:m,tenantId:g?`iten${u.AddressToHash(g)}`:void 0}}),await this.FinalizeContentObject({libraryId:A,objectId:p,writeToken:T.write_token,commitMessage:"set tenant_contract_id"})}return{tenantContractId:m,tenantId:g?`iten${u.AddressToHash(g)}`:void 0}},Zr}var yd={},qoe=function(){return!1};const Voe=qoe;var Goe=function(){return!0};const Woe=Goe,Koe={"@@functional/placeholder":!0};function Hr(n){return n!=null&&typeof n=="object"&&n["@@functional/placeholder"]===!0}function Qt(n){return function e(t){return arguments.length===0||Hr(t)?e:n.apply(this,arguments)}}function Ke(n){return function e(t,r){switch(arguments.length){case 0:return e;case 1:return Hr(t)?e:Qt(function(i){return n(t,i)});default:return Hr(t)&&Hr(r)?e:Hr(t)?Qt(function(i){return n(i,r)}):Hr(r)?Qt(function(i){return n(t,i)}):n(t,r)}}}var Yoe=Ke(function(e,t){return Number(e)+Number(t)});const J2=Yoe;function Fu(n,e){n=n||[],e=e||[];var t,r=n.length,i=e.length,o=[];for(t=0;t<r;)o[o.length]=n[t],t+=1;for(t=0;t<i;)o[o.length]=e[t],t+=1;return o}function Bu(n,e){switch(n){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,r){return e.apply(this,arguments)};case 3:return function(t,r,i){return e.apply(this,arguments)};case 4:return function(t,r,i,o){return e.apply(this,arguments)};case 5:return function(t,r,i,o,u){return e.apply(this,arguments)};case 6:return function(t,r,i,o,u,c){return e.apply(this,arguments)};case 7:return function(t,r,i,o,u,c,p){return e.apply(this,arguments)};case 8:return function(t,r,i,o,u,c,p,h){return e.apply(this,arguments)};case 9:return function(t,r,i,o,u,c,p,h,m){return e.apply(this,arguments)};case 10:return function(t,r,i,o,u,c,p,h,m,w){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function Jb(n,e,t){return function(){for(var r=[],i=0,o=n,u=0;u<e.length||i<arguments.length;){var c;u<e.length&&(!Hr(e[u])||i>=arguments.length)?c=e[u]:(c=arguments[i],i+=1),r[u]=c,Hr(c)||(o-=1),u+=1}return o<=0?t.apply(this,r):Bu(o,Jb(n,r,t))}}var Joe=Ke(function(e,t){return e===1?Qt(t):Bu(e,Jb(e,[],t))});const si=Joe;var Qoe=Qt(function(e){return si(e.length,function(){var t=0,r=arguments[0],i=arguments[arguments.length-1],o=Array.prototype.slice.call(arguments,0);return o[0]=function(){var u=r.apply(this,Fu(arguments,[t,i]));return t+=1,u},e.apply(this,o)})});const Zoe=Qoe;function _n(n){return function e(t,r,i){switch(arguments.length){case 0:return e;case 1:return Hr(t)?e:Ke(function(o,u){return n(t,o,u)});case 2:return Hr(t)&&Hr(r)?e:Hr(t)?Ke(function(o,u){return n(o,r,u)}):Hr(r)?Ke(function(o,u){return n(t,o,u)}):Qt(function(o){return n(t,r,o)});default:return Hr(t)&&Hr(r)&&Hr(i)?e:Hr(t)&&Hr(r)?Ke(function(o,u){return n(o,u,i)}):Hr(t)&&Hr(i)?Ke(function(o,u){return n(o,r,u)}):Hr(r)&&Hr(i)?Ke(function(o,u){return n(t,o,u)}):Hr(t)?Qt(function(o){return n(o,r,i)}):Hr(r)?Qt(function(o){return n(t,o,i)}):Hr(i)?Qt(function(o){return n(t,r,o)}):n(t,r,i)}}}var Xoe=_n(function(e,t,r){if(e>=r.length||e<-r.length)return r;var i=e<0?r.length:0,o=i+e,u=Fu(r);return u[o]=t(r[o]),u});const EB=Xoe,Du=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function Z4(n){return n!=null&&typeof n["@@transducer/step"]=="function"}function Ba(n,e,t){return function(){if(arguments.length===0)return t();var r=Array.prototype.slice.call(arguments,0),i=r.pop();if(!Du(i)){for(var o=0;o<n.length;){if(typeof i[n[o]]=="function")return i[n[o]].apply(i,r);o+=1}if(Z4(i)){var u=e.apply(null,r);return u(i)}}return t.apply(this,arguments)}}function $d(n){return n&&n["@@transducer/reduced"]?n:{"@@transducer/value":n,"@@transducer/reduced":!0}}const kr={init:function(){return this.xf["@@transducer/init"]()},result:function(n){return this.xf["@@transducer/result"](n)}};var eue=function(){function n(e,t){this.xf=t,this.f=e,this.all=!0}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.all&&(e=this.xf["@@transducer/step"](e,!0)),this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.f(t)||(this.all=!1,e=$d(this.xf["@@transducer/step"](e,!1))),e},n}(),tue=Ke(function(e,t){return new eue(e,t)}),nue=Ke(Ba(["all"],tue,function(e,t){for(var r=0;r<t.length;){if(!e(t[r]))return!1;r+=1}return!0}));const AB=nue;var rue=Ke(function(e,t){return t>e?t:e});const xm=rue;function Vy(n,e){for(var t=0,r=e.length,i=Array(r);t<r;)i[t]=n(e[t]),t+=1;return i}function nm(n){return Object.prototype.toString.call(n)==="[object String]"}var Qb=Qt(function(e){return Du(e)?!0:!e||typeof e!="object"||nm(e)?!1:e.nodeType===1?!!e.length:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),aue=function(){function n(e){this.f=e}return n.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},n.prototype["@@transducer/result"]=function(e){return e},n.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},n}();function kB(n){return new aue(n)}var iue=Ke(function(e,t){return Bu(e.length,function(){return e.apply(t,arguments)})});const MB=iue;function sue(n,e,t){for(var r=0,i=t.length;r<i;){if(e=n["@@transducer/step"](e,t[r]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return n["@@transducer/result"](e)}function lP(n,e,t){for(var r=t.next();!r.done;){if(e=n["@@transducer/step"](e,r.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=t.next()}return n["@@transducer/result"](e)}function cP(n,e,t,r){return n["@@transducer/result"](t[r](MB(n["@@transducer/step"],n),e))}var fP=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function ws(n,e,t){if(typeof n=="function"&&(n=kB(n)),Qb(t))return sue(n,e,t);if(typeof t["fantasy-land/reduce"]=="function")return cP(n,e,t,"fantasy-land/reduce");if(t[fP]!=null)return lP(n,e,t[fP]());if(typeof t.next=="function")return lP(n,e,t);if(typeof t.reduce=="function")return cP(n,e,t,"reduce");throw new TypeError("reduce: list must be array or iterable")}var oue=function(){function n(e,t){this.xf=t,this.f=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},n}(),uue=Ke(function(e,t){return new oue(e,t)});function Ei(n,e){return Object.prototype.hasOwnProperty.call(e,n)}var dP=Object.prototype.toString,TB=function(){return dP.call(arguments)==="[object Arguments]"?function(e){return dP.call(e)==="[object Arguments]"}:function(e){return Ei("callee",e)}}(),lue=!{toString:null}.propertyIsEnumerable("toString"),pP=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],hP=function(){return arguments.propertyIsEnumerable("length")}(),cue=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},fue=Qt(typeof Object.keys=="function"&&!hP?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var t,r,i=[],o=hP&&TB(e);for(t in e)Ei(t,e)&&(!o||t!=="length")&&(i[i.length]=t);if(lue)for(r=pP.length-1;r>=0;)t=pP[r],Ei(t,e)&&!cue(i,t)&&(i[i.length]=t),r-=1;return i});const go=fue;var Yo=Ke(Ba(["fantasy-land/map","map"],uue,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return si(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return ws(function(r,i){return r[i]=e(t[i]),r},{},go(t));default:return Vy(e,t)}}));const mh=Number.isInteger||function(e){return e<<0===e};var _m=Ke(function(e,t){var r=e<0?t.length+e:e;return nm(t)?t.charAt(r):t[r]}),due=Ke(function(e,t){return e.map(function(r){for(var i=t,o=0,u;o<r.length;){if(i==null)return;u=r[o],i=mh(u)?_m(u,i):i[u],o+=1}return i})});const RB=due;var pue=Ke(function(e,t){return RB([e],t)[0]});const Rh=pue;var hue=Ke(function(e,t){return Rh([e],t)});const X4=hue;var yue=Ke(function(e,t){return Yo(X4(e),t)});const Zb=yue;var Jl=_n(ws),mue=Qt(function(e){return si(Jl(xm,0,Zb("length",e)),function(){for(var t=0,r=e.length;t<r;){if(!e[t].apply(this,arguments))return!1;t+=1}return!0})});const gue=mue;var vue=Qt(function(e){return function(){return e}});const Q2=vue;var bue=Ke(function(e,t){return e&&t});const OB=bue;var wue=function(){function n(e,t){this.xf=t,this.f=e,this.any=!1}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.any||(e=this.xf["@@transducer/step"](e,!1)),this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.any=!0,e=$d(this.xf["@@transducer/step"](e,!0))),e},n}(),xue=Ke(function(e,t){return new wue(e,t)}),_ue=Ke(Ba(["any"],xue,function(e,t){for(var r=0;r<t.length;){if(e(t[r]))return!0;r+=1}return!1}));const Sue=_ue;var Cue=Qt(function(e){return si(Jl(xm,0,Zb("length",e)),function(){for(var t=0,r=e.length;t<r;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})});const Eue=Cue;var Aue=Ke(function(e,t){return typeof t["fantasy-land/ap"]=="function"?t["fantasy-land/ap"](e):typeof e.ap=="function"?e.ap(t):typeof e=="function"?function(r){return e(r)(t(r))}:ws(function(r,i){return Fu(r,Yo(i,t))},[],e)});const ek=Aue;function kue(n,e){for(var t=0,r=e.length-(n-1),i=new Array(r>=0?r:0);t<r;)i[t]=Array.prototype.slice.call(e,t,t+n),t+=1;return i}var Mue=function(){function n(e,t){this.xf=t,this.pos=0,this.full=!1,this.acc=new Array(e)}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.acc=null,this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.store(t),this.full?this.xf["@@transducer/step"](e,this.getCopy()):e},n.prototype.store=function(e){this.acc[this.pos]=e,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},n.prototype.getCopy=function(){return Fu(Array.prototype.slice.call(this.acc,this.pos),Array.prototype.slice.call(this.acc,0,this.pos))},n}(),Tue=Ke(function(e,t){return new Mue(e,t)}),Rue=Ke(Ba([],Tue,kue));const Oue=Rue;var Lue=Ke(function(e,t){return Fu(t,[e])});const Nue=Lue;var Pue=Ke(function(e,t){return e.apply(this,t)});const LB=Pue;var Iue=Qt(function(e){for(var t=go(e),r=t.length,i=[],o=0;o<r;)i[o]=e[t[o]],o+=1;return i});const NB=Iue;function yP(n,e){return go(e).reduce(function(t,r){return t[r]=n(e[r]),t},{})}var Due=Qt(function n(e){return e=yP(function(t){return typeof t=="function"?t:n(t)},e),si(Jl(xm,0,Zb("length",NB(e))),function(){var t=arguments;return yP(function(r){return LB(r,t)},e)})});const Uue=Due;var Fue=Ke(function(e,t){return t(e)});const Bue=Fue;var zue=_n(function(e,t,r){var i=e(t),o=e(r);return i<o?-1:i>o?1:0});const jue=zue;var $ue=_n(function(e,t,r){var i={};for(var o in r)i[o]=r[o];return i[e]=t,i});const Z2=$ue;var Hue=Qt(function(e){return e==null});const n2=Hue;var que=_n(function n(e,t,r){if(e.length===0)return t;var i=e[0];if(e.length>1){var o=!n2(r)&&Ei(i,r)?r[i]:mh(e[1])?[]:{};t=n(Array.prototype.slice.call(e,1),t,o)}if(mh(i)&&Du(r)){var u=[].concat(r);return u[i]=t,u}else return Z2(i,t,r)});const PB=que;var Vue=Ke(function(e,t){switch(e){case 0:return function(){return t.call(this)};case 1:return function(r){return t.call(this,r)};case 2:return function(r,i){return t.call(this,r,i)};case 3:return function(r,i,o){return t.call(this,r,i,o)};case 4:return function(r,i,o,u){return t.call(this,r,i,o,u)};case 5:return function(r,i,o,u,c){return t.call(this,r,i,o,u,c)};case 6:return function(r,i,o,u,c,p){return t.call(this,r,i,o,u,c,p)};case 7:return function(r,i,o,u,c,p,h){return t.call(this,r,i,o,u,c,p,h)};case 8:return function(r,i,o,u,c,p,h,m){return t.call(this,r,i,o,u,c,p,h,m)};case 9:return function(r,i,o,u,c,p,h,m,w){return t.call(this,r,i,o,u,c,p,h,m,w)};case 10:return function(r,i,o,u,c,p,h,m,w,b){return t.call(this,r,i,o,u,c,p,h,m,w,b)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}});const X2=Vue;var Gue=Qt(function(e){return X2(2,e)});const Wue=Gue;function rm(n){var e=Object.prototype.toString.call(n);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"}var Kue=Ke(function(e,t){var r=si(e,t);return si(e,function(){return ws(ek,Yo(r,arguments[0]),Array.prototype.slice.call(arguments,1))})});const IB=Kue;var e3=Qt(function(e){return IB(e.length,e)}),Yue=Ke(function(e,t){return rm(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e3(OB)(e,t)});const Jue=Yue;var tk=Qt(function(e){return si(e.length,e)}),Que=tk(function(e){return e.apply(this,Array.prototype.slice.call(arguments,1))});const Zue=Que;function DB(n){return function e(t){for(var r,i,o,u=[],c=0,p=t.length;c<p;){if(Qb(t[c]))for(r=n?e(t[c]):t[c],o=0,i=r.length;o<i;)u[u.length]=r[o],o+=1;else u[u.length]=t[c];c+=1}return u}}function Xue(n){return{"@@transducer/value":n,"@@transducer/reduced":!0}}var ele=function(n){return{"@@transducer/init":kr.init,"@@transducer/result":function(e){return n["@@transducer/result"](e)},"@@transducer/step":function(e,t){var r=n["@@transducer/step"](e,t);return r["@@transducer/reduced"]?Xue(r):r}}},tle=function(e){var t=ele(e);return{"@@transducer/init":kr.init,"@@transducer/result":function(r){return t["@@transducer/result"](r)},"@@transducer/step":function(r,i){return Qb(i)?ws(t,r,i):ws(t,r,[i])}}},nle=Ke(function(e,t){return Yo(e,tle(t))}),rle=Ke(Ba(["fantasy-land/chain","chain"],nle,function(e,t){return typeof t=="function"?function(r){return e(t(r))(r)}:DB(!1)(Yo(e,t))}));const nk=rle;var ale=_n(function(e,t,r){if(e>t)throw new Error("min must not be greater than max in clamp(min, max, value)");return r<e?e:r>t?t:r});const ile=ale;function UB(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))}var sle=Qt(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});const r2=sle;function t3(n,e,t,r){var i=function(u){for(var c=e.length,p=0;p<c;){if(n===e[p])return t[p];p+=1}e[p+1]=n,t[p+1]=u;for(var h in n)u[h]=r?t3(n[h],e,t,!0):n[h];return u};switch(r2(n)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(n.valueOf());case"RegExp":return UB(n);default:return n}}var ole=Qt(function(e){return e!=null&&typeof e.clone=="function"?e.clone():t3(e,[],[],!0)});const ule=ole;var lle=Qt(function(e){return function(t,r){return e(t,r)?-1:e(r,t)?1:0}});const cle=lle;var fle=Qt(function(e){return!e});const FB=fle;var dle=e3(FB);const ple=dle;function hle(n,e){return function(){return e.call(this,n.apply(this,arguments))}}function Xb(n,e){return function(){var t=arguments.length;if(t===0)return e();var r=arguments[t-1];return Du(r)||typeof r[n]!="function"?e.apply(this,arguments):r[n].apply(r,Array.prototype.slice.call(arguments,0,t-1))}}var Ho=_n(Xb("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)})),n3=Qt(Xb("tail",Ho(1,1/0)));function BB(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Bu(arguments[0].length,Jl(hle,arguments[0],n3(arguments)))}var e1=Qt(function(e){return nm(e)?e.split("").reverse().join(""):Array.prototype.slice.call(e,0).reverse()});function a2(){if(arguments.length===0)throw new Error("compose requires at least one argument");return BB.apply(this,e1(arguments))}function zB(){if(arguments.length===0)throw new Error("composeK requires at least one argument");var n=Array.prototype.slice.call(arguments),e=n.pop();return a2(a2.apply(this,Yo(nk,n)),e)}function yle(n,e){return function(){var t=this;return n.apply(t,arguments).then(function(r){return e.call(t,r)})}}function jB(){if(arguments.length===0)throw new Error("pipeP requires at least one argument");return Bu(arguments[0].length,Jl(yle,arguments[0],n3(arguments)))}function mle(){if(arguments.length===0)throw new Error("composeP requires at least one argument");return jB.apply(this,e1(arguments))}var gle=_m(0);const $B=gle;function t1(n){return n}var vle=Qt(t1);const r3=vle;var ble=Ke(function(e,t){if(t.length<=0)return r3;var r=$B(t),i=n3(t);return Bu(r.length,function(){return ws(function(o,u){return e.call(this,u,o)},r.apply(this,arguments),i)})});const HB=ble;var wle=Ke(function(e,t){return HB.apply(this,[e,e1(t)])});const xle=wle;function mP(n){for(var e=[],t;!(t=n.next()).done;)e.push(t.value);return e}function am(n,e,t){for(var r=0,i=t.length;r<i;){if(n(e,t[r]))return!0;r+=1}return!1}function _le(n){var e=String(n).match(/^function (\w*)/);return e==null?"":e[1]}function Sle(n,e){return n===e?n!==0||1/n===1/e:n!==n&&e!==e}const I_=typeof Object.is=="function"?Object.is:Sle;function gP(n,e,t,r){var i=mP(n),o=mP(e);function u(c,p){return rk(c,p,t.slice(),r.slice())}return!am(function(c,p){return!am(u,p,c)},o,i)}function rk(n,e,t,r){if(I_(n,e))return!0;var i=r2(n);if(i!==r2(e)||n==null||e==null)return!1;if(typeof n["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof n["fantasy-land/equals"]=="function"&&n["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](n);if(typeof n.equals=="function"||typeof e.equals=="function")return typeof n.equals=="function"&&n.equals(e)&&typeof e.equals=="function"&&e.equals(n);switch(i){case"Arguments":case"Array":case"Object":if(typeof n.constructor=="function"&&_le(n.constructor)==="Promise")return n===e;break;case"Boolean":case"Number":case"String":if(!(typeof n==typeof e&&I_(n.valueOf(),e.valueOf())))return!1;break;case"Date":if(!I_(n.valueOf(),e.valueOf()))return!1;break;case"Error":return n.name===e.name&&n.message===e.message;case"RegExp":if(!(n.source===e.source&&n.global===e.global&&n.ignoreCase===e.ignoreCase&&n.multiline===e.multiline&&n.sticky===e.sticky&&n.unicode===e.unicode))return!1;break}for(var o=t.length-1;o>=0;){if(t[o]===n)return r[o]===e;o-=1}switch(i){case"Map":return n.size!==e.size?!1:gP(n.entries(),e.entries(),t.concat([n]),r.concat([e]));case"Set":return n.size!==e.size?!1:gP(n.values(),e.values(),t.concat([n]),r.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var u=go(n);if(u.length!==go(e).length)return!1;var c=t.concat([n]),p=r.concat([e]);for(o=u.length-1;o>=0;){var h=u[o];if(!(Ei(h,e)&&rk(e[h],n[h],c,p)))return!1;o-=1}return!0}var Cle=Ke(function(e,t){return rk(e,t,[],[])});const vo=Cle;function qB(n,e,t){var r,i;if(typeof n.indexOf=="function")switch(typeof e){case"number":if(e===0){for(r=1/e;t<n.length;){if(i=n[t],i===0&&1/i===r)return t;t+=1}return-1}else if(e!==e){for(;t<n.length;){if(i=n[t],typeof i=="number"&&i!==i)return t;t+=1}return-1}return n.indexOf(e,t);case"string":case"boolean":case"function":case"undefined":return n.indexOf(e,t);case"object":if(e===null)return n.indexOf(e,t)}for(;t<n.length;){if(vo(n[t],e))return t;t+=1}return-1}function gh(n,e){return qB(e,n,0)>=0}function P5(n){var e=n.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var jv=function(e){return(e<10?"0":"")+e},Ele=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+jv(e.getUTCMonth()+1)+"-"+jv(e.getUTCDate())+"T"+jv(e.getUTCHours())+":"+jv(e.getUTCMinutes())+":"+jv(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function VB(n){return function(){return!n.apply(this,arguments)}}function ak(n,e){for(var t=0,r=e.length,i=[];t<r;)n(e[t])&&(i[i.length]=e[t]),t+=1;return i}function i2(n){return Object.prototype.toString.call(n)==="[object Object]"}var Ale=function(){function n(e,t){this.xf=t,this.f=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},n}(),kle=Ke(function(e,t){return new Ale(e,t)}),Mle=Ke(Ba(["filter"],kle,function(n,e){return i2(e)?ws(function(t,r){return n(e[r])&&(t[r]=e[r]),t},{},go(e)):ak(n,e)}));const ik=Mle;var Tle=Ke(function(e,t){return ik(VB(e),t)});const a3=Tle;function sk(n,e){var t=function(u){var c=e.concat([n]);return gh(u,c)?"<Circular>":sk(u,c)},r=function(o,u){return Vy(function(c){return P5(c)+": "+t(o[c])},u.slice().sort())};switch(Object.prototype.toString.call(n)){case"[object Arguments]":return"(function() { return arguments; }("+Vy(t,n).join(", ")+"))";case"[object Array]":return"["+Vy(t,n).concat(r(n,a3(function(o){return/^\d+$/.test(o)},go(n)))).join(", ")+"]";case"[object Boolean]":return typeof n=="object"?"new Boolean("+t(n.valueOf())+")":n.toString();case"[object Date]":return"new Date("+(isNaN(n.valueOf())?t(NaN):P5(Ele(n)))+")";case"[object Null]":return"null";case"[object Number]":return typeof n=="object"?"new Number("+t(n.valueOf())+")":1/n===-1/0?"-0":n.toString(10);case"[object String]":return typeof n=="object"?"new String("+t(n.valueOf())+")":P5(n);case"[object Undefined]":return"undefined";default:if(typeof n.toString=="function"){var i=n.toString();if(i!=="[object Object]")return i}return"{"+r(n,go(n)).join(", ")+"}"}}var Rle=Qt(function(e){return sk(e,[])});const Gy=Rle;var Ole=Ke(function(e,t){if(Du(e)){if(Du(t))return e.concat(t);throw new TypeError(Gy(t)+" is not an array")}if(nm(e)){if(nm(t))return e+t;throw new TypeError(Gy(t)+" is not a string")}if(e!=null&&rm(e["fantasy-land/concat"]))return e["fantasy-land/concat"](t);if(e!=null&&rm(e.concat))return e.concat(t);throw new TypeError(Gy(e)+' does not have a method named "concat" or "fantasy-land/concat"')});const ok=Ole;var Lle=Qt(function(e){var t=Jl(xm,0,Yo(function(r){return r[0].length},e));return Bu(t,function(){for(var r=0;r<e.length;){if(e[r][0].apply(this,arguments))return e[r][1].apply(this,arguments);r+=1}})});const Nle=Lle;var Ple=Ke(function(e,t){if(e>10)throw new Error("Constructor with greater than ten arguments");return e===0?function(){return new t}:tk(X2(e,function(r,i,o,u,c,p,h,m,w,b){switch(arguments.length){case 1:return new t(r);case 2:return new t(r,i);case 3:return new t(r,i,o);case 4:return new t(r,i,o,u);case 5:return new t(r,i,o,u,c);case 6:return new t(r,i,o,u,c,p);case 7:return new t(r,i,o,u,c,p,h);case 8:return new t(r,i,o,u,c,p,h,m);case 9:return new t(r,i,o,u,c,p,h,m,w);case 10:return new t(r,i,o,u,c,p,h,m,w,b)}}))});const GB=Ple;var Ile=Qt(function(e){return GB(e.length,e)});const Dle=Ile;var Ule=Ke(gh);const Fle=Ule;var Ble=Ke(function(e,t){return si(Jl(xm,0,Zb("length",t)),function(){var r=arguments,i=this;return e.apply(i,Vy(function(o){return o.apply(i,r)},t))})});const WB=Ble;var zle=function(){function n(e,t,r,i){this.valueFn=e,this.valueAcc=t,this.keyFn=r,this.xf=i,this.inputs={}}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){var t;for(t in this.inputs)if(Ei(t,this.inputs)&&(e=this.xf["@@transducer/step"](e,this.inputs[t]),e["@@transducer/reduced"])){e=e["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){var r=this.keyFn(t);return this.inputs[r]=this.inputs[r]||[r,this.valueAcc],this.inputs[r][1]=this.valueFn(this.inputs[r][1],t),e},n}(),jle=Jb(4,[],function(e,t,r,i){return new zle(e,t,r,i)}),i3=Jb(4,[],Ba([],jle,function(e,t,r,i){return ws(function(o,u){var c=r(u);return o[c]=e(Ei(c,o)?o[c]:t3(t,[],[],!1),u),o},{},i)})),$le=i3(function(n,e){return n+1},0);const Hle=$le;var qle=J2(-1);const Vle=qle;var Gle=Ke(function(e,t){return t==null||t!==t?e:t});const KB=Gle;var Wle=_n(function(e,t,r){var i=e(t),o=e(r);return i>o?-1:i<o?1:0});const Kle=Wle;var YB=function(){function n(){this._nativeSet=typeof Set=="function"?new Set:null,this._items={}}return n.prototype.add=function(e){return!vP(e,!0,this)},n.prototype.has=function(e){return vP(e,!1,this)},n}();function vP(n,e,t){var r=typeof n,i,o;switch(r){case"string":case"number":return n===0&&1/n===-1/0?t._items["-0"]?!0:(e&&(t._items["-0"]=!0),!1):t._nativeSet!==null?e?(i=t._nativeSet.size,t._nativeSet.add(n),o=t._nativeSet.size,o===i):t._nativeSet.has(n):r in t._items?n in t._items[r]?!0:(e&&(t._items[r][n]=!0),!1):(e&&(t._items[r]={},t._items[r][n]=!0),!1);case"boolean":if(r in t._items){var u=n?1:0;return t._items[r][u]?!0:(e&&(t._items[r][u]=!0),!1)}else return e&&(t._items[r]=n?[!1,!0]:[!0,!1]),!1;case"function":return t._nativeSet!==null?e?(i=t._nativeSet.size,t._nativeSet.add(n),o=t._nativeSet.size,o===i):t._nativeSet.has(n):r in t._items?gh(n,t._items[r])?!0:(e&&t._items[r].push(n),!1):(e&&(t._items[r]=[n]),!1);case"undefined":return t._items[r]?!0:(e&&(t._items[r]=!0),!1);case"object":if(n===null)return t._items.null?!0:(e&&(t._items.null=!0),!1);default:return r=Object.prototype.toString.call(n),r in t._items?gh(n,t._items[r])?!0:(e&&t._items[r].push(n),!1):(e&&(t._items[r]=[n]),!1)}}var Yle=Ke(function(e,t){for(var r=[],i=0,o=e.length,u=t.length,c=new YB,p=0;p<u;p+=1)c.add(t[p]);for(;i<o;)c.add(e[i])&&(r[r.length]=e[i]),i+=1;return r});const D8=Yle;var Jle=_n(function(e,t,r){for(var i=[],o=0,u=t.length;o<u;)!am(e,t[o],r)&&!am(e,t[o],i)&&i.push(t[o]),o+=1;return i});const U8=Jle;var Qle=Ke(function(e,t){var r={};for(var i in t)r[i]=t[i];return delete r[e],r});const JB=Qle;var Zle=_n(function(e,t,r){var i=Array.prototype.slice.call(r,0);return i.splice(e,t),i});const QB=Zle;var Xle=_n(function(e,t,r){return EB(e,Q2(t),r)});const uk=Xle;var ece=Ke(function n(e,t){switch(e.length){case 0:return t;case 1:return mh(e[0])&&Du(t)?QB(e[0],1,t):JB(e[0],t);default:var r=e[0],i=Array.prototype.slice.call(e,1);return t[r]==null?t:mh(r)&&Du(t)?uk(r,n(i,t[r]),t):Z2(r,n(i,t[r]),t)}});const tce=ece;var nce=Ke(function(e,t){return e/t});const rce=nce;var ace=function(){function n(e,t){this.xf=t,this.n=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){return this.n>0?(this.n-=1,e):this.xf["@@transducer/step"](e,t)},n}(),ice=Ke(function(e,t){return new ace(e,t)}),sce=Ke(Ba(["drop"],ice,function(e,t){return Ho(Math.max(0,e),1/0,t)}));const ZB=sce;var oce=function(){function n(e,t){this.xf=t,this.n=e,this.i=0}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){this.i+=1;var r=this.n===0?e:this.xf["@@transducer/step"](e,t);return this.n>=0&&this.i>=this.n?$d(r):r},n}(),uce=Ke(function(e,t){return new oce(e,t)}),lce=Ke(Ba(["take"],uce,function(e,t){return Ho(0,e<0?1/0:e,t)}));const lk=lce;function cce(n,e){return lk(n<e.length?e.length-n:0,e)}var fce=function(){function n(e,t){this.xf=t,this.pos=0,this.full=!1,this.acc=new Array(e)}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.acc=null,this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.full&&(e=this.xf["@@transducer/step"](e,this.acc[this.pos])),this.store(t),e},n.prototype.store=function(e){this.acc[this.pos]=e,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},n}(),dce=Ke(function(e,t){return new fce(e,t)}),pce=Ke(Ba([],dce,cce));const hce=pce;function yce(n,e){for(var t=e.length-1;t>=0&&n(e[t]);)t-=1;return Ho(0,t+1,e)}var mce=function(){function n(e,t){this.f=e,this.retained=[],this.xf=t}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.retained=null,this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.retain(e,t):this.flush(e,t)},n.prototype.flush=function(e,t){return e=ws(this.xf["@@transducer/step"],e,this.retained),this.retained=[],this.xf["@@transducer/step"](e,t)},n.prototype.retain=function(e,t){return this.retained.push(t),e},n}(),gce=Ke(function(e,t){return new mce(e,t)}),vce=Ke(Ba([],gce,yce));const bce=vce;var wce=function(){function n(e,t){this.xf=t,this.pred=e,this.lastValue=void 0,this.seenFirstValue=!1}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){var r=!1;return this.seenFirstValue?this.pred(this.lastValue,t)&&(r=!0):this.seenFirstValue=!0,this.lastValue=t,r?e:this.xf["@@transducer/step"](e,t)},n}(),XB=Ke(function(e,t){return new wce(e,t)}),xce=_m(-1);const ez=xce;var _ce=Ke(Ba([],XB,function(e,t){var r=[],i=1,o=t.length;if(o!==0)for(r[0]=t[0];i<o;)e(ez(r),t[i])||(r[r.length]=t[i]),i+=1;return r}));const tz=_ce;var Sce=Qt(Ba([],XB(vo),tz(vo)));const Cce=Sce;var Ece=function(){function n(e,t){this.xf=t,this.f=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},n}(),Ace=Ke(function(e,t){return new Ece(e,t)}),kce=Ke(Ba(["dropWhile"],Ace,function(e,t){for(var r=0,i=t.length;r<i&&e(t[r]);)r+=1;return Ho(r,1/0,t)}));const Mce=kce;var Tce=Ke(function(e,t){return e||t});const nz=Tce;var Rce=Ke(function(e,t){return rm(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:e3(nz)(e,t)});const Oce=Rce;var Lce=Qt(function(e){return e!=null&&typeof e["fantasy-land/empty"]=="function"?e["fantasy-land/empty"]():e!=null&&e.constructor!=null&&typeof e.constructor["fantasy-land/empty"]=="function"?e.constructor["fantasy-land/empty"]():e!=null&&typeof e.empty=="function"?e.empty():e!=null&&e.constructor!=null&&typeof e.constructor.empty=="function"?e.constructor.empty():Du(e)?[]:nm(e)?"":i2(e)?{}:TB(e)?function(){return arguments}():void 0});const rz=Lce;var Nce=Ke(function(e,t){return ZB(e>=0?t.length-e:0,t)});const az=Nce;var Pce=Ke(function(n,e){return vo(az(n.length,e),n)});const Ice=Pce;var Dce=_n(function(e,t,r){return vo(e(t),e(r))});const Uce=Dce;var Fce=_n(function(e,t,r){return vo(t[e],r[e])});const Bce=Fce;var zce=Ke(function n(e,t){var r=t instanceof Array?[]:{},i,o,u;for(o in t)i=e[o],u=typeof i,r[o]=u==="function"?i(t[o]):i&&u==="object"?n(i,t[o]):t[o];return r});const jce=zce;var $ce=function(){function n(e,t){this.xf=t,this.f=e,this.found=!1}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.found=!0,e=$d(this.xf["@@transducer/step"](e,t))),e},n}(),Hce=Ke(function(e,t){return new $ce(e,t)}),qce=Ke(Ba(["find"],Hce,function(e,t){for(var r=0,i=t.length;r<i;){if(e(t[r]))return t[r];r+=1}}));const Vce=qce;var Gce=function(){function n(e,t){this.xf=t,this.f=e,this.idx=-1,this.found=!1}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,-1)),this.xf["@@transducer/result"](e)},n.prototype["@@transducer/step"]=function(e,t){return this.idx+=1,this.f(t)&&(this.found=!0,e=$d(this.xf["@@transducer/step"](e,this.idx))),e},n}(),Wce=Ke(function(e,t){return new Gce(e,t)}),Kce=Ke(Ba([],Wce,function(e,t){for(var r=0,i=t.length;r<i;){if(e(t[r]))return r;r+=1}return-1}));const Yce=Kce;var Jce=function(){function n(e,t){this.xf=t,this.f=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](e,this.last))},n.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.last=t),e},n}(),Qce=Ke(function(e,t){return new Jce(e,t)}),Zce=Ke(Ba([],Qce,function(e,t){for(var r=t.length-1;r>=0;){if(e(t[r]))return t[r];r-=1}}));const Xce=Zce;var efe=function(){function n(e,t){this.xf=t,this.f=e,this.idx=-1,this.lastIdx=-1}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=function(e){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](e,this.lastIdx))},n.prototype["@@transducer/step"]=function(e,t){return this.idx+=1,this.f(t)&&(this.lastIdx=this.idx),e},n}(),tfe=Ke(function(e,t){return new efe(e,t)}),nfe=Ke(Ba([],tfe,function(e,t){for(var r=t.length-1;r>=0;){if(e(t[r]))return r;r-=1}return-1}));const rfe=nfe;var afe=Qt(DB(!0));const ife=afe;var sfe=Qt(function(e){return si(e.length,function(t,r){var i=Array.prototype.slice.call(arguments,0);return i[0]=r,i[1]=t,e.apply(this,i)})});const s3=sfe;var ofe=Ke(Xb("forEach",function(e,t){for(var r=t.length,i=0;i<r;)e(t[i]),i+=1;return t}));const ufe=ofe;var lfe=Ke(function(e,t){for(var r=go(t),i=0;i<r.length;){var o=r[i];e(t[o],o,t),i+=1}return t});const cfe=lfe;var ffe=Qt(function(e){for(var t={},r=0;r<e.length;)t[e[r][0]]=e[r][1],r+=1;return t});const dfe=ffe;var pfe=Ke(Xb("groupBy",i3(function(n,e){return n==null&&(n=[]),n.push(e),n},null)));const hfe=pfe;var yfe=Ke(function(n,e){for(var t=[],r=0,i=e.length;r<i;){for(var o=r+1;o<i&&n(e[o-1],e[o]);)o+=1;t.push(e.slice(r,o)),r=o}return t});const mfe=yfe;var gfe=Ke(function(e,t){return e>t});const vfe=gfe;var bfe=Ke(function(e,t){return e>=t});const wfe=bfe;var xfe=Ke(function(e,t){if(e.length===0||n2(t))return!1;for(var r=t,i=0;i<e.length;)if(!n2(r)&&Ei(e[i],r))r=r[e[i]],i+=1;else return!1;return!0});const iz=xfe;var _fe=Ke(function(e,t){return iz([e],t)});const Sfe=_fe;var Cfe=Ke(function(e,t){return e in t});const Efe=Cfe;var Afe=Ke(I_);const kfe=Afe;var Mfe=_n(function(e,t,r){return si(Math.max(e.length,t.length,r.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)})});const Tfe=Mfe;var Rfe=J2(1);const Ofe=Rfe;var Lfe=Ke(gh);const Nfe=Lfe;var Pfe=i3(function(n,e){return e},null);const Ife=Pfe;var Dfe=Ke(function(e,t){return typeof t.indexOf=="function"&&!Du(t)?t.indexOf(e):qB(t,e,0)});const Ufe=Dfe;var Ffe=Ho(0,-1);const Bfe=Ffe;var zfe=_n(function(e,t,r){return ak(function(i){return am(e,i,r)},t)});const jfe=zfe;var $fe=_n(function(e,t,r){e=e<r.length&&e>=0?e:r.length;var i=Array.prototype.slice.call(r,0);return i.splice(e,0,t),i});const Hfe=$fe;var qfe=_n(function(e,t,r){return e=e<r.length&&e>=0?e:r.length,[].concat(Array.prototype.slice.call(r,0,e),t,Array.prototype.slice.call(r,e))});const Vfe=qfe;var sz=Ke(function(e,t){for(var r=new YB,i=[],o=0,u,c;o<t.length;)c=t[o],u=e(c),r.add(u)&&i.push(c),o+=1;return i}),Gfe=sz(r3);const ck=Gfe;var Wfe=Ke(function(e,t){var r,i;return e.length>t.length?(r=e,i=t):(r=t,i=e),ck(ak(s3(gh)(r),i))});const Kfe=Wfe;var Yfe=Ke(Xb("intersperse",function(e,t){for(var r=[],i=0,o=t.length;i<o;)i===o-1?r.push(t[i]):r.push(t[i],e),i+=1;return r}));const Jfe=Yfe;function Qfe(n){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(n),t=1,r=arguments.length;t<r;){var i=arguments[t];if(i!=null)for(var o in i)Ei(o,i)&&(e[o]=i[o]);t+=1}return e}const n1=typeof Object.assign=="function"?Object.assign:Qfe;var Zfe=Ke(function(e,t){var r={};return r[e]=t,r});const oz=Zfe;var Xfe={"@@transducer/init":Array,"@@transducer/step":function(n,e){return n.push(e),n},"@@transducer/result":t1},ede={"@@transducer/init":String,"@@transducer/step":function(n,e){return n+e},"@@transducer/result":t1},tde={"@@transducer/init":Object,"@@transducer/step":function(n,e){return n1(n,Qb(e)?oz(e[0],e[1]):e)},"@@transducer/result":t1};function nde(n){if(Z4(n))return n;if(Qb(n))return Xfe;if(typeof n=="string")return ede;if(typeof n=="object")return tde;throw new Error("Cannot create transformer for "+n)}var rde=_n(function(e,t,r){return Z4(e)?ws(t(e),e["@@transducer/init"](),r):ws(t(nde(e)),t3(e,[],[],!1),r)});const ade=rde;var ide=Qt(function(e){for(var t=go(e),r=t.length,i=0,o={};i<r;){var u=t[i],c=e[u],p=Ei(c,o)?o[c]:o[c]=[];p[p.length]=u,i+=1}return o});const sde=ide;var ode=Qt(function(e){for(var t=go(e),r=t.length,i=0,o={};i<r;){var u=t[i];o[e[u]]=u,i+=1}return o});const ude=ode;var lde=Ke(function(e,t){return si(e+1,function(){var r=arguments[e];if(r!=null&&rm(r[t]))return r[t].apply(r,Array.prototype.slice.call(arguments,0,e));throw new TypeError(Gy(r)+' does not have a method named "'+t+'"')})});const r1=lde;var cde=Ke(function(e,t){return t!=null&&t.constructor===e||t instanceof e});const uz=cde;var fde=Qt(function(e){return e!=null&&vo(e,rz(e))});const dde=fde;var pde=r1(1,"join");const hde=pde;var yde=Qt(function(e){return WB(function(){return Array.prototype.slice.call(arguments,0)},e)});const lz=yde;var mde=Qt(function(e){var t,r=[];for(t in e)r[r.length]=t;return r});const gde=mde;var vde=Ke(function(e,t){if(typeof t.lastIndexOf=="function"&&!Du(t))return t.lastIndexOf(e);for(var r=t.length-1;r>=0;){if(vo(t[r],e))return r;r-=1}return-1});const bde=vde;function F8(n){return Object.prototype.toString.call(n)==="[object Number]"}var wde=Qt(function(e){return e!=null&&F8(e.length)?e.length:NaN});const cz=wde;var xde=Ke(function(e,t){return function(r){return function(i){return Yo(function(o){return t(o,i)},r(e(i)))}}});const o3=xde;var _de=Qt(function(e){return o3(_m(e),uk(e))});const Sde=_de;var Cde=Qt(function(e){return o3(Rh(e),PB(e))});const Ede=Cde;var Ade=Qt(function(e){return o3(X4(e),Z2(e))});const kde=Ade;var Mde=Ke(function(e,t){return e<t});const Tde=Mde;var Rde=Ke(function(e,t){return e<=t});const Ode=Rde;var Lde=_n(function(e,t,r){for(var i=0,o=r.length,u=[],c=[t];i<o;)c=e(c[0],r[i]),u[i]=c[1],i+=1;return[c[0],u]});const Nde=Lde;var Pde=_n(function(e,t,r){for(var i=r.length-1,o=[],u=[t];i>=0;)u=e(u[0],r[i]),o[i]=u[1],i-=1;return[u[0],o]});const Ide=Pde;var Dde=Ke(function(e,t){return ws(function(r,i){return r[i]=e(t[i],i,t),r},{},go(t))});const Ude=Dde;var Fde=Ke(function(e,t){return t.match(e)||[]});const Bde=Fde;var zde=Ke(function(e,t){return mh(e)?!mh(t)||t<1?NaN:(e%t+t)%t:NaN});const jde=zde;var $de=_n(function(e,t,r){return e(r)>e(t)?r:t});const Hde=$de;var qde=Jl(J2,0);const fz=qde;var Vde=Qt(function(e){return fz(e)/e.length});const dz=Vde;var Gde=Qt(function(e){var t=e.length;if(t===0)return NaN;var r=2-t%2,i=(t-r)/2;return dz(Array.prototype.slice.call(e,0).sort(function(o,u){return o<u?-1:o>u?1:0}).slice(i,i+r))});const Wde=Gde;var Kde=Ke(function(e,t){var r={};return Bu(t.length,function(){var i=e.apply(this,arguments);return Ei(i,r)||(r[i]=t.apply(this,arguments)),r[i]})});const Yde=Kde;var Jde=Ke(function(e,t){return n1({},e,t)});const Qde=Jde;var Zde=Qt(function(e){return n1.apply(null,[{}].concat(e))});const Xde=Zde;var epe=_n(function(e,t,r){var i={},o;for(o in t)Ei(o,t)&&(i[o]=Ei(o,r)?e(o,t[o],r[o]):t[o]);for(o in r)Ei(o,r)&&!Ei(o,i)&&(i[o]=r[o]);return i});const fk=epe;var tpe=_n(function n(e,t,r){return fk(function(i,o,u){return i2(o)&&i2(u)?n(e,o,u):e(i,o,u)},t,r)});const u3=tpe;var npe=Ke(function(e,t){return u3(function(r,i,o){return i},e,t)});const rpe=npe;var ape=Ke(function(e,t){return u3(function(r,i,o){return o},e,t)});const ipe=ape;var spe=_n(function(e,t,r){return u3(function(i,o,u){return e(o,u)},t,r)});const ope=spe;var upe=Ke(function(e,t){return n1({},t,e)});const lpe=upe;var cpe=Ke(function(e,t){return n1({},e,t)});const fpe=cpe;var dpe=_n(function(e,t,r){return fk(function(i,o,u){return e(o,u)},t,r)});const ppe=dpe;var hpe=Ke(function(e,t){return t<e?t:e});const ype=hpe;var mpe=_n(function(e,t,r){return e(r)<e(t)?r:t});const gpe=mpe;var vpe=Ke(function(e,t){return e%t});const bpe=vpe;var wpe=_n(function(n,e,t){var r=t.length,i=t.slice(),o=n<0?r+n:n,u=e<0?r+e:e,c=i.splice(o,1);return o<0||o>=t.length||u<0||u>=t.length?t:[].concat(i.slice(0,u)).concat(c).concat(i.slice(u,t.length))});const xpe=wpe;var _pe=Ke(function(e,t){return e*t});const pz=_pe;var Spe=Qt(function(e){return-e});const Cpe=Spe;var Epe=Ke(function(e,t){return AB(VB(e),t)});const Ape=Epe;var kpe=Qt(function(e){var t=e<0?1:e+1;return si(t,function(){return _m(e,arguments)})});const Mpe=kpe;var Tpe=_n(function(e,t,r){return e(t(r))});const Rpe=Tpe;function Ope(n){return[n]}var Lpe=Qt(Ope);const Npe=Lpe;var Ppe=Ke(function(e,t){for(var r={},i={},o=0,u=e.length;o<u;)i[e[o]]=1,o+=1;for(var c in t)i.hasOwnProperty(c)||(r[c]=t[c]);return r});const Ipe=Ppe;var Dpe=Qt(function(e){var t=!1,r;return Bu(e.length,function(){return t||(t=!0,r=e.apply(this,arguments)),r})});const Upe=Dpe;function hz(n,e){if(e==null||!rm(e.then))throw new TypeError("`"+n+"` expected a Promise, received "+sk(e,[]))}var Fpe=Ke(function(e,t){return hz("otherwise",t),t.then(null,e)});const Bpe=Fpe;var yz=function(n){return{value:n,map:function(e){return yz(e(n))}}},zpe=_n(function(e,t,r){return e(function(i){return yz(t(i))})(r).value});const mz=zpe;var jpe=Ke(function(e,t){return[e,t]});const $pe=jpe;function gz(n){return Ke(function(e,t){return Bu(Math.max(0,e.length-t.length),function(){return e.apply(this,n(t,arguments))})})}var Hpe=gz(Fu);const qpe=Hpe;var Vpe=gz(s3(Fu));const Gpe=Vpe;var Wpe=lz([ik,a3]);const Kpe=Wpe;var Ype=_n(function(e,t,r){return vo(Rh(e,r),t)});const Jpe=Ype;var Qpe=_n(function(e,t,r){return KB(e,Rh(t,r))});const vz=Qpe;var Zpe=_n(function(e,t,r){return e(Rh(t,r))});const Xpe=Zpe;var ehe=Ke(function(e,t){for(var r={},i=0;i<e.length;)e[i]in t&&(r[e[i]]=t[e[i]]),i+=1;return r});const the=ehe;var nhe=Ke(function(e,t){for(var r={},i=0,o=e.length;i<o;){var u=e[i];r[u]=t[u],i+=1}return r});const bz=nhe;var rhe=Ke(function(e,t){var r={};for(var i in t)e(t[i],i,t)&&(r[i]=t[i]);return r});const ahe=rhe;function ihe(){if(arguments.length===0)throw new Error("pipeK requires at least one argument");return zB.apply(this,e1(arguments))}var she=Ke(function(e,t){return Fu([e],t)});const wz=she;var ohe=Jl(pz,1);const uhe=ohe;var xz=Ke(function(e,t){return si(t.length,function(){for(var r=[],i=0;i<t.length;)r.push(t[i].call(this,arguments[i])),i+=1;return e.apply(this,r.concat(Array.prototype.slice.call(arguments,t.length)))})}),lhe=xz(Vy,[bz,r3]);const che=lhe;var fhe=_n(function(e,t,r){return vo(t,r[e])});const dhe=fhe;var phe=_n(function(e,t,r){return uz(e,r[t])});const hhe=phe;var yhe=_n(function(e,t,r){return vz(e,[t],r)});const mhe=yhe;var ghe=_n(function(e,t,r){return e(r[t])});const vhe=ghe;var bhe=Ke(function(e,t){return e.map(function(r){return Rh([r],t)})});const whe=bhe;var xhe=Ke(function(e,t){if(!(F8(e)&&F8(t)))throw new TypeError("Both arguments to range must be numbers");for(var r=[],i=e;i<t;)r.push(i),i+=1;return r});const _he=xhe;var She=_n(function(e,t,r){for(var i=r.length-1;i>=0;)t=e(r[i],t),i-=1;return t});const _z=She;var Che=Jb(4,[],function(e,t,r,i){return ws(function(o,u){return e(o,u)?t(o,u):$d(o)},r,i)});const Ehe=Che;var Ahe=Qt($d);const khe=Ahe;var Mhe=Ke(function(e,t){var r=Number(t),i=0,o;if(r<0||isNaN(r))throw new RangeError("n must be a non-negative number");for(o=new Array(r);i<r;)o[i]=e(i),i+=1;return o});const Sz=Mhe;var The=Ke(function(e,t){return Sz(Q2(e),t)});const Rhe=The;var Ohe=_n(function(e,t,r){return r.replace(e,t)});const Lhe=Ohe;var Nhe=_n(function(e,t,r){for(var i=0,o=r.length,u=[t];i<o;)t=e(t,r[i]),u[i+1]=t,i+=1;return u});const Phe=Nhe;var Ihe=Ke(function(e,t){return typeof t.sequence=="function"?t.sequence(e):_z(function(r,i){return ek(Yo(wz,r),i)},e([]),t)});const Cz=Ihe;var Dhe=_n(function(e,t,r){return mz(e,Q2(t),r)});const Uhe=Dhe;var Fhe=Ke(function(e,t){return Array.prototype.slice.call(t,0).sort(e)});const Bhe=Fhe;var zhe=Ke(function(e,t){return Array.prototype.slice.call(t,0).sort(function(r,i){var o=e(r),u=e(i);return o<u?-1:o>u?1:0})});const jhe=zhe;var $he=Ke(function(e,t){return Array.prototype.slice.call(t,0).sort(function(r,i){for(var o=0,u=0;o===0&&u<e.length;)o=e[u](r,i),u+=1;return o})});const Hhe=$he;var qhe=r1(1,"split");const Vhe=qhe;var Ghe=Ke(function(e,t){return[Ho(0,e,t),Ho(e,cz(t),t)]});const Whe=Ghe;var Khe=Ke(function(e,t){if(e<=0)throw new Error("First argument to splitEvery must be a positive integer");for(var r=[],i=0;i<t.length;)r.push(Ho(i,i+=e,t));return r});const Yhe=Khe;var Jhe=Ke(function(e,t){for(var r=0,i=t.length,o=[];r<i&&!e(t[r]);)o.push(t[r]),r+=1;return[o,Array.prototype.slice.call(t,r)]});const Qhe=Jhe;var Zhe=Ke(function(n,e){return vo(lk(n.length,e),n)});const Xhe=Zhe;var e0e=Ke(function(e,t){return Number(e)-Number(t)});const t0e=e0e;var n0e=Ke(function(e,t){return ok(D8(e,t),D8(t,e))});const r0e=n0e;var a0e=_n(function(e,t,r){return ok(U8(e,t,r),U8(e,r,t))});const i0e=a0e;var s0e=Ke(function(e,t){for(var r=t.length-1;r>=0&&e(t[r]);)r-=1;return Ho(r+1,1/0,t)});const o0e=s0e;var u0e=function(){function n(e,t){this.xf=t,this.f=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):$d(e)},n}(),l0e=Ke(function(e,t){return new u0e(e,t)}),c0e=Ke(Ba(["takeWhile"],l0e,function(e,t){for(var r=0,i=t.length;r<i&&e(t[r]);)r+=1;return Ho(0,r,t)}));const f0e=c0e;var d0e=function(){function n(e,t){this.xf=t,this.f=e}return n.prototype["@@transducer/init"]=kr.init,n.prototype["@@transducer/result"]=kr.result,n.prototype["@@transducer/step"]=function(e,t){return this.f(t),this.xf["@@transducer/step"](e,t)},n}(),p0e=Ke(function(e,t){return new d0e(e,t)}),h0e=Ke(Ba([],p0e,function(e,t){return e(t),t}));const y0e=h0e;function m0e(n){return Object.prototype.toString.call(n)==="[object RegExp]"}var g0e=Ke(function(e,t){if(!m0e(e))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+Gy(e));return UB(e).test(t)});const v0e=g0e;var b0e=Ke(function(e,t){return hz("andThen",t),t.then(e)});const w0e=b0e;var x0e=r1(0,"toLowerCase");const _0e=x0e;var S0e=Qt(function(e){var t=[];for(var r in e)Ei(r,e)&&(t[t.length]=[r,e[r]]);return t});const C0e=S0e;var E0e=Qt(function(e){var t=[];for(var r in e)t[t.length]=[r,e[r]];return t});const A0e=E0e;var k0e=r1(0,"toUpperCase");const M0e=k0e;var T0e=si(4,function(e,t,r,i){return ws(e(typeof t=="function"?kB(t):t),r,i)});const R0e=T0e;var O0e=Qt(function(e){for(var t=0,r=[];t<e.length;){for(var i=e[t],o=0;o<i.length;)typeof r[o]>"u"&&(r[o]=[]),r[o].push(i[o]),o+=1;t+=1}return r});const L0e=O0e;var N0e=_n(function(e,t,r){return typeof r["fantasy-land/traverse"]=="function"?r["fantasy-land/traverse"](t,e):Cz(e,Yo(t,r))});const P0e=N0e;var $v=`
329
329
  \v\f\r                 \u2028\u2029\uFEFF`,I0e="​",D0e=typeof String.prototype.trim=="function",U0e=Qt(!D0e||$v.trim()||!I0e.trim()?function(e){var t=new RegExp("^["+$v+"]["+$v+"]*"),r=new RegExp("["+$v+"]["+$v+"]*$");return e.replace(t,"").replace(r,"")}:function(e){return e.trim()});const F0e=U0e;var B0e=Ke(function(e,t){return Bu(e.length,function(){try{return e.apply(this,arguments)}catch(r){return t.apply(this,Fu([r],arguments))}})});const z0e=B0e;var j0e=Qt(function(e){return function(){return e(Array.prototype.slice.call(arguments,0))}});const $0e=j0e;var H0e=Qt(function(e){return X2(1,e)});const q0e=H0e;var V0e=Ke(function(e,t){return si(e,function(){for(var r=1,i=t,o=0,u;r<=e&&typeof i=="function";)u=r===e?arguments.length:o+i.length,i=i.apply(this,Array.prototype.slice.call(arguments,o,u)),r+=1,o=u;return i})});const G0e=V0e;var W0e=Ke(function(e,t){for(var r=e(t),i=[];r&&r.length;)i[i.length]=r[0],r=e(r[1]);return i});const K0e=W0e;var Y0e=Ke(a2(ck,Fu));const J0e=Y0e;var Q0e=Ke(function(e,t){for(var r=0,i=t.length,o=[],u;r<i;)u=t[r],am(e,u,o)||(o[o.length]=u),r+=1;return o});const Ez=Q0e;var Z0e=_n(function(e,t,r){return Ez(e,Fu(t,r))});const X0e=Z0e;var eye=_n(function(e,t,r){return e(r)?r:t(r)});const tye=eye;var nye=nk(t1);const rye=nye;var aye=_n(function(e,t,r){for(var i=r;!e(i);)i=t(i);return i});const iye=aye;var sye=Qt(function(e){var t,r=[];for(t in e)r[r.length]=e[t];return r});const oye=sye;var uye=function(n){return{value:n,"fantasy-land/map":function(){return this}}},lye=Ke(function(e,t){return e(uye)(t).value});const cye=lye;var fye=_n(function(e,t,r){return e(r)?t(r):r});const dye=fye;var pye=Ke(function(e,t){for(var r in e)if(Ei(r,e)&&!e[r](t[r]))return!1;return!0});const Az=pye;var hye=Ke(function(e,t){return Az(Yo(vo,e),t)});const yye=hye;var mye=Ke(function(n,e){return a3(s3(gh)(n),e)});const gye=mye;var vye=Ke(function(e,t){return!!(!e^!t)});const bye=vye;var wye=Ke(function(e,t){for(var r=0,i=e.length,o,u=t.length,c=[];r<i;){for(o=0;o<u;)c[c.length]=[e[r],t[o]],o+=1;r+=1}return c});const xye=wye;var _ye=Ke(function(e,t){for(var r=[],i=0,o=Math.min(e.length,t.length);i<o;)r[i]=[e[i],t[i]],i+=1;return r});const Sye=_ye;var Cye=Ke(function(e,t){for(var r=0,i=Math.min(e.length,t.length),o={};r<i;)o[e[r]]=t[r],r+=1;return o});const Eye=Cye;var Aye=_n(function(e,t,r){for(var i=[],o=0,u=Math.min(t.length,r.length);o<u;)i[o]=e(t[o],r[o]),o+=1;return i});const kye=Aye;var Mye=Qt(function(e){return si(e.length,function(){var r=arguments;return function(){return e.apply(this,r)}})});const Tye=Mye,Rye=Object.freeze(Object.defineProperty({__proto__:null,F:Voe,T:Woe,__:Koe,add:J2,addIndex:Zoe,adjust:EB,all:AB,allPass:gue,always:Q2,and:OB,andThen:w0e,any:Sue,anyPass:Eue,ap:ek,aperture:Oue,append:Nue,apply:LB,applySpec:Uue,applyTo:Bue,ascend:jue,assoc:Z2,assocPath:PB,binary:Wue,bind:MB,both:Jue,call:Zue,chain:nk,clamp:ile,clone:ule,comparator:cle,complement:ple,compose:a2,composeK:zB,composeP:mle,composeWith:xle,concat:ok,cond:Nle,construct:Dle,constructN:GB,contains:Fle,converge:WB,countBy:Hle,curry:tk,curryN:si,dec:Vle,defaultTo:KB,descend:Kle,difference:D8,differenceWith:U8,dissoc:JB,dissocPath:tce,divide:rce,drop:ZB,dropLast:hce,dropLastWhile:bce,dropRepeats:Cce,dropRepeatsWith:tz,dropWhile:Mce,either:Oce,empty:rz,endsWith:Ice,eqBy:Uce,eqProps:Bce,equals:vo,evolve:jce,filter:ik,find:Vce,findIndex:Yce,findLast:Xce,findLastIndex:rfe,flatten:ife,flip:s3,forEach:ufe,forEachObjIndexed:cfe,fromPairs:dfe,groupBy:hfe,groupWith:mfe,gt:vfe,gte:wfe,has:Sfe,hasIn:Efe,hasPath:iz,head:$B,identical:kfe,identity:r3,ifElse:Tfe,inc:Ofe,includes:Nfe,indexBy:Ife,indexOf:Ufe,init:Bfe,innerJoin:jfe,insert:Hfe,insertAll:Vfe,intersection:Kfe,intersperse:Jfe,into:ade,invert:sde,invertObj:ude,invoker:r1,is:uz,isEmpty:dde,isNil:n2,join:hde,juxt:lz,keys:go,keysIn:gde,last:ez,lastIndexOf:bde,length:cz,lens:o3,lensIndex:Sde,lensPath:Ede,lensProp:kde,lift:e3,liftN:IB,lt:Tde,lte:Ode,map:Yo,mapAccum:Nde,mapAccumRight:Ide,mapObjIndexed:Ude,match:Bde,mathMod:jde,max:xm,maxBy:Hde,mean:dz,median:Wde,memoizeWith:Yde,merge:Qde,mergeAll:Xde,mergeDeepLeft:rpe,mergeDeepRight:ipe,mergeDeepWith:ope,mergeDeepWithKey:u3,mergeLeft:lpe,mergeRight:fpe,mergeWith:ppe,mergeWithKey:fk,min:ype,minBy:gpe,modulo:bpe,move:xpe,multiply:pz,nAry:X2,negate:Cpe,none:Ape,not:FB,nth:_m,nthArg:Mpe,o:Rpe,objOf:oz,of:Npe,omit:Ipe,once:Upe,or:nz,otherwise:Bpe,over:mz,pair:$pe,partial:qpe,partialRight:Gpe,partition:Kpe,path:Rh,pathEq:Jpe,pathOr:vz,pathSatisfies:Xpe,paths:RB,pick:the,pickAll:bz,pickBy:ahe,pipe:BB,pipeK:ihe,pipeP:jB,pipeWith:HB,pluck:Zb,prepend:wz,product:uhe,project:che,prop:X4,propEq:dhe,propIs:hhe,propOr:mhe,propSatisfies:vhe,props:whe,range:_he,reduce:Jl,reduceBy:i3,reduceRight:_z,reduceWhile:Ehe,reduced:khe,reject:a3,remove:QB,repeat:Rhe,replace:Lhe,reverse:e1,scan:Phe,sequence:Cz,set:Uhe,slice:Ho,sort:Bhe,sortBy:jhe,sortWith:Hhe,split:Vhe,splitAt:Whe,splitEvery:Yhe,splitWhen:Qhe,startsWith:Xhe,subtract:t0e,sum:fz,symmetricDifference:r0e,symmetricDifferenceWith:i0e,tail:n3,take:lk,takeLast:az,takeLastWhile:o0e,takeWhile:f0e,tap:y0e,test:v0e,thunkify:Tye,times:Sz,toLower:_0e,toPairs:C0e,toPairsIn:A0e,toString:Gy,toUpper:M0e,transduce:R0e,transpose:L0e,traverse:P0e,trim:F0e,tryCatch:z0e,type:r2,unapply:$0e,unary:q0e,uncurryN:G0e,unfold:K0e,union:J0e,unionWith:X0e,uniq:ck,uniqBy:sz,uniqWith:Ez,unless:tye,unnest:rye,until:iye,update:uk,useWith:xz,values:NB,valuesIn:oye,view:cye,when:dye,where:Az,whereEq:yye,without:gye,xor:bye,xprod:xye,zip:Sye,zipObj:Eye,zipWith:kye},Symbol.toStringTag,{value:"Module"})),Oye=d2(Rye);var bP;function Lye(){if(bP)return yd;bP=1;const n=Oye,e=xs,{ValidateLibrary:t,ValidateVersion:r,ValidateParameters:i}=Wo,o=function(u){if(!u)throw Error("No mezzanine preparation job info found at /abr_mezzanine");const c=Object.keys(u).find(p=>u[p].mez_prep_specs);if(!c)throw Error("Could not determine offering key for last submitted job");return c};return yd.CreateProductionMaster=async function({libraryId:u,type:c,name:p,description:h,metadata:m={},fileInfo:w,encrypt:b=!0,access:g=[],copy:S=!1,callback:A,respLogLevel:T="warn",structLogLevel:R="none"}){t(u);const{id:L,write_token:D}=await this.CreateContentObject({libraryId:u,options:c?{type:c}:{}});if(w)if(g.length>0){const me=/^s3:\/\/([^/]+)\//i;for(let Se=0;Se<w.length;Se++){const Ce=w[Se];let ne=!1;for(let ke=0;!ne&&ke<g.length;ke++){let C=g[ke];const _=C.remote_access.path.replace(/\/$/,""),O=C.path_matchers;for(let z=0;!ne&&z<O.length;z++){const F=new RegExp(O[z]),j=Ce.source;if(F.test(j)){ne=!0;const Q=me.exec(j);if(Q&&Q[1]!==_)throw Error('Full S3 file path "'+j+`" matched to credential set with different bucket name '`+_+"'");C.hasOwnProperty("matched")?C.matched.push(Ce):C.matched=[Ce]}}}if(!ne)throw Error('no credential set found for file path: "'+filePath+'"')}for(let Se=0;Se<g.length;Se++){const Ce=g[Se];if(Ce.hasOwnProperty("matched")&&Ce.matched.length>0){const ne=Ce.remote_access.storage_endpoint.region,ke=Ce.remote_access.path.replace(/\/$/,""),C=Ce.remote_access.cloud_credentials.access_key_id,_=Ce.remote_access.cloud_credentials.secret_access_key;await this.UploadFilesFromS3({libraryId:u,objectId:L,writeToken:D,fileInfo:Ce.matched,region:ne,bucket:ke,accessKey:C,secret:_,copy:S,callback:A,encryption:b?"cgck":"none"})}}}else await this.UploadFiles({libraryId:u,objectId:L,writeToken:D,fileInfo:w,callback:A,encryption:b?"cgck":"none"});await this.CreateEncryptionConk({libraryId:u,objectId:L,writeToken:D,createKMSConk:!0});const{logs:q,errors:W,warnings:de}=await this.CallBitcodeMethod({libraryId:u,objectId:L,writeToken:D,method:e("media","production_master","init"),queryParams:{response_log_level:T,struct_log_level:R},body:{access:g},constant:!1});await this.MergeMetadata({libraryId:u,objectId:L,writeToken:D,metadata:{...m||{},name:p,description:h,reference:g&&!S,public:{...(m||{}).public||{},name:p||"",description:h||""},elv_created_at:new Date().getTime()}});const ce=await this.FinalizeContentObject({libraryId:u,objectId:L,writeToken:D,commitMessage:"Create master",awaitCommitConfirmation:!1});return{errors:W||[],logs:q||[],warnings:de||[],...ce}},yd.CreateABRMezzanine=async function({libraryId:u,objectId:c,type:p,name:h,description:m,metadata:w,masterVersionHash:b,abrProfile:g,addlOfferingSpecs:S,variant:A="default",offeringKey:T="default",keepOtherStreams:R=!1,respLogLevel:L="warn",structLogLevel:D="none",streamKeys:q}){if(t(u),r(b),!b)throw Error("Master version hash not specified");if(!c&&R)throw Error("Existing mezzanine object ID required in order to use 'keepOtherStreams'");if(S&&!g)throw Error("abrProfile required when using addlOfferingSpecs");const W=!!c;let de=p?{type:p}:{},ce,me;if(W){const Q=await this.EditContentObject({libraryId:u,objectId:c,options:de});ce=Q.id,me=Q.write_token}else{const Q=await this.CreateContentObject({libraryId:u,options:de});ce=Q.id,me=Q.write_token}await this.CreateEncryptionConk({libraryId:u,objectId:ce,writeToken:me,createKMSConk:!0});const Se=await this.ContentObjectMetadata({versionHash:b,metadataSubtree:"public/name"});let Ce=[];Ce.push(await this.authClient.AuthorizationToken({libraryId:u,objectId:ce,update:!0})),Ce.push(await this.authClient.AuthorizationToken({libraryId:u})),Ce.push(await this.authClient.AuthorizationToken({versionHash:b}));const ne={Authorization:Ce.map(Q=>`Bearer ${Q}`).join(",")},ke={additional_offering_specs:S,offering_key:T,keep_other_streams:R,prod_master_hash:b,stream_keys:q,variant_key:A};let C=!1;g?(ke.abr_profile=g,C=g.store_clear):C=await this.ContentObjectMetadata({libraryId:u,objectId:this.utils.AddressToObjectId(this.utils.HashToAddress(u)),metadataSubtree:"abr_profile/store_clear"}),C||await this.EncryptionConk({libraryId:u,objectId:ce,writeToken:me});const{logs:_,errors:O,warnings:z}=await this.CallBitcodeMethod({libraryId:u,objectId:ce,writeToken:me,method:e("media","abr_mezzanine","init"),queryParams:{response_log_level:L,struct_log_level:D},headers:ne,body:ke,constant:!1});w||(w={}),w.public||(w.public={}),w.public.asset_metadata||(w.public.asset_metadata={}),w.master={name:Se,id:this.utils.DecodeVersionHash(b).objectId,hash:b,variant:A},w.public={...w.public},w.public.asset_metadata={sources:{[T]:{"/":`./rep/playout/${T}/options.json`}},...w.public.asset_metadata},(h||!W)&&(w.name=h||`${Se} Mezzanine`,w.public.name=h||`${Se} Mezzanine`),(m||!W)&&(w.description=m||"",w.public.description=m||"");const F=await this.ContentObjectMetadata({libraryId:u,objectId:ce,writeToken:me});w=n.mergeDeepRight(F,w),W||(w.elv_created_at=new Date().getTime()),await this.ReplaceMetadata({libraryId:u,objectId:ce,writeToken:me,metadata:w});const j=await this.FinalizeContentObject({libraryId:u,objectId:ce,writeToken:me,commitMessage:"Create ABR mezzanine"});return{logs:_||[],warnings:z||[],errors:O||[],...j}},yd.StartABRMezzanineJobs=async function({libraryId:u,objectId:c,access:p=[],jobIndexes:h=null}){i({libraryId:u,objectId:c});const m=await this.ContentObjectMetadata({libraryId:u,objectId:c,metadataSubtree:e("abr_mezzanine","offerings")}),w=o(m),b=m[w].mez_prep_specs;if(!b)throw Error("No stream preparation specs found");let g=Object.keys(b).map(me=>(b[me].source_streams||[]).map(Se=>Se.source_hash));g=[].concat.apply([],g).filter(me=>me).filter((me,Se,Ce)=>Ce.indexOf(me)===Se);let S=await Promise.all(g.map(async me=>await this.authClient.AuthorizationToken({versionHash:me})));S=[await this.authClient.AuthorizationToken({libraryId:u,objectId:c,update:!0}),...S];const A={Authorization:S.map(me=>`Bearer ${me}`).join(",")},T=await this.EditContentObject({libraryId:u,objectId:c}),R={write_token:T.write_token,node:T.nodeUrl,offering:w},L=await this.EditContentObject({libraryId:u,objectId:c});await this.ReplaceMetadata({libraryId:u,objectId:c,writeToken:L.write_token,metadataSubtree:"lro_draft",metadata:R});const D=await this.FinalizeContentObject({libraryId:u,objectId:c,writeToken:L.write_token,commitMessage:"Mezzanine LRO status"}),{data:q,errors:W,warnings:de,logs:ce}=await this.CallBitcodeMethod({libraryId:u,objectId:c,writeToken:T.write_token,headers:A,method:e("media","abr_mezzanine","prep_start"),constant:!1,body:{access:p,offering_key:w,job_indexes:h}});return{hash:D.hash,lro_draft:R,writeToken:T.write_token,nodeUrl:T.nodeUrl,data:q,logs:ce||[],warnings:de||[],errors:W||[]}},yd.LRODraftInfo=async function({libraryId:u,objectId:c}){const p=await this.ContentObjectMetadata({libraryId:u,objectId:c,metadataSubtree:"lro_draft"});if(p)return p;const h=await this.ContentObjectMetadata({libraryId:u,objectId:c,metadataSubtree:e("abr_mezzanine","offerings")});if(!h)throw Error("No metadata for mezzanine preparation job found at /abr_mezzanine");const m=o(h);if(!m)throw Error("Could not determine offering key for last submitted job");const w=h[m].ready,b=await this.ContentObjectMetadata({libraryId:u,objectId:c,metadataSubtree:`lro_draft_${m}`});if(b)return b;throw Error(w?"No LRO draft found for this mezzanine - looks like last mez prep job was already finalized.":"No LRO draft found for this mezzanine - looks like last mez prep job was either cancelled or discarded.")},yd.LROStatus=async function({libraryId:u,objectId:c}){i({libraryId:u,objectId:c});const p=await this.LRODraftInfo({libraryId:u,objectId:c});return this.RecordWriteToken({writeToken:p.write_token,fabricNodeUrl:p.node}),await this.ContentObjectMetadata({libraryId:u,objectId:c,writeToken:p.write_token,metadataSubtree:"lro_status"})},yd.FinalizeABRMezzanine=async function({libraryId:u,objectId:c,preFinalizeFn:p,preFinalizeThrow:h}){i({libraryId:u,objectId:c});const m=await this.LRODraftInfo({libraryId:u,objectId:c});this.RecordWriteToken({writeToken:m.write_token,fabricNodeUrl:m.node});const w=await this.ContentObjectMetadata({libraryId:u,objectId:c,writeToken:m.write_token,metadataSubtree:e("abr_mezzanine","offerings")}),b=o(w),g=w[b].prod_master_hash,A={Authorization:[await this.authClient.AuthorizationToken({libraryId:u,objectId:c,update:!0}),await this.authClient.AuthorizationToken({versionHash:g})].map(de=>`Bearer ${de}`).join(",")},{data:T,errors:R,warnings:L,logs:D}=await this.CallBitcodeMethod({objectId:c,libraryId:u,writeToken:m.write_token,method:e("media","abr_mezzanine","offerings",b,"finalize"),headers:A,constant:!1});let q=[];if(p){const de={nodeUrl:m.node,offeringKey:b,writeToken:m.write_token};try{await p(de)}catch(ce){if(h)throw new Error("Error running preFinalize function",{cause:ce});q=`Error running preFinalize function: ${ce}`}}const W=await this.FinalizeContentObject({libraryId:u,objectId:c,writeToken:m.write_token,commitMessage:"Finalize ABR mezzanine",awaitCommitConfirmation:!1});return{data:T,logs:D||[],warnings:(L||[]).concat(q),errors:R||[],...W}},yd}var ys={},I5={},wP;function Nye(){if(wP)return I5;wP=1;const n={2160:{bit_rate:14e6,codecs:"avc1.640028,mp4a.40.2",height:2160,media_type:1,representation:"videovideo_3840x2160_h264@14000000",stream_name:"video",width:3840},1080:{bit_rate:95e5,codecs:"avc1.640028,mp4a.40.2",height:1080,media_type:1,representation:"videovideo_1920x1080_h264@9500000",stream_name:"video",stream_index:0,width:1920},720:{bit_rate:45e5,codecs:"avc1.640028,mp4a.40.2",height:720,media_type:1,representation:"videovideo_1280x720_h264@4500000",stream_name:"video",stream_index:0,width:1280},540:{bit_rate:2e6,codecs:"avc1.640028,mp4a.40.2",height:540,media_type:1,representation:"videovideo_960x540_h264@2000000",stream_name:"video",stream_index:0,width:960},"540_low":{bit_rate:9e5,codecs:"avc1.640028,mp4a.40.2",height:540,media_type:1,representation:"videovideo_960x540_h264@900000",stream_name:"video",stream_index:0,width:960}},e={live_recording:{fabric_config:{ingress_node_api:"",ingress_node_id:""},playout_config:{rebroadcast_start_time_sec_epoch:0,vod_enabled:!1},recording_config:{recording_params:{description:"",ladder_specs:[],listen:!0,live_delay_nano:2e9,max_duration_sec:-1,name:"",origin_url:"",part_ttl:3600,playout_type:"live",source_timescale:null,xc_params:{audio_bitrate:384e3,audio_index:[0,0,0,0,0,0,0,0],audio_seg_duration_ts:null,connection_timeout:60,ecodec2:"aac",enc_height:null,enc_width:null,filter_descriptor:"",force_keyint:null,format:"fmp4-segment",listen:!0,n_audio:1,preset:"faster",sample_rate:48e3,seg_duration:null,skip_decoding:!1,start_segment_str:"1",stream_id:-1,sync_audio_to_stream_id:-1,video_bitrate:null,video_seg_duration_ts:null,video_time_base:null,video_frame_duration_ts:null,xc_type:3}}}}},t={bit_rate:384e3,channels:2,codecs:"mp4a.40.2",media_type:2,representation:"audioaudio_aac@384000",stream_name:"audio",stream_index:0};let r=class{constructor(o,u,c,p,h,m){this.probeData=o,this.nodeId=u,this.nodeUrl=c,this.includeAVSegDurations=p,this.overwriteOriginUrl=h,this.syncAudioToVideo=m}probeKind(){return this.probeData.format.filename.split(":")[0]}getStreamDataForCodecType(o){let u=null;for(let c=0;c<this.probeData.streams.length;c++)this.probeData.streams[c].codec_type==o&&(u=this.probeData.streams[c]);return u}getAudioStreamsFromProbe(){let o={};for(let u=0;u<this.probeData.streams.length;u++)this.probeData.streams[u].codec_type=="audio"&&(o[u]={recordingBitrate:Math.max(this.probeData.streams[u].bit_rate,128e3),recordingChannels:this.probeData.streams[u].channels,playoutLabel:`Audio ${u}`});return o}getFrameRate(){let o=this.getStreamDataForCodecType("video");return(o.r_frame_rate||o.frame_rate).split("/")}isFrameRateWhole(){return this.getFrameRate()[1]=="1"}getForceKeyint(){let o=this.getFrameRate(),u=Math.round(o[0]/o[1]);return u>30?u:u*2}calcSegDuration({sourceTimescale:o,sampleRate:u,audioCodec:c}){let p={};switch(this.probeKind()){case"rtmp":p=this.calcSegDurationRtmp({sourceTimescale:o,sampleRate:u,audioCodec:c});break;case"udp":case"srt":p=this.calcSegDurationMpegts({sourceTimescale:o,sampleRate:u,audioCodec:c});break;default:throw"protocol not supported - "+this.probeKind()}return c=="aac"?p.audio=29.76*u:p.audio=29.76*48e3,p}calcOutputTimebase(o){let u=o;for(;u<1e4;)u=u*2;return u}calcSegDurationMpegts({sourceTimescale:o}){let c=this.getStreamDataForCodecType("video").frame_rate,p={};switch(c){case"24":p.video=o*30,p.keyint=48,p.duration="30";break;case"25":p.video=o*30,p.keyint=50,p.duration="30";break;case"30":p.video=o*30,p.keyint=60,p.duration="30";break;case"30000/1001":p.video=o*30,p.keyint=60,p.duration="30.03";break;case"48":p.video=o*30,p.keyint=96,p.duration="30";break;case"50":p.video=o*30,p.keyint=100,p.duration="30";break;case"60":p.video=o*30,p.keyint=120,p.duration="30";break;case"60000/1001":p.videoTimeBase=6e4,p.video=p.videoTimeBase*30.03,p.keyint=120,p.duration="30.03";break;default:throw"unsupported frame rate for MPEGTS - "+c}return p}calcSegDurationRtmp({sourceTimescale:o}){let c=this.getStreamDataForCodecType("video").frame_rate,p={};switch(c){case"24":p.videoTimeBase=768,p.videoFrameDurationTs=512,p.video=this.calcOutputTimebase(p.videoTimeBase)*30,p.keyint=48,p.duration="30";break;case"25":p.video=o*30,p.keyint=50,p.duration="30";break;case"30":p.videoTimeBase=960,p.videoFrameDurationTs=512,p.video=this.calcOutputTimebase(p.videoTimeBase)*30,p.keyint=60,p.duration="30";break;case"30000/1001":p.video=o*30.03,p.keyint=60,p.duration="30.03";break;case"48":p.videoTimeBase=1536,p.videoFrameDurationTs=256,p.video=this.calcOutputTimebase(p.videoTimeBase)*30,p.keyint=96,p.duration="30";break;case"50":p.video=o*30,p.keyint=100,p.duration="30";break;case"60":p.videoTimeBase=960,p.videoFrameDurationTs=256,p.video=this.calcOutputTimebase(p.videoTimeBase)*30,p.keyint=120,p.duration="30";break;case"60000/1001":p.video=o*30.03,p.keyint=120,p.duration="30.03";break;default:throw"unsupported frame rate for RTMP - "+c}return p}syncAudioToStreamIdValue(){let o=-1,u=this.getStreamDataForCodecType("video");switch(this.probeKind()){case"udp":case"srt":o=u.stream_id;break;case"rtmp":o=u.stream_index;break}return o}generateAudioStreamsConfig({customSettings:o}){let u={};if(o&&o.audio)for(let c=0;c<Object.keys(o.audio).length;c++){let p=Object.keys(o.audio)[c],h=o.audio[p];u[p]={recordingBitrate:h.recording_bitrate||192e3,recordingChannels:h.recording_channels||2},h.playout&&(u[p].playoutLabel=h.playout_label||`Audio ${p}`)}return o.audio||(u=this.getAudioStreamsFromProbe()),u}generateLiveConf({customSettings:o}){const u=JSON.parse(JSON.stringify(e)),c=this.overwriteOriginUrl||this.probeData.format.filename,p=this.generateAudioStreamsConfig({customSettings:o}),h=this.getStreamDataForCodecType("audio"),m=parseInt(h.sample_rate),w=h.codec_name,b=this.getStreamDataForCodecType("video");let g;u.live_recording.fabric_config.ingress_node_api=this.nodeUrl||null,u.live_recording.fabric_config.ingress_node_id=this.nodeId||null,u.live_recording.recording_config.recording_params.description,u.live_recording.recording_config.recording_params.origin_url=c,u.live_recording.recording_config.recording_params.description=`Ingest stream ${c}`,u.live_recording.recording_config.recording_params.name=`Ingest stream ${c}`,u.live_recording.recording_config.recording_params.xc_params.sample_rate=m,u.live_recording.recording_config.recording_params.xc_params.enc_height=b.height,u.live_recording.recording_config.recording_params.xc_params.enc_width=b.width;for(let R=0;R<Object.keys(p).length;R++)u.live_recording.recording_config.recording_params.xc_params.audio_index[R]=parseInt(Object.keys(p)[R]);switch(this.syncAudioToVideo&&(u.live_recording.recording_config.recording_params.xc_params.sync_audio_to_stream_id=this.syncAudioToStreamIdValue()),o.edge_write_token&&(u.live_recording.fabric_config.edge_write_token=o.edge_write_token),o.part_ttl&&(u.live_recording.recording_config.recording_params.part_ttl=o.part_ttl),this.probeKind()){case"udp":g=9e4,u.live_recording.recording_config.recording_params.source_timescale=g;break;case"srt":g=9e4,u.live_recording.recording_config.recording_params.source_timescale=g,u.live_recording.recording_config.recording_params.live_delay_nano=4e9;break;case"rtmp":g=16e3,u.live_recording.recording_config.recording_params.source_timescale=g;break;case"hls":console.log("HLS detected. Not yet implemented");break;default:console.log("Unsupported media",this.probeKind());break}const S=this.calcSegDuration({sourceTimescale:g,sampleRate:m,audioCodec:w});switch(u.live_recording.recording_config.recording_params.xc_params.seg_duration=S.duration,u.live_recording.recording_config.recording_params.xc_params.audio_seg_duration_ts=S.audio,u.live_recording.recording_config.recording_params.xc_params.video_seg_duration_ts=S.video,u.live_recording.recording_config.recording_params.xc_params.force_keyint=S.keyint,S.videoTimeBase&&(u.live_recording.recording_config.recording_params.xc_params.video_time_base=S.videoTimeBase,u.live_recording.recording_config.recording_params.source_timescale=this.calcOutputTimebase(S.videoTimeBase)),S.videoFrameDurationTs&&(u.live_recording.recording_config.recording_params.xc_params.video_frame_duration_ts=S.videoFrameDurationTs),b.height){case 2160:u.live_recording.recording_config.recording_params.ladder_specs.unshift(n[2160],n[1080],n[720],n[540],n["540_low"]),u.live_recording.recording_config.recording_params.xc_params.video_bitrate=n[2160].bit_rate,u.live_recording.recording_config.recording_params.xc_params.enc_height=2160,u.live_recording.recording_config.recording_params.xc_params.enc_width=3840;break;case 1080:u.live_recording.recording_config.recording_params.ladder_specs.unshift(n[1080],n[720],n[540],n["540_low"]),u.live_recording.recording_config.recording_params.xc_params.video_bitrate=n[1080].bit_rate,u.live_recording.recording_config.recording_params.xc_params.enc_height=1080,u.live_recording.recording_config.recording_params.xc_params.enc_width=1920;break;case 720:u.live_recording.recording_config.recording_params.ladder_specs.unshift(n[720],n[540],n["540_low"]),u.live_recording.recording_config.recording_params.xc_params.video_bitrate=n[720].bit_rate,u.live_recording.recording_config.recording_params.xc_params.enc_height=720,u.live_recording.recording_config.recording_params.xc_params.enc_width=1280;break;case 540:u.live_recording.recording_config.recording_params.ladder_specs.unshift(n[540],n["540_low"]),u.live_recording.recording_config.recording_params.xc_params.video_bitrate=n[540].bit_rate,u.live_recording.recording_config.recording_params.xc_params.enc_height=540,u.live_recording.recording_config.recording_params.xc_params.enc_width=960;break;default:throw new Error("ERROR: Probed stream does not conform to one of the following built in resolution ladders [4096, 2160], [1920, 1080] [1280, 720], [960, 540]")}let A=0,T=0;for(let R=0;R<Object.keys(p).length;R++){let L={...t};const D=Object.keys(p)[R],q=p[D];L.bit_rate=q.recordingBitrate,L.representation=`audioaudio_aac@${q.recordingBitrate}`,L.channels=q.recordingChannels,L.stream_index=parseInt(D),L.stream_name=`audio_${D}`,L.stream_label=q.playoutLabel?q.playoutLabel:null,u.live_recording.recording_config.recording_params.ladder_specs.push(L),q.recordingBitrate>A&&(A=q.recordingBitrate),T++}return u.live_recording.recording_config.recording_params.xc_params.audio_bitrate=A,u.live_recording.recording_config.recording_params.xc_params.n_audio=T,u}};return I5.LiveConf=r,I5}var Ty={exports:{}},D5={},U5,xP;function Pye(){return xP||(xP=1,U5=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),U5}var w_={exports:{}},_P;function Iye(){return _P||(_P=1,typeof Object.create=="function"?w_.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:w_.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}),w_.exports}var SP;function Dye(){return SP||(SP=1,function(n){var e=/%[sdj%]/g;n.format=function(F){if(!D(F)){for(var j=[],Q=0;Q<arguments.length;Q++)j.push(i(arguments[Q]));return j.join(" ")}for(var Q=1,ae=arguments,N=ae.length,k=String(F).replace(e,function(ie){if(ie==="%%")return"%";if(Q>=N)return ie;switch(ie){case"%s":return String(ae[Q++]);case"%d":return Number(ae[Q++]);case"%j":try{return JSON.stringify(ae[Q++])}catch{return"[Circular]"}default:return ie}}),Y=ae[Q];Q<N;Y=ae[++Q])T(Y)||!ce(Y)?k+=" "+Y:k+=" "+i(Y);return k},n.deprecate=function(F,j){if(W(Fa.process))return function(){return n.deprecate(F,j).apply(this,arguments)};if(process.noDeprecation===!0)return F;var Q=!1;function ae(){if(!Q){if(process.throwDeprecation)throw new Error(j);process.traceDeprecation?console.trace(j):console.error(j),Q=!0}return F.apply(this,arguments)}return ae};var t={},r;n.debuglog=function(F){if(W(r)&&(r=process.env.NODE_DEBUG||""),F=F.toUpperCase(),!t[F])if(new RegExp("\\b"+F+"\\b","i").test(r)){var j=process.pid;t[F]=function(){var Q=n.format.apply(n,arguments);console.error("%s %d: %s",F,j,Q)}}else t[F]=function(){};return t[F]};function i(F,j){var Q={seen:[],stylize:u};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),A(j)?Q.showHidden=j:j&&n._extend(Q,j),W(Q.showHidden)&&(Q.showHidden=!1),W(Q.depth)&&(Q.depth=2),W(Q.colors)&&(Q.colors=!1),W(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=o),p(Q,F,Q.depth)}n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function o(F,j){var Q=i.styles[j];return Q?"\x1B["+i.colors[Q][0]+"m"+F+"\x1B["+i.colors[Q][1]+"m":F}function u(F,j){return F}function c(F){var j={};return F.forEach(function(Q,ae){j[Q]=!0}),j}function p(F,j,Q){if(F.customInspect&&j&&Ce(j.inspect)&&j.inspect!==n.inspect&&!(j.constructor&&j.constructor.prototype===j)){var ae=j.inspect(Q,F);return D(ae)||(ae=p(F,ae,Q)),ae}var N=h(F,j);if(N)return N;var k=Object.keys(j),Y=c(k);if(F.showHidden&&(k=Object.getOwnPropertyNames(j)),Se(j)&&(k.indexOf("message")>=0||k.indexOf("description")>=0))return m(j);if(k.length===0){if(Ce(j)){var ie=j.name?": "+j.name:"";return F.stylize("[Function"+ie+"]","special")}if(de(j))return F.stylize(RegExp.prototype.toString.call(j),"regexp");if(me(j))return F.stylize(Date.prototype.toString.call(j),"date");if(Se(j))return m(j)}var $="",be=!1,Ie=["{","}"];if(S(j)&&(be=!0,Ie=["[","]"]),Ce(j)){var Me=j.name?": "+j.name:"";$=" [Function"+Me+"]"}if(de(j)&&($=" "+RegExp.prototype.toString.call(j)),me(j)&&($=" "+Date.prototype.toUTCString.call(j)),Se(j)&&($=" "+m(j)),k.length===0&&(!be||j.length==0))return Ie[0]+$+Ie[1];if(Q<0)return de(j)?F.stylize(RegExp.prototype.toString.call(j),"regexp"):F.stylize("[Object]","special");F.seen.push(j);var Ue;return be?Ue=w(F,j,Q,Y,k):Ue=k.map(function(se){return b(F,j,Q,Y,se,be)}),F.seen.pop(),g(Ue,$,Ie)}function h(F,j){if(W(j))return F.stylize("undefined","undefined");if(D(j)){var Q="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return F.stylize(Q,"string")}if(L(j))return F.stylize(""+j,"number");if(A(j))return F.stylize(""+j,"boolean");if(T(j))return F.stylize("null","null")}function m(F){return"["+Error.prototype.toString.call(F)+"]"}function w(F,j,Q,ae,N){for(var k=[],Y=0,ie=j.length;Y<ie;++Y)z(j,String(Y))?k.push(b(F,j,Q,ae,String(Y),!0)):k.push("");return N.forEach(function($){$.match(/^\d+$/)||k.push(b(F,j,Q,ae,$,!0))}),k}function b(F,j,Q,ae,N,k){var Y,ie,$;if($=Object.getOwnPropertyDescriptor(j,N)||{value:j[N]},$.get?$.set?ie=F.stylize("[Getter/Setter]","special"):ie=F.stylize("[Getter]","special"):$.set&&(ie=F.stylize("[Setter]","special")),z(ae,N)||(Y="["+N+"]"),ie||(F.seen.indexOf($.value)<0?(T(Q)?ie=p(F,$.value,null):ie=p(F,$.value,Q-1),ie.indexOf(`
@@ -372,4 +372,4 @@ ${o.length}${o}`,"utf-8")),p=Kp.utils.recoverAddress(c,i);return{type:t,message:
372
372
  top=${m},
373
373
  left=${h}
374
374
  `);return w&&window.focus&&w.focus(),w};Oh.ActionPopup=async({mode:n="tab",url:e,onMessage:t,onCancel:r})=>{await new Promise(i=>{const o=n==="popup"?tme({url:e,title:"Eluvio Media Wallet",w:500,h:850}):window.open(e),u=setInterval(async()=>{o.closed&&(clearInterval(u),r&&await r(),i())},1e3);window.addEventListener("message",async c=>{await t(c,()=>{clearInterval(u),o.close(),i()})})})};var tn={},DP;function nme(){if(DP)return tn;DP=1;const n=ki,e=xs,{FormatNFTDetails:t,FormatNFTMetadata:r,FormatNFT:i}=Oh,o=xF();return tn.UserInfo=function(){if(this.loggedIn)return{name:this.__authorization.email||this.UserAddress(),address:this.UserAddress(),email:this.__authorization.email,walletType:this.__authorization.walletType,walletName:this.__authorization.walletName}},tn.UserAddress=function(){if(this.loggedIn)return this.client.utils.DecodeSignedToken(this.AuthToken()).payload.adr},tn.UserWalletBalance=async function(u=!1){if(!this.loggedIn)return;const{balance:c,usage_hold:p,payout_hold:h,locked_offer_balance:m,stripe_id:w,stripe_payouts_enabled:b}=await this.client.utils.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","bal"),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})),g=w,S=b,A=parseFloat(c||0),T=parseFloat(m||0),R=Math.max(0,A-parseFloat(p||0)-T),L=Math.max(0,A-R),D=Math.max(0,A-parseFloat(Math.max(h,T)||0));if(u&&w&&!b){const W=new URL(e(window.location.origin,window.location.pathname)).toString();return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","onb","stripe"),method:"POST",body:{country:"US",mode:this.mode,refresh_url:W.toString(),return_url:W.toString()},headers:{Authorization:`Bearer ${this.AuthToken()}`}}),await this.UserWalletBalance(!1)}let q={totalWalletBalance:A,availableWalletBalance:R,lockedWalletBalance:T,pendingWalletBalance:L,withdrawableWalletBalance:D};return S&&(q.userStripeId=g,q.userStripeEnabled=S),q},tn.UserItemNames=async function({marketplaceParams:u,userAddress:c}={}){let p=[];return u&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:u})).tenantId}`),c&&p.push(`wlt:eq:${n.FormatAddress(c)}`),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","names"),method:"GET",queryParams:{filter:p}}))},tn.UserItemEditionNames=async function({displayName:u}){return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","editions"),method:"GET",queryParams:{filter:`meta/display_name:eq:${u}`}}))},tn.UserItemAttributes=async function({marketplaceParams:u,displayName:c,userAddress:p}={}){let h=[];return u&&h.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:u})).tenantId}`),p&&h.push(`wlt:eq:${n.FormatAddress(p)}`),c&&h.push(`meta/display_name:eq:${c}`),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","attributes"),method:"GET",queryParams:{filter:h}}))).map(({trait_type:w,values:b})=>({name:w,values:b})).filter(({name:w})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(w))},tn.UserItems=async function({sortBy:u="default",includeFullMetadata:c=!1}={}){return c&&this.loggedIn?this.FilteredQuery({mode:"owned-full-meta",sortBy:u,...arguments[0]||{}}):this.FilteredQuery({mode:"owned",sortBy:u,...arguments[0]||{}})},tn.UserListings=async function({userAddress:u,sortBy:c="created",sortDesc:p=!1,contractAddress:h,tokenId:m,marketplaceParams:w}={}){return(await this.FilteredQuery({mode:"listings",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:u||this.UserAddress(),marketplaceParams:w,contractAddress:h,tokenId:m,includeCheckoutLocked:!0})).results},tn.UserSales=async function({userAddress:u,sortBy:c="created",sortDesc:p=!1,contractAddress:h,tokenId:m,startTime:w,endTime:b,lastNDays:g,marketplaceParams:S}={}){return(await this.FilteredQuery({mode:"sales",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:u||this.UserAddress(),startTime:w,endTime:b,lastNDays:g,marketplaceParams:S,contractAddress:h,tokenId:m})).results},tn.UserTransfers=async function({userAddress:u,sortBy:c="created",sortDesc:p=!1,contractAddress:h,tokenId:m,startTime:w,endTime:b,lastNDays:g,marketplaceParams:S}={}){return(await this.FilteredQuery({mode:"transfers",start:0,limit:1e4,sortBy:c,sortDesc:p,sellerAddress:u||this.UserAddress(),marketplaceParams:S,contractAddress:h,tokenId:m,startTime:w,endTime:b,lastNDays:g})).results},tn.TenantConfiguration=async function({tenantId:u,contractAddress:c}){try{return c=c?n.FormatAddress(c):void 0,this.tenantConfigs[c||u]||(this.tenantConfigs[c||u]=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:c?e("as","config","nft",c):e("as","config","tnt",u),method:"GET"}))),this.tenantConfigs[c||u]}catch(p){return this.Log("Failed to load tenant configuration",!0,p),{}}},tn.ExchangeRate=async function({currency:u}){if(!u)throw Error("Eluvio Wallet Client: Invalid or missing currency in ExchangeRate");return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","xr","ebanx",u),method:"GET"}))},tn.TenantCSS=async function({tenantSlug:u}){return this.cachedCSS[u]||(this.cachedCSS[u]=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("/public","asset_metadata","tenants",u,"info","branding","wallet_css"),authorizationToken:this.publicStaticToken})),this.cachedCSS[u]||""},tn.MarketplaceStock=async function({marketplaceParams:u,tenantId:c}){return c||(c=this.MarketplaceInfo({marketplaceParams:u}).tenantId),this.loggedIn?await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","nft","info",c),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","stock",c),method:"GET"}))},tn.MarketplaceInfo=function({marketplaceParams:u}){let{tenantSlug:c,marketplaceSlug:p,marketplaceId:h,marketplaceHash:m}=u||{},w;if(c&&p?w=(this.availableMarketplaces[c]||{})[p]:(h=m?this.client.utils.DecodeVersionHash(m).objectId:h,w=this.availableMarketplacesById[h]),!w)throw Error(`Eluvio Wallet Client: Unable to find marketplace with parameters ${JSON.stringify(arguments)}`);return w},tn.MarketplaceCSS=async function({marketplaceParams:u}){const p=this.MarketplaceInfo({marketplaceParams:u}).marketplaceHash;return this.cachedCSS[p]||(this.cachedCSS[p]=await this.client.ContentObjectMetadata({versionHash:p,metadataSubtree:"public/asset_metadata/info/branding/custom_css",authorizationToken:this.publicStaticToken,noAuth:!0})),this.cachedCSS[p]||""},tn.AvailableMarketplaces=async function({organizeById:u,forceReload:c=!1}={}){return c&&await this.LoadAvailableMarketplaces(!0),{...u?this.availableMarketplacesById:this.availableMarketplaces}},tn.Marketplace=async function({marketplaceParams:u}){return this.LoadMarketplace(u)},tn.NFTContractStats=async function({contractAddress:u}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",u),method:"GET"}))},tn.NFT=async function({tokenId:u,contractAddress:c}){let p=t(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","nft","info",c,u),method:"GET"})));const h=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:"public/asset_metadata/nft",produceLinkUrls:!0})||{};if(p.metadata=o({},h,p.metadata,(m,w)=>w===null||w===""?m:void 0),this.localization){const m=await this.client.ContentObjectMetadata({versionHash:p.details.VersionHash,metadataSubtree:e("public","asset_metadata","localizations",this.localization,"nft"),produceLinkUrls:!0})||{};p.metadata=o({},p.metadata,m,(w,b)=>b===null||b===""?w:void 0)}return p.config=await this.TenantConfiguration({contractAddress:c}),r(this,p)},tn.TransferNFT=async function({contractAddress:u,tokenId:c,targetAddress:p}){if(!p||!n.ValidAddress(p))throw Error("Eluvio Wallet Client: Invalid or missing target address in UserTransferNFT");return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","xfer"),method:"POST",body:{contract:n.FormatAddress(u),token:c,to_addr:n.FormatAddress(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.ListingStatus=async function({listingId:u}){try{return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","status",u),method:"GET"}))}catch(c){if(c.status===404)return;throw c}},tn.Listing=async function({listingId:u}){return i(this,await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","l",u),method:"GET"})))},tn.Listings=async function(){return this.FilteredQuery({mode:"listings",...arguments[0]||{}})},tn.ListingStats=async function(){return this.FilteredQuery({mode:"listing-stats",...arguments[0]||{}})},tn.Sales=async function(){return this.FilteredQuery({mode:"sales",...arguments[0]||{}})},tn.Transfers=async function(){return this.FilteredQuery({mode:"transfers",...arguments[0]||{}})},tn.SalesStats=async function(){return this.FilteredQuery({mode:"sales-stats",...arguments[0]||{}})},tn.Leaderboard=async function({userAddress:u,marketplaceParams:c}){if(u){let p={addr:n.FormatAddress(u)};return c&&(p.filter=[`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:c})).tenantId}`]),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","ranks"),method:"GET",queryParams:p}))||[])[0]}return this.FilteredQuery({mode:"leaderboard",...arguments[0]||{}})},tn.CreateListing=async function({contractAddress:u,tokenId:c,price:p,listingId:h}){return u=n.FormatAddress(u),h?await n.ResponseToFormat("text",await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"PUT",body:{id:h,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt"),method:"POST",body:{contract:u,token:c,price:parseFloat(p)},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.RemoveListing=async function({listingId:u}){await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt",u),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.SalesNames=async function({marketplaceParams:u}){let c;return u&&(c=(await this.MarketplaceInfo({marketplaceParams:u})).tenantId),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names","hst"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},tn.ListingNames=async function({marketplaceParams:u}){let c;return u&&(c=(await this.MarketplaceInfo({marketplaceParams:u})).tenantId),await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","names"),method:"GET",queryParams:c?{filter:`tenant:eq:${c}`}:{}}))},tn.ListingEditionNames=async function({displayName:u}){return await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","editions"),queryParams:{filter:`nft/display_name:eq:${u}`},method:"GET"}))},tn.ListingAttributes=async function({marketplaceParams:u,displayName:c}={}){let p=[];return u&&p.push(`tenant:eq:${(await this.MarketplaceInfo({marketplaceParams:u})).tenantId}`),c&&p.push(`nft/display_name:eq:${c}`),(await n.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:e("as","mkt","attributes"),method:"GET",queryParams:{filter:p}}))).map(({trait_type:m,values:w})=>({name:m,values:w})).filter(({name:m})=>!["Content Fabric Hash","Total Minted Supply","Creator"].includes(m))},tn.ClaimGift=async function({code:u}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","gifts","claim"),body:{otp_code:u},headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.ClaimItem=async function({marketplaceParams:u,sku:c,email:p}){const h=await this.MarketplaceInfo({marketplaceParams:u});await this.client.authClient.MakeAuthServiceRequest({method:"POST",path:e("as","wlt","act",h.tenant_id),body:{op:"nft-claim",sid:h.marketplaceId,sku:c,email:p},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.PurchaseItem=async function({marketplaceParams:u,sku:c,confirmationId:p,successUrl:h,cancelUrl:m}){const w=await this.MarketplaceInfo({marketplaceParams:u});window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:w.marketplaceId,parameters:{sku:c,confirmationId:p,successUrl:h,cancelUrl:m,login:!0,auth:this.ClientAuthToken()}})},tn.PurchaseListing=async function({marketplaceParams:u,listingId:c,confirmationId:p,successUrl:h,cancelUrl:m}){let w;u&&(w=await this.MarketplaceInfo({marketplaceParams:u})),window.location.href=this.FlowURL({type:"action",flow:"purchase",marketplaceId:w&&w.marketplaceId,parameters:{listingId:c,confirmationId:p,successUrl:h,cancelUrl:m,login:!0,auth:this.ClientAuthToken()}})},tn.ListingPurchaseStatus=async function({listingId:u,confirmationId:c}){try{const p=await this.ListingStatus({listingId:u});if(!p)throw Error("Unable to find info for listing "+u);return(await this.MintingStatus({tenantId:p.tenant})).find(m=>m.op==="nft-transfer"&&m.extra&&m.extra[0]===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.PurchaseStatus=async function({marketplaceParams:u,confirmationId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:u});return(await this.MintingStatus({tenantId:p.tenant_id})).find(m=>m.op==="nft-buy"&&m.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.ClaimStatus=async function({marketplaceParams:u,sku:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:u});return(await this.MintingStatus({tenantId:p.tenantId})).find(m=>m.op==="nft-claim"&&m.marketplaceId===p.marketplaceId&&m.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.GiftClaimStatus=async function({marketplaceParams:u,confirmationId:c,giftId:p}){try{const h=await this.MarketplaceInfo({marketplaceParams:u}),w=(await this.MintingStatus({tenantId:h.tenantId})).filter(b=>b.op==="nft-transfer"&&(c&&b.confirmationId===c||p&&b.giftId===p))||{status:"none"};return w.length===0?{status:"none"}:w.find(b=>b.status==="failed")?{status:"failed",op:"nft-transfer",transfer_statuses:w}:w.find(b=>b.status!=="complete")?{status:"pending",op:"nft-transfer",transfer_statuses:w}:{status:"complete",op:"nft-transfer",transfer_statuses:w,items:w.map(b=>({token_addr:b.address,token_id_str:b.tokenId}))}}catch(h){return this.Log(h,!0),{status:"unknown"}}},tn.EntitlementClaimStatus=async function({marketplaceParams:u,purchaseId:c}){try{const p=await this.MarketplaceInfo({marketplaceParams:u}),m=(await this.MintingStatus({tenantId:p.tenantId})).filter(w=>w.op==="nft-claim-entitlement"&&c&&c==w.confirmationId)||{status:"none"};return m.length===0?{status:"none"}:m.find(w=>w.status==="complete")?{status:"complete",op:"nft-claim-entitlement",items:[{token_addr:m[0].address,token_id:m[0].tokenId}]}:m.find(w=>w.status==="error")?{status:"error",op:"nft-claim-entitlement"}:{status:"pending",op:"nft-claim-entitlement"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.PackOpenStatus=async function({contractAddress:u,tokenId:c}){try{const p=await this.TenantConfiguration({contractAddress:u});return(await this.MintingStatus({tenantId:p.tenant})).find(m=>m.op==="nft-open"&&n.EqualAddress(u,m.address)&&m.tokenId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.CollectionRedemptionStatus=async function({marketplaceParams:u,confirmationId:c}){try{return(await this.MintingStatus({marketplaceParams:u})).find(h=>h.op==="nft-redeem"&&h.confirmationId===c)||{status:"none"}}catch(p){return this.Log(p,!0),{status:"unknown"}}},tn.RedeemableOfferStatus=async function({tenantId:u,marketplaceParams:c,contractAddress:p,tokenId:h,offerId:m}){try{const w=await this.MintingStatus({marketplaceParams:c,tenantId:u});return p=n.FormatAddress(p),w.find(b=>b.op==="nft-offer-redeem"&&n.EqualAddress(b.address,p)&&b.tokenId===(h||"").toString()&&b.offerId===(m||"").toString())||{status:"none"}}catch(w){return this.Log(w,!0),{status:"unknown"}}},tn.RedeemableCustomFulfillmentInfo=async function({redeemableTransactionId:u}){return await n.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:e("code-fulfillment",this.network==="main"?"main":"demov3","fulfill",u),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.LoadDrop=async function({tenantSlug:u,eventSlug:c,dropId:p}){if(this.drops||(this.drops={}),this.drops[u]||(this.drops[u]={}),this.drops[u][c]||(this.drops[u][c]={}),!this.drops[u][c][p]){const h=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:e("public","asset_metadata","tenants",u,"sites",c,"info"),resolveLinks:!0,linkDepthLimit:2,resolveIncludeSource:!0,produceLinkUrls:!0,select:[".","drops"],noAuth:!0})||[],m=n.DecodeVersionHash(h["."].source).objectId;h.drops.forEach(w=>{w={...w,eventId:m},this.drops[u][c][w.uuid]=w,this.drops[w.uuid]=w})}return this.drops[p]},tn.SubmitDropVote=async function({marketplaceParams:u,eventId:c,dropId:p,sku:h}){const m=await this.MarketplaceInfo({marketplaceParams:u});await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",m.tenant_id),method:"POST",body:{op:"vote-drop",evt:c,id:p,itm:h},headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.DropStatus=async function({marketplace:u,eventId:c,dropId:p}){try{return(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","act",u.tenant_id,c,p),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).sort((m,w)=>m.ts>w.ts?1:-1)[0]||{status:"none"}}catch(h){return this.Log(h,!0),""}},tn.MarketplaceOffers=async function({contractAddress:u,tokenId:c,buyerAddress:p,sellerAddress:h,statuses:m,start:w=0,limit:b=10}){let g=e("as","mkt","offers","ls");p?g=e(g,"b",n.FormatAddress(p)):h&&(g=e(g,"s",n.FormatAddress(h))),u&&(g=e(g,"c",n.FormatAddress(u)),c&&(g=e(g,"t",c)));let S={start:w,limit:b};return m&&m.length>0&&(S.include=m.join(",")),(await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:g,method:"GET",queryParams:S}))).map(T=>({...T,created:T.created*1e3,updated:T.updated*1e3,expiration:T.expiration*1e3}))},tn.CreateMarketplaceOffer=async function({contractAddress:u,tokenId:c,offerId:p,price:h,expiresAt:m}){let w;return p?w=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",p),method:"PUT",body:{price:h,expiration:Math.floor(m/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})):w=await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",u,c),method:"POST",body:{contract:u,token:c,price:h,expiration:Math.floor(m/1e3)},headers:{Authorization:`Bearer ${this.AuthToken()}`}})),w.offer_id},tn.RemoveMarketplaceOffer=async function({offerId:u}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers",u),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.AcceptMarketplaceOffer=async function({offerId:u}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","accept",u),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.RejectMarketplaceOffer=async function({offerId:u}){return await this.client.authClient.MakeAuthServiceRequest({path:e("as","wlt","mkt","offers","decline",u),method:"PUT",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},tn.VoteStatus=async function({tenantId:u,votingEventId:c}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",u,c),headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.CastVote=async function({tenantId:u,votingEventId:c,sku:p}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",u,c,p),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn.RevokeVote=async function({tenantId:u,votingEventId:c,sku:p}){return await n.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:e("as","votes",u,c,p),method:"DELETE",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))},tn}var Yp={},UP;function rme(){if(UP)return Yp;UP=1;const n=ki,e=xs,t=({network:i,path:o})=>e(i==="main"?"/main":"/dv3",o),r=({network:i,appId:o,userAddress:u,key:c,type:p,mode:h})=>t({network:i,path:e(p==="app"?"app":"usr",p==="app"?o:"",u,h==="public"?"pub":"pri",c||"")});return Yp.ProfileMetadata=async function({type:i="app",mode:o="public",appId:u,userAddress:c,key:p}){try{const h=await this.stateStoreClient.Request({path:r({network:this.network,appId:u||this.appId,userAddress:c||this.UserAddress(),type:i,mode:o,key:p}),headers:o==="private"?{Authorization:`Bearer ${this.AuthToken()}`}:void 0});if(!h.ok)throw h;return(await n.ResponseToJson(h))[p]}catch(h){if(h.status===404)return;throw h}},Yp.SetProfileMetadata=async function({type:i="app",mode:o="public",appId:u,key:c,value:p}){await this.stateStoreClient.Request({method:"POST",path:r({network:this.network,appId:u||this.appId,userAddress:this.UserAddress(),type:i,mode:o,key:c}),body:p,bodyType:typeof p=="object"?"JSON":"string",headers:{Authorization:`Bearer ${this.AuthToken()}`}})},Yp.RemoveProfileMetadata=async function({type:i="app",mode:o="public",appId:u,key:c}){await this.stateStoreClient.Request({method:"DELETE",path:r({network:this.network,appId:u||this.appId,userAddress:this.UserAddress(),type:i,mode:o,key:c}),headers:{Authorization:`Bearer ${this.AuthToken()}`}})},Yp.Profile=async function({userAddress:i,userName:o}){if(o&&(i=await this.UserNameToAddress({userName:o})),!i)throw Error("Eluvio Wallet Client: Unable to determine profile - user address not specified");o||(o=await this.ProfileMetadata({type:"user",userAddress:i,key:"username"}));const u=await this.ProfileMetadata({type:"user",userAddress:i,key:"icon_url"});let c=await this.ProfileMetadata({type:"app",mode:"public",appId:"elv-badge-srv",userAddress:this.badgerAddress,key:`badges_${n.FormatAddress(i)}`}),p=[];if(c)try{c=JSON.parse(c).badges,p=Object.keys(c).map(h=>({...c[h],name:h}))}catch(h){this.Log(`Failed to load badge info for ${o||i}`,!0),this.Log(h,!0)}return{userAddress:n.FormatAddress(i),userName:o,imageUrl:u,badges:p}},Yp.UserNameToAddress=async function({userName:i}){try{const o=await this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("usr","profile_for_username",i)})});if(!o.ok)throw o;return(await n.ResponseToJson(o)).address}catch(o){if(o.status!==404)throw o}},Yp}var Hv={},FP;function ame(){if(FP)return Hv;FP=1;const n=ki,e=xs,t=({network:r,path:i})=>e("/push",r==="main"?"/main":"/dv3",i);return Hv.PushNotification=async function({tenantId:r,eventType:i,data:o,userAddress:u}){await this.stateStoreClient.Request({method:"POST",path:t({network:this.network,path:e("notify_user",u||this.UserAddress(),r,i)}),body:o,headers:{Authorization:`Bearer ${this.AuthToken()}`}})},Hv.AddNotificationListener=async function({onMessage:r}){if(!r)throw Error("Eluvio Wallet Client: No onMessage callback provided to AddNotificationListener");const i=new URL(this.stateStoreClient.BaseURI().toString());i.pathname=t({network:this.network,path:e("register",this.UserAddress(),this.AuthToken())});const o=new EventSource(i);return o.onmessage=u=>{let c=JSON.parse(u.data);try{c.data=JSON.parse(c.data)}catch{}r(c)},o},Hv.Notifications=async function({tenantId:r,types:i,offsetId:o,limit:u=10}={}){let c={limit:u};r&&(c.tenant_id=r),i&&(c.types=Array.isArray(i)?i.join(","):i),o&&(c.offset_by=o);const{records:p}=await n.ResponseToJson(this.stateStoreClient.Request({method:"GET",path:t({network:this.network,path:e("history",this.UserAddress())}),queryParams:c,headers:{Authorization:`Bearer ${this.AuthToken()}`}}));return p.map(h=>{try{h.data=JSON.parse(h.data)}catch{}return h})},Hv}const{ElvClient:ime}=H8,md=Xye,{LinkTargetHash:j5,FormatNFT:sme,ActionPopup:BP}=Oh,ome=Fd,da=xs,pa=ki,ume=Wl,tb=typeof window<"u",lme=tb&&window.top!==window.self;let D_=!1;try{typeof localStorage<"u"&&localStorage.getItem("test"),D_=!0}catch{}class kd{constructor({appId:e,client:t,network:r,mode:i,localization:o,marketplaceInfo:u,previewMarketplaceHash:c,storeAuthToken:p}){this.appId=e,this.client=t,this.loggedIn=!1,this.localization=o,this.network=r,this.mode=i,this.purchaseMode=md[r][i].purchaseMode,this.mainSiteLibraryId=md[r][i].siteLibraryId,this.mainSiteId=md[r][i].siteId,this.appUrl=md[r][i].appUrl,this.publicStaticToken=t.staticToken,this.storeAuthToken=p,this.selectedMarketplaceInfo=u,this.previewMarketplaceId=c?pa.DecodeVersionHash(c).objectId:void 0,this.previewMarketplaceHash=c,this.availableMarketplaces={},this.availableMarketplacesById={},this.marketplaceHashes={},this.tenantConfigs={},this.stateStoreUrls=md[r].stateStoreUrls,this.stateStoreClient=new ome({uris:this.stateStoreUrls}),this.badgerAddress=md[r].badgerAddress,this.cachedMarketplaces={},this.cachedCSS={},this.utils=t.utils,this.ForbiddenMethods=kd.ForbiddenMethods}Log(e,t=!1,r){t?console.error("Eluvio Wallet Client:",e):console.log("Eluvio Wallet Client:",e),r&&console.error(r)}static ForbiddenMethods(){return["constructor","Authenticate","AuthenticateOAuth","AuthenticateExternalWallet","AuthToken","ClientAuthToken","Initialize","Log","LogIn","LogOut","PersonalSign","SetAuthorization","SignMetamask"]}static AllowedMethods(){return Object.getOwnPropertyNames(kd.prototype).filter(e=>!kd.ForbiddenMethods().includes(e)).sort()}static async Initialize({client:e,appId:t="general",network:r="main",mode:i="production",localization:o,marketplaceParams:u,previewMarketplaceId:c,storeAuthToken:p=!0,skipMarketplaceLoad:h=!1}){let{tenantSlug:m,marketplaceSlug:w,marketplaceId:b,marketplaceHash:g}=u||{};if(md[r]){if(!md[r][i])throw Error(`ElvWalletClient: Invalid mode ${i}`)}else throw Error(`ElvWalletClient: Invalid network ${r}`);e||(e=await ime.FromNetworkName({networkName:r,assumeV3:!0}));let S=c;S&&!S.startsWith("hq__")&&(S=await e.LatestVersionHash({objectId:c}));const A=new kd({appId:t,client:e,network:r,mode:i,localization:o,marketplaceInfo:{tenantSlug:m,marketplaceSlug:w,marketplaceId:g?e.utils.DecodeVersionHash(g).objectId:b,marketplaceHash:g},previewMarketplaceHash:S,storeAuthToken:p});if(tb&&window.location&&window.location.href){let T=new URL(window.location.href);if(T.searchParams.get("elvToken"))await A.Authenticate({token:T.searchParams.get("elvToken")}),T.searchParams.delete("elvToken"),window.history.replaceState("","",T);else if(p&&D_)try{let R=localStorage.getItem(`__elv-token-${r}`);R&&await A.Authenticate({token:R})}catch{}}return h||await A.LoadAvailableMarketplaces(),A}CanSign(){return this.loggedIn?!!this.__authorization.clusterToken||tb&&!!(this.UserInfo().walletName.toLowerCase()==="metamask"&&window.ethereum&&window.ethereum.isMetaMask&&window.ethereum.chainId):!1}async PersonalSign({message:e}){if(!this.loggedIn)throw Error("ElvWalletClient: Unable to perform signature - Not logged in");if(this.CanSign()){if(this.__authorization.clusterToken)return e=typeof e=="object"?JSON.stringify(e):e,e=ume.utils.keccak256(Buffer.from(`Ethereum Signed Message:
375
- ${e.length}${e}`,"utf-8")),await this.client.authClient.Sign(e);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:e,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!tb)throw Error("ElvWalletClient: Unable to sign");const t={action:"personal-sign",message:e,logIn:!0};let r=new URL(this.appUrl);if(r.hash=da("/action","sign",pa.B58(JSON.stringify(t))),r.searchParams.set("origin",window.location.origin),!lme&&window.location.origin===r.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(i,o)=>{await BP({mode:"tab",url:r.toString(),onCancel:()=>o("User cancelled sign"),onMessage:async(u,c)=>{if(!(!u||!u.data||u.data.type!=="FlowResponse"))try{i(u.data.response)}catch(p){o(p)}finally{c()}}})})}async LogInURL({mode:e="login",provider:t,marketplaceParams:r,clearLogin:i}){let o=new URL(this.appUrl);return o.hash="/login",o.searchParams.set("action","login"),typeof window<"u"&&o.searchParams.set("origin",window.location.origin),t&&o.searchParams.set("provider",t),e&&o.searchParams.set("mode",e),r?o.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:r})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&o.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),i&&o.searchParams.set("clear",""),o}async LogIn({method:e="redirect",provider:t,mode:r="login",callbackUrl:i,marketplaceParams:o,clearLogin:u=!1,callback:c}){let p=await this.LogInURL({mode:r,provider:t,marketplaceParams:o,clearLogin:u});e==="redirect"?(p.searchParams.set("response","redirect"),p.searchParams.set("source","origin"),p.searchParams.set("redirect",i),window.location=p):(p.searchParams.set("response","message"),p.searchParams.set("source","parent"),await new Promise(async(h,m)=>{await BP({mode:"tab",url:p.toString(),onCancel:()=>m("User cancelled login"),onMessage:async(w,b)=>{if(!(!w||!w.data||w.data.type!=="LoginResponse"))try{c?await c(w.data.params):await this.Authenticate({token:w.data.params.clientSigningToken||w.data.params.clientAuthToken}),h()}catch(g){m(g)}finally{b()}}})}))}async LogOut(){if(this.__authorization.nonce)try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(e){this.Log("Failed to release token",!0,e)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},D_)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!this.__authorization.nonce?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:e}){let t;try{t=JSON.parse(this.utils.FromB58ToStr(e))||{}}catch{throw new Error("Invalid authorization token "+e)}if(!t.expiresAt||Date.now()>t.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return t.clusterToken&&await this.client.SetRemoteSigner({authToken:t.clusterToken,signerURIs:t.signerURIs}),this.client.SetStaticToken({token:t.fabricToken}),this.SetAuthorization({...t})}async AuthenticateOAuth({idToken:e,tenantId:t,email:r,signerURIs:i,shareEmail:o=!1,extraData:u={},nonce:c,createRemoteToken:p=!0,force:h=!1}){let m=24;!t&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),t=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:e,tenantId:t,signerURIs:i,extraData:{...u,share_email:o},unsignedPublicAuth:!0});let w,b;if(p&&this.client.signer.remoteSigner){b=Date.now()+24*60*60*1e3;const S=await this.client.signer.RetrieveCSAT({email:r,nonce:c,force:h});w=S.token,c=S.nonce}else b=Date.now()+m*60*60*1e3,w=await this.client.CreateFabricToken({duration:m*60*60*1e3,context:r?{usr:{email:r}}:{}});const g=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!r)try{r=JSON.parse(this.utils.FromB64URL(e.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:w}),{authToken:this.SetAuthorization({fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:c}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",nonce:c})}}async AuthenticateExternalWallet({address:e,tokenDuration:t=24,walletName:r="Metamask",Sign:i}){e||(e=window.ethereum.selectedAddress),e=this.utils.FormatAddress(e),i||(i=async c=>this.SignMetamask({message:c,address:e}));const o=Date.now()+t*60*60*1e3,u=await this.client.CreateFabricToken({address:e,duration:t*60*60*1e3,Sign:i,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:u,address:e,expiresAt:o,walletType:"External",walletName:r,register:!0})}ClientAuthToken(){return this.loggedIn?this.utils.B58(JSON.stringify(this.__authorization)):""}AuthToken(){return this.loggedIn?this.__authorization.fabricToken:this.publicStaticToken}SetAuthorization({clusterToken:e,fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,signerURIs:c,walletType:p,walletName:h,nonce:m,register:w=!1}){i=this.client.utils.FormatAddress(i),this.__authorization={fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,walletType:p,walletName:h,nonce:m},e&&(this.__authorization.clusterToken=e,c&&(this.__authorization.signerURIs=c)),this.loggedIn=!0,this.cachedMarketplaces={};const b=this.ClientAuthToken();if(this.storeAuthToken&&D_)try{localStorage.setItem(`__elv-token-${this.network}`,b)}catch{}return w&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(g=>{this.Log("Failed to register account: ",!0,g)}),b}async SignMetamask({message:e,address:t}){if(!tb||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");t=t||this.UserAddress();const r=await window.ethereum.request({method:"eth_requestAccounts"});if(t&&!pa.EqualAddress(r[0],t))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${t}, got ${r[0]}`);return await window.ethereum.request({method:"personal_sign",params:[e,t,""]})}FlowURL({type:e="flow",flow:t,marketplaceId:r,parameters:i={}}){const o=new URL(this.appUrl);return r?o.pathname=da("/",e,t,"marketplace",r,pa.B58(JSON.stringify(i))):o.pathname=da("/",e,t,pa.B58(JSON.stringify(i))),o.searchParams.set("origin",window.location.origin),o.toString()}async GenerateCodeAuth({url:e}={}){e||(e=await this.LogInURL({mode:"login"}),e.searchParams.set("response","code"),e.searchParams.set("source","code"));const t=await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:e.toString()}}));return t.code=t.id,t.url=t.url.startsWith("https://")?t.url:`https://${t.url}`,t.metamask_url=t.metamask_url.startsWith("https://")?t.metamask_url:`https://${t.metamask_url}`,t}async SetCodeAuth({code:e,address:t,type:r,authToken:i}){await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","login","session",e),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:e,format:"auth_token",payload:JSON.stringify({addr:pa.FormatAddress(t),eth:t?`ikms${pa.AddressToHash(t)}`:"",type:r,token:i})}}))}async GetCodeAuth({code:e,passcode:t}){try{return await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","login","redirect","metamask",e,t),method:"GET"}))}catch(r){if(r&&r.status===404)return;throw r}}async LoadAvailableMarketplaces(e=!1){if(!e&&Object.keys(this.availableMarketplaces)>0)return;let t=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:"public/asset_metadata",resolveLinks:!0,linkDepthLimit:2,resolveIncludeSource:!0,resolveIgnoreErrors:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken,noAuth:!0,select:["info/marketplace_order","tenants/*/.","tenants/*/info/branding","tenants/*/marketplaces/*/.","tenants/*/marketplaces/*/info/tenant_id","tenants/*/marketplaces/*/info/tenant_name","tenants/*/marketplaces/*/info/branding","tenants/*/marketplaces/*/info/storefront/background","tenants/*/marketplaces/*/info/storefront/background_mobile"],remove:["tenants/*/info/branding/wallet_css","tenants/*/marketplaces/*/info/branding/custom_css"]});const r=((t||{}).info||{}).marketplace_order||[];if(t=(t||{}).tenants||{},this.previewMarketplaceId){let u="PREVIEW",c,p;Object.keys(t||{}).forEach(h=>Object.keys(t[h].marketplaces||{}).forEach(m=>{const w=t[h].marketplaces[m]["."].source;this.utils.DecodeVersionHash(w).objectId===this.previewMarketplaceId&&(u=h,c=m,w===this.previewMarketplaceHash&&(p=t[h].marketplaces[m]))})),p||(p=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"public/asset_metadata",produceLinkUrls:!0,authorizationToken:this.publicStaticToken,noAuth:!0,select:["slug","info/tenant_id","info/tenant_name","info/branding"],remove:["info/branding/custom_css"]}),c||(c=p.slug)),p["."]={source:this.previewMarketplaceHash},p.info["."]={source:this.previewMarketplaceHash},p.info.branding.preview=!0,p.info.branding.show=!0,t[u]=t[u]||{},t[u].marketplaces=t[u].marketplaces||{},t[u].marketplaces[c]=p}let i={...this.availableMarketplaces||{}},o={...this.availableMarketplacesById||{}};Object.keys(t||{}).forEach(u=>{try{i[u]=t[u]["."]?{versionHash:t[u]["."].source}:{},Object.keys(t[u].marketplaces||{}).forEach(c=>{try{const p=t[u].marketplaces[c]["."].source,h=this.utils.DecodeVersionHash(p).objectId;i[u][c]={...t[u].marketplaces[c].info||{},tenantName:t[u].marketplaces[c].info.tenant_name,tenantId:t[u].marketplaces[c].info.tenant_id,tenantSlug:u,marketplaceSlug:c,marketplaceId:h,marketplaceHash:p,tenantBranding:(t[u].info||{}).branding||{},order:r.findIndex(m=>m===c)},o[h]=i[u][c],this.marketplaceHashes[h]=p,this.selectedMarketplaceInfo&&(this.selectedMarketplaceInfo.tenantSlug===u&&this.selectedMarketplaceInfo.marketplaceSlug===c||this.selectedMarketplaceInfo.marketplaceId===h)&&(this.selectedMarketplaceInfo=i[u][c])}catch{this.Log(`Eluvio Wallet Client: Unable to load info for marketplace ${u}/${c}`,!0)}})}catch(c){this.Log(`Eluvio Wallet Client: Failed to load tenant info ${u}`,!0,c)}}),this.availableMarketplaces=i,this.availableMarketplacesById=o}async LatestMarketplaceHash({marketplaceParams:e}){const t=await this.MarketplaceInfo({marketplaceParams:e});if(this.previewMarketplaceId&&pa.EqualHash(this.previewMarketplaceId,t.marketplaceId))return this.previewMarketplaceHash;const r=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug),resolveLinks:!1,noAuth:!0});return j5(r)}async LoadMarketplace(e){const t=this.MarketplaceInfo({marketplaceParams:e}),r=t.marketplaceId,i=await this.LatestMarketplaceHash({marketplaceParams:e});if(this.cachedMarketplaces[r]&&this.cachedMarketplaces[r].versionHash!==i&&delete this.cachedMarketplaces[r],!this.cachedMarketplaces[r]){let o;this.previewMarketplaceId&&pa.EqualHash(r,this.previewMarketplaceId)?o=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"/public/asset_metadata/info",localizationSubtree:this.localization?da("public","asset_metadata","localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}):o=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"info"),localizationSubtree:this.localization?da("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}),o.branding.use_tenant_styling&&(o.tenantBranding=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("/public","asset_metadata","tenants",t.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),o.items=await Promise.all(o.items.map(async(u,c)=>{if(u.requires_permissions){let p;this.loggedIn||(p=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:j5(u.nft_template),metadataSubtree:"permissioned",authorizationToken:p}),u.authorized=!0}catch{u.authorized=!1}}return u.nftTemplateMetadata=(u.nft_template||{}).nft||{},u.nftTemplateHash=((u.nft_template||{})["."]||{}).source,u.itemIndex=c,u})),o.collections=(o.collections||[]).map((u,c)=>({...u,collectionIndex:c})),o.retrievedAt=Date.now(),o.marketplaceId=r,o.versionHash=i,o.marketplaceHash=i,this.previewMarketplaceId&&r===this.previewMarketplaceId&&(o.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(u=>{try{if(o.storefront[u]){let c=new URL("https://embed.v3.contentfabric.io");const p=j5(o.storefront[u]);c.searchParams.set("p",""),c.searchParams.set("net",this.network==="main"?"main":"demo"),c.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),c.searchParams.set("vid",p),c.searchParams.set("ap",""),u.startsWith("reveal")||(c.searchParams.set("m",""),c.searchParams.set("lp","")),o.storefront[`${u}_embed_url`]=c.toString()}}catch{}}),this.cachedMarketplaces[r]=o}return this.cachedMarketplaces[r]}async FilteredQuery({mode:e="listings",sortBy:t="created",sortDesc:r=!1,filter:i,editionFilters:o,attributeFilters:u,contractAddress:c,tokenId:p,currency:h,marketplaceParams:m,tenantId:w,collectionIndexes:b,priceRange:g,tokenIdRange:S,capLimit:A,userAddress:T,sellerAddress:R,lastNDays:L=-1,startTime:D,endTime:q,includeCheckoutLocked:W=!1,start:de=0,limit:ce=50}={}){b=(b||[]).map(ne=>parseInt(ne));let me={start:de,limit:ce,sort_descending:r};e==="owned"&&t==="created"&&(t="default"),e!=="leaderboard"&&(me.sort_by=t),e.includes("listings")&&W&&(me.checkout=!0);let Se,Ce;m&&(Se=await this.MarketplaceInfo({marketplaceParams:m}),b.length>0&&(Ce=await this.Marketplace({marketplaceParams:m})));try{let ne=[];R?ne.push(`seller:eq:${this.client.utils.FormatAddress(R)}`):T&&e!=="owned"&&ne.push(`addr:eq:${this.client.utils.FormatAddress(T)}`),Ce&&b.length>=0?b.forEach(F=>{Ce.collections[F].items.forEach(Q=>{if(!Q)return;const ae=Ce.items.find(k=>k.sku===Q);if(!ae)return;const N=pa.SafeTraverse(ae,"nft_template","nft","address");N&&ne.push(`${e==="owned"?"contract_addr":"contract"}:eq:${pa.FormatAddress(N)}`)})}):(Se||w)&&ne.push(`tenant:eq:${Se?Se.tenantId:w}`),c?(e==="owned"?ne.push(`contract_addr:eq:${pa.FormatAddress(c)}`):ne.push(`contract:eq:${pa.FormatAddress(c)}`),p&&ne.push(`token:eq:${p}`)):i&&(e.includes("listing")?ne.push(`nft/display_name:eq:${i}`):e==="owned"?ne.push(`meta/display_name:eq:${i}`):ne.push(`name:eq:${i}`)),o&&o.forEach(F=>{e.includes("listing")?ne.push(`nft/edition_name:eq:${F}`):e==="owned"?(ne.push(`meta:@>:{"edition_name":"${F}"}`),me.exact=!1):ne.push(`edition:eq:${F}`)}),u&&u.map(({name:F,value:j})=>{!F||!j||ne.push(`nft/attributes/${F}:eq:${j}`)}),h&&ne.push("link_type:eq:sol"),D||q?(D&&ne.push(`created:gt:${parseInt(D)/1e3}`),q&&ne.push(`created:lt:${parseInt(q)/1e3}`)):L&&L>0&&ne.push(`created:gt:${(Date.now()/1e3-L*24*60*60).toFixed(0)}`),g&&(g.min&&ne.push(`price:ge:${parseFloat(g.min)}`),g.max&&ne.push(`price:le:${parseFloat(g.max)}`)),S&&(S.min&&ne.push(`info/token_id:ge:${parseInt(S.min)}`),S.max&&ne.push(`info/token_id:le:${parseInt(S.max)}`)),A&&ne.push(`info/cap:le:${parseInt(A)}`);let ke,C;switch(e){case"owned":C=da("as","wlt",T||this.UserAddress());break;case"owned-full-meta":C=da("as","apigw","nfts"),ke={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":C=da("as","mkt","f");break;case"transfers":C=da("as","mkt","hst","f"),ne.push("action:eq:TRANSFERRED"),ne.push("action:eq:SOLD");break;case"sales":C=da("as","mkt","hst","f"),ne.push("action:eq:SOLD"),ne.push("seller:co:0x");break;case"listing-stats":C=da("as","mkt","stats","listed");break;case"sales-stats":C=da("as","mkt","stats","sold"),ne.push("seller:co:0x");break;case"leaderboard":C=da("as","wlt","leaders");break}if(ne.length>0&&(me.filter=ne),e.includes("stats"))return await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:me,headers:ke}));const{contents:_,paging:O}=await pa.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:me,headers:ke}))||[],z=["owned","listings","owned-full-meta"];return{paging:{start:me.start,limit:me.limit,total:O.total,more:O.total>de+ce},results:(_||[]).map(F=>z.includes(e)?sme(this,F):F)}}catch(ne){if(ne.status&&ne.status.toString()==="404")return{paging:{start:me.start,limit:me.limit,total:0,more:!1},results:[]};throw ne}}async MintingStatus({marketplaceParams:e,tenantId:t}){t||(t=(await this.MarketplaceInfo({marketplaceParams:e||this.selectedMarketplaceInfo})).tenantId);try{return(await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","status","act",t),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(i=>{let[o,u,c]=i.op.split(":");u=u.startsWith("0x")?pa.FormatAddress(u):u;let p,h,m,w;if(o==="nft-buy"?p=c:o==="nft-claim"?(p=c,i.marketplaceId=u,i.extra&&i.extra[0]&&(u=i.extra.token_addr,h=i.extra.token_id_str)):o==="nft-redeem"?p=i.op.split(":").slice(-1)[0]:h=c,o==="nft-transfer"&&(p=i.extra&&i.extra.trans_id,h=i.extra&&i.extra.token_id_str||h,i.extra&&i.extra.gift_action==="nft-gift-claim"&&(w=i.extra.gift_id)),o==="nft-offer-redeem"&&(m=i.op.split(":")[3]),o==="nft-claim-entitlement"){let[b,g,S,A]=i.op.split(":");p=A,i.extra&&i.extra[0]&&(u=i.extra[0].token_addr,h=i.extra[0].token_id,u=u.startsWith("0x")?pa.FormatAddress(u):u,i.marketplaceId=g)}return{...i,timestamp:new Date(i.ts),state:i.state&&typeof i.state=="object"?Object.values(i.state):i.state,extra:i.extra&&typeof i.extra=="object"?Object.values(i.extra):i.extra,confirmationId:p,op:o,address:pa.FormatAddress(u),tokenId:h,offerId:m,giftId:w}}).sort((i,o)=>i.ts<o.ts?1:-1)}catch(r){return this.Log("Failed to retrieve minting status",!0,r),[]}}async DeployTenant({tenantId:e,tenantSlug:t="",tenantHash:r}){if(!r){const u=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("public/asset_metadata/tenants",t),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!u)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${t}`);const c=u["."].source;r=await this.client.LatestVersionHash({versionHash:c})}const i={content_hash:r,ts:Date.now()},o=await this.client.Sign(JSON.stringify(i));await this.client.authClient.MakeAuthServiceRequest({path:da("as","tnt","config",e,"metadata"),method:"POST",body:i,headers:{Authorization:`Bearer ${o}`}})}}Object.assign(kd.prototype,nme());Object.assign(kd.prototype,rme());Object.assign(kd.prototype,ame());const{ElvClient:cme}=H8,fme=ki;var dme=cme,uh=fme;const Tz=Object.freeze(Object.defineProperty({__proto__:null,ElvClient:dme,Utils:uh},Symbol.toStringTag,{value:"Module"})),zP={default:{label:"Default",hlsSettings:uh.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class pme{constructor({player:e}){this.player=e,this.visible=!0,this.allowRotation=!0,this._activeMenus=0}__ToggleMenu(e){this._activeMenus=e?this._activeMenus+1:Math.max(0,this._activeMenus-1),this.player.__SettingsUpdate()}IsVisible(){return this.visible}IsMenuVisible(){return this._activeMenus>0}IsReady(){return!this.player.loading}IsPlaying(){return!this.player.video.paused}HasPlaybackStarted(){return this.player.playbackStarted}async Play(){return await this.player.__Play()}Pause(){this.player.video.pause()}TogglePlay(){return this.player.video.paused?(this.Play(),!0):(this.Pause(),!1)}Stop(){this.Pause(),this.Seek({time:0}),this.player.playbackStarted=!1,this.player.__SettingsUpdate()}GetCurrentTime(){return this.player.video.currentTime}GetDuration(){return this.player.video.duration}Seek({fraction:e,time:t,relativeSeconds:r}){if(!this.player.video||e&&!this.player.video.duration)return;const i=this.player.video.currentTime;return r?this.player.video.currentTime=Math.max(0,Math.min(this.player.video.duration,this.player.video.currentTime+r)):typeof e<"u"?this.player.video.currentTime=this.player.video.duration*e:this.player.video.currentTime=t,i<=this.player.video.currentTime}GetVolume(){return this.player.video.volume}SetVolume({fraction:e,relativeFraction:t}){return t?this.player.video.volume=Math.min(1,Math.max(0,this.GetVolume()+t)):this.player.video.volume=e,this.player.video.volume>0&&this.Unmute(!1),this.player.video.volume}IsMuted(){return this.player.video.muted}Mute(){this.player.video.muted=!0}Unmute(){this.player.video.muted=!1}ToggleMuted(){return this.player.video.muted=!this.player.video.muted,this.player.video.muted}IsFullscreen(){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===this.player.target}Fullscreen(){this.player.target.requestFullscreen?this.player.target.requestFullscreen({navigationUI:"hide"}):this.player.target.mozRequestFullScreen?this.player.target.mozRequestFullScreen({navigationUI:"hide"}):this.player.target.webkitRequestFullscreen?this.player.target.webkitRequestFullscreen({navigationUI:"hide"}):this.player.target.msRequestFullscreen?this.player.target.msRequestFullscreen({navigationUI:"hide"}):this.player.target.querySelector("video").webkitEnterFullScreen()}ExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}ToggleFullscreen(){return this.IsFullscreen()?(this.ExitFullscreen(),!1):(this.Fullscreen(),!0)}GetCollectionInfo(){if(!this.player.collectionInfo)return;const e={...this.player.collectionInfo};return e.content=e.content.map(t=>({...t,active:t.mediaIndex===e.mediaIndex})),e.active=e.content[e.mediaIndex],e}CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){this.player.loading||(this.player.__CollectionPlay({mediaId:t,mediaIndex:e,autoplay:r}),this.player.__SettingsUpdate())}CollectionPlayNext({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.min(t.mediaIndex+1,t.mediaLength-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}CollectionPlayPrevious({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.max(0,t.mediaIndex-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}IsLive(){return this.player.isLive}GetContentInfo(){if(this.player.playerOptions.title!==!1){const e=this.GetCollectionInfo();if(e&&e.active)return{title:e.active.title||"",subtitle:e.active.title||"",description:e.active.description||"",image:e.active.image&&e.active.image.url||"",posterImage:e.active.poster_image&&e.active.poster_image.url||"",headers:e.active.headers||[]};if(this.player.sourceOptions.contentInfo)return{title:this.player.sourceOptions.contentInfo.title,subtitle:this.player.sourceOptions.contentInfo.subtitle,description:this.player.sourceOptions.contentInfo.description,image:this.player.sourceOptions.contentInfo.image,posterImage:this.player.sourceOptions.contentInfo.posterImage,headers:this.player.sourceOptions.contentInfo.headers||[]}}}GetQualityLevels(){let e=[];if(this.player.hlsPlayer){if(e=this.player.hlsPlayer.levels.map((t,r)=>({index:r,active:this.player.hlsPlayer.currentLevel===r&&!this.player.hlsPlayer.autoLevelEnabled,resolution:t.attrs.RESOLUTION,bitrate:t.bitrate,audioTrack:!t.videoCodec,label:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1),e.length>0){const t=e.find(r=>this.player.hlsPlayer.currentLevel===r.index);e.unshift({index:-1,label:"Auto",activeLabel:t?`Auto (${t.activeLabel})`:"Auto",active:this.player.hlsPlayer.autoLevelEnabled})}}else this.player.dashPlayer&&(e=this.player.dashPlayer.getBitrateInfoListFor("video").map(t=>({index:t.qualityIndex,active:t.qualityIndex===this.player.dashPlayer.getQualityFor("video"),resolution:`${t.width}x${t.height}`,bitrate:t.bitrate,label:`${t.width}x${t.height} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:`${t.width}x${t.height}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1));return{options:e,active:e.find(t=>t.active)}}SetQualityLevel(e){this.player.hlsPlayer?(this.player.hlsPlayer.nextLevel=e,this.player.hlsPlayer.streamController.immediateLevelSwitch()):this.player.dashPlayer&&(this.player.dashPlayer.setQualityFor("video",e),this.player.dashPlayer.updateSettings({streaming:{trackSwitchMode:"alwaysReplace",buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0},abr:{autoSwitchBitrate:{video:e===-1}}}})),this.player.__SettingsUpdate()}GetAudioTracks(){let e=[];return this.player.nativeHLS?e=Array.from(this.player.video.audioTracks).map(t=>({index:t.id,label:t.label||t.language,active:t.enabled})):this.player.hlsPlayer?e=this.player.hlsPlayer.audioTracks.map(t=>({index:t.id,label:t.name,active:t.id===this.player.hlsPlayer.audioTrack})):this.player.dashPlayer&&(e=this.player.dashPlayer.getTracksFor("audio").map(t=>({index:t.index,label:t.labels&&t.labels.length>0?t.labels[0].text:t.lang,active:t.index===this.player.dashPlayer.getCurrentTrackFor("audio").index}))),{options:e,active:e.find(t=>t.active)}}SetAudioTrack(e){if(this.player.nativeHLS)Array.from(this.player.video.audioTracks).forEach(t=>t.enabled=e.toString()===t.id);else if(this.player.hlsPlayer)this.player.hlsPlayer.audioTrack=e,this.player.hlsPlayer.streamController.immediateLevelSwitch();else if(this.player.dashPlayer){const t=this.player.dashPlayer.getTracksFor("audio").find(r=>r.index===e);this.player.dashPlayer.setCurrentTrack(t)}}GetTextTracks(){let e=[],t;return this.player.nativeHLS||this.player.hlsPlayer?(t=Array.from(this.player.video.textTracks).findIndex(r=>r.mode==="showing"),e=Array.from(this.player.video.textTracks).map((r,i)=>({index:i,label:r.label||r.language,language:r.language,active:r.mode==="showing"}))):this.player.dashPlayer&&(t=this.player.dashPlayer.getCurrentTextTrackIndex(),e=this.player.dashPlayer.getTracksFor("text").map((r,i)=>({index:i,label:r.labels&&r.labels.length>0?r.labels[0].text:r.lang,language:r.lang,active:i===t}))),e.length>0&&e.unshift({index:-1,label:"Disabled",active:t<0}),{options:e,active:e.find(r=>r.active)}}SetTextTrack(e){if(e=parseInt(e),this.player.nativeHLS||this.player.hlsPlayer){const t=Array.from(this.player.video.textTracks);t.map(r=>r.mode="disabled"),e>=0&&(t[e].mode="showing")}else this.player.dashPlayer&&this.player.dashPlayer.setTextTrack(parseInt(e));e>=0&&(this.__lastTextTrackIndex=e)}ToggleTextTrack(){const{active:e,options:t}=this.GetTextTracks();if(t.length!==0){if(e&&e.index>=0)return this.SetTextTrack(-1),!1;if(this.__lastTextTrackIndex>=0)return this.SetTextTrack(this.__lastTextTrackIndex),!0;for(const r of navigator.languages){const i=t.find(o=>o.language===r||o.language===r.split("-")[0]);if(i)return this.SetTextTrack(i.index),!0}return this.SetTextTrack(0),!0}}GetPlaybackRates(){const e=["0.25","0.5","0.75","1","1.25","1.5","1.75","2"].map((r,i)=>({index:i,rate:parseFloat(r),label:`${r}x`,active:this.player.video.playbackRate.toFixed(2)===parseFloat(r).toFixed(2)}));let t=e.find(r=>r.active);return t||(t={index:-1,rate:this.player.video.playbackRate,label:`${this.player.video.playbackRate}x`,active:!0}),{options:e,active:t}}SetPlaybackRate({index:e,rate:t}){const r=this.player.video.playbackRate;if(t)return this.player.video.playbackRate=t,this.player.__SettingsUpdate(),{rate:t,increase:r<=t};{const i=this.GetPlaybackRates().options[e];if(i)return this.player.video.playbackRate=i.rate,this.player.__SettingsUpdate(),{rate:i.rate,increase:r<=i.rate}}}GetPlayerProfiles(){let e=[];return this.player.hlsPlayer&&(e=Object.keys(zP).map(t=>({index:t,label:zP[t].label,active:this.player.playerOptions.playerProfile===t}))),{options:e,active:e.find(t=>t.active)}}SetPlayerProfile({profile:e,customOptions:t={}}){this.player.SetPlayerProfile({profile:e,customHLSOptions:t})}ShowPlayerProfileForm(){this.player.__showPlayerProfileForm=!0,this.player.__SettingsUpdate()}HidePlayerProfileForm(){this.player.__showPlayerProfileForm=!1,this.player.__SettingsUpdate()}ContentVerified(){return this.player.contentVerified||!1}GetContentVerificationDetails(){return this.player.contentAudit||!1}GetOptions(){let e={quality:this.GetQualityLevels(),audio:this.GetAudioTracks(),text:this.GetTextTracks(),profile:this.GetPlayerProfiles(),rate:this.GetPlaybackRates()};return e.hasQualityOptions=e.quality.options.length>0,e.hasAudioOptions=e.audio.options.length>0,e.hasTextOptions=e.text.options.length>0,e.hasProfileOptons=e.profile.options.length>0,e.hasRateOptions=!this.IsLive(),e.hasAnyOptions=e.hasQualityOptions||e.hasAudioOptions||e.hasTextOptions||e.hasProfileOptons||e.hasRateOptions,e}AllowRotation(){return this.allowRotation}SetAllowRotation(e){this.allowRotation=e,this.player.__SettingsUpdate()}IsRotatable(){return this.IsFullscreen()&&window.innerWidth<900&&window.innerHeight>window.innerWidth&&this.player.video.videoWidth>this.player.video.videoHeight}RegisterVideoEventListener(e,t){return this.player.__RegisterVideoEventListener(e,t)}RegisterSettingsListener(e){return this.player.__RegisterSettingsListener(e)}Reset(){this.player.Reset()}Destroy(){this.player.Destroy()}}const Pn={PLAY:"play",PAUSE:"pause",MUTE:"muted",UNMUTE:"unmuted",VOLUME_UP:"volumeup",VOLUME_DOWN:"volumedown",SEEK_BACK:"seekback",SEEK_FORWARD:"seekforward",PLAYBACK_RATE_UP:"playbackrateup",PLAYBACK_RATE_DOWN:"playbackratedown",SUBTITLES_ON:"subtitleson",SUBTITLES_OFF:"subtitlesoff",PLAY_NEXT:"playnext",PLAY_PREVIOUS:"playprevious"},Rz=({player:n,setRecentUserAction:e,sideClickRatio:t=.1,doubleClickDelay:r=300})=>{let i,o,u,c;return window.addEventListener("focus",()=>{u=c||document.activeElement,c=document.activeElement},!0),()=>p=>{if(clearTimeout(o),p.target===p.currentTarget&&p.currentTarget.contains(u)&&!p.currentTarget.classList.contains("menu-active"))if(Date.now()-i<r){const h=p.target.getBoundingClientRect(),m=(p.clientX-h.left)/h.width;m<=t?(n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"})):m>=1-t?(n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"})):n.controls.ToggleFullscreen()}else o=setTimeout(()=>{const h=n.controls.TogglePlay();e({action:h?Pn.PLAY:Pn.PAUSE})},r);u=p.target,i=Date.now()}},Oz=(n,e)=>{let t=0;return()=>r=>{r.repeat||(t=0);const i=t<5?5:t<15?10:t<40?30:60;switch(r.key){case"ArrowLeft":r.preventDefault(),n.controls.Seek({relativeSeconds:-i}),e({action:Pn.SEEK_BACK,text:`${i} seconds`});break;case"ArrowRight":r.preventDefault(),n.controls.Seek({relativeSeconds:i}),e({action:Pn.SEEK_FORWARD,text:`${i} seconds`});break;default:return}t+=1}},hme=n=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),n.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),n.controls.IsMuted()?n.controls.SetVolume({fraction:.05}):n.controls.SetVolume({relativeFraction:.05});break}},s2=(n,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=n>60*60,r=Math.floor(n/60/60),i=Math.floor(n/60%60),o=Math.floor(n%60);let u=`${i.toString().padStart(t?2:1,"0")}:${o.toString().padStart(2,"0")}`;return t&&(u=`${r.toString()}:${u}`),u},dk=async({player:n,pathOrUrl:e="",width:t})=>{if(typeof e=="string"&&(e.startsWith("http://")||e.startsWith("https://")))return e;if(e&&e.url)return e.url;const r=await n.__Client();let i;const{mediaCatalogObjectId:o,mediaCatalogVersionHash:u}=n.sourceOptions&&n.sourceOptions.mediaCollectionOptions||{},c=n.sourceOptions&&n.sourceOptions.playoutParameters||{};return u?i=u:o?i=await r.LatestVersionHash({objectId:o}):c.versionHash?i=c.versionHash:i=await r.LatestVersionHash({objectId:c.objectId}),i?(e=e&&e.toString().trim().replace(/^\./,"").replace(/\/+/,""),e.startsWith("files")?await r.FileUrl({versionHash:i,filePath:e.replace(/^files/,""),queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken}):await r.LinkUrl({versionHash:i,linkPath:e,queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken})):""},Lz=(n,e)=>{let t={};return Object.keys(n).forEach(r=>{if(typeof n[r]=="object"&&!Array.isArray(n[r]))t[r]=Lz(n[r],(e||{})[r]);else{const i=(e||{})[r];t[r]=typeof i<"u"?i:n[r]}}),t},Nz=n=>Lz(BG,n),yme={default:{label:"Default",hlsSettings:uh.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class o2{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t),this.__listenerDisposers.push(()=>this.video.removeEventListener(e,t))}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:r,SetErrorMessage:i}){this.loading=!0,this.target=e,this.video=t,this.SetErrorMessage=i,this.controls=new pme({player:this}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.playbackStarted=!1,this.reloads=0,this.canPlay=!1,this.isLive=!1,this.dvrEnabled=!1,this.behindLiveEdge=!1,this.publicMetadataUrl=void 0;try{r.playerOptions.hlsjsOptions&&Object.keys(r.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=r.playerOptions.hlsjsOptions,r.playerOptions.playerProfile=jt.playerProfile.CUSTOM)}catch(o){this.Log(o,!0)}this.__Initialize(r)}async __Client(){return this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>Tz);return this.clientOptions.client=await e.FromConfigurationUrl({configUrl:this.clientOptions.network}),this.clientOptions.client.SetStaticToken({token:this.clientOptions.staticToken||this.clientOptions.client.utils.B64(JSON.stringify({qspace_id:await this.clientOptions.client.ContentSpaceId()}))}),this.clientOptions.client})(),await this.clientPromise),this.clientOptions.client}async __PlayoutOptions(){const e=await this.__Client(),t=this.sourceOptions.playoutParameters||{};if(this.collectionInfo){const A=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(A.mediaHash).objectId,t.versionHash=A.mediaHash,this.sourceOptions.playoutOptions=void 0}let r,i,o={};(t.clipStart||t.clipEnd)&&(o.clip_start=parseFloat(t.clipStart||0),t.clipEnd&&(o.clip_end=parseFloat(t.clipEnd)));let u=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(r=u.default?"default":Object.keys(u)[0],t.offering?r=u[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?r=t.offerings.find(A=>u[A]):t.offerings&&t.offerings.length>0&&(r=t.offerings.find(A=>u[A])),!r)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const c=u[r]&&u[r].properties||{};i=u[r].uri,o.ignore_trimming=t.ignoreTrimming,o.resolve=t.resolve,this.sourceOptions.contentInfo.liveDVR===jt.liveDVR.ON&&c.dvr_available?(o.dvr=1,this.dvrEnabled=!0):this.dvrEnabled=!1,c.live?this.isLive=!0:this.isLive=!1,t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:i,options:o})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,offering:r,options:o}));let p=(await e.AvailableDRMs()).filter(A=>(this.sourceOptions.drms||[]).includes(A)),h=this.sourceOptions.protocols,m,w;for(;!(m&&w);)if(m=h.find(A=>this.sourceOptions.playoutOptions[A]),w=this.sourceOptions.drms.find(A=>p.includes(A)&&this.sourceOptions.playoutOptions[m].playoutMethods[A]),!w&&(h=h.filter(A=>A!==m),h.length===0))throw Error("No valid protocol / DRM combination available");const{playoutUrl:b,drms:g}=this.sourceOptions.playoutOptions[m].playoutMethods[w],S=b.split("/").find(A=>A.startsWith("hq__"));return{protocol:m,drm:w,playoutUrl:b,versionHash:S,drms:g,availableDRMs:p,offeringURI:i,offering:r,sessionId:this.sourceOptions.playoutOptions.sessionId,multiviewOptions:{enabled:this.sourceOptions.playoutOptions.multiview,AvailableViews:this.sourceOptions.playoutOptions.AvailableViews,SwitchView:this.sourceOptions.playoutOptions.SwitchView}}}__CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){t&&(e=this.collectionInfo.content.find(i=>i.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof r<"u"?r:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:r}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!r)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const i=await this.__Client();try{const o=this.sourceOptions.playoutParameters.authorizationToken;t=t||await i.LatestVersionHash({objectId:e});const c=(await i.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:o,produceLinkUrls:!0})||[]).find(p=>p.id===r);if(!c)throw{displayMessage:`No collection with ID ${r} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,h)=>({...p,active:h===0,mediaId:p.id,mediaIndex:h,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(m=>m.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(o){throw this.Log("Failed to load collection:"),o}}async __Initialize(e,t){if(!this.__destroyed){this.__Reset(),this.loading=!0,this.initTime=Date.now(),this.__SettingsUpdate(),e&&(this.originalParameters=Nz(e),this.clientOptions=e.clientOptions,this.sourceOptions=e.sourceOptions,this.playerOptions=e.playerOptions),this.errors=0,this.__Client();try{t&&(this.video.volume=t.volume,this.video.muted=t.muted,t.playing&&(this.playerOptions.autoplay=jt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.__RegisterVideoEventListener("play",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate()}),this.__RegisterVideoEventListener("canplay",()=>{this.initTime&&!this.initTimeLogged&&(this.Log(`Player initialization: ${((Date.now()-this.initTime)/1e3).toFixed(2)} seconds`),this.initTimeLogged=!0,this.canPlay=!0,this.playerOptions.autoplay===jt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrEnabled)return;const m=this.video.duration-this.video.currentTime;this.behindLiveEdge=m>15,this.__SettingsUpdate()}),await this.__LoadCollection(),this.collectionInfo&&this.collectionInfo.isPlaylist&&this.collectionInfo.mediaIndex<this.collectionInfo.mediaLength-1&&this.__RegisterVideoEventListener("ended",()=>this.controls&&this.controls.CollectionPlayNext({autoplay:!0}));let{versionHash:r,playoutUrl:i,protocol:o,drm:u,drms:c,multiviewOptions:p}=await this.__PlayoutOptions();this.contentHash=r,i=new URL(i);const h=this.sourceOptions.playoutParameters.authorizationToken||i.searchParams.get("authorization");if(this.authorizationToken=h,this.__destroyed)return;o==="hls"?await this.__InitializeHLS({playoutUrl:i,authorizationToken:h,drm:u,drms:c,multiviewOptions:p}):await this.__InitializeDash({playoutUrl:i,authorizationToken:h,drm:u,drms:c,multiviewOptions:p}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-B6MHUb3Q.js")).then(({InitializeMuxMonitoring:m})=>m({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:i,authorizationToken:h,disableCookies:this.playerOptions.collectVideoAnalytics===jt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.playerCallback&&this.playerOptions.playerCallback({player:this,videoElement:this.video,hlsPlayer:this.hlsPlayer,dashPlayer:this.dashPlayer}),this.__destroyed&&this.__DestroyPlayer()}catch(r){let i;if(r&&[401,403].includes(r.status)||[401,403].includes(r.code))try{const o=await this.__Client(),u=this.sourceOptions.playoutParameters.linkPath?await o.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await o.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});i=await o.ContentObjectMetadata({versionHash:u,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),i?(r.permission_message=i,this.SetErrorMessage(i),typeof r=="object"?r.permission_message=i:this.Log(i,!0)):this.SetErrorMessage(r.displayMessage||"Insufficient permissions")}catch(o){this.SetErrorMessage(o.displayMessage||"Insufficient permissions")}else r.status>=500?this.__HardReload(r,1e4):this.SetErrorMessage(r.displayMessage||"Something went wrong");this.playerOptions.errorCallback&&this.playerOptions.errorCallback(r,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,drms:i,multiviewOptions:o}){if(this.HLS=(await Promise.resolve().then(()=>require("./hls-VH5py-kh.js"))).default,[jt.drms.FAIRPLAY,jt.drms.SAMPLE_AES].includes(r)||!this.HLS.isSupported()){if(this.nativeHLS=!0,r===jt.drms.FAIRPLAY?cW({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),o.enabled){const u=o.SwitchView;o.SwitchView=async c=>{await u(c)}}}else{e.searchParams.delete("authorization");let u={};(r===jt.drms.PLAYREADY||r===jt.drms.WIDEVINE)&&(u={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(m,w)=>{m.open("POST",w,!0),m.setRequestHeader("Authorization",`Bearer ${t}`)}},r===jt.drms.PLAYREADY?u.drmSystems={"com.microsoft.playready":{licenseUrl:i[r].licenseServers[0]}}:r===jt.drms.WIDEVINE&&(u.drmSystems={"com.widevine.alpha":{licenseUrl:i[r].licenseServers[0]}}));const c=(yme[this.playerOptions.playerProfile]||{}).hlsSettings||{},p=this.playerOptions.playerProfile===jt.playerProfile.CUSTOM?this.customHLSOptions:{};this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:m=>(m.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(m),m),...u,...c,...p},this.dvrEnabled&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const h=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&h.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:w,firstLevel:b})=>{let g=w.map((S,A)=>S.bitrate>this.playerOptions.maxBitrate?A:void 0).filter(S=>typeof S<"u").reverse();g.length===w.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),g=g.filter(S=>S>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(g.map(S=>[w[S].width,"x",w[S].height,` (${(w[S].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),g.find(S=>b===S)&&(h.startLevel=w.map((S,A)=>A).filter(S=>!g.includes(S)).reverse()[0]),g.map(S=>h.removeLevel(S))}),h.loadSource(e.toString()),h.attachMedia(this.video),this.controls&&o.enabled){const m=o.SwitchView;o.SwitchView=async w=>{await m(w),h.nextLevel=h.currentLevel},this.controls.InitializeMultiViewControls(o)}[this.HLS.Events.SUBTITLE_TRACKS_UPDATED,this.HLS.Events.SUBTITLE_TRACK_SWITCH,this.HLS.Events.LEVEL_UPDATED,this.HLS.Events.LEVEL_SWITCHED,this.HLS.Events.AUDIO_TRACKS_UPDATED,this.HLS.Events.AUDIO_TRACK_SWITCHED,this.HLS.Events.MANIFEST_LOADED].map(m=>h.on(m,()=>this.__SettingsUpdate())),this.SetPlayerProfile=async({profile:m,customHLSOptions:w={}})=>{this.videoDuration=void 0,this.playerOptions.playerProfile=m,this.customHLSOptions=w;const b=!this.video.paused,g=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(S){this.Log("Failed to destroy HLS player",!0),this.Log(S,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,multiviewOptions:o}),b?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=g)},h.on(this.HLS.Events.FRAG_LOADED,()=>this.errors=0),h.on(this.HLS.Events.ERROR,async(m,w)=>{this.errors+=1,this.Log(`Encountered ${w.details}`,!0),this.Log(w,!0),w.response&&w.response.code===403?this.SetErrorMessage("Insufficient permissions"):this.errors<5?w.fatal&&(w.data&&w.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError"),h.recoverMediaError()):this.__HardReload(w)):this.__HardReload(w)}),this.hlsPlayer=h,this.player=h}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:r,drms:i}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-BgLUy4QY.js")).then(c=>c.dash_all_min)).default;const o=this.Dash.MediaPlayer().create(),u=this.playerOptions.dashjsOptions||{};if(o.updateSettings({...u,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(u.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(u.streaming||{}).text||{}},...u.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&o.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&o.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),e.searchParams.delete("authorization"),o.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),r===jt.drms.WIDEVINE){const c=i.widevine.licenseServers[0];o.setProtectionData({"com.widevine.alpha":{serverURL:c}})}o.initialize(this.video,e.toString(),this.playerOptions.autoplay===jt.autoplay.ON),[this.Dash.MediaPlayer.events.TRACK_CHANGE_RENDERED,this.Dash.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.Dash.MediaPlayer.events.REPRESENTATION_SWITCH,this.Dash.MediaPlayer.events.TEXT_TRACKS_ADDED,this.Dash.MediaPlayer.events.TEXT_TRACK_ADDED,this.Dash.MediaPlayer.events.MANIFEST_LOADED,this.Dash.MediaPlayer.events.CAN_PLAY].map(c=>o.on(c,()=>this.__SettingsUpdate())),o.on(this.Dash.MediaPlayer.events.METRIC_CHANGED,c=>{!c||c.mediaType!=="text"||this.__SettingsUpdate()}),this.player=o,this.dashPlayer=o}async __Play(){try{return await this.video.play(),!0}catch(e){if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===jt.muted.OFF_IF_POSSIBLE&&this.video.paused&&!this.video.muted){await new Promise(t=>setTimeout(t,250)),this.Log("Attempting to autoplay muted"),this.video.muted=!0;try{return await this.video.play(),!0}catch{return this.playbackStarted=!1,!1}}else return this.playbackStarted=!1,!1}}async __PublicMetadataUrl({versionHash:e,authorizationToken:t}){const r=await this.__Client();let i=!1;try{await r.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{i=!0}let o=new URL(r.NetworkInfo().name==="main"?"https://main.net955305.contentfabric.io":"https://demov3.net955210.contentfabric.io"),u=`s/${r.NetworkInfo().name}`;return i&&(u=`t/${t}`),o.pathname=`${u}/q/${e}/meta/public`,o.toString()}async __VerifyContent(){if(!this.contentHash)return;const e=await this.__Client(),t=this.isLive?await e.AuditStream({versionHash:this.contentHash,authorizationToken:this.authorizationToken}):await e.AuditContentObject({versionHash:this.contentHash,authorizationToken:this.authorizationToken});if(!t.verified)return;t.verifiedAt=Date.now();const r=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:r,address:e.utils.HashToAddress(r),signatureMethod:"ECDSA secp256k1"},this.contentAudit=t,this.contentVerified=t.verified,this.publicMetadataUrl=await this.__PublicMetadataUrl({versionHash:this.contentHash,authorizationToken:this.authorizationToken}),this.__SettingsUpdate()}async __LoadVerificationDetails(){if(!this.contentHash||!this.contentAudit||this.contentAudit.details._state!=="initial"||this.contentAudit.loading)return;this.contentAudit.loading=!0;const e=await this.__Client(),t=e.utils.DecodeVersionHash(this.contentHash).objectId,r=await e.ContentObjectTenantId({objectId:t});let i,o,u;try{o=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),o&&(o=new Date(parseInt(o._hex,16)*1e3)),u=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),u&&(u=parseInt(u._hex,16))}catch{}try{i=await e.ContentObjectMetadata({libraryId:e.contentSpaceLibraryId,objectId:r.replace("iten","iq__"),metadataSubtree:"/public/name"})}catch{}this.contentAudit.details={_state:"minus-tx",versionHash:this.contentHash,objectId:t,address:e.utils.HashToAddress(t),explorerUrl:e.NetworkInfo().name!=="main"?void 0:`https://explorer.contentfabric.io/address/${e.utils.HashToAddress(t)}`,tenantId:r,tenantAddress:e.utils.HashToAddress(r),tenantName:i,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:o,versionCount:u,latestVersionHash:await e.LatestVersionHash({objectId:t}),signatureMethod:"ECDSA secp256k1"},this.__SettingsUpdate();try{if(e.NetworkInfo().name==="main"){const c=new URL("https://explorer.contentfabric.io/api");c.searchParams.set("module","account"),c.searchParams.set("action","txlist"),c.searchParams.set("offset","1"),c.searchParams.set("address",e.utils.HashToAddress(t)),this.contentAudit.details.latestTransactionHash=(await(await fetch(c)).json()).result[0].hash,this.contentAudit.details.latestTransactionHashUrl=`https://explorer.contentfabric.io/tx/${this.contentAudit.details.latestTransactionHash}`}}catch{}finally{this.contentAudit.details._state="full",delete this.contentAudit.loading,this.__SettingsUpdate()}}__SettingsUpdate(){this.__settingsListeners.forEach(e=>{try{e()}catch(t){this.Log("Failed to call settings listener",!0),this.Log(t,!0)}})}__SetControlsVisibility(e){this.controls.visible!==e&&(this.controls.visible=e,this.__SettingsUpdate())}__DestroyPlayer(){this.__destroyed=!0,this.__Reset()}__Reset(){if(this.player){this.Log("Destroying player"),this.video&&this.video.pause();try{this.hlsPlayer?this.hlsPlayer.destroy():this.dashPlayer&&this.dashPlayer.destroy()}catch(e){this.Log("Failed to destroy abr player",!0),this.Log(e,!0)}if(this.__listenerDisposers.forEach(e=>{try{e()}catch(t){this.Log("Failed to dispose of video event listener",!0),this.Log(t,!0)}}),this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.video.mux)try{this.video.mux.destroy()}catch(e){this.Log("Error destroying mux monitoring:"),this.Log(e)}this.contentHash=void 0,this.nativeHLS=!1,this.hlsPlayer=void 0,this.dashPlayer=void 0,this.player=void 0,this.initTimeLogged=!1,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0}}async __HardReload(e,t=6e3){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content");return}try{if(e&&this.playerOptions.restartCallback)try{const r=await this.playerOptions.restartCallback(e);if(r&&typeof r=="boolean"){this.Destroy();return}}catch(r){this.Log("Restart callback failed:"),this.Log(r)}if(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player..."),await new Promise(r=>setTimeout(r,t)),this.__destroyed)return;this.Log("Reloading stream");try{const r=await this.__Client();r.region?await r.UseRegion({region:r.region}):r.Nodes().fabricURIs.length>1&&await r.ResetRegion()}catch(r){this.Log("Client region reset failed:"),this.Log(r)}this.restarted=!0,this.SetErrorMessage(void 0),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,currentTime:this.video.currentTime,playing:!this.video.paused}:null)}finally{this.reloading=!1}}}Log(e,t=!1){t?console.error("ELUVIO PLAYER:",e):this.playerOptions.debugLogging&&console.warn("ELUVIO PLAYER:",e)}}o2.EluvioPlayerParameters=jt;o2.EluvioPlayer=o2;var Pz=function(){if(typeof Map<"u")return Map;function n(e,t){var r=-1;return e.some(function(i,o){return i[0]===t?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(t,r){var i=n(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,i=n(r,t);~i&&r.splice(i,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var u=o[i];t.call(r,u[1],u[0])}},e}()}(),z8=typeof window<"u"&&typeof document<"u"&&window.document===document,u2=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),mme=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(u2):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),gme=2;function vme(n,e){var t=!1,r=!1,i=0;function o(){t&&(t=!1,n()),r&&c()}function u(){mme(o)}function c(){var p=Date.now();if(t){if(p-i<gme)return;r=!0}else t=!0,r=!1,setTimeout(u,e);i=p}return c}var bme=20,wme=["top","right","bottom","left","width","height","size","weight"],xme=typeof MutationObserver<"u",_me=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=vme(this.refresh.bind(this),bme)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!z8||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xme?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!z8||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,i=wme.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),Iz=function(n,e){for(var t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];Object.defineProperty(n,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return n},im=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||u2},Dz=l3(0,0,0,0);function l2(n){return parseFloat(n)||0}function jP(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(r,i){var o=n["border-"+i+"-width"];return r+l2(o)},0)}function Sme(n){for(var e=["top","right","bottom","left"],t={},r=0,i=e;r<i.length;r++){var o=i[r],u=n["padding-"+o];t[o]=l2(u)}return t}function Cme(n){var e=n.getBBox();return l3(0,0,e.width,e.height)}function Eme(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return Dz;var r=im(n).getComputedStyle(n),i=Sme(r),o=i.left+i.right,u=i.top+i.bottom,c=l2(r.width),p=l2(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+o)!==e&&(c-=jP(r,"left","right")+o),Math.round(p+u)!==t&&(p-=jP(r,"top","bottom")+u)),!kme(n)){var h=Math.round(c+o)-e,m=Math.round(p+u)-t;Math.abs(h)!==1&&(c-=h),Math.abs(m)!==1&&(p-=m)}return l3(i.left,i.top,c,p)}var Ame=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof im(n).SVGGraphicsElement}:function(n){return n instanceof im(n).SVGElement&&typeof n.getBBox=="function"}}();function kme(n){return n===im(n).document.documentElement}function Mme(n){return z8?Ame(n)?Cme(n):Eme(n):Dz}function Tme(n){var e=n.x,t=n.y,r=n.width,i=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return Iz(u,{x:e,y:t,width:r,height:i,top:t,right:e+r,bottom:i+t,left:e}),u}function l3(n,e,t,r){return{x:n,y:e,width:t,height:r}}var Rme=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=l3(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=Mme(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n}(),Ome=function(){function n(e,t){var r=Tme(t);Iz(this,{target:e,contentRect:r})}return n}(),Lme=function(){function n(e,t,r){if(this.activeObservations_=[],this.observations_=new Pz,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof im(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Rme(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof im(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new Ome(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),Uz=typeof WeakMap<"u"?new WeakMap:new Pz,Fz=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=_me.getInstance(),r=new Lme(e,t,this);Uz.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){Fz.prototype[n]=function(){var e;return(e=Uz.get(this))[n].apply(e,arguments)}});var Nme=function(){return typeof u2.ResizeObserver<"u"?u2.ResizeObserver:Fz}();const c3=({element:n,Hide:e})=>{if(!n)return;const t=o=>{o&&(o.key||"").toLowerCase()==="escape"&&e()},r=o=>{n.contains(o.target)||e()};let i=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",r,!0)},0);return()=>{clearTimeout(i),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",r,!0)}},Bz=({target:n,video:e,setVideoState:t})=>{const r=function(){const o=e.buffered;let u=0;for(let c=0;c<o.length;c++)o.start(c)>e.currentTime||o.end(c)>u&&(u=o.end(c));t({playing:!e.paused,duration:e.duration,volume:e.volume,muted:e.muted,rate:e.playbackRate,fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},i=["play","pause","volumechange","seeked","durationchange","ratechange"];return i.map(o=>e.addEventListener(o,r)),n.addEventListener("fullscreenchange",r),()=>{i.map(o=>e.removeEventListener(o,r)),n.removeEventListener("fullscreenchange",r)}},Pme=({video:n,setBufferFraction:e})=>{const t=()=>{if(!isFinite(n.duration))return 1;const r=n.buffered;let i=0;for(let o=0;o<r.length;o++)r.start(o)>n.currentTime||r.end(o)>i&&(i=r.end(o));e(1-(n.duration-i)/n.duration)};return n.addEventListener("progress",t),()=>n.removeEventListener("progress",t)},pk=({video:n,rate:e=10,setCurrentTime:t})=>{const r=setInterval(()=>{t(n.currentTime)},1e3/e);return()=>{clearInterval(r)}},Ime=({target:n,setSize:e,setOrientation:t,setDimensions:r})=>{let i;const o=()=>{clearTimeout(i);const c=n.getBoundingClientRect();let p="sm",h="landscape";c.width>1400&&c.height>600?p="xl":c.width>1e3&&c.height>400?p="lg":c.width>650&&c.height>300&&(p="md"),c.width<c.height&&(h="portrait"),e(p),t(h),i=setTimeout(()=>{r({width:c.width,height:c.height})},500)};o();const u=new Nme(o);return u.observe(n),()=>u.disconnect()},Dme=({player:n})=>{const e=n.video,t=n.playerOptions.autoplay===jt.autoplay.WHEN_VISIBLE,r=n.playerOptions.muted===jt.muted.WHEN_NOT_VISIBLE;if(!t&&!r)return;let i,o;const u=async([p])=>{t&&(i!=="play"&&p.isIntersecting&&e.paused?(n.controls.Play(),i="play"):i!=="pause"&&!p.isIntersecting&&!e.paused&&(n.controls.Pause(),i="pause")),r&&(o!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,o="unmute"):o!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,o="mute"))},c=new window.IntersectionObserver(u,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},Ume=({player:n,inactivityPeriod:e=3e3,onSleep:t,onWake:r})=>{let i;const o=p=>{clearTimeout(i),r&&r(),i=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},u=["play","pause","volumechange","seeking"];u.forEach(p=>n.video.addEventListener(p,o));const c=["click","dblclick","keydown","mousemove","touchmove","blur","mouseout","fullscreenchange"];return c.forEach(p=>n.target.addEventListener(p,o)),()=>{u.map(p=>n.video.removeEventListener(p,o)),c.map(p=>n.target.removeEventListener(p,o))}},Fme=({player:n,setRecentUserAction:e})=>{if(n.playerOptions.keyboardControls===jt.keyboardControls.OFF)return;const t=n.playerOptions.keyboardControls===jt.keyboardControls.ARROW_KEYS_DISABLED,r=Oz(n,e)(),i=o=>{if(!(n.target===o.target||n.target.contains(o.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||n.__showPlayerProfileForm)return;let u;switch(o.key){case" ":case"k":u=n.controls.TogglePlay(),e({action:u?Pn.PLAY:Pn.PAUSE});break;case"f":n.controls.ToggleFullscreen();break;case"m":u=n.controls.ToggleMuted(),e({action:u?Pn.MUTE:Pn.UNMUTE});break;case"ArrowDown":t||(u=n.controls.SetVolume({relativeFraction:-.1}),e({action:u===0?Pn.MUTE:Pn.VOLUME_DOWN,text:(u*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(u=n.controls.SetVolume({relativeFraction:.1}),e({action:Pn.VOLUME_UP,text:(u*100).toFixed(0)+"%"}));break;case",":n.video.paused&&(n.controls.Seek({relativeSeconds:-1/60}),e({action:Pn.SEEK_BACK}));break;case".":n.video.paused&&(n.controls.Seek({relativeSeconds:1/60}),e({action:Pn.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||r(o);break;case"j":n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"});break;case"l":n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=n.controls.GetPlaybackRates();c.active?u=n.controls.SetPlaybackRate({index:c.active.index+(o.key==="<"?-1:1)}):u=n.controls.SetPlaybackRate({rate:1}),e({action:u.increase?Pn.PLAYBACK_RATE_UP:Pn.PLAYBACK_RATE_DOWN,text:`${u.rate.toFixed(2)}x`});break;case"c":u=n.controls.ToggleTextTrack(),e({action:u?Pn.SUBTITLES_ON:Pn.SUBTITLES_OFF});break;case"P":n.controls.CollectionPlayPrevious(),e({action:Pn.PLAY_PREVIOUS});break;case"N":n.controls.CollectionPlayNext(),e({action:Pn.PLAY_NEXT});break;case"Home":n.controls.Seek({fraction:0}),e({action:Pn.SEEK_BACK});break;case"End":n.controls.Seek({fraction:1}),e({action:Pn.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u=n.controls.Seek({fraction:parseFloat(o.key)*.1}),e({action:u?Pn.SEEK_FORWARD:Pn.SEEK_BACK});break;default:return}o.preventDefault()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},Bme=({player:n})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(i=>{navigator.mediaSession.setActionHandler(i,o=>{switch(i){case"play":n.controls.Play();break;case"pause":n.controls.Pause();break;case"stop":n.controls.Stop();break;case"seekbackward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||-10});break;case"seekforward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||10});break;case"seekto":o&&typeof o.seekTime<"u"&&n.controls.Seek({time:o.seekTime});break;case"previoustrack":n.controls.CollectionPlayPrevious();break;case"nexttrack":n.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=n.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(n.video.duration)?n.video.duration||0:n.video.currentTime+1,playbackRate:n.video.playbackRate,position:n.video.currentTime})},1e3);const r=n.controls.RegisterSettingsListener(()=>{const{title:i}=n.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==i)&&(navigator.mediaSession.metadata=new MediaMetadata({title:i}))});return()=>{clearInterval(t),r&&r(),navigator.mediaSession.metadata=null,e.forEach(i=>{navigator.mediaSession.setActionHandler(i,null)})}}},zme="_container_11xc9_1",jme="_autohide_11xc9_41",$me="_seek_11xc9_162",Hme="_controls_11xc9_195",qme="_time_11xc9_209",Vme="_spacer_11xc9_267",Gme="_watermark_11xc9_279",Wme="_fadein_11xc9_1",Kme="_menu_11xc9_37",In={container:zme,"container--default-controls":"_container--default-controls_11xc9_33","bottom-controls-container":"_bottom-controls-container_11xc9_37",autohide:jme,"info-container":"_info-container_11xc9_44","bottom-controls-container--autohide":"_bottom-controls-container--autohide_11xc9_45","icon-button":"_icon-button_11xc9_51","icon-button-active":"_icon-button-active_11xc9_65","info-image-container":"_info-image-container_11xc9_94","info-image":"_info-image_11xc9_94","info-text":"_info-text_11xc9_110","info-headers":"_info-headers_11xc9_119","info-description":"_info-description_11xc9_129","info-title":"_info-title_11xc9_135","info-subtitle":"_info-subtitle_11xc9_140","center-play-button":"_center-play-button_11xc9_148","center-play-button--hidden":"_center-play-button--hidden_11xc9_155",seek:$me,"bottom-controls-gradient":"_bottom-controls-gradient_11xc9_182",controls:Hme,"play-pause-button":"_play-pause-button_11xc9_205",time:qme,"live-indicator":"_live-indicator_11xc9_219","live-indicator--faded":"_live-indicator--faded_11xc9_229","collection-button-container":"_collection-button-container_11xc9_237","collection-button-text":"_collection-button-text_11xc9_242","collection-button-container--loading":"_collection-button-container--loading_11xc9_251",spacer:Vme,"floating-volume-toggle":"_floating-volume-toggle_11xc9_271",watermark:Gme,"content-verified-badge":"_content-verified-badge_11xc9_290","content-verification-menu-button":"_content-verification-menu-button_11xc9_291",fadein:Wme,"menu-control-container":"_menu-control-container_11xc9_305",menu:Kme},zz='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="currentColor"/> <path d="M22 15.5L13.75 21.1292L13.75 9.87083L22 15.5Z" fill="black"/></svg>',jz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',$z='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><path d="M22.8,16l-11.6,7V9L22.8,16z" fill="black"/></svg>',Yme='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pause"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',Hz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><g> <rect x="10.4" y="9" width="4.5" height="14.1" fill="black"/> <rect x="17.5" y="9" width="4.5" height="14.1" fill="black"/></g></svg>',Jme='<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.46154 18.9985L5.84615 18.9942C6.03997 18.9942 6.22584 18.9172 6.36289 18.7801C6.49993 18.6431 6.57692 18.4572 6.57692 18.2634C6.57692 18.0696 6.49993 17.8837 6.36289 17.7467C6.22584 17.6096 6.03997 17.5326 5.84615 17.5326L1.46154 17.537V13.1538C1.46154 12.96 1.38455 12.7742 1.2475 12.6371C1.11046 12.5001 0.924581 12.4231 0.730769 12.4231C0.536957 12.4231 0.351083 12.5001 0.214037 12.6371C0.0769915 12.7742 0 12.96 0 13.1538V19H1.46154V18.9985ZM1.46154 0.00146249V3.57628e-07H0V5.84615C0 6.03997 0.0769915 6.22584 0.214037 6.36289C0.351083 6.49993 0.536957 6.57692 0.730769 6.57692C0.924581 6.57692 1.11046 6.49993 1.2475 6.36289C1.38455 6.22584 1.46154 6.03997 1.46154 5.84615V1.463L5.84615 1.46738C6.03997 1.46738 6.22584 1.39039 6.36289 1.25335C6.49993 1.1163 6.57692 0.930427 6.57692 0.736615C6.57692 0.542803 6.49993 0.35693 6.36289 0.219884C6.22584 0.0828385 6.03997 0.00584609 5.84615 0.00584609L1.46154 0.00146249V0.00146249ZM17.5385 18.9985V19H19V13.1538C19 12.96 18.923 12.7742 18.786 12.6371C18.6489 12.5001 18.463 12.4231 18.2692 12.4231C18.0754 12.4231 17.8895 12.5001 17.7525 12.6371C17.6155 12.7742 17.5385 12.96 17.5385 13.1538V17.537L13.1538 17.5326C12.96 17.5326 12.7742 17.6096 12.6371 17.7467C12.5001 17.8837 12.4231 18.0696 12.4231 18.2634C12.4231 18.4572 12.5001 18.6431 12.6371 18.7801C12.7742 18.9172 12.96 18.9942 13.1538 18.9942L17.5385 18.9985V18.9985ZM17.5385 0.00146249L13.1538 0.00584609C12.96 0.00584609 12.7742 0.0828385 12.6371 0.219884C12.5001 0.35693 12.4231 0.542803 12.4231 0.736615C12.4231 0.930427 12.5001 1.1163 12.6371 1.25335C12.7742 1.39039 12.96 1.46738 13.1538 1.46738L17.5385 1.463V5.84615C17.5385 6.03997 17.6155 6.22584 17.7525 6.36289C17.8895 6.49993 18.0754 6.57692 18.2692 6.57692C18.463 6.57692 18.6489 6.49993 18.786 6.36289C18.923 6.22584 19 6.03997 19 5.84615V3.57628e-07H17.5385V0.00146249V0.00146249Z" fill="currentColor"/></svg>',Qme='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51.94 50.82"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:4px;}</style></defs><polyline class="cls-1" points="12.1 49.82 12.1 35.59 1 35.59"/><polyline class="cls-1" points="39.84 1 39.84 15.22 50.94 15.22"/><polyline class="cls-1" points="12.1 1 12.1 15.22 1 15.22"/><polyline class="cls-1" points="39.84 49.82 39.84 35.59 50.94 35.59"/></svg>',Zme='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_363_9540)"><path d="M16.0889 9.77734C12.6223 9.77734 9.8667 12.5329 9.8667 15.9996C9.8667 19.4662 12.6223 22.2218 16.0889 22.2218C19.5556 22.2218 22.3111 19.4662 22.3111 15.9996C22.3111 12.5329 19.5556 9.77734 16.0889 9.77734ZM16.0889 20.444C13.6 20.444 11.6445 18.4885 11.6445 15.9996C11.6445 13.5107 13.6 11.5551 16.0889 11.5551C18.5778 11.5551 20.5334 13.5107 20.5334 15.9996C20.5334 18.4885 18.5778 20.444 16.0889 20.444Z" fill="currentColor"/><path d="M29.1556 13.0662L26.6667 12.2662L26.1334 10.9329L27.3778 8.62179C27.6445 8.08845 27.5556 7.37734 27.1112 6.9329L24.9778 4.79957C24.5334 4.35512 23.8223 4.26623 23.2889 4.5329L20.9778 5.77734L19.6445 5.24401L18.8445 2.75512C18.6667 2.22179 18.1334 1.77734 17.5112 1.77734H14.4889C13.8667 1.77734 13.3334 2.22179 13.2445 2.84401L12.4445 5.3329C11.9112 5.42179 11.4667 5.59957 11.0223 5.86623L8.71117 4.62179C8.17783 4.35512 7.46672 4.44401 7.02228 4.88845L4.88894 7.02179C4.4445 7.46623 4.35561 8.17734 4.62228 8.71068L5.77783 10.9329C5.60005 11.3773 5.42228 11.9107 5.2445 12.3551L2.75561 13.1551C2.22228 13.3329 1.77783 13.8662 1.77783 14.4885V17.5107C1.77783 18.1329 2.22228 18.6662 2.8445 18.844L5.33339 19.644L5.86672 20.9773L4.62228 23.2885C4.35561 23.8218 4.4445 24.5329 4.88894 24.9773L7.02228 27.1107C7.46672 27.5551 8.17783 27.644 8.71117 27.3773L11.0223 26.1329L12.3556 26.6662L13.1556 29.244C13.3334 29.7773 13.8667 30.2218 14.4889 30.2218H17.5112C18.1334 30.2218 18.6667 29.7773 18.8445 29.244L19.6445 26.6662L20.9778 26.1329L23.2889 27.3773C23.8223 27.644 24.5334 27.5551 24.9778 27.1107L27.1112 24.9773C27.5556 24.5329 27.6445 23.8218 27.3778 23.2885L26.1334 20.9773L26.6667 19.644L29.2445 18.844C29.7778 18.6662 30.2223 18.1329 30.2223 17.5107V14.4885C30.2223 13.8662 29.7778 13.244 29.1556 13.0662ZM28.4445 17.244L25.2445 18.2218L25.1556 18.6662L24.3556 20.5329L24.0889 20.9773L25.6889 23.9107L23.9112 25.6885L20.9778 24.0885L20.5334 24.3551C19.9112 24.7107 19.2889 24.9773 18.6667 25.1551L18.2223 25.244L17.2445 28.444H14.7556L13.7778 25.244L13.3334 25.1551L11.4667 24.3551L11.0223 24.0885L8.08894 25.6885L6.31117 23.9107L7.91117 20.9773L7.6445 20.5329C7.28894 19.9107 7.02228 19.2885 6.8445 18.6662L6.75561 18.2218L3.55561 17.244V14.7551L6.57783 13.8662L6.75561 13.4218C6.93339 12.7107 7.20005 12.0885 7.55561 11.4662L7.82228 11.0218L6.31117 8.08846L8.08894 6.31068L10.9334 7.91068L11.3778 7.64401C12.0001 7.28846 12.6223 7.02179 13.3334 6.84401L13.7778 6.66623L14.7556 3.55512H17.2445L18.2223 6.66623L18.6667 6.84401C19.2889 7.02179 19.9112 7.28846 20.5334 7.64401L20.9778 7.91068L23.9112 6.31068L25.6889 8.08846L24.0889 11.0218L24.3556 11.4662C24.7112 12.0885 24.9778 12.7107 25.1556 13.3329L25.2445 13.7773L28.4445 14.7551V17.244Z" fill="currentColor"/></g><defs><clipPath id="clip0_363_9540"><rect width="32" height="32" fill="currentColor"/></clipPath></defs></svg>',hk='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M5.3,1.4c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/><g> <rect x="7.7" y="3.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.4992 7.4586)" width="1.2" height="4.2" fill="currentColor"/> <rect x="6.1" y="4.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.5119 7.4281)" width="4.2" height="1.2" fill="currentColor"/></g></svg>',qz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',Xme='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M8.4,9.8c0.6-0.6,1-1.2,1.3-1.9c0.3-0.7,0.5-1.5,0.5-2.3c0-0.8-0.2-1.6-0.5-2.3C9.4,2.5,9,1.9,8.4,1.3L7.8,2 c0.5,0.5,0.8,1,1.1,1.6c0.3,0.6,0.4,1.3,0.4,1.9c0,0.7-0.1,1.3-0.4,1.9C8.6,8.1,8.2,8.7,7.8,9.1L8.4,9.8z" fill="currentColor"/><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',c2='<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.71196 11.08C10.4407 10.3533 11.0186 9.4898 11.4125 8.53906C11.8064 7.58832 12.0085 6.56911 12.0072 5.54C12.0085 4.51089 11.8064 3.49168 11.4125 2.54094C11.0186 1.5902 10.4407 0.726679 9.71196 0L9.05933 0.65171C9.7023 1.2929 10.2122 2.05484 10.5598 2.89374C10.9073 3.73264 11.0856 4.63196 11.0845 5.54C11.0845 7.44904 10.3102 9.17741 9.05933 10.4283L9.71196 11.08V11.08Z" fill="currentColor"/><path d="M8.40781 9.77644C8.96502 9.2207 9.40692 8.56034 9.70812 7.83329C10.0093 7.10624 10.1639 6.32683 10.1629 5.53986C10.1639 4.75289 10.0093 3.97349 9.70812 3.24644C9.40692 2.51939 8.96502 1.85902 8.40781 1.30328L7.7561 1.95499C8.22759 2.42525 8.60149 2.98403 8.85634 3.59924C9.11119 4.21445 9.24195 4.87396 9.24112 5.53986C9.2422 6.20586 9.11164 6.8655 8.85694 7.48087C8.60225 8.09625 8.22845 8.65522 7.75703 9.12565L8.40781 9.77644Z" fill="currentColor"/><path d="M7.10429 8.47307C7.49005 8.08831 7.79596 7.6311 8.00446 7.12773C8.21296 6.62436 8.31993 6.08475 8.31922 5.53991C8.31993 4.99507 8.21296 4.45546 8.00446 3.95209C7.79596 3.44872 7.49005 2.99152 7.10429 2.60675L6.45258 3.25846C6.75261 3.55774 6.99054 3.91337 7.15269 4.30489C7.31483 4.69642 7.39801 5.11614 7.39742 5.53991C7.39795 5.96368 7.31476 6.38338 7.15261 6.7749C6.99047 7.16642 6.75257 7.52205 6.45258 7.82136L7.10429 8.47307ZM5.26991 1.43791C5.348 1.47553 5.4139 1.53441 5.46004 1.60778C5.50618 1.68115 5.5307 1.76605 5.53078 1.85272V9.2271C5.53066 9.31383 5.50607 9.39876 5.45984 9.47214C5.4136 9.54551 5.34761 9.60436 5.26943 9.64191C5.19125 9.67945 5.10407 9.69418 5.01789 9.6844C4.93172 9.67462 4.85005 9.64072 4.78228 9.5866L2.60408 7.8444H0.460899C0.338661 7.8444 0.221429 7.79585 0.134994 7.70941C0.0485588 7.62298 0 7.50574 0 7.38351V3.69632C0 3.57408 0.0485588 3.45685 0.134994 3.37041C0.221429 3.28398 0.338661 3.23542 0.460899 3.23542H2.60408L4.78228 1.49322C4.8501 1.43901 4.93185 1.40506 5.01812 1.39527C5.1044 1.38549 5.19168 1.40027 5.26991 1.43791V1.43791Z" fill="currentColor"/></svg>',ege='<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.5 8L24 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M8.5 1L1.5 8L8.5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',$P='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="currentColor"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="currentColor"/></svg>',tge='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.2374" cy="45.798" r="45.2374" fill="currentColor"/><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="black"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="black"/></svg>',HP='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="currentColor"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="currentColor"/></svg>',nge='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.7169" cy="45.796" r="45.2374" fill="currentColor"/><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="black"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="black"/></svg>',yk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M3.1,16L30.8,0v32L3.1,16z" fill="currentColor"/> <rect y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',mk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M27.7,16L0,32V0L27.7,16z" fill="currentColor"/> <rect x="24.6" y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',Vz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',Iy='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>',rge='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>',age='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path></svg>',ige='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M3 3l18 18" stroke="currentColor"></path></svg>',sge='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',f2='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 27.5C15 27.5 25 22.5 25 15V6.25L15 2.5L5 6.25V15C5 22.5 15 27.5 15 27.5Z" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.715 11.3574L13.8221 17.8396L11.1436 14.8931" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/></svg>',qP='<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23.7508 12.9997V23.7508H13.0003C7.05943 23.7508 2.24919 18.9406 2.24919 12.9997C2.24919 7.05888 7.05943 2.24864 13.0003 2.24864C18.9411 2.24864 23.7508 7.05888 23.7508 12.9997ZM0 12.9997C0 5.82396 5.82396 0 12.9997 0C20.1755 0 26 5.82396 26 12.9997V25.9995H13.0003C5.82396 25.9995 0 20.1755 0 12.9997ZM5.174 13.5197C5.174 16.1976 6.98078 18.4599 9.85371 18.4599C12.2198 18.4599 13.8185 16.9 14.2084 14.8589H11.8686C11.5698 15.7951 10.8155 16.367 9.85371 16.367C8.39758 16.367 7.44886 15.2227 7.44886 13.5202C7.44886 11.8178 8.39813 10.6735 9.85371 10.6735C10.7899 10.6735 11.5305 11.2066 11.8429 12.0903H14.1959C13.7797 10.1011 12.1941 8.58055 9.85371 8.58055C6.96822 8.58001 5.174 10.8418 5.174 13.5197ZM17.3419 8.83999H15.132V18.2131H17.4331V13.3253C17.4331 12.4022 17.6931 11.8041 18.1349 11.4273C18.5249 11.0761 19.0318 10.8942 19.8642 10.8942H20.4491V8.72256H19.8773C18.668 8.72256 17.8624 9.16442 17.3424 9.8406V8.82633V8.83999H17.3419Z" fill="currentColor"/></svg>',oge='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>';(function(n,e){(function(t,r){r()})(Fa,function(){function t(i){var o=!0,u=!1,c=null,p={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function h(W){return!!(W&&W!==document&&W.nodeName!=="HTML"&&W.nodeName!=="BODY"&&"classList"in W&&"contains"in W.classList)}function m(W){var de=W.type,ce=W.tagName;return!!(ce==="INPUT"&&p[de]&&!W.readOnly||ce==="TEXTAREA"&&!W.readOnly||W.isContentEditable)}function w(W){W.classList.contains("focus-visible")||(W.classList.add("focus-visible"),W.setAttribute("data-focus-visible-added",""))}function b(W){W.hasAttribute("data-focus-visible-added")&&(W.classList.remove("focus-visible"),W.removeAttribute("data-focus-visible-added"))}function g(W){W.metaKey||W.altKey||W.ctrlKey||(h(i.activeElement)&&w(i.activeElement),o=!0)}function S(W){o=!1}function A(W){h(W.target)&&(o||m(W.target))&&w(W.target)}function T(W){h(W.target)&&(W.target.classList.contains("focus-visible")||W.target.hasAttribute("data-focus-visible-added"))&&(u=!0,window.clearTimeout(c),c=window.setTimeout(function(){u=!1},100),b(W.target))}function R(W){document.visibilityState==="hidden"&&(u&&(o=!0),L())}function L(){document.addEventListener("mousemove",q),document.addEventListener("mousedown",q),document.addEventListener("mouseup",q),document.addEventListener("pointermove",q),document.addEventListener("pointerdown",q),document.addEventListener("pointerup",q),document.addEventListener("touchmove",q),document.addEventListener("touchstart",q),document.addEventListener("touchend",q)}function D(){document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",q),document.removeEventListener("mouseup",q),document.removeEventListener("pointermove",q),document.removeEventListener("pointerdown",q),document.removeEventListener("pointerup",q),document.removeEventListener("touchmove",q),document.removeEventListener("touchstart",q),document.removeEventListener("touchend",q)}function q(W){W.target.nodeName&&W.target.nodeName.toLowerCase()==="html"||(o=!1,D())}document.addEventListener("keydown",g,!0),document.addEventListener("mousedown",S,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("touchstart",S,!0),document.addEventListener("visibilitychange",R,!0),L(),i.addEventListener("focus",A,!0),i.addEventListener("blur",T,!0),i.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&i.host?i.host.setAttribute("data-js-focus-visible",""):i.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=t;var r;try{r=new CustomEvent("focus-visible-polyfill-ready")}catch{r=document.createEvent("CustomEvent"),r.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(r)}typeof document<"u"&&t(document)})})();const Gz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAABSCAYAAACfWoXuAAAACXBIWXMAAC4jAAAuIwF4pT92AAAMX0lEQVR4nO2d/XEbtxbF4Tf+N5ptIEO6gYipQHQDz3QDT0wDkfIKiKUGYvk1IKqBJzoNmKwgZBoINWmApgtQBtJdaSUtDrDLXewCOL8ZjsciRe0H9uDifuC+ur29VYQQQsLgNe8TISRBhkqpUeGVKaWOHC7DV6XUSim1lX8Xhf97Ibe0x5Hds/yC2jCd90ZeoZEPvjIWAZ6PqnFOQ3mVEep9LQM9s77vdSb3qQyvgmZhItdN/zto+LvXct1njtpTm1y0Y/ORLB0nItN5nyulzho+Jh8sgLXwKsDzUTXOST+Q14bPr4G4hISelP4yHO9nuQY+0c/aF8Pfe9uxwaCv1VReTQu1iRul1IUIeOMT1r+a/kJCOmYuD00Zh8AKD4kpONY5B+AdQxFNPbl98CjYSv7WRxmHZ2ClWAuKNokRJFynEZyvSbR3IlQpk4mVq8X6uOPrcCATxk2TK3eKNomRC3BOvl0HTTMCVqPJLZQKExHIk4bOdymvfcnFe9WEe47ZIyRGNuK/Piw5t4H4YEMNzKKVQqpWdibn/q7G7y4LGSAbhyDiuBB4HTtmnOTo8fjHvjEzm2h/bTsS2hIhHjNpFm1tXxq+cRqwaL83/Pwm4HPah5EIdtkEbeJKXGh1/P/5Nc5/NxMLf1Jh0vhQyGKpHKi0ifYqwnRAkgZzINrvLcG8vjKRpXYZKVrZI7GUTdekyE6CgxcNZ3Rs5drPJPh55uhLP5IJYFrVyKRPm8TKViyqMg4CFW10zKmJ9lRcDS6CfS5usbOWc8Y3clxvJPXSxqFMOpX83BRtEjNo+RtaQDIDy+9lREVDLkzBKqqIjmv86EGsn7OR8aVz1P+2fPagqnBTtEnMzGVZXMa7pvNnWwZNMilZ2Vrc/ufwuXP5bJfxLe3++MHB6tbC/bvreKRok9hBFllILhJT1sguoYIa7TPWVul34DM7iVn0paJ5KxPuueVz37sGkinaJHaQFRqKaA9BdsR1j/b2aBs9OSEf9k4CfH2cxPQk8pPlM4eWGoM7KNokdlbi2ywjlLJ25mbfix5K68sFu8/pvjMH4T6xxVso2iQFQre2TQ9xKrnZI8ltNvEtAMHOcRHuK+TfpmiTFAhZtMegbD0VK9t2nj8HVlA3A+moSlxARp88RZukwBZE8Ac936419dzsU4tb5FOg12EK3HZK3CSl45KiTVIBPdh93vnPVLaeQm52Zsm6WAe6733ORFw7JkqDkhRtkgooZ9skjF0zTbxs/dSSLXIaeOaMnnR/Be8flW0jQtEmKWHK2T7oaYWk6ZhSyc3+Bbx3FUkQ9gI07VBlKwmKNkmJkAKSqGw9hdxstMr4Frhb5Dlo7B09T0ulaJOUWAGrpm9l7QxAmvktMn/+wtJs4cm1oGiT1Ailq41JtFPIzUYVoCrSSQuNyyd53RRtkhoh9I9EopWClY0mz6tIs2ZQQ+onMReKNkmNDcjZ7ktZe+pl66l2m0f3lqJNkgY9+H0ISJoszRRys9EqQ1uiqYr2Q+ofRZukyAzkbHct2qmXraP2hrH78jegSnKQrwIp2iRVrg3n3XVZu2nSSCU3G4l2CuePJqa7FRhFm6QKitZ3ZW1noDozlX2z0YSZwo6GaGK6uzYUbZIqKGfbtnVmW7DbutmfvU5k0kITE0WbJI/J2u6qrD31fbNT9mcXQU07KNokafrUrX0IytZTsbKRaySk/bL3BZ3rmKJNUmYDyoePPZe1s9s6vt6xpzoWQeeaUbRJ6jgVNHjAFPxMITc7h5b2PdCv/dryy5nFz9Q3UvJ7kWaYS/eTsgDg1JOVO0q8bD0HWdqpdJy3YhNtPZC+9OA4XXkVxmGSHrGVdLrjkkPKt8Vs29JNPTc7xyTaqC1XjCDjc0j3CCHdu0hMfyOV3Owc02qDVvYjFG1CxLIx5Wy3vfPfhN3WSRUo2oTcYxLItsvaU8/NJhWhaBNyTxetyFDZOq1sUgpFm5B7UM52W2XtLFsnlbGJ9lIyMkJ5EbIPJqFsq6w95X2zSU1oaRPyyFw6fZfRtGizbJ3UgqJNyCM6tez/huvxvuGydjQJpJSbXcTknupTl3wfoPNdUbQJeYpJMJt2kZhSCa+Yl/wC1Jk9RlC20paiTchTUFfspkR7BHKzU7WylW2jJI/H0TXwXCnahLzEJJzvGurWbkohjL1xrQ0k2l22gPMN7N5D0SbkJagVWRPWtimFMGXBVhTtB+geIaQiqCv2voU2KDcbTRYpQNG+B25RS9GOCwawmsMkoId7CojJUl8zN9veHzEBMhDvuMuuoWjHRUobxX9t+fuRq6KutZ0ZtoBVtLIfQP0Rm4gn9B3Uv+Du+aZop0NsA77tCWor6Xdl1PVrMzfbDrK2Q2rIUhc0RijaiRGqaB91+LdNQjqoKdwmC5252Y8g0e6iQ75vrB3pKdokVHz4f7Vo/214r6qADMEERCv7ESTaOuUy5nxtlL//EPOgaMdFbEtLdMy+gnZNlbWjfbMp2o/oFcdn8H7M1jZquPHwbFO00yFE9wg6Zl9B16Z2/jM9kBTslyDjo629zbsG7a2uiuOQoh0XsVnaSLR9WdorkNHgKtpo2cuskZegXQ6PIg1ITkH+/k3RSKFox4dp34xBgNa2Nf3JEyYRcfWxmqxD5maXY3ORxGhtI9fIk4mdoh0fSMxCs1BMgTuT5dsW+7YiM5Wt08o2g67NcWTW9ilYiann44+iHR+xpEyhY/Xd8BZZfjbRRmXr9GebQR3yNWddH2BD6JXaOfiqF+mgFO34QEIQUspUn0RbAWvbVqnH3Oz6IGE+srgUQuECTOqq7BpQtONjY7FQQvAH2iLpXYi2ngx3hvdM4pGBlmK0su3MLGP5PPBK3wnY1kDJxP4i5kHRjhPkgw3BOkEuhc8dWqiXhp+bVgXMzd4fZGQcBHwdM7BNghIDofRZpWjHCRLtQQDWNloWd/mQmq7rwBAYY272/iwsmSSHgTZCXljcIh9NxglFO042oEmq6nkQ5wxE0ncdP6AoZ/v5RDgEvQ2ZNVKNU+CaUuJiCCkNcGbpe7lGzyhFO16QMA96Ktxa6P4L3v/o8VhMmCaN5z545mY3x8bi+1XiugpBuGeWc/lmOw+KdrwsLNb2hx7mumq3wXeG93Y9sVBRt/biw2Z68Ghl12Nu8QGrAITbJtian22FYxTtuLFZ05971BHEtmQ86UmK3Ab4WPPAY1+6rWcyBvQEfitiMAs440K7SWyFVZc99HFncg9sgn3lcuwU7bixWdsH8n7Xwm2zQJY9exBRt/YMBCB95mbre/qnrKjyytJDuc5/BVoKrq/dGGyXm3MsE1QfJqex3AfbvvBL13tC0Y6fqSWIkwt3F9WSmTxcSLB3PRSYGbimU5Bj7svKzuRvfQ8+cxloKbgW7n9bxrSSCWrdYYprJq6wL5b7oOQ4nZ8/inb8uARxtHBfyyDzVTE5lXxl5BJR4hbpY+Du2vDzj4ZULp+52VPLXhY5ofrXV2K52oT7QO7HyvMENRXr+sThs2s5NucVGEU7DbRY/OJwpiciLtMWxXsibptLS56qkoq3vubgVhU8n75sV6st5Ga5K5mYXDYPOxSLd9Hiqi2T797I2LZZ10rcZZUEW/Pq9lbHJ+6CFLHx1qHcOYbzdjnPHJfodc6uENTZdxvUkQzoiaMFqPkUQPXmpsL5vPG4YlhU6K1ZZfyYGIsotvX9iNwN4TquVWFsz/c8tkzOfSIuMZsRUuS8btrt6zq/RIJlWrBybRyI5X0ig/wP+d2Ng/iMC//+WHEwK9nKNIQqtwvH3PE+52aHvmnVVsb1SoTQZawVx7aSmM5Kvssm4mNZnYwcXHtl7CRgXXuyoKUdPnUsmbGkrVUV07bRWQH/6WhDqDoMJRPDhu9J6MLRn3rTkHukS0u7yFCuc5cd/BGfxLrea6KkTztNFrKstxUr+EQP6B8CEmxlydku4nuvkQuHIJ2KsNBnIxPIe8vugL5ZyuR12sTKhqKdLvmy8q0ll7ttluLvbWRAd4BNkLvYN3vjYGlfRVydORer+6cOuhwVycV63KQxQtEmi4Lv+crRQtuXnfytN/K3Q96LA+Vsqw539JvJPX2+ErgRMYu1q3mRmfie33oe25/k2jcq1jm5T5uQnEyi4WN5uWZH2FjLAF5wa9JOGHluhtxXimO7TiCxjHVhXLfu3qNoExtDeY1F0F1K3vMMk60IxYqttUhP0eNaj+l8bNvqE/Kxnb/8xmCUUv8APsi0l8VaI5gAAAAASUVORK5CYII=",uge="_spinner_1eos5_1",lge="_spin_1eos5_1",cge="_svg_1eos5_16",fge="_menu_1eos5_276",dge="_fadein_1eos5_1",pge="_fadeout_1eos5_1",Ot={spinner:uge,spin:lge,"spinner--light":"_spinner--light_1eos5_12",svg:cge,"user-action-indicator-container":"_user-action-indicator-container_1eos5_23","action-indicator-fade-out":"_action-indicator-fade-out_1eos5_1","user-action-indicator-text":"_user-action-indicator-text_1eos5_40","user-action-indicator":"_user-action-indicator_1eos5_23","action-indicator-icon-scale":"_action-indicator-icon-scale_1eos5_1","user-action-indicator-icon":"_user-action-indicator-icon_1eos5_60","seek-container":"_seek-container_1eos5_69","seek-playhead":"_seek-playhead_1eos5_92","seek-buffer":"_seek-buffer_1eos5_93","seek-input":"_seek-input_1eos5_94","volume-controls":"_volume-controls_1eos5_201","volume-slider":"_volume-slider_1eos5_208","volume-input":"_volume-input_1eos5_224","volume-progress":"_volume-progress_1eos5_225",menu:fge,fadein:dge,"menu-option":"_menu-option_1eos5_296","menu-option-back":"_menu-option-back_1eos5_313","menu-option-back-icon":"_menu-option-back-icon_1eos5_317","focus-visible":"_focus-visible_1eos5_327","menu-option-active":"_menu-option-active_1eos5_332","menu-option-icon":"_menu-option-icon_1eos5_336","menu-header":"_menu-header_1eos5_346","verification-menu":"_verification-menu_1eos5_353","verification-menu__group":"_verification-menu__group_1eos5_357","verification-menu__group-icon":"_verification-menu__group-icon_1eos5_362","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_1eos5_366","verification-menu__group-text":"_verification-menu__group-text_1eos5_374","verification-menu__group-title":"_verification-menu__group-title_1eos5_378","verification-menu__group-subtitle":"_verification-menu__group-subtitle_1eos5_378","verification-menu__loader":"_verification-menu__loader_1eos5_393","verification-menu__details":"_verification-menu__details_1eos5_400","verification-menu__detail":"_verification-menu__detail_1eos5_400","verification-menu__detail-label":"_verification-menu__detail-label_1eos5_419","verification-menu__detail-value":"_verification-menu__detail-value_1eos5_423","verification-menu__detail-copy":"_verification-menu__detail-copy_1eos5_430","verification-menu__inline-icon":"_verification-menu__inline-icon_1eos5_440","verification-menu--details":"_verification-menu--details_1eos5_448","copy-button":"_copy-button_1eos5_564","copy-button--copied":"_copy-button--copied_1eos5_567",fadeout:pge},Ob=({light:n,className:e=""})=>Le.jsx("div",{className:`${e} ${Ot.spinner} ${n?Ot["spinner--light"]:""}`,children:Le.jsx("div",{className:Ot["spinner-inner"]})}),bd=({icon:n,className:e=""})=>Le.jsx("div",{className:`${Ot.svg} ${e}`,dangerouslySetInnerHTML:{__html:n}}),VP={[Pn.PLAY]:jz,[Pn.PAUSE]:Yme,[Pn.MUTE]:hk,[Pn.UNMUTE]:c2,[Pn.VOLUME_DOWN]:qz,[Pn.VOLUME_UP]:c2,[Pn.SEEK_BACK]:$P,[Pn.SEEK_FORWARD]:HP,[Pn.PLAYBACK_RATE_DOWN]:$P,[Pn.PLAYBACK_RATE_UP]:HP,[Pn.SUBTITLES_ON]:age,[Pn.SUBTITLES_OFF]:ige,[Pn.PLAY_PREVIOUS]:yk,[Pn.PLAY_NEXT]:mk},hge=({action:n})=>{if(!(!n||!VP[n.action]))return Le.jsxs("div",{className:Ot["user-action-indicator-container"],children:[Le.jsx("div",{className:Ot["user-action-indicator"],children:Le.jsx(bd,{icon:VP[n.action],"aria-label":`Action indicator ${n}`,className:Ot["user-action-indicator-icon"]})}),n.text?Le.jsx("div",{className:Ot["user-action-indicator-text"],children:n.text}):null]})},Wz=({player:n,videoState:e,setRecentUserAction:t,className:r=""})=>{const[i,o]=Ct.useState(n.video.currentTime),[u,c]=Ct.useState(0),[p,h]=Ct.useState(void 0);return Ct.useEffect(()=>{h(Oz(n,t));const m=pk({video:n.video,setCurrentTime:o,rate:60}),w=Pme({video:n.video,setBufferFraction:c});return()=>{m&&m(),w&&w()}},[]),n.isLive&&!n.dvrEnabled?null:Le.jsxs("div",{className:`${r} ${Ot["seek-container"]} ${r}`,children:[Le.jsx("progress",{max:1,value:u,className:Ot["seek-buffer"]}),Le.jsx("progress",{max:1,value:i/e.duration||0,className:Ot["seek-playhead"]}),Le.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:i/e.duration||0,onInput:m=>n.controls.Seek({fraction:m.currentTarget.value}),onKeyDown:p,className:Ot["seek-input"]})]})},yge=({player:n,videoState:e})=>Le.jsxs("div",{className:Ot["volume-controls"],children:[Le.jsx(qc,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?hk:e.volume<.4?qz:e.volume<.8?Xme:c2,onClick:()=>n.controls.ToggleMuted(),className:Ot["volume-button"]},"mute-button"),Le.jsxs("div",{className:Ot["volume-slider"],children:[Le.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ot["volume-progress"]}),Le.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>n.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:hme(n),className:Ot["volume-input"]})]})]}),Kz=({player:n,Hide:e,className:t=""})=>{const[r,i]=Ct.useState(void 0),[o,u]=Ct.useState(void 0),c=Ct.createRef();if(Ct.useEffect(()=>{const w=()=>u(n.controls.GetOptions());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),Ct.useEffect(()=>{if(!c||!c.current)return;const w=c3({element:c.current.parentElement,Hide:e});return()=>{w&&w()}},[c]),!o)return null;const p=w=>setTimeout(()=>i(w)),h={quality:{label:"Quality",Update:w=>n.controls.SetQualityLevel(w)},audio:{label:"Audio",Update:w=>n.controls.SetAudioTrack(w)},text:{label:"Subtitles",Update:w=>n.controls.SetTextTrack(w)},profile:{label:"Player Profile",Update:w=>{w==="custom"?(n.controls.ShowPlayerProfileForm(),e()):n.controls.SetPlayerProfile({profile:w})}},rate:{label:"Playback Rate",Update:w=>n.controls.SetPlaybackRate({index:w})}};let m;return r?m=Le.jsxs("div",{role:"menu",className:`${Ot.menu} ${Ot.submenu} ${t}`,children:[Le.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ot["menu-option"]} ${Ot["menu-option-back"]}`,children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:ege},className:Ot["menu-option-back-icon"]}),Le.jsx("div",{children:h[r].label})]}),o[r].options.map(w=>Le.jsxs("button",{role:"menuitemradio","aria-checked":w.active,autoFocus:w.active,"aria-label":`${h[r].label}: ${w.label||""}`,onClick:()=>{h[r].Update(w.index),p(void 0)},className:`${Ot["menu-option"]} ${w.active?Ot["menu-option-active"]:""}`,children:[w.label||"",w.active?Le.jsx(bd,{icon:rge,className:Ot["menu-option-icon"]}):null]},`option-${w.index}`))]},"submenu"):m=Le.jsxs("div",{role:"menu",className:`${Ot.menu} ${t}`,children:[o.hasQualityOptions?Le.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ot["menu-option"],children:[`${h.quality.label}: ${o.quality.active&&o.quality.active.activeLabel||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasAudioOptions?Le.jsxs("button",{autoFocus:!o.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Ot["menu-option"],children:[`${h.audio.label}: ${o.audio.active&&o.audio.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasTextOptions?Le.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Ot["menu-option"],children:[`${h.text.label}: ${o.text.active&&o.text.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasProfileOptons?Le.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Ot["menu-option"],children:[`${h.profile.label}: ${o.profile.active&&o.profile.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasRateOptions?Le.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions&&!o.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Ot["menu-option"],children:[`${h.rate.label}: ${o.rate.active&&o.rate.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null]},"menu"),Le.jsx("div",{ref:c,children:m})},mge=async n=>{try{n=(n||"").toString(),await navigator.clipboard.writeText(n)}catch{const t=document.createElement("input");t.value=n,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},gge=({label:n,value:e,className:t=""})=>{const[r,i]=Ct.useState(!1);return Le.jsx("button",{onClick:()=>{r||(mge(e),i(!0),setTimeout(()=>i(!1),100))},dangerouslySetInnerHTML:{__html:oge},className:[Ot["copy-button"],r?Ot["copy-button--copied"]:"",t].join(" "),title:`Copy ${n}`})},Fo=({label:n,value:e,copyable:t})=>e?Le.jsxs("div",{className:Ot["verification-menu__detail"],children:[Le.jsxs("label",{className:Ot["verification-menu__detail-label"],children:[n,":"]}),Le.jsx("div",{className:Ot["verification-menu__detail-value"],children:e}),t?Le.jsx(gge,{label:n,value:e,className:Ot["verification-menu__detail-copy"]}):null]}):null,Yz=({player:n,Hide:e,className:t=""})=>{const r=Ct.createRef(),[i,o]=Ct.useState(),[u,c]=Ct.useState(!1),[p,h]=Ct.useState(!1);if(Ct.useEffect(()=>{n.__LoadVerificationDetails().then(()=>h(!0));const w=()=>o(n.controls.GetContentVerificationDetails());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),Ct.useEffect(()=>{if(!r||!r.current)return;const w=c3({element:r.current.parentElement,Hide:e});return()=>{w&&w()}},[r]),!i)return null;let m;return u?m=Le.jsxs(Le.Fragment,{children:[Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:f2},className:Ot["verification-menu__group-icon"]}),Le.jsxs("div",{className:Ot["verification-menu__group-text"],children:[Le.jsx("div",{className:Ot["verification-menu__group-title"],children:"This content has been verified as authentic"}),Le.jsxs("div",{className:Ot["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:qP},className:[Ot["verification-menu__group-icon"],Ot["verification-menu__group-icon--cc"]].join(" ")}),Le.jsxs("div",{className:Ot["verification-menu__group-text"],children:[Le.jsx("button",{onClick:()=>c(!0),className:Ot["verification-menu__group-title"],children:"Content Credentials"}),Le.jsxs("div",{className:Ot["verification-menu__group-subtitle"],children:["Issued by the",Le.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Le.jsxs("div",{className:Ot["verification-menu__details"],children:[Le.jsx(Fo,{label:"Content Fabric Object ID",value:i.details.objectId,copyable:!0}),Le.jsx(Fo,{label:"Organization Address",value:i.details.tenantAddress,copyable:!0}),Le.jsx(Fo,{label:"Organization Name",value:i.details.tenantName&&i.details.tenantName.toString()}),Le.jsx(Fo,{label:"Owner Address",value:i.details.ownerAddress,copyable:!0}),Le.jsx(Fo,{label:"Content Object Contract Address",value:i.details.explorerUrl?Le.jsx("a",{href:i.details.explorerUrl,target:"_blank",rel:"noreferrer",children:i.details.address}):i.details.address,copyable:!0}),Le.jsx(Fo,{label:"Versions",value:i.details.versionCount}),Le.jsx(Fo,{label:"Content Version Hash",value:i.details.versionHash,copyable:!0}),i.details.lastCommittedAt?Le.jsx(Fo,{label:"Latest Commit",value:new Date(i.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Le.jsx(Fo,{label:"Latest Version Hash",value:i.details.latestVersionHash,copyable:!0}),Le.jsx(Fo,{label:"Latest Transaction",value:i.details._state!=="full"?Le.jsx(Ob,{className:Ot["verification-menu__loader"]}):i.details.latestTransactionHashUrl?Le.jsx("a",{href:i.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:i.details.latestTransactionHash&&i.details.latestTransactionHash.toString()}):void 0}),Le.jsx(Fo,{label:"Signature Algorithm",value:i.details.signatureMethod}),n.publicMetadataUrl?Le.jsx(Fo,{label:"Public Metadata",value:Le.jsx("a",{href:n.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:n.publicMetadataUrl})}):null]},`details-${i.details._state}`)]}):m=Le.jsxs(Le.Fragment,{children:[Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:f2},className:Ot["verification-menu__group-icon"]}),Le.jsxs("div",{className:Ot["verification-menu__group-text"],children:[Le.jsx("div",{className:Ot["verification-menu__group-title"],children:"This content has been verified as authentic"}),Le.jsxs("div",{className:Ot["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:qP},className:[Ot["verification-menu__group-icon"],Ot["verification-menu__group-icon--cc"]].join(" ")}),Le.jsx("div",{className:Ot["verification-menu__group-text"],children:Le.jsxs("button",{onClick:()=>c(!0),className:Ot["verification-menu__group-title"],children:["View Content Credentials",Le.jsx("div",{className:Ot["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:Iy}})]})})]})]}),Le.jsx("div",{ref:r,children:Le.jsx("div",{role:"menu",className:`${Ot.menu} ${Ot["verification-menu"]} ${u?Ot["verification-menu--details"]:""} ${t}`,children:m},"menu")})},Jz=({player:n,Hide:e,className:t=""})=>{const r=Ct.createRef(),[i,o]=Ct.useState(void 0);if(Ct.useEffect(()=>{const c=()=>o(n.controls.GetCollectionInfo());c();const p=n.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Ct.useEffect(()=>{if(!r||!r.current)return;const c=c3({element:r.current.parentElement,Hide:e});return()=>c&&c()},[r]),!i)return null;const u=c=>{n.controls.CollectionPlay({mediaIndex:c}),e()};return Le.jsxs("div",{role:"menu",className:`${Ot.menu} ${Ot["collection-menu"]} ${t}`,ref:r,children:[Le.jsx("div",{className:`${Ot["menu-option"]} ${Ot["menu-header"]}`,children:i.title}),i.content.map(c=>Le.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>u(c.mediaIndex),className:`${Ot["menu-option"]} ${c.active?Ot["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`))]},"menu")},qc=({icon:n,className:e="",...t})=>Le.jsx("button",{...t,className:`${In["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:n}}),vge=({player:n,videoState:e})=>{const[t,r]=Ct.useState(n.video.currentTime);return Ct.useEffect(()=>{const i=pk({video:n.video,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.dvrEnabled?Le.jsx("div",{className:In["live-indicator"],children:"Live"}):Le.jsxs("div",{className:In.time,children:[n.isLive?Le.jsx("button",{onClick:()=>n.controls.Seek({time:n.controls.GetDuration()-2}),className:`${In["live-indicator"]} ${n.isLive&&n.behindLiveEdge?In["live-indicator--faded"]:""}`,children:"Live"}):null,n.isLive&&!n.behindLiveEdge?null:`${s2(t,e.duration)} / `,s2(e.duration,e.duration)]})},bge=({player:n})=>{const e=n.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],r=e.content[e.mediaIndex+1],i=n.controls.IsReady();return Le.jsxs(Le.Fragment,{children:[t?Le.jsxs("div",{className:`${In["collection-button-container"]} ${i?"":In["collection-button-container--loading"]}`,children:[Le.jsx(qc,{"aria-label":`Play Previous: ${t.title}`,disabled:!i,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious()}),Le.jsx("div",{className:In["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,r?Le.jsxs("div",{className:`${In["collection-button-container"]} ${i?"":In["collection-button-container--loading"]}`,children:[Le.jsx(qc,{"aria-label":`Play Next: ${r.title}`,disabled:!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext()}),Le.jsx("div",{className:In["collection-button-text"],children:r.title})]},`media-next-${e.mediaIndex}`):null]})},j8=({label:n,icon:e,player:t,MenuComponent:r,className:i=""})=>{const[o,u]=Ct.useState(!1);return Le.jsxs("div",{className:[In["menu-control-container"],i].join(" "),children:[Le.jsx(qc,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!o),u(!o)},className:o?In["icon-button-active"]:""}),o?Le.jsx(r,{player:t,Hide:()=>{u(!1),t.controls.__ToggleMenu(!1)}}):null]})},wge=({player:n})=>{const[e,t]=Ct.useState(void 0),{title:r,subtitle:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return Ct.useEffect(()=>{t(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>t(p))},[u]),!r||n.playerOptions.title===jt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()||n.playerOptions.title===jt.title.OFF?null:Le.jsxs("div",{className:In["info-container"],children:[e?Le.jsx("div",{className:In["info-image-container"],children:Le.jsx("img",{src:e,alt:"Image",className:In["info-image"]})}):null,Le.jsxs("div",{className:In["info-text"],children:[c.length===0?null:Le.jsx("div",{className:In["info-headers"],children:c.map((p,h)=>Le.jsx("div",{className:In["info-header"],children:p},`header-${h}`))}),r?Le.jsx("div",{className:In["info-title"],children:r}):null,i?Le.jsx("div",{className:In["info-subtitle"],children:i}):null,o?Le.jsx("div",{className:In["info-description"],children:o}):null]})]})},xge=({player:n})=>{const[e,t]=Ct.useState(!1);return Ct.useEffect(()=>{const r=()=>t(n.controls.ContentVerified());r();const i=n.controls.RegisterSettingsListener(r);return()=>i&&i()},[]),e?Le.jsxs(Le.Fragment,{children:[Le.jsx("div",{className:In["content-verified-badge"],children:"VERIFIED"}),Le.jsx(j8,{label:"Content Verification Menu",icon:f2,player:n,MenuComponent:Yz,className:In["content-verification-menu-button"]})]}):null},_ge=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=Ct.useState(void 0),[p,h]=Ct.useState(void 0),[m,w]=Ct.useState(n.controls.IsMenuVisible());if(Ct.useEffect(()=>{h(Rz({player:n,setRecentUserAction:i}));const A=()=>w(n.controls.IsMenuVisible()),T=n.controls.RegisterSettingsListener(A),R=Bz({target:n.target,video:n.video,setVideoState:c});return()=>{T&&T(),R&&R()}},[]),!u)return null;const b=n.controls.GetCollectionInfo(),g=r||!e||m,S=!g&&n.playerOptions.controls===jt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!S),Le.jsxs("div",{onClick:p,className:[o,In.container,g?"":In.autohide,n.playerOptions.controls!==jt.controls.DEFAULT?"":In["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Le.jsx(wge,{player:n},`content-info-${b&&b.mediaIndex}`),[jt.controls.DEFAULT,jt.controls.OFF,jt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls)?null:Le.jsxs(Le.Fragment,{children:[Le.jsx(qc,{"aria-label":"Play",tabIndex:e?-1:0,icon:zz,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${In["center-play-button"]} ${t&&!e?"":In["center-play-button--hidden"]}`}),Le.jsxs("div",{className:`${In["bottom-controls-container"]} ${S?In["bottom-controls-container--autohide"]:""}`,children:[Le.jsx("div",{className:In["bottom-controls-gradient"]}),Le.jsx(Wz,{player:n,videoState:u,setRecentUserAction:i,className:In.seek}),Le.jsxs("div",{className:In.controls,children:[Le.jsx(qc,{"aria-label":u.playing?"Pause":"Play",icon:u.playing?Hz:$z,onClick:()=>n.controls.TogglePlay(),className:In["play-pause-button"]}),Le.jsx(bge,{player:n}),Le.jsx(yge,{player:n,videoState:u}),Le.jsx(vge,{player:n,videoState:u}),Le.jsx("div",{className:In.spacer}),Le.jsx(xge,{player:n}),b?Le.jsx(j8,{label:"Collection Menu",icon:Vz,player:n,MenuComponent:Jz}):null,n.controls.IsRotatable()?Le.jsx(qc,{"aria-label":"Rotate Video",icon:sge,onClick:()=>n.controls.SetAllowRotation(!n.controls.AllowRotation()),className:In["right-control-button"]}):null,n.controls.GetOptions().hasAnyOptions?Le.jsx(j8,{label:"Settings Menu",icon:Zme,player:n,MenuComponent:Kz}):null,Le.jsx(qc,{"aria-label":u.fullscreen?"Exit Fullscreen":"Fullscreen",icon:u.fullscreen?Qme:Jme,onClick:()=>n.controls.ToggleFullscreen(),className:In["right-control-button"]})]})]})]}),n.playerOptions.controls!==jt.controls.OFF_WITH_VOLUME_TOGGLE?null:Le.jsx("div",{className:In["floating-volume-toggle"],children:Le.jsx(qc,{"aria-label":u.muted?"Unmute":"Mute",icon:u.muted||u.volume===0?hk:c2,onClick:()=>n.controls.ToggleMuted(),className:In["volume-button"]},"mute-button")}),n.playerOptions.watermark===jt.watermark.OFF?null:Le.jsx("div",{className:In.watermark,children:Le.jsx("img",{src:Gz,alt:"Eluvio"})})]})},Sge="_spinner_1c6ar_17",Cge="_text_1c6ar_33",Ege="_title_1c6ar_39",Age="_description_1c6ar_43",kge="_inputs_1c6ar_47",Mge="_input_1c6ar_47",Tge="_submit_1c6ar_77",wi={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:Sge,"ticket-form":"_ticket-form_1c6ar_1",text:Cge,title:Ege,description:Age,inputs:kge,input:Mge,submit:Tge,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Rge=({parameters:n,dimensions:e,onComplete:t})=>{let{tenantId:r,ntpId:i,ticketCode:o,ticketSubject:u}=n.clientOptions||{};const c=!r||!i,[p,h]=Ct.useState(o||""),[m,w]=Ct.useState(!!o),[b,g]=Ct.useState(!1),[S,A]=Ct.useState(c?"Error: Tenant ID or NTP ID not specified":""),[T,R]=Ct.useState(void 0),L=async({client:D,code:q})=>{if(!(!q||!D)){A(""),g(!0);try{let W=u;q.includes(":")&&(W=q.split(":")[0],q=q.split(":")[1]),await D.RedeemCode({tenantId:r,ntpId:i,code:q.trim(),email:W}),t(D)}catch(W){console.log(W),A("Invalid Code"),w(!1)}finally{g(!1)}}};return Ct.useEffect(()=>{Promise.resolve().then(()=>Tz).then(async({ElvClient:D})=>{const q=await D.FromConfigurationUrl({configUrl:n.clientOptions.network});R(q),o&&L({client:q,code:o})})},[]),m?Le.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:Le.jsx("div",{className:wi["ticket-form-overlay"],children:Le.jsx(Ob,{className:wi.spinner})})}):Le.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:Le.jsx("div",{className:wi["ticket-form-overlay"],children:Le.jsxs("form",{onSubmit:D=>{D.preventDefault(),L({client:T,code:p})},className:wi["ticket-form"],children:[Le.jsxs("div",{className:wi.text,children:[Le.jsx("h2",{className:wi.title,children:n.clientOptions.ticketTitle||"This content requires a code to view"}),Le.jsx("p",{className:wi.description,children:n.clientOptions.ticketDescription||"Please enter your code below"})]}),Le.jsxs("div",{className:wi.inputs,children:[Le.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!S&&!c,"aria-errormessage":S,onKeyDown:D=>D.key==="Enter"&&L({client:T,code:p}),onChange:D=>{A(""),h(D.target.value)},className:wi.input}),Le.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!T||c,className:wi.submit,children:b?Le.jsx(Ob,{light:!0}):"Submit"})]}),Le.jsxs("div",{className:wi["error-message"],children:[S," "]})]})})})},Oge="_container_25yw5_1",Lge="_autohide_25yw5_34",Nge="_fadein_25yw5_1",Pge="_title_25yw5_134",Ige="_spacer_25yw5_318",Dge="_watermark_25yw5_322",Uge="_menu_25yw5_145",ln={container:Oge,"container--default-controls":"_container--default-controls_25yw5_29",autohide:Lge,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_25yw5_37","icon-button":"_icon-button_25yw5_43","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_25yw5_60","icon-button-active":"_icon-button-active_25yw5_73","icon-button--circle-focus":"_icon-button--circle-focus_25yw5_73","text-button":"_text-button_25yw5_86","text-button--active":"_text-button--active_25yw5_91","bottom-controls-container":"_bottom-controls-container_25yw5_37",fadein:Nge,"bottom-controls-gradient":"_bottom-controls-gradient_25yw5_108","center-play-button":"_center-play-button_25yw5_120","center-play-button--hidden":"_center-play-button--hidden_25yw5_127","title-container":"_title-container_25yw5_134",title:Pge,"menu-control-container":"_menu-control-container_25yw5_145","time-container":"_time-container_25yw5_149","live-indicator":"_live-indicator_25yw5_156","live-indicator--faded":"_live-indicator--faded_25yw5_168","bottom-controls":"_bottom-controls_25yw5_37","center-buttons":"_center-buttons_25yw5_184","play-pause-button":"_play-pause-button_25yw5_194","track-button":"_track-button_25yw5_197","bottom-left-controls":"_bottom-left-controls_25yw5_201","bottom-right-controls":"_bottom-right-controls_25yw5_202","info-box-container":"_info-box-container_25yw5_219","info-box":"_info-box_25yw5_219","info-box-image-container":"_info-box-image-container_25yw5_242","info-box-image":"_info-box-image_25yw5_242","info-box-text":"_info-box-text_25yw5_258","info-box-text--top-padding":"_info-box-text--top-padding_25yw5_265","info-box-headers":"_info-box-headers_25yw5_269","info-box-description":"_info-box-description_25yw5_277","info-box-title":"_info-box-title_25yw5_281","info-box-button":"_info-box-button_25yw5_286","info-box-button--restart":"_info-box-button--restart_25yw5_301",spacer:Ige,watermark:Dge,menu:Uge},eh=({icon:n,...e})=>Le.jsx("button",{...e,className:`${ln["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:n}}),Fge=({player:n,videoState:e})=>{const[t,r]=Ct.useState(n.video.currentTime);return Ct.useEffect(()=>{const i=pk({video:n.video,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.dvrEnabled?null:Le.jsxs("div",{className:ln["time-container"],children:[n.isLive&&!n.behindLiveEdge?null:Le.jsx("div",{className:ln.time,children:s2(t,e.duration)}),Le.jsx("div",{className:ln.spacer}),Le.jsx("div",{className:ln.time,children:s2(e.duration,e.duration)})]})},Bge=({player:n,videoState:e})=>{const t=n.controls.GetCollectionInfo(),r=t&&t.isPlaylist&&t.content[t.mediaIndex-1],i=t&&t.isPlaylist&&t.content[t.mediaIndex+1],o=n.controls.IsReady();return Le.jsxs("div",{className:ln["center-buttons"],children:[!r&&!i?null:Le.jsx(eh,{disabled:!o||!r,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious(),className:`${ln["track-button"]} ${ln["icon-button--drop-shadow-focus"]}`}),Le.jsx(eh,{"aria-label":"Back 10 Seconds",icon:tge,onClick:()=>n.controls.Seek({relativeSeconds:-10}),className:ln["icon-button--drop-shadow-focus"]}),Le.jsx(eh,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?Hz:$z,onClick:()=>n.controls.TogglePlay(),className:`${ln["play-pause-button"]} ${ln["icon-button--drop-shadow-focus"]}`}),Le.jsx(eh,{"aria-label":"Forward 10 Seconds",icon:nge,onClick:()=>n.controls.Seek({relativeSeconds:10}),className:ln["icon-button--drop-shadow-focus"]}),!r&&!i?null:Le.jsx(eh,{disabled:!o||!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext(),className:`${ln["track-button"]} ${ln["icon-button--drop-shadow-focus"]}`})]})},$8=({label:n,icon:e,children:t,player:r,MenuComponent:i})=>{const[o,u]=Ct.useState(!1);return Le.jsxs("div",{className:ln["menu-control-container"],children:[e?Le.jsx(eh,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${ln["icon-button--circle-focus"]} ${o?ln["icon-button-active"]:""}`}):Le.jsx("button",{onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${ln["text-button"]} ${o?ln["text-button--active"]:""}`,children:t}),o?Le.jsx(i,{player:r,Hide:()=>{r.controls.__ToggleMenu(!1),u(!1)},className:ln.menu}):null]})},zge=({player:n,Hide:e})=>{const[t,r]=Ct.useState(void 0),{title:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return Ct.useEffect(()=>{r(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>r(p))},[u]),Ct.useEffect(()=>{const p=h=>{h&&(h.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Le.jsxs("div",{className:ln["info-box-container"],children:[Le.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${ln["info-box-button"]} ${ln["info-box-button--info"]}`,children:"Info"}),Le.jsxs("div",{className:ln["info-box"],children:[t?Le.jsx("div",{className:ln["info-box-image-container"],children:Le.jsx("img",{src:t,alt:"Image",className:ln["info-box-image"]})}):null,Le.jsxs("div",{className:`${ln["info-box-text"]} ${t&&c&&c.length===0?ln["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Le.jsx("div",{className:ln["info-box-headers"],children:c.map((p,h)=>Le.jsx("div",{className:ln["info-box-header"],children:p},`header-${h}`))}),Le.jsx("div",{className:ln["info-box-title"],children:i||""}),Le.jsx("div",{className:ln["info-box-description"],children:o||""})]}),Le.jsx("div",{className:ln["info-box-actions"],children:Le.jsxs("button",{onClick:()=>{n.controls.Seek({time:0}),e()},className:`${ln["info-box-button"]} ${ln["info-box-button--restart"]}`,children:[Le.jsx(bd,{icon:jz}),"From Beginning"]})})]})]})},jge=({player:n})=>{const[e,t]=Ct.useState(!1);return Ct.useEffect(()=>{const r=()=>t(n.controls.ContentVerified());r(),n.controls.RegisterSettingsListener(r)},[]),e?Le.jsx($8,{label:"Content Verification Menu",icon:f2,player:n,MenuComponent:Yz,className:ln["content-verification-menu-button"],children:"Verified"}):null},$ge=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=Ct.useState(void 0),[p,h]=Ct.useState(void 0),[m,w]=Ct.useState(!1);if(Ct.useEffect(()=>{h(Rz({player:n,setRecentUserAction:i}));const T=Bz({target:n.target,video:n.video,setVideoState:c});return()=>T&&T()},[]),!u)return null;const{title:b}=n.controls.GetContentInfo()||{},g=n.controls.GetCollectionInfo(),S=r||!e||n.controls.IsMenuVisible(),A=!S&&n.playerOptions.controls===jt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!A),Le.jsxs("div",{onClick:p,className:[o,ln.container,S?"":ln.autohide,n.playerOptions.controls!==jt.controls.DEFAULT?"":ln["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Le.jsx(eh,{"aria-label":"Play",tabIndex:e?-1:0,icon:zz,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${ln["center-play-button"]} ${ln["icon-button--drop-shadow-focus"]} ${t&&!e?"":ln["center-play-button--hidden"]}`}),m?Le.jsx(zge,{player:n,Hide:()=>w(!1)}):Le.jsxs("div",{className:`${ln["bottom-controls-container"]} ${A?ln["bottom-controls-container--autohide"]:""}`,children:[Le.jsx("div",{className:ln["bottom-controls-gradient"]}),Le.jsxs("div",{className:ln["title-container"],children:[Le.jsx("div",{className:ln.title,children:n.playerOptions.title===jt.title.OFF||n.playerOptions.title===jt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()?"":b||""}),Le.jsx("div",{className:ln.spacer}),n.isLive?n.dvrEnabled?Le.jsx("button",{onClick:()=>n.controls.Seek({time:n.controls.GetDuration()-2}),className:`${ln["live-indicator"]} ${n.isLive&&n.behindLiveEdge?ln["live-indicator--faded"]:""}`,children:"Live"}):Le.jsx("div",{className:ln["live-indicator"],children:"Live"}):null,g?Le.jsx($8,{label:"Collection Menu",icon:Vz,player:n,MenuComponent:Jz}):null]}),Le.jsx(Wz,{player:n,videoState:u,setRecentUserAction:i}),Le.jsx(Fge,{player:n,videoState:u}),Le.jsxs("div",{className:ln["bottom-controls"],children:[Le.jsx("div",{className:ln["bottom-left-controls"],children:!b||n.playerOptions.title===jt.title.OFF?null:Le.jsx("button",{className:ln["text-button"],onClick:()=>w(!0),children:"Info"})}),Le.jsx(Bge,{player:n,videoState:u}),Le.jsxs("div",{className:ln["bottom-right-controls"],children:[Le.jsx(jge,{player:n}),n.controls.GetOptions().hasAnyOptions?Le.jsx($8,{label:"Settings",player:n,MenuComponent:Kz,children:"Settings"},"settings-button"):null]})]})]}),n.playerOptions.watermark===jt.watermark.OFF?null:Le.jsx("div",{className:ln.watermark,children:Le.jsx("img",{src:Gz,alt:"Eluvio"})})]},"controls")},Hge="_container_1l7ln_1",qge="_overlay_1l7ln_9",Vge="_fadein_1l7ln_1",Gge="_form_1l7ln_22",Wge="_header_1l7ln_39",Kge="_input_1l7ln_45",Yge="_actions_1l7ln_92",Jge="_submit_1l7ln_98",Qge="_cancel_1l7ln_99",co={container:Hge,overlay:qge,fadein:Vge,form:Gge,header:Wge,"input-container":"_input-container_1l7ln_45",input:Kge,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:Yge,submit:Jge,cancel:Qge},Zge=({player:n,Close:e})=>{const[t,r]=Ct.useState(JSON.stringify(n.hlsOptions||"{}",null,2)),[i,o]=Ct.useState(!1),[u,c]=Ct.useState(""),p=Ct.useRef();Ct.useEffect(()=>{if(!p||!p.current)return;const m=c3({element:p.current,Hide:e});return()=>m&&m()},[p]);const h=async m=>{m.preventDefault();try{o(!0),await n.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(w){c(w.toString()),o(!1)}};return Le.jsx("div",{role:"complementary",tabIndex:-1,className:co.container,children:Le.jsx("div",{className:co.overlay,children:Le.jsxs("form",{onSubmit:h,className:co.form,ref:p,children:[Le.jsx("h2",{className:co.header,children:"Custom hls.js Options"}),Le.jsxs("div",{className:co["input-container"],children:[Le.jsx("textarea",{disabled:i,autoFocus:!0,value:t,title:u,"aria-label":"Player Options","aria-invalid":!!u,"aria-errormessage":u||"",onChange:m=>r(m.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),r(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(m){c(m.toString())}},className:`${co.input} ${u?co["input--invalid"]:""}`}),Le.jsxs("div",{className:co["player-info"],children:[Le.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:co["api-link"],children:"API Docs"}),Le.jsxs("div",{className:co["player-version"],children:["hls.js ",n.HLS.version]})]})]}),Le.jsxs("div",{className:co.actions,children:[Le.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:co.cancel,children:"Cancel"}),Le.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!u,className:co.submit,children:i?Le.jsx(Ob,{light:!0}):"Submit"})]})]})})})},Xge=({player:n})=>{const[e,t]=Ct.useState(void 0),{posterImage:r}=n.controls.GetContentInfo()||{};return Ct.useEffect(()=>{t(void 0),r&&dk({player:n,pathOrUrl:r,width:200}).then(i=>t(i))},[r]),e?Le.jsx("img",{alt:"Video Poster",src:e,className:Al.poster}):null};let eve;const tve=({target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:i,Reset:o})=>{const[u,c]=Ct.useState(void 0),[p,h]=Ct.useState(void 0),[m,w]=Ct.useState("lg"),[b,g]=Ct.useState("landscape"),[S,A]=Ct.useState({width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height}),[T,R]=Ct.useState(void 0),[L,D]=Ct.useState(!1),[q,W]=Ct.useState(!1),[de,ce]=Ct.useState(!1),[me,Se]=Ct.useState(!1),[Ce,ne]=Ct.useState(!1),[ke,C]=Ct.useState(!0),[_,O]=Ct.useState(void 0),[z,F]=Ct.useState(void 0),j=Ct.useRef(),Q=!!u,ae=({action:k,text:Y})=>O({action:k,text:Y,key:Math.random()});if(Ct.useEffect(()=>{Se(!0);const k=Ime({target:n,setSize:w,setOrientation:g,setDimensions:A});return()=>{Se(!1),k&&k()}},[]),Ct.useEffect(()=>{if(!(!j||!j.current||!me))try{D(!1),W(!1),e.clientOptions.client=p||e.clientOptions.client;const k=new o2({target:n,video:j.current,parameters:e,SetErrorMessage:R});window.__elvPlayer=k;const Y=k.controls.RegisterSettingsListener(()=>{F(k.controls.AllowRotation()),W(k.playbackStarted),D(!k.loading),ne(k.__showPlayerProfileForm)});k.Destroy=()=>{k.__DestroyPlayer(),i()},k.Reset=()=>{o()};const ie=Dme({player:k}),$=Ume({player:k,inactivityPeriod:5e3,onWake:()=>C(!0),onSleep:()=>C(!1)}),be=Fme({player:k,setRecentUserAction:ae}),Ie=Bme({player:k});t(k),c(k);const Me=k.controls.RegisterVideoEventListener("canplay",()=>ce(!0));return()=>{j&&j.current&&j.current.removeEventListener("play",W),Y&&Y(),ie&&ie(),$&&$(),be&&be(),Ie&&Ie(),Me&&Me(),k&&k.__DestroyPlayer()}}catch(k){r(k),i()}},[j,me,p]),Ct.useEffect(()=>{if(Q)return()=>{u&&u.__DestroyPlayer(),c(void 0)}},[Q]),Ct.useEffect(()=>{_&&(clearTimeout(eve),setTimeout(()=>{O(void 0)},1e3))},[_]),e.clientOptions.promptTicket&&!p)return Le.jsx(Rge,{parameters:e,dimensions:{size:m,orientation:b,...S},onComplete:k=>h(k)});const N=e.playerOptions.ui===jt.ui.WEB&&u&&u.controls.IsRotatable()&&z;return Le.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${N?S.height:S.width}px`,"--portal-height":`${N?S.width:S.height}px`},className:[Al["player-container"],N?Al["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!Ce||!L?null:Le.jsx(Zge,{player:u,Close:()=>u.controls.HidePlayerProfileForm()}),Le.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:j,muted:[jt.muted.ON,jt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===jt.controls.DEFAULT,loop:e.playerOptions.loop===jt.loop.ON,className:Al.video}),!u||!de||q&&!e.playerOptions.permanentPoster?null:Le.jsx(Xge,{player:u}),L||T||!e.playerOptions.showLoader?null:Le.jsx("div",{className:Al["spinner-container"],children:Le.jsx(Ob,{className:Al.spinner})}),T?Le.jsx("div",{className:Al["error-message"],children:T}):null,u?e.playerOptions.ui===jt.ui.WEB?Le.jsx(_ge,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:ke,setRecentUserAction:ae,className:Al.controls}):Le.jsx($ge,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:ke,setRecentUserAction:ae,className:Al.controls}):null,_?Le.jsx(hge,{action:_},`action-indicator-${_&&_.key}`):null]})},nve=n=>{const[e,t]=Ct.useState(Math.random());return Ct.createElement(tve,{...n,key:`player-${e}`,Reset:()=>t(Math.random())})},rve=(n,e)=>(n.innerHTML="",n.classList.add(GG.reset),n.classList.add(Al["player-target"]),e=Nz(e),e.playerOptions&&e.playerOptions.backgroundColor&&(n.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,r)=>{const i=Vv.createRoot(n);i.render(Le.jsx($G.StrictMode,{children:Le.jsx(nve,{target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:async()=>{try{await i.unmount()}catch(o){console.error("Failed to unmount Eluvio Player"),console.error(o)}}})}))}));exports.Initialize=rve;exports.PlayerParameters=jt;exports.commonjsGlobal=Fa;exports.crypto=ZP;exports.eventsExports=Gb;exports.getDefaultExportFromCjs=Pd;exports.inherits_browserExports=$I;exports.require$$3=p2;exports.requireBuffer=Lb;exports.string_decoder=V4;
375
+ ${e.length}${e}`,"utf-8")),await this.client.authClient.Sign(e);if(this.UserInfo().walletName.toLowerCase()==="metamask")return this.SignMetamask({message:e,address:this.UserAddress()});throw Error("ElvWalletClient: Unable to sign")}else if(!tb)throw Error("ElvWalletClient: Unable to sign");const t={action:"personal-sign",message:e,logIn:!0};let r=new URL(this.appUrl);if(r.hash=da("/action","sign",pa.B58(JSON.stringify(t))),r.searchParams.set("origin",window.location.origin),!lme&&window.location.origin===r.origin)throw Error("ElvWalletClient: Unable to sign");return await new Promise(async(i,o)=>{await BP({mode:"tab",url:r.toString(),onCancel:()=>o("User cancelled sign"),onMessage:async(u,c)=>{if(!(!u||!u.data||u.data.type!=="FlowResponse"))try{i(u.data.response)}catch(p){o(p)}finally{c()}}})})}async LogInURL({mode:e="login",provider:t,marketplaceParams:r,clearLogin:i}){let o=new URL(this.appUrl);return o.hash="/login",o.searchParams.set("action","login"),typeof window<"u"&&o.searchParams.set("origin",window.location.origin),t&&o.searchParams.set("provider",t),e&&o.searchParams.set("mode",e),r?o.searchParams.set("mid",(await this.MarketplaceInfo({marketplaceParams:r})).marketplaceHash):(this.selectedMarketplaceInfo||{}).marketplaceHash&&o.searchParams.set("mid",this.selectedMarketplaceInfo.marketplaceHash),i&&o.searchParams.set("clear",""),o}async LogIn({method:e="redirect",provider:t,mode:r="login",callbackUrl:i,marketplaceParams:o,clearLogin:u=!1,callback:c}){let p=await this.LogInURL({mode:r,provider:t,marketplaceParams:o,clearLogin:u});e==="redirect"?(p.searchParams.set("response","redirect"),p.searchParams.set("source","origin"),p.searchParams.set("redirect",i),window.location=p):(p.searchParams.set("response","message"),p.searchParams.set("source","parent"),await new Promise(async(h,m)=>{await BP({mode:"tab",url:p.toString(),onCancel:()=>m("User cancelled login"),onMessage:async(w,b)=>{if(!(!w||!w.data||w.data.type!=="LoginResponse"))try{c?await c(w.data.params):await this.Authenticate({token:w.data.params.clientSigningToken||w.data.params.clientAuthToken}),h()}catch(g){m(g)}finally{b()}}})}))}async LogOut(){if(this.__authorization.nonce)try{await this.client.signer.ReleaseCSAT({accessToken:this.AuthToken()})}catch(e){this.Log("Failed to release token",!0,e)}if(this.__authorization={},this.loggedIn=!1,this.cachedMarketplaces={},D_)try{localStorage.removeItem(`__elv-token-${this.network}`)}catch{}}async TokenStatus(){return!this.__authorization||!this.__authorization.nonce?!0:await this.client.signer.CSATStatus({accessToken:this.AuthToken()})}async Authenticate({token:e}){let t;try{t=JSON.parse(this.utils.FromB58ToStr(e))||{}}catch{throw new Error("Invalid authorization token "+e)}if(!t.expiresAt||Date.now()>t.expiresAt)throw Error("ElvWalletClient: Provided authorization token has expired");return t.clusterToken&&await this.client.SetRemoteSigner({authToken:t.clusterToken,signerURIs:t.signerURIs}),this.client.SetStaticToken({token:t.fabricToken}),this.SetAuthorization({...t})}async AuthenticateOAuth({idToken:e,tenantId:t,email:r,signerURIs:i,shareEmail:o=!1,extraData:u={},nonce:c,createRemoteToken:p=!0,force:h=!1}){let m=24;!t&&this.selectedMarketplaceInfo&&(await this.AvailableMarketplaces(),t=this.selectedMarketplaceInfo.tenantId),await this.client.SetRemoteSigner({idToken:e,tenantId:t,signerURIs:i,extraData:{...u,share_email:o},unsignedPublicAuth:!0});let w,b;if(p&&this.client.signer.remoteSigner){b=Date.now()+24*60*60*1e3;const S=await this.client.signer.RetrieveCSAT({email:r,nonce:c,force:h});w=S.token,c=S.nonce}else b=Date.now()+m*60*60*1e3,w=await this.client.CreateFabricToken({duration:m*60*60*1e3,context:r?{usr:{email:r}}:{}});const g=this.client.utils.FormatAddress(this.client.CurrentAccountAddress());if(!r)try{r=JSON.parse(this.utils.FromB64URL(e.split(".")[1])).email}catch{throw Error("Failed to decode ID token")}return this.client.SetStaticToken({token:w}),{authToken:this.SetAuthorization({fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",register:!0,nonce:c}),signingToken:this.SetAuthorization({clusterToken:this.client.signer.authToken,fabricToken:w,tenantId:t,address:g,email:r,expiresAt:b,signerURIs:i,walletType:"Custodial",walletName:"Eluvio",nonce:c})}}async AuthenticateExternalWallet({address:e,tokenDuration:t=24,walletName:r="Metamask",Sign:i}){e||(e=window.ethereum.selectedAddress),e=this.utils.FormatAddress(e),i||(i=async c=>this.SignMetamask({message:c,address:e}));const o=Date.now()+t*60*60*1e3,u=await this.client.CreateFabricToken({address:e,duration:t*60*60*1e3,Sign:i,addEthereumPrefix:!1});return this.SetAuthorization({fabricToken:u,address:e,expiresAt:o,walletType:"External",walletName:r,register:!0})}ClientAuthToken(){return this.loggedIn?this.utils.B58(JSON.stringify(this.__authorization)):""}AuthToken(){return this.loggedIn?this.__authorization.fabricToken:this.publicStaticToken}SetAuthorization({clusterToken:e,fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,signerURIs:c,walletType:p,walletName:h,nonce:m,register:w=!1}){i=this.client.utils.FormatAddress(i),this.__authorization={fabricToken:t,tenantId:r,address:i,email:o,expiresAt:u,walletType:p,walletName:h,nonce:m},e&&(this.__authorization.clusterToken=e,c&&(this.__authorization.signerURIs=c)),this.loggedIn=!0,this.cachedMarketplaces={};const b=this.ClientAuthToken();if(this.storeAuthToken&&D_)try{localStorage.setItem(`__elv-token-${this.network}`,b)}catch{}return w&&this.client.authClient.MakeAuthServiceRequest({path:"/as/wlt/register",method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`}}).catch(g=>{this.Log("Failed to register account: ",!0,g)}),b}async SignMetamask({message:e,address:t}){if(!tb||!window.ethereum)throw Error("ElvWalletClient: Unable to initialize - Metamask not available");t=t||this.UserAddress();const r=await window.ethereum.request({method:"eth_requestAccounts"});if(t&&!pa.EqualAddress(r[0],t))throw Error(`ElvWalletClient: Incorrect MetaMask account selected. Expected ${t}, got ${r[0]}`);return await window.ethereum.request({method:"personal_sign",params:[e,t,""]})}FlowURL({type:e="flow",flow:t,marketplaceId:r,parameters:i={}}){const o=new URL(this.appUrl);return r?o.pathname=da("/",e,t,"marketplace",r,pa.B58(JSON.stringify(i))):o.pathname=da("/",e,t,pa.B58(JSON.stringify(i))),o.searchParams.set("origin",window.location.origin),o.toString()}async GenerateCodeAuth({url:e}={}){e||(e=await this.LogInURL({mode:"login"}),e.searchParams.set("response","code"),e.searchParams.set("source","code"));const t=await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","login","redirect","metamask"),method:"POST",body:{op:"create",dest:e.toString()}}));return t.code=t.id,t.url=t.url.startsWith("https://")?t.url:`https://${t.url}`,t.metamask_url=t.metamask_url.startsWith("https://")?t.metamask_url:`https://${t.metamask_url}`,t}async SetCodeAuth({code:e,address:t,type:r,authToken:i}){await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","login","session",e),method:"POST",headers:{Authorization:`Bearer ${this.AuthToken()}`},body:{op:"set",id:e,format:"auth_token",payload:JSON.stringify({addr:pa.FormatAddress(t),eth:t?`ikms${pa.AddressToHash(t)}`:"",type:r,token:i})}}))}async GetCodeAuth({code:e,passcode:t}){try{return await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","login","redirect","metamask",e,t),method:"GET"}))}catch(r){if(r&&r.status===404)return;throw r}}async LoadAvailableMarketplaces(e=!1){if(!e&&Object.keys(this.availableMarketplaces)>0)return;let t=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:"public/asset_metadata",resolveLinks:!0,linkDepthLimit:2,resolveIncludeSource:!0,resolveIgnoreErrors:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken,noAuth:!0,select:["info/marketplace_order","tenants/*/.","tenants/*/info/branding","tenants/*/marketplaces/*/.","tenants/*/marketplaces/*/info/tenant_id","tenants/*/marketplaces/*/info/tenant_name","tenants/*/marketplaces/*/info/branding","tenants/*/marketplaces/*/info/storefront/background","tenants/*/marketplaces/*/info/storefront/background_mobile"],remove:["tenants/*/info/branding/wallet_css","tenants/*/marketplaces/*/info/branding/custom_css"]});const r=((t||{}).info||{}).marketplace_order||[];if(t=(t||{}).tenants||{},this.previewMarketplaceId){let u="PREVIEW",c,p;Object.keys(t||{}).forEach(h=>Object.keys(t[h].marketplaces||{}).forEach(m=>{const w=t[h].marketplaces[m]["."].source;this.utils.DecodeVersionHash(w).objectId===this.previewMarketplaceId&&(u=h,c=m,w===this.previewMarketplaceHash&&(p=t[h].marketplaces[m]))})),p||(p=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"public/asset_metadata",produceLinkUrls:!0,authorizationToken:this.publicStaticToken,noAuth:!0,select:["slug","info/tenant_id","info/tenant_name","info/branding"],remove:["info/branding/custom_css"]}),c||(c=p.slug)),p["."]={source:this.previewMarketplaceHash},p.info["."]={source:this.previewMarketplaceHash},p.info.branding.preview=!0,p.info.branding.show=!0,t[u]=t[u]||{},t[u].marketplaces=t[u].marketplaces||{},t[u].marketplaces[c]=p}let i={...this.availableMarketplaces||{}},o={...this.availableMarketplacesById||{}};Object.keys(t||{}).forEach(u=>{try{i[u]=t[u]["."]?{versionHash:t[u]["."].source}:{},Object.keys(t[u].marketplaces||{}).forEach(c=>{try{const p=t[u].marketplaces[c]["."].source,h=this.utils.DecodeVersionHash(p).objectId;i[u][c]={...t[u].marketplaces[c].info||{},tenantName:t[u].marketplaces[c].info.tenant_name,tenantId:t[u].marketplaces[c].info.tenant_id,tenantSlug:u,marketplaceSlug:c,marketplaceId:h,marketplaceHash:p,tenantBranding:(t[u].info||{}).branding||{},order:r.findIndex(m=>m===c)},o[h]=i[u][c],this.marketplaceHashes[h]=p,this.selectedMarketplaceInfo&&(this.selectedMarketplaceInfo.tenantSlug===u&&this.selectedMarketplaceInfo.marketplaceSlug===c||this.selectedMarketplaceInfo.marketplaceId===h)&&(this.selectedMarketplaceInfo=i[u][c])}catch{this.Log(`Eluvio Wallet Client: Unable to load info for marketplace ${u}/${c}`,!0)}})}catch(c){this.Log(`Eluvio Wallet Client: Failed to load tenant info ${u}`,!0,c)}}),this.availableMarketplaces=i,this.availableMarketplacesById=o}async LatestMarketplaceHash({marketplaceParams:e}){const t=await this.MarketplaceInfo({marketplaceParams:e});if(this.previewMarketplaceId&&pa.EqualHash(this.previewMarketplaceId,t.marketplaceId))return this.previewMarketplaceHash;const r=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug),resolveLinks:!1,noAuth:!0});return j5(r)}async LoadMarketplace(e){const t=this.MarketplaceInfo({marketplaceParams:e}),r=t.marketplaceId,i=await this.LatestMarketplaceHash({marketplaceParams:e});if(this.cachedMarketplaces[r]&&this.cachedMarketplaces[r].versionHash!==i&&delete this.cachedMarketplaces[r],!this.cachedMarketplaces[r]){let o;this.previewMarketplaceId&&pa.EqualHash(r,this.previewMarketplaceId)?o=await this.client.ContentObjectMetadata({versionHash:this.previewMarketplaceHash,metadataSubtree:"/public/asset_metadata/info",localizationSubtree:this.localization?da("public","asset_metadata","localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}):o=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"info"),localizationSubtree:this.localization?da("/public","asset_metadata","tenants",t.tenantSlug,"marketplaces",t.marketplaceSlug,"localizations",this.localization,"info"):void 0,linkDepthLimit:1,resolveLinks:!0,resolveIgnoreErrors:!0,resolveIncludeSource:!0,produceLinkUrls:!0,authorizationToken:this.publicStaticToken}),o.branding.use_tenant_styling&&(o.tenantBranding=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("/public","asset_metadata","tenants",t.tenantSlug,"info","branding"),authorizationToken:this.publicStaticToken,produceLinkUrls:!0})||{}),o.items=await Promise.all(o.items.map(async(u,c)=>{if(u.requires_permissions){let p;this.loggedIn||(p=await this.client.CreateFabricToken({}));try{await this.client.ContentObjectMetadata({versionHash:j5(u.nft_template),metadataSubtree:"permissioned",authorizationToken:p}),u.authorized=!0}catch{u.authorized=!1}}return u.nftTemplateMetadata=(u.nft_template||{}).nft||{},u.nftTemplateHash=((u.nft_template||{})["."]||{}).source,u.itemIndex=c,u})),o.collections=(o.collections||[]).map((u,c)=>({...u,collectionIndex:c})),o.retrievedAt=Date.now(),o.marketplaceId=r,o.versionHash=i,o.marketplaceHash=i,this.previewMarketplaceId&&r===this.previewMarketplaceId&&(o.branding.preview=!0),["purchase_animation","purchase_animation_mobile","reveal_animation","reveal_animation_mobile"].forEach(u=>{try{if(o.storefront[u]){let c=new URL("https://embed.v3.contentfabric.io");const p=j5(o.storefront[u]);c.searchParams.set("p",""),c.searchParams.set("net",this.network==="main"?"main":"demo"),c.searchParams.set("ath",(this.__authorization||{}).authToken||this.publicStaticToken),c.searchParams.set("vid",p),c.searchParams.set("ap",""),u.startsWith("reveal")||(c.searchParams.set("m",""),c.searchParams.set("lp","")),o.storefront[`${u}_embed_url`]=c.toString()}}catch{}}),this.cachedMarketplaces[r]=o}return this.cachedMarketplaces[r]}async FilteredQuery({mode:e="listings",sortBy:t="created",sortDesc:r=!1,filter:i,editionFilters:o,attributeFilters:u,contractAddress:c,tokenId:p,currency:h,marketplaceParams:m,tenantId:w,collectionIndexes:b,priceRange:g,tokenIdRange:S,capLimit:A,userAddress:T,sellerAddress:R,lastNDays:L=-1,startTime:D,endTime:q,includeCheckoutLocked:W=!1,start:de=0,limit:ce=50}={}){b=(b||[]).map(ne=>parseInt(ne));let me={start:de,limit:ce,sort_descending:r};e==="owned"&&t==="created"&&(t="default"),e!=="leaderboard"&&(me.sort_by=t),e.includes("listings")&&W&&(me.checkout=!0);let Se,Ce;m&&(Se=await this.MarketplaceInfo({marketplaceParams:m}),b.length>0&&(Ce=await this.Marketplace({marketplaceParams:m})));try{let ne=[];R?ne.push(`seller:eq:${this.client.utils.FormatAddress(R)}`):T&&e!=="owned"&&ne.push(`addr:eq:${this.client.utils.FormatAddress(T)}`),Ce&&b.length>=0?b.forEach(F=>{Ce.collections[F].items.forEach(Q=>{if(!Q)return;const ae=Ce.items.find(k=>k.sku===Q);if(!ae)return;const N=pa.SafeTraverse(ae,"nft_template","nft","address");N&&ne.push(`${e==="owned"?"contract_addr":"contract"}:eq:${pa.FormatAddress(N)}`)})}):(Se||w)&&ne.push(`tenant:eq:${Se?Se.tenantId:w}`),c?(e==="owned"?ne.push(`contract_addr:eq:${pa.FormatAddress(c)}`):ne.push(`contract:eq:${pa.FormatAddress(c)}`),p&&ne.push(`token:eq:${p}`)):i&&(e.includes("listing")?ne.push(`nft/display_name:eq:${i}`):e==="owned"?ne.push(`meta/display_name:eq:${i}`):ne.push(`name:eq:${i}`)),o&&o.forEach(F=>{e.includes("listing")?ne.push(`nft/edition_name:eq:${F}`):e==="owned"?(ne.push(`meta:@>:{"edition_name":"${F}"}`),me.exact=!1):ne.push(`edition:eq:${F}`)}),u&&u.map(({name:F,value:j})=>{!F||!j||ne.push(`nft/attributes/${F}:eq:${j}`)}),h&&ne.push("link_type:eq:sol"),D||q?(D&&ne.push(`created:gt:${parseInt(D)/1e3}`),q&&ne.push(`created:lt:${parseInt(q)/1e3}`)):L&&L>0&&ne.push(`created:gt:${(Date.now()/1e3-L*24*60*60).toFixed(0)}`),g&&(g.min&&ne.push(`price:ge:${parseFloat(g.min)}`),g.max&&ne.push(`price:le:${parseFloat(g.max)}`)),S&&(S.min&&ne.push(`info/token_id:ge:${parseInt(S.min)}`),S.max&&ne.push(`info/token_id:le:${parseInt(S.max)}`)),A&&ne.push(`info/cap:le:${parseInt(A)}`);let ke,C;switch(e){case"owned":C=da("as","wlt",T||this.UserAddress());break;case"owned-full-meta":C=da("as","apigw","nfts"),ke={Authorization:`Bearer ${this.AuthToken()}`};break;case"listings":C=da("as","mkt","f");break;case"transfers":C=da("as","mkt","hst","f"),ne.push("action:eq:TRANSFERRED"),ne.push("action:eq:SOLD");break;case"sales":C=da("as","mkt","hst","f"),ne.push("action:eq:SOLD"),ne.push("seller:co:0x");break;case"listing-stats":C=da("as","mkt","stats","listed");break;case"sales-stats":C=da("as","mkt","stats","sold"),ne.push("seller:co:0x");break;case"leaderboard":C=da("as","wlt","leaders");break}if(ne.length>0&&(me.filter=ne),e.includes("stats"))return await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:me,headers:ke}));const{contents:_,paging:O}=await pa.ResponseToJson(await this.client.authClient.MakeAuthServiceRequest({path:C,method:"GET",queryParams:me,headers:ke}))||[],z=["owned","listings","owned-full-meta"];return{paging:{start:me.start,limit:me.limit,total:O.total,more:O.total>de+ce},results:(_||[]).map(F=>z.includes(e)?sme(this,F):F)}}catch(ne){if(ne.status&&ne.status.toString()==="404")return{paging:{start:me.start,limit:me.limit,total:0,more:!1},results:[]};throw ne}}async MintingStatus({marketplaceParams:e,tenantId:t}){t||(t=(await this.MarketplaceInfo({marketplaceParams:e||this.selectedMarketplaceInfo})).tenantId);try{return(await pa.ResponseToJson(this.client.authClient.MakeAuthServiceRequest({path:da("as","wlt","status","act",t),method:"GET",headers:{Authorization:`Bearer ${this.AuthToken()}`}}))).map(i=>{let[o,u,c]=i.op.split(":");u=u.startsWith("0x")?pa.FormatAddress(u):u;let p,h,m,w;if(o==="nft-buy"?p=c:o==="nft-claim"?(p=c,i.marketplaceId=u,i.extra&&i.extra[0]&&(u=i.extra.token_addr,h=i.extra.token_id_str)):o==="nft-redeem"?p=i.op.split(":").slice(-1)[0]:h=c,o==="nft-transfer"&&(p=i.extra&&i.extra.trans_id,h=i.extra&&i.extra.token_id_str||h,i.extra&&i.extra.gift_action==="nft-gift-claim"&&(w=i.extra.gift_id)),o==="nft-offer-redeem"&&(m=i.op.split(":")[3]),o==="nft-claim-entitlement"){let[b,g,S,A]=i.op.split(":");p=A,i.extra&&i.extra[0]&&(u=i.extra[0].token_addr,h=i.extra[0].token_id,u=u.startsWith("0x")?pa.FormatAddress(u):u,i.marketplaceId=g)}return{...i,timestamp:new Date(i.ts),state:i.state&&typeof i.state=="object"?Object.values(i.state):i.state,extra:i.extra&&typeof i.extra=="object"?Object.values(i.extra):i.extra,confirmationId:p,op:o,address:pa.FormatAddress(u),tokenId:h,offerId:m,giftId:w}}).sort((i,o)=>i.ts<o.ts?1:-1)}catch(r){return this.Log("Failed to retrieve minting status",!0,r),[]}}async DeployTenant({tenantId:e,tenantSlug:t="",tenantHash:r}){if(!r){const u=await this.client.ContentObjectMetadata({libraryId:this.mainSiteLibraryId,objectId:this.mainSiteId,metadataSubtree:da("public/asset_metadata/tenants",t),resolveLinks:!0,linkDepthLimit:1,resolveIncludeSource:!0,resolveIgnoreErrors:!0,select:["."]});if(!u)throw Error(`Eluvio Wallet Client: Invalid or missing tenancy: ${t}`);const c=u["."].source;r=await this.client.LatestVersionHash({versionHash:c})}const i={content_hash:r,ts:Date.now()},o=await this.client.Sign(JSON.stringify(i));await this.client.authClient.MakeAuthServiceRequest({path:da("as","tnt","config",e,"metadata"),method:"POST",body:i,headers:{Authorization:`Bearer ${o}`}})}}Object.assign(kd.prototype,nme());Object.assign(kd.prototype,rme());Object.assign(kd.prototype,ame());const{ElvClient:cme}=H8,fme=ki;var dme=cme,uh=fme;const Tz=Object.freeze(Object.defineProperty({__proto__:null,ElvClient:dme,Utils:uh},Symbol.toStringTag,{value:"Module"})),zP={default:{label:"Default",hlsSettings:uh.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class pme{constructor({player:e}){this.player=e,this.visible=!0,this.allowRotation=!0,this._activeMenus=0}__ToggleMenu(e){this._activeMenus=e?this._activeMenus+1:Math.max(0,this._activeMenus-1),this.player.__SettingsUpdate()}IsVisible(){return this.visible}IsMenuVisible(){return this._activeMenus>0}IsReady(){return!this.player.loading}IsPlaying(){return!this.player.video.paused}HasPlaybackStarted(){return this.player.playbackStarted}async Play(){return await this.player.__Play()}Pause(){this.player.video.pause()}TogglePlay(){return this.player.video.paused?(this.Play(),!0):(this.Pause(),!1)}Stop(){this.Pause(),this.Seek({time:0}),this.player.playbackStarted=!1,this.player.__SettingsUpdate()}GetCurrentTime(){return this.player.video.currentTime}GetDuration(){return this.player.video.duration}Seek({fraction:e,time:t,relativeSeconds:r}){if(!this.player.video||e&&!this.player.video.duration)return;const i=this.player.video.currentTime;return r?this.player.video.currentTime=Math.max(0,Math.min(this.player.video.duration,this.player.video.currentTime+r)):typeof e<"u"?this.player.video.currentTime=this.player.video.duration*e:this.player.video.currentTime=t,i<=this.player.video.currentTime}GetVolume(){return this.player.video.volume}SetVolume({fraction:e,relativeFraction:t}){return t?this.player.video.volume=Math.min(1,Math.max(0,this.GetVolume()+t)):this.player.video.volume=e,this.player.video.volume>0&&this.Unmute(!1),this.player.video.volume}IsMuted(){return this.player.video.muted}Mute(){this.player.video.muted=!0}Unmute(){this.player.video.muted=!1}ToggleMuted(){return this.player.video.muted=!this.player.video.muted,this.player.video.muted}IsFullscreen(){return(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)===this.player.target}Fullscreen(){this.player.target.requestFullscreen?this.player.target.requestFullscreen({navigationUI:"hide"}):this.player.target.mozRequestFullScreen?this.player.target.mozRequestFullScreen({navigationUI:"hide"}):this.player.target.webkitRequestFullscreen?this.player.target.webkitRequestFullscreen({navigationUI:"hide"}):this.player.target.msRequestFullscreen?this.player.target.msRequestFullscreen({navigationUI:"hide"}):this.player.target.querySelector("video").webkitEnterFullScreen()}ExitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}ToggleFullscreen(){return this.IsFullscreen()?(this.ExitFullscreen(),!1):(this.Fullscreen(),!0)}GetCollectionInfo(){if(!this.player.collectionInfo)return;const e={...this.player.collectionInfo};return e.content=e.content.map(t=>({...t,active:t.mediaIndex===e.mediaIndex})),e.active=e.content[e.mediaIndex],e}CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){this.player.loading||(this.player.__CollectionPlay({mediaId:t,mediaIndex:e,autoplay:r}),this.player.__SettingsUpdate())}CollectionPlayNext({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.min(t.mediaIndex+1,t.mediaLength-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}CollectionPlayPrevious({autoplay:e}={}){const t=this.GetCollectionInfo();if(!t)return;const r=Math.max(0,t.mediaIndex-1);r!==t.mediaIndex&&this.CollectionPlay({mediaIndex:r,autoplay:e})}IsLive(){return this.player.isLive}GetContentInfo(){if(this.player.playerOptions.title!==!1){const e=this.GetCollectionInfo();if(e&&e.active)return{title:e.active.title||"",subtitle:e.active.title||"",description:e.active.description||"",image:e.active.image&&e.active.image.url||"",posterImage:e.active.poster_image&&e.active.poster_image.url||"",headers:e.active.headers||[]};if(this.player.sourceOptions.contentInfo)return{title:this.player.sourceOptions.contentInfo.title,subtitle:this.player.sourceOptions.contentInfo.subtitle,description:this.player.sourceOptions.contentInfo.description,image:this.player.sourceOptions.contentInfo.image,posterImage:this.player.sourceOptions.contentInfo.posterImage,headers:this.player.sourceOptions.contentInfo.headers||[]}}}GetQualityLevels(){let e=[];if(this.player.hlsPlayer){if(e=this.player.hlsPlayer.levels.map((t,r)=>({index:r,active:this.player.hlsPlayer.currentLevel===r&&!this.player.hlsPlayer.autoLevelEnabled,resolution:t.attrs.RESOLUTION,bitrate:t.bitrate,audioTrack:!t.videoCodec,label:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:t.audioTrack?`${t.bitrate/1e3}kbps`:`${t.attrs.RESOLUTION}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1),e.length>0){const t=e.find(r=>this.player.hlsPlayer.currentLevel===r.index);e.unshift({index:-1,label:"Auto",activeLabel:t?`Auto (${t.activeLabel})`:"Auto",active:this.player.hlsPlayer.autoLevelEnabled})}}else this.player.dashPlayer&&(e=this.player.dashPlayer.getBitrateInfoListFor("video").map(t=>({index:t.qualityIndex,active:t.qualityIndex===this.player.dashPlayer.getQualityFor("video"),resolution:`${t.width}x${t.height}`,bitrate:t.bitrate,label:`${t.width}x${t.height} (${(t.bitrate/1e3/1e3).toFixed(1)}Mbps)`,activeLabel:`${t.width}x${t.height}`})).sort((t,r)=>t.bitrate<r.bitrate?1:-1));return{options:e,active:e.find(t=>t.active)}}SetQualityLevel(e){this.player.hlsPlayer?(this.player.hlsPlayer.nextLevel=e,this.player.hlsPlayer.streamController.immediateLevelSwitch()):this.player.dashPlayer&&(this.player.dashPlayer.setQualityFor("video",e),this.player.dashPlayer.updateSettings({streaming:{trackSwitchMode:"alwaysReplace",buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0},abr:{autoSwitchBitrate:{video:e===-1}}}})),this.player.__SettingsUpdate()}GetAudioTracks(){let e=[];return this.player.nativeHLS?e=Array.from(this.player.video.audioTracks).map(t=>({index:t.id,label:t.label||t.language,active:t.enabled})):this.player.hlsPlayer?e=this.player.hlsPlayer.audioTracks.map(t=>({index:t.id,label:t.name,active:t.id===this.player.hlsPlayer.audioTrack})):this.player.dashPlayer&&(e=this.player.dashPlayer.getTracksFor("audio").map(t=>({index:t.index,label:t.labels&&t.labels.length>0?t.labels[0].text:t.lang,active:t.index===this.player.dashPlayer.getCurrentTrackFor("audio").index}))),{options:e,active:e.find(t=>t.active)}}SetAudioTrack(e){if(this.player.nativeHLS)Array.from(this.player.video.audioTracks).forEach(t=>t.enabled=e.toString()===t.id);else if(this.player.hlsPlayer)this.player.hlsPlayer.audioTrack=e,this.player.hlsPlayer.streamController.immediateLevelSwitch();else if(this.player.dashPlayer){const t=this.player.dashPlayer.getTracksFor("audio").find(r=>r.index===e);this.player.dashPlayer.setCurrentTrack(t)}}GetTextTracks(){let e=[],t;return this.player.nativeHLS||this.player.hlsPlayer?(t=Array.from(this.player.video.textTracks).findIndex(r=>r.mode==="showing"),e=Array.from(this.player.video.textTracks).map((r,i)=>({index:i,label:r.label||r.language,language:r.language,active:r.mode==="showing"}))):this.player.dashPlayer&&(t=this.player.dashPlayer.getCurrentTextTrackIndex(),e=this.player.dashPlayer.getTracksFor("text").map((r,i)=>({index:i,label:r.labels&&r.labels.length>0?r.labels[0].text:r.lang,language:r.lang,active:i===t}))),e.length>0&&e.unshift({index:-1,label:"Disabled",active:t<0}),{options:e,active:e.find(r=>r.active)}}SetTextTrack(e){if(e=parseInt(e),this.player.nativeHLS||this.player.hlsPlayer){const t=Array.from(this.player.video.textTracks);t.map(r=>r.mode="disabled"),e>=0&&(t[e].mode="showing")}else this.player.dashPlayer&&this.player.dashPlayer.setTextTrack(e);e>=0&&(this.__lastTextTrackIndex=e),setTimeout(()=>this.player.__SettingsUpdate(),500)}ToggleTextTrack(){const{active:e,options:t}=this.GetTextTracks();if(t.length!==0){if(e&&e.index>=0)return this.SetTextTrack(-1),!1;if(this.__lastTextTrackIndex>=0)return this.SetTextTrack(this.__lastTextTrackIndex),!0;for(const r of navigator.languages){const i=t.find(o=>o.language===r||o.language===r.split("-")[0]);if(i)return this.SetTextTrack(i.index),!0}return this.SetTextTrack(0),!0}}GetPlaybackRates(){const e=["0.25","0.5","0.75","1","1.25","1.5","1.75","2"].map((r,i)=>({index:i,rate:parseFloat(r),label:`${r}x`,active:this.player.video.playbackRate.toFixed(2)===parseFloat(r).toFixed(2)}));let t=e.find(r=>r.active);return t||(t={index:-1,rate:this.player.video.playbackRate,label:`${this.player.video.playbackRate}x`,active:!0}),{options:e,active:t}}SetPlaybackRate({index:e,rate:t}){const r=this.player.video.playbackRate;if(t)return this.player.video.playbackRate=t,this.player.__SettingsUpdate(),{rate:t,increase:r<=t};{const i=this.GetPlaybackRates().options[e];if(i)return this.player.video.playbackRate=i.rate,this.player.__SettingsUpdate(),{rate:i.rate,increase:r<=i.rate}}}GetPlayerProfiles(){let e=[];return this.player.hlsPlayer&&(e=Object.keys(zP).map(t=>({index:t,label:zP[t].label,active:this.player.playerOptions.playerProfile===t}))),{options:e,active:e.find(t=>t.active)}}SetPlayerProfile({profile:e,customOptions:t={}}){this.player.SetPlayerProfile({profile:e,customHLSOptions:t})}ShowPlayerProfileForm(){this.player.__showPlayerProfileForm=!0,this.player.__SettingsUpdate()}HidePlayerProfileForm(){this.player.__showPlayerProfileForm=!1,this.player.__SettingsUpdate()}ContentVerified(){return this.player.contentVerified||!1}GetContentVerificationDetails(){return this.player.contentAudit||!1}GetOptions(){let e={quality:this.GetQualityLevels(),audio:this.GetAudioTracks(),text:this.GetTextTracks(),profile:this.GetPlayerProfiles(),rate:this.GetPlaybackRates()};return e.hasQualityOptions=e.quality.options.length>0,e.hasAudioOptions=e.audio.options.length>0,e.hasTextOptions=e.text.options.length>0,e.hasProfileOptons=e.profile.options.length>0,e.hasRateOptions=!this.IsLive(),e.hasAnyOptions=e.hasQualityOptions||e.hasAudioOptions||e.hasTextOptions||e.hasProfileOptons||e.hasRateOptions,e}AllowRotation(){return this.allowRotation}SetAllowRotation(e){this.allowRotation=e,this.player.__SettingsUpdate()}IsRotatable(){return this.IsFullscreen()&&window.innerWidth<900&&window.innerHeight>window.innerWidth&&this.player.video.videoWidth>this.player.video.videoHeight}RegisterVideoEventListener(e,t){return this.player.__RegisterVideoEventListener(e,t)}RegisterSettingsListener(e){return this.player.__RegisterSettingsListener(e)}Reset(){this.player.Reset()}Destroy(){this.player.Destroy()}}const Pn={PLAY:"play",PAUSE:"pause",MUTE:"muted",UNMUTE:"unmuted",VOLUME_UP:"volumeup",VOLUME_DOWN:"volumedown",SEEK_BACK:"seekback",SEEK_FORWARD:"seekforward",PLAYBACK_RATE_UP:"playbackrateup",PLAYBACK_RATE_DOWN:"playbackratedown",SUBTITLES_ON:"subtitleson",SUBTITLES_OFF:"subtitlesoff",PLAY_NEXT:"playnext",PLAY_PREVIOUS:"playprevious"},Rz=({player:n,setRecentUserAction:e,sideClickRatio:t=.1,doubleClickDelay:r=300})=>{let i,o,u,c;return window.addEventListener("focus",()=>{u=c||document.activeElement,c=document.activeElement},!0),()=>p=>{if(clearTimeout(o),p.target===p.currentTarget&&p.currentTarget.contains(u)&&!p.currentTarget.classList.contains("menu-active"))if(Date.now()-i<r){const h=p.target.getBoundingClientRect(),m=(p.clientX-h.left)/h.width;m<=t?(n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"})):m>=1-t?(n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"})):n.controls.ToggleFullscreen()}else o=setTimeout(()=>{const h=n.controls.TogglePlay();e({action:h?Pn.PLAY:Pn.PAUSE})},r);u=p.target,i=Date.now()}},Oz=(n,e)=>{let t=0;return()=>r=>{r.repeat||(t=0);const i=t<5?5:t<15?10:t<40?30:60;switch(r.key){case"ArrowLeft":r.preventDefault(),n.controls.Seek({relativeSeconds:-i}),e({action:Pn.SEEK_BACK,text:`${i} seconds`});break;case"ArrowRight":r.preventDefault(),n.controls.Seek({relativeSeconds:i}),e({action:Pn.SEEK_FORWARD,text:`${i} seconds`});break;default:return}t+=1}},hme=n=>e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),n.controls.SetVolume({relativeFraction:-.05});break;case"ArrowRight":e.preventDefault(),n.controls.IsMuted()?n.controls.SetVolume({fraction:.05}):n.controls.SetVolume({relativeFraction:.05});break}},s2=(n,e)=>{if(isNaN(e)||!isFinite(e)||e===0)return"00:00";const t=n>60*60,r=Math.floor(n/60/60),i=Math.floor(n/60%60),o=Math.floor(n%60);let u=`${i.toString().padStart(t?2:1,"0")}:${o.toString().padStart(2,"0")}`;return t&&(u=`${r.toString()}:${u}`),u},dk=async({player:n,pathOrUrl:e="",width:t})=>{if(typeof e=="string"&&(e.startsWith("http://")||e.startsWith("https://")))return e;if(e&&e.url)return e.url;const r=await n.__Client();let i;const{mediaCatalogObjectId:o,mediaCatalogVersionHash:u}=n.sourceOptions&&n.sourceOptions.mediaCollectionOptions||{},c=n.sourceOptions&&n.sourceOptions.playoutParameters||{};return u?i=u:o?i=await r.LatestVersionHash({objectId:o}):c.versionHash?i=c.versionHash:i=await r.LatestVersionHash({objectId:c.objectId}),i?(e=e&&e.toString().trim().replace(/^\./,"").replace(/\/+/,""),e.startsWith("files")?await r.FileUrl({versionHash:i,filePath:e.replace(/^files/,""),queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken}):await r.LinkUrl({versionHash:i,linkPath:e,queryParams:t?{width:t}:{},authorizationToken:c.authorizationToken})):""},Lz=(n,e)=>{let t={};return Object.keys(n).forEach(r=>{if(typeof n[r]=="object"&&!Array.isArray(n[r]))t[r]=Lz(n[r],(e||{})[r]);else{const i=(e||{})[r];t[r]=typeof i<"u"?i:n[r]}}),t},Nz=n=>Lz(BG,n),yme={default:{label:"Default",hlsSettings:uh.HLSJSSettings({profile:"default"})},low_latency:{label:"Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ll"})},ultra_low_latency:{label:"Ultra Low Latency Live",hlsSettings:uh.HLSJSSettings({profile:"ull"})},custom:{label:"Custom",hlsSettings:{}}};class o2{__RegisterVideoEventListener(e,t){this.video.addEventListener(e,t),this.__listenerDisposers.push(()=>this.video.removeEventListener(e,t))}__RegisterSettingsListener(e){return this.__settingsListeners.push(e),()=>this.__settingsListeners=this.__settingsListeners.filter(t=>t!==e)}constructor({target:e,video:t,parameters:r,SetErrorMessage:i}){this.loading=!0,this.target=e,this.video=t,this.SetErrorMessage=i,this.controls=new pme({player:this}),this.__settingsListeners=[],this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.playbackStarted=!1,this.reloads=0,this.canPlay=!1,this.isLive=!1,this.dvrEnabled=!1,this.behindLiveEdge=!1,this.publicMetadataUrl=void 0;try{r.playerOptions.hlsjsOptions&&Object.keys(r.playerOptions.hlsjsOptions).length>0&&(this.customHLSOptions=r.playerOptions.hlsjsOptions,r.playerOptions.playerProfile=jt.playerProfile.CUSTOM)}catch(o){this.Log(o,!0)}this.__Initialize(r)}async __Client(){return this.clientPromise&&await this.clientPromise,this.clientOptions.client||(this.clientPromise=(async()=>{const{ElvClient:e}=await Promise.resolve().then(()=>Tz);return this.clientOptions.client=await e.FromConfigurationUrl({configUrl:this.clientOptions.network}),this.clientOptions.client.SetStaticToken({token:this.clientOptions.staticToken||this.clientOptions.client.utils.B64(JSON.stringify({qspace_id:await this.clientOptions.client.ContentSpaceId()}))}),this.clientOptions.client})(),await this.clientPromise),this.clientOptions.client}async __PlayoutOptions(){const e=await this.__Client(),t=this.sourceOptions.playoutParameters||{};if(this.collectionInfo){const A=this.collectionInfo.content[this.collectionInfo.mediaIndex];t.objectId=e.utils.DecodeVersionHash(A.mediaHash).objectId,t.versionHash=A.mediaHash,this.sourceOptions.playoutOptions=void 0}let r,i,o={};(t.clipStart||t.clipEnd)&&(o.clip_start=parseFloat(t.clipStart||0),t.clipEnd&&(o.clip_end=parseFloat(t.clipEnd)));let u=await e.AvailableOfferings({objectId:t.objectId,versionHash:t.versionHash,writeToken:t.writeToken,linkPath:t.linkPath,directLink:t.directLink,resolveIncludeSource:!0,authorizationToken:t.authorizationToken})||{};if(r=u.default?"default":Object.keys(u)[0],t.offering?r=u[t.offering]?t.offering:void 0:(t.offerings||[]).length>0?r=t.offerings.find(A=>u[A]):t.offerings&&t.offerings.length>0&&(r=t.offerings.find(A=>u[A])),!r)throw new Error(`Unable to find offering from '${t.offering||t.offerings}'`);const c=u[r]&&u[r].properties||{};i=u[r].uri,o.ignore_trimming=t.ignoreTrimming,o.resolve=t.resolve,this.sourceOptions.contentInfo.liveDVR===jt.liveDVR.ON&&c.dvr_available?(o.dvr=1,this.dvrEnabled=!0):this.dvrEnabled=!1,c.live?this.isLive=!0:this.isLive=!1,t.directLink?this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({offeringURI:i,options:o})):this.sourceOptions.playoutOptions||(this.sourceOptions.playoutOptions=await e.PlayoutOptions({...t,offering:r,options:o}));let p=(await e.AvailableDRMs()).filter(A=>(this.sourceOptions.drms||[]).includes(A)),h=this.sourceOptions.protocols,m,w;for(;!(m&&w);)if(m=h.find(A=>this.sourceOptions.playoutOptions[A]),w=this.sourceOptions.drms.find(A=>p.includes(A)&&this.sourceOptions.playoutOptions[m].playoutMethods[A]),!w&&(h=h.filter(A=>A!==m),h.length===0))throw Error("No valid protocol / DRM combination available");const{playoutUrl:b,drms:g}=this.sourceOptions.playoutOptions[m].playoutMethods[w],S=b.split("/").find(A=>A.startsWith("hq__"));return{protocol:m,drm:w,playoutUrl:b,versionHash:S,drms:g,availableDRMs:p,offeringURI:i,offering:r,sessionId:this.sourceOptions.playoutOptions.sessionId,multiviewOptions:{enabled:this.sourceOptions.playoutOptions.multiview,AvailableViews:this.sourceOptions.playoutOptions.AvailableViews,SwitchView:this.sourceOptions.playoutOptions.SwitchView}}}__CollectionPlay({mediaIndex:e,mediaId:t,autoplay:r}){t&&(e=this.collectionInfo.content.find(i=>i.id===t)),this.collectionInfo.mediaIndex=e,this.__SettingsUpdate(),this.__Initialize(this.originalParameters,this.video?{muted:this.video.muted,volume:this.video.volume,playing:typeof r<"u"?r:!this.video.paused}:null)}async __LoadCollection(){if(this.collectionInfo)return;let{mediaCatalogObjectId:e,mediaCatalogVersionHash:t,collectionId:r}=this.sourceOptions&&this.sourceOptions.mediaCollectionOptions||{};if(!r)return;if(!e&&!t)throw{displayMessage:"Invalid collection options: Media catalog not specified"};const i=await this.__Client();try{const o=this.sourceOptions.playoutParameters.authorizationToken;t=t||await i.LatestVersionHash({objectId:e});const c=(await i.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/info/collections",authorizationToken:o,produceLinkUrls:!0})||[]).find(p=>p.id===r);if(!c)throw{displayMessage:`No collection with ID ${r} found for media catalog ${e||t}`};c.content=c.content.filter(p=>p.media).map((p,h)=>({...p,active:h===0,mediaId:p.id,mediaIndex:h,mediaHash:p.media&&p.media["/"]&&p.media["/"].split("/").find(m=>m.startsWith("hq__"))})),this.collectionInfo={...c,isPlaylist:c.type==="playlist",mediaIndex:0,mediaLength:c.content.length}}catch(o){throw this.Log("Failed to load collection:"),o}}async __Initialize(e,t){if(!this.__destroyed){this.__Reset(),this.initialized=!1,this.loading=!0,this.initTime=Date.now(),this.restartParameters=t,this.__SettingsUpdate(),e&&(this.originalParameters=Nz(e),this.clientOptions=e.clientOptions,this.sourceOptions=e.sourceOptions,this.playerOptions=e.playerOptions),this.errors=0,this.__Client();try{t&&(this.video.volume=t.volume,this.video.muted=t.muted,t.playing&&(this.playerOptions.autoplay=jt.autoplay.ON),t.currentTime&&this.__RegisterVideoEventListener("loadedmetadata",()=>this.video.currentTime=t.currentTime)),this.__RegisterVideoEventListener("play",()=>{this.reloads=0,this.playbackStarted=!0,this.__SettingsUpdate()}),this.__RegisterVideoEventListener("canplay",()=>{this.initTime&&!this.initTimeLogged&&(this.Log(`Player initialization: ${((Date.now()-this.initTime)/1e3).toFixed(2)} seconds`),this.initTimeLogged=!0,this.canPlay=!0,this.playerOptions.autoplay===jt.autoplay.ON&&this.controls.Play())}),this.__RegisterVideoEventListener("seeking",()=>{if(!this.isLive||!this.dvrEnabled)return;const m=this.video.duration-this.video.currentTime;this.behindLiveEdge=m>15,this.__SettingsUpdate()}),await this.__LoadCollection(),this.collectionInfo&&this.collectionInfo.isPlaylist&&this.collectionInfo.mediaIndex<this.collectionInfo.mediaLength-1&&this.__RegisterVideoEventListener("ended",()=>this.controls&&this.controls.CollectionPlayNext({autoplay:!0}));let{versionHash:r,playoutUrl:i,protocol:o,drm:u,drms:c,multiviewOptions:p}=await this.__PlayoutOptions();this.contentHash=r,i=new URL(i);const h=this.sourceOptions.playoutParameters.authorizationToken||i.searchParams.get("authorization");if(this.authorizationToken=h,this.__destroyed)return;o==="hls"?await this.__InitializeHLS({playoutUrl:i,authorizationToken:h,drm:u,drms:c,multiviewOptions:p}):await this.__InitializeDash({playoutUrl:i,authorizationToken:h,drm:u,drms:c,multiviewOptions:p}),this.playerOptions.collectVideoAnalytics&&Promise.resolve().then(()=>require("./Analytics-B5-vVweo.js")).then(({InitializeMuxMonitoring:m})=>m({appName:this.playerOptions.appName||"elv-player-js",elvPlayer:this,playoutUrl:i,authorizationToken:h,disableCookies:this.playerOptions.collectVideoAnalytics===jt.collectVideoAnalytics.DISABLE_COOKIES})),this.playerOptions.verifyContent&&setTimeout(()=>{this.__VerifyContent()},1e3),this.playerOptions.playerCallback&&this.playerOptions.playerCallback({player:this,videoElement:this.video,hlsPlayer:this.hlsPlayer,dashPlayer:this.dashPlayer}),this.__destroyed&&this.__DestroyPlayer(),this.initialized=!0,this.restartParameters=void 0}catch(r){let i;if(r&&[401,403].includes(r.status)||[401,403].includes(r.code))try{const o=await this.__Client(),u=this.sourceOptions.playoutParameters.linkPath?await o.LinkTarget({...this.sourceOptions.playoutParameters}):this.sourceOptions.playoutParameters.versionHash||await o.LatestVersionHash({objectId:this.sourceOptions.playoutParameters.objectId});i=await o.ContentObjectMetadata({versionHash:u,metadataSubtree:"public/asset_metadata/permission_message",authorizationToken:this.sourceOptions.playoutParameters.authorizationToken}),i?(r.permission_message=i,this.SetErrorMessage(i),typeof r=="object"?r.permission_message=i:this.Log(i,!0)):this.SetErrorMessage(r.displayMessage||"Insufficient permissions")}catch(o){this.SetErrorMessage(o.displayMessage||"Insufficient permissions")}else r.status>=500?this.__HardReload(r,1e4):this.__HardReload(r,2e4);this.playerOptions.errorCallback&&this.playerOptions.errorCallback(r,this)}finally{this.loading=!1,this.__SettingsUpdate()}}}async __InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,drms:i,multiviewOptions:o}){if(this.HLS=(await Promise.resolve().then(()=>require("./hls-VH5py-kh.js"))).default,[jt.drms.FAIRPLAY,jt.drms.SAMPLE_AES].includes(r)||!this.HLS.isSupported()){if(this.nativeHLS=!0,r===jt.drms.FAIRPLAY?cW({playoutOptions:this.sourceOptions.playoutOptions,video:this.video}):this.video.src=e.toString(),o.enabled){const u=o.SwitchView;o.SwitchView=async c=>{await u(c)}}}else{e.searchParams.delete("authorization");let u={};(r===jt.drms.PLAYREADY||r===jt.drms.WIDEVINE)&&(u={drmSystems:{},emeEnabled:!0,licenseXhrSetup:(m,w)=>{m.open("POST",w,!0),m.setRequestHeader("Authorization",`Bearer ${t}`)}},r===jt.drms.PLAYREADY?u.drmSystems={"com.microsoft.playready":{licenseUrl:i[r].licenseServers[0]}}:r===jt.drms.WIDEVINE&&(u.drmSystems={"com.widevine.alpha":{licenseUrl:i[r].licenseServers[0]}}));const c=(yme[this.playerOptions.playerProfile]||{}).hlsSettings||{},p=this.playerOptions.playerProfile===jt.playerProfile.CUSTOM?this.customHLSOptions:{};this.hlsOptions={capLevelToPlayerSize:this.playerOptions.capLevelToPlayerSize,xhrSetup:m=>(m.setRequestHeader("Authorization",`Bearer ${t}`),(this.playerOptions.hlsjsOptions||{}).xhrSetup&&this.playerOptions.hlsjsOptions.xhrSetup(m),m),...u,...c,...p},this.dvrEnabled&&(delete this.hlsOptions.liveMaxLatencyDuration,delete this.hlsOptions.liveMaxLatencyDurationCount);const h=new this.HLS(this.hlsOptions);if(this.playerOptions.maxBitrate&&h.on(this.HLS.Events.MANIFEST_PARSED,(m,{levels:w,firstLevel:b})=>{let g=w.map((S,A)=>S.bitrate>this.playerOptions.maxBitrate?A:void 0).filter(S=>typeof S<"u").reverse();g.length===w.length&&(this.Log(`Warning: Max bitrate '${this.playerOptions.maxBitrate}bps' is less than all available levels for this content.`),g=g.filter(S=>S>0)),this.Log("Removing the following levels due to maxBitrate setting:"),this.Log(g.map(S=>[w[S].width,"x",w[S].height,` (${(w[S].bitrate/1e3/1e3).toFixed(1)}Mbps)`].join("")).join(", ")),g.find(S=>b===S)&&(h.startLevel=w.map((S,A)=>A).filter(S=>!g.includes(S)).reverse()[0]),g.map(S=>h.removeLevel(S))}),h.loadSource(e.toString()),h.attachMedia(this.video),this.controls&&o.enabled){const m=o.SwitchView;o.SwitchView=async w=>{await m(w),h.nextLevel=h.currentLevel},this.controls.InitializeMultiViewControls(o)}[this.HLS.Events.SUBTITLE_TRACKS_UPDATED,this.HLS.Events.SUBTITLE_TRACK_SWITCH,this.HLS.Events.LEVEL_UPDATED,this.HLS.Events.LEVEL_SWITCHED,this.HLS.Events.AUDIO_TRACKS_UPDATED,this.HLS.Events.AUDIO_TRACK_SWITCHED,this.HLS.Events.MANIFEST_LOADED].map(m=>h.on(m,()=>this.__SettingsUpdate())),this.SetPlayerProfile=async({profile:m,customHLSOptions:w={}})=>{this.videoDuration=void 0,this.playerOptions.playerProfile=m,this.customHLSOptions=w;const b=!this.video.paused,g=this.video.currentTime;try{this.hlsPlayer.destroy()}catch(S){this.Log("Failed to destroy HLS player",!0),this.Log(S,!0)}await this.__InitializeHLS({playoutUrl:e,authorizationToken:t,drm:r,multiviewOptions:o}),b?this.video.play():this.video.pause(),this.isLive||(this.video.currentTime=g)},h.on(this.HLS.Events.FRAG_LOADED,()=>this.errors=0),h.on(this.HLS.Events.ERROR,async(m,w)=>{this.errors+=1,this.Log(`Encountered ${w.details}`,!0),this.Log(w,!0),w.response&&w.response.code===403?this.SetErrorMessage("Insufficient permissions"):this.errors<5?w.fatal&&(w.data&&w.data.type===this.HLS.ErrorTypes.MEDIA_ERROR?(this.Log("Attempting to recover using hlsPlayer.recoverMediaError"),h.recoverMediaError()):this.__HardReload(w)):this.__HardReload(w)}),this.hlsPlayer=h,this.player=h}}async __InitializeDash({playoutUrl:e,authorizationToken:t,drm:r,drms:i}){this.Dash=(await Promise.resolve().then(()=>require("./dash.all.min-DdJwXkcr.js")).then(c=>c.dash_all_min)).default;const o=this.Dash.MediaPlayer().create(),u=this.playerOptions.dashjsOptions||{};if(o.updateSettings({...u,streaming:{buffer:{fastSwitchEnabled:!0,flushBufferAtTrackSwitch:!0,...(u.streaming||{}).buffer||{}},text:{defaultEnabled:!1,...(u.streaming||{}).text||{}},...u.streaming||{}}}),this.playerOptions.capLevelToPlayerSize&&o.updateSettings({streaming:{abr:{limitBitrateByPortal:!0}}}),this.playerOptions.maxBitrate&&o.updateSettings({streaming:{abr:{maxBitrate:{video:this.playerOptions.maxBitrate/1e3}}}}),e.searchParams.delete("authorization"),o.extend("RequestModifier",function(){return{modifyRequestHeader:c=>(c.setRequestHeader("Authorization",`Bearer ${t}`),c),modifyRequestURL:c=>c}}),r===jt.drms.WIDEVINE){const c=i.widevine.licenseServers[0];o.setProtectionData({"com.widevine.alpha":{serverURL:c}})}o.initialize(this.video,e.toString(),this.playerOptions.autoplay===jt.autoplay.ON),[this.Dash.MediaPlayer.events.TRACK_CHANGE_RENDERED,this.Dash.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.Dash.MediaPlayer.events.REPRESENTATION_SWITCH,this.Dash.MediaPlayer.events.TEXT_TRACKS_ADDED,this.Dash.MediaPlayer.events.TEXT_TRACK_ADDED,this.Dash.MediaPlayer.events.MANIFEST_LOADED,this.Dash.MediaPlayer.events.CAN_PLAY].map(c=>o.on(c,()=>this.__SettingsUpdate())),this.video.textTracks.addEventListener("change",()=>this.__SettingsUpdate()),this.player=o,this.dashPlayer=o}async __Play(){try{return await this.video.play(),!0}catch(e){if(this.Log("Unable to autoplay",!0),this.Log(e,!0),this.playbackStarted=!1,this.playerOptions.muted===jt.muted.OFF_IF_POSSIBLE&&this.video.paused&&!this.video.muted){await new Promise(t=>setTimeout(t,250)),this.Log("Attempting to autoplay muted"),this.video.muted=!0;try{return await this.video.play(),!0}catch{return this.playbackStarted=!1,!1}}else return this.playbackStarted=!1,!1}}async __PublicMetadataUrl({versionHash:e,authorizationToken:t}){const r=await this.__Client();let i=!1;try{await r.ContentObjectMetadata({versionHash:e,metadataSubtree:"/public/name",noAuth:!0})}catch{i=!0}let o=new URL(r.NetworkInfo().name==="main"?"https://main.net955305.contentfabric.io":"https://demov3.net955210.contentfabric.io"),u=`s/${r.NetworkInfo().name}`;return i&&(u=`t/${t}`),o.pathname=`${u}/q/${e}/meta/public`,o.toString()}async __VerifyContent(){if(!this.contentHash)return;const e=await this.__Client(),t=this.isLive?await e.AuditStream({versionHash:this.contentHash,authorizationToken:this.authorizationToken}):await e.AuditContentObject({versionHash:this.contentHash,authorizationToken:this.authorizationToken});if(!t.verified)return;t.verifiedAt=Date.now();const r=e.utils.DecodeVersionHash(this.contentHash).objectId;t.details={_state:"initial",versionHash:this.contentHash,objectId:r,address:e.utils.HashToAddress(r),signatureMethod:"ECDSA secp256k1"},this.contentAudit=t,this.contentVerified=t.verified,this.publicMetadataUrl=await this.__PublicMetadataUrl({versionHash:this.contentHash,authorizationToken:this.authorizationToken}),this.__SettingsUpdate()}async __LoadVerificationDetails(){if(!this.contentHash||!this.contentAudit||this.contentAudit.details._state!=="initial"||this.contentAudit.loading)return;this.contentAudit.loading=!0;const e=await this.__Client(),t=e.utils.DecodeVersionHash(this.contentHash).objectId,r=await e.ContentObjectTenantId({objectId:t});let i,o,u;try{o=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"objectTimestamp"}),o&&(o=new Date(parseInt(o._hex,16)*1e3)),u=await e.CallContractMethod({contractAddress:e.utils.HashToAddress(t),methodName:"countVersionHashes"}),u&&(u=parseInt(u._hex,16))}catch{}try{i=await e.ContentObjectMetadata({libraryId:e.contentSpaceLibraryId,objectId:r.replace("iten","iq__"),metadataSubtree:"/public/name"})}catch{}this.contentAudit.details={_state:"minus-tx",versionHash:this.contentHash,objectId:t,address:e.utils.HashToAddress(t),explorerUrl:e.NetworkInfo().name!=="main"?void 0:`https://explorer.contentfabric.io/address/${e.utils.HashToAddress(t)}`,tenantId:r,tenantAddress:e.utils.HashToAddress(r),tenantName:i,ownerAddress:await e.ContentObjectOwner({objectId:t}),lastCommittedAt:o,versionCount:u,latestVersionHash:await e.LatestVersionHash({objectId:t}),signatureMethod:"ECDSA secp256k1"},this.__SettingsUpdate();try{if(e.NetworkInfo().name==="main"){const c=new URL("https://explorer.contentfabric.io/api");c.searchParams.set("module","account"),c.searchParams.set("action","txlist"),c.searchParams.set("offset","1"),c.searchParams.set("address",e.utils.HashToAddress(t)),this.contentAudit.details.latestTransactionHash=(await(await fetch(c)).json()).result[0].hash,this.contentAudit.details.latestTransactionHashUrl=`https://explorer.contentfabric.io/tx/${this.contentAudit.details.latestTransactionHash}`}}catch{}finally{this.contentAudit.details._state="full",delete this.contentAudit.loading,this.__SettingsUpdate()}}__SettingsUpdate(){this.__settingsListeners.forEach(e=>{try{e()}catch(t){this.Log("Failed to call settings listener",!0),this.Log(t,!0)}})}__SetControlsVisibility(e){this.controls.visible!==e&&(this.controls.visible=e,this.__SettingsUpdate())}__DestroyPlayer(){this.__destroyed=!0,this.__Reset()}__Reset(){if(this.player){this.Log("Destroying player"),this.video&&this.video.pause();try{this.hlsPlayer?this.hlsPlayer.destroy():this.dashPlayer&&this.dashPlayer.destroy()}catch(e){this.Log("Failed to destroy abr player",!0),this.Log(e,!0)}if(this.__listenerDisposers.forEach(e=>{try{e()}catch(t){this.Log("Failed to dispose of video event listener",!0),this.Log(t,!0)}}),this.__listenerDisposers=[],this.__showPlayerProfileForm=!1,this.video.mux)try{this.video.mux.destroy()}catch(e){this.Log("Error destroying mux monitoring:"),this.Log(e)}this.contentHash=void 0,this.nativeHLS=!1,this.hlsPlayer=void 0,this.dashPlayer=void 0,this.player=void 0,this.initTimeLogged=!1,this.canPlay=!1,this.isLive=!1,this.behindLiveEdge=!1,this.dvrEnabled=!1,this.publicMetadataUrl=void 0}}async __HardReload(e,t=6e3){if(!this.reloading){if(this.reloading=!0,this.reloads+=1,this.reloads>10){this.SetErrorMessage(e&&e.displayMessage||"Unable to play content");return}try{if(e&&this.playerOptions.restartCallback)try{const r=await this.playerOptions.restartCallback(e);if(r&&typeof r=="boolean"){this.Destroy();return}}catch(r){this.Log("Restart callback failed:"),this.Log(r)}if(this.SetErrorMessage(e&&e.displayMessage||"Something went wrong, reloading player..."),await new Promise(r=>setTimeout(r,t)),this.__destroyed)return;this.Log("Reloading stream");try{const r=await this.__Client();r.region?await r.UseRegion({region:r.region}):r.Nodes().fabricURIs.length>1&&await r.ResetRegion()}catch(r){this.Log("Client region reset failed:"),this.Log(r)}this.restarted=!0,this.SetErrorMessage(void 0),this.__Initialize(this.originalParameters,!this.video||!this.initialized?this.restartParameters:{muted:this.video.muted,volume:this.video.volume,currentTime:this.video.currentTime,playing:!this.video.paused})}finally{this.reloading=!1}}}Log(e,t=!1){t?console.error("ELUVIO PLAYER:",e):this.playerOptions.debugLogging&&console.warn("ELUVIO PLAYER:",e)}}o2.EluvioPlayerParameters=jt;o2.EluvioPlayer=o2;var Pz=function(){if(typeof Map<"u")return Map;function n(e,t){var r=-1;return e.some(function(i,o){return i[0]===t?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(t,r){var i=n(this.__entries__,t);~i?this.__entries__[i][1]=r:this.__entries__.push([t,r])},e.prototype.delete=function(t){var r=this.__entries__,i=n(r,t);~i&&r.splice(i,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var u=o[i];t.call(r,u[1],u[0])}},e}()}(),z8=typeof window<"u"&&typeof document<"u"&&window.document===document,u2=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),mme=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(u2):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),gme=2;function vme(n,e){var t=!1,r=!1,i=0;function o(){t&&(t=!1,n()),r&&c()}function u(){mme(o)}function c(){var p=Date.now();if(t){if(p-i<gme)return;r=!0}else t=!0,r=!1,setTimeout(u,e);i=p}return c}var bme=20,wme=["top","right","bottom","left","width","height","size","weight"],xme=typeof MutationObserver<"u",_me=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=vme(this.refresh.bind(this),bme)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,r=t.indexOf(e);~r&&t.splice(r,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!z8||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xme?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!z8||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=t===void 0?"":t,i=wme.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),Iz=function(n,e){for(var t=0,r=Object.keys(e);t<r.length;t++){var i=r[t];Object.defineProperty(n,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return n},im=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||u2},Dz=l3(0,0,0,0);function l2(n){return parseFloat(n)||0}function jP(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(r,i){var o=n["border-"+i+"-width"];return r+l2(o)},0)}function Sme(n){for(var e=["top","right","bottom","left"],t={},r=0,i=e;r<i.length;r++){var o=i[r],u=n["padding-"+o];t[o]=l2(u)}return t}function Cme(n){var e=n.getBBox();return l3(0,0,e.width,e.height)}function Eme(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return Dz;var r=im(n).getComputedStyle(n),i=Sme(r),o=i.left+i.right,u=i.top+i.bottom,c=l2(r.width),p=l2(r.height);if(r.boxSizing==="border-box"&&(Math.round(c+o)!==e&&(c-=jP(r,"left","right")+o),Math.round(p+u)!==t&&(p-=jP(r,"top","bottom")+u)),!kme(n)){var h=Math.round(c+o)-e,m=Math.round(p+u)-t;Math.abs(h)!==1&&(c-=h),Math.abs(m)!==1&&(p-=m)}return l3(i.left,i.top,c,p)}var Ame=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof im(n).SVGGraphicsElement}:function(n){return n instanceof im(n).SVGElement&&typeof n.getBBox=="function"}}();function kme(n){return n===im(n).document.documentElement}function Mme(n){return z8?Ame(n)?Cme(n):Eme(n):Dz}function Tme(n){var e=n.x,t=n.y,r=n.width,i=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return Iz(u,{x:e,y:t,width:r,height:i,top:t,right:e+r,bottom:i+t,left:e}),u}function l3(n,e,t,r){return{x:n,y:e,width:t,height:r}}var Rme=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=l3(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=Mme(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n}(),Ome=function(){function n(e,t){var r=Tme(t);Iz(this,{target:e,contentRect:r})}return n}(),Lme=function(){function n(e,t,r){if(this.activeObservations_=[],this.observations_=new Pz,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=r}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof im(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Rme(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof im(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(r){return new Ome(r.target,r.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),Uz=typeof WeakMap<"u"?new WeakMap:new Pz,Fz=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=_me.getInstance(),r=new Lme(e,t,this);Uz.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){Fz.prototype[n]=function(){var e;return(e=Uz.get(this))[n].apply(e,arguments)}});var Nme=function(){return typeof u2.ResizeObserver<"u"?u2.ResizeObserver:Fz}();const c3=({element:n,Hide:e})=>{if(!n)return;const t=o=>{o&&(o.key||"").toLowerCase()==="escape"&&e()},r=o=>{n.contains(o.target)||e()};let i=setTimeout(()=>{document.body.addEventListener("keydown",t),document.body.addEventListener("click",r,!0)},0);return()=>{clearTimeout(i),document.body.removeEventListener("keydown",t),document.body.removeEventListener("click",r,!0)}},Bz=({target:n,video:e,setVideoState:t})=>{const r=function(){const o=e.buffered;let u=0;for(let c=0;c<o.length;c++)o.start(c)>e.currentTime||o.end(c)>u&&(u=o.end(c));t({playing:!e.paused,duration:e.duration,volume:e.volume,muted:e.muted,rate:e.playbackRate,fullscreen:!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)})},i=["play","pause","volumechange","seeked","durationchange","ratechange"];return i.map(o=>e.addEventListener(o,r)),n.addEventListener("fullscreenchange",r),()=>{i.map(o=>e.removeEventListener(o,r)),n.removeEventListener("fullscreenchange",r)}},Pme=({video:n,setBufferFraction:e})=>{const t=()=>{if(!isFinite(n.duration))return 1;const r=n.buffered;let i=0;for(let o=0;o<r.length;o++)r.start(o)>n.currentTime||r.end(o)>i&&(i=r.end(o));e(1-(n.duration-i)/n.duration)};return n.addEventListener("progress",t),()=>n.removeEventListener("progress",t)},pk=({video:n,rate:e=10,setCurrentTime:t})=>{const r=setInterval(()=>{t(n.currentTime)},1e3/e);return()=>{clearInterval(r)}},Ime=({target:n,setSize:e,setOrientation:t,setDimensions:r})=>{let i;const o=()=>{clearTimeout(i);const c=n.getBoundingClientRect();let p="sm",h="landscape";c.width>1400&&c.height>600?p="xl":c.width>1e3&&c.height>400?p="lg":c.width>650&&c.height>300&&(p="md"),c.width<c.height&&(h="portrait"),e(p),t(h),i=setTimeout(()=>{r({width:c.width,height:c.height})},500)};o();const u=new Nme(o);return u.observe(n),()=>u.disconnect()},Dme=({player:n})=>{const e=n.video,t=n.playerOptions.autoplay===jt.autoplay.WHEN_VISIBLE,r=n.playerOptions.muted===jt.muted.WHEN_NOT_VISIBLE;if(!t&&!r)return;let i,o;const u=async([p])=>{t&&(i!=="play"&&p.isIntersecting&&e.paused?(n.controls.Play(),i="play"):i!=="pause"&&!p.isIntersecting&&!e.paused&&(n.controls.Pause(),i="pause")),r&&(o!=="unmute"&&p.isIntersecting&&e.muted?(e.muted=!1,o="unmute"):o!=="mute"&&!p.isIntersecting&&!e.muted&&(e.muted=!0,o="mute"))},c=new window.IntersectionObserver(u,{threshold:.1}).observe(e);return()=>c&&c.disconnect()},Ume=({player:n,inactivityPeriod:e=3e3,onSleep:t,onWake:r})=>{let i;const o=p=>{clearTimeout(i),r&&r(),i=setTimeout(()=>{t&&t()},p.type==="mouseout"?500:e)},u=["play","pause","volumechange","seeking"];u.forEach(p=>n.video.addEventListener(p,o));const c=["click","dblclick","keydown","mousemove","touchmove","blur","mouseout","fullscreenchange"];return c.forEach(p=>n.target.addEventListener(p,o)),()=>{u.map(p=>n.video.removeEventListener(p,o)),c.map(p=>n.target.removeEventListener(p,o))}},Fme=({player:n,setRecentUserAction:e})=>{if(n.playerOptions.keyboardControls===jt.keyboardControls.OFF)return;const t=n.playerOptions.keyboardControls===jt.keyboardControls.ARROW_KEYS_DISABLED,r=Oz(n,e)(),i=o=>{if(!(n.target===o.target||n.target.contains(o.target))||["button","input"].includes(document.activeElement&&document.activeElement.tagName.toLowerCase())||n.__showPlayerProfileForm)return;let u;switch(o.key){case" ":case"k":u=n.controls.TogglePlay(),e({action:u?Pn.PLAY:Pn.PAUSE});break;case"f":n.controls.ToggleFullscreen();break;case"m":u=n.controls.ToggleMuted(),e({action:u?Pn.MUTE:Pn.UNMUTE});break;case"ArrowDown":t||(u=n.controls.SetVolume({relativeFraction:-.1}),e({action:u===0?Pn.MUTE:Pn.VOLUME_DOWN,text:(u*100).toFixed(0)+"%"}));break;case"ArrowUp":t||(u=n.controls.SetVolume({relativeFraction:.1}),e({action:Pn.VOLUME_UP,text:(u*100).toFixed(0)+"%"}));break;case",":n.video.paused&&(n.controls.Seek({relativeSeconds:-1/60}),e({action:Pn.SEEK_BACK}));break;case".":n.video.paused&&(n.controls.Seek({relativeSeconds:1/60}),e({action:Pn.SEEK_FORWARD}));break;case"ArrowLeft":case"ArrowRight":t||r(o);break;case"j":n.controls.Seek({relativeSeconds:-10}),e({action:Pn.SEEK_BACK,text:"10 seconds"});break;case"l":n.controls.Seek({relativeSeconds:10}),e({action:Pn.SEEK_FORWARD,text:"10 seconds"});break;case"<":case">":const c=n.controls.GetPlaybackRates();c.active?u=n.controls.SetPlaybackRate({index:c.active.index+(o.key==="<"?-1:1)}):u=n.controls.SetPlaybackRate({rate:1}),e({action:u.increase?Pn.PLAYBACK_RATE_UP:Pn.PLAYBACK_RATE_DOWN,text:`${u.rate.toFixed(2)}x`});break;case"c":u=n.controls.ToggleTextTrack(),e({action:u?Pn.SUBTITLES_ON:Pn.SUBTITLES_OFF});break;case"P":n.controls.CollectionPlayPrevious(),e({action:Pn.PLAY_PREVIOUS});break;case"N":n.controls.CollectionPlayNext(),e({action:Pn.PLAY_NEXT});break;case"Home":n.controls.Seek({fraction:0}),e({action:Pn.SEEK_BACK});break;case"End":n.controls.Seek({fraction:1}),e({action:Pn.SEEK_FORWARD});break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u=n.controls.Seek({fraction:parseFloat(o.key)*.1}),e({action:u?Pn.SEEK_FORWARD:Pn.SEEK_BACK});break;default:return}o.preventDefault()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},Bme=({player:n})=>{if("mediaSession"in navigator){const e=["play","pause","stop","seekbackward","seekforward","seekto","previoustrack","nexttrack"];e.forEach(i=>{navigator.mediaSession.setActionHandler(i,o=>{switch(i){case"play":n.controls.Play();break;case"pause":n.controls.Pause();break;case"stop":n.controls.Stop();break;case"seekbackward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||-10});break;case"seekforward":n.controls.Seek({relativeSeconds:o&&o.seekOffset||10});break;case"seekto":o&&typeof o.seekTime<"u"&&n.controls.Seek({time:o.seekTime});break;case"previoustrack":n.controls.CollectionPlayPrevious();break;case"nexttrack":n.controls.CollectionPlayNext();break}})});let t=setInterval(()=>{navigator.mediaSession.playbackState=n.video.paused?"paused":"playing",navigator.mediaSession.setPositionState({duration:isFinite(n.video.duration)?n.video.duration||0:n.video.currentTime+1,playbackRate:n.video.playbackRate,position:n.video.currentTime})},1e3);const r=n.controls.RegisterSettingsListener(()=>{const{title:i}=n.controls.GetContentInfo()||{};(!navigator.mediaSession.metadata||navigator.mediaSession.metadata.title!==i)&&(navigator.mediaSession.metadata=new MediaMetadata({title:i}))});return()=>{clearInterval(t),r&&r(),navigator.mediaSession.metadata=null,e.forEach(i=>{navigator.mediaSession.setActionHandler(i,null)})}}},zme="_container_11xc9_1",jme="_autohide_11xc9_41",$me="_seek_11xc9_162",Hme="_controls_11xc9_195",qme="_time_11xc9_209",Vme="_spacer_11xc9_267",Gme="_watermark_11xc9_279",Wme="_fadein_11xc9_1",Kme="_menu_11xc9_37",In={container:zme,"container--default-controls":"_container--default-controls_11xc9_33","bottom-controls-container":"_bottom-controls-container_11xc9_37",autohide:jme,"info-container":"_info-container_11xc9_44","bottom-controls-container--autohide":"_bottom-controls-container--autohide_11xc9_45","icon-button":"_icon-button_11xc9_51","icon-button-active":"_icon-button-active_11xc9_65","info-image-container":"_info-image-container_11xc9_94","info-image":"_info-image_11xc9_94","info-text":"_info-text_11xc9_110","info-headers":"_info-headers_11xc9_119","info-description":"_info-description_11xc9_129","info-title":"_info-title_11xc9_135","info-subtitle":"_info-subtitle_11xc9_140","center-play-button":"_center-play-button_11xc9_148","center-play-button--hidden":"_center-play-button--hidden_11xc9_155",seek:$me,"bottom-controls-gradient":"_bottom-controls-gradient_11xc9_182",controls:Hme,"play-pause-button":"_play-pause-button_11xc9_205",time:qme,"live-indicator":"_live-indicator_11xc9_219","live-indicator--faded":"_live-indicator--faded_11xc9_229","collection-button-container":"_collection-button-container_11xc9_237","collection-button-text":"_collection-button-text_11xc9_242","collection-button-container--loading":"_collection-button-container--loading_11xc9_251",spacer:Vme,"floating-volume-toggle":"_floating-volume-toggle_11xc9_271",watermark:Gme,"content-verified-badge":"_content-verified-badge_11xc9_290","content-verification-menu-button":"_content-verification-menu-button_11xc9_291",fadein:Wme,"menu-control-container":"_menu-control-container_11xc9_305",menu:Kme},zz='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"> <circle cx="16" cy="16" r="16" fill="currentColor"/> <path d="M22 15.5L13.75 21.1292L13.75 9.87083L22 15.5Z" fill="black"/></svg>',jz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',$z='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><path d="M22.8,16l-11.6,7V9L22.8,16z" fill="black"/></svg>',Yme='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-pause"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',Hz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"><circle cx="16" cy="16" r="16" fill="currentColor"/><g> <rect x="10.4" y="9" width="4.5" height="14.1" fill="black"/> <rect x="17.5" y="9" width="4.5" height="14.1" fill="black"/></g></svg>',Jme='<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.46154 18.9985L5.84615 18.9942C6.03997 18.9942 6.22584 18.9172 6.36289 18.7801C6.49993 18.6431 6.57692 18.4572 6.57692 18.2634C6.57692 18.0696 6.49993 17.8837 6.36289 17.7467C6.22584 17.6096 6.03997 17.5326 5.84615 17.5326L1.46154 17.537V13.1538C1.46154 12.96 1.38455 12.7742 1.2475 12.6371C1.11046 12.5001 0.924581 12.4231 0.730769 12.4231C0.536957 12.4231 0.351083 12.5001 0.214037 12.6371C0.0769915 12.7742 0 12.96 0 13.1538V19H1.46154V18.9985ZM1.46154 0.00146249V3.57628e-07H0V5.84615C0 6.03997 0.0769915 6.22584 0.214037 6.36289C0.351083 6.49993 0.536957 6.57692 0.730769 6.57692C0.924581 6.57692 1.11046 6.49993 1.2475 6.36289C1.38455 6.22584 1.46154 6.03997 1.46154 5.84615V1.463L5.84615 1.46738C6.03997 1.46738 6.22584 1.39039 6.36289 1.25335C6.49993 1.1163 6.57692 0.930427 6.57692 0.736615C6.57692 0.542803 6.49993 0.35693 6.36289 0.219884C6.22584 0.0828385 6.03997 0.00584609 5.84615 0.00584609L1.46154 0.00146249V0.00146249ZM17.5385 18.9985V19H19V13.1538C19 12.96 18.923 12.7742 18.786 12.6371C18.6489 12.5001 18.463 12.4231 18.2692 12.4231C18.0754 12.4231 17.8895 12.5001 17.7525 12.6371C17.6155 12.7742 17.5385 12.96 17.5385 13.1538V17.537L13.1538 17.5326C12.96 17.5326 12.7742 17.6096 12.6371 17.7467C12.5001 17.8837 12.4231 18.0696 12.4231 18.2634C12.4231 18.4572 12.5001 18.6431 12.6371 18.7801C12.7742 18.9172 12.96 18.9942 13.1538 18.9942L17.5385 18.9985V18.9985ZM17.5385 0.00146249L13.1538 0.00584609C12.96 0.00584609 12.7742 0.0828385 12.6371 0.219884C12.5001 0.35693 12.4231 0.542803 12.4231 0.736615C12.4231 0.930427 12.5001 1.1163 12.6371 1.25335C12.7742 1.39039 12.96 1.46738 13.1538 1.46738L17.5385 1.463V5.84615C17.5385 6.03997 17.6155 6.22584 17.7525 6.36289C17.8895 6.49993 18.0754 6.57692 18.2692 6.57692C18.463 6.57692 18.6489 6.49993 18.786 6.36289C18.923 6.22584 19 6.03997 19 5.84615V3.57628e-07H17.5385V0.00146249V0.00146249Z" fill="currentColor"/></svg>',Qme='<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51.94 50.82"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:4px;}</style></defs><polyline class="cls-1" points="12.1 49.82 12.1 35.59 1 35.59"/><polyline class="cls-1" points="39.84 1 39.84 15.22 50.94 15.22"/><polyline class="cls-1" points="12.1 1 12.1 15.22 1 15.22"/><polyline class="cls-1" points="39.84 49.82 39.84 35.59 50.94 35.59"/></svg>',Zme='<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_363_9540)"><path d="M16.0889 9.77734C12.6223 9.77734 9.8667 12.5329 9.8667 15.9996C9.8667 19.4662 12.6223 22.2218 16.0889 22.2218C19.5556 22.2218 22.3111 19.4662 22.3111 15.9996C22.3111 12.5329 19.5556 9.77734 16.0889 9.77734ZM16.0889 20.444C13.6 20.444 11.6445 18.4885 11.6445 15.9996C11.6445 13.5107 13.6 11.5551 16.0889 11.5551C18.5778 11.5551 20.5334 13.5107 20.5334 15.9996C20.5334 18.4885 18.5778 20.444 16.0889 20.444Z" fill="currentColor"/><path d="M29.1556 13.0662L26.6667 12.2662L26.1334 10.9329L27.3778 8.62179C27.6445 8.08845 27.5556 7.37734 27.1112 6.9329L24.9778 4.79957C24.5334 4.35512 23.8223 4.26623 23.2889 4.5329L20.9778 5.77734L19.6445 5.24401L18.8445 2.75512C18.6667 2.22179 18.1334 1.77734 17.5112 1.77734H14.4889C13.8667 1.77734 13.3334 2.22179 13.2445 2.84401L12.4445 5.3329C11.9112 5.42179 11.4667 5.59957 11.0223 5.86623L8.71117 4.62179C8.17783 4.35512 7.46672 4.44401 7.02228 4.88845L4.88894 7.02179C4.4445 7.46623 4.35561 8.17734 4.62228 8.71068L5.77783 10.9329C5.60005 11.3773 5.42228 11.9107 5.2445 12.3551L2.75561 13.1551C2.22228 13.3329 1.77783 13.8662 1.77783 14.4885V17.5107C1.77783 18.1329 2.22228 18.6662 2.8445 18.844L5.33339 19.644L5.86672 20.9773L4.62228 23.2885C4.35561 23.8218 4.4445 24.5329 4.88894 24.9773L7.02228 27.1107C7.46672 27.5551 8.17783 27.644 8.71117 27.3773L11.0223 26.1329L12.3556 26.6662L13.1556 29.244C13.3334 29.7773 13.8667 30.2218 14.4889 30.2218H17.5112C18.1334 30.2218 18.6667 29.7773 18.8445 29.244L19.6445 26.6662L20.9778 26.1329L23.2889 27.3773C23.8223 27.644 24.5334 27.5551 24.9778 27.1107L27.1112 24.9773C27.5556 24.5329 27.6445 23.8218 27.3778 23.2885L26.1334 20.9773L26.6667 19.644L29.2445 18.844C29.7778 18.6662 30.2223 18.1329 30.2223 17.5107V14.4885C30.2223 13.8662 29.7778 13.244 29.1556 13.0662ZM28.4445 17.244L25.2445 18.2218L25.1556 18.6662L24.3556 20.5329L24.0889 20.9773L25.6889 23.9107L23.9112 25.6885L20.9778 24.0885L20.5334 24.3551C19.9112 24.7107 19.2889 24.9773 18.6667 25.1551L18.2223 25.244L17.2445 28.444H14.7556L13.7778 25.244L13.3334 25.1551L11.4667 24.3551L11.0223 24.0885L8.08894 25.6885L6.31117 23.9107L7.91117 20.9773L7.6445 20.5329C7.28894 19.9107 7.02228 19.2885 6.8445 18.6662L6.75561 18.2218L3.55561 17.244V14.7551L6.57783 13.8662L6.75561 13.4218C6.93339 12.7107 7.20005 12.0885 7.55561 11.4662L7.82228 11.0218L6.31117 8.08846L8.08894 6.31068L10.9334 7.91068L11.3778 7.64401C12.0001 7.28846 12.6223 7.02179 13.3334 6.84401L13.7778 6.66623L14.7556 3.55512H17.2445L18.2223 6.66623L18.6667 6.84401C19.2889 7.02179 19.9112 7.28846 20.5334 7.64401L20.9778 7.91068L23.9112 6.31068L25.6889 8.08846L24.0889 11.0218L24.3556 11.4662C24.7112 12.0885 24.9778 12.7107 25.1556 13.3329L25.2445 13.7773L28.4445 14.7551V17.244Z" fill="currentColor"/></g><defs><clipPath id="clip0_363_9540"><rect width="32" height="32" fill="currentColor"/></clipPath></defs></svg>',hk='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M5.3,1.4c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/><g> <rect x="7.7" y="3.4" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.4992 7.4586)" width="1.2" height="4.2" fill="currentColor"/> <rect x="6.1" y="4.9" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -1.5119 7.4281)" width="4.2" height="1.2" fill="currentColor"/></g></svg>',qz='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',Xme='<?xml version="1.0" encoding="utf-8"?><!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 13 12" style="enable-background:new 0 0 10.2 12;" xml:space="preserve"><path d="M8.4,9.8c0.6-0.6,1-1.2,1.3-1.9c0.3-0.7,0.5-1.5,0.5-2.3c0-0.8-0.2-1.6-0.5-2.3C9.4,2.5,9,1.9,8.4,1.3L7.8,2 c0.5,0.5,0.8,1,1.1,1.6c0.3,0.6,0.4,1.3,0.4,1.9c0,0.7-0.1,1.3-0.4,1.9C8.6,8.1,8.2,8.7,7.8,9.1L8.4,9.8z" fill="currentColor"/><path d="M7.1,8.5C7.5,8.1,7.8,7.6,8,7.1c0.2-0.5,0.3-1,0.3-1.6C8.3,5,8.2,4.5,8,4C7.8,3.4,7.5,3,7.1,2.6L6.5,3.3 c0.3,0.3,0.5,0.7,0.7,1c0.2,0.4,0.2,0.8,0.2,1.2c0,0.4-0.1,0.8-0.2,1.2C7,7.2,6.8,7.5,6.5,7.8L7.1,8.5z M5.3,1.4 c0.1,0,0.1,0.1,0.2,0.2c0,0.1,0.1,0.2,0.1,0.2v7.4c0,0.1,0,0.2-0.1,0.2c0,0.1-0.1,0.1-0.2,0.2c-0.1,0-0.2,0.1-0.3,0 c-0.1,0-0.2,0-0.2-0.1L2.6,7.8H0.5c-0.1,0-0.2,0-0.3-0.1C0,7.6,0,7.5,0,7.4V3.7c0-0.1,0-0.2,0.1-0.3c0.1-0.1,0.2-0.1,0.3-0.1h2.1 l2.2-1.7C4.9,1.4,4.9,1.4,5,1.4C5.1,1.4,5.2,1.4,5.3,1.4L5.3,1.4z" fill="currentColor"/></svg>',c2='<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.71196 11.08C10.4407 10.3533 11.0186 9.4898 11.4125 8.53906C11.8064 7.58832 12.0085 6.56911 12.0072 5.54C12.0085 4.51089 11.8064 3.49168 11.4125 2.54094C11.0186 1.5902 10.4407 0.726679 9.71196 0L9.05933 0.65171C9.7023 1.2929 10.2122 2.05484 10.5598 2.89374C10.9073 3.73264 11.0856 4.63196 11.0845 5.54C11.0845 7.44904 10.3102 9.17741 9.05933 10.4283L9.71196 11.08V11.08Z" fill="currentColor"/><path d="M8.40781 9.77644C8.96502 9.2207 9.40692 8.56034 9.70812 7.83329C10.0093 7.10624 10.1639 6.32683 10.1629 5.53986C10.1639 4.75289 10.0093 3.97349 9.70812 3.24644C9.40692 2.51939 8.96502 1.85902 8.40781 1.30328L7.7561 1.95499C8.22759 2.42525 8.60149 2.98403 8.85634 3.59924C9.11119 4.21445 9.24195 4.87396 9.24112 5.53986C9.2422 6.20586 9.11164 6.8655 8.85694 7.48087C8.60225 8.09625 8.22845 8.65522 7.75703 9.12565L8.40781 9.77644Z" fill="currentColor"/><path d="M7.10429 8.47307C7.49005 8.08831 7.79596 7.6311 8.00446 7.12773C8.21296 6.62436 8.31993 6.08475 8.31922 5.53991C8.31993 4.99507 8.21296 4.45546 8.00446 3.95209C7.79596 3.44872 7.49005 2.99152 7.10429 2.60675L6.45258 3.25846C6.75261 3.55774 6.99054 3.91337 7.15269 4.30489C7.31483 4.69642 7.39801 5.11614 7.39742 5.53991C7.39795 5.96368 7.31476 6.38338 7.15261 6.7749C6.99047 7.16642 6.75257 7.52205 6.45258 7.82136L7.10429 8.47307ZM5.26991 1.43791C5.348 1.47553 5.4139 1.53441 5.46004 1.60778C5.50618 1.68115 5.5307 1.76605 5.53078 1.85272V9.2271C5.53066 9.31383 5.50607 9.39876 5.45984 9.47214C5.4136 9.54551 5.34761 9.60436 5.26943 9.64191C5.19125 9.67945 5.10407 9.69418 5.01789 9.6844C4.93172 9.67462 4.85005 9.64072 4.78228 9.5866L2.60408 7.8444H0.460899C0.338661 7.8444 0.221429 7.79585 0.134994 7.70941C0.0485588 7.62298 0 7.50574 0 7.38351V3.69632C0 3.57408 0.0485588 3.45685 0.134994 3.37041C0.221429 3.28398 0.338661 3.23542 0.460899 3.23542H2.60408L4.78228 1.49322C4.8501 1.43901 4.93185 1.40506 5.01812 1.39527C5.1044 1.38549 5.19168 1.40027 5.26991 1.43791V1.43791Z" fill="currentColor"/></svg>',ege='<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M1.5 8L24 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M8.5 1L1.5 8L8.5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',$P='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="currentColor"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="currentColor"/></svg>',tge='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.2374" cy="45.798" r="45.2374" fill="currentColor"/><path d="M62.8896 63.918L62.8897 28.2377L34.8552 46.0779L62.8896 63.918Z" fill="black"/><path d="M45.3281 63.918L45.3281 28.2377L17.2937 46.0779L45.3281 63.918Z" fill="black"/></svg>',HP='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="currentColor"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="currentColor"/></svg>',nge='<svg width="91" height="92" viewBox="0 0 91 92" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="45.7169" cy="45.796" r="45.2374" fill="currentColor"/><path d="M26.8555 28.9512V64.6314L54.8899 46.7913L26.8555 28.9512Z" fill="black"/><path d="M44.417 28.9512V64.6314L72.4515 46.7913L44.417 28.9512Z" fill="black"/></svg>',yk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M3.1,16L30.8,0v32L3.1,16z" fill="currentColor"/> <rect y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',mk='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30.8 32" style="enable-background:new 0 0 30.8 32;" xml:space="preserve"><g> <path d="M27.7,16L0,32V0L27.7,16z" fill="currentColor"/> <rect x="24.6" y="3.7" width="6.2" height="24.6" fill="currentColor"/></g></svg>',Vz='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',Iy='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>',rge='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>',age='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path></svg>',ige='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-badge-cc" width="48" height="48" viewBox="0 0 24 24" stroke="black" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <rect x="3" y="5" width="18" height="14" rx="2" stroke="currentColor"></rect> <path d="M10 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M17 10.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0" stroke="currentColor"></path> <path d="M3 3l18 18" stroke="currentColor"></path></svg>',sge='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-rotate-cw"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>',f2='<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15 27.5C15 27.5 25 22.5 25 15V6.25L15 2.5L5 6.25V15C5 22.5 15 27.5 15 27.5Z" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/><path d="M19.715 11.3574L13.8221 17.8396L11.1436 14.8931" stroke="currentColor" stroke-width="2.14286" stroke-linecap="round" stroke-linejoin="round"/></svg>',qP='<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M23.7508 12.9997V23.7508H13.0003C7.05943 23.7508 2.24919 18.9406 2.24919 12.9997C2.24919 7.05888 7.05943 2.24864 13.0003 2.24864C18.9411 2.24864 23.7508 7.05888 23.7508 12.9997ZM0 12.9997C0 5.82396 5.82396 0 12.9997 0C20.1755 0 26 5.82396 26 12.9997V25.9995H13.0003C5.82396 25.9995 0 20.1755 0 12.9997ZM5.174 13.5197C5.174 16.1976 6.98078 18.4599 9.85371 18.4599C12.2198 18.4599 13.8185 16.9 14.2084 14.8589H11.8686C11.5698 15.7951 10.8155 16.367 9.85371 16.367C8.39758 16.367 7.44886 15.2227 7.44886 13.5202C7.44886 11.8178 8.39813 10.6735 9.85371 10.6735C10.7899 10.6735 11.5305 11.2066 11.8429 12.0903H14.1959C13.7797 10.1011 12.1941 8.58055 9.85371 8.58055C6.96822 8.58001 5.174 10.8418 5.174 13.5197ZM17.3419 8.83999H15.132V18.2131H17.4331V13.3253C17.4331 12.4022 17.6931 11.8041 18.1349 11.4273C18.5249 11.0761 19.0318 10.8942 19.8642 10.8942H20.4491V8.72256H19.8773C18.668 8.72256 17.8624 9.16442 17.3424 9.8406V8.82633V8.83999H17.3419Z" fill="currentColor"/></svg>',oge='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>';(function(n,e){(function(t,r){r()})(Fa,function(){function t(i){var o=!0,u=!1,c=null,p={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function h(W){return!!(W&&W!==document&&W.nodeName!=="HTML"&&W.nodeName!=="BODY"&&"classList"in W&&"contains"in W.classList)}function m(W){var de=W.type,ce=W.tagName;return!!(ce==="INPUT"&&p[de]&&!W.readOnly||ce==="TEXTAREA"&&!W.readOnly||W.isContentEditable)}function w(W){W.classList.contains("focus-visible")||(W.classList.add("focus-visible"),W.setAttribute("data-focus-visible-added",""))}function b(W){W.hasAttribute("data-focus-visible-added")&&(W.classList.remove("focus-visible"),W.removeAttribute("data-focus-visible-added"))}function g(W){W.metaKey||W.altKey||W.ctrlKey||(h(i.activeElement)&&w(i.activeElement),o=!0)}function S(W){o=!1}function A(W){h(W.target)&&(o||m(W.target))&&w(W.target)}function T(W){h(W.target)&&(W.target.classList.contains("focus-visible")||W.target.hasAttribute("data-focus-visible-added"))&&(u=!0,window.clearTimeout(c),c=window.setTimeout(function(){u=!1},100),b(W.target))}function R(W){document.visibilityState==="hidden"&&(u&&(o=!0),L())}function L(){document.addEventListener("mousemove",q),document.addEventListener("mousedown",q),document.addEventListener("mouseup",q),document.addEventListener("pointermove",q),document.addEventListener("pointerdown",q),document.addEventListener("pointerup",q),document.addEventListener("touchmove",q),document.addEventListener("touchstart",q),document.addEventListener("touchend",q)}function D(){document.removeEventListener("mousemove",q),document.removeEventListener("mousedown",q),document.removeEventListener("mouseup",q),document.removeEventListener("pointermove",q),document.removeEventListener("pointerdown",q),document.removeEventListener("pointerup",q),document.removeEventListener("touchmove",q),document.removeEventListener("touchstart",q),document.removeEventListener("touchend",q)}function q(W){W.target.nodeName&&W.target.nodeName.toLowerCase()==="html"||(o=!1,D())}document.addEventListener("keydown",g,!0),document.addEventListener("mousedown",S,!0),document.addEventListener("pointerdown",S,!0),document.addEventListener("touchstart",S,!0),document.addEventListener("visibilitychange",R,!0),L(),i.addEventListener("focus",A,!0),i.addEventListener("blur",T,!0),i.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&i.host?i.host.setAttribute("data-js-focus-visible",""):i.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window<"u"&&typeof document<"u"){window.applyFocusVisiblePolyfill=t;var r;try{r=new CustomEvent("focus-visible-polyfill-ready")}catch{r=document.createEvent("CustomEvent"),r.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(r)}typeof document<"u"&&t(document)})})();const Gz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAW0AAABSCAYAAACfWoXuAAAACXBIWXMAAC4jAAAuIwF4pT92AAAMX0lEQVR4nO2d/XEbtxbF4Tf+N5ptIEO6gYipQHQDz3QDT0wDkfIKiKUGYvk1IKqBJzoNmKwgZBoINWmApgtQBtJdaSUtDrDLXewCOL8ZjsciRe0H9uDifuC+ur29VYQQQsLgNe8TISRBhkqpUeGVKaWOHC7DV6XUSim1lX8Xhf97Ibe0x5Hds/yC2jCd90ZeoZEPvjIWAZ6PqnFOQ3mVEep9LQM9s77vdSb3qQyvgmZhItdN/zto+LvXct1njtpTm1y0Y/ORLB0nItN5nyulzho+Jh8sgLXwKsDzUTXOST+Q14bPr4G4hISelP4yHO9nuQY+0c/aF8Pfe9uxwaCv1VReTQu1iRul1IUIeOMT1r+a/kJCOmYuD00Zh8AKD4kpONY5B+AdQxFNPbl98CjYSv7WRxmHZ2ClWAuKNokRJFynEZyvSbR3IlQpk4mVq8X6uOPrcCATxk2TK3eKNomRC3BOvl0HTTMCVqPJLZQKExHIk4bOdymvfcnFe9WEe47ZIyRGNuK/Piw5t4H4YEMNzKKVQqpWdibn/q7G7y4LGSAbhyDiuBB4HTtmnOTo8fjHvjEzm2h/bTsS2hIhHjNpFm1tXxq+cRqwaL83/Pwm4HPah5EIdtkEbeJKXGh1/P/5Nc5/NxMLf1Jh0vhQyGKpHKi0ifYqwnRAkgZzINrvLcG8vjKRpXYZKVrZI7GUTdekyE6CgxcNZ3Rs5drPJPh55uhLP5IJYFrVyKRPm8TKViyqMg4CFW10zKmJ9lRcDS6CfS5usbOWc8Y3clxvJPXSxqFMOpX83BRtEjNo+RtaQDIDy+9lREVDLkzBKqqIjmv86EGsn7OR8aVz1P+2fPagqnBTtEnMzGVZXMa7pvNnWwZNMilZ2Vrc/ufwuXP5bJfxLe3++MHB6tbC/bvreKRok9hBFllILhJT1sguoYIa7TPWVul34DM7iVn0paJ5KxPuueVz37sGkinaJHaQFRqKaA9BdsR1j/b2aBs9OSEf9k4CfH2cxPQk8pPlM4eWGoM7KNokdlbi2ywjlLJ25mbfix5K68sFu8/pvjMH4T6xxVso2iQFQre2TQ9xKrnZI8ltNvEtAMHOcRHuK+TfpmiTFAhZtMegbD0VK9t2nj8HVlA3A+moSlxARp88RZukwBZE8Ac936419dzsU4tb5FOg12EK3HZK3CSl45KiTVIBPdh93vnPVLaeQm52Zsm6WAe6733ORFw7JkqDkhRtkgooZ9skjF0zTbxs/dSSLXIaeOaMnnR/Be8flW0jQtEmKWHK2T7oaYWk6ZhSyc3+Bbx3FUkQ9gI07VBlKwmKNkmJkAKSqGw9hdxstMr4Frhb5Dlo7B09T0ulaJOUWAGrpm9l7QxAmvktMn/+wtJs4cm1oGiT1Ailq41JtFPIzUYVoCrSSQuNyyd53RRtkhoh9I9EopWClY0mz6tIs2ZQQ+onMReKNkmNDcjZ7ktZe+pl66l2m0f3lqJNkgY9+H0ISJoszRRys9EqQ1uiqYr2Q+ofRZukyAzkbHct2qmXraP2hrH78jegSnKQrwIp2iRVrg3n3XVZu2nSSCU3G4l2CuePJqa7FRhFm6QKitZ3ZW1noDozlX2z0YSZwo6GaGK6uzYUbZIqKGfbtnVmW7DbutmfvU5k0kITE0WbJI/J2u6qrD31fbNT9mcXQU07KNokafrUrX0IytZTsbKRaySk/bL3BZ3rmKJNUmYDyoePPZe1s9s6vt6xpzoWQeeaUbRJ6jgVNHjAFPxMITc7h5b2PdCv/dryy5nFz9Q3UvJ7kWaYS/eTsgDg1JOVO0q8bD0HWdqpdJy3YhNtPZC+9OA4XXkVxmGSHrGVdLrjkkPKt8Vs29JNPTc7xyTaqC1XjCDjc0j3CCHdu0hMfyOV3Owc02qDVvYjFG1CxLIx5Wy3vfPfhN3WSRUo2oTcYxLItsvaU8/NJhWhaBNyTxetyFDZOq1sUgpFm5B7UM52W2XtLFsnlbGJ9lIyMkJ5EbIPJqFsq6w95X2zSU1oaRPyyFw6fZfRtGizbJ3UgqJNyCM6tez/huvxvuGydjQJpJSbXcTknupTl3wfoPNdUbQJeYpJMJt2kZhSCa+Yl/wC1Jk9RlC20paiTchTUFfspkR7BHKzU7WylW2jJI/H0TXwXCnahLzEJJzvGurWbkohjL1xrQ0k2l22gPMN7N5D0SbkJagVWRPWtimFMGXBVhTtB+geIaQiqCv2voU2KDcbTRYpQNG+B25RS9GOCwawmsMkoId7CojJUl8zN9veHzEBMhDvuMuuoWjHRUobxX9t+fuRq6KutZ0ZtoBVtLIfQP0Rm4gn9B3Uv+Du+aZop0NsA77tCWor6Xdl1PVrMzfbDrK2Q2rIUhc0RijaiRGqaB91+LdNQjqoKdwmC5252Y8g0e6iQ75vrB3pKdokVHz4f7Vo/214r6qADMEERCv7ESTaOuUy5nxtlL//EPOgaMdFbEtLdMy+gnZNlbWjfbMp2o/oFcdn8H7M1jZquPHwbFO00yFE9wg6Zl9B16Z2/jM9kBTslyDjo629zbsG7a2uiuOQoh0XsVnaSLR9WdorkNHgKtpo2cuskZegXQ6PIg1ITkH+/k3RSKFox4dp34xBgNa2Nf3JEyYRcfWxmqxD5maXY3ORxGhtI9fIk4mdoh0fSMxCs1BMgTuT5dsW+7YiM5Wt08o2g67NcWTW9ilYiann44+iHR+xpEyhY/Xd8BZZfjbRRmXr9GebQR3yNWddH2BD6JXaOfiqF+mgFO34QEIQUspUn0RbAWvbVqnH3Oz6IGE+srgUQuECTOqq7BpQtONjY7FQQvAH2iLpXYi2ngx3hvdM4pGBlmK0su3MLGP5PPBK3wnY1kDJxP4i5kHRjhPkgw3BOkEuhc8dWqiXhp+bVgXMzd4fZGQcBHwdM7BNghIDofRZpWjHCRLtQQDWNloWd/mQmq7rwBAYY272/iwsmSSHgTZCXljcIh9NxglFO042oEmq6nkQ5wxE0ncdP6AoZ/v5RDgEvQ2ZNVKNU+CaUuJiCCkNcGbpe7lGzyhFO16QMA96Ktxa6P4L3v/o8VhMmCaN5z545mY3x8bi+1XiugpBuGeWc/lmOw+KdrwsLNb2hx7mumq3wXeG93Y9sVBRt/biw2Z68Ghl12Nu8QGrAITbJtian22FYxTtuLFZ05971BHEtmQ86UmK3Ab4WPPAY1+6rWcyBvQEfitiMAs440K7SWyFVZc99HFncg9sgn3lcuwU7bixWdsH8n7Xwm2zQJY9exBRt/YMBCB95mbre/qnrKjyytJDuc5/BVoKrq/dGGyXm3MsE1QfJqex3AfbvvBL13tC0Y6fqSWIkwt3F9WSmTxcSLB3PRSYGbimU5Bj7svKzuRvfQ8+cxloKbgW7n9bxrSSCWrdYYprJq6wL5b7oOQ4nZ8/inb8uARxtHBfyyDzVTE5lXxl5BJR4hbpY+Du2vDzj4ZULp+52VPLXhY5ofrXV2K52oT7QO7HyvMENRXr+sThs2s5NucVGEU7DbRY/OJwpiciLtMWxXsibptLS56qkoq3vubgVhU8n75sV6st5Ga5K5mYXDYPOxSLd9Hiqi2T797I2LZZ10rcZZUEW/Pq9lbHJ+6CFLHx1qHcOYbzdjnPHJfodc6uENTZdxvUkQzoiaMFqPkUQPXmpsL5vPG4YlhU6K1ZZfyYGIsotvX9iNwN4TquVWFsz/c8tkzOfSIuMZsRUuS8btrt6zq/RIJlWrBybRyI5X0ig/wP+d2Ng/iMC//+WHEwK9nKNIQqtwvH3PE+52aHvmnVVsb1SoTQZawVx7aSmM5Kvssm4mNZnYwcXHtl7CRgXXuyoKUdPnUsmbGkrVUV07bRWQH/6WhDqDoMJRPDhu9J6MLRn3rTkHukS0u7yFCuc5cd/BGfxLrea6KkTztNFrKstxUr+EQP6B8CEmxlydku4nuvkQuHIJ2KsNBnIxPIe8vugL5ZyuR12sTKhqKdLvmy8q0ll7ttluLvbWRAd4BNkLvYN3vjYGlfRVydORer+6cOuhwVycV63KQxQtEmi4Lv+crRQtuXnfytN/K3Q96LA+Vsqw539JvJPX2+ErgRMYu1q3mRmfie33oe25/k2jcq1jm5T5uQnEyi4WN5uWZH2FjLAF5wa9JOGHluhtxXimO7TiCxjHVhXLfu3qNoExtDeY1F0F1K3vMMk60IxYqttUhP0eNaj+l8bNvqE/Kxnb/8xmCUUv8APsi0l8VaI5gAAAAASUVORK5CYII=",uge="_spinner_1eos5_1",lge="_spin_1eos5_1",cge="_svg_1eos5_16",fge="_menu_1eos5_276",dge="_fadein_1eos5_1",pge="_fadeout_1eos5_1",Ot={spinner:uge,spin:lge,"spinner--light":"_spinner--light_1eos5_12",svg:cge,"user-action-indicator-container":"_user-action-indicator-container_1eos5_23","action-indicator-fade-out":"_action-indicator-fade-out_1eos5_1","user-action-indicator-text":"_user-action-indicator-text_1eos5_40","user-action-indicator":"_user-action-indicator_1eos5_23","action-indicator-icon-scale":"_action-indicator-icon-scale_1eos5_1","user-action-indicator-icon":"_user-action-indicator-icon_1eos5_60","seek-container":"_seek-container_1eos5_69","seek-playhead":"_seek-playhead_1eos5_92","seek-buffer":"_seek-buffer_1eos5_93","seek-input":"_seek-input_1eos5_94","volume-controls":"_volume-controls_1eos5_201","volume-slider":"_volume-slider_1eos5_208","volume-input":"_volume-input_1eos5_224","volume-progress":"_volume-progress_1eos5_225",menu:fge,fadein:dge,"menu-option":"_menu-option_1eos5_296","menu-option-back":"_menu-option-back_1eos5_313","menu-option-back-icon":"_menu-option-back-icon_1eos5_317","focus-visible":"_focus-visible_1eos5_327","menu-option-active":"_menu-option-active_1eos5_332","menu-option-icon":"_menu-option-icon_1eos5_336","menu-header":"_menu-header_1eos5_346","verification-menu":"_verification-menu_1eos5_353","verification-menu__group":"_verification-menu__group_1eos5_357","verification-menu__group-icon":"_verification-menu__group-icon_1eos5_362","verification-menu__group-icon--cc":"_verification-menu__group-icon--cc_1eos5_366","verification-menu__group-text":"_verification-menu__group-text_1eos5_374","verification-menu__group-title":"_verification-menu__group-title_1eos5_378","verification-menu__group-subtitle":"_verification-menu__group-subtitle_1eos5_378","verification-menu__loader":"_verification-menu__loader_1eos5_393","verification-menu__details":"_verification-menu__details_1eos5_400","verification-menu__detail":"_verification-menu__detail_1eos5_400","verification-menu__detail-label":"_verification-menu__detail-label_1eos5_419","verification-menu__detail-value":"_verification-menu__detail-value_1eos5_423","verification-menu__detail-copy":"_verification-menu__detail-copy_1eos5_430","verification-menu__inline-icon":"_verification-menu__inline-icon_1eos5_440","verification-menu--details":"_verification-menu--details_1eos5_448","copy-button":"_copy-button_1eos5_564","copy-button--copied":"_copy-button--copied_1eos5_567",fadeout:pge},Ob=({light:n,className:e=""})=>Le.jsx("div",{className:`${e} ${Ot.spinner} ${n?Ot["spinner--light"]:""}`,children:Le.jsx("div",{className:Ot["spinner-inner"]})}),bd=({icon:n,className:e=""})=>Le.jsx("div",{className:`${Ot.svg} ${e}`,dangerouslySetInnerHTML:{__html:n}}),VP={[Pn.PLAY]:jz,[Pn.PAUSE]:Yme,[Pn.MUTE]:hk,[Pn.UNMUTE]:c2,[Pn.VOLUME_DOWN]:qz,[Pn.VOLUME_UP]:c2,[Pn.SEEK_BACK]:$P,[Pn.SEEK_FORWARD]:HP,[Pn.PLAYBACK_RATE_DOWN]:$P,[Pn.PLAYBACK_RATE_UP]:HP,[Pn.SUBTITLES_ON]:age,[Pn.SUBTITLES_OFF]:ige,[Pn.PLAY_PREVIOUS]:yk,[Pn.PLAY_NEXT]:mk},hge=({action:n})=>{if(!(!n||!VP[n.action]))return Le.jsxs("div",{className:Ot["user-action-indicator-container"],children:[Le.jsx("div",{className:Ot["user-action-indicator"],children:Le.jsx(bd,{icon:VP[n.action],"aria-label":`Action indicator ${n}`,className:Ot["user-action-indicator-icon"]})}),n.text?Le.jsx("div",{className:Ot["user-action-indicator-text"],children:n.text}):null]})},Wz=({player:n,videoState:e,setRecentUserAction:t,className:r=""})=>{const[i,o]=Ct.useState(n.video.currentTime),[u,c]=Ct.useState(0),[p,h]=Ct.useState(void 0);return Ct.useEffect(()=>{h(Oz(n,t));const m=pk({video:n.video,setCurrentTime:o,rate:60}),w=Pme({video:n.video,setBufferFraction:c});return()=>{m&&m(),w&&w()}},[]),n.isLive&&!n.dvrEnabled?null:Le.jsxs("div",{className:`${r} ${Ot["seek-container"]} ${r}`,children:[Le.jsx("progress",{max:1,value:u,className:Ot["seek-buffer"]}),Le.jsx("progress",{max:1,value:i/e.duration||0,className:Ot["seek-playhead"]}),Le.jsx("input",{"aria-label":"Seek slider",type:"range",min:0,max:1,step:1e-5,value:i/e.duration||0,onInput:m=>n.controls.Seek({fraction:m.currentTarget.value}),onKeyDown:p,className:Ot["seek-input"]})]})},yge=({player:n,videoState:e})=>Le.jsxs("div",{className:Ot["volume-controls"],children:[Le.jsx(qc,{"aria-label":e.muted?"Unmute":"Mute",icon:e.muted||e.volume===0?hk:e.volume<.4?qz:e.volume<.8?Xme:c2,onClick:()=>n.controls.ToggleMuted(),className:Ot["volume-button"]},"mute-button"),Le.jsxs("div",{className:Ot["volume-slider"],children:[Le.jsx("progress",{max:1,value:e.muted?0:e.volume,className:Ot["volume-progress"]}),Le.jsx("input",{"aria-label":"Volume slider",type:"range",min:0,max:1,step:.001,value:e.muted?0:e.volume,onInput:t=>n.controls.SetVolume({fraction:t.currentTarget.value}),onKeyDown:hme(n),className:Ot["volume-input"]})]})]}),Kz=({player:n,Hide:e,className:t=""})=>{const[r,i]=Ct.useState(void 0),[o,u]=Ct.useState(void 0),c=Ct.createRef();if(Ct.useEffect(()=>{const w=()=>u(n.controls.GetOptions());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),Ct.useEffect(()=>{if(!c||!c.current)return;const w=c3({element:c.current.parentElement,Hide:e});return()=>{w&&w()}},[c]),!o)return null;const p=w=>setTimeout(()=>i(w)),h={quality:{label:"Quality",Update:w=>n.controls.SetQualityLevel(w)},audio:{label:"Audio",Update:w=>n.controls.SetAudioTrack(w)},text:{label:"Subtitles",Update:w=>n.controls.SetTextTrack(w)},profile:{label:"Player Profile",Update:w=>{w==="custom"?(n.controls.ShowPlayerProfileForm(),e()):n.controls.SetPlayerProfile({profile:w})}},rate:{label:"Playback Rate",Update:w=>n.controls.SetPlaybackRate({index:w})}};let m;return r?m=Le.jsxs("div",{role:"menu",className:`${Ot.menu} ${Ot.submenu} ${t}`,children:[Le.jsxs("button",{onClick:()=>p(void 0),"aria-label":"Back to settings menu",className:`${Ot["menu-option"]} ${Ot["menu-option-back"]}`,children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:ege},className:Ot["menu-option-back-icon"]}),Le.jsx("div",{children:h[r].label})]}),o[r].options.map(w=>Le.jsxs("button",{role:"menuitemradio","aria-checked":w.active,autoFocus:w.active,"aria-label":`${h[r].label}: ${w.label||""}`,onClick:()=>{h[r].Update(w.index),p(void 0)},className:`${Ot["menu-option"]} ${w.active?Ot["menu-option-active"]:""}`,children:[w.label||"",w.active?Le.jsx(bd,{icon:rge,className:Ot["menu-option-icon"]}):null]},`option-${w.index}`))]},"submenu"):m=Le.jsxs("div",{role:"menu",className:`${Ot.menu} ${t}`,children:[o.hasQualityOptions?Le.jsxs("button",{autoFocus:!0,role:"menuitem",onClick:()=>p("quality"),className:Ot["menu-option"],children:[`${h.quality.label}: ${o.quality.active&&o.quality.active.activeLabel||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasAudioOptions?Le.jsxs("button",{autoFocus:!o.hasQualityOptions,role:"menuitem",onClick:()=>p("audio"),className:Ot["menu-option"],children:[`${h.audio.label}: ${o.audio.active&&o.audio.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasTextOptions?Le.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions,role:"menuitem",onClick:()=>p("text"),className:Ot["menu-option"],children:[`${h.text.label}: ${o.text.active&&o.text.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasProfileOptons?Le.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions,role:"menuitem",onClick:()=>p("profile"),className:Ot["menu-option"],children:[`${h.profile.label}: ${o.profile.active&&o.profile.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null,o.hasRateOptions?Le.jsxs("button",{autoFocus:!o.hasQualityOptions&&!o.hasAudioOptions&&!o.hasTextOptions&&!o.hasProfileOptons,role:"menuitem",onClick:()=>p("rate"),className:Ot["menu-option"],children:[`${h.rate.label}: ${o.rate.active&&o.rate.active.label||""}`,Le.jsx(bd,{icon:Iy,className:Ot["menu-option-icon"]})]}):null]},"menu"),Le.jsx("div",{ref:c,children:m})},mge=async n=>{try{n=(n||"").toString(),await navigator.clipboard.writeText(n)}catch{const t=document.createElement("input");t.value=n,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}},gge=({label:n,value:e,className:t=""})=>{const[r,i]=Ct.useState(!1);return Le.jsx("button",{onClick:()=>{r||(mge(e),i(!0),setTimeout(()=>i(!1),100))},dangerouslySetInnerHTML:{__html:oge},className:[Ot["copy-button"],r?Ot["copy-button--copied"]:"",t].join(" "),title:`Copy ${n}`})},Fo=({label:n,value:e,copyable:t})=>e?Le.jsxs("div",{className:Ot["verification-menu__detail"],children:[Le.jsxs("label",{className:Ot["verification-menu__detail-label"],children:[n,":"]}),Le.jsx("div",{className:Ot["verification-menu__detail-value"],children:e}),t?Le.jsx(gge,{label:n,value:e,className:Ot["verification-menu__detail-copy"]}):null]}):null,Yz=({player:n,Hide:e,className:t=""})=>{const r=Ct.createRef(),[i,o]=Ct.useState(),[u,c]=Ct.useState(!1),[p,h]=Ct.useState(!1);if(Ct.useEffect(()=>{n.__LoadVerificationDetails().then(()=>h(!0));const w=()=>o(n.controls.GetContentVerificationDetails());w();const b=n.controls.RegisterSettingsListener(w);return()=>b&&b()},[]),Ct.useEffect(()=>{if(!r||!r.current)return;const w=c3({element:r.current.parentElement,Hide:e});return()=>{w&&w()}},[r]),!i)return null;let m;return u?m=Le.jsxs(Le.Fragment,{children:[Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:f2},className:Ot["verification-menu__group-icon"]}),Le.jsxs("div",{className:Ot["verification-menu__group-text"],children:[Le.jsx("div",{className:Ot["verification-menu__group-title"],children:"This content has been verified as authentic"}),Le.jsxs("div",{className:Ot["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:qP},className:[Ot["verification-menu__group-icon"],Ot["verification-menu__group-icon--cc"]].join(" ")}),Le.jsxs("div",{className:Ot["verification-menu__group-text"],children:[Le.jsx("button",{onClick:()=>c(!0),className:Ot["verification-menu__group-title"],children:"Content Credentials"}),Le.jsxs("div",{className:Ot["verification-menu__group-subtitle"],children:["Issued by the",Le.jsx("a",{href:"https://main.net955305.contentfabric.io/config",target:"_blank",rel:"noreferrer",children:"Content Fabric"})]})]})]}),Le.jsxs("div",{className:Ot["verification-menu__details"],children:[Le.jsx(Fo,{label:"Content Fabric Object ID",value:i.details.objectId,copyable:!0}),Le.jsx(Fo,{label:"Organization Address",value:i.details.tenantAddress,copyable:!0}),Le.jsx(Fo,{label:"Organization Name",value:i.details.tenantName&&i.details.tenantName.toString()}),Le.jsx(Fo,{label:"Owner Address",value:i.details.ownerAddress,copyable:!0}),Le.jsx(Fo,{label:"Content Object Contract Address",value:i.details.explorerUrl?Le.jsx("a",{href:i.details.explorerUrl,target:"_blank",rel:"noreferrer",children:i.details.address}):i.details.address,copyable:!0}),Le.jsx(Fo,{label:"Versions",value:i.details.versionCount}),Le.jsx(Fo,{label:"Content Version Hash",value:i.details.versionHash,copyable:!0}),i.details.lastCommittedAt?Le.jsx(Fo,{label:"Latest Commit",value:new Date(i.details.lastCommittedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})}):null,Le.jsx(Fo,{label:"Latest Version Hash",value:i.details.latestVersionHash,copyable:!0}),Le.jsx(Fo,{label:"Latest Transaction",value:i.details._state!=="full"?Le.jsx(Ob,{className:Ot["verification-menu__loader"]}):i.details.latestTransactionHashUrl?Le.jsx("a",{href:i.details.latestTransactionHashUrl,target:"_blank",rel:"noreferrer",children:i.details.latestTransactionHash&&i.details.latestTransactionHash.toString()}):void 0}),Le.jsx(Fo,{label:"Signature Algorithm",value:i.details.signatureMethod}),n.publicMetadataUrl?Le.jsx(Fo,{label:"Public Metadata",value:Le.jsx("a",{href:n.publicMetadataUrl,target:"_blank",rel:"noreferrer",children:n.publicMetadataUrl})}):null]},`details-${i.details._state}`)]}):m=Le.jsxs(Le.Fragment,{children:[Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:f2},className:Ot["verification-menu__group-icon"]}),Le.jsxs("div",{className:Ot["verification-menu__group-text"],children:[Le.jsx("div",{className:Ot["verification-menu__group-title"],children:"This content has been verified as authentic"}),Le.jsxs("div",{className:Ot["verification-menu__group-subtitle"],children:["Last Verified: ",new Date(i.verifiedAt).toLocaleTimeString(navigator.language||"en-us",{year:"numeric",month:"long",day:"numeric"})]})]})]}),Le.jsxs("div",{className:Ot["verification-menu__group"],children:[Le.jsx("div",{dangerouslySetInnerHTML:{__html:qP},className:[Ot["verification-menu__group-icon"],Ot["verification-menu__group-icon--cc"]].join(" ")}),Le.jsx("div",{className:Ot["verification-menu__group-text"],children:Le.jsxs("button",{onClick:()=>c(!0),className:Ot["verification-menu__group-title"],children:["View Content Credentials",Le.jsx("div",{className:Ot["verification-menu__inline-icon"],dangerouslySetInnerHTML:{__html:Iy}})]})})]})]}),Le.jsx("div",{ref:r,children:Le.jsx("div",{role:"menu",className:`${Ot.menu} ${Ot["verification-menu"]} ${u?Ot["verification-menu--details"]:""} ${t}`,children:m},"menu")})},Jz=({player:n,Hide:e,className:t=""})=>{const r=Ct.createRef(),[i,o]=Ct.useState(void 0);if(Ct.useEffect(()=>{const c=()=>o(n.controls.GetCollectionInfo());c();const p=n.controls.RegisterSettingsListener(c);return()=>p&&p()},[]),Ct.useEffect(()=>{if(!r||!r.current)return;const c=c3({element:r.current.parentElement,Hide:e});return()=>c&&c()},[r]),!i)return null;const u=c=>{n.controls.CollectionPlay({mediaIndex:c}),e()};return Le.jsxs("div",{role:"menu",className:`${Ot.menu} ${Ot["collection-menu"]} ${t}`,ref:r,children:[Le.jsx("div",{className:`${Ot["menu-option"]} ${Ot["menu-header"]}`,children:i.title}),i.content.map(c=>Le.jsx("button",{"aria-label":`${c.title||c.mediaId} ${c.active?"(active)":""}`,role:"menuitemradio","aria-checked":c.active,autoFocus:c.active,onClick:()=>u(c.mediaIndex),className:`${Ot["menu-option"]} ${c.active?Ot["menu-option-active"]:""}`,children:c.title||c.mediaId},`collection-item-${c.mediaId}`))]},"menu")},qc=({icon:n,className:e="",...t})=>Le.jsx("button",{...t,className:`${In["icon-button"]} ${e}`,dangerouslySetInnerHTML:{__html:n}}),vge=({player:n,videoState:e})=>{const[t,r]=Ct.useState(n.video.currentTime);return Ct.useEffect(()=>{const i=pk({video:n.video,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.dvrEnabled?Le.jsx("div",{className:In["live-indicator"],children:"Live"}):Le.jsxs("div",{className:In.time,children:[n.isLive?Le.jsx("button",{onClick:()=>n.controls.Seek({time:n.controls.GetDuration()-2}),className:`${In["live-indicator"]} ${n.isLive&&n.behindLiveEdge?In["live-indicator--faded"]:""}`,children:"Live"}):null,n.isLive&&!n.behindLiveEdge?null:`${s2(t,e.duration)} / `,s2(e.duration,e.duration)]})},bge=({player:n})=>{const e=n.controls.GetCollectionInfo();if(!e||e.mediaLength===0||!e.isPlaylist)return null;const t=e.content[e.mediaIndex-1],r=e.content[e.mediaIndex+1],i=n.controls.IsReady();return Le.jsxs(Le.Fragment,{children:[t?Le.jsxs("div",{className:`${In["collection-button-container"]} ${i?"":In["collection-button-container--loading"]}`,children:[Le.jsx(qc,{"aria-label":`Play Previous: ${t.title}`,disabled:!i,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious()}),Le.jsx("div",{className:In["collection-button-text"],children:t.title})]},`media-previous-${e.mediaIndex}`):null,r?Le.jsxs("div",{className:`${In["collection-button-container"]} ${i?"":In["collection-button-container--loading"]}`,children:[Le.jsx(qc,{"aria-label":`Play Next: ${r.title}`,disabled:!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext()}),Le.jsx("div",{className:In["collection-button-text"],children:r.title})]},`media-next-${e.mediaIndex}`):null]})},j8=({label:n,icon:e,player:t,MenuComponent:r,className:i=""})=>{const[o,u]=Ct.useState(!1);return Le.jsxs("div",{className:[In["menu-control-container"],i].join(" "),children:[Le.jsx(qc,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{t.controls.__ToggleMenu(!o),u(!o)},className:o?In["icon-button-active"]:""}),o?Le.jsx(r,{player:t,Hide:()=>{u(!1),t.controls.__ToggleMenu(!1)}}):null]})},wge=({player:n})=>{const[e,t]=Ct.useState(void 0),{title:r,subtitle:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return Ct.useEffect(()=>{t(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>t(p))},[u]),!r||n.playerOptions.title===jt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()||n.playerOptions.title===jt.title.OFF?null:Le.jsxs("div",{className:In["info-container"],children:[e?Le.jsx("div",{className:In["info-image-container"],children:Le.jsx("img",{src:e,alt:"Image",className:In["info-image"]})}):null,Le.jsxs("div",{className:In["info-text"],children:[c.length===0?null:Le.jsx("div",{className:In["info-headers"],children:c.map((p,h)=>Le.jsx("div",{className:In["info-header"],children:p},`header-${h}`))}),r?Le.jsx("div",{className:In["info-title"],children:r}):null,i?Le.jsx("div",{className:In["info-subtitle"],children:i}):null,o?Le.jsx("div",{className:In["info-description"],children:o}):null]})]})},xge=({player:n})=>{const[e,t]=Ct.useState(!1);return Ct.useEffect(()=>{const r=()=>t(n.controls.ContentVerified());r();const i=n.controls.RegisterSettingsListener(r);return()=>i&&i()},[]),e?Le.jsxs(Le.Fragment,{children:[Le.jsx("div",{className:In["content-verified-badge"],children:"VERIFIED"}),Le.jsx(j8,{label:"Content Verification Menu",icon:f2,player:n,MenuComponent:Yz,className:In["content-verification-menu-button"]})]}):null},_ge=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=Ct.useState(void 0),[p,h]=Ct.useState(void 0),[m,w]=Ct.useState(n.controls.IsMenuVisible());if(Ct.useEffect(()=>{h(Rz({player:n,setRecentUserAction:i}));const A=()=>w(n.controls.IsMenuVisible()),T=n.controls.RegisterSettingsListener(A),R=Bz({target:n.target,video:n.video,setVideoState:c});return()=>{T&&T(),R&&R()}},[]),!u)return null;const b=n.controls.GetCollectionInfo(),g=r||!e||m,S=!g&&n.playerOptions.controls===jt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!S),Le.jsxs("div",{onClick:p,className:[o,In.container,g?"":In.autohide,n.playerOptions.controls!==jt.controls.DEFAULT?"":In["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Le.jsx(wge,{player:n},`content-info-${b&&b.mediaIndex}`),[jt.controls.DEFAULT,jt.controls.OFF,jt.controls.OFF_WITH_VOLUME_TOGGLE].includes(n.playerOptions.controls)?null:Le.jsxs(Le.Fragment,{children:[Le.jsx(qc,{"aria-label":"Play",tabIndex:e?-1:0,icon:zz,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${In["center-play-button"]} ${t&&!e?"":In["center-play-button--hidden"]}`}),Le.jsxs("div",{className:`${In["bottom-controls-container"]} ${S?In["bottom-controls-container--autohide"]:""}`,children:[Le.jsx("div",{className:In["bottom-controls-gradient"]}),Le.jsx(Wz,{player:n,videoState:u,setRecentUserAction:i,className:In.seek}),Le.jsxs("div",{className:In.controls,children:[Le.jsx(qc,{"aria-label":u.playing?"Pause":"Play",icon:u.playing?Hz:$z,onClick:()=>n.controls.TogglePlay(),className:In["play-pause-button"]}),Le.jsx(bge,{player:n}),Le.jsx(yge,{player:n,videoState:u}),Le.jsx(vge,{player:n,videoState:u}),Le.jsx("div",{className:In.spacer}),Le.jsx(xge,{player:n}),b?Le.jsx(j8,{label:"Collection Menu",icon:Vz,player:n,MenuComponent:Jz}):null,n.controls.IsRotatable()?Le.jsx(qc,{"aria-label":"Rotate Video",icon:sge,onClick:()=>n.controls.SetAllowRotation(!n.controls.AllowRotation()),className:In["right-control-button"]}):null,n.controls.GetOptions().hasAnyOptions?Le.jsx(j8,{label:"Settings Menu",icon:Zme,player:n,MenuComponent:Kz}):null,Le.jsx(qc,{"aria-label":u.fullscreen?"Exit Fullscreen":"Fullscreen",icon:u.fullscreen?Qme:Jme,onClick:()=>n.controls.ToggleFullscreen(),className:In["right-control-button"]})]})]})]}),n.playerOptions.controls!==jt.controls.OFF_WITH_VOLUME_TOGGLE?null:Le.jsx("div",{className:In["floating-volume-toggle"],children:Le.jsx(qc,{"aria-label":u.muted?"Unmute":"Mute",icon:u.muted||u.volume===0?hk:c2,onClick:()=>n.controls.ToggleMuted(),className:In["volume-button"]},"mute-button")}),n.playerOptions.watermark===jt.watermark.OFF?null:Le.jsx("div",{className:In.watermark,children:Le.jsx("img",{src:Gz,alt:"Eluvio"})})]})},Sge="_spinner_1c6ar_17",Cge="_text_1c6ar_33",Ege="_title_1c6ar_39",Age="_description_1c6ar_43",kge="_inputs_1c6ar_47",Mge="_input_1c6ar_47",Tge="_submit_1c6ar_77",wi={"ticket-form-container":"_ticket-form-container_1c6ar_1","ticket-form-overlay":"_ticket-form-overlay_1c6ar_8",spinner:Sge,"ticket-form":"_ticket-form_1c6ar_1",text:Cge,title:Ege,description:Age,inputs:kge,input:Mge,submit:Tge,"error-message":"_error-message_1c6ar_88","size-md":"_size-md_1c6ar_102","size-sm":"_size-sm_1c6ar_103"},Rge=({parameters:n,dimensions:e,onComplete:t})=>{let{tenantId:r,ntpId:i,ticketCode:o,ticketSubject:u}=n.clientOptions||{};const c=!r||!i,[p,h]=Ct.useState(o||""),[m,w]=Ct.useState(!!o),[b,g]=Ct.useState(!1),[S,A]=Ct.useState(c?"Error: Tenant ID or NTP ID not specified":""),[T,R]=Ct.useState(void 0),L=async({client:D,code:q})=>{if(!(!q||!D)){A(""),g(!0);try{let W=u;q.includes(":")&&(W=q.split(":")[0],q=q.split(":")[1]),await D.RedeemCode({tenantId:r,ntpId:i,code:q.trim(),email:W}),t(D)}catch(W){console.log(W),A("Invalid Code"),w(!1)}finally{g(!1)}}};return Ct.useEffect(()=>{Promise.resolve().then(()=>Tz).then(async({ElvClient:D})=>{const q=await D.FromConfigurationUrl({configUrl:n.clientOptions.network});R(q),o&&L({client:q,code:o})})},[]),m?Le.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:Le.jsx("div",{className:wi["ticket-form-overlay"],children:Le.jsx(Ob,{className:wi.spinner})})}):Le.jsx("div",{role:"complementary",tabIndex:-1,style:{backgroundColor:n.playerOptions.backgroundColor||"transparent","--portal-width":`${e.width}px`,"--portal-height":`${e.height}px`},className:[wi["ticket-form-container"],wi[`size-${e.size}`],wi[`orientation-${e.orientation}`]].join(" "),children:Le.jsx("div",{className:wi["ticket-form-overlay"],children:Le.jsxs("form",{onSubmit:D=>{D.preventDefault(),L({client:T,code:p})},className:wi["ticket-form"],children:[Le.jsxs("div",{className:wi.text,children:[Le.jsx("h2",{className:wi.title,children:n.clientOptions.ticketTitle||"This content requires a code to view"}),Le.jsx("p",{className:wi.description,children:n.clientOptions.ticketDescription||"Please enter your code below"})]}),Le.jsxs("div",{className:wi.inputs,children:[Le.jsx("input",{disabled:c,autoFocus:!0,type:"text",placeholder:"Ticket Code",value:p,"aria-label":"Ticket Code","aria-invalid":!!S&&!c,"aria-errormessage":S,onKeyDown:D=>D.key==="Enter"&&L({client:T,code:p}),onChange:D=>{A(""),h(D.target.value)},className:wi.input}),Le.jsx("button",{type:"submit","aria-label":"Submit Code",disabled:!p||!T||c,className:wi.submit,children:b?Le.jsx(Ob,{light:!0}):"Submit"})]}),Le.jsxs("div",{className:wi["error-message"],children:[S," "]})]})})})},Oge="_container_25yw5_1",Lge="_autohide_25yw5_34",Nge="_fadein_25yw5_1",Pge="_title_25yw5_134",Ige="_spacer_25yw5_318",Dge="_watermark_25yw5_322",Uge="_menu_25yw5_145",ln={container:Oge,"container--default-controls":"_container--default-controls_25yw5_29",autohide:Lge,"bottom-controls-container--autohide":"_bottom-controls-container--autohide_25yw5_37","icon-button":"_icon-button_25yw5_43","icon-button--drop-shadow-focus":"_icon-button--drop-shadow-focus_25yw5_60","icon-button-active":"_icon-button-active_25yw5_73","icon-button--circle-focus":"_icon-button--circle-focus_25yw5_73","text-button":"_text-button_25yw5_86","text-button--active":"_text-button--active_25yw5_91","bottom-controls-container":"_bottom-controls-container_25yw5_37",fadein:Nge,"bottom-controls-gradient":"_bottom-controls-gradient_25yw5_108","center-play-button":"_center-play-button_25yw5_120","center-play-button--hidden":"_center-play-button--hidden_25yw5_127","title-container":"_title-container_25yw5_134",title:Pge,"menu-control-container":"_menu-control-container_25yw5_145","time-container":"_time-container_25yw5_149","live-indicator":"_live-indicator_25yw5_156","live-indicator--faded":"_live-indicator--faded_25yw5_168","bottom-controls":"_bottom-controls_25yw5_37","center-buttons":"_center-buttons_25yw5_184","play-pause-button":"_play-pause-button_25yw5_194","track-button":"_track-button_25yw5_197","bottom-left-controls":"_bottom-left-controls_25yw5_201","bottom-right-controls":"_bottom-right-controls_25yw5_202","info-box-container":"_info-box-container_25yw5_219","info-box":"_info-box_25yw5_219","info-box-image-container":"_info-box-image-container_25yw5_242","info-box-image":"_info-box-image_25yw5_242","info-box-text":"_info-box-text_25yw5_258","info-box-text--top-padding":"_info-box-text--top-padding_25yw5_265","info-box-headers":"_info-box-headers_25yw5_269","info-box-description":"_info-box-description_25yw5_277","info-box-title":"_info-box-title_25yw5_281","info-box-button":"_info-box-button_25yw5_286","info-box-button--restart":"_info-box-button--restart_25yw5_301",spacer:Ige,watermark:Dge,menu:Uge},eh=({icon:n,...e})=>Le.jsx("button",{...e,className:`${ln["icon-button"]} ${e.className||""}`,dangerouslySetInnerHTML:{__html:n}}),Fge=({player:n,videoState:e})=>{const[t,r]=Ct.useState(n.video.currentTime);return Ct.useEffect(()=>{const i=pk({video:n.video,setCurrentTime:r,rate:10});return()=>i&&i()},[]),n.isLive&&!n.dvrEnabled?null:Le.jsxs("div",{className:ln["time-container"],children:[n.isLive&&!n.behindLiveEdge?null:Le.jsx("div",{className:ln.time,children:s2(t,e.duration)}),Le.jsx("div",{className:ln.spacer}),Le.jsx("div",{className:ln.time,children:s2(e.duration,e.duration)})]})},Bge=({player:n,videoState:e})=>{const t=n.controls.GetCollectionInfo(),r=t&&t.isPlaylist&&t.content[t.mediaIndex-1],i=t&&t.isPlaylist&&t.content[t.mediaIndex+1],o=n.controls.IsReady();return Le.jsxs("div",{className:ln["center-buttons"],children:[!r&&!i?null:Le.jsx(eh,{disabled:!o||!r,icon:yk,onClick:()=>n.controls.CollectionPlayPrevious(),className:`${ln["track-button"]} ${ln["icon-button--drop-shadow-focus"]}`}),Le.jsx(eh,{"aria-label":"Back 10 Seconds",icon:tge,onClick:()=>n.controls.Seek({relativeSeconds:-10}),className:ln["icon-button--drop-shadow-focus"]}),Le.jsx(eh,{"aria-label":e.playing?"Pause":"Play",icon:e.playing?Hz:$z,onClick:()=>n.controls.TogglePlay(),className:`${ln["play-pause-button"]} ${ln["icon-button--drop-shadow-focus"]}`}),Le.jsx(eh,{"aria-label":"Forward 10 Seconds",icon:nge,onClick:()=>n.controls.Seek({relativeSeconds:10}),className:ln["icon-button--drop-shadow-focus"]}),!r&&!i?null:Le.jsx(eh,{disabled:!o||!i,icon:mk,onClick:()=>n.controls.CollectionPlayNext(),className:`${ln["track-button"]} ${ln["icon-button--drop-shadow-focus"]}`})]})},$8=({label:n,icon:e,children:t,player:r,MenuComponent:i})=>{const[o,u]=Ct.useState(!1);return Le.jsxs("div",{className:ln["menu-control-container"],children:[e?Le.jsx(eh,{"aria-label":o?`Hide ${n} Menu`:n,"aria-haspopup":!0,icon:e,onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${ln["icon-button--circle-focus"]} ${o?ln["icon-button-active"]:""}`}):Le.jsx("button",{onClick:()=>{r.controls.__ToggleMenu(!o),u(!o)},className:`${ln["text-button"]} ${o?ln["text-button--active"]:""}`,children:t}),o?Le.jsx(i,{player:r,Hide:()=>{r.controls.__ToggleMenu(!1),u(!1)},className:ln.menu}):null]})},zge=({player:n,Hide:e})=>{const[t,r]=Ct.useState(void 0),{title:i,description:o,image:u,headers:c}=n.controls.GetContentInfo()||{};return Ct.useEffect(()=>{r(void 0),u&&dk({player:n,pathOrUrl:u,width:200}).then(p=>r(p))},[u]),Ct.useEffect(()=>{const p=h=>{h&&(h.key||"").toLowerCase()==="escape"&&e()};return document.body.addEventListener("keydown",p),()=>document.body.removeEventListener("keydown",p)},[]),Le.jsxs("div",{className:ln["info-box-container"],children:[Le.jsx("button",{autoFocus:!0,onClick:()=>e(),className:`${ln["info-box-button"]} ${ln["info-box-button--info"]}`,children:"Info"}),Le.jsxs("div",{className:ln["info-box"],children:[t?Le.jsx("div",{className:ln["info-box-image-container"],children:Le.jsx("img",{src:t,alt:"Image",className:ln["info-box-image"]})}):null,Le.jsxs("div",{className:`${ln["info-box-text"]} ${t&&c&&c.length===0?ln["info-box-text--top-padding"]:""}`,children:[!c||c.length===0?null:Le.jsx("div",{className:ln["info-box-headers"],children:c.map((p,h)=>Le.jsx("div",{className:ln["info-box-header"],children:p},`header-${h}`))}),Le.jsx("div",{className:ln["info-box-title"],children:i||""}),Le.jsx("div",{className:ln["info-box-description"],children:o||""})]}),Le.jsx("div",{className:ln["info-box-actions"],children:Le.jsxs("button",{onClick:()=>{n.controls.Seek({time:0}),e()},className:`${ln["info-box-button"]} ${ln["info-box-button--restart"]}`,children:[Le.jsx(bd,{icon:jz}),"From Beginning"]})})]})]})},jge=({player:n})=>{const[e,t]=Ct.useState(!1);return Ct.useEffect(()=>{const r=()=>t(n.controls.ContentVerified());r(),n.controls.RegisterSettingsListener(r)},[]),e?Le.jsx($8,{label:"Content Verification Menu",icon:f2,player:n,MenuComponent:Yz,className:ln["content-verification-menu-button"],children:"Verified"}):null},$ge=({player:n,playbackStarted:e,canPlay:t,recentlyInteracted:r,setRecentUserAction:i,className:o=""})=>{const[u,c]=Ct.useState(void 0),[p,h]=Ct.useState(void 0),[m,w]=Ct.useState(!1);if(Ct.useEffect(()=>{h(Rz({player:n,setRecentUserAction:i}));const T=Bz({target:n.target,video:n.video,setVideoState:c});return()=>T&&T()},[]),!u)return null;const{title:b}=n.controls.GetContentInfo()||{},g=n.controls.GetCollectionInfo(),S=r||!e||n.controls.IsMenuVisible(),A=!S&&n.playerOptions.controls===jt.controls.AUTO_HIDE;return n.__SetControlsVisibility(!A),Le.jsxs("div",{onClick:p,className:[o,ln.container,S?"":ln.autohide,n.playerOptions.controls!==jt.controls.DEFAULT?"":ln["container--default-controls"],n.controls.IsMenuVisible()?"menu-active":""].join(" "),children:[Le.jsx(eh,{"aria-label":"Play",tabIndex:e?-1:0,icon:zz,onClick:()=>{n.controls.Play(),n.target.firstChild.focus()},className:`${ln["center-play-button"]} ${ln["icon-button--drop-shadow-focus"]} ${t&&!e?"":ln["center-play-button--hidden"]}`}),m?Le.jsx(zge,{player:n,Hide:()=>w(!1)}):Le.jsxs("div",{className:`${ln["bottom-controls-container"]} ${A?ln["bottom-controls-container--autohide"]:""}`,children:[Le.jsx("div",{className:ln["bottom-controls-gradient"]}),Le.jsxs("div",{className:ln["title-container"],children:[Le.jsx("div",{className:ln.title,children:n.playerOptions.title===jt.title.OFF||n.playerOptions.title===jt.title.FULLSCREEN_ONLY&&!n.controls.IsFullscreen()?"":b||""}),Le.jsx("div",{className:ln.spacer}),n.isLive?n.dvrEnabled?Le.jsx("button",{onClick:()=>n.controls.Seek({time:n.controls.GetDuration()-2}),className:`${ln["live-indicator"]} ${n.isLive&&n.behindLiveEdge?ln["live-indicator--faded"]:""}`,children:"Live"}):Le.jsx("div",{className:ln["live-indicator"],children:"Live"}):null,g?Le.jsx($8,{label:"Collection Menu",icon:Vz,player:n,MenuComponent:Jz}):null]}),Le.jsx(Wz,{player:n,videoState:u,setRecentUserAction:i}),Le.jsx(Fge,{player:n,videoState:u}),Le.jsxs("div",{className:ln["bottom-controls"],children:[Le.jsx("div",{className:ln["bottom-left-controls"],children:!b||n.playerOptions.title===jt.title.OFF?null:Le.jsx("button",{className:ln["text-button"],onClick:()=>w(!0),children:"Info"})}),Le.jsx(Bge,{player:n,videoState:u}),Le.jsxs("div",{className:ln["bottom-right-controls"],children:[Le.jsx(jge,{player:n}),n.controls.GetOptions().hasAnyOptions?Le.jsx($8,{label:"Settings",player:n,MenuComponent:Kz,children:"Settings"},"settings-button"):null]})]})]}),n.playerOptions.watermark===jt.watermark.OFF?null:Le.jsx("div",{className:ln.watermark,children:Le.jsx("img",{src:Gz,alt:"Eluvio"})})]},"controls")},Hge="_container_1l7ln_1",qge="_overlay_1l7ln_9",Vge="_fadein_1l7ln_1",Gge="_form_1l7ln_22",Wge="_header_1l7ln_39",Kge="_input_1l7ln_45",Yge="_actions_1l7ln_92",Jge="_submit_1l7ln_98",Qge="_cancel_1l7ln_99",co={container:Hge,overlay:qge,fadein:Vge,form:Gge,header:Wge,"input-container":"_input-container_1l7ln_45",input:Kge,"input--invalid":"_input--invalid_1l7ln_65","player-info":"_player-info_1l7ln_74","api-link":"_api-link_1l7ln_83",actions:Yge,submit:Jge,cancel:Qge},Zge=({player:n,Close:e})=>{const[t,r]=Ct.useState(JSON.stringify(n.hlsOptions||"{}",null,2)),[i,o]=Ct.useState(!1),[u,c]=Ct.useState(""),p=Ct.useRef();Ct.useEffect(()=>{if(!p||!p.current)return;const m=c3({element:p.current,Hide:e});return()=>m&&m()},[p]);const h=async m=>{m.preventDefault();try{o(!0),await n.controls.SetPlayerProfile({profile:"custom",customOptions:JSON.parse(t)}),e()}catch(w){c(w.toString()),o(!1)}};return Le.jsx("div",{role:"complementary",tabIndex:-1,className:co.container,children:Le.jsx("div",{className:co.overlay,children:Le.jsxs("form",{onSubmit:h,className:co.form,ref:p,children:[Le.jsx("h2",{className:co.header,children:"Custom hls.js Options"}),Le.jsxs("div",{className:co["input-container"],children:[Le.jsx("textarea",{disabled:i,autoFocus:!0,value:t,title:u,"aria-label":"Player Options","aria-invalid":!!u,"aria-errormessage":u||"",onChange:m=>r(m.currentTarget.value),onFocus:()=>c(""),onBlur:()=>{try{c(""),r(JSON.stringify(JSON.parse(t||"{}"),null,2))}catch(m){c(m.toString())}},className:`${co.input} ${u?co["input--invalid"]:""}`}),Le.jsxs("div",{className:co["player-info"],children:[Le.jsx("a",{tabIndex:0,href:"https://github.com/video-dev/hls.js/blob/master/docs/API.md",rel:"noreferrer",target:"_blank",className:co["api-link"],children:"API Docs"}),Le.jsxs("div",{className:co["player-version"],children:["hls.js ",n.HLS.version]})]})]}),Le.jsxs("div",{className:co.actions,children:[Le.jsx("button",{type:"button","aria-label":"Cancel",onClick:()=>e(),className:co.cancel,children:"Cancel"}),Le.jsx("button",{type:"submit","aria-label":"Submit",disabled:!!u,className:co.submit,children:i?Le.jsx(Ob,{light:!0}):"Submit"})]})]})})})},Xge=({player:n})=>{const[e,t]=Ct.useState(void 0),{posterImage:r}=n.controls.GetContentInfo()||{};return Ct.useEffect(()=>{t(void 0),r&&dk({player:n,pathOrUrl:r,width:200}).then(i=>t(i))},[r]),e?Le.jsx("img",{alt:"Video Poster",src:e,className:Al.poster}):null};let eve;const tve=({target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:i,Reset:o})=>{const[u,c]=Ct.useState(void 0),[p,h]=Ct.useState(void 0),[m,w]=Ct.useState("lg"),[b,g]=Ct.useState("landscape"),[S,A]=Ct.useState({width:n.getBoundingClientRect().width,height:n.getBoundingClientRect().height}),[T,R]=Ct.useState(void 0),[L,D]=Ct.useState(!1),[q,W]=Ct.useState(!1),[de,ce]=Ct.useState(!1),[me,Se]=Ct.useState(!1),[Ce,ne]=Ct.useState(!1),[ke,C]=Ct.useState(!0),[_,O]=Ct.useState(void 0),[z,F]=Ct.useState(void 0),j=Ct.useRef(),Q=!!u,ae=({action:k,text:Y})=>O({action:k,text:Y,key:Math.random()});if(Ct.useEffect(()=>{Se(!0);const k=Ime({target:n,setSize:w,setOrientation:g,setDimensions:A});return()=>{Se(!1),k&&k()}},[]),Ct.useEffect(()=>{if(!(!j||!j.current||!me))try{D(!1),W(!1),e.clientOptions.client=p||e.clientOptions.client;const k=new o2({target:n,video:j.current,parameters:e,SetErrorMessage:R});window.__elvPlayer=k;const Y=k.controls.RegisterSettingsListener(()=>{F(k.controls.AllowRotation()),W(k.playbackStarted),D(!k.loading),ne(k.__showPlayerProfileForm)});k.Destroy=()=>{k.__DestroyPlayer(),i()},k.Reset=()=>{o()};const ie=Dme({player:k}),$=Ume({player:k,inactivityPeriod:5e3,onWake:()=>C(!0),onSleep:()=>C(!1)}),be=Fme({player:k,setRecentUserAction:ae}),Ie=Bme({player:k});t(k),c(k);const Me=k.controls.RegisterVideoEventListener("canplay",()=>ce(!0));return()=>{j&&j.current&&j.current.removeEventListener("play",W),Y&&Y(),ie&&ie(),$&&$(),be&&be(),Ie&&Ie(),Me&&Me(),k&&k.__DestroyPlayer()}}catch(k){r(k),i()}},[j,me,p]),Ct.useEffect(()=>{if(Q)return()=>{u&&u.__DestroyPlayer(),c(void 0)}},[Q]),Ct.useEffect(()=>{_&&(clearTimeout(eve),setTimeout(()=>{O(void 0)},1e3))},[_]),e.clientOptions.promptTicket&&!p)return Le.jsx(Rge,{parameters:e,dimensions:{size:m,orientation:b,...S},onComplete:k=>h(k)});const N=e.playerOptions.ui===jt.ui.WEB&&u&&u.controls.IsRotatable()&&z;return Le.jsxs("div",{role:"complementary","aria-label":"Eluvio Video Player",tabIndex:0,style:{backgroundColor:e.playerOptions.backgroundColor||"transparent","--portal-width":`${N?S.height:S.width}px`,"--portal-height":`${N?S.width:S.height}px`},className:[Al["player-container"],N?Al["player-container--rotated"]:"",`__eluvio-player--size-${m}`,`__eluvio-player--orientation-${b}`].join(" "),children:[!Ce||!L?null:Le.jsx(Zge,{player:u,Close:()=>u.controls.HidePlayerProfileForm()}),Le.jsx("video",{playsInline:!0,disablePictureInPicture:!0,ref:j,muted:[jt.muted.ON,jt.muted.WHEN_NOT_VISIBLE].includes(e.playerOptions.muted),controls:e.playerOptions.controls===jt.controls.DEFAULT,loop:e.playerOptions.loop===jt.loop.ON,className:Al.video}),!u||!de||q&&!e.playerOptions.permanentPoster?null:Le.jsx(Xge,{player:u}),L||T||!e.playerOptions.showLoader?null:Le.jsx("div",{className:Al["spinner-container"],children:Le.jsx(Ob,{className:Al.spinner})}),T?Le.jsx("div",{className:Al["error-message"],children:T}):null,u?e.playerOptions.ui===jt.ui.WEB?Le.jsx(_ge,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:ke,setRecentUserAction:ae,className:Al.controls}):Le.jsx($ge,{player:u,playbackStarted:!!q,canPlay:de,recentlyInteracted:ke,setRecentUserAction:ae,className:Al.controls}):null,_?Le.jsx(hge,{action:_},`action-indicator-${_&&_.key}`):null]})},nve=n=>{const[e,t]=Ct.useState(Math.random());return Ct.createElement(tve,{...n,key:`player-${e}`,Reset:()=>t(Math.random())})},rve=(n,e)=>(n.innerHTML="",n.classList.add(GG.reset),n.classList.add(Al["player-target"]),e=Nz(e),e.playerOptions&&e.playerOptions.backgroundColor&&(n.style.backgroundColor=e.playerOptions.backgroundColor),new Promise((t,r)=>{const i=Vv.createRoot(n);i.render(Le.jsx($G.StrictMode,{children:Le.jsx(nve,{target:n,parameters:e,InitCallback:t,ErrorCallback:r,Unmount:async()=>{try{await i.unmount()}catch(o){console.error("Failed to unmount Eluvio Player"),console.error(o)}}})}))}));exports.Initialize=rve;exports.PlayerParameters=jt;exports.commonjsGlobal=Fa;exports.crypto=ZP;exports.eventsExports=Gb;exports.getDefaultExportFromCjs=Pd;exports.inherits_browserExports=$I;exports.require$$3=p2;exports.requireBuffer=Lb;exports.string_decoder=V4;