@designcombo/state 0.1.38 → 0.1.39
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +1383 -1325
- package/dist/index.umd.js +2 -2
- package/package.json +6 -6
package/dist/index.umd.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(
|
1
|
+
(function(_,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("@designcombo/events")):typeof define=="function"&&define.amd?define(["exports","@designcombo/events"],w):(_=typeof globalThis<"u"?globalThis:_||self,w(_.events={},_.events))})(this,function(_,w){"use strict";var Us=Object.defineProperty;var Xs=(_,w,Rt)=>w in _?Us(_,w,{enumerable:!0,configurable:!0,writable:!0,value:Rt}):_[w]=Rt;var ee=(_,w,Rt)=>Xs(_,typeof w!="symbol"?w+"":w,Rt);var Rt=function(t,r){return Rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},Rt(t,r)};function Ee(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");Rt(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}function Sr(t){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&t[r],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Tr(t,r){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var i=n.call(t),s,c=[],d;try{for(;(r===void 0||r-- >0)&&!(s=i.next()).done;)c.push(s.value)}catch(m){d={error:m}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(d)throw d.error}}return c}function Ar(t,r,n){if(n||arguments.length===2)for(var i=0,s=r.length,c;i<s;i++)(c||!(i in r))&&(c||(c=Array.prototype.slice.call(r,0,i)),c[i]=r[i]);return t.concat(c||Array.prototype.slice.call(r))}typeof SuppressedError=="function"&&SuppressedError;function kt(t){return typeof t=="function"}function Ln(t){var r=function(i){Error.call(i),i.stack=new Error().stack},n=t(r);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var kr=Ln(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
2
2
|
`+n.map(function(i,s){return s+1+") "+i.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function Ar(t,r){if(t){var n=t.indexOf(r);0<=n&&t.splice(n,1)}}var Ge=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,n,i,s,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var _=Er(d),A=_.next();!A.done;A=_.next()){var x=A.value;x.remove(this)}}catch(h){r={error:h}}finally{try{A&&!A.done&&(n=_.return)&&n.call(_)}finally{if(r)throw r.error}}else d.remove(this);var S=this.initialTeardown;if(At(S))try{S()}catch(h){c=h instanceof Tr?h.errors:[h]}var H=this._finalizers;if(H){this._finalizers=null;try{for(var I=Er(H),f=I.next();!f.done;f=I.next()){var l=f.value;try{Fn(l)}catch(h){c=c??[],h instanceof Tr?c=Sr(Sr([],vr(c)),vr(h.errors)):c.push(h)}}}catch(h){i={error:h}}finally{try{f&&!f.done&&(s=I.return)&&s.call(I)}finally{if(i)throw i.error}}}if(c)throw new Tr(c)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)Fn(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(r)}},t.prototype._hasParent=function(r){var n=this._parentage;return n===r||Array.isArray(n)&&n.includes(r)},t.prototype._addParent=function(r){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(r),n):n?[n,r]:r},t.prototype._removeParent=function(r){var n=this._parentage;n===r?this._parentage=null:Array.isArray(n)&&Ar(n,r)},t.prototype.remove=function(r){var n=this._finalizers;n&&Ar(n,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),xn=Ge.EMPTY;function Nn(t){return t instanceof Ge||t&&"closed"in t&&At(t.remove)&&At(t.add)&&At(t.unsubscribe)}function Fn(t){At(t)?t():t.unsubscribe()}var Hn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},jn={setTimeout:function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,Sr([t,r],vr(n)))},clearTimeout:function(t){var r=jn.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Di(t){jn.setTimeout(function(){throw t})}function Yn(){}function Ue(t){t()}var $n=function(t){ge(r,t);function r(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Nn(n)&&n.add(i)):i.destination=Ri,i}return r.create=function(n,i,s){return new wr(n,i,s)},r.prototype.next=function(n){this.isStopped||this._next(n)},r.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(n){this.destination.next(n)},r.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(Ge),Mi=Function.prototype.bind;function kr(t,r){return Mi.call(t,r)}var Oi=function(){function t(r){this.partialObserver=r}return t.prototype.next=function(r){var n=this.partialObserver;if(n.next)try{n.next(r)}catch(i){Xe(i)}},t.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(i){Xe(i)}else Xe(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){Xe(n)}},t}(),wr=function(t){ge(r,t);function r(n,i,s){var c=t.call(this)||this,d;if(At(n)||!n)d={next:n??void 0,error:i??void 0,complete:s??void 0};else{var _;c&&Hn.useDeprecatedNextContext?(_=Object.create(n),_.unsubscribe=function(){return c.unsubscribe()},d={next:n.next&&kr(n.next,_),error:n.error&&kr(n.error,_),complete:n.complete&&kr(n.complete,_)}):d=n}return c.destination=new Oi(d),c}return r}($n);function Xe(t){Di(t)}function Pi(t){throw t}var Ri={closed:!0,next:Yn,error:Pi,complete:Yn},Ci=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Li(t){return t}function xi(t){return t.length===0?Li:t.length===1?t[0]:function(n){return t.reduce(function(i,s){return s(i)},n)}}var zn=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var n=new t;return n.source=this,n.operator=r,n},t.prototype.subscribe=function(r,n,i){var s=this,c=Fi(r)?r:new wr(r,n,i);return Ue(function(){var d=s,_=d.operator,A=d.source;c.add(_?_.call(c,A):A?s._subscribe(c):s._trySubscribe(c))}),c},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(n){r.error(n)}},t.prototype.forEach=function(r,n){var i=this;return n=Gn(n),new n(function(s,c){var d=new wr({next:function(_){try{r(_)}catch(A){c(A),d.unsubscribe()}},error:c,complete:s});i.subscribe(d)})},t.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},t.prototype[Ci]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return xi(r)(this)},t.prototype.toPromise=function(r){var n=this;return r=Gn(r),new r(function(i,s){var c;n.subscribe(function(d){return c=d},function(d){return s(d)},function(){return i(c)})})},t.create=function(r){return new t(r)},t}();function Gn(t){var r;return(r=t??Hn.Promise)!==null&&r!==void 0?r:Promise}function Ni(t){return t&&At(t.next)&&At(t.error)&&At(t.complete)}function Fi(t){return t&&t instanceof $n||Ni(t)&&Nn(t)}var Hi=Ln(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Un=function(t){ge(r,t);function r(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return r.prototype.lift=function(n){var i=new Xn(this,this);return i.operator=n,i},r.prototype._throwIfClosed=function(){if(this.closed)throw new Hi},r.prototype.next=function(n){var i=this;Ue(function(){var s,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=Er(i.currentObservers),_=d.next();!_.done;_=d.next()){var A=_.value;A.next(n)}}catch(x){s={error:x}}finally{try{_&&!_.done&&(c=d.return)&&c.call(d)}finally{if(s)throw s.error}}}})},r.prototype.error=function(n){var i=this;Ue(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var s=i.observers;s.length;)s.shift().error(n)}})},r.prototype.complete=function(){var n=this;Ue(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var i=n.observers;i.length;)i.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},r.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},r.prototype._innerSubscribe=function(n){var i=this,s=this,c=s.hasError,d=s.isStopped,_=s.observers;return c||d?xn:(this.currentObservers=null,_.push(n),new Ge(function(){i.currentObservers=null,Ar(_,n)}))},r.prototype._checkFinalizedStatuses=function(n){var i=this,s=i.hasError,c=i.thrownError,d=i.isStopped;s?n.error(c):d&&n.complete()},r.prototype.asObservable=function(){var n=new zn;return n.source=this,n},r.create=function(n,i){return new Xn(n,i)},r}(zn),Xn=function(t){ge(r,t);function r(n,i){var s=t.call(this)||this;return s.destination=n,s.source=i,s}return r.prototype.next=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,n)},r.prototype.error=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,n)},r.prototype.complete=function(){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||i===void 0||i.call(n)},r.prototype._subscribe=function(n){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&s!==void 0?s:xn},r}(Un),Wn=function(t){ge(r,t);function r(n){var i=t.call(this)||this;return i._value=n,i}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(n){var i=t.prototype._subscribe.call(this,n);return!i.closed&&n.next(this._value),i},r.prototype.getValue=function(){var n=this,i=n.hasError,s=n.thrownError,c=n._value;if(i)throw s;return this._throwIfClosed(),c},r.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},r}(Un),mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var We={exports:{}};We.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=1,c=2,d=9007199254740991,_="[object Arguments]",A="[object Array]",x="[object AsyncFunction]",S="[object Boolean]",H="[object Date]",I="[object Error]",f="[object Function]",l="[object GeneratorFunction]",h="[object Map]",b="[object Number]",g="[object Null]",E="[object Object]",p="[object Promise]",m="[object Proxy]",k="[object RegExp]",R="[object Set]",D="[object String]",L="[object Symbol]",N="[object Undefined]",C="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",G="[object Float32Array]",zt="[object Float64Array]",Gt="[object Int8Array]",re="[object Int16Array]",ne="[object Int32Array]",ie="[object Uint8Array]",ae="[object Uint8ClampedArray]",Y="[object Uint16Array]",se="[object Uint32Array]",oe=/[\\^$.*+?()[\]{}|]/g,ct=/^\[object .+?Constructor\]$/,Ut=/^(?:0|[1-9]\d*)$/,$={};$[G]=$[zt]=$[Gt]=$[re]=$[ne]=$[ie]=$[ae]=$[Y]=$[se]=!0,$[_]=$[A]=$[T]=$[S]=$[O]=$[H]=$[I]=$[f]=$[h]=$[b]=$[E]=$[k]=$[R]=$[D]=$[C]=!1;var U=typeof mt=="object"&&mt&&mt.Object===Object&&mt,X=typeof self=="object"&&self&&self.Object===Object&&self,P=U||X||Function("return this")(),pt=r&&!r.nodeType&&r,st=pt&&!0&&t&&!t.nodeType&&t,Z=st&&st.exports===pt,ht=Z&&U.process,J=function(){try{return ht&&ht.binding&&ht.binding("util")}catch{}}(),W=J&&J.isTypedArray;function bt(e,a){for(var o=-1,u=e==null?0:e.length,M=0,v=[];++o<u;){var j=e[o];a(j,o,e)&&(v[M++]=j)}return v}function Xt(e,a){for(var o=-1,u=a.length,M=e.length;++o<u;)e[M+o]=a[o];return e}function rr(e,a){for(var o=-1,u=e==null?0:e.length;++o<u;)if(a(e[o],o,e))return!0;return!1}function Wr(e,a){for(var o=-1,u=Array(e);++o<e;)u[o]=a(o);return u}function Kr(e){return function(a){return e(a)}}function ce(e,a){return e.has(a)}function De(e,a){return e==null?void 0:e[a]}function nr(e){var a=-1,o=Array(e.size);return e.forEach(function(u,M){o[++a]=[M,u]}),o}function ir(e,a){return function(o){return e(a(o))}}function Et(e){var a=-1,o=Array(e.size);return e.forEach(function(u){o[++a]=u}),o}var ue=Array.prototype,Br=Function.prototype,Wt=Object.prototype,le=P["__core-js_shared__"],Me=Br.toString,_t=Wt.hasOwnProperty,ar=function(){var e=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Wt.toString,Vr=RegExp("^"+Me.call(_t).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=Z?P.Buffer:void 0,fe=P.Symbol,or=P.Uint8Array,de=Wt.propertyIsEnumerable,Kt=ue.splice,It=fe?fe.toStringTag:void 0,pe=Object.getOwnPropertySymbols,Pe=Oe?Oe.isBuffer:void 0,Bt=ir(Object.keys,Object),Re=wt(P,"DataView"),Vt=wt(P,"Map"),Ce=wt(P,"Promise"),Le=wt(P,"Set"),xe=wt(P,"WeakMap"),Rt=wt(Object,"create"),cr=ot(Re),kt=ot(Vt),Zr=ot(Ce),Jr=ot(Le),qr=ot(xe),ur=fe?fe.prototype:void 0,Ne=ur?ur.valueOf:void 0;function q(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function Qr(){this.__data__=Rt?Rt(null):{},this.size=0}function tn(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}function en(e){var a=this.__data__;if(Rt){var o=a[e];return o===i?void 0:o}return _t.call(a,e)?a[e]:void 0}function rn(e){var a=this.__data__;return Rt?a[e]!==void 0:_t.call(a,e)}function nn(e,a){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Rt&&a===void 0?i:a,this}q.prototype.clear=Qr,q.prototype.delete=tn,q.prototype.get=en,q.prototype.has=rn,q.prototype.set=nn;function et(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function an(){this.__data__=[],this.size=0}function sn(e){var a=this.__data__,o=ye(a,e);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():Kt.call(a,o,1),--this.size,!0}function on(e){var a=this.__data__,o=ye(a,e);return o<0?void 0:a[o][1]}function cn(e){return ye(this.__data__,e)>-1}function un(e,a){var o=this.__data__,u=ye(o,e);return u<0?(++this.size,o.push([e,a])):o[u][1]=a,this}et.prototype.clear=an,et.prototype.delete=sn,et.prototype.get=on,et.prototype.has=cn,et.prototype.set=un;function ut(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function ln(){this.size=0,this.__data__={hash:new q,map:new(Vt||et),string:new q}}function fn(e){var a=gt(this,e).delete(e);return this.size-=a?1:0,a}function dn(e){return gt(this,e).get(e)}function pn(e){return gt(this,e).has(e)}function hn(e,a){var o=gt(this,e),u=o.size;return o.set(e,a),this.size+=o.size==u?0:1,this}ut.prototype.clear=ln,ut.prototype.delete=fn,ut.prototype.get=dn,ut.prototype.has=pn,ut.prototype.set=hn;function he(e){var a=-1,o=e==null?0:e.length;for(this.__data__=new ut;++a<o;)this.add(e[a])}function lr(e){return this.__data__.set(e,i),this}function me(e){return this.__data__.has(e)}he.prototype.add=he.prototype.push=lr,he.prototype.has=me;function vt(e){var a=this.__data__=new et(e);this.size=a.size}function Fe(){this.__data__=new et,this.size=0}function mn(e){var a=this.__data__,o=a.delete(e);return this.size=a.size,o}function yn(e){return this.__data__.get(e)}function _n(e){return this.__data__.has(e)}function In(e,a){var o=this.__data__;if(o instanceof et){var u=o.__data__;if(!Vt||u.length<n-1)return u.push([e,a]),this.size=++o.size,this;o=this.__data__=new ut(u)}return o.set(e,a),this.size=o.size,this}vt.prototype.clear=Fe,vt.prototype.delete=mn,vt.prototype.get=yn,vt.prototype.has=_n,vt.prototype.set=In;function gn(e,a){var o=_e(e),u=!o&&mr(e),M=!o&&!u&&Ie(e),v=!o&&!u&&!M&&Ir(e),j=o||u||M||v,F=j?Wr(e.length,String):[],K=F.length;for(var z in e)_t.call(e,z)&&!(j&&(z=="length"||M&&(z=="offset"||z=="parent")||v&&(z=="buffer"||z=="byteLength"||z=="byteOffset")||wn(z,K)))&&F.push(z);return F}function ye(e,a){for(var o=e.length;o--;)if(hr(e[o][0],a))return o;return-1}function He(e,a,o){var u=a(e);return _e(e)?u:Xt(u,o(e))}function Zt(e){return e==null?e===void 0?N:g:It&&It in Object(e)?Dt(e):pr(e)}function fr(e){return Tt(e)&&Zt(e)==_}function dr(e,a,o,u,M){return e===a?!0:e==null||a==null||!Tt(e)&&!Tt(a)?e!==e&&a!==a:bn(e,a,o,u,dr,M)}function bn(e,a,o,u,M,v){var j=_e(e),F=_e(a),K=j?A:St(e),z=F?A:St(a);K=K==_?E:K,z=z==_?E:z;var rt=K==E,lt=z==E,V=K==z;if(V&&Ie(e)){if(!Ie(a))return!1;j=!0,rt=!1}if(V&&!rt)return v||(v=new vt),j||Ir(e)?je(e,a,o,u,M,v):Tn(e,a,K,o,u,M,v);if(!(o&s)){var nt=rt&&_t.call(e,"__wrapped__"),Q=lt&&_t.call(a,"__wrapped__");if(nt||Q){var Ct=nt?e.value():e,Mt=Q?a.value():a;return v||(v=new vt),M(Ct,Mt,o,u,v)}}return V?(v||(v=new vt),An(e,a,o,u,M,v)):!1}function En(e){if(!_r(e)||Mn(e))return!1;var a=yr(e)?Vr:ct;return a.test(ot(e))}function vn(e){return Tt(e)&&$e(e.length)&&!!$[Zt(e)]}function Sn(e){if(!On(e))return Bt(e);var a=[];for(var o in Object(e))_t.call(e,o)&&o!="constructor"&&a.push(o);return a}function je(e,a,o,u,M,v){var j=o&s,F=e.length,K=a.length;if(F!=K&&!(j&&K>F))return!1;var z=v.get(e);if(z&&v.get(a))return z==a;var rt=-1,lt=!0,V=o&c?new he:void 0;for(v.set(e,a),v.set(a,e);++rt<F;){var nt=e[rt],Q=a[rt];if(u)var Ct=j?u(Q,nt,rt,a,e,v):u(nt,Q,rt,e,a,v);if(Ct!==void 0){if(Ct)continue;lt=!1;break}if(V){if(!rr(a,function(Mt,qt){if(!ce(V,qt)&&(nt===Mt||M(nt,Mt,o,u,v)))return V.push(qt)})){lt=!1;break}}else if(!(nt===Q||M(nt,Q,o,u,v))){lt=!1;break}}return v.delete(e),v.delete(a),lt}function Tn(e,a,o,u,M,v,j){switch(o){case O:if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case T:return!(e.byteLength!=a.byteLength||!v(new or(e),new or(a)));case S:case H:case b:return hr(+e,+a);case I:return e.name==a.name&&e.message==a.message;case k:case D:return e==a+"";case h:var F=nr;case R:var K=u&s;if(F||(F=Et),e.size!=a.size&&!K)return!1;var z=j.get(e);if(z)return z==a;u|=c,j.set(e,a);var rt=je(F(e),F(a),u,M,v,j);return j.delete(e),rt;case L:if(Ne)return Ne.call(e)==Ne.call(a)}return!1}function An(e,a,o,u,M,v){var j=o&s,F=Jt(e),K=F.length,z=Jt(a),rt=z.length;if(K!=rt&&!j)return!1;for(var lt=K;lt--;){var V=F[lt];if(!(j?V in a:_t.call(a,V)))return!1}var nt=v.get(e);if(nt&&v.get(a))return nt==a;var Q=!0;v.set(e,a),v.set(a,e);for(var Ct=j;++lt<K;){V=F[lt];var Mt=e[V],qt=a[V];if(u)var wi=j?u(qt,Mt,V,a,e,v):u(Mt,qt,V,e,a,v);if(!(wi===void 0?Mt===qt||M(Mt,qt,o,u,v):wi)){Q=!1;break}Ct||(Ct=V=="constructor")}if(Q&&!Ct){var gr=e.constructor,br=a.constructor;gr!=br&&"constructor"in e&&"constructor"in a&&!(typeof gr=="function"&&gr instanceof gr&&typeof br=="function"&&br instanceof br)&&(Q=!1)}return v.delete(e),v.delete(a),Q}function Jt(e){return He(e,ze,kn)}function gt(e,a){var o=e.__data__;return Dn(a)?o[typeof a=="string"?"string":"hash"]:o.map}function wt(e,a){var o=De(e,a);return En(o)?o:void 0}function Dt(e){var a=_t.call(e,It),o=e[It];try{e[It]=void 0;var u=!0}catch{}var M=sr.call(e);return u&&(a?e[It]=o:delete e[It]),M}var kn=pe?function(e){return e==null?[]:(e=Object(e),bt(pe(e),function(a){return de.call(e,a)}))}:Rn,St=Zt;(Re&&St(new Re(new ArrayBuffer(1)))!=O||Vt&&St(new Vt)!=h||Ce&&St(Ce.resolve())!=p||Le&&St(new Le)!=R||xe&&St(new xe)!=C)&&(St=function(e){var a=Zt(e),o=a==E?e.constructor:void 0,u=o?ot(o):"";if(u)switch(u){case cr:return O;case kt:return h;case Zr:return p;case Jr:return R;case qr:return C}return a});function wn(e,a){return a=a??d,!!a&&(typeof e=="number"||Ut.test(e))&&e>-1&&e%1==0&&e<a}function Dn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function Mn(e){return!!ar&&ar in e}function On(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||Wt;return e===o}function pr(e){return sr.call(e)}function ot(e){if(e!=null){try{return Me.call(e)}catch{}try{return e+""}catch{}}return""}function hr(e,a){return e===a||e!==e&&a!==a}var mr=fr(function(){return arguments}())?fr:function(e){return Tt(e)&&_t.call(e,"callee")&&!de.call(e,"callee")},_e=Array.isArray;function Ye(e){return e!=null&&$e(e.length)&&!yr(e)}var Ie=Pe||Cn;function Pn(e,a){return dr(e,a)}function yr(e){if(!_r(e))return!1;var a=Zt(e);return a==f||a==l||a==x||a==m}function $e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=d}function _r(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}function Tt(e){return e!=null&&typeof e=="object"}var Ir=W?Kr(W):vn;function ze(e){return Ye(e)?gn(e):Sn(e)}function Rn(){return[]}function Cn(){return!1}t.exports=Pn}(We,We.exports);var ji=We.exports;const it=Dr(ji);var Ke={exports:{}};Ke.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,c="[object Arguments]",d="[object Array]",_="[object Boolean]",A="[object Date]",x="[object Error]",S="[object Function]",H="[object GeneratorFunction]",I="[object Map]",f="[object Number]",l="[object Object]",h="[object Promise]",b="[object RegExp]",g="[object Set]",E="[object String]",p="[object Symbol]",m="[object WeakMap]",k="[object ArrayBuffer]",R="[object DataView]",D="[object Float32Array]",L="[object Float64Array]",N="[object Int8Array]",C="[object Int16Array]",T="[object Int32Array]",O="[object Uint8Array]",G="[object Uint8ClampedArray]",zt="[object Uint16Array]",Gt="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,ne=/\w*$/,ie=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,Y={};Y[c]=Y[d]=Y[k]=Y[R]=Y[_]=Y[A]=Y[D]=Y[L]=Y[N]=Y[C]=Y[T]=Y[I]=Y[f]=Y[l]=Y[b]=Y[g]=Y[E]=Y[p]=Y[O]=Y[G]=Y[zt]=Y[Gt]=!0,Y[x]=Y[S]=Y[m]=!1;var se=typeof mt=="object"&&mt&&mt.Object===Object&&mt,oe=typeof self=="object"&&self&&self.Object===Object&&self,ct=se||oe||Function("return this")(),Ut=r&&!r.nodeType&&r,$=Ut&&!0&&t&&!t.nodeType&&t,U=$&&$.exports===Ut;function X(e,a){return e.set(a[0],a[1]),e}function P(e,a){return e.add(a),e}function pt(e,a){for(var o=-1,u=e?e.length:0;++o<u&&a(e[o],o,e)!==!1;);return e}function st(e,a){for(var o=-1,u=a.length,M=e.length;++o<u;)e[M+o]=a[o];return e}function Z(e,a,o,u){for(var M=-1,v=e?e.length:0;++M<v;)o=a(o,e[M],M,e);return o}function ht(e,a){for(var o=-1,u=Array(e);++o<e;)u[o]=a(o);return u}function J(e,a){return e==null?void 0:e[a]}function W(e){var a=!1;if(e!=null&&typeof e.toString!="function")try{a=!!(e+"")}catch{}return a}function bt(e){var a=-1,o=Array(e.size);return e.forEach(function(u,M){o[++a]=[M,u]}),o}function Xt(e,a){return function(o){return e(a(o))}}function rr(e){var a=-1,o=Array(e.size);return e.forEach(function(u){o[++a]=u}),o}var Wr=Array.prototype,Kr=Function.prototype,ce=Object.prototype,De=ct["__core-js_shared__"],nr=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ir=Kr.toString,Et=ce.hasOwnProperty,ue=ce.toString,Br=RegExp("^"+ir.call(Et).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Wt=U?ct.Buffer:void 0,le=ct.Symbol,Me=ct.Uint8Array,_t=Xt(Object.getPrototypeOf,Object),ar=Object.create,sr=ce.propertyIsEnumerable,Vr=Wr.splice,Oe=Object.getOwnPropertySymbols,fe=Wt?Wt.isBuffer:void 0,or=Xt(Object.keys,Object),de=gt(ct,"DataView"),Kt=gt(ct,"Map"),It=gt(ct,"Promise"),pe=gt(ct,"Set"),Pe=gt(ct,"WeakMap"),Bt=gt(Object,"create"),Re=ot(de),Vt=ot(Kt),Ce=ot(It),Le=ot(pe),xe=ot(Pe),Rt=le?le.prototype:void 0,cr=Rt?Rt.valueOf:void 0;function kt(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function Zr(){this.__data__=Bt?Bt(null):{}}function Jr(e){return this.has(e)&&delete this.__data__[e]}function qr(e){var a=this.__data__;if(Bt){var o=a[e];return o===i?void 0:o}return Et.call(a,e)?a[e]:void 0}function ur(e){var a=this.__data__;return Bt?a[e]!==void 0:Et.call(a,e)}function Ne(e,a){var o=this.__data__;return o[e]=Bt&&a===void 0?i:a,this}kt.prototype.clear=Zr,kt.prototype.delete=Jr,kt.prototype.get=qr,kt.prototype.has=ur,kt.prototype.set=Ne;function q(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function Qr(){this.__data__=[]}function tn(e){var a=this.__data__,o=me(a,e);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():Vr.call(a,o,1),!0}function en(e){var a=this.__data__,o=me(a,e);return o<0?void 0:a[o][1]}function rn(e){return me(this.__data__,e)>-1}function nn(e,a){var o=this.__data__,u=me(o,e);return u<0?o.push([e,a]):o[u][1]=a,this}q.prototype.clear=Qr,q.prototype.delete=tn,q.prototype.get=en,q.prototype.has=rn,q.prototype.set=nn;function et(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function an(){this.__data__={hash:new kt,map:new(Kt||q),string:new kt}}function sn(e){return Jt(this,e).delete(e)}function on(e){return Jt(this,e).get(e)}function cn(e){return Jt(this,e).has(e)}function un(e,a){return Jt(this,e).set(e,a),this}et.prototype.clear=an,et.prototype.delete=sn,et.prototype.get=on,et.prototype.has=cn,et.prototype.set=un;function ut(e){this.__data__=new q(e)}function ln(){this.__data__=new q}function fn(e){return this.__data__.delete(e)}function dn(e){return this.__data__.get(e)}function pn(e){return this.__data__.has(e)}function hn(e,a){var o=this.__data__;if(o instanceof q){var u=o.__data__;if(!Kt||u.length<n-1)return u.push([e,a]),this;o=this.__data__=new et(u)}return o.set(e,a),this}ut.prototype.clear=ln,ut.prototype.delete=fn,ut.prototype.get=dn,ut.prototype.has=pn,ut.prototype.set=hn;function he(e,a){var o=Ye(e)||_e(e)?ht(e.length,String):[],u=o.length,M=!!u;for(var v in e)Et.call(e,v)&&!(M&&(v=="length"||Dn(v,u)))&&o.push(v);return o}function lr(e,a,o){var u=e[a];(!(Et.call(e,a)&&mr(u,o))||o===void 0&&!(a in e))&&(e[a]=o)}function me(e,a){for(var o=e.length;o--;)if(mr(e[o][0],a))return o;return-1}function vt(e,a){return e&&je(a,ze(a),e)}function Fe(e,a,o,u,M,v,j){var F;if(u&&(F=v?u(e,M,v,j):u(e)),F!==void 0)return F;if(!Tt(e))return e;var K=Ye(e);if(K){if(F=kn(e),!a)return Sn(e,F)}else{var z=Dt(e),rt=z==S||z==H;if(yr(e))return ye(e,a);if(z==l||z==c||rt&&!v){if(W(e))return v?e:{};if(F=St(rt?{}:e),!a)return Tn(e,vt(F,e))}else{if(!Y[z])return v?e:{};F=wn(e,z,Fe,a)}}j||(j=new ut);var lt=j.get(e);if(lt)return lt;if(j.set(e,F),!K)var V=o?An(e):ze(e);return pt(V||e,function(nt,Q){V&&(Q=nt,nt=e[Q]),lr(F,Q,Fe(nt,a,o,u,Q,e,j))}),F}function mn(e){return Tt(e)?ar(e):{}}function yn(e,a,o){var u=a(e);return Ye(e)?u:st(u,o(e))}function _n(e){return ue.call(e)}function In(e){if(!Tt(e)||On(e))return!1;var a=$e(e)||W(e)?Br:ie;return a.test(ot(e))}function gn(e){if(!pr(e))return or(e);var a=[];for(var o in Object(e))Et.call(e,o)&&o!="constructor"&&a.push(o);return a}function ye(e,a){if(a)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}function He(e){var a=new e.constructor(e.byteLength);return new Me(a).set(new Me(e)),a}function Zt(e,a){var o=a?He(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}function fr(e,a,o){var u=a?o(bt(e),!0):bt(e);return Z(u,X,new e.constructor)}function dr(e){var a=new e.constructor(e.source,ne.exec(e));return a.lastIndex=e.lastIndex,a}function bn(e,a,o){var u=a?o(rr(e),!0):rr(e);return Z(u,P,new e.constructor)}function En(e){return cr?Object(cr.call(e)):{}}function vn(e,a){var o=a?He(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}function Sn(e,a){var o=-1,u=e.length;for(a||(a=Array(u));++o<u;)a[o]=e[o];return a}function je(e,a,o,u){o||(o={});for(var M=-1,v=a.length;++M<v;){var j=a[M],F=void 0;lr(o,j,F===void 0?e[j]:F)}return o}function Tn(e,a){return je(e,wt(e),a)}function An(e){return yn(e,ze,wt)}function Jt(e,a){var o=e.__data__;return Mn(a)?o[typeof a=="string"?"string":"hash"]:o.map}function gt(e,a){var o=J(e,a);return In(o)?o:void 0}var wt=Oe?Xt(Oe,Object):Rn,Dt=_n;(de&&Dt(new de(new ArrayBuffer(1)))!=R||Kt&&Dt(new Kt)!=I||It&&Dt(It.resolve())!=h||pe&&Dt(new pe)!=g||Pe&&Dt(new Pe)!=m)&&(Dt=function(e){var a=ue.call(e),o=a==l?e.constructor:void 0,u=o?ot(o):void 0;if(u)switch(u){case Re:return R;case Vt:return I;case Ce:return h;case Le:return g;case xe:return m}return a});function kn(e){var a=e.length,o=e.constructor(a);return a&&typeof e[0]=="string"&&Et.call(e,"index")&&(o.index=e.index,o.input=e.input),o}function St(e){return typeof e.constructor=="function"&&!pr(e)?mn(_t(e)):{}}function wn(e,a,o,u){var M=e.constructor;switch(a){case k:return He(e);case _:case A:return new M(+e);case R:return Zt(e,u);case D:case L:case N:case C:case T:case O:case G:case zt:case Gt:return vn(e,u);case I:return fr(e,u,o);case f:case E:return new M(e);case b:return dr(e);case g:return bn(e,u,o);case p:return En(e)}}function Dn(e,a){return a=a??s,!!a&&(typeof e=="number"||ae.test(e))&&e>-1&&e%1==0&&e<a}function Mn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function On(e){return!!nr&&nr in e}function pr(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||ce;return e===o}function ot(e){if(e!=null){try{return ir.call(e)}catch{}try{return e+""}catch{}}return""}function hr(e){return Fe(e,!0,!0)}function mr(e,a){return e===a||e!==e&&a!==a}function _e(e){return Pn(e)&&Et.call(e,"callee")&&(!sr.call(e,"callee")||ue.call(e)==c)}var Ye=Array.isArray;function Ie(e){return e!=null&&_r(e.length)&&!$e(e)}function Pn(e){return Ir(e)&&Ie(e)}var yr=fe||Cn;function $e(e){var a=Tt(e)?ue.call(e):"";return a==S||a==H}function _r(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s}function Tt(e){var a=typeof e;return!!e&&(a=="object"||a=="function")}function Ir(e){return!!e&&typeof e=="object"}function ze(e){return Ie(e)?he(e):gn(e)}function Rn(){return[]}function Cn(){return!1}t.exports=hr}(Ke,Ke.exports);var Yi=Ke.exports;const tt=Dr(Yi),Kn=t=>new Promise((r,n)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const s=i.width,c=i.height;r({width:s,height:c})},i.onerror=s=>{n(s)},i.crossOrigin="anonymous",i.src=t}),$i=t=>new Promise((r,n)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3;r({duration:s})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.crossOrigin="anonymous",i.load()}),Bn=t=>new Promise((r,n)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3,c=i.videoWidth,d=i.videoHeight;r({duration:s,width:c,height:d})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.load()}),Vn=(t,r)=>{const n=document.createElement("div");Object.keys(r).forEach(s=>{s!=="height"&&(n.style[s]=r[s])}),document.body.appendChild(n),n.textContent=t,n.style.whiteSpace="normal",n.style.position="absolute",n.style.visibility="hidden",n.style.display="inline-block",n.style.width=r.width+"px",n.style.fontSize=r.fontSize+"px";const i=getComputedStyle(n).height;return document.body.removeChild(n),parseFloat(i)},Be=t=>{const r=t.map(n=>new FontFace(n.fontFamily,`url(${n.url})`).load().catch(i=>i));return r.length===0?Promise.resolve(!0):new Promise((n,i)=>{Promise.all(r).then(s=>{s.forEach(c=>{c&&c.family&&(document.fonts.add(c),n(!0))})}).catch(s=>i(s))})},zi="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ve=(t=21)=>{let r="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)r+=zi[n[t]&63];return r};function te(t=16){const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.charAt(Math.floor(Math.random()*r.length));let i=Ve(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),n+i}const Ze={color:"#000000",x:0,y:0,blur:0},be=(t,r)=>{let n=r!=null&&r.trim?r.trim.to-r.trim.from:(r==null?void 0:r.duration)||5e3;const i={from:0,to:n};if(!t)return i;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),i;if(t.from!==void 0&&t.to===void 0)return{from:t.from,to:t.from+n};if(t.to!==void 0){if(t.to<0)return console.error("'to' must be a non-negative number. Returning default display."),i;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),i}return t},Zn=(t,r)=>t?t.from&&!t.to?{from:t.from,to:r.duration}:t:{from:0,to:r.duration};function Je(t,r){const n={x:t.size.width/2,y:t.size.height/2},i={x:r.width/2,y:r.height/2},s=Math.min(t.size.width/r.width,t.size.height/r.height),c=n.x-i.x;return{top:`${n.y-i.y}px`,left:`${c}px`,transform:`scale(${s})`}}const Jn=async(t,r)=>{const n=t.details.src,i=await Bn(n),s=Je(r,{...i}),c=Zn(t.trim,{duration:i.duration}),d={width:i.width,height:i.height,opacity:100,src:n,volume:t.details.volume??100,borderRadius:t.details.borderRadius??0,borderWidth:t.details.borderWidth??0,borderColor:t.details.borderColor||"#000000",boxShadow:t.details.boxShadow||Ze,top:t.details.top||s.top||"0px",left:t.details.left||s.left||"0px",transform:t.details.transform||s.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1,rotate:t.details.rotate||"0deg",visibility:t.details.visibility||"visible",mediaWidth:t.details.mediaWidth||i.width||100,mediaHeight:t.details.mediaHeight||i.height||100};return{...t,trim:c,type:"video",name:"video",details:d,playbackRate:t.playbackRate||1,display:be(t.display,{duration:i.duration,trim:c}),duration:i.duration}},qn=async t=>{const r=t.id,n=t.details,s=(await $i(n.src)).duration,c=Zn(t.trim,{duration:s});return{id:r,name:"",type:"audio",display:be(t.display,{duration:s,trim:c}),trim:c,playbackRate:t.playbackRate||1,details:{src:n.src,volume:n.volume??100},metadata:{...t.metadata},duration:s}},Gi=async(t,r)=>{var H,I,f;const n=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},s=Math.min(r.size.width/i.width,r.size.height/i.height),c=((H=t.details)==null?void 0:H.rotate)||0,d={top:((I=t.details)==null?void 0:I.top)||0,left:((f=t.details)==null?void 0:f.left)||0},_=t.display,A=t.trim||t.display;let x=1/0,S=0;return n.forEach(l=>{const h=t.trackItemsMap[l];h.display.from<x&&(x=h.display.from),h.display.to>S&&(S=h.display.to)}),{id:t.id,details:{...i,top:d.top,left:d.left,scale:s,rotate:c},trim:A,display:_||{from:x,to:S},activeEdit:!1}},Qn=async(t,r)=>{const n=t.details,i=await Kn(n.src),s=Je(r,i);return{id:t.id,type:"image",name:"image",display:be(t.display),playbackRate:t.playbackRate||1,details:{src:n.src||"",width:n.width||i.width||100,height:n.height||i.height||100,opacity:n.opacity??100,transform:n.transform||s.transform,border:n.border||"none",borderRadius:n.borderRadius||0,boxShadow:n.boxShadow||Ze,top:n.top||s.top||"0px",left:n.left||s.left||"0px",borderWidth:n.borderWidth??0,borderColor:n.borderColor||"#000000",blur:n.blur||0,brightness:n.brightness||100,flipX:n.flipX||!1,flipY:n.flipY||!1,rotate:n.rotate||"0deg",visibility:n.visibility||"visible",mediaWidth:n.mediaWidth||n.width||i.width||100,mediaHeight:n.mediaHeight||n.height||i.height||100},metadata:t.metadata||{}}},ti=async(t,r)=>{const n=t;n.details.fontUrl&&await Be([{fontFamily:n.details.fontFamily,url:n.details.fontUrl}]);const i=n.id,s=n.details,c=ri(s),d=Vn(n.details.text,c),_=Je(r,{width:c.width,height:d});return{id:i,name:"caption",type:"caption",display:be(n.display),details:{...c,text:s.text||"",height:d,fontUrl:s.fontUrl,top:c.top||_.top,left:c.left||_.left,borderWidth:s.borderWidth||0,borderColor:s.borderColor||"#000000",boxShadow:s.boxShadow||Ze,words:s.words||[]},metadata:{}}},ei=async(t,r)=>{t.details.fontUrl&&await Be([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const n=t.id,i=t.details,s=ri(i),c=Vn(t.details.text,s),d=Je(r,{width:s.width,height:c});return{id:n,name:"text",type:"text",display:be(t.display),details:{...s,text:i.text||"",height:c,fontUrl:i.fontUrl,top:s.top||d.top,left:s.left||d.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||Ze},metadata:{}}},ri=t=>({fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||"16px",fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textDecoration:t.textDecoration||"none",textAlign:t.textAlign||"left",lineHeight:t.lineHeight||"normal",letterSpacing:t.letterSpacing||"normal",wordSpacing:t.wordSpacing||"normal",color:t.color||"#ffffff",backgroundColor:t.backgroundColor||"transparent",border:t.border||"none",textShadow:t.textShadow||"none",text:t.text||"",opacity:t.opacity??100,width:t.width||300,wordWrap:t.wordWrap||"normal",wordBreak:t.wordBreak||"normal",WebkitTextStrokeColor:t.WebkitTextStrokeColor||"#ffffff",WebkitTextStrokeWidth:t.WebkitTextStrokeWidth||"0px",top:t.top,left:t.left,textTransform:t.textTransform||"none",transform:t.transform||"none",skewX:t.skewX||0,skewY:t.skewY||0}),Ui=async(t,r)=>{switch(t.type){case"video":return Jn(t,r||{});case"audio":return qn(t);case"image":return Qn(t,r||{});case"text":return ei(t,r||{});case"caption":return ti(t,r||{});default:throw new Error("Unsupported track item")}};function Xi(t,r){return r.some(n=>t.some(i=>i.id===n.id))}const Wi=(t=[],r=[])=>t.length===0?r.map(i=>({id:te(),items:[i.id],type:i.type,accepts:["text","image","video","audio","caption","template"]})):t.map(n=>({...n,items:n.items||[],accepts:["audio","video","image","text","caption","template"],type:n.type||"text",magnetic:n.magnetic||!1,static:n.static||!1,id:n.id||te()}));function Ki(t,r){return t.filter(i=>{if(r.forEach(s=>{i.items.includes(s)&&(i.items=i.items.filter(c=>c!==s))}),i.items.length!==0||i.static)return i})}const Lt=t=>Object.keys(t).reduce((r,n)=>{const{display:i,playbackRate:s}=t[n];return Math.max(r,i.to/(s||1))},0);function Mr(t,r,n){return Math.min(Math.max(t,r),n)}const Bi=(t,r,n,i,s)=>{if(i===void 0&&s===void 0)return{trackId:void 0,trackIndex:void 0};const c=s!==void 0?r[Mr(s,0,r.length)]:r.find(A=>A.id===i);if(!c)return{trackId:void 0,trackIndex:s!==void 0?Mr(s,0,r.length):void 0};const d=c.items.map(A=>n[A]),_=t.map(A=>n[A]);for(const A of d){const x=A.display.from,S=A.display.to;for(const H of _){const I=H.display.from;if(!(H.display.to<=x||I>=S))return{trackId:void 0,trackIndex:r.indexOf(c)}}}return{trackId:c.id,trackIndex:r.indexOf(c)}};function Vi(t){const r=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.DESIGN_PREFIX))),n=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.ADD_PREFIX))),i=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.LAYER_PREFIX))),s=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.HISTORY_PREFIX))),c=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.ACTIVE_PREFIX))),d=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.EDIT_PREFIX))),_=r.subscribe(async f=>{var l,h;if(f.key===w.DESIGN_LOAD){const b=(l=f.value)==null?void 0:l.payload,g=b.trackItemsMap,E=b.trackItemDetailsMap;console.warn("IMPROVE FONTS LOADING");for(const m in E)if(E[m].type==="text"||E[m].type==="caption"){const k=E[m].details;await Be([{fontFamily:k.fontFamily,url:k.fontUrl}])}const p=Lt(g);t.updateState({...b,duration:p},{kind:"design:load",updateHistory:!1})}if(f.key===w.DESIGN_RESIZE){const b=(h=f.value)==null?void 0:h.payload;t.updateState({size:b},{kind:"design:resize",updateHistory:!1})}}),A=s.subscribe(f=>{if(f.key===w.HISTORY_UNDO)return t.undo();if(f.key===w.HISTORY_REDO)return t.redo()}),x=i.subscribe(f=>{var h,b,g,E;const l=[];if((h=f.value)!=null&&h.payload.trackItemIds&&(l.push((b=f.value)==null?void 0:b.payload.trackItemIds),t.updateState({activeIds:l},{kind:"update",updateHistory:!1})),f.key===w.LAYER_DELETE){const p=(g=f.value)==null?void 0:g.payload.trackItemIds,m=tt(t.getState()),k=p&&p.length?p:m.activeIds,R=m.trackItemIds,D=m.trackItemDetailsMap,L=R.filter(G=>!k.includes(G)),N=Object.fromEntries(Object.entries(D).filter(([G])=>!k.includes(G))),C=Ki(m.tracks,k),T=Object.fromEntries(Object.entries(m.trackItemsMap).filter(([G])=>!k.includes(G))),O=Lt(T);t.updateState({trackItemIds:L,trackItemDetailsMap:N,activeIds:[],trackItemsMap:T,tracks:C,duration:O},{updateHistory:!0,kind:"remove"})}if(f.key===w.LAYER_CLONE){const p=tt(t.getState()),m={},k=((E=f.value)==null?void 0:E.payload.trackItemIds)||p.activeIds;if(k.length===0)return;k.forEach(D=>{const L=p.trackItemsMap[D],N=p.trackItemDetailsMap[D],C=te();p.trackItemsMap[C]={...tt(L),id:C},p.trackItemDetailsMap[C]={...tt(N)},p.trackItemIds.push(C);const T=p.tracks.find(O=>O.items.includes(D));m[T.id]?m[T.id].items.push(C):m[T.id]={...T,id:te(),items:[C],static:!1,magnetic:!1}});const R=Object.values(m);p.tracks=[...R,...p.tracks],t.updateState({trackItemDetailsMap:p.trackItemDetailsMap,tracks:p.tracks,trackItemIds:p.trackItemIds,trackItemsMap:p.trackItemsMap},{updateHistory:!0,kind:"update"})}}),S=n.subscribe(async f=>{var k,R,D,L,N,C,T,O,G,zt,Gt,re,ne,ie,ae,Y,se,oe,ct,Ut,$;const l=tt(t.getState()),h=((R=(k=f.value)==null?void 0:k.options)==null?void 0:R.isSelected)||!1;let b=[],g="text";const E=(L=(D=f.value)==null?void 0:D.options)==null?void 0:L.trackId;let p=(C=(N=f.value)==null?void 0:N.options)==null?void 0:C.trackIndex;if(f.key===Ti){const U=(T=f.value)==null?void 0:T.payload,X=U.trackItems.map(W=>Ui(W,{size:l.size})),P=await Promise.all(X),pt=Wi(U.tracks,U.trackItems),st=[],Z={},ht={};if(P.forEach(W=>{const{details:bt,...Xt}=W;st.push(W.id),Z[W.id]={type:W.type,details:bt},ht[W.id]=Xt}),Xi(l.tracks,pt))l.tracks.forEach(W=>{pt.forEach(bt=>{W.id===bt.id&&W.items.push(...st)})});else{const W=((G=(O=f.value)==null?void 0:O.options)==null?void 0:G.trackIndex)||0,bt=Mr(W,0,l.tracks.length);l.tracks.splice(bt,0,...pt)}l.trackItemDetailsMap={...l.trackItemDetailsMap,...Z},l.trackItemsMap={...l.trackItemsMap,...ht},l.trackItemIds=[...l.trackItemIds,...st],l.duration=Lt(l.trackItemsMap),t.updateState({trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,tracks:l.tracks,duration:l.duration},{updateHistory:!0,kind:"add"});return}if(f.key===w.ADD_CAPTION){g="caption";const U=(zt=f.value)==null?void 0:zt.payload,X=[];for(const st of U){const Z=ti(st,{size:l.size});X.push(Z)}const P=await Promise.all(X),pt=[];for(const st of P){const Z=st.id;pt.push(Z);const{details:ht,...J}=st;l.trackItemDetailsMap[Z]={type:g,details:ht},l.trackItemsMap[Z]=J,l.trackItemIds.push(Z)}b=pt}if(f.key===w.ADD_TEXT){g="text";const U=await ei((Gt=f.value)==null?void 0:Gt.payload,{size:l.size}),{details:X,...P}=U;l.trackItemDetailsMap[P.id]={type:g,details:X},l.trackItemsMap[P.id]=P,l.trackItemIds.push(P.id),b=[P.id]}if(f.key===w.ADD_TEMPLATE){g="template";const U=(re=f.value)==null?void 0:re.payload.trackItemsMap,X=(ne=f.value)==null?void 0:ne.payload.trackItemDetailsMap,P=(ie=f.value)==null?void 0:ie.payload.transitionsMap,pt=((ae=f.value)==null?void 0:ae.payload.transitionIds)||[],st=(Y=f.value)==null?void 0:Y.payload.trackItemIds,Z=((se=f.value)==null?void 0:se.payload.tracks)||[],{details:ht,...J}=await Gi((oe=f.value)==null?void 0:oe.payload,{size:l.size}),W={id:J.id,items:st,transitions:pt,tracks:Z};l.trackItemDetailsMap[J.id]={type:g,details:ht},l.trackItemsMap[J.id]=J,l.trackItemIds.push(J.id),b=[J.id],l.trackItemsMap={...l.trackItemsMap,...U,[J.id]:{type:"template",...J}},l.trackItemDetailsMap={...l.trackItemDetailsMap,...X,[J.id]:{type:"template",details:ht}},l.transitionsMap={...l.transitionsMap,...P},l.structure=[...l.structure,W]}if(f.key===w.ADD_IMAGE){g="image";const U=await Qn((ct=f.value)==null?void 0:ct.payload,{size:l.size}),{details:X,...P}=U;l.trackItemDetailsMap[P.id]={type:g,details:X},l.trackItemsMap[P.id]=P,l.trackItemIds.push(P.id),b=[P.id]}if(f.key===w.ADD_AUDIO){g="audio";const U=await qn((Ut=f.value)==null?void 0:Ut.payload),{details:X,...P}=U;l.trackItemDetailsMap[P.id]={type:g,details:X},l.trackItemsMap[P.id]=P,l.trackItemIds.push(P.id),b=[P.id]}if(f.key===w.ADD_VIDEO){g="video";const U=await Jn(($=f.value)==null?void 0:$.payload,{size:l.size}),{details:X,...P}=U;l.trackItemDetailsMap[P.id]={type:g,details:X},l.trackItemsMap[P.id]=P,l.trackItemIds.push(P.id),b=[P.id]}const m=Bi(b,l.tracks,l.trackItemsMap,E,p);if(m.trackId){const U=l.tracks.find(X=>X.id===m.trackId);U&&U.items.push(...b)}else if(m.trackIndex!==void 0){const U={id:Ve(),accepts:["text","audio","helper","video","image","caption","template"],type:g,items:b,magnetic:!1,static:!1};l.tracks.splice(m.trackIndex,0,U)}else l.tracks.unshift({id:Ve(),accepts:["text","audio","helper","video","image","caption","template"],type:g,items:b,magnetic:!1,static:!1});h&&(l.activeIds=b),l.duration=Lt(l.trackItemsMap),t.updateState({activeIds:l.activeIds,trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,transitionsMap:l.transitionsMap,tracks:l.tracks,duration:l.duration,structure:l.structure},{updateHistory:!0,kind:"add"})}),H=c.subscribe(async f=>{var l;if(f.key===w.ACTIVE_SPLIT){const h=tt(t.getState()),b=(l=f.value)==null?void 0:l.options.time;if(h.activeIds.length===1){const g=h.activeIds[0],E=h.trackItemsMap[g];if(b>=E.display.to||b<=E.display.from)return;const p=h.trackItemDetailsMap[g],m=te(),k={...E,id:m,display:{from:b,to:E.display.to},trim:{from:b,to:E.display.to}};h.trackItemsMap[g].display.to=b,h.trackItemsMap[m]=k,h.trackItemIds.push(m),h.trackItemDetailsMap[m]=p,h.tracks.forEach(R=>{R.items.includes(g)&&R.items.push(m)}),t.updateState({trackItemDetailsMap:h.trackItemDetailsMap,tracks:h.tracks,trackItemIds:h.trackItemIds,trackItemsMap:h.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(f.key===w.ACTIVE_CLONE){const h=tt(t.getState());if(h.activeIds.length){const b=h.activeIds,g=[],E={activeIds:b,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};b.forEach(m=>{E.trackItemDetailsMap[m]=h.trackItemDetailsMap[m],E.trackItemsMap[m]=h.trackItemsMap[m],g.push(h.tracks.find(k=>k.items.includes(m)))});const p=new Set;g.filter(m=>p.has(m.id)?!1:(p.add(m),!0)),E.tracks=Array.from(p.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(E))}}if(f.key===w.ACTIVE_PASTE){const h=localStorage.getItem("DesignComboTemp");if(!h)return;const b=tt(t.getState()),g=JSON.parse(h),E={},p=g.trackItemsMap,m=g.trackItemDetailsMap,k=g.tracks,R=[],D=g.activeIds.map(async L=>{const N=m[L];(N.type==="caption"||N.type==="text")&&N.details.fontUrl&&await Be([{fontFamily:N.details.fontFamily,url:N.details.fontUrl}]);const C=te();return E[L]=C,b.trackItemsMap[C]={...p[L],id:C},b.trackItemDetailsMap[C]=N,b.trackItemIds.push(C),!0});await Promise.all(D),k.forEach(L=>{const N=L.items.map(T=>E[T]),C={...L,items:N,id:Ve()};R.push(C)}),b.tracks=[...b.tracks,...R],t.updateState({trackItemDetailsMap:b.trackItemDetailsMap,tracks:b.tracks,trackItemIds:b.trackItemIds,trackItemsMap:b.trackItemsMap},{updateHistory:!0,kind:"update"})}}),I=d.subscribe(async f=>{var l,h,b;if(f.key===w.EDIT_OBJECT){const g=tt(t.getState()),E=g.trackItemDetailsMap,p=g.trackItemsMap,m=Object.keys((l=f.value)==null?void 0:l.payload);if(!m.length)return;const k=(h=f.value)==null?void 0:h.payload;m.forEach(D=>{const L=k[D];L.details?E[D].details={...E[D].details,...L.details}:k[D].playbackRate&&(p[D].playbackRate=k[D].playbackRate)});const R=Lt(p);t.updateState({trackItemDetailsMap:{...E},trackItemsMap:{...p},duration:R},{updateHistory:!0,kind:"update:details"})}if(f.key===w.REPLACE_MEDIA){const g=(b=f.value)==null?void 0:b.payload,E=Object.keys(g)[0],p=Object.values(g)[0],m=tt(t.getState()),k=m.trackItemDetailsMap[E];if(p.details){if(p.type==="image"&&p.details.src){const L=await Kn(p.details.src),N=k.details.width||0,C=k.details.height||0;let T=L.width,O=L.height;const G=L.width/L.height;N/C>G?(T=N,O=N/G):(O=C,T=C*G),p.details.mediaWidth=T,p.details.mediaHeight=O}if(p.type==="video"&&p.details.src){const L=await Bn(p.details.src),N=k.details.width||0,C=k.details.height||0;let T=L.width,O=L.height;const G=L.width/L.height;N/C>G?(T=N,O=N/G):(O=C,T=C*G),p.details.mediaWidth=T,p.details.mediaHeight=O}const D=k.details;k.details={...D,...p.details},p.details=k.details}const R={...k,...p};m.trackItemDetailsMap[E]=R,m.trackItemsMap[E]={...m.trackItemsMap[E],type:p.type},t.updateState({trackItemDetailsMap:{...m.trackItemDetailsMap},trackItemsMap:{...m.trackItemsMap}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{S.unsubscribe(),H.unsubscribe(),I.unsubscribe(),A.unsubscribe(),x.unsubscribe(),_.unsubscribe()}}}const Zi={Date:!0,RegExp:!0,String:!0,Number:!0};function ni(t,r,n={cyclesFix:!0},i=[]){var _,A;let s=[];const c=Array.isArray(t);for(const x in t){const S=t[x],H=c?+x:x;if(!(x in r)){s.push({type:"REMOVE",path:[H],oldValue:t[x]});continue}const I=r[x],f=typeof S=="object"&&typeof I=="object"&&Array.isArray(S)===Array.isArray(I);if(S&&I&&f&&!Zi[(A=(_=Object.getPrototypeOf(S))==null?void 0:_.constructor)==null?void 0:A.name]&&(!n.cyclesFix||!i.includes(S))){const l=ni(S,I,n,n.cyclesFix?i.concat([S]):[]);s.push.apply(s,l.map(h=>(h.path.unshift(H),h)))}else S!==I&&!(Number.isNaN(S)&&Number.isNaN(I))&&!(f&&(isNaN(S)?S+""==I+"":+S==+I))&&s.push({path:[H],type:"CHANGE",value:I,oldValue:S})}const d=Array.isArray(r);for(const x in r)x in t||s.push({type:"CREATE",path:[d?+x:x],value:r[x]});return s}var Or=Symbol.for("immer-nothing"),Ee=Symbol.for("immer-draftable"),ft=Symbol.for("immer-state"),ii=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function B(t,...r){if(process.env.NODE_ENV!=="production"){const n=ii[t],i=typeof n=="function"?n.apply(null,r):n;throw new Error(`[Immer] ${i}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var xt=Object.getPrototypeOf;function Nt(t){return!!t&&!!t[ft]}function Pt(t){var r;return t?ai(t)||Array.isArray(t)||!!t[Ee]||!!((r=t.constructor)!=null&&r[Ee])||Te(t)||Ae(t):!1}var Ji=Object.prototype.constructor.toString();function ai(t){if(!t||typeof t!="object")return!1;const r=xt(t);if(r===null)return!0;const n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Ji}function ve(t,r){Ft(t)===0?Reflect.ownKeys(t).forEach(n=>{r(n,t[n],t)}):t.forEach((n,i)=>r(i,n,t))}function Ft(t){const r=t[ft];return r?r.type_:Array.isArray(t)?1:Te(t)?2:Ae(t)?3:0}function Se(t,r){return Ft(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function Pr(t,r){return Ft(t)===2?t.get(r):t[r]}function si(t,r,n){const i=Ft(t);i===2?t.set(r,n):i===3?t.add(n):t[r]=n}function qi(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}function Te(t){return t instanceof Map}function Ae(t){return t instanceof Set}function Ht(t){return t.copy_||t.base_}function Rr(t,r){if(Te(t))return new Map(t);if(Ae(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=ai(t);if(r===!0||r==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[ft];let s=Reflect.ownKeys(i);for(let c=0;c<s.length;c++){const d=s[c],_=i[d];_.writable===!1&&(_.writable=!0,_.configurable=!0),(_.get||_.set)&&(i[d]={configurable:!0,writable:!0,enumerable:_.enumerable,value:t[d]})}return Object.create(xt(t),i)}else{const i=xt(t);if(i!==null&&n)return{...t};const s=Object.create(i);return Object.assign(s,t)}}function Cr(t,r=!1){return qe(t)||Nt(t)||!Pt(t)||(Ft(t)>1&&(t.set=t.add=t.clear=t.delete=Qi),Object.freeze(t),r&&Object.entries(t).forEach(([n,i])=>Cr(i,!0))),t}function Qi(){B(2)}function qe(t){return Object.isFrozen(t)}var Lr={};function jt(t){const r=Lr[t];return r||B(0,t),r}function ta(t,r){Lr[t]||(Lr[t]=r)}var ke;function oi(){return ke}function ea(t,r){return{drafts_:[],parent_:t,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ci(t,r){r&&(jt("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=r)}function xr(t){Nr(t),t.drafts_.forEach(ra),t.drafts_=null}function Nr(t){t===ke&&(ke=t.parent_)}function ui(t){return ke=ea(ke,t)}function ra(t){const r=t[ft];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function li(t,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];return t!==void 0&&t!==n?(n[ft].modified_&&(xr(r),B(4)),Pt(t)&&(t=Qe(r,t),r.parent_||tr(r,t)),r.patches_&&jt("Patches").generateReplacementPatches_(n[ft].base_,t,r.patches_,r.inversePatches_)):t=Qe(r,n,[]),xr(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t!==Or?t:void 0}function Qe(t,r,n){if(qe(r))return r;const i=r[ft];if(!i)return ve(r,(s,c)=>fi(t,i,r,s,c,n)),r;if(i.scope_!==t)return r;if(!i.modified_)return tr(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let c=s,d=!1;i.type_===3&&(c=new Set(s),s.clear(),d=!0),ve(c,(_,A)=>fi(t,i,s,_,A,n,d)),tr(t,s,!1),n&&t.patches_&&jt("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function fi(t,r,n,i,s,c,d){if(process.env.NODE_ENV!=="production"&&s===n&&B(5),Nt(s)){const _=c&&r&&r.type_!==3&&!Se(r.assigned_,i)?c.concat(i):void 0,A=Qe(t,s,_);if(si(n,i,A),Nt(A))t.canAutoFreeze_=!1;else return}else d&&n.add(s);if(Pt(s)&&!qe(s)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;Qe(t,s),(!r||!r.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&tr(t,s)}}function tr(t,r,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Cr(r,n)}function na(t,r){const n=Array.isArray(t),i={type_:n?1:0,scope_:r?r.scope_:oi(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=i,c=Fr;n&&(s=[i],c=we);const{revoke:d,proxy:_}=Proxy.revocable(s,c);return i.draft_=_,i.revoke_=d,_}var Fr={get(t,r){if(r===ft)return t;const n=Ht(t);if(!Se(n,r))return ia(t,n,r);const i=n[r];return t.finalized_||!Pt(i)?i:i===Hr(t.base_,r)?(Yr(t),t.copy_[r]=$r(i,t)):i},has(t,r){return r in Ht(t)},ownKeys(t){return Reflect.ownKeys(Ht(t))},set(t,r,n){const i=di(Ht(t),r);if(i!=null&&i.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const s=Hr(Ht(t),r),c=s==null?void 0:s[ft];if(c&&c.base_===n)return t.copy_[r]=n,t.assigned_[r]=!1,!0;if(qi(n,s)&&(n!==void 0||Se(t.base_,r)))return!0;Yr(t),jr(t)}return t.copy_[r]===n&&(n!==void 0||r in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[r])||(t.copy_[r]=n,t.assigned_[r]=!0),!0},deleteProperty(t,r){return Hr(t.base_,r)!==void 0||r in t.base_?(t.assigned_[r]=!1,Yr(t),jr(t)):delete t.assigned_[r],t.copy_&&delete t.copy_[r],!0},getOwnPropertyDescriptor(t,r){const n=Ht(t),i=Reflect.getOwnPropertyDescriptor(n,r);return i&&{writable:!0,configurable:t.type_!==1||r!=="length",enumerable:i.enumerable,value:n[r]}},defineProperty(){B(11)},getPrototypeOf(t){return xt(t.base_)},setPrototypeOf(){B(12)}},we={};ve(Fr,(t,r)=>{we[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),we.deleteProperty=function(t,r){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(r))&&B(13),we.set.call(this,t,r,void 0)},we.set=function(t,r,n){return process.env.NODE_ENV!=="production"&&r!=="length"&&isNaN(parseInt(r))&&B(14),Fr.set.call(this,t[0],r,n,t[0])};function Hr(t,r){const n=t[ft];return(n?Ht(n):t)[r]}function ia(t,r,n){var s;const i=di(r,n);return i?"value"in i?i.value:(s=i.get)==null?void 0:s.call(t.draft_):void 0}function di(t,r){if(!(r in t))return;let n=xt(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,r);if(i)return i;n=xt(n)}}function jr(t){t.modified_||(t.modified_=!0,t.parent_&&jr(t.parent_))}function Yr(t){t.copy_||(t.copy_=Rr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var aa=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,n,i)=>{if(typeof r=="function"&&typeof n!="function"){const c=n;n=r;const d=this;return function(A=c,...x){return d.produce(A,S=>n.call(this,S,...x))}}typeof n!="function"&&B(6),i!==void 0&&typeof i!="function"&&B(7);let s;if(Pt(r)){const c=ui(this),d=$r(r,void 0);let _=!0;try{s=n(d),_=!1}finally{_?xr(c):Nr(c)}return ci(c,i),li(s,c)}else if(!r||typeof r!="object"){if(s=n(r),s===void 0&&(s=r),s===Or&&(s=void 0),this.autoFreeze_&&Cr(s,!0),i){const c=[],d=[];jt("Patches").generateReplacementPatches_(r,s,c,d),i(c,d)}return s}else B(1,r)},this.produceWithPatches=(r,n)=>{if(typeof r=="function")return(d,..._)=>this.produceWithPatches(d,A=>r(A,..._));let i,s;return[this.produce(r,n,(d,_)=>{i=d,s=_}),i,s]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Pt(t)||B(8),Nt(t)&&(t=sa(t));const r=ui(this),n=$r(t,void 0);return n[ft].isManual_=!0,Nr(r),n}finishDraft(t,r){const n=t&&t[ft];(!n||!n.isManual_)&&B(9);const{scope_:i}=n;return ci(i,r),li(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const s=r[n];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}n>-1&&(r=r.slice(n+1));const i=jt("Patches").applyPatches_;return Nt(t)?i(t,r):this.produce(t,s=>i(s,r))}};function $r(t,r){const n=Te(t)?jt("MapSet").proxyMap_(t,r):Ae(t)?jt("MapSet").proxySet_(t,r):na(t,r);return(r?r.scope_:oi()).drafts_.push(n),n}function sa(t){return Nt(t)||B(10,t),pi(t)}function pi(t){if(!Pt(t)||qe(t))return t;const r=t[ft];let n;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=Rr(t,r.scope_.immer_.useStrictShallowCopy_)}else n=Rr(t,!0);return ve(n,(i,s)=>{si(n,i,pi(s))}),r&&(r.finalized_=!1),n}function hi(){process.env.NODE_ENV!=="production"&&ii.push('Sets cannot have "replace" patches.',function(I){return"Unsupported patch operation: "+I},function(I){return"Cannot apply patch, path doesn't resolve: "+I},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const r="replace",n="add",i="remove";function s(I,f,l,h){switch(I.type_){case 0:case 2:return d(I,f,l,h);case 1:return c(I,f,l,h);case 3:return _(I,f,l,h)}}function c(I,f,l,h){let{base_:b,assigned_:g}=I,E=I.copy_;E.length<b.length&&([b,E]=[E,b],[l,h]=[h,l]);for(let p=0;p<b.length;p++)if(g[p]&&E[p]!==b[p]){const m=f.concat([p]);l.push({op:r,path:m,value:H(E[p])}),h.push({op:r,path:m,value:H(b[p])})}for(let p=b.length;p<E.length;p++){const m=f.concat([p]);l.push({op:n,path:m,value:H(E[p])})}for(let p=E.length-1;b.length<=p;--p){const m=f.concat([p]);h.push({op:i,path:m})}}function d(I,f,l,h){const{base_:b,copy_:g}=I;ve(I.assigned_,(E,p)=>{const m=Pr(b,E),k=Pr(g,E),R=p?Se(b,E)?r:n:i;if(m===k&&R===r)return;const D=f.concat(E);l.push(R===i?{op:R,path:D}:{op:R,path:D,value:k}),h.push(R===n?{op:i,path:D}:R===i?{op:n,path:D,value:H(m)}:{op:r,path:D,value:H(m)})})}function _(I,f,l,h){let{base_:b,copy_:g}=I,E=0;b.forEach(p=>{if(!g.has(p)){const m=f.concat([E]);l.push({op:i,path:m,value:p}),h.unshift({op:n,path:m,value:p})}E++}),E=0,g.forEach(p=>{if(!b.has(p)){const m=f.concat([E]);l.push({op:n,path:m,value:p}),h.unshift({op:i,path:m,value:p})}E++})}function A(I,f,l,h){l.push({op:r,path:[],value:f===Or?void 0:f}),h.push({op:r,path:[],value:I})}function x(I,f){return f.forEach(l=>{const{path:h,op:b}=l;let g=I;for(let k=0;k<h.length-1;k++){const R=Ft(g);let D=h[k];typeof D!="string"&&typeof D!="number"&&(D=""+D),(R===0||R===1)&&(D==="__proto__"||D==="constructor")&&B(19),typeof g=="function"&&D==="prototype"&&B(19),g=Pr(g,D),typeof g!="object"&&B(18,h.join("/"))}const E=Ft(g),p=S(l.value),m=h[h.length-1];switch(b){case r:switch(E){case 2:return g.set(m,p);case 3:B(16);default:return g[m]=p}case n:switch(E){case 1:return m==="-"?g.push(p):g.splice(m,0,p);case 2:return g.set(m,p);case 3:return g.add(p);default:return g[m]=p}case i:switch(E){case 1:return g.splice(m,1);case 2:return g.delete(m);case 3:return g.delete(l.value);default:return delete g[m]}default:B(17,b)}}),I}function S(I){if(!Pt(I))return I;if(Array.isArray(I))return I.map(S);if(Te(I))return new Map(Array.from(I.entries()).map(([l,h])=>[l,S(h)]));if(Ae(I))return new Set(Array.from(I).map(S));const f=Object.create(xt(I));for(const l in I)f[l]=S(I[l]);return Se(I,Ee)&&(f[Ee]=I[Ee]),f}function H(I){return Nt(I)?S(I):I}ta("Patches",{applyPatches_:x,generatePatches_:s,generateReplacementPatches_:A})}var dt=new aa,oa=dt.produce;dt.produceWithPatches.bind(dt),dt.setAutoFreeze.bind(dt),dt.setUseStrictShallowCopy.bind(dt);var ca=dt.applyPatches.bind(dt);dt.createDraft.bind(dt),dt.finishDraft.bind(dt);var ua=1/0,la=9007199254740991,fa="[object Arguments]",da="[object Function]",pa="[object GeneratorFunction]",ha="[object Symbol]",ma=typeof mt=="object"&&mt&&mt.Object===Object&&mt,ya=typeof self=="object"&&self&&self.Object===Object&&self,_a=ma||ya||Function("return this")();function Ia(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function ga(t,r){for(var n=-1,i=t?t.length:0,s=Array(i);++n<i;)s[n]=r(t[n],n,t);return s}function ba(t,r){for(var n=-1,i=r.length,s=t.length;++n<i;)t[s+n]=r[n];return t}var zr=Object.prototype,Ea=zr.hasOwnProperty,Gr=zr.toString,mi=_a.Symbol,va=zr.propertyIsEnumerable,yi=mi?mi.isConcatSpreadable:void 0,_i=Math.max;function Sa(t,r,n,i,s){var c=-1,d=t.length;for(n||(n=wa),s||(s=[]);++c<d;){var _=t[c];n(_)?ba(s,_):s[s.length]=_}return s}function Ta(t,r){return t=Object(t),Aa(t,r,function(n,i){return i in t})}function Aa(t,r,n){for(var i=-1,s=r.length,c={};++i<s;){var d=r[i],_=t[d];n(_,d)&&(c[d]=_)}return c}function ka(t,r){return r=_i(r===void 0?t.length-1:r,0),function(){for(var n=arguments,i=-1,s=_i(n.length-r,0),c=Array(s);++i<s;)c[i]=n[r+i];i=-1;for(var d=Array(r+1);++i<r;)d[i]=n[i];return d[r]=c,Ia(t,this,d)}}function wa(t){return Oa(t)||Ma(t)||!!(yi&&t&&t[yi])}function Da(t){if(typeof t=="string"||Na(t))return t;var r=t+"";return r=="0"&&1/t==-ua?"-0":r}function Ma(t){return Ra(t)&&Ea.call(t,"callee")&&(!va.call(t,"callee")||Gr.call(t)==fa)}var Oa=Array.isArray;function Pa(t){return t!=null&&La(t.length)&&!Ca(t)}function Ra(t){return Ii(t)&&Pa(t)}function Ca(t){var r=xa(t)?Gr.call(t):"";return r==da||r==pa}function La(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=la}function xa(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function Ii(t){return!!t&&typeof t=="object"}function Na(t){return typeof t=="symbol"||Ii(t)&&Gr.call(t)==ha}var Fa=ka(function(t,r){return t==null?{}:Ta(t,ga(Sa(r),Da))}),Ha=Fa;const gi=Dr(Ha),ja={size:{width:1080,height:1920},tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1,index:1},duration:0,activeIds:[],trackItemDetailsMap:{},structure:[]},bi=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds"];class Ya{constructor(r){Qt(this,"stateSubject");Qt(this,"stateHistorySubject");Qt(this,"prevState");Qt(this,"undos",[]);Qt(this,"redos",[]);Qt(this,"listener");const n=r||ja;this.stateSubject=new Wn(n),this.stateHistorySubject=new Wn({handleRedo:!1,handleUndo:!1}),this.prevState=n,this.initListeners()}initListeners(){Vi(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(r,n){const i=gi(r,bi),s=gi(this.getState(),bi),c=ni(s,i);c.length&&(this.undos.push({undos:c,type:n}),this.redos=[])}getStateHistory(){return this.stateHistorySubject.getValue()}subscribeHistory(r){return this.stateHistorySubject.subscribe(r)}getState(){return this.stateSubject.getValue()}subscribe(r){return this.stateSubject.subscribe(r)}updateState(r,n={updateHistory:!1}){const i=this.getState(),s={...i,...r};it(i,s)||(n.updateHistory&&this.updateHistory(s,n.kind),this.prevState=i,this.stateSubject.next(s))}subscribeToSize(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.size,this.prevState.size)||r({size:n.size})})}subscribeToScale(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.scale,this.prevState.scale)||r({scale:n.scale})})}subscribeToUpdateTrackItem(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemsMap,this.prevState.trackItemsMap)||r({trackItemsMap:n.trackItemsMap})})}subscribeToUpdateItemDetails(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||r({trackItemDetailsMap:n.trackItemDetailsMap})})}subscribeToDuration(r){return this.stateSubject.asObservable().subscribe(n=>{n.duration!==this.prevState.duration&&r({duration:n.duration})})}subscribeToHistory(r){return this.stateHistorySubject.asObservable().subscribe(n=>{if(n.handleRedo){const i=this.undos[this.undos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(n.handleUndo){const i=this.redos[this.redos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.tracks,this.prevState.tracks))&&r({trackItemIds:n.trackItemIds})})}subscribeToActiveIds(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.activeIds,this.prevState.activeIds)||r({activeIds:n.activeIds})})}subscribeToTracks(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.tracks,this.prevState.tracks)||!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.trackItemsMap,this.prevState.trackItemsMap)||!it(n.transitionIds,this.prevState.transitionIds)||!it(n.transitionsMap,this.prevState.transitionsMap)||!it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||!it(n.structure,this.prevState.structure))&&r({tracks:n.tracks,trackItemIds:n.trackItemIds,trackItemsMap:n.trackItemsMap,transitionIds:n.transitionIds,transitionsMap:n.transitionsMap,trackItemDetailsMap:n.trackItemDetailsMap,structure:n.structure})})}undo(){const r=this.undos.pop(),n=r==null?void 0:r.undos,i=r==null?void 0:r.type;if(!n||!i)return;hi();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:_,transitionsMap:A,trackItemsMap:x}=this.getState(),S=tt({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:_,transitionsMap:A,trackItemsMap:x}),H=[],I=[],f=[],l=[],h=[],b=[];n.forEach(T=>{let O;const G=T.path.slice(1);T.type==="CREATE"?O={path:G,op:"remove",value:T.value}:T.type==="CHANGE"?O={path:G,op:"replace",value:T.oldValue}:O={path:G,op:"add",value:T.oldValue},T.path.includes("trackItemIds")?f.push(O):T.path.includes("transitionIds")?I.push(O):T.path.includes("trackItemsMap")?h.push(O):T.path.includes("transitionsMap")?l.push(O):T.path.includes("tracks")?H.push(O):T.path.includes("trackItemDetailsMap")&&b.push(O)});const g=this.applyPatch(S.tracks,H),E=this.applyPatch(S.transitionIds,I),p=this.applyPatch(S.trackItemIds,f),m=this.applyPatch(S.transitionsMap,l),k=this.applyPatch(S.trackItemsMap,h),R=this.applyPatch(S.trackItemDetailsMap,b),D=tt({tracks:g,transitionIds:E,trackItemIds:p,transitionsMap:m,trackItemsMap:k,trackItemDetailsMap:R}),L=tt(this.getState()),N={...L,...D};this.prevState=L,this.redos.push({redos:n,type:i});const C=Lt(N.trackItemsMap);this.stateSubject.next({...N,duration:C}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0})}applyPatch(r,n){return n.reverse().reduce((i,s)=>oa(i,c=>{ca(c,[s])}),r)}redo(){const r=this.redos.pop(),n=r==null?void 0:r.redos,i=r==null?void 0:r.type;if(!n||!i)return;hi();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:_,transitionsMap:A,trackItemsMap:x}=this.getState(),S=tt({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:_,transitionsMap:A,trackItemsMap:x}),H=[],I=[],f=[],l=[],h=[],b=[];n.forEach(T=>{let O;const G=T.path.slice(1);T.type==="CREATE"?O={path:G,op:"add",value:T.value}:T.type==="CHANGE"?O={path:G,op:"replace",value:T.value}:O={path:G,op:"remove",value:T.oldValue},T.path.includes("trackItemIds")?f.push(O):T.path.includes("transitionIds")?I.push(O):T.path.includes("trackItemsMap")?h.push(O):T.path.includes("transitionsMap")?l.push(O):T.path.includes("trackItemDetailsMap")?b.push(O):H.push(O)});const g=this.applyPatch(S.tracks,H),E=this.applyPatch(S.transitionIds,I),p=this.applyPatch(S.trackItemIds,f),m=this.applyPatch(S.transitionsMap,l),k=this.applyPatch(S.trackItemsMap,h),R=this.applyPatch(S.trackItemDetailsMap,b),D=tt({tracks:g,transitionIds:E,trackItemIds:p,transitionsMap:m,trackItemsMap:k,trackItemDetailsMap:R}),L=tt(this.getState()),N={...L,...D};this.prevState=L,this.undos.push({undos:n,type:i});const C=Lt(N.trackItemsMap);this.stateSubject.next({...N,duration:C}),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1})}}const $a="add",Ei="track",vi="trackItems",za=`${Ei}:changed`,Ga=`${vi}:changed`,Si="state",Ua=`${Si}:changed`,Ur="design",Xa=`${Ur}:load`,Wa=`${Ur}:resize`,yt="add",Ka=`${yt}:text`,Ba=`${yt}:video`,Va=`${yt}:audio`,Za=`${yt}:placeholder`,Ja=`${yt}:image`,qa=`${yt}:mask`,Ti=`${yt}:items`,Qa=`${yt}:transition`,ts=`${yt}:animation`,es=`${yt}:caption`,rs=`${yt}:template`,Yt="edit",ns=`${Yt}:object`,is=`${Yt}:text`,as=`${Yt}:shape`,ss=`${Yt}:templateItem`,os=`${Yt}:closeTemplate`,cs=`${Yt}:deleteTemplateItem`,us="enterEditMode",$t="player",ls=`${$t}:play`,fs=`${$t}:pause`,ds=`${$t}:seek`,ps=`${$t}:seekTo`,hs=`${$t}:seekBy`,ms=`${$t}:togglePlay`,ee="active",ys=`${ee}:set`,_s=`${ee}:delete`,Is=`${ee}:paste`,gs=`${ee}:clone`,bs=`${ee}:split`,at="layer",Es=`${at}:locked`,vs=`${at}:hidden`,Ss=`${at}:move`,Ts=`${at}:select`,As=`${at}:selection`,ks=`${at}:sendTo`,ws=`${at}:rename`,Ds=`${at}:editingName`,Ms=`${at}:copy`,Os=`${at}:paste`,Ps=`${at}:clone`,Rs=`${at}:split`,Cs=`${at}:cut`,Ls=`${at}:delete`,er="history",xs=`${er}:undo`,Ns=`${er}:redo`,Fs=`${er}:reset`,Ai="scale",Hs=`${Ai}:changed`,Xr="drag",js=`${Xr}:start`,Ys=`${Xr}:end`,ki="timeline",$s=`${ki}:boundingChanged`;y.ACTIVE_CLONE=gs,y.ACTIVE_DELETE=_s,y.ACTIVE_PASTE=Is,y.ACTIVE_PREFIX=ee,y.ACTIVE_SET=ys,y.ACTIVE_SPLIT=bs,y.ADD_ANIMATION=ts,y.ADD_AUDIO=Va,y.ADD_CAPTION=es,y.ADD_IMAGE=Ja,y.ADD_ITEMS=Ti,y.ADD_MASK=qa,y.ADD_PLACEHOLDER=Za,y.ADD_PREFIX=yt,y.ADD_SUFFIX=$a,y.ADD_TEMPLATE=rs,y.ADD_TEXT=Ka,y.ADD_TRANSITION=Qa,y.ADD_VIDEO=Ba,y.CLOSE_EDIT_TEMPLATE=os,y.DELETE_TEMPLATE_ITEM=cs,y.DESIGN_LOAD=Xa,y.DESIGN_PREFIX=Ur,y.DESIGN_RESIZE=Wa,y.DRAG_END=Ys,y.DRAG_PREFIX=Xr,y.DRAG_START=js,y.EDIT_OBJECT=ns,y.EDIT_PREFIX=Yt,y.EDIT_SHAPE=as,y.EDIT_TEMPLATE_ITEM=ss,y.EDIT_TEXT=is,y.ENTER_EDIT_MODE=us,y.HISTORY_PREFIX=er,y.HISTORY_REDO=Ns,y.HISTORY_RESET=Fs,y.HISTORY_UNDO=xs,y.LAYER_CLONE=Ps,y.LAYER_COPY=Ms,y.LAYER_CUT=Cs,y.LAYER_DELETE=Ls,y.LAYER_EDITING_NAME=Ds,y.LAYER_HIDDEN=vs,y.LAYER_LOCKED=Es,y.LAYER_MOVE=Ss,y.LAYER_PASTE=Os,y.LAYER_PREFIX=at,y.LAYER_RENAME=ws,y.LAYER_SELECT=Ts,y.LAYER_SELECTION=As,y.LAYER_SEND_TO=ks,y.LAYER_SPLIT=Rs,y.PLAYER_PAUSE=fs,y.PLAYER_PLAY=ls,y.PLAYER_PREFIX=$t,y.PLAYER_SEEK=ds,y.PLAYER_SEEK_BY=hs,y.PLAYER_SEEK_TO=ps,y.PLAYER_TOGGLE_PLAY=ms,y.STATE_CHANGED=Ua,y.STATE_PREFIX=Si,y.TIMELINE_BOUNDING_CHANGED=$s,y.TIMELINE_PREFIX=ki,y.TIMELINE_SCALE_CHANGED=Hs,y.TIMELINE_SCALE_PREFIX=Ai,y.TRACKS_CHANGED=za,y.TRACK_ITEMS_CHANGED=Ga,y.TRACK_ITEMS_PREFIX=vi,y.TRACK_PREFIX=Ei,y.default=Ya,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function wr(t,r){if(t){var n=t.indexOf(r);0<=n&&t.splice(n,1)}}var We=function(){function t(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var r,n,i,s,c;if(!this.closed){this.closed=!0;var d=this._parentage;if(d)if(this._parentage=null,Array.isArray(d))try{for(var m=Sr(d),T=m.next();!T.done;T=m.next()){var D=T.value;D.remove(this)}}catch(h){r={error:h}}finally{try{T&&!T.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}else d.remove(this);var v=this.initialTeardown;if(kt(v))try{v()}catch(h){c=h instanceof kr?h.errors:[h]}var N=this._finalizers;if(N){this._finalizers=null;try{for(var I=Sr(N),f=I.next();!f.done;f=I.next()){var l=f.value;try{Fn(l)}catch(h){c=c??[],h instanceof kr?c=Ar(Ar([],Tr(c)),Tr(h.errors)):c.push(h)}}}catch(h){i={error:h}}finally{try{f&&!f.done&&(s=I.return)&&s.call(I)}finally{if(i)throw i.error}}}if(c)throw new kr(c)}},t.prototype.add=function(r){var n;if(r&&r!==this)if(this.closed)Fn(r);else{if(r instanceof t){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(r)}},t.prototype._hasParent=function(r){var n=this._parentage;return n===r||Array.isArray(n)&&n.includes(r)},t.prototype._addParent=function(r){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(r),n):n?[n,r]:r},t.prototype._removeParent=function(r){var n=this._parentage;n===r?this._parentage=null:Array.isArray(n)&&wr(n,r)},t.prototype.remove=function(r){var n=this._finalizers;n&&wr(n,r),r instanceof t&&r._removeParent(this)},t.EMPTY=function(){var r=new t;return r.closed=!0,r}(),t}(),xn=We.EMPTY;function Nn(t){return t instanceof We||t&&"closed"in t&&kt(t.remove)&&kt(t.add)&&kt(t.unsubscribe)}function Fn(t){kt(t)?t():t.unsubscribe()}var Hn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},jn={setTimeout:function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,Ar([t,r],Tr(n)))},clearTimeout:function(t){var r=jn.delegate;return((r==null?void 0:r.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Di(t){jn.setTimeout(function(){throw t})}function $n(){}function Ke(t){t()}var Yn=function(t){Ee(r,t);function r(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Nn(n)&&n.add(i)):i.destination=Ri,i}return r.create=function(n,i,s){return new Mr(n,i,s)},r.prototype.next=function(n){this.isStopped||this._next(n)},r.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(n){this.destination.next(n)},r.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(We),Mi=Function.prototype.bind;function Dr(t,r){return Mi.call(t,r)}var Oi=function(){function t(r){this.partialObserver=r}return t.prototype.next=function(r){var n=this.partialObserver;if(n.next)try{n.next(r)}catch(i){Be(i)}},t.prototype.error=function(r){var n=this.partialObserver;if(n.error)try{n.error(r)}catch(i){Be(i)}else Be(r)},t.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(n){Be(n)}},t}(),Mr=function(t){Ee(r,t);function r(n,i,s){var c=t.call(this)||this,d;if(kt(n)||!n)d={next:n??void 0,error:i??void 0,complete:s??void 0};else{var m;c&&Hn.useDeprecatedNextContext?(m=Object.create(n),m.unsubscribe=function(){return c.unsubscribe()},d={next:n.next&&Dr(n.next,m),error:n.error&&Dr(n.error,m),complete:n.complete&&Dr(n.complete,m)}):d=n}return c.destination=new Oi(d),c}return r}(Yn);function Be(t){Di(t)}function Pi(t){throw t}var Ri={closed:!0,next:$n,error:Pi,complete:$n},Ci=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Li(t){return t}function xi(t){return t.length===0?Li:t.length===1?t[0]:function(n){return t.reduce(function(i,s){return s(i)},n)}}var zn=function(){function t(r){r&&(this._subscribe=r)}return t.prototype.lift=function(r){var n=new t;return n.source=this,n.operator=r,n},t.prototype.subscribe=function(r,n,i){var s=this,c=Fi(r)?r:new Mr(r,n,i);return Ke(function(){var d=s,m=d.operator,T=d.source;c.add(m?m.call(c,T):T?s._subscribe(c):s._trySubscribe(c))}),c},t.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(n){r.error(n)}},t.prototype.forEach=function(r,n){var i=this;return n=Gn(n),new n(function(s,c){var d=new Mr({next:function(m){try{r(m)}catch(T){c(T),d.unsubscribe()}},error:c,complete:s});i.subscribe(d)})},t.prototype._subscribe=function(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)},t.prototype[Ci]=function(){return this},t.prototype.pipe=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return xi(r)(this)},t.prototype.toPromise=function(r){var n=this;return r=Gn(r),new r(function(i,s){var c;n.subscribe(function(d){return c=d},function(d){return s(d)},function(){return i(c)})})},t.create=function(r){return new t(r)},t}();function Gn(t){var r;return(r=t??Hn.Promise)!==null&&r!==void 0?r:Promise}function Ni(t){return t&&kt(t.next)&&kt(t.error)&&kt(t.complete)}function Fi(t){return t&&t instanceof Yn||Ni(t)&&Nn(t)}var Hi=Ln(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Un=function(t){Ee(r,t);function r(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return r.prototype.lift=function(n){var i=new Xn(this,this);return i.operator=n,i},r.prototype._throwIfClosed=function(){if(this.closed)throw new Hi},r.prototype.next=function(n){var i=this;Ke(function(){var s,c;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var d=Sr(i.currentObservers),m=d.next();!m.done;m=d.next()){var T=m.value;T.next(n)}}catch(D){s={error:D}}finally{try{m&&!m.done&&(c=d.return)&&c.call(d)}finally{if(s)throw s.error}}}})},r.prototype.error=function(n){var i=this;Ke(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var s=i.observers;s.length;)s.shift().error(n)}})},r.prototype.complete=function(){var n=this;Ke(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var i=n.observers;i.length;)i.shift().complete()}})},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},r.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},r.prototype._innerSubscribe=function(n){var i=this,s=this,c=s.hasError,d=s.isStopped,m=s.observers;return c||d?xn:(this.currentObservers=null,m.push(n),new We(function(){i.currentObservers=null,wr(m,n)}))},r.prototype._checkFinalizedStatuses=function(n){var i=this,s=i.hasError,c=i.thrownError,d=i.isStopped;s?n.error(c):d&&n.complete()},r.prototype.asObservable=function(){var n=new zn;return n.source=this,n},r.create=function(n,i){return new Xn(n,i)},r}(zn),Xn=function(t){Ee(r,t);function r(n,i){var s=t.call(this)||this;return s.destination=n,s.source=i,s}return r.prototype.next=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,n)},r.prototype.error=function(n){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,n)},r.prototype.complete=function(){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||i===void 0||i.call(n)},r.prototype._subscribe=function(n){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&s!==void 0?s:xn},r}(Un),Wn=function(t){Ee(r,t);function r(n){var i=t.call(this)||this;return i._value=n,i}return Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(n){var i=t.prototype._subscribe.call(this,n);return!i.closed&&n.next(this._value),i},r.prototype.getValue=function(){var n=this,i=n.hasError,s=n.thrownError,c=n._value;if(i)throw s;return this._throwIfClosed(),c},r.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},r}(Un),mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Or(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ve={exports:{}};Ve.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=1,c=2,d=9007199254740991,m="[object Arguments]",T="[object Array]",D="[object AsyncFunction]",v="[object Boolean]",N="[object Date]",I="[object Error]",f="[object Function]",l="[object GeneratorFunction]",h="[object Map]",b="[object Number]",g="[object Null]",E="[object Object]",p="[object Promise]",y="[object Proxy]",k="[object RegExp]",C="[object Set]",M="[object String]",x="[object Symbol]",F="[object Undefined]",L="[object WeakMap]",A="[object ArrayBuffer]",P="[object DataView]",G="[object Float32Array]",Ut="[object Float64Array]",Xt="[object Int8Array]",ie="[object Int16Array]",ae="[object Int32Array]",se="[object Uint8Array]",oe="[object Uint8ClampedArray]",$="[object Uint16Array]",ce="[object Uint32Array]",ue=/[\\^$.*+?()[\]{}|]/g,ct=/^\[object .+?Constructor\]$/,Wt=/^(?:0|[1-9]\d*)$/,Y={};Y[G]=Y[Ut]=Y[Xt]=Y[ie]=Y[ae]=Y[se]=Y[oe]=Y[$]=Y[ce]=!0,Y[m]=Y[T]=Y[A]=Y[v]=Y[P]=Y[N]=Y[I]=Y[f]=Y[h]=Y[b]=Y[E]=Y[k]=Y[C]=Y[M]=Y[L]=!1;var U=typeof mt=="object"&&mt&&mt.Object===Object&&mt,X=typeof self=="object"&&self&&self.Object===Object&&self,R=U||X||Function("return this")(),ht=r&&!r.nodeType&&r,st=ht&&!0&&t&&!t.nodeType&&t,Z=st&&st.exports===ht,ut=Z&&U.process,J=function(){try{return ut&&ut.binding&&ut.binding("util")}catch{}}(),wt=J&&J.isTypedArray;function le(e,a){for(var o=-1,u=e==null?0:e.length,O=0,S=[];++o<u;){var j=e[o];a(j,o,e)&&(S[O++]=j)}return S}function W(e,a){for(var o=-1,u=a.length,O=e.length;++o<u;)e[O+o]=a[o];return e}function It(e,a){for(var o=-1,u=e==null?0:e.length;++o<u;)if(a(e[o],o,e))return!0;return!1}function Kt(e,a){for(var o=-1,u=Array(e);++o<e;)u[o]=a(o);return u}function Oe(e){return function(a){return e(a)}}function Et(e,a){return e.has(a)}function Pe(e,a){return e==null?void 0:e[a]}function ar(e){var a=-1,o=Array(e.size);return e.forEach(function(u,O){o[++a]=[O,u]}),o}function sr(e,a){return function(o){return e(a(o))}}function vt(e){var a=-1,o=Array(e.size);return e.forEach(function(u){o[++a]=u}),o}var fe=Array.prototype,Br=Function.prototype,Bt=Object.prototype,de=R["__core-js_shared__"],Re=Br.toString,_t=Bt.hasOwnProperty,or=function(){var e=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),cr=Bt.toString,Vr=RegExp("^"+Re.call(_t).replace(ue,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=Z?R.Buffer:void 0,pe=R.Symbol,ur=R.Uint8Array,he=Bt.propertyIsEnumerable,Vt=fe.splice,gt=pe?pe.toStringTag:void 0,me=Object.getOwnPropertySymbols,Le=Ce?Ce.isBuffer:void 0,Zt=sr(Object.keys,Object),xe=Mt(R,"DataView"),Jt=Mt(R,"Map"),Ne=Mt(R,"Promise"),Fe=Mt(R,"Set"),He=Mt(R,"WeakMap"),Lt=Mt(Object,"create"),lr=ot(xe),Dt=ot(Jt),Zr=ot(Ne),Jr=ot(Fe),qr=ot(He),fr=pe?pe.prototype:void 0,je=fr?fr.valueOf:void 0;function q(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function Qr(){this.__data__=Lt?Lt(null):{},this.size=0}function tn(e){var a=this.has(e)&&delete this.__data__[e];return this.size-=a?1:0,a}function en(e){var a=this.__data__;if(Lt){var o=a[e];return o===i?void 0:o}return _t.call(a,e)?a[e]:void 0}function rn(e){var a=this.__data__;return Lt?a[e]!==void 0:_t.call(a,e)}function nn(e,a){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=Lt&&a===void 0?i:a,this}q.prototype.clear=Qr,q.prototype.delete=tn,q.prototype.get=en,q.prototype.has=rn,q.prototype.set=nn;function et(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function an(){this.__data__=[],this.size=0}function sn(e){var a=this.__data__,o=Ie(a,e);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():Vt.call(a,o,1),--this.size,!0}function on(e){var a=this.__data__,o=Ie(a,e);return o<0?void 0:a[o][1]}function cn(e){return Ie(this.__data__,e)>-1}function un(e,a){var o=this.__data__,u=Ie(o,e);return u<0?(++this.size,o.push([e,a])):o[u][1]=a,this}et.prototype.clear=an,et.prototype.delete=sn,et.prototype.get=on,et.prototype.has=cn,et.prototype.set=un;function lt(e){var a=-1,o=e==null?0:e.length;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function ln(){this.size=0,this.__data__={hash:new q,map:new(Jt||et),string:new q}}function fn(e){var a=bt(this,e).delete(e);return this.size-=a?1:0,a}function dn(e){return bt(this,e).get(e)}function pn(e){return bt(this,e).has(e)}function hn(e,a){var o=bt(this,e),u=o.size;return o.set(e,a),this.size+=o.size==u?0:1,this}lt.prototype.clear=ln,lt.prototype.delete=fn,lt.prototype.get=dn,lt.prototype.has=pn,lt.prototype.set=hn;function ye(e){var a=-1,o=e==null?0:e.length;for(this.__data__=new lt;++a<o;)this.add(e[a])}function dr(e){return this.__data__.set(e,i),this}function _e(e){return this.__data__.has(e)}ye.prototype.add=ye.prototype.push=dr,ye.prototype.has=_e;function St(e){var a=this.__data__=new et(e);this.size=a.size}function $e(){this.__data__=new et,this.size=0}function mn(e){var a=this.__data__,o=a.delete(e);return this.size=a.size,o}function yn(e){return this.__data__.get(e)}function _n(e){return this.__data__.has(e)}function In(e,a){var o=this.__data__;if(o instanceof et){var u=o.__data__;if(!Jt||u.length<n-1)return u.push([e,a]),this.size=++o.size,this;o=this.__data__=new lt(u)}return o.set(e,a),this.size=o.size,this}St.prototype.clear=$e,St.prototype.delete=mn,St.prototype.get=yn,St.prototype.has=_n,St.prototype.set=In;function gn(e,a){var o=ge(e),u=!o&&_r(e),O=!o&&!u&&be(e),S=!o&&!u&&!O&&br(e),j=o||u||O||S,H=j?Kt(e.length,String):[],K=H.length;for(var z in e)_t.call(e,z)&&!(j&&(z=="length"||O&&(z=="offset"||z=="parent")||S&&(z=="buffer"||z=="byteLength"||z=="byteOffset")||wn(z,K)))&&H.push(z);return H}function Ie(e,a){for(var o=e.length;o--;)if(yr(e[o][0],a))return o;return-1}function Ye(e,a,o){var u=a(e);return ge(e)?u:W(u,o(e))}function qt(e){return e==null?e===void 0?F:g:gt&> in Object(e)?Ot(e):mr(e)}function pr(e){return At(e)&&qt(e)==m}function hr(e,a,o,u,O){return e===a?!0:e==null||a==null||!At(e)&&!At(a)?e!==e&&a!==a:bn(e,a,o,u,hr,O)}function bn(e,a,o,u,O,S){var j=ge(e),H=ge(a),K=j?T:Tt(e),z=H?T:Tt(a);K=K==m?E:K,z=z==m?E:z;var rt=K==E,ft=z==E,V=K==z;if(V&&be(e)){if(!be(a))return!1;j=!0,rt=!1}if(V&&!rt)return S||(S=new St),j||br(e)?ze(e,a,o,u,O,S):Tn(e,a,K,o,u,O,S);if(!(o&s)){var nt=rt&&_t.call(e,"__wrapped__"),Q=ft&&_t.call(a,"__wrapped__");if(nt||Q){var xt=nt?e.value():e,Pt=Q?a.value():a;return S||(S=new St),O(xt,Pt,o,u,S)}}return V?(S||(S=new St),An(e,a,o,u,O,S)):!1}function En(e){if(!gr(e)||Mn(e))return!1;var a=Ir(e)?Vr:ct;return a.test(ot(e))}function vn(e){return At(e)&&Ue(e.length)&&!!Y[qt(e)]}function Sn(e){if(!On(e))return Zt(e);var a=[];for(var o in Object(e))_t.call(e,o)&&o!="constructor"&&a.push(o);return a}function ze(e,a,o,u,O,S){var j=o&s,H=e.length,K=a.length;if(H!=K&&!(j&&K>H))return!1;var z=S.get(e);if(z&&S.get(a))return z==a;var rt=-1,ft=!0,V=o&c?new ye:void 0;for(S.set(e,a),S.set(a,e);++rt<H;){var nt=e[rt],Q=a[rt];if(u)var xt=j?u(Q,nt,rt,a,e,S):u(nt,Q,rt,e,a,S);if(xt!==void 0){if(xt)continue;ft=!1;break}if(V){if(!It(a,function(Pt,te){if(!Et(V,te)&&(nt===Pt||O(nt,Pt,o,u,S)))return V.push(te)})){ft=!1;break}}else if(!(nt===Q||O(nt,Q,o,u,S))){ft=!1;break}}return S.delete(e),S.delete(a),ft}function Tn(e,a,o,u,O,S,j){switch(o){case P:if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case A:return!(e.byteLength!=a.byteLength||!S(new ur(e),new ur(a)));case v:case N:case b:return yr(+e,+a);case I:return e.name==a.name&&e.message==a.message;case k:case M:return e==a+"";case h:var H=ar;case C:var K=u&s;if(H||(H=vt),e.size!=a.size&&!K)return!1;var z=j.get(e);if(z)return z==a;u|=c,j.set(e,a);var rt=ze(H(e),H(a),u,O,S,j);return j.delete(e),rt;case x:if(je)return je.call(e)==je.call(a)}return!1}function An(e,a,o,u,O,S){var j=o&s,H=Qt(e),K=H.length,z=Qt(a),rt=z.length;if(K!=rt&&!j)return!1;for(var ft=K;ft--;){var V=H[ft];if(!(j?V in a:_t.call(a,V)))return!1}var nt=S.get(e);if(nt&&S.get(a))return nt==a;var Q=!0;S.set(e,a),S.set(a,e);for(var xt=j;++ft<K;){V=H[ft];var Pt=e[V],te=a[V];if(u)var wi=j?u(te,Pt,V,a,e,S):u(Pt,te,V,e,a,S);if(!(wi===void 0?Pt===te||O(Pt,te,o,u,S):wi)){Q=!1;break}xt||(xt=V=="constructor")}if(Q&&!xt){var Er=e.constructor,vr=a.constructor;Er!=vr&&"constructor"in e&&"constructor"in a&&!(typeof Er=="function"&&Er instanceof Er&&typeof vr=="function"&&vr instanceof vr)&&(Q=!1)}return S.delete(e),S.delete(a),Q}function Qt(e){return Ye(e,Xe,kn)}function bt(e,a){var o=e.__data__;return Dn(a)?o[typeof a=="string"?"string":"hash"]:o.map}function Mt(e,a){var o=Pe(e,a);return En(o)?o:void 0}function Ot(e){var a=_t.call(e,gt),o=e[gt];try{e[gt]=void 0;var u=!0}catch{}var O=cr.call(e);return u&&(a?e[gt]=o:delete e[gt]),O}var kn=me?function(e){return e==null?[]:(e=Object(e),le(me(e),function(a){return he.call(e,a)}))}:Rn,Tt=qt;(xe&&Tt(new xe(new ArrayBuffer(1)))!=P||Jt&&Tt(new Jt)!=h||Ne&&Tt(Ne.resolve())!=p||Fe&&Tt(new Fe)!=C||He&&Tt(new He)!=L)&&(Tt=function(e){var a=qt(e),o=a==E?e.constructor:void 0,u=o?ot(o):"";if(u)switch(u){case lr:return P;case Dt:return h;case Zr:return p;case Jr:return C;case qr:return L}return a});function wn(e,a){return a=a??d,!!a&&(typeof e=="number"||Wt.test(e))&&e>-1&&e%1==0&&e<a}function Dn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function Mn(e){return!!or&&or in e}function On(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||Bt;return e===o}function mr(e){return cr.call(e)}function ot(e){if(e!=null){try{return Re.call(e)}catch{}try{return e+""}catch{}}return""}function yr(e,a){return e===a||e!==e&&a!==a}var _r=pr(function(){return arguments}())?pr:function(e){return At(e)&&_t.call(e,"callee")&&!he.call(e,"callee")},ge=Array.isArray;function Ge(e){return e!=null&&Ue(e.length)&&!Ir(e)}var be=Le||Cn;function Pn(e,a){return hr(e,a)}function Ir(e){if(!gr(e))return!1;var a=qt(e);return a==f||a==l||a==D||a==y}function Ue(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=d}function gr(e){var a=typeof e;return e!=null&&(a=="object"||a=="function")}function At(e){return e!=null&&typeof e=="object"}var br=wt?Oe(wt):vn;function Xe(e){return Ge(e)?gn(e):Sn(e)}function Rn(){return[]}function Cn(){return!1}t.exports=Pn}(Ve,Ve.exports);var ji=Ve.exports;const it=Or(ji);var Ze={exports:{}};Ze.exports,function(t,r){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,c="[object Arguments]",d="[object Array]",m="[object Boolean]",T="[object Date]",D="[object Error]",v="[object Function]",N="[object GeneratorFunction]",I="[object Map]",f="[object Number]",l="[object Object]",h="[object Promise]",b="[object RegExp]",g="[object Set]",E="[object String]",p="[object Symbol]",y="[object WeakMap]",k="[object ArrayBuffer]",C="[object DataView]",M="[object Float32Array]",x="[object Float64Array]",F="[object Int8Array]",L="[object Int16Array]",A="[object Int32Array]",P="[object Uint8Array]",G="[object Uint8ClampedArray]",Ut="[object Uint16Array]",Xt="[object Uint32Array]",ie=/[\\^$.*+?()[\]{}|]/g,ae=/\w*$/,se=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,$={};$[c]=$[d]=$[k]=$[C]=$[m]=$[T]=$[M]=$[x]=$[F]=$[L]=$[A]=$[I]=$[f]=$[l]=$[b]=$[g]=$[E]=$[p]=$[P]=$[G]=$[Ut]=$[Xt]=!0,$[D]=$[v]=$[y]=!1;var ce=typeof mt=="object"&&mt&&mt.Object===Object&&mt,ue=typeof self=="object"&&self&&self.Object===Object&&self,ct=ce||ue||Function("return this")(),Wt=r&&!r.nodeType&&r,Y=Wt&&!0&&t&&!t.nodeType&&t,U=Y&&Y.exports===Wt;function X(e,a){return e.set(a[0],a[1]),e}function R(e,a){return e.add(a),e}function ht(e,a){for(var o=-1,u=e?e.length:0;++o<u&&a(e[o],o,e)!==!1;);return e}function st(e,a){for(var o=-1,u=a.length,O=e.length;++o<u;)e[O+o]=a[o];return e}function Z(e,a,o,u){for(var O=-1,S=e?e.length:0;++O<S;)o=a(o,e[O],O,e);return o}function ut(e,a){for(var o=-1,u=Array(e);++o<e;)u[o]=a(o);return u}function J(e,a){return e==null?void 0:e[a]}function wt(e){var a=!1;if(e!=null&&typeof e.toString!="function")try{a=!!(e+"")}catch{}return a}function le(e){var a=-1,o=Array(e.size);return e.forEach(function(u,O){o[++a]=[O,u]}),o}function W(e,a){return function(o){return e(a(o))}}function It(e){var a=-1,o=Array(e.size);return e.forEach(function(u){o[++a]=u}),o}var Kt=Array.prototype,Oe=Function.prototype,Et=Object.prototype,Pe=ct["__core-js_shared__"],ar=function(){var e=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Oe.toString,vt=Et.hasOwnProperty,fe=Et.toString,Br=RegExp("^"+sr.call(vt).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=U?ct.Buffer:void 0,de=ct.Symbol,Re=ct.Uint8Array,_t=W(Object.getPrototypeOf,Object),or=Object.create,cr=Et.propertyIsEnumerable,Vr=Kt.splice,Ce=Object.getOwnPropertySymbols,pe=Bt?Bt.isBuffer:void 0,ur=W(Object.keys,Object),he=bt(ct,"DataView"),Vt=bt(ct,"Map"),gt=bt(ct,"Promise"),me=bt(ct,"Set"),Le=bt(ct,"WeakMap"),Zt=bt(Object,"create"),xe=ot(he),Jt=ot(Vt),Ne=ot(gt),Fe=ot(me),He=ot(Le),Lt=de?de.prototype:void 0,lr=Lt?Lt.valueOf:void 0;function Dt(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function Zr(){this.__data__=Zt?Zt(null):{}}function Jr(e){return this.has(e)&&delete this.__data__[e]}function qr(e){var a=this.__data__;if(Zt){var o=a[e];return o===i?void 0:o}return vt.call(a,e)?a[e]:void 0}function fr(e){var a=this.__data__;return Zt?a[e]!==void 0:vt.call(a,e)}function je(e,a){var o=this.__data__;return o[e]=Zt&&a===void 0?i:a,this}Dt.prototype.clear=Zr,Dt.prototype.delete=Jr,Dt.prototype.get=qr,Dt.prototype.has=fr,Dt.prototype.set=je;function q(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function Qr(){this.__data__=[]}function tn(e){var a=this.__data__,o=_e(a,e);if(o<0)return!1;var u=a.length-1;return o==u?a.pop():Vr.call(a,o,1),!0}function en(e){var a=this.__data__,o=_e(a,e);return o<0?void 0:a[o][1]}function rn(e){return _e(this.__data__,e)>-1}function nn(e,a){var o=this.__data__,u=_e(o,e);return u<0?o.push([e,a]):o[u][1]=a,this}q.prototype.clear=Qr,q.prototype.delete=tn,q.prototype.get=en,q.prototype.has=rn,q.prototype.set=nn;function et(e){var a=-1,o=e?e.length:0;for(this.clear();++a<o;){var u=e[a];this.set(u[0],u[1])}}function an(){this.__data__={hash:new Dt,map:new(Vt||q),string:new Dt}}function sn(e){return Qt(this,e).delete(e)}function on(e){return Qt(this,e).get(e)}function cn(e){return Qt(this,e).has(e)}function un(e,a){return Qt(this,e).set(e,a),this}et.prototype.clear=an,et.prototype.delete=sn,et.prototype.get=on,et.prototype.has=cn,et.prototype.set=un;function lt(e){this.__data__=new q(e)}function ln(){this.__data__=new q}function fn(e){return this.__data__.delete(e)}function dn(e){return this.__data__.get(e)}function pn(e){return this.__data__.has(e)}function hn(e,a){var o=this.__data__;if(o instanceof q){var u=o.__data__;if(!Vt||u.length<n-1)return u.push([e,a]),this;o=this.__data__=new et(u)}return o.set(e,a),this}lt.prototype.clear=ln,lt.prototype.delete=fn,lt.prototype.get=dn,lt.prototype.has=pn,lt.prototype.set=hn;function ye(e,a){var o=Ge(e)||ge(e)?ut(e.length,String):[],u=o.length,O=!!u;for(var S in e)vt.call(e,S)&&!(O&&(S=="length"||Dn(S,u)))&&o.push(S);return o}function dr(e,a,o){var u=e[a];(!(vt.call(e,a)&&_r(u,o))||o===void 0&&!(a in e))&&(e[a]=o)}function _e(e,a){for(var o=e.length;o--;)if(_r(e[o][0],a))return o;return-1}function St(e,a){return e&&ze(a,Xe(a),e)}function $e(e,a,o,u,O,S,j){var H;if(u&&(H=S?u(e,O,S,j):u(e)),H!==void 0)return H;if(!At(e))return e;var K=Ge(e);if(K){if(H=kn(e),!a)return Sn(e,H)}else{var z=Ot(e),rt=z==v||z==N;if(Ir(e))return Ie(e,a);if(z==l||z==c||rt&&!S){if(wt(e))return S?e:{};if(H=Tt(rt?{}:e),!a)return Tn(e,St(H,e))}else{if(!$[z])return S?e:{};H=wn(e,z,$e,a)}}j||(j=new lt);var ft=j.get(e);if(ft)return ft;if(j.set(e,H),!K)var V=o?An(e):Xe(e);return ht(V||e,function(nt,Q){V&&(Q=nt,nt=e[Q]),dr(H,Q,$e(nt,a,o,u,Q,e,j))}),H}function mn(e){return At(e)?or(e):{}}function yn(e,a,o){var u=a(e);return Ge(e)?u:st(u,o(e))}function _n(e){return fe.call(e)}function In(e){if(!At(e)||On(e))return!1;var a=Ue(e)||wt(e)?Br:se;return a.test(ot(e))}function gn(e){if(!mr(e))return ur(e);var a=[];for(var o in Object(e))vt.call(e,o)&&o!="constructor"&&a.push(o);return a}function Ie(e,a){if(a)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}function Ye(e){var a=new e.constructor(e.byteLength);return new Re(a).set(new Re(e)),a}function qt(e,a){var o=a?Ye(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}function pr(e,a,o){var u=a?o(le(e),!0):le(e);return Z(u,X,new e.constructor)}function hr(e){var a=new e.constructor(e.source,ae.exec(e));return a.lastIndex=e.lastIndex,a}function bn(e,a,o){var u=a?o(It(e),!0):It(e);return Z(u,R,new e.constructor)}function En(e){return lr?Object(lr.call(e)):{}}function vn(e,a){var o=a?Ye(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}function Sn(e,a){var o=-1,u=e.length;for(a||(a=Array(u));++o<u;)a[o]=e[o];return a}function ze(e,a,o,u){o||(o={});for(var O=-1,S=a.length;++O<S;){var j=a[O],H=void 0;dr(o,j,H===void 0?e[j]:H)}return o}function Tn(e,a){return ze(e,Mt(e),a)}function An(e){return yn(e,Xe,Mt)}function Qt(e,a){var o=e.__data__;return Mn(a)?o[typeof a=="string"?"string":"hash"]:o.map}function bt(e,a){var o=J(e,a);return In(o)?o:void 0}var Mt=Ce?W(Ce,Object):Rn,Ot=_n;(he&&Ot(new he(new ArrayBuffer(1)))!=C||Vt&&Ot(new Vt)!=I||gt&&Ot(gt.resolve())!=h||me&&Ot(new me)!=g||Le&&Ot(new Le)!=y)&&(Ot=function(e){var a=fe.call(e),o=a==l?e.constructor:void 0,u=o?ot(o):void 0;if(u)switch(u){case xe:return C;case Jt:return I;case Ne:return h;case Fe:return g;case He:return y}return a});function kn(e){var a=e.length,o=e.constructor(a);return a&&typeof e[0]=="string"&&vt.call(e,"index")&&(o.index=e.index,o.input=e.input),o}function Tt(e){return typeof e.constructor=="function"&&!mr(e)?mn(_t(e)):{}}function wn(e,a,o,u){var O=e.constructor;switch(a){case k:return Ye(e);case m:case T:return new O(+e);case C:return qt(e,u);case M:case x:case F:case L:case A:case P:case G:case Ut:case Xt:return vn(e,u);case I:return pr(e,u,o);case f:case E:return new O(e);case b:return hr(e);case g:return bn(e,u,o);case p:return En(e)}}function Dn(e,a){return a=a??s,!!a&&(typeof e=="number"||oe.test(e))&&e>-1&&e%1==0&&e<a}function Mn(e){var a=typeof e;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?e!=="__proto__":e===null}function On(e){return!!ar&&ar in e}function mr(e){var a=e&&e.constructor,o=typeof a=="function"&&a.prototype||Et;return e===o}function ot(e){if(e!=null){try{return sr.call(e)}catch{}try{return e+""}catch{}}return""}function yr(e){return $e(e,!0,!0)}function _r(e,a){return e===a||e!==e&&a!==a}function ge(e){return Pn(e)&&vt.call(e,"callee")&&(!cr.call(e,"callee")||fe.call(e)==c)}var Ge=Array.isArray;function be(e){return e!=null&&gr(e.length)&&!Ue(e)}function Pn(e){return br(e)&&be(e)}var Ir=pe||Cn;function Ue(e){var a=At(e)?fe.call(e):"";return a==v||a==N}function gr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=s}function At(e){var a=typeof e;return!!e&&(a=="object"||a=="function")}function br(e){return!!e&&typeof e=="object"}function Xe(e){return be(e)?ye(e):gn(e)}function Rn(){return[]}function Cn(){return!1}t.exports=yr}(Ze,Ze.exports);var $i=Ze.exports;const tt=Or($i),Kn=t=>new Promise((r,n)=>{const i=new Image;console.warn("update cdn config for cors?"),i.onload=()=>{const s=i.width,c=i.height;r({width:s,height:c})},i.onerror=s=>{n(s)},i.crossOrigin="anonymous",i.src=t}),Yi=t=>new Promise((r,n)=>{const i=new Audio;i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3;r({duration:s})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.crossOrigin="anonymous",i.load()}),Bn=t=>new Promise((r,n)=>{const i=document.createElement("video");i.preload="auto",i.addEventListener("loadedmetadata",()=>{const s=i.duration*1e3,c=i.videoWidth,d=i.videoHeight;r({duration:s,width:c,height:d})}),i.addEventListener("error",s=>{n(s)}),i.src=t,i.load()}),Vn=(t,r)=>{const n=document.createElement("div");Object.keys(r).forEach(s=>{s!=="height"&&(n.style[s]=r[s])}),document.body.appendChild(n),n.textContent=t,n.style.whiteSpace="normal",n.style.position="absolute",n.style.visibility="hidden",n.style.display="inline-block",n.style.width=r.width+"px",n.style.fontSize=r.fontSize+"px";const i=getComputedStyle(n).height;return document.body.removeChild(n),parseFloat(i)},Je=t=>{const r=t.map(n=>new FontFace(n.fontFamily,`url(${n.url})`).load().catch(i=>i));return r.length===0?Promise.resolve(!0):new Promise((n,i)=>{Promise.all(r).then(s=>{s.forEach(c=>{c&&c.family&&(document.fonts.add(c),n(!0))})}).catch(s=>i(s))})},zi="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let qe=(t=21)=>{let r="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)r+=zi[n[t]&63];return r};function re(t=16){const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.charAt(Math.floor(Math.random()*r.length));let i=qe(t-1);return i=i.replace(/[^a-zA-Z0-9]/g,"").slice(0,t-1),n+i}const Qe={color:"#000000",x:0,y:0,blur:0},ve=(t,r)=>{let n=r!=null&&r.trim?r.trim.to-r.trim.from:(r==null?void 0:r.duration)||5e3;const i={from:0,to:n};if(!t)return i;if(t.from<0)return console.error("'from' must be a non-negative number. Returning default display."),i;if(t.from!==void 0&&t.to===void 0)return{from:t.from,to:t.from+n};if(t.to!==void 0){if(t.to<0)return console.error("'to' must be a non-negative number. Returning default display."),i;if(t.to<t.from)return console.error("'to' must be greater than or equal to 'from'. Returning default display."),i}return t},Zn=(t,r)=>t?t.from&&!t.to?{from:t.from,to:r.duration}:t:{from:0,to:r.duration};function tr(t,r){const n={x:t.size.width/2,y:t.size.height/2},i={x:r.width/2,y:r.height/2},s=Math.min(t.size.width/r.width,t.size.height/r.height),c=n.x-i.x;return{top:`${n.y-i.y}px`,left:`${c}px`,transform:`scale(${s})`}}const Jn=async(t,r)=>{const n=t.details.src,i=await Bn(n),s=tr(r,{...i}),c=Zn(t.trim,{duration:i.duration}),d={width:i.width,height:i.height,opacity:100,src:n,volume:t.details.volume??100,borderRadius:t.details.borderRadius??0,borderWidth:t.details.borderWidth??0,borderColor:t.details.borderColor||"#000000",boxShadow:t.details.boxShadow||Qe,top:t.details.top||s.top||"0px",left:t.details.left||s.left||"0px",transform:t.details.transform||s.transform,blur:t.details.blur||0,brightness:t.details.brightness||100,flipX:t.details.flipX||!1,flipY:t.details.flipY||!1,rotate:t.details.rotate||"0deg",visibility:t.details.visibility||"visible",mediaWidth:t.details.mediaWidth||i.width||100,mediaHeight:t.details.mediaHeight||i.height||100};return{...t,trim:c,type:"video",name:"video",details:d,playbackRate:t.playbackRate||1,display:ve(t.display,{duration:i.duration,trim:c}),duration:i.duration}},qn=async t=>{const r=t.id,n=t.details,s=(await Yi(n.src)).duration,c=Zn(t.trim,{duration:s});return{id:r,name:"",type:"audio",display:ve(t.display,{duration:s,trim:c}),trim:c,playbackRate:t.playbackRate||1,details:{src:n.src,volume:n.volume??100},metadata:{...t.metadata},duration:s}},Gi=async(t,r)=>{var N,I,f;const n=t.trackItemIds,i=t.size||{width:t.details.width,height:t.details.height},s=Math.min(r.size.width/i.width,r.size.height/i.height),c=((N=t.details)==null?void 0:N.rotate)||0,d={top:((I=t.details)==null?void 0:I.top)||0,left:((f=t.details)==null?void 0:f.left)||0},m=t.display,T=t.trim||t.display;let D=1/0,v=0;return n.forEach(l=>{const h=t.trackItemsMap[l];h.display.from<D&&(D=h.display.from),h.display.to>v&&(v=h.display.to)}),{id:t.id,details:{...i,top:d.top,left:d.left,scale:s,rotate:c},trim:T,display:m||{from:D,to:v},activeEdit:!1}},Qn=async(t,r)=>{const n=t.details,i=await Kn(n.src),s=tr(r,i);return{id:t.id,type:"image",name:"image",display:ve(t.display),playbackRate:t.playbackRate||1,details:{src:n.src||"",width:n.width||i.width||100,height:n.height||i.height||100,opacity:n.opacity??100,transform:n.transform||s.transform,border:n.border||"none",borderRadius:n.borderRadius||0,boxShadow:n.boxShadow||Qe,top:n.top||s.top||"0px",left:n.left||s.left||"0px",borderWidth:n.borderWidth??0,borderColor:n.borderColor||"#000000",blur:n.blur||0,brightness:n.brightness||100,flipX:n.flipX||!1,flipY:n.flipY||!1,rotate:n.rotate||"0deg",visibility:n.visibility||"visible",mediaWidth:n.mediaWidth||n.width||i.width||100,mediaHeight:n.mediaHeight||n.height||i.height||100},metadata:t.metadata||{}}},ti=async(t,r)=>{const n=t;n.details.fontUrl&&await Je([{fontFamily:n.details.fontFamily,url:n.details.fontUrl}]);const i=n.id,s=n.details,c=ri(s),d=Vn(n.details.text,c),m=tr(r,{width:c.width,height:d});return{id:i,name:"caption",type:"caption",display:ve(n.display),details:{...c,text:s.text||"",height:d,fontUrl:s.fontUrl,top:c.top||m.top,left:c.left||m.left,borderWidth:s.borderWidth||0,borderColor:s.borderColor||"#000000",boxShadow:s.boxShadow||Qe,words:s.words||[]},metadata:{}}},ei=async(t,r)=>{t.details.fontUrl&&await Je([{fontFamily:t.details.fontFamily,url:t.details.fontUrl}]);const n=t.id,i=t.details,s=ri(i),c=Vn(t.details.text,s),d=tr(r,{width:s.width,height:c});return{id:n,name:"text",type:"text",display:ve(t.display),details:{...s,text:i.text||"",height:c,fontUrl:i.fontUrl,top:s.top||d.top,left:s.left||d.left,borderWidth:i.borderWidth||0,borderColor:i.borderColor||"#000000",boxShadow:i.boxShadow||Qe},metadata:{}}},ri=t=>({fontFamily:t.fontFamily||"Arial",fontSize:t.fontSize||"16px",fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textDecoration:t.textDecoration||"none",textAlign:t.textAlign||"left",lineHeight:t.lineHeight||"normal",letterSpacing:t.letterSpacing||"normal",wordSpacing:t.wordSpacing||"normal",color:t.color||"#ffffff",backgroundColor:t.backgroundColor||"transparent",border:t.border||"none",textShadow:t.textShadow||"none",text:t.text||"",opacity:t.opacity??100,width:t.width||300,wordWrap:t.wordWrap||"normal",wordBreak:t.wordBreak||"normal",WebkitTextStrokeColor:t.WebkitTextStrokeColor||"#ffffff",WebkitTextStrokeWidth:t.WebkitTextStrokeWidth||"0px",top:t.top,left:t.left,textTransform:t.textTransform||"none",transform:t.transform||"none",skewX:t.skewX||0,skewY:t.skewY||0}),Ui=async(t,r)=>{switch(t.type){case"video":return Jn(t,r||{});case"audio":return qn(t);case"image":return Qn(t,r||{});case"text":return ei(t,r||{});case"caption":return ti(t,r||{});default:throw new Error("Unsupported track item")}};function Xi(t,r){return r.some(n=>t.some(i=>i.id===n.id))}const Wi=(t=[],r=[])=>t.length===0?r.map(i=>({id:re(),items:[i.id],type:i.type,accepts:["text","image","video","audio","caption","template"]})):t.map(n=>({...n,items:n.items||[],accepts:["audio","video","image","text","caption","template"],type:n.type||"text",magnetic:n.magnetic||!1,static:n.static||!1,id:n.id||re()}));function Ki(t,r){return t.filter(i=>{if(r.forEach(s=>{i.items.includes(s)&&(i.items=i.items.filter(c=>c!==s))}),i.items.length!==0||i.static)return i})}const Nt=t=>Object.keys(t).reduce((r,n)=>{const{display:i,playbackRate:s}=t[n];return Math.max(r,i.to/(s||1))},0);function Pr(t,r,n){return Math.min(Math.max(t,r),n)}const Bi=(t,r,n,i,s)=>{if(i===void 0&&s===void 0)return{trackId:void 0,trackIndex:void 0};const c=s!==void 0?r[Pr(s,0,r.length)]:r.find(T=>T.id===i);if(!c)return{trackId:void 0,trackIndex:s!==void 0?Pr(s,0,r.length):void 0};const d=c.items.map(T=>n[T]),m=t.map(T=>n[T]);for(const T of d){const D=T.display.from,v=T.display.to;for(const N of m){const I=N.display.from;if(!(N.display.to<=D||I>=v))return{trackId:void 0,trackIndex:r.indexOf(c)}}}return{trackId:c.id,trackIndex:r.indexOf(c)}};function Vi(t,r){let i=r.reduce((s,c)=>c.display.to>s.display.to?c:s,{display:{to:0}}).display.to;t.forEach(s=>{const c=s.display.from,m=s.display.to-c;s.display.from=i,s.display.to=s.display.from+m,i=s.display.to})}function Zi(t){const r=t,n=r.tracks,i=r.trackItemsMap,s=[],c={};return n.forEach(d=>{var T;const m=d.items.map(D=>i[D]).sort((D,v)=>D.display.from-v.display.from);for(let D=0;D<m.length-1;D++){const v=m[D],N=m[D+1];if(Math.abs(v.display.to-N.display.from)<=1){const I=`${v.id}-${N.id}`;if((T=r.transitionIds)==null?void 0:T.includes(I))c[I]=r.transitionsMap[I];else{const l={id:I,duration:1500,fromId:v.id,toId:N.id,kind:"none",trackId:d.id,type:"transition"};c[I]=l}s.push(I)}}}),r.transitionIds=s,r.transitionsMap=c,{transitionIds:s,transitionsMap:c}}function Ji(t){const r=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.DESIGN_PREFIX))),n=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.ADD_PREFIX))),i=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.LAYER_PREFIX))),s=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.HISTORY_PREFIX))),c=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.ACTIVE_PREFIX))),d=w.subject.pipe(w.filter(({key:f})=>f.startsWith(w.EDIT_PREFIX))),m=r.subscribe(async f=>{var l,h;if(f.key===w.DESIGN_LOAD){const b=(l=f.value)==null?void 0:l.payload,g=b.trackItemsMap,E=b.trackItemDetailsMap;console.warn("IMPROVE FONTS LOADING");for(const y in E)if(E[y].type==="text"||E[y].type==="caption"){const k=E[y].details;await Je([{fontFamily:k.fontFamily,url:k.fontUrl}])}const p=Nt(g);t.updateState({...b,duration:p},{kind:"design:load",updateHistory:!1})}if(f.key===w.DESIGN_RESIZE){const b=(h=f.value)==null?void 0:h.payload;t.updateState({size:b},{kind:"design:resize",updateHistory:!1})}}),T=s.subscribe(f=>{if(f.key===w.HISTORY_UNDO)return t.undo();if(f.key===w.HISTORY_REDO)return t.redo()}),D=i.subscribe(f=>{var h,b,g,E;const l=[];if((h=f.value)!=null&&h.payload.trackItemIds&&(l.push((b=f.value)==null?void 0:b.payload.trackItemIds),t.updateState({activeIds:l},{kind:"update",updateHistory:!1})),f.key===w.LAYER_DELETE){const p=(g=f.value)==null?void 0:g.payload.trackItemIds,y=tt(t.getState()),k=p&&p.length?p:y.activeIds,C=y.trackItemIds,M=y.trackItemDetailsMap,x=C.filter(G=>!k.includes(G)),F=Object.fromEntries(Object.entries(M).filter(([G])=>!k.includes(G))),L=Ki(y.tracks,k),A=Object.fromEntries(Object.entries(y.trackItemsMap).filter(([G])=>!k.includes(G))),P=Nt(A);t.updateState({trackItemIds:x,trackItemDetailsMap:F,activeIds:[],trackItemsMap:A,tracks:L,duration:P},{updateHistory:!0,kind:"remove"})}if(f.key===w.LAYER_CLONE){const p=tt(t.getState()),y={},k=((E=f.value)==null?void 0:E.payload.trackItemIds)||p.activeIds;if(k.length===0)return;k.forEach(M=>{const x=p.trackItemsMap[M],F=p.trackItemDetailsMap[M],L=re();p.trackItemsMap[L]={...tt(x),id:L},p.trackItemDetailsMap[L]={...tt(F)},p.trackItemIds.push(L);const A=p.tracks.find(P=>P.items.includes(M));y[A.id]?y[A.id].items.push(L):y[A.id]={...A,id:re(),items:[L],static:!1,magnetic:!1}});const C=Object.values(y);p.tracks=[...C,...p.tracks],t.updateState({trackItemDetailsMap:p.trackItemDetailsMap,tracks:p.tracks,trackItemIds:p.trackItemIds,trackItemsMap:p.trackItemsMap},{updateHistory:!0,kind:"update"})}}),v=n.subscribe(async f=>{var k,C,M,x,F,L,A,P,G,Ut,Xt,ie,ae,se,oe,$,ce,ue,ct,Wt,Y;const l=tt(t.getState()),h=((C=(k=f.value)==null?void 0:k.options)==null?void 0:C.isSelected)||!1;let b=[],g="text";const E=(x=(M=f.value)==null?void 0:M.options)==null?void 0:x.trackId;let p=(L=(F=f.value)==null?void 0:F.options)==null?void 0:L.trackIndex;if(f.key===Ti){const U=(A=f.value)==null?void 0:A.payload,X=U.trackItems.map(W=>Ui(W,{size:l.size})),R=await Promise.all(X),ht=Wi(U.tracks,U.trackItems),st=[],Z={},ut={};if(R.forEach(W=>{const{details:It,...Kt}=W;st.push(W.id),Z[W.id]={type:W.type,details:It},ut[W.id]=Kt}),Xi(l.tracks,ht))l.tracks.forEach(W=>{ht.forEach(It=>{if(W.id===It.id){if(W.magnetic){const Kt=It.items.map(Et=>ut[Et]),Oe=W.items.map(Et=>l.trackItemsMap[Et]);Vi(Kt,Oe)}W.items.push(...st)}})});else{const W=((G=(P=f.value)==null?void 0:P.options)==null?void 0:G.trackIndex)||0,It=Pr(W,0,l.tracks.length);l.tracks.splice(It,0,...ht)}l.trackItemDetailsMap={...l.trackItemDetailsMap,...Z},l.trackItemsMap={...l.trackItemsMap,...ut},l.trackItemIds=[...l.trackItemIds,...st],l.duration=Nt(l.trackItemsMap);const{transitionIds:wt,transitionsMap:le}=Zi(l);t.updateState({trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,tracks:l.tracks,duration:l.duration,transitionIds:wt,transitionsMap:le},{updateHistory:!0,kind:"add"});return}if(f.key===w.ADD_CAPTION){g="caption";const U=(Ut=f.value)==null?void 0:Ut.payload,X=[];for(const st of U){const Z=ti(st,{size:l.size});X.push(Z)}const R=await Promise.all(X),ht=[];for(const st of R){const Z=st.id;ht.push(Z);const{details:ut,...J}=st;l.trackItemDetailsMap[Z]={type:g,details:ut},l.trackItemsMap[Z]=J,l.trackItemIds.push(Z)}b=ht}if(f.key===w.ADD_TEXT){g="text";const U=await ei((Xt=f.value)==null?void 0:Xt.payload,{size:l.size}),{details:X,...R}=U;l.trackItemDetailsMap[R.id]={type:g,details:X},l.trackItemsMap[R.id]=R,l.trackItemIds.push(R.id),b=[R.id]}if(f.key===w.ADD_TEMPLATE){g="template";const U=(ie=f.value)==null?void 0:ie.payload.trackItemsMap,X=(ae=f.value)==null?void 0:ae.payload.trackItemDetailsMap,R=(se=f.value)==null?void 0:se.payload.transitionsMap,ht=((oe=f.value)==null?void 0:oe.payload.transitionIds)||[],st=($=f.value)==null?void 0:$.payload.trackItemIds,Z=((ce=f.value)==null?void 0:ce.payload.tracks)||[],{details:ut,...J}=await Gi((ue=f.value)==null?void 0:ue.payload,{size:l.size}),wt={id:J.id,items:st,transitions:ht,tracks:Z};l.trackItemDetailsMap[J.id]={type:g,details:ut},l.trackItemsMap[J.id]=J,l.trackItemIds.push(J.id),b=[J.id],l.trackItemsMap={...l.trackItemsMap,...U,[J.id]:{type:"template",...J}},l.trackItemDetailsMap={...l.trackItemDetailsMap,...X,[J.id]:{type:"template",details:ut}},l.transitionsMap={...l.transitionsMap,...R},l.structure=[...l.structure,wt]}if(f.key===w.ADD_IMAGE){g="image";const U=await Qn((ct=f.value)==null?void 0:ct.payload,{size:l.size}),{details:X,...R}=U;l.trackItemDetailsMap[R.id]={type:g,details:X},l.trackItemsMap[R.id]=R,l.trackItemIds.push(R.id),b=[R.id]}if(f.key===w.ADD_AUDIO){g="audio";const U=await qn((Wt=f.value)==null?void 0:Wt.payload),{details:X,...R}=U;l.trackItemDetailsMap[R.id]={type:g,details:X},l.trackItemsMap[R.id]=R,l.trackItemIds.push(R.id),b=[R.id]}if(f.key===w.ADD_VIDEO){g="video";const U=await Jn((Y=f.value)==null?void 0:Y.payload,{size:l.size}),{details:X,...R}=U;l.trackItemDetailsMap[R.id]={type:g,details:X},l.trackItemsMap[R.id]=R,l.trackItemIds.push(R.id),b=[R.id]}const y=Bi(b,l.tracks,l.trackItemsMap,E,p);if(y.trackId){const U=l.tracks.find(X=>X.id===y.trackId);U&&U.items.push(...b)}else if(y.trackIndex!==void 0){const U={id:qe(),accepts:["text","audio","helper","video","image","caption","template"],type:g,items:b,magnetic:!1,static:!1};l.tracks.splice(y.trackIndex,0,U)}else l.tracks.unshift({id:qe(),accepts:["text","audio","helper","video","image","caption","template"],type:g,items:b,magnetic:!1,static:!1});h&&(l.activeIds=b),l.duration=Nt(l.trackItemsMap),t.updateState({activeIds:l.activeIds,trackItemIds:l.trackItemIds,trackItemDetailsMap:l.trackItemDetailsMap,trackItemsMap:l.trackItemsMap,transitionsMap:l.transitionsMap,tracks:l.tracks,duration:l.duration,structure:l.structure},{updateHistory:!0,kind:"add"})}),N=c.subscribe(async f=>{var l;if(f.key===w.ACTIVE_SPLIT){const h=tt(t.getState()),b=(l=f.value)==null?void 0:l.options.time;if(h.activeIds.length===1){const g=h.activeIds[0],E=h.trackItemsMap[g];if(b>=E.display.to||b<=E.display.from)return;const p=h.trackItemDetailsMap[g],y=re(),k={...E,id:y,display:{from:b,to:E.display.to},trim:{from:b,to:E.display.to}};h.trackItemsMap[g].display.to=b,h.trackItemsMap[y]=k,h.trackItemIds.push(y),h.trackItemDetailsMap[y]=p,h.tracks.forEach(C=>{C.items.includes(g)&&C.items.push(y)}),t.updateState({trackItemDetailsMap:h.trackItemDetailsMap,tracks:h.tracks,trackItemIds:h.trackItemIds,trackItemsMap:h.trackItemsMap},{updateHistory:!0,kind:"update"})}return}if(f.key===w.ACTIVE_CLONE){const h=tt(t.getState());if(h.activeIds.length){const b=h.activeIds,g=[],E={activeIds:b,trackItemDetailsMap:{},trackItemsMap:{},tracks:[]};b.forEach(y=>{E.trackItemDetailsMap[y]=h.trackItemDetailsMap[y],E.trackItemsMap[y]=h.trackItemsMap[y],g.push(h.tracks.find(k=>k.items.includes(y)))});const p=new Set;g.filter(y=>p.has(y.id)?!1:(p.add(y),!0)),E.tracks=Array.from(p.keys()),localStorage.setItem("DesignComboTemp",JSON.stringify(E))}}if(f.key===w.ACTIVE_PASTE){const h=localStorage.getItem("DesignComboTemp");if(!h)return;const b=tt(t.getState()),g=JSON.parse(h),E={},p=g.trackItemsMap,y=g.trackItemDetailsMap,k=g.tracks,C=[],M=g.activeIds.map(async x=>{const F=y[x];(F.type==="caption"||F.type==="text")&&F.details.fontUrl&&await Je([{fontFamily:F.details.fontFamily,url:F.details.fontUrl}]);const L=re();return E[x]=L,b.trackItemsMap[L]={...p[x],id:L},b.trackItemDetailsMap[L]=F,b.trackItemIds.push(L),!0});await Promise.all(M),k.forEach(x=>{const F=x.items.map(A=>E[A]),L={...x,items:F,id:qe()};C.push(L)}),b.tracks=[...b.tracks,...C],t.updateState({trackItemDetailsMap:b.trackItemDetailsMap,tracks:b.tracks,trackItemIds:b.trackItemIds,trackItemsMap:b.trackItemsMap},{updateHistory:!0,kind:"update"})}}),I=d.subscribe(async f=>{var l,h,b;if(f.key===w.EDIT_OBJECT){const g=tt(t.getState()),E=g.trackItemDetailsMap,p=g.trackItemsMap,y=Object.keys((l=f.value)==null?void 0:l.payload);if(!y.length)return;const k=(h=f.value)==null?void 0:h.payload;y.forEach(M=>{const x=k[M];x.details?E[M].details={...E[M].details,...x.details}:k[M].playbackRate&&(p[M].playbackRate=k[M].playbackRate)});const C=Nt(p);t.updateState({trackItemDetailsMap:{...E},trackItemsMap:{...p},duration:C},{updateHistory:!0,kind:"update:details"})}if(f.key===w.REPLACE_MEDIA){const g=(b=f.value)==null?void 0:b.payload,E=Object.keys(g)[0],p=Object.values(g)[0],y=tt(t.getState()),k=y.trackItemDetailsMap[E];if(p.details){if(p.type==="image"&&p.details.src){const x=await Kn(p.details.src),F=k.details.width||0,L=k.details.height||0;let A=x.width,P=x.height;const G=x.width/x.height;F/L>G?(A=F,P=F/G):(P=L,A=L*G),p.details.mediaWidth=A,p.details.mediaHeight=P}if(p.type==="video"&&p.details.src){const x=await Bn(p.details.src),F=k.details.width||0,L=k.details.height||0;let A=x.width,P=x.height;const G=x.width/x.height;F/L>G?(A=F,P=F/G):(P=L,A=L*G),p.details.mediaWidth=A,p.details.mediaHeight=P}const M=k.details;k.details={...M,...p.details},p.details=k.details}const C={...k,...p};y.trackItemDetailsMap[E]=C,y.trackItemsMap[E]={...y.trackItemsMap[E],type:p.type},t.updateState({trackItemDetailsMap:{...y.trackItemDetailsMap},trackItemsMap:{...y.trackItemsMap}},{updateHistory:!0,kind:"update:details"})}});return{unsubscribe:()=>{v.unsubscribe(),N.unsubscribe(),I.unsubscribe(),T.unsubscribe(),D.unsubscribe(),m.unsubscribe()}}}const qi={Date:!0,RegExp:!0,String:!0,Number:!0};function ni(t,r,n={cyclesFix:!0},i=[]){var m,T;let s=[];const c=Array.isArray(t);for(const D in t){const v=t[D],N=c?+D:D;if(!(D in r)){s.push({type:"REMOVE",path:[N],oldValue:t[D]});continue}const I=r[D],f=typeof v=="object"&&typeof I=="object"&&Array.isArray(v)===Array.isArray(I);if(v&&I&&f&&!qi[(T=(m=Object.getPrototypeOf(v))==null?void 0:m.constructor)==null?void 0:T.name]&&(!n.cyclesFix||!i.includes(v))){const l=ni(v,I,n,n.cyclesFix?i.concat([v]):[]);s.push.apply(s,l.map(h=>(h.path.unshift(N),h)))}else v!==I&&!(Number.isNaN(v)&&Number.isNaN(I))&&!(f&&(isNaN(v)?v+""==I+"":+v==+I))&&s.push({path:[N],type:"CHANGE",value:I,oldValue:v})}const d=Array.isArray(r);for(const D in r)D in t||s.push({type:"CREATE",path:[d?+D:D],value:r[D]});return s}var Rr=Symbol.for("immer-nothing"),Se=Symbol.for("immer-draftable"),dt=Symbol.for("immer-state"),ii=process.env.NODE_ENV!=="production"?[function(t){return`The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`},function(t){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${t}'`},"This object has been frozen and should not be mutated",function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(t){return`'current' expects a draft, got: ${t}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(t){return`'original' expects a draft, got: ${t}`}]:[];function B(t,...r){if(process.env.NODE_ENV!=="production"){const n=ii[t],i=typeof n=="function"?n.apply(null,r):n;throw new Error(`[Immer] ${i}`)}throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Ft=Object.getPrototypeOf;function Ht(t){return!!t&&!!t[dt]}function Ct(t){var r;return t?ai(t)||Array.isArray(t)||!!t[Se]||!!((r=t.constructor)!=null&&r[Se])||ke(t)||we(t):!1}var Qi=Object.prototype.constructor.toString();function ai(t){if(!t||typeof t!="object")return!1;const r=Ft(t);if(r===null)return!0;const n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Qi}function Te(t,r){jt(t)===0?Reflect.ownKeys(t).forEach(n=>{r(n,t[n],t)}):t.forEach((n,i)=>r(i,n,t))}function jt(t){const r=t[dt];return r?r.type_:Array.isArray(t)?1:ke(t)?2:we(t)?3:0}function Ae(t,r){return jt(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function Cr(t,r){return jt(t)===2?t.get(r):t[r]}function si(t,r,n){const i=jt(t);i===2?t.set(r,n):i===3?t.add(n):t[r]=n}function ta(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r}function ke(t){return t instanceof Map}function we(t){return t instanceof Set}function $t(t){return t.copy_||t.base_}function Lr(t,r){if(ke(t))return new Map(t);if(we(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);const n=ai(t);if(r===!0||r==="class_only"&&!n){const i=Object.getOwnPropertyDescriptors(t);delete i[dt];let s=Reflect.ownKeys(i);for(let c=0;c<s.length;c++){const d=s[c],m=i[d];m.writable===!1&&(m.writable=!0,m.configurable=!0),(m.get||m.set)&&(i[d]={configurable:!0,writable:!0,enumerable:m.enumerable,value:t[d]})}return Object.create(Ft(t),i)}else{const i=Ft(t);if(i!==null&&n)return{...t};const s=Object.create(i);return Object.assign(s,t)}}function xr(t,r=!1){return er(t)||Ht(t)||!Ct(t)||(jt(t)>1&&(t.set=t.add=t.clear=t.delete=ea),Object.freeze(t),r&&Object.entries(t).forEach(([n,i])=>xr(i,!0))),t}function ea(){B(2)}function er(t){return Object.isFrozen(t)}var Nr={};function Yt(t){const r=Nr[t];return r||B(0,t),r}function ra(t,r){Nr[t]||(Nr[t]=r)}var De;function oi(){return De}function na(t,r){return{drafts_:[],parent_:t,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ci(t,r){r&&(Yt("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=r)}function Fr(t){Hr(t),t.drafts_.forEach(ia),t.drafts_=null}function Hr(t){t===De&&(De=t.parent_)}function ui(t){return De=na(De,t)}function ia(t){const r=t[dt];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function li(t,r){r.unfinalizedDrafts_=r.drafts_.length;const n=r.drafts_[0];return t!==void 0&&t!==n?(n[dt].modified_&&(Fr(r),B(4)),Ct(t)&&(t=rr(r,t),r.parent_||nr(r,t)),r.patches_&&Yt("Patches").generateReplacementPatches_(n[dt].base_,t,r.patches_,r.inversePatches_)):t=rr(r,n,[]),Fr(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),t!==Rr?t:void 0}function rr(t,r,n){if(er(r))return r;const i=r[dt];if(!i)return Te(r,(s,c)=>fi(t,i,r,s,c,n)),r;if(i.scope_!==t)return r;if(!i.modified_)return nr(t,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let c=s,d=!1;i.type_===3&&(c=new Set(s),s.clear(),d=!0),Te(c,(m,T)=>fi(t,i,s,m,T,n,d)),nr(t,s,!1),n&&t.patches_&&Yt("Patches").generatePatches_(i,n,t.patches_,t.inversePatches_)}return i.copy_}function fi(t,r,n,i,s,c,d){if(process.env.NODE_ENV!=="production"&&s===n&&B(5),Ht(s)){const m=c&&r&&r.type_!==3&&!Ae(r.assigned_,i)?c.concat(i):void 0,T=rr(t,s,m);if(si(n,i,T),Ht(T))t.canAutoFreeze_=!1;else return}else d&&n.add(s);if(Ct(s)&&!er(s)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;rr(t,s),(!r||!r.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,i)&&nr(t,s)}}function nr(t,r,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&xr(r,n)}function aa(t,r){const n=Array.isArray(t),i={type_:n?1:0,scope_:r?r.scope_:oi(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=i,c=jr;n&&(s=[i],c=Me);const{revoke:d,proxy:m}=Proxy.revocable(s,c);return i.draft_=m,i.revoke_=d,m}var jr={get(t,r){if(r===dt)return t;const n=$t(t);if(!Ae(n,r))return sa(t,n,r);const i=n[r];return t.finalized_||!Ct(i)?i:i===$r(t.base_,r)?(zr(t),t.copy_[r]=Gr(i,t)):i},has(t,r){return r in $t(t)},ownKeys(t){return Reflect.ownKeys($t(t))},set(t,r,n){const i=di($t(t),r);if(i!=null&&i.set)return i.set.call(t.draft_,n),!0;if(!t.modified_){const s=$r($t(t),r),c=s==null?void 0:s[dt];if(c&&c.base_===n)return t.copy_[r]=n,t.assigned_[r]=!1,!0;if(ta(n,s)&&(n!==void 0||Ae(t.base_,r)))return!0;zr(t),Yr(t)}return t.copy_[r]===n&&(n!==void 0||r in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[r])||(t.copy_[r]=n,t.assigned_[r]=!0),!0},deleteProperty(t,r){return $r(t.base_,r)!==void 0||r in t.base_?(t.assigned_[r]=!1,zr(t),Yr(t)):delete t.assigned_[r],t.copy_&&delete t.copy_[r],!0},getOwnPropertyDescriptor(t,r){const n=$t(t),i=Reflect.getOwnPropertyDescriptor(n,r);return i&&{writable:!0,configurable:t.type_!==1||r!=="length",enumerable:i.enumerable,value:n[r]}},defineProperty(){B(11)},getPrototypeOf(t){return Ft(t.base_)},setPrototypeOf(){B(12)}},Me={};Te(jr,(t,r)=>{Me[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Me.deleteProperty=function(t,r){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(r))&&B(13),Me.set.call(this,t,r,void 0)},Me.set=function(t,r,n){return process.env.NODE_ENV!=="production"&&r!=="length"&&isNaN(parseInt(r))&&B(14),jr.set.call(this,t[0],r,n,t[0])};function $r(t,r){const n=t[dt];return(n?$t(n):t)[r]}function sa(t,r,n){var s;const i=di(r,n);return i?"value"in i?i.value:(s=i.get)==null?void 0:s.call(t.draft_):void 0}function di(t,r){if(!(r in t))return;let n=Ft(t);for(;n;){const i=Object.getOwnPropertyDescriptor(n,r);if(i)return i;n=Ft(n)}}function Yr(t){t.modified_||(t.modified_=!0,t.parent_&&Yr(t.parent_))}function zr(t){t.copy_||(t.copy_=Lr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var oa=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,n,i)=>{if(typeof r=="function"&&typeof n!="function"){const c=n;n=r;const d=this;return function(T=c,...D){return d.produce(T,v=>n.call(this,v,...D))}}typeof n!="function"&&B(6),i!==void 0&&typeof i!="function"&&B(7);let s;if(Ct(r)){const c=ui(this),d=Gr(r,void 0);let m=!0;try{s=n(d),m=!1}finally{m?Fr(c):Hr(c)}return ci(c,i),li(s,c)}else if(!r||typeof r!="object"){if(s=n(r),s===void 0&&(s=r),s===Rr&&(s=void 0),this.autoFreeze_&&xr(s,!0),i){const c=[],d=[];Yt("Patches").generateReplacementPatches_(r,s,c,d),i(c,d)}return s}else B(1,r)},this.produceWithPatches=(r,n)=>{if(typeof r=="function")return(d,...m)=>this.produceWithPatches(d,T=>r(T,...m));let i,s;return[this.produce(r,n,(d,m)=>{i=d,s=m}),i,s]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){Ct(t)||B(8),Ht(t)&&(t=ca(t));const r=ui(this),n=Gr(t,void 0);return n[dt].isManual_=!0,Hr(r),n}finishDraft(t,r){const n=t&&t[dt];(!n||!n.isManual_)&&B(9);const{scope_:i}=n;return ci(i,r),li(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const s=r[n];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}n>-1&&(r=r.slice(n+1));const i=Yt("Patches").applyPatches_;return Ht(t)?i(t,r):this.produce(t,s=>i(s,r))}};function Gr(t,r){const n=ke(t)?Yt("MapSet").proxyMap_(t,r):we(t)?Yt("MapSet").proxySet_(t,r):aa(t,r);return(r?r.scope_:oi()).drafts_.push(n),n}function ca(t){return Ht(t)||B(10,t),pi(t)}function pi(t){if(!Ct(t)||er(t))return t;const r=t[dt];let n;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=Lr(t,r.scope_.immer_.useStrictShallowCopy_)}else n=Lr(t,!0);return Te(n,(i,s)=>{si(n,i,pi(s))}),r&&(r.finalized_=!1),n}function hi(){process.env.NODE_ENV!=="production"&&ii.push('Sets cannot have "replace" patches.',function(I){return"Unsupported patch operation: "+I},function(I){return"Cannot apply patch, path doesn't resolve: "+I},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");const r="replace",n="add",i="remove";function s(I,f,l,h){switch(I.type_){case 0:case 2:return d(I,f,l,h);case 1:return c(I,f,l,h);case 3:return m(I,f,l,h)}}function c(I,f,l,h){let{base_:b,assigned_:g}=I,E=I.copy_;E.length<b.length&&([b,E]=[E,b],[l,h]=[h,l]);for(let p=0;p<b.length;p++)if(g[p]&&E[p]!==b[p]){const y=f.concat([p]);l.push({op:r,path:y,value:N(E[p])}),h.push({op:r,path:y,value:N(b[p])})}for(let p=b.length;p<E.length;p++){const y=f.concat([p]);l.push({op:n,path:y,value:N(E[p])})}for(let p=E.length-1;b.length<=p;--p){const y=f.concat([p]);h.push({op:i,path:y})}}function d(I,f,l,h){const{base_:b,copy_:g}=I;Te(I.assigned_,(E,p)=>{const y=Cr(b,E),k=Cr(g,E),C=p?Ae(b,E)?r:n:i;if(y===k&&C===r)return;const M=f.concat(E);l.push(C===i?{op:C,path:M}:{op:C,path:M,value:k}),h.push(C===n?{op:i,path:M}:C===i?{op:n,path:M,value:N(y)}:{op:r,path:M,value:N(y)})})}function m(I,f,l,h){let{base_:b,copy_:g}=I,E=0;b.forEach(p=>{if(!g.has(p)){const y=f.concat([E]);l.push({op:i,path:y,value:p}),h.unshift({op:n,path:y,value:p})}E++}),E=0,g.forEach(p=>{if(!b.has(p)){const y=f.concat([E]);l.push({op:n,path:y,value:p}),h.unshift({op:i,path:y,value:p})}E++})}function T(I,f,l,h){l.push({op:r,path:[],value:f===Rr?void 0:f}),h.push({op:r,path:[],value:I})}function D(I,f){return f.forEach(l=>{const{path:h,op:b}=l;let g=I;for(let k=0;k<h.length-1;k++){const C=jt(g);let M=h[k];typeof M!="string"&&typeof M!="number"&&(M=""+M),(C===0||C===1)&&(M==="__proto__"||M==="constructor")&&B(19),typeof g=="function"&&M==="prototype"&&B(19),g=Cr(g,M),typeof g!="object"&&B(18,h.join("/"))}const E=jt(g),p=v(l.value),y=h[h.length-1];switch(b){case r:switch(E){case 2:return g.set(y,p);case 3:B(16);default:return g[y]=p}case n:switch(E){case 1:return y==="-"?g.push(p):g.splice(y,0,p);case 2:return g.set(y,p);case 3:return g.add(p);default:return g[y]=p}case i:switch(E){case 1:return g.splice(y,1);case 2:return g.delete(y);case 3:return g.delete(l.value);default:return delete g[y]}default:B(17,b)}}),I}function v(I){if(!Ct(I))return I;if(Array.isArray(I))return I.map(v);if(ke(I))return new Map(Array.from(I.entries()).map(([l,h])=>[l,v(h)]));if(we(I))return new Set(Array.from(I).map(v));const f=Object.create(Ft(I));for(const l in I)f[l]=v(I[l]);return Ae(I,Se)&&(f[Se]=I[Se]),f}function N(I){return Ht(I)?v(I):I}ra("Patches",{applyPatches_:D,generatePatches_:s,generateReplacementPatches_:T})}var pt=new oa,ua=pt.produce;pt.produceWithPatches.bind(pt),pt.setAutoFreeze.bind(pt),pt.setUseStrictShallowCopy.bind(pt);var la=pt.applyPatches.bind(pt);pt.createDraft.bind(pt),pt.finishDraft.bind(pt);var fa=1/0,da=9007199254740991,pa="[object Arguments]",ha="[object Function]",ma="[object GeneratorFunction]",ya="[object Symbol]",_a=typeof mt=="object"&&mt&&mt.Object===Object&&mt,Ia=typeof self=="object"&&self&&self.Object===Object&&self,ga=_a||Ia||Function("return this")();function ba(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}function Ea(t,r){for(var n=-1,i=t?t.length:0,s=Array(i);++n<i;)s[n]=r(t[n],n,t);return s}function va(t,r){for(var n=-1,i=r.length,s=t.length;++n<i;)t[s+n]=r[n];return t}var Ur=Object.prototype,Sa=Ur.hasOwnProperty,Xr=Ur.toString,mi=ga.Symbol,Ta=Ur.propertyIsEnumerable,yi=mi?mi.isConcatSpreadable:void 0,_i=Math.max;function Aa(t,r,n,i,s){var c=-1,d=t.length;for(n||(n=Ma),s||(s=[]);++c<d;){var m=t[c];n(m)?va(s,m):s[s.length]=m}return s}function ka(t,r){return t=Object(t),wa(t,r,function(n,i){return i in t})}function wa(t,r,n){for(var i=-1,s=r.length,c={};++i<s;){var d=r[i],m=t[d];n(m,d)&&(c[d]=m)}return c}function Da(t,r){return r=_i(r===void 0?t.length-1:r,0),function(){for(var n=arguments,i=-1,s=_i(n.length-r,0),c=Array(s);++i<s;)c[i]=n[r+i];i=-1;for(var d=Array(r+1);++i<r;)d[i]=n[i];return d[r]=c,ba(t,this,d)}}function Ma(t){return Ra(t)||Pa(t)||!!(yi&&t&&t[yi])}function Oa(t){if(typeof t=="string"||Ha(t))return t;var r=t+"";return r=="0"&&1/t==-fa?"-0":r}function Pa(t){return La(t)&&Sa.call(t,"callee")&&(!Ta.call(t,"callee")||Xr.call(t)==pa)}var Ra=Array.isArray;function Ca(t){return t!=null&&Na(t.length)&&!xa(t)}function La(t){return Ii(t)&&Ca(t)}function xa(t){var r=Fa(t)?Xr.call(t):"";return r==ha||r==ma}function Na(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=da}function Fa(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function Ii(t){return!!t&&typeof t=="object"}function Ha(t){return typeof t=="symbol"||Ii(t)&&Xr.call(t)==ya}var ja=Da(function(t,r){return t==null?{}:ka(t,Ea(Aa(r),Oa))}),$a=ja;const gi=Or($a),Ya={size:{width:1080,height:1920},tracks:[],trackItemIds:[],trackItemsMap:{},transitionIds:[],transitionsMap:{},scale:{unit:1,zoom:1,segments:1,index:1},duration:0,activeIds:[],trackItemDetailsMap:{},structure:[]},bi=["tracks","trackItemsMap","trackItemDetailsMap","transitionIds","transitionsMap","trackItemIds"];class za{constructor(r){ee(this,"stateSubject");ee(this,"stateHistorySubject");ee(this,"prevState");ee(this,"undos",[]);ee(this,"redos",[]);ee(this,"listener");const n=r||Ya;this.stateSubject=new Wn(n),this.stateHistorySubject=new Wn({handleRedo:!1,handleUndo:!1}),this.prevState=n,this.initListeners()}initListeners(){Ji(this)}destroyListeners(){this.listener&&this.listener.unsubscribe()}purge(){this.destroyListeners()}updateHistory(r,n){const i=gi(r,bi),s=gi(this.getState(),bi),c=ni(s,i);c.length&&(this.undos.push({undos:c,type:n}),this.redos=[])}getStateHistory(){return this.stateHistorySubject.getValue()}subscribeHistory(r){return this.stateHistorySubject.subscribe(r)}getState(){return this.stateSubject.getValue()}subscribe(r){return this.stateSubject.subscribe(r)}updateState(r,n={updateHistory:!1}){const i=this.getState(),s={...i,...r};it(i,s)||(n.updateHistory&&this.updateHistory(s,n.kind),this.prevState=i,this.stateSubject.next(s))}subscribeToSize(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.size,this.prevState.size)||r({size:n.size})})}subscribeToScale(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.scale,this.prevState.scale)||r({scale:n.scale})})}subscribeToUpdateTrackItem(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemsMap,this.prevState.trackItemsMap)||r({trackItemsMap:n.trackItemsMap})})}subscribeToUpdateItemDetails(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||r({trackItemDetailsMap:n.trackItemDetailsMap})})}subscribeToDuration(r){return this.stateSubject.asObservable().subscribe(n=>{n.duration!==this.prevState.duration&&r({duration:n.duration})})}subscribeToHistory(r){return this.stateHistorySubject.asObservable().subscribe(n=>{if(n.handleRedo){const i=this.undos[this.undos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}if(n.handleUndo){const i=this.redos[this.redos.length-1].type;i==="update"&&r({...this.getState(),type:i}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!1})}})}subscribeToAddOrRemoveItems(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.tracks,this.prevState.tracks))&&r({trackItemIds:n.trackItemIds})})}subscribeToActiveIds(r){return this.stateSubject.asObservable().subscribe(n=>{it(n.activeIds,this.prevState.activeIds)||r({activeIds:n.activeIds})})}subscribeToTracks(r){return this.stateSubject.asObservable().subscribe(n=>{(!it(n.tracks,this.prevState.tracks)||!it(n.trackItemIds,this.prevState.trackItemIds)||!it(n.trackItemsMap,this.prevState.trackItemsMap)||!it(n.transitionIds,this.prevState.transitionIds)||!it(n.transitionsMap,this.prevState.transitionsMap)||!it(n.trackItemDetailsMap,this.prevState.trackItemDetailsMap)||!it(n.structure,this.prevState.structure))&&r({tracks:n.tracks,trackItemIds:n.trackItemIds,trackItemsMap:n.trackItemsMap,transitionIds:n.transitionIds,transitionsMap:n.transitionsMap,trackItemDetailsMap:n.trackItemDetailsMap,structure:n.structure})})}undo(){const r=this.undos.pop(),n=r==null?void 0:r.undos,i=r==null?void 0:r.type;if(!n||!i)return;hi();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:m,transitionsMap:T,trackItemsMap:D}=this.getState(),v=tt({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:m,transitionsMap:T,trackItemsMap:D}),N=[],I=[],f=[],l=[],h=[],b=[];n.forEach(A=>{let P;const G=A.path.slice(1);A.type==="CREATE"?P={path:G,op:"remove",value:A.value}:A.type==="CHANGE"?P={path:G,op:"replace",value:A.oldValue}:P={path:G,op:"add",value:A.oldValue},A.path.includes("trackItemIds")?f.push(P):A.path.includes("transitionIds")?I.push(P):A.path.includes("trackItemsMap")?h.push(P):A.path.includes("transitionsMap")?l.push(P):A.path.includes("tracks")?N.push(P):A.path.includes("trackItemDetailsMap")&&b.push(P)});const g=this.applyPatch(v.tracks,N),E=this.applyPatch(v.transitionIds,I),p=this.applyPatch(v.trackItemIds,f),y=this.applyPatch(v.transitionsMap,l),k=this.applyPatch(v.trackItemsMap,h),C=this.applyPatch(v.trackItemDetailsMap,b),M=tt({tracks:g,transitionIds:E,trackItemIds:p,transitionsMap:y,trackItemsMap:k,trackItemDetailsMap:C}),x=tt(this.getState()),F={...x,...M};this.prevState=x,this.redos.push({redos:n,type:i});const L=Nt(F.trackItemsMap);this.stateSubject.next({...F,duration:L}),this.stateHistorySubject.next({handleRedo:!1,handleUndo:!0})}applyPatch(r,n){return n.reverse().reduce((i,s)=>ua(i,c=>{la(c,[s])}),r)}redo(){const r=this.redos.pop(),n=r==null?void 0:r.redos,i=r==null?void 0:r.type;if(!n||!i)return;hi();const{trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:m,transitionsMap:T,trackItemsMap:D}=this.getState(),v=tt({trackItemDetailsMap:s,trackItemIds:c,tracks:d,transitionIds:m,transitionsMap:T,trackItemsMap:D}),N=[],I=[],f=[],l=[],h=[],b=[];n.forEach(A=>{let P;const G=A.path.slice(1);A.type==="CREATE"?P={path:G,op:"add",value:A.value}:A.type==="CHANGE"?P={path:G,op:"replace",value:A.value}:P={path:G,op:"remove",value:A.oldValue},A.path.includes("trackItemIds")?f.push(P):A.path.includes("transitionIds")?I.push(P):A.path.includes("trackItemsMap")?h.push(P):A.path.includes("transitionsMap")?l.push(P):A.path.includes("trackItemDetailsMap")?b.push(P):N.push(P)});const g=this.applyPatch(v.tracks,N),E=this.applyPatch(v.transitionIds,I),p=this.applyPatch(v.trackItemIds,f),y=this.applyPatch(v.transitionsMap,l),k=this.applyPatch(v.trackItemsMap,h),C=this.applyPatch(v.trackItemDetailsMap,b),M=tt({tracks:g,transitionIds:E,trackItemIds:p,transitionsMap:y,trackItemsMap:k,trackItemDetailsMap:C}),x=tt(this.getState()),F={...x,...M};this.prevState=x,this.undos.push({undos:n,type:i});const L=Nt(F.trackItemsMap);this.stateSubject.next({...F,duration:L}),this.stateHistorySubject.next({handleRedo:!0,handleUndo:!1})}}const Ga="add",Ei="track",vi="trackItems",Ua=`${Ei}:changed`,Xa=`${vi}:changed`,Si="state",Wa=`${Si}:changed`,Wr="design",Ka=`${Wr}:load`,Ba=`${Wr}:resize`,yt="add",Va=`${yt}:text`,Za=`${yt}:video`,Ja=`${yt}:audio`,qa=`${yt}:placeholder`,Qa=`${yt}:image`,ts=`${yt}:mask`,Ti=`${yt}:items`,es=`${yt}:transition`,rs=`${yt}:animation`,ns=`${yt}:caption`,is=`${yt}:template`,zt="edit",as=`${zt}:object`,ss=`${zt}:text`,os=`${zt}:shape`,cs=`${zt}:templateItem`,us=`${zt}:closeTemplate`,ls=`${zt}:deleteTemplateItem`,fs="enterEditMode",Gt="player",ds=`${Gt}:play`,ps=`${Gt}:pause`,hs=`${Gt}:seek`,ms=`${Gt}:seekTo`,ys=`${Gt}:seekBy`,_s=`${Gt}:togglePlay`,ne="active",Is=`${ne}:set`,gs=`${ne}:delete`,bs=`${ne}:paste`,Es=`${ne}:clone`,vs=`${ne}:split`,at="layer",Ss=`${at}:locked`,Ts=`${at}:hidden`,As=`${at}:move`,ks=`${at}:select`,ws=`${at}:selection`,Ds=`${at}:sendTo`,Ms=`${at}:rename`,Os=`${at}:editingName`,Ps=`${at}:copy`,Rs=`${at}:paste`,Cs=`${at}:clone`,Ls=`${at}:split`,xs=`${at}:cut`,Ns=`${at}:delete`,ir="history",Fs=`${ir}:undo`,Hs=`${ir}:redo`,js=`${ir}:reset`,Ai="scale",$s=`${Ai}:changed`,Kr="drag",Ys=`${Kr}:start`,zs=`${Kr}:end`,ki="timeline",Gs=`${ki}:boundingChanged`;_.ACTIVE_CLONE=Es,_.ACTIVE_DELETE=gs,_.ACTIVE_PASTE=bs,_.ACTIVE_PREFIX=ne,_.ACTIVE_SET=Is,_.ACTIVE_SPLIT=vs,_.ADD_ANIMATION=rs,_.ADD_AUDIO=Ja,_.ADD_CAPTION=ns,_.ADD_IMAGE=Qa,_.ADD_ITEMS=Ti,_.ADD_MASK=ts,_.ADD_PLACEHOLDER=qa,_.ADD_PREFIX=yt,_.ADD_SUFFIX=Ga,_.ADD_TEMPLATE=is,_.ADD_TEXT=Va,_.ADD_TRANSITION=es,_.ADD_VIDEO=Za,_.CLOSE_EDIT_TEMPLATE=us,_.DELETE_TEMPLATE_ITEM=ls,_.DESIGN_LOAD=Ka,_.DESIGN_PREFIX=Wr,_.DESIGN_RESIZE=Ba,_.DRAG_END=zs,_.DRAG_PREFIX=Kr,_.DRAG_START=Ys,_.EDIT_OBJECT=as,_.EDIT_PREFIX=zt,_.EDIT_SHAPE=os,_.EDIT_TEMPLATE_ITEM=cs,_.EDIT_TEXT=ss,_.ENTER_EDIT_MODE=fs,_.HISTORY_PREFIX=ir,_.HISTORY_REDO=Hs,_.HISTORY_RESET=js,_.HISTORY_UNDO=Fs,_.LAYER_CLONE=Cs,_.LAYER_COPY=Ps,_.LAYER_CUT=xs,_.LAYER_DELETE=Ns,_.LAYER_EDITING_NAME=Os,_.LAYER_HIDDEN=Ts,_.LAYER_LOCKED=Ss,_.LAYER_MOVE=As,_.LAYER_PASTE=Rs,_.LAYER_PREFIX=at,_.LAYER_RENAME=Ms,_.LAYER_SELECT=ks,_.LAYER_SELECTION=ws,_.LAYER_SEND_TO=Ds,_.LAYER_SPLIT=Ls,_.PLAYER_PAUSE=ps,_.PLAYER_PLAY=ds,_.PLAYER_PREFIX=Gt,_.PLAYER_SEEK=hs,_.PLAYER_SEEK_BY=ys,_.PLAYER_SEEK_TO=ms,_.PLAYER_TOGGLE_PLAY=_s,_.STATE_CHANGED=Wa,_.STATE_PREFIX=Si,_.TIMELINE_BOUNDING_CHANGED=Gs,_.TIMELINE_PREFIX=ki,_.TIMELINE_SCALE_CHANGED=$s,_.TIMELINE_SCALE_PREFIX=Ai,_.TRACKS_CHANGED=Ua,_.TRACK_ITEMS_CHANGED=Xa,_.TRACK_ITEMS_PREFIX=vi,_.TRACK_PREFIX=Ei,_.default=za,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@designcombo/state",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.39",
|
4
4
|
"private": false,
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -24,9 +24,9 @@
|
|
24
24
|
"typescript": "^5.3.3",
|
25
25
|
"vite": "^5.2.0",
|
26
26
|
"vite-plugin-dts": "^3.9.1",
|
27
|
-
"@designcombo/
|
28
|
-
"@designcombo/
|
29
|
-
"@designcombo/
|
27
|
+
"@designcombo/types": "0.1.39",
|
28
|
+
"@designcombo/typescript-config": "0.0.0",
|
29
|
+
"@designcombo/events": "0.1.39"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
32
|
"immer": "^10.1.1",
|
@@ -38,8 +38,8 @@
|
|
38
38
|
"nanoid": "^5.0.7"
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|
41
|
-
"@designcombo/events": "0.1.
|
42
|
-
"@designcombo/types": "0.1.
|
41
|
+
"@designcombo/events": "0.1.39",
|
42
|
+
"@designcombo/types": "0.1.39"
|
43
43
|
},
|
44
44
|
"scripts": {
|
45
45
|
"dev": "vite",
|