1import{d as xe}from"./pinia-BZRDrTuq.js";import{g as Ie}from"./matrix-BOdY2fbt.js";import{h as Me,g as ee,c as Fe,E as B,u as Be}from"./auth-Db5PsbJi.js";import{useUserActionStore as ce}from"./user_action-CI2HlQlJ.js";import"./shopping-DQnL2wMe.js";import"./vue-DhRW_Bdo.js";import"./member-BJuQ_RSS.js";import"./vuetify-D-QhuFO2.js";import"./accumulator-BmSov0uh.js";import"./index-B8bd3gKi.js";import"./device_action-dnYxxnu_.js";import"./index-CvhpDjto.js";import"./app-0wSrahwM.js";import"./theme-00tyXzne.js";import"./user_setting-BrkTZoVW.js";import"./notice-CqsQaO5L.js";var T=null;typeof WebSocket<"u"?T=WebSocket:typeof MozWebSocket<"u"?T=MozWebSocket:typeof window<"u"||typeof window<"u"?T=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(T=self.WebSocket||self.MozWebSocket);const Ue=T;var U={exports:{}},$={},X={exports:{}};var $e=X.exports,fe;function Pe(){return fe||(fe=1,(function(o){(function(s){function _(){}var l=_.prototype,c=s.EventEmitter;function y(e,n){for(var t=e.length;t--;)if(e[t].listener===n)return t;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}l.getListeners=function(n){var t=this._getEvents(),h,m;if(n instanceof RegExp){h={};for(m in t)t.hasOwnProperty(m)&&n.test(m)&&(h[m]=t[m])}else h=t[n]||(t[n]=[]);return h},l.flattenListeners=function(n){var t=[],h;for(h=0;h<n.length;h+=1)t.push(n[h].listener);return t},l.getListenersAsObject=function(n){var t=this.getListeners(n),h;return t instanceof Array&&(h={},h[n]=t),h||t};function u(e){return typeof e=="function"||e instanceof RegExp?!0:e&&typeof e=="object"?u(e.listener):!1}l.addListener=function(n,t){if(!u(t))throw new TypeError("listener must be a function");var h=this.getListenersAsObject(n),m=typeof t=="object",b;for(b in h)h.hasOwnProperty(b)&&y(h[b],t)===-1&&h[b].push(m?t:{listener:t,once:!1});return this},l.on=r("addListener"),l.addOnceListener=function(n,t){return this.addListener(n,{listener:t,once:!0})},l.once=r("addOnceListener"),l.defineEvent=function(n){return this.getListeners(n),this},l.defineEvents=function(n){for(var t=0;t<n.length;t+=1)this.defineEvent(n[t]);return this},l.removeListener=function(n,t){var h=this.getListenersAsObject(n),m,b;for(b in h)h.hasOwnProperty(b)&&(m=y(h[b],t),m!==-1&&h[b].splice(m,1));return this},l.off=r("removeListener"),l.addListeners=function(n,t){return this.manipulateListeners(!1,n,t)},l.removeListeners=function(n,t){return this.manipulateListeners(!0,n,t)},l.manipulateListeners=function(n,t,h){var m,b,C=n?this.removeListener:this.addListener,R=n?this.removeListeners:this.addListeners;if(typeof t=="object"&&!(t instanceof RegExp))for(m in t)t.hasOwnProperty(m)&&(b=t[m])&&(typeof b=="function"?C.call(this,m,b):R.call(this,m,b));else for(m=h.length;m--;)C.call(this,t,h[m]);return this},l.removeEvent=function(n){var t=typeof n,h=this._getEvents(),m;if(t==="string")delete h[n];else if(n instanceof RegExp)for(m in h)h.hasOwnProperty(m)&&n.test(m)&&delete h[m];else delete this._events;return this},l.removeAllListeners=r("removeEvent"),l.emitEvent=function(n,t){var h=this.getListenersAsObject(n),m,b,C,R,v;for(R in h)if(h.hasOwnProperty(R))for(m=h[R].slice(0),C=0;C<m.length;C++)b=m[C],b.once===!0&&this.removeListener(n,b.listener),v=b.listener.apply(this,t||[]),v===this._getOnceReturnValue()&&this.removeListener(n,b.listener);return this},l.trigger=r("emitEvent"),l.emit=function(n){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(n,t)},l.setOnceReturnValue=function(n){return this._onceReturnValue=n,this},l._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},l._getEvents=function(){return this._events||(this._events={})},_.noConflict=function(){return s.EventEmitter=c,_},o.exports?o.exports=_:s.EventEmitter=_})(typeof window<"u"?window:$e||{})})(X)),X.exports}var Q={},le;function Qe(){if(le)return Q;le=1,Object.defineProperty(Q,"__esModule",{value:!0});var o=(function(){function l(c,y){for(var r=0;r<y.length;r++){var u=y[r];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}return function(c,y,r){return y&&l(c.prototype,y),r&&l(c,r),c}})();
1function s(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var _=(function(){function l(c){s(this,l),this.consumer=c,this.paused=!1,this.queue=[]}return o(l,[{key:"pause",value:function(){this.paused=!0}},{key:"continue",value:function(){this.paused=!1,this.process()}},{key:"push",value:function(y){this.queue.push(y),this.process()}},{key:"unshift",value:function(y){this.queue.unshift(y),this.process()}},{key:"process",value:function(y){if(!this.paused&&this.queue.length!==0){var r=this.consumer(this.queue[0]);r&&(this.queue.shift(),this.paused||this.process())}}},{key:"empty",value:function(){this.queue=[]}}]),l})();return Q.default=_,Q}var G={},te={exports:{}},de;function ue(){return de||(de=1,(function(o){(function(){var s=[,(function(y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.lengthOf=r.keysOf=r.isObject=r.isInfOrNaN=r.isFunction=r.isArguments=r.hasOwn=r.handleError=r.convertMapToObject=r.checkError=void 0;function u(g,w){return m(g)||h(g,w)||n(g,w)||e()}function e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(g,w){if(g){if(typeof g=="string")return t(g,w);var k=Object.prototype.toString.call(g).slice(8,-1);if(k==="Object"&&g.constructor&&(k=g.constructor.name),k==="Map"||k==="Set")return Array.from(g);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return t(g,w)}}function t(g,w){(w==null||w>g.length)&&(w=g.length);for(var k=0,E=new Array(w);k<w;k++)E[k]=g[k];return E}function h(g,w){var k=g==null?null:typeof Symbol<"u"&&g[Symbol.iterator]||g["@@iterator"];if(k!=null){var E=[],A=!0,N=!1,j,P;try{for(k=k.call(g);!(A=(j=k.next()).done)&&(E.push(j.value),!(w&&E.length===w));A=!0);}catch(F){N=!0,P=F}finally{try{!A&&k.return!=null&&k.return()}finally{if(N)throw P}}return E}}function m(g){if(Array.isArray(g))return g}function b(g){"@babel/helpers - typeof";return b=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},b(g)}var C=function(w){return typeof w=="function"};r.isFunction=C;var R=function(w){return b(w)==="object"};r.isObject=R;var v=function(w){return Object.keys(w)};r.keysOf=v;var i=function(w){return Object.keys(w).length};r.lengthOf=i;var f=function(w,k){return Object.prototype.hasOwnProperty.call(w,k)};r.hasOwn=f;var p=function(w){return Array.from(w).reduce(function(k,E){var A=u(E,2),N=A[0],j=A[1];return k[N]=j,k},{})};r.convertMapToObject=p;var a=function(w){return w!=null&&f(w,"callee")};r.isArguments=a;var d=function(w){return Number.isNaN(w)||w===1/0||w===-1/0};r.isInfOrNaN=d;var O={maxStack:function(w){return new RegExp("Maximum call stack size exceeded","g").test(w)}};r.checkError=O;var S=function(w){return function(){try{return w.apply(this,arguments)}catch(E){var k=O.maxStack(E.message);throw k?new Error("Converting circular structure to JSON"):E}}};r.handleError=S}),(function(y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.Base64=void 0;for(var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=Object.create(null),n=function(i){return u.charAt(i)},t=function(i){return i==="="?-1:e[i]},h=0;h<u.length;h++)e[n(h)]=h;var m=function(i){if(typeof i=="string"){var f=i;i=b(f.length);for(var p=0;p<f.length;p++){var a=f.charCodeAt(p);if(a>255)throw new Error("Not ascii. Base64.encode can only take ascii strings.");
2i[p]=a}}for(var d=[],O=null,S=null,g=null,w=null,k=0;k<i.length;k++)switch(k%3){case 0:O=i[k]>>2&63,S=(i[k]&3)<<4;break;case 1:S=S|i[k]>>4&15,g=(i[k]&15)<<2;break;case 2:g=g|i[k]>>6&3,w=i[k]&63,d.push(n(O)),d.push(n(S)),d.push(n(g)),d.push(n(w)),O=null,S=null,g=null,w=null;break}return O!=null&&(d.push(n(O)),d.push(n(S)),g==null?d.push("="):d.push(n(g)),w==null&&d.push("=")),d.join("")},b=function(i){if(typeof Uint8Array>"u"||typeof ArrayBuffer>"u"){for(var f=[],p=0;p<i;p++)f.push(0);return f.$Uint8ArrayPolyfill=!0,f}return new Uint8Array(new ArrayBuffer(i))},C=function(i){var f=Math.floor(i.length*3/4);i.charAt(i.length-1)=="="&&(f--,i.charAt(i.length-2)=="="&&f--);for(var p=b(f),a=null,d=null,O=null,S=0,g=0;g<i.length;g++){var w=i.charAt(g),k=t(w);switch(g%4){case 0:if(k<0)throw new Error("invalid base64 string");a=k<<2;break;case 1:if(k<0)throw new Error("invalid base64 string");a=a|k>>4,p[S++]=a,d=(k&15)<<4;break;case 2:k>=0&&(d=d|k>>2,p[S++]=d,O=(k&3)<<6);break;case 3:k>=0&&(p[S++]=O|k);break}}return p},R={encode:m,decode:C,newBinary:b};r.Base64=R}),(function(y){y.exports={_noYieldsAllowed:function(u){return u()}}}),(function(y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;function u(m){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},u(m)}function e(m){return JSON.stringify(m)}var n=function m(b,C,R,v,i){var f=C[b];switch(u(f)){case"string":return e(f);case"number":return isFinite(f)?String(f):"null";case"boolean":return String(f);case"object":{if(!f)return"null";var p=v+R,a=[],d;if(Array.isArray(f)||{}.hasOwnProperty.call(f,"callee")){for(var O=f.length,S=0;S<O;S+=1)a[S]=m(S,f,R,p,i)||"null";return a.length===0?d="[]":p?d=`[ 3`+p+a.join(`, 4`+p)+` 5`+v+"]":d="["+a.join(",")+"]",d}var g=Object.keys(f);return i&&(g=g.sort()),g.forEach(function(w){d=m(w,f,R,p,i),d&&a.push(e(w)+(p?": ":":")+d)}),a.length===0?d="{}":p?d=`{ 6`+p+a.join(`, 7`+p)+` 8`+v+"}":d="{"+a.join(",")+"}",d}}},t=function(b,C){var R=Object.assign({indent:"",canonical:!1},C);if(R.indent===!0)R.indent=" ";else if(typeof R.indent=="number"){for(var v="",i=0;i<R.indent;i++)v+=" ";R.indent=v}return n("",{"":b},R.indent,"",R.canonical)},h=t;r.default=h,y.exports=r.default})],_={};function l(y){var r=_[y];if(r!==void 0)return r.exports;var u=_[y]={exports:{}};return s[y](u,u.exports,l),u.exports}var c={};(function(){var y=c,r=l(2).Base64,u=l(3);Object.defineProperty(y,"__esModule",{value:!0}),y.EJSON=void 0;var e=l(1),n={};y.EJSON=n;var t=new Map;n.addType=function(v,i){if(t.has(v))throw new Error("Type ".concat(v," already present"));t.set(v,i)};var h=[{matchJSONValue:function(i){return(0,e.hasOwn)(i,"$date")&&(0,e.lengthOf)(i)===1},matchObject:function(i){return i instanceof Date},toJSONValue:function(i){return{$date:i.getTime()}},fromJSONValue:function(i){return new Date(i.$date)}},{matchJSONValue:function(i){return(0,e.hasOwn)(i,"$regexp")&&(0,e.hasOwn)(i,"$flags")&&(0,e.lengthOf)(i)===2},matchObject:function(i){return i instanceof RegExp},toJSONValue:function(i){return{$regexp:i.source,$flags:i.flags}},fromJSONValue:function(i){return new RegExp(i.$regexp,i.$flags.slice(0,50).replace(/[^gimuy]/g,"").replace(/(.)(?=.*\1)/g,""))}},{matchJSONValue:function(i){return(0,e.hasOwn)(i,"$InfNaN")&&(0,e.lengthOf)(i)===1},matchObject:e.isInfOrNaN,toJSONValue:function(i){var f;return Number.isNaN(i)?f=0:i===1/0?f=1:f=-1,{$InfNaN:f}},fromJSONValue:function(i){return i.$InfNaN/0}},{matchJSONValue:function(i){return(0,e.hasOwn)(i,"$binary")&&(0,e.lengthOf)(i)===1},matchObject:function(i){return typeof Uint8Array<"u"&&i instanceof Uint8Array||i&&(0,e.hasOwn)(i,"$Uint8ArrayPolyfill")},toJSONValue:function(i){return{$binary:r.encode(i)}},fromJSONValue:function(i){return r.decode(i.$binary)}},{matchJSONValue:function(i){return(0,e.hasOwn)(i,"$escape")&&(0,e.lengthOf)(i)===1},matchObject:function(i){var f=!1;if(i){var p=(0,e.lengthOf)(i);(p===1||p===2)&&(f=h.some(function(a){return a.matchJSONValue(i)}))}return f},toJSONValue:function(i){var f={};
8return(0,e.keysOf)(i).forEach(function(p){f[p]=n.toJSONValue(i[p])}),{$escape:f}},fromJSONValue:function(i){var f={};return(0,e.keysOf)(i.$escape).forEach(function(p){f[p]=n.fromJSONValue(i.$escape[p])}),f}},{matchJSONValue:function(i){return(0,e.hasOwn)(i,"$type")&&(0,e.hasOwn)(i,"$value")&&(0,e.lengthOf)(i)===2},matchObject:function(i){return n._isCustomType(i)},toJSONValue:function(i){var f=u._noYieldsAllowed(function(){return i.toJSONValue()});return{$type:i.typeName(),$value:f}},fromJSONValue:function(i){var f=i.$type;if(!t.has(f))throw new Error("Custom EJSON type ".concat(f," is not defined"));var p=t.get(f);return u._noYieldsAllowed(function(){return p(i.$value)})}}];n._isCustomType=function(v){return v&&(0,e.isFunction)(v.toJSONValue)&&(0,e.isFunction)(v.typeName)&&t.has(v.typeName())},n._getTypes=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return v?t:(0,e.convertMapToObject)(t)},n._getConverters=function(){return h};var m=function(i){for(var f=0;f<h.length;f++){var p=h[f];if(p.matchObject(i))return p.toJSONValue(i)}},b=function v(i){if(i===null)return null;var f=m(i);return f!==void 0?f:((0,e.isObject)(i)&&(0,e.keysOf)(i).forEach(function(p){var a=i[p];if(!(!(0,e.isObject)(a)&&a!==void 0&&!(0,e.isInfOrNaN)(a))){var d=m(a);if(d){i[p]=d;return}v(a)}}),i)};n._adjustTypesToJSONValue=b,n.toJSONValue=function(v){var i=m(v);if(i!==void 0)return i;var f=v;return(0,e.isObject)(v)&&(f=n.clone(v),b(f)),f};var C=function(i){if((0,e.isObject)(i)&&i!==null){var f=(0,e.keysOf)(i);if(f.length<=2&&f.every(function(d){return typeof d=="string"&&d.substr(0,1)==="$"}))for(var p=0;p<h.length;p++){var a=h[p];if(a.matchJSONValue(i))return a.fromJSONValue(i)}}return i},R=function v(i){if(i===null)return null;var f=C(i);return f!==i?f:((0,e.isObject)(i)&&(0,e.keysOf)(i).forEach(function(p){var a=i[p];if((0,e.isObject)(a)){var d=C(a);if(a!==d){i[p]=d;return}v(a)}}),i)};n._adjustTypesFromJSONValue=R,n.fromJSONValue=function(v){var i=C(v);return i===v&&(0,e.isObject)(v)&&(i=n.clone(v),R(i)),i},n.stringify=(0,e.handleError)(function(v,i){var f,p=n.toJSONValue(v);if(i&&(i.canonical||i.indent)){var a=l(4);f=a(p,i)}else f=JSON.stringify(p);return f}),n.parse=function(v){if(typeof v!="string")throw new Error("EJSON.parse argument should be a string");return n.fromJSONValue(JSON.parse(v))},n.isBinary=function(v){return!!(typeof Uint8Array<"u"&&v instanceof Uint8Array||v&&v.$Uint8ArrayPolyfill)},n.equals=function(v,i,f){var p,a=!!(f&&f.keyOrderSensitive);if(v===i||Number.isNaN(v)&&Number.isNaN(i))return!0;if(!v||!i||!((0,e.isObject)(v)&&(0,e.isObject)(i)))return!1;if(v instanceof Date&&i instanceof Date)return v.valueOf()===i.valueOf();if(n.isBinary(v)&&n.isBinary(i)){if(v.length!==i.length)return!1;for(p=0;p<v.length;p++)if(v[p]!==i[p])return!1;return!0}if((0,e.isFunction)(v.equals))return v.equals(i,f);if((0,e.isFunction)(i.equals))return i.equals(v,f);var d=Array.isArray(v),O=Array.isArray(i);if(d!==O)return!1;if(d&&O){if(v.length!==i.length)return!1;for(p=0;p<v.length;p++)if(!n.equals(v[p],i[p],f))return!1;return!0}switch(n._isCustomType(v)+n._isCustomType(i)){case 1:return!1;case 2:return n.equals(n.toJSONValue(v),n.toJSONValue(i))}var S,g=(0,e.keysOf)(v),w=(0,e.keysOf)(i);return a?(p=0,S=g.every(function(k){return p>=w.length||k!==w[p]||!n.equals(v[k],i[w[p]],f)?!1:(p++,!0)})):(p=0,S=g.every(function(k){return!(0,e.hasOwn)(i,k)||!n.equals(v[k],i[k],f)?!1:(p++,!0)})),S&&p===w.length},n.clone=function(v){var i;if(!(0,e.isObject)(v))return v;if(v===null)return null;if(v instanceof Date)return new Date(v.getTime());if(v instanceof RegExp)return v;if(n.isBinary(v)){i=n.newBinary(v.length);for(var f=0;f<v.length;f++)i[f]=v[f];return i}return Array.isArray(v)?v.map(n.clone):(0,e.isArguments)(v)?Array.from(v).map(n.clone):(0,e.isFunction)(v.clone)?v.clone():n._isCustomType(v)?n.fromJSONValue(n.clone(n.toJSONValue(v)),!0):(i={},(0,e.keysOf)(v).forEach(function(p){i[p]=n.clone(v[p])}),i)},n.newBinary=r.newBinary})(),o.exports=c.EJSON})()})(te)),te.exports}var he;function Ge(){if(he)return G;
8he=1,Object.defineProperty(G,"__esModule",{value:!0});var o=(function(){function t(h,m){for(var b=0;b<m.length;b++){var C=m[b];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(h,C.key,C)}}return function(h,m,b){return m&&t(h.prototype,m),b&&t(h,b),h}})(),s=Pe(),_=y(s),l=ue(),c=y(l);function y(t){return t&&t.__esModule?t:{default:t}}function r(t,h){if(!(t instanceof h))throw new TypeError("Cannot call a class as a function")}function u(t,h){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:t}function e(t,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);t.prototype=Object.create(h&&h.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(t,h):t.__proto__=h)}var n=(function(t){e(h,t);function h(m,b){r(this,h);var C=u(this,(h.__proto__||Object.getPrototypeOf(h)).call(this));return C.SocketConstructor=m,C.endpoint=b,C.rawSocket=null,C}return o(h,[{key:"send",value:function(b){var C=c.default.stringify(b);this.rawSocket.send(C),this.emit("message:out",c.default.parse(C))}},{key:"open",value:function(){var b=this;this.rawSocket||(this.rawSocket=new this.SocketConstructor(this.endpoint),this.rawSocket.onopen=function(){return b.emit("open")},this.rawSocket.onclose=function(){b.rawSocket=null,b.emit("close")},this.rawSocket.onerror=function(){b.rawSocket&&b.rawSocket.onclose&&delete b.rawSocket.onclose,b.rawSocket.close(),b.rawSocket=null,b.emit("close")},this.rawSocket.onmessage=function(C){var R;try{R=c.default.parse(C.data)}catch{return}b.emit("message:in",R)})}},{key:"close",value:function(){this.rawSocket&&this.rawSocket.close()}}]),h})(_.default);return G.default=n,G}var V={},pe;function He(){if(pe)return V;pe=1,Object.defineProperty(V,"__esModule",{value:!0}),V.uniqueId=s,V.contains=_;var o=0;function s(){return(o++).toString()}function _(l,c){return l.indexOf(c)!==-1}return V}var ye;function We(){if(ye)return $;ye=1,Object.defineProperty($,"__esModule",{value:!0});var o=(function(){function i(f,p){for(var a=0;a<p.length;a++){var d=p[a];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(f,d.key,d)}}return function(f,p,a){return p&&i(f.prototype,p),a&&i(f,a),f}})(),s=function i(f,p,a){f===null&&(f=Function.prototype);var d=Object.getOwnPropertyDescriptor(f,p);if(d===void 0){var O=Object.getPrototypeOf(f);return O===null?void 0:i(O,p,a)}else{if("value"in d)return d.value;var S=d.get;return S===void 0?void 0:S.call(a)}},_=Pe(),l=n(_),c=Qe(),y=n(c),r=Ge(),u=n(r),e=He();function n(i){return i&&i.__esModule?i:{default:i}}function t(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}function h(i,f){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:i}function m(i,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);i.prototype=Object.create(f&&f.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(i,f):i.__proto__=f)}var b="1",C=["ready","nosub","added","changed","removed","result","updated","error"],R=1e4,v=(function(i){m(f,i),o(f,[{key:"emit",value:function(){var a;setTimeout((a=s(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"emit",this)).bind.apply(a,[this].concat(Array.prototype.slice.call(arguments))),0)}}]);function f(p){t(this,f);var a=h(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return a.status="disconnected",a.sessionId=null,a.cleanQueue=p.cleanQueue===!0,a.autoConnect=p.autoConnect!==!1,a.autoReconnect=p.autoReconnect!==!1,a.autoReconnectUserValue=a.autoReconnect,a.reconnectInterval=p.reconnectInterval||R,a.messageQueue=new y.default(function(d){return a.status==="connected"?(a.socket.send(d),!0):!1}),a.socket=new u.default(p.SocketConstructor,p.endpoint),a.socket.on("open",function(){var d={msg:"connect",version:b,supp
8ort:[b]};a.sessionId&&(d.session=a.sessionId),a.socket.send(d)}),a.socket.on("close",function(){var d=a.status;a.status="disconnected",a.cleanQueue&&a.messageQueue.empty(),d!="disconnected"&&a.emit("disconnected"),a.autoReconnect&&setTimeout(a.socket.open.bind(a.socket),a.reconnectInterval)}),a.socket.on("message:in",function(d){d.msg==="connected"?(a.status="connected",a.sessionId=d.session?d.session:null,a.messageQueue.process(),a.emit("connected",d)):d.msg==="ping"?a.socket.send({msg:"pong",id:d.id}):(0,e.contains)(C,d.msg)&&a.emit(d.msg,d)}),a.autoConnect&&a.connect(),a}return o(f,[{key:"connect",value:function(){this.autoReconnect=this.autoReconnectUserValue,this.socket.open()}},{key:"disconnect",value:function(){this.autoReconnectUserValue=this.autoReconnect,this.autoReconnect=!1,this.sessionId=null,this.socket.close()}},{key:"pauseQueue",value:function(){this.messageQueue.pause()}},{key:"continueQueue",value:function(){this.messageQueue.continue()}},{key:"method",value:function(a,d){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,S=(0,e.uniqueId)();return this.messageQueue[O?"unshift":"push"]({msg:"method",id:S,method:a,params:d}),S}},{key:"sub",value:function(a,d){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(0,e.uniqueId)();return this.messageQueue.push({msg:"sub",id:O,name:a,params:d}),O}},{key:"unsub",value:function(a){return this.messageQueue.push({msg:"unsub",id:a}),a}}]),f})(l.default);return $.default=v,$}var H={},ve;function ze(){return ve||(ve=1,Object.defineProperty(H,"__esModule",{value:!0}),H.isEqual=function o(s,_){var l=Object.prototype.toString.call(s);if(l!==Object.prototype.toString.call(_)||["[object Array]","[object Object]"].indexOf(l)<0)return!1;var c=l==="[object Array]"?s.length:Object.keys(s).length,y=l==="[object Array]"?_.length:Object.keys(_).length;if(c!==y)return!1;var r=function(t,h){var m=Object.prototype.toString.call(t);if(["[object Array]","[object Object]"].indexOf(m)>=0){if(!o(t,h))return!1}else{if(m!==Object.prototype.toString.call(h))return!1;if(m==="[object Function]"){if(t.toString()!==h.toString())return!1}else if(t!==h)return!1}};if(l==="[object Array]"){for(var u=0;u<c;u++)if(r(s[u],_[u])===!1)return!1}else for(var e in s)if(s.hasOwnProperty(e)&&r(s[e],_[e])===!1)return!1;return!0}),H}var q={},ne,_e;function Te(){if(_e)return ne;_e=1;var o=Object.prototype.toString;ne=function(h){if(h===void 0)return"undefined";if(h===null)return"null";var m=typeof h;if(m==="boolean")return"boolean";if(m==="string")return"string";if(m==="number")return"number";if(m==="symbol")return"symbol";if(m==="function")return r(h)?"generatorfunction":"function";if(_(h))return"array";if(n(h))return"buffer";if(e(h))return"arguments";if(c(h))return"date";if(l(h))return"error";if(y(h))return"regexp";switch(s(h)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(u(h))return"generator";switch(m=o.call(h),m){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return m.slice(8,-1).toLowerCase().replace(/\s/g,"")};function s(t){return typeof t.constructor=="function"?t.constructor.name:null}function _(t){return Array.isArray?Array.isArray(t):t instanceof Array}function l(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function c(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function y(t){return t instanceof RegExp?!0:typeof t.flags=="string"&&typeof t.ignoreCase=="boolean"&&typeof t.multiline=="boolean"&&typeof t.global=="boolean"}function r(t,h){return s(t)==="GeneratorFunction"}function u(t){return typeof t.throw=="function"&&typeof t.return=="function"&&typeof t.next=="function"}function e(t){try{if(typeof t.length=="number"&&typeof t.callee=="function")return!0}catch(h){if(h.message.indexOf("callee")!==-1)return!0}return!1}function n(t){return t.constructor&&typeof t.constructor.isBuffer=="function"?t.constructor.isBuffer(t):!1}return ne}var re,me;function Ke(){if(me)return re;me=1;const o=Symbol.prototype.valueOf,s=Te();function _(e,n){switch(s(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return r(e);case"symbol":return u(e);case"arraybuffer":return c(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return y(e);case"regexp":return l(e);case"error":return Object.create(e);default:return e}}function l(e){const n=e.flags!==void 0?e.flags:/\w+$/.exec(e)||void 0,t=new e.constructor(e.source,n);return t.lastIndex=e.lastIndex,t}function c(e){const n=new e.constructor(e.byteLength);return new Uint8Array(n).set(new Uint8Array(e)),n}function y(e,n){return new e.constructor(e.buffer,e.byteOffset,e.length)}function r(e){const n=e.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(n):Buffer.from(n);return e.copy(t),t}function u(e){return o?Object(o.call(e)):{}}return re=_,re}var ie,ge;function Ye(){return ge||(ge=1,ie=function(s){return s!=null&&typeof s=="object"&&Array.isArray(s)===!1}),ie}var ae,be;
8function Xe(){if(be)return ae;be=1;var o=Ye();function s(_){return o(_)===!0&&Object.prototype.toString.call(_)==="[object Object]"}return ae=function(l){var c,y;return!(s(l)===!1||(c=l.constructor,typeof c!="function")||(y=c.prototype,s(y)===!1)||y.hasOwnProperty("isPrototypeOf")===!1)},ae}var se,Oe;function Ze(){if(Oe)return se;Oe=1;const o=Ke(),s=Te(),_=Xe();function l(r,u){switch(s(r)){case"object":return c(r,u);case"array":return y(r,u);default:return o(r)}}function c(r,u){if(typeof u=="function")return u(r);if(u||_(r)){const e=new r.constructor;for(let n in r)e[n]=l(r[n],u);return e}return r}function y(r,u){const e=new r.constructor(r.length);for(let n=0;n<r.length;n++)e[n]=l(r[n],u);return e}return se=l,se}var we;function Ve(){if(we)return q;we=1,Object.defineProperty(q,"__esModule",{value:!0}),q.fullCopy=void 0;var o=Ze(),s=_(o);function _(l){return l&&l.__esModule?l:{default:l}}return q.fullCopy=s.default,q}var W={},ke;function et(){if(ke)return W;ke=1,Object.defineProperty(W,"__esModule",{value:!0});var o=(function(){function _(l,c){for(var y=0;y<c.length;y++){var r=c[y];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}return function(l,c,y){return c&&_(l.prototype,c),y&&_(l,y),l}})();function s(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}return W.ddpEventListener=(function(){function _(l,c,y){s(this,_),this._ddplink=y,this._eventname=l,this._f=c,this._started=!1,this.start()}return o(_,[{key:"stop",value:function(){this._started&&(this._ddplink.ddpConnection.removeListener(this._eventname,this._f),this._started=!1)}},{key:"start",value:function(){this._started||(this._ddplink.ddpConnection.on(this._eventname,this._f),this._started=!0)}}]),_})(),W}var z={},Se;function tt(){if(Se)return z;Se=1,Object.defineProperty(z,"__esModule",{value:!0});var o=(function(){function _(l,c){for(var y=0;y<c.length;y++){var r=c[y];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}return function(l,c,y){return c&&_(l.prototype,c),y&&_(l,y),l}})();function s(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}return z.ddpSubscription=(function(){function _(l,c,y){var r=this;s(this,_),this._ddplink=y,this.pubname=l,this.args=c,this._nosub=!1,this._started=!1,this._ready=!1,this.selfReadyEvent=y.on("ready",function(u){u.subs.includes(r.subscriptionId)&&(r._ready=!0,r._nosub=!1)}),this.selfNosubEvent=y.on("nosub",function(u){u.id==r.subscriptionId&&(r._ready=!1,r._nosub=!0,r._started=!1)}),this.start()}return o(_,[{key:"onNosub",value:function(c){var y=this;if(this.isStopped())c();else{var r=this._ddplink.on("nosub",function(u){u.id==y.subscriptionId&&c(u.error)});return r}}},{key:"onReady",value:function(c){var y=this;if(this.isReady())c();else{var r=this._ddplink.on("ready",function(u){u.subs.includes(y.subscriptionId)&&c()});return r}}},{key:"isReady",value:function(){return this._ready}},{key:"isStopped",value:function(){return this._nosub}},{key:"ready",value:function(){var c=this;return new Promise(function(y,r){if(c.isReady())y();else var u=c._ddplink.on("ready",function(n){n.subs.includes(c.subscriptionId)&&(u.stop(),e.stop(),y())}),e=c._ddplink.on("nosub",function(n){n.id==c.subscriptionId&&(e.stop(),u.stop(),n.error&&r(n.error),y())})})}},{key:"nosub",value:function(){var c=this;return new Promise(function(y,r){if(c.isStopped())y();else var u=c._ddplink.on("nosub",function(e){e.id==c.subscriptionId&&(c._nosub=!0,u.stop(),e.error?r(e.error):y())})})}},{key:"isOn",value:function(){return this._started}},{key:"remove",value:function(){this.selfNosubEvent.stop(),this.stop();var c=this._ddplink.subs.indexOf(this);c>-1&&this._ddplink.subs.splice(c,1)}},{key:"stop",value:function(){return this._started&&(this.selfReadyEvent.stop(),this._nosub||this._ddplink.ddpConnection.unsub(this.subscriptionId),this._started=!1,this._ready=!1),this.nosub()}},{key:"_getId",value:function(){return this.subscriptionId}},{key:"start",value:function(c){return this._started||(this.selfReadyEvent.start(),Array.isArray(c)&&(this.args=c),this.subscriptionId=this._ddplink.ddpConnection.sub(this.pubname,this.args),this._started=!0),this.ready()}},{key:"restart",value:function(c){var y=this;return new Promise(function(r,u){y.stop().then(function(){y.start(c).then(function(){r()}).catch(function(e){u(e)})}).catch(function(e){u(e)})})}}]),_})(),z}var L={},K={},Ce;function Z(){if(Ce)return K;Ce=1,Object.defineProperty(K,"__esModule",{value:!0});var o=(function(){function _(l,c){for(var y=0;y<c.length;y++){var r=c[y];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(l,r.key,r)}}return function(l,c,y){return c&&_(l.prototype,c),y&&_(l,y),l}})();function s(_,l){if(!(_ instanceof l))throw new TypeError("Cannot call a class as a function")}return K.ddpOnChange=(function(){function _(l,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"onChangeFuncs";s(this,_),this._obj=l,this._inst=c,this._isStopped=!0,this._listenersArray=y,this.start()}return o(_,[{key:"stop",value:function(){var c=this._inst[this._listenersArray].indexOf(this._obj);c>-1&&(this._isStopped=!0,this._inst[this._listenersArray].splice(c,1))}},{key:"start",value:function(){this._isStopped&&(this._inst[this._listenersArray].push(this._obj),this._isStopped=!1)}}]),_})(),K}var J={},x={},Ae;function nt(){if(Ae)return x;Ae=1,Object.defineProperty(x,"__esModule",{value:!0}),x.ddpReducer=void 0;var o=(function(){function l(c,y){for(var r=0;r<y.length;r++){var u=y[r];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(c,u.key,u)}}return function(c,y,r){return y&&l(c.prototype,y),r&&l(c,r),c}})(),s=Z();function _(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}return x.ddpReducer=(function(){function l(c,y,r){_(this,l),this._ddpReactiveCollectionInstance=c,this._reducer=y,this._started=!1,this._data={result:null},this._tickers=[],this._initialValue=r,this.start()}return o(l,[{key:"doReduce",value:function(){var y=this;this._started&&(this._data.result=this._ddpReactiveCollectionInstance.data().reduce(this._reducer,this._initialValue),this._tickers.forEac
8h(function(r){r(y.data().result)}))}},{key:"start",value:function(){this._started||(this.doReduce(),this._ddpReactiveCollectionInstance._activateReducer(this),this._started=!0)}},{key:"stop",value:function(){this._started&&(this._ddpReactiveCollectionInstance._deactivateReducer(this),this._started=!1)}},{key:"data",value:function(){return this._data}},{key:"onChange",value:function(y){return new s.ddpOnChange(y,this,"_tickers")}}]),l})(),x}var M={},Re;function rt(){if(Re)return M;Re=1,Object.defineProperty(M,"__esModule",{value:!0}),M.ddpReactiveDocument=void 0;var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},s=(function(){function c(y,r){for(var u=0;u<r.length;u++){var e=r[u];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(y,e.key,e)}}return function(y,r,u){return r&&c(y.prototype,r),u&&c(y,u),y}})(),_=Z();function l(c,y){if(!(c instanceof y))throw new TypeError("Cannot call a class as a function")}return M.ddpReactiveDocument=(function(){function c(y,r){l(this,c),this._ddpReactiveCollectionInstance=y,this._started=!1,this._data={},this._tickers=[],this._preserve=!1,(typeof r>"u"?"undefined":o(r))==="object"&&r!==null&&this.settings(r),this.start()}return s(c,[{key:"_update",value:function(r){var u=this;r?(Object.keys(this._data).forEach(function(e){delete u._data[e]}),Object.assign(this._data,r)):this._preserve||Object.keys(this._data).forEach(function(e){delete u._data[e]}),this._tickers.forEach(function(e){e(u.data())})}},{key:"start",value:function(){this._started||(this._update(this._ddpReactiveCollectionInstance.data()[0]),this._ddpReactiveCollectionInstance._activateReactiveObject(this),this._started=!0)}},{key:"stop",value:function(){this._started&&(this._ddpReactiveCollectionInstance._deactivateReactiveObject(this),this._started=!1)}},{key:"data",value:function(){return this._data}},{key:"onChange",value:function(r){return new _.ddpOnChange(r,this,"_tickers")}},{key:"settings",value:function(r){var u=r.preserve;this._preserve=!!u}}]),c})(),M}var Ee;function it(){if(Ee)return J;Ee=1,Object.defineProperty(J,"__esModule",{value:!0}),J.ddpReactiveCollection=void 0;var o=(function(){function r(u,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,e,n){return e&&r(u.prototype,e),n&&r(u,n),u}})(),s=nt(),_=rt(),l=Z();function c(r){if(Array.isArray(r)){for(var u=0,e=Array(r.length);u<r.length;u++)e[u]=r[u];return e}else return Array.from(r)}function y(r,u){if(!(r instanceof u))throw new TypeError("Cannot call a class as a function")}return J.ddpReactiveCollection=(function(){function r(u,e,n){var t=this;y(this,r),this._skip=e&&typeof e.skip=="number"?e.skip:0,this._limit=e&&typeof e.limit=="number"?e.limit:1/0,this._length={result:0},this._data=[],this._rawData=[],this._reducers=[],this._tickers=[],this._ones=[],this._first={},this._syncFunc=function(h,m,b){var C={};return typeof h=="number"&&(C.skip=h),typeof m=="number"&&(C.limit=m),b&&(C.sort=b),u.fetch.call(u,C)},this._changeHandler=u.onChange(function(h){var m=h.prev,b=h.next,C=h.predicatePassed;if(m&&b){if(C[0]==0&&C[1]==1)t._smartUpdate(b);else if(C[0]==1&&C[1]==0){var R=t._rawData.findIndex(function(f){return f.id==m.id});t._removeItem(R)}else if(C[0]==1&&C[1]==1){var v=t._rawData.findIndex(function(f){return f.id==m.id});t._smartUpdate(b,v)}}else if(!m&&b)t._smartUpdate(b);else if(m&&!b){var i=t._rawData.findIndex(function(f){return f.id==m.id});t._removeItem(i)}t._length.result=t._data.length,t._reducers.forEach(function(f){f.doReduce()}),t._data[0]!==t._first&&t._updateReactiveObjects(),t._first=t._data[0],t._tickers.forEach(function(f){f(t.data())})},n||function(h){return!0}),this.started=!1,this._sort=!1,this.start()}return o(r,[{key:"_removeItem",value:function(e){this._rawData.splice(e,1),e>=this._skip&&e<this._skip+this._limit?(this._data.splice(e-this._skip,1),this._rawData.length>=this._skip+this._limit&&this._data.push(this._rawData[this._skip+this._limit-1])):e<this._skip&&(this._data.shift(),this._rawData.length>=this._skip+this._limit&&this._data.push(this._rawData[this._skip+this._limit-1]))}},{key:"_smartUpdate",value:function(e,n){var t=void 0;if(!this._rawData.length){t=this._rawData.push(e)-1,t>=this._skip&&t<this._skip+this._limit&&this._data.push(e);return}if(this._sort)for(var h=0;h<this._rawData.length;h++){if(this._sort(e,this._rawData[h])<1){t=h,h==n?(this._rawData[h]=e,n>=this._skip&&n<this._skip+this._limit&&(this._data[n-this._skip]=e)):(this._removeItem(n),this._rawData.splice(h,0,e),h>=this._skip&&h<this._skip+this._limit&&(this._data.splice(h-this._skip,0,e),this._data.splice(this._limit)));break}if(h==this._rawData.length-1){t=this._rawData.push(e)-1,t>=this._skip&&t<this._skip+this._limit&&this._data.push(e);break}}else typeof n=="number"?(t=n,this._rawData[n]=e,n>=this._skip&&n<this._skip+this._limit&&(this._data[n-this._skip]=e)):(t=this._rawData.push(e)-1,t>=this._skip&&t<this._skip+this._limit&&this._data.push(e))}},{key:"_activateReducer",value:function(e){this._reducers.push(e)}},{key:"_activateReactiveObject",value:function(e){this._ones.push(e)}},{key:"_deactivateReducer",value:function(e){var n=this._reducers.indexOf(e);n>-1&&this._reducers.splice(n,1)}},{key:"_deactivateReactiveObject",value:function(e){var n=this._ones.indexOf(e);n>-1&&this._ones.splice(n,1)}},{key:"_updateReactiveObjects",value:function(){var e=this;
8this._ones.forEach(function(n){n._update(e.data()[0])})}},{key:"settings",value:function(e){var n,t=e.skip,h=e.limit;this._skip=t!==!1?t:0,this._limit=h!==!1?h:1/0,(n=this._data).splice.apply(n,[0,this._data.length].concat(c(this._syncFunc(this._skip,this._limit,this._sort)))),this._updateReactiveObjects()}},{key:"stop",value:function(){this.started&&(this._changeHandler.stop(),this.started=!1)}},{key:"start",value:function(){if(!this.started){var e,n;(e=this._rawData).splice.apply(e,[0,this._rawData.length].concat(c(this._syncFunc(!1,!1,this._sort)))),(n=this._data).splice.apply(n,[0,this._data.length].concat(c(this._syncFunc(this._skip,this._limit,this._sort)))),this._updateReactiveObjects(),this._changeHandler.start(),this.started=!0}}},{key:"sort",value:function(e){if(this._sort=e,this._sort){var n,t;(n=this._rawData).splice.apply(n,[0,this._rawData.length].concat(c(this._syncFunc(!1,!1,this._sort)))),(t=this._data).splice.apply(t,[0,this._data.length].concat(c(this._syncFunc(this._skip,this._limit,this._sort)))),this._updateReactiveObjects()}return this}},{key:"data",value:function(){return this._data}},{key:"onChange",value:function(e){return new l.ddpOnChange(e,this,"_tickers")}},{key:"map",value:function(e){return new s.ddpReducer(this,function(n,t,h,m){return n.concat(e(t,h,m))},[])}},{key:"reduce",value:function(e,n){return new s.ddpReducer(this,e,n)}},{key:"count",value:function(){return this._length}},{key:"one",value:function(e){return new _.ddpReactiveDocument(this,e)}}]),r})(),J}var De;function at(){if(De)return L;De=1,Object.defineProperty(L,"__esModule",{value:!0}),L.ddpCollection=void 0;var o=(function(){function r(u,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(u,t.key,t)}}return function(u,e,n){return e&&r(u.prototype,e),n&&r(u,n),u}})(),s=Ve(),_=Z(),l=it();function c(r,u,e){return u in r?Object.defineProperty(r,u,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[u]=e,r}function y(r,u){if(!(r instanceof u))throw new TypeError("Cannot call a class as a function")}return L.ddpCollection=(function(){function r(u,e){y(this,r),this._name=u,this._server=e,this._filter=!1}return o(r,[{key:"filter",value:function(e){return this._filter=e,this}},{key:"importData",value:function(e){var n=this,t=typeof e=="string"?EJSON.parse(e):e;t[this._name]&&t[this._name].forEach(function(h,m,b){(!n._filter||n._filter&&n._filter(h,m,b))&&n.ddpConnection.emit("added",{msg:"added",id:h.id,collection:n._name,fields:h.fields})})}},{key:"exportData",value:function(e){var n=c({},this._name,this.fetch());if(e===void 0||e=="string")return EJSON.stringify(n);if(e=="raw")return n}},{key:"fetch",value:function(e){var n=void 0,t=void 0,h=void 0;e&&(n=e.skip,t=e.limit,h=e.sort);var m=this._server.collections[this._name],b=m?(0,s.fullCopy)(m):[];return this._filter&&(b=b.filter(this._filter)),h&&b.sort(h),typeof n=="number"&&b.splice(0,n),(typeof t=="number"||t==1/0)&&b.splice(t),b}},{key:"reactive",value:function(e){return new l.ddpReactiveCollection(this,e,this._filter)}},{key:"onChange",value:function(e,n){var t={collection:this._name,f:e};return this._filter&&(t.filter=this._filter),n&&(t.filter=n),new _.ddpOnChange(t,this._server)}}]),r})(),L}var Ne;function st(){return Ne||(Ne=1,(function(o,s){Object.defineProperty(s,"__esModule",{value:!0});var _=(function(){function f(p,a){for(var d=0;d<a.length;d++){var O=a[d];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(p,O.key,O)}}return function(p,a,d){return a&&f(p.prototype,a),d&&f(p,d),p}})(),l=We(),c=m(l),y=ue(),r=m(y),u=ze(),e=Ve(),n=et(),t=tt(),h=at();function m(f){return f&&f.__esModule?f:{default:f}}function b(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")}function C(){var f=0;return function(){return f++}}var R=C();function v(f){for(var p=this,a=arguments.length,d=Array(a>1?a-1:0),O=1;O<a;O++)d[O-1]=arguments[O];Array.isArray(f)&&f.forEach(function(S){d.forEach(function(g){S[g]&&S[g].call(p)})})}var i=(function(){function f(p,a){var d=this;b(this,f),this._id=R(),this._opGenId=C(),this._opts=p,this.ddpConnection=new c.default(p),this.subs=[],this.collections={},this.onChangeFuncs=[],this.connected=!1,this.maxTimeout=p.maxTimeout,this.clearDataOnReconnection=p.clearDataOnReconnection===void 0?!0:p.clearDataOnReconnection,this.tryingToConnect=p.autoConnect===void 0?!0:p.autoConnect,this.tryingToDisconnect=!1,this.willTryToReconnect=p.autoReconnect===void 0?!0:p.autoReconnect;var O=v.bind(this,a);O("init","beforeConnected"),this.connectedEvent=this.on("connected",function(S){d.connected=!0,d.tryingToConnect=!1}),O("afterConnected","beforeSubsRestart"),this.connectedEventRestartSubs=this.on("connected",function(S){d.clearDataOnReconnection?d.clearData().then(function(){d.ddpConnection.emit("clientReady"),d.restartSubs()}):(d.ddpConnection.emit("clientReady"),d.restartSubs())}),O("afterSubsRestart","beforeDisconnected"),this.disconnectedEvent=this.on("disconnected",function(S){d.connected=!1,d.tryingToDisconnect=!1,d.tryingToConnect=d.willTryToReconnect}),O("afterDisconnected","beforeAdded"),this.addedEvent=this.on("added",function(S){return d.dispatchAdded(S)}),O("afterAdded","beforeChanged"),this.changedEvent=this.on("changed",function(S){return d.dispatchChanged(S)}),O("afterChanged","beforeRemoved"),this.removedEvent=this.on("removed",function(S){return d.dispatchRemoved(S)}),O("afterRemoved","after")}return _(f,[{key:"restartSubs",value:function(){this.subs.forEac
8h(function(a){a.isOn()&&a.restart()})}},{key:"collection",value:function(a){return new h.ddpCollection(a,this)}},{key:"dispatchAdded",value:function(a){var d=this;if(this.collections.hasOwnProperty(a.collection)){var O=this.collections[a.collection].findIndex(function(k){return k.id==a.id});O>-1&&this.collections[a.collection].splice(O,1)}this.collections.hasOwnProperty(a.collection)||(this.collections[a.collection]=[]);var S=Object.assign({id:a.id},a.fields),g=this.collections[a.collection].push(S),w={};a.fields&&Object.keys(a.fields).map(function(k){w[k]=1}),this.onChangeFuncs.forEach(function(k){if(k.collection==a.collection){var E=k.hasOwnProperty("filter"),A=(0,e.fullCopy)(S);E?E&&k.filter(A,g-1,d.collections[a.collection])&&k.f({prev:!1,next:A,fields:w,fieldsChanged:A,fieldsRemoved:[]}):k.f({changed:!1,added:A,removed:!1})}})}},{key:"dispatchChanged",value:function(a){var d=this;this.collections.hasOwnProperty(a.collection)||(this.collections[a.collection]=[]);var O=this.collections[a.collection].findIndex(function(A){return A.id==a.id});if(O>-1){var S=(0,e.fullCopy)(this.collections[a.collection][O]),g={},w={},k=[];a.fields&&(w=a.fields,Object.keys(a.fields).map(function(A){g[A]=1}),Object.assign(this.collections[a.collection][O],a.fields)),a.cleared&&(k=a.cleared,a.cleared.forEach(function(A){g[A]=0,delete d.collections[a.collection][O][A]}));var E=this.collections[a.collection][O];this.onChangeFuncs.forEach(function(A){if(A.collection==a.collection){var N=A.hasOwnProperty("filter");if(!N)A.f({changed:{prev:S,next:(0,e.fullCopy)(E),fields:g,fieldsChanged:w,fieldsRemoved:k},added:!1,removed:!1});else{var j=(0,e.fullCopy)(E),P=A.filter(S,O,d.collections[a.collection]),F=A.filter(j,O,d.collections[a.collection]);(P||F)&&A.f({prev:S,next:j,fields:g,fieldsChanged:w,fieldsRemoved:k,predicatePassed:[P,F]})}}})}else this.dispatchAdded(a)}},{key:"dispatchRemoved",value:function(a){var d=this;this.collections.hasOwnProperty(a.collection)||(this.collections[a.collection]=[]);var O=this.collections[a.collection].findIndex(function(g){return g.id==a.id});if(O>-1){var S=this.collections[a.collection].splice(O,1)[0];this.onChangeFuncs.forEach(function(g){if(g.collection==a.collection){var w=g.hasOwnProperty("filter");w?g.filter(S,O,d.collections[a.collection])&&g.f({prev:S,next:!1}):g.f({changed:!1,added:!1,removed:S})}})}}},{key:"connect",value:function(){var a=this;return this.willTryToReconnect=this._opts.autoReconnect===void 0?!0:this._opts.autoReconnect,new Promise(function(d,O){if(a.tryingToConnect||(a.ddpConnection.connect(),a.tryingToConnect=!0),a.connected)d();else var S=a.on("connected",function(){S.stop(),a.tryingToConnect=!1,d()})})}},{key:"disconnect",value:function(){var a=this;return this.willTryToReconnect=!1,new Promise(function(d,O){if(a.tryingToDisconnect||(a.ddpConnection.disconnect(),a.tryingToDisconnect=!0),a.connected)var S=a.on("disconnected",function(){S.stop(),a.tryingToDisconnect=!1,d()});else d()})}},{key:"apply",value:function(a,d){var O=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return new Promise(function(g,w){var k=O.ddpConnection.method(a,d||[],S),E=O,A=void 0;function N(j){j.id==k&&(clearTimeout(A),j.error?w(j.error):g(j.result),E.ddpConnection.removeListener("result",N))}O.ddpConnection.on("result",N),O.maxTimeout&&(A=setTimeout(function(){O.ddpConnection.removeListener("result",N),w(new Error)},O.maxTimeout))})}},{key:"call",value:function(a){for(var d=arguments.length,O=Array(d>1?d-1:0),S=1;S<d;S++)O[S-1]=arguments[S];return this.apply(a,O)}},{key:"sub",value:function(a,d){var O=this.subs.find(function(g){return g.pubname==a&&(0,u.isEqual)(g.args,Array.isArray(d)?d:[])});if(O)return O;var S=this.subs.push(new t.ddpSubscription(a,Array.isArray(d)?d:[],this));return this.subs[S-1]}},{key:"subscribe",value:function(a){for(var d=arguments.length,O=Array(d>1?d-1:0),S=1;S<d;S++)O[S-1]=arguments[S];return this.sub(a,O)}},{key:"on",value:function(a,d){return new n.ddpEventListener(a,d,this)}},{key:"stopChangeListeners",value:function(){this.onChangeFuncs=[]}},{key:"clearData",value:function(){var a=this;return new Promise(function(d,O){var S=0;
8if(Object.keys(a.collections).forEach(function(E){S+=Array.isArray(a.collections[E])?a.collections[E].length:0}),S===0)d();else{var g=0,w=a._id+"-"+a._opGenId(),k=a.on("removed",function(E,A){A==w&&(g++,g==S&&(k.stop(),d()))});Object.keys(a.collections).forEach(function(E){a.collections[E].forEach(function(A){a.ddpConnection.emit("removed",{msg:"removed",id:A.id,collection:E},w)})})}})}},{key:"importData",value:function(a){var d=this;return new Promise(function(O,S){var g=typeof a=="string"?r.default.parse(a):a,w=0;Object.keys(g).forEach(function(N){w+=Array.isArray(g[N])?g[N].length:0});var k=0,E=d._id+"-"+d._opGenId(),A=d.on("added",function(N,j){j==E&&(k++,k==w&&(A.stop(),O()))});Object.keys(g).forEach(function(N){g[N].forEach(function(j){var P=Object.assign({},j);delete P.id,d.ddpConnection.emit("added",{msg:"added",id:j.id,collection:N,fields:P},E)})})})}},{key:"exportData",value:function(a){if(a===void 0||a=="string")return r.default.stringify(this.collections);if(a=="raw")return(0,e.fullCopy)(this.collections)}},{key:"markAsReady",value:function(a){var d=this;return new Promise(function(O,S){var g=d._id+"-"+d._opGenId();d.ddpConnection.emit("ready",{msg:"ready",subs:a.map(function(k){return k._getId()})},g);var w=d.on("ready",function(k,E){E==g&&(w.stop(),O())})})}}]),f})();s.default=i,o.exports=s.default})(U,U.exports)),U.exports}var ot=st();const ut=Ie(ot);var Y={},je;function ct(){return je||(je=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.simpleDDPLogin={init:function(){var s=this;this.userId=void 0,this._loggedIn=!1,this.login=function(_){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return new Promise(function(c,y){s.apply("login",[_],l).then(function(r){r&&r.id?(s.userId=r.id,s.token=r.token,s._loggedIn=!0,r.type=="resume"?s.ddpConnection.emit("loginResume",r):s.ddpConnection.emit("login",r),c(r)):y(r)},y)})},this.logout=function(){return new Promise(function(_,l){s._loggedIn?s.apply("logout").then(function(c){s.userId=void 0,s.token=void 0,s._loggedIn=!1,s.ddpConnection.emit("logout"),_()},l):_()})},this.logoutWhenDisconnectedEvent=this.on("disconnected",function(_){s.userId&&(s.ddpConnection.emit("loginSessionLost",s.userId),s.ddpConnection.pauseQueue()),s._loggedIn=!1}),this.clientReadyEvent=this.on("clientReady",function(){s.userId&&(s.login({resume:s.token},!0).catch(function(_){s.ddpConnection.emit("loginResumeFailed",_)}),s.ddpConnection.continueQueue())})}}),Y}var ft=ct();Me.instance;var lt=ue();const dt=Ie(lt),ht="23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghijkmnopqrstuvwxyz",pt="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";class qe{fraction(){throw new Error("Unknown random generator type")}hexString(s){return this._randomString(s,"0123456789abcdef")}_randomString(s,_){let l="";for(let c=0;c<s;c++)l+=this.choice(_);return l}id(s){return s===void 0&&(s=17),this._randomString(s,ht)}secret(s){return s===void 0&&(s=43),this._randomString(s,pt)}choice(s){const _=Math.floor(this.fraction()*s.length);return typeof s=="string"?s.substr(_,1):s[_]}}class yt extends qe{fraction(){const s=new Uint32Array(1);return window.crypto.getRandomValues(s),s[0]*23283064365386963e-26}}function vt(o){function s(){let e=4022871197;const n=t=>{t=t.toString();for(let h=0;h<t.length;h++){e+=t.charCodeAt(h);let m=.02519603282416938*e;e=m>>>0,m-=e,m*=e,e=m>>>0,m-=e,e+=m*4294967296}return(e>>>0)*23283064365386963e-26};return n.version="Mash 0.9",n}let _=0,l=0,c=0,y=1;o.length===0&&(o=[+new Date]);let r=s();_=r(" "),l=r(" "),c=r(" ");for(let e=0;e<o.length;e++)_-=r(o[e]),_<0&&(_+=1),l-=r(o[e]),l<0&&(l+=1),c-=r(o[e]),c<0&&(c+=1);r=null;const u=()=>{const e=2091639*_+y*23283064365386963e-26;return _=l,l=c,c=e-(y=e|0)};return u.uint32=()=>u()*4294967296,u.fract53=()=>u()+(u()*2097152|0)*11102230246251565e-32,u.version="Alea 0.9",u.args=o,u}class Le extends qe{constructor({seeds:s=[]}={}){if(super(),!s)throw new Error("No seeds were provided for Alea PRNG");this.alea=vt(s)}fraction(){return this.alea()}}const _t=typeof window<"u"&&window.innerHeight||typeof document<"u"&&document.documentElement&&document.documentElement.clientHeight||typeof document<"u"&&document.body&&document.body.clientHeight||1,mt=typeof window<"u"&&window.innerWidth||typeof document<"u"&&document.documentElement&&document.documentElement.clientWidth||typeof document<"u"&&document.body&&document.body.clientWidth||1,gt=typeof navigator<"u"&&navigator.userAgent||"";function Je(){return new Le({seeds:[new Date,_t,mt,gt,Math.random()]})}function bt(o){return o.createWithSeeds=(...s)=>{if(s.length===0)throw new Error("No seeds were provided");return new Le({seeds:s})},o.insecure=Je(),o}let oe;typeof window<"u"&&window.crypto?oe=new yt:oe=Je();const Ot=bt(oe),I={};I._looksLikeObjectID=o=>o.length===24&&/^[0-9a-f]*$/.test(o);I.ObjectID=class{constructor(s){if(s){if(s=s.toLowerCase(),!I._looksLikeObjectID(s))throw new Error("Invalid hexadecimal string for creating an ObjectID");this._str=s}else this._str=Ot.hexString(24)}equals(s){return s instanceof I.ObjectID&&this.valueOf()===s.valueOf()}toString(){return`ObjectID("${this._str}")`}clone(){return new I.ObjectID(this._str)}typeName(){return"oid"}getTimestamp(){return Number.parseInt(this._str.substr(0,8),16)}valueOf(){return this._str}toJSONValue(){return this.valueOf()}toHexString(){return this.valueOf()}};dt.addType("oid",o=>new I.ObjectID(o));I.idStringify=o=>
8{if(o instanceof I.ObjectID)return o.valueOf();if(typeof o=="string"){const s=o.charAt(0);return o===""?o:s==="-"||s==="~"||I._looksLikeObjectID(o)||s==="{"?`-${o}`:o}else{if(o===void 0)return"-";if(typeof o=="object"&&o!==null)throw new Error("Meteor does not currently support objects other than ObjectID as ids");return`~${JSON.stringify(o)}`}};I.idParse=o=>{const s=o.charAt(0);return o===""?o:o==="-"?void 0:s==="-"?o.substr(1):s==="~"?JSON.parse(o.substr(1)):I._looksLikeObjectID(o)?new I.ObjectID(o):o};const wt={endpoint:"wss://www.mymedicalshopper.com/websocket",SocketConstructor:Ue,reconnectInterval:1e4},D=new ut(wt,[ft.simpleDDPLogin]);D.on("error",o=>{console.error(`DDP ERROR: ${JSON.stringify(o)}`)});D.on("disconnected",()=>{console.error("DDP DISCONNECTED")});const Mt=xe("talon",{state:()=>({activeOfferingId:"",cardStatus:{active:!1,block:"OPEN"},cards:[],loadingTalonCard:!1,offerings:[],cardActions:[],presentationSide:"FRONT",presentationActionId:"",dashboardSettingsId:"Qrx4TPPZ99XHLSGNm",fetchingCardContent:!1,cardFrontContent:"",cardBackContent:null}),actions:{toggleActiveOffering(o){if(this.activeOfferingId===o){this.activeOfferingId="";return}this.activeOfferingId=o},talonLogin(){const o=Be(),s=ee(o,"talonToken.access_token",!1);s&&D.login({resume:s}).then(_=>{new B("function",{name:"talon.talonLogin",data:_})}).catch(_=>{new B("simpleddp-error",{name:"talon.talonLogin",data:_})})},async fetchCards(){D.subscribe("getCardsAndCardActions"),D.collection("cards").onChange(()=>{this.cards=D.collection("cards").fetch()}),this.cards=D.collection("cards").fetch(),D.collection("cardActions").onChange(async()=>{if(this.cardActions=D.collection("cardActions").fetch(),this.presentationActionId){const o=this.presentationActionId,s=this.cardActions.find(_=>_.id===o);s&&s.status==="COMPLETE"&&(this.presentationActionId="",this.presentCardStageTwo(s.id))}})},async presentCardStageTwo(o){const s={cardActionId:o,dashboardSettingsId:this.dashboardSettingsId};this.cardBackContent=await D.call("getTalonPayCard",s).then(_=>this._arrayBufferToBase64(_[0].downloadContent)).catch(_=>{new B("simpleddp-error",{name:"talon.presentCardStageTwo",data:_}),console.error("getTalonPayCard error",_),this.fetchingCardContent=!1})},async fetchAccounts(){D.call("getDetailedOfferingsForUser").then(o=>{this.offerings=o.filter(s=>s.name!=="my-medical-rewards")}).catch(o=>{new B("simpleddp-error",{name:"talon.fetchAccounts",data:o}),console.error("getDetailedOfferingsForUser error",o)})},_arrayBufferToBase64(o){let s="";const _=new Uint8Array(o),l=_.byteLength;for(let c=0;c<l;c++)s+=String.fromCharCode(_[c]);return btoa(s)},async acceptPrivacyPolicy(){const o=ce();return D.call("acceptAgreementForLoggedInUser","agreedToPathwardPrivacyPolicy").then(s=>(o.privacyPolicyAccepted=s,!0)).catch(s=>!1)},async acceptCardholderAgreement(){const o=ce();return D.call("acceptAgreementForLoggedInUser","agreedToPathwardCardholderAgreement").then(s=>(o.cardholderAgreementAccepted=s,s)).catch(s=>!1)},async activateCard(){const o=this.mostRecentCard;return o?D.call("activateCard",o.last4Digits).then(()=>{}):Promise.reject("No card found")},async orderCard(){const o=this.mostRecentCard;return o?D.call("orderPhysicalCard",o.last4Digits).then(s=>{}).catch(s=>{Promise.reject("order physical card error")}):Promise.reject("No card found")},async replaceCard(o){const s=this.mostRecentCard;return s?["LOST","STOLEN"].includes(o.toUpperCase())?D.call("reissueCard",s.last4Digits).then(_=>{}).catch(_=>{}):["DAMAGED","EXPIRED"].includes(o.toUpperCase())?D.call("newCardSameNums",s.last4Digits).then(_=>{}).catch(_=>{}):Promise.reject("Invalid reason"):Promise.reject("No card found")},async presentCard(){if(Fe(this.cardBackContent==="")){const o=this.mostRecentCard;if(!o)return;this.presentationActionId=await D.call("requestEncryptedPan",o.last4Digits)}},async freezeCard(){const o=this.mostRecentCard;o&&D.call("blockCard",o.last4Digits).then(()=>{this.cardStatus.block="BLOCKED"}).catch(s=>{})},async unfreezeCard(){const o=this.mostRecentCard;o&&D.call("unblockCard",o.last4Digits).then(()=>{this.cardStatus.block="OPEN"}).catch(s=>{})},async deactivateCard(){const o=this.mostRecentCard;o&&D.call("deactivateCard",o.last4Digits).then(()=>{this.cardStatus.active=!1}
8).catch(s=>{})},async setCardPin(o){const s=this.mostRecentCard;return s?D.call("setCardPin",{last4Digits:s.last4Digits,pin:o}).then(_=>{}).catch(_=>Promise.reject(_)):Promise.reject("No card found")}},getters:{cardFrozen:o=>ee(o.mostRecentCard,"block","")==="BLOCKED NO FRAUD",cardActive:o=>ee(o.mostRecentCard,"active",!1),memberHasCard(o){return o.cards&&o.cards.length>0},memberHasOffering(o){return o.offerings&&o.offerings.length>0},balanceForOffering(o){return s=>{const _=o.offerings.find(l=>l.name===s);return _?_.balance:0}},balanceAllOfferings(o){return o.offerings.reduce((s,_)=>s+_.balance,0)},offeringBalances(o){const s={};return o.offerings.forEach(_=>{s[_.name]=_.balance}),s},mostRecentCard(o){return o.cards&&o.cards.length>0?o.cards[0]:null},pendingCardActions(o){return o.cardActions.filter(s=>s.status==="PENDING")},freezeActionPending(o){return o.cardActions.some(s=>s.status==="PENDING"&&s.type==="BLOCK")},unfreezeActionPending(o){return o.cardActions.some(s=>s.status==="PENDING"&&s.type==="UNBLOCK")},cardActivationPending(o){return o.cardActions.some(s=>s.status==="PENDING"&&s.type==="ACTIVATE")},awaitingCardPresentment(o){return o.presentationActionId!==""},physicalCardExists(o){const s=o.cards&&o.cards.length>0?o.cards[0]:null;return s&&s.physicalCardStatus==="SHIPPED"},cardHasPin(o){const s=o.cards&&o.cards.length>0?o.cards[0]:null;return s&&s.pinSet}}});export{Mt as useTalonStore};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.