@rhinostone/swig 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/HISTORY.md CHANGED
@@ -1,3 +1,15 @@
1
+ [2.5.3](https://github.com/gina-io/swig/tree/v2.5.3) / 2026-06-02
2
+ -----------------------------------------------------------------
3
+
4
+ * **Changed** Dynamic `{% extends %}` on the synchronous render path now throws a clear error pointing to the async render path (`renderFile` with `loader.async === true`), instead of a generic "template not found" / "no filename" error. Dynamic extends has always required the async render path — this only improves the diagnostic. Applies to all flavors via the shared engine.
5
+
6
+ [2.5.2](https://github.com/gina-io/swig/tree/v2.5.2) / 2026-06-02
7
+ -----------------------------------------------------------------
8
+
9
+ * **Fixed** Dynamic `{% extends %}` paths (e.g. `{% extends layout_var %}`) now resolve on the async-loader render path (`renderFile(path, locals, cb)` with `loader.async`) in `@rhinostone/swig-twig` and `@rhinostone/swig-jinja2`, matching native swig and real Twig/Jinja2. Static string-literal extends and the synchronous render path are unchanged.
10
+
11
+ * **Fixed** Dynamic `{% extends %}` paths (e.g. `{% extends layout_var %}`) now resolve on the async-loader render path (`renderFile(path, locals, cb)` with `loader.async`); previously a dynamic parent path produced a garbage template lookup. Static string-literal extends and the synchronous render path are unchanged.
12
+
1
13
  [2.5.1](https://github.com/gina-io/swig/tree/v2.5.1) / 2026-05-28
2
14
  -----------------------------------------------------------------
3
15
 
package/ROADMAP.md CHANGED
@@ -14,7 +14,7 @@ _No near-term scheduled items. See [Future (post-2.0)](#future-post-20) for upco
14
14
 
15
15
  | Status | Item |
16
16
  | --- | --- |
17
- | Planned | Async parse path for dynamic targets — full support for `{% extends parent_var %}`, `{% include user_template %}`, and runtime-resolved `import` / `from` paths on the async-codegen branch. Static-target async dispatch shipped in 2.2.0; dynamic-target support is on hold pending consumer demand. |
17
+ | Planned | Async parse path for the remaining dynamic targets — runtime-resolved `{% import %}` / `{% from %}` paths on the async-codegen branch. Static-target async dispatch shipped in 2.2.0; dynamic `{% extends %}` shipped in 2.5.2 (native + Twig + Jinja2) and dynamic `{% include %}` paths already resolve (the include path has always been an expression). Dynamic `import` / `from` are on hold pending consumer demand. |
18
18
  | Planned | Ship a Django frontend as an additional `@rhinostone/swig-*` package. On demand — when there's concrete user demand. (The Jinja2 frontend shipped in `2.5.0`.) |
19
19
  | Planned | Test framework migration. Replace mocha 1.x + expect.js with `node:test` + `node:assert/strict`, add a modern browser-test harness (the legacy phantomjs runner has been removed), swap blanket for `c8`. (The Node engines bump is upstream-driven by gina and is being treated as done.) |
20
20
 
@@ -22,6 +22,16 @@ _No near-term scheduled items. See [Future (post-2.0)](#future-post-20) for upco
22
22
 
23
23
  ## Completed
24
24
 
25
+ ### v2.5.3 (June 2026)
26
+
27
+ - Dynamic `{% extends %}` on the synchronous render path now throws a clear error pointing to the async render path (`renderFile` with `loader.async === true`), instead of a generic "template not found" / "no filename" error. Dynamic extends has always required the async render path; this only improves the diagnostic. Applies to all flavors via the shared engine.
28
+ - All four packages (`@rhinostone/swig`, `@rhinostone/swig-core`, `@rhinostone/swig-twig`, `@rhinostone/swig-jinja2`) released in lockstep at `2.5.3`.
29
+
30
+ ### v2.5.2 (June 2026)
31
+
32
+ - Dynamic `{% extends %}` paths now resolve on the async render path (`renderFile(path, locals, cb)` against a loader with `loader.async === true`) across all three frontends — native `@rhinostone/swig`, `@rhinostone/swig-twig`, and `@rhinostone/swig-jinja2`. A dynamic parent (e.g. `{% extends layout_var %}`) is lowered to a deferred IR expression and resolved at render time, matching real Twig and Jinja2; previously a dynamic parent path was rejected at parse time (Twig / Jinja2) or produced a garbage template lookup (native). Static string-literal `{% extends %}` and the synchronous render path are unchanged — on the sync path a dynamic parent still requires a string literal (dispatch the chosen parent in the caller).
33
+ - All four packages (`@rhinostone/swig`, `@rhinostone/swig-core`, `@rhinostone/swig-twig`, `@rhinostone/swig-jinja2`) released in lockstep at `2.5.2`.
34
+
25
35
  ### v2.5.1 (May 2026)
26
36
 
27
37
  - Restored JSDoc on the top-level `@rhinostone/swig` public API methods (`setFilter`, `setTag`, `setExtension`, `precompile`, `compile`, `compileFile`, `render`, `renderFile`, `run`, `invalidateCache`). The blocks were inadvertently stripped from `lib/swig.js` when the Swig constructor body was carved into `@rhinostone/swig-core` during the `2.0.0-alpha.1` cycle; `make build-docs` and IDE hover tooling read from `lib/swig.js`, so the documented surface for all ten methods had been missing since the carve. Doc-only restoration; `renderFile`'s block also documents the `v2.2.0` async-codegen dispatch (set `loader.async === true` on the loader to opt in).
package/dist/swig.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Swig v2.5.1 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
1
+ /*! Swig v2.5.3 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
2
2
  /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/ocrybit/DateZ/blob/master/LISENCE */
3
3
  (() => {
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -664,11 +664,29 @@
664
664
  // lib/tags/extends.js
665
665
  var require_extends = __commonJS({
666
666
  "lib/tags/extends.js"(exports) {
667
+ var _t = require_tokentypes();
667
668
  exports.compile = function() {
668
669
  };
669
670
  exports.parse = function() {
670
671
  return true;
671
672
  };
673
+ exports.lowerExpr = function(parser, tokens) {
674
+ var i, tk, pathTokens = [];
675
+ for (i = 0; i < tokens.length; i += 1) {
676
+ tk = tokens[i];
677
+ if (tk.type === _t.WHITESPACE) {
678
+ continue;
679
+ }
680
+ pathTokens.push(tk);
681
+ }
682
+ if (!pathTokens.length) {
683
+ return void 0;
684
+ }
685
+ if (pathTokens.length === 1 && pathTokens[0].type === _t.STRING) {
686
+ return void 0;
687
+ }
688
+ return { file: parser.parseExpr(tokens) };
689
+ };
672
690
  exports.ends = false;
673
691
  }
674
692
  });
@@ -2990,7 +3008,7 @@
2990
3008
  source = source.replace(/\r\n/g, "\n");
2991
3009
  var escape = opts.autoescape, tagOpen = opts.tagControls[0], tagClose = opts.tagControls[1], varOpen = opts.varControls[0], varClose = opts.varControls[1], escapedTagOpen = escapeRegExp(tagOpen), escapedTagClose = escapeRegExp(tagClose), escapedVarOpen = escapeRegExp(varOpen), escapedVarClose = escapeRegExp(varClose), tagStrip = new RegExp("^" + escapedTagOpen + "-?\\s*|\\s*-?" + escapedTagClose + "$", "g"), tagStripBefore = new RegExp("^" + escapedTagOpen + "-"), tagStripAfter = new RegExp("-" + escapedTagClose + "$"), varStrip = new RegExp("^" + escapedVarOpen + "-?\\s*|\\s*-?" + escapedVarClose + "$", "g"), varStripBefore = new RegExp("^" + escapedVarOpen + "-"), varStripAfter = new RegExp("-" + escapedVarClose + "$"), cmtOpen = opts.cmtControls[0], cmtClose = opts.cmtControls[1], anyChar = "[\\s\\S]*?", splitter = new RegExp(
2992
3010
  "(" + escapedTagOpen + anyChar + escapedTagClose + "|" + escapedVarOpen + anyChar + escapedVarClose + "|" + escapeRegExp(cmtOpen) + anyChar + escapeRegExp(cmtClose) + ")"
2993
- ), line = 1, stack = [], parent = null, tokens = [], blocks = {}, inRaw = false, stripNext;
3011
+ ), line = 1, stack = [], parent = null, parentExpr = null, tokens = [], blocks = {}, inRaw = false, stripNext;
2994
3012
  function parseVariable(str, line2) {
2995
3013
  var tokens2 = lexer.read(utils.strip(str)), parser, node;
2996
3014
  parser = new TokenParser(tokens2, filters, escape, line2, opts.filename);
@@ -3081,6 +3099,7 @@
3081
3099
  if (token) {
3082
3100
  if (token.name === "extends") {
3083
3101
  parent = token.args.join("").replace(/^\'|\'$/g, "").replace(/^\"|\"$/g, "");
3102
+ parentExpr = token.irExpr && token.irExpr.file;
3084
3103
  } else if (token.block && !stack.length) {
3085
3104
  blocks[token.args.join("")] = token;
3086
3105
  }
@@ -3121,6 +3140,7 @@
3121
3140
  return {
3122
3141
  name: opts.filename,
3123
3142
  parent,
3143
+ parentExpr,
3124
3144
  tokens,
3125
3145
  blocks
3126
3146
  };
@@ -4388,7 +4408,7 @@
4388
4408
  }
4389
4409
  });
4390
4410
  return ir.extendsDeferred(
4391
- ir.literal("string", tokens.parent),
4411
+ tokens.parentExpr || ir.literal("string", tokens.parent),
4392
4412
  childBlocks,
4393
4413
  childIRs,
4394
4414
  options.filename || ""
@@ -4506,6 +4526,9 @@
4506
4526
  parents = [];
4507
4527
  tokens.tokens = [buildExtendsDeferred(tokens, options)];
4508
4528
  } else {
4529
+ if (tokens.parentExpr) {
4530
+ throw new Error("Dynamic {% extends %} requires the async render path \u2014 use renderFile(path, locals, cb) with a loader that sets loader.async === true.");
4531
+ }
4509
4532
  parents = getParentsInternal(tokens, options);
4510
4533
  if (parents.length) {
4511
4534
  tokens.tokens = exports.remapBlocks(tokens.blocks, parents[0].tokens);
@@ -4682,7 +4705,7 @@
4682
4705
  var loaders = require_loaders2();
4683
4706
  var preWalker = require_pre_walker();
4684
4707
  var engine = require_engine();
4685
- exports.version = "2.5.1";
4708
+ exports.version = "2.5.3";
4686
4709
  var defaultOptions = {
4687
4710
  autoescape: true,
4688
4711
  varControls: ["{{", "}}"],
@@ -4917,6 +4940,15 @@
4917
4940
  * a tight IR keeps the shape honest for future flavor backends.
4918
4941
  * @private
4919
4942
  */
4943
+ /*!
4944
+ * Lower a dynamic parent-path to IR so `{% extends layout_var %}`
4945
+ * resolves at render time on the async codegen path. A lone
4946
+ * string-literal path (`{% extends "x.html" %}`) returns undefined, so
4947
+ * the engine keeps its existing tokens.parent string + ir.literal path
4948
+ * unchanged; only a dynamic path is lowered. Mirrors include.js. The
4949
+ * resulting IRExpr is read back as token.irExpr.file by the parser
4950
+ * splitter and stashed on the sibling tokens.parentExpr slot.
4951
+ */
4920
4952
  /*!
4921
4953
  * JSON-escape a literal text chunk for embedding inside a JS
4922
4954
  * double-quoted string literal in the compiled template body.
package/dist/swig.min.js CHANGED
@@ -1,6 +1,6 @@
1
- /*! Swig v2.5.1 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
1
+ /*! Swig v2.5.3 | https://github.com/gina-io/swig | @license https://github.com/gina-io/swig/blob/master/LICENSE */
2
2
  /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/ocrybit/DateZ/blob/master/LISENCE */
3
- (()=>{var e=Object.getOwnPropertyNames,t=(t,r)=>function(){return r||(0,t[e(t)[0]])((r={exports:{}}).exports,r),r.exports},r=t({"packages/swig-core/lib/utils.js"(e){var t;e.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.each=function(e,r){var n,o;if(t(e))for(n=0,o=e.length;n<o&&!1!==r(e[n],n,e);n+=1);else for(n in e)if(e.hasOwnProperty(n)&&!1===r(e[n],n,e))break;return e},e.isArray=t=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return!!e&&("object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf())},e.some=function(r,n){var o,a,i=0;if(t(r))for(a=r.length;i<a&&!(o=n(r[i],i,r));i+=1);else e.each(r,function(e,t){return!(o=n(e,t,r))});return!!o},e.map=function(e,r){var n,o=0,a=[];if(t(e))for(n=e.length;o<n;o+=1)a[o]=r(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(a[o]=r(e[o],o));return a},e.extend=function(){for(var e,t,r=arguments,n=r[0],o=r.length>1?Array.prototype.slice.call(r,1):[],a=0,i=o.length;a<i;a+=1)for(e in t=o[a]||{})t.hasOwnProperty(e)&&(n[e]=t[e]);return n},e.keys=function(t){return t?Object.keys?Object.keys(t):e.map(t,function(e,t){return t}):[]},e.throwError=function(e,t,r){throw t&&(e+=" on line "+t),r&&(e+=" in file "+r),new Error(e+".")},e.range=function(e,t){var r,n,o,a=[];if("number"==typeof e&&"number"==typeof t){if(e<=t)for(r=e;r<=t;r+=1)a.push(r);else for(r=e;r>=t;r-=1)a.push(r);return a}if("string"==typeof e&&"string"==typeof t&&1===e.length&&1===t.length){if((n=e.charCodeAt(0))<=(o=t.charCodeAt(0)))for(r=n;r<=o;r+=1)a.push(String.fromCharCode(r));else for(r=n;r>=o;r-=1)a.push(String.fromCharCode(r));return a}return a},e.slice=function(e,t,r,n){var o,a,i,s,c,l,p="string"==typeof e,u=[];function f(e){return e=Number(e),isNaN(e)?NaN:e<0?Math.ceil(e):Math.floor(e)}function h(e,t){return null==e?t:(e=f(e),isNaN(e)?t:(e<0?(e+=o)<a&&(e=a):e>i&&(e=i),e))}if(null==e||"number"!=typeof e.length)return p?"":[];if(o=e.length,null==n?n=1:(n=f(n),(isNaN(n)||0===n)&&(n=1)),n<0?(a=-1,i=o-1):(a=0,i=o),s=h(t,n<0?i:a),c=h(r,n<0?a:i),n>0)for(l=s;l<c;l+=n)u.push(e[l]);else for(l=s;l>c;l+=n)u.push(e[l]);return p?u.join(""):u},e.coerceOutput=function(e){return null==e?"":e}}}),n=t({"lib/utils.js"(e,t){t.exports=r()}}),o=t({"packages/swig-core/lib/ir.js"(e){function t(e,t){return void 0!==t&&(e.loc=t),e}e.template=function(e,r,n,o){var a={type:"Template",body:e};return void 0!==r&&(a.parent=r),void 0!==n&&(a.blocks=n),t(a,o)},e.text=function(e,r){return t({type:"Text",value:e},r)},e.output=function(e,r,n,o){var a={type:"Output",expr:e};return void 0!==r&&(a.filters=r),void 0!==n&&(a.safe=n),t(a,o)},e.filterCall=function(e,t){var r={name:e};return void 0!==t&&(r.args=t),r},e.ifStmt=function(e,r){return t({type:"If",branches:e},r)},e.ifBranch=function(e,t){return{test:e,body:t}},e.forStmt=function(e,r,n,o,a,i){var s={type:"For",value:e,iterable:r,body:n};return void 0!==o&&(s.key=o),void 0!==a&&(s.emptyBody=a),t(s,i)},e.block=function(e,r,n){return t({type:"Block",name:e,body:r},n)},e.include=function(e,r,n,o,a,i){var s={type:"Include",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importStmt=function(e,r,n){return t({type:"Import",path:e,alias:r},n)},e.macro=function(e,r,n,o){return t({type:"Macro",name:e,params:r,body:n},o)},e.macroParam=function(e,t){var r={name:e};return void 0!==t&&(r.default=t),r},e.call=function(e,r,n){return t({type:"Call",callee:e,args:r},n)},e.set=function(e,r,n,o){return t({type:"Set",target:e,op:r,value:n},o)},e.raw=function(e,r){return t({type:"Raw",value:e},r)},e.parent=function(e,r){var n={type:"Parent"};return void 0!==e&&(n.body=e),t(n,r)},e.autoescape=function(e,r,n){return t({type:"Autoescape",strategy:e,body:r},n)},e.filter=function(e,r,n,o){var a={type:"Filter",name:e,body:r};return void 0!==n&&(a.args=n),t(a,o)},e.withStmt=function(e,r,n,o){var a={type:"With",body:n};return void 0!==e&&(a.context=e),void 0!==r&&(a.isolated=r),t(a,o)},e.legacyJS=function(e,r){return t({type:"LegacyJS",js:e},r)},e.extendsDeferred=function(e,r,n,o,a){var i={type:"ExtendsDeferred",path:e};return void 0!==r&&(i.childBlocks=r),void 0!==n&&(i.childIRs=n),void 0!==o&&(i.resolveFrom=o),t(i,a)},e.includeDeferred=function(e,r,n,o,a,i){var s={type:"IncludeDeferred",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importDeferred=function(e,r,n,o){var a={type:"ImportDeferred",path:e,alias:r};return void 0!==n&&(a.resolveFrom=n),t(a,o)},e.fromImportDeferred=function(e,r,n,o){var a={type:"FromImportDeferred",path:e,imports:r};return void 0!==n&&(a.resolveFrom=n),t(a,o)},e.literal=function(e,r,n){return t({type:"Literal",kind:e,value:r},n)},e.varRef=function(e,r){return t({type:"VarRef",path:e},r)},e.varRefExists=function(e,r){return t({type:"VarRefExists",path:e},r)},e.access=function(e,r,n){return t({type:"Access",object:e,key:r},n)},e.binaryOp=function(e,r,n,o){return t({type:"BinaryOp",op:e,left:r,right:n},o)},e.unaryOp=function(e,r,n){return t({type:"UnaryOp",op:e,operand:r},n)},e.conditional=function(e,r,n,o){var a={type:"Conditional",test:e,then:r};return a.else=n,t(a,o)},e.arrayLiteral=function(e,r){return t({type:"ArrayLiteral",elements:e},r)},e.objectLiteral=function(e,r){return t({type:"ObjectLiteral",properties:e},r)},e.objectProperty=function(e,t){return{key:e,value:t}},e.fnCall=function(e,r,n){return t({type:"FnCall",callee:e,args:r},n)},e.filterCallExpr=function(e,r,n,o){var a={type:"FilterCall",name:e,input:r};return void 0!==n&&(a.args=n),t(a,o)}}}),a=t({"lib/tags/autoescape.js"(e){var t=n(),r=o(),a=["html","js"];e.compile=function(e,t,n,o,a,i){var s=e(n,o,a,i);return r.autoescape(function(e){if("true"===e)return!0;if("false"===e)return!1;if("string"==typeof e&&e.length>=2){var t=e.charAt(0),r=e.charAt(e.length-1);if('"'===t&&'"'===r||"'"===t&&"'"===r)return e.slice(1,-1)}return e}(t[0]),[r.legacyJS(s)])},e.parse=function(e,r,n,o,i,s){var c;return n.on("*",function(e){if(!c&&(e.type===o.BOOL||e.type===o.STRING&&-1===a.indexOf(e.match)))return this.out.push(e.match),void(c=!0);t.throwError('Unexpected token "'+e.match+'" in autoescape tag',r,s.filename)}),!0},e.ends=!0}}),i=t({"lib/tags/block.js"(e){var t=o();e.compile=function(e,r,n,o,a){var i=r.join("");return t.block(i,[t.legacyJS(e(n,o,a,i))])},e.parse=function(e,t,r){return r.on("*",function(e){this.out.push(e.match)}),!0},e.ends=!0,e.block=!0}}),s=t({"lib/tags/else.js"(e){e.compile=function(){return"} else {\n"},e.parse=function(e,t,r,n,o){return r.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}}}),c=t({"packages/swig-core/lib/tokentypes.js"(e,t){t.exports={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,QMARK:27,UNKNOWN:100}}}),l=t({"lib/tags/if.js"(e){var t=o(),r=c();e.compile=function(e,r,n,o,a,i,s){var c,l,p=[],u=s&&s.irExpr?s.irExpr:t.legacyJS(r.join(" ")),f=[];for(c=0;c<n.length;c++)!(l=n[c])||"elseif"!==l.name&&"else"!==l.name?f.push(l):(p.push(t.ifBranch(u,[t.legacyJS(e(f,o,a,i))])),u="else"===l.name?null:l.irExpr?l.irExpr:t.legacyJS(l.args.join(" ")),f=[]);return p.push(t.ifBranch(u,[t.legacyJS(e(f,o,a,i))])),t.ifStmt(p)},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,t,r,n){if(void 0===e)throw new Error("No conditional statement provided on line "+t+".");return r.on(n.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===n.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),r.on(n.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),r.on(n.BOOL,function(e){this.out.push(e.match)}),r.on(n.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},e.ends=!0}}),p=t({"lib/tags/elseif.js"(e){var t=l().parse,r=c();e.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,r,n,o,a){return t(e,r,n,o,a)&&a.length&&"if"===a[a.length-1].name}}}),u=t({"lib/tags/extends.js"(e){e.compile=function(){},e.parse=function(){return!0},e.ends=!1}}),f=t({"packages/swig-core/lib/dateformatter.js"(e){var t=r(),n={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},o={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};e.tzOffset=0,e.DateZ=function(){var r=["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],n=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"],o=this;o.date=o.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments[0])):new Date,o.timezoneOffset=o.dateZ.getTimezoneOffset(),t.each(n,function(e){o[e]=function(){return o.dateZ[e]()}}),t.each(r,function(e){o[e]=function(){return o.date[e]()}}),this.setTimezoneOffset(e.tzOffset)},e.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},e.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},e.D=function(e){return o.abbr[e.getDay()]},e.j=function(e){return e.getDate()},e.l=function(e){return o.full[e.getDay()]},e.N=function(e){var t=e.getDay();return t>=1?t:7},e.S=function(e){var t=e.getDate();return t%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th"},e.w=function(e){return e.getDay()},e.z=function(t,r,n){var o=t.getFullYear(),a=new e.DateZ(o,t.getMonth(),t.getDate(),12,0,0),i=new e.DateZ(o,0,1,12,0,0);return a.setTimezoneOffset(r,n),i.setTimezoneOffset(r,n),Math.round((a-i)/864e5)},e.W=function(e){var t,r=new Date(e.valueOf()),n=(e.getDay()+6)%7;return r.setDate(r.getDate()-n+3),t=r.valueOf(),r.setMonth(0,1),4!==r.getDay()&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((t-r)/6048e5)},e.F=function(e){return n.full[e.getMonth()]},e.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},e.M=function(e){return n.abbr[e.getMonth()]},e.n=function(e){return e.getMonth()+1},e.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},e.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},e.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},e.Y=function(e){return e.getFullYear()},e.y=function(e){return e.getFullYear().toString().substr(2)},e.a=function(e){return e.getHours()<12?"am":"pm"},e.A=function(e){return e.getHours()<12?"AM":"PM"},e.B=function(e){var t,r=e.getUTCHours();return r=23===r?0:r+1,t=Math.abs((60*(60*r+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},e.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},e.G=function(e){return e.getHours()},e.h=function(e){var t=e.getHours();return(t<10||12<t&&22>t?"0":"")+(t<12?t:t-12)},e.H=function(e){var t=e.getHours();return(t<10?"0":"")+t},e.i=function(e){var t=e.getMinutes();return(t<10?"0":"")+t},e.s=function(e){var t=e.getSeconds();return(t<10?"0":"")+t},e.O=function(e){var t=e.getTimezoneOffset();return(t<0?"-":"+")+(t/60<10?"0":"")+Math.abs(t/60)+"00"},e.Z=function(e){return 60*e.getTimezoneOffset()},e.c=function(e){return e.toISOString()},e.r=function(e){return e.toUTCString()},e.U=function(e){return e.getTime()/1e3}}}),h=t({"lib/dateformatter.js"(e,t){t.exports=f()}}),d=t({"packages/swig-core/lib/filters.js"(e){var t=r();e.iterateFilter=function(e){var r=this,n={};return t.isArray(e)?t.map(e,function(e){return r.apply(null,arguments)}):"object"==typeof e?(t.each(e,function(e,t){n[t]=r.apply(null,arguments)}),n):void 0}}}),y=t({"lib/filters.js"(e){var t=n(),r=h(),o=d().iterateFilter;function a(e){return"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"&#39;"}e.addslashes=function(t){var r=o.apply(e.addslashes,arguments);return void 0!==r?r:t.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},e.capitalize=function(t){var r=o.apply(e.capitalize,arguments);return void 0!==r?r:t.toString().charAt(0).toUpperCase()+t.toString().substr(1).toLowerCase()},e.date=function(e,t,n,o){var a,i=t.length,s=new r.DateZ(e),c=0,l="";for(n&&s.setTimezoneOffset(n,o);c<i;c+=1)"\\"===(a=t.charAt(c))?l+=(c+=1)<i?t.charAt(c):a:r.hasOwnProperty(a)?l+=r[a](s,n,o):l+=a;return l},e.default=function(e,t){return void 0===e||!e&&"number"!=typeof e?t:e},e.escape=function(t,r){var n,i,s,c,l;if(null==t)return t;if("string"!==(n=typeof t))return"object"===n&&void 0!==(s=o.apply(e.escape,arguments))?s:t;if("js"===r){for(i=t.replace(/\\/g,"\\u005C"),s="",c=0;c<i.length;c+=1)s+=(l=i.charCodeAt(c))<32?"\\u00"+(l=(l=l.toString(16).toUpperCase()).length<2?"0"+l:l):i[c];return s.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B")}return t.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&amp;").replace(/[<>"']/g,a)},e.e=e.escape,e.first=function(e){return"object"!=typeof e||t.isArray(e)?"string"==typeof e?e.substr(0,1):e[0]:e[t.keys(e)[0]]},e.groupBy=function(e,r){if(!t.isArray(e))return e;var n={};return t.each(e,function(e){if(e.hasOwnProperty(r)){var o=e[r],a=t.extend({},e);delete a[r],n[o]||(n[o]=[]),n[o].push(a)}}),n},e.join=function(e,r){if(t.isArray(e))return e.join(r);if("object"==typeof e){var n=[];return t.each(e,function(e){n.push(e)}),n.join(r)}return e},e.json=function(e,t){return JSON.stringify(e,null,t||0)},e.json_encode=e.json,e.last=function(e){if("object"==typeof e&&!t.isArray(e)){var r=t.keys(e);return e[r[r.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},e.length=function(e){return"object"!=typeof e||t.isArray(e)?e.hasOwnProperty("length")?e.length:"":t.keys(e).length},e.lower=function(t){var r=o.apply(e.lower,arguments);return void 0!==r?r:t.toString().toLowerCase()},e.raw=function(t){return e.safe(t)},e.raw.safe=!0,e.replace=function(e,t,r,n){var o=new RegExp(t,n);return e.replace(o,r)},e.reverse=function(t){return e.sort(t,!0)},e.safe=function(e){return e},e.safe.safe=!0,e.sort=function(e,r){var n;if(t.isArray(e))n=t.extend([],e).sort();else switch(typeof e){case"object":n=t.keys(e).sort();break;case"string":return n=e.split(""),r?n.reverse().join(""):n.sort().join("")}return n&&r?n.reverse():n||e},e.striptags=function(t){var r=o.apply(e.striptags,arguments);return void 0!==r?r:t.toString().replace(/(<([^>]+)>)/gi,"")},e.title=function(t){var r=o.apply(e.title,arguments);return void 0!==r?r:t.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.uniq=function(e){var r;return e&&t.isArray(e)?(r=[],t.each(e,function(e){-1===r.indexOf(e)&&r.push(e)}),r):""},e.upper=function(t){var r=o.apply(e.upper,arguments);return void 0!==r?r:t.toString().toUpperCase()},e.url_encode=function(t){var r=o.apply(e.url_encode,arguments);return void 0!==r?r:encodeURIComponent(t)},e.url_decode=function(t){var r=o.apply(e.url_decode,arguments);return void 0!==r?r:decodeURIComponent(t)}}}),g=t({"lib/tags/filter.js"(e){var t=y(),r=o(),n=c();e.compile=function(e,t,n,o,a,i,s){var c=t.shift().replace(/\($/,""),l=e(n,o,a,i);")"===t[t.length-1]&&t.pop();var p=s&&s.irExpr?s.irExpr:t.length?t:void 0;return r.filter(c,[r.legacyJS(l)],p)},e.lowerExpr=function(e,t){for(var r=0;r<t.length&&t[r].type===n.WHITESPACE;)r+=1;if(!(r>=t.length)){var o=t[r];if(o.type!==n.VAR){if(o.type===n.FUNCTIONEMPTY)return[];if(o.type===n.FUNCTION){var a,i=1,s=r+1,c=[];for(a=r+1;a<t.length;a+=1){var l=t[a];if(l.type===n.FILTER||l.type===n.FILTEREMPTY)return;if(l.type!==n.PARENOPEN&&l.type!==n.FUNCTION&&l.type!==n.BRACKETOPEN&&l.type!==n.CURLYOPEN){if(l.type!==n.PARENCLOSE&&l.type!==n.BRACKETCLOSE&&l.type!==n.CURLYCLOSE)l.type===n.COMMA&&1===i&&(c.push(t.slice(s,a)),s=a+1);else if(0===(i-=1)){a>s&&c.push(t.slice(s,a));break}}else i+=1}if(0===i){var p=[];for(a=0;a<c.length;a+=1)p.push(e.parseExpr(c[a]));return p}}}}},e.parse=function(e,r,n,o){var a;function i(e){if(!t.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+r+".")}return n.on(o.FUNCTION,function(e){return!!a||(i(a=e.match.replace(/\($/,"")),this.out.push(e.match),void this.state.push(e.type))}),n.on(o.VAR,function(e){return!!a||(i(a=e.match),void this.out.push(a))}),!0},e.ends=!0}}),m=t({"packages/swig-core/lib/security.js"(e){e.dangerousProps=["__proto__","constructor","prototype"]}}),v=t({"lib/tags/for.js"(e){var t=o(),r=c(),n=m().dangerousProps;e.compile=function(e,r,n,o,a,i,s){var c,l=r.shift(),p="__k";r[0]&&","===r[0]&&(r.shift(),p=l,l=r.shift()),c=s&&s.irExpr?s.irExpr:r.join("");var u=e(n,o,a,i);return t.forStmt(l,c,[t.legacyJS(u)],p)},e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.COMPARATOR&&"in"===t[n].match){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY)return;return e.parseExpr(a)}},e.parse=function(e,t,r,o){var a,i;return r.on(o.NUMBER,function(e){var r=this.state.length?this.state[this.state.length-1]:null;if(!i||r!==o.ARRAYOPEN&&r!==o.CURLYOPEN&&r!==o.CURLYCLOSE&&r!==o.FUNCTION&&r!==o.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),r.on(o.VAR,function(e){if(i&&a)return!0;if(-1!==e.match.indexOf("."))throw new Error('Loop variable "'+e.match+'" must be a bare identifier in "for" tag on line '+t+".");if(-1!==n.indexOf(e.match))throw new Error('Unsafe loop variable "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.length||(a=!0),this.out.push(e.match)}),r.on(o.COMMA,function(e){if(!a||this.prevToken.type!==o.VAR)return!0;this.out.push(e.match)}),r.on(o.COMPARATOR,function(e){if("in"!==e.match||!a)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0,this.filterApplyIdx.push(this.out.length)}),!0},e.ends=!0}}),E=t({"packages/swig-core/lib/backend.js"(e){var t=r(),n=m(),a=o();function i(e){return e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')}function s(e){return{dangerousProps:(e=e||{}).dangerousProps||n.dangerousProps,throwError:e.throwError||t.throwError}}function c(e,r){switch(e&&"string"==typeof e.type||r.throwError("emitExpr: expected an IR expression node"),e.type){case"Literal":return function(e,t){switch(e.kind){case"string":return JSON.stringify(e.value);case"number":return String(e.value);case"bool":return e.value?"true":"false";case"null":return"null";case"undefined":return"undefined"}t.throwError('emitLiteral: unknown literal kind "'+e.kind+'"')}(e,r);case"VarRef":return function(e,r){t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRef: path must be a non-empty array");return t.each(e.path,function(t){l(t,r,e)}),f(e.path)}(e,r);case"VarRefExists":return p(e,r);case"Access":return function(e,t){e.key&&"Literal"===e.key.type&&"string"===e.key.kind&&l(e.key.value,t,e);return c(e.object,t)+"["+c(e.key,t)+"]"}(e,r);case"BinaryOp":return function(e,t){var r=c(e.left,t),n=c(e.right,t);if(o=e.op,"+"===o||"-"===o||"*"===o||"/"===o||"%"===o)return r+" "+e.op+" "+n;var o;if("in"===e.op)return r+" in "+n;if("~"===e.op)return"(String("+r+") + String("+n+"))";if("??"===e.op&&e.left&&"VarRef"===e.left.type){return"("+p(a.varRefExists(e.left.path,e.left.loc),t)+" ? "+r+" : "+n+")"}return r+e.op+n}(e,r);case"UnaryOp":return function(e,t){var r=c(e.operand,t);e.operand&&"BinaryOp"===e.operand.type&&(r="("+r+")");return e.op+r}(e,r);case"Conditional":return function(e,t){return"("+c(e.test,t)+" ? "+c(e.then,t)+" : "+c(e.else,t)+")"}(e,r);case"ArrayLiteral":return function(e,r){var n=[];return t.each(e.elements,function(e){n.push(c(e,r))}),"["+n.join(", ")+"]"}(e,r);case"ObjectLiteral":return function(e,r){var n=[];return t.each(e.properties,function(e){n.push(c(e.key,r)+":"+c(e.value,r))}),"{"+n.join(", ")+"}"}(e,r);case"FnCall":return function(e,r){var n,o,a,i=[],s=e.callee;if(t.each(e.args,function(e){i.push(c(e,r))}),a=i.join(", "),s&&"VarRef"===s.type&&t.isArray(s.path))return t.each(s.path,function(e){l(e,r,s)}),1===s.path.length?"((typeof _ctx."+(n=s.path[0])+' !== "undefined") ? _ctx.'+n+" : ((typeof "+n+' !== "undefined") ? '+n+" : _fn))("+a+")":(o=s.path.slice(0,-1),"("+f(s.path)+" || _fn).call("+f(o)+(a?", "+a:"")+")");return"("+c(s,r)+")("+a+")"}(e,r);case"FilterCall":return function(e,r){var n=c(e.input,r),o="";if(e.args&&e.args.length){var a=[];t.each(e.args,function(e){a.push(c(e,r))}),o=", "+a.join(", ")}return'_filters["'+e.name+'"]('+n+o+")"}(e,r)}r.throwError('emitExpr: unknown IR expression type "'+e.type+'"')}function l(e,t,r){if(-1!==t.dangerousProps.indexOf(e)){var n=r&&r.loc&&r.loc.line||void 0,o=r&&r.loc&&r.loc.filename||void 0;t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',n,o)}}function p(e,r){return t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRefExists: path must be a non-empty array"),t.each(e.path,function(t){l(t,r,e)}),"("+u(e.path,"_ctx.")+" || "+u(e.path,"")+")"}function u(e,r){var n=r+e[0],o="";return o="(typeof "+n+' !== "undefined" && '+n+" !== null",t.each(e,function(e,t){0!==t&&(o+=" && "+n+"."+e+" !== undefined && "+n+"."+e+" !== null",n+="."+e)}),o+=")"}function f(e){var t=e.join(".");return"("+u(e,"_ctx.")+" ? _ctx."+t+" : ("+u(e,"")+" ? "+t+' : ""))'}e.compile=function(r,o,c,p){var u="",f=t.isArray(r)?r:r.tokens,h=[];return t.each(f,function(r){if("string"!=typeof r)if(r&&"object"==typeof r&&"string"==typeof r.type&&"function"!=typeof r.compile)h.push(r);else{var n=r.compile(e.compile,r.args?r.args.slice(0):[],r.content?r.content.slice(0):[],o,c,p,r);null!=n&&""!==n&&("string"!=typeof n?t.isArray(n)?t.each(n,function(e){h.push(e)}):"object"!=typeof n||"string"!=typeof n.type?h.push(a.legacyJS(String(n))):h.push(n):h.push(a.legacyJS(n)))}else h.push(a.text(r))}),t.each(h,function(r){if("Text"!==r.type&&"Raw"!==r.type)if("LegacyJS"!==r.type)if("Autoescape"!==r.type){if("If"===r.type){var a="";return t.each(r.branches,function(r,n){var o,s="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(s+='_output += "'+i(e.value)+'";\n'):s+=e.js}),null!==r.test?(o=r.test&&"object"==typeof r.test&&"LegacyJS"===r.test.type?r.test.js:"object"==typeof r.test&&"string"==typeof r.test.type?e.emitExpr(r.test):r.test,a+=0===n?"if ("+o+") { \n"+s:"} else if ("+o+") {\n"+s):a+="} else {\n"+s}),void(u+=a+"\n}")}if("Set"===r.type){var p,f;if(r.target&&"object"==typeof r.target&&"VarRef"===r.target.type){var h=s();t.isArray(r.target.path)&&0!==r.target.path.length||h.throwError("Set: target VarRef must have a non-empty path"),t.each(r.target.path,function(e){l(e,h,r.target)}),p="_ctx."+r.target.path.join(".")}else p=r.target;return f=r.value&&"object"==typeof r.value&&"string"==typeof r.value.type?e.emitExpr(r.value):r.value,void(u+=p+" "+r.op+" "+f+";\n")}if("For"!==r.type)if("Macro"!==r.type)if("Parent"!==r.type)if("Block"!==r.type){var d,y,g;if("Include"===r.type)return d=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(y="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),g=r.isolated&&y?y:y?"_utils.extend({}, _ctx, "+y+")":"_ctx",void(u+=(r.ignoreMissing?" try {\n":"")+"_output += _swig.compileFile("+d+', {resolveFrom: "'+r.resolveFrom+'"})('+g+");\n"+(r.ignoreMissing?"} catch (e) {}\n":""));if("IncludeDeferred"!==r.type)if("ImportDeferred"!==r.type){if("FromImportDeferred"===r.type){var m,v=r.imports||[];t.each(v,function(e){if(-1!==n.dangerousProps.indexOf(e.name))throw new Error('From-import name "'+e.name+'" is reserved.');var t=e.alias||e.name;if(-1!==n.dangerousProps.indexOf(t))throw new Error('From-import binding "'+t+'" is reserved.')}),m=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var E='{resolveFrom: "'+(r.resolveFrom||"")+'"}',x="";return t.each(v,function(e){var t=e.alias||e.name;x+=" _ctx."+t+' = _imp["'+e.name+'"];\n'}),void(u+="await (async function () {\n var _imp = (await (await _swig.getTemplate("+m+", "+E+"))(_ctx)).exports;\n"+x+"})();\n")}if("ExtendsDeferred"===r.type){var O;r.childIRs&&r.childIRs.length&&(u+=e.compile(r.childIRs,o,c)),u+="var _localChildBlocks = {};\n",r.childBlocks&&t.each(r.childBlocks,function(e,r){var n="";t.each(e.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(n+='_output += "'+i(e.value)+'";\n'):n+=e.js}),u+="_localChildBlocks["+JSON.stringify(r)+'] = async function (_ctx) {\n var _output = "";\n'+n+" return _output;\n};\n"}),u+="var _mergedBlocks = _utils.extend({}, _localChildBlocks, _blocks || {});\n",O=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var w='{resolveFrom: "'+(r.resolveFrom||"")+'"}';return u+="var _parentTpl = await _swig.getTemplate("+O+", "+w+");\n",u+="var _parentResult = await _parentTpl(_ctx, _mergedBlocks);\n",void(u+="_output = _parentResult.output;\n")}if("With"===r.type){var C;void 0!==r.context&&(C=r.context&&"object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context);var b,T="";return t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(T+='_output += "'+i(e.value)+'";\n'):T+=e.js}),b=r.isolated?void 0!==C?C:"{}":void 0!==C?"_utils.extend({}, _ctx, "+C+")":"_utils.extend({}, _ctx)",void(u+="(function (_ctx) {\n"+T+"})("+b+");\n")}if("Output"===r.type){if(r.expr&&"LegacyJS"===r.expr.type)return void(u+=r.expr.js);var R=e.emitExpr(r.expr);return r.filters&&r.filters.length&&t.each(r.filters,function(r){var n="";if(r.args&&r.args.length){var o=[];t.each(r.args,function(t){o.push(e.emitExpr(t))}),n=", "+o.join(", ")}R='_filters["'+r.name+'"]('+R+n+")"}),void(r.coerce?u+="_output += _utils.coerceOutput("+R+");\n":u+="_output += "+R+";\n")}if("Filter"!==r.type);else{var A="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(A+='_output += "'+i(e.value)+'";\n'):A+=e.js});var N='(function () {\n var _output = "";\n'+A+" return _output;\n})()",k="";if(r.args&&r.args.length){var P=[];t.each(r.args,function(t){t&&"object"==typeof t&&"string"==typeof t.type?P.push(e.emitExpr(t)):P.push(t)}),k=", "+P.join(", ")}u+='_output += _filters["'+r.name+'"]('+N+k+");\n"}}else{if(-1!==n.dangerousProps.indexOf(r.alias))throw new Error('Import alias "'+r.alias+'" is reserved.');var _;_=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var L='{resolveFrom: "'+(r.resolveFrom||"")+'"}';u+="_ctx."+r.alias+" = (await (await _swig.getTemplate("+_+", "+L+"))(_ctx)).exports;\n"}else{var S,I,F;S=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(I="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),F=r.isolated&&I?I:I?"_utils.extend({}, _ctx, "+I+")":"_ctx";var j='{resolveFrom: "'+(r.resolveFrom||"")+'"}';u+=(r.ignoreMissing?" try {\n":"")+"_output += (await (await _swig.getTemplate("+S+", "+j+"))("+F+")).output;\n"+(r.ignoreMissing?"} catch (e) {}\n":"")}}else{if(c&&"async"===c.codegenMode){var U=JSON.stringify(r.name);return u+="if (_blocks && _blocks["+U+"]) {\n",u+=" _output += await _blocks["+U+"](_ctx);\n",u+="} else {\n",t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js}),void(u+="}\n")}t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js})}else t.each(r.body||[],function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else{var M="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(M+='_output += "'+i(e.value)+'";\n'):M+=e.js});var Y,D,B=r.params||[],V="";if(B.length&&"object"==typeof B[0]&&null!==B[0]&&"string"==typeof B[0].name){var J=[];t.each(B,function(t){J.push(t.name),t.default&&(V+=" if ("+t.name+" === undefined) { "+t.name+" = "+e.emitExpr(t.default)+"; }\n")}),Y=J.join(", ");var K=[];t.each(J,function(e){K.push(JSON.stringify(e))}),D=K.join(",")}else Y=B.join(""),D='"'+B.join('","')+'"';if(u+="_ctx."+r.name+" = function ("+Y+') {\n var _output = "",\n __ctx = _utils.extend({}, _ctx);\n'+V+" _utils.each(_ctx, function (v, k) {\n if (["+D+"].indexOf(k) !== -1) { delete _ctx[k]; }\n });\n"+M+"\n _ctx = _utils.extend(_ctx, __ctx);\n return _output;\n};\n_ctx."+r.name+".safe = true;\n",c&&"async"===c.codegenMode){if(-1!==n.dangerousProps.indexOf(r.name))throw new Error('Macro name "'+r.name+'" is reserved.');u+="_exports."+r.name+" = _ctx."+r.name+";\n"}}else{var W,$=r.value,z=r.key,G="",H=("_ctx.__loopcache"+Math.random()).replace(/\./g,""),Z="_ctx.",Q="_ctx.loop";W=r.iterable&&"object"==typeof r.iterable&&"string"==typeof r.iterable.type?e.emitExpr(r.iterable):r.iterable,t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(G+='_output += "'+i(e.value)+'";\n'):G+=e.js});var q=" if (!__l) { return; }\n";if(r.emptyBody){var X="";t.each(r.emptyBody,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(X+='_output += "'+i(e.value)+'";\n'):X+=e.js}),q=" if (!__l || !__len) {\n"+X+" return;\n }\n"}u+="(function () {\n var __l = "+W+', __len = (_utils.isArray(__l) || typeof __l === "string") ? __l.length : _utils.keys(__l).length;\n'+q+" var "+H+" = { loop: "+Q+", "+$+": "+Z+$+", "+z+": "+Z+z+" };\n "+Q+" = { first: false, index: 1, index0: 0, revindex: __len, revindex0: __len - 1, length: __len, last: false };\n _utils.each(__l, function ("+$+", "+z+") {\n "+Z+$+" = "+$+";\n "+Z+z+" = "+z+";\n "+Q+".key = "+z+";\n "+Q+".first = ("+Q+".index0 === 0);\n "+Q+".last = ("+Q+".revindex0 === 0);\n "+G+" "+Q+".index += 1; "+Q+".index0 += 1; "+Q+".revindex -= 1; "+Q+".revindex0 -= 1;\n });\n "+Q+" = "+H+".loop;\n "+Z+$+" = "+H+"."+$+";\n "+Z+z+" = "+H+"."+z+";\n "+H+" = undefined;\n})();\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else u+=r.js;else u+='_output += "'+i(r.value)+'";\n'}),u},e.emitExpr=function(e,t){return c(e,s(t))}}}),x=t({"lib/lexer.js"(e){var t=n(),r=c(),o=[{type:r.WHITESPACE,regex:[/^\s+/]},{type:r.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:r.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:r.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:r.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:r.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:r.PARENOPEN,regex:[/^\(/]},{type:r.PARENCLOSE,regex:[/^\)/]},{type:r.COMMA,regex:[/^,/]},{type:r.LOGIC,regex:[/^(&&|\|\|)\s*/,/^(and|or)\s+/],idx:1,replace:{and:"&&",or:"||"}},{type:r.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:r.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:r.NOT,regex:[/^\!\s*/,/^not\s+/],replace:{not:"!"}},{type:r.BOOL,regex:[/^(true|false)\s+/,/^(true|false)$/],idx:1},{type:r.VAR,regex:[/^[a-zA-Z_$]\w*((\.\$?\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:r.BRACKETOPEN,regex:[/^\[/]},{type:r.BRACKETCLOSE,regex:[/^\]/]},{type:r.CURLYOPEN,regex:[/^\{/]},{type:r.COLON,regex:[/^\:/]},{type:r.CURLYCLOSE,regex:[/^\}/]},{type:r.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:r.NUMBER,regex:[/^\d+(\.\d+)?/]},{type:r.QMARK,regex:[/^\?/]},{type:r.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];function a(e){var n;return t.some(o,function(r){return t.some(r.regex,function(t){var o,a=e.match(t);if(a)return o=a[r.idx||0].replace(/\s*$/,""),o=r.hasOwnProperty("replace")&&r.replace.hasOwnProperty(o)?r.replace[o]:o,n={match:o,type:r.type,length:a[0].length},!0})}),n||(n={match:e,type:r.UNKNOWN,length:e.length}),n}e.types=r,e.read=function(e){for(var t,r=0,n=[];r<e.length;)r+=(t=a(e.substring(r))).length,n.push(t);return n}}}),O=t({"packages/swig-core/lib/tokenparser.js"(e){var t=r(),n=c(),a=o(),i=m().dangerousProps,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];function l(e,r,o,a,i){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=a,this.filename=i,this.filters=r,this.escape=o,this.parse=function(){var r=this;return r._parsers.start&&r._parsers.start.call(r),t.each(e,function(t,o){var a=e[o-1];if(r.isLast=o===e.length-1,a)for(;a.type===n.WHITESPACE;)a=e[(o-=1)-1];r.prevToken=a,r.parseToken(t)}),r._parsers.end&&r._parsers.end.call(r),r.escape&&(r.filterApplyIdx=[0],"string"==typeof r.escape?(r.parseToken({type:n.FILTER,match:"e"}),r.parseToken({type:n.COMMA,match:","}),r.parseToken({type:n.STRING,match:String(o)}),r.parseToken({type:n.PARENCLOSE,match:")"})):r.parseToken({type:n.FILTEREMPTY,match:"e"})),r.out}}l.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var r,o=this,a=o._parsers[e.type]||o._parsers["*"],s=e.match,c=o.prevToken,l=c?c.type:null,p=o.state.length?o.state[o.state.length-1]:null;if(!a||"function"!=typeof a||a.call(this,e))switch(p&&c&&p===n.FILTER&&l===n.FILTER&&e.type!==n.PARENCLOSE&&e.type!==n.COMMA&&e.type!==n.OPERATOR&&e.type!==n.FILTER&&e.type!==n.FILTEREMPTY&&o.out.push(", "),p&&p===n.METHODOPEN&&(o.state.pop(),e.type!==n.PARENCLOSE&&o.out.push(", ")),e.type){case n.WHITESPACE:break;case n.STRING:if(p===n.BRACKETOPEN){var u=s.replace(/^['"]|['"]$/g,"");-1!==i.indexOf(u)&&t.throwError('Unsafe access to "'+u+'" via bracket notation is not allowed in templates (CVE-2023-25345)',o.line,o.filename)}o.filterApplyIdx.push(o.out.length),o.out.push(s.replace(/\\/g,"\\\\"));break;case n.NUMBER:case n.BOOL:o.filterApplyIdx.push(o.out.length),o.out.push(s);break;case n.FILTER:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.state.push(e.type);break;case n.FILTEREMPTY:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.out.push(")");break;case n.FUNCTION:case n.FUNCTIONEMPTY:o.out.push("((typeof _ctx."+s+' !== "undefined") ? _ctx.'+s+" : ((typeof "+s+' !== "undefined") ? '+s+" : _fn))("),o.escape=!1,e.type===n.FUNCTIONEMPTY?o.out[o.out.length-1]=o.out[o.out.length-1]+")":o.state.push(e.type),o.filterApplyIdx.push(o.out.length-1);break;case n.PARENOPEN:o.state.push(e.type),o.filterApplyIdx.length?(o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,"("),c&&l===n.VAR?(r=c.match.split(".").slice(0,-1),o.out.push(" || _fn).call("+o.checkMatch(r)),o.state.push(n.METHODOPEN),o.escape=!1):o.out.push(" || _fn)("),o.filterApplyIdx.push(o.out.length-3)):(o.out.push("("),o.filterApplyIdx.push(o.out.length-1));break;case n.PARENCLOSE:(r=o.state.pop())!==n.PARENOPEN&&r!==n.FUNCTION&&r!==n.FILTER&&t.throwError("Mismatched nesting state",o.line,o.filename),o.out.push(")"),o.filterApplyIdx.pop(),r!==n.FILTER&&o.filterApplyIdx.pop();break;case n.COMMA:p!==n.FUNCTION&&p!==n.FILTER&&p!==n.ARRAYOPEN&&p!==n.CURLYOPEN&&p!==n.PARENOPEN&&p!==n.COLON&&t.throwError("Unexpected comma",o.line,o.filename),p===n.COLON&&o.state.pop(),o.out.push(", "),o.filterApplyIdx.pop();break;case n.LOGIC:case n.COMPARATOR:c&&l!==n.COMMA&&l!==e.type&&l!==n.BRACKETOPEN&&l!==n.CURLYOPEN&&l!==n.PARENOPEN&&l!==n.FUNCTION||t.throwError("Unexpected logic",o.line,o.filename),o.out.push(e.match);break;case n.NOT:o.out.push(e.match);break;case n.VAR:o.parseVar(e,s,p);break;case n.BRACKETOPEN:!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.PARENCLOSE?(o.state.push(n.ARRAYOPEN),o.filterApplyIdx.push(o.out.length)):o.state.push(e.type),o.out.push("[");break;case n.BRACKETCLOSE:(r=o.state.pop())!==n.BRACKETOPEN&&r!==n.ARRAYOPEN&&t.throwError("Unexpected closing square bracket",o.line,o.filename),o.out.push("]"),o.filterApplyIdx.pop();break;case n.CURLYOPEN:o.state.push(e.type),o.out.push("{"),o.filterApplyIdx.push(o.out.length-1);break;case n.QMARK:o.out.push(" ? "),o.state.push(e.type),o.filterApplyIdx.pop();break;case n.COLON:p===n.CURLYOPEN?(o.state.push(e.type),o.out.push(":")):p===n.QMARK?(o.state.pop()," ? "===o.out[o.out.length-1]?o.out[o.out.length-1]=" || ":o.out.push(" : ")):t.throwError("Unexpected colon",o.line,o.filename),o.filterApplyIdx.pop();break;case n.CURLYCLOSE:p===n.COLON&&o.state.pop(),o.state.pop()!==n.CURLYOPEN&&t.throwError("Unexpected closing curly brace",o.line,o.filename),o.out.push("}"),o.filterApplyIdx.pop();break;case n.DOTKEY:(!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.DOTKEY&&l!==n.PARENCLOSE&&l!==n.FUNCTIONEMPTY&&l!==n.FILTEREMPTY&&l!==n.CURLYCLOSE)&&t.throwError('Unexpected key "'+s+'"',o.line,o.filename),-1!==i.indexOf(s)&&t.throwError('Unsafe access to "'+s+'" is not allowed in templates (CVE-2023-25345)',o.line,o.filename),o.out.push("."+s);break;case n.OPERATOR:o.out.push(" "+s+" "),o.filterApplyIdx.pop()}},parseVar:function(e,r,o){var a=this;if(r=r.split("."),-1!==s.indexOf(r[0])&&t.throwError('Reserved keyword "'+r[0]+'" attempted to be used as a variable',a.line,a.filename),t.each(r,function(e){-1!==i.indexOf(e)&&t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',a.line,a.filename)}),a.filterApplyIdx.push(a.out.length),o===n.CURLYOPEN)return r.length>1&&t.throwError("Unexpected dot",a.line,a.filename),void a.out.push(r[0]);a.out.push(a.checkMatch(r))},parseExpr:function(e,r){var o=this,c=0;function l(){return function(){for(;c<e.length&&e[c].type===n.WHITESPACE;)c+=1}(),c<e.length?e[c]:null}function p(){var e=l();return e&&(c+=1),e}function u(e){t.throwError(e,o.line,o.filename)}function f(e){-1!==i.indexOf(e)&&u('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)')}function h(e){-1!==i.indexOf(e)&&u('Unsafe access to "'+e+'" via bracket notation is not allowed in templates (CVE-2023-25345)')}function d(e){var t;if(e.type===n.LOGIC){if("||"===e.match)return{op:"||",prec:1};if("&&"===e.match)return{op:"&&",prec:2}}if(e.type===n.COMPARATOR)return"==="===(t=e.match)||"!=="===t||"=="===t||"!="===t?{op:t,prec:3}:{op:t,prec:4};if(e.type===n.OPERATOR){if("+"===(t=e.match)||"-"===t)return{op:t,prec:5};if("*"===t||"/"===t||"%"===t)return{op:t,prec:6}}return null}function y(e){return e.replace(/^['"]|['"]$/g,"")}function g(e){var t=[],r=l();if(r&&r.type===e)return p(),t;for(;;){t.push(x(0));var o=p();if(o||u("Unexpected end of expression"),o.type===e)break;o.type!==n.COMMA&&u("Expected comma or closing delimiter")}return t}function m(e){for(;;){var t=l();if(!t)break;if(t.type===n.DOTKEY)p(),f(t.match),e="VarRef"===e.type?a.varRef(e.path.concat([t.match])):a.access(e,a.literal("string",t.match));else if(t.type===n.BRACKETOPEN){p();var r=x(0);"Literal"===r.type&&"string"===r.kind&&h(r.value);var i=p();i&&i.type===n.BRACKETCLOSE||u("Unexpected closing square bracket"),e=a.access(e,r)}else if(t.type===n.PARENOPEN)p(),e=a.fnCall(e,g(n.PARENCLOSE));else{if(t.type!==n.FILTER&&t.type!==n.FILTEREMPTY)break;p();var s,c=t.match;o.filters.hasOwnProperty(c)&&"function"==typeof o.filters[c]||u('Invalid filter "'+c+'"'),t.type===n.FILTER&&(s=g(n.PARENCLOSE)),e=a.filterCallExpr(c,e,s)}}return e}function v(){var e,r=p();switch(r||u("Unexpected end of expression"),r.type){case n.STRING:return a.literal("string",y(r.match));case n.NUMBER:return a.literal("number",parseFloat(r.match));case n.BOOL:return a.literal("bool","true"===r.match);case n.NOT:return a.unaryOp("!",E());case n.OPERATOR:if("+"===(e=r.match)||"-"===e)return a.unaryOp(e,E());u('Unexpected operator "'+e+'"');break;case n.PARENOPEN:var o=x(0),i=p();return i&&i.type===n.PARENCLOSE||u("Mismatched nesting state"),m(o);case n.BRACKETOPEN:return m(a.arrayLiteral(g(n.BRACKETCLOSE)));case n.CURLYOPEN:return m(function(){var e=[],t=l();if(t&&t.type===n.CURLYCLOSE)return p(),a.objectLiteral([]);for(;;){var r,o=p();o||u("Unclosed object literal"),o.type===n.STRING?r=a.literal("string",y(o.match)):o.type===n.VAR?(-1!==o.match.indexOf(".")&&u("Unexpected dot"),r=a.literal("string",o.match)):o.type===n.NUMBER?r=a.literal("number",parseFloat(o.match)):u("Unexpected object key");var i=p();i&&i.type===n.COLON||u("Unexpected colon");var s=x(0);e.push(a.objectProperty(r,s));var c=p();if(c||u("Unclosed object literal"),c.type===n.CURLYCLOSE)break;c.type!==n.COMMA&&u("Expected comma or closing curly brace")}return a.objectLiteral(e)}());case n.VAR:var c=r.match.split(".");return-1!==s.indexOf(c[0])&&u('Reserved keyword "'+c[0]+'" attempted to be used as a variable'),t.each(c,function(e){f(e)}),m(a.varRef(c));case n.FUNCTION:case n.FUNCTIONEMPTY:return e=r.match,-1!==s.indexOf(e)&&u('Reserved keyword "'+e+'" attempted to be used as a variable'),f(e),r.type===n.FUNCTIONEMPTY?m(a.fnCall(a.varRef([e]),[])):m(a.fnCall(a.varRef([e]),g(n.PARENCLOSE)))}return u('Unexpected token "'+r.match+'"'),null}function E(){return v()}function x(e){for(var t=E();;){var r=l();if(!r)break;if(r.type===n.FILTER||r.type===n.FILTEREMPTY)break;var o=d(r);if(!o||o.prec<e)break;p();var i=x(o.prec+1);t=a.binaryOp(o.op,t,i)}if(0===e){var s=l();if(s&&s.type===n.QMARK){p();var c,f=l();if(f&&f.type===n.COLON)p(),c=x(0),t=a.conditional(t,t,c);else{var h=x(0),y=p();y&&y.type===n.COLON||u("Expected colon in ternary expression"),c=x(0),t=a.conditional(t,h,c)}}}return t}var O=x(0);return r&&(r.pos=c),O},parseOutput:function(e){var r=this;function o(){var e=r.parse().join("");return a.output(a.legacyJS("_output += "+e+";\n"))}var i,s,c=!1;for(i=0;i<e.length;i+=1)if(e[i].type!==n.WHITESPACE){c=!0;break}if(!c)return o();if("string"==typeof r.escape)return o();var l=0,p=!1,u=!1,f=!1,h=-1;for(i=0;i<e.length;i+=1)s=e[i],0===l&&(s.type!==n.OPERATOR&&s.type!==n.LOGIC&&s.type!==n.COMPARATOR&&s.type!==n.NOT||(p=!0),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||(u=!0,h<0&&(h=i)),s.type===n.QMARK&&(f=!0)),s.type===n.PARENOPEN||s.type===n.FUNCTION||s.type===n.BRACKETOPEN||s.type===n.CURLYOPEN||s.type===n.FILTER?l+=1:s.type!==n.PARENCLOSE&&s.type!==n.BRACKETCLOSE&&s.type!==n.CURLYCLOSE||(l-=1);if(0===h)return o();try{var d=r.escape;for(i=0;i<e.length;i+=1)if((s=e[i]).type!==n.FUNCTION&&s.type!==n.FUNCTIONEMPTY||(d=!1),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||r.filters.hasOwnProperty(s.match)&&"function"==typeof r.filters[s.match]&&r.filters[s.match].safe&&(d=!1),s.type===n.PARENOPEN){for(var y=i-1;y>=0&&e[y].type===n.WHITESPACE;)y-=1;y>=0&&e[y].type===n.VAR&&(d=!1)}if(f||p&&u){var g=r.parseExpr(e),m=d?[a.filterCall("e")]:[];return a.output(g,m.length>0?m:void 0)}var v=h>=0?h:e.length,E=e.slice(0,v),x={pos:0},O=r.parseExpr(E,x),w=!1;for(i=x.pos;i<E.length;i+=1)if(E[i].type!==n.WHITESPACE){w=!0;break}if(w)return o();var C=[];if(h>=0)for(var b=h;b<e.length;){var T=e[b];if(T.type!==n.WHITESPACE)if(T.type!==n.FILTEREMPTY)if(T.type!==n.FILTER)t.throwError('Unexpected token "'+T.match+'"',r.line,r.filename);else{r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(d=!1);for(var R=1,A=b+1,N=b+1;N<e.length&&R>0;){var k=e[N];if(k.type===n.PARENOPEN||k.type===n.FUNCTION||k.type===n.BRACKETOPEN||k.type===n.CURLYOPEN||k.type===n.FILTER)R+=1;else if((k.type===n.PARENCLOSE||k.type===n.BRACKETCLOSE||k.type===n.CURLYCLOSE)&&0===(R-=1))break;N+=1}0!==R&&t.throwError('Unable to parse filter "'+T.match+'"',r.line,r.filename);var P,_=[],L=A,S=1;for(P=A;P<N;P+=1){var I=e[P];I.type===n.PARENOPEN||I.type===n.FUNCTION||I.type===n.BRACKETOPEN||I.type===n.CURLYOPEN||I.type===n.FILTER?S+=1:I.type===n.PARENCLOSE||I.type===n.BRACKETCLOSE||I.type===n.CURLYCLOSE?S-=1:I.type===n.COMMA&&1===S&&(_.push(e.slice(L,P)),L=P+1)}L<N&&_.push(e.slice(L,N));var F,j=[];for(F=0;F<_.length;F+=1){var U,M=_[F],Y=!1;for(U=0;U<M.length;U+=1)if(M[U].type!==n.WHITESPACE){Y=!0;break}Y&&j.push(r.parseExpr(M))}C.push(a.filterCall(T.match,j)),b=N+1}else r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(d=!1),C.push(a.filterCall(T.match)),b+=1;else b+=1}return d&&C.push(a.filterCall("e")),a.output(O,C.length>0?C:void 0)}catch(e){if(f)throw e;return o()}},checkMatch:function(e){var r=e[0],n=e.join(".");function o(n){var o=n+r,a=e,i="";return i="(typeof "+o+' !== "undefined" && '+o+" !== null",t.each(a,function(e,t){0!==t&&(i+=" && "+o+"."+e+" !== undefined && "+o+"."+e+" !== null",o+="."+e)}),i+=")"}return"("+o("_ctx.")+" ? _ctx."+n+" : ("+o("")+" ? "+n+' : ""))'}},e.TokenParser=l}}),w=t({"lib/parser.js"(e){var t=n(),r=x(),o=r.types,a=O().TokenParser;function i(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}e.parse=function(n,s,c,l,p){s=s.replace(/\r\n/g,"\n");var u,f=c.autoescape,h=c.tagControls[0],d=c.tagControls[1],y=c.varControls[0],g=c.varControls[1],m=i(h),v=i(d),E=i(y),x=i(g),O=new RegExp("^"+m+"-?\\s*|\\s*-?"+v+"$","g"),w=new RegExp("^"+m+"-"),C=new RegExp("-"+v+"$"),b=new RegExp("^"+E+"-?\\s*|\\s*-?"+x+"$","g"),T=new RegExp("^"+E+"-"),R=new RegExp("-"+x+"$"),A=c.cmtControls[0],N=c.cmtControls[1],k="[\\s\\S]*?",P=new RegExp("("+m+k+v+"|"+E+k+x+"|"+i(A)+k+i(N)+")"),_=1,L=[],S=null,I=[],F={},j=!1;function U(e,n){var o,i,s=r.read(t.strip(e));return i=(o=new a(s,p,f,n,c.filename)).parseOutput(s),o.state.length&&t.throwError('Unable to parse "'+e+'"',n,c.filename),i}function M(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}return e.parseVariable=U,t.each(s.split(P),function(e){var i,s,m,v,E;if(e){if(!j&&t.startsWith(e,y)&&t.endsWith(e,g))m=T.test(e),u=R.test(e),i=U(e.replace(b,""),_);else if(t.startsWith(e,h)&&t.endsWith(e,d))m=w.test(e),u=C.test(e),(i=function(e,i){var s,u,h,d,y,g,m;if(t.startsWith(e,"end")){if((m=L[L.length-1])&&m.name===e.split(/\s+/)[0].replace(/^end/,"")&&m.ends){switch(m.name){case"autoescape":f=c.autoescape;break;case"raw":j=!1}return void L.pop()}j||t.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',i,c.filename)}if(!j){switch(d=(h=e.split(/\s+(.+)?/)).shift(),l.hasOwnProperty(d)||t.throwError('Unexpected tag "'+e+'"',i,c.filename),s=r.read(t.strip(h.join(" "))),u=new a(s,p,!1,i,c.filename),(y=l[d]).parse(h[1],i,u,o,L,c,n)||t.throwError('Unexpected tag "'+d+'"',i,c.filename),u.parse(),g=u.out,d){case"autoescape":f="false"!==g[0]&&g[0];break;case"raw":j=!0}var v;return"function"==typeof y.lowerExpr&&(v=y.lowerExpr(u,s,h[1],i)),{block:!!l[d].block,compile:y.compile,args:g,content:[],ends:y.ends,name:d,irExpr:v}}}(e.replace(O,""),_))&&("extends"===i.name?S=i.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,""):i.block&&!L.length&&(F[i.args.join("")]=i)),j&&!i&&(i=e);else if(j||!t.startsWith(e,A)&&!t.endsWith(e,N))i=u?e.replace(/^\s*/,""):e,u=!1;else if(t.startsWith(e,A)&&t.endsWith(e,N))return;m&&I.length&&("string"==typeof(v=I.pop())?v=M(v):v.content&&v.content.length&&(E=M(v.content.pop()),v.content.push(E)),I.push(v)),i&&(L.length?L[L.length-1].content.push(i):I.push(i),i.name&&i.ends&&L.push(i),s=e.match(/\n/g),_+=s?s.length:0)}}),{name:c.filename,parent:S,tokens:I,blocks:F}},e.compile=E().compile}}),C=t({"lib/tags/import.js"(e){var t=n(),r=o(),a=E(),i=m().dangerousProps;e.compile=function(e,n,o,a,i){if(i&&"async"===i.codegenMode){var s=n[n.length-1],c=n[0].path;return r.importDeferred(r.literal("string",c),s,i.filename||"")}var l=n.pop(),p=[],u=[];t.each(n,function(e){(e.isImport?u:p).push(e)});var f=t.map(p,function(e){return e.name}).join("|"),h="_ctx."+l+' = {};\n var _output = "";\n',d=t.map(p,function(e){return{ex:new RegExp("_ctx."+e.name+"(\\W)(?!"+f+")","g"),re:"_ctx."+l+"."+e.name+"$1"}}),y=[];return t.each(u,function(e){t.each(e.boundNames,function(e){y.push({ex:new RegExp("_ctx\\."+e+"(\\W)","g"),re:"_ctx."+l+"."+e+"$1"})})}),t.each(u,function(e){var r=e.compiled;t.each(y,function(e){r=r.replace(e.ex,e.re)}),h+=r}),t.each(p,function(e){var r=e.compiled;t.each(d,function(e){r=r.replace(e.ex,e.re)}),t.each(y,function(e){r=r.replace(e.ex,e.re)}),h+=r}),h},e.parse=function(e,r,n,o,s,c,l){var p,u,f=w().compile,h={resolveFrom:c.filename},d=t.extend({},c,h),y=!(!c||"async"!==c.codegenMode);return n.on(o.STRING,function(e){var n=this;if(void 0!==p)throw new Error("Unexpected string "+e.match+" on line "+r+".");if(p=e.match.replace(/^("|')|("|')$/g,""),y)n.out.push({path:p});else{var o=l.parseFile(p,h).tokens;t.each(o,function(e){var t,r="";e&&e.compile&&("import"!==e.name?"macro"===e.name&&(t=e.args[0],r+=a.compile([e.compile(f,e.args,e.content,[],d)],[],d)+"\n",n.out.push({compiled:r,name:t})):n.out.push({compiled:e.compile(f,e.args.slice(),e.content,[],d)+"\n",isImport:!0,boundNames:[e.args[e.args.length-1]]}))})}}),n.on(o.VAR,function(e){if(void 0===p||u)throw new Error('Unexpected variable "'+e.match+'" on line '+r+".");if("as"!==e.match){if(-1!==i.indexOf(e.match))throw new Error('Unsafe import alias "'+e.match+'" is not allowed (CVE-2023-25345) on line '+r+".");return u=e.match,this.out.push(u),!1}}),!0},e.block=!0}}),b=t({"lib/tags/include.js"(e){var t=o(),r=c(),n="ignore",a="missing",i="only";e.compile=function(e,r,n,o,s,c,l){var p=r.shift(),u=r.indexOf(i),f=-1!==u&&r.splice(u,1),h=(r.pop()||"").replace(/\\/g,"\\\\"),d=r[r.length-1]===a&&r.pop(),y=r.join("");return l&&l.irExpr&&(p=l.irExpr.file,y=void 0!==l.irExpr.context?l.irExpr.context:void 0),s&&"async"===s.codegenMode?t.includeDeferred(p,y||void 0,!!f,!!d,h):t.include(p,y||void 0,!!f,!!d,h)},e.lowerExpr=function(e,t){var o,a,s=0,c=-1,l=-1,p=-1;for(o=0;o<t.length;o++){if((a=t[o]).type===r.FILTER||a.type===r.FILTEREMPTY)return;a.type!==r.PARENOPEN&&a.type!==r.BRACKETOPEN&&a.type!==r.ARRAYOPEN&&a.type!==r.CURLYOPEN&&a.type!==r.FUNCTION&&a.type!==r.METHODOPEN?a.type!==r.PARENCLOSE&&a.type!==r.BRACKETCLOSE&&a.type!==r.CURLYCLOSE?0===s&&a.type===r.VAR&&(-1===c&&"with"===a.match?c=o:-1!==c&&-1===l&&a.match===i?l=o:-1===p&&a.match===n&&(p=o)):s--:s++}var u=t.length;-1!==c?u=c:-1!==p&&(u=p);var f=t.slice(0,u);if(0!==f.length){var h={file:e.parseExpr(f)};if(-1!==c){var d=t.length;-1!==l?d=l:-1!==p&&(d=p);var y=t.slice(c+1,d);y.length>0&&(h.context=e.parseExpr(y))}return h}},e.parse=function(e,t,r,o,s,c){var l,p;return r.on(o.STRING,function(e){return!!l||(l=e.match,void this.out.push(l))}),r.on(o.VAR,function(e){if(!l)return l=e.match,!0;if(p||"with"!==e.match){if(!p||e.match!==i||"with"===this.prevToken.match){if(e.match===n)return!1;if(e.match===a){if(this.prevToken.match!==n)throw new Error('Unexpected token "'+a+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===n)throw new Error('Expected "'+a+'" on line '+t+' but found "'+e.match+'".');return!0}this.out.push(e.match)}else p=!0}),r.on("end",function(){this.out.push(c.filename||null)}),!0}}}),T=t({"lib/tags/macro.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s=r.shift();return t.macro(s,r,[t.legacyJS(e(n,o,a,i))])};var r=m().dangerousProps;e.parse=function(e,t,n,o){var a;return n.on(o.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");return a=e.match,void this.out.push(a)}if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro argument "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.push({name:e.match})}),n.on(o.FUNCTION,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a),this.state.push(o.FUNCTION)}}),n.on(o.FUNCTIONEMPTY,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a)}}),n.on(o.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(o.COMMA,function(){}),n.on("*",function(){}),!0},e.ends=!0,e.block=!0}}),R=t({"lib/tags/parent.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){if(!o||!o.length)return"";for(var s,c,l=r[0],p=o.length,u=0;u<p;u+=1)if((s=o[u]).blocks&&s.blocks.hasOwnProperty(i)&&l!==s.name){var f=(c=s.blocks[i]).compile(e,[i],c.content,o.slice(u+1),a);return t.parent(f&&f.body?f.body.concat([t.legacyJS("\n")]):[t.legacyJS("\n")])}},e.parse=function(e,t,r,n,o,a){return r.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),r.on("end",function(){this.out.push(a.filename)}),!0}}}),A=t({"lib/tags/raw.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s,c=[];for(s=0;s<n.length;s++)"string"==typeof n[s]?c.push(t.raw(n[s])):c.push(t.legacyJS(e([n[s]],o,a,i)));return c},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},e.ends=!0}}),N=t({"lib/tags/set.js"(e){var t=o(),r=c(),n=/^_ctx\.([a-zA-Z_$][\w$]*)((?:\.[a-zA-Z_$][\w$]*)*)$/;e.compile=function(e,r,o,a,i,s,c){var l=r[0],p="string"==typeof l&&n.exec(l);if(p){var u=[p[1]];if(p[2])for(var f=p[2].split("."),h=1;h<f.length;h++)u.push(f[h]);l=t.varRef(u)}var d=c&&c.irExpr?c.irExpr:r.slice(2).join(" ");return t.set(l,r[1],d)};var a=m().dangerousProps;e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.ASSIGNMENT){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY||a[n].type===r.ASSIGNMENT)return;return e.parseExpr(a)}},e.parse=function(e,t,r,n){var o,i="";return r.on(n.VAR,function(e){if(o)o+="_ctx."+e.match;else{if(r.out.length)return!0;for(var n=e.match.split("."),s=0;s<n.length;s++)if(-1!==a.indexOf(n[s]))throw new Error('Unsafe assignment to "'+n[s]+'" is not allowed (CVE-2023-25345) on line '+t+".");i+=e.match}}),r.on(n.BRACKETOPEN,function(e){if(o||this.out.length)return!0;o=e.match}),r.on(n.STRING,function(e){if(!o||this.out.length)return!0;var r=e.match.replace(/^['"]|['"]$/g,"");if(-1!==a.indexOf(r))throw new Error('Unsafe assignment to "'+r+'" via bracket notation is not allowed (CVE-2023-25345) on line '+t+".");o+=e.match}),r.on(n.BRACKETCLOSE,function(e){return!(o&&!this.out.length)||(i+=o+e.match,void(o=void 0))}),r.on(n.DOTKEY,function(e){if(!o&&!i)return!0;if(-1!==a.indexOf(e.match))throw new Error('Unsafe assignment to "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");i+="."+e.match}),r.on(n.ASSIGNMENT,function(e){if(this.out.length||!i)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push("_ctx."+i),this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),!0},e.block=!0}}),k=t({"lib/tags/spaceless.js"(e){n();e.compile=function(e,t,r,n,o,a){var i=e(r,n,o,a);return i+='_output = _output.replace(/^\\s+/, "")\n .replace(/>\\s+</g, "><")\n .replace(/\\s+$/, "");\n'},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},e.ends=!0}}),P=t({"lib/tags/index.js"(e){e.autoescape=a(),e.block=i(),e.else=s(),e.elseif=p(),e.elif=e.elseif,e.extends=u(),e.filter=g(),e.for=v(),e.if=l(),e.import=C(),e.include=b(),e.macro=T(),e.parent=R(),e.raw=A(),e.set=N(),e.spaceless=k()}}),_=t({"browser/stubs/fs.js"(e,t){t.exports={}}}),L=t({"node_modules/path-browserify/index.js"(e,t){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=s,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,a=s,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var o={resolve:function(){for(var e,t="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),r(i),0!==i.length&&(t=i+"/"+t,o=47===i.charCodeAt(0))}return t=n(t,!o),o?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&o&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var a=e.length,i=a-n,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var c=t.length-s,l=i<c?i:c,p=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===t.charCodeAt(s+u))return t.slice(s+u+1);if(0===u)return t.slice(s+u)}else i>l&&(47===e.charCodeAt(n+u)?p=u:0===u&&(p=0));break}var f=e.charCodeAt(n+u);if(f!==t.charCodeAt(s+u))break;47===f&&(p=u)}var h="";for(u=n+p+1;u<=a;++u)u!==a&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+p):(s+=p,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,a=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!i){o=n+1;break}}else-1===c&&(i=!1,c=n+1),s>=0&&(l===t.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!i){o=n+1;break}}else-1===a&&(i=!1,a=n+1);return-1===a?"":e.slice(o,a)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(a=!1,o=s+1),46===c?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){n=s+1;break}}return-1===t||-1===o||0===i||1===i&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),a=47===o;a?(t.root="/",n=1):n=0;for(var i=-1,s=0,c=-1,l=!0,p=e.length-1,u=0;p>=n;--p)if(47!==(o=e.charCodeAt(p)))-1===c&&(l=!1,c=p+1),46===o?-1===i?i=p:1!==u&&(u=1):-1!==i&&(u=-1);else if(!l){s=p+1;break}return-1===i||-1===c||0===u||1===u&&i===c-1&&i===s+1?-1!==c&&(t.base=t.name=0===s&&a?e.slice(1,c):e.slice(s,c)):(0===s&&a?(t.name=e.slice(1,i),t.base=e.slice(1,c)):(t.name=e.slice(s,i),t.base=e.slice(s,c)),t.ext=e.slice(i,c)),s>0?t.dir=e.slice(0,s-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}}),S=t({"packages/swig-core/lib/loaders/filesystem.js"(e,t){var r=_(),n=L();t.exports=function(e,t){var o={};return t=t||"utf8",e=e?n.normalize(e):null,o.resolve=function(t,r){return r=e||(r?n.dirname(r):process.cwd()),n.resolve(r,t)},o.load=function(e,n){if(!r||n&&!r.readFile||!r.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");if(e=o.resolve(e),!n)return r.readFileSync(e,t);r.readFile(e,t,n)},o}}}),I=t({"packages/swig-core/lib/loaders/memory.js"(e,t){var n=L(),o=r();t.exports=function(e,t){var r={};return t=t?n.normalize(t):null,r.resolve=function(e,r){return r=t||(r?n.dirname(r):"/"),n.resolve(r,e)},r.load=function(t,r){var n,a;if(a=[t,t.replace(/^(\/|\\)/,"")],(n=e[a[0]]||e[a[1]])||o.throwError('Unable to find template "'+t+'".'),!r)return n;r(null,n)},r}}}),F=t({"packages/swig-core/lib/loaders/index.js"(e){e.fs=S(),e.memory=I()}}),j=t({"lib/loaders/index.js"(e,t){t.exports=F()}}),U=t({"lib/async/pre-walker.js"(e){var t=n();function r(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}function o(e,t,r){var n=e.substr(t.length,e.length-t.length-r.length);return"-"===n.charAt(0)&&(n=n.substr(1)),"-"===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),n.replace(/^\s+|\s+$/g,"")}e.scan=function(e,n){e=e.replace(/\r\n/g,"\n");var a,i,s,c,l,p=function(e){var t="[\\s\\S]*?",n=r(e.varControls[0]),o=r(e.varControls[1]),a=r(e.tagControls[0]),i=r(e.tagControls[1]),s=r(e.cmtControls[0]),c=r(e.cmtControls[1]);return new RegExp("("+a+t+i+"|"+n+t+o+"|"+s+t+c+")")}(n),u=n.tagControls[0],f=n.tagControls[1],h=n.rawTag,d="end"+h,y=new RegExp("^("+n.keywords.join("|")+")\\s+[\"\\']([^\"\\']+)[\"\\']"),g=e.split(p),m=[],v=!1;for(a=0;a<g.length;a+=1)"string"==typeof(i=g[a])&&i&&t.startsWith(i,u)&&t.endsWith(i,f)&&((c=(s=o(i,u,f)).split(/\s+/)[0])!==h?c!==d?v||(l=y.exec(s))&&m.push({kind:l[1],path:l[2]}):v=!1:v=!0);return m},e.walk=function(t,r,n){var o={},a={};return new Promise(function(i,s){var c=0,l=[],p=!1;function u(e){o.hasOwnProperty(e)||a[e]||(a[e]=!0,l.push(e))}function f(){for(;l.length>0&&!p;){var e=l.shift();c+=1,h(e)}0!==c||p||0!==l.length||i(o)}function h(t){r.load(t,function(a,i){if(!p){if(a)return p=!0,void s(a);if("string"!=typeof i)return p=!0,void s(new Error('Async loader returned non-string source for "'+t+'"'));var l,h,d;o[t]=i;try{l=e.scan(i,n)}catch(e){return p=!0,void s(e)}for(h=0;h<l.length;h+=1){try{d=r.resolve(l[h].path,t)}catch(e){return p=!0,void s(e)}u(d)}c-=1,f()}})}u(t),f()})},e.makeMemoryWrapper=function(e,t){return{resolve:function(t,r){return e.resolve(t,r)},load:function(e,r){var n=t[e];if("string"!=typeof n){var o=new Error('Pre-walked map missing path: "'+e+'"');if(r)return void r(o);throw o}if(!r)return n;r(null,n)}}}}}),M=t({"packages/swig-core/lib/cache.js"(e){e.shouldCache=function(e,t){return(e=e||{}).hasOwnProperty("cache")&&!e.cache||!t},e.cacheGet=function(t,r,n,o){if(!e.shouldCache(r,n))return"memory"===n?o[t]:n.get(t)},e.cacheSet=function(t,r,n,o,a){e.shouldCache(r,o)||("memory"!==o?o.set(t,n):a[t]=n)}}}),Y=t({"packages/swig-core/lib/engine.js"(e){var t=r(),n=o(),a=E(),i=M(),s=Object.getPrototypeOf(async function(){}).constructor;function c(){return""}function l(e,r){var o={},i=[];return t.each(e.blocks,function(e){var s=e.args?e.args.slice(0):[],c=e.content?e.content.slice(0):[];if("block"!==e.name){var l=e.compile(a.compile,s,c,[],r,void 0,e);null!=l&&""!==l&&("string"!=typeof l?t.isArray(l)?t.each(l,function(e){i.push(e)}):"object"==typeof l&&"string"==typeof l.type&&i.push(l):i.push(n.legacyJS(l)))}else{var p=s.join(""),u=e.compile(a.compile,s,c,[],r,p,e);u&&"object"==typeof u&&"string"==typeof u.type&&(o[p]=u)}}),n.extendsDeferred(n.literal("string",e.parent),o,i,r.filename||"")}e.remapBlocks=function e(r,n){return t.map(n,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&r[n]&&(t=r[n]),t.content&&t.content.length&&(t.content=e(r,t.content)),t})},e.importNonBlocks=function(e,r){var n=[];t.each(e,function(e){n.push(e)}),t.each(n.reverse(),function(e){"block"!==e.name&&r.unshift(e)})},e.getParents=function(r,n,o){for(var a,i,s,c=r.parent,l=[],p=[];c;){if(!n||!n.filename)throw new Error('Cannot extend "'+c+'" because current template has no filename.');if(a=a||n.filename,a=o.resolve(c,a),c=(i=o.cacheGet(a,n)||o.parseFile(a,t.extend({},n,{filename:a}))).parent,-1!==l.indexOf(a))throw new Error('Illegal circular extends of "'+a+'".');l.push(a),p.push(i)}for(s=p.length,s=p.length-2;s>=0;s-=1)p[s].tokens=e.remapBlocks(p[s].blocks,p[s+1].tokens),e.importNonBlocks(p[s].blocks,p[s].tokens);return p},e.buildTemplateFunction=function(e,t,r){if(r&&"async"===r.codegenMode){var n=' var _ext = _swig.extensions,\n _output = "",\n _exports = {};\n'+a.compile(e,t,r)+"\n return { output: _output, exports: _exports };\n";return new s("_swig","_ctx","_filters","_utils","_fn","_blocks",n)}var o=' var _ext = _swig.extensions,\n _output = "";\n'+a.compile(e,t,r)+"\n return _output;\n";return new Function("_swig","_ctx","_filters","_utils","_fn",o)},e.install=function(r,n){var o=n.parser,a=t.extend({},n.tags),s=t.extend({},n.filters),p=n.validateOptions,u=n.onCompileError;function f(e){return e&&e.locals?t.extend({},r.options.locals,e.locals):r.options.locals}function h(e,t){return i.cacheGet(e,t,r.options.cache,r.cache)}function d(e,t,n){i.cacheSet(e,t,n,r.options.cache,r.cache)}r.invalidateCache=function(){"memory"===r.options.cache&&(r.cache={})},r.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');s[e]=t},r.setTag=function(e,t,r,n,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof r)throw new Error('Tag "'+e+'" compile method is not a valid function.');a[e]={parse:t,compile:r,ends:n||!1,block:!!o}},r.setExtension=function(e,t){r.extensions[e]=t},r.parse=function(e,n){p(n);var i,c=f(n),l={};for(i in n)n.hasOwnProperty(i)&&"locals"!==i&&(l[i]=n[i]);return(n=t.extend({},r.options,l)).locals=c,o.parse(r,e,n,a,s)},r.parseFile=function(e,n){var o;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),o=r.options.loader.load(e),n.filename||(n=t.extend({filename:e},n)),r.parse(o,n)},r.precompile=function(t,n){var o,a,i=r.parse(t,n);n&&"async"===n.codegenMode&&i.parent?(o=[],i.tokens=[l(i,n)]):(o=function(t,n){return e.getParents(t,n,{resolve:function(e,t){return r.options.loader.resolve(e,t)},parseFile:r.parseFile,cacheGet:h})}(i,n),o.length&&(i.tokens=e.remapBlocks(i.blocks,o[0].tokens),e.importNonBlocks(i.blocks,i.tokens)));try{a=e.buildTemplateFunction(i,o,n)}catch(e){u(e,n)}return{tpl:a,tokens:i}},r.compile=function(e,n){var o,a,i,l=n?n.filename:null,p=l?h(l,n):null;if(p)return p;function u(e,n){var l;return l=e&&a?t.extend({},o,e):e&&!a?e:!e&&a?o:{},i.tpl(r,l,s,t,c,n)}return o=f(n),a=t.keys(o).length,i=r.precompile(e,n),t.extend(u,i.tokens),l&&d(l,n,u),u},r.compileFile=function(e,n,o){var a,i;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),n.filename||(n=t.extend({filename:e},n)),(i=h(e,n))?o?void o(null,i):i:o?void r.options.loader.load(e,function(e,t){if(e)o(e);else{var a;try{a=r.compile(t,n)}catch(e){return void o(e)}o(e,a)}}):(a=r.options.loader.load(e),r.compile(a,n))},r.getTemplate=function(e,n){var o;n=n||{};try{o=r.options.loader.resolve(e,n.resolveFrom)}catch(e){return Promise.reject(e)}var a=t.extend({},n,{filename:n.filename||o,codegenMode:"async",cache:!1});return new Promise(function(e,t){function n(n,o){if(n)t(n);else{var i;try{i=r.compile(o,a)}catch(e){return void t(e)}e(i)}}if(r.options.loader.load.length>=2)try{r.options.loader.load(o,n)}catch(e){n(e)}else{var i;try{i=r.options.loader.load(o)}catch(e){return void n(e)}n(null,i)}})},r.render=function(e,t){return r.compile(e,t)()},r.renderFile=function(e,t,n){return n?r.options.loader&&!0===r.options.loader.async?void r.getTemplate(e).then(function(e){return e(t)}).then(function(e){n(null,e.output)}).catch(n):void r.compileFile(e,{},function(e,r){var o;if(e)n(e);else{try{o=r(t)}catch(e){return void n(e)}n(null,o)}}):r.compileFile(e)(t)},r.run=function(e,n,o){var a=f({locals:n});return o&&d(o,{},e),e(r,a,s,t,c)}}}}),D=t({"lib/swig.js"(e){var t=n(),r=P(),o=y(),a=w(),i=h(),s=j(),c=U(),l=Y();e.version="2.5.1";var p,u={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory",loader:s.fs()};function f(e){if(e){if(t.each(["varControls","tagControls","cmtControls"],function(r){if(e.hasOwnProperty(r)){if(!t.isArray(e[r])||2!==e[r].length)throw new Error('Option "'+r+'" must be an array containing 2 different control strings.');if(e[r][0]===e[r][1])throw new Error('Option "'+r+'" open and close controls must not be the same.');t.each(e[r],function(e,t){if(e.length<2)throw new Error('Option "'+r+'" '+(t?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.');if(e.hasOwnProperty("loader")&&e.loader&&(!e.loader.load||!e.loader.resolve))throw new Error("Invalid loader option "+JSON.stringify(e.loader)+" found. Expected { load: function (pathname, cb) { ... }, resolve: function (to, from) { ... } }.")}}e.setDefaults=function(e){f(e),p.options=t.extend(p.options,e)},e.setDefaultTZOffset=function(e){i.tzOffset=e},e.Swig=function(e){f(e),this.options=t.extend({},u,e||{}),this.cache={},this.extensions={},l.install(this,{parser:a,tags:r,filters:o,validateOptions:f,onCompileError:function(e,r){t.throwError(e,null,r.filename)}});var n=this;function i(){return{varControls:n.options.varControls,tagControls:n.options.tagControls,cmtControls:n.options.cmtControls,rawTag:"raw",keywords:["extends","include","import"]}}this.renderFileAsync=function(e,t,r){"function"==typeof t&&(r=t,t=void 0);var o,a=n.options.loader;try{o=a.resolve(e)}catch(e){return void r(e)}c.walk(o,a,i()).then(function(e){var i,s,l=c.makeMemoryWrapper(a,e),p=n.options.loader;n.options.loader=l;try{i=n.renderFile(o,t)}catch(e){s=e}n.options.loader=p,s?r(s):r(null,i)},function(e){r(e)})},this.compileFileAsync=function(e,t,r){"function"==typeof t&&(r=t,t={});var o,a=n.options.loader;try{o=a.resolve(e)}catch(e){return void r(e)}c.walk(o,a,i()).then(function(e){var i,s,l=c.makeMemoryWrapper(a,e),p=n.options.loader;n.options.loader=l;try{i=n.compileFile(o,t)}catch(e){s=e}if(n.options.loader=p,s)r(s);else{r(null,function(e){var t=n.options.loader;n.options.loader=l;try{var r=i(e);return n.options.loader=t,r}catch(e){throw n.options.loader=t,e}})}},function(e){r(e)})}},p=new e.Swig,e.setFilter=p.setFilter,e.setTag=p.setTag,e.setExtension=p.setExtension,e.parseFile=p.parseFile,e.precompile=p.precompile,e.compile=p.compile,e.compileFile=p.compileFile,e.compileFileAsync=p.compileFileAsync,e.render=p.render,e.renderFile=p.renderFile,e.renderFileAsync=p.renderFileAsync,e.run=p.run,e.invalidateCache=p.invalidateCache,e.loaders=s}})();"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return D}):window.swig=D})();
3
+ (()=>{var e=Object.getOwnPropertyNames,t=(t,r)=>function(){return r||(0,t[e(t)[0]])((r={exports:{}}).exports,r),r.exports},r=t({"packages/swig-core/lib/utils.js"(e){var t;e.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},e.each=function(e,r){var n,o;if(t(e))for(n=0,o=e.length;n<o&&!1!==r(e[n],n,e);n+=1);else for(n in e)if(e.hasOwnProperty(n)&&!1===r(e[n],n,e))break;return e},e.isArray=t=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return!!e&&("object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf())},e.some=function(r,n){var o,a,i=0;if(t(r))for(a=r.length;i<a&&!(o=n(r[i],i,r));i+=1);else e.each(r,function(e,t){return!(o=n(e,t,r))});return!!o},e.map=function(e,r){var n,o=0,a=[];if(t(e))for(n=e.length;o<n;o+=1)a[o]=r(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(a[o]=r(e[o],o));return a},e.extend=function(){for(var e,t,r=arguments,n=r[0],o=r.length>1?Array.prototype.slice.call(r,1):[],a=0,i=o.length;a<i;a+=1)for(e in t=o[a]||{})t.hasOwnProperty(e)&&(n[e]=t[e]);return n},e.keys=function(t){return t?Object.keys?Object.keys(t):e.map(t,function(e,t){return t}):[]},e.throwError=function(e,t,r){throw t&&(e+=" on line "+t),r&&(e+=" in file "+r),new Error(e+".")},e.range=function(e,t){var r,n,o,a=[];if("number"==typeof e&&"number"==typeof t){if(e<=t)for(r=e;r<=t;r+=1)a.push(r);else for(r=e;r>=t;r-=1)a.push(r);return a}if("string"==typeof e&&"string"==typeof t&&1===e.length&&1===t.length){if((n=e.charCodeAt(0))<=(o=t.charCodeAt(0)))for(r=n;r<=o;r+=1)a.push(String.fromCharCode(r));else for(r=n;r>=o;r-=1)a.push(String.fromCharCode(r));return a}return a},e.slice=function(e,t,r,n){var o,a,i,s,c,l,p="string"==typeof e,u=[];function f(e){return e=Number(e),isNaN(e)?NaN:e<0?Math.ceil(e):Math.floor(e)}function h(e,t){return null==e?t:(e=f(e),isNaN(e)?t:(e<0?(e+=o)<a&&(e=a):e>i&&(e=i),e))}if(null==e||"number"!=typeof e.length)return p?"":[];if(o=e.length,null==n?n=1:(n=f(n),(isNaN(n)||0===n)&&(n=1)),n<0?(a=-1,i=o-1):(a=0,i=o),s=h(t,n<0?i:a),c=h(r,n<0?a:i),n>0)for(l=s;l<c;l+=n)u.push(e[l]);else for(l=s;l>c;l+=n)u.push(e[l]);return p?u.join(""):u},e.coerceOutput=function(e){return null==e?"":e}}}),n=t({"lib/utils.js"(e,t){t.exports=r()}}),o=t({"packages/swig-core/lib/ir.js"(e){function t(e,t){return void 0!==t&&(e.loc=t),e}e.template=function(e,r,n,o){var a={type:"Template",body:e};return void 0!==r&&(a.parent=r),void 0!==n&&(a.blocks=n),t(a,o)},e.text=function(e,r){return t({type:"Text",value:e},r)},e.output=function(e,r,n,o){var a={type:"Output",expr:e};return void 0!==r&&(a.filters=r),void 0!==n&&(a.safe=n),t(a,o)},e.filterCall=function(e,t){var r={name:e};return void 0!==t&&(r.args=t),r},e.ifStmt=function(e,r){return t({type:"If",branches:e},r)},e.ifBranch=function(e,t){return{test:e,body:t}},e.forStmt=function(e,r,n,o,a,i){var s={type:"For",value:e,iterable:r,body:n};return void 0!==o&&(s.key=o),void 0!==a&&(s.emptyBody=a),t(s,i)},e.block=function(e,r,n){return t({type:"Block",name:e,body:r},n)},e.include=function(e,r,n,o,a,i){var s={type:"Include",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importStmt=function(e,r,n){return t({type:"Import",path:e,alias:r},n)},e.macro=function(e,r,n,o){return t({type:"Macro",name:e,params:r,body:n},o)},e.macroParam=function(e,t){var r={name:e};return void 0!==t&&(r.default=t),r},e.call=function(e,r,n){return t({type:"Call",callee:e,args:r},n)},e.set=function(e,r,n,o){return t({type:"Set",target:e,op:r,value:n},o)},e.raw=function(e,r){return t({type:"Raw",value:e},r)},e.parent=function(e,r){var n={type:"Parent"};return void 0!==e&&(n.body=e),t(n,r)},e.autoescape=function(e,r,n){return t({type:"Autoescape",strategy:e,body:r},n)},e.filter=function(e,r,n,o){var a={type:"Filter",name:e,body:r};return void 0!==n&&(a.args=n),t(a,o)},e.withStmt=function(e,r,n,o){var a={type:"With",body:n};return void 0!==e&&(a.context=e),void 0!==r&&(a.isolated=r),t(a,o)},e.legacyJS=function(e,r){return t({type:"LegacyJS",js:e},r)},e.extendsDeferred=function(e,r,n,o,a){var i={type:"ExtendsDeferred",path:e};return void 0!==r&&(i.childBlocks=r),void 0!==n&&(i.childIRs=n),void 0!==o&&(i.resolveFrom=o),t(i,a)},e.includeDeferred=function(e,r,n,o,a,i){var s={type:"IncludeDeferred",path:e};return void 0!==r&&(s.context=r),void 0!==n&&(s.isolated=n),void 0!==o&&(s.ignoreMissing=o),void 0!==a&&(s.resolveFrom=a),t(s,i)},e.importDeferred=function(e,r,n,o){var a={type:"ImportDeferred",path:e,alias:r};return void 0!==n&&(a.resolveFrom=n),t(a,o)},e.fromImportDeferred=function(e,r,n,o){var a={type:"FromImportDeferred",path:e,imports:r};return void 0!==n&&(a.resolveFrom=n),t(a,o)},e.literal=function(e,r,n){return t({type:"Literal",kind:e,value:r},n)},e.varRef=function(e,r){return t({type:"VarRef",path:e},r)},e.varRefExists=function(e,r){return t({type:"VarRefExists",path:e},r)},e.access=function(e,r,n){return t({type:"Access",object:e,key:r},n)},e.binaryOp=function(e,r,n,o){return t({type:"BinaryOp",op:e,left:r,right:n},o)},e.unaryOp=function(e,r,n){return t({type:"UnaryOp",op:e,operand:r},n)},e.conditional=function(e,r,n,o){var a={type:"Conditional",test:e,then:r};return a.else=n,t(a,o)},e.arrayLiteral=function(e,r){return t({type:"ArrayLiteral",elements:e},r)},e.objectLiteral=function(e,r){return t({type:"ObjectLiteral",properties:e},r)},e.objectProperty=function(e,t){return{key:e,value:t}},e.fnCall=function(e,r,n){return t({type:"FnCall",callee:e,args:r},n)},e.filterCallExpr=function(e,r,n,o){var a={type:"FilterCall",name:e,input:r};return void 0!==n&&(a.args=n),t(a,o)}}}),a=t({"lib/tags/autoescape.js"(e){var t=n(),r=o(),a=["html","js"];e.compile=function(e,t,n,o,a,i){var s=e(n,o,a,i);return r.autoescape(function(e){if("true"===e)return!0;if("false"===e)return!1;if("string"==typeof e&&e.length>=2){var t=e.charAt(0),r=e.charAt(e.length-1);if('"'===t&&'"'===r||"'"===t&&"'"===r)return e.slice(1,-1)}return e}(t[0]),[r.legacyJS(s)])},e.parse=function(e,r,n,o,i,s){var c;return n.on("*",function(e){if(!c&&(e.type===o.BOOL||e.type===o.STRING&&-1===a.indexOf(e.match)))return this.out.push(e.match),void(c=!0);t.throwError('Unexpected token "'+e.match+'" in autoescape tag',r,s.filename)}),!0},e.ends=!0}}),i=t({"lib/tags/block.js"(e){var t=o();e.compile=function(e,r,n,o,a){var i=r.join("");return t.block(i,[t.legacyJS(e(n,o,a,i))])},e.parse=function(e,t,r){return r.on("*",function(e){this.out.push(e.match)}),!0},e.ends=!0,e.block=!0}}),s=t({"lib/tags/else.js"(e){e.compile=function(){return"} else {\n"},e.parse=function(e,t,r,n,o){return r.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}}}),c=t({"packages/swig-core/lib/tokentypes.js"(e,t){t.exports={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,QMARK:27,UNKNOWN:100}}}),l=t({"lib/tags/if.js"(e){var t=o(),r=c();e.compile=function(e,r,n,o,a,i,s){var c,l,p=[],u=s&&s.irExpr?s.irExpr:t.legacyJS(r.join(" ")),f=[];for(c=0;c<n.length;c++)!(l=n[c])||"elseif"!==l.name&&"else"!==l.name?f.push(l):(p.push(t.ifBranch(u,[t.legacyJS(e(f,o,a,i))])),u="else"===l.name?null:l.irExpr?l.irExpr:t.legacyJS(l.args.join(" ")),f=[]);return p.push(t.ifBranch(u,[t.legacyJS(e(f,o,a,i))])),t.ifStmt(p)},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,t,r,n){if(void 0===e)throw new Error("No conditional statement provided on line "+t+".");return r.on(n.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===n.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),r.on(n.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),r.on(n.BOOL,function(e){this.out.push(e.match)}),r.on(n.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},e.ends=!0}}),p=t({"lib/tags/elseif.js"(e){var t=l().parse,r=c();e.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},e.lowerExpr=function(e,t){var n;for(n=0;n<t.length;n++)if(t[n].type===r.FILTER||t[n].type===r.FILTEREMPTY)return;return e.parseExpr(t)},e.parse=function(e,r,n,o,a){return t(e,r,n,o,a)&&a.length&&"if"===a[a.length-1].name}}}),u=t({"lib/tags/extends.js"(e){var t=c();e.compile=function(){},e.parse=function(){return!0},e.lowerExpr=function(e,r){var n,o,a=[];for(n=0;n<r.length;n+=1)(o=r[n]).type!==t.WHITESPACE&&a.push(o);if(a.length&&(1!==a.length||a[0].type!==t.STRING))return{file:e.parseExpr(r)}},e.ends=!1}}),f=t({"packages/swig-core/lib/dateformatter.js"(e){var t=r(),n={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},o={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};e.tzOffset=0,e.DateZ=function(){var r=["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],n=["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"],o=this;o.date=o.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments[0])):new Date,o.timezoneOffset=o.dateZ.getTimezoneOffset(),t.each(n,function(e){o[e]=function(){return o.dateZ[e]()}}),t.each(r,function(e){o[e]=function(){return o.date[e]()}}),this.setTimezoneOffset(e.tzOffset)},e.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},e.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},e.D=function(e){return o.abbr[e.getDay()]},e.j=function(e){return e.getDate()},e.l=function(e){return o.full[e.getDay()]},e.N=function(e){var t=e.getDay();return t>=1?t:7},e.S=function(e){var t=e.getDate();return t%10==1&&11!==t?"st":t%10==2&&12!==t?"nd":t%10==3&&13!==t?"rd":"th"},e.w=function(e){return e.getDay()},e.z=function(t,r,n){var o=t.getFullYear(),a=new e.DateZ(o,t.getMonth(),t.getDate(),12,0,0),i=new e.DateZ(o,0,1,12,0,0);return a.setTimezoneOffset(r,n),i.setTimezoneOffset(r,n),Math.round((a-i)/864e5)},e.W=function(e){var t,r=new Date(e.valueOf()),n=(e.getDay()+6)%7;return r.setDate(r.getDate()-n+3),t=r.valueOf(),r.setMonth(0,1),4!==r.getDay()&&r.setMonth(0,1+(4-r.getDay()+7)%7),1+Math.ceil((t-r)/6048e5)},e.F=function(e){return n.full[e.getMonth()]},e.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},e.M=function(e){return n.abbr[e.getMonth()]},e.n=function(e){return e.getMonth()+1},e.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},e.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},e.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},e.Y=function(e){return e.getFullYear()},e.y=function(e){return e.getFullYear().toString().substr(2)},e.a=function(e){return e.getHours()<12?"am":"pm"},e.A=function(e){return e.getHours()<12?"AM":"PM"},e.B=function(e){var t,r=e.getUTCHours();return r=23===r?0:r+1,t=Math.abs((60*(60*r+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},e.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},e.G=function(e){return e.getHours()},e.h=function(e){var t=e.getHours();return(t<10||12<t&&22>t?"0":"")+(t<12?t:t-12)},e.H=function(e){var t=e.getHours();return(t<10?"0":"")+t},e.i=function(e){var t=e.getMinutes();return(t<10?"0":"")+t},e.s=function(e){var t=e.getSeconds();return(t<10?"0":"")+t},e.O=function(e){var t=e.getTimezoneOffset();return(t<0?"-":"+")+(t/60<10?"0":"")+Math.abs(t/60)+"00"},e.Z=function(e){return 60*e.getTimezoneOffset()},e.c=function(e){return e.toISOString()},e.r=function(e){return e.toUTCString()},e.U=function(e){return e.getTime()/1e3}}}),h=t({"lib/dateformatter.js"(e,t){t.exports=f()}}),d=t({"packages/swig-core/lib/filters.js"(e){var t=r();e.iterateFilter=function(e){var r=this,n={};return t.isArray(e)?t.map(e,function(e){return r.apply(null,arguments)}):"object"==typeof e?(t.each(e,function(e,t){n[t]=r.apply(null,arguments)}),n):void 0}}}),y=t({"lib/filters.js"(e){var t=n(),r=h(),o=d().iterateFilter;function a(e){return"<"===e?"&lt;":">"===e?"&gt;":'"'===e?"&quot;":"&#39;"}e.addslashes=function(t){var r=o.apply(e.addslashes,arguments);return void 0!==r?r:t.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},e.capitalize=function(t){var r=o.apply(e.capitalize,arguments);return void 0!==r?r:t.toString().charAt(0).toUpperCase()+t.toString().substr(1).toLowerCase()},e.date=function(e,t,n,o){var a,i=t.length,s=new r.DateZ(e),c=0,l="";for(n&&s.setTimezoneOffset(n,o);c<i;c+=1)"\\"===(a=t.charAt(c))?l+=(c+=1)<i?t.charAt(c):a:r.hasOwnProperty(a)?l+=r[a](s,n,o):l+=a;return l},e.default=function(e,t){return void 0===e||!e&&"number"!=typeof e?t:e},e.escape=function(t,r){var n,i,s,c,l;if(null==t)return t;if("string"!==(n=typeof t))return"object"===n&&void 0!==(s=o.apply(e.escape,arguments))?s:t;if("js"===r){for(i=t.replace(/\\/g,"\\u005C"),s="",c=0;c<i.length;c+=1)s+=(l=i.charCodeAt(c))<32?"\\u00"+(l=(l=l.toString(16).toUpperCase()).length<2?"0"+l:l):i[c];return s.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B")}return t.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&amp;").replace(/[<>"']/g,a)},e.e=e.escape,e.first=function(e){return"object"!=typeof e||t.isArray(e)?"string"==typeof e?e.substr(0,1):e[0]:e[t.keys(e)[0]]},e.groupBy=function(e,r){if(!t.isArray(e))return e;var n={};return t.each(e,function(e){if(e.hasOwnProperty(r)){var o=e[r],a=t.extend({},e);delete a[r],n[o]||(n[o]=[]),n[o].push(a)}}),n},e.join=function(e,r){if(t.isArray(e))return e.join(r);if("object"==typeof e){var n=[];return t.each(e,function(e){n.push(e)}),n.join(r)}return e},e.json=function(e,t){return JSON.stringify(e,null,t||0)},e.json_encode=e.json,e.last=function(e){if("object"==typeof e&&!t.isArray(e)){var r=t.keys(e);return e[r[r.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},e.length=function(e){return"object"!=typeof e||t.isArray(e)?e.hasOwnProperty("length")?e.length:"":t.keys(e).length},e.lower=function(t){var r=o.apply(e.lower,arguments);return void 0!==r?r:t.toString().toLowerCase()},e.raw=function(t){return e.safe(t)},e.raw.safe=!0,e.replace=function(e,t,r,n){var o=new RegExp(t,n);return e.replace(o,r)},e.reverse=function(t){return e.sort(t,!0)},e.safe=function(e){return e},e.safe.safe=!0,e.sort=function(e,r){var n;if(t.isArray(e))n=t.extend([],e).sort();else switch(typeof e){case"object":n=t.keys(e).sort();break;case"string":return n=e.split(""),r?n.reverse().join(""):n.sort().join("")}return n&&r?n.reverse():n||e},e.striptags=function(t){var r=o.apply(e.striptags,arguments);return void 0!==r?r:t.toString().replace(/(<([^>]+)>)/gi,"")},e.title=function(t){var r=o.apply(e.title,arguments);return void 0!==r?r:t.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},e.uniq=function(e){var r;return e&&t.isArray(e)?(r=[],t.each(e,function(e){-1===r.indexOf(e)&&r.push(e)}),r):""},e.upper=function(t){var r=o.apply(e.upper,arguments);return void 0!==r?r:t.toString().toUpperCase()},e.url_encode=function(t){var r=o.apply(e.url_encode,arguments);return void 0!==r?r:encodeURIComponent(t)},e.url_decode=function(t){var r=o.apply(e.url_decode,arguments);return void 0!==r?r:decodeURIComponent(t)}}}),g=t({"lib/tags/filter.js"(e){var t=y(),r=o(),n=c();e.compile=function(e,t,n,o,a,i,s){var c=t.shift().replace(/\($/,""),l=e(n,o,a,i);")"===t[t.length-1]&&t.pop();var p=s&&s.irExpr?s.irExpr:t.length?t:void 0;return r.filter(c,[r.legacyJS(l)],p)},e.lowerExpr=function(e,t){for(var r=0;r<t.length&&t[r].type===n.WHITESPACE;)r+=1;if(!(r>=t.length)){var o=t[r];if(o.type!==n.VAR){if(o.type===n.FUNCTIONEMPTY)return[];if(o.type===n.FUNCTION){var a,i=1,s=r+1,c=[];for(a=r+1;a<t.length;a+=1){var l=t[a];if(l.type===n.FILTER||l.type===n.FILTEREMPTY)return;if(l.type!==n.PARENOPEN&&l.type!==n.FUNCTION&&l.type!==n.BRACKETOPEN&&l.type!==n.CURLYOPEN){if(l.type!==n.PARENCLOSE&&l.type!==n.BRACKETCLOSE&&l.type!==n.CURLYCLOSE)l.type===n.COMMA&&1===i&&(c.push(t.slice(s,a)),s=a+1);else if(0===(i-=1)){a>s&&c.push(t.slice(s,a));break}}else i+=1}if(0===i){var p=[];for(a=0;a<c.length;a+=1)p.push(e.parseExpr(c[a]));return p}}}}},e.parse=function(e,r,n,o){var a;function i(e){if(!t.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+r+".")}return n.on(o.FUNCTION,function(e){return!!a||(i(a=e.match.replace(/\($/,"")),this.out.push(e.match),void this.state.push(e.type))}),n.on(o.VAR,function(e){return!!a||(i(a=e.match),void this.out.push(a))}),!0},e.ends=!0}}),m=t({"packages/swig-core/lib/security.js"(e){e.dangerousProps=["__proto__","constructor","prototype"]}}),v=t({"lib/tags/for.js"(e){var t=o(),r=c(),n=m().dangerousProps;e.compile=function(e,r,n,o,a,i,s){var c,l=r.shift(),p="__k";r[0]&&","===r[0]&&(r.shift(),p=l,l=r.shift()),c=s&&s.irExpr?s.irExpr:r.join("");var u=e(n,o,a,i);return t.forStmt(l,c,[t.legacyJS(u)],p)},e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.COMPARATOR&&"in"===t[n].match){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY)return;return e.parseExpr(a)}},e.parse=function(e,t,r,o){var a,i;return r.on(o.NUMBER,function(e){var r=this.state.length?this.state[this.state.length-1]:null;if(!i||r!==o.ARRAYOPEN&&r!==o.CURLYOPEN&&r!==o.CURLYCLOSE&&r!==o.FUNCTION&&r!==o.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),r.on(o.VAR,function(e){if(i&&a)return!0;if(-1!==e.match.indexOf("."))throw new Error('Loop variable "'+e.match+'" must be a bare identifier in "for" tag on line '+t+".");if(-1!==n.indexOf(e.match))throw new Error('Unsafe loop variable "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.length||(a=!0),this.out.push(e.match)}),r.on(o.COMMA,function(e){if(!a||this.prevToken.type!==o.VAR)return!0;this.out.push(e.match)}),r.on(o.COMPARATOR,function(e){if("in"!==e.match||!a)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0,this.filterApplyIdx.push(this.out.length)}),!0},e.ends=!0}}),E=t({"packages/swig-core/lib/backend.js"(e){var t=r(),n=m(),a=o();function i(e){return e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')}function s(e){return{dangerousProps:(e=e||{}).dangerousProps||n.dangerousProps,throwError:e.throwError||t.throwError}}function c(e,r){switch(e&&"string"==typeof e.type||r.throwError("emitExpr: expected an IR expression node"),e.type){case"Literal":return function(e,t){switch(e.kind){case"string":return JSON.stringify(e.value);case"number":return String(e.value);case"bool":return e.value?"true":"false";case"null":return"null";case"undefined":return"undefined"}t.throwError('emitLiteral: unknown literal kind "'+e.kind+'"')}(e,r);case"VarRef":return function(e,r){t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRef: path must be a non-empty array");return t.each(e.path,function(t){l(t,r,e)}),f(e.path)}(e,r);case"VarRefExists":return p(e,r);case"Access":return function(e,t){e.key&&"Literal"===e.key.type&&"string"===e.key.kind&&l(e.key.value,t,e);return c(e.object,t)+"["+c(e.key,t)+"]"}(e,r);case"BinaryOp":return function(e,t){var r=c(e.left,t),n=c(e.right,t);if(o=e.op,"+"===o||"-"===o||"*"===o||"/"===o||"%"===o)return r+" "+e.op+" "+n;var o;if("in"===e.op)return r+" in "+n;if("~"===e.op)return"(String("+r+") + String("+n+"))";if("??"===e.op&&e.left&&"VarRef"===e.left.type){return"("+p(a.varRefExists(e.left.path,e.left.loc),t)+" ? "+r+" : "+n+")"}return r+e.op+n}(e,r);case"UnaryOp":return function(e,t){var r=c(e.operand,t);e.operand&&"BinaryOp"===e.operand.type&&(r="("+r+")");return e.op+r}(e,r);case"Conditional":return function(e,t){return"("+c(e.test,t)+" ? "+c(e.then,t)+" : "+c(e.else,t)+")"}(e,r);case"ArrayLiteral":return function(e,r){var n=[];return t.each(e.elements,function(e){n.push(c(e,r))}),"["+n.join(", ")+"]"}(e,r);case"ObjectLiteral":return function(e,r){var n=[];return t.each(e.properties,function(e){n.push(c(e.key,r)+":"+c(e.value,r))}),"{"+n.join(", ")+"}"}(e,r);case"FnCall":return function(e,r){var n,o,a,i=[],s=e.callee;if(t.each(e.args,function(e){i.push(c(e,r))}),a=i.join(", "),s&&"VarRef"===s.type&&t.isArray(s.path))return t.each(s.path,function(e){l(e,r,s)}),1===s.path.length?"((typeof _ctx."+(n=s.path[0])+' !== "undefined") ? _ctx.'+n+" : ((typeof "+n+' !== "undefined") ? '+n+" : _fn))("+a+")":(o=s.path.slice(0,-1),"("+f(s.path)+" || _fn).call("+f(o)+(a?", "+a:"")+")");return"("+c(s,r)+")("+a+")"}(e,r);case"FilterCall":return function(e,r){var n=c(e.input,r),o="";if(e.args&&e.args.length){var a=[];t.each(e.args,function(e){a.push(c(e,r))}),o=", "+a.join(", ")}return'_filters["'+e.name+'"]('+n+o+")"}(e,r)}r.throwError('emitExpr: unknown IR expression type "'+e.type+'"')}function l(e,t,r){if(-1!==t.dangerousProps.indexOf(e)){var n=r&&r.loc&&r.loc.line||void 0,o=r&&r.loc&&r.loc.filename||void 0;t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',n,o)}}function p(e,r){return t.isArray(e.path)&&0!==e.path.length||r.throwError("emitVarRefExists: path must be a non-empty array"),t.each(e.path,function(t){l(t,r,e)}),"("+u(e.path,"_ctx.")+" || "+u(e.path,"")+")"}function u(e,r){var n=r+e[0],o="";return o="(typeof "+n+' !== "undefined" && '+n+" !== null",t.each(e,function(e,t){0!==t&&(o+=" && "+n+"."+e+" !== undefined && "+n+"."+e+" !== null",n+="."+e)}),o+=")"}function f(e){var t=e.join(".");return"("+u(e,"_ctx.")+" ? _ctx."+t+" : ("+u(e,"")+" ? "+t+' : ""))'}e.compile=function(r,o,c,p){var u="",f=t.isArray(r)?r:r.tokens,h=[];return t.each(f,function(r){if("string"!=typeof r)if(r&&"object"==typeof r&&"string"==typeof r.type&&"function"!=typeof r.compile)h.push(r);else{var n=r.compile(e.compile,r.args?r.args.slice(0):[],r.content?r.content.slice(0):[],o,c,p,r);null!=n&&""!==n&&("string"!=typeof n?t.isArray(n)?t.each(n,function(e){h.push(e)}):"object"!=typeof n||"string"!=typeof n.type?h.push(a.legacyJS(String(n))):h.push(n):h.push(a.legacyJS(n)))}else h.push(a.text(r))}),t.each(h,function(r){if("Text"!==r.type&&"Raw"!==r.type)if("LegacyJS"!==r.type)if("Autoescape"!==r.type){if("If"===r.type){var a="";return t.each(r.branches,function(r,n){var o,s="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(s+='_output += "'+i(e.value)+'";\n'):s+=e.js}),null!==r.test?(o=r.test&&"object"==typeof r.test&&"LegacyJS"===r.test.type?r.test.js:"object"==typeof r.test&&"string"==typeof r.test.type?e.emitExpr(r.test):r.test,a+=0===n?"if ("+o+") { \n"+s:"} else if ("+o+") {\n"+s):a+="} else {\n"+s}),void(u+=a+"\n}")}if("Set"===r.type){var p,f;if(r.target&&"object"==typeof r.target&&"VarRef"===r.target.type){var h=s();t.isArray(r.target.path)&&0!==r.target.path.length||h.throwError("Set: target VarRef must have a non-empty path"),t.each(r.target.path,function(e){l(e,h,r.target)}),p="_ctx."+r.target.path.join(".")}else p=r.target;return f=r.value&&"object"==typeof r.value&&"string"==typeof r.value.type?e.emitExpr(r.value):r.value,void(u+=p+" "+r.op+" "+f+";\n")}if("For"!==r.type)if("Macro"!==r.type)if("Parent"!==r.type)if("Block"!==r.type){var d,y,g;if("Include"===r.type)return d=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(y="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),g=r.isolated&&y?y:y?"_utils.extend({}, _ctx, "+y+")":"_ctx",void(u+=(r.ignoreMissing?" try {\n":"")+"_output += _swig.compileFile("+d+', {resolveFrom: "'+r.resolveFrom+'"})('+g+");\n"+(r.ignoreMissing?"} catch (e) {}\n":""));if("IncludeDeferred"!==r.type)if("ImportDeferred"!==r.type){if("FromImportDeferred"===r.type){var m,v=r.imports||[];t.each(v,function(e){if(-1!==n.dangerousProps.indexOf(e.name))throw new Error('From-import name "'+e.name+'" is reserved.');var t=e.alias||e.name;if(-1!==n.dangerousProps.indexOf(t))throw new Error('From-import binding "'+t+'" is reserved.')}),m=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var E='{resolveFrom: "'+(r.resolveFrom||"")+'"}',x="";return t.each(v,function(e){var t=e.alias||e.name;x+=" _ctx."+t+' = _imp["'+e.name+'"];\n'}),void(u+="await (async function () {\n var _imp = (await (await _swig.getTemplate("+m+", "+E+"))(_ctx)).exports;\n"+x+"})();\n")}if("ExtendsDeferred"===r.type){var O;r.childIRs&&r.childIRs.length&&(u+=e.compile(r.childIRs,o,c)),u+="var _localChildBlocks = {};\n",r.childBlocks&&t.each(r.childBlocks,function(e,r){var n="";t.each(e.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(n+='_output += "'+i(e.value)+'";\n'):n+=e.js}),u+="_localChildBlocks["+JSON.stringify(r)+'] = async function (_ctx) {\n var _output = "";\n'+n+" return _output;\n};\n"}),u+="var _mergedBlocks = _utils.extend({}, _localChildBlocks, _blocks || {});\n",O=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var w='{resolveFrom: "'+(r.resolveFrom||"")+'"}';return u+="var _parentTpl = await _swig.getTemplate("+O+", "+w+");\n",u+="var _parentResult = await _parentTpl(_ctx, _mergedBlocks);\n",void(u+="_output = _parentResult.output;\n")}if("With"===r.type){var C;void 0!==r.context&&(C=r.context&&"object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context);var b,T="";return t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(T+='_output += "'+i(e.value)+'";\n'):T+=e.js}),b=r.isolated?void 0!==C?C:"{}":void 0!==C?"_utils.extend({}, _ctx, "+C+")":"_utils.extend({}, _ctx)",void(u+="(function (_ctx) {\n"+T+"})("+b+");\n")}if("Output"===r.type){if(r.expr&&"LegacyJS"===r.expr.type)return void(u+=r.expr.js);var R=e.emitExpr(r.expr);return r.filters&&r.filters.length&&t.each(r.filters,function(r){var n="";if(r.args&&r.args.length){var o=[];t.each(r.args,function(t){o.push(e.emitExpr(t))}),n=", "+o.join(", ")}R='_filters["'+r.name+'"]('+R+n+")"}),void(r.coerce?u+="_output += _utils.coerceOutput("+R+");\n":u+="_output += "+R+";\n")}if("Filter"!==r.type);else{var A="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(A+='_output += "'+i(e.value)+'";\n'):A+=e.js});var N='(function () {\n var _output = "";\n'+A+" return _output;\n})()",k="";if(r.args&&r.args.length){var P=[];t.each(r.args,function(t){t&&"object"==typeof t&&"string"==typeof t.type?P.push(e.emitExpr(t)):P.push(t)}),k=", "+P.join(", ")}u+='_output += _filters["'+r.name+'"]('+N+k+");\n"}}else{if(-1!==n.dangerousProps.indexOf(r.alias))throw new Error('Import alias "'+r.alias+'" is reserved.');var _;_=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path;var L='{resolveFrom: "'+(r.resolveFrom||"")+'"}';u+="_ctx."+r.alias+" = (await (await _swig.getTemplate("+_+", "+L+"))(_ctx)).exports;\n"}else{var S,I,F;S=r.path&&"object"==typeof r.path&&"string"==typeof r.path.type?e.emitExpr(r.path):r.path,void 0!==r.context&&(I="object"==typeof r.context&&"string"==typeof r.context.type?e.emitExpr(r.context):r.context),F=r.isolated&&I?I:I?"_utils.extend({}, _ctx, "+I+")":"_ctx";var j='{resolveFrom: "'+(r.resolveFrom||"")+'"}';u+=(r.ignoreMissing?" try {\n":"")+"_output += (await (await _swig.getTemplate("+S+", "+j+"))("+F+")).output;\n"+(r.ignoreMissing?"} catch (e) {}\n":"")}}else{if(c&&"async"===c.codegenMode){var U=JSON.stringify(r.name);return u+="if (_blocks && _blocks["+U+"]) {\n",u+=" _output += await _blocks["+U+"](_ctx);\n",u+="} else {\n",t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js}),void(u+="}\n")}t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js})}else t.each(r.body||[],function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else{var M="";t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(M+='_output += "'+i(e.value)+'";\n'):M+=e.js});var Y,D,B=r.params||[],V="";if(B.length&&"object"==typeof B[0]&&null!==B[0]&&"string"==typeof B[0].name){var J=[];t.each(B,function(t){J.push(t.name),t.default&&(V+=" if ("+t.name+" === undefined) { "+t.name+" = "+e.emitExpr(t.default)+"; }\n")}),Y=J.join(", ");var K=[];t.each(J,function(e){K.push(JSON.stringify(e))}),D=K.join(",")}else Y=B.join(""),D='"'+B.join('","')+'"';if(u+="_ctx."+r.name+" = function ("+Y+') {\n var _output = "",\n __ctx = _utils.extend({}, _ctx);\n'+V+" _utils.each(_ctx, function (v, k) {\n if (["+D+"].indexOf(k) !== -1) { delete _ctx[k]; }\n });\n"+M+"\n _ctx = _utils.extend(_ctx, __ctx);\n return _output;\n};\n_ctx."+r.name+".safe = true;\n",c&&"async"===c.codegenMode){if(-1!==n.dangerousProps.indexOf(r.name))throw new Error('Macro name "'+r.name+'" is reserved.');u+="_exports."+r.name+" = _ctx."+r.name+";\n"}}else{var W,$=r.value,z=r.key,G="",H=("_ctx.__loopcache"+Math.random()).replace(/\./g,""),Z="_ctx.",q="_ctx.loop";W=r.iterable&&"object"==typeof r.iterable&&"string"==typeof r.iterable.type?e.emitExpr(r.iterable):r.iterable,t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(G+='_output += "'+i(e.value)+'";\n'):G+=e.js});var Q=" if (!__l) { return; }\n";if(r.emptyBody){var X="";t.each(r.emptyBody,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(X+='_output += "'+i(e.value)+'";\n'):X+=e.js}),Q=" if (!__l || !__len) {\n"+X+" return;\n }\n"}u+="(function () {\n var __l = "+W+', __len = (_utils.isArray(__l) || typeof __l === "string") ? __l.length : _utils.keys(__l).length;\n'+Q+" var "+H+" = { loop: "+q+", "+$+": "+Z+$+", "+z+": "+Z+z+" };\n "+q+" = { first: false, index: 1, index0: 0, revindex: __len, revindex0: __len - 1, length: __len, last: false };\n _utils.each(__l, function ("+$+", "+z+") {\n "+Z+$+" = "+$+";\n "+Z+z+" = "+z+";\n "+q+".key = "+z+";\n "+q+".first = ("+q+".index0 === 0);\n "+q+".last = ("+q+".revindex0 === 0);\n "+G+" "+q+".index += 1; "+q+".index0 += 1; "+q+".revindex -= 1; "+q+".revindex0 -= 1;\n });\n "+q+" = "+H+".loop;\n "+Z+$+" = "+H+"."+$+";\n "+Z+z+" = "+H+"."+z+";\n "+H+" = undefined;\n})();\n"}}else t.each(r.body,function(e){"LegacyJS"!==e.type?"Text"!==e.type&&"Raw"!==e.type||(u+='_output += "'+i(e.value)+'";\n'):u+=e.js});else u+=r.js;else u+='_output += "'+i(r.value)+'";\n'}),u},e.emitExpr=function(e,t){return c(e,s(t))}}}),x=t({"lib/lexer.js"(e){var t=n(),r=c(),o=[{type:r.WHITESPACE,regex:[/^\s+/]},{type:r.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:r.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:r.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:r.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:r.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:r.PARENOPEN,regex:[/^\(/]},{type:r.PARENCLOSE,regex:[/^\)/]},{type:r.COMMA,regex:[/^,/]},{type:r.LOGIC,regex:[/^(&&|\|\|)\s*/,/^(and|or)\s+/],idx:1,replace:{and:"&&",or:"||"}},{type:r.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:r.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:r.NOT,regex:[/^\!\s*/,/^not\s+/],replace:{not:"!"}},{type:r.BOOL,regex:[/^(true|false)\s+/,/^(true|false)$/],idx:1},{type:r.VAR,regex:[/^[a-zA-Z_$]\w*((\.\$?\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:r.BRACKETOPEN,regex:[/^\[/]},{type:r.BRACKETCLOSE,regex:[/^\]/]},{type:r.CURLYOPEN,regex:[/^\{/]},{type:r.COLON,regex:[/^\:/]},{type:r.CURLYCLOSE,regex:[/^\}/]},{type:r.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:r.NUMBER,regex:[/^\d+(\.\d+)?/]},{type:r.QMARK,regex:[/^\?/]},{type:r.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];function a(e){var n;return t.some(o,function(r){return t.some(r.regex,function(t){var o,a=e.match(t);if(a)return o=a[r.idx||0].replace(/\s*$/,""),o=r.hasOwnProperty("replace")&&r.replace.hasOwnProperty(o)?r.replace[o]:o,n={match:o,type:r.type,length:a[0].length},!0})}),n||(n={match:e,type:r.UNKNOWN,length:e.length}),n}e.types=r,e.read=function(e){for(var t,r=0,n=[];r<e.length;)r+=(t=a(e.substring(r))).length,n.push(t);return n}}}),O=t({"packages/swig-core/lib/tokenparser.js"(e){var t=r(),n=c(),a=o(),i=m().dangerousProps,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];function l(e,r,o,a,i){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=a,this.filename=i,this.filters=r,this.escape=o,this.parse=function(){var r=this;return r._parsers.start&&r._parsers.start.call(r),t.each(e,function(t,o){var a=e[o-1];if(r.isLast=o===e.length-1,a)for(;a.type===n.WHITESPACE;)a=e[(o-=1)-1];r.prevToken=a,r.parseToken(t)}),r._parsers.end&&r._parsers.end.call(r),r.escape&&(r.filterApplyIdx=[0],"string"==typeof r.escape?(r.parseToken({type:n.FILTER,match:"e"}),r.parseToken({type:n.COMMA,match:","}),r.parseToken({type:n.STRING,match:String(o)}),r.parseToken({type:n.PARENCLOSE,match:")"})):r.parseToken({type:n.FILTEREMPTY,match:"e"})),r.out}}l.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var r,o=this,a=o._parsers[e.type]||o._parsers["*"],s=e.match,c=o.prevToken,l=c?c.type:null,p=o.state.length?o.state[o.state.length-1]:null;if(!a||"function"!=typeof a||a.call(this,e))switch(p&&c&&p===n.FILTER&&l===n.FILTER&&e.type!==n.PARENCLOSE&&e.type!==n.COMMA&&e.type!==n.OPERATOR&&e.type!==n.FILTER&&e.type!==n.FILTEREMPTY&&o.out.push(", "),p&&p===n.METHODOPEN&&(o.state.pop(),e.type!==n.PARENCLOSE&&o.out.push(", ")),e.type){case n.WHITESPACE:break;case n.STRING:if(p===n.BRACKETOPEN){var u=s.replace(/^['"]|['"]$/g,"");-1!==i.indexOf(u)&&t.throwError('Unsafe access to "'+u+'" via bracket notation is not allowed in templates (CVE-2023-25345)',o.line,o.filename)}o.filterApplyIdx.push(o.out.length),o.out.push(s.replace(/\\/g,"\\\\"));break;case n.NUMBER:case n.BOOL:o.filterApplyIdx.push(o.out.length),o.out.push(s);break;case n.FILTER:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.state.push(e.type);break;case n.FILTEREMPTY:o.filters.hasOwnProperty(s)&&"function"==typeof o.filters[s]||t.throwError('Invalid filter "'+s+'"',o.line,o.filename),o.escape=!o.filters[s].safe&&o.escape,o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,'_filters["'+s+'"]('),o.out.push(")");break;case n.FUNCTION:case n.FUNCTIONEMPTY:o.out.push("((typeof _ctx."+s+' !== "undefined") ? _ctx.'+s+" : ((typeof "+s+' !== "undefined") ? '+s+" : _fn))("),o.escape=!1,e.type===n.FUNCTIONEMPTY?o.out[o.out.length-1]=o.out[o.out.length-1]+")":o.state.push(e.type),o.filterApplyIdx.push(o.out.length-1);break;case n.PARENOPEN:o.state.push(e.type),o.filterApplyIdx.length?(o.out.splice(o.filterApplyIdx[o.filterApplyIdx.length-1],0,"("),c&&l===n.VAR?(r=c.match.split(".").slice(0,-1),o.out.push(" || _fn).call("+o.checkMatch(r)),o.state.push(n.METHODOPEN),o.escape=!1):o.out.push(" || _fn)("),o.filterApplyIdx.push(o.out.length-3)):(o.out.push("("),o.filterApplyIdx.push(o.out.length-1));break;case n.PARENCLOSE:(r=o.state.pop())!==n.PARENOPEN&&r!==n.FUNCTION&&r!==n.FILTER&&t.throwError("Mismatched nesting state",o.line,o.filename),o.out.push(")"),o.filterApplyIdx.pop(),r!==n.FILTER&&o.filterApplyIdx.pop();break;case n.COMMA:p!==n.FUNCTION&&p!==n.FILTER&&p!==n.ARRAYOPEN&&p!==n.CURLYOPEN&&p!==n.PARENOPEN&&p!==n.COLON&&t.throwError("Unexpected comma",o.line,o.filename),p===n.COLON&&o.state.pop(),o.out.push(", "),o.filterApplyIdx.pop();break;case n.LOGIC:case n.COMPARATOR:c&&l!==n.COMMA&&l!==e.type&&l!==n.BRACKETOPEN&&l!==n.CURLYOPEN&&l!==n.PARENOPEN&&l!==n.FUNCTION||t.throwError("Unexpected logic",o.line,o.filename),o.out.push(e.match);break;case n.NOT:o.out.push(e.match);break;case n.VAR:o.parseVar(e,s,p);break;case n.BRACKETOPEN:!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.PARENCLOSE?(o.state.push(n.ARRAYOPEN),o.filterApplyIdx.push(o.out.length)):o.state.push(e.type),o.out.push("[");break;case n.BRACKETCLOSE:(r=o.state.pop())!==n.BRACKETOPEN&&r!==n.ARRAYOPEN&&t.throwError("Unexpected closing square bracket",o.line,o.filename),o.out.push("]"),o.filterApplyIdx.pop();break;case n.CURLYOPEN:o.state.push(e.type),o.out.push("{"),o.filterApplyIdx.push(o.out.length-1);break;case n.QMARK:o.out.push(" ? "),o.state.push(e.type),o.filterApplyIdx.pop();break;case n.COLON:p===n.CURLYOPEN?(o.state.push(e.type),o.out.push(":")):p===n.QMARK?(o.state.pop()," ? "===o.out[o.out.length-1]?o.out[o.out.length-1]=" || ":o.out.push(" : ")):t.throwError("Unexpected colon",o.line,o.filename),o.filterApplyIdx.pop();break;case n.CURLYCLOSE:p===n.COLON&&o.state.pop(),o.state.pop()!==n.CURLYOPEN&&t.throwError("Unexpected closing curly brace",o.line,o.filename),o.out.push("}"),o.filterApplyIdx.pop();break;case n.DOTKEY:(!c||l!==n.VAR&&l!==n.BRACKETCLOSE&&l!==n.DOTKEY&&l!==n.PARENCLOSE&&l!==n.FUNCTIONEMPTY&&l!==n.FILTEREMPTY&&l!==n.CURLYCLOSE)&&t.throwError('Unexpected key "'+s+'"',o.line,o.filename),-1!==i.indexOf(s)&&t.throwError('Unsafe access to "'+s+'" is not allowed in templates (CVE-2023-25345)',o.line,o.filename),o.out.push("."+s);break;case n.OPERATOR:o.out.push(" "+s+" "),o.filterApplyIdx.pop()}},parseVar:function(e,r,o){var a=this;if(r=r.split("."),-1!==s.indexOf(r[0])&&t.throwError('Reserved keyword "'+r[0]+'" attempted to be used as a variable',a.line,a.filename),t.each(r,function(e){-1!==i.indexOf(e)&&t.throwError('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)',a.line,a.filename)}),a.filterApplyIdx.push(a.out.length),o===n.CURLYOPEN)return r.length>1&&t.throwError("Unexpected dot",a.line,a.filename),void a.out.push(r[0]);a.out.push(a.checkMatch(r))},parseExpr:function(e,r){var o=this,c=0;function l(){return function(){for(;c<e.length&&e[c].type===n.WHITESPACE;)c+=1}(),c<e.length?e[c]:null}function p(){var e=l();return e&&(c+=1),e}function u(e){t.throwError(e,o.line,o.filename)}function f(e){-1!==i.indexOf(e)&&u('Unsafe access to "'+e+'" is not allowed in templates (CVE-2023-25345)')}function h(e){-1!==i.indexOf(e)&&u('Unsafe access to "'+e+'" via bracket notation is not allowed in templates (CVE-2023-25345)')}function d(e){var t;if(e.type===n.LOGIC){if("||"===e.match)return{op:"||",prec:1};if("&&"===e.match)return{op:"&&",prec:2}}if(e.type===n.COMPARATOR)return"==="===(t=e.match)||"!=="===t||"=="===t||"!="===t?{op:t,prec:3}:{op:t,prec:4};if(e.type===n.OPERATOR){if("+"===(t=e.match)||"-"===t)return{op:t,prec:5};if("*"===t||"/"===t||"%"===t)return{op:t,prec:6}}return null}function y(e){return e.replace(/^['"]|['"]$/g,"")}function g(e){var t=[],r=l();if(r&&r.type===e)return p(),t;for(;;){t.push(x(0));var o=p();if(o||u("Unexpected end of expression"),o.type===e)break;o.type!==n.COMMA&&u("Expected comma or closing delimiter")}return t}function m(e){for(;;){var t=l();if(!t)break;if(t.type===n.DOTKEY)p(),f(t.match),e="VarRef"===e.type?a.varRef(e.path.concat([t.match])):a.access(e,a.literal("string",t.match));else if(t.type===n.BRACKETOPEN){p();var r=x(0);"Literal"===r.type&&"string"===r.kind&&h(r.value);var i=p();i&&i.type===n.BRACKETCLOSE||u("Unexpected closing square bracket"),e=a.access(e,r)}else if(t.type===n.PARENOPEN)p(),e=a.fnCall(e,g(n.PARENCLOSE));else{if(t.type!==n.FILTER&&t.type!==n.FILTEREMPTY)break;p();var s,c=t.match;o.filters.hasOwnProperty(c)&&"function"==typeof o.filters[c]||u('Invalid filter "'+c+'"'),t.type===n.FILTER&&(s=g(n.PARENCLOSE)),e=a.filterCallExpr(c,e,s)}}return e}function v(){var e,r=p();switch(r||u("Unexpected end of expression"),r.type){case n.STRING:return a.literal("string",y(r.match));case n.NUMBER:return a.literal("number",parseFloat(r.match));case n.BOOL:return a.literal("bool","true"===r.match);case n.NOT:return a.unaryOp("!",E());case n.OPERATOR:if("+"===(e=r.match)||"-"===e)return a.unaryOp(e,E());u('Unexpected operator "'+e+'"');break;case n.PARENOPEN:var o=x(0),i=p();return i&&i.type===n.PARENCLOSE||u("Mismatched nesting state"),m(o);case n.BRACKETOPEN:return m(a.arrayLiteral(g(n.BRACKETCLOSE)));case n.CURLYOPEN:return m(function(){var e=[],t=l();if(t&&t.type===n.CURLYCLOSE)return p(),a.objectLiteral([]);for(;;){var r,o=p();o||u("Unclosed object literal"),o.type===n.STRING?r=a.literal("string",y(o.match)):o.type===n.VAR?(-1!==o.match.indexOf(".")&&u("Unexpected dot"),r=a.literal("string",o.match)):o.type===n.NUMBER?r=a.literal("number",parseFloat(o.match)):u("Unexpected object key");var i=p();i&&i.type===n.COLON||u("Unexpected colon");var s=x(0);e.push(a.objectProperty(r,s));var c=p();if(c||u("Unclosed object literal"),c.type===n.CURLYCLOSE)break;c.type!==n.COMMA&&u("Expected comma or closing curly brace")}return a.objectLiteral(e)}());case n.VAR:var c=r.match.split(".");return-1!==s.indexOf(c[0])&&u('Reserved keyword "'+c[0]+'" attempted to be used as a variable'),t.each(c,function(e){f(e)}),m(a.varRef(c));case n.FUNCTION:case n.FUNCTIONEMPTY:return e=r.match,-1!==s.indexOf(e)&&u('Reserved keyword "'+e+'" attempted to be used as a variable'),f(e),r.type===n.FUNCTIONEMPTY?m(a.fnCall(a.varRef([e]),[])):m(a.fnCall(a.varRef([e]),g(n.PARENCLOSE)))}return u('Unexpected token "'+r.match+'"'),null}function E(){return v()}function x(e){for(var t=E();;){var r=l();if(!r)break;if(r.type===n.FILTER||r.type===n.FILTEREMPTY)break;var o=d(r);if(!o||o.prec<e)break;p();var i=x(o.prec+1);t=a.binaryOp(o.op,t,i)}if(0===e){var s=l();if(s&&s.type===n.QMARK){p();var c,f=l();if(f&&f.type===n.COLON)p(),c=x(0),t=a.conditional(t,t,c);else{var h=x(0),y=p();y&&y.type===n.COLON||u("Expected colon in ternary expression"),c=x(0),t=a.conditional(t,h,c)}}}return t}var O=x(0);return r&&(r.pos=c),O},parseOutput:function(e){var r=this;function o(){var e=r.parse().join("");return a.output(a.legacyJS("_output += "+e+";\n"))}var i,s,c=!1;for(i=0;i<e.length;i+=1)if(e[i].type!==n.WHITESPACE){c=!0;break}if(!c)return o();if("string"==typeof r.escape)return o();var l=0,p=!1,u=!1,f=!1,h=-1;for(i=0;i<e.length;i+=1)s=e[i],0===l&&(s.type!==n.OPERATOR&&s.type!==n.LOGIC&&s.type!==n.COMPARATOR&&s.type!==n.NOT||(p=!0),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||(u=!0,h<0&&(h=i)),s.type===n.QMARK&&(f=!0)),s.type===n.PARENOPEN||s.type===n.FUNCTION||s.type===n.BRACKETOPEN||s.type===n.CURLYOPEN||s.type===n.FILTER?l+=1:s.type!==n.PARENCLOSE&&s.type!==n.BRACKETCLOSE&&s.type!==n.CURLYCLOSE||(l-=1);if(0===h)return o();try{var d=r.escape;for(i=0;i<e.length;i+=1)if((s=e[i]).type!==n.FUNCTION&&s.type!==n.FUNCTIONEMPTY||(d=!1),s.type!==n.FILTER&&s.type!==n.FILTEREMPTY||r.filters.hasOwnProperty(s.match)&&"function"==typeof r.filters[s.match]&&r.filters[s.match].safe&&(d=!1),s.type===n.PARENOPEN){for(var y=i-1;y>=0&&e[y].type===n.WHITESPACE;)y-=1;y>=0&&e[y].type===n.VAR&&(d=!1)}if(f||p&&u){var g=r.parseExpr(e),m=d?[a.filterCall("e")]:[];return a.output(g,m.length>0?m:void 0)}var v=h>=0?h:e.length,E=e.slice(0,v),x={pos:0},O=r.parseExpr(E,x),w=!1;for(i=x.pos;i<E.length;i+=1)if(E[i].type!==n.WHITESPACE){w=!0;break}if(w)return o();var C=[];if(h>=0)for(var b=h;b<e.length;){var T=e[b];if(T.type!==n.WHITESPACE)if(T.type!==n.FILTEREMPTY)if(T.type!==n.FILTER)t.throwError('Unexpected token "'+T.match+'"',r.line,r.filename);else{r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(d=!1);for(var R=1,A=b+1,N=b+1;N<e.length&&R>0;){var k=e[N];if(k.type===n.PARENOPEN||k.type===n.FUNCTION||k.type===n.BRACKETOPEN||k.type===n.CURLYOPEN||k.type===n.FILTER)R+=1;else if((k.type===n.PARENCLOSE||k.type===n.BRACKETCLOSE||k.type===n.CURLYCLOSE)&&0===(R-=1))break;N+=1}0!==R&&t.throwError('Unable to parse filter "'+T.match+'"',r.line,r.filename);var P,_=[],L=A,S=1;for(P=A;P<N;P+=1){var I=e[P];I.type===n.PARENOPEN||I.type===n.FUNCTION||I.type===n.BRACKETOPEN||I.type===n.CURLYOPEN||I.type===n.FILTER?S+=1:I.type===n.PARENCLOSE||I.type===n.BRACKETCLOSE||I.type===n.CURLYCLOSE?S-=1:I.type===n.COMMA&&1===S&&(_.push(e.slice(L,P)),L=P+1)}L<N&&_.push(e.slice(L,N));var F,j=[];for(F=0;F<_.length;F+=1){var U,M=_[F],Y=!1;for(U=0;U<M.length;U+=1)if(M[U].type!==n.WHITESPACE){Y=!0;break}Y&&j.push(r.parseExpr(M))}C.push(a.filterCall(T.match,j)),b=N+1}else r.filters.hasOwnProperty(T.match)&&"function"==typeof r.filters[T.match]||t.throwError('Invalid filter "'+T.match+'"',r.line,r.filename),r.filters[T.match].safe&&(d=!1),C.push(a.filterCall(T.match)),b+=1;else b+=1}return d&&C.push(a.filterCall("e")),a.output(O,C.length>0?C:void 0)}catch(e){if(f)throw e;return o()}},checkMatch:function(e){var r=e[0],n=e.join(".");function o(n){var o=n+r,a=e,i="";return i="(typeof "+o+' !== "undefined" && '+o+" !== null",t.each(a,function(e,t){0!==t&&(i+=" && "+o+"."+e+" !== undefined && "+o+"."+e+" !== null",o+="."+e)}),i+=")"}return"("+o("_ctx.")+" ? _ctx."+n+" : ("+o("")+" ? "+n+' : ""))'}},e.TokenParser=l}}),w=t({"lib/parser.js"(e){var t=n(),r=x(),o=r.types,a=O().TokenParser;function i(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}e.parse=function(n,s,c,l,p){s=s.replace(/\r\n/g,"\n");var u,f=c.autoescape,h=c.tagControls[0],d=c.tagControls[1],y=c.varControls[0],g=c.varControls[1],m=i(h),v=i(d),E=i(y),x=i(g),O=new RegExp("^"+m+"-?\\s*|\\s*-?"+v+"$","g"),w=new RegExp("^"+m+"-"),C=new RegExp("-"+v+"$"),b=new RegExp("^"+E+"-?\\s*|\\s*-?"+x+"$","g"),T=new RegExp("^"+E+"-"),R=new RegExp("-"+x+"$"),A=c.cmtControls[0],N=c.cmtControls[1],k="[\\s\\S]*?",P=new RegExp("("+m+k+v+"|"+E+k+x+"|"+i(A)+k+i(N)+")"),_=1,L=[],S=null,I=null,F=[],j={},U=!1;function M(e,n){var o,i,s=r.read(t.strip(e));return i=(o=new a(s,p,f,n,c.filename)).parseOutput(s),o.state.length&&t.throwError('Unable to parse "'+e+'"',n,c.filename),i}function Y(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}return e.parseVariable=M,t.each(s.split(P),function(e){var i,s,m,v,E;if(e){if(!U&&t.startsWith(e,y)&&t.endsWith(e,g))m=T.test(e),u=R.test(e),i=M(e.replace(b,""),_);else if(t.startsWith(e,h)&&t.endsWith(e,d))m=w.test(e),u=C.test(e),(i=function(e,i){var s,u,h,d,y,g,m;if(t.startsWith(e,"end")){if((m=L[L.length-1])&&m.name===e.split(/\s+/)[0].replace(/^end/,"")&&m.ends){switch(m.name){case"autoescape":f=c.autoescape;break;case"raw":U=!1}return void L.pop()}U||t.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',i,c.filename)}if(!U){switch(d=(h=e.split(/\s+(.+)?/)).shift(),l.hasOwnProperty(d)||t.throwError('Unexpected tag "'+e+'"',i,c.filename),s=r.read(t.strip(h.join(" "))),u=new a(s,p,!1,i,c.filename),(y=l[d]).parse(h[1],i,u,o,L,c,n)||t.throwError('Unexpected tag "'+d+'"',i,c.filename),u.parse(),g=u.out,d){case"autoescape":f="false"!==g[0]&&g[0];break;case"raw":U=!0}var v;return"function"==typeof y.lowerExpr&&(v=y.lowerExpr(u,s,h[1],i)),{block:!!l[d].block,compile:y.compile,args:g,content:[],ends:y.ends,name:d,irExpr:v}}}(e.replace(O,""),_))&&("extends"===i.name?(S=i.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,""),I=i.irExpr&&i.irExpr.file):i.block&&!L.length&&(j[i.args.join("")]=i)),U&&!i&&(i=e);else if(U||!t.startsWith(e,A)&&!t.endsWith(e,N))i=u?e.replace(/^\s*/,""):e,u=!1;else if(t.startsWith(e,A)&&t.endsWith(e,N))return;m&&F.length&&("string"==typeof(v=F.pop())?v=Y(v):v.content&&v.content.length&&(E=Y(v.content.pop()),v.content.push(E)),F.push(v)),i&&(L.length?L[L.length-1].content.push(i):F.push(i),i.name&&i.ends&&L.push(i),s=e.match(/\n/g),_+=s?s.length:0)}}),{name:c.filename,parent:S,parentExpr:I,tokens:F,blocks:j}},e.compile=E().compile}}),C=t({"lib/tags/import.js"(e){var t=n(),r=o(),a=E(),i=m().dangerousProps;e.compile=function(e,n,o,a,i){if(i&&"async"===i.codegenMode){var s=n[n.length-1],c=n[0].path;return r.importDeferred(r.literal("string",c),s,i.filename||"")}var l=n.pop(),p=[],u=[];t.each(n,function(e){(e.isImport?u:p).push(e)});var f=t.map(p,function(e){return e.name}).join("|"),h="_ctx."+l+' = {};\n var _output = "";\n',d=t.map(p,function(e){return{ex:new RegExp("_ctx."+e.name+"(\\W)(?!"+f+")","g"),re:"_ctx."+l+"."+e.name+"$1"}}),y=[];return t.each(u,function(e){t.each(e.boundNames,function(e){y.push({ex:new RegExp("_ctx\\."+e+"(\\W)","g"),re:"_ctx."+l+"."+e+"$1"})})}),t.each(u,function(e){var r=e.compiled;t.each(y,function(e){r=r.replace(e.ex,e.re)}),h+=r}),t.each(p,function(e){var r=e.compiled;t.each(d,function(e){r=r.replace(e.ex,e.re)}),t.each(y,function(e){r=r.replace(e.ex,e.re)}),h+=r}),h},e.parse=function(e,r,n,o,s,c,l){var p,u,f=w().compile,h={resolveFrom:c.filename},d=t.extend({},c,h),y=!(!c||"async"!==c.codegenMode);return n.on(o.STRING,function(e){var n=this;if(void 0!==p)throw new Error("Unexpected string "+e.match+" on line "+r+".");if(p=e.match.replace(/^("|')|("|')$/g,""),y)n.out.push({path:p});else{var o=l.parseFile(p,h).tokens;t.each(o,function(e){var t,r="";e&&e.compile&&("import"!==e.name?"macro"===e.name&&(t=e.args[0],r+=a.compile([e.compile(f,e.args,e.content,[],d)],[],d)+"\n",n.out.push({compiled:r,name:t})):n.out.push({compiled:e.compile(f,e.args.slice(),e.content,[],d)+"\n",isImport:!0,boundNames:[e.args[e.args.length-1]]}))})}}),n.on(o.VAR,function(e){if(void 0===p||u)throw new Error('Unexpected variable "'+e.match+'" on line '+r+".");if("as"!==e.match){if(-1!==i.indexOf(e.match))throw new Error('Unsafe import alias "'+e.match+'" is not allowed (CVE-2023-25345) on line '+r+".");return u=e.match,this.out.push(u),!1}}),!0},e.block=!0}}),b=t({"lib/tags/include.js"(e){var t=o(),r=c(),n="ignore",a="missing",i="only";e.compile=function(e,r,n,o,s,c,l){var p=r.shift(),u=r.indexOf(i),f=-1!==u&&r.splice(u,1),h=(r.pop()||"").replace(/\\/g,"\\\\"),d=r[r.length-1]===a&&r.pop(),y=r.join("");return l&&l.irExpr&&(p=l.irExpr.file,y=void 0!==l.irExpr.context?l.irExpr.context:void 0),s&&"async"===s.codegenMode?t.includeDeferred(p,y||void 0,!!f,!!d,h):t.include(p,y||void 0,!!f,!!d,h)},e.lowerExpr=function(e,t){var o,a,s=0,c=-1,l=-1,p=-1;for(o=0;o<t.length;o++){if((a=t[o]).type===r.FILTER||a.type===r.FILTEREMPTY)return;a.type!==r.PARENOPEN&&a.type!==r.BRACKETOPEN&&a.type!==r.ARRAYOPEN&&a.type!==r.CURLYOPEN&&a.type!==r.FUNCTION&&a.type!==r.METHODOPEN?a.type!==r.PARENCLOSE&&a.type!==r.BRACKETCLOSE&&a.type!==r.CURLYCLOSE?0===s&&a.type===r.VAR&&(-1===c&&"with"===a.match?c=o:-1!==c&&-1===l&&a.match===i?l=o:-1===p&&a.match===n&&(p=o)):s--:s++}var u=t.length;-1!==c?u=c:-1!==p&&(u=p);var f=t.slice(0,u);if(0!==f.length){var h={file:e.parseExpr(f)};if(-1!==c){var d=t.length;-1!==l?d=l:-1!==p&&(d=p);var y=t.slice(c+1,d);y.length>0&&(h.context=e.parseExpr(y))}return h}},e.parse=function(e,t,r,o,s,c){var l,p;return r.on(o.STRING,function(e){return!!l||(l=e.match,void this.out.push(l))}),r.on(o.VAR,function(e){if(!l)return l=e.match,!0;if(p||"with"!==e.match){if(!p||e.match!==i||"with"===this.prevToken.match){if(e.match===n)return!1;if(e.match===a){if(this.prevToken.match!==n)throw new Error('Unexpected token "'+a+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===n)throw new Error('Expected "'+a+'" on line '+t+' but found "'+e.match+'".');return!0}this.out.push(e.match)}else p=!0}),r.on("end",function(){this.out.push(c.filename||null)}),!0}}}),T=t({"lib/tags/macro.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s=r.shift();return t.macro(s,r,[t.legacyJS(e(n,o,a,i))])};var r=m().dangerousProps;e.parse=function(e,t,n,o){var a;return n.on(o.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");return a=e.match,void this.out.push(a)}if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro argument "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");this.out.push({name:e.match})}),n.on(o.FUNCTION,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a),this.state.push(o.FUNCTION)}}),n.on(o.FUNCTIONEMPTY,function(e){if(!a){if(-1!==r.indexOf(e.match))throw new Error('Unsafe macro name "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");a=e.match,this.out.push(a)}}),n.on(o.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(o.COMMA,function(){}),n.on("*",function(){}),!0},e.ends=!0,e.block=!0}}),R=t({"lib/tags/parent.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){if(!o||!o.length)return"";for(var s,c,l=r[0],p=o.length,u=0;u<p;u+=1)if((s=o[u]).blocks&&s.blocks.hasOwnProperty(i)&&l!==s.name){var f=(c=s.blocks[i]).compile(e,[i],c.content,o.slice(u+1),a);return t.parent(f&&f.body?f.body.concat([t.legacyJS("\n")]):[t.legacyJS("\n")])}},e.parse=function(e,t,r,n,o,a){return r.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),r.on("end",function(){this.out.push(a.filename)}),!0}}}),A=t({"lib/tags/raw.js"(e){var t=o();e.compile=function(e,r,n,o,a,i){var s,c=[];for(s=0;s<n.length;s++)"string"==typeof n[s]?c.push(t.raw(n[s])):c.push(t.legacyJS(e([n[s]],o,a,i)));return c},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},e.ends=!0}}),N=t({"lib/tags/set.js"(e){var t=o(),r=c(),n=/^_ctx\.([a-zA-Z_$][\w$]*)((?:\.[a-zA-Z_$][\w$]*)*)$/;e.compile=function(e,r,o,a,i,s,c){var l=r[0],p="string"==typeof l&&n.exec(l);if(p){var u=[p[1]];if(p[2])for(var f=p[2].split("."),h=1;h<f.length;h++)u.push(f[h]);l=t.varRef(u)}var d=c&&c.irExpr?c.irExpr:r.slice(2).join(" ");return t.set(l,r[1],d)};var a=m().dangerousProps;e.lowerExpr=function(e,t){var n,o=-1;for(n=0;n<t.length;n++)if(t[n].type===r.ASSIGNMENT){o=n;break}if(-1!==o){var a=t.slice(o+1);for(n=0;n<a.length;n++)if(a[n].type===r.FILTER||a[n].type===r.FILTEREMPTY||a[n].type===r.ASSIGNMENT)return;return e.parseExpr(a)}},e.parse=function(e,t,r,n){var o,i="";return r.on(n.VAR,function(e){if(o)o+="_ctx."+e.match;else{if(r.out.length)return!0;for(var n=e.match.split("."),s=0;s<n.length;s++)if(-1!==a.indexOf(n[s]))throw new Error('Unsafe assignment to "'+n[s]+'" is not allowed (CVE-2023-25345) on line '+t+".");i+=e.match}}),r.on(n.BRACKETOPEN,function(e){if(o||this.out.length)return!0;o=e.match}),r.on(n.STRING,function(e){if(!o||this.out.length)return!0;var r=e.match.replace(/^['"]|['"]$/g,"");if(-1!==a.indexOf(r))throw new Error('Unsafe assignment to "'+r+'" via bracket notation is not allowed (CVE-2023-25345) on line '+t+".");o+=e.match}),r.on(n.BRACKETCLOSE,function(e){return!(o&&!this.out.length)||(i+=o+e.match,void(o=void 0))}),r.on(n.DOTKEY,function(e){if(!o&&!i)return!0;if(-1!==a.indexOf(e.match))throw new Error('Unsafe assignment to "'+e.match+'" is not allowed (CVE-2023-25345) on line '+t+".");i+="."+e.match}),r.on(n.ASSIGNMENT,function(e){if(this.out.length||!i)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push("_ctx."+i),this.out.push(e.match),this.filterApplyIdx.push(this.out.length)}),!0},e.block=!0}}),k=t({"lib/tags/spaceless.js"(e){n();e.compile=function(e,t,r,n,o,a){var i=e(r,n,o,a);return i+='_output = _output.replace(/^\\s+/, "")\n .replace(/>\\s+</g, "><")\n .replace(/\\s+$/, "");\n'},e.parse=function(e,t,r){return r.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},e.ends=!0}}),P=t({"lib/tags/index.js"(e){e.autoescape=a(),e.block=i(),e.else=s(),e.elseif=p(),e.elif=e.elseif,e.extends=u(),e.filter=g(),e.for=v(),e.if=l(),e.import=C(),e.include=b(),e.macro=T(),e.parent=R(),e.raw=A(),e.set=N(),e.spaceless=k()}}),_=t({"browser/stubs/fs.js"(e,t){t.exports={}}}),L=t({"node_modules/path-browserify/index.js"(e,t){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var r,n="",o=0,a=-1,i=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(a===s-1||1===i);else if(a!==s-1&&2===i){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=s,i=0;continue}}else if(2===n.length||1===n.length){n="",o=0,a=s,i=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(a+1,s):n=e.slice(a+1,s),o=s-a-1;a=s,i=0}else 46===r&&-1!==i?++i:i=-1}return n}var o={resolve:function(){for(var e,t="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var i;a>=0?i=arguments[a]:(void 0===e&&(e=process.cwd()),i=e),r(i),0!==i.length&&(t=i+"/"+t,o=47===i.charCodeAt(0))}return t=n(t,!o),o?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&o&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];r(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var a=e.length,i=a-n,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var c=t.length-s,l=i<c?i:c,p=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===t.charCodeAt(s+u))return t.slice(s+u+1);if(0===u)return t.slice(s+u)}else i>l&&(47===e.charCodeAt(n+u)?p=u:0===u&&(p=0));break}var f=e.charCodeAt(n+u);if(f!==t.charCodeAt(s+u))break;47===f&&(p=u)}var h="";for(u=n+p+1;u<=a;++u)u!==a&&47!==e.charCodeAt(u)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+p):(s+=p,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,o=-1,a=!0,i=e.length-1;i>=1;--i)if(47===(t=e.charCodeAt(i))){if(!a){o=i;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var n,o=0,a=-1,i=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!i){o=n+1;break}}else-1===c&&(i=!1,c=n+1),s>=0&&(l===t.charCodeAt(s)?-1===--s&&(a=n):(s=-1,a=c))}return o===a?a=c:-1===a&&(a=e.length),e.slice(o,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!i){o=n+1;break}}else-1===a&&(i=!1,a=n+1);return-1===a?"":e.slice(o,a)},extname:function(e){r(e);for(var t=-1,n=0,o=-1,a=!0,i=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(a=!1,o=s+1),46===c?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!a){n=s+1;break}}return-1===t||-1===o||0===i||1===i&&t===o-1&&t===n+1?"":e.slice(t,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,o=e.charCodeAt(0),a=47===o;a?(t.root="/",n=1):n=0;for(var i=-1,s=0,c=-1,l=!0,p=e.length-1,u=0;p>=n;--p)if(47!==(o=e.charCodeAt(p)))-1===c&&(l=!1,c=p+1),46===o?-1===i?i=p:1!==u&&(u=1):-1!==i&&(u=-1);else if(!l){s=p+1;break}return-1===i||-1===c||0===u||1===u&&i===c-1&&i===s+1?-1!==c&&(t.base=t.name=0===s&&a?e.slice(1,c):e.slice(s,c)):(0===s&&a?(t.name=e.slice(1,i),t.base=e.slice(1,c)):(t.name=e.slice(s,i),t.base=e.slice(s,c)),t.ext=e.slice(i,c)),s>0?t.dir=e.slice(0,s-1):a&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,t.exports=o}}),S=t({"packages/swig-core/lib/loaders/filesystem.js"(e,t){var r=_(),n=L();t.exports=function(e,t){var o={};return t=t||"utf8",e=e?n.normalize(e):null,o.resolve=function(t,r){return r=e||(r?n.dirname(r):process.cwd()),n.resolve(r,t)},o.load=function(e,n){if(!r||n&&!r.readFile||!r.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");if(e=o.resolve(e),!n)return r.readFileSync(e,t);r.readFile(e,t,n)},o}}}),I=t({"packages/swig-core/lib/loaders/memory.js"(e,t){var n=L(),o=r();t.exports=function(e,t){var r={};return t=t?n.normalize(t):null,r.resolve=function(e,r){return r=t||(r?n.dirname(r):"/"),n.resolve(r,e)},r.load=function(t,r){var n,a;if(a=[t,t.replace(/^(\/|\\)/,"")],(n=e[a[0]]||e[a[1]])||o.throwError('Unable to find template "'+t+'".'),!r)return n;r(null,n)},r}}}),F=t({"packages/swig-core/lib/loaders/index.js"(e){e.fs=S(),e.memory=I()}}),j=t({"lib/loaders/index.js"(e,t){t.exports=F()}}),U=t({"lib/async/pre-walker.js"(e){var t=n();function r(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}function o(e,t,r){var n=e.substr(t.length,e.length-t.length-r.length);return"-"===n.charAt(0)&&(n=n.substr(1)),"-"===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),n.replace(/^\s+|\s+$/g,"")}e.scan=function(e,n){e=e.replace(/\r\n/g,"\n");var a,i,s,c,l,p=function(e){var t="[\\s\\S]*?",n=r(e.varControls[0]),o=r(e.varControls[1]),a=r(e.tagControls[0]),i=r(e.tagControls[1]),s=r(e.cmtControls[0]),c=r(e.cmtControls[1]);return new RegExp("("+a+t+i+"|"+n+t+o+"|"+s+t+c+")")}(n),u=n.tagControls[0],f=n.tagControls[1],h=n.rawTag,d="end"+h,y=new RegExp("^("+n.keywords.join("|")+")\\s+[\"\\']([^\"\\']+)[\"\\']"),g=e.split(p),m=[],v=!1;for(a=0;a<g.length;a+=1)"string"==typeof(i=g[a])&&i&&t.startsWith(i,u)&&t.endsWith(i,f)&&((c=(s=o(i,u,f)).split(/\s+/)[0])!==h?c!==d?v||(l=y.exec(s))&&m.push({kind:l[1],path:l[2]}):v=!1:v=!0);return m},e.walk=function(t,r,n){var o={},a={};return new Promise(function(i,s){var c=0,l=[],p=!1;function u(e){o.hasOwnProperty(e)||a[e]||(a[e]=!0,l.push(e))}function f(){for(;l.length>0&&!p;){var e=l.shift();c+=1,h(e)}0!==c||p||0!==l.length||i(o)}function h(t){r.load(t,function(a,i){if(!p){if(a)return p=!0,void s(a);if("string"!=typeof i)return p=!0,void s(new Error('Async loader returned non-string source for "'+t+'"'));var l,h,d;o[t]=i;try{l=e.scan(i,n)}catch(e){return p=!0,void s(e)}for(h=0;h<l.length;h+=1){try{d=r.resolve(l[h].path,t)}catch(e){return p=!0,void s(e)}u(d)}c-=1,f()}})}u(t),f()})},e.makeMemoryWrapper=function(e,t){return{resolve:function(t,r){return e.resolve(t,r)},load:function(e,r){var n=t[e];if("string"!=typeof n){var o=new Error('Pre-walked map missing path: "'+e+'"');if(r)return void r(o);throw o}if(!r)return n;r(null,n)}}}}}),M=t({"packages/swig-core/lib/cache.js"(e){e.shouldCache=function(e,t){return(e=e||{}).hasOwnProperty("cache")&&!e.cache||!t},e.cacheGet=function(t,r,n,o){if(!e.shouldCache(r,n))return"memory"===n?o[t]:n.get(t)},e.cacheSet=function(t,r,n,o,a){e.shouldCache(r,o)||("memory"!==o?o.set(t,n):a[t]=n)}}}),Y=t({"packages/swig-core/lib/engine.js"(e){var t=r(),n=o(),a=E(),i=M(),s=Object.getPrototypeOf(async function(){}).constructor;function c(){return""}function l(e,r){var o={},i=[];return t.each(e.blocks,function(e){var s=e.args?e.args.slice(0):[],c=e.content?e.content.slice(0):[];if("block"!==e.name){var l=e.compile(a.compile,s,c,[],r,void 0,e);null!=l&&""!==l&&("string"!=typeof l?t.isArray(l)?t.each(l,function(e){i.push(e)}):"object"==typeof l&&"string"==typeof l.type&&i.push(l):i.push(n.legacyJS(l)))}else{var p=s.join(""),u=e.compile(a.compile,s,c,[],r,p,e);u&&"object"==typeof u&&"string"==typeof u.type&&(o[p]=u)}}),n.extendsDeferred(e.parentExpr||n.literal("string",e.parent),o,i,r.filename||"")}e.remapBlocks=function e(r,n){return t.map(n,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&r[n]&&(t=r[n]),t.content&&t.content.length&&(t.content=e(r,t.content)),t})},e.importNonBlocks=function(e,r){var n=[];t.each(e,function(e){n.push(e)}),t.each(n.reverse(),function(e){"block"!==e.name&&r.unshift(e)})},e.getParents=function(r,n,o){for(var a,i,s,c=r.parent,l=[],p=[];c;){if(!n||!n.filename)throw new Error('Cannot extend "'+c+'" because current template has no filename.');if(a=a||n.filename,a=o.resolve(c,a),c=(i=o.cacheGet(a,n)||o.parseFile(a,t.extend({},n,{filename:a}))).parent,-1!==l.indexOf(a))throw new Error('Illegal circular extends of "'+a+'".');l.push(a),p.push(i)}for(s=p.length,s=p.length-2;s>=0;s-=1)p[s].tokens=e.remapBlocks(p[s].blocks,p[s+1].tokens),e.importNonBlocks(p[s].blocks,p[s].tokens);return p},e.buildTemplateFunction=function(e,t,r){if(r&&"async"===r.codegenMode){var n=' var _ext = _swig.extensions,\n _output = "",\n _exports = {};\n'+a.compile(e,t,r)+"\n return { output: _output, exports: _exports };\n";return new s("_swig","_ctx","_filters","_utils","_fn","_blocks",n)}var o=' var _ext = _swig.extensions,\n _output = "";\n'+a.compile(e,t,r)+"\n return _output;\n";return new Function("_swig","_ctx","_filters","_utils","_fn",o)},e.install=function(r,n){var o=n.parser,a=t.extend({},n.tags),s=t.extend({},n.filters),p=n.validateOptions,u=n.onCompileError;function f(e){return e&&e.locals?t.extend({},r.options.locals,e.locals):r.options.locals}function h(e,t){return i.cacheGet(e,t,r.options.cache,r.cache)}function d(e,t,n){i.cacheSet(e,t,n,r.options.cache,r.cache)}r.invalidateCache=function(){"memory"===r.options.cache&&(r.cache={})},r.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');s[e]=t},r.setTag=function(e,t,r,n,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof r)throw new Error('Tag "'+e+'" compile method is not a valid function.');a[e]={parse:t,compile:r,ends:n||!1,block:!!o}},r.setExtension=function(e,t){r.extensions[e]=t},r.parse=function(e,n){p(n);var i,c=f(n),l={};for(i in n)n.hasOwnProperty(i)&&"locals"!==i&&(l[i]=n[i]);return(n=t.extend({},r.options,l)).locals=c,o.parse(r,e,n,a,s)},r.parseFile=function(e,n){var o;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),o=r.options.loader.load(e),n.filename||(n=t.extend({filename:e},n)),r.parse(o,n)},r.precompile=function(t,n){var o,a,i=r.parse(t,n);if(n&&"async"===n.codegenMode&&i.parent)o=[],i.tokens=[l(i,n)];else{if(i.parentExpr)throw new Error("Dynamic {% extends %} requires the async render path — use renderFile(path, locals, cb) with a loader that sets loader.async === true.");o=function(t,n){return e.getParents(t,n,{resolve:function(e,t){return r.options.loader.resolve(e,t)},parseFile:r.parseFile,cacheGet:h})}(i,n),o.length&&(i.tokens=e.remapBlocks(i.blocks,o[0].tokens),e.importNonBlocks(i.blocks,i.tokens))}try{a=e.buildTemplateFunction(i,o,n)}catch(e){u(e,n)}return{tpl:a,tokens:i}},r.compile=function(e,n){var o,a,i,l=n?n.filename:null,p=l?h(l,n):null;if(p)return p;function u(e,n){var l;return l=e&&a?t.extend({},o,e):e&&!a?e:!e&&a?o:{},i.tpl(r,l,s,t,c,n)}return o=f(n),a=t.keys(o).length,i=r.precompile(e,n),t.extend(u,i.tokens),l&&d(l,n,u),u},r.compileFile=function(e,n,o){var a,i;return n||(n={}),e=r.options.loader.resolve(e,n.resolveFrom),n.filename||(n=t.extend({filename:e},n)),(i=h(e,n))?o?void o(null,i):i:o?void r.options.loader.load(e,function(e,t){if(e)o(e);else{var a;try{a=r.compile(t,n)}catch(e){return void o(e)}o(e,a)}}):(a=r.options.loader.load(e),r.compile(a,n))},r.getTemplate=function(e,n){var o;n=n||{};try{o=r.options.loader.resolve(e,n.resolveFrom)}catch(e){return Promise.reject(e)}var a=t.extend({},n,{filename:n.filename||o,codegenMode:"async",cache:!1});return new Promise(function(e,t){function n(n,o){if(n)t(n);else{var i;try{i=r.compile(o,a)}catch(e){return void t(e)}e(i)}}if(r.options.loader.load.length>=2)try{r.options.loader.load(o,n)}catch(e){n(e)}else{var i;try{i=r.options.loader.load(o)}catch(e){return void n(e)}n(null,i)}})},r.render=function(e,t){return r.compile(e,t)()},r.renderFile=function(e,t,n){return n?r.options.loader&&!0===r.options.loader.async?void r.getTemplate(e).then(function(e){return e(t)}).then(function(e){n(null,e.output)}).catch(n):void r.compileFile(e,{},function(e,r){var o;if(e)n(e);else{try{o=r(t)}catch(e){return void n(e)}n(null,o)}}):r.compileFile(e)(t)},r.run=function(e,n,o){var a=f({locals:n});return o&&d(o,{},e),e(r,a,s,t,c)}}}}),D=t({"lib/swig.js"(e){var t=n(),r=P(),o=y(),a=w(),i=h(),s=j(),c=U(),l=Y();e.version="2.5.3";var p,u={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory",loader:s.fs()};function f(e){if(e){if(t.each(["varControls","tagControls","cmtControls"],function(r){if(e.hasOwnProperty(r)){if(!t.isArray(e[r])||2!==e[r].length)throw new Error('Option "'+r+'" must be an array containing 2 different control strings.');if(e[r][0]===e[r][1])throw new Error('Option "'+r+'" open and close controls must not be the same.');t.each(e[r],function(e,t){if(e.length<2)throw new Error('Option "'+r+'" '+(t?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.');if(e.hasOwnProperty("loader")&&e.loader&&(!e.loader.load||!e.loader.resolve))throw new Error("Invalid loader option "+JSON.stringify(e.loader)+" found. Expected { load: function (pathname, cb) { ... }, resolve: function (to, from) { ... } }.")}}e.setDefaults=function(e){f(e),p.options=t.extend(p.options,e)},e.setDefaultTZOffset=function(e){i.tzOffset=e},e.Swig=function(e){f(e),this.options=t.extend({},u,e||{}),this.cache={},this.extensions={},l.install(this,{parser:a,tags:r,filters:o,validateOptions:f,onCompileError:function(e,r){t.throwError(e,null,r.filename)}});var n=this;function i(){return{varControls:n.options.varControls,tagControls:n.options.tagControls,cmtControls:n.options.cmtControls,rawTag:"raw",keywords:["extends","include","import"]}}this.renderFileAsync=function(e,t,r){"function"==typeof t&&(r=t,t=void 0);var o,a=n.options.loader;try{o=a.resolve(e)}catch(e){return void r(e)}c.walk(o,a,i()).then(function(e){var i,s,l=c.makeMemoryWrapper(a,e),p=n.options.loader;n.options.loader=l;try{i=n.renderFile(o,t)}catch(e){s=e}n.options.loader=p,s?r(s):r(null,i)},function(e){r(e)})},this.compileFileAsync=function(e,t,r){"function"==typeof t&&(r=t,t={});var o,a=n.options.loader;try{o=a.resolve(e)}catch(e){return void r(e)}c.walk(o,a,i()).then(function(e){var i,s,l=c.makeMemoryWrapper(a,e),p=n.options.loader;n.options.loader=l;try{i=n.compileFile(o,t)}catch(e){s=e}if(n.options.loader=p,s)r(s);else{r(null,function(e){var t=n.options.loader;n.options.loader=l;try{var r=i(e);return n.options.loader=t,r}catch(e){throw n.options.loader=t,e}})}},function(e){r(e)})}},p=new e.Swig,e.setFilter=p.setFilter,e.setTag=p.setTag,e.setExtension=p.setExtension,e.parseFile=p.parseFile,e.precompile=p.precompile,e.compile=p.compile,e.compileFile=p.compileFile,e.compileFileAsync=p.compileFileAsync,e.render=p.render,e.renderFile=p.renderFile,e.renderFileAsync=p.renderFileAsync,e.run=p.run,e.invalidateCache=p.invalidateCache,e.loaders=s}})();"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return D}):window.swig=D})();
4
4
  /*!
5
5
  * Attach `loc` to the node if provided, skipping the assignment otherwise
6
6
  * so consumers can tell "no source location available" from
@@ -16,6 +16,15 @@
16
16
  * a tight IR keeps the shape honest for future flavor backends.
17
17
  * @private
18
18
  */
19
+ /*!
20
+ * Lower a dynamic parent-path to IR so `{% extends layout_var %}`
21
+ * resolves at render time on the async codegen path. A lone
22
+ * string-literal path (`{% extends "x.html" %}`) returns undefined, so
23
+ * the engine keeps its existing tokens.parent string + ir.literal path
24
+ * unchanged; only a dynamic path is lowered. Mirrors include.js. The
25
+ * resulting IRExpr is read back as token.irExpr.file by the parser
26
+ * splitter and stashed on the sibling tokens.parentExpr slot.
27
+ */
19
28
  /*!
20
29
  * JSON-escape a literal text chunk for embedding inside a JS
21
30
  * double-quoted string literal in the compiled template body.