@widget-js/core 0.1.2 → 0.1.4

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.
@@ -13,8 +13,12 @@ class BrowserWindowApi {
13
13
  static async setAlwaysOnTop(alwaysOnTop) {
14
14
  await ElectronUtils_1.ElectronUtils.getAPI().invoke(Channel_1.Channel.BROWSER_WINDOW, this.ALWAYS_ON_TOP, alwaysOnTop);
15
15
  }
16
+ static async openUrl(url) {
17
+ await ElectronUtils_1.ElectronUtils.getAPI().invoke(Channel_1.Channel.BROWSER_WINDOW, this.OPEN_LINK, url);
18
+ }
16
19
  }
17
20
  exports.BrowserWindowApi = BrowserWindowApi;
18
21
  BrowserWindowApi.IGNORE_MOUSE_EVENT = "ignore-mouse-event";
19
22
  BrowserWindowApi.WINDOW_VISIBILITY = "window-visibility";
20
23
  BrowserWindowApi.ALWAYS_ON_TOP = "always-on-top";
24
+ BrowserWindowApi.OPEN_LINK = "open-link";
@@ -22,8 +22,20 @@ class WidgetApi {
22
22
  }
23
23
  return widgets;
24
24
  }
25
+ static async getWidgetPackages() {
26
+ return await ElectronUtils_1.ElectronUtils.getAPI().invoke(Channel_1.Channel.WIDGET, this.GET_WIDGET_PACKAGES);
27
+ }
28
+ /**
29
+ *
30
+ * @param name package name
31
+ */
32
+ static async getWidgetPackage(name) {
33
+ return await ElectronUtils_1.ElectronUtils.getAPI().invoke(Channel_1.Channel.WIDGET, this.GET_WIDGET_PACKAGE, name);
34
+ }
25
35
  }
26
36
  exports.WidgetApi = WidgetApi;
27
37
  WidgetApi.REGISTER_WIDGETS = "register-widgets";
28
38
  WidgetApi.REGISTER_WIDGET_PACKAGE = "register-widget-package";
29
39
  WidgetApi.GET_WIDGETS = "get-widgets";
40
+ WidgetApi.GET_WIDGET_PACKAGE = "get-widget-package";
41
+ WidgetApi.GET_WIDGET_PACKAGES = "get-widget-packages";
@@ -10,7 +10,11 @@ export class BrowserWindowApi {
10
10
  static async setAlwaysOnTop(alwaysOnTop) {
11
11
  await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.ALWAYS_ON_TOP, alwaysOnTop);
12
12
  }
13
+ static async openUrl(url) {
14
+ await ElectronUtils.getAPI().invoke(Channel.BROWSER_WINDOW, this.OPEN_LINK, url);
15
+ }
13
16
  }
14
17
  BrowserWindowApi.IGNORE_MOUSE_EVENT = "ignore-mouse-event";
15
18
  BrowserWindowApi.WINDOW_VISIBILITY = "window-visibility";
16
19
  BrowserWindowApi.ALWAYS_ON_TOP = "always-on-top";
20
+ BrowserWindowApi.OPEN_LINK = "open-link";
@@ -19,7 +19,19 @@ export class WidgetApi {
19
19
  }
20
20
  return widgets;
21
21
  }
22
+ static async getWidgetPackages() {
23
+ return await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET_PACKAGES);
24
+ }
25
+ /**
26
+ *
27
+ * @param name package name
28
+ */
29
+ static async getWidgetPackage(name) {
30
+ return await ElectronUtils.getAPI().invoke(Channel.WIDGET, this.GET_WIDGET_PACKAGE, name);
31
+ }
22
32
  }
23
33
  WidgetApi.REGISTER_WIDGETS = "register-widgets";
24
34
  WidgetApi.REGISTER_WIDGET_PACKAGE = "register-widget-package";
25
35
  WidgetApi.GET_WIDGETS = "get-widgets";
36
+ WidgetApi.GET_WIDGET_PACKAGE = "get-widget-package";
37
+ WidgetApi.GET_WIDGET_PACKAGES = "get-widget-packages";
@@ -2,7 +2,9 @@ export declare class BrowserWindowApi {
2
2
  static readonly IGNORE_MOUSE_EVENT = "ignore-mouse-event";
3
3
  static readonly WINDOW_VISIBILITY = "window-visibility";
4
4
  static readonly ALWAYS_ON_TOP = "always-on-top";
5
+ static readonly OPEN_LINK = "open-link";
5
6
  static setIgnoreMouseEvent(ignore: boolean): Promise<void>;
6
7
  static setWindowVisibility(show: boolean): Promise<void>;
7
8
  static setAlwaysOnTop(alwaysOnTop: boolean): Promise<void>;
9
+ static openUrl(url: string): Promise<void>;
8
10
  }
@@ -4,7 +4,15 @@ export declare class WidgetApi {
4
4
  static readonly REGISTER_WIDGETS = "register-widgets";
5
5
  static readonly REGISTER_WIDGET_PACKAGE = "register-widget-package";
6
6
  static readonly GET_WIDGETS = "get-widgets";
7
+ static readonly GET_WIDGET_PACKAGE = "get-widget-package";
8
+ static readonly GET_WIDGET_PACKAGES = "get-widget-packages";
7
9
  static registerWidgets(widgets: Widget[]): Promise<void>;
8
10
  static registerWidgetPackage(widgetPackage: WidgetPackage): Promise<void>;
9
11
  static getWidgets(): Promise<Widget[]>;
12
+ static getWidgetPackages(): Promise<WidgetPackage>;
13
+ /**
14
+ *
15
+ * @param name package name
16
+ */
17
+ static getWidgetPackage(name: string): Promise<WidgetPackage>;
10
18
  }
@@ -42,7 +42,7 @@ export declare class Widget {
42
42
  */
43
43
  readonly lang: string;
44
44
  readonly width: number;
45
- readonly packageName?: string | null;
45
+ packageName?: string | null;
46
46
  readonly height: number;
47
47
  readonly maxWidth: number;
48
48
  readonly maxHeight: number;
@@ -30,8 +30,12 @@ export declare class WidgetPackage {
30
30
  */
31
31
  entry: string;
32
32
  /**
33
- * 测试时的url,如:http://127.0.0.1:8080
33
+ * 测试时的url,如:http://127.0.0.1:8080/#/
34
34
  */
35
35
  debugUrl?: string;
36
+ /**
37
+ * 解压后的文件夹路径
38
+ */
39
+ folder?: string;
36
40
  widgets: Widget[];
37
41
  }
package/dist/umd/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.exampleTypescriptPackage=t():e.exampleTypescriptPackage=t()}(this,(()=>(()=>{var e={736:(e,t,n)=>{"use strict";n.r(t),n.d(t,{camelCase:()=>v,camelCaseTransform:()=>d,camelCaseTransformMerge:()=>h,capitalCase:()=>g,capitalCaseTransform:()=>y,constantCase:()=>_,dotCase:()=>b,headerCase:()=>I,noCase:()=>c,paramCase:()=>A,pascalCase:()=>l,pascalCaseTransform:()=>u,pascalCaseTransformMerge:()=>f,pathCase:()=>E,sentenceCase:()=>O,sentenceCaseTransform:()=>w,snakeCase:()=>P});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e){return e.toLowerCase()}Object.create,Object.create;var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function c(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?i:n,c=t.stripRegexp,u=void 0===c?a:c,f=t.transform,l=void 0===f?o:f,d=t.delimiter,h=void 0===d?" ":d,v=s(s(e,r,"$1\0$2"),u,"\0"),p=0,y=v.length;"\0"===v.charAt(p);)p++;for(;"\0"===v.charAt(y-1);)y--;return v.slice(p,y).split("\0").map(l).join(h)}function s(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function u(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function f(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function l(e,t){return void 0===t&&(t={}),c(e,r({delimiter:"",transform:u},t))}function d(e,t){return 0===t?e.toLowerCase():u(e,t)}function h(e,t){return 0===t?e.toLowerCase():f(e)}function v(e,t){return void 0===t&&(t={}),l(e,r({transform:d},t))}function p(e){return e.charAt(0).toUpperCase()+e.substr(1)}function y(e){return p(e.toLowerCase())}function g(e,t){return void 0===t&&(t={}),c(e,r({delimiter:" ",transform:y},t))}function m(e){return e.toUpperCase()}function _(e,t){return void 0===t&&(t={}),c(e,r({delimiter:"_",transform:m},t))}function b(e,t){return void 0===t&&(t={}),c(e,r({delimiter:"."},t))}function I(e,t){return void 0===t&&(t={}),g(e,r({delimiter:"-"},t))}function A(e,t){return void 0===t&&(t={}),b(e,r({delimiter:"-"},t))}function E(e,t){return void 0===t&&(t={}),b(e,r({delimiter:"/"},t))}function w(e,t){var n=e.toLowerCase();return 0===t?p(n):n}function O(e,t){return void 0===t&&(t={}),c(e,r({delimiter:" ",transform:w},t))}function P(e,t){return void 0===t&&(t={}),b(e,r({delimiter:"_"},t))}},483:(e,t,n)=>{e.exports=function e(t,n,r){function o(a,c){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return o(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var i=void 0,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,r){(function(e){"use strict";var n,r,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(f),c=e.document.createTextNode("");a.observe(c,{characterData:!0}),n=function(){c.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var s=new e.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}var u=[];function f(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}t.exports=function(e){1!==u.push(e)||r||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e(1);function o(){}var i={},a=["REJECTED"],c=["FULFILLED"],s=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,e!==o&&h(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return i.reject(e,t)}r===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,r)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var n=!1;function r(t){n||(n=!0,i.reject(e,t))}function o(t){n||(n=!0,i.resolve(e,t))}var a=v((function(){t(o,r)}));"error"===a.status&&r(a.value)}function v(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===c||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(o);return this.state!==s?l(n,this.state===c?e:t,this.outcome):this.queue.push(new f(n,e,t)),n},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=v(d,t);if("error"===n.status)return i.reject(e,n.value);var r=n.value;if(r)h(e,r);else{e.state=c,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},u.reject=function(e){var t=new this(o);return i.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=new Array(n),c=0,s=-1,u=new this(o);++s<n;)f(e[s],s);return u;function f(e,o){t.resolve(e).then((function(e){a[o]=e,++c!==n||r||(r=!0,i.resolve(u,a))}),(function(e){r||(r=!0,i.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n,r=e.length,a=!1;if(!r)return this.resolve([]);for(var c=-1,s=new this(o);++c<r;)n=e[c],t.resolve(n).then((function(e){a||(a=!0,i.resolve(s,e))}),(function(e){a||(a=!0,i.reject(s,e))}));return s}},{1:1}],3:[function(e,t,r){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function s(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",d=void 0,h={},v=Object.prototype.toString,p="readonly",y="readwrite";function g(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}function m(e){return"boolean"==typeof d?a.resolve(d):function(e){return new a((function(t){var n=e.transaction(l,y),r=i([""]);n.objectStore(l).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function _(e){var t=h[e.name],n={};n.promise=new a((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function b(e){var t=h[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function I(e,t){var n=h[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function A(e,t){return new a((function(n,r){if(h[e.name]=h[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);_(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),b(e)}}))}function E(e){return A(e,!1)}function w(e){return A(e,!0)}function O(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,o=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function P(e){return i([g(atob(e.data))],{type:e.type})}function S(e){return e&&e.__local_forage_encoded_blob}function T(e){var t=this,n=t._initReady().then((function(){var e=h[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return s(n,e,e),n}function N(e,t,n,r){void 0===r&&(r=1);try{var o=e.db.transaction(e.storeName,t);n(null,o)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),w(e)})).then((function(){return function(e){_(e);for(var t=h[e.name],n=t.forages,r=0;r<n.length;r++){var o=n[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,O(e)?w(e):t})).then((function(r){e.db=t.db=r;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=r})).catch((function(t){throw I(e,t),t}))}(e).then((function(){N(e,t,n,r-1)}))})).catch(n);n(o)}}var R={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var o=h[n.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},h[n.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=T);var i=[];function c(){return a.resolve()}for(var s=0;s<o.forages.length;s++){var u=o.forages[s];u!==t&&i.push(u._initReady().catch(c))}var f=o.forages.slice(0);return a.all(i).then((function(){return n.db=o.db,E(n)})).then((function(e){return n.db=e,O(n,t._defaultConfig.version)?w(n):e})).then((function(e){n.db=o.db=e,t._dbInfo=n;for(var r=0;r<f.length;r++){var i=f[r];i!==t&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}}))},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=new a((function(t,r){n.ready().then((function(){N(n._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).openCursor(),c=1;a.onsuccess=function(){var n=a.result;if(n){var r=n.value;S(r)&&(r=P(r));var o=e(r,n.key,c++);void 0!==o?t(o):n.continue()}else t()},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){N(n._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),S(e)&&(e=P(e)),t(e)},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var o=new a((function(n,o){var i;r.ready().then((function(){return i=r._dbInfo,"[object Blob]"===v.call(t)?m(i.db).then((function(e){return e?t:(n=t,new a((function(e,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):t})).then((function(t){N(r._dbInfo,y,(function(i,a){if(i)return o(i);try{var c=a.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var s=c.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=s.error?s.error:s.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return c(o,n),o},removeItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){N(n._dbInfo,y,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){r(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){N(t._dbInfo,y,(function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){N(t._dbInfo,p,(function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n},key:function(e,t){var n=this,r=new a((function(t,r){e<0?t(null):n.ready().then((function(){N(n._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName),c=!1,s=a.openKeyCursor();s.onsuccess=function(){var n=s.result;n?0===e||c?t(n.key):(c=!0,n.advance(e)):t(null)},s.onerror=function(){r(s.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){N(t._dbInfo,p,(function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;if(e.name){var s=e.name===n.name&&i._dbInfo.db?a.resolve(i._dbInfo.db):E(e).then((function(t){var n=h[e.name],r=n.forages;n.db=t;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=t;return t}));r=e.storeName?s.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;_(e);var r=h[e.name],i=r.forages;t.close();for(var c=0;c<i.length;c++){var s=i[c];s._dbInfo.db=null,s._dbInfo.version=n}var u=new a((function(t,r){var i=o.open(e.name,n);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return u.then((function(e){r.db=e;for(var t=0;t<i.length;t++){var n=i[t];n._dbInfo.db=e,b(n._dbInfo)}})).catch((function(t){throw(I(e,t)||a.resolve()).catch((function(){})),t}))}})):s.then((function(t){_(e);var n=h[e.name],r=n.forages;t.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;var c=new a((function(t,n){var r=o.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return c.then((function(e){n.db=e;for(var t=0;t<r.length;t++)b(r[t]._dbInfo)})).catch((function(t){throw(I(e,t)||a.resolve()).catch((function(){})),t}))}))}else r=a.reject("Invalid arguments");return c(r,t),r}};var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/^~~local_forage_type~([^~]+)~/,j="__lfsc__:",M=j.length,W="arbf",k="blob",U="si08",x="ui08",B="uic8",L="si16",F="si32",G="ur16",H="ui32",z="fl32",K="fl64",Q=M+W.length,V=Object.prototype.toString;function J(e){var t,n,r,o,i,a=.75*e.length,c=e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),f=new Uint8Array(u);for(t=0;t<c;t+=4)n=C.indexOf(e[t]),r=C.indexOf(e[t+1]),o=C.indexOf(e[t+2]),i=C.indexOf(e[t+3]),f[s++]=n<<2|r>>4,f[s++]=(15&r)<<4|o>>2,f[s++]=(3&o)<<6|63&i;return u}function X(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=C[n[t]>>2],r+=C[(3&n[t])<<4|n[t+1]>>4],r+=C[(15&n[t+1])<<2|n[t+2]>>6],r+=C[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var Y={serialize:function(e,t){var n="";if(e&&(n=V.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var r,o=j;e instanceof ArrayBuffer?(r=e,o+=W):(r=e.buffer,"[object Int8Array]"===n?o+=U:"[object Uint8Array]"===n?o+=x:"[object Uint8ClampedArray]"===n?o+=B:"[object Int16Array]"===n?o+=L:"[object Uint16Array]"===n?o+=G:"[object Int32Array]"===n?o+=F:"[object Uint32Array]"===n?o+=H:"[object Float32Array]"===n?o+=z:"[object Float64Array]"===n?o+=K:t(new Error("Failed to get type for BinaryArray"))),t(o+X(r))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n="~~local_forage_type~"+e.type+"~"+X(this.result);t("__lfsc__:blob"+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,M)!==j)return JSON.parse(e);var t,n=e.substring(Q),r=e.substring(M,Q);if(r===k&&D.test(n)){var o=n.match(D);t=o[1],n=n.substring(o[0].length)}var a=J(n);switch(r){case W:return a;case k:return i([a],{type:t});case U:return new Int8Array(a);case x:return new Uint8Array(a);case B:return new Uint8ClampedArray(a);case L:return new Int16Array(a);case G:return new Uint16Array(a);case F:return new Int32Array(a);case H:return new Uint32Array(a);case z:return new Float32Array(a);case K:return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:J,bufferToString:X};function q(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function $(e,t,n,r,o,i){e.executeSql(n,r,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,c){c.rows.length?i(e,a):q(e,t,(function(){e.executeSql(n,r,o,i)}),i)}),i):i(e,a)}),i)}function Z(e,t,n,r){var o=this;e=u(e);var i=new a((function(i,a){o.ready().then((function(){void 0===t&&(t=null);var c=t,s=o._dbInfo;s.serializer.serialize(t,(function(t,u){u?a(u):s.db.transaction((function(n){$(n,s,"INSERT OR REPLACE INTO "+s.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){i(c)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void i(Z.apply(o,[e,c,n,r-1]));a(t)}}))}))})).catch(a)}));return c(i,n),i}function ee(e){return new a((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);t({db:e,storeNames:o})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}var te={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var o=new a((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(o){q(o,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=Y,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"SELECT * FROM "+o.storeName,[],(function(n,r){for(var i=r.rows,a=i.length,c=0;c<a;c++){var s=i.item(c),u=s.value;if(u&&(u=o.serializer.deserialize(u)),void 0!==(u=e(u,s.key,c+1)))return void t(u)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},setItem:function(e,t,n){return Z.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n},key:function(e,t){var n=this,r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],o=0;o<n.rows.length;o++)r.push(n.rows.item(o).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,o=this;return c(r=e.name?new a((function(t){var r;r=e.name===n.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(ee(r))})).then((function(e){return new a((function(t,n){e.db.transaction((function(r){function o(e){return new a((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var i=[],c=0,s=e.storeNames.length;c<s;c++)i.push(o(e.storeNames[c]));a.all(i).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):a.reject("Invalid arguments"),t),r}};function ne(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function re(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var oe={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=ne(e,this._defaultConfig),re()?(this._dbInfo=t,t.serializer=Y,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,o=r.length,i=localStorage.length,a=1,c=0;c<i;c++){var s=localStorage.key(c);if(0===s.indexOf(r)){var u=localStorage.getItem(s);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,s.substring(o),a++)))return u}}}));return c(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return c(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var o=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new a((function(o,i){var a=r._dbInfo;a.serializer.serialize(t,(function(t,r){if(r)i(r);else try{localStorage.setItem(a.keyPrefix+e,t),o(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return c(o,n),o},removeItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return c(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return c(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],o=0;o<n;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&r.push(i.substring(e.keyPrefix.length))}return r}));return c(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,o=this;return r=e.name?new a((function(t){e.storeName?t(ne(e,o._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):a.reject("Invalid arguments"),c(r,t),r}},ie=function(e,t){for(var n=e.length,r=0;r<n;){if((o=e[r])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;r++}var o,i;return!1},ae=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ce={},se={},ue={INDEXEDDB:R,WEBSQL:te,LOCALSTORAGE:oe},fe=[ue.INDEXEDDB._driver,ue.WEBSQL._driver,ue.LOCALSTORAGE._driver],le=["dropInstance"],de=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(le),he={description:"",driver:fe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ve(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function pe(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(ae(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var ye=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ue)if(ue.hasOwnProperty(n)){var r=ue[n],o=r._driver;this[n]=o,ce[o]||this.defineDriver(r)}this._defaultConfig=pe({},he),this._config=pe({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new a((function(t,n){try{var r=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(o);for(var i=de.concat("_initStorage"),s=0,u=i.length;s<u;s++){var f=i[s];if((!ie(le,f)||e[f])&&"function"!=typeof e[f])return void n(o)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=a.reject(t);return c(n,arguments[arguments.length-1]),n}},n=0,r=le.length;n<r;n++){var o=le[n];e[o]||(e[o]=t(o))}}();var l=function(n){ce[r]&&console.info("Redefining LocalForage driver: "+r),ce[r]=e,se[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,n):l(!!e._support):l(!0)}catch(e){n(e)}}));return s(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ce[e]?a.resolve(ce[e]):a.reject(new Error("Driver not found."));return s(r,t,n),r},e.prototype.getSerializer=function(e){var t=a.resolve(Y);return s(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return s(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;ae(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){r._config.driver=r.driver()}function c(e){return r._extend(e),i(),r._ready=r._initStorage(r._config),r._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=u.then((function(){var e=o[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var o=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(o).then(c).catch(n)}i();var s=new Error("No available storage method found.");return r._driverSet=a.reject(s),r._driverSet}()}}(o)}))})).catch((function(){i();var e=new Error("No available storage method found.");return r._driverSet=a.reject(e),r._driverSet})),s(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!se[e]},e.prototype._extend=function(e){pe(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=de.length;e<t;e++)ve(this,de[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),ge=new ye;t.exports=ge},{3:3}]},{},[4])(4)},250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiConstants=void 0;class n{}t.ApiConstants=n,n.CONFIG_LAUNCH_AT_STARTUP="CONFIG_LAUNCH_AT_STARTUP",n.CONFIG_WIDGET_TITLE_COLOR="CONFIG_WIDGET_TITLE_COLOR"},828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppApi=void 0;const r=n(823),o=n(714);class i{static async setConfig(e,t){await r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.SET_CONFIG,e,t)}static async getConfig(e,t){const n=await r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.GET_CONFIG,e);return null==n?t:"boolean"==typeof t?"true"===n:n}static openAddWidgetWindow(){r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.OPEN_ADD_WIDGET_WINDOW)}static openSettingWindow(){r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.OPEN_SETTING_WINDOW)}}t.AppApi=i,i.SET_CONFIG="SET_CONFIG",i.GET_CONFIG="GET_CONFIG",i.OPEN_ADD_WIDGET_WINDOW="open-add-widget-window",i.OPEN_SETTING_WINDOW="open-setting-window"},510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastApi=void 0;const r=n(823),o=n(714),i=n(991);t.BroadcastApi=class{static async sendBroadcastEvent(e){await r.ElectronUtils.getAPI().invoke(o.Channel.BROADCAST,JSON.stringify(e))}static async registerBroadcast(e){await i.ElectronApi.addIpcListener(o.Channel.BROADCAST,(t=>{e(JSON.parse(t))}))}static async unregisterBroadcast(){await i.ElectronApi.removeIpcListener(o.Channel.BROADCAST)}}},434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserWindowApi=void 0;const r=n(714),o=n(823);class i{static async setIgnoreMouseEvent(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.IGNORE_MOUSE_EVENT,e)}static async setWindowVisibility(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.WINDOW_VISIBILITY,e)}static async setAlwaysOnTop(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.ALWAYS_ON_TOP,e)}}t.BrowserWindowApi=i,i.IGNORE_MOUSE_EVENT="ignore-mouse-event",i.WINDOW_VISIBILITY="window-visibility",i.ALWAYS_ON_TOP="always-on-top"},714:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Channel=void 0,(n=t.Channel||(t.Channel={})).NOTIFICATION="channel::fun.zujian.core.notification",n.BROWSER_WINDOW="channel::fun.zujian.core.browser_window",n.BROADCAST="channel::fun.zujian.core.broadcast",n.WIDGET="channel::fun.zujian.core.widget",n.APP="channel::fun.zujian.core.app"},991:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElectronApi=void 0;const r=n(823);t.ElectronApi=class{static async addIpcListener(e,t){await r.ElectronUtils.getAPI().addIpcListener(e,t)}static async removeIpcListener(e){await r.ElectronUtils.getAPI().removeIpcListener(e)}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationApi=void 0;const r=n(957),o=n(714),i=n(823);t.NotificationApi=class{static async call(e=5e3){i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({title:"章鱼哥",type:"call",message:"下班提醒",duration:e}))}static async advanceCountdown(e,t,n){i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({title:n,message:e,targetTime:t,type:"advance-countdown"}))}static async countdown(e,t){i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,targetTime:t,type:"countdown"}))}static async success(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"success",duration:t})):this.callback("success",e,t)}static async error(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"error",duration:t})):this.callback("error",e,t)}static async warning(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"warning",duration:t})):this.callback("warning",e,t)}static async message(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"message",duration:t})):this.callback("message",e,t)}static setDebugNotification(e){this.callback=e}}},426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetApi=void 0;const r=n(203),o=n(823),i=n(714);class a{static async registerWidgets(e){await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.REGISTER_WIDGETS,JSON.stringify(e))}static async registerWidgetPackage(e){await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.REGISTER_WIDGET_PACKAGE,JSON.stringify(e))}static async getWidgets(){const e=await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.GET_WIDGETS),t=[];if(e){const n=JSON.parse(e);for(const e in n)t.push(r.Widget.parseObject(n[e]))}return t}}t.WidgetApi=a,a.REGISTER_WIDGETS="register-widgets",a.REGISTER_WIDGET_PACKAGE="register-widget-package",a.GET_WIDGETS="get-widgets"},432:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(203),t),o(n(254),t),o(n(978),t),o(n(791),t),o(n(387),t),o(n(957),t),o(n(363),t),o(n(991),t),o(n(865),t),o(n(434),t),o(n(585),t),o(n(714),t),o(n(426),t),o(n(250),t),o(n(510),t),o(n(828),t),o(n(823),t)},957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Notification=void 0,t.Notification=class{constructor(e){var t,n;this.type="message",this.type=null!==(t=e.type)&&void 0!==t?t:"message",this.title=e.title,this.message=e.message,this.targetTime=e.targetTime,this.duration=null!==(n=e.duration)&&void 0!==n?n:5e3}}},203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetKeyword=t.Widget=void 0;class n{constructor(e){var t,n,r,o,i;this.lang="zh",this.name=e.name,this.title=e.title,this.description=e.description,this.keywords=e.keywords,this.lang=e.lang,this.width=e.width,this.height=e.height,this.maxWidth=null!==(t=e.maxWidth)&&void 0!==t?t:e.width,this.maxHeight=null!==(n=e.maxHeight)&&void 0!==n?n:e.height,this.minWidth=null!==(r=e.minWidth)&&void 0!==r?r:e.width,this.minHeight=null!==(o=e.minHeight)&&void 0!==o?o:e.height,this.url=e.url,this.packageName=e.packageName,this.configUrl=e.configUrl,this.extraUrl=null!==(i=e.extraUrl)&&void 0!==i?i:{}}getTitle(e){var t;return e&&null!==(t=this.title[e])&&void 0!==t?t:this.title[this.lang]}getDescription(e){return e?this.description[e]:this.description[this.lang]}static parseJSON(e){const t=JSON.parse(e);return this.parseObject(t)}static parseObject(e){return new n({configUrl:e.configUrl,description:e.description,extraUrl:e.extraUrl,width:e.width,keywords:e.keywords,lang:e.lang,maxHeight:e.maxHeight,maxWidth:e.maxWidth,height:e.height,packageName:e.packageName,minHeight:e.minHeight,minWidth:e.minWidth,name:e.name,title:e.title,url:e.url})}}var r;t.Widget=n,(r=t.WidgetKeyword||(t.WidgetKeyword={})).RECOMMEND="recommend",r.TOOLS="tools",r.EFFICIENCY="efficiency",r.PICTURE="picture",r.LIFE="life",r.SHORTCUT="shortcut",r.COUNTDOWN="countdown",r.TIMER="timer",r.INFO="info",r.DASHBOARD="dashboard"},791:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetData=void 0,t.WidgetData=class{constructor(e,t){this.id=t,this.name=e}parseJSON(e){Object.assign(this,e)}}},363:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetPackage=void 0,t.WidgetPackage=class{}},387:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetHostMode=t.ThemeMode=t.WidgetParams=void 0;const r=n(470),o=n(736);class i{toUrlParams(){const e=new URLSearchParams,t=Object.getOwnPropertyNames(this);for(let n of t){const t=this[n];t&&e.append(i.PARAM_PREFIX+(0,o.snakeCase)(n),t.toString())}return e}getPersistKey(){return`${this.name}-${this.id}`}static fromCurrentLocation(){let e=window.location.href.split("?")[1];return this.fromObject((0,r.parseQuery)(e))}static setValue(e,t,n){const r=t.replace(this.PARAM_PREFIX,"");r==i.PARAM_ID?e.id=n:r==i.PARAM_X?e.x=parseInt(n):r==i.PARAM_Y?e.y=parseInt(n):r==i.PARAM_HEIGHT?e.height=parseInt(n):r==i.PARAM_WIDTH?e.width=parseInt(n):r==i.PARAM_LANG?e.lang=n:r==i.PARAM_THEME?e.theme=n:r==i.PARAM_MODE?e.mode=parseInt(n):r==i.PARAM_RADIUS?e.radius=parseInt(n):r==i.PARAM_WIDTH_PX?e.widthPx=parseInt(n):r==i.PARAM_HEIGHT_PX?e.heightPx=parseInt(n):r==i.PARAM_NAME?e.name=n:r==i.PARAM_TITLE?e.title=n:r==i.PARAM_PREVIEW&&(e.preview="true"===n)}static fromObject(e){const t=new i,n=Object.getOwnPropertyNames(e);for(let r of n){const n=r,o=e[n];this.setValue(t,n,o)}return t}}var a,c;t.WidgetParams=i,i.PARAM_PREFIX="w_",i.PARAM_ID="id",i.PARAM_WIDTH="width",i.PARAM_HEIGHT="height",i.PARAM_WIDTH_PX="width_px",i.PARAM_HEIGHT_PX="height_px",i.PARAM_X="x",i.PARAM_Y="y",i.PARAM_LANG="lang",i.PARAM_THEME="theme",i.PARAM_MODE="mode",i.PARAM_RADIUS="radius",i.PARAM_NAME="name",i.PARAM_TITLE="title",i.PARAM_PREVIEW="preview",i.PARAMS=[i.PARAM_ID,i.PARAM_WIDTH,i.PARAM_HEIGHT,i.PARAM_X,i.PARAM_Y,i.PARAM_LANG,i.PARAM_THEME,i.PARAM_MODE,i.PARAM_WIDTH_PX,i.PARAM_HEIGHT_PX,i.PARAM_NAME,i.PARAM_TITLE,i.PARAM_PREVIEW],(c=t.ThemeMode||(t.ThemeMode={})).AUTO="auto",c.LIGHT="LIGHT",c.DARK="DARK",(a=t.WidgetHostMode||(t.WidgetHostMode={}))[a.DEFAULT=0]="DEFAULT",a[a.OVERLAP=1]="OVERLAP"},254:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastEvent=void 0;class n{constructor(e,t,n){this.type=e,this.from=t,this.payload=n}}t.BroadcastEvent=n,n.TYPE_WIDGET_UPDATED="broadcast::fun.zujian.core.widget_updated",n.TYPE_APP_CONFIG_UPDATED="broadcast::fun.zujian.core.app_config_updated",n.TYPE_THEME_CHANGED="broadcast::fun.zujian.core.theme_changed"},978:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketEvent=t.WebSocketEventType=void 0,(t.WebSocketEventType||(t.WebSocketEventType={})).RESISTER_WIDGETS="ws::fun.zujian.core.resister_widgets",t.WebSocketEvent=class{constructor(e,t){this.type=e,this.payload=t}}},865:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetDataRepository=void 0;const o=r(n(483)),i=n(254),a=n(510);class c{static async save(e){let t=this.getStore(e.name);const n=await t.setItem(this.getKey(e.name,e.id),JSON.stringify(e)),r=new i.BroadcastEvent(i.BroadcastEvent.TYPE_WIDGET_UPDATED,"",e);return await a.BroadcastApi.sendBroadcastEvent(r),n}static getStore(e){if(this.stores.has(e))return this.stores.get(e);const t=o.default.createInstance({name:e});return this.stores.set(e,t),t}static async saveByName(e){const t=this.getStore(e.name),n=JSON.stringify(e),r=await t.setItem(e.name,n),o=new i.BroadcastEvent(i.BroadcastEvent.TYPE_WIDGET_UPDATED,"",{name:e.name,json:n});return await a.BroadcastApi.sendBroadcastEvent(o),r}static async findByName(e,t){let n=this.getStore(e),r=await n.getItem(e);if(r){const n=new t(e);return n.parseJSON(JSON.parse(r)),n}}static async find(e,t,n){let r=this.getStore(e),o=await r.getItem(this.getKey(e,t));if(o){const r=new n(e,t);return r.parseJSON(JSON.parse(o)),r}}static getKey(e,t){return`${e}@${t}`}}t.WidgetDataRepository=c,c.stores=new Map},194:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encodeParam=t.encodePath=t.encodeQueryKey=t.encodeQueryValue=t.encodeHash=t.PLUS_RE=void 0;const n=/#/g,r=/&/g,o=/\//g,i=/=/g,a=/\?/g;t.PLUS_RE=/\+/g;const c=/%5B/g,s=/%5D/g,u=/%5E/g,f=/%60/g,l=/%7B/g,d=/%7C/g,h=/%7D/g,v=/%20/g;function p(e){return encodeURI(""+e).replace(d,"|").replace(c,"[").replace(s,"]")}function y(e){return p(e).replace(t.PLUS_RE,"%2B").replace(v,"+").replace(n,"%23").replace(r,"%26").replace(f,"`").replace(l,"{").replace(h,"}").replace(u,"^")}function g(e){return p(e).replace(n,"%23").replace(a,"%3F")}t.encodeHash=function(e){return p(e).replace(l,"{").replace(h,"}").replace(u,"^")},t.encodeQueryValue=y,t.encodeQueryKey=function(e){return y(e).replace(i,"%3D")},t.encodePath=g,t.encodeParam=function(e){return null==e?"":g(e).replace(o,"%2F")},t.decode=function(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}},470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeQuery=t.stringifyQuery=t.parseQuery=void 0;const r=n(194),o=Array.isArray;t.parseQuery=function(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const i=n[e].replace(r.PLUS_RE," "),a=i.indexOf("="),c=(0,r.decode)(a<0?i:i.slice(0,a)),s=a<0?null:(0,r.decode)(i.slice(a+1));if(c in t){let e=t[c];o(e)||(e=t[c]=[e]),e.push(s)}else t[c]=s}return t},t.stringifyQuery=function(e){let t="";for(let n in e){const i=e[n];(n=(0,r.encodeQueryKey)(n),null!=i)?(o(i)?i.map((e=>e&&(0,r.encodeQueryValue)(e))):[i&&(0,r.encodeQueryValue)(i)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})):void 0!==i&&(t+=(t.length?"&":"")+n)}return t},t.normalizeQuery=function(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=o(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}},823:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElectronUtils=void 0,t.ElectronUtils=class{static hasElectronApi(){return null!=this.getAPI()}static getAPI(){return Reflect.has(window,"electronAPI")?window.electronAPI:Reflect.has(window.parent,"electronAPI")?window.parent.electronAPI:null}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(432)})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.exampleTypescriptPackage=t():e.exampleTypescriptPackage=t()}(this,(()=>(()=>{var e={736:(e,t,n)=>{"use strict";n.r(t),n.d(t,{camelCase:()=>v,camelCaseTransform:()=>d,camelCaseTransformMerge:()=>h,capitalCase:()=>y,capitalCaseTransform:()=>g,constantCase:()=>m,dotCase:()=>b,headerCase:()=>I,noCase:()=>c,paramCase:()=>A,pascalCase:()=>l,pascalCaseTransform:()=>u,pascalCaseTransformMerge:()=>f,pathCase:()=>E,sentenceCase:()=>P,sentenceCaseTransform:()=>w,snakeCase:()=>O});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e){return e.toLowerCase()}Object.create,Object.create;var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function c(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?i:n,c=t.stripRegexp,u=void 0===c?a:c,f=t.transform,l=void 0===f?o:f,d=t.delimiter,h=void 0===d?" ":d,v=s(s(e,r,"$1\0$2"),u,"\0"),p=0,g=v.length;"\0"===v.charAt(p);)p++;for(;"\0"===v.charAt(g-1);)g--;return v.slice(p,g).split("\0").map(l).join(h)}function s(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function u(e,t){var n=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&n>="0"&&n<="9"?"_"+n+r:""+n.toUpperCase()+r}function f(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function l(e,t){return void 0===t&&(t={}),c(e,r({delimiter:"",transform:u},t))}function d(e,t){return 0===t?e.toLowerCase():u(e,t)}function h(e,t){return 0===t?e.toLowerCase():f(e)}function v(e,t){return void 0===t&&(t={}),l(e,r({transform:d},t))}function p(e){return e.charAt(0).toUpperCase()+e.substr(1)}function g(e){return p(e.toLowerCase())}function y(e,t){return void 0===t&&(t={}),c(e,r({delimiter:" ",transform:g},t))}function _(e){return e.toUpperCase()}function m(e,t){return void 0===t&&(t={}),c(e,r({delimiter:"_",transform:_},t))}function b(e,t){return void 0===t&&(t={}),c(e,r({delimiter:"."},t))}function I(e,t){return void 0===t&&(t={}),y(e,r({delimiter:"-"},t))}function A(e,t){return void 0===t&&(t={}),b(e,r({delimiter:"-"},t))}function E(e,t){return void 0===t&&(t={}),b(e,r({delimiter:"/"},t))}function w(e,t){var n=e.toLowerCase();return 0===t?p(n):n}function P(e,t){return void 0===t&&(t={}),c(e,r({delimiter:" ",transform:w},t))}function O(e,t){return void 0===t&&(t={}),b(e,r({delimiter:"_"},t))}},483:(e,t,n)=>{e.exports=function e(t,n,r){function o(a,c){if(!n[a]){if(!t[a]){if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return o(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var i=void 0,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,r){(function(e){"use strict";var n,r,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(f),c=e.document.createTextNode("");a.observe(c,{characterData:!0}),n=function(){c.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var s=new e.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}var u=[];function f(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}t.exports=function(e){1!==u.push(e)||r||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e(1);function o(){}var i={},a=["REJECTED"],c=["FULFILLED"],s=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=s,this.queue=[],this.outcome=void 0,e!==o&&h(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return i.reject(e,t)}r===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,r)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var n=!1;function r(t){n||(n=!0,i.reject(e,t))}function o(t){n||(n=!0,i.resolve(e,t))}var a=v((function(){t(o,r)}));"error"===a.status&&r(a.value)}function v(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===c||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(o);return this.state!==s?l(n,this.state===c?e:t,this.outcome):this.queue.push(new f(n,e,t)),n},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var n=v(d,t);if("error"===n.status)return i.reject(e,n.value);var r=n.value;if(r)h(e,r);else{e.state=c,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},u.reject=function(e){var t=new this(o);return i.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=new Array(n),c=0,s=-1,u=new this(o);++s<n;)f(e[s],s);return u;function f(e,o){t.resolve(e).then((function(e){a[o]=e,++c!==n||r||(r=!0,i.resolve(u,a))}),(function(e){r||(r=!0,i.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n,r=e.length,a=!1;if(!r)return this.resolve([]);for(var c=-1,s=new this(o);++c<r;)n=e[c],t.resolve(n).then((function(e){a||(a=!0,i.resolve(s,e))}),(function(e){a||(a=!0,i.reject(s,e))}));return s}},{1:1}],3:[function(e,t,r){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function c(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function s(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",d=void 0,h={},v=Object.prototype.toString,p="readonly",g="readwrite";function y(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),o=0;o<t;o++)r[o]=e.charCodeAt(o);return n}function _(e){return"boolean"==typeof d?a.resolve(d):function(e){return new a((function(t){var n=e.transaction(l,g),r=i([""]);n.objectStore(l).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function m(e){var t=h[e.name],n={};n.promise=new a((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function b(e){var t=h[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function I(e,t){var n=h[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function A(e,t){return new a((function(n,r){if(h[e.name]=h[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);m(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),b(e)}}))}function E(e){return A(e,!1)}function w(e){return A(e,!0)}function P(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,o=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||n){if(n){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function O(e){return i([y(atob(e.data))],{type:e.type})}function T(e){return e&&e.__local_forage_encoded_blob}function S(e){var t=this,n=t._initReady().then((function(){var e=h[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return s(n,e,e),n}function N(e,t,n,r){void 0===r&&(r=1);try{var o=e.db.transaction(e.storeName,t);n(null,o)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),w(e)})).then((function(){return function(e){m(e);for(var t=h[e.name],n=t.forages,r=0;r<n.length;r++){var o=n[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,P(e)?w(e):t})).then((function(r){e.db=t.db=r;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=r})).catch((function(t){throw I(e,t),t}))}(e).then((function(){N(e,t,n,r-1)}))})).catch(n);n(o)}}var R={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var o=h[n.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},h[n.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=S);var i=[];function c(){return a.resolve()}for(var s=0;s<o.forages.length;s++){var u=o.forages[s];u!==t&&i.push(u._initReady().catch(c))}var f=o.forages.slice(0);return a.all(i).then((function(){return n.db=o.db,E(n)})).then((function(e){return n.db=e,P(n,t._defaultConfig.version)?w(n):e})).then((function(e){n.db=o.db=e,t._dbInfo=n;for(var r=0;r<f.length;r++){var i=f[r];i!==t&&(i._dbInfo.db=n.db,i._dbInfo.version=n.version)}}))},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=new a((function(t,r){n.ready().then((function(){N(n._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).openCursor(),c=1;a.onsuccess=function(){var n=a.result;if(n){var r=n.value;T(r)&&(r=O(r));var o=e(r,n.key,c++);void 0!==o?t(o):n.continue()}else t()},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){N(n._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),T(e)&&(e=O(e)),t(e)},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var o=new a((function(n,o){var i;r.ready().then((function(){return i=r._dbInfo,"[object Blob]"===v.call(t)?_(i.db).then((function(e){return e?t:(n=t,new a((function(e,t){var r=new FileReader;r.onerror=t,r.onloadend=function(t){var r=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:n.type})},r.readAsBinaryString(n)})));var n})):t})).then((function(t){N(r._dbInfo,g,(function(i,a){if(i)return o(i);try{var c=a.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var s=c.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=s.error?s.error:s.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return c(o,n),o},removeItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){N(n._dbInfo,g,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){r(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){N(t._dbInfo,g,(function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){N(t._dbInfo,p,(function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n},key:function(e,t){var n=this,r=new a((function(t,r){e<0?t(null):n.ready().then((function(){N(n._dbInfo,p,(function(o,i){if(o)return r(o);try{var a=i.objectStore(n._dbInfo.storeName),c=!1,s=a.openKeyCursor();s.onsuccess=function(){var n=s.result;n?0===e||c?t(n.key):(c=!0,n.advance(e)):t(null)},s.onerror=function(){r(s.error)}}catch(e){r(e)}}))})).catch(r)}));return c(r,t),r},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){N(t._dbInfo,p,(function(r,o){if(r)return n(r);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){n(i.error)}}catch(e){n(e)}}))})).catch(n)}));return c(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;if(e.name){var s=e.name===n.name&&i._dbInfo.db?a.resolve(i._dbInfo.db):E(e).then((function(t){var n=h[e.name],r=n.forages;n.db=t;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=t;return t}));r=e.storeName?s.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;m(e);var r=h[e.name],i=r.forages;t.close();for(var c=0;c<i.length;c++){var s=i[c];s._dbInfo.db=null,s._dbInfo.version=n}var u=new a((function(t,r){var i=o.open(e.name,n);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return u.then((function(e){r.db=e;for(var t=0;t<i.length;t++){var n=i[t];n._dbInfo.db=e,b(n._dbInfo)}})).catch((function(t){throw(I(e,t)||a.resolve()).catch((function(){})),t}))}})):s.then((function(t){m(e);var n=h[e.name],r=n.forages;t.close();for(var i=0;i<r.length;i++)r[i]._dbInfo.db=null;var c=new a((function(t,n){var r=o.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return c.then((function(e){n.db=e;for(var t=0;t<r.length;t++)b(r[t]._dbInfo)})).catch((function(t){throw(I(e,t)||a.resolve()).catch((function(){})),t}))}))}else r=a.reject("Invalid arguments");return c(r,t),r}};var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=/^~~local_forage_type~([^~]+)~/,j="__lfsc__:",M=j.length,W="arbf",k="blob",U="si08",x="ui08",B="uic8",L="si16",G="si32",F="ur16",H="ui32",z="fl32",K="fl64",Q=M+W.length,V=Object.prototype.toString;function J(e){var t,n,r,o,i,a=.75*e.length,c=e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),f=new Uint8Array(u);for(t=0;t<c;t+=4)n=C.indexOf(e[t]),r=C.indexOf(e[t+1]),o=C.indexOf(e[t+2]),i=C.indexOf(e[t+3]),f[s++]=n<<2|r>>4,f[s++]=(15&r)<<4|o>>2,f[s++]=(3&o)<<6|63&i;return u}function X(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=C[n[t]>>2],r+=C[(3&n[t])<<4|n[t+1]>>4],r+=C[(15&n[t+1])<<2|n[t+2]>>6],r+=C[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var Y={serialize:function(e,t){var n="";if(e&&(n=V.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var r,o=j;e instanceof ArrayBuffer?(r=e,o+=W):(r=e.buffer,"[object Int8Array]"===n?o+=U:"[object Uint8Array]"===n?o+=x:"[object Uint8ClampedArray]"===n?o+=B:"[object Int16Array]"===n?o+=L:"[object Uint16Array]"===n?o+=F:"[object Int32Array]"===n?o+=G:"[object Uint32Array]"===n?o+=H:"[object Float32Array]"===n?o+=z:"[object Float64Array]"===n?o+=K:t(new Error("Failed to get type for BinaryArray"))),t(o+X(r))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n="~~local_forage_type~"+e.type+"~"+X(this.result);t("__lfsc__:blob"+n)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,M)!==j)return JSON.parse(e);var t,n=e.substring(Q),r=e.substring(M,Q);if(r===k&&D.test(n)){var o=n.match(D);t=o[1],n=n.substring(o[0].length)}var a=J(n);switch(r){case W:return a;case k:return i([a],{type:t});case U:return new Int8Array(a);case x:return new Uint8Array(a);case B:return new Uint8ClampedArray(a);case L:return new Int16Array(a);case F:return new Uint16Array(a);case G:return new Int32Array(a);case H:return new Uint32Array(a);case z:return new Float32Array(a);case K:return new Float64Array(a);default:throw new Error("Unkown type: "+r)}},stringToBuffer:J,bufferToString:X};function q(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function $(e,t,n,r,o,i){e.executeSql(n,r,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,c){c.rows.length?i(e,a):q(e,t,(function(){e.executeSql(n,r,o,i)}),i)}),i):i(e,a)}),i)}function Z(e,t,n,r){var o=this;e=u(e);var i=new a((function(i,a){o.ready().then((function(){void 0===t&&(t=null);var c=t,s=o._dbInfo;s.serializer.serialize(t,(function(t,u){u?a(u):s.db.transaction((function(n){$(n,s,"INSERT OR REPLACE INTO "+s.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){i(c)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void i(Z.apply(o,[e,c,n,r-1]));a(t)}}))}))})).catch(a)}));return c(i,n),i}function ee(e){return new a((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var o=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);t({db:e,storeNames:o})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}var te={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var o=new a((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(o){q(o,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=Y,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"SELECT * FROM "+o.storeName,[],(function(n,r){for(var i=r.rows,a=i.length,c=0;c<a;c++){var s=i.item(c),u=s.value;if(u&&(u=o.serializer.deserialize(u)),void 0!==(u=e(u,s.key,c+1)))return void t(u)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},setItem:function(e,t,n){return Z.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=u(e);var r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},clear:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n},length:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n},key:function(e,t){var n=this,r=new a((function(t,r){n.ready().then((function(){var o=n._dbInfo;o.db.transaction((function(n){$(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return c(r,t),r},keys:function(e){var t=this,n=new a((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],o=0;o<n.rows.length;o++)r.push(n.rows.item(o).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return c(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,o=this;return c(r=e.name?new a((function(t){var r;r=e.name===n.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(ee(r))})).then((function(e){return new a((function(t,n){e.db.transaction((function(r){function o(e){return new a((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var i=[],c=0,s=e.storeNames.length;c<s;c++)i.push(o(e.storeNames[c]));a.all(i).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):a.reject("Invalid arguments"),t),r}};function ne(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function re(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var oe={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=ne(e,this._defaultConfig),re()?(this._dbInfo=t,t.serializer=Y,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,o=r.length,i=localStorage.length,a=1,c=0;c<i;c++){var s=localStorage.key(c);if(0===s.indexOf(r)){var u=localStorage.getItem(s);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,s.substring(o),a++)))return u}}}));return c(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return c(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var o=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new a((function(o,i){var a=r._dbInfo;a.serializer.serialize(t,(function(t,r){if(r)i(r);else try{localStorage.setItem(a.keyPrefix+e,t),o(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return c(o,n),o},removeItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return c(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return c(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return c(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return c(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],o=0;o<n;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&r.push(i.substring(e.keyPrefix.length))}return r}));return c(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,o=this;return r=e.name?new a((function(t){e.storeName?t(ne(e,o._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):a.reject("Invalid arguments"),c(r,t),r}},ie=function(e,t){for(var n=e.length,r=0;r<n;){if((o=e[r])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;r++}var o,i;return!1},ae=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ce={},se={},ue={INDEXEDDB:R,WEBSQL:te,LOCALSTORAGE:oe},fe=[ue.INDEXEDDB._driver,ue.WEBSQL._driver,ue.LOCALSTORAGE._driver],le=["dropInstance"],de=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(le),he={description:"",driver:fe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ve(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function pe(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(ae(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var ge=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ue)if(ue.hasOwnProperty(n)){var r=ue[n],o=r._driver;this[n]=o,ce[o]||this.defineDriver(r)}this._defaultConfig=pe({},he),this._config=pe({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new a((function(t,n){try{var r=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(o);for(var i=de.concat("_initStorage"),s=0,u=i.length;s<u;s++){var f=i[s];if((!ie(le,f)||e[f])&&"function"!=typeof e[f])return void n(o)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=a.reject(t);return c(n,arguments[arguments.length-1]),n}},n=0,r=le.length;n<r;n++){var o=le[n];e[o]||(e[o]=t(o))}}();var l=function(n){ce[r]&&console.info("Redefining LocalForage driver: "+r),ce[r]=e,se[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,n):l(!!e._support):l(!0)}catch(e){n(e)}}));return s(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ce[e]?a.resolve(ce[e]):a.reject(new Error("Driver not found."));return s(r,t,n),r},e.prototype.getSerializer=function(e){var t=a.resolve(Y);return s(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return s(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;ae(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){r._config.driver=r.driver()}function c(e){return r._extend(e),i(),r._ready=r._initStorage(r._config),r._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=u.then((function(){var e=o[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,i(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var o=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(o).then(c).catch(n)}i();var s=new Error("No available storage method found.");return r._driverSet=a.reject(s),r._driverSet}()}}(o)}))})).catch((function(){i();var e=new Error("No available storage method found.");return r._driverSet=a.reject(e),r._driverSet})),s(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!se[e]},e.prototype._extend=function(e){pe(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=de.length;e<t;e++)ve(this,de[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),ye=new ge;t.exports=ye},{3:3}]},{},[4])(4)},250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApiConstants=void 0;class n{}t.ApiConstants=n,n.CONFIG_LAUNCH_AT_STARTUP="CONFIG_LAUNCH_AT_STARTUP",n.CONFIG_WIDGET_TITLE_COLOR="CONFIG_WIDGET_TITLE_COLOR"},828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppApi=void 0;const r=n(823),o=n(714);class i{static async setConfig(e,t){await r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.SET_CONFIG,e,t)}static async getConfig(e,t){const n=await r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.GET_CONFIG,e);return null==n?t:"boolean"==typeof t?"true"===n:n}static openAddWidgetWindow(){r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.OPEN_ADD_WIDGET_WINDOW)}static openSettingWindow(){r.ElectronUtils.getAPI().invoke(o.Channel.APP,this.OPEN_SETTING_WINDOW)}}t.AppApi=i,i.SET_CONFIG="SET_CONFIG",i.GET_CONFIG="GET_CONFIG",i.OPEN_ADD_WIDGET_WINDOW="open-add-widget-window",i.OPEN_SETTING_WINDOW="open-setting-window"},510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastApi=void 0;const r=n(823),o=n(714),i=n(991);t.BroadcastApi=class{static async sendBroadcastEvent(e){await r.ElectronUtils.getAPI().invoke(o.Channel.BROADCAST,JSON.stringify(e))}static async registerBroadcast(e){await i.ElectronApi.addIpcListener(o.Channel.BROADCAST,(t=>{e(JSON.parse(t))}))}static async unregisterBroadcast(){await i.ElectronApi.removeIpcListener(o.Channel.BROADCAST)}}},434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserWindowApi=void 0;const r=n(714),o=n(823);class i{static async setIgnoreMouseEvent(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.IGNORE_MOUSE_EVENT,e)}static async setWindowVisibility(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.WINDOW_VISIBILITY,e)}static async setAlwaysOnTop(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.ALWAYS_ON_TOP,e)}static async openUrl(e){await o.ElectronUtils.getAPI().invoke(r.Channel.BROWSER_WINDOW,this.OPEN_LINK,e)}}t.BrowserWindowApi=i,i.IGNORE_MOUSE_EVENT="ignore-mouse-event",i.WINDOW_VISIBILITY="window-visibility",i.ALWAYS_ON_TOP="always-on-top",i.OPEN_LINK="open-link"},714:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Channel=void 0,(n=t.Channel||(t.Channel={})).NOTIFICATION="channel::fun.zujian.core.notification",n.BROWSER_WINDOW="channel::fun.zujian.core.browser_window",n.BROADCAST="channel::fun.zujian.core.broadcast",n.WIDGET="channel::fun.zujian.core.widget",n.APP="channel::fun.zujian.core.app"},991:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElectronApi=void 0;const r=n(823);t.ElectronApi=class{static async addIpcListener(e,t){await r.ElectronUtils.getAPI().addIpcListener(e,t)}static async removeIpcListener(e){await r.ElectronUtils.getAPI().removeIpcListener(e)}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationApi=void 0;const r=n(957),o=n(714),i=n(823);t.NotificationApi=class{static async call(e=5e3){i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({title:"章鱼哥",type:"call",message:"下班提醒",duration:e}))}static async advanceCountdown(e,t,n){i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({title:n,message:e,targetTime:t,type:"advance-countdown"}))}static async countdown(e,t){i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,targetTime:t,type:"countdown"}))}static async success(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"success",duration:t})):this.callback("success",e,t)}static async error(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"error",duration:t})):this.callback("error",e,t)}static async warning(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"warning",duration:t})):this.callback("warning",e,t)}static async message(e,t=5e3){i.ElectronUtils.hasElectronApi()?i.ElectronUtils.getAPI().invoke(o.Channel.NOTIFICATION,new r.Notification({message:e,type:"message",duration:t})):this.callback("message",e,t)}static setDebugNotification(e){this.callback=e}}},426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetApi=void 0;const r=n(203),o=n(823),i=n(714);class a{static async registerWidgets(e){await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.REGISTER_WIDGETS,JSON.stringify(e))}static async registerWidgetPackage(e){await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.REGISTER_WIDGET_PACKAGE,JSON.stringify(e))}static async getWidgets(){const e=await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.GET_WIDGETS),t=[];if(e){const n=JSON.parse(e);for(const e in n)t.push(r.Widget.parseObject(n[e]))}return t}static async getWidgetPackages(){return await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.GET_WIDGET_PACKAGES)}static async getWidgetPackage(e){return await o.ElectronUtils.getAPI().invoke(i.Channel.WIDGET,this.GET_WIDGET_PACKAGE,e)}}t.WidgetApi=a,a.REGISTER_WIDGETS="register-widgets",a.REGISTER_WIDGET_PACKAGE="register-widget-package",a.GET_WIDGETS="get-widgets",a.GET_WIDGET_PACKAGE="get-widget-package",a.GET_WIDGET_PACKAGES="get-widget-packages"},432:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(203),t),o(n(254),t),o(n(978),t),o(n(791),t),o(n(387),t),o(n(957),t),o(n(363),t),o(n(991),t),o(n(865),t),o(n(434),t),o(n(585),t),o(n(714),t),o(n(426),t),o(n(250),t),o(n(510),t),o(n(828),t),o(n(823),t)},957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Notification=void 0,t.Notification=class{constructor(e){var t,n;this.type="message",this.type=null!==(t=e.type)&&void 0!==t?t:"message",this.title=e.title,this.message=e.message,this.targetTime=e.targetTime,this.duration=null!==(n=e.duration)&&void 0!==n?n:5e3}}},203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetKeyword=t.Widget=void 0;class n{constructor(e){var t,n,r,o,i;this.lang="zh",this.name=e.name,this.title=e.title,this.description=e.description,this.keywords=e.keywords,this.lang=e.lang,this.width=e.width,this.height=e.height,this.maxWidth=null!==(t=e.maxWidth)&&void 0!==t?t:e.width,this.maxHeight=null!==(n=e.maxHeight)&&void 0!==n?n:e.height,this.minWidth=null!==(r=e.minWidth)&&void 0!==r?r:e.width,this.minHeight=null!==(o=e.minHeight)&&void 0!==o?o:e.height,this.url=e.url,this.packageName=e.packageName,this.configUrl=e.configUrl,this.extraUrl=null!==(i=e.extraUrl)&&void 0!==i?i:{}}getTitle(e){var t;return e&&null!==(t=this.title[e])&&void 0!==t?t:this.title[this.lang]}getDescription(e){return e?this.description[e]:this.description[this.lang]}static parseJSON(e){const t=JSON.parse(e);return this.parseObject(t)}static parseObject(e){return new n({configUrl:e.configUrl,description:e.description,extraUrl:e.extraUrl,width:e.width,keywords:e.keywords,lang:e.lang,maxHeight:e.maxHeight,maxWidth:e.maxWidth,height:e.height,packageName:e.packageName,minHeight:e.minHeight,minWidth:e.minWidth,name:e.name,title:e.title,url:e.url})}}var r;t.Widget=n,(r=t.WidgetKeyword||(t.WidgetKeyword={})).RECOMMEND="recommend",r.TOOLS="tools",r.EFFICIENCY="efficiency",r.PICTURE="picture",r.LIFE="life",r.SHORTCUT="shortcut",r.COUNTDOWN="countdown",r.TIMER="timer",r.INFO="info",r.DASHBOARD="dashboard"},791:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetData=void 0,t.WidgetData=class{constructor(e,t){this.id=t,this.name=e}parseJSON(e){Object.assign(this,e)}}},363:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetPackage=void 0,t.WidgetPackage=class{}},387:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetHostMode=t.ThemeMode=t.WidgetParams=void 0;const r=n(470),o=n(736);class i{toUrlParams(){const e=new URLSearchParams,t=Object.getOwnPropertyNames(this);for(let n of t){const t=this[n];t&&e.append(i.PARAM_PREFIX+(0,o.snakeCase)(n),t.toString())}return e}getPersistKey(){return`${this.name}-${this.id}`}static fromCurrentLocation(){let e=window.location.href.split("?")[1];return this.fromObject((0,r.parseQuery)(e))}static setValue(e,t,n){const r=t.replace(this.PARAM_PREFIX,"");r==i.PARAM_ID?e.id=n:r==i.PARAM_X?e.x=parseInt(n):r==i.PARAM_Y?e.y=parseInt(n):r==i.PARAM_HEIGHT?e.height=parseInt(n):r==i.PARAM_WIDTH?e.width=parseInt(n):r==i.PARAM_LANG?e.lang=n:r==i.PARAM_THEME?e.theme=n:r==i.PARAM_MODE?e.mode=parseInt(n):r==i.PARAM_RADIUS?e.radius=parseInt(n):r==i.PARAM_WIDTH_PX?e.widthPx=parseInt(n):r==i.PARAM_HEIGHT_PX?e.heightPx=parseInt(n):r==i.PARAM_NAME?e.name=n:r==i.PARAM_TITLE?e.title=n:r==i.PARAM_PREVIEW&&(e.preview="true"===n)}static fromObject(e){const t=new i,n=Object.getOwnPropertyNames(e);for(let r of n){const n=r,o=e[n];this.setValue(t,n,o)}return t}}var a,c;t.WidgetParams=i,i.PARAM_PREFIX="w_",i.PARAM_ID="id",i.PARAM_WIDTH="width",i.PARAM_HEIGHT="height",i.PARAM_WIDTH_PX="width_px",i.PARAM_HEIGHT_PX="height_px",i.PARAM_X="x",i.PARAM_Y="y",i.PARAM_LANG="lang",i.PARAM_THEME="theme",i.PARAM_MODE="mode",i.PARAM_RADIUS="radius",i.PARAM_NAME="name",i.PARAM_TITLE="title",i.PARAM_PREVIEW="preview",i.PARAMS=[i.PARAM_ID,i.PARAM_WIDTH,i.PARAM_HEIGHT,i.PARAM_X,i.PARAM_Y,i.PARAM_LANG,i.PARAM_THEME,i.PARAM_MODE,i.PARAM_WIDTH_PX,i.PARAM_HEIGHT_PX,i.PARAM_NAME,i.PARAM_TITLE,i.PARAM_PREVIEW],(c=t.ThemeMode||(t.ThemeMode={})).AUTO="auto",c.LIGHT="LIGHT",c.DARK="DARK",(a=t.WidgetHostMode||(t.WidgetHostMode={}))[a.DEFAULT=0]="DEFAULT",a[a.OVERLAP=1]="OVERLAP"},254:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastEvent=void 0;class n{constructor(e,t,n){this.type=e,this.from=t,this.payload=n}}t.BroadcastEvent=n,n.TYPE_WIDGET_UPDATED="broadcast::fun.zujian.core.widget_updated",n.TYPE_APP_CONFIG_UPDATED="broadcast::fun.zujian.core.app_config_updated",n.TYPE_THEME_CHANGED="broadcast::fun.zujian.core.theme_changed"},978:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketEvent=t.WebSocketEventType=void 0,(t.WebSocketEventType||(t.WebSocketEventType={})).RESISTER_WIDGETS="ws::fun.zujian.core.resister_widgets",t.WebSocketEvent=class{constructor(e,t){this.type=e,this.payload=t}}},865:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetDataRepository=void 0;const o=r(n(483)),i=n(254),a=n(510);class c{static async save(e){let t=this.getStore(e.name);const n=await t.setItem(this.getKey(e.name,e.id),JSON.stringify(e)),r=new i.BroadcastEvent(i.BroadcastEvent.TYPE_WIDGET_UPDATED,"",e);return await a.BroadcastApi.sendBroadcastEvent(r),n}static getStore(e){if(this.stores.has(e))return this.stores.get(e);const t=o.default.createInstance({name:e});return this.stores.set(e,t),t}static async saveByName(e){const t=this.getStore(e.name),n=JSON.stringify(e),r=await t.setItem(e.name,n),o=new i.BroadcastEvent(i.BroadcastEvent.TYPE_WIDGET_UPDATED,"",{name:e.name,json:n});return await a.BroadcastApi.sendBroadcastEvent(o),r}static async findByName(e,t){let n=this.getStore(e),r=await n.getItem(e);if(r){const n=new t(e);return n.parseJSON(JSON.parse(r)),n}}static async find(e,t,n){let r=this.getStore(e),o=await r.getItem(this.getKey(e,t));if(o){const r=new n(e,t);return r.parseJSON(JSON.parse(o)),r}}static getKey(e,t){return`${e}@${t}`}}t.WidgetDataRepository=c,c.stores=new Map},194:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decode=t.encodeParam=t.encodePath=t.encodeQueryKey=t.encodeQueryValue=t.encodeHash=t.PLUS_RE=void 0;const n=/#/g,r=/&/g,o=/\//g,i=/=/g,a=/\?/g;t.PLUS_RE=/\+/g;const c=/%5B/g,s=/%5D/g,u=/%5E/g,f=/%60/g,l=/%7B/g,d=/%7C/g,h=/%7D/g,v=/%20/g;function p(e){return encodeURI(""+e).replace(d,"|").replace(c,"[").replace(s,"]")}function g(e){return p(e).replace(t.PLUS_RE,"%2B").replace(v,"+").replace(n,"%23").replace(r,"%26").replace(f,"`").replace(l,"{").replace(h,"}").replace(u,"^")}function y(e){return p(e).replace(n,"%23").replace(a,"%3F")}t.encodeHash=function(e){return p(e).replace(l,"{").replace(h,"}").replace(u,"^")},t.encodeQueryValue=g,t.encodeQueryKey=function(e){return g(e).replace(i,"%3D")},t.encodePath=y,t.encodeParam=function(e){return null==e?"":y(e).replace(o,"%2F")},t.decode=function(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}},470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeQuery=t.stringifyQuery=t.parseQuery=void 0;const r=n(194),o=Array.isArray;t.parseQuery=function(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const i=n[e].replace(r.PLUS_RE," "),a=i.indexOf("="),c=(0,r.decode)(a<0?i:i.slice(0,a)),s=a<0?null:(0,r.decode)(i.slice(a+1));if(c in t){let e=t[c];o(e)||(e=t[c]=[e]),e.push(s)}else t[c]=s}return t},t.stringifyQuery=function(e){let t="";for(let n in e){const i=e[n];(n=(0,r.encodeQueryKey)(n),null!=i)?(o(i)?i.map((e=>e&&(0,r.encodeQueryValue)(e))):[i&&(0,r.encodeQueryValue)(i)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))})):void 0!==i&&(t+=(t.length?"&":"")+n)}return t},t.normalizeQuery=function(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=o(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}},823:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElectronUtils=void 0,t.ElectronUtils=class{static hasElectronApi(){return null!=this.getAPI()}static getAPI(){return Reflect.has(window,"electronAPI")?window.electronAPI:Reflect.has(window.parent,"electronAPI")?window.parent.electronAPI:null}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(432)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widget-js/core",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"