UNPKG

vue-bbs

Version:

Serverless comment system in Vue

1 lines 51 kB
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-bbs"]=e():t["vue-bbs"]=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=73)}({1:function(t,e,r){"use strict";function n(t,e,r,n,o,i,s,u){var a,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=r,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=a):o&&(a=u?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(c.functional){c._injectStyles=a;var f=c.render;c.render=function(t,e){return a.call(e),f(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,a):[a]}return{exports:t,options:c}}r.d(e,"a",(function(){return n}))},10:function(t,e,r){var n,o;!function(i){if(void 0===(o="function"===typeof(n=i)?n.call(e,r,e,t):n)||(t.exports=o),!0,t.exports=i(),!!0){var s=window.Cookies,u=window.Cookies=i();u.noConflict=function(){return window.Cookies=s,u}}}((function(){function t(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(e,r,i){if("undefined"!==typeof document){"number"===typeof(i=t({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var s=JSON.stringify(r);/^[\{\[]/.test(s)&&(r=s)}catch(c){}r=n.write?n.write(r,e):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var u="";for(var a in i)i[a]&&(u+="; "+a,!0!==i[a]&&(u+="="+i[a].split(";")[0]));return document.cookie=e+"="+r+u}}function s(t,r){if("undefined"!==typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],s=0;s<i.length;s++){var u=i[s].split("="),a=u.slice(1).join("=");r||'"'!==a.charAt(0)||(a=a.slice(1,-1));try{var c=e(u[0]);if(a=(n.read||n)(a,c)||e(a),r)try{a=JSON.parse(a)}catch(f){}if(o[c]=a,t===c)break}catch(f){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return s(t,!1)},o.getJSON=function(t){return s(t,!0)},o.remove=function(e,r){i(e,"",t(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))}))},120:function(t,e,r){"use strict";function n(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}r.d(e,"a",(function(){return n}))},14:function(t,e){var r=Object.prototype.toString;function n(t){return"function"===typeof t.constructor?t.constructor.name:null}t.exports=function(t){if(void 0===t)return"undefined";if(null===t)return"null";var e=typeof t;if("boolean"===e)return"boolean";if("string"===e)return"string";if("number"===e)return"number";if("symbol"===e)return"symbol";if("function"===e)return"GeneratorFunction"===n(t)?"generatorfunction":"function";if(function(t){return Array.isArray?Array.isArray(t):t instanceof Array}(t))return"array";if(function(t){if(t.constructor&&"function"===typeof t.constructor.isBuffer)return t.constructor.isBuffer(t);return!1}(t))return"buffer";if(function(t){try{if("number"===typeof t.length&&"function"===typeof t.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(t))return"arguments";if(function(t){return t instanceof Date||"function"===typeof t.toDateString&&"function"===typeof t.getDate&&"function"===typeof t.setDate}(t))return"date";if(function(t){return t instanceof Error||"string"===typeof t.message&&t.constructor&&"number"===typeof t.constructor.stackTraceLimit}(t))return"error";if(function(t){return t instanceof RegExp||"string"===typeof t.flags&&"boolean"===typeof t.ignoreCase&&"boolean"===typeof t.multiline&&"boolean"===typeof t.global}(t))return"regexp";switch(n(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(t){return"function"===typeof t.throw&&"function"===typeof t.return&&"function"===typeof t.next}(t))return"generator";switch(e=r.call(t)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}},17:function(t,e,r){"use strict";var n=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,n.fetch&&(e.default=n.fetch.bind(n)),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},24:function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}t.exports=r},26:function(t,e,r){"use strict";(function(e){const n=Symbol.prototype.valueOf,o=r(14);t.exports=function(t,r){switch(o(t)){case"array":return t.slice();case"object":return Object.assign({},t);case"date":return new t.constructor(Number(t));case"map":return new Map(t);case"set":return new Set(t);case"buffer":return function(t){const r=t.length,n=e.allocUnsafe?e.allocUnsafe(r):e.from(r);return t.copy(n),n}(t);case"symbol":return function(t){return n?Object(n.call(t)):{}}(t);case"arraybuffer":return function(t){const e=new t.constructor(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),e}(t);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return function(t,e){return new t.constructor(t.buffer,t.byteOffset,t.length)}(t);case"regexp":return function(t){const e=void 0!==t.flags?t.flags:/\w+$/.exec(t)||void 0,r=new t.constructor(t.source,e);return r.lastIndex=t.lastIndex,r}(t);case"error":return Object.create(t);default:return t}}}).call(this,r(27).Buffer)},27:function(t,e,r){"use strict";(function(t){var n=r(28),o=r(29),i=r(30);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!a.TYPED_ARRAY_SUPPORT&&!(this instanceof a))return new a(t,e,r);if("number"===typeof t){if("string"===typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"===typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=l(t,e);return t}(t,e,r,n):"string"===typeof e?function(t,e,r){"string"===typeof r&&""!==r||(r="utf8");if(!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(a.isBuffer(e)){var r=0|p(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!==typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!==typeof e.length||(n=e.length)!==n?u(t,0):l(t,e);if("Buffer"===e.type&&i(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!==typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(f(e),t=u(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|p(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return R(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"===typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"===typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<u;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===a)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){for(var h=!0,l=0;l<a;l++)if(c(t,i+l)!==c(e,l)){h=!1;break}if(h)return i}return-1}function m(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(isNaN(u))return s;t[r+s]=u}return s}function w(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function b(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function A(t,e,r,n){return b(t,e,r,n)}function S(t,e,r,n){return q($(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function R(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function C(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,a,c=t[o],f=null,h=c>239?4:c>223?3:c>191?2:1;if(o+h<=r)switch(h){case 1:c<128&&(f=c);break;case 2:128===(192&(i=t[o+1]))&&(a=(31&c)<<6|63&i)>127&&(f=a);break;case 3:i=t[o+1],s=t[o+2],128===(192&i)&&128===(192&s)&&(a=(15&c)<<12|(63&i)<<6|63&s)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128===(192&i)&&128===(192&s)&&128===(192&u)&&(a=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(f=a)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=s(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return c(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?u(t,e):void 0!==r?"string"===typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},a.allocUnsafe=function(t){return h(null,t)},a.allocUnsafeSlow=function(t){return h(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)_(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)_(this,e,e+3),_(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)_(this,e,e+7),_(this,e+1,e+6),_(this,e+2,e+5),_(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):y.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,o){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),h=0;h<u;++h)if(c[h]!==f[h]){i=c[h],s=f[h];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"===typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return b(this,t,e,r);case"latin1":case"binary":return A(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function B(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=Y(t[i]);return o}function T(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function O(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function j(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function x(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function k(t,e,r,n,i){return i||x(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return i||x(t,0,r,8),o.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=a.prototype;else{var o=e-t;r=new a(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},a.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},a.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUInt8=function(t,e){return e||O(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||O(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||O(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||O(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||O(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||O(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return e||O(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||O(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||O(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||O(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||O(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||O(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||O(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||O(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||O(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||U(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||U(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);U(this,t,e,r,o-1,-o)}var i=0,s=1,u=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/s>>0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);U(this,t,e,r,o-1,-o)}var i=r-1,s=1,u=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/s>>0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return k(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return k(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},a.prototype.fill=function(t,e,r,n){if("string"===typeof t){if("string"===typeof e?(n=e,e=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"===typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:N(new a(t,n).toString()),u=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function $(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(24))},28:function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),s=n[0],u=n[1],a=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),f=0,h=u>0?s-4:s;for(r=0;r<h;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],a[f++]=e>>16&255,a[f++]=e>>8&255,a[f++]=255&e;2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,a[f++]=255&e);1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,a[f++]=e>>8&255,a[f++]=255&e);return a},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,u=r-o;s<u;s+=16383)i.push(f(t,s,s+16383>u?u:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,a=s.length;u<a;++u)n[u]=s[u],o[s.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,s=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},29:function(t,e){e.read=function(t,e,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,c=a>>1,f=-7,h=r?o-1:0,l=r?-1:1,p=t[e+h];for(h+=l,i=p&(1<<-f)-1,p>>=-f,f+=u;f>0;i=256*i+t[e+h],h+=l,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+h],h+=l,f-=8);if(0===i)i=1-c;else{if(i===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,u,a,c=8*i-o-1,f=(1<<c)-1,h=f>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+h>=1?l/a:l*Math.pow(2,1-h))*a>=2&&(s++,a/=2),s+h>=f?(u=0,s=f):s+h>=1?(u=(e*a-1)*Math.pow(2,o),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&u,p+=d,u/=256,o-=8);for(s=s<<o|u,c+=o;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},30:function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},31:function(t,e,r){"use strict";var n=r(32);function o(t){return!0===n(t)&&"[object Object]"===Object.prototype.toString.call(t)}t.exports=function(t){var e,r;return!1!==o(t)&&("function"===typeof(e=t.constructor)&&(!1!==o(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}},32:function(t,e,r){"use strict";t.exports=function(t){return null!=t&&"object"===typeof t&&!1===Array.isArray(t)}},6:function(t,e,r){"use strict";const n=r(26),o=r(14),i=r(31);function s(t,e){switch(o(t)){case"object":return function(t,e){if("function"===typeof e)return e(t);if(e||i(t)){const r=new t.constructor;for(let n in t)r[n]=s(t[n],e);return r}return t}(t,e);case"array":return function(t,e){const r=new t.constructor(t.length);for(let n=0;n<t.length;n++)r[n]=s(t[n],e);return r}(t,e);default:return n(t)}}t.exports=s},73:function(t,e,r){"use strict";r.r(e);var n=r(6),o=r.n(n),i=r(17),s=r.n(i),u=["appId","appKey"];function a(t){return(a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function f(t,e,r){return(f="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=d(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}})(t,e,r||t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=d(t);if(e){var o=d(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return p(this,r)}}function p(t,e){return!e||"object"!==a(e)&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function g(t,e,r){return e&&_(t.prototype,e),r&&_(t,r),t}function v(t,e){var r;r="string"===typeof e?[e]:e;var n=Object.prototype.toString.call(t).slice(8,-1);if(!r.includes(n))throw new Error("parameter type must be "+r.join(" or ")+"!");return!0}var m=null,w=function(){function t(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST";for(var o in y(this,t),this.__table__=e,this.__classes__="classes",this.__data__={},this.id=r?r.objectId:null,this.createdAt=r?r.createdAt:null,this.updatedAt=r?r.updatedAt:null,this.attributes={},this.__method__=n,r)if(Object.prototype.hasOwnProperty.call(r,o)){if("_r"===o||"_w"===o||"ua"===o||"ownerCode"===o)continue;this.attributes[o]=r[o]}}return g(t,[{key:"increment",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return v(t,"String"),v(e,"Number"),this.__data__[t]={__op:"Increment",amount:e},this}},{key:"set",value:function(t,e){return v(t,"String"),this.__data__[t]=e,this}},{key:"get",value:function(t){return v(t,"String"),this.attributes[t]}},{key:"setACL",value:function(t){if(t instanceof S.ACL===!1)throw new Error("parameter must instacneof AV.ACL");this.__data__.ACL={};var e=t.permissionsById;for(var r in e)this.__data__.ACL[r]=e[r];return this}},{key:"save",value:function(){var t=this,e="PUT"===this.__method__?"".concat(S.serverURLs.api,"/1.1/").concat(this.__classes__,"/").concat(this.__table__,"/").concat(this.id,"?fetchWhenSave=true"):"".concat(S.serverURLs.api,"/1.1/").concat(this.__classes__,"/").concat(this.__table__,"?fetchWhenSave=true");return s()(e,{method:this.__method__,body:JSON.stringify(this.__data__),headers:{"X-LC-Id":S.__appId__,"X-LC-Key":S.__appKey__,"X-LC-Session":m&&m.attributes.sessionToken,"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(e){return"PUT"===t.__method__&&(e=Object.assign(t.attributes,e)),"POST"===t.__method__&&(t.__method__="PUT",t.id=e.objectId),A(e,t.__table__)}))}}]),t}(),b=function(t){!function(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(r,t);var e=l(r);function r(t){var n;return y(this,r),t||(t="Users"),(n=e.call(this,t)).__table__=t,n}return g(r,[{key:"setUsername",value:function(t){this.set("username",t)}},{key:"setPassword",value:function(t){this.set("password",t)}},{key:"save",value:function(){var t=this;return f(d(r.prototype),"save",this).call(this).then((function(e){return"POST"===t.__method__&&(t.__method__="PUT",t.id=e.objectId),m||(m={}),e.attributes.username=t.__data__.username,e=Object.assign(m,e),m=e}))}}],[{key:"current",value:function(){return m}},{key:"logOut",value:function(){m=null}},{key:"logIn",value:function(t,e){var r=this,n="".concat(S.serverURLs.api,"/1.1/login");return s()(n,{method:"POST",body:JSON.stringify({username:t,password:e}),headers:{"X-LC-Id":S.__appId__,"X-LC-Key":S.__appKey__,"Content-Type":"application/json"}}).then((function(t){if(t.ok)return t.json();throw new Error("Login failed")})).then((function(e){return function(t,e,r){e.username=r,m=new w(t,e,"PUT")}(r.__table__,e,t),m}))}}]),r}(w);function A(t,e){return new w(e,t,"PUT")}var S={__appId__:"",__appKey__:"",serverURLs:{api:"https://i5daxohp.api.lncld.net",engine:"https://i5daxohp.engine.lncld.net",push:"https://i5daxohp.push.lncld.net",stats:"https://i5daxohp.stats.lncld.net"},init:function(t){if(!t.appId||!t.appKey)throw new Error("appId or appKey must be required!");var e=t.appId,r=t.appKey,n=c(t,u);for(var o in S.__appKey__=r,S.__appId__=e,n)Object.prototype.hasOwnProperty.call(n,o)&&null!=S[o]&&(S[o]=n[o]);if("string"===typeof S.serverURLs){var i=S.serverURLs;S.serverURLs={api:i,engine:i,push:i,stats:i}}},ACL:function(){function t(){y(this,t),this.permissionsById={}}return g(t,[{key:"setPublicReadAccess",value:function(t){v(t,"Boolean"),null==this.permissionsById["*"]&&(this.permissionsById["*"]={}),this.permissionsById["*"].read=t}},{key:"setPublicWriteAccess",value:function(t){v(t,"Boolean"),null==this.permissionsById["*"]&&(this.permissionsById["*"]={}),this.permissionsById["*"].write=t}},{key:"setReadAccess",value:function(t,e){v(e,"Boolean"),null==this.permissionsById[t]&&(this.permissionsById[t]={}),this.permissionsById[t].read=e}},{key:"setWriteAccess",value:function(t,e){v(e,"Boolean"),null==this.permissionsById[t]&&(this.permissionsById[t]={}),this.permissionsById[t].write=e}}]),t}(),Object:{extend:function(t){return v(t,"String"),w.bind(void 0,t)}},Query:function(){function t(e){y(this,t),e||(e="Users"),this.__table__=e,this.conditions={}}return g(t,[{key:"equalTo",value:function(t,e){return v(t,"String"),null==this.conditions.where&&(this.conditions.where={}),this.conditions.where[t]=e,this}},{key:"get",value:function(t){var e=this;return s()("".concat(S.serverURLs.api,"/1.1/classes/").concat(this.__table__,"/").concat(t,"?fetchWhenSave=true"),{headers:{"X-LC-Id":S.__appId__,"X-LC-Key":S.__appKey__,"Content-Type":"application/json"}}).then((function(t){return t.json()})).then((function(t){return A(t,e.__table__)}))}},{key:"notEqualTo",value:function(t,e){return v(t,"String"),null==this.conditions.where&&(this.conditions.where={}),this.conditions.where[t]={$ne:e},this}},{key:"containedIn",value:function(t,e){return v(t,"String"),v(e,"Array"),null==this.conditions.where&&(this.conditions.where={}),this.conditions.where[t]={$in:e},this}},{key:"select",value:function(t){var e;v(t,["String","Array"]),"string"===typeof t?e=[t]:Array.isArray(t)&&(e=t),null==this.conditions.keys&&(this.conditions.keys="");for(var r=0;r<e.length-1;r++)this.conditions.keys+=e[r]+",";return this.conditions.keys+=e[e.length-1],this}},{key:"skip",value:function(t){return v(t,"Number"),this.conditions.skip=t,this}},{key:"limit",value:function(t){return v(t,"Number"),this.conditions.limit=t,this}},{key:"addDescending",value:function(t){return v(t,"String"),null!=this.conditions.order?this.conditions.order+=",":this.conditions.order="",this.conditions.order+="-"+t,this}},{key:"addAscending",value:function(t){return v(t,"String"),null!=this.conditions.order?this.conditions.order+=",":this.conditions.order="",this.conditions.order+=t,this}},{key:"descending",value:function(t){return v(t,"String"),this.conditions.order="-"+t,this}},{key:"ascending",value:function(t){return v(t,"String"),this.conditions.order=t,this}},{key:"count",value:function(){return this.conditions.count=1,null==this.conditions.limit&&(this.conditions.limit=0),this._find().then((function(t){if(101===t.code)throw t;return t.count}))}},{key:"find",value:function(){var t=this;return this._find().then((function(e){if(101===e.code)throw e;if(!e.results)throw e;for(var r=e.results,n=[],o=0;o<r.length;o++)n.push(new w(t.__table__,r[o],"PUT"));return n})).catch((function(t){throw t}))}},{key:"_find",value:function(){var t="";for(var e in this.conditions){var r=this.conditions[e],n=void 0;null!=r&&(n="object"!==a(r)?r:JSON.stringify(r),t+="&".concat(e,"=").concat(encodeURIComponent(n)))}return t=t.slice(1),s()("".concat(S.serverURLs.api,"/1.1/classes/").concat(this.__table__,"?").concat(t),{headers:{"X-LC-Id":S.__appId__,"X-LC-Key":S.__appKey__,"Content-Type":"application/json"}}).then((function(t){return t.json()}))}}]),t}(),User:b},I=S,R=r(76),C=r(120);function P(t){var e=t.appId,r=t.appKey,n=t.serverURLs;return I.__appKey__&&I.__appId__?Promise.resolve():function(t,e){return new Promise((function(r){return e?r(e):function(t){return fetch("https://app-router.leancloud.cn/2/route?appId="+t,{method:"get"}).then((function(t){return t.json()})).then((function(t){return t.api_server||t.api}))}(t).then((function(t){return r(t)}))})).then((function(t){var e=t;return"string"!==typeof e||e.startsWith("https://")||(e="https://"+e),e})).catch((function(t){throw console.error(t),new Error("Something error happened in initial server urls. Please pass the serverURLs manually")}))}(e,n).then((function(t){if(!t)throw new Error("serverURLs \u83b7\u53d6\u5931\u8d25\uff0c\u8bf7\u81ea\u884c\u624b\u52a8\u6dfb\u52a0, https://github.com/stonehank/react-valine#\u83b7\u53d6serverURLs");try{I.init({appId:e,appKey:r,serverURLs:t})}catch(n){throw console.error(n),new Error("Something error when initial leancloud, try again please")}}))}var E=Object(R.a)("serverless_bbs_ownerCode"),B=E||Object(C.a)(),T={id:null,attributes:{objectId:null,sessionToken:null,username:null}},O={name:"APILayer",data:function(){return{commentsPage:1,errorCodeMsg:{100:"Initialization failed, Please check your appId and appKey.",401:"Unauthorized operation, Please check your appId and appKey.",403:"Access denied by api domain white list, Please check your security domain."}}},methods:{serverInit:function(){return P(this.$serverLessBBS)},__generatePageViews__:function(t,e){var r=this,n=this.$serverLessBBS.CounterClass,o=new(I.Object.extend(n)),i=new I.ACL;return i.setPublicReadAccess(!0),i.setPublicWriteAccess(!0),o.setACL(i),o.set("uniqStr",t),o.set("title",e),o.set("time",1),o.save().then((function(){return 1})).catch((function(t){return console.error(r.errorCodeMsg[t.code],t),1}))},fetchPageViews_server:function(t,e){var r=this,n=this.$serverLessBBS,o=n.CounterClass,i=n.pageviewMap;return i.has(t)?i.get(t):new I.Query(o).equalTo("uniqStr",t).find().then((function(n){if(0===n.length)return r.__generatePageViews__(t,e);n.length>1&&console.warn("Warning! The uniqStr is not unique! Current uniqStr is: "+t);var o=n[0],i=o.get("time")+1;return o.increment("time"),o.set("title",e),o.save().then((function(){return i})).catch((function(){return i-1}))})).catch((function(n){return console.error(r.errorCodeMsg[n.code],n),r.__generatePageViews__(t,e)}))},fetchCounts_server:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.$serverLessBBS.CommentClass,n=new I.Query(r);return(e?n.equalTo("uniqStr",t).count():n.equalTo("uniqStr",t).equalTo("replyId","").count()).then((function(t){return t})).catch((function(t){return 101===t.code||console.error("Error happen in fetch count",t),0}))},signIn_server:function(){var t=this;return this.$serverLessBBS.loggedUser?Promise.resolve(this.$serverLessBBS.loggedUser):this.$serverLessBBS.editMode?new Promise((function(e){return E?I.User.logIn(E,E).then((function(t){return e(t)})).catch((function(r){return t.signUp_server().then((function(t){return e(t)}))})):t.signUp_server().then((function(t){return e(t)}))})):Promise.resolve(T)},signUp_server:function(){var t=this.$serverLessBBS,e=t.editMode,r=t.UserClass;if(!e)return Promise.resolve(T);var n=new I.User(r);n.setUsername(B),n.setPassword(B);var o=new I.ACL;return o.setPublicReadAccess(!1),o.setPublicWriteAccess(!1),n.setACL(o),n.save().then((function(t){return Object(R.b)("serverless_bbs_ownerCode",B),E=B,t})).catch((function(t){return console.error(t),T}))},updateComment_server:function(t,e){var r=this.$serverLessBBS,n=r.editMode,o=r.CommentClass;if(!n)return Promise.reject(null);var i=new(I.Object.extend(o))({objectId:t,message:e},"PUT");return i.set("message",e),i.save().then((function(t){return t.attributes})).catch((function(t){return console.error("update error!",t),null}))},uploadComment_server:function(t){var e=this.$serverLessBBS.CommentClass,r=new(I.Object.extend(e));for(var n in t)t.hasOwnProperty(n)&&r.set(n,t[n]);r.set("url",location.href);var o=new I.ACL;return o.setPublicReadAccess(!0),o.setPublicWriteAccess(!1),this.signIn_server().then((function(t){return r.set("user_id",t.id),t.id&&o.setWriteAccess(t.id,!0),r.setACL(o),r.save()})).then((function(t){var e=t.attributes;return e.error?(console.error(e.error),null):e})).catch((function(t){return console.error(t.msg),null}))},fetchComments_server:function(t){var e=this,r=this.$serverLessBBS.CommentClass;return new I.Query(r).equalTo("uniqStr",t).select(["nickname","rootId","message","link","pid","avatar","replyId","at","user_id"]).addDescending("createdAt").skip(1e3*(this.commentsPage-1)).limit(1e3).find().then((function(t){return e.commentsPage++,t.map((function(t){return t.attributes}))})).catch((function(t){if(101===t.code)return[];console.error("Error happen in fetch owner task",t)}))}}},U=r(1);function j(t,e){var r="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"===typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(t,e)}(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw i}}}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var x={name:"ConvertLayer",extends:Object(U.a)(O,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,null,null,null).exports,data:function(){return{initialLoading:!0,noMoreRemoteData:!1,allCommentData:[],objectIdToData:{},waitNextInserted:[],checkOnNextInsert:!1}},mounted:function(){var t=this;this.serverInit().then((function(){return t.initialLoading=!1}))},methods:{fetchPageViews:function(t){var e=this;return this.fetchPageViews_server(t).then((function(r){return e.$serverLessBBS.pageviewMap.set(t,r),r}))},fetchCounts:function(t){var e=this;return this.fetchCounts_server(t).then((function(r){return e.$serverLessBBS.countMap.set(t,r),r}))},updateComment:function(t,e){var r=this;return this.updateComment_server(t,e).then((function(e){return e?(r.__updateCommentAfterEdit__(t,e),e):null}))},uploadComment:function(t){var e=this;return this.uploadComment_server(t).then((function(t){if(!t)return null;if(!t.replyId){var r=e.$serverLessBBS.countMap.get(t.uniqStr);e.$serverLessBBS.countMap.set(t.uniqStr,r+1)}return e.__insertInToList__(e.allCommentData,t),t})).catch((function(t){return null}))},fetchCurrentUser:function(){var t=this;return this.signIn_server().then((function(e){var r=e;return e.attributes&&(r={id:e.id,sessionToken:e.attributes.sessionToken,username:e.attributes.username}),t.$serverLessBBS.loggedUser=r,r}))},fetchComments:function(t){var e=this,r=t.uniqStr,n=t.replyId,i=t.pageSize,s=t.page,u=t.deepReply,a=t.deepReplyCounts;return this.checkOnNextInsert=!0,(n||this.noMoreRemoteData?Promise.resolve(this.allCommentData):this.__getMoreData__(r)).then((function(t){var r=t;n?(r=e.objectIdToData[n].replys,u&&(r=e.__deepSearchReply__(r))):u&&(r=Object.values(e.objectIdToData));var c=o()(r.slice(0,i*s));return a&&e.__deepSearchReplyCount__(c),c=c.map((function(t){return t.replys=null,t})).sort((function(t,e){return t.createdAt<e.createdAt?1:-1})),new Promise((function(t){setTimeout((function(){t({data:c,total:Math.max(e.allCommentData.length,c.length,r.length)})}),200)}))}))},__updateCommentAfterEdit__:function(t,e){var r=this.objectIdToData[t];r.message=e.message,r.updatedAt=e.updatedAt},__insertInToList__:function(t,e){if(e.replyId){var r=this.objectIdToData[e.replyId];null==r.replys&&(r.replys=[],r.replyCounts=0),r.replys.unshift(e),r.replyCounts++}else t.unshift(e);this.objectIdToData[e.objectId]=e},__getMoreData__:function(t){var e=this;return this.fetchComments_server(t).then((function(t){return e.noMoreRemoteData=t.length<1e3,t})).then(this.__generateIndexSearch__).then(this.__mergeToNest__).then(this.__generateReplyCounts__)},__deepSearchReply__:function(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r]),t[r].replys&&(e=e.concat(this.__deepSearchReply__(t[r].replys)));return e},__deepSearchReplyCount__:function(t){for(var e=0,r=0;r<t.length;r++)t[r].replys&&t[r].replys.length>0?(t[r].replyCounts=this.__deepSearchReplyCount__(t[r].replys),e+=t[r].replyCounts+1):e+=1;return e},__mergeToNest__:function(t){this.checkOnNextInsert&&(t=t.concat(this.waitNextInserted),this.waitNextInserted=[],this.checkOnNextInsert=!1);var e,r=[],n=j(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;o.replyId?r.push(o):this.allCommentData.push(o)}}catch(c){n.e(c)}finally{n.f()}r.sort((function(t,e){return t.createdAt<e.createdAt?-1:1}));for(var i=0,s=r;i<s.length;i++){var u=s[i],a=this.__insertReplyItem__(this.allCommentData,u);a.inserted?this.allCommentData=a.list:this.waitNextInserted.push(u)}return this.allCommentData},__generateReplyCounts__:function(t){var e,r=j(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.replys&&n.replys.length>0?(n.replyCounts=n.replys.length,this.__generateReplyCounts__(n.replys)):n.replyCounts=0}}catch(o){r.e(o)}finally{r.f()}return t},__generateIndexSearch__:function(t){var e,r=j(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.objectIdToData[n.objectId]=n}}catch(o){r.e(o)}finally{r.f()}return t},__insertReplyItem__:funct