yox
Version:
A lightweight mvvm framework
1 lines • 78 kB
JavaScript
const e=/^!(?:\s|--)/,t="undefined"!=typeof window?window:undefined,n="undefined"!=typeof document?document:undefined,r=function(){},i=Object.freeze({}),o=Object.freeze([]),s=/yox/.test(r.toString())?2:3,a={leftDelimiter:"{",rightDelimiter:"}",uglifyCompiled:false,minifyCompiled:false,logLevel:s};function c(e){return"function"==typeof e}function u(e){return Array.isArray(e)}function f(e){return null!==e&&"object"==typeof e}function l(e){return"string"==typeof e}function d(e){return"number"==typeof e&&!isNaN(e)}function p(e){return true===e||false===e}function h(e){return!isNaN(e-parseFloat(e))}var m=Object.freeze({__proto__:null,func:c,array:u,object:f,string:l,number:d,boolean:p,numeric:h});function g(e,t,n){return u(n)?e.apply(t,n):undefined!==t?e.call(t,n):undefined!==n?e(n):e()}class y{constructor(e,t){this.type=e,this.phase=y.PHASE_CURRENT,t&&(this.originalEvent=t)}static is(e){return e instanceof y}preventDefault(){const e=this;if(!e.isPrevented){const{originalEvent:t}=e;t&&t.preventDefault(),e.isPrevented=true}return e}stopPropagation(){const e=this;if(!e.isStoped){const{originalEvent:t}=e;t&&t.stopPropagation(),e.isStoped=true}return e}prevent(){return this.preventDefault()}stop(){return this.stopPropagation()}}function v(e,t,n){const{length:r}=e;if(r)if(n)for(let n=r-1;n>=0&&false!==t(e[n],n);n--);else for(let n=0;n<r&&false!==t(e[n],n);n++);}function $(e,t){e[e.length]=t}function b(e,t){e.unshift(t)}function x(e,t,n){u(t)?v(t,(function(t){n(e,t)})):n(e,t)}function k(e,t){x(e,t,$)}function w(e,t){x(e,t,b)}function T(e,t,n){let r=-1;return v(e,(function(e,i){if(false===n?e==t:e===t)return r=i,false})),r}function S(e){const{length:t}=e;if(t>0)return e[t-1]}function _(e){const{length:t}=e;if(t>0)return e.pop()}function C(e,t,n){let r=0;return v(e,(function(i,o){(false===n?i==t:i===t)&&(e.splice(o,1),r++)}),true),r}function N(e,t,n){return T(e,t,n)>=0}function E(e){return u(e)?e:g(o.slice,e)}function A(e,t,n){let r={};return v(e,(function(e){r[t?e[t]:e]=n||e})),r}function O(e,t){return e.join(t)}function D(e){return!u(e)||!e.length}y.PHASE_CURRENT=0,y.PHASE_UPWARD=1,y.PHASE_DOWNWARD=-1;var z=Object.freeze({__proto__:null,each:v,push:k,unshift:w,indexOf:T,last:S,pop:_,remove:C,has:N,toArray:E,toObject:A,join:O,falsy:D});function L(e,t){return null!=e&&e.toString?e.toString():undefined!==t?t:""}function I(e){return c(e)&&L(e).indexOf("[native code]")>=0}let j=function(){const e=Object.create(null);return{get:t=>e[t],set(t,n){e[t]=n},has:t=>t in e,keys:()=>Object.keys(e)}};function P(e){const t=j();return function(n){const r=t.get(n);if(undefined!==r)return r;const i=e(n);return t.set(n,i),i}}function U(e){const t=j();return function(n,r){let i=t.get(n);if(i){const e=i.get(r);if(e)return e}else i=j(),t.set(n,i);const o=e(n,r);return i.set(r,o),o}}const V=/-([a-z])/gi,M=/\B([A-Z])/g,H=/^[a-z]/,R=P((function(e){return e.replace(V,(function(e,t){return ee(t)}))})),F=P((function(e){return e.replace(M,(function(e,t){return"-"+te(t)}))})),q=P((function(e){return e.replace(H,ee)}));function W(e,t){return O(new Array(t+1),e)}function K(e){return ie(e)?"":e.trim()}function B(e,t,n){return d(n)?t===n?"":e.slice(t,n):e.slice(t)}function Y(e,t,n){return e.indexOf(t,undefined!==n?n:0)}function G(e,t,n){return e.lastIndexOf(t,undefined!==n?n:e.length)}function Z(e,t){return 0===Y(e,t)}function J(e,t){const n=e.length-t.length;return n>=0&&G(e,t)===n}function Q(e,t){return e.charAt(t||0)}function X(e,t){return e.charCodeAt(t||0)}function ee(e){return e.toUpperCase()}function te(e){return e.toLowerCase()}function ne(e,t){return Y(e,t)>=0}function re(e,t){const n=Object.create(null);return v(e.split(t||","),(function(e){n[e]=true})),n}function ie(e){return!l(e)||!e.length}var oe=Object.freeze({__proto__:null,camelize:R,hyphenate:F,capitalize:q,repeat:W,trim:K,slice:B,indexOf:Y,lastIndexOf:G,startsWith:Z,endsWith:J,charAt:Q,codeAt:X,upper:ee,lower:te,has:ne,toMap:re,falsy:ie});const se=/\./g,ae=/\*/g,ce=/\*\*/g,ue=U((function(e,t){return e===t||Z(e,t+=".")?t.length:-1})),fe=P((function(e){return Y(e,".")<0?[e]:e.split(".")}));function le(e,t){const n=l(e)?fe(e):e;for(let e=0,r=n.length-1;e<=r&&false!==t(n[e],e,r);e++);}const de=U((function(e,t){return e&&t?e+"."+t:e||t})),pe=P((function(e){return ne(e,"*")})),he=P((function(e){return new RegExp(`^${e.replace(se,"\\.").replace(ae,"(\\w+)").replace(ce,"([.\\w]+?)")}$`)})),me=U((function(e,t){const n=e.match(he(t));return n?n[1]:undefined})),ge={value:undefined};function ye(e){return Object.keys(e)}function ve(e,t){for(let n in e)if(false===t(e[n],n))break}function $e(e,t){return ve(t,(function(t,n){e[n]=t})),e}function be(e,t){let n=e;return u(e)?t?(n=[],v(e,(function(e,r){n[r]=be(e,t)}))):n=e.slice():f(e)&&(n={},ve(e,(function(e,r){n[r]=t?be(e,t):e}))),n}function xe(e){return c(e.get)?e.get():e}function ke(e,t,n){let r=e;return le(t,(function(e,t,i){if(null==r)return r=undefined,false;{let o=r[e],s=undefined!==o;o&&(o=(n||xe)(o)),t===i?s?(ge.value=o,r=ge):r=undefined:r=o}})),r}function we(e,t){return undefined!==e[t]}var Te=Object.freeze({__proto__:null,keys:ye,each:ve,extend:$e,merge:function(e,t){return e&&t?$e($e({},e),t):e||t},copy:be,get:ke,set:function(e,t,n,r){let i=e;le(t,(function(e,t,o){if(t===o)i[e]=n;else if(i[e])i=i[e];else{if(!r)return false;i=i[e]={}}}))},has:we,falsy:function(e){return!f(e)||u(e)||!ye(e).length}});const Se="undefined"!=typeof console?console:null,_e=t&&/edge|msie|trident/i.test(t.navigator.userAgent)?"":"%c",Ce=Se?_e?function(e,t,n){Se.log(_e+e,n,t)}:function(e,t){Se.log(e,t)}:r;function Ne(){const{logLevel:e}=a;return e>=1&&e<=5?e:s}function Ee(e){return`background-color:${e};border-radius:12px;color:#fff;font-size:10px;padding:3px 6px;`}function Ae(e,t){Ne()<=1&&Ce(t||"Yox debug",e,Ee("#999"))}function Oe(e,t){Ne()<=2&&Ce(t||"Yox info",e,Ee("#2db7f5"))}function De(e,t){Ne()<=3&&Ce(t||"Yox warn",e,Ee("#f90"))}function ze(e,t){Ne()<=4&&Ce(t||"Yox error",e,Ee("#ed4014"))}function Le(e,t){if(Ne()<=5)throw new Error(`[${t||"Yox fatal"}]: ${e}`)}var Ie=Object.freeze({__proto__:null,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5,debug:Ae,info:Oe,warn:De,error:ze,fatal:Le});class je{constructor(e){this.ns=e||false,this.listeners={}}fire(e,t,n){let r=this,i=l(e)?r.toEvent(e):e,o=r.listeners[i.type],s=true;if(o){o=o.slice();const e=t&&y.is(t[0])?t[0]:undefined;for(let a=0,c=o.length;a<c;a++){let c=o[a];if(!Ue(i.ns,c)||!N(o,c)||n&&!n(i,t,c))continue;let u=g(c.listener,c.ctx,t);if(c.num=c.num?c.num+1:1,c.num===c.max&&r.off(i.type,{ns:i.ns,listener:c.listener}),e&&(false===u?e.prevent().stop():e.isStoped&&(u=false)),false===u){s=false;break}}}return s}on(e,t){const n=this,r=n.listeners,i=c(t)?{listener:t}:t;if(f(i)&&c(i.listener)){if(!l(i.ns)){const t=n.toEvent(e);i.ns=t.ns,e=t.type}k(r[e]||(r[e]=[]),i)}else Le('emitter.on(type, listener) invoke failed:\n\n"listener" is expected to be a Function or an EmitterOptions.\n')}off(e,t){const n=this,r=n.listeners;if(e){const i=n.toFilter(e,t),o=function(e,t){v(e,(function(t,n){Pe(i.listener,t)&&Ue(i.ns,t)&&e.splice(n,1)}),true),e.length||delete r[t]};i.type?r[i.type]&&o(r[i.type],i.type):i.ns&&ve(r,o),arguments.length>1&&null==t&&De(`emitter.off(type, listener) is invoked, but "listener" is ${t}.`)}else n.listeners={},arguments.length>0&&De(`emitter.off(type) is invoked, but "type" is ${e}.`)}has(e,t){let n=this.listeners,r=this.toFilter(e,t),i=true,o=function(e){return v(e,(function(e){if(Pe(r.listener,e)&&Ue(r.ns,e))return i=false})),i};return r.type?n[r.type]&&o(n[r.type]):r.ns&&ve(n,o),!i}toEvent(e){const t={type:e,ns:""};if(this.ns){const n=Y(e,".");n>=0&&(t.type=B(e,0,n),t.ns=B(e,n+1))}return t}toFilter(e,t){let n;if(n=t?c(t)?{listener:t}:t:{},l(n.ns))n.type=e;else{const t=this.toEvent(e);n.type=t.type,n.ns=t.ns}return n}}function Pe(e,t){return!e||e===t.listener}function Ue(e,t){const{ns:n}=t;return!n||!e||n===e}let Ve;"function"==typeof setImmediate&&I(setImmediate)&&(Ve=setImmediate),Ve="function"==typeof MessageChannel&&I(MessageChannel)?function(e){const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(1)}:setTimeout;var Me=Ve;let He;class Re{constructor(e){this.tasks=[],this.hooks=e||i}static shared(){return He||(He=new Re)}append(e,t){const n=this,{tasks:r}=n;k(r,{fn:e,ctx:t}),1===r.length&&Me((function(){n.run()}))}prepend(e,t){const n=this,{tasks:r}=n;w(r,{fn:e,ctx:t}),1===r.length&&Me((function(){n.run()}))}clear(){this.tasks.length=0}run(){const e=this,{tasks:t,hooks:n}=e,{length:r}=t;if(r){e.tasks=[],n.beforeTask&&n.beforeTask();for(let e=0;e<r;e++)g(t[e].fn,t[e].ctx);n.afterTask&&n.afterTask()}}}function Fe(e,t,n){let r;return function(){if(!r){const i=E(arguments);n&&g(e,undefined,i),r=setTimeout((function(){r=undefined,n||g(e,undefined,i)}),t)}}}function qe(e,t,n,r,i,o,s){let{name:a,listener:c}=s;if(o){const e=o[a]||o[""];true===e?a="change":e>0&&(c=Fe(c,e,"click"===a||"tap"===a))}if(n){if(s.isNative){const t=n.$el;return e.on(t,a,c),function(){e.off(t,a,c)}}n.on(a,s),r["$event_destroy"+i]=function(){n.off(a,s),delete r["$event_destroy"+i]}}else e.on(t,a,c),r["$event_destroy"+i]=function(){e.off(t,i,c),delete r["$event_destroy"+i]}}var We=Object.freeze({__proto__:null,afterCreate:function(e,t){const{events:n}=t;if(n){const r=t.node,i=t.component,o=t.lazy,s=t.data;for(let t in n)qe(e,r,i,s,t,o,n[t])}},afterUpdate:function(e,t,n){const r=t.events,o=n.events;if(r!==o){const n=t.node,s=t.component,a=t.lazy,c=t.data;if(o){const e=r||i;for(let t in o)if(!e[t]){const e=c["$event_destroy"+t];e&&e()}}if(r){const t=o||i;for(let i in r){const o=r[i],u=t[i];if(u)if(o.value!==u.value){const t=c["$event_destroy"+i];t&&t(),qe(e,n,s,c,i,a,o)}else u.runtime&&o.runtime&&(u.runtime.execute=o.runtime.execute,o.runtime=u.runtime);else qe(e,n,s,c,i,a,o)}}}},beforeDestroy:function(e,t){const n=t.events,r=t.data;if(n)for(let e in n){const t=r["$event_destroy"+e];t&&t()}}});function Ke(e,t){return t&&true!==t?Fe(e,t):e}const Be={set(e,t){e.value=L(t)},sync(e,t,n){n.set(t,e.value)}},Ye={set(e,t){e.checked=e.value===L(t)},sync(e,t,n){e.checked&&n.set(t,e.value)}},Ge={set(e,t){e.checked=u(t)?N(t,e.value,false):!!t},sync(e,t,n){const r=n.get(t);u(r)?e.checked?n.append(t,e.value):n.removeAt(t,T(r,e.value,false)):n.set(t,e.checked)}},Ze={set(e,t){const{multiple:n,options:r}=e;for(let i=0,o=r.length;i<o;i++)if(n)r[i].selected=N(t,r[i].value,false);else if(r[i].value==t)return void(e.selectedIndex=i);n||(e.selectedIndex=-1)},sync(e,t,n){const{multiple:r,options:i}=e;if(r){const e=[];for(let t=0,n=i.length;t<n;t++)i[t].selected&&e.push(i[t].value);n.set(t,e)}else n.set(t,i[e.selectedIndex].value)}};function Je(e,t,n,r,i){let{context:o,model:s,lazy:a,nativeAttrs:c}=i,{keypath:u,value:f}=s,l=a&&(a.model||a[""]);if(n){let e=n.$model,t=Ke((function(e){o.set(u,e)}),l);n.watch(e,t),r.$model_destroy=function(){n.unwatch(e,t),delete r.$model_destroy}}else{let n="select"===i.tag?Ze:Be,s="change";if(n===Be){const e=c&&c.type;"radio"===e?n=Ye:"checkbox"===e?n=Ge:true!==l&&(s="model")}const a=Ke((function(){n.sync(t,u,o)}),l);e.on(t,s,a),n.set(t,f),r.$model_control=n,r.$model_destroy=function(){e.off(t,s,a),delete r.$model_destroy,delete r.$model_control}}}var Qe=Object.freeze({__proto__:null,afterCreate:function(e,t){t.model&&Je(e,t.node,t.component,t.data,t)},afterUpdate:function(e,t,n){const r=t.data,i=t.model,o=n.model;if(i){const n=t.node,s=t.component;if(o)if(i.keypath!==o.keypath)r.$model_destroy(),Je(e,n,s,r,t);else if(s)s.set(s.$model,i.value);else{const e=r.$model_control;e&&e.set(n,i.value)}else Je(e,n,s,r,t)}else o&&r.$model_destroy()},beforeDestroy:function(e,t){const n=t.data.$model_destroy;n&&n()}});var Xe=Object.freeze({__proto__:null,afterCreate:function(e,t){const{nativeAttrs:n}=t;if(n){const r=t.node;for(let t in n)e.setAttr(r,t,n[t])}},afterUpdate:function(e,t,n){const r=t.nativeAttrs,o=n.nativeAttrs;if(r!==o){const n=t.node;if(r){const t=o||i;for(let i in r)undefined!==t[i]&&r[i]===t[i]||e.setAttr(n,i,r[i])}if(o){const t=r||i;for(let r in o)undefined===t[r]&&e.removeAttr(n,r)}}}});var et=Object.freeze({__proto__:null,afterCreate:function(e,t){const{nativeStyles:n}=t;if(n){const r=t.node.style;for(let t in n)e.setStyle(r,t,n[t])}},afterUpdate:function(e,t,n){const r=t.nativeStyles,o=n.nativeStyles;if(r!==o){const n=t.node.style;if(r){const t=o||i;for(let i in r)undefined!==t[i]&&r[i]===t[i]||e.setStyle(n,i,r[i])}if(o){const t=r||i;for(let r in o)undefined===t[r]&&e.removeStyle(n,r)}}}});function tt(e,t,n){e["$directive_hooks"+n.name]=n.create(t.component||t.node,n,t)}function nt(e,t,n,r){const i=e["$directive_hooks"+n.name],o=i&&i[r];o&&o(n,t)}function rt(e){return function(t,n){const{directives:r}=n;if(r){const t=n.data;for(let i in r)nt(t,n,r[i],e)}}}const it=rt("afterMount"),ot=rt("beforeDestroy");var st=Object.freeze({__proto__:null,afterCreate:function(e,t){const{directives:n}=t;if(n){const e=t.data;for(let r in n)tt(e,t,n[r])}},beforeUpdate:function(e,t,n){const r=t.directives,o=n.directives,s=t.data;if(o){const e=r||i;for(let n in o)undefined===e[n]&&nt(s,t,o[n],"beforeDestroy")}if(r){const e=o||i,n=[];for(let i in r){const o=r[i];undefined===e[i]?tt(s,t,o):o.value!==e[i].value&&(nt(s,t,o,"beforeUpdate"),n.push(o))}s.$directive_updating=n}},afterUpdate:function(e,t,n){const{data:r}=t;if(r){const e=r.$directive_updating;if(e){for(let n=0,i=e.length;n<i;n++)nt(r,t,e[n],"afterUpdate");r.$directive_updating=undefined}}},afterMount:it,beforeDestroy:ot});function at(e,t){if(5===t.type||7===t.type){const n=t.children[0];return n?at(e,n):e.createComment("")}return t.node}function ct(e,t,n,r){r?e.before(t,n,r):e.append(t,n)}function ut(e,t,n){const r=n.node;t.node=r,t.parentNode=n.parentNode,t.text!==n.text&&e.setNodeText(r,t.text)}function ft(e){e.data&&Vt(e,e.node)}function lt(e,t){e.data&&Mt(e,e.node,t)||t()}function dt(e,t,n,r){r?e.before(t,n.node,r.node):e.append(t,n.node)}function pt(e,t){e.remove(t.parentNode,t.node)}function ht(e,t){t()}function mt(e,t){const n=t.children;for(let t=0,r=n.length;t<r;t++)zt(e,n[t])}function gt(e,t,n,r){Ht(e,t,n.children,r.children)}function yt(e,t){const n=t.children;for(let t=0,r=n.length;t<r;t++)Pt(e,n[t])}function vt(e,t,n,r){const i=n.children;for(let n=0,o=i.length;n<o;n++)It(e,t,i[n],r)}function $t(e,t){const n=t.children;for(let t=0,r=n.length;t<r;t++)Ut(e,n[t])}const bt={create(e,t){t.node=e.createText(t.text)},update:ut,destroy:r,insert:dt,remove:pt,enter:r,leave:ht},xt={create(e,t){t.node=e.createComment(t.text)},update:ut,destroy:r,insert:dt,remove:pt,enter:r,leave:ht},kt=[Xe,et,Object.freeze({__proto__:null,afterCreate:function(e,t){const n=t.ref;if(n){const e=t.context;let r=e.$refs;r||(r=e.$refs={}),r[n]=t.component||t.node}},beforeUpdate:function(e,t,n){const r=t.ref,i=n.ref;if(r||i){const e=t.context,n=t.component||t.node;let o=e.$refs;r?i?r!==i&&(o?o[r]===n&&delete o[r]:o=e.$refs={},o[r]=n):(o||(o=e.$refs={}),o[r]=n):o&&i&&o[i]===n&&delete o[i]}},beforeDestroy:function(e,t){const{ref:n}=t;if(n){const{$refs:e}=t.context,r=t.component||t.node;e&&e[n]===r&&delete e[n]}}}),We,Qe,st],wt=kt.length;function Tt(e,t){for(let n=0;n<wt;n++){const r=kt[n][e];r&&r.apply(undefined,t)}}const St={create(e,t){const n=t.node=e.createElement(t.tag,t.isSvg);t.children?Lt(e,n,t.children):t.text?e.setElementText(n,t.text):t.html&&e.setHtml(n,t.html),t.isPure||(t.data={}),Tt("afterCreate",[e,t])},update(e,t,n){const r=n.node;t.node=r,t.parentNode=n.parentNode,t.data=n.data,!t.isPure&&n.isPure&&(t.data={}),Tt("beforeUpdate",[e,t,n]);const{text:i,html:o,children:s}=t,a=n.text,c=n.html,u=n.children;l(i)?(u&&jt(e,u),i!==a&&e.setElementText(r,i)):l(o)?(u&&jt(e,u),o!==c&&e.setHtml(r,o)):s?u?s!==u&&Ht(e,r,s,u):((a||c)&&e.setElementText(r,""),Lt(e,r,s)):u?jt(e,u):(a||c)&&e.setElementText(r,""),Tt("afterUpdate",[e,t,n])},destroy(e,t){if(t.isPure)return;Tt("beforeDestroy",[e,t]);const{children:n}=t;if(n)for(let t=0,r=n.length;t<r;t++)Pt(e,n[t])},insert:dt,remove:pt,enter:ft,leave:lt},_t={create(e,t){const n=t.data={};let r=undefined;t.tag&&t.context.loadComponent(t.tag,(function(i){we(n,"$loading")?n.$loading&&(n.$vnode&&(t=n.$vnode,delete n.$vnode),Dt(e,t,i),t.operator.enter(t)):r=i})),t.node=e.createComment("component"),r?Dt(e,t,r):n.$loading=true},update(e,t,n){const r=n.data;if(t.data=r,t.node=n.node,t.parentNode=n.parentNode,t.component=n.component,r.$loading)return void(r.$vnode=t);Tt("beforeUpdate",[e,t,n]);const{component:i,slots:o}=t;if(i){let e=t.props;if(e)for(let t in e)i.checkProp(t,e[t]);o&&(e=$e(e||{},o)),e&&i.forceUpdate(e)}Tt("afterUpdate",[e,t,n])},destroy(e,t){const{component:n}=t;n?(Tt("beforeDestroy",[e,t]),n.destroy(),t.shadow=n.$vnode,t.component=undefined):t.data.$loading=false},insert(e,t,n,r){const{shadow:i}=n;i?(i.operator.insert(e,t,i,r),i.parentNode=t):dt(e,t,n,r)},remove(e,t){const{shadow:n}=t;n?(n.operator.remove(e,n),n.parentNode=undefined):pt(e,t)},enter(e){const{shadow:t}=e;t&&(e.transition?Vt(e,t.node):t.operator.enter(t))},leave(e,t){const{shadow:n}=e;if(n){if(!e.transition)return void n.operator.leave(n,t);if(Mt(e,n.node,t))return}t()}},Ct={create(e,t){mt(e,t),t.node=at(e,t)},update(e,t,n){const{parentNode:r}=n;t.node=n.node,t.parentNode=r,gt(e,r,t,n)},destroy:yt,insert:vt,remove:$t,enter:r,leave:ht},Nt={create(e,t){let n=undefined;t.to&&(n=e.find(t.to),n||Le(`Failed to locate portal target with selector "${t.to}".`)),n||(n=e.getBodyElement()),t.target=n,t.node=e.createComment("");const r=t.children;for(let t=0,i=r.length;t<i;t++)zt(e,r[t]),It(e,n,r[t])},update(e,t,n){const{target:r}=n;t.node=n.node,t.parentNode=n.parentNode,t.target=r,gt(e,r,t,n)},destroy(e,t){const n=t.children;for(let t=0,r=n.length;t<r;t++)Pt(e,n[t]),Ut(e,n[t])},insert:dt,remove:pt,enter:r,leave:ht},Et={create(e,t){mt(e,t),t.data={},t.node=at(e,t),Tt("afterCreate",[e,t])},update(e,t,n){const{parentNode:r}=n;t.node=n.node,t.parentNode=r,t.data=n.data,Tt("beforeUpdate",[e,t,n]),gt(e,r,t,n),Tt("afterUpdate",[e,t,n])},destroy(e,t){Tt("beforeDestroy",[e,t]),yt(e,t)},insert:vt,remove:$t,enter:ft,leave:lt};function At(e,t){return e.type===t.type&&e.tag===t.tag&&e.key===t.key}function Ot(e,t,n){let r,o,s;for(;t<=n;)o=e[t],o&&(s=o.key)&&(r||(r={}),r[s]=t),t++;return r||i}function Dt(e,t,n){const r=t.data,i=(t.parent||t.context).createComponent(n,t);return t.component=i,t.shadow=i.$vnode,r.$loading=false,Tt("afterCreate",[e,t]),i}function zt(e,t){t.node||t.operator.create(e,t)}function Lt(e,t,n,r,i,o){let s,a=r||0,c=undefined!==i?i:n.length-1;for(;a<=c;)s=n[a],zt(e,s),It(e,t,s,o),a++}function It(e,t,n,r){const{operator:i}=n;i.insert(e,t,n,r),n.parentNode=t,Tt("afterMount",[e,n]),i.enter(n)}function jt(e,t,n,r){let i,o=n||0,s=undefined!==r?r:t.length-1;for(;o<=s;)i=t[o],i&&(Pt(e,i),Ut(e,i)),o++}function Pt(e,t){t.operator.destroy(e,t)}function Ut(e,t){const{operator:n}=t;n.leave(t,(function(){n.remove(e,t),t.parentNode=undefined}))}function Vt(e,t){const{context:n,transition:r}=e,i=e.data.$leaving;if(i&&i(),r){const{enter:e}=r;e&&e.call(n,t)}}function Mt(e,t,n){const{context:r,transition:i}=e,o=e.data,s=o.$leaving;if(s&&s(),i){const{leave:e}=i;if(e)return e.call(r,t,o.$leaving=function(){o.$leaving&&(n(),o.$leaving=undefined)}),true}}function Ht(e,t,n,r){let i,o,s=0,a=n.length-1,c=n[s],u=n[a],f=0,l=r.length-1,d=r[f],p=r[l];for(;f<=l&&s<=a;)c?u?d?p?At(c,d)?(Rt(e,c,d),c=n[++s],d=r[++f]):At(u,p)?(Rt(e,u,p),u=n[--a],p=r[--l]):At(u,d)?(Rt(e,u,d),ct(e,t,d.node,e.next(p.node)),u=n[--a],d=r[++f]):At(c,p)?(Rt(e,c,p),ct(e,t,p.node,d.node),c=n[++s],p=r[--l]):(i||(i=Ot(r,f,l)),o=c.key?i[c.key]:undefined,undefined!==o?(Ft(e,c,r[o]),r[o]=undefined):zt(e,c),It(e,t,c,d),c=n[++s]):p=r[--l]:d=r[++f]:u=n[--a]:c=n[++s];f>l?Lt(e,t,n,s,a,n[a+1]):s>a&&jt(e,r,f,l)}function Rt(e,t,n){t!==n&&t.operator.update(e,t,n)}function Ft(e,t,n){if(t!==n){if(!At(t,n)){const r=n.parentNode;return zt(e,t),void(r&&(It(e,r,t,n),Pt(e,n),Ut(e,n)))}Rt(e,t,n)}}function qt(e){const{children:t}=e;return{type:e.type,data:e.data,node:e.node,parentNode:e.parentNode,target:e.target,shadow:e.shadow,parent:e.parent,component:e.component,context:e.context,operator:e.operator,tag:e.tag,isSvg:e.isSvg,isStatic:e.isStatic,isPure:e.isPure,slots:e.slots,props:e.props,nativeAttrs:e.nativeAttrs,nativeStyles:e.nativeStyles,directives:e.directives,events:e.events,lazy:e.lazy,transition:e.transition,model:e.model,to:e.to,ref:e.ref,key:e.key,text:e.text,html:e.html,children:t?t.map(qt):t}}const Wt={},Kt={},Bt={},Yt={};function Gt(e,t){return Kt[t.name]||"portal"===e.tag&&"to"===t.name||"slot"===e.tag&&"name"===t.name}function Zt(e,t){const n=e.split(";");for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.indexOf(":");if(i>0){const e=K(r.substring(0,i)),n=K(r.substring(i+1));e&&n&&t(R(e),n)}}}function Jt(e,t){return{type:2,isStatic:true,name:e,ns:t}}function Qt(e,t,n){return{type:3,ns:t,name:e,modifier:n}}function Xt(e,t,n,r){return{type:9,from:e,to:t,equal:n||undefined,index:r,isVirtual:true}}function en(e){return{type:5,text:e,isStatic:true,isLeaf:true}}Wt.slot=Wt.portal=Wt.fragment=Wt.template=Kt.key=Kt.ref=Kt.slot=true,Bt.if=6,Bt.each=9,Yt.fragment=5,Yt.portal=6,Yt.slot=7;const tn=/^[A-Z]|-/,nn=/&[#\w\d]{2,6};/,rn=re("area,base,embed,track,source,param,input,col,img,br,hr"),on=re("svg,g,defs,desc,metadata,symbol,use,image,path,rect,circle,line,ellipse,polyline,polygon,text,tspan,tref,textpath,marker,pattern,clippath,mask,filter,cursor,view,animate,font,font-face,glyph,missing-glyph,animateColor,animateMotion,animateTransform,textPath,foreignObject"),sn=re("min,minlength,max,maxlength,step,size,rows,cols,tabindex,colspan,rowspan,frameborder"),an=re("disabled,checked,required,multiple,readonly,autofocus,autoplay,reversed,selected,controls,default,loop,muted,novalidate,draggable,contenteditable,hidden,spellcheck,allowfullscreen");function cn(e,t,n){if(e.isComponent)return Jt(R(t),n);if("style"===t)return{type:4,isStatic:!0};const r=Jt(t,n);return ln(t)&&(r.defaultValue="spellcheck"===t||"img"===e.tag&&"draggable"===t),r}function un(e,t,n){return fn(e)?dn(e,t):ln(e)?pn(e,t,n):t}function fn(e){return sn[e]}function ln(e){return an[e]}function dn(e,t){return h(t)||De(`The value of "${e}" is not a number: ${t}.`),L(t)}function pn(e,t,n){const r=true===t||"true"===t||t===e;return r===n?undefined:r?"true":"false"}function hn(e,t){let n=false,r=false,i=false;return t?i=true:(n=undefined!==on[e],!n&&tn.test(e)?i=true:"style"===e&&(r=true)),function(e,t,n,r,i){const o="slot"===e,s=!i&&!o&&!!Wt[e],a=!i&&!o&&!s;return{type:1,tag:e,dynamicTag:t,isSvg:n,isStyle:r,isStatic:a,isNative:a,isVirtual:s,isComponent:i}}(e,t,n,r,i)}function mn(e,t){return l(t)&&nn.test(t)?e.html=t:e.text=t,true}function gn(e){return undefined!==e}const yn={};function vn(e){return e>0&&e<33||160===e}function $n(e){return e>47&&e<58}function bn(e){return 64===e}function xn(e){return 36===e||95===e||e>96&&e<123||e>64&&e<91}function kn(e){return xn(e)||$n(e)}function wn(e,t,n,r){return{type:5,raw:r,left:e,operator:t,right:n,isStatic:An([e,n])}}function Tn(e,t,n){let r=false,i=true,o=0;return"this"===t?(t="",i=false):".."===t?(t="",i=false,o=1):"~"===t?(t="",r=true,i=false):t=En(t),n?Sn(t,e):Cn(e,t,r,i,o)}function Sn(e,t){return{type:1,raw:t,value:e,isStatic:true}}function _n(e,t){let n=t.shift(),r=false,i=true,o=0;if(t.length>0){let s=true,a=[],c="",u=[];if(v(t,(function(e){if(s)if(1===e.type){const t=e;if(".."===t.raw)return o+=1,void(c=c?c+"/..":"..");if("this"!==t.raw){const e=L(t.value);k(a,e),c&&(c+=J(c,"..")?"/":"."),c+=e}}else s=false;s||k(u,e)})),2===n.type){const t=n;r=t.root,i=t.lookup,o+=t.offset;let f=t.name;if(f&&(f=En(f,t),w(a,f)),f=O(a,"."),s)n=Cn(e,f,r,i,o,a);else{let s=t.raw;if(c){let e=".";"~"!==s&&".."!==s||(e="/"),s+=e+c}n=Nn(e,Cn(s,f,r,i,o,a),undefined,u,r,i,o)}}else n=s?Nn(e,n,O(a,"."),undefined,r,i,o):Nn(e,n,undefined,u,r,i,o)}return n}function Cn(e,t,n,r,i,o){return{type:2,raw:e,name:t,root:n,lookup:r,offset:i,literals:o&&o.length>1?o:undefined}}function Nn(e,t,n,r,i,o,s){return{type:3,raw:e,lead:t,keypath:n,nodes:r,root:i,lookup:o,offset:s,isStatic:t.isStatic&&(!r||An(r))}}function En(e,t){return bn(X(e,0))&&(e="$slot_"+B(e,1),t&&(t.name=e)),e}function An(e){let t=true;return v(e,(function(e){if(!e.isStatic)return t=false})),t}yn.true=true,yn.false=false,yn.null=null,yn[void 0]=undefined;const On={"+":true,"-":true,"~":true,"!":true,"!!":true},Dn={"*":15,"/":15,"%":15,"+":14,"-":14,"<<":13,">>":13,">>>":13,"<":12,"<=":12,">":12,">=":12,"==":11,"!=":11,"===":11,"!==":11,"&":10,"^":9,"|":8,"&&":7,"||":6};class zn{constructor(e){const t=this;t.index=-1,t.end=e.length,t.code=0,t.content=e,t.go()}go(e){let t=this,{index:n,end:r}=t;n+=e||1,n>=0&&n<r?(t.code=t.codeAt(n),t.index=n):(t.code=0,t.index=n<0?-1:r)}skip(e){const t=this,n=e&&e<0;if(0===t.code){const n=t.index;if(t.go(e),!vn(t.code))return void t.go(n-t.index)}else if(!vn(t.code))return;for(;;){if(!vn(t.code)){n&&t.go();break}t.go(e)}}is(e){return this.code===e}pick(e,t){return B(this.content,e,gn(t)?t:this.index)}codeAt(e){return X(this.content,e)}scanToken(){const e=this,{code:t,index:n}=e;let r=false;if(bn(t)&&(r=true,e.go()),xn(e.code))return e.scanTail(n,[e.scanIdentifier(n,r)]);if(r&&e.go(-1),$n(t))return e.scanNumber(n);switch(t){case 0:return;case 39:case 34:return e.scanTail(n,[e.scanString(n,t)]);case 46:return e.go(),$n(e.code)?e.scanNumber(n):e.scanPath(n);case 126:if(47===e.codeAt(n+1))return e.scanPath(n);break;case 40:return e.go(),e.scanTernary(41);case 91:return e.scanTail(n,[(i=e.scanTuple(n,93),o=e.pick(n),{type:7,raw:o,nodes:i,isStatic:An(i)})]);case 123:return e.scanObject(n)}var i,o;const s=e.scanOperator(n);if(s&&On[s]){const t=e.scanTernary();if(t){if(1===t.type){const r=t.value;if(d(r))return e.skip(-1),Sn(-r,e.pick(n))}return e.skip(-1),function(e,t,n){return{type:4,raw:n,operator:e,node:t,isStatic:t.isStatic}}(s,t,e.pick(n))}e.fatal(n,"Expression expected.")}}scanNumber(e){const t=this;for(;$n(n=t.code)||46===n;)t.go();var n;const r=t.pick(e);if(h(r))return Sn(+r,r);t.fatal(e,"Number expected.")}scanString(e,t){const n=this;e:for(;;)switch(n.go(),n.code){case 92:n.go();break;case t:n.go();break e;case 0:n.fatal(e,"Unexpected end of text.");break e}const r=n.pick(e);return Sn(new Function("return "+r)(),r)}scanObject(e){let t,n=this,r=[],i=[],o=true;n.go();e:for(;;)switch(n.code){case 125:n.go(),r.length!==i.length&&n.fatal(e,"The length of keys and values must be equal.");break e;case 0:n.fatal(e,"Unexpected end of text.");break e;case 58:n.go(),o=false;break;case 44:n.go(),o=true;break;default:if(t=n.scanTernary(),o){if(t)if(n.skip(),2===t.type)k(r,t.name);else{if(1!==t.type){n.fatal(e,"The key of an object must be a literal or identifier.");break e}k(r,t.value)}}else{if(!t){n.fatal(e,"The value of the object was not found.");break e}n.skip(),k(i,t)}}return function(e,t,n){return{type:8,raw:n,keys:e,values:t,isStatic:An(t)}}(r,i,n.pick(e))}scanTuple(e,t){let n,r=this,i=[];r.go();e:for(;;)switch(r.code){case t:r.go();break e;case 0:r.fatal(e,"Unexpected end of text.");break e;case 44:r.go();break;default:n=r.scanTernary(),n&&(r.skip(),k(i,n))}return i}scanPath(e){let t,n=this,r=[];for(;t="this",n.is(46)?(n.go(),t=".."):n.is(126)&&(n.go(),t="~"),k(r,Tn(t,t,r.length>0)),n.is(47);){n.go();const{index:t,code:i}=n;let o=false;if(bn(i)&&(o=true,n.go()),xn(n.code))return k(r,n.scanIdentifier(t,o,true)),n.scanTail(e,r);if(o&&n.go(-1),!n.is(46)){n.fatal(e,S(r).raw+"/ must be followed by an identifier.");break}n.go()}}scanTail(e,t){let n,r=this;e:for(;;)switch(r.code){case 40:t=[(i=_n(r.pick(e),t),o=r.scanTuple(r.index,41),s=r.pick(e),{type:9,raw:s,name:i,args:o})];break;case 46:if(r.go(),kn(r.code)){k(t,r.scanIdentifier(r.index,false,true));break}r.fatal(e,"Identifier or number expected.");break e;case 91:if(r.go(),n=r.scanTernary(93),n){k(t,n);break}r.fatal(e,"[] is not allowed.");break e;default:break e}var i,o,s;return _n(r.pick(e),t)}scanIdentifier(e,t,n){const r=this;do{r.go()}while(kn(r.code));const i=r.pick(e);return t&&1===i.length&&r.fatal(e,"A slot identifier must be followed by its name."),!n&&i in yn?Sn(yn[i],i):Tn(i,i,n)}scanOperator(e){const t=this;switch(t.code){case 47:case 37:case 126:case 94:case 42:t.go();break;case 43:t.go(),t.is(43)&&t.fatal(e,'The operator "++" is not supported.');break;case 45:t.go(),t.is(45)&&t.fatal(e,'The operator "--" is not supported.');break;case 33:t.go(),t.is(33)?t.go():t.is(61)&&(t.go(),t.is(61)&&t.go());break;case 38:t.go(),t.is(38)&&t.go();break;case 124:t.go(),t.is(124)&&t.go();break;case 61:t.go(),t.is(61)?(t.go(),t.is(61)&&t.go()):t.fatal(e,"Assignment statements are not supported.");break;case 60:t.go(),(t.is(61)||t.is(60))&&t.go();break;case 62:t.go(),t.is(61)?t.go():t.is(62)&&(t.go(),t.is(62)&&t.go())}if(t.index>e)return t.pick(e)}scanBinary(e){let t,n,r,i,o,s,a=this,c=[];for(;;){if(a.skip(),k(c,a.index),t=a.scanToken(),t){if(k(c,t),k(c,a.index),a.skip(),r=a.scanOperator(a.index),r&&(i=Dn[r])){for(;n=c.length-4,(o=c[n])&&(s=Dn[o])&&s>=i;)c.splice(n-2,5,wn(c[n-2],o,c[n+2],a.pick(c[n-3],c[n+3])));k(c,r);continue}r=undefined}else r&&a.fatal(e,"Invalid syntax.");break}for(;;){if(!(c.length>=7))return c[1];n=c.length-4,c.splice(n-2,5,wn(c[n-2],c[n],c[n+2],a.pick(c[n-3],c[n+3])))}}scanTernary(e){const t=this;t.skip();let n,r,i=t.index,o=t.scanBinary(i);return t.is(63)&&(t.go(),n=t.scanTernary(),t.is(58)&&(t.go(),r=t.scanTernary()),o&&n&&r?(t.skip(-1),o=function(e,t,n,r){return{type:6,raw:r,test:e,yes:t,no:n,isStatic:An([e,t,n])}}(o,n,r,t.pick(i))):t.fatal(i,"Invalid ternary syntax.")),gn(e)&&(t.skip(),t.is(e)?t.go():t.fatal(i,`"${String.fromCharCode(e)}" expected, "${String.fromCharCode(t.code)}" actually.`)),o}fatal(e,t){Le(`Error compiling expression\n\n${this.content}\n\nmessage: ${t}\n`)}}const Ln=P((function(e){return new zn(e).scanTernary(0)})),In={},jn=/\s*:\s*([_$a-z]+)$/i,Pn=/^[_$a-z]([\w]+)?$/i,Un=/^[_$a-z]([\w]+)?$/i,Vn=/^[_$a-z]([\w]+)?\.[_$a-z]([\w]+)?$/i,Mn=/^\s*[\n\r]\s*|\s*[\n\r]\s*$/g,Hn=/\s*(=>|->)\s*/,Rn=/<(\/)?([a-z][-a-z0-9]*|\$[^\s]*)/i,Fn=/^\s*([-$.:\w]+)(?:=(['"]))?/,qn=/^[!=]*['"]/,Wn=/^\s*(\/)?>/;function Kn(e,t){return K(B(e,t.length))}function Bn(e){if(e.safe&&1===e.expr.type)return en(L(e.expr.value))}function Yn(e){return e&&11===e.type&&!e.safe}function Gn(e,t){return e>=0&&t>=0?e<t?-1:1:e>=0?-1:t>=0?1:0}function Zn(e,t,n,r){for(;;){const i=t.text.indexOf("\x3c!--",t.position),o=t.text.indexOf("--\x3e",t.position);switch(Gn(i,o)){case-1:t.position=i+1;const s={startIndex:i};k(e,s),n&&n(t,s);break;case 1:t.position=o+1;const{length:a}=e;if(a>0){const n=_(e);n.endIndex=o+"--\x3e".length;const i=1===a;if(r){if(false===r(t,n,i))return}if(i)return}break;case 0:return}}}function Jn(e){const t=[];let n=false;for(let r=0;r<e.length;r++){const i=e[r];if(5===i.type){const o=i;Zn(t,{text:o.text,position:0},(function(e,t){t.index=r,t.text=B(o.text,0,t.startIndex)}),(function(t,i){const s=i.index,a=r,c=i.text,u=B(o.text,i.endIndex);if(s===a)return t.text=o.text=c+u,void(t.position=i.startIndex);let f=s,l=a;c&&(e[s].text=c,f++),u&&(e[a].text=u,l--);const d=l-f+1;return d>0&&(n=true,e.splice(f,d),r=f-1),false}))}}if(n)for(let t=0;t<e.length;t++){const n=e[t];if(5===n.type){const r=e[t+1];r&&5===r.type&&(n.text+=r.text,e.splice(t+1,1))}}}function Qn(t){let n,r,i,o,s,c=W(a.leftDelimiter,2),u=W(a.rightDelimiter,2),f=a.leftDelimiter,l=a.rightDelimiter,p=[],h=[],m=[],g=[],y=[],$=[],b=t.length,x=0,w=0,C=0,N=0,E=1,A=[],O=[],D=function(e){Le(`Error compiling template\n\n${t}\n\nmessage: ${e}`)},z=function(e){const t=S(h);if(t&&1===t.type){const r=t;r.tag!==e&&(n=r.tag,void 0!==rn[n])&&L(r.type,r.tag)}var n},L=function(e,t){const n=_(h);n&&n.type===e||D("The type of poping node is not expected.");const i=n,o=1===e,s=2===e,a=4===e,c=3===e,u=S(h);o&&t&&i.tag!==t&&D(`End tag is "${t}",but start tag is "${i.tag}".`);let{children:f}=i;if(f&&f.length>1&&(r||(Jn(f),f.length||(f=i.children=undefined))),f){const e=1===f.length&&f[0];if(e)switch(e.type){case 5:o?I(i,e):r&&(s?M(r,i,e):a?U(r,i,e):c&&q(r,i,e));break;case 11:o?j(i,e):r&&(s||a||c)&&H(r,i,e)}}else r&&(s?V(r,i):a?P(r,i):c&&F(r,i));return i.isVirtual&&!i.children&&ee(i),o?J(i):r&&s&&X(r,i),u&&u.isStatic&&!i.isStatic&&(u.isStatic=false),i},I=function(e,t){e.isNative&&mn(e,t.text)&&(e.children=undefined)},j=function(e,t){e.isNative&&(t.safe&&mn(e,t.expr)||!t.safe&&function(e,t){return e.html=t,!0}(e,t.expr))&&(e.children=undefined)},P=function(e,t){ee(t)},U=function(e,t,n){n.text?(t.value=n.text,t.children=undefined):ee(t)},V=function(e,t){Gt(e,t)?D(`The value of "${t.name}" is empty.`):t.value=function(e,t,n){return!!e.isComponent||(fn(t)?void 0:ln(t)?pn(t,!0,n):"")}(e,t.name,t.defaultValue)},M=function(e,t,n){const{text:r}=n;e.isNative?t.value=un(t.name,r,t.defaultValue):t.value=r,t.children=undefined},H=function(e,t,n){const{expr:r}=n;if(1===r.type){let n=r.value;e.isNative&&2===t.type&&(n=un(t.name,n,t.defaultValue)),t.value=n}else t.expr=r;t.children=undefined},F=function(e,t){t.value=true},q=function(e,t,n){let i,o,{ns:s}=t,{text:a}=n,c="model"===s,u="lazy"===s,f="event"===s,l="o"===s;try{i=Ln(a)}catch(e){o=e}if(i){{const{raw:e}=i;if(u)(1!==i.type||!d(i.value)||i.value<=0)&&D("The value of lazy must be a number greater than 0.");else if(9===i.type){const e=i.name;2!==e.type?D("Invalid method name."):Pn.test(e.name)||D("Invalid method name.")}else f&&(Un.test(e)||Vn.test(e)?(Vn.test(e)&&"native"===e.split(".")[1]&&D('The event namespace "native" is not permitted.'),r&&r.isComponent&&t.name===e&&D("The event name listened and fired can't be the same.")):D("The event name and namespace must be an identifier."));c&&2!==i.type&&D("The value of the model must be an identifier."),l&&9===i.type&&D(`The value of the directive [${t.ns}-${t.name}] can't be a method call.`)}t.expr=i,t.value=1===i.type?i.value:a}else{if(!l)throw o;t.value=a}t.children=undefined},G=function(e){let t=e,n=[],r=false,i=false;for(;k(n,t),t.next;)t=t.next;v(n,(function(e){e.children&&(!r&&e.next&&delete e.next,i=r=true)}),true),i||ee(e)},J=function(e){const{tag:t,slot:n}=e,r="template"===t,i="fragment"===t,o="portal"===t;r&&(e.key?D('The "key" attribute is not supported in <template>.'):e.ref?D('The "ref" attribute is not supported in <template>.'):e.attrs?D("The attributes and directives are not supported in <template>."):n||D('The "slot" attribute is required in <template>.')),(r||i||o)&&!e.children?ee(e):e.isNative&&function(e){let{attrs:t}=e,n=!1;if(t&&v(t,(function(e){"type"===(2===e.type?e.name:void 0)&&(n=!0)})),e.isStyle&&!n){const t=Jt("type");t.value="text/css",k(e.attrs||(e.attrs=[]),t)}}(e)},X=function(e,t){const{name:n,value:r}=t,i="slot"===n;if(i){const{tag:t,isComponent:n,isNative:r}=e;"template"===t||n||r||D(`The "slot" attribute can't be used in <${t}>.`)}if(Gt(e,t)){const o=i;S(h)!==e&&D(`The "${n}" attribute can't be used in an if block.`),""===r?D(`The value of "${n}" attribute is empty.`):o&&ie(r)&&D(`The value of "${n}" attribute can only be a string literal.`),e[n]=o?r:t,ee(t),t.isStatic&&(t.isStatic=false)}},ee=function(e,t){let n,i,o,s=S(h);s?(n=r&&r===s,i=n?s.attrs:s.children):i=p,i&&(o=T(i,e),o>=0&&(t?i[o]=t:(i.splice(o,1),s&&!i.length&&(n?delete s.attrs:s.children=undefined))))},te=function(e){r||z();let t=e.type,n=S(h),o=undefined,s=undefined,a=undefined;if(7===t){const e=S(g);e?6===e.type?o=e:7===e.type?s=e:D('The "else" block must not be followed by an "else if" block.'):D('The "if" block is required.')}else if(8===t){const e=S(g),t=S($);e&&n===e?6===e.type?o=e:7===e.type?s=e:D('The "else" block can\'t appear more than once in a conditional statement.'):t&&n===t?9===t.type?a=t:D('The "else" block can\'t appear more than once in a conditional statement.'):D('The "if" block is required.')}else if(n)if(r&&1===n.type)Yn(e)&&D("The dangerous interpolation must be the only child of a HTML element."),k(r.attrs||(r.attrs=[]),e);else{i&&3===i.type&&5!==t?D(`For performance, "${c}" and "${u}" are not allowed in directive value.`):3===t&&"model"===e.ns&&n!==r&&D('The "model" can\'t be used in an if block.');const o=n.children||(n.children=[]),s=S(o);if(11===t&&(!r||i&&o.length>0)){const n=Bn(e);n&&(e=n,t=n.type)}if(s&&5===t){if(5===s.type)return void(s.text+=e.text);if(11===s.type){const t=Bn(s);if(t)return o[o.length-1]=t,void(t.text+=e.text)}}Yn(e)?s?D("The dangerous interpolation must be the only child of a HTML element."):1===n.type&&n.isNative||D("The dangerous interpolation must be the only child of a HTML element."):Yn(s)&&D("The dangerous interpolation must be the only child of a HTML element."),k(o,e)}else Yn(e)&&D("The dangerous interpolation must be under a HTML element."),k(p,e);6===t?(k(m,e),k(g,e)):9===t?(k(y,e),k($,e)):o?(o.next=e,g[g.length-1]=e,L(o.type)):s?(s.next=e,g[g.length-1]=e,L(s.type)):a&&(a.next=e,$[$.length-1]=e,L(a.type)),e.isLeaf?n&&n.isStatic&&!e.isStatic&&(n.isStatic=false):k(h,e)},ne=function(e){(e=e.replace(Mn,""))&&te(en(e))},re=[function(e){if(!n&&!r){const t=e.match(Rn);if(t&&0===t.index){let e=t[2];if("/"===t[1])z(e),r=L(1,e);else{if("template"===e){const e=S(h);e&&e.isComponent||D("<template> can only be used within an component children.")}let t;"$"===Q(e)&&(e=B(e,1),t=Ln(e),t?2!==t.type&&D(`The dynamic component "${e}" is not a valid identifier.`):D(`The dynamic component "${e}" is not a valid expression.`));const n=hn(e,t);te(n),r=n}return t[0]}}},function(e){if(n)return;const t=e.match(Wn);return t&&r&&!i?("/"===t[1]&&L(r.type,r.tag),r=undefined,t[0]):void 0},function(e){if(!n&&r&&!i){e.match(qn)&&D("The previous attribute is not end.");const t=e.match(Fn);if(t){let e,n=t[1];if("model"===n||"transition"===n)e=Qt("",n);else if(Z(n,"on-")){const t=Kn(n,"on-");t||D("The event name is required.");const r=R(t).split(".");e=Qt(r[0],"event",r[1]),r.length>2&&D("Invalid event namespace.")}else if("lazy"===n)e=Qt("","lazy");else if(Z(n,"lazy-")){const t=Kn(n,"lazy-");t||D("The lazy name is required."),e=Qt(R(t),"lazy")}else if(Z(n,"o-")){const t=Kn(n,"o-");t||D("The directive name is required.");const r=R(t).split(".");e=Qt(r[0],"o",r[1]),r.length>2&&D("Invalid directive modifier.")}else{const t=n.split(":");e=2===t.length?cn(r,t[1],t[0]):cn(r,n)}return te(e),s=t[2],s?i=e:L(e.type),t[0]}}},function(e){let t,o=undefined;if(!n&&i&&s)t=e.match(In[s]||(In[s]=new RegExp(s))),t?(o=B(e,0,t.index),ne(o),i.children||te(en("")),o+=s,L(i.type),i=undefined):(o=e,ne(o));else if(r)K(e)&&D(`Invalid character is found in <${r.tag}> attribute level.`),o=e;else{let r="";if(!n&&(t=e.match(Rn),t)){const n=t.index;Gn(n,e.indexOf("\x3c!--"))<0&&(o=B(e,0,n),r=o)}if(!gn(o)){let t=-1,i=-1;const s=n,a=n||[];n=undefined,Zn(a,{text:e,position:0},(function(i,s){t<0&&(t=s.startIndex,o=e,r=e,n=a)}),(function(a,c,u){u&&(n=undefined,i=c.endIndex,t>=0?s?(o=B(e,0,i),r=o):(o=B(e,0,i),r=B(e,0,t)):(o=B(e,0,i),r=o))}))}gn(o)||(o=e,r=e),ne(r)}return o}],oe=[function(e){if(Z(e,"#each")){r&&D(i?'The "each" block can\'t be appear in an attribute value.':'The "each" block can\'t be appear in attribute level.');let t=e=K(Kn(e,"#each")),n=undefined,o=e.match(jn);if(o&&(n=o[1],t=B(e,0,-1*o[0].length)),t&&""!==n||D("Invalid each"),"$scope"!==n&&"$keypath"!==n&&"$length"!==n&&"$event"!==n&&"$data"!==n||D(`The each index can't be "${n}".`),o=t.match(Hn),o){const e=t.split(Hn),r=Ln(e[0]),i=Ln(e[2]);if(r&&i)return Xt(r,i,"=>"===o[1],n)}else{const e=Ln(t);if(e)return Xt(e,undefined,false,n)}D("Invalid each")}},function(e){if(Z(e,">")){(e=Kn(e,">"))||D("Invalid import"),r&&D(i?'The "import" block can\'t be appear in an attribute value.':'The "import" block can\'t be appear in attribute level.');const t=Ln(e);return t||D("Invalid import"),function(e){return{type:10,expr:e,isLeaf:!0}}(t)}},function(e){if(Z(e,"#if")){e=Kn(e,"#if");const t=Ln(e);return t||D("Invalid if"),function(e){return{type:6,expr:e,isVirtual:!0}}(t)}},function(e){if(Z(e,"else if")){e=Kn(e,"else if");const t=Ln(e);return t||D("Invalid else if"),function(e){return{type:7,expr:e,isVirtual:!0}}(t)}},function(e){if(Z(e,"else"))return K(e=Kn(e,"else"))&&D('The "else" must not be followed by anything.'),{type:8,isVirtual:!0}},function(e){if(Z(e,"...")){e=Kn(e,"...");const t=Ln(e);if(t||D("Invalid spread"),r&&r.isComponent)return function(e){return{type:12,expr:e,isLeaf:!0}}(t);D("The spread can only be used by a component.")}},function(t){if(!e.test(t)){t=K(t);const e=Ln(t);return e||D("Invalid expression"),function(e,t){return{type:11,expr:e,safe:t,isLeaf:!0,isStatic:e.isStatic}}(e,2===E)}}],se=function(e){for(;e;)v(re,(function(t){const n=t(e);if(n)return e=B(e,n.length),false}))},ae=function(e){if("/"===Q(e)){z();const t=B(e,1);let n=Bt[t],r=undefined,i=undefined;if(6===n){const e=_(g);e?(n=e.type,r=_(m)):D('The "if" block is closing, but it\'s not open yet.')}else if(9===n){const e=_($);e?(n=e.type,i=_(y)):D('The "each" block is closing, but it\'s not open yet.')}L(n),r?G(r):i&&G(i)}else v(oe,(function(t){const n=t(e);if(n)return te(n),false}))},ce=function(){if(x=N+u.length,!(x<=b))return true;x<b&&Q(t,x)===l?3===E?w=x+1:D(`${c} and ${l}${u} is not a pair.`):2===E?w=x:D(`${c}${f} and ${u} is not a pair.`),_(A),ue(N)},ue=function(e){A.length||k(O,e)};for(;;)if(ue(w),C=Y(t,c,w),N=Y(t,u,w),N>=w&&(C<0||N<C)){if(ce())break}else{if(!(C>=w))break;if(E=2,ue(C),C+=c.length,C<b)if(Q(t,C)===f&&(E=3,C++),ue(C),ue(E),k(A,true),C<b)if(N=Y(t,u,C),N>=C){if(w=Y(t,c,C),(w<0||N<w)&&ce())break}else D("The end delimiter is not found.");else D("Unterminated template literal.");else D("Unterminated template literal.")}E=1;for(let e=0,n=O.length;e<n;e+=5)x=O[e],C=O[e+1],gn(C)?(se(B(t,x,C)),C=O[e+2],E=O[e+3],N=O[e+4],o=K(B(t,C,N)),o&&ae(o)):(E=1,se(B(t,x)));return h.length&&(z(),h.length&&D("Some nodes is still in the stack.")),p.length>0&&Jn(p),p}let Xn=undefined,er=undefined,tr=re("abstract,goto,native,static,enum,implements,package,super,byte,export,import,private,protected,public,synchronized,char,extends,int,throws,class,final,interface,transient,yield,let,const,float,double,boolean,long,short,volatile,default"),nr=0,rr={},ir={},or="",sr="",ar="",cr="",ur="",fr="",lr="",dr="",pr="";class hr{constructor(e){this.value=e}toString(){const{value:e}=this;return true===e?ur:false===e?fr:null===e?cr:undefined===e?ar:l(e)?qr(e):""+e}}class mr{constructor(e,t,n,r,i,o){this.left=e,this.right=t,this.separator=n,this.breakLine=r,this.offset=i,this.items=o||[]}unshift(e){w(this.items,e)}push(e){k(this.items,e)}toString(e){let{left:t,right:n,separator:r,breakLine:i,offset:o,items:s}=this,{length:a}=s;if(!a)return`${t}${n}`;const c=e||0,u=c+o,f=W(dr,c),l=W(dr,u),d=s.map((function(e){return e.toString(u)}));return t&&i&&(t+=pr+l),n&&i&&(n=pr+f+n),`${t}${O(d,i?r+pr+l:r+lr)}${n}`}}class gr{constructor(e){this.items=e||[]}add(e){k(this.items,e)}toString(e){const{items:t}=this;return 1===t.length?t[0].toString(e):new mr("(",")",",",true,1,t).toString(e)}}class yr{constructor(e){if(this.fields={},e){const t=this;ve(e,(function(e,n){t.set(n,e)}))}}set(e,t){t instanceof hr&&undefined===t.value||(this.fields[e]=t)}isNotEmpty(){return ye(this.fields).length>0}toString(e){const{fields:t}=this;return Ar("{","}",",",true,1,ye(t).sort().map((function(e){return{toString:n=>function(e,t){/^[\w$]+$/.test(e)&&!tr[e]||(e=qr(e));return`${e}:${lr}${t}`}(e,t[e].toString(n))}}))).toString(e)}}class vr{constructor(e,t){this.name=e,this.args=t}toString(e){const{name:t,args:n}=this,r=n?function(e){let t=[],n=true;return v(e,(function(e){!(e instanceof hr)||undefined!==e.value?(n=false,w(t,e)):n||w(t,Er(undefined))}),true),t}(n):[];return r.length?`${t.toString(e)}${Ar("(",")",",",true,1,r).toString(e)}`:t.toString(e)+"()"}}class $r{constructor(e){this.value=e}toString(e){return`(${this.value.toString(e)})`}}class br{append(e){const{buffer:t}=this;this.buffer=t?Pr(t instanceof wr?Ir(t):t,"+",e instanceof wr?Ir(e):e):e}toString(e){return this.buffer.toString(e)}}class xr{constructor(e,t){this.operator=e,this.value=t}toString(e){return`${this.operator}${this.value.toString(e)}`}}class kr{constructor(e,t,n){this.left=e,this.operator=t,this.right=n}toString(e){return`${this.left.toString(e)}${lr}${this.operator}${lr}${this.right.toString(e)}`}}class wr{constructor(e,t,n){this.test=e,this.yes=t,this.no=n}toString(e){return`${this.test.toString(e)}${lr}?${lr}${this.yes.toString(e)}${lr}:${lr}${this.no.toString(e)}`}}class Tr{constructor(e,t,n){this.args=e,this.body=t,this.returnValue=n}toString(e){const{args:t,body:n,returnValue:r}=this,i=e||0,o=i+1,s=W(dr,i),a=W(dr,o),c=t?Ar("","",",",false,1,t).toString(i):"",u=[];return n&&k(u,n.toString(o)+(r?";":"")),r&&k(u,"return "+r.toString(o)),`function${lr}(${c})${lr}{${pr}${a}${O(u,pr+a)}${pr}${s}}`}}class Sr{constructor(e,t){this.base=e,this.props=t}toString(e){const{base:t,props:n}=this;let r=t.toString(e);return v(n,(function(t){t instanceof hr?h(t.value)?r+=`[${lr}${t.value}${lr}]`:r+="."+t.value:r+=`[${lr}${t.toString(e)}${lr}]`})),r}}class _r{constructor(e,t,n){this.name=e,this.value=t,this.isDeclaration=n}toString(e){const{name:t,value:n,isDeclaration:r}=this,i=`${t.toString(e)}${lr}=${lr}${n.toString(e)}`;return r?"var "+i:i}}class Cr{constructor(e,t){this.array=e,this.item=t}toString(e){const{array:t,item:n}=this;return Lr(Mr(t,[Er("push")]),[n]).toString(e)}}class Nr{constructor(e,t){this.value=e,this.type=t}toString(e){const{value:t,type:n}=this;return`typeof ${t.toString(e)}${lr}===${lr}${qr(n)}`}}function Er(e){return new hr(e)}function Ar(e,t,n,r,i,o){return new mr(e,t,n,r,i,o)}function Or(e){return new gr(e)}function Dr(e,t){let n=Ar("[","]",",",true,1,e);return l(t)?{toString:e=>`${n.toString(e)}.join(${Er(t).toString()})`}:n}function zr(e){return new yr(e)}function Lr(e,t){return new vr(e,t)}function Ir(e){return new $r(e)}function jr(){return new br}function Pr(e,t,n){return new kr(e,t,n)}function Ur(e,t,n){return new wr(e,t,n)}function Vr(e,t,n){return new Tr(e,t,n)}function Mr(e,t){return new Sr(e,t)}function Hr(e,t,n){return new _r(e,t,n)}function Rr(e,t){return new Cr(e,t)}function Fr(){return sr}function qr(e){return`"${e=e.replace(/\\?'/g,"\\'").replace(/\\?"/g,'\\"').replace(/\n\s*/g,"\\n")}"`}function Wr(e,t){const n=e?e.toString():undefined;if(t&&n&&ir[n])return ir[n];const r=or+nr++;return rr[r]=e,t&&n&&(ir[n]=r),r}function Kr(e){return e.split(".").filter((function(e){return e.length>0})).map(Er)}function Br(e,t){const n=[];ve(rr,(function(e,t){k(n,{toString:n=>function(e,t){return void 0!==t?`${e}${lr}=${lr}${t}`:e}(t,e?e.toString(n):undefined)})}));return`(${Vr(undefined,Ar("var ","",",",false,0,n),Vr(e,t)).toString()})()`}function Yr(e){return 6===e.type||5===e.type}function Gr(e,t,n,r,i,o,s){let a,c=false,u=function(e,o){return Gr(e,t,n,r,i,false,o)},f=function(e,t){return e.map((function(e){return u(e,t)}))};switch(e.type){case 1:a=Er(e.value);break;case 4:const l=e;a=function(e,t){return new xr(e,t)}(l.operator,u(l.node));break;case 5:let d=e,p=u(d.left),h=u(d.right);a=Pr(Yr(d.left)?Ir(p):p,d.operator,Yr(d.right)?Ir(h):h);break;case 6:const m=e;a=Ur(u(m.test),u(m.yes),u(m.no));break;case 7:a=Dr(f(e.nodes,s));break;case 8:const g=e,y=zr();v(g.keys,(function(e,t){const n=g.values[t];y.set(e,u(n))})),a=y;break;case 2:c=true;const $=e;a=t($)||n($,$.name?Kr($.name):[],$.name,o,s);break;case 3:c=true;const b=e;if(b.isStatic)a=b.raw;else if(2===b.lead.type){const e=b.lead,i=t(e),c=f(b.nodes||[]);i?a=r(i,c,o):(e.name&&v(Kr(e.name),(function(e){c.unshift(e)}),true),a=n(b,c,undefined,o,s))}else a=b.nodes?r(u(b.lead),f(b.nodes||[]),o):r(u(b.lead),Kr(b.keypath),o);break;default:c=true;const x=e;a=i(x,u(x.name,x),x.args.length?f(x.args):undefined,o)}return!o||c?a:zr({value:a})}const Zr=[true],Jr=[],Qr=[],Xr=[],ei=[true],ti=[],ni=[],ri=["$keypath","$length","$event","$data"],ii={},oi=Er(undefined),si=Er(true);let ai=undefined,ci=undefined,ui="",fi="",li="",di="",pi="",hi="",mi="",gi="",yi="",vi="",$i="",bi="",xi="",ki="",wi="",Ti="",Si="",_i="",Ci="",Ni="",Ei="",Ai="",Oi="",Di="",zi="",Li="",Ii="",ji="",Pi="",Ui="",Vi="",Mi="",Hi="",Ri="",Fi="",qi="",Wi="",Ki="",Bi="",Yi="",Gi="",Zi="",Ji="";class Qi{constructor(e){this.text=e}toString(e){return zr({type:Er(2),isPure:si,operator:Ei,text:this.text}).toString(e)}}class Xi{constructor(e){this.buffer=jr(),this.append(e)}append(e){this.buffer.append(e)}toString(e){return zr({type:Er(1),isPure:si,operator:Ni,text:this.buffer}).toString(e)}}function eo(e){if(N(ri,e))switch(e){case"$keypath":return Yi;case"$length":return Gi;case"$event":return Zi;case"$data":return Ji;default:return e}}function to(e){const{name:t,root:n,lookup:r,offset:i,literals:o}=e;if(o){const e=eo(o[0]);if(gn(e)){const t=be(o);return t[0]=e,O(t,".")}}else{const e=eo(t);if(gn(e))return e}if(S(Qr)&&false===n&&false===r&&0===i)return""===t?Bi:Mr(Bi,Kr(t))}function no(e,t){return t?e:Mr(e,[Er("value")])}function ro(e,t,n,r,i){const{root:o,lookup:s,offset:a}=e,{length:c}=t,u=function(e,t){return e?Er(0):Pr(Mr(Fi,[Er("length")]),"-",Er(1+(t||0)))}(o,a);let f=oi;i&&9===i.type&&s&&n&&c>0&&(f=c>1?Mr(Ui,t):po(Pi,Ui,n));let d=Lr(wi,[Fi,u,l(n)?Er(n):Dr(t,"."),Dr(t),s?si:oi,f]);if(n&&1===c)if(o||a||s)if(o||a){const e=Or(),t=Fr();e.add(Hr(t,Mr(Fi,[u]))),e.add(Lr(_i,[Mr(Lr(Mr(t,[Er("getScope")])),[Er(n)]),Lr(Mr(t,[Er("getKeypath")]),[Er(n)])])),d=e}else d=Lr(Ti,[Fi,u,Er(n),f]);else d=Lr(_i,[Mr(Bi,t),Lr(Mr(Mr(Fi,[u]),[Er("getKeypath")]),[Er(n)])]);else if(!n&&!c){const e=Or(),t=Fr();e.add(Hr(t,Mr(Fi,[u]))),e.add(Lr(_i,[Lr(Mr(t,[Er("getScope")])),Mr(t,[Er("keypath")])])),d=e}return no(d,r)}function io(e,t,n){let r;switch(t.length){case 0:r=Lr(_i,[e]);break;case 1:r=Lr(_i,[Mr(e,t)]);break;default:r=Lr(Si,[e,Dr(t)])}return no(r,n)}function oo(e,t,n,r){const i=Or(),o=Fr();return i.add(Hr(o,t)),i.add(Ur(new Nr(o,"function"),Lr(o,n),Lr(Mr(ji,[Er("fatal")]),[Er(`[${e.raw}] is not a function.`)]))),no(Lr(_i,[i]),r)}function so(e,t){const n=Gr(e,to,ro,io,oo,t);return e.isStatic?Wr(n,true):n}function ao(e){const t=jr();return k(ti,t),v(e,(function(e){ii[e.type](e)})),_(ti),t}function co(e){return gn(e.value)?Er(e.value):e.expr?so(e.expr):e.children?ao(e.children):oi}function uo(e){ci=undefined;const t=[];return v(e,(function(e){const n=ii[e.type](e);n instanceof hr&&undefined===n.value||k(t,n)})),ci=u