@kosatyi/ejs 0.0.79 → 0.0.81

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.
@@ -4,6 +4,39 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ejs = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
8
+ try {
9
+ var i = n[a](c),
10
+ u = i.value;
11
+ } catch (n) {
12
+ return void e(n);
13
+ }
14
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
15
+ }
16
+ function _asyncToGenerator(n) {
17
+ return function () {
18
+ var t = this,
19
+ e = arguments;
20
+ return new Promise(function (r, o) {
21
+ var a = n.apply(t, e);
22
+ function _next(n) {
23
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
24
+ }
25
+ function _throw(n) {
26
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
27
+ }
28
+ _next(void 0);
29
+ });
30
+ };
31
+ }
32
+ function _defineProperty(e, r, t) {
33
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
34
+ value: t,
35
+ enumerable: !0,
36
+ configurable: !0,
37
+ writable: !0
38
+ }) : e[r] = t, e;
39
+ }
7
40
  function _regeneratorRuntime() {
8
41
  _regeneratorRuntime = function () {
9
42
  return e;
@@ -112,7 +145,7 @@
112
145
  function makeInvokeMethod(e, r, n) {
113
146
  var o = h;
114
147
  return function (i, a) {
115
- if (o === f) throw new Error("Generator is already running");
148
+ if (o === f) throw Error("Generator is already running");
116
149
  if (o === s) {
117
150
  if ("throw" === i) throw a;
118
151
  return {
@@ -254,7 +287,7 @@
254
287
  } else if (c) {
255
288
  if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
256
289
  } else {
257
- if (!u) throw new Error("try statement without catch or finally");
290
+ if (!u) throw Error("try statement without catch or finally");
258
291
  if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
259
292
  }
260
293
  }
@@ -294,7 +327,7 @@
294
327
  return o;
295
328
  }
296
329
  }
297
- throw new Error("illegal catch attempt");
330
+ throw Error("illegal catch attempt");
298
331
  },
299
332
  delegateYield: function (e, r, n) {
300
333
  return this.delegate = {
@@ -305,63 +338,19 @@
305
338
  }
306
339
  }, e;
307
340
  }
308
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
309
- try {
310
- var info = gen[key](arg);
311
- var value = info.value;
312
- } catch (error) {
313
- reject(error);
314
- return;
315
- }
316
- if (info.done) {
317
- resolve(value);
318
- } else {
319
- Promise.resolve(value).then(_next, _throw);
320
- }
321
- }
322
- function _asyncToGenerator(fn) {
323
- return function () {
324
- var self = this,
325
- args = arguments;
326
- return new Promise(function (resolve, reject) {
327
- var gen = fn.apply(self, args);
328
- function _next(value) {
329
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
330
- }
331
- function _throw(err) {
332
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
333
- }
334
- _next(undefined);
335
- });
336
- };
337
- }
338
- function _defineProperty(obj, key, value) {
339
- key = _toPropertyKey(key);
340
- if (key in obj) {
341
- Object.defineProperty(obj, key, {
342
- value: value,
343
- enumerable: true,
344
- configurable: true,
345
- writable: true
346
- });
347
- } else {
348
- obj[key] = value;
349
- }
350
- return obj;
351
- }
352
- function _toPrimitive(input, hint) {
353
- if (typeof input !== "object" || input === null) return input;
354
- var prim = input[Symbol.toPrimitive];
355
- if (prim !== undefined) {
356
- var res = prim.call(input, hint || "default");
357
- if (typeof res !== "object") return res;
341
+ function _toPrimitive(t, r) {
342
+ if ("object" != typeof t || !t) return t;
343
+ var e = t[Symbol.toPrimitive];
344
+ if (void 0 !== e) {
345
+ var i = e.call(t, r || "default");
346
+ if ("object" != typeof i) return i;
358
347
  throw new TypeError("@@toPrimitive must return a primitive value.");
359
348
  }
360
- return (hint === "string" ? String : Number)(input);
349
+ return ("string" === r ? String : Number)(t);
361
350
  }
362
- function _toPropertyKey(arg) {
363
- var key = _toPrimitive(arg, "string");
364
- return typeof key === "symbol" ? key : String(key);
351
+ function _toPropertyKey(t) {
352
+ var i = _toPrimitive(t, "string");
353
+ return "symbol" == typeof i ? i : i + "";
365
354
  }
366
355
 
367
356
  var typeProp = function typeProp() {
@@ -850,46 +839,46 @@
850
839
  extend(this, data || {});
851
840
  }
852
841
  Scope.prototype = extend({}, methods || {});
853
- Object.defineProperties(Scope.prototype, (_Object$definePropert = {}, _defineProperty(_Object$definePropert, BUFFER, {
842
+ Object.defineProperties(Scope.prototype, (_Object$definePropert = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$definePropert, BUFFER, {
854
843
  value: createBuffer(),
855
844
  writable: true,
856
845
  configurable: false,
857
846
  enumerable: false
858
- }), _defineProperty(_Object$definePropert, BLOCKS, {
847
+ }), BLOCKS, {
859
848
  value: {},
860
849
  writable: true,
861
850
  configurable: false,
862
851
  enumerable: false
863
- }), _defineProperty(_Object$definePropert, MACRO, {
852
+ }), MACRO, {
864
853
  value: {},
865
854
  writable: true,
866
855
  configurable: false,
867
856
  enumerable: false
868
- }), _defineProperty(_Object$definePropert, LAYOUT, {
857
+ }), LAYOUT, {
869
858
  value: false,
870
859
  writable: true,
871
860
  configurable: false,
872
861
  enumerable: false
873
- }), _defineProperty(_Object$definePropert, EXTEND, {
862
+ }), EXTEND, {
874
863
  value: false,
875
864
  writable: true,
876
865
  configurable: false,
877
866
  enumerable: false
878
- }), _defineProperty(_Object$definePropert, "getMacro", {
867
+ }), "getMacro", {
879
868
  value: function value() {
880
869
  return this[MACRO];
881
870
  },
882
871
  writable: false,
883
872
  configurable: false,
884
873
  enumerable: false
885
- }), _defineProperty(_Object$definePropert, "getBuffer", {
874
+ }), "getBuffer", {
886
875
  value: function value() {
887
876
  return this[BUFFER];
888
877
  },
889
878
  writable: false,
890
879
  configurable: false,
891
880
  enumerable: false
892
- }), _defineProperty(_Object$definePropert, "getComponent", {
881
+ }), "getComponent", {
893
882
  value: function value() {
894
883
  var context = this;
895
884
  if (COMPONENT in context) {
@@ -904,42 +893,42 @@
904
893
  writable: false,
905
894
  configurable: false,
906
895
  enumerable: false
907
- }), _defineProperty(_Object$definePropert, "getBlocks", {
896
+ }), "getBlocks", {
908
897
  value: function value() {
909
898
  return this[BLOCKS];
910
899
  },
911
900
  writable: false,
912
901
  configurable: false,
913
902
  enumerable: false
914
- }), _defineProperty(_Object$definePropert, "setExtend", {
903
+ }), "setExtend", {
915
904
  value: function value(_value) {
916
905
  this[EXTEND] = _value;
917
906
  },
918
907
  writable: false,
919
908
  configurable: false,
920
909
  enumerable: false
921
- }), _defineProperty(_Object$definePropert, "getExtend", {
910
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$definePropert, "getExtend", {
922
911
  value: function value() {
923
912
  return this[EXTEND];
924
913
  },
925
914
  writable: false,
926
915
  configurable: false,
927
916
  enumerable: false
928
- }), _defineProperty(_Object$definePropert, "setLayout", {
917
+ }), "setLayout", {
929
918
  value: function value(layout) {
930
919
  this[LAYOUT] = layout;
931
920
  },
932
921
  writable: false,
933
922
  configurable: false,
934
923
  enumerable: false
935
- }), _defineProperty(_Object$definePropert, "getLayout", {
924
+ }), "getLayout", {
936
925
  value: function value() {
937
926
  return this[LAYOUT];
938
927
  },
939
928
  writable: false,
940
929
  configurable: false,
941
930
  enumerable: false
942
- }), _defineProperty(_Object$definePropert, "clone", {
931
+ }), "clone", {
943
932
  value: function value(exclude_blocks) {
944
933
  var filter = [LAYOUT, EXTEND, BUFFER];
945
934
  if (exclude_blocks === true) {
@@ -950,7 +939,7 @@
950
939
  writable: false,
951
940
  configurable: false,
952
941
  enumerable: false
953
- }), _defineProperty(_Object$definePropert, "extend", {
942
+ }), "extend", {
954
943
  value: function value(layout) {
955
944
  this.setExtend(true);
956
945
  this.setLayout(layout);
@@ -958,7 +947,7 @@
958
947
  writable: false,
959
948
  configurable: false,
960
949
  enumerable: false
961
- }), _defineProperty(_Object$definePropert, "echo", {
950
+ }), "echo", {
962
951
  value: function value(layout) {
963
952
  var buffer = this.getBuffer();
964
953
  var params = [].slice.call(arguments);
@@ -967,7 +956,7 @@
967
956
  writable: false,
968
957
  configurable: false,
969
958
  enumerable: false
970
- }), _defineProperty(_Object$definePropert, "fn", {
959
+ }), "fn", {
971
960
  value: function value(callback) {
972
961
  var buffer = this.getBuffer();
973
962
  var context = this;
@@ -982,7 +971,7 @@
982
971
  writable: false,
983
972
  configurable: false,
984
973
  enumerable: false
985
- }), _defineProperty(_Object$definePropert, "get", {
974
+ }), "get", {
986
975
  value: function value(name, defaults) {
987
976
  var path = getPath(this, name, true);
988
977
  var result = path.shift();
@@ -992,7 +981,7 @@
992
981
  writable: true,
993
982
  configurable: true,
994
983
  enumerable: false
995
- }), _defineProperty(_Object$definePropert, "set", {
984
+ }), "set", {
996
985
  value: function value(name, _value2) {
997
986
  var path = getPath(this, name, false);
998
987
  var result = path.shift();
@@ -1005,7 +994,7 @@
1005
994
  writable: false,
1006
995
  configurable: false,
1007
996
  enumerable: false
1008
- }), _defineProperty(_Object$definePropert, "macro", {
997
+ }), "macro", {
1009
998
  value: function value(name, callback) {
1010
999
  var list = this.getMacro();
1011
1000
  var macro = this.fn(callback);
@@ -1017,7 +1006,7 @@
1017
1006
  writable: false,
1018
1007
  configurable: false,
1019
1008
  enumerable: false
1020
- }), _defineProperty(_Object$definePropert, "call", {
1009
+ }), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_Object$definePropert, "call", {
1021
1010
  value: function value(name) {
1022
1011
  var list = this.getMacro();
1023
1012
  var macro = list[name];
@@ -1029,7 +1018,7 @@
1029
1018
  writable: false,
1030
1019
  configurable: false,
1031
1020
  enumerable: false
1032
- }), _defineProperty(_Object$definePropert, "block", {
1021
+ }), "block", {
1033
1022
  value: function value(name, callback) {
1034
1023
  var _this = this;
1035
1024
  var blocks = this.getBlocks();
@@ -1040,29 +1029,29 @@
1040
1029
  var current = function current() {
1041
1030
  return list.shift();
1042
1031
  };
1043
- var next = function next() {
1032
+ var _next = function next() {
1044
1033
  var parent = current();
1045
1034
  if (parent) {
1046
1035
  return function () {
1047
- _this.echo(parent(next()));
1036
+ _this.echo(parent(_next()));
1048
1037
  };
1049
1038
  } else {
1050
1039
  return noop;
1051
1040
  }
1052
1041
  };
1053
- this.echo(current()(next()));
1042
+ this.echo(current()(_next()));
1054
1043
  },
1055
1044
  writable: false,
1056
1045
  configurable: false,
1057
1046
  enumerable: false
1058
- }), _defineProperty(_Object$definePropert, "hasBlock", {
1047
+ }), "hasBlock", {
1059
1048
  value: function value(name) {
1060
1049
  return this.getBlocks().hasOwnProperty(name);
1061
1050
  },
1062
1051
  writable: false,
1063
1052
  configurable: false,
1064
1053
  enumerable: false
1065
- }), _defineProperty(_Object$definePropert, "include", {
1054
+ }), "include", {
1066
1055
  value: function value(path, data, cx) {
1067
1056
  var context = cx === false ? {} : this.clone(true);
1068
1057
  var params = extend(context, data || {});
@@ -1072,7 +1061,7 @@
1072
1061
  writable: false,
1073
1062
  configurable: false,
1074
1063
  enumerable: false
1075
- }), _defineProperty(_Object$definePropert, "use", {
1064
+ }), "use", {
1076
1065
  value: function value(path, namespace) {
1077
1066
  var promise = this.require(path);
1078
1067
  this.echo(resolve$1(promise, function (exports) {
@@ -1085,7 +1074,7 @@
1085
1074
  writable: false,
1086
1075
  configurable: false,
1087
1076
  enumerable: false
1088
- }), _defineProperty(_Object$definePropert, "async", {
1077
+ }), "async", {
1089
1078
  value: function value(promise, callback) {
1090
1079
  this.echo(resolve$1(promise, function (data) {
1091
1080
  return this.fn(callback)(data);
@@ -1094,7 +1083,7 @@
1094
1083
  writable: false,
1095
1084
  configurable: false,
1096
1085
  enumerable: false
1097
- }), _defineProperty(_Object$definePropert, "each", {
1086
+ }), "each", {
1098
1087
  value: function value(object, callback) {
1099
1088
  if (isString(object)) {
1100
1089
  object = this.get(object, []);
@@ -1104,14 +1093,14 @@
1104
1093
  writable: false,
1105
1094
  configurable: false,
1106
1095
  enumerable: false
1107
- }), _defineProperty(_Object$definePropert, "element", {
1096
+ }), "element", {
1108
1097
  value: function value(tag, attr, content) {
1109
1098
  return element(tag, attr, content);
1110
1099
  },
1111
1100
  writable: false,
1112
1101
  configurable: false,
1113
1102
  enumerable: false
1114
- }), _defineProperty(_Object$definePropert, "el", {
1103
+ }), "el", {
1115
1104
  value: function value(tag, attr, content) {
1116
1105
  if (isFunction(content)) {
1117
1106
  content = this.fn(content)();
@@ -1123,7 +1112,7 @@
1123
1112
  writable: false,
1124
1113
  configurable: false,
1125
1114
  enumerable: false
1126
- }), _Object$definePropert));
1115
+ })));
1127
1116
  };
1128
1117
  this.configure(config);
1129
1118
  }
@@ -1155,7 +1144,7 @@
1155
1144
  return scope.getMacro();
1156
1145
  });
1157
1146
  };
1158
- var render = function render(name, data) {
1147
+ var _render = function render(name, data) {
1159
1148
  var filepath = ext(name, config.extension);
1160
1149
  var scope = context.create(data);
1161
1150
  return output(filepath, scope).then(function (content) {
@@ -1163,7 +1152,7 @@
1163
1152
  scope.setExtend(false);
1164
1153
  var layout = scope.getLayout();
1165
1154
  var _data = scope.clone();
1166
- return render(layout, _data);
1155
+ return _render(layout, _data);
1167
1156
  }
1168
1157
  return content;
1169
1158
  });
@@ -1178,7 +1167,7 @@
1178
1167
  return config;
1179
1168
  };
1180
1169
  this.render = function (name, data) {
1181
- return render(name, data);
1170
+ return _render(name, data);
1182
1171
  };
1183
1172
  this.helpers = function (methods) {
1184
1173
  context.helpers(extend(scope, methods));
@@ -1197,7 +1186,7 @@
1197
1186
  };
1198
1187
  this.helpers({
1199
1188
  require: require,
1200
- render: render
1189
+ render: _render
1201
1190
  });
1202
1191
  return this;
1203
1192
  }
@@ -1244,7 +1233,7 @@
1244
1233
  _ref$version = _ref.version,
1245
1234
  version = _ref$version === void 0 ? '1.0' : _ref$version;
1246
1235
  return /*#__PURE__*/function () {
1247
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(c, next) {
1236
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(c, next) {
1248
1237
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1249
1238
  while (1) switch (_context.prev = _context.next) {
1250
1239
  case 0:
@@ -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(){e=function(){return n};var t,n={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new N(r||[]);return i(a,"_invoke",{value:P(t,n,c)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=f;var p="suspendedStart",v="suspendedYield",g="executing",b="completed",m={};function d(){}function y(){}function w(){}var x={};l(x,c,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(B([])));j&&j!==r&&o.call(j,c)&&(x=j);var O=w.prototype=d.prototype=Object.create(x);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(r,i,a,c){var u=h(t[r],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function P(e,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=F(c,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?b:v,s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=b,r.method="throw",r.arg=s.arg)}}}function F(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,F(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=w,i(O,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=l(w,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},n.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,u,(function(){return this})),n.AsyncIterator=k,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new k(f(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(O),l(O,s,"Generator"),l(O,c,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=B,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},n}function n(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function r(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var o=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},i=function(t){return Array.isArray(t)},a=function(t){return"function"==typeof t},c=function(t){return"string"==typeof t},u=function(t){return"boolean"==typeof t},s=function(t){return void 0===t},l="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),f={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},p=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},v=p(h),g=p(f),b=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(v,(function(t){return h[t]}))},m=function(t,e){var n=t;return null==n?"":!0===e?b(n):n},d=function(t,e){return Boolean(t instanceof e)},y=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),c=0;c<o.length;c++){var u=o[c];if(a(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(u)){r={};break}r=r[u]=r[u]||{}}return a(r.toJSON)&&(r=r.toJSON()),[r,i]},w=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},x=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)},E=function(){},j=function(t,e){var n;for(n in t)k(t,n)&&e(t[n],n,t)},O=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return j(t,(function(t,o,i){var a=e(t,o,i);!1===s(a)&&(n?r.push(a):r[o]=a)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},L=function(t,e,n){return Promise.resolve(t).then(e.bind(n))},k=function(t,e){return t&&t.hasOwnProperty(e)},P={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]+?)"}},F=function(t,e){x(t,{path:o(c,P.path,t.path,e.path),export:o(c,P.export,t.export,e.export),resolver:o(a,P.resolver,t.resolver,e.resolver),extension:o(c,P.extension,t.extension,e.extension),withObject:o(u,P.withObject,t.withObject,e.withObject),rmWhitespace:o(u,P.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:o(u,P.cache,t.cache,e.cache),token:x({},P.token,t.token,e.token),vars:x({},P.vars,t.vars,e.vars),globalHelpers:o(i,P.globalHelpers,t.globalHelpers,e.globalHelpers)})},S="undefined"!=typeof globalThis?globalThis:window||self;function T(t){if(!1===d(this,T))return new T;var e={enabled:!0,list:{}};this.configure=function(t){e.enabled=t.cache,!1===l&&this.load(S[t.export])},this.clear=function(){e.list={}},this.load=function(t){return e.enabled&&x(e.list,t||{}),this},this.get=function(t){if(e.enabled)return e.list[t]},this.set=function(t,n){return e.enabled&&(e.list[t]=n),this},this.resolve=function(t){return Promise.resolve(this.get(t))},this.remove=function(t){delete e.list[t]},this.exist=function(t){return k(e.list,t)}}var N=[{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 B(t){if(!1===d(this,B))return new B(t);var e={};this.configure=function(t){e.withObject=t.withObject,e.rmWhitespace=t.rmWhitespace,e.token=t.token,e.vars=t.vars,e.globalHelpers=t.globalHelpers,e.matches=[],e.formats=[],e.slurp={match:"[ \\t]*",start:[e.token.start,"_"],end:["_",e.token.end]},N.forEach((function(t){e.matches.push(e.token.start.concat(t.symbol).concat(e.token.regex).concat(e.token.end)),e.formats.push(t.format.bind(e.vars))})),e.regex=new RegExp(e.matches.join("|").concat("|$"),"g"),e.slurpStart=new RegExp([e.slurp.match,e.slurp.start.join("")].join(""),"gm"),e.slurpEnd=new RegExp([e.slurp.end.join(""),e.slurp.match].join(""),"gm")},this.compile=function(t,n){var r=e.vars,o=r.SCOPE,i=r.SAFE,a=r.BUFFER,c=r.COMPONENT,u=e.globalHelpers;t=String(t),e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=t.replace(e.slurpStart,e.token.start).replace(e.slurpEnd,e.token.end);var s,l,h,p="".concat(a,"('");s=e.regex,l=function(n,r,o){p+=(""+t.slice(r,o)).replace(g,(function(t){return"\\"+f[t]})),n.forEach((function(t,n){t&&(p+=e.formats[n](t))}))},h=0,t.replace(s,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,h,e),h=e+n.length,n})),p="try{".concat(p+="');","}catch(e){return ").concat(a,".error(e)}"),e.withObject&&(p="with(".concat(o,"){").concat(p,"}")),p="".concat(a,".start();").concat(p,"return ").concat(a,".end();"),p+="\n//# sourceURL=".concat(n);var v=null,b=[o,c,a,i].concat(u);try{(v=Function.apply(null,b.concat(p))).source="(function(".concat(b.join(","),"){\n").concat(p,"\n})")}catch(t){throw t.filename=n,t.source=p,t}return v},this.configure(t)}function R(t,e,n){if(!1===d(this,R))return new R(t,e,n);if(!1===d(e,T))throw new TypeError("cache is not instance of Cache");if(!1===d(n,B))throw new TypeError("compiler is not instance of Compiler");var r={},o=function(t){return r.resolver(r.path,t)};this.configure=function(t){r.path=t.path,r.cache=t.cache,a(t.resolver)&&(r.resolver=t.resolver)},this.get=function(t){return e.exist(t)?e.resolve(t):o(t).then((function(r){return function(t,n){return e.set(t,n),n}(t,function(t,e){return a(t)?t:n.compile(t,e)}(r,t))}))},this.configure(t)}var _=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],A=" ",$='"',C="/",U="<",M=">",H=function(t,e,n){var r=[],o=-1===_.indexOf(t),i=function(t,e){var n=[];return j(t,(function(t,r,o){var i=e(t,r,o);!1===s(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[b(e),[$,b(t),$].join("")].join("=")})).join(A);return r.push([U,t,A,i,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),o&&r.push([U,C,t,M].join("")),r.join("")};function G(t){this.code=1,this.name="TemplateError",this.message=t,Error.call(this)}function W(t){G.call(this),this.code=404,this.name="TemplateNotFound",this.message=t}function q(t){G.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=t}function J(t){return Promise.all(t||[]).then((function(t){return t.join("")}))}function Y(){var t=[],e=[];function n(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(),J(n)},n.error=function(t){return e=t,Promise.reject(new q(e.message));var e},n.end=function(){return J(e)},n}function I(t){if(!1===d(this,I))return new I(t);this.configure=function(t,e){var n,o=t.vars,i=o.BLOCKS,u=o.MACRO,s=o.EXTEND,l=o.LAYOUT,f=o.BUFFER,h=o.COMPONENT;function p(t){this[i]={},this[u]={},x(this,t||{})}this.create=function(t){return new p(t)},this.helpers=function(t){x(p.prototype,t||{})},p.prototype=x({},e||{}),Object.defineProperties(p.prototype,(r(n={},f,{value:Y(),writable:!0,configurable:!1,enumerable:!1}),r(n,i,{value:{},writable:!0,configurable:!1,enumerable:!1}),r(n,u,{value:{},writable:!0,configurable:!1,enumerable:!1}),r(n,l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),r(n,s,{value:!1,writable:!0,configurable:!1,enumerable:!1}),r(n,"getMacro",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),r(n,"getBuffer",{value:function(){return this[f]},writable:!1,configurable:!1,enumerable:!1}),r(n,"getComponent",{value:function(){var t=this;return h in t?function(){return t[h].apply(t,arguments)}:function(){console.log("%s function not defined",h)}},writable:!1,configurable:!1,enumerable:!1}),r(n,"getBlocks",{value:function(){return this[i]},writable:!1,configurable:!1,enumerable:!1}),r(n,"setExtend",{value:function(t){this[s]=t},writable:!1,configurable:!1,enumerable:!1}),r(n,"getExtend",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),r(n,"setLayout",{value:function(t){this[l]=t},writable:!1,configurable:!1,enumerable:!1}),r(n,"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),r(n,"clone",{value:function(t){var e=[l,s,f];return!0===t&&e.push(i),O(this,e)},writable:!1,configurable:!1,enumerable:!1}),r(n,"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)},writable:!1,configurable:!1,enumerable:!1}),r(n,"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)},writable:!1,configurable:!1,enumerable:!1}),r(n,"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){return e.backup(),a(t)&&t.apply(n,arguments),e.restore()}},writable:!1,configurable:!1,enumerable:!1}),r(n,"get",{value:function(t,e){var n=y(this,t,!0),r=n.shift(),o=n.pop();return k(r,o)?r[o]:e},writable:!0,configurable:!0,enumerable:!1}),r(n,"set",{value:function(t,e){var n=y(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&k(r,o)?r[o]:r[o]=e},writable:!1,configurable:!1,enumerable:!1}),r(n,"macro",{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),r(n,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(a(e))return e.apply(e,n)},writable:!1,configurable:!1,enumerable:!1}),r(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 o=Object.assign([],r[t]),i=function(){return o.shift()};this.echo(i()(function t(){var e=i();return e?function(){n.echo(e(t()))}:E}()))}},writable:!1,configurable:!1,enumerable:!1}),r(n,"hasBlock",{value:function(t){return this.getBlocks().hasOwnProperty(t)},writable:!1,configurable:!1,enumerable:!1}),r(n,"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=x(r,e||{}),i=this.render(t,o);this.echo(i)},writable:!1,configurable:!1,enumerable:!1}),r(n,"use",{value:function(t,e){var n=this.require(t);this.echo(L(n,(function(t){var n=this.getMacro();j(t,(function(t,r){n[[e,r].join(".")]=t}))}),this))},writable:!1,configurable:!1,enumerable:!1}),r(n,"async",{value:function(t,e){this.echo(L(t,(function(t){return this.fn(e)(t)}),this))},writable:!1,configurable:!1,enumerable:!1}),r(n,"each",{value:function(t,e){c(t)&&(t=this.get(t,[])),j(t,e)},writable:!1,configurable:!1,enumerable:!1}),r(n,"element",{value:function(t,e,n){return H(t,e,n)},writable:!1,configurable:!1,enumerable:!1}),r(n,"el",{value:function(t,e,n){a(n)&&(n=this.fn(n)()),this.echo(L(n,(function(n){return this.element(t,e,n)}),this))},writable:!1,configurable:!1,enumerable:!1}),n))},this.configure(t)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,G.prototype),Object.setPrototypeOf(q.prototype,G.prototype);var D={},K=new function t(e){if(!1===d(this,t))return new t(e);var n={},r={};F(r,e||{});var o=new I(r),i=new B(r),c=new T,u=new R(r,c,i),s=function(t,e){var n=r.globalHelpers,o=[e,e.getComponent(),e.getBuffer(),m].concat(n.filter((function(t){return a(e[t])})).map((function(t){return e[t].bind(e)})));return u.get(t).then((function(t){return t.apply(e,o)}))},l=function t(e,n){var i=w(e,r.extension),a=o.create(n);return s(i,a).then((function(e){if(a.getExtend()){a.setExtend(!1);var n=a.getLayout(),r=a.clone();return t(n,r)}return e}))};return this.configure=function(t){return F(r,t=t||{}),o.configure(r,n),i.configure(r),c.configure(r),u.configure(r),r},this.render=function(t,e){return l(t,e)},this.helpers=function(t){o.helpers(x(n,t))},this.preload=function(t){return c.load(t||{})},this.create=function(e){return new t(e)},this.compile=function(t,e){return i.compile(t,e)},this.context=function(t){return o.create(t)},this.helpers({require:function(t){var e=w(t,r.extension),n=o.create({});return s(e,n).then((function(){return n.getMacro()}))},render:l}),this}({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){D.hasOwnProperty(e)?t(D[e]):n(new W("template ".concat(e," not found")))}))}}),X=function(t,e){return t=new URL(t),e&&(t.protocol="https:"),t.origin};var z=K.render,Q=K.context,V=K.compile,Z=K.helpers,tt=K.preload,et=K.configure,nt=K.create;t.compile=V,t.configure=et,t.context=Q,t.create=nt,t.helpers=Z,t.preload=tt,t.render=z,t.setRenderer=function(t){var r=t.secure,o=void 0===r||r,i=t.version,a=void 0===i?"1.0":i;return function(){var t,r=(t=e().mark((function t(n,r){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.data=Q({}),n.data.set("version",a),n.data.set("origin",X(n.req.url,o)),n.ejs=function(t,e){return z(t,Object.assign({},n.data,e))},n.render=function(t,e){return n.html(n.ejs(t,e))},t.next=7,r();case 7:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(t,e){return r.apply(this,arguments)}}()},t.setTemplates=function(t){Object.assign(D,t||{})}}));
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,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function n(t,e,n){return(e=function(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||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(){r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new N(r||[]);return i(a,"_invoke",{value:P(t,n,c)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p="suspendedStart",v="suspendedYield",g="executing",b="completed",m={};function d(){}function y(){}function w(){}var x={};l(x,c,(function(){return this}));var E=Object.getPrototypeOf,j=E&&E(E(B([])));j&&j!==n&&o.call(j,c)&&(x=j);var O=w.prototype=d.prototype=Object.create(x);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(r,i,a,c){var u=h(t[r],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var r;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,r){n(t,o,e,r)}))}return r=r?r.then(i,i):i()}})}function P(e,n,r){var o=p;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===b){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var u=F(c,r);if(u){if(u===m)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=b,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var s=h(e,n,r);if("normal"===s.type){if(o=r.done?b:v,s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=b,r.method="throw",r.arg=s.arg)}}}function F(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,F(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function n(){for(;++r<e.length;)if(o.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=w,i(O,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=l(w,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,s,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},L(k.prototype),l(k.prototype,u,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(f(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(O),l(O,s,"Generator"),l(O,c,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=B,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:B(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var o=function(){var t=[].slice.call(arguments),e=t.shift();return t.filter(e).pop()},i=function(t){return Array.isArray(t)},a=function(t){return"function"==typeof t},c=function(t){return"string"==typeof t},u=function(t){return"boolean"==typeof t},s=function(t){return void 0===t},l="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),f={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},p=function(t){return new RegExp(["[",Object.keys(t).join(""),"]"].join(""),"g")},v=p(h),g=p(f),b=function(){return(""+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")).replace(v,(function(t){return h[t]}))},m=function(t,e){var n=t;return null==n?"":!0===e?b(n):n},d=function(t,e){return Boolean(t instanceof e)},y=function(t,e,n){for(var r=t,o=String(e).split("."),i=o.pop(),c=0;c<o.length;c++){var u=o[c];if(a(r.toJSON)&&(r=r.toJSON()),n&&!1===r.hasOwnProperty(u)){r={};break}r=r[u]=r[u]||{}}return a(r.toJSON)&&(r=r.toJSON()),[r,i]},w=function(t,e){var n=t.split(".").pop();return n!==e&&(t=[t,e].join(".")),t},x=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)},E=function(){},j=function(t,e){var n;for(n in t)k(t,n)&&e(t[n],n,t)},O=function(t,e){return function(t,e){var n=t instanceof Array,r=n?[]:{};return j(t,(function(t,o,i){var a=e(t,o,i);!1===s(a)&&(n?r.push(a):r[o]=a)})),r}(t,(function(t,n){if(-1===e.indexOf(n))return t}))},L=function(t,e,n){return Promise.resolve(t).then(e.bind(n))},k=function(t,e){return t&&t.hasOwnProperty(e)},P={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]+?)"}},F=function(t,e){x(t,{path:o(c,P.path,t.path,e.path),export:o(c,P.export,t.export,e.export),resolver:o(a,P.resolver,t.resolver,e.resolver),extension:o(c,P.extension,t.extension,e.extension),withObject:o(u,P.withObject,t.withObject,e.withObject),rmWhitespace:o(u,P.rmWhitespace,t.rmWhitespace,e.rmWhitespace),cache:o(u,P.cache,t.cache,e.cache),token:x({},P.token,t.token,e.token),vars:x({},P.vars,t.vars,e.vars),globalHelpers:o(i,P.globalHelpers,t.globalHelpers,e.globalHelpers)})},S="undefined"!=typeof globalThis?globalThis:window||self;function T(t){if(!1===d(this,T))return new T;var e={enabled:!0,list:{}};this.configure=function(t){e.enabled=t.cache,!1===l&&this.load(S[t.export])},this.clear=function(){e.list={}},this.load=function(t){return e.enabled&&x(e.list,t||{}),this},this.get=function(t){if(e.enabled)return e.list[t]},this.set=function(t,n){return e.enabled&&(e.list[t]=n),this},this.resolve=function(t){return Promise.resolve(this.get(t))},this.remove=function(t){delete e.list[t]},this.exist=function(t){return k(e.list,t)}}var N=[{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 B(t){if(!1===d(this,B))return new B(t);var e={};this.configure=function(t){e.withObject=t.withObject,e.rmWhitespace=t.rmWhitespace,e.token=t.token,e.vars=t.vars,e.globalHelpers=t.globalHelpers,e.matches=[],e.formats=[],e.slurp={match:"[ \\t]*",start:[e.token.start,"_"],end:["_",e.token.end]},N.forEach((function(t){e.matches.push(e.token.start.concat(t.symbol).concat(e.token.regex).concat(e.token.end)),e.formats.push(t.format.bind(e.vars))})),e.regex=new RegExp(e.matches.join("|").concat("|$"),"g"),e.slurpStart=new RegExp([e.slurp.match,e.slurp.start.join("")].join(""),"gm"),e.slurpEnd=new RegExp([e.slurp.end.join(""),e.slurp.match].join(""),"gm")},this.compile=function(t,n){var r=e.vars,o=r.SCOPE,i=r.SAFE,a=r.BUFFER,c=r.COMPONENT,u=e.globalHelpers;t=String(t),e.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),t=t.replace(e.slurpStart,e.token.start).replace(e.slurpEnd,e.token.end);var s,l,h,p="".concat(a,"('");s=e.regex,l=function(n,r,o){p+=(""+t.slice(r,o)).replace(g,(function(t){return"\\"+f[t]})),n.forEach((function(t,n){t&&(p+=e.formats[n](t))}))},h=0,t.replace(s,(function(){var t=[].slice.call(arguments,0,-1),e=t.pop(),n=t.shift();return l(t,h,e),h=e+n.length,n})),p="try{".concat(p+="');","}catch(e){return ").concat(a,".error(e)}"),e.withObject&&(p="with(".concat(o,"){").concat(p,"}")),p="".concat(a,".start();").concat(p,"return ").concat(a,".end();"),p+="\n//# sourceURL=".concat(n);var v=null,b=[o,c,a,i].concat(u);try{(v=Function.apply(null,b.concat(p))).source="(function(".concat(b.join(","),"){\n").concat(p,"\n})")}catch(t){throw t.filename=n,t.source=p,t}return v},this.configure(t)}function R(t,e,n){if(!1===d(this,R))return new R(t,e,n);if(!1===d(e,T))throw new TypeError("cache is not instance of Cache");if(!1===d(n,B))throw new TypeError("compiler is not instance of Compiler");var r={},o=function(t){return r.resolver(r.path,t)};this.configure=function(t){r.path=t.path,r.cache=t.cache,a(t.resolver)&&(r.resolver=t.resolver)},this.get=function(t){return e.exist(t)?e.resolve(t):o(t).then((function(r){return function(t,n){return e.set(t,n),n}(t,function(t,e){return a(t)?t:n.compile(t,e)}(r,t))}))},this.configure(t)}var _=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],A=" ",$='"',C="/",U="<",M=">",H=function(t,e,n){var r=[],o=-1===_.indexOf(t),i=function(t,e){var n=[];return j(t,(function(t,r,o){var i=e(t,r,o);!1===s(i)&&n.push(i)})),n}(e,(function(t,e){if(null!=t)return[b(e),[$,b(t),$].join("")].join("=")})).join(A);return r.push([U,t,A,i,M].join("")),n&&r.push(n instanceof Array?n.join(""):n),o&&r.push([U,C,t,M].join("")),r.join("")};function G(t){this.code=1,this.name="TemplateError",this.message=t,Error.call(this)}function W(t){G.call(this),this.code=404,this.name="TemplateNotFound",this.message=t}function q(t){G.call(this),this.code=500,this.name="TemplateSyntaxError",this.message=t}function J(t){return Promise.all(t||[]).then((function(t){return t.join("")}))}function Y(){var t=[],e=[];function n(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(),J(n)},n.error=function(t){return e=t,Promise.reject(new q(e.message));var e},n.end=function(){return J(e)},n}function I(t){if(!1===d(this,I))return new I(t);this.configure=function(t,e){var r,o=t.vars,i=o.BLOCKS,u=o.MACRO,s=o.EXTEND,l=o.LAYOUT,f=o.BUFFER,h=o.COMPONENT;function p(t){this[i]={},this[u]={},x(this,t||{})}this.create=function(t){return new p(t)},this.helpers=function(t){x(p.prototype,t||{})},p.prototype=x({},e||{}),Object.defineProperties(p.prototype,(n(n(n(n(n(n(n(n(n(n(r={},f,{value:Y(),writable:!0,configurable:!1,enumerable:!1}),i,{value:{},writable:!0,configurable:!1,enumerable:!1}),u,{value:{},writable:!0,configurable:!1,enumerable:!1}),l,{value:!1,writable:!0,configurable:!1,enumerable:!1}),s,{value:!1,writable:!0,configurable:!1,enumerable:!1}),"getMacro",{value:function(){return this[u]},writable:!1,configurable:!1,enumerable:!1}),"getBuffer",{value:function(){return this[f]},writable:!1,configurable:!1,enumerable:!1}),"getComponent",{value:function(){var t=this;return h in t?function(){return t[h].apply(t,arguments)}:function(){console.log("%s function not defined",h)}},writable:!1,configurable:!1,enumerable:!1}),"getBlocks",{value:function(){return this[i]},writable:!1,configurable:!1,enumerable:!1}),"setExtend",{value:function(t){this[s]=t},writable:!1,configurable:!1,enumerable:!1}),n(n(n(n(n(n(n(n(n(n(r,"getExtend",{value:function(){return this[s]},writable:!1,configurable:!1,enumerable:!1}),"setLayout",{value:function(t){this[l]=t},writable:!1,configurable:!1,enumerable:!1}),"getLayout",{value:function(){return this[l]},writable:!1,configurable:!1,enumerable:!1}),"clone",{value:function(t){var e=[l,s,f];return!0===t&&e.push(i),O(this,e)},writable:!1,configurable:!1,enumerable:!1}),"extend",{value:function(t){this.setExtend(!0),this.setLayout(t)},writable:!1,configurable:!1,enumerable:!1}),"echo",{value:function(t){var e=this.getBuffer();[].slice.call(arguments).forEach(e)},writable:!1,configurable:!1,enumerable:!1}),"fn",{value:function(t){var e=this.getBuffer(),n=this;return function(){return e.backup(),a(t)&&t.apply(n,arguments),e.restore()}},writable:!1,configurable:!1,enumerable:!1}),"get",{value:function(t,e){var n=y(this,t,!0),r=n.shift(),o=n.pop();return k(r,o)?r[o]:e},writable:!0,configurable:!0,enumerable:!1}),"set",{value:function(t,e){var n=y(this,t,!1),r=n.shift(),o=n.pop();return this.getExtend()&&k(r,o)?r[o]:r[o]=e},writable:!1,configurable:!1,enumerable:!1}),"macro",{value:function(t,e){var n=this.getMacro(),r=this.fn(e),o=this;n[t]=function(){return o.echo(r.apply(void 0,arguments))}},writable:!1,configurable:!1,enumerable:!1}),n(n(n(n(n(n(n(n(n(r,"call",{value:function(t){var e=this.getMacro()[t],n=[].slice.call(arguments,1);if(a(e))return e.apply(e,n)},writable:!1,configurable:!1,enumerable:!1}),"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 o=Object.assign([],r[t]),i=function(){return o.shift()},a=function(){var t=i();return t?function(){n.echo(t(a()))}:E};this.echo(i()(a()))}},writable:!1,configurable:!1,enumerable:!1}),"hasBlock",{value:function(t){return this.getBlocks().hasOwnProperty(t)},writable:!1,configurable:!1,enumerable:!1}),"include",{value:function(t,e,n){var r=!1===n?{}:this.clone(!0),o=x(r,e||{}),i=this.render(t,o);this.echo(i)},writable:!1,configurable:!1,enumerable:!1}),"use",{value:function(t,e){var n=this.require(t);this.echo(L(n,(function(t){var n=this.getMacro();j(t,(function(t,r){n[[e,r].join(".")]=t}))}),this))},writable:!1,configurable:!1,enumerable:!1}),"async",{value:function(t,e){this.echo(L(t,(function(t){return this.fn(e)(t)}),this))},writable:!1,configurable:!1,enumerable:!1}),"each",{value:function(t,e){c(t)&&(t=this.get(t,[])),j(t,e)},writable:!1,configurable:!1,enumerable:!1}),"element",{value:function(t,e,n){return H(t,e,n)},writable:!1,configurable:!1,enumerable:!1}),"el",{value:function(t,e,n){a(n)&&(n=this.fn(n)()),this.echo(L(n,(function(n){return this.element(t,e,n)}),this))},writable:!1,configurable:!1,enumerable:!1})))},this.configure(t)}Object.setPrototypeOf(W.prototype,Error.prototype),Object.setPrototypeOf(W.prototype,G.prototype),Object.setPrototypeOf(q.prototype,G.prototype);var D={},K=new function t(e){if(!1===d(this,t))return new t(e);var n={},r={};F(r,e||{});var o=new I(r),i=new B(r),c=new T,u=new R(r,c,i),s=function(t,e){var n=r.globalHelpers,o=[e,e.getComponent(),e.getBuffer(),m].concat(n.filter((function(t){return a(e[t])})).map((function(t){return e[t].bind(e)})));return u.get(t).then((function(t){return t.apply(e,o)}))},l=function(t,e){var n=w(t,r.extension),i=o.create(e);return s(n,i).then((function(t){if(i.getExtend()){i.setExtend(!1);var e=i.getLayout(),n=i.clone();return l(e,n)}return t}))};return this.configure=function(t){return F(r,t=t||{}),o.configure(r,n),i.configure(r),c.configure(r),u.configure(r),r},this.render=function(t,e){return l(t,e)},this.helpers=function(t){o.helpers(x(n,t))},this.preload=function(t){return c.load(t||{})},this.create=function(e){return new t(e)},this.compile=function(t,e){return i.compile(t,e)},this.context=function(t){return o.create(t)},this.helpers({require:function(t){var e=w(t,r.extension),n=o.create({});return s(e,n).then((function(){return n.getMacro()}))},render:l}),this}({cache:!1,withObject:!1,resolver:function(t,e){return new Promise((function(t,n){D.hasOwnProperty(e)?t(D[e]):n(new W("template ".concat(e," not found")))}))}}),X=function(t,e){return t=new URL(t),e&&(t.protocol="https:"),t.origin};var z=K.render,Q=K.context,V=K.compile,Z=K.helpers,tt=K.preload,et=K.configure,nt=K.create;t.compile=V,t.configure=et,t.context=Q,t.create=nt,t.helpers=Z,t.preload=tt,t.render=z,t.setRenderer=function(t){var n=t.secure,o=void 0===n||n,i=t.version,a=void 0===i?"1.0":i;return function(){var t,n=(t=r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.data=Q({}),e.data.set("version",a),e.data.set("origin",X(e.req.url,o)),e.ejs=function(t,n){return z(t,Object.assign({},e.data,n))},e.render=function(t,n){return e.html(e.ejs(t,n))},t.next=7,n();case 7:case"end":return t.stop()}}),t)})),function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(t,e){return n.apply(this,arguments)}}()},t.setTemplates=function(t){Object.assign(D,t||{})}}));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "EJS Templates",
4
4
  "homepage": "https://github.com/kosatyi/ejs",
5
5
  "type": "module",
6
- "version": "0.0.79",
6
+ "version": "0.0.81",
7
7
  "main": "dist/cjs/index.js",
8
8
  "module": "dist/esm/index.js",
9
9
  "browser": "dist/umd/browser.js",
@@ -61,11 +61,19 @@
61
61
  "nodejs"
62
62
  ],
63
63
  "peerDependencies": {
64
- "@kosatyi/rollup": "0.0.x",
65
64
  "@babel/core": "7.x",
66
65
  "@babel/preset-env": "7.x",
67
66
  "glob": "11.x",
68
- "process.argv": "0.x",
67
+ "process.argv": "1.x",
69
68
  "terser": "5.x"
69
+ },
70
+ "devDependencies": {
71
+ "@rollup/plugin-babel": "^6.0.4",
72
+ "@rollup/plugin-commonjs": "^28.0.1",
73
+ "@rollup/plugin-node-resolve": "^15.3.0",
74
+ "@rollup/plugin-terser": "^0.4.4",
75
+ "rollup": "^4.28.1",
76
+ "rollup-plugin-copy": "^3.5.0",
77
+ "rollup-plugin-ignore": "^1.0.10"
70
78
  }
71
79
  }