!function(){function u(e,t,n,r){var i;if(!e||!(i=e.firstChild))return null;do{var a=i.nextSibling}while(e.removeChild(i),t.push(i),i=a);var l=t.length;if(!r||!1!==r.replaceHTML){var u=[n];if(1<l)for(var f=n.parentNode,a=n.nextSibling,o=l;0<--o;){var s=document.createElement("DIV");u.push(s),f.insertBefore(s,a)}for(var g=0;g<l;++g)t[g].replaceHTML(u[g])}return t.length<=1?t[0]:t}function a(e){var t,n={},r=[];for(t in!function e(t,n){var r=t.tagName;if("zk"!=r&&"attribute"!=r){if(!zk.Widget.getClass(r)){var i=zk.wgt.WidgetInfo.getClassName(r);if(!i)throw"Unknown tag: "+r;r=i.lastIndexOf(".");0<=r&&(n[i.substring(0,r)]=!0)}for(t=t.firstChild;t;t=t.nextSibling){var a=t.nodeType;1==a&&e(t,n)}}}(e,n),n)r.push(t);return r.join(",")}function c(e,t,n,r){if(t){var i=h(e,t.getAttribute("forEach"),n);if(null!=i){for(var a=window.each,l=i.length,u=0;u<l;u++)window.each=i[u],f(e,t,n,r);window.each=a}else f(e,t,n,r)}}function f(e,t,n,r){var i=h(e,t.getAttribute("if"),n),a=h(e,t.getAttribute("unless"),n);if((null==i||i)&&(null==a||!a)){var l,i=t.tagName;if("zk"==i)f=e;else{if("attribute"==i){a=h(e,t.getAttribute("name"),n);if(!a)throw"The name attribute required, "+t;return void e.set(a,zk.xml.Utl.getElementValue(t))}var u=t.attributes,f=zk.Widget.newInstance(i);r&&r.push(f),e&&e.appendChild(f);for(var o=u.length,s=0;s<o;++s){var g=u[s];f.set(g.name,h(f,g.value,n))}}for(t=t.firstChild;t;t=t.nextSibling){var d,v=t.nodeType;1==v?(c(f,t,n,d=[]),l&&(d=d[0])&&(d.prolog=l,l=null)):3==v&&((d=h(f,t.nodeValue,n)).trim().length?((v=new zk.Native).prolog=d,f.appendChild(v)):f.blankPreserved&&(l=d))}}}function h(e,t,n){if(t)for(var r,i,a,l=0,u=t.length-1;;){if((r=t.indexOf("#{",l))<0&&(r=t.indexOf("${",l))<0){a&&(t=a+t.substring(l));break}if(o=t.substring(l,r),(i=t.indexOf("}",r+2))<0){t=a?a+o:o;break}a=a?a+o:o,o=t.substring(r+2,i);try{var f=new Function("var _=arguments[0];return "+o),o=e?f.call(e,n):f(n)}catch(e){throw"Failed to evaluate "+o}if(!a&&i==u)return o;o&&(a+=o),l=i+1}return t}zk.zuml.Parser={create:function(e,t,n,r){"function"!=typeof n||r||(r=n,n=null),t=("string"==typeof t?zk.xml.Utl.parseXML(t):t).documentElement;var i=[];return zk.load(a(t),function(){c(e,t,n,i),r&&r(i.length<=1?i[0]:i)}),i.length<=1?i[0]:i},createAt:function(e,t,n,r){"function"!=typeof n||r||(r=n,n=null);var i,a=jq(e)[0],e=(i=a,e=a.innerHTML,(e=(e=0<=(i=e.indexOf("\x3c!--"))?e.substring(i+4,e.lastIndexOf("--\x3e")):e).trim())?"<div>"+e.trim()+"</div>":null);if(e){var l=[],n=zk.zuml.Parser.create(null,e,n,function(e){e=u(e,l,a,t),r&&r(e)});return u(n,l,a,t)}}}}();