yox
Version:
A lightweight mvvm framework
3 lines (2 loc) • 48.5 kB
JavaScript
const t=/^!(?:\s|--)/,e="undefined"!=typeof window?window:undefined,n=function(){},r=Object.freeze({}),i=Object.freeze([]),s=/yox/.test(n.toString())?2:3,o={leftDelimiter:"{",rightDelimiter:"}",uglifyCompiled:false,minifyCompiled:false,logLevel:s};function c(t){return"function"==typeof t}function u(t){return Array.isArray(t)}function a(t){return null!==t&&"object"==typeof t}function f(t){return"string"==typeof t}function l(t){return"number"==typeof t&&!isNaN(t)}function d(t){return true===t||false===t}function p(t){return!isNaN(t-parseFloat(t))}var h=Object.freeze({__proto__:null,func:c,array:u,object:a,string:f,number:l,boolean:d,numeric:p});function g(t,e,n){return u(n)?t.apply(e,n):undefined!==e?t.call(e,n):undefined!==n?t(n):t()}class y{constructor(t,e){this.type=t,this.phase=y.PHASE_CURRENT,e&&(this.originalEvent=e)}static is(t){return t instanceof y}preventDefault(){const t=this;if(!t.isPrevented){const{originalEvent:e}=t;e&&e.preventDefault(),t.isPrevented=true}return t}stopPropagation(){const t=this;if(!t.isStoped){const{originalEvent:e}=t;e&&e.stopPropagation(),t.isStoped=true}return t}prevent(){return this.preventDefault()}stop(){return this.stopPropagation()}}function m(t,e,n){const{length:r}=t;if(r)if(n)for(let n=r-1;n>=0&&false!==e(t[n],n);n--);else for(let n=0;n<r&&false!==e(t[n],n);n++);}function v(t,e){t[t.length]=e}function x(t,e){t.unshift(e)}function b(t,e,n){u(e)?m(e,(function(e){n(t,e)})):n(t,e)}function k(t,e){b(t,e,v)}function $(t,e){b(t,e,x)}function S(t,e,n){let r=-1;return m(t,(function(t,i){if(false===n?t==e:t===e)return r=i,false})),r}function w(t){const{length:e}=t;if(e>0)return t[e-1]}function _(t){const{length:e}=t;if(e>0)return t.pop()}function O(t,e,n){let r=0;return m(t,(function(i,s){(false===n?i==e:i===e)&&(t.splice(s,1),r++)}),true),r}function A(t,e,n){return S(t,e,n)>=0}function E(t,e,n){let r={};return m(t,(function(t){r[e?t[e]:t]=n||t})),r}function T(t,e){return t.join(e)}function C(t){return!u(t)||!t.length}y.PHASE_CURRENT=0,y.PHASE_UPWARD=1,y.PHASE_DOWNWARD=-1;var D=Object.freeze({__proto__:null,each:m,push:k,unshift:$,indexOf:S,last:w,pop:_,remove:O,has:A,toArray:function(t){return u(t)?t:g(i.slice,t)},toObject:E,join:T,falsy:C});function N(t,e){return null!=t&&t.toString?t.toString():undefined!==e?e:""}function L(t){return c(t)&&N(t).indexOf("[native code]")>=0}let z=function(){const t=Object.create(null);return{get:e=>t[e],set(e,n){t[e]=n},has:e=>e in t,keys:()=>Object.keys(t)}};L(Object.create)||(z=function(){const t={};return{get:e=>t.hasOwnProperty(e)?t[e]:undefined,set(e,n){t[e]=n},has:e=>t.hasOwnProperty(e),keys:()=>Object.keys(t)}});var V=z;function P(t){const e=V();return function(n){const r=e.get(n);if(undefined!==r)return r;const i=t(n);return e.set(n,i),i}}function j(t){const e=V();return function(n,r){let i=e.get(n);if(i){const t=i.get(r);if(t)return t}else i=V(),e.set(n,i);const s=t(n,r);return i.set(r,s),s}}const I=/-([a-z])/gi,R=/\B([A-Z])/g,F=/^[a-z]/,K=P((function(t){return t.replace(I,(function(t,e){return X(e)}))})),M=P((function(t){return t.replace(R,(function(t,e){return"-"+tt(e)}))})),W=P((function(t){return t.replace(F,X)}));function H(t,e){return T(new Array(e+1),t)}function U(t){return rt(t)?"":t.trim()}function B(t,e,n){return l(n)?e===n?"":t.slice(e,n):t.slice(e)}function Y(t,e,n){return t.indexOf(e,undefined!==n?n:0)}function q(t,e,n){return t.lastIndexOf(e,undefined!==n?n:t.length)}function G(t,e){return 0===Y(t,e)}function Z(t,e){const n=t.length-e.length;return n>=0&&q(t,e)===n}function J(t,e){return t.charAt(e||0)}function Q(t,e){return t.charCodeAt(e||0)}function X(t){return t.toUpperCase()}function tt(t){return t.toLowerCase()}function et(t,e){return Y(t,e)>=0}function nt(t,e){const n=Object.create(null);return m(t.split(e||","),(function(t){n[t]=true})),n}function rt(t){return!f(t)||!t.length}var it=Object.freeze({__proto__:null,camelize:K,hyphenate:M,capitalize:W,repeat:H,trim:U,slice:B,indexOf:Y,lastIndexOf:q,startsWith:G,endsWith:Z,charAt:J,codeAt:Q,upper:X,lower:tt,has:et,toMap:nt,falsy:rt});const st=/\./g,ot=/\*/g,ct=/\*\*/g,ut=j((function(t,e){return t===e||G(t,e+=".")?e.length:-1})),at=P((function(t){return Y(t,".")<0?[t]:t.split(".")}));function ft(t,e){const n=f(t)?at(t):t;for(let t=0,r=n.length-1;t<=r&&false!==e(n[t],t,r);t++);}const lt=j((function(t,e){return t&&e?t+"."+e:t||e})),dt=P((function(t){return et(t,"*")})),pt=P((function(t){return new RegExp(`^${t.replace(st,"\\.").replace(ot,"(\\w+)").replace(ct,"([.\\w]+?)")}$`)})),ht=j((function(t,e){const n=t.match(pt(e));return n?n[1]:undefined})),gt={value:undefined};function yt(t){return Object.keys(t)}function mt(t,e){for(let n in t)if(false===e(t[n],n))break}function vt(t,e){return mt(e,(function(e,n){t[n]=e})),t}function xt(t,e){let n=t;return u(t)?e?(n=[],m(t,(function(t,r){n[r]=xt(t,e)}))):n=t.slice():a(t)&&(n={},mt(t,(function(t,r){n[r]=e?xt(t,e):t}))),n}function bt(t){return c(t.get)?t.get():t}function kt(t,e,n){let r=t;return ft(e,(function(t,e,i){if(null==r)return r=undefined,false;{let s=r[t],o=undefined!==s;s&&(s=(n||bt)(s)),e===i?o?(gt.value=s,r=gt):r=undefined:r=s}})),r}var $t=Object.freeze({__proto__:null,keys:yt,each:mt,extend:vt,merge:function(t,e){return t&&e?vt(vt({},t),e):t||e},copy:xt,get:kt,set:function(t,e,n,r){let i=t;ft(e,(function(t,e,s){if(e===s)i[t]=n;else if(i[t])i=i[t];else{if(!r)return false;i=i[t]={}}}))},has:function(t,e){return undefined!==t[e]},falsy:function(t){return!a(t)||u(t)||!yt(t).length}});const St="undefined"!=typeof console?console:null,wt=e&&/edge|msie|trident/i.test(e.navigator.userAgent)?"":"%c",_t=St?wt?function(t,e,n){St.log(wt+t,n,e)}:function(t,e){St.log(t,e)}:n;function Ot(){const{logLevel:t}=o;return t>=1&&t<=5?t:s}function At(t){return`background-color:${t};border-radius:12px;color:#fff;font-size:10px;padding:3px 6px;`}var Et=Object.freeze({__proto__:null,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5,debug:function(t,e){Ot()<=1&&_t(e||"Yox debug",t,At("#999"))},info:function(t,e){Ot()<=2&&_t(e||"Yox info",t,At("#2db7f5"))},warn:function(t,e){Ot()<=3&&_t(e||"Yox warn",t,At("#f90"))},error:function(t,e){Ot()<=4&&_t(e||"Yox error",t,At("#ed4014"))},fatal:function(t,e){if(Ot()<=5)throw new Error(`[${e||"Yox fatal"}]: ${t}`)}});class Tt{constructor(t){this.ns=t||false,this.listeners={}}fire(t,e,n){let r=this,i=f(t)?r.toEvent(t):t,s=r.listeners[i.type],o=true;if(s){s=s.slice();const t=e&&y.is(e[0])?e[0]:undefined;for(let c=0,u=s.length;c<u;c++){let u=s[c];if(!Dt(i.ns,u)||!A(s,u)||n&&!n(i,e,u))continue;let a=g(u.listener,u.ctx,e);if(u.num=u.num?u.num+1:1,u.num===u.max&&r.off(i.type,{ns:i.ns,listener:u.listener}),t&&(false===a?t.prevent().stop():t.isStoped&&(a=false)),false===a){o=false;break}}}return o}on(t,e){const n=this,r=n.listeners,i=c(e)?{listener:e}:e;if(a(i)&&c(i.listener)){if(!f(i.ns)){const e=n.toEvent(t);i.ns=e.ns,t=e.type}k(r[t]||(r[t]=[]),i)}}off(t,e){const n=this,r=n.listeners;if(t){const i=n.toFilter(t,e),s=function(t,e){m(t,(function(e,n){Ct(i.listener,e)&&Dt(i.ns,e)&&t.splice(n,1)}),true),t.length||delete r[e]};i.type?r[i.type]&&s(r[i.type],i.type):i.ns&&mt(r,s)}else n.listeners={}}has(t,e){let n=this.listeners,r=this.toFilter(t,e),i=true,s=function(t){return m(t,(function(t){if(Ct(r.listener,t)&&Dt(r.ns,t))return i=false})),i};return r.type?n[r.type]&&s(n[r.type]):r.ns&&mt(n,s),!i}toEvent(t){const e={type:t,ns:""};if(this.ns){const n=Y(t,".");n>=0&&(e.type=B(t,0,n),e.ns=B(t,n+1))}return e}toFilter(t,e){let n;if(n=e?c(e)?{listener:e}:e:{},f(n.ns))n.type=t;else{const e=this.toEvent(t);n.type=e.type,n.ns=e.ns}return n}}function Ct(t,e){return!t||t===e.listener}function Dt(t,e){const{ns:n}=e;return!n||!t||n===t}let Nt;"function"==typeof setImmediate&&L(setImmediate)&&(Nt=setImmediate),Nt="function"==typeof MessageChannel&&L(MessageChannel)?function(t){const e=new MessageChannel;e.port1.onmessage=t,e.port2.postMessage(1)}:setTimeout;var Lt=Nt;let zt;class Vt{constructor(t){this.tasks=[],this.hooks=t||r}static shared(){return zt||(zt=new Vt)}append(t,e){const n=this,{tasks:r}=n;k(r,{fn:t,ctx:e}),1===r.length&&Lt((function(){n.run()}))}prepend(t,e){const n=this,{tasks:r}=n;$(r,{fn:t,ctx:e}),1===r.length&&Lt((function(){n.run()}))}clear(){this.tasks.length=0}run(){const t=this,{tasks:e,hooks:n}=t,{length:r}=e;if(r){t.tasks=[],n.beforeTask&&n.beforeTask();for(let t=0;t<r;t++)g(e[t].fn,e[t].ctx);n.afterTask&&n.afterTask()}}}const Pt={},jt={},It={},Rt={};function Ft(t,e){return jt[e.name]||"portal"===t.tag&&"to"===e.name||"slot"===t.tag&&"name"===e.name}function Kt(t,e){return{type:2,isStatic:true,name:t,ns:e}}function Mt(t,e,n){return{type:3,ns:e,name:t,modifier:n}}function Wt(t,e,n,r){return{type:9,from:t,to:e,equal:n||undefined,index:r,isVirtual:true}}function Ht(t){return{type:5,text:t,isStatic:true,isLeaf:true}}Pt.slot=Pt.portal=Pt.fragment=Pt.template=jt.key=jt.ref=jt.slot=true,It["if"]=6,It.each=9,Rt.fragment=5,Rt.portal=6,Rt.slot=7;const Ut=/^[A-Z]|-/,Bt=/&[#\w\d]{2,6};/,Yt=r,qt=r,Gt=r,Zt=r;function Jt(t,e,n){if(t.isComponent)return Kt(K(e),n);if("style"===e)return{type:4,isStatic:!0};const r=Kt(e,n);return te(e)&&(r.defaultValue="spellcheck"===e||"img"===t.tag&&"draggable"===e),r}function Qt(t,e,n){return Xt(t)?function(t,e){return N(e)}(0,e):te(t)?ee(t,e,n):e}function Xt(t){return Gt[t]}function te(t){return Zt[t]}function ee(t,e,n){const r=true===e||"true"===e||e===t;return r===n?undefined:r?"true":"false"}function ne(t,e){let n=false,r=false,i=false;return e?i=true:(n=undefined!==qt[t],!n&&Ut.test(t)?i=true:"style"===t&&(r=true)),function(t,e,n,r,i){const s="slot"===t,o=!i&&!s&&!!Pt[t],c=!i&&!s&&!o;return{type:1,tag:t,dynamicTag:e,isSvg:n,isStyle:r,isStatic:c,isNative:c,isVirtual:o,isComponent:i}}(t,e,n,r,i)}function re(t,e){return f(e)&&Bt.test(e)?t.html=e:t.text=e,true}function ie(t){return undefined!==t}const se={};function oe(t){return t>0&&t<33||160===t}function ce(t){return t>47&&t<58}function ue(t){return 64===t}function ae(t){return 36===t||95===t||t>96&&t<123||t>64&&t<91}function fe(t){return ae(t)||ce(t)}function le(t,e,n,r){return{type:5,raw:r,left:t,operator:e,right:n,isStatic:ve([t,n])}}function de(t,e,n){let r=false,i=true,s=0;return"this"===e?(e="",i=false):".."===e?(e="",i=false,s=1):"~"===e?(e="",r=true,i=false):e=me(e),n?pe(e,t):ge(t,e,r,i,s)}function pe(t,e){return{type:1,raw:e,value:t,isStatic:true}}function he(t,e){let n=e.shift(),r=false,i=true,s=0;if(e.length>0){let o=true,c=[],u="",a=[];if(m(e,(function(t){if(o)if(1===t.type){const e=t;if(".."===e.raw)return s+=1,void(u=u?u+"/..":"..");if("this"!==e.raw){const t=N(e.value);k(c,t),u&&(u+=Z(u,"..")?"/":"."),u+=t}}else o=false;o||k(a,t)})),2===n.type){const e=n;r=e.root,i=e.lookup,s+=e.offset;let f=e.name;if(f&&(f=me(f,e),$(c,f)),f=T(c,"."),o)n=ge(t,f,r,i,s,c);else{let o=e.raw;if(u){let t=".";"~"!==o&&".."!==o||(t="/"),o+=t+u}n=ye(t,ge(o,f,r,i,s,c),undefined,a,r,i,s)}}else n=o?ye(t,n,T(c,"."),undefined,r,i,s):ye(t,n,undefined,a,r,i,s)}return n}function ge(t,e,n,r,i,s){return{type:2,raw:t,name:e,root:n,lookup:r,offset:i,literals:s&&s.length>1?s:undefined}}function ye(t,e,n,r,i,s,o){return{type:3,raw:t,lead:e,keypath:n,nodes:r,root:i,lookup:s,offset:o,isStatic:e.isStatic&&(!r||ve(r))}}function me(t,e){return ue(Q(t,0))&&(t="$slot_"+B(t,1),e&&(e.name=t)),t}function ve(t){let e=true;return m(t,(function(t){if(!t.isStatic)return e=false})),e}se["true"]=true,se["false"]=false,se["null"]=null,se[void 0]=undefined;const xe={"+":true,"-":true,"~":true,"!":true,"!!":true},be={"*":15,"/":15,"%":15,"+":14,"-":14,"<<":13,">>":13,">>>":13,"<":12,"<=":12,">":12,">=":12,"==":11,"!=":11,"===":11,"!==":11,"&":10,"^":9,"|":8,"&&":7,"||":6};class ke{constructor(t){const e=this;e.index=-1,e.end=t.length,e.code=0,e.content=t,e.go()}go(t){let e=this,{index:n,end:r}=e;n+=t||1,n>=0&&n<r?(e.code=e.codeAt(n),e.index=n):(e.code=0,e.index=n<0?-1:r)}skip(t){const e=this,n=t&&t<0;if(0===e.code){const n=e.index;if(e.go(t),!oe(e.code))return void e.go(n-e.index)}else if(!oe(e.code))return;for(;;){if(!oe(e.code)){n&&e.go();break}e.go(t)}}is(t){return this.code===t}pick(t,e){return B(this.content,t,ie(e)?e:this.index)}codeAt(t){return Q(this.content,t)}scanToken(){const t=this,{code:e,index:n}=t;let r=false;if(ue(e)&&(r=true,t.go()),ae(t.code))return t.scanTail(n,[t.scanIdentifier(n,r)]);if(r&&t.go(-1),ce(e))return t.scanNumber(n);switch(e){case 0:return;case 39:case 34:return t.scanTail(n,[t.scanString(n,e)]);case 46:return t.go(),ce(t.code)?t.scanNumber(n):t.scanPath(n);case 126:if(47===t.codeAt(n+1))return t.scanPath(n);break;case 40:return t.go(),t.scanTernary(41);case 91:return t.scanTail(n,[(i=t.scanTuple(n,93),s=t.pick(n),{type:7,raw:s,nodes:i,isStatic:ve(i)})]);case 123:return t.scanObject(n)}var i,s;const o=t.scanOperator(n);if(o&&xe[o]){const e=t.scanTernary();if(e){if(1===e.type){const r=e.value;if(l(r))return t.skip(-1),pe(-r,t.pick(n))}return t.skip(-1),function(t,e,n){return{type:4,raw:n,operator:t,node:e,isStatic:e.isStatic}}(o,e,t.pick(n))}}}scanNumber(t){const e=this;for(;ce(n=e.code)||46===n;)e.go();var n;const r=e.pick(t);if(p(r))return pe(+r,r)}scanString(t,e){const n=this;t:for(;;)switch(n.go(),n.code){case 92:n.go();break;case e:n.go();break t;case 0:break t}const r=n.pick(t);return pe(new Function("return "+r)(),r)}scanObject(t){let e,n=this,r=[],i=[],s=true;n.go();t:for(;;)switch(n.code){case 125:n.go();break t;case 0:break t;case 58:n.go(),s=false;break;case 44:n.go(),s=true;break;default:if(e=n.scanTernary(),s){if(e)if(n.skip(),2===e.type)k(r,e.name);else{if(1!==e.type)break t;k(r,e.value)}}else{if(!e)break t;n.skip(),k(i,e)}}return function(t,e,n){return{type:8,raw:n,keys:t,values:e,isStatic:ve(e)}}(r,i,n.pick(t))}scanTuple(t,e){let n,r=this,i=[];r.go();t:for(;;)switch(r.code){case e:r.go();break t;case 0:break t;case 44:r.go();break;default:n=r.scanTernary(),n&&(r.skip(),k(i,n))}return i}scanPath(t){let e,n=this,r=[];for(;e="this",n.is(46)?(n.go(),e=".."):n.is(126)&&(n.go(),e="~"),k(r,de(e,e,r.length>0)),n.is(47);){n.go();const{index:e,code:i}=n;let s=false;if(ue(i)&&(s=true,n.go()),ae(n.code))return k(r,n.scanIdentifier(e,s,true)),n.scanTail(t,r);if(s&&n.go(-1),!n.is(46))break;n.go()}}scanTail(t,e){let n,r=this;t:for(;;)switch(r.code){case 40:e=[(i=he(r.pick(t),e),s=r.scanTuple(r.index,41),o=r.pick(t),{type:9,raw:o,name:i,args:s})];break;case 46:if(r.go(),fe(r.code)){k(e,r.scanIdentifier(r.index,false,true));break}break t;case 91:if(r.go(),n=r.scanTernary(93),n){k(e,n);break}break t;default:break t}var i,s,o;return he(r.pick(t),e)}scanIdentifier(t,e,n){const r=this;do{r.go()}while(fe(r.code));const i=r.pick(t);return e&&1===i.length&&r.fatal(t,"A slot identifier must be followed by its name."),!n&&i in se?pe(se[i],i):de(i,i,n)}scanOperator(t){const e=this;switch(e.code){case 47:case 37:case 126:case 94:case 42:case 43:case 45:e.go();break;case 33:e.go(),e.is(33)?e.go():e.is(61)&&(e.go(),e.is(61)&&e.go());break;case 38:e.go(),e.is(38)&&e.go();break;case 124:e.go(),e.is(124)&&e.go();break;case 61:e.go(),e.is(61)&&(e.go(),e.is(61)&&e.go());break;case 60:e.go(),(e.is(61)||e.is(60))&&e.go();break;case 62:e.go(),e.is(61)?e.go():e.is(62)&&(e.go(),e.is(62)&&e.go())}if(e.index>t)return e.pick(t)}scanBinary(t){let e,n,r,i,s,o,c=this,u=[];for(;;){if(c.skip(),k(u,c.index),e=c.scanToken(),e){if(k(u,e),k(u,c.index),c.skip(),r=c.scanOperator(c.index),r&&(i=be[r])){for(;n=u.length-4,(s=u[n])&&(o=be[s])&&o>=i;)u.splice(n-2,5,le(u[n-2],s,u[n+2],c.pick(u[n-3],u[n+3])));k(u,r);continue}r=undefined}break}for(;;){if(!(u.length>=7))return u[1];n=u.length-4,u.splice(n-2,5,le(u[n-2],u[n],u[n+2],c.pick(u[n-3],u[n+3])))}}scanTernary(t){const e=this;e.skip();let n,r,i=e.index,s=e.scanBinary(i);return e.is(63)&&(e.go(),n=e.scanTernary(),e.is(58)&&(e.go(),r=e.scanTernary()),s&&n&&r&&(e.skip(-1),s=function(t,e,n,r){return{type:6,raw:r,test:t,yes:e,no:n,isStatic:ve([t,e,n])}}(s,n,r,e.pick(i)))),ie(t)&&(e.skip(),e.is(t)&&e.go()),s}fatal(t,e){}}const $e=P((function(t){return new ke(t).scanTernary(0)})),Se={},we=/\s*:\s*([_$a-z]+)$/i,_e=/^\s*[\n\r]\s*|\s*[\n\r]\s*$/g,Oe=/\s*(=>|->)\s*/,Ae=/<(\/)?([a-z][-a-z0-9]*|\$[^\s]*)/i,Ee=/^\s*([-$.:\w]+)(?:=(['"]))?/,Te=/^\s*(\/)?>/;function Ce(t,e){return U(B(t,e.length))}function De(t){if(t.safe&&1===t.expr.type)return Ht(N(t.expr.value))}function Ne(t,e){return t>=0&&e>=0?t<e?-1:1:t>=0?-1:e>=0?1:0}function Le(t,e,n,r){for(;;){const i=e.text.indexOf("\x3c!--",e.position),s=e.text.indexOf("--\x3e",e.position);switch(Ne(i,s)){case-1:e.position=i+1;const o={startIndex:i};k(t,o),n&&n(e,o);break;case 1:e.position=s+1;const{length:c}=t;if(c>0){const n=_(t);n.endIndex=s+"--\x3e".length;const i=1===c;if(r){if(false===r(e,n,i))return}if(i)return}break;case 0:return}}}function ze(t){const e=[];let n=false;for(let r=0;r<t.length;r++){const i=t[r];if(5===i.type){const s=i;Le(e,{text:s.text,position:0},(function(t,e){e.index=r,e.text=B(s.text,0,e.startIndex)}),(function(e,i){const o=i.index,c=r,u=i.text,a=B(s.text,i.endIndex);if(o===c)return e.text=s.text=u+a,void(e.position=i.startIndex);let f=o,l=c;u&&(t[o].text=u,f++),a&&(t[c].text=a,l--);const d=l-f+1;return d>0&&(n=true,t.splice(f,d),r=f-1),false}))}}if(n)for(let e=0;e<t.length;e++){const n=t[e];if(5===n.type){const r=t[e+1];r&&5===r.type&&(n.text+=r.text,t.splice(e+1,1))}}}function Ve(e){let n,r,i,s,c,u=H(o.leftDelimiter,2),a=H(o.rightDelimiter,2),f=o.leftDelimiter,l=o.rightDelimiter,d=[],p=[],h=[],g=[],y=[],v=[],x=e.length,b=0,$=0,O=0,A=0,E=1,T=[],C=[],D=function(t){const e=w(p);if(e&&1===e.type){const r=e;r.tag!==t&&(n=r.tag,void 0!==Yt[n])&&N(r.type,r.tag)}var n},N=function(t,e){const n=_(p),i=1===t,s=2===t,o=4===t,c=3===t,u=w(p);let{children:a}=n;if(a&&a.length>1&&(r||(ze(a),a.length||(a=n.children=undefined))),a){const t=1===a.length&&a[0];if(t)switch(t.type){case 5:i?L(n,t):r&&(s?I(r,n,t):o?P(r,n,t):c&&M(r,n,t));break;case 11:i?z(n,t):r&&(s||o||c)&&R(r,n,t)}}else r&&(s?j(r,n):o?V(r,n):c&&F(r,n));return n.isVirtual&&!n.children&&Q(n),i?q(n):r&&s&&Z(r,n),u&&u.isStatic&&!n.isStatic&&(u.isStatic=false),n},L=function(t,e){t.isNative&&re(t,e.text)&&(t.children=undefined)},z=function(t,e){t.isNative&&(e.safe&&re(t,e.expr)||!e.safe&&function(t,e){return t.html=e,!0}(t,e.expr))&&(t.children=undefined)},V=function(t,e){Q(e)},P=function(t,e,n){n.text?(e.value=n.text,e.children=undefined):Q(e)},j=function(t,e){Ft(t,e)||(e.value=function(t,e,n){return!!t.isComponent||(Xt(e)?void 0:te(e)?ee(e,!0,n):"")}(t,e.name,e.defaultValue))},I=function(t,e,n){const{text:r}=n;t.isNative?e.value=Qt(e.name,r,e.defaultValue):e.value=r,e.children=undefined},R=function(t,e,n){const{expr:r}=n;if(1===r.type){let n=r.value;t.isNative&&2===e.type&&(n=Qt(e.name,n,e.defaultValue)),e.value=n}else e.expr=r;e.children=undefined},F=function(t,e){e.value=true},M=function(t,e,n){let r,i,{ns:s}=e,{text:o}=n,c="o"===s;try{r=$e(o)}catch(u){i=u}if(r)e.expr=r,e.value=1===r.type?r.value:o;else{if(!c)throw i;e.value=o}e.children=undefined},W=function(t){let e=t,n=[],r=false,i=false;for(;k(n,e),e.next;)e=e.next;m(n,(function(t){t.children&&(!r&&t.next&&delete t.next,i=r=true)}),true),i||Q(t)},q=function(t){const{tag:e,slot:n}=t;("template"===e||"fragment"===e||"portal"===e)&&!t.children?Q(t):t.isNative&&function(t){let{attrs:e}=t,n=!1;if(e&&m(e,(function(t){"type"===(2===t.type?t.name:void 0)&&(n=!0)})),t.isStyle&&!n){const e=Kt("type");e.value="text/css",k(t.attrs||(t.attrs=[]),e)}}(t)},Z=function(t,e){const{name:n,value:r}=e,i="slot"===n;if(Ft(t,e)){const s=i;t[n]=s?r:e,Q(e),e.isStatic&&(e.isStatic=false)}},Q=function(t,e){let n,i,s,o=w(p);o?(n=r&&r===o,i=n?o.attrs:o.children):i=d,i&&(s=S(i,t),s>=0&&(e?i[s]=e:(i.splice(s,1),o&&!i.length&&(n?delete o.attrs:o.children=undefined))))},X=function(t){r||D();let e=t.type,n=w(p),s=undefined,o=undefined,c=undefined;if(7===e){const t=w(g);t&&(6===t.type?s=t:7===t.type&&(o=t))}else if(8===e){const t=w(g),e=w(v);t&&n===t?6===t.type?s=t:7===t.type&&(o=t):e&&n===e&&9===e.type&&(c=e)}else if(n)if(r&&1===n.type)k(r.attrs||(r.attrs=[]),t);else{const s=n.children||(n.children=[]),o=w(s);if(11===e&&(!r||i&&s.length>0)){const n=De(t);n&&(t=n,e=n.type)}if(o&&5===e){if(5===o.type)return void(o.text+=t.text);if(11===o.type){const e=De(o);if(e)return s[s.length-1]=e,void(e.text+=t.text)}}k(s,t)}else k(d,t);6===e?(k(h,t),k(g,t)):9===e?(k(y,t),k(v,t)):s?(s.next=t,g[g.length-1]=t,N(s.type)):o?(o.next=t,g[g.length-1]=t,N(o.type)):c&&(c.next=t,v[v.length-1]=t,N(c.type)),t.isLeaf?n&&n.isStatic&&!t.isStatic&&(n.isStatic=false):k(p,t)},tt=function(t){(t=t.replace(_e,""))&&X(Ht(t))},et=[function(t){if(!n&&!r){const e=t.match(Ae);if(e&&0===e.index){let t=e[2];if("/"===e[1])D(t),r=N(1);else{let e;"$"===J(t)&&(t=B(t,1),e=$e(t));const n=ne(t,e);X(n),r=n}return e[0]}}},function(t){if(n)return;const e=t.match(Te);return e&&r&&!i?("/"===e[1]&&N(r.type,r.tag),r=undefined,e[0]):void 0},function(t){if(!n&&r&&!i){const e=t.match(Ee);if(e){let t,n=e[1];if("model"===n||"transition"===n)t=Mt("",n);else if(G(n,"on-")){const e=Ce(n,"on-"),r=K(e).split(".");t=Mt(r[0],"event",r[1])}else if("lazy"===n)t=Mt("","lazy");else if(G(n,"lazy-")){const e=Ce(n,"lazy-");t=Mt(K(e),"lazy")}else if(G(n,"o-")){const e=Ce(n,"o-"),r=K(e).split(".");t=Mt(r[0],"o",r[1])}else{const e=n.split(":");t=2===e.length?Jt(r,e[1],e[0]):Jt(r,n)}return X(t),c=e[2],c?i=t:N(t.type),e[0]}}},function(t){let e,s=undefined;if(!n&&i&&c)e=t.match(Se[c]||(Se[c]=new RegExp(c))),e?(s=B(t,0,e.index),tt(s),i.children||X(Ht("")),s+=c,N(i.type),i=undefined):(s=t,tt(s));else if(r)s=t;else{let r="";if(!n&&(e=t.match(Ae),e)){const n=e.index;Ne(n,t.indexOf("\x3c!--"))<0&&(s=B(t,0,n),r=s)}if(!ie(s)){let e=-1,i=-1;const o=n,c=n||[];n=undefined,Le(c,{text:t,position:0},(function(i,o){e<0&&(e=o.startIndex,s=t,r=t,n=c)}),(function(c,u,a){a&&(n=undefined,i=u.endIndex,e>=0?o?(s=B(t,0,i),r=s):(s=B(t,0,i),r=B(t,0,e)):(s=B(t,0,i),r=s))}))}ie(s)||(s=t,r=t),tt(r)}return s}],nt=[function(t){if(G(t,"#each")){let e=t=U(Ce(t,"#each")),n=undefined,r=t.match(we);if(r&&(n=r[1],e=B(t,0,-1*r[0].length)),r=e.match(Oe),r){const t=e.split(Oe),i=$e(t[0]),s=$e(t[2]);if(i&&s)return Wt(i,s,"=>"===r[1],n)}else{const t=$e(e);if(t)return Wt(t,undefined,false,n)}}},function(t){if(G(t,">")){t=Ce(t,">");return function(t){return{type:10,expr:t,isLeaf:!0}}($e(t))}},function(t){if(G(t,"#if")){t=Ce(t,"#if");return function(t){return{type:6,expr:t,isVirtual:!0}}($e(t))}},function(t){if(G(t,"else if")){t=Ce(t,"else if");return function(t){return{type:7,expr:t,isVirtual:!0}}($e(t))}},function(t){if(G(t,"else"))return t=Ce(t,"else"),{type:8,isVirtual:!0}},function(t){if(G(t,"...")){t=Ce(t,"...");const e=$e(t);if(r&&r.isComponent)return function(t){return{type:12,expr:t,isLeaf:!0}}(e)}},function(e){if(!t.test(e)){e=U(e);return function(t,e){return{type:11,expr:t,safe:e,isLeaf:!0,isStatic:t.isStatic}}($e(e),2===E)}}],rt=function(t){for(;t;)m(et,(function(e){const n=e(t);if(n)return t=B(t,n.length),false}))},it=function(t){if("/"===J(t)){D();const e=B(t,1);let n=It[e],r=undefined,i=undefined;if(6===n){const t=_(g);t&&(n=t.type,r=_(h))}else if(9===n){const t=_(v);t&&(n=t.type,i=_(y))}N(n),r?W(r):i&&W(i)}else m(nt,(function(e){const n=e(t);if(n)return X(n),false}))},st=function(){if(b=A+a.length,!(b<=x))return true;b<x&&J(e,b)===l?3===E&&($=b+1):2===E&&($=b),_(T),ot(A)},ot=function(t){T.length||k(C,t)};for(;;)if(ot($),O=Y(e,u,$),A=Y(e,a,$),A>=$&&(O<0||A<O)){if(st())break}else{if(!(O>=$))break;if(E=2,ot(O),O+=u.length,O<x&&(J(e,O)===f&&(E=3,O++),ot(O),ot(E),k(T,true),O<x&&(A=Y(e,a,O),A>=O&&($=Y(e,u,O),($<0||A<$)&&st()))))break}E=1;for(let t=0,n=C.length;t<n;t+=5)b=C[t],O=C[t+1],ie(O)?(rt(B(e,b,O)),O=C[t+2],E=C[t+3],A=C[t+4],s=U(B(e,O,A)),s&&it(s)):(E=1,rt(B(e,b)));return p.length&&D(),d.length>0&&ze(d),d}let Pe=undefined,je=undefined,Ie=nt("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"),Re=0,Fe={},Ke={},Me="",We="",He="",Ue="",Be="",Ye="",qe="",Ge="",Ze="";class Je{constructor(t){this.value=t}toString(){const{value:t}=this;return true===t?Be:false===t?Ye:null===t?Ue:undefined===t?He:f(t)?En(t):""+t}}class Qe{constructor(t,e,n,r,i,s){this.left=t,this.right=e,this.separator=n,this.breakLine=r,this.offset=i,this.items=s||[]}unshift(t){$(this.items,t)}push(t){k(this.items,t)}toString(t){let{left:e,right:n,separator:r,breakLine:i,offset:s,items:o}=this,{length:c}=o;if(!c)return`${e}${n}`;const u=t||0,a=u+s,f=H(Ge,u),l=H(Ge,a),d=o.map((function(t){return t.toString(a)}));return e&&i&&(e+=Ze+l),n&&i&&(n=Ze+f+n),`${e}${T(d,i?r+Ze+l:r+qe)}${n}`}}class Xe{constructor(t){this.items=t||[]}add(t){k(this.items,t)}toString(t){const{items:e}=this;return 1===e.length?e[0].toString(t):new Qe("(",")",",",true,1,e).toString(t)}}class tn{constructor(t){if(this.fields={},t){const e=this;mt(t,(function(t,n){e.set(n,t)}))}}set(t,e){e instanceof Je&&undefined===e.value||(this.fields[t]=e)}isNotEmpty(){return yt(this.fields).length>0}toString(t){const{fields:e}=this;return hn("{","}",",",true,1,yt(e).sort().map((function(t){return{toString:n=>function(t,e){/^[\w$]+$/.test(t)&&!Ie[t]||(t=En(t));return`${t}:${qe}${e}`}(t,e[t].toString(n))}}))).toString(t)}}class en{constructor(t,e){this.name=t,this.args=e}toString(t){const{name:e,args:n}=this,r=n?function(t){let e=[],n=true;return m(t,(function(t){!(t instanceof Je)||undefined!==t.value?(n=false,$(e,t)):n||$(e,pn(undefined))}),true),e}(n):[];return r.length?`${e.toString(t)}${hn("(",")",",",true,1,r).toString(t)}`:e.toString(t)+"()"}}class nn{constructor(t){this.value=t}toString(t){return`(${this.value.toString(t)})`}}class rn{append(t){const{buffer:e}=this;this.buffer=e?kn(e instanceof cn?xn(e):e,"+",t instanceof cn?xn(t):t):t}toString(t){return this.buffer.toString(t)}}class sn{constructor(t,e){this.operator=t,this.value=e}toString(t){return`${this.operator}${this.value.toString(t)}`}}class on{constructor(t,e,n){this.left=t,this.operator=e,this.right=n}toString(t){return`${this.left.toString(t)}${qe}${this.operator}${qe}${this.right.toString(t)}`}}class cn{constructor(t,e,n){this.test=t,this.yes=e,this.no=n}toString(t){return`${this.test.toString(t)}${qe}?${qe}${this.yes.toString(t)}${qe}:${qe}${this.no.toString(t)}`}}class un{constructor(t,e,n){this.args=t,this.body=e,this.returnValue=n}toString(t){const{args:e,body:n,returnValue:r}=this,i=t||0,s=i+1,o=H(Ge,i),c=H(Ge,s),u=e?hn("","",",",false,1,e).toString(i):"",a=[];return n&&k(a,n.toString(s)+(r?";":"")),r&&k(a,"return "+r.toString(s)),`function${qe}(${u})${qe}{${Ze}${c}${T(a,Ze+c)}${Ze}${o}}`}}class an{constructor(t,e){this.base=t,this.props=e}toString(t){const{base:e,props:n}=this;let r=e.toString(t);return m(n,(function(e){e instanceof Je?p(e.value)?r+=`[${qe}${e.value}${qe}]`:r+="."+e.value:r+=`[${qe}${e.toString(t)}${qe}]`})),r}}class fn{constructor(t,e,n){this.name=t,this.value=e,this.isDeclaration=n}toString(t){const{name:e,value:n,isDeclaration:r}=this,i=`${e.toString(t)}${qe}=${qe}${n.toString(t)}`;return r?"var "+i:i}}class ln{constructor(t,e){this.array=t,this.item=e}toString(t){const{array:e,item:n}=this;return vn(wn(e,[pn("push")]),[n]).toString(t)}}class dn{constructor(t,e){this.value=t,this.type=e}toString(t){const{value:e,type:n}=this;return`typeof ${e.toString(t)}${qe}===${qe}${En(n)}`}}function pn(t){return new Je(t)}function hn(t,e,n,r,i,s){return new Qe(t,e,n,r,i,s)}function gn(t){return new Xe(t)}function yn(t,e){let n=hn("[","]",",",true,1,t);return f(e)?{toString:t=>`${n.toString(t)}.join(${pn(e).toString()})`}:n}function mn(t){return new tn(t)}function vn(t,e){return new en(t,e)}function xn(t){return new nn(t)}function bn(){return new rn}function kn(t,e,n){return new on(t,e,n)}function $n(t,e,n){return new cn(t,e,n)}function Sn(t,e,n){return new un(t,e,n)}function wn(t,e){return new an(t,e)}function _n(t,e,n){return new fn(t,e,n)}function On(t,e){return new ln(t,e)}function An(){return We}function En(t){return`"${t=t.replace(/\\?'/g,"\\'").replace(/\\?"/g,'\\"').replace(/\n\s*/g,"\\n")}"`}function Tn(t,e){const n=t?t.toString():undefined;if(e&&n&&Ke[n])return Ke[n];const r=Me+Re++;return Fe[r]=t,e&&n&&(Ke[n]=r),r}function Cn(t){return t.split(".").filter((function(t){return t.length>0})).map(pn)}function Dn(t,e){const n=[];mt(Fe,(function(t,e){k(n,{toString:n=>function(t,e){return void 0!==e?`${t}${qe}=${qe}${e}`:t}(e,t?t.toString(n):undefined)})}));return`(${Sn(undefined,hn("var ","",",",false,0,n),Sn(t,e)).toString()})()`}function Nn(t){return 6===t.type||5===t.type}function Ln(t,e,n,r,i,s,o){let c,u=false,a=function(t,s){return Ln(t,e,n,r,i,false,s)},f=function(t,e){return t.map((function(t){return a(t,e)}))};switch(t.type){case 1:c=pn(t.value);break;case 4:const l=t;c=function(t,e){return new sn(t,e)}(l.operator,a(l.node));break;case 5:let d=t,p=a(d.left),h=a(d.right);c=kn(Nn(d.left)?xn(p):p,d.operator,Nn(d.right)?xn(h):h);break;case 6:const g=t;c=$n(a(g.test),a(g.yes),a(g.no));break;case 7:c=yn(f(t.nodes,o));break;case 8:const y=t,v=mn();m(y.keys,(function(t,e){const n=y.values[e];v.set(t,a(n))})),c=v;break;case 2:u=true;const x=t;c=e(x)||n(x,x.name?Cn(x.name):[],x.name,s,o);break;case 3:u=true;const b=t;if(b.isStatic)c=b.raw;else if(2===b.lead.type){const t=b.lead,i=e(t),u=f(b.nodes||[]);i?c=r(i,u,s):(t.name&&m(Cn(t.name),(function(t){u.unshift(t)}),true),c=n(b,u,undefined,s,o))}else c=b.nodes?r(a(b.lead),f(b.nodes||[]),s):r(a(b.lead),Cn(b.keypath),s);break;default:u=true;const k=t;c=i(k,a(k.name,k),k.args.length?f(k.args):undefined,s)}return!s||u?c:mn({value:c})}const zn=[true],Vn=[],Pn=[],jn=[],In=[true],Rn=[],Fn=[],Kn=["$keypath","$length","$event","$data"],Mn={},Wn=pn(undefined),Hn=pn(true);let Un=undefined,Bn=undefined,Yn="",qn="",Gn="",Zn="",Jn="",Qn="",Xn="",tr="",er="",nr="",rr="",ir="",sr="",or="",cr="",ur="",ar="",fr="",lr="",dr="",pr="",hr="",gr="",yr="",mr="",vr="",xr="",br="",kr="",$r="",Sr="",wr="",_r="",Or="",Ar="",Er="",Tr="",Cr="",Dr="",Nr="",Lr="",zr="",Vr="";class Pr{constructor(t){this.text=t}toString(t){return mn({type:pn(2),isPure:Hn,operator:pr,text:this.text}).toString(t)}}class jr{constructor(t){this.buffer=bn(),this.append(t)}append(t){this.buffer.append(t)}toString(t){return mn({type:pn(1),isPure:Hn,operator:dr,text:this.buffer}).toString(t)}}function Ir(t){if(A(Kn,t))switch(t){case"$keypath":return Nr;case"$length":return Lr;case"$event":return zr;case"$data":return Vr;default:return t}}function Rr(t){const{name:e,root:n,lookup:r,offset:i,literals:s}=t;if(s){const t=Ir(s[0]);if(ie(t)){const e=xt(s);return e[0]=t,T(e,".")}}else{const t=Ir(e);if(ie(t))return t}if(w(Pn)&&false===n&&false===r&&0===i)return""===e?Dr:wn(Dr,Cn(e))}function Fr(t,e){return e?t:wn(t,[pn("value")])}function Kr(t,e,n,r,i){const{root:s,lookup:o,offset:c}=t,{length:u}=e,a=function(t,e){return t?pn(0):kn(wn(Ar,[pn("length")]),"-",pn(1+(e||0)))}(s,c);let l=Wn;i&&9===i.type&&o&&n&&u>0&&(l=u>1?wn($r,e):Zr(kr,$r,n));let d=vn(cr,[Ar,a,f(n)?pn(n):yn(e,"."),yn(e),o?Hn:Wn,l]);if(n&&1===u)if(s||c||o)if(s||c){const t=gn(),e=An();t.add(_n(e,wn(Ar,[a]))),t.add(vn(fr,[wn(vn(wn(e,[pn("getScope")])),[pn(n)]),vn(wn(e,[pn("getKeypath")]),[pn(n)])])),d=t}else d=vn(ur,[Ar,a,pn(n),l]);else d=vn(fr,[wn(Dr,e),vn(wn(wn(Ar,[a]),[pn("getKeypath")]),[pn(n)])]);else if(!n&&!u){const t=gn(),e=An();t.add(_n(e,wn(Ar,[a]))),t.add(vn(fr,[vn(wn(e,[pn("getScope")])),wn(e,[pn("keypath")])])),d=t}return Fr(d,r)}function Mr(t,e,n){let r;switch(e.length){case 0:r=vn(fr,[t]);break;case 1:r=vn(fr,[wn(t,e)]);break;default:r=vn(ar,[t,yn(e)])}return Fr(r,n)}function Wr(t,e,n,r){const i=gn(),s=An();return i.add(_n(s,e)),i.add($n(new dn(s,"function"),vn(s,n),vn(wn(br,[pn("fatal")]),[pn(`[${t.raw}] is not a function.`)]))),Fr(vn(fr,[i]),r)}function Hr(t,e){const n=Ln(t,Rr,Kr,Mr,Wr,e);return t.isStatic?Tn(n,true):n}function Ur(t){const e=bn();return k(Rn,e),m(t,(function(t){Mn[t.type](t)})),_(Rn),e}function Br(t){return ie(t.value)?pn(t.value):t.expr?Hr(t.expr):t.children?Ur(t.children):Wn}function Yr(t){Bn=undefined;const e=[];return m(t,(function(t){const n=Mn[t.type](t);n instanceof Je&&undefined===n.value||k(e,n)})),Bn=undefined,e}function qr(t){return hn("","",";",true,0,Yr(t))}function Gr(t,e){const n=qr(t);return n.unshift(_n(Cr,yn(),true)),Sn(e,n,$n(wn(Cr,[pn("length")]),Cr,pn(undefined)))}function Zr(t,e,n){return kn(kn(t,"&&",wn(t,[pn(n)])),"||",wn(e,[pn(n)]))}function Jr(t){return w(In)?function(t){return Bn=t instanceof jr?t:void 0,On(Cr,t)}(t):t}function Qr(t){return Bn?(Bn.append(t),Wn):Jr(new jr(t))}function Xr(t,e){let n=[],r=[],i=undefined,s=[],o=undefined,c=undefined,u=[],a=[],f=[];for(let l=0,d=t.length;l<d;l++){const d=t[l];if(2===d.type){const t=d;k(4===e||7===e?r:n,t)}else if(4===d.type)i=d;else if(3===d.type){const t=d;switch(t.ns){case"lazy":k(s,t);break;case"transition":o=t;break;case"model":c=t;break;case"event":k(u,t);break;default:k(a,t)}}else k(f,d)}return{nativeAttributeList:n,propertyList:r,style:i,lazyList:s,transition:o,model:c,eventList:u,customDirectiveList:a,otherList:f}}function ti(t){const{name:e}=t;let n=Br(t);return n instanceof Je||(Xt(e)?n=vn(sr,[pn(e),n]):te(e)&&(n=vn(or,[pn(e),n,pn(t.defaultValue)]))),n}function ei(t,e){let n=undefined,r=undefined,i=e||false;return i||m(t,(function(t){if(!t.isStatic)return i=true,false})),k(In,i),i?n=vn(Gr(t)):r=yn(Yr(t)),_(In),{dynamicChildren:n,staticChildren:r}}function ni(t){if(ie(t.value)){const e=mn();return function(t,e){const n=t.split(";");for(let t=0,r=n.length;t<r;t++){const r=n[t],i=r.indexOf(":");if(i>0){const t=U(r.substring(0,i)),n=U(r.substring(i+1));t&&n&&e(K(t),n)}}}(t.value,(function(t,n){e.set(t,pn(n))})),Tn(e,true)}return t.expr?8===t.expr.type?Hr(t.expr):vn(qn,[Hr(t.expr)]):vn(Yn,[Ur(t.children)])}function ri(t){return pn(t.value)}function ii(t){return vn(Gn,[pn(t.value),Zr(_r,Or,t.value)])}function si(t){return vn(Zn,[Hr(t.expr,true)])}function oi(t,e){k(t,Wn),k(t,Wn),4===w(Fn)&&("native"===e.modifier?t[t.length-1]=Hn:t[t.length-2]=Hn)}function ci(t){const e=[];k(e,pn(ui(t))),k(e,pn(t.value)),k(e,pn(t.name)),k(e,pn(t.modifier||""));const n=t.expr,{raw:r}=n;if(9===n.type){const r=n;return k(e,pn(r.name.name)),C(r.args)?k(e,Wn):k(e,mn({execute:Sn([zr,Vr],undefined,yn(r.args.map((function(t){return Hr(t)}))))})),oi(e,t),{name:Jn,args:e}}const i=r.split(".");return k(e,pn(i[0])),k(e,pn(i[1])),oi(e,t),{name:Qn,args:e}}function ui(t){return lt(t.name,t.modifier||"")}function ai(t){const e=[];return k(e,pn(ui(t))),k(e,pn(t.name)),k(e,pn(t.modifier)),k(e,t.expr?Hr(t.expr):pn(t.value)),k(e,Zr(Sr,wr,t.name)),e}function fi(){return w(zn)?Jr(new Pr(pn(""))):w(Rn)?pn(""):Wn}function li(t){if(t)return w(Vn)&&(t=function(t,e){const{nativeAttributeList:n,propertyList:r,style:i,lazyList:s,transition:o,model:c,eventList:u,customDirectiveList:a,otherList:f}=Xr(t,e),l=[];return k(l,n),k(l,r),i&&k(l,i),k(l,s),o&&k(l,o),c&&k(l,c),k(l,u),k(l,a),k(l,f),l}(t,w(Fn))),w(Rn)?Ur(t):gn(Yr(t))}function di(t){return Un!==o.uglifyCompiled&&(o.uglifyCompiled?(Yn="_a",qn="_b",Gn="_c",Zn="_d",Jn="_e",Qn="_f",Xn="_g",tr="_h",er="_i",nr="_j",rr="_k",ir="_l",sr="_m",or="_n",cr="_o",ur="_p",ar="_q",fr="_r",lr="_s",dr="_t",pr="_u",hr="_v",gr="_w",yr="_x",mr="_y",vr="_z",xr="_A",br="_B",kr="_C",$r="_D",Sr="_E",wr="_F",_r="_G",Or="_H",Ar="_I",Er="_J",Tr="_K",Cr="_L",Dr="_M",Nr="_N",Lr="_O",zr="_P",Vr="_Q"):(Yn="renderStyleStyle",qn="renderStyleExpr",Gn="renderTransition",Zn="renderModel",Jn="renderEventMethod",Qn="renderEventName",Xn="renderDirective",tr="renderSpread",er="renderEach",nr="renderRange",rr="renderSlot",ir="appendVNodeProperty",sr="formatNativeAttributeNumberValue",or="formatNativeAttributeBooleanValue",cr="lookupKeypath",ur="lookupProp",ar="readKeypath",fr="setValueHolder",lr="toString",dr="textVNodeOperator",pr="commentVNodeOperator",hr="elementVNodeOperator",gr="componentVNodeOperator",yr="fragmentVNodeOperator",mr="portalVNodeOperator",vr="slotVNodeOperator",xr="instance",br="logger",kr="filters",$r="globalFilters",Sr="directives",wr="globalDirectives",_r="transition",Or="globalTransitions",Ar="stack",Er="parent",Tr="vnode",Cr="children",Dr="$scope",Nr="$keypath",Lr="$length",zr="$event",Vr="$data"),Un=o.uglifyCompiled),Pe!==o.uglifyCompiled&&(Pe=o.uglifyCompiled,Me=Pe?"$":"var"),je!==o.minifyCompiled&&(je=o.minifyCompiled,je?qe=Ge=Ze="":(qe=" ",Ge=" ",Ze="\n")),Re=0,Fe={},Ke={},We=Tn(),He=Tn("void 0"),Ue=Tn("null"),Be=Tn("!0"),Ye=Tn("!1"),Dn([Yn,qn,Gn,Zn,Jn,Qn,Xn,tr,er,nr,rr,ir,sr,or,cr,ur,ar,fr,lr,dr,pr,hr,gr,yr,mr,vr,xr,br,kr,$r,Sr,wr,_r,Or,Ar,Dr,Nr,Cr],Mn[t.type](t))}Mn[1]=function(t){let{tag:e,dynamicTag:n,isComponent:r,to:i,ref:s,key:o,html:c,text:u,attrs:a,children:l}=t,d=r?4:Rt[e]||3,p=mn({context:xr,type:pn(d),tag:n?Hr(n):pn(e)}),h=5===d,g=6===d,y=7===d,v=undefined,x=undefined,b=undefined,$=undefined;if(k(zn,true),k(Vn,false),k(Fn,d),l)if(r)b=function(t){const e=mn(),n={},r=function(t,e){C(e)||k(n[t="$slot_"+t]||(n[t]=[]),e)};if(k(jn,!0),m(t,(function(t){if(1===t.type){const e=t;if(e.slot)return void r(e.slot,"template"===e.tag?e.children:[e])}r("children",[t])})),mt(n,(function(t,n){e.set(n,Gr(t,[Er]))})),_(jn),e.isNotEmpty())return e}(l);else{const{dynamicChildren:t,staticChildren:e}=ei(l);t?x=t:e&&(y?x=e:p.set("children",e))}if(zn[zn.length-1]=false,Vn[Vn.length-1]=true,i&&p.set("to",Br(i)),s&&p.set("ref",Br(s)),o&&p.set("key",Br(o)),c&&p.set("html",f(c)?pn(c):vn(lr,[Hr(c)])),u&&p.set("text",f(u)?pn(u):vn(lr,[Hr(u)])),a){const{nativeAttributeList:t,propertyList:e,style:n,lazyList:r,transition:i,model:s,eventList:o,customDirectiveList:c,otherList:u}=Xr(a,d),f=u.length>0;if(t.length){let e=mn(),n=f;m(t,(function(t){t.isStatic||(n=true),e.set(t.name,ti(t))})),p.set("nativeAttrs",n?e:Tn(e,true))}if(e.length){const t=mn();m(e,(function(e){t.set(e.name,Br(e))})),p.set("props",t)}if(n&&p.set("nativeStyles",ni(n)),r.length){const t=mn();m(r,(function(e){t.set(e.name,ri(e))})),p.set("lazy",Tn(t,true))}if(i&&p.set("transition",ii(i)),s&&p.set("model",si(s)),o.length){const t=mn();m(o,(function(e){const n=ci(e);t.set(ui(e),vn(n.name,n.args))})),p.set("events",t)}if(c.length){const t=mn();m(c,(function(e){t.set(ui(e),vn(Xn,ai(e)))})),p.set("directives",t)}u.length&&(v=Sn([Tr],qr(u),Tr))}if(y){const e=t.name;let n=pn("$slot_children");e&&(n=ie(e.value)?pn("$slot_"+e.value):kn(pn("$slot_"),"+",xn(Br(e)))),$=vn(rr,[n,w(jn)?Er:Wn])}_(zn),_(Vn),_(Fn),3===d?p.set("operator",hr):h?p.set("operator",yr):g?p.set("operator",mr):r?(p.set("operator",gr),w(jn)&&p.set("parent",Er)):y&&(p.set("operator",vr),x=x?kn($,"||",x):$),t.isSvg&&p.set("isSvg",Hn),t.isStatic&&(p.set("isStatic",Hn),p.set("isPure",Hn)),x&&p.set("children",x),b&&p.set("slots",b);const S=v?vn(v,[p]):p;if(h||g||y){const t=gn(),e=An();return t.add(_n(e,S)),t.add(kn(kn(wn(e,[pn("children")]),"&&",wn(e,[pn("children"),pn("length")])),"&&",On(Cr,e))),t}return Jr(S)},Mn[2]=function(t){const e=w(Fn);return vn(ir,[Tr,pn(4===e||7===e?"props":"nativeAttrs"),pn(t.name),ti(t)])},Mn[4]=function(t){return _n(wn(Tr,[pn("nativeStyles")]),ni(t))},Mn[3]=function(t){switch(t.ns){case"lazy":return vn(ir,[Tr,pn("lazy"),pn(t.name),ri(t)]);case"transition":return _n(wn(Tr,[pn("transition")]),ii(t));case"model":return _n(wn(Tr,[pn("model")]),si(t));case"event":const e=ci(t);return vn(ir,[Tr,pn("events"),pn(ui(t)),vn(e.name,e.args)]);default:return vn(ir,[Tr,pn("directives"),pn(ui(t)),vn(Xn,ai(t))])}},Mn[12]=function(t){return vn(tr,[Tr,pn("props"),Hr(t.expr)])},Mn[5]=function(t){const e=pn(t.text);if(w(zn))return Qr(e);const n=w(Rn);return n?(n.append(e),Wn):e},Mn[11]=function(t){const e=Hr(t.expr);if(w(zn))return Qr(vn(lr,[e]));const n=w(Rn);return n?(n.append(vn(lr,[e])),Wn):e},Mn[6]=function(t){const{next:e}=t,n=w(Rn),r=fi(),i=$n(Hr(t.expr),li(t.children)||r,e?Mn[e.type](e):r);return n?(n.append(i),Wn):i},Mn[7]=function(t){const{next:e}=t,n=fi();return $n(Hr(t.expr),li(t.children)||n,e?Mn[e.type](e):n)},Mn[8]=function(t){return li(t.children)||fi()},Mn[9]=function(t){const{index:e,from:n,to:r,equal:i,next:s}=t,o=r||7===n.type||8===n.type,c=[Ar,Dr,Nr,Lr];e&&(k(c,e),k(Kn,e)),k(Pn,o);const u=Sn(c,qr(t.children));e&&_(Kn),_(Pn);const a=s?Sn(undefined,qr(s.children)):Wn;return r?vn(nr,[Hr(n),Hr(r),pn(i),u,a]):vn(er,[Hr(n,true),u,a])},Mn[10]=function(t){const e=An(),n=gn();return n.add(_n(e,Hr(t.expr))),n.add($n(e,Jr(e),Wn)),n};function pi(t){const{input:e,getter:n}=t;t.value=e?n.apply(undefined,e):n()}class hi{constructor(){this.map={},this.list=[]}add(t,e){const n=this.map[t.id]||(this.map[t.id]={});n[e]||(n[e]=t,this.list.push([t,e]))}watch(t){const{list:e}=this;if(e)for(let n=0,r=e.length;n<r;n++)e[n][0].watch(e[n][1],t)}unwatch(t){const{list:e}=this;if(e)for(let n=0,r=e.length;n<r;n++)e[n][0].unwatch(e[n][1],t)}}class gi{constructor(t,e,n,r,i,s,o,c){const u=this;u.status=1,u.keypath=t,u.cache=e,u.input=r,u.output=i,u.setter=o,u.getter=s,u.onChange=c,u.watcherOptions={sync:n,watcher(){u.refresh()}}}get(){const t=this,{status:e,watcherOptions:n}=t;if(t.cache){if(2!==e)if(t.staticDeps)pi(t);else{let{dynamicDeps:e}=t;e&&e.unwatch(n.watcher),t.dynamicDeps=undefined;const r=gi.current;gi.current=t,pi(t),gi.current=r,e=t.dynamicDeps,e&&e.watch(n)}}else pi(t);return 2!==e&&(t.status=2),function(t){const{value:e,output:n}=t;return n?n(e):e}(t)}set(t){const{setter:e}=this;e?e(t):c(t)&&(this.getter=t,this.refresh())}refresh(){const t=this.value;this.status=3;const e=this.get();e!==t&&this.onChange(this.keypath,e,t)}addStaticDeps(t,e){const n=this.staticDeps||(this.staticDeps=new hi);for(let r=0,i=e.length;r<i;r++)n.add(t,e[r]);n.watch(this.watcherOptions)}addDynamicDep(t,e){(this.dynamicDeps||(this.dynamicDeps=new hi)).add(t,e)}}function yi(t,e){return p(t)?+t:undefined!==e?e:0}function mi(t,e){if(null==t||""===e)return t;const n=kt(t,e);return n?n.value:void 0}function vi(t,e,n,i,s,o){const c=function(e,n,r){if(n!==r){const c=lt(t,e);for(let t=0;t<s;t++){const e=i[t];undefined!==ht(c,e)&&o(e,c,n,r)}vi(c,n,r,i,s,o)}};(function(t,e,n){const r=f(t),i=f(e);if(r||i)return n("length",r?t.length:void 0,i?e.length:void 0),!0})(e,n,c)||function(t,e,n){const r=u(t),i=u(e);if(r||i){const s=r?t.length:void 0,o=i?e.length:void 0;n("length",s,o);for(let c=0,u=Math.max(s||0,o||0);c<u;c++)n(""+c,r?t[c]:void 0,i?e[c]:void 0);return!0}}(e,n,c)||function(t,e,n){const i=a(t),s=a(e);if(i||s){const o=V(),c=i?t:r,u=s?e:r;if(i)for(let t in c){const e=c[t];e!==u[t]&&(o.set(t,!0),n(t,e,u[t]))}if(s)for(let t in u){const e=u[t];void 0===o.get(t)&&e!==c[t]&&n(t,c[t],e)}}}(e,n,c)}function xi(t,e,n,r,i,s){let o;for(const c in r)if(dt(c))undefined!==ht(t,c)?s(c,t,e,n):i&&(o?o.push(c):o=[c]);else{const r=ut(c,t);if(r>=0){const t=B(c,r),i=mi(e,t),o=mi(n,t);i!==o&&s(c,c,i,o)}}o&&vi(t,e,n,o,o.length,s)}const bi={watcher:n};function ki(t,e){return c(t)?(bi.watcher=t,bi.immediate=true===e,bi):t}let $i=0;class Si{constructor(t,e,n){const r=this;r.id=$i++,r.data=t||{},r.context=e||r,r.nextTask=n||new Vt,r.syncEmitter=new Tt,r.asyncEmitter=new Tt,r.asyncOldValues={},r.asyncKeypaths={},r.onComputedChange=function(t,e,n){r.diff(t,e,n)}}get(t,e,n){const r=this,{data:i}=r,s=gi.current;if(""===t)return i;s&&!n&&s.addDynamicDep(r,t);const o=kt(i,t);return o?o.value:e}set(t,e){const n=this,{data:r}=n,i=function(t,e){const i=n.get(t);if(e===i)return;let s;ft(t,(function(t,n,i){if(0!==n)s&&(n===i?s[t]=e:s=s[t]||(s[t]={}));else{const n=r[t];n&&n instanceof gi?0===i?n.set(e):s=n.get():0===i?r[t]=e:s=r[t]||(r[t]={})}})),n.diff(t,e,i)};if(f(t))i(t,e);else if(a(t))for(let e in t)i(e,t[e])}diff(t,e,n){let r=this,{syncEmitter:i,asyncEmitter:s,asyncOldValues:o,asyncKeypaths:c}=r,u=36!==Q(t);xi(t,e,n,i.listeners,u,(function(t,e,n,r){i.fire({type:t,ns:""},[n,r,e])})),xi(t,e,n,s.listeners,u,(function(t,e,n,i){const u=s.listeners[t];for(let t=0,e=u.length;t<e;t++)u[t].count++;c[e]||(o[e]=i,c[e]={}),c[e][t]=true,r.pending||(r.pending=true,r.nextTask.append((function(){r.pending&&r.diffAsync()})))}))}diffAsync(){const t=this,{asyncEmitter:e,asyncOldValues:n,asyncKeypaths:r}=t;t.pending=undefined,t.asyncOldValues={},t.asyncKeypaths={};for(let i in n){const s=[t.get(i),n[i],i],o=r[i],c=s[0]!==s[1],u=function(t,e,n){if(n.count)return n.count--,c};for(let t in o)e.fire({type:t,ns:""},s,u)}}addComputed(t,e){let n,r,i,s,o,f=this,l=f.context,p=true,h=true;if(c(e))i=e.bind(l);else if(a(e)){const t=e;d(t.cache)&&(p=t.cache),d(t.sync)&&(h=t.sync),u(t.deps)&&(n=t.deps),C(t.input)||(r=t.input),c(t.output)&&(o=t.output),c(t.get)&&(i=t.get.bind(l)),c(t.set)&&(s=t.set.bind(l))}if(i){const e=new gi(t,p,h,r,o,i,s,f.onComputedChange);return p&&n&&e.addStaticDeps(f,n),f.data[t]=e}}removeComputed(t){delete this.data[t]}watch(t,e,n){const r=this,{context:i,syncEmitter:s,asyncEmitter:o}=r,c=function(t,e){const n=e.sync?s:o,c={ns:"",listener:e.watcher,ctx:i,count:0};e.once&&(c.max=1),n.on(t,c),e.immediate&&e.watcher.call(i,r.get(t),undefined,t)};if(f(t))c(t,ki(e,n));else for(let e in t)c(e,ki(t[e]))}unwatch(t,e){this.syncEmitter.off(t,e),this.asyncEmitter.off(t,e)}toggle(t){const e=!this.get(t);return this.set(t,e),e}increase(t,e,n){const r=yi(this.get(t),0)+(e||1);if(!l(n)||r<=n)return this.set(t,r),r}decrease(t,e,n){const r=yi(this.get(t),0)-(e||1);if(!l(n)||r>=n)return this.set(t,r),r}insert(t,e,n){let r=this.get(t);r=u(r)?r.slice():[];const{length:i}=r;if(true===n||n===i)r.push(e);else if(false===n||0===n)r.unshift(e);else{if(!(n>0&&n<i))return;r.splice(n,0,e)}return this.set(t,r),true}append(t,e){return this.insert(t,e,true)}prepend(t,e){return this.insert(t,e,false)}removeAt(t,e){let n=this.get(t);if(u(n)&&e>=0&&e<n.length)return n=n.slice(),n.splice(e,1),this.set(t,n),true}remove(t,e){let n=this.get(t);if(u(n)&&(n=n.slice(),O(n,e)))return this.set(t,n),true}copy(t,e){return xt(t,e)}destroy(){const t=this;t.syncEmitter.off(),t.asyncEmitter.off(),t.nextTask.clear(),t.data={}}}P((function(t){return di(Ve(t)[0])}));class wi{constructor(t){const e=this,n=t||r;e.$emitter=new Tt(true),n.events&&e.on(n.events);let{data:i,props:s,vnode:o,propTypes:u,computed:f,methods:l,watchers:d,extensions:p}=n;e.$options=n,p&&vt(e,p);const h=s?xt(s):{},g=e.$observer=new Si(h,e,e.$nextTask=new Vt);f&&mt(f,(function(t,e){g.addComputed(e,t)}));const y=c(i)?i.call(e,t):i;a(y)&&mt(y,(function(t,e){h[e]=t})),l&&mt(l,(function(t,n){e[n]=t})),d&&g.watch(d)}static define(t){return t}static use(t){t.install(wi)}static nextTick(t,e){Vt.shared().append(t,e)}static compile(t,e){return t}static directive(t,e){}static transition(t,e){}static component(t,e){}static filter(t,e){}static method(t,e){if(f(t)&&!e)return _i[t];!function(t,e,n,r){f(e)?Oi(t,e,n,r):mt(e,(function(e,n){Oi(t,n,e,r)}))}(_i,t,e)}get(t,e){return this.$observer.get(t,e)}set(t,e){const{$observer:n}=this;n&&n.set(t,e)}on(t,e){return Ei(this,t,e),this}once(t,e){return Ei(this,t,e,true),this}off(t,e){return this.$emitter.off(t,e),this}fire(t,e,n){const r=this,{$emitter:i,$parent:s,$children:o}=r;let c;if(y.is(t))c=t;else if(f(t))c=new y(t);else{const e=t;c=new y(e.type),c.ns=e.ns}if(undefined===c.ns){const t=i.toEvent(c.type);c.type=t.type,c.ns=t.ns}c.target||(c.target=r);let u,l=[c];return a(e)?k(l,e):true===e&&(n=true),u=!(!n||c.target!==r)||i.fire(c,l),u&&(n?o&&(c.phase=y.PHASE_DOWNWARD,m(o,(function(t){return u=t.fire(c,e,true)}))):s&&(c.phase=y.PHASE_UPWARD,u=s.fire(c,e))),u}watch(t,e,n){return this.$observer.watch(t,e,n),this}unwatch(t,e){return this.$observer.unwatch(t,e),this}loadComponent(t,e){}createComponent(t,e){return this}directive(t,e){}transition(t,e){}component(t,e){}filter(t,e){}forceUpdate(t){}render(){}update(t,e){}checkProp(t,e){}destroy(){const{$parent:t,$options:e,$emitter:n,$observer:r}=this;r.destroy(),n.off(),this.$el=undefined}nextTick(t){this.$nextTask.append(t,this)}toggle(t){return this.$observer.toggle(t)}increase(t,e,n){return this.$observer.increase(t,e,n)}decrease(t,e,n){return this.$observer.decrease(t,e,n)}insert(t,e,n){return this.$observer.insert(t,e,n)}append(t,e){return this.$observer.append(t,e)}prepend(t,e){return this.$observer.prepend(t,e)}removeAt(t,e){return this.$observer.removeAt(t,e)}remove(t,e){return this.$observer.remove(t,e)}copy(t,e){return this.$observer.copy(t,e)}}wi.version="1.0.0-alpha.408",wi.is=h,wi.array=D,wi.object=$t,wi.string=it,wi.logger=Et,wi.Event=y,wi.Emitter=Tt,wi.config=o;const _i=wi.prototype;function Oi(t,e,n,r){r&&r.format&&(n=r.format(n)),t[e]=n}function Ai(t,e,n){t.$emitter.on(e.type,{listener:e.listener,ns:e.ns,max:n?1:-1,ctx:t})}function Ei(t,e,n,r){const{$emitter:i}=t;f(e)?Ai(t,i.toFilter(e,n),r):u(e)?m(e,(function(e){Ai(t,e,r)})):mt(e,(function(e,n){Ai(t,i.toFilter(n,e),r)}))}E(yt(_i));export default wi;
//# sourceMappingURL=yox.esm.min.js.map