From 54a30c80bd7baf78200177312d4c41fbf54bbe8f Mon Sep 17 00:00:00 2001 From: kmdjs Date: Tue, 3 May 2016 20:38:06 +0800 Subject: [PATCH] fix nc-class bug --- dist/nuclear.js | 6 +++++- dist/nuclear.min.js | 2 +- src/nuclear.js | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/nuclear.js b/dist/nuclear.js index e36ca3a26..bed90ade4 100644 --- a/dist/nuclear.js +++ b/dist/nuclear.js @@ -172,7 +172,11 @@ Nuclear._mixObj = function (obj) { for (; j < cLen; j++) { var cNode = cNodes[j]; var cAttr = cNode.getAttribute("nc-class"); - if (!this[cAttr]) this[cAttr] = []; + this[cAttr] = []; + } + for (j = 0; j < cLen; j++) { + var cNode = cNodes[j]; + var cAttr = cNode.getAttribute("nc-class"); this[cAttr].push(cNode); } } diff --git a/dist/nuclear.min.js b/dist/nuclear.min.js index ba9a83bb0..437430f9f 100644 --- a/dist/nuclear.min.js +++ b/dist/nuclear.min.js @@ -3,4 +3,4 @@ * Github: https://github.com/AlloyTeam/Nuclear * MIT Licensed. */ -!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():"function"==typeof define&&define.cmd&&define(function(e,n,r){r.exports=t()}),e.Nuclear=t()}(window,function(){var e={};return e.create=function(t,n){t._nuclearSetting=n,e._mixObj(t);var r=this===e?e.Class:this,o=r.extend(t);return o.create=e.create,o},e._mixObj=function(t){t.ctor=function(t,n){if(this._ncInstanceId=e.getInstanceId(),this._nuclearTwoWay=!0,this._nuclearSetting&&this._nuclearSetting.twoWay===!1&&(this._nuclearTwoWay=!1),window.Nuclear.instances[this._ncInstanceId]=this,this._nuclearParentEmpty=!n,this.HTML="",this.option=t,this._nuclearParentEmpty)this.parent=document.createElement("div");else if(this.parent="string"==typeof n?document.querySelector(n):n,document.body!==this.parent)for(;this.parent.firstChild;)this.parent.removeChild(this.parent.firstChild);this.install&&this.install(),this._nuclearRef=[];for(var r in this)this.hasOwnProperty(r)&&this[r]&&this[r]._nuclearLocalRefresh&&(this[r]._nuclearParent=this,this._nuclearRef.push(this[r]));this._nuclearTimer=null,this._preNuclearTime=new Date,this.option&&this._nuclearTwoWay&&e.observe(this.option,function(e,t,n,r){(!this.onOptionChange||this.onOptionChange&&this.onOptionChange(e,t,n,r)!==!1)&&(clearTimeout(this._nuclearTimer),new Date-this._preNuclearTime>40?(this._nuclearLocalRefresh(),this._preNuclearTime=new Date):this._nuclearTimer=setTimeout(function(){this._nuclearLocalRefresh()}.bind(this),40))}.bind(this)),this._nuclearRenderInfo={tpl:this._nuclearTplGenerator(),data:this.option,parent:this.parent},this._nuclearRender(this._nuclearRenderInfo),this.installed&&this.installed()},t.refresh=function(){this._nuclearLocalRefresh()},t.render&&(t._nuclearTplGenerator=t.render),t.render=function(){return this._nuclearParentEmpty?this.HTML:this._nuclearTplGenerator()},t._nuclearRender=function(t){if(this.node)if(e.isUndefined(t.tpl))t.parent.removeChild(this.node),this.node=null,this.HTML="";else{var n=e.str2Dom(this._nuclearWrap(e.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data)));t.parent.replaceChild(n,this.node),this.node=n}else e.isUndefined(t.tpl)||(t.parent.insertAdjacentHTML("beforeEnd",this._nuclearWrap(e.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))),this.node=t.parent.lastChild);this.node&&(this._nuclearId=e.getId(),this.node.setAttribute("data-nuclearId",this._nuclearId),this._mixNode(),t.refreshPart=this.node.querySelectorAll("*[nc-refresh]"),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh())},t._mixNode=function(){var e=this.node.querySelectorAll("*[nc-id]"),t=e.length;if(t>0)for(var n=0;t>n;n++){var r=e[n];this[r.getAttribute("nc-id")]=r}var o=this.node.querySelectorAll("*[nc-class]"),i=o.length;if(i>0)for(var s=0;i>s;s++){var a=o[s],c=a.getAttribute("nc-class");this[c]||(this[c]=[]),this[c].push(a)}},t._nuclearFix=function(){this._nuclearParent||this._nuclearFixOne(this)},t._nuclearFixOne=function(e){var t=e._nuclearRef.length;if(t>0)for(var n=0;t>n;n++){var r=e._nuclearRef[n];r.node=e.node.querySelector('*[data-nuclearId="'+r._nuclearId+'"]'),r.node&&(r._mixNode(),r._nuclearRenderInfo.refreshPart=r.node.querySelectorAll("*[nc-refresh]"),r._nuclearRenderInfo.parent=r.node.parentNode,this._nuclearFixOne(r),r.onRefresh&&r.onRefresh(),r.installed&&r.installed())}},t._nuclearWrap=function(e){var t="";return this.style&&(t=""),"
"+e+t+"
"},t._nuclearLocalRefresh=function(){var t=this._nuclearRenderInfo,n=t.refreshPart.length;if(t.tpl=this._nuclearTplGenerator(),n>0){for(var r=e.str2Dom(this._nuclearWrap(e.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))).querySelectorAll("*[nc-refresh]"),o=0;n>o;o++){var i=t.refreshPart[o];i.parentNode&&i.parentNode.replaceChild(r[o],i)}t.refreshPart=r,this._mixNode(),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh()}else this._nuclearRender(t);e.refreshStyle()}},e._fixEvent=function(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g,function(e,n,r,o,i){return"Nuclear.instances["===i.substr(e.length+o,18)?e:e+="Nuclear.instances["+t+"]."})})},e._fixTplIndex=function(e){return e.replace(/{{@index}}/g,"{{_nuclearIndex}}")},e.str2Dom=function(e){var t={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],body:[0,"",""],_default:[1,"
","
"]};t.optgroup=t.option,t.tbody=t.tfoot=t.colgroup=t.caption=t.thead,t.th=t.td;var n=/<\s*\w.*?>/g.exec(e),r=document.createElement("div");if(null!=n){var o=n[0].replace(//g,"").split(" ")[0];if("body"===o.toLowerCase()){var i=document.createElement("body");r.innerHTML=e.replace(//g,"");var s=r.firstChild.attributes;i.innerHTML=e;for(var a=0;a"'\/]/g,function(e){return y[e]})}function s(t,r){function i(){if(x&&!P)for(;y.length;)delete v[y.pop()];else y=[];x=!1,P=!1}function s(e){if("string"==typeof e&&(e=e.split(b,2)),!d(e)||2!==e.length)throw new Error("Invalid tags: "+e);h=new RegExp(n(e[0])+"\\s*"),u=new RegExp("\\s*"+n(e[1])),p=new RegExp("\\s*"+n("}"+e[1]))}if(!t)return[];var h,u,p,f=[],v=[],y=[],x=!1,P=!1;s(r||e.tags);for(var T,I,C,$,E,R,S=new l(t);!S.eos();){if(T=S.pos,C=S.scanUntil(h))for(var k=0,A=C.length;A>k;++k)$=C.charAt(k),o($)?y.push(v.length):P=!0,v.push(["text",$,T,T+1]),T+=1,"\n"===$&&i();if(!S.scan(h))break;if(x=!0,I=S.scan(w)||"name",S.scan(g),"="===I?(C=S.scanUntil(m),S.scan(m),S.scanUntil(u)):"{"===I?(C=S.scanUntil(p),S.scan(_),S.scanUntil(u),I="&"):C=S.scanUntil(u),!S.scan(u))throw new Error("Unclosed tag at "+S.pos);if(E=[I,C,T,S.pos],v.push(E),"#"===I||"^"===I)f.push(E);else if("/"===I){if(R=f.pop(),!R)throw new Error('Unopened section "'+C+'" at '+T);if(R[1]!==C)throw new Error('Unclosed section "'+R[1]+'" at '+T)}else"name"===I||"{"===I||"&"===I?P=!0:"="===I&&s(C)}if(R=f.pop())throw new Error('Unclosed section "'+R[1]+'" at '+S.pos);return c(a(v))}function a(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)t=e[o],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function c(e){for(var t,n,r=[],o=r,i=[],s=0,a=e.length;a>s;++s)switch(t=e[s],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function l(e){this.string=e,this.tail=e,this.pos=0}function h(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function u(){this.cache={}}var p=Object.prototype.toString,d=Array.isArray||function(e){return"[object Array]"===p.call(e)},f=RegExp.prototype.test,v=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},g=/\s*/,b=/\s+/,m=/\s*=/,_=/\s*\}/,w=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},l.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},h.prototype.push=function(e){return new h(e,this)},h.prototype.lookup=function(e){var n,r=this.cache;if(e in r)n=r[e];else{for(var o,i,s=this,a=!1;s;){if(e.indexOf(".")>0)for(n=s.view,o=e.split("."),i=0;null!=n&&ic;++c)s=void 0,o=e[c],i=o[0],"#"===i?s=this.renderSection(o,t,n,r):"^"===i?s=this.renderInverted(o,t,n,r):">"===i?s=this.renderPartial(o,t,n,r):"&"===i?s=this.unescapedValue(o,t):"name"===i?s=this.escapedValue(o,t):"text"===i&&(s=this.rawValue(o)),void 0!==s&&(a+=s);return a},u.prototype.renderSection=function(e,n,r,o){function i(e){return s.render(e,n,r)}var s=this,a="",c=n.lookup(e[1]);if(c){if(d(c))for(var l=0,h=c.length;h>l;++l)a+=this.renderTokens(e[4],n.push(c[l]),r,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)a+=this.renderTokens(e[4],n.push(c),r,o);else if(t(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");c=c.call(n.view,o.slice(e[3],e[5]),i),null!=c&&(a+=c)}else a+=this.renderTokens(e[4],n,r,o);return a}},u.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);return!o||d(o)&&0===o.length?this.renderTokens(e[4],t,n,r):void 0},u.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},u.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},u.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},u.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.0.0",e.tags=["{{","}}"];var x=new u;e.clearCache=function(){return x.clearCache()},e.parse=function(e,t){return x.parse(e,t)},e.render=function(e,t,n){return x.render(e,t,n)},e.to_html=function(n,r,o,i){var s=e.render(n,r,o);return t(i)?void i(s):s},e.escape=i,e.Scanner=l,e.Context=h,e.Writer=u}),function(){var t=function(e,n,r){var o=function(e,n,r){e.$observer||(e.$observer=this);var o=e.$observer,i=[];t.isArray(e)&&(0===e.length&&(e.$observeProps={},e.$observeProps.$observerPath="#"),o.mock(e));for(var s in e)e.hasOwnProperty(s)&&(r?t.isArray(n)&&t.isInArray(n,s)?(i.push(s),o.watch(e,s)):t.isString(n)&&s==n&&(i.push(s),o.watch(e,s)):(i.push(s),o.watch(e,s)));o.target=e,o.propertyChangedHandler||(o.propertyChangedHandler=[]);var a=r?r:n;o.propertyChangedHandler.push({all:!r,propChanged:a,eventPropArr:i})};return o.prototype={onPropertyChanged:function(e,n,r,o,i){if(n!==r&&this.propertyChangedHandler)for(var s=t._getRootName(e,i),a=0,c=this.propertyChangedHandler.length;c>a;a++){var l=this.propertyChangedHandler[a];(l.all||t.isInArray(l.eventPropArr,s)||0===s.indexOf("Array-"))&&l.propChanged.call(this.target,e,n,r,i)}0!==e.indexOf("Array-")&&"object"==typeof n&&this.watch(o,e,o.$observeProps.$observerPath)},mock:function(e){var n=this;e.forEach(function(e,t){e._nuclearIndex=t}),t.methods.forEach(function(r){e[r]=function(){var e=Array.prototype.slice.call(this,0),o=Array.prototype[r].apply(this,Array.prototype.slice.call(arguments));if(new RegExp("\\b"+r+"\\b").test(t.triggerStr)){this.forEach(function(e,t){e._nuclearIndex=t});for(var i in this)this.hasOwnProperty(i)&&!t.isFunction(this[i])&&n.watch(this,i,this.$observeProps.$observerPath);n.onPropertyChanged("Array-"+r,this,e,this,this.$observeProps.$observerPath)}return o}})},watch:function(e,n,r){if("$observeProps"!==n&&"$observer"!==n&&!t.isFunction(e[n])){e.$observeProps||(e.$observeProps={}),void 0!==r?e.$observeProps.$observerPath=r:e.$observeProps.$observerPath="#";var o=this,i=e.$observeProps[n]=e[n];if(Object.defineProperty(e,n,{get:function(){return this.$observeProps[n]},set:function(t){var r=this.$observeProps[n];this.$observeProps[n]=t,o.onPropertyChanged(n,t,r,this,e.$observeProps.$observerPath)}}),"object"==typeof i){t.isArray(i)&&(this.mock(i),0===i.length&&(i.$observeProps||(i.$observeProps={}),void 0!==r?i.$observeProps.$observerPath=r:i.$observeProps.$observerPath="#"));for(var s in i)i.hasOwnProperty(s)&&this.watch(i,s,e.$observeProps.$observerPath+"-"+n)}}}},new o(e,n,r)};t.methods=["concat","copyWithin","entries","every","fill","filter","find","findIndex","forEach","includes","indexOf","join","keys","lastIndexOf","map","pop","push","reduce","reduceRight","reverse","shift","slice","some","sort","splice","toLocaleString","toString","unshift","values","size"],t.triggerStr=["concat","copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift","size"].join(","),t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isInArray=function(e,t){for(var n=e.length;--n>-1;)if(t===e[n])return!0;return!1},t.isFunction=function(e){return"[object Function]"==Object.prototype.toString.call(e)},t.twoWay=function(e,n,r,o){"object"==typeof e[n]&&"object"==typeof r[o]?(t(e,n,function(e,t){r[o]=this[n]}),t(r,o,function(t,r){e[n]=this[o]})):(t(e,n,function(e,t){r[o]=t}),t(r,o,function(t,r){e[n]=r}))},t._getRootName=function(e,t){return"#"===t?e:t.split("-")[1]},t.add=function(e,t,n){e[t]=n;var r=e.$observer;r.watch(e,t)},Array.prototype.size=function(e){this.length=e},e.observe=t}(),e.Class=function(){},e.Class.extend=function(t){function n(){this.ctor.apply(this,arguments)}var r=Object.create(this.prototype);for(var o in t)r[o]=t[o];return n.prototype=r,n.prototype._super=Object.create(this.prototype),n.prototype.constructor=n,n.extend=e.Class.extend,n},function(){function t(){var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet.insertRule("body { visibility: hidden; }",0)}function n(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,"$1"+t+" "),n+r)})}function r(){var e=document.body.querySelectorAll("style[scoped]");if(0===e.length)return void(document.getElementsByTagName("body")[0].style.visibility="visible");var t=document.head||document.getElementsByTagName("head")[0];o&&t.removeChild(o),o=document.createElement("style");for(var r="",i=0;i40?(this._nuclearLocalRefresh(),this._preNuclearTime=new Date):this._nuclearTimer=setTimeout(function(){this._nuclearLocalRefresh()}.bind(this),40))}.bind(this)),this._nuclearRenderInfo={tpl:this._nuclearTplGenerator(),data:this.option,parent:this.parent},this._nuclearRender(this._nuclearRenderInfo),this.installed&&this.installed()},t.refresh=function(){this._nuclearLocalRefresh()},t.render&&(t._nuclearTplGenerator=t.render),t.render=function(){return this._nuclearParentEmpty?this.HTML:this._nuclearTplGenerator()},t._nuclearRender=function(t){if(this.node)if(e.isUndefined(t.tpl))t.parent.removeChild(this.node),this.node=null,this.HTML="";else{var n=e.str2Dom(this._nuclearWrap(e.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data)));t.parent.replaceChild(n,this.node),this.node=n}else e.isUndefined(t.tpl)||(t.parent.insertAdjacentHTML("beforeEnd",this._nuclearWrap(e.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))),this.node=t.parent.lastChild);this.node&&(this._nuclearId=e.getId(),this.node.setAttribute("data-nuclearId",this._nuclearId),this._mixNode(),t.refreshPart=this.node.querySelectorAll("*[nc-refresh]"),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh())},t._mixNode=function(){var e=this.node.querySelectorAll("*[nc-id]"),t=e.length;if(t>0)for(var n=0;t>n;n++){var r=e[n];this[r.getAttribute("nc-id")]=r}var o=this.node.querySelectorAll("*[nc-class]"),i=o.length;if(i>0){for(var s=0;i>s;s++){var a=o[s],c=a.getAttribute("nc-class");this[c]=[]}for(s=0;i>s;s++){var a=o[s],c=a.getAttribute("nc-class");this[c].push(a)}}},t._nuclearFix=function(){this._nuclearParent||this._nuclearFixOne(this)},t._nuclearFixOne=function(e){var t=e._nuclearRef.length;if(t>0)for(var n=0;t>n;n++){var r=e._nuclearRef[n];r.node=e.node.querySelector('*[data-nuclearId="'+r._nuclearId+'"]'),r.node&&(r._mixNode(),r._nuclearRenderInfo.refreshPart=r.node.querySelectorAll("*[nc-refresh]"),r._nuclearRenderInfo.parent=r.node.parentNode,this._nuclearFixOne(r),r.onRefresh&&r.onRefresh(),r.installed&&r.installed())}},t._nuclearWrap=function(e){var t="";return this.style&&(t=""),"
"+e+t+"
"},t._nuclearLocalRefresh=function(){var t=this._nuclearRenderInfo,n=t.refreshPart.length;if(t.tpl=this._nuclearTplGenerator(),n>0){for(var r=e.str2Dom(this._nuclearWrap(e.render(e._fixEvent(e._fixTplIndex(t.tpl),this._ncInstanceId),t.data))).querySelectorAll("*[nc-refresh]"),o=0;n>o;o++){var i=t.refreshPart[o];i.parentNode&&i.parentNode.replaceChild(r[o],i)}t.refreshPart=r,this._mixNode(),this.HTML=this.node.outerHTML,this._nuclearFix(),this.onRefresh&&this.onRefresh()}else this._nuclearRender(t);e.refreshStyle()}},e._fixEvent=function(e,t){return e.replace(/<[\s\S]*?>/g,function(e){return e.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g,function(e,n,r,o,i){return"Nuclear.instances["===i.substr(e.length+o,18)?e:e+="Nuclear.instances["+t+"]."})})},e._fixTplIndex=function(e){return e.replace(/{{@index}}/g,"{{_nuclearIndex}}")},e.str2Dom=function(e){var t={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],body:[0,"",""],_default:[1,"
","
"]};t.optgroup=t.option,t.tbody=t.tfoot=t.colgroup=t.caption=t.thead,t.th=t.td;var n=/<\s*\w.*?>/g.exec(e),r=document.createElement("div");if(null!=n){var o=n[0].replace(//g,"").split(" ")[0];if("body"===o.toLowerCase()){var i=document.createElement("body");r.innerHTML=e.replace(//g,"");var s=r.firstChild.attributes;i.innerHTML=e;for(var a=0;a"'\/]/g,function(e){return y[e]})}function s(t,r){function i(){if(x&&!P)for(;y.length;)delete v[y.pop()];else y=[];x=!1,P=!1}function s(e){if("string"==typeof e&&(e=e.split(b,2)),!d(e)||2!==e.length)throw new Error("Invalid tags: "+e);h=new RegExp(n(e[0])+"\\s*"),u=new RegExp("\\s*"+n(e[1])),p=new RegExp("\\s*"+n("}"+e[1]))}if(!t)return[];var h,u,p,f=[],v=[],y=[],x=!1,P=!1;s(r||e.tags);for(var T,I,C,$,E,A,R=new l(t);!R.eos();){if(T=R.pos,C=R.scanUntil(h))for(var S=0,k=C.length;k>S;++S)$=C.charAt(S),o($)?y.push(v.length):P=!0,v.push(["text",$,T,T+1]),T+=1,"\n"===$&&i();if(!R.scan(h))break;if(x=!0,I=R.scan(w)||"name",R.scan(g),"="===I?(C=R.scanUntil(m),R.scan(m),R.scanUntil(u)):"{"===I?(C=R.scanUntil(p),R.scan(_),R.scanUntil(u),I="&"):C=R.scanUntil(u),!R.scan(u))throw new Error("Unclosed tag at "+R.pos);if(E=[I,C,T,R.pos],v.push(E),"#"===I||"^"===I)f.push(E);else if("/"===I){if(A=f.pop(),!A)throw new Error('Unopened section "'+C+'" at '+T);if(A[1]!==C)throw new Error('Unclosed section "'+A[1]+'" at '+T)}else"name"===I||"{"===I||"&"===I?P=!0:"="===I&&s(C)}if(A=f.pop())throw new Error('Unclosed section "'+A[1]+'" at '+R.pos);return c(a(v))}function a(e){for(var t,n,r=[],o=0,i=e.length;i>o;++o)t=e[o],t&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function c(e){for(var t,n,r=[],o=r,i=[],s=0,a=e.length;a>s;++s)switch(t=e[s],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function l(e){this.string=e,this.tail=e,this.pos=0}function h(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function u(){this.cache={}}var p=Object.prototype.toString,d=Array.isArray||function(e){return"[object Array]"===p.call(e)},f=RegExp.prototype.test,v=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},g=/\s*/,b=/\s+/,m=/\s*=/,_=/\s*\}/,w=/#|\^|\/|>|\{|&|=|!/;l.prototype.eos=function(){return""===this.tail},l.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},l.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},h.prototype.push=function(e){return new h(e,this)},h.prototype.lookup=function(e){var n,r=this.cache;if(e in r)n=r[e];else{for(var o,i,s=this,a=!1;s;){if(e.indexOf(".")>0)for(n=s.view,o=e.split("."),i=0;null!=n&&ic;++c)s=void 0,o=e[c],i=o[0],"#"===i?s=this.renderSection(o,t,n,r):"^"===i?s=this.renderInverted(o,t,n,r):">"===i?s=this.renderPartial(o,t,n,r):"&"===i?s=this.unescapedValue(o,t):"name"===i?s=this.escapedValue(o,t):"text"===i&&(s=this.rawValue(o)),void 0!==s&&(a+=s);return a},u.prototype.renderSection=function(e,n,r,o){function i(e){return s.render(e,n,r)}var s=this,a="",c=n.lookup(e[1]);if(c){if(d(c))for(var l=0,h=c.length;h>l;++l)a+=this.renderTokens(e[4],n.push(c[l]),r,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)a+=this.renderTokens(e[4],n.push(c),r,o);else if(t(c)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");c=c.call(n.view,o.slice(e[3],e[5]),i),null!=c&&(a+=c)}else a+=this.renderTokens(e[4],n,r,o);return a}},u.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);return!o||d(o)&&0===o.length?this.renderTokens(e[4],t,n,r):void 0},u.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},u.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);return null!=n?n:void 0},u.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);return null!=r?e.escape(r):void 0},u.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.0.0",e.tags=["{{","}}"];var x=new u;e.clearCache=function(){return x.clearCache()},e.parse=function(e,t){return x.parse(e,t)},e.render=function(e,t,n){return x.render(e,t,n)},e.to_html=function(n,r,o,i){var s=e.render(n,r,o);return t(i)?void i(s):s},e.escape=i,e.Scanner=l,e.Context=h,e.Writer=u}),function(){var t=function(e,n,r){var o=function(e,n,r){e.$observer||(e.$observer=this);var o=e.$observer,i=[];t.isArray(e)&&(0===e.length&&(e.$observeProps={},e.$observeProps.$observerPath="#"),o.mock(e));for(var s in e)e.hasOwnProperty(s)&&(r?t.isArray(n)&&t.isInArray(n,s)?(i.push(s),o.watch(e,s)):t.isString(n)&&s==n&&(i.push(s),o.watch(e,s)):(i.push(s),o.watch(e,s)));o.target=e,o.propertyChangedHandler||(o.propertyChangedHandler=[]);var a=r?r:n;o.propertyChangedHandler.push({all:!r,propChanged:a,eventPropArr:i})};return o.prototype={onPropertyChanged:function(e,n,r,o,i){if(n!==r&&this.propertyChangedHandler)for(var s=t._getRootName(e,i),a=0,c=this.propertyChangedHandler.length;c>a;a++){var l=this.propertyChangedHandler[a];(l.all||t.isInArray(l.eventPropArr,s)||0===s.indexOf("Array-"))&&l.propChanged.call(this.target,e,n,r,i)}0!==e.indexOf("Array-")&&"object"==typeof n&&this.watch(o,e,o.$observeProps.$observerPath)},mock:function(e){var n=this;e.forEach(function(e,t){e._nuclearIndex=t}),t.methods.forEach(function(r){e[r]=function(){var e=Array.prototype.slice.call(this,0),o=Array.prototype[r].apply(this,Array.prototype.slice.call(arguments));if(new RegExp("\\b"+r+"\\b").test(t.triggerStr)){this.forEach(function(e,t){e._nuclearIndex=t});for(var i in this)this.hasOwnProperty(i)&&!t.isFunction(this[i])&&n.watch(this,i,this.$observeProps.$observerPath);n.onPropertyChanged("Array-"+r,this,e,this,this.$observeProps.$observerPath)}return o}})},watch:function(e,n,r){if("$observeProps"!==n&&"$observer"!==n&&!t.isFunction(e[n])){e.$observeProps||(e.$observeProps={}),void 0!==r?e.$observeProps.$observerPath=r:e.$observeProps.$observerPath="#";var o=this,i=e.$observeProps[n]=e[n];if(Object.defineProperty(e,n,{get:function(){return this.$observeProps[n]},set:function(t){var r=this.$observeProps[n];this.$observeProps[n]=t,o.onPropertyChanged(n,t,r,this,e.$observeProps.$observerPath)}}),"object"==typeof i){t.isArray(i)&&(this.mock(i),0===i.length&&(i.$observeProps||(i.$observeProps={}),void 0!==r?i.$observeProps.$observerPath=r:i.$observeProps.$observerPath="#"));for(var s in i)i.hasOwnProperty(s)&&this.watch(i,s,e.$observeProps.$observerPath+"-"+n)}}}},new o(e,n,r)};t.methods=["concat","copyWithin","entries","every","fill","filter","find","findIndex","forEach","includes","indexOf","join","keys","lastIndexOf","map","pop","push","reduce","reduceRight","reverse","shift","slice","some","sort","splice","toLocaleString","toString","unshift","values","size"],t.triggerStr=["concat","copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift","size"].join(","),t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isInArray=function(e,t){for(var n=e.length;--n>-1;)if(t===e[n])return!0;return!1},t.isFunction=function(e){return"[object Function]"==Object.prototype.toString.call(e)},t.twoWay=function(e,n,r,o){"object"==typeof e[n]&&"object"==typeof r[o]?(t(e,n,function(e,t){r[o]=this[n]}),t(r,o,function(t,r){e[n]=this[o]})):(t(e,n,function(e,t){r[o]=t}),t(r,o,function(t,r){e[n]=r}))},t._getRootName=function(e,t){return"#"===t?e:t.split("-")[1]},t.add=function(e,t,n){e[t]=n;var r=e.$observer;r.watch(e,t)},Array.prototype.size=function(e){this.length=e},e.observe=t}(),e.Class=function(){},e.Class.extend=function(t){function n(){this.ctor.apply(this,arguments)}var r=Object.create(this.prototype);for(var o in t)r[o]=t[o];return n.prototype=r,n.prototype._super=Object.create(this.prototype),n.prototype.constructor=n,n.extend=e.Class.extend,n},function(){function t(){var e=document.createElement("style");e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet.insertRule("body { visibility: hidden; }",0)}function n(e,t){var n=new RegExp("([^\r\n,{}]+)(,(?=[^}]*{)|s*{)","g");return e=e.replace(n,function(e,n,r){return n.match(/^\s*(@media|@keyframes|to|from|@font-face)/)?n+r:(n.match(/:scope/)&&(n=n.replace(/([^\s]*):scope/,function(e,t){return""===t?"> *":"> "+t})),n=n.replace(/^(\s*)/,"$1"+t+" "),n+r)})}function r(){var e=document.body.querySelectorAll("style[scoped]");if(0===e.length)return void(document.getElementsByTagName("body")[0].style.visibility="visible");var t=document.head||document.getElementsByTagName("head")[0];o&&t.removeChild(o),o=document.createElement("style");for(var r="",i=0;i