From b0d2e87cbe98d3b9f386fe07d1cc67835dfa6367 Mon Sep 17 00:00:00 2001 From: Jerome Grosdenier Date: Wed, 28 Sep 2016 15:23:52 +0200 Subject: [PATCH 1/4] Testing pages templates --- functions.php | 17 +- rest-theme/dist/build.js | 28058 ++++++++++++++++++++++++++++++++- rest-theme/src/main.js | 9 +- rest-theme/src/page-test.vue | 49 + 4 files changed, 28127 insertions(+), 6 deletions(-) create mode 100644 rest-theme/src/page-test.vue diff --git a/functions.php b/functions.php index 91ecbf7..c20090c 100644 --- a/functions.php +++ b/functions.php @@ -37,10 +37,25 @@ function rest_theme_routes() { 'id' => get_the_ID(), 'type' => get_post_type(), 'slug' => basename( get_permalink() ), + 'template' => get_page_template_slug( get_the_ID() ), ); } } wp_reset_postdata(); return $routes; -} \ No newline at end of file +} + +function attach_template_to_page( $page_name, $template_name ) { + + $page = get_page_by_title( $page_name, OBJECT, 'page' ); + $page_id = null == $page ? -1 : $page->ID; + + if( -1 != $page_id ) { + update_post_meta( $page_id, '_wp_page_template', $template_name ); + } + + return $page_id; +} + +attach_template_to_page( 'test', 'test' ); diff --git a/rest-theme/dist/build.js b/rest-theme/dist/build.js index 8884586..43c6c7d 100644 --- a/rest-theme/dist/build.js +++ b/rest-theme/dist/build.js @@ -1,4 +1,28054 @@ -!function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=200&&t.status<300,t})}},{"../../promise":17,"../../util":24,"./xhr":5}],3:[function(t,e,n){var i=t("../../util"),r=t("../../promise");e.exports=function(t){return new r(function(e){var n,r,o="_jsonp"+Math.random().toString(36).substr(2),s={request:t,data:null};t.params[t.jsonp]=o,t.cancel=function(){n({type:"cancel"})},r=document.createElement("script"),r.src=i.url(t),r.type="text/javascript",r.async=!0,window[o]=function(t){s.data=t},n=function(t){"load"===t.type&&null!==s.data?s.status=200:"error"===t.type?s.status=404:s.status=0,e(s),delete window[o],document.body.removeChild(r)},r.onload=n,r.onerror=n,document.body.appendChild(r)})}},{"../../promise":17,"../../util":24}],4:[function(t,e,n){var i=t("../../util"),r=t("../../promise");e.exports=function(t){return new r(function(e){var n,r=new XDomainRequest,o={request:t};t.cancel=function(){r.abort()},r.open(t.method,i.url(t),!0),n=function(t){o.data=r.responseText,o.status=r.status,o.statusText=r.statusText,e(o)},r.timeout=0,r.onload=n,r.onabort=n,r.onerror=n,r.ontimeout=function(){},r.onprogress=function(){},r.send(t.data)})}},{"../../promise":17,"../../util":24}],5:[function(t,e,n){var i=t("../../util"),r=t("../../promise");e.exports=function(t){return new r(function(e){var n,r=new XMLHttpRequest,o={request:t};t.cancel=function(){r.abort()},r.open(t.method,i.url(t),!0),n=function(t){o.data=r.responseText,o.status=r.status,o.statusText=r.statusText,o.headers=r.getAllResponseHeaders(),e(o)},r.timeout=0,r.onload=n,r.onabort=n,r.onerror=n,r.ontimeout=function(){},r.onprogress=function(){},i.isPlainObject(t.xhr)&&i.extend(r,t.xhr),i.isPlainObject(t.upload)&&i.extend(r.upload,t.upload),i.each(t.headers||{},function(t,e){r.setRequestHeader(e,t)}),r.send(t.data)})}},{"../../promise":17,"../../util":24}],6:[function(t,e,n){function i(t){var e=r.url.parse(r.url(t));return e.protocol!==a.protocol||e.host!==a.host}var r=t("../util"),o=t("./client/xdr"),s="withCredentials"in new XMLHttpRequest,a=r.url.parse(location.href);e.exports={request:function(t){return null===t.crossOrigin&&(t.crossOrigin=i(t)),t.crossOrigin&&(s||(t.client=o),t.emulateHTTP=!1),t}}},{"../util":24,"./client/xdr":4}],7:[function(t,e,n){var i=t("../util");e.exports={request:function(t){return t.method=t.method.toUpperCase(),t.headers=i.extend({},i.http.headers.common,t.crossOrigin?{}:i.http.headers.custom,i.http.headers[t.method.toLowerCase()],t.headers),i.isPlainObject(t.data)&&/^(GET|JSONP)$/i.test(t.method)&&(i.extend(t.params,t.data),delete t.data),t}}},{"../util":24}],8:[function(t,e,n){function i(t,e){var n,u,h=o;return i.interceptors.forEach(function(t){h=a(t,this.$vm)(h)},this),e=r.isObject(t)?t:r.extend({url:t},e),n=r.merge({},i.options,this.$options,e),u=h(n).bind(this.$vm).then(function(t){return t.ok?t:s.reject(t)},function(t){return t instanceof Error&&r.error(t),s.reject(t)}),n.success&&u.success(n.success),n.error&&u.error(n.error),u}var r=t("../util"),o=t("./client"),s=t("../promise"),a=t("./interceptor"),u={"Content-Type":"application/json"};i.options={method:"get",data:"",params:{},headers:{},xhr:null,upload:null,jsonp:"callback",beforeSend:null,crossOrigin:null,emulateHTTP:!1,emulateJSON:!1,timeout:0},i.interceptors=[t("./before"),t("./timeout"),t("./jsonp"),t("./method"),t("./mime"),t("./header"),t("./cors")],i.headers={put:u,post:u,patch:u,"delete":u,common:{Accept:"application/json, text/plain, */*"},custom:{"X-Requested-With":"XMLHttpRequest"}},["get","put","post","patch","delete","jsonp"].forEach(function(t){i[t]=function(e,n,i,o){return r.isFunction(n)&&(o=i,i=n,n=void 0),r.isObject(i)&&(o=i,i=void 0),this(e,r.extend({method:t,data:n,success:i},o))}}),e.exports=r.http=i},{"../promise":17,"../util":24,"./before":1,"./client":2,"./cors":6,"./header":7,"./interceptor":9,"./jsonp":10,"./method":11,"./mime":12,"./timeout":13}],9:[function(t,e,n){function i(t,e,n){var i=o.resolve(t);return arguments.length<2?i:i.then(e,n)}var r=t("../util"),o=t("../promise");e.exports=function(t,e){return function(n){return r.isFunction(t)&&(t=t.call(e,o)),function(o){return r.isFunction(t.request)&&(o=t.request.call(e,o)),i(o,function(o){return i(n(o),function(n){return r.isFunction(t.response)&&(n=t.response.call(e,n)),n})})}}}},{"../promise":17,"../util":24}],10:[function(t,e,n){var i=t("./client/jsonp");e.exports={request:function(t){return"JSONP"==t.method&&(t.client=i),t}}},{"./client/jsonp":3}],11:[function(t,e,n){e.exports={request:function(t){return t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers["X-HTTP-Method-Override"]=t.method,t.method="POST"),t}}},{}],12:[function(t,e,n){var i=t("../util");e.exports={request:function(t){return t.emulateJSON&&i.isPlainObject(t.data)&&(t.headers["Content-Type"]="application/x-www-form-urlencoded",t.data=i.url.params(t.data)),i.isObject(t.data)&&/FormData/i.test(t.data.toString())&&delete t.headers["Content-Type"],i.isPlainObject(t.data)&&(t.data=JSON.stringify(t.data)),t},response:function(t){try{t.data=JSON.parse(t.data)}catch(e){}return t}}},{"../util":24}],13:[function(t,e,n){e.exports=function(){var t;return{request:function(e){return e.timeout&&(t=setTimeout(function(){e.cancel()},e.timeout)),e},response:function(e){return clearTimeout(t),e}}}},{}],14:[function(t,e,n){function i(e){var n=t("./util");n.config=e.config,n.warning=e.util.warn,n.nextTick=e.util.nextTick,e.url=t("./url"),e.http=t("./http"),e.resource=t("./resource"),e.Promise=t("./promise"),Object.defineProperties(e.prototype,{$url:{get:function(){return n.options(e.url,this,this.$options.url)}},$http:{get:function(){return n.options(e.http,this,this.$options.http)}},$resource:{get:function(){return e.resource.bind(this)}},$promise:{get:function(){return function(t){return new e.Promise(t,this)}.bind(this)}}})}window.Vue&&Vue.use(i),e.exports=i},{"./http":8,"./promise":17,"./resource":18,"./url":19,"./util":24}],15:[function(t,e,n){function i(t){this.state=a,this.value=void 0,this.deferred=[];var e=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(n){e.reject(n)}}var r=t("../util"),o=0,s=1,a=2;i.reject=function(t){return new i(function(e,n){n(t)})},i.resolve=function(t){return new i(function(e,n){e(t)})},i.all=function(t){return new i(function(e,n){function r(n){return function(i){s[n]=i,o+=1,o===t.length&&e(s)}}var o=0,s=[];0===t.length&&e(s);for(var a=0;ar;r++)i+=t[r].path.length;e=e.substr(i);var s={path:e,handler:n};t.push(s)}function r(t,e,n,o){var s=e.routes;for(var a in s)if(s.hasOwnProperty(a)){var u=t.slice();i(u,a,s[a]),e.children[a]?r(u,e.children[a],n,o):n.call(o,u)}}function o(t,i){var o=new e;t(n("",o,this.delegate)),r([],o,function(t){i?i(this,t):this.add(t)},this)}function s(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){this.string=t}function u(t){this.name=t}function h(t){this.name=t}function c(){}function l(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var i=t.split("/"),r=[];n.val="";for(var o=0,s=i.length;s>o;o++){var l,f=i[o];(l=f.match(/^:([^\/]+)$/))?(r.push(new u(l[1])),e.push(l[1]),n.val+="3"):(l=f.match(/^\*([^\/]+)$/))?(r.push(new h(l[1])),n.val+="2",e.push(l[1])):""===f?(r.push(new c),n.val+="1"):(r.push(new a(f)),n.val+="4")}return n.val=+n.val,r}function f(t){this.charSpec=t,this.nextStates=[]}function p(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function d(t,e){for(var n=[],i=0,r=t.length;r>i;i++){var o=t[i];n=n.concat(o.match(e))}return n}function v(t){this.queryParams=t||{}}function m(t,e,n){for(var i=t.handlers,r=t.regex,o=e.match(r),s=1,a=new v(n),u=0,h=i.length;h>u;u++){for(var c=i[u],l=c.names,f={},p=0,d=l.length;d>p;p++)f[l[p]]=o[s++];a.push({handler:c.handler,params:f,isDynamic:!!l.length})}return a}function g(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function y(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}function _(t){window.console&&(console.warn("[vue-router] "+t),(!W.Vue||W.Vue.config.debug)&&console.warn(new Error("warning stack trace:").stack))}function b(t,e,n){var i=t.match(/(\?.*)$/);if(i&&(i=i[1],t=t.slice(0,-i.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");n&&r[r.length-1]||r.pop();for(var o=e.replace(/^\//,"").split("/"),s=0;s can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this);for(var e=void 0,i=this.vm;i;){if(i._routerView){e=i._routerView;break}i=i.$parent}if(e)this.parentView=e,e.childView=this;else{var r=t.router;r._rootView=this}var o=t.router._currentTransition;if(!e&&o.done||e&&e.activated){var s=e?e.depth+1:0;j(this,o,s)}},unbind:function(){this.parentView&&(this.parentView.childView=null),n.unbind.call(this)}}),t.elementDirective("router-view",i)}function H(t){function e(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port}var n=t.util,i=n.bind,r=n.isObject,o=n.addClass,s=n.removeClass;t.directive("link-active",{priority:1001,bind:function(){this.el.__v_link_active=!0}}),t.directive("link",{priority:1e3,bind:function(){var t=this.vm;if(!t.$route)return void _("v-link can only be used inside a router-enabled app.");this.router=t.$route.router,this.unwatch=t.$watch("$route",i(this.onRouteUpdate,this)),this.activeEl=this.el;for(var e=this.el.parentNode;e;){if(e.__v_link_active){this.activeEl=e;break}e=e.parentNode}("A"!==this.el.tagName||"_blank"!==this.el.getAttribute("target"))&&this.el.addEventListener("click",i(this.onClick,this))},update:function(t){this.target=t,r(t)&&(this.append=t.append,this.exact=t.exact,this.prevActiveClass=this.activeClass,this.activeClass=t.activeClass),this.onRouteUpdate(this.vm.$route)},onClick:function(t){if(!(t.metaKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||0!==t.button)){var n=this.target;if(n)t.preventDefault(),this.router.go(n);else{for(var i=t.target;"A"!==i.tagName&&i!==this.el;)i=i.parentNode;"A"===i.tagName&&e(i)&&(t.preventDefault(),this.router.go({path:i.pathname,replace:n&&n.replace,append:n&&n.append}))}}},onRouteUpdate:function(t){var e=this.router._stringifyPath(this.target);this.path!==e&&(this.path=e,this.updateActiveMatch(),this.updateHref()),this.updateClasses(t.path)},updateActiveMatch:function(){this.activeRE=this.path&&!this.exact?new RegExp("^"+this.path.replace(/\/$/,"").replace(it,"").replace(nt,"\\$&")+"(\\/|$)"):null},updateHref:function(){if("A"===this.el.tagName){var t=this.path,e=this.router,n="/"===t.charAt(0),i=t&&("hash"===e.mode||n)?e.history.formatPath(t,this.append):t;i?this.el.href=i:this.el.removeAttribute("href")}},updateClasses:function(t){var e=this.activeEl,n=this.activeClass||this.router._linkActiveClass;this.prevActiveClass!==n&&s(e,this.prevActiveClass);var i=this.path.replace(it,"");t=t.replace(it,""),this.exact?i===t||"/"!==i.charAt(i.length-1)&&i===t.replace(et,"")?o(e,n):s(e,n):this.activeRE&&this.activeRE.test(t)?o(e,n):s(e,n)},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})}function M(t,e){var n=e.component;ot.util.isPlainObject(n)&&(n=e.component=ot.extend(n)),"function"!=typeof n&&(e.component=null,_('invalid component for route "'+t+'".'))}var L={};L.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},e.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,i,r,o){var s=new e(i);this.children[t]=s;var a=n(t,s,o);o&&o.contextEntered&&o.contextEntered(i,a),r(a)}};var q=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],U=new RegExp("(\\"+q.join("|\\")+")","g");a.prototype={eachChar:function(t){for(var e,n=this.string,i=0,r=n.length;r>i;i++)e=n.charAt(i),t({validChars:e})},regex:function(){return this.string.replace(U,"\\$1")},generate:function(){return this.string}},u.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){var e=t[this.name];return null==e?":"+this.name:e}},h.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){var e=t[this.name];return null==e?":"+this.name:e}},c.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},f.prototype={get:function(t){for(var e=this.nextStates,n=0,i=e.length;i>n;n++){var r=e[n],o=r.charSpec.validChars===t.validChars;if(o=o&&r.charSpec.invalidChars===t.invalidChars)return r}},put:function(t){var e;return(e=this.get(t))?e:(e=new f(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,i,r=this.nextStates,o=[],s=0,a=r.length;a>s;s++)e=r[s],n=e.charSpec,"undefined"!=typeof(i=n.validChars)?-1!==i.indexOf(t)&&o.push(e):"undefined"!=typeof(i=n.invalidChars)&&-1===i.indexOf(t)&&o.push(e);return o}};var I=Object.create||function(t){function e(){}return e.prototype=t,new e};v.prototype=I({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var z=function(){this.rootState=new f,this.names={}};z.prototype={add:function(t,e){for(var n,i=this.rootState,r="^",o={},s=[],a=[],u=!0,h=0,f=t.length;f>h;h++){var p=t[h],d=[],v=l(p.path,d,o);a=a.concat(v);for(var m=0,y=v.length;y>m;m++){var _=v[m];_ instanceof c||(u=!1,i=i.put({validChars:"/"}),r+="/",i=g(i,_),r+=_.regex())}var b={handler:p.handler,names:d};s.push(b)}u&&(i=i.put({validChars:"/"}),r+="/"),i.handlers=s,i.regex=new RegExp(r+"$"),i.specificity=o,(n=e&&e.as)&&(this.names[n]={segments:a,handlers:s})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var i=0,r=e.handlers.length;r>i;i++)n.push(e.handlers[i]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],i="";if(!n)throw new Error("There is no route named "+t);for(var r=n.segments,o=0,s=r.length;s>o;o++){var a=r[o];a instanceof c||(i+="/",i+=a.generate(e))}return"/"!==i.charAt(0)&&(i="/"+i),e&&e.queryParams&&(i+=this.generateQueryString(e.queryParams)),i},generateQueryString:function(t){var e=[],n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i);n.sort();for(var r=0,o=n.length;o>r;r++){i=n[r];var a=t[i];if(null!=a){var u=encodeURIComponent(i);if(s(a))for(var h=0,c=a.length;c>h;h++){var l=i+"[]="+encodeURIComponent(a[h]);e.push(l)}else u+="="+encodeURIComponent(a),e.push(u)}}return 0===e.length?"":"?"+e.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},i=0;i2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),n[s]||(n[s]=[])),r=o[1]?y(o[1]):""),u?n[s].push(r):n[s]=r}return n},recognize:function(t){var e,n,i,r,o=[this.rootState],s={},a=!1;if(r=t.indexOf("?"),-1!==r){var u=t.substr(r+1,t.length);t=t.substr(0,r),s=this.parseQueryString(u)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),a=!0),n=0,i=t.length;i>n&&(o=d(o,t.charAt(n)),o.length);n++);var h=[];for(n=0,i=o.length;i>n;n++)o[n].handlers&&h.push(o[n]);o=p(h);var c=h[0];return c&&c.handlers?(a&&"(.+)$"===c.regex.source.slice(-5)&&(t+="/"),m(c,t,s)):void 0}},z.prototype.map=o,z.VERSION="0.1.9";var B=z.prototype.generateQueryString,W={},J=void 0,Q=/#.*$/,G=function(){function t(e){var n=e.root,i=e.onChange;L.classCallCheck(this,t),n?("/"!==n.charAt(0)&&(n="/"+n),this.root=n.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=i;var r=document.querySelector("base");this.base=r&&r.getAttribute("href")}return t.prototype.start=function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);t.root&&(n=n.replace(t.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()},t.prototype.stop=function(){window.removeEventListener("popstate",this.listener)},t.prototype.go=function(t,e,n){var i=this.formatPath(t,n);e?history.replaceState({},"",i):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",i));var r=t.match(Q),o=r&&r[0];t=i.replace(Q,"").replace(this.rootRE,""),this.onChange(t,null,o)},t.prototype.formatPath=function(t,e){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:b(this.base||location.pathname,t,e)},t}(),K=function(){function t(e){var n=e.hashbang,i=e.onChange;L.classCallCheck(this,t),this.hashbang=n,this.onChange=i}return t.prototype.start=function(){var t=this;this.listener=function(){var e=location.hash,n=e.replace(/^#!?/,"");"/"!==n.charAt(0)&&(n="/"+n);var i=t.formatPath(n);if(i!==e)return void location.replace(i);var r=location.search&&e.indexOf("?")>-1?"&"+location.search.slice(1):location.search;t.onChange(decodeURI(e.replace(/^#!?/,"")+r))},window.addEventListener("hashchange",this.listener),this.listener()},t.prototype.stop=function(){window.removeEventListener("hashchange",this.listener)},t.prototype.go=function(t,e,n){t=this.formatPath(t,n),e?location.replace(t):location.hash=t},t.prototype.formatPath=function(t,e){var n="/"===t.charAt(0),i="#"+(this.hashbang?"!":""); -return n?i+t:i+b(location.hash.replace(/^#!?/,""),t,e)},t}(),X=function(){function t(e){var n=e.onChange;L.classCallCheck(this,t),this.onChange=n,this.currentPath="/"}return t.prototype.start=function(){this.onChange("/")},t.prototype.stop=function(){},t.prototype.go=function(t,e,n){t=this.currentPath=this.formatPath(t,n),this.onChange(t)},t.prototype.formatPath=function(t,e){return"/"===t.charAt(0)?t:b(this.currentPath,t,e)},t}(),Y=function(){function t(e,n,i){L.classCallCheck(this,t),this.router=e,this.to=n,this.from=i,this.next=null,this.aborted=!1,this.done=!1}return t.prototype.abort=function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}},t.prototype.redirect=function(t){this.aborted||(this.aborted=!0,"string"==typeof t?t=$(t,this.to.params,this.to.query):(t.params=t.params||this.to.params,t.query=t.query||this.to.query),this.router.replace(t))},t.prototype.start=function(t){for(var e=this,n=[],i=this.router._rootView;i;)n.unshift(i),i=i.childView;var r=n.slice().reverse(),o=this.activateQueue=F(this.to.matched).map(function(t){return t.handler}),s=void 0,a=void 0;for(s=0;s0&&(a=r.slice(0,s),n=r.slice(s).reverse(),o=o.slice(s)),e.runQueue(n,A,function(){e.runQueue(o,O,function(){e.runQueue(n,T,function(){if(e.router._onTransitionValidated(e),a&&a.forEach(function(t){return E(t,e)}),n.length){var i=n[n.length-1],r=a?a.length:0;j(i,e,r,t)}else t()})})})},t.prototype.runQueue=function(t,e,n){function i(o){o>=t.length?n():e(t[o],r,function(){i(o+1)})}var r=this;i(0)},t.prototype.callHook=function(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=i.expectBoolean,o=void 0===r?!1:r,s=i.expectData,a=void 0===s?!1:s,u=i.cleanup,h=this,c=!1,l=function(){u&&u(),h.abort()},f=function(t){if(u?p():l(),t&&!h.router._suppress)throw _("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},p=function(t){return c?void _("transition.next() should be called only once."):(c=!0,h.aborted?void(u&&u()):void(n&&n(t,f)))},d={to:h.to,from:h.from,abort:l,next:p,redirect:function(){h.redirect.apply(h,arguments)}},v=void 0;try{v=t.call(e,d)}catch(m){return f(m)}var g=w(v);o?"boolean"==typeof v?v?p():l():g?v.then(function(t){t?p():l()},f):t.length||p(v):g?v.then(p,f):(a&&N(v)||!t.length)&&p(v)},t.prototype.callHooks=function(t,e,n,i){var r=this;Array.isArray(t)?!function(){var o=[];o._needMerge=!0;var s=void 0;r.runQueue(t,function(t,n,s){r.aborted||r.callHook(t,e,function(t,e){t&&o.push(t),e=e,s()},i)},function(){n(o,s)})}():this.callHook(t,e,n,i)},t}(),Z=/^(component|subRoutes)$/,tt=function at(t,e){var n=this;L.classCallCheck(this,at);var i=e._recognizer.recognize(t);i&&([].forEach.call(i,function(t){for(var e in t.handler)Z.test(e)||(n[e]=t.handler[e])}),this.query=i.queryParams,this.params=[].reduce.call(i,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{})),this.path=t,this.router=e,this.matched=i||e._notFoundHandler,Object.freeze(this)},et=/\/$/,nt=/[-.*+?^${}()|[\]\/\\]/g,it=/\?.*$/,rt={"abstract":X,hash:K,html5:G},ot=void 0,st=function(){function t(){var e=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.hashbang,r=void 0===i?!0:i,o=n["abstract"],s=void 0===o?!1:o,a=n.history,u=void 0===a?!1:a,h=n.saveScrollPosition,c=void 0===h?!1:h,l=n.transitionOnLoad,f=void 0===l?!1:l,p=n.suppressTransitionError,d=void 0===p?!1:p,v=n.root,m=void 0===v?null:v,g=n.linkActiveClass,y=void 0===g?"v-link-active":g;if(L.classCallCheck(this,t),!t.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._children=[],this._recognizer=new z,this._guardRecognizer=new z,this._started=!1,this._startCb=null,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._notFoundRedirect=null,this._beforeEachHooks=[],this._afterEachHooks=[],this._rendered=!1,this._transitionOnLoad=f,this._root=m,this._abstract=s,this._hashbang=r;var _="undefined"!=typeof window&&window.history&&window.history.pushState;this._history=u&&_,this._historyFallback=u&&!_;var b=ot.util.inBrowser;this.mode=!b||this._abstract?"abstract":this._history?"html5":"hash";var w=rt[this.mode];this.history=new w({root:m,hashbang:this._hashbang,onChange:function(t,n,i){e._match(t,n,i)}}),this._saveScrollPosition=c,this._linkActiveClass=y,this._suppress=d}return t.prototype.map=function(t){for(var e in t)this.on(e,t[e]);return this},t.prototype.on=function(t,e){return"*"===t?this._notFound(e):this._addRoute(t,e,[]),this},t.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e]);return this},t.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e]);return this},t.prototype.beforeEach=function(t){return this._beforeEachHooks.push(t),this},t.prototype.afterEach=function(t){return this._afterEachHooks.push(t),this},t.prototype.go=function(t){var e=!1,n=!1;ot.util.isObject(t)&&(e=t.replace,n=t.append),t=this._stringifyPath(t),t&&this.history.go(t,e,n)},t.prototype.replace=function(t){"string"==typeof t&&(t={path:t}),t.replace=!0,this.go(t)},t.prototype.start=function(t,e,n){if(this._started)return void _("already started.");if(this._started=!0,this._startCb=n,!this.app){if(!t||!e)throw new Error("Must start vue-router with a component and a root container.");if(t instanceof ot)throw new Error("Must start vue-router with a component, not a Vue instance.");this._appContainer=e;var i=this._appConstructor="function"==typeof t?t:ot.extend(t);i.options.name=i.options.name||"RouterApp"}if(this._historyFallback){var r=window.location,o=new G({root:this._root}),s=o.root?r.pathname.replace(o.rootRE,""):r.pathname;if(s&&"/"!==s)return void r.assign((o.root||"")+"/"+this.history.formatPath(s)+r.search)}this.history.start()},t.prototype.stop=function(){this.history.stop(),this._started=!1},t.prototype._addRoute=function(t,e,n){if(M(t,e),e.path=t,e.fullPath=(n.reduce(function(t,e){return t+e.path},"")+t).replace("//","/"),n.push({path:t,handler:e}),this._recognizer.add(n,{as:e.name}),e.subRoutes)for(var i in e.subRoutes)this._addRoute(i,e.subRoutes[i],n.slice())},t.prototype._notFound=function(t){M("*",t),this._notFoundHandler=[{handler:t}]},t.prototype._addRedirect=function(t,e){"*"===t?this._notFoundRedirect=e:this._addGuard(t,e,this.replace)},t.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},t.prototype._addGuard=function(t,e,n){var i=this;this._guardRecognizer.add([{path:t,handler:function(t,r){var o=$(e,t.params,r);n.call(i,o)}}])},t.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):this._notFoundRedirect&&(e=this._recognizer.recognize(t),!e)?(this.replace(this._notFoundRedirect),!0):void 0},t.prototype._match=function(t,e,n){var i=this;if(!this._checkGuard(t)){var r=this._currentRoute,o=this._currentTransition;if(o){if(o.to.path===t)return;if(r.path===t)return o.aborted=!0,void(this._currentTransition=this._prevTransition);o.aborted=!0}var s=new tt(t,this),a=new Y(this,s,r);this._prevTransition=o,this._currentTransition=a,this.app||!function(){var t=i;i.app=new i._appConstructor({el:i._appContainer,created:function(){this.$router=t},_meta:{$route:s}})}();var u=this._beforeEachHooks,h=function(){a.start(function(){i._postTransition(s,e,n)})};u.length?a.runQueue(u,function(t,e,n){a===i._currentTransition&&a.callHook(t,null,n,{expectBoolean:!0})},h):h(),!this._rendered&&this._startCb&&this._startCb.call(null),this._rendered=!0}},t.prototype._onTransitionValidated=function(t){var e=this._currentRoute=t.to;this.app.$route!==e&&(this.app.$route=e,this._children.forEach(function(t){t.$route=e})),this._afterEachHooks.length&&this._afterEachHooks.forEach(function(e){return e.call(null,{to:t.to,from:t.from})}),this._currentTransition.done=!0},t.prototype._postTransition=function(t,e,n){var i=e&&e.pos;i&&this._saveScrollPosition?ot.nextTick(function(){window.scrollTo(i.x,i.y)}):n&&ot.nextTick(function(){var t=document.getElementById(n.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})},t.prototype._stringifyPath=function(t){var e="";if(t&&"object"==typeof t){if(t.name){var n=ot.util.extend,i=this._currentTransition&&this._currentTransition.to.params,r=t.params||{},o=i?n(n({},i),r):r;t.query&&(o.queryParams=t.query),e=this._recognizer.generate(t.name,o)}else if(t.path&&(e=t.path,t.query)){var s=this._recognizer.generateQueryString(t.query);e+=e.indexOf("?")>-1?"&"+s.slice(1):s}}else e=t?t+"":"";return encodeURI(e)},t}();return st.installed=!1,st.install=function(t){return st.installed?void _("already installed."):(ot=t,D(ot),V(ot),H(ot),W.Vue=ot,void(st.installed=!0))},"undefined"!=typeof window&&window.Vue&&window.Vue.use(st),st})},{}],26:[function(t,e,n){(function(t){"use strict";function n(t,e,i){if(r(t,e))return void(t[e]=i);if(t._isVue)return void n(t._data,e,i);var o=t.__ob__;if(!o)return void(t[e]=i);if(o.convert(e,i),o.dep.notify(),o.vms)for(var s=o.vms.length;s--;){var a=o.vms[s];a._proxy(e),a._digest()}return i}function i(t,e){if(r(t,e)){delete t[e];var n=t.__ob__;if(n&&(n.dep.notify(),n.vms))for(var i=n.vms.length;i--;){var o=n.vms[i];o._unproxy(e),o._digest()}}}function r(t,e){return _n.call(t,e)}function o(t){return bn.test(t)}function s(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function a(t){return null==t?"":t.toString()}function u(t){if("string"!=typeof t)return t;var e=Number(t);return isNaN(e)?t:e}function h(t){return"true"===t?!0:"false"===t?!1:t}function c(t){var e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e!==n||34!==e&&39!==e?t:t.slice(1,-1)}function l(t){return t.replace(wn,f)}function f(t,e){return e?e.toUpperCase():""}function p(t){return t.replace(Cn,"$1-$2").toLowerCase()}function d(t){return t.replace(xn,f)}function v(t,e){return function(n){var i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}}function m(t,e){e=e||0;for(var n=t.length-e,i=new Array(n);n--;)i[n]=t[n+e];return i}function g(t,e){for(var n=Object.keys(e),i=n.length;i--;)t[n[i]]=e[n[i]];return t}function y(t){return null!==t&&"object"==typeof t}function _(t){return $n.call(t)===kn}function b(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function w(t,e){var n,i,r,o,s,a=function u(){var a=Date.now()-o;e>a&&a>=0?n=setTimeout(u,e-a):(n=null,s=t.apply(r,i),n||(r=i=null))};return function(){return r=this,i=arguments,o=Date.now(),n||(n=setTimeout(a,e)),s}}function C(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function x(t){var e=function n(){return n.cancelled?void 0:t.apply(this,arguments)};return e.cancel=function(){e.cancelled=!0},e}function $(t,e){return t==e||(y(t)&&y(e)?JSON.stringify(t)===JSON.stringify(e):!1)}function k(t){this.size=0,this.limit=t,this.head=this.tail=void 0,this._keymap=Object.create(null)}function A(){var t,e=Ln.slice(Wn,zn).trim();if(e){t={};var n=e.match(Zn);t.name=n[0],n.length>1&&(t.args=n.slice(1).map(O))}t&&(qn.filters=qn.filters||[]).push(t),Wn=zn+1}function O(t){if(ti.test(t))return{value:u(t),dynamic:!1};var e=c(t),n=e===t;return{value:n?t:e,dynamic:n}}function T(t){var e=Yn.get(t);if(e)return e;for(Ln=t,Jn=Qn=!1,Gn=Kn=Xn=0,Wn=0,qn={},zn=0,Bn=Ln.length;Bn>zn;zn++)if(In=Un,Un=Ln.charCodeAt(zn),Jn)39===Un&&92!==In&&(Jn=!Jn);else if(Qn)34===Un&&92!==In&&(Qn=!Qn);else if(124===Un&&124!==Ln.charCodeAt(zn+1)&&124!==Ln.charCodeAt(zn-1))null==qn.expression?(Wn=zn+1,qn.expression=Ln.slice(0,zn).trim()):A();else switch(Un){case 34:Qn=!0;break;case 39:Jn=!0;break;case 40:Xn++;break;case 41:Xn--;break;case 91:Kn++;break;case 93:Kn--;break;case 123:Gn++;break;case 125:Gn--}return null==qn.expression?qn.expression=Ln.slice(0,zn).trim():0!==Wn&&A(),Yn.put(t,qn),qn}function j(t){return t.replace(ni,"\\$&")}function E(){var t=j(ci.delimiters[0]),e=j(ci.delimiters[1]),n=j(ci.unsafeDelimiters[0]),i=j(ci.unsafeDelimiters[1]);ri=new RegExp(n+"(.+?)"+i+"|"+t+"(.+?)"+e,"g"),oi=new RegExp("^"+n+".*"+i+"$"),ii=new k(1e3)}function P(t){ii||E();var e=ii.get(t);if(e)return e;if(t=t.replace(/\n/g,""),!ri.test(t))return null;for(var n,i,r,o,s,a,u=[],h=ri.lastIndex=0;n=ri.exec(t);)i=n.index,i>h&&u.push({value:t.slice(h,i)}),r=oi.test(n[0]),o=r?n[1]:n[2],s=o.charCodeAt(0),a=42===s,o=a?o.slice(1):o,u.push({tag:!0,value:o.trim(),html:r,oneTime:a}),h=i+n[0].length;return h1?t.map(function(t){return S(t,e)}).join("+"):S(t[0],e,!0)}function S(t,e,n){return t.tag?t.oneTime&&e?'"'+e.$eval(t.value)+'"':N(t.value,n):'"'+t.value+'"'}function N(t,e){if(si.test(t)){var n=T(t);return n.filters?"this._applyFilters("+n.expression+",null,"+JSON.stringify(n.filters)+",false)":"("+t+")"}return e?t:"("+t+")"}function F(t,e,n,i){H(t,1,function(){e.appendChild(t)},n,i)}function D(t,e,n,i){H(t,1,function(){z(t,e)},n,i)}function V(t,e,n){H(t,-1,function(){W(t)},e,n)}function H(t,e,n,i,r){var o=t.__v_trans;if(!o||!o.hooks&&!Sn||!i._isCompiled||i.$parent&&!i.$parent._isCompiled)return n(),void(r&&r());var s=e>0?"enter":"leave";o[s](n,r)}function M(t){if("string"==typeof t){t=document.querySelector(t)}return t}function L(t){var e=document.documentElement,n=t&&t.parentNode;return e===t||e===n||!(!n||1!==n.nodeType||!e.contains(n))}function q(t,e){var n=t.getAttribute(e);return null!==n&&t.removeAttribute(e),n}function U(t,e){var n=q(t,":"+e);return null===n&&(n=q(t,"v-bind:"+e)),n}function I(t,e){return t.hasAttribute(e)||t.hasAttribute(":"+e)||t.hasAttribute("v-bind:"+e)}function z(t,e){e.parentNode.insertBefore(t,e)}function B(t,e){e.nextSibling?z(t,e.nextSibling):e.parentNode.appendChild(t)}function W(t){t.parentNode.removeChild(t)}function J(t,e){e.firstChild?z(t,e.firstChild):e.appendChild(t)}function Q(t,e){var n=t.parentNode;n&&n.replaceChild(e,t)}function G(t,e,n,i){t.addEventListener(e,n,i)}function K(t,e,n){t.removeEventListener(e,n)}function X(t,e){!En||t instanceof SVGElement?t.setAttribute("class",e):t.className=e}function Y(t,e){if(t.classList)t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&X(t,(n+e).trim())}}function Z(t,e){if(t.classList)t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",i=" "+e+" ";n.indexOf(i)>=0;)n=n.replace(i," ");X(t,n.trim())}t.className||t.removeAttribute("class")}function tt(t,e){var n,i;if(it(t)&&t.content instanceof DocumentFragment&&(t=t.content),t.hasChildNodes())for(et(t),i=e?document.createDocumentFragment():document.createElement("div");n=t.firstChild;)i.appendChild(n);return i}function et(t){for(var e;e=t.firstChild,nt(e);)t.removeChild(e);for(;e=t.lastChild,nt(e);)t.removeChild(e)}function nt(t){return t&&(3===t.nodeType&&!t.data.trim()||8===t.nodeType)}function it(t){return t.tagName&&"template"===t.tagName.toLowerCase()}function rt(t,e){var n=ci.debug?document.createComment(t):document.createTextNode(e?" ":"");return n.__vue_anchor=!0,n}function ot(t){if(t.hasAttributes())for(var e=t.attributes,n=0,i=e.length;i>n;n++){var r=e[n].name;if(fi.test(r))return l(r.replace(fi,""))}}function st(t,e,n){for(var i;t!==e;)i=t.nextSibling,n(t),t=i;n(e)}function at(t,e,n,i,r){function o(){if(a++,s&&a>=u.length){for(var t=0;tr;r++){var s=i[r];pi.test(s)||di.test(s)||(e=n[s],_(e)&&(n[s]=pn.extend(e)))}}function mt(t){var e,n,i=t.props;if(An(i))for(t.props={},e=i.length;e--;)n=i[e],"string"==typeof n?t.props[n]=null:n.name&&(t.props[n.name]=n);else if(_(i)){var r=Object.keys(i);for(e=r.length;e--;)n=i[r[e]],"function"==typeof n&&(i[r[e]]={type:n})}}function gt(t){if(An(t)){for(var e,n={},i=t.length;i--;){e=t[i];var r="function"==typeof e?e.options&&e.options.name||e.id:e.name||e.id;r&&(n[r]=e)}return n}return t}function yt(t,e,n){function i(i){var r=vi[i]||mi;s[i]=r(t[i],e[i],n,i)}vt(e),mt(e);var o,s={};if(e.mixins)for(var a=0,u=e.mixins.length;u>a;a++)t=yt(t,e.mixins[a],n);for(o in t)i(o);for(o in e)r(t,o)||i(o);return s}function _t(t,e,n){if("string"==typeof n){var i,r=t[e];return r[n]||r[i=l(n)]||r[i.charAt(0).toUpperCase()+i.slice(1)]}}function bt(t,e,n){}function wt(){this.id=_i++,this.subs=[]}function Ct(t){if(this.value=t,this.dep=new wt,b(t,"__ob__",this),An(t)){var e=On?xt:$t;e(t,yi,bi),this.observeArray(t)}else this.walk(t)}function xt(t,e){t.__proto__=e}function $t(t,e,n){for(var i=0,r=n.length;r>i;i++){var o=n[i];b(t,o,e[o])}}function kt(t,e){if(t&&"object"==typeof t){var n;return r(t,"__ob__")&&t.__ob__ instanceof Ct?n=t.__ob__:(An(t)||_(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new Ct(t)),n&&e&&n.addVm(e),n}}function At(t,e,n){var i,r,o=new wt;if(ci.convertAllProperties){var s=Object.getOwnPropertyDescriptor(t,e);if(s&&s.configurable===!1)return;i=s&&s.get,r=s&&s.set}var a=kt(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=i?i.call(t):n;if(wt.target&&(o.depend(),a&&a.dep.depend(),An(e)))for(var r,s=0,u=e.length;u>s;s++)r=e[s],r&&r.__ob__&&r.__ob__.dep.depend();return e},set:function(e){var s=i?i.call(t):n;e!==s&&(r?r.call(t,e):n=e,a=kt(e),o.notify())}})}function Ot(t){t.prototype._init=function(t){t=t||{},this.$el=null,this.$parent=t.parent,this.$root=this.$parent?this.$parent.$root:this,this.$children=[],this.$refs={},this.$els={},this._watchers=[],this._directives=[],this._uid=Ci++,this._isVue=!0,this._events={},this._eventsCount={},this._isFragment=!1,this._fragment=this._fragmentStart=this._fragmentEnd=null,this._isCompiled=this._isDestroyed=this._isReady=this._isAttached=this._isBeingDestroyed=this._vForRemoving=!1,this._unlinkFn=null,this._context=t._context||this.$parent,this._scope=t._scope,this._frag=t._frag,this._frag&&this._frag.children.push(this),this.$parent&&this.$parent.$children.push(this),t=this.$options=yt(this.constructor.options,t,this),this._updateRef(),this._data={},this._callHook("init"),this._initState(),this._initEvents(),this._callHook("created"),t.el&&this.$mount(t.el)}}function Tt(t){if(void 0===t)return"eof";var e=t.charCodeAt(0);switch(e){case 91:case 93:case 46:case 34:case 39:case 48:return t;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return e>=97&&122>=e||e>=65&&90>=e?"ident":e>=49&&57>=e?"number":"else"}function jt(t){var e=t.trim();return"0"===t.charAt(0)&&isNaN(t)?!1:o(e)?c(e):"*"+e}function Et(t){function e(){var e=t[c+1];return l===Si&&"'"===e||l===Ni&&'"'===e?(c++,i="\\"+e,p[$i](),!0):void 0}var n,i,r,o,s,a,u,h=[],c=-1,l=Ti,f=0,p=[];for(p[ki]=function(){void 0!==r&&(h.push(r),r=void 0)},p[$i]=function(){void 0===r?r=i:r+=i},p[Ai]=function(){p[$i](),f++},p[Oi]=function(){if(f>0)f--,l=Ri,p[$i]();else{if(f=0,r=jt(r),r===!1)return!1;p[ki]()}};null!=l;)if(c++,n=t[c],"\\"!==n||!e()){if(o=Tt(n),u=Vi[l],s=u[o]||u["else"]||Di,s===Di)return;if(l=s[0],a=p[s[1]],a&&(i=s[2],i=void 0===i?n:i,a()===!1))return;if(l===Fi)return h.raw=t,h}}function Pt(t){var e=xi.get(t);return e||(e=Et(t),e&&xi.put(t,e)),e}function Rt(t,e){return Lt(e).get(t)}function St(t,e,i){var r=t;if("string"==typeof e&&(e=Et(e)),!e||!y(t))return!1;for(var o,s,a=0,u=e.length;u>a;a++)o=t,s=e[a],"*"===s.charAt(0)&&(s=Lt(s.slice(1)).get.call(r,r)),u-1>a?(t=t[s],y(t)||(t={},n(o,s,t))):An(t)?t.$set(s,i):s in t?t[s]=i:n(t,s,i);return!0}function Nt(t,e){var n=Xi.length;return Xi[n]=e?t.replace(Bi,"\\n"):t,'"'+n+'"'}function Ft(t){var e=t.charAt(0),n=t.slice(1);return qi.test(n)?t:(n=n.indexOf('"')>-1?n.replace(Ji,Dt):n,e+"scope."+n)}function Dt(t,e){return Xi[e]}function Vt(t){Ii.test(t),Xi.length=0;var e=t.replace(Wi,Nt).replace(zi,"");return e=(" "+e).replace(Gi,Ft).replace(Ji,Dt),Ht(e)}function Ht(t){try{return new Function("scope","return "+t+";")}catch(e){}}function Mt(t){var e=Pt(t);return e?function(t,n){St(t,e,n)}:void 0}function Lt(t,e){t=t.trim();var n=Mi.get(t);if(n)return e&&!n.set&&(n.set=Mt(n.exp)),n;var i={exp:t};return i.get=qt(t)&&t.indexOf("[")<0?Ht("scope."+t):Vt(t),e&&(i.set=Mt(t)),Mi.put(t,i),i}function qt(t){return Qi.test(t)&&!Ki.test(t)&&"Math."!==t.slice(0,5)}function Ut(){Zi=[],tr=[],er={},nr={},ir=rr=!1}function It(){zt(Zi),rr=!0,zt(tr),jn&&jn.emit("flush"),Ut()}function zt(t){for(var e=0;e47&&58>e?parseInt(t,10):1===t.length&&(e=t.toUpperCase().charCodeAt(0),e>64&&91>e)?e:Pr[t]});return n=[].concat.apply([],n),function(e){return n.indexOf(e.keyCode)>-1?t.call(this,e):void 0}}function Xt(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function Yt(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Zt(t){return function(e){return e.target===e.currentTarget?t.call(this,e):void 0}}function te(t,e,n){for(var i,r,o,s=e?[]:null,a=0,u=t.options.length;u>a;a++)if(i=t.options[a],o=n?i.hasAttribute("selected"):i.selected){if(r=i.hasOwnProperty("_value")?i._value:i.value,!e)return r;s.push(r)}return s}function ee(t,e){for(var n=t.length;n--;)if($(t[n],e))return n;return-1}function ne(t){return it(t)&&t.content instanceof DocumentFragment}function ie(t,e){var n=e?t:t.trim(),i=Lr.get(n);if(i)return i;var r=document.createDocumentFragment(),o=t.match(Ir),s=zr.test(t);if(o||s){var a=o&&o[1],u=Ur[a]||Ur.efault,h=u[0],c=u[1],l=u[2],f=document.createElement("div");for(f.innerHTML=c+t+l;h--;)f=f.lastChild;for(var p;p=f.firstChild;)r.appendChild(p)}else r.appendChild(document.createTextNode(t));return e||et(r),Lr.put(n,r),r}function re(t){if(ne(t))return et(t.content),t.content;if("SCRIPT"===t.tagName)return ie(t.textContent);for(var e,n=oe(t),i=document.createDocumentFragment();e=n.firstChild;)i.appendChild(e);return et(i),i}function oe(t){if(!t.querySelectorAll)return t.cloneNode();var e,n,i,r=t.cloneNode(!0);if(Br){var o=r;if(ne(t)&&(t=t.content,o=r.content),n=t.querySelectorAll("template"),n.length)for(i=o.querySelectorAll("template"),e=i.length;e--;)i[e].parentNode.replaceChild(oe(n[e]),i[e])}if(Wr)if("TEXTAREA"===t.tagName)r.value=t.value;else if(n=t.querySelectorAll("textarea"),n.length)for(i=r.querySelectorAll("textarea"),e=i.length;e--;)i[e].value=n[e].value;return r}function se(t,e,n){var i,r;return t instanceof DocumentFragment?(et(t),e?oe(t):t):("string"==typeof t?n||"#"!==t.charAt(0)?r=ie(t,n):(r=qr.get(t),r||(i=document.getElementById(t.slice(1)),i&&(r=re(i),qr.put(t,r)))):t.nodeType&&(r=re(t)),r&&e?oe(r):r)}function ae(t,e,n,i,r,o){this.children=[],this.childFrags=[],this.vm=e,this.scope=r,this.inserted=!1,this.parentFrag=o,o&&o.childFrags.push(this),this.unlink=t(e,n,i,r,this);var s=this.single=1===n.childNodes.length&&!n.childNodes[0].__vue_anchor;s?(this.node=n.childNodes[0],this.before=ue,this.remove=he):(this.node=rt("fragment-start"),this.end=rt("fragment-end"),this.frag=n,J(this.node,n),n.appendChild(this.end),this.before=ce,this.remove=le),this.node.__vfrag__=this}function ue(t,e){this.inserted=!0;var n=e!==!1?D:z;n(this.node,t,this.vm),L(this.node)&&this.callHook(fe)}function he(){this.inserted=!1;var t=L(this.node),e=this;this.beforeRemove(),V(this.node,this.vm,function(){t&&e.callHook(pe),e.destroy()})}function ce(t,e){this.inserted=!0;var n=this.vm,i=e!==!1?D:z;st(this.node,this.end,function(e){i(e,t,n)}),L(this.node)&&this.callHook(fe)}function le(){this.inserted=!1;var t=this,e=L(this.node);this.beforeRemove(),at(this.node,this.end,this.vm,this.frag,function(){e&&t.callHook(pe),t.destroy()})}function fe(t){t._isAttached||t._callHook("attached")}function pe(t){t._isAttached&&t._callHook("detached")}function de(t,e){this.vm=t;var n,i="string"==typeof e;i||it(e)?n=se(e,!0):(n=document.createDocumentFragment(),n.appendChild(e)),this.template=n;var r,o=t.constructor.cid;if(o>0){var s=o+(i?e:e.outerHTML);r=Qr.get(s),r||(r=Oe(n,t.$options,!0),Qr.put(s,r))}else r=Oe(n,t.$options,!0);this.linker=r}function ve(t,e,n){var i=t.node.previousSibling;if(i){for(t=i.__vfrag__;!(t&&t.forId===n&&t.inserted||i===e);){if(i=i.previousSibling,!i)return;t=i.__vfrag__}return t}}function me(t){var e=t.node;if(t.end)for(;!e.__vue__&&e!==t.end&&e.nextSibling;)e=e.nextSibling;return e.__vue__}function ge(t){for(var e=-1,n=new Array(Math.floor(t));++e-1:r(t,e)}function $e(t,e){for(var n,i,r,s,a,u,h,c=[],f=Object.keys(e),d=f.length;d--;)i=f[d],n=e[i]||mo,a=l(i),go.test(a)&&(h={name:i,path:a,options:n,mode:vo.ONE_WAY,raw:null},r=p(i),null===(s=U(t,r))&&(null!==(s=U(t,r+".sync"))?h.mode=vo.TWO_WAY:null!==(s=U(t,r+".once"))&&(h.mode=vo.ONE_TIME)),null!==s?(h.raw=s,u=T(s),s=u.expression,h.filters=u.filters,o(s)&&!u.filters?h.optimizedLiteral=!0:h.dynamic=!0,h.parentPath=s):null!==(s=q(t,r))?h.raw=s:n.required,c.push(h));return ke(c)}function ke(t){return function(e,n){e._props={};for(var i,r,o,s,a,l=t.length;l--;)if(i=t[l],a=i.raw,r=i.path,o=i.options,e._props[r]=i,null===a)ct(e,i,Ae(e,o));else if(i.dynamic)e._context&&(i.mode===vo.ONE_TIME?(s=(n||e._context).$get(i.parentPath),ct(e,i,s)):e._bindDir({name:"prop",def:co,prop:i},null,null,n));else if(i.optimizedLiteral){var f=c(a);s=f===a?h(u(a)):f,ct(e,i,s)}else s=o.type===Boolean&&""===a?!0:a,ct(e,i,s)}}function Ae(t,e){if(!r(e,"default"))return e.type===Boolean?!1:void 0;var n=e["default"];return y(n),"function"==typeof n&&e.type!==Function?n.call(t):n}function Oe(t,e,n){var i=n||!e._asComponent?Ne(t,e):null,r=i&&i.terminal||"SCRIPT"===t.tagName||!t.hasChildNodes()?null:Le(t.childNodes,e);return function(t,e,n,o,s){var a=m(e.childNodes),u=Te(function(){i&&i(t,e,n,o,s),r&&r(t,a,n,o,s)},t);return Ee(t,u)}}function Te(t,e){e._directives=[];var n=e._directives.length;t();var i=e._directives.slice(n);i.sort(je);for(var r=0,o=i.length;o>r;r++)i[r]._bind();return i}function je(t,e){return t=t.descriptor.def.priority||$o,e=e.descriptor.def.priority||$o,t>e?-1:t===e?0:1}function Ee(t,e,n,i){function r(r){Pe(t,e,r),n&&i&&Pe(n,i)}return r.dirs=e,r}function Pe(t,e,n){for(var i=e.length;i--;)e[i]._teardown()}function Re(t,e,n,i){var r=$e(e,n),o=Te(function(){r(t,i)},t);return Ee(t,o)}function Se(t,e,n){var i,r,o=e._containerAttrs,s=e._replacerAttrs;if(11!==t.nodeType)e._asComponent?(o&&n&&(i=Je(o,n)),s&&(r=Je(s,e))):r=Je(t.attributes,e);else;return e._containerAttrs=e._replacerAttrs=null,function(t,e,n){var o,s=t._context;s&&i&&(o=Te(function(){i(s,e,null,n)},s));var a=Te(function(){r&&r(t,e)},t);return Ee(t,a,s,o)}}function Ne(t,e){var n=t.nodeType;return 1===n&&"SCRIPT"!==t.tagName?Fe(t,e):3===n&&t.data.trim()?De(t,e):null}function Fe(t,e){if("TEXTAREA"===t.tagName){var n=P(t.value);n&&(t.setAttribute(":value",R(n)),t.value="")}var i,r=t.hasAttributes();return r&&(i=ze(t,e)),i||(i=Ue(t,e)),i||(i=Ie(t,e)),!i&&r&&(i=Je(t.attributes,e)),i}function De(t,e){if(t._skip)return Ve;var n=P(t.wholeText);if(!n)return null;for(var i=t.nextSibling;i&&3===i.nodeType;)i._skip=!0,i=i.nextSibling;for(var r,o,s=document.createDocumentFragment(),a=0,u=n.length;u>a;a++)o=n[a],r=o.tag?He(o,e):document.createTextNode(o.value),s.appendChild(r);return Me(n,s,e)}function Ve(t,e){W(e)}function He(t,e){function n(e){if(!t.descriptor){var n=T(t.value);t.descriptor={name:e,def:to[e],expression:n.expression,filters:n.filters}}}var i;return t.oneTime?i=document.createTextNode(t.value):t.html?(i=document.createComment("v-html"),n("html")):(i=document.createTextNode(" "),n("text")),i}function Me(t,e){return function(n,i,r,o){for(var s,a,u,h=e.cloneNode(!0),c=m(h.childNodes),l=0,f=t.length;f>l;l++)s=t[l],a=s.value,s.tag&&(u=c[l],s.oneTime?(a=(o||n).$eval(a),s.html?Q(u,se(a,!0)):u.data=a):n._bindDir(s.descriptor,u,r,o));Q(i,h)}}function Le(t,e){for(var n,i,r,o=[],s=0,a=t.length;a>s;s++)r=t[s],n=Ne(r,e),i=n&&n.terminal||"SCRIPT"===r.tagName||!r.hasChildNodes()?null:Le(r.childNodes,e),o.push(n,i);return o.length?qe(o):null}function qe(t){return function(e,n,i,r,o){for(var s,a,u,h=0,c=0,l=t.length;l>h;c++){s=n[c],a=t[h++],u=t[h++];var f=m(s.childNodes);a&&a(e,s,i,r,o),u&&u(e,f,i,r,o)}}}function Ue(t,e){var n=t.tagName.toLowerCase();if(!pi.test(n)){"slot"===n&&I(t,"name")&&(n="_namedSlot");var i=_t(e,"elementDirectives",n);return i?We(t,n,"",e,i):void 0}}function Ie(t,e){var n=ut(t,e);if(n){var i=ot(t),r={name:"component",ref:i,expression:n.id,def:po.component,modifiers:{literal:!n.dynamic}},o=function(t,e,n,o,s){i&&At((o||t).$refs,i,null),t._bindDir(r,e,n,o,s)};return o.terminal=!0,o}}function ze(t,e){if(null!==q(t,"v-pre"))return Be;if(t.hasAttribute("v-else")){var n=t.previousElementSibling;if(n&&n.hasAttribute("v-if"))return Be}for(var i,r,o=0,s=xo.length;s>o;o++)if(r=xo[o],i=t.getAttribute("v-"+r),null!=i)return We(t,r,i,e)}function Be(){}function We(t,e,n,i,r){var o=T(n),s={name:e,expression:o.expression,filters:o.filters,raw:n,def:r||to[e]};("for"===e||"router-view"===e)&&(s.ref=ot(t));var a=function(t,e,n,i,r){s.ref&&At((i||t).$refs,s.ref,null),t._bindDir(s,e,n,i,r)};return a.terminal=!0,a}function Je(t,e){function n(t,e,n){var i=n&&Ke(n),r=!i&&T(o);v.push({name:t,attr:s,raw:a,def:e,arg:h,modifiers:c,expression:r&&r.expression,filters:r&&r.filters,interp:n,hasOneTime:i})}for(var i,r,o,s,a,u,h,c,l,f,p,d=t.length,v=[];d--;)if(i=t[d], -r=s=i.name,o=a=i.value,f=P(o),h=null,c=Qe(r),r=r.replace(wo,""),f)o=R(f),h=r,n("bind",to.bind,f);else if(Co.test(r))c.literal=!yo.test(r),n("transition",po.transition);else if(_o.test(r))h=r.replace(_o,""),n("on",to.on);else if(yo.test(r))u=r.replace(yo,""),"style"===u||"class"===u?n(u,po[u]):(h=u,n("bind",to.bind));else if(p=r.match(bo)){if(u=p[1],h=p[2],"else"===u)continue;l=_t(e,"directives",u),l&&n(u,l)}return v.length?Ge(v):void 0}function Qe(t){var e=Object.create(null),n=t.match(wo);if(n)for(var i=n.length;i--;)e[n[i].slice(1)]=!0;return e}function Ge(t){return function(e,n,i,r,o){for(var s=t.length;s--;)e._bindDir(t[s],n,i,r,o)}}function Ke(t){for(var e=t.length;e--;)if(t[e].oneTime)return!0}function Xe(t,e){return e&&(e._containerAttrs=Ze(t)),it(t)&&(t=se(t)),e&&(e._asComponent&&!e.template&&(e.template=""),e.template&&(e._content=tt(t),t=Ye(t,e))),t instanceof DocumentFragment&&(J(rt("v-start",!0),t),t.appendChild(rt("v-end",!0))),t}function Ye(t,e){var n=e.template,i=se(n,!0);if(i){var r=i.firstChild,o=r.tagName&&r.tagName.toLowerCase();return e.replace?(t===document.body,i.childNodes.length>1||1!==r.nodeType||"component"===o||_t(e,"components",o)||I(r,"is")||_t(e,"elementDirectives",o)||r.hasAttribute("v-for")||r.hasAttribute("v-if")?i:(e._replacerAttrs=Ze(r),tn(t,r),r)):(t.appendChild(i),t)}}function Ze(t){return 1===t.nodeType&&t.hasAttributes()?m(t.attributes):void 0}function tn(t,e){for(var n,i,r=t.attributes,o=r.length;o--;)n=r[o].name,i=r[o].value,e.hasAttribute(n)||ko.test(n)?"class"!==n||P(i)||i.split(/\s+/).forEach(function(t){Y(e,t)}):e.setAttribute(n,i)}function en(t){function e(){}function i(t,e){var n=new Wt(e,t,null,{lazy:!0});return function(){return n.dirty&&n.evaluate(),wt.target&&n.depend(),n.value}}Object.defineProperty(t.prototype,"$data",{get:function(){return this._data},set:function(t){t!==this._data&&this._setData(t)}}),t.prototype._initState=function(){this._initProps(),this._initMeta(),this._initMethods(),this._initData(),this._initComputed()},t.prototype._initProps=function(){var t=this.$options,e=t.el,n=t.props;e=t.el=M(e),this._propsUnlinkFn=e&&1===e.nodeType&&n?Re(this,e,n,this._scope):null},t.prototype._initData=function(){var t=this._data,e=this.$options.data,i=e&&e();if(i){this._data=i;for(var o in t)null===this._props[o].raw&&r(i,o)||n(i,o,t[o])}var s,a,u=this._data,h=Object.keys(u);for(s=h.length;s--;)a=h[s],this._proxy(a);kt(u,this)},t.prototype._setData=function(t){t=t||{};var e=this._data;this._data=t;var n,i,o;for(n=Object.keys(e),o=n.length;o--;)i=n[o],i in t||this._unproxy(i);for(n=Object.keys(t),o=n.length;o--;)i=n[o],r(this,i)||this._proxy(i);e.__ob__.removeVm(this),kt(t,this),this._digest()},t.prototype._proxy=function(t){if(!s(t)){var e=this;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return e._data[t]},set:function(n){e._data[t]=n}})}},t.prototype._unproxy=function(t){s(t)||delete this[t]},t.prototype._digest=function(){for(var t=0,e=this._watchers.length;e>t;t++)this._watchers[t].update(!0)},t.prototype._initComputed=function(){var t=this.$options.computed;if(t)for(var n in t){var r=t[n],o={enumerable:!0,configurable:!0};"function"==typeof r?(o.get=i(r,this),o.set=e):(o.get=r.get?r.cache!==!1?i(r.get,this):v(r.get,this):e,o.set=r.set?v(r.set,this):e),Object.defineProperty(this,n,o)}},t.prototype._initMethods=function(){var t=this.$options.methods;if(t)for(var e in t)this[e]=v(t[e],this)},t.prototype._initMeta=function(){var t=this.$options._meta;if(t)for(var e in t)At(this,e,t[e])}}function nn(t){function e(t,e){for(var n,i,r=e.attributes,o=0,s=r.length;s>o;o++)n=r[o].name,Oo.test(n)&&(n=n.replace(Oo,""),i=(t._scope||t._context).$eval(r[o].value,!0),i._fromParent=!0,t.$on(n.replace(Oo),i))}function n(t,e,n){if(n){var r,o,s,a;for(o in n)if(r=n[o],An(r))for(s=0,a=r.length;a>s;s++)i(t,e,o,r[s]);else i(t,e,o,r)}}function i(t,e,n,r,o){var s=typeof r;if("function"===s)t[e](n,r,o);else if("string"===s){var a=t.$options.methods,u=a&&a[r];u&&t[e](n,u,o)}else r&&"object"===s&&i(t,e,n,r.handler,r)}function r(){this._isAttached||(this._isAttached=!0,this.$children.forEach(o))}function o(t){!t._isAttached&&L(t.$el)&&t._callHook("attached")}function s(){this._isAttached&&(this._isAttached=!1,this.$children.forEach(a))}function a(t){t._isAttached&&!L(t.$el)&&t._callHook("detached")}t.prototype._initEvents=function(){var t=this.$options;t._asComponent&&e(this,t.el),n(this,"$on",t.events),n(this,"$watch",t.watch)},t.prototype._initDOMHooks=function(){this.$on("hook:attached",r),this.$on("hook:detached",s)},t.prototype._callHook=function(t){this.$emit("pre-hook:"+t);var e=this.$options[t];if(e)for(var n=0,i=e.length;i>n;n++)e[n].call(this);this.$emit("hook:"+t)}}function rn(){}function on(t,e,n,i,r,o){this.vm=e,this.el=n,this.descriptor=t,this.name=t.name,this.expression=t.expression,this.arg=t.arg,this.modifiers=t.modifiers,this.filters=t.filters,this.literal=this.modifiers&&this.modifiers.literal,this._locked=!1,this._bound=!1,this._listeners=null,this._host=i,this._scope=r,this._frag=o}function sn(t){t.prototype._updateRef=function(t){var e=this.$options._ref;if(e){var n=(this._scope||this._context).$refs;t?n[e]===this&&(n[e]=null):n[e]=this}},t.prototype._compile=function(t){var e=this.$options,n=t;if(t=Xe(t,e),this._initElement(t),1!==t.nodeType||null===q(t,"v-pre")){var i,r=this._context&&this._context.$options,o=Se(t,e,r),s=this.constructor;e._linkerCachable&&(i=s.linker,i||(i=s.linker=Oe(t,e)));var a=o(this,t,this._scope),u=i?i(this,t):Oe(t,e)(this,t);this._unlinkFn=function(){a(),u(!0)},e.replace&&Q(n,t),this._isCompiled=!0,this._callHook("compiled")}},t.prototype._initElement=function(t){t instanceof DocumentFragment?(this._isFragment=!0,this.$el=this._fragmentStart=t.firstChild,this._fragmentEnd=t.lastChild,3===this._fragmentStart.nodeType&&(this._fragmentStart.data=this._fragmentEnd.data=""),this._fragment=t):this.$el=t,this.$el.__vue__=this,this._callHook("beforeCompile")},t.prototype._bindDir=function(t,e,n,i,r){this._directives.push(new on(t,this,e,n,i,r))},t.prototype._destroy=function(t,e){if(this._isBeingDestroyed)return void(e||this._cleanup());var n,i,r=this,o=function(){!n||i||e||r._cleanup()};t&&this.$el&&(i=!0,this.$remove(function(){i=!1,o()})),this._callHook("beforeDestroy"),this._isBeingDestroyed=!0;var s,a=this.$parent;for(a&&!a._isBeingDestroyed&&(a.$children.$remove(this),this._updateRef(!0)),s=this.$children.length;s--;)this.$children[s].$destroy();for(this._propsUnlinkFn&&this._propsUnlinkFn(),this._unlinkFn&&this._unlinkFn(),s=this._watchers.length;s--;)this._watchers[s].teardown();this.$el&&(this.$el.__vue__=null),n=!0,o()},t.prototype._cleanup=function(){this._isDestroyed||(this._frag&&this._frag.children.$remove(this),this._data.__ob__&&this._data.__ob__.removeVm(this),this.$el=this.$parent=this.$root=this.$children=this._watchers=this._context=this._scope=this._directives=null,this._isDestroyed=!0,this._callHook("destroyed"),this.$off())}}function an(t){t.prototype._applyFilters=function(t,e,n,i){var r,o,s,a,u,h,c,l,f;for(h=0,c=n.length;c>h;h++)if(r=n[h],o=_t(this.$options,"filters",r.name),o&&(o=i?o.write:o.read||o,"function"==typeof o)){if(s=i?[t,e]:[t],u=i?2:1,r.args)for(l=0,f=r.args.length;f>l;l++)a=r.args[l],s[l+u]=a.dynamic?this.$get(a.value):a.value;t=o.apply(this,s)}return t},t.prototype._resolveComponent=function(e,n){var i=_t(this.$options,"components",e);if(i)if(i.options)n(i);else if(i.resolved)n(i.resolved);else if(i.requested)i.pendingCallbacks.push(n);else{i.requested=!0;var r=i.pendingCallbacks=[n];i(function(e){_(e)&&(e=t.extend(e)),i.resolved=e;for(var n=0,o=r.length;o>n;n++)r[n](e)},function(t){})}}}function un(t){function e(t){return new Function("return function "+d(t)+" (options) { this._init(options) }")()}t.util=wi,t.config=ci,t.set=n,t["delete"]=i,t.nextTick=Hn,t.compiler=Ao,t.FragmentFactory=de,t.internalDirectives=po,t.parsers={path:Hi,text:ai,template:Jr,directive:ei,expression:Yi},t.cid=0;var r=1;t.extend=function(t){t=t||{};var n=this,i=0===n.cid;if(i&&t._Ctor)return t._Ctor;var o=t.name||n.options.name,s=e(o||"VueComponent");return s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.cid=r++,s.options=yt(n.options,t),s["super"]=n,s.extend=n.extend,ci._assetTypes.forEach(function(t){s[t]=n[t]}),o&&(s.options.components[o]=s),i&&(t._Ctor=s),s},t.use=function(t){if(!t.installed){var e=m(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):t.apply(null,e),t.installed=!0,this}},t.mixin=function(e){t.options=yt(t.options,e)},ci._assetTypes.forEach(function(e){t[e]=function(n,i){return i?("component"===e&&_(i)&&(i.name=n,i=t.extend(i)),this.options[e+"s"][n]=i,i):this.options[e+"s"][n]}})}function hn(t){function e(t){return JSON.parse(JSON.stringify(t))}t.prototype.$get=function(t,e){var n=Lt(t);if(n){if(e&&!qt(t)){var i=this;return function(){i.$arguments=m(arguments);var t=n.get.call(i,i);return i.$arguments=null,t}}try{return n.get.call(this,this)}catch(r){}}},t.prototype.$set=function(t,e){var n=Lt(t,!0);n&&n.set&&n.set.call(this,this,e)},t.prototype.$delete=function(t){i(this._data,t)},t.prototype.$watch=function(t,e,n){var i,r=this;"string"==typeof t&&(i=T(t),t=i.expression);var o=new Wt(r,t,e,{deep:n&&n.deep,sync:n&&n.sync,filters:i&&i.filters,user:!n||n.user!==!1});return n&&n.immediate&&e.call(r,o.value),function(){o.teardown()}},t.prototype.$eval=function(t,e){if(To.test(t)){var n=T(t),i=this.$get(n.expression,e);return n.filters?this._applyFilters(i,null,n.filters):i}return this.$get(t,e)},t.prototype.$interpolate=function(t){var e=P(t),n=this;return e?1===e.length?n.$eval(e[0].value)+"":e.map(function(t){return t.tag?n.$eval(t.value):t.value}).join(""):t},t.prototype.$log=function(t){var n=t?Rt(this._data,t):this._data;if(n&&(n=e(n)),!t)for(var i in this.$options.computed)n[i]=e(this[i]);console.log(n)}}function cn(t){function e(t,e,i,r,o,s){e=n(e);var a=!L(e),u=r===!1||a?o:s,h=!a&&!t._isAttached&&!L(t.$el);return t._isFragment?(st(t._fragmentStart,t._fragmentEnd,function(n){u(n,e,t)}),i&&i()):u(t.$el,e,t,i),h&&t._callHook("attached"),t}function n(t){return"string"==typeof t?document.querySelector(t):t}function i(t,e,n,i){e.appendChild(t),i&&i()}function r(t,e,n,i){z(t,e),i&&i()}function o(t,e,n){W(t),n&&n()}t.prototype.$nextTick=function(t){Hn(t,this)},t.prototype.$appendTo=function(t,n,r){return e(this,t,n,r,i,F)},t.prototype.$prependTo=function(t,e,i){return t=n(t),t.hasChildNodes()?this.$before(t.firstChild,e,i):this.$appendTo(t,e,i),this},t.prototype.$before=function(t,n,i){return e(this,t,n,i,r,D)},t.prototype.$after=function(t,e,i){return t=n(t),t.nextSibling?this.$before(t.nextSibling,e,i):this.$appendTo(t.parentNode,e,i),this},t.prototype.$remove=function(t,e){if(!this.$el.parentNode)return t&&t();var n=this._isAttached&&L(this.$el);n||(e=!1);var i=this,r=function(){n&&i._callHook("detached"),t&&t()};if(this._isFragment)at(this._fragmentStart,this._fragmentEnd,this,this._fragment,r);else{var s=e===!1?o:V;s(this.$el,this,r)}return this}}function ln(t){function e(t,e,i){var r=t.$parent;if(r&&i&&!n.test(e))for(;r;)r._eventsCount[e]=(r._eventsCount[e]||0)+i,r=r.$parent}t.prototype.$on=function(t,n){return(this._events[t]||(this._events[t]=[])).push(n),e(this,t,1),this},t.prototype.$once=function(t,e){function n(){i.$off(t,n),e.apply(this,arguments)}var i=this;return n.fn=e,this.$on(t,n),this},t.prototype.$off=function(t,n){var i;if(!arguments.length){if(this.$parent)for(t in this._events)i=this._events[t],i&&e(this,t,-i.length);return this._events={},this}if(i=this._events[t],!i)return this;if(1===arguments.length)return e(this,t,-i.length),this._events[t]=null,this;for(var r,o=i.length;o--;)if(r=i[o],r===n||r.fn===n){e(this,t,-1),i.splice(o,1);break}return this},t.prototype.$emit=function(t){var e="string"==typeof t;t=e?t:t.name;var n=this._events[t],i=e||!n;if(n){n=n.length>1?m(n):n;var r=e&&n.some(function(t){return t._fromParent});r&&(i=!1);for(var o=m(arguments,1),s=0,a=n.length;a>s;s++){var u=n[s],h=u.apply(this,o);h!==!0||r&&!u._fromParent||(i=!0)}}return i},t.prototype.$broadcast=function(t){var e="string"==typeof t;if(t=e?t:t.name,this._eventsCount[t]){var n=this.$children,i=m(arguments);e&&(i[0]={name:t,source:this});for(var r=0,o=n.length;o>r;r++){var s=n[r],a=s.$emit.apply(s,i);a&&s.$broadcast.apply(s,i)}return this}},t.prototype.$dispatch=function(t){var e=this.$emit.apply(this,arguments);if(e){var n=this.$parent,i=m(arguments);for(i[0]={name:t,source:this};n;)e=n.$emit.apply(n,i),n=e?n.$parent:null;return this}};var n=/^hook:/}function fn(t){function e(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")}t.prototype.$mount=function(t){return this._isCompiled?void 0:(t=M(t),t||(t=document.createElement("div")),this._compile(t),this._initDOMHooks(),L(this.$el)?(this._callHook("attached"),e.call(this)):this.$once("hook:attached",e),this)},t.prototype.$destroy=function(t,e){this._destroy(t,e)},t.prototype.$compile=function(t,e,n,i){return Oe(t,this.$options,!0)(this,t,e,n,i)}}function pn(t){this._init(t)}function dn(t,e,n){return n=n?parseInt(n,10):0,e=u(e),"number"==typeof e?t.slice(n,n+e):t}function vn(t,e,n){if(t=jo(t),null==e)return t;if("function"==typeof e)return t.filter(e);e=(""+e).toLowerCase();for(var i,r,o,s,a="in"===n?3:2,u=m(arguments,a).reduce(function(t,e){return t.concat(e)},[]),h=[],c=0,l=t.length;l>c;c++)if(i=t[c],o=i&&i.$value||i,s=u.length){for(;s--;)if(r=u[s],"$key"===r&&gn(i.$key,e)||gn(Rt(o,r),e)){h.push(i);break}}else gn(i,e)&&h.push(i);return h}function mn(t,e,n){if(t=jo(t),!e)return t;var i=n&&0>n?-1:1;return t.slice().sort(function(t,n){return"$key"!==e&&(y(t)&&"$value"in t&&(t=t.$value),y(n)&&"$value"in n&&(n=n.$value)),t=y(t)?Rt(t,e):t,n=y(n)?Rt(n,e):n,t===n?0:t>n?i:-i})}function gn(t,e){var n;if(_(t)){var i=Object.keys(t);for(n=i.length;n--;)if(gn(t[i[n]],e))return!0}else if(An(t)){for(n=t.length;n--;)if(gn(t[n],e))return!0}else if(null!=t)return t.toString().toLowerCase().indexOf(e)>-1}function yn(t,e,n){function i(t){!it(t)||t.hasAttribute("v-if")||t.hasAttribute("v-for")||(t=se(t)),t=oe(t),r.appendChild(t)}for(var r=document.createDocumentFragment(),o=0,s=t.length;s>o;o++){var a=t[o];n&&!a.__v_selected?i(a):n||a.parentNode!==e||(a.__v_selected=!0,i(a))}return r}var _n=Object.prototype.hasOwnProperty,bn=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,wn=/-(\w)/g,Cn=/([a-z\d])([A-Z])/g,xn=/(?:^|[-_\/])(\w)/g,$n=Object.prototype.toString,kn="[object Object]",An=Array.isArray,On="__proto__"in{},Tn="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),jn=Tn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,En=Tn&&navigator.userAgent.toLowerCase().indexOf("msie 9.0")>0,Pn=Tn&&navigator.userAgent.toLowerCase().indexOf("android")>0,Rn=void 0,Sn=void 0,Nn=void 0,Fn=void 0;if(Tn&&!En){var Dn=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,Vn=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;Rn=Dn?"WebkitTransition":"transition",Sn=Dn?"webkitTransitionEnd":"transitionend",Nn=Vn?"WebkitAnimation":"animation",Fn=Vn?"webkitAnimationEnd":"animationend"}var Hn=function(){function e(){r=!1;var t=i.slice(0);i=[];for(var e=0;e=this.length&&(this.length=Number(t)+1),this.splice(t,1,e)[0]}),b(gi,"$remove",function(t){if(this.length){var e=C(this,t);return e>-1?this.splice(e,1):void 0}});var _i=0;wt.target=null,wt.prototype.addSub=function(t){this.subs.push(t)},wt.prototype.removeSub=function(t){this.subs.$remove(t)},wt.prototype.depend=function(){wt.target.addDep(this)},wt.prototype.notify=function(){for(var t=m(this.subs),e=0,n=t.length;n>e;e++)t[e].update()};var bi=Object.getOwnPropertyNames(yi);Ct.prototype.walk=function(t){for(var e=Object.keys(t),n=0,i=e.length;i>n;n++)this.convert(e[n],t[e[n]])},Ct.prototype.observeArray=function(t){for(var e=0,n=t.length;n>e;e++)kt(t[e])},Ct.prototype.convert=function(t,e){At(this.value,t,e)},Ct.prototype.addVm=function(t){(this.vms||(this.vms=[])).push(t)},Ct.prototype.removeVm=function(t){this.vms.$remove(t)};var wi=Object.freeze({defineReactive:At,set:n,del:i,hasOwn:r,isLiteral:o,isReserved:s,_toString:a,toNumber:u,toBoolean:h,stripQuotes:c,camelize:l,hyphenate:p,classify:d,bind:v,toArray:m,extend:g,isObject:y,isPlainObject:_,def:b,debounce:w,indexOf:C,cancellable:x,looseEqual:$,isArray:An,hasProto:On,inBrowser:Tn,devtools:jn,isIE9:En,isAndroid:Pn,get transitionProp(){return Rn},get transitionEndEvent(){return Sn},get animationProp(){return Nn},get animationEndEvent(){return Fn},nextTick:Hn,query:M,inDoc:L,getAttr:q,getBindAttr:U,hasBindAttr:I,before:z,after:B,remove:W,prepend:J,replace:Q,on:G,off:K,setClass:X,addClass:Y,removeClass:Z,extractContent:tt,trimNode:et,isTemplate:it,createAnchor:rt,findRef:ot,mapNodeRange:st,removeNodeRange:at,mergeOptions:yt,resolveAsset:_t,assertAsset:bt,checkComponentAttr:ut,initProp:ct,assertProp:lt,coerceProp:ft,commonTagRE:pi,reservedTagRE:di,get warn(){return li}}),Ci=0,xi=new k(1e3),$i=0,ki=1,Ai=2,Oi=3,Ti=0,ji=1,Ei=2,Pi=3,Ri=4,Si=5,Ni=6,Fi=7,Di=8,Vi=[];Vi[Ti]={ws:[Ti],ident:[Pi,$i],"[":[Ri],eof:[Fi]},Vi[ji]={ws:[ji],".":[Ei],"[":[Ri],eof:[Fi]},Vi[Ei]={ws:[Ei],ident:[Pi,$i]},Vi[Pi]={ident:[Pi,$i],0:[Pi,$i],number:[Pi,$i],ws:[ji,ki],".":[Ei,ki],"[":[Ri,ki],eof:[Fi,ki]},Vi[Ri]={"'":[Si,$i],'"':[Ni,$i],"[":[Ri,Ai],"]":[ji,Oi],eof:Di,"else":[Ri,$i]},Vi[Si]={"'":[Ri,$i],eof:Di,"else":[Si,$i]},Vi[Ni]={'"':[Ri,$i],eof:Di,"else":[Ni,$i]};var Hi=Object.freeze({parsePath:Pt,getPath:Rt,setPath:St}),Mi=new k(1e3),Li="Math,Date,this,true,false,null,undefined,Infinity,NaN,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,parseInt,parseFloat",qi=new RegExp("^("+Li.replace(/,/g,"\\b|")+"\\b)"),Ui="break,case,class,catch,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,let,return,super,switch,throw,try,var,while,with,yield,enum,await,implements,package,proctected,static,interface,private,public",Ii=new RegExp("^("+Ui.replace(/,/g,"\\b|")+"\\b)"),zi=/\s/g,Bi=/\n/g,Wi=/[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")|new |typeof |void /g,Ji=/"(\d+)"/g,Qi=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/,Gi=/[^\w$\.](?:[A-Za-z_$][\w$]*)/g,Ki=/^(?:true|false)$/,Xi=[],Yi=Object.freeze({parseExpression:Lt,isSimplePath:qt}),Zi=[],tr=[],er={},nr={},ir=!1,rr=!1,or=0;Wt.prototype.addDep=function(t){var e=t.id;this.newDeps[e]||(this.newDeps[e]=t,this.deps[e]||(this.deps[e]=t,t.addSub(this)))},Wt.prototype.get=function(){this.beforeGet();var t,e=this.scope||this.vm;try{t=this.getter.call(e,e)}catch(n){}return this.deep&&Jt(t),this.preProcess&&(t=this.preProcess(t)),this.filters&&(t=e._applyFilters(t,null,this.filters,!1)),this.postProcess&&(t=this.postProcess(t)),this.afterGet(),t},Wt.prototype.set=function(t){var e=this.scope||this.vm;this.filters&&(t=e._applyFilters(t,this.value,this.filters,!0));try{this.setter.call(e,e,t)}catch(n){}var i=e.$forContext;if(i&&i.alias===this.expression){if(i.filters)return;i._withLock(function(){e.$key?i.rawValue[e.$key]=t:i.rawValue.$set(e.$index,t)})}},Wt.prototype.beforeGet=function(){wt.target=this,this.newDeps=Object.create(null)},Wt.prototype.afterGet=function(){wt.target=null;for(var t=Object.keys(this.deps),e=t.length;e--;){var n=t[e];this.newDeps[n]||this.deps[n].removeSub(this)}this.deps=this.newDeps},Wt.prototype.update=function(t){this.lazy?this.dirty=!0:this.sync||!ci.async?this.run():(this.shallow=this.queued?t?this.shallow:!1:!!t,this.queued=!0,Bt(this))},Wt.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||(y(t)||this.deep)&&!this.shallow){var e=this.value;this.value=t;this.prevError;this.cb.call(this.vm,t,e)}this.queued=this.shallow=!1}},Wt.prototype.evaluate=function(){var t=wt.target;this.value=this.get(),this.dirty=!1,wt.target=t},Wt.prototype.depend=function(){for(var t=Object.keys(this.deps),e=t.length;e--;)this.deps[t[e]].depend()},Wt.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||this.vm._vForRemoving||this.vm._watchers.$remove(this);for(var t=Object.keys(this.deps),e=t.length;e--;)this.deps[t[e]].removeSub(this);this.active=!1,this.vm=this.cb=this.value=null}};var sr={bind:function(){var t=this.el;this.vm.$once("pre-hook:compiled",function(){t.removeAttribute("v-cloak")})}},ar={bind:function(){}},ur=700,hr=800,cr=850,lr=1100,fr=1500,pr=1500,dr=1750,vr=2e3,mr=2e3,gr=2100,yr={priority:fr,bind:function(){if(this.arg){var t=this.id=l(this.arg),e=(this._scope||this.vm).$els;r(e,t)?e[t]=this.el:At(e,t,this.el)}},unbind:function(){var t=(this._scope||this.vm).$els;t[this.id]===this.el&&(t[this.id]=null)}},_r=["-webkit-","-moz-","-ms-"],br=["Webkit","Moz","ms"],wr=/!important;?$/,Cr=Object.create(null),xr=null,$r={deep:!0,update:function(t){"string"==typeof t?this.el.style.cssText=t:An(t)?this.handleObject(t.reduce(g,{})):this.handleObject(t||{})},handleObject:function(t){var e,n,i=this.cache||(this.cache={});for(e in i)e in t||(this.handleSingle(e,null),delete i[e]);for(e in t)n=t[e],n!==i[e]&&(i[e]=n,this.handleSingle(e,n))},handleSingle:function(t,e){if(t=Qt(t))if(null!=e&&(e+=""),e){var n=wr.test(e)?"important":"";n&&(e=e.replace(wr,"").trim()),this.el.style.setProperty(t,e,n)}else this.el.style.removeProperty(t)}},kr="http://www.w3.org/1999/xlink",Ar=/^xlink:/,Or=/^v-|^:|^@|^(?:is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/,Tr=/^(?:value|checked|selected|muted)$/,jr={value:"_value","true-value":"_trueValue","false-value":"_falseValue"},Er={priority:cr,bind:function(){var t=this.arg,e=this.el.tagName;t||(this.deep=!0);var n=this.descriptor,i=n.interp;if(i){n.hasOneTime&&(this.expression=R(i,this._scope||this.vm)),(Or.test(t)||"name"===t&&("PARTIAL"===e||"SLOT"===e))&&(this.el.removeAttribute(t),this.invalid=!0)}},update:function(t){if(!this.invalid){var e=this.arg;this.arg?this.handleSingle(e,t):this.handleObject(t||{})}},handleObject:$r.handleObject,handleSingle:function(t,e){var n=this.el,i=this.descriptor.interp;this.modifiers.camel&&(t=l(t)),!i&&Tr.test(t)&&t in n&&(n[t]="value"===t&&null==e?"":e);var r=jr[t];if(!i&&r){n[r]=e;var o=n.__v_model;o&&o.listener()}return"value"===t&&"TEXTAREA"===n.tagName?void n.removeAttribute(t):void(null!=e&&e!==!1?"class"===t?(n.__v_trans&&(e+=" "+n.__v_trans.id+"-transition"),X(n,e)):Ar.test(t)?n.setAttributeNS(kr,t,e===!0?"":e):n.setAttribute(t,e===!0?"":e):n.removeAttribute(t))}},Pr={esc:27,tab:9,enter:13,space:32,"delete":[8,46],up:38,left:37,right:39,down:40},Rr={acceptStatement:!0,priority:ur,bind:function(){if("IFRAME"===this.el.tagName&&"load"!==this.arg){var t=this;this.iframeBind=function(){G(t.el.contentWindow,t.arg,t.handler,t.modifiers.capture)},this.on("load",this.iframeBind)}},update:function(t){if(this.descriptor.raw||(t=function(){}),"function"==typeof t){this.modifiers.stop&&(t=Xt(t)),this.modifiers.prevent&&(t=Yt(t)),this.modifiers.self&&(t=Zt(t));var e=Object.keys(this.modifiers).filter(function(t){return"stop"!==t&&"prevent"!==t});e.length&&(t=Kt(t,e)),this.reset(),this.handler=t,this.iframeBind?this.iframeBind():G(this.el,this.arg,this.handler,this.modifiers.capture)}},reset:function(){var t=this.iframeBind?this.el.contentWindow:this.el;this.handler&&K(t,this.arg,this.handler)},unbind:function(){this.reset()}},Sr={bind:function(){function t(){var t=n.checked;return t&&n.hasOwnProperty("_trueValue")?n._trueValue:!t&&n.hasOwnProperty("_falseValue")?n._falseValue:t}var e=this,n=this.el;this.getValue=function(){return n.hasOwnProperty("_value")?n._value:e.params.number?u(n.value):n.value},this.listener=function(){var i=e._watcher.value;if(An(i)){var r=e.getValue();n.checked?C(i,r)<0&&i.push(r):i.$remove(r)}else e.set(t())},this.on("change",this.listener),n.hasAttribute("checked")&&(this.afterBind=this.listener)},update:function(t){var e=this.el;An(t)?e.checked=C(t,this.getValue())>-1:e.hasOwnProperty("_trueValue")?e.checked=$(t,e._trueValue):e.checked=!!t}},Nr={bind:function(){var t=this,e=this.el;this.forceUpdate=function(){t._watcher&&t.update(t._watcher.get())};var n=this.multiple=e.hasAttribute("multiple");this.listener=function(){var i=te(e,n);i=t.params.number?An(i)?i.map(u):u(i):i,t.set(i)},this.on("change",this.listener);var i=te(e,n,!0);(n&&i.length||!n&&null!==i)&&(this.afterBind=this.listener),this.vm.$on("hook:attached",this.forceUpdate)},update:function(t){var e=this.el;e.selectedIndex=-1;for(var n,i,r=this.multiple&&An(t),o=e.options,s=o.length;s--;)n=o[s],i=n.hasOwnProperty("_value")?n._value:n.value,n.selected=r?ee(t,i)>-1:$(t,i)},unbind:function(){this.vm.$off("hook:attached",this.forceUpdate)}},Fr={bind:function(){var t=this,e=this.el;this.getValue=function(){if(e.hasOwnProperty("_value"))return e._value;var n=e.value;return t.params.number&&(n=u(n)),n},this.listener=function(){t.set(t.getValue())},this.on("change",this.listener),e.hasAttribute("checked")&&(this.afterBind=this.listener)},update:function(t){this.el.checked=$(t,this.getValue())}},Dr={bind:function(){var t=this,e=this.el,n="range"===e.type,i=this.params.lazy,r=this.params.number,o=this.params.debounce,s=!1;if(Pn||n||(this.on("compositionstart",function(){s=!0}),this.on("compositionend",function(){s=!1,i||t.listener()})),this.focused=!1,n||i||(this.on("focus",function(){t.focused=!0}),this.on("blur",function(){t.focused=!1,(!t._frag||t._frag.inserted)&&t.rawListener()})),this.listener=this.rawListener=function(){if(!s&&t._bound){var i=r||n?u(e.value):e.value;t.set(i),Hn(function(){t._bound&&!t.focused&&t.update(t._watcher.value)})}},o&&(this.listener=w(this.listener,o)),this.hasjQuery="function"==typeof jQuery,this.hasjQuery){var a=jQuery.fn.on?"on":"bind";jQuery(e)[a]("change",this.listener),i||jQuery(e)[a]("input",this.listener)}else this.on("change",this.listener),i||this.on("input",this.listener);!i&&En&&(this.on("cut",function(){Hn(t.listener)}),this.on("keyup",function(e){(46===e.keyCode||8===e.keyCode)&&t.listener()})),(e.hasAttribute("value")||"TEXTAREA"===e.tagName&&e.value.trim())&&(this.afterBind=this.listener)},update:function(t){this.el.value=a(t)},unbind:function(){var t=this.el;if(this.hasjQuery){var e=jQuery.fn.off?"off":"unbind";jQuery(t)[e]("change",this.listener),jQuery(t)[e]("input",this.listener)}}},Vr={text:Dr,radio:Fr,select:Nr,checkbox:Sr},Hr={priority:hr,twoWay:!0,handlers:Vr,params:["lazy","number","debounce"],bind:function(){this.checkFilters(),this.hasRead&&!this.hasWrite;var t,e=this.el,n=e.tagName;if("INPUT"===n)t=Vr[e.type]||Vr.text;else if("SELECT"===n)t=Vr.select;else{if("TEXTAREA"!==n)return;t=Vr.text}e.__v_model=this,t.bind.call(this),this.update=t.update,this._unbind=t.unbind},checkFilters:function(){var t=this.filters;if(t)for(var e=t.length;e--;){var n=_t(this.vm.$options,"filters",t[e].name);("function"==typeof n||n.read)&&(this.hasRead=!0),n.write&&(this.hasWrite=!0)}},unbind:function(){this.el.__v_model=null,this._unbind&&this._unbind()}},Mr={bind:function(){var t=this.el.nextElementSibling;t&&null!==q(t,"v-else")&&(this.elseEl=t)},update:function(t){this.apply(this.el,t),this.elseEl&&this.apply(this.elseEl,!t)},apply:function(t,e){function n(){t.style.display=e?"":"none"}L(t)?H(t,e?1:-1,n,this.vm):n()}},Lr=new k(1e3),qr=new k(1e3),Ur={efault:[0,"",""],legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"]};Ur.td=Ur.th=[3,"","
"],Ur.option=Ur.optgroup=[1,'"],Ur.thead=Ur.tbody=Ur.colgroup=Ur.caption=Ur.tfoot=[1,"","
"],Ur.g=Ur.defs=Ur.symbol=Ur.use=Ur.image=Ur.text=Ur.circle=Ur.ellipse=Ur.line=Ur.path=Ur.polygon=Ur.polyline=Ur.rect=[1,'',""];var Ir=/<([\w:]+)/,zr=/&#?\w+?;/,Br=function(){if(Tn){var t=document.createElement("div");return t.innerHTML="",!t.cloneNode(!0).firstChild.innerHTML}return!1}(),Wr=function(){if(Tn){var t=document.createElement("textarea");return t.placeholder="t","t"===t.cloneNode(!0).value}return!1}(),Jr=Object.freeze({cloneNode:oe,parseTemplate:se});ae.prototype.callHook=function(t){var e,n;for(e=0,n=this.childFrags.length;n>e;e++)this.childFrags[e].callHook(t);for(e=0,n=this.children.length;n>e;e++)t(this.children[e])},ae.prototype.beforeRemove=function(){var t,e;for(t=0,e=this.childFrags.length;e>t;t++)this.childFrags[t].beforeRemove(!1);for(t=0, -e=this.children.length;e>t;t++)this.children[t].$destroy(!1,!0);var n=this.unlink.dirs;for(t=0,e=n.length;e>t;t++)n[t]._watcher&&n[t]._watcher.teardown()},ae.prototype.destroy=function(){this.parentFrag&&this.parentFrag.childFrags.$remove(this),this.node.__vfrag__=null,this.unlink()};var Qr=new k(5e3);de.prototype.create=function(t,e,n){var i=oe(this.template);return new ae(this.linker,this.vm,i,t,e,n)};var Gr={priority:mr,bind:function(){var t=this.el;if(t.__vue__)this.invalid=!0;else{var e=t.nextElementSibling;e&&null!==q(e,"v-else")&&(W(e),this.elseFactory=new de(this.vm,e)),this.anchor=rt("v-if"),Q(t,this.anchor),this.factory=new de(this.vm,t)}},update:function(t){this.invalid||(t?this.frag||this.insert():this.remove())},insert:function(){this.elseFrag&&(this.elseFrag.remove(),this.elseFrag=null),this.frag=this.factory.create(this._host,this._scope,this._frag),this.frag.before(this.anchor)},remove:function(){this.frag&&(this.frag.remove(),this.frag=null),this.elseFactory&&!this.elseFrag&&(this.elseFrag=this.elseFactory.create(this._host,this._scope,this._frag),this.elseFrag.before(this.anchor))},unbind:function(){this.frag&&this.frag.destroy(),this.elseFrag&&this.elseFrag.destroy()}},Kr=0,Xr={priority:vr,params:["track-by","stagger","enter-stagger","leave-stagger"],bind:function(){var t=this.expression.match(/(.*) in (.*)/);if(t){var e=t[1].match(/\((.*),(.*)\)/);e?(this.iterator=e[1].trim(),this.alias=e[2].trim()):this.alias=t[1].trim(),this.expression=t[2]}if(this.alias){this.id="__v-for__"+ ++Kr;var n=this.el.tagName;this.isOption=("OPTION"===n||"OPTGROUP"===n)&&"SELECT"===this.el.parentNode.tagName,this.start=rt("v-for-start"),this.end=rt("v-for-end"),Q(this.el,this.end),z(this.start,this.end),this.cache=Object.create(null),this.factory=new de(this.vm,this.el)}},update:function(t){this.diff(t),this.updateRef(),this.updateModel()},diff:function(t){var e,n,i,o,s,a,u=t[0],h=this.fromObject=y(u)&&r(u,"$key")&&r(u,"$value"),c=this.params.trackBy,l=this.frags,f=this.frags=new Array(t.length),p=this.alias,d=this.iterator,v=this.start,m=this.end,g=L(v),_=!l;for(e=0,n=t.length;n>e;e++)u=t[e],o=h?u.$key:null,s=h?u.$value:u,a=!y(s),i=!_&&this.getCachedFrag(s,e,o),i?(i.reused=!0,i.scope.$index=e,o&&(i.scope.$key=o),d&&(i.scope[d]=null!==o?o:e),(c||h||a)&&(i.scope[p]=s)):(i=this.create(s,p,e,o),i.fresh=!_),f[e]=i,_&&i.before(m);if(!_){var b=0,w=l.length-f.length;for(this.vm._vForRemoving=!0,e=0,n=l.length;n>e;e++)i=l[e],i.reused||(this.deleteCachedFrag(i),this.remove(i,b++,w,g));this.vm._vForRemoving=!1,this.vm._watchers=this.vm._watchers.filter(function(t){return t.active});var C,x,$,k=0;for(e=0,n=f.length;n>e;e++)i=f[e],C=f[e-1],x=C?C.staggerCb?C.staggerAnchor:C.end||C.node:v,i.reused&&!i.staggerCb?($=ve(i,v,this.id),$===C||$&&ve($,v,this.id)===C||this.move(i,x)):this.insert(i,k++,x,g),i.reused=i.fresh=!1}},create:function(t,e,n,i){var r=this._host,o=this._scope||this.vm,s=Object.create(o);s.$refs=Object.create(o.$refs),s.$els=Object.create(o.$els),s.$parent=o,s.$forContext=this,At(s,e,t),At(s,"$index",n),i?At(s,"$key",i):s.$key&&b(s,"$key",null),this.iterator&&At(s,this.iterator,null!==i?i:n);var a=this.factory.create(r,s,this._frag);return a.forId=this.id,this.cacheFrag(t,a,n,i),a},updateRef:function(){var t=this.descriptor.ref;if(t){var e,n=(this._scope||this.vm).$refs;this.fromObject?(e={},this.frags.forEach(function(t){e[t.scope.$key]=me(t)})):e=this.frags.map(me),n[t]=e}},updateModel:function(){if(this.isOption){var t=this.start.parentNode,e=t&&t.__v_model;e&&e.forceUpdate()}},insert:function(t,e,n,i){t.staggerCb&&(t.staggerCb.cancel(),t.staggerCb=null);var r=this.getStagger(t,e,null,"enter");if(i&&r){var o=t.staggerAnchor;o||(o=t.staggerAnchor=rt("stagger-anchor"),o.__vfrag__=t),B(o,n);var s=t.staggerCb=x(function(){t.staggerCb=null,t.before(o),W(o)});setTimeout(s,r)}else t.before(n.nextSibling)},remove:function(t,e,n,i){if(t.staggerCb)return t.staggerCb.cancel(),void(t.staggerCb=null);var r=this.getStagger(t,e,n,"leave");if(i&&r){var o=t.staggerCb=x(function(){t.staggerCb=null,t.remove()});setTimeout(o,r)}else t.remove()},move:function(t,e){e.nextSibling||this.end.parentNode.appendChild(this.end),t.before(e.nextSibling,!1)},cacheFrag:function(t,e,n,i){var o,s=this.params.trackBy,a=this.cache,u=!y(t);i||s||u?(o=s?"$index"===s?n:t[s]:i||t,a[o]||(a[o]=e)):(o=this.id,r(t,o)?null===t[o]&&(t[o]=e):b(t,o,e)),e.raw=t},getCachedFrag:function(t,e,n){var i,r=this.params.trackBy,o=!y(t);if(n||r||o){var s=r?"$index"===r?e:t[r]:n||t;i=this.cache[s]}else i=t[this.id];return i&&(i.reused||i.fresh),i},deleteCachedFrag:function(t){var e=t.raw,n=this.params.trackBy,i=t.scope,o=i.$index,s=r(i,"$key")&&i.$key,a=!y(e);if(n||s||a){var u=n?"$index"===n?o:e[n]:s||e;this.cache[u]=null}else e[this.id]=null,t.raw=null},getStagger:function(t,e,n,i){i+="Stagger";var r=t.node.__v_trans,o=r&&r.hooks,s=o&&(o[i]||o.stagger);return s?s.call(t,e,n):e*parseInt(this.params[i]||this.params.stagger,10)},_preProcess:function(t){return this.rawValue=t,t},_postProcess:function(t){if(An(t))return t;if(_(t)){for(var e,n=Object.keys(t),i=n.length,r=new Array(i);i--;)e=n[i],r[i]={$key:e,$value:t[e]};return r}return"number"!=typeof t||isNaN(t)||(t=ge(t)),t||[]},unbind:function(){if(this.descriptor.ref&&((this._scope||this.vm).$refs[this.descriptor.ref]=null),this.frags)for(var t,e=this.frags.length;e--;)t=this.frags[e],this.deleteCachedFrag(t),t.destroy()}},Yr={bind:function(){8===this.el.nodeType&&(this.nodes=[],this.anchor=rt("v-html"),Q(this.el,this.anchor))},update:function(t){t=a(t),this.nodes?this.swap(t):this.el.innerHTML=t},swap:function(t){for(var e=this.nodes.length;e--;)W(this.nodes[e]);var n=se(t,!0,!0);this.nodes=m(n.childNodes),z(n,this.anchor)}},Zr={bind:function(){this.attr=3===this.el.nodeType?"data":"textContent"},update:function(t){this.el[this.attr]=a(t)}},to={text:Zr,html:Yr,"for":Xr,"if":Gr,show:Mr,model:Hr,on:Rr,bind:Er,el:yr,ref:ar,cloak:sr},eo=[],no=!1,io="transition",ro="animation",oo=Rn+"Duration",so=Nn+"Duration",ao=be.prototype;ao.enter=function(t,e){this.cancelPending(),this.callHook("beforeEnter"),this.cb=e,Y(this.el,this.enterClass),t(),this.entered=!1,this.callHookWithCb("enter"),this.entered||(this.cancel=this.hooks&&this.hooks.enterCancelled,ye(this.enterNextTick))},ao.enterNextTick=function(){this.justEntered=!0;var t=this;setTimeout(function(){t.justEntered=!1},17);var e=this.enterDone,n=this.getCssTransitionType(this.enterClass);this.pendingJsCb?n===io&&Z(this.el,this.enterClass):n===io?(Z(this.el,this.enterClass),this.setupCssCb(Sn,e)):n===ro?this.setupCssCb(Fn,e):e()},ao.enterDone=function(){this.entered=!0,this.cancel=this.pendingJsCb=null,Z(this.el,this.enterClass),this.callHook("afterEnter"),this.cb&&this.cb()},ao.leave=function(t,e){this.cancelPending(),this.callHook("beforeLeave"),this.op=t,this.cb=e,Y(this.el,this.leaveClass),this.left=!1,this.callHookWithCb("leave"),this.left||(this.cancel=this.hooks&&this.hooks.leaveCancelled,this.op&&!this.pendingJsCb&&(this.justEntered?this.leaveDone():ye(this.leaveNextTick)))},ao.leaveNextTick=function(){var t=this.getCssTransitionType(this.leaveClass);if(t){var e=t===io?Sn:Fn;this.setupCssCb(e,this.leaveDone)}else this.leaveDone()},ao.leaveDone=function(){this.left=!0,this.cancel=this.pendingJsCb=null,this.op(),Z(this.el,this.leaveClass),this.callHook("afterLeave"),this.cb&&this.cb(),this.op=null},ao.cancelPending=function(){this.op=this.cb=null;var t=!1;this.pendingCssCb&&(t=!0,K(this.el,this.pendingCssEvent,this.pendingCssCb),this.pendingCssEvent=this.pendingCssCb=null),this.pendingJsCb&&(t=!0,this.pendingJsCb.cancel(),this.pendingJsCb=null),t&&(Z(this.el,this.enterClass),Z(this.el,this.leaveClass)),this.cancel&&(this.cancel.call(this.vm,this.el),this.cancel=null)},ao.callHook=function(t){this.hooks&&this.hooks[t]&&this.hooks[t].call(this.vm,this.el)},ao.callHookWithCb=function(t){var e=this.hooks&&this.hooks[t];e&&(e.length>1&&(this.pendingJsCb=x(this[t+"Done"])),e.call(this.vm,this.el,this.pendingJsCb))},ao.getCssTransitionType=function(t){if(!(!Sn||document.hidden||this.hooks&&this.hooks.css===!1||we(this.el))){var e=this.type||this.typeCache[t];if(e)return e;var n=this.el.style,i=window.getComputedStyle(this.el),r=n[oo]||i[oo];if(r&&"0s"!==r)e=io;else{var o=n[so]||i[so];o&&"0s"!==o&&(e=ro)}return e&&(this.typeCache[t]=e),e}},ao.setupCssCb=function(t,e){this.pendingCssEvent=t;var n=this,i=this.el,r=this.pendingCssCb=function(o){o.target===i&&(K(i,t,r),n.pendingCssEvent=n.pendingCssCb=null,!n.pendingJsCb&&e&&e())};G(i,t,r)};var uo={priority:lr,update:function(t,e){var n=this.el,i=_t(this.vm.$options,"transitions",t);t=t||"v",n.__v_trans=new be(n,t,i,this.el.__vue__||this.vm),e&&Z(n,e+"-transition"),Y(n,t+"-transition")}},ho=ci._propBindingModes,co={bind:function(){var t=this.vm,e=t._context,n=this.descriptor.prop,i=n.path,r=n.parentPath,o=n.mode===ho.TWO_WAY,s=this.parentWatcher=new Wt(e,r,function(e){e=ft(n,e),lt(n,e)&&(t[i]=e)},{twoWay:o,filters:n.filters,scope:this._scope});if(ct(t,n,s.value),o){var a=this;t.$once("pre-hook:created",function(){a.childWatcher=new Wt(t,i,function(t){s.set(t)},{sync:!0})})}},unbind:function(){this.parentWatcher.teardown(),this.childWatcher&&this.childWatcher.teardown()}},lo={priority:pr,params:["keep-alive","transition-mode","inline-template"],bind:function(){this.el.__vue__||(this.keepAlive=this.params.keepAlive,this.keepAlive&&(this.cache={}),this.params.inlineTemplate&&(this.inlineTemplate=tt(this.el,!0)),this.pendingComponentCb=this.Component=null,this.pendingRemovals=0,this.pendingRemovalCb=null,this.anchor=rt("v-component"),Q(this.el,this.anchor),this.el.removeAttribute("is"),this.descriptor.ref&&this.el.removeAttribute("v-ref:"+p(this.descriptor.ref)),this.literal&&this.setComponent(this.expression))},update:function(t){this.literal||this.setComponent(t)},setComponent:function(t,e){if(this.invalidatePending(),t){var n=this;this.resolveComponent(t,function(){n.mountComponent(e)})}else this.unbuild(!0),this.remove(this.childVM,e),this.childVM=null},resolveComponent:function(t,e){var n=this;this.pendingComponentCb=x(function(i){n.ComponentName=i.options.name||t,n.Component=i,e()}),this.vm._resolveComponent(t,this.pendingComponentCb)},mountComponent:function(t){this.unbuild(!0);var e=this,n=this.Component.options.activate,i=this.getCached(),r=this.build();n&&!i?(this.waitingFor=r,n.call(r,function(){e.waitingFor===r&&(e.waitingFor=null,e.transition(r,t))})):(i&&r._updateRef(),this.transition(r,t))},invalidatePending:function(){this.pendingComponentCb&&(this.pendingComponentCb.cancel(),this.pendingComponentCb=null)},build:function(t){var e=this.getCached();if(e)return e;if(this.Component){var n={name:this.ComponentName,el:oe(this.el),template:this.inlineTemplate,parent:this._host||this.vm,_linkerCachable:!this.inlineTemplate,_ref:this.descriptor.ref,_asComponent:!0,_isRouterView:this._isRouterView,_context:this.vm,_scope:this._scope,_frag:this._frag};t&&g(n,t);var i=new this.Component(n);return this.keepAlive&&(this.cache[this.Component.cid]=i),i}},getCached:function(){return this.keepAlive&&this.cache[this.Component.cid]},unbuild:function(t){this.waitingFor&&(this.waitingFor.$destroy(),this.waitingFor=null);var e=this.childVM;return!e||this.keepAlive?void(e&&e._updateRef(!0)):void e.$destroy(!1,t)},remove:function(t,e){var n=this.keepAlive;if(t){this.pendingRemovals++,this.pendingRemovalCb=e;var i=this;t.$remove(function(){i.pendingRemovals--,n||t._cleanup(),!i.pendingRemovals&&i.pendingRemovalCb&&(i.pendingRemovalCb(),i.pendingRemovalCb=null)})}else e&&e()},transition:function(t,e){var n=this,i=this.childVM;switch(this.childVM=t,n.params.transitionMode){case"in-out":t.$before(n.anchor,function(){n.remove(i,e)});break;case"out-in":n.remove(i,function(){t.$before(n.anchor,e)});break;default:n.remove(i),t.$before(n.anchor,e)}},unbind:function(){if(this.invalidatePending(),this.unbuild(),this.cache){for(var t in this.cache)this.cache[t].$destroy();this.cache=null}}},fo={deep:!0,update:function(t){t&&"string"==typeof t?this.handleObject(Ce(t)):_(t)?this.handleObject(t):An(t)?this.handleArray(t):this.cleanup()},handleObject:function(t){this.cleanup(t);for(var e=this.prevKeys=Object.keys(t),n=0,i=e.length;i>n;n++){var r=e[n];t[r]?Y(this.el,r):Z(this.el,r)}},handleArray:function(t){this.cleanup(t);for(var e=0,n=t.length;n>e;e++)t[e]&&Y(this.el,t[e]);this.prevKeys=t.slice()},cleanup:function(t){if(this.prevKeys)for(var e=this.prevKeys.length;e--;){var n=this.prevKeys[e];!n||t&&xe(t,n)||Z(this.el,n)}}},po={style:$r,"class":fo,component:lo,prop:co,transition:uo},vo=ci._propBindingModes,mo={},go=/^[$_a-zA-Z]+[\w$]*$/,yo=/^v-bind:|^:/,_o=/^v-on:|^@/,bo=/^v-([^:]+)(?:$|:(.*)$)/,wo=/\.[^\.]+/g,Co=/^(v-bind:|:)?transition$/,xo=["for","if"],$o=1e3;Be.terminal=!0;var ko=/[^\w\-:\.]/,Ao=Object.freeze({compile:Oe,compileAndLinkProps:Re,compileRoot:Se,terminalDirectives:xo,transclude:Xe}),Oo=/^v-on:|^@/;on.prototype._bind=function(){var t=this.name,e=this.descriptor;if(("cloak"!==t||this.vm._isCompiled)&&this.el&&this.el.removeAttribute){var n=e.attr||"v-"+t;this.el.removeAttribute(n)}var i=e.def;if("function"==typeof i?this.update=i:g(this,i),this._setupParams(),this.bind&&this.bind(),this._bound=!0,this.literal)this.update&&this.update(e.raw);else if((this.expression||this.modifiers)&&(this.update||this.twoWay)&&!this._checkStatement()){var r=this;this.update?this._update=function(t,e){r._locked||r.update(t,e)}:this._update=rn;var o=this._preProcess?v(this._preProcess,this):null,s=this._postProcess?v(this._postProcess,this):null,a=this._watcher=new Wt(this.vm,this.expression,this._update,{filters:this.filters,twoWay:this.twoWay,deep:this.deep,preProcess:o,postProcess:s,scope:this._scope});this.afterBind?this.afterBind():this.update&&this.update(a.value)}},on.prototype._setupParams=function(){if(this.params){var t=this.params;this.params=Object.create(null);for(var e,n,i,r=t.length;r--;)e=t[r],i=l(e),n=U(this.el,e),null!=n?this._setupParamWatcher(i,n):(n=q(this.el,e),null!=n&&(this.params[i]=""===n?!0:n))}},on.prototype._setupParamWatcher=function(t,e){var n=this,i=!1,r=(this._scope||this.vm).$watch(e,function(e,r){if(n.params[t]=e,i){var o=n.paramWatchers&&n.paramWatchers[t];o&&o.call(n,e,r)}else i=!0},{immediate:!0,user:!1});(this._paramUnwatchFns||(this._paramUnwatchFns=[])).push(r)},on.prototype._checkStatement=function(){var t=this.expression;if(t&&this.acceptStatement&&!qt(t)){var e=Lt(t).get,n=this._scope||this.vm,i=function(t){n.$event=t,e.call(n,n),n.$event=null};return this.filters&&(i=n._applyFilters(i,null,this.filters)),this.update(i),!0}},on.prototype.set=function(t){this.twoWay&&this._withLock(function(){this._watcher.set(t)})},on.prototype._withLock=function(t){var e=this;e._locked=!0,t.call(e),Hn(function(){e._locked=!1})},on.prototype.on=function(t,e,n){G(this.el,t,e,n),(this._listeners||(this._listeners=[])).push([t,e])},on.prototype._teardown=function(){if(this._bound){this._bound=!1,this.unbind&&this.unbind(),this._watcher&&this._watcher.teardown();var t,e=this._listeners;if(e)for(t=e.length;t--;)K(this.el,e[t][0],e[t][1]);var n=this._paramUnwatchFns;if(n)for(t=n.length;t--;)n[t]();this.vm=this.el=this._watcher=this._listeners=null}};var To=/[^|]\|[^|]/;Ot(pn),en(pn),nn(pn),sn(pn),an(pn),un(pn),hn(pn),cn(pn),ln(pn),fn(pn);var jo=Xr._postProcess,Eo=/(\d{3})(?=\d)/g,Po={orderBy:mn,filterBy:vn,limitBy:dn,json:{read:function(t,e){return"string"==typeof t?t:JSON.stringify(t,null,Number(e)||2)},write:function(t){try{return JSON.parse(t)}catch(e){return t}}},capitalize:function(t){return t||0===t?(t=t.toString(),t.charAt(0).toUpperCase()+t.slice(1)):""},uppercase:function(t){return t||0===t?t.toString().toUpperCase():""},lowercase:function(t){return t||0===t?t.toString().toLowerCase():""},currency:function(t,e){if(t=parseFloat(t),!isFinite(t)||!t&&0!==t)return"";e=null!=e?e:"$";var n=Math.abs(t).toFixed(2),i=n.slice(0,-3),r=i.length%3,o=r>0?i.slice(0,r)+(i.length>3?",":""):"",s=n.slice(-3),a=0>t?"-":"";return e+a+o+i.slice(r).replace(Eo,"$1,")+s},pluralize:function(t){var e=m(arguments,1);return e.length>1?e[t%10-1]||e[e.length-1]:e[0]+(1===t?"":"s")},debounce:function(t,e){return t?(e||(e=300),w(t,e)):void 0}},Ro={priority:dr,params:["name"],paramWatchers:{name:function(t){Gr.remove.call(this),t&&this.insert(t)}},bind:function(){this.anchor=rt("v-partial"),Q(this.el,this.anchor),this.insert(this.params.name)},insert:function(t){var e=_t(this.vm.$options,"partials",t);e&&(this.factory=new de(this.vm,e),Gr.insert.call(this))},unbind:function(){this.frag&&this.frag.destroy()}},So={priority:gr,bind:function(){var t=this.vm,e=t.$options._content;if(!e)return void this.fallback();var n=t._context,i=this.params&&this.params.name;if(i){var r='[slot="'+i+'"]',o=e.querySelectorAll(r);o.length?this.tryCompile(yn(o,e),n,t):this.fallback()}else this.tryCompile(yn(e.childNodes,e,!0),n,t)},tryCompile:function(t,e,n){t.hasChildNodes()?this.compile(t,e,n):this.fallback()},compile:function(t,e,n){if(t&&e){if(this.el.hasChildNodes()&&1===t.childNodes.length&&1===t.childNodes[0].nodeType&&t.childNodes[0].hasAttribute("v-if")){var i=document.createElement("template");i.setAttribute("v-else",""),i.innerHTML=this.el.innerHTML,t.appendChild(i)}var r=n?n._scope:this._scope;this.unlink=e.$compile(t,n,r,this._frag)}t?Q(this.el,t):W(this.el)},fallback:function(){this.compile(tt(this.el,!0),this.vm)},unbind:function(){this.unlink&&this.unlink()}},No=g(g({},So),{priority:So.priority+1,params:["name"]}),Fo={slot:So,_namedSlot:No,partial:Ro};pn.version="1.0.16",pn.options={directives:to,elementDirectives:Fo,filters:Po,transitions:{},components:{},partials:{},replace:!0},jn&&jn.emit("init",pn),e.exports=pn}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(t,e,n){var i=n.cache={};n.insert=function(t){if(!i[t]){i[t]=!0;var e=document.createElement("style");return e.setAttribute("type","text/css"),"textContent"in e?e.textContent=t:e.styleSheet.cssText=t,document.getElementsByTagName("head")[0].appendChild(e),e}}},{}],28:[function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}var o=t("vue"),s=i(o),a=t("vue-router"),u=i(a),h=t("./posts.vue"),c=i(h),l=t("./post.vue"),f=i(l),p=t("./page.vue"),d=i(p),v=t("./theme-header.vue"),m=i(v),g=t("./theme-footer.vue"),y=i(g);s["default"].use(t("vue-resource")),s["default"].use(u["default"]),s["default"].config.debug=!0,s["default"].component("Post",f["default"]),s["default"].component("Page",d["default"]),s["default"].component("theme-header",m["default"]),s["default"].component("theme-footer",y["default"]);var _=s["default"].extend({template:'
',ready:function(){this.updateTitle("")},methods:{updateTitle:function(t){document.title=(t?t+" - ":"")+wp.site_name}},events:{"page-title":function(t){this.updateTitle(t)}}}),b=new u["default"]({hashbang:!1,history:!0});b.on(wp.base_path,{component:c["default"]});for(var w in wp.routes){var C=wp.routes[w];b.on(wp.base_path+C.slug,{component:s["default"].component(r(C.type)),postId:C.id})}b.start(_,"#app")},{"./page.vue":29,"./post.vue":30,"./posts.vue":31,"./theme-footer.vue":32,"./theme-header.vue":33,vue:26,"vue-resource":14,"vue-router":25}],29:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={ready:function(){this.getPage()},data:function(){return{page:{id:0,slug:"",title:{rendered:""},content:{rendered:""}}}},methods:{getPage:function(){this.$http.get(wp.root+"wp/v2/pages/"+this.$route.postId).then(function(t){this.page=t.data,this.$dispatch("page-title",this.page.title.rendered)},function(t){console.log(t)})}},route:{canReuse:function(){return!1}}},e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template="

{{ page.title.rendered }}

{{{ page.content.rendered }}}
"},{}],30:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={props:{post:{type:Object,"default":function(){return{id:0,slug:"",title:{rendered:""},content:{rendered:""}}}}},ready:function(){this.post.id||(this.getPost(),this.isSingle=!0)},data:function(){return{base_path:wp.base_path,isSingle:!1}},methods:{getPost:function(){this.$http.get(wp.root+"wp/v2/posts/"+this.$route.postId).then(function(t){this.post=t.data,this.$dispatch("page-title",this.post.title.rendered)},function(t){console.log(t)})}}},e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template='

{{ post.title.rendered }}

{{ post.title.rendered }}

{{{ post.content.rendered }}}
'},{}],31:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={ready:function(){this.getPosts()},data:function(){return{posts:[]}},methods:{getPosts:function(){this.$http.get(wp.root+"wp/v2/posts").then(function(t){this.posts=t.data,this.$dispatch("page-title","")},function(t){console.log(t)})}}},e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template='
'},{}],32:[function(t,e,n){t("vueify-insert-css").insert(".footer{font-size:14px;color:#999;margin-top:50px}");Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={data:function(){return{base_path:wp.base_path,site_name:wp.site_name}}},e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template=''},{"vueify-insert-css":27}],33:[function(t,e,n){t("vueify-insert-css").insert(".header{box-shadow:0 1px 1px rgba(0,0,0,.1);margin-bottom:50px}.header .container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.header .site-title{width:50%}.header .nav{list-style:none;margin:0;padding:0;width:50%;text-align:right}.header .nav li{display:inline;margin-left:15px}.header .v-link-active{color:#333}");Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={ready:function(){this.getPages()},data:function(){return{base_path:wp.base_path,site_name:wp.site_name,pages:[]}},methods:{getPages:function(){this.$http.get(wp.root+"wp/v2/pages").then(function(t){this.pages=t.data},function(t){console.log(t)})}}},e.exports.__esModule&&(e.exports=e.exports["default"]),("function"==typeof e.exports?e.exports.options:e.exports).template='
'},{"vueify-insert-css":27}]},{},[28]); +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o bytes) { end = bytes; } + + if (start >= bytes || start >= end || bytes === 0) { + return new ArrayBuffer(0); + } + + var abv = new Uint8Array(arraybuffer); + var result = new Uint8Array(end - start); + for (var i = start, ii = 0; i < end; i++, ii++) { + result[ii] = abv[i]; + } + return result.buffer; +}; + +}).apply(this, arguments); + +},{}],4:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/backo2/index.js", module); +(function(){ + +/** + * Expose `Backoff`. + */ + +module.exports = Backoff; + +/** + * Initialize backoff timer with `opts`. + * + * - `min` initial timeout in milliseconds [100] + * - `max` max timeout [10000] + * - `jitter` [0] + * - `factor` [2] + * + * @param {Object} opts + * @api public + */ + +function Backoff(opts) { + opts = opts || {}; + this.ms = opts.min || 100; + this.max = opts.max || 10000; + this.factor = opts.factor || 2; + this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0; + this.attempts = 0; +} + +/** + * Return the backoff duration. + * + * @return {Number} + * @api public + */ + +Backoff.prototype.duration = function(){ + var ms = this.ms * Math.pow(this.factor, this.attempts++); + if (this.jitter) { + var rand = Math.random(); + var deviation = Math.floor(rand * this.jitter * ms); + ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation; + } + return Math.min(ms, this.max) | 0; +}; + +/** + * Reset the number of attempts. + * + * @api public + */ + +Backoff.prototype.reset = function(){ + this.attempts = 0; +}; + +/** + * Set the minimum duration + * + * @api public + */ + +Backoff.prototype.setMin = function(min){ + this.ms = min; +}; + +/** + * Set the maximum duration + * + * @api public + */ + +Backoff.prototype.setMax = function(max){ + this.max = max; +}; + +/** + * Set the jitter + * + * @api public + */ + +Backoff.prototype.setJitter = function(jitter){ + this.jitter = jitter; +}; + + +}).apply(this, arguments); + +},{}],5:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/base64-arraybuffer/lib/base64-arraybuffer.js", module); +(function(){ +/* + * base64-arraybuffer + * https://github.com/niklasvh/base64-arraybuffer + * + * Copyright (c) 2012 Niklas von Hertzen + * Licensed under the MIT license. + */ +(function(chars){ + "use strict"; + + exports.encode = function(arraybuffer) { + var bytes = new Uint8Array(arraybuffer), + i, len = bytes.length, base64 = ""; + + for (i = 0; i < len; i+=3) { + base64 += chars[bytes[i] >> 2]; + base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)]; + base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)]; + base64 += chars[bytes[i + 2] & 63]; + } + + if ((len % 3) === 2) { + base64 = base64.substring(0, base64.length - 1) + "="; + } else if (len % 3 === 1) { + base64 = base64.substring(0, base64.length - 2) + "=="; + } + + return base64; + }; + + exports.decode = function(base64) { + var bufferLength = base64.length * 0.75, + len = base64.length, i, p = 0, + encoded1, encoded2, encoded3, encoded4; + + if (base64[base64.length - 1] === "=") { + bufferLength--; + if (base64[base64.length - 2] === "=") { + bufferLength--; + } + } + + var arraybuffer = new ArrayBuffer(bufferLength), + bytes = new Uint8Array(arraybuffer); + + for (i = 0; i < len; i+=4) { + encoded1 = chars.indexOf(base64[i]); + encoded2 = chars.indexOf(base64[i+1]); + encoded3 = chars.indexOf(base64[i+2]); + encoded4 = chars.indexOf(base64[i+3]); + + bytes[p++] = (encoded1 << 2) | (encoded2 >> 4); + bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2); + bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63); + } + + return arraybuffer; + }; +})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"); + +}).apply(this, arguments); + +},{}],6:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/blob/index.js", module); +(function(){ +(function (global){ +/** + * Create a blob builder even when vendor prefixes exist + */ + +var BlobBuilder = global.BlobBuilder + || global.WebKitBlobBuilder + || global.MSBlobBuilder + || global.MozBlobBuilder; + +/** + * Check if Blob constructor is supported + */ + +var blobSupported = (function() { + try { + var a = new Blob(['hi']); + return a.size === 2; + } catch(e) { + return false; + } +})(); + +/** + * Check if Blob constructor supports ArrayBufferViews + * Fails in Safari 6, so we need to map to ArrayBuffers there. + */ + +var blobSupportsArrayBufferView = blobSupported && (function() { + try { + var b = new Blob([new Uint8Array([1,2])]); + return b.size === 2; + } catch(e) { + return false; + } +})(); + +/** + * Check if BlobBuilder is supported + */ + +var blobBuilderSupported = BlobBuilder + && BlobBuilder.prototype.append + && BlobBuilder.prototype.getBlob; + +/** + * Helper function that maps ArrayBufferViews to ArrayBuffers + * Used by BlobBuilder constructor and old browsers that didn't + * support it in the Blob constructor. + */ + +function mapArrayBufferViews(ary) { + for (var i = 0; i < ary.length; i++) { + var chunk = ary[i]; + if (chunk.buffer instanceof ArrayBuffer) { + var buf = chunk.buffer; + + // if this is a subarray, make a copy so we only + // include the subarray region from the underlying buffer + if (chunk.byteLength !== buf.byteLength) { + var copy = new Uint8Array(chunk.byteLength); + copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); + buf = copy.buffer; + } + + ary[i] = buf; + } + } +} + +function BlobBuilderConstructor(ary, options) { + options = options || {}; + + var bb = new BlobBuilder(); + mapArrayBufferViews(ary); + + for (var i = 0; i < ary.length; i++) { + bb.append(ary[i]); + } + + return (options.type) ? bb.getBlob(options.type) : bb.getBlob(); +}; + +function BlobConstructor(ary, options) { + mapArrayBufferViews(ary); + return new Blob(ary, options || {}); +}; + +module.exports = (function() { + if (blobSupported) { + return blobSupportsArrayBufferView ? global.Blob : BlobConstructor; + } else if (blobBuilderSupported) { + return BlobBuilderConstructor; + } else { + return undefined; + } +})(); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +}).apply(this, arguments); + +},{}],7:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/browser-resolve/empty.js", module); +(function(){ + +}).apply(this, arguments); + +},{}],8:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/browserify-hmr/inc/index.js", module); +(function(){ +(function (global){ +'use strict'; + +var has = require('../lib/has'); +var StrSet = require('../lib/str-set'); +var forEach = require('lodash/forEach'); +var some = require('lodash/some'); +var map = require('lodash/map'); +var filter = require('lodash/filter'); +var zipObject = require('lodash/zipObject'); +var forOwn = require('lodash/forOwn'); +var mapValues = require('lodash/mapValues'); +var assign = require('lodash/assign'); + +function emitError(err) { + setTimeout(function() { + throw err; + }, 0); +} + +function makeModuleIndexesToNames(moduleMeta) { + var moduleIndexesToNames = {}; + forOwn(moduleMeta, function(value, name) { + moduleIndexesToNames[value.index] = name; + }); + return moduleIndexesToNames; +} + +var console = global.console ? global.console : { + error: function(){}, log: function() {} +}; + +function main( + moduleDefs, cachedModules, moduleMeta, updateUrl, + updateMode, supportModes, ignoreUnaccepted, updateCacheBust, bundleKey, + socketio, + bundle__filename, bundle__dirname +) { + var moduleIndexesToNames = makeModuleIndexesToNames(moduleMeta); + + var socket; + var name, i, len; + + if (!global._hmr[bundleKey].setStatus) { + var runtimeModuleInfo = {}; + var createInfoEntry = function(name) { + runtimeModuleInfo[name] = { + index: moduleMeta[name].index, + hash: moduleMeta[name].hash, + parents: new StrSet(moduleMeta[name].parents), + module: null, + disposeData: null, + accepters: new StrSet(), + accepting: new StrSet(), + decliners: new StrSet(), + declining: new StrSet(), + selfAcceptCbs: [], // may contain null. nonzero length means module is self-accepting + disposeHandlers: [] + }; + }; + for (name in moduleMeta) { + if (has(moduleMeta, name)) { + createInfoEntry(name); + } + } + + // loaders take a callback(err, data). They may give null for data if they + // know there hasn't been an update. + var fileReloaders = { + fs: function(cb) { + var fs; + try { + fs = require('f'+'s'); + } catch(e) { + cb(e); + return; + } + fs.readFile(localHmr.updateUrl || bundle__filename, 'utf8', cb); + }, + ajax: function(cb) { + var xhr; + try { + xhr = new XMLHttpRequest(); + } catch(e) { + cb(e); + return; + } + xhr.onreadystatechange = function() { + if (xhr.readyState === 4) { + if (xhr.status === 200) { + cb(null, xhr.responseText); + } else { + cb(new Error("Request had response "+xhr.status)); + } + } + }; + var url = localHmr.updateUrl + (updateCacheBust?'?_v='+(+new Date()):''); + xhr.open('GET', url, true); + xhr.send(); + } + }; + + var lastScriptData = null; + + // cb(err, expectUpdate) + var reloadAndRunScript = function(cb) { + if (!has(fileReloaders, localHmr.updateMode)) { + cb(new Error("updateMode "+localHmr.updateMode+" not implemented")); + return; + } + var reloader = fileReloaders[localHmr.updateMode]; + reloader(function(err, data) { + if (err || !data || lastScriptData === data) { + cb(err, false); + return; + } + lastScriptData = data; + localHmr.newLoad = null; + try { + //jshint evil:true + if (bundle__filename || bundle__dirname) { + new Function('require', '__filename', '__dirname', data)(require, bundle__filename, bundle__dirname); + } else { + new Function('require', data)(require); + } + // running the file sets _hmr.newLoad + } catch (err2) { + localHmr.newLoad = null; + cb(err2); + return; + } + if (!localHmr.newLoad) { + cb(new Error("Reloaded script did not set hot module reload data")); + return; + } + cb(null, true); + }); + }; + + var getOutdatedModules = function() { + var outdated = []; + var name; + // add changed and deleted modules + for (name in runtimeModuleInfo) { + if (has(runtimeModuleInfo, name)) { + if ( + !has(localHmr.newLoad.moduleMeta, name) || + runtimeModuleInfo[name].hash !== localHmr.newLoad.moduleMeta[name].hash + ) { + outdated.push(name); + } + } + } + // add brand new modules + for (name in localHmr.newLoad.moduleMeta) { + if (has(localHmr.newLoad.moduleMeta, name)) { + if (!has(runtimeModuleInfo, name)) { + outdated.push(name); + } + } + } + // add modules that are non-accepting/declining parents of outdated modules. + // important: if outdated has new elements added during the loop, + // then we iterate over them too. + for (var i=0; i= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} + +}).apply(this, arguments); + +},{"./debug":15}],15:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/debug/debug.js", module); +(function(){ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} + +}).apply(this, arguments); + +},{"ms":169}],16:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/engine.io-client/index.js", module); +(function(){ + +module.exports = require('./lib/'); + +}).apply(this, arguments); + +},{"./lib/":17}],17:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/engine.io-client/lib/index.js", module); +(function(){ + +module.exports = require('./socket'); + +/** + * Exports parser + * + * @api public + * + */ +module.exports.parser = require('engine.io-parser'); + +}).apply(this, arguments); + +},{"./socket":18,"engine.io-parser":26}],18:[function(require,module,exports){ +_hmr["websocket:null"].initModule("node_modules/engine.io-client/lib/socket.js", module); +(function(){ +(function (global){ +/** + * Module dependencies. + */ + +var transports = require('./transports'); +var Emitter = require('component-emitter'); +var debug = require('debug')('engine.io-client:socket'); +var index = require('indexof'); +var parser = require('engine.io-parser'); +var parseuri = require('parseuri'); +var parsejson = require('parsejson'); +var parseqs = require('parseqs'); + +/** + * Module exports. + */ + +module.exports = Socket; + +/** + * Noop function. + * + * @api private + */ + +function noop(){} + +/** + * Socket constructor. + * + * @param {String|Object} uri or options + * @param {Object} options + * @api public + */ + +function Socket(uri, opts){ + if (!(this instanceof Socket)) return new Socket(uri, opts); + + opts = opts || {}; + + if (uri && 'object' == typeof uri) { + opts = uri; + uri = null; + } + + if (uri) { + uri = parseuri(uri); + opts.hostname = uri.host; + opts.secure = uri.protocol == 'https' || uri.protocol == 'wss'; + opts.port = uri.port; + if (uri.query) opts.query = uri.query; + } else if (opts.host) { + opts.hostname = parseuri(opts.host).host; + } + + this.secure = null != opts.secure ? opts.secure : + (global.location && 'https:' == location.protocol); + + if (opts.hostname && !opts.port) { + // if no port is specified manually, use the protocol default + opts.port = this.secure ? '443' : '80'; + } + + this.agent = opts.agent || false; + this.hostname = opts.hostname || + (global.location ? location.hostname : 'localhost'); + this.port = opts.port || (global.location && location.port ? + location.port : + (this.secure ? 443 : 80)); + this.query = opts.query || {}; + if ('string' == typeof this.query) this.query = parseqs.decode(this.query); + this.upgrade = false !== opts.upgrade; + this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/'; + this.forceJSONP = !!opts.forceJSONP; + this.jsonp = false !== opts.jsonp; + this.forceBase64 = !!opts.forceBase64; + this.enablesXDR = !!opts.enablesXDR; + this.timestampParam = opts.timestampParam || 't'; + this.timestampRequests = opts.timestampRequests; + this.transports = opts.transports || ['polling', 'websocket']; + this.readyState = ''; + this.writeBuffer = []; + this.policyPort = opts.policyPort || 843; + this.rememberUpgrade = opts.rememberUpgrade || false; + this.binaryType = null; + this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades; + this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false; + + if (true === this.perMessageDeflate) this.perMessageDeflate = {}; + if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) { + this.perMessageDeflate.threshold = 1024; + } + + // SSL options for Node.js client + this.pfx = opts.pfx || null; + this.key = opts.key || null; + this.passphrase = opts.passphrase || null; + this.cert = opts.cert || null; + this.ca = opts.ca || null; + this.ciphers = opts.ciphers || null; + this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized; + + // other options for Node.js client + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal) { + if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) { + this.extraHeaders = opts.extraHeaders; + } + } + + this.open(); +} + +Socket.priorWebsocketSuccess = false; + +/** + * Mix in `Emitter`. + */ + +Emitter(Socket.prototype); + +/** + * Protocol version. + * + * @api public + */ + +Socket.protocol = parser.protocol; // this is an int + +/** + * Expose deps for legacy compatibility + * and standalone browser access. + */ + +Socket.Socket = Socket; +Socket.Transport = require('./transport'); +Socket.transports = require('./transports'); +Socket.parser = require('engine.io-parser'); + +/** + * Creates transport of the given type. + * + * @param {String} transport name + * @return {Transport} + * @api private + */ + +Socket.prototype.createTransport = function (name) { + debug('creating transport "%s"', name); + var query = clone(this.query); + + // append engine.io protocol identifier + query.EIO = parser.protocol; + + // transport name + query.transport = name; + + // session id if we already have one + if (this.id) query.sid = this.id; + + var transport = new transports[name]({ + agent: this.agent, + hostname: this.hostname, + port: this.port, + secure: this.secure, + path: this.path, + query: query, + forceJSONP: this.forceJSONP, + jsonp: this.jsonp, + forceBase64: this.forceBase64, + enablesXDR: this.enablesXDR, + timestampRequests: this.timestampRequests, + timestampParam: this.timestampParam, + policyPort: this.policyPort, + socket: this, + pfx: this.pfx, + key: this.key, + passphrase: this.passphrase, + cert: this.cert, + ca: this.ca, + ciphers: this.ciphers, + rejectUnauthorized: this.rejectUnauthorized, + perMessageDeflate: this.perMessageDeflate, + extraHeaders: this.extraHeaders + }); + + return transport; +}; + +function clone (obj) { + var o = {}; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + o[i] = obj[i]; + } + } + return o; +} + +/** + * Initializes transport to use and starts probe. + * + * @api private + */ +Socket.prototype.open = function () { + var transport; + if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) { + transport = 'websocket'; + } else if (0 === this.transports.length) { + // Emit error on next tick so it can be listened to + var self = this; + setTimeout(function() { + self.emit('error', 'No transports available'); + }, 0); + return; + } else { + transport = this.transports[0]; + } + this.readyState = 'opening'; + + // Retry with the next transport if the transport is disabled (jsonp: false) + try { + transport = this.createTransport(transport); + } catch (e) { + this.transports.shift(); + this.open(); + return; + } + + transport.open(); + this.setTransport(transport); +}; + +/** + * Sets the current transport. Disables the existing one (if any). + * + * @api private + */ + +Socket.prototype.setTransport = function(transport){ + debug('setting transport %s', transport.name); + var self = this; + + if (this.transport) { + debug('clearing existing transport %s', this.transport.name); + this.transport.removeAllListeners(); + } + + // set up transport + this.transport = transport; + + // set up transport listeners + transport + .on('drain', function(){ + self.onDrain(); + }) + .on('packet', function(packet){ + self.onPacket(packet); + }) + .on('error', function(e){ + self.onError(e); + }) + .on('close', function(){ + self.onClose('transport close'); + }); +}; + +/** + * Probes a transport. + * + * @param {String} transport name + * @api private + */ + +Socket.prototype.probe = function (name) { + debug('probing transport "%s"', name); + var transport = this.createTransport(name, { probe: 1 }) + , failed = false + , self = this; + + Socket.priorWebsocketSuccess = false; + + function onTransportOpen(){ + if (self.onlyBinaryUpgrades) { + var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary; + failed = failed || upgradeLosesBinary; + } + if (failed) return; + + debug('probe transport "%s" opened', name); + transport.send([{ type: 'ping', data: 'probe' }]); + transport.once('packet', function (msg) { + if (failed) return; + if ('pong' == msg.type && 'probe' == msg.data) { + debug('probe transport "%s" pong', name); + self.upgrading = true; + self.emit('upgrading', transport); + if (!transport) return; + Socket.priorWebsocketSuccess = 'websocket' == transport.name; + + debug('pausing current transport "%s"', self.transport.name); + self.transport.pause(function () { + if (failed) return; + if ('closed' == self.readyState) return; + debug('changing transport and sending upgrade packet'); + + cleanup(); + + self.setTransport(transport); + transport.send([{ type: 'upgrade' }]); + self.emit('upgrade', transport); + transport = null; + self.upgrading = false; + self.flush(); + }); + } else { + debug('probe transport "%s" failed', name); + var err = new Error('probe error'); + err.transport = transport.name; + self.emit('upgradeError', err); + } + }); + } + + function freezeTransport() { + if (failed) return; + + // Any callback called by transport should be ignored since now + failed = true; + + cleanup(); + + transport.close(); + transport = null; + } + + //Handle any error that happens while probing + function onerror(err) { + var error = new Error('probe error: ' + err); + error.transport = transport.name; + + freezeTransport(); + + debug('probe transport "%s" failed because of error: %s', name, err); + + self.emit('upgradeError', error); + } + + function onTransportClose(){ + onerror("transport closed"); + } + + //When the socket is closed while we're probing + function onclose(){ + onerror("socket closed"); + } + + //When the socket is upgraded while we're probing + function onupgrade(to){ + if (transport && to.name != transport.name) { + debug('"%s" works - aborting "%s"', to.name, transport.name); + freezeTransport(); + } + } + + //Remove all listeners on the transport and on self + function cleanup(){ + transport.removeListener('open', onTransportOpen); + transport.removeListener('error', onerror); + transport.removeListener('close', onTransportClose); + self.removeListener('close', onclose); + self.removeListener('upgrading', onupgrade); + } + + transport.once('open', onTransportOpen); + transport.once('error', onerror); + transport.once('close', onTransportClose); + + this.once('close', onclose); + this.once('upgrading', onupgrade); + + transport.open(); + +}; + +/** + * Called when connection is deemed open. + * + * @api public + */ + +Socket.prototype.onOpen = function () { + debug('socket open'); + this.readyState = 'open'; + Socket.priorWebsocketSuccess = 'websocket' == this.transport.name; + this.emit('open'); + this.flush(); + + // we check for `readyState` in case an `open` + // listener already closed the socket + if ('open' == this.readyState && this.upgrade && this.transport.pause) { + debug('starting upgrade probes'); + for (var i = 0, l = this.upgrades.length; i < l; i++) { + this.probe(this.upgrades[i]); + } + } +}; + +/** + * Handles a packet. + * + * @api private + */ + +Socket.prototype.onPacket = function (packet) { + if ('opening' == this.readyState || 'open' == this.readyState) { + debug('socket receive: type "%s", data "%s"', packet.type, packet.data); + + this.emit('packet', packet); + + // Socket is live - any packet counts + this.emit('heartbeat'); + + switch (packet.type) { + case 'open': + this.onHandshake(parsejson(packet.data)); + break; + + case 'pong': + this.setPing(); + this.emit('pong'); + break; + + case 'error': + var err = new Error('server error'); + err.code = packet.data; + this.onError(err); + break; + + case 'message': + this.emit('data', packet.data); + this.emit('message', packet.data); + break; + } + } else { + debug('packet received with socket readyState "%s"', this.readyState); + } +}; + +/** + * Called upon handshake completion. + * + * @param {Object} handshake obj + * @api private + */ + +Socket.prototype.onHandshake = function (data) { + this.emit('handshake', data); + this.id = data.sid; + this.transport.query.sid = data.sid; + this.upgrades = this.filterUpgrades(data.upgrades); + this.pingInterval = data.pingInterval; + this.pingTimeout = data.pingTimeout; + this.onOpen(); + // In case open handler closes socket + if ('closed' == this.readyState) return; + this.setPing(); + + // Prolong liveness of socket on heartbeat + this.removeListener('heartbeat', this.onHeartbeat); + this.on('heartbeat', this.onHeartbeat); +}; + +/** + * Resets ping timeout. + * + * @api private + */ + +Socket.prototype.onHeartbeat = function (timeout) { + clearTimeout(this.pingTimeoutTimer); + var self = this; + self.pingTimeoutTimer = setTimeout(function () { + if ('closed' == self.readyState) return; + self.onClose('ping timeout'); + }, timeout || (self.pingInterval + self.pingTimeout)); +}; + +/** + * Pings server every `this.pingInterval` and expects response + * within `this.pingTimeout` or closes connection. + * + * @api private + */ + +Socket.prototype.setPing = function () { + var self = this; + clearTimeout(self.pingIntervalTimer); + self.pingIntervalTimer = setTimeout(function () { + debug('writing ping packet - expecting pong within %sms', self.pingTimeout); + self.ping(); + self.onHeartbeat(self.pingTimeout); + }, self.pingInterval); +}; + +/** +* Sends a ping packet. +* +* @api private +*/ + +Socket.prototype.ping = function () { + var self = this; + this.sendPacket('ping', function(){ + self.emit('ping'); + }); +}; + +/** + * Called on `drain` event + * + * @api private + */ + +Socket.prototype.onDrain = function() { + this.writeBuffer.splice(0, this.prevBufferLen); + + // setting prevBufferLen = 0 is very important + // for example, when upgrading, upgrade packet is sent over, + // and a nonzero prevBufferLen could cause problems on `drain` + this.prevBufferLen = 0; + + if (0 === this.writeBuffer.length) { + this.emit('drain'); + } else { + this.flush(); + } +}; + +/** + * Flush write buffers. + * + * @api private + */ + +Socket.prototype.flush = function () { + if ('closed' != this.readyState && this.transport.writable && + !this.upgrading && this.writeBuffer.length) { + debug('flushing %d packets in socket', this.writeBuffer.length); + this.transport.send(this.writeBuffer); + // keep track of current length of writeBuffer + // splice writeBuffer and callbackBuffer on `drain` + this.prevBufferLen = this.writeBuffer.length; + this.emit('flush'); + } +}; + +/** + * Sends a message. + * + * @param {String} message. + * @param {Function} callback function. + * @param {Object} options. + * @return {Socket} for chaining. + * @api public + */ + +Socket.prototype.write = +Socket.prototype.send = function (msg, options, fn) { + this.sendPacket('message', msg, options, fn); + return this; +}; + +/** + * Sends a packet. + * + * @param {String} packet type. + * @param {String} data. + * @param {Object} options. + * @param {Function} callback function. + * @api private + */ + +Socket.prototype.sendPacket = function (type, data, options, fn) { + if('function' == typeof data) { + fn = data; + data = undefined; + } + + if ('function' == typeof options) { + fn = options; + options = null; + } + + if ('closing' == this.readyState || 'closed' == this.readyState) { + return; + } + + options = options || {}; + options.compress = false !== options.compress; + + var packet = { + type: type, + data: data, + options: options + }; + this.emit('packetCreate', packet); + this.writeBuffer.push(packet); + if (fn) this.once('flush', fn); + this.flush(); +}; + +/** + * Closes the connection. + * + * @api private + */ + +Socket.prototype.close = function () { + if ('opening' == this.readyState || 'open' == this.readyState) { + this.readyState = 'closing'; + + var self = this; + + if (this.writeBuffer.length) { + this.once('drain', function() { + if (this.upgrading) { + waitForUpgrade(); + } else { + close(); + } + }); + } else if (this.upgrading) { + waitForUpgrade(); + } else { + close(); + } + } + + function close() { + self.onClose('forced close'); + debug('socket closing - telling transport to close'); + self.transport.close(); + } + + function cleanupAndClose() { + self.removeListener('upgrade', cleanupAndClose); + self.removeListener('upgradeError', cleanupAndClose); + close(); + } + + function waitForUpgrade() { + // wait for upgrade to finish since we can't send packets while pausing a transport + self.once('upgrade', cleanupAndClose); + self.once('upgradeError', cleanupAndClose); + } + + return this; +}; + +/** + * Called upon transport error + * + * @api private + */ + +Socket.prototype.onError = function (err) { + debug('socket error %j', err); + Socket.priorWebsocketSuccess = false; + this.emit('error', err); + this.onClose('transport error', err); +}; + +/** + * Called upon transport close. + * + * @api private + */ + +Socket.prototype.onClose = function (reason, desc) { + if ('opening' == this.readyState || 'open' == this.readyState || 'closing' == this.readyState) { + debug('socket close with reason: "%s"', reason); + var self = this; + + // clear timers + clearTimeout(this.pingIntervalTimer); + clearTimeout(this.pingTimeoutTimer); + + // stop event from firing again for transport + this.transport.removeAllListeners('close'); + + // ensure transport won't stay open + this.transport.close(); + + // ignore further transport communication + this.transport.removeAllListeners(); + + // set ready state + this.readyState = 'closed'; + + // clear session id + this.id = null; + + // emit close event + this.emit('close', reason, desc); + + // clean buffers after, so users can still + // grab the buffers on `close` event + self.writeBuffer = []; + self.prevBufferLen = 0; + } +}; + +/** + * Filters upgrades, returning only those matching client transports. + * + * @param {Array} server upgrades + * @api private + * + */ + +Socket.prototype.filterUpgrades = function (upgrades) { + var filteredUpgrades = []; + for (var i = 0, j = upgrades.length; i