PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
themes
/
wilcity
/
assets
/
production
/
js
!function(){"use strict";function e(e){var t=void 0===e?jQuery(".wilcity-grid"):e;t.length&&t.each(function(){var e=jQuery(this),n=!1;if(!e.parent().hasClass("wil-tab__panel")&&!e.parent().hasClass("vc_tta-panel-body")||(n=!0,e.parent().hasClass("active")&&(!e.parent().hasClass("vc_tta-panel-body")||e.parent().parent().hasClass("vc_active")))){var i=0,r=0,o=e.find(".js-grid-item");o.length>1&&(e.data("highestBody")?(i=t.data("highestBody"),r=t.data("highestFooter")):(o.each(function(){i<jQuery(this).find(".js-grid-item-body").outerHeight()&&(i=jQuery(this).find(".js-grid-item-body").outerHeight()),r<jQuery(this).find(".js-grid-item-footer").outerHeight()&&(r=jQuery(this).find(".js-grid-item-footer").outerHeight())}),e.data("highestBody",i),e.data("highestFooter",r)),o.find(".js-grid-item-body").css({height:i}),o.find(".js-grid-item-footer").css({height:r}),n&&e.parent().data("calculatedHeight",!0))}})}var t=function(){};t.isNull=function(e){return""===e||null===e||"object"==typeof e&&!Object.keys(e).length||void 0===e},t.mapboxGetAddressByLatLng=function(e,t){var n="https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURIComponent(e+","+t)+".json?access_token="+WILOKE_GLOBAL.mapAPI+"&limit=10&autocomplete=true";jQuery.get(n,function(e){console.log(e)})},t.count=function(e){return"object"==typeof e?Object.keys(e).length:e.length},t.isRestError=function(e){return void 0!==e.error},t.buildRestRequest=function(e){return WILOKE_GLOBAL.restAPI+e},t.consoleInternalMessage=function(e){e.error.internalMessage,console.log(e.error.internalMessage)},t.consoleUserMessage=function(e){e.error.userMessage,console.log(e.error.userMessage)},t.getUserMessage=function(e){return typeof e.error.userMessage&&e.error.userMessage},t.buildFirebaseUsersKey=function(e){return"messages/users/___"+e+"___"},t.maybeMapMessage=function(e){if(-1===e.indexOf("longitude"))return WilCityHelpers.unSlashed(e);try{var t=JSON.parse(e),n="https://www.google.com/maps/search/?api=1&query="+t.latitude+","+t.longitude;return'<a target="_blank" class="wilcity-single-map" href="'+n+'">'+n+"</a>"}catch(e){return""}},t.objectReserve=function(e){for(var t=Object.keys(e),n=Object.values(e).reverse(),i={},r=0;r<n.length;r++)i[t[r]]=n[r];return i},t.timestampToDate=function(e,t){var n=new Date(e);switch(t){case"Y-m-d":return n.getFullYear()+"-"+n.getMonth()+"-"+n.getDay();case"m/d/Y":return n.getMonth()+"-"+n.getDay()+"-"+n.getFullYear();case"d/m/Y":return n.getDay()+"-"+n.getMonth()+"-"+n.getFullYear();default:return(new Date-e)/864e5>1?n.toLocaleDateString(WILOKE_GLOBAL.localeCode,{year:"numeric",month:"short",day:"numeric"}):n.toLocaleTimeString(WILOKE_GLOBAL.localeCode)}},t.renderSentAt=function(e,n){e=parseInt(e);var i=(new Date).getTime()-e;if(i<=6e4)return WILCITY_I18.oneMinuteAgo;if(i<=6e5)return WILCITY_I18.aFewMinutesAgo;if(i<36e5)return parseInt(i/1e3/60)+" "+WILCITY_I18.minutesAgo;if(i<864e5){var r=parseInt(i/1e3/60/60);return r+(r>1?" "+WILCITY_I18.hoursAgo:" "+WILCITY_I18.hourAgo)}return t.timestampToDate(e,n)},t.unSlashed=function(e){return e.replace(/\\/g,"")},t.setFirebaseID=function(e){"undefined"!=typeof Storage?localStorage.setItem("firebaseUserID",e):alert(WILCITY_I18.browserDoesNotSupportLocalStore)},t.getFirebaseUserID=function(){if("undefined"!=typeof Storage)return localStorage.getItem("firebaseUserID");alert(WILCITY_I18.browserDoesNotSupportLocalStore)},t.clearFirebaseID=function(){"undefined"!=typeof Storage?localStorage.removeItem("firebaseUserID"):alert(WILCITY_I18.browserDoesNotSupportLocalStore)},t.scrollTop=function(e,t){(void 0===e?jQuery("html, body"):jQuery(e)).stop().animate({scrollTop:0},t,"swing")},t.validEmail=function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},t.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},t.isMobile=function(e,n){if(void 0!==n&&n<=window.innerWidth)return!1;switch(e){case"Android":return navigator.userAgent.match(/Android/i);case"BlackBerry":return navigator.userAgent.match(/BlackBerry/i);case"IOS":return navigator.userAgent.match(/iPhone|iPad|iPod/i);case"Opera":return navigator.userAgent.match(/Opera Mini/i);case"Windows":return navigator.userAgent.match(/IEMobile/i);default:return t.isMobile("Android")||t.isMobile("BlackBerry")||t.isMobile("IOS")||t.isMobile("Opera")||t.isMobile("Windows")}},t.convertFirebaseToOrderByDescTimestamp=function(e){var t=Object.values(e),n=Object.keys(e);for(var i in t)t[i].key=n[i];return t.reverse(),t},t.additionalHeightToScrollTop=function(){var e=0;jQuery("header.js-header-sticky").length&&(e=88);var t=jQuery("#wpadminbar");return t.lenght&&(e+=t.outerHeight()),e},t.getParamFromUrl=function(e,t){var n=void 0!==t?t:window.location.href;if(-1===n.indexOf(e+"="))return!1;var i=n.split(e+"=");return(-1!==i[1].indexOf("#")?i[1].split("#"):i[1].split("&"))[0]},t.pushState=function(e){var n="";-1===e.indexOf("paged=")&&-1!==window.location.href.indexOf("paged=")&&(n=t.getParamFromUrl("page",window.location.href)),n.length&&(-1!==e.indexOf("?")?e+="&paged="+n:e+="?paged="+n),window.history.pushState({href:e},"",e)},t.buildRouter=function(e,t){if(-1===(t=void 0!==t?t:window.location.href).indexOf("?"))t+="#"+e;else{var n=t.split(",");t=n[0]+"#"+e+"?"+n[1]}return t},t.buildQuery=function(e,t,n){return n=void 0!==n?n:window.location.href,t=encodeURIComponent(t),n=-1===n.indexOf("?")?n+"?"+e+"="+t:n+"&"+e+"="+t};var n=function(e,t,n,i,r){this.currentPage=void 0!==r?r:1,this.totalPosts=t,this.postsPerPage=n,this.maxPages=i,this.nextPage=0,this.prevPage=0,this.xhr=null,this.$wrapper=e};n.prototype.resetPagination=function(){var e=this;this.$wrapper.on("resetPagination",function(t,n,i){e.currentPage=n,e.totalPosts=i,e.$wrapper.html(e.createPagination())})},n.prototype.ajaxLoading=function(){var e=this;jQuery("body").on("click",".pagination_pageItem__3SatM",function(t){t.preventDefault(),null!==e.xhr&&200!==e.xhr.status&&e.xhr.abort(),e.$wrapper.find(".pagination_pageItem__3SatM.current").removeClass("current");var n=jQuery(t.currentTarget),i=e.$wrapper.data("gridid");jQuery("body").trigger("blockLoading",[i]),n.addClass("current"),e.currentPage=n.find("a").attr("data-page");var r={page:e.currentPage,action:e.$wrapper.data("action")};r=Object.assign({},e.$wrapper.data(),r),e.xhr=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:r,success:function(t){var n=jQuery("body");n.trigger("paginationLoaded",[t,e.$wrapper.data("gridid")]),t.success?e.$wrapper.html(e.createPagination()):e.$wrapper.addClass("hidden"),n.trigger("listingLoaded",[e.$wrapper.data("gridid")])}})})},n.prototype.createPagination=function(){var e=[],t="";if(this.totalPosts=parseInt(this.totalPosts),this.postsPerPage=parseInt(this.postsPerPage),0===this.totalPosts||this.totalPosts<=this.postsPerPage)return"";if(this.currentPage=parseInt(this.currentPage,10),this.nextPage=this.currentPage+1,this.prevPage=this.currentPage-1,this.maxPages=Math.ceil(this.totalPosts/this.postsPerPage),this.maxPages<=1)return!1;if(this.maxPages<=8)for(var n=1;n<=this.maxPages;n++)e.push(n);else if(this.currentPage<=3)e=[1,2,3,4,"x",this.maxPages];else if(this.currentPage<7)e=[1,2,3,4,5,6,7,"x",this.maxPages];else{e=[1,"x"];for(var i=2;i>=0;i--)e.push(this.currentPage-i);if(this.maxPages-this.currentPage<=8)for(var r=this.currentPage+1;r<=this.maxPages;r++)e.push(r);else{for(var o=0;o<=2;o++)e.push(this.currentPage+1+o);e.push("x"),e.push(this.maxPages)}}for(var s=0,a=e.length;s<a;s++)this.currentPage===e[s]?t+='<li class="pagination_pageItem__3SatM current"><a class="pagination_pageLink__2UQhK" data-page="'+e[s]+'">'+e[s]+"</a></li>":"x"===e[s]?t+='<li class="pagination_pageItem__3SatM disable"><span class="pagination_pageLink__2UQhK"><i class="la la-ellipsis-h"></i></span></li>':t+='<li class="pagination_pageItem__3SatM"><a href="#" class="pagination_pageLink__2UQhK" data-page="'+e[s]+'">'+e[s]+"</a></li>";return""!==t&&(1!==this.currentPage&&(t='<li class="pagination_pageItem__3SatM"><a href="#" class="pagination_pageLink__2UQhK" data-page="'+this.prevPage+'"><i class="la la-angle-left"></i></a></li>'+t),this.currentPage!==this.maxPages&&(t+='<li class="pagination_pageItem__3SatM next"><a href="#" class="pagination_pageLink__2UQhK" data-page="'+this.nextPage+'"><i class="la la-angle-right"></i></a></li>')),t};var i=function(){this.$toggle=jQuery(".wilcity-toggle-follow"),this.init()};i.prototype.init=function(){if(!this.$toggle.length)return!1;this.$toggle.on("click",function(e){if(e.preventDefault(),"yes"!==WILOKE_INLINE_GLOBAL.isUserLoggedIn)return document.getElementById("wilcity-login-btn").click(),!1;var t=jQuery(e.currentTarget),n=t.data("authorid"),i=jQuery("#wilcity-follower-number-"+n),r=t.data("currentStatus");jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_update_following",authorID:n},success:function(e){e.success?(i.length&&i.find(".wilcity-print-number").html(e.data),t.data("textonly")?"followingtext"===r?(t.html('<i class="la la-refresh"></i> '+t.data("followtext")),t.data("currentStatus","followtext")):(t.html('<i class="la la-refresh"></i> '+t.data("followingtext")),t.data("currentStatus","followingtext")):(t.find("span").html(e.data),"followingtext"===r?(t.html("<span>"+e.data+"</span> "+t.data("followtext")),t.data("currentStatus","followtext")):(t.html('<span class="color-primary">'+e.data+"</span> "+t.data("followingtext")),t.data("currentStatus","followingtext")))):alert(e.data.msg)}})})};var r=function(e){e.length&&(this.$btn=e,this.toggle())};r.prototype.toggle=function(){this.$btn.hasClass("wil-btn--loading")?(this.$btn.find(".pill-loading_module__3LZ6v").addClass("hidden"),this.$btn.removeClass("wil-btn--loading")):(this.$btn.addClass("wil-btn--loading"),this.$btn.find(".pill-loading_module__3LZ6v").length?this.$btn.find(".pill-loading_module__3LZ6v").removeClass("hidden"):this.$btn.append('<div class="pill-loading_module__3LZ6v"><div class="pill-loading_loader__3LOnT"></div></div>'))};var o=function(){};o.configuration=function(){return console.log("dad",jQuery("#wilcity-valid-coupon-code").attr("value")),{couponCode:jQuery("#wilcity-valid-coupon-code").attr("value")}};var s=function(e){this.$btn=e,e.length&&(this.text=null,this.xhr=null,this.oData={token:"",email:"",action:"wiloke_submission_buy_plan_via_stripe"})};s.prototype.ajaxRequest=function(){var e=this;null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),new r(this.$btn);var t=o.configuration();t=Object.assign(this.oData,t),this.xhr=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:t,success:function(t){t.success?window.location.href=t.data.thankyou:jQuery("#wilcity-print-msg").trigger("printErrMsg",[t.data.msg]),new r(e.$btn)}})},s.prototype.proceed=function(){var e=this;return new Promise(function(t,n){e.oStripe=StripeCheckout.configure({key:WILCITY_GLOBAL.oStripe.publishableKey,locale:"auto"}),e.oStripe.open({name:WILCITY_GLOBAL.oGeneral.brandName,zipCode:!1,closed:function(){new r(e.$btn)},token:function(n){e.oData.token=n.id,e.oData.email=n.email,t(e.oData)}})})},s.prototype.pay=function(){var e=this;this.$btn.on("click",function(t){var n=jQuery(t.currentTarget);t.preventDefault(),jQuery("#wilcity-print-msg").addClass("hidden"),new r(n),e.proceed().then(function(t){e.ajaxRequest()})})};var a=function(e){this.$btn=e,e.length&&(this.xhr=null,this.oData={action:"wiloke_submission_pay_with_paypal"},console.log("dad"))};a.prototype.proceed=function(){var e=this,t=o.configuration();t=Object.assign(this.oData,t),this.xhr=jQuery.ajax({type:"POST",data:t,url:WILOKE_GLOBAL.ajaxurl,success:function(t){t.success?void 0!==t.data.redirectTo&&(window.location.href=t.data.redirectTo):jQuery("#wilcity-print-msg").trigger("printErrMsg",[t.data.msg]),new r(e.$btn)}})},a.prototype.pay=function(){var e=this;this.$btn.on("click",function(t){t.preventDefault(),jQuery("#wilcity-print-msg").addClass("hidden"),new r(e.$btn),null!==e.xhr&&200!==e.xhr.status&&e.xhr.abort(),e.proceed()})};var l=function(e){this.$btn=e,e.length&&(this.xhr=null,this.oData={action:"wiloke_submission_pay_with_directbanktransfer"})};l.prototype.proceed=function(){var e=this,t=o.configuration();t=Object.assign(this.oData,t),this.xhr=jQuery.ajax({type:"POST",data:t,url:WILOKE_GLOBAL.ajaxurl,success:function(t){t.success?void 0!==t.data.redirectTo&&(window.location.href=t.data.redirectTo):jQuery("#wilcity-print-msg").trigger("printErrMsg",[t.data.msg]),new r(e.$btn)}})},l.prototype.pay=function(){var e=this;this.$btn.on("click",function(t){t.preventDefault(),jQuery("#wilcity-print-msg").addClass("hidden"),new r(e.$btn),null!==e.xhr&&200!==e.xhr.status&&e.xhr.abort(),e.proceed()})};var u=function(){jQuery("#wilcity-submit-coupon").on("click",function(e){e.preventDefault();var t=jQuery(e.currentTarget),n=jQuery("#wilcity-coupon-code").val(),i=jQuery("#wilcity-coupon-msg");if(""===n)return!1;new r(t),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wiloke_submission_verify_coupon",code:n},success:function(e){jQuery(".column-sub").html(e.data.subTotal),jQuery(".column-discount").html(e.data.discount),jQuery(".column-total").html(e.data.total),e.success?jQuery("#wilcity-valid-coupon-code").attr("value",n):jQuery("#wilcity-valid-coupon-code").attr("value",""),i.html('<div class="mt-20"></div>'+e.data.msg),new r(t)}})})},c=function(e){this.$btn=e,this.submit()};c.prototype.submit=function(){this.$btn.on("click",function(e){e.preventDefault(),$.ajax({type:"POST",data:{action:"wilcity_get_pay_and_publish_url"},url:WILOKE_GLOBAL.ajaxurl,success:function(e){e.success?window.location.href=e.data.redirectTo:alert(e.data.msg)}})})};var h="undefined"!=typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function d(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}function p(e,t){if(!e)throw new Error("[vuex] "+t)}var f=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"==typeof n?n():n)||{}},g={namespaced:{configurable:!0}};g.namespaced.get=function(){return!!this._rawModule.namespaced},f.prototype.addChild=function(e,t){this._children[e]=t},f.prototype.removeChild=function(e){delete this._children[e]},f.prototype.getChild=function(e){return this._children[e]},f.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},f.prototype.forEachChild=function(e){d(this._children,e)},f.prototype.forEachGetter=function(e){this._rawModule.getters&&d(this._rawModule.getters,e)},f.prototype.forEachAction=function(e){this._rawModule.actions&&d(this._rawModule.actions,e)},f.prototype.forEachMutation=function(e){this._rawModule.mutations&&d(this._rawModule.mutations,e)},Object.defineProperties(f.prototype,g);var v=function(e){this.register([],e,!1)};v.prototype.get=function(e){return e.reduce(function(e,t){return e.getChild(t)},this.root)},v.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")},"")},v.prototype.update=function(e){!function e(t,n,i){"production"!==process.env.NODE_ENV&&b(t,i);n.update(i);if(i.modules)for(var r in i.modules){if(!n.getChild(r))return void("production"!==process.env.NODE_ENV&&console.warn("[vuex] trying to add a new module '"+r+"' on hot reloading, manual reload is needed"));e(t.concat(r),n.getChild(r),i.modules[r])}}([],this.root,e)},v.prototype.register=function(e,t,n){var i=this;void 0===n&&(n=!0),"production"!==process.env.NODE_ENV&&b(e,t);var r=new f(t,n);0===e.length?this.root=r:this.get(e.slice(0,-1)).addChild(e[e.length-1],r);t.modules&&d(t.modules,function(t,r){i.register(e.concat(r),t,n)})},v.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];t.getChild(n).runtime&&t.removeChild(n)};var m,_={assert:function(e){return"function"==typeof e},expected:"function"},y={getters:_,mutations:_,actions:{assert:function(e){return"function"==typeof e||"object"==typeof e&&"function"==typeof e.handler},expected:'function or object with "handler" function'}};function b(e,t){Object.keys(y).forEach(function(n){if(t[n]){var i=y[n];d(t[n],function(t,r){p(i.assert(t),function(e,t,n,i,r){var o=t+" should be "+r+' but "'+t+"."+n+'"';e.length>0&&(o+=' in module "'+e.join(".")+'"');return o+=" is "+JSON.stringify(i)+"."}(e,n,r,t,i.expected))})}})}var w=function e(t){var n=this;void 0===t&&(t={}),!m&&"undefined"!=typeof window&&window.Vue&&function(e){if(m&&e===m)return void("production"!==process.env.NODE_ENV&&console.error("[vuex] already installed. Vue.use(Vuex) should be called only once."));!function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:n});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[n].concat(e.init):n,t.call(this,e)}}function n(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}(m=e)}(window.Vue),"production"!==process.env.NODE_ENV&&(p(m,"must call Vue.use(Vuex) before creating a store instance."),p("undefined"!=typeof Promise,"vuex requires a Promise polyfill in this browser."),p(this instanceof e,"store must be called with the new operator."));var i=t.plugins;void 0===i&&(i=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new v(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new m;var o=this,s=this.dispatch,a=this.commit;this.dispatch=function(e,t){return s.call(o,e,t)},this.commit=function(e,t,n){return a.call(o,e,t,n)},this.strict=r;var l=this._modules.root.state;I(this,l,[],this._modules.root),S(this,l),i.forEach(function(e){return e(n)}),(void 0!==t.devtools?t.devtools:m.config.devtools)&&function(e){h&&(e._devtoolHook=h,h.emit("vuex:init",e),h.on("vuex:travel-to-state",function(t){e.replaceState(t)}),e.subscribe(function(e,t){h.emit("vuex:mutation",e,t)}))}(this)},C={state:{configurable:!0}};function T(e,t){return t.indexOf(e)<0&&t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function E(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;I(e,n,[],e._modules.root,!0),S(e,n,t)}function S(e,t,n){var i=e._vm;e.getters={};var r={};d(e._wrappedGetters,function(t,n){r[n]=function(){return t(e)},Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})});var o=m.config.silent;m.config.silent=!0,e._vm=new m({data:{$$state:t},computed:r}),m.config.silent=o,e.strict&&function(e){e._vm.$watch(function(){return this._data.$$state},function(){"production"!==process.env.NODE_ENV&&p(e._committing,"do not mutate vuex store state outside mutation handlers.")},{deep:!0,sync:!0})}(e),i&&(n&&e._withCommit(function(){i._data.$$state=null}),m.nextTick(function(){return i.$destroy()}))}function I(e,t,n,i,r){var o=!n.length,s=e._modules.getNamespace(n);if(i.namespaced&&(e._modulesNamespaceMap[s]=i),!o&&!r){var a=k(t,n.slice(0,-1)),l=n[n.length-1];e._withCommit(function(){m.set(a,l,i.state)})}var u=i.context=function(e,t,n){var i=""===t,r={dispatch:i?e.dispatch:function(n,i,r){var o=x(n,i,r),s=o.payload,a=o.options,l=o.type;if(a&&a.root||(l=t+l,"production"===process.env.NODE_ENV||e._actions[l]))return e.dispatch(l,s);console.error("[vuex] unknown local action type: "+o.type+", global type: "+l)},commit:i?e.commit:function(n,i,r){var o=x(n,i,r),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=t+l,"production"===process.env.NODE_ENV||e._mutations[l])?e.commit(l,s,a):console.error("[vuex] unknown local mutation type: "+o.type+", global type: "+l)}};return Object.defineProperties(r,{getters:{get:i?function(){return e.getters}:function(){return function(e,t){var n={},i=t.length;return Object.keys(e.getters).forEach(function(r){if(r.slice(0,i)===t){var o=r.slice(i);Object.defineProperty(n,o,{get:function(){return e.getters[r]},enumerable:!0})}}),n}(e,t)}},state:{get:function(){return k(e.state,n)}}}),r}(e,s,n);i.forEachMutation(function(t,n){!function(e,t,n,i){(e._mutations[t]||(e._mutations[t]=[])).push(function(t){n.call(e,i.state,t)})}(e,s+n,t,u)}),i.forEachAction(function(t,n){var i=t.root?n:s+n,r=t.handler||t;!function(e,t,n,i){(e._actions[t]||(e._actions[t]=[])).push(function(t,r){var o,s=n.call(e,{dispatch:i.dispatch,commit:i.commit,getters:i.getters,state:i.state,rootGetters:e.getters,rootState:e.state},t,r);return(o=s)&&"function"==typeof o.then||(s=Promise.resolve(s)),e._devtoolHook?s.catch(function(t){throw e._devtoolHook.emit("vuex:error",t),t}):s})}(e,i,r,u)}),i.forEachGetter(function(t,n){!function(e,t,n,i){if(e._wrappedGetters[t])return void("production"!==process.env.NODE_ENV&&console.error("[vuex] duplicate getter key: "+t));e._wrappedGetters[t]=function(e){return n(i.state,i.getters,e.state,e.getters)}}(e,s+n,t,u)}),i.forEachChild(function(i,o){I(e,t,n.concat(o),i,r)})}function k(e,t){return t.length?t.reduce(function(e,t){return e[t]},e):e}function x(e,t,n){var i;return null!==(i=e)&&"object"==typeof i&&e.type&&(n=t,t=e,e=e.type),"production"!==process.env.NODE_ENV&&p("string"==typeof e,"expects string as the type, but found "+typeof e+"."),{type:e,payload:t,options:n}}C.state.get=function(){return this._vm._data.$$state},C.state.set=function(e){"production"!==process.env.NODE_ENV&&p(!1,"use store.replaceState() to explicit replace store state.")},w.prototype.commit=function(e,t,n){var i=this,r=x(e,t,n),o=r.type,s=r.payload,a=r.options,l={type:o,payload:s},u=this._mutations[o];u?(this._withCommit(function(){u.forEach(function(e){e(s)})}),this._subscribers.forEach(function(e){return e(l,i.state)}),"production"!==process.env.NODE_ENV&&a&&a.silent&&console.warn("[vuex] mutation type: "+o+". Silent option has been removed. Use the filter functionality in the vue-devtools")):"production"!==process.env.NODE_ENV&&console.error("[vuex] unknown mutation type: "+o)},w.prototype.dispatch=function(e,t){var n=this,i=x(e,t),r=i.type,o=i.payload,s={type:r,payload:o},a=this._actions[r];if(a){try{this._actionSubscribers.filter(function(e){return e.before}).forEach(function(e){return e.before(s,n.state)})}catch(e){"production"!==process.env.NODE_ENV&&(console.warn("[vuex] error in before action subscribers: "),console.error(e))}return(a.length>1?Promise.all(a.map(function(e){return e(o)})):a[0](o)).then(function(e){try{n._actionSubscribers.filter(function(e){return e.after}).forEach(function(e){return e.after(s,n.state)})}catch(e){"production"!==process.env.NODE_ENV&&(console.warn("[vuex] error in after action subscribers: "),console.error(e))}return e})}"production"!==process.env.NODE_ENV&&console.error("[vuex] unknown action type: "+r)},w.prototype.subscribe=function(e){return T(e,this._subscribers)},w.prototype.subscribeAction=function(e){return T("function"==typeof e?{before:e}:e,this._actionSubscribers)},w.prototype.watch=function(e,t,n){var i=this;return"production"!==process.env.NODE_ENV&&p("function"==typeof e,"store.watch only accepts a function."),this._watcherVM.$watch(function(){return e(i.state,i.getters)},t,n)},w.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._vm._data.$$state=e})},w.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"==typeof e&&(e=[e]),"production"!==process.env.NODE_ENV&&(p(Array.isArray(e),"module path must be a string or an Array."),p(e.length>0,"cannot register the root module by using registerModule.")),this._modules.register(e,t),I(this,this.state,e,this._modules.get(e),n.preserveState),S(this,this.state)},w.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),"production"!==process.env.NODE_ENV&&p(Array.isArray(e),"module path must be a string or an Array."),this._modules.unregister(e),this._withCommit(function(){var n=k(t.state,e.slice(0,-1));m.delete(n,e[e.length-1])}),E(this)},w.prototype.hotUpdate=function(e){this._modules.update(e),E(this,!0)},w.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(w.prototype,C);var A=function(e,t,n,i,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,h="function"==typeof n?n.options:n;if(e&&e.render&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0,r&&(h.functional=!0)),i&&(h._scopeId=i),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},h._ssrRegister=c):t&&(c=s?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),c)if(h.functional){var d=h.render;h.render=function(e,t){return c.call(t),d(e,t)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,c):[c]}return n},P={data:function(){return{isLoading:!1,isOpenPopup:"open"==this.status}},props:{popupId:{type:String,default:""},popupTitle:{type:String,default:""},icon:{type:String,default:""},wrapperClass:{type:String,default:"popup_module__3M-0- pos-f-full popup_md__3El3k popup_mobile-full__1hyc4"}},computed:{loadingClass:function(){return this.isLoading?"line-loading_module__SUlA1 pos-a-top":"line-loading_module__SUlA1 pos-a-top hidden"},parseWrapperClass:function(){var e=this.wrapperClass;return this.isOpenPopup||void 0!==this.$store&&"open"==this.$store.getters.getPopupStatus(this.popupId)?(WilCityHelpers.isMobile()&&document.body.classList.add("disabled-scroll"),e+" active"):(this.removeDisabledScroll(),e)}},methods:{closePopup:function(){this.isOpenPopup=!1,void 0!==this.$store&&"close"!==this.$store.getters.getPopupStatus(this.popupId)&&(this.removeDisabledScroll(),this.$store.dispatch("closePopup",{id:this.popupId,status:"close"}))},removeDisabledScroll:function(){WilCityHelpers.isMobile()&&document.body.classList.remove("disabled-scroll")}},mounted:function(){var e=this;this.$parent.$on("line-loading",function(t){e.isLoading="yes"==t}),this.$parent.$on("onOpenPopup",function(){jQuery(document.body).trigger("popup_"+e.popupId+"_open"),e.isOpenPopup=!0}),this.$parent.$on("onClosePopup",function(){jQuery(document.body).trigger("popup_"+e.popupId+"_close"),e.c=!1,e.closePopup(),e.isLoading=!1,e.removeDisabledScroll()})}},O=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.parseWrapperClass,attrs:{id:e.popupId,"data-popup-content":e.popupId}},[n("div",{staticClass:"wil-overlay js-popup-overlay"}),e._v(" "),n("div",{staticClass:"wil-tb"},[n("div",{staticClass:"wil-tb__cell"},[n("div",{staticClass:"popup_content__3CJVi"},[n("header",{staticClass:"popup_header__2QTxC clearfix"},[n("h3",{staticClass:"popup_title__3q6Xh"},[e.icon?n("i",{class:e.icon}):e._e(),n("span",{domProps:{innerHTML:e._s(e.popupTitle)}})]),e._v(" "),n("div",{staticClass:"popup_headerRight__c4FcP"},[n("span",{staticClass:"popup_close__mJx2A color-primary--hover js-toggle-close",on:{click:e.closePopup}},[n("i",{staticClass:"la la-close"})])])]),e._v(" "),n("div",{staticClass:"popup_body__1wtsy wil-scroll-bar"},[n("div",{class:e.loadingClass,attrs:{id:"popup-line-loading"}},[n("div",{staticClass:"line-loading_loader__FjIcM"})]),e._v(" "),e._t("body")],2),e._v(" "),e._t("before-footer"),e._v(" "),e._t("footer")],2)])])])};O._withStripped=!0;var N=A({render:O,staticRenderFns:[]},void 0,P,void 0,!1,void 0,void 0,void 0),L={data:function(){return{isHidden:!1}},props:{msg:{type:String,default:""},hasRemove:{type:String,default:"no"},status:{type:String,default:""},icon:{type:String,default:""},additionalClass:{type:String,default:""}},computed:{wrapperClass:function(){var e="alert_module__Q4QZx";switch(this.status){case"danger":e+=" alert_danger__2ajVf";break;case"success":e+=" alert_success__1nkos";break;case"warning":e+=" alert_warning__2IUiO";break;case"info":e+=" alert_info__2dwkg";break;case"dark":e+=" alert_dark__3ks";default:e+=" "}return e+" "+this.additionalClass}},methods:{hideMsg:function(){event.preventDefault(),this.isHidden=!0}}},D=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:!e.isHidden,expression:"!isHidden"}],class:e.wrapperClass},[n("div",{directives:[{name:"show",rawName:"v-show",value:""!=e.icon,expression:"icon!=''"}],staticClass:"alert_icon__1bDKL"},[n("i",{class:e.icon})]),e._v(" "),n("div",{staticClass:"alert_content__1ntU3",domProps:{innerHTML:e._s(e.msg)}}),"yes"==e.hasRemove?n("a",{staticClass:"alert_close__3PtGd",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.hideMsg(t)}}},[n("i",{staticClass:"la la-times"})]):e._e()])};D._withStripped=!0;var R=A({render:D,staticRenderFns:[]},void 0,L,void 0,!1,void 0,void 0,void 0),M={data:function(){return{oTranslation:WILCITY_I18,message:"",errorMsg:"",successMsg:"",isSending:"no",xhr:null}},props:["displayName","receiveId"],computed:{messageWrapper:function(){var e="field_module__1H6kT field_style2__2Znhe mb-15";return this.message.length?e+" active":e},btnClass:function(){var e="wil-btn wil-btn--primary wil-btn--block wil-btn--md";return(this.isSending=this.message.length)?e:e+" disable"}},methods:{closePopup:function(){this.$store.dispatch("closePopup",{id:"wilcity-signin-popup",status:"close"})},sendMessage:function(){var e=this;null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),this.successMsg="",this.errorMsg="",this.$emit("line-loading","yes"),this.isSending="yes",this.xhr=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_submit_new_msg",message:this.message,receiveID:this.receiveId},success:function(t){e.$emit("line-loading","no"),t.success?(e.successMsg=t.data.instantMessage,setTimeout(function(){e.successMsg="",e.errorMsg="",e.message="",jQuery(e.$el).find(".js-toggle-close").trigger("click")},3e3)):e.errorMsg=t.data.msg,e.isSending="no"}})}},components:{WilokePopup:N,WilokeMessage:R}},F=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":"wilcity-message-popup","popup-title":e.oTranslation.newMessage,icon:"la la-envelope"},on:{"on-close-popup":e.closePopup}},[n("div",{attrs:{slot:"body"},slot:"body"},[n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.errorMsg.length,expression:"errorMsg.length"}],attrs:{msg:e.errorMsg,status:"danger",icon:"la la-bullhorn"}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.successMsg.length,expression:"successMsg.length"}],attrs:{msg:e.successMsg,status:"success",icon:"la la-bullhorn"}}),e._v(" "),n("div",{staticClass:"pos-r"},[n("div",{staticClass:"field_module__1H6kT field_style2__2Znhe mb-15 active"},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.displayName,expression:"displayName"}],staticClass:"field_field__3U_Rt",attrs:{type:"text",readonly:""},domProps:{value:e.displayName},on:{input:function(t){t.target.composing||(e.displayName=t.target.value)}}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.oTranslation.to))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("div",{class:e.messageWrapper},[n("div",{staticClass:"field_wrap__Gv92k"},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.message,expression:"message"}],staticClass:"field_field__3U_Rt",domProps:{value:e.message},on:{input:function(t){t.target.composing||(e.message=t.target.value)}}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.oTranslation.message))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})])])]),e._v(" "),n("button",{class:e.btnClass,attrs:{type:"submit"},on:{click:e.sendMessage}},[e._v(e._s(e.oTranslation.send))])],1)])};F._withStripped=!0;var j=A({render:F,staticRenderFns:[]},void 0,M,void 0,!1,void 0,void 0,void 0),U={data:function(){return{oTranslation:WILCITY_I18,defaultArticleClass:"listing_module__2EnGq wil-shadow mb-30 mb-sm-20 js-listing-module js-grid-item"}},props:["oListing","layout","borderClass"],computed:{articleClass:function(){return"list"==this.$store.getters.getTemplateStyle?this.defaultArticleClass+" js-listing-list":this.defaultArticleClass+" "+this.borderClass},renderTopSecondButtonLink:function(){if("string"==typeof this.oListing.headerCardAction&&!this.oListing.headerCardAction.length||0==this.oListing.headerCardAction)return"";switch(this.oListing.headerCardType){case"email_us":return"mailto:"+this.oListing.headerCardAction;case"call_us":return"tell:"+this.oListing.headerCardAction;default:return this.oListing.permalink}},renderTopSecondIcon:function(){var e;switch(this.oListing.headerCardType){case"email_us":e="la la-envelope";break;case"call_us":e="la la-phone";break;default:e="la la-eye"}return e},renderTopSecondName:function(){switch(this.oListing.headerCardType){case"email_us":return this.oTranslation.emailUs;case"call_us":return this.oTranslation.callUs;default:return this.oListing.headerCardAction>1?this.oListing.headerCardAction+" "+this.oTranslation.totalViews:this.oListing.headerCardAction+" "+this.oTranslation.totalView}},renderFavorites2:function(){return"yes"==this.oListing.isMyFavorite?"la la-star color-primary":"la la-star-o"},favoriteClass:function(){return"yes"==this.oListing.isMyFavorite?"la la-heart color-primary":"la la-heart-o"}},methods:{isTaxonomy:function(e){return-1!==e.indexOf("taxonomy_")},detailDataRated:function(e){return 5==this.mode?2*parseFloat(e):e},renderMail:function(e){return"mailto:"+e.value},renderPhone:function(e){return"tel:"+e.value},renderWebsite:function(e){return e.value}}},W=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("article",{class:e.articleClass},[n("div",{staticClass:"listing_firstWrap__36UOZ"},[n("div",{staticStyle:{position:"absolute",top:"10px",left:"10px","z-index":"99"}},[n("a",{staticClass:"wilcity-js-favorite utility-meta_module__mfOnV utility-meta_primary__2xTvX utility-meta_border__3O9g6 mb-10 mr-5 is-event",attrs:{"data-post-id":e.oListing.postID,href:e.oListing.permalink,"data-tooltip":e.oTranslation.favoriteTooltip,"data-tooltip-placement":"top"}},[n("i",{class:e.renderFavorites2})]),e._v(" "),e.renderTopSecondButtonLink?n("a",{staticClass:"utility-meta_module__mfOnV utility-meta_light__2EzdO utility-meta_border__3O9g6 mb-10 mr-5",attrs:{href:e.renderTopSecondButtonLink}},[n("i",{class:e.renderTopSecondIcon}),e._v(" "),n("span",{domProps:{innerHTML:e._s(e.renderTopSecondName)}})]):e._e()]),e._v(" "),n("header",{staticClass:"listing_header__2pt4D"},[n("a",{attrs:{href:e.oListing.permalink}},[e.oListing.featuredImage?n("div",{staticClass:"listing_img__3pwlB pos-a-full bg-cover",style:{"background-image":"url("+e.oListing.featuredImage+")"}},[n("img",{attrs:{src:e.oListing.featuredImage,alt:e.oListing.postTitle}})]):e._e(),e._v(" "),e.oListing.oReviews&&e.oListing.oReviews.average>0?n("div",{staticClass:"listing_rated__1y7qV"},[n("div",{staticClass:"rated-small_module__1vw2B rated-small_style-2__3lb7d"},[n("div",{staticClass:"rated-small_wrap__2Eetz",attrs:{"data-rated":e.detailDataRated(e.oListing.oReviews.average)}},[n("div",{staticClass:"rated-small_overallRating__oFmKR",domProps:{textContent:e._s(e.oListing.oReviews.average)}}),e._v(" "),n("div",{staticClass:"rated-small_ratingWrap__3lzhB"},[n("div",{staticClass:"rated-small_maxRating__2D9mI"},[e._v(e._s(e.oListing.oReviews.mode))]),e._v(" "),n("div",{staticClass:"rated-small_ratingOverview__2kCI_"},[e._v(e._s(e.oListing.oReviews.quality))])])])])]):e._e()]),e._v(" "),"yes"==e.oListing.isClaimed?n("span",{staticClass:"wil-verified",domProps:{innerHTML:e._s(e.oTranslation.verfied)}}):e._e()]),e._v(" "),n("div",{staticClass:"js-grid-item-body listing_body__31ndf"},[e.oListing.logo?n("a",{staticClass:"listing_goo__3r7Tj",attrs:{href:e.oListing.permalink}},[n("div",{staticClass:"listing_logo__PIZwf bg-cover",style:{"background-image":"url("+e.oListing.logo+")"}})]):e._e(),e._v(" "),n("h2",{staticClass:"listing_title__2920A text-ellipsis"},[n("a",{attrs:{href:e.oListing.permalink},domProps:{innerHTML:e._s(e.oListing.postTitle)}})]),e._v(" "),n("div",{staticClass:"listing_tagline__1cOB3 text-ellipsis"},[e._v(e._s(e.oListing.excerpt))]),e._v(" "),n("div",{staticClass:"listing_meta__6BbCG vertical"},[e._l(e.oListing.oBody,function(t,i){return["phone"==i?n("a",{staticClass:"text-ellipsis",attrs:{href:e.renderPhone(t)}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "+e._s(t.value)+"\n ")]):"email"==i?n("a",{staticClass:"text-ellipsis",attrs:{href:e.renderMail(t)}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "+e._s(t.value)+"\n ")]):"website"==i?n("a",{staticClass:"text-ellipsis",attrs:{href:e.renderWebsite(t),target:"_blank"}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "+e._s(t.value)+"\n ")]):"price_range"==i?n("a",{staticClass:"text-ellipsis",attrs:{href:"#"}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "),n("span",{domProps:{innerHTML:e._s(t.value.minimumPrice)}}),e._v(" - "),n("span",{domProps:{innerHTML:e._s(t.value.maximumPrice)}})]):e._e(),e._v(" "),"event_starts_on"==i?n("a",{staticClass:"text-ellipsis",attrs:{href:e.oListing.permalink}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.value.day)+" "+e._s(t.value.hour))])]):"google_address"==i?n("a",{staticClass:"text-ellipsis",attrs:{target:"_blank",href:t.value.googleMapAddress}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "),n("span",{domProps:{innerHTML:e._s(t.value.address)}})]):"interested_people"==i?n("a",{staticClass:"text-ellipsis",attrs:{href:t.value}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.icon,expression:"oItem.icon"}],staticClass:"color-primary",class:t.icon}),e._v(" "),n("span",{domProps:{innerHTML:e._s(t.value)}})]):e.isTaxonomy(i)?n("div",[n("div",{staticClass:"icon-box-1_module__uyg5F mb-10"},e._l(t,function(t){return t.oIcon?n("div",{staticClass:"icon-box-1_block1__bJ25J"},[t.oIcon?n("a",{staticClass:"text-ellipsis",attrs:{href:t.link}},[void 0===t.oIcon.color?n("div",{staticClass:"icon-box-1_icon__3V5c0 rounded-circle"},[n("img",{attrs:{src:t.oIcon.url}})]):t.oIcon.color?n("div",{staticClass:"icon-box-1_icon__3V5c0 rounded-circle",style:{"background-color":t.oIcon.color}},[n("i",{class:t.oIcon.icon})]):n("div",{staticClass:"icon-box-1_icon__3V5c0 rounded-circle"},[n("i",{class:t.oIcon.icon})]),e._v(" "),n("div",{staticClass:"icon-box-1_text__3R39g",domProps:{innerHTML:e._s(t.name)}})]):e._e()]):e._e()}),0)]):"custom_field"==i?n("div",e._l(t,function(t){return n("div",{domProps:{innerHTML:e._s(t)}})}),0):e._e()]})],2)])]),e._v(" "),n("footer",{staticClass:"listing_footer__1PzMC js-grid-item-footer"},[n("div",{staticClass:"text-ellipsis"},[n("div",{staticClass:"icon-box-1_module__uyg5F text-ellipsis icon-box-1_style2__1EMOP"},[e.oListing.oTermFooter?n("div",{staticClass:"icon-box-1_block1__bJ25J"},[n("a",{staticClass:"text-ellipsis",attrs:{href:e.oListing.oTermFooter.link}},["icon"==e.oListing.oTermFooter.oIcon.type?n("div",{staticClass:"icon-box-1_icon__3V5c0 rounded-circle",style:{"background-color":e.oListing.oTermFooter.oIcon.color}},[n("i",{class:e.oListing.oTermFooter.oIcon.icon})]):n("div",{staticClass:"bg-trasparent icon-box-1_icon__3V5c0"},[n("img",{attrs:{src:e.oListing.oTermFooter.oIcon.url}})]),e._v(" "),n("div",{staticClass:"icon-box-1_text__3R39g",domProps:{innerHTML:e._s(e.oListing.oTermFooter.name)}})])]):e._e(),e._v(" "),e.oListing.oBusinessHours?n("div",{staticClass:"icon-box-1_block2__1y3h0"},[n("span",{class:e.oListing.oBusinessHours.class},[e._v(e._s(e.oListing.oBusinessHours.text))])]):e._e()])]),e._v(" "),n("div",{staticClass:"listing_footerRight__2398w"},[e.oListing.gallery?n("a",{staticClass:"wilcity-preview-gallery",attrs:{href:"#","data-tooltip":e.oTranslation.gallery,"data-tooltip-placement":"top","data-gallery":e.oListing.gallery}},[n("i",{staticClass:"la la-search-plus"})]):e._e(),e._v(" "),n("a",{staticClass:"wilcity-js-favorite",attrs:{"data-post-id":e.oListing.postID,href:"#","data-tooltip":e.oTranslation.favoriteTooltip,"data-tooltip-placement":"top"}},[n("i",{class:e.favoriteClass})])])])])};W._withStripped=!0;var B=A({render:W,staticRenderFns:[]},void 0,U,void 0,!1,void 0,void 0,void 0),V={computed:{innerClass:function(){return"pill-loading_module__3LZ6v "+this.position}},props:{position:{type:String,default:"pos-a-center"},isLoading:{type:String,default:"no"},wrapperClass:{type:String,default:"full-load"}}},H=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{directives:[{name:"show",rawName:"v-show",value:"yes"==this.isLoading,expression:"isLoading=='yes'"}],class:this.wrapperClass},[t("div",{class:this.innerClass},[t("div",{staticClass:"pill-loading_loader__3LOnT"})])])};H._withStripped=!0;var G=A({render:H,staticRenderFns:[]},void 0,V,void 0,!1,void 0,void 0,void 0),K={data:function(){return{isLoading:"no",errorMsg:"",style:"grid",aListings:[],oGeoLocation:{lat:"",lng:""},oTranslation:WILCITY_I18}},props:["postType","gridClass","postsPerPage","unit","radius","oAjaxData","tabId","borderClass"],computed:{styleObject:function(){return"grid"==this.style?{}:{width:"100%",opacity:1}}},components:{Listing:B,BlockLoading:G,WilokeMessage:R},updated:function(){this.equalHeight()},mounted:function(){var e=this;if(this.tabId.length){var t=jQuery('a[href="#'+this.tabId+'"]');t.parent().prev().length?t.on("click",function(t){var n=jQuery(t.currentTarget);n.data("clicked")||(e.getGeoLocationLatLng(),n.data("clicked",!0))}):(this.getGeoLocationLatLng(),t.data("clicked",!0))}else this.getGeoLocationLatLng();this.equalHeight()},methods:{equalHeight:function(){var t=this.tabId.length?jQuery("#"+this.tabId):jQuery(".wilcity-grid-nearbyme");if(t.length&&t.find(".js-grid-item").length){var n=t.closest(".wil-tab__panel");if(n.length&&!n.hasClass("active"))return!1;t.data("calculatedHeight")||(e(t),t.data("calculatedHeight",!0))}},getGeoLocationLatLng:function(){this.isLoading="yes";var e=localStorage.getItem("geocode");if(void 0===e||null===e)this.askForLocation();else{var t=localStorage.getItem("geocode_saved_at");if((Date.now()-t)/1e4>=600)localStorage.removeItem("geocode"),localStorage.removeItem("geocode_saved_at"),this.askForLocation();else{var n=e.split("-");this.oGeoLocation.lat=n[0],this.oGeoLocation.lng=n[1],this.fetchListings()}}},showPosition:function(e){this.oGeoLocation.lat=e.coords.latitude,this.oGeoLocation.lng=e.coords.longitude;var t=Date.now();localStorage.setItem("geocode_saved_at",t),localStorage.setItem("geocode",e.coords.latitude+"-"+e.coords.longitude),this.fetchListings()},askForLocation:function(){navigator.geolocation?navigator.geolocation.getCurrentPosition(this.showPosition):this.errorMsg=this.oTranslation.geolocationError},fetchListings:function(){var e=this;jQuery.ajax({type:"POST",data:{action:"wilcity_get_listings_nearbyme",data:this.oAjaxData,postType:this.postType,postsPerPage:this.postsPerPage,oAddress:{lat:this.oGeoLocation.lat,lng:this.oGeoLocation.lng,unit:this.unit,radius:this.radius}},url:WILOKE_GLOBAL.ajaxurl,success:function(t){t.success?e.aListings=t.data.aResults:e.errorMsg=t.data.msg,e.isLoading="no",setTimeout(function(){jQuery(e.$el).find(".wilcity-js-favorite").each(function(){jQuery(this).wilcityFavoriteStatistic()}),jQuery(e.$el).find(".wilcity-preview-gallery").each(function(){jQuery(this).wilcityMagnificGalleryPopup()})},3e3)}})}}},q=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"pos-r",staticStyle:{"min-height":"100px"}},[n("block-loading",{attrs:{position:"pos-a-center","is-loading":e.isLoading}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.errorMsg.length,expression:"errorMsg.length"}],staticClass:"row"},[n("div",{staticClass:"col-md-12 text-center",staticStyle:{"margin-top":"40px"},domProps:{innerHTML:e._s(e.errorMsg)}})]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.errorMsg.length,expression:"!errorMsg.length"}],staticClass:"row js-listing-grid",attrs:{id:e.tabId}},e._l(e.aListings,function(t){return n("div",{class:e.gridClass,style:e.styleObject},[n("listing",{attrs:{"o-listing":t,layout:e.style,"border-class":e.borderClass}})],1)}),0)],1)};q._withStripped=!0;var Q=A({render:q,staticRenderFns:[]},void 0,K,void 0,!1,void 0,void 0,void 0),Y={data:function(){return{oTranslation:WILCITY_I18,isCopied:!1}},components:{WilokePopup:N},computed:{copyBtn:function(){return this.isCopied?this.oTranslation.copied:this.oTranslation.copy},shareToEmail:function(){return"mailto:?Subject="+this.title.replace(" ","%20")+"&Body="+this.desc+" "+this.oTranslation.pleaseUseThisCouponCode+" "+this.code},shareOnTwitter:function(){return"//twitter.com/share?text="+encodeURI(this.title)+"&url="+encodeURI(this.postUrl)+"&hashtags="+encodeURI(this.code)}},props:["title","code","desc","img","postUrl"],methods:{shareOnFacebook:function(){if("undefined"==typeof FB)return"//facebook.com/sharer.php?u="+encodeURI(this.postUrl)+"&t="+encodeURI(this.title)+"&summary=dadad&thumbnail="+encodeURI(this.img);FB.ui({method:"share",title:this.title+"?og:image="+this.img,href:this.postUrl,picture:this.img,quote:this.desc+" "+this.oTranslation.pleaseUseThisCouponCode+" "+this.code})},copyCoupon:function(){var e=document.getElementById("wilcity-copy-coupon-code");e.setAttribute("type","text"),e.select(),document.execCommand("copy"),this.isCopied=!0,e.setAttribute("type","hidden"),window.getSelection().removeAllRanges()}}},z=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"wrapper-class":"popup_module__3M-0- pos-f-full popup_md__3El3k popup_mobile-full__1hyc4 wilcity-coupon","popup-id":"wilcity-coupon-popup",icon:"la la-tag",popupTitle:e.title}},[n("div",{staticStyle:{"min-height":"200px"},attrs:{slot:"body"},slot:"body"},[e.img?n("div",{staticClass:"wilcity-coupon-image wil-text-center"},[n("img",{attrs:{src:e.img,alt:e.code}})]):e._e(),e._v(" "),n("div",{staticClass:"wilcity-coupon-code color-secondary"},[n("span",[e._v(e._s(e.code))])]),e._v(" "),e.desc?n("div",{staticClass:"wilcity-coupon-description"},[n("p",{domProps:{innerHTML:e._s(e.desc)}})]):e._e(),e._v(" "),n("a",{staticClass:"wil-btn mb-10 wil-btn--primary wil-btn--md wil-btn--block wil-btn--round",staticStyle:{"background-color":"#3B5998"},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.shareOnFacebook(t)}}},[e._v(e._s(e.oTranslation.shareOnFacebook))]),e._v(" "),n("a",{staticClass:"wil-btn mb-10 wil-btn--primary wil-btn--md wil-btn--block wil-btn--round",staticStyle:{"background-color":"#00aced"},attrs:{href:e.shareOnTwitter,target:"_blank"}},[e._v(e._s(e.oTranslation.shareOnTwitter))]),e._v(" "),n("a",{staticClass:"wil-btn mb-10 wil-btn--primary wil-btn--md wil-btn--block wil-btn--round",staticStyle:{"background-color":"#c71610"},attrs:{href:e.shareToEmail}},[e._v(e._s(e.oTranslation.shareToEmail))]),e._v(" "),n("a",{staticClass:"wil-btn wil-btn--primary wil-btn--md wil-btn--block wil-btn--round",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.copyCoupon(t)}}},[e._v(e._s(e.copyBtn))]),e._v(" "),n("input",{attrs:{id:"wilcity-copy-coupon-code",type:"hidden"},domProps:{value:e.code}})])])};z._withStripped=!0;var X=A({render:z,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,void 0,void 0),Z={props:{settings:{type:Object,default:function(){return{value:"",askVisitorForLocation:"no",isRequired:"no",placeholder:""}}},wrapperClass:{type:String,default:"field_module__1H6kT field_style2__2Znhe mb-15"}},data:function(){return{instSearchBox:{},instAutocomplete:{},oGeoCode:{},geocoder:null,place:void 0!==this.settings.value?this.settings.value:"",placeholder:void 0!==this.settings.placeholder?this.settings.placeholder:this.place,originalValue:this.settings.value,oTranslation:WILCITY_I18,countryRestriction:void 0!==WILOKE_GLOBAL.searchCountryRestriction?WILOKE_GLOBAL.searchCountryRestriction:"",fieldID:null}},computed:{generateID:function(){var e=new Date;return this.fieldID="wilcity-searchbox-field-"+e.getUTCMilliseconds(),this.fieldID},parseWrapperClass:function(){return this.place.length?this.wrapperClass+" active":this.wrapperClass}},methods:{parseCountryRestriction:function(){return this.countryRestriction.length?this.countryRestriction.split(",").map(function(e){return e.trim()}):""},getAddressByLatLng:function(e,t){var n=this;if("mapbox"==WILOKE_GLOBAL.mapType){var i="https://api.mapbox.com/geocoding/v5/mapbox.places/"+t+","+e+".json?access_token="+WILOKE_GLOBAL.mapAPI+"&types=locality";void 0!==WILOKE_GLOBAL.mapLanguage&&WILOKE_GLOBAL.mapLanguage.length&&(i+="&language="+WILOKE_GLOBAL.mapLanguage),jQuery.get(i,function(e){void 0!==e.features&&e.features.length&&(n.oGeoCode.address=e.features[0].place_name,n.place=n.oGeoCode.address,n.$emit("geocode-changed",n.oGeoCode,n.settings))})}else{null==this.geocoder&&(this.geocoder=new google.maps.Geocoder);var r=new google.maps.LatLng(e,t);this.geocoder.geocode({latLng:r},function(e,t){t===google.maps.GeocoderStatus.OK&&(n.oGeoCode.address=e[0].formatted_address,n.place=n.oGeoCode.address,n.$emit("geocode-changed",n.oGeoCode,n.settings))})}},askMyLocation:function(){var e=this;navigator.geolocation?navigator.geolocation.getCurrentPosition(function(t){e.oGeoCode.lat=t.coords.latitude,e.oGeoCode.lng=t.coords.longitude,e.getAddressByLatLng(t.coords.latitude,t.coords.longitude)}):alert(this.oTranslation.geoCodeIsNotSupportedByBrowser)},getPlaces:function(){var e=this.instSearchBox.getPlaces();if(0===e.length)return this.$emit("geocode-changed","",this.settings),!1;var t=e.pop(),n={address:t.formatted_address,lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};this.place=t.formatted_address,this.$emit("geocode-changed",n,this.settings)},getPlace:function(){var e=this.instSearchBox.getPlace();if(!e.geometry)return this.$emit("geocode-changed","",this.settings),!1;var t={address:e.formatted_address,lat:e.geometry.location.lat(),lng:e.geometry.location.lng()};this.place=e.formatted_address,this.$emit("geocode-changed",t,this.settings)},init:function(){"mapbox"==WILOKE_GLOBAL.mapType?this.mapboxAutoComplete():this.googleAutoComplete()},buildMapboxSearchURL:function(e){return"https://api.mapbox.com/geocoding/v5/mapbox.places/"+encodeURIComponent(e)+".json?access_token="+WILOKE_GLOBAL.mapAPI+"&limit=10&autocomplete=true"},mapboxAutoComplete:function(){var e=this;$("#"+this.generateID).autocomplete({source:function(t,n){$.ajax({type:"GET",url:e.buildMapboxSearchURL(e.place),success:function(e){if(e.features.length){var t=e.features.map(function(e){return{geocode:e.center,label:e.place_name,value:e.place_name}},e.features);n(t)}else n([])}})},select:function(t,n){var i={address:n.item.value,lat:n.item.geocode[1],lng:n.item.geocode[0]};e.place=i.address,e.$emit("geocode-changed",i,e.settings)},open:function(){$(this).data("uiAutocomplete").menu.element.addClass("wil-auto-complete wil-mapbox-geocode")}})},googleAutoComplete:function(){var e=this;new Promise(function(e,t){"undefined"!=typeof google&&e("loaded")}).then(function(t){var n=document.getElementById(e.fieldID);if(n)if("function"==typeof google.maps.places.Autocomplete){var i=e.parseCountryRestriction();if(i.length){var r={componentRestrictions:{country:i}};e.instSearchBox=new google.maps.places.Autocomplete(n,r)}else e.instSearchBox=new google.maps.places.Autocomplete(n);e.instSearchBox.addListener("place_changed",e.getPlace)}else e.instSearchBox=new google.maps.places.SearchBox(n),e.instSearchBox.addListener("places_changed",e.getPlaces)})},resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){e.place=e.originalValue})},onChanged:function(e){""===e.target.value&&this.$emit("geocode-changed","",this.settings)}},mounted:function(){this.init(),this.resetValue()}},J=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.parseWrapperClass},[n("div",{staticClass:"field_wrap__Gv92k"},[(e.settings.isRequired,n("input",{directives:[{name:"model",rawName:"v-model",value:e.place,expression:"place"}],staticClass:"field_field__3U_Rt",attrs:{id:e.generateID,type:"text",placeholder:e.placeholder},domProps:{value:e.place},on:{change:e.onChanged,input:function(t){t.target.composing||(e.place=t.target.value)}}})),e._v(" "),n("span",{staticClass:"bg-color-primary"}),e._v(" "),"yes"==e.settings.askVisitorForLocation?n("div",{staticClass:"field_right__2qM90 pos-a-center-right"},[n("a",{staticClass:"field_icon__1_sOi",staticStyle:{cursor:"pointer","pointer-events":"auto"},attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.askMyLocation(t)}}},[n("i",{staticClass:"la la-map-pin"})])]):e._e()]),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:""!=e.settings.errMsg,expression:"settings.errMsg!=''"}],staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.settings.errMsg))])])};J._withStripped=!0;var ee=A({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,void 0,void 0),te={props:{title:{type:String,value:""},desc:{type:String,value:""}}},ne=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"promo-item_group__2ZJhC"},[""!==e.title?n("h3",{staticClass:"promo-item_title__3hfHG",domProps:{innerHTML:e._s(e.title)}}):e._e(),e._v(" "),""!==e.desc?n("p",{staticClass:"promo-item_description__2nc26",domProps:{innerHTML:e._s(e.desc)}}):e._e()])};ne._withStripped=!0;var ie=A({render:ne,staticRenderFns:[]},void 0,te,void 0,!1,void 0,void 0,void 0),re={data:function(){return{isTax:null,optionClass:null,selected:null,$select2:null,defaultVal:null,isMultiple:void 0!==this.settings.maximum&&this.settings.maximum>1}},components:{WilokeHeading:ie},props:{cId:{type:String,default:""},settings:{type:Object,default:{}},wrapperClass:{type:String,default:""},aRawOptions:{type:Array,default:[]}},computed:{parseWrapperClass:function(){var e=this.wrapperClass;return e.length||(e="field_module__1H6kT field_style2__2Znhe mb-15"),this.cId.length&&(e+=" "+this.cId),this.isMultiple?this.selected.length?e+" active":e:null!=this.selected&&""!=this.selected?e+" active":e},isAjax:function(){return this.settings.isAjax&&"yes"==this.settings.isAjax},selectTwoClass:function(){var e="wilcity-select-2";return this.isAjax&&(e+=" is-ajax"),e},aOptions:function(){return void 0!==this.$store&&void 0!==this.$store.state.aNewBusinessHoursOptions&&this.$store.state.aNewBusinessHoursOptions.aHours.length&&this.$store.state.aNewBusinessHoursOptions.cId==this.cId?this.$store.state.aNewBusinessHoursOptions.aHours:this.aRawOptions.length?this.aRawOptions:this.settings.terms?"string"==typeof this.settings.terms?JSON.parse(this.settings.terms):this.settings.terms:this.settings.options?"string"==typeof this.settings.options?JSON.parse(this.settings.options):this.settings.options:{}}},methods:{resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){"post_type"!=e.settings.key&&(jQuery(e.$el).find(".wilcity-select-2").val(e.defaultVal).trigger("change"),e.$emit("selectTwoChanged",e.defaultVal,e.settings))})},setDefault:function(){if("yes"==this.settings.isMultiple)if(WilCityHelpers.isNull(this.settings.value))this.selected=[];else{var e=typeof this.settings.value;this.selected="number"==e?[this.settings.value]:"string"==e?this.settings.value.split(","):this.settings.value,this.settings.value=this.selected}else WilCityHelpers.isNull(this.settings.value)?this.selected="":"object"==typeof this.settings.value?this.selected=this.selected.value[0]:this.selected=this.settings.value;this.defaultVal=this.selected},updateValue:function(e){if(void 0===e)return!1;if(null===e&&(e="yes"==this.settings.isMultiple?[]:""),"yes"==this.settings.isMultiple)this.selected=e,this.settings.value=this.selected;else{if(this.selected==e)return!1;this.selected=e,this.settings.value=this.selected}this.$emit("selectTwoChanged",this.settings.value,this.settings),this.$emit("input",this.value)},printOptionValue:function(e){return void 0!==e.value?e.value:e},printOptionName:function(e){return(void 0!==e.name?e.name:e).split("|")[0]},printOptionClass:function(e){return void 0!==e.parent&&0!==e.parent?"has-parent-term":""},maximumSelectionLength:function(){return this.settings.maximum?this.settings.maximum:1e4},parseAjaxArgs:function(){if(void 0===this.settings)return!1;var e={},t=!1;for(var n in this.settings)-1!==n.indexOf("ajaxArgs.")&&(e[n.replace("ajaxArgs.","")]=this.settings[n],t=!0);return!!t&&e},selectTwo:function(){var e=this;if(this.$select2=jQuery(this.$el).find(".wilcity-select-2"),this.$select2.data("select2")&&this.$select2.select2("destroy"),this.$select2.hasClass("is-ajax")){var t={action:this.settings.ajaxAction};void 0!==this.settings.ajaxArgs&&(t=Object.assign({},t,this.settings.ajaxArgs)),void 0!==this.settings.eventParents&&(void 0===this.settings.ajaxArgs&&(this.settings.ajaxArgs={}),this.settings.ajaxArgs.postTypes=this.settings.eventParents,t=Object.assign({},t,this.settings.ajaxArgs));var n=this.parseAjaxArgs();n&&(t=Object.assign({},t,n)),console.log(n);var i={ajax:{url:WILOKE_GLOBAL.ajaxurl,data:function(e){return Object.assign({},{search:e.term},t)},processResults:function(e,t){return!!e.success&&e.data.msg},cache:!0},templateSelection:function(e){return e.text.replace("&","&")},minimumInputLength:1,placeholder:"",allowClear:!0};"undefined"!=typeof WILCITY_SELECT2_LENG&&(i.language=WILCITY_SELECT2_LENG),this.$select2.select2(i).on("select2:open",function(e){jQuery(e.currentTarget).closest(".field_module__1H6kT").addClass("active")}).on("select2:close",function(t){e.updateValue(jQuery(t.currentTarget).val())})}else{var r={templateResult:function(e){if(!e.id)return e.text;var t=jQuery(e.element).hasClass("has-parent-term")?"has-parent-term":"";return jQuery('<span class="'+t+'">'+e.text+"</span>")},templateSelection:function(e){return e.text.replace("&","&")},allowClear:!0,placeholder:""};void 0!==this.settings&&void 0!==this.settings.key&&"post_type"==this.settings.key&&(r.allowClear=!1),this.isMultiple&&(r.maximumSelectionLength=this.maximumSelectionLength()),"undefined"!=typeof WILCITY_SELECT2_LENG&&(r.language=WILCITY_SELECT2_LENG),this.$select2.select2(r).on("change",function(t){var n=jQuery(t.currentTarget);n.closest(".field_module__1H6kT").addClass("active");var i=n.val();WilCityHelpers.isNull(i)?n.closest(".field_module__1H6kT").removeClass("active"):n.closest(".field_module__1H6kT").find(".select2-selection__rendered").attr("style",""),e.updateValue(i)})}this.$store.commit("updateSelect2Store",this.$select2),this.triggerDefault()},triggerDefault:function(){WilCityHelpers.isNull(this.settings.value)||this.$select2.closest(".field_module__1H6kT").addClass("active")},updateOptions:function(){var e=this;this.$parent.$on("onUpdateOptions",function(t){e.settings.options=t,e.triggerDefault()})}},mounted:function(){this.selectTwo(),this.resetValue(),this.updateOptions()},updated:function(){this.selectTwo()},beforeMount:function(){this.setDefault()}},oe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.parseWrapperClass},[n("div",{staticClass:"field_wrap__Gv92k"},[e.isAjax?n("div",["yes"==e.settings.isMultiple?n("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],class:e.selectTwoClass,attrs:{multiple:""},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?n:n[0]}}},e._l(e.aOptions,function(t){return n("option",{class:e.printOptionClass(t),attrs:{selected:""},domProps:{value:e.printOptionValue(t),innerHTML:e._s(e.printOptionName(t))}})}),0):n("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],class:e.selectTwoClass,on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?n:n[0]}}},e._l(e.aOptions,function(t){return n("option",{class:e.printOptionClass(t),attrs:{selected:""},domProps:{value:e.printOptionValue(t),innerHTML:e._s(e.printOptionName(t))}})}),0)]):n("div",["yes"==e.settings.isMultiple?n("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],class:e.selectTwoClass,attrs:{multiple:""},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?n:n[0]}}},e._l(e.aOptions,function(t){return n("option",{class:e.printOptionClass(t),domProps:{value:e.printOptionValue(t),innerHTML:e._s(e.printOptionName(t))}})}),0):n("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],class:e.selectTwoClass,on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?n:n[0]}}},e._l(e.aOptions,function(t){return n("option",{class:e.printOptionClass(t),domProps:{value:e.printOptionValue(t),innerHTML:e._s(e.printOptionName(t))}})}),0)]),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis",class:{required:"yes"==e.settings.isRequired}},[e._v(e._s(e.settings.label))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})]),e._v(" "),e.settings.errMsg?n("span",{staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.settings.errMsg))]):e._e()])};oe._withStripped=!0;var se=A({render:oe,staticRenderFns:[]},void 0,re,void 0,!1,void 0,void 0,void 0),ae={data:function(){return{value:void 0!==this.settings.value?this.settings.value:"",oPlanSettings:void 0!==this.$store&&void 0!==this.$store.getters.getPlanSettings?this.$store.getters.getPlanSettings:{}}},props:["settings"],computed:{wrapperClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.value.length,disable:void 0!==this.oPlanSettings["toggle_"+this.settings.key]&&"disable"==this.oPlanSettings["toggle_"+this.settings.key]}}},watch:{settings:{handler:function(){this.value!==this.settings.value&&(this.value=this.settings.value)},deep:!0}},methods:{isRequired:function(e){return"yes"==e||"true"===e||!0===e},updateVal:function(){var e=this;if(void 0!==this.oPlanSettings["toggle_"+this.settings.key]&&"disable"==this.oPlanSettings["toggle_"+this.settings.key])return!1;this.$parent.$on("update_"+this.settings.key,function(t){e.value=t,e.changed()})},changed:function(){this.settings.value=this.value,this.$emit("inputChanged",this.value,this.settings),this.$emit("input",this.value)}},mounted:function(){this.updateVal()}},le=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperClass},[n("div",{staticClass:"field_wrap__Gv92k"},[(e.isRequired(e.settings.isRequired),n("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:e.value},on:{change:e.changed,keyup:e.changed,input:function(t){t.target.composing||(e.value=t.target.value)}}})),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis",class:{required:e.isRequired(e.settings.isRequired)},domProps:{innerHTML:e._s(e.settings.label)}}),e._v(" "),n("span",{staticClass:"bg-color-primary"})]),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:""!=e.settings.errMsg,expression:"settings.errMsg!=''"}],staticClass:"field_message__3Z6FX color-quaternary",domProps:{innerHTML:e._s(e.settings.errMsg)}})])};le._withStripped=!0;var ue=A({render:le,staticRenderFns:[]},void 0,ae,void 0,!1,void 0,void 0,void 0),ce={data:function(){return{value:void 0!==this.settings.value?this.settings.value:""}},props:{settings:{type:Object,value:"",label:"",isRequired:"no"},wrapperClass:{type:String,default:"field_module__1H6kT field_style2__2Znhe mb-15"}},computed:{parseWrapperClass:function(){return null!=this.selected&&this.selected.length?this.wrapperClass+" active":this.wrapperClass},fieldClass:function(){return this.value.length?this.wrapperClass+" active":this.wrapperClass}},methods:{updatedDatepicker:function(){this.settings.value=this.value,this.$emit("datepickerChanged",this.value,this.settings)},datepicker:function(){var e=this;jQuery(this.$el).find(".wilcity_datepicker").each(function(){var t=jQuery(this);t.datepicker({dateFormat:WILOKE_INLINE_GLOBAL.datePickerFormat,onSelect:function(t){e.value=t,e.$emit("input",e.value),e.updatedDatepicker()}}),"undefined"!=typeof WILCITY_DATE_PICKER&&(t.datepicker("option",jQuery.datepicker.regional[WILCITY_DATE_PICKER]),t.datepicker("option","dateFormat",WILOKE_INLINE_GLOBAL.datePickerFormat))})},reset:function(){var e=this;this.$parent.$on("resetEverything",function(){e.$set(e.$data,"value","")})}},mounted:function(){var e=this;this.$nextTick(function(){e.datepicker()}),this.reset()}},he=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.fieldClass},[n("div",{staticClass:"field_wrap__Gv92k"},[e.settings.isRequired?n("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"field_field__3U_Rt notranslate wilcity_datepicker",attrs:{type:"text"},domProps:{value:e.value},on:{change:e.updatedDatepicker,input:function(t){t.target.composing||(e.value=t.target.value)}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"field_field__3U_Rt wilcity_datepicker",attrs:{type:"text"},domProps:{value:e.value},on:{change:e.updatedDatepicker,input:function(t){t.target.composing||(e.value=t.target.value)}}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.settings.label))]),n("span",{staticClass:"bg-color-primary"}),e._v(" "),e._m(0)]),e._v(" "),e.settings.errMsg?n("span",{staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.settings.errMsg))]):e._e()])};he._withStripped=!0;var de={data:function(){return{from:void 0!==this.value.from?this.value.from:"",to:void 0!==this.value.to?this.value.to:""}},props:["fromLabel","toLabel","value"],components:{DatePicker:A({render:he,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"field_right__2qM90 pos-a-center-right"},[t("span",{staticClass:"field_icon__1_sOi"},[t("i",{staticClass:"la la-calendar-check-o"})])])}]},void 0,ce,void 0,!1,void 0,void 0,void 0)},watch:{from:"onChangedRange",to:"onChangedRange"},methods:{onChangedRange:function(){this.$emit("onChangedRange",{from:this.from,to:this.to},{key:"date_range"})},reset:function(){var e=this;this.$parent.$on("resetEverything",function(){e.$emit("resetEverything",{from:"",to:""},{key:"date_range"})})}},mounted:function(){this.reset()}},pe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col-md-6"},[n("date-picker",{attrs:{settings:{value:e.from,label:e.fromLabel},"wrapper-class":"field_module__1H6kT field_style2__2Znhe"},model:{value:e.from,callback:function(t){e.from=t},expression:"from"}})],1),e._v(" "),n("div",{staticClass:"col-md-6"},[n("date-picker",{attrs:{settings:{value:e.to,label:e.toLabel},"wrapper-class":"field_module__1H6kT field_style2__2Znhe"},model:{value:e.to,callback:function(t){e.to=t},expression:"to"}})],1)])};pe._withStripped=!0;var fe=A({render:pe,staticRenderFns:[]},void 0,de,void 0,!1,void 0,void 0,void 0),ge={data:function(){return{s:this.value,onSearchChanged:null}},props:{label:{default:"",type:String},value:{default:"",type:String},wrapperClass:{default:"field_module__1H6kT field_style2__2Znhe mb-15 select-text",type:String}},computed:{parseWrapperClass:function(){return this.s.length?this.wrapperClass+" active":this.wrapperClass}},mounted:function(){this.resetValue()},methods:{submitSearchForm:function(){this.$parent.$emit("submitSearchForm")},resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){e.s="",e.$emit("changedValue",e.s,{key:"wp_search"})})},changedValue:function(){this.$emit("changedValue",this.s,{key:"wp_search"})}}},ve=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.parseWrapperClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.s,expression:"s"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:e.s},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.submitSearchForm(t))},keyup:e.changedValue,input:[function(t){t.target.composing||(e.s=t.target.value)},function(t){e.s=t.target.value}]}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.label))]),e._v(" "),n("span",{staticClass:"bg-color-primary"}),e._v(" "),e._m(0)])])};ve._withStripped=!0;var me=A({render:ve,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"field_right__2qM90 pos-a-center-right"},[t("span",{staticClass:"field_icon__1_sOi"},[t("i",{staticClass:"la la-search"})])])}]},void 0,ge,void 0,!1,void 0,void 0,void 0),_e={data:function(){return{originalVal:this.settings.value,status:this.value.length?this.value:this.settings.value}},props:{settings:{type:Object,default:{}},wrapperClass:"",value:{type:String,default:""}},methods:{changed:function(){this.settings.value=this.status,this.$emit("checkboxChanged",this.status,this.settings)},resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){e.status=e.originalVal}),this.$parent.$on("changeCheckboxVal",function(t){void 0!==t[e.settings.key]&&(e.status=t[e.settings.key])})}},mounted:function(){this.resetValue()}},ye=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"checkbox_module__1K5IS checkbox_full__jTSmg mb-15 js-checkbox"},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.status,expression:"status"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox","true-value":"yes","false-value":"no"},domProps:{checked:Array.isArray(e.status)?e._i(e.status,null)>-1:e._q(e.status,"yes")},on:{change:[function(t){var n=e.status,i=t.target,r=i.checked?"yes":"no";if(Array.isArray(n)){var o=e._i(n,null);i.checked?o<0&&(e.status=n.concat([null])):o>-1&&(e.status=n.slice(0,o).concat(n.slice(o+1)))}else e.status=r},e.changed]}}),e._v(" "),e._m(0),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis"},[n("span",{domProps:{innerHTML:e._s(e.settings.label)}}),e._v(" "),n("span",{staticClass:"checkbox-border"})])])])};ye._withStripped=!0;var be=A({render:ye,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),this._v(" "),t("span",{staticClass:"checkbox-iconBg"})])}]},void 0,_e,void 0,!1,void 0,void 0,void 0),we={data:function(){return{originalVal:this.settings.value,value:this.settings.value,$slider:null}},props:["settings","wrapperClass"],mounted:function(){this.slider(),this.resetValue()},computed:{infoStatus:function(){return this.value>0?"true":""}},methods:{resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){e.value=e.originalVal,e.$slider.slider("value",e.originalVal)})},slider:function(){var e=this,t=jQuery(this.$el);t.find(".js-slider-info");this.$slider=t.find(".js-slider"),this.$slider.slider({range:"min",min:0,max:parseFloat(this.settings.maximum),value:parseFloat(this.value),slide:function(t,n){e.value=n.value,e.$slider.attr("data-slider-value",e.value)},stop:function(t,n){e.$emit("sliderChanged",n.value,e.settings)}})}}},Ce=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"field_module__1H6kT field_style2__2Znhe mb-15 js-field"},[n("div",{staticClass:"field_wrap__Gv92k"},[n("div",{staticClass:"js-slider-info",attrs:{"data-active":e.infoStatus}},[n("span",{staticClass:"js-slider-info__number"},[e._v(e._s(e.value))]),e._v(" "),e.settings.unit?n("span",{staticClass:"js-slider-info__unit"},[e._v(" "+e._s(e.settings.unit))]):e._e()]),e._v(" "),n("div",{staticClass:"js-slider"}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.settings.label))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})])])};Ce._withStripped=!0;var Te=A({render:Ce,staticRenderFns:[]},void 0,we,void 0,!1,void 0,void 0,void 0),Ee={data:function(){return{oAddress:this.oField,defaultAddress:this.value,unit:void 0!==this.oField.unit?this.oField.unit:"km",radius:void 0!==this.oField.defaultRadius?this.oField.defaultRadius:0,originalAddress:this.value}},props:["oField","value"],components:{WilokeAutoComplete:ee,WilokeSlider:Te},methods:{resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){e.oAddress.address=e.originalAddress,e.oAddress.defaultRadius=e.oField.defaultRadius,e.$emit("resetEverything",!0)})},onAddressChanged:function(e){""==e?(this.$set(this.oAddress,"address",""),this.$set(this.oAddress,"lat",""),this.$set(this.oAddress,"lng",""),this.$emit("addressChanged","")):(this.$set(this.$data,"oAddress",e),this.$emit("addressChanged",{address:this.oAddress.address,lat:e.lat,lng:e.lng,radius:this.radius,unit:this.unit})),this.defaultAddress=""},radiusChanged:function(e){this.radius=e,this.$emit("addressChanged",{address:this.oAddress.address,lat:this.oAddress.lat,lng:this.oAddress.lng,radius:this.radius,unit:this.unit}),this.defaultAddress=""}},mounted:function(){this.resetValue()}},Se=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("wiloke-auto-complete",{attrs:{settings:{placeholder:e.oField.label,askVisitorForLocation:"yes",value:e.value}},on:{"geocode-changed":e.onAddressChanged}}),e._v(" "),n("wiloke-slider",{directives:[{name:"show",rawName:"v-show",value:e.oAddress.address.length||e.defaultAddress.length,expression:"oAddress.address.length || defaultAddress.length"}],attrs:{settings:{label:e.oField.radiusLabel,maximum:e.oField.maxRadius,value:e.oField.defaultRadius,unit:e.unit}},on:{sliderChanged:e.radiusChanged}})],1)};Se._withStripped=!0;var Ie=A({render:Se,staticRenderFns:[]},void 0,Ee,void 0,!1,void 0,void 0,void 0),ke={data:function(){return{isTax:null,optionClass:null,selected:null,$select2:null,aTermOptions:null,defaultVal:null,aOptions:[],at:0,isOpening:!1}},watch:{aOptions:{handler:function(e){this.selectTwo()},deep:!0}},props:{settings:{type:Object,default:{}},wrapperClass:{type:String,default:""},target:{type:String,default:"id"},postType:{type:String,default:""},cacheAt:{type:Number,default:0}},components:{WilokeHeading:ie},computed:{parseWrapperClass:function(){var e=this.wrapperClass;return e.length||(e="field_module__1H6kT field_style2__2Znhe mb-15"),null!=this.selected&&this.selected.length||this.isOpening?e+" active":e},selectTwoClass:function(){var e="wilcity-select-2";return this.settings.isAjax&&"yes"==this.settings.isAjax&&(e+=" is-ajax"),e}},methods:{getOptions:function(){var e=this.settings.key;""!==this.postType&&(e=e+"_"+this.postType);var t=this.$store.getters.getTermOptions(e);t?(0!==this.cacheAt&&this.cacheAt>t.at?this.fetchAjaxOptions():this.at=this.aOptions.at,this.$set(this.$data,"aOptions",t.terms)):this.fetchAjaxOptions()},dataOptions:function(e){return JSON.stringify(e)},resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){e.selected=e.defaultVal,jQuery(e.$el).find(".wilcity-select-2").val(e.selected).trigger("change"),e.$emit("term-changed",e.selected,e.settings)})},setDefault:function(){"yes"===this.settings.isMultiple?this.selected=void 0!==this.settings.value&&this.settings.value.length?this.settings.value:[]:this.selected=WilCityHelpers.isNull(this.settings.value)?"":this.settings.value,this.defaultVal=this.selected},updateValue:function(e){if(void 0===e||null===e)return this.selected="yes"==this.settings.isMultiple?[]:"",this.settings.value=this.selected,this.$emit("term-changed",this.settings.value,this.settings),!0;if("yes"==this.settings.isMultiple)this.selected=e,this.settings.value=this.selected,this.$emit("term-changed",this.settings.value,this.settings);else{if(this.selected==e)return!1;this.selected=e,this.settings.value=this.selected,this.$emit("term-changed",this.settings.value,this.settings)}},printOptionClass:function(e){return void 0!==e.parent&&0!==e.parent?"has-parent-term":""},maximumSelectionLength:function(){return this.settings.maximum?this.settings.maximum:1e4},createState:function(e){var t=jQuery(e.element).hasClass("has-parent-term")?"has-parent-term":"",n=void 0!==e.oIcon?e:JSON.parse(e.element.dataset.options),i="";return i=void 0!==n.oIcon?"icon"==n.oIcon.type?'<div class="wilcity-search-wrapper-suggestion-item '+t+'"><div class="icon-box-1_icon__3V5c0 rounded-circle" style="background-color: '+n.oIcon.color+'"><i class="'+n.oIcon.icon+'"></i></div><div class="icon-box-1_text__3R39g">'+e.text+"</div></div>":'<div class="wilcity-search-wrapper-suggestion-item '+t+'"><div class="icon-box-1_icon__3V5c0 bg-transparent bg-cover" style="background-image: url('+n.oIcon.url+')"><img src="'+n.oIcon.url+'"></div><div class="icon-box-1_text__3R39g">'+e.text+"</div></div>":'<div class="wilcity-search-wrapper-suggestion-item '+t+'"><div class="icon-box-1_text__3R39g">'+e.text+"</div></div>",jQuery(i)},selectTwo:function(){var e=this;if(this.$select2=jQuery(this.$el).find(".wilcity-select-2"),void 0!==this.$select2.data("select2")&&this.$select2.select2("destroy"),this.$select2.hasClass("is-ajax")||"yes"==this.settings.isAjax){var t={action:this.settings.ajaxAction,taxonomy:this.settings.key,get:this.target};void 0!==this.settings.ajaxArgs&&(t=Object.assign({},t,this.settings.ajaxArgs));var n={ajax:{url:WILOKE_GLOBAL.ajaxurl,data:function(e){return Object.assign({},{search:e.term},t)},processResults:function(e,t){return!!e.success&&e.data.msg},cache:!0},templateResult:function(t){return t.id?e.createState(t):t.text},templateSelection:function(e){return e.text.replace("&","&")},allowClear:!0,placeholder:"",minimumInputLength:1};"undefined"!=typeof WILCITY_SELECT2_LENG&&(n.language=WILCITY_SELECT2_LENG),this.$select2.select2(n).on("select2:open",function(e){jQuery(e.currentTarget).closest(".field_module__1H6kT").addClass("active")}).on("change",function(t){e.updateValue(jQuery(t.currentTarget).val())}).on("select2:opening",function(t){e.isOpening=!0}).on("select2:closing",function(t){e.isOpening=!1})}else{if(null===this.aOptions||void 0===this.aOptions||!this.aOptions)return!1;var i={templateResult:function(t){return t.id?e.createState(t):t.text},templateSelection:function(e){return e.text.replace("&","&")},allowClear:!0,placeholder:"",cache:!1,maximumSelectionLength:this.maximumSelectionLength()};"undefined"!=typeof WILCITY_SELECT2_LENG&&(i.language=WILCITY_SELECT2_LENG),this.$select2.select2(i).on("change",function(t){var n=jQuery(t.currentTarget);n.closest(".field_module__1H6kT").addClass("active");var i=n.val();WilCityHelpers.isNull(i)?n.closest(".field_module__1H6kT").removeClass("active"):n.closest(".field_module__1H6kT").find(".select2-selection__rendered").attr("style",""),e.updateValue(i)}).on("select2:opening",function(t){e.isOpening=!0}).on("select2:closing",function(t){e.isOpening=!1})}this.triggerDefault()},triggerDefault:function(){WilCityHelpers.isNull(this.settings.value)||this.$select2.closest(".field_module__1H6kT").addClass("active")},fetchAjaxOptions:function(){var e=this;if("yes"==this.settings.isAjax)return this.selectTwo(),!1;var t=this.settings.key;""!==this.postType&&(t=t+"_"+this.postType);var n="count",i="DESC",r=0;void 0!==this.settings&&(void 0!==this.settings.orderBy&&(n=this.settings.orderBy),void 0!==this.settings.order&&(i=this.settings.order),void 0!==this.settings.isHideEmpty&&(r=this.settings.isHideEmpty)),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_fetch_terms_options",taxonomy:this.settings.key,postType:this.postType,orderBy:n,order:i,isHideEmpty:r,isShowParentOnly:this.settings.isShowParentOnly,at:this.at},success:function(n){"update_new_terms"==n.data.action&&(e.$store.commit("updateTermOptions",{key:t,at:n.data.at,terms:n.data.terms}),e.$set(e.$data,"aOptions",n.data.terms))}})}},mounted:function(){this.resetValue(),this.getOptions()},beforeMount:function(){this.setDefault()}},xe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.parseWrapperClass},[n("div",{staticClass:"field_wrap__Gv92k"},["yes"==e.settings.isMultiple?n("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],class:e.selectTwoClass,attrs:{multiple:""},on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?n:n[0]}}},e._l(e.aOptions,function(t){return n("option",{class:e.printOptionClass(t),attrs:{"data-options":e.dataOptions(t)},domProps:{value:t.value,innerHTML:e._s(t.name)}})}),0):n("select",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],class:e.selectTwoClass,on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,function(e){return e.selected}).map(function(e){return"_value"in e?e._value:e.value});e.selected=t.target.multiple?n:n[0]}}},e._l(e.aOptions,function(t){return n("option",{class:e.printOptionClass(t),attrs:{"data-options":e.dataOptions(t)},domProps:{value:t.value,innerHTML:e._s(t.name)}})}),0),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis",class:{required:"yes"==e.settings.isRequired}},[e._v(e._s(e.settings.label))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})]),e._v(" "),e.settings.errMsg?n("span",{staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.settings.errMsg))]):e._e()])};xe._withStripped=!0;var Ae=A({render:xe,staticRenderFns:[]},void 0,ke,void 0,!1,void 0,void 0,void 0),Pe={data:function(){return{isReachedMaximum:!1}},components:{WilokeHeading:ie},props:["settings"],computed:{itemClass:function(){return"undefined"!==this.settings.itemClass?this.settings.itemClass:"col-md-6 col-lg-4"}},watch:{settings:{handler:function(e){e.value.length>=e.maximum?this.isReachedMaximum=!0:this.isReachedMaximum=!1,this.$emit("checkboxTwoChanged",this.settings.value,this.settings)},deep:!0}},methods:{printLabel:function(e){return void 0!==e.label?e.label.split("|")[0]:e.name},isUnChecked:function(e){return!(!this.settings.value.length||!this.isReachedMaximum)&&-1==this.settings.value.indexOf(e)},changed:function(){this.$emit("checkboxTwoChanged",this.settings.value,this.settings)}},beforeMount:function(){""!==this.settings.value&&null!==this.settings.value||(this.settings.value=[])},mounted:function(){}},Oe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"field_module__1H6kT field_style2__2Znhe mb-15 js-field",class:{error:e.isReachedMaximum}},[n("div",{staticClass:"row"},[e.settings.label?n("div",{staticClass:"col-md-12"},[n("wiloke-heading",{attrs:{title:e.settings.label,desc:e.settings.desc}})],1):e._e(),e._v(" "),e._l(e.settings.options,function(t,i){return n("div",{class:e.itemClass},[n("div",{staticClass:"checkbox_module__1K5IS mb-20 js-checkbox"},[n("label",{staticClass:"checkbox_label__3cO9k"},[e.isUnChecked(t.value)&&e.isReachedMaximum?n("input",{directives:[{name:"model",rawName:"v-model",value:e.settings.value,expression:"settings.value"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox",disabled:""},domProps:{value:t.value,checked:Array.isArray(e.settings.value)?e._i(e.settings.value,t.value)>-1:e.settings.value},on:{change:[function(n){var i=e.settings.value,r=n.target,o=!!r.checked;if(Array.isArray(i)){var s=t.value,a=e._i(i,s);r.checked?a<0&&e.$set(e.settings,"value",i.concat([s])):a>-1&&e.$set(e.settings,"value",i.slice(0,a).concat(i.slice(a+1)))}else e.$set(e.settings,"value",o)},e.checkboxTwoChanged]}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.settings.value,expression:"settings.value"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox"},domProps:{value:t.value,checked:Array.isArray(e.settings.value)?e._i(e.settings.value,t.value)>-1:e.settings.value},on:{change:[function(n){var i=e.settings.value,r=n.target,o=!!r.checked;if(Array.isArray(i)){var s=t.value,a=e._i(i,s);r.checked?a<0&&e.$set(e.settings,"value",i.concat([s])):a>-1&&e.$set(e.settings,"value",i.slice(0,a).concat(i.slice(a+1)))}else e.$set(e.settings,"value",o)},e.changed]}}),e._v(" "),e._m(0,!0),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis"},[n("span",{domProps:{innerHTML:e._s(e.printLabel(t))}}),e._v(" "),n("span",{staticClass:"checkbox-border"})])])])])})],2),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:e.isReachedMaximum,expression:"isReachedMaximum"}],staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.settings.overMaximumTagsWarning))])])};Oe._withStripped=!0;var Ne=A({render:Oe,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),this._v(" "),t("span",{staticClass:"checkbox-iconBg"})])}]},void 0,Pe,void 0,!1,void 0,void 0,void 0),Le={data:function(){return{aTags:this.aStd,isFilterByTag:this.isExpandTag,oTranslation:WILCITY_I18}},props:{isExpandTag:{type:String,default:"no"},settings:{type:Object,default:{}},aStd:{type:Array,default:[]}},components:{WilokeCheckboxTwo:Ne},mounted:function(){this.resetValue(),this.scrollBar()},methods:{oTagOptions:function(e){var t=this.aStd.length;if(t){for(var n={},i=0;i<t;i++)n[this.aStd[i]]=e[this.aStd[i]],delete e[this.aStd[i]];e=Object.assign({},n,e)}return e},resetValue:function(){var e=this;this.$parent.$on("resetEverything",function(){return e.aTags=[]})},tagChanged:function(){"no"==this.isFilterByTag?this.$emit("onTagChanged",[],this.isFilterByTag):this.$emit("onTagChanged",this.aTags,this.isFilterByTag)},scrollBar:function(){var e=this;this.$nextTick(function(){jQuery(e.$el).find(".wil-scroll-bar").wrapInner('<div class="wil-scroll-container"></div>');var t=e.$el.querySelector(".wil-scroll-bar");new PerfectScrollbar(t)})}}},De=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"checkbox_module__1K5IS checkbox_full__jTSmg checkbox_toggle__vd6vd mb-20 js-checkbox"},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.isFilterByTag,expression:"isFilterByTag"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox","true-value":"yes","false-value":"no"},domProps:{checked:Array.isArray(e.isFilterByTag)?e._i(e.isFilterByTag,null)>-1:e._q(e.isFilterByTag,"yes")},on:{change:[function(t){var n=e.isFilterByTag,i=t.target,r=i.checked?"yes":"no";if(Array.isArray(n)){var o=e._i(n,null);i.checked?o<0&&(e.isFilterByTag=n.concat([null])):o>-1&&(e.isFilterByTag=n.slice(0,o).concat(n.slice(o+1)))}else e.isFilterByTag=r},e.tagChanged]}}),e._v(" "),e._m(0),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis"},[e._v(e._s(e.settings.label)+"\n "),n("span",{staticClass:"checkbox-border"})])])]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:"yes"==e.isFilterByTag,expression:"isFilterByTag=='yes'"}],staticClass:"wil-visible wil-scroll-bar"},e._l(e.settings.options,function(t){return n("div",[n("div",{staticClass:"checkbox_module__1K5IS mb-20 js-checkbox"},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.aTags,expression:"aTags"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox"},domProps:{value:t.value,checked:Array.isArray(e.aTags)?e._i(e.aTags,t.value)>-1:e.aTags},on:{change:[function(n){var i=e.aTags,r=n.target,o=!!r.checked;if(Array.isArray(i)){var s=t.value,a=e._i(i,s);r.checked?a<0&&(e.aTags=i.concat([s])):a>-1&&(e.aTags=i.slice(0,a).concat(i.slice(a+1)))}else e.aTags=o},e.tagChanged]}}),e._v(" "),e._m(1,!0),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis"},[n("span",{domProps:{innerHTML:e._s(t.name)}}),e._v(" "),n("span",{staticClass:"checkbox-border"})])])])])}),0)])};De._withStripped=!0;var Re={data:function(){return{aSearchFields:[],post_type:this.type,oldPostType:this.type,isLoading:"yes",errorMsg:"",successMsg:"",xhrSearchField:null,oArgs:{},aFullTags:[],aTags:[],isFindingFullTags:!1,oTagsCache:{},isSetDefault:!1,isFocusHidden:!1,xhrTag:null,xhrSearch:null,foundPosts:0,at:0,isReset:!1,isSearching:!1,oTagOrder:null,tagisHideEmpty:!0,isMobile:WilCityHelpers.isMobile("Any",769),oTaxonomies:{},oTaxonomiesOptions:{},isOpenTag:"listing_tag"==this.taxonomy?"yes":"no"}},props:["type","postsPerPage","s","latLng","address","isMap","formItemClass","isPopup","rawTaxonomies","rawDateRange","taxonomy","catId","imageSize","raw-taxonomies-options","order","orderBy","templateId","templateStyle"],computed:{wrapperClass:function(){return"no"==this.isPopup?"content-box_module__333d9":""},innerClass:function(){return"no"==this.isPopup?"content-box_body__3tSRB":""},searchKeyDefault:function(){return void 0!==this.s?this.s:""},wrapperFieldsClass:function(){return"no"==this.isMap?"":"row"},defaultDateRange:function(){return void 0!==this.rawDateRange&&this.rawDateRange.length?JSON.parse(this.rawDateRange):""}},components:{BlockLoading:G,WilokeMessage:R,WilokeInput:ue,WilokeCheckboxThree:be,WpSearch:me,WilokeSelectTwo:se,GooglePlace:Ie,WilokeSlider:Te,WilokeTags:A({render:De,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),this._v(" "),t("span",{staticClass:"checkbox-iconBg"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),this._v(" "),t("span",{staticClass:"checkbox-iconBg"})])}]},void 0,Le,void 0,!1,void 0,void 0,void 0),WilokeTerms:Ae,WilokeRangeDate:fe},watch:{oArgs:{handler:function(e){this.updateState()},deep:!0},post_type:"updateState"},methods:{generateWrapperKey:function(e){return"searchform-"+this.post_type+"-"+e.key},generateSelectTwoKey:function(e){return"searchform-field-"+this.post_type+"-"+e.key},getCheckboxVal:function(e){var t="no";if(!this.orderBy.length)return t;switch(e){case"best_rated":t="best_rated"==this.orderBy?"yes":"no";break;case"open_now":t="open_now"==this.orderBy?"yes":"no";break;case"best_viewed":t="best_viewed"==this.orderBy?"yes":"no";break;case"recommended":t="menu_order"==this.orderBy?"yes":"no"}return t},buildCheckboxSettings:function(e){return{label:e.label,value:this.getCheckboxVal(e.key),key:e.key}},aTagDefault:function(e){return void 0!==this.oArgs[e.key]?this.oArgs[e.key]:[]},setRawOptions:function(e){return("listing_location"==e.key||"listing_cat"==e.key)&&e.options?Array.isArray(e.options)?e.options:Object.values(e.options):[]},select2Id:function(e){return this.post_type+"-"+e.key},googlePlaceField:function(e){if(!WilCityHelpers.isNull(this.latLng)){var t=this.latLng.split(",");e.lat=t[0],e.lng=t[1]}return WilCityHelpers.isNull(this.address)||(e.address=this.address),e},hasInOptions:function(e,t){if("yes"==e.isAjax)return!0;for(var n in e.options)if(e.options[n].value==t)return!0;return!1},buildArgs:function(e){var t=this;if(this.aSearchFields={},this.$store.getters.getSearchArgsOfPostType(this.post_type))return this.oArgs=this.$store.getters.getSearchArgsOfPostType(this.post_type),Vue.set(this.$data,"aSearchFields",Object.values(e)),!0;e.forEach(function(n,i){switch(n.type){case"select2":if(null!==t.oTaxonomies&&void 0!==t.oTaxonomies[n.key]){if(void 0===n.isMultiple||"yes"!=n.isMultiple){var r=Array.isArray(t.oTaxonomies[n.key])?t.oTaxonomies[n.key][0]:t.oTaxonomies[n.key];t.hasInOptions(n,r)?t.oArgs[n.key]=r:t.oArgs[n.key]=""}else void 0!==t.oTaxonomies[n.key]?t.oArgs[n.key]=Array.isArray(t.oTaxonomies[n.key])?t.oTaxonomies[n.key]:t.oTaxonomies[n.key].split(","):t.oArgs[n.key]=[];e[i].value=t.oArgs[n.key],"yes"==n.isAjax&&(e[i].options=t.oTaxonomiesOptions[n.key])}else void 0!==n.isMultiple&&"yes"==n.isMultiple?t.oArgs[n.key]=void 0!==n.value?n.value:[]:t.oArgs[n.key]=void 0!==n.value?n.value:"";if("listing_cat"==n.key){var o=new Date;t.$store.commit("updateTermOptions",{key:n.key+"_"+t.post_type,terms:n.options,at:o.getTime()})}break;case"autocomplete":if(void 0!==t.oArgs.oAddress)t.oArgs.oAddress=t.oArgs.oAddress;else{var s=[];s=void 0!==t.latLng&&t.latLng.length?t.latLng.split(","):["",""],t.oArgs.oAddress={address:void 0!==t.address?t.address:"",lat:s[0],lng:s[1]}}break;case"date_range":if(!WilCityHelpers.isNull(t.rawDateRange)){var a=JSON.parse(t.rawDateRange);t.oArgs[n.key]={from:a.from,to:a.to}}break;default:"listing_tag"==n.key?(null!==t.oTaxonomies&&void 0!==t.oTaxonomies.listing_tag?(t.oArgs.listing_tag=Array.isArray(t.oTaxonomies.listing_tag)?t.oTaxonomies.listing_tag:t.oTaxonomies.listing_tag.split(","),t.aTags=t.oArgs.listing_tag):t.aTags=[],t.aTags=void 0!==n.options?n.options:[]):void 0!==t.oArgs[n.key]?t.oArgs[n.key]=t.oArgs[n.key]:t.oArgs[n.key]=void 0!==n.value?n.value:""}}),this.oArgs.type=this.post_type,this.oArgs.orderby=this.orderBy,this.oArgs.order=this.order,this.oArgs.post_type=this.post_type,this.oArgs.s=this.s,this.oArgs.templateId=this.templateId,Vue.set(this.$data,"aSearchFields",Object.values(e))},toggleSortBySetting:function(e){switch(e){case"best_viewed":Vue.set(this.oArgs,"open_now","no"),Vue.set(this.oArgs,"recommended","no"),this.$emit("changeCheckboxVal",{open_now:"no",recommended:"no"});break;case"open_now":Vue.set(this.oArgs,"best_viewed","no"),Vue.set(this.oArgs,"recommended","no"),this.$emit("changeCheckboxVal",{best_viewed:"no",recommended:"no"});break;case"recommended":Vue.set(this.oArgs,"best_viewed","no"),Vue.set(this.oArgs,"open_now","no"),this.$emit("changeCheckboxVal",{open_now:"no",best_viewed:"no"})}},updateState:function(){void 0!==this.$store&&(this.$store.commit("updateOSearchArgs",this.oArgs),this.$store.commit("updatePostType",this.post_type),this.$store.commit("updateSearchField",{postType:this.post_type,aFields:this.aSearchFields}),this.$emit("fetch-listings",this.isReset),this.isReset=!1,jQuery("#wilcity-search-pagination").data("oArgs",this.oArgs))},wrapperFieldClass:function(e){return"no"==this.isMap?"":"listing_tag"==e.key?"col-md-12 col-lg-12":this.formItemClass},setDefault:function(){if(void 0!==this.latLng&&this.latLng.length){var e=this.latLng.split(",");this.oArgs.oAddress={lat:e[0],lng:e[1],address:this.address}}},resetSearchForm:function(){this.$emit("resetEverything",!0),this.isReset=!0,this.searchListings()},selectTwoDefault:function(e){return void 0!==this.oArgs[e.key]?this.oArgs[e.key]:void 0!==e.isMultiple&&"yes"==e.isMultiple?[]:""},setFullTags:function(e){var t=this;this.isFindingFullTags||(this.isFindingFullTags=!0,e.forEach(function(e){if(void 0!==e.key&&"listing_tag"==e.key)return void 0!==e.options?(t.aFullTags=Object.values(e.options),t.aTags=t.aFullTags):t.aTags=[],!0}))},fetchIndividualTag:function(e){var t=this;if(void 0!==this.oTagsCache[e])return this.aTags=this.oTagsCache[e],!0;-1==e&&(this.aTags=this.aFullTags),null!==this.xhrTag&&200!==this.xhrTag.status&&this.xhrTag.abort(),new Promise(function(e,n){if(null!==t.oTagOrder)e("find");else{for(var i in t.aSearchFields)"listing_tag"==t.aSearchFields[i].key&&(void 0!==t.aSearchFields[i].orderBy&&(null===t.oTagOrder&&(t.oTagOrder={}),t.oTagOrder.orderBy=t.aSearchFields[i].orderBy),void 0!==t.aSearchFields[i].order&&(null===t.oTagOrder&&(t.oTagOrder={}),t.oTagOrder.order=t.aSearchFields[i].order),void 0!==t.aSearchFields[i].isHideEmpty&&(t.tagisHideEmpty=t.aSearchFields[i].isHideEmpty),e("find"));null===t.oTagOrder&&(t.oTagOrder="nothing"),n("noTag")}}).then(function(n){if("nothing"!=t.oTagOrder){var i={action:"wilcity_fetch_individual_cat_tags",termSlug:e};null!==t.oTagOrder&&void 0!==t.oTagOrder.orderBy&&(i.orderBy=t.oTagOrder.orderBy),null!==t.oTagOrder&&void 0!==t.oTagOrder.order&&(i.order=t.oTagOrder.order),void 0!==t.tagisHideEmpty&&(i.hide_empty=t.tagisHideEmpty),t.xhrTag=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:i,success:function(n){n.success?(t.aTags=n.data,t.oTagsCache[e]=n.data,t.isOpenTag="yes"):(t.aTags={},t.oTagsCache[e]={},t.isOpenTag="no")}})}})},buildSearchFormName:function(){var e="";return void 0!==this.catId&&(e=this.catId),"main_search_form_"+this.post_type+"_"+e},generateSearchFields:function(e){this.setFullTags(e),this.buildArgs(e)},getSearchFields:function(){this.$store.commit("isFocusUpdateSelect2",!0);var e=this.$store.getters.getSearchFormFields(this.buildSearchFormName());this.$store.commit("updatePostType",this.post_type),e?(this.generateSearchFields(e.fields),this.at=e.at,this.fetchAjaxSearchField()):this.fetchAjaxSearchField()},fetchAjaxSearchField:function(){var e=this;null!==this.xhrSearchField&&200!==this.xhrSearchField.status&&this.xhrSearchField.abort(),this.isLoading="yes",this.xhrSearchField=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_get_search_fields",order:this.order,catId:this.catId,postType:this.post_type,at:this.at},success:function(t){t.success?("update_search_fields"==t.data.action&&(e.generateSearchFields(Object.values(t.data.fields)),e.$store.commit("updateSearchFields",{fields:e.aSearchFields,at:t.data.at,key:e.buildSearchFormName()})),e.errorMsg="",e.updateState()):e.errorMsg="To setup Hero Search Form, please click on Wiloke Tools -> [Your Directory Type] Settings -> Search Form -> Drag fields you want to use to Used Fields area.",e.isLoading="no"}})},deleteMapBounds:function(){void 0!==this.oArgs.aBounds&&delete this.oArgs.aBounds},onTagChanged:function(e,t){this.$set(this.oArgs,"listing_tag",e),this.isOpenTag=t,this.isMobile||this.searchListings(!1,!0)},onChangedRange:function(e){e.from.length&&e.to.length&&(this.$set(this.oArgs,"date_range",e),this.isMobile||this.searchListings(!1,!0))},onSearchChanged:function(e,t){this.$set(this.oArgs,"s",e),this.isMobile||this.searchListings(!1,!0)},checkboxChanged:function(e,t){this.toggleSortBySetting(t.key),this.$set(this.oArgs,t.key,e),this.isMobile||this.searchListings(!1,!0)},addressChanged:function(e){this.oArgs.oAddress=e,this.deleteMapBounds(),this.isMobile||this.searchListings(!1,!0)},selectTwoChanged:function(e,t){this.$store.commit("isFocusUpdateSelect2",!1);var n=!1;if("listing_cat"==t.key)""==e?this.aTags=this.aFullTags:this.fetchIndividualTag(e);else if("listing_location"==t.key)this.deleteMapBounds();else if("post_type"==t.key){this.post_type=e;var i=this.$store.getters.getSelect2Store,r=i.length;if(r){for(var o=0;o<r;o++)i[o].data("select2")&&i[o].select2("destroy");this.$store.commit("cleanSelect2Store")}this.getSearchFields(),n=!0}this.$set(this.oArgs,t.key,e),this.isMobile||this.searchListings(n,!0)},maybeDefault:function(e){return void 0!==this.oQuery[e]?this.oQuery[e]:""},searchListings:function(t,n){var i=this;if("yes"==this.isMap)return this.$emit("fetch-listings",t,n),!1;this.$emit("searching",!1),null!==this.xhrSearch&&200!==this.xhrSearch.status&&this.xhrSearch.abort(),this.$emit("searching",!0);var r=jQuery("#wilcity-search-pagination");r.data("oArgs",this.oArgs),r.data("postType",this.post_type);var o={};this.isReset?(o=this.$store.getters.getDefaultSearchFormArgs(this.post_type),this.isReset=!1):o=this.oArgs,this.$store.commit("updateSearchArgsOfPostType",{postType:this.post_type,oArgs:this.oArgs}),this.xhrSearch=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{postType:this.post_type,oArgs:o,action:"wilcity_search_listings",postsPerPage:this.postsPerPage,img_size:this.imageSize,style:this.$store.getters.getTemplateStyle},success:function(t){if(t.success){document.getElementById("wilcity-search-results").innerHTML=t.data.msg;var n=jQuery("#wilcity-search-results");n.find(".wilcity-preview-gallery").each(function(){jQuery(this).wilcityMagnificGalleryPopup()}),n.find(".wilcity-js-favorite").each(function(){jQuery(this).wilcityFavoriteStatistic()}),jQuery("body, html").stop().animate({scrollTop:0},500,"swing"),n.hasClass("wilcity-grid")&&(n.data("highestBody",!1),e(n))}else document.getElementById("wilcity-search-results").innerHTML=t.data.msg;i.$store.commit("updateTotalListings",t.data.maxPosts),r.trigger("resetPagination",[1,t.data.maxPosts]),i.$emit("searching",!1),"event"==i.post_type?jQuery("#wilcity-no-map").find(".listing-bar_item__266Xo--switch").addClass("hidden"):jQuery("#wilcity-no-map").find(".listing-bar_item__266Xo--switch").removeClass("hidden")}})}},mounted:function(){var e=this;"object"==typeof this.rawTaxonomies?this.oTaxonomies=this.rawTaxonomies:this.rawTaxonomies.length?this.oTaxonomies=JSON.parse(this.rawTaxonomies):this.oTaxonomies={},"object"==typeof this.rawTaxonomiesOptions?this.oTaxonomiesOptions=this.rawTaxonomiesOptions:this.rawTaxonomiesOptions.length?this.oTaxonomiesOptions=JSON.parse(this.rawTaxonomiesOptions):this.oTaxonomiesOptions={},this.$store.commit("updateTemplateStyle",this.templateStyle),this.setDefault(),this.getSearchFields(),this.isMobile?jQuery("body").on("resetSearchOnMobile",function(){e.resetSearchForm()}):this.$parent.$on("resetSearchForm",function(){e.resetSearchForm()}),jQuery("#wilcity-search-pagination").data("oArgs",this.oArgs),jQuery("body").on("searchOnMobile",function(){e.searchListings()})}},Me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperClass,staticStyle:{"min-height":"150px"}},[n("div",{class:e.innerClass},[n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:""!==e.errorMsg,expression:"errorMsg!==''"}],attrs:{msg:e.errorMsg,icon:"la la-frown-o"}}),e._v(" "),n("block-loading",{attrs:{position:"pos-a-center","is-loading":e.isLoading}}),e._v(" "),e.aSearchFields.length?n("div",{class:e.wrapperFieldsClass},e._l(e.aSearchFields,function(t){return n("div",{key:e.generateWrapperKey(t),class:e.wrapperFieldClass(t)},["wp_search"==t.type?n("wp-search",{attrs:{label:t.label,value:e.searchKeyDefault},on:{changedValue:e.onSearchChanged}}):e._e(),e._v(" "),"date_range"==t.type?n("wiloke-range-date",{attrs:{"from-label":t.fromLabel,"to-label":t.toLabel,value:e.defaultDateRange},on:{onChangedRange:e.onChangedRange}}):"checkbox"==t.type&&"listing_tag"!==t.key?n("wiloke-checkbox-three",{attrs:{settings:e.buildCheckboxSettings(t)},on:{checkboxChanged:e.checkboxChanged}}):"checkbox2"==t.type&&"listing_tag"==t.key?n("wiloke-tags",{directives:[{name:"show",rawName:"v-show",value:e.aTags.length,expression:"aTags.length"}],attrs:{settings:{value:t.key,key:t.key,options:e.aTags,label:t.label},"is-expand-tag":e.isOpenTag,"a-std":e.aTagDefault(t)},on:{onTagChanged:e.onTagChanged}}):"slider"==t.type?n("wiloke-slider",{attrs:{settings:{label:t.label,value:t.key,maximum:t.maxRadius,value:t.defaultRadius,unit:t.unit}}}):"autocomplete"==t.type?n("google-place",{attrs:{"o-field":e.googlePlaceField(t),value:e.address},on:{addressChanged:e.addressChanged}}):"select2"==t.type&&"listing_cat"==t.key?n("wiloke-terms",{attrs:{target:"slug","post-type":e.post_type,"wrapper-class":"field_module__1H6kT field_style2__2Znhe",settings:{isAjax:t.isAjax,options:t.options,label:t.label,isMultiple:t.isMultiple,value:e.selectTwoDefault(t),key:t.key,ajaxAction:t.ajaxAction,ajaxArgs:{taxonomy:t.key,postType:e.post_type,get:"slug"},isSearchForm:"yes"}},on:{"term-changed":e.selectTwoChanged}}):"select2"==t.type?n("wiloke-select-two",{key:e.generateSelectTwoKey(t),attrs:{"wrapper-id":e.select2Id(t),settings:{isAjax:t.isAjax,options:t.options,label:t.label,isMultiple:t.isMultiple,value:e.selectTwoDefault(t),key:t.key,ajaxAction:t.ajaxAction,ajaxArgs:{taxonomy:t.key,postType:e.post_type,get:"slug"},isSearchForm:"yes"},"c-id":t.key,"a-raw-options":e.setRawOptions(t)},on:{selectTwoChanged:e.selectTwoChanged}}):e._e()],1)}),0):e._e()],1)])};Me._withStripped=!0;var Fe={data:function(){return{oTranslation:WILCITY_I18}},props:["type","postsPerPage","rawTaxonomies","s","latLng","address","isMap","rawDateRange","formItemClass","popupTitle","rawTaxonomiesOptions","order","orderBy","templateId","style"],components:{SearchForm:A({render:Me,staticRenderFns:[]},void 0,Re,void 0,!1,void 0,void 0,void 0),WilokePopup:N},methods:{triggerFetchListing:function(){"yes"==this.isMap&&WilcityMap.$emit("fetchListings")},searchNow:function(){"yes"==this.isMap?WilcityMap.$emit("fetchListings"):jQuery("body").trigger("searchOnMobile"),this.$store.dispatch("closeSearchFormPopup")}},computed:{isMobile:function(){return WilCityHelpers.isMobile("Any",769)}}},je=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isMobile?n("wiloke-popup",{attrs:{"wrapper-class":"popup_module__3M-0- pos-f-full popup_mobile-full__1hyc4","popup-id":"wilcity-search-form-popup","popup-title":e.popupTitle}},[n("div",{attrs:{slot:"body"},slot:"body"},[n("search-form",{attrs:{type:e.type,"posts-per-page":e.postsPerPage,s:e.s,"lat-lng":e.latLng,address:e.address,"is-map":e.isMap,"raw-taxonomies":e.rawTaxonomies,"raw-data-range":e.rawDateRange,"form-item-class":e.formItemClass,"is-popup":"yes","raw-taxonomies-options":e.rawTaxonomiesOptions,"order-by":e.orderBy,order:e.order,"template-id":"templateId","template-style":e.style},on:{"fetch-listings":e.triggerFetchListing}})],1),e._v(" "),n("footer",{staticClass:"popup_footer__2pUrl",staticStyle:{"padding-left":"0","padding-right":"0",border:"0"},attrs:{slot:"footer"},slot:"footer"},[n("a",{staticClass:"wil-btn wil-btn--primary wil-btn--md wil-btn--block",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.searchNow(t)}}},[n("i",{staticClass:"la la-search"}),e._v(" "+e._s(e.oTranslation.search)+"\n ")])])]):e._e()};je._withStripped=!0;var Ue=A({render:je,staticRenderFns:[]},void 0,Fe,void 0,!1,void 0,void 0,void 0),We={data:function(){return{oHandled:{},aForm:{},aFields:[],errorMsg:"",xhr:null,currentType:"",oArgs:{},at:0,type:this.postType,oTranslation:WILCITY_I18,oSearchFormCacheSettings:{}}},props:["postType","searchUrl","defaultPostType"],components:{WilokeSelectTwo:se,WilokeAutoComplete:ee,WilokeTerms:Ae,WpSearch:me,WilokeRangeDate:fe},methods:{generateWrapperKey:function(e){return"hero-searchform-"+this.type+"-"+e.key},autoCompleteFields:function(e){return e.placeholder=e.label,e},wrapperClass:function(e){return 1==this.aFields.length?"col-sm-9":3==this.aFields.length?"col-sm-3":0==e?"col-sm-5":"col-sm-4"},getHeroSearchFields:function(){var e=this.$store.getters.getSearchFormFields("hero_form_"+this.type);e?(this.aFields=e.fields,this.at=e.at,this.fetchFields()):this.fetchFields()},fetchFields:function(){var e=this;return void 0!==this.aForm[this.type]?(this.aFields=this.aForm[this.type],!0):void 0!==this.oHandled[this.type]||(this.oHandled[this.type]="1",this.currentType.length||(this.currentType=this.type),void fetch(WilCityHelpers.buildRestRequest("search-fields/hero?postType="+this.type+"&at="+this.at)).then(function(e){return e.json()}).then(function(t){"success"==t.status?"update_field"==t.action&&(e.currentType==e.type&&(e.aFields=t.oSettings),e.aForm[e.currentType]=e.aFields,e.at=t.at,e.$store.commit("updateSearchFields",{fields:t.oSettings,at:t.at,key:"hero_form_"+e.type})):e.errorMsg=t.msg,e.$parent.$emit("formLoaded",!0),e.currentType=""}))},oUpdateArgs:function(e,t){switch(t.key){case"google_place":""!==e?(this.oArgs.latLng=encodeURIComponent(e.lat+","+e.lng),this.oArgs.address=encodeURIComponent(e.address)):(delete this.oArgs.latLng,delete this.oArgs.address,delete this.oArgs.unit,delete this.oArgs.radius);break;case"wp_search":""!==e?this.oArgs.title=encodeURIComponent(e):delete this.oArgs.title;break;case"date_range":""!==e?this.oArgs.date_range=encodeURIComponent(e.from+","+e.to):delete this.oArgs.date_range;break;case"listing_cat":if(e.length)if("object"==typeof e){var n=e.join(",");this.oArgs.listing_cat=encodeURIComponent(n)}else this.oArgs.listing_cat=encodeURIComponent(e);else delete this.oArgs.listing_cat;break;default:this.oArgs[t.key]=e}},buildSearchArgs:function(){var e=this;return new Promise(function(t,n){var i="";for(var r in e.oArgs)i+=r+"="+e.oArgs[r]+"&";t(i=i.slice(0,-1))})},submitSearch:function(){var e=this;this.oArgs.type=this.$parent.type;var t=this.buildSearchArgs();console.log(t),t.then(function(t){var n=e.searchUrl+"?"+t;window.location.href=n})},getCacheFields:function(e){if(this.oSearchFormCacheSettings){if(void 0!==this.oSearchFormCacheSettings.oSettings&&void 0!==this.oSearchFormCacheSettings.oSettings[this.type])return this.cacheVersion=this.oSearchFormCacheSettings.version,this.oSearchFormCacheSettings.oSettings[this.type]}else this.oSearchFormCacheSettings={};return!1}},mounted:function(){var e=this;this.getHeroSearchFields(),this.$on("submitSearchForm",function(){e.submitSearch()})}},Be=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e._l(e.aFields,function(t,i){return n("div",{key:e.generateWrapperKey(t),class:e.wrapperClass(i)},["term"==t.group?n("wiloke-terms",{attrs:{settings:t,value:"",target:"slug","post-type":e.postType,"wrapper-class":"field_module__1H6kT field_style2__2Znhe","cache-at":e.at},on:{"term-changed":e.oUpdateArgs}}):"autocomplete"==t.type?n("wiloke-auto-complete",{attrs:{settings:e.autoCompleteFields(t),"wrapper-class":"field_module__1H6kT field_style2__2Znhe"},on:{"geocode-changed":e.oUpdateArgs}}):e._e(),e._v(" "),"wp_search"==t.type?n("wp-search",{attrs:{label:t.label,value:"","wrapper-class":"field_module__1H6kT field_style2__2Znhe select-text"},on:{changedValue:e.oUpdateArgs}}):e._e(),e._v(" "),"date_range"==t.type?n("wiloke-range-date",{attrs:{"from-label":t.fromLabel,"to-label":t.toLabel,value:""},on:{onChangedRange:e.oUpdateArgs}}):e._e()],1)}),e._v(" "),n("div",{staticClass:"col-sm-3"},[n("button",{directives:[{name:"show",rawName:"v-show",value:e.aFields.length,expression:"aFields.length"}],staticClass:"wil-btn wil-btn--primary wil-btn--md wil-btn--round wil-btn--block",on:{click:function(t){return t.preventDefault(),e.submitSearch(t)}}},[n("i",{staticClass:"la la-search"}),e._v(" "+e._s(e.oTranslation.searchNow))])])],2)};Be._withStripped=!0;var Ve=A({render:Be,staticRenderFns:[]},void 0,We,void 0,!1,void 0,void 0,void 0),He={data:function(){return{wrapperClass:"yes"==this.isDefaultActive?"active":"wait-for-click"}},props:["isDefaultActive","postType","iconClass","tabName"],methods:{switchPostType:function(){this.$emit("on-switch-post-type",this.postType)}}},$e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a",{class:e.wrapperClass,attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.switchPostType(t)}}},[n("i",{class:e.iconClass}),e._v(e._s(e.tabName))])};$e._withStripped=!0;var Ge=A({render:$e,staticRenderFns:[]},void 0,He,void 0,!1,void 0,void 0,void 0),Ke=function(){this.textUpWhenFocusOn(jQuery)};Ke.prototype.textUpWhenFocusOn=function(e){var t=e("body").find('input[type="text"], textarea, input[type="email"], input[type="url"]');t.each(function(){var t=e(this);""!==t.val()&&t.closest(".js-field").addClass("active")}),t.on("focus",function(t){e(t.currentTarget).closest(".js-field").addClass("active")}).on("blur",function(t){""===e(t.currentTarget).val()&&e(t.currentTarget).closest(".js-field").removeClass("active")})};var qe={data:function(){return{oTranslation:WILCITY_I18,isShowing:"no",isLoading:"no",needDashboardUrl:"yes",aNotifications:[],errMsg:"",notificationDashboardUrl:"#",countNewNotifications:0,isLoadedCheckUnFocusClick:!1}},components:{BlockLoading:G},computed:{wrapperNotificationsClass:function(){return"no"==this.isShowing?"header_loginBody__2hz2g":"header_loginBody__2hz2g active"},aCssClass:function(){return"yes"==this.isShowing?"header_loginHead__3HoVP active":"header_loginHead__3HoVP"}},mounted:function(){var e=this;setTimeout(function(){e.fetchNewNotifications(),e.$store.commit("updateTimeout")},this.$store.getters.getTimeout)},methods:{deleteNotification:function(e,t){var n=this;if(!confirm(this.oTranslation.confirmDeleteNotification))return!1;jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_delete_notification",ID:e.ID},success:function(e){e.success?n.aNotifications.splice(t,1):n.errorMsg=e.data.msg}})},fetchNewNotifications:function(){var e=this;jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_count_new_notifications"},success:function(t){e.countNewNotifications=t.data}})},resetNotification:function(){if(this.countNewNotifications<1)return!1;this.countNewNotifications=0,setTimeout(function(){jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_reset_new_notifications"}})},4e3)},hideMenu:function(){this.isShowing="no"},toggleShowing:function(){var e=this;this.isShowing="no"==this.isShowing?"yes":"no",this.isLoadedCheckUnFocusClick||(this.hideWhenOurClick(),this.isLoadedCheckUnFocusClick=!0),this.isLoading="yes",this.errMsg="",this.aNotifications=[],this.resetNotification(),jQuery.ajax({type:"post",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_fetch_list_notifications",needDashboardUrl:this.needDashboardUrl,limit:5},success:function(t){t.success?(e.aNotifications=t.data.oInfo,"#"===e.notificationDashboardUrl&&(e.notificationDashboardUrl=t.data.dashboardUrl,e.needDashboardUrl="no")):e.errMsg=t.data.msg,e.isLoading="no"}})},hideWhenOurClick:function(){var e=this;jQuery(document).on("click",function(t){"yes"==e.isShowing&&(jQuery(t.target).closest("#wilcity-quick-notifications").length||(e.isShowing="no"))})}}},Qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a",{class:e.aCssClass,attrs:{href:"#","data-toggle-minWidth":"768",dataTooltip:e.oTranslation.notifications,"data-tooltip-placement":"top","data-tooltip-theme":"light"},on:{click:function(t){return t.preventDefault(),e.toggleShowing(t)}}},[n("i",{staticClass:"la la-bell-o"}),n("span",{directives:[{name:"show",rawName:"v-show",value:e.countNewNotifications,expression:"countNewNotifications"}],staticClass:"header_number__1a6F5 bg-color-quaternary"},[e._v(e._s(e.countNewNotifications))])]),e._v(" "),n("div",{class:e.wrapperNotificationsClass},[n("div",{directives:[{name:"show",rawName:"v-show",value:"yes"==e.isLoading,expression:"isLoading=='yes'"}],staticClass:"pos-r",staticStyle:{"min-height":"100px"}},[n("block-loading",{attrs:{"is-loading":e.isLoading,position:"pos-a-center"}})],1),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.aNotifications.length,expression:"aNotifications.length"}],staticClass:"list-utility_module__32oNg list-none list-utility_abs__OYiyL arrow--top-right"},[e._l(e.aNotifications,function(t){return n("li",{staticClass:"list-utility_list__1DzGk"},[n("a",{staticClass:"list-utility_link__3BRZx",attrs:{href:t.link}},[n("span",{staticClass:"list-utility_remove__1Vlf4 color-primary--hover",attrs:{title:e.oTranslation.deleteMsg},on:{click:function(n){return n.preventDefault(),e.deleteNotification(t,e.order)}}},[n("i",{staticClass:"la la-close"})]),e._v(" "),n("div",{staticClass:"utility-box-1_module__MYXpX utility-box-1_sm__mopok utility-box-1_boxLeft__3iS6b clearfix "},[t.featuredImg?n("div",{staticClass:"utility-box-1_avatar__DB9c_ rounded-circle",style:{"background-image":"url("+t.featuredImg+")"}},[n("img",{attrs:{src:t.featuredImg,alt:t.title}})]):e._e(),e._v(" "),n("div",{staticClass:"utility-box-1_body__8qd9j"},[n("div",{staticClass:"utility-box-1_group__2ZPA2 text-ellipsis"},[t.title?n("h3",{staticClass:"utility-box-1_title__1I925",domProps:{innerHTML:e._s(t.title)}}):e._e(),e._v(" "),n("div",{staticClass:"utility-box-1_content__3jEL7"},[n("span",{domProps:{innerHTML:e._s(t.content)}}),e._v(" "),t.contentHighlight?n("span",{staticClass:"color-dark-1",domProps:{innerHTML:e._s(t.contentHighlight)}}):e._e()])]),e._v(" "),n("div",{staticClass:"utility-box-1_description__2VDJ6"},[n("i",{staticClass:"la la-comments color-primary"}),e._v(" "+e._s(t.time))])])])])])}),e._v(" "),n("li",{directives:[{name:"show",rawName:"v-show",value:e.aNotifications.length,expression:"aNotifications.length"}],staticClass:"list-utility_list__1DzGk"},[n("a",{staticClass:"list-utility_more__2Y_w7 wil-text-center color-primary--hover",attrs:{href:e.notificationDashboardUrl}},[e._v(e._s(e.oTranslation.viewAll))])])],2),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],staticClass:"list-utility_module__32oNg list-none list-utility_abs__OYiyL arrow--top-right"},[n("li",{staticClass:"list-utility_list__1DzGk"},[n("a",{staticClass:"list-utility_link__3BRZx",attrs:{href:"#"}},[n("div",{staticClass:"utility-box-1_module__MYXpX utility-box-1_sm__mopok utility-box-1_boxLeft__3iS6b clearfix"},[n("div",{staticClass:"utility-box-1_body__8qd9j"},[n("div",{staticClass:"utility-box-1_group__2ZPA2 text-ellipsis"},[n("div",{staticClass:"utility-box-1_content__3jEL7",domProps:{innerHTML:e._s(e.errMsg)}})])])])])])])])])};Qe._withStripped=!0;var Ye=A({render:Qe,staticRenderFns:[]},void 0,qe,void 0,!1,void 0,void 0,void 0);!function(e){if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=function(e){return e&&DataView.prototype.isPrototypeOf(e)},r=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};c.prototype.append=function(e,t){e=a(e),t=l(t);var n=this.map[e];this.map[e]=n?n+","+t:t},c.prototype.delete=function(e){delete this.map[a(e)]},c.prototype.get=function(e){return e=a(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(a(e))},c.prototype.set=function(e,t){this.map[a(e)]=l(t)},c.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},c.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),u(e)},c.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),u(e)},c.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),u(e)},t.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var o=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},g.call(v.prototype),g.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var s=[301,302,303,307,308];_.redirect=function(e,t){if(-1===s.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},e.Headers=c,e.Request=v,e.Response=_,e.fetch=function(e,n){return new Promise(function(i,r){var o=new v(e,n),s=new XMLHttpRequest;s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),i=n.shift().trim();if(i){var r=n.join(":").trim();t.append(i,r)}}),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var r="response"in s?s.response:s.responseText;i(new _(r,n))},s.onerror=function(){r(new TypeError("Network request failed"))},s.ontimeout=function(){r(new TypeError("Network request failed"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&t.blob&&(s.responseType="blob"),o.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),s.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}function a(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function c(e){this.map={},e instanceof c?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&i(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!r(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var e,t,n,i=h(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=d(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),i=0;i<t.length;i++)n[i]=String.fromCharCode(t[i]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}function v(e,t){var n,i,r=(t=t||{}).body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(n=t.method||this.method||"GET",i=n.toUpperCase(),o.indexOf(i)>-1?i:n),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(r))}}),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:void 0);var ze="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ze(e,t){return e(t={exports:{}},t.exports),t.exports}var Je=setTimeout;function et(){}function tt(e){if(!(this instanceof tt))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],st(e,this)}function nt(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,tt._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var i;try{i=n(e._value)}catch(e){return void rt(t.promise,e)}it(t.promise,i)}else(1===e._state?it:rt)(t.promise,e._value)})):e._deferreds.push(t)}function it(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof tt)return e._state=3,e._value=t,void ot(e);if("function"==typeof n)return void st((i=n,r=t,function(){i.apply(r,arguments)}),e)}e._state=1,e._value=t,ot(e)}catch(t){rt(e,t)}var i,r}function rt(e,t){e._state=2,e._value=t,ot(e)}function ot(e){2===e._state&&0===e._deferreds.length&&tt._immediateFn(function(){e._handled||tt._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)nt(e,e._deferreds[t]);e._deferreds=null}function st(e,t){var n=!1;try{e(function(e){n||(n=!0,it(t,e))},function(e){n||(n=!0,rt(t,e))})}catch(e){if(n)return;n=!0,rt(t,e)}}tt.prototype.catch=function(e){return this.then(null,e)},tt.prototype.then=function(e,t){var n=new this.constructor(et);return nt(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},tt.prototype.finally=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},tt.all=function(e){return new tt(function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);var r=i.length;function o(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){o(e,t)},n)}i[e]=s,0==--r&&t(i)}catch(e){n(e)}}for(var s=0;s<i.length;s++)o(s,i[s])})},tt.resolve=function(e){return e&&"object"==typeof e&&e.constructor===tt?e:new tt(function(t){t(e)})},tt.reject=function(e){return new tt(function(t,n){n(e)})},tt.race=function(e){return new tt(function(t,n){for(var i=0,r=e.length;i<r;i++)e[i].then(t,n)})},tt._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){Je(e,0)},tt._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var at=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==ze)return ze;throw new Error("unable to locate global object")}();at.Promise||(at.Promise=tt);var lt=Ze(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),ut=Object.freeze({default:lt,__moduleExports:lt}),ct=Ze(function(e){var t=e.exports={version:"2.5.5"};"number"==typeof __e&&(__e=t)}),ht=ct.version,dt=Object.freeze({default:ct,__moduleExports:ct,version:ht}),pt=function(e){return"object"==typeof e?null!==e:"function"==typeof e},ft=Object.freeze({default:pt,__moduleExports:pt}),gt=ft&&pt||ft,vt=function(e){if(!gt(e))throw TypeError(e+" is not an object!");return e},mt=Object.freeze({default:vt,__moduleExports:vt}),_t=function(e){try{return!!e()}catch(e){return!0}},yt=Object.freeze({default:_t,__moduleExports:_t}),bt=yt&&_t||yt,wt=!bt(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Ct=Object.freeze({default:wt,__moduleExports:wt}),Tt=ut&<||ut,Et=Tt.document,St=gt(Et)&>(Et.createElement),It=function(e){return St?Et.createElement(e):{}},kt=Object.freeze({default:It,__moduleExports:It}),xt=Ct&&wt||Ct,At=kt&&It||kt,Pt=!xt&&!bt(function(){return 7!=Object.defineProperty(At("div"),"a",{get:function(){return 7}}).a}),Ot=Object.freeze({default:Pt,__moduleExports:Pt}),Nt=function(e,t){if(!gt(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!gt(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!gt(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!gt(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},Lt=Object.freeze({default:Nt,__moduleExports:Nt}),Dt=mt&&vt||mt,Rt=Ot&&Pt||Ot,Mt=Lt&&Nt||Lt,Ft=Object.defineProperty,jt=xt?Object.defineProperty:function(e,t,n){if(Dt(e),t=Mt(t,!0),Dt(n),Rt)try{return Ft(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e},Ut={f:jt},Wt=Object.freeze({default:Ut,__moduleExports:Ut,f:jt}),Bt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Vt=Object.freeze({default:Bt,__moduleExports:Bt}),Ht=Wt&&Ut||Wt,$t=Vt&&Bt||Vt,Gt=xt?function(e,t,n){return Ht.f(e,t,$t(1,n))}:function(e,t,n){return e[t]=n,e},Kt=Object.freeze({default:Gt,__moduleExports:Gt}),qt={}.hasOwnProperty,Qt=function(e,t){return qt.call(e,t)},Yt=Object.freeze({default:Qt,__moduleExports:Qt}),zt=0,Xt=Math.random(),Zt=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++zt+Xt).toString(36))},Jt=Object.freeze({default:Zt,__moduleExports:Zt}),en=Kt&&Gt||Kt,tn=Yt&&Qt||Yt,nn=Jt&&Zt||Jt,rn=dt&&ct||dt,on=Ze(function(e){var t=nn("src"),n=Function.toString,i=(""+n).split("toString");rn.inspectSource=function(e){return n.call(e)},(e.exports=function(e,n,r,o){var s="function"==typeof r;s&&(tn(r,"name")||en(r,"name",n)),e[n]!==r&&(s&&(tn(r,t)||en(r,t,e[n]?""+e[n]:i.join(String(n)))),e===Tt?e[n]=r:o?e[n]?e[n]=r:en(e,n,r):(delete e[n],en(e,n,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||n.call(this)})}),sn=Object.freeze({default:on,__moduleExports:on}),an=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},ln=Object.freeze({default:an,__moduleExports:an}),un=ln&&an||ln,cn=function(e,t,n){if(un(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},hn=Object.freeze({default:cn,__moduleExports:cn}),dn=sn&&on||sn,pn=hn&&cn||hn,fn=function(e,t,n){var i,r,o,s,a=e&fn.F,l=e&fn.G,u=e&fn.S,c=e&fn.P,h=e&fn.B,d=l?Tt:u?Tt[t]||(Tt[t]={}):(Tt[t]||{}).prototype,p=l?rn:rn[t]||(rn[t]={}),f=p.prototype||(p.prototype={});for(i in l&&(n=t),n)o=((r=!a&&d&&void 0!==d[i])?d:n)[i],s=h&&r?pn(o,Tt):c&&"function"==typeof o?pn(Function.call,o):o,d&&dn(d,i,o,e&fn.U),p[i]!=o&&en(p,i,s),c&&f[i]!=o&&(f[i]=o)};Tt.core=rn,fn.F=1,fn.G=2,fn.S=4,fn.P=8,fn.B=16,fn.W=32,fn.U=64,fn.R=128;var gn=fn,vn=Object.freeze({default:gn,__moduleExports:gn}),mn={}.toString,_n=function(e){return mn.call(e).slice(8,-1)},yn=Object.freeze({default:_n,__moduleExports:_n}),bn=yn&&_n||yn,wn=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==bn(e)?e.split(""):Object(e)},Cn=Object.freeze({default:wn,__moduleExports:wn}),Tn=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},En=Object.freeze({default:Tn,__moduleExports:Tn}),Sn=En&&Tn||En,In=function(e){return Object(Sn(e))},kn=Object.freeze({default:In,__moduleExports:In}),xn=Math.ceil,An=Math.floor,Pn=function(e){return isNaN(e=+e)?0:(e>0?An:xn)(e)},On=Object.freeze({default:Pn,__moduleExports:Pn}),Nn=On&&Pn||On,Ln=Math.min,Dn=function(e){return e>0?Ln(Nn(e),9007199254740991):0},Rn=Object.freeze({default:Dn,__moduleExports:Dn}),Mn=Array.isArray||function(e){return"Array"==bn(e)},Fn=Object.freeze({default:Mn,__moduleExports:Mn}),jn=Tt["__core-js_shared__"]||(Tt["__core-js_shared__"]={}),Un=function(e){return jn[e]||(jn[e]={})},Wn=Object.freeze({default:Un,__moduleExports:Un}),Bn=Wn&&Un||Wn,Vn=Ze(function(e){var t=Bn("wks"),n=Tt.Symbol,i="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=i&&n[e]||(i?n:nn)("Symbol."+e))}).store=t}),Hn=Object.freeze({default:Vn,__moduleExports:Vn}),$n=Fn&&Mn||Fn,Gn=Hn&&Vn||Hn,Kn=Gn("species"),qn=function(e){var t;return $n(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!$n(t.prototype)||(t=void 0),gt(t)&&null===(t=t[Kn])&&(t=void 0)),void 0===t?Array:t},Qn=Object.freeze({default:qn,__moduleExports:qn}),Yn=Qn&&qn||Qn,zn=function(e,t){return new(Yn(e))(t)},Xn=Object.freeze({default:zn,__moduleExports:zn}),Zn=Cn&&wn||Cn,Jn=kn&&In||kn,ei=Rn&&Dn||Rn,ti=Xn&&zn||Xn,ni=function(e,t){var n=1==e,i=2==e,r=3==e,o=4==e,s=6==e,a=5==e||s,l=t||ti;return function(t,u,c){for(var h,d,p=Jn(t),f=Zn(p),g=pn(u,c,3),v=ei(f.length),m=0,_=n?l(t,v):i?l(t,0):void 0;v>m;m++)if((a||m in f)&&(d=g(h=f[m],m,p),e))if(n)_[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:_.push(h)}else if(o)return!1;return s?-1:r||o?o:_}},ii=Object.freeze({default:ni,__moduleExports:ni}),ri=Gn("unscopables"),oi=Array.prototype;void 0==oi[ri]&&en(oi,ri,{});var si=function(e){oi[ri][e]=!0},ai=Object.freeze({default:si,__moduleExports:si}),li=vn&&gn||vn,ui=ii&&ni||ii,ci=ai&&si||ai,hi=ui(5),di=!0;"find"in[]&&Array(1).find(function(){di=!1}),li(li.P+li.F*di,"Array",{find:function(e){return hi(this,e,arguments.length>1?arguments[1]:void 0)}}),ci("find");rn.Array.find;var pi=ui(6),fi=!0;"findIndex"in[]&&Array(1).findIndex(function(){fi=!1}),li(li.P+li.F*fi,"Array",{findIndex:function(e){return pi(this,e,arguments.length>1?arguments[1]:void 0)}}),ci("findIndex");rn.Array.findIndex;var gi=function(e){return Zn(Sn(e))},vi=Object.freeze({default:gi,__moduleExports:gi}),mi=Math.max,_i=Math.min,yi=function(e,t){return(e=Nn(e))<0?mi(e+t,0):_i(e,t)},bi=Object.freeze({default:yi,__moduleExports:yi}),wi=vi&&gi||vi,Ci=bi&&yi||bi,Ti=function(e){return function(t,n,i){var r,o=wi(t),s=ei(o.length),a=Ci(i,s);if(e&&n!=n){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},Ei=Object.freeze({default:Ti,__moduleExports:Ti}),Si=Bn("keys"),Ii=function(e){return Si[e]||(Si[e]=nn(e))},ki=Object.freeze({default:Ii,__moduleExports:Ii}),xi=ki&&Ii||ki,Ai=(Ei&&Ti||Ei)(!1),Pi=xi("IE_PROTO"),Oi=function(e,t){var n,i=wi(e),r=0,o=[];for(n in i)n!=Pi&&tn(i,n)&&o.push(n);for(;t.length>r;)tn(i,n=t[r++])&&(~Ai(o,n)||o.push(n));return o},Ni=Object.freeze({default:Oi,__moduleExports:Oi}),Li="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Di=Object.freeze({default:Li,__moduleExports:Li}),Ri=Ni&&Oi||Ni,Mi=Di&&Li||Di,Fi=Object.keys||function(e){return Ri(e,Mi)},ji=Object.freeze({default:Fi,__moduleExports:Fi}),Ui=Object.getOwnPropertySymbols,Wi={f:Ui},Bi=Object.freeze({default:Wi,__moduleExports:Wi,f:Ui}),Vi={}.propertyIsEnumerable,Hi={f:Vi},$i=Object.freeze({default:Hi,__moduleExports:Hi,f:Vi}),Gi=ji&&Fi||ji,Ki=Bi&&Wi||Bi,qi=$i&&Hi||$i,Qi=Object.assign,Yi=!Qi||bt(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=Qi({},e)[n]||Object.keys(Qi({},t)).join("")!=i})?function(e,t){for(var n=arguments,i=Jn(e),r=arguments.length,o=1,s=Ki.f,a=qi.f;r>o;)for(var l,u=Zn(n[o++]),c=s?Gi(u).concat(s(u)):Gi(u),h=c.length,d=0;h>d;)a.call(u,l=c[d++])&&(i[l]=u[l]);return i}:Qi,zi=Object.freeze({default:Yi,__moduleExports:Yi}),Xi=zi&&Yi||zi;li(li.S+li.F,"Object",{assign:Xi});rn.Object.assign;var Zi=Gn("match"),Ji=function(e){var t;return gt(e)&&(void 0!==(t=e[Zi])?!!t:"RegExp"==bn(e))},er=Object.freeze({default:Ji,__moduleExports:Ji}),tr=er&&Ji||er,nr=function(e,t,n){if(tr(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(Sn(e))},ir=Object.freeze({default:nr,__moduleExports:nr}),rr=Gn("match"),or=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[rr]=!1,!"/./"[e](t)}catch(e){}}return!0},sr=Object.freeze({default:or,__moduleExports:or}),ar=ir&&nr||ir,lr=sr&&or||sr,ur="".startsWith;li(li.P+li.F*lr("startsWith"),"String",{startsWith:function(e){var t=ar(this,e,"startsWith"),n=ei(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),i=String(e);return ur?ur.call(t,i,n):t.slice(n,n+i.length)===i}});rn.String.startsWith;var cr=function(e){var t=String(Sn(this)),n="",i=Nn(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},hr=Object.freeze({default:cr,__moduleExports:cr}),dr=hr&&cr||hr;li(li.P,"String",{repeat:dr});rn.String.repeat;var pr=Ze(function(e){var t=nn("meta"),n=Ht.f,i=0,r=Object.isExtensible||function(){return!0},o=!bt(function(){return r(Object.preventExtensions({}))}),s=function(e){n(e,t,{value:{i:"O"+ ++i,w:{}}})},a=e.exports={KEY:t,NEED:!1,fastKey:function(e,n){if(!gt(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!tn(e,t)){if(!r(e))return"F";if(!n)return"E";s(e)}return e[t].i},getWeak:function(e,n){if(!tn(e,t)){if(!r(e))return!0;if(!n)return!1;s(e)}return e[t].w},onFreeze:function(e){return o&&a.NEED&&r(e)&&!tn(e,t)&&s(e),e}}}),fr=pr.KEY,gr=pr.NEED,vr=pr.fastKey,mr=pr.getWeak,_r=pr.onFreeze,yr=Object.freeze({default:pr,__moduleExports:pr,KEY:fr,NEED:gr,fastKey:vr,getWeak:mr,onFreeze:_r}),br=Ht.f,wr=Gn("toStringTag"),Cr=function(e,t,n){e&&!tn(e=n?e:e.prototype,wr)&&br(e,wr,{configurable:!0,value:t})},Tr=Object.freeze({default:Cr,__moduleExports:Cr}),Er=Gn,Sr={f:Er},Ir=Object.freeze({default:Sr,__moduleExports:Sr,f:Er}),kr=Object.freeze({default:!1,__moduleExports:!1}),xr=kr,Ar=Ir&&Sr||Ir,Pr=Ht.f,Or=function(e){var t=rn.Symbol||(rn.Symbol=xr?{}:Tt.Symbol||{});"_"==e.charAt(0)||e in t||Pr(t,e,{value:Ar.f(e)})},Nr=Object.freeze({default:Or,__moduleExports:Or}),Lr=function(e){var t=Gi(e),n=Ki.f;if(n)for(var i,r=n(e),o=qi.f,s=0;r.length>s;)o.call(e,i=r[s++])&&t.push(i);return t},Dr=Object.freeze({default:Lr,__moduleExports:Lr}),Rr=xt?Object.defineProperties:function(e,t){Dt(e);for(var n,i=Gi(t),r=i.length,o=0;r>o;)Ht.f(e,n=i[o++],t[n]);return e},Mr=Object.freeze({default:Rr,__moduleExports:Rr}),Fr=Tt.document,jr=Fr&&Fr.documentElement,Ur=Object.freeze({default:jr,__moduleExports:jr}),Wr=Mr&&Rr||Mr,Br=Ur&&jr||Ur,Vr=xi("IE_PROTO"),Hr=function(){},$r=function(){var e,t=At("iframe"),n=Mi.length;for(t.style.display="none",Br.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),$r=e.F;n--;)delete $r.prototype[Mi[n]];return $r()},Gr=Object.create||function(e,t){var n;return null!==e?(Hr.prototype=Dt(e),n=new Hr,Hr.prototype=null,n[Vr]=e):n=$r(),void 0===t?n:Wr(n,t)},Kr=Object.freeze({default:Gr,__moduleExports:Gr}),qr=Mi.concat("length","prototype"),Qr=Object.getOwnPropertyNames||function(e){return Ri(e,qr)},Yr={f:Qr},zr=Object.freeze({default:Yr,__moduleExports:Yr,f:Qr}),Xr=zr&&Yr||zr,Zr=Xr.f,Jr={}.toString,eo="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],to=function(e){return eo&&"[object Window]"==Jr.call(e)?function(e){try{return Zr(e)}catch(e){return eo.slice()}}(e):Zr(wi(e))},no={f:to},io=Object.freeze({default:no,__moduleExports:no,f:to}),ro=Object.getOwnPropertyDescriptor,oo=xt?ro:function(e,t){if(e=wi(e),t=Mt(t,!0),Rt)try{return ro(e,t)}catch(e){}if(tn(e,t))return $t(!qi.f.call(e,t),e[t])},so={f:oo},ao=Object.freeze({default:so,__moduleExports:so,f:oo}),lo=Tr&&Cr||Tr,uo=Nr&&Or||Nr,co=Dr&&Lr||Dr,ho=Kr&&Gr||Kr,po=io&&no||io,fo=ao&&so||ao,go=(yr&&pr||yr).KEY,vo=fo.f,mo=Ht.f,_o=po.f,yo=Tt.Symbol,bo=Tt.JSON,wo=bo&&bo.stringify,Co=Gn("_hidden"),To=Gn("toPrimitive"),Eo={}.propertyIsEnumerable,So=Bn("symbol-registry"),Io=Bn("symbols"),ko=Bn("op-symbols"),xo=Object.prototype,Ao="function"==typeof yo,Po=Tt.QObject,Oo=!Po||!Po.prototype||!Po.prototype.findChild,No=xt&&bt(function(){return 7!=ho(mo({},"a",{get:function(){return mo(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=vo(xo,t);i&&delete xo[t],mo(e,t,n),i&&e!==xo&&mo(xo,t,i)}:mo,Lo=function(e){var t=Io[e]=ho(yo.prototype);return t._k=e,t},Do=Ao&&"symbol"==typeof yo.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof yo},Ro=function(e,t,n){return e===xo&&Ro(ko,t,n),Dt(e),t=Mt(t,!0),Dt(n),tn(Io,t)?(n.enumerable?(tn(e,Co)&&e[Co][t]&&(e[Co][t]=!1),n=ho(n,{enumerable:$t(0,!1)})):(tn(e,Co)||mo(e,Co,$t(1,{})),e[Co][t]=!0),No(e,t,n)):mo(e,t,n)},Mo=function(e,t){Dt(e);for(var n,i=co(t=wi(t)),r=0,o=i.length;o>r;)Ro(e,n=i[r++],t[n]);return e},Fo=function(e){var t=Eo.call(this,e=Mt(e,!0));return!(this===xo&&tn(Io,e)&&!tn(ko,e))&&(!(t||!tn(this,e)||!tn(Io,e)||tn(this,Co)&&this[Co][e])||t)},jo=function(e,t){if(e=wi(e),t=Mt(t,!0),e!==xo||!tn(Io,t)||tn(ko,t)){var n=vo(e,t);return!n||!tn(Io,t)||tn(e,Co)&&e[Co][t]||(n.enumerable=!0),n}},Uo=function(e){for(var t,n=_o(wi(e)),i=[],r=0;n.length>r;)tn(Io,t=n[r++])||t==Co||t==go||i.push(t);return i},Wo=function(e){for(var t,n=e===xo,i=_o(n?ko:wi(e)),r=[],o=0;i.length>o;)!tn(Io,t=i[o++])||n&&!tn(xo,t)||r.push(Io[t]);return r};Ao||(dn((yo=function(){if(this instanceof yo)throw TypeError("Symbol is not a constructor!");var e=nn(arguments.length>0?arguments[0]:void 0),t=function(n){this===xo&&t.call(ko,n),tn(this,Co)&&tn(this[Co],e)&&(this[Co][e]=!1),No(this,e,$t(1,n))};return xt&&Oo&&No(xo,e,{configurable:!0,set:t}),Lo(e)}).prototype,"toString",function(){return this._k}),fo.f=jo,Ht.f=Ro,Xr.f=po.f=Uo,qi.f=Fo,Ki.f=Wo,xt&&!xr&&dn(xo,"propertyIsEnumerable",Fo,!0),Ar.f=function(e){return Lo(Gn(e))}),li(li.G+li.W+li.F*!Ao,{Symbol:yo});for(var Bo="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Vo=0;Bo.length>Vo;)Gn(Bo[Vo++]);for(var Ho=Gi(Gn.store),$o=0;Ho.length>$o;)uo(Ho[$o++]);li(li.S+li.F*!Ao,"Symbol",{for:function(e){return tn(So,e+="")?So[e]:So[e]=yo(e)},keyFor:function(e){if(!Do(e))throw TypeError(e+" is not a symbol!");for(var t in So)if(So[t]===e)return t},useSetter:function(){Oo=!0},useSimple:function(){Oo=!1}}),li(li.S+li.F*!Ao,"Object",{create:function(e,t){return void 0===t?ho(e):Mo(ho(e),t)},defineProperty:Ro,defineProperties:Mo,getOwnPropertyDescriptor:jo,getOwnPropertyNames:Uo,getOwnPropertySymbols:Wo}),bo&&li(li.S+li.F*(!Ao||bt(function(){var e=yo();return"[null]"!=wo([e])||"{}"!=wo({a:e})||"{}"!=wo(Object(e))})),"JSON",{stringify:function(e){for(var t,n,i=arguments,r=[e],o=1;arguments.length>o;)r.push(i[o++]);if(n=t=r[1],(gt(t)||void 0!==e)&&!Do(e))return $n(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Do(t))return t}),r[1]=t,wo.apply(bo,r)}}),yo.prototype[To]||en(yo.prototype,To,yo.prototype.valueOf),lo(yo,"Symbol"),lo(Math,"Math",!0),lo(Tt.JSON,"JSON",!0);var Go=Gn("toStringTag"),Ko="Arguments"==bn(function(){return arguments}()),qo=function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Go))?n:Ko?bn(t):"Object"==(i=bn(t))&&"function"==typeof t.callee?"Arguments":i},Qo=Object.freeze({default:qo,__moduleExports:qo}),Yo=Qo&&qo||Qo,zo={};zo[Gn("toStringTag")]="z",zo+""!="[object z]"&&dn(Object.prototype,"toString",function(){return"[object "+Yo(this)+"]"},!0),uo("asyncIterator"),uo("observable");rn.Symbol;var Xo=function(e){return function(t,n){var i,r,o=String(Sn(t)),s=Nn(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=o.charCodeAt(s))<55296||i>56319||s+1===a||(r=o.charCodeAt(s+1))<56320||r>57343?e?o.charAt(s):i:e?o.slice(s,s+2):r-56320+(i-55296<<10)+65536}},Zo=Object.freeze({default:Xo,__moduleExports:Xo}),Jo={},es=Object.freeze({default:Jo,__moduleExports:Jo}),ts={};en(ts,Gn("iterator"),function(){return this});var ns=function(e,t,n){e.prototype=ho(ts,{next:$t(1,n)}),lo(e,t+" Iterator")},is=Object.freeze({default:ns,__moduleExports:ns}),rs=xi("IE_PROTO"),os=Object.prototype,ss=Object.getPrototypeOf||function(e){return e=Jn(e),tn(e,rs)?e[rs]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?os:null},as=Object.freeze({default:ss,__moduleExports:ss}),ls=es&&Jo||es,us=is&&ns||is,cs=as&&ss||as,hs=Gn("iterator"),ds=!([].keys&&"next"in[].keys()),ps=function(){return this},fs=function(e,t,n,i,r,o,s){us(n,t,i);var a,l,u,c=function(e){if(!ds&&e in f)return f[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},h=t+" Iterator",d="values"==r,p=!1,f=e.prototype,g=f[hs]||f["@@iterator"]||r&&f[r],v=g||c(r),m=r?d?c("entries"):v:void 0,_="Array"==t&&f.entries||g;if(_&&(u=cs(_.call(new e)))!==Object.prototype&&u.next&&(lo(u,h,!0),xr||"function"==typeof u[hs]||en(u,hs,ps)),d&&g&&"values"!==g.name&&(p=!0,v=function(){return g.call(this)}),xr&&!s||!ds&&!p&&f[hs]||en(f,hs,v),ls[t]=v,ls[h]=ps,r)if(a={values:d?v:c("values"),keys:o?v:c("keys"),entries:m},s)for(l in a)l in f||dn(f,l,a[l]);else li(li.P+li.F*(ds||p),t,a);return a},gs=Object.freeze({default:fs,__moduleExports:fs}),vs=gs&&fs||gs,ms=(Zo&&Xo||Zo)(!0);vs(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=ms(t,n),this._i+=e.length,{value:e,done:!1})});var _s=function(e,t){return{value:t,done:!!e}},ys=Object.freeze({default:_s,__moduleExports:_s}),bs=ys&&_s||ys,ws=vs(Array,"Array",function(e,t){this._t=wi(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,bs(1)):bs(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values");ls.Arguments=ls.Array,ci("keys"),ci("values"),ci("entries");for(var Cs=Object.freeze({default:ws,__moduleExports:ws}),Ts=Cs&&ws||Cs,Es=Gn("iterator"),Ss=Gn("toStringTag"),Is=ls.Array,ks={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},xs=Gi(ks),As=0;As<xs.length;As++){var Ps,Os=xs[As],Ns=ks[Os],Ls=Tt[Os],Ds=Ls&&Ls.prototype;if(Ds&&(Ds[Es]||en(Ds,Es,Is),Ds[Ss]||en(Ds,Ss,Os),ls[Os]=Is,Ns))for(Ps in Ts)Ds[Ps]||dn(Ds,Ps,Ts[Ps],!0)}Ar.f("iterator");var Rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};function Ms(e,t){function n(){this.constructor=e}Rs(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Fs=Object.assign||function(e){for(var t,n=arguments,i=1,r=arguments.length;i<r;i++)for(var o in t=n[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function js(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}l((i=i.apply(e,t||[])).next())})}function Us(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=i[2&o[0]?"return":o[0]?"throw":"next"])&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[0,r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function Ws(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function Bs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}function Vs(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t=t.concat(Bs(e[n]));return t}function Hs(e){return this instanceof Hs?(this.v=e,this):new Hs(e)}var $s=Object.freeze({__extends:Ms,__assign:Fs,__rest:function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&(n[i[r]]=e[i[r]])}return n},__decorate:function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},__param:function(e,t){return function(n,i){t(n,i,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:js,__generator:Us,__exportStar:function(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])},__values:Ws,__read:Bs,__spread:Vs,__await:Hs,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,r=n.apply(e,t||[]),o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(e){r[e]&&(i[e]=function(t){return new Promise(function(n,i){o.push([e,t,n,i])>1||a(e,t)})})}function a(e,t){try{(n=r[e](t)).value instanceof Hs?Promise.resolve(n.value.v).then(l,u):c(o[0][2],n)}catch(e){c(o[0][3],e)}var n}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},__asyncDelegator:function(e){var t,n;return t={},i("next"),i("throw",function(e){throw e}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,r){e[i]&&(t[i]=function(t){return(n=!n)?{value:Hs(e[i](t)),done:"return"===i}:r?r(t):t})}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):Ws(e)},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}}}),Gs=$s,Ks=Ze(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw r(t)},r=function(e){return new Error("Firebase Database ("+n.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},o=function(e){for(var t=[],n=0,i=0;i<e.length;i++){var r=e.charCodeAt(i);r<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i)),t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128)}return t},s={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:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[],r=0;r<e.length;r+=3){var o=e[r],s=r+1<e.length,a=s?e[r+1]:0,l=r+2<e.length,u=l?e[r+2]:0,c=o>>2,h=(3&o)<<4|a>>4,d=(15&a)<<2|u>>6,p=63&u;l||(p=64,s||(d=64)),i.push(n[c],n[h],n[d],n[p])}return i.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,i=0;n<e.length;){var r=e[n++];if(r<128)t[i++]=String.fromCharCode(r);else if(r>191&&r<224){var o=e[n++];t[i++]=String.fromCharCode((31&r)<<6|63&o)}else if(r>239&&r<365){var s=((7&r)<<18|(63&(o=e[n++]))<<12|(63&(a=e[n++]))<<6|63&e[n++])-65536;t[i++]=String.fromCharCode(55296+(s>>10)),t[i++]=String.fromCharCode(56320+(1023&s))}else{o=e[n++];var a=e[n++];t[i++]=String.fromCharCode((15&r)<<12|(63&o)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,i=[],r=0;r<e.length;){var o=n[e.charAt(r++)],s=r<e.length?n[e.charAt(r)]:0,a=++r<e.length?n[e.charAt(r)]:64,l=++r<e.length?n[e.charAt(r)]:64;if(++r,null==o||null==s||null==a||null==l)throw Error();var u=o<<2|s>>4;if(i.push(u),64!=a){var c=s<<4&240|a>>2;if(i.push(c),64!=l){var h=a<<6&192|l;i.push(h)}}}return i},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},a=function(e){try{return s.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=l(e[n],t[n]));return e}var u=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,i){n?t.reject(n):t.resolve(i),"function"==typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,i))}},e}(),c=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""},h="FirebaseError",d=Error.captureStackTrace;var p=function(){return function(e,t){if(this.code=e,this.message=t,d)d(this,f.prototype.create);else try{throw Error.apply(this,arguments)}catch(e){this.name=h,Object.defineProperty(this,"stack",{get:function(){return e.stack}})}}}();p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name=h;var f=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n,this.pattern=/\{\$([^}]+)}/g}return e.prototype.create=function(e,t){void 0===t&&(t={});var n,i=this.errors[e],r=this.service+"/"+e;n=void 0===i?"Error":i.replace(this.pattern,function(e,n){var i=t[n];return void 0!==i?i.toString():"<"+n+"?>"}),n=this.serviceName+": "+n+" ("+r+").";var o=new p(r,n);for(var s in t)t.hasOwnProperty(s)&&"_"!==s.slice(-1)&&(o[s]=t[s]);return o},e}();function g(e){return JSON.parse(e)}var v=function(e){var t={},n={},i={},r="";try{var o=e.split(".");t=g(a(o[0])||""),n=g(a(o[1])||""),r=o[2],i=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:i,signature:r}},m=function(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])},_=function(e,t){return m(t,function(t,n){e[t]=n}),e},y=function(e,t,n){for(var i in e)if(t.call(n,e[i],i,e))return i},b=function(e){function t(){var t=e.call(this)||this;t.chain_=[],t.buf_=[],t.W_=[],t.pad_=[],t.inbuf_=0,t.total_=0,t.blockSize=64,t.pad_[0]=128;for(var n=1;n<t.blockSize;++n)t.pad_[n]=0;return t.reset(),t}return Gs.__extends(t,e),t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(e,t){t||(t=0);var n=this.W_;if("string"==typeof e)for(var i=0;i<16;i++)n[i]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(i=0;i<16;i++)n[i]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(i=16;i<80;i++){var r=n[i-3]^n[i-8]^n[i-14]^n[i-16];n[i]=4294967295&(r<<1|r>>>31)}var o,s,a=this.chain_[0],l=this.chain_[1],u=this.chain_[2],c=this.chain_[3],h=this.chain_[4];for(i=0;i<80;i++){i<40?i<20?(o=c^l&(u^c),s=1518500249):(o=l^u^c,s=1859775393):i<60?(o=l&u|c&(l|u),s=2400959708):(o=l^u^c,s=3395469782);r=(a<<5|a>>>27)+o+h+s+n[i]&4294967295;h=c,c=u,u=4294967295&(l<<30|l>>>2),l=a,a=r}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},t.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,i=0,r=this.buf_,o=this.inbuf_;i<t;){if(0==o)for(;i<=n;)this.compress_(e,i),i+=this.blockSize;if("string"==typeof e){for(;i<t;)if(r[o]=e.charCodeAt(i),++i,++o==this.blockSize){this.compress_(r),o=0;break}}else for(;i<t;)if(r[o]=e[i],++i,++o==this.blockSize){this.compress_(r),o=0;break}}this.inbuf_=o,this.total_+=t}},t.prototype.digest=function(){var e=[],t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var i=0;for(n=0;n<5;n++)for(var r=24;r>=0;r-=8)e[i]=this.chain_[n]>>r&255,++i;return e},t}(function(){return function(){this.blockSize=-1}}());var w=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var i,r=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(i=function(e,t){if("object"!=typeof e||null===e)return!1;for(var n=0,i=t;n<i.length;n++){var r=i[n];if(r in e&&"function"==typeof e[r])return!0}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n}).next&&(i.next=C),void 0===i.error&&(i.error=C),void 0===i.complete&&(i.complete=C);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{r.finalError?i.error(r.finalError):i.complete()}catch(e){}}),this.observers.push(i),o},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();function C(){}function T(e,t,n){var i="";switch(t){case 1:i=n?"first":"First";break;case 2:i=n?"second":"Second";break;case 3:i=n?"third":"Third";break;case 4:i=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4. Need to update it?")}var r=e+" failed: ";return r+=i+" argument "}t.assert=i,t.assertionError=r,t.base64=s,t.base64Decode=a,t.base64Encode=function(e){var t=o(e);return s.encodeByteArray(t,!0)},t.CONSTANTS=n,t.deepCopy=function(e){return l(void 0,e)},t.deepExtend=l,t.patchProperty=function(e,t,n){e[t]=n},t.Deferred=u,t.getUA=c,t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(c())},t.isNodeSdk=function(){return!0===n.NODE_CLIENT||!0===n.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.ErrorFactory=f,t.FirebaseError=p,t.patchCapture=function(e){var t=d;return d=e,t},t.jsonEval=g,t.stringify=function(e){return JSON.stringify(e)},t.decode=v,t.isAdmin=function(e){var t=v(e).claims;return"object"==typeof t&&!0===t.admin},t.issuedAtTime=function(e){var t=v(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.isValidFormat=function(e){var t=v(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t,n,i=v(e).claims,r=Math.floor((new Date).getTime()/1e3);return"object"==typeof i&&(i.hasOwnProperty("nbf")?t=i.nbf:i.hasOwnProperty("iat")&&(t=i.iat),n=i.hasOwnProperty("exp")?i.exp:t+86400),r&&t&&n&&r>=t&&r<=n},t.clone=function(e){return _({},e)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.every=function(e,t){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!t(n,e[n]))return!1;return!0},t.extend=_,t.findKey=y,t.findValue=function(e,t,n){var i=y(e,t,n);return i&&e[i]},t.forEach=m,t.getAnyKey=function(e){for(var t in e)return t},t.getCount=function(e){var t=0;for(var n in e)t++;return t},t.getValues=function(e){var t=[],n=0;for(var i in e)t[n++]=e[i];return t},t.isEmpty=function(e){for(var t in e)return!1;return!0},t.isNonNullObject=function(e){return"object"==typeof e&&null!==e},t.map=function(e,t,n){var i={};for(var r in e)i[r]=t.call(n,e[r],r,e);return i},t.safeGet=function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]},t.querystring=function(e){var t=[];return m(e,function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}),t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.Sha1=b,t.async=function(e,t){return function(){for(var n=arguments,i=[],r=0;r<arguments.length;r++)i[r]=n[r];Promise.resolve(!0).then(function(){e.apply(void 0,i)}).catch(function(e){t&&t(e)})}},t.createSubscribe=function(e,t){var n=new w(e,t);return n.subscribe.bind(n)},t.errorPrefix=T,t.validateArgCount=function(e,t,n,i){var r;if(i<t?r="at least "+t:i>n&&(r=0===n?"none":"no more than "+n),r)throw new Error(e+" failed: Was called with "+i+(1===i?" argument.":" arguments.")+" Expects "+r+".")},t.validateCallback=function(e,t,n,i){if((!i||n)&&"function"!=typeof n)throw new Error(T(e,t,i)+"must be a valid function.")},t.validateContextObject=function(e,t,n,i){if((!i||n)&&("object"!=typeof n||null===n))throw new Error(T(e,t,i)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,i){if((!i||n)&&"string"!=typeof n)throw new Error(T(e,t,i)+"must be a valid firebase namespace.")},t.stringLength=function(e){for(var t=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t++:i<2048?t+=2:i>=55296&&i<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);if(o>=55296&&o<=56319){var s=o-55296;i(++r<e.length,"Surrogate pair missing trail surrogate."),o=65536+(s<<10)+(e.charCodeAt(r)-56320)}o<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):o<65536?(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128)}return t}}),qs=Xe(Ks),Qs=Ks.assert,Ys=Ks.assertionError,zs=Ks.base64,Xs=Ks.base64Decode,Zs=Ks.base64Encode,Js=Ks.CONSTANTS,ea=Ks.deepCopy,ta=Ks.deepExtend,na=Ks.patchProperty,ia=Ks.Deferred,ra=Ks.getUA,oa=Ks.isMobileCordova,sa=Ks.isNodeSdk,aa=Ks.isReactNative,la=Ks.ErrorFactory,ua=Ks.FirebaseError,ca=Ks.patchCapture,ha=Ks.jsonEval,da=Ks.stringify,pa=Ks.decode,fa=Ks.isAdmin,ga=Ks.issuedAtTime,va=Ks.isValidFormat,ma=Ks.isValidTimestamp,_a=Ks.clone,ya=Ks.contains,ba=Ks.every,wa=Ks.extend,Ca=Ks.findKey,Ta=Ks.findValue,Ea=Ks.forEach,Sa=Ks.getAnyKey,Ia=Ks.getCount,ka=Ks.getValues,xa=Ks.isEmpty,Aa=Ks.isNonNullObject,Pa=Ks.map,Oa=Ks.safeGet,Na=Ks.querystring,La=Ks.querystringDecode,Da=Ks.Sha1,Ra=Ks.async,Ma=Ks.createSubscribe,Fa=Ks.errorPrefix,ja=Ks.validateArgCount,Ua=Ks.validateCallback,Wa=Ks.validateContextObject,Ba=Ks.validateNamespace,Va=Ks.stringLength,Ha=Ks.stringToByteArray,$a=Object.freeze({default:qs,__moduleExports:Ks,assert:Qs,assertionError:Ys,base64:zs,base64Decode:Xs,base64Encode:Zs,CONSTANTS:Js,deepCopy:ea,deepExtend:ta,patchProperty:na,Deferred:ia,getUA:ra,isMobileCordova:oa,isNodeSdk:sa,isReactNative:aa,ErrorFactory:la,FirebaseError:ua,patchCapture:ca,jsonEval:ha,stringify:da,decode:pa,isAdmin:fa,issuedAtTime:ga,isValidFormat:va,isValidTimestamp:ma,clone:_a,contains:ya,every:ba,extend:wa,findKey:Ca,findValue:Ta,forEach:Ea,getAnyKey:Sa,getCount:Ia,getValues:ka,isEmpty:xa,isNonNullObject:Aa,map:Pa,safeGet:Oa,querystring:Na,querystringDecode:La,Sha1:Da,async:Ra,createSubscribe:Ma,errorPrefix:Fa,validateArgCount:ja,validateCallback:Ua,validateContextObject:Wa,validateNamespace:Ba,stringLength:Va,stringToByteArray:Ha}),Ga=$a&&qs||$a,Ka=Ze(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i="[DEFAULT]",r=[],o=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled||!1,this.options_=Ga.deepCopy(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){r.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){r=r.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed_(),this._automaticDataCollectionEnabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);var t=[];return Object.keys(e.services_).forEach(function(n){Object.keys(e.services_[n]).forEach(function(i){t.push(e.services_[n][i])})}),Promise.all(t.map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=i),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t!==i?t:void 0,r=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=r}return this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;Ga.deepExtend(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(r.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),r=[])},e.prototype.checkDestroyed_=function(){this.isDeleted_&&s("app-deleted",{name:this.name_})},e}();function s(e,t){throw a.create(e,t)}o.prototype.name&&o.prototype.options||o.prototype.delete||console.log("dc");var a=new Ga.ErrorFactory("app","Firebase",{"no-app":"No Firebase App '{$name}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$name}","duplicate-app":"Firebase App named '{$name}' already exists","app-deleted":"Firebase App named '{$name}' already deleted","duplicate-service":"Firebase service named '{$name}' already registered","sa-not-supported":"Initializing the Firebase SDK with a service account is only allowed in a Node.js environment. On client devices, you should instead initialize the SDK with an api key and auth domain","invalid-app-argument":"firebase.{$name}() takes either no argument or a Firebase App instance."}),l=!1;try{l="[object process]"===Object.prototype.toString.call(ze.process)}catch(e){}l&&console.warn('\nWarning: This is a browser-targeted Firebase bundle but it appears it is being\nrun in a Node environment. If running in a Node environment, make sure you\nare using the bundle specified by the "main" field in package.json.\n\nIf you are using Webpack, you can specify "main" as the first item in\n"resolve.mainFields":\nhttps://webpack.js.org/configuration/resolve/#resolvemainfields\n\nIf using Rollup, use the rollup-plugin-node-resolve plugin and set "module"\nto false and "main" to true:\nhttps://github.com/rollup/rollup-plugin-node-resolve\n');var u=function e(){var t={},r={},a={},l={__esModule:!0,initializeApp:function(e,r){if(void 0===r&&(r={}),"object"!=typeof r||null===r){var a=r;r={name:a}}var u=r;void 0===u.name&&(u.name=i);var c=u.name;"string"==typeof c&&c||s("bad-app-name",{name:c+""}),n(t,c)&&s("duplicate-app",{name:c});var d=new o(e,u,l);return t[c]=d,h(d,"create"),d},app:u,apps:null,Promise:Promise,SDK_VERSION:"5.8.5",INTERNAL:{registerService:function(e,t,n,i,h){r[e]&&s("duplicate-service",{name:e}),r[e]=t,i&&(a[e]=i,c().forEach(function(e){i("create",e)}));var d=function(t){return void 0===t&&(t=u()),"function"!=typeof t[e]&&s("invalid-app-argument",{name:e}),t[e]()};return void 0!==n&&Ga.deepExtend(d,n),l[e]=d,o.prototype[e]=function(){for(var t=arguments,n=[],i=0;i<arguments.length;i++)n[i]=t[i];return this._getService.bind(this,e).apply(this,h?n:[])},d},createFirebaseNamespace:e,extendNamespace:function(e){Ga.deepExtend(l,e)},createSubscribe:Ga.createSubscribe,ErrorFactory:Ga.ErrorFactory,removeApp:function(e){h(t[e],"delete"),delete t[e]},factories:r,useAsService:d,Promise:Promise,deepExtend:Ga.deepExtend}};function u(e){return n(t,e=e||i)||s("no-app",{name:e}),t[e]}function c(){return Object.keys(t).map(function(e){return t[e]})}function h(e,t){Object.keys(r).forEach(function(n){var i=d(e,n);null!==i&&a[i]&&a[i](t,e)})}function d(e,t){if("serverAuth"===t)return null;var n=t;return e.options,n}return Ga.patchProperty(l,"default",l),Object.defineProperty(l,"apps",{get:c}),Ga.patchProperty(u,"App",o),l}();t.firebase=u,t.default=u}),qa=Xe(Ka),Qa=Ka.firebase,Ya=Object.freeze({default:qa,__moduleExports:Ka,firebase:Qa}),za=Ya&&qa||Ya;var Xa,Za=(Xa=za)&&"object"==typeof Xa&&"default"in Xa?Xa.default:Xa;(function(){var e,t=t||{},n=this;function i(e){return"string"==typeof e}function r(e){return"boolean"==typeof e}function o(){}function s(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t}function a(e){return null===e}function l(e){return"array"==s(e)}function u(e){var t=s(e);return"array"==t||"object"==t&&"number"==typeof e.length}function c(e){return"function"==s(e)}function h(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var d="closure_uid_"+(1e9*Math.random()>>>0),p=0;function f(e,t,n){return e.call.apply(e.bind,arguments)}function g(e,t,n){if(!e)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,i),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function v(e,t,n){return(v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?f:g).apply(null,arguments)}function m(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}var _=Date.now||function(){return+new Date};function y(e,t){function n(){}n.prototype=t.prototype,e.ob=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.ed=function(e,n,i){for(var r=arguments,o=Array(arguments.length-2),s=2;s<arguments.length;s++)o[s-2]=r[s];return t.prototype[n].apply(e,o)}}function b(e){e.prototype.then=e.prototype.then,e.prototype.$goog_Thenable=!0}function w(e){if(!e)return!1;try{return!!e.$goog_Thenable}catch(e){return!1}}function C(e){if(Error.captureStackTrace)Error.captureStackTrace(this,C);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e))}function T(e,t){for(var n="",i=(e=e.split("%s")).length-1,r=0;r<i;r++)n+=e[r]+(r<t.length?t[r]:"%s");C.call(this,n+e[i])}function E(e,t){throw new T("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1))}function S(e,t){this.c=e,this.f=t,this.b=0,this.a=null}function I(e,t){e.f(t),100>e.b&&(e.b++,t.next=e.a,e.a=t)}function k(){this.b=this.a=null}y(C,Error),C.prototype.name="CustomError",y(T,C),T.prototype.name="AssertionError",S.prototype.get=function(){if(0<this.b){this.b--;var e=this.a;this.a=e.next,e.next=null}else e=this.c();return e};var x=new S(function(){return new P},function(e){e.reset()});function A(){var e=de,t=null;return e.a&&(t=e.a,e.a=e.a.next,e.a||(e.b=null),t.next=null),t}function P(){this.next=this.b=this.a=null}k.prototype.add=function(e,t){var n=x.get();n.set(e,t),this.b?this.b.next=n:this.a=n,this.b=n},P.prototype.set=function(e,t){this.a=e,this.b=t,this.next=null},P.prototype.reset=function(){this.next=this.b=this.a=null};var O=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if(i(e))return i(t)&&1==t.length?e.indexOf(t,0):-1;for(var n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},N=Array.prototype.forEach?function(e,t,n){Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=i(e)?e.split(""):e,s=0;s<r;s++)s in o&&t.call(n,o[s],s,e)};var L=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var n=e.length,r=Array(n),o=i(e)?e.split(""):e,s=0;s<n;s++)s in o&&(r[s]=t.call(void 0,o[s],s,e));return r},D=Array.prototype.some?function(e,t){return Array.prototype.some.call(e,t,void 0)}:function(e,t){for(var n=e.length,r=i(e)?e.split(""):e,o=0;o<n;o++)if(o in r&&t.call(void 0,r[o],o,e))return!0;return!1};function R(e,t){return 0<=O(e,t)}function M(e,t){var n;return(n=0<=(t=O(e,t)))&&Array.prototype.splice.call(e,t,1),n}function F(e,t){!function(e,t){var n=e.length,r=i(e)?e.split(""):e;for(--n;0<=n;--n)n in r&&t.call(void 0,r[n],n,e)}(e,function(n,i){t.call(void 0,n,i,e)&&1==Array.prototype.splice.call(e,i,1).length&&0})}function j(e){return Array.prototype.concat.apply([],arguments)}function U(e){var t=e.length;if(0<t){for(var n=Array(t),i=0;i<t;i++)n[i]=e[i];return n}return[]}function W(e,t){for(var n=e.split("%s"),i="",r=Array.prototype.slice.call(arguments,1);r.length&&1<n.length;)i+=n.shift()+r.shift();return i+n.join("%s")}var B=String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]};function V(e){return z.test(e)?(-1!=e.indexOf("&")&&(e=e.replace($,"&")),-1!=e.indexOf("<")&&(e=e.replace(G,"<")),-1!=e.indexOf(">")&&(e=e.replace(K,">")),-1!=e.indexOf('"')&&(e=e.replace(q,""")),-1!=e.indexOf("'")&&(e=e.replace(Q,"'")),-1!=e.indexOf("\0")&&(e=e.replace(Y,"�")),e):e}var H,$=/&/g,G=/</g,K=/>/g,q=/"/g,Q=/'/g,Y=/\x00/g,z=/[\x00&<>"']/;function X(e,t){return-1!=e.indexOf(t)}function Z(e,t){return e<t?-1:e>t?1:0}e:{var J=n.navigator;if(J){var ee=J.userAgent;if(ee){H=ee;break e}}H=""}function te(e){return X(H,e)}function ne(e,t){for(var n in e)t.call(void 0,e[n],n,e)}function ie(e){for(var t in e)return!1;return!0}function re(e){var t,n={};for(t in e)n[t]=e[t];return n}var oe,se,ae="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function le(e,t){for(var n,i,r=arguments,o=1;o<arguments.length;o++){for(n in i=r[o])e[n]=i[n];for(var s=0;s<ae.length;s++)n=ae[s],Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}}function ue(e){n.setTimeout(function(){throw e},0)}function ce(e,t){se||function(){if(n.Promise&&n.Promise.resolve){var e=n.Promise.resolve(void 0);se=function(){e.then(pe)}}else se=function(){var e=pe;!c(n.setImmediate)||n.Window&&n.Window.prototype&&!te("Edge")&&n.Window.prototype.setImmediate==n.setImmediate?(oe||(oe=function(){var e=n.MessageChannel;if(void 0===e&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!te("Presto")&&(e=function(){var e=document.createElement("IFRAME");e.style.display="none",e.src="",document.documentElement.appendChild(e);var t=e.contentWindow;(e=t.document).open(),e.write(""),e.close();var n="callImmediate"+Math.random(),i="file:"==t.location.protocol?"*":t.location.protocol+"//"+t.location.host;e=v(function(e){"*"!=i&&e.origin!=i||e.data!=n||this.port1.onmessage()},this),t.addEventListener("message",e,!1),this.port1={},this.port2={postMessage:function(){t.postMessage(n,i)}}}),void 0!==e&&!te("Trident")&&!te("MSIE")){var t=new e,i={},r=i;return t.port1.onmessage=function(){if(void 0!==i.next){var e=(i=i.next).wb;i.wb=null,e()}},function(e){r.next={wb:e},r=r.next,t.port2.postMessage(0)}}return"undefined"!=typeof document&&"onreadystatechange"in document.createElement("SCRIPT")?function(e){var t=document.createElement("SCRIPT");t.onreadystatechange=function(){t.onreadystatechange=null,t.parentNode.removeChild(t),t=null,e(),e=null},document.documentElement.appendChild(t)}:function(e){n.setTimeout(e,0)}}()),oe(e)):n.setImmediate(e)}}(),he||(se(),he=!0),de.add(e,t)}var he=!1,de=new k;function pe(){for(var e;e=A();){try{e.a.call(e.b)}catch(e){ue(e)}I(x,e)}he=!1}function fe(e,t){if(this.a=ge,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,e!=o)try{var n=this;e.call(t,function(e){ke(n,ve,e)},function(e){if(!(e instanceof De))try{if(e instanceof Error)throw e;throw Error("Promise rejected.")}catch(e){}ke(n,me,e)})}catch(e){ke(this,me,e)}}var ge=0,ve=2,me=3;function _e(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}_e.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var ye=new S(function(){return new _e},function(e){e.reset()});function be(e,t,n){var i=ye.get();return i.g=e,i.b=t,i.f=n,i}function we(e){if(e instanceof fe)return e;var t=new fe(o);return ke(t,ve,e),t}function Ce(e){return new fe(function(t,n){n(e)})}function Te(e,t,n){xe(e,t,n,null)||ce(m(t,e))}function Ee(e){return new fe(function(t){var n=e.length,i=[];if(n)for(var r=function(e,r,o){n--,i[e]=r?{Db:!0,value:o}:{Db:!1,reason:o},0==n&&t(i)},o=0;o<e.length;o++)Te(e[o],m(r,o,!0),m(r,o,!1));else t(i)})}function Se(e,t){e.b||e.a!=ve&&e.a!=me||Ae(e),e.f?e.f.next=t:e.b=t,e.f=t}function Ie(e,t,n,i){var r=be(null,null,null);return r.a=new fe(function(e,o){r.g=t?function(n){try{var r=t.call(i,n);e(r)}catch(e){o(e)}}:e,r.b=n?function(t){try{var r=n.call(i,t);void 0===r&&t instanceof De?o(t):e(r)}catch(e){o(e)}}:o}),r.a.c=e,Se(e,r),r.a}function ke(e,t,n){e.a==ge&&(e===n&&(t=me,n=new TypeError("Promise cannot resolve to itself")),e.a=1,xe(n,e.Nc,e.Oc,e)||(e.i=n,e.a=t,e.c=null,Ae(e),t!=me||n instanceof De||function(e,t){e.g=!0,ce(function(){e.g&&Le.call(null,t)})}(e,n)))}function xe(e,t,n,i){if(e instanceof fe)return Se(e,be(t||o,n||null,i)),!0;if(w(e))return e.then(t,n,i),!0;if(h(e))try{var r=e.then;if(c(r))return function(e,t,n,i,r){function o(e){s||(s=!0,i.call(r,e))}var s=!1;try{t.call(e,function(e){s||(s=!0,n.call(r,e))},o)}catch(e){o(e)}}(e,r,t,n,i),!0}catch(e){return n.call(i,e),!0}return!1}function Ae(e){e.h||(e.h=!0,ce(e.Yb,e))}function Pe(e){var t=null;return e.b&&(t=e.b,e.b=t.next,t.next=null),e.b||(e.f=null),t}function Oe(e,t,n,i){if(n==me&&t.b&&!t.c)for(;e&&e.g;e=e.c)e.g=!1;if(t.a)t.a.c=null,Ne(t,n,i);else try{t.c?t.g.call(t.f):Ne(t,n,i)}catch(e){Le.call(null,e)}I(ye,t)}function Ne(e,t,n){t==ve?e.g.call(e.f,n):e.b&&e.b.call(e.f,n)}fe.prototype.then=function(e,t,n){return Ie(this,c(e)?e:null,c(t)?t:null,n)},b(fe),(e=fe.prototype).ia=function(e,t){return(e=be(e,e,t)).c=!0,Se(this,e),this},e.s=function(e,t){return Ie(this,null,e,t)},e.cancel=function(e){this.a==ge&&ce(function(){!function e(t,n){if(t.a==ge)if(t.c){var i=t.c;if(i.b){for(var r=0,o=null,s=null,a=i.b;a&&(a.c||(r++,a.a==t&&(o=a),!(o&&1<r)));a=a.next)o||(s=a);o&&(i.a==ge&&1==r?e(i,n):(s?((r=s).next==i.f&&(i.f=r),r.next=r.next.next):Pe(i),Oe(i,o,me,n)))}t.c=null}else ke(t,me,n)}(this,new De(e))},this)},e.Nc=function(e){this.a=ge,ke(this,ve,e)},e.Oc=function(e){this.a=ge,ke(this,me,e)},e.Yb=function(){for(var e;e=Pe(this);)Oe(this,e,this.a,this.i);this.h=!1};var Le=ue;function De(e){C.call(this,e)}function Re(){this.qa=this.qa,this.ja=this.ja}y(De,C),De.prototype.name="cancel";var Me=0;function Fe(e){if(!e.qa&&(e.qa=!0,e.va(),0!=Me))e[d]||(e[d]=++p)}function je(e){return je[" "](e),e}Re.prototype.qa=!1,Re.prototype.va=function(){if(this.ja)for(;this.ja.length;)this.ja.shift()()},je[" "]=o;var Ue,We,Be=te("Opera"),Ve=te("Trident")||te("MSIE"),He=te("Edge"),$e=He||Ve,Ge=te("Gecko")&&!(X(H.toLowerCase(),"webkit")&&!te("Edge"))&&!(te("Trident")||te("MSIE"))&&!te("Edge"),Ke=X(H.toLowerCase(),"webkit")&&!te("Edge");function qe(){var e=n.document;return e?e.documentMode:void 0}e:{var Qe="",Ye=(We=H,Ge?/rv:([^\);]+)(\)|;)/.exec(We):He?/Edge\/([\d\.]+)/.exec(We):Ve?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(We):Ke?/WebKit\/(\S+)/.exec(We):Be?/(?:Version)[ \/]?(\S+)/.exec(We):void 0);if(Ye&&(Qe=Ye?Ye[1]:""),Ve){var ze=qe();if(null!=ze&&ze>parseFloat(Qe)){Ue=String(ze);break e}}Ue=Qe}var Xe,Ze={};function Je(e){return function(e,t){var n=Ze;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(){for(var t=0,n=B(String(Ue)).split("."),i=B(String(e)).split("."),r=Math.max(n.length,i.length),o=0;0==t&&o<r;o++){var s=n[o]||"",a=i[o]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==s[0].length&&0==a[0].length)break;t=Z(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||Z(0==s[2].length,0==a[2].length)||Z(s[2],a[2]),s=s[3],a=a[3]}while(0==t)}return 0<=t})}var et=n.document;Xe=et&&Ve?qe()||("CSS1Compat"==et.compatMode?parseInt(Ue,10):5):void 0;var tt=Object.freeze||function(e){return e},nt=!Ve||9<=Number(Xe),it=Ve&&!Je("9"),rt=function(){if(!n.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});return n.addEventListener("test",o,t),n.removeEventListener("test",o,t),e}();function ot(e,t){this.type=e,this.b=this.target=t,this.Kb=!0}function st(e,t){if(ot.call(this,e?e.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,e){var n=this.type=e.type,r=e.changedTouches?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.b=t,t=e.relatedTarget){if(Ge){e:{try{je(t.nodeName);var o=!0;break e}catch(e){}o=!1}o||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,null===r?(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0):(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType=i(e.pointerType)?e.pointerType:at[e.pointerType]||"",this.a=e,e.defaultPrevented&&this.preventDefault()}}ot.prototype.preventDefault=function(){this.Kb=!1},y(st,ot);var at=tt({2:"touch",3:"pen",4:"mouse"});st.prototype.preventDefault=function(){st.ob.preventDefault.call(this);var e=this.a;if(e.preventDefault)e.preventDefault();else if(e.returnValue=!1,it)try{(e.ctrlKey||112<=e.keyCode&&123>=e.keyCode)&&(e.keyCode=-1)}catch(e){}},st.prototype.f=function(){return this.a};var lt="closure_listenable_"+(1e6*Math.random()|0),ut=0;function ct(e){e.oa=!0,e.listener=null,e.proxy=null,e.src=null,e.La=null}function ht(e){this.src=e,this.a={},this.b=0}function dt(e,t){var n=t.type;n in e.a&&M(e.a[n],t)&&(ct(t),0==e.a[n].length&&(delete e.a[n],e.b--))}function pt(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r];if(!o.oa&&o.listener==t&&o.capture==!!n&&o.La==i)return r}return-1}ht.prototype.add=function(e,t,n,i,r){var o=e.toString();(e=this.a[o])||(e=this.a[o]=[],this.b++);var s=pt(e,t,i,r);return-1<s?(t=e[s],n||(t.Ia=!1)):((t=new function(e,t,n,i,r){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!i,this.La=r,this.key=++ut,this.oa=this.Ia=!1}(t,this.src,o,!!i,r)).Ia=n,e.push(t)),t};var ft="closure_lm_"+(1e6*Math.random()|0),gt={};function vt(e,t,n,i,r){if(i&&i.once)_t(e,t,n,i,r);else if(l(t))for(var o=0;o<t.length;o++)vt(e,t[o],n,i,r);else n=kt(n),e&&e[lt]?At(e,t,n,h(i)?!!i.capture:!!i,r):mt(e,t,n,!1,i,r)}function mt(e,t,n,i,r,o){if(!t)throw Error("Invalid event type");var s=h(r)?!!r.capture:!!r,a=St(e);if(a||(e[ft]=a=new ht(e)),!(n=a.add(t,n,i,s,o)).proxy)if(i=function(){var e=Et,t=nt?function(n){return e.call(t.src,t.listener,n)}:function(n){if(!(n=e.call(t.src,t.listener,n)))return n};return t}(),n.proxy=i,i.src=e,i.listener=n,e.addEventListener)rt||(r=s),void 0===r&&(r=!1),e.addEventListener(t.toString(),i,r);else if(e.attachEvent)e.attachEvent(wt(t.toString()),i);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(i)}}function _t(e,t,n,i,r){if(l(t))for(var o=0;o<t.length;o++)_t(e,t[o],n,i,r);else n=kt(n),e&&e[lt]?Pt(e,t,n,h(i)?!!i.capture:!!i,r):mt(e,t,n,!0,i,r)}function yt(e,t,n,i,r){if(l(t))for(var o=0;o<t.length;o++)yt(e,t[o],n,i,r);else i=h(i)?!!i.capture:!!i,n=kt(n),e&&e[lt]?(e=e.l,(t=String(t).toString())in e.a&&(-1<(n=pt(o=e.a[t],n,i,r))&&(ct(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete e.a[t],e.b--)))):e&&(e=St(e))&&(t=e.a[t.toString()],e=-1,t&&(e=pt(t,n,i,r)),(n=-1<e?t[e]:null)&&bt(n))}function bt(e){if("number"!=typeof e&&e&&!e.oa){var t=e.src;if(t&&t[lt])dt(t.l,e);else{var n=e.type,i=e.proxy;t.removeEventListener?t.removeEventListener(n,i,e.capture):t.detachEvent?t.detachEvent(wt(n),i):t.addListener&&t.removeListener&&t.removeListener(i),(n=St(t))?(dt(n,e),0==n.b&&(n.src=null,t[ft]=null)):ct(e)}}}function wt(e){return e in gt?gt[e]:gt[e]="on"+e}function Ct(e,t,n,i){var r=!0;if((e=St(e))&&(t=e.a[t.toString()]))for(t=t.concat(),e=0;e<t.length;e++){var o=t[e];o&&o.capture==n&&!o.oa&&(o=Tt(o,i),r=r&&!1!==o)}return r}function Tt(e,t){var n=e.listener,i=e.La||e.src;return e.Ia&&bt(e),n.call(i,t)}function Et(e,t){if(e.oa)return!0;if(!nt){if(!t)e:{t=["window","event"];for(var i=n,r=0;r<t.length;r++)if(null==(i=i[t[r]])){t=null;break e}t=i}if(t=new st(r=t,this),i=!0,!(0>r.keyCode||void 0!=r.returnValue)){e:{var o=!1;if(0==r.keyCode)try{r.keyCode=-1;break e}catch(e){o=!0}(o||void 0==r.returnValue)&&(r.returnValue=!0)}for(r=[],o=t.b;o;o=o.parentNode)r.push(o);for(e=e.type,o=r.length-1;0<=o;o--){t.b=r[o];var s=Ct(r[o],e,!0,t);i=i&&s}for(o=0;o<r.length;o++)t.b=r[o],s=Ct(r[o],e,!1,t),i=i&&s}return i}return Tt(e,new st(t,this))}function St(e){return(e=e[ft])instanceof ht?e:null}var It="__closure_events_fn_"+(1e9*Math.random()>>>0);function kt(e){return c(e)?e:(e[It]||(e[It]=function(t){return e.handleEvent(t)}),e[It])}function xt(){Re.call(this),this.l=new ht(this),this.Rb=this,this.Va=null}function At(e,t,n,i,r){e.l.add(String(t),n,!1,i,r)}function Pt(e,t,n,i,r){e.l.add(String(t),n,!0,i,r)}function Ot(e,t,n,i){if(!(t=e.l.a[String(t)]))return!0;t=t.concat();for(var r=!0,o=0;o<t.length;++o){var s=t[o];if(s&&!s.oa&&s.capture==n){var a=s.listener,l=s.La||s.src;s.Ia&&dt(e.l,s),r=!1!==a.call(l,i)&&r}}return r&&0!=i.Kb}function Nt(e,t,i){if(c(e))i&&(e=v(e,i));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=v(e.handleEvent,e)}return 2147483647<Number(t)?-1:n.setTimeout(e,t||0)}function Lt(e){var t=null;return new fe(function(n,i){-1==(t=Nt(function(){n(void 0)},e))&&i(Error("Failed to schedule timer."))}).s(function(e){throw n.clearTimeout(t),e})}function Dt(e){if(e.S&&"function"==typeof e.S)return e.S();if(i(e))return e.split("");if(u(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}function Rt(e){if(e.U&&"function"==typeof e.U)return e.U();if(!e.S||"function"!=typeof e.S){if(u(e)||i(e)){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}for(var r in t=[],n=0,e)t[n++]=r;return t}}function Mt(e,t){var n=arguments;this.b={},this.a=[],this.c=0;var i=arguments.length;if(1<i){if(i%2)throw Error("Uneven number of arguments");for(var r=0;r<i;r+=2)this.set(n[r],n[r+1])}else if(e)if(e instanceof Mt)for(i=e.U(),r=0;r<i.length;r++)this.set(i[r],e.get(i[r]));else for(r in e)this.set(r,e[r])}function Ft(e){if(e.c!=e.a.length){for(var t=0,n=0;t<e.a.length;){var i=e.a[t];jt(e.b,i)&&(e.a[n++]=i),t++}e.a.length=n}if(e.c!=e.a.length){var r={};for(n=t=0;t<e.a.length;)jt(r,i=e.a[t])||(e.a[n++]=i,r[i]=1),t++;e.a.length=n}}function jt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}y(xt,Re),xt.prototype[lt]=!0,xt.prototype.addEventListener=function(e,t,n,i){vt(this,e,t,n,i)},xt.prototype.removeEventListener=function(e,t,n,i){yt(this,e,t,n,i)},xt.prototype.dispatchEvent=function(e){var t,n=this.Va;if(n)for(t=[];n;n=n.Va)t.push(n);n=this.Rb;var r=e.type||e;if(i(e))e=new ot(e,n);else if(e instanceof ot)e.target=e.target||n;else{var o=e;le(e=new ot(r,n),o)}if(o=!0,t)for(var s=t.length-1;0<=s;s--){var a=e.b=t[s];o=Ot(a,r,!0,e)&&o}if(o=Ot(a=e.b=n,r,!0,e)&&o,o=Ot(a,r,!1,e)&&o,t)for(s=0;s<t.length;s++)o=Ot(a=e.b=t[s],r,!1,e)&&o;return o},xt.prototype.va=function(){if(xt.ob.va.call(this),this.l){var e,t=this.l;for(e in t.a){for(var n=t.a[e],i=0;i<n.length;i++)ct(n[i]);delete t.a[e],t.b--}}this.Va=null},(e=Mt.prototype).S=function(){Ft(this);for(var e=[],t=0;t<this.a.length;t++)e.push(this.b[this.a[t]]);return e},e.U=function(){return Ft(this),this.a.concat()},e.clear=function(){this.b={},this.c=this.a.length=0},e.get=function(e,t){return jt(this.b,e)?this.b[e]:t},e.set=function(e,t){jt(this.b,e)||(this.c++,this.a.push(e)),this.b[e]=t},e.forEach=function(e,t){for(var n=this.U(),i=0;i<n.length;i++){var r=n[i],o=this.get(r);e.call(t,o,r,this)}};var Ut=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Wt(e,t){if(this.b=this.l=this.c="",this.i=null,this.h=this.g="",this.f=!1,e instanceof Wt){this.f=void 0!==t?t:e.f,Bt(this,e.c),this.l=e.l,this.b=e.b,Vt(this,e.i),this.g=e.g,t=e.a;var n=new nn;n.c=t.c,t.a&&(n.a=new Mt(t.a),n.b=t.b),Ht(this,n),this.h=e.h}else e&&(n=String(e).match(Ut))?(this.f=!!t,Bt(this,n[1]||"",!0),this.l=Qt(n[2]||""),this.b=Qt(n[3]||"",!0),Vt(this,n[4]),this.g=Qt(n[5]||"",!0),Ht(this,n[6]||"",!0),this.h=Qt(n[7]||"")):(this.f=!!t,this.a=new nn(null,this.f))}function Bt(e,t,n){e.c=n?Qt(t,!0):t,e.c&&(e.c=e.c.replace(/:$/,""))}function Vt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.i=t}else e.i=null}function Ht(e,t,n){t instanceof nn?(e.a=t,function(e,t){t&&!e.f&&(rn(e),e.c=null,e.a.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(sn(this,t),ln(this,n,e))},e)),e.f=t}(e.a,e.f)):(n||(t=Yt(t,en)),e.a=new nn(t,e.f))}function $t(e,t,n){e.a.set(t,n)}function Gt(e,t){return e.a.get(t)}function Kt(e){return e instanceof Wt?new Wt(e):new Wt(e,void 0)}function qt(e,t){var n=new Wt(null,void 0);return Bt(n,"https"),e&&(n.b=e),t&&(n.g=t),n}function Qt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Yt(e,t,n){return i(e)?(e=encodeURI(e).replace(t,zt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function zt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Wt.prototype.toString=function(){var e=[],t=this.c;t&&e.push(Yt(t,Xt,!0),":");var n=this.b;return(n||"file"==t)&&(e.push("//"),(t=this.l)&&e.push(Yt(t,Xt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.i)&&e.push(":",String(n))),(n=this.g)&&(this.b&&"/"!=n.charAt(0)&&e.push("/"),e.push(Yt(n,"/"==n.charAt(0)?Jt:Zt,!0))),(n=this.a.toString())&&e.push("?",n),(n=this.h)&&e.push("#",Yt(n,tn)),e.join("")};var Xt=/[#\/\?@]/g,Zt=/[#\?:]/g,Jt=/[#\?]/g,en=/[#\?@]/g,tn=/#/g;function nn(e,t){this.b=this.a=null,this.c=e||null,this.f=!!t}function rn(e){e.a||(e.a=new Mt,e.b=0,e.c&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var i=e[n].indexOf("="),r=null;if(0<=i){var o=e[n].substring(0,i);r=e[n].substring(i+1)}else o=e[n];t(o,r?decodeURIComponent(r.replace(/\+/g," ")):"")}}}(e.c,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function on(e){var t=Rt(e);if(void 0===t)throw Error("Keys are undefined");var n=new nn(null,void 0);e=Dt(e);for(var i=0;i<t.length;i++){var r=t[i],o=e[i];l(o)?ln(n,r,o):n.add(r,o)}return n}function sn(e,t){rn(e),t=un(e,t),jt(e.a.b,t)&&(e.c=null,e.b-=e.a.get(t).length,jt((e=e.a).b,t)&&(delete e.b[t],e.c--,e.a.length>2*e.c&&Ft(e)))}function an(e,t){return rn(e),t=un(e,t),jt(e.a.b,t)}function ln(e,t,n){sn(e,t),0<n.length&&(e.c=null,e.a.set(un(e,t),U(n)),e.b+=n.length)}function un(e,t){return t=String(t),e.f&&(t=t.toLowerCase()),t}(e=nn.prototype).add=function(e,t){rn(this),this.c=null,e=un(this,e);var n=this.a.get(e);return n||this.a.set(e,n=[]),n.push(t),this.b+=1,this},e.clear=function(){this.a=this.c=null,this.b=0},e.forEach=function(e,t){rn(this),this.a.forEach(function(n,i){N(n,function(n){e.call(t,n,i,this)},this)},this)},e.U=function(){rn(this);for(var e=this.a.S(),t=this.a.U(),n=[],i=0;i<t.length;i++)for(var r=e[i],o=0;o<r.length;o++)n.push(t[i]);return n},e.S=function(e){rn(this);var t=[];if(i(e))an(this,e)&&(t=j(t,this.a.get(un(this,e))));else{e=this.a.S();for(var n=0;n<e.length;n++)t=j(t,e[n])}return t},e.set=function(e,t){return rn(this),this.c=null,an(this,e=un(this,e))&&(this.b-=this.a.get(e).length),this.a.set(e,[t]),this.b+=1,this},e.get=function(e,t){return 0<(e=e?this.S(e):[]).length?String(e[0]):t},e.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var e=[],t=this.a.U(),n=0;n<t.length;n++){var i=t[n],r=encodeURIComponent(String(i));i=this.S(i);for(var o=0;o<i.length;o++){var s=r;""!==i[o]&&(s+="="+encodeURIComponent(String(i[o]))),e.push(s)}}return this.c=e.join("&")};var cn=!Ve||9<=Number(Xe);function hn(){this.a="",this.b=pn}function dn(e){return e instanceof hn&&e.constructor===hn&&e.b===pn?e.a:(E("expected object of type Const, got '"+e+"'"),"type_error:Const")}hn.prototype.na=!0,hn.prototype.ma=function(){return this.a},hn.prototype.toString=function(){return"Const{"+this.a+"}"};var pn={};function fn(e){var t=new hn;return t.a=e,t}function gn(){this.a="",this.b=bn}function vn(e){return e instanceof gn&&e.constructor===gn&&e.b===bn?e.a:(E("expected object of type TrustedResourceUrl, got '"+e+"' of type "+s(e)),"type_error:TrustedResourceUrl")}function mn(e,t){var n=dn(e);if(!yn.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return function(e){var t=new gn;return t.a=e,t}(e=n.replace(_n,function(e,i){if(!Object.prototype.hasOwnProperty.call(t,i))throw Error('Found marker, "'+i+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[i])instanceof hn?dn(e):encodeURIComponent(String(e))}))}fn(""),gn.prototype.na=!0,gn.prototype.ma=function(){return this.a},gn.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var _n=/%{(\w+)}/g,yn=/^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i,bn={};function wn(){this.a="",this.b=Sn}function Cn(e){return e instanceof wn&&e.constructor===wn&&e.b===Sn?e.a:(E("expected object of type SafeUrl, got '"+e+"' of type "+s(e)),"type_error:SafeUrl")}wn.prototype.na=!0,wn.prototype.ma=function(){return this.a},wn.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Tn=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function En(e){return e instanceof wn?e:(e=e.na?e.ma():String(e),Tn.test(e)||(e="about:invalid#zClosurez"),In(e))}var Sn={};function In(e){var t=new wn;return t.a=e,t}function kn(){this.a="",this.b=xn}In("about:blank"),kn.prototype.na=!0,kn.prototype.ma=function(){return this.a},kn.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var xn={};function An(e){var t=new kn;return t.a=e,t}function Pn(e){var t=document;return i(e)?t.getElementById(e):e}function On(e,t){ne(t,function(t,n){t&&t.na&&(t=t.ma()),"style"==n?e.style.cssText=t:"class"==n?e.className=t:"for"==n?e.htmlFor=t:Nn.hasOwnProperty(n)?e.setAttribute(Nn[n],t):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?e.setAttribute(n,t):e[n]=t})}An("<!DOCTYPE html>"),An(""),An("<br>");var Nn={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function Ln(e,t,n){var r=arguments,o=document,s=String(r[0]),a=r[1];if(!cn&&a&&(a.name||a.type)){if(s=["<",s],a.name&&s.push(' name="',V(a.name),'"'),a.type){s.push(' type="',V(a.type),'"');var c={};le(c,a),delete c.type,a=c}s.push(">"),s=s.join("")}return s=o.createElement(s),a&&(i(a)?s.className=a:l(a)?s.className=a.join(" "):On(s,a)),2<r.length&&function(e,t,n){function r(n){n&&t.appendChild(i(n)?e.createTextNode(n):n)}for(var o=2;o<n.length;o++){var s=n[o];!u(s)||h(s)&&0<s.nodeType?r(s):N(Dn(s)?U(s):s,r)}}(o,s,r),s}function Dn(e){if(e&&"number"==typeof e.length){if(h(e))return"function"==typeof e.item||"string"==typeof e.item;if(c(e))return"function"==typeof e.item}return!1}function Rn(e){var t=[];return function e(t,n,i){if(null==n)i.push("null");else{if("object"==typeof n){if(l(n)){var r=n;n=r.length,i.push("[");for(var o="",s=0;s<n;s++)i.push(o),e(t,r[s],i),o=",";return void i.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(r in i.push("{"),o="",n)Object.prototype.hasOwnProperty.call(n,r)&&("function"!=typeof(s=n[r])&&(i.push(o),jn(r,i),i.push(":"),e(t,s,i),o=","));return void i.push("}")}n=n.valueOf()}switch(typeof n){case"string":jn(n,i);break;case"number":i.push(isFinite(n)&&!isNaN(n)?String(n):"null");break;case"boolean":i.push(String(n));break;case"function":i.push("null");break;default:throw Error("Unknown type: "+typeof n)}}}(new function(){},e,t),t.join("")}var Mn={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},Fn=/\uffff/.test("")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function jn(e,t){t.push('"',e.replace(Fn,function(e){var t=Mn[e];return t||(t="\\u"+(65536|e.charCodeAt(0)).toString(16).substr(1),Mn[e]=t),t}),'"')}function Un(){var e=ri();return Ve&&!!Xe&&11==Xe||/Edge\/\d+/.test(e)}function Wn(){return n.window&&n.window.location.href||self&&self.location&&self.location.href||""}function Bn(e,t){t=t||n.window;var i="about:blank";e&&(i=Cn(En(e))),t.location.href=i}function Vn(e){return!!((e=(e||ri()).toLowerCase()).match(/android/)||e.match(/webos/)||e.match(/iphone|ipad|ipod/)||e.match(/blackberry/)||e.match(/windows phone/)||e.match(/iemobile/))}function Hn(e){e=e||n.window;try{e.close()}catch(e){}}function $n(e,t,n){var i=Math.floor(1e9*Math.random()).toString();t=t||500,n=n||600;var r=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-t)/2;for(a in t={width:t,height:n,top:0<r?r:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=ri().toLowerCase(),i&&(t.target=i,X(n,"crios/")&&(t.target="_blank")),ti(ri())==Jn&&(e=e||"http://localhost",t.scrollbars=!0),n=e||"",(e=t)||(e={}),i=window,t=n instanceof wn?n:En(void 0!==n.href?n.href:String(n)),n=e.target||n.target,r=[],e)switch(a){case"width":case"height":case"top":case"left":r.push(a+"="+e[a]);break;case"target":case"noopener":case"noreferrer":break;default:r.push(a+"="+(e[a]?1:0))}var a=r.join(",");if((te("iPhone")&&!te("iPod")&&!te("iPad")||te("iPad")||te("iPod"))&&i.navigator&&i.navigator.standalone&&n&&"_self"!=n?(a=i.document.createElement("A"),t instanceof wn||t instanceof wn||(t=t.na?t.ma():String(t),Tn.test(t)||(t="about:invalid#zClosurez"),t=In(t)),a.href=Cn(t),a.setAttribute("target",n),e.noreferrer&&a.setAttribute("rel","noreferrer"),(e=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,i,1),a.dispatchEvent(e),a={}):e.noreferrer?(a=i.open("",n,a),e=Cn(t),a&&($e&&X(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),a.opener=null,fn("b/12014412, meta tag with sanitized URL"),e=An(e='<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+V(e)+'">'),a.document.write(function(e){return e instanceof kn&&e.constructor===kn&&e.b===xn?e.a:(E("expected object of type SafeHtml, got '"+e+"' of type "+s(e)),"type_error:SafeHtml")}(e)),a.document.close())):(a=i.open(Cn(t),n,a))&&e.noopener&&(a.opener=null),a)try{a.focus()}catch(e){}return a}var Gn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Kn=/^[^@]+@[^@]+$/;function qn(){var e=null;return new fe(function(t){"complete"==n.document.readyState?t():(e=function(){t()},_t(window,"load",e))}).s(function(t){throw yt(window,"load",e),t})}function Qn(e){return e=e||ri(),!("file:"!==ui()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function Yn(){var e=n.window;try{return!(!e||e==e.top)}catch(e){return!1}}function zn(){return"object"!=typeof n.window&&"function"==typeof n.importScripts}function Xn(){return qa.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":qa.INTERNAL.hasOwnProperty("node")?"Node":zn()?"Worker":"Browser"}function Zn(){var e=Xn();return"ReactNative"===e||"Node"===e}var Jn="Firefox",ei="Chrome";function ti(e){var t=e.toLowerCase();return X(t,"opera/")||X(t,"opr/")||X(t,"opios/")?"Opera":X(t,"iemobile")?"IEMobile":X(t,"msie")||X(t,"trident/")?"IE":X(t,"edge/")?"Edge":X(t,"firefox/")?Jn:X(t,"silk/")?"Silk":X(t,"blackberry")?"Blackberry":X(t,"webos")?"Webos":!X(t,"safari/")||X(t,"chrome/")||X(t,"crios/")||X(t,"android")?!X(t,"chrome/")&&!X(t,"crios/")||X(t,"edge/")?X(t,"android")?"Android":(e=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==e.length?e[1]:"Other":ei:"Safari"}var ni={Uc:"FirebaseCore-web",Wc:"FirebaseUI-web"};function ii(e,t){t=t||[];var n,i=[],r={};for(n in ni)r[ni[n]]=!0;for(n=0;n<t.length;n++)void 0!==r[t[n]]&&(delete r[t[n]],i.push(t[n]));return i.sort(),(t=i).length||(t=["FirebaseCore-web"]),"Browser"===(i=Xn())?i=ti(r=ri()):"Worker"===i&&(i=ti(r=ri())+"-"+i),i+"/JsCore/"+e+"/"+t.join(",")}function ri(){return n.navigator&&n.navigator.userAgent||""}function oi(e,t){e=e.split("."),t=t||n;for(var i=0;i<e.length&&"object"==typeof t&&null!=t;i++)t=t[e[i]];return i!=e.length&&(t=void 0),t}function si(){try{var e=n.localStorage,t=fi();if(e)return e.setItem(t,"1"),e.removeItem(t),!Un()||!!n.indexedDB}catch(e){return zn()&&!!n.indexedDB}return!1}function ai(){return(li()||"chrome-extension:"===ui()||Qn())&&!Zn()&&si()&&!zn()}function li(){return"http:"===ui()||"https:"===ui()}function ui(){return n.location&&n.location.protocol||null}function ci(e){return!Vn(e=e||ri())&&ti(e)!=Jn}function hi(e){return void 0===e?null:Rn(e)}function di(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&null!==e[t]&&void 0!==e[t]&&(n[t]=e[t]);return n}function pi(e){if(null!==e)return JSON.parse(e)}function fi(e){return e||Math.floor(1e9*Math.random()).toString()}function gi(e){return"Safari"!=ti(e=e||ri())&&!e.toLowerCase().match(/iphone|ipad|ipod/)}function vi(){var e=n.___jsl;if(e&&e.H)for(var t in e.H)if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=e.H[t].L.concat(),e.CP)for(var i=0;i<e.CP.length;i++)e.CP[i]=null}function mi(e,t){if(e>t)throw Error("Short delay should be less than long delay!");this.a=e,this.c=t,e=ri(),t=Xn(),this.b=Vn(e)||"ReactNative"===t}function _i(){var e=n.document;return!e||void 0===e.visibilityState||"visible"==e.visibilityState}function yi(e){try{var t=new Date(parseInt(e,10));if(!isNaN(t.getTime())&&!/[^0-9]/.test(e))return t.toUTCString()}catch(e){}return null}function bi(){return!(!oi("fireauth.oauthhelper",n)&&!oi("fireauth.iframe",n))}mi.prototype.get=function(){var e=n.navigator;return!e||"boolean"!=typeof e.onLine||!li()&&"chrome-extension:"!==ui()&&void 0===e.connection||e.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var wi,Ci={};function Ti(e){Ci[e]||(Ci[e]=!0,"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(e))}try{var Ei={};Object.defineProperty(Ei,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Ei,"abcd",{configurable:!0,enumerable:!0,value:2}),wi=2==Ei.abcd}catch(We){wi=!1}function Si(e,t,n){wi?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n}):e[t]=n}function Ii(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&Si(e,n,t[n])}function ki(e){var t={};return Ii(t,e),t}function xi(e){var t=e;if("object"==typeof e&&null!=e)for(var n in t="length"in e?[]:{},e)Si(t,n,xi(e[n]));return t}var Ai="EMAIL_SIGNIN",Pi="email",Oi="newEmail",Ni="requestType",Li="email",Di="fromEmail",Ri="data",Mi="operation";function Fi(e,t){this.code=Ui+e,this.message=t||Wi[e]||""}function ji(e){var t=e&&e.code;return t?new Fi(t.substring(Ui.length),e.message):null}y(Fi,Error),Fi.prototype.C=function(){return{code:this.code,message:this.message}},Fi.prototype.toJSON=function(){return this.C()};var Ui="auth/",Wi={"argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The OIDC ID token requires a valid unhashed nonce.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","user-cancelled":"User did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."};function Bi(e){var t=e[Ki];if(void 0===t)throw new Fi("missing-continue-uri");if("string"!=typeof t||"string"==typeof t&&!t.length)throw new Fi("invalid-continue-uri");this.h=t,this.b=this.a=null,this.g=!1;var n=e[Vi];if(n&&"object"==typeof n){t=n[Yi];var i=n[qi];if(n=n[Qi],"string"==typeof t&&t.length){if(this.a=t,void 0!==i&&"boolean"!=typeof i)throw new Fi("argument-error",qi+" property must be a boolean when specified.");if(this.g=!!i,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new Fi("argument-error",Qi+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==t)throw new Fi("argument-error",Yi+" property must be a non empty string when specified.");if(void 0!==i||void 0!==n)throw new Fi("missing-android-pkg-name")}}else if(void 0!==n)throw new Fi("argument-error",Vi+" property must be a non null object when specified.");if(this.f=null,(t=e[Gi])&&"object"==typeof t){if("string"==typeof(t=t[zi])&&t.length)this.f=t;else if(void 0!==t)throw new Fi("argument-error",zi+" property must be a non empty string when specified.")}else if(void 0!==t)throw new Fi("argument-error",Gi+" property must be a non null object when specified.");if(void 0!==(t=e[$i])&&"boolean"!=typeof t)throw new Fi("argument-error",$i+" property must be a boolean when specified.");if(this.c=!!t,void 0!==(e=e[Hi])&&("string"!=typeof e||"string"==typeof e&&!e.length))throw new Fi("argument-error",Hi+" property must be a non empty string when specified.");this.i=e||null}var Vi="android",Hi="dynamicLinkDomain",$i="handleCodeInApp",Gi="iOS",Ki="url",qi="installApp",Qi="minimumVersion",Yi="packageName",zi="bundleId";function Xi(e){var t={};for(var n in t.continueUrl=e.h,t.canHandleCodeInApp=e.c,(t.androidPackageName=e.a)&&(t.androidMinimumVersion=e.b,t.androidInstallApp=e.g),t.iOSBundleId=e.f,t.dynamicLinkDomain=e.i,t)null===t[n]&&delete t[n];return t}var Zi=null,Ji=null;function er(e){var t="";return function(e,t){function n(t){for(;i<e.length;){var n=e.charAt(i++),r=Ji[n];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}!function(){if(!Zi){Zi={},Ji={};for(var e=0;65>e;e++)Zi[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),Ji[Zi[e]]=e,62<=e&&(Ji["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e)]=e)}}();for(var i=0;;){var r=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===r)break;t(r<<2|o>>4),64!=s&&(t(o<<4&240|s>>2),64!=a&&t(s<<6&192|a))}}(e,function(e){t+=String.fromCharCode(e)}),t}function tr(e){this.c=e.sub,this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.b=!!e.is_anonymous||"anonymous"==this.a}function nr(e){return(e=ir(e))&&e.sub&&e.iss&&e.aud&&e.exp?new tr(e):null}function ir(e){if(!e)return null;if(3!=(e=e.split(".")).length)return null;for(var t=(4-(e=e[1]).length%4)%4,n=0;n<t;n++)e+=".";try{return JSON.parse(er(e))}catch(e){}return null}tr.prototype.f=function(){return this.b};var rr,or={$c:{ab:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",ib:"https://securetoken.googleapis.com/v1/token",id:"p"},bd:{ab:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",ib:"https://staging-securetoken.sandbox.googleapis.com/v1/token",id:"s"},cd:{ab:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",ib:"https://test-securetoken.sandbox.googleapis.com/v1/token",id:"t"}};function sr(e){for(var t in or)if(or[t].id===e)return{firebaseEndpoint:(e=or[t]).ab,secureTokenEndpoint:e.ib};return null}rr=sr("__EID__")?"__EID__":void 0;var ar="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),lr=["client_id","response_type","scope","redirect_uri","state"],ur={Vc:{Ma:"locale",Ba:500,Aa:600,Na:"facebook.com",hb:lr},Xc:{Ma:null,Ba:500,Aa:620,Na:"github.com",hb:lr},Yc:{Ma:"hl",Ba:515,Aa:680,Na:"google.com",hb:lr},dd:{Ma:"lang",Ba:485,Aa:705,Na:"twitter.com",hb:ar}};function cr(e){for(var t in ur)if(ur[t].Na==e)return ur[t];return null}function hr(e){var t={};t["facebook.com"]=vr,t["google.com"]=_r,t["github.com"]=mr,t["twitter.com"]=yr;var n=e&&e[pr];try{if(n)return t[n]?new t[n](e):new gr(e);if(void 0!==e[dr])return new fr(e)}catch(e){}return null}var dr="idToken",pr="providerId";function fr(e){var t=e[pr];if(!t&&e[dr]){var n=nr(e[dr]);n&&n.a&&(t=n.a)}if(!t)throw Error("Invalid additional user info!");"anonymous"!=t&&"custom"!=t||(t=null),n=!1,void 0!==e.isNewUser?n=!!e.isNewUser:"identitytoolkit#SignupNewUserResponse"===e.kind&&(n=!0),Si(this,"providerId",t),Si(this,"isNewUser",n)}function gr(e){fr.call(this,e),Si(this,"profile",xi((e=pi(e.rawUserInfo||"{}"))||{}))}function vr(e){if(gr.call(this,e),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function mr(e){if(gr.call(this,e),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Si(this,"username",this.profile&&this.profile.login||null)}function _r(e){if(gr.call(this,e),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function yr(e){if(gr.call(this,e),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Si(this,"username",e.screenName||null)}function br(e){var t=Kt(e),n=Gt(t,"link"),i=Gt(Kt(n),"link");return Gt(Kt(t=Gt(t,"deep_link_id")),"link")||t||i||n||e}function wr(e,t){return e.then(function(e){if(e[is]){var n=nr(e[is]);if(!n||t!=n.c)throw new Fi("user-mismatch");return e}throw new Fi("user-mismatch")}).s(function(e){throw e&&e.code&&e.code==Ui+"user-not-found"?new Fi("user-mismatch"):e})}function Cr(e,t){if(!t)throw new Fi("internal-error","failed to construct a credential");this.a=t,Si(this,"providerId",e),Si(this,"signInMethod",e)}function Tr(e){return{pendingToken:e.a,requestUri:"http://localhost"}}function Er(e,t,n){if(this.a=null,t.idToken||t.accessToken)t.idToken&&Si(this,"idToken",t.idToken),t.accessToken&&Si(this,"accessToken",t.accessToken),t.nonce&&!t.pendingToken&&Si(this,"nonce",t.nonce),t.pendingToken&&(this.a=t.pendingToken);else{if(!t.oauthToken||!t.oauthTokenSecret)throw new Fi("internal-error","failed to construct a credential");Si(this,"accessToken",t.oauthToken),Si(this,"secret",t.oauthTokenSecret)}Si(this,"providerId",e),Si(this,"signInMethod",n)}function Sr(e){var t={};return e.idToken&&(t.id_token=e.idToken),e.accessToken&&(t.access_token=e.accessToken),e.secret&&(t.oauth_token_secret=e.secret),t.providerId=e.providerId,e.nonce&&!e.a&&(t.nonce=e.nonce),t={postBody:on(t).toString(),requestUri:"http://localhost"},e.a&&(delete t.postBody,t.pendingToken=e.a),t}function Ir(e,t){this.Dc=t||[],Ii(this,{providerId:e,isOAuthProvider:!0}),this.yb={},this.cb=(cr(e)||{}).Ma||null,this.$a=null}function kr(e){if("string"!=typeof e||0!=e.indexOf("saml."))throw new Fi("argument-error",'SAML provider IDs must be prefixed with "saml."');Ir.call(this,e,[])}function xr(e){Ir.call(this,e,lr),this.a=[]}function Ar(){xr.call(this,"facebook.com")}function Pr(e){if(!e)throw new Fi("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return h(e)&&(t=e.accessToken),(new Ar).credential(null,t)}function Or(){xr.call(this,"github.com")}function Nr(e){if(!e)throw new Fi("argument-error","credential failed: expected 1 argument (the OAuth access token).");var t=e;return h(e)&&(t=e.accessToken),(new Or).credential(null,t)}function Lr(){xr.call(this,"google.com"),this.ua("profile")}function Dr(e,t){var n=e;return h(e)&&(n=e.idToken,t=e.accessToken),(new Lr).credential(n,t)}function Rr(){Ir.call(this,"twitter.com",ar)}function Mr(e,t){var n=e;if(h(n)||(n={oauthToken:e,oauthTokenSecret:t}),!n.oauthToken||!n.oauthTokenSecret)throw new Fi("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Er("twitter.com",n,"twitter.com")}function Fr(e,t,n){this.a=e,this.c=t,Si(this,"providerId","password"),Si(this,"signInMethod",n===jr.EMAIL_LINK_SIGN_IN_METHOD?jr.EMAIL_LINK_SIGN_IN_METHOD:jr.EMAIL_PASSWORD_SIGN_IN_METHOD)}function jr(){Ii(this,{providerId:"password",isOAuthProvider:!1})}function Ur(e,t){if(!(t=Wr(t)))throw new Fi("argument-error","Invalid email link!");return new Fr(e,t,jr.EMAIL_LINK_SIGN_IN_METHOD)}function Wr(e){var t=Gt((e=new function(e){this.a=Kt(e)}(e=br(e))).a,"oobCode")||null;return"signIn"===(Gt(e.a,"mode")||null)&&t?t:null}function Br(e){if(!(e.Ta&&e.Sa||e.Fa&&e.$))throw new Fi("internal-error");this.a=e,Si(this,"providerId","phone"),Si(this,"signInMethod","phone")}function Vr(e){return e.a.Fa&&e.a.$?{temporaryProof:e.a.Fa,phoneNumber:e.a.$}:{sessionInfo:e.a.Ta,code:e.a.Sa}}function Hr(e){try{this.a=e||qa.auth()}catch(e){throw new Fi("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}Ii(this,{providerId:"phone",isOAuthProvider:!1})}function $r(e,t){if(!e)throw new Fi("missing-verification-id");if(!t)throw new Fi("missing-verification-code");return new Br({Ta:e,Sa:t})}function Gr(e){if(e.temporaryProof&&e.phoneNumber)return new Br({Fa:e.temporaryProof,$:e.phoneNumber});var t=e&&e.providerId;if(!t||"password"===t)return null;var n=e&&e.oauthAccessToken,i=e&&e.oauthTokenSecret,r=e&&e.nonce,o=e&&e.oauthIdToken,s=e&&e.pendingToken;try{switch(t){case"google.com":return Dr(o,n);case"facebook.com":return Pr(n);case"github.com":return Nr(n);case"twitter.com":return Mr(n,i);default:return n||i||o||s?s?0==t.indexOf("saml.")?new Cr(t,s):new Er(t,{pendingToken:s,idToken:e.oauthIdToken,accessToken:e.oauthAccessToken},t):new xr(t).credential(o,n,r):null}}catch(e){return null}}function Kr(e){if(!e.isOAuthProvider)throw new Fi("invalid-oauth-provider")}function qr(e,t,n,i,r,o){if(this.b=e,this.c=t||null,this.f=n||null,this.g=i||null,this.h=o||null,this.a=r||null,!this.f&&!this.a)throw new Fi("invalid-auth-event");if(this.f&&this.a)throw new Fi("invalid-auth-event");if(this.f&&!this.g)throw new Fi("invalid-auth-event")}function Qr(e){return(e=e||{}).type?new qr(e.type,e.eventId,e.urlResponse,e.sessionId,e.error&&ji(e.error),e.postBody):null}function Yr(){this.b=null,this.a=[]}y(gr,fr),y(vr,gr),y(mr,gr),y(_r,gr),y(yr,gr),Cr.prototype.la=function(e){return ws(e,Tr(this))},Cr.prototype.b=function(e,t){var n=Tr(this);return n.idToken=t,Cs(e,n)},Cr.prototype.f=function(e,t){return wr(Ts(e,Tr(this)),t)},Cr.prototype.C=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},Er.prototype.la=function(e){return ws(e,Sr(this))},Er.prototype.b=function(e,t){var n=Sr(this);return n.idToken=t,Cs(e,n)},Er.prototype.f=function(e,t){return wr(Ts(e,Sr(this)),t)},Er.prototype.C=function(){var e={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(e.oauthIdToken=this.idToken),this.accessToken&&(e.oauthAccessToken=this.accessToken),this.secret&&(e.oauthTokenSecret=this.secret),this.nonce&&(e.nonce=this.nonce),this.a&&(e.pendingToken=this.a),e},Ir.prototype.Da=function(e){return this.yb=re(e),this},y(kr,Ir),y(xr,Ir),xr.prototype.ua=function(e){return R(this.a,e)||this.a.push(e),this},xr.prototype.Eb=function(){return U(this.a)},xr.prototype.credential=function(e,t,n){if(!e&&!t)throw new Fi("argument-error","credential failed: must provide the ID token and/or the access token.");return new Er(this.providerId,{idToken:e||null,accessToken:t||null,nonce:n||null},this.providerId)},y(Ar,xr),Si(Ar,"PROVIDER_ID","facebook.com"),Si(Ar,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),y(Or,xr),Si(Or,"PROVIDER_ID","github.com"),Si(Or,"GITHUB_SIGN_IN_METHOD","github.com"),y(Lr,xr),Si(Lr,"PROVIDER_ID","google.com"),Si(Lr,"GOOGLE_SIGN_IN_METHOD","google.com"),y(Rr,Ir),Si(Rr,"PROVIDER_ID","twitter.com"),Si(Rr,"TWITTER_SIGN_IN_METHOD","twitter.com"),Fr.prototype.la=function(e){return this.signInMethod==jr.EMAIL_LINK_SIGN_IN_METHOD?Zs(e,Os,{email:this.a,oobCode:this.c}):Zs(e,Qs,{email:this.a,password:this.c})},Fr.prototype.b=function(e,t){return this.signInMethod==jr.EMAIL_LINK_SIGN_IN_METHOD?Zs(e,Ns,{idToken:t,email:this.a,oobCode:this.c}):Zs(e,Vs,{idToken:t,email:this.a,password:this.c})},Fr.prototype.f=function(e,t){return wr(this.la(e),t)},Fr.prototype.C=function(){return{email:this.a,password:this.c,signInMethod:this.signInMethod}},Ii(jr,{PROVIDER_ID:"password"}),Ii(jr,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Ii(jr,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Br.prototype.la=function(e){return e.Ua(Vr(this))},Br.prototype.b=function(e,t){var n=Vr(this);return n.idToken=t,Zs(e,zs,n)},Br.prototype.f=function(e,t){var n=Vr(this);return n.operation="REAUTH",wr(e=Zs(e,Xs,n),t)},Br.prototype.C=function(){var e={providerId:"phone"};return this.a.Ta&&(e.verificationId=this.a.Ta),this.a.Sa&&(e.verificationCode=this.a.Sa),this.a.Fa&&(e.temporaryProof=this.a.Fa),this.a.$&&(e.phoneNumber=this.a.$),e},Hr.prototype.Ua=function(e,t){var n=this.a.b;return we(t.verify()).then(function(r){if(!i(r))throw new Fi("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(t.type){case"recaptcha":return function(e,t){return Zs(e,Ws,t)}(n,{phoneNumber:e,recaptchaToken:r}).then(function(e){return"function"==typeof t.reset&&t.reset(),e},function(e){throw"function"==typeof t.reset&&t.reset(),e});default:throw new Fi("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}})},Ii(Hr,{PROVIDER_ID:"phone"}),Ii(Hr,{PHONE_SIGN_IN_METHOD:"phone"}),qr.prototype.C=function(){return{type:this.b,eventId:this.c,urlResponse:this.f,sessionId:this.g,postBody:this.h,error:this.a&&this.a.C()}};var zr,Xr=null;function Zr(e){var t="unauthorized-domain",n=void 0,i=Kt(e);e=i.b,"chrome-extension"==(i=i.c)?n=W("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):"http"==i||"https"==i?n=W("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",e):t="operation-not-supported-in-this-environment",Fi.call(this,t,n)}function Jr(e,t,n){Fi.call(this,e,n),(e=t||{}).zb&&Si(this,"email",e.zb),e.$&&Si(this,"phoneNumber",e.$),e.credential&&Si(this,"credential",e.credential)}function eo(e){if(e.code){var t=e.code||"";0==t.indexOf(Ui)&&(t=t.substring(Ui.length));var n={credential:Gr(e)};if(e.email)n.zb=e.email;else if(e.phoneNumber)n.$=e.phoneNumber;else if(!n.credential)return new Fi(t,e.message||void 0);return new Jr(t,n,e.message)}return null}function to(){}function no(e){return e.c||(e.c=e.b())}function io(){}function ro(e){if(!e.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var t=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<t.length;n++){var i=t[n];try{return new ActiveXObject(i),e.f=i}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return e.f}function oo(){}function so(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseText="",this.status=-1,this.statusText="",this.a.onload=v(this.ec,this),this.a.onerror=v(this.Fb,this),this.a.onprogress=v(this.fc,this),this.a.ontimeout=v(this.ic,this)}function ao(e,t){e.readyState=t,e.onreadystatechange&&e.onreadystatechange()}function lo(e,t,n){this.reset(e,t,n,void 0,void 0)}function uo(e){this.f=e,this.b=this.c=this.a=null}function co(e,t){this.name=e,this.value=t}Yr.prototype.subscribe=function(e){var t=this;this.a.push(e),this.b||(this.b=function(e){for(var n=0;n<t.a.length;n++)t.a[n](e)},"function"==typeof(e=oi("universalLinks.subscribe",n))&&e(null,this.b))},Yr.prototype.unsubscribe=function(e){F(this.a,function(t){return t==e})},y(Zr,Fi),y(Jr,Fi),Jr.prototype.C=function(){var e={code:this.code,message:this.message};this.email&&(e.email=this.email),this.phoneNumber&&(e.phoneNumber=this.phoneNumber);var t=this.credential&&this.credential.C();return t&&le(e,t),e},Jr.prototype.toJSON=function(){return this.C()},to.prototype.c=null,y(io,to),io.prototype.a=function(){var e=ro(this);return e?new ActiveXObject(e):new XMLHttpRequest},io.prototype.b=function(){var e={};return ro(this)&&(e[0]=!0,e[1]=!0),e},zr=new io,y(oo,to),oo.prototype.a=function(){var e=new XMLHttpRequest;if("withCredentials"in e)return e;if("undefined"!=typeof XDomainRequest)return new so;throw Error("Unsupported browser")},oo.prototype.b=function(){return{}},(e=so.prototype).open=function(e,t,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(e,t)},e.send=function(e){if(e){if("string"!=typeof e)throw Error("Only string data is supported");this.a.send(e)}else this.a.send()},e.abort=function(){this.a.abort()},e.setRequestHeader=function(){},e.getResponseHeader=function(e){return"content-type"==e.toLowerCase()?this.a.contentType:""},e.ec=function(){this.status=200,this.responseText=this.a.responseText,ao(this,4)},e.Fb=function(){this.status=500,this.responseText="",ao(this,4)},e.ic=function(){this.Fb()},e.fc=function(){this.status=200,ao(this,1)},e.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},lo.prototype.a=null,lo.prototype.reset=function(e,t,n,i,r){delete this.a},co.prototype.toString=function(){return this.name};var ho=new co("SEVERE",1e3),po=new co("WARNING",900),fo=new co("CONFIG",700),go=new co("FINE",500);uo.prototype.log=function(e,t,n){if(e.value>=function e(t){return t.c?t.c:t.a?e(t.a):(E("Root logger has no level set."),null)}(this).value)for(c(t)&&(t=t()),e=new lo(e,String(t),this.f),n&&(e.a=n),n=this;n;)n=n.a};var vo={},mo=null;function _o(e){var t;if(mo||(mo=new uo(""),vo[""]=mo,mo.c=fo),!(t=vo[e])){t=new uo(e);var n=e.lastIndexOf("."),i=e.substr(n+1);(n=_o(e.substr(0,n))).b||(n.b={}),n.b[i]=t,t.a=n,vo[e]=t}return t}function yo(e,t){e&&e.log(go,t,void 0)}function bo(e){this.f=e}function wo(e){xt.call(this),this.i=e,this.readyState=Co,this.status=0,this.responseText=this.statusText="",this.onreadystatechange=null,this.g=new Headers,this.b=null,this.h="GET",this.c="",this.a=!1,this.f=_o("goog.net.FetchXmlHttp")}y(bo,to),bo.prototype.a=function(){return new wo(this.f)},bo.prototype.b=function(e){return function(){return e}}({}),y(wo,xt);var Co=0;function To(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Eo(e){xt.call(this),this.headers=new Mt,this.D=e||null,this.c=!1,this.w=this.a=null,this.h=this.N=this.m="",this.f=this.I=this.i=this.G=!1,this.g=0,this.u=null,this.o=So,this.v=this.O=!1}(e=wo.prototype).open=function(e,t){if(this.readyState!=Co)throw this.abort(),Error("Error reopening a connection");this.h=e,this.c=t,this.readyState=1,To(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var t={headers:this.g,method:this.h,credentials:void 0,cache:void 0};e&&(t.body=e),this.i.fetch(new Request(this.c,t)).then(this.hc.bind(this),this.Gb.bind(this))},e.abort=function(){this.responseText="",this.g=new Headers,this.status=0,1<=this.readyState&&this.a&&4!=this.readyState&&(this.readyState=4,this.a=!1,To(this)),this.readyState=Co},e.hc=function(e){this.a&&(this.b||(this.b=e.headers,this.readyState=2,To(this)),this.a&&(this.readyState=3,To(this),this.a&&e.text().then(this.gc.bind(this,e),this.Gb.bind(this))))},e.gc=function(e,t){this.a&&(this.status=e.status,this.statusText=e.statusText,this.responseText=t,this.readyState=4,To(this))},e.Gb=function(e){var t=this.f;t&&t.log(po,"Failed to fetch url "+this.c,e instanceof Error?e:Error(e)),this.a&&(this.readyState=4,To(this))},e.setRequestHeader=function(e,t){this.g.append(e,t)},e.getResponseHeader=function(e){return this.b?this.b.get(e.toLowerCase())||"":((e=this.f)&&e.log(po,"Attempting to get response header but no headers have been received for url: "+this.c,void 0),"")},e.getAllResponseHeaders=function(){if(!this.b){var e=this.f;return e&&e.log(po,"Attempting to get all response headers but no headers have been received for url: "+this.c,void 0),""}e=[];for(var t=this.b.entries(),n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},y(Eo,xt);var So="";Eo.prototype.b=_o("goog.net.XhrIo");var Io=/^https?$/i,ko=["POST","PUT"];function xo(e,t,r,o,s){if(e.a)throw Error("[goog.net.XhrIo] Object is active with another request="+e.m+"; newUri="+t);r=r?r.toUpperCase():"GET",e.m=t,e.h="",e.N=r,e.G=!1,e.c=!0,e.a=e.D?e.D.a():zr.a(),e.w=e.D?no(e.D):no(zr),e.a.onreadystatechange=v(e.Jb,e);try{yo(e.b,Fo(e,"Opening Xhr")),e.I=!0,e.a.open(r,String(t),!0),e.I=!1}catch(t){return yo(e.b,Fo(e,"Error opening Xhr: "+t.message)),void Po(e,t)}t=o||"";var a=new Mt(e.headers);s&&function(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(u(e)||i(e))N(e,t,void 0);else for(var n=Rt(e),r=Dt(e),o=r.length,s=0;s<o;s++)t.call(void 0,r[s],n&&n[s],e)}(s,function(e,t){a.set(t,e)}),s=function(e){e:{for(var t=Ao,n=e.length,r=i(e)?e.split(""):e,o=0;o<n;o++)if(o in r&&t.call(void 0,r[o],o,e)){t=o;break e}t=-1}return 0>t?null:i(e)?e.charAt(t):e[t]}(a.U()),o=n.FormData&&t instanceof n.FormData,!R(ko,r)||s||o||a.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),a.forEach(function(e,t){this.a.setRequestHeader(t,e)},e),e.o&&(e.a.responseType=e.o),"withCredentials"in e.a&&e.a.withCredentials!==e.O&&(e.a.withCredentials=e.O);try{Do(e),0<e.g&&(e.v=function(e){return Ve&&Je(9)&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(e.a),yo(e.b,Fo(e,"Will abort after "+e.g+"ms if incomplete, xhr2 "+e.v)),e.v?(e.a.timeout=e.g,e.a.ontimeout=v(e.Ga,e)):e.u=Nt(e.Ga,e.g,e)),yo(e.b,Fo(e,"Sending request")),e.i=!0,e.a.send(t),e.i=!1}catch(t){yo(e.b,Fo(e,"Send error: "+t.message)),Po(e,t)}}function Ao(e){return"content-type"==e.toLowerCase()}function Po(e,t){e.c=!1,e.a&&(e.f=!0,e.a.abort(),e.f=!1),e.h=t,Oo(e),Lo(e)}function Oo(e){e.G||(e.G=!0,e.dispatchEvent("complete"),e.dispatchEvent("error"))}function No(e){if(e.c&&void 0!==t)if(e.w[1]&&4==Ro(e)&&2==Mo(e))yo(e.b,Fo(e,"Local request error detected and ignored"));else if(e.i&&4==Ro(e))Nt(e.Jb,0,e);else if(e.dispatchEvent("readystatechange"),4==Ro(e)){yo(e.b,Fo(e,"Request complete")),e.c=!1;try{var i,r=Mo(e);e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var o=!0;break e;default:o=!1}if(!(i=o)){var s;if(s=0===r){var a=String(e.m).match(Ut)[1]||null;if(!a&&n.self&&n.self.location){var l=n.self.location.protocol;a=l.substr(0,l.length-1)}s=!Io.test(a?a.toLowerCase():"")}i=s}if(i)e.dispatchEvent("complete"),e.dispatchEvent("success");else{try{var u=2<Ro(e)?e.a.statusText:""}catch(t){yo(e.b,"Can not get status: "+t.message),u=""}e.h=u+" ["+Mo(e)+"]",Oo(e)}}finally{Lo(e)}}}function Lo(e,t){if(e.a){Do(e);var n=e.a,i=e.w[0]?o:null;e.a=null,e.w=null,t||e.dispatchEvent("ready");try{n.onreadystatechange=i}catch(t){(e=e.b)&&e.log(ho,"Problem encountered resetting onreadystatechange: "+t.message,void 0)}}}function Do(e){e.a&&e.v&&(e.a.ontimeout=null),e.u&&(n.clearTimeout(e.u),e.u=null)}function Ro(e){return e.a?e.a.readyState:0}function Mo(e){try{return 2<Ro(e)?e.a.status:-1}catch(e){return-1}}function Fo(e,t){return t+" ["+e.N+" "+e.m+" "+Mo(e)+"]"}function jo(e,t){this.g=[],this.v=e,this.u=t||null,this.f=this.a=!1,this.c=void 0,this.m=this.w=this.i=!1,this.h=0,this.b=null,this.l=0}function Uo(e,t,n){e.a=!0,e.c=n,e.f=!t,Ho(e)}function Wo(e){if(e.a){if(!e.m)throw new $o(e);e.m=!1}}function Bo(e,t,n,i){e.g.push([t,n,i]),e.a&&Ho(e)}function Vo(e){return D(e.g,function(e){return c(e[1])})}function Ho(e){if(e.h&&e.a&&Vo(e)){var t=e.h,i=qo[t];i&&(n.clearTimeout(i.a),delete qo[t]),e.h=0}e.b&&(e.b.l--,delete e.b),t=e.c;for(var r=i=!1;e.g.length&&!e.i;){var o=e.g.shift(),s=o[0],a=o[1];if(o=o[2],s=e.f?a:s)try{var l=s.call(o||e.u,t);void 0!==l&&(e.f=e.f&&(l==t||l instanceof Error),e.c=t=l),(w(t)||"function"==typeof n.Promise&&t instanceof n.Promise)&&(r=!0,e.i=!0)}catch(n){t=n,e.f=!0,Vo(e)||(i=!0)}}e.c=t,r&&(l=v(e.o,e,!0),r=v(e.o,e,!1),t instanceof jo?(Bo(t,l,r),t.w=!0):t.then(l,r)),i&&(t=new Ko(t),qo[t.a]=t,e.h=t.a)}function $o(){C.call(this)}function Go(){C.call(this)}function Ko(e){this.a=n.setTimeout(v(this.c,this),0),this.b=e}(e=Eo.prototype).Ga=function(){void 0!==t&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",yo(this.b,Fo(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},e.abort=function(){this.a&&this.c&&(yo(this.b,Fo(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Lo(this))},e.va=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Lo(this,!0)),Eo.ob.va.call(this)},e.Jb=function(){this.qa||(this.I||this.i||this.f?No(this):this.wc())},e.wc=function(){No(this)},e.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.o){case So:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var e=this.b;return e&&e.log(ho,"Response type "+this.o+" is not supported on this browser",void 0),null}catch(e){return yo(this.b,"Can not get response: "+e.message),null}},jo.prototype.cancel=function(e){if(this.a)this.c instanceof jo&&this.c.cancel();else{if(this.b){var t=this.b;delete this.b,e?t.cancel(e):(t.l--,0>=t.l&&t.cancel())}this.v?this.v.call(this.u,this):this.m=!0,this.a||(e=new Go(this),Wo(this),Uo(this,!1,e))}},jo.prototype.o=function(e,t){this.i=!1,Uo(this,e,t)},jo.prototype.D=function(){Wo(this),Uo(this,!0,null)},jo.prototype.then=function(e,t,n){var i,r,o=new fe(function(e,t){i=e,r=t});return Bo(this,i,function(e){e instanceof Go?o.cancel():r(e)}),o.then(e,t,n)},b(jo),y($o,C),$o.prototype.message="Deferred has already fired",$o.prototype.name="AlreadyCalledError",y(Go,C),Go.prototype.message="Deferred was canceled",Go.prototype.name="CanceledError",Ko.prototype.c=function(){throw delete qo[this.a],this.b};var qo={};function Qo(e){var t,n=document,i=vn(e),r=document.createElement("SCRIPT"),o={Lb:r,Ga:void 0},s=new jo(Yo,o);return t=window.setTimeout(function(){zo(r,!0);var e=new Jo(Zo,"Timeout reached for loading script "+i);Wo(s),Uo(s,!1,e)},5e3),o.Ga=t,r.onload=r.onreadystatechange=function(){r.readyState&&"loaded"!=r.readyState&&"complete"!=r.readyState||(zo(r,!1,t),s.D())},r.onerror=function(){zo(r,!0,t);var e=new Jo(Xo,"Error while loading script "+i);Wo(s),Uo(s,!1,e)},le(o={},{type:"text/javascript",charset:"UTF-8"}),On(r,o),r.src=vn(e),function(e){var t;return(t=(e||document).getElementsByTagName("HEAD"))&&0!=t.length?t[0]:e.documentElement}(n).appendChild(r),s}function Yo(){if(this&&this.Lb){var e=this.Lb;e&&"SCRIPT"==e.tagName&&zo(e,!0,this.Ga)}}function zo(e,t,i){null!=i&&n.clearTimeout(i),e.onload=o,e.onerror=o,e.onreadystatechange=o,t&&window.setTimeout(function(){e&&e.parentNode&&e.parentNode.removeChild(e)},0)}var Xo=0,Zo=1;function Jo(e,t){var n="Jsloader error (code #"+e+")";t&&(n+=": "+t),C.call(this,n),this.code=e}function es(e){this.f=e}function ts(e,t,i){if(this.b=e,e=t||{},this.i=e.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.l=e.secureTokenTimeout||rs,this.f=re(e.secureTokenHeaders||os),this.g=e.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.h=e.firebaseTimeout||ss,this.a=re(e.firebaseHeaders||as),i&&(this.a["X-Client-Version"]=i,this.f["X-Client-Version"]=i),i="Node"==Xn(),!(i=n.XMLHttpRequest||i&&qa.INTERNAL.node&&qa.INTERNAL.node.XMLHttpRequest)&&!zn())throw new Fi("internal-error","The XMLHttpRequest compatibility library was not found.");this.c=void 0,zn()?this.c=new bo(self):Zn()?this.c=new es(i):this.c=new oo}y(Jo,C),y(es,to),es.prototype.a=function(){return new this.f},es.prototype.b=function(){return{}};var ns,is="idToken",rs=new mi(3e4,6e4),os={"Content-Type":"application/x-www-form-urlencoded"},ss=new mi(3e4,6e4),as={"Content-Type":"application/json"};function ls(e,t){t?e.a["X-Firebase-Locale"]=t:delete e.a["X-Firebase-Locale"]}function us(e,t){t?(e.a["X-Client-Version"]=t,e.f["X-Client-Version"]=t):(delete e.a["X-Client-Version"],delete e.f["X-Client-Version"])}function cs(e,t,i,r,o,s,a){(function(){var e=ri();return!((e=ti(e)!=ei?null:(e=e.match(/\sChrome\/(\d+)/i))&&2==e.length?parseInt(e[1],10):null)&&30>e||Ve&&Xe&&!(9<Xe))})()||zn()?e=v(e.o,e):(ns||(ns=new fe(function(e,t){!function(e,t){if(((window.gapi||{}).client||{}).request)e();else{n[ds]=function(){((window.gapi||{}).client||{}).request?e():t(Error("CORS_UNSUPPORTED"))};var i=mn(hs,{onload:ds});!function(e,t){Bo(e,null,t,void 0)}(Qo(i),function(){t(Error("CORS_UNSUPPORTED"))})}}(e,t)})),e=v(e.m,e)),e(t,i,r,o,s,a)}ts.prototype.o=function(e,t,i,r,o,s){if(zn()&&(void 0===n.fetch||void 0===n.Headers||void 0===n.Request))throw new Fi("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support HTTP requests from a Worker environment.");var a=new Eo(this.c);if(s){a.g=Math.max(0,s);var l=setTimeout(function(){a.dispatchEvent("timeout")},s)}At(a,"complete",function(){l&&clearTimeout(l);var e=null;try{e=JSON.parse(function(e){try{return e.a?e.a.responseText:""}catch(t){return yo(e.b,"Can not get responseText: "+t.message),""}}(this))||null}catch(t){e=null}t&&t(e)}),Pt(a,"ready",function(){l&&clearTimeout(l),Fe(this)}),Pt(a,"timeout",function(){l&&clearTimeout(l),Fe(this),t&&t(null)}),xo(a,e,i,r,o)};var hs=fn("https://apis.google.com/js/client.js?onload=%{onload}"),ds="__fcb"+Math.floor(1e6*Math.random()).toString();function ps(e){if(!i(e=e.email)||!Kn.test(e))throw new Fi("invalid-email")}function fs(e){"email"in e&&ps(e)}function gs(e){if(!e[is])throw new Fi("internal-error")}function vs(e){if(e.phoneNumber||e.temporaryProof){if(!e.phoneNumber||!e.temporaryProof)throw new Fi("internal-error")}else{if(!e.sessionInfo)throw new Fi("missing-verification-id");if(!e.code)throw new Fi("missing-verification-code")}}ts.prototype.m=function(e,t,n,i,r){var o=this;ns.then(function(){window.gapi.client.setApiKey(o.b);var s=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:e,method:n,body:i,headers:r,authType:"none",callback:function(e){window.gapi.auth.setToken(s),t&&t(e)}})}).s(function(e){t&&t({error:{message:e&&e.message||"CORS_UNSUPPORTED"}})})},ts.prototype.Qa=function(){return Zs(this,Hs,{})},ts.prototype.pb=function(e,t){return Zs(this,Bs,{idToken:e,email:t})},ts.prototype.qb=function(e,t){return Zs(this,Vs,{idToken:e,password:t})};var ms={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function _s(e){if(!e.requestUri||!e.sessionId&&!e.postBody&&!e.pendingToken)throw new Fi("internal-error")}function ys(e,t){return t.oauthIdToken&&t.providerId&&0==t.providerId.indexOf("oidc.")&&!t.pendingToken&&(e.sessionId?t.nonce=e.sessionId:e.postBody&&(an(e=new nn(e.postBody),"nonce")&&(t.nonce=e.get("nonce")))),t}function bs(e){var t=null;if(e.needConfirmation?(e.code="account-exists-with-different-credential",t=eo(e)):"FEDERATED_USER_ID_ALREADY_LINKED"==e.errorMessage?(e.code="credential-already-in-use",t=eo(e)):"EMAIL_EXISTS"==e.errorMessage?(e.code="email-already-in-use",t=eo(e)):e.errorMessage&&(t=Js(e.errorMessage)),t)throw t;if(!e[is])throw new Fi("internal-error")}function ws(e,t){return t.returnIdpCredential=!0,Zs(e,$s,t)}function Cs(e,t){return t.returnIdpCredential=!0,Zs(e,Ks,t)}function Ts(e,t){return t.returnIdpCredential=!0,t.autoCreate=!1,Zs(e,Gs,t)}function Es(e){if(!e.oobCode)throw new Fi("invalid-action-code")}(e=ts.prototype).rb=function(e,t){var n={idToken:e},i=[];return ne(ms,function(e,r){var o=t[r];null===o?i.push(e):r in t&&(n[r]=o)}),i.length&&(n.deleteAttribute=i),Zs(this,Bs,n)},e.kb=function(e,t){return le(e={requestType:"PASSWORD_RESET",email:e},t),Zs(this,Ms,e)},e.lb=function(e,t){return le(e={requestType:"EMAIL_SIGNIN",email:e},t),Zs(this,Ds,e)},e.jb=function(e,t){return le(e={requestType:"VERIFY_EMAIL",idToken:e},t),Zs(this,Rs,e)},e.Ua=function(e){return Zs(this,Ys,e)},e.Za=function(e,t){return Zs(this,Us,{oobCode:e,newPassword:t})},e.Ja=function(e){return Zs(this,Is,{oobCode:e})},e.Wa=function(e){return Zs(this,Ss,{oobCode:e})};var Ss={endpoint:"setAccountInfo",B:Es,da:"email"},Is={endpoint:"resetPassword",B:Es,J:function(e){var t=e.requestType;if(!t||!e.email&&"EMAIL_SIGNIN"!=t)throw new Fi("internal-error")}},ks={endpoint:"signupNewUser",B:function(e){if(ps(e),!e.password)throw new Fi("weak-password")},J:gs,R:!0},xs={endpoint:"createAuthUri"},As={endpoint:"deleteAccount",T:["idToken"]},Ps={endpoint:"setAccountInfo",T:["idToken","deleteProvider"],B:function(e){if(!l(e.deleteProvider))throw new Fi("internal-error")}},Os={endpoint:"emailLinkSignin",T:["email","oobCode"],B:ps,J:gs,R:!0},Ns={endpoint:"emailLinkSignin",T:["idToken","email","oobCode"],B:ps,J:gs,R:!0},Ls={endpoint:"getAccountInfo"},Ds={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(e){if("EMAIL_SIGNIN"!=e.requestType)throw new Fi("internal-error");ps(e)},da:"email"},Rs={endpoint:"getOobConfirmationCode",T:["idToken","requestType"],B:function(e){if("VERIFY_EMAIL"!=e.requestType)throw new Fi("internal-error")},da:"email"},Ms={endpoint:"getOobConfirmationCode",T:["requestType"],B:function(e){if("PASSWORD_RESET"!=e.requestType)throw new Fi("internal-error");ps(e)},da:"email"},Fs={ub:!0,endpoint:"getProjectConfig",Ib:"GET"},js={ub:!0,endpoint:"getRecaptchaParam",Ib:"GET",J:function(e){if(!e.recaptchaSiteKey)throw new Fi("internal-error")}},Us={endpoint:"resetPassword",B:Es,da:"email"},Ws={endpoint:"sendVerificationCode",T:["phoneNumber","recaptchaToken"],da:"sessionInfo"},Bs={endpoint:"setAccountInfo",T:["idToken"],B:fs,R:!0},Vs={endpoint:"setAccountInfo",T:["idToken"],B:function(e){if(fs(e),!e.password)throw new Fi("weak-password")},J:gs,R:!0},Hs={endpoint:"signupNewUser",J:gs,R:!0},$s={endpoint:"verifyAssertion",B:_s,Oa:ys,J:bs,R:!0},Gs={endpoint:"verifyAssertion",B:_s,Oa:ys,J:function(e){if(e.errorMessage&&"USER_NOT_FOUND"==e.errorMessage)throw new Fi("user-not-found");if(e.errorMessage)throw Js(e.errorMessage);if(!e[is])throw new Fi("internal-error")},R:!0},Ks={endpoint:"verifyAssertion",B:function(e){if(_s(e),!e.idToken)throw new Fi("internal-error")},Oa:ys,J:bs,R:!0},qs={endpoint:"verifyCustomToken",B:function(e){if(!e.token)throw new Fi("invalid-custom-token")},J:gs,R:!0},Qs={endpoint:"verifyPassword",B:function(e){if(ps(e),!e.password)throw new Fi("wrong-password")},J:gs,R:!0},Ys={endpoint:"verifyPhoneNumber",B:vs,J:gs},zs={endpoint:"verifyPhoneNumber",B:function(e){if(!e.idToken)throw new Fi("internal-error");vs(e)},J:function(e){if(e.temporaryProof)throw e.code="credential-already-in-use",eo(e);gs(e)}},Xs={Xb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:vs,J:gs};function Zs(e,t,n){if(!function(e,t){if(!t||!t.length)return!0;if(!e)return!1;for(var n=0;n<t.length;n++){var i=e[t[n]];if(void 0===i||null===i||""===i)return!1}return!0}(n,t.T))return Ce(new Fi("internal-error"));var i,r=t.Ib||"POST";return we(n).then(t.B).then(function(){return t.R&&(n.returnSecureToken=!0),function(e,t,n,i,r,o){var s=Kt(e.g+t);$t(s,"key",e.b),o&&$t(s,"cb",_().toString());var a="GET"==n;if(a)for(var l in i)i.hasOwnProperty(l)&&$t(s,l,i[l]);return new fe(function(t,o){cs(e,s.toString(),function(e){e?e.error?o(ea(e,r||{})):t(e):o(new Fi("network-request-failed"))},n,a?void 0:Rn(di(i)),e.a,e.h.get())})}(e,t.endpoint,r,n,t.Xb,t.ub||!1)}).then(function(e){return i=e,t.Oa?t.Oa(n,i):i}).then(t.J).then(function(){if(!t.da)return i;if(!(t.da in i))throw new Fi("internal-error");return i[t.da]})}function Js(e){return ea({error:{errors:[{message:e}],code:400,message:e}})}function ea(e,t){var n=(e.error&&e.error.errors&&e.error.errors[0]||{}).reason||"",i={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=i[n]?new Fi(i[n]):null)return n;for(var r in n=e.error&&e.error.message||"",le(i={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash"},t||{}),t=(t=n.match(/^[^\s]+\s*:\s*(.*)$/))&&1<t.length?t[1]:void 0,i)if(0===n.indexOf(r))return new Fi(i[r],t);return!t&&e&&(t=hi(e)),new Fi("internal-error",t)}function ta(e){this.b=e,this.a=null,this.fb=function(e){return(oa||(oa=new fe(function(e,t){function i(){vi(),oi("gapi.load")("gapi.iframes",{callback:e,ontimeout:function(){vi(),t(Error("Network Error"))},timeout:ia.get()})}if(oi("gapi.iframes.Iframe"))e();else if(oi("gapi.load"))i();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();n[r]=function(){oi("gapi.load")?i():t(Error("Network Error"))},we(Qo(r=mn(na,{onload:r}))).s(function(){t(Error("Network Error"))})}}).s(function(e){throw oa=null,e}))).then(function(){return new fe(function(t,n){oi("gapi.iframes.getContext")().open({where:document.body,url:e.b,messageHandlersFilter:oi("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},function(i){function r(){clearTimeout(o),t()}e.a=i,e.a.restyle({setHideOnLeave:!1});var o=setTimeout(function(){n(Error("Network Error"))},ra.get());i.ping(r).then(r,function(){n(Error("Network Error"))})})})})}(this)}var na=fn("https://apis.google.com/js/api.js?onload=%{onload}"),ia=new mi(3e4,6e4),ra=new mi(5e3,15e3),oa=null;function sa(e,t,n){this.i=e,this.g=t,this.h=n,this.f=null,this.a=qt(this.i,"/__/auth/iframe"),$t(this.a,"apiKey",this.g),$t(this.a,"appName",this.h),this.b=null,this.c=[]}function aa(e,t,n,i,r){this.o=e,this.m=t,this.c=n,this.l=i,this.h=this.g=this.i=null,this.a=r,this.f=null}function la(e){try{return qa.app(e).auth().ya()}catch(e){return[]}}function ua(e,t,n,i,r){this.m=e,this.f=t,this.b=n,this.c=i||null,this.h=r||null,this.o=this.u=this.v=null,this.g=[],this.l=this.a=null}function ca(e){var t=Wn();return function(e){return Zs(e,Fs,{}).then(function(e){return e.authorizedDomains||[]})}(e).then(function(e){e:{var n=Kt(t),i=n.c;n=n.b;for(var r=0;r<e.length;r++){var o=e[r],s=n,a=i;if(0==o.indexOf("chrome-extension://")?s=Kt(o).b==s&&"chrome-extension"==a:"http"!=a&&"https"!=a?s=!1:Gn.test(o)?s=s==o:(o=o.split(".").join("\\."),s=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(s)),s){e=!0;break e}}e=!1}if(!e)throw new Zr(Wn())})}function ha(e){return e.l?e.l:(e.l=qn().then(function(){if(!e.u){var t=e.c,n=e.h,i=la(e.b),r=new sa(e.m,e.f,e.b);r.f=t,r.b=n,r.c=U(i||[]),e.u=r.toString()}e.i=new ta(e.u),function(e){if(!e.i)throw Error("IfcHandler must be initialized!");!function(e,t){e.fb.then(function(){e.a.register("authEvent",t,oi("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})}(e.i,function(t){var n={};if(t&&t.authEvent){var i=!1;for(t=Qr(t.authEvent),n=0;n<e.g.length;n++)i=e.g[n](t)||i;return(n={}).status=i?"ACK":"ERROR",we(n)}return n.status="ERROR",we(n)})}(e)}),e.l)}function da(e){return e.o||(e.v=e.c?ii(e.c,la(e.b)):null,e.o=new ts(e.f,sr(e.h),e.v)),e.o}function pa(e,t,n,i,r,o,s,a,l,u){return(e=new aa(e,t,n,i,r)).i=o,e.g=s,e.h=a,e.b=re(l||null),e.f=u,e.toString()}function fa(e){if(this.a=e||qa.INTERNAL.reactNative&&qa.INTERNAL.reactNative.AsyncStorage,!this.a)throw new Fi("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function ga(e){this.b=e,this.a={},this.c=v(this.f,this)}sa.prototype.toString=function(){return this.f?$t(this.a,"v",this.f):sn(this.a.a,"v"),this.b?$t(this.a,"eid",this.b):sn(this.a.a,"eid"),this.c.length?$t(this.a,"fw",this.c.join(",")):sn(this.a.a,"fw"),this.a.toString()},aa.prototype.toString=function(){var e=qt(this.o,"/__/auth/handler");if($t(e,"apiKey",this.m),$t(e,"appName",this.c),$t(e,"authType",this.l),this.a.isOAuthProvider){var t=this.a;try{var n=qa.app(this.c).auth().ea()}catch(e){n=null}for(var i in t.$a=n,$t(e,"providerId",this.a.providerId),n=di((t=this.a).yb))n[i]=n[i].toString();i=t.Dc,n=re(n);for(var r=0;r<i.length;r++){var o=i[r];o in n&&delete n[o]}t.cb&&t.$a&&!n[t.cb]&&(n[t.cb]=t.$a),ie(n)||$t(e,"customParameters",hi(n))}if("function"==typeof this.a.Eb&&((t=this.a.Eb()).length&&$t(e,"scopes",t.join(","))),this.i?$t(e,"redirectUrl",this.i):sn(e.a,"redirectUrl"),this.g?$t(e,"eventId",this.g):sn(e.a,"eventId"),this.h?$t(e,"v",this.h):sn(e.a,"v"),this.b)for(var s in this.b)this.b.hasOwnProperty(s)&&!Gt(e,s)&&$t(e,s,this.b[s]);return this.f?$t(e,"eid",this.f):sn(e.a,"eid"),(s=la(this.c)).length&&$t(e,"fw",s.join(",")),e.toString()},(e=ua.prototype).Ea=function(e,t,n){var i=new Fi("popup-closed-by-user"),r=new Fi("web-storage-unsupported"),o=this,s=!1;return this.ga().then(function(){(function(e){var t={type:"webStorageSupport"};return ha(e).then(function(){return function(e,t){return e.fb.then(function(){return new fe(function(n){e.a.send(t.type,t,n,oi("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))})})}(e.i,t)}).then(function(e){if(e&&e.length&&void 0!==e[0].webStorageSupport)return e[0].webStorageSupport;throw Error()})})(o).then(function(n){n||(e&&Hn(e),t(r),s=!0)})}).s(function(){}).then(function(){if(!s)return function(e){return new fe(function(t){return function n(){Lt(2e3).then(function(){if(e&&!e.closed)return n();t()})}()})}(e)}).then(function(){if(!s)return Lt(n).then(function(){t(i)})})},e.Mb=function(){var e=ri();return!ci(e)&&!gi(e)},e.Hb=function(){return!1},e.Cb=function(e,t,n,i,r,o,s){if(!e)return Ce(new Fi("popup-blocked"));if(s&&!ci())return this.ga().s(function(t){Hn(e),r(t)}),i(),we();this.a||(this.a=ca(da(this)));var a=this;return this.a.then(function(){var t=a.ga().s(function(t){throw Hn(e),r(t),t});return i(),t}).then(function(){(Kr(n),s)||Bn(pa(a.m,a.f,a.b,t,n,null,o,a.c,void 0,a.h),e)}).s(function(e){throw"auth/network-request-failed"==e.code&&(a.a=null),e})},e.Ca=function(e,t,n){this.a||(this.a=ca(da(this)));var i=this;return this.a.then(function(){Kr(t),Bn(pa(i.m,i.f,i.b,e,t,Wn(),n,i.c,void 0,i.h))}).s(function(e){throw"auth/network-request-failed"==e.code&&(i.a=null),e})},e.ga=function(){var e=this;return ha(this).then(function(){return e.i.fb}).s(function(){throw e.a=null,new Fi("network-request-failed")})},e.Qb=function(){return!0},e.wa=function(e){this.g.push(e)},e.Ka=function(e){F(this.g,function(t){return t==e})},(e=fa.prototype).get=function(e){return we(this.a.getItem(e)).then(function(e){return e&&pi(e)})},e.set=function(e,t){return we(this.a.setItem(e,hi(t)))},e.P=function(e){return we(this.a.removeItem(e))},e.Y=function(){},e.ca=function(){};var va,ma=[];function _a(e){this.a=e}function ya(e){this.c=e,this.b=!1,this.a=[]}function ba(e,t,n,i){var r,o,s,a,l=n||{},u=null;if(e.b)return Ce(Error("connection_unavailable"));var c=i?800:50,h="undefined"!=typeof MessageChannel?new MessageChannel:null;return new fe(function(n,i){h?(r=Math.floor(Math.random()*Math.pow(10,20)).toString(),h.port1.start(),s=setTimeout(function(){i(Error("unsupported_event"))},c),u={messageChannel:h,onMessage:o=function(e){e.data.eventId===r&&("ack"===e.data.status?(clearTimeout(s),a=setTimeout(function(){i(Error("timeout"))},3e3)):"done"===e.data.status?(clearTimeout(a),void 0!==e.data.response?n(e.data.response):i(Error("unknown_error"))):(clearTimeout(s),clearTimeout(a),i(Error("invalid_response"))))}},e.a.push(u),h.port1.addEventListener("message",o),e.c.postMessage({eventType:t,eventId:r,data:l},[h.port2])):i(Error("connection_unavailable"))}).then(function(t){return wa(e,u),t}).s(function(t){throw wa(e,u),t})}function wa(e,t){if(t){var n=t.messageChannel,i=t.onMessage;n&&(n.port1.removeEventListener("message",i),n.port1.close()),F(e.a,function(e){return e==t})}}function Ca(){if(!Sa())throw new Fi("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=n.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.u=!1,this.h=null;var e=this;zn()&&self?(this.l=function(){var e=zn()?self:null;if(N(ma,function(n){n.b==e&&(t=n)}),!t){var t=new ga(e);ma.push(t)}return t}(),this.l.subscribe("keyChanged",function(t,n){return Pa(e).then(function(t){return 0<t.length&&N(e.a,function(e){e(t)}),{keyProcessed:R(t,n.key)}})}),this.l.subscribe("ping",function(){return we(["keyChanged"])})):function(){var e=n.navigator;return e&&e.serviceWorker?we().then(function(){return e.serviceWorker.ready}).then(function(e){return e.active||null}).s(function(){return null}):we(null)}().then(function(t){(e.h=t)&&(e.g=new ya(new _a(t)),ba(e.g,"ping",null,!0).then(function(t){t[0].fulfilled&&R(t[0].value,"keyChanged")&&(e.u=!0)}).s(function(){}))})}function Ta(e){return new fe(function(t,n){var i=e.m.open("firebaseLocalStorageDb",1);i.onerror=function(e){try{e.preventDefault()}catch(e){}n(Error(e.target.error))},i.onupgradeneeded=function(e){e=e.target.result;try{e.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},i.onsuccess=function(i){(i=i.target.result).objectStoreNames.contains("firebaseLocalStorage")?t(i):function(e){return new fe(function(t,n){var i=e.m.deleteDatabase("firebaseLocalStorageDb");i.onsuccess=function(){t()},i.onerror=function(e){n(Error(e.target.error))}})}(e).then(function(){return Ta(e)}).then(function(e){t(e)}).s(function(e){n(e)})}})}function Ea(e){return e.o||(e.o=Ta(e)),e.o}function Sa(){try{return!!n.indexedDB}catch(e){return!1}}function Ia(e){return e.objectStore("firebaseLocalStorage")}function ka(e,t){return e.transaction(["firebaseLocalStorage"],t?"readwrite":"readonly")}function xa(e){return new fe(function(t,n){e.onsuccess=function(e){e&&e.target?t(e.target.result):t()},e.onerror=function(e){n(e.target.error)}})}function Aa(e,t){return e.g&&e.h&&function(){var e=n.navigator;return e&&e.serviceWorker&&e.serviceWorker.controller||null}()===e.h?ba(e.g,"keyChanged",{key:t},e.u).then(function(){}).s(function(){}):we()}function Pa(e){return Ea(e).then(function(e){var t=Ia(ka(e,!1));return t.getAll?xa(t.getAll()):new fe(function(e,n){var i=[],r=t.openCursor();r.onsuccess=function(t){(t=t.target.result)?(i.push(t.value),t.continue()):e(i)},r.onerror=function(e){n(e.target.error)}})}).then(function(t){var n={},i=[];if(0==e.b){for(i=0;i<t.length;i++)n[t[i].fbase_key]=t[i].value;i=function e(t,n){var i,r=[];for(i in t)i in n?typeof t[i]!=typeof n[i]?r.push(i):"object"==typeof t[i]&&null!=t[i]&&null!=n[i]?0<e(t[i],n[i]).length&&r.push(i):t[i]!==n[i]&&r.push(i):r.push(i);for(i in n)i in t||r.push(i);return r}(e.c,n),e.c=n}return i})}function Oa(e){e.i&&e.i.cancel("STOP_EVENT"),e.f&&(clearTimeout(e.f),e.f=null)}function Na(e){var t=this,n=null;this.a=[],this.type="indexedDB",this.c=e,this.b=we().then(function(){if(Sa()){var e=fi(),i="__sak"+e;return va||(va=new Ca),(n=va).set(i,e).then(function(){return n.get(i)}).then(function(t){if(t!==e)throw Error("indexedDB not supported!");return n.P(i)}).then(function(){return n}).s(function(){return t.c})}return t.c}).then(function(e){return t.type=e.type,e.Y(function(e){N(t.a,function(t){t(e)})}),e})}function La(){this.a={},this.type="inMemory"}function Da(){if(!function(){var e="Node"==Xn();if(!(e=Ra()||e&&qa.INTERNAL.node&&qa.INTERNAL.node.localStorage))return!1;try{return e.setItem("__sak","1"),e.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==Xn())throw new Fi("internal-error","The LocalStorage compatibility library was not found.");throw new Fi("web-storage-unsupported")}this.a=Ra()||qa.INTERNAL.node.localStorage,this.type="localStorage"}function Ra(){try{var e=n.localStorage,t=fi();return e&&(e.setItem(t,"1"),e.removeItem(t)),e}catch(e){return null}}function Ma(){this.type="nullStorage"}function Fa(){if(!function(){var e="Node"==Xn();if(!(e=ja()||e&&qa.INTERNAL.node&&qa.INTERNAL.node.sessionStorage))return!1;try{return e.setItem("__sak","1"),e.removeItem("__sak"),!0}catch(e){return!1}}()){if("Node"==Xn())throw new Fi("internal-error","The SessionStorage compatibility library was not found.");throw new Fi("web-storage-unsupported")}this.a=ja()||qa.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function ja(){try{var e=n.sessionStorage,t=fi();return e&&(e.setItem(t,"1"),e.removeItem(t)),e}catch(e){return null}}ga.prototype.f=function(e){var t=e.data.eventType,n=e.data.eventId,i=this.a[t];if(i&&0<i.length){e.ports[0].postMessage({status:"ack",eventId:n,eventType:t,response:null});var r=[];N(i,function(t){r.push(we().then(function(){return t(e.origin,e.data.data)}))}),Ee(r).then(function(i){var r=[];N(i,function(e){r.push({fulfilled:e.Db,value:e.value,reason:e.reason?e.reason.message:void 0})}),N(r,function(e){for(var t in e)void 0===e[t]&&delete e[t]}),e.ports[0].postMessage({status:"done",eventId:n,eventType:t,response:r})})}},ga.prototype.subscribe=function(e,t){ie(this.a)&&this.b.addEventListener("message",this.c),void 0===this.a[e]&&(this.a[e]=[]),this.a[e].push(t)},ga.prototype.unsubscribe=function(e,t){void 0!==this.a[e]&&t?(F(this.a[e],function(e){return e==t}),0==this.a[e].length&&delete this.a[e]):t||delete this.a[e],ie(this.a)&&this.b.removeEventListener("message",this.c)},_a.prototype.postMessage=function(e,t){this.a.postMessage(e,t)},ya.prototype.close=function(){for(;0<this.a.length;)wa(this,this.a[0]);this.b=!0},(e=Ca.prototype).set=function(e,t){var n,i=!1,r=this;return Ea(this).then(function(t){return xa((t=Ia(ka(n=t,!0))).get(e))}).then(function(o){var s=Ia(ka(n,!0));return o?(o.value=t,xa(s.put(o))):(r.b++,i=!0,(o={}).fbase_key=e,o.value=t,xa(s.add(o)))}).then(function(){return r.c[e]=t,Aa(r,e)}).ia(function(){i&&r.b--})},e.get=function(e){return Ea(this).then(function(t){return xa(Ia(ka(t,!1)).get(e))}).then(function(e){return e&&e.value})},e.P=function(e){var t=!1,n=this;return Ea(this).then(function(i){return t=!0,n.b++,xa(Ia(ka(i,!0)).delete(e))}).then(function(){return delete n.c[e],Aa(n,e)}).ia(function(){t&&n.b--})},e.Y=function(e){0==this.a.length&&function(e){Oa(e),function t(){e.f=setTimeout(function(){e.i=Pa(e).then(function(t){0<t.length&&N(e.a,function(e){e(t)})}).then(function(){t()}).s(function(e){"STOP_EVENT"!=e.message&&t()})},800)}()}(this),this.a.push(e)},e.ca=function(e){F(this.a,function(t){return t==e}),0==this.a.length&&Oa(this)},(e=Na.prototype).get=function(e){return this.b.then(function(t){return t.get(e)})},e.set=function(e,t){return this.b.then(function(n){return n.set(e,t)})},e.P=function(e){return this.b.then(function(t){return t.P(e)})},e.Y=function(e){this.a.push(e)},e.ca=function(e){F(this.a,function(t){return t==e})},(e=La.prototype).get=function(e){return we(this.a[e])},e.set=function(e,t){return this.a[e]=t,we()},e.P=function(e){return delete this.a[e],we()},e.Y=function(){},e.ca=function(){},(e=Da.prototype).get=function(e){var t=this;return we().then(function(){return pi(t.a.getItem(e))})},e.set=function(e,t){var n=this;return we().then(function(){var i=hi(t);null===i?n.P(e):n.a.setItem(e,i)})},e.P=function(e){var t=this;return we().then(function(){t.a.removeItem(e)})},e.Y=function(e){n.window&&vt(n.window,"storage",e)},e.ca=function(e){n.window&&yt(n.window,"storage",e)},(e=Ma.prototype).get=function(){return we(null)},e.set=function(){return we()},e.P=function(){return we()},e.Y=function(){},e.ca=function(){},(e=Fa.prototype).get=function(e){var t=this;return we().then(function(){return pi(t.a.getItem(e))})},e.set=function(e,t){var n=this;return we().then(function(){var i=hi(t);null===i?n.P(e):n.a.setItem(e,i)})},e.P=function(e){var t=this;return we().then(function(){t.a.removeItem(e)})},e.Y=function(){},e.ca=function(){};var Ua,Wa,Ba={A:Da,Ra:Fa},Va={A:Da,Ra:Fa},Ha={A:fa,Ra:Ma},$a={A:Da,Ra:Ma},Ga={Zc:"local",NONE:"none",ad:"session"};function Ka(){var e=!(gi(ri())||!Yn()),t=ci(),i=si();this.o=e,this.h=t,this.l=i,this.a={},Ua||(Ua=new function(){var e={};e.Browser=Ba,e.Node=Va,e.ReactNative=Ha,e.Worker=$a,this.a=e[Xn()]}),e=Ua;try{this.g=!Un()&&bi()||!n.indexedDB?new e.a.A:new Na(zn()?new La:new e.a.A)}catch(e){this.g=new La,this.h=!0}try{this.i=new e.a.Ra}catch(e){this.i=new La}this.m=new La,this.f=v(this.Pb,this),this.b={}}function Qa(){return Wa||(Wa=new Ka),Wa}function Ya(e,t){switch(t){case"session":return e.i;case"none":return e.m;default:return e.g}}function za(e,t){return"firebase:"+e.name+(t?":"+t:"")}function Xa(e,t,n){return n=za(t,n),"local"==t.A&&(e.b[n]=null),Ya(e,t.A).P(n)}function Za(e){e.c&&(clearInterval(e.c),e.c=null)}(e=Ka.prototype).get=function(e,t){return Ya(this,e.A).get(za(e,t))},e.set=function(e,t,n){var i=za(e,n),r=this,o=Ya(this,e.A);return o.set(i,t).then(function(){return o.get(i)}).then(function(t){"local"==e.A&&(r.b[i]=t)})},e.addListener=function(e,t,i){e=za(e,t),this.l&&(this.b[e]=n.localStorage.getItem(e)),ie(this.a)&&(Ya(this,"local").Y(this.f),this.h||(Un()||!bi())&&n.indexedDB||!this.l||function(e){Za(e),e.c=setInterval(function(){for(var t in e.a){var i=n.localStorage.getItem(t),r=e.b[t];i!=r&&(e.b[t]=i,i=new st({type:"storage",key:t,target:window,oldValue:r,newValue:i,a:!0}),e.Pb(i))}},1e3)}(this)),this.a[e]||(this.a[e]=[]),this.a[e].push(i)},e.removeListener=function(e,t,n){e=za(e,t),this.a[e]&&(F(this.a[e],function(e){return e==n}),0==this.a[e].length&&delete this.a[e]),ie(this.a)&&(Ya(this,"local").ca(this.f),Za(this))},e.Pb=function(e){if(e&&e.f){var t=e.a.key;if(null==t)for(var i in this.a){var r=this.b[i];void 0===r&&(r=null);var o=n.localStorage.getItem(i);o!==r&&(this.b[i]=o,this.Xa(i))}else if(0==t.indexOf("firebase:")&&this.a[t]){if(void 0!==e.a.a?Ya(this,"local").ca(this.f):Za(this),this.o)if(i=n.localStorage.getItem(t),(r=e.a.newValue)!==i)null!==r?n.localStorage.setItem(t,r):n.localStorage.removeItem(t);else if(this.b[t]===r&&void 0===e.a.a)return;var s=this;i=function(){void 0===e.a.a&&s.b[t]===n.localStorage.getItem(t)||(s.b[t]=n.localStorage.getItem(t),s.Xa(t))},Ve&&Xe&&10==Xe&&n.localStorage.getItem(t)!==e.a.newValue&&e.a.newValue!==e.a.oldValue?setTimeout(i,10):i()}}else N(e,v(this.Xa,this))},e.Xa=function(e){this.a[e]&&N(this.a[e],function(e){e()})};var Ja,el={name:"authEvent",A:"local"};function tl(e,t){this.b=nl,this.f=n.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=e,this.h=t,this.l=n.Int32Array?new Int32Array(64):Array(64),void 0!==Ja||(Ja=n.Int32Array?new Int32Array(ul):ul),this.reset()}y(tl,function(){this.b=-1});for(var nl=64,il=nl-1,rl=[],ol=0;ol<il;ol++)rl[ol]=0;var sl=j(128,rl);function al(e){for(var t=e.f,n=e.l,i=0,r=0;r<t.length;)n[i++]=t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3],r=4*i;for(t=16;64>t;t++){r=0|n[t-15],i=0|n[t-2];var o=(0|n[t-16])+((r>>>7|r<<25)^(r>>>18|r<<14)^r>>>3)|0,s=(0|n[t-7])+((i>>>17|i<<15)^(i>>>19|i<<13)^i>>>10)|0;n[t]=o+s|0}i=0|e.a[0],r=0|e.a[1];var a=0|e.a[2],l=0|e.a[3],u=0|e.a[4],c=0|e.a[5],h=0|e.a[6];for(o=0|e.a[7],t=0;64>t;t++){var d=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&r^i&a^r&a)|0;s=(o=o+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))|0)+((s=(s=u&c^~u&h)+(0|Ja[t])|0)+(0|n[t])|0)|0,o=h,h=c,c=u,u=l+s|0,l=a,a=r,r=i,i=s+d|0}e.a[0]=e.a[0]+i|0,e.a[1]=e.a[1]+r|0,e.a[2]=e.a[2]+a|0,e.a[3]=e.a[3]+l|0,e.a[4]=e.a[4]+u|0,e.a[5]=e.a[5]+c|0,e.a[6]=e.a[6]+h|0,e.a[7]=e.a[7]+o|0}function ll(e,t,n){void 0===n&&(n=t.length);var r=0,o=e.c;if(i(t))for(;r<n;)e.f[o++]=t.charCodeAt(r++),o==e.b&&(al(e),o=0);else{if(!u(t))throw Error("message must be string or array");for(;r<n;){var s=t[r++];if(!("number"==typeof s&&0<=s&&255>=s&&s==(0|s)))throw Error("message must be a byte array");e.f[o++]=s,o==e.b&&(al(e),o=0)}}e.c=o,e.g+=n}tl.prototype.reset=function(){this.g=this.c=0,this.a=n.Int32Array?new Int32Array(this.h):U(this.h)};var ul=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function cl(){tl.call(this,8,hl)}y(cl,tl);var hl=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function dl(e,t,n,i,r){this.m=e,this.i=t,this.l=n,this.o=i||null,this.u=r||null,this.h=t+":"+n,this.v=new function(){this.a=Qa()},this.g=new function(e){this.a=e,this.b=Qa()}(this.h),this.f=null,this.b=[],this.a=this.c=null}function pl(e){return new Fi("invalid-cordova-configuration",e)}function fl(e){var t=new cl;ll(t,e),e=[];var n=8*t.g;56>t.c?ll(t,sl,56-t.c):ll(t,sl,t.b-(t.c-56));for(var i=63;56<=i;i--)t.f[i]=255&n,n/=256;for(al(t),i=n=0;i<t.i;i++)for(var r=24;0<=r;r-=8)e[n++]=t.a[i]>>r&255;return function(e){return L(e,function(e){return 1<(e=e.toString(16)).length?e:"0"+e}).join("")}(e)}function gl(e,t){for(var n=0;n<e.b.length;n++)try{e.b[n](t)}catch(e){}}function vl(e){return e.f||(e.f=e.ga().then(function(){return new fe(function(t){e.wa(function n(i){return t(i),e.Ka(n),!1}),function(e){function t(t){r=!0,o&&o.cancel(),ml(e).then(function(n){var r=i;if(n&&t&&t.url){var o=null;-1!=(r=br(t.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=pi(Gt(o=Kt(r),"firebaseError")||null))?ji(o):null)?new qr(n.b,n.c,null,null,o):new qr(n.b,n.c,r,n.g)),r=o||i}gl(e,r)})}var i=new qr("unknown",null,null,null,new Fi("no-auth-event")),r=!1,o=Lt(500).then(function(){return ml(e).then(function(){r||gl(e,i)})}),s=n.handleOpenURL;n.handleOpenURL=function(e){if(0==e.toLowerCase().indexOf(oi("BuildInfo.packageName",n).toLowerCase()+"://")&&t({url:e}),"function"==typeof s)try{s(e)}catch(e){console.error(e)}},Xr||(Xr=new Yr),Xr.subscribe(t)}(e)})})),e.f}function ml(e){var t=null;return function(e){return e.b.get(el,e.a).then(function(e){return Qr(e)})}(e.g).then(function(n){return t=n,Xa((n=e.g).b,el,n.a)}).then(function(){return t})}(e=dl.prototype).ga=function(){return this.za?this.za:this.za=(Qn(void 0)?qn().then(function(){return new fe(function(e,t){var i=n.document,r=setTimeout(function(){t(Error("Cordova framework is not ready."))},1e3);i.addEventListener("deviceready",function(){clearTimeout(r),e()},!1)})}):Ce(Error("Cordova must run in an Android or iOS file scheme."))).then(function(){if("function"!=typeof oi("universalLinks.subscribe",n))throw pl("cordova-universal-links-plugin-fix is not installed");if(void 0===oi("BuildInfo.packageName",n))throw pl("cordova-plugin-buildinfo is not installed");if("function"!=typeof oi("cordova.plugins.browsertab.openUrl",n))throw pl("cordova-plugin-browsertab is not installed");if("function"!=typeof oi("cordova.InAppBrowser.open",n))throw pl("cordova-plugin-inappbrowser is not installed")},function(){throw new Fi("cordova-not-ready")})},e.Ea=function(e,t){return t(new Fi("operation-not-supported-in-this-environment")),we()},e.Cb=function(){return Ce(new Fi("operation-not-supported-in-this-environment"))},e.Qb=function(){return!1},e.Mb=function(){return!0},e.Hb=function(){return!0},e.Ca=function(e,t,i){if(this.c)return Ce(new Fi("redirect-operation-pending"));var r=this,o=n.document,s=null,a=null,l=null,u=null;return this.c=we().then(function(){return Kr(t),vl(r)}).then(function(){return function(e,t,i,r){var o=function(){for(var e=20,t=[];0<e;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),e--;return t.join("")}(),s=new qr(t,r,null,o,new Fi("no-auth-event")),a=oi("BuildInfo.packageName",n);if("string"!=typeof a)throw new Fi("invalid-cordova-configuration");var l=oi("BuildInfo.displayName",n),u={};if(ri().toLowerCase().match(/iphone|ipad|ipod/))u.ibi=a;else{if(!ri().toLowerCase().match(/android/))return Ce(new Fi("operation-not-supported-in-this-environment"));u.apn=a}l&&(u.appDisplayName=l),o=fl(o),u.sessionId=o;var c=pa(e.m,e.i,e.l,t,i,null,r,e.o,u,e.u);return e.ga().then(function(){var t=e.h;return e.v.a.set(el,s.C(),t)}).then(function(){var t=oi("cordova.plugins.browsertab.isAvailable",n);if("function"!=typeof t)throw new Fi("invalid-cordova-configuration");var i=null;t(function(t){if(t){if("function"!=typeof(i=oi("cordova.plugins.browsertab.openUrl",n)))throw new Fi("invalid-cordova-configuration");i(c)}else{if("function"!=typeof(i=oi("cordova.InAppBrowser.open",n)))throw new Fi("invalid-cordova-configuration");t=!(!(t=ri()).match(/(iPad|iPhone|iPod).*OS 7_\d/i)&&!t.match(/(iPad|iPhone|iPod).*OS 8_\d/i)),e.a=i(c,t?"_blank":"_system","location=yes")}})})}(r,e,t,i)}).then(function(){return new fe(function(e,t){a=function(){var t=oi("cordova.plugins.browsertab.close",n);return e(),"function"==typeof t&&t(),r.a&&"function"==typeof r.a.close&&(r.a.close(),r.a=null),!1},r.wa(a),l=function(){s||(s=Lt(2e3).then(function(){t(new Fi("redirect-cancelled-by-user"))}))},u=function(){_i()&&l()},o.addEventListener("resume",l,!1),ri().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",u,!1)}).s(function(e){return ml(r).then(function(){throw e})})}).ia(function(){l&&o.removeEventListener("resume",l,!1),u&&o.removeEventListener("visibilitychange",u,!1),s&&s.cancel(),a&&r.Ka(a),r.c=null})},e.wa=function(e){this.b.push(e),vl(this).s(function(t){"auth/invalid-cordova-configuration"===t.code&&(t=new qr("unknown",null,null,null,new Fi("no-auth-event")),e(t))})},e.Ka=function(e){F(this.b,function(t){return t==e})};var _l={name:"pendingRedirect",A:"session"};function yl(e){return Xa(e.b,_l,e.a)}function bl(e,t,n){this.u=e,this.l=t,this.m=n,this.h=[],this.f=!1,this.i=v(this.bb,this),this.b=new Pl,this.o=new Dl,this.g=new function(e){this.a=e,this.b=Qa()}(this.l+":"+this.m),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.o,this.c.linkViaPopup=this.o,this.c.reauthViaPopup=this.o,this.a=wl(this.u,this.l,this.m,rr)}function wl(e,t,n,i){var r=qa.SDK_VERSION||null;return Qn()?new dl(e,t,n,r,i):new ua(e,t,n,r,i)}function Cl(e){e.f||(e.f=!0,e.a.wa(e.i));var t=e.a;return e.a.ga().s(function(n){throw e.a==t&&e.reset(),n})}function Tl(e){e.a.Mb()&&Cl(e).s(function(t){var n=new qr("unknown",null,null,null,new Fi("operation-not-supported-in-this-environment"));kl(t)&&e.bb(n)}),e.a.Hb()||Ol(e.b)}(e=bl.prototype).reset=function(){this.f=!1,this.a.Ka(this.i),this.a=wl(this.u,this.l,this.m)},e.Ya=function(){this.b.Ya()},e.subscribe=function(e){if(R(this.h,e)||this.h.push(e),!this.f){var t=this;(function(e){return e.b.get(_l,e.a).then(function(e){return"pending"==e})})(this.g).then(function(e){e?yl(t.g).then(function(){Cl(t).s(function(e){var n=new qr("unknown",null,null,null,new Fi("operation-not-supported-in-this-environment"));kl(e)&&t.bb(n)})}):Tl(t)}).s(function(){Tl(t)})}},e.unsubscribe=function(e){F(this.h,function(t){return t==e})},e.bb=function(e){if(!e)throw new Fi("invalid-auth-event");for(var t=!1,n=0;n<this.h.length;n++){var i=this.h[n];if(i.vb(e.b,e.c)){(t=this.c[e.b])&&t.h(e,i),t=!0;break}}return Ol(this.b),t};var El=new mi(2e3,1e4),Sl=new mi(3e4,6e4);function Il(e,t,n,i,r,o){return e.a.Cb(t,n,i,function(){e.f||(e.f=!0,e.a.wa(e.i))},function(){e.reset()},r,o)}function kl(e){return!(!e||"auth/cordova-not-ready"!=e.code)}bl.prototype.fa=function(){return this.b.fa()},bl.prototype.Ca=function(e,t,n){var i,r=this;return function(e){return e.b.set(_l,"pending",e.a)}(this.g).then(function(){return r.a.Ca(e,t,n).s(function(e){if(kl(e))throw new Fi("operation-not-supported-in-this-environment");return i=e,yl(r.g).then(function(){throw i})}).then(function(){return r.a.Qb()?new fe(function(){}):yl(r.g).then(function(){return r.fa()}).then(function(){}).s(function(){})})})},bl.prototype.Ea=function(e,t,n,i){return this.a.Ea(n,function(n){e.ha(t,null,n,i)},El.get())};var xl={};function Al(e,t,n){var i=t+":"+n;return xl[i]||(xl[i]=new bl(e,t,n)),xl[i]}function Pl(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Ol(e){e.g||(e.g=!0,Ll(e,!1,null,null))}function Nl(e,t){if(e.b=function(){return we(t)},e.f.length)for(var n=0;n<e.f.length;n++)e.f[n](t)}function Ll(e,t,n,i){t?i?function(e,t){if(e.b=function(){return Ce(t)},e.c.length)for(var n=0;n<e.c.length;n++)e.c[n](t)}(e,i):Nl(e,n):Nl(e,{user:null}),e.f=[],e.c=[]}function Dl(){}function Rl(){this.sb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.sb},set:function(e){this.sb=e},enumerable:!1})}function Ml(e,t){this.a=t,Si(this,"verificationId",e)}function Fl(e,t,n,i){return new Hr(e).Ua(t,n).then(function(e){return new Ml(e,i)})}function jl(e,t,n){if(this.h=e,this.i=t,this.g=n,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function Ul(e){this.f=e,this.b=this.a=null,this.c=0}function Wl(e,t){var n=t[is],i=t.refreshToken;t=Bl(t.expiresIn),e.b=n,e.c=t,e.a=i}function Bl(e){return _()+1e3*parseInt(e,10)}function Vl(e,t){return function(e,t){return new fe(function(n,i){"refresh_token"==t.grant_type&&t.refresh_token||"authorization_code"==t.grant_type&&t.code?cs(e,e.i+"?key="+encodeURIComponent(e.b),function(e){e?e.error?i(ea(e)):e.access_token&&e.refresh_token?n(e):i(new Fi("internal-error")):i(new Fi("network-request-failed"))},"POST",on(t).toString(),e.f,e.l.get()):i(new Fi("internal-error"))})}(e.f,t).then(function(t){return e.b=t.access_token,e.c=Bl(t.expires_in),e.a=t.refresh_token,{accessToken:e.b,expirationTime:e.c,refreshToken:e.a}}).s(function(t){throw"auth/user-token-expired"==t.code&&(e.a=null),t})}function Hl(e,t){this.a=e||null,this.b=t||null,Ii(this,{lastSignInTime:yi(t||null),creationTime:yi(e||null)})}function $l(e,t){for(var n in ot.call(this,e),t)this[n]=t[n]}function Gl(e,t,n){this.G=[],this.m=e.apiKey,this.o=e.appName,this.u=e.authDomain||null,e=qa.SDK_VERSION?ii(qa.SDK_VERSION):null,this.b=new ts(this.m,sr(rr),e),this.h=new Ul(this.b),Zl(this,t[is]),Wl(this.h,t),Si(this,"refreshToken",this.h.a),tu(this,n||{}),xt.call(this),this.I=!1,this.u&&ai()&&(this.a=Al(this.u,this.m,this.o)),this.N=[],this.i=null,this.w=function(e){return new jl(function(){return e.F(!0)},function(e){return!(!e||"auth/network-request-failed"!=e.code)},function(){var t=e.h.c-_()-3e5;return 0<t?t:0})}(this),this.V=v(this.Ha,this);var i=this;this.ka=null,this.ta=function(e){i.pa(e.g)},this.X=null,this.O=[],this.sa=function(e){ql(i,e.c)},this.W=null}function Kl(e,t){e.X&&yt(e.X,"languageCodeChanged",e.ta),(e.X=t)&&vt(t,"languageCodeChanged",e.ta)}function ql(e,t){e.O=t,us(e.b,qa.SDK_VERSION?ii(qa.SDK_VERSION,e.O):null)}function Ql(e,t){e.W&&yt(e.W,"frameworkChanged",e.sa),(e.W=t)&&vt(t,"frameworkChanged",e.sa)}function Yl(e){try{return qa.app(e.o).auth()}catch(t){throw new Fi("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+e.o+"'!")}}function zl(e){e.D||e.w.b||(e.w.start(),yt(e,"tokenChanged",e.V),vt(e,"tokenChanged",e.V))}function Xl(e){yt(e,"tokenChanged",e.V),e.w.stop()}function Zl(e,t){e.ra=t,Si(e,"_lat",t)}function Jl(e){for(var t=[],n=0;n<e.N.length;n++)t.push(e.N[n](e));return Ee(t).then(function(){return e})}function eu(e){e.a&&!e.I&&(e.I=!0,e.a.subscribe(e))}function tu(e,t){Ii(e,{uid:t.uid,displayName:t.displayName||null,photoURL:t.photoURL||null,email:t.email||null,emailVerified:t.emailVerified||!1,phoneNumber:t.phoneNumber||null,isAnonymous:t.isAnonymous||!1,metadata:new Hl(t.createdAt,t.lastLoginAt),providerData:[]})}function nu(){}function iu(e){return we().then(function(){if(e.D)throw new Fi("app-deleted")})}function ru(e){return L(e.providerData,function(e){return e.providerId})}function ou(e,t){t&&(su(e,t.providerId),e.providerData.push(t))}function su(e,t){F(e.providerData,function(e){return e.providerId==t})}function au(e,t,n){("uid"!=t||n)&&e.hasOwnProperty(t)&&Si(e,t,n)}function lu(e,t){e!=t&&(Ii(e,{uid:t.uid,displayName:t.displayName,photoURL:t.photoURL,email:t.email,emailVerified:t.emailVerified,phoneNumber:t.phoneNumber,isAnonymous:t.isAnonymous,providerData:[]}),t.metadata?Si(e,"metadata",function(e){return new Hl(e.a,e.b)}(t.metadata)):Si(e,"metadata",new Hl),N(t.providerData,function(t){ou(e,t)}),function(e,t){e.b=t.b,e.a=t.a,e.c=t.c}(e.h,t.h),Si(e,"refreshToken",e.h.a))}function uu(e){return e.F().then(function(t){var n=e.isAnonymous;return function(e,t){return Zs(e.b,Ls,{idToken:t}).then(v(e.xc,e))}(e,t).then(function(){return n||au(e,"isAnonymous",!1),t})})}function cu(e,t){t[is]&&e.ra!=t[is]&&(Wl(e.h,t),e.dispatchEvent(new $l("tokenChanged")),Zl(e,t[is]),au(e,"refreshToken",e.h.a))}function hu(e,t){return uu(e).then(function(){if(R(ru(e),t))return Jl(e).then(function(){throw new Fi("provider-already-linked")})})}function du(e,t,n){return ki({user:e,credential:Gr(t),additionalUserInfo:t=hr(t),operationType:n})}function pu(e,t){return cu(e,t),e.reload().then(function(){return e})}function fu(e,t,n,i,r){if(!ai())return Ce(new Fi("operation-not-supported-in-this-environment"));if(e.i&&!r)return Ce(e.i);var o=cr(n.providerId),s=fi(e.uid+":::"),a=null;(!ci()||Yn())&&e.u&&n.isOAuthProvider&&(a=pa(e.u,e.m,e.o,t,n,null,s,qa.SDK_VERSION||null));var l=$n(a,o&&o.Ba,o&&o.Aa);return i=i().then(function(){if(vu(e),!r)return e.F().then(function(){})}).then(function(){return Il(e.a,l,t,n,s,!!a)}).then(function(){return new fe(function(n,i){e.ha(t,null,new Fi("cancelled-popup-request"),e.g||null),e.f=n,e.v=i,e.g=s,e.c=e.a.Ea(e,t,l,s)})}).then(function(e){return l&&Hn(l),e?ki(e):null}).s(function(e){throw l&&Hn(l),e}),mu(e,i,r)}function gu(e,t,n,i,r){if(!ai())return Ce(new Fi("operation-not-supported-in-this-environment"));if(e.i&&!r)return Ce(e.i);var o=null,s=fi(e.uid+":::");return i=i().then(function(){if(vu(e),!r)return e.F().then(function(){})}).then(function(){return e.aa=s,Jl(e)}).then(function(t){return e.ba&&(t=(t=e.ba).b.set(yu,e.C(),t.a)),t}).then(function(){return e.a.Ca(t,n,s)}).s(function(t){if(o=t,e.ba)return bu(e.ba);throw o}).then(function(){if(o)throw o}),mu(e,i,r)}function vu(e){if(!e.a||!e.I){if(e.a&&!e.I)throw new Fi("internal-error");throw new Fi("auth-domain-config-required")}}function mu(e,t,n){var i=function(e,t,n){return e.i&&!n?(t.cancel(),Ce(e.i)):t.s(function(t){throw!t||"auth/user-disabled"!=t.code&&"auth/user-token-expired"!=t.code||(e.i||e.dispatchEvent(new $l("userInvalidated")),e.i=t),t})}(e,t,n);return e.G.push(i),i.ia(function(){M(e.G,i)}),i}function _u(e){if(!e.apiKey)return null;var t={apiKey:e.apiKey,authDomain:e.authDomain,appName:e.appName},n={};if(!(e.stsTokenManager&&e.stsTokenManager.accessToken&&e.stsTokenManager.expirationTime))return null;n[is]=e.stsTokenManager.accessToken,n.refreshToken=e.stsTokenManager.refreshToken||null,n.expiresIn=(e.stsTokenManager.expirationTime-_())/1e3;var i=new Gl(t,n,e);return e.providerData&&N(e.providerData,function(e){e&&ou(i,ki(e))}),e.redirectEventId&&(i.aa=e.redirectEventId),i}Pl.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Pl.prototype.h=function(e,t){if(e){this.reset(),this.g=!0;var n=e.b,i=e.c,r=e.a&&"auth/web-storage-unsupported"==e.a.code,o=e.a&&"auth/operation-not-supported-in-this-environment"==e.a.code;this.i=!(!r&&!o),"unknown"!=n||r||o?e.a?(Ll(this,!0,null,e.a),we()):t.xa(n,i)?function(e,t,n){n=n.xa(t.b,t.c);var i=t.f,r=t.g,o=t.h,s=!!t.b.match(/Redirect$/);n(i,r,o).then(function(t){Ll(e,s,t,null)}).s(function(t){Ll(e,s,null,t)})}(this,e,t):Ce(new Fi("invalid-auth-event")):(Ll(this,!1,null,null),we())}else Ce(new Fi("invalid-auth-event"))},Pl.prototype.Ya=function(){this.g&&!this.i&&Ll(this,!1,null,null)},Pl.prototype.fa=function(){var e=this;return new fe(function(t,n){e.b?e.b().then(t,n):(e.f.push(t),e.c.push(n),function(e){var t=new Fi("timeout");e.a&&e.a.cancel(),e.a=Lt(Sl.get()).then(function(){e.b||(e.g=!0,Ll(e,!0,null,t))})}(e))})},Dl.prototype.h=function(e,t){if(e){var n=e.b,i=e.c;e.a?(t.ha(e.b,null,e.a,e.c),we()):t.xa(n,i)?function(e,t){var n=e.c,i=e.b;t.xa(i,n)(e.f,e.g,e.h).then(function(e){t.ha(i,e,null,n)}).s(function(e){t.ha(i,null,e,n)})}(e,t):Ce(new Fi("invalid-auth-event"))}else Ce(new Fi("invalid-auth-event"))},Ml.prototype.confirm=function(e){return e=$r(this.verificationId,e),this.a(e)},jl.prototype.start=function(){this.a=this.c,function e(t,i){t.stop();t.b=Lt(function(e,t){if(t)return e.a=e.c,e.g();return t=e.a,e.a*=2,e.a>e.f&&(e.a=e.f),t}(t,i)).then(function(){return e=n.document,t=null,_i()||!e?we():new fe(function(n){t=function(){_i()&&(e.removeEventListener("visibilitychange",t,!1),n())},e.addEventListener("visibilitychange",t,!1)}).s(function(n){throw e.removeEventListener("visibilitychange",t,!1),n});var e,t}).then(function(){return t.h()}).then(function(){e(t,!0)}).s(function(n){t.i(n)&&e(t,!1)})}(this,!0)},jl.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},Ul.prototype.C=function(){return{apiKey:this.f.b,refreshToken:this.a,accessToken:this.b,expirationTime:this.c}},Ul.prototype.getToken=function(e){return e=!!e,this.b&&!this.a?Ce(new Fi("user-token-expired")):e||!this.b||_()>this.c-3e4?this.a?Vl(this,{grant_type:"refresh_token",refresh_token:this.a}):we(null):we({accessToken:this.b,expirationTime:this.c,refreshToken:this.a})},Hl.prototype.C=function(){return{lastLoginAt:this.b,createdAt:this.a}},y($l,ot),y(Gl,xt),Gl.prototype.pa=function(e){this.ka=e,ls(this.b,e)},Gl.prototype.ea=function(){return this.ka},Gl.prototype.ya=function(){return U(this.O)},Gl.prototype.Ha=function(){this.w.b&&(this.w.stop(),this.w.start())},Si(Gl.prototype,"providerId","firebase"),(e=Gl.prototype).reload=function(){var e=this;return mu(this,iu(this).then(function(){return uu(e).then(function(){return Jl(e)}).then(nu)}))},e.dc=function(e){return this.F(e).then(function(e){return new function(e){var t=ir(e);if(!(t&&t.exp&&t.auth_time&&t.iat))throw new Fi("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");Ii(this,{token:e,expirationTime:yi(1e3*t.exp),authTime:yi(1e3*t.auth_time),issuedAtTime:yi(1e3*t.iat),signInProvider:t.firebase&&t.firebase.sign_in_provider?t.firebase.sign_in_provider:null,claims:t})}(e)})},e.F=function(e){var t=this;return mu(this,iu(this).then(function(){return t.h.getToken(e)}).then(function(e){if(!e)throw new Fi("internal-error");return e.accessToken!=t.ra&&(Zl(t,e.accessToken),t.dispatchEvent(new $l("tokenChanged"))),au(t,"refreshToken",e.refreshToken),e.accessToken}))},e.xc=function(e){if(!(e=e.users)||!e.length)throw new Fi("internal-error");tu(this,{uid:(e=e[0]).localId,displayName:e.displayName,photoURL:e.photoUrl,email:e.email,emailVerified:!!e.emailVerified,phoneNumber:e.phoneNumber,lastLoginAt:e.lastLoginAt,createdAt:e.createdAt});for(var t=function(e){return(e=e.providerUserInfo)&&e.length?L(e,function(e){return new function(e,t,n,i,r,o){Ii(this,{uid:e,displayName:i||null,photoURL:r||null,email:n||null,phoneNumber:o||null,providerId:t})}(e.rawId,e.providerId,e.email,e.displayName,e.photoUrl,e.phoneNumber)}):[]}(e),n=0;n<t.length;n++)ou(this,t[n]);au(this,"isAnonymous",!(this.email&&e.passwordHash||this.providerData&&this.providerData.length))},e.gb=function(e){var t=this,n=null;return mu(this,e.f(this.b,this.uid).then(function(e){return cu(t,e),n=du(t,e,"reauthenticate"),t.i=null,t.reload()}).then(function(){return n}),!0)},e.yc=function(e){return Ti("firebase.User.prototype.reauthenticateWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential instead."),this.gb(e).then(function(){})},e.eb=function(e){var t=this,n=null;return mu(this,hu(this,e.providerId).then(function(){return t.F()}).then(function(n){return e.b(t.b,n)}).then(function(e){return n=du(t,e,"link"),pu(t,e)}).then(function(){return n}))},e.pc=function(e){return Ti("firebase.User.prototype.linkWithCredential is deprecated. Please use firebase.User.prototype.linkAndRetrieveDataWithCredential instead."),this.eb(e).then(function(e){return e.user})},e.qc=function(e,t){var n=this;return mu(this,hu(this,"phone").then(function(){return Fl(Yl(n),e,t,v(n.eb,n))}))},e.zc=function(e,t){var n=this;return mu(this,we().then(function(){return Fl(Yl(n),e,t,v(n.gb,n))}),!0)},e.pb=function(e){var t=this;return mu(this,this.F().then(function(n){return t.b.pb(n,e)}).then(function(e){return cu(t,e),t.reload()}))},e.Rc=function(e){var t=this;return mu(this,this.F().then(function(n){return e.b(t.b,n)}).then(function(e){return cu(t,e),t.reload()}))},e.qb=function(e){var t=this;return mu(this,this.F().then(function(n){return t.b.qb(n,e)}).then(function(e){return cu(t,e),t.reload()}))},e.rb=function(e){if(void 0===e.displayName&&void 0===e.photoURL)return iu(this);var t=this;return mu(this,this.F().then(function(n){return t.b.rb(n,{displayName:e.displayName,photoUrl:e.photoURL})}).then(function(e){return cu(t,e),au(t,"displayName",e.displayName||null),au(t,"photoURL",e.photoUrl||null),N(t.providerData,function(e){"password"===e.providerId&&(Si(e,"displayName",t.displayName),Si(e,"photoURL",t.photoURL))}),Jl(t)}).then(nu))},e.Pc=function(e){var t=this;return mu(this,uu(this).then(function(n){return R(ru(t),e)?function(e,t,n){return Zs(e,Ps,{idToken:t,deleteProvider:n})}(t.b,n,[e]).then(function(e){var n={};return N(e.providerUserInfo||[],function(e){n[e.providerId]=!0}),N(ru(t),function(e){n[e]||su(t,e)}),n[Hr.PROVIDER_ID]||Si(t,"phoneNumber",null),Jl(t)}):Jl(t).then(function(){throw new Fi("no-such-provider")})}))},e.delete=function(){var e=this;return mu(this,this.F().then(function(t){return Zs(e.b,As,{idToken:t})}).then(function(){e.dispatchEvent(new $l("userDeleted"))})).then(function(){for(var t=0;t<e.G.length;t++)e.G[t].cancel("app-deleted");Kl(e,null),Ql(e,null),e.G=[],e.D=!0,Xl(e),Si(e,"refreshToken",null),e.a&&e.a.unsubscribe(e)})},e.vb=function(e,t){return!!("linkViaPopup"==e&&(this.g||null)==t&&this.f||"reauthViaPopup"==e&&(this.g||null)==t&&this.f||"linkViaRedirect"==e&&(this.aa||null)==t||"reauthViaRedirect"==e&&(this.aa||null)==t)},e.ha=function(e,t,n,i){"linkViaPopup"!=e&&"reauthViaPopup"!=e||i!=(this.g||null)||(n&&this.v?this.v(n):t&&!n&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},e.xa=function(e,t){return"linkViaPopup"==e&&t==(this.g||null)?v(this.Ab,this):"reauthViaPopup"==e&&t==(this.g||null)?v(this.Bb,this):"linkViaRedirect"==e&&(this.aa||null)==t?v(this.Ab,this):"reauthViaRedirect"==e&&(this.aa||null)==t?v(this.Bb,this):null},e.rc=function(e){var t=this;return fu(this,"linkViaPopup",e,function(){return hu(t,e.providerId).then(function(){return Jl(t)})},!1)},e.Ac=function(e){return fu(this,"reauthViaPopup",e,function(){return we()},!0)},e.sc=function(e){var t=this;return gu(this,"linkViaRedirect",e,function(){return hu(t,e.providerId)},!1)},e.Bc=function(e){return gu(this,"reauthViaRedirect",e,function(){return we()},!0)},e.Ab=function(e,t,n){var i=this;this.c&&(this.c.cancel(),this.c=null);var r=null;return mu(this,this.F().then(function(r){return Cs(i.b,{requestUri:e,postBody:n,sessionId:t,idToken:r})}).then(function(e){return r=du(i,e,"link"),pu(i,e)}).then(function(){return r}))},e.Bb=function(e,t,n){var i=this;this.c&&(this.c.cancel(),this.c=null);var r=null;return mu(this,we().then(function(){return wr(Ts(i.b,{requestUri:e,sessionId:t,postBody:n}),i.uid)}).then(function(e){return r=du(i,e,"reauthenticate"),cu(i,e),i.i=null,i.reload()}).then(function(){return r}),!0)},e.jb=function(e){var t=this,n=null;return mu(this,this.F().then(function(t){return n=t,void 0===e||ie(e)?{}:Xi(new Bi(e))}).then(function(e){return t.b.jb(n,e)}).then(function(e){if(t.email!=e)return t.reload()}).then(function(){}))},e.toJSON=function(){return this.C()},e.C=function(){var e={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,providerData:[],apiKey:this.m,appName:this.o,authDomain:this.u,stsTokenManager:this.h.C(),redirectEventId:this.aa||null};return this.metadata&&le(e,this.metadata.C()),N(this.providerData,function(t){e.providerData.push(function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}(t))}),e};var yu={name:"redirectUser",A:"session"};function bu(e){return Xa(e.b,yu,e.a)}function wu(e){this.a=e,this.b=Qa(),this.c=null,this.f=function(e){var t=Eu("local"),i=Eu("session"),r=Eu("none");return function(e,t,i){var r=za(t,i),o=Ya(e,t.A);return e.get(t,i).then(function(s){var a=null;try{a=pi(n.localStorage.getItem(r))}catch(e){}if(a&&!s)return n.localStorage.removeItem(r),e.set(t,a,i);a&&s&&"localStorage"!=o.type&&n.localStorage.removeItem(r)})}(e.b,t,e.a).then(function(){return e.b.get(i,e.a)}).then(function(n){return n?i:e.b.get(r,e.a).then(function(n){return n?r:e.b.get(t,e.a).then(function(n){return n?t:e.b.get(Tu,e.a).then(function(e){return e?Eu(e):t})})})}).then(function(t){return e.c=t,Cu(e,t.A)}).s(function(){e.c||(e.c=t)})}(this),this.b.addListener(Eu("local"),this.a,v(this.g,this))}function Cu(e,t){var n,i=[];for(n in Ga)Ga[n]!==t&&i.push(Xa(e.b,Eu(Ga[n]),e.a));return i.push(Xa(e.b,Tu,e.a)),function(e){return new fe(function(t,n){var i=e.length,r=[];if(i)for(var o=function(e,n){i--,r[e]=n,0==i&&t(r)},s=function(e){n(e)},a=0;a<e.length;a++)Te(e[a],m(o,a),s);else t(r)})}(i)}wu.prototype.g=function(){var e=this,t=Eu("local");xu(this,function(){return we().then(function(){return e.c&&"local"!=e.c.A?e.b.get(t,e.a):null}).then(function(n){if(n)return Cu(e,"local").then(function(){e.c=t})})})};var Tu={name:"persistence",A:"session"};function Eu(e){return{name:"authUser",A:e}}function Su(e,t){return xu(e,function(){return e.b.set(e.c,t.C(),e.a)})}function Iu(e){return xu(e,function(){return Xa(e.b,e.c,e.a)})}function ku(e,t){return xu(e,function(){return e.b.get(e.c,e.a).then(function(e){return e&&t&&(e.authDomain=t),_u(e||{})})})}function xu(e,t){return e.f=e.f.then(t,t),e.f}function Au(e){if(this.m=!1,Si(this,"settings",new Rl),Si(this,"app",e),!Mu(this).options||!Mu(this).options.apiKey)throw new Fi("invalid-api-key");e=qa.SDK_VERSION?ii(qa.SDK_VERSION):null,this.b=new ts(Mu(this).options&&Mu(this).options.apiKey,sr(rr),e),this.N=[],this.o=[],this.I=[],this.Tb=qa.INTERNAL.createSubscribe(v(this.mc,this)),this.O=void 0,this.Ub=qa.INTERNAL.createSubscribe(v(this.nc,this)),Du(this,null),this.h=new wu(Mu(this).options.apiKey+":"+Mu(this).name),this.w=new function(e){this.a=e,this.b=Qa()}(Mu(this).options.apiKey+":"+Mu(this).name),this.V=Wu(this,function(e){var t=Mu(e).options.authDomain,n=function(e){var t=function(e,t){return e.b.get(yu,e.a).then(function(e){return e&&t&&(e.authDomain=t),_u(e||{})})}(e.w,Mu(e).options.authDomain).then(function(t){return(e.D=t)&&(t.ba=e.w),bu(e.w)});return Wu(e,t)}(e).then(function(){return ku(e.h,t)}).then(function(t){return t?(t.ba=e.w,e.D&&(e.D.aa||null)==(t.aa||null)?t:t.reload().then(function(){return Su(e.h,t).then(function(){return t})}).s(function(n){return"auth/network-request-failed"==n.code?t:Iu(e.h)})):null}).then(function(t){Du(e,t||null)});return Wu(e,n)}(this)),this.i=Wu(this,function(e){return e.V.then(function(){return e.fa()}).s(function(){}).then(function(){if(!e.m)return e.ka()}).s(function(){}).then(function(){if(!e.m){e.X=!0;var t=e.h;t.b.addListener(Eu("local"),t.a,e.ka)}})}(this)),this.X=!1,this.ka=v(this.Mc,this),this.Ha=v(this.Z,this),this.ra=v(this.bc,this),this.sa=v(this.jc,this),this.ta=v(this.kc,this),function(e){var t=Mu(e).options.authDomain,n=Mu(e).options.apiKey;t&&ai()&&(e.Sb=e.V.then(function(){if(!e.m){if(e.a=Al(t,n,Mu(e).name),e.a.subscribe(e),Fu(e)&&eu(Fu(e)),e.D){eu(e.D);var i=e.D;i.pa(e.ea()),Kl(i,e),ql(i=e.D,e.G),Ql(i,e),e.D=null}return e.a}}))}(this),this.INTERNAL={},this.INTERNAL.delete=v(this.delete,this),this.INTERNAL.logFramework=v(this.tc,this),this.u=0,xt.call(this),function(e){Object.defineProperty(e,"lc",{get:function(){return this.ea()},set:function(e){this.pa(e)},enumerable:!1}),e.W=null}(this),this.G=[]}function Pu(e){ot.call(this,"languageCodeChanged"),this.g=e}function Ou(e){ot.call(this,"frameworkChanged"),this.c=e}function Nu(e){return e.Sb||Ce(new Fi("auth-domain-config-required"))}function Lu(e,t){var n={};return n.apiKey=Mu(e).options.apiKey,n.authDomain=Mu(e).options.authDomain,n.appName=Mu(e).name,e.V.then(function(){return function(e,t,n,i){var r=new Gl(e,t);return n&&(r.ba=n),i&&ql(r,i),r.reload().then(function(){return r})}(n,t,e.w,e.ya())}).then(function(t){return Fu(e)&&t.uid==Fu(e).uid?(lu(Fu(e),t),e.Z(t)):(Du(e,t),eu(t),e.Z(t))}).then(function(){Uu(e)})}function Du(e,t){Fu(e)&&(function(e,t){F(e.N,function(e){return e==t})}(Fu(e),e.Ha),yt(Fu(e),"tokenChanged",e.ra),yt(Fu(e),"userDeleted",e.sa),yt(Fu(e),"userInvalidated",e.ta),Xl(Fu(e))),t&&(t.N.push(e.Ha),vt(t,"tokenChanged",e.ra),vt(t,"userDeleted",e.sa),vt(t,"userInvalidated",e.ta),0<e.u&&zl(t)),Si(e,"currentUser",t),t&&(t.pa(e.ea()),Kl(t,e),ql(t,e.G),Ql(t,e))}function Ru(e,t){var n=null,i=null;return Wu(e,t.then(function(t){return n=Gr(t),i=hr(t),Lu(e,t)}).then(function(){return ki({user:Fu(e),credential:n,additionalUserInfo:i,operationType:"signIn"})}))}function Mu(e){return e.app}function Fu(e){return e.currentUser}function ju(e){return Fu(e)&&Fu(e)._lat||null}function Uu(e){if(e.X){for(var t=0;t<e.o.length;t++)e.o[t]&&e.o[t](ju(e));if(e.O!==e.getUid()&&e.I.length)for(e.O=e.getUid(),t=0;t<e.I.length;t++)e.I[t]&&e.I[t](ju(e))}}function Wu(e,t){return e.N.push(t),t.ia(function(){M(e.N,t)}),t}function Bu(){}function Vu(){this.a={},this.b=1e12}wu.prototype.mb=function(e){var t=null,n=this;return function(e){var t=new Fi("invalid-persistence-type"),n=new Fi("unsupported-persistence-type");e:{for(i in Ga)if(Ga[i]==e){var i=!0;break e}i=!1}if(!i||"string"!=typeof e)throw t;switch(Xn()){case"ReactNative":if("session"===e)throw n;break;case"Node":if("none"!==e)throw n;break;default:if(!si()&&"none"!==e)throw n}}(e),xu(this,function(){return e!=n.c.A?n.b.get(n.c,n.a).then(function(i){return t=i,Cu(n,e)}).then(function(){if(n.c=Eu(e),t)return n.b.set(n.c,t,n.a)}):we()})},y(Au,xt),y(Pu,ot),y(Ou,ot),(e=Au.prototype).mb=function(e){return Wu(this,e=this.h.mb(e))},e.pa=function(e){this.W===e||this.m||(this.W=e,ls(this.b,this.W),this.dispatchEvent(new Pu(this.ea())))},e.ea=function(){return this.W},e.Sc=function(){var e=n.navigator;this.pa(e&&(e.languages&&e.languages[0]||e.language||e.userLanguage)||null)},e.tc=function(e){this.G.push(e),us(this.b,qa.SDK_VERSION?ii(qa.SDK_VERSION,this.G):null),this.dispatchEvent(new Ou(this.G))},e.ya=function(){return U(this.G)},e.toJSON=function(){return{apiKey:Mu(this).options.apiKey,authDomain:Mu(this).options.authDomain,appName:Mu(this).name,currentUser:Fu(this)&&Fu(this).C()}},e.vb=function(e,t){switch(e){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==t&&!!this.f;default:return!1}},e.ha=function(e,t,n,i){"signInViaPopup"==e&&this.g==i&&(n&&this.v?this.v(n):t&&!n&&this.f&&this.f(t),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.v)},e.xa=function(e,t){return"signInViaRedirect"==e||"signInViaPopup"==e&&this.g==t&&this.f?v(this.ac,this):null},e.ac=function(e,t,n){var i=this;e={requestUri:e,postBody:n,sessionId:t},this.c&&(this.c.cancel(),this.c=null);var r=null,o=null,s=ws(i.b,e).then(function(e){return r=Gr(e),o=hr(e),e});return Wu(this,e=i.V.then(function(){return s}).then(function(e){return Lu(i,e)}).then(function(){return ki({user:Fu(i),credential:r,additionalUserInfo:o,operationType:"signIn"})}))},e.Kc=function(e){if(!ai())return Ce(new Fi("operation-not-supported-in-this-environment"));var t=this,n=cr(e.providerId),i=fi(),r=null;(!ci()||Yn())&&Mu(this).options.authDomain&&e.isOAuthProvider&&(r=pa(Mu(this).options.authDomain,Mu(this).options.apiKey,Mu(this).name,"signInViaPopup",e,null,i,qa.SDK_VERSION||null));var o=$n(r,n&&n.Ba,n&&n.Aa);return Wu(this,n=Nu(this).then(function(t){return Il(t,o,"signInViaPopup",e,i,!!r)}).then(function(){return new fe(function(e,n){t.ha("signInViaPopup",null,new Fi("cancelled-popup-request"),t.g),t.f=e,t.v=n,t.g=i,t.c=t.a.Ea(t,"signInViaPopup",o,i)})}).then(function(e){return o&&Hn(o),e?ki(e):null}).s(function(e){throw o&&Hn(o),e}))},e.Lc=function(e){if(!ai())return Ce(new Fi("operation-not-supported-in-this-environment"));var t=this;return Wu(this,Nu(this).then(function(){return xu(e=t.h,function(){return e.b.set(Tu,e.c.A,e.a)});var e}).then(function(){return t.a.Ca("signInViaRedirect",e)}))},e.fa=function(){if(!ai())return Ce(new Fi("operation-not-supported-in-this-environment"));var e=this;return Wu(this,Nu(this).then(function(){return e.a.fa()}).then(function(e){return e?ki(e):null}))},e.Qc=function(e){if(!e)return Ce(new Fi("null-user"));var t=this,n={};n.apiKey=Mu(this).options.apiKey,n.authDomain=Mu(this).options.authDomain,n.appName=Mu(this).name;var i=function(e,t,n,i){t=t||{apiKey:e.m,authDomain:e.u,appName:e.o};var r=e.h,o={};return o[is]=r.b,o.refreshToken=r.a,o.expiresIn=(r.c-_())/1e3,t=new Gl(t,o),n&&(t.ba=n),i&&ql(t,i),lu(t,e),t}(e,n,t.w,t.ya());return Wu(this,this.i.then(function(){if(Mu(t).options.apiKey!=e.m)return i.reload()}).then(function(){return Fu(t)&&e.uid==Fu(t).uid?(lu(Fu(t),e),t.Z(e)):(Du(t,i),eu(i),t.Z(i))}).then(function(){Uu(t)}))},e.nb=function(){var e=this;return Wu(this,this.i.then(function(){return Fu(e)?(Du(e,null),Iu(e.h).then(function(){Uu(e)})):we()}))},e.Mc=function(){var e=this;return ku(this.h,Mu(this).options.authDomain).then(function(t){if(!e.m){var n;if(n=Fu(e)&&t){n=Fu(e).uid;var i=t.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==i&&null!==i&&""!==i&&n==i}if(n)return lu(Fu(e),t),Fu(e).F();(Fu(e)||t)&&(Du(e,t),t&&(eu(t),t.ba=e.w),e.a&&e.a.subscribe(e),Uu(e))}})},e.Z=function(e){return Su(this.h,e)},e.bc=function(){Uu(this),this.Z(Fu(this))},e.jc=function(){this.nb()},e.kc=function(){this.nb()},e.mc=function(e){var t=this;this.addAuthTokenListener(function(){e.next(Fu(t))})},e.nc=function(e){var t=this;!function(e,t){e.I.push(t),Wu(e,e.i.then(function(){!e.m&&R(e.I,t)&&e.O!==e.getUid()&&(e.O=e.getUid(),t(ju(e)))}))}(this,function(){e.next(Fu(t))})},e.vc=function(e,t,n){var i=this;return this.X&&qa.Promise.resolve().then(function(){c(e)?e(Fu(i)):c(e.next)&&e.next(Fu(i))}),this.Tb(e,t,n)},e.uc=function(e,t,n){var i=this;return this.X&&qa.Promise.resolve().then(function(){i.O=i.getUid(),c(e)?e(Fu(i)):c(e.next)&&e.next(Fu(i))}),this.Ub(e,t,n)},e.cc=function(e){var t=this;return Wu(this,this.i.then(function(){return Fu(t)?Fu(t).F(e).then(function(e){return{accessToken:e}}):null}))},e.Nb=function(e){var t=this;return this.i.then(function(){return Ru(t,Zs(t.b,qs,{token:e}))}).then(function(e){var n=e.user;return au(n,"isAnonymous",!1),t.Z(n),e})},e.Ec=function(e){return Ti("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCustomToken is deprecated. Please use firebase.auth.Auth.prototype.signInWithCustomToken instead."),this.Nb(e)},e.Fc=function(e,t){return Ti("firebase.auth.Auth.prototype.signInAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.signInWithEmailAndPassword instead."),this.Ob(e,t)},e.Ob=function(e,t){var n=this;return this.i.then(function(){return Ru(n,Zs(n.b,Qs,{email:e,password:t}))})},e.xb=function(e,t){var n=this;return this.i.then(function(){return Ru(n,Zs(n.b,ks,{email:e,password:t}))})},e.Wb=function(e,t){return Ti("firebase.auth.Auth.prototype.createUserAndRetrieveDataWithEmailAndPassword is deprecated. Please use firebase.auth.Auth.prototype.createUserWithEmailAndPassword instead."),this.xb(e,t)},e.Hc=function(e){return Ti("firebase.auth.Auth.prototype.signInWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential instead."),this.Pa(e).then(function(e){return e.user})},e.Pa=function(e){var t=this;return this.i.then(function(){return Ru(t,e.la(t.b))})},e.Qa=function(){var e=this;return this.i.then(function(){var t=Fu(e);return t&&t.isAnonymous?ki({user:t,credential:null,additionalUserInfo:ki({providerId:null,isNewUser:!1}),operationType:"signIn"}):Ru(e,e.b.Qa()).then(function(t){var n=t.user;return au(n,"isAnonymous",!0),e.Z(n),t})})},e.Gc=function(){return Ti("firebase.auth.Auth.prototype.signInAnonymouslyAndRetrieveData is deprecated. Please use firebase.auth.Auth.prototype.signInAnonymously instead."),this.Qa()},e.getUid=function(){return Fu(this)&&Fu(this).uid||null},e.Vb=function(e){this.addAuthTokenListener(e),this.u++,0<this.u&&Fu(this)&&zl(Fu(this))},e.Cc=function(e){var t=this;N(this.o,function(n){n==e&&t.u--}),0>this.u&&(this.u=0),0==this.u&&Fu(this)&&Xl(Fu(this)),this.removeAuthTokenListener(e)},e.addAuthTokenListener=function(e){var t=this;this.o.push(e),Wu(this,this.i.then(function(){t.m||R(t.o,e)&&e(ju(t))}))},e.removeAuthTokenListener=function(e){F(this.o,function(t){return t==e})},e.delete=function(){this.m=!0;for(var e=0;e<this.N.length;e++)this.N[e].cancel("app-deleted");return this.N=[],this.h&&(e=this.h).b.removeListener(Eu("local"),e.a,this.ka),this.a&&(this.a.unsubscribe(this),this.a.Ya()),qa.Promise.resolve()},e.Zb=function(e){return Ti("firebase.auth.Auth.prototype.fetchProvidersForEmail is deprecated. Please use firebase.auth.Auth.prototype.fetchSignInMethodsForEmail instead."),Wu(this,function(e,t){return Zs(e,xs,{identifier:t,continueUri:li()?Wn():"http://localhost"}).then(function(e){return e.allProviders||[]})}(this.b,e))},e.$b=function(e){return Wu(this,function(e,t){return Zs(e,xs,{identifier:t,continueUri:li()?Wn():"http://localhost"}).then(function(e){return e.signinMethods||[]})}(this.b,e))},e.oc=function(e){return!!Wr(e)},e.lb=function(e,t){var n=this;return Wu(this,we().then(function(){var e=new Bi(t);if(!e.c)throw new Fi("argument-error",$i+" must be true when sending sign in link to email");return Xi(e)}).then(function(t){return n.b.lb(e,t)}).then(function(){}))},e.Tc=function(e){return this.Ja(e).then(function(e){return e.data.email})},e.Za=function(e,t){return Wu(this,this.b.Za(e,t).then(function(){}))},e.Ja=function(e){return Wu(this,this.b.Ja(e).then(function(e){return new function(e){var t={},n=e[Pi],i=e[Oi];if(!(e=e[Ni])||e!=Ai&&!n)throw Error("Invalid provider user info!");t[Di]=i||null,t[Li]=n||null,Si(this,Mi,e),Si(this,Ri,xi(t))}(e)}))},e.Wa=function(e){return Wu(this,this.b.Wa(e).then(function(){}))},e.kb=function(e,t){var n=this;return Wu(this,we().then(function(){return void 0===t||ie(t)?{}:Xi(new Bi(t))}).then(function(t){return n.b.kb(e,t)}).then(function(){}))},e.Jc=function(e,t){return Wu(this,Fl(this,e,t,v(this.Pa,this)))},e.Ic=function(e,t){var n=this;return Wu(this,we().then(function(){var i=Ur(e,t||Wn());return n.Pa(i)}))},Bu.prototype.render=function(){},Bu.prototype.reset=function(){},Bu.prototype.getResponse=function(){},Bu.prototype.execute=function(){};var Hu=null;function $u(e,t){return(t=Gu(t))&&e.a[t]||null}function Gu(e){return(e=void 0===e?1e12:e)?e.toString():null}function Ku(e,t){this.g=!1,this.c=t,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=Pn(e);var n=this;this.i=function(){n.execute()},this.h?this.execute():vt(this.f,"click",this.i)}function qu(e){if(e.g)throw Error("reCAPTCHA mock was already deleted!")}function Qu(){}Vu.prototype.render=function(e,t){return this.a[this.b.toString()]=new Ku(e,t),this.b++},Vu.prototype.reset=function(e){var t=$u(this,e);e=Gu(e),t&&e&&(t.delete(),delete this.a[e])},Vu.prototype.getResponse=function(e){return(e=$u(this,e))?e.getResponse():null},Vu.prototype.execute=function(e){(e=$u(this,e))&&e.execute()},Ku.prototype.getResponse=function(){return qu(this),this.b},Ku.prototype.execute=function(){qu(this);var e=this;this.a||(this.a=setTimeout(function(){e.b=function(){for(var e=50,t=[];0<e;)t.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),e--;return t.join("")}();var t=e.c.callback,n=e.c["expired-callback"];if(t)try{t(e.b)}catch(e){}e.a=setTimeout(function(){if(e.a=null,e.b=null,n)try{n()}catch(e){}e.h&&e.execute()},6e4)},500))},Ku.prototype.delete=function(){qu(this),this.g=!0,clearTimeout(this.a),this.a=null,yt(this.f,"click",this.i)},Qu.prototype.g=function(){return Hu||(Hu=new Vu),we(Hu)},Qu.prototype.c=function(){};var Yu=null;function zu(){this.b=n.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var Xu=fn("https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Zu=new mi(3e4,6e4);zu.prototype.g=function(e){var t=this;return new fe(function(i,r){var o=setTimeout(function(){r(new Fi("network-request-failed"))},Zu.get());!n.grecaptcha||e!==t.f&&!t.b?(n[t.a]=function(){if(n.grecaptcha){t.f=e;var s=n.grecaptcha.render;n.grecaptcha.render=function(e,n){return e=s(e,n),t.b++,e},clearTimeout(o),i(n.grecaptcha)}else clearTimeout(o),r(new Fi("internal-error"));delete n[t.a]},we(Qo(mn(Xu,{onload:t.a,hl:e||""}))).s(function(){clearTimeout(o),r(new Fi("internal-error","Unable to load external reCAPTCHA dependencies!"))})):(clearTimeout(o),i(n.grecaptcha))})},zu.prototype.c=function(){this.b--};var Ju=null;function ec(e,t,i,r,o,s,a){if(Si(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.m=t,this.g=null,a?(Yu||(Yu=new Qu),a=Yu):(Ju||(Ju=new zu),a=Ju),this.o=a,this.a=i||{theme:"light",type:"image"},this.h=[],this.a[ic])throw new Fi("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[rc],!n.document)throw new Fi("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!Pn(t)||!this.i&&Pn(t).hasChildNodes())throw new Fi("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.u=new ts(e,s||null,o||null),this.v=r||function(){return null};var l=this;this.l=[];var u=this.a[tc];this.a[tc]=function(e){if(oc(l,e),"function"==typeof u)u(e);else if("string"==typeof u){var t=oi(u,n);"function"==typeof t&&t(e)}};var c=this.a[nc];this.a[nc]=function(){if(oc(l,null),"function"==typeof c)c();else if("string"==typeof c){var e=oi(c,n);"function"==typeof e&&e()}}}var tc="callback",nc="expired-callback",ic="sitekey",rc="size";function oc(e,t){for(var n=0;n<e.l.length;n++)try{e.l[n](t)}catch(e){}}function sc(e,t){return e.h.push(t),t.ia(function(){M(e.h,t)}),t}function ac(e){if(e.D)throw new Fi("internal-error","RecaptchaVerifier instance has been destroyed.")}function lc(e,t,n){var i=!1;try{this.b=n||qa.app()}catch(e){throw new Fi("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new Fi("invalid-api-key");n=this.b.options.apiKey;var r=this,o=null;try{o=this.b.auth().ya()}catch(e){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(e){}o=qa.SDK_VERSION?ii(qa.SDK_VERSION,o):null,ec.call(this,n,e,t,function(){try{var e=r.b.auth().ea()}catch(t){e=null}return e},o,sr(rr),i)}function uc(e,t,n,i){e:{n=Array.prototype.slice.call(n);for(var r=0,o=!1,s=0;s<t.length;s++)if(t[s].optional)o=!0;else{if(o)throw new Fi("internal-error","Argument validator encountered a required argument after an optional argument.");r++}if(o=t.length,n.length<r||o<n.length)i="Expected "+(r==o?1==r?"1 argument":r+" arguments":r+"-"+o+" arguments")+" but got "+n.length+".";else{for(r=0;r<n.length;r++)if(o=t[r].optional&&void 0===n[r],!t[r].M(n[r])&&!o){if(t=t[r],0>r||r>=cc.length)throw new Fi("internal-error","Argument validator received an unsupported number of arguments.");n=cc[r],i=(i?"":n+" argument ")+(t.name?'"'+t.name+'" ':"")+"must be "+t.K+".";break e}i=null}}if(i)throw new Fi("argument-error",e+" failed: "+i)}(e=ec.prototype).za=function(){var e=this;return this.f?this.f:this.f=sc(this,we().then(function(){if(li()&&!zn())return qn();throw new Fi("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")}).then(function(){return e.o.g(e.v())}).then(function(t){return e.g=t,Zs(e.u,js,{})}).then(function(t){e.a[ic]=t.recaptchaSiteKey}).s(function(t){throw e.f=null,t}))},e.render=function(){ac(this);var e=this;return sc(this,this.za().then(function(){if(null===e.c){var t=e.m;if(!e.i){var n=Pn(t);t=Ln("DIV"),n.appendChild(t)}e.c=e.g.render(t,e.a)}return e.c}))},e.verify=function(){ac(this);var e=this;return sc(this,this.render().then(function(t){return new fe(function(n){var i=e.g.getResponse(t);if(i)n(i);else{var r=function(t){t&&(function(e,t){F(e.l,function(e){return e==t})}(e,r),n(t))};e.l.push(r),e.i&&e.g.execute(e.c)}})}))},e.reset=function(){ac(this),null!==this.c&&this.g.reset(this.c)},e.clear=function(){ac(this),this.D=!0,this.o.c();for(var e=0;e<this.h.length;e++)this.h[e].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){e=Pn(this.m);for(var t;t=e.firstChild;)e.removeChild(t)}},y(lc,ec);var cc="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function hc(e,t){return{name:e||"",K:"a valid string",optional:!!t,M:i}}function dc(e,t){return{name:e||"",K:"a boolean",optional:!!t,M:r}}function pc(e,t){return{name:e||"",K:"a valid object",optional:!!t,M:h}}function fc(e,t){return{name:e||"",K:"a function",optional:!!t,M:c}}function gc(e,t){return{name:e||"",K:"null",optional:!!t,M:a}}function vc(e){return{name:e?e+"Credential":"credential",K:e?"a valid "+e+" credential":"a valid credential",optional:!1,M:function(t){if(!t)return!1;var n=!e||t.providerId===e;return!(!t.la||!n)}}}function mc(){return{name:"applicationVerifier",K:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,M:function(e){return!!(e&&i(e.type)&&c(e.verify))}}}function _c(e,t,n,i){return{name:n||"",K:e.K+" or "+t.K,optional:!!i,M:function(n){return e.M(n)||t.M(n)}}}function yc(e,t){for(var n in t){var i=t[n].name;e[i]=Cc(i,e[n],t[n].j)}}function bc(e,t){for(var n in t){var i=t[n].name;i!==n&&Object.defineProperty(e,i,{get:m(function(e){return this[e]},n),set:m(function(e,t,n,i){uc(e,[n],[i],!0),this[t]=i},i,n,t[n].tb),enumerable:!0})}}function wc(e,t,n,i){e[t]=Cc(t,n,i)}function Cc(e,t,n){function i(){var e=Array.prototype.slice.call(arguments);return uc(o,n,e),t.apply(this,e)}if(!n)return t;var r,o=function(e){return(e=e.split("."))[e.length-1]}(e);for(r in t)i[r]=t[r];for(r in t.prototype)i.prototype[r]=t.prototype[r];return i}yc(Au.prototype,{Wa:{name:"applyActionCode",j:[hc("code")]},Ja:{name:"checkActionCode",j:[hc("code")]},Za:{name:"confirmPasswordReset",j:[hc("code"),hc("newPassword")]},xb:{name:"createUserWithEmailAndPassword",j:[hc("email"),hc("password")]},Wb:{name:"createUserAndRetrieveDataWithEmailAndPassword",j:[hc("email"),hc("password")]},Zb:{name:"fetchProvidersForEmail",j:[hc("email")]},$b:{name:"fetchSignInMethodsForEmail",j:[hc("email")]},fa:{name:"getRedirectResult",j:[]},oc:{name:"isSignInWithEmailLink",j:[hc("emailLink")]},uc:{name:"onAuthStateChanged",j:[_c(pc(),fc(),"nextOrObserver"),fc("opt_error",!0),fc("opt_completed",!0)]},vc:{name:"onIdTokenChanged",j:[_c(pc(),fc(),"nextOrObserver"),fc("opt_error",!0),fc("opt_completed",!0)]},kb:{name:"sendPasswordResetEmail",j:[hc("email"),_c(pc("opt_actionCodeSettings",!0),gc(null,!0),"opt_actionCodeSettings",!0)]},lb:{name:"sendSignInLinkToEmail",j:[hc("email"),pc("actionCodeSettings")]},mb:{name:"setPersistence",j:[hc("persistence")]},Pa:{name:"signInAndRetrieveDataWithCredential",j:[vc()]},Qa:{name:"signInAnonymously",j:[]},Gc:{name:"signInAnonymouslyAndRetrieveData",j:[]},Hc:{name:"signInWithCredential",j:[vc()]},Nb:{name:"signInWithCustomToken",j:[hc("token")]},Ec:{name:"signInAndRetrieveDataWithCustomToken",j:[hc("token")]},Ob:{name:"signInWithEmailAndPassword",j:[hc("email"),hc("password")]},Ic:{name:"signInWithEmailLink",j:[hc("email"),hc("emailLink",!0)]},Fc:{name:"signInAndRetrieveDataWithEmailAndPassword",j:[hc("email"),hc("password")]},Jc:{name:"signInWithPhoneNumber",j:[hc("phoneNumber"),mc()]},Kc:{name:"signInWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}]},Lc:{name:"signInWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}]},Qc:{name:"updateCurrentUser",j:[_c({name:"user",K:"an instance of Firebase User",optional:!1,M:function(e){return!!(e&&e instanceof Gl)}},gc(),"user")]},nb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[hc(null,!0)]},Sc:{name:"useDeviceLanguage",j:[]},Tc:{name:"verifyPasswordResetCode",j:[hc("code")]}}),bc(Au.prototype,{lc:{name:"languageCode",tb:_c(hc(),gc(),"languageCode")}}),Au.Persistence=Ga,Au.Persistence.LOCAL="local",Au.Persistence.SESSION="session",Au.Persistence.NONE="none",yc(Gl.prototype,{delete:{name:"delete",j:[]},dc:{name:"getIdTokenResult",j:[dc("opt_forceRefresh",!0)]},F:{name:"getIdToken",j:[dc("opt_forceRefresh",!0)]},eb:{name:"linkAndRetrieveDataWithCredential",j:[vc()]},pc:{name:"linkWithCredential",j:[vc()]},qc:{name:"linkWithPhoneNumber",j:[hc("phoneNumber"),mc()]},rc:{name:"linkWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}]},sc:{name:"linkWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}]},gb:{name:"reauthenticateAndRetrieveDataWithCredential",j:[vc()]},yc:{name:"reauthenticateWithCredential",j:[vc()]},zc:{name:"reauthenticateWithPhoneNumber",j:[hc("phoneNumber"),mc()]},Ac:{name:"reauthenticateWithPopup",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}]},Bc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",K:"a valid Auth provider",optional:!1,M:function(e){return!!(e&&e.providerId&&e.hasOwnProperty&&e.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},jb:{name:"sendEmailVerification",j:[_c(pc("opt_actionCodeSettings",!0),gc(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[hc(null,!0)]},Pc:{name:"unlink",j:[hc("provider")]},pb:{name:"updateEmail",j:[hc("email")]},qb:{name:"updatePassword",j:[hc("password")]},Rc:{name:"updatePhoneNumber",j:[vc("phone")]},rb:{name:"updateProfile",j:[pc("profile")]}}),yc(Vu.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),yc(Bu.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),yc(fe.prototype,{ia:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),bc(Rl.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",tb:dc("appVerificationDisabledForTesting")}}),yc(Ml.prototype,{confirm:{name:"confirm",j:[hc("verificationCode")]}}),wc(jr,"credential",function(e,t){return new Fr(e,t)},[hc("email"),hc("password")]),yc(Ar.prototype,{ua:{name:"addScope",j:[hc("scope")]},Da:{name:"setCustomParameters",j:[pc("customOAuthParameters")]}}),wc(Ar,"credential",Pr,[_c(hc(),pc(),"token")]),wc(jr,"credentialWithLink",Ur,[hc("email"),hc("emailLink")]),yc(Or.prototype,{ua:{name:"addScope",j:[hc("scope")]},Da:{name:"setCustomParameters",j:[pc("customOAuthParameters")]}}),wc(Or,"credential",Nr,[_c(hc(),pc(),"token")]),yc(Lr.prototype,{ua:{name:"addScope",j:[hc("scope")]},Da:{name:"setCustomParameters",j:[pc("customOAuthParameters")]}}),wc(Lr,"credential",Dr,[_c(hc(),_c(pc(),gc()),"idToken"),_c(hc(),gc(),"accessToken",!0)]),yc(Rr.prototype,{Da:{name:"setCustomParameters",j:[pc("customOAuthParameters")]}}),wc(Rr,"credential",Mr,[_c(hc(),pc(),"token"),hc("secret",!0)]),yc(xr.prototype,{ua:{name:"addScope",j:[hc("scope")]},credential:{name:"credential",j:[_c(hc(),gc(),"idToken",!0),_c(hc(),gc(),"accessToken",!0),_c(hc(),gc(),"nonce",!0)]},Da:{name:"setCustomParameters",j:[pc("customOAuthParameters")]}}),wc(Hr,"credential",$r,[hc("verificationId"),hc("verificationCode")]),yc(Hr.prototype,{Ua:{name:"verifyPhoneNumber",j:[hc("phoneNumber"),mc()]}}),yc(Fi.prototype,{toJSON:{name:"toJSON",j:[hc(null,!0)]}}),yc(Jr.prototype,{toJSON:{name:"toJSON",j:[hc(null,!0)]}}),yc(Zr.prototype,{toJSON:{name:"toJSON",j:[hc(null,!0)]}}),yc(lc.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),function(){if(void 0===qa||!qa.INTERNAL||!qa.INTERNAL.registerService)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var e={Auth:Au,Error:Fi};wc(e,"EmailAuthProvider",jr,[]),wc(e,"FacebookAuthProvider",Ar,[]),wc(e,"GithubAuthProvider",Or,[]),wc(e,"GoogleAuthProvider",Lr,[]),wc(e,"TwitterAuthProvider",Rr,[]),wc(e,"OAuthProvider",xr,[hc("providerId")]),wc(e,"SAMLAuthProvider",kr,[hc("providerId")]),wc(e,"PhoneAuthProvider",Hr,[{name:"auth",K:"an instance of Firebase Auth",optional:!0,M:function(e){return!!(e&&e instanceof Au)}}]),wc(e,"RecaptchaVerifier",lc,[_c(hc(),{name:"",K:"an HTML element",optional:!1,M:function(e){return!!(e&&e instanceof Element)}},"recaptchaContainer"),pc("recaptchaParameters",!0),{name:"app",K:"an instance of Firebase App",optional:!0,M:function(e){return!!(e&&e instanceof qa.app.App)}}]),qa.INTERNAL.registerService("auth",function(e,t){return t({INTERNAL:{getUid:v((e=new Au(e)).getUid,e),getToken:v(e.cc,e),addAuthTokenListener:v(e.Vb,e),removeAuthTokenListener:v(e.Cc,e)}}),e},e,function(e,t){if("create"===e)try{t.auth()}catch(e){}}),qa.INTERNAL.extendNamespace({User:Gl})}()}).apply("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ja,el=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(Ja||(Ja={}));var tl=Ja.INFO,nl=function(e,t){for(var n=arguments,i=[],r=2;r<arguments.length;r++)i[r-2]=n[r];if(!(t<e.logLevel)){var o=(new Date).toISOString();switch(t){case Ja.DEBUG:case Ja.VERBOSE:console.log.apply(console,["["+o+"] "+e.name+":"].concat(i));break;case Ja.INFO:console.info.apply(console,["["+o+"] "+e.name+":"].concat(i));break;case Ja.WARN:console.warn.apply(console,["["+o+"] "+e.name+":"].concat(i));break;case Ja.ERROR:console.error.apply(console,["["+o+"] "+e.name+":"].concat(i));break;default:throw new Error("Attempted to log a message with an invalid logType (value: "+t+")")}}},il=function(){function e(e){this.name=e,this._logLevel=tl,this._logHandler=nl,el.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in Ja))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!0,configurable:!0}),e.prototype.debug=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this._logHandler.apply(this,[this,Ja.DEBUG].concat(t))},e.prototype.log=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this._logHandler.apply(this,[this,Ja.VERBOSE].concat(t))},e.prototype.info=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this._logHandler.apply(this,[this,Ja.INFO].concat(t))},e.prototype.warn=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this._logHandler.apply(this,[this,Ja.WARN].concat(t))},e.prototype.error=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];this._logHandler.apply(this,[this,Ja.ERROR].concat(t))},e}();var rl=Object.freeze({setLogLevel:function(e){el.forEach(function(t){t.logLevel=e})},Logger:il,get LogLevel(){return Ja}}),ol=rl,sl=Ze(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n,i,r=(n=za)&&"object"==typeof n&&"default"in n?n.default:n,o=function(){function e(e){this.domStorage_=e,this.prefix_="firebase:"}return e.prototype.set=function(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),Ga.stringify(t))},e.prototype.get=function(e){var t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:Ga.jsonEval(t)},e.prototype.remove=function(e){this.domStorage_.removeItem(this.prefixedName_(e))},e.prototype.prefixedName_=function(e){return this.prefix_+e},e.prototype.toString=function(){return this.domStorage_.toString()},e}(),s=function(){function e(){this.cache_={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t},e.prototype.get=function(e){return Ga.contains(this.cache_,e)?this.cache_[e]:null},e.prototype.remove=function(e){delete this.cache_[e]},e}(),a=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new o(t)}}catch(e){}return new s},l=a("localStorage"),u=a("sessionStorage"),c=new ol.Logger("@firebase/database"),h=(i=1,function(){return i++}),d=function(e){var t=Ga.stringToByteArray(e),n=new Ga.Sha1;n.update(t);var i=n.digest();return Ga.base64.encodeByteArray(i)},p=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var i="",r=0;r<t.length;r++)Array.isArray(t[r])||t[r]&&"object"==typeof t[r]&&"number"==typeof t[r].length?i+=p.apply(null,t[r]):"object"==typeof t[r]?i+=Ga.stringify(t[r]):i+=t[r],i+=" ";return i},f=null,g=!0,v=function(e,t){Ga.assert(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(c.logLevel=ol.LogLevel.VERBOSE,f=c.log.bind(c),t&&u.set("logging_enabled",!0)):"function"==typeof e?f=e:(f=null,u.remove("logging_enabled"))},m=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];if(!0===g&&(g=!1,null===f&&!0===u.get("logging_enabled")&&v(!0)),f){var i=p.apply(null,t);f(i)}},_=function(e){return function(){for(var t=arguments,n=[],i=0;i<arguments.length;i++)n[i]=t[i];m.apply(void 0,[e].concat(n))}},y=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];var i="FIREBASE INTERNAL ERROR: "+p.apply(void 0,t);c.error(i)},b=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];var i="FIREBASE FATAL ERROR: "+p.apply(void 0,t);throw c.error(i),new Error(i)},w=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];var i="FIREBASE WARNING: "+p.apply(void 0,t);c.warn(i)},C=function(e){return"number"==typeof e&&(e!=e||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY)},T="[MIN_NAME]",E="[MAX_NAME]",S=function(e,t){if(e===t)return 0;if(e===T||t===E)return-1;if(t===T||e===E)return 1;var n=L(e),i=L(t);return null!==n?null!==i?n-i==0?e.length-t.length:n-i:-1:null!==i?1:e<t?-1:1},I=function(e,t){return e===t?0:e<t?-1:1},k=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+Ga.stringify(t))},x=function(e){if("object"!=typeof e||null===e)return Ga.stringify(e);var t=[];for(var n in e)t.push(n);t.sort();for(var i="{",r=0;r<t.length;r++)0!==r&&(i+=","),i+=Ga.stringify(t[r]),i+=":",i+=x(e[t[r]]);return i+="}"},A=function(e,t){var n=e.length;if(n<=t)return[e];for(var i=[],r=0;r<n;r+=t)r+t>n?i.push(e.substring(r,n)):i.push(e.substring(r,r+t));return i},P=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;++n)t(n,e[n]);else Ga.forEach(e,function(e,n){return t(n,e)})},O=function(e){Ga.assert(!C(e),"Invalid JSON number");var t,n,i,r,o,s,a;for(0===e?(n=0,i=0,t=1/e==-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(n=(r=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,i=Math.round(e*Math.pow(2,52-r)-Math.pow(2,52))):(n=0,i=Math.round(e/Math.pow(2,-1074)))),s=[],o=52;o;o-=1)s.push(i%2?1:0),i=Math.floor(i/2);for(o=11;o;o-=1)s.push(n%2?1:0),n=Math.floor(n/2);s.push(t?1:0),s.reverse(),a=s.join("");var l="";for(o=0;o<64;o+=8){var u=parseInt(a.substr(o,8),2).toString(16);1===u.length&&(u="0"+u),l+=u}return l.toLowerCase()},N=new RegExp("^-?\\d{1,10}$"),L=function(e){if(N.test(e)){var t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},D=function(e){try{e()}catch(e){setTimeout(function(){var t=e.stack||"";throw w("Exception was thrown by user callback.",t),e},Math.floor(0))}},R=function(){return("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},M=function(e,t){var n=setTimeout(e,t);return"object"==typeof n&&n.unref&&n.unref(),n},F=function(){function e(e,t){if(void 0===t){this.pieces_=e.split("/");for(var n=0,i=0;i<this.pieces_.length;i++)this.pieces_[i].length>0&&(this.pieces_[n]=this.pieces_[i],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!0,configurable:!0}),e.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},e.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},e.prototype.popFront=function(){var t=this.pieceNum_;return t<this.pieces_.length&&t++,new e(this.pieces_,t)},e.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"},e.prototype.toUrlEncodedString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+encodeURIComponent(String(this.pieces_[t])));return e||"/"},e.prototype.slice=function(e){return void 0===e&&(e=0),this.pieces_.slice(this.pieceNum_+e)},e.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var t=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)t.push(this.pieces_[n]);return new e(t,0)},e.prototype.child=function(t){for(var n=[],i=this.pieceNum_;i<this.pieces_.length;i++)n.push(this.pieces_[i]);if(t instanceof e)for(i=t.pieceNum_;i<t.pieces_.length;i++)n.push(t.pieces_[i]);else{var r=t.split("/");for(i=0;i<r.length;i++)r[i].length>0&&n.push(r[i])}return new e(n,0)},e.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},e.relativePath=function(t,n){var i=t.getFront(),r=n.getFront();if(null===i)return n;if(i===r)return e.relativePath(t.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),i=t.slice(),r=0;r<n.length&&r<i.length;r++){var o=S(n[r],i[r]);if(0!==o)return o}return n.length===i.length?0:n.length<i.length?-1:1},e.prototype.equals=function(e){if(this.getLength()!==e.getLength())return!1;for(var t=this.pieceNum_,n=e.pieceNum_;t<=this.pieces_.length;t++,n++)if(this.pieces_[t]!==e.pieces_[n])return!1;return!0},e.prototype.contains=function(e){var t=this.pieceNum_,n=e.pieceNum_;if(this.getLength()>e.getLength())return!1;for(;t<this.pieces_.length;){if(this.pieces_[t]!==e.pieces_[n])return!1;++t,++n}return!0},e}(),j=function(){function e(e,t){this.errorPrefix_=t,this.parts_=e.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=Ga.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(e,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(e,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),e.prototype.push=function(e){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(e),this.byteLength_+=Ga.stringLength(e),this.checkValid_()},e.prototype.pop=function(){var e=this.parts_.pop();this.byteLength_-=Ga.stringLength(e),this.parts_.length>0&&(this.byteLength_-=1)},e.prototype.checkValid_=function(){if(this.byteLength_>e.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>e.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0==this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},e}(),U="long_polling",W=function(){function e(e,t,n,i,r){void 0===r&&(r=""),this.secure=t,this.namespace=n,this.webSocketOnly=i,this.persistenceKey=r,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=l.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&l.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){var n;if(Ga.assert("string"==typeof e,"typeof type must == string"),Ga.assert("object"==typeof t,"typeof params must == object"),"websocket"===e)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(e!==U)throw new Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var i=[];return Ga.forEach(t,function(e,t){i.push(e+"="+t)}),n+i.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();var B,V,H,$,G,K=function(e){var t=q(e),n=t.subdomain;"firebase"===t.domain&&b(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||"localhost"===t.domain||b("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&w("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var i="ws"===t.scheme||"wss"===t.scheme;return{repoInfo:new W(t.host,t.secure,n,i),path:new F(t.pathString)}},q=function(e){var t="",n="",i="",r="",o=!0,s="https",a=443;if("string"==typeof e){var l=e.indexOf("//");l>=0&&(s=e.substring(0,l-1),e=e.substring(l+2));var u=e.indexOf("/");-1===u&&(u=e.length);var c=e.indexOf("?");-1===c&&(c=e.length),t=e.substring(0,Math.min(u,c)),u<c&&(r=function(e){for(var t="",n=e.split("/"),i=0;i<n.length;i++)if(n[i].length>0){var r=n[i];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch(e){}t+="/"+r}return t}(e.substring(u,c)));var h=function(e){var t={};"?"===e.charAt(0)&&(e=e.substring(1));for(var n=0,i=e.split("&");n<i.length;n++){var r=i[n];if(0!==r.length){var o=r.split("=");2===o.length?t[decodeURIComponent(o[0])]=decodeURIComponent(o[1]):w("Invalid query segment '"+r+"' in query '"+e+"'")}}return t}(e.substring(Math.min(e.length,c)));(l=t.indexOf(":"))>=0?(o="https"===s||"wss"===s,a=parseInt(t.substring(l+1),10)):l=e.length;var d=t.split(".");3===d.length?(n=d[1],i=d[0].toLowerCase()):2===d.length?n=d[0]:"localhost"===d[0].slice(0,l).toLowerCase()&&(n="localhost"),""===i&&"ns"in h&&(i=h.ns)}return{host:t,port:a,domain:n,subdomain:i,secure:o,scheme:s,pathString:r}},Q=/[\[\].#$\/\u0000-\u001F\u007F]/,Y=/[\[\].#$\u0000-\u001F\u007F]/,z=function(e){return"string"==typeof e&&0!==e.length&&!Q.test(e)},X=function(e){return"string"==typeof e&&0!==e.length&&!Y.test(e)},Z=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!C(e)||e&&"object"==typeof e&&Ga.contains(e,".sv")},J=function(e,t,n,i,r){r&&void 0===n||ee(Ga.errorPrefix(e,t,r),n,i)},ee=function(e,t,n){var i=n instanceof F?new j(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+i.toErrorString());if("function"==typeof t)throw new Error(e+"contains a function "+i.toErrorString()+" with contents = "+t.toString());if(C(t))throw new Error(e+"contains "+t.toString()+" "+i.toErrorString());if("string"==typeof t&&t.length>10485760/3&&Ga.stringLength(t)>10485760)throw new Error(e+"contains a string greater than 10485760 utf8 bytes "+i.toErrorString()+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){var r=!1,o=!1;if(Ga.forEach(t,function(t,n){if(".value"===t)r=!0;else if(".priority"!==t&&".sv"!==t&&(o=!0,!z(t)))throw new Error(e+" contains an invalid key ("+t+") "+i.toErrorString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');i.push(t),ee(e,n,i),i.pop()}),r&&o)throw new Error(e+' contains ".value" child '+i.toErrorString()+" in addition to actual children.")}},te=function(e,t,n,i,r){if(!r||void 0!==n){var o=Ga.errorPrefix(e,t,r);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var s=[];Ga.forEach(n,function(e,t){var n=new F(e);if(ee(o,t,i.child(n)),".priority"===n.getBack()&&!Z(t))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");s.push(n)}),function(e,t){var n,i;for(n=0;n<t.length;n++)for(var r=(i=t[n]).slice(),o=0;o<r.length;o++)if(".priority"===r[o]&&o===r.length-1);else if(!z(r[o]))throw new Error(e+"contains an invalid key ("+r[o]+") in path "+i.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');t.sort(F.comparePaths);var s=null;for(n=0;n<t.length;n++){if(i=t[n],null!==s&&s.contains(i))throw new Error(e+"contains a path "+s.toString()+" that is ancestor of another path "+i.toString());s=i}}(o,s)}},ne=function(e,t,n,i){if(!i||void 0!==n){if(C(n))throw new Error(Ga.errorPrefix(e,t,i)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Z(n))throw new Error(Ga.errorPrefix(e,t,i)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},ie=function(e,t,n,i){if(!i||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(Ga.errorPrefix(e,t,i)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},re=function(e,t,n,i){if(!(i&&void 0===n||z(n)))throw new Error(Ga.errorPrefix(e,t,i)+'was an invalid key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},oe=function(e,t,n,i){if(!(i&&void 0===n||X(n)))throw new Error(Ga.errorPrefix(e,t,i)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},se=function(e,t){if(".info"===t.getFront())throw new Error(e+" failed = Can't modify data under /.info/")},ae=function(e,t,n){var i=n.path.toString();if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!z(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==i.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),X(e)}(i))throw new Error(Ga.errorPrefix(e,t,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},le=function(){function e(e,t){this.repo_=e,this.path_=t}return e.prototype.cancel=function(e){Ga.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),Ga.validateCallback("OnDisconnect.cancel",1,e,!0);var t=new Ga.Deferred;return this.repo_.onDisconnectCancel(this.path_,t.wrapCallback(e)),t.promise},e.prototype.remove=function(e){Ga.validateArgCount("OnDisconnect.remove",0,1,arguments.length),se("OnDisconnect.remove",this.path_),Ga.validateCallback("OnDisconnect.remove",1,e,!0);var t=new Ga.Deferred;return this.repo_.onDisconnectSet(this.path_,null,t.wrapCallback(e)),t.promise},e.prototype.set=function(e,t){Ga.validateArgCount("OnDisconnect.set",1,2,arguments.length),se("OnDisconnect.set",this.path_),J("OnDisconnect.set",1,e,this.path_,!1),Ga.validateCallback("OnDisconnect.set",2,t,!0);var n=new Ga.Deferred;return this.repo_.onDisconnectSet(this.path_,e,n.wrapCallback(t)),n.promise},e.prototype.setWithPriority=function(e,t,n){Ga.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),se("OnDisconnect.setWithPriority",this.path_),J("OnDisconnect.setWithPriority",1,e,this.path_,!1),ne("OnDisconnect.setWithPriority",2,t,!1),Ga.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var i=new Ga.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,e,t,i.wrapCallback(n)),i.promise},e.prototype.update=function(e,t){if(Ga.validateArgCount("OnDisconnect.update",1,2,arguments.length),se("OnDisconnect.update",this.path_),Array.isArray(e)){for(var n={},i=0;i<e.length;++i)n[""+i]=e[i];e=n,w("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}te("OnDisconnect.update",1,e,this.path_,!1),Ga.validateCallback("OnDisconnect.update",2,t,!0);var r=new Ga.Deferred;return this.repo_.onDisconnectUpdate(this.path_,e,r.wrapCallback(t)),r.promise},e}(),ue=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return Ga.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}(),ce=(B="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",V=0,H=[],function(e){var t,n=e===V;V=e;var i=new Array(8);for(t=7;t>=0;t--)i[t]=B.charAt(e%64),e=Math.floor(e/64);Ga.assert(0===e,"Cannot push at time == 0");var r=i.join("");if(n){for(t=11;t>=0&&63===H[t];t--)H[t]=0;H[t]++}else for(t=0;t<12;t++)H[t]=Math.floor(64*Math.random());for(t=0;t<12;t++)r+=B.charAt(H[t]);return Ga.assert(20===r.length,"nextPushId: Length should be 20."),r}),he=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}(),de=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new he(T,e),i=new he(T,t);return 0!==this.compare(n,i)},e.prototype.minPost=function(){return he.MIN},e}(),pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Gs.__extends(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return $},set:function(e){$=e},enumerable:!0,configurable:!0}),t.prototype.compare=function(e,t){return S(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw Ga.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return he.MIN},t.prototype.maxPost=function(){return new he(E,$)},t.prototype.makePost=function(e,t){return Ga.assert("string"==typeof e,"KeyIndex indexValue must always be a string."),new he(e,$)},t.prototype.toString=function(){return".key"},t}(de),fe=new pe;var ge,ve,me,_e=function(e){return"number"==typeof e?"number:"+O(e):"string:"+e},ye=function(e){if(e.isLeafNode()){var t=e.val();Ga.assert("string"==typeof t||"number"==typeof t||"object"==typeof t&&Ga.contains(t,".sv"),"Priority must be a string or number.")}else Ga.assert(e===G||e.isEmpty(),"priority of unexpected type.");Ga.assert(e===G||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},be=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,Ga.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),ye(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return ge},set:function(e){ge=e},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var i=t.getFront();return null===i?n:n.isEmpty()&&".priority"!==i?this:(Ga.assert(".priority"!==i||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(i,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+_e(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?O(this.value_):this.value_,this.lazyHash_=d(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(Ga.assert(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,i=typeof this.value_,r=e.VALUE_TYPE_ORDER.indexOf(n),o=e.VALUE_TYPE_ORDER.indexOf(i);return Ga.assert(r>=0,"Unknown leaf type: "+n),Ga.assert(o>=0,"Unknown leaf type: "+i),r===o?"object"===i?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:o-r},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode()){var t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();var we,Ce,Te=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Gs.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),i=t.node.getPriority(),r=n.compareTo(i);return 0===r?S(e.name,t.name):r},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return he.MIN},t.prototype.maxPost=function(){return new he(E,new be("[PRIORITY-POST]",me))},t.prototype.makePost=function(e,t){var n=ve(e);return new he(t,new be("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(de)),Ee=function(){function e(e,t,n,i,r){void 0===r&&(r=null),this.isReverse_=i,this.resultGenerator_=r,this.nodeStack_=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,i&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.nodeStack_.length>0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),Se=function(){function e(t,n,i,r,o){this.key=t,this.value=n,this.color=null!=i?i:e.RED,this.left=null!=r?r:ke.EMPTY_NODE,this.right=null!=o?o:ke.EMPTY_NODE}return e.prototype.copy=function(t,n,i,r,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=i?i:this.color,null!=r?r:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var i,r;return(r=(i=n(e,(r=this).key))<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return ke.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var n,i;if(t(e,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return ke.EMPTY_NODE;i=n.right.min_(),n=n.copy(i.key,i.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight_())).rotateLeft_()).colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){var e;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");if((e=this.left.check_())!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Ie=function(){function e(){}return e.prototype.copy=function(e,t,n,i,r){return this},e.prototype.insert=function(e,t,n){return new Se(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),ke=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,Se.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,Se.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,i=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return i?i.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(i=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new Ee(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new Ee(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new Ee(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new Ee(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Ie,e}(),xe=Math.log(2),Ae=function(){function e(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/xe,10)),this.current_=this.count-1;var n,i=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=e+1&i}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<<this.current_);return this.current_--,e},e}(),Pe=function(e,t,n,i){e.sort(t);var r=function(t,i){var o,s,a=i-t;if(0==a)return null;if(1==a)return o=e[t],s=n?n(o):o,new Se(s,o.node,Se.BLACK,null,null);var l=parseInt(a/2,10)+t,u=r(t,l),c=r(l+1,i);return o=e[l],s=n?n(o):o,new Se(s,o.node,Se.BLACK,u,c)},o=function(t){for(var i=null,o=null,s=e.length,a=function(t,i){var o=s-t,a=s;s-=t;var u=r(o+1,a),c=e[o],h=n?n(c):c;l(new Se(h,c.node,i,null,u))},l=function(e){i?(i.left=e,i=e):(o=e,i=e)},u=0;u<t.count;++u){var c=t.nextBitIsOne(),h=Math.pow(2,t.count-(u+1));c?a(h,Se.BLACK):(a(h,Se.BLACK),a(h,Se.RED))}return o}(new Ae(e.length));return new ke(i||t,o)},Oe={},Ne=function(){function e(e,t){this.indexes_=e,this.indexSet_=t}return Object.defineProperty(e,"Default",{get:function(){return Ga.assert(Oe&&Te,"ChildrenNode.ts has not been loaded"),we=we||new e({".priority":Oe},{".priority":Te})},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var t=Ga.safeGet(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t===Oe?null:t},e.prototype.hasIndex=function(e){return Ga.contains(this.indexSet_,e.toString())},e.prototype.addIndex=function(t,n){Ga.assert(t!==fe,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var i,r=[],o=!1,s=n.getIterator(he.Wrap),a=s.getNext();a;)o=o||t.isDefinedOn(a.node),r.push(a),a=s.getNext();i=o?Pe(r,t.getCompare()):Oe;var l=t.toString(),u=Ga.clone(this.indexSet_);u[l]=t;var c=Ga.clone(this.indexes_);return c[l]=i,new e(c,u)},e.prototype.addToIndexes=function(t,n){var i=this;return new e(Ga.map(this.indexes_,function(e,r){var o=Ga.safeGet(i.indexSet_,r);if(Ga.assert(o,"Missing index implementation for "+r),e===Oe){if(o.isDefinedOn(t.node)){for(var s=[],a=n.getIterator(he.Wrap),l=a.getNext();l;)l.name!=t.name&&s.push(l),l=a.getNext();return s.push(t),Pe(s,o.getCompare())}return Oe}var u=n.get(t.name),c=e;return u&&(c=c.remove(new he(t.name,u))),c.insert(t,t.node)}),this.indexSet_)},e.prototype.removeFromIndexes=function(t,n){return new e(Ga.map(this.indexes_,function(e){if(e===Oe)return e;var i=n.get(t.name);return i?e.remove(new he(t.name,i)):e}),this.indexSet_)},e}();function Le(e,t){return S(e.name,t.name)}function De(e,t){return S(e,t)}var Re=function(){function e(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&ye(this.priorityNode_),this.children_.isEmpty()&&Ga.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return Ce||(Ce=new e(new ke(De),null,Ne.Default))},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.priorityNode_||Ce},e.prototype.updatePriority=function(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this.children_.get(e);return null===t?Ce:t},e.prototype.getChild=function(e){var t=e.getFront();return null===t?this:this.getImmediateChild(t).getChild(e.popFront())},e.prototype.hasChild=function(e){return null!==this.children_.get(e)},e.prototype.updateImmediateChild=function(t,n){if(Ga.assert(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var i=new he(t,n),r=void 0,o=void 0;return n.isEmpty()?(r=this.children_.remove(t),o=this.indexMap_.removeFromIndexes(i,this.children_)):(r=this.children_.insert(t,n),o=this.indexMap_.addToIndexes(i,this.children_)),new e(r,r.isEmpty()?Ce:this.priorityNode_,o)},e.prototype.updateChild=function(e,t){var n=e.getFront();if(null===n)return t;Ga.assert(".priority"!==e.getFront()||1===e.getLength(),".priority must be the last token in a path");var i=this.getImmediateChild(n).updateChild(e.popFront(),t);return this.updateImmediateChild(n,i)},e.prototype.isEmpty=function(){return this.children_.isEmpty()},e.prototype.numChildren=function(){return this.children_.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},i=0,r=0,o=!0;if(this.forEachChild(Te,function(s,a){n[s]=a.val(t),i++,o&&e.INTEGER_REGEXP_.test(s)?r=Math.max(r,Number(s)):o=!1}),!t&&o&&r<2*i){var s=[];for(var a in n)s[a]=n[a];return s}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.getPriority().isEmpty()||(e+="priority:"+_e(this.getPriority().val())+":"),this.forEachChild(Te,function(t,n){var i=n.hash();""!==i&&(e+=":"+t+":"+i)}),this.lazyHash_=""===e?"":d(e)}return this.lazyHash_},e.prototype.getPredecessorChildName=function(e,t,n){var i=this.resolveIndex_(n);if(i){var r=i.getPredecessorKey(new he(e,t));return r?r.name:null}return this.children_.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.minKey();return n&&n.name}return this.children_.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new he(t,this.children_.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.maxKey();return n&&n.name}return this.children_.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new he(t,this.children_.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.resolveIndex_(e);return n?n.inorderTraversal(function(e){return t(e.name,e.node)}):this.children_.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,function(e){return e});for(var i=this.children_.getIteratorFrom(e.name,he.Wrap),r=i.peek();null!=r&&t.compare(r,e)<0;)i.getNext(),r=i.peek();return i},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,function(e){return e});for(var i=this.children_.getReverseIteratorFrom(e.name,he.Wrap),r=i.peek();null!=r&&t.compare(r,e)>0;)i.getNext(),r=i.peek();return i},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Me?-1:0},e.prototype.withIndex=function(t){if(t===fe||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===fe||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(Te),i=t.getIterator(Te),r=n.getNext(),o=i.getNext();r&&o;){if(r.name!==o.name||!r.node.equals(o.node))return!1;r=n.getNext(),o=i.getNext()}return null===r&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===fe?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),Me=new(function(e){function t(){return e.call(this,new ke(De),Re.EMPTY_NODE,Ne.Default)||this}return Gs.__extends(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return Re.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(Re));Object.defineProperties(he,{MIN:{value:new he(T,Re.EMPTY_NODE)},MAX:{value:new he(E,Me)}}),pe.__EMPTY_NODE=Re.EMPTY_NODE,be.__childrenNodeConstructor=Re,G=Me,function(e){me=e}(Me);var Fe=!0;function je(e,t){if(void 0===t&&(t=null),null===e)return Re.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),Ga.assert(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e)return new be(e,je(t));if(e instanceof Array||!Fe){var n=Re.EMPTY_NODE,i=e;return Ga.forEach(i,function(e,t){if(Ga.contains(i,e)&&"."!==e.substring(0,1)){var r=je(t);!r.isLeafNode()&&r.isEmpty()||(n=n.updateImmediateChild(e,r))}}),n.updatePriority(je(t))}var r=[],o=!1,s=e;if(Ga.forEach(s,function(e,t){if("string"!=typeof e||"."!==e.substring(0,1)){var n=je(s[e]);n.isEmpty()||(o=o||!n.getPriority().isEmpty(),r.push(new he(e,n)))}}),0==r.length)return Re.EMPTY_NODE;var a=Pe(r,Le,function(e){return e.name},De);if(o){var l=Pe(r,Te.getCompare());return new Re(a,je(t),new Ne({".priority":l},{".priority":Te}))}return new Re(a,je(t),Ne.Default)}!function(e){ve=e}(je);var Ue,We,Be=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Gs.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?S(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return he.MIN},t.prototype.maxPost=function(){return he.MAX},t.prototype.makePost=function(e,t){var n=je(e);return new he(t,n)},t.prototype.toString=function(){return".value"},t}(de)),Ve=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,Ga.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return Gs.__extends(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),i=this.extractChild(t.node),r=n.compareTo(i);return 0===r?S(e.name,t.name):r},t.prototype.makePost=function(e,t){var n=je(e),i=Re.EMPTY_NODE.updateChild(this.indexPath_,n);return new he(t,i)},t.prototype.maxPost=function(){var e=Re.EMPTY_NODE.updateChild(this.indexPath_,Me);return new he(E,e)},t.prototype.toString=function(){return this.indexPath_.slice().join("/")},t}(de),He=function(){function e(e,t,n){this.node_=e,this.ref_=t,this.index_=n}return e.prototype.val=function(){return Ga.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},e.prototype.exportVal=function(){return Ga.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},e.prototype.toJSON=function(){return Ga.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return Ga.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},e.prototype.child=function(t){Ga.validateArgCount("DataSnapshot.child",0,1,arguments.length),t=String(t),oe("DataSnapshot.child",1,t,!1);var n=new F(t),i=this.ref_.child(n);return new e(this.node_.getChild(n),i,Te)},e.prototype.hasChild=function(e){Ga.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),oe("DataSnapshot.hasChild",1,e,!1);var t=new F(e);return!this.node_.getChild(t).isEmpty()},e.prototype.getPriority=function(){return Ga.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},e.prototype.forEach=function(t){var n=this;return Ga.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),Ga.validateCallback("DataSnapshot.forEach",1,t,!1),!this.node_.isLeafNode()&&!!this.node_.forEachChild(this.index_,function(i,r){return t(new e(r,n.ref_.child(i),Te))})},e.prototype.hasChildren=function(){return Ga.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!0,configurable:!0}),e.prototype.numChildren=function(){return Ga.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},e.prototype.getRef=function(){return Ga.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}(),$e=function(){function e(e,t,n,i){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=i}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+Ga.stringify(this.snapshot.exportVal())},e}(),Ge=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),Ke=function(){function e(e,t,n){this.callback_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new $e("value",this,new He(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){Ga.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var i=this.callback_;return function(){i.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ge(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callback_||!this.callback_||t.callback_===this.callback_&&t.context_===this.context_)},e.prototype.hasAnyCallback=function(){return null!==this.callback_},e}(),qe=function(){function e(e,t,n){this.callbacks_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,Ga.contains(this.callbacks_,t)},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ge(this,e,t):null},e.prototype.createEvent=function(e,t){Ga.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),i=t.getQueryParams().getIndex();return new $e(e.type,this,new He(e.snapshotNode,n,i),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){Ga.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var i=this.callbacks_[e.eventType];return function(){i.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){if(t instanceof e){if(!this.callbacks_||!t.callbacks_)return!0;if(this.context_===t.context_){var n=Ga.getCount(t.callbacks_);if(n===Ga.getCount(this.callbacks_)){if(1===n){var i=Ga.getAnyKey(t.callbacks_),r=Ga.getAnyKey(this.callbacks_);return!(r!==i||t.callbacks_[i]&&this.callbacks_[r]&&t.callbacks_[i]!==this.callbacks_[r])}return Ga.every(this.callbacks_,function(e,n){return t.callbacks_[e]===n})}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.callbacks_},e}(),Qe=function(){function e(e,t,n,i){this.repo=e,this.path=t,this.queryParams_=n,this.orderByCalled_=i}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return Ga.assert(Ue,"Reference.ts has not been loaded"),Ue},set:function(e){Ue=e},enumerable:!0,configurable:!0}),e.validateQueryEndpoints_=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===fe){var i="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",r="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!=T)throw new Error(i);if("string"!=typeof t)throw new Error(r)}if(e.hasEnd()){if(e.getIndexEndName()!=E)throw new Error(i);if("string"!=typeof n)throw new Error(r)}}else if(e.getIndex()===Te){if(null!=t&&!Z(t)||null!=n&&!Z(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(Ga.assert(e.getIndex()instanceof Ve||e.getIndex()===Be,"unknown index type."),null!=t&&"object"==typeof t||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.validateLimit_=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.validateNoPreviousOrderByCall_=function(e){if(!0===this.orderByCalled_)throw new Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.queryParams_},e.prototype.getRef=function(){return Ga.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,i,r){Ga.validateArgCount("Query.on",2,4,arguments.length),ie("Query.on",1,t,!1),Ga.validateCallback("Query.on",2,n,!1);var o=e.getCancelAndContextArgs_("Query.on",i,r);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var s={};s[t]=n,this.onChildEvent(s,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var i=new Ke(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,i)},e.prototype.onChildEvent=function(e,t,n){var i=new qe(e,t,n);this.repo.addEventCallbackForQuery(this,i)},e.prototype.off=function(e,t,n){Ga.validateArgCount("Query.off",0,3,arguments.length),ie("Query.off",1,e,!0),Ga.validateCallback("Query.off",2,t,!0),Ga.validateContextObject("Query.off",3,n,!0);var i=null,r=null;"value"===e?i=new Ke(t||null,null,n||null):e&&(t&&((r={})[e]=t),i=new qe(r,null,n||null));this.repo.removeEventCallbackForQuery(this,i)},e.prototype.once=function(t,n,i,r){var o=this;Ga.validateArgCount("Query.once",1,4,arguments.length),ie("Query.once",1,t,!1),Ga.validateCallback("Query.once",2,n,!0);var s=e.getCancelAndContextArgs_("Query.once",i,r),a=!0,l=new Ga.Deferred;l.promise.catch(function(){});var u=function(e){a&&(a=!1,o.off(t,u),n&&n.bind(s.context)(e),l.resolve(e))};return this.on(t,u,function(e){o.off(t,u),s.cancel&&s.cancel.bind(s.context)(e),l.reject(e)}),l.promise},e.prototype.limitToFirst=function(t){if(Ga.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToFirst(t),this.orderByCalled_)},e.prototype.limitToLast=function(t){if(Ga.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToLast(t),this.orderByCalled_)},e.prototype.orderByChild=function(t){if(Ga.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw new Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw new Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw new Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');oe("Query.orderByChild",1,t,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new F(t);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var i=new Ve(n),r=this.queryParams_.orderBy(i);return e.validateQueryEndpoints_(r),new e(this.repo,this.path,r,!0)},e.prototype.orderByKey=function(){Ga.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var t=this.queryParams_.orderBy(fe);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){Ga.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var t=this.queryParams_.orderBy(Te);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){Ga.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var t=this.queryParams_.orderBy(Be);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),Ga.validateArgCount("Query.startAt",0,2,arguments.length),J("Query.startAt",1,t,this.path,!0),re("Query.startAt",2,n,!0);var i=this.queryParams_.startAt(t,n);if(e.validateLimit_(i),e.validateQueryEndpoints_(i),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,i,this.orderByCalled_)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),Ga.validateArgCount("Query.endAt",0,2,arguments.length),J("Query.endAt",1,t,this.path,!0),re("Query.endAt",2,n,!0);var i=this.queryParams_.endAt(t,n);if(e.validateLimit_(i),e.validateQueryEndpoints_(i),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,i,this.orderByCalled_)},e.prototype.equalTo=function(e,t){if(Ga.validateArgCount("Query.equalTo",1,2,arguments.length),J("Query.equalTo",1,e,this.path,!1),re("Query.equalTo",2,t,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return Ga.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return Ga.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},e.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=x(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(Ga.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e)){throw new Error("Query.isEqual failed: First argument must be an instance of firebase.database.Query.")}var n=this.repo===t.repo,i=this.path.equals(t.path),r=this.queryIdentifier()===t.queryIdentifier();return n&&i&&r},e.getCancelAndContextArgs_=function(e,t,n){var i={cancel:null,context:null};if(t&&n)i.cancel=t,Ga.validateCallback(e,3,i.cancel,!0),i.context=n,Ga.validateContextObject(e,4,i.context,!0);else if(t)if("object"==typeof t&&null!==t)i.context=t;else{if("function"!=typeof t)throw new Error(Ga.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");i.cancel=t}return i},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}(),Ye=function(){function e(){this.set={}}return e.prototype.add=function(e,t){this.set[e]=null===t||t},e.prototype.contains=function(e){return Ga.contains(this.set,e)},e.prototype.get=function(e){return this.contains(e)?this.set[e]:void 0},e.prototype.remove=function(e){delete this.set[e]},e.prototype.clear=function(){this.set={}},e.prototype.isEmpty=function(){return Ga.isEmpty(this.set)},e.prototype.count=function(){return Ga.getCount(this.set)},e.prototype.each=function(e){Ga.forEach(this.set,function(t,n){return e(t,n)})},e.prototype.keys=function(){var e=[];return Ga.forEach(this.set,function(t){e.push(t)}),e},e}(),ze=function(){function e(){this.value_=null,this.children_=null}return e.prototype.find=function(e){if(null!=this.value_)return this.value_.getChild(e);if(e.isEmpty()||null==this.children_)return null;var t=e.getFront();return e=e.popFront(),this.children_.contains(t)?this.children_.get(t).find(e):null},e.prototype.remember=function(t,n){if(t.isEmpty())this.value_=n,this.children_=null;else if(null!==this.value_)this.value_=this.value_.updateChild(t,n);else{null==this.children_&&(this.children_=new Ye);var i=t.getFront();this.children_.contains(i)||this.children_.add(i,new e);var r=this.children_.get(i);t=t.popFront(),r.remember(t,n)}},e.prototype.forget=function(e){if(e.isEmpty())return this.value_=null,this.children_=null,!0;if(null!==this.value_){if(this.value_.isLeafNode())return!1;var t=this.value_;this.value_=null;var n=this;return t.forEachChild(Te,function(e,t){n.remember(new F(e),t)}),this.forget(e)}if(null!==this.children_){var i=e.getFront();if(e=e.popFront(),this.children_.contains(i))this.children_.get(i).forget(e)&&this.children_.remove(i);return!!this.children_.isEmpty()&&(this.children_=null,!0)}return!0},e.prototype.forEachTree=function(e,t){null!==this.value_?t(e,this.value_):this.forEachChild(function(n,i){var r=new F(e.toString()+"/"+n);i.forEachTree(r,t)})},e.prototype.forEachChild=function(e){null!==this.children_&&this.children_.each(function(t,n){e(t,n)})},e}(),Xe=function(e,t){return e&&"object"==typeof e?(Ga.assert(".sv"in e,"Unexpected leaf node or priority contents"),t[e[".sv"]]):e},Ze=function(e,t){var n,i=e.getPriority().val(),r=Xe(i,t);if(e.isLeafNode()){var o=e,s=Xe(o.getValue(),t);return s!==o.getValue()||r!==o.getPriority().val()?new be(s,je(r)):e}var a=e;return n=a,r!==a.getPriority().val()&&(n=n.updatePriority(new be(r))),a.forEachChild(Te,function(e,i){var r=Ze(i,t);r!==i&&(n=n.updateImmediateChild(e,r))}),n};!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(We||(We={}));var Je,et,tt=function(){function e(e,t,n,i){this.fromUser=e,this.fromServer=t,this.queryId=n,this.tagged=i,Ga.assert(!i||t,"Tagged queries must be from server.")}return e.User=new e(!0,!1,null,!1),e.Server=new e(!1,!0,null,!1),e.forServerTaggedQuery=function(t){return new e(!1,!0,t,!0)},e}(),nt=function(){function e(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=We.ACK_USER_WRITE,this.source=tt.User}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return Ga.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new F(t));return new e(F.Empty,n,this.revert)}return Ga.assert(this.path.getFront()===t,"operationForChild called for unrelated child."),new e(this.path.popFront(),this.affectedTree,this.revert)},e}(),it=function(){return Je||(Je=new ke(I)),Je},rt=function(){function e(e,t){void 0===t&&(t=it()),this.value=e,this.children=t}return e.fromObject=function(t){var n=e.Empty;return Ga.forEach(t,function(e,t){n=n.set(new F(e),t)}),n},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:F.Empty,value:this.value};if(e.isEmpty())return null;var n=e.getFront(),i=this.children.get(n);if(null!==i){var r=i.findRootMostMatchingPathAndValue(e.popFront(),t);return null!=r?{path:new F(n).child(r.path),value:r.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,function(){return!0})},e.prototype.subtree=function(t){if(t.isEmpty())return this;var n=t.getFront(),i=this.children.get(n);return null!==i?i.subtree(t.popFront()):e.Empty},e.prototype.set=function(t,n){if(t.isEmpty())return new e(n,this.children);var i=t.getFront(),r=(this.children.get(i)||e.Empty).set(t.popFront(),n),o=this.children.insert(i,r);return new e(this.value,o)},e.prototype.remove=function(t){if(t.isEmpty())return this.children.isEmpty()?e.Empty:new e(null,this.children);var n=t.getFront(),i=this.children.get(n);if(i){var r=i.remove(t.popFront()),o=void 0;return o=r.isEmpty()?this.children.remove(n):this.children.insert(n,r),null===this.value&&o.isEmpty()?e.Empty:new e(this.value,o)}return this},e.prototype.get=function(e){if(e.isEmpty())return this.value;var t=e.getFront(),n=this.children.get(t);return n?n.get(e.popFront()):null},e.prototype.setTree=function(t,n){if(t.isEmpty())return n;var i=t.getFront(),r=(this.children.get(i)||e.Empty).setTree(t.popFront(),n),o=void 0;return o=r.isEmpty()?this.children.remove(i):this.children.insert(i,r),new e(this.value,o)},e.prototype.fold=function(e){return this.fold_(F.Empty,e)},e.prototype.fold_=function(e,t){var n={};return this.children.inorderTraversal(function(i,r){n[i]=r.fold_(e.child(i),t)}),t(e,this.value,n)},e.prototype.findOnPath=function(e,t){return this.findOnPath_(e,F.Empty,t)},e.prototype.findOnPath_=function(e,t,n){var i=!!this.value&&n(t,this.value);if(i)return i;if(e.isEmpty())return null;var r=e.getFront(),o=this.children.get(r);return o?o.findOnPath_(e.popFront(),t.child(r),n):null},e.prototype.foreachOnPath=function(e,t){return this.foreachOnPath_(e,F.Empty,t)},e.prototype.foreachOnPath_=function(t,n,i){if(t.isEmpty())return this;this.value&&i(n,this.value);var r=t.getFront(),o=this.children.get(r);return o?o.foreachOnPath_(t.popFront(),n.child(r),i):e.Empty},e.prototype.foreach=function(e){this.foreach_(F.Empty,e)},e.prototype.foreach_=function(e,t){this.children.inorderTraversal(function(n,i){i.foreach_(e.child(n),t)}),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal(function(t,n){n.value&&e(t,n.value)})},e.Empty=new e(null),e}(),ot=function(){function e(e,t){this.source=e,this.path=t,this.type=We.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,F.Empty):new e(this.source,this.path.popFront())},e}(),st=function(){function e(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=We.OVERWRITE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,F.Empty,this.snap.getImmediateChild(t)):new e(this.source,this.path.popFront(),this.snap)},e}(),at=function(){function e(e,t,n){this.source=e,this.path=t,this.children=n,this.type=We.MERGE}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){var n=this.children.subtree(new F(t));return n.isEmpty()?null:n.value?new st(this.source,F.Empty,n.value):new e(this.source,F.Empty,n)}return Ga.assert(this.path.getFront()===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,this.path.popFront(),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},e}(),lt=function(){function e(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}return e.prototype.isFullyInitialized=function(){return this.fullyInitialized_},e.prototype.isFiltered=function(){return this.filtered_},e.prototype.isCompleteForPath=function(e){if(e.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var t=e.getFront();return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)},e.prototype.getNode=function(){return this.node_},e}(),ut=function(){function e(e,t){this.eventCache_=e,this.serverCache_=t}return e.prototype.updateEventSnap=function(t,n,i){return new e(new lt(t,n,i),this.serverCache_)},e.prototype.updateServerSnap=function(t,n,i){return new e(this.eventCache_,new lt(t,n,i))},e.prototype.getEventCache=function(){return this.eventCache_},e.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},e.prototype.getServerCache=function(){return this.serverCache_},e.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},e.Empty=new e(new lt(Re.EMPTY_NODE,!1,!1),new lt(Re.EMPTY_NODE,!1,!1)),e}(),ct=function(){function e(e,t,n,i,r){this.type=e,this.snapshotNode=t,this.childName=n,this.oldSnap=i,this.prevName=r}return e.valueChange=function(t){return new e(e.VALUE,t)},e.childAddedChange=function(t,n){return new e(e.CHILD_ADDED,n,t)},e.childRemovedChange=function(t,n){return new e(e.CHILD_REMOVED,n,t)},e.childChangedChange=function(t,n,i){return new e(e.CHILD_CHANGED,n,t,i)},e.childMovedChange=function(t,n){return new e(e.CHILD_MOVED,n,t)},e.CHILD_ADDED="child_added",e.CHILD_REMOVED="child_removed",e.CHILD_CHANGED="child_changed",e.CHILD_MOVED="child_moved",e.VALUE="value",e}(),ht=function(){function e(e){this.index_=e}return e.prototype.updateChild=function(e,t,n,i,r,o){Ga.assert(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");var s=e.getImmediateChild(t);return s.getChild(i).equals(n.getChild(i))&&s.isEmpty()==n.isEmpty()?e:(null!=o&&(n.isEmpty()?e.hasChild(t)?o.trackChildChange(ct.childRemovedChange(t,s)):Ga.assert(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):s.isEmpty()?o.trackChildChange(ct.childAddedChange(t,n)):o.trackChildChange(ct.childChangedChange(t,n,s))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))},e.prototype.updateFullNode=function(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(Te,function(e,i){t.hasChild(e)||n.trackChildChange(ct.childRemovedChange(e,i))}),t.isLeafNode()||t.forEachChild(Te,function(t,i){if(e.hasChild(t)){var r=e.getImmediateChild(t);r.equals(i)||n.trackChildChange(ct.childChangedChange(t,i,r))}else n.trackChildChange(ct.childAddedChange(t,i))})),t.withIndex(this.index_)},e.prototype.updatePriority=function(e,t){return e.isEmpty()?Re.EMPTY_NODE:e.updatePriority(t)},e.prototype.filtersNodes=function(){return!1},e.prototype.getIndexedFilter=function(){return this},e.prototype.getIndex=function(){return this.index_},e}(),dt=function(){function e(){this.changeMap_={}}return e.prototype.trackChildChange=function(e){var t=e.type,n=e.childName;Ga.assert(t==ct.CHILD_ADDED||t==ct.CHILD_CHANGED||t==ct.CHILD_REMOVED,"Only child changes supported for tracking"),Ga.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var i=Ga.safeGet(this.changeMap_,n);if(i){var r=i.type;if(t==ct.CHILD_ADDED&&r==ct.CHILD_REMOVED)this.changeMap_[n]=ct.childChangedChange(n,e.snapshotNode,i.snapshotNode);else if(t==ct.CHILD_REMOVED&&r==ct.CHILD_ADDED)delete this.changeMap_[n];else if(t==ct.CHILD_REMOVED&&r==ct.CHILD_CHANGED)this.changeMap_[n]=ct.childRemovedChange(n,i.oldSnap);else if(t==ct.CHILD_CHANGED&&r==ct.CHILD_ADDED)this.changeMap_[n]=ct.childAddedChange(n,e.snapshotNode);else{if(t!=ct.CHILD_CHANGED||r!=ct.CHILD_CHANGED)throw Ga.assertionError("Illegal combination of changes: "+e+" occurred after "+i);this.changeMap_[n]=ct.childChangedChange(n,e.snapshotNode,i.oldSnap)}}else this.changeMap_[n]=e},e.prototype.getChanges=function(){return Ga.getValues(this.changeMap_)},e}(),pt=new(function(){function e(){}return e.prototype.getCompleteChild=function(e){return null},e.prototype.getChildAfterChild=function(e,t,n){return null},e}()),ft=function(){function e(e,t,n){void 0===n&&(n=null),this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}return e.prototype.getCompleteChild=function(e){var t=this.viewCache_.getEventCache();if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);var n=null!=this.optCompleteServerCache_?new lt(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(e,n)},e.prototype.getChildAfterChild=function(e,t,n){var i=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),r=this.writes_.calcIndexedSlice(i,t,1,n,e);return 0===r.length?null:r[0]},e}(),gt=function(){return function(e,t){this.viewCache=e,this.changes=t}}(),vt=function(){function e(e){this.filter_=e}return e.prototype.assertIndexed=function(e){Ga.assert(e.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),Ga.assert(e.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},e.prototype.applyOperation=function(t,n,i,r){var o,s,a=new dt;if(n.type===We.OVERWRITE){var l=n;l.source.fromUser?o=this.applyUserOverwrite_(t,l.path,l.snap,i,r,a):(Ga.assert(l.source.fromServer,"Unknown source."),s=l.source.tagged||t.getServerCache().isFiltered()&&!l.path.isEmpty(),o=this.applyServerOverwrite_(t,l.path,l.snap,i,r,s,a))}else if(n.type===We.MERGE){var u=n;u.source.fromUser?o=this.applyUserMerge_(t,u.path,u.children,i,r,a):(Ga.assert(u.source.fromServer,"Unknown source."),s=u.source.tagged||t.getServerCache().isFiltered(),o=this.applyServerMerge_(t,u.path,u.children,i,r,s,a))}else if(n.type===We.ACK_USER_WRITE){var c=n;o=c.revert?this.revertUserWrite_(t,c.path,i,r,a):this.ackUserWrite_(t,c.path,c.affectedTree,i,r,a)}else{if(n.type!==We.LISTEN_COMPLETE)throw Ga.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(t,n.path,i,a)}var h=a.getChanges();return e.maybeAddValueEvent_(t,o,h),new gt(o,h)},e.maybeAddValueEvent_=function(e,t,n){var i=t.getEventCache();if(i.isFullyInitialized()){var r=i.getNode().isLeafNode()||i.getNode().isEmpty(),o=e.getCompleteEventSnap();(n.length>0||!e.getEventCache().isFullyInitialized()||r&&!i.getNode().equals(o)||!i.getNode().getPriority().equals(o.getPriority()))&&n.push(ct.valueChange(t.getCompleteEventSnap()))}},e.prototype.generateEventCacheAfterServerEvent_=function(e,t,n,i,r){var o=e.getEventCache();if(null!=n.shadowingWrite(t))return e;var s=void 0,a=void 0;if(t.isEmpty())if(Ga.assert(e.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),e.getServerCache().isFiltered()){var l=e.getCompleteServerSnap(),u=l instanceof Re?l:Re.EMPTY_NODE,c=n.calcCompleteEventChildren(u);s=this.filter_.updateFullNode(e.getEventCache().getNode(),c,r)}else{var h=n.calcCompleteEventCache(e.getCompleteServerSnap());s=this.filter_.updateFullNode(e.getEventCache().getNode(),h,r)}else{var d=t.getFront();if(".priority"==d){Ga.assert(1==t.getLength(),"Can't have a priority with additional path components");var p=o.getNode();a=e.getServerCache().getNode();var f=n.calcEventCacheAfterServerOverwrite(t,p,a);s=null!=f?this.filter_.updatePriority(p,f):o.getNode()}else{var g=t.popFront(),v=void 0;if(o.isCompleteForChild(d)){a=e.getServerCache().getNode();var m=n.calcEventCacheAfterServerOverwrite(t,o.getNode(),a);v=null!=m?o.getNode().getImmediateChild(d).updateChild(g,m):o.getNode().getImmediateChild(d)}else v=n.calcCompleteChild(d,e.getServerCache());s=null!=v?this.filter_.updateChild(o.getNode(),d,v,g,i,r):o.getNode()}}return e.updateEventSnap(s,o.isFullyInitialized()||t.isEmpty(),this.filter_.filtersNodes())},e.prototype.applyServerOverwrite_=function(e,t,n,i,r,o,s){var a,l=e.getServerCache(),u=o?this.filter_:this.filter_.getIndexedFilter();if(t.isEmpty())a=u.updateFullNode(l.getNode(),n,null);else if(u.filtersNodes()&&!l.isFiltered()){var c=l.getNode().updateChild(t,n);a=u.updateFullNode(l.getNode(),c,null)}else{var h=t.getFront();if(!l.isCompleteForPath(t)&&t.getLength()>1)return e;var d=t.popFront(),p=l.getNode().getImmediateChild(h).updateChild(d,n);a=".priority"==h?u.updatePriority(l.getNode(),p):u.updateChild(l.getNode(),h,p,d,pt,null)}var f=e.updateServerSnap(a,l.isFullyInitialized()||t.isEmpty(),u.filtersNodes()),g=new ft(i,f,r);return this.generateEventCacheAfterServerEvent_(f,t,i,g,s)},e.prototype.applyUserOverwrite_=function(e,t,n,i,r,o){var s,a,l=e.getEventCache(),u=new ft(i,e,r);if(t.isEmpty())a=this.filter_.updateFullNode(e.getEventCache().getNode(),n,o),s=e.updateEventSnap(a,!0,this.filter_.filtersNodes());else{var c=t.getFront();if(".priority"===c)a=this.filter_.updatePriority(e.getEventCache().getNode(),n),s=e.updateEventSnap(a,l.isFullyInitialized(),l.isFiltered());else{var h=t.popFront(),d=l.getNode().getImmediateChild(c),p=void 0;if(h.isEmpty())p=n;else{var f=u.getCompleteChild(c);p=null!=f?".priority"===h.getBack()&&f.getChild(h.parent()).isEmpty()?f:f.updateChild(h,n):Re.EMPTY_NODE}if(d.equals(p))s=e;else{var g=this.filter_.updateChild(l.getNode(),c,p,h,u,o);s=e.updateEventSnap(g,l.isFullyInitialized(),this.filter_.filtersNodes())}}}return s},e.cacheHasChild_=function(e,t){return e.getEventCache().isCompleteForChild(t)},e.prototype.applyUserMerge_=function(t,n,i,r,o,s){var a=this,l=t;return i.foreach(function(i,u){var c=n.child(i);e.cacheHasChild_(t,c.getFront())&&(l=a.applyUserOverwrite_(l,c,u,r,o,s))}),i.foreach(function(i,u){var c=n.child(i);e.cacheHasChild_(t,c.getFront())||(l=a.applyUserOverwrite_(l,c,u,r,o,s))}),l},e.prototype.applyMerge_=function(e,t){return t.foreach(function(t,n){e=e.updateChild(t,n)}),e},e.prototype.applyServerMerge_=function(e,t,n,i,r,o,s){var a=this;if(e.getServerCache().getNode().isEmpty()&&!e.getServerCache().isFullyInitialized())return e;var l,u=e;l=t.isEmpty()?n:rt.Empty.setTree(t,n);var c=e.getServerCache().getNode();return l.children.inorderTraversal(function(t,n){if(c.hasChild(t)){var l=e.getServerCache().getNode().getImmediateChild(t),h=a.applyMerge_(l,n);u=a.applyServerOverwrite_(u,new F(t),h,i,r,o,s)}}),l.children.inorderTraversal(function(t,n){var l=!e.getServerCache().isCompleteForChild(t)&&null==n.value;if(!c.hasChild(t)&&!l){var h=e.getServerCache().getNode().getImmediateChild(t),d=a.applyMerge_(h,n);u=a.applyServerOverwrite_(u,new F(t),d,i,r,o,s)}}),u},e.prototype.ackUserWrite_=function(e,t,n,i,r,o){if(null!=i.shadowingWrite(t))return e;var s=e.getServerCache().isFiltered(),a=e.getServerCache();if(null!=n.value){if(t.isEmpty()&&a.isFullyInitialized()||a.isCompleteForPath(t))return this.applyServerOverwrite_(e,t,a.getNode().getChild(t),i,r,s,o);if(t.isEmpty()){var l=rt.Empty;return a.getNode().forEachChild(fe,function(e,t){l=l.set(new F(e),t)}),this.applyServerMerge_(e,t,l,i,r,s,o)}return e}var u=rt.Empty;return n.foreach(function(e,n){var i=t.child(e);a.isCompleteForPath(i)&&(u=u.set(e,a.getNode().getChild(i)))}),this.applyServerMerge_(e,t,u,i,r,s,o)},e.prototype.listenComplete_=function(e,t,n,i){var r=e.getServerCache(),o=e.updateServerSnap(r.getNode(),r.isFullyInitialized()||t.isEmpty(),r.isFiltered());return this.generateEventCacheAfterServerEvent_(o,t,n,pt,i)},e.prototype.revertUserWrite_=function(e,t,n,i,r){var o;if(null!=n.shadowingWrite(t))return e;var s=new ft(n,e,i),a=e.getEventCache().getNode(),l=void 0;if(t.isEmpty()||".priority"===t.getFront()){var u=void 0;if(e.getServerCache().isFullyInitialized())u=n.calcCompleteEventCache(e.getCompleteServerSnap());else{var c=e.getServerCache().getNode();Ga.assert(c instanceof Re,"serverChildren would be complete if leaf node"),u=n.calcCompleteEventChildren(c)}u=u,l=this.filter_.updateFullNode(a,u,r)}else{var h=t.getFront(),d=n.calcCompleteChild(h,e.getServerCache());null==d&&e.getServerCache().isCompleteForChild(h)&&(d=a.getImmediateChild(h)),(l=null!=d?this.filter_.updateChild(a,h,d,t.popFront(),s,r):e.getEventCache().getNode().hasChild(h)?this.filter_.updateChild(a,h,Re.EMPTY_NODE,t.popFront(),s,r):a).isEmpty()&&e.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(e.getCompleteServerSnap())).isLeafNode()&&(l=this.filter_.updateFullNode(l,o,r))}return o=e.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(F.Empty),e.updateEventSnap(l,o,this.filter_.filtersNodes())},e}(),mt=function(){function e(e){this.query_=e,this.index_=this.query_.getQueryParams().getIndex()}return e.prototype.generateEventsForChanges=function(e,t,n){var i=this,r=[],o=[];return e.forEach(function(e){e.type===ct.CHILD_CHANGED&&i.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push(ct.childMovedChange(e.childName,e.snapshotNode))}),this.generateEventsForType_(r,ct.CHILD_REMOVED,e,n,t),this.generateEventsForType_(r,ct.CHILD_ADDED,e,n,t),this.generateEventsForType_(r,ct.CHILD_MOVED,o,n,t),this.generateEventsForType_(r,ct.CHILD_CHANGED,e,n,t),this.generateEventsForType_(r,ct.VALUE,e,n,t),r},e.prototype.generateEventsForType_=function(e,t,n,i,r){var o=this,s=n.filter(function(e){return e.type===t});s.sort(this.compareChanges_.bind(this)),s.forEach(function(t){var n=o.materializeSingleChange_(t,r);i.forEach(function(i){i.respondsTo(t.type)&&e.push(i.createEvent(n,o.query_))})})},e.prototype.materializeSingleChange_=function(e,t){return"value"===e.type||"child_removed"===e.type?e:(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,this.index_),e)},e.prototype.compareChanges_=function(e,t){if(null==e.childName||null==t.childName)throw Ga.assertionError("Should only compare child_ events.");var n=new he(e.childName,e.snapshotNode),i=new he(t.childName,t.snapshotNode);return this.index_.compare(n,i)},e}(),_t=function(){function e(e,t){this.query_=e,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),i=new ht(n.getIndex()),r=n.getNodeFilter();this.processor_=new vt(r);var o=t.getServerCache(),s=t.getEventCache(),a=i.updateFullNode(Re.EMPTY_NODE,o.getNode(),null),l=r.updateFullNode(Re.EMPTY_NODE,s.getNode(),null),u=new lt(a,o.isFullyInitialized(),i.filtersNodes()),c=new lt(l,s.isFullyInitialized(),r.filtersNodes());this.viewCache_=new ut(c,u),this.eventGenerator_=new mt(this.query_)}return e.prototype.getQuery=function(){return this.query_},e.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},e.prototype.getCompleteServerCache=function(e){var t=this.viewCache_.getCompleteServerSnap();return t&&(this.query_.getQueryParams().loadsAllData()||!e.isEmpty()&&!t.getImmediateChild(e.getFront()).isEmpty())?t.getChild(e):null},e.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},e.prototype.addEventRegistration=function(e){this.eventRegistrations_.push(e)},e.prototype.removeEventRegistration=function(e,t){var n=[];if(t){Ga.assert(null==e,"A cancel should cancel all event registrations.");var i=this.query_.path;this.eventRegistrations_.forEach(function(e){t=t;var r=e.createCancelEvent(t,i);r&&n.push(r)})}if(e){for(var r=[],o=0;o<this.eventRegistrations_.length;++o){var s=this.eventRegistrations_[o];if(s.matches(e)){if(e.hasAnyCallback()){r=r.concat(this.eventRegistrations_.slice(o+1));break}}else r.push(s)}this.eventRegistrations_=r}else this.eventRegistrations_=[];return n},e.prototype.applyOperation=function(e,t,n){e.type===We.MERGE&&null!==e.source.queryId&&(Ga.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full cache before handling merges"),Ga.assert(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var i=this.viewCache_,r=this.processor_.applyOperation(i,e,t,n);return this.processor_.assertIndexed(r.viewCache),Ga.assert(r.viewCache.getServerCache().isFullyInitialized()||!i.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=r.viewCache,this.generateEventsForChanges_(r.changes,r.viewCache.getEventCache().getNode(),null)},e.prototype.getInitialEvents=function(e){var t=this.viewCache_.getEventCache(),n=[];t.getNode().isLeafNode()||t.getNode().forEachChild(Te,function(e,t){n.push(ct.childAddedChange(e,t))});return t.isFullyInitialized()&&n.push(ct.valueChange(t.getNode())),this.generateEventsForChanges_(n,t.getNode(),e)},e.prototype.generateEventsForChanges_=function(e,t,n){var i=n?[n]:this.eventRegistrations_;return this.eventGenerator_.generateEventsForChanges(e,t,i)},e}(),yt=function(){function e(){this.views_={}}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return Ga.assert(et,"Reference.ts has not been loaded"),et},set:function(e){Ga.assert(!et,"__referenceConstructor has already been defined"),et=e},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return Ga.isEmpty(this.views_)},e.prototype.applyOperation=function(e,t,n){var i=e.source.queryId;if(null!==i){var r=Ga.safeGet(this.views_,i);return Ga.assert(null!=r,"SyncTree gave us an op for an invalid query."),r.applyOperation(e,t,n)}var o=[];return Ga.forEach(this.views_,function(i,r){o=o.concat(r.applyOperation(e,t,n))}),o},e.prototype.addEventRegistration=function(e,t,n,i,r){var o=e.queryIdentifier(),s=Ga.safeGet(this.views_,o);if(!s){var a=n.calcCompleteEventCache(r?i:null),l=!1;a?l=!0:i instanceof Re?(a=n.calcCompleteEventChildren(i),l=!1):(a=Re.EMPTY_NODE,l=!1);var u=new ut(new lt(a,l,!1),new lt(i,r,!1));s=new _t(e,u),this.views_[o]=s}return s.addEventRegistration(t),s.getInitialEvents(t)},e.prototype.removeEventRegistration=function(t,n,i){var r=t.queryIdentifier(),o=[],s=[],a=this.hasCompleteView();if("default"===r){var l=this;Ga.forEach(this.views_,function(e,t){s=s.concat(t.removeEventRegistration(n,i)),t.isEmpty()&&(delete l.views_[e],t.getQuery().getQueryParams().loadsAllData()||o.push(t.getQuery()))})}else{var u=Ga.safeGet(this.views_,r);u&&(s=s.concat(u.removeEventRegistration(n,i)),u.isEmpty()&&(delete this.views_[r],u.getQuery().getQueryParams().loadsAllData()||o.push(u.getQuery())))}return a&&!this.hasCompleteView()&&o.push(new e.__referenceConstructor(t.repo,t.path)),{removed:o,events:s}},e.prototype.getQueryViews=function(){var e=this;return Object.keys(this.views_).map(function(t){return e.views_[t]}).filter(function(e){return!e.getQuery().getQueryParams().loadsAllData()})},e.prototype.getCompleteServerCache=function(e){var t=null;return Ga.forEach(this.views_,function(n,i){t=t||i.getCompleteServerCache(e)}),t},e.prototype.viewForQuery=function(e){if(e.getQueryParams().loadsAllData())return this.getCompleteView();var t=e.queryIdentifier();return Ga.safeGet(this.views_,t)},e.prototype.viewExistsForQuery=function(e){return null!=this.viewForQuery(e)},e.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},e.prototype.getCompleteView=function(){return Ga.findValue(this.views_,function(e){return e.getQuery().getQueryParams().loadsAllData()})||null},e}(),bt=function(){function e(e){this.writeTree_=e}return e.prototype.addWrite=function(t,n){if(t.isEmpty())return new e(new rt(n));var i=this.writeTree_.findRootMostValueAndPath(t);if(null!=i){var r=i.path,o=i.value,s=F.relativePath(r,t);return o=o.updateChild(s,n),new e(this.writeTree_.set(r,o))}var a=new rt(n);return new e(this.writeTree_.setTree(t,a))},e.prototype.addWrites=function(e,t){var n=this;return Ga.forEach(t,function(t,i){n=n.addWrite(e.child(t),i)}),n},e.prototype.removeWrite=function(t){return t.isEmpty()?e.Empty:new e(this.writeTree_.setTree(t,rt.Empty))},e.prototype.hasCompleteWrite=function(e){return null!=this.getCompleteNode(e)},e.prototype.getCompleteNode=function(e){var t=this.writeTree_.findRootMostValueAndPath(e);return null!=t?this.writeTree_.get(t.path).getChild(F.relativePath(t.path,e)):null},e.prototype.getCompleteChildren=function(){var e=[],t=this.writeTree_.value;return null!=t?t.isLeafNode()||t.forEachChild(Te,function(t,n){e.push(new he(t,n))}):this.writeTree_.children.inorderTraversal(function(t,n){null!=n.value&&e.push(new he(t,n.value))}),e},e.prototype.childCompoundWrite=function(t){if(t.isEmpty())return this;var n=this.getCompleteNode(t);return new e(null!=n?new rt(n):this.writeTree_.subtree(t))},e.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},e.prototype.apply=function(t){return e.applySubtreeWrite_(F.Empty,this.writeTree_,t)},e.Empty=new e(new rt(null)),e.applySubtreeWrite_=function(t,n,i){if(null!=n.value)return i.updateChild(t,n.value);var r=null;return n.children.inorderTraversal(function(n,o){".priority"===n?(Ga.assert(null!==o.value,"Priority writes must always be leaf nodes"),r=o.value):i=e.applySubtreeWrite_(t.child(n),o,i)}),i.getChild(t).isEmpty()||null===r||(i=i.updateChild(t.child(".priority"),r)),i},e}(),wt=function(){function e(){this.visibleWrites_=bt.Empty,this.allWrites_=[],this.lastWriteId_=-1}return e.prototype.childWrites=function(e){return new Ct(e,this)},e.prototype.addOverwrite=function(e,t,n,i){Ga.assert(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===i&&(i=!0),this.allWrites_.push({path:e,snap:t,writeId:n,visible:i}),i&&(this.visibleWrites_=this.visibleWrites_.addWrite(e,t)),this.lastWriteId_=n},e.prototype.addMerge=function(e,t,n){Ga.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:e,children:t,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(e,t),this.lastWriteId_=n},e.prototype.getWrite=function(e){for(var t=0;t<this.allWrites_.length;t++){var n=this.allWrites_[t];if(n.writeId===e)return n}return null},e.prototype.removeWrite=function(e){var t=this,n=this.allWrites_.findIndex(function(t){return t.writeId===e});Ga.assert(n>=0,"removeWrite called with nonexistent writeId.");var i=this.allWrites_[n];this.allWrites_.splice(n,1);for(var r=i.visible,o=!1,s=this.allWrites_.length-1;r&&s>=0;){var a=this.allWrites_[s];a.visible&&(s>=n&&this.recordContainsPath_(a,i.path)?r=!1:i.path.contains(a.path)&&(o=!0)),s--}if(r){if(o)return this.resetTree_(),!0;if(i.snap)this.visibleWrites_=this.visibleWrites_.removeWrite(i.path);else{var l=i.children;Ga.forEach(l,function(e){t.visibleWrites_=t.visibleWrites_.removeWrite(i.path.child(e))})}return!0}return!1},e.prototype.getCompleteWriteData=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcCompleteEventCache=function(t,n,i,r){if(i||r){var o=this.visibleWrites_.childCompoundWrite(t);if(!r&&o.isEmpty())return n;if(r||null!=n||o.hasCompleteWrite(F.Empty)){var s=e.layerTree_(this.allWrites_,function(e){return(e.visible||r)&&(!i||!~i.indexOf(e.writeId))&&(e.path.contains(t)||t.contains(e.path))},t);u=n||Re.EMPTY_NODE;return s.apply(u)}return null}var a=this.visibleWrites_.getCompleteNode(t);if(null!=a)return a;var l=this.visibleWrites_.childCompoundWrite(t);if(l.isEmpty())return n;if(null!=n||l.hasCompleteWrite(F.Empty)){var u=n||Re.EMPTY_NODE;return l.apply(u)}return null},e.prototype.calcCompleteEventChildren=function(e,t){var n=Re.EMPTY_NODE,i=this.visibleWrites_.getCompleteNode(e);if(i)return i.isLeafNode()||i.forEachChild(Te,function(e,t){n=n.updateImmediateChild(e,t)}),n;if(t){var r=this.visibleWrites_.childCompoundWrite(e);return t.forEachChild(Te,function(e,t){var i=r.childCompoundWrite(new F(e)).apply(t);n=n.updateImmediateChild(e,i)}),r.getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n}return this.visibleWrites_.childCompoundWrite(e).getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n,i){Ga.assert(n||i,"Either existingEventSnap or existingServerSnap must exist");var r=e.child(t);if(this.visibleWrites_.hasCompleteWrite(r))return null;var o=this.visibleWrites_.childCompoundWrite(r);return o.isEmpty()?i.getChild(t):o.apply(i.getChild(t))},e.prototype.calcCompleteChild=function(e,t,n){var i=e.child(t),r=this.visibleWrites_.getCompleteNode(i);return null!=r?r:n.isCompleteForChild(t)?this.visibleWrites_.childCompoundWrite(i).apply(n.getNode().getImmediateChild(t)):null},e.prototype.shadowingWrite=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcIndexedSlice=function(e,t,n,i,r,o){var s,a=this.visibleWrites_.childCompoundWrite(e),l=a.getCompleteNode(F.Empty);if(null!=l)s=l;else{if(null==t)return[];s=a.apply(t)}if((s=s.withIndex(o)).isEmpty()||s.isLeafNode())return[];for(var u=[],c=o.getCompare(),h=r?s.getReverseIteratorFrom(n,o):s.getIteratorFrom(n,o),d=h.getNext();d&&u.length<i;)0!==c(d,n)&&u.push(d),d=h.getNext();return u},e.prototype.recordContainsPath_=function(e,t){return e.snap?e.path.contains(t):!!Ga.findKey(e.children,function(n,i){return e.path.child(i).contains(t)})},e.prototype.resetTree_=function(){this.visibleWrites_=e.layerTree_(this.allWrites_,e.DefaultFilter_,F.Empty),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},e.DefaultFilter_=function(e){return e.visible},e.layerTree_=function(e,t,n){for(var i=bt.Empty,r=0;r<e.length;++r){var o=e[r];if(t(o)){var s=o.path,a=void 0;if(o.snap)n.contains(s)?(a=F.relativePath(n,s),i=i.addWrite(a,o.snap)):s.contains(n)&&(a=F.relativePath(s,n),i=i.addWrite(F.Empty,o.snap.getChild(a)));else{if(!o.children)throw Ga.assertionError("WriteRecord should have .snap or .children");if(n.contains(s))a=F.relativePath(n,s),i=i.addWrites(a,o.children);else if(s.contains(n))if((a=F.relativePath(s,n)).isEmpty())i=i.addWrites(F.Empty,o.children);else{var l=Ga.safeGet(o.children,a.getFront());if(l){var u=l.getChild(a.popFront());i=i.addWrite(F.Empty,u)}}}}}return i},e}(),Ct=function(){function e(e,t){this.treePath_=e,this.writeTree_=t}return e.prototype.calcCompleteEventCache=function(e,t,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,e,t,n)},e.prototype.calcCompleteEventChildren=function(e){return this.writeTree_.calcCompleteEventChildren(this.treePath_,e)},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,e,t,n)},e.prototype.shadowingWrite=function(e){return this.writeTree_.shadowingWrite(this.treePath_.child(e))},e.prototype.calcIndexedSlice=function(e,t,n,i,r){return this.writeTree_.calcIndexedSlice(this.treePath_,e,t,n,i,r)},e.prototype.calcCompleteChild=function(e,t){return this.writeTree_.calcCompleteChild(this.treePath_,e,t)},e.prototype.child=function(t){return new e(this.treePath_.child(t),this.writeTree_)},e}(),Tt=function(){function e(e){this.listenProvider_=e,this.syncPointTree_=rt.Empty,this.pendingWriteTree_=new wt,this.tagToQueryMap_={},this.queryToTagMap_={}}return e.prototype.applyUserOverwrite=function(e,t,n,i){return this.pendingWriteTree_.addOverwrite(e,t,n,i),i?this.applyOperationToSyncPoints_(new st(tt.User,e,t)):[]},e.prototype.applyUserMerge=function(e,t,n){this.pendingWriteTree_.addMerge(e,t,n);var i=rt.fromObject(t);return this.applyOperationToSyncPoints_(new at(tt.User,e,i))},e.prototype.ackUserWrite=function(e,t){void 0===t&&(t=!1);var n=this.pendingWriteTree_.getWrite(e);if(this.pendingWriteTree_.removeWrite(e)){var i=rt.Empty;return null!=n.snap?i=i.set(F.Empty,!0):Ga.forEach(n.children,function(e,t){i=i.set(new F(e),t)}),this.applyOperationToSyncPoints_(new nt(n.path,i,t))}return[]},e.prototype.applyServerOverwrite=function(e,t){return this.applyOperationToSyncPoints_(new st(tt.Server,e,t))},e.prototype.applyServerMerge=function(e,t){var n=rt.fromObject(t);return this.applyOperationToSyncPoints_(new at(tt.Server,e,n))},e.prototype.applyListenComplete=function(e){return this.applyOperationToSyncPoints_(new ot(tt.Server,e))},e.prototype.applyTaggedQueryOverwrite=function(t,n,i){var r=this.queryKeyForTag_(i);if(null!=r){var o=e.parseQueryKey_(r),s=o.path,a=o.queryId,l=F.relativePath(s,t),u=new st(tt.forServerTaggedQuery(a),l,n);return this.applyTaggedOperation_(s,u)}return[]},e.prototype.applyTaggedQueryMerge=function(t,n,i){var r=this.queryKeyForTag_(i);if(r){var o=e.parseQueryKey_(r),s=o.path,a=o.queryId,l=F.relativePath(s,t),u=rt.fromObject(n),c=new at(tt.forServerTaggedQuery(a),l,u);return this.applyTaggedOperation_(s,c)}return[]},e.prototype.applyTaggedListenComplete=function(t,n){var i=this.queryKeyForTag_(n);if(i){var r=e.parseQueryKey_(i),o=r.path,s=r.queryId,a=F.relativePath(o,t),l=new ot(tt.forServerTaggedQuery(s),a);return this.applyTaggedOperation_(o,l)}return[]},e.prototype.addEventRegistration=function(t,n){var i=t.path,r=null,o=!1;this.syncPointTree_.foreachOnPath(i,function(e,t){var n=F.relativePath(e,i);r=r||t.getCompleteServerCache(n),o=o||t.hasCompleteView()});var s,a=this.syncPointTree_.get(i);(a?(o=o||a.hasCompleteView(),r=r||a.getCompleteServerCache(F.Empty)):(a=new yt,this.syncPointTree_=this.syncPointTree_.set(i,a)),null!=r)?s=!0:(s=!1,r=Re.EMPTY_NODE,this.syncPointTree_.subtree(i).foreachChild(function(e,t){var n=t.getCompleteServerCache(F.Empty);n&&(r=r.updateImmediateChild(e,n))}));var l=a.viewExistsForQuery(t);if(!l&&!t.getQueryParams().loadsAllData()){var u=e.makeQueryKey_(t);Ga.assert(!(u in this.queryToTagMap_),"View does not exist, but we have a tag");var c=e.getNextQueryTag_();this.queryToTagMap_[u]=c,this.tagToQueryMap_["_"+c]=u}var h=this.pendingWriteTree_.childWrites(i),d=a.addEventRegistration(t,n,h,r,s);if(!l&&!o){var p=a.viewForQuery(t);d=d.concat(this.setupListener_(t,p))}return d},e.prototype.removeEventRegistration=function(t,n,i){var r=this,o=t.path,s=this.syncPointTree_.get(o),a=[];if(s&&("default"===t.queryIdentifier()||s.viewExistsForQuery(t))){var l=s.removeEventRegistration(t,n,i);s.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var u=l.removed;a=l.events;var c=-1!==u.findIndex(function(e){return e.getQueryParams().loadsAllData()}),h=this.syncPointTree_.findOnPath(o,function(e,t){return t.hasCompleteView()});if(c&&!h){var d=this.syncPointTree_.subtree(o);if(!d.isEmpty())for(var p=this.collectDistinctViewsForSubTree_(d),f=0;f<p.length;++f){var g=p[f],v=g.getQuery(),m=this.createListenerForView_(g);this.listenProvider_.startListening(e.queryForListening_(v),this.tagForQuery_(v),m.hashFn,m.onComplete)}}if(!h&&u.length>0&&!i)if(c){this.listenProvider_.stopListening(e.queryForListening_(t),null)}else u.forEach(function(t){var n=r.queryToTagMap_[e.makeQueryKey_(t)];r.listenProvider_.stopListening(e.queryForListening_(t),n)});this.removeTags_(u)}return a},e.prototype.calcCompleteEventCache=function(e,t){var n=this.pendingWriteTree_,i=this.syncPointTree_.findOnPath(e,function(t,n){var i=F.relativePath(t,e),r=n.getCompleteServerCache(i);if(r)return r});return n.calcCompleteEventCache(e,i,t,!0)},e.prototype.collectDistinctViewsForSubTree_=function(e){return e.fold(function(e,t,n){if(t&&t.hasCompleteView())return[t.getCompleteView()];var i=[];return t&&(i=t.getQueryViews()),Ga.forEach(n,function(e,t){i=i.concat(t)}),i})},e.prototype.removeTags_=function(t){for(var n=0;n<t.length;++n){var i=t[n];if(!i.getQueryParams().loadsAllData()){var r=e.makeQueryKey_(i),o=this.queryToTagMap_[r];delete this.queryToTagMap_[r],delete this.tagToQueryMap_["_"+o]}}},e.queryForListening_=function(e){return e.getQueryParams().loadsAllData()&&!e.getQueryParams().isDefault()?e.getRef():e},e.prototype.setupListener_=function(t,n){var i=t.path,r=this.tagForQuery_(t),o=this.createListenerForView_(n),s=this.listenProvider_.startListening(e.queryForListening_(t),r,o.hashFn,o.onComplete),a=this.syncPointTree_.subtree(i);if(r)Ga.assert(!a.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var l=a.fold(function(e,t,n){if(!e.isEmpty()&&t&&t.hasCompleteView())return[t.getCompleteView().getQuery()];var i=[];return t&&(i=i.concat(t.getQueryViews().map(function(e){return e.getQuery()}))),Ga.forEach(n,function(e,t){i=i.concat(t)}),i}),u=0;u<l.length;++u){var c=l[u];this.listenProvider_.stopListening(e.queryForListening_(c),this.tagForQuery_(c))}return s},e.prototype.createListenerForView_=function(e){var t=this,n=e.getQuery(),i=this.tagForQuery_(n);return{hashFn:function(){return(e.getServerCache()||Re.EMPTY_NODE).hash()},onComplete:function(e){if("ok"===e)return i?t.applyTaggedListenComplete(n.path,i):t.applyListenComplete(n.path);var r=function(e,t){var n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==e?n="Client doesn't have permission to access the desired data.":"unavailable"==e&&(n="The service is unavailable");var i=new Error(e+" at "+t.path.toString()+": "+n);return i.code=e.toUpperCase(),i}(e,n);return t.removeEventRegistration(n,null,r)}}},e.makeQueryKey_=function(e){return e.path.toString()+"$"+e.queryIdentifier()},e.parseQueryKey_=function(e){var t=e.indexOf("$");return Ga.assert(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new F(e.substr(0,t))}},e.prototype.queryKeyForTag_=function(e){return this.tagToQueryMap_["_"+e]},e.prototype.tagForQuery_=function(t){var n=e.makeQueryKey_(t);return Ga.safeGet(this.queryToTagMap_,n)},e.getNextQueryTag_=function(){return e.nextQueryTag_++},e.prototype.applyTaggedOperation_=function(e,t){var n=this.syncPointTree_.get(e);Ga.assert(n,"Missing sync point for query tag that we're tracking");var i=this.pendingWriteTree_.childWrites(e);return n.applyOperation(t,i,null)},e.prototype.applyOperationToSyncPoints_=function(e){return this.applyOperationHelper_(e,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(F.Empty))},e.prototype.applyOperationHelper_=function(e,t,n,i){if(e.path.isEmpty())return this.applyOperationDescendantsHelper_(e,t,n,i);var r=t.get(F.Empty);null==n&&null!=r&&(n=r.getCompleteServerCache(F.Empty));var o=[],s=e.path.getFront(),a=e.operationForChild(s),l=t.children.get(s);if(l&&a){var u=n?n.getImmediateChild(s):null,c=i.child(s);o=o.concat(this.applyOperationHelper_(a,l,u,c))}return r&&(o=o.concat(r.applyOperation(e,i,n))),o},e.prototype.applyOperationDescendantsHelper_=function(e,t,n,i){var r=this,o=t.get(F.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(F.Empty));var s=[];return t.children.inorderTraversal(function(t,o){var a=n?n.getImmediateChild(t):null,l=i.child(t),u=e.operationForChild(t);u&&(s=s.concat(r.applyOperationDescendantsHelper_(u,o,a,l)))}),o&&(s=s.concat(o.applyOperation(e,i,n))),s},e.nextQueryTag_=1,e}(),Et=function(){function e(){this.rootNode_=Re.EMPTY_NODE}return e.prototype.getNode=function(e){return this.rootNode_.getChild(e)},e.prototype.updateSnapshot=function(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)},e}(),St=function(){function e(e){this.app_=e}return e.prototype.getToken=function(e){return this.app_.INTERNAL.getToken(e).then(null,function(e){return e&&"auth/token-not-initialized"===e.code?(m("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e)})},e.prototype.addTokenChangeListener=function(e){this.app_.INTERNAL.addAuthTokenListener(e)},e.prototype.removeTokenChangeListener=function(e){this.app_.INTERNAL.removeAuthTokenListener(e)},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',w(e)},e}(),It=function(){function e(){this.counters_={}}return e.prototype.incrementCounter=function(e,t){void 0===t&&(t=1),Ga.contains(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t},e.prototype.get=function(){return Ga.deepCopy(this.counters_)},e}(),kt=function(){function e(){}return e.getCollection=function(e){var t=e.toString();return this.collections_[t]||(this.collections_[t]=new It),this.collections_[t]},e.getOrCreateReporter=function(e,t){var n=e.toString();return this.reporters_[n]||(this.reporters_[n]=t()),this.reporters_[n]},e.collections_={},e.reporters_={},e}(),xt=function(){function e(e){this.collection_=e,this.last_=null}return e.prototype.get=function(){var e=this.collection_.get(),t=Ga.clone(e);return this.last_&&Ga.forEach(this.last_,function(e,n){t[e]=t[e]-n}),this.last_=e,t},e}(),At=1e4,Pt=3e4,Ot=function(){function e(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new xt(e);var n=At+(Pt-At)*Math.random();M(this.reportStats_.bind(this),Math.floor(n))}return e.prototype.includeStat=function(e){this.statsToReport_[e]=!0},e.prototype.reportStats_=function(){var e=this,t=this.statsListener_.get(),n={},i=!1;Ga.forEach(t,function(t,r){r>0&&Ga.contains(e.statsToReport_,t)&&(n[t]=r,i=!0)}),i&&this.server_.reportStats(n),M(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},e}(),Nt=function(){function e(){this.eventLists_=[],this.recursionDepth_=0}return e.prototype.queueEvents=function(e){for(var t=null,n=0;n<e.length;n++){var i=e[n],r=i.getPath();null===t||r.equals(t.getPath())||(this.eventLists_.push(t),t=null),null===t&&(t=new Lt(r)),t.add(i)}t&&this.eventLists_.push(t)},e.prototype.raiseEventsAtPath=function(e,t){this.queueEvents(t),this.raiseQueuedEventsMatchingPredicate_(function(t){return t.equals(e)})},e.prototype.raiseEventsForChangedPath=function(e,t){this.queueEvents(t),this.raiseQueuedEventsMatchingPredicate_(function(t){return t.contains(e)||e.contains(t)})},e.prototype.raiseQueuedEventsMatchingPredicate_=function(e){this.recursionDepth_++;for(var t=!0,n=0;n<this.eventLists_.length;n++){var i=this.eventLists_[n];if(i)e(i.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):t=!1}t&&(this.eventLists_=[]),this.recursionDepth_--},e}(),Lt=function(){function e(e){this.path_=e,this.events_=[]}return e.prototype.add=function(e){this.events_.push(e)},e.prototype.raise=function(){for(var e=0;e<this.events_.length;e++){var t=this.events_[e];if(null!==t){this.events_[e]=null;var n=t.getEventRunner();f&&m("event: "+t.toString()),D(n)}}},e.prototype.getPath=function(){return this.path_},e}(),Dt=function(){function e(e){this.allowedEvents_=e,this.listeners_={},Ga.assert(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=arguments,n=[],i=1;i<arguments.length;i++)n[i-1]=t[i];if(Array.isArray(this.listeners_[e]))for(var r=this.listeners_[e].slice(),o=0;o<r.length;o++)r[o].callback.apply(r[o].context,n)},e.prototype.on=function(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});var i=this.getInitialEvent(e);i&&t.apply(n,i)},e.prototype.off=function(e,t,n){this.validateEventType_(e);for(var i=this.listeners_[e]||[],r=0;r<i.length;r++)if(i[r].callback===t&&(!n||n===i[r].context))return void i.splice(r,1)},e.prototype.validateEventType_=function(e){Ga.assert(this.allowedEvents_.find(function(t){return t===e}),"Unknown event: "+e)},e}(),Rt=function(e){function t(){var t,n,i=e.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",t="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",t="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",t="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",t="webkitHidden")),i.visible_=!0,n&&document.addEventListener(n,function(){var e=!document[t];e!==i.visible_&&(i.visible_=e,i.trigger("visible",e))},!1),i}return Gs.__extends(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return Ga.assert("visible"===e,"Unknown event type: "+e),[this.visible_]},t}(Dt),Mt=function(e){function t(){var t=e.call(this,["online"])||this;return t.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||Ga.isMobileCordova()||(window.addEventListener("online",function(){t.online_||(t.online_=!0,t.trigger("online",!0))},!1),window.addEventListener("offline",function(){t.online_&&(t.online_=!1,t.trigger("online",!1))},!1)),t}return Gs.__extends(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return Ga.assert("online"===e,"Unknown event type: "+e),[this.online_]},t.prototype.currentlyOnline=function(){return this.online_},t}(Dt),Ft=function(){function e(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return e.prototype.closeAfter=function(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},e.prototype.handleResponse=function(e,t){var n=this;this.pendingResponses[e]=t;for(var i=function(){var e=r.pendingResponses[r.currentResponseNum];delete r.pendingResponses[r.currentResponseNum];for(var t=function(t){e[t]&&D(function(){n.onMessage_(e[t])})},i=0;i<e.length;++i)t(i);if(r.currentResponseNum===r.closeAfterResponse)return r.onClose&&(r.onClose(),r.onClose=null),"break";r.currentResponseNum++},r=this;this.pendingResponses[this.currentResponseNum];){if("break"===i())break}},e}(),jt="pLPCommand",Ut="pRTLPCB",Wt=function(){function e(e,t,n,i){this.connId=e,this.repoInfo=t,this.transportSessionId=n,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=_(e),this.stats_=kt.getCollection(t),this.urlFn=function(e){return t.connectionURL(U,e)}}return e.prototype.open=function(e,t){var n=this;this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new Ft(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null},Math.floor(3e4)),function(e){if(Ga.isNodeSdk()||"complete"===document.readyState)e();else{var t=!1,n=function(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}(function(){if(!n.isClosed_){n.scriptTagHolder=new Bt(function(){for(var e=arguments,t=[],i=0;i<arguments.length;i++)t[i]=e[i];var r=t[0],o=t[1],s=t[2];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"==r)n.id=o,n.password=s;else{if("close"!==r)throw new Error("Unrecognized command received: "+r);o?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(o,function(){n.onClosed_()})):n.onClosed_()}},function(){for(var e=arguments,t=[],i=0;i<arguments.length;i++)t[i]=e[i];var r=t[0],o=t[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(r,o)},function(){n.onClosed_()},n.urlFn);var e={start:"t"};e.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=n.scriptTagHolder.uniqueCallbackIdentifier),e.v="5",n.transportSessionId&&(e.s=n.transportSessionId),n.lastSessionId&&(e.ls=n.lastSessionId),!Ga.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(e.r="f");var t=n.urlFn(e);n.log_("Connecting via long-poll to "+t),n.scriptTagHolder.addTag(t,function(){})}})},e.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},e.forceAllow=function(){e.forceAllow_=!0},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){return e.forceAllow_||!e.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)&&!Ga.isNodeSdk()},e.prototype.markConnectionHealthy=function(){},e.prototype.shutdown_=function(){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)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},e.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},e.prototype.send=function(e){var t=Ga.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);for(var n=Ga.base64Encode(t),i=A(n,1840),r=0;r<i.length;r++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,i.length,i[r]),this.curSegmentNum++},e.prototype.addDisconnectPingFrame=function(e,t){if(!Ga.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=e,n.pw=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},e.prototype.incrementIncomingBytes_=function(e){var t=Ga.stringify(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)},e}(),Bt=function(){function e(t,n,i,r){if(this.onDisconnect=i,this.urlFn=r,this.outstandingRequests=new Ye,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,Ga.isNodeSdk())this.commandCB=t,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=h(),window[jt+this.uniqueCallbackIdentifier]=t,window[Ut+this.uniqueCallbackIdentifier]=n,this.myIFrame=e.createIFrame_();var o="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length))o='<script>document.domain="'+document.domain+'";<\/script>';var s="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(e){m("frame writing exception"),e.stack&&m(e.stack),m(e)}}}return e.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||m("No IE domain setting required")}catch(n){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var t=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)},Math.floor(0))),Ga.isNodeSdk()&&this.myID){var n={disconn:"t"};n.id=this.myID,n.pw=this.myPW;var i=this.urlFn(n);e.nodeRestRequest(i)}var r=this.onDisconnect;r&&(this.onDisconnect=null,r())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););},e.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.count()<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;for(var t=this.urlFn(e),n="",i=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;var r=this.pendingSegs.shift();n=n+"&seg"+i+"="+r.seg+"&ts"+i+"="+r.ts+"&d"+i+"="+r.d,i++}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()},e.prototype.addLongPollTag_=function(e,t){var n=this;this.outstandingRequests.add(t,1);var i=function(){n.outstandingRequests.remove(t),n.newRequest_()},r=setTimeout(i,Math.floor(25e3));this.addTag(e,function(){clearTimeout(r),i()})},e.prototype.addTag=function(e,t){var n=this;Ga.isNodeSdk()?this.doNodeLongPoll(e,t):setTimeout(function(){try{if(!n.sendNewPolls)return;var i=n.myIFrame.doc.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.onload=i.onreadystatechange=function(){var e=i.readyState;e&&"loaded"!==e&&"complete"!==e||(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),t())},i.onerror=function(){m("Long-poll script failed to load: "+e),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(i)}catch(e){}},Math.floor(1))},e}(),Vt=null;"undefined"!=typeof MozWebSocket?Vt=MozWebSocket:"undefined"!=typeof WebSocket&&(Vt=WebSocket);var Ht=function(){function e(t,n,i,r){this.connId=t,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=_(this.connId),this.stats_=kt.getCollection(n),this.connURL=e.connectionURL_(n,i,r)}return e.connectionURL_=function(e,t,n){var i={v:"5"};return!Ga.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(i.r="f"),t&&(i.s=t),n&&(i.ls=n),e.connectionURL("websocket",i)},e.prototype.open=function(e,t){var n=this;this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,l.set("previous_websocket_failure",!0);try{if(Ga.isNodeSdk()){var i=Ga.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+r.SDK_VERSION+"/"+process.platform+"/"+i}},s=process.env,a=0==this.connURL.indexOf("wss://")?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;a&&(o.proxy={origin:a}),this.mySock=new Vt(this.connURL,[],o)}else this.mySock=new Vt(this.connURL)}catch(e){this.log_("Error instantiating WebSocket.");var u=e.message||e.data;return u&&this.log_(u),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(e){n.handleIncomingFrame(e)},this.mySock.onerror=function(e){n.log_("WebSocket error. Closing connection.");var t=e.message||e.data;t&&n.log_(t),n.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==Vt&&!e.forceDisallow_},e.previouslyFailed=function(){return l.isInMemoryStorage||!0===l.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){l.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length==this.totalFrames){var t=this.frames.join("");this.frames=null;var n=Ga.jsonEval(t);this.onMessage(n)}},e.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},e.prototype.extractFrameCount_=function(e){if(Ga.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},e.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},e.prototype.send=function(e){this.resetKeepAlive();var t=Ga.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=A(t,16384);n.length>1&&this.sendString_(String(n.length));for(var i=0;i<n.length;i++)this.sendString_(n[i])},e.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},e.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},e.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){e.mySock&&e.sendString_("0"),e.resetKeepAlive()},Math.floor(45e3))},e.prototype.sendString_=function(e){try{this.mySock.send(e)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}(),$t=function(){function e(e){this.initTransports_(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[Wt,Ht]},enumerable:!0,configurable:!0}),e.prototype.initTransports_=function(t){var n=Ht&&Ht.isAvailable(),i=n&&!Ht.previouslyFailed();if(t.webSocketOnly&&(n||w("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),i=!0),i)this.transports_=[Ht];else{var r=this.transports_=[];P(e.ALL_TRANSPORTS,function(e,t){t&&t.isAvailable()&&r.push(t)})}},e.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),Gt=function(){function e(e,t,n,i,r,o,s){this.id=e,this.repoInfo_=t,this.onMessage_=n,this.onReady_=i,this.onDisconnect_=r,this.onKill_=o,this.lastSessionId=s,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=_("c:"+this.id+":"),this.transportManager_=new $t(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,void 0,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),i=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(function(){e.conn_&&e.conn_.open(n,i)},Math.floor(0));var r=t.healthyTimeout||0;r>0&&(this.healthyTimeout_=M(function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes. Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes. Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))},Math.floor(r)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!=t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){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)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=k("t",e),n=k("d",e);if("c"==t)this.onSecondaryControl_(n);else{if("d"!=t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.upgradeIfSecondaryHealthy_=function(){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:{}}}))},e.prototype.proceedWithUpgrade_=function(){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()},e.prototype.onPrimaryMessageReceived_=function(e){var t=k("t",e),n=k("d",e);"c"==t?this.onControl_(n):"d"==t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=k("t",e);if("d"in e){var n=e.d;if("h"===t)this.onHandshake_(n);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var i=0;i<this.pendingDataMessages.length;++i)this.onDataMessage_(this.pendingDataMessages[i]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?y("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):y("Unknown control packet command: "+t)}},e.prototype.onHandshake_=function(e){var t=e.ts,n=e.v,i=e.h;this.sessionId=e.s,this.repoInfo_.updateHost(i),0==this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),"5"!==n&&w("Protocol version mismatch detected"),this.tryStartUpgrade_())},e.prototype.tryStartUpgrade_=function(){var e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)},e.prototype.startUpgrade_=function(e){var t=this;this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),i=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,i),M(function(){t.secondaryConn_&&(t.log_("Timed out trying to upgrade."),t.secondaryConn_.close())},Math.floor(6e4))},e.prototype.onReset_=function(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.updateHost(e),1===this.state_?this.close():(this.closeConnections_(),this.start_())},e.prototype.onConnectionEstablished_=function(e,t){var n=this;this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):M(function(){n.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))},e.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},e.prototype.onSecondaryConnectionLost_=function(){var e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()},e.prototype.onConnectionLost_=function(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(l.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},e.prototype.onConnectionShutdown_=function(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()},e.prototype.sendData_=function(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)},e.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},e.prototype.closeConnections_=function(){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)},e}(),Kt=function(){function e(){}return e.prototype.put=function(e,t,n,i){},e.prototype.merge=function(e,t,n,i){},e.prototype.refreshAuthToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}(),qt=1e3,Qt=3e5,Yt=function(e){function t(n,i,r,o,s,a){var l=e.call(this)||this;if(l.repoInfo_=n,l.onDataUpdate_=i,l.onConnectStatus_=r,l.onServerInfoUpdate_=o,l.authTokenProvider_=s,l.authOverride_=a,l.id=t.nextPersistentConnectionId_++,l.log_=_("p:"+l.id+":"),l.interruptReasons_={},l.listens_={},l.outstandingPuts_=[],l.outstandingPutCount_=0,l.onDisconnectRequestQueue_=[],l.connected_=!1,l.reconnectDelay_=qt,l.maxReconnectDelay_=Qt,l.securityDebugCallback_=null,l.lastSessionId=null,l.establishConnectionTimer_=null,l.visible_=!1,l.requestCBHash_={},l.requestNumber_=0,l.realtime_=null,l.authToken_=null,l.forceTokenRefresh_=!1,l.invalidAuthTokenCount_=0,l.firstConnection_=!0,l.lastConnectionAttemptTime_=null,l.lastConnectionEstablishedTime_=null,a&&!Ga.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return l.scheduleConnect_(0),Rt.getInstance().on("visible",l.onVisible_,l),-1===n.host.indexOf("fblocal")&&Mt.getInstance().on("online",l.onOnline_,l),l}return Gs.__extends(t,e),t.prototype.sendRequest=function(e,t,n){var i=++this.requestNumber_,r={r:i,a:e,b:t};this.log_(Ga.stringify(r)),Ga.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(r),n&&(this.requestCBHash_[i]=n)},t.prototype.listen=function(e,t,n,i){var r=e.queryIdentifier(),o=e.path.toString();this.log_("Listen called for "+o+" "+r),this.listens_[o]=this.listens_[o]||{},Ga.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),Ga.assert(!this.listens_[o][r],"listen() called twice for same path/queryId.");var s={onComplete:i,hashFn:t,query:e,tag:n};this.listens_[o][r]=s,this.connected_&&this.sendListen_(s)},t.prototype.sendListen_=function(e){var n=this,i=e.query,r=i.path.toString(),o=i.queryIdentifier();this.log_("Listen on "+r+" for "+o);var s={p:r};e.tag&&(s.q=i.queryObject(),s.t=e.tag),s.h=e.hashFn(),this.sendRequest("q",s,function(s){var a=s.d,l=s.s;t.warnOnListenWarnings_(a,i),(n.listens_[r]&&n.listens_[r][o])===e&&(n.log_("listen response",s),"ok"!==l&&n.removeListen_(r,o),e.onComplete&&e.onComplete(l,a))})},t.warnOnListenWarnings_=function(e,t){if(e&&"object"==typeof e&&Ga.contains(e,"w")){var n=Ga.safeGet(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var i='".indexOn": "'+t.getQueryParams().getIndex().toString()+'"',r=t.path.toString();w("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+i+" at "+r+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||Ga.isAdmin(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,n=Ga.isValidFormat(t)?"auth":"gauth",i={cred:t};null===this.authOverride_?i.noauth=!0:"object"==typeof this.authOverride_&&(i.authvar=this.authOverride_),this.sendRequest(n,i,function(n){var i=n.s,r=n.d||"error";e.authToken_===t&&("ok"===i?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(i,r))})}},t.prototype.unlisten=function(e,t){var n=e.path.toString(),i=e.queryIdentifier();this.log_("Unlisten called for "+n+" "+i),Ga.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,i)&&this.connected_&&this.sendUnlisten_(n,i,e.queryObject(),t)},t.prototype.sendUnlisten_=function(e,t,n,i){this.log_("Unlisten on "+e+" for "+t);var r={p:e};i&&(r.q=n,r.t=i),this.sendRequest("n",r)},t.prototype.onDisconnectPut=function(e,t,n){this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,n,i){var r={p:t,d:n};this.log_("onDisconnect "+e,r),this.sendRequest(e,r,function(e){i&&setTimeout(function(){i(e.s,e.d)},Math.floor(0))})},t.prototype.put=function(e,t,n,i){this.putInternal("p",e,t,n,i)},t.prototype.merge=function(e,t,n,i){this.putInternal("m",e,t,n,i)},t.prototype.putInternal=function(e,t,n,i,r){var o={p:t,d:n};void 0!==r&&(o.h=r),this.outstandingPuts_.push({action:e,request:o,onComplete:i}),this.outstandingPutCount_++;var s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,n=this.outstandingPuts_[e].action,i=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,i,function(i){t.log_(n+" response",i),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),r&&r(i.s,i.d)})},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,function(e){if("ok"!==e.s){var n=e.d;t.log_("reportStats","Error sending stats: "+n)}})}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+Ga.stringify(e));var t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):y("Unrecognized action received from server: "+Ga.stringify(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;Ga.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){t.establishConnectionTimer_=null,t.establishConnection_()},Math.floor(e))},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=qt,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=qt,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},t.prototype.onRealtimeDisconnect_=function(){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_=qt),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+t.nextConnectionId_++,o=this,s=this.lastSessionId,a=!1,l=null,u=function(){l?l.close():(a=!0,i())};this.realtime_={close:u,sendRequest:function(e){Ga.assert(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(e)}};var c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(c).then(function(t){a?m("getToken() completed but was canceled"):(m("getToken() completed. Creating connection."),o.authToken_=t&&t.accessToken,l=new Gt(r,o.repoInfo_,e,n,i,function(e){w(e+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")},s))}).then(null,function(e){o.log_("Failed to get token: "+e),a||(Ga.CONSTANTS.NODE_ADMIN&&w(e),u())})}},t.prototype.interrupt=function(e){m("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){m("Resuming connection for reason: "+e),delete this.interruptReasons_[e],Ga.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=qt,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e<this.outstandingPuts_.length;e++){var t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},t.prototype.onListenRevoked_=function(e,t){var n;n=t?t.map(function(e){return x(e)}).join("$"):"default";var i=this.removeListen_(e,n);i&&i.onComplete&&i.onComplete("permission_denied")},t.prototype.removeListen_=function(e,t){var n,i=new F(e).toString();return void 0!==this.listens_[i]?(n=this.listens_[i][t],delete this.listens_[i][t],0===Ga.getCount(this.listens_[i])&&delete this.listens_[i]):n=void 0,n},t.prototype.onAuthRevoked_=function(e,t){m("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e=this;this.tryAuth(),Ga.forEach(this.listens_,function(t,n){Ga.forEach(n,function(t,n){e.sendListen_(n)})});for(var t=0;t<this.outstandingPuts_.length;t++)this.outstandingPuts_[t]&&this.sendPut_(t);for(;this.onDisconnectRequestQueue_.length;){var n=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(n.action,n.pathString,n.data,n.onComplete)}},t.prototype.sendConnectStats_=function(){var e={},t="js";Ga.CONSTANTS.NODE_ADMIN?t="admin_node":Ga.CONSTANTS.NODE_CLIENT&&(t="node"),e["sdk."+t+"."+r.SDK_VERSION.replace(/\./g,"-")]=1,Ga.isMobileCordova()?e["framework.cordova"]=1:Ga.isReactNative()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.shouldReconnect_=function(){var e=Mt.getInstance().currentlyOnline();return Ga.isEmpty(this.interruptReasons_)&&e},t.nextPersistentConnectionId_=0,t.nextConnectionId_=0,t}(Kt),zt=function(e){function t(t,n,i){var r=e.call(this)||this;return r.repoInfo_=t,r.onDataUpdate_=n,r.authTokenProvider_=i,r.log_=_("p:rest:"),r.listens_={},r}return Gs.__extends(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:(Ga.assert(e.getQueryParams().isDefault(),"should have a tag if it's not a default query."),e.path.toString())},t.prototype.listen=function(e,n,i,r){var o=this,s=e.path.toString();this.log_("Listen called for "+s+" "+e.queryIdentifier());var a=t.getListenId_(e,i),l={};this.listens_[a]=l;var u=e.getQueryParams().toRestQueryStringParameters();this.restRequest_(s+".json",u,function(e,t){var n=t;(404===e&&(n=null,e=null),null===e&&o.onDataUpdate_(s,n,!1,i),Ga.safeGet(o.listens_,a)===l)&&r(e?401==e?"permission_denied":"rest_error:"+e:"ok",null)})},t.prototype.unlisten=function(e,n){var i=t.getListenId_(e,n);delete this.listens_[i]},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,n){var i=this;void 0===t&&(t={}),t.format="export",this.authTokenProvider_.getToken(!1).then(function(r){var o=r&&r.accessToken;o&&(t.auth=o);var s=(i.repoInfo_.secure?"https://":"http://")+i.repoInfo_.host+e+"?ns="+i.repoInfo_.namespace+Ga.querystring(t);i.log_("Sending REST request for "+s);var a=new XMLHttpRequest;a.onreadystatechange=function(){if(n&&4===a.readyState){i.log_("REST Response for "+s+" received. status:",a.status,"response:",a.responseText);var e=null;if(a.status>=200&&a.status<300){try{e=Ga.jsonEval(a.responseText)}catch(e){w("Failed to parse JSON response for "+s+": "+a.responseText)}n(null,e)}else 401!==a.status&&404!==a.status&&w("Got unsuccessful REST response for "+s+" Status: "+a.status),n(a.status);n=null}},a.open("GET",s,!0),a.send()})},t}(Kt),Xt=function(){function e(e,t,n){var i=this;this.repoInfo_=e,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Nt,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new ze,this.persistentConnection_=null;var r=new St(n);if(this.stats_=kt.getCollection(e),t||R())this.server_=new zt(this.repoInfo_,this.onDataUpdate_.bind(this),r),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if(void 0!==o&&null!==o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Ga.stringify(o)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}this.persistentConnection_=new Yt(this.repoInfo_,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),r,o),this.server_=this.persistentConnection_}r.addTokenChangeListener(function(e){i.server_.refreshAuthToken(e)}),this.statsReporter_=kt.getOrCreateReporter(e,function(){return new Ot(i.stats_,i.server_)}),this.transactions_init_(),this.infoData_=new Et,this.infoSyncTree_=new Tt({startListening:function(e,t,n,r){var o=[],s=i.infoData_.getNode(e.path);return s.isEmpty()||(o=i.infoSyncTree_.applyServerOverwrite(e.path,s),setTimeout(function(){r("ok")},0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new Tt({startListening:function(e,t,n,r){return i.server_.listen(e,n,t,function(t,n){var o=r(t,n);i.eventQueue_.raiseEventsForChangedPath(e.path,o)}),[]},stopListening:function(e,t){i.server_.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e.prototype.name=function(){return this.repoInfo_.namespace},e.prototype.serverTime=function(){var e=this.infoData_.getNode(new F(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e},e.prototype.generateServerValues=function(){return(e=(e={timestamp:this.serverTime()})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e},e.prototype.onDataUpdate_=function(e,t,n,i){this.dataUpdateCount++;var r=new F(e);t=this.interceptServerDataCallback_?this.interceptServerDataCallback_(e,t):t;var o=[];if(i)if(n){var s=Ga.map(t,function(e){return je(e)});o=this.serverSyncTree_.applyTaggedQueryMerge(r,s,i)}else{var a=je(t);o=this.serverSyncTree_.applyTaggedQueryOverwrite(r,a,i)}else if(n){var l=Ga.map(t,function(e){return je(e)});o=this.serverSyncTree_.applyServerMerge(r,l)}else{var u=je(t);o=this.serverSyncTree_.applyServerOverwrite(r,u)}var c=r;o.length>0&&(c=this.rerunTransactions_(r)),this.eventQueue_.raiseEventsForChangedPath(c,o)},e.prototype.interceptServerData_=function(e){this.interceptServerDataCallback_=e},e.prototype.onConnectStatus_=function(e){this.updateInfo_("connected",e),!1===e&&this.runOnDisconnectEvents_()},e.prototype.onServerInfoUpdate_=function(e){var t=this;P(e,function(e,n){t.updateInfo_(n,e)})},e.prototype.updateInfo_=function(e,t){var n=new F("/.info/"+e),i=je(t);this.infoData_.updateSnapshot(n,i);var r=this.infoSyncTree_.applyServerOverwrite(n,i);this.eventQueue_.raiseEventsForChangedPath(n,r)},e.prototype.getNextWriteId_=function(){return this.nextWriteId_++},e.prototype.setWithPriority=function(e,t,n,i){var r=this;this.log_("set",{path:e.toString(),value:t,priority:n});var o=this.generateServerValues(),s=je(t,n),a=Ze(s,o),l=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserOverwrite(e,a,l,!0);this.eventQueue_.queueEvents(u),this.server_.put(e.toString(),s.val(!0),function(t,n){var o="ok"===t;o||w("set at "+e+" failed: "+t);var s=r.serverSyncTree_.ackUserWrite(l,!o);r.eventQueue_.raiseEventsForChangedPath(e,s),r.callOnCompleteCallback(i,t,n)});var c=this.abortTransactions_(e);this.rerunTransactions_(c),this.eventQueue_.raiseEventsForChangedPath(c,[])},e.prototype.update=function(e,t,n){var i=this;this.log_("update",{path:e.toString(),value:t});var r=!0,o=this.generateServerValues(),s={};if(Ga.forEach(t,function(e,t){r=!1;var n=je(t);s[e]=Ze(n,o)}),r)m("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var a=this.getNextWriteId_(),l=this.serverSyncTree_.applyUserMerge(e,s,a);this.eventQueue_.queueEvents(l),this.server_.merge(e.toString(),t,function(t,r){var o="ok"===t;o||w("update at "+e+" failed: "+t);var s=i.serverSyncTree_.ackUserWrite(a,!o),l=s.length>0?i.rerunTransactions_(e):e;i.eventQueue_.raiseEventsForChangedPath(l,s),i.callOnCompleteCallback(n,t,r)}),Ga.forEach(t,function(t){var n=i.abortTransactions_(e.child(t));i.rerunTransactions_(n)}),this.eventQueue_.raiseEventsForChangedPath(e,[])}},e.prototype.runOnDisconnectEvents_=function(){var e=this;this.log_("onDisconnectEvents");var t=this.generateServerValues(),n=[];(function(e,t){var n=new ze;return e.forEachTree(new F(""),function(e,i){n.remember(e,Ze(i,t))}),n})(this.onDisconnect_,t).forEachTree(F.Empty,function(t,i){n=n.concat(e.serverSyncTree_.applyServerOverwrite(t,i));var r=e.abortTransactions_(t);e.rerunTransactions_(r)}),this.onDisconnect_=new ze,this.eventQueue_.raiseEventsForChangedPath(F.Empty,n)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.server_.onDisconnectCancel(e.toString(),function(i,r){"ok"===i&&n.onDisconnect_.forget(e),n.callOnCompleteCallback(t,i,r)})},e.prototype.onDisconnectSet=function(e,t,n){var i=this,r=je(t);this.server_.onDisconnectPut(e.toString(),r.val(!0),function(t,o){"ok"===t&&i.onDisconnect_.remember(e,r),i.callOnCompleteCallback(n,t,o)})},e.prototype.onDisconnectSetWithPriority=function(e,t,n,i){var r=this,o=je(t,n);this.server_.onDisconnectPut(e.toString(),o.val(!0),function(t,n){"ok"===t&&r.onDisconnect_.remember(e,o),r.callOnCompleteCallback(i,t,n)})},e.prototype.onDisconnectUpdate=function(e,t,n){var i=this;if(Ga.isEmpty(t))return m("onDisconnect().update() called with empty data. Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(e.toString(),t,function(r,o){"ok"===r&&Ga.forEach(t,function(t,n){var r=je(n);i.onDisconnect_.remember(e.child(t),r)}),i.callOnCompleteCallback(n,r,o)})},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.addEventRegistration(e,t):this.serverSyncTree_.addEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.removeEventRegistration(e,t):this.serverSyncTree_.removeEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},e.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var t;e?(this.statsListener_||(this.statsListener_=new xt(this.stats_)),t=this.statsListener_.get()):t=this.stats_.get();var n=Object.keys(t).reduce(function(e,t){return Math.max(t.length,e)},0);Ga.forEach(t,function(e,t){for(var i=e.length;i<n+2;i++)e+=" ";console.log(e+t)})}},e.prototype.statsIncrementCounter=function(e){this.stats_.incrementCounter(e),this.statsReporter_.includeStat(e)},e.prototype.log_=function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];var i="";this.persistentConnection_&&(i=this.persistentConnection_.id+":"),m.apply(void 0,[i].concat(t))},e.prototype.callOnCompleteCallback=function(e,t,n){e&&D(function(){if("ok"==t)e(null);else{var i=(t||"error").toUpperCase(),r=i;n&&(r+=": "+n);var o=new Error(r);o.code=i,e(o)}})},Object.defineProperty(e.prototype,"database",{get:function(){return this.__database||(this.__database=new ln(this))},enumerable:!0,configurable:!0}),e}(),Zt=function(){function e(t){this.indexedFilter_=new ht(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t)}return e.prototype.getStartPost=function(){return this.startPost_},e.prototype.getEndPost=function(){return this.endPost_},e.prototype.matches=function(e){return this.index_.compare(this.getStartPost(),e)<=0&&this.index_.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,i,r,o){return this.matches(new he(t,n))||(n=Re.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,i,r,o)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=Re.EMPTY_NODE);var i=t.withIndex(this.index_);i=i.updatePriority(Re.EMPTY_NODE);var r=this;return t.forEachChild(Te,function(e,t){r.matches(new he(e,t))||(i=i.updateImmediateChild(e,Re.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,i,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.indexedFilter_},e.prototype.getIndex=function(){return this.index_},e.getStartPost_=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.getEndPost_=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}(),Jt=function(){function e(e){this.rangedFilter_=new Zt(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,i,r,o){return this.rangedFilter_.matches(new he(t,n))||(n=Re.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,i,r,o):this.fullLimitUpdateChild_(e,t,n,r,o)},e.prototype.updateFullNode=function(e,t,n){var i;if(t.isLeafNode()||t.isEmpty())i=Re.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){i=Re.EMPTY_NODE.withIndex(this.index_);var r=void 0;r=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;r.hasNext()&&o<this.limit_;){var s=r.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),s)<=0:this.index_.compare(s,this.rangedFilter_.getEndPost())<=0))break;i=i.updateImmediateChild(s.name,s.node),o++}}else{i=(i=t.withIndex(this.index_)).updatePriority(Re.EMPTY_NODE);var a=void 0,l=void 0,u=void 0;r=void 0;if(this.reverse_){r=i.getReverseIterator(this.index_),a=this.rangedFilter_.getEndPost(),l=this.rangedFilter_.getStartPost();var c=this.index_.getCompare();u=function(e,t){return c(t,e)}}else r=i.getIterator(this.index_),a=this.rangedFilter_.getStartPost(),l=this.rangedFilter_.getEndPost(),u=this.index_.getCompare();o=0;for(var h=!1;r.hasNext();){s=r.getNext();!h&&u(a,s)<=0&&(h=!0),h&&o<this.limit_&&u(s,l)<=0?o++:i=i.updateImmediateChild(s.name,Re.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,i,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},e.prototype.getIndex=function(){return this.index_},e.prototype.fullLimitUpdateChild_=function(e,t,n,i,r){var o;if(this.reverse_){var s=this.index_.getCompare();o=function(e,t){return s(t,e)}}else o=this.index_.getCompare();var a=e;Ga.assert(a.numChildren()==this.limit_,"");var l=new he(t,n),u=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),c=this.rangedFilter_.matches(l);if(a.hasChild(t)){for(var h=a.getImmediateChild(t),d=i.getChildAfterChild(this.index_,u,this.reverse_);null!=d&&(d.name==t||a.hasChild(d.name));)d=i.getChildAfterChild(this.index_,d,this.reverse_);var p=null==d?1:o(d,l);if(c&&!n.isEmpty()&&p>=0)return null!=r&&r.trackChildChange(ct.childChangedChange(t,n,h)),a.updateImmediateChild(t,n);null!=r&&r.trackChildChange(ct.childRemovedChange(t,h));var f=a.updateImmediateChild(t,Re.EMPTY_NODE);return null!=d&&this.rangedFilter_.matches(d)?(null!=r&&r.trackChildChange(ct.childAddedChange(d.name,d.node)),f.updateImmediateChild(d.name,d.node)):f}return n.isEmpty()?e:c&&o(u,l)>=0?(null!=r&&(r.trackChildChange(ct.childRemovedChange(u.name,u.node)),r.trackChildChange(ct.childAddedChange(t,n))),a.updateImmediateChild(t,n).updateImmediateChild(u.name,Re.EMPTY_NODE)):e},e}(),en=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Te}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return Ga.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return Ga.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:T},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return Ga.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return Ga.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:E},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return Ga.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.copy_=function(){var t=new e;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},e.prototype.limit=function(e){var t=this.copy_();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="",t},e.prototype.limitToFirst=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.copy_();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=t?(n.startNameSet_=!0,n.indexStartName_=t):(n.startNameSet_=!1,n.indexStartName_=""),n},e.prototype.endAt=function(e,t){var n=this.copy_();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==t?(n.endNameSet_=!0,n.indexEndName_=t):(n.endNameSet_=!1,n.indexEndName_=""),n},e.prototype.orderBy=function(e){var t=this.copy_();return t.index_=e,t},e.prototype.getQueryObject=function(){var t=e.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[t.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[t.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[t.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[t.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[t.LIMIT]=this.limit_;var i=this.viewFrom_;""===i&&(i=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=i}return this.index_!==Te&&(n[t.INDEX]=this.index_.toString()),n},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_==Te},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new ht(this.getIndex()):this.hasLimit()?new Jt(this):new Zt(this)},e.prototype.toRestQueryStringParameters=function(){var t,n=e.REST_QUERY_CONSTANTS_,i={};return this.isDefault()?i:(this.index_===Te?t=n.PRIORITY_INDEX:this.index_===Be?t=n.VALUE_INDEX:this.index_===fe?t=n.KEY_INDEX:(Ga.assert(this.index_ instanceof Ve,"Unrecognized index type!"),t=this.index_.toString()),i[n.ORDER_BY]=Ga.stringify(t),this.startSet_&&(i[n.START_AT]=Ga.stringify(this.indexStartValue_),this.startNameSet_&&(i[n.START_AT]+=","+Ga.stringify(this.indexStartName_))),this.endSet_&&(i[n.END_AT]=Ga.stringify(this.indexEndValue_),this.endNameSet_&&(i[n.END_AT]+=","+Ga.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?i[n.LIMIT_TO_FIRST]=this.limit_:i[n.LIMIT_TO_LAST]=this.limit_),i)},e.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},e.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},e.DEFAULT=new e,e}(),tn=function(e){function t(t,n){if(!(t instanceof Xt))throw new Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,en.DEFAULT,!1)||this}return Gs.__extends(t,e),t.prototype.getKey=function(){return Ga.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return Ga.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof e?e=String(e):e instanceof F||(null===this.path.getFront()?function(e,t,n,i){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),oe(e,t,n,i)}("Reference.child",1,e,!1):oe("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){Ga.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){Ga.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){Ga.validateArgCount("Reference.set",1,2,arguments.length),se("Reference.set",this.path),J("Reference.set",1,e,this.path,!1),Ga.validateCallback("Reference.set",2,t,!0);var n=new Ga.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(Ga.validateArgCount("Reference.update",1,2,arguments.length),se("Reference.update",this.path),Array.isArray(e)){for(var n={},i=0;i<e.length;++i)n[""+i]=e[i];e=n,w("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}te("Reference.update",1,e,this.path,!1),Ga.validateCallback("Reference.update",2,t,!0);var r=new Ga.Deferred;return this.repo.update(this.path,e,r.wrapCallback(t)),r.promise},t.prototype.setWithPriority=function(e,t,n){if(Ga.validateArgCount("Reference.setWithPriority",2,3,arguments.length),se("Reference.setWithPriority",this.path),J("Reference.setWithPriority",1,e,this.path,!1),ne("Reference.setWithPriority",2,t,!1),Ga.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var i=new Ga.Deferred;return this.repo.setWithPriority(this.path,e,t,i.wrapCallback(n)),i.promise},t.prototype.remove=function(e){return Ga.validateArgCount("Reference.remove",0,1,arguments.length),se("Reference.remove",this.path),Ga.validateCallback("Reference.remove",1,e,!0),this.set(null,e)},t.prototype.transaction=function(e,t,n){if(Ga.validateArgCount("Reference.transaction",1,3,arguments.length),se("Reference.transaction",this.path),Ga.validateCallback("Reference.transaction",1,e,!1),Ga.validateCallback("Reference.transaction",2,t,!0),function(e,t,n,i){if((!i||void 0!==n)&&"boolean"!=typeof n)throw new Error(Ga.errorPrefix(e,t,i)+"must be a boolean.")}("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var i=new Ga.Deferred;"function"==typeof t&&i.promise.catch(function(){});return this.repo.startTransaction(this.path,e,function(e,n,r){e?i.reject(e):i.resolve(new ue(n,r)),"function"==typeof t&&t(e,n,r)},n),i.promise},t.prototype.setPriority=function(e,t){Ga.validateArgCount("Reference.setPriority",1,2,arguments.length),se("Reference.setPriority",this.path),ne("Reference.setPriority",1,e,!1),Ga.validateCallback("Reference.setPriority",2,t,!0);var n=new Ga.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),e,null,n.wrapCallback(t)),n.promise},t.prototype.push=function(e,t){Ga.validateArgCount("Reference.push",0,2,arguments.length),se("Reference.push",this.path),J("Reference.push",1,e,this.path,!0),Ga.validateCallback("Reference.push",2,t,!0);var n,i=this.repo.serverTime(),r=ce(i),o=this.child(r),s=this.child(r);return n=null!=e?o.set(e,t).then(function(){return s}):Promise.resolve(s),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof t&&n.catch(function(){}),o},t.prototype.onDisconnect=function(){return se("Reference.onDisconnect",this.path),new le(this.repo,this.path)},Object.defineProperty(t.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),t}(Qe);Qe.__referenceConstructor=tn,yt.__referenceConstructor=tn;var nn,rn=function(){return function(){this.children={},this.childCount=0,this.value=null}}(),on=function(){function e(e,t,n){void 0===e&&(e=""),void 0===t&&(t=null),void 0===n&&(n=new rn),this.name_=e,this.parent_=t,this.node_=n}return e.prototype.subTree=function(t){for(var n,i=t instanceof F?t:new F(t),r=this;null!==(n=i.getFront());){r=new e(n,r,Ga.safeGet(r.node_.children,n)||new rn),i=i.popFront()}return r},e.prototype.getValue=function(){return this.node_.value},e.prototype.setValue=function(e){Ga.assert(void 0!==e,"Cannot set value to undefined"),this.node_.value=e,this.updateParents_()},e.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},e.prototype.hasChildren=function(){return this.node_.childCount>0},e.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},e.prototype.forEachChild=function(t){var n=this;Ga.forEach(this.node_.children,function(i,r){t(new e(i,n,r))})},e.prototype.forEachDescendant=function(e,t,n){t&&!n&&e(this),this.forEachChild(function(t){t.forEachDescendant(e,!0,n)}),t&&n&&e(this)},e.prototype.forEachAncestor=function(e,t){for(var n=t?this:this.parent();null!==n;){if(e(n))return!0;n=n.parent()}return!1},e.prototype.forEachImmediateDescendantWithValue=function(e){this.forEachChild(function(t){null!==t.getValue()?e(t):t.forEachImmediateDescendantWithValue(e)})},e.prototype.path=function(){return new F(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},e.prototype.name=function(){return this.name_},e.prototype.parent=function(){return this.parent_},e.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},e.prototype.updateChild_=function(e,t){var n=t.isEmpty(),i=Ga.contains(this.node_.children,e);n&&i?(delete this.node_.children[e],this.node_.childCount--,this.updateParents_()):n||i||(this.node_.children[e]=t.node_,this.node_.childCount++,this.updateParents_())},e}();!function(e){e[e.RUN=0]="RUN",e[e.SENT=1]="SENT",e[e.COMPLETED=2]="COMPLETED",e[e.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",e[e.NEEDS_ABORT=4]="NEEDS_ABORT"}(nn||(nn={})),Xt.MAX_TRANSACTION_RETRIES_=25,Xt.prototype.transactions_init_=function(){this.transactionQueueTree_=new on},Xt.prototype.startTransaction=function(e,t,n,i){this.log_("transaction on "+e);var r=function(){},o=new tn(this,e);o.on("value",r);var s={path:e,update:t,onComplete:n,status:null,order:h(),applyLocally:i,retryCount:0,unwatcher:function(){o.off("value",r)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},a=this.getLatestState_(e);s.currentInputSnapshot=a;var l=s.update(a.val());if(void 0===l){if(s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete){var u=new He(s.currentInputSnapshot,new tn(this,s.path),Te);s.onComplete(null,!1,u)}}else{ee("transaction failed: Data returned ",l,s.path),s.status=nn.RUN;var c=this.transactionQueueTree_.subTree(e),d=c.getValue()||[];d.push(s),c.setValue(d);var p=void 0;if("object"==typeof l&&null!==l&&Ga.contains(l,".priority"))p=Ga.safeGet(l,".priority"),Ga.assert(Z(p),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else p=(this.serverSyncTree_.calcCompleteEventCache(e)||Re.EMPTY_NODE).getPriority().val();p=p;var f=this.generateServerValues(),g=je(l,p),v=Ze(g,f);s.currentOutputSnapshotRaw=g,s.currentOutputSnapshotResolved=v,s.currentWriteId=this.getNextWriteId_();var m=this.serverSyncTree_.applyUserOverwrite(e,v,s.currentWriteId,s.applyLocally);this.eventQueue_.raiseEventsForChangedPath(e,m),this.sendReadyTransactions_()}},Xt.prototype.getLatestState_=function(e,t){return this.serverSyncTree_.calcCompleteEventCache(e,t)||Re.EMPTY_NODE},Xt.prototype.sendReadyTransactions_=function(e){var t=this;if(void 0===e&&(e=this.transactionQueueTree_),e||this.pruneCompletedTransactionsBelowNode_(e),null!==e.getValue()){var n=this.buildTransactionQueue_(e);Ga.assert(n.length>0,"Sending zero length transaction queue"),n.every(function(e){return e.status===nn.RUN})&&this.sendTransactionQueue_(e.path(),n)}else e.hasChildren()&&e.forEachChild(function(e){t.sendReadyTransactions_(e)})},Xt.prototype.sendTransactionQueue_=function(e,t){for(var n=this,i=t.map(function(e){return e.currentWriteId}),r=this.getLatestState_(e,i),o=r,s=r.hash(),a=0;a<t.length;a++){var l=t[a];Ga.assert(l.status===nn.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),l.status=nn.SENT,l.retryCount++;var u=F.relativePath(e,l.path);o=o.updateChild(u,l.currentOutputSnapshotRaw)}var c=o.val(!0),h=e;this.server_.put(h.toString(),c,function(i){n.log_("transaction put response",{path:h.toString(),status:i});var r=[];if("ok"===i){for(var o=[],s=0;s<t.length;s++){if(t[s].status=nn.COMPLETED,r=r.concat(n.serverSyncTree_.ackUserWrite(t[s].currentWriteId)),t[s].onComplete){var a=t[s].currentOutputSnapshotResolved,l=new tn(n,t[s].path),u=new He(a,l,Te);o.push(t[s].onComplete.bind(null,null,!0,u))}t[s].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(e)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(e,r);for(s=0;s<o.length;s++)D(o[s])}else{if("datastale"===i)for(s=0;s<t.length;s++)t[s].status===nn.SENT_NEEDS_ABORT?t[s].status=nn.NEEDS_ABORT:t[s].status=nn.RUN;else{w("transaction at "+h.toString()+" failed: "+i);for(s=0;s<t.length;s++)t[s].status=nn.NEEDS_ABORT,t[s].abortReason=i}n.rerunTransactions_(e)}},s)},Xt.prototype.rerunTransactions_=function(e){var t=this.getAncestorTransactionNode_(e),n=t.path(),i=this.buildTransactionQueue_(t);return this.rerunTransactionQueue_(i,n),n},Xt.prototype.rerunTransactionQueue_=function(e,t){if(0!==e.length){for(var n,i=[],r=[],o=e.filter(function(e){return e.status===nn.RUN}).map(function(e){return e.currentWriteId}),s=0;s<e.length;s++){var a=e[s],l=F.relativePath(t,a.path),u=!1,c=void 0;if(Ga.assert(null!==l,"rerunTransactionsUnderNode_: relativePath should not be null."),a.status===nn.NEEDS_ABORT)u=!0,c=a.abortReason,r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0));else if(a.status===nn.RUN)if(a.retryCount>=Xt.MAX_TRANSACTION_RETRIES_)u=!0,c="maxretry",r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0));else{var h=this.getLatestState_(a.path,o);a.currentInputSnapshot=h;var d=e[s].update(h.val());if(void 0!==d){ee("transaction failed: Data returned ",d,a.path);var p=je(d);"object"==typeof d&&null!=d&&Ga.contains(d,".priority")||(p=p.updatePriority(h.getPriority()));var f=a.currentWriteId,g=this.generateServerValues(),v=Ze(p,g);a.currentOutputSnapshotRaw=p,a.currentOutputSnapshotResolved=v,a.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(f),1),r=(r=r.concat(this.serverSyncTree_.applyUserOverwrite(a.path,v,a.currentWriteId,a.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(f,!0))}else u=!0,c="nodata",r=r.concat(this.serverSyncTree_.ackUserWrite(a.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(t,r),r=[],u&&(e[s].status=nn.COMPLETED,n=e[s].unwatcher,setTimeout(n,Math.floor(0)),e[s].onComplete))if("nodata"===c){var m=new tn(this,e[s].path),_=e[s].currentInputSnapshot,y=new He(_,m,Te);i.push(e[s].onComplete.bind(null,null,!1,y))}else i.push(e[s].onComplete.bind(null,new Error(c),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(s=0;s<i.length;s++)D(i[s]);this.sendReadyTransactions_()}},Xt.prototype.getAncestorTransactionNode_=function(e){for(var t,n=this.transactionQueueTree_;null!==(t=e.getFront())&&null===n.getValue();)n=n.subTree(t),e=e.popFront();return n},Xt.prototype.buildTransactionQueue_=function(e){var t=[];return this.aggregateTransactionQueuesForNode_(e,t),t.sort(function(e,t){return e.order-t.order}),t},Xt.prototype.aggregateTransactionQueuesForNode_=function(e,t){var n=this,i=e.getValue();if(null!==i)for(var r=0;r<i.length;r++)t.push(i[r]);e.forEachChild(function(e){n.aggregateTransactionQueuesForNode_(e,t)})},Xt.prototype.pruneCompletedTransactionsBelowNode_=function(e){var t=this,n=e.getValue();if(n){for(var i=0,r=0;r<n.length;r++)n[r].status!==nn.COMPLETED&&(n[i]=n[r],i++);n.length=i,e.setValue(n.length>0?n:null)}e.forEachChild(function(e){t.pruneCompletedTransactionsBelowNode_(e)})},Xt.prototype.abortTransactions_=function(e){var t=this,n=this.getAncestorTransactionNode_(e).path(),i=this.transactionQueueTree_.subTree(e);return i.forEachAncestor(function(e){t.abortTransactionsOnNode_(e)}),this.abortTransactionsOnNode_(i),i.forEachDescendant(function(e){t.abortTransactionsOnNode_(e)}),n},Xt.prototype.abortTransactionsOnNode_=function(e){var t=e.getValue();if(null!==t){for(var n=[],i=[],r=-1,o=0;o<t.length;o++)if(t[o].status===nn.SENT_NEEDS_ABORT);else if(t[o].status===nn.SENT)Ga.assert(r===o-1,"All SENT items should be at beginning of queue."),r=o,t[o].status=nn.SENT_NEEDS_ABORT,t[o].abortReason="set";else if(Ga.assert(t[o].status===nn.RUN,"Unexpected transaction status in abort"),t[o].unwatcher(),i=i.concat(this.serverSyncTree_.ackUserWrite(t[o].currentWriteId,!0)),t[o].onComplete){n.push(t[o].onComplete.bind(null,new Error("set"),!1,null))}-1===r?e.setValue(null):t.length=r+1,this.eventQueue_.raiseEventsForChangedPath(e.path(),i);for(o=0;o<n.length;o++)D(n[o])}};var sn,an=function(){function e(){this.repos_={},this.useRestClient_=!1}return e.getInstance=function(){return sn||(sn=new e),sn},e.prototype.interrupt=function(){for(var e in this.repos_)for(var t in this.repos_[e])this.repos_[e][t].interrupt()},e.prototype.resume=function(){for(var e in this.repos_)for(var t in this.repos_[e])this.repos_[e][t].resume()},e.prototype.databaseFromApp=function(e,t){var n=t||e.options.databaseURL;void 0===n&&b("Can't determine Firebase Database URL. Be sure to include databaseURL option when calling firebase.initializeApp().");var i=K(n),r=i.repoInfo;return ae("Invalid Firebase Database URL",1,i),i.path.isEmpty()||b("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(r,e).database},e.prototype.deleteRepo=function(e){var t=Ga.safeGet(this.repos_,e.app.name);t&&Ga.safeGet(t,e.repoInfo_.toURLString())===e||b("Database "+e.app.name+"("+e.repoInfo_+") has already been deleted."),e.interrupt(),delete t[e.repoInfo_.toURLString()]},e.prototype.createRepo=function(e,t){var n=Ga.safeGet(this.repos_,t.name);n||(n={},this.repos_[t.name]=n);var i=Ga.safeGet(n,e.toURLString());return i&&b("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new Xt(e,this.useRestClient_,t),n[e.toURLString()]=i,i},e.prototype.forceRestClient=function(e){this.useRestClient_=e},e}(),ln=function(){function e(e){this.repo_=e,e instanceof Xt||b("Don't call new Database() directly - please use firebase.database()."),this.root_=new tn(e,F.Empty),this.INTERNAL=new un(this)}return Object.defineProperty(e.prototype,"app",{get:function(){return this.repo_.app},enumerable:!0,configurable:!0}),e.prototype.ref=function(e){return this.checkDeleted_("ref"),Ga.validateArgCount("database.ref",0,1,arguments.length),e instanceof tn?this.refFromURL(e.toString()):void 0!==e?this.root_.child(e):this.root_},e.prototype.refFromURL=function(e){var t="database.refFromURL";this.checkDeleted_(t),Ga.validateArgCount(t,1,1,arguments.length);var n=K(e);ae(t,1,n);var i=n.repoInfo;return i.host!==this.repo_.repoInfo_.host&&b(t+": Host name does not match the current database: (found "+i.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},e.prototype.checkDeleted_=function(e){null===this.repo_&&b("Cannot call "+e+" on a deleted database.")},e.prototype.goOffline=function(){Ga.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},e.prototype.goOnline=function(){Ga.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},e.ServerValue={TIMESTAMP:{".sv":"timestamp"}},e}(),un=function(){function e(e){this.database=e}return e.prototype.delete=function(){return Gs.__awaiter(this,void 0,void 0,function(){return Gs.__generator(this,function(e){return this.database.checkDeleted_("delete"),an.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]})})},e}(),cn=Object.freeze({forceLongPolling:function(){Ht.forceDisallow(),Wt.forceAllow()},forceWebSockets:function(){Wt.forceDisallow()},isWebSocketsAvailable:function(){return Ht.isAvailable()},setSecurityDebugCallback:function(e,t){e.repo.persistentConnection_.securityDebugCallback_=t},stats:function(e,t){e.repo.stats(t)},statsIncrementCounter:function(e,t){e.repo.statsIncrementCounter(t)},dataUpdateCount:function(e){return e.repo.dataUpdateCount},interceptServerData:function(e,t){return e.repo.interceptServerData_(t)}}),hn=Yt;Yt.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},Yt.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};var dn=Gt,pn=W,fn=Object.freeze({DataConnection:hn,RealTimeConnection:dn,hijackHash:function(e){var t=Yt.prototype.put;return Yt.prototype.put=function(n,i,r,o){void 0!==o&&(o=e()),t.call(this,n,i,r,o)},function(){Yt.prototype.put=t}},ConnectionTarget:pn,queryIdentifier:function(e){return e.queryIdentifier()},listens:function(e){return e.repo.persistentConnection_.listens_},forceRestClient:function(e){an.getInstance().forceRestClient(e)}}),gn=ln.ServerValue;function vn(t){var n=t.INTERNAL.registerService("database",function(e,t,n){return an.getInstance().databaseFromApp(e,n)},{Reference:tn,Query:Qe,Database:ln,enableLogging:v,INTERNAL:cn,ServerValue:gn,TEST_ACCESS:fn},null,!0);Ga.isNodeSdk()&&(e.exports=n)}vn(r),t.registerDatabase=vn,t.Database=ln,t.Query=Qe,t.Reference=tn,t.enableLogging=v,t.ServerValue=gn,t.DataSnapshot=He,t.OnDisconnect=le});Xe(sl);sl.registerDatabase,sl.Database,sl.Query,sl.Reference,sl.enableLogging,sl.ServerValue,sl.DataSnapshot,sl.OnDisconnect;var al,ll,ul,cl={AVAILABLE_IN_WINDOW:"only-available-in-window",AVAILABLE_IN_SW:"only-available-in-sw",SHOULD_BE_INHERITED:"should-be-overriden",BAD_SENDER_ID:"bad-sender-id",INCORRECT_GCM_SENDER_ID:"incorrect-gcm-sender-id",PERMISSION_DEFAULT:"permission-default",PERMISSION_BLOCKED:"permission-blocked",UNSUPPORTED_BROWSER:"unsupported-browser",NOTIFICATIONS_BLOCKED:"notifications-blocked",FAILED_DEFAULT_REGISTRATION:"failed-serviceworker-registration",SW_REGISTRATION_EXPECTED:"sw-registration-expected",GET_SUBSCRIPTION_FAILED:"get-subscription-failed",INVALID_SAVED_TOKEN:"invalid-saved-token",SW_REG_REDUNDANT:"sw-reg-redundant",TOKEN_SUBSCRIBE_FAILED:"token-subscribe-failed",TOKEN_SUBSCRIBE_NO_TOKEN:"token-subscribe-no-token",TOKEN_SUBSCRIBE_NO_PUSH_SET:"token-subscribe-no-push-set",TOKEN_UNSUBSCRIBE_FAILED:"token-unsubscribe-failed",TOKEN_UPDATE_FAILED:"token-update-failed",TOKEN_UPDATE_NO_TOKEN:"token-update-no-token",USE_SW_BEFORE_GET_TOKEN:"use-sw-before-get-token",INVALID_DELETE_TOKEN:"invalid-delete-token",DELETE_TOKEN_NOT_FOUND:"delete-token-not-found",DELETE_SCOPE_NOT_FOUND:"delete-scope-not-found",BG_HANDLER_FUNCTION_EXPECTED:"bg-handler-function-expected",NO_WINDOW_CLIENT_TO_MSG:"no-window-client-to-msg",UNABLE_TO_RESUBSCRIBE:"unable-to-resubscribe",NO_FCM_TOKEN_FOR_RESUBSCRIBE:"no-fcm-token-for-resubscribe",FAILED_TO_DELETE_TOKEN:"failed-to-delete-token",NO_SW_IN_REG:"no-sw-in-reg",BAD_SCOPE:"bad-scope",BAD_VAPID_KEY:"bad-vapid-key",BAD_SUBSCRIPTION:"bad-subscription",BAD_TOKEN:"bad-token",BAD_PUSH_SET:"bad-push-set",FAILED_DELETE_VAPID_KEY:"failed-delete-vapid-key",INVALID_PUBLIC_VAPID_KEY:"invalid-public-vapid-key",USE_PUBLIC_KEY_BEFORE_GET_TOKEN:"use-public-key-before-get-token",PUBLIC_KEY_DECRYPTION_FAILED:"public-vapid-key-decryption-failed"},hl=new la("messaging","Messaging",((al={})[cl.AVAILABLE_IN_WINDOW]="This method is available in a Window context.",al[cl.AVAILABLE_IN_SW]="This method is available in a service worker context.",al[cl.SHOULD_BE_INHERITED]="This method should be overriden by extended classes.",al[cl.BAD_SENDER_ID]="Please ensure that 'messagingSenderId' is set correctly in the options passed into firebase.initializeApp().",al[cl.PERMISSION_DEFAULT]="The required permissions were not granted and dismissed instead.",al[cl.PERMISSION_BLOCKED]="The required permissions were not granted and blocked instead.",al[cl.UNSUPPORTED_BROWSER]="This browser doesn't support the API's required to use the firebase SDK.",al[cl.NOTIFICATIONS_BLOCKED]="Notifications have been blocked.",al[cl.FAILED_DEFAULT_REGISTRATION]="We are unable to register the default service worker. {$browserErrorMessage}",al[cl.SW_REGISTRATION_EXPECTED]="A service worker registration was the expected input.",al[cl.GET_SUBSCRIPTION_FAILED]="There was an error when trying to get any existing Push Subscriptions.",al[cl.INVALID_SAVED_TOKEN]="Unable to access details of the saved token.",al[cl.SW_REG_REDUNDANT]="The service worker being used for push was made redundant.",al[cl.TOKEN_SUBSCRIBE_FAILED]="A problem occured while subscribing the user to FCM: {$message}",al[cl.TOKEN_SUBSCRIBE_NO_TOKEN]="FCM returned no token when subscribing the user to push.",al[cl.TOKEN_SUBSCRIBE_NO_PUSH_SET]="FCM returned an invalid response when getting an FCM token.",al[cl.TOKEN_UNSUBSCRIBE_FAILED]="A problem occured while unsubscribing the user from FCM: {$message}",al[cl.TOKEN_UPDATE_FAILED]="A problem occured while updating the user from FCM: {$message}",al[cl.TOKEN_UPDATE_NO_TOKEN]="FCM returned no token when updating the user to push.",al[cl.USE_SW_BEFORE_GET_TOKEN]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",al[cl.INVALID_DELETE_TOKEN]="You must pass a valid token into deleteToken(), i.e. the token from getToken().",al[cl.DELETE_TOKEN_NOT_FOUND]="The deletion attempt for token could not be performed as the token was not found.",al[cl.DELETE_SCOPE_NOT_FOUND]="The deletion attempt for service worker scope could not be performed as the scope was not found.",al[cl.BG_HANDLER_FUNCTION_EXPECTED]="The input to setBackgroundMessageHandler() must be a function.",al[cl.NO_WINDOW_CLIENT_TO_MSG]="An attempt was made to message a non-existant window client.",al[cl.UNABLE_TO_RESUBSCRIBE]="There was an error while re-subscribing the FCM token for push messaging. Will have to resubscribe the user on next visit. {$message}",al[cl.NO_FCM_TOKEN_FOR_RESUBSCRIBE]="Could not find an FCM token and as a result, unable to resubscribe. Will have to resubscribe the user on next visit.",al[cl.FAILED_TO_DELETE_TOKEN]="Unable to delete the currently saved token.",al[cl.NO_SW_IN_REG]="Even though the service worker registration was successful, there was a problem accessing the service worker itself.",al[cl.INCORRECT_GCM_SENDER_ID]="Please change your web app manifest's 'gcm_sender_id' value to '103953800507' to use Firebase messaging.",al[cl.BAD_SCOPE]="The service worker scope must be a string with at least one character.",al[cl.BAD_VAPID_KEY]="The public VAPID key is not a Uint8Array with 65 bytes.",al[cl.BAD_SUBSCRIPTION]="The subscription must be a valid PushSubscription.",al[cl.BAD_TOKEN]="The FCM Token used for storage / lookup was not a valid token string.",al[cl.BAD_PUSH_SET]="The FCM push set used for storage / lookup was not not a valid push set string.",al[cl.FAILED_DELETE_VAPID_KEY]="The VAPID key could not be deleted.",al[cl.INVALID_PUBLIC_VAPID_KEY]="The public VAPID key must be a string.",al[cl.PUBLIC_KEY_DECRYPTION_FAILED]="The public VAPID key did not equal 65 bytes when decrypted.",al)),dl=new Uint8Array([4,51,148,247,223,161,235,177,220,3,162,94,21,113,219,72,211,46,237,237,178,52,219,183,71,58,12,143,196,204,225,111,60,140,132,223,171,182,102,62,242,12,212,139,254,227,249,118,47,20,28,99,8,106,111,45,177,26,149,176,206,55,192,156,110]),pl="https://fcm.googleapis.com";function fl(e,t){if(null==e||null==t)return!1;if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var n=new DataView(e),i=new DataView(t),r=0;r<e.byteLength;r++)if(n.getUint8(r)!==i.getUint8(r))return!1;return!0}function gl(e){return function(e){var t=new Uint8Array(e);return btoa(String.fromCharCode.apply(String,Vs(t)))}(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}!function(e){e.TYPE_OF_MSG="firebase-messaging-msg-type",e.DATA="firebase-messaging-msg-data"}(ll||(ll={})),function(e){e.PUSH_MSG_RECEIVED="push-msg-received",e.NOTIFICATION_CLICKED="notification-clicked"}(ul||(ul={}));var vl=function(){function e(){}return e.prototype.getToken=function(e,t,n){return js(this,void 0,void 0,function(){var i,r,o,s,a,l,u,c;return Us(this,function(h){switch(h.label){case 0:i=gl(t.getKey("p256dh")),r=gl(t.getKey("auth")),o="authorized_entity="+e+"&endpoint="+t.endpoint+"&encryption_key="+i+"&encryption_auth="+r,fl(n.buffer,dl.buffer)||(s=gl(n),o+="&application_pub_key="+s),(a=new Headers).append("Content-Type","application/x-www-form-urlencoded"),l={method:"POST",headers:a,body:o},h.label=1;case 1:return h.trys.push([1,4,,5]),[4,fetch(pl+"/fcm/connect/subscribe",l)];case 2:return[4,h.sent().json()];case 3:return u=h.sent(),[3,5];case 4:throw h.sent(),hl.create(cl.TOKEN_SUBSCRIBE_FAILED);case 5:if(u.error)throw c=u.error.message,hl.create(cl.TOKEN_SUBSCRIBE_FAILED,{message:c});if(!u.token)throw hl.create(cl.TOKEN_SUBSCRIBE_NO_TOKEN);if(!u.pushSet)throw hl.create(cl.TOKEN_SUBSCRIBE_NO_PUSH_SET);return[2,{token:u.token,pushSet:u.pushSet}]}})})},e.prototype.updateToken=function(e,t,n,i,r){return js(this,void 0,void 0,function(){var o,s,a,l,u,c,h,d;return Us(this,function(p){switch(p.label){case 0:o=gl(i.getKey("p256dh")),s=gl(i.getKey("auth")),a="push_set="+n+"&token="+t+"&authorized_entity="+e+"&endpoint="+i.endpoint+"&encryption_key="+o+"&encryption_auth="+s,fl(r.buffer,dl.buffer)||(l=gl(r),a+="&application_pub_key="+l),(u=new Headers).append("Content-Type","application/x-www-form-urlencoded"),c={method:"POST",headers:u,body:a},p.label=1;case 1:return p.trys.push([1,4,,5]),[4,fetch(pl+"/fcm/connect/subscribe",c)];case 2:return[4,p.sent().json()];case 3:return h=p.sent(),[3,5];case 4:throw p.sent(),hl.create(cl.TOKEN_UPDATE_FAILED);case 5:if(h.error)throw d=h.error.message,hl.create(cl.TOKEN_UPDATE_FAILED,{message:d});if(!h.token)throw hl.create(cl.TOKEN_UPDATE_NO_TOKEN);return[2,h.token]}})})},e.prototype.deleteToken=function(e,t,n){return js(this,void 0,void 0,function(){var i,r,o,s,a;return Us(this,function(l){switch(l.label){case 0:i="authorized_entity="+e+"&token="+t+"&pushSet="+n,(r=new Headers).append("Content-Type","application/x-www-form-urlencoded"),o={method:"POST",headers:r,body:i},l.label=1;case 1:return l.trys.push([1,4,,5]),[4,fetch(pl+"/fcm/connect/unsubscribe",o)];case 2:return[4,l.sent().json()];case 3:if((s=l.sent()).error)throw a=s.error.message,hl.create(cl.TOKEN_UNSUBSCRIBE_FAILED,{message:a});return[3,5];case 4:throw l.sent(),hl.create(cl.TOKEN_UNSUBSCRIBE_FAILED);case 5:return[2]}})})},e}();function ml(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=atob(t),i=new Uint8Array(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}var _l="undefined",yl="fcm_token_object_Store";function bl(){var e=indexedDB.open(_l);e.onerror=function(e){},e.onsuccess=function(t){!function(e){if(e.objectStoreNames.contains(yl)){var t=e.transaction(yl).objectStore(yl),n=new vl,i=t.openCursor();i.onerror=function(e){console.warn("Unable to cleanup old IDB.",e)},i.onsuccess=function(){var t=i.result;if(t){var r=t.value;n.deleteToken(r.fcmSenderId,r.fcmToken,r.fcmPushSet),t.continue()}else e.close(),indexedDB.deleteDatabase(_l)}}}(e.result)}}var wl=function(){function e(){this.dbPromise=null}return e.prototype.get=function(e){return this.createTransaction(function(t){return t.get(e)})},e.prototype.getIndex=function(e,t){return this.createTransaction(function(n){return n.index(e).get(t)})},e.prototype.put=function(e){return this.createTransaction(function(t){return t.put(e)},"readwrite")},e.prototype.delete=function(e){return this.createTransaction(function(t){return t.delete(e)},"readwrite")},e.prototype.closeDatabase=function(){return js(this,void 0,void 0,function(){return Us(this,function(e){switch(e.label){case 0:return this.dbPromise?[4,this.dbPromise]:[3,2];case 1:e.sent().close(),this.dbPromise=null,e.label=2;case 2:return[2]}})})},e.prototype.createTransaction=function(e,t){return void 0===t&&(t="readonly"),js(this,void 0,void 0,function(){var n,i,r,o;return Us(this,function(s){switch(s.label){case 0:return[4,this.getDb()];case 1:return n=s.sent(),i=n.transaction(this.objectStoreName,t),r=i.objectStore(this.objectStoreName),[4,function(e){return new Promise(function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)}})}(e(r))];case 2:return o=s.sent(),[2,new Promise(function(e,t){i.oncomplete=function(){e(o)},i.onerror=function(){t(i.error)}})]}})})},e.prototype.getDb=function(){var e=this;return this.dbPromise||(this.dbPromise=new Promise(function(t,n){var i=indexedDB.open(e.dbName,e.dbVersion);i.onsuccess=function(){t(i.result)},i.onerror=function(){e.dbPromise=null,n(i.error)},i.onupgradeneeded=function(t){return e.onDbUpgrade(i,t)}})),this.dbPromise},e}();var Cl=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dbName="fcm_token_details_db",t.dbVersion=3,t.objectStoreName="fcm_token_object_Store",t}return Ms(t,e),t.prototype.onDbUpgrade=function(e,t){var n=e.result;switch(t.oldVersion){case 0:(i=n.createObjectStore(this.objectStoreName,{keyPath:"swScope"})).createIndex("fcmSenderId","fcmSenderId",{unique:!1}),i.createIndex("fcmToken","fcmToken",{unique:!0});case 1:bl();case 2:var i,r=(i=e.transaction.objectStore(this.objectStoreName)).openCursor();r.onsuccess=function(){var e=r.result;if(e){var t=e.value,n=Fs({},t);t.createTime||(n.createTime=Date.now()),"string"==typeof t.vapidKey&&(n.vapidKey=ml(t.vapidKey)),"string"==typeof t.auth&&(n.auth=ml(t.auth).buffer),"string"==typeof t.auth&&(n.p256dh=ml(t.p256dh).buffer),e.update(n),e.continue()}}}},t.prototype.getTokenDetailsFromToken=function(e){return js(this,void 0,void 0,function(){return Us(this,function(t){if(!e)throw hl.create(cl.BAD_TOKEN);return Tl({fcmToken:e}),[2,this.getIndex("fcmToken",e)]})})},t.prototype.getTokenDetailsFromSWScope=function(e){return js(this,void 0,void 0,function(){return Us(this,function(t){if(!e)throw hl.create(cl.BAD_SCOPE);return Tl({swScope:e}),[2,this.get(e)]})})},t.prototype.saveTokenDetails=function(e){return js(this,void 0,void 0,function(){return Us(this,function(t){if(!e.swScope)throw hl.create(cl.BAD_SCOPE);if(!e.vapidKey)throw hl.create(cl.BAD_VAPID_KEY);if(!e.endpoint||!e.auth||!e.p256dh)throw hl.create(cl.BAD_SUBSCRIPTION);if(!e.fcmSenderId)throw hl.create(cl.BAD_SENDER_ID);if(!e.fcmToken)throw hl.create(cl.BAD_TOKEN);if(!e.fcmPushSet)throw hl.create(cl.BAD_PUSH_SET);return Tl(e),[2,this.put(e)]})})},t.prototype.deleteToken=function(e){return js(this,void 0,void 0,function(){var t;return Us(this,function(n){switch(n.label){case 0:return"string"!=typeof e||0===e.length?[2,Promise.reject(hl.create(cl.INVALID_DELETE_TOKEN))]:[4,this.getTokenDetailsFromToken(e)];case 1:if(!(t=n.sent()))throw hl.create(cl.DELETE_TOKEN_NOT_FOUND);return[4,this.delete(t.swScope)];case 2:return n.sent(),[2,t]}})})},t}(wl);function Tl(e){if(e.fcmToken&&("string"!=typeof e.fcmToken||0===e.fcmToken.length))throw hl.create(cl.BAD_TOKEN);if(e.swScope&&("string"!=typeof e.swScope||0===e.swScope.length))throw hl.create(cl.BAD_SCOPE);if(e.vapidKey&&(!(e.vapidKey instanceof Uint8Array)||65!==e.vapidKey.length))throw hl.create(cl.BAD_VAPID_KEY);if(e.endpoint&&("string"!=typeof e.endpoint||0===e.endpoint.length))throw hl.create(cl.BAD_SUBSCRIPTION);if(e.auth&&!(e.auth instanceof ArrayBuffer))throw hl.create(cl.BAD_SUBSCRIPTION);if(e.p256dh&&!(e.p256dh instanceof ArrayBuffer))throw hl.create(cl.BAD_SUBSCRIPTION);if(e.fcmSenderId&&("string"!=typeof e.fcmSenderId||0===e.fcmSenderId.length))throw hl.create(cl.BAD_SENDER_ID);if(e.fcmPushSet&&("string"!=typeof e.fcmPushSet||0===e.fcmPushSet.length))throw hl.create(cl.BAD_PUSH_SET)}var El=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dbName="fcm_vapid_details_db",t.dbVersion=1,t.objectStoreName="fcm_vapid_object_Store",t}return Ms(t,e),t.prototype.onDbUpgrade=function(e){e.result.createObjectStore(this.objectStoreName,{keyPath:"swScope"})},t.prototype.getVapidFromSWScope=function(e){return js(this,void 0,void 0,function(){var t;return Us(this,function(n){switch(n.label){case 0:if("string"!=typeof e||0===e.length)throw hl.create(cl.BAD_SCOPE);return[4,this.get(e)];case 1:return[2,(t=n.sent())?t.vapidKey:void 0]}})})},t.prototype.saveVapidDetails=function(e,t){return js(this,void 0,void 0,function(){var n;return Us(this,function(i){if("string"!=typeof e||0===e.length)throw hl.create(cl.BAD_SCOPE);if(null===t||65!==t.length)throw hl.create(cl.BAD_VAPID_KEY);return n={swScope:e,vapidKey:t},[2,this.put(n)]})})},t.prototype.deleteVapidDetails=function(e){return js(this,void 0,void 0,function(){var t;return Us(this,function(n){switch(n.label){case 0:return[4,this.getVapidFromSWScope(e)];case 1:if(!(t=n.sent()))throw hl.create(cl.DELETE_SCOPE_NOT_FOUND);return[4,this.delete(e)];case 2:return n.sent(),[2,t]}})})},t}(wl),Sl="messagingSenderId",Il=function(){function e(e){var t=this;if(!e.options[Sl]||"string"!=typeof e.options[Sl])throw hl.create(cl.BAD_SENDER_ID);this.messagingSenderId=e.options[Sl],this.tokenDetailsModel=new Cl,this.vapidDetailsModel=new El,this.iidModel=new vl,this.app=e,this.INTERNAL={delete:function(){return t.delete()}}}return e.prototype.getToken=function(){return js(this,void 0,void 0,function(){var e,t,n,i,r;return Us(this,function(o){switch(o.label){case 0:if("denied"===(e=this.getNotificationPermission_()))throw hl.create(cl.NOTIFICATIONS_BLOCKED);return"granted"!==e?[2,null]:[4,this.getSWRegistration_()];case 1:return t=o.sent(),[4,this.getPublicVapidKey_()];case 2:return n=o.sent(),[4,this.getPushSubscription(t,n)];case 3:return i=o.sent(),[4,this.tokenDetailsModel.getTokenDetailsFromSWScope(t.scope)];case 4:return(r=o.sent())?[2,this.manageExistingToken(t,i,n,r)]:[2,this.getNewToken(t,i,n)]}})})},e.prototype.manageExistingToken=function(e,t,n,i){return js(this,void 0,void 0,function(){return Us(this,function(r){switch(r.label){case 0:return function(e,t,n){if(!n.vapidKey||!fl(t.buffer,n.vapidKey.buffer))return!1;var i=e.endpoint===n.endpoint,r=fl(e.getKey("auth"),n.auth),o=fl(e.getKey("p256dh"),n.p256dh);return i&&r&&o}(t,n,i)?Date.now()<i.createTime+6048e5?[2,i.fcmToken]:[2,this.updateToken(e,t,n,i)]:[4,this.deleteTokenFromDB(i.fcmToken)];case 1:return r.sent(),[2,this.getNewToken(e,t,n)]}})})},e.prototype.updateToken=function(e,t,n,i){return js(this,void 0,void 0,function(){var r,o,s;return Us(this,function(a){switch(a.label){case 0:return a.trys.push([0,4,,6]),[4,this.iidModel.updateToken(this.messagingSenderId,i.fcmToken,i.fcmPushSet,t,n)];case 1:return r=a.sent(),o={swScope:e.scope,vapidKey:n,fcmSenderId:this.messagingSenderId,fcmToken:r,fcmPushSet:i.fcmPushSet,createTime:Date.now(),endpoint:t.endpoint,auth:t.getKey("auth"),p256dh:t.getKey("p256dh")},[4,this.tokenDetailsModel.saveTokenDetails(o)];case 2:return a.sent(),[4,this.vapidDetailsModel.saveVapidDetails(e.scope,n)];case 3:return a.sent(),[2,r];case 4:return s=a.sent(),[4,this.deleteToken(i.fcmToken)];case 5:throw a.sent(),s;case 6:return[2]}})})},e.prototype.getNewToken=function(e,t,n){return js(this,void 0,void 0,function(){var i,r;return Us(this,function(o){switch(o.label){case 0:return[4,this.iidModel.getToken(this.messagingSenderId,t,n)];case 1:return i=o.sent(),r={swScope:e.scope,vapidKey:n,fcmSenderId:this.messagingSenderId,fcmToken:i.token,fcmPushSet:i.pushSet,createTime:Date.now(),endpoint:t.endpoint,auth:t.getKey("auth"),p256dh:t.getKey("p256dh")},[4,this.tokenDetailsModel.saveTokenDetails(r)];case 2:return o.sent(),[4,this.vapidDetailsModel.saveVapidDetails(e.scope,n)];case 3:return o.sent(),[2,i.token]}})})},e.prototype.deleteToken=function(e){return js(this,void 0,void 0,function(){var t,n;return Us(this,function(i){switch(i.label){case 0:return[4,this.deleteTokenFromDB(e)];case 1:return i.sent(),[4,this.getSWRegistration_()];case 2:return(t=i.sent())?[4,t.pushManager.getSubscription()]:[3,4];case 3:if(n=i.sent())return[2,n.unsubscribe()];i.label=4;case 4:return[2,!0]}})})},e.prototype.deleteTokenFromDB=function(e){return js(this,void 0,void 0,function(){var t;return Us(this,function(n){switch(n.label){case 0:return[4,this.tokenDetailsModel.deleteToken(e)];case 1:return t=n.sent(),[4,this.iidModel.deleteToken(t.fcmSenderId,t.fcmToken,t.fcmPushSet)];case 2:return n.sent(),[2]}})})},e.prototype.getPushSubscription=function(e,t){return e.pushManager.getSubscription().then(function(n){return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t})})},e.prototype.requestPermission=function(){throw hl.create(cl.AVAILABLE_IN_WINDOW)},e.prototype.useServiceWorker=function(e){throw hl.create(cl.AVAILABLE_IN_WINDOW)},e.prototype.usePublicVapidKey=function(e){throw hl.create(cl.AVAILABLE_IN_WINDOW)},e.prototype.onMessage=function(e,t,n){throw hl.create(cl.AVAILABLE_IN_WINDOW)},e.prototype.onTokenRefresh=function(e,t,n){throw hl.create(cl.AVAILABLE_IN_WINDOW)},e.prototype.setBackgroundMessageHandler=function(e){throw hl.create(cl.AVAILABLE_IN_SW)},e.prototype.delete=function(){return js(this,void 0,void 0,function(){return Us(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.tokenDetailsModel.closeDatabase(),this.vapidDetailsModel.closeDatabase()])];case 1:return e.sent(),[2]}})})},e.prototype.getNotificationPermission_=function(){return Notification.permission},e.prototype.getTokenDetailsModel=function(){return this.tokenDetailsModel},e.prototype.getVapidDetailsModel=function(){return this.vapidDetailsModel},e.prototype.getIidModel=function(){return this.iidModel},e}();var kl=function(e){function t(t){var n=e.call(this,t)||this;return n.bgMessageHandler=null,self.addEventListener("push",function(e){n.onPush(e)}),self.addEventListener("pushsubscriptionchange",function(e){n.onSubChange(e)}),self.addEventListener("notificationclick",function(e){n.onNotificationClick(e)}),n}return Ms(t,e),t.prototype.onPush=function(e){e.waitUntil(this.onPush_(e))},t.prototype.onSubChange=function(e){e.waitUntil(this.onSubChange_(e))},t.prototype.onNotificationClick=function(e){e.waitUntil(this.onNotificationClick_(e))},t.prototype.onPush_=function(e){return js(this,void 0,void 0,function(){var t,n,i,r,o,s;return Us(this,function(a){switch(a.label){case 0:if(!e.data)return[2];try{t=e.data.json()}catch(e){return[2]}return[4,this.hasVisibleClients_()];case 1:return a.sent()?[2,this.sendMessageToWindowClients_(t)]:(n=this.getNotificationData_(t))?(i=n.title||"",[4,this.getSWRegistration_()]):[3,3];case 2:return r=a.sent(),o=n.actions,s=Notification.maxActions,o&&s&&o.length>s&&console.warn("This browser only supports "+s+" actions.The remaining actions will not be displayed."),[2,r.showNotification(i,n)];case 3:return this.bgMessageHandler?[4,this.bgMessageHandler(t)]:[3,5];case 4:return a.sent(),[2];case 5:return[2]}})})},t.prototype.onSubChange_=function(e){return js(this,void 0,void 0,function(){var e,t,n,i;return Us(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getSWRegistration_()];case 1:return e=r.sent(),[3,3];case 2:throw t=r.sent(),hl.create(cl.UNABLE_TO_RESUBSCRIBE,{message:t});case 3:return r.trys.push([3,5,,8]),[4,e.pushManager.getSubscription()];case 4:return r.sent(),[3,8];case 5:return n=r.sent(),[4,this.getTokenDetailsModel().getTokenDetailsFromSWScope(e.scope)];case 6:if(!(i=r.sent()))throw n;return[4,this.deleteToken(i.fcmToken)];case 7:throw r.sent(),n;case 8:return[2]}})})},t.prototype.onNotificationClick_=function(e){return js(this,void 0,void 0,function(){var t,n,i,r;return Us(this,function(o){switch(o.label){case 0:return e.notification&&e.notification.data&&e.notification.data.FCM_MSG?e.action?[2]:(e.stopImmediatePropagation(),e.notification.close(),(t=e.notification.data.FCM_MSG).notification&&(n=t.fcmOptions&&t.fcmOptions.link||t.notification.click_action)?[4,this.getWindowClient_(n)]:[2]):[2];case 1:return(i=o.sent())?[3,3]:[4,self.clients.openWindow(n)];case 2:return i=o.sent(),[3,5];case 3:return[4,i.focus()];case 4:i=o.sent(),o.label=5;case 5:return i?(delete t.notification,delete t.fcmOptions,r=Al(ul.NOTIFICATION_CLICKED,t),[2,this.attemptToMessageClient_(i,r)]):[2]}})})},t.prototype.getNotificationData_=function(e){var t;if(e&&"object"==typeof e.notification){var n=Fs({},e.notification);return n.data=Fs({},e.notification.data,((t={}).FCM_MSG=e,t)),n}},t.prototype.setBackgroundMessageHandler=function(e){if(!e||"function"!=typeof e)throw hl.create(cl.BG_HANDLER_FUNCTION_EXPECTED);this.bgMessageHandler=e},t.prototype.getWindowClient_=function(e){return js(this,void 0,void 0,function(){var t,n,i,r;return Us(this,function(o){switch(o.label){case 0:return t=new URL(e,self.location.href).href,[4,xl()];case 1:for(n=o.sent(),i=null,r=0;r<n.length;r++)if(new URL(n[r].url,self.location.href).href===t){i=n[r];break}return[2,i]}})})},t.prototype.attemptToMessageClient_=function(e,t){return js(this,void 0,void 0,function(){return Us(this,function(n){if(!e)throw hl.create(cl.NO_WINDOW_CLIENT_TO_MSG);return e.postMessage(t),[2]})})},t.prototype.hasVisibleClients_=function(){return js(this,void 0,void 0,function(){return Us(this,function(e){switch(e.label){case 0:return[4,xl()];case 1:return[2,e.sent().some(function(e){return"visible"===e.visibilityState})]}})})},t.prototype.sendMessageToWindowClients_=function(e){return js(this,void 0,void 0,function(){var t,n,i=this;return Us(this,function(r){switch(r.label){case 0:return[4,xl()];case 1:return t=r.sent(),n=Al(ul.PUSH_MSG_RECEIVED,e),[4,Promise.all(t.map(function(e){return i.attemptToMessageClient_(e,n)}))];case 2:return r.sent(),[2]}})})},t.prototype.getSWRegistration_=function(){return js(this,void 0,void 0,function(){return Us(this,function(e){return[2,self.registration]})})},t.prototype.getPublicVapidKey_=function(){return js(this,void 0,void 0,function(){var e,t;return Us(this,function(n){switch(n.label){case 0:return[4,this.getSWRegistration_()];case 1:if(!(e=n.sent()))throw hl.create(cl.SW_REGISTRATION_EXPECTED);return[4,this.getVapidDetailsModel().getVapidFromSWScope(e.scope)];case 2:return null==(t=n.sent())?[2,dl]:[2,t]}})})},t}(Il);function xl(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function Al(e,t){var n;return(n={})[ll.TYPE_OF_MSG]=e,n[ll.DATA]=t,n}var Pl,Ol=function(e){function t(t){var n=e.call(this,t)||this;return n.registrationToUse=null,n.publicVapidKeyToUse=null,n.manifestCheckPromise=null,n.messageObserver=null,n.tokenRefreshObserver=null,n.onMessageInternal=Ma(function(e){n.messageObserver=e}),n.onTokenRefreshInternal=Ma(function(e){n.tokenRefreshObserver=e}),n.setupSWMessageListener_(),n}return Ms(t,e),t.prototype.getToken=function(){return js(this,void 0,void 0,function(){return Us(this,function(t){switch(t.label){case 0:return this.manifestCheckPromise||(this.manifestCheckPromise=function(){return js(this,void 0,void 0,function(){var e,t;return Us(this,function(n){switch(n.label){case 0:if(!(e=document.querySelector('link[rel="manifest"]')))return[2];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(e.href)];case 2:return[4,n.sent().json()];case 3:return t=n.sent(),[3,5];case 4:return n.sent(),[2];case 5:if(!t||!t.gcm_sender_id)return[2];if("103953800507"!==t.gcm_sender_id)throw hl.create(cl.INCORRECT_GCM_SENDER_ID);return[2]}})})}()),[4,this.manifestCheckPromise];case 1:return t.sent(),[2,e.prototype.getToken.call(this)]}})})},t.prototype.requestPermission=function(){return js(this,void 0,void 0,function(){var e;return Us(this,function(t){switch(t.label){case 0:return"granted"===this.getNotificationPermission_()?[2]:[4,Notification.requestPermission()];case 1:if("granted"===(e=t.sent()))return[2];throw"denied"===e?hl.create(cl.PERMISSION_BLOCKED):hl.create(cl.PERMISSION_DEFAULT)}})})},t.prototype.useServiceWorker=function(e){if(!(e instanceof ServiceWorkerRegistration))throw hl.create(cl.SW_REGISTRATION_EXPECTED);if(null!=this.registrationToUse)throw hl.create(cl.USE_SW_BEFORE_GET_TOKEN);this.registrationToUse=e},t.prototype.usePublicVapidKey=function(e){if("string"!=typeof e)throw hl.create(cl.INVALID_PUBLIC_VAPID_KEY);if(null!=this.publicVapidKeyToUse)throw hl.create(cl.USE_PUBLIC_KEY_BEFORE_GET_TOKEN);var t=ml(e);if(65!==t.length)throw hl.create(cl.PUBLIC_KEY_DECRYPTION_FAILED);this.publicVapidKeyToUse=t},t.prototype.onMessage=function(e,t,n){return"function"==typeof e?this.onMessageInternal(e,t,n):this.onMessageInternal(e)},t.prototype.onTokenRefresh=function(e,t,n){return"function"==typeof e?this.onTokenRefreshInternal(e,t,n):this.onTokenRefreshInternal(e)},t.prototype.waitForRegistrationToActivate_=function(e){var t=e.installing||e.waiting||e.active;return new Promise(function(n,i){if(t)if("activated"!==t.state)if("redundant"!==t.state){var r=function(){if("activated"===t.state)n(e);else{if("redundant"!==t.state)return;i(hl.create(cl.SW_REG_REDUNDANT))}t.removeEventListener("statechange",r)};t.addEventListener("statechange",r)}else i(hl.create(cl.SW_REG_REDUNDANT));else n(e);else i(hl.create(cl.NO_SW_IN_REG))})},t.prototype.getSWRegistration_=function(){var e=this;return this.registrationToUse?this.waitForRegistrationToActivate_(this.registrationToUse):(this.registrationToUse=null,navigator.serviceWorker.register("/firebase-messaging-sw.js",{scope:"/firebase-cloud-messaging-push-scope"}).catch(function(e){throw hl.create(cl.FAILED_DEFAULT_REGISTRATION,{browserErrorMessage:e.message})}).then(function(t){return e.waitForRegistrationToActivate_(t).then(function(){return e.registrationToUse=t,t.update(),t})}))},t.prototype.getPublicVapidKey_=function(){return js(this,void 0,void 0,function(){return Us(this,function(e){return this.publicVapidKeyToUse?[2,this.publicVapidKeyToUse]:[2,dl]})})},t.prototype.setupSWMessageListener_=function(){var e=this;navigator.serviceWorker.addEventListener("message",function(t){if(t.data&&t.data[ll.TYPE_OF_MSG]){var n=t.data;switch(n[ll.TYPE_OF_MSG]){case ul.PUSH_MSG_RECEIVED:case ul.NOTIFICATION_CLICKED:var i=n[ll.DATA];e.messageObserver&&e.messageObserver.next(i)}}},!1)},t}(Il);function Nl(){return self&&"ServiceWorkerGlobalScope"in self?"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey"):navigator.cookieEnabled&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}Pl={isSupported:Nl},qa.INTERNAL.registerService("messaging",function(e){if(!Nl())throw hl.create(cl.UNSUPPORTED_BROWSER);return self&&"ServiceWorkerGlobalScope"in self?new kl(e):new Ol(e)},Pl);var Ll=null,Dl=null;if("yes"===WILOKE_GLOBAL.isUsingFirebase){var Rl=WILOKE_GLOBAL.oFirebaseConfiguration;Za.apps.length||Za.initializeApp(Rl),Ll=Za.database(),Dl=Za.auth()}var Ml={db:Ll,auth:Dl},Fl={data:function(){return{oTranslation:WILCITY_I18,isShowing:"no",isLoading:"no",needDashboardUrl:"yes",aNotifications:null,errMsg:"",isUsingFirebase:"yes"==WILOKE_GLOBAL.isUsingFirebase,notificationDashboardUrl:this.dashboardUrl+"#/messages",countNewNotifications:0,isLoadedCheckUnFocusClick:!1}},props:["userId","dashboardUrl"],components:{BlockLoading:G,firebase:Ml},computed:{wrapperNotificationsClass:function(){return"no"==this.isShowing?"header_loginBody__2hz2g":"header_loginBody__2hz2g active"},aCssClass:function(){return"yes"==this.isShowing?"header_loginHead__3HoVP active":"header_loginHead__3HoVP"}},mounted:function(){var e=this;this.isUsingFirebase?this.getFirebaseLatestNotifications():(setTimeout(function(){e.fetchNewNotifications(),e.$store.commit("updateTimeout")},this.$store.getters.getTimeout),this.fakeSocket())},methods:{renderLink:function(e){return this.isUsingFirebase?this.dashboardUrl+"#/messages?u="+e.displayName:e.link},buildUserKey:function(){return"___"+this.userId+"___"},sentAt:function(e){return this.isUsingFirebase?WilCityHelpers.timestampToDate(e.timestamp):e.time},getFirebaseLatestNotifications:function(){var e=this;Ml.db.ref("messages/users/"+this.buildUserKey()).orderByChild("timestamp").limitToLast(6).on("value",function(t){var n=t.val();if(null===n)e.countNewNotifications=0,e.errMsg=e.oTranslation.noMessage;else{var i={};WilCityHelpers.convertFirebaseToOrderByDescTimestamp(n).forEach(function(t){if(t.userID!=e.userId){1==t.new&&(e.countNewNotifications+=1);var n=[];n[t.key]=t,i=Object.assign({},i,n)}}),e.errMsg="",e.aNotifications=i}})},fakeSocket:function(){var e=this;setInterval(function(){e.fetchNewNotifications()},3e5)},fetchNewNotifications:function(){var e=this;jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_count_new_messages"},success:function(t){e.countNewNotifications=t.data}})},resetNotification:function(){if(this.countNewNotifications<1)return!1;this.countNewNotifications=0,setTimeout(function(){jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_reset_new_messages"}})},4e3)},hideMenu:function(){this.isShowing="no"},toggleShowing:function(){var e=this;if(this.isLoadedCheckUnFocusClick||(this.hideWhenOurClick(),this.isLoadedCheckUnFocusClick=!0),this.isUsingFirebase){this.isShowing="no"==this.isShowing?"yes":"no",this.isLoading="no";var t=Object.keys(this.aNotifications),n={};for(var i in t)n["/"+t[i]+"/new"]=null;return Ml.db.ref("messages/users/"+this.buildUserKey()).update(n),!0}this.isShowing="no"==this.isShowing?"yes":"no",this.isLoading="yes",this.errMsg="",this.resetNotification(),jQuery.ajax({type:"post",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_fetch_list_messages",needDashboardUrl:this.needDashboardUrl,limit:5},success:function(t){t.success?(e.aNotifications=t.data.aInfo,"#"===e.notificationDashboardUrl&&(e.notificationDashboardUrl=t.data.dashboardUrl,e.needDashboardUrl="no")):e.errMsg=t.data.msg,e.isLoading="no"}})},hideWhenOurClick:function(){var e=this;jQuery(document).on("click",function(t){"yes"==e.isShowing&&(jQuery(t.target).closest("#wilcity-message-notifications").length||(e.isShowing="no"))})}}},jl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("a",{class:e.aCssClass,attrs:{href:"#","data-toggle-minWidth":"768",dataTooltip:e.oTranslation.messages,"data-tooltip-placement":"top","data-tooltip-theme":"light"},on:{click:function(t){return t.preventDefault(),e.toggleShowing(t)}}},[n("i",{staticClass:"la la-envelope"}),n("span",{directives:[{name:"show",rawName:"v-show",value:e.countNewNotifications,expression:"countNewNotifications"}],staticClass:"header_number__1a6F5 bg-color-quaternary"},[e._v(e._s(e.countNewNotifications))])]),e._v(" "),n("div",{class:e.wrapperNotificationsClass},[n("div",{directives:[{name:"show",rawName:"v-show",value:"yes"==e.isLoading,expression:"isLoading=='yes'"}],staticClass:"pos-r",staticStyle:{"min-height":"100px"}},[n("block-loading",{attrs:{"is-loading":e.isLoading,position:"pos-a-center"}})],1),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:null!==e.aNotifications&&"no"==e.isLoading,expression:"aNotifications!==null && isLoading=='no'"}],staticClass:"list-utility_module__32oNg list-none list-utility_abs__OYiyL arrow--top-right"},[e._l(e.aNotifications,function(t){return n("li",{staticClass:"list-utility_list__1DzGk"},[n("a",{staticClass:"list-utility_link__3BRZx",attrs:{href:e.renderLink(t)}},[n("div",{staticClass:"utility-box-1_module__MYXpX utility-box-1_sm__mopok utility-box-1_boxLeft__3iS6b clearfix "},[t.avatar?n("div",{staticClass:"utility-box-1_avatar__DB9c_ rounded-circle",style:{"background-image":"url("+t.avatar+")"}},[n("img",{attrs:{src:t.avatar,alt:t.displayName}})]):e._e(),e._v(" "),n("div",{staticClass:"utility-box-1_body__8qd9j"},[n("div",{staticClass:"utility-box-1_group__2ZPA2 text-ellipsis",staticStyle:{"white-space":"normal"}},[t.displayName?n("h3",{staticClass:"utility-box-1_title__1I925",domProps:{innerHTML:e._s(t.displayName)}}):e._e(),e._v(" "),n("div",{staticClass:"utility-box-1_content__3jEL7",domProps:{innerHTML:e._s(t.message)}})]),e._v(" "),n("div",{staticClass:"utility-box-1_description__2VDJ6"},[n("i",{staticClass:"la la-comments color-primary"}),e._v(" "),n("span",{domProps:{innerHTML:e._s(e.sentAt(t))}})])])])])])}),e._v(" "),n("li",{staticClass:"list-utility_list__1DzGk"},[n("a",{staticClass:"list-utility_more__2Y_w7 wil-text-center color-primary--hover",attrs:{href:e.notificationDashboardUrl}},[e._v(e._s(e.oTranslation.viewAll))])])],2),e._v(" "),n("ul",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],staticClass:"list-utility_module__32oNg list-none list-utility_abs__OYiyL arrow--top-right"},[n("li",{staticClass:"list-utility_list__1DzGk"},[n("a",{staticClass:"list-utility_link__3BRZx",attrs:{href:"#"}},[n("div",{staticClass:"utility-box-1_module__MYXpX utility-box-1_sm__mopok utility-box-1_boxLeft__3iS6b clearfix"},[n("div",{staticClass:"utility-box-1_body__8qd9j"},[n("div",{staticClass:"utility-box-1_group__2ZPA2 text-ellipsis"},[n("div",{staticClass:"utility-box-1_content__3jEL7",domProps:{innerHTML:e._s(e.errMsg)}})])])])])])])])])};jl._withStripped=!0;var Ul=A({render:jl,staticRenderFns:[]},void 0,Fl,void 0,!1,void 0,void 0,void 0),Wl={data:function(){return{isLoading:!1,xhr:null,oTranslation:WILCITY_I18,fbAPI:WILOKE_GLOBAL.oFacebook.API}},props:["margin"],computed:{cssClass:function(){var e=this.margin+" wil-btn wil-btn--facebook wil-btn--block wil-btn--md wil-btn--round";return this.isLoading&&(e+=" wil-btn--loading"),e}},methods:{handleResponse:function(e){var t=this;"connected"===e.status?jQuery.ajax({data:{action:"wilcity_facebook_login",fb_response:e},global:!1,type:"POST",url:WILOKE_GLOBAL.ajaxurl,success:function(e){e.success?"self"==e.data.redirectTo?location.reload():window.location.href=decodeURIComponent(e.data.redirectTo):t.isLoading=!1}}):(this.isLoading=!1,navigator.userAgent.match("CriOS")&&window.open("https://www.facebook.com/dialog/oauth?client_id="+this.fbAPI+"&redirect_uri="+window.location.href+"&scope=email,public_profile","",null))},loginWithFacebook:function(){var e=this;if(this.isLoading=!0,null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),navigator.userAgent.match("CriOS"))jQuery('<p class="fbl_error">'+fbl.l18n.chrome_ios_alert+"</p>").insertAfter(window.fbl_button),FB.getLoginStatus(function(t){e.handleResponse(t)});else try{FB.login(function(t){e.handleResponse(t)},{scope:"email,public_profile",return_scopes:!0,auth_type:"rerequest"})}catch(e){this.isLoading=!1,alert(this.oTranslation.fbLoginWarning)}}}},Bl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{class:e.cssClass,attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.loginWithFacebook(t)}}},[n("i",{staticClass:"fa fa-facebook"}),e._v(" Facebook\n "),e.isLoading?n("div",{staticClass:"pill-loading_module__3LZ6v"},[n("div",{staticClass:"pill-loading_loader__3LOnT"})]):e._e()])};Bl._withStripped=!0;var Vl={data:function(){return{oTranslation:WILCITY_I18}},components:{Facebook:A({render:Bl,staticRenderFns:[]},void 0,Wl,void 0,!1,void 0,void 0,void 0)},computed:{isFBLogin:function(){return void 0!==WILOKE_GLOBAL.oFacebook&&"yes"==WILOKE_GLOBAL.oFacebook.toggle}}},Hl=function(){var e=this.$createElement,t=this._self._c||e;return this.isFBLogin?t("div",[t("div",{staticClass:"divider-text_module__3vqhE divider-text_center__299NM mt-15 mb-15"},[t("span",{staticClass:"divider-text_text__2OtOt",domProps:{innerHTML:this._s(this.oTranslation.connectWithSocialNetworks)}})]),this._v(" "),t("facebook",{attrs:{margin:this.mt-10}})],1):this._e()};Hl._withStripped=!0;var $l=A({render:Hl,staticRenderFns:[]},void 0,Vl,void 0,!1,void 0,void 0,void 0);var Gl,Kl=(Gl=function(){var e=!1,t=[];return{resolved:function(){return e},resolve:function(n){if(!e){e=!0;for(var i=0,r=t.length;i<r;i++)t[i](n)}},promise:{then:function(n){e?n():t.push(n)}}}}(),{notify:function(){Gl.resolve()},wait:function(){return Gl.promise},render:function(e,t,n){this.wait().then(function(){n(window.grecaptcha.render(e,t))})},reset:function(e){void 0!==e&&(this.assertLoaded(),this.wait().then(function(){return window.grecaptcha.reset(e)}))},execute:function(e){void 0!==e&&(this.assertLoaded(),this.wait().then(function(){return window.grecaptcha.execute(e)}))},checkRecaptchaLoad:function(){window.hasOwnProperty("grecaptcha")&&window.grecaptcha.hasOwnProperty("render")&&this.notify()},assertLoaded:function(){if(!Gl.resolved())throw new Error("ReCAPTCHA has not been loaded")}});"undefined"!=typeof window&&(window.vueRecaptchaApiLoaded=Kl.notify);var ql=Object.assign||function(e){for(var t=arguments,n=1;n<arguments.length;n++){var i=t[n];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},Ql={name:"VueRecaptcha",props:{sitekey:{type:String,required:!0},theme:{type:String},badge:{type:String},type:{type:String},size:{type:String},tabindex:{type:String}},mounted:function(){var e=this;Kl.checkRecaptchaLoad();var t=ql({},this.$props,{callback:this.emitVerify,"expired-callback":this.emitExpired}),n=this.$slots.default?this.$el.children[0]:this.$el;Kl.render(n,t,function(t){e.$widgetId=t,e.$emit("render",t)})},methods:{reset:function(){Kl.reset(this.$widgetId)},execute:function(){Kl.execute(this.$widgetId)},emitVerify:function(e){this.$emit("verify",e)},emitExpired:function(){this.$emit("expired")}},render:function(e){return e("div",{},this.$slots.default)}},Yl={data:function(){return{oGoogleReCaptcha:void 0!==WILOKE_GLOBAL.oGoogleReCaptcha&&WILOKE_GLOBAL.oGoogleReCaptcha,oTranslation:WILCITY_I18,canRegister:"yes"==WILOKE_INLINE_GLOBAL.canRegister,toggleRegister:1==WILCITY_REGISTER_LOGIN.toggleRegister,username:"",password:"",isRemember:"no",isDisable:!1,isVerifiedGoogleReCaptcha:void 0===WILOKE_GLOBAL.oGoogleReCaptcha||"both"!=WILOKE_GLOBAL.oGoogleReCaptcha.on,recaptchaToken:""}},mounted:function(){console.log(this.oGoogleReCaptcha)},components:{SocialLogin:$l,VueRecaptcha:Ql},computed:{btnClass:function(){return{"wil-btn wil-btn--primary wil-btn--block wil-btn--md wil-btn--round":!0,disable:!this.username.length||!this.password.length||!this.isVerifiedGoogleReCaptcha}},usernameClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.username.length}},passwordClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.password.length}}},methods:{onVerify:function(e){this.isVerifiedGoogleReCaptcha=!0,this.recaptchaToken=e},onExpired:function(){this.isVerifiedGoogleReCaptcha=!1},keyboardLogin:function(e){13==e.keyCode&&this.username.length&&this.password.length&&this.submitLogin()},lostPassword:function(){this.$emit("switch-mode","lost-password")},switchToRegister:function(){this.$emit("switch-mode","register")},submitLogin:function(){var e=this;this.isDisable=!0,this.$emit("line-loading","yes"),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{username:this.username,password:this.password,isRemember:this.isRemember,action:"wilcity_login","g-recaptcha-response":this.recaptchaToken},success:function(t){e.$emit("update-msg",t),e.isDisable=!1,e.$emit("line-loading","no")}})}}},zl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"wilcity-login-form"}},[n("div",{class:e.usernameClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.username,expression:"username"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:e.username},on:{keypress:e.keyboardLogin,input:function(t){t.target.composing||(e.username=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis required",domProps:{innerHTML:e._s(e.oTranslation.usernameOrEmail)}}),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("div",{class:e.passwordClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],staticClass:"field_field__3U_Rt",attrs:{type:"password"},domProps:{value:e.password},on:{keypress:e.keyboardLogin,input:function(t){t.target.composing||(e.password=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis required",domProps:{innerHTML:e._s(e.oTranslation.password)}}),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("div",{staticClass:"o-hidden ws-nowrap"},[n("div",{staticClass:"checkbox_module__1K5IS mb-15 d-inline-block"},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.isRemember,expression:"isRemember"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox","true-value":"yes","no-value":"false"},domProps:{checked:Array.isArray(e.isRemember)?e._i(e.isRemember,null)>-1:e._q(e.isRemember,"yes")},on:{change:function(t){var n=e.isRemember,i=t.target,r=!!i.checked&&"yes";if(Array.isArray(n)){var o=e._i(n,null);i.checked?o<0&&(e.isRemember=n.concat([null])):o>-1&&(e.isRemember=n.slice(0,o).concat(n.slice(o+1)))}else e.isRemember=r}}}),e._m(0),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis"},[n("span",{domProps:{innerHTML:e._s(e.oTranslation.rememberMe)}}),n("span",{staticClass:"checkbox-border"})])])]),e._v(" "),n("a",{staticClass:"wil-float-right td-underline",attrs:{href:"#"},domProps:{innerHTML:e._s(e.oTranslation.lostPassword)},on:{click:function(t){return t.preventDefault(),e.lostPassword(t)}}})]),e._v(" "),e.oGoogleReCaptcha&&"both"==e.oGoogleReCaptcha.on?n("div",{staticClass:"wilcity-google-recaptcha-wrapper mt-20 mb-20"},[n("hr"),e._v(" "),n("vue-recaptcha",{attrs:{sitekey:e.oGoogleReCaptcha.siteKey},on:{verify:e.onVerify,expired:e.onExpired}})],1):e._e(),e._v(" "),n("button",{class:e.btnClass,attrs:{type:"submit"},domProps:{innerHTML:e._s(e.oTranslation.login)},on:{click:function(t){return t.preventDefault(),e.submitLogin(t)}}}),e._v(" "),e.toggleRegister&&e.canRegister?n("div",{staticClass:"mt-15"},[n("span",{domProps:{innerHTML:e._s(e.oTranslation.donthaveanaccount)}}),n("a",{staticClass:"wil-float-right td-underline",attrs:{href:"#"},domProps:{innerHTML:e._s(e.oTranslation.register)},on:{click:function(t){return t.preventDefault(),e.switchToRegister(t)}}})]):e._e(),e._v(" "),n("social-login")],1)};zl._withStripped=!0;var Xl=A({render:zl,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),t("span",{staticClass:"checkbox-iconBg"})])}]},void 0,Yl,void 0,!1,void 0,void 0,void 0),Zl={data:function(){return{oGoogleReCaptcha:void 0!==WILOKE_GLOBAL.oGoogleReCaptcha&&WILOKE_GLOBAL.oGoogleReCaptcha,oTranslation:WILCITY_I18,email:"",username:"",recaptchaToken:"",password:"",isAgreeToPrivacyPolicy:1==WILCITY_REGISTER_LOGIN.togglePrivacyPolicy?"no":"yes",isAgreeToTermsAndConditionals:1==WILCITY_REGISTER_LOGIN.toggleTermsAndConditionals?"no":"yes",togglePrivacyPolicy:WILCITY_REGISTER_LOGIN.togglePrivacyPolicy,privacyPolicyDesc:WILCITY_REGISTER_LOGIN.privacyPolicyDesc,toggleTermsAndConditionals:WILCITY_REGISTER_LOGIN.toggleTermsAndConditionals,termsAndConditionalDesc:WILCITY_REGISTER_LOGIN.termsAndConditionals,isDisable:!1,isVerifiedGoogleReCaptcha:void 0===WILOKE_GLOBAL.oGoogleReCaptcha}},components:{VueRecaptcha:Ql,SocialLogin:$l},computed:{buttonClass:function(){return{"wil-btn wil-btn--primary wil-btn--block wil-btn--md wil-btn--round":!0,disable:!this.isVerifiedGoogleReCaptcha||this.isDisable||"no"==this.isAgreeToPrivacyPolicy||"no"==this.isAgreeToTermsAndConditionals||!this.password.length||!this.username.length||!WilCityHelpers.validEmail(this.email)}},usernameClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.username.length}},emailClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.email.length,error:this.email.length&&!WilCityHelpers.validEmail(this.email)}},passwordClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.password.length}}},methods:{onVerify:function(e){this.isVerifiedGoogleReCaptcha=!0,this.recaptchaToken=e},onExpired:function(){this.isVerifiedGoogleReCaptcha=!1},switchMode:function(){this.$emit("switch-mode","login")},registerAnAccount:function(){var e=this;this.isDisable=!0,this.isVerifiedGoogleReCaptcha||(this.$emit("update-msg",{msg:oTranslation.invalidGooglereCaptcha}),this.isDisable=!1,this.$emit("line-loading","no")),this.$emit("line-loading","yes"),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{email:this.email,username:this.username,password:this.password,isAgreeToTermsAndConditionals:this.isAgreeToTermsAndConditionals,isAgreeToPrivacyPolicy:this.isAgreeToPrivacyPolicy,action:"wilcity_register","g-recaptcha-response":this.recaptchaToken},success:function(t){e.$emit("update-msg",t),e.isDisable=!1,e.$emit("line-loading","no")}})}}},Jl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"wilcity-register-form"}},[n("div",{class:e.usernameClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.username,expression:"username"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:e.username},on:{input:function(t){t.target.composing||(e.username=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis required",domProps:{innerHTML:e._s(e.oTranslation.username)}}),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("div",{class:e.emailClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.email,expression:"email"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:e.email},on:{input:function(t){t.target.composing||(e.email=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis required",domProps:{innerHTML:e._s(e.oTranslation.email)}}),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("div",{class:e.passwordClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],staticClass:"field_field__3U_Rt",attrs:{type:"password"},domProps:{value:e.password},on:{input:function(t){t.target.composing||(e.password=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis required",domProps:{innerHTML:e._s(e.oTranslation.password)}}),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),1==e.togglePrivacyPolicy?n("div",[n("div",{staticClass:"o-hidden ws-nowrap"},[n("div",{class:["checkbox_module__1K5IS mb-15","yes"==e.isAgreeToPrivacyPolicy]},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.isAgreeToPrivacyPolicy,expression:"isAgreeToPrivacyPolicy"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox","true-value":"yes","false-value":"no"},domProps:{checked:Array.isArray(e.isAgreeToPrivacyPolicy)?e._i(e.isAgreeToPrivacyPolicy,null)>-1:e._q(e.isAgreeToPrivacyPolicy,"yes")},on:{change:function(t){var n=e.isAgreeToPrivacyPolicy,i=t.target,r=i.checked?"yes":"no";if(Array.isArray(n)){var o=e._i(n,null);i.checked?o<0&&(e.isAgreeToPrivacyPolicy=n.concat([null])):o>-1&&(e.isAgreeToPrivacyPolicy=n.slice(0,o).concat(n.slice(o+1)))}else e.isAgreeToPrivacyPolicy=r}}}),e._v(" "),e._m(0)]),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis",domProps:{innerHTML:e._s(e.privacyPolicyDesc)}},[n("span",{staticClass:"checkbox-border"})])])])]):e._e(),e._v(" "),1==e.toggleTermsAndConditionals?n("div",[n("div",{staticClass:"o-hidden ws-nowrap"},[n("div",{class:["checkbox_module__1K5IS mb-15","yes"==e.isAgreeToTermsAndConditionals]},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.isAgreeToTermsAndConditionals,expression:"isAgreeToTermsAndConditionals"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"checkbox","true-value":"yes","false-value":"no"},domProps:{checked:Array.isArray(e.isAgreeToTermsAndConditionals)?e._i(e.isAgreeToTermsAndConditionals,null)>-1:e._q(e.isAgreeToTermsAndConditionals,"yes")},on:{change:function(t){var n=e.isAgreeToTermsAndConditionals,i=t.target,r=i.checked?"yes":"no";if(Array.isArray(n)){var o=e._i(n,null);i.checked?o<0&&(e.isAgreeToTermsAndConditionals=n.concat([null])):o>-1&&(e.isAgreeToTermsAndConditionals=n.slice(0,o).concat(n.slice(o+1)))}else e.isAgreeToTermsAndConditionals=r}}}),e._v(" "),e._m(1)]),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis",domProps:{innerHTML:e._s(e.termsAndConditionalDesc)}},[n("span",{staticClass:"checkbox-border"})])])])]):e._e(),e._v(" "),e.oGoogleReCaptcha?n("div",{staticClass:"wilcity-google-recaptcha-wrapper mt-20 mb-20"},[n("hr"),e._v(" "),n("vue-recaptcha",{attrs:{sitekey:e.oGoogleReCaptcha.siteKey},on:{verify:e.onVerify,expired:e.onExpired}})],1):e._e(),e._v(" "),n("button",{class:e.buttonClass,attrs:{type:"submit"},domProps:{innerHTML:e._s(e.oTranslation.register)},on:{click:function(t){return t.preventDefault(),e.registerAnAccount(t)}}}),e._v(" "),n("div",{staticClass:"mt-15"},[e._v(e._s(e.oTranslation.ihaveanaccount)),n("a",{staticClass:"wil-float-right td-underline",attrs:{href:"#"},domProps:{innerHTML:e._s(e.oTranslation.login)},on:{click:function(t){return t.preventDefault(),e.switchMode(t)}}})]),e._v(" "),n("social-login")],1)};Jl._withStripped=!0;var eu=A({render:Jl,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),t("span",{staticClass:"checkbox-iconBg"})])},function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),t("span",{staticClass:"checkbox-iconBg"})])}]},void 0,Zl,void 0,!1,void 0,void 0,void 0),tu={data:function(){return{username:"",oTranslation:WILCITY_I18}},computed:{usernameClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.username.length}}},methods:{switchToLogin:function(){this.$emit("switch-mode","login")},resetPassword:function(){var e=this;this.isDisable=!0,this.$emit("line-loading","yes"),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{username:this.username,action:"wilcity_reset_password"},success:function(t){e.$emit("update-msg",t),e.isDisable=!1,e.$emit("line-loading","no")}})}}},nu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"wilcity-lost-password-form"}},[n("div",{class:e.usernameClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.username,expression:"username"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:e.username},on:{input:function(t){t.target.composing||(e.username=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis required"},[e._v(e._s(e.oTranslation.usernameOrEmail))]),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("button",{class:["wil-btn wil-btn--primary wil-btn--block wil-btn--md wil-btn--round",e.isDisable],attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.resetPassword(t)}}},[e._v(e._s(e.oTranslation.resetPassword))]),e._v(" "),n("div",{staticClass:"mt-15 mb-15 wil-float-right"},[n("a",{attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.switchToLogin(t)}}},[e._v(e._s(e.oTranslation.cancel))])])])};nu._withStripped=!0;var iu={data:function(){return{oIcon:{login:"la la la-unlock",register:"la la la-user-plus","lost-password":"la la la-refresh"},oTitle:{login:WILCITY_I18.login,register:WILCITY_I18.register,"lost-password":WILCITY_I18.resetPassword},msg:"",msgStatus:"",msgIcon:"",isHideComponent:!1,oTranslation:WILCITY_I18}},computed:{mode:function(){return this.$store.getters.getDefaultComponentOfRegisterLogin},popupTitle:function(){return this.oTitle[this.mode]},popupIcon:function(){return this.oIcon[this.mode]}},components:{WilokePopup:N,WilokeMessage:R,register:eu,login:Xl,"lost-password":A({render:nu,staticRenderFns:[]},void 0,tu,void 0,!1,void 0,void 0,void 0)},methods:{closePopup:function(){this.$store.dispatch("closeRegisterLoginPopup")},onUpdateMode:function(e){"register"==e?this.$store.dispatch("setRegisterAsDefaultComponentOfRegisterLoginPopup"):"login"==e?this.$store.dispatch("setLoginAsDefaultComponentOfRegisterLoginPopup"):this.$store.dispatch("setLostPasswordAsDefaultComponentOfRegisterLoginPopup"),this.msg=""},updateMsg:function(e){e.success?(this.msgStatus="success",this.msgIcon="la la-smile-o",void 0!==e.data.isFocusHideForm&&(this.isHideComponent=!0),void 0!==e.data.redirectTo&&e.data.redirectTo.length&&(this.isHideComponent=!0,setTimeout(function(){"self"==e.data.redirectTo?location.reload():window.location.href=decodeURIComponent(e.data.redirectTo)},2500))):(this.msgStatus="error",this.msgIcon="la la-frown-o",this.msgStatus="danger"),this.msg=e.data.msg},updateLoadingStatus:function(e){this.$emit("line-loading",e)}}},ru=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":"wilcity-signin-popup","popup-title":e.popupTitle,icon:e.popupIcon,"wrapper-class":"popup_module__3M-0- pos-f-full popup_sm__Rc24D popup_mobile-full__1hyc4"},on:{"on-close-popup":e.closePopup}},[n("div",{attrs:{slot:"body"},slot:"body"},[n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.msg.length,expression:"msg.length"}],attrs:{msg:e.msg,"has-remove":"false",icon:e.msgIcon,status:e.msgStatus}}),e._v(" "),n("keep-alive",[n(e.mode,{directives:[{name:"show",rawName:"v-show",value:!e.isHideComponent,expression:"!isHideComponent"}],tag:"component",on:{"switch-mode":e.onUpdateMode,"line-loading":e.updateLoadingStatus,"update-msg":e.updateMsg}})],1)],1)])};ru._withStripped=!0;var ou=A({render:ru,staticRenderFns:[]},void 0,iu,void 0,!1,void 0,void 0,void 0),su={props:["btnName"],methods:{onOpenLoginPopup:function(){this.$store.dispatch("setLoginAsDefaultComponentOfRegisterLoginPopup"),this.$store.dispatch("openRegisterLoginPopup")}}},au=function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{staticClass:"wil-btn wil-btn--primary2 wil-btn--round wil-btn--xs",attrs:{id:"wilcity-login-btn",href:"#"},domProps:{innerHTML:e._s(e.btnName)},on:{click:function(t){return t.preventDefault(),e.onOpenLoginPopup(t)}}})};au._withStripped=!0;var lu=A({render:au,staticRenderFns:[]},void 0,su,void 0,!1,void 0,void 0,void 0),uu={props:["btnName"],methods:{onOpenRegisterPopup:function(){this.$store.dispatch("setRegisterAsDefaultComponentOfRegisterLoginPopup"),this.$store.dispatch("openRegisterLoginPopup")}}},cu=function(){var e=this,t=e.$createElement;return(e._self._c||t)("a",{staticClass:"wil-btn wil-btn--secondary wil-btn--round wil-btn--xs",attrs:{id:"wilcity-register-btn",href:"#"},domProps:{innerHTML:e._s(e.btnName)},on:{click:function(t){return t.preventDefault(),e.onOpenRegisterPopup(t)}}})};cu._withStripped=!0;var hu=A({render:cu,staticRenderFns:[]},void 0,uu,void 0,!1,void 0,void 0,void 0);!function(){var e;function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},i="undefined"!=typeof window&&window===this?this:void 0!==ze&&null!=ze?ze:this;function r(){r=function(){},i.Symbol||(i.Symbol=a)}var o,s,a=(o=0,function(e){return"jscomp_symbol_"+(e||"")+o++});function l(){r();var e=i.Symbol.iterator;e||(e=i.Symbol.iterator=i.Symbol("iterator")),"function"!=typeof Array.prototype[e]&&n(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return e=t(this),l(),(e={next:e})[i.Symbol.iterator]=function(){return this},e;var e}}),l=function(){}}function u(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var c;e:{var h={};try{h.__proto__={s:!0},c=h.s;break e}catch(o){}c=!1}s=c?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var d=s;function p(){this.h=!1,this.c=null,this.o=void 0,this.b=1,this.m=this.u=0,this.g=null}function f(e){if(e.h)throw new TypeError("Generator is already running");e.h=!0}function g(e,t,n){return e.b=n,{value:t}}function v(e){this.a=new p,this.B=e}function m(e,t,n,i){try{var r=t.call(e.a.c,n);if(!(r instanceof Object))throw new TypeError("Iterator result "+r+" is not an object");if(!r.done)return e.a.h=!1,r;var o=r.value}catch(t){return e.a.c=null,e.a.j(t),_(e)}return e.a.c=null,i.call(e.a,o),_(e)}function _(e){for(;e.a.b;)try{var t=e.B(e.a);if(t)return e.a.h=!1,{value:t.value,done:!1}}catch(t){e.a.o=void 0,e.a.j(t)}if(e.a.h=!1,e.a.g){if(t=e.a.g,e.a.g=null,t.w)throw t.v;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function y(e){this.next=function(t){return e.i(t)},this.throw=function(t){return e.j(t)},this.return=function(t){return function(e,t){f(e.a);var n=e.a.c;return n?m(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.a.return):(e.a.return(t),_(e))}(e,t)},l(),this[Symbol.iterator]=function(){return this}}function b(e,t){var n=new y(new v(t));return d&&d(n,e.prototype),n}if(p.prototype.i=function(e){this.o=e},p.prototype.j=function(e){this.g={v:e,w:!0},this.b=this.u||this.m},p.prototype.return=function(e){this.g={return:e},this.b=this.m},v.prototype.i=function(e){return f(this.a),this.a.c?m(this,this.a.c.next,e,this.a.i):(this.a.i(e),_(this))},v.prototype.j=function(e){return f(this.a),this.a.c?m(this,this.a.c.throw,e,this.a.i):(this.a.j(e),_(this))},"function"==typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var w=function(e,t){for(var n=0;n<e.length;n++)t(e[n])},C=function(e,t,n){return t instanceof Blob?[String(e),t,void 0!==n?n+"":"string"==typeof t.name?t.name:"blob"]:[String(e),String(t)]},T=function(e,t){if(e.length<t)throw new TypeError(t+" argument required, but only "+e.length+" present.")},E=function(e){var t=u(e);return e=t.next().value,t=t.next().value,e instanceof Blob&&(e=new File([e],t,{type:e.type,lastModified:e.lastModified})),e},S="object"==typeof window?window:"object"==typeof self?self:this,I=S.FormData,k=S.XMLHttpRequest&&S.XMLHttpRequest.prototype.send,x=S.Request&&S.fetch,A=S.navigator&&S.navigator.sendBeacon;r();var P=S.Symbol&&Symbol.toStringTag;P&&(Blob.prototype[P]||(Blob.prototype[P]="Blob"),"File"in S&&!File.prototype[P]&&(File.prototype[P]="File"));try{new File([],"")}catch(o){S.File=function(e,t,n){return e=new Blob(e,n),n=n&&void 0!==n.lastModified?new Date(n.lastModified):new Date,Object.defineProperties(e,{name:{value:t},lastModifiedDate:{value:n},lastModified:{value:+n},toString:{value:function(){return"[object File]"}}}),P&&Object.defineProperty(e,P,{value:"File"}),e}}r(),l();var O=function(e){if(this.f=Object.create(null),!e)return this;var t=this;w(e.elements,function(e){if(e.name&&!e.disabled&&"submit"!==e.type&&"button"!==e.type)if("file"===e.type){var n=e.files&&e.files.length?e.files:[new File([],"",{type:"application/octet-stream"})];w(n,function(n){t.append(e.name,n)})}else"select-multiple"===e.type||"select-one"===e.type?w(e.options,function(n){!n.disabled&&n.selected&&t.append(e.name,n.value)}):"checkbox"===e.type||"radio"===e.type?e.checked&&t.append(e.name,e.value):(n="textarea"===e.type?e.value.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"):e.value,t.append(e.name,n))})};if((e=O.prototype).append=function(e,t,n){T(arguments,2);var i=u(C.apply(null,arguments));e=i.next().value,t=i.next().value,n=i.next().value,(i=this.f)[e]||(i[e]=[]),i[e].push([t,n])},e.delete=function(e){T(arguments,1),delete this.f[String(e)]},e.entries=function e(){var t,n,i,r,o,s,a=this;return b(e,function(e){switch(e.b){case 1:t=a.f,i=new function(e){for(var t in this.A=e,this.l=[],e)this.l.push(t);this.l.reverse()}(t);case 2:var l;e:{for(l=i;0<l.l.length;){var c=l.l.pop();if(c in l.A){l=c;break e}}l=null}if(null==(n=l)){e.b=0;break}r=u(t[n]),o=r.next();case 5:if(o.done){e.b=2;break}return s=o.value,g(e,[n,E(s)],6);case 6:o=r.next(),e.b=5}})},e.forEach=function(e,t){T(arguments,1);for(var n=u(this),i=n.next();!i.done;i=n.next()){var r=u(i.value);i=r.next().value,r=r.next().value,e.call(t,r,i,this)}},e.get=function(e){T(arguments,1);var t=this.f;return t[e=String(e)]?E(t[e][0]):null},e.getAll=function(e){return T(arguments,1),(this.f[String(e)]||[]).map(E)},e.has=function(e){return T(arguments,1),String(e)in this.f},e.keys=function e(){var t,n,i,r,o=this;return b(e,function(e){if(1==e.b&&(t=u(o),n=t.next()),3!=e.b)return n.done?void(e.b=0):(i=n.value,r=u(i),g(e,r.next().value,3));n=t.next(),e.b=2})},e.set=function(e,t,n){T(arguments,2);var i=C.apply(null,arguments);this.f[i[0]]=[[i[1],i[2]]]},e.values=function e(){var t,n,i,r,o=this;return b(e,function(e){if(1==e.b&&(t=u(o),n=t.next()),3!=e.b)return n.done?void(e.b=0):(i=n.value,(r=u(i)).next(),g(e,r.next().value,3));n=t.next(),e.b=2})},O.prototype._asNative=function(){for(var e=new I,t=u(this),n=t.next();!n.done;n=t.next()){var i=u(n.value);n=i.next().value,i=i.next().value,e.append(n,i)}return e},O.prototype._blob=function(){for(var e="----formdata-polyfill-"+Math.random(),t=[],n=u(this),i=n.next();!i.done;i=n.next()){var r=u(i.value);i=r.next().value,r=r.next().value,t.push("--"+e+"\r\n"),r instanceof Blob?t.push('Content-Disposition: form-data; name="'+i+'"; filename="'+r.name+'"\r\n',"Content-Type: "+(r.type||"application/octet-stream")+"\r\n\r\n",r,"\r\n"):t.push('Content-Disposition: form-data; name="'+i+'"\r\n\r\n'+r+"\r\n")}return t.push("--"+e+"--"),new Blob(t,{type:"multipart/form-data; boundary="+e})},O.prototype[Symbol.iterator]=function(){return this.entries()},O.prototype.toString=function(){return"[object FormData]"},P&&(O.prototype[P]="FormData"),k&&(S.XMLHttpRequest.prototype.send=function(e){e instanceof O?(e=e._blob(),this.setRequestHeader("Content-Type",e.type),k.call(this,e)):k.call(this,e)}),x){var N=S.fetch;S.fetch=function(e,t){return t&&t.body&&t.body instanceof O&&(t.body=t.body._blob()),N.call(this,e,t)}}A&&(S.navigator.sendBeacon=function(e,t){return t instanceof O&&(t=t._asNative()),A.call(this,e,t)}),S.FormData=O}}();var du=Ze(function(e){var t;t=function(){if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var e,t,n,i,r,o,s,a,l,u,c,h,d,p,f,g,v,m,_,y,b,w,C,T,E,S=[],I=!1,k=!1,x=!1,A=[],P=!1,O=!1,N=/\s+/g,L="Sortable"+(new Date).getTime(),D=window,R=D.document,M=D.parseInt,F=D.setTimeout,j=D.jQuery||D.Zepto,U=D.Polymer,W={capture:!1,passive:!1},B=!!navigator.userAgent.match(/(?:Trident.*rv[ :]?11\.|msie|iemobile)/i),V=!!navigator.userAgent.match(/Edge/i),H=V||B?"cssFloat":"float",$="draggable"in R.createElement("div"),G=function(){if(B)return!1;var e=R.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}(),K=!1,q=!1,Q=Math.abs,Y=Math.min,z=[],X=function(e,t){var n=ge(e),i=M(n.width),r=Ce(e,0,t),o=Ce(e,1,t),s=r&&ge(r),a=o&&ge(o),l=s&&M(s.marginLeft)+M(s.marginRight)+Ne(r).width,u=a&&M(a.marginLeft)+M(a.marginRight)+Ne(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if(r&&"none"!==s.float){var c="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==c?"horizontal":"vertical"}return r&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=i&&"none"===n[H]||o&&"none"===n[H]&&l+u>i)?"vertical":"horizontal"},Z=function(e,t){if(!e||!e.getBoundingClientRect)return D;var n=e,i=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=ge(n);if(n.clientWidth<n.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!n||!n.getBoundingClientRect||n===R.body)return D;if(i||t)return n;i=!0}}}while(n=n.parentNode);return D},J=ke(function(e,t,n,i){if(t.scroll){var r=n?n[L]:window,o=t.scrollSensitivity,s=t.scrollSpeed,c=e.clientX,h=e.clientY,d=(window.innerWidth,window.innerHeight,!1);l!==n&&(ee(),a=t.scroll,u=t.scrollFn,!0===a&&(a=Z(n,!0),l=a));var p=0,f=a;do{var g,v,m,y,b,w,C,T,E,k=f,x=Ne(k),A=x.top,P=x.bottom,O=x.left,N=x.right,M=x.width,F=x.height;if(k!==D?(g=k.scrollWidth,v=k.scrollHeight,m=ge(k),w=M<g&&("auto"===m.overflowX||"scroll"===m.overflowX),C=F<v&&("auto"===m.overflowY||"scroll"===m.overflowY),T=k.scrollLeft,E=k.scrollTop):(g=R.documentElement.scrollWidth,v=R.documentElement.scrollHeight,m=ge(R.documentElement),w=M<g&&("auto"===m.overflowX||"scroll"===m.overflowX||"visible"===m.overflowX),C=F<v&&("auto"===m.overflowY||"scroll"===m.overflowY||"visible"===m.overflowY),T=R.documentElement.scrollLeft,E=R.documentElement.scrollTop),y=w&&(Q(N-c)<=o&&T+M<g)-(Q(O-c)<=o&&!!T),b=C&&(Q(P-h)<=o&&E+F<v)-(Q(A-h)<=o&&!!E),!S[p])for(var j=0;j<=p;j++)S[j]||(S[j]={});S[p].vx==y&&S[p].vy==b&&S[p].el===k||(S[p].el=k,S[p].vx=y,S[p].vy=b,clearInterval(S[p].pid),!k||0==y&&0==b||(d=!0,S[p].pid=setInterval(function(){i&&0===this.layer&&ue.active._emulateDragOver(!0);var t=S[this.layer].vy?S[this.layer].vy*s:0,n=S[this.layer].vx?S[this.layer].vx*s:0;"function"==typeof u&&"continue"!==u.call(r,n,t,e,_,S[this.layer].el)||(S[this.layer].el===D?D.scrollTo(D.pageXOffset+n,D.pageYOffset+t):(S[this.layer].el.scrollTop+=t,S[this.layer].el.scrollLeft+=n))}.bind({layer:p}),24))),p++}while(t.bubbleScroll&&f!==D&&(f=Z(f,!1)));I=d}},30),ee=function(){S.forEach(function(e){clearInterval(e.pid)}),S=[]},te=function(e){function t(e,n){return function(i,r,o,s){var a=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(null==e&&(n||a))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(i,r,o,s),n)(i,r,o,s);var l=(n?i:r).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},i=e.group;i&&"object"==typeof i||(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},ne=function(t){e&&e.parentNode&&e.parentNode[L]&&e.parentNode[L]._computeIsAligned(t)},ie=function(e,t){for(var n=t;!n[L];)n=n.parentNode;return e===n},re=function(e,t,n){for(var i=e.parentNode;i&&!i[L];)i=i.parentNode;i&&i[L][n](xe(t,{artificialBubble:!0}))},oe=function(){!G&&n&&ge(n,"display","none")},se=function(){!G&&n&&ge(n,"display","")};R.addEventListener("click",function(e){if(x)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),x=!1,!1},!0);var ae,le=function(t){if(t=t.touches?t.touches[0]:t,e){var n=function(e,t){for(var n=0;n<A.length;n++)if(!A[n].children.length){var i=Ne(A[n]),r=A[n][L].options.emptyInsertThreshold,o=e>=i.left-r&&e<=i.right+r,s=t>=i.top-r&&t<=i.bottom+r;if(o&&s)return A[n]}}(t.clientX,t.clientY);n&&n[L]._onDragOver({clientX:t.clientX,clientY:t.clientY,target:n,rootEl:n})}};function ue(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be HTMLElement, not "+{}.toString.call(e);this.el=e,this.options=t=xe({},t),e[L]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0,draggable:/[uo]l/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return X(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,touchStartThreshold:M(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==ue.supportPointer&&("PointerEvent"in window||window.navigator&&"msPointerEnabled"in window.navigator),emptyInsertThreshold:5};for(var i in n)!(i in t)&&(t[i]=n[i]);for(var r in te(t),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!t.forceFallback&&$,t.supportPointer?de(e,"pointerdown",this._onTapStart):(de(e,"mousedown",this._onTapStart),de(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(de(e,"dragover",this),de(e,"dragenter",this)),A.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[])}function ce(e,t,n,i){if(e){n=n||R;do{if(null!=t&&(">"===t[0]&&e.parentNode===n&&Ie(e,t.substring(1))||Ie(e,t))||i&&e===n)return e;if(e===n)break}while(e=he(e))}return null}function he(e){return e.host&&e!==R&&e.host.nodeType?e.host:e.parentNode}function de(e,t,n){e.addEventListener(t,n,W)}function pe(e,t,n){e.removeEventListener(t,n,W)}function fe(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(N," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(N," ")}}function ge(e,t,n){var i=e&&e.style;if(i){if(void 0===n)return R.defaultView&&R.defaultView.getComputedStyle?n=R.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in i||-1!==t.indexOf("webkit")||(t="-webkit-"+t),i[t]=n+("string"==typeof n?"":"px")}}function ve(e){var t="";do{var n=ge(e,"transform");n&&"none"!==n&&(t=n+" "+t)}while(e=e.parentNode);return window.DOMMatrix?new DOMMatrix(t):window.WebKitCSSMatrix?new WebKitCSSMatrix(t):window.CSSMatrix?new CSSMatrix(t):void 0}function me(e,t,n){if(e){var i=e.getElementsByTagName(t),r=0,o=i.length;if(n)for(;r<o;r++)n(i[r],r);return i}return[]}function _e(e,t,n,r,o,s,a,l,u){var c,h=(e=e||t[L]).options,d="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||B||V?(c=R.createEvent("Event")).initEvent(n,!0,!0):c=new CustomEvent(n,{bubbles:!0,cancelable:!0}),c.to=o||t,c.from=s||t,c.item=r||t,c.clone=i,c.oldIndex=a,c.newIndex=l,c.originalEvent=u,t&&t.dispatchEvent(c),h[d]&&h[d].call(e,c)}function ye(e,t,n,i,r,o,s,a){var l,u,c=e[L],h=c.options.onMove;return!window.CustomEvent||B||V?(l=R.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=i,l.related=r||t,l.relatedRect=o||Ne(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),h&&(u=h.call(c,l,s)),u}function be(e){e.draggable=!1}function we(){K=!1}function Ce(t,i,r){for(var o=0,s=0,a=t.children;s<a.length;){if("none"!==a[s].style.display&&a[s]!==n&&a[s]!==e&&ce(a[s],r.draggable,t,!1)){if(o===i)return a[s];o++}s++}return null}function Te(e){for(var t=e.lastElementChild;(t===n||"none"===t.style.display)&&(t=t.previousElementSibling););return t||null}function Ee(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function Se(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e&&(e=e.previousElementSibling);)"TEMPLATE"!==e.nodeName.toUpperCase()&&e!==i&&n++;return n}function Ie(e,t){if(e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}function ke(e,t){return function(){if(!ae){var n=arguments,i=this;ae=F(function(){1===n.length?e.call(i,n[0]):e.apply(i,n),ae=void 0},t)}}}function xe(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Ae(e){return U&&U.dom?U.dom(e).cloneNode(!0):j?j(e).clone(!0)[0]:e.cloneNode(!0)}function Pe(e){return F(e,0)}function Oe(e){return clearTimeout(e)}function Ne(e,t,n){if(e.getBoundingClientRect||e===D){var i,r,o,s,a,l,u;if(e!==D?(r=(i=e.getBoundingClientRect()).top,o=i.left,s=i.bottom,a=i.right,l=i.height,u=i.width):(r=0,o=0,s=window.innerHeight,a=window.innerWidth,l=window.innerHeight,u=window.innerWidth),n&&e!==D){if(t=t||e.parentNode,!B)do{if(t&&t.getBoundingClientRect&&"none"!==ge(t,"transform")){var c=t.getBoundingClientRect();r-=c.top+M(ge(t,"border-top-width")),o-=c.left+M(ge(t,"border-left-width")),s=r+i.height,a=o+i.width;break}}while(t=t.parentNode);var h=ve(e),d=h&&h.a,p=h&&h.d;h&&(s=(r/=p)+(l/=p),a=(o/=d)+(u/=d))}return{top:r,left:o,bottom:s,right:a,width:u,height:l}}}return de(R,"dragover",le),de(R,"mousemove",le),de(R,"touchmove",le),ue.prototype={constructor:ue,_computeIsAligned:function(t){var i;if(n&&!G?(oe(),i=R.elementFromPoint(t.clientX,t.clientY),se()):i=t.target,i=ce(i,this.options.draggable,this.el,!1),!q&&e&&e.parentNode===this.el){for(var r,o,s,a,l,u,c,h,d=this.el.children,p=0;p<d.length;p++)ce(d[p],this.options.draggable,this.el,!1)&&d[p]!==i&&(d[p].sortableMouseAligned=(r=t.clientX,o=t.clientY,s=d[p],a=this._getDirection(t,null),this.options,void 0,void 0,void 0,void 0,l=Ne(s),u="vertical"===a?l.left:l.top,c="vertical"===a?l.right:l.bottom,u<(h="vertical"===a?r:o)&&h<c));ce(i,this.options.draggable,this.el,!0)||(b=null),q=!0,F(function(){q=!1},30)}},_getDirection:function(t,n){return"function"==typeof this.options.direction?this.options.direction.call(this,t,n,e):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n,i=this,r=this.el,o=this.options,a=o.preventOnFilter,l=t.type,u=t.touches&&t.touches[0],c=(u||t).target,h=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,d=o.filter;if(function(e){z.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var i=t[n];i.checked&&z.push(i)}}(r),(!B||t.artificialBubble||ie(r,c))&&!e&&!(/mousedown|pointerdown/.test(l)&&0!==t.button||o.disabled||h.isContentEditable))if(c=ce(c,o.draggable,r,!1)){if(s!==c){if(n=Se(c,o.draggable),"function"==typeof d){if(d.call(this,t,c,this))return _e(i,h,"filter",c,r,r,n),void(a&&t.cancelable&&t.preventDefault())}else if(d&&(d=d.split(",").some(function(e){if(e=ce(h,e.trim(),r,!1))return _e(i,e,"filter",c,r,r,n),!0})))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!ce(h,o.handle,r,!1)||this._prepareDragStart(t,u,c,n)}}else B&&re(r,t,"_onTapStart")}},_handleAutoScroll:function(t,n){if(e&&this.options.scroll){var i=t.clientX,r=t.clientY,o=R.elementFromPoint(i,r),s=this;if(n||V||B){J(t,s.options,o,n);var a=Z(o,!0);!I||f&&i===g&&r===v||(f&&clearInterval(f),f=setInterval(function(){if(e){var o=Z(R.elementFromPoint(i,r),!0);o!==a&&(a=o,ee(),J(t,s.options,a,n))}},10),g=i,v=r)}else{if(!s.options.bubbleScroll||Z(o,!0)===window)return void ee();J(t,s.options,Z(o,!1),!1)}}},_prepareDragStart:function(n,i,a,l){var u,h=this,p=h.el,f=h.options,g=p.ownerDocument;a&&!e&&a.parentNode===p&&(r=p,t=(e=a).parentNode,o=e.nextSibling,s=a,d=f.group,c=l,m={target:e,clientX:(i||n).clientX,clientY:(i||n).clientY},this._lastX=(i||n).clientX,this._lastY=(i||n).clientY,e.style["will-change"]="all",e.style.transition="",e.style.transform="",u=function(){h._disableDelayedDrag(),e.draggable=h.nativeDraggable,h._triggerDragStart(n,i),_e(h,r,"choose",e,r,r,c),fe(e,f.chosenClass,!0)},f.ignore.split(",").forEach(function(t){me(e,t.trim(),be)}),f.supportPointer?de(g,"pointerup",h._onDrop):(de(g,"mouseup",h._onDrop),de(g,"touchend",h._onDrop),de(g,"touchcancel",h._onDrop)),f.delay?(de(g,"mouseup",h._disableDelayedDrag),de(g,"touchend",h._disableDelayedDrag),de(g,"touchcancel",h._disableDelayedDrag),de(g,"mousemove",h._delayedDragTouchMoveHandler),de(g,"touchmove",h._delayedDragTouchMoveHandler),f.supportPointer&&de(g,"pointermove",h._delayedDragTouchMoveHandler),h._dragStartTimer=F(u,f.delay)):u())},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Y(Q(t.clientX-this._lastX),Q(t.clientY-this._lastY))>=this.options.touchStartThreshold&&this._disableDelayedDrag()},_disableDelayedDrag:function(){var e=this.el.ownerDocument;clearTimeout(this._dragStartTimer),pe(e,"mouseup",this._disableDelayedDrag),pe(e,"touchend",this._disableDelayedDrag),pe(e,"touchcancel",this._disableDelayedDrag),pe(e,"mousemove",this._delayedDragTouchMoveHandler),pe(e,"touchmove",this._delayedDragTouchMoveHandler),pe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||("touch"==t.pointerType?t:null),!this.nativeDraggable||n?this.options.supportPointer?de(R,"pointermove",this._onTouchMove):de(R,n?"touchmove":"mousemove",this._onTouchMove):(de(e,"dragend",this),de(r,"dragstart",this._onDragStart));try{R.selection?Pe(function(){R.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(t){if(k=!1,r&&e){this.nativeDraggable&&(de(R,"dragover",this._handleAutoScroll),de(R,"dragover",ne));var n=this.options;!t&&fe(e,n.dragClass,!1),fe(e,n.ghostClass,!0),ge(e,"transform",""),ue.active=this,t&&this._appendGhost(),_e(this,r,"start",e,r,r,c)}else this._nulling()},_emulateDragOver:function(t){if(_){if(this._lastX===_.clientX&&this._lastY===_.clientY&&!t)return;this._lastX=_.clientX,this._lastY=_.clientY,oe();for(var n=R.elementFromPoint(_.clientX,_.clientY),i=n;n&&n.shadowRoot;)i=n=n.shadowRoot.elementFromPoint(_.clientX,_.clientY);if(i)do{if(i[L])if(i[L]._onDragOver({clientX:_.clientX,clientY:_.clientY,target:n,rootEl:i})&&!this.options.dragoverBubble)break;n=i}while(i=i.parentNode);e.parentNode[L]._computeIsAligned(_),se()}},_onTouchMove:function(e){if(m){var t=this.options,i=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,s=n&&ve(n),a=n&&s&&s.a,l=n&&s&&s.d,u=(o.clientX-m.clientX+r.x)/(a||1),c=(o.clientY-m.clientY+r.y)/(l||1),h=e.touches?"translate3d("+u+"px,"+c+"px,0)":"translate("+u+"px,"+c+"px)";if(!ue.active&&!k){if(i&&Y(Q(o.clientX-this._lastX),Q(o.clientY-this._lastY))<i)return;this._onDragStart(e,!0)}this._handleAutoScroll(o,!0),y=!0,_=o,ge(n,"webkitTransform",h),ge(n,"mozTransform",h),ge(n,"msTransform",h),ge(n,"transform",h),e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!n){var t=Ne(e,this.options.fallbackOnBody?R.body:r,!0),i=(ge(e),this.options);fe(n=e.cloneNode(!0),i.ghostClass,!1),fe(n,i.fallbackClass,!0),fe(n,i.dragClass,!0),ge(n,"box-sizing","border-box"),ge(n,"margin",0),ge(n,"top",t.top),ge(n,"left",t.left),ge(n,"width",t.width),ge(n,"height",t.height),ge(n,"opacity","0.8"),ge(n,"position","fixed"),ge(n,"zIndex","100000"),ge(n,"pointerEvents","none"),i.fallbackOnBody&&R.body.appendChild(n)||r.appendChild(n)}},_onDragStart:function(t,n){var o=this,s=t.dataTransfer,a=o.options;(i=Ae(e)).draggable=!1,i.style["will-change"]="",this._hideClone(),fe(i,o.options.chosenClass,!1),o._cloneId=Pe(function(){o.options.removeCloneOnHide||r.insertBefore(i,e),_e(o,r,"clone",e)}),!n&&fe(e,a.dragClass,!0),n?(x=!0,o._loopId=setInterval(o._emulateDragOver,50)):(pe(R,"mouseup",o._onDrop),pe(R,"touchend",o._onDrop),pe(R,"touchcancel",o._onDrop),s&&(s.effectAllowed="move",a.setData&&a.setData.call(o,s,e)),de(R,"drop",o),ge(e,"transform","translateZ(0)")),k=!0,o._dragStartId=Pe(o._dragStarted.bind(o,n)),de(R,"selectstart",o)},_onDragOver:function(i){var s,a,l,u=this.el,h=i.target,f=this.options,g=f.group,v=ue.active,m=d===g,_=f.sort,S=this;if(!K&&(!B||i.rootEl||i.artificialBubble||ie(u,h))){if(void 0!==i.preventDefault&&i.cancelable&&i.preventDefault(),y=!0,h=ce(h,f.draggable,u,!0),ce(i.target,null,e,!0)||h.animated)return $();if(h!==e&&(x=!1),v&&!f.disabled&&(m?_||(l=!r.contains(e)):p===this||(this.lastPutMode=d.checkPull(this,v,e,i))&&g.checkPut(this,v,e,i))){var k=this._getDirection(i,h);if(s=Ne(e),l)return this._hideClone(),t=r,o?r.insertBefore(e,o):r.appendChild(e),$();if(0===u.children.length||u.children[0]===n||function(e,t,n){var i=Ne(Te(n)),r="vertical"===t?e.clientY:e.clientX,o="vertical"===t?e.clientX:e.clientY,s="vertical"===t?i.bottom:i.right,a="vertical"===t?i.left:i.top,l="vertical"===t?i.right:i.bottom;return"vertical"===t?o>l+10||o<=l&&r>s&&o>=a:r>s&&o>a||r<=s&&o>l+10}(i,k,u)&&!e.animated){if(0!==u.children.length&&u.children[0]!==n&&u===i.target&&(h=Te(u)),h&&(a=Ne(h)),m?v._hideClone():v._showClone(this),!1!==ye(r,u,e,s,h,a,i,!!h))return u.appendChild(e),t=u,E=null,G(),this._animate(s,e),h&&this._animate(a,h),$()}else if(h&&h!==e&&h.parentNode===u){var A,N=0,M=h.sortableMouseAligned,j=e.parentNode!==u,U=function(e,t){var n=Z(n,!0),i=Ne(e)[t];for(;n;){var r=Ne(n)[t];if(!("top"===t||"left"===t?i>=r:i<=r))return!0;if(n===D)break;n=Z(n,!1)}return!1}(h,"vertical"===k?"top":"left");if(b!==h&&(C=null,A=Ne(h)["vertical"===k?"top":"left"],P=!1),function(t,n,i){var r=t===e&&E||Ne(t),o=n===e&&E||Ne(n),s="vertical"===i?r.left:r.top,a="vertical"===i?r.right:r.bottom,l="vertical"===i?r.width:r.height,u="vertical"===i?o.left:o.top,c="vertical"===i?o.right:o.bottom,h="vertical"===i?o.width:o.height;return s===u||a===c||s+l/2===u+h/2}(e,h,k)&&M||j||U||f.invertSwap||"insert"===C||"swap"===C?("swap"!==C&&(O=f.invertSwap||j||I||U),N=function(t,n,i,r,o,s,a){var l=Ne(n),u="vertical"===i?t.clientY:t.clientX,c="vertical"===i?l.height:l.width,h="vertical"===i?l.top:l.left,d="vertical"===i?l.bottom:l.right,p=Ne(e),f=!1;if(!s)if(a&&T<c*r)if(!P&&(1===w?u>h+c*o/2:u<d-c*o/2)&&(P=!0),P)f=!0;else{"vertical"===i?p.top:p.left,"vertical"===i?p.bottom:p.right;if(1===w?u<h+T:u>d-T)return-1*w}else if(u>h+c*(1-r)/2&&u<d-c*(1-r)/2)return u>h+c/2?-1:1;if((f=f||s)&&(u<h+c*o/2||u>d-c*o/2))return u>h+c/2?1:-1;return 0}(i,h,k,f.swapThreshold,null==f.invertedSwapThreshold?f.swapThreshold:f.invertedSwapThreshold,O,b===h),C="swap"):(N=function(t,n){var i=Se(e,n.draggable),r=Se(t,n.draggable);return i<r?1:-1}(h,f),C="insert"),0===N)return $();E=null,b=h,w=N,a=Ne(h);var W=h.nextElementSibling,V=!1,H=ye(r,u,e,s,h,a,i,V=1===N);if(!1!==H)return 1!==H&&-1!==H||(V=1===H),K=!0,F(we,30),m?v._hideClone():v._showClone(this),V&&!W?u.appendChild(e):h.parentNode.insertBefore(e,V?W:h),t=e.parentNode,void 0===A||O||(T=Q(A-Ne(h)["vertical"===k?"top":"left"])),G(),!j&&this._animate(a,h),this._animate(s,e),$()}if(u.contains(e))return $()}return B&&!i.rootEl&&re(u,i,"_onDragOver"),!1}function $(){return v&&(fe(e,p?p.options.ghostClass:v.options.ghostClass,!1),fe(e,f.ghostClass,!0)),p!==S&&S!==ue.active?p=S:S===ue.active&&(p=null),(h===e&&!e.animated||h===u&&!h.animated)&&(b=null),f.dragoverBubble||i.rootEl||h===R||(S._handleAutoScroll(i),e.parentNode[L]._computeIsAligned(i)),!f.dragoverBubble&&i.stopPropagation&&i.stopPropagation(),!0}function G(){_e(S,r,"change",h,u,r,c,Se(e,f.draggable),i)}},_animate:function(t,n){var i=this.options.animation;if(i){var r=Ne(n);if(n===e&&(E=r),1===t.nodeType&&(t=Ne(t)),t.left+t.width/2!==r.left+r.width/2||t.top+t.height/2!==r.top+r.height/2){var o=ve(this.el),s=o&&o.a,a=o&&o.d;ge(n,"transition","none"),ge(n,"transform","translate3d("+(t.left-r.left)/(s||1)+"px,"+(t.top-r.top)/(a||1)+"px,0)"),n.offsetWidth,ge(n,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),ge(n,"transform","translate3d(0,0,0)")}"number"==typeof n.animated&&clearTimeout(n.animated),n.animated=F(function(){ge(n,"transition",""),ge(n,"transform",""),n.animated=!1},i)}},_offUpEvents:function(){var e=this.el.ownerDocument;pe(R,"touchmove",this._onTouchMove),pe(R,"pointermove",this._onTouchMove),pe(e,"mouseup",this._onDrop),pe(e,"touchend",this._onDrop),pe(e,"pointerup",this._onDrop),pe(e,"touchcancel",this._onDrop),pe(R,"selectstart",this)},_onDrop:function(s){var a=this.el,l=this.options;k=!1,I=!1,O=!1,P=!1,clearInterval(this._loopId),clearInterval(f),ee(),clearTimeout(ae),ae=void 0,clearTimeout(this._dragStartTimer),Oe(this._cloneId),Oe(this._dragStartId),pe(R,"mousemove",this._onTouchMove),this.nativeDraggable&&(pe(R,"drop",this),pe(a,"dragstart",this._onDragStart),pe(R,"dragover",this._handleAutoScroll),pe(R,"dragover",ne)),this._offUpEvents(),s&&(y&&(s.cancelable&&s.preventDefault(),!l.dropBubble&&s.stopPropagation()),n&&n.parentNode&&n.parentNode.removeChild(n),(r===t||p&&"clone"!==p.lastPutMode)&&i&&i.parentNode&&i.parentNode.removeChild(i),e&&(this.nativeDraggable&&pe(e,"dragend",this),be(e),e.style["will-change"]="",fe(e,p?p.options.ghostClass:this.options.ghostClass,!1),fe(e,this.options.chosenClass,!1),_e(this,r,"unchoose",e,t,r,c,null,s),r!==t?((h=Se(e,l.draggable))>=0&&(_e(null,t,"add",e,t,r,c,h,s),_e(this,r,"remove",e,t,r,c,h,s),_e(null,t,"sort",e,t,r,c,h,s),_e(this,r,"sort",e,t,r,c,h,s)),p&&p.save()):e.nextSibling!==o&&(h=Se(e,l.draggable))>=0&&(_e(this,r,"update",e,t,r,c,h,s),_e(this,r,"sort",e,t,r,c,h,s)),ue.active&&(null!=h&&-1!==h||(h=c),_e(this,r,"end",e,t,r,c,h,s),this.save()))),this._nulling()},_nulling:function(){r=e=t=n=o=i=s=a=l=S.length=f=g=v=m=_=y=h=c=b=w=E=p=d=ue.active=null,z.forEach(function(e){e.checked=!0}),z.length=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":e&&(this._onDragOver(t),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,i=0,r=n.length,o=this.options;i<r;i++)ce(e=n[i],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Ee(e));return t},sort:function(e){var t={},n=this.el;this.toArray().forEach(function(e,i){var r=n.children[i];ce(r,this.options.draggable,n,!1)&&(t[e]=r)},this),e.forEach(function(e){t[e]&&(n.removeChild(t[e]),n.appendChild(t[e]))})},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return ce(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];n[e]=t,"group"===e&&te(n)},destroy:function(){var e=this.el;e[L]=null,pe(e,"mousedown",this._onTapStart),pe(e,"touchstart",this._onTapStart),pe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(pe(e,"dragover",this),pe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),A.splice(A.indexOf(this.el),1),this.el=e=null},_hideClone:function(){i.cloneHidden||(ge(i,"display","none"),i.cloneHidden=!0,i.parentNode&&this.options.removeCloneOnHide&&i.parentNode.removeChild(i))},_showClone:function(t){"clone"===t.lastPutMode?i.cloneHidden&&(r.contains(e)&&!this.options.group.revertClone?r.insertBefore(i,e):o?r.insertBefore(i,o):r.appendChild(i),this.options.group.revertClone&&this._animate(e,i),ge(i,"display",""),i.cloneHidden=!1):this._hideClone()}},de(R,"touchmove",function(e){(ue.active||k)&&e.cancelable&&e.preventDefault()}),ue.utils={on:de,off:pe,css:ge,find:me,is:function(e,t){return!!ce(e,t,e,!1)},extend:xe,throttle:ke,closest:ce,toggleClass:fe,clone:Ae,index:Se,nextTick:Pe,cancelNextTick:Oe,detectDirection:X,getChild:Ce},ue.create=function(e,t){return new ue(e,t)},ue.version="1.8.3",ue},e.exports=t()}),pu=Object.freeze({default:du,__moduleExports:du}),fu=pu&&du||pu,gu=Ze(function(e,t){var n=Object.assign||function(e){for(var t=arguments,n=1;n<arguments.length;n++){var i=t[n];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e};function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}!function(){Array.from||(Array.from=function(e){return[].slice.call(e)});var t=fu;e.exports=function(e){function t(e){e.parentElement.removeChild(e)}function r(e,t,n){var i=0===n?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,i)}function o(e,t){var n=this;this.$nextTick(function(){return n.$emit(e.toLowerCase(),t)})}var s=["Start","Add","Remove","Update","End"],a=["Choose","Sort","Filter","Clone"],l=["Move"].concat(s,a).map(function(e){return"on"+e}),u=null;return{name:"draggable",props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(e){return e}},element:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1,init:!1}},render:function(e){var t=this.$slots.default;if(t&&1===t.length){var n=t[0];n.componentOptions&&"transition-group"===n.componentOptions.tag&&(this.transitionMode=!0)}var r=t,o=this.$slots.footer;o&&(r=t?[].concat(i(t),i(o)):[].concat(i(o)));var s=null,a=function(e,t){s=function(e,t,n){return void 0==n?e:((e=null==e?{}:e)[t]=n,e)}(s,e,t)};if(a("attrs",this.$attrs),this.componentData){var l=this.componentData,u=l.on,c=l.props;a("on",u),a("props",c)}return e(this.element,s,r)},mounted:function(){var t=this;if(this.noneFunctionalComponentMode=this.element.toLowerCase()!==this.$el.nodeName.toLowerCase(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter element value or remove transition-group. Current element value: "+this.element);var i={};s.forEach(function(e){i["on"+e]=function(e){var t=this;return function(n){null!==t.realList&&t["onDrag"+e](n),o.call(t,e,n)}}.call(t,e)}),a.forEach(function(e){i["on"+e]=o.bind(t,e)});var r=n({},this.options,i,{onMove:function(e,n){return t.onDragMove(e,n)}});!("draggable"in r)&&(r.draggable=">*"),this._sortable=new e(this.rootContainer,r),this.computeIndexes()},beforeDestroy:function(){this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},isCloning:function(){return!!this.options&&!!this.options.group&&"clone"===this.options.group.pull},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(e){for(var t in e)-1==l.indexOf(t)&&this._sortable.option(t,e[t])},deep:!0},realList:function(){this.computeIndexes()}},methods:{getChildrenNodes:function(){if(this.init||(this.noneFunctionalComponentMode=this.noneFunctionalComponentMode&&1==this.$children.length,this.init=!0),this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var e=this.$slots.default;return this.transitionMode?e[0].child.$slots.default:e},computeIndexes:function(){var e=this;this.$nextTick(function(){e.visibleIndexes=function(e,t,n){if(!e)return[];var r=e.map(function(e){return e.elm}),o=[].concat(i(t)).map(function(e){return r.indexOf(e)});return n?o.filter(function(e){return-1!==e}):o}(e.getChildrenNodes(),e.rootContainer.children,e.transitionMode)})},getUnderlyingVm:function(e){var t=function(e,t){return e.map(function(e){return e.elm}).indexOf(t)}(this.getChildrenNodes()||[],e);return-1===t?null:{index:t,element:this.realList[t]}},getUnderlyingPotencialDraggableComponent:function(e){var t=e.__vue__;return t&&t.$options&&"transition-group"===t.$options._componentTag?t.$parent:t},emitChanges:function(e){var t=this;this.$nextTick(function(){t.$emit("change",e)})},alterList:function(e){if(this.list)e(this.list);else{var t=[].concat(i(this.value));e(t),this.$emit("input",t)}},spliceList:function(){var e=arguments,t=function(t){return t.splice.apply(t,e)};this.alterList(t)},updatePosition:function(e,t){var n=function(n){return n.splice(t,0,n.splice(e,1)[0])};this.alterList(n)},getRelatedContextFromMoveEvent:function(e){var t=e.to,i=e.related,r=this.getUnderlyingPotencialDraggableComponent(t);if(!r)return{component:r};var o=r.realList,s={list:o,component:r};if(t!==i&&o&&r.getUnderlyingVm){var a=r.getUnderlyingVm(i);if(a)return n(a,s)}return s},getVmIndex:function(e){var t=this.visibleIndexes,n=t.length;return e>n-1?n:t[e]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(e){if(this.noTransitionOnDrag&&this.transitionMode){this.getChildrenNodes()[e].data=null;var t=this.getComponent();t.children=[],t.kept=void 0}},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),u=e.item},onDragAdd:function(e){var n=e.item._underlying_vm_;if(void 0!==n){t(e.item);var i=this.getVmIndex(e.newIndex);this.spliceList(i,0,n),this.computeIndexes();var r={element:n,newIndex:i};this.emitChanges({added:r})}},onDragRemove:function(e){if(r(this.rootContainer,e.item,e.oldIndex),this.isCloning)t(e.clone);else{var n=this.context.index;this.spliceList(n,1);var i={element:this.context.element,oldIndex:n};this.resetTransitionData(n),this.emitChanges({removed:i})}},onDragUpdate:function(e){t(e.item),r(e.from,e.item,e.oldIndex);var n=this.context.index,i=this.getVmIndex(e.newIndex);this.updatePosition(n,i);var o={element:this.context.element,oldIndex:n,newIndex:i};this.emitChanges({moved:o})},computeFutureIndex:function(e,t){if(!e.element)return 0;var n=[].concat(i(t.to.children)).filter(function(e){return"none"!==e.style.display}),r=n.indexOf(t.related),o=e.component.getVmIndex(r);return-1==n.indexOf(u)&&t.willInsertAfter?o+1:o},onDragMove:function(e,t){var i=this.move;if(!i||!this.realList)return!0;var r=this.getRelatedContextFromMoveEvent(e),o=this.context,s=this.computeFutureIndex(r,e);return n(o,{futureIndex:s}),n(e,{relatedContext:r,draggedContext:o}),i(e,t)},onDragEnd:function(e){this.computeIndexes(),u=null}}}}(t)}()}),vu={data:function(){var e=void 0!==WILOKE_GLOBAL.uploadType&&"ajax"==WILOKE_GLOBAL.uploadType,t={isRequired:!1,oPlanSettings:{},value:[],maximumImages:0,aUploadedImages:"object"==typeof this.settings.value&&this.settings.value.length?this.settings.value:[],oTranslation:WILCITY_I18,isAjaxUpload:e,isUploading:!1,isWPUpload:"wp"==WILOKE_GLOBAL.uploadType,internalErrMsg:""},n={};n=this.settings.isMultiple?Object.assign({},{isMultiple:!0,labelName:WILCITY_I18.images,paramName:e?"images":"images[]",btnName:WILCITY_I18.uploadMultipleImagesTitle,wrapperClassName:"upload-image_module__3I5sF"},this.settings):Object.assign({},{uploadFieldID:"",isMultiple:!1,paramName:"image",labelName:WILCITY_I18.image,btnName:WILCITY_I18.uploadSingleImageTitle,wrapperClassName:"field_module__1H6kT field_style2__2Znhe mb-15"},this.settings);var i=Object.assign({},t,n);return"no"==i.isRequired&&(i.isRequired=!1),void 0===i.oPlanSettings&&(i.oPlanSettings={}),i},props:{settings:{type:Object,default:function(){return{isMultiple:!1,value:[],wrapperClassName:"field_module__1H6kT field_style2__2Znhe mb-15"}}},field:{type:Object}},watch:{settings:{handler:function(e){this.aUploadedImages=e.value,void 0!==e.oPlanSettings&&e.oPlanSettings&&(this.oPlanSettings=e.oPlanSettings,this.setupConfiguration())},deep:!0},aUploadedImages:{handler:function(e){this.isMultiple&&0!==this.maximumImages&&this.aUploadedImages.length>this.maximumImages&&this.aUploadedImages.splice(0,this.maximumImages),void 0!==this.field&&(this.field.value=this.aUploadedImages),this.$emit("uploadImgChanged",this.aUploadedImages,this.settings)},deep:!0}},computed:{errMsg:function(){return this.internalErrMsg.length?this.internalErrMsg:this.settings.errMsg},singleBtnClass:function(){return this.isUploading?"wil-btn wil-btn--primary wil-btn--round wil-btn--xxs wil-btn--loading":"wil-btn wil-btn--primary wil-btn--round wil-btn--xxs"},uploadClass:function(){return{"upload-image_button__3-6QW color-primary--hover":!0,disable:0!=this.maximumImages&&this.aUploadedImages.length>=this.maximumImages}},conditional:function(){return this.isRequired&&"required|","image|size:"+WILOKE_GLOBAL.maxUpload},singleBgImg:function(){return this.isValidImg()?this.aUploadedImages[0].src:""},singleImgName:function(){return this.isValidImg()?this.aUploadedImages[0].fileName:""},generateID:function(){var e=new Date;return this.uploadFieldID="wilcity-upload-"+e.getUTCMilliseconds(),this.uploadFieldID},warning:function(){return 0==this.maximumImages||isNaN(this.maximumImages)?"":this.oTranslation.maximumImgsWarning.replace("%s",this.oPlanSettings.maximumGalleryImages)},wrapperClass:function(){var e=this.wrapperClassName;return null!==this.settings&&void 0!==this.settings.paramName&&void 0!==this.oPlanSettings["toggle_"+this.settings.paramName]&&"disable"==this.oPlanSettings["toggle_"+this.settings.paramName]&&(e+=" disable"),this.hasUploadedImages()?(void 0!==this.errMsg&&""!=this.errMsg?e+=" error":e+=" active",e):e}},methods:{handleSingleUpload:function(e){this.aUploadedImages=[],this.aUploadedImages.push({id:e.id,src:e.url,fileName:e.filename})},handleMultipleUpload:function(e){var t=e.map(function(e){return{id:e.id,src:e.url,fileName:e.filename}});Array.isArray(this.aUploadedImages)||(this.aUploadedImages=[]),this.aUploadedImages=this.aUploadedImages.concat(t)},wpUploadHandler:function(e){var t,n=this;if(e.data("uploadFrame"))return e.data("uploadFrame").open(),!0;t=wp.media({multiple:this.isMultiple}),e.data("uploadFrame",t),t.on("select",function(){n.isMultiple?n.handleMultipleUpload(t.state().get("selection").toJSON()):n.handleSingleUpload(t.state().get("selection").first().toJSON())}),t.open()},setupConfiguration:function(){void 0!==this.oPlanSettings.maximumGalleryImages&&0!=this.oPlanSettings.maximumGalleryImages&&(this.maximumImages=parseInt(this.oPlanSettings.maximumGalleryImages,10))},hasUploadedImages:function(){return this.aUploadedImages.length},isValidImg:function(){return!(this.errMsg||!this.hasUploadedImages())},getBase64Img:function(e,t){var n=document.createElement("canvas");return n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0),n.toDataURL(t.type)},getImage:function(e){var t=this;return new Promise(function(n,i){var r=new FileReader,o=document.createElement("img");r.onload=function(){o.src=r.result,o.onload=function(){n(t.getBase64Img(o,e))}},r.readAsDataURL(e)})},startUploading:function(e){var t=this,n=e.getAll(this.paramName);!this.aUploadedImages.length&&0!=this.maximumImages&&n.length>this.maximumImages&&(n=n.splice(0,this.maximumImages));var i=n.map(function(e){return t.getImage(e).then(function(t){return{fileType:e.type,fileSize:e.size,originalName:e.name,fileName:e.name,src:t}})});return Promise.all(i)},ajaxUploadImgs:function(e){var t=this;this.isUploading=!0,this.internalErrMsg="";var n=WILOKE_GLOBAL.ajaxurl+"?action=wilcity_ajax_upload_imgs";return this.isMultiple||this.aUploadedImages.length&&(n+="&previous="+this.aUploadedImages[0].id),new Promise(function(i,r){jQuery.ajax({url:n,type:"POST",data:e,contentType:!1,cache:!1,processData:!1,success:function(e){t.isUploading=!1,e.success?i(e.data):r(e.data.msg)}})})},uploadFieldListener:function(){var e=this;if(null===document.getElementById(this.uploadFieldID))return this.aUploadedImages=[],!1;document.getElementById(this.uploadFieldID).addEventListener("change",function(t){var n=t.target.files;if(!n.length)return!1;var i=new FormData,r=n.length;if(void 0!==WILOKE_GLOBAL.isUploadImgViaAjax&&"yes"==WILOKE_GLOBAL.isUploadImgViaAjax){0!=e.maximumImages&&(e.aUploadedImages.length&&(e.maximumImages=e.maximumImages-e.aUploadedImages.length),r>e.maximumImages&&(r=e.maximumImages));for(var o=0;o<r;o++)i.append(e.paramName+"_"+o,n[o],n[o].name);return e.ajaxUploadImgs(i).then(function(t){if(e.isMultiple?(Array.isArray(e.aUploadedImages)||(e.aUploadedImages=[]),e.aUploadedImages=e.aUploadedImages.concat(t.aImgs)):e.aUploadedImages=t.aImgs,void 0!==e.field&&(e.field.value=e.aUploadedImages),void 0!==t.aErrors&&t.aErrors.length){for(var n="<ul>",i=0;i<t.aErrors.length;i++)n+="<li>"+t.aErrors[i].name+":"+t.aErrors[i].msg+"</li>";n+="<ul>",e.internalErrMsg=n}}).catch(function(t){e.internalErrMsg=t}),!0}for(var s=0;s<r;s++)i.append(e.paramName,n[s],n[s].name);e.startUploading(i).then(function(t){e.isMultiple&&e.hasUploadedImages()?e.aUploadedImages=Array.isArray(e.aUploadedImages)?e.aUploadedImages.concat(t):Object.assign({},e.aUploadedImages,t):e.aUploadedImages=t,0!=e.maximumImages&&e.aUploadedImages.length>e.maximumImages&&e.aUploadedImages.splice(0,e.maximumImages),void 0!==e.field&&(e.field.value=e.aUploadedImages)})})},listenUploadEvent:function(e){this.isWPUpload?(e.preventDefault(),this.wpUploadHandler(jQuery(e.target))):jQuery(e.currentTarget).closest(".field_wrap__Gv92k").find(".field_field__3U_Rt").trigger("click")},deleteImg:function(e){jQuery.ajax({url:WILOKE_GLOBAL.ajaxurl,type:"POST",data:{action:"wilcity_delete_attachment",id:e},success:function(e){}})},removeImg:function(e){if(this.isWPUpload)this.aUploadedImages.splice(e,1);else{var t=this.aUploadedImages.splice(e,1);this.deleteImg(t[0].id)}}},mounted:function(){this.setupConfiguration(),this.uploadFieldListener()},components:{draggable:gu}},mu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isMultiple?n("div",{class:e.wrapperClass},[n("div",{staticClass:"upload-image_row__2UK1p clearfix temporary-disable"},[e.hasUploadedImages()?n("div",[n("draggable",{model:{value:e.aUploadedImages,callback:function(t){e.aUploadedImages=t},expression:"aUploadedImages"}},e._l(e.aUploadedImages,function(t,i){return n("div",{staticClass:"upload-image_thumb__V-SH7"},[n("div",{staticClass:"upload-image_image__17ttf cover-after",style:{backgroundImage:"url("+t.src+")"}}),e._v(" "),n("span",{staticClass:"upload-image_remove__3Oa_t color-primary--hover",on:{click:function(t){return t.preventDefault(),e.removeImg(i)}}},[n("i",{staticClass:"la la-close"})])])}),0)],1):e._e(),e._v(" "),n("div",{class:e.uploadClass},[e.isWPUpload?n("input",{attrs:{id:e.generateID,type:"text",name:e.paramName},on:{click:function(t){return t.preventDefault(),e.listenUploadEvent(t)}}}):n("input",{attrs:{id:e.generateID,type:"file",name:e.paramName,multiple:""}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.isUploading,expression:"!isUploading"}],staticClass:"upload-image_buttonContent__fjl5V"},[n("i",{staticClass:"la la-image"})]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.isUploading,expression:"isUploading"}],staticClass:"full-load"},[e._m(0)])])]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:""!=e.errMsg,expression:"errMsg!=''"}],staticClass:"clearfix"}),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:""!=e.errMsg,expression:"errMsg!=''"}],staticClass:"field_message__3Z6FX color-quaternary",domProps:{innerHTML:e._s(e.errMsg)}}),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:""!=e.warning,expression:"warning!=''"}],staticClass:"field_message__3Z6FX color-quaternary",domProps:{innerHTML:e._s(e.warning)}})]):n("div",{class:e.wrapperClass},[n("div",{staticClass:"field_wrap__Gv92k temporary-disable"},[e._t("wiloke-uploader-action",[e.isWPUpload?n("input",{staticClass:"field_field__3U_Rt",attrs:{id:e.generateID,type:"text",name:e.paramName}}):n("input",{staticClass:"field_field__3U_Rt",attrs:{id:e.generateID,type:"file",name:e.paramName}}),e._v(" "),n("span",{staticClass:"input-filename",attrs:{"data-text":e.singleImgName},on:{click:e.listenUploadEvent}},[n("span",{staticClass:"input-fileimg",style:{backgroundImage:"url("+e.singleBgImg+")"}})]),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis",class:{required:e.isRequired}},[e._v(e._s(e.labelName))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})],{paramName:e.paramName,isRequired:e.isRequired,labelName:e.labelName}),e._v(" "),e._t("wiloke-uploader-preview",[n("div",{staticClass:"field_right__2qM90 pos-a-center-right"},[n("a",{class:e.singleBtnClass,attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.listenUploadEvent(t)}}},[e._v(e._s(e.btnName)+"\n "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.isUploading,expression:"isUploading"}],staticClass:"pill-loading_module__3LZ6v"},[n("div",{staticClass:"pill-loading_loader__3LOnT"})])])])],{aUploadedImages:e.aUploadedImages})],2),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:""!=e.errMsg,expression:"errMsg!=''"}],staticClass:"field_message__3Z6FX color-quaternary",domProps:{innerHTML:e._s(e.errMsg)}})])};mu._withStripped=!0;var _u=A({render:mu,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"pill-loading_module__3LZ6v pos-a-center"},[t("div",{staticClass:"pill-loading_loader__3LOnT"})])}]},void 0,vu,void 0,!1,void 0,void 0,void 0),yu={data:function(){return{isUpdated:!1,changed:this.value,$jsSlider:null}},props:["maximum","minimum","oItem","value"],updated:function(){this.$nextTick(function(){if(this.isUpdated)return!1;this.isUpdated=!0,this.wilSlider()})},watch:{value:function(e){this.changed=e,this.$jsSlider.slider("option","value",e)}},methods:{wilSlider:function(){var e=this;isNaN(this.value)&&(this.value=0),this.$jsSlider=jQuery(this.$el).find(".js-slider");var t=this.$jsSlider.siblings(".js-slider-info"),n=(this.$jsSlider.data("key"),jQuery(".js-slider-info__number",t));this.$jsSlider.slider({range:"min",min:this.$jsSlider.data("slider-min"),max:this.$jsSlider.data("slider-max"),value:this.value,slide:function(i,r){t.attr("data-active","true"),n.text(r.value),e.changed=r.value,0===r.value&&t.attr("data-active","")},stop:function(t,n){e.$emit("sliderChanged",n.value,e.oItem)}})}},mounted:function(){this.wilSlider()}},bu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"rated-slider_module__s79oc d-table"},[n("div",{staticClass:"rated-slider_item__3pr-4 d-table-row"},[n("div",{staticClass:"rated-slider_text__RSWfi d-table-cell"},[e._v(e._s(e.oItem.name))]),e._v(" "),n("div",{staticClass:"rated-slider_slider__ncPAq d-table-cell"},[n("div",{staticClass:"js-slider",attrs:{"data-key":e.key,"data-slider-min":e.minimum,"data-slider-max":e.maximum,"data-slider-value":e.changed}}),e._v(" "),n("div",{staticClass:"js-slider-info"},[n("span",{staticClass:"js-slider-info__number"},[e._v(e._s(e.changed))])])])])])};bu._withStripped=!0;var wu=A({render:bu,staticRenderFns:[]},void 0,yu,void 0,!1,void 0,void 0,void 0),Cu={data:function(){return{isHidden:!1}},props:["msg","hasRemove"],methods:{hideMsg:function(){event.preventDefault(),this.isHidden=!0}}},Tu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:!e.isHidden,expression:"!isHidden"}],staticClass:"alert_module__Q4QZx alert_danger__2ajVf"},[e._m(0),e._v(" "),n("div",{staticClass:"alert_content__1ntU3",domProps:{innerHTML:e._s(e.msg)}}),e.hasRemove?n("a",{staticClass:"alert_close__3PtGd",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.hideMsg(t)}}},[n("i",{staticClass:"la la-times"})]):e._e()])};Tu._withStripped=!0;var Eu=A({render:Tu,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"alert_icon__1bDKL"},[t("i",{staticClass:"la la-warning"})])}]},void 0,Cu,void 0,!1,void 0,void 0,void 0),Su={data:function(){return{title:"",content:"",popupID:"write-a-review-popup",oReviewSettings:"undefined"!=typeof WILCITY_REVIEW_SETTINGS?WILCITY_REVIEW_SETTINGS:{},errMsg:"",thankMsg:"",isFetching:!1,xhrReviewGeneral:null,reviewQuality:null,averageReviewScore:null,reviewID:""}},props:["popupId","btnName","popupTitle","icon","reviewData","reviewSettings","reviewTitleLabel","reviewContentLabel","toggleGallery"],components:{WilokePopup:N,WilokeUploadImg:_u,WilokeMessage:R,WilokeSliderRange:wu,WilokeErrorMsg:Eu},watch:{oReviewData:{handler:function(e){this.title!==e.title&&(this.title=e.title),this.content!==e.content&&(this.content=e.content)},deep:!0}},computed:{titleClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.title.length}},contentClass:function(){return{"field_module__1H6kT field_style2__2Znhe mb-15":!0,active:this.content.length}},galleryData:function(){return{isMultiple:!0,value:this.$store.getters.getReviewInfo&&void 0!==this.$store.getters.getReviewInfo.gallery?this.$store.getters.getReviewInfo.gallery:[],wrapperClassName:"upload-image_module__3I5sF upload-image_sm__25yM3",aUploadedImgs:[]}},oReviewData:function(){var e=this.$store.getters.getReviewInfo;return e||{gallery:{},title:"",content:""}},oReviewDetails:function(){var e=this.$store.getters.getReviewInfo;return e?(this.getReviewID(),e.details):WILCITY_REVIEW_SETTINGS.details}},methods:{getReviewID:function(){var e=this.$store.getters.getPopupArgs(this.popupID);e||(this.reviewID=""),this.reviewID=void 0!==e.reviewID?e.reviewID:""},itemVal:function(e){return this.$store.getters.getReviewInfo?parseFloat(this.$store.getters.getReviewInfo.details[e.key].value):5},changedReviewDetail:function(e,t){void 0===this.oReviewData.details&&(this.oReviewData.details={}),void 0===this.oReviewData.details[t.key]&&(this.oReviewData.details[t.key]={}),this.oReviewData.details[t.key].value=e},updateReviewOnDOM:function(e){if(jQuery(".wilcity-review-title-"+this.reviewID).html(this.oReviewData.title),jQuery(".wilcity-review-content-"+this.reviewID).html(this.oReviewData.content),null!==this.averageReviewScore){var t=averageReviewScore;5==this.mode&&(t=2*parseFloat(t)),jQuery(".wilcity-data-average-review-score-"+this.reviewID).attr("data-rated",t),jQuery(".wilcity-average-review-score-"+this.reviewID).html(this.averageReviewScore),this.averageReviewScore>0&&jQuery(".wilcity-data-average-review-score-"+this.reviewID).removeClass("hidden")}null!==this.reviewQuality&&jQuery(".wilcity-review-quality-"+this.reviewID).html(this.reviewQuality),jQuery("#wilcity-review-gallery-"+this.reviewID).find(".wilcity-magnific-via-jquery").length&&jQuery("#wilcity-review-gallery-"+this.reviewID).wilcityInitMagnific()},galleryChanged:function(e){this.oReviewData.gallery=e},reCalculationReviewGeneral:function(){null!==this.xhrReviewGeneral&&200!==typeof this.xhrReviewGeneral.status&&this.xhrReviewGeneral.abort(),this.xhrReviewGeneral=jQuery.ajax({url:WILOKE_GLOBAL.ajaxurl+"?action=wilcity_fetch_review_general&postID="+WILOKE_INLINE_GLOBAL.postID,type:"GET",success:function(e){e.success&&jQuery("body").trigger("changedGeneralReview",e.data)}})},closePopup:function(){this.$store.commit("updatePopupStatus",{id:"write-a-review-popup",status:"close"})},submitReview:function(e){var t=this,n=jQuery(e.currentTarget);this.errMsg="",n.addClass("wil-btn--disabled"),this.$emit("line-loading","yes"),this.oReviewData.title=this.title,this.oReviewData.content=this.content,this.getReviewID(),jQuery.ajax({url:WILOKE_GLOBAL.ajaxurl,type:"POST",data:{action:"wilcity_submit_review",listingID:WILOKE_INLINE_GLOBAL.postID,reviewID:this.reviewID,data:this.oReviewData},success:function(e){if(n.removeClass("wil-btn--disabled"),e.success){t.$store.commit("updateReviews",{isAddToFirst:!0,oReviews:e.data.reviews});var i=WilCityHelpers.buildQuery("st","wilcity-js-review-item-"+e.data.reviewID);"yes"==e.data.isRefresh?(t.$store.commit("updateFocusRefresh",!0),window.location.href=WilCityHelpers.buildQuery("tab",t.$store.getters.getCurrentListingTab,i)):(t.thankMsg=e.data.msg,setTimeout(function(){t.closePopup()},3e3))}else t.errMsg=e.data.msg;t.$emit("line-loading","no")}})}}},Iu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":e.popupID,"btn-name":e.btnName,"popup-title":e.popupTitle,icon:e.icon},on:{"on-close-popup":e.closePopup}},[n("template",{slot:"body"},[n("form",{attrs:{action:"#",method:"POST"}},[n("wiloke-error-msg",{directives:[{name:"show",rawName:"v-show",value:""!=e.errMsg,expression:"errMsg!=''"}],attrs:{msg:e.errMsg}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:""!=e.thankMsg,expression:"thankMsg!=''"}],attrs:{msg:e.thankMsg,status:"success"}}),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.thankMsg.length,expression:"!thankMsg.length"}]},[e._l(e.oReviewSettings.details,function(t){return e.oReviewSettings.details?n("wiloke-slider-range",{attrs:{maximum:e.oReviewSettings.mode,minimum:"1","o-item":t,value:e.itemVal(t)},on:{sliderChanged:e.changedReviewDetail}}):e._e()}),e._v(" "),n("div",{staticClass:"wil-divider bg-color-gray-1 mt-20 mb-20"}),e._v(" "),n("div",{class:e.titleClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.title,expression:"title"}],staticClass:"field_field__3U_Rt",attrs:{type:"text",required:""},domProps:{value:e.title},on:{input:function(t){t.target.composing||(e.title=t.target.value)}}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.reviewTitleLabel)+"*")]),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),n("div",{class:e.contentClass},[n("div",{staticClass:"field_wrap__Gv92k"},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.content,expression:"content"}],staticClass:"field_field__3U_Rt",attrs:{required:""},domProps:{value:e.content},on:{input:function(t){t.target.composing||(e.content=t.target.value)}}}),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.reviewContentLabel)+"*")]),n("span",{staticClass:"bg-color-primary"})])]),e._v(" "),"enable"==e.toggleGallery?n("wiloke-upload-img",{attrs:{settings:e.galleryData,additional:{cssClass:"comment-review_gallery__2Tyry"}},on:{uploadImgChanged:e.galleryChanged}}):e._e(),e._v(" "),n("div",{staticClass:"mt-10"}),e._v(" "),n("button",{staticClass:"wil-btn wil-btn--primary wil-btn--round wil-btn--md wil-btn--block",on:{click:function(t){return t.preventDefault(),e.submitReview(t)}}},[n("i",{staticClass:"la la-paper-plane"}),e._v(" "+e._s(e.btnName))])],2)],1)])],2)};Iu._withStripped=!0;var ku=A({render:Iu,staticRenderFns:[]},void 0,Su,void 0,!1,void 0,void 0,void 0),xu={data:function(){return{value:void 0!==this.settings.value?this.settings.value:"",oPlanSettings:void 0!==this.$store&&void 0!==this.$store.getters.getPlanSettings?this.$store.getters.getPlanSettings:{}}},props:["settings"],watch:{value:function(e){this.settings.value=e,this.$emit("textareaChanged",e,this.settings),this.$emit("input",e)}},computed:{wrapperClass:function(){return{"field_module__1H6kT field_style2__2Znhe field-autoHeight mb-15":!0,active:this.value.length,disable:void 0!==this.oPlanSettings["toggle_"+this.settings.key]&&"disable"==this.oPlanSettings["toggle_"+this.settings.key]}}}},Au=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperClass},[n("div",{staticClass:"field_wrap__Gv92k"},[(e.settings.isRequired,n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"field_field__3U_Rt",domProps:{value:e.value},on:{input:function(t){t.target.composing||(e.value=t.target.value)}}})),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis",class:{required:"yes"==e.settings.isRequired}},[e._v(e._s(e.settings.label))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})]),e._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:""!=e.settings.errMsg,expression:"settings.errMsg!=''"}],staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.settings.errMsg))])])};Au._withStripped=!0;var Pu=A({render:Au,staticRenderFns:[]},void 0,xu,void 0,!1,void 0,void 0,void 0),Ou={data:function(){return{selected:this.settings.value}},props:["settings","wrapperClass"],methods:{printOptionValue:function(e){return void 0!==e.value?e.value:e},printOptionName:function(e){return void 0!==e.label?e.label:e},changed:function(){this.settings.value=this.selected,this.$emit("radioChanged",this.selected,this.settings)}},computed:{getGridClass:function(){return void 0===this.gridClass?"col-md-12":this.gridClass}},components:{WilokeHeading:ie},mounted:function(){}},Nu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperClass},[e.settings.label?n("div",[n("wiloke-heading",{attrs:{title:e.settings.label,desc:e.settings.desc}})],1):e._e(),e._v(" "),e._l(e.settings.options,function(t){return n("div",[n("div",{staticClass:"checkbox_module__1K5IS checkbox_radio__1pYzR mb-15 js-checkbox"},[n("label",{staticClass:"checkbox_label__3cO9k"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.selected,expression:"selected"}],staticClass:"checkbox_inputcheck__1_X9Z",attrs:{type:"radio"},domProps:{value:e.printOptionValue(t),checked:e._q(e.selected,e.printOptionValue(t))},on:{change:[function(n){e.selected=e.printOptionValue(t)},e.changed]}}),e._v(" "),e._m(0,!0),e._v(" "),n("span",{staticClass:"checkbox_text__3Go1u text-ellipsis"},[e._v(e._s(e.printOptionName(t))+"\n "),n("span",{staticClass:"checkbox-border"})])])])])})],2)};Nu._withStripped=!0;var Lu=A({render:Nu,staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("span",{staticClass:"checkbox_icon__28tFk bg-color-primary--checked-after bd-color-primary--checked"},[t("i",{staticClass:"la la-check"}),this._v(" "),t("span",{staticClass:"checkbox-iconBg"})])}]},void 0,Ou,void 0,!1,void 0,void 0,void 0),Du={data:function(){return{oTranslation:WILCITY_I18,oClaimFields:{},oData:{},errMsg:"",postID:"",successMsg:"",isSending:"no",xhr:null}},components:{BlockLoading:G,WilokeMessage:R,WilokePopup:N,WilokeInput:ue,WilokeTextarea:Pu,WilokeRadio:Lu,WilokeCheckboxTwo:Ne,WilokeSelectTwo:se,WilokeErrorMsg:Eu},mounted:function(){document.getElementById("wilcity-single-listing-content")&&this.fetchClaimFields()},methods:{getVal:function(e,t){return void 0===this.oData[e]?!0===typeof t?[]:"":this.oData[e]},closePopup:function(){this.$store.dispatch("closePopup",{id:"wilcity-claim-popup",status:"close"})},submitClaimRequest:function(e){var t=this;null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),this.postID=WILOKE_INLINE_GLOBAL.postID,this.$emit("line-loading","yes"),this.isSending="yes",this.oData.postID=this.postID,this.xhr=jQuery.ajax({url:WILOKE_GLOBAL.ajaxurl,type:"POST",data:{url:WILOKE_GLOBAL.ajaxurl,action:"wilcity_claim_request",data:this.oData},success:function(e){e.success?(t.errMsg="",void 0!==e.data.redirectTo?window.location.href=e.data.redirectTo:(t.successMsg=e.data.msg,setTimeout(function(){t.closePopup()},4e3))):t.errMsg=e.data.msg,t.$emit("line-loading","no"),t.isSending="no"}})},checkboxTwoChanged:function(e,t){this.oData[t.key]=e},textareaChanged:function(e,t){this.oData[t.key]=e},radioChanged:function(e,t){this.oData[t.key]=e},inputChanged:function(e,t){this.oData[t.key]=e},selectTwoChanged:function(e,t){this.oData[t.key]=e},fetchClaimFields:function(){var e=this;if(Object.values(this.oClaimFields).length)return!0;this.isSending="yes",fetch(WilCityHelpers.buildRestRequest("listings/"+WILOKE_INLINE_GLOBAL.postID+"/fields/claims")).then(function(e){return e.json()}).then(function(t){WilCityHelpers.isRestError(t)?e.errMsg=WilCityHelpers.getUserMessage(t):e.$set(e.$data,"oClaimFields",t.data)})}}},Ru=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":"wilcity-claim-popup","popup-title":e.oTranslation.claimListing},on:{"on-close-popup":e.closePopup}},[n("block-loading",{attrs:{position:"pos-a-center","is-loading":e.isSending}}),e._v(" "),n("div",{attrs:{slot:"body"},slot:"body"},[n("wiloke-error-msg",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],attrs:{msg:e.errMsg,"has-remove":"false"}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.successMsg.length,expression:"successMsg.length"}],attrs:{msg:e.successMsg,"has-remove":"false",icon:"la la-bullhorn",status:"success"}}),e._v(" "),e.oClaimFields.noPackage?n("div",[n("wiloke-error-msg",{attrs:{msg:e.oTranslation.noClaimFields,"has-remove":"false"}})],1):e._l(e.oClaimFields,function(t){return n("div",["checkbox"==t.type?n("wiloke-checkbox-two",{attrs:{settings:{options:t.options,value:e.getVal(t.key,!0),label:t.label,key:t.key}},on:{checkboxTwoChanged:e.checkboxTwoChanged}}):"textarea"==t.type?n("wiloke-textarea",{attrs:{settings:{isRequired:t.isRequired,value:e.getVal(t.key),label:t.label,key:t.key}},on:{textareaChanged:e.textareaChanged}}):"radio"==t.type?n("wiloke-radio",{attrs:{settings:{options:t.options,value:e.getVal(t.key),label:t.label,key:t.key}},on:{radioChanged:e.radioChanged}}):t.options?n("wiloke-select-two",{attrs:{settings:{options:t.options,value:e.getVal(t.key),label:t.label,key:t.key}},on:{selectTwoChanged:e.selectTwoChanged}}):n("wiloke-input",{attrs:{settings:{isRequired:t.isRequired,value:e.getVal(t.key),label:t.label,key:t.key}},on:{inputChanged:e.inputChanged}})],1)})],2),e._v(" "),n("footer",{staticClass:"popup_footer__2pUrl clearfix",attrs:{slot:"footer"},slot:"footer"},[n("div",{staticClass:"popup_footerRight__qvdP6"},[n("button",{staticClass:"wil-btn wil-btn--gray wil-btn--sm wil-btn--round",attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.closePopup(t)}}},[e._v(e._s(e.oTranslation.cancel))]),e._v(" "),n("button",{staticClass:"wil-btn wil-btn--primary wil-btn--sm wil-btn--round",attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.submitClaimRequest(t)}}},[e._v(e._s(e.oTranslation.submit))])])])],1)};Ru._withStripped=!0;var Mu=A({render:Ru,staticRenderFns:[]},void 0,Du,void 0,!1,void 0,void 0,void 0),Fu={data:function(){return{errMsg:"",successMsg:"",oTranslation:WILCITY_I18,isLoading:"no"}},props:["cancel","yes","title"],components:{WilokeMessage:R,WilokeErrorMsg:Eu,WilokePopup:N},methods:{deleteReview:function(){var e=this,t=this.$store.getters.getPopupArgs("wilcity-delete-review-popup");t&&void 0!==t.reviewID||(this.errMsg=this.oTranslation.reviewIDIsRequired),this.$emit("line-loading","yes"),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_delete_review",reviewID:t.reviewID},success:function(n){n.success?(e.successMsg=n.data.msg,jQuery(".wilcity-js-review-item-"+t.reviewID).length&&jQuery(".wilcity-js-review-item-"+t.reviewID).remove(),setTimeout(function(){e.closePopup(),e.errMsg="",e.successMsg=""},1e3)):e.errMsg=n.data.msg,e.$emit("line-loading","no")}})},closePopup:function(){this.$store.commit("updatePopupStatus",{id:"wilcity-delete-review-popup",status:"close"})}}},ju=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":"wilcity-delete-review-popup","popup-title":e.title,"wrapper-class":"popup_module__3M-0- pos-f-full popup_sm__Rc24D popup_mobile-full__1hyc4"},on:{"on-close-popup":e.closePopup}},[n("block-loading",{attrs:{"is-loading":e.isLoading,position:""}}),e._v(" "),n("div",{staticClass:"wil-scroll-container",attrs:{slot:"body"},slot:"body"},[n("wiloke-error-msg",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],attrs:{msg:e.errMsg,"has-remove":"false"}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.successMsg.length,expression:"successMsg.length"}],attrs:{msg:e.successMsg,"has-remove":"false",icon:"la la-bullhorn",status:"success"}}),e._v(" "),n("button",{directives:[{name:"show",rawName:"v-show",value:!e.successMsg.length,expression:"!successMsg.length"}],staticClass:"wil-btn wil-btn--primary wil-btn--sm wil-btn--round mr-30",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.yes)},on:{click:function(t){return t.preventDefault(),e.deleteReview(t)}}}),e._v(" "),n("button",{directives:[{name:"show",rawName:"v-show",value:!e.successMsg.length,expression:"!successMsg.length"}],staticClass:"wil-btn wil-btn--secondary wil-btn--sm wil-btn--round",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.cancel)},on:{click:function(t){return t.preventDefault(),e.closePopup(t)}}})],1)],1)};ju._withStripped=!0;var Uu=A({render:ju,staticRenderFns:[]},void 0,Fu,void 0,!1,void 0,void 0,void 0),Wu={data:function(){return{errMsg:"",successMsg:"",oTranslation:WILCITY_I18,isLoading:"no",xhr:null,id:"wilcity-ask-delete-author-message-popup"}},props:["cancel","yes","title","body"],components:{WilokeMessage:R,WilokeErrorMsg:Eu,WilokePopup:N},methods:{closePopup:function(){this.$store.commit("updatePopupStatus",{id:this.id,status:"close"})},deleteMessage:function(){var e=this,t=this.$store.getters.getDeleteAuthorInfo;null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),this.$emit("line-loading","yes"),this.xhr=jQuery.ajax({type:"post",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_delete_author_message",authorInfo:t},success:function(t){if(t.success){"yes"!=WILOKE_GLOBAL.isUsingFirebase&&document.getElementById("wilcity-sent-from-"+t.data.authorId).remove();var n=document.querySelectorAll(".wilcity-message-content");if(n)for(var i=n.length,r=0;r<i;r++)n[r].remove()}e.closePopup()}})}}},Bu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":e.id,"popup-title":e.title,"wrapper-class":"popup_module__3M-0- pos-f-full popup_sm__Rc24D popup_mobile-full__1hyc4"},on:{"on-close-popup":e.closePopup}},[n("block-loading",{attrs:{"is-loading":e.isLoading,position:""}}),e._v(" "),e.body?n("div",{staticClass:"wil-scroll-container",attrs:{slot:"body"},slot:"body"},[n("div",{staticClass:"promo-item_module__24ZhT"},[n("div",{staticClass:"promo-item_group__2ZJhC"},[n("p",{staticClass:"promo-item_description__2nc26",domProps:{innerHTML:e._s(e.body)}})])]),e._v(" "),n("wiloke-error-msg",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],attrs:{msg:e.errMsg,"has-remove":"false"}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.successMsg.length,expression:"successMsg.length"}],attrs:{msg:e.successMsg,"has-remove":"false",icon:"la la-bullhorn",status:"success"}})],1):e._e(),e._v(" "),n("footer",{staticClass:"popup_footer__2pUrl clearfix",attrs:{slot:"footer"},slot:"footer"},[n("div",{staticClass:"popup_footerRight__qvdP6"},[n("button",{directives:[{name:"show",rawName:"v-show",value:!e.successMsg.length,expression:"!successMsg.length"}],staticClass:"wil-btn wil-btn--primary wil-btn--sm wil-btn--round",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.yes)},on:{click:function(t){return t.preventDefault(),e.deleteMessage(t)}}}),e._v(" "),n("button",{directives:[{name:"show",rawName:"v-show",value:!e.successMsg.length,expression:"!successMsg.length"}],staticClass:"wil-btn wil-btn--secondary wil-btn--sm wil-btn--round",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.cancel)},on:{click:function(t){return t.preventDefault(),e.closePopup(t)}}})])])],1)};Bu._withStripped=!0;var Vu=A({render:Bu,staticRenderFns:[]},void 0,Wu,void 0,!1,void 0,void 0,void 0),Hu={data:function(){return{errMsg:"",successMsg:"",oTranslation:WILCITY_I18,isLoading:"no",xhr:null,id:"wilcity-ask-delete-single-message-popup"}},props:["cancel","yes","title","body"],components:{WilokeMessage:R,WilokeErrorMsg:Eu,WilokePopup:N},methods:{closePopup:function(){this.$store.commit("updatePopupStatus",{id:this.id,status:"close"})},deleteMessage:function(){var e=this,t=this.$store.getters.getDeleteSingleMessageInfo;null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),this.$emit("line-loading","yes"),this.errMsg="",this.xhr=jQuery.ajax({type:"post",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_delete_single_message",ID:t.msgID,firebaseMsgID:t.msgID,firebaseChatKey:t.oFirebase.chatKey,firebaseReceiveID:t.oFirebase.receiveId,firebaseSenderID:t.oFirebase.senderId},success:function(n){if(n.success){var i=document.getElementById("wilcity-message-id-"+t.msgID);i&&i.remove(),e.closePopup()}else e.errMsg=n.data.msg;e.$emit("line-loading","no")}})}}},$u=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":e.id,"popup-title":e.title,"wrapper-class":"popup_module__3M-0- pos-f-full popup_sm__Rc24D popup_mobile-full__1hyc4"},on:{"on-close-popup":e.closePopup}},[n("block-loading",{attrs:{"is-loading":e.isLoading,position:""}}),e._v(" "),n("div",{staticClass:"wil-scroll-container",attrs:{slot:"body"},slot:"body"},[n("wiloke-error-msg",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],attrs:{msg:e.errMsg,"has-remove":"false"}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.successMsg.length,expression:"successMsg.length"}],attrs:{msg:e.successMsg,"has-remove":"false",icon:"la la-bullhorn",status:"success"}}),e._v(" "),n("div",{staticClass:"promo-item_module__24ZhT"},[n("div",{staticClass:"promo-item_group__2ZJhC"},[n("p",{staticClass:"promo-item_description__2nc26",domProps:{innerHTML:e._s(e.body)}})])])],1),e._v(" "),n("footer",{staticClass:"popup_footer__2pUrl clearfix",attrs:{slot:"footer"},slot:"footer"},[n("div",{staticClass:"popup_footerRight__qvdP6"},[n("button",{directives:[{name:"show",rawName:"v-show",value:!e.successMsg.length,expression:"!successMsg.length"}],staticClass:"wil-btn wil-btn--primary wil-btn--sm wil-btn--round mr-30",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.yes)},on:{click:function(t){return t.preventDefault(),e.deleteMessage(t)}}}),e._v(" "),n("button",{directives:[{name:"show",rawName:"v-show",value:!e.successMsg.length,expression:"!successMsg.length"}],staticClass:"wil-btn wil-btn--secondary wil-btn--sm wil-btn--round",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.cancel)},on:{click:function(t){return t.preventDefault(),e.closePopup(t)}}})])])],1)};$u._withStripped=!0;var Gu=A({render:$u,staticRenderFns:[]},void 0,Hu,void 0,!1,void 0,void 0,void 0),Ku={data:function(){return{oTranslation:WILCITY_I18,aFields:[],oData:{},description:"",errMsg:"",postID:"",successMsg:"",aStopSubmitting:[],xhr:null}},components:{WilokeMessage:R,WilokePopup:N,WilokeInput:ue,WilokeTextarea:Pu,WilokeRadio:Lu,WilokeCheckboxTwo:Ne,WilokeSelectTwo:se,WilokeErrorMsg:Eu},mounted:function(){this.fetchPopupFields()},computed:{isStopSubmitting:function(){return void 0!==this.aStopSubmitting[this.postID]}},methods:{inputChanged:function(e,t){this.oData[t.key]=e},selectTwoChanged:function(e,t){this.oData[t.key]=e},textareaChanged:function(e,t){this.oData[t.key]=e},fetchPopupFields:function(){var e=this;if(this.aFields.length)return!1;this.errMsg="",fetch(WilCityHelpers.buildRestRequest("listings/fields/reports")).then(function(e){return e.json()}).then(function(t){WilCityHelpers.isRestError(t)?e.errMsg=WilCityHelpers.getUserMessage(t):(e.aFields=t.data.fields,e.description=t.data.description)})},getVal:function(e,t){return void 0===this.oData[e]?!0===typeof t?[]:"":this.oData[e]},closePopup:function(){this.$emit("onClosePopup",!0)},submitReport:function(){var e=this;if(null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),this.stopSubmitting)return!1;this.$emit("line-loading","yes"),this.successMsg=this.errMsg="";var t=this.$store.getters.getPopupArgs("wilcity-report-popup");this.xhr=jQuery.ajax({url:WILOKE_GLOBAL.ajaxurl,type:"POST",data:{url:WILOKE_GLOBAL.ajaxurl,action:"wilcity_submit_report",data:this.oData,postID:t.reviewID},success:function(n){n.success?(e.$set(e.aStopSubmitting,t.reviewID,!0),e.successMsg=n.data.msg,setTimeout(function(){e.closePopup(),e.successMsg=""},3e3)):e.errMsg=n.data.msg,e.$emit("line-loading","no")}})}}},qu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":"wilcity-report-popup","popup-title":e.oTranslation.reportTitle},on:{"on-close-popup":e.closePopup}},[n("div",{attrs:{slot:"body"},slot:"body"},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.description.length,expression:"description.length"}],domProps:{innerHTML:e._s(e.description)}}),e._v(" "),n("wiloke-error-msg",{directives:[{name:"show",rawName:"v-show",value:e.errMsg.length,expression:"errMsg.length"}],attrs:{msg:e.errMsg,"has-remove":"false"}}),e._v(" "),n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:e.successMsg.length,expression:"successMsg.length"}],attrs:{msg:e.successMsg,"has-remove":"false",icon:"la la-bullhorn",status:"success"}}),e._v(" "),e._l(e.aFields,function(t){return e.isStopSubmitting?e._e():n("div",["textarea"==t.type?n("wiloke-textarea",{attrs:{settings:{isRequired:t.isRequired,value:"",label:t.label,key:t.key}},on:{textareaChanged:e.textareaChanged}}):"select"==t.type?n("wiloke-select-two",{attrs:{settings:{options:t.options,value:"",label:t.label,key:t.key}},on:{selectTwoChanged:e.selectTwoChanged}}):n("wiloke-input",{attrs:{settings:{isRequired:t.isRequired,value:"",label:t.label,key:t.key}},on:{inputChanged:e.inputChanged}})],1)})],2),e._v(" "),e.isStopSubmitting?e._e():n("footer",{staticClass:"popup_footer__2pUrl clearfix",attrs:{slot:"footer"},slot:"footer"},[n("div",{staticClass:"popup_footerRight__qvdP6"},[n("button",{staticClass:"wil-btn wil-btn--gray wil-btn--sm wil-btn--round",attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.closePopup(t)}}},[e._v(e._s(e.oTranslation.cancel))]),e._v(" "),n("button",{staticClass:"wil-btn wil-btn--primary wil-btn--sm wil-btn--round",attrs:{type:"submit"},on:{click:function(t){return t.preventDefault(),e.submitReport(t)}}},[e._v(e._s(e.oTranslation.submit))])])])])};qu._withStripped=!0;var Qu=A({render:qu,staticRenderFns:[]},void 0,Ku,void 0,!1,void 0,void 0,void 0),Yu={data:function(){return{maximumVideos:0,oTranslation:WILCITY_I18,maximumVideos:null,oPlanSettings:void 0!==this.$store&&void 0!==this.$store.getters.getPlanSettings?this.$store.getters.getPlanSettings:{},aAddedVideos:void 0!==this.settings.value&&this.settings.value.length?this.settings.value:[{src:"",thumbnail:""}],toggle:"enable"}},props:["settings"],computed:{wrapperClass:function(){return{disable:void 0!==this.oPlanSettings["toggle_"+this.settings.key]&&"disable"==this.oPlanSettings["toggle_"+this.settings.key]}},addMoreBtnClass:function(){return{"wil-btn input-upload mb-5 wil-btn--gray wil-btn--round wil-btn--xs":!0,disable:0!=this.maximumVideos&&this.aAddedVideos.length>=this.maximumVideos}},warning:function(){return 0==this.maximumVideos||isNaN(this.maximumVideos)?"":this.oTranslation.maximumVideosWarning.replace("%s",this.maximumVideos)}},methods:{updatingVideoUrl:function(){this.settings.value=this.aAddedVideos,this.$emit("videoChanged",this.aAddedVideos,this.settings)},wrapperFieldItemClass:function(e){return e.length?"field_module__1H6kT field_style2__2Znhe mb-15 active":"field_module__1H6kT field_style2__2Znhe mb-15"},setupConfiguration:function(){null!==this.oPlanSettings&&(this.maximumVideos=parseInt(this.oPlanSettings.maximumVideos,10),this.toggle=this.oPlanSettings.toggle_video)},checkValue:function(){""==this.settings.value&&(this.settings.value=[""]),this.aAddedVideos=this.settings.value,this.oPlanSettings=void 0!==this.settings.oPlanSettings?this.settings.oPlanSettings:this.oPlanSettings},deleteVideo:function(e){this.aAddedVideos.splice(e,1),this.updatingVideoUrl()},addMore:function(){if(0!=this.maximumVideos&&this.aAddedVideos.length>=this.maximumVideos)return!1;this.aAddedVideos.push({src:"",thumbnail:""})},updateDefault:function(e){this.aAddedVideos=e}},mounted:function(){this.setupConfiguration()}},zu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperClass},[e._l(e.aAddedVideos,function(t,i){return n("div",{staticClass:"field-has-close"},[n("div",{class:e.wrapperFieldItemClass(t.src)},[n("div",{staticClass:"field_wrap__Gv92k"},[e.settings.isRequired?n("div",{staticClass:"video-field"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.src,expression:"aItem.src"}],staticClass:"field_field__3U_Rt",attrs:{type:"text",required:""},domProps:{value:t.src},on:{keyup:e.updatingVideoUrl,input:function(n){n.target.composing||e.$set(t,"src",n.target.value)}}}),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.thumbnail,expression:"aItem.thumbnail"}],staticClass:"field_field__3U_Rt",attrs:{type:"hidden",required:""},domProps:{value:t.thumbnail},on:{input:function(n){n.target.composing||e.$set(t,"thumbnail",n.target.value)}}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.settings.placeholder))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})]):n("div",{staticClass:"video-field"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.src,expression:"aItem.src"}],staticClass:"field_field__3U_Rt",attrs:{type:"text"},domProps:{value:t.src},on:{keyup:e.updatingVideoUrl,input:function(n){n.target.composing||e.$set(t,"src",n.target.value)}}}),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.thumbnail,expression:"aItem.thumbnail"}],staticClass:"field_field__3U_Rt",attrs:{type:"hidden"},domProps:{value:t.thumbnail},on:{input:function(n){n.target.composing||e.$set(t,"thumbnail",n.target.value)}}}),e._v(" "),n("span",{staticClass:"field_label__2eCP7 text-ellipsis"},[e._v(e._s(e.settings.placeholder))]),e._v(" "),n("span",{staticClass:"bg-color-primary"})])])]),e._v(" "),0!=i?n("a",{staticClass:"wil-btn mb-15 wil-btn--gray wil-btn--round wil-btn--xs wil-btn--icon ",attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.deleteVideo(i)}}},[n("i",{staticClass:"la la-close"})]):e._e()])}),e._v(" "),n("a",{class:e.addMoreBtnClass,attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.addMore(t)}}},[n("i",{staticClass:"la la-plus"}),e._v(e._s(e.settings.addMoreBtnName))]),e._v(" "),n("p",{directives:[{name:"show",rawName:"v-show",value:""!=e.warning,expression:"warning!=''"}],staticClass:"field_message__3Z6FX color-quaternary"},[e._v(e._s(e.warning))])],2)};zu._withStripped=!0;var Xu={data:function(){return{oTranslation:WILCITY_I18,oPlanSettings:{},aImagesUploaded:[],aVideosAdded:[],addVideosMsg:"",addPhotosMsg:"",successMsg:"",isSending:"no",xhr:null}},components:{BlockLoading:G,WilokeMessage:R,WilokeVideo:A({render:zu,staticRenderFns:[]},void 0,Yu,void 0,!1,void 0,void 0,void 0),WilokeUploadImg:_u,WilokePopup:N},methods:{closePopup:function(){this.$store.dispatch("closePopup",{id:"wilcity-add-photos-videos-popup",status:"close"})},updatePlanSettings:function(e){!Object.values(this.oPlanSettings).length&&"undefined"!==e.data.oPlanSettings&&e.data.oPlanSettings&&(this.oPlanSettings=e.data.oPlanSettings)},loadPhotos:function(){var e=this;this.aImagesUploaded.length||fetch(WilCityHelpers.buildRestRequest("listings/"+WILOKE_INLINE_GLOBAL.postID+"/add-more-photos")).then(function(e){return e.json()}).then(function(t){WilCityHelpers.isRestError(t)?e.addVideosMsg=WilCityHelpers.getUserMessage(t):(void 0!==t.data.images&&(e.aImagesUploaded=t.data.images),e.updatePlanSettings(t),e.addPhotosMsg=t.data.msg)})},loadVideos:function(){var e=this;this.aVideosAdded.length||fetch(WilCityHelpers.buildRestRequest("listings/"+WILOKE_INLINE_GLOBAL.postID+"/add-more-videos")).then(function(e){return e.json()}).then(function(t){WilCityHelpers.isRestError(t)?e.addVideosMsg=WilCityHelpers.getUserMessage(t):(void 0!==t.data.videos&&(e.aVideosAdded=t.data.videos),e.$refs.updateAddedVideos.updateDefault(e.aVideosAdded),e.updatePlanSettings(t),e.addVideosMsg=t.data.msg)})},updatingGallery:function(e){this.aImagesUploaded=e},updatingVideos:function(e){this.aVideosAdded=e},submit:function(){var e=this;null!==this.xhr&&200!==this.xhr.status&&this.xhr.abort(),this.isSending="yes",this.xhr=jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{listingID:WILOKE_INLINE_GLOBAL.postID,action:"update_gallery_and_videos",videos:this.aVideosAdded,gallery:this.aImagesUploaded},success:function(t){e.successMsg=t.data.msg,e.isSending="no",setTimeout(function(){e.closePopup()},3e3)}})}},mounted:function(){this.loadVideos(),this.loadPhotos()}},Zu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("wiloke-popup",{attrs:{"popup-id":"wilcity-add-photos-videos-popup","popup-title":e.oTranslation.addPhotoVideoPopupTitle},on:{"on-close-popup":e.closePopup}},[n("block-loading",{attrs:{position:"pos-a-center","is-loading":e.isSending}}),e._v(" "),n("div",{attrs:{slot:"body"},slot:"body"},[n("wiloke-message",{directives:[{name:"show",rawName:"v-show",value:""!==e.successMsg,expression:"successMsg!==''"}],attrs:{status:"success",icon:"la la-bullhorn",msg:e.successMsg,"has-remove":"false"}}),e._v(" "),n("div",{staticClass:"promo-item_module__24ZhT"},[n("div",{staticClass:"promo-item_group__2ZJhC"},[n("h3",{staticClass:"promo-item_title__3hfHG",domProps:{innerHTML:e._s(e.oTranslation.uploadMultipleImagesTitle)}}),e._v(" "),n("p",{staticClass:"promo-item_description__2nc26",domProps:{innerHTML:e._s(e.oTranslation.uploadMultipleImagesDesc)}})])]),e._v(" "),n("div",[n("wiloke-upload-img",{attrs:{settings:{isMultiple:!0,value:e.aImagesUploaded,wrapperClassName:"field_module__1H6kT field_style2__2Znhe mb-15",oPlanSettings:e.oPlanSettings}},on:{uploadImgChanged:e.updatingGallery}})],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:""!=e.addPhotosMsg,expression:"addPhotosMsg!=''"}],staticClass:"mt-20 mb-20"},[n("p",{domProps:{innerHTML:e._s(e.addPhotosMsg)}})]),e._v(" "),n("div",{staticClass:"promo-item_module__24ZhT"},[n("div",{staticClass:"promo-item_group__2ZJhC"},[n("h3",{staticClass:"promo-item_title__3hfHG",domProps:{innerHTML:e._s(e.oTranslation.uploadVideosTitle)}}),e._v(" "),n("p",{staticClass:"promo-item_description__2nc26",domProps:{innerHTML:e._s(e.oTranslation.uploadVideosDesc)}})])]),e._v(" "),n("div",[n("wiloke-video",{ref:"updateAddedVideos",attrs:{settings:{addMoreBtnName:e.oTranslation.addVideoBtn,oPlanSettings:e.oPlanSettings,value:e.aVideosAdded}},on:{videoChanged:e.updatingVideos}})],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:""!=e.addVideosMsg,expression:"addVideosMsg!=''"}],staticClass:"mt-20 mb-20"},[n("p",{domProps:{innerHTML:e._s(e.addVideosMsg)}})])],1),e._v(" "),n("footer",{staticClass:"popup_footer__2pUrl clearfix",attrs:{slot:"footer"},slot:"footer"},[n("div",{staticClass:"popup_footerRight__qvdP6"},[n("button",{staticClass:"wil-btn wil-btn--gray wil-btn--sm wil-btn--round wilcity-close-popup",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.oTranslation.cancel)},on:{click:function(t){return t.preventDefault(),e.closePopup(t)}}}),e._v(" "),n("button",{staticClass:"wil-btn wil-btn--primary wil-btn--sm wil-btn--round",attrs:{type:"submit"},domProps:{innerHTML:e._s(e.oTranslation.submit)},on:{click:function(t){return t.preventDefault(),e.submit(t)}}})])])],1)};Zu._withStripped=!0;var Ju=A({render:Zu,staticRenderFns:[]},void 0,Xu,void 0,!1,void 0,void 0,void 0);Vue.config.devtools=!0;var ec=jQuery("body");jQuery.fn.setCursorPosition=function(e){var t=jQuery(this)[0];if(void 0!==t.setSelectionRange)t.setSelectionRange(e,e);else if(this.createTextRange){var n=t.createTextRange();n.collapse(!0),n.moveEnd("character",e),n.moveStart("character",e),n.select()}return this},window.WilCityHelpers=t,window.WilokeDirectBankTransfer=l,window.WilokePayPal=a,window.WilokeStripe=s,Vue.use(Vuex),window.WILCITY_VUEX=new Vuex.Store({state:{oPopupStatus:{"wilcity-coupon-popup":"close","wilcity-signin-popup":"close","wilcity-message-popup":"close","wilcity-claim-popup":"close","wilcity-add-photos-videos-popup":"close","wilcity-search-form-popup":"close","wilcity-delete-review-popup":"close","wilcity-report-popup":"close","write-a-review-popup":"close","wilcity-quick-search-form-popup":"close","wilcity-ask-delete-author-message-popup":"close","wilcity-ask-delete-single-message-popup":"close"},currentListingTab:"",defaultComponentOfRegisterLogin:"login",oSettingTabs:{currentTab:"general"},oNavTab:{current:"home"},oSingleGallery:{id:"",aImages:[]},oPopUpArgs:{"wilcity-signin-popup":{},"wilcity-report-popup":{},"wilcity-message-popup":{},"wilcity-claim-popup":{},"wilcity-add-photos-videos-popup":{},"wilcity-search-form-popup":{},"wilcity-delete-review-popup":{},"write-a-review-popup":{},"wilcity-review-info":{},"wilcity-coupon-popup":{}},oTemporaryCacheTerm:{},oReviewsInfo:{},compareTimeout:100,aRequireLoggedIn:["wilcity-add-photos-videos-popup","wilcity-message-popup"],aReviews:[],oSearchArgs:{},oDefaultSearchArgs:{},postType:"",isFocusRefresh:!1,maxPages:0,foundPosts:0,currentPage:1,postsPerPage:0,isFocusUpdateSelect2:!1,elMouseOn:null,isSearchAsIMoveTheMap:!1,aNewListings:[],oTermOptions:{},aNewBusinessHoursOptions:{cId:"",aHours:[]},aSingleClickedSection:{},aIcons:[],oSearchFields:{},oPlanSettings:"undefined"!=typeof WILCITY_ADDLISTING&&"undefined"!==WILCITY_ADDLISTING.aPlanSettings?WILCITY_ADDLISTING.aPlanSettings:{},aQuickSearchFormSuggestions:[],oTagsBelongsToCat:{},selectedCat:null,timeout:4e3,aSelect2Store:[],aCacheSearchArgs:{},eventTab:"upcoming",tab:"",aXHR:{},aListings:{},aAuthorsInfo:{},oReceiverProfile:{},fetching:"",authorMessageID:"",query:{},dashboardTimeout:0,messageDetailClass:"",oUserProfile:{display_name:"",avatar:""},firebaseUserID:"",oDeleteAuthorInfo:{},oDeleteSingleMessageInfo:{},oAddListingVal:{},oCheckboxVals:{},defaultPostType:WILOKE_GLOBAL.defaultPostType,defaultPostTypeExcerptEvent:WILOKE_GLOBAL.defaultPostTypeExcerptEvent,oChatWith:{},templateStyle:""},mutations:{updateChatWithProfile:function(e,t){e.oChatWith=t},updateSearchField:function(e,t){e.oSearchFields[t.postType]=t.aFields},updateSelect2Store:function(e,t){e.aSelect2Store.push(t)},cleanSelect2Store:function(e){e.aSelect2Store=[]},updateSingleClickedSection:function(e,t){e.aSingleClickedSection[t]="yes"},updateNewBusinessHours:function(e,t){e.aNewBusinessHoursOptions.cId=t.cId,e.aNewBusinessHoursOptions.aHours=t.aHours},updatePlanSettings:function(e,t){e.oPlanSettings.cId=t},setDefaultComponentOfRegisterLoginPopup:function(e,t){e.defaultComponentOfRegisterLogin=t},updateRegisterLoginPopupStatus:function(e,t){e.oPopupStatus["wilcity-signin-popup"]=t},setAskDeleteAuthorMessagePopup:function(e,t){e.oPopupStatus["wilcity-ask-delete-author-message-popup"]=t},setAskDeleteSingleMessagePopup:function(e,t){e.oPopupStatus["wilcity-ask-delete-single-message-popup"]=t},updatePopupArgs:function(e,t){e.oPopUpArgs[t.id],e.oPopUpArgs[t.id]=t.oArgs},updatePopupStatus:function(e,t){e.oPopupStatus[t.id],e.oPopupStatus[t.id]=t.status},updateCurrentSettingTab:function(e,t){e.oSettingTabs.currentTab=t},updateCurrentNavTab:function(e,t){e.oNavTab.current=t},updateSingleGallery:function(e,t){e.oSingleGallery.id=t.id,e.oSingleGallery.aImages=e.oSingleGallery.aImages.concat(t.aImages)},updateReviews:function(e,t){t.isAddToFirst?e.aReviews=t.oReviews.concat(e.aReviews):e.aReviews=e.aReviews.concat(t.oReviews)},updatePinReviewToTop:function(e,t){var n=e.aReviews[t];n.isPintToTop="yes",e.aReviews.splice(t,1),e.aReviews.splice(0,0,n)},updateCompareTimeout:function(){},updateNewListings:function(e,t){e.aNewListings=t},updateOSearchArgs:function(e,t){e.oSearchArgs=t,""!==e.postType&&void 0===e.oDefaultSearchArgs[e.postType]&&(e.oDefaultSearchArgs[e.postType]=t)},updateDefaultSearchFormArgs:function(e,t){void 0!==e.oDefaultSearchArgs[t]&&(e.oSearchArgs[t]=e.oDefaultSearchArgs[t])},updatePostType:function(e,t){e.postType=t},updateTotalListings:function(e,t){e.foundPosts=parseInt(t,10)},updateCurrentPage:function(e,t){e.currentPage=parseInt(t,10)},updateMaxPages:function(e,t){e.maxPages=parseInt(t,10)},updatePostsPerPage:function(e,t){e.postsPerPage=parseInt(t,10)},updateMouseOn:function(e,t){e.elMouseOn=t},updateReviewInfo:function(e,t){e.oReviewsInfo=t},updateCurrentListingTab:function(e,t){e.currentListingTab=t},updateIcons:function(e,t){e.aIcons=t},updateHeroSearchForm:function(e,t){if("undefined"==typeof localStorage)return!1;localStorage.setItem("wilcity_hero_search_form",JSON.stringify(t.oSettings)),localStorage.setItem("wilcity_hero_search_form_version",t.version)},updateTagsBelongsToCat:function(e,t){e.oTagsBelongsToCat[e.selectedCat]=t},updateSelectedCat:function(e,t){e.selectedCat=t},updateDefaultType:function(e,t){e.type=t},updateSearchFields:function(e,t){localStorage.removeItem(t.key+"_at"),localStorage.removeItem(t.key),localStorage.setItem(t.key,JSON.stringify(t.fields)),localStorage.setItem(t.key+"_at",t.at)},updateTermOptions:function(e,t){localStorage.removeItem(t.key+"_at"),localStorage.removeItem(t.key),localStorage.setItem(t.key,JSON.stringify(t.terms)),localStorage.setItem(t.key+"_at",t.at)},updateTimeout:function(e,t){t=void 0===t?1e3:t,e.timeout=e.timeout+t},isFocusUpdateSelect2:function(e,t){e.isFocusUpdateSelect2=t},updateSearchArgsOfPostType:function(e,t){e.aCacheSearchArgs[t.postType]=t.oArgs},activateMessageDetail:function(e,t){e.messageDetailClass=t?"active":""},setEventTab:function(e,t){e.eventTab=t},setAuthorMessageID:function(e,t){e.authorMessageID=t},setTab:function(e,t){e.tab=t},setQuery:function(e,t){e.query=t},setListings:function(e,t){e.aListings[t.postType]=t.listings},setAuthorInfo:function(e,t){e.aAuthorsInfo=t},updateSetTimeout:function(e,t){e.dashboardTimeout=e.dashboardTimeout+100},updateUserProfile:function(e,t){e.oUserProfile=t},updateReceiverProfile:function(e,t){e.oReceiverProfile=t},setDeleteAuthorInfo:function(e,t){e.oDeleteAuthorInfo=t},setDeleteSingleMessageInfo:function(e,t){e.oDeleteSingleMessageInfo=t},setAddListingVal:function(e,t){e.oAddListingVal[t.key]=t.val},setUserFirebaseUserID:function(e,t){e.firebaseUserID=t},setCheckboxVal:function(e,t){e.oCheckboxVals[t.key]=t.value},updateTemplateStyle:function(e,t){e.templateStyle=t},updateFocusRefresh:function(e,t){e.isFocusRefresh=t}},getters:{getTemplateStyle:function(e){return e.templateStyle},getIsFocusRefresh:function(e){return e.isFocusRefresh},getCheckboxVal:function(e){return function(t){return void 0!==e.oCheckboxVals[t]&&e.oCheckboxVals[t]}},getChatWithProfile:function(e){return e.oChatWith},getUserFirebaseUserID:function(e){return e.firebaseUserID},getDefaultPostType:function(e){return e.defaultPostType},defaultPostTypeExcerptEvent:function(e){return e.defaultPostTypeExcerptEvent},getAddListingVal:function(e){return function(t){return void 0!==e.oAddListingVal[t]&&e.oAddListingVal[t]}},getDeleteAuthorInfo:function(e){return e.oDeleteAuthorInfo},getDeleteSingleMessageInfo:function(e){return e.oDeleteSingleMessageInfo},getSearchArgsOfPostType:function(e){return function(t){return void 0!==e.aCacheSearchArgs[t]&&e.aCacheSearchArgs[t]}},isFocusUpdateSelect2:function(e){return e.isFocusUpdateSelect2},getTimeout:function(e){return e.timeout},getTermOptions:function(e){return function(e){var t=localStorage.getItem(e);if(null===t||"undefined"===t)return!1;var n=localStorage.getItem(e+"_at");return{terms:JSON.parse(t),at:n}}},getSearchFormFields:function(e){return function(e){var t=localStorage.getItem(e);if(null===t||void 0===t)return!1;var n=localStorage.getItem(e+"_at");return{fields:JSON.parse(t),at:n}}},getDefaultType:function(e){return e.type},getSelectedCat:function(e){return e.selectedCat},getTagsBelongsToCat:function(e){return function(t){var n=null;return null!==(n=void 0!==t&&null!==t?t:e.selectedCat)&&(void 0!==e.oTagsBelongsToCat[n]&&e.oTagsBelongsToCat[n])}},getDefaultSearchFormArgs:function(e){return function(t){return void 0!==e.oDefaultSearchArgs[t]?e.oDefaultSearchArgs[t]:{}}},getFoundPosts:function(e){return e.foundPosts},getSearchFields:function(e){return function(t){return void 0!==e.oSearchFields[t]&&e.oSearchFields[t]}},getNewListings:function(e){return e.aNewListings},getTotalListings:function(e){return e.foundPosts},getCurrentPage:function(e){return e.currentPage},getMaxPages:function(e){return e.maxPages},getSearchArgs:function(e){return e.oSearchArgs},getPostType:function(e){return e.postType},getPostsPerPage:function(e){return e.postsPerPage},getIsSearchAsIMoveTheMap:function(e){return e.isSearchAsIMoveTheMap},getDefaultComponentOfRegisterLogin:function(e){return e.defaultComponentOfRegisterLogin},getPopupStatus:function(e){return function(t){return void 0!==t?e.oPopupStatus[t]:e.oPopupStatus}},getPopupArgs:function(e){return function(t){return void 0!==e.oPopUpArgs[t]&&e.oPopUpArgs[t]}},getCurrentSettingTab:function(e){return e.oSettingTabs.currentTab},getCurrentNavTab:function(e){return e.oNavTab.current},getSingleGallery:function(e){return e.oSingleGallery.aImages},getReviews:function(e){return e.aReviews},changedBusinessHoursOptions:function(e){return e.aBusinessHoursOptions.aHours},getPlanSettings:function(e){return e.oPlanSettings},getReviewInfo:function(e){return!!Object.values(e.oReviewsInfo).length&&e.oReviewsInfo},getCurrentListingTab:function(e){return e.currentListingTab},getIcons:function(e){return!!e.aIcons.length&&e.aIcons},getSingleClickedSection:function(e){return function(t){return void 0!==e.aSingleClickedSection[t]}},getHeroSearchFormSettings:function(){if("undefined"==typeof localStorage)return!1;var e=localStorage.getItem("wilcity_hero_search_form");if(e){var t=localStorage.getItem("wilcity_hero_search_form_version");return null!==t&&void 0!==t&&{version:t,oSettings:JSON.parse(e)}}return!1},getSelect2Store:function(e){return e.aSelect2Store},getMessageDetailClass:function(e){return e.messageDetailClass},getAuthorInfo:function(e){return e.aAuthorsInfo[e.authorMessageID]},getEventTab:function(e){return e.eventTab},getTab:function(e){return e.tab},getQuery:function(e){return e.query},getListings:function(e){return e.aListings},getSetTimeout:function(e){return parseInt(e.timeout,10)},getUserProfile:function(e){return function(t){return e.oUserProfile[t]}},getReceiverProfile:function(e){return e.oReceiverProfile}},actions:{setAskDeleteAuthorMessagePopupToOpen:function(e){e.commit("setAskDeleteAuthorMessagePopup","open")},setAskDeleteSingleMessagePopup:function(e){e.commit("setAskDeleteSingleMessagePopup","open")},updateHeroSearchForm:function(e,t){e.commit("updateHeroSearchForm",t)},openRegisterLoginPopup:function(e){e.commit("updateRegisterLoginPopupStatus","open")},setRegisterAsDefaultComponentOfRegisterLoginPopup:function(e){e.commit("setDefaultComponentOfRegisterLoginPopup","register")},setLoginAsDefaultComponentOfRegisterLoginPopup:function(e){e.commit("setDefaultComponentOfRegisterLoginPopup","login")},setLostPasswordAsDefaultComponentOfRegisterLoginPopup:function(e){e.commit("setDefaultComponentOfRegisterLoginPopup","lost-password")},closeRegisterLoginPopup:function(e){e.commit("updateRegisterLoginPopupStatus","close")},closePopup:function(e,t){e.commit("updatePopupStatus",t)},openSearchFormPopup:function(e){e.commit("updatePopupStatus",{id:"wilcity-search-form-popup",status:"open"})},closeSearchFormPopup:function(e){e.commit("updatePopupStatus",{id:"wilcity-search-form-popup",status:"close"})},openQuickSearchFormPopup:function(e){e.commit("updatePopupStatus",{id:"wilcity-quick-search-form-popup",status:"open"})}}}),document.getElementById("wilcity-author-listing")&&(WILOKE_GLOBAL.vmAuthorListing=new Vue({el:"#wilcity-author-listing",store:WILCITY_VUEX,methods:{openMessagePopup:function(){"yes"!==WILOKE_INLINE_GLOBAL.isUserLoggedIn?this.$store.commit("updatePopupStatus",{id:"wilcity-signin-popup",status:"open"}):this.$store.commit("updatePopupStatus",{id:"wilcity-message-popup",status:"open"})}}})),document.getElementById("wilcity-hero-search-form")&&(WILOKE_GLOBAL.vmAuthorListing=new Vue({store:WILCITY_VUEX,data:function(){return{isRequestedForm:!1,latLng:"",address:"",type:"listing",searchUrl:"",isFormLoaded:!1}},el:"#wilcity-hero-search-form",components:{WilokeAutoComplete:ee,WilokeSelectTwo:se,WilokeHeroSearchForm:Ve,WilokeSwitchPostTypeBtn:Ge},mounted:function(){this.formLoaded(),this.type=this.$el.getAttribute("default-type")},methods:{updateGeocode:function(e){""===e?(this.latLng="",this.address=""):(this.latLng=e.lat+","+e.lng,this.address=e.address)},formLoaded:function(){var e=this;this.$on("formLoaded",function(t){e.isFormLoaded=t})},switchPostType:function(e){this.type=e,this.$emit("switched-tab",this.type)},onSubmit:function(e){if(this.isRequestedForm)return!0;var t=document.getElementById(e);for(var n in this.$refs){var i=document.createElement("input");if(i.setAttribute("type","hidden"),"latLng"===this.$refs[n].settings.name){if(""!==this.latLng){i.setAttribute("name","latLng"),i.setAttribute("value",this.latLng);var r=document.createElement("input");r.setAttribute("name","address"),r.setAttribute("value",this.address),t.appendChild(r)}}else void 0!==this.$refs[n].settings.value&&""!==this.$refs[n].settings.value&&(i.setAttribute("name",this.$refs[n].settings.name),i.setAttribute("value",this.$refs[n].settings.value));t.appendChild(i)}this.isRequestedForm=!0,t.submit()}}})),document.getElementById("wilcity-wrapper-all-popup")&&(WILOKE_GLOBAL.vmWrapperAllPopup=new Vue({el:"#wilcity-wrapper-all-popup",store:WILCITY_VUEX,components:{LoginRegisterPopup:ou,WilokeMessagePopup:j,WilokeClaimPopup:Mu,WilokeReportPopup:Qu,WilokeDeleteReviewPopup:Uu,WilokeAskForDeleteAuthorMessagePopup:Vu,WilokeAskForDeleteSingleMessagePopup:Gu,WilokeSearchFormPopup:Ue,WilokeAddPhotosVideos:Ju,WilokeReviewPopup:ku,BlockLoading:G,WilokeCouponPopup:X},data:function(){return{ajaxSearch:null,s:"",aTemporaryCache:[],aResults:[],oListings:{},isSearching:"no",aTerms:[],isNotFound:!1}},methods:{setResults:function(e){"term"===e.type?(this.aTerms=e.aResults,this.oListings=[]):(this.oListings=e.aResults,this.aTerms=[]),Object.values(this.oListings).length||this.aTerms.length||(this.isNotFound=!0)},closePopup:function(){jQuery(".wilcity-close-popup").on("click",function(e){e.preventDefault();var t=jQuery(e.currentTarget).data("popup-id");jQuery("#"+t).removeClass("active"),jQuery("body").removeClass("popup-active")})},abortSearch:function(){null!==this.ajaxSearch&&200!==this.ajaxSearch.status&&this.ajaxSearch.abort()},searchResults:function(){var e=this;if(this.isSearching="yes",this.abortSearch(),void 0!==this.aTemporaryCache[this.s])return this.aResults=this.aTemporaryCache[this.s],this.setResults(this.aResults),this.isSearching="no",!0;this.ajaxSearch=jQuery.ajax({url:WILOKE_GLOBAL.ajaxurl,type:"POST",data:{action:"wilcity_search_by_ajax",s:this.s},success:function(t){t.success?e.setResults(t.data):(e.oListings={},e.aTerms=[],e.isNotFound=!0),e.aTemporaryCache[e.s]=t.data,e.isSearching="no"}})}},mounted:function(){this.closePopup()}})),document.getElementById("wilcity-quick-notifications")&&(WILOKE_GLOBAL.vmWrapperAllPopup=new Vue({el:"#wilcity-quick-notifications",store:WILCITY_VUEX,components:{QuickNotifications:Ye}})),document.getElementById("wilcity-message-notifications")&&(WILOKE_GLOBAL.vmWrapperAllPopup=new Vue({el:"#wilcity-message-notifications",store:WILCITY_VUEX,components:{MessageNotifications:Ul}})),document.getElementById("wilcity-login-register-controller")&&(WILOKE_GLOBAL.vmRegisterLoginController=new Vue({el:"#wilcity-login-register-controller",store:WILCITY_VUEX,methods:{listenjQuery:function(){var e=this;jQuery("body").on("onOpenLoginRegisterPopup",function(t,n){"register"===n?e.$store.dispatch("setRegisterAsDefaultComponentOfRegisterLoginPopup"):e.$store.dispatch("setLoginAsDefaultComponentOfRegisterLoginPopup"),e.$store.dispatch("openRegisterLoginPopup")})}},mounted:function(){this.listenjQuery()},components:{RegisterBtn:hu,LoginBtn:lu}}),jQuery(".wilcity-trigger-login-button").on("click",function(e){e.preventDefault(),jQuery("body").trigger("onOpenLoginRegisterPopup",["login"])}),jQuery(".wilcity-trigger-register-button").on("click",function(e){e.preventDefault(),jQuery("body").trigger("onOpenLoginRegisterPopup",["register"])})),document.getElementById("wilcity-become-an-author")&&(WILOKE_GLOBAL.vmBecomeAnAuthor=new Vue({el:"#wilcity-become-an-author",data:function(){return{agreeToTerms:"no",agreeToPrivacyPolicy:"no",isSubmitting:!1,isDisableBtn:!1,isConfirmed:!1}},computed:{btnClass:function(){return{disable:"yes"!==this.agreeToTerms||"yes"!==this.agreeToPrivacyPolicy||this.isDisableBtn,"wil-btn--loading":this.isSubmitting}}},methods:{submitBecomeAnAuthor:function(){var e=this;this.isDisableBtn=!1,this.isSubmitting=!0,jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_agree_become_to_author",agreeToTerms:this.agreeToTerms,agreeToPrivacyPolicy:this.agreeToPrivacyPolicy},success:function(t){t.success?(e.isConfirmed=!0,WilCityHelpers.isMobile()&&jQuery("html, body").stop().animate({scrollTop:0},500,"swing")):alert(t.data.msg);e.isSubmitting=!1}})}}}));var tc=document.querySelectorAll(".wilcity-grid-nearbyme");tc&&(void 0===WILOKE_GLOBAL.vmNearByMe&&(WILOKE_GLOBAL.vmNearByMe={}),[].forEach.call(tc,function(e){WILOKE_GLOBAL.vmNearByMe.listing=new Vue({el:"#"+e.id,store:WILCITY_VUEX,components:{WilokeListingsNearByMe:Q}})})),document.getElementById("wilcity-profile-nav-menu")&&(WILOKE_GLOBAL.vmProfileNavMenu=new Vue({el:"#wilcity-profile-nav-menu",data:function(){return{isShowing:!1,isLoadedCheckUnFocusClick:!1}},computed:{wrapperClass:function(){return this.isShowing?"active":""},aCssClass:function(){return this.isShowing?"header_loginItem__oVsmv account active":"header_loginItem__oVsmv account"}},methods:{toggleProfileMenu:function(){this.isLoadedCheckUnFocusClick||(this.hideWhenOurClick(),this.isLoadedCheckUnFocusClick=!0),this.isShowing=!this.isShowing},navWrapperClass:function(){return"dashboard-nav_item__2798B"},hideWhenOurClick:function(){var e=this;jQuery(document).on("click",function(t){e.isShowing&&(jQuery(t.target).closest("#wilcity-profile-nav-menu").length||(e.isShowing=!1))})}},mounted:function(){this.$el.style.display="inline-block"}})),jQuery(document).ready(function(t){var r,o;new Ke,jQuery(".comment-review_btn__32CMP").each(function(){jQuery(this).children().length||jQuery(this).closest("footer.comment-review_footer__3XR0_").remove()}),(r=jQuery(".wilcity-remove-if-no-child")).length&&r.each(function(){jQuery(this).children().length||jQuery(this).remove()}),new s(jQuery("#wilcity-proceed-with-stripe")).pay(),new a(jQuery("#wilcity-proceed-with-paypal")).pay(),new l(jQuery("#wilcity-proceed-with-banktransfer")).pay(),new u,jQuery(".wilcity-gateway-box").removeClass("disable"),o=jQuery(".wilcity-js-toggle-group"),jQuery("#wilcity-single-listing-content").on("click",".js-detail-navtop .list_link__2rDA1",function(e){e.preventDefault();var t=jQuery(e.currentTarget).parent(),n=t.data("tabKey");t.siblings().removeClass("active"),t.addClass("active"),o.addClass("hidden"),o.removeClass("active"),jQuery('.wilcity-js-toggle-group[data-tab-key="'+n+'"]').addClass("active").removeClass("hidden")}),e(),jQuery("#wilcity-addlisting-form").find(".content-box_module__333d9").each(function(){1===jQuery(this).find(".group-required").length&&jQuery(this).find(".content-box_title__1gBHS").addClass("required")}),jQuery(".wil-tab__nav, .vc_tta-tab").on("click","a",function(t){var n=jQuery(t.target).attr("href");jQuery(n).data("calculatedHeight")||(e(jQuery(n).find(".wilcity-grid")),jQuery(n).data("calculatedHeight",!0))}),function(){if(WilCityHelpers.isMobile()){var e=jQuery(".wilcity-become-an-author");e.length&&e.find(".la-user").attr("class","la la-plus-circle")}}(),jQuery(document.body).on("removed_from_cart",function(e,t,n,i){var r=jQuery(".wilcity-total-cart-item"),o=r.html();o=parseInt(o);var s=i.data("quantity");r.html(o-s)});var h=t("#wilcity-print-msg");h.on("printErrMsg",function(e,t){h.find(".alert_content__1ntU3").html(t),h.removeClass("hidden")}),new c(t("#wilcity-pay-and-publish"));var d,p,f=t("#wilcity-line-loading");ec.on("topLoading",function(){f.removeClass("hidden")}),ec.on("topHideLoading",function(){f.addClass("hidden")}),(d=jQuery("#wilcity-submit")).removeClass("disable"),d.on("click",function(e){e.preventDefault();var t=jQuery(e.currentTarget);t.addClass("wil-btn--loading disable"),t.find(".pill-loading_module__3LZ6v").removeClass("hidden");var n="wilcity_handle_submit_";"event"===WILCITY_ADDLISTING.listingType?n+="event":n+="listing",jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:n},success:function(e){e.success?window.location.href=e.data.redirectTo:alert(e.data.msg),t.removeClass("wil-btn--loading disable"),t.find(".pill-loading_module__3LZ6v").addClass("hidden")}})}),t(".js-video-popup").each(function(){t(this).magnificPopup({fixedContentPos:!0,gallery:{enabled:!0},type:"iframe"})}),t(".wilcity-pagination").each(function(){var e=t(this),i=new n(e,e.data("totals"),e.data("postsPerPage"),e.data("maxPages"));e.html(i.createPagination()),i.ajaxLoading(),i.resetPagination()}),t("body").on("paginationLoaded",function(e,n,i){document.getElementById(i).innerHTML=n.data.msg;var r=t("#"+i);r.find(".wilcity-preview-gallery").each(function(){t(this).wilcityMagnificGalleryPopup()}),r.find(".wilcity-js-favorite").each(function(){t(this).wilcityFavoriteStatistic()})}),new i,t(".wilcity-copy").on("click",function(e){e.preventDefault();var n=t(this).data("target");if(void 0===n)return!1;var i=document.getElementById(n);i.setAttribute("type","text"),i.select(),document.execCommand("copy"),i.setAttribute("type","hidden"),t(this).html(WILCITY_I18.copied),window.getSelection().removeAllRanges()}),t(".wilcity-share-on-facebook").on("click",function(e){e.preventDefault();var n=t(this).data("content"),i=t(this).data("url");"undefined"!=typeof FB?FB.ui({method:"share",title:n.title+"?og:image="+n.img,href:i,picture:n.img,quote:n.quote}):window.open("//facebook.com/sharer.php?u="+encodeURI(i)+"&t="+encodeURI(n.title)+"&summary=dadad&thumbnail="+encodeURI(n.img))}),t(".wil-js-send-confirmation-code").on("click",function(e){e.preventDefault();var n=t(e.target),i=n.parent();n.html(WILCITY_I18.sending),jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_send_confirmation_code"},success:function(e){i.html(e.data.msg)}})}),(p=jQuery(".wpb_wrapper")).length&&p.each(function(){t(this).children().length||t(this).closest(".vc_row").remove()}),setTimeout(function(){jQuery(".temporary-disable").removeClass("temporary-disable")},300)}),jQuery(window).load(function(){!function(){if("undefined"==typeof WILCITY_GLOBAL)return!1;setTimeout(function(){if(!jQuery("body.single").length)return!1;jQuery.ajax({type:"POST",url:WILOKE_GLOBAL.ajaxurl,data:{action:"wilcity_count_views",postID:WILOKE_INLINE_GLOBAL.postID}})},2e3)}(),jQuery(".temporary-hidden").removeClass("temporary-hidden"),function(){var e=WilCityHelpers.getParamFromUrl("tab");if(e&&"home"!==e)return!1;var t=WilCityHelpers.getParamFromUrl("st");if(!t)return!1;var n=jQuery("#"+t);if(!n.length){var i="."+t;jQuery(i).length&&(n=jQuery(i).first())}n.length&&jQuery("html, body").animate({scrollTop:n.offset().top-100},1e3)}()})}();
[+]
..
[-] vendors~WilAddToCalendar~WilFieldsGroup~WilSearchFormV1.0.js
[edit]
[-] review.min.js
[edit]
[-] 30.min.js
[edit]
[-] WilDateRange.WilDateRange.js
[edit]
[-] 70.min.js
[edit]
[-] 26.min.js
[edit]
[-] 14.14.js
[edit]
[-] map.min.js
[edit]
[-] 66.min.js
[edit]
[-] shortcodes.min.js
[edit]
[-] 91.min.js
[edit]
[-] 24.24.js
[edit]
[-] single-general.min.js
[edit]
[-] WilSingleNavPosts.WilSingleNavPosts.js
[edit]
[-] 51.min.js
[edit]
[-] 11.min.js
[edit]
[-] 2.min.js
[edit]
[-] WilSocialSharingFacebook.WilSocialSharingFacebook.js
[edit]
[-] WilSocialSharingVk.WilSocialSharingVk.js
[edit]
[-] 47.min.js
[edit]
[-] LoginForm.LoginForm.js
[edit]
[-] WilSocialSharingLinkedIn.WilSocialSharingLinkedIn.js
[edit]
[-] 87.min.js
[edit]
[-] vendors~WilMapbox.vendors~WilMapbox.js
[edit]
[-] vendors~UserProfile.vendors~UserProfile.js
[edit]
[-] no-map-search.min.js
[edit]
[-] SearchFormV2.min.js
[edit]
[-] 72.min.js
[edit]
[-] quick-search.min.js
[edit]
[-] WilReviewDiscussionForm.WilReviewDiscussionForm.js
[edit]
[-] .DS_Store
[edit]
[-] 32.min.js
[edit]
[-] 29.min.js
[edit]
[-] WilCheckoutPopup.WilCheckoutPopup.js
[edit]
[-] WilokeStripe.min.js
[edit]
[-] 69.min.js
[edit]
[-] WilAddToCalendar.WilAddToCalendar.js
[edit]
[-] 0.0.js
[edit]
[-] single-event.min.js
[edit]
[-] single-mapbox.min.js
[edit]
[-] WilSocialSharingCopy.WilSocialSharingCopy.js
[edit]
[-] 64.min.js
[edit]
[-] proceedPayment.min.js
[edit]
[-] 24.min.js
[edit]
[-] LoginRegisterPopup.LoginRegisterPopup.js
[edit]
[-] 25.25.js
[edit]
[-] addlisting.min.js
[edit]
[-] 88.min.js
[edit]
[-] 0.min.js
[edit]
[-] 13.min.js
[edit]
[-] 53.min.js
[edit]
[-] vendors~WilFieldsGroup.vendors~WilFieldsGroup.js
[edit]
[-] WilGrid.WilGrid.js
[edit]
[-] WilListingSettingsEditNavigation.WilListingSettingsEditNavigation.js
[edit]
[-] 48.min.js
[edit]
[-] WilBoxesIconItem.WilBoxesIconItem.js
[edit]
[-] WilToggleController.WilToggleController.js
[edit]
[-] WilListingSettingsGeneral.WilListingSettingsGeneral.js
[edit]
[-] 5.5.js
[edit]
[-] 15.15.js
[edit]
[-] WilGridCustomSelectField.WilGridCustomSelectField.js
[edit]
[-] 85.min.js
[edit]
[-] 45.min.js
[edit]
[-] WilPromotionListingStatistic.WilPromotionListingStatistic.js
[edit]
[-] 39.min.js
[edit]
[-] mapbox.min.js
[edit]
[-] 79.min.js
[edit]
[-] 62.min.js
[edit]
[-] WilSingleNavTerm.WilSingleNavTerm.js
[edit]
[-] 22.min.js
[edit]
[-] 74.min.js
[edit]
[-] 17.17.js
[edit]
[-] vendors~WilFieldsGroup~WilSearchFormList.vendors~WilFieldsGroup~WilSearchFormList.js
[edit]
[-] 4.4.js
[edit]
[-] resetPassword.min.js
[edit]
[-] WilReviewDetails.WilReviewDetails.js
[edit]
[-] 34.min.js
[edit]
[-] general.min.js
[edit]
[-] WilokeGoogleMap.min.js
[edit]
[-] WilGoogleMap.WilGoogleMap.js
[edit]
[-] WilIcon.WilIcon.js
[edit]
[-] LoginRegister.min.js
[edit]
[-] WilRestaurantMenuItem.WilRestaurantMenuItem.js
[edit]
[-] 58.min.js
[edit]
[-] 27.27.js
[edit]
[-] UserProfile.UserProfile.js
[edit]
[-] WilCouponPopup.WilCouponPopup.js
[edit]
[-] 18.min.js
[edit]
[-] 83.min.js
[edit]
[-] single-settings-sidebar.min.js
[edit]
[-] 1.1.js
[edit]
[-] single-google-map.min.js
[edit]
[-] 43.min.js
[edit]
[-] customLogin.min.js
[edit]
[-] LostPasswordForm.LostPasswordForm.js
[edit]
[-] 15.min.js
[edit]
[-] 6.min.js
[edit]
[-] 55.min.js
[edit]
[-] WilSingleNavWrapper.WilSingleNavWrapper.js
[edit]
[-] 20.min.js
[edit]
[-] 60.min.js
[edit]
[-] WilCouponListing.WilCouponListing.js
[edit]
[-] 30.30.js
[edit]
[-] WilSocialSharingPinterest.WilSocialSharingPinterest.js
[edit]
[-] 36.min.js
[edit]
[-] WilSingleNavMyProducts.WilSingleNavMyProducts.js
[edit]
[-] vendors~WilDateRange~WilFieldsGroup.vendors~WilDateRange~WilFieldsGroup.js
[edit]
[-] 26.26.js
[edit]
[-] WilSocialSharingTumblr.WilSocialSharingTumblr.js
[edit]
[-] single-listing.min.js
[edit]
[-] 76.min.js
[edit]
[-] activeListItem.min.js
[edit]
[-] 41.min.js
[edit]
[-] FavoriteStatistics.min.js
[edit]
[-] 81.min.js
[edit]
[-] 9.min.js
[edit]
[-] 16.16.js
[edit]
[-] WilListingSettings.WilListingSettings.js
[edit]
[-] WilFavorite.WilFavorite.js
[edit]
[-] 57.min.js
[edit]
[-] 4.min.js
[edit]
[-] 17.min.js
[edit]
[-] WilSocialSharingEmail.WilSocialSharingEmail.js
[edit]
[-] 54.min.js
[edit]
[-] WilokeDirectBankTransfer.min.js
[edit]
[-] dashboard.min.js
[edit]
[-] 7.min.js
[edit]
[-] 14.min.js
[edit]
[-] WilEventDate.WilEventDate.js
[edit]
[-] 28.28.js
[edit]
[-] 19.min.js
[edit]
[-] 82.min.js
[edit]
[-] 12.12.js
[edit]
[-] index.min.js
[edit]
[-] 59.min.js
[edit]
[-] 42.min.js
[edit]
[-] WilReviewAverageRating.WilReviewAverageRating.js
[edit]
[-] WilSocialSharingReddit.WilSocialSharingReddit.js
[edit]
[-] 35.min.js
[edit]
[-] 75.min.js
[edit]
[-] 22.22.js
[edit]
[-] 9.9.js
[edit]
[-] WilSocialSharingDigg.WilSocialSharingDigg.js
[edit]
[-] app.min.js
[edit]
[-] 78.min.js
[edit]
[-] 38.min.js
[edit]
[-] 23.min.js
[edit]
[-] 63.min.js
[edit]
[-] 18.18.js
[edit]
[-] 19.19.js
[edit]
[-] WilGridFeaturedImage.WilGridFeaturedImage.js
[edit]
[-] WilGridTerm.WilGridTerm.js
[edit]
[-] 16.min.js
[edit]
[-] 5.min.js
[edit]
[-] bundle.min.js
[edit]
[-] WilEventWeekly.WilEventWeekly.js
[edit]
[-] MagnificGalleryPopup.min.js
[edit]
[-] 56.min.js
[edit]
[-] WilBoxesColorItems.WilBoxesColorItems.js
[edit]
[-] RegisterForm.RegisterForm.js
[edit]
[-] WilSingleNavPhotos.WilSingleNavPhotos.js
[edit]
[-] 40.min.js
[edit]
[-] 3.3.js
[edit]
[-] 23.23.js
[edit]
[-] 80.min.js
[edit]
[-] vendors~WilGoogleMap.vendors~WilGoogleMap.js
[edit]
[-] 8.min.js
[edit]
[-] WilCountdown.WilCountdown.js
[edit]
[-] AppleLogin.AppleLogin.js
[edit]
[-] vendors~WilAddToCalendar~WilSearchFormV1.vendors~WilAddToCalendar~WilSearchFormV1.js
[edit]
[-] 6.6.js
[edit]
[-] 13.13.js
[edit]
[-] 77.min.js
[edit]
[-] 37.min.js
[edit]
[-] 29.29.js
[edit]
[-] 61.min.js
[edit]
[-] WilokePayPal.min.js
[edit]
[-] 21.min.js
[edit]
[-] WilFieldsGroup.WilFieldsGroup.js
[edit]
[-] WilMapbox.WilMapbox.js
[edit]
[-] WilReviewDiscussionItem.WilReviewDiscussionItem.js
[edit]
[-] 46.min.js
[edit]
[-] WilReviewDetail.WilReviewDetail.js
[edit]
[-] becomeAnAuthor.min.js
[edit]
[-] 86.min.js
[edit]
[-] WilSearchFormPriceRange.WilSearchFormPriceRange.js
[edit]
[-] WilGridAverageRating.WilGridAverageRating.js
[edit]
[-] 90.min.js
[edit]
[-] 11.11.js
[edit]
[-] WilSocialSharingTwitter.WilSocialSharingTwitter.js
[edit]
[-] 3.min.js
[edit]
[-] 10.min.js
[edit]
[-] 7.7.js
[edit]
[-] 50.min.js
[edit]
[-] 67.min.js
[edit]
[-] 2.2.js
[edit]
[-] WilListingSettingsSidebar.WilListingSettingsSidebar.js
[edit]
[-] 27.min.js
[edit]
[-] vendors~WilCountdown.vendors~WilCountdown.js
[edit]
[-] 21.21.js
[edit]
[-] HeroSearchForm.min.js
[edit]
[-] WilSingleNavCustomContent.WilSingleNavCustomContent.js
[edit]
[-] SocialsLogin.SocialsLogin.js
[edit]
[-] WilokeSubmissionCouponCode.min.js
[edit]
[-] Follow.min.js
[edit]
[-] default~WilGoogleMap~WilMapbox.default~WilGoogleMap~WilMapbox.js
[edit]
[-] WilMessageBtn.WilMessageBtn.js
[edit]
[-] WilReportPopup.WilReportPopup.js
[edit]
[-] WilGridSkeleton.WilGridSkeleton.js
[edit]
[-] WilMessagePopup.WilMessagePopup.js
[edit]
[-] WilSocialSharingStumbleupon.WilSocialSharingStumbleupon.js
[edit]
[-] 71.min.js
[edit]
[-] 31.min.js
[edit]
[-] vendors~VueGallerySlideshow.vendors~VueGallerySlideshow.js
[edit]
[-] 84.min.js
[edit]
[-] WilSearchFormV1.WilSearchFormV1.js
[edit]
[-] SearchFormV1.min.js
[edit]
[-] vendors~WilGoogleMap~WilMapbox.vendors~WilGoogleMap~WilMapbox.js
[edit]
[-] WilSearchFormList.WilSearchFormList.js
[edit]
[-] 44.min.js
[edit]
[-] WilLayoutSwitch.WilLayoutSwitch.js
[edit]
[-] WilSingleNavContent.WilSingleNavContent.js
[edit]
[-] WilSocialSharingWhatsapp.WilSocialSharingWhatsapp.js
[edit]
[-] WilGridItem.WilGridItem.js
[edit]
[-] 52.min.js
[edit]
[-] 89.min.js
[edit]
[-] 12.min.js
[edit]
[-] 1.min.js
[edit]
[-] 20.20.js
[edit]
[-] WilFavoriteBtn.WilFavoriteBtn.js
[edit]
[-] 92.min.js
[edit]
[-] WilSingleNavVideos.WilSingleNavVideos.js
[edit]
[-] WilCommentForm.WilCommentForm.js
[edit]
[-] 8.8.js
[edit]
[-] 49.min.js
[edit]
[-] WilPromotionBtn.WilPromotionBtn.js
[edit]
[-] WilSocialSharingLists.WilSocialSharingLists.js
[edit]
[-] WilSingleListProducts.WilSingleListProducts.js
[edit]
[-] googlemap.min.js
[edit]
[-] WilQuickSearchFormPopup.WilQuickSearchFormPopup.js
[edit]
[-] vendors~single-general.min.js
[edit]
[-] 10.10.js
[edit]
[-] 25.min.js
[edit]
[-] WilSingleProductTwo.WilSingleProductTwo.js
[edit]
[-] 65.min.js
[edit]
[-] RegisterLogin.RegisterLogin.js
[edit]
[-] 33.min.js
[edit]
[-] 73.min.js
[edit]
[-] vendors~WilSearchFormV1.vendors~WilSearchFormV1.js
[edit]
[-] 68.min.js
[edit]
[-] 28.min.js
[edit]