@kosatyi/ejs 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ejs.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).ejs=n()}(this,(function(){"use strict";var t={},n={export:"ejs.precompiled",cache:!0,path:"views",resolver:null,extension:"ejs",withObject:!0,vars:{SCOPE:"ejs",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},e=function(){var t=[].slice.call(arguments),n=t.shift();return t.filter(n).pop()},r=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},i=function(t){return"boolean"==typeof t},c="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),u=function(){return c},a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},s=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},h=s(f),l=s(a),p=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(""+t).replace(h,(function(t){return f[t]}))},d=function(t,n,e){return null==(e=t)?"":n?p(e):e},v=function(t,n){var e=t,r=n.split("."),o=r.pop();return r.forEach((function(t){e=e[t]=e[t]||{}})),[e,o]},m=function(t,n){var e=t.split(".").pop();return e!==n&&(t=[t,n].join(".")),t},g=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];var r=n.shift();return n.filter((function(t){return t})).reduce((function(t,n){return Object.assign(t,n)}),r)},b=function(){},y=function(t,n){var e;for(e in t)j(t,e)&&n(t[e],e,t)},w=function(t,n){return function(t,n,e){var r=t instanceof Array,o=r?[]:{};return y(t,(function(t,e,i){var c=n(t,e,i);void 0!==c&&(r?o.push(c):o[e]=c)})),o}(t,(function(t,e){if(-1===n.indexOf(e))return t}))},x=function(t,n,e){return Promise.resolve(t).then(n.bind(e))},j=function(t,n){return t&&t.hasOwnProperty(n)},E=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],F=" ",O='"',B="/",R="<",k=">";function $(t,n,e){var r=[],o=-1===E.indexOf(t),i=function(t,n,e){var r=[];return y(t,(function(t,e,o){var i=n(t,e,o);void 0!==i&&r.push(i)})),r}(n,(function(t,n){if(null!=t)return[p(n),[O,p(t),O].join("")].join("=")})).join(F);return r.push([R,t,F,i,k].join("")),e&&r.push(e instanceof Array?e.join(""):e),o&&r.push([R,B,t,k].join("")),r.join("")}var S=[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}],U=function(t,n){var e=n.withObject,r=n.token,o=n.vars,i=[],c=[],u={match:"[ \\t]*",start:[r.start,"_"],end:["_",r.end]};S.forEach((function(t){i.push(r.start.concat(t.symbol).concat(r.regex).concat(r.end)),c.push(t.format.bind(o))}));var f=new RegExp(i.join("|").concat("|$"),"g"),s=new RegExp([u.match,u.start].join(""),"gm"),h=new RegExp([u.end,u.match].join(""),"gm");return function(t,n){var r=o.SCOPE,i=o.SAFE,p=o.BUFFER;t=(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")).replace(s,u.start).replace(h,u.end);var d="".concat(p,"('");!function(t,n,e){var r=0;n.replace(t,(function(){var t=[].slice.call(arguments,0,-1),n=t.pop(),o=t.shift();return e(t,r,n),r=n+o.length,o}))}(f,t,(function(n,e,r){d+=(""+t.slice(e,r)).replace(l,(function(t){return"\\"+a[t]})),n.forEach((function(t,n){t&&(d+=c[n](t))}))})),d="try{".concat(d+="');","}catch(e){console.info(e)}"),e&&(d="with(".concat(r,"){").concat(d,"}")),d="".concat(p,".start();").concat(d,"return ").concat(p,".end();"),d+="\n//# sourceURL=".concat(n);var v=null;try{(v=new Function(r,p,i,d)).source="(function(".concat(r,",").concat(p,",").concat(i,"){\n").concat(d,"\n})")}catch(t){throw t.filename=n,t.source=d,t}return v}},A=function(t){return fetch(t).then((function(t){return t.text()}))},T=function(n){return new Promise((function(e,r){t.readFile(n,(function(t,n){t?r(t):e(n.toString())}))}))},L=function(n,e){return t.watch(".",{cwd:n}).on("change",(function(t){e.remove(t)})).on("error",(function(t){console.log("watcher error: "+t)}))},M=function(t,n){var e=n.path,o=t.cache,i=t.compile,c=r(n.resolver)?n.resolver:u()?T:A,a=function(t){return c(function(t){return(t=[e,t].join("/")).replace(/\/\//g,"/")}(t))},f=function(t,n){return o.set(n,t),t};return n.watch&&u()&&L(e,o),function(t){if(o.exist(t))return o.resolve(t);var n=a(t).then((function(n){return f(i(n,t),t)}));return f(n,t)}},P=function(t){return Promise.all(t).then((function(t){return t.join("")}))},C=function(){var t=[],n=[];function e(t){n.push(t)}return e.start=function(){n=[]},e.backup=function(){t.push(n.concat()),n=[]},e.restore=function(){var e=n.concat();return n=t.pop(),P(e)},e.error=function(t){throw t},e.end=function(){return P(n)},e},q="undefined"!=typeof globalThis?globalThis:window||self;function _(c){var a={},f={safeValue:d,element:$,output:function(t,n){return f.template(t).then((function(t){return t.call(n,n,n.getBuffer(),d)}))},render:function(t,n){var e=m(t,a.extension),r=new f.scope(n);return f.output(e,r).then((function(t){if(r.getExtend()){r.setExtend(!1);var n=r.getLayout(),e=r.clone();return f.render(n,e)}return t}))},require:function(t){var n=m(t,a.extension),e=new f.scope({});return f.output(n,e).then((function(){return e.getMacro()}))},helpers:function(t){f.scope.helpers(t)},configure:function(t){return a.export=e(o,n.export,t.export),a.path=e(o,n.path,t.path),a.resolver=e(r,n.resolver,t.resolver),a.extension=e(o,n.extension,t.extension),a.withObject=e(i,n.withObject,t.withObject),a.token=g({},n.token,t.token),a.vars=g({},n.vars,t.vars),f.scope=function(t,n){var e=n.vars,i=e.EXTEND,c=e.LAYOUT,u=e.BLOCKS,a=e.BUFFER,f=e.MACRO;function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.initBlocks(),this.initMacro(),g(this,t)}return s.helpers=function(t){g(s.prototype,t)},s.property=function(t,n){Object.defineProperty(s.prototype,t,n)},s.method=function(t,n){Object.defineProperty(s.prototype,t,{value:n,writable:!1,configurable:!1,enumerable:!1})},s.property(a,{value:C(),writable:!1,configurable:!1,enumerable:!1}),s.property(u,{value:{},writable:!0,configurable:!1,enumerable:!1}),s.property(f,{value:{},writable:!0,configurable:!1,enumerable:!1}),s.property(c,{value:!1,writable:!0,configurable:!1,enumerable:!1}),s.property(i,{value:!1,writable:!0,configurable:!1,enumerable:!1}),s.method("initBlocks",(function(){this[u]={}})),s.method("initMacro",(function(){this[f]={}})),s.method("getMacro",(function(){return this[f]})),s.method("getBuffer",(function(){return this[a]})),s.method("getBlocks",(function(){return this[u]})),s.method("setExtend",(function(t){this[i]=t})),s.method("getExtend",(function(){return this[i]})),s.method("setLayout",(function(t){this[c]=t})),s.method("getLayout",(function(){return this[c]})),s.method("clone",(function(t){var n=[c,i,a];return!0===t&&n.push(u),w(this,n)})),s.method("extend",(function(t){this.setExtend(!0),this.setLayout(t)})),s.method("echo",(function(){var t=this.getBuffer();[].slice.call(arguments).forEach((function(n){t(n)}))})),s.method("fn",(function(t){var n=this.getBuffer(),e=this;return function(){return n.backup(),r(t)&&t.apply(e,arguments),n.restore()}})),s.method("get",(function(t,n){var e=v(this,t),r=e.shift(),o=e.pop();return j(r,o)?r[o]:n})),s.method("set",(function(t,n){var e=v(this,t),r=e.shift(),o=e.pop();return this.getExtend()&&j(r,o)?r[o]:r[o]=n})),s.method("macro",(function(t,n){var e=this.getMacro(),r=this.fn(n),o=this;e[t]=function(){return o.echo(r.apply(void 0,arguments))}})),s.method("call",(function(t){var n=this.getMacro()[t],e=[].slice.call(arguments,1);if(r(n))return n.apply(n,e)})),s.method("block",(function(t,n){var e=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(n)),!this.getExtend()){var o=Object.assign([],r[t]),i=function(){return o.shift()};this.echo(i()(function t(){var n=i();return n?function(){e.echo(n(t()))}:b}()))}})),s.method("include",(function(t,n,e){var r=!1===e?{}:this.clone(!0),o=g(r,n||{}),i=this.render(t,o);this.echo(i)})),s.method("use",(function(t,n){var e=this.require(t);this.echo(x(e,(function(t){var e=this.getMacro();y(t,(function(t,r){e[[n,r].join(".")]=t}))}),this))})),s.method("async",(function(t,n){this.echo(x(t,(function(t){return this.fn(n)(t)}),this))})),s.method("el",(function(t,n,e){r(e)&&(e=this.fn(e)()),this.echo(x(e,(function(e){return $(t,n,e)}),this))})),s.method("each",(function(t,n){o(t)&&(t=this.get(t,[])),y(t,n)})),s}(0,a),f.compile=U(0,a),f.wrapper=function(t){var n=t.export,e=!1===t.withObject;return function(t){var r="";return r+="(function(global,factory){",r+='typeof exports === "object" && typeof module !== "undefined" ?',r+="module.exports = factory():",r+='typeof define === "function" && define.amd ? define(factory):',r+='(global = typeof globalThis !== "undefined" ? globalThis:',r+='global || self,global["'+n+'"] = factory())',r+="})(this,(function(){",e&&(r+="'use strict';\n"),r+="var list = {};\n",t.forEach((function(t){r+="list["+JSON.stringify(t.name)+"]="+String(t.content)+";\n"})),r+="return list;}));\n"}}(f),f.cache=function(t){var n=t.export,e={};return{preload:function(){return!1===u()&&this.load(q[n]),this},exist:function(t){return j(e,t)},get:function(t){return e[t]},remove:function(t){delete e[t]},resolve:function(t){return Promise.resolve(this.get(t))},set:function(t,n){return e[t]=n,this},load:function(t){return g(e,t),this}}.preload()}(f),f.template=M(f,a),f},__express:function(c,u,a){r(u)&&(a=u,u={});var s=g({},(u=u||{}).settings),h=e(o,s.views,n.path),l=e(i,s["view cache"],n.cache),p=g({},s["view options"]),d=t.relative(h,c);return p.path=h,p.cache=l,f.configure(p),f.render(d,u).then((function(t){a(null,t)})).catch((function(t){a(t)}))}};return f.configure(c||{}),f.helpers({require:function(t){return f.require(t,this)},render:function(t,n){return f.render(t,n)}}),f}var N=_();return N.create=_,N}));
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";var n={},e={export:"ejs.precompiled",cache:!0,path:"views",resolver:null,extension:"ejs",withObject:!0,vars:{SCOPE:"ejs",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},r=function(){var t=[].slice.call(arguments),n=t.shift();return t.filter(n).pop()},i=function(t){return"function"==typeof t},o=function(t){return"string"==typeof t},c=function(t){return"boolean"==typeof t},u="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),s=function(){return u},a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},f={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},h=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},l=h(f),p=h(a),v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(""+t).replace(l,(function(t){return f[t]}))},d=function(t,n,e){return null==(e=t)?"":n?v(e):e},g=function(t,n){var e=t,r=n.split("."),i=r.pop();return r.forEach((function(t){e=e[t]=e[t]||{}})),[e,i]},m=function(t,n){var e=t.split(".").pop();return e!==n&&(t=[t,n].join(".")),t},y=function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];var r=n.shift();return n.filter((function(t){return t})).reduce((function(t,n){return Object.assign(t,n)}),r)},b=function(){},w=function(t,n){var e;for(e in t)E(t,e)&&n(t[e],e,t)},j=function(t,n){return function(t,n,e){var r=t instanceof Array,i=r?[]:{};return w(t,(function(t,e,o){var c=n(t,e,o);void 0!==c&&(r?i.push(c):i[e]=c)})),i}(t,(function(t,e){if(-1===n.indexOf(e))return t}))},x=function(t,n,e){return Promise.resolve(t).then(n.bind(e))},E=function(t,n){return t&&t.hasOwnProperty(n)},k=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],O=" ",F='"',P="/",S="<",B=">",R=function(t,n,e){var r=[],i=-1===k.indexOf(t),o=function(t,n,e){var r=[];return w(t,(function(t,e,i){var o=n(t,e,i);void 0!==o&&r.push(o)})),r}(n,(function(t,n){if(null!=t)return[v(n),[F,v(t),F].join("")].join("=")})).join(O);return r.push([S,t,O,o,B].join("")),e&&r.push(e instanceof Array?e.join(""):e),i&&r.push([S,P,t,B].join("")),r.join("")};function $(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function T(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,A(r.key),r)}}function U(t,n,e){return n&&T(t.prototype,n),e&&T(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function A(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==typeof n?n:String(n)}var M=[{symbol:"-",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(t){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(t,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(t){return"')\n/**".concat(t,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(t){return"')\n".concat(t.trim(),"\n").concat(this.BUFFER,"('")}}],_=function(){function t(n){$(this,t),this.configure(n)}return U(t,[{key:"configure",value:function(t){var n=this;this.withObject=t.withObject,this.token=t.token,this.vars=t.vars,this.matches=[],this.formats=[],this.slurp={match:"[ \\t]*",start:[this.token.start,"_"],end:["_",this.token.end]},M.forEach((function(t){n.matches.push(n.token.start.concat(t.symbol).concat(n.token.regex).concat(n.token.end)),n.formats.push(t.format.bind(n.vars))})),this.regex=new RegExp(this.matches.join("|").concat("|$"),"g"),this.slurpStart=new RegExp([this.slurp.match,this.slurp.start].join(""),"gm"),this.slurpEnd=new RegExp([this.slurp.end,this.slurp.match].join(""),"gm")}},{key:"compile",value:function(t,n){var e=this,r=this.vars,i=r.SCOPE,o=r.SAFE,c=r.BUFFER;t=(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")).replace(this.slurpStart,this.slurp.start).replace(this.slurpEnd,this.slurp.end);var u,s,f,h="".concat(c,"('");u=this.regex,s=function(n,r,i){h+=(""+t.slice(r,i)).replace(p,(function(t){return"\\"+a[t]})),n.forEach((function(t,n){t&&(h+=e.formats[n](t))}))},f=0,t.replace(u,(function(){var t=[].slice.call(arguments,0,-1),n=t.pop(),e=t.shift();return s(t,f,n),f=n+e.length,e})),h="try{".concat(h+="');","}catch(e){console.info(e)}"),this.withObject&&(h="with(".concat(i,"){").concat(h,"}")),h="".concat(c,".start();").concat(h,"return ").concat(c,".end();"),h+="\n//# sourceURL=".concat(n);var l=null;try{(l=new Function(i,c,o,h)).source="(function(".concat(i,",").concat(c,",").concat(o,"){\n").concat(h,"\n})")}catch(t){throw t.filename=n,t.source=h,t}return l}}]),t}(),L=function(){function t(n){$(this,t),this.configure(n)}return U(t,[{key:"configure",value:function(t){this.namespace=t.export,this.useStrict=!1===t.withObject}},{key:"wrapper",value:function(t){var n="";return n+="(function(global,factory){",n+='typeof exports === "object" && typeof module !== "undefined" ?',n+="module.exports = factory():",n+='typeof define === "function" && define.amd ? define(factory):',n+='(global = typeof globalThis !== "undefined" ? globalThis:',n+='global || self,global["'+this.namespace+'"] = factory())',n+="})(this,(function(){",this.useStrict&&(n+="'use strict';\n"),n+="var list = {};\n",t.forEach((function(t){n+="list["+JSON.stringify(t.name)+"]="+String(t.content)+";\n"})),n+="return list;}));\n"}}]),t}(),C=function(t){return fetch(t).then((function(t){return t.text()}))},N=function(t){return new Promise((function(e,r){n.readFile(t,(function(t,n){t?r(t):e(n.toString())}))}))},q=function(){function t(n,e,r){$(this,t),this.cache=e,this.compiler=r,this.configure(n)}return U(t,[{key:"configure",value:function(t){this.path=t.path,this.resolver=i(t.resolver)?t.resolver:s()?N:C}},{key:"resolve",value:function(t){return this.resolver(function(t,n){return(n=[t,n].join("/")).replace(/\/\//g,"/")}(this.path,t))}},{key:"result",value:function(t,n){return this.cache.set(n,t),t}},{key:"get",value:function(t){var n=this;if(this.cache.exist(t))return this.cache.resolve(t);var e=this.resolve(t).then((function(e){return n.result(n.compiler.compile(e,t),t)}));return this.result(e,t)}}]),t}(),D=function(t){return Promise.all(t).then((function(t){return t.join("")}))},K=function(){function t(n){$(this,t),this.configure(n)}return U(t,[{key:"configure",value:function(t){var n=t.vars,e=n.EXTEND,r=n.LAYOUT,c=n.BLOCKS,u=n.BUFFER,s=n.MACRO;function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.initBlocks(),this.initMacro(),y(this,t)}this.create=function(t){return new a(t)},this.helpers=function(t){y(a.prototype,t)},a.helpers=function(t){y(a.prototype,t)},a.defineProp=a.method=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Object.defineProperty(a.prototype,t,{value:n,writable:e,configurable:r,enumerable:i})},a.defineProp(u,function(){var t=[],n=[];function e(t){n.push(t)}return e.start=function(){n=[]},e.backup=function(){t.push(n.concat()),n=[]},e.restore=function(){var e=n.concat();return n=t.pop(),D(e)},e.error=function(t){throw t},e.end=function(){return D(n)},e}()),a.defineProp(c,{},!0),a.defineProp(s,{},!0),a.defineProp(r,!1,!0),a.defineProp(e,!1,!0),a.method("initBlocks",(function(){this[c]={}})),a.method("initMacro",(function(){this[s]={}})),a.method("getMacro",(function(){return this[s]})),a.method("getBuffer",(function(){return this[u]})),a.method("getBlocks",(function(){return this[c]})),a.method("setExtend",(function(t){this[e]=t})),a.method("getExtend",(function(){return this[e]})),a.method("setLayout",(function(t){this[r]=t})),a.method("getLayout",(function(){return this[r]})),a.method("clone",(function(t){var n=[r,e,u];return!0===t&&n.push(c),j(this,n)})),a.method("extend",(function(t){this.setExtend(!0),this.setLayout(t)})),a.method("echo",(function(){var t=this.getBuffer(),n=[].slice.call(arguments);n.forEach(t)})),a.method("fn",(function(t){var n=this.getBuffer(),e=this;return function(){return n.backup(),i(t)&&t.apply(e,arguments),n.restore()}})),a.method("get",(function(t,n){var e=g(this,t),r=e.shift(),i=e.pop();return E(r,i)?r[i]:n})),a.method("set",(function(t,n){var e=g(this,t),r=e.shift(),i=e.pop();return this.getExtend()&&E(r,i)?r[i]:r[i]=n})),a.method("macro",(function(t,n){var e=this.getMacro(),r=this.fn(n),i=this;e[t]=function(){return i.echo(r.apply(void 0,arguments))}})),a.method("call",(function(t){var n=this.getMacro(),e=n[t],r=[].slice.call(arguments,1);if(i(e))return e.apply(e,r)})),a.method("block",(function(t,n){var e=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(n)),!this.getExtend()){var i=Object.assign([],r[t]),o=function(){return i.shift()};this.echo(o()(function t(){var n=o();return n?function(){e.echo(n(t()))}:b}()))}})),a.method("include",(function(t,n,e){var r=!1===e?{}:this.clone(!0),i=y(r,n||{}),o=this.render(t,i);this.echo(o)})),a.method("use",(function(t,n){var e=this.require(t);this.echo(x(e,(function(t){var e=this.getMacro();w(t,(function(t,r){e[[n,r].join(".")]=t}))}),this))})),a.method("async",(function(t,n){this.echo(x(t,(function(t){return this.fn(n)(t)}),this))})),a.method("el",(function(t,n,e){i(e)&&(e=this.fn(e)()),this.echo(x(e,(function(e){return R(t,n,e)}),this))})),a.method("each",(function(t,n){o(t)&&(t=this.get(t,[])),w(t,n)}))}}]),t}(),X="undefined"!=typeof globalThis?globalThis:window||self,Y=function(){function t(n){var e,r,i;$(this,t),e=this,i={},(r=A(r="list"))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,this.configure(n),!1===s()&&this.load(X[this.namespace])}return U(t,[{key:"configure",value:function(t){this.list={},this.namespace=t.export}},{key:"load",value:function(t){return y(this.list,t),this}},{key:"exist",value:function(t){return E(this.list,t)}},{key:"get",value:function(t){return this.list[t]}},{key:"remove",value:function(t){delete this.list[t]}},{key:"resolve",value:function(t){return Promise.resolve(this.get(t))}},{key:"set",value:function(t,n){return this.list[t]=n,this}}]),t}(),J=function(t,n){y(t,{export:r(o,e.export,n.export),path:r(o,e.path,n.path),resolver:r(i,e.resolver,n.resolver),extension:r(o,e.extension,n.extension),withObject:r(c,e.withObject,n.withObject),token:y({},e.token,n.token),vars:y({},e.vars,n.vars)})},V=function t(u){var s={},a={};J(s,u||{});var f=new K(s),h=new _(s),l=new L(s),p=new Y(s),v=new q(s,p,h),g=function(t){J(s,t),f.configure(s),h.configure(s),l.configure(s),p.configure(s),v.configure(s)},b=function(t,n){return v.get(t).then((function(t){return t.call(n,n,n.getBuffer(),d)}))},w=function(t,n){var e=m(t,s.extension),r=f.create(n);return b(e,r).then((function(t){if(r.getExtend()){r.setExtend(!1);var n=r.getLayout(),e=r.clone();return w(n,e)}return t}))},j=function(t){f.helpers(y(a,t||{}))};return j({require:function(t){return function(t){var n=m(t,s.extension),e=f.create({});return b(n,e).then((function(){return e.getMacro()}))}(t)},render:function(t,n){return w(t,n)}}),{render:w,helpers:j,configure:g,wrapper:function(t){return l.wrapper(t)},compile:function(t,n){return h.compile(t,n)},create:function(n){return t(n)},preload:function(t){return p.load(t)},__express:function(t,u,s){i(u)&&(s=u,u={});var a=y({},(u=u||{}).settings),f=r(o,a.views,e.path),h=r(c,a["view cache"],e.cache),l=y({},a["view options"]),p=n.relative(f,t);return l.path=f,l.cache=h,g(l),w(p,u).then((function(t){s(null,t)})).catch((function(t){s(t)}))}}}({}),z=V.render,G=V.helpers,H=V.configure,I=V.wrapper,Q=V.compile,W=V.create,Z=V.preload,tt=V.__express;t.__express=tt,t.compile=Q,t.configure=H,t.create=W,t.element=R,t.helpers=G,t.preload=Z,t.render=z,t.safeValue=d,t.wrapper=I,Object.defineProperty(t,"__esModule",{value:!0})}));