UNPKG

@byomakase/omakase-player

Version:

## Omakase Player - Open source JavaScript framework for building frame accurate video experiences

3 lines • 1.09 MB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ft=require("hls.js");var Yd=function(A,e){return Yd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])},Yd(A,e)};function NA(A,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Yd(A,e);function t(){this.constructor=A}A.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function dC(A,e,t,i){function r(s){return s instanceof t?s:new t(function(n){n(s)})}return new(t||(t=Promise))(function(s,n){function a(d){try{l(i.next(d))}catch(h){n(h)}}function o(d){try{l(i.throw(d))}catch(h){n(h)}}function l(d){d.done?s(d.value):r(d.value).then(a,o)}l((i=i.apply(A,e||[])).next())})}function Wg(A,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,n;return n={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(l){return function(d){return o([l,d])}}function o(l){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(t=0)),t;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,r=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(A,t)}catch(d){l=[6,d],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Os(A){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&A[e],i=0;if(t)return t.call(A);if(A&&typeof A.length=="number")return{next:function(){return A&&i>=A.length&&(A=void 0),{value:A&&A[i++],done:!A}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Or(A,e){var t=typeof Symbol=="function"&&A[Symbol.iterator];if(!t)return A;var i=t.call(A),r,s=[],n;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){n={error:a}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return s}function Hs(A,e,t){if(t||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return A.concat(s||Array.prototype.slice.call(e))}function ks(A){return this instanceof ks?(this.v=A,this):new ks(A)}function hC(A,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(A,e||[]),r,s=[];return r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r;function n(c){i[c]&&(r[c]=function(m){return new Promise(function(g,u){s.push([c,m,g,u])>1||a(c,m)})})}function a(c,m){try{o(i[c](m))}catch(g){h(s[0][3],g)}}function o(c){c.value instanceof ks?Promise.resolve(c.value.v).then(l,d):h(s[0][2],c)}function l(c){a("next",c)}function d(c){a("throw",c)}function h(c,m){c(m),s.shift(),s.length&&a(s[0][0],s[0][1])}}function cC(A){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=A[Symbol.asyncIterator],t;return e?e.call(A):(A=typeof Os=="function"?Os(A):A[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=A[s]&&function(n){return new Promise(function(a,o){n=A[s](n),r(a,o,n.done,n.value)})}}function r(s,n,a,o){Promise.resolve(o).then(function(l){s({value:l,done:a})},n)}}function Ke(A){return typeof A=="function"}function Nl(A){var e=function(i){Error.call(i),i.stack=new Error().stack},t=A(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Bd=Nl(function(A){return function(t){A(this),this.message=t?t.length+` errors occurred during unsubscription: `+t.map(function(i,r){return r+1+") "+i.toString()}).join(` `):"",this.name="UnsubscriptionError",this.errors=t}});function sl(A,e){if(A){var t=A.indexOf(e);0<=t&&A.splice(t,1)}}var Ba=function(){function A(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return A.prototype.unsubscribe=function(){var e,t,i,r,s;if(!this.closed){this.closed=!0;var n=this._parentage;if(n)if(this._parentage=null,Array.isArray(n))try{for(var a=Os(n),o=a.next();!o.done;o=a.next()){var l=o.value;l.remove(this)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else n.remove(this);var d=this.initialTeardown;if(Ke(d))try{d()}catch(u){s=u instanceof Bd?u.errors:[u]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var c=Os(h),m=c.next();!m.done;m=c.next()){var g=m.value;try{Jc(g)}catch(u){s=s??[],u instanceof Bd?s=Hs(Hs([],Or(s)),Or(u.errors)):s.push(u)}}}catch(u){i={error:u}}finally{try{m&&!m.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}if(s)throw new Bd(s)}},A.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Jc(e);else{if(e instanceof A){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},A.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},A.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},A.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&sl(t,e)},A.prototype.remove=function(e){var t=this._finalizers;t&&sl(t,e),e instanceof A&&e._removeParent(this)},A.EMPTY=function(){var e=new A;return e.closed=!0,e}(),A}(),zg=Ba.EMPTY;function Kg(A){return A instanceof Ba||A&&"closed"in A&&Ke(A.remove)&&Ke(A.add)&&Ke(A.unsubscribe)}function Jc(A){Ke(A)?A():A.unsubscribe()}var Jg={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},qg={setTimeout:function(A,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Hs([A,e],Or(t)))},clearTimeout:function(A){var e=qg.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(A)},delegate:void 0};function Xg(A){qg.setTimeout(function(){throw A})}function nl(){}function fo(A){A()}var Wh=function(A){NA(e,A);function e(t){var i=A.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Kg(t)&&t.add(i)):i.destination=fC,i}return e.create=function(t,i,r){return new al(t,i,r)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,A.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ba),uC=Function.prototype.bind;function wd(A,e){return uC.call(A,e)}var gC=function(){function A(e){this.partialObserver=e}return A.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){Ha(i)}},A.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){Ha(i)}else Ha(e)},A.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Ha(t)}},A}(),al=function(A){NA(e,A);function e(t,i,r){var s=A.call(this)||this,n;if(Ke(t)||!t)n={next:t??void 0,error:i??void 0,complete:r??void 0};else{var a;s&&Jg.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return s.unsubscribe()},n={next:t.next&&wd(t.next,a),error:t.error&&wd(t.error,a),complete:t.complete&&wd(t.complete,a)}):n=t}return s.destination=new gC(n),s}return e}(Wh);function Ha(A){Xg(A)}function mC(A){throw A}var fC={closed:!0,next:nl,error:mC,complete:nl},zh=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Wr(A){return A}function pC(A){return A.length===0?Wr:A.length===1?A[0]:function(t){return A.reduce(function(i,r){return r(i)},t)}}var de=function(){function A(e){e&&(this._subscribe=e)}return A.prototype.lift=function(e){var t=new A;return t.source=this,t.operator=e,t},A.prototype.subscribe=function(e,t,i){var r=this,s=CC(e)?e:new al(e,t,i);return fo(function(){var n=r,a=n.operator,o=n.source;s.add(a?a.call(s,o):o?r._subscribe(s):r._trySubscribe(s))}),s},A.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},A.prototype.forEach=function(e,t){var i=this;return t=qc(t),new t(function(r,s){var n=new al({next:function(a){try{e(a)}catch(o){s(o),n.unsubscribe()}},error:s,complete:r});i.subscribe(n)})},A.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},A.prototype[zh]=function(){return this},A.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pC(e)(this)},A.prototype.toPromise=function(e){var t=this;return e=qc(e),new e(function(i,r){var s;t.subscribe(function(n){return s=n},function(n){return r(n)},function(){return i(s)})})},A.create=function(e){return new A(e)},A}();function qc(A){var e;return(e=A??Jg.Promise)!==null&&e!==void 0?e:Promise}function EC(A){return A&&Ke(A.next)&&Ke(A.error)&&Ke(A.complete)}function CC(A){return A&&A instanceof Wh||EC(A)&&Kg(A)}function vC(A){return Ke(A==null?void 0:A.lift)}function Ot(A){return function(e){if(vC(e))return e.lift(function(t){try{return A(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function ct(A,e,t,i,r){return new IC(A,e,t,i,r)}var IC=function(A){NA(e,A);function e(t,i,r,s,n,a){var o=A.call(this,t)||this;return o.onFinalize=n,o.shouldUnsubscribe=a,o._next=i?function(l){try{i(l)}catch(d){t.error(d)}}:A.prototype._next,o._error=s?function(l){try{s(l)}catch(d){t.error(d)}finally{this.unsubscribe()}}:A.prototype._error,o._complete=r?function(){try{r()}catch(l){t.error(l)}finally{this.unsubscribe()}}:A.prototype._complete,o}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;A.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(Wh),_C=Nl(function(A){return function(){A(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),y=function(A){NA(e,A);function e(){var t=A.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var i=new Xc(this,this);return i.operator=t,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new _C},e.prototype.next=function(t){var i=this;fo(function(){var r,s;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var n=Os(i.currentObservers),a=n.next();!a.done;a=n.next()){var o=a.value;o.next(t)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(s=n.return)&&s.call(n)}finally{if(r)throw r.error}}}})},e.prototype.error=function(t){var i=this;fo(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=t;for(var r=i.observers;r.length;)r.shift().error(t)}})},e.prototype.complete=function(){var t=this;fo(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var i=t.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),A.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var i=this,r=this,s=r.hasError,n=r.isStopped,a=r.observers;return s||n?zg:(this.currentObservers=null,a.push(t),new Ba(function(){i.currentObservers=null,sl(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var i=this,r=i.hasError,s=i.thrownError,n=i.isStopped;r?t.error(s):n&&t.complete()},e.prototype.asObservable=function(){var t=new de;return t.source=this,t},e.create=function(t,i){return new Xc(t,i)},e}(de),Xc=function(A){NA(e,A);function e(t,i){var r=A.call(this)||this;return r.destination=t,r.source=i,r}return e.prototype.next=function(t){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,t)},e.prototype.error=function(t){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,t)},e.prototype.complete=function(){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||i===void 0||i.call(t)},e.prototype._subscribe=function(t){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(t))!==null&&r!==void 0?r:zg},e}(y),at=function(A){NA(e,A);function e(t){var i=A.call(this)||this;return i._value=t,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var i=A.prototype._subscribe.call(this,t);return!i.closed&&t.next(this._value),i},e.prototype.getValue=function(){var t=this,i=t.hasError,r=t.thrownError,s=t._value;if(i)throw r;return this._throwIfClosed(),s},e.prototype.next=function(t){A.prototype.next.call(this,this._value=t)},e}(y),BC={now:function(){return Date.now()},delegate:void 0},wC=function(A){NA(e,A);function e(t,i){return A.call(this)||this}return e.prototype.schedule=function(t,i){return this},e}(Ba),Zc={setInterval:function(A,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setInterval.apply(void 0,Hs([A,e],Or(t)))},clearInterval:function(A){return clearInterval(A)},delegate:void 0},bC=function(A){NA(e,A);function e(t,i){var r=A.call(this,t,i)||this;return r.scheduler=t,r.work=i,r.pending=!1,r}return e.prototype.schedule=function(t,i){var r;if(i===void 0&&(i=0),this.closed)return this;this.state=t;var s=this.id,n=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(n,s,i)),this.pending=!0,this.delay=i,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(n,this.id,i),this},e.prototype.requestAsyncId=function(t,i,r){return r===void 0&&(r=0),Zc.setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,i,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return i;i!=null&&Zc.clearInterval(i)},e.prototype.execute=function(t,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,i);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,i){var r=!1,s;try{this.work(t)}catch(n){r=!0,s=n||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,i=t.id,r=t.scheduler,s=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,sl(s,this),i!=null&&(this.id=this.recycleAsyncId(r,i,null)),this.delay=null,A.prototype.unsubscribe.call(this)}},e}(wC),jc=function(){function A(e,t){t===void 0&&(t=A.now),this.schedulerActionCtor=e,this.now=t}return A.prototype.schedule=function(e,t,i){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(i,t)},A.now=BC.now,A}(),yC=function(A){NA(e,A);function e(t,i){i===void 0&&(i=jc.now);var r=A.call(this,t,i)||this;return r.actions=[],r._active=!1,r}return e.prototype.flush=function(t){var i=this.actions;if(this._active){i.push(t);return}var r;this._active=!0;do if(r=t.execute(t.state,t.delay))break;while(t=i.shift());if(this._active=!1,r){for(;t=i.shift();)t.unsubscribe();throw r}},e}(jc),Xs=new yC(bC),QC=Xs,Kh=new de(function(A){return A.complete()});function Zg(A){return A&&Ke(A.schedule)}function Jh(A){return A[A.length-1]}function qh(A){return Ke(Jh(A))?A.pop():void 0}function Fl(A){return Zg(Jh(A))?A.pop():void 0}function DC(A,e){return typeof Jh(A)=="number"?A.pop():e}var Xh=function(A){return A&&typeof A.length=="number"&&typeof A!="function"};function jg(A){return Ke(A==null?void 0:A.then)}function em(A){return Ke(A[zh])}function tm(A){return Symbol.asyncIterator&&Ke(A==null?void 0:A[Symbol.asyncIterator])}function im(A){return new TypeError("You provided "+(A!==null&&typeof A=="object"?"an invalid object":"'"+A+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function SC(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Am=SC();function rm(A){return Ke(A==null?void 0:A[Am])}function sm(A){return hC(this,arguments,function(){var t,i,r,s;return Wg(this,function(n){switch(n.label){case 0:t=A.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,ks(t.read())];case 3:return i=n.sent(),r=i.value,s=i.done,s?[4,ks(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,ks(r)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function nm(A){return Ke(A==null?void 0:A.getReader)}function Ht(A){if(A instanceof de)return A;if(A!=null){if(em(A))return TC(A);if(Xh(A))return kC(A);if(jg(A))return ge(A);if(tm(A))return am(A);if(rm(A))return PC(A);if(nm(A))return MC(A)}throw im(A)}function TC(A){return new de(function(e){var t=A[zh]();if(Ke(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function kC(A){return new de(function(e){for(var t=0;t<A.length&&!e.closed;t++)e.next(A[t]);e.complete()})}function ge(A){return new de(function(e){A.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Xg)})}function PC(A){return new de(function(e){var t,i;try{for(var r=Os(A),s=r.next();!s.done;s=r.next()){var n=s.value;if(e.next(n),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}e.complete()})}function am(A){return new de(function(e){RC(A,e).catch(function(t){return e.error(t)})})}function MC(A){return am(sm(A))}function RC(A,e){var t,i,r,s;return dC(this,void 0,void 0,function(){var n,a;return Wg(this,function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),t=cC(A),o.label=1;case 1:return[4,t.next()];case 2:if(i=o.sent(),!!i.done)return[3,4];if(n=i.value,e.next(n),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=o.sent(),r={error:a},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(r)throw r.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function xA(A,e,t,i,r){i===void 0&&(i=0),r===void 0&&(r=!1);var s=e.schedule(function(){t(),r?A.add(this.schedule(null,i)):this.unsubscribe()},i);if(A.add(s),!r)return s}function om(A,e){return e===void 0&&(e=0),Ot(function(t,i){t.subscribe(ct(i,function(r){return xA(i,A,function(){return i.next(r)},e)},function(){return xA(i,A,function(){return i.complete()},e)},function(r){return xA(i,A,function(){return i.error(r)},e)}))})}function lm(A,e){return e===void 0&&(e=0),Ot(function(t,i){i.add(A.schedule(function(){return t.subscribe(i)},e))})}function xC(A,e){return Ht(A).pipe(lm(e),om(e))}function LC(A,e){return Ht(A).pipe(lm(e),om(e))}function NC(A,e){return new de(function(t){var i=0;return e.schedule(function(){i===A.length?t.complete():(t.next(A[i++]),t.closed||this.schedule())})})}function FC(A,e){return new de(function(t){var i;return xA(t,e,function(){i=A[Am](),xA(t,e,function(){var r,s,n;try{r=i.next(),s=r.value,n=r.done}catch(a){t.error(a);return}n?t.complete():t.next(s)},0,!0)}),function(){return Ke(i==null?void 0:i.return)&&i.return()}})}function dm(A,e){if(!A)throw new Error("Iterable cannot be null");return new de(function(t){xA(t,e,function(){var i=A[Symbol.asyncIterator]();xA(t,e,function(){i.next().then(function(r){r.done?t.complete():t.next(r.value)})},0,!0)})})}function GC(A,e){return dm(sm(A),e)}function OC(A,e){if(A!=null){if(em(A))return xC(A,e);if(Xh(A))return NC(A,e);if(jg(A))return LC(A,e);if(tm(A))return dm(A,e);if(rm(A))return FC(A,e);if(nm(A))return GC(A,e)}throw im(A)}function jt(A,e){return e?OC(A,e):Ht(A)}function Xt(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Fl(A);return jt(A,t)}var Zh=Nl(function(A){return function(){A(this),this.name="EmptyError",this.message="no elements in sequence"}});function me(A,e){return new Promise(function(t,i){var r=new al({next:function(s){t(s),r.unsubscribe()},error:i,complete:function(){i(new Zh)}});A.subscribe(r)})}function hm(A){return A instanceof Date&&!isNaN(A)}var HC=Nl(function(A){return function(t){t===void 0&&(t=null),A(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function Rr(A,e){var t=hm(A)?{first:A}:typeof A=="number"?{each:A}:A,i=t.first,r=t.each,s=t.with,n=s===void 0?$C:s,a=t.scheduler,o=a===void 0?Xs:a,l=t.meta,d=l===void 0?null:l;if(i==null&&r==null)throw new TypeError("No timeout provided.");return Ot(function(h,c){var m,g,u=null,f=0,I=function(v){g=xA(c,o,function(){try{m.unsubscribe(),Ht(n({meta:d,lastValue:u,seen:f})).subscribe(c)}catch(_){c.error(_)}},v)};m=h.subscribe(ct(c,function(v){g==null||g.unsubscribe(),f++,c.next(u=v),r>0&&I(r)},void 0,void 0,function(){g!=null&&g.closed||g==null||g.unsubscribe(),u=null})),!f&&I(i!=null?typeof i=="number"?i:+i-o.now():r)})}function $C(A){throw new HC(A)}function _e(A,e){return Ot(function(t,i){var r=0;t.subscribe(ct(i,function(s){i.next(A.call(e,s,r++))}))})}var UC=Array.isArray;function VC(A,e){return UC(e)?A.apply(void 0,Hs([],Or(e))):A(e)}function jh(A){return _e(function(e){return VC(A,e)})}var YC=Array.isArray,WC=Object.getPrototypeOf,zC=Object.prototype,KC=Object.keys;function cm(A){if(A.length===1){var e=A[0];if(YC(e))return{args:e,keys:null};if(JC(e)){var t=KC(e);return{args:t.map(function(i){return e[i]}),keys:t}}}return{args:A,keys:null}}function JC(A){return A&&typeof A=="object"&&WC(A)===zC}function um(A,e){return A.reduce(function(t,i,r){return t[i]=e[r],t},{})}function Gl(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Fl(A),i=qh(A),r=cm(A),s=r.args,n=r.keys;if(s.length===0)return jt([],t);var a=new de(qC(s,t,n?function(o){return um(n,o)}:Wr));return i?a.pipe(jh(i)):a}function qC(A,e,t){return t===void 0&&(t=Wr),function(i){eu(e,function(){for(var r=A.length,s=new Array(r),n=r,a=r,o=function(d){eu(e,function(){var h=jt(A[d],e),c=!1;h.subscribe(ct(i,function(m){s[d]=m,c||(c=!0,a--),a||i.next(t(s.slice()))},function(){--n||i.complete()}))},i)},l=0;l<r;l++)o(l)},i)}}function eu(A,e,t){A?xA(t,A,e):e()}function XC(A,e,t,i,r,s,n,a){var o=[],l=0,d=0,h=!1,c=function(){h&&!o.length&&!l&&e.complete()},m=function(u){return l<i?g(u):o.push(u)},g=function(u){l++;var f=!1;Ht(t(u,d++)).subscribe(ct(e,function(I){e.next(I)},function(){f=!0},void 0,function(){if(f)try{l--;for(var I=function(){var v=o.shift();n||g(v)};o.length&&l<i;)I();c()}catch(v){e.error(v)}}))};return A.subscribe(ct(e,m,function(){h=!0,c()})),function(){}}function or(A,e,t){return t===void 0&&(t=1/0),Ke(e)?or(function(i,r){return _e(function(s,n){return e(i,s,r,n)})(Ht(A(i,r)))},t):(typeof e=="number"&&(t=e),Ot(function(i,r){return XC(i,r,A,t)}))}function ec(A){return A===void 0&&(A=1/0),or(Wr,A)}function ZC(){return ec(1)}function jC(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return ZC()(jt(A,Fl(A)))}function ev(A){return new de(function(e){Ht(A()).subscribe(e)})}function gi(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=qh(A),i=cm(A),r=i.args,s=i.keys,n=new de(function(a){var o=r.length;if(!o){a.complete();return}for(var l=new Array(o),d=o,h=o,c=function(g){var u=!1;Ht(r[g]).subscribe(ct(a,function(f){u||(u=!0,h--),l[g]=f},function(){return d--},void 0,function(){(!d||!u)&&(h||a.next(s?um(s,l):l),a.complete())}))},m=0;m<o;m++)c(m)});return t?n.pipe(jh(t)):n}var tv=["addListener","removeListener"],iv=["addEventListener","removeEventListener"],Av=["on","off"];function xe(A,e,t,i){if(Ke(t)&&(i=t,t=void 0),i)return xe(A,e,t).pipe(jh(i));var r=Or(nv(A)?iv.map(function(a){return function(o){return A[a](e,o,t)}}):rv(A)?tv.map(tu(A,e)):sv(A)?Av.map(tu(A,e)):[],2),s=r[0],n=r[1];if(!s&&Xh(A))return or(function(a){return xe(a,e,t)})(Ht(A));if(!s)throw new TypeError("Invalid event target");return new de(function(a){var o=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return a.next(1<l.length?l:l[0])};return s(o),function(){return n(o)}})}function tu(A,e){return function(t){return function(i){return A[t](e,i)}}}function rv(A){return Ke(A.addListener)&&Ke(A.removeListener)}function sv(A){return Ke(A.on)&&Ke(A.off)}function nv(A){return Ke(A.addEventListener)&&Ke(A.removeEventListener)}function Jn(A,e,t){A===void 0&&(A=0),t===void 0&&(t=QC);var i=-1;return e!=null&&(Zg(e)?t=e:i=e),new de(function(r){var s=hm(A)?+A-t.now():A;s<0&&(s=0);var n=0;return t.schedule(function(){r.closed||(r.next(n++),0<=i?this.schedule(void 0,i):r.complete())},s)})}function tc(A,e){return A===void 0&&(A=0),e===void 0&&(e=Xs),A<0&&(A=0),Jn(A,A,e)}function dA(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=Fl(A),i=DC(A,1/0),r=A;return r.length?r.length===1?Ht(r[0]):ec(i)(jt(r,t)):Kh}var av=Array.isArray;function gm(A){return A.length===1&&av(A[0])?A[0]:A}function ce(A,e){return Ot(function(t,i){var r=0;t.subscribe(ct(i,function(s){return A.call(e,s,r++)&&i.next(s)}))})}function ov(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return A=gm(A),A.length===1?Ht(A[0]):new de(lv(A))}function lv(A){return function(e){for(var t=[],i=function(s){t.push(Ht(A[s]).subscribe(ct(e,function(n){if(t){for(var a=0;a<t.length;a++)a!==s&&t[a].unsubscribe();t=null}e.next(n)})))},r=0;t&&!e.closed&&r<A.length;r++)i(r)}}function zr(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=qh(A),i=gm(A);return i.length?new de(function(r){var s=i.map(function(){return[]}),n=i.map(function(){return!1});r.add(function(){s=n=null});for(var a=function(l){Ht(i[l]).subscribe(ct(r,function(d){if(s[l].push(d),s.every(function(c){return c.length})){var h=s.map(function(c){return c.shift()});r.next(t?t.apply(void 0,Hs([],Or(h))):h),s.some(function(c,m){return!c.length&&n[m]})&&r.complete()}},function(){n[l]=!0,!s[l].length&&r.complete()}))},o=0;!r.closed&&o<i.length;o++)a(o);return function(){s=n=null}}):Kh}function xr(A){return Ot(function(e,t){var i=null,r=!1,s;i=e.subscribe(ct(t,void 0,void 0,function(n){s=Ht(A(n,xr(A)(e))),i?(i.unsubscribe(),i=null,s.subscribe(t)):r=!0})),r&&(i.unsubscribe(),i=null,s.subscribe(t))})}function dv(A,e,t,i,r){return function(s,n){var a=t,o=e,l=0;s.subscribe(ct(n,function(d){var h=l++;o=a?A(o,d,h):(a=!0,d)},function(){a&&n.next(o),n.complete()}))}}function hv(A,e){return Ot(dv(A,e,arguments.length>=2,!1,!0))}var cv=function(A,e){return A.push(e),A};function Wd(){return Ot(function(A,e){hv(cv,[])(A).subscribe(e)})}function zd(A,e){return Ke(e)?or(A,e,1):or(A,1)}function Ti(A,e){return e===void 0&&(e=Xs),Ot(function(t,i){var r=null,s=null,n=null,a=function(){if(r){r.unsubscribe(),r=null;var l=s;s=null,i.next(l)}};function o(){var l=n+A,d=e.now();if(d<l){r=this.schedule(void 0,l-d),i.add(r);return}a()}t.subscribe(ct(i,function(l){s=l,n=e.now(),r||(r=e.schedule(o,A),i.add(r))},function(){a(),i.complete()},void 0,function(){s=r=null}))})}function uv(A){return Ot(function(e,t){var i=!1;e.subscribe(ct(t,function(r){i=!0,t.next(r)},function(){i||t.next(A),t.complete()}))})}function it(A){return A<=0?function(){return Kh}:Ot(function(e,t){var i=0;e.subscribe(ct(t,function(r){++i<=A&&(t.next(r),A<=i&&t.complete())}))})}function gv(A){return _e(function(){return A})}function mv(A,e){return or(function(t,i){return Ht(A(t,i)).pipe(it(1),gv(t))})}function fv(A,e){e===void 0&&(e=Xs);var t=Jn(A,e);return mv(function(){return t})}function ic(A,e){return e===void 0&&(e=Wr),A=A??pv,Ot(function(t,i){var r,s=!0;t.subscribe(ct(i,function(n){var a=e(n);(s||!A(r,a))&&(s=!1,r=a,i.next(n))}))})}function pv(A,e){return A===e}function Ev(A){return A===void 0&&(A=Cv),Ot(function(e,t){var i=!1;e.subscribe(ct(t,function(r){i=!0,t.next(r)},function(){return i?t.complete():t.error(A())}))})}function Cv(){return new Zh}function Ps(A,e){var t=arguments.length>=2;return function(i){return i.pipe(Wr,it(1),t?uv(e):Ev(function(){return new Zh}))}}function vv(A){return Ot(function(e,t){var i=!1,r=null;e.subscribe(ct(t,function(s){i=!0,r=s})),Ht(A).subscribe(ct(t,function(){if(i){i=!1;var s=r;r=null,t.next(s)}},nl))})}function mm(A,e){return e===void 0&&(e=Xs),vv(tc(A,e))}function iu(A){return ce(function(e,t){return A<=t})}function ol(A,e){return Ot(function(t,i){var r=null,s=0,n=!1,a=function(){return n&&!r&&i.complete()};t.subscribe(ct(i,function(o){r==null||r.unsubscribe();var l=0,d=s++;Ht(A(o,d)).subscribe(r=ct(i,function(h){return i.next(e?e(o,h,d,l++):h)},function(){r=null,a()}))},function(){n=!0,a()}))})}function E(A){return Ot(function(e,t){Ht(A).subscribe(ct(t,function(){return t.complete()},nl)),!t.closed&&e.subscribe(t)})}function fm(A,e,t){var i=Ke(A)||e||t?{next:A,error:e,complete:t}:A;return i?Ot(function(r,s){var n;(n=i.subscribe)===null||n===void 0||n.call(i);var a=!0;r.subscribe(ct(s,function(o){var l;(l=i.next)===null||l===void 0||l.call(i,o),s.next(o)},function(){var o;a=!1,(o=i.complete)===null||o===void 0||o.call(i),s.complete()},function(o){var l;a=!1,(l=i.error)===null||l===void 0||l.call(i,o),s.error(o)},function(){var o,l;a&&((o=i.unsubscribe)===null||o===void 0||o.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):Wr}class Ol{constructor(e){this.onChange$=new y,this.style={...e}}get style(){return this._style}set style(e){let t=JSON.stringify(this._style);this._style={...this._style,...e},t!==JSON.stringify(this._style)&&this.onChange$.next(this._style)}}class Yt{static isNullUndefinedOrWhitespace(e){return typeof e===void 0||e==null?!0:`${e}`.replace(/\s/g,"").length<1}static isNonEmpty(e){return!this.isNullUndefinedOrWhitespace(e)}static isEmpty(e){return!this.isNonEmpty(e)}static toArrayBuffer(e){return new TextEncoder().encode(e).buffer}}class _i extends Error{constructor(e,t){super(e),this.name=Yt.isNullUndefinedOrWhitespace(t)?"OmpError":t}}class pm extends _i{constructor(e){super(e,"OmpBroadcastChannelError")}}class Em extends _i{constructor(e){super(e,"OmpBroadcastChannelTimeoutError")}}class Kt extends _i{constructor(e){super(e,"OmpVideoWindowPlaybackError")}}var Ge;(function(A){A.assertEqual=r=>r;function e(r){}A.assertIs=e;function t(r){throw new Error}A.assertNever=t,A.arrayToEnum=r=>{const s={};for(const n of r)s[n]=n;return s},A.getValidEnumValues=r=>{const s=A.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),n={};for(const a of s)n[a]=r[a];return A.objectValues(n)},A.objectValues=r=>A.objectKeys(r).map(function(s){return r[s]}),A.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&s.push(n);return s},A.find=(r,s)=>{for(const n of r)if(s(n))return n},A.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(n=>typeof n=="string"?`'${n}'`:n).join(s)}A.joinValues=i,A.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Ge||(Ge={}));var Kd;(function(A){A.mergeShapes=(e,t)=>({...e,...t})})(Kd||(Kd={}));const Ae=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ir=A=>{switch(typeof A){case"undefined":return Ae.undefined;case"string":return Ae.string;case"number":return isNaN(A)?Ae.nan:Ae.number;case"boolean":return Ae.boolean;case"function":return Ae.function;case"bigint":return Ae.bigint;case"symbol":return Ae.symbol;case"object":return Array.isArray(A)?Ae.array:A===null?Ae.null:A.then&&typeof A.then=="function"&&A.catch&&typeof A.catch=="function"?Ae.promise:typeof Map<"u"&&A instanceof Map?Ae.map:typeof Set<"u"&&A instanceof Set?Ae.set:typeof Date<"u"&&A instanceof Date?Ae.date:Ae.object;default:return Ae.unknown}},U=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Iv=A=>JSON.stringify(A,null,2).replace(/"([^"]+)":/g,"$1:");class mi extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const n of s.issues)if(n.code==="invalid_union")n.unionErrors.map(r);else if(n.code==="invalid_return_type")r(n.returnTypeError);else if(n.code==="invalid_arguments")r(n.argumentsError);else if(n.path.length===0)i._errors.push(t(n));else{let a=i,o=0;for(;o<n.path.length;){const l=n.path[o];o===n.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(n))):a[l]=a[l]||{_errors:[]},a=a[l],o++}}};return r(this),i}static assert(e){if(!(e instanceof mi))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},i=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}mi.create=A=>new mi(A);const $s=(A,e)=>{let t;switch(A.code){case U.invalid_type:A.received===Ae.undefined?t="Required":t=`Expected ${A.expected}, received ${A.received}`;break;case U.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(A.expected,Ge.jsonStringifyReplacer)}`;break;case U.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ge.joinValues(A.keys,", ")}`;break;case U.invalid_union:t="Invalid input";break;case U.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ge.joinValues(A.options)}`;break;case U.invalid_enum_value:t=`Invalid enum value. Expected ${Ge.joinValues(A.options)}, received '${A.received}'`;break;case U.invalid_arguments:t="Invalid function arguments";break;case U.invalid_return_type:t="Invalid function return type";break;case U.invalid_date:t="Invalid date";break;case U.invalid_string:typeof A.validation=="object"?"includes"in A.validation?(t=`Invalid input: must include "${A.validation.includes}"`,typeof A.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${A.validation.position}`)):"startsWith"in A.validation?t=`Invalid input: must start with "${A.validation.startsWith}"`:"endsWith"in A.validation?t=`Invalid input: must end with "${A.validation.endsWith}"`:Ge.assertNever(A.validation):A.validation!=="regex"?t=`Invalid ${A.validation}`:t="Invalid";break;case U.too_small:A.type==="array"?t=`Array must contain ${A.exact?"exactly":A.inclusive?"at least":"more than"} ${A.minimum} element(s)`:A.type==="string"?t=`String must contain ${A.exact?"exactly":A.inclusive?"at least":"over"} ${A.minimum} character(s)`:A.type==="number"?t=`Number must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${A.minimum}`:A.type==="date"?t=`Date must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(A.minimum))}`:t="Invalid input";break;case U.too_big:A.type==="array"?t=`Array must contain ${A.exact?"exactly":A.inclusive?"at most":"less than"} ${A.maximum} element(s)`:A.type==="string"?t=`String must contain ${A.exact?"exactly":A.inclusive?"at most":"under"} ${A.maximum} character(s)`:A.type==="number"?t=`Number must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`:A.type==="bigint"?t=`BigInt must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`:A.type==="date"?t=`Date must be ${A.exact?"exactly":A.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(A.maximum))}`:t="Invalid input";break;case U.custom:t="Invalid input";break;case U.invalid_intersection_types:t="Intersection results could not be merged";break;case U.not_multiple_of:t=`Number must be a multiple of ${A.multipleOf}`;break;case U.not_finite:t="Number must be finite";break;default:t=e.defaultError,Ge.assertNever(A)}return{message:t}};let Cm=$s;function _v(A){Cm=A}function ll(){return Cm}const dl=A=>{const{data:e,path:t,errorMaps:i,issueData:r}=A,s=[...t,...r.path||[]],n={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let a="";const o=i.filter(l=>!!l).slice().reverse();for(const l of o)a=l(n,{data:e,defaultError:a}).message;return{...r,path:s,message:a}},Bv=[];function ee(A,e){const t=ll(),i=dl({issueData:e,data:A.data,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,t,t===$s?void 0:$s].filter(r=>!!r)});A.common.issues.push(i)}class ei{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return Ce;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const s=await r.key,n=await r.value;i.push({key:s,value:n})}return ei.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:s,value:n}=r;if(s.status==="aborted"||n.status==="aborted")return Ce;s.status==="dirty"&&e.dirty(),n.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof n.value<"u"||r.alwaysSet)&&(i[s.value]=n.value)}return{status:e.value,value:i}}}const Ce=Object.freeze({status:"aborted"}),bs=A=>({status:"dirty",value:A}),ai=A=>({status:"valid",value:A}),Jd=A=>A.status==="aborted",qd=A=>A.status==="dirty",qn=A=>A.status==="valid",Xn=A=>typeof Promise<"u"&&A instanceof Promise;function hl(A,e,t,i){if(typeof e=="function"?A!==e||!i:!e.has(A))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(A)}function vm(A,e,t,i,r){if(typeof e=="function"?A!==e||!r:!e.has(A))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(A,t),t}var le;(function(A){A.errToObj=e=>typeof e=="string"?{message:e}:e||{},A.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(le||(le={}));var _n,Bn;class gA{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Au=(A,e)=>{if(qn(e))return{success:!0,data:e.value};if(!A.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new mi(A.common.issues);return this._error=t,this._error}}};function ye(A){if(!A)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=A;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(n,a)=>{var o,l;const{message:d}=A;return n.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(o=d??i)!==null&&o!==void 0?o:a.defaultError}:n.code!=="invalid_type"?{message:a.defaultError}:{message:(l=d??t)!==null&&l!==void 0?l:a.defaultError}},description:r}}class Te{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ir(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ei,ctx:{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Xn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;const r={common:{issues:[],async:(i=t==null?void 0:t.async)!==null&&i!==void 0?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Au(r,s)}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(Xn(r)?r:Promise.resolve(r));return Au(i,s)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,s)=>{const n=e(r),a=()=>s.addIssue({code:U.custom,...i(r)});return typeof Promise<"u"&&n instanceof Promise?n.then(o=>o?!0:(a(),!1)):n?!0:(a(),!1)})}refinement(e,t){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new Wi({schema:this,typeName:Ee.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cA.create(this,this._def)}nullable(){return cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vi.create(this,this._def)}promise(){return Vs.create(this,this._def)}or(e){return ta.create([this,e],this._def)}and(e){return ia.create(this,e,this._def)}transform(e){return new Wi({...ye(this._def),schema:this,typeName:Ee.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new aa({...ye(this._def),innerType:this,defaultValue:t,typeName:Ee.ZodDefault})}brand(){return new Ac({typeName:Ee.ZodBranded,type:this,...ye(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new oa({...ye(this._def),innerType:this,catchValue:t,typeName:Ee.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return wa.create(this,e)}readonly(){return la.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wv=/^c[^\s-]{8,}$/i,bv=/^[0-9a-z]+$/,yv=/^[0-9A-HJKMNP-TV-Z]{26}$/,Qv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dv=/^[a-z0-9_-]{21}$/i,Sv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Tv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let bd;const Pv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Mv=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Rv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Im="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xv=new RegExp(`^${Im}$`);function _m(A){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return A.precision?e=`${e}\\.\\d{${A.precision}}`:A.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Lv(A){return new RegExp(`^${_m(A)}$`)}function Bm(A){let e=`${Im}T${_m(A)}`;const t=[];return t.push(A.local?"Z?":"Z"),A.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Nv(A,e){return!!((e==="v4"||!e)&&Pv.test(A)||(e==="v6"||!e)&&Mv.test(A))}class Hi extends Te{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ae.string){const s=this._getOrReturnCtx(e);return ee(s,{code:U.invalid_type,expected:Ae.string,received:s.parsedType}),Ce}const i=new ei;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),ee(r,{code:U.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),ee(r,{code:U.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const n=e.data.length>s.value,a=e.data.length<s.value;(n||a)&&(r=this._getOrReturnCtx(e,r),n?ee(r,{code:U.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ee(r,{code:U.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Tv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"email",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")bd||(bd=new RegExp(kv,"u")),bd.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"emoji",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Qv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"uuid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")Dv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"nanoid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")wv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"cuid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")bv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"cuid2",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")yv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"ulid",code:U.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ee(r,{validation:"url",code:U.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"regex",code:U.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Bm(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?xv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?Lv(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:U.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?Sv.test(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{validation:"duration",code:U.invalid_string,message:s.