@azrico/global 1.3.7 → 1.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/packages/cache/g_cache.d.ts +2 -1
- package/dist/packages/cache/g_cache.js +1 -1
- package/dist/packages/core/index.js +1 -1
- package/dist/packages/encryption/g_encryption.js +2 -2
- package/dist/packages/hooks/g_filter.js +2 -2
- package/dist/packages/hooks/g_func.js +3 -3
- package/dist/packages/hooks/g_view.js +1 -1
- package/dist/packages/hooks/index.js +1 -1
- package/dist/packages/once/g_once.js +1 -1
- package/dist/packages/state/g_state.js +1 -1
- package/dist/packages/storage/g_storage.d.ts +1 -0
- package/dist/packages/storage/g_storage.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _gglobal=_interopRequireWildcard(require("./packages/core"));var _gonce=_interopRequireWildcard(require("./packages/once"));var _gcache=_interopRequireWildcard(require("./packages/cache"));var _gstorage=_interopRequireWildcard(require("./packages/storage"));var _gencryption=_interopRequireWildcard(require("./packages/encryption"));var _gstate=_interopRequireWildcard(require("./packages/state"));var _hooks=require("./packages/hooks");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"gfilter",{enumerable:!0,get:function get(){return _hooks.gfilter}}),Object.defineProperty(exports,"gfunc",{enumerable:!0,get:function get(){return _hooks.gfunc}}),Object.defineProperty(exports,"gholder",{enumerable:!0,get:function get(){return _hooks.gholder}}),Object.defineProperty(exports,"gview",{enumerable:!0,get:function get(){return _hooks.gview}})
|
|
1
|
+
"use strict";var _gglobal=_interopRequireWildcard(require("./packages/core"));var _gonce=_interopRequireWildcard(require("./packages/once"));var _gcache=_interopRequireWildcard(require("./packages/cache"));var _gstorage=_interopRequireWildcard(require("./packages/storage"));var _gencryption=_interopRequireWildcard(require("./packages/encryption"));var _gstate=_interopRequireWildcard(require("./packages/state"));var _hooks=require("./packages/hooks");function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.gencryption=exports.gcache=void 0,Object.defineProperty(exports,"gfilter",{enumerable:!0,get:function get(){return _hooks.gfilter}}),Object.defineProperty(exports,"gfunc",{enumerable:!0,get:function get(){return _hooks.gfunc}}),exports.gglobal=void 0,Object.defineProperty(exports,"gholder",{enumerable:!0,get:function get(){return _hooks.gholder}}),exports.gstorage=exports.gstate=exports.gonce=void 0,Object.defineProperty(exports,"gview",{enumerable:!0,get:function get(){return _hooks.gview}});exports.gglobal=_gglobal;exports.gonce=_gonce;exports.gcache=_gcache;exports.gstorage=_gstorage;exports.gencryption=_gencryption;exports.gstate=_gstate;function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}
|
|
@@ -5,9 +5,10 @@ interface cache_async_params extends get_cache_params {
|
|
|
5
5
|
normal?: boolean;
|
|
6
6
|
session?: boolean;
|
|
7
7
|
storage?: boolean;
|
|
8
|
+
local_storage?: boolean;
|
|
8
9
|
}
|
|
9
10
|
declare type cache_getterFunction<T> = (...params: any) => Promise<T> | T;
|
|
10
|
-
export declare function get_cache<T>(key: string, getterFunction?: cache_getterFunction<T>, params?: cache_async_params): Promise<T |
|
|
11
|
+
export declare function get_cache<T>(key: string, getterFunction?: cache_getterFunction<T>, params?: cache_async_params): Promise<T | null>;
|
|
11
12
|
export declare function set_cache(key: string, value: any, params?: cache_async_params): Promise<any>;
|
|
12
13
|
export declare function delete_cache(key: string, params?: cache_async_params): Promise<any>;
|
|
13
14
|
export declare function set_cache_sync(key: string, value: any): any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.get_cache=get_cache,exports.set_cache=set_cache,exports.delete_cache=delete_cache,exports.set_cache_sync=set_cache_sync,exports.get_cache_sync=get_cache_sync,exports.delete_cache_sync=delete_cache_sync,exports.get_cacheFunc=get_cacheFunc,exports.set_cacheFunc=set_cacheFunc;var _core=_interopRequireDefault(require("../core")),_index=require("../../index");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var sname="cache",lname="list_cache",lname_f="list_cache_func";function get_cache(){return _get_cache.apply(this,arguments)}function _get_cache(){return _get_cache=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b,c,d){var e,f,g,h,i,j;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(d||(d={}),b=_core["default"].fixKey(b),e="".concat(sname,"-").concat(b),f="",g=!1,!(d.session||d.storage)){a.next=11;break}return a.next=8,_index.gstorage.get_var(e,{session:d.session,storage:d.storage});case 8:f=a.sent,a.next=12;break;case 11:f=_core["default"].Global_get(lname,b);case 12:if(f){a.next=24;break}if(h=null,"function"==typeof c?h=c:null==h&&(h=get_cacheFunc(b)),"function"!=typeof h){a.next=24;break}return a.t0=JSON,a.t1=convert_to_cacheObject,a.next=20,h(d);case 20:a.t2=a.sent,a.t3=(0,a.t1)(a.t2),f=a.t0.stringify.call(a.t0,a.t3),g=!0;case 24:if(i=load_cacheObject(f),j=get_cacheValue(i),!(g&&null!=j)){a.next=29;break}return a.next=29,set_cache(b,j,d);case 29:if(d.search){a.next=31;break}return a.abrupt("return",j);case 31:return a.abrupt("return",searchResult(j,d.search));case 32:case"end":return a.stop();}},a)})),_get_cache.apply(this,arguments)}function set_cache(){return _set_cache.apply(this,arguments)}function _set_cache(){return _set_cache=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b,c,d){var e,f;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(d||(d={}),b=_core["default"].fixKey(b),e="".concat(sname,"-").concat(b),f=null==c?c:JSON.stringify(convert_to_cacheObject(c)),!(d.session||d.storage)){a.next=9;break}return a.next=7,_index.gstorage.set_var(e,f,{session:d.session,storage:d.storage});case 7:a.next=10;break;case 9:_core["default"].Global_set(lname,b,f);case 10:return a.abrupt("return",c);case 11:case"end":return a.stop();}},a)})),_set_cache.apply(this,arguments)}function delete_cache(){return _delete_cache.apply(this,arguments)}/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */function _delete_cache(){return _delete_cache=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b,c){return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,set_cache(b,void 0,c);case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop();}},a)})),_delete_cache.apply(this,arguments)}function set_cache_sync(a,b){if(null==b)return _core["default"].Global_set(lname,a,b);var c=JSON.stringify(convert_to_cacheObject(b));return _core["default"].Global_set(lname,a,c)}function get_cache_sync(a,b,c){c||(c={}),a=_core["default"].fixKey(a);/* -------------------------------------------------------------------------- */ /* get the cache */ /* -------------------------------------------------------------------------- */var d="",e=!1;/* -------------------------------------------------------------------------- */ /* if cache not found use the cache func */ /* -------------------------------------------------------------------------- */if(d=_core["default"].Global_get(lname,a),!d){var h=null;"function"==typeof b?h=b:null==h&&(h=get_cacheFunc(a)),"function"==typeof h&&(d=JSON.stringify(convert_to_cacheObject(h(c))),e=!0)}var f=load_cacheObject(d),g=get_cacheValue(f);/* -------------------------------------------------------------------------- */ /* return */ /* -------------------------------------------------------------------------- */return e&&null!=g&&set_cache_sync(a,g),c.search?searchResult(g,c.search):g}function delete_cache_sync(){return _delete_cache_sync.apply(this,arguments)}function _delete_cache_sync(){return _delete_cache_sync=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b){return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,set_cache_sync(b,void 0);case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop();}},a)})),_delete_cache_sync.apply(this,arguments)}function get_cacheFunc(a){return _core["default"].Global_get(lname_f,a)}function set_cacheFunc(a,b){return _core["default"].Global_set(lname_f,a,b)}/* -------------------------------------------------------------------------- */function convert_to_cacheObject(a){var b=_typeof(a),c=stringify_cacheValue(a);return{original_type:b,raw_data:c}}function load_cacheObject(a){if("object"===_typeof(a))return{original_type:a.original_type,raw_data:a.raw_data};if("string"==typeof a)try{return load_cacheObject(JSON.parse(a))}catch(a){}return null}function get_cacheValue(a){if(null!=a&&"object"===_typeof(a)){var b=a.original_type,c=a.raw_data;return"string"===b?c:JSON.parse(c)}}function stringify_cacheValue(a){return null==a?"":"string"==typeof a?a:JSON.stringify(a)}/* -------------------------------------------------------------------------- */function searchResult(a,b){if("object"!=_typeof(a)||"object"!=_typeof(b))return a;//cant search in non objects
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.delete_cache=delete_cache,exports.delete_cache_sync=delete_cache_sync,exports.get_cache=get_cache,exports.get_cacheFunc=get_cacheFunc,exports.get_cache_sync=get_cache_sync,exports.set_cache=set_cache,exports.set_cacheFunc=set_cacheFunc,exports.set_cache_sync=set_cache_sync;var _core=_interopRequireDefault(require("../core")),_index=require("../../index");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var sname="cache",lname="list_cache",lname_f="list_cache_func";function get_cache(){return _get_cache.apply(this,arguments)}function _get_cache(){return _get_cache=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function d(a,b,c){var e,f,g,h,i,j;return _regeneratorRuntime().wrap(function k(d){for(;1;)switch(d.prev=d.next){case 0:return c||(c={}),a=_core["default"].fixKey(a),e="".concat(sname,"-").concat(a),f="",g=!1,c.session||c.storage||c.local_storage||(c.session=!0),d.next=8,_index.gstorage.get_var(e,{local_storage:c.local_storage,session:c.session,storage:c.storage});case 8:if(f=d.sent,f){d.next=21;break}if(h=null,"function"==typeof b?h=b:null==h&&(h=get_cacheFunc(a)),"function"!=typeof h){d.next=21;break}return d.t0=JSON,d.t1=convert_to_cacheObject,d.next=17,h(c);case 17:d.t2=d.sent,d.t3=(0,d.t1)(d.t2),f=d.t0.stringify.call(d.t0,d.t3),g=!0;case 21:if(i=load_cacheObject(f),j=get_cacheValue(i),!(g&&null!=j)){d.next=26;break}return d.next=26,set_cache(a,j,c);case 26:if(null!==j&&void 0!==j){d.next=28;break}return d.abrupt("return",null);case 28:if(c.search){d.next=30;break}return d.abrupt("return",j);case 30:return d.abrupt("return",searchResult(j,c.search));case 31:case"end":return d.stop();}},d)})),_get_cache.apply(this,arguments)}function set_cache(a,b,c){return _set_cache.apply(this,arguments)}function _set_cache(){return _set_cache=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function d(a,b,c){var e,f;return _regeneratorRuntime().wrap(function g(d){for(;1;)switch(d.prev=d.next){case 0:return c||(c={}),a=_core["default"].fixKey(a),e="".concat(sname,"-").concat(a),f=null==b?b:JSON.stringify(convert_to_cacheObject(b)),c.session||c.storage||c.local_storage||(c.session=!0),d.next=7,_index.gstorage.set_var(e,f,{local_storage:c.local_storage,session:c.session,storage:c.storage});case 7:return d.abrupt("return",b);case 8:case"end":return d.stop();}},d)})),_set_cache.apply(this,arguments)}function delete_cache(a,b){return _delete_cache.apply(this,arguments)}/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */function _delete_cache(){return _delete_cache=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a,b){return _regeneratorRuntime().wrap(function d(c){for(;1;)switch(c.prev=c.next){case 0:return c.next=2,set_cache(a,void 0,b);case 2:return c.abrupt("return",c.sent);case 3:case"end":return c.stop();}},c)})),_delete_cache.apply(this,arguments)}function set_cache_sync(a,b){if(null==b)return _core["default"].Global_set(lname,a,b);var c=JSON.stringify(convert_to_cacheObject(b));return _core["default"].Global_set(lname,a,c)}function get_cache_sync(a,b,c){c||(c={}),a=_core["default"].fixKey(a);/* -------------------------------------------------------------------------- */ /* get the cache */ /* -------------------------------------------------------------------------- */var d="",e=!1;/* -------------------------------------------------------------------------- */ /* if cache not found use the cache func */ /* -------------------------------------------------------------------------- */if(d=_core["default"].Global_get(lname,a),!d){var h=null;"function"==typeof b?h=b:null==h&&(h=get_cacheFunc(a)),"function"==typeof h&&(d=JSON.stringify(convert_to_cacheObject(h(c))),e=!0)}var f=load_cacheObject(d),g=get_cacheValue(f);/* -------------------------------------------------------------------------- */ /* return */ /* -------------------------------------------------------------------------- */return e&&null!=g&&set_cache_sync(a,g),c.search?searchResult(g,c.search):g}function delete_cache_sync(a){return _delete_cache_sync.apply(this,arguments)}function _delete_cache_sync(){return _delete_cache_sync=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){return _regeneratorRuntime().wrap(function c(b){for(;1;)switch(b.prev=b.next){case 0:return b.next=2,set_cache_sync(a,void 0);case 2:return b.abrupt("return",b.sent);case 3:case"end":return b.stop();}},b)})),_delete_cache_sync.apply(this,arguments)}function get_cacheFunc(a){return _core["default"].Global_get(lname_f,a)}function set_cacheFunc(a,b){return _core["default"].Global_set(lname_f,a,b)}/* -------------------------------------------------------------------------- */function convert_to_cacheObject(a){var b=_typeof(a),c=stringify_cacheValue(a);return{original_type:b,raw_data:c}}function load_cacheObject(a){if(null===a||a===void 0)return null;if("object"===_typeof(a))return{original_type:a.original_type,raw_data:a.raw_data};if("string"==typeof a)try{return load_cacheObject(JSON.parse(a))}catch(a){}return null}function get_cacheValue(a){if(null===a||a===void 0)return null;if("object"===_typeof(a)){var b=a.original_type,c=a.raw_data;return"string"===b?c:JSON.parse(c)}return null}function stringify_cacheValue(a){return null==a?"":"string"==typeof a?a:JSON.stringify(a)}/* -------------------------------------------------------------------------- */function searchResult(a,b){if("object"!=_typeof(a)||"object"!=_typeof(b))return a;//cant search in non objects
|
|
2
2
|
if(!isNaN(b._per_page)&&0>=b._per_page)return null;var c=[];if(Array.isArray(a))for(var d,e=0;e<a.length;e++)d=gMatch(a[e],b),d&&c.push(d);else{var f=gMatch(a,b);if(f)return f}return isNaN(b._per_page)||(c=c.slice(0,+b._per_page)),c}function gMatch(a,b){if("object"!=_typeof(a)||"object"!=_typeof(b))return a;//cant search in non objects
|
|
3
3
|
var c=!0;for(var g in b)if(g&&!g.startsWith("_")&&Object.hasOwnProperty.call(b,g)&&Object.hasOwnProperty.call(a,g)){var d=!1,e=b[g],f=a[g];if(f===e)continue;if(!isNaN(f)&&!isNaN(e)){d=!1,c=!1;break}var h=e+"";if(h.startsWith("!")?(h=h.substr(1),d=(f+"").toLowerCase()==h.toLowerCase()):d=(f+"").toLowerCase().includes((h+"").toLowerCase()),!d){c=!1;break}}return c?a:null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=exports.GlobalStorage=void 0;function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}var GlobalStorage=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,null,[{key:"initGlobal",value:function initGlobal(){return null!=a&&void(null==a.deus_globals&&(a.deus_globals={}))}/* -------------------------------------------------------------------------- */},{key:"Global_set",value:function Global_set(b,c,d){return a.loadGlobals(b),!0===c?(null==d||null==d?delete a.deus_globals[b]:a.deus_globals[b]=d,a.deus_globals[b]=d):(c=a.fixKey(c),null==d||null==d?delete a.deus_globals[b][c]:a.deus_globals[b][c]=d),d}/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=exports.GlobalStorage=void 0;function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}var GlobalStorage=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,null,[{key:"initGlobal",value:function initGlobal(){return null!=a&&void(null==a.deus_globals&&(a.deus_globals={}))}/* -------------------------------------------------------------------------- */},{key:"Global_set",value:function Global_set(b,c,d){return a.loadGlobals(b),!0===c?(null==d||null==d?delete a.deus_globals[b]:a.deus_globals[b]=d,a.deus_globals[b]=d):(c=a.fixKey(c),null==d||null==d?delete a.deus_globals[b][c]:a.deus_globals[b][c]=d),d}/**
|
|
2
2
|
*
|
|
3
3
|
* @param type
|
|
4
4
|
* @param key
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Decode=Decode,exports.Decode_Default=Decode_Default,exports.Encode=Encode,exports.Encode_Default=Encode_Default,exports.Get_Secret=Get_Secret,exports.Hash=Hash,exports.IsHashValid=IsHashValid,exports.Set_Secret=Set_Secret;var _cryptoJs=_interopRequireDefault(require("crypto-js")),_core=_interopRequireDefault(require("../core"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}function Hash(){return _Hash.apply(this,arguments)}function _Hash(){return _Hash=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d;return _regeneratorRuntime().wrap(function e(b){for(;1;)switch(b.prev=b.next){case 0:return c=a,b.next=3,_cryptoJs["default"].SHA256(c).toString();case 3:return d=b.sent,b.abrupt("return",d);case 5:case"end":return b.stop();}},b)})),_Hash.apply(this,arguments)}function IsHashValid(a,b){return _IsHashValid.apply(this,arguments)}function _IsHashValid(){return _IsHashValid=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a,b){var d,e;return _regeneratorRuntime().wrap(function f(c){for(;1;)switch(c.prev=c.next){case 0:return d=b,c.next=3,_cryptoJs["default"].SHA256(d).toString();case 3:return e=c.sent,c.abrupt("return",e===a);case 5:case"end":return c.stop();}},c)})),_IsHashValid.apply(this,arguments)}function Encode(a,b){if(!a||!b||0>=b.length)return a;if("string"!=typeof a)throw Error("Cant Encode non-string");var c=_cryptoJs["default"].AES.encrypt(a,b).toString();//console.log("Encode " + data + " = " + encrypted);
|
|
2
2
|
return c}function Decode(a,b){if(!a||!b||0>=b.length)return a;if("string"!=typeof a)throw Error("Cant Decode non-string");var c="";try{// console.log("Decode " + data + " = " + decrypted);
|
|
3
|
-
return c=_cryptoJs["default"].AES.decrypt(a,b).toString(_cryptoJs["default"].enc.Utf8),c}catch(b){return a}}function Encode_Default(){return _Encode_Default.apply(this,arguments)}function _Encode_Default(){return _Encode_Default=_asyncToGenerator(/*#__PURE__*/
|
|
3
|
+
return c=_cryptoJs["default"].AES.decrypt(a,b).toString(_cryptoJs["default"].enc.Utf8),c}catch(b){return a}}function Encode_Default(a){return _Encode_Default.apply(this,arguments)}function _Encode_Default(){return _Encode_Default=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){return _regeneratorRuntime().wrap(function c(b){for(;1;)switch(b.prev=b.next){case 0:return b.abrupt("return",Encode(a,Get_Secret()));case 1:case"end":return b.stop();}},b)})),_Encode_Default.apply(this,arguments)}function Decode_Default(a){return _Decode_Default.apply(this,arguments)}function _Decode_Default(){return _Decode_Default=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){return _regeneratorRuntime().wrap(function c(b){for(;1;)switch(b.prev=b.next){case 0:return b.abrupt("return",Decode(a,Get_Secret()));case 1:case"end":return b.stop();}},b)})),_Decode_Default.apply(this,arguments)}function Set_Secret(a){return _core["default"].Global_set("encryption","secret",a)}function Get_Secret(){var a;return null!==(a=_core["default"].Global_get("encryption","secret"))&&void 0!==a?a:"default_secret"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_filter=add_filter,exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_filter=add_filter,exports.apply_filter=apply_filter,exports.apply_filter_sync=apply_filter_sync,exports.clear_all_filters=clear_all_filters,exports.clear_filter=clear_filter,exports.hold_add_filter=hold_add_filter,exports.remove_filter=remove_filter;var _react=_interopRequireDefault(require("react")),_core=_interopRequireDefault(require("../core"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}/* -------------------------------------------------------------------------- */ /* Filters */ /* -------------------------------------------------------------------------- */var lname_filter="list_filter";/**
|
|
2
2
|
* Adds a filter
|
|
3
3
|
* @param key
|
|
4
4
|
* @param action action of the filter
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @param key
|
|
15
15
|
* @param initialValue
|
|
16
16
|
* @returns
|
|
17
|
-
*/function _apply_filter(){return _apply_filter=_asyncToGenerator(/*#__PURE__*/
|
|
17
|
+
*/function _apply_filter(){return _apply_filter=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i=arguments;return _regeneratorRuntime().wrap(function j(b){for(;1;)switch(b.prev=b.next){case 0:if(c=1<i.length&&void 0!==i[1]?i[1]:null,d=_core["default"].Global_get(lname_filter,a),Array.isArray(d)&&0!=d.length){b.next=4;break}return b.abrupt("return",c);case 4:d.sort(function(c,a){return c.priority>a.priority?1:-1}),e=c,f=0;case 7:if(!(f<d.length)){b.next=16;break}return g=d[f],b.next=11,g.action(e);case 11:h=b.sent,e=h;case 13:f++,b.next=7;break;case 16:return b.abrupt("return",e);case 17:case"end":return b.stop();}},b)})),_apply_filter.apply(this,arguments)}function apply_filter_sync(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,c=_core["default"].Global_get(lname_filter,a);if(!Array.isArray(c)||0==c.length)return b;c.sort(function(c,a){return c.priority>a.priority?1:-1});for(var d=b,e=0;e<c.length;e++){var f=c[e],g=f.action(d);g!==void 0&&(d=g)}return d}/* -------------------------------------------------------------------------- */ /**
|
|
18
18
|
* Adds a filter until the current component unmounts
|
|
19
19
|
* @param key
|
|
20
20
|
* @param action
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.get_action=get_action,exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_action=add_action,exports.get_action=get_action,exports.hold_add_action=hold_add_action,exports.hold_set_action=hold_set_action,exports.remove_action=remove_action,exports.run_action=run_action,exports.run_action_clear=run_action_clear,exports.run_action_sync=run_action_sync,exports.set_action=set_action;var _react=_interopRequireDefault(require("react")),_core=_interopRequireDefault(require("../core"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var lname="list_func";/* -------------------------------------------------------------------------- */function get_action(a){var b=_core["default"].Global_get(lname,a);return Array.isArray(b)||"function"==typeof b?b:null}/**
|
|
2
2
|
* set action in action list by its key , you can later run this action using the key
|
|
3
3
|
* @param key
|
|
4
4
|
* @param value
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
* @param key
|
|
24
24
|
* @param args
|
|
25
25
|
* @returns result of action if there is a single action , or an array of results if there are multiple actions
|
|
26
|
-
*/function _run_action_clear(){return _run_action_clear=_asyncToGenerator(/*#__PURE__*/
|
|
26
|
+
*/function _run_action_clear(){return _run_action_clear=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g=arguments;return _regeneratorRuntime().wrap(function h(b){for(;1;)switch(b.prev=b.next){case 0:for(c=g.length,d=Array(1<c?c-1:0),e=1;e<c;e++)d[e-1]=g[e];return b.next=3,run_action.apply(void 0,[a].concat(d));case 3:return f=b.sent,set_action(a,null),b.abrupt("return",f);case 6:case"end":return b.stop();}},b)})),_run_action_clear.apply(this,arguments)}function run_action(a){return _run_action.apply(this,arguments)}/**
|
|
27
27
|
* Runs an action or a list of actions by their key,
|
|
28
28
|
* @param key
|
|
29
29
|
* @param args
|
|
30
30
|
* @returns result of action if there is a single action , or an array of results if there are multiple actions
|
|
31
|
-
*/function _run_action(){return _run_action=_asyncToGenerator(/*#__PURE__*/
|
|
31
|
+
*/function _run_action(){return _run_action=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function b(a){var c,d,e,f,g,h,i,j,k,l=arguments;return _regeneratorRuntime().wrap(function m(b){for(;1;)switch(b.prev=b.next){case 0:if(c=get_action(a),null!=c){b.next=3;break}return b.abrupt("return",null);case 3:for(d=l.length,e=Array(1<d?d-1:0),f=1;f<d;f++)e[f-1]=l[f];if("function"!=typeof c){b.next=9;break}return g=c,b.next=8,g.apply(void 0,e);case 8:return b.abrupt("return",b.sent);case 9:if(!Array.isArray(c)){b.next=29;break}h=[],i=0;case 12:if(!(i<c.length)){b.next=26;break}if(j=c[i],"function"!=typeof j){b.next=22;break}return k=null,b.next=18,j.apply(void 0,e);case 18:k=b.sent,h.push(k),b.next=23;break;case 22:console.error("[run_action]","non function detected ","key:",a);case 23:i++,b.next=12;break;case 26:return b.abrupt("return",h);case 29:console.error("[run_action]","invalid functions detected ","key:",a);case 30:case"end":return b.stop();}},b)})),_run_action.apply(this,arguments)}function run_action_sync(a){var b=get_action(a);if(null==b)return null;for(var c=arguments.length,d=Array(1<c?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];if("function"==typeof b){var i=b;return i.apply(void 0,d)}if(Array.isArray(b)){for(var f,g=[],h=0;h<b.length;h++)if(f=b[h],"function"==typeof f){var j=null;j=f.apply(void 0,d),g.push(j)}else console.error("[run_action]","non function detected ","key:",a);return g}console.error("[run_action]","invalid functions detected ","key:",a)}/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ /**
|
|
32
32
|
* Adds an action until the current component unmounts
|
|
33
33
|
* @param key
|
|
34
34
|
* @param value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_view=add_view,exports.load_views=load_views,exports.use_views=use_views
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViewsContainer=ViewsContainer,exports.add_view=add_view,exports.load_views=load_views,exports.use_views=use_views;var _react=_interopRequireDefault(require("react")),_core=_interopRequireDefault(require("../core"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/* -------------------------------------------------------------------------- */ /* Filters */ /* -------------------------------------------------------------------------- */var lname_views="list_views";/**
|
|
2
2
|
* Adds a view to view list
|
|
3
3
|
* @param key
|
|
4
4
|
* @param action action of the filter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _gfunc=_interopRequireWildcard(require("./g_func"));var _gfilter=_interopRequireWildcard(require("./g_filter"));var _gview=_interopRequireWildcard(require("./g_view"));var _gholder=_interopRequireWildcard(require("./g_holder"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";var _gfunc=_interopRequireWildcard(require("./g_func"));var _gfilter=_interopRequireWildcard(require("./g_filter"));var _gview=_interopRequireWildcard(require("./g_view"));var _gholder=_interopRequireWildcard(require("./g_holder"));function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.gview=exports.gholder=exports.gfunc=exports.gfilter=void 0;exports.gfunc=_gfunc;exports.gfilter=_gfilter;exports.gview=_gview;exports.gholder=_gholder;function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _core=_interopRequireDefault(require("../core"));Object.defineProperty(exports,"__esModule",{value:!0}),exports.do_once=do_once,exports.reset_once=reset_once;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var lname="list_once";function do_once(){return _do_once.apply(this,arguments)}function _do_once(){return _do_once=_asyncToGenerator(/*#__PURE__*/
|
|
1
|
+
"use strict";var _core=_interopRequireDefault(require("../core"));Object.defineProperty(exports,"__esModule",{value:!0}),exports.do_once=do_once,exports.reset_once=reset_once;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var lname="list_once";function do_once(){return _do_once.apply(this,arguments)}function _do_once(){return _do_once=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function d(a,b,c){var e;return _regeneratorRuntime().wrap(function f(d){for(;1;)switch(d.prev=d.next){case 0:if(a&&"function"==typeof a){d.next=2;break}return d.abrupt("return",null);case 2:if(b&&""!=b||(b="fn-"+a.name),e=_core["default"].Global_get(lname,b),"true"!=e){d.next=10;break}if(!c){d.next=9;break}return d.next=8,c();case 8:return d.abrupt("return",d.sent);case 9:return d.abrupt("return",null);case 10:return _core["default"].Global_set(lname,b,"true"),d.next=13,a();case 13:return d.abrupt("return",d.sent);case 14:case"end":return d.stop();}},d)})),_do_once.apply(this,arguments)}function reset_once(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return a&&""!=a?(_core["default"].Global_set(lname,a,null),!0):(_core["default"].Global_set(lname,!0,null),!0)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_state=add_state,exports.hold_add_state=hold_add_state,exports.hold_set_keystate=hold_set_keystate,exports.hold_set_state=hold_set_state,exports.remove_keystate=remove_keystate,exports.remove_state=remove_state,exports.set_keystate=set_keystate,exports.set_state=set_state,exports.use_state=use_state;var _pullstate=require("pullstate"),_react=_interopRequireDefault(require("react"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}var sd={},DataStore=new _pullstate.Store(sd),handler_name="gstate_handler",lname="gstate_list";function set_state(a,b){return DataStore.update(function(c){if(c&&"object"==_typeof(c)||(c={}),"string"==typeof a)c[a]=b;else if("function"==typeof a){var d=a(c);null!=d&&(c=d)}}),!0;//const updateFunc = GlobalStorage.Global_get(handler_name, "state_changed");
|
|
2
2
|
//if (typeof updateFunc === "function") {
|
|
3
3
|
// updateFunc(state_name, value);
|
|
4
4
|
// return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_var=add_var,exports.get_var_sync=get_var_sync,exports.get_var=get_var,exports.set_var=set_var,exports.hold_var=hold_var;var _asyncStorage=_interopRequireDefault(require("@react-native-async-storage/async-storage")),_react=_interopRequireDefault(require("react")),_index=require("../../index"),_core=_interopRequireDefault(require("../core"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var lname="list_var";function add_var(){return _add_var.apply(this,arguments)}function _add_var(){return _add_var=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b,c,d){var e;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,get_var(b,d);case 2:return e=a.sent,Array.isArray(e)||(e=[]),e.push(c),a.next=7,set_var(b,e,d);case 7:return a.abrupt("return",e);case 8:case"end":return a.stop();}},a)})),_add_var.apply(this,arguments)}function get_var_sync(a){var b=_core["default"].Global_get(lname,a),c="string"==typeof b;return c?(b=_index.gencryption.Decode_Default(b),b):b}function get_var(){return _get_var.apply(this,arguments)}function _get_var(){return _get_var=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b,c){var d,e,f,g;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(c||(c={}),d=c.json,e=null,!c.normal&&(c.session||c.storage)||(e=_core["default"].Global_get(lname,b)),!(null==e&&c.session)){a.next=9;break}return f=window.sessionStorage,a.next=8,f.getItem(b);case 8:e=a.sent;case 9:if(!(null==e&&c.storage)){a.next=13;break}return a.next=12,_asyncStorage["default"].getItem(b);case 12:e=a.sent;case 13:if(null!=e){a.next=15;break}return a.abrupt("return",null);case 15:if(g="string"==typeof e,g){a.next=18;break}return a.abrupt("return",e);case 18:return a.next=20,_index.gencryption.Decode_Default(e);case 20:if(e=a.sent,d)try{e=JSON.parse(e)}catch(a){}return a.abrupt("return",e);case 23:case"end":return a.stop();}},a)})),_get_var.apply(this,arguments)}function set_var(){return _set_var.apply(this,arguments)}/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */function _set_var(){return _set_var=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function a(b,c,d){var e,f,g,h;return regeneratorRuntime.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(d||(d={}),e=c,f=d.json&&"function"!=typeof e,f)try{e=JSON.stringify(e)}catch(a){}if((null===e||void 0===e)&&(e=""),g="string"==typeof e,!g){a.next=10;break}return a.next=9,_index.gencryption.Encode_Default(e);case 9:e=a.sent;case 10:if(!d.normal&&(d.session||d.storage)){a.next=13;break}return a.next=13,_core["default"].Global_set(lname,b,e);case 13:if(!d.session){a.next=24;break}if(g){a.next=16;break}throw new Error("You cant save non-string values in session !");case 16:if(h=window.sessionStorage,""===e){a.next=22;break}return a.next=20,h.setItem(b,e);case 20:a.next=24;break;case 22:return a.next=24,h["delete"](b);case 24:if(!d.storage){a.next=34;break}if(g){a.next=27;break}throw new Error("You cant save non-string values in AsyncStorage !");case 27:if(""===e){a.next=32;break}return a.next=30,_asyncStorage["default"].setItem(b,e);case 30:a.next=34;break;case 32:return a.next=34,_asyncStorage["default"].removeItem(b);case 34:return a.abrupt("return",e);case 35:case"end":return a.stop();}},a)})),_set_var.apply(this,arguments)}function hold_var(a,b,c){return _react["default"].useEffect(function(){return set_var(a,b,c),function(){set_var(a,null,c)}},[b]),b}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.add_var=add_var,exports.get_var=get_var,exports.get_var_sync=get_var_sync,exports.hold_var=hold_var,exports.set_var=set_var;var _asyncStorage=_interopRequireDefault(require("@react-native-async-storage/async-storage")),_react=_interopRequireDefault(require("react")),_index=require("../../index"),_core=_interopRequireDefault(require("../core"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function a(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function b(a,b,e,f){var g=b&&b.prototype instanceof d?b:d,h=Object.create(g.prototype),j=new l(f||[]);return h._invoke=function(a,b,d){var e="suspendedStart";return function(f,g){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===f)throw g;return n()}for(d.method=f,d.arg=g;;){var h=d.delegate;if(h){var j=i(h,d);if(j){if(j===v)continue;return j}}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if("suspendedStart"===e)throw e="completed",d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e="executing";var k=c(a,b,d);if("normal"===k.type){if(e=d.done?"completed":"suspendedYield",k.arg===v)continue;return{value:k.arg,done:d.done}}"throw"===k.type&&(e="completed",d.method="throw",d.arg=k.arg)}}}(a,e,j),h}function c(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function d(){}function e(){}function f(){}function g(b){["next","throw","return"].forEach(function(c){a(b,c,function(a){return this._invoke(c,a)})})}function h(a,b){function d(e,f,g,h){var i=c(a[e],a,f);if("throw"!==i.type){var j=i.arg,k=j.value;return k&&"object"==_typeof(k)&&q.call(k,"__await")?b.resolve(k.__await).then(function(a){d("next",a,g,h)},function(a){d("throw",a,g,h)}):b.resolve(k).then(function(a){j.value=a,g(j)},function(a){return d("throw",a,g,h)})}h(i.arg)}var e;this._invoke=function(a,c){function f(){return new b(function(b,e){d(a,c,b,e)})}return e=e?e.then(f,f):f()}}function i(a,b){var d=a.iterator[b.method];if(void 0===d){if(b.delegate=null,"throw"===b.method){if(a.iterator["return"]&&(b.method="return",b.arg=void 0,i(a,b),"throw"===b.method))return v;b.method="throw",b.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var e=c(d,a.iterator,b.arg);if("throw"===e.type)return b.method="throw",b.arg=e.arg,b.delegate=null,v;var f=e.arg;return f?f.done?(b[a.resultName]=f.value,b.next=a.nextLoc,"return"!==b.method&&(b.method="next",b.arg=void 0),b.delegate=null,v):f:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,v)}function j(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function k(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function l(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(j,this),this.reset(!0)}function m(a){if(a){var b=a[s];if(b)return b.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var c=-1,d=function b(){for(;++c<a.length;)if(q.call(a,c))return b.value=a[c],b.done=!1,b;return b.value=void 0,b.done=!0,b};return d.next=d}}return{next:n}}function n(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return o};var o={},p=Object.prototype,q=p.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",t=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";try{a({},"")}catch(b){a=function(a,b,c){return a[b]=c}}o.wrap=b;var v={},w={};a(w,s,function(){return this});var x=Object.getPrototypeOf,y=x&&x(x(m([])));y&&y!==p&&q.call(y,s)&&(w=y);var z=f.prototype=d.prototype=Object.create(w);return e.prototype=f,a(z,"constructor",f),a(f,"constructor",e),e.displayName=a(f,u,"GeneratorFunction"),o.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===e||"GeneratorFunction"===(b.displayName||b.name))},o.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,f):(b.__proto__=f,a(b,u,"GeneratorFunction")),b.prototype=Object.create(z),b},o.awrap=function(a){return{__await:a}},g(h.prototype),a(h.prototype,t,function(){return this}),o.AsyncIterator=h,o.async=function(a,c,d,e,f){void 0===f&&(f=Promise);var g=new h(b(a,c,d,e),f);return o.isGeneratorFunction(c)?g:g.next().then(function(a){return a.done?a.value:g.next()})},g(z),a(z,u,"Generator"),a(z,s,function(){return this}),a(z,"toString",function(){return"[object Generator]"}),o.keys=function(a){var b=[];for(var c in a)b.push(c);return b.reverse(),function c(){for(;b.length;){var d=b.pop();if(d in a)return c.value=d,c.done=!1,c}return c.done=!0,c}},o.values=m,l.prototype={constructor:l,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!a)for(var b in this)"t"===b.charAt(0)&&q.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=void 0)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(a){function b(b,d){return f.type="throw",f.arg=a,c.next=b,d&&(c.method="next",c.arg=void 0),!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=q.call(e,"catchLoc"),h=q.call(e,"finallyLoc");if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(!g){if(!h)throw new Error("try statement without catch or finally");if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}}},abrupt:function abrupt(a,b){for(var c,d=this.tryEntries.length-1;0<=d;--d)if(c=this.tryEntries[d],c.tryLoc<=this.prev&&q.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var e=c;break}e&&("break"===a||"continue"===a)&&e.tryLoc<=b&&b<=e.finallyLoc&&(e=null);var f=e?e.completion:{};return f.type=a,f.arg=b,e?(this.method="next",this.next=e.finallyLoc,v):this.complete(f)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),v},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),k(b),v},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var e=d.arg;k(b)}return e}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(a,b,c){return this.delegate={iterator:m(a),resultName:b,nextLoc:c},"next"===this.method&&(this.arg=void 0),v}},o}function asyncGeneratorStep(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){return void c(a)}h.done?b(i):Promise.resolve(i).then(d,e)}function _asyncToGenerator(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){function f(a){asyncGeneratorStep(h,d,e,f,g,"next",a)}function g(a){asyncGeneratorStep(h,d,e,f,g,"throw",a)}var h=a.apply(b,c);f(void 0)})}}var lname="list_var";function add_var(){return _add_var.apply(this,arguments)}function _add_var(){return _add_var=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function d(a,b,c){var e;return _regeneratorRuntime().wrap(function f(d){for(;1;)switch(d.prev=d.next){case 0:return d.next=2,get_var(a,c);case 2:return e=d.sent,Array.isArray(e)||(e=[]),e.push(b),d.next=7,set_var(a,e,c);case 7:return d.abrupt("return",e);case 8:case"end":return d.stop();}},d)})),_add_var.apply(this,arguments)}function get_var_sync(a){var b=_core["default"].Global_get(lname,a),c="string"==typeof b;return c?(b=_index.gencryption.Decode_Default(b),b):b}function get_var(a,b){return _get_var.apply(this,arguments)}function _get_var(){return _get_var=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function c(a,b){var d,e,f,g,h;return _regeneratorRuntime().wrap(function i(c){for(;1;)switch(c.prev=c.next){case 0:if(b||(b={}),d=b.json,e=null,!b.normal&&(b.session||b.storage||b.local_storage)||(e=_core["default"].Global_get(lname,a)),null==e&&b.local_storage&&(f="list_var_"+a,e=localStorage[f]),!(null==e&&b.session)){c.next=10;break}return g=window.sessionStorage,c.next=9,g.getItem(a);case 9:e=c.sent;case 10:if(!(null==e&&b.storage)){c.next=14;break}return c.next=13,_asyncStorage["default"].getItem(a);case 13:e=c.sent;case 14:if(null!=e){c.next=16;break}return c.abrupt("return",null);case 16:if(h="string"==typeof e,h){c.next=19;break}return c.abrupt("return",e);case 19:return c.next=21,_index.gencryption.Decode_Default(e);case 21:if(e=c.sent,d)try{e=JSON.parse(e)}catch(a){}return c.abrupt("return",e);case 24:case"end":return c.stop();}},c)})),_get_var.apply(this,arguments)}function set_var(a,b,c){return _set_var.apply(this,arguments)}/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */function _set_var(){return _set_var=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function d(a,b,c){var e,f,g,h,i;return _regeneratorRuntime().wrap(function j(d){for(;1;)switch(d.prev=d.next){case 0:if(c||(c={}),e=b,f=c.json&&"function"!=typeof e,f)try{e=JSON.stringify(e)}catch(a){}if((null===e||void 0===e)&&(e=""),g="string"==typeof e,!g){d.next=10;break}return d.next=9,_index.gencryption.Encode_Default(e);case 9:e=d.sent;case 10:if(!c.normal&&(c.session||c.storage||c.local_storage)){d.next=13;break}return d.next=13,_core["default"].Global_set(lname,a,e);case 13:if(!c.local_storage){d.next=18;break}if(g){d.next=16;break}throw new Error("You cant save non-string values in local_storage !");case 16:h="list_var_"+a,localStorage[h]=e;case 18:if(!c.session){d.next=29;break}if(g){d.next=21;break}throw new Error("You cant save non-string values in session !");case 21:if(i=window.sessionStorage,""===e){d.next=27;break}return d.next=25,i.setItem(a,e);case 25:d.next=29;break;case 27:return d.next=29,i.removeItem(a);case 29:if(!c.storage){d.next=39;break}if(g){d.next=32;break}throw new Error("You cant save non-string values in AsyncStorage !");case 32:if(""===e){d.next=37;break}return d.next=35,_asyncStorage["default"].setItem(a,e);case 35:d.next=39;break;case 37:return d.next=39,_asyncStorage["default"].removeItem(a);case 39:return d.abrupt("return",e);case 40:case"end":return d.stop();}},d)})),_set_var.apply(this,arguments)}function hold_var(a,b,c){return _react["default"].useEffect(function(){return set_var(a,b,c),function(){set_var(a,null,c)}},[b]),b}
|