@yunzhijia/qing
Version:
> qingjs是为了方便前端人员在云之家环境调用native代码的工具类,兼容新版桌面端、老版桌面端、移动端、微信
2 lines • 33.2 kB
JavaScript
/** Fri Sep 15 2023 13:31:58 GMT+0800 (中国标准时间) **/
(()=>{var e={4375:(e,r,n)=>{"use strict";n.r(r),n.d(r,{call:()=>o,checkJsApi:()=>u,off:()=>c,on:()=>a,once:()=>i,trigger:()=>s}),n(9600);var t=window._CloudHubJSBridge,o=t.call,i=t.once,a=t.on,c=t.off,u=t.checkJsApi,s=t.trigger},9600:(e,r,n)=>{window.qing.isMiniApp?n(7595):n(3014)},5379:()=>{qing._simulate("setClipboardData",function(e){window.clipboardData.setData("text",e.data),e.success&&e.success({success:!0})}),qing._simulate("getClipboardData",function(e){e.success({success:!0,data:window.clipboardData.getData("text")})})},3014:(e,r,n)=>{"use strict";n.r(r);n(686),n(5379)},7595:(e,r,n)=>{"use strict";n.r(r);n(6734),n(5379)},6734:(e,r,n)=>{"use strict";var t,o=n(9483),i=n.n(o),a=window.qing,c=function(){t=i().createInstance({name:"__qingjs__stroage__",driver:[i().INDEXEDDB],size:20971520}),c=null};a._simulate("setStorage",function(e){c&&c(),t.setItem(e.key,e.data,function(r){r?e.error&&e.error({success:!1,error:r}):e.success&&e.success({success:!0})})}),a._simulate("getStorage",function(e){c&&c(),t.getItem(e.key,function(r,n){r?e.error&&e.error({success:!1,error:r}):e.success&&e.success({success:!0,data:n})})}),a._simulate("clearStorage",function(e){c&&c(),t.clear(function(r){r?e.error&&e.error({success:!1,error:r}):e.success&&e.success({success:!0})})}),a._simulate("removeStorage",function(e){c&&c(),t.removeItem(e.key,function(r){r?e.error&&e.error({success:!1,error:r}):e.success&&e.success({success:!0})})}),a._simulate("getStorageInfo",function(e){c&&c(),t.keys(function(r,n){r?e.error&&e.error({success:!1,error:r}):e.success&&e.success({success:!0,keys:n})})})},686:()=>{"use strict";var e="JSON解析失败";var r="参数错误",n="鉴权失败",t="获取签名失败",o="签名信息错误";function i(i,a){function c(e,r,t){if(!(e&&e.appId&&e.timeStamp&&e.nonceStr&&e.signature))return t(o);var a={success:function(e){"string"==typeof e.success&&(e.success="true"===e.success),e.success?r&&r(e):t&&t(n)},error:function(e){t&&t(n)}};Object.assign(a,e),i.call("runtime.auth",a)}if("function"==typeof a.success)if(a.appId&&a.timeStamp&&a.nonceStr&&a.signature)c(a,a.success,a.error);else if(a.signUrl){var u=encodeURIComponent(location.href.split("#")[0]);/^file:/.test(location.href)&&(u=encodeURIComponent(location.href.replace(/file:\/\//,""))),function(r){var n,t=new XMLHttpRequest,o=/^(2\d{2}|304)$/;r.method||(r.method="GET"),r.error||(r.error=function(){}),r.success||(r.success=function(){}),t.open(r.method,r.url),t.onreadystatechange=function(){if(4===t.readyState)if(o.test(t.status))try{r.success(JSON.parse(t.responseText),t)}catch(n){r.error(e)}else r.error(t.responseText)},r.headers=r.headers||{},"json"===r.serializer?(n=JSON.stringify(r.data),r.headers["Content-type"]="application/json; charset=utf-8"):(n=function(e){var r=encodeURIComponent;return"string"!=typeof e&&e?Object.keys(e).map(function(n){return r(n)+"="+r(e[n])}).join("&"):e}(r.data),r.headers["Content-type"]="application/x-www-form-urlencoded; charset=utf-8"),r.headers&&Object.keys(r.headers).forEach(function(e){t.setRequestHeader(e,r.headers[e])}),t.send(n)}({url:a.signUrl.replace(/\?|$/,"?url="+u+"&").replace(/&$/,""),method:a.signMethod||"post",success:function(e){if(e&&e.success&&e.data){var r=e.data;"function"==typeof a.signFormat&&(r=a.signFormat(r)),c(r,a.success,a.error)}else a.error&&a.error(t)},error:function(e){a.error&&a.error(t)}})}else a.error&&a.error(r)}window.qing._simulate("getTicket",function(e){i(window.qing,e)},!0)},9483:(e,r,n)=>{!function(r){e.exports=function(){return function e(r,n,t){function o(a,c){if(!n[a]){if(!r[a]){var u=void 0;if(!c&&u)return require(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[a]={exports:{}};r[a][0].call(f.exports,function(e){var n=r[a][1][e];return o(n||e)},f,f.exports,e,r,n,t)}return n[a].exports}for(var i=void 0,a=0;a<t.length;a++)o(t[a]);return o}({1:[function(e,r,t){(function(e){"use strict";var n,t,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 r=e.document.createElement("script");r.onreadystatechange=function(){f(),r.onreadystatechange=null,r.parentNode.removeChild(r),r=null},e.document.documentElement.appendChild(r)}:function(){setTimeout(f,0)};else{var u=new e.MessageChannel;u.port1.onmessage=f,n=function(){u.port2.postMessage(0)}}var s=[];function f(){var e,r;t=!0;for(var n=s.length;n;){for(r=s,s=[],e=-1;++e<n;)r[e]();n=s.length}t=!1}r.exports=function(e){1!==s.push(e)||t||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,r,n){"use strict";var t=e(1);function o(){}var i={},a=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function s(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==o&&v(this,e)}function f(e,r,n){this.promise=e,"function"==typeof r&&(this.onFulfilled=r,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(e,r,n){t(function(){var t;try{t=r(n)}catch(r){return i.reject(e,r)}t===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,t)})}function d(e){var r=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof r)return function(){r.apply(e,arguments)}}function v(e,r){var n=!1;function t(r){n||(n=!0,i.reject(e,r))}function o(r){n||(n=!0,i.resolve(e,r))}var a=h(function(){r(o,t)});"error"===a.status&&t(a.value)}function h(e,r){var n={};try{n.value=e(r),n.status="success"}catch(e){n.status="error",n.value=e}return n}r.exports=s,s.prototype.catch=function(e){return this.then(null,e)},s.prototype.then=function(e,r){if("function"!=typeof e&&this.state===c||"function"!=typeof r&&this.state===a)return this;var n=new this.constructor(o);if(this.state!==u){var t=this.state===c?e:r;l(n,t,this.outcome)}else this.queue.push(new f(n,e,r));return 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,r){var n=h(d,r);if("error"===n.status)return i.reject(e,n.value);var t=n.value;if(t)v(e,t);else{e.state=c,e.outcome=r;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(r)}return e},i.reject=function(e,r){e.state=a,e.outcome=r;for(var n=-1,t=e.queue.length;++n<t;)e.queue[n].callRejected(r);return e},s.resolve=function(e){if(e instanceof this)return e;return i.resolve(new this(o),e)},s.reject=function(e){var r=new this(o);return i.reject(r,e)},s.all=function(e){var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,t=!1;if(!n)return this.resolve([]);var a=new Array(n),c=0,u=-1,s=new this(o);for(;++u<n;)f(e[u],u);return s;function f(e,o){r.resolve(e).then(function(e){a[o]=e,++c!==n||t||(t=!0,i.resolve(s,a))},function(e){t||(t=!0,i.reject(s,e))})}},s.race=function(e){var r=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,t=!1;if(!n)return this.resolve([]);var a=-1,c=new this(o);for(;++a<n;)u(e[a]);return c;function u(e){r.resolve(e).then(function(e){t||(t=!0,i.resolve(c,e))},function(e){t||(t=!0,i.reject(c,e))})}}},{1:1}],3:[function(e,r,t){(function(r){"use strict";"function"!=typeof r.Promise&&(r.Promise=e(2))}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,r,n){"use strict";var t="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,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if("TypeError"!==i.name)throw i;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,t=new n,o=0;o<e.length;o+=1)t.append(e[o]);return t.getBlob(r.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function c(e,r){r&&e.then(function(e){r(null,e)},function(e){r(e)})}function u(e,r,n){"function"==typeof r&&e.then(r),"function"==typeof n&&e.catch(n)}function s(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,v={},h=Object.prototype.toString,p="readonly",y="readwrite";function b(e){return"boolean"==typeof d?a.resolve(d):function(e){return new a(function(r){var n=e.transaction(l,y),t=i([""]);n.objectStore(l).put(t,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),r(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);r(n||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}(e).then(function(e){return d=e})}function g(e){var r=v[e.name],n={};n.promise=new a(function(e,r){n.resolve=e,n.reject=r}),r.deferredOperations.push(n),r.dbReady?r.dbReady=r.dbReady.then(function(){return n.promise}):r.dbReady=n.promise}function m(e){var r=v[e.name],n=r.deferredOperations.pop();if(n)return n.resolve(),n.promise}function _(e,r){var n=v[e.name],t=n.deferredOperations.pop();if(t)return t.reject(r),t.promise}function w(e,r){return new a(function(n,t){if(v[e.name]=v[e.name]||R(),e.db){if(!r)return n(e.db);g(e),e.db.close()}var i=[e.name];r&&i.push(e.version);var a=o.open.apply(o,i);r&&(a.onupgradeneeded=function(r){var n=a.result;try{n.createObjectStore(e.storeName),r.oldVersion<=1&&n.createObjectStore(l)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+r.oldVersion+" to version "+r.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),t(a.error)},a.onsuccess=function(){n(a.result),m(e)}})}function I(e){return w(e,!1)}function S(e){return w(e,!0)}function E(e,r){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),t=e.version<e.db.version,o=e.version>e.db.version;if(t&&(e.version!==r&&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 N(e){var r=function(e){for(var r=e.length,n=new ArrayBuffer(r),t=new Uint8Array(n),o=0;o<r;o++)t[o]=e.charCodeAt(o);return n}(atob(e.data));return i([r],{type:e.type})}function j(e){return e&&e.__local_forage_encoded_blob}function O(e){var r=this,n=r._initReady().then(function(){var e=v[r._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return u(n,e,e),n}function D(e,r,n,t){void 0===t&&(t=1);try{var o=e.db.transaction(e.storeName,r);n(null,o)}catch(o){if(t>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),S(e)}).then(function(){return function(e){g(e);for(var r=v[e.name],n=r.forages,t=0;t<n.length;t++){var o=n[t];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,I(e).then(function(r){return e.db=r,E(e)?S(e):r}).then(function(t){e.db=r.db=t;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t}).catch(function(r){throw _(e,r),r})}(e).then(function(){D(e,r,n,t-1)})}).catch(n);n(o)}}function R(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}var A={_driver:"asyncStorage",_initStorage:function(e){var r=this,n={db:null};if(e)for(var t in e)n[t]=e[t];var o=v[n.name];o||(o=R(),v[n.name]=o);o.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=O);var i=[];function c(){return a.resolve()}for(var u=0;u<o.forages.length;u++){var s=o.forages[u];s!==r&&i.push(s._initReady().catch(c))}var f=o.forages.slice(0);return a.all(i).then(function(){return n.db=o.db,I(n)}).then(function(e){return n.db=e,E(n,r._defaultConfig.version)?S(n):e}).then(function(e){n.db=o.db=e,r._dbInfo=n;for(var t=0;t<f.length;t++){var i=f[t];i!==r&&(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),r="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||r)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,r){var n=this,t=new a(function(r,t){n.ready().then(function(){D(n._dbInfo,p,function(o,i){if(o)return t(o);try{var a=i.objectStore(n._dbInfo.storeName),c=a.openCursor(),u=1;c.onsuccess=function(){var n=c.result;if(n){var t=n.value;j(t)&&(t=N(t));var o=e(t,n.key,u++);void 0!==o?r(o):n.continue()}else r()},c.onerror=function(){t(c.error)}}catch(e){t(e)}})}).catch(t)});return c(t,r),t},getItem:function(e,r){var n=this;e=s(e);var t=new a(function(r,t){n.ready().then(function(){D(n._dbInfo,p,function(o,i){if(o)return t(o);try{var a=i.objectStore(n._dbInfo.storeName),c=a.get(e);c.onsuccess=function(){var e=c.result;void 0===e&&(e=null),j(e)&&(e=N(e)),r(e)},c.onerror=function(){t(c.error)}}catch(e){t(e)}})}).catch(t)});return c(t,r),t},setItem:function(e,r,n){var t=this;e=s(e);var o=new a(function(n,o){var i;t.ready().then(function(){return i=t._dbInfo,"[object Blob]"===h.call(r)?b(i.db).then(function(e){return e?r:function(e){return new a(function(r,n){var t=new FileReader;t.onerror=n,t.onloadend=function(n){var t=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:t,type:e.type})},t.readAsBinaryString(e)})}(r)}):r}).then(function(r){D(t._dbInfo,y,function(i,a){if(i)return o(i);try{var c=a.objectStore(t._dbInfo.storeName);null===r&&(r=void 0);var u=c.put(r,e);a.oncomplete=function(){void 0===r&&(r=null),n(r)},a.onabort=a.onerror=function(){var e=u.error?u.error:u.transaction.error;o(e)}}catch(e){o(e)}})}).catch(o)});return c(o,n),o},removeItem:function(e,r){var n=this;e=s(e);var t=new a(function(r,t){n.ready().then(function(){D(n._dbInfo,y,function(o,i){if(o)return t(o);try{var a=i.objectStore(n._dbInfo.storeName),c=a.delete(e);i.oncomplete=function(){r()},i.onerror=function(){t(c.error)},i.onabort=function(){var e=c.error?c.error:c.transaction.error;t(e)}}catch(e){t(e)}})}).catch(t)});return c(t,r),t},clear:function(e){var r=this,n=new a(function(e,n){r.ready().then(function(){D(r._dbInfo,y,function(t,o){if(t)return n(t);try{var i=o.objectStore(r._dbInfo.storeName),a=i.clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}})}).catch(n)});return c(n,e),n},length:function(e){var r=this,n=new a(function(e,n){r.ready().then(function(){D(r._dbInfo,p,function(t,o){if(t)return n(t);try{var i=o.objectStore(r._dbInfo.storeName),a=i.count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return c(n,e),n},key:function(e,r){var n=this,t=new a(function(r,t){e<0?r(null):n.ready().then(function(){D(n._dbInfo,p,function(o,i){if(o)return t(o);try{var a=i.objectStore(n._dbInfo.storeName),c=!1,u=a.openKeyCursor();u.onsuccess=function(){var n=u.result;n?0===e?r(n.key):c?r(n.key):(c=!0,n.advance(e)):r(null)},u.onerror=function(){t(u.error)}}catch(e){t(e)}})}).catch(t)});return c(t,r),t},keys:function(e){var r=this,n=new a(function(e,n){r.ready().then(function(){D(r._dbInfo,p,function(t,o){if(t)return n(t);try{var i=o.objectStore(r._dbInfo.storeName),a=i.openKeyCursor(),c=[];a.onsuccess=function(){var r=a.result;r?(c.push(r.key),r.continue()):e(c)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return c(n,e),n},dropInstance:function(e,r){r=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 t;if(e.name){var i=e.name===n.name&&this._dbInfo.db,u=i?a.resolve(this._dbInfo.db):I(e).then(function(r){var n=v[e.name],t=n.forages;n.db=r;for(var o=0;o<t.length;o++)t[o]._dbInfo.db=r;return r});t=e.storeName?u.then(function(r){if(r.objectStoreNames.contains(e.storeName)){var n=r.version+1;g(e);var t=v[e.name],i=t.forages;r.close();for(var c=0;c<i.length;c++){var u=i[c];u._dbInfo.db=null,u._dbInfo.version=n}var s=new a(function(r,t){var i=o.open(e.name,n);i.onerror=function(e){var r=i.result;r.close(),t(e)},i.onupgradeneeded=function(){var r=i.result;r.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),r(e)}});return s.then(function(e){t.db=e;for(var r=0;r<i.length;r++){var n=i[r];n._dbInfo.db=e,m(n._dbInfo)}}).catch(function(r){throw(_(e,r)||a.resolve()).catch(function(){}),r})}}):u.then(function(r){g(e);var n=v[e.name],t=n.forages;r.close();for(var i=0;i<t.length;i++){var c=t[i];c._dbInfo.db=null}var u=new a(function(r,n){var t=o.deleteDatabase(e.name);t.onerror=t.onblocked=function(e){var r=t.result;r&&r.close(),n(e)},t.onsuccess=function(){var e=t.result;e&&e.close(),r(e)}});return u.then(function(e){n.db=e;for(var r=0;r<t.length;r++){var o=t[r];m(o._dbInfo)}}).catch(function(r){throw(_(e,r)||a.resolve()).catch(function(){}),r})})}else t=a.reject("Invalid arguments");return c(t,r),t}};var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k="~~local_forage_type~",C=/^~~local_forage_type~([^~]+)~/,B="__lfsc__:",T=B.length,F="arbf",M="blob",L="si08",P="ui08",q="uic8",z="si16",U="si32",W="ur16",J="ui32",H="fl32",K="fl64",X=T+F.length,Q=Object.prototype.toString;function G(e){var r,n,t,o,i,a=.75*e.length,c=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var s=new ArrayBuffer(a),f=new Uint8Array(s);for(r=0;r<c;r+=4)n=x.indexOf(e[r]),t=x.indexOf(e[r+1]),o=x.indexOf(e[r+2]),i=x.indexOf(e[r+3]),f[u++]=n<<2|t>>4,f[u++]=(15&t)<<4|o>>2,f[u++]=(3&o)<<6|63&i;return s}function V(e){var r,n=new Uint8Array(e),t="";for(r=0;r<n.length;r+=3)t+=x[n[r]>>2],t+=x[(3&n[r])<<4|n[r+1]>>4],t+=x[(15&n[r+1])<<2|n[r+2]>>6],t+=x[63&n[r+2]];return n.length%3==2?t=t.substring(0,t.length-1)+"=":n.length%3==1&&(t=t.substring(0,t.length-2)+"=="),t}var Y={serialize:function(e,r){var n="";e&&(n=Q.call(e));if(e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===Q.call(e.buffer))){var t,o=B;e instanceof ArrayBuffer?(t=e,o+=F):(t=e.buffer,"[object Int8Array]"===n?o+=L:"[object Uint8Array]"===n?o+=P:"[object Uint8ClampedArray]"===n?o+=q:"[object Int16Array]"===n?o+=z:"[object Uint16Array]"===n?o+=W:"[object Int32Array]"===n?o+=U:"[object Uint32Array]"===n?o+=J:"[object Float32Array]"===n?o+=H:"[object Float64Array]"===n?o+=K:r(new Error("Failed to get type for BinaryArray"))),r(o+V(t))}else if("[object Blob]"===n){var i=new FileReader;i.onload=function(){var n=k+e.type+"~"+V(this.result);r(B+M+n)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),r(null,n)}},deserialize:function(e){if(e.substring(0,T)!==B)return JSON.parse(e);var r,n=e.substring(X),t=e.substring(T,X);if(t===M&&C.test(n)){var o=n.match(C);r=o[1],n=n.substring(o[0].length)}var a=G(n);switch(t){case F:return a;case M:return i([a],{type:r});case L:return new Int8Array(a);case P:return new Uint8Array(a);case q:return new Uint8ClampedArray(a);case z:return new Int16Array(a);case W:return new Uint16Array(a);case U:return new Int32Array(a);case J:return new Uint32Array(a);case H:return new Float32Array(a);case K:return new Float64Array(a);default:throw new Error("Unkown type: "+t)}},stringToBuffer:G,bufferToString:V};function $(e,r,n,t){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,t)}function Z(e,r,n,t,o,i){e.executeSql(n,t,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(e,c){c.rows.length?i(e,a):$(e,r,function(){e.executeSql(n,t,o,i)},i)},i):i(e,a)},i)}var ee={_driver:"webSQLStorage",_initStorage:function(e){var r=this,n={db:null};if(e)for(var t in e)n[t]="string"!=typeof e[t]?e[t].toString():e[t];var o=new a(function(e,t){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return t(e)}n.db.transaction(function(o){$(o,n,function(){r._dbInfo=n,e()},function(e,r){t(r)})},t)});return n.serializer=Y,o},_support:function(){return"function"==typeof openDatabase}(),iterate:function(e,r){var n=this,t=new a(function(r,t){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){Z(n,o,"SELECT * FROM "+o.storeName,[],function(n,t){for(var i=t.rows,a=i.length,c=0;c<a;c++){var u=i.item(c),s=u.value;if(s&&(s=o.serializer.deserialize(s)),void 0!==(s=e(s,u.key,c+1)))return void r(s)}r()},function(e,r){t(r)})})}).catch(t)});return c(t,r),t},getItem:function(e,r){var n=this;e=s(e);var t=new a(function(r,t){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){Z(n,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,n){var t=n.rows.length?n.rows.item(0).value:null;t&&(t=o.serializer.deserialize(t)),r(t)},function(e,r){t(r)})})}).catch(t)});return c(t,r),t},setItem:function(e,r,n){return function e(r,n,t,o){var i=this;r=s(r);var u=new a(function(a,c){i.ready().then(function(){void 0===n&&(n=null);var u=n,s=i._dbInfo;s.serializer.serialize(n,function(n,f){f?c(f):s.db.transaction(function(e){Z(e,s,"INSERT OR REPLACE INTO "+s.storeName+" (key, value) VALUES (?, ?)",[r,n],function(){a(u)},function(e,r){c(r)})},function(n){if(n.code===n.QUOTA_ERR){if(o>0)return void a(e.apply(i,[r,u,t,o-1]));c(n)}})})}).catch(c)});c(u,t);return u}.apply(this,[e,r,n,1])},removeItem:function(e,r){var n=this;e=s(e);var t=new a(function(r,t){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){Z(n,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){r()},function(e,r){t(r)})})}).catch(t)});return c(t,r),t},clear:function(e){var r=this,n=new a(function(e,n){r.ready().then(function(){var t=r._dbInfo;t.db.transaction(function(r){Z(r,t,"DELETE FROM "+t.storeName,[],function(){e()},function(e,r){n(r)})})}).catch(n)});return c(n,e),n},length:function(e){var r=this,n=new a(function(e,n){r.ready().then(function(){var t=r._dbInfo;t.db.transaction(function(r){Z(r,t,"SELECT COUNT(key) as c FROM "+t.storeName,[],function(r,n){var t=n.rows.item(0).c;e(t)},function(e,r){n(r)})})}).catch(n)});return c(n,e),n},key:function(e,r){var n=this,t=new a(function(r,t){n.ready().then(function(){var o=n._dbInfo;o.db.transaction(function(n){Z(n,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,n){var t=n.rows.length?n.rows.item(0).key:null;r(t)},function(e,r){t(r)})})}).catch(t)});return c(t,r),t},keys:function(e){var r=this,n=new a(function(e,n){r.ready().then(function(){var t=r._dbInfo;t.db.transaction(function(r){Z(r,t,"SELECT key FROM "+t.storeName,[],function(r,n){for(var t=[],o=0;o<n.rows.length;o++)t.push(n.rows.item(o).key);e(t)},function(e,r){n(r)})})}).catch(n)});return c(n,e),n},dropInstance:function(e,r){r=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 t,o=this;t=e.name?new a(function(r){var t;t=e.name===n.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?r({db:t,storeNames:[e.storeName]}):r(function(e){return new a(function(r,n){e.transaction(function(t){t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,t){for(var o=[],i=0;i<t.rows.length;i++)o.push(t.rows.item(i).name);r({db:e,storeNames:o})},function(e,r){n(r)})},function(e){n(e)})})}(t))}).then(function(e){return new a(function(r,n){e.db.transaction(function(t){function o(e){return new a(function(r,n){t.executeSql("DROP TABLE IF EXISTS "+e,[],function(){r()},function(e,r){n(r)})})}for(var i=[],c=0,u=e.storeNames.length;c<u;c++)i.push(o(e.storeNames[c]));a.all(i).then(function(){r()}).catch(function(e){n(e)})},function(e){n(e)})})}):a.reject("Invalid arguments");return c(t,r),t}};function re(e,r){var n=e.name+"/";return e.storeName!==r.storeName&&(n+=e.storeName+"/"),n}function ne(){return!function(){try{return localStorage.setItem("_localforage_support_test",!0),localStorage.removeItem("_localforage_support_test"),!1}catch(e){return!0}}()||localStorage.length>0}var te={_driver:"localStorageWrapper",_initStorage:function(e){var r={};if(e)for(var n in e)r[n]=e[n];if(r.keyPrefix=re(e,this._defaultConfig),!ne())return a.reject();return this._dbInfo=r,r.serializer=Y,a.resolve()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,r){var n=this,t=n.ready().then(function(){for(var r=n._dbInfo,t=r.keyPrefix,o=t.length,i=localStorage.length,a=1,c=0;c<i;c++){var u=localStorage.key(c);if(0===u.indexOf(t)){var s=localStorage.getItem(u);if(s&&(s=r.serializer.deserialize(s)),void 0!==(s=e(s,u.substring(o),a++)))return s}}});return c(t,r),t},getItem:function(e,r){var n=this;e=s(e);var t=n.ready().then(function(){var r=n._dbInfo,t=localStorage.getItem(r.keyPrefix+e);return t&&(t=r.serializer.deserialize(t)),t});return c(t,r),t},setItem:function(e,r,n){var t=this;e=s(e);var o=t.ready().then(function(){void 0===r&&(r=null);var n=r;return new a(function(o,i){var a=t._dbInfo;a.serializer.serialize(r,function(r,t){if(t)i(t);else try{localStorage.setItem(a.keyPrefix+e,r),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,r){var n=this;e=s(e);var t=n.ready().then(function(){var r=n._dbInfo;localStorage.removeItem(r.keyPrefix+e)});return c(t,r),t},clear:function(e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var t=localStorage.key(n);0===t.indexOf(e)&&localStorage.removeItem(t)}});return c(n,e),n},length:function(e){var r=this.keys().then(function(e){return e.length});return c(r,e),r},key:function(e,r){var n=this,t=n.ready().then(function(){var r,t=n._dbInfo;try{r=localStorage.key(e)}catch(e){r=null}return r&&(r=r.substring(t.keyPrefix.length)),r});return c(t,r),t},keys:function(e){var r=this,n=r.ready().then(function(){for(var e=r._dbInfo,n=localStorage.length,t=[],o=0;o<n;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&t.push(i.substring(e.keyPrefix.length))}return t});return c(n,e),n},dropInstance:function(e,r){if(r=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 t,o=this;t=e.name?new a(function(r){e.storeName?r(re(e,o._defaultConfig)):r(e.name+"/")}).then(function(e){for(var r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}):a.reject("Invalid arguments");return c(t,r),t}},oe=function(e,r){return e===r||"number"==typeof e&&"number"==typeof r&&isNaN(e)&&isNaN(r)},ie=function(e,r){for(var n=e.length,t=0;t<n;){if(oe(e[t],r))return!0;t++}return!1},ae=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ce={},ue={},se={INDEXEDDB:A,WEBSQL:ee,LOCALSTORAGE:te},fe=[se.INDEXEDDB._driver,se.WEBSQL._driver,se.LOCALSTORAGE._driver],le=["dropInstance"],de=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(le),ve={description:"",driver:fe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function he(e,r){e[r]=function(){var n=arguments;return e.ready().then(function(){return e[r].apply(e,n)})}}function pe(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var n in r)r.hasOwnProperty(n)&&(ae(r[n])?arguments[0][n]=r[n].slice():arguments[0][n]=r[n])}return arguments[0]}var ye=function(){function e(r){for(var n in function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),se)if(se.hasOwnProperty(n)){var t=se[n],o=t._driver;this[n]=o,ce[o]||this.defineDriver(t)}this._defaultConfig=pe({},ve),this._config=pe({},this._defaultConfig,r),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":t(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var r in e){if("storeName"===r&&(e[r]=e[r].replace(/\W/g,"_")),"version"===r&&"number"!=typeof e[r])return new Error("Database version must be a number.");this._config[r]=e[r]}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,r,n){var t=new a(function(r,n){try{var t=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"),u=0,s=i.length;u<s;u++){var f=i[u],l=!ie(le,f);if((l||e[f])&&"function"!=typeof e[f])return void n(o)}!function(){for(var r=function(e){return function(){var r=new Error("Method "+e+" is not implemented by the current driver"),n=a.reject(r);return c(n,arguments[arguments.length-1]),n}},n=0,t=le.length;n<t;n++){var o=le[n];e[o]||(e[o]=r(o))}}();var d=function(n){ce[t]&&console.info("Redefining LocalForage driver: "+t),ce[t]=e,ue[t]=n,r()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}});return u(t,r,n),t},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,r,n){var t=ce[e]?a.resolve(ce[e]):a.reject(new Error("Driver not found."));return u(t,r,n),t},e.prototype.getSerializer=function(e){var r=a.resolve(Y);return u(r,e),r},e.prototype.ready=function(e){var r=this,n=r._driverSet.then(function(){return null===r._ready&&(r._ready=r._initDriver()),r._ready});return u(n,e,e),n},e.prototype.setDriver=function(e,r,n){var t=this;ae(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){t._config.driver=t.driver()}function c(e){return t._extend(e),i(),t._ready=t._initStorage(t._config),t._ready}var s=null!==this._driverSet?this._driverSet.catch(function(){return a.resolve()}):a.resolve();return this._driverSet=s.then(function(){var e=o[0];return t._dbInfo=null,t._ready=null,t.getDriver(e).then(function(e){t._driver=e._driver,i(),t._wrapLibraryMethodsWithReady(),t._initDriver=function(e){return function(){var r=0;return function n(){for(;r<e.length;){var o=e[r];return r++,t._dbInfo=null,t._ready=null,t.getDriver(o).then(c).catch(n)}i();var u=new Error("No available storage method found.");t._driverSet=a.reject(u);return t._driverSet}()}}(o)})}).catch(function(){i();var e=new Error("No available storage method found.");return t._driverSet=a.reject(e),t._driverSet}),u(this._driverSet,r,n),this._driverSet},e.prototype.supports=function(e){return!!ue[e]},e.prototype._extend=function(e){pe(this,e)},e.prototype._getSupportedDrivers=function(e){for(var r=[],n=0,t=e.length;n<t;n++){var o=e[n];this.supports(o)&&r.push(o)}return r},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,r=de.length;e<r;e++)he(this,de[e])},e.prototype.createInstance=function(r){return new e(r)},e}(),be=new ye;r.exports=be},{3:3}]},{},[4])(4)}()}()}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}(()=>{n.n=(e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r})})(),(()=>{n.d=((e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})})})(),(()=>{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,r)=>Object.prototype.hasOwnProperty.call(e,r))})(),(()=>{n.r=(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})})(),(()=>{window.qing.define("desktop",function(e,r){var t=n(4375);for(var o in t)e[o]=t[o]})})()})();