!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=158)}([function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},function(t,e,n){t.exports=n(159)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return N})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return S})),n.d(e,"h",(function(){return m})),n.d(e,"i",(function(){return p})),n.d(e,"j",(function(){return A})),n.d(e,"k",(function(){return j})),n.d(e,"l",(function(){return k})),n.d(e,"m",(function(){return O})),n.d(e,"n",(function(){return g})),n.d(e,"o",(function(){return _})),n.d(e,"p",(function(){return y})),n.d(e,"q",(function(){return x})),n.d(e,"r",(function(){return b})),n.d(e,"s",(function(){return E})),n.d(e,"t",(function(){return I})),n.d(e,"u",(function(){return T})),n.d(e,"v",(function(){return q})),n.d(e,"w",(function(){return P})),n.d(e,"x",(function(){return w})); /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const r=!1,i=!1,o="${JSCORE_VERSION}",a=function(t,e){if(!t)throw s(e)},s=function(t){return new Error("Firebase Database ("+o+") INTERNAL ASSERT FAILED: "+t)},l=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let e=0;e>2,u=(3&i)<<4|a>>4;let d=(15&a)<<2|l>>6,h=63&l;s||(h=64,o||(d=64)),r.push(n[c],n[u],n[d],n[h])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(l(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(o>>10)),e[r++]=String.fromCharCode(56320+(1023&o))}else{const o=t[n++],a=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let e=0;e>4;if(r.push(l),64!==a){const t=o<<4&240|a>>2;if(r.push(t),64!==s){const t=a<<6&192|s;r.push(t)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){const e=l(t);return c.encodeByteArray(e,!0)},d=function(t){return u(t).replace(/\./g,"")},h=function(t){try{return c.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null}; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function p(t){return function t(e,n){if(!(n instanceof Object))return n;switch(n.constructor){case Date:return new Date(n.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return n}for(const r in n)n.hasOwnProperty(r)&&"__proto__"!==r&&(e[r]=t(e[r],n[r]));return e}(void 0,t)} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class f{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch(()=>{}),1===t.length?t(e):t(e,n))}}} /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function m(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",r=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:"https://securetoken.google.com/"+n,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t);return[d(JSON.stringify({alg:"none",type:"JWT"})),d(JSON.stringify(o)),""].join(".")} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function v(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function g(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function y(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function _(){return!0===r||!0===i}Error; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function b(t){return JSON.parse(t)}function w(t){return JSON.stringify(t)} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const C=function(t){let e={},n={},r={},i="";try{const o=t.split(".");e=b(h(o[0])||""),n=b(h(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(t){}return{header:e,claims:n,data:r,signature:i}},x=function(t){const e=C(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},k=function(t){const e=C(t).claims;return"object"==typeof e&&!0===e.admin}; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function O(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function E(t,e,n){const r={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function I(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(t=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class N{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let t=1;t>>31)}let r,i,o=this.chain_[0],a=this.chain_[1],s=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(let t=0;t<80;t++){t<40?t<20?(r=l^a&(s^l),i=1518500249):(r=a^s^l,i=1859775393):t<60?(r=a&s|l&(a|s),i=2400959708):(r=a^s^l,i=3395469782);const e=(o<<5|o>>>27)+r+c+i+n[t]&4294967295;c=l,l=s,s=4294967295&(a<<30|a>>>2),a=o,o=e}this.chain_[0]=this.chain_[0]+o&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+s&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(t,e){if(null==t)return;void 0===e&&(e=t.length);const n=e-this.blockSize;let r=0;const i=this.buf_;let o=this.inbuf_;for(;r=56;t--)this.buf_[t]=255&e,e/=256;this.compress_(this.buf_);let n=0;for(let e=0;e<5;e++)for(let r=24;r>=0;r-=8)t[n]=this.chain_[e]>>r&255,++n;return t}}function A(t,e){return`${t} failed: ${e} argument `} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const P=function(t){const e=[];let n=0;for(let r=0;r=55296&&i<=56319){const e=i-55296;r++,a(r>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},q=function(t){let e=0;for(let n=0;n=55296&&r<=56319?(e+=4,n++):e+=3}return e}; /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function j(t){return t&&t._delegate?t._delegate:t}}).call(this,n(27))},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,l,"next",t)}function l(t){n(a,i,o,s,l,"throw",t)}s(void 0)}))}}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";(function(t){n.d(e,"d",(function(){return m})),n.d(e,"b",(function(){return g})),n.d(e,"c",(function(){return w}));var r=n(1),i=n.n(r),o=n(3),a=n.n(o),s=n(7),l=n(95),c=n.n(l),u=n(6),d="quizac.accessToken",h="quizac.refreshToken",p="quizac.user";function f(e){try{t.browser&&localStorage.setItem(p,JSON.stringify(e))}catch(t){console.log(t)}}function m(e){if(t.browser){var n=w();if(!n)return;var r=JSON.stringify({LoadedPropertyOption:{LoadedProperties:["activePoints","bio","dob","category","categoryId","subscriptions","currencyCode","displayName","email","availableGems","picture","tickets","freeTickets","pointsToClaimNewGem","firstname","id","lastname","location","phoneNumber","isAvailable","gender"]}});s.a.get("".concat(u.urlConfig.baseUrl,"users/").concat(n.id,"/get?option=").concat(r)).then((function(t){if(200==t.status){var n=t.data;"success"==n.status&&f(n.data),e&&e(n.data)}}))}}function v(){return(v=a()(i.a.mark((function t(){var e,n;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null!=(e=localStorage.getItem(d))){t.next=4;break}return t.abrupt("return",null);case 4:return n=c.a.decode(e),t.abrupt("return",n);case 8:return t.prev=8,t.t0=t.catch(0),t.abrupt("return",null);case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))).apply(this,arguments)}function g(){return y.apply(this,arguments)}function y(){return(y=a()(i.a.mark((function t(){var e,n,r,o,a,s;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null!=(e=localStorage.getItem(d))){t.next=4;break}return t.abrupt("return","");case 4:if(n=c.a.decode(e),r=n.exp,o=new Date(1e3*r),a=new Date,!(o>a)){t.next=10;break}return t.abrupt("return",e);case 10:return t.next=12,_();case 12:return s=t.sent,t.abrupt("return",s);case 16:return t.prev=16,t.t0=t.catch(0),t.abrupt("return","");case 19:case"end":return t.stop()}}),t,null,[[0,16]])})))).apply(this,arguments)}function _(){return b.apply(this,arguments)}function b(){return(b=a()(i.a.mark((function t(){var e,n,r,o,a,l,c;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e=localStorage.getItem(h),n={noQuizacAuth:!0},r={refreshToken:e,clientId:null,clientSecret:null},o=JSON.parse(localStorage.getItem(p)),t.next=7,s.a.post("".concat(u.urlConfig.baseUrl,"auth/").concat(o.id,"/refreshToken"),r,n);case 7:if(a=t.sent,l=a.data,"success"!=(c=l).status){t.next=14;break}return localStorage.setItem(d,c.data.accessToken),localStorage.setItem(h,c.data.refreshToken),t.abrupt("return",c.data.accessToken);case 14:return t.abrupt("return","");case 17:return t.prev=17,t.t0=t.catch(0),t.abrupt("return","");case 20:case"end":return t.stop()}}),t,null,[[0,17]])})))).apply(this,arguments)}function w(){try{if(t.browser){var e=JSON.parse(localStorage.getItem(p));return e||null}return null}catch(t){return null}}e.a={getCurrentUser:w,updateUser:f,refreshUser:m,getAccessToken:g,safeAuthenticationData:function(e){var n=e.access_token,r=e.refresh_token,i=e.user;try{t.browser&&(localStorage.setItem(d,n),localStorage.setItem(h,r),localStorage.setItem(p,JSON.stringify(i)))}catch(t){}},clearStorage:function(){t.browser&&(localStorage.removeItem(d),localStorage.removeItem(h),localStorage.removeItem(p),localStorage.removeItem("loginRequired"),localStorage.removeItem("returnUrl"))},decodeJwtToken:function(){return v.apply(this,arguments)},refreshAccessToken:_,setReturnUrl:function(e){t.browser&&localStorage.setItem("returnUrl",e)},getReturnUrl:function(){if(t.browser)return localStorage.getItem("returnUrl")},clearReturnUrl:function(){if(t.browser)return localStorage.removeItem("returnUrl")}}}).call(this,n(19))},function(t){t.exports=JSON.parse('{"urlConfig2":{"baseUrl":"https://api.staging.quizac.com/","baseUrl2":"http://localhost:60896/","webUrl":"https://staging.quizac.com/","servicesBaseUrl":"https://api.services-staging.quizac.com/","paystackPublicKey":"pk_test_59270e4e7d589db8f22191e74373052a69b525f6","contributorUrl":"https://staging.contributor.quizac.com/","serviceWorkerScript":"/firebase-messaging-sw-staging.js","firebaseConfig":{"apiKey":"AIzaSyAFYh3w5mej2JvV7KH7k1r0YhcvxjhJuaM","authDomain":"quizac-staging.firebaseapp.com","databaseURL":"https://quizac-staging.firebaseio.com","projectId":"quizac-staging","storageBucket":"quizac-staging.appspot.com","messagingSenderId":"194753472989","appId":"1:194753472989:web:e29962bff74ef94514ee34"}},"urlConfig":{"baseUrl":"https://api.quizac.com/","webUrl":"https://quizac.com/","servicesBaseUrl":"https://api.services.quizac.com/","paystackPublicKey":"pk_live_3cc98f961448ac10dc196eb0b8cdfae3719b6c4e","contributorUrl":"https://contributor.quizac.com/","serviceWorkerScript":"/firebase-messaging-sw.js","firebaseConfig":{"apiKey":"AIzaSyBnlNcfik7Y5l8weUc_Udl5a4z9uGhuUzU","authDomain":"quizac-14fa2.firebaseapp.com","databaseURL":"https://quizac-14fa2.firebaseio.com","projectId":"quizac-14fa2","storageBucket":"quizac-14fa2.appspot.com","messagingSenderId":"605961954630","appId":"1:605961954630:web:503119dd223a628b947147"}},"google_api_key":"AIzaSyBnlNcfik7Y5l8weUc_Udl5a4z9uGhuUzU","countries":[{"Code":"AF","Name":"Afghanistan"},{"Code":"AX","Name":"Åland Islands"},{"Code":"AL","Name":"Albania"},{"Code":"DZ","Name":"Algeria"},{"Code":"AS","Name":"American Samoa"},{"Code":"AD","Name":"Andorra"},{"Code":"AO","Name":"Angola"},{"Code":"AI","Name":"Anguilla"},{"Code":"AQ","Name":"Antarctica"},{"Code":"AG","Name":"Antigua and Barbuda"},{"Code":"AR","Name":"Argentina"},{"Code":"AM","Name":"Armenia"},{"Code":"AW","Name":"Aruba"},{"Code":"AU","Name":"Australia"},{"Code":"AT","Name":"Austria"},{"Code":"AZ","Name":"Azerbaijan"},{"Code":"BS","Name":"Bahamas"},{"Code":"BH","Name":"Bahrain"},{"Code":"BD","Name":"Bangladesh"},{"Code":"BB","Name":"Barbados"},{"Code":"BY","Name":"Belarus"},{"Code":"BE","Name":"Belgium"},{"Code":"BZ","Name":"Belize"},{"Code":"BJ","Name":"Benin"},{"Code":"BM","Name":"Bermuda"},{"Code":"BT","Name":"Bhutan"},{"Code":"BO","Name":"Bolivia, Plurinational State of"},{"Code":"BQ","Name":"Bonaire, Sint Eustatius and Saba"},{"Code":"BA","Name":"Bosnia and Herzegovina"},{"Code":"BW","Name":"Botswana"},{"Code":"BV","Name":"Bouvet Island"},{"Code":"BR","Name":"Brazil"},{"Code":"IO","Name":"British Indian Ocean Territory"},{"Code":"BN","Name":"Brunei Darussalam"},{"Code":"BG","Name":"Bulgaria"},{"Code":"BF","Name":"Burkina Faso"},{"Code":"BI","Name":"Burundi"},{"Code":"KH","Name":"Cambodia"},{"Code":"CM","Name":"Cameroon"},{"Code":"CA","Name":"Canada"},{"Code":"CV","Name":"Cape Verde"},{"Code":"KY","Name":"Cayman Islands"},{"Code":"CF","Name":"Central African Republic"},{"Code":"TD","Name":"Chad"},{"Code":"CL","Name":"Chile"},{"Code":"CN","Name":"China"},{"Code":"CX","Name":"Christmas Island"},{"Code":"CC","Name":"Cocos (Keeling) Islands"},{"Code":"CO","Name":"Colombia"},{"Code":"KM","Name":"Comoros"},{"Code":"CG","Name":"Congo"},{"Code":"CD","Name":"Congo, the Democratic Republic of the"},{"Code":"CK","Name":"Cook Islands"},{"Code":"CR","Name":"Costa Rica"},{"Code":"CI","Name":"Côte d\'Ivoire"},{"Code":"HR","Name":"Croatia"},{"Code":"CU","Name":"Cuba"},{"Code":"CW","Name":"Curaçao"},{"Code":"CY","Name":"Cyprus"},{"Code":"CZ","Name":"Czech Republic"},{"Code":"DK","Name":"Denmark"},{"Code":"DJ","Name":"Djibouti"},{"Code":"DM","Name":"Dominica"},{"Code":"DO","Name":"Dominican Republic"},{"Code":"EC","Name":"Ecuador"},{"Code":"EG","Name":"Egypt"},{"Code":"SV","Name":"El Salvador"},{"Code":"GQ","Name":"Equatorial Guinea"},{"Code":"ER","Name":"Eritrea"},{"Code":"EE","Name":"Estonia"},{"Code":"ET","Name":"Ethiopia"},{"Code":"FK","Name":"Falkland Islands (Malvinas)"},{"Code":"FO","Name":"Faroe Islands"},{"Code":"FJ","Name":"Fiji"},{"Code":"FI","Name":"Finland"},{"Code":"FR","Name":"France"},{"Code":"GF","Name":"French Guiana"},{"Code":"PF","Name":"French Polynesia"},{"Code":"TF","Name":"French Southern Territories"},{"Code":"GA","Name":"Gabon"},{"Code":"GM","Name":"Gambia"},{"Code":"GE","Name":"Georgia"},{"Code":"DE","Name":"Germany"},{"Code":"GH","Name":"Ghana"},{"Code":"GI","Name":"Gibraltar"},{"Code":"GR","Name":"Greece"},{"Code":"GL","Name":"Greenland"},{"Code":"GD","Name":"Grenada"},{"Code":"GP","Name":"Guadeloupe"},{"Code":"GU","Name":"Guam"},{"Code":"GT","Name":"Guatemala"},{"Code":"GG","Name":"Guernsey"},{"Code":"GN","Name":"Guinea"},{"Code":"GW","Name":"Guinea-Bissau"},{"Code":"GY","Name":"Guyana"},{"Code":"HT","Name":"Haiti"},{"Code":"HM","Name":"Heard Island and McDonald Islands"},{"Code":"VA","Name":"Holy See (Vatican City State)"},{"Code":"HN","Name":"Honduras"},{"Code":"HK","Name":"Hong Kong"},{"Code":"HU","Name":"Hungary"},{"Code":"IS","Name":"Iceland"},{"Code":"IN","Name":"India"},{"Code":"ID","Name":"Indonesia"},{"Code":"IR","Name":"Iran, Islamic Republic of"},{"Code":"IQ","Name":"Iraq"},{"Code":"IE","Name":"Ireland"},{"Code":"IM","Name":"Isle of Man"},{"Code":"IL","Name":"Israel"},{"Code":"IT","Name":"Italy"},{"Code":"JM","Name":"Jamaica"},{"Code":"JP","Name":"Japan"},{"Code":"JE","Name":"Jersey"},{"Code":"JO","Name":"Jordan"},{"Code":"KZ","Name":"Kazakhstan"},{"Code":"KE","Name":"Kenya"},{"Code":"KI","Name":"Kiribati"},{"Code":"KP","Name":"Korea, Democratic People\'s Republic of"},{"Code":"KR","Name":"Korea, Republic of"},{"Code":"KW","Name":"Kuwait"},{"Code":"KG","Name":"Kyrgyzstan"},{"Code":"LA","Name":"Lao People\'s Democratic Republic"},{"Code":"LV","Name":"Latvia"},{"Code":"LB","Name":"Lebanon"},{"Code":"LS","Name":"Lesotho"},{"Code":"LR","Name":"Liberia"},{"Code":"LY","Name":"Libya"},{"Code":"LI","Name":"Liechtenstein"},{"Code":"LT","Name":"Lithuania"},{"Code":"LU","Name":"Luxembourg"},{"Code":"MO","Name":"Macao"},{"Code":"MK","Name":"Macedonia, the Former Yugoslav Republic of"},{"Code":"MG","Name":"Madagascar"},{"Code":"MW","Name":"Malawi"},{"Code":"MY","Name":"Malaysia"},{"Code":"MV","Name":"Maldives"},{"Code":"ML","Name":"Mali"},{"Code":"MT","Name":"Malta"},{"Code":"MH","Name":"Marshall Islands"},{"Code":"MQ","Name":"Martinique"},{"Code":"MR","Name":"Mauritania"},{"Code":"MU","Name":"Mauritius"},{"Code":"YT","Name":"Mayotte"},{"Code":"MX","Name":"Mexico"},{"Code":"FM","Name":"Micronesia, Federated States of"},{"Code":"MD","Name":"Moldova, Republic of"},{"Code":"MC","Name":"Monaco"},{"Code":"MN","Name":"Mongolia"},{"Code":"ME","Name":"Montenegro"},{"Code":"MS","Name":"Montserrat"},{"Code":"MA","Name":"Morocco"},{"Code":"MZ","Name":"Mozambique"},{"Code":"MM","Name":"Myanmar"},{"Code":"NA","Name":"Namibia"},{"Code":"NR","Name":"Nauru"},{"Code":"NP","Name":"Nepal"},{"Code":"NL","Name":"Netherlands"},{"Code":"NC","Name":"New Caledonia"},{"Code":"NZ","Name":"New Zealand"},{"Code":"NI","Name":"Nicaragua"},{"Code":"NE","Name":"Niger"},{"Code":"NG","Name":"Nigeria"},{"Code":"NU","Name":"Niue"},{"Code":"NF","Name":"Norfolk Island"},{"Code":"MP","Name":"Northern Mariana Islands"},{"Code":"NO","Name":"Norway"},{"Code":"OM","Name":"Oman"},{"Code":"PK","Name":"Pakistan"},{"Code":"PW","Name":"Palau"},{"Code":"PS","Name":"Palestine, State of"},{"Code":"PA","Name":"Panama"},{"Code":"PG","Name":"Papua New Guinea"},{"Code":"PY","Name":"Paraguay"},{"Code":"PE","Name":"Peru"},{"Code":"PH","Name":"Philippines"},{"Code":"PN","Name":"Pitcairn"},{"Code":"PL","Name":"Poland"},{"Code":"PT","Name":"Portugal"},{"Code":"PR","Name":"Puerto Rico"},{"Code":"QA","Name":"Qatar"},{"Code":"RE","Name":"Réunion"},{"Code":"RO","Name":"Romania"},{"Code":"RU","Name":"Russian Federation"},{"Code":"RW","Name":"Rwanda"},{"Code":"BL","Name":"Saint Barthélemy"},{"Code":"SH","Name":"Saint Helena, Ascension and Tristan da Cunha"},{"Code":"KN","Name":"Saint Kitts and Nevis"},{"Code":"LC","Name":"Saint Lucia"},{"Code":"MF","Name":"Saint Martin (French part)"},{"Code":"PM","Name":"Saint Pierre and Miquelon"},{"Code":"VC","Name":"Saint Vincent and the Grenadines"},{"Code":"WS","Name":"Samoa"},{"Code":"SM","Name":"San Marino"},{"Code":"ST","Name":"Sao Tome and Principe"},{"Code":"SA","Name":"Saudi Arabia"},{"Code":"SN","Name":"Senegal"},{"Code":"RS","Name":"Serbia"},{"Code":"SC","Name":"Seychelles"},{"Code":"SL","Name":"Sierra Leone"},{"Code":"SG","Name":"Singapore"},{"Code":"SX","Name":"Sint Maarten (Dutch part)"},{"Code":"SK","Name":"Slovakia"},{"Code":"SI","Name":"Slovenia"},{"Code":"SB","Name":"Solomon Islands"},{"Code":"SO","Name":"Somalia"},{"Code":"ZA","Name":"South Africa"},{"Code":"GS","Name":"South Georgia and the South Sandwich Islands"},{"Code":"SS","Name":"South Sudan"},{"Code":"ES","Name":"Spain"},{"Code":"LK","Name":"Sri Lanka"},{"Code":"SD","Name":"Sudan"},{"Code":"SR","Name":"Suriname"},{"Code":"SJ","Name":"Svalbard and Jan Mayen"},{"Code":"SZ","Name":"Swaziland"},{"Code":"SE","Name":"Sweden"},{"Code":"CH","Name":"Switzerland"},{"Code":"SY","Name":"Syrian Arab Republic"},{"Code":"TW","Name":"Taiwan, Province of China"},{"Code":"TJ","Name":"Tajikistan"},{"Code":"TZ","Name":"Tanzania, United Republic of"},{"Code":"TH","Name":"Thailand"},{"Code":"TL","Name":"Timor-Leste"},{"Code":"TG","Name":"Togo"},{"Code":"TK","Name":"Tokelau"},{"Code":"TO","Name":"Tonga"},{"Code":"TT","Name":"Trinidad and Tobago"},{"Code":"TN","Name":"Tunisia"},{"Code":"TR","Name":"Turkey"},{"Code":"TM","Name":"Turkmenistan"},{"Code":"TC","Name":"Turks and Caicos Islands"},{"Code":"TV","Name":"Tuvalu"},{"Code":"UG","Name":"Uganda"},{"Code":"UA","Name":"Ukraine"},{"Code":"AE","Name":"United Arab Emirates"},{"Code":"GB","Name":"United Kingdom"},{"Code":"US","Name":"United States"},{"Code":"UM","Name":"United States Minor Outlying Islands"},{"Code":"UY","Name":"Uruguay"},{"Code":"UZ","Name":"Uzbekistan"},{"Code":"VU","Name":"Vanuatu"},{"Code":"VE","Name":"Venezuela, Bolivarian Republic of"},{"Code":"VN","Name":"Viet Nam"},{"Code":"VG","Name":"Virgin Islands, British"},{"Code":"VI","Name":"Virgin Islands, U.S."},{"Code":"WF","Name":"Wallis and Futuna"},{"Code":"EH","Name":"Western Sahara"},{"Code":"YE","Name":"Yemen"},{"Code":"ZM","Name":"Zambia"},{"Code":"ZW","Name":"Zimbabwe"}]}')},function(t,e,n){"use strict";(function(t){var r=n(1),i=n.n(r),o=n(3),a=n.n(o),s=n(33),l=n.n(s),c=n(5);function u(){return(u=a()(i.a.mark((function e(n){var r,o,a,s;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.headers["Cache-Control"]="no-store",n.headers.Pragma="no-store",n.headers.Expires="0",!n.noQuizacAuth){e.next=5;break}return e.abrupt("return",n);case 5:if(!(t.browser&&localStorage.getItem("loginRequired"))){e.next=8;break}return e.abrupt("return",Promise.reject("Login Required"));case 8:return e.next=10,Object(c.b)();case 10:return r=e.sent,n.headers.Authorization="Bearer "+r,o=(new Date).getTime(),(a=n.url.split("?")).length>1?(s="".concat(a[1],"×tamp=").concat(o),n.url="".concat(a[0],"?").concat(s)):n.url=n.url+"?timestamp="+o,e.abrupt("return",n);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}l.a.interceptors.response.use(null,(function(e){var n=e.response;if(!n)return Promise.reject(e);if(n&&401==n.status&&t.browser){localStorage.setItem("loginRequired","true");var r="".concat(window.location.pathname);window.location=r}return Promise.reject(e)})),l.a.interceptors.request.use((function(t){return function(t){return u.apply(this,arguments)}(t)}),(function(t){return Promise.reject(t)})),e.a={get:l.a.get,post:l.a.post,put:l.a.put,all:l.a.all,patch:l.a.patch,delete:l.a.delete}}).call(this,n(19))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return w})),n.d(e,"f",(function(){return v})),n.d(e,"g",(function(){return b})),n.d(e,"h",(function(){return k})),n.d(e,"i",(function(){return s})),n.d(e,"j",(function(){return c})),n.d(e,"k",(function(){return m})),n.d(e,"l",(function(){return d})),n.d(e,"m",(function(){return l})),n.d(e,"n",(function(){return u})),n.d(e,"o",(function(){return y})),n.d(e,"p",(function(){return _})); /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const r=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},i={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let e=0;e>2,u=(3&i)<<4|a>>4;let d=(15&a)<<2|l>>6,h=63&l;s||(h=64,o||(d=64)),r.push(n[c],n[u],n[d],n[h])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(r(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(o>>10)),e[r++]=String.fromCharCode(56320+(1023&o))}else{const o=t[n++],a=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let e=0;e>4;if(r.push(l),64!==a){const t=o<<4&240|a>>2;if(r.push(t),64!==s){const t=a<<6&192|s;r.push(t)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},o=function(t){try{return i.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null}; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class a{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch(()=>{}),1===t.length?t(e):t(e,n))}}} /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function s(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function l(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(s())}function c(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function u(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function d(){const t=s();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}class h extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,h.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,p.prototype.create)}}class p{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){const n=e[0]||{},r=`${this.service}/${t}`,i=this.errors[t],o=i?function(t,e){return t.replace(f,(t,n)=>{const r=e[n];return null!=r?String(r):`<${n}?>`})}(i,n):"Error",a=`${this.serviceName}: ${o} (${r}).`;return new h(r,a,n)}}const f=/\{\$([^}]+)}/g; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function m(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function v(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const n=t[i],o=e[i];if(g(n)&&g(o)){if(!v(n,o))return!1}else if(n!==o)return!1}for(const t of r)if(!n.includes(t))return!1;return!0}function g(t){return null!==t&&"object"==typeof t} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function y(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(t=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function _(t){const e={};return t.replace(/^\?/,"").split("&").forEach(t=>{if(t){const[n,r]=t.split("=");e[decodeURIComponent(n)]=decodeURIComponent(r)}}),e}function b(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function w(t,e){const n=new C(t,e);return n.subscribe.bind(n)}class C{constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then(()=>{t(this)}).catch(t=>{this.error(t)})}next(t){this.forEachObserver(e=>{e.next(t)})}error(t){this.forEachObserver(e=>{e.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,e,n){let r;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");r=function(t,e){if("object"!=typeof t||null===t)return!1;for(const n of e)if(n in t&&"function"==typeof t[n])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===r.next&&(r.next=x),void 0===r.error&&(r.error=x),void 0===r.complete&&(r.complete=x);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(t){}}),this.observers.push(r),i}unsubscribeOne(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let e=0;e{if(void 0!==this.observers&&void 0!==this.observers[t])try{e(this.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}})}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function x(){} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function k(t){return t&&t._delegate?t._delegate:t}}).call(this,n(27))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r={button_click:1,option_correct:2,option_wrong:3,point_increased:4,game_active:5,game_end:6,searching_opponent:7,app_launched:8,off_game:9,timer_tick:10,onboarding:11,loading:12,chat_sent:13,tickets_deduction:14,notification:15,bonus_up:16,spinning_wheel_celebration:17,spinning_wheel_sound:18},i={sound_effect:1,in_game:2,off_game:3,notification:4},o={very_low:1,low:2,medium:3,high:4,highest:5}},function(t,e,n){"use strict";(function(t){n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"e",(function(){return l})),n.d(e,"b",(function(){return c}));t.browser&&window.navigator.platform;var r=t.browser?window.navigator.userAgent:null,i=["As a Quizac user, you can play any topic based on your country curriculum and class.","As a premium Quizac user, you can start a multiplayer or group game with maximum of 50 players","The faster you answer questions correctly on Quizac, the more your point","Plants retain a definite shape because of their rigid cell walls.","As a Quizac user, you can create your own games, practice alone or challenge a friend"," With a single GEM earned on Quizac, you can roll reward wheel for a chance to win amazing prizes","For every 300 points you score, you get additional 1GEM."];function o(){return/Android/.test(r)}function a(){return{client_id:"Web",client_secret:"quizacWeb",grant_type:0}}function s(){var t=Math.floor(Math.random()*i.length);return i[t]}function l(e,n){if(t.browser&&e){var r=new Image;r.src=e,r.onload=function(){n(r.src,r)}}}function c(t){var e;e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):unescape(t.split(",")[1]);for(var n=t.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(e.length),i=0;i"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...t.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return null!=this.component}isInitialized(t="[DEFAULT]"){return this.instances.has(t)}getOptions(t="[DEFAULT]"){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,n=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:e});for(const[t,e]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(t)&&e.resolve(r)}return r}onInit(t,e){var n;const r=this.normalizeInstanceIdentifier(e),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(t),this.onInitCallbacks.set(r,i);const o=this.instances.get(r);return o&&t(o,r),()=>{i.delete(t)}}invokeOnInitCallbacks(t,e){const n=this.onInitCallbacks.get(e);if(n)for(const r of n)try{r(t,e)}catch(t){}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=t,"[DEFAULT]"===r?void 0:r),options:e}),this.instances.set(t,n),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch(t){}var r;return n||null}normalizeInstanceIdentifier(t="[DEFAULT]"){return this.component?this.component.multipleInstances?t:"[DEFAULT]":t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class a{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const e=this.getProvider(t.name);if(e.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);e.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new o(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const s=[];var l;!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(l||(l={}));const c={debug:l.DEBUG,verbose:l.VERBOSE,info:l.INFO,warn:l.WARN,error:l.ERROR,silent:l.SILENT},u=l.INFO,d={[l.DEBUG]:"log",[l.VERBOSE]:"log",[l.INFO]:"info",[l.WARN]:"warn",[l.ERROR]:"error"},h=(t,e,...n)=>{if(e{if(function(t){const e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null}).filter(t=>t).join(" ")}}const f="@firebase/app",m=new class{constructor(t){this.name=t,this._logLevel=u,this._logHandler=h,this._userLogHandler=null,s.push(this)}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in l))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?c[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,l.DEBUG,...t),this._logHandler(this,l.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,l.VERBOSE,...t),this._logHandler(this,l.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,l.INFO,...t),this._logHandler(this,l.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,l.WARN,...t),this._logHandler(this,l.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,l.ERROR,...t),this._logHandler(this,l.ERROR,...t)}}("@firebase/app"),v={[f]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},g=new Map,y=new Map;function _(t,e){try{t.container.addComponent(e)}catch(n){m.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function b(t){const e=t.name;if(y.has(e))return m.debug(`There were multiple attempts to register component ${e}.`),!1;y.set(e,t);for(const e of g.values())_(e,t);return!0}function w(t,e){return t.container.getProvider(e)} /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const C={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."},x=new r.b("app","Firebase",C); /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class k{constructor(t,e,n){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},e),this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new i("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw x.create("app-deleted",{appName:this._name})}} /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const S="9.3.0";function T(t,e={}){if("object"!=typeof e){e={name:e}}const n=Object.assign({name:"[DEFAULT]",automaticDataCollectionEnabled:!1},e),i=n.name;if("string"!=typeof i||!i)throw x.create("bad-app-name",{appName:String(i)});const o=g.get(i);if(o){if(Object(r.c)(t,o.options)&&Object(r.c)(n,o.config))return o;throw x.create("duplicate-app",{appName:i})}const s=new a(i);for(const t of y.values())s.addComponent(t);const l=new k(t,n,s);return g.set(i,l),l}function O(t="[DEFAULT]"){const e=g.get(t);if(!e)throw x.create("no-app",{appName:t});return e}function E(t,e,n){var r;let o=null!==(r=v[t])&&void 0!==r?r:t;n&&(o+="-"+n);const a=o.match(/\s|\//),s=e.match(/\s|\//);if(a||s){const t=[`Unable to register library "${o}" with version "${e}":`];return a&&t.push(`library name "${o}" contains illegal characters (whitespace or "/")`),a&&s&&t.push("and"),s&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void m.warn(t.join(" "))}b(new i(o+"-version",()=>({library:o,version:e}),"VERSION"))} /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var I;I="",b(new i("platform-logger",t=>new p(t),"PRIVATE")),E(f,"0.7.6",I),E(f,"0.7.6","esm2017"),E("fire-js","")},function(t,e){t.exports="/img/avatar.png"},function(t,e,n){"use strict";n.d(e,"a",(function(){return ot})),n.d(e,"b",(function(){return nt})),n.d(e,"c",(function(){return S}));var r=n(15),i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&k.getRuleDefinition("max")&&(r.max=n.maxlength),n.minlength>=0&&k.getRuleDefinition("min")&&(r.min=n.minlength),"number"===n.type&&(p(n.min)&&k.getRuleDefinition("min_value")&&(r.min_value=Number(n.min)),p(n.max)&&k.getRuleDefinition("max_value")&&(r.max_value=Number(n.max))),r):r}(t))):E(r)}function Q(t,e){return t.$scopedSlots.default?t.$scopedSlots.default(e)||[]:t.$slots.default||[]}function K(t){return i(i({},t.flags),{errors:t.errors,classes:t.classes,failedRules:t.failedRules,reset:function(){return t.reset()},validate:function(){for(var e=[],n=0;n0&&this.syncValue(t[0]),[2,X(this)]}))}))},validateSilent:function(){return o(this,void 0,void 0,(function(){var t,e;return a(this,(function(n){switch(n.label){case 0:return this.setFlags({pending:!0}),t=i(i({},this._resolvedRules),this.normalizedRules),Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),[4,P(this.value,t,i(i({name:this.name||this.fieldName},(r=this,o=r.$_veeObserver.refs,{names:{},values:{}},r.fieldDeps.reduce((function(t,e){return o[e]?(t.values[e]=o[e].value,t.names[e]=o[e].name,t):t}),{names:{},values:{}}))),{bails:this.bails,skipIfEmpty:this.skipIfEmpty,isInitial:!this.initialized,customMessages:this.customMessages}))];case 1:return e=n.sent(),this.setFlags({pending:!1,valid:e.valid,invalid:!e.valid}),[2,e]}var r,o}))}))},setErrors:function(t){this.applyResult({errors:t,failedRules:{}})},applyResult:function(t){var e=t.errors,n=t.failedRules,r=t.regenerateMap;this.errors=e,this._regenerateMap=r,this.failedRules=i({},n||{}),this.setFlags({valid:!e.length,passed:!e.length,invalid:!!e.length,failed:!!e.length,validated:!0,changed:this.value!==this.initialValue})},registerField:function(){!function(t){var e=function(t){if(t.vid)return t.vid;if(t.name)return t.name;if(t.id)return t.id;if(t.fieldName)return t.fieldName;return"_vee_"+ ++et}(t),n=t.id;if(!t.isActive||n===e&&t.$_veeObserver.refs[n])return;n!==e&&t.$_veeObserver.refs[n]===t&&t.$_veeObserver.unobserve(n);t.id=e,t.$_veeObserver.observe(t)}(this)}}});var rt=[["pristine","every"],["dirty","some"],["touched","some"],["untouched","every"],["valid","every"],["invalid","some"],["pending","some"],["validated","every"],["changed","some"],["passed","every"],["failed","some"]],it=0;var ot=r.default.extend({name:"ValidationObserver",provide:function(){return{$_veeObserver:this}},inject:{$_veeObserver:{from:"$_veeObserver",default:function(){return this.$vnode.context.$_veeObserver?this.$vnode.context.$_veeObserver:null}}},props:{tag:{type:String,default:"span"},vid:{type:String,default:function(){return"obs_"+it++}},slim:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},data:function(){return{id:"",refs:{},observers:[],errors:{},flags:lt(),fields:{}}},created:function(){var t=this;this.id=this.vid,st(this);var e=w((function(e){var n=e.errors,r=e.flags,i=e.fields;t.errors=n,t.flags=r,t.fields=i}),16);this.$watch(ct,e)},activated:function(){st(this)},deactivated:function(){at(this)},beforeDestroy:function(){at(this)},render:function(t){var e,n=Q(this,i(i({},(e=this).flags),{errors:e.errors,fields:e.fields,validate:e.validate,passes:e.handleSubmit,handleSubmit:e.handleSubmit,reset:e.reset}));return this.slim&&n.length<=1?n[0]:t(this.tag,{on:this.$listeners},n)},methods:{observe:function(t,e){var n;void 0===e&&(e="provider"),"observer"!==e?this.refs=i(i({},this.refs),((n={})[t.id]=t,n)):this.observers.push(t)},unobserve:function(t,e){if(void 0===e&&(e="provider"),"provider"!==e){var n=v(this.observers,(function(e){return e.id===t}));-1!==n&&this.observers.splice(n,1)}else{if(!this.refs[t])return;this.$delete(this.refs,t)}},validate:function(t){var e=(void 0===t?{}:t).silent,n=void 0!==e&&e;return o(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,Promise.all(s(_(this.refs).filter((function(t){return!t.disabled})).map((function(t){return t[n?"validateSilent":"validate"]().then((function(t){return t.valid}))})),this.observers.filter((function(t){return!t.disabled})).map((function(t){return t.validate({silent:n})}))))];case 1:return[2,t.sent().every((function(t){return t}))]}}))}))},handleSubmit:function(t){return o(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.validate()];case 1:return e.sent()&&t?[2,t()]:[2]}}))}))},reset:function(){return s(_(this.refs),this.observers).forEach((function(t){return t.reset()}))},setErrors:function(t){var e=this;Object.keys(t).forEach((function(n){var r=e.refs[n];if(r){var i=t[n]||[];i="string"==typeof i?[i]:i,r.setErrors(i)}})),this.observers.forEach((function(e){e.setErrors(t)}))}}});function at(t){t.$_veeObserver&&t.$_veeObserver.unobserve(t.id,"observer")}function st(t){t.$_veeObserver&&t.$_veeObserver.observe(t,"observer")}function lt(){return i(i({},{untouched:!0,touched:!1,dirty:!1,pristine:!0,valid:!1,invalid:!1,validated:!1,pending:!1,required:!1,changed:!1,passed:!1,failed:!1}),{valid:!0,invalid:!1})}function ct(){for(var t=s(_(this.refs),this.observers),e={},n=lt(),r={},o=t.length,a=0;a=0&&Math.floor(e)===e&&isFinite(t)}function p(t){return o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function f(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===c?JSON.stringify(t,null,2):String(t)}function m(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}var _=Object.prototype.hasOwnProperty;function b(t,e){return _.call(t,e)}function w(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var C=/-(\w)/g,x=w((function(t){return t.replace(C,(function(t,e){return e?e.toUpperCase():""}))})),k=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),S=/\B([A-Z])/g,T=w((function(t){return t.replace(S,"-$1").toLowerCase()}));var O=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function E(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function I(t,e){for(var n in e)t[n]=e[n];return t}function N(t){for(var e={},n=0;n0,Z=Y&&Y.indexOf("edge/")>0,J=(Y&&Y.indexOf("android"),Y&&/iphone|ipad|ipod|ios/.test(Y)||"ios"===V),X=(Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y),Y&&Y.match(/firefox\/(\d+)/)),tt={}.watch,et=!1;if(W)try{var nt={};Object.defineProperty(nt,"passive",{get:function(){et=!0}}),window.addEventListener("test-passive",null,nt)}catch(t){}var rt=function(){return void 0===B&&(B=!W&&!G&&void 0!==t&&(t.process&&"server"===t.process.env.VUE_ENV)),B},it=W&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ot(t){return"function"==typeof t&&/native code/.test(t.toString())}var at,st="undefined"!=typeof Symbol&&ot(Symbol)&&"undefined"!=typeof Reflect&&ot(Reflect.ownKeys);at="undefined"!=typeof Set&&ot(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var lt=A,ct=0,ut=function(){this.id=ct++,this.subs=[]};ut.prototype.addSub=function(t){this.subs.push(t)},ut.prototype.removeSub=function(t){y(this.subs,t)},ut.prototype.depend=function(){ut.target&&ut.target.addDep(this)},ut.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(o&&!b(i,"default"))a=!1;else if(""===a||a===T(t)){var l=zt(String,i.type);(l<0||s0&&(ue((l=t(l,(n||"")+"_"+r))[0])&&ue(u)&&(d[c]=gt(u.text+l[0].text),l.shift()),d.push.apply(d,l)):s(l)?ue(u)?d[c]=gt(u.text+l):""!==l&&d.push(gt(l)):ue(l)&&ue(u)?d[c]=gt(u.text+l.text):(a(e._isVList)&&o(l.tag)&&i(l.key)&&o(n)&&(l.key="__vlist"+n+"_"+r+"__"),d.push(l)));return d}(t):void 0}function ue(t){return o(t)&&o(t.text)&&!1===t.isComment}function de(t,e){if(t){for(var n=Object.create(null),r=st?Reflect.ownKeys(t):Object.keys(t),i=0;i0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&s===n.$key&&!o&&!n.$hasNormal)return n;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=me(e,l,t[l]))}else i={};for(var c in e)c in i||(i[c]=ve(e,c));return t&&Object.isExtensible(t)&&(t._normalized=i),z(i,"$stable",a),z(i,"$key",s),z(i,"$hasNormal",o),i}function me(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:ce(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function ve(t,e){return function(){return t[e]}}function ge(t,e){var n,r,i,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,i=t.length;rdocument.createEvent("Event").timeStamp&&(ln=function(){return cn.now()})}function un(){var t,e;for(sn=ln(),on=!0,tn.sort((function(t,e){return t.id-e.id})),an=0;anan&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);rn||(rn=!0,ee(un))}}(this)},hn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||l(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){Ft(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},hn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},hn.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},hn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:A,set:A};function fn(t,e,n){pn.get=function(){return this[e][n]},pn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,pn)}function mn(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[];t.$parent&&xt(!1);var o=function(o){i.push(o);var a=Mt(o,e,n,t);Tt(r,o,a),o in t||fn(t,"_props",o)};for(var a in e)o(a);xt(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?A:O(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;u(e=t._data="function"==typeof e?function(t,e){ht();try{return t.call(e,e)}catch(t){return Ft(t,e,"data()"),{}}finally{pt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);for(;i--;){var o=n[i];0,r&&b(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&fn(t,"_data",o))}var a;St(e,!0)}(t):St(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=rt();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;0,r||(n[i]=new hn(t,a||A,A,vn)),i in t||gn(t,i,o)}}(t,e.computed),e.watch&&e.watch!==tt&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!d(t)&&t.test(e)}function On(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=Sn(a.componentOptions);s&&!e(s)&&En(n,o,r,i)}}}function En(t,e,n,r){var i=t[e];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),t[e]=null,y(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=wn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=Dt(Cn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ye(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,i=n&&n.context;t.$slots=he(e._renderChildren,i),t.$scopedSlots=r,t._c=function(e,n,r,i){return $e(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return $e(t,e,n,r,i,!0)};var o=n&&n.data;Tt(t,"$attrs",o&&o.attrs||r,null,!0),Tt(t,"$listeners",e._parentListeners||r,null,!0)}(e),Xe(e,"beforeCreate"),function(t){var e=de(t.$options.inject,t);e&&(xt(!1),Object.keys(e).forEach((function(n){Tt(t,n,e[n])})),xt(!0))}(e),mn(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),Xe(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(xn),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Ot,t.prototype.$delete=Et,t.prototype.$watch=function(t,e,n){if(u(e))return bn(this,t,e,n);(n=n||{}).user=!0;var r=new hn(this,t,e,n);if(n.immediate)try{e.call(this,r.value)}catch(t){Ft(t,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(xn),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var i=0,o=t.length;i1?E(n):n;for(var r=E(arguments,1),i='event handler for "'+t+'"',o=0,a=n.length;oparseInt(this.max)&&En(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return $}};Object.defineProperty(t,"config",e),t.util={warn:lt,extend:I,mergeOptions:Dt,defineReactive:Tt},t.set=Ot,t.delete=Et,t.nextTick=ee,t.observable=function(t){return St(t),t},t.options=Object.create(null),L.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,I(t.options.components,Nn),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=E(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=Dt(this.options,t),this}}(t),kn(t),function(t){L.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&u(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(xn),Object.defineProperty(xn.prototype,"$isServer",{get:rt}),Object.defineProperty(xn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(xn,"FunctionalRenderContext",{value:Pe}),xn.version="2.6.11";var An=v("style,class"),Pn=v("input,textarea,option,select,progress"),qn=v("contenteditable,draggable,spellcheck"),jn=v("events,caret,typing,plaintext-only"),Rn=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Dn="http://www.w3.org/1999/xlink",Ln=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Mn=function(t){return Ln(t)?t.slice(6,t.length):""},$n=function(t){return null==t||!1===t};function Un(t){for(var e=t.data,n=t,r=t;o(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=zn(r.data,e));for(;o(n=n.parent);)n&&n.data&&(e=zn(e,n.data));return function(t,e){if(o(t)||o(e))return Fn(t,Bn(e));return""}(e.staticClass,e.class)}function zn(t,e){return{staticClass:Fn(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Fn(t,e){return t?e?t+" "+e:t:e||""}function Bn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,i=t.length;r-1?hr(t,e,n):Rn(e)?$n(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):qn(e)?t.setAttribute(e,function(t,e){return $n(e)||"false"===e?"false":"contenteditable"===t&&jn(e)?e:"true"}(e,n)):Ln(e)?$n(n)?t.removeAttributeNS(Dn,Mn(e)):t.setAttributeNS(Dn,e,n):hr(t,e,n)}function hr(t,e,n){if($n(n))t.removeAttribute(e);else{if(Q&&!K&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var pr={create:ur,update:ur};function fr(t,e){var n=e.elm,r=e.data,a=t.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var s=Un(e),l=n._transitionClasses;o(l)&&(s=Fn(s,Bn(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var mr,vr={create:fr,update:fr};function gr(t,e,n){var r=mr;return function i(){var o=e.apply(null,arguments);null!==o&&br(t,i,n,r)}}var yr=Vt&&!(X&&Number(X[1])<=53);function _r(t,e,n,r){if(yr){var i=sn,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}mr.addEventListener(t,e,et?{capture:n,passive:r}:n)}function br(t,e,n,r){(r||mr).removeEventListener(t,e._wrapper||e,n)}function wr(t,e){if(!i(t.data.on)||!i(e.data.on)){var n=e.data.on||{},r=t.data.on||{};mr=e.elm,function(t){if(o(t.__r)){var e=Q?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}o(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),ae(n,r,_r,br,gr,e.context),mr=void 0}}var Cr,xr={create:wr,update:wr};function kr(t,e){if(!i(t.data.domProps)||!i(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},l=e.data.domProps||{};for(n in o(l.__ob__)&&(l=e.data.domProps=I({},l)),s)n in l||(a[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var c=i(r)?"":String(r);Sr(a,c)&&(a.value=c)}else if("innerHTML"===n&&Gn(a.tagName)&&i(a.innerHTML)){(Cr=Cr||document.createElement("div")).innerHTML=""+r+"";for(var u=Cr.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;u.firstChild;)a.appendChild(u.firstChild)}else if(r!==s[n])try{a[n]=r}catch(t){}}}}function Sr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return m(n)!==m(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Tr={create:kr,update:kr},Or=w((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Er(t){var e=Ir(t.style);return t.staticStyle?I(t.staticStyle,e):e}function Ir(t){return Array.isArray(t)?N(t):"string"==typeof t?Or(t):t}var Nr,Ar=/^--/,Pr=/\s*!important$/,qr=function(t,e,n){if(Ar.test(e))t.style.setProperty(e,n);else if(Pr.test(n))t.style.setProperty(T(e),n.replace(Pr,""),"important");else{var r=Rr(e);if(Array.isArray(n))for(var i=0,o=n.length;i-1?e.split(Mr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Ur(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Mr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function zr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&I(e,Fr(t.name||"v")),I(e,t),e}return"string"==typeof t?Fr(t):void 0}}var Fr=w((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Br=W&&!K,Hr="transition",Wr="transitionend",Gr="animation",Vr="animationend";Br&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Hr="WebkitTransition",Wr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Gr="WebkitAnimation",Vr="webkitAnimationEnd"));var Yr=W?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Qr(t){Yr((function(){Yr(t)}))}function Kr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),$r(t,e))}function Zr(t,e){t._transitionClasses&&y(t._transitionClasses,e),Ur(t,e)}function Jr(t,e,n){var r=ti(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s="transition"===i?Wr:Vr,l=0,c=function(){t.removeEventListener(s,u),n()},u=function(e){e.target===t&&++l>=a&&c()};setTimeout((function(){l0&&(n="transition",u=a,d=o.length):"animation"===e?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(a,c))>0?a>c?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Xr.test(r[Hr+"Property"])}}function ei(t,e){for(;t.length1}function si(t,e){!0!==e.data.show&&ri(e)}var li=function(t){var e,n,r={},l=t.modules,c=t.nodeOps;for(e=0;ef?_(t,i(n[g+1])?null:n[g+1].elm,n,p,g,r):p>g&&w(e,h,f)}(h,v,g,n,u):o(g)?(o(t.text)&&c.setTextContent(h,""),_(h,null,g,0,g.length-1,n)):o(v)?w(v,0,v.length-1):o(t.text)&&c.setTextContent(h,""):t.text!==e.text&&c.setTextContent(h,e.text),o(f)&&o(p=f.hook)&&o(p=p.postpatch)&&p(t,e)}}}function S(t,e,n){if(a(n)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r-1,a.selected!==o&&(a.selected=o);else if(j(pi(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function hi(t,e){return e.every((function(e){return!j(e,t)}))}function pi(t){return"_value"in t?t._value:t.value}function fi(t){t.target.composing=!0}function mi(t){t.target.composing&&(t.target.composing=!1,vi(t.target,"input"))}function vi(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function gi(t){return!t.componentInstance||t.data&&t.data.transition?t:gi(t.componentInstance._vnode)}var yi={model:ci,show:{bind:function(t,e,n){var r=e.value,i=(n=gi(n)).data&&n.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&i?(n.data.show=!0,ri(n,(function(){t.style.display=o}))):t.style.display=r?o:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=gi(n)).data&&n.data.transition?(n.data.show=!0,r?ri(n,(function(){t.style.display=t.__vOriginalDisplay})):ii(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,i){i||(t.style.display=t.__vOriginalDisplay)}}},_i={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function bi(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?bi(He(e.children)):t}function wi(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[x(o)]=i[o];return e}function Ci(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var xi=function(t){return t.tag||Be(t)},ki=function(t){return"show"===t.name},Si={name:"transition",props:_i,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(xi)).length){0;var r=this.mode;0;var i=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return i;var o=bi(i);if(!o)return i;if(this._leaving)return Ci(t,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var l=(o.data||(o.data={})).transition=wi(this),c=this._vnode,u=bi(c);if(o.data.directives&&o.data.directives.some(ki)&&(o.data.show=!0),u&&u.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(o,u)&&!Be(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=I({},l);if("out-in"===r)return this._leaving=!0,se(d,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Ci(t,i);if("in-out"===r){if(Be(o))return c;var h,p=function(){h()};se(l,"afterEnter",p),se(l,"enterCancelled",p),se(d,"delayLeave",(function(t){h=t}))}}return i}}},Ti=I({tag:String,moveClass:String},_i);function Oi(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Ei(t){t.data.newPos=t.elm.getBoundingClientRect()}function Ii(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete Ti.mode;var Ni={Transition:Si,TransitionGroup:{props:Ti,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var i=Ke(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=wi(this),s=0;s-1?Yn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Yn[t]=/HTMLUnknownElement/.test(e.toString())},I(xn.options.directives,yi),I(xn.options.components,Ni),xn.prototype.__patch__=W?li:A,xn.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=vt),Xe(t,"beforeMount"),r=function(){t._update(t._render(),n)},new hn(t,r,A,{before:function(){t._isMounted&&!t._isDestroyed&&Xe(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Xe(t,"mounted")),t}(this,t=t&&W?function(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}(t):void 0,e)},W&&setTimeout((function(){$.devtools&&it&&it.emit("init",xn)}),0),e.default=xn}.call(this,n(27),n(229).setImmediate)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(22),i=n.n(r),o=n(4),a=n.n(o),s=function t(){i()(this,t)};a()(s,"ROUND_ANSWER_DRAW_DURATION",3e3),a()(s,"ROUND_STAGE_CLEAR_DELAY",1500),a()(s,"ROUND_OPTIONS_DRAW_DELAY",4e3),a()(s,"ROUND_OPTION_DRAW_DURATION",500),a()(s,"ROUND_OPTION_DRAW_DELAY",[300,500,700,900]),a()(s,"ROUND_QUESTION_DRAW_DURATION",500),a()(s,"SHOW_NEXT_ROUND_ANIMATION_DURATION",1500),a()(s,"SHOW_NEXT_ROUND_DURATION",1e3),a()(s,"HIDE_NEXT_ROUND_ANIMATION_DURATION",1e3),a()(s,"ROUND_ANSWER_FLASH_DURATION",500),a()(s,"ROUND_TIMER_FAST_FORWARD_DURATION",1e3),a()(s,"DEFAULT_CLEAR_ANIMATION",300),a()(s,"CORRECT_ANSWER_DISPLAY_DURATION",3e3)},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("nav",{staticClass:"navbar navbar-expand-lg homepage-navbar",class:[t.isTransparent?"navbar-error bg-transparent":"navbar-dark bg-light"]},[r("div",{staticClass:"container-fluid"},[r("router-link",{staticClass:"navbar-brand",attrs:{to:"/"}},[r("img",{staticClass:"img-fluid",attrs:{src:t.isTransparent?t.darkLogo:t.lightLogo,width:"150"}})]),t._v(" "),r("button",{staticClass:"navbar-toggler",attrs:{type:"button","data-toggle":"collapse","data-target":"#navbarSupportedContent","aria-controls":"navbarSupportedContent","aria-expanded":"false","aria-label":"Toggle navigation"}},[r("span",{staticClass:"navbar-toggler-icon"},[t.isTransparent?r("img",{staticClass:"img-fluid under-menu",attrs:{src:n(231)}}):t._e()])]),t._v(" "),r("div",{staticClass:"collapse navbar-collapse",attrs:{id:"navbarSupportedContent"}},[r("ul",{staticClass:"navbar-nav mx-auto"},[t._l(t.menus,(function(e){return r("li",{key:e.label,staticClass:"nav-item",class:{active:t.currentRoute==e.path}},[r("a",{staticClass:"nav-link",on:{click:function(n){return t.navClicked(e)}}},[t._v(t._s(e.label))])])})),t._v(" "),r("li",{staticClass:"nav-item dropdown"},[t._m(0),t._v(" "),r("div",{staticClass:"dropdown-menu",attrs:{"aria-labelledby":"navbarDropdown"}},[r("router-link",{staticClass:"dropdown-item",attrs:{to:"/learner",href:"#"}},[r("i",{staticClass:"fa fa-user"}),t._v(" For Learner")]),t._v(" "),r("div",{staticClass:"dropdown-divider"}),t._v(" "),r("router-link",{staticClass:"dropdown-item",attrs:{to:"/corporate",href:"#"}},[r("i",{staticClass:"fa fa-user-plus"}),t._v(" For Corporate")]),t._v(" "),r("div",{staticClass:"dropdown-divider"}),t._v(" "),r("router-link",{staticClass:"dropdown-item",attrs:{to:"/teacher",href:"#"}},[r("i",{staticClass:"fa fa-building"}),t._v(" For Teacher")])],1)])],2),t._v(" "),r("ul",{staticClass:"navbar-nav ml-auto"},[r("li",{staticClass:"nav-item",class:{active:"/login"==t.currentRoute}},[r("a",{staticClass:"nav-link",on:{click:function(e){return t.navClicked({path:"/login"})}}},[t._v("Log in")])]),t._v(" "),r("li",{staticClass:"nav-item"},[r("button",{staticClass:"btn btn-success",attrs:{type:"button"},on:{click:function(e){return t.navClicked({path:"/register"})}}},[t._v("\n Sign Up\n ")])])])])],1)])};r._withStripped=!0;var i=n(61).a,o=n(0),a=Object(o.a)(i,r,[function(){var t=this.$createElement,e=this._self._c||t;return e("a",{staticClass:"nav-link dropdown-toggle",attrs:{href:"#",id:"navbarDropdown",role:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[this._v("\n Offer "),e("i",{staticClass:"fa fa-chevron-down"})])}],!1,null,null,null);a.options.__file="src/js/public/common/components/header.vue";e.a=a.exports},function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return"hide"!=t.loaderState?n("div",{staticClass:"text-center quiz"},[n("p",[t._v(t._s(t.feedbackMessage))]),t._v(" "),"loading"===t.loaderState?n("div",{staticClass:"loader m-auto py-9 null"}):t._e(),t._v(" "),"error"===t.loaderState?n("button",{staticClass:"btn btn-primary mx-auto btn-shadow",on:{click:t.retry}},[t._v("Retry")]):t._e()]):t._e()};r._withStripped=!0;var i={props:["loaderState","errorMessage","loadingMessage"],computed:{feedbackMessage:function(){return"loading"===this.$props.loaderState?this.$props.loadingMessage?this.$props.loadingMessage:"Please wait":"error"===this.$props.loaderState?this.$props.errorMessage?this.$props.errorMessage:"Something went wrong":void 0}},methods:{retry:function(){this.$emit("retry")}}},o=n(0),a=Object(o.a)(i,r,[],!1,null,null,null);a.options.__file="src/js/common/components/loader.vue";e.a=a.exports},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d1)for(var n=1;n-1}function c(t,e){return t.apply(null,e)}var u={arr:function(t){return Array.isArray(t)},obj:function(t){return l(Object.prototype.toString.call(t),"Object")},pth:function(t){return u.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||u.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return u.hex(t)||u.rgb(t)||u.hsl(t)},key:function(t){return!r.hasOwnProperty(t)&&!i.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function d(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function h(t,e){var n=d(t),r=s(u.und(n[0])?1:n[0],.1,100),i=s(u.und(n[1])?100:n[1],.1,100),o=s(u.und(n[2])?10:n[2],.1,100),l=s(u.und(n[3])?0:n[3],.1,100),c=Math.sqrt(i/r),h=o/(2*Math.sqrt(i*r)),p=h<1?c*Math.sqrt(1-h*h):0,f=h<1?(h*c-l)/p:-l+c;function m(t){var n=e?e*t/1e3:t;return n=h<1?Math.exp(-n*h*c)*(1*Math.cos(p*n)+f*Math.sin(p*n)):(1+f*n)*Math.exp(-n*c),0===t||1===t?t:1-n}return e?m:function(){var e=a.springs[t];if(e)return e;for(var n=0,r=0;;)if(1===m(n+=1/6)){if(++r>=16)break}else r=0;var i=n*(1/6)*1e3;return a.springs[t]=i,i}}function p(t){return void 0===t&&(t=10),function(e){return Math.ceil(s(e,1e-6,1)*t)*(1/t)}}var f,m,v=function(){function t(t,e){return 1-3*e+3*t}function e(t,e){return 3*e-6*t}function n(t){return 3*t}function r(r,i,o){return((t(i,o)*r+e(i,o))*r+n(i))*r}function i(r,i,o){return 3*t(i,o)*r*r+2*e(i,o)*r+n(i)}return function(t,e,n,o){if(0<=t&&t<=1&&0<=n&&n<=1){var a=new Float32Array(11);if(t!==e||n!==o)for(var s=0;s<11;++s)a[s]=r(.1*s,t,n);return function(i){return t===e&&n===o||0===i||1===i?i:r(l(i),e,o)}}function l(e){for(var o=0,s=1;10!==s&&a[s]<=e;++s)o+=.1;--s;var l=o+.1*((e-a[s])/(a[s+1]-a[s])),c=i(l,t,n);return c>=.001?function(t,e,n,o){for(var a=0;a<4;++a){var s=i(e,n,o);if(0===s)return e;e-=(r(e,n,o)-t)/s}return e}(e,l,t,n):0===c?l:function(t,e,n,i,o){var a,s,l=0;do{(a=r(s=e+(n-e)/2,i,o)-t)>0?n=s:e=s}while(Math.abs(a)>1e-7&&++l<10);return s}(e,o,o+.1,t,n)}}}(),g=(f={linear:function(){return function(t){return t}}},m={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(t,e){void 0===t&&(t=1),void 0===e&&(e=.5);var n=s(t,1,10),r=s(e,.1,2);return function(t){return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,e){m[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(m).forEach((function(t){var e=m[t];f["easeIn"+t]=e,f["easeOut"+t]=function(t,n){return function(r){return 1-e(t,n)(1-r)}},f["easeInOut"+t]=function(t,n){return function(r){return r<.5?e(t,n)(2*r)/2:1-e(t,n)(-2*r+2)/2}}})),f);function y(t,e){if(u.fnc(t))return t;var n=t.split("(")[0],r=g[n],i=d(t);switch(n){case"spring":return h(t,e);case"cubicBezier":return c(v,i);case"steps":return c(p,i);default:return c(r,i)}}function _(t){try{return document.querySelectorAll(t)}catch(t){return}}function b(t,e){for(var n=t.length,r=arguments.length>=2?arguments[1]:void 0,i=[],o=0;o1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(0==a)e=n=r=s;else{var u=s<.5?s*(1+a):s+a-s*a,d=2*s-u;e=c(d,u,o+1/3),n=c(d,u,o),r=c(d,u,o-1/3)}return"rgba("+255*e+","+255*n+","+255*r+","+l+")"}(t):void 0;var e,n}function E(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return e[1]}function I(t,e){return u.fnc(t)?t(e.target,e.id,e.total):t}function N(t,e){return t.getAttribute(e)}function A(t,e,n){if(x([n,"deg","rad","turn"],E(e)))return e;var r=a.CSS[e+n];if(!u.und(r))return r;var i=document.createElement(t.tagName),o=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;o.appendChild(i),i.style.position="absolute",i.style.width=100+n;var s=100/i.offsetWidth;o.removeChild(i);var l=s*parseFloat(e);return a.CSS[e+n]=l,l}function P(t,e,n){if(e in t.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i=t.style[e]||getComputedStyle(t).getPropertyValue(r)||"0";return n?A(t,i,n):i}}function q(t,e){return u.dom(t)&&!u.inp(t)&&(N(t,e)||u.svg(t)&&t[e])?"attribute":u.dom(t)&&x(o,e)?"transform":u.dom(t)&&"transform"!==e&&P(t,e)?"css":null!=t[e]?"object":void 0}function j(t){if(u.dom(t)){for(var e,n=t.style.transform||"",r=/(\w+)\(([^)]*)\)/g,i=new Map;e=r.exec(n);)i.set(e[1],e[2]);return i}}function R(t,e,n,r){var i=l(e,"scale")?1:0+function(t){return l(t,"translate")||"perspective"===t?"px":l(t,"rotate")||l(t,"skew")?"deg":void 0}(e),o=j(t).get(e)||i;return n&&(n.transforms.list.set(e,o),n.transforms.last=e),r?A(t,o,r):o}function D(t,e,n,r){switch(q(t,e)){case"transform":return R(t,e,r,n);case"css":return P(t,e,n);case"attribute":return N(t,e);default:return t[e]||0}}function L(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var r=E(t)||0,i=parseFloat(e),o=parseFloat(t.replace(n[0],""));switch(n[0][0]){case"+":return i+o+r;case"-":return i-o+r;case"*":return i*o+r}}function M(t,e){if(u.col(t))return O(t);if(/\s/g.test(t))return t;var n=E(t),r=n?t.substr(0,t.length-n.length):t;return e?r+e:r}function $(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function U(t){for(var e,n=t.points,r=0,i=0;i0&&(r+=$(e,o)),e=o}return r}function z(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*N(t,"r")}(t);case"rect":return function(t){return 2*N(t,"width")+2*N(t,"height")}(t);case"line":return function(t){return $({x:N(t,"x1"),y:N(t,"y1")},{x:N(t,"x2"),y:N(t,"y2")})}(t);case"polyline":return U(t);case"polygon":return function(t){var e=t.points;return U(t)+$(e.getItem(e.numberOfItems-1),e.getItem(0))}(t)}}function F(t,e){var n=e||{},r=n.el||function(t){for(var e=t.parentNode;u.svg(e)&&u.svg(e.parentNode);)e=e.parentNode;return e}(t),i=r.getBoundingClientRect(),o=N(r,"viewBox"),a=i.width,s=i.height,l=n.viewBox||(o?o.split(" "):[0,0,a,s]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:a/l[2],h:s/l[3]}}function B(t,e){function n(n){void 0===n&&(n=0);var r=e+n>=1?e+n:0;return t.el.getPointAtLength(r)}var r=F(t.el,t.svg),i=n(),o=n(-1),a=n(1);switch(t.property){case"x":return(i.x-r.x)*r.w;case"y":return(i.y-r.y)*r.h;case"angle":return 180*Math.atan2(a.y-o.y,a.x-o.x)/Math.PI}}function H(t,e){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=M(u.pth(t)?t.totalLength:t,e)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:u.str(t)||e?r.split(n):[]}}function W(t){return b(t?w(u.arr(t)?t.map(C):C(t)):[],(function(t,e,n){return n.indexOf(t)===e}))}function G(t){var e=W(t);return e.map((function(t,n){return{target:t,id:n,total:e.length,transforms:{list:j(t)}}}))}function V(t,e){var n=k(e);if(/^spring/.test(n.easing)&&(n.duration=h(n.easing)),u.arr(t)){var r=t.length;2===r&&!u.obj(t[0])?t={value:t}:u.fnc(e.duration)||(n.duration=e.duration/r)}var i=u.arr(t)?t:[t];return i.map((function(t,n){var r=u.obj(t)&&!u.pth(t)?t:{value:t};return u.und(r.delay)&&(r.delay=n?0:e.delay),u.und(r.endDelay)&&(r.endDelay=n===i.length-1?e.endDelay:0),r})).map((function(t){return T(t,n)}))}function Y(t,e){var n=[],r=e.keyframes;for(var i in r&&(e=T(function(t){for(var e=b(w(t.map((function(t){return Object.keys(t)}))),(function(t){return u.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),n={},r=function(r){var i=e[r];n[i]=t.map((function(t){var e={};for(var n in t)u.key(n)?n==i&&(e.value=t[n]):e[n]=t[n];return e}))},i=0;i-1&&(nt.splice(o,1),n=nt.length)}else i.tick(e);r++}t()}else et=cancelAnimationFrame(et)}return t}();function ot(t){void 0===t&&(t={});var e,n=0,o=0,a=0,l=0,c=null;function u(t){var e=window.Promise&&new Promise((function(t){return c=t}));return t.finished=e,e}var d=function(t){var e=S(r,t),n=S(i,t),o=Y(n,t),a=G(t.targets),s=J(a,o),l=X(s,n),c=tt;return tt++,T(e,{id:c,children:[],animatables:a,animations:s,duration:l.duration,delay:l.delay,endDelay:l.endDelay})}(t);u(d);function h(){var t=d.direction;"alternate"!==t&&(d.direction="normal"!==t?"normal":"reverse"),d.reversed=!d.reversed,e.forEach((function(t){return t.reversed=d.reversed}))}function p(t){return d.reversed?d.duration-t:t}function f(){n=0,o=p(d.currentTime)*(1/ot.speed)}function m(t,e){e&&e.seek(t-e.timelineOffset)}function v(t){for(var e=0,n=d.animations,r=n.length;e2||(_=Math.round(_*f)/f)),m.push(_)}var x=p.length;if(x){g=p[0];for(var k=0;k0&&(d.began=!0,g("begin")),!d.loopBegan&&d.currentTime>0&&(d.loopBegan=!0,g("loopBegin")),y<=i&&0!==d.currentTime&&v(0),(y>=f&&d.currentTime!==r||!r)&&v(r),y>i&&y=r&&(o=0,d.remaining&&!0!==d.remaining&&d.remaining--,d.remaining?(n=a,g("loopComplete"),d.loopBegan=!1,"alternate"===d.direction&&h()):(d.paused=!0,d.completed||(d.completed=!0,g("loopComplete"),g("complete"),!d.passThrough&&"Promise"in window&&(c(),u(d)))))}return d.reset=function(){var t=d.direction;d.passThrough=!1,d.currentTime=0,d.progress=0,d.paused=!0,d.began=!1,d.loopBegan=!1,d.changeBegan=!1,d.completed=!1,d.changeCompleted=!1,d.reversePlayback=!1,d.reversed="reverse"===t,d.remaining=d.loop,e=d.children;for(var n=l=e.length;n--;)d.children[n].reset();(d.reversed&&!0!==d.loop||"alternate"===t&&1===d.loop)&&d.remaining++,v(d.reversed?d.duration:0)},d.set=function(t,e){return Z(t,e),d},d.tick=function(t){a=t,n||(n=a),y((a+(o-n))*ot.speed)},d.seek=function(t){y(p(t))},d.pause=function(){d.paused=!0,f()},d.play=function(){d.paused&&(d.completed&&d.reset(),d.paused=!1,nt.push(d),f(),et||it())},d.reverse=function(){h(),d.completed=!d.reversed,f()},d.restart=function(){d.reset(),d.play()},d.reset(),d.autoplay&&d.play(),d}function at(t,e){for(var n=e.length;n--;)x(t,e[n].animatable.target)&&e.splice(n,1)}"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){document.hidden?(nt.forEach((function(t){return t.pause()})),rt=nt.slice(0),ot.running=nt=[]):rt.forEach((function(t){return t.play()}))})),ot.version="3.2.0",ot.speed=1,ot.running=nt,ot.remove=function(t){for(var e=W(t),n=nt.length;n--;){var r=nt[n],i=r.animations,o=r.children;at(e,i);for(var a=o.length;a--;){var s=o[a],l=s.animations;at(e,l),l.length||s.children.length||o.splice(a,1)}i.length||o.length||r.pause()}},ot.get=D,ot.set=Z,ot.convertPx=A,ot.path=function(t,e){var n=u.str(t)?_(t)[0]:t,r=e||100;return function(t){return{property:t,el:n,svg:F(n),totalLength:z(n)*(r/100)}}},ot.setDashoffset=function(t){var e=z(t);return t.setAttribute("stroke-dasharray",e),e},ot.stagger=function(t,e){void 0===e&&(e={});var n=e.direction||"normal",r=e.easing?y(e.easing):null,i=e.grid,o=e.axis,a=e.from||0,s="first"===a,l="center"===a,c="last"===a,d=u.arr(t),h=d?parseFloat(t[0]):parseFloat(t),p=d?parseFloat(t[1]):0,f=E(d?t[1]:t)||0,m=e.start||0+(d?h:0),v=[],g=0;return function(t,e,u){if(s&&(a=0),l&&(a=(u-1)/2),c&&(a=u-1),!v.length){for(var y=0;y-1&&nt.splice(o,1);for(var l=0;l\nimport { SkeletonStyle } from './skeleton-theme.vue';\n\nconst isEmptyVNode = (children) => {\n if (!children) return true;\n\n const [firstNode] = children;\n let str = firstNode.text;\n if (str) {\n // remove all line-break and space character\n str = str.replace(/(\\n|\\r\\n|\\s)/g, '');\n }\n\n return typeof firstNode.tag === 'undefined' && !str;\n};\n\nexport default {\n name: 'PuSkeleton',\n inject: {\n themeStyle: {\n from: '_themeStyle',\n default: SkeletonStyle\n },\n theme: {\n from: '_skeletonTheme',\n default: ({})\n }\n },\n props: {\n prefix: {\n type: String,\n default: 'pu'\n },\n count: {\n type: Number,\n default: 1\n },\n duration: {\n type: Number,\n default: 1.5\n },\n tag: {\n type: String,\n default: 'span'\n },\n width: [String, Number],\n height: [String, Number],\n circle: Boolean,\n loading: undefined\n },\n computed: {\n isLoading() {\n return typeof this.theme.loading !== 'undefined' ? this.theme.loading : this.loading;\n }\n },\n render(h) {\n const {\n width, height, duration, prefix, circle, count, tag, isLoading\n } = this;\n const classes = [`${prefix}-skeleton`];\n const elements = [];\n const styles = { ...this.themeStyle };\n\n if (duration) {\n styles.animation = `SkeletonLoading ${duration}s ease-in-out infinite`;\n } else {\n styles.backgroundImage = '';\n }\n if (width) styles.width = width;\n if (height) styles.height = height;\n if (circle) styles.borderRadius = '50%';\n\n for (let i = 0; i < count; i += 1) {\n elements.push(\n \n ‌\n \n );\n }\n\n const showLoading = typeof isLoading !== 'undefined' ? isLoading : isEmptyVNode(this.$slots.default);\n if (tag) {\n return h(tag, !showLoading ? this.$slots.default : elements);\n }\n return (!showLoading ? this.$slots.default : { elements });\n }\n};\n<\/script>\n\n\n"]},media:void 0})}),c,void 0,void 0,void 0,!1,(function(t){return(t,e)=>function(t,e){const n=u?e.media||"default":t,r=h[n]||(h[n]={ids:new Set,styles:[]});if(!r.ids.has(t)){r.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",e.media&&r.element.setAttribute("media",e.media),void 0===d&&(d=document.head||document.getElementsByTagName("head")[0]),d.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(n),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const t=r.ids.size-1,e=document.createTextNode(n),i=r.element.childNodes;i[t]&&r.element.removeChild(i[t]),i.length?r.element.insertBefore(e,i[t]):r.element.appendChild(e)}}}(t,e)}),void 0,void 0)},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return yi})),n.d(e,"b",(function(){return pi})),n.d(e,"c",(function(){return ai})),n.d(e,"d",(function(){return bi})),n.d(e,"e",(function(){return li})),n.d(e,"f",(function(){return ci}));var r=n(11),i=n(136),o=n(2),a=n(97);const s="@firebase/database"; /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ let l=""; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class c{constructor(t){this.domStorage_=t,this.prefix_="firebase:"}set(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),Object(o.x)(e))}get(t){const e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:Object(o.r)(e)}remove(t){this.domStorage_.removeItem(this.prefixedName_(t))}prefixedName_(t){return this.prefix_+t}toString(){return this.domStorage_.toString()}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class u{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e}get(t){return Object(o.g)(this.cache_,t)?this.cache_[t]:null}remove(t){delete this.cache_[t]}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const d=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){const e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new c(e)}}catch(t){}return new u},h=d("localStorage"),p=d("sessionStorage"),f=new a.b("@firebase/database"),m=function(){let t=1;return function(){return t++}}(),v=function(t){const e=Object(o.w)(t),n=new o.b;n.update(e);const r=n.digest();return o.e.encodeByteArray(r)},g=function(...t){let e="";for(let n=0;nn?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};function j(t,e){for(const n in t)t.hasOwnProperty(n)&&e(n,t[n])}const R=function(t){Object(o.c)(!T(t),"Invalid JSON number");let e,n,r,i,a;0===t?(n=0,r=0,e=1/t==-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),n=i+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074))));const s=[];for(a=52;a;a-=1)s.push(r%2?1:0),r=Math.floor(r/2);for(a=11;a;a-=1)s.push(n%2?1:0),n=Math.floor(n/2);s.push(e?1:0),s.reverse();const l=s.join("");let c="";for(a=0;a<64;a+=8){let t=parseInt(l.substr(a,8),2).toString(16);1===t.length&&(t="0"+t),c+=t}return c.toLowerCase()};const D=new RegExp("^-?(0*)\\d{1,10}$"),L=function(t){if(D.test(t)){const e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},M=function(t){try{t()}catch(t){setTimeout(()=>{const e=t.stack||"";throw S("Exception was thrown by user callback.",e),t},Math.floor(0))}},$=function(t,e){const n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n}; /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class U{constructor(t,e){this.appName_=t,this.appCheckProvider=e,this.appCheck=null==e?void 0:e.getImmediate({optional:!0}),this.appCheck||null==e||e.get().then(t=>this.appCheck=t)}getToken(t){return this.appCheck?this.appCheck.getToken(t):new Promise((e,n)=>{setTimeout(()=>{this.appCheck?this.getToken(t).then(e,n):e(null)},0)})}addTokenChangeListener(t){var e;null===(e=this.appCheckProvider)||void 0===e||e.get().then(e=>e.addTokenListener(t))}notifyForInvalidToken(){S(`Provided AppCheck credentials for the app named "${this.appName_}" are invalid. This usually indicates your app was not initialized correctly.`)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class z{constructor(t,e,n){this.appName_=t,this.firebaseOptions_=e,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit(t=>this.auth_=t)}getToken(t){return this.auth_?this.auth_.getToken(t).catch(t=>t&&"auth/token-not-initialized"===t.code?(w("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)):new Promise((e,n)=>{setTimeout(()=>{this.auth_?this.getToken(t).then(e,n):e(null)},0)})}addTokenChangeListener(t){this.auth_?this.auth_.addAuthTokenListener(t):this.authProvider_.get().then(e=>e.addAuthTokenListener(t))}removeTokenChangeListener(t){this.authProvider_.get().then(e=>e.removeAuthTokenListener(t))}notifyForInvalidToken(){let t='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',S(t)}}class F{constructor(t){this.accessToken=t}getToken(t){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(t){t(this.accessToken)}removeTokenChangeListener(t){}notifyForInvalidToken(){}}F.OWNER="owner"; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const B=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class H{constructor(t,e,n,r,i=!1,o="",a=!1){this.secure=e,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this._host=t.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=h.get("host:"+t)||this._host}isCacheableHost(){return"s-"===this.internalHost.substr(0,2)}isCustomHost(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain}get host(){return this._host}set host(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&h.set("host:"+this._host,this.internalHost))}toString(){let t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t}toURLString(){const t=this.secure?"https://":"http://",e=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return`${t}${this.host}/${e}`}}function W(t,e,n){let r;if(Object(o.c)("string"==typeof e,"typeof type must == string"),Object(o.c)("object"==typeof n,"typeof params must == object"),"websocket"===e)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else{if("long_polling"!==e)throw new Error("Unknown connection type: "+e);r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?"}(function(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams})(t)&&(n.ns=t.namespace);const i=[];return j(n,(t,e)=>{i.push(t+"="+e)}),r+i.join("&")} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class G{constructor(){this.counters_={}}incrementCounter(t,e=1){Object(o.g)(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e}get(){return Object(o.i)(this.counters_)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const V={},Y={};function Q(t){const e=t.toString();return V[e]||(V[e]=new G),V[e]} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class K{constructor(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse{this.onMessage_(t[e])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Z{constructor(t,e,n,r,i,o,a){this.connId=t,this.repoInfo=e,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.transportSessionId=o,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=C(t),this.stats_=Q(e),this.urlFn=t=>(this.appCheckToken&&(t.ac=this.appCheckToken),W(e,"long_polling",t))}open(t,e){this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new K(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(3e4)),function(t){if(Object(o.o)()||"complete"===document.readyState)t();else{let e=!1;const n=function(){document.body?e||(e=!0,t()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}(()=>{if(this.isClosed_)return;this.scriptTagHolder=new J((...t)=>{const[e,n,r,i,o]=t;if(this.incrementIncomingBytes_(t),this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,"start"===e)this.id=n,this.password=r;else{if("close"!==e)throw new Error("Unrecognized command received: "+e);n?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(n,()=>{this.onClosed_()})):this.onClosed_()}},(...t)=>{const[e,n]=t;this.incrementIncomingBytes_(t),this.myPacketOrderer.handleResponse(e,n)},()=>{this.onClosed_()},this.urlFn);const t={start:"t"};t.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=this.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",this.transportSessionId&&(t.s=this.transportSessionId),this.lastSessionId&&(t.ls=this.lastSessionId),this.applicationId&&(t.p=this.applicationId),this.appCheckToken&&(t.ac=this.appCheckToken),"undefined"!=typeof location&&location.hostname&&B.test(location.hostname)&&(t.r="f");const e=this.urlFn(t);this.log_("Connecting via long-poll to "+e),this.scriptTagHolder.addTag(e,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){Z.forceAllow_=!0}static forceDisallow(){Z.forceDisallow_=!0}static isAvailable(){return!Object(o.o)()&&(!!Z.forceAllow_||!(Z.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI))}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(t){const e=Object(o.x)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);const n=Object(o.f)(e),r=q(n,1840);for(let t=0;tdocument.domain="'+document.domain+'";<\/script>'}const r=""+n+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(r),this.myIFrame.doc.close()}catch(t){w("frame writing exception"),t.stack&&w(t.stack),w(t)}}}static createIFrame_(){const t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||w("No IE domain setting required")}catch(e){const n=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(()=>{null!==this.myIFrame&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const t=this.onDisconnect;t&&(this.onDisconnect=null,t())}startLongPoll(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;let e=this.urlFn(t),n="",r=0;for(;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;{const t=this.pendingSegs.shift();n=n+"&seg"+r+"="+t.seg+"&ts"+r+"="+t.ts+"&d"+r+"="+t.d,r++}}return e+=n,this.addLongPollTag_(e,this.currentSerial),!0}return!1}enqueueSegment(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(t,e){this.outstandingRequests.add(e);const n=()=>{this.outstandingRequests.delete(e),this.newRequest_()},r=setTimeout(n,Math.floor(25e3));this.addTag(t,()=>{clearTimeout(r),n()})}addTag(t,e){Object(o.o)()?this.doNodeLongPoll(t,e):setTimeout(()=>{try{if(!this.sendNewPolls)return;const n=this.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=t,n.onload=n.onreadystatechange=function(){const t=n.readyState;t&&"loaded"!==t&&"complete"!==t||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),e())},n.onerror=()=>{w("Long-poll script failed to load: "+t),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch(t){}},Math.floor(1))}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let X=null;"undefined"!=typeof MozWebSocket?X=MozWebSocket:"undefined"!=typeof WebSocket&&(X=WebSocket);class tt{constructor(t,e,n,r,i,o,a){this.connId=t,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=C(this.connId),this.stats_=Q(e),this.connURL=tt.connectionURL_(e,o,a,r),this.nodeAdmin=e.nodeAdmin}static connectionURL_(t,e,n,r){const i={v:"5"};return!Object(o.o)()&&"undefined"!=typeof location&&location.hostname&&B.test(location.hostname)&&(i.r="f"),e&&(i.s=e),n&&(i.ls=n),r&&(i.ac=r),W(t,"websocket",i)}open(e,n){this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,h.set("previous_websocket_failure",!0);try{if(Object(o.o)()){const e=this.nodeAdmin?"AdminNode":"Node",n={headers:{"User-Agent":`Firebase/5/${l}/${t.platform}/${e}`,"X-Firebase-GMPID":this.applicationId||""}};this.authToken&&(n.headers.Authorization="Bearer "+this.authToken),this.appCheckToken&&(n.headers["X-Firebase-AppCheck"]=this.appCheckToken);const r=t.env,i=0===this.connURL.indexOf("wss://")?r.HTTPS_PROXY||r.https_proxy:r.HTTP_PROXY||r.http_proxy;i&&(n.proxy={origin:i}),this.mySock=new X(this.connURL,[],n)}else{const t={headers:{"X-Firebase-GMPID":this.applicationId||"","X-Firebase-AppCheck":this.appCheckToken||""}};this.mySock=new X(this.connURL,[],t)}}catch(t){this.log_("Error instantiating WebSocket.");const e=t.message||t.data;return e&&this.log_(e),void this.onClosed_()}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=t=>{this.handleIncomingFrame(t)},this.mySock.onerror=t=>{this.log_("WebSocket error. Closing connection.");const e=t.message||t.data;e&&this.log_(e),this.onClosed_()}}start(){}static forceDisallow(){tt.forceDisallow_=!0}static isAvailable(){let t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){const e=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(e);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==X&&!tt.forceDisallow_}static previouslyFailed(){return h.isInMemoryStorage||!0===h.get("previous_websocket_failure")}markConnectionHealthy(){h.remove("previous_websocket_failure")}appendFrame_(t){if(this.frames.push(t),this.frames.length===this.totalFrames){const t=this.frames.join("");this.frames=null;const e=Object(o.r)(t);this.onMessage(e)}}handleNewFrameCount_(t){this.totalFrames=t,this.frames=[]}extractFrameCount_(t){if(Object(o.c)(null===this.frames,"We already have a frame buffer"),t.length<=6){const e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t}handleIncomingFrame(t){if(null===this.mySock)return;const e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{const t=this.extractFrameCount_(e);null!==t&&this.appendFrame_(t)}}send(t){this.resetKeepAlive();const e=Object(o.x)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);const n=q(e,16384);n.length>1&&this.sendString_(String(n.length));for(let t=0;t{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(45e3))}sendString_(t){try{this.mySock.send(t)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}tt.responsesRequiredToBeHealthy=2,tt.healthyTimeout=3e4; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class et{constructor(t){this.initTransports_(t)}static get ALL_TRANSPORTS(){return[Z,tt]}initTransports_(t){const e=tt&&tt.isAvailable();let n=e&&!tt.previouslyFailed();if(t.webSocketOnly&&(e||S("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)this.transports_=[tt];else{const t=this.transports_=[];for(const e of et.ALL_TRANSPORTS)e&&e.isAvailable()&&t.push(e)}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class nt{constructor(t,e,n,r,i,o,a,s,l,c){this.id=t,this.repoInfo_=e,this.applicationId_=n,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=s,this.onKill_=l,this.lastSessionId=c,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=C("c:"+this.id+":"),this.transportManager_=new et(e),this.log_("Connection created"),this.start_()}start_(){const t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;const e=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(e,n)},Math.floor(0));const r=t.healthyTimeout||0;r>0&&(this.healthyTimeout_=$(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>102400?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>10240?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(r)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(t){return e=>{t===this.conn_?this.onConnectionLost_(e):t===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(t){return e=>{2!==this.state_&&(t===this.rx_?this.onPrimaryMessageReceived_(e):t===this.secondaryConn_?this.onSecondaryMessageReceived_(e):this.log_("message on old connection"))}}sendRequest(t){const e={t:"d",d:t};this.sendData_(e)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(t){if("t"in t){const e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(t){const e=A("t",t),n=A("d",t);if("c"===e)this.onSecondaryControl_(n);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(t){const e=A("t",t),n=A("d",t);"c"===e?this.onControl_(n):"d"===e&&this.onDataMessage_(n)}onDataMessage_(t){this.onPrimaryResponse_(),this.onMessage_(t)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(t){const e=A("t",t);if("d"in t){const n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let t=0;t{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(6e4))}onReset_(t){this.log_("Reset packet received. New host: "+t),this.repoInfo_.host=t,1===this.state_?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(t,e){this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):$(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))}sendPingOnPrimaryIfNecessary_(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))}onSecondaryConnectionLost_(){const t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()}onConnectionLost_(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(h.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()}onConnectionShutdown_(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)}close(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class rt{put(t,e,n,r){}merge(t,e,n,r){}refreshAuthToken(t){}refreshAppCheckToken(t){}onDisconnectPut(t,e,n){}onDisconnectMerge(t,e,n){}onDisconnectCancel(t,e){}reportStats(t){}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class it{constructor(t){this.allowedEvents_=t,this.listeners_={},Object(o.c)(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}trigger(t,...e){if(Array.isArray(this.listeners_[t])){const n=[...this.listeners_[t]];for(let t=0;te===t),"Unknown event: "+t)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ot extends it{constructor(){super(["online"]),this.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||Object(o.n)()||(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}static getInstance(){return new ot}getInitialEvent(t){return Object(o.c)("online"===t,"Unknown event type: "+t),[this.online_]}currentlyOnline(){return this.online_}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class at{constructor(t,e){if(void 0===e){this.pieces_=t.split("/");let e=0;for(let t=0;t0&&(this.pieces_[e]=this.pieces_[t],e++);this.pieces_.length=e,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}toString(){let t="";for(let e=this.pieceNum_;e=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function ct(t){return t.pieces_.length-t.pieceNum_}function ut(t){let e=t.pieceNum_;return e=t.pieces_.length)return null;const e=[];for(let n=t.pieceNum_;n0&&n.push(t[e])}return new at(n,0)}function mt(t){return t.pieceNum_>=t.pieces_.length}function vt(t,e){const n=lt(t),r=lt(e);if(null===n)return e;if(n===r)return vt(ut(t),ut(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function gt(t,e){const n=ht(t,0),r=ht(e,0);for(let t=0;tct(e))return!1;for(;n768)throw new Error(t.errorPrefix_+"has a key path longer than 768 bytes ("+t.byteLength_+").");if(t.parts_.length>32)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+Ct(t))}function Ct(t){return 0===t.parts_.length?"":"in property '"+t.parts_.join(".")+"'"} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class xt extends it{constructor(){let t,e;super(["visible"]),"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(e="visibilitychange",t="hidden"):void 0!==document.mozHidden?(e="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(e="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(e="webkitvisibilitychange",t="webkitHidden")),this.visible_=!0,e&&document.addEventListener(e,()=>{const e=!document[t];e!==this.visible_&&(this.visible_=e,this.trigger("visible",e))},!1)}static getInstance(){return new xt}getInitialEvent(t){return Object(o.c)("visible"===t,"Unknown event type: "+t),[this.visible_]}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class kt extends rt{constructor(t,e,n,r,i,a,s,l){if(super(),this.repoInfo_=t,this.applicationId_=e,this.onDataUpdate_=n,this.onConnectStatus_=r,this.onServerInfoUpdate_=i,this.authTokenProvider_=a,this.appCheckTokenProvider_=s,this.authOverride_=l,this.id=kt.nextPersistentConnectionId_++,this.log_=C("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=1e3,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,l&&!Object(o.o)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");xt.getInstance().on("visible",this.onVisible_,this),-1===t.host.indexOf("fblocal")&&ot.getInstance().on("online",this.onOnline_,this)}sendRequest(t,e,n){const r=++this.requestNumber_,i={r:r,a:t,b:e};this.log_(Object(o.x)(i)),Object(o.c)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)}get(t){this.initConnection_();const e=new o.a,n={p:t._path.toString(),q:t._queryObject},r={action:"g",request:n,onComplete:t=>{const r=t.d;"ok"===t.s?(this.onDataUpdate_(n.p,r,!1,null),e.resolve(r)):e.reject(r)}};this.outstandingGets_.push(r),this.outstandingGetCount_++;const i=this.outstandingGets_.length-1;return this.connected_||setTimeout(()=>{const t=this.outstandingGets_[i];void 0!==t&&r===t&&(delete this.outstandingGets_[i],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),this.log_("get "+i+" timed out on connection"),e.reject(new Error("Client is offline.")))},3e3),this.connected_&&this.sendGet_(i),e.promise}listen(t,e,n,r){this.initConnection_();const i=t._queryIdentifier,a=t._path.toString();this.log_("Listen called for "+a+" "+i),this.listens.has(a)||this.listens.set(a,new Map),Object(o.c)(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),Object(o.c)(!this.listens.get(a).has(i),"listen() called twice for same path/queryId.");const s={onComplete:r,hashFn:e,query:t,tag:n};this.listens.get(a).set(i,s),this.connected_&&this.sendListen_(s)}sendGet_(t){const e=this.outstandingGets_[t];this.sendRequest("g",e.request,n=>{delete this.outstandingGets_[t],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),e.onComplete&&e.onComplete(n)})}sendListen_(t){const e=t.query,n=e._path.toString(),r=e._queryIdentifier;this.log_("Listen on "+n+" for "+r);const i={p:n};t.tag&&(i.q=e._queryObject,i.t=t.tag),i.h=t.hashFn(),this.sendRequest("q",i,i=>{const o=i.d,a=i.s;kt.warnOnListenWarnings_(o,e);(this.listens.get(n)&&this.listens.get(n).get(r))===t&&(this.log_("listen response",i),"ok"!==a&&this.removeListen_(n,r),t.onComplete&&t.onComplete(a,o))})}static warnOnListenWarnings_(t,e){if(t&&"object"==typeof t&&Object(o.g)(t,"w")){const n=Object(o.u)(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const t='".indexOn": "'+e._queryParams.getIndex().toString()+'"',n=e._path.toString();S(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${t} at `+n+" to your security rules for better performance.")}}}refreshAuthToken(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(t)}reduceReconnectDelayIfAdminCredential_(t){(t&&40===t.length||Object(o.l)(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(t){this.appCheckToken_=t,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const t=this.authToken_,e=Object(o.q)(t)?"auth":"gauth",n={cred:t};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(e,n,e=>{const n=e.s,r=e.d||"error";this.authToken_===t&&("ok"===n?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,r))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},t=>{const e=t.s,n=t.d||"error";"ok"===e?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(e,n)})}unlisten(t,e){const n=t._path.toString(),r=t._queryIdentifier;this.log_("Unlisten called for "+n+" "+r),Object(o.c)(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t._queryObject,e)}sendUnlisten_(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);const i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)}onDisconnectPut(t,e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})}onDisconnectMerge(t,e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})}onDisconnectCancel(t,e){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})}sendOnDisconnect_(t,e,n,r){const i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,t=>{r&&setTimeout(()=>{r(t.s,t.d)},Math.floor(0))})}put(t,e,n,r){this.putInternal("p",t,e,n,r)}merge(t,e,n,r){this.putInternal("m",t,e,n,r)}putInternal(t,e,n,r,i){this.initConnection_();const o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++;const a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+e)}sendPut_(t){const e=this.outstandingPuts_[t].action,n=this.outstandingPuts_[t].request,r=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(e,n,n=>{this.log_(e+" response",n),delete this.outstandingPuts_[t],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),r&&r(n.s,n.d)})}reportStats(t){if(this.connected_){const e={c:t};this.log_("reportStats",e),this.sendRequest("s",e,t=>{if("ok"!==t.s){const e=t.d;this.log_("reportStats","Error sending stats: "+e)}})}}onDataMessage_(t){if("r"in t){this.log_("from server: "+Object(o.x)(t));const e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}}onDataPush_(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"apc"===t?this.onAppCheckRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):x("Unrecognized action received from server: "+Object(o.x)(t)+"\nAre you using the latest client?")}onReady_(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(t){Object(o.c)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(t))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=t}onOnline_(t){t?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const t=(new Date).getTime()-this.lastConnectionAttemptTime_;let e=Math.max(0,this.reconnectDelay_-t);e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const t=this.onDataMessage_.bind(this),e=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+kt.nextConnectionId_++,i=this.lastSessionId;let a=!1,s=null;const l=function(){s?s.close():(a=!0,n())},c=function(t){Object(o.c)(s,"sendRequest call when we're not connected not allowed."),s.sendRequest(t)};this.realtime_={close:l,sendRequest:c};const u=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[o,l]=await Promise.all([this.authTokenProvider_.getToken(u),this.appCheckTokenProvider_.getToken(u)]);a?w("getToken() completed but was canceled"):(w("getToken() completed. Creating connection."),this.authToken_=o&&o.accessToken,this.appCheckToken_=l&&l.token,s=new nt(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,e,n,t=>{S(t+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")},i))}catch(t){this.log_("Failed to get token: "+t),a||(this.repoInfo_.nodeAdmin&&S(t),l())}}}interrupt(t){w("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(t){w("Resuming connection for reason: "+t),delete this.interruptReasons_[t],Object(o.m)(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(t){const e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})}cancelSentTransactions_(){for(let t=0;tP(t)).join("$"):"default";const r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")}removeListen_(t,e){const n=new at(t).toString();let r;if(this.listens.has(n)){const t=this.listens.get(n);r=t.get(e),t.delete(e),0===t.size&&this.listens.delete(n)}else r=void 0;return r}onAuthRevoked_(t,e){w("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(t,e){w("App check token revoked: "+t+"/"+e),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const t of this.listens.values())for(const e of t.values())this.sendListen_(e);for(let t=0;t0}peek(){if(0===this.nodeStack_.length)return null;const t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}}}class At{constructor(t,e,n,r,i){this.key=t,this.value=e,this.color=null!=n?n:At.RED,this.left=null!=r?r:Pt.EMPTY_NODE,this.right=null!=i?i:Pt.EMPTY_NODE}copy(t,e,n,r,i){return new At(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let r=this;const i=n(t,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return Pt.EMPTY_NODE;let t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),t=t.copy(null,null,null,t.left.removeMin_(),null),t.fixUp_()}remove(t,e){let n,r;if(n=this,e(t,n.key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return Pt.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,e))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t}moveRedLeft_(){let t=this.colorFlip_();return t.right.left.isRed_()&&(t=t.copy(null,null,null,null,t.right.rotateRight_()),t=t.rotateLeft_(),t=t.colorFlip_()),t}moveRedRight_(){let t=this.colorFlip_();return t.left.left.isRed_()&&(t=t.rotateRight_(),t=t.colorFlip_()),t}rotateLeft_(){const t=this.copy(null,null,At.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight_(){const t=this.copy(null,null,At.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip_(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth_(){const t=this.check_();return Math.pow(2,t)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)}}At.RED=!0,At.BLACK=!1;class Pt{constructor(t,e=Pt.EMPTY_NODE){this.comparator_=t,this.root_=e}insert(t,e){return new Pt(this.comparator_,this.root_.insert(t,e,this.comparator_).copy(null,null,At.BLACK,null,null))}remove(t){return new Pt(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,At.BLACK,null,null))}get(t){let e,n=this.root_;for(;!n.isEmpty();){if(e=this.comparator_(t,n.key),0===e)return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null}getPredecessorKey(t){let e,n=this.root_,r=null;for(;!n.isEmpty();){if(e=this.comparator_(t,n.key),0===e){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(t){return this.root_.inorderTraversal(t)}reverseTraversal(t){return this.root_.reverseTraversal(t)}getIterator(t){return new Nt(this.root_,null,this.comparator_,!1,t)}getIteratorFrom(t,e){return new Nt(this.root_,t,this.comparator_,!1,e)}getReverseIteratorFrom(t,e){return new Nt(this.root_,t,this.comparator_,!0,e)}getReverseIterator(t){return new Nt(this.root_,null,this.comparator_,!0,t)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function qt(t,e){return I(t.name,e.name)}function jt(t,e){return I(t,e)} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Rt;Pt.EMPTY_NODE=new class{copy(t,e,n,r,i){return this}insert(t,e,n){return new At(t,e,null)}remove(t,e){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}};const Dt=function(t){return"number"==typeof t?"number:"+R(t):"string:"+t},Lt=function(t){if(t.isLeafNode()){const e=t.val();Object(o.c)("string"==typeof e||"number"==typeof e||"object"==typeof e&&Object(o.g)(e,".sv"),"Priority must be a string or number.")}else Object(o.c)(t===Rt||t.isEmpty(),"priority of unexpected type.");Object(o.c)(t===Rt||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")}; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ let Mt,$t,Ut;class zt{constructor(t,e=zt.__childrenNodeConstructor.EMPTY_NODE){this.value_=t,this.priorityNode_=e,this.lazyHash_=null,Object(o.c)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Lt(this.priorityNode_)}static set __childrenNodeConstructor(t){Mt=t}static get __childrenNodeConstructor(){return Mt}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(t){return new zt(this.value_,t)}getImmediateChild(t){return".priority"===t?this.priorityNode_:zt.__childrenNodeConstructor.EMPTY_NODE}getChild(t){return mt(t)?this:".priority"===lt(t)?this.priorityNode_:zt.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(t,e){return null}updateImmediateChild(t,e){return".priority"===t?this.updatePriority(e):e.isEmpty()&&".priority"!==t?this:zt.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,e).updatePriority(this.priorityNode_)}updateChild(t,e){const n=lt(t);return null===n?e:e.isEmpty()&&".priority"!==n?this:(Object(o.c)(".priority"!==n||1===ct(t),".priority must be the last token in a path"),this.updateImmediateChild(n,zt.__childrenNodeConstructor.EMPTY_NODE.updateChild(ut(t),e)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(t,e){return!1}val(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(null===this.lazyHash_){let t="";this.priorityNode_.isEmpty()||(t+="priority:"+Dt(this.priorityNode_.val())+":");const e=typeof this.value_;t+=e+":",t+="number"===e?R(this.value_):this.value_,this.lazyHash_=v(t)}return this.lazyHash_}getValue(){return this.value_}compareTo(t){return t===zt.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof zt.__childrenNodeConstructor?-1:(Object(o.c)(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))}compareToLeafNode_(t){const e=typeof t.value_,n=typeof this.value_,r=zt.VALUE_TYPE_ORDER.indexOf(e),i=zt.VALUE_TYPE_ORDER.indexOf(n);return Object(o.c)(r>=0,"Unknown leaf type: "+e),Object(o.c)(i>=0,"Unknown leaf type: "+n),r===i?"object"===n?0:this.value_{const i=Object(o.u)(this.indexSet_,r);if(Object(o.c)(i,"Missing index implementation for "+r),n===Vt){if(i.isDefinedOn(t.node)){const n=[],r=e.getIterator(St.Wrap);let o=r.getNext();for(;o;)o.name!==t.name&&n.push(o),o=r.getNext();return n.push(t),Wt(n,i.getCompare())}return Vt}{const r=e.get(t.name);let i=n;return r&&(i=i.remove(new St(t.name,r))),i.insert(t,t.node)}});return new Yt(n,this.indexSet_)}removeFromIndexes(t,e){const n=Object(o.s)(this.indexes_,n=>{if(n===Vt)return n;{const r=e.get(t.name);return r?n.remove(new St(t.name,r)):n}});return new Yt(n,this.indexSet_)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Qt;class Kt{constructor(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Lt(this.priorityNode_),this.children_.isEmpty()&&Object(o.c)(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}static get EMPTY_NODE(){return Qt||(Qt=new Kt(new Pt(jt),null,Yt.Default))}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Qt}updatePriority(t){return this.children_.isEmpty()?this:new Kt(this.children_,t,this.indexMap_)}getImmediateChild(t){if(".priority"===t)return this.getPriority();{const e=this.children_.get(t);return null===e?Qt:e}}getChild(t){const e=lt(t);return null===e?this:this.getImmediateChild(e).getChild(ut(t))}hasChild(t){return null!==this.children_.get(t)}updateImmediateChild(t,e){if(Object(o.c)(e,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(e);{const n=new St(t,e);let r,i;e.isEmpty()?(r=this.children_.remove(t),i=this.indexMap_.removeFromIndexes(n,this.children_)):(r=this.children_.insert(t,e),i=this.indexMap_.addToIndexes(n,this.children_));const o=r.isEmpty()?Qt:this.priorityNode_;return new Kt(r,o,i)}}updateChild(t,e){const n=lt(t);if(null===n)return e;{Object(o.c)(".priority"!==lt(t)||1===ct(t),".priority must be the last token in a path");const r=this.getImmediateChild(n).updateChild(ut(t),e);return this.updateImmediateChild(n,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(t){if(this.isEmpty())return null;const e={};let n=0,r=0,i=!0;if(this.forEachChild(Ft,(o,a)=>{e[o]=a.val(t),n++,i&&Kt.INTEGER_REGEXP_.test(o)?r=Math.max(r,Number(o)):i=!1}),!t&&i&&r<2*n){const t=[];for(const n in e)t[n]=e[n];return t}return t&&!this.getPriority().isEmpty()&&(e[".priority"]=this.getPriority().val()),e}hash(){if(null===this.lazyHash_){let t="";this.getPriority().isEmpty()||(t+="priority:"+Dt(this.getPriority().val())+":"),this.forEachChild(Ft,(e,n)=>{const r=n.hash();""!==r&&(t+=":"+e+":"+r)}),this.lazyHash_=""===t?"":v(t)}return this.lazyHash_}getPredecessorChildName(t,e,n){const r=this.resolveIndex_(n);if(r){const n=r.getPredecessorKey(new St(t,e));return n?n.name:null}return this.children_.getPredecessorKey(t)}getFirstChildName(t){const e=this.resolveIndex_(t);if(e){const t=e.minKey();return t&&t.name}return this.children_.minKey()}getFirstChild(t){const e=this.getFirstChildName(t);return e?new St(e,this.children_.get(e)):null}getLastChildName(t){const e=this.resolveIndex_(t);if(e){const t=e.maxKey();return t&&t.name}return this.children_.maxKey()}getLastChild(t){const e=this.getLastChildName(t);return e?new St(e,this.children_.get(e)):null}forEachChild(t,e){const n=this.resolveIndex_(t);return n?n.inorderTraversal(t=>e(t.name,t.node)):this.children_.inorderTraversal(e)}getIterator(t){return this.getIteratorFrom(t.minPost(),t)}getIteratorFrom(t,e){const n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,t=>t);{const n=this.children_.getIteratorFrom(t.name,St.Wrap);let r=n.peek();for(;null!=r&&e.compare(r,t)<0;)n.getNext(),r=n.peek();return n}}getReverseIterator(t){return this.getReverseIteratorFrom(t.maxPost(),t)}getReverseIteratorFrom(t,e){const n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,t=>t);{const n=this.children_.getReverseIteratorFrom(t.name,St.Wrap);let r=n.peek();for(;null!=r&&e.compare(r,t)>0;)n.getNext(),r=n.peek();return n}}compareTo(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Zt?-1:0}withIndex(t){if(t===It||this.indexMap_.hasIndex(t))return this;{const e=this.indexMap_.addIndex(t,this.children_);return new Kt(this.children_,this.priorityNode_,e)}}isIndexed(t){return t===It||this.indexMap_.hasIndex(t)}equals(t){if(t===this)return!0;if(t.isLeafNode())return!1;{const e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){const t=this.getIterator(Ft),n=e.getIterator(Ft);let r=t.getNext(),i=n.getNext();for(;r&&i;){if(r.name!==i.name||!r.node.equals(i.node))return!1;r=t.getNext(),i=n.getNext()}return null===r&&null===i}return!1}return!1}}resolveIndex_(t){return t===It?null:this.indexMap_.get(t.toString())}}Kt.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;const Zt=new class extends Kt{constructor(){super(new Pt(jt),Kt.EMPTY_NODE,Yt.Default)}compareTo(t){return t===this?0:1}equals(t){return t===this}getPriority(){return this}getImmediateChild(t){return Kt.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(St,{MIN:{value:new St(O,Kt.EMPTY_NODE)},MAX:{value:new St(E,Zt)}}),Et.__EMPTY_NODE=Kt.EMPTY_NODE,zt.__childrenNodeConstructor=Kt,Rt=Zt,function(t){Ut=t}(Zt);function Jt(t,e=null){if(null===t)return Kt.EMPTY_NODE;if("object"==typeof t&&".priority"in t&&(e=t[".priority"]),Object(o.c)(null===e||"string"==typeof e||"number"==typeof e||"object"==typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t){return new zt(t,Jt(e))}if(t instanceof Array){let n=Kt.EMPTY_NODE;return j(t,(e,r)=>{if(Object(o.g)(t,e)&&"."!==e.substring(0,1)){const t=Jt(r);!t.isLeafNode()&&t.isEmpty()||(n=n.updateImmediateChild(e,t))}}),n.updatePriority(Jt(e))}{const n=[];let r=!1;if(j(t,(t,e)=>{if("."!==t.substring(0,1)){const i=Jt(e);i.isEmpty()||(r=r||!i.getPriority().isEmpty(),n.push(new St(t,i)))}}),0===n.length)return Kt.EMPTY_NODE;const i=Wt(n,qt,t=>t.name,jt);if(r){const t=Wt(n,Ft.getCompare());return new Kt(i,Jt(e),new Yt({".priority":t},{".priority":Ft}))}return new Kt(i,Jt(e),Yt.Default)}}!function(t){$t=t}(Jt); /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class Xt extends Tt{constructor(t){super(),this.indexPath_=t,Object(o.c)(!mt(t)&&".priority"!==lt(t),"Can't create PathIndex with empty path or .priority key")}extractChild(t){return t.getChild(this.indexPath_)}isDefinedOn(t){return!t.getChild(this.indexPath_).isEmpty()}compare(t,e){const n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?I(t.name,e.name):i}makePost(t,e){const n=Jt(t),r=Kt.EMPTY_NODE.updateChild(this.indexPath_,n);return new St(e,r)}maxPost(){const t=Kt.EMPTY_NODE.updateChild(this.indexPath_,Zt);return new St(E,t)}toString(){return ht(this.indexPath_,0).join("/")}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const te=new class extends Tt{compare(t,e){const n=t.node.compareTo(e.node);return 0===n?I(t.name,e.name):n}isDefinedOn(t){return!0}indexedValueChanged(t,e){return!t.equals(e)}minPost(){return St.MIN}maxPost(){return St.MAX}makePost(t,e){const n=Jt(t);return new St(e,n)}toString(){return".value"}},ee="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */!function(){let t=0;const e=[]}(); /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function ne(t){return{type:"value",snapshotNode:t}}function re(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function ie(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function oe(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class ae{constructor(t){this.index_=t}updateChild(t,e,n,r,i,a){Object(o.c)(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");const s=t.getImmediateChild(e);return s.getChild(r).equals(n.getChild(r))&&s.isEmpty()===n.isEmpty()?t:(null!=a&&(n.isEmpty()?t.hasChild(e)?a.trackChildChange(ie(e,s)):Object(o.c)(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):s.isEmpty()?a.trackChildChange(re(e,n)):a.trackChildChange(oe(e,n,s))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))}updateFullNode(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(Ft,(t,r)=>{e.hasChild(t)||n.trackChildChange(ie(t,r))}),e.isLeafNode()||e.forEachChild(Ft,(e,r)=>{if(t.hasChild(e)){const i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(oe(e,r,i))}else n.trackChildChange(re(e,r))})),e.withIndex(this.index_)}updatePriority(t,e){return t.isEmpty()?Kt.EMPTY_NODE:t.updatePriority(e)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class se{constructor(t){this.indexedFilter_=new ae(t.getIndex()),this.index_=t.getIndex(),this.startPost_=se.getStartPost_(t),this.endPost_=se.getEndPost_(t)}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0}updateChild(t,e,n,r,i,o){return this.matches(new St(e,n))||(n=Kt.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)}updateFullNode(t,e,n){e.isLeafNode()&&(e=Kt.EMPTY_NODE);let r=e.withIndex(this.index_);r=r.updatePriority(Kt.EMPTY_NODE);const i=this;return e.forEachChild(Ft,(t,e)=>{i.matches(new St(t,e))||(r=r.updateImmediateChild(t,Kt.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(t,r,n)}updatePriority(t,e){return t}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(t){if(t.hasStart()){const e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()}static getEndPost_(t){if(t.hasEnd()){const e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class le{constructor(t){this.rangedFilter_=new se(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}updateChild(t,e,n,r,i,o){return this.rangedFilter_.matches(new St(e,n))||(n=Kt.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()e(n,t)}else o=r.getIterator(this.index_),t=this.rangedFilter_.getStartPost(),n=this.rangedFilter_.getEndPost(),i=this.index_.getCompare();let a=0,s=!1;for(;o.hasNext();){const e=o.getNext();!s&&i(t,e)<=0&&(s=!0);s&&at(n,e)}else a=this.index_.getCompare();const s=t;Object(o.c)(s.numChildren()===this.limit_,"");const l=new St(e,n),c=this.reverse_?s.getFirstChild(this.index_):s.getLastChild(this.index_),u=this.rangedFilter_.matches(l);if(s.hasChild(e)){const t=s.getImmediateChild(e);let o=r.getChildAfterChild(this.index_,c,this.reverse_);for(;null!=o&&(o.name===e||s.hasChild(o.name));)o=r.getChildAfterChild(this.index_,o,this.reverse_);const d=null==o?1:a(o,l);if(u&&!n.isEmpty()&&d>=0)return null!=i&&i.trackChildChange(oe(e,n,t)),s.updateImmediateChild(e,n);{null!=i&&i.trackChildChange(ie(e,t));const n=s.updateImmediateChild(e,Kt.EMPTY_NODE);return null!=o&&this.rangedFilter_.matches(o)?(null!=i&&i.trackChildChange(re(o.name,o.node)),n.updateImmediateChild(o.name,o.node)):n}}return n.isEmpty()?t:u&&a(c,l)>=0?(null!=i&&(i.trackChildChange(ie(c.name,c.node)),i.trackChildChange(re(e,n))),s.updateImmediateChild(e,n).updateImmediateChild(c.name,Kt.EMPTY_NODE)):t}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ce{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Ft}hasStart(){return this.startSet_}hasStartAfter(){return this.startAfterSet_}hasEndBefore(){return this.endBeforeSet_}isViewFromLeft(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_}getIndexStartValue(){return Object(o.c)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return Object(o.c)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:O}hasEnd(){return this.endSet_}getIndexEndValue(){return Object(o.c)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return Object(o.c)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:E}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&""!==this.viewFrom_}getLimit(){return Object(o.c)(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Ft}copy(){const t=new ce;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t}}function ue(t){const e={};if(t.isDefault())return e;let n;return t.index_===Ft?n="$priority":t.index_===te?n="$value":t.index_===It?n="$key":(Object(o.c)(t.index_ instanceof Xt,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=Object(o.x)(n),t.startSet_&&(e.startAt=Object(o.x)(t.indexStartValue_),t.startNameSet_&&(e.startAt+=","+Object(o.x)(t.indexStartName_))),t.endSet_&&(e.endAt=Object(o.x)(t.indexEndValue_),t.endNameSet_&&(e.endAt+=","+Object(o.x)(t.indexEndName_))),t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function de(t){const e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_)),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_)),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;""===n&&(n=t.isViewFromLeft()?"l":"r"),e.vf=n}return t.index_!==Ft&&(e.i=t.index_.toString()),e} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class he extends rt{constructor(t,e,n,r){super(),this.repoInfo_=t,this.onDataUpdate_=e,this.authTokenProvider_=n,this.appCheckTokenProvider_=r,this.log_=C("p:rest:"),this.listens_={}}reportStats(t){throw new Error("Method not implemented.")}static getListenId_(t,e){return void 0!==e?"tag$"+e:(Object(o.c)(t._queryParams.isDefault(),"should have a tag if it's not a default query."),t._path.toString())}listen(t,e,n,r){const i=t._path.toString();this.log_("Listen called for "+i+" "+t._queryIdentifier);const a=he.getListenId_(t,n),s={};this.listens_[a]=s;const l=ue(t._queryParams);this.restRequest_(i+".json",l,(t,e)=>{let l=e;if(404===t&&(l=null,t=null),null===t&&this.onDataUpdate_(i,l,!1,n),Object(o.u)(this.listens_,a)===s){let e;e=t?401===t?"permission_denied":"rest_error:"+t:"ok",r(e,null)}})}unlisten(t,e){const n=he.getListenId_(t,e);delete this.listens_[n]}get(t){const e=ue(t._queryParams),n=t._path.toString(),r=new o.a;return this.restRequest_(n+".json",e,(t,e)=>{let i=e;404===t&&(i=null,t=null),null===t?(this.onDataUpdate_(n,i,!1,null),r.resolve(i)):r.reject(new Error(i))}),r.promise}refreshAuthToken(t){}restRequest_(t,e={},n){return e.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([r,i])=>{r&&r.accessToken&&(e.auth=r.accessToken),i&&i.token&&(e.ac=i.token);const a=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+t+"?ns="+this.repoInfo_.namespace+Object(o.t)(e);this.log_("Sending REST request for "+a);const s=new XMLHttpRequest;s.onreadystatechange=()=>{if(n&&4===s.readyState){this.log_("REST Response for "+a+" received. status:",s.status,"response:",s.responseText);let t=null;if(s.status>=200&&s.status<300){try{t=Object(o.r)(s.responseText)}catch(t){S("Failed to parse JSON response for "+a+": "+s.responseText)}n(null,t)}else 401!==s.status&&404!==s.status&&S("Got unsuccessful REST response for "+a+" Status: "+s.status),n(s.status);n=null}},s.open("GET",a,!0),s.send()})}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class pe{constructor(){this.rootNode_=Kt.EMPTY_NODE}getNode(t){return this.rootNode_.getChild(t)}updateSnapshot(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function fe(){return{value:null,children:new Map}}function me(t,e,n){if(mt(e))t.value=n,t.children.clear();else if(null!==t.value)t.value=t.value.updateChild(e,n);else{const r=lt(e);t.children.has(r)||t.children.set(r,fe());me(t.children.get(r),e=ut(e),n)}}function ve(t,e,n){null!==t.value?n(e,t.value):function(t,e){t.children.forEach((t,n)=>{e(n,t)})} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(t,(t,r)=>{ve(r,new at(e.toString()+"/"+t),n)})}class ge{constructor(t){this.collection_=t,this.last_=null}get(){const t=this.collection_.get(),e=Object.assign({},t);return this.last_&&j(this.last_,(t,n)=>{e[t]=e[t]-n}),this.last_=t,e}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ye{constructor(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new ge(t);const n=1e4+2e4*Math.random();$(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const t=this.statsListener_.get(),e={};let n=!1;j(t,(t,r)=>{r>0&&Object(o.g)(this.statsToReport_,t)&&(e[t]=r,n=!0)}),n&&this.server_.reportStats(e),$(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var _e;function be(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(_e||(_e={}));class we{constructor(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=_e.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}operationForChild(t){if(mt(this.path)){if(null!=this.affectedTree.value)return Object(o.c)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const e=this.affectedTree.subtree(new at(t));return new we(st(),e,this.revert)}}return Object(o.c)(lt(this.path)===t,"operationForChild called for unrelated child."),new we(ut(this.path),this.affectedTree,this.revert)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ce{constructor(t,e){this.source=t,this.path=e,this.type=_e.LISTEN_COMPLETE}operationForChild(t){return mt(this.path)?new Ce(this.source,st()):new Ce(this.source,ut(this.path))}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class xe{constructor(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=_e.OVERWRITE}operationForChild(t){return mt(this.path)?new xe(this.source,st(),this.snap.getImmediateChild(t)):new xe(this.source,ut(this.path),this.snap)}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ke{constructor(t,e,n){this.source=t,this.path=e,this.children=n,this.type=_e.MERGE}operationForChild(t){if(mt(this.path)){const e=this.children.subtree(new at(t));return e.isEmpty()?null:e.value?new xe(this.source,st(),e.value):new ke(this.source,st(),e)}return Object(o.c)(lt(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new ke(this.source,ut(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Se{constructor(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(t){if(mt(t))return this.isFullyInitialized()&&!this.filtered_;const e=lt(t);return this.isCompleteForChild(e)}isCompleteForChild(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)}getNode(){return this.node_}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Te{constructor(t){this.query_=t,this.index_=this.query_._queryParams.getIndex()}}function Oe(t,e,n,r,i,a){const s=r.filter(t=>t.type===n);s.sort((e,n)=>function(t,e,n){if(null==e.childName||null==n.childName)throw Object(o.d)("Should only compare child_ events.");const r=new St(e.childName,e.snapshotNode),i=new St(n.childName,n.snapshotNode);return t.index_.compare(r,i)} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(t,e,n)),s.forEach(n=>{const r=function(t,e,n){return"value"===e.type||"child_removed"===e.type||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}(t,n,a);i.forEach(i=>{i.respondsTo(n.type)&&e.push(i.createEvent(r,t.query_))})})}function Ee(t,e){return{eventCache:t,serverCache:e}}function Ie(t,e,n,r){return Ee(new Se(e,n,r),t.serverCache)}function Ne(t,e,n,r){return Ee(t.eventCache,new Se(e,n,r))}function Ae(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function Pe(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let qe;class je{constructor(t,e=(()=>(qe||(qe=new Pt(N)),qe))()){this.value=t,this.children=e}static fromObject(t){let e=new je(null);return j(t,(t,n)=>{e=e.set(new at(t),n)}),e}isEmpty(){return null===this.value&&this.children.isEmpty()}findRootMostMatchingPathAndValue(t,e){if(null!=this.value&&e(this.value))return{path:st(),value:this.value};if(mt(t))return null;{const n=lt(t),r=this.children.get(n);if(null!==r){const i=r.findRootMostMatchingPathAndValue(ut(t),e);if(null!=i){return{path:ft(new at(n),i.path),value:i.value}}return null}return null}}findRootMostValueAndPath(t){return this.findRootMostMatchingPathAndValue(t,()=>!0)}subtree(t){if(mt(t))return this;{const e=lt(t),n=this.children.get(e);return null!==n?n.subtree(ut(t)):new je(null)}}set(t,e){if(mt(t))return new je(e,this.children);{const n=lt(t),r=(this.children.get(n)||new je(null)).set(ut(t),e),i=this.children.insert(n,r);return new je(this.value,i)}}remove(t){if(mt(t))return this.children.isEmpty()?new je(null):new je(null,this.children);{const e=lt(t),n=this.children.get(e);if(n){const r=n.remove(ut(t));let i;return i=r.isEmpty()?this.children.remove(e):this.children.insert(e,r),null===this.value&&i.isEmpty()?new je(null):new je(this.value,i)}return this}}get(t){if(mt(t))return this.value;{const e=lt(t),n=this.children.get(e);return n?n.get(ut(t)):null}}setTree(t,e){if(mt(t))return e;{const n=lt(t),r=(this.children.get(n)||new je(null)).setTree(ut(t),e);let i;return i=r.isEmpty()?this.children.remove(n):this.children.insert(n,r),new je(this.value,i)}}fold(t){return this.fold_(st(),t)}fold_(t,e){const n={};return this.children.inorderTraversal((r,i)=>{n[r]=i.fold_(ft(t,r),e)}),e(t,this.value,n)}findOnPath(t,e){return this.findOnPath_(t,st(),e)}findOnPath_(t,e,n){const r=!!this.value&&n(e,this.value);if(r)return r;if(mt(t))return null;{const r=lt(t),i=this.children.get(r);return i?i.findOnPath_(ut(t),ft(e,r),n):null}}foreachOnPath(t,e){return this.foreachOnPath_(t,st(),e)}foreachOnPath_(t,e,n){if(mt(t))return this;{this.value&&n(e,this.value);const r=lt(t),i=this.children.get(r);return i?i.foreachOnPath_(ut(t),ft(e,r),n):new je(null)}}foreach(t){this.foreach_(st(),t)}foreach_(t,e){this.children.inorderTraversal((n,r)=>{r.foreach_(ft(t,n),e)}),this.value&&e(t,this.value)}foreachChild(t){this.children.inorderTraversal((e,n)=>{n.value&&t(e,n.value)})}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Re{constructor(t){this.writeTree_=t}static empty(){return new Re(new je(null))}}function De(t,e,n){if(mt(e))return new Re(new je(n));{const r=t.writeTree_.findRootMostValueAndPath(e);if(null!=r){const i=r.path;let o=r.value;const a=vt(i,e);return o=o.updateChild(a,n),new Re(t.writeTree_.set(i,o))}{const r=new je(n),i=t.writeTree_.setTree(e,r);return new Re(i)}}}function Le(t,e,n){let r=t;return j(n,(t,n)=>{r=De(r,ft(e,t),n)}),r}function Me(t,e){if(mt(e))return Re.empty();{const n=t.writeTree_.setTree(e,new je(null));return new Re(n)}}function $e(t,e){return null!=Ue(t,e)}function Ue(t,e){const n=t.writeTree_.findRootMostValueAndPath(e);return null!=n?t.writeTree_.get(n.path).getChild(vt(n.path,e)):null}function ze(t){const e=[],n=t.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(Ft,(t,n)=>{e.push(new St(t,n))}):t.writeTree_.children.inorderTraversal((t,n)=>{null!=n.value&&e.push(new St(t,n.value))}),e}function Fe(t,e){if(mt(e))return t;{const n=Ue(t,e);return new Re(null!=n?new je(n):t.writeTree_.subtree(e))}}function Be(t){return t.writeTree_.isEmpty()}function He(t,e){return function t(e,n,r){if(null!=n.value)return r.updateChild(e,n.value);{let i=null;return n.children.inorderTraversal((n,a)=>{".priority"===n?(Object(o.c)(null!==a.value,"Priority writes must always be leaf nodes"),i=a.value):r=t(ft(e,n),a,r)}),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(ft(e,".priority"),i)),r}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(st(),t.writeTree_,e)}function We(t,e){return on(e,t)}function Ge(t,e){const n=t.allWrites.findIndex(t=>t.writeId===e);Object(o.c)(n>=0,"removeWrite called with nonexistent writeId.");const r=t.allWrites[n];t.allWrites.splice(n,1);let i=r.visible,a=!1,s=t.allWrites.length-1;for(;i&&s>=0;){const e=t.allWrites[s];e.visible&&(s>=n&&Ve(e,r.path)?i=!1:_t(r.path,e.path)&&(a=!0)),s--}if(i){if(a)return function(t){t.visibleWrites=Qe(t.allWrites,Ye,st()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}(t),!0;if(r.snap)t.visibleWrites=Me(t.visibleWrites,r.path);else{j(r.children,e=>{t.visibleWrites=Me(t.visibleWrites,ft(r.path,e))})}return!0}return!1}function Ve(t,e){if(t.snap)return _t(t.path,e);for(const n in t.children)if(t.children.hasOwnProperty(n)&&_t(ft(t.path,n),e))return!0;return!1}function Ye(t){return t.visible}function Qe(t,e,n){let r=Re.empty();for(let i=0;i{r=r.updateImmediateChild(t,e)}),r;if(n){const i=Fe(t.visibleWrites,e);return n.forEachChild(Ft,(t,e)=>{const n=He(Fe(i,new at(t)),e);r=r.updateImmediateChild(t,n)}),ze(i).forEach(t=>{r=r.updateImmediateChild(t.name,t.node)}),r}return ze(Fe(t.visibleWrites,e)).forEach(t=>{r=r.updateImmediateChild(t.name,t.node)}),r}(t.writeTree,t.treePath,e)}function Xe(t,e,n,r){return function(t,e,n,r,i){Object(o.c)(r||i,"Either existingEventSnap or existingServerSnap must exist");const a=ft(e,n);if($e(t.visibleWrites,a))return null;{const e=Fe(t.visibleWrites,a);return Be(e)?i.getChild(n):He(e,i.getChild(n))}}(t.writeTree,t.treePath,e,n,r)}function tn(t,e){return function(t,e){return Ue(t.visibleWrites,e)}(t.writeTree,ft(t.treePath,e))}function en(t,e,n,r,i,o){return function(t,e,n,r,i,o,a){let s;const l=Fe(t.visibleWrites,e),c=Ue(l,st());if(null!=c)s=c;else{if(null==n)return[];s=He(l,n)}if(s=s.withIndex(a),s.isEmpty()||s.isLeafNode())return[];{const t=[],e=a.getCompare(),n=o?s.getReverseIteratorFrom(r,a):s.getIteratorFrom(r,a);let l=n.getNext();for(;l&&t.length{const c=ft(n,r);pn(e,lt(c))&&(s=hn(t,s,c,l,i,o,a))}),r.foreach((r,l)=>{const c=ft(n,r);pn(e,lt(c))||(s=hn(t,s,c,l,i,o,a))}),s}(t,e,c.path,c.children,r,i,a):(Object(o.c)(c.source.fromServer,"Unknown source."),l=c.source.tagged||e.serverCache.isFiltered(),s=mn(t,e,c.path,c.children,r,i,l,a))}else if(n.type===_e.ACK_USER_WRITE){const l=n;s=l.revert?function(t,e,n,r,i,a){let s;if(null!=tn(r,n))return e;{const l=new ln(r,e,i),c=e.eventCache.getNode();let u;if(mt(n)||".priority"===lt(n)){let n;if(e.serverCache.isFullyInitialized())n=Ze(r,Pe(e));else{const t=e.serverCache.getNode();Object(o.c)(t instanceof Kt,"serverChildren would be complete if leaf node"),n=Je(r,t)}n=n,u=t.filter.updateFullNode(c,n,a)}else{const i=lt(n);let o=nn(r,i,e.serverCache);null==o&&e.serverCache.isCompleteForChild(i)&&(o=c.getImmediateChild(i)),u=null!=o?t.filter.updateChild(c,i,o,ut(n),l,a):e.eventCache.getNode().hasChild(i)?t.filter.updateChild(c,i,Kt.EMPTY_NODE,ut(n),l,a):c,u.isEmpty()&&e.serverCache.isFullyInitialized()&&(s=Ze(r,Pe(e)),s.isLeafNode()&&(u=t.filter.updateFullNode(u,s,a)))}return s=e.serverCache.isFullyInitialized()||null!=tn(r,st()),Ie(e,u,s,t.filter.filtersNodes())}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(t,e,l.path,r,i,a):function(t,e,n,r,i,o,a){if(null!=tn(i,n))return e;const s=e.serverCache.isFiltered(),l=e.serverCache;if(null!=r.value){if(mt(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return dn(t,e,n,l.getNode().getChild(n),i,o,s,a);if(mt(n)){let r=new je(null);return l.getNode().forEachChild(It,(t,e)=>{r=r.set(new at(t),e)}),mn(t,e,n,r,i,o,s,a)}return e}{let c=new je(null);return r.foreach((t,e)=>{const r=ft(n,t);l.isCompleteForPath(r)&&(c=c.set(t,l.getNode().getChild(r)))}),mn(t,e,n,c,i,o,s,a)}}(t,e,l.path,l.affectedTree,r,i,a)}else{if(n.type!==_e.LISTEN_COMPLETE)throw Object(o.d)("Unknown operation type: "+n.type);s=function(t,e,n,r,i){const o=e.serverCache,a=Ne(e,o.getNode(),o.isFullyInitialized()||mt(n),o.isFiltered());return un(t,a,n,r,sn,i)}(t,e,n.path,r,a)}const c=a.getChanges();return function(t,e,n){const r=e.eventCache;if(r.isFullyInitialized()){const i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=Ae(t);(n.length>0||!t.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(ne(Ae(e)))}}(e,s,c),{viewCache:s,changes:c}}function un(t,e,n,r,i,a){const s=e.eventCache;if(null!=tn(r,n))return e;{let l,c;if(mt(n))if(Object(o.c)(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const n=Pe(e),i=Je(r,n instanceof Kt?n:Kt.EMPTY_NODE);l=t.filter.updateFullNode(e.eventCache.getNode(),i,a)}else{const n=Ze(r,Pe(e));l=t.filter.updateFullNode(e.eventCache.getNode(),n,a)}else{const u=lt(n);if(".priority"===u){Object(o.c)(1===ct(n),"Can't have a priority with additional path components");const i=s.getNode();c=e.serverCache.getNode();const a=Xe(r,n,i,c);l=null!=a?t.filter.updatePriority(i,a):s.getNode()}else{const o=ut(n);let d;if(s.isCompleteForChild(u)){c=e.serverCache.getNode();const t=Xe(r,n,s.getNode(),c);d=null!=t?s.getNode().getImmediateChild(u).updateChild(o,t):s.getNode().getImmediateChild(u)}else d=nn(r,u,e.serverCache);l=null!=d?t.filter.updateChild(s.getNode(),u,d,o,i,a):s.getNode()}}return Ie(e,l,s.isFullyInitialized()||mt(n),t.filter.filtersNodes())}}function dn(t,e,n,r,i,o,a,s){const l=e.serverCache;let c;const u=a?t.filter:t.filter.getIndexedFilter();if(mt(n))c=u.updateFullNode(l.getNode(),r,null);else if(u.filtersNodes()&&!l.isFiltered()){const t=l.getNode().updateChild(n,r);c=u.updateFullNode(l.getNode(),t,null)}else{const t=lt(n);if(!l.isCompleteForPath(n)&&ct(n)>1)return e;const i=ut(n),o=l.getNode().getImmediateChild(t).updateChild(i,r);c=".priority"===t?u.updatePriority(l.getNode(),o):u.updateChild(l.getNode(),t,o,i,sn,null)}const d=Ne(e,c,l.isFullyInitialized()||mt(n),u.filtersNodes());return un(t,d,n,i,new ln(i,d,o),s)}function hn(t,e,n,r,i,o,a){const s=e.eventCache;let l,c;const u=new ln(i,e,o);if(mt(n))c=t.filter.updateFullNode(e.eventCache.getNode(),r,a),l=Ie(e,c,!0,t.filter.filtersNodes());else{const i=lt(n);if(".priority"===i)c=t.filter.updatePriority(e.eventCache.getNode(),r),l=Ie(e,c,s.isFullyInitialized(),s.isFiltered());else{const o=ut(n),c=s.getNode().getImmediateChild(i);let d;if(mt(o))d=r;else{const t=u.getCompleteChild(i);d=null!=t?".priority"===dt(o)&&t.getChild(pt(o)).isEmpty()?t:t.updateChild(o,r):Kt.EMPTY_NODE}if(c.equals(d))l=e;else{l=Ie(e,t.filter.updateChild(s.getNode(),i,d,o,u,a),s.isFullyInitialized(),t.filter.filtersNodes())}}}return l}function pn(t,e){return t.eventCache.isCompleteForChild(e)}function fn(t,e,n){return n.foreach((t,n)=>{e=e.updateChild(t,n)}),e}function mn(t,e,n,r,i,o,a,s){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let l,c=e;l=mt(n)?r:new je(null).setTree(n,r);const u=e.serverCache.getNode();return l.children.inorderTraversal((n,r)=>{if(u.hasChild(n)){const l=fn(0,e.serverCache.getNode().getImmediateChild(n),r);c=dn(t,c,new at(n),l,i,o,a,s)}}),l.children.inorderTraversal((n,r)=>{const l=!e.serverCache.isCompleteForChild(n)&&void 0===r.value;if(!u.hasChild(n)&&!l){const l=fn(0,e.serverCache.getNode().getImmediateChild(n),r);c=dn(t,c,new at(n),l,i,o,a,s)}}),c}class vn{constructor(t,e){this.query_=t,this.eventRegistrations_=[];const n=this.query_._queryParams,r=new ae(n.getIndex()),i=(o=n).loadsAllData()?new ae(o.getIndex()):o.hasLimit()?new le(o):new se(o);var o;this.processor_=function(t){return{filter:t}}(i);const a=e.serverCache,s=e.eventCache,l=r.updateFullNode(Kt.EMPTY_NODE,a.getNode(),null),c=i.updateFullNode(Kt.EMPTY_NODE,s.getNode(),null),u=new Se(l,a.isFullyInitialized(),r.filtersNodes()),d=new Se(c,s.isFullyInitialized(),i.filtersNodes());this.viewCache_=Ee(d,u),this.eventGenerator_=new Te(this.query_)}get query(){return this.query_}}function gn(t,e){const n=Pe(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!mt(e)&&!n.getImmediateChild(lt(e)).isEmpty())?n.getChild(e):null}function yn(t){return 0===t.eventRegistrations_.length}function _n(t,e,n){const r=[];if(n){Object(o.c)(null==e,"A cancel should cancel all event registrations.");const i=t.query._path;t.eventRegistrations_.forEach(t=>{const e=t.createCancelEvent(n,i);e&&r.push(e)})}if(e){let n=[];for(let r=0;r{var n;"child_changed"===e.type&&t.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push((n=e.childName,{type:"child_moved",snapshotNode:e.snapshotNode,childName:n}))}),Oe(t,i,"child_removed",e,r,n),Oe(t,i,"child_added",e,r,n),Oe(t,i,"child_moved",o,r,n),Oe(t,i,"child_changed",e,r,n),Oe(t,i,"value",e,r,n),i}(t.eventGenerator_,e,n,i)} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Cn,xn;class kn{constructor(){this.views=new Map}}function Sn(t,e,n,r){const i=e.source.queryId;if(null!==i){const a=t.views.get(i);return Object(o.c)(null!=a,"SyncTree gave us an op for an invalid query."),bn(a,e,n,r)}{let i=[];for(const o of t.views.values())i=i.concat(bn(o,e,n,r));return i}}function Tn(t,e,n,r,i){const o=e._queryIdentifier,a=t.views.get(o);if(!a){let t=Ze(n,i?r:null),o=!1;t?o=!0:r instanceof Kt?(t=Je(n,r),o=!1):(t=Kt.EMPTY_NODE,o=!1);const a=Ee(new Se(t,o,!1),new Se(r,i,!1));return new vn(e,a)}return a}function On(t,e,n,r,i,o){const a=Tn(t,e,r,i,o);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,a),function(t,e){t.eventRegistrations_.push(e)}(a,n),function(t,e){const n=t.viewCache_.eventCache,r=[];if(!n.getNode().isLeafNode()){n.getNode().forEachChild(Ft,(t,e)=>{r.push(re(t,e))})}return n.isFullyInitialized()&&r.push(ne(n.getNode())),wn(t,r,n.getNode(),e)}(a,n)}function En(t,e,n,r){const i=e._queryIdentifier,a=[];let s=[];const l=qn(t);if("default"===i)for(const[e,i]of t.views.entries())s=s.concat(_n(i,n,r)),yn(i)&&(t.views.delete(e),i.query._queryParams.loadsAllData()||a.push(i.query));else{const e=t.views.get(i);e&&(s=s.concat(_n(e,n,r)),yn(e)&&(t.views.delete(i),e.query._queryParams.loadsAllData()||a.push(e.query)))}return l&&!qn(t)&&a.push(new(Object(o.c)(Cn,"Reference.ts has not been loaded"),Cn)(e._repo,e._path)),{removed:a,events:s}}function In(t){const e=[];for(const n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function Nn(t,e){let n=null;for(const r of t.views.values())n=n||gn(r,e);return n}function An(t,e){if(e._queryParams.loadsAllData())return jn(t);{const n=e._queryIdentifier;return t.views.get(n)}}function Pn(t,e){return null!=An(t,e)}function qn(t){return null!=jn(t)}function jn(t){for(const e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Rn=1;class Dn{constructor(t){this.listenProvider_=t,this.syncPointTree_=new je(null),this.pendingWriteTree_={visibleWrites:Re.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function Ln(t,e,n,r,i){return function(t,e,n,r,i){Object(o.c)(r>t.lastWriteId,"Stacking an older write on top of newer ones"),void 0===i&&(i=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:i}),i&&(t.visibleWrites=De(t.visibleWrites,e,n)),t.lastWriteId=r}(t.pendingWriteTree_,e,n,r,i),i?Hn(t,new xe({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,n)):[]}function Mn(t,e,n,r){!function(t,e,n,r){Object(o.c)(r>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:n,writeId:r,visible:!0}),t.visibleWrites=Le(t.visibleWrites,e,n),t.lastWriteId=r}(t.pendingWriteTree_,e,n,r);const i=je.fromObject(n);return Hn(t,new ke({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,i))}function $n(t,e,n=!1){const r=function(t,e){for(let n=0;n{e=e.set(new at(t),!0)}),Hn(t,new we(r.path,e,n))}return[]}function Un(t,e,n){return Hn(t,new xe({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,n))}function zn(t,e,n,r){const i=e._path,o=t.syncPointTree_.get(i);let a=[];if(o&&("default"===e._queryIdentifier||Pn(o,e))){const s=En(o,e,n,r);0===o.views.size&&(t.syncPointTree_=t.syncPointTree_.remove(i));const l=s.removed;a=s.events;const c=-1!==l.findIndex(t=>t._queryParams.loadsAllData()),u=t.syncPointTree_.findOnPath(i,(t,e)=>qn(e));if(c&&!u){const e=t.syncPointTree_.subtree(i);if(!e.isEmpty()){const n=function(t){return t.fold((t,e,n)=>{if(e&&qn(e)){return[jn(e)]}{let t=[];return e&&(t=In(e)),j(n,(e,n)=>{t=t.concat(n)}),t}})}(e);for(let e=0;e0&&!r)if(c){const n=null;t.listenProvider_.stopListening(Zn(e),n)}else l.forEach(e=>{const n=t.queryToTagMap.get(Vn(e));t.listenProvider_.stopListening(Zn(e),n)});!function(t,e){for(let n=0;n{const n=vt(t,r);i=i||Nn(e,n),a=a||qn(e)});let s,l=t.syncPointTree_.get(r);if(l?(a=a||qn(l),i=i||Nn(l,st())):(l=new kn,t.syncPointTree_=t.syncPointTree_.set(r,l)),null!=i)s=!0;else{s=!1,i=Kt.EMPTY_NODE;t.syncPointTree_.subtree(r).foreachChild((t,e)=>{const n=Nn(e,st());n&&(i=i.updateImmediateChild(t,n))})}const c=Pn(l,e);if(!c&&!e._queryParams.loadsAllData()){const n=Vn(e);Object(o.c)(!t.queryToTagMap.has(n),"View does not exist, but we have a tag");const r=Rn++;t.queryToTagMap.set(n,r),t.tagToQueryMap.set(r,n)}let u=On(l,e,n,We(t.pendingWriteTree_,r),i,s);if(!c&&!a){const n=An(l,e);u=u.concat(function(t,e,n){const r=e._path,i=Gn(t,e),a=Wn(t,n),s=t.listenProvider_.startListening(Zn(e),i,a.hashFn,a.onComplete),l=t.syncPointTree_.subtree(r);if(i)Object(o.c)(!qn(l.value),"If we're adding a query, it shouldn't be shadowed");else{const e=l.fold((t,e,n)=>{if(!mt(t)&&e&&qn(e))return[jn(e).query];{let t=[];return e&&(t=t.concat(In(e).map(t=>t.query))),j(n,(e,n)=>{t=t.concat(n)}),t}});for(let n=0;n{const r=Nn(n,vt(t,e));if(r)return r});return Ke(r,e,i,n,!0)}function Hn(t,e){return function t(e,n,r,i){if(mt(e.path))return function t(e,n,r,i){const o=n.get(st());null==r&&null!=o&&(r=Nn(o,st()));let a=[];n.children.inorderTraversal((n,o)=>{const s=r?r.getImmediateChild(n):null,l=rn(i,n),c=e.operationForChild(n);c&&(a=a.concat(t(c,o,s,l)))}),o&&(a=a.concat(Sn(o,e,i,r)));return a}(e,n,r,i);{const o=n.get(st());null==r&&null!=o&&(r=Nn(o,st()));let a=[];const s=lt(e.path),l=e.operationForChild(s),c=n.children.get(s);if(c&&l){const e=r?r.getImmediateChild(s):null,n=rn(i,s);a=a.concat(t(l,c,e,n))}return o&&(a=a.concat(Sn(o,e,i,r))),a}}(e,t.syncPointTree_,null,We(t.pendingWriteTree_,st()))}function Wn(t,e){const n=e.query,r=Gn(t,n);return{hashFn:()=>(function(t){return t.viewCache_.serverCache.getNode()}(e)||Kt.EMPTY_NODE).hash(),onComplete:e=>{if("ok"===e)return r?function(t,e,n){const r=Yn(t,n);if(r){const n=Qn(r),i=n.path,o=n.queryId,a=vt(i,e);return Kn(t,i,new Ce(be(o),a))}return[]}(t,n._path,r):function(t,e){return Hn(t,new Ce({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e))}(t,n._path);{const r=function(t,e){let n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===t?n="Client doesn't have permission to access the desired data.":"unavailable"===t&&(n="The service is unavailable");const r=new Error(t+" at "+e._path.toString()+": "+n);return r.code=t.toUpperCase(),r}(e,n);return zn(t,n,null,r)}}}}function Gn(t,e){const n=Vn(e);return t.queryToTagMap.get(n)}function Vn(t){return t._path.toString()+"$"+t._queryIdentifier}function Yn(t,e){return t.tagToQueryMap.get(e)}function Qn(t){const e=t.indexOf("$");return Object(o.c)(-1!==e&&e{const i=or(r,e.getImmediateChild(t),n);i!==r&&(o=o.updateImmediateChild(t,i))}),o}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ar{constructor(t="",e=null,n={children:{},childCount:0}){this.name=t,this.parent=e,this.node=n}}function sr(t,e){let n=e instanceof at?e:new at(e),r=t,i=lt(n);for(;null!==i;){const t=Object(o.u)(r.node.children,i)||{children:{},childCount:0};r=new ar(i,r,t),n=ut(n),i=lt(n)}return r}function lr(t){return t.node.value}function cr(t,e){t.node.value=e,pr(t)}function ur(t){return t.node.childCount>0}function dr(t,e){j(t.node.children,(n,r)=>{e(new ar(n,t,r))})}function hr(t){return new at(null===t.parent?t.name:hr(t.parent)+"/"+t.name)}function pr(t){null!==t.parent&&function(t,e,n){const r=function(t){return void 0===lr(t)&&!ur(t)}(n),i=Object(o.g)(t.node.children,e);r&&i?(delete t.node.children[e],t.node.childCount--,pr(t)):r||i||(t.node.children[e]=n.node,t.node.childCount++,pr(t))} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */(t.parent,t.name,t)}const fr=/[\[\].#$\/\u0000-\u001F\u007F]/,mr=/[\[\].#$\u0000-\u001F\u007F]/,vr=function(t){return"string"==typeof t&&0!==t.length&&!fr.test(t)},gr=function(t){return"string"==typeof t&&0!==t.length&&!mr.test(t)},yr=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!T(t)||t&&"object"==typeof t&&Object(o.g)(t,".sv")},_r=function(t,e,n,r){r&&void 0===e||br(Object(o.j)(t,"value"),e,n)},br=function(t,e,n){const r=n instanceof at?new bt(n,t):n;if(void 0===e)throw new Error(t+"contains undefined "+Ct(r));if("function"==typeof e)throw new Error(t+"contains a function "+Ct(r)+" with contents = "+e.toString());if(T(e))throw new Error(t+"contains "+e.toString()+" "+Ct(r));if("string"==typeof e&&e.length>10485760/3&&Object(o.v)(e)>10485760)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+Ct(r)+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){let n=!1,i=!1;if(j(e,(e,a)=>{if(".value"===e)n=!0;else if(".priority"!==e&&".sv"!==e&&(i=!0,!vr(e)))throw new Error(t+" contains an invalid key ("+e+") "+Ct(r)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');!function(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=Object(o.v)(e),wt(t)}(r,e),br(t,a,r),function(t){const e=t.parts_.pop();t.byteLength_-=Object(o.v)(e),t.parts_.length>0&&(t.byteLength_-=1)}(r)}),n&&i)throw new Error(t+' contains ".value" child '+Ct(r)+" in addition to actual children.")}},wr=function(t,e,n,r){if(r&&void 0===e)return;const i=Object(o.j)(t,"values");if(!e||"object"!=typeof e||Array.isArray(e))throw new Error(i+" must be an object containing the children to replace.");const a=[];j(e,(t,e)=>{const r=new at(t);if(br(i,e,ft(n,r)),".priority"===dt(r)&&!yr(e))throw new Error(i+"contains an invalid value for '"+r.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(r)}),function(t,e){let n,r;for(n=0;nyt(t,e))}function Er(t,e,n){Tr(t,n),Ir(t,t=>_t(t,e)||_t(e,t))}function Ir(t,e){t.recursionDepth_++;let n=!0;for(let r=0;r=0)t.server_=new he(t.repoInfo_,(e,n,r,i)=>{Rr(t,e,n,r,i)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>Dr(t,!0),0);else{if(null!=n){if("object"!=typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Object(o.x)(n)}catch(t){throw new Error("Invalid authOverride provided: "+t)}}t.persistentConnection_=new kt(t.repoInfo_,e,(e,n,r,i)=>{Rr(t,e,n,r,i)},e=>{Dr(t,e)},e=>{!function(t,e){j(e,(e,n)=>{Lr(t,e,n)})}(t,e)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(e=>{t.server_.refreshAuthToken(e)}),t.appCheckProvider_.addTokenChangeListener(e=>{t.server_.refreshAppCheckToken(e.token)}),t.statsReporter_=function(t,e){const n=t.toString();return Y[n]||(Y[n]=e()),Y[n]}(t.repoInfo_,()=>new ye(t.stats_,t.server_)),t.infoData_=new pe,t.infoSyncTree_=new Dn({startListening:(e,n,r,i)=>{let o=[];const a=t.infoData_.getNode(e._path);return a.isEmpty()||(o=Un(t.infoSyncTree_,e._path,a),setTimeout(()=>{i("ok")},0)),o},stopListening:()=>{}}),Lr(t,"connected",!1),t.serverSyncTree_=new Dn({startListening:(e,n,r,i)=>(t.server_.listen(e,r,n,(n,r)=>{const o=i(n,r);Er(t.eventQueue_,e._path,o)}),[]),stopListening:(e,n)=>{t.server_.unlisten(e,n)}})}function qr(t){const e=t.infoData_.getNode(new at(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e}function jr(t){return(e=(e={timestamp:qr(t)})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e}function Rr(t,e,n,r,i){t.dataUpdateCount++;const a=new at(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let s=[];if(i)if(r){const e=Object(o.s)(n,t=>Jt(t));s=function(t,e,n,r){const i=Yn(t,r);if(i){const r=Qn(i),o=r.path,a=r.queryId,s=vt(o,e),l=je.fromObject(n);return Kn(t,o,new ke(be(a),s,l))}return[]}(t.serverSyncTree_,a,e,i)}else{const e=Jt(n);s=function(t,e,n,r){const i=Yn(t,r);if(null!=i){const r=Qn(i),o=r.path,a=r.queryId,s=vt(o,e);return Kn(t,o,new xe(be(a),s,n))}return[]}(t.serverSyncTree_,a,e,i)}else if(r){const e=Object(o.s)(n,t=>Jt(t));s=function(t,e,n){const r=je.fromObject(n);return Hn(t,new ke({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,r))}(t.serverSyncTree_,a,e)}else{const e=Jt(n);s=Un(t.serverSyncTree_,a,e)}let l=a;s.length>0&&(l=Gr(t,a)),Er(t.eventQueue_,l,s)}function Dr(t,e){Lr(t,"connected",e),!1===e&&function(t){Fr(t,"onDisconnectEvents");const e=jr(t),n=fe();ve(t.onDisconnect_,st(),(r,i)=>{const o=rr(r,i,t.serverSyncTree_,e);me(n,r,o)});let r=[];ve(n,st(),(e,n)=>{r=r.concat(Un(t.serverSyncTree_,e,n));const i=Kr(t,e);Gr(t,i)}),t.onDisconnect_=fe(),Er(t.eventQueue_,st(),r)}(t)}function Lr(t,e,n){const r=new at("/.info/"+e),i=Jt(n);t.infoData_.updateSnapshot(r,i);const o=Un(t.infoSyncTree_,r,i);Er(t.eventQueue_,r,o)}function Mr(t){return t.nextWriteId_++}function $r(t,e,n,r,i){Fr(t,"set",{path:e.toString(),value:n,priority:r});const o=jr(t),a=Jt(n,r),s=Bn(t.serverSyncTree_,e),l=ir(a,s,o),c=Mr(t),u=Ln(t.serverSyncTree_,e,l,c,!0);Tr(t.eventQueue_,u),t.server_.put(e.toString(),a.val(!0),(n,r)=>{const o="ok"===n;o||S("set at "+e+" failed: "+n);const a=$n(t.serverSyncTree_,c,!o);Er(t.eventQueue_,e,a),Br(t,i,n,r)});const d=Kr(t,e);Gr(t,d),Er(t.eventQueue_,d,[])}function Ur(t,e,n){let r;r=".info"===lt(e._path)?zn(t.infoSyncTree_,e,n):zn(t.serverSyncTree_,e,n),Or(t.eventQueue_,e._path,r)}function zr(t){t.persistentConnection_&&t.persistentConnection_.interrupt("repo_interrupt")}function Fr(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),w(n,...e)}function Br(t,e,n,r){e&&M(()=>{if("ok"===n)e(null);else{const t=(n||"error").toUpperCase();let i=t;r&&(i+=": "+r);const o=new Error(i);o.code=t,e(o)}})}function Hr(t,e,n){return Bn(t.serverSyncTree_,e,n)||Kt.EMPTY_NODE}function Wr(t,e=t.transactionQueueTree_){if(e||Qr(t,e),lr(e)){const n=Yr(t,e);Object(o.c)(n.length>0,"Sending zero length transaction queue");n.every(t=>0===t.status)&&function(t,e,n){const r=n.map(t=>t.currentWriteId),i=Hr(t,e,r);let a=i;const s=i.hash();for(let t=0;t{Fr(t,"transaction put response",{path:c.toString(),status:r});let i=[];if("ok"===r){const r=[];for(let e=0;en[e].onComplete(null,!0,n[e].currentOutputSnapshotResolved)),n[e].unwatcher();Qr(t,sr(t.transactionQueueTree_,e)),Wr(t,t.transactionQueueTree_),Er(t.eventQueue_,e,i);for(let t=0;t{Wr(t,e)})}function Gr(t,e){const n=Vr(t,e),r=hr(n);return function(t,e,n){if(0===e.length)return;const r=[];let i=[];const a=e.filter(t=>0===t.status).map(t=>t.currentWriteId);for(let l=0;l=25)h=!0,d="maxretry",i=i.concat($n(t.serverSyncTree_,c.currentWriteId,!0));else{const n=Hr(t,c.path,a);c.currentInputSnapshot=n;const r=e[l].update(n.val());if(void 0!==r){br("transaction failed: Data returned ",r,c.path);let e=Jt(r);"object"==typeof r&&null!=r&&Object(o.g)(r,".priority")||(e=e.updatePriority(n.getPriority()));const s=c.currentWriteId,l=jr(t),u=ir(e,n,l);c.currentOutputSnapshotRaw=e,c.currentOutputSnapshotResolved=u,c.currentWriteId=Mr(t),a.splice(a.indexOf(s),1),i=i.concat(Ln(t.serverSyncTree_,c.path,u,c.currentWriteId,c.applyLocally)),i=i.concat($n(t.serverSyncTree_,s,!0))}else h=!0,d="nodata",i=i.concat($n(t.serverSyncTree_,c.currentWriteId,!0))}Er(t.eventQueue_,n,i),i=[],h&&(e[l].status=2,s=e[l].unwatcher,setTimeout(s,Math.floor(0)),e[l].onComplete&&("nodata"===d?r.push(()=>e[l].onComplete(null,!1,e[l].currentInputSnapshot)):r.push(()=>e[l].onComplete(new Error(d),!1,null))))}var s;Qr(t,t.transactionQueueTree_);for(let t=0;t{t(e,n,r)})}(t,e,n),n.sort((t,e)=>t.order-e.order),n}function Qr(t,e){const n=lr(e);if(n){let t=0;for(let e=0;e0?n:void 0)}dr(e,e=>{Qr(t,e)})}function Kr(t,e){const n=hr(Vr(t,e)),r=sr(t.transactionQueueTree_,e);return function(t,e,n){let r=n?t:t.parent;for(;null!==r;){if(e(r))return!0;r=r.parent}}(r,e=>{Zr(t,e)}),Zr(t,r),function t(e,n,r,i){r&&!i&&n(e),dr(e,e=>{t(e,n,!0,i)}),r&&i&&n(e)}(r,e=>{Zr(t,e)}),n}function Zr(t,e){const n=lr(e);if(n){const r=[];let i=[],a=-1;for(let e=0;e.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||k("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&S("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");const i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new H(n.host,n.secure,r,e,i,"",r!==n.subdomain),path:new at(n.pathString)}},Xr=function(t){let e="",n="",r="",i="",o="",a=!0,s="https",l=443;if("string"==typeof t){let c=t.indexOf("//");c>=0&&(s=t.substring(0,c-1),t=t.substring(c+2));let u=t.indexOf("/");-1===u&&(u=t.length);let d=t.indexOf("?");-1===d&&(d=t.length),e=t.substring(0,Math.min(u,d)),u0){let r=n[t];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch(t){}e+="/"+r}return e}(t.substring(u,d)));const h=function(t){const e={};"?"===t.charAt(0)&&(t=t.substring(1));for(const n of t.split("&")){if(0===n.length)continue;const r=n.split("=");2===r.length?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):S(`Invalid query segment '${n}' in query '${t}'`)}return e}(t.substring(Math.min(t.length,d)));c=e.indexOf(":"),c>=0?(a="https"===s||"wss"===s,l=parseInt(e.substring(c+1),10)):c=e.length;const p=e.slice(0,c);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{const t=e.indexOf(".");r=e.substring(0,t).toLowerCase(),n=e.substring(t+1),o=r}"ns"in h&&(o=h.ns)}return{host:e,port:l,domain:n,subdomain:r,secure:a,scheme:s,pathString:i,namespace:o}}; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class ti{constructor(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}getPath(){const t=this.snapshot.ref;return"value"===this.eventType?t._path:t.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+Object(o.x)(this.snapshot.exportVal())}}class ei{constructor(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ni{constructor(t,e){this.snapshotCallback=t,this.cancelCallback=e}onValue(t,e){this.snapshotCallback.call(null,t,e)}onCancel(t){return Object(o.c)(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,t)}get hasCancelCallback(){return!!this.cancelCallback}matches(t){return this.snapshotCallback===t.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===t.snapshotCallback.userCallback&&this.snapshotCallback.context===t.snapshotCallback.context}} /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class ri{constructor(t,e,n,r){this._repo=t,this._path=e,this._queryParams=n,this._orderByCalled=r}get key(){return mt(this._path)?null:dt(this._path)}get ref(){return new ii(this._repo,this._path)}get _queryIdentifier(){const t=de(this._queryParams),e=P(t);return"{}"===e?"default":e}get _queryObject(){return de(this._queryParams)}isEqual(t){if(!((t=Object(o.k)(t))instanceof ri))return!1;const e=this._repo===t._repo,n=yt(this._path,t._path),r=this._queryIdentifier===t._queryIdentifier;return e&&n&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+function(t){let e="";for(let n=t.pieceNum_;nt(new oi(n,si(this.ref,e),Ft)))}hasChild(t){const e=new at(t);return!this._node.getChild(e).isEmpty()}hasChildren(){return!this._node.isLeafNode()&&!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function ai(t,e){return(t=Object(o.k)(t))._checkNotDeleted("ref"),void 0!==e?si(t._root,e):t._root}function si(t,e){var n,r,i,a;return null===lt((t=Object(o.k)(t))._path)?(n="child",r="path",a=!1,(i=e)&&(i=i.replace(/^\/*\.info(\/|$)/,"/")),Cr(n,r,i,a)):Cr("child","path",e,!1),new ii(t._repo,ft(t._path,e))}function li(t,e){t=Object(o.k)(t),xr("set",t._path),_r("set",e,t._path,!1);const n=new o.a;return $r(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function ci(t,e){wr("update",e,t._path,!1);const n=new o.a;return function(t,e,n,r){Fr(t,"update",{path:e.toString(),value:n});let i=!0;const o=jr(t),a={};if(j(n,(n,r)=>{i=!1,a[n]=rr(ft(e,n),Jt(r),t.serverSyncTree_,o)}),i)w("update() called with empty data. Don't do anything."),Br(t,r,"ok",void 0);else{const i=Mr(t),o=Mn(t.serverSyncTree_,e,a,i);Tr(t.eventQueue_,o),t.server_.merge(e.toString(),n,(n,o)=>{const a="ok"===n;a||S("update at "+e+" failed: "+n);const s=$n(t.serverSyncTree_,i,!a),l=s.length>0?Gr(t,e):e;Er(t.eventQueue_,l,s),Br(t,r,n,o)}),j(n,n=>{const r=Kr(t,ft(e,n));Gr(t,r)}),Er(t.eventQueue_,e,[])}}(t._repo,t._path,e,n.wrapCallback(()=>{})),n.promise}class ui{constructor(t){this.callbackContext=t}respondsTo(t){return"value"===t}createEvent(t,e){const n=e._queryParams.getIndex();return new ti("value",this,new oi(t.snapshotNode,new ii(e._repo,e._path),n))}getEventRunner(t){return"cancel"===t.getEventType()?()=>this.callbackContext.onCancel(t.error):()=>this.callbackContext.onValue(t.snapshot,null)}createCancelEvent(t,e){return this.callbackContext.hasCancelCallback?new ei(this,t,e):null}matches(t){return t instanceof ui&&(!t.callbackContext||!this.callbackContext||t.callbackContext.matches(this.callbackContext))}hasAnyCallback(){return null!==this.callbackContext}}class di{constructor(t,e){this.eventType=t,this.callbackContext=e}respondsTo(t){let e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,this.eventType===e}createCancelEvent(t,e){return this.callbackContext.hasCancelCallback?new ei(this,t,e):null}createEvent(t,e){Object(o.c)(null!=t.childName,"Child events should have a childName.");const n=si(new ii(e._repo,e._path),t.childName),r=e._queryParams.getIndex();return new ti(t.type,this,new oi(t.snapshotNode,n,r),t.prevName)}getEventRunner(t){return"cancel"===t.getEventType()?()=>this.callbackContext.onCancel(t.error):()=>this.callbackContext.onValue(t.snapshot,t.prevName)}matches(t){return t instanceof di&&(this.eventType===t.eventType&&(!this.callbackContext||!t.callbackContext||this.callbackContext.matches(t.callbackContext)))}hasAnyCallback(){return!!this.callbackContext}}function hi(t,e,n,r,i){let o;if("object"==typeof r&&(o=void 0,i=r),"function"==typeof r&&(o=r),i&&i.onlyOnce){const e=n,r=(n,r)=>{Ur(t._repo,t,s),e(n,r)};r.userCallback=n.userCallback,r.context=n.context,n=r}const a=new ni(n,o||void 0),s="value"===e?new ui(a):new di(e,a);return function(t,e,n){let r;r=".info"===lt(e._path)?Fn(t.infoSyncTree_,e,n):Fn(t.serverSyncTree_,e,n),Or(t.eventQueue_,e._path,r)}(t._repo,t,s),()=>Ur(t._repo,t,s)}function pi(t,e,n,r){return hi(t,"value",e,n,r)}!function(t){Object(o.c)(!Cn,"__referenceConstructor has already been defined"),Cn=t}(ii),function(t){Object(o.c)(!xn,"__referenceConstructor has already been defined"),xn=t}(ii); /** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const fi={};let mi=!1;function vi(e,n,r,i,o){let a=i||e.options.databaseURL;void 0===a&&(e.options.projectId||k("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),w("Using default host for project ",e.options.projectId),a=e.options.projectId+"-default-rtdb.firebaseio.com");let s,l=Jr(a,o),c=l.repoInfo,u=void 0;void 0!==t&&(u=t.env.FIREBASE_DATABASE_EMULATOR_HOST),u?(s=!0,a=`http://${u}?ns=${c.namespace}`,l=Jr(a,o),c=l.repoInfo):s=!l.repoInfo.secure;const d=o&&s?new F(F.OWNER):new z(e.name,e.options,n);kr("Invalid Firebase Database URL",l),mt(l.path)||k("Database URL must point to the root of a Firebase Database (not including a child path).");const h=function(t,e,n,r){let i=fi[e.name];i||(i={},fi[e.name]=i);let o=i[t.toURLString()];o&&k("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return o=new Ar(t,mi,n,r),i[t.toURLString()]=o,o}(c,e,d,new U(e.name,r));return new gi(h,e)}class gi{constructor(t,e){this._repoInternal=t,this.app=e,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(Pr(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new ii(this._repo,st())),this._rootInternal}_delete(){return null!==this._rootInternal&&(!function(t,e){const n=fi[e];n&&n[t.key]===t||k(`Database ${e}(${t.repoInfo_}) has already been deleted.`),zr(t),delete n[t.key]}(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(t){null===this._rootInternal&&k("Cannot call "+t+" on a deleted database.")}}function yi(t=Object(r.e)(),e){return Object(r.b)(t,"database").getImmediate({identifier:e})} /** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class _i{constructor(t,e){this.committed=t,this.snapshot=e}toJSON(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}}}function bi(t,e,n){var r;if(t=Object(o.k)(t),xr("Reference.transaction",t._path),".length"===t.key||".keys"===t.key)throw"Reference.transaction failed: "+t.key+" is a read-only object.";const i=null===(r=null==n?void 0:n.applyLocally)||void 0===r||r,a=new o.a,s=pi(t,()=>{});return function(t,e,n,r,i,a){Fr(t,"transaction on "+e);const s={path:e,update:n,onComplete:r,status:null,order:m(),applyLocally:a,retryCount:0,unwatcher:i,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},l=Hr(t,e,void 0);s.currentInputSnapshot=l;const c=s.update(l.val());if(void 0===c)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{br("transaction failed: Data returned ",c,s.path),s.status=0;const n=sr(t.transactionQueueTree_,e),r=lr(n)||[];let i;if(r.push(s),cr(n,r),"object"==typeof c&&null!==c&&Object(o.g)(c,".priority"))i=Object(o.u)(c,".priority"),Object(o.c)(yr(i),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else{i=(Bn(t.serverSyncTree_,e)||Kt.EMPTY_NODE).getPriority().val()}const a=jr(t),u=Jt(c,i),d=ir(u,l,a);s.currentOutputSnapshotRaw=u,s.currentOutputSnapshotResolved=d,s.currentWriteId=Mr(t);const h=Ln(t.serverSyncTree_,e,d,s.currentWriteId,s.applyLocally);Er(t.eventQueue_,e,h),Wr(t,t.transactionQueueTree_)}}(t._repo,t._path,e,(e,n,r)=>{let i=null;e?a.reject(e):(i=new oi(r,new ii(t._repo,t._path),Ft),a.resolve(new _i(n,i)))},s,i),a.promise} /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */kt.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},kt.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)}; /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var wi; /** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */!function(t){l=t}(r.a),Object(r.c)(new i.a("database",(t,{instanceIdentifier:e})=>vi(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"),t.getProvider("app-check-internal"),e),"PUBLIC").setMultipleInstances(!0)),Object(r.g)(s,"0.12.3",wi),Object(r.g)(s,"0.12.3","esm2017")}).call(this,n(19))},function(t,e){function n(t,e){for(var n=0;n>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e}; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ class i{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch(()=>{}),1===t.length?t(e):t(e,n))}}} /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function o(){return"object"==typeof indexedDB}function a(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var t;e((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(t){e(t)}})}function s(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class l extends Error{constructor(t,e,n){super(e),this.code=t,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,l.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,c.prototype.create)}}class c{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(t,...e){const n=e[0]||{},r=`${this.service}/${t}`,i=this.errors[t],o=i?function(t,e){return t.replace(u,(t,n)=>{const r=e[n];return null!=r?String(r):`<${n}?>`})}(i,n):"Error",a=`${this.serviceName}: ${o} (${r}).`;return new l(r,a,n)}}const u=/\{\$([^}]+)}/g; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function d(t){return t&&t._delegate?t._delegate:t}}).call(this,n(27))},function(t,e,n){(function(e){ /*! * Quill Editor v1.3.7 * https://quilljs.com/ * Copyright (c) 2014, Jason Chen * Copyright (c) 2013, salesforce.com */ var n;"undefined"!=typeof self&&self,n=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=109)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),i=n(18),o=n(19),a=n(45),s=n(46),l=n(47),c=n(48),u=n(49),d=n(12),h=n(32),p=n(33),f=n(31),m=n(1),v={Scope:m.Scope,create:m.create,find:m.find,query:m.query,register:m.register,Container:r.default,Format:i.default,Leaf:o.default,Embed:c.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:u.default,Attributor:{Attribute:d.default,Class:h.default,Style:p.default,Store:f.default}};e.default=v},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(e){var n=this;return e="[Parchment] "+e,(n=t.call(this,e)||this).message=e,n.name=n.constructor.name,n}return i(e,t),e}(Error);e.ParchmentError=o;var a,s={},l={},c={},u={};function d(t,e){var n;if(void 0===e&&(e=a.ANY),"string"==typeof t)n=u[t]||s[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=u.text;else if("number"==typeof t)t&a.LEVEL&a.BLOCK?n=u.block:t&a.LEVEL&a.INLINE&&(n=u.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var i in r)if(n=l[r[i]])break;n=n||c[t.tagName]}return null==n?null:e&a.LEVEL&n.scope&&e&a.TYPE&n.scope?n:null}e.DATA_KEY="__blot",function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(a=e.Scope||(e.Scope={})),e.create=function(t,e){var n=d(t);if(null==n)throw new o("Unable to create "+t+" blot");var r=n,i=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e);return new r(i,e)},e.find=function t(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[e.DATA_KEY]?n[e.DATA_KEY].blot:r?t(n.parentNode,r):null},e.query=d,e.register=function t(){for(var e=[],n=0;n1)return e.map((function(e){return t(e)}));var r=e[0];if("string"!=typeof r.blotName&&"string"!=typeof r.attrName)throw new o("Invalid definition");if("abstract"===r.blotName)throw new o("Cannot register abstract class");if(u[r.blotName||r.attrName]=r,"string"==typeof r.keyName)s[r.keyName]=r;else if(null!=r.className&&(l[r.className]=r),null!=r.tagName){Array.isArray(r.tagName)?r.tagName=r.tagName.map((function(t){return t.toUpperCase()})):r.tagName=r.tagName.toUpperCase();var i=Array.isArray(r.tagName)?r.tagName:[r.tagName];i.forEach((function(t){null!=c[t]&&null!=r.className||(c[t]=r)}))}return r}},function(t,e,n){var r=n(51),i=n(11),o=n(3),a=n(20),s=String.fromCharCode(0),l=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};l.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},l.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},l.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},l.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=o(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(i(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},l.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},l.prototype.filter=function(t){return this.ops.filter(t)},l.prototype.forEach=function(t){this.ops.forEach(t)},l.prototype.map=function(t){return this.ops.map(t)},l.prototype.partition=function(t){var e=[],n=[];return this.forEach((function(r){(t(r)?e:n).push(r)})),[e,n]},l.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},l.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+a.length(e):e.delete?t-e.delete:t}),0)},l.prototype.length=function(){return this.reduce((function(t,e){return t+a.length(e)}),0)},l.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=a.iterator(this.ops),i=0;i0&&n.next(o.retain-s)}for(var c=new l(r);e.hasNext()||n.hasNext();)if("insert"===n.peekType())c.push(n.next());else if("delete"===e.peekType())c.push(e.next());else{var u=Math.min(e.peekLength(),n.peekLength()),d=e.next(u),h=n.next(u);if("number"==typeof h.retain){var p={};"number"==typeof d.retain?p.retain=u:p.insert=d.insert;var f=a.attributes.compose(d.attributes,h.attributes,"number"==typeof d.retain);if(f&&(p.attributes=f),c.push(p),!n.hasNext()&&i(c.ops[c.ops.length-1],p)){var m=new l(e.rest());return c.concat(m).chop()}}else"number"==typeof h.delete&&"number"==typeof d.retain&&c.push(h)}return c.chop()},l.prototype.concat=function(t){var e=new l(this.ops.slice());return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},l.prototype.diff=function(t,e){if(this.ops===t.ops)return new l;var n=[this,t].map((function(e){return e.map((function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(e===t?"on":"with")+" non-document")})).join("")})),o=new l,c=r(n[0],n[1],e),u=a.iterator(this.ops),d=a.iterator(t.ops);return c.forEach((function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(d.peekLength(),e),o.push(d.next(n));break;case r.DELETE:n=Math.min(e,u.peekLength()),u.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),e);var s=u.next(n),l=d.next(n);i(s.insert,l.insert)?o.retain(n,a.attributes.diff(s.attributes,l.attributes)):o.push(l).delete(n)}e-=n}})),o.chop()},l.prototype.eachLine=function(t,e){e=e||"\n";for(var n=a.iterator(this.ops),r=new l,i=0;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),s=a.length(o)-n.peekLength(),c="string"==typeof o.insert?o.insert.indexOf(e,s)-s:-1;if(c<0)r.push(n.next());else if(c>0)r.push(n.next(c));else{if(!1===t(r,n.next(1).attributes||{},i))return;i+=1,r=new l}}r.length()>0&&t(r,{},i)},l.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=a.iterator(this.ops),r=a.iterator(t.ops),i=new l;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())i.push(r.next());else{var o=Math.min(n.peekLength(),r.peekLength()),s=n.next(o),c=r.next(o);if(s.delete)continue;c.delete?i.push(c):i.retain(o,a.attributes.transform(s.attributes,c.attributes,e))}else i.retain(a.length(n.next()));return i.chop()},l.prototype.transformPosition=function(t,e){e=!!e;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var i=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(s.default.Block);function g(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,o.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:g(t.parent,e))}v.blotName="block",v.tagName="P",v.defaultChild="break",v.allowedChildren=[c.default,s.default.Embed,u.default],e.bubbleFormats=g,e.BlockEmbed=m,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var r="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},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(y(this,t),this.options=w(e,r),this.container=this.options.container,null==this.container)return _.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new l.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new h.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(l.default.events.EDITOR_CHANGE,(function(t){t===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())})),this.emitter.on(l.default.events.SCROLL_UPDATE,(function(t,e){var r=n.selection.lastRange,i=r&&0===r.length?r.index:void 0;C.call(n,(function(){return n.editor.update(null,e,i)}),t)}));var o=this.clipboard.convert("
"+i+"


");this.setContents(o),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),f.default.level(t)}},{key:"find",value:function(t){return t.__quill||u.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&_.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var i=t.attrName||t.blotName;"string"==typeof i?this.register("formats/"+i,t,e):Object.keys(t).forEach((function(r){n.register(r,t[r],e)}))}else null==this.imports[t]||r||_.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?u.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),o(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;(t=document.createElement("div")).classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=x(t,e,n),a=i(o,4);return t=a[0],e=a[1],n=a[3],C.call(this,(function(){return r.editor.deleteText(t,e)}),n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;return C.call(this,(function(){var r=n.getSelection(!0),i=new a.default;if(null==r)return i;if(u.default.query(t,u.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,g({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,g({},t,e))}return n.setSelection(r,l.default.sources.SILENT),i}),r)}},{key:"formatLine",value:function(t,e,n,r,o){var a,s=this,l=x(t,e,n,r,o),c=i(l,4);return t=c[0],e=c[1],a=c[2],o=c[3],C.call(this,(function(){return s.editor.formatLine(t,e,a)}),o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var a,s=this,l=x(t,e,n,r,o),c=i(l,4);return t=c[0],e=c[1],a=c[2],o=c[3],C.call(this,(function(){return s.editor.formatText(t,e,a)}),o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=x(t,e),r=i(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=x(t,e),r=i(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return C.call(this,(function(){return i.editor.insertEmbed(e,n,r)}),o,e)}},{key:"insertText",value:function(t,e,n,r,o){var a,s=this,l=x(t,0,n,r,o),c=i(l,4);return t=c[0],a=c[2],o=c[3],C.call(this,(function(){return s.editor.insertText(t,e,a)}),o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=x(t,e,n),a=i(o,4);return t=a[0],e=a[1],n=a[3],C.call(this,(function(){return r.editor.removeFormat(t,e)}),n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return C.call(this,(function(){t=new a.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),i=e.editor.applyDelta(t),o=i.ops[i.ops.length-1];return null!=o&&"string"==typeof o.insert&&"\n"===o.insert[o.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),i.delete(1)),r.compose(i)}),n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=x(e,n,r),a=i(o,4);e=a[0],n=a[1],r=a[3],this.selection.setRange(new d.Range(e,n),r),r!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return C.call(this,(function(){return t=new a.default(t),e.editor.applyDelta(t,n)}),n,!0)}}]),t}();function w(t,e){if((e=(0,p.default)(!0,{container:t,modules:{clipboard:!0,keyboard:!0,history:!0}},e)).theme&&e.theme!==b.DEFAULTS.theme){if(e.theme=b.import("themes/"+e.theme),null==e.theme)throw new Error("Invalid theme "+e.theme+". Did you register it?")}else e.theme=m.default;var n=(0,p.default)(!0,{},e.theme.DEFAULTS);[n,e].forEach((function(t){t.modules=t.modules||{},Object.keys(t.modules).forEach((function(e){!0===t.modules[e]&&(t.modules[e]={})}))}));var r=Object.keys(n.modules).concat(Object.keys(e.modules)).reduce((function(t,e){var n=b.import("modules/"+e);return null==n?_.error("Cannot load "+e+" module. Are you sure you registered it?"):t[e]=n.DEFAULTS||{},t}),{});return null!=e.modules&&e.modules.toolbar&&e.modules.toolbar.constructor!==Object&&(e.modules.toolbar={container:e.modules.toolbar}),e=(0,p.default)(!0,{},b.DEFAULTS,{modules:r},n,e),["bounds","container","scrollingContainer"].forEach((function(t){"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))})),e.modules=Object.keys(e.modules).reduce((function(t,n){return e.modules[n]&&(t[n]=e.modules[n]),t}),{}),e}function C(t,e,n,r){if(this.options.strict&&!this.isEnabled()&&e===l.default.sources.USER)return new a.default;var i=null==n?null:this.getSelection(),o=this.editor.delta,s=t();if(null!=i&&(!0===n&&(n=i.index),null==r?i=k(i,s,e):0!==r&&(i=k(i,n,r,e)),this.setSelection(i,l.default.sources.SILENT)),s.length()>0){var c,u,d=[l.default.events.TEXT_CHANGE,s,o,e];(c=this.emitter).emit.apply(c,[l.default.events.EDITOR_CHANGE].concat(d)),e!==l.default.sources.SILENT&&(u=this.emitter).emit.apply(u,d)}return s}function x(t,e,n,i,o){var a={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=i,i=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=i,i=n,n=e,e=0),"object"===(void 0===n?"undefined":r(n))?(a=n,o=i):"string"==typeof n&&(null!=i?a[n]=i:o=n),[t,e,a,o=o||l.default.sources.API]}function k(t,e,n,r){if(null==t)return null;var o=void 0,s=void 0;if(e instanceof a.default){var c=[t.index,t.index+t.length].map((function(t){return e.transformPosition(t,r!==l.default.sources.USER)})),u=i(c,2);o=u[0],s=u[1]}else{var h=[t.index,t.index+t.length].map((function(t){return t=0?t+n:Math.max(e,t+n)})),p=i(h,2);o=p[0],s=p[1]}return new d.Range(o,s-o)}b.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},b.events=l.default.events,b.sources=l.default.sources,b.version="1.3.7",b.imports={delta:a.default,parchment:u.default,"core/module":c.default,"core/theme":m.default},e.expandConfig=w,e.overload=x,e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),i=e.order.indexOf(n);return r>=0||i>=0?r-i:t===n?0:t1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};i.DEFAULTS={},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=["error","warn","log","info"],i="warn";function o(t){if(r.indexOf(t)<=r.indexOf(i)){for(var e,n=arguments.length,o=Array(n>1?n-1:0),a=1;a=0;c--)if(d[c]!=h[c])return!1;for(c=d.length-1;c>=0;c--)if(u=d[c],!a(t[u],e[u],n))return!1;return typeof t==typeof e}(t,e,n))};function s(t){return null==t}function l(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length||"function"!=typeof t.copy||"function"!=typeof t.slice||t.length>0&&"number"!=typeof t[0])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(){function t(t,e,n){void 0===n&&(n={}),this.attrName=t,this.keyName=e;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return t.keys=function(t){return[].map.call(t.attributes,(function(t){return t.name}))},t.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)},t.prototype.canAdd=function(t,e){return null!=r.query(t,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n=t+n)){var a=this.newlineIndex(t,!0)+1,l=o-a+1,c=this.isolate(a,l),u=c.next;c.format(r,i),u instanceof e&&u.formatAt(0,t-a+n-l,r,i)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var i=this.descendant(u.default,t),o=r(i,2),a=o[0],s=o[1];a.insertAt(s,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var n=this.domNode.textContent.slice(t).indexOf("\n");return n>-1?t+n:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach((function(t){var e=s.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof s.default.Embed?e.remove():e.unwrap()}))}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(l.default);v.blotName="code-block",v.tagName="PRE",v.TAB=" ",e.Code=m,e.default=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="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},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n=o&&!p.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,p);var f=e.scroll.line(t),m=i(f,2),g=m[0],y=m[1],_=(0,v.default)({},(0,d.bubbleFormats)(g));if(g instanceof h.default){var b=g.descendant(l.default.Leaf,y),w=i(b,1)[0];_=(0,v.default)(_,(0,d.bubbleFormats)(w))}u=s.default.attributes.diff(_,u)||{}}else if("object"===r(a.insert)){var C=Object.keys(a.insert)[0];if(null==C)return t;e.scroll.insertAt(t,C,a.insert[C])}o+=c}return Object.keys(u).forEach((function(n){e.scroll.formatAt(t,c,n,u[n])})),t+c}),0),t.reduce((function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)}),0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new a.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach((function(i){if(null==n.scroll.whitelist||n.scroll.whitelist[i]){var o=n.scroll.lines(t,Math.max(e,1)),a=e;o.forEach((function(e){var o=e.length();if(e instanceof c.default){var s=t-e.offset(n.scroll),l=e.newlineIndex(s+a)-s+1;e.formatAt(s,l,i,r[i])}else e.format(i,r[i]);a-=o}))}})),this.scroll.optimize(),this.update((new a.default).retain(t).retain(e,(0,f.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach((function(i){n.scroll.formatAt(t,e,i,r[i])})),this.update((new a.default).retain(t).retain(e,(0,f.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce((function(t,e){return t.concat(e.delta())}),new a.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach((function(t){var e=i(t,1)[0];e instanceof h.default?n.push(e):e instanceof l.default.Leaf&&r.push(e)})):(n=this.scroll.lines(t,e),r=this.scroll.descendants(l.default.Leaf,t,e));var o=[n,r].map((function(t){if(0===t.length)return{};for(var e=(0,d.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=b((0,d.bubbleFormats)(n),e)}return e}));return v.default.apply(v.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter((function(t){return"string"==typeof t.insert})).map((function(t){return t.insert})).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new a.default).retain(t).insert(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach((function(i){n.scroll.formatAt(t,e.length,i,r[i])})),this.update((new a.default).retain(t).insert(e,(0,f.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===h.default.blotName&&!(t.children.length>1)&&t.children.head instanceof p.default}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=i(r,2),s=o[0],l=o[1],u=0,d=new a.default;null!=s&&(u=s instanceof c.default?s.newlineIndex(l)-l+1:s.length()-l,d=s.delta().slice(l,l+u-1).insert("\n"));var h=this.getContents(t,e+u).diff((new a.default).insert(n).concat(d)),p=(new a.default).retain(t).concat(h);return this.applyDelta(p)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(y)&&l.default.find(e[0].target)){var i=l.default.find(e[0].target),o=(0,d.bubbleFormats)(i),s=i.offset(this.scroll),c=e[0].oldValue.replace(u.default.CONTENTS,""),h=(new a.default).insert(c),p=(new a.default).insert(i.value()),f=(new a.default).retain(s).concat(h.diff(p,n));t=f.reduce((function(t,e){return e.insert?t.insert(e.insert,o):t.push(e)}),new a.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,m.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();function b(t,e){return Object.keys(e).reduce((function(n,r){return null==t[r]||(e[r]===t[r]?n[r]=e[r]:Array.isArray(e[r])?e[r].indexOf(t[r])<0&&(n[r]=e[r].concat([t[r]])):n[r]=[e[r],t[r]]),n}),{})}e.default=_},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Range=void 0;var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;d(this,t),this.index=e,this.length=n},f=function(){function t(e,n){var r=this;d(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=o.default.create("cursor",this),this.lastRange=this.savedRange=new p(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(function(){r.mouseDown||setTimeout(r.update.bind(r,l.default.sources.USER),1)})),this.emitter.on(l.default.events.EDITOR_CHANGE,(function(t,e){t===l.default.events.TEXT_CHANGE&&e.length()>0&&r.update(l.default.sources.SILENT)})),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,(function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(l.default.events.SCROLL_UPDATE,(function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}}))}})),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,(function(t,e){if(e.range){var n=e.range,i=n.startNode,o=n.startOffset,a=n.endNode,s=n.endOffset;r.setNativeRange(i,o,a,s)}})),this.update(l.default.sources.SILENT)}return i(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",(function(){t.composing=!0})),this.root.addEventListener("compositionend",(function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout((function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,(function(){t.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(function(){t.mouseDown=!1,t.update(l.default.sources.USER)}))}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!o.default.query(t,o.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=o.default.find(n.start.node,!1);if(null==r)return;if(r instanceof o.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var i=void 0,o=this.scroll.leaf(t),a=r(o,2),s=a[0],l=a[1];if(null==s)return null;var c=s.position(l,!0),u=r(c,2);i=u[0],l=u[1];var d=document.createRange();if(e>0){d.setStart(i,l);var h=this.scroll.leaf(t+e),p=r(h,2);if(s=p[0],l=p[1],null==s)return null;var f=s.position(l,!0),m=r(f,2);return i=m[0],l=m[1],d.setEnd(i,l),d.getBoundingClientRect()}var v="left",g=void 0;return i instanceof Text?(l0&&(v="right")),{bottom:g.top+g.height,height:g.height,left:g[v],right:g[v],top:g.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return h.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var i=n.map((function(t){var n=r(t,2),i=n[0],a=n[1],s=o.default.find(i,!0),l=s.offset(e.scroll);return 0===a?l:s instanceof o.default.Container?l+s.length():l+s.index(i,a)})),a=Math.min(Math.max.apply(Math,u(i)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(u(i)));return new p(s,a-s)}},{key:"normalizeNative",value:function(t){if(!m(this.root,t.startContainer)||!t.collapsed&&!m(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach((function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;n=(e=e.lastChild)instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n})),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],i=[],o=this.scroll.length();return n.forEach((function(t,n){t=Math.min(o-1,t);var a,s=e.scroll.leaf(t),l=r(s,2),c=l[0],u=l[1],d=c.position(u,0!==n),h=r(d,2);a=h[0],u=h[1],i.push(a,u)})),i.length<2&&(i=i.concat(i)),i}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var i=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,i)),a=r(o,1)[0],s=a;if(e.length>0){var l=this.scroll.line(Math.min(e.index+e.length,i));s=r(l,1)[0]}if(null!=a&&null!=s){var c=t.getBoundingClientRect();n.topc.bottom&&(t.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(h.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var o=document.getSelection();if(null!=o)if(null!=t){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||i||t!==a.startContainer||e!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(t,e),s.setEnd(n,r),o.removeAllRanges(),o.addRange(s)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"==typeof e&&(n=e,e=!1),h.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,u(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,e=this.lastRange,n=this.getRange(),i=r(n,2),o=i[0],c=i[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(e,this.lastRange)){var u;!this.composing&&null!=c&&c.native.collapsed&&c.start.node!==this.cursor.textNode&&this.cursor.restore();var d,h=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(e),t];(u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(h)),t!==l.default.sources.SILENT&&(d=this.emitter).emit.apply(d,h)}}}]),t}();function m(t,e){try{e.parentNode}catch(t){return!1}return e instanceof Text&&(e=e.parentNode),t.contains(e)}e.Range=p,e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){var t;return(t={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,t},e.scope=a.Scope.INLINE_BLOT,e}(o.default);e.default=s},function(t,e,n){var r=n(11),i=n(3),o={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=i(!0,{},e);for(var o in n||(r=Object.keys(r).reduce((function(t,e){return null!=r[e]&&(t[e]=r[e]),t}),{})),t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce((function(n,i){return r(t[i],e[i])||(n[i]=void 0===e[i]?null:e[i]),n}),{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce((function(n,r){return void 0===t[r]&&(n[r]=e[r]),n}),{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new a(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};function a(t){this.ops=t,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=o.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var i={};return e.attributes&&(i.attributes=e.attributes),"number"==typeof e.retain?i.retain=t:"string"==typeof e.insert?i.insert=e.insert.substr(n,t):i.insert=e.insert,i}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)}return[]},t.exports=o},function(t,n){var r=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,i;try{n=Map}catch(t){n=function(){}}try{r=Set}catch(t){r=function(){}}try{i=Promise}catch(t){i=function(){}}function o(a,l,c,u,d){"object"==typeof l&&(c=l.depth,u=l.prototype,d=l.includeNonEnumerable,l=l.circular);var h=[],p=[],f=void 0!==e;return void 0===l&&(l=!0),void 0===c&&(c=1/0),function a(c,m){if(null===c)return null;if(0===m)return c;var v,g;if("object"!=typeof c)return c;if(t(c,n))v=new n;else if(t(c,r))v=new r;else if(t(c,i))v=new i((function(t,e){c.then((function(e){t(a(e,m-1))}),(function(t){e(a(t,m-1))}))}));else if(o.__isArray(c))v=[];else if(o.__isRegExp(c))v=new RegExp(c.source,s(c)),c.lastIndex&&(v.lastIndex=c.lastIndex);else if(o.__isDate(c))v=new Date(c.getTime());else{if(f&&e.isBuffer(c))return v=e.allocUnsafe?e.allocUnsafe(c.length):new e(c.length),c.copy(v),v;t(c,Error)?v=Object.create(c):void 0===u?(g=Object.getPrototypeOf(c),v=Object.create(g)):(v=Object.create(u),g=u)}if(l){var y=h.indexOf(c);if(-1!=y)return p[y];h.push(c),p.push(v)}for(var _ in t(c,n)&&c.forEach((function(t,e){var n=a(e,m-1),r=a(t,m-1);v.set(n,r)})),t(c,r)&&c.forEach((function(t){var e=a(t,m-1);v.add(e)})),c){var b;g&&(b=Object.getOwnPropertyDescriptor(g,_)),b&&null==b.set||(v[_]=a(c[_],m-1))}if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(c);for(_=0;_0){if(s instanceof l.BlockEmbed||p instanceof l.BlockEmbed)return void this.optimize();if(s instanceof d.default){var f=s.newlineIndex(s.length(),!0);if(f>-1&&(s=s.split(f+1))===p)return void this.optimize()}else if(p instanceof d.default){var m=p.newlineIndex(0);m>-1&&p.split(m+1)}var v=p.children.head instanceof u.default?null:p.children.head;s.moveChildren(p,v),s.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,i){(null==this.whitelist||this.whitelist[r])&&(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,i),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var i=a.default.create(this.statics.defaultChild);this.appendChild(i),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var s=a.default.create(n,r);this.appendChild(s)}else o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(t),t=r}o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(f,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE,n=function t(e,n,r){var i=[],o=r;return e.children.forEachAt(n,r,(function(e,n,r){f(e)?i.push(e):e instanceof a.default.Container&&(i=i.concat(t(e,n,o))),o-=r})),i};return n(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=s.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,t),o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,t)}}}]),e}(a.default.Scroll);m.blotName="scroll",m.className="ql-editor",m.tagName="DIV",m.defaultChild="block",m.allowedChildren=[c.default,l.BlockEmbed,h.default],e.default=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var r="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},i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=O(t);if(null==r||null==r.key)return g.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,l.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",(function(n){if(!n.defaultPrevented){var o=n.which||n.keyCode,a=(t.bindings[o]||[]).filter((function(t){return e.match(n,t)}));if(0!==a.length){var l=t.quill.getSelection();if(null!=l&&t.quill.hasFocus()){var c=t.quill.getLine(l.index),u=i(c,2),h=u[0],p=u[1],f=t.quill.getLeaf(l.index),m=i(f,2),v=m[0],g=m[1],y=0===l.length?[v,g]:t.quill.getLeaf(l.index+l.length),_=i(y,2),b=_[0],w=_[1],C=v instanceof d.default.Text?v.value().slice(0,g):"",x=b instanceof d.default.Text?b.value().slice(w):"",k={collapsed:0===l.length,empty:0===l.length&&h.length()<=1,format:t.quill.getFormat(l),offset:p,prefix:C,suffix:x};a.some((function(e){if(null!=e.collapsed&&e.collapsed!==k.collapsed)return!1;if(null!=e.empty&&e.empty!==k.empty)return!1;if(null!=e.offset&&e.offset!==k.offset)return!1;if(Array.isArray(e.format)){if(e.format.every((function(t){return null==k.format[t]})))return!1}else if("object"===r(e.format)&&!Object.keys(e.format).every((function(t){return!0===e.format[t]?null!=k.format[t]:!1===e.format[t]?null==k.format[t]:(0,s.default)(e.format[t],k.format[t])})))return!1;return!(null!=e.prefix&&!e.prefix.test(k.prefix)||null!=e.suffix&&!e.suffix.test(k.suffix)||!0===e.handler.call(t,l,k))}))&&n.preventDefault()}}}}))}}]),e}(f.default);function b(t,e){var n,r=t===_.keys.LEFT?"prefix":"suffix";return v(n={key:t,shiftKey:e,altKey:null},r,/^$/),v(n,"handler",(function(n){var r=n.index;t===_.keys.RIGHT&&(r+=n.length+1);var o=this.quill.getLeaf(r);return!(i(o,1)[0]instanceof d.default.Embed&&(t===_.keys.LEFT?e?this.quill.setSelection(n.index-1,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index-1,h.default.sources.USER):e?this.quill.setSelection(n.index,n.length+1,h.default.sources.USER):this.quill.setSelection(n.index+n.length+1,h.default.sources.USER),1))})),n}function w(t,e){if(!(0===t.index||this.quill.getLength()<=1)){var n=this.quill.getLine(t.index),r=i(n,1)[0],o={};if(0===e.offset){var a=this.quill.getLine(t.index-1),s=i(a,1)[0];if(null!=s&&s.length()>1){var l=r.formats(),c=this.quill.getFormat(t.index-1,1);o=u.default.attributes.diff(l,c)||{}}}var d=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-d,d,h.default.sources.USER),Object.keys(o).length>0&&this.quill.formatLine(t.index-d,d,o,h.default.sources.USER),this.quill.focus()}}function C(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},o=0,a=this.quill.getLine(t.index),s=i(a,1)[0];if(e.offset>=s.length()-1){var l=this.quill.getLine(t.index+1),c=i(l,1)[0];if(c){var d=s.formats(),p=this.quill.getFormat(t.index,1);r=u.default.attributes.diff(d,p)||{},o=c.length()}}this.quill.deleteText(t.index,n,h.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+o-1,n,r,h.default.sources.USER)}}function x(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),i=e[e.length-1].formats();n=u.default.attributes.diff(i,r)||{}}this.quill.deleteText(t,h.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,h.default.sources.USER),this.quill.setSelection(t.index,h.default.sources.SILENT),this.quill.focus()}function k(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce((function(t,n){return d.default.query(n,d.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t}),{});this.quill.insertText(t.index,"\n",r,h.default.sources.USER),this.quill.setSelection(t.index+1,h.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach((function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],h.default.sources.USER))}))}function S(t){return{key:_.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=d.default.query("code-block"),r=e.index,o=e.length,a=this.quill.scroll.descendant(n,r),s=i(a,2),l=s[0],c=s[1];if(null!=l){var u=this.quill.getIndex(l),p=l.newlineIndex(c,!0)+1,f=l.newlineIndex(u+c+o),m=l.domNode.textContent.slice(p,f).split("\n");c=0,m.forEach((function(e,i){t?(l.insertAt(p+c,n.TAB),c+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(l.deleteAt(p+c,n.TAB.length),c-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),c+=e.length+1})),this.quill.update(h.default.sources.USER),this.quill.setSelection(r,o,h.default.sources.SILENT)}}}}function T(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],h.default.sources.USER)}}}function O(t){if("string"==typeof t||"number"==typeof t)return O({key:t});if("object"===(void 0===t?"undefined":r(t))&&(t=(0,a.default)(t,!1)),"string"==typeof t.key)if(null!=_.keys[t.key.toUpperCase()])t.key=_.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[y]=t.shortKey,delete t.shortKey),t}_.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},_.DEFAULTS={bindings:{bold:T("bold"),italic:T("italic"),underline:T("underline"),indent:{key:_.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",h.default.sources.USER)}},outdent:{key:_.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",h.default.sources.USER)}},"outdent backspace":{key:_.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",h.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,h.default.sources.USER)}},"indent code-block":S(!0),"outdent code-block":S(!1),"remove tab":{key:_.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,h.default.sources.USER)}},tab:{key:_.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new c.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,h.default.sources.SILENT)}},"list empty enter":{key:_.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,h.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,h.default.sources.USER)}},"checklist enter":{key:_.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=i(e,2),r=n[0],o=n[1],a=(0,l.default)({},r.formats(),{list:"checked"}),s=(new c.default).retain(t.index).insert("\n",a).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,h.default.sources.USER),this.quill.setSelection(t.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:_.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=i(n,2),o=r[0],a=r[1],s=(new c.default).retain(t.index).insert("\n",e.format).retain(o.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,h.default.sources.USER),this.quill.setSelection(t.index+1,h.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),o=i(r,2),a=o[0],s=o[1];if(s>n)return!0;var l=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(t.index," ",h.default.sources.USER),this.quill.history.cutoff();var u=(new c.default).retain(t.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(u,h.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,h.default.sources.SILENT)}},"code exit":{key:_.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=i(e,2),r=n[0],o=n[1],a=(new c.default).retain(t.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,h.default.sources.USER)}},"embed left":b(_.keys.LEFT,!1),"embed left shift":b(_.keys.LEFT,!0),"embed right":b(_.keys.RIGHT,!1),"embed right shift":b(_.keys.RIGHT,!0)}},e.default=_,e.SHORTKEY=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n-1}c.blotName="link",c.tagName="A",c.SANITIZED_URL="about:blank",c.PROTOCOL_WHITELIST=["http","https","mailto","tel"],e.default=c,e.sanitize=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r="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},i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":r(Event))){var i=document.createEvent("Event");i.initEvent("change",!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=g(n(0)),i=g(n(5)),o=n(4),a=g(o),s=g(n(16)),l=g(n(25)),c=g(n(24)),u=g(n(35)),d=g(n(6)),h=g(n(22)),p=g(n(7)),f=g(n(55)),m=g(n(42)),v=g(n(23));function g(t){return t&&t.__esModule?t:{default:t}}i.default.register({"blots/block":a.default,"blots/block/embed":o.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":c.default,"blots/embed":u.default,"blots/inline":d.default,"blots/scroll":h.default,"blots/text":p.default,"modules/clipboard":f.default,"modules/history":m.default,"modules/keyboard":v.default}),r.default.register(a.default,s.default,c.default,d.default,h.default,p.default),e.default=i.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(){function t(t){this.domNode=t,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(t.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),t.create=function(t){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t).toString()===t&&(t=parseInt(t))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,i){var o=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);o.wrap(a),a.format(n,i)}},t.prototype.insertAt=function(t,e,n){var i=null==n?r.create("text",e):r.create(e,n),o=this.split(t);this.parent.insertBefore(i,o)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),this.domNode.parentNode==t.domNode&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=n(32),o=n(33),a=n(1),s=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=i.default.keys(this.domNode),s=o.default.keys(this.domNode);e.concat(n).concat(s).forEach((function(e){var n=a.query(e,a.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)}))},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach((function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)}))},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach((function(t){e.attributes[t].remove(e.domNode)})),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce((function(e,n){return e[n]=t.attributes[n].value(t.domNode),e}),{})},t}();e.default=s},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter((function(t){return 0===t.indexOf(e+"-")}))}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map((function(t){return t.split("-").slice(0,-1).join("-")}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){o(t,this.keyName).forEach((function(e){t.classList.remove(e)})),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=(o(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function o(t){var e=t.split("-"),n=e.slice(1).map((function(t){return t[0].toUpperCase()+t.slice(1)})).join("");return e[0]+n}Object.defineProperty(e,"__esModule",{value:!0});var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map((function(t){return t.split(":")[0].trim()}))},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[o(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[o(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[o(this.keyName)];return this.canAdd(t,e)?e:""},e}(n(12).default);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),t=i.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})),this.stack.redo.forEach((function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}))}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(a(n(9)).default);function l(t){var e=t.reduce((function(t,e){return t+=e.delete||0}),0),n=t.length()-e;return function(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some((function(t){return null!=i.default.query(t,i.default.Scope.BLOCK)})))}(t)&&(n-=1),n}s.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=s,e.getLastChangeIndex=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t,e,n=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var r=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",n,a.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",n,a.default.sources.USER)),this.quill.root.scrollTop=r;break;case"video":e=(t=n).match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/),n=e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t;case"formula":if(!n)break;var i=this.quill.getSelection(!0);if(null!=i){var o=i.index+i.length;this.quill.insertEmbed(o,this.root.getAttribute("data-mode"),n,a.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(o+1," ",a.default.sources.USER),this.quill.setSelection(o+2,a.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}(h.default);function k(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach((function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)}))}e.BaseTooltip=x,e.default=C},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(ta?n(r,t-a,Math.min(e,a+l-t)):n(r,0,Math.min(l,t+e-a)),a+=l}},t.prototype.map=function(t){return this.reduce((function(e,n){return e.push(t(n)),e}),[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),a=n(1),s={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},l=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver((function(t){n.update(t)})),n.observer.observe(n.domNode,s),n.attach(),n}return i(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach((function(t){t.remove()})):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,i){this.update(),t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var i=[].slice.call(this.observer.takeRecords());i.length>0;)e.push(i.pop());for(var s=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[a.DATA_KEY].mutations&&(t.domNode[a.DATA_KEY].mutations=[]),e&&s(t.parent))},l=function(t){null!=t.domNode[a.DATA_KEY]&&null!=t.domNode[a.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(l),t.optimize(n))},c=e,u=0;c.length>0;u+=1){if(u>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(c.forEach((function(t){var e=a.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(s(a.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,(function(t){var e=a.find(t,!1);s(e,!1),e instanceof o.default&&e.children.forEach((function(t){s(t,!1)}))}))):"attributes"===t.type&&s(e.prev)),s(e))})),this.children.forEach(l),i=(c=[].slice.call(this.observer.takeRecords())).slice();i.length>0;)e.push(i.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),(e=e||this.observer.takeRecords()).map((function(t){var e=a.find(t.target,!0);return null==e?null:null==e.domNode[a.DATA_KEY].mutations?(e.domNode[a.DATA_KEY].mutations=[t],e):(e.domNode[a.DATA_KEY].mutations.push(t),null)})).forEach((function(t){null!=t&&t!==r&&null!=t.domNode[a.DATA_KEY]&&t.update(t.domNode[a.DATA_KEY].mutations||[],n)})),null!=this.domNode[a.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[a.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=l},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var i=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach((function(t){t instanceof o.default||(t=t.wrap(e.blotName,!0)),i.attributes.copy(t)})),this.unwrap())},e.prototype.formatAt=function(e,n,r,i){null!=this.formats()[r]||a.query(r,a.Scope.ATTRIBUTE)?this.isolate(e,n).format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=a.Scope.INLINE_BLOT,e.tagName="SPAN",e}(o.default);e.default=s},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),a=n(1),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(n){var r=a.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=a.query(n,a.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,i){null!=a.query(r,a.Scope.BLOCK)?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=a.query(n,a.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var i=this.split(e),o=a.create(n,r);i.parent.insertBefore(o,i)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=a.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=s},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,i){0===e&&n===this.length()?this.format(r,i):t.prototype.formatAt.call(this,e,n,r,i)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(n(19).default);e.default=o},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return i(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=a.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some((function(t){return"characterData"===t.type&&t.target===n.domNode}))&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=a.Scope.INLINE_BLOT,e}(o.default);e.default=s},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:i.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;oe.length?t:e,l=t.length>e.length?e:t,c=s.indexOf(l);if(-1!=c)return a=[[1,s.substring(0,c)],[0,l],[1,s.substring(c+l.length)]],t.length>e.length&&(a[0][0]=a[2][0]=-1),a;if(1==l.length)return[[-1,t],[1,e]];var u=function(t,e){var n=t.length>e.length?t:e,r=t.length>e.length?e:t;if(n.length<4||2*r.length=t.length?[r,a,s,l,d]:null}var s,l,c,u,d,h=a(n,r,Math.ceil(n.length/4)),p=a(n,r,Math.ceil(n.length/2));if(!h&&!p)return null;s=p?h&&h[4].length>p[4].length?h:p:h,t.length>e.length?(l=s[0],c=s[1],u=s[2],d=s[3]):(u=s[0],d=s[1],l=s[2],c=s[3]);var f=s[4];return[l,c,u,d,f]}(t,e);if(u){var d=u[0],h=u[1],p=u[2],f=u[3],m=u[4],v=n(d,p),g=n(h,f);return v.concat([[0,m]],g)}return function(t,e){for(var n=t.length,i=e.length,o=Math.ceil((n+i)/2),a=o,s=2*o,l=new Array(s),c=new Array(s),u=0;un)f+=2;else if(b>i)p+=2;else if(h&&(x=a+d-y)>=0&&x=w)return r(t,e,S,b)}}for(var C=-g+m;C<=g-v;C+=2){for(var x=a+C,k=(w=C==-g||C!=g&&c[x-1]n)v+=2;else if(k>i)m+=2;else if(!h&&(_=a+d-C)>=0&&_=(w=n-w))return r(t,e,S,b)}}}return[[-1,t],[1,e]]}(t,e)}(t=t.substring(0,t.length-l),e=e.substring(0,e.length-l));return c&&d.unshift([0,c]),u&&d.push([0,u]),function t(e){e.push([0,""]);for(var n,r=0,a=0,s=0,l="",c="";r1?(0!==a&&0!==s&&(0!==(n=i(c,l))&&(r-a-s>0&&0==e[r-a-s-1][0]?e[r-a-s-1][1]+=c.substring(0,n):(e.splice(0,0,[0,c.substring(0,n)]),r++),c=c.substring(n),l=l.substring(n)),0!==(n=o(c,l))&&(e[r][1]=c.substring(c.length-n)+e[r][1],c=c.substring(0,c.length-n),l=l.substring(0,l.length-n))),0===a?e.splice(r-s,a+s,[1,c]):0===s?e.splice(r-a,a+s,[-1,l]):e.splice(r-a-s,a+s,[-1,l],[1,c]),r=r-a-s+(a?1:0)+(s?1:0)+1):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,s=0,a=0,l="",c=""}""===e[e.length-1][1]&&e.pop();var u=!1;for(r=1;r0&&r.splice(i+2,0,[a[0],l]),s(r,i,3)}return t}(d,a)),d=function(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r=55296&&i.charCodeAt(i.length-1)<=56319&&-1===t[r-1][0]&&n(t[r-1][1])&&1===t[r][0]&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));var i;if(!e)return t;var o=[];for(r=0;r0&&o.push(t[r]);return o}(d)}function r(t,e,r,i){var o=t.substring(0,r),a=e.substring(0,i),s=t.substring(r),l=e.substring(i),c=n(o,a),u=n(s,l);return c.concat(u)}function i(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),i=r,o=0;n=0&&r>=e-1;r--)if(r+1=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=O(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new s.default).insert("\t").concat(e)),e}],["li",function(t,e){var n=l.default.query(t);if(null==n||"list-item"!==n.blotName||!I(e,"\n"))return e;for(var r=-1,i=t.parentNode;!i.classList.contains("ql-clipboard");)"list"===(l.default.query(i)||{}).blotName&&(r+=1),i=i.parentNode;return r<=0?e:e.compose((new s.default).retain(e.length()-1).retain(1,{indent:r}))}],["b",A.bind(A,"bold")],["i",A.bind(A,"italic")],["style",function(){return new s.default}]],k=[h.AlignAttribute,v.DirectionAttribute].reduce((function(t,e){return t[e.keyName]=e,t}),{}),S=[h.AlignStyle,p.BackgroundStyle,m.ColorStyle,v.DirectionStyle,g.FontStyle,y.SizeStyle].reduce((function(t,e){return t[e.keyName]=e,t}),{}),T=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],x.concat(r.options.matchers).forEach((function(t){var e=i(t,2),o=e[0],a=e[1];(n.matchVisual||a!==R)&&r.addMatcher(o,a)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),o(e,[{key:"addMatcher",value:function(t,e){this.matchers.push([t,e])}},{key:"convert",value:function(t){if("string"==typeof t)return this.container.innerHTML=t.replace(/\>\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[f.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,b({},f.default.blotName,e[f.default.blotName]))}var r=this.prepareMatching(),o=i(r,2),a=o[0],l=o[1],c=function t(e,n,r){return e.nodeType===e.TEXT_NODE?r.reduce((function(t,n){return n(e,t)}),new s.default):e.nodeType===e.ELEMENT_NODE?[].reduce.call(e.childNodes||[],(function(i,o){var a=t(o,n,r);return o.nodeType===e.ELEMENT_NODE&&(a=n.reduce((function(t,e){return e(o,t)}),a),a=(o[C]||[]).reduce((function(t,e){return e(o,t)}),a)),i.concat(a)}),new s.default):new s.default}(this.container,a,l);return I(c,"\n")&&null==c.ops[c.ops.length-1].attributes&&(c=c.compose((new s.default).retain(c.length()-1).delete(1))),w.log("convert",this.container.innerHTML,c),this.container.innerHTML="",c}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,c.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new s.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),c.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new s.default).retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(c.default.sources.SILENT),setTimeout((function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,c.default.sources.USER),e.quill.setSelection(r.length()-n.length,c.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=i,e.quill.focus()}),1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach((function(r){var o=i(r,2),a=o[0],s=o[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:e.push(s);break;default:[].forEach.call(t.container.querySelectorAll(a),(function(t){t[C]=t[C]||[],t[C].push(s)}))}})),[e,n]}}]),e}(d.default);function O(t,e,n){return"object"===(void 0===e?"undefined":r(e))?Object.keys(e).reduce((function(t,n){return O(t,n,e[n])}),t):t.reduce((function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,a.default)({},b({},e,n),r.attributes))}),new s.default)}function E(t){return t.nodeType!==Node.ELEMENT_NODE?{}:t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function I(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function A(t,e,n){return O(n,t,!0)}function P(t,e){var n=l.default.Attributor.Attribute.keys(t),r=l.default.Attributor.Class.keys(t),i=l.default.Attributor.Style.keys(t),o={};return n.concat(r).concat(i).forEach((function(e){var n=l.default.query(e,l.default.Scope.ATTRIBUTE);null!=n&&(o[n.attrName]=n.value(t),o[n.attrName])||(null==(n=k[e])||n.attrName!==e&&n.keyName!==e||(o[n.attrName]=n.value(t)||void 0),null==(n=S[e])||n.attrName!==e&&n.keyName!==e||(n=S[e],o[n.attrName]=n.value(t)||void 0))})),Object.keys(o).length>0&&(e=O(e,o)),e}function q(t,e){var n=l.default.query(t);if(null==n)return e;if(n.prototype instanceof l.default.Embed){var r={},i=n.value(t);null!=i&&(r[n.blotName]=i,e=(new s.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=O(e,n.blotName,n.formats(t)));return e}function j(t,e){return I(e,"\n")||(N(t)||e.length()>0&&t.nextSibling&&N(t.nextSibling))&&e.insert("\n"),e}function R(t,e){if(N(t)&&null!=t.nextElementSibling&&!I(e,"\n\n")){var n=t.offsetHeight+parseFloat(E(t).marginTop)+parseFloat(E(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function D(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!E(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return(e=e.replace(/[^\u00a0]/g,"")).length<1&&t?" ":e};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&N(t.parentNode)||null!=t.previousSibling&&N(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&N(t.parentNode)||null!=t.nextSibling&&N(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}T.DEFAULTS={matchers:[],matchVisual:!0},e.default=T,e.matchAttributor=P,e.matchBlot=q,e.matchNewline=j,e.matchSpacing=R,e.matchText=D},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;nr.right&&(o=r.right-i.right,this.root.style.left=e+o+"px"),i.leftr.bottom){var a=i.bottom-i.top,s=t.bottom-t.top+a;this.root.style.top=n-s+"px",this.root.classList.add("ql-flip")}return o}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=R(n(29)),i=n(36),o=n(38),a=n(64),s=R(n(65)),l=R(n(66)),c=n(67),u=R(c),d=n(37),h=n(26),p=n(39),f=n(40),m=R(n(56)),v=R(n(68)),g=R(n(27)),y=R(n(69)),_=R(n(70)),b=R(n(71)),w=R(n(72)),C=R(n(73)),x=n(13),k=R(x),S=R(n(74)),T=R(n(75)),O=R(n(57)),E=R(n(41)),I=R(n(28)),N=R(n(59)),A=R(n(60)),P=R(n(61)),q=R(n(108)),j=R(n(62));function R(t){return t&&t.__esModule?t:{default:t}}r.default.register({"attributors/attribute/direction":o.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":d.BackgroundClass,"attributors/class/color":h.ColorClass,"attributors/class/direction":o.DirectionClass,"attributors/class/font":p.FontClass,"attributors/class/size":f.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":d.BackgroundStyle,"attributors/style/color":h.ColorStyle,"attributors/style/direction":o.DirectionStyle,"attributors/style/font":p.FontStyle,"attributors/style/size":f.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":o.DirectionClass,"formats/indent":a.IndentClass,"formats/background":d.BackgroundStyle,"formats/color":h.ColorStyle,"formats/font":p.FontClass,"formats/size":f.SizeClass,"formats/blockquote":s.default,"formats/code-block":k.default,"formats/header":l.default,"formats/list":u.default,"formats/bold":m.default,"formats/code":x.Code,"formats/italic":v.default,"formats/link":g.default,"formats/script":y.default,"formats/strike":_.default,"formats/underline":b.default,"formats/image":w.default,"formats/video":C.default,"formats/list/item":c.ListItem,"modules/formula":S.default,"modules/syntax":T.default,"modules/toolbar":O.default,"themes/bubble":q.default,"themes/snow":j.default,"ui/icons":E.default,"ui/picker":I.default,"ui/icon-picker":A.default,"ui/color-picker":N.default,"ui/tooltip":P.default},!0),e.default=r.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var r,i=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return t={},e=this.statics.blotName,n=this.statics.formats(this.domNode),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var t,e,n}},{key:"insertBefore",value:function(t,n){if(t instanceof h)i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=o.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}i(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(s.default);p.blotName="list",p.scope=o.default.Scope.BLOCK_BLOT,p.tagName=["OL","UL"],p.defaultChild="list-item",p.allowedChildren=[h],e.ListItem=h,e.default=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(56);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var s=function(t){function e(){return o(this,e),a(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(((r=i)&&r.__esModule?r:{default:r}).default);s.blotName="italic",s.tagName=["EM","I"],e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return d.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,l.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(s.default.Embed);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):o(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=o(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return d.reduce((function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e}),{})}},{key:"sanitize",value:function(t){return l.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(a.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var r=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(s(n(13)).default);d.className="ql-syntax";var h=new i.default.Attributor.Class("token","hljs",{scope:i.default.Scope.INLINE}),p=function(t){function e(t,n){l(this,e);var r=c(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var i=null;return r.quill.on(o.default.events.SCROLL_OPTIMIZE,(function(){clearTimeout(i),i=setTimeout((function(){r.highlight(),i=null}),r.options.interval)})),r.highlight(),r}return u(e,t),r(e,null,[{key:"register",value:function(){o.default.register(h,!0),o.default.register(d,!0)}}]),r(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(o.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(d).forEach((function(e){e.highlight(t.options.highlight)})),this.quill.update(o.default.sources.SILENT),null!=e&&this.quill.setSelection(e,o.default.sources.SILENT)}}}]),e}(a.default);p.DEFAULTS={highlight:null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value},interval:1e3},e.CodeBlock=d,e.CodeToken=h,e.default=p},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e){t.exports=' '},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var r=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},i=function(){function t(t,e){for(var n=0;n0&&i===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var o=r.quill.getLines(e.index,e.length);if(1===o.length)r.position(r.quill.getBounds(e));else{var s=o[o.length-1],l=r.quill.getIndex(s),u=Math.min(s.length()-1,e.index+e.length-l),d=r.quill.getBounds(new c.Range(l,u));r.position(d)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()})),r}return f(e,t),i(e,[{key:"listen",value:function(){var t=this;r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",(function(){t.root.classList.remove("ql-editing")})),this.quill.on(a.default.events.SCROLL_OPTIMIZE,(function(){setTimeout((function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}}),1)}))}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=r(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),i=this.root.querySelector(".ql-tooltip-arrow");if(i.style.marginLeft="",0===n)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+"px"}}]),e}(s.BaseTooltip);g.TEMPLATE=['','
','','',"
"].join(""),e.BubbleTooltip=g,e.default=v},function(t,e,n){t.exports=n(63)}]).default},t.exports=n()}).call(this,n(233).Buffer)},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(101),i=n(161),o=Object.prototype.toString;function a(t){return"[object Array]"===o.call(t)}function s(t){return null!==t&&"object"==typeof t}function l(t){return"[object Function]"===o.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n0?r("div",{staticClass:"container"},[r("div",{staticClass:"row"},[r("div",{staticClass:"col-sm-5 mx-auto"},[r("form",[r("div",{staticClass:"form-row"},[r("div",{staticClass:"form-group col-sm-8"},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.coupon,expression:"coupon"}],staticClass:"form-control form-control-xs rounded-pill is-invalid",attrs:{type:"text",placeholder:"Enter coupon code..."},domProps:{value:t.coupon},on:{input:function(e){e.target.composing||(t.coupon=e.target.value)}}}),t._v(" "),t.couponError?r("div",{staticClass:"invalid-feedback",attrs:{id:"validationServer03Feedback"}},[t._v("\n "+t._s(t.couponError)+"\n ")]):t._e()]),t._v(" "),r("div",{staticClass:"form-group col-sm-4"},[r("button",{staticClass:"btn btn-outline-custom btn-lg btn-custom-sm-2 btn-block",attrs:{enabled:t.coupon,type:"submit"},on:{click:function(e){return e.preventDefault(),t.applyCoupon(e)}}},["loading"==t.couponStatus?r("span",{staticClass:"btn-loader text-dark"}):t._e(),t._v(" Apply\n ")])])])])])]),t._v(" "),r("div",{staticClass:"row"},[r("div",{staticClass:"col-md-12 mx-auto"},[r("section",{staticClass:"pricing py-5"},[r("div",{staticClass:"container"},[r("div",{staticClass:"row pricing-pop-row"},t._l(t.subscriptions,(function(e,i){return r("div",{key:i,staticClass:"col-lg-4 col-12 mb-3 d-flex"},[r("div",{staticClass:"card mb-5 mb-lg-0"},[r("div",{staticClass:"card-body card-box-relative"},[r("h5",{staticClass:"card-title text-muted text-uppercase text-center"},[t._v(t._s(e.name))]),t._v(" "),r("h6",{staticClass:"card-price text-center"},[e.amount!=e.couponAmount?r("del",[t._v("\n "+t._s(e.currencySymbol)+t._s(t.numberWithCommas(e.amount))),r("br")]):t._e(),t._v("\n\n "+t._s(e.currencySymbol)+t._s(t.numberWithCommas(e.couponAmount))+"\n "),r("span",{staticClass:"period"},[t._v("/"+t._s(e.readableValidity))])]),t._v(" "),r("hr"),t._v(" "),r("h6",{staticClass:"card-price text-center"},[t._v("\n "+t._s(t.numberWithCommas(e.ticketValue))+"\n "),r("span",{staticClass:"period"},[t._v("tickets")])]),t._v(" "),r("hr"),t._v(" "),r("div",{staticClass:"pricing-info-data flex-grow-1"},[r("ul",{staticClass:"fa-ul reward-list"},t._l(e.features,(function(e,n){return r("li",{key:n,class:[e.isAvailable?"":"text-muted text-danger"]},[r("span",{staticClass:"fa-li"},[r("i",{staticClass:"fas",class:[e.isAvailable?"fa-check text-success":"fa-times"]})]),t._v("\n "+t._s(e.featureName)+t._s(e.isCustomized?" : ":"")+" "),e.isCustomized?r("span",{staticClass:"text-success"},[t._v(t._s(e.description))]):t._e()])})),0)]),t._v(" "),e.isActive&&"free"!=e.id?r("div",{staticClass:"progress pricing-progress"},[r("div",{staticClass:"progress-bar pricing-progress-bar bg-green",style:"width: "+e.percentageBeforeExpiration+"%",attrs:{role:"progressbar","aria-valuenow":e.percentageBeforeExpiration,"aria-valuemin":"0","aria-valuemax":"100"}},[r("span",{staticStyle:{color:"#000",align:"center"}},[t._v(t._s(e.expiresIn)+" Left")])])]):t._e(),t._v(" "),e.isActive?r("div",{staticClass:"user-active-card"},[r("img",{staticClass:"img-fluid",attrs:{src:n(213)}})]):t._e(),t._v(" "),e.isActive||e.isFree?t._e():r("a",{staticClass:"btn btn-block btn-primary text-uppercase",attrs:{href:"#"},on:{click:function(n){return t.proceedWithSubscription(e,n)}}},[t._v("\n Subscribe\n ")])])])])})),0)])])])])]):t._e()],1)};r._withStripped=!0;var i=n(1),o=n.n(i),a=n(3),s=n.n(a),l=n(18),c=n(5),u=n(6),d={props:["show","for"],components:{loader:l.a},data:function(){return{loaderState:"loading",loaderErrorMessage:"Error loading subscription bundles",subscriptions:[],currentUser:c.a.getCurrentUser(),selectedSubscription:null,selectedCurrency:"NGN",coupon:null,couponStatus:"idle",couponError:""}},mounted:function(){this.getPlatformSubscriptions();var t=document.createElement("script");t.setAttribute("src","https://js.paystack.co/v2/inline.js"),document.head.appendChild(t)},watch:{show:function(t){t?window.$("#rewardModal").modal("show"):window.$("#rewardModal").modal("hide")},coupon:function(t){this.couponError=null},subscriptions:function(t){}},methods:{proceedWithSubscription:function(t,e){if(e.preventDefault(),!this.currentUser||this.currentUser.isAnonymous)return this.$emit("loginRequired"),void this.$router.push({name:"login"});this.selectedSubscription=t,this.payWithPaystack()},applyCoupon:function(){var t=this;return s()(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("loading"!=t.couponStatus){e.next=2;break}return e.abrupt("return");case 2:return t.couponError=null,t.couponStatus="loading",e.next=6,t.getPlatformSubscriptions(t.coupon,!0);case 6:t.couponStatus="idle",t.subscriptions.some((function(t){return t.amount!=t.couponAmount}))||(t.couponError="Invalid coupon");case 9:case"end":return e.stop()}}),e)})))()},getPlatformSubscriptions:function(){var t=arguments,e=this;return s()(o.a.mark((function n(){var r,i,a,s,l,c,u,d,h,p,f,m;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.length>0&&void 0!==t[0]?t[0]:null,i=t.length>1&&void 0!==t[1]&&t[1],n.prev=2,e.loaderState=i?"hide":"loading",a=null,s=[],!e.currentUser||e.currentUser.isAnonymous){n.next=12;break}return n.next=9,e.$store.dispatch("fetchUserActiveSubscriptions");case 9:l=n.sent,c=l.data,a=c.length>0?c[0]:null;case 12:return n.next=14,e.$store.dispatch("fetchPlatformFeatures",{});case 14:return"success"==(u=n.sent).status&&(s=u.data),d={searchExpression:null},e.for&&(h=e.for.split(","),p="",h.forEach((function(t){return p+="suitableFor%".concat(t," ||")})),p=(p=p.trim().substring(0,p.lastIndexOf("|"))).trim().substring(0,p.lastIndexOf("|")),d.searchExpression=p),n.next=20,e.$store.dispatch("fetchPlatformSubscriptions",{currency:e.selectedCurrency,getOption:d,coupon:r});case 20:"success"==(f=n.sent).status?((m=f.data).forEach((function(t){if(t.readableValidity="free"==t.name.trim().toLowerCase()?"Lifetime":e.getReadableExpirationTime(t.durationInDays),a&&a.id==t.id){t.isActive=!0;var n=(new Date(a.expiryDate)-new Date)/864e5;t.expiresIn=e.getReadableExpirationTime(n),t.percentageBeforeExpiration=n/t.durationInDays*100}s.filter((function(e){return!t.features.some((function(t){return t.featureId==e.id}))})).forEach((function(e){t.features.push({featureId:e.id,featureName:e.name,description:null})})),t.features.forEach((function(t){t.isAvailable="no"!=(t.description||"No").trim().toLowerCase(),t.isAvailable&&(t.isCustomized="yes"!=t.description.trim().toLowerCase())}))})),e.subscriptions=m,e.loaderState="hide"):e.loaderState="error",n.next=28;break;case 24:n.prev=24,n.t0=n.catch(2),e.loaderState="error",console.log(n.t0);case 28:case"end":return n.stop()}}),n,null,[[2,24]])})))()},numberWithCommas:function(t){return t&&Number(t)?Number(t).toLocaleString():t},getReadableExpirationTime:function(t){if(t){t=Math.round(t);var e=Math.round(t/365);if(e>0)return e+(e>1?"years":"year");var n=Math.round(t/30);if(n>0)return n+(n>1?"months":"month");var r=Math.round(t/7);return r>0?r+(r>1?"weeks":"week"):t+(t>1?"days":"day")}},payWithPaystack:function(){var t,e=this;PaystackPop.setup({key:u.urlConfig.paystackPublicKey,email:this.currentUser.email,amount:100*this.selectedSubscription.couponAmount,currency:this.selectedSubscription.currency,callback:(t=s()(o.a.mark((function t(n){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.currentUser.isActiveSubscriber=!0,e.currentUser.tickets=e.currentUser.tickets+e.selectedSubscription.value,c.a.updateUser(e.currentUser),c.a.refreshUser(),e.$emit("paymentSuccess"),t.next=7,e.$store.dispatch("subscribe",{subscriptionId:e.selectedSubscription.id,gateway:"paystack",reference:n.reference,coupon:null});case 7:"success"!=t.sent.status?e.notify({text:"Error finalizing account upgrade",type:"error"}):(e.getPlatformSubscriptions(),c.a.refreshAccessToken()),c.a.refreshUser();case 10:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)}),onClose:function(){return e.$emit("paymentAborted")}}).openIframe()}}},h=n(0),p=Object(h.a)(d,r,[],!1,null,null,null);p.options.__file="src/js/user/common/components/subscriptions.vue";e.a=p.exports},function(t,e){t.exports="/img/Diamond.png"},function(t,e){t.exports="/img/logo.png"},function(t,e,n){t.exports=n(160)},function(t,e,n){var r; /*! * jQuery JavaScript Library v3.5.1 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2020-05-04T22:49Z */!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},c=o.push,u=o.indexOf,d={},h=d.toString,p=d.hasOwnProperty,f=p.toString,m=f.call(Object),v={},g=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function(t){return null!=t&&t===t.window},_=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(t,e,n){var r,i,o=(n=n||_).createElement("script");if(o.text=t,e)for(r in b)(i=e[r]||e.getAttribute&&e.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function C(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[h.call(t)]||"object":typeof t}var x=function(t,e){return new x.fn.init(t,e)};function k(t){var e=!!t&&"length"in t&&t.length,n=C(t);return!g(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}x.fn=x.prototype={jquery:"3.5.1",constructor:x,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=x.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return x.each(this,t)},map:function(t){return this.pushStack(x.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),G=new RegExp(U),V=new RegExp("^"+M+"$"),Y={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+$),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+D+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},rt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,it=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){h()},at=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{q.apply(N=j.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(t){q={apply:N.length?function(t,e){P.apply(t,j.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}function st(t,e,r,i){var o,s,c,u,d,f,g,y=e&&e.ownerDocument,w=e?e.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return r;if(!i&&(h(e),e=e||p,m)){if(11!==w&&(d=X.exec(t)))if(o=d[1]){if(9===w){if(!(c=e.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(y&&(c=y.getElementById(o))&&_(e,c)&&c.id===o)return r.push(c),r}else{if(d[2])return q.apply(r,e.getElementsByTagName(t)),r;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return q.apply(r,e.getElementsByClassName(o)),r}if(n.qsa&&!O[t+" "]&&(!v||!v.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(g=t,y=e,1===w&&(W.test(t)||H.test(t))){for((y=tt.test(t)&>(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(rt,it):e.setAttribute("id",u=b)),s=(f=a(t)).length;s--;)f[s]=(u?"#"+u:":scope")+" "+_t(f[s]);g=f.join(",")}try{return q.apply(r,y.querySelectorAll(g)),r}catch(e){O(t,!0)}finally{u===b&&e.removeAttribute("id")}}}return l(t.replace(F,"$1"),e,r,i)}function lt(){var t=[];return function e(n,i){return t.push(n+" ")>r.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function ct(t){return t[b]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=e}function ht(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function vt(t){return ct((function(e){return e=+e,ct((function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!Q.test(e||n&&n.nodeName||"HTML")},h=st.setDocument=function(t){var e,i,a=t?t.ownerDocument||t:w;return a!=p&&9===a.nodeType&&a.documentElement?(f=(p=a).documentElement,m=!o(p),w!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ot,!1):i.attachEvent&&i.attachEvent("onunload",ot)),n.scope=ut((function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=b,!p.getElementsByName||!p.getElementsByName(b).length})),n.getById?(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(r.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},r.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,r,i,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(i=e.getElementsByName(t),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},g=[],v=[],(n.qsa=J.test(p.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\["+L+"*(?:value|"+D+")"),t.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||v.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),t.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=J.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),g.push("!=",U)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),e=J.test(f.compareDocumentPosition),_=e||J.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},E=e?function(t,e){if(t===e)return d=!0,0;var r=!t.compareDocumentPosition-!e.compareDocumentPosition;return r||(1&(r=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===r?t==p||t.ownerDocument==w&&_(w,t)?-1:e==p||e.ownerDocument==w&&_(w,e)?1:u?R(u,t)-R(u,e):0:4&r?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!i||!o)return t==p?-1:e==p?1:i?-1:o?1:u?R(u,t)-R(u,e):0;if(i===o)return ht(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ht(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(h(t),n.matchesSelector&&m&&!O[e+" "]&&(!g||!g.test(e))&&(!v||!v.test(e)))try{var r=y.call(t,e);if(r||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){O(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=p&&h(t),_(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=p&&h(t);var i=r.attrHandle[e.toLowerCase()],o=i&&I.call(r.attrHandle,e.toLowerCase())?i(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(rt,it)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,r=[],i=0,o=0;if(d=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(E),d){for(;e=t[o++];)e===t[o]&&(i=r.push(o));for(;i--;)t.splice(r[i],1)}return u=null,t},i=st.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=i(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=i(e);return n},(r=st.selectors={cacheLength:50,createPseudo:ct,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&G.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&k(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var i=st.attr(r,t);return null==i?"!="===e:!e||(i+="","="===e?i===n:"!="===e?i!==n:"^="===e?n&&0===i.indexOf(n):"*="===e?n&&i.indexOf(n)>-1:"$="===e?n&&i.slice(-n.length)===n:"~="===e?(" "+i.replace(z," ")+" ").indexOf(n)>-1:"|="===e&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,p,f,m=o!==a?"nextSibling":"previousSibling",v=e.parentNode,g=s&&e.nodeName.toLowerCase(),y=!l&&!s,_=!1;if(v){if(o){for(;m;){for(h=e;h=h[m];)if(s?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[a?v.firstChild:v.lastChild],a&&y){for(_=(p=(c=(u=(d=(h=v)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===C&&c[1])&&c[2],h=p&&v.childNodes[p];h=++p&&h&&h[m]||(_=p=0)||f.pop();)if(1===h.nodeType&&++_&&h===e){u[t]=[C,p,_];break}}else if(y&&(_=p=(c=(u=(d=(h=e)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===C&&c[1]),!1===_)for(;(h=++p&&h&&h[m]||(_=p=0)||f.pop())&&((s?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++_||(y&&((u=(d=h[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]=[C,_]),h!==e)););return(_-=i)===r||_%r==0&&_/r>=0}}},PSEUDO:function(t,e){var n,i=r.pseudos[t]||r.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return i[b]?i(e):i.length>1?(n=[t,t,"",e],r.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){for(var r,o=i(t,e),a=o.length;a--;)t[r=R(t,o[a])]=!(n[r]=o[a])})):function(t){return i(t,0,n)}):i}},pseudos:{not:ct((function(t){var e=[],n=[],r=s(t.replace(F,"$1"));return r[b]?ct((function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return st(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||i(e)).indexOf(t)>-1}})),lang:ct((function(t){return V.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!r.pseudos.empty(t)},header:function(t){return Z.test(t.nodeName)},input:function(t){return K.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:vt((function(){return[0]})),last:vt((function(t,e){return[e-1]})),eq:vt((function(t,e,n){return[n<0?n+e:n]})),even:vt((function(t,e){for(var n=0;ne?e:n;--r>=0;)t.push(r);return t})),gt:vt((function(t,e,n){for(var r=n<0?n+e:n;++r1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function Ct(t,e,n,r,i){for(var o,a=[],s=0,l=t.length,c=null!=e;s-1&&(o[c]=!(a[c]=d))}}else g=Ct(g===a?g.splice(f,g.length):g),i?i(null,a,g,l):q.apply(a,g)}))}function kt(t){for(var e,n,i,o=t.length,a=r.relative[t[0].type],s=a||r.relative[" "],l=a?1:0,u=bt((function(t){return t===e}),s,!0),d=bt((function(t){return R(e,t)>-1}),s,!0),h=[function(t,n,r){var i=!a&&(r||n!==c)||((e=n).nodeType?u(t,n,r):d(t,n,r));return e=null,i}];l1&&wt(h),l>1&&_t(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(F,"$1"),n,l0,i=t.length>0,o=function(o,a,s,l,u){var d,f,v,g=0,y="0",_=o&&[],b=[],w=c,x=o||i&&r.find.TAG("*",u),k=C+=null==w?1:Math.random()||.1,S=x.length;for(u&&(c=a==p||a||u);y!==S&&null!=(d=x[y]);y++){if(i&&d){for(f=0,a||d.ownerDocument==p||(h(d),s=!m);v=t[f++];)if(v(d,a||p,s)){l.push(d);break}u&&(C=k)}n&&((d=!v&&d)&&g--,o&&_.push(d))}if(g+=y,n&&y!==g){for(f=0;v=e[f++];)v(_,b,a,s);if(o){if(g>0)for(;y--;)_[y]||b[y]||(b[y]=A.call(l));b=Ct(b)}q.apply(l,b),u&&!o&&b.length>0&&g+e.length>1&&st.uniqueSort(l)}return u&&(C=k,c=w),_};return n?ct(o):o}(o,i))).selector=t}return s},l=st.select=function(t,e,n,i){var o,l,c,u,d,h="function"==typeof t&&t,p=!i&&a(t=h.selector||t);if(n=n||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&m&&r.relative[l[1].type]){if(!(e=(r.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(o=Y.needsContext.test(t)?0:l.length;o--&&(c=l[o],!r.relative[u=c.type]);)if((d=r.find[u])&&(i=d(c.matches[0].replace(et,nt),tt.test(l[0].type)&>(e.parentNode)||e))){if(l.splice(o,1),!(t=i.length&&_t(l)))return q.apply(n,i),n;break}}return(h||s(t,p))(i,e,!m,n,!e||tt.test(t)&>(e.parentNode)||e),n},n.sortStable=b.split("").sort(E).join("")===b,n.detectDuplicates=!!d,h(),n.sortDetached=ut((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),ut((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ut((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ut((function(t){return null==t.getAttribute("disabled")}))||dt(D,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),st}(n);x.find=S,x.expr=S.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=S.uniqueSort,x.text=S.getText,x.isXMLDoc=S.isXML,x.contains=S.contains,x.escapeSelector=S.escape;var T=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&x(t).is(n))break;r.push(t)}return r},O=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},E=x.expr.match.needsContext;function I(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return g(e)?x.grep(t,(function(t,r){return!!e.call(t,r,t)!==n})):e.nodeType?x.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?x.grep(t,(function(t){return u.call(e,t)>-1!==n})):x.filter(e,t,n)}x.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?x.find.matchesSelector(r,t)?[r]:[]:x.find.matches(t,x.grep(e,(function(t){return 1===t.nodeType})))},x.fn.extend({find:function(t){var e,n,r=this.length,i=this;if("string"!=typeof t)return this.pushStack(x(t).filter((function(){for(e=0;e1?x.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&E.test(t)?x(t):t||[],!1).length}});var P,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||P,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:q.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof x?e[0]:e,x.merge(this,x.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:_,!0)),N.test(r[1])&&x.isPlainObject(e))for(r in e)g(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(i=_.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):g(t)?void 0!==n.ready?n.ready(t):t(x):x.makeArray(t,this)}).prototype=x.fn,P=x(_);var j=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function D(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}x.fn.extend({has:function(t){var e=x(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&x.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?u.call(x(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),x.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return T(t,"parentNode")},parentsUntil:function(t,e,n){return T(t,"parentNode",n)},next:function(t){return D(t,"nextSibling")},prev:function(t){return D(t,"previousSibling")},nextAll:function(t){return T(t,"nextSibling")},prevAll:function(t){return T(t,"previousSibling")},nextUntil:function(t,e,n){return T(t,"nextSibling",n)},prevUntil:function(t,e,n){return T(t,"previousSibling",n)},siblings:function(t){return O((t.parentNode||{}).firstChild,t)},children:function(t){return O(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(I(t,"template")&&(t=t.content||t),x.merge([],t.childNodes))}},(function(t,e){x.fn[t]=function(n,r){var i=x.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(R[t]||x.uniqueSort(i),j.test(t)&&i.reverse()),this.pushStack(i)}}));var L=/[^\x20\t\r\n\f]+/g;function M(t){return t}function $(t){throw t}function U(t,e,n,r){var i;try{t&&g(i=t.promise)?i.call(t).done(e).fail(n):t&&g(i=t.then)?i.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}x.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return x.each(t.match(L)||[],(function(t,n){e[n]=!0})),e}(t):x.extend({},t);var e,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||t.once,r=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?x.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||e||(o=n=""),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},x.extend({Deferred:function(t){var e=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return x.Deferred((function(n){x.each(e,(function(e,r){var i=g(t[r[4]])&&t[r[4]];o[r[1]]((function(){var t=i&&i.apply(this,arguments);t&&g(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,i){var o=0;function a(t,e,r,i){return function(){var s=this,l=arguments,c=function(){var n,c;if(!(t=o&&(r!==$&&(s=void 0,l=[n]),e.rejectWith(s,l))}};t?u():(x.Deferred.getStackHook&&(u.stackTrace=x.Deferred.getStackHook()),n.setTimeout(u))}}return x.Deferred((function(n){e[0][3].add(a(0,n,g(i)?i:M,n.notifyWith)),e[1][3].add(a(0,n,g(t)?t:M)),e[2][3].add(a(0,n,g(r)?r:$))})).promise()},promise:function(t){return null!=t?x.extend(t,i):i}},o={};return x.each(e,(function(t,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,r=Array(n),i=s.call(arguments),o=x.Deferred(),a=function(t){return function(n){r[t]=this,i[t]=arguments.length>1?s.call(arguments):n,--e||o.resolveWith(r,i)}};if(e<=1&&(U(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||g(i[n]&&i[n].then)))return o.then();for(;n--;)U(i[n],a(n),o.reject);return o.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&z.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},x.readyException=function(t){n.setTimeout((function(){throw t}))};var F=x.Deferred();function B(){_.removeEventListener("DOMContentLoaded",B),n.removeEventListener("load",B),x.ready()}x.fn.ready=function(t){return F.then(t).catch((function(t){x.readyException(t)})),this},x.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==t&&--x.readyWait>0||F.resolveWith(_,[x]))}}),x.ready.then=F.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?n.setTimeout(x.ready):(_.addEventListener("DOMContentLoaded",B),n.addEventListener("load",B));var H=function(t,e,n,r,i,o,a){var s=0,l=t.length,c=null==n;if("object"===C(n))for(s in i=!0,n)H(t,e,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,g(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(x(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){J.remove(this,t)}))}}),x.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=Z.get(t,e),n&&(!r||Array.isArray(n)?r=Z.access(t,e,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=x.queue(t,e),r=n.length,i=n.shift(),o=x._queueHooks(t,e);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,(function(){x.dequeue(t,e)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Z.get(t,n)||Z.access(t,n,{empty:x.Callbacks("once memory").add((function(){Z.remove(t,[e+"queue",n])}))})}}),x.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i;pt=_.createDocumentFragment().appendChild(_.createElement("div")),(ft=_.createElement("input")).setAttribute("type","radio"),ft.setAttribute("checked","checked"),ft.setAttribute("name","t"),pt.appendChild(ft),v.checkClone=pt.cloneNode(!0).cloneNode(!0).lastChild.checked,pt.innerHTML="",v.noCloneChecked=!!pt.cloneNode(!0).lastChild.defaultValue,pt.innerHTML="",v.option=!!pt.lastChild;var yt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function _t(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&I(t,e)?x.merge([t],n):n}function bt(t,e){for(var n=0,r=t.length;n",""]);var wt=/<|&#?\w+;/;function Ct(t,e,n,r,i){for(var o,a,s,l,c,u,d=e.createDocumentFragment(),h=[],p=0,f=t.length;p-1)i&&i.push(o);else if(c=at(o),a=_t(d.appendChild(o),"script"),c&&bt(a),n)for(u=0;o=a[u++];)gt.test(o.type||"")&&n.push(o);return d}var xt=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,St=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function Ot(){return!1}function Et(t,e){return t===function(){try{return _.activeElement}catch(t){}}()==("focus"===e)}function It(t,e,n,r,i,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(r=r||n,n=void 0),e)It(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ot;else if(!i)return t;return 1===o&&(a=i,(i=function(t){return x().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=x.guid++)),t.each((function(){x.event.add(this,e,i,r,n)}))}function Nt(t,e,n){n?(Z.set(t,e,!1),x.event.add(t,e,{namespace:!1,handler:function(t){var r,i,o=Z.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(x.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=s.call(arguments),Z.set(this,e,o),r=n(this,e),this[e](),o!==(i=Z.get(this,e))||r?Z.set(this,e,!1):i={},o!==i)return t.stopImmediatePropagation(),t.preventDefault(),i.value}else o.length&&(Z.set(this,e,{value:x.event.trigger(x.extend(o[0],x.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Z.get(t,e)&&x.event.add(t,e,Tt)}x.event={global:{},add:function(t,e,n,r,i){var o,a,s,l,c,u,d,h,p,f,m,v=Z.get(t);if(Q(t))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&x.find.matchesSelector(ot,i),n.guid||(n.guid=x.guid++),(l=v.events)||(l=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return void 0!==x&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(L)||[""]).length;c--;)p=m=(s=St.exec(e[c])||[])[1],f=(s[2]||"").split(".").sort(),p&&(d=x.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=x.event.special[p]||{},u=x.extend({type:p,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&x.expr.match.needsContext.test(i),namespace:f.join(".")},o),(h=l[p])||((h=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,f,a)||t.addEventListener&&t.addEventListener(p,a)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,u):h.push(u),x.event.global[p]=!0)},remove:function(t,e,n,r,i){var o,a,s,l,c,u,d,h,p,f,m,v=Z.hasData(t)&&Z.get(t);if(v&&(l=v.events)){for(c=(e=(e||"").match(L)||[""]).length;c--;)if(p=m=(s=St.exec(e[c])||[])[1],f=(s[2]||"").split(".").sort(),p){for(d=x.event.special[p]||{},h=l[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)u=h[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,f,v.handle)||x.removeEvent(t,p,v.handle),delete l[p])}else for(p in l)x.event.remove(t,p+e[c],n,r,!0);x.isEmptyObject(l)&&Z.remove(t,"handle events")}},dispatch:function(t){var e,n,r,i,o,a,s=new Array(arguments.length),l=x.event.fix(t),c=(Z.get(this,"events")||Object.create(null))[l.type]||[],u=x.event.special[l.type]||{};for(s[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:x.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,l\s*$/g;function jt(t,e){return I(t,"table")&&I(11!==e.nodeType?e:e.firstChild,"tr")&&x(t).children("tbody")[0]||t}function Rt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Dt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Lt(t,e){var n,r,i,o,a,s;if(1===e.nodeType){if(Z.hasData(t)&&(s=Z.get(t).events))for(i in Z.remove(e,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof f&&!v.checkClone&&Pt.test(f))return t.each((function(i){var o=t.eq(i);m&&(e[0]=f.call(this,i,o.html())),$t(o,e,n,r)}));if(h&&(o=(i=Ct(e,t[0].ownerDocument,!1,t,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=x.map(_t(i,"script"),Rt)).length;d0&&bt(a,!l&&_t(t,"script")),s},cleanData:function(t){for(var e,n,r,i=x.event.special,o=0;void 0!==(n=t[o]);o++)if(Q(n)){if(e=n[Z.expando]){if(e.events)for(r in e.events)i[r]?x.event.remove(n,r):x.removeEvent(n,r,e.handle);n[Z.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),x.fn.extend({detach:function(t){return Ut(this,t,!0)},remove:function(t){return Ut(this,t)},text:function(t){return H(this,(function(t){return void 0===t?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return $t(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||jt(this,t).appendChild(t)}))},prepend:function(){return $t(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=jt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return $t(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return $t(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(x.cleanData(_t(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return x.clone(this,t,e)}))},html:function(t){return H(this,(function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!At.test(t)&&!yt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=x.htmlPrefilter(t);try{for(;n3,ot.removeChild(t)),s}}))}();var Vt=["Webkit","Moz","ms"],Yt=_.createElement("div").style,Qt={};function Kt(t){var e=x.cssProps[t]||Qt[t];return e||(t in Yt?t:Qt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Vt.length;n--;)if((t=Vt[n]+e)in Yt)return t}(t)||t)}var Zt=/^(none|table(?!-c[ea]).+)/,Jt=/^--/,Xt={position:"absolute",visibility:"hidden",display:"block"},te={letterSpacing:"0",fontWeight:"400"};function ee(t,e,n){var r=rt.exec(e);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):e}function ne(t,e,n,r,i,o){var a="width"===e?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=x.css(t,n+it[a],!0,i)),r?("content"===n&&(l-=x.css(t,"padding"+it[a],!0,i)),"margin"!==n&&(l-=x.css(t,"border"+it[a]+"Width",!0,i))):(l+=x.css(t,"padding"+it[a],!0,i),"padding"!==n?l+=x.css(t,"border"+it[a]+"Width",!0,i):s+=x.css(t,"border"+it[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l}function re(t,e,n){var r=Ft(t),i=(!v.boxSizingReliable()||n)&&"border-box"===x.css(t,"boxSizing",!1,r),o=i,a=Wt(t,e,r),s="offset"+e[0].toUpperCase()+e.slice(1);if(zt.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&I(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===x.css(t,"display",!1,r))&&t.getClientRects().length&&(i="border-box"===x.css(t,"boxSizing",!1,r),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+ne(t,e,n||(i?"border":"content"),o,r,a)+"px"}function ie(t,e,n,r,i){return new ie.prototype.init(t,e,n,r,i)}x.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Wt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=Y(e),l=Jt.test(e),c=t.style;if(l||(e=Kt(s)),a=x.cssHooks[e]||x.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:c[e];"string"===(o=typeof n)&&(i=rt.exec(n))&&i[1]&&(n=ct(t,e,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(x.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,r){var i,o,a,s=Y(e);return Jt.test(e)||(e=Kt(s)),(a=x.cssHooks[e]||x.cssHooks[s])&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=Wt(t,e,r)),"normal"===i&&e in te&&(i=te[e]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),x.each(["height","width"],(function(t,e){x.cssHooks[e]={get:function(t,n,r){if(n)return!Zt.test(x.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?re(t,e,r):Bt(t,Xt,(function(){return re(t,e,r)}))},set:function(t,n,r){var i,o=Ft(t),a=!v.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===x.css(t,"boxSizing",!1,o),l=r?ne(t,e,r,s,o):0;return s&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ne(t,e,"border",!1,o)-.5)),l&&(i=rt.exec(n))&&"px"!==(i[3]||"px")&&(t.style[e]=n,n=x.css(t,e)),ee(0,n,l)}}})),x.cssHooks.marginLeft=Gt(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Wt(t,"marginLeft"))||t.getBoundingClientRect().left-Bt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(t,e){x.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+it[r]+e]=o[r]||o[r-2]||o[0];return i}},"margin"!==t&&(x.cssHooks[t+e].set=ee)})),x.fn.extend({css:function(t,e){return H(this,(function(t,e,n){var r,i,o={},a=0;if(Array.isArray(e)){for(r=Ft(t),i=e.length;a1)}}),x.Tween=ie,ie.prototype={constructor:ie,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||x.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var t=ie.propHooks[this.prop];return t&&t.get?t.get(this):ie.propHooks._default.get(this)},run:function(t){var e,n=ie.propHooks[this.prop];return this.options.duration?this.pos=e=x.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ie.propHooks._default.set(this),this}},ie.prototype.init.prototype=ie.prototype,ie.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=x.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){x.fx.step[t.prop]?x.fx.step[t.prop](t):1!==t.elem.nodeType||!x.cssHooks[t.prop]&&null==t.elem.style[Kt(t.prop)]?t.elem[t.prop]=t.now:x.style(t.elem,t.prop,t.now+t.unit)}}},ie.propHooks.scrollTop=ie.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},x.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},x.fx=ie.prototype.init,x.fx.step={};var oe,ae,se=/^(?:toggle|show|hide)$/,le=/queueHooks$/;function ce(){ae&&(!1===_.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ce):n.setTimeout(ce,x.fx.interval),x.fx.tick())}function ue(){return n.setTimeout((function(){oe=void 0})),oe=Date.now()}function de(t,e){var n,r=0,i={height:t};for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=it[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function he(t,e,n){for(var r,i=(pe.tweeners[e]||[]).concat(pe.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(t){return this.each((function(){x.removeAttr(this,t)}))}}),x.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?x.prop(t,e,n):(1===o&&x.isXMLDoc(t)||(i=x.attrHooks[e.toLowerCase()]||(x.expr.match.bool.test(e)?fe:void 0)),void 0!==n?null===n?void x.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=x.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&I(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,i=e&&e.match(L);if(i&&1===t.nodeType)for(;n=i[r++];)t.removeAttribute(n)}}),fe={set:function(t,e,n){return!1===e?x.removeAttr(t,n):t.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=me[e]||x.find.attr;me[e]=function(t,e,r){var i,o,a=e.toLowerCase();return r||(o=me[a],me[a]=i,i=null!=n(t,e,r)?a:null,me[a]=o),i}}));var ve=/^(?:input|select|textarea|button)$/i,ge=/^(?:a|area)$/i;function ye(t){return(t.match(L)||[]).join(" ")}function _e(t){return t.getAttribute&&t.getAttribute("class")||""}function be(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(L)||[]}x.fn.extend({prop:function(t,e){return H(this,x.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[x.propFix[t]||t]}))}}),x.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&x.isXMLDoc(t)||(e=x.propFix[e]||e,i=x.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=x.find.attr(t,"tabindex");return e?parseInt(e,10):ve.test(t.nodeName)||ge.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(x.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,l=0;if(g(t))return this.each((function(e){x(this).addClass(t.call(this,e,_e(this)))}));if((e=be(t)).length)for(;n=this[l++];)if(i=_e(n),r=1===n.nodeType&&" "+ye(i)+" "){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ye(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,l=0;if(g(t))return this.each((function(e){x(this).removeClass(t.call(this,e,_e(this)))}));if(!arguments.length)return this.attr("class","");if((e=be(t)).length)for(;n=this[l++];)if(i=_e(n),r=1===n.nodeType&&" "+ye(i)+" "){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=ye(r))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):g(t)?this.each((function(n){x(this).toggleClass(t.call(this,n,_e(this),e),e)})):this.each((function(){var e,i,o,a;if(r)for(i=0,o=x(this),a=be(t);e=a[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=_e(this))&&Z.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Z.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+ye(_e(n))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;x.fn.extend({val:function(t){var e,n,r,i=this[0];return arguments.length?(r=g(t),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?t.call(this,n,x(this).val()):t)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=x.map(i,(function(t){return null==t?"":t+""}))),(e=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))}))):i?(e=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(we,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(t){var e=x.find.attr(t,"value");return null!=e?e:ye(x.text(t))}},select:{get:function(t){var e,n,r,i=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=x.inArray(x(t).val(),e)>-1}},v.checkOn||(x.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),v.focusin="onfocusin"in n;var Ce=/^(?:focusinfocus|focusoutblur)$/,xe=function(t){t.stopPropagation()};x.extend(x.event,{trigger:function(t,e,r,i){var o,a,s,l,c,u,d,h,f=[r||_],m=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(a=h=s=r=r||_,3!==r.nodeType&&8!==r.nodeType&&!Ce.test(m+x.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[x.expando]?t:new x.Event(m,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),e=null==e?[t]:x.makeArray(e,[t]),d=x.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(r,e))){if(!i&&!d.noBubble&&!y(r)){for(l=d.delegateType||m,Ce.test(l+m)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(r.ownerDocument||_)&&f.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=f[o++])&&!t.isPropagationStopped();)h=a,t.type=o>1?l:d.bindType||m,(u=(Z.get(a,"events")||Object.create(null))[t.type]&&Z.get(a,"handle"))&&u.apply(a,e),(u=c&&a[c])&&u.apply&&Q(a)&&(t.result=u.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(f.pop(),e)||!Q(r)||c&&g(r[m])&&!y(r)&&((s=r[c])&&(r[c]=null),x.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,xe),r[m](),t.isPropagationStopped()&&h.removeEventListener(m,xe),x.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(t,e,n){var r=x.extend(new x.Event,n,{type:t,isSimulated:!0});x.event.trigger(r,null,e)}}),x.fn.extend({trigger:function(t,e){return this.each((function(){x.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return x.event.trigger(t,e,n,!0)}}),v.focusin||x.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){x.event.simulate(e,t.target,x.event.fix(t))};x.event.special[e]={setup:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,e);i||r.addEventListener(t,n,!0),Z.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Z.access(r,e)-1;i?Z.access(r,e,i):(r.removeEventListener(t,n,!0),Z.remove(r,e))}}}));var ke=n.location,Se={guid:Date.now()},Te=/\?/;x.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+t),e};var Oe=/\[\]$/,Ee=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Ne=/^(?:input|select|textarea|keygen)/i;function Ae(t,e,n,r){var i;if(Array.isArray(e))x.each(e,(function(e,i){n||Oe.test(t)?r(t,i):Ae(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==C(e))r(t,e);else for(i in e)Ae(t+"["+i+"]",e[i],n,r)}x.param=function(t,e){var n,r=[],i=function(t,e){var n=g(e)?e():e;r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!x.isPlainObject(t))x.each(t,(function(){i(this.name,this.value)}));else for(n in t)Ae(n,t[n],e,i);return r.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=x.prop(this,"elements");return t?x.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!x(this).is(":disabled")&&Ne.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!mt.test(t))})).map((function(t,e){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}})):{name:e.name,value:n.replace(Ee,"\r\n")}})).get()}});var Pe=/%20/g,qe=/#.*$/,je=/([?&])_=[^&]*/,Re=/^(.*?):[ \t]*([^\r\n]*)$/gm,De=/^(?:GET|HEAD)$/,Le=/^\/\//,Me={},$e={},Ue="*/".concat("*"),ze=_.createElement("a");function Fe(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(L)||[];if(g(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Be(t,e,n,r){var i={},o=t===$e;function a(s){var l;return i[s]=!0,x.each(t[s]||[],(function(t,s){var c=s(e,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),a(c),!1)})),l}return a(e.dataTypes[0])||!i["*"]&&a("*")}function He(t,e){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&x.extend(!0,t,r),t}ze.href=ke.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ue,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?He(He(t,x.ajaxSettings),e):He(x.ajaxSettings,t)},ajaxPrefilter:Fe(Me),ajaxTransport:Fe($e),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,a,s,l,c,u,d,h,p=x.ajaxSetup({},e),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?x(f):x.event,v=x.Deferred(),g=x.Callbacks("once memory"),y=p.statusCode||{},b={},w={},C="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Re.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||C;return r&&r.abort(e),S(0,e),this}};if(v.promise(k),p.url=((t||p.url||ke.href)+"").replace(Le,ke.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(L)||[""],null==p.crossDomain){l=_.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=ze.protocol+"//"+ze.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),Be(Me,p,e,k),c)return k;for(d in(u=x.event&&p.global)&&0==x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!De.test(p.type),i=p.url.replace(qe,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Pe,"+")):(h=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(Te.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(je,"$1"),h=(Te.test(i)?"&":"?")+"_="+Se.guid+++h),p.url=i+h),p.ifModified&&(x.lastModified[i]&&k.setRequestHeader("If-Modified-Since",x.lastModified[i]),x.etag[i]&&k.setRequestHeader("If-None-Match",x.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ue+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(f,k,p)||c))return k.abort();if(C="abort",g.add(p.complete),k.done(p.success),k.fail(p.error),r=Be($e,p,e,k)){if(k.readyState=1,u&&m.trigger("ajaxSend",[k,p]),c)return k;p.async&&p.timeout>0&&(s=n.setTimeout((function(){k.abort("timeout")}),p.timeout));try{c=!1,r.send(b,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,a,l){var d,h,_,b,w,C=e;c||(c=!0,s&&n.clearTimeout(s),r=void 0,o=l||"",k.readyState=t>0?4:0,d=t>=200&&t<300||304===t,a&&(b=function(t,e,n){for(var r,i,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||t.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,k,a)),!d&&x.inArray("script",p.dataTypes)>-1&&(p.converters["text script"]=function(){}),b=function(t,e,n,r){var i,o,a,s,l,c={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(o=u.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=c[l+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,b,k,d),d?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(x.lastModified[i]=w),(w=k.getResponseHeader("etag"))&&(x.etag[i]=w)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=b.state,h=b.data,d=!(_=b.error))):(_=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(e||C)+"",d?v.resolveWith(f,[h,C,k]):v.rejectWith(f,[k,C,_]),k.statusCode(y),y=void 0,u&&m.trigger(d?"ajaxSuccess":"ajaxError",[k,p,d?h:_]),g.fireWith(f,[k,C]),u&&(m.trigger("ajaxComplete",[k,p]),--x.active||x.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return x.get(t,e,n,"json")},getScript:function(t,e){return x.get(t,void 0,e,"script")}}),x.each(["get","post"],(function(t,e){x[e]=function(t,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),x.ajax(x.extend({url:t,type:e,dataType:i,data:n,success:r},x.isPlainObject(t)&&t))}})),x.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),x._evalUrl=function(t,e,n){return x.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){x.globalEval(t,e,n)}})},x.fn.extend({wrapAll:function(t){var e;return this[0]&&(g(t)&&(t=t.call(this[0])),e=x(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return g(t)?this.each((function(e){x(this).wrapInner(t.call(this,e))})):this.each((function(){var e=x(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=g(t);return this.each((function(n){x(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(t){return!x.expr.pseudos.visible(t)},x.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var We={0:200,1223:204},Ge=x.ajaxSettings.xhr();v.cors=!!Ge&&"withCredentials"in Ge,v.ajax=Ge=!!Ge,x.ajaxTransport((function(t){var e,r;if(v.cors||Ge&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);e=function(t){return function(){e&&(e=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(We[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),r=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),x.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return x.globalEval(t),t}}}),x.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),x.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(r,i){e=x("