@kosatyi/ejs 0.0.98 → 0.0.100

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.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function n(t,e,n){return e=h(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,n){return t.get(e(t,n))}function c(t,e,n){r(t,e),e.set(t,n)}function u(t,n,r){return t.set(e(t,n),r),r}function s(t,e){r(t,e),e.add(t)}function a(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,g(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e,n){return(e=g(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function g(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function y(t){var e="function"==typeof Map?new Map:void 0;return y=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(p())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&v(i,n.prototype),i}(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,t)},y(t)}var d=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},b=function(t){return Array.isArray(t)},m=function(t){return"function"==typeof t},w=function(t){return"string"==typeof t},k=function(t){return"boolean"==typeof t},j=function(t){return void 0===t},O="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),E={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},S=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},M=S(x),P=S(E),F=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(M,(function(t){return x[t]}))},W=function(t,e){var n=t;return null==n?"":!0===Boolean(e)?F(n):n},R=function(t,e){if(!1===function(t,e){return Boolean(t instanceof e)}(t,e))throw new TypeError("".concat(t," in not instance of ").concat(e))},B=function(t,e,n){for(var r=t,i=String(e).split("."),o=i.pop(),c=0;c<i.length;c++){var u=i[c];if(m(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(u)){r={};break}r=r[u]=r[u]||{}}return m(r.toJSON)&&(r=r.toJSON()),[r,o]},T=function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((function(e){e in t&&(t[e]=t[e].bind(t))}))},A=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},C=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},$=function(){},N=function(t,e){var n;for(n in t)_(t,n)&&e(t[n],n,t)},U=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return N(t,(function(t,i,o){var c=e(t,i,o);!1===j(c)&&(n?r.push(c):r[i]=c)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},_=function(t,e){return t&&t.hasOwnProperty(e)},H={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},L=function(t,e){C(t,{path:d(w,H.path,t.path,e.path),export:d(w,H.export,t.export,e.export),resolver:d(m,H.resolver,t.resolver,e.resolver),extension:d(w,H.extension,t.extension,e.extension),withObject:d(k,H.withObject,t.withObject,e.withObject),rmWhitespace:d(k,H.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:d(k,H.cache,t.cache,e.cache),token:C({},H.token,t.token,e.token),vars:C({},H.vars,t.vars,e.vars),globalHelpers:d(b,H.globalHelpers,t.globalHelpers,e.globalHelpers)})},J="undefined"!=typeof globalThis?globalThis:window||self,q=new WeakMap,D=new WeakMap,K=function(){return a((function t(e){i(this,t),c(this,q,!0),c(this,D,{}),T(this,["configure"]),this.configure(e)}),[{key:"load",value:function(t){o(q,this)&&C(o(D,this),t||{})}},{key:"get",value:function(t){if(o(q,this))return o(D,this)[t]}},{key:"set",value:function(t,e){o(q,this)&&(o(D,this)[t]=e)}},{key:"exist",value:function(t){return _(o(D,this),t)}},{key:"clear",value:function(){u(D,this,{})}},{key:"remove",value:function(t){delete o(D,this)[t]}},{key:"resolve",value:function(t){return Promise.resolve(this.get(t))}},{key:"configure",value:function(t){u(q,this,t.cache),!1===O&&this.load(J[t.export])}}])}(),X=new WeakMap,Y=new WeakMap,z=function(){return a((function t(e){i(this,t),c(this,X,{}),c(this,Y,[{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,"('")}}]),T(this,["configure","compile"]),this.configure(e)}),[{key:"configure",value:function(t){var e=this;o(X,this).withObject=t.withObject,o(X,this).rmWhitespace=t.rmWhitespace,o(X,this).token=t.token,o(X,this).vars=t.vars,o(X,this).globalHelpers=t.globalHelpers,o(X,this).matches=[],o(X,this).formats=[],o(X,this).slurp={match:"[s\t\n]*",start:[o(X,this).token.start,"_"],end:["_",o(X,this).token.end]},o(Y,this).forEach((function(t){o(X,e).matches.push(o(X,e).token.start.concat(t.symbol).concat(o(X,e).token.regex).concat(o(X,e).token.end)),o(X,e).formats.push(t.format.bind(o(X,e).vars))})),o(X,this).regex=new RegExp(o(X,this).matches.join("|").concat("|$"),"g"),o(X,this).slurpStart=new RegExp([o(X,this).slurp.match,o(X,this).slurp.start.join("")].join(""),"gm"),o(X,this).slurpEnd=new RegExp([o(X,this).slurp.end.join(""),o(X,this).slurp.match].join(""),"gm")}},{key:"compile",value:function(t,e){var n=this,r=o(X,this).vars,i=r.SCOPE,c=r.SAFE,u=r.BUFFER,s=r.COMPONENT,a=o(X,this).globalHelpers;o(X,this).rmWhitespace&&(t=String(t).replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=String(t).replace(o(X,this).slurpStart,o(X,this).token.start).replace(o(X,this).slurpEnd,o(X,this).token.end);var f,h,l,p="".concat(u,"('");f=o(X,this).regex,h=function(e,r,i){p+=(""+t.slice(r,i)).replace(P,(function(t){return"\\"+E[t]})),e.forEach((function(t,e){t&&(p+=o(X,n).formats[e](t))}))},l=0,t.replace(f,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return h(t,l,e),l=e+n.length,n})),p="try{".concat(p+="');","}catch(e){return ").concat(u,".error(e)}"),o(X,this).withObject&&(p="with(".concat(i,"){").concat(p,"}")),p="".concat(u,".start();").concat(p,"return ").concat(u,".end();"),p+="\n//# sourceURL=".concat(e);var v=null,g=[i,s,u,c].concat(a);try{(v=Function.apply(null,g.concat(p))).source="(function(".concat(g.join(","),"){\n").concat(p,"\n});")}catch(t){throw t.filename=e,t.source=p,t}return v}}])}(),G=new WeakMap,I=new WeakMap,Q=new WeakMap,V=new WeakMap,Z=new WeakSet,tt=function(){return a((function t(e,n,r){i(this,t),s(this,Z),c(this,G,void 0),c(this,I,void 0),c(this,Q,void 0),c(this,V,void 0),R(n,K),R(r,z),u(I,this,n),u(Q,this,r),T(this,["configure","get"]),this.configure(e)}),[{key:"configure",value:function(t){u(G,this,t.path),m(t.resolver)&&u(V,this,t.resolver)}},{key:"get",value:function(t){var n=this;return o(I,this).exist(t)?o(I,this).resolve(t):e(Z,this,et).call(this,t).then((function(r){return e(Z,n,nt).call(n,t,e(Z,n,rt).call(n,r,t))}))}}])}();function et(t){return o(V,this).call(this,o(G,this),t)}function nt(t,e){return o(I,this).set(t,e),e}function rt(t,e){return m(t)?t:o(Q,this).compile(t,e)}var it=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],ot=" ",ct='"',ut="/",st="<",at=">",ft=function(t,e,n){var r=[],i=-1===it.indexOf(t),o=function(t,e){var n=[];return N(t,(function(t,r,i){var o=e(t,r,i);!1===j(o)&&n.push(o)})),n}(e,(function(t,e){if(null!=t)return[F(e),[ct,F(t),ct].join("")].join("=")})).join(ot);return r.push([st,t,ot,o,at].join("")),n&&i&&r.push(n instanceof Array?n.join(""):n),i&&r.push([st,ut,t,at].join("")),r.join("")},ht=function(t){function e(t){var r;return i(this,e),f(r=n(this,e),"code",0),r.message=t,r}return l(e,t),a(e,[{key:"getCode",value:function(){return this.code}},{key:"getMessage",value:function(){return this.message}},{key:"toString",value:function(){return this.getMessage()}}])}(y(Error)),lt=function(t){function e(){var t;i(this,e);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return f(t=n(this,e,[].concat(o)),"code",404),t}return l(e,t),a(e)}(ht),pt=function(t){function e(){var t;i(this,e);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return f(t=n(this,e,[].concat(o)),"code",500),t}return l(e,t),a(e)}(ht);function vt(t){return Promise.all(t||[]).then((function(t){return t.join("")})).catch((function(t){return t}))}function gt(){var t=[],e=[],n=function(t){e.push(t)};return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),vt(n)},n.error=function(t){return e=t,Promise.reject(new pt(e.message));var e},n.end=function(){return vt(e)},n}var yt=new WeakMap,dt=function(){return a((function t(e,n){i(this,t),c(this,yt,void 0),T(this,["create","helpers","configure"]),this.configure(e,n)}),[{key:"create",value:function(t){return new(o(yt,this))(t)}},{key:"configure",value:function(t,e){u(yt,this,function(t,e){var n,r=t.vars,i=r.BLOCKS,o=r.MACRO,c=r.EXTEND,u=r.LAYOUT,s=r.BUFFER,a=r.COMPONENT,h=r.SAFE,l=r.SCOPE;function p(t){this[i]={},this[o]={},Object.assign(this,U(t,[l,s,h,a]))}return Object.assign(p.prototype,e),Object.defineProperties(p.prototype,(f(f(f(f(f(f(f(f(f(f(n={},s,{value:gt()}),i,{value:{},writable:!0}),o,{value:{},writable:!0}),u,{value:!1,writable:!0}),c,{value:!1,writable:!0}),"getMacro",{value:function(){return this[o]}}),"getBuffer",{value:function(){return this[s]}}),"getComponent",{value:function(){var t=this;return a in t?function(){return t[a].apply(t,arguments)}:function(){console.log("%s function not defined",a)}}}),"getBlocks",{value:function(){return this[i]}}),"setExtend",{value:function(t){this[c]=t}}),f(f(f(f(f(f(f(f(f(f(n,"getExtend",{value:function(){return this[c]}}),"setLayout",{value:function(t){this[u]=t}}),"getLayout",{value:function(){return this[u]}}),"clone",{value:function(t){var e=[u,c,s];return!0===t&&e.push(i),U(this,e)}}),"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)}}),"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)}}),"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){return e.backup(),m(t)&&t.apply(n,arguments),e.restore()}}}),"get",{value:function(t,e){var n=B(this,t,!0),r=n.shift(),i=n.pop();return _(r,i)?r[i]:e}}),"set",{value:function(t,e){var n=B(this,t,!1),r=n.shift(),i=n.pop();return this.getExtend()&&_(r,i)?r[i]:r[i]=e}}),"macro",{value:function(t,e){var n=this.getMacro(),r=this.fn(e),i=this;n[t]=function(){return i.echo(r.apply(void 0,arguments))}}}),f(f(f(f(f(f(f(f(f(f(n,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(m(e))return e.apply(e,n)}}),"block",{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var i=Object.assign([],r[t]),o=function(){return i.shift()},c=function(){var t=o();return t?function(){n.echo(t(c()))}:$};this.echo(o()(c()))}}}),"hasBlock",{value:function(t){return this.getBlocks().hasOwnProperty(t)}}),"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),i=C(r,e||{}),o=this.render(t,i);this.echo(o)}}),"promiseResolve",{value:function(t,e){return Promise.resolve(m(t)?this.fn(t)():t).then(e.bind(this))}}),"use",{value:function(t,e){this.echo(this.promiseResolve(this.require(t),(function(t){var n=this.getMacro();N(t,(function(t,r){n[[e,r].join(".")]=t}))})))}}),"async",{value:function(t,e){this.echo(this.promiseResolve(t,(function(t){return this.fn(e)(t)})))}}),"each",{value:function(t,e){w(t)&&(t=this.get(t,[])),N(t,e)}}),"element",{value:function(t,e,n){return ft(t,e,n)}}),"el",{value:function(t,e,n){this.echo(this.promiseResolve(n,(function(n){return this.element(t,e,n)})))}}))),p}(t,e))}},{key:"helpers",value:function(t){C(o(yt,this).prototype,t||{})}}])}(),bt=new WeakMap,mt=new WeakMap,wt=new WeakMap,kt=new WeakMap,jt=new WeakMap,Ot=new WeakMap,Et=new WeakSet,xt=function(){return a((function t(n){i(this,t),s(this,Et),c(this,bt,{}),c(this,mt,{}),c(this,wt,void 0),c(this,kt,void 0),c(this,jt,void 0),c(this,Ot,void 0),L(o(bt,this),n||{}),u(wt,this,new dt(o(bt,this),o(mt,this))),u(kt,this,new z(o(bt,this))),u(jt,this,new K(o(bt,this))),u(Ot,this,new tt(o(bt,this),o(jt,this),o(kt,this))),T(this,["configure","create","render","context","preload","compile","helpers"]),this.helpers({require:e(Et,this,Mt),render:this.render})}),[{key:"configure",value:function(t){return L(o(bt,this),t||{}),o(wt,this).configure(o(bt,this),o(mt,this)),o(kt,this).configure(o(bt,this)),o(jt,this).configure(o(bt,this)),o(Ot,this).configure(o(bt,this)),o(bt,this)}},{key:"render",value:function(t,n){var r=this,i=A(t,o(bt,this).extension),c=this.context(n);return e(Et,this,St).call(this,i,c).then((function(t){if(c.getExtend()){c.setExtend(!1);var e=c.getLayout(),n=c.clone();return r.render(e,n)}return t}))}},{key:"helpers",value:function(t){o(wt,this).helpers(C(o(mt,this),t))}},{key:"context",value:function(t){return o(wt,this).create(t)}},{key:"compile",value:function(t,e){return o(kt,this).compile(t,e)}},{key:"preload",value:function(t){return o(jt,this).load(t||{})}},{key:"create",value:function(t){return new this.constructor(t)}}])}();function St(t,e){var n=o(bt,this).globalHelpers,r=[e,e.getComponent(),e.getBuffer(),W].concat(n.filter((function(t){return m(e[t])})).map((function(t){return e[t].bind(e)})));return o(Ot,this).get(t).then((function(t){return t.apply(e,r)}))}function Mt(t){var n=A(t,o(bt,this).extension),r=this.context({});return e(Et,this,St).call(this,n,r).then((function(){return r.getMacro()}))}var Pt={};var Ft=new xt({resolver:function(t,e){return new Promise((function(n,r){Pt.readFile(function(t,e){return(e=[t,e].join("/")).replace(/\/\//g,"/")}(t,e),(function(t,e){t?r(new ht(t)):n(e.toString())}))}))}}),Wt=Ft.render,Rt=Ft.context,Bt=Ft.compile,Tt=Ft.helpers,At=Ft.preload,Ct=Ft.configure,$t=Ft.create,Nt=function(t,e){return function(n,r,i){m(r)&&(i=r,r={});var o=C({},(r=r||{}).settings),c=d(w,H.path,o.views),u=d(k,H.cache,o["view cache"]),s=C({},o["view options"]),a=Pt.relative(c,n);return s.path=c,s.cache=u,t(s),e(a,r).then((function(t){i(null,t)})).catch((function(t){i(t)}))}}(Ct,Wt);t.TemplateError=ht,t.TemplateNotFound=lt,t.TemplateSyntaxError=pt,t.__express=Nt,t.compile=Bt,t.configure=Ct,t.context=Rt,t.create=$t,t.helpers=Tt,t.preload=At,t.render=Wt}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ejs={})}(this,(function(t){"use strict";function e(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function n(t,e,n){return e=h(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}function r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,n){return t.get(e(t,n))}function u(t,e,n){r(t,e),e.set(t,n)}function c(t,n,r){return t.set(e(t,n),r),r}function s(t,e){r(t,e),e.add(t)}function a(t,e,n){return e&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,y(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function f(t,e,n){return(e=y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}function y(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:e+""}function g(t){var e="function"==typeof Map?new Map:void 0;return g=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(p())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&v(i,n.prototype),i}(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,t)},g(t)}var d=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},b=function(t){return Array.isArray(t)},w=function(t){return"function"==typeof t},m=function(t){return"string"==typeof t},k=function(t){return"boolean"==typeof t},E=function(t){return void 0===t},j="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),O={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},x={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},P=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},S=P(x),M=P(O),F=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(S,(function(t){return x[t]}))},T=function(t,e){var n=t;return null==n?"":!0===Boolean(e)?F(n):n},W=function(t,e){if(!1===function(t,e){return Boolean(t instanceof e)}(t,e))throw new TypeError("".concat(t," in not instance of ").concat(e))},B=function(t,e,n){for(var r=t,i=String(e).split("."),o=i.pop(),u=0;u<i.length;u++){var c=i[u];if(w(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(c)){r={};break}r=r[c]=r[c]||{}}return w(r.toJSON)&&(r=r.toJSON()),[r,o]},R=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},A=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.filter((function(t){return t})).reduce((function(t,e){return Object.assign(t,e)}),t)},N=function(){},C=function(t,e){var n;for(n in t)L(t,n)&&e(t[n],n,t)},$=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return C(t,(function(t,i,o){var u=e(t,i,o);!1===E(u)&&(n?r.push(u):r[i]=u)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},L=function(t,e){return t&&t.hasOwnProperty(e)},U={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(t,e){return Promise.resolve(["resolver is not defined",t,e].join(" "))},extension:"ejs",rmWhitespace:!0,withObject:!0,globalHelpers:[],vars:{SCOPE:"ejs",COMPONENT:"ui",ELEMENT:"el",EXTEND:"$$e",BUFFER:"$$a",LAYOUT:"$$l",BLOCKS:"$$b",MACRO:"$$m",SAFE:"$$v"},token:{start:"<%",end:"%>",regex:"([\\s\\S]+?)"}},_=function(t,e){A(t,{path:d(m,U.path,t.path,e.path),export:d(m,U.export,t.export,e.export),resolver:d(w,U.resolver,t.resolver,e.resolver),extension:d(m,U.extension,t.extension,e.extension),withObject:d(k,U.withObject,t.withObject,e.withObject),rmWhitespace:d(k,U.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:d(k,U.cache,t.cache,e.cache),token:A({},U.token,t.token,e.token),vars:A({},U.vars,t.vars,e.vars),globalHelpers:d(b,U.globalHelpers,t.globalHelpers,e.globalHelpers)})},H="undefined"!=typeof globalThis?globalThis:window||self,q=new WeakMap,J=new WeakMap,D=function(){return a((function t(e){i(this,t),u(this,q,!0),u(this,J,{}),this.configure(e)}),[{key:"load",value:function(t){o(q,this)&&A(o(J,this),t||{})}},{key:"get",value:function(t){if(o(q,this))return o(J,this)[t]}},{key:"set",value:function(t,e){o(q,this)&&(o(J,this)[t]=e)}},{key:"exist",value:function(t){return L(o(J,this),t)}},{key:"clear",value:function(){c(J,this,{})}},{key:"remove",value:function(t){delete o(J,this)[t]}},{key:"resolve",value:function(t){return Promise.resolve(this.get(t))}},{key:"configure",value:function(t){c(q,this,t.cache),!1===j&&this.load(H[t.export])}}])}(),K=new WeakMap,V=new WeakMap,X=function(){return a((function t(e){i(this,t),u(this,K,{}),u(this,V,[{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,"('")}}]),this.configure(e)}),[{key:"configure",value:function(t){var e=this;o(K,this).withObject=t.withObject,o(K,this).rmWhitespace=t.rmWhitespace,o(K,this).token=t.token,o(K,this).vars=t.vars,o(K,this).globalHelpers=t.globalHelpers,o(K,this).matches=[],o(K,this).formats=[],o(K,this).slurp={match:"[s\t\n]*",start:[o(K,this).token.start,"_"],end:["_",o(K,this).token.end]},o(V,this).forEach((function(t){o(K,e).matches.push(o(K,e).token.start.concat(t.symbol).concat(o(K,e).token.regex).concat(o(K,e).token.end)),o(K,e).formats.push(t.format.bind(o(K,e).vars))})),o(K,this).regex=new RegExp(o(K,this).matches.join("|").concat("|$"),"g"),o(K,this).slurpStart=new RegExp([o(K,this).slurp.match,o(K,this).slurp.start.join("")].join(""),"gm"),o(K,this).slurpEnd=new RegExp([o(K,this).slurp.end.join(""),o(K,this).slurp.match].join(""),"gm")}},{key:"compile",value:function(t,e){var n=this,r=o(K,this).vars,i=r.SCOPE,u=r.SAFE,c=r.BUFFER,s=r.COMPONENT,a=r.ELEMENT,f=o(K,this).globalHelpers;o(K,this).rmWhitespace&&(t=String(t).replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=String(t).replace(o(K,this).slurpStart,o(K,this).token.start).replace(o(K,this).slurpEnd,o(K,this).token.end);var h,l,p,v="".concat(c,"('");h=o(K,this).regex,l=function(e,r,i){v+=(""+t.slice(r,i)).replace(M,(function(t){return"\\"+O[t]})),e.forEach((function(t,e){t&&(v+=o(K,n).formats[e](t))}))},p=0,t.replace(h,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,p,e),p=e+n.length,n})),v="try{".concat(v+="');","}catch(e){return ").concat(c,".error(e)}"),o(K,this).withObject&&(v="with(".concat(i,"){").concat(v,"}")),v="".concat(c,".start();").concat(v,"return ").concat(c,".end();"),v+="\n//# sourceURL=".concat(e);var y=null,g=[i,c,u,s,a].concat(f);try{(y=Function.apply(null,g.concat(v))).source="(function(".concat(g.join(","),"){\n").concat(v,"\n});")}catch(t){throw t.filename=e,t.source=v,t}return y}}])}(),Y=new WeakMap,z=new WeakMap,G=new WeakMap,I=new WeakMap,Q=new WeakSet,Z=function(){return a((function t(e,n,r){i(this,t),s(this,Q),u(this,Y,void 0),u(this,z,void 0),u(this,G,void 0),u(this,I,void 0),W(n,D),W(r,X),c(z,this,n),c(G,this,r),this.configure(e)}),[{key:"configure",value:function(t){c(Y,this,t.path),w(t.resolver)&&c(I,this,t.resolver)}},{key:"get",value:function(t){var n=this;return o(z,this).exist(t)?o(z,this).resolve(t):e(Q,this,tt).call(this,t).then((function(r){return e(Q,n,et).call(n,t,e(Q,n,nt).call(n,r,t))}))}}])}();function tt(t){return o(I,this).call(this,o(Y,this),t)}function et(t,e){return o(z,this).set(t,e),e}function nt(t,e){return w(t)?t:o(G,this).compile(t,e)}var rt=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],it=" ",ot='"',ut="/",ct="<",st=">",at=function(t,e,n){var r=[],i=-1===rt.indexOf(t),o=function(t,e){var n=[];return C(t,(function(t,r,i){var o=e(t,r,i);!1===E(o)&&n.push(o)})),n}(e,(function(t,e){if(null!=t)return[F(e),[ot,F(t),ot].join("")].join("=")})).join(it);return r.push([ct,t,it,o,st].join("")),n&&i&&r.push(n instanceof Array?n.join(""):n),i&&r.push([ct,ut,t,st].join("")),r.join("")},ft=function(t){function e(t){var r;return i(this,e),f(r=n(this,e),"code",0),r.message=t,r}return l(e,t),a(e,[{key:"getCode",value:function(){return this.code}},{key:"getMessage",value:function(){return this.message}},{key:"toString",value:function(){return this.getMessage()}}])}(g(Error)),ht=function(t){function e(){var t;i(this,e);for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return f(t=n(this,e,[].concat(o)),"code",404),t}return l(e,t),a(e)}(ft),lt=function(t){function e(){var t;i(this,e);for(var r=arguments.length,o=new Array(r),u=0;u<r;u++)o[u]=arguments[u];return f(t=n(this,e,[].concat(o)),"code",500),t}return l(e,t),a(e)}(ft);function pt(t){return Promise.all(t||[]).then((function(t){return t.join("")})).catch((function(t){return t}))}function vt(){var t=[],e=[],n=function(t){e.push(t)};return n.start=function(){e=[]},n.backup=function(){t.push(e.concat()),e=[]},n.restore=function(){var n=e.concat();return e=t.pop(),pt(n)},n.error=function(t){return e=t,Promise.reject(new lt(e.message));var e},n.end=function(){return pt(e)},n}var yt=new WeakMap,gt=function(){return a((function t(e,n){i(this,t),u(this,yt,void 0),this.configure(e,n)}),[{key:"create",value:function(t){return new(o(yt,this))(t)}},{key:"configure",value:function(t,e){c(yt,this,function(t,e){var n=t.vars,r=n.BLOCKS,i=n.MACRO,o=n.EXTEND,u=n.LAYOUT,c=n.BUFFER,s=n.SAFE,a=n.SCOPE,f=n.COMPONENT,h=n.ELEMENT;function l(t){this[r]={},this[i]={},Object.assign(this,$(t,[a,c,s,f,h]))}return Object.assign(l.prototype,e),Object.defineProperty(l.prototype,c,{value:vt()}),Object.defineProperty(l.prototype,r,{value:{},writable:!0}),Object.defineProperty(l.prototype,i,{value:{},writable:!0}),Object.defineProperty(l.prototype,u,{value:!1,writable:!0}),Object.defineProperty(l.prototype,o,{value:!1,writable:!0}),Object.defineProperties(l.prototype,{useSafeValue:{get:function(){return T}},useComponent:{get:function(){return w(this[f])?this[f].bind(this):function(){throw new Error("".concat(f," must be a function"))}}},useElement:{get:function(){return w(this[h])?this[h].bind(this):function(){throw new Error("".concat(h," must be a function"))}}},getMacro:{value:function(){return this[i]}},getBuffer:{value:function(){return this[c]}},getBlocks:{value:function(){return this[r]}},setExtend:{value:function(t){this[o]=t}},getExtend:{value:function(){return this[o]}},setLayout:{value:function(t){this[u]=t}},getLayout:{value:function(){return this[u]}},clone:{value:function(t){var e=[u,o,c];return!0===t&&e.push(r),$(this,e)}},extend:{value:function(t){this.setExtend(!0),this.setLayout(t)}},echo:{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)}},fn:{value:function(t){var e=this.getBuffer(),n=this;return function(){if(w(t))return e.backup(),e(t.apply(n,arguments)),e.restore()}}},macro:{value:function(t,e){var n=this.getMacro(),r=this.fn(e),i=this;n[t]=function(){return i.echo(r.apply(void 0,arguments))}}},call:{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(w(e))return e.apply(e,n)}},block:{value:function(t,e){var n=this,r=this.getBlocks();if(r[t]=r[t]||[],r[t].push(this.fn(e)),!this.getExtend()){var i=Object.assign([],r[t]),o=function(){return i.shift()},u=function(){var t=o();return t?function(){n.echo(t(u()))}:N};this.echo(o()(u()))}}},hasBlock:{value:function(t){return this.getBlocks().hasOwnProperty(t)}},include:{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),i=A(r,e||{}),o=this.render(t,i);this.echo(o)}},use:{value:function(t,e){var n=this;this.echo(Promise.resolve(this.require(t)).then((function(t){var r=n.getMacro();C(t,(function(t,n){r[[e,n].join(".")]=t}))})))}},async:{value:function(t,e){this.echo(Promise.resolve(t).then(e))}},get:{value:function(t,e){var n=B(this,t,!0),r=n.shift(),i=n.pop();return L(r,i)?r[i]:e}},set:{value:function(t,e){var n=B(this,t,!1),r=n.shift(),i=n.pop();return this.getExtend()&&L(r,i)?r[i]:r[i]=e}},each:{value:function(t,e){m(t)&&(t=this.get(t,[])),C(t,e)},writable:!0},el:{value:function(t,e,n){n=w(n)?this.fn(n)():n,this.echo(Promise.resolve(n).then((function(n){return at(t,e,n)})))},writable:!0},ui:{value:function(t){},writable:!0}}),l}(t,e))}},{key:"helpers",value:function(t){A(o(yt,this).prototype,t||{})}}])}(),dt=new WeakMap,bt=new WeakMap,wt=new WeakMap,mt=new WeakMap,kt=new WeakMap,Et=new WeakMap,jt=new WeakSet,Ot=function(){return a((function t(e){i(this,t),s(this,jt),u(this,dt,{}),u(this,bt,{}),u(this,wt,void 0),u(this,mt,void 0),u(this,kt,void 0),u(this,Et,void 0),_(o(dt,this),e||{}),c(wt,this,new gt(o(dt,this),o(bt,this))),c(mt,this,new X(o(dt,this))),c(kt,this,new D(o(dt,this))),c(Et,this,new Z(o(dt,this),o(kt,this),o(mt,this))),function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((function(e){e in t&&(t[e]=t[e].bind(t))}))}(this,["configure","create","render","require","context","preload","compile","helpers"]),this.helpers({require:this.require,render:this.render})}),[{key:"configure",value:function(t){return _(o(dt,this),t||{}),o(wt,this).configure(o(dt,this),o(bt,this)),o(mt,this).configure(o(dt,this)),o(kt,this).configure(o(dt,this)),o(Et,this).configure(o(dt,this)),o(dt,this)}},{key:"render",value:function(t,n){var r=this,i=R(t,o(dt,this).extension),u=this.context(n);return e(jt,this,xt).call(this,i,u).then((function(t){if(u.getExtend()){u.setExtend(!1);var e=u.getLayout(),n=u.clone();return r.render(e,n)}return t}))}},{key:"helpers",value:function(t){o(wt,this).helpers(A(o(bt,this),t))}},{key:"context",value:function(t){return o(wt,this).create(t)}},{key:"compile",value:function(t,e){return o(mt,this).compile(t,e)}},{key:"preload",value:function(t){return o(kt,this).load(t||{})}},{key:"create",value:function(t){return new this.constructor(t)}},{key:"require",value:function(t){var n=R(t,o(dt,this).extension),r=this.context({});return e(jt,this,xt).call(this,n,r).then((function(){return r.getMacro()}))}}])}();function xt(t,e){var n=o(dt,this).globalHelpers,r=[e,e.getBuffer(),e.useSafeValue,e.useComponent,e.useElement].concat(n.filter((function(t){return w(e[t])})).map((function(t){return e[t].bind(e)})));return o(Et,this).get(t).then((function(t){return t.apply(e,r)}))}var Pt={};var St=new Ot({resolver:function(t,e){return new Promise((function(n,r){Pt.readFile(function(t,e){return(e=[t,e].join("/")).replace(/\/\//g,"/")}(t,e),(function(t,e){t?r(new ft(t)):n(e.toString())}))}))}}),Mt=St.render,Ft=St.context,Tt=St.compile,Wt=St.helpers,Bt=St.preload,Rt=St.configure,At=St.create,Nt=function(t,e){return function(n,r,i){w(r)&&(i=r,r={});var o=A({},(r=r||{}).settings),u=d(m,U.path,o.views),c=d(k,U.cache,o["view cache"]),s=A({},o["view options"]),a=Pt.relative(u,n);return s.path=u,s.cache=c,t(s),e(a,r).then((function(t){i(null,t)})).catch((function(t){i(t)}))}}(Rt,Mt);t.TemplateError=ft,t.TemplateNotFound=ht,t.TemplateSyntaxError=lt,t.__express=Nt,t.compile=Tt,t.configure=Rt,t.context=Ft,t.create=At,t.helpers=Wt,t.preload=Bt,t.render=Mt}));