-
Notifications
You must be signed in to change notification settings - Fork 1
/
zest.build.min.js
18 lines (17 loc) · 29.6 KB
/
zest.build.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
* ZestJS
* http://zestjs.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(e,t){typeof exports=="object"?module.exports=t():typeof define=="function"&&define.amd?define("zoe/zoe",[],function(){return t()}):e.zoe=t()})(this,function(){var zoe={},console=typeof window!="undefined"?window.console=window.console||{}:global.console;console.dir=console.dir||function(){},console.log=console.log||function(){};var zoe_fn=zoe.fn=function(e,t){if(typeof e=="function"||typeof e=="string")t=e,e=null;var n=function(){return n.run(n._this||this,Array.prototype.splice.call(arguments,0),n.fns)};return n.constructor=zoe_fn,n.fns=e||[],n.run=(typeof t=="string"?zoe_fn[t]:t)||zoe_fn.LAST_DEFINED,n.on=on,n.off=off,n.first=first,n._this=undefined,n.bind=bind,n},bind=function(e){return this._this=e,this},on=function(e){return this.fns.push(e),this},off=function(e){if(!e){this.fns=[];return}for(var t=0;t<this.fns.length;t++)if(this.fns[t]==e){this.fns.splice(t,1);return}},first=function(e){return this.fns=[e].concat(this.fns),this};zoe_fn.executeReduce=function(e,t){return t===undefined&&(t=e,e=undefined),typeof e=="function"&&(e=e()),function(n,r,i){var s=e;for(var o=0;o<i.length;o++)s=t(s,i[o].apply(n,r));return s}};var l=zoe_fn.LAST_DEFINED=zoe_fn.executeReduce(function(e,t){return t!==undefined?t:e});zoe_fn.STOP_DEFINED=function(t,n,r){var i;for(var s=0;s<r.length;s++){i=r[s].apply(t,n);if(i!==undefined)return i}return i},zoe_fn.ASYNC=zoe_fn.ASYNC_NEXT=function(t,n,r){var i=0,s;typeof n[n.length-1]=="function"&&(s=n.pop());var o=function(e){return function(){r[e]?r[e].length>=n.length+1||r[e].run==zoe_fn.ASYNC?r[e].apply(t,n.concat([o(e+1)])):(r[e].apply(t,n),o(e+1)()):s&&s()}};return o(0)()},zoe_fn.ASYNC_SIM=function(t,n,r){var i=0,s;typeof n[n.length-1]=="function"&&(s=n.pop());for(var o=0;o<r.length;o++)r[o].apply(t,n.concat([function(){++i==r.length&&s()}]))},zoe.on=function(e,t,n){var r=e[t];if(!r||r.constructor!=zoe_fn||r.run!=zoe_fn.LAST_DEFINED)e[t]=zoe_fn(r?[r]:[]);e[t].on(n)},zoe.off=function(e,t,n){if(e[t].constructor==zoe_fn)return e[t].off(n)};var zoe_extend=zoe.extend=function(t,n,r){t=t||{};var i=arguments;i.length>2&&(r=i[i.length-1]);var s;typeof r=="object"?(s=r,r=undefined):r||(n._extend&&(t._extend=zoe_extend(t._extend||{},n._extend,"REPLACE")),s=t._extend);if(s)for(var o in s){var u=o.indexOf(".");if(u!=-1){var a=o.substr(0,u);s[a]||(s[a]=zoe_extend)}}for(var o in n)if(!n.hasOwnProperty||n.hasOwnProperty(o)){if(o=="_extend")continue;var f=n[o],l,c=o.length,h=o.substr(0,2)=="__",p=o.substr(c-2,2)=="__",d=h&&!p&&(o=o.substr(2))&&zoe_extend.APPEND||!h&&p&&(o=o.substr(0,c-2))&&zoe_extend.PREPEND||h&&p&&(o=o.substr(2,c-4))&&zoe_extend.REPLACE,v=d||r||s&&(s[o]||s["*"])||zoe_extend.DEFINE;typeof v=="string"&&(v=zoe_extend[v]);try{l=v(t[o],f,s&&zoe_extend.deriveRules(s,o))}catch(m){throw console.dir(t),console.dir(n),console.dir(zoe_extend.deriveRules(r,o)),'zoe.extend: "'+o+'" override error. \n ->'+(m.message||m)}l!==undefined&&(t[o]=l)}if(i.length>3){var g=[t];g.concat(Array.prototype.splice.call(i,2,i.length-3,i.length-3)),g.push(r),$z.extend.apply(this,g)}return t};zoe_extend.EXTEND=zoe_extend,zoe_extend.DEFINE=function(t,n){if(t!==undefined)throw"No override specified.";return n},zoe_extend.REPLACE=function(t,n){return n!==undefined?n:t},zoe_extend.FILL=function(t,n){return t===undefined?n:t},zoe_extend.IGNORE=function(){};var is_obj=function(e){return e!=null&&e.constructor==Object},is_fn=function(e){return typeof e=="function"},is_str=function(e){return typeof e=="string"},is_arr=function(e){return e instanceof Array},default_rule=function(e,t){return e?typeof e=="string"?e:(e&&!e["*"]&&(e["*"]=t),e):t};zoe_extend.APPEND=function(t,n,r){return is_obj(n)?zoe_extend(is_obj(t)?t:{},n,default_rule(r,"REPLACE")):is_fn(n)?zoe_extend.CHAIN(t,n):is_str(n)?zoe_extend.STR_APPEND(t,n):is_arr(n)?zoe_extend.ARR_APPEND(t,n):n},zoe_extend.PREPEND=function(t,n,r){return is_obj(n)&&(t===undefined||is_obj(t))?zoe_extend(t||{},n,default_rule(r,"FILL")):is_fn(n)?zoe_extend.CHAIN_FIRST(t,n):is_str(n)?zoe_extend.STR_PREPEND(t,n):is_arr(n)?zoe_extend.ARR_PREPEND(t,n):t===undefined?n:t},zoe_extend.DAPPEND=function(t,n,r){return zoe_extend.APPEND(t,n,default_rule(r,"DAPPEND"))},zoe_extend.DPREPEND=function(t,n,r){return zoe.extend.PREPEND(t,n,default_rule(r,"DPREPEND"))},zoe_extend.DREPLACE=function(t,n,r){return is_obj(n)?zoe_extend(t||{},n,default_rule(r,"DREPLACE")):is_arr(n)?zoe_extend(t||[],n,default_rule(r,"DREPLACE")):n},zoe_extend.DFILL=function(t,n,r){return is_obj(n)?zoe_extend(t||{},n,default_rule(r,"DFILL")):typeof t=="undefined"?n:t},zoe_extend.ARR_APPEND=function(t,n){return t=t||[],t.concat||(t=[t]),t.concat(n)},zoe_extend.ARR_PREPEND=function(t,n){return n=n||[],n.concat||(n=[n]),n.concat(t||[])},zoe_extend.STR_APPEND=function(t,n){return t?t+n:n},zoe_extend.STR_PREPEND=function(t,n){return n+t},zoe_extend.deriveRules=function(e,t){var n;for(var r in e){if(r=="*")continue;var i=r.split(".");if(i[0]==t||i[0]=="*")n=n||{},n[i.splice(1).join(".")]=e[r]}return n},zoe_extend.makeChain=function(e,t){return typeof e=="string"&&(e=zoe_fn[e]),function(n,r){if(!n||n.constructor!=zoe_fn||n.run!=e)n=zoe_fn(n?[n]:[],e);return t?n.first(r):n.on(r),n}},zoe_extend.CHAIN=zoe_extend.makeChain(zoe_fn.LAST_DEFINED),zoe_extend.CHAIN_FIRST=zoe_extend.makeChain(zoe_fn.LAST_DEFINED,!0),zoe_extend.CHAIN_STOP_DEFINED=zoe_extend.makeChain(zoe_fn.STOP_DEFINED),zoe_extend.CHAIN_ASYNC=zoe_extend.makeChain(zoe_fn.ASYNC),zoe.create=function(e,t){t=inheritCheck(e,t),t._definition&&(t=t._definition);var n,r;implementLoop(t,function(e){n=n||e._base,r=r||e._name});var i=n?n(r):{};i._definition=t,i._extend={_name:zoe_extend.IGNORE,_base:zoe_extend.IGNORE,_implement:zoe_extend.IGNORE,_reinherit:zoe_extend.IGNORE,_make:zoe_extend.IGNORE,_integrate:zoe_extend.IGNORE,_built:zoe_extend.IGNORE};var s=[],o=zoe_fn(),u=zoe_fn();return u._this=o._this=i,implementLoop(t,function(n){n=u(n,t)||n,n._integrate&&u.on(n._integrate),zoe_extend(i,n),n._make&&n._make.call(i,t,n),n._built&&o.on(n._built),s.push(n)},function(t){return s.indexOf(t)!=-1&&!t._reinherit}),o(t),i};var implementLoop=function(e,t,n){n=n||function(){};if(e._implement)for(var r=0,i=e._implement.length;r<i;r++){var s=e._implement[r];s||(console.dir(e),console.log("Implementor not defined!")),s._definition&&(s=s._definition);if(n(s))continue;if(implementLoop(s,t,n))return!0}return t(e)},inheritCheck=function(e,t){return e instanceof Array||(t=e,e=[]),t=t||{},t._implement=e.concat(t._implement||[]),t};zoe.inherits=function(e,t){if(e._definition)return zoe.inherits(e._definition,t);if(t._definition)return zoe.inherits(e,t._definition);var n=!1;return implementLoop(e,function(e){if(e===t)return n=!0,!0}),n};var evalSupport=!1;try{eval(""),evalSupport=!0}catch(e){}return zoe.Constructor={_base:function(name){return evalSupport&&name&&name.match(/^[a-z]+$/i)?eval("(function "+name+"(){if("+name+".construct)"+name+".construct.apply(this, arguments);})"):function Constructor(){Constructor.construct&&Constructor.construct.apply(this,arguments)}},_extend:{prototype:zoe_extend,construct:zoe_extend.CHAIN},_integrate:function(e){if(typeof e=="function"&&!e._definition)return{construct:e,prototype:e.prototype};var t=Object.getOwnPropertyDescriptor;if(t){var n=t(e,"prototype");n&&!n.enumerable&&zoe_extend(this.prototype,e.prototype,zoe_extend.deriveRules(this._extend,"prototype"))}}},zoe_fn.COMPOSE_FIRST=function(t,n,r){if(r.length==0)return;var i=r[0].apply(t,n);n=i instanceof Array?i:n;for(var s=1;s<r.length;s++)r[s].apply(t,n)},zoe.InstanceEvents={_extend:{_events:"ARR_APPEND"},construct:function(){var e=this.constructor._events;if(!e)return;for(var t=0;t<e.length;t++){var n=e[t];this[n]=zoe.fn(this[n]?[this[n]]:[],this[n]?"COMPOSE_FIRST":"LAST_DEFINED").bind(this)}}},zoe}),define("zoe",["zoe/zoe"],function(e){return e}),define("require-is/is-api",[],function(){var e={},t=0;return e.normalize=function(n,r){if(t++%2==1)return n;var i=e.parse(n);i.feature=r(i.feature),i.yesModuleId&&(i.yesModuleId=r(i.yesModuleId)),i.noModuleId&&(i.noModuleId=r(i.noModuleId));if(i.type=="lookup")return i.feature;i.yesBuild||(i.yesModuleId="["+i.yesModuleId+"]"),i.noBuild||(i.noModuleId="["+i.noModuleId+"]");if(i.type=="load_if_not")return"~"+i.feature+"?"+i.yesModuleId+(i.noModuleId?":"+i.noModuleId:"");if(i.type=="load_if")return i.feature+"?"+i.yesModuleId+(i.noModuleId?":"+i.noModuleId:"")},e.parse=function(e){var t=e.substr(0,e.indexOf("?")),n=e.substr(t.length+1,e.length-t.length-1),r=n.substr(0,n.indexOf(":"));n.substr(r.length+1,2)=="//"&&(r=n.substr(0,n.indexOf(":",r.length+1)));var i=n.substr(r.length+1,n.length-r.length-1);r==""&&(r=n,i=null);var s=!0,o=!0;return r&&r.substr(0,1)=="["&&r.substr(r.length-1,1)=="]"&&(r=r.substr(1,r.length-2),s=!1),i&&i.substr(0,1)=="["&&i.substr(i.length-1,1)=="]"&&(i=i.substr(1,i.length-2),o=!1),t==""?{feature:e,type:"lookup"}:t.substr(0,1)=="~"?{feature:t.substr(1,e.length-1),type:"load_if_not",yesModuleId:r,noModuleId:i,yesBuild:s,noBuild:o}:{feature:t,type:"load_if",yesModuleId:r,noModuleId:i,yesBuild:s,noBuild:o}},e}),define("require-is/is",["module","./is-api"],function(e,t){return is={},is.pluginBuilder="./is-builder",is.normalize=t.normalize,is.features=e.config()||{},is.features.browser===undefined&&(is.features.browser=typeof window!="undefined"),is.features.build===undefined&&(is.features.build=!1),is.curModule=null,is.modules=null,is.empty=function(){return null},is.lookup=function(e,t){if(is.features[e]!==undefined){t(is.features[e]);return}require([e],function(n){if(n!==!0&&n!==!1)throw"Feature module "+e+" must return true or false.";is.features[e]=n,t(n)})},is.load=function(e,n,r,i){var s=t.parse(e);s.type=="lookup"&&is.lookup(s.feature,r),(s.type=="load_if"||s.type=="load_if_not")&&is.lookup(s.feature,function(e){e&&s.type=="load_if"||!e&&s.type=="load_if_not"?require([s.yesModuleId],r):!e&&s.type=="load_if"&&s.noModuleId||e&&s.type=="load_if_not"&&s.noModuleId?require([s.noModuleId],r):r(is.empty())})},is}),define("amdquery/css-support",[],function(){if(typeof window=="undefined"||typeof window.location=="undefined")return null;var e="0.3",t=window,n,r,i=t.document,s=i.documentElement,o=s.getElementsByTagName("head")[0]||s,u=i.implementation||{hasFeature:function(){return!1}},r=i.createElement("style");r.type="text/css",o.insertBefore(r,o.firstChild),n=r.sheet||r.styleSheet;var a=function(e){return e=="float"?"styleFloat"in s.style?"styleFloat":"cssFloat"in s.style?"cssFloat":e:e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})};return{supportSelector:u.hasFeature("CSS2","")?function(e){if(!n||!e)return!1;try{n.insertRule(e+"{ }",0),n.deleteRule(n.cssRules.length-1)}catch(t){return!1}return!0}:function(e){return!n||!e?!1:(n.cssText=e+" { }",n.cssText.length!==0&&!/unknown/i.test(n.cssText)&&n.cssText.indexOf(e)===0)}}}),define("amdquery/native-selector",["./css-support"],function(e){if(typeof window=="undefined")return!0;if(!document.querySelectorAll)return!1;var t=["E > F","E + F","E[foo]",'E[foo="bar"]'];for(var n=0;n<t.length;n++)if(!e.supportSelector(t[n]))return!1;return!0}),define("amdquery/amdquery",["is!~./native-selector?http://cdnjs.cloudflare.com/ajax/libs/sizzle/1.9.1/sizzle.min.js"],function(e){var t="amd-selector-context",n=function(){},r=new Array;n.prototype=r;var i=function(r,i){var s=new n;if(e)return e(r,i,s);i&&(i.id?r="#"+i.id+" "+r:(i.id=t,r="#"+t+" "+r));var o=document.querySelectorAll(r);i&&i.id==t&&(i.id="");for(var u=0,a=o.length;u<a;u++)s[u]=o[u];return s.length=o.length,s};i.addMethods=function(e){for(var t in e)(function(e){r[t]=function(){var t=Array.prototype.splice.call(arguments,0);return t.unshift(this),e.apply(this,t)}})(e[t])},i.normalize=function(e,t){var n=e.split(",");for(var r=0;r<n.length;r++)n[r]=t(n[r]);return n.join(",")};var s=[];return i.load=function(e,t,n,r){var o=e.split(",");for(var u=0;u<o.length;u++)s.indexOf(o[u])!=-1?o.splice(u--,1):s.push(o[u]);t(o,function(){for(var e=0;e<arguments.length;e++){var t=arguments[e];if(!t)continue;i.addMethods(t)}n(i)})},i}),define("amdquery",["amdquery/amdquery"],function(e){return e}),define("zest/com",{pluginBuilder:"./com-build",load:function(e,t,n){n()}}),function(e,t){typeof define=="function"&&define.amd?define("zest/zest-render",["require","amdquery","module","./com!"],t):t(null,window.$||document.querySelectorAll,null)}(this,function(e,t,n){var r=n&&n.config(),i=r&&r.typeAttribute||"component",s=function(){return s.selectAll.apply(this,arguments)};if(!r||r.defineGlobal)this.$z=s;s._components={},s._global=null,s.selectAll=function(e,n,r,i){if(!e){var o=[];for(var u in s._components)o.push(u);return o}typeof n=="function"&&(i=r,r=n,n=undefined),n=n||s.getElement(this)||document;var o=t(e,n);i&&(o=o[0]?[o[0]]:[]);var a=[],f=0;for(var l=0;l<o.length;l++)a[l]=s.getComponent(o[l].id)||o[l],r&&a[l].constructor==s.fn&&(f++,function(e){a[e].on(function(t){f--,a[e]=t,f==0&&r(a)})}(l));return r&&f==0?r(a):i?a[0]:a},s.select=function(e,t,n){return s.selectAll(e,t,n,!0)},s.$=function(e,n){return n=n||s.getElement(this)||document,t(e,n)},s.render=function(e,t,n,r){arguments.length==2&&(n=t,t={}),typeof n=="function"&&(r=n,n=t,t={}),n=n.length?n[0]:n,t=t||{},t.global=t.global||s._global;var i=s.render.Buffer(),o=function(){s.render.Buffer(n).write(i);var e=s("*",n);for(var t=0;t<e.length;t++)e[t].constructor==s.fn?e[t].on(function(e){typeof e.init=="function"&&e.init()}):typeof e[t].init=="function"&&e[t].init();r&&r.apply(this,arguments)};s.render.renderItem(e,t,i.write,o)},s._nextComponentId=1,s.render.renderItem=function(t,n,r,i){i===undefined&&(i=r,r=n,n=null),i=i||function(){};if(typeof t=="undefined"||t==null)return i();n=n||{},n.global=n.global||{};var o=this;if(typeof t=="undefined"||t===null)return i();if(typeof t=="string")t.substr(0,1)=="@"?e([t.substr(1)],function(e){o.renderItem(e,n,r,i)}):o.renderTemplate(t,null,n,r,i);else if(typeof t=="function"&&!t.render)t.length==2?t(n,function(e){o.renderItem(e,{global:n.global},r,i)}):(t=t(n),typeof t=="string"?o.renderTemplate(t,null,n,r,i):o.renderItem(t,{global:n.global},r,i));else if(t instanceof Array)o.renderArray(t,{global:n.global},r,i);else{if(!t.render){if("render"in t)return i();throw s.dir(t),"Unrecognised structure item for render."}o.renderComponent(t,n,r,i)}},s.render.renderArray=function(e,t,n,r){var i=0,s=this,o=function(){if(i==e.length){r();return}s.renderItem(e[i++],{global:t.global},n,function(e){o()})};o()};var o=function(e,t){var n=e.split(".");if(n.length>1){var r=n.shift();return t[r]?o(n.join("."),t[r]):undefined}return t[e]};s.render.renderTemplate=function(e,n,r,i,u){var a;e=e.trim();var f=e.match(/\{\`[\w\.]+\`\}|\{\[[\w\.]+\]\}/g);if(f)for(var l=0;l<f.length;l++){var c=f[l],h=c.substr(2,c.length-4);f[l]=h;var p=e.match(new RegExp("(</(\\w*)[^>]*>|<(\\w*)[^>]*/>)\\s*"+c));p=p&&(p[2]||p[3])||"span";var d=e.match(new RegExp("<(\\w*)[^>]*>\\s*"+c));d=d&&d[1]||"div";var v=p||"span";d=="tbody"&&(v="tr"),e=e.replace(c,"<"+v+' style="display: none;" region-placeholder="'+h+'"></'+v+">"),delete c}var m=s.render.Buffer();m.write(e);var g={};if(f)for(var l=0;l<f.length;l++){var c=f[l],y;for(var b=0;b<m.container.childNodes.length;b++){var w=m.container.childNodes[b];if(w.getAttribute&&w.getAttribute("region-placeholder")==c){y=w;break}if(w.nodeType==1){var E=t('[region-placeholder="'+c+'"]',w);if(E.length>0){y=E[0];break}}}g[c]=y}a=m.toArray(),i(m);if(!f)return u(a);var S=0,x=function(e){var t={};for(var n in e)t[n]=e[n];return t};for(var l=0;l<f.length;l++)(function(e,t){var i=n&&o(e,n)||o(e,r),l=a.indexOf(t);s.render.renderItem(i,i&&i.render?x(r):r,function(e){var n=s.render.Buffer();n.write(e);if(n.container)while(n.container.childNodes.length>0)l!=-1&&a.splice(l++,0,n.container.childNodes[0]),t.parentNode.insertBefore(n.container.childNodes[0],t)},function(){t.parentNode.removeChild(t),l!=-1&&a.splice(l,1),S++,S==f.length&&u(a)})})(f[l],g[f[l]])},s.fn&&(s.fn.STOP_FIRST_DEFINED=s.fn.STOP_FIRST_DEFINED||function(e,t,n){var r=n[0].apply(e,t);if(r!=="undefined")return;for(var i=1;i<n.length;i++)n[i].apply(e,t)}),s.render.renderComponent=function(t,n,r,o){if(t.options)for(var u in t.options)n[u]===undefined&&(n[u]=t.options[u]);var f=this,l=function(){var u,l=n.id,c=t.type,h=(t.className||"")+(n.className&&t.className?" "+n.className:n.className||"");l===undefined&&(t.attach||t.style)&&(l="z"+s._nextComponentId++,n.id=l);if(s._components[l])throw"Id "+l+" already has an attachment defined!";if(c&&c.substr(0,1).toUpperCase()!=c.substr(0,1))throw"Type names must always start with an uppercase letter.";var p=function(r){var u=r&&r[0];if(!u)return o();if(l){if(u.id!=l&&s._components[l])throw"Id "+l+" already defined!";u.id=l}c&&(u.getAttribute(i)||u.setAttribute(i,c)),h&&(u.className?u.className+=" "+h:u.className=h);if(t.style){var f=typeof t.style=="function"?t.style(n):t.style,p=document.createElement("style");p.type="text/css",p.setAttribute("data-zid",l),p.styleSheet?p.styleSheet.cssText=f:p.appendChild(document.createTextNode(f)),u.parentNode.insertBefore(p,u)}if(!t.attach)return o();if(c===undefined&&!u.getAttribute(i)){var d=s.getModuleId(t);d?(c=d.split("/").pop(),c=c[0].toUpperCase()+c.substr(1)):u.setAttribute(i,"")}t.pipe===!0&&(t.pipe=function(e){return e});if(t.pipe instanceof Array){var v=t.pipe,m={};t.pipe=function(e){for(var t=0;t<v.length;t++)m[v[t]]=e[v[t]];return m}}var g=t.pipe?t.pipe(n)||{}:null;g&&(g.global=n.global);var y=function(e){controller=new e(r[0],g||{global:n.global});if(!controller)return o();var t=controller.dispose;t&&s.fn?(t.constructor==s.fn&&controller.hasOwnProperty&&controller.hasOwnProperty(t)?t.run=s.fn.STOP_FIRST_DEFINED:t=s.fn([t],s.fn.STOP_FIRST_DEFINED),t.first(function(e){if(!e)return s.dispose(r)}),controller.dispose=t):controller.dispose=function(e){if(!e)return s.dispose(r);t&&t()},s._components[l]=controller,o(controller)};if(typeof t.attach=="string"){var b=t.attach,d=s.getModuleId(t);if(d){var w=!1;b.substr(0,3)=="cs!"&&(w=!0,b=b.substr(3));var E=a.makeModuleMap(d,null,!1,!1);b=a.makeModuleMap(b,E,!1,!0).id,w&&(b="cs!"+b)}e([b],function(e){y(e)})}else y(t.attach)},d=function(i){if(typeof i=="string"&&i.substr(0,1)=="@"){e([i.substr(1)],d);return}typeof i=="function"&&!i.render&&i.length==1?(i=i.call(t,n),typeof i=="string"?f.renderTemplate(i,t,n,r,p):t.attach?(t.main=i,f.renderTemplate("<div>{[main]}</div>",t,n,r,p)):f.renderItem(i,{global:n.global},r,p)):typeof i=="string"?f.renderTemplate(i,t,n,r,p):t.attach?(t.main=i,f.renderTemplate("<div>{[main]}</div>",t,n,r,p)):f.renderItem(i,n,r,p)};d(t.render)};t.load?t.load.length==1?(t.load(n),l()):t.load(n,l):l()};var u=function(e){return e=="tr"?"tbody":"div"};s.render.Buffer=function(e){if(e&&e.constructor==s.fn)throw"Its a $z fn!";var t={};return t.container=e,t.toArray=function(){var e=[];for(var t=0;t<this.container.childNodes.length;t++)e.push(this.container.childNodes[t]);return e},t.write=function(e){if(typeof e=="string"){var n=e.match(/<(\w*)[^>]*>/);n=n&&n[1]||"div";var r=document.createElement(u(n));r.innerHTML=e,t.write({write:!0,container:r})}else if(e.write){if(!t.container&&e.container.childNodes[0]){var n=(e.container.childNodes[0].tagName||"span").toLowerCase();t.container=document.createElement(u(n))}while(e.container.childNodes.length>0)t.container.appendChild(e.container.childNodes[0])}else if(e.nodeType)t.container=t.container||document.createElement(u(e.tagName.toLowerCase())),t.container.appendChild(e);else if(e.length){!t.container&&e[0]&&(t.container=document.createElement(e[0].tagName.toLowerCase()));for(var i=0;i<e.length;i++)t.container.appendChild(e[i])}},t};if(typeof requirejs!="undefined"){var a=null,f;e:for(var l in requirejs.s.contexts){f=requirejs.s.contexts[l].defined;for(var c in f)if(f[c]==t){a=requirejs.s.contexts[l];break e}}if(!a)throw"Unable to detect RequireJS context.";s.getModuleId=function(e,t){var n;if(e==null)return n;for(var r in f)f[r]==e?n=r:t!==!1&&f[r]&&e._definition==f[r]&&(n=r);return n}}s.getElement=function(e){if(typeof e=="string")return document.getElementById(e);if(e.el)return e.el;for(var t in s._components)if(s._components[t]==e)return document.getElementById(t)},s.getComponent=function(e){if(typeof e=="string"){var t=s._components[e];return t===!0&&(t=s._components[e]=s.fn()),t}var t=s.getComponent(e.id);return t?t:null};var h=function(e){var n=e.constructor==s.fn;if(e&&e.dispose&&!e._disposed||n){n||(e.dispose(!0),e._disposed=!0);for(var r in s._components)if(s._components[r]==e){var i=t('style[data-zid="'+r+'"]');i&&i[0]&&i[0].parentNode.removeChild(i[0]),n?s._components[r]=!1:delete s._components[r];break}}};return s.dispose=function(e){if(typeof e=="string")return s.dispose(t(e));if(!e.nodeType&&e.length){for(var n=e.length-1;n>=0;n--)s.dispose(e[n]);return}e.id&&s._components[e.id]&&h(s._components[e.id]);var r=s("*",e);for(var n=0;n<r.length;n++)h(r[n]);e.parentNode&&e.parentNode.removeChild(e)},s}),function(e,t){typeof define=="function"&&define.amd?define("zest/escape",t):e.$z.esc=t()}(this,function(){var e=function(t,n){var r=Array.prototype.splice.call(arguments,2,arguments.length-2);return r.unshift(t),e[n].apply(e,r)};return e.num=function(e,t){var n=parseFloat(e);return isNaN(n)?t||0:n+""},e.attr=function(e){return(e+"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'")},e.htmlText=function(e){return(e+"").replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/</g,"<").replace(/>/g,">")},e.cssAttr=function(e){return(e+"").replace(/"/g,""").replace(/{/g,"").replace(/}/g,"").replace(/:/g,"").replace(/;/g,"")},e.html=function(t,n,r){var i=["cite","href","poster","src"];n=n||["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","h1","h2","h3","h4","h5","h6","header","group","hr","i","img","input","ins","label","legend","li","map","mark","menu","meter","nav","nobr","noscript","ol","optgroup","option","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","video","wbr"],r=r||["align","alt","autocomplete","autofocus","autoplay","bgcolor","border","buffered","checked","cite","class","color","cols","colspan","contenteditable","contextmenu","controls","coords","datetime","default","dir","dirname","disabled","for","headers","height","hidden","high","href","hreflang","id","ismap","itemprop","lang","list","loop","low","max","maxlength","media","min","multiple","name","open","optimum","pattern","ping","placeholder","poster","preload","pubdate","readonly","rel","required","reversed","rows","rowspan","spellcheck","scope","selected","shape","size","span","src","srclang","start","step","summary","tabindex","target","title","type","usemap","value","width","wrap"];var s,o=/<[^\s><\/]+/g,u=/<\/[^\s><\/]+/g,a=/^\s*([^\s="'>]+)(=("([^"\\]*(\\.[^"\\]*)*)"|\'([^\'\\]*(\\.[^\'\\]*)*)\'|[^\s>]*))?/;while(s=o.exec(t))if(n.indexOf(s[0].substr(1))==-1)t=t.substr(0,s.index)+"<"+t.substr(s.index+1);else{var f=t.substr(0,s.index)+s[0],l=t.substr(s.index+s[0].length),c;while(c=a.exec(l)){var h;if(r.indexOf(c[1])!=-1){var h=c[6]!==undefined?c[6]:c[4]!==undefined?c[4]:c[3]!==undefined?c[3]:undefined;h!==undefined?f+=" "+c[1]+'="'+(i.indexOf(c[1])!=-1?e.url(h):e.attr(h))+'"':f+=" "+c[1]}l=l.substr(c.index+c[0].length)}var p=l.match(/\s*\/?>/);if(!p)return f+">";p[1]?f+=" />":f+=">",o.lastIndex=f.length,t=f+l.substr(p[0].length)}while(s=u.exec(t))n.indexOf(s[0].substr(2))==-1&&(t=t.substr(0,s.index)+"<"+t.substr(s.index+1));return t},e.uriComponent=function(e){return encodeURIComponent(e)},e.url=function(e){return e.substr(0,11)=="javascript:"?"javascript:void(0)":encodeURI(e)},e}),function(e,t){typeof define=="function"&&define.amd?define("zest/component",["zoe","is!browser?./zest-render"],t):e.$z.Component=t($z,$z)}(this,function(e,t){return{_implement:[e.Constructor,e.InstanceEvents],_extend:{options:"DAPPEND",className:function(e,t){return e&&t?e+" "+t:e||t||""},pipe:e.extend.makeChain(function(t,n,r){var i={},s=[];for(var o=0,u=r.length;o<u;o++){var a=r[o];if(typeof a=="function")e.extend(i,a.apply(t,n),{"*":"REPLACE",global:"APPEND"});else if(a instanceof Array)for(var f=0;f<a.length;f++)i[a[f]]=n[0][a[f]];else if(a===!0)return n[0]}return i}),load:e.extend.makeChain("ASYNC"),attach:e.extend.REPLACE},_integrate:function(e){if(e.construct||e.prototype){var n=this;this.attach=this.attach||function(e,r,i){return i?(e.getAttribute("component")||e.setAttribute("component",""),e.id=e.id||t._nextComponentId++,t._components[e.id]=new n(e,r)):new n(e,r)}}},_built:function(){this.render||(this.pipe=this.pipe||!0)},construct:function(e,t,n){this.el=e,this.o=t},prototype:{$:t&&t.$,$z:t&&t.select}}}),define("require-css/normalize",["require","module"],function(e,t){function s(e,t,n){return e=r(e),e.match(/^\/|([^\:\/]*:)/)?e:u(o(e,t),n)}function o(e,t){e.substr(0,2)=="./"&&(e=e.substr(2));var n=t.split("/"),r=e.split("/");n.pop();while(curPart=r.shift())curPart==".."?n.pop():n.push(curPart);return n.join("/")}function u(e,t){var n=t.split("/");n.pop(),t=n.join("/")+"/",i=0;while(t.substr(i,1)==e.substr(i,1))i++;while(t.substr(i,1)!="/")i--;t=t.substr(i+1),e=e.substr(i+1),n=t.split("/");var r=e.split("/");out="";while(n.shift())out+="../";while(curPart=r.shift())out+=curPart+"/";return out.substr(0,out.length-1)}var n=/([^:])\/+/g,r=function(e){return e.replace(n,"$1/")},a=function(e,t,n){t=r(t),n=r(n);var i=/@import\s*("([^"]*)"|'([^']*)')|url\s*\(\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/ig,o,u,e;while(o=i.exec(e)){u=o[3]||o[2]||o[5]||o[6]||o[4];var a=s(u,t,n),f=o[5]||o[6]?1:0;e=e.substr(0,i.lastIndex-u.length-f-1)+a+e.substr(i.lastIndex-f-1),i.lastIndex=i.lastIndex+(a.length-u.length)}return e};return a.convertURIBase=s,a}),define("require-css/css",["./normalize","module"],function(e,t){if(typeof window=="undefined")return{load:function(e,t,n){n()}};var n=document.getElementsByTagName("head")[0],r=window.navigator.userAgent.match(/Chrome\/([^ \.]*)|MSIE ([^ ;]*)|Firefox\/([^ ;]*)|Version\/([\d\.]*) Safari\//),i,s;window.opera&&(s="opera",i=!0),r&&(r[4]&&(s="webkit"),r[3]?s="mozilla":r[2]?s="ie":r[1]&&(s="webkit"),i=s&&(parseInt(r[4])>5||parseInt(r[3])>8||parseInt(r[2])>9||parseInt(r[1])>18)||undefined);var o=t.config();o&&o.useLinks!==undefined&&(i=o.useLinks);var u=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],a={},f=function(e,t,n){if(a[e]){t(a[e]);return}var r,i,s;if(typeof XMLHttpRequest!="undefined")r=new XMLHttpRequest;else if(typeof ActiveXObject!="undefined")for(i=0;i<3;i+=1){s=u[i];try{r=new ActiveXObject(s)}catch(o){}if(r){u=[s];break}}r.open("GET",e,requirejs.inlineRequire?!1:!0),r.onreadystatechange=function(i){var s,o;r.readyState===4&&(s=r.status,s>399&&s<600?(o=new Error(e+" HTTP status: "+s),o.xhr=r,n(o)):(a[e]=r.responseText,t(r.responseText)))},r.send(null)},l={};l.pluginBuilder="./css-builder";var c=document.createElement("style");c.type="text/css",n.appendChild(c),c.styleSheet?l.inject=function(e){c.styleSheet.cssText+=e}:l.inject=function(e){c.appendChild(document.createTextNode(e))};var h=function(e,t){setTimeout(function(){for(var n=0;n<document.styleSheets.length;n++){var r=document.styleSheets[n];if(r.href==e.href)return t()}h(e,t)},10)},p=function(e,t){setTimeout(function(){try{return e.sheet.cssRules,t()}catch(n){}p(e,t)},10)},d=function(e){var t=document.createElement("link");return t.type="text/css",t.rel="stylesheet",t.href=e,t},v=function(){},m=s=="webkit"&&(parseInt(r[4])<5||parseInt(r[1])<18),g=s=="mozilla"&&parseInt(r[3])<18;l.linkLoad=function(e,t){var r=setTimeout(t,E*1e3),i=function(){clearTimeout(r),s&&(s.onload=v),setTimeout(t,7)};if(m){var s=d(e);h(s,i),n.appendChild(s)}else if(g){var o=document.createElement("style");o.textContent='@import "'+e+'"',p(o,i),n.appendChild(o)}else{var s=d(e);s.onload=i,n.appendChild(s)}},l.inspect=function(){if(c.styleSheet)return c.styleSheet.cssText;if(c.innerHTML)return c.innerHTML},l.normalize=function(e,t){return e.substr(e.length-4,4)==".css"&&(e=e.substr(0,e.length-4)),t(e)};var y=/@import\s*(url)?\s*(('([^']*)'|"([^"]*)")|\(('([^']*)'|"([^"]*)"|([^\)]*))\))\s*;?/g,b=window.location.pathname.split("/");b.pop(),b=b.join("/")+"/";var w=function(t,n,r){t.substr(0,1)!="/"&&(t="/"+e.convertURIBase(t,b,"/")),f(t,function(i){i=e(i,t,b);var s=[],o=[],u=[],a;while(a=y.exec(i)){var f=a[4]||a[5]||a[7]||a[8]||a[9];f.indexOf(".")==-1&&(f+=".less"),s.push(f),o.push(y.lastIndex-a[0].length),u.push(a[0].length)}var l=0;for(var c=0;c<s.length;c++)(function(e){w(s[e],function(t){i=i.substr(0,o[e])+t+i.substr(o[e]+u[e]);var r=t.length-u[e];for(var a=e+1;a<s.length;a++)o[a]+=r;l++,l==s.length&&n(i)},r)})(c);s.length==0&&n(i)},r)},E;return l.load=function(e,t,n,r,s){E=E||r.waitSeconds||7;var o=e;o.substr(o.length-4,4)!=".css"&&!s&&(o+=".css"),o=t.toUrl(o);var u=!0;if(o.indexOf("://")!=-1){var a=window.location.href.split("/").splice(0,3).join("/");o.substr(0,a.length)!=a&&(u=!1)}!s&&i!==!1&&(!u||i)?l.linkLoad(o,function(){n(l)}):w(o,function(e){s&&(e=s(e)),l.inject(e),n(l)},n.error)},l}),define("json/json-detect",[],function(){return typeof JSON!="undefined"&&JSON.parse&&JSON.stringify&&!0}),define("json/json",["is!~./json-detect?[json2]"],function(e){return e||JSON}),define("zest/zest",["zoe","is!browser?./zest-render","./escape","./component","css","json/json"],function(e,t,n,r){return t=t||{},t.Component=r,t.esc=n,t.fn||e.extend(t,e),t}),define("zest",["zest/zest"],function(e){return e});