@kosatyi/ejs 0.0.97 → 0.0.99

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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ejs={})}(this,(function(e){"use strict";var t=function(){var e=[].slice.call(arguments),t=e.shift();return e.filter(t).pop()},n=function(e){return Array.isArray(e)},r=function(e){return"function"==typeof e},o=function(e){return"string"==typeof e},i=function(e){return"boolean"==typeof e},u=function(e){return void 0===e},c="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),a={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},l=function(e){return new RegExp(["[",Object.keys(e).join(""),"]"].join(""),"g")},f=l(s),h=l(a),p=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(f,(function(e){return s[e]}))},b=function(e,t){var n=e;return null==n?"":!0===Boolean(t)?p(n):n},g=function(e,t){return Boolean(e instanceof t)},v=function(e,t,n){for(var o=e,i=String(t).split("."),u=i.pop(),c=0;c<i.length;c++){var a=i[c];if(r(o.toJSON)&&(o=o.toJSON()),n&&!1===o.hasOwnProperty(a)){o={};break}o=o[a]=o[a]||{}}return r(o.toJSON)&&(o=o.toJSON()),[o,u]},m=function(e,t){var n=e.split(".").pop();return n!==t&&(e=[e,t].join(".")),e},d=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.filter((function(e){return e})).reduce((function(e,t){return Object.assign(e,t)}),e)},w=function(){},y=function(e,t){var n;for(n in e)E(e,n)&&t(e[n],n,e)},j=function(e,t){return function(e,t){var n=e instanceof Array,r=n?[]:{};return y(e,(function(e,o,i){var c=t(e,o,i);!1===u(c)&&(n?r.push(c):r[o]=c)})),r}(e,(function(e,n){if(-1===t.indexOf(n))return e}))},E=function(e,t){return e&&e.hasOwnProperty(t)},O={export:"ejsPrecompiled",cache:!0,chokidar:null,path:"views",resolver:function(e,t){return Promise.resolve(["resolver is not defined",e,t].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]+?)"}},x=function(e,u){d(e,{path:t(o,O.path,e.path,u.path),export:t(o,O.export,e.export,u.export),resolver:t(r,O.resolver,e.resolver,u.resolver),extension:t(o,O.extension,e.extension,u.extension),withObject:t(i,O.withObject,e.withObject,u.withObject),rmWhitespace:t(i,O.rmWhitespace,e.rmWhitespace,u.rmWhitespace),cache:t(i,O.cache,e.cache,u.cache),token:d({},O.token,e.token,u.token),vars:d({},O.vars,e.vars,u.vars),globalHelpers:t(n,O.globalHelpers,e.globalHelpers,u.globalHelpers)})},k="undefined"!=typeof globalThis?globalThis:window||self;function F(e){if(!1===g(this,F))return new F;var t={enabled:!0,list:{}};this.configure=function(e){t.enabled=e.cache,!1===c&&this.load(k[e.export])},this.clear=function(){t.list={}},this.load=function(e){return t.enabled&&d(t.list,e||{}),this},this.get=function(e){if(t.enabled)return t.list[e]},this.set=function(e,n){return t.enabled&&(t.list[e]=n),this},this.resolve=function(e){return Promise.resolve(this.get(e))},this.remove=function(e){delete t.list[e]},this.exist=function(e){return E(t.list,e)}}var S=[{symbol:"-",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,",1))\n").concat(this.BUFFER,"('")}},{symbol:"=",format:function(e){return"')\n".concat(this.BUFFER,"(").concat(this.SAFE,"(").concat(e,"))\n").concat(this.BUFFER,"('")}},{symbol:"#",format:function(e){return"')\n/**".concat(e,"**/\n").concat(this.BUFFER,"('")}},{symbol:"",format:function(e){return"')\n".concat(e.trim(),"\n").concat(this.BUFFER,"('")}}];function B(e){if(!1===g(this,B))return new B(e);var t={};this.configure=function(e){t.withObject=e.withObject,t.rmWhitespace=e.rmWhitespace,t.token=e.token,t.vars=e.vars,t.globalHelpers=e.globalHelpers,t.matches=[],t.formats=[],t.slurp={match:"[s\t\n]*",start:[t.token.start,"_"],end:["_",t.token.end]},S.forEach((function(e){t.matches.push(t.token.start.concat(e.symbol).concat(t.token.regex).concat(t.token.end)),t.formats.push(e.format.bind(t.vars))})),t.regex=new RegExp(t.matches.join("|").concat("|$"),"g"),t.slurpStart=new RegExp([t.slurp.match,t.slurp.start.join("")].join(""),"gm"),t.slurpEnd=new RegExp([t.slurp.end.join(""),t.slurp.match].join(""),"gm")},this.compile=function(e,n){var r=t.vars,o=r.SCOPE,i=r.SAFE,u=r.BUFFER,c=r.COMPONENT,s=t.globalHelpers;e=String(e),t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),e=e.replace(t.slurpStart,t.token.start).replace(t.slurpEnd,t.token.end);var l,f,p,b="".concat(u,"('");l=t.regex,f=function(n,r,o){b+=(""+e.slice(r,o)).replace(h,(function(e){return"\\"+a[e]})),n.forEach((function(e,n){e&&(b+=t.formats[n](e))}))},p=0,e.replace(l,(function(){var e=[].slice.call(arguments,0,-1),t=e.pop(),n=e.shift();return f(e,p,t),p=t+n.length,n})),b="try{".concat(b+="');","}catch(e){return ").concat(u,".error(e)}"),t.withObject&&(b="with(".concat(o,"){").concat(b,"}")),b="".concat(u,".start();").concat(b,"return ").concat(u,".end();"),b+="\n//# sourceURL=".concat(n);var g=null,v=[o,c,u,i].concat(s);try{(g=Function.apply(null,v.concat(b))).source="(function(".concat(v.join(","),"){\n").concat(b,"\n});")}catch(e){throw e.filename=n,e.source=b,e}return g},this.configure(e)}function P(e,t,n){if(!1===g(this,P))return new P(e,t,n);if(!1===g(t,F))throw new TypeError("cache is not instance of Cache");if(!1===g(n,B))throw new TypeError("compiler is not instance of Compiler");var o={},i=function(e){return o.resolver(o.path,e)};this.configure=function(e){o.path=e.path,o.cache=e.cache,r(e.resolver)&&(o.resolver=e.resolver)},this.get=function(e){return t.exist(e)?t.resolve(e):i(e).then((function(o){return function(e,n){return t.set(e,n),n}(e,function(e,t){return r(e)?e:n.compile(e,t)}(o,e))}))},this.configure(e)}function R(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],N=" ",C='"',$="/",A="<",M=">",U=function(e,t,n){var r=[],o=-1===T.indexOf(e),i=function(e,t){var n=[];return y(e,(function(e,r,o){var i=t(e,r,o);!1===u(i)&&n.push(i)})),n}(t,(function(e,t){if(null!=e)return[p(t),[C,p(e),C].join("")].join("=")})).join(N);return r.push([A,e,N,i,M].join("")),n&&o&&r.push(n instanceof Array?n.join(""):n),o&&r.push([A,$,e,M].join("")),r.join("")};function H(e){this.name="TemplateError",this.message=e,Error.call(this)}function L(e){H.call(this),this.name="TemplateNotFound",this.message=e}function W(e){H.call(this),this.name="TemplateSyntaxError",this.message=e}function J(e){return Promise.all(e||[]).then((function(e){return e.join("")})).catch((function(e){return e}))}function q(){var e=[],t=[];function n(e){t.push(e)}return n.start=function(){t=[]},n.backup=function(){e.push(t.concat()),t=[]},n.restore=function(){var n=t.concat();return t=e.pop(),J(n)},n.error=function(e){return t=e,Promise.reject(new W(t.message));var t},n.end=function(){return J(t)},n}function D(e){if(!1===g(this,D))return new D(e);this.configure=function(e,t){var n,i=e.vars,u=i.BLOCKS,c=i.MACRO,a=i.EXTEND,s=i.LAYOUT,l=i.BUFFER,f=i.COMPONENT;function h(e){this[u]={},this[c]={},d(this,e||{})}this.create=function(e){return new h(e)},this.helpers=function(e){d(h.prototype,e||{})},h.prototype=d({},t||{}),Object.defineProperties(h.prototype,(R(R(R(R(R(R(R(R(R(R(n={},l,{value:q(),writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),c,{value:{},writable:!0,configurable:!1,enumerable:!1}),s,{value:!1,writable:!0,configurable:!1,enumerable:!1}),a,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[c]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var e=this;return f in e?function(){return e[f].apply(e,arguments)}:function(){console.log("%s function not defined",f)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(e){this[a]=e},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(R(n,"getExtend",{value:function(){return this[a]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(e){this[s]=e},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(e){var t=[s,a,l];return!0===e&&t.push(u),j(this,t)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(e){this.setExtend(!0),this.setLayout(e)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(e){var t=this.getBuffer();[].slice.call(arguments).forEach(t)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(e){var t=this.getBuffer(),n=this;return function(){return t.backup(),r(e)&&e.apply(n,arguments),t.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(e,t){var n=v(this,e,!0),r=n.shift(),o=n.pop();return E(r,o)?r[o]:t},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(e,t){var n=v(this,e,!1),r=n.shift(),o=n.pop();return this.getExtend()&&E(r,o)?r[o]:r[o]=t},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(e,t){var n=this.getMacro(),r=this.fn(t),o=this;n[e]=function(){return o.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),R(R(R(R(R(R(R(R(R(R(n,"call",{value:function(e){var t=this.getMacro()[e],n=[].slice.call(arguments,1);if(r(t))return t.apply(t,n)},writable:!1,configurable:!1,enumerable:!1}),"block",{value:function(e,t){var n=this,r=this.getBlocks();if(r[e]=r[e]||[],r[e].push(this.fn(t)),!this.getExtend()){var o=Object.assign([],r[e]),i=function(){return o.shift()},u=function(){var e=i();return e?function(){n.echo(e(u()))}:w};this.echo(i()(u()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(e){return this.getBlocks().hasOwnProperty(e)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(e,t,n){var r=!1===n?{}:this.clone(!0),o=d(r,t||{}),i=this.render(e,o);this.echo(i)},writable:!1,configurable:!1,enumerable:!1}),"promiseResolve",{value:function(e,t){return Promise.resolve(r(e)?this.fn(e)():e).then(t.bind(this))},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(e,t){this.echo(this.promiseResolve(this.require(e),(function(e){var n=this.getMacro();y(e,(function(e,r){n[[t,r].join(".")]=e}))})))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(e,t){this.echo(this.promiseResolve(e,(function(e){return this.fn(t)(e)})))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(e,t){o(e)&&(e=this.get(e,[])),y(e,t)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(e,t,n){return U(e,t,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(e,t,n){this.echo(this.promiseResolve(n,(function(n){return this.element(e,t,n)})))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(e)}Object.setPrototypeOf(H.prototype,Error.prototype),Object.assign(H.prototype,{code:1}),H.prototype.getCode=function(){return this.code},H.prototype.getMessage=function(){return this.message},H.prototype.toString=function(){return this.getMessage()},Object.setPrototypeOf(L.prototype,H.prototype),Object.assign(L.prototype,{code:404}),Object.setPrototypeOf(W.prototype,H.prototype),Object.assign(W.prototype,{code:500});var K=new function e(t){if(!1===g(this,e))return new e(t);var n={},o={};x(o,t||{});var i=new D(o),u=new B(o),c=new F,a=new P(o,c,u),s=function(e,t){var n=o.globalHelpers,i=[t,t.getComponent(),t.getBuffer(),b].concat(n.filter((function(e){return r(t[e])})).map((function(e){return t[e].bind(t)})));return a.get(e).then((function(e){return e.apply(t,i)}))},l=function(e,t){var n=m(e,o.extension),r=i.create(t);return s(n,r).then((function(e){if(r.getExtend()){r.setExtend(!1);var t=r.getLayout(),n=r.clone();return l(t,n)}return e}))};return this.configure=function(e){return x(o,e=e||{}),i.configure(o,n),u.configure(o),c.configure(o),a.configure(o),o},this.render=function(e,t){return l(e,t)},this.helpers=function(e){i.helpers(d(n,e))},this.preload=function(e){return c.load(e||{})},this.create=function(t){return new e(t)},this.compile=function(e,t){return u.compile(e,t)},this.context=function(e){return i.create(e)},this.helpers({require:function(e){var t=m(e,o.extension),n=i.create({});return s(t,n).then((function(){return n.getMacro()}))},render:l}),this}({resolver:function(e,t){return fetch(function(e,t){return(t=[e,t].join("/")).replace(/\/\//g,"/")}(e,t)).then((function(e){return e.text()}),(function(e){return new H(e)}))}}),X=K.render,Y=K.context,_=K.compile,z=K.helpers,G=K.preload,I=K.configure,Q=K.create;e.TemplateError=H,e.TemplateNotFound=L,e.TemplateSyntaxError=W,e.compile=_,e.configure=I,e.context=Y,e.create=Q,e.helpers=z,e.preload=G,e.render=X}));
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;"},M=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},S=M(x),P=M(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(P,(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,r=t.vars,i=r.BLOCKS,o=r.MACRO,u=r.EXTEND,c=r.LAYOUT,s=r.BUFFER,a=r.SAFE,h=r.SCOPE,l=r.COMPONENT,p=r.ELEMENT;function v(t){this[i]={},this[o]={},Object.assign(this,$(t,[h,s,a,l,p]))}return Object.assign(v.prototype,e),Object.defineProperties(v.prototype,(f(f(f(f(f(f(f(f(f(f(n={},s,{value:vt()}),i,{value:{},writable:!0}),o,{value:{},writable:!0}),c,{value:!1,writable:!0}),u,{value:!1,writable:!0}),"useSafeValue",{get:function(){return T}}),"useComponent",{get:function(){return w(this[l])?this[l].bind(this):function(){throw new Error("".concat(l," must be a function"))}}}),"useElement",{get:function(){return w(this[p])?this[p].bind(this):function(){throw new Error("".concat(p," must be a function"))}}}),"getMacro",{value:function(){return this[o]}}),"getBuffer",{value:function(){return this[s]}}),f(f(f(f(f(f(f(f(f(f(n,"getBlocks",{value:function(){return this[i]}}),"setExtend",{value:function(t){this[u]=t}}),"getExtend",{value:function(){return this[u]}}),"setLayout",{value:function(t){this[c]=t}}),"getLayout",{value:function(){return this[c]}}),"clone",{value:function(t){var e=[c,u,s];return!0===t&&e.push(i),$(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))}}}),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(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}),f(n,"ui",{value:function(t){},writable:!0}))),v}(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 Mt=new Ot({resolver:function(t,e){return fetch(function(t,e){return(e=[t,e].join("/")).replace(/\/\//g,"/")}(t,e)).then((function(t){return t.text()}),(function(t){return new ft(t)}))}}),St=Mt.render,Pt=Mt.context,Ft=Mt.compile,Tt=Mt.helpers,Wt=Mt.preload,Bt=Mt.configure,Rt=Mt.create;t.TemplateError=ft,t.TemplateNotFound=ht,t.TemplateSyntaxError=lt,t.compile=Ft,t.configure=Bt,t.context=Pt,t.create=Rt,t.helpers=Tt,t.preload=Wt,t.render=St}));
@@ -58,6 +58,13 @@
58
58
  });
59
59
  return result;
60
60
  };
61
+
62
+ /**
63
+ *
64
+ * @param object
65
+ * @param prop
66
+ * @return {boolean}
67
+ */
61
68
  var hasProp = function hasProp(object, prop) {
62
69
  return object && object.hasOwnProperty(prop);
63
70
  };