File Manager
Viewing File: 47.js
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{G4qV:function(t,e,r){"use strict";function n(t,e){return t===e}function o(t,e,r){if(null===e||null===r||e.length!==r.length)return!1;for(var n=e.length,o=0;o<n;o++)if(!t(e[o],r[o]))return!1;return!0}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,r=null,i=null;return function(){return o(e,r,arguments)||(i=t.apply(null,arguments)),r=arguments,i}}function u(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every((function(t){return"function"==typeof t}))){var r=e.map((function(t){return typeof t})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return e}r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return c}));var c=function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];var i=0,c=n.pop(),a=u(n),s=t.apply(void 0,[function(){return i++,c.apply(null,arguments)}].concat(r)),l=t((function(){for(var t=[],e=a.length,r=0;r<e;r++)t.push(a[r].apply(null,arguments));return s.apply(null,t)}));return l.resultFunc=c,l.dependencies=a,l.recomputations=function(){return i},l.resetRecomputations=function(){return i=0},l}}(i)},TkhF:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));function n(t){return t.startsWith("###")}},fgbt:function(t,e,r){"use strict";r.r(e),r.d(e,"isIDCExchangeByProductId",(function(){return n})),r.d(e,"isIDCExchange",(function(){return o}));r("bSeV");function n(t,e){void 0===e&&(e=!1);var r=window.pro,n=r.getProduct(t);return!!r.isProductDefined(n)&&(e?!!n.idc_service_codes_delay:!!n.idc_service_codes)}function o(t,e){if(void 0===e&&(e=!1),t&&t.startsWith("exchange-"))return n(t,e);var r=(t||"").toLowerCase();return window.pro.getIDCExchanges(e).includes(r)}},i7Pf:function(t,e,r){"use strict";function n(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function o(t){return!!t&&!!t[B]}function i(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return"function"==typeof r&&Function.toString.call(r)===L}(t)||Array.isArray(t)||!!t[G]||!!t.constructor[G]||p(t)||y(t))}function u(t,e,r){void 0===r&&(r=!1),0===c(t)?(r?Object.keys:$)(t).forEach((function(n){r&&"symbol"==typeof n||e(n,t[n],t)})):t.forEach((function(r,n){return e(n,r,t)}))}function c(t){var e=t[B];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:p(t)?2:y(t)?3:0}function a(t,e){return 2===c(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function s(t,e){return 2===c(t)?t.get(e):t[e]}function l(t,e,r){var n=c(t);2===n?t.set(e,r):3===n?(t.delete(e),t.add(r)):t[e]=r}function f(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function p(t){
return W&&t instanceof Map}function y(t){return U&&t instanceof Set}function d(t){return t.o||t.t}function b(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=H(t);delete e[B];for(var r=$(e),n=0;n<r.length;n++){var o=r[n],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]})}return Object.create(Object.getPrototypeOf(t),e)}function v(t,e){return void 0===e&&(e=!1),h(t)||o(t)||!i(t)||(c(t)>1&&(t.set=t.add=t.clear=t.delete=m),Object.freeze(t),e&&u(t,(function(t,e){return v(e,!0)}),!0)),t}function m(){n(2)}function h(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function g(t){var e=Q[t];return e||n(18,t),e}function O(t,e){Q[t]||(Q[t]=e)}function S(){return K}function w(t,e){e&&(g("Patches"),t.u=[],t.s=[],t.v=e)}function j(t){P(t),t.p.forEach(_),t.p=null}function P(t){t===K&&(K=t.l)}function A(t){return K={p:[],l:K,h:t,m:!0,_:0}}function _(t){var e=t[B];0===e.i||1===e.i?e.j():e.g=!0}function x(t,e){e._=e.p.length;var r=e.p[0],o=void 0!==t&&t!==r;return e.h.O||g("ES5").S(e,t,o),o?(r[B].P&&(j(e),n(4)),i(t)&&(t=E(e,t),e.l||C(e,t)),e.u&&g("Patches").M(r[B],t,e.u,e.s)):t=E(e,r,[]),j(e),e.u&&e.v(e.u,e.s),t!==X?t:void 0}function E(t,e,r){if(h(e))return e;var n=e[B];if(!n)return u(e,(function(o,i){return k(t,n,e,o,i,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return C(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=b(n.k):n.o;u(3===n.i?new Set(o):o,(function(e,i){return k(t,n,o,e,i,r)})),C(t,o,!1),r&&t.u&&g("Patches").R(n,r,t.u,t.s)}return n.o}function k(t,e,r,n,u,c){if(o(u)){var s=E(t,u,c&&e&&3!==e.i&&!a(e.D,n)?c.concat(n):void 0);if(l(r,n,s),!o(s))return;t.m=!1}if(i(u)&&!h(u)){if(!t.h.F&&t._<1)return;E(t,u),e&&e.A.l||C(t,u)}}function C(t,e,r){void 0===r&&(r=!1),t.h.F&&t.m&&v(e,r)}function D(t,e){var r=t[B];return(r?d(r):t)[e]}function R(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function F(t){t.P||(t.P=!0,t.l&&F(t.l))}function I(t){t.o||(t.o=b(t.t))}function M(t,e,r){var n=p(e)?g("MapSet").N(e,r):y(e)?g("MapSet").T(e,r):t.O?function(t,e){var r=Array.isArray(t),n={i:r?1:0,A:e?e.A:S(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},o=n,i=Y;r&&(o=[n],i=Z);var u=Proxy.revocable(o,i),c=u.revoke,a=u.proxy;return n.k=a,n.j=c,a}(e,r):g("ES5").J(e,r);return(r?r.A:S()).p.push(n),n}function N(t){return o(t)||n(22,t),function t(e){if(!i(e))return e;var r,n=e[B],o=c(e);if(n){if(!n.P&&(n.i<4||!g("ES5").K(n)))return n.t;n.I=!0,r=z(e,o),n.I=!1}else r=z(e,o);return u(r,(function(e,o){n&&s(n.t,e)===o||l(r,e,t(o))})),3===o?new Set(r):r}(t)}function z(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return b(t)}function T(){function t(t,e){var r=i[t];return r?r.enumerable=e:i[t]=r={configurable:!0,enumerable:e,get:function(){var e=this[B];return Y.get(e,t)},set:function(e){var r=this[B];Y.set(r,t,e)}},r}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][B];if(!o.P)switch(o.i){case 5:n(o)&&F(o);break
;case 4:r(o)&&F(o)}}}function r(t){for(var e=t.t,r=t.k,n=$(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==B){var u=e[i];if(void 0===u&&!a(e,i))return!0;var c=r[i],s=c&&c[B];if(s?s.t!==u:!f(c,u))return!0}}var l=!!e[B];return n.length!==$(e).length+(l?0:1)}function n(t){var e=t.k;if(e.length!==t.t.length)return!0;var r=Object.getOwnPropertyDescriptor(e,e.length-1);return!(!r||r.get)}var i={};O("ES5",{J:function(e,r){var n=Array.isArray(e),o=function(e,r){if(e){for(var n=Array(r.length),o=0;o<r.length;o++)Object.defineProperty(n,""+o,t(o,!0));return n}var i=H(r);delete i[B];for(var u=$(i),c=0;c<u.length;c++){var a=u[c];i[a]=t(a,e||!!i[a].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,e),i={i:n?5:4,A:r?r.A:S(),P:!1,I:!1,D:{},l:r,t:e,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,B,{value:i,writable:!0}),o},S:function(t,r,i){i?o(r)&&r[B].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var r=e[B];if(r){var o=r.t,i=r.k,c=r.D,s=r.i;if(4===s)u(i,(function(e){e!==B&&(void 0!==o[e]||a(o,e)?c[e]||t(i[e]):(c[e]=!0,F(r)))})),u(o,(function(t){void 0!==i[t]||a(i,t)||(c[t]=!1,F(r))}));else if(5===s){if(n(r)&&(F(r),c.length=!0),i.length<o.length)for(var l=i.length;l<o.length;l++)c[l]=!1;else for(var f=o.length;f<i.length;f++)c[f]=!0;for(var p=Math.min(i.length,o.length),y=0;y<p;y++)void 0===c[y]&&t(i[y])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?r(t):n(t)}})}var q,K,J="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),W="undefined"!=typeof Map,U="undefined"!=typeof Set,V="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,X=J?Symbol.for("immer-nothing"):((q={})["immer-nothing"]=!0,q),G=J?Symbol.for("immer-draftable"):"__$immer_draftable",B=J?Symbol.for("immer-state"):"__$immer_state",L=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),$="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,H=Object.getOwnPropertyDescriptors||function(t){var e={};return $(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},Q={},Y={get:function(t,e){if(e===B)return t;var r=d(t);if(!a(r,e))return function(t,e,r){var n,o=R(e,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(t.k):void 0}(t,r,e);var n=r[e];return t.I||!i(n)?n:n===D(t.t,e)?(I(t),t.o[e]=M(t.A.h,n,t)):n},has:function(t,e){return e in d(t)},ownKeys:function(t){return Reflect.ownKeys(d(t))},set:function(t,e,r){var n=R(d(t),e);if(null==n?void 0:n.set)return n.set.call(t.k,r),!0;if(!t.P){var o=D(d(t),e),i=null==o?void 0:o[B];if(i&&i.t===r)return t.o[e]=r,t.D[e]=!1,!0;if(f(r,o)&&(void 0!==r||a(t.t,e)))return!0;I(t),F(t)}return t.o[e]===r&&"number"!=typeof r||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==D(t.t,e)||e in t.t?(t.D[e]=!1,I(t),F(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=d(t),n=Reflect.getOwnPropertyDescriptor(r,e)
;return n?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:n.enumerable,value:r[e]}:n},defineProperty:function(){n(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){n(12)}},Z={};u(Y,(function(t,e){Z[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Z.deleteProperty=function(t,e){return Y.deleteProperty.call(this,t[0],e)},Z.set=function(t,e,r){return Y.set.call(this,t[0],e,r,t[0])};var tt=new(function(){function t(t){var e=this;this.O=V,this.F=!0,this.produce=function(t,r,o){if("function"==typeof t&&"function"!=typeof r){var u=r;r=t;var c=e;return function(t){var e=this;void 0===t&&(t=u);for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return c.produce(t,(function(t){var n;return(n=r).call.apply(n,[e,t].concat(o))}))}}var a;if("function"!=typeof r&&n(6),void 0!==o&&"function"!=typeof o&&n(7),i(t)){var s=A(e),l=M(e,t,void 0),f=!0;try{a=r(l),f=!1}finally{f?j(s):P(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return w(s,o),x(t,s)}),(function(t){throw j(s),t})):(w(s,o),x(a,s))}if(!t||"object"!=typeof t){if((a=r(t))===X)return;return void 0===a&&(a=t),e.F&&v(a,!0),a}n(21,t)},this.produceWithPatches=function(t,r){return"function"==typeof t?function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return e.produceWithPatches(r,(function(e){return t.apply(void 0,[e].concat(o))}))}:[e.produce(t,r,(function(t,e){n=t,o=e})),n,o];var n,o},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){i(t)||n(8),o(t)&&(t=N(t));var e=A(this),r=M(this,t,void 0);return r[B].C=!0,P(e),r},e.finishDraft=function(t,e){var r=(t&&t[B]).A;return w(r,e),x(void 0,r)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!V&&n(20),this.O=t},e.applyPatches=function(t,e){var r;for(r=e.length-1;r>=0;r--){var n=e[r];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}var i=g("Patches").$;return o(t)?i(t,e):this.produce(t,(function(t){return i(t,e.slice(r+1))}))},t}()),et=tt.produce,rt=(tt.produceWithPatches.bind(tt),tt.setAutoFreeze.bind(tt),tt.setUseProxies.bind(tt),tt.applyPatches.bind(tt),tt.createDraft.bind(tt),tt.finishDraft.bind(tt),et),nt=r("ANjH");r("G4qV");function ot(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(o){return"function"==typeof o?o(r,n,t):e(o)}}}}var it=ot();it.withExtraArgument=ot;var ut=it;r.d(e,"a",(function(){return mt})),r.d(e,"b",(function(){return Ot})),r.d(e,"c",(function(){return vt}));function ct(){return(ct=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function at(t){return(at=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function st(t,e){
return(st=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function lt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function ft(t,e,r){return(ft=lt()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&st(o,r.prototype),o}).apply(null,arguments)}function pt(t){var e="function"==typeof Map?new Map:void 0;return(pt=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return ft(t,arguments,at(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),st(r,t)})(t)}var yt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?nt.compose:nt.compose.apply(null,arguments)};function dt(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}var bt=function(t){var e,r;function n(){return t.apply(this,arguments)||this}r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r;var o=n.prototype;return o.concat=function(){for(var e,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return ft(n,(e=t.prototype.concat).call.apply(e,[this].concat(o)))},o.prepend=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return 1===e.length&&Array.isArray(e[0])?ft(n,e[0].concat(this)):ft(n,e.concat(this))},n}(pt(Array));function vt(t){void 0===t&&(t={});var e=t,r=e.thunk,n=void 0===r||r,o=(e.immutableCheck,e.serializableCheck,new bt);return n&&(!function(t){return"boolean"==typeof t}(n)?o.push(ut.withExtraArgument(n.extraArgument)):o.push(ut)),o}function mt(t){var e,r=function(t){return vt(t)},n=t||{},o=n.reducer,i=void 0===o?void 0:o,u=n.middleware,c=void 0===u?r():u,a=n.devTools,s=void 0===a||a,l=n.preloadedState,f=void 0===l?void 0:l,p=n.enhancers,y=void 0===p?void 0:p;if("function"==typeof i)e=i;else{if(!dt(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=Object(nt.combineReducers)(i)}var d=nt.applyMiddleware.apply(void 0,"function"==typeof c?c(r):c),b=nt.compose;s&&(b=yt(ct({trace:!1},"object"==typeof s&&s)));var v=[d];Array.isArray(y)?v=[d].concat(y):"function"==typeof y&&(v=y(v));var m=b.apply(void 0,v);return Object(nt.createStore)(e,f,m)}function ht(t,e){function r(){if(e){var r=e.apply(void 0,arguments);if(!r)throw new Error("prepareAction did not return an object");return ct({type:t,
payload:r.payload},"meta"in r&&{meta:r.meta},{},"error"in r&&{error:r.error})}return{type:t,payload:arguments.length<=0?void 0:arguments[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(e){return e.type===t},r}function gt(t){var e,r={},n=[],o={addCase:function(t,e){var n="string"==typeof t?t:t.type;if(n in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[n]=e,o},addMatcher:function(t,e){return n.push({matcher:t,reducer:e}),o},addDefaultCase:function(t){return e=t,o}};return t(o),[r,n,e]}function Ot(t){var e=t.name,r=t.initialState;if(!e)throw new Error("`name` is a required option for createSlice");var n=t.reducers||{},u=void 0===t.extraReducers?[]:"function"==typeof t.extraReducers?gt(t.extraReducers):[t.extraReducers],c=u[0],a=void 0===c?{}:c,s=u[1],l=void 0===s?[]:s,f=u[2],p=void 0===f?void 0:f,y=Object.keys(n),d={},b={},v={};y.forEach((function(t){var r,o,i=n[t],u=e+"/"+t;"reducer"in i?(r=i.reducer,o=i.prepare):r=i,d[t]=r,b[u]=r,v[t]=o?ht(u,o):ht(u)}));var m=function(t,e,r,n){void 0===r&&(r=[]);var u="function"==typeof e?gt(e):[e,r,n],c=u[0],a=u[1],s=u[2];return function(e,r){void 0===e&&(e=t);var n=[c[r.type]].concat(a.filter((function(t){return(0,t.matcher)(r)})).map((function(t){return t.reducer})));return 0===n.filter((function(t){return!!t})).length&&(n=[s]),n.reduce((function(t,e){if(e){if(o(t)){var n=e(t,r);return void 0===n?t:n}if(i(t))return rt(t,(function(t){return e(t,r)}));var u=e(t,r);if(void 0===u){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return u}return t}),e)}}(r,ct({},a,{},b),l,p);return{name:e,reducer:m,actions:v,caseReducers:d}}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));T()},"j+67":function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return c})),r.d(e,"j",(function(){return a})),r.d(e,"k",(function(){return d})),r.d(e,"r",(function(){return b})),r.d(e,"q",(function(){return v})),r.d(e,"n",(function(){return m})),r.d(e,"o",(function(){return h})),r.d(e,"p",(function(){return g})),r.d(e,"c",(function(){return O})),r.d(e,"s",(function(){return S})),r.d(e,"m",(function(){return w})),r.d(e,"l",(function(){return j})),r.d(e,"d",(function(){return _})),r.d(e,"g",(function(){return x})),r.d(e,"f",(function(){return E})),r.d(e,"h",(function(){return k})),r.d(e,"e",(function(){return C})),r.d(e,"i",(function(){return D}));var n,o=r("i7Pf"),i=r("Eyy1"),u=r("TkhF");!function(t){t.Red="red",t.Blue="blue",t.Green="green",t.Orange="orange",t.Purple="purple"}(n||(n={}));const c=[n.Red,n.Blue,n.Green,n.Orange,n.Purple];function a(t){return new Set(c).has(t)}const s={lists:{colors:[],byColor:{},bySymbol:{}},commands:[],timestamp:null,separators:!0};function l(t,e){const{lists:r}=t,n=r.byColor[e];n&&0===n.symbols.length&&(r.colors=r.colors.filter(t=>t!==e))}function f(t,e){
return t.separators&&Object(u.a)(e)}function p(t,e){return[...t].sort((t,r)=>e.indexOf(t.color)-e.indexOf(r.color))}const y=Object(o.b)({name:"marked-lists",initialState:s,reducers:{setup:(t,e)=>{const{separators:r,lists:n,timestamp:o}=e.payload,i={lists:{colors:[],byColor:{},bySymbol:{}},commands:[],timestamp:null,separators:!0};i.separators=r,i.timestamp=o;for(const u of p(n,c)){const t=u.symbols.filter(t=>void 0===i.lists.bySymbol[t]&&(f(i,t)||(i.lists.bySymbol[t]=u.color),!0));i.lists.byColor[u.color]={color:u.color,name:u.name,symbols:t},t.length>0&&i.lists.colors.push(u.color)}return i},remove:(t,e)=>{const{color:r,symbols:n,silent:o}=e.payload,{lists:i,commands:u}=t,c=i.byColor[r];if(void 0===c||0===c.symbols.length)return;const a=new Set(n),s=c.symbols.filter(t=>!a.has(t));if(!P(s,c.symbols)){c.symbols=s;for(const t of a)delete i.bySymbol[t];o||u.push({type:"remove",color:r,symbols:[...a]}),l(t,r)}},markMany:(t,e)=>{const{color:r,before:n,silent:o}=e.payload,{lists:u,commands:c}=t,a=Symbol(),s=(t,e,r)=>{const n=void 0===r?void 0!==e?t.indexOf(e):void 0:r===a?0:t.indexOf(r)+1;return-1!==n?n:void 0},{unique:p,exclusions:y}=function(t,e){var r;const{color:n,symbols:o,separators:u}=e.payload,{lists:c}=t,a={},s=new Set,l=e=>f(t,e)?(Object(i.assert)(null!==n),n):c.bySymbol[e];for(let i=0;i<o.length;++i){const e=o[i];if(s.has(e)||f(t,e)&&!u)continue;s.add(e);const n=l(e);if(void 0===n)continue;(a[n]=null!==(r=a[n])&&void 0!==r?r:new Set).add(e)}return{exclusions:a,unique:s}}(t,e);if(0===p.size)return;const d=function(t,e,r,n){const{color:o,before:i}=e.payload,{lists:u}=t;let c;if(null!==o&&void 0!==i&&r.has(i)){const t=u.byColor[o];if(void 0!==t){c=n;for(let e=t.symbols.indexOf(i);e>=0;--e)if(!r.has(t.symbols[e])){c=t.symbols[e];break}}}return c}(t,e,p,a);if(null!==r&&void 0!==y[r]&&1===Object.keys(y).length){const e=u.byColor[r];Object(i.assert)(void 0!==e);const a=e.symbols.filter(t=>!p.has(t)),b=s(a,n,d);if(void 0===b?a.push(...p):a.splice(b,0,...p),P(a,e.symbols))return;{const n=y[r];Object(i.assert)(void 0!==n),e.symbols=a;for(const t of n)delete u.bySymbol[t];for(const e of p)f(t,e)||(u.bySymbol[e]=r);return l(t,r),void(o||c.push({type:"replace",color:r,symbols:[...e.symbols]}))}}for(const f in y){if(!y.hasOwnProperty(f))continue;const e=y[f];Object(i.assert)(void 0!==e);const r=u.byColor[f];Object(i.assert)(void 0!==r),r.symbols=r.symbols.filter(t=>!e.has(t)||(delete u.bySymbol[t],!1)),l(t,f)}if(null===r)return void(o||c.push({type:"reset",symbols:[...p]}));const b=u.byColor[r];if(u.colors.includes(r)){Object(i.assert)(void 0!==b);const t=s(b.symbols,n,d);void 0===t?(b.symbols.push(...p),o||(void 0===y[r]?c.push({type:"append",color:r,symbols:[...p]}):c.push({type:"replace",color:r,symbols:[...b.symbols]}))):(b.symbols.splice(t,0,...p),o||c.push({type:"replace",color:r,symbols:[...b.symbols]}))}else void 0===b?u.byColor[r]={color:r,symbols:[...p],name:null}:b.symbols=[...p],u.colors.push(r),o||c.push({type:"append",color:r,symbols:[...p]});for(const i of p)f(t,i)||(u.bySymbol[i]=r)},renameSeparator:(t,e)=>{
const{color:r,separator:n,name:o,silent:u}=e.payload;if(n===o||!f(t,n)||!f(t,o))return;const c=t.lists.byColor[r];Object(i.assert)(void 0!==c);const a=c.symbols.indexOf(n);-1!==a&&-1===c.symbols.indexOf(o)&&(c.symbols.splice(a,1,o),u||t.commands.push({type:"replace",color:r,symbols:c.symbols}))},rename:(t,e)=>{const{name:r,color:n,silent:o}=e.payload,u=t.lists.byColor[n];Object(i.assert)(void 0!==u),u.name!==r&&(u.name=r,o||t.commands.push({type:"rename",color:n,name:r}))},reset:(t,e)=>{const{silent:r}=e.payload,{lists:n}=t;for(const o of c){const t=n.byColor[o];void 0!==t&&(t.symbols=[])}n.colors=[],n.bySymbol={},r||t.commands.push({type:"reset-all"})},activateSeparators:(t,e)=>{if(t.separators!==e.payload.value){if(t.separators=e.payload.value,t.separators)for(const e of Object.keys(t.lists.bySymbol))Object(u.a)(e)&&delete t.lists.bySymbol[e];else{const e=Object.values(t.lists.byColor).filter(t=>void 0!==t);for(const r of p(e,c))r.symbols=r.symbols.filter(e=>{if(!Object(u.a)(e))return!0;const n=void 0===t.lists.bySymbol[e];return n&&(t.lists.bySymbol[e]=r.color),n})}for(const e of c)l(t,e)}},shiftCommand:(t,e)=>{const{count:r}=e.payload;t.commands.splice(0,r)}}}),{markMany:d,setup:b,reset:v,remove:m,rename:h,renameSeparator:g,activateSeparators:O,shiftCommand:S}=y.actions,{reducer:w}=y,j={cast:t=>t,castMany:t=>t.map(j.cast)};function P(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}function A(t,e){return e.actions.markMany.match(t)||e.actions.rename.match(t)||e.actions.remove.match(t)||e.actions.setup.match(t)||e.actions.renameSeparator.match(t)||e.actions.reset.match(t)||e.actions.activateSeparators.match(t)}function _(t,e,r=y){return n=>(e.on("marked-list-cross-tab-sync",e=>{const{action:o,emitter:i}=JSON.parse(e);i!==t&&A(o,r)&&n.dispatch(Object.assign(Object.assign({},o),{payload:Object.assign(Object.assign({},o.payload),{silent:!0})}))}),n=>o=>{const i=n(o);return A(o,r)&&(o.payload.silent||e.emit("marked-list-cross-tab-sync",JSON.stringify({action:o,emitter:t}))),i})}function x(t,e){var r;return null!==(r=t.lists.bySymbol[j.cast(e)])&&void 0!==r?r:null}function E(t,e){var r;return null!==(r=t.lists.byColor[e])&&void 0!==r?r:null}function k(t,e){var r,n;return null!==(n=null===(r=E(t,e))||void 0===r?void 0:r.symbols)&&void 0!==n?n:null}function C(t){return t.commands}function D(t){return t.timestamp}}}]);