Permalink
Fetching contributors…
Cannot retrieve contributors at this time
1 lines (1 sloc) 19.8 KB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.jtmpl=e()}}(function(){var define,module,exports;return function e(t,n,r){function o(a,l){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!l&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t){"use strict";function n(e,t,r,o){function i(e,t){if(!e)throw t||"assertion failed"}function a(e,t){for(var n=0,r=Object.getOwnPropertyNames(t),o=r.length;o>n;n++)e[r[n]]=t[r[n]]}function l(e,t){if("object"==typeof e&&null!==e&&"object"==typeof t&&null!==t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e.hasOwnProperty(n)){if(!t.hasOwnProperty(n))return!1;if(!l(e[n],t[n]))return!1}return!0}return e!==t?!1:!0}function u(){var e=arguments[0],t=["string","number"].indexOf(typeof arguments[1])>-1?arguments[1]:null,n="function"==typeof arguments[1]?arguments[1]:"function"==typeof arguments[2]?arguments[2]:null;i("change"===e||["insert","delete","update"].indexOf(e)>-1&&null===t),-1===b[e].indexOf(n)&&(b[e].push(n),N[e].push("change"===e&&null!==t?function(e){e===t&&n.call(E)}:n))}function c(){var e,t=arguments[0],n=("string"==typeof arguments[1]?arguments[1]:null,"function"==typeof arguments[1]?arguments[1]:"function"==typeof arguments[2]?arguments[2]:null);n?(e=b[t].indexOf(n),e>-1&&(b[t].splice(e,1),N[t].splice(e,1))):(b[t]=[],N[t]=[])}function p(e,t,n){var r,o=N[e]||[],i=o.length;for(r=0;i>r;r++)o[r].call(E,t,n)}function s(){function t(e){var n,r=Array.isArray(e)?[]:{};for(n in e)"object"==typeof e[n]?r[n]=t(e[n]):"function"!=typeof e[n]&&"_"!==n[0]&&(r[n]=e[n]);return r}return JSON.stringify(t(e))}function d(t){var n;"string"==typeof t&&(t=JSON.parse(t));for(n in t)E(n,t[n]),p("update",n);E.len=e.length}function f(e){l(C[e],h(e,function(){},!0))||p("change",e);for(var t=0,n=O[e]||[],r=n.length;r>t;t++)delete T[n[t]],x[e][t].trigger("update",n[t]);E.parent&&E.parent.trigger("update",E.prop)}function m(e){function n(t){return function(n,r){return t._dependentProps[n]||(t._dependentProps[n]=[],t._dependentContexts[n]=[]),-1===t._dependentProps[n].indexOf(e)&&(t._dependentProps[n].push(e),t._dependentContexts[n].push(E)),t(n,r,!0)}}var o=n(E);return j(o),r&&(o.parent=n(r)),o.root=n(t||E),o}function g(e){var t,n;if(e&&"object"==typeof e){n={};for(t in e)n[t]=e[t]}else n=e;return n}function h(t,n,r){var o=e[t];return"function"==typeof o?(o=o.call(m(t),n),r||(C[t]=void 0===o?o:g(o))):r||(C[t]=o),o}function v(e,r,o){var i=h(e,r,o);return i&&"object"==typeof i?T[e]?T[e]:T[e]=n(i,t||E,E,e):i}function y(t,n){var r=h(t);"function"==typeof e[t]?e[t].call(m(t),n):(e[t]=n,n&&"object"==typeof n&&(delete C[t],delete T[t])),r!==n&&p("update",t)}function _(e,t,n){return(void 0===t||"function"==typeof t?v:y)(e,t,n)}function j(n){function i(t,r){return function(){var o=[][t].apply(e,arguments);return this.len=this.values.length,C={},T={},r.apply(this,arguments),n.parent.trigger("update",n.prop),o}}function l(t){return function(){var r=arguments[0];return[][t].apply(e,r?[function(e,t){return r.apply(n(t),arguments)}].concat([].slice.call(arguments,1)):arguments)}}a(n,{values:e,parent:r||null,root:t||n,prop:void 0===o?null:o,on:u,off:c,trigger:p,toJSON:s,fromJSON:d,_dependentProps:O,_dependentContexts:x}),Array.isArray(e)&&(a(n,{len:e.length,pop:i("pop",function(){p("delete",this.len,1)}),push:i("push",function(){p("insert",this.len-1,1)}),reverse:i("reverse",function(){p("delete",0,this.len),p("insert",0,this.len)}),shift:i("shift",function(){p("delete",0,1)}),unshift:i("unshift",function(){p("insert",0,1)}),sort:i("sort",function(){p("delete",0,this.len),p("insert",0,this.len)}),splice:i("splice",function(){arguments[1]&&p("delete",arguments[0],arguments[1]),arguments.length>2&&p("insert",arguments[0],arguments.length-2)})}),["forEach","every","some","filter","find","findIndex","keys","map","reduce","reduceRight"].forEach(function(e){n[e]=l(e)}))}var N={change:[],update:[],insert:[],"delete":[]},b={change:[],update:[],insert:[],"delete":[]},O={},x={},C={},T={};u("update",f);var E=function(){return _.apply(null,arguments)};return j(E),E}"object"==typeof t&&(t.exports=n)},{}],2:[function(e,t){var n=/^\{\{([\w\.\-]+)\}\}$/;t.exports=[{id:"var",match:function(e,t){return"value"===t&&e.getAttribute(t).match(n)},prop:function(e){return e[1]},rule:function(e,t,n,r){function o(){var o=jtmpl._get(n,r);e[t]!==o&&(e[t]=o||"")}var i=["text","password"].indexOf(e.type)>-1?"keyup":"change";e.addEventListener(i,function(){n(r,e[t])}),n.on("change",r,o),o()}},{id:"selected_var",match:function(e,t){return"jtmpl-selected"===t&&e.getAttribute(t).match(n)},prop:function(e){return e[1]},rule:function(e,t,n,r,o){function i(){if("OPTION"===e.nodeName){var t=o.selects.indexOf(e.parentNode);if(o.selectsUpdating[t])return;for(var i=0,a=o.selectOptions[t].length;a>i;i++)o.selectOptions[t][i].selected=o.selectOptionsContexts[t][i](r)}else e.selected=n(r)}"OPTION"===e.nodeName?setTimeout(function(){var t=o.selects.indexOf(e.parentNode);-1===t&&(t=o.selects.push(e.parentNode)-1,o.selectOptions.push([]),o.selectOptionsContexts.push([]),e.parentNode.addEventListener("change",function(){o.selectsUpdating[t]=!0;for(var e=0,n=o.selectOptions[t].length;n>e;e++)o.selectOptionsContexts[t][e](r,o.selectOptions[t][e].selected);o.selectsUpdating[t]=!1})),o.selectOptions[t].push(e),o.selectOptionsContexts[t].push(n)},0):e.addEventListener("change",function(){n(r,this.selected)}),n.on("change",r,i),setTimeout(i)}},{id:"checked_var",match:function(e,t){return"jtmpl-checked"===t&&e.getAttribute(t).match(n)},prop:function(e){return e[1]},rule:function(e,t,n,r,o){function i(){if(e.name){if(o.radioGroupsUpdating[e.name])return;for(var t=0,i=o.radioGroups[e.name][0].length;i>t;t++)o.radioGroups[e.name][0][t].checked=o.radioGroups[e.name][1][t](r)}else e.checked=n(r)}function a(){"radio"===e.type&&e.name&&(o.radioGroups[e.name]||(o.radioGroups[e.name]=[[],[]]),o.radioGroups[e.name][0].push(e),o.radioGroups[e.name][1].push(n)),e.addEventListener("click",function(){if("radio"===e.type&&e.name){o.radioGroupsUpdating[e.name]=!0;for(var t=0,i=o.radioGroups[e.name][0].length;i>t;t++)o.radioGroups[e.name][1][t](r,o.radioGroups[e.name][0][t].checked);o.radioGroupsUpdating[e.name]=!1}else n(r,e.checked)}),n.on("change",r,i),setTimeout(i)}setTimeout(a)}},{id:"attribute_var",match:function(e,t){return e.getAttribute(t).match(n)},prop:function(e){return e[1]},rule:function(e,t,n,r){function o(){var o=jtmpl._get(n,r);return o?e.setAttribute(t,o):e.removeAttribute(t)}n.on("change",r,o),o()}},{id:"utemplate",match:function(e,t){return{template:e.getAttribute(t)}},prop:function(e){return e.template},rule:function(e,t,n,r){function o(){e.setAttribute(i,jtmpl.utemplate(r,n,o))}var i=t.replace("jtmpl-","");o()}}]},{}],3:[function(e,t){var n=/^\s*/.source,r=/\s*$/.source,o=/([\w\.\-]+)/.source,i=/([\w\.\-]+)\s*(?:\|(.*))?/.source;t.exports=[{id:"var",match:function(e){return e.innerHTML.match(RegExp(n+i+r))},prop:function(e){return e},rule:function(e,t,n){var r=document.createTextNode(jtmpl._get(t,n[1],n[2])||"");e.appendChild(r),t.on("change",n[1],function(){r.data=jtmpl._get(t,n[1],n[2])||""})}},{id:"not_var",match:function(e){return e.innerHTML.match(RegExp(n+"&"+o+r))},prop:function(e){return e},rule:function(e,t,n){function r(){for(var e,r=document.createDocumentFragment(),a=document.createElement("body");i;)o.parentNode.removeChild(o.previousSibling),i--;for(a.innerHTML=jtmpl._get(t,n[1],n[2])||"",i=a.childNodes.length,e=0;i>e;e++)r.appendChild(a.childNodes[0]);o.parentNode.insertBefore(r,o)}var o=document.createComment(""),i=0;e.appendChild(o),t.on("change",n[1],r),r()}},{id:"partial",match:function(e){return e.innerHTML.match(/>([\w\.\-]+)|'([^\']*)\'|"([^"]*)"/)},prop:function(e){return e},rule:function(e,t,n){function r(){o||(o=i.parentNode),jtmpl.loader(o,n[1]?t(n[1]):n[2]||n[3],t)}var o,i=document.createComment("");n[1]&&t.on("change",n[1],r),e.appendChild(i),setTimeout(r)}},{id:"section",match:function(e){return e.innerHTML.match(RegExp(n+"#"+i+r))},block:function(e){return e},rule:function(e,t,n,r){function o(e){return function(){for(var o=c.parentNode,i=[].indexOf.call(o.childNodes,c),a=i-p+e*u,l=u,s=jtmpl.applyPipe("."===n[1]?t:t(n[1]),n[2],t);l--;)o.removeChild(o.childNodes[a]);o.insertBefore(r(s(e)),o.childNodes[a])}}function i(e,o){var i,a,l,s=c.parentNode,d="."===n[1]?t:t(n[1]);for(i=0,a=document.createDocumentFragment();o>i;i++)l=r(d(e+i)),u=l.childNodes.length,a.appendChild(l);var f=[].indexOf.call(s.childNodes,c),m=f-p+e*u,g=o*u;s.insertBefore(a,s.childNodes[m]),p+=g}function a(e,t){var n=c.parentNode,r=[].indexOf.call(n.childNodes,c),o=r-p+e*u,i=t*u;for(p-=i;i--;)n.removeChild(n.childNodes[o])}function l(){for(var e,l,s,d=jtmpl.applyPipe("."===n[1]?t:t(n[1]),n[2]||"",t);p;)c.parentNode.removeChild(c.previousSibling),p--;if("function"==typeof d&&void 0!==d.len){d.on("insert",i),d.on("delete",a),s=document.createDocumentFragment();var f,m;for(e=0,l=d.values.length;l>e;e++)m=d(e),f=r(m),f.__jtmpl__=m,s.appendChild(f);d.on("change",o),p=s.childNodes.length,u=~~(p/l),c.parentNode.insertBefore(s,c)}else"function"==typeof d&&void 0===d.len?(s=r(d),p=s.childNodes.length,u=p,c.parentNode.insertBefore(s,c),c.parentNode.__jtmpl__=t):d&&(s=r(t),p=s.childNodes.length,u=p,c.parentNode.insertBefore(s,c))}var u,c=document.createComment(""),p=0;e.appendChild(c),l(),t.on("change",n[1],l)}},{id:"inverted_section",match:function(e){return e.innerHTML.match(n+"\\^"+i+r)},block:function(e){return e},rule:function(e,t,n,r){function o(){for(var e,l,u="."===n[1]?t:t(n[1]);a;)i.parentNode.removeChild(i.previousSibling),a--;"function"==typeof u&&void 0!==u.len?(u.on("insert",o),u.on("delete",o),l=document.createDocumentFragment(),0===u.len&&l.appendChild(r(u(e))),a=l.childNodes.length,i.parentNode.insertBefore(l,i)):u||(l=r(t),a=l.childNodes.length,i.parentNode.insertBefore(l,i))}var i=document.createComment(""),a=0;e.appendChild(i),o(),t.on("change",n[1],o)}},{id:"emit_verbatim",match:function(e){return e.innerHTML},prop:function(e){return e},rule:function(e,t,n){e.appendChild(document.createTextNode(n))}}]},{}],4:[function(e,t){function n(t,o,i){function a(e,t){t=t||0;for(var n=0,r="";(i||0)+t>n;n++)r+=" ";return e.map(function(e){return r+e}).join("\n")+"\n"}var l,u,c,p,s;i=(i||0)+1;var d=a(["(function(model) {"],-1);d+=a(["var frag = document.createDocumentFragment(), node;"]),1===i&&(d+=a(["var globals = {"," radioGroups: {},"," radioGroupsUpdating: {},"," selects: [],"," selectsUpdating: [],"," selectOptions: [],"," selectOptionsContexts: []","};"])),d+=a(["model = jtmpl.normalizeModel(model);"]);for(var f,m=0,g=t.childNodes,h=g.length;h>m;m++)switch(f=g[m],f.nodeType){case 1:if("SCRIPT"===f.nodeName&&"text/jtmpl-tag"===f.type){for(l=0,u=e("./compile-rules-node"),c=u.length;c>l;l++)if(p=u[l].match(f)){if(u[l].block){for(s=document.createDocumentFragment(),m++,f=g[m];h>m&&!r(u[l].block(p[1]),f.innerHTML||"");m++,f=g[m])s.appendChild(f.cloneNode(!0));if(m===h)throw"jtmpl: Unclosed "+u[l].block(p[1]);d+=a(["jtmpl.rules.node."+u[l].id+"("," frag,"," model,"," "+JSON.stringify(u[l].block(p))+","]),d+=n(s,"",i+1)+", ",d+=a([" globals",");"])}else d+=a(["jtmpl.rules.node."+u[l].id+"(frag, model, "+JSON.stringify(u[l].prop(p))+");"]);break}}else{d+=a(['node = document.createElement("'+f.nodeName+'");',"node.__jtmpl__ = model;"]);for(var v=0,y=f.attributes,_=y.length;_>v;v++)for(l=0,u=e("./compile-rules-attr"),c=u.length;c>l;l++)if(p=u[l].match(f,y[v].name.toLowerCase())){d+=a(["jtmpl.rules.attr."+u[l].id+"(node, "+JSON.stringify(y[v].name)+", model, "+JSON.stringify(u[l].prop(p))+", globals);"]);break}"INPUT"!==f.nodeName&&(d+=a(["node.appendChild("]),d+=n(f,"",i+1),d+=a([" (model)",");"])),d+=a(["frag.appendChild(node);"])}break;case 3:d+=a(["frag.appendChild(document.createTextNode("+JSON.stringify(f.data)+"));"]);break;case 8:d+=a(["frag.appendChild(document.createComment("+JSON.stringify(f.data)+"));"])}return d+=a([" return frag;","})"],-1),d+=o?"\n//@ sourceURL="+o+"\n//# sourceURL="+o+"\n":""}function r(e,t){var n=t.match(/^\/([\w\.\-]+)?$/);return n?""===e||!n[1]||n[1]===e:!1}t.exports=n},{"./compile-rules-attr":2,"./compile-rules-node":3}],5:[function(_dereq_,module,exports){function jtmpl(){var args=[].slice.call(arguments),target,t,template,model;return["GET","POST"].indexOf(args[0])>-1?_dereq_("./xhr").apply(null,args):1===args.length&&"object"==typeof args[0]?_dereq_("freak")(args[0]):1===args.length&&"string"==typeof args[0]?document.querySelector(args[0]).__jtmpl__:void((args[0]&&args[0].nodeType||"string"==typeof args[0])&&(args[1]&&"function"==typeof args[1].appendChild||"string"==typeof args[1])&&void 0!==args[2]&&(target=args[0]&&args[0].nodeType?args[0]:document.querySelector(args[0]),template=args[1].match(jtmpl.RE_NODE_ID)?document.querySelector(args[1]).innerHTML:args[1],model="function"==typeof args[2]?args[2]:jtmpl("object"==typeof args[2]?args[2]:"string"==typeof args[2]&&args[2].match(jtmpl.RE_NODE_ID)?_dereq_("./loader")(document.querySelector(args[2]).innerHTML):{".":args[2]}),"SCRIPT"===target.nodeName&&(t=document.createElement("div"),t.id=target.id,target.parentNode.replaceChild(t,target),target=t),target.__jtmpl__=model,target.innerHTML="",target.appendChild(eval(jtmpl.compile(jtmpl.parse(template),target.getAttribute("data-jtmpl"))+"(model)"))))}window.addEventListener("DOMContentLoaded",function(){for(var e=_dereq_("./loader"),t=document.querySelectorAll("[data-jtmpl]"),n=0,r=t.length;r>n;n++)e(t[n],t[n].getAttribute("data-jtmpl"))}),jtmpl.RE_NODE_ID=/^#[\w\.\-]+$/,jtmpl.RE_ENDS_WITH_NODE_ID=/.+(#[\w\.\-]+)$/,jtmpl.parse=_dereq_("./parse"),jtmpl.compile=_dereq_("./compile"),jtmpl.loader=_dereq_("./loader"),jtmpl.utemplate=_dereq_("./utemplate"),jtmpl._get=function(e,t,n){var r=e(t);return"function"==typeof r?JSON.stringify(r.values):jtmpl.applyPipe(r,n,e)},jtmpl.applyPipe=function(e,t,n){if(!t)return e;t=t.split("|");for(var r=0,o=t.length;o>r;r++)e=n.root.values.__filters__[t[r].trim()](e);return e},jtmpl.rules=_dereq_("./prepare-runtime")(),jtmpl.normalizeModel=function(e){return"function"==typeof e?e:jtmpl("object"==typeof e?e:{".":e})},_dereq_("./polyfills/matches"),jtmpl.plugins=_dereq_("./plugins"),module.exports=jtmpl,"undefined"!=typeof window&&(window.jtmpl=jtmpl),"function"==typeof define&&define("jtmpl",[],jtmpl)},{"./compile":4,"./loader":6,"./parse":7,"./plugins":8,"./polyfills/matches":12,"./prepare-runtime":13,"./utemplate":14,"./xhr":15,freak:1}],6:[function(_dereq_,module,exports){module.exports=function(target,src,model){function mixin(e,t){for(var n in t)0===n.indexOf("__")&&n.lastIndexOf("__")===n.length-2||"function"==typeof t[n]?void 0===e.values[n]&&(e.values[n]=t[n]):void 0===e(n)&&e(n,t[n])}function applyPlugins(){var e,t;for(e in jtmpl.plugins)plugin=jtmpl.plugins[e],t=model.values["__"+e+"__"],"function"==typeof plugin&&void 0!==t&&plugin.call(model,t,target)}function evalObject(body,src){var result,module={exports:{}};return src=src?"\n//@ sourceURL="+src+"\n//# sourceURL="+src:"",body.match(/^\s*{[\S\s]*}\s*$/)?eval("result="+body+src):(eval(body+src),module.exports)}function loadModel(e,t,n){var r;if(e)if(e.match(jtmpl.RE_NODE_ID)){var o=n.querySelector(e);mixin(model,evalObject(o.innerHTML,e)),applyPlugins(),jtmpl(target,t,model)}else r=e.indexOf("#"),jtmpl("GET",r>-1?e.substring(0,r):e,function(n){var r=e.match(jtmpl.RE_ENDS_WITH_NODE_ID),o=r&&(new DOMParser).parseFromString(n,"text/html").querySelector(r[1]);mixin(model,evalObject(r?o.innerHTML:n,e)),applyPlugins(),jtmpl(target,t,model)});else jtmpl(target,t,model)}function loadTemplate(){var e;if(src)if(src.match(jtmpl.RE_NODE_ID)){var t=document.querySelector(src);loadModel(t.getAttribute("data-model"),t.innerHTML,document)}else e=src.indexOf("#"),jtmpl("GET",e>-1?src.substring(0,e):src,function(e){var t,n,r=src.match(jtmpl.RE_ENDS_WITH_NODE_ID);r?(t=document.createElement("iframe"),t.style.display="none",document.body.appendChild(t),n=t.contentDocument,n.writeln(e),document.body.removeChild(t)):n=document;var o=r&&n.querySelector(r[1]);loadModel(r?o.getAttribute("data-model"):"",r?o.innerHTML:e,n)})}model=model||{},"function"!=typeof model&&(model=jtmpl(model)),loadTemplate()}},{}],7:[function(e,t){function n(e){function t(e){return e=e.replace(/\{\{\{([\S\s]*?)\}\}\}/g,"{{&$1}}"),e=e.replace(/\{\{([\S\s]*?)\}\}/g,function(t,n,r){var o=e.slice(0,r),i=!!o.match(/<[\w\-]+[^>]*?$/),a=o.match(/<(script|SCRIPT)/g),l=o.match(/<\/(script|SCRIPT)/g),u=(a&&a.length||0)>(l&&l.length||0),c=!!o.match(/<!--\s*$/),p=0===n.indexOf("!");return i||c?p?"":t:u?t:'<script type="text/jtmpl-tag">'+n.trim()+"</script>"}),e=e.replace(/(<(?:option|OPTION)[^>]*?)(?:selected|SELECTED)=/g,"$1jtmpl-selected="),e=e.replace(/(<(?:input|INPUT)[^>]*?)(?:checked|CHECKED)=/g,"$1jtmpl-checked=")}var n,r;return e=t(e),n=document.createElement("iframe"),n.style.display="none",document.body.appendChild(n),n.contentDocument.writeln("<!doctype html>\n<html><body>"+e+"</body></html>"),r=n.contentDocument.body,document.body.removeChild(n),r}t.exports=n},{}],8:[function(e,t){t.exports={init:e("./plugins/init"),on:e("./plugins/on"),routes:e("./plugins/routes")}},{"./plugins/init":9,"./plugins/on":10,"./plugins/routes":11}],9:[function(e,t){t.exports=function(e){if("function"==typeof e){var t=this;setTimeout(function(){e.call(t)})}}},{}],10:[function(e,t){t.exports=function(e,t){function n(n){t.addEventListener(n,function(t){for(var r in e[n])if(t.target.matches(r)){for(var o=t.target;!o.__jtmpl__&&o.parentNode;)o=o.parentNode;e[n][r].call(o.__jtmpl__,t)}})}for(var r in e)n(r)}},{}],11:[function(e,t){t.exports=function(){}},{}],12:[function(){"undefined"!=typeof Element&&function(e){e.matches=e.matches||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=this,n=(t.parentNode||t.document).querySelectorAll(e),r=-1;n[++r]&&n[r]!=t;);return!!n[r]}}(Element.prototype)},{}],13:[function(e,t){t.exports=function(){var t={node:{},attr:{}};return e("./compile-rules-node").forEach(function(e){t.node[e.id]=e.rule}),e("./compile-rules-attr").forEach(function(e){t.attr[e.id]=e.rule}),t}},{"./compile-rules-attr":2,"./compile-rules-node":3}],14:[function(e,t){function n(e,t,r){return e.replace(/\{\{#([\w\.\-]+)\}\}(.+?)\{\{\/([\w\.\-]*?)\}\}/g,function(e,o,i,a){if(""!==a&&a!==o)throw"jtmpl: Unclosed "+o;"function"==typeof r&&t.on("change",o,r);var l="."===o?t:t(o);return"function"==typeof l&&void 0!==l.len?l.len>0?l.values.map(function(e,t){return n(i.replace(/\{\{\.\}\}/g,"{{"+t+"}}"),l,r)}).join(""):"":"function"==typeof l&&void 0===l.len?n(i,l,r):l?n(i,t,r):""}).replace(/\{\{\^([\w\.\-]+)\}\}(.+?)\{\{\/([\w\.\-]*?)\}\}/g,function(e,o,i,a){if(""!==a&&a!==o)throw"jtmpl: Unclosed "+o;"function"==typeof r&&t.on("change",o,r);var l="."===o?t:t(o);return"function"==typeof l&&void 0!==l.len?0===l.len?n(i,t,r):"":l?"":n(i,t,r)}).replace(/\{\{([\w\.\-]+)\}\}/g,function(e,n){return"function"==typeof r&&t.on("change",n,r),void 0===t(n)?"":t(n)+""})}t.exports=n},{}],15:[function(e,t){t.exports=function(){var e,t,n,r,o,i=[].slice.call(arguments),a=new XMLHttpRequest,l=i.reduce(function(e,t){return"function"==typeof t?t:e},null),u=i[i.length-1];for("object"!=typeof u&&(u={}),e=0,r=Object.getOwnPropertyNames(u),t=r.length;t>e;e++)n=r[e],a[n]=u[n];o="string"==typeof i[2]?i[2]:"object"==typeof i[2]?Object.keys(i[2]).map(function(e){return e+"="+encodeURIComponent(i[2][e])}).join("&"):"";var c=function(e){var t;if(l){try{t=JSON.parse(this.responseText)}catch(n){t=this.responseText}l.call(this,t,e)}};return a.onreadystatechange=function(){4===a.readyState&&(a.status>=200&&a.status<300?c.call(this,"done"):console.log("jtmpl XHR error: "+this.responseText))},a.open(i[0],i[1],void 0!==u.async?u.async:!0,u.user,u.password),a.send(o),a}},{}]},{},[5])(5)});