iobroker.vis-jsontemplate 4.6.0 → 4.6.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/README.md CHANGED
@@ -143,6 +143,9 @@ Example output of data, widget and style in the template
143
143
  .replace(/ /g, ' '); %>
144
144
  ```
145
145
 
146
+ If an error occurs, it is displayed in the widget and output to the
147
+ browser console (F12).
148
+
146
149
  #### Advanced use case
147
150
 
148
151
  In the examples above, only the pure output was covered.
@@ -183,6 +186,7 @@ a specific layout. Here is an example:
183
186
  - [Use Case Tasklist](documentation/usecase-tasklist.md)
184
187
  - [Use Case public-transport](documentation/usecase-public-transport.md)
185
188
  - [Use Case simple gauge](documentation/usecase-simplegauge.md)
189
+ - [Use Case configurable segmented gauge](documentation/usecase-configurable-gauge.md)
186
190
  - [Use Case Github Issues and PRs](documentation/usecase-githubissues.md)
187
191
  - [Use Case FRITZ!Box call list](documentation/usecase-fritzbox-call-list.md)
188
192
 
@@ -420,6 +424,14 @@ Loop over the attributes of an object
420
424
  Placeholder for the next version (at the beginning of the line):
421
425
  ### **WORK IN PROGRESS**
422
426
  -->
427
+ ### 4.6.3 (2026-10-28)
428
+
429
+ - last valid version for vis-2 with react 18 (vis-2 version <=2.15.4)
430
+
431
+ ### 4.6.1 (2026-07-31)
432
+
433
+ - Improved error output.
434
+
423
435
  ### 4.6.0 (2026-07-30)
424
436
 
425
437
  - some changes. see readme/below
@@ -441,24 +453,8 @@ Loop over the attributes of an object
441
453
 
442
454
  ### 4.4.5 (2026-07-22)
443
455
 
444
- - fix packages for vis-2
445
-
446
- ### 4.4.4 (2026-07-22)
447
-
448
- - some changes. see readme/below
449
-
450
- #### Changes 2026-07.22
451
-
452
- - change documentation that in the template the widgetid is available and not widgetID
453
- - add documentation for the usecase simple gauge
454
- - add documentation for a responsive FRITZ!Box call list
455
- - Due to an inconsistency between the vis1 and vis2 widgets,
456
- both `widgetid` and `widgetID` are now passed to the template.
457
-
458
- ### 4.4.3 (2026-04-21)
456
+ - fix packages for vis-2
459
457
 
460
- - revert repochecker warning about fs/node:fs and path/node:path
461
- because of error loading ejs
462
458
 
463
459
  [Older changelogs can be found there](CHANGELOG_OLD.md)
464
460
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "vis-jsontemplate",
4
- "version": "4.6.0",
4
+ "version": "4.6.3",
5
5
  "news": {
6
+ "4.6.3": {
7
+ "en": "last valid version for vis-2 with react 18 (vis-2 version <=2.15.4)",
8
+ "de": "letzte gültige Version für Vis-2 mit React 18 (vis-2 <=2.15.4)",
9
+ "ru": "последняя действительная версия для vis-2 с реакцией 18 (версия vis-2 <= 2.15.4)",
10
+ "pt": "última versão válida para vis-2 com react 18 (vis-2 <=2.15.4)",
11
+ "nl": "laatste geldige versie voor vis-2 met react 18 (vis-2 versie <=2.15.4)",
12
+ "fr": "dernière version valide pour Vis-2 avec React 18 (vis-2 version <=2.15.4)",
13
+ "it": "ultima versione valida per vis-2 con react 18 (vis-2 <=2.15.4)",
14
+ "es": "última versión válida para vis-2 con react 18 (vis-2 versión <=2.15.4)",
15
+ "pl": "ostatnia poprawna wersja dla vis-2 z reactem 18 (wersja vis-2 <=2.15.4)",
16
+ "uk": "остання дійсна версія для vis-2 з реакцією 18 (версія vis-2 <= 2.15.4)",
17
+ "zh-cn": "使用 react 18 的 vis-2 的最后一个有效版本(vis-2 版本 <=2.15.4)"
18
+ },
19
+ "4.6.1": {
20
+ "en": "- Improved error output.",
21
+ "de": "- Verbesserte Fehlerausgabe.",
22
+ "ru": "- Улучшен вывод сообщений об ошибках.",
23
+ "pt": "- Melhorada a saída de erros.",
24
+ "nl": "- Verbeterde foutuitvoer.",
25
+ "fr": "- Amélioration de l'affichage des erreurs.",
26
+ "it": "- Migliorata la visualizzazione degli errori.",
27
+ "es": "- Se ha mejorado la salida de errores.",
28
+ "pl": "- Ulepszono wyświetlanie błędów.",
29
+ "uk": "- Покращено виведення повідомлень про помилки.",
30
+ "zh-cn": "- 改进了错误输出。"
31
+ },
6
32
  "4.6.0": {
7
33
  "en": "- some changes. see readme/below",
8
34
  "de": "- einige änderungen. siehe readme/unten",
@@ -67,32 +93,6 @@
67
93
  "pl": "- revert repochecker warning about fs / node: fs and path / node: path\nz powodu błędu wczytywania dżinsów",
68
94
  "uk": "- перевернути повторне попередження про fs/node:fs і шлях/node:path\nчерез завантаження помилок",
69
95
  "zh-cn": "- 恢复关于fs/节点:fs和路径/节点:路径的重新检查器警告\n因为装入 ejs 出错"
70
- },
71
- "4.4.2": {
72
- "en": "fix runtime",
73
- "de": "die laufzeit",
74
- "ru": "исправить runtime",
75
- "pt": "corrigir o tempo de execução",
76
- "nl": "runtime corrigeren",
77
- "fr": "fixer l'exécution",
78
- "it": "correzione di runtime",
79
- "es": "corrección",
80
- "pl": "napraw środowisko wykonawcze",
81
- "uk": "фіксувати runtime",
82
- "zh-cn": "固定运行时间"
83
- },
84
- "4.4.1": {
85
- "en": "fix regression\nupdate packages",
86
- "de": "regression\nupdate-pakete",
87
- "ru": "фиксировать регрессию\nобновление пакетов",
88
- "pt": "corrigir regressão\natualizar pacotes",
89
- "nl": "repareren regressie\npakketten bijwerken",
90
- "fr": "fixer la régression\nmettre à jour les paquets",
91
- "it": "correzione della regressione\npacchetti di aggiornamento",
92
- "es": "regreso\nactualizar paquetes",
93
- "pl": "naprawić regresję\naktualizacja pakietów",
94
- "uk": "фіксація регресія\nоновлення пакетів",
95
- "zh-cn": "修复回归\n更新软件包"
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.vis-jsontemplate",
3
- "version": "4.6.0",
3
+ "version": "4.6.3",
4
4
  "description": "vis-jsontemplate",
5
5
  "author": {
6
6
  "name": "oweitman",
@@ -19,19 +19,18 @@
19
19
  "JSON template",
20
20
  "Smart Home"
21
21
  ],
22
- "dependencies": {},
23
22
  "devDependencies": {
24
23
  "@alcalzone/release-script": "^5.2.1",
25
24
  "@alcalzone/release-script-plugin-iobroker": "^5.2.0",
26
- "@alcalzone/release-script-plugin-license": "^5.2.0",
25
+ "@alcalzone/release-script-plugin-license": "^5.2.2",
27
26
  "@alcalzone/release-script-plugin-manual-review": "^5.2.0",
28
27
  "@iobroker/adapter-dev": "^1.5.0",
28
+ "@iobroker/build-tools": "^3.0.3",
29
29
  "@iobroker/eslint-config": "^2.2.0",
30
- "@iobroker/testing": "^5.3.0",
31
- "@iobroker/build-tools": "^3.0.1",
30
+ "@iobroker/testing": "^6.3.1",
32
31
  "@iobroker/vis-2-widgets-react-dev": "^4.0.4",
33
32
  "@iobroker/vis-2-widgets-testing": "^1.0.6",
34
- "@types/node": "^25.9.5"
33
+ "@types/node": "^25.9.9"
35
34
  },
36
35
  "main": "widgets/vis2jsontemplate/customWidgets.js",
37
36
  "files": [
@@ -44,7 +43,8 @@
44
43
  "test:package": "mocha test/package --exit",
45
44
  "test:widgets": "mocha ./test/*.test.js",
46
45
  "test:integration": "mocha test/widgets.test.js --exit",
47
- "test": "npm run test:package && npm run test:widgets",
46
+ "testbakcip": "npm run test:package && npm run test:widgets",
47
+ "test": "npm run test:package ",
48
48
  "prepublishOnly": "npm run build-vis1widgets && npm run build-vis2widgets",
49
49
  "lint": "npm run lint-adapter && npm run lint-vis1widgets && npm run lint-vis2widgets",
50
50
  "lint-adapter": "eslint -c eslint.config.mjs .",
@@ -53,19 +53,21 @@
53
53
  "build": "npm run build-vis1widgets && npm run build-vis2widgets",
54
54
  "build-vis2widgets": "node tasks --javascript-vite",
55
55
  "build-vis1widgets": "cd widgets/vis-jsontemplate && npm run build && cd ../..",
56
+ "dev:upload": "dev-server upload",
57
+ "dev:run": "dev-server run",
58
+ "dev:watch": "dev-server watch --noStart",
59
+ "dev:watchvis2widgets": "npm run start --prefix src-widgets",
60
+ "dev:watchvis1widgets": "npm run watch --prefix widgets",
56
61
  "release": "release-script --all",
57
62
  "update-packages": "ncu --upgrade && cd src-widgets && ncu --upgrade && cd ..",
58
63
  "npm": "npm run npm:main && npm run npm:vis1widgets && npm run npm:vis2widgets",
59
64
  "npm:main": "npm i -f",
60
65
  "npm:vis2widgets": "cd src-widgets && npm i -f && cd ..",
61
66
  "npm:vis1widgets": "cd widgets && npm i && cd ..",
62
- "debug": "npx dev-server watch --noStart --doNotWatch widgets/vis2vis-jsontemplate/**",
63
- "repocheckerx": "npx github:oweitman/ioBroker.repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate --local",
64
- "repocheckerx2": "npx @iobroker/repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate",
67
+ "repochecker": "npx github:oweitman/ioBroker.repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate --noinfo --local --env=../iobroker.env",
65
68
  "translate": "translate-adapter",
66
69
  "translate-widgets-vis2": "node ./bin/translate.js --source src-widgets/src/i18n/",
67
- "translate-widgets-vis1": "node ./bin/translate.js --source widgets/vis-jsontemplate/myi18n/en.json --format single",
68
- "debugiob": "npx dev-server watch --noStart"
70
+ "translate-widgets-vis1": "node ./bin/translate.js --source widgets/vis-jsontemplate/myi18n/en.json --format single"
69
71
  },
70
72
  "bugs": {
71
73
  "url": "https://github.com/oweitman/ioBroker.vis-jsontemplate/issues"
@@ -75,7 +75,7 @@
75
75
  var version;
76
76
  var init_package = __esm({
77
77
  "../package.json"() {
78
- version = "4.6.0";
78
+ version = "4.6.3";
79
79
  }
80
80
  });
81
81
 
@@ -345,6 +345,7 @@
345
345
  );
346
346
  } catch (e) {
347
347
  text = vis.binds["jsontemplate"].escapeHTML(e.message).replace(/(?:\r\n|\r|\n)/g, "<br>");
348
+ console.error(e.message);
348
349
  text = text.replace(/ /gm, "&nbsp;");
349
350
  text = `<code style="color:red;">${text}</code>`;
350
351
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../package.json", "../js/jsontemplate.js", "../js/ejs.js", "../js/bundle.js"],
4
- "sourcesContent": ["{\n \"name\": \"iobroker.vis-jsontemplate\",\n \"version\": \"4.6.0\",\n \"description\": \"vis-jsontemplate\",\n \"author\": {\n \"name\": \"oweitman\",\n \"email\": \"oweitman@gmx.de\"\n },\n \"homepage\": \"https://github.com/oweitman/ioBroker.vis-jsontemplate\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/oweitman/ioBroker.vis-jsontemplate.git\"\n },\n \"keywords\": [\n \"ioBroker\",\n \"visualization\",\n \"widgets\",\n \"JSON template\",\n \"Smart Home\"\n ],\n \"dependencies\": {},\n \"devDependencies\": {\n \"@alcalzone/release-script\": \"^5.2.1\",\n \"@alcalzone/release-script-plugin-iobroker\": \"^5.2.0\",\n \"@alcalzone/release-script-plugin-license\": \"^5.2.0\",\n \"@alcalzone/release-script-plugin-manual-review\": \"^5.2.0\",\n \"@iobroker/adapter-dev\": \"^1.5.0\",\n \"@iobroker/eslint-config\": \"^2.2.0\",\n \"@iobroker/testing\": \"^5.3.0\",\n \"@iobroker/build-tools\": \"^3.0.1\",\n \"@iobroker/vis-2-widgets-react-dev\": \"^4.0.4\",\n \"@iobroker/vis-2-widgets-testing\": \"^1.0.6\",\n \"@types/node\": \"^25.9.5\"\n },\n \"main\": \"widgets/vis2jsontemplate/customWidgets.js\",\n \"files\": [\n \"admin/\",\n \"widgets/\",\n \"io-package.json\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"test:package\": \"mocha test/package --exit\",\n \"test:widgets\": \"mocha ./test/*.test.js\",\n \"test:integration\": \"mocha test/widgets.test.js --exit\",\n \"test\": \"npm run test:package && npm run test:widgets\",\n \"prepublishOnly\": \"npm run build-vis1widgets && npm run build-vis2widgets\",\n \"lint\": \"npm run lint-adapter && npm run lint-vis1widgets && npm run lint-vis2widgets\",\n \"lint-adapter\": \"eslint -c eslint.config.mjs .\",\n \"lint-vis1widgets\": \"cd widgets/ && npm run lint && cd ../..\",\n \"lint-vis2widgets\": \"cd src-widgets/ && npm run lint && cd ../..\",\n \"build\": \"npm run build-vis1widgets && npm run build-vis2widgets\",\n \"build-vis2widgets\": \"node tasks --javascript-vite\",\n \"build-vis1widgets\": \"cd widgets/vis-jsontemplate && npm run build && cd ../..\",\n \"release\": \"release-script --all\",\n \"update-packages\": \"ncu --upgrade && cd src-widgets && ncu --upgrade && cd ..\",\n \"npm\": \"npm run npm:main && npm run npm:vis1widgets && npm run npm:vis2widgets\",\n \"npm:main\": \"npm i -f\",\n \"npm:vis2widgets\": \"cd src-widgets && npm i -f && cd ..\",\n \"npm:vis1widgets\": \"cd widgets && npm i && cd ..\",\n \"debug\": \"npx dev-server watch --noStart --doNotWatch widgets/vis2vis-jsontemplate/**\",\n \"repocheckerx\": \"npx github:oweitman/ioBroker.repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate --local\",\n \"repocheckerx2\": \"npx @iobroker/repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate\",\n \"translate\": \"translate-adapter\",\n \"translate-widgets-vis2\": \"node ./bin/translate.js --source src-widgets/src/i18n/\",\n \"translate-widgets-vis1\": \"node ./bin/translate.js --source widgets/vis-jsontemplate/myi18n/en.json --format single\",\n \"debugiob\": \"npx dev-server watch --noStart\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/oweitman/ioBroker.vis-jsontemplate/issues\"\n },\n \"readmeFilename\": \"README.md\"\n}\n", "/*\n ioBroker.vis jsontemplate Widget-Set\n\n Copyright 2020-2025 oweitman oweitman@gmx.de\n*/\n'use strict';\n/* jshint -W069 */\n/* globals $,window,document,systemDictionary,vis,ejs,ace,_ */\n\n// add translations for edit mode\nimport { version as pkgVersion } from '../../../package.json';\n\nfetch('widgets/vis-jsontemplate/myi18n/words.json').then(async res => {\n const i18n = await res.json();\n\n $.extend(true, systemDictionary, i18n);\n});\n\nconst EJS_CONTEXT_NAMES = new Set(['widgetid', 'widgetID', 'data', 'dp', 'style', 'widget', 'I18n']);\nconst RESERVED_WORDS = new Set([\n 'await',\n 'break',\n 'case',\n 'catch',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'else',\n 'enum',\n 'export',\n 'extends',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'interface',\n 'let',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'static',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'while',\n 'with',\n 'yield',\n]);\n\nfunction isValidJavaScriptIdentifier(value) {\n if (typeof value !== 'string' || !value) {\n return false;\n }\n\n // ZWNJ and ZWJ are explicitly permitted after the first character by ECMAScript.\n // eslint-disable-next-line no-misleading-character-class\n return /^[$_\\p{ID_Start}][$\\u200C\\u200D_\\p{ID_Continue}]*$/u.test(value) && !RESERVED_WORDS.has(value);\n}\n\nfunction getDatapointVariableName(data, index) {\n const value = data?.[`json_dp_variable${index}`] ?? data?.[`json_dp_variable-${index}`] ?? '';\n return typeof value === 'string' ? value.trim() : '';\n}\n\nfunction buildDatapointVariables(data, dpCount) {\n const variables = {};\n const usedNames = new Set();\n\n for (let i = 1; i <= dpCount; i++) {\n const name = getDatapointVariableName(data, i);\n if (!name) {\n continue;\n }\n if (!isValidJavaScriptIdentifier(name)) {\n throw new Error(`Invalid JavaScript variable name: ${name}`);\n }\n\n const valueName = `${name}_value`;\n if (EJS_CONTEXT_NAMES.has(name) || EJS_CONTEXT_NAMES.has(valueName)) {\n throw new Error(`Variable name is already used by the template context: ${name}`);\n }\n if (usedNames.has(name) || usedNames.has(valueName)) {\n throw new Error(`Variable name is used more than once: ${name}`);\n }\n usedNames.add(name);\n usedNames.add(valueName);\n\n const oid = data[`json_dp${i}`];\n if (oid) {\n Object.defineProperty(variables, name, {\n value: oid,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n Object.defineProperty(variables, valueName, {\n value: vis.states.attr(`${oid}.val`),\n enumerable: true,\n configurable: true,\n writable: true,\n });\n }\n }\n\n return variables;\n}\n\n// this code can be placed directly in jsontemplate.html\nvis.binds['jsontemplate'] = {\n version: pkgVersion,\n _assetCache: (vis.binds['jsontemplate'] && vis.binds['jsontemplate']._assetCache) || new Map(),\n _widgetInit: (vis.binds['jsontemplate'] && vis.binds['jsontemplate']._widgetInit) || new Map(),\n\n /**\n * Log the version of jsontemplate and remove it.\n * Should be called from the main thread, as it logs to the console.\n */\n showVersion: function () {\n if (vis.binds['jsontemplate'].version) {\n console.log(`Version jsontemplate: ${vis.binds['jsontemplate'].version}`);\n vis.binds['jsontemplate'].version = null;\n }\n },\n jsontemplate4: {\n /**\n * Initializes and creates a JSON template widget.\n *\n * @param widgetID - The ID of the widget element.\n * @param view - The view object containing widget information.\n * @param data - Contains configuration data for the widget, including JSON object ID and template.\n * @param style - Style settings for the widget. *\n * The function checks for the widget element by its ID. If not found, it retries after a delay.\n * It parses the JSON data from the specified object ID, processes additional data points,\n * and binds states if necessary. It then renders the widget using the EJS template with\n * the provided data and style.\n \n Testtemplate:\n \n <%\n \n debugger;\n req = await sendToAsync(\"admin.0\",\"selectSendTo\");\n console.log(JSON.stringify(req));\n %>\n <%- JSON.stringify(req) %>\n <%\n async function sendToAsync(instance, command, sendData) {\n return new Promise((resolve, reject) => {\n try {\n vis.conn.sendTo(instance, command, sendData, function (receiveData) {\n resolve(receiveData);\n });\n } catch (error) {\n reject(error);\n }\n });\n }\n %>\n */\n createWidget: async function (widgetID, view, data, style) {\n const $div = $(`#${widgetID}`);\n // if nothing found => wait\n if (!$div.length) {\n return setTimeout(function () {\n vis.binds['jsontemplate'].jsontemplate4.createWidget(widgetID, view, data, style);\n }, 100);\n }\n const bound = [];\n // const oiddata = data.json_oid ? JSON.parse(vis.states.attr(`${data.json_oid}.val`)) : {};\n // const template = data.json_template ? data.json_template : '';\n if (data.json_oid) {\n bound.push(data.json_oid);\n }\n\n const dpCount = data.json_dpCount ? data.json_dpCount : 1;\n const datapoints = [];\n\n for (let i = 1; i <= dpCount; i++) {\n if (data[`json_dp${i}`]) {\n datapoints[data[`json_dp${i}`]] = vis.states.attr(`${data[`json_dp${i}`]}.val`);\n bound.push(data[`json_dp${i}`]);\n }\n }\n\n const scriptCount = data.json_scriptCount ? data.json_scriptCount : 1;\n const scripts = [];\n for (let i = 1; i <= scriptCount; i++) {\n if (data[`json_script${i}`]) {\n scripts.push(data[`json_script${i}`]);\n }\n }\n const cssCount = data.json_cssCount ? data.json_cssCount : 1;\n const css = [];\n for (let i = 1; i <= cssCount; i++) {\n if (data[`json_css${i}`]) {\n css.push(data[`json_css${i}`]);\n }\n }\n\n if (bound) {\n if (!vis.editMode) {\n await vis.binds['jsontemplate'].bindStatesAsync(\n $div,\n bound,\n vis.binds['jsontemplate'].jsontemplate4.onChange.bind({\n widgetID: widgetID,\n view: view,\n data: data,\n style: style,\n }),\n );\n }\n }\n // Assets einmalig laden (nicht in render, da render bei jedem DP-Change l\u00E4uft)\n try {\n await vis.binds['jsontemplate'].initWidgetAssetsOnce(widgetID, scripts, css);\n } catch (e) {\n // Fehler sichtbar machen und abbrechen\n let msg = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n msg = msg.replace(/ /gm, '&nbsp;');\n $div.html(`<code style=\"color:red;\">${msg}</code>`);\n return;\n }\n\n await this.render(widgetID, view, data, style);\n },\n\n /**\n * Will be called if the value of the bound data point changes.\n *\n * @param e event object\n * @param newVal new value of the bound data point\n */\n onChange: function (e, newVal) {\n if (newVal) {\n vis.binds['jsontemplate'].jsontemplate4.render(this.widgetID, this.view, this.data, this.style);\n }\n },\n\n /**\n * Renders the widget using the provided EJS template.\n *\n * @param widgetID - The ID of the widget element to be rendered.\n * @param view - The view object containing widget information.\n * @param data - Contains configuration data for the widget, including JSON object ID and template.\n *\n * The function retrieves data associated with the JSON object ID and additional data points.\n * It then uses EJS to render the template with the provided data and updates the widget's HTML content.\n * In case of an error during rendering, it escapes and formats the error message to display it in the widget.\n */\n render: async function (widgetID, view, data, style) {\n const oiddata = data.json_oid ? JSON.parse(vis.states.attr(`${data.json_oid}.val`)) : {};\n const dpCount = data.json_dpCount ? data.json_dpCount : 1;\n const template = data.json_template ? data.json_template : '';\n const datapoints = [];\n\n for (let i = 1; i <= dpCount; i++) {\n if (data[`json_dp${i}`]) {\n datapoints[data[`json_dp${i}`]] = vis.states.attr(`${data[`json_dp${i}`]}.val`);\n }\n }\n let text = '';\n try {\n const datapointVariables = buildDatapointVariables(data, dpCount);\n text = await ejs.render(\n template,\n {\n ...datapointVariables,\n widgetID: widgetID,\n widgetid: widgetID,\n data: oiddata,\n dp: datapoints,\n widget: data,\n style: style,\n },\n { async: true },\n );\n } catch (e) {\n text = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n text = text.replace(/ /gm, '&nbsp;');\n text = `<code style=\"color:red;\">${text}</code>`;\n }\n $(`#${widgetID}`).html(text);\n },\n },\n /**\n * Bind states to an element.\n *\n * First unbind all previously bound states and then get the current values of the states.\n * Then subscribe to the states and bind the callback to the states.\n * Finally, update the states of the element.\n *\n * @param elem - the element to bind the states to\n * @param bound - the states to bind\n * @param change_callback - the callback to call if one of the states changes\n */\n bindStates: function (elem, bound, change_callback) {\n const $div = $(elem);\n const boundstates = $div.data('bound');\n if (boundstates) {\n for (let i = 0; i < boundstates.length; i++) {\n vis.states.unbind(boundstates[i], change_callback);\n }\n }\n $div.data('bound', null);\n $div.data('bindHandler', null);\n\n vis.conn.gettingStates = 0;\n vis.conn.getStates(\n bound,\n function (error, states) {\n vis.conn.subscribe(bound);\n $div.data('bound', bound);\n $div.data('bindHandler', change_callback);\n for (let i = 0; i < bound.length; i++) {\n bound[i] = `${bound[i]}.val`;\n vis.states.bind(bound[i], change_callback);\n }\n vis.updateStates(states);\n }.bind({ change_callback }),\n );\n },\n bindStatesAsync: async function (elem, bound, change_callback) {\n return new Promise((resolve, reject) => {\n try {\n const $div = $(elem);\n const boundstates = $div.data('bound');\n if (boundstates) {\n for (let i = 0; i < boundstates.length; i++) {\n vis.states.unbind(boundstates[i], change_callback);\n }\n }\n $div.data('bound', null);\n $div.data('bindHandler', null);\n\n vis.conn.gettingStates = 0;\n vis.conn.getStates(\n bound,\n function (error, states) {\n vis.conn.subscribe(bound);\n $div.data('bound', bound);\n $div.data('bindHandler', change_callback);\n for (let i = 0; i < bound.length; i++) {\n bound[i] = `${bound[i]}.val`;\n vis.states.bind(bound[i], change_callback);\n }\n vis.updateStates(states);\n resolve();\n }.bind({ change_callback }),\n );\n } catch (error) {\n reject(error);\n }\n });\n },\n /**\n * Escapes HTML special characters in a given string.\n *\n * @param html - The string to escape.\n * @returns The escaped string.\n */\n escapeHTML: function (html) {\n let escapeEl = document.createElement('textarea');\n escapeEl.textContent = html;\n const ret = escapeEl.innerHTML;\n escapeEl = null;\n return ret;\n },\n /**\n * Shows a dialog for editing a template.\n *\n * @param widAttr - The attribute of the widget to edit.\n * @returns A object with two properties: 'input' and 'button'. 'input' is a string containing the HTML of a\n * 'textarea' element with id 'inspect_<widAttr>'. 'button' is an object with properties 'icon', 'text', 'title',\n * 'click'. 'click' is a function which is called when the button is clicked. The function shows a dialog with\n * the 'textarea' element. The dialog has a 'save' and a 'cancel' button. The 'save' button saves the changes to\n * the attribute and closes the dialog. The 'cancel' button just closes the dialog.\n */\n editEjs: function (widAttr) {\n const that = vis;\n const line = {\n input: `<textarea id=\"inspect_${widAttr}\"></textarea>`,\n };\n\n line.button = {\n icon: 'ui-icon-note',\n text: false,\n title: _('Select color'),\n click: function (/*event*/) {\n const wdata = $(this).data('wdata');\n let data = {};\n if (that.config['dialog-edit-text']) {\n data = JSON.parse(that.config['dialog-edit-text']);\n }\n ace.config.setModuleUrl('ace/mode/ejs', 'widgets/jsontemplate/js/mode-ejs.js');\n const editor = ace.edit('dialog-edit-text-textarea');\n let changed = false;\n $('#dialog-edit-text')\n .dialog({\n autoOpen: true,\n width: data.width || 800,\n height: data.height || 600,\n modal: true,\n resize: function () {\n editor.resize();\n },\n open: function (event) {\n $(event.target).parent().find('.ui-dialog-titlebar-close .ui-button-text').html('');\n $(this).parent().css({ 'z-index': 1000 });\n if (data.top !== undefined) {\n if (data.top >= 0) {\n $(this).parent().css({ top: data.top });\n } else {\n $(this).parent().css({ top: 0 });\n }\n }\n if (data.left !== undefined) {\n if (data.left >= 0) {\n $(this).parent().css({ left: data.left });\n } else {\n $(this).parent().css({ left: 0 });\n }\n }\n editor.getSession().setMode('ace/mode/ejs');\n editor.setOptions({\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n });\n editor.$blockScrolling = Infinity;\n editor.getSession().setUseWrapMode(true);\n editor.setValue($(`#inspect_${wdata.attr}`).val());\n editor.navigateFileEnd();\n editor.focus();\n editor.getSession().on('change', function () {\n changed = true;\n });\n },\n beforeClose: function () {\n const $parent = $('#dialog-edit-text').parent();\n const pos = $parent.position();\n that.editSaveConfig(\n 'dialog-edit-text',\n JSON.stringify({\n top: pos.top > 0 ? pos.top : 0,\n left: pos.left > 0 ? pos.left : 0,\n width: $parent.width(),\n height: $parent.height() + 9,\n }),\n );\n\n if (changed) {\n if (!window.confirm(_('Changes are not saved!. Continue?'))) {\n return false;\n }\n }\n },\n buttons: [\n {\n text: _('Ok'),\n click: function () {\n $(`#inspect_${wdata.attr}`).val(editor.getValue()).trigger('change');\n changed = false;\n $(this).dialog('close');\n },\n },\n {\n text: _('Cancel'),\n click: function () {\n $(this).dialog('close');\n },\n },\n ],\n })\n .show();\n },\n };\n return line;\n },\n loadAsset: function (url, kind /* 'js' | 'css' */) {\n const u = (url || '').trim();\n if (!u) {\n return Promise.resolve();\n }\n\n const cache = vis.binds['jsontemplate']._assetCache;\n if (cache.has(u)) {\n return cache.get(u);\n }\n\n const p = new Promise((resolve, reject) => {\n try {\n const isCss = kind === 'css' || u.toLowerCase().endsWith('.css');\n const isJs = kind === 'js' || u.toLowerCase().endsWith('.js') || !isCss;\n\n if (isCss) {\n // Verhindern, dass die gleiche CSS-Datei mehrfach in <head> landet\n // (zus\u00E4tzlich zum Promise-Cache; hilfreich bei Reload/Hot)\n const existing = document.querySelector(`link[rel=\"stylesheet\"][href=\"${CSS.escape(u)}\"]`);\n if (existing) {\n return resolve();\n }\n\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = u;\n link.onload = () => resolve();\n link.onerror = () => reject(new Error(`CSS konnte nicht geladen werden: ${u}`));\n document.head.appendChild(link);\n return;\n }\n\n if (isJs) {\n // Verhindern, dass das gleiche Script mehrfach eingebunden wird\n const existing = document.querySelector(`script[src=\"${CSS.escape(u)}\"]`);\n if (existing) {\n return resolve();\n }\n\n const s = document.createElement('script');\n s.src = u;\n\n // wichtig f\u00FCr Abh\u00E4ngigkeiten: Reihenfolge muss stimmen\n s.async = false;\n s.defer = false;\n\n s.onload = () => resolve();\n s.onerror = () => reject(new Error(`Script konnte nicht geladen werden: ${u}`));\n document.head.appendChild(s);\n return;\n }\n\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n\n cache.set(u, p);\n return p;\n },\n loadAssetsInOrder: async function (assets) {\n if (!assets || !assets.length) {\n return;\n }\n for (const a of assets) {\n if (!a) {\n continue;\n }\n if (typeof a === 'string') {\n // String => auto-detect per Endung\n await vis.binds['jsontemplate'].loadAsset(a);\n } else {\n // Objektform: { url, kind }\n await vis.binds['jsontemplate'].loadAsset(a.url, a.kind);\n }\n }\n },\n /**\n * L\u00E4dt CSS und Scripts (einmalig) in definierter Reihenfolge:\n * 1) CSS (Reihenfolge beibehalten, relevant f\u00FCr Overrides)\n * 2) JS (sequentiell, relevant f\u00FCr Abh\u00E4ngigkeiten)\n */\n loadScriptsAndCssOnce: async function (scripts, css) {\n // CSS zuerst\n if (Array.isArray(css) && css.length) {\n const cssAssets = css\n .map(u => (u || '').trim())\n .filter(Boolean)\n .map(u => ({ url: u, kind: 'css' }));\n await vis.binds['jsontemplate'].loadAssetsInOrder(cssAssets);\n }\n\n // danach Scripts\n if (Array.isArray(scripts) && scripts.length) {\n const scriptAssets = scripts\n .map(u => (u || '').trim())\n .filter(Boolean)\n .map(u => ({ url: u, kind: 'js' }));\n await vis.binds['jsontemplate'].loadAssetsInOrder(scriptAssets);\n }\n },\n\n /**\n * Einmalige Initialisierung pro WidgetID + Asset-Set.\n * Dadurch wird bei render()-Aufrufen (State changes) nicht erneut geladen.\n * Wenn sich Assets in den Properties \u00E4ndern, erzeugt der Key ein neues Init-Promise.\n */\n initWidgetAssetsOnce: function (widgetID, scripts, css) {\n const initMap = vis.binds['jsontemplate']._widgetInit;\n\n // Key enth\u00E4lt auch die Assets, damit \u00C4nderungen (im Editor) neu laden k\u00F6nnen\n const key =\n `${widgetID}::` +\n `css=${(css || [])\n .map(s => String(s).trim())\n .filter(Boolean)\n .join('|')}::` +\n `js=${(scripts || [])\n .map(s => String(s).trim())\n .filter(Boolean)\n .join('|')}`;\n\n if (initMap.has(key)) {\n return initMap.get(key);\n }\n\n const p = (async () => {\n await vis.binds['jsontemplate'].loadScriptsAndCssOnce(scripts, css);\n })();\n\n initMap.set(key, p);\n return p;\n },\n};\n\nvis.binds['jsontemplate'].showVersion();\n\n/* remember for strip tag function\nstr='this string has <i>html</i> code i want to <b>remove</b><br>Link Number 1 -><a href=\"http://www.bbc.co.uk\">BBC</a> Link Number 1<br><p>Now back to normal text and stuff</p>\n';\nstr=str.replace(/<br>/gi, \"\\n\");\nstr=str.replace(/<p.*>/gi, \"\\n\");\nstr=str.replace(/<a.*href=\"(.*?)\".*>(.*?)<\\/a>/gi, \" $2 (Link->$1) \");\nstr=str.replace(/<(?:.|\\s)*?>/g, \"\");\n*/\n", "(function (f) {\r\n if (typeof exports === 'object' && typeof module !== 'undefined') {\r\n module.exports = f();\r\n } else if (typeof define === 'function' && define.amd) {\r\n define([], f);\r\n } else {\r\n var g;\r\n if (typeof window !== 'undefined') {\r\n g = window;\r\n } else if (typeof global !== 'undefined') {\r\n g = global;\r\n } else if (typeof self !== 'undefined') {\r\n g = self;\r\n } else {\r\n g = this;\r\n }\r\n g.ejs = f();\r\n }\r\n})(function () {\r\n var define, module, exports;\r\n return (function () {\r\n function e(t, n, r) {\r\n function s(o, u) {\r\n if (!n[o]) {\r\n if (!t[o]) {\r\n var a = typeof require == 'function' && require;\r\n if (!u && a) return a(o, !0);\r\n if (i) return i(o, !0);\r\n var f = new Error(\"Cannot find module '\" + o + \"'\");\r\n throw ((f.code = 'MODULE_NOT_FOUND'), f);\r\n }\r\n var l = (n[o] = { exports: {} });\r\n t[o][0].call(\r\n l.exports,\r\n function (e) {\r\n var n = t[o][1][e];\r\n return s(n ? n : e);\r\n },\r\n l,\r\n l.exports,\r\n e,\r\n t,\r\n n,\r\n r,\r\n );\r\n }\r\n return n[o].exports;\r\n }\r\n var i = typeof require == 'function' && require;\r\n for (var o = 0; o < r.length; o++) s(r[o]);\r\n return s;\r\n }\r\n return e;\r\n })()(\r\n {\r\n 1: [\r\n function (require, module, exports) {\r\n /*\r\n * EJS Embedded JavaScript templates\r\n * Copyright 2112 Matthew Eernisse (mde@fleegix.org)\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\r\n */\r\n\r\n 'use strict';\r\n\r\n /**\r\n * @file Embedded JavaScript templating engine. {@link http://ejs.co}\r\n * @author Matthew Eernisse <mde@fleegix.org>\r\n * @author Tiancheng \"Timothy\" Gu <timothygu99@gmail.com>\r\n * @project EJS\r\n * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}\r\n */\r\n\r\n /**\r\n * EJS internal functions.\r\n *\r\n * Technically this \"module\" lies in the same file as {@link module:ejs}, for\r\n * the sake of organization all the private functions re grouped into this\r\n * module.\r\n *\r\n * @module ejs-internal\r\n * @private\r\n */\r\n\r\n /**\r\n * Embedded JavaScript templating engine.\r\n *\r\n * @module ejs\r\n * @public\r\n */\r\n\r\n var fs = require('fs');\r\n var path = require('path');\r\n var utils = require('./utils');\r\n\r\n var scopeOptionWarned = false;\r\n var _VERSION_STRING = require('../package.json').version;\r\n var _DEFAULT_OPEN_DELIMITER = '<';\r\n var _DEFAULT_CLOSE_DELIMITER = '>';\r\n var _DEFAULT_DELIMITER = '%';\r\n var _DEFAULT_LOCALS_NAME = 'locals';\r\n var _NAME = 'ejs';\r\n var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)';\r\n var _OPTS_PASSABLE_WITH_DATA = [\r\n 'delimiter',\r\n 'scope',\r\n 'context',\r\n 'debug',\r\n 'compileDebug',\r\n 'client',\r\n '_with',\r\n 'rmWhitespace',\r\n 'strict',\r\n 'filename',\r\n 'async',\r\n ];\r\n // We don't allow 'cache' option to be passed in the data obj for\r\n // the normal `render` call, but this is where Express 2 & 3 put it\r\n // so we make an exception for `renderFile`\r\n var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache');\r\n var _BOM = /^\\uFEFF/;\r\n\r\n /**\r\n * EJS template function cache. This can be a LRU object from lru-cache NPM\r\n * module. By default, it is {@link module:utils.cache}, a simple in-process\r\n * cache that grows continuously.\r\n *\r\n * @type {Cache}\r\n */\r\n\r\n exports.cache = utils.cache;\r\n\r\n /**\r\n * Custom file loader. Useful for template preprocessing or restricting access\r\n * to a certain part of the filesystem.\r\n *\r\n * @type {fileLoader}\r\n */\r\n\r\n exports.fileLoader = fs.readFileSync;\r\n\r\n /**\r\n * Name of the object containing the locals.\r\n *\r\n * This variable is overridden by {@link Options}`.localsName` if it is not\r\n * `undefined`.\r\n *\r\n * @type {String}\r\n * @public\r\n */\r\n\r\n exports.localsName = _DEFAULT_LOCALS_NAME;\r\n\r\n /**\r\n * Promise implementation -- defaults to the native implementation if available\r\n * This is mostly just for testability\r\n *\r\n * @type {Function}\r\n * @public\r\n */\r\n\r\n exports.promiseImpl = new Function('return this;')().Promise;\r\n\r\n /**\r\n * Get the path to the included file from the parent file path and the\r\n * specified path.\r\n *\r\n * @param {String} name specified path\r\n * @param {String} filename parent file path\r\n * @param {Boolean} isDir parent file path whether is directory\r\n * @return {String}\r\n */\r\n exports.resolveInclude = function (name, filename, isDir) {\r\n var dirname = path.dirname;\r\n var extname = path.extname;\r\n var resolve = path.resolve;\r\n var includePath = resolve(isDir ? filename : dirname(filename), name);\r\n var ext = extname(name);\r\n if (!ext) {\r\n includePath += '.ejs';\r\n }\r\n return includePath;\r\n };\r\n\r\n /**\r\n * Get the path to the included file by Options\r\n *\r\n * @param {String} path specified path\r\n * @param {Options} options compilation options\r\n * @return {String}\r\n */\r\n function getIncludePath(path, options) {\r\n var includePath;\r\n var filePath;\r\n var views = options.views;\r\n var match = /^[A-Za-z]+:\\\\|^\\//.exec(path);\r\n\r\n // Abs path\r\n if (match && match.length) {\r\n includePath = exports.resolveInclude(path.replace(/^\\/*/, ''), options.root || '/', true);\r\n }\r\n // Relative paths\r\n else {\r\n // Look relative to a passed filename first\r\n if (options.filename) {\r\n filePath = exports.resolveInclude(path, options.filename);\r\n if (fs.existsSync(filePath)) {\r\n includePath = filePath;\r\n }\r\n }\r\n // Then look in any views directories\r\n if (!includePath) {\r\n if (\r\n Array.isArray(views) &&\r\n views.some(function (v) {\r\n filePath = exports.resolveInclude(path, v, true);\r\n return fs.existsSync(filePath);\r\n })\r\n ) {\r\n includePath = filePath;\r\n }\r\n }\r\n if (!includePath) {\r\n throw new Error(\r\n 'Could not find the include file \"' + options.escapeFunction(path) + '\"',\r\n );\r\n }\r\n }\r\n return includePath;\r\n }\r\n\r\n /**\r\n * Get the template from a string or a file, either compiled on-the-fly or\r\n * read from cache (if enabled), and cache the template if needed.\r\n *\r\n * If `template` is not set, the file specified in `options.filename` will be\r\n * read.\r\n *\r\n * If `options.cache` is true, this function reads the file from\r\n * `options.filename` so it must be set prior to calling this function.\r\n *\r\n * @memberof module:ejs-internal\r\n * @param {Options} options compilation options\r\n * @param {String} [template] template source\r\n * @return {(TemplateFunction|ClientFunction)}\r\n * Depending on the value of `options.client`, either type might be returned.\r\n * @static\r\n */\r\n\r\n function handleCache(options, template) {\r\n var func;\r\n var filename = options.filename;\r\n var hasTemplate = arguments.length > 1;\r\n\r\n if (options.cache) {\r\n if (!filename) {\r\n throw new Error('cache option requires a filename');\r\n }\r\n func = exports.cache.get(filename);\r\n if (func) {\r\n return func;\r\n }\r\n if (!hasTemplate) {\r\n template = fileLoader(filename).toString().replace(_BOM, '');\r\n }\r\n } else if (!hasTemplate) {\r\n // istanbul ignore if: should not happen at all\r\n if (!filename) {\r\n throw new Error('Internal EJS error: no file name or template ' + 'provided');\r\n }\r\n template = fileLoader(filename).toString().replace(_BOM, '');\r\n }\r\n func = exports.compile(template, options);\r\n if (options.cache) {\r\n exports.cache.set(filename, func);\r\n }\r\n return func;\r\n }\r\n\r\n /**\r\n * Try calling handleCache with the given options and data and call the\r\n * callback with the result. If an error occurs, call the callback with\r\n * the error. Used by renderFile().\r\n *\r\n * @memberof module:ejs-internal\r\n * @param {Options} options compilation options\r\n * @param {Object} data template data\r\n * @param {RenderFileCallback} cb callback\r\n * @static\r\n */\r\n\r\n function tryHandleCache(options, data, cb) {\r\n var result;\r\n if (!cb) {\r\n if (typeof exports.promiseImpl == 'function') {\r\n return new exports.promiseImpl(function (resolve, reject) {\r\n try {\r\n result = handleCache(options)(data);\r\n resolve(result);\r\n } catch (err) {\r\n reject(err);\r\n }\r\n });\r\n } else {\r\n throw new Error('Please provide a callback function');\r\n }\r\n } else {\r\n try {\r\n result = handleCache(options)(data);\r\n } catch (err) {\r\n return cb(err);\r\n }\r\n\r\n cb(null, result);\r\n }\r\n }\r\n\r\n /**\r\n * fileLoader is independent\r\n *\r\n * @param {String} filePath ejs file path.\r\n * @return {String} The contents of the specified file.\r\n * @static\r\n */\r\n\r\n function fileLoader(filePath) {\r\n return exports.fileLoader(filePath);\r\n }\r\n\r\n /**\r\n * Get the template function.\r\n *\r\n * If `options.cache` is `true`, then the template is cached.\r\n *\r\n * @memberof module:ejs-internal\r\n * @param {String} path path for the specified file\r\n * @param {Options} options compilation options\r\n * @return {(TemplateFunction|ClientFunction)}\r\n * Depending on the value of `options.client`, either type might be returned\r\n * @static\r\n */\r\n\r\n function includeFile(path, options) {\r\n var opts = utils.shallowCopy({}, options);\r\n opts.filename = getIncludePath(path, opts);\r\n return handleCache(opts);\r\n }\r\n\r\n /**\r\n * Re-throw the given `err` in context to the `str` of ejs, `filename`, and\r\n * `lineno`.\r\n *\r\n * @implements RethrowCallback\r\n * @memberof module:ejs-internal\r\n * @param {Error} err Error object\r\n * @param {String} str EJS source\r\n * @param {String} filename file name of the EJS file\r\n * @param {String} lineno line number of the error\r\n * @static\r\n */\r\n\r\n function rethrow(err, str, flnm, lineno, esc) {\r\n var lines = str.split('\\n');\r\n var start = Math.max(lineno - 3, 0);\r\n var end = Math.min(lines.length, lineno + 3);\r\n var filename = esc(flnm); // eslint-disable-line\r\n // Error context\r\n var context = lines\r\n .slice(start, end)\r\n .map(function (line, i) {\r\n var curr = i + start + 1;\r\n return (curr == lineno ? ' >> ' : ' ') + curr + '| ' + line;\r\n })\r\n .join('\\n');\r\n\r\n // Alter exception message\r\n err.path = filename;\r\n err.message = (filename || 'ejs') + ':' + lineno + '\\n' + context + '\\n\\n' + err.message;\r\n\r\n throw err;\r\n }\r\n\r\n function stripSemi(str) {\r\n return str.replace(/;(\\s*$)/, '$1');\r\n }\r\n\r\n /**\r\n * Compile the given `str` of ejs into a template function.\r\n *\r\n * @param {String} template EJS template\r\n *\r\n * @param {Options} opts compilation options\r\n *\r\n * @return {(TemplateFunction|ClientFunction)}\r\n * Depending on the value of `opts.client`, either type might be returned.\r\n * Note that the return type of the function also depends on the value of `opts.async`.\r\n * @public\r\n */\r\n\r\n exports.compile = function compile(template, opts) {\r\n var templ;\r\n\r\n // v1 compat\r\n // 'scope' is 'context'\r\n // FIXME: Remove this in a future version\r\n if (opts && opts.scope) {\r\n if (!scopeOptionWarned) {\r\n console.warn('`scope` option is deprecated and will be removed in EJS 3');\r\n scopeOptionWarned = true;\r\n }\r\n if (!opts.context) {\r\n opts.context = opts.scope;\r\n }\r\n delete opts.scope;\r\n }\r\n templ = new Template(template, opts);\r\n return templ.compile();\r\n };\r\n\r\n /**\r\n * Render the given `template` of ejs.\r\n *\r\n * If you would like to include options but not data, you need to explicitly\r\n * call this function with `data` being an empty object or `null`.\r\n *\r\n * @param {String} template EJS template\r\n * @param {Object} [data={}] template data\r\n * @param {Options} [opts={}] compilation and rendering options\r\n * @return {(String|Promise<String>)}\r\n * Return value type depends on `opts.async`.\r\n * @public\r\n */\r\n\r\n exports.render = function (template, d, o) {\r\n var data = d || {};\r\n var opts = o || {};\r\n\r\n // No options object -- if there are optiony names\r\n // in the data, copy them to options\r\n if (arguments.length == 2) {\r\n utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);\r\n }\r\n\r\n return handleCache(opts, template)(data);\r\n };\r\n\r\n /**\r\n * Render an EJS file at the given `path` and callback `cb(err, str)`.\r\n *\r\n * If you would like to include options but not data, you need to explicitly\r\n * call this function with `data` being an empty object or `null`.\r\n *\r\n * @param {String} path path to the EJS file\r\n * @param {Object} [data={}] template data\r\n * @param {Options} [opts={}] compilation and rendering options\r\n * @param {RenderFileCallback} cb callback\r\n * @public\r\n */\r\n\r\n exports.renderFile = function () {\r\n var args = Array.prototype.slice.call(arguments);\r\n var filename = args.shift();\r\n var cb;\r\n var opts = { filename: filename };\r\n var data;\r\n var viewOpts;\r\n\r\n // Do we have a callback?\r\n if (typeof arguments[arguments.length - 1] == 'function') {\r\n cb = args.pop();\r\n }\r\n // Do we have data/opts?\r\n if (args.length) {\r\n // Should always have data obj\r\n data = args.shift();\r\n // Normal passed opts (data obj + opts obj)\r\n if (args.length) {\r\n // Use shallowCopy so we don't pollute passed in opts obj with new vals\r\n utils.shallowCopy(opts, args.pop());\r\n }\r\n // Special casing for Express (settings + opts-in-data)\r\n else {\r\n // Express 3 and 4\r\n if (data.settings) {\r\n // Pull a few things from known locations\r\n if (data.settings.views) {\r\n opts.views = data.settings.views;\r\n }\r\n if (data.settings['view cache']) {\r\n opts.cache = true;\r\n }\r\n // Undocumented after Express 2, but still usable, esp. for\r\n // items that are unsafe to be passed along with data, like `root`\r\n viewOpts = data.settings['view options'];\r\n if (viewOpts) {\r\n utils.shallowCopy(opts, viewOpts);\r\n }\r\n }\r\n // Express 2 and lower, values set in app.locals, or people who just\r\n // want to pass options in their data. NOTE: These values will override\r\n // anything previously set in settings or settings['view options']\r\n utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);\r\n }\r\n opts.filename = filename;\r\n } else {\r\n data = {};\r\n }\r\n\r\n return tryHandleCache(opts, data, cb);\r\n };\r\n\r\n /**\r\n * Clear intermediate JavaScript cache. Calls {@link Cache#reset}.\r\n * @public\r\n */\r\n\r\n /**\r\n * EJS template class\r\n * @public\r\n */\r\n exports.Template = Template;\r\n\r\n exports.clearCache = function () {\r\n exports.cache.reset();\r\n };\r\n\r\n function Template(text, opts) {\r\n opts = opts || {};\r\n var options = {};\r\n this.templateText = text;\r\n this.mode = null;\r\n this.truncate = false;\r\n this.currentLine = 1;\r\n this.source = '';\r\n this.dependencies = [];\r\n options.client = opts.client || false;\r\n options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;\r\n options.compileDebug = opts.compileDebug !== false;\r\n options.debug = !!opts.debug;\r\n options.filename = opts.filename;\r\n options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;\r\n options.closeDelimiter =\r\n opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;\r\n options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;\r\n options.strict = opts.strict || false;\r\n options.context = opts.context;\r\n options.cache = opts.cache || false;\r\n options.rmWhitespace = opts.rmWhitespace;\r\n options.root = opts.root;\r\n options.outputFunctionName = opts.outputFunctionName;\r\n options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;\r\n options.views = opts.views;\r\n options.async = opts.async;\r\n options.destructuredLocals = opts.destructuredLocals;\r\n options.legacyInclude = typeof opts.legacyInclude != 'undefined' ? !!opts.legacyInclude : true;\r\n\r\n if (options.strict) {\r\n options._with = false;\r\n } else {\r\n options._with = typeof opts._with != 'undefined' ? opts._with : true;\r\n }\r\n\r\n this.opts = options;\r\n\r\n this.regex = this.createRegex();\r\n }\r\n\r\n Template.modes = {\r\n EVAL: 'eval',\r\n ESCAPED: 'escaped',\r\n RAW: 'raw',\r\n COMMENT: 'comment',\r\n LITERAL: 'literal',\r\n };\r\n\r\n Template.prototype = {\r\n createRegex: function () {\r\n var str = _REGEX_STRING;\r\n var delim = utils.escapeRegExpChars(this.opts.delimiter);\r\n var open = utils.escapeRegExpChars(this.opts.openDelimiter);\r\n var close = utils.escapeRegExpChars(this.opts.closeDelimiter);\r\n str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);\r\n return new RegExp(str);\r\n },\r\n\r\n compile: function () {\r\n var src;\r\n var fn;\r\n var opts = this.opts;\r\n var prepended = '';\r\n var appended = '';\r\n var escapeFn = opts.escapeFunction;\r\n var ctor;\r\n\r\n if (!this.source) {\r\n this.generateSource();\r\n prepended +=\r\n ' var __output = \"\";\\n' +\r\n ' function __append(s) { if (s !== undefined && s !== null) __output += s }\\n';\r\n if (opts.outputFunctionName) {\r\n prepended += ' var ' + opts.outputFunctionName + ' = __append;' + '\\n';\r\n }\r\n if (opts.destructuredLocals && opts.destructuredLocals.length) {\r\n var destructuring = ' var __locals = (' + opts.localsName + ' || {}),\\n';\r\n for (var i = 0; i < opts.destructuredLocals.length; i++) {\r\n var name = opts.destructuredLocals[i];\r\n if (i > 0) {\r\n destructuring += ',\\n ';\r\n }\r\n destructuring += name + ' = __locals.' + name;\r\n }\r\n prepended += destructuring + ';\\n';\r\n }\r\n if (opts._with !== false) {\r\n prepended += ' with (' + opts.localsName + ' || {}) {' + '\\n';\r\n appended += ' }' + '\\n';\r\n }\r\n appended += ' return __output;' + '\\n';\r\n this.source = prepended + this.source + appended;\r\n }\r\n\r\n if (opts.compileDebug) {\r\n src =\r\n 'var __line = 1' +\r\n '\\n' +\r\n ' , __lines = ' +\r\n JSON.stringify(this.templateText) +\r\n '\\n' +\r\n ' , __filename = ' +\r\n (opts.filename ? JSON.stringify(opts.filename) : 'undefined') +\r\n ';' +\r\n '\\n' +\r\n 'try {' +\r\n '\\n' +\r\n this.source +\r\n '} catch (e) {' +\r\n '\\n' +\r\n ' rethrow(e, __lines, __filename, __line, escapeFn);' +\r\n '\\n' +\r\n '}' +\r\n '\\n';\r\n } else {\r\n src = this.source;\r\n }\r\n\r\n if (opts.client) {\r\n src = 'escapeFn = escapeFn || ' + escapeFn.toString() + ';' + '\\n' + src;\r\n if (opts.compileDebug) {\r\n src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\\n' + src;\r\n }\r\n }\r\n\r\n if (opts.strict) {\r\n src = '\"use strict\";\\n' + src;\r\n }\r\n if (opts.debug) {\r\n console.log(src);\r\n }\r\n if (opts.compileDebug && opts.filename) {\r\n src = src + '\\n' + '//# sourceURL=' + opts.filename + '\\n';\r\n }\r\n\r\n try {\r\n if (opts.async) {\r\n // Have to use generated function for this, since in envs without support,\r\n // it breaks in parsing\r\n try {\r\n ctor = new Function('return (async function(){}).constructor;')();\r\n } catch (e) {\r\n if (e instanceof SyntaxError) {\r\n throw new Error('This environment does not support async/await');\r\n } else {\r\n throw e;\r\n }\r\n }\r\n } else {\r\n ctor = Function;\r\n }\r\n fn = new ctor(opts.localsName + ', escapeFn, include, rethrow', src);\r\n } catch (e) {\r\n // istanbul ignore else\r\n if (e instanceof SyntaxError) {\r\n if (opts.filename) {\r\n e.message += ' in ' + opts.filename;\r\n }\r\n e.message += ' while compiling ejs\\n\\n';\r\n e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\\n';\r\n e.message += 'https://github.com/RyanZim/EJS-Lint';\r\n if (!opts.async) {\r\n e.message += '\\n';\r\n e.message +=\r\n 'Or, if you meant to create an async function, pass `async: true` as an option.';\r\n }\r\n }\r\n throw e;\r\n }\r\n\r\n // Return a callable function which will execute the function\r\n // created by the source-code, with the passed data as locals\r\n // Adds a local `include` function which allows full recursive include\r\n var returnedFn = opts.client\r\n ? fn\r\n : function anonymous(data) {\r\n var include = function (path, includeData) {\r\n var d = utils.shallowCopy({}, data);\r\n if (includeData) {\r\n d = utils.shallowCopy(d, includeData);\r\n }\r\n return includeFile(path, opts)(d);\r\n };\r\n return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]);\r\n };\r\n returnedFn.dependencies = this.dependencies;\r\n if (opts.filename && typeof Object.defineProperty === 'function') {\r\n var filename = opts.filename;\r\n var basename = path.basename(filename, path.extname(filename));\r\n try {\r\n Object.defineProperty(returnedFn, 'name', {\r\n value: basename,\r\n writable: false,\r\n enumerable: false,\r\n configurable: true,\r\n });\r\n } catch (e) {\r\n /* ignore */\r\n }\r\n }\r\n return returnedFn;\r\n },\r\n\r\n generateSource: function () {\r\n var opts = this.opts;\r\n\r\n if (opts.rmWhitespace) {\r\n // Have to use two separate replace here as `^` and `$` operators don't\r\n // work well with `\\r` and empty lines don't work well with the `m` flag.\r\n this.templateText = this.templateText\r\n .replace(/[\\r\\n]+/g, '\\n')\r\n .replace(/^\\s+|\\s+$/gm, '');\r\n }\r\n\r\n // Slurp spaces and tabs before <%_ and after _%>\r\n this.templateText = this.templateText\r\n .replace(/[ \\t]*<%_/gm, '<%_')\r\n .replace(/_%>[ \\t]*/gm, '_%>');\r\n\r\n var self = this;\r\n var matches = this.parseTemplateText();\r\n var d = this.opts.delimiter;\r\n var o = this.opts.openDelimiter;\r\n var c = this.opts.closeDelimiter;\r\n\r\n if (matches && matches.length) {\r\n matches.forEach(function (line, index) {\r\n var closing;\r\n // If this is an opening tag, check for closing tags\r\n // FIXME: May end up with some false positives here\r\n // Better to store modes as k/v with openDelimiter + delimiter as key\r\n // Then this can simply check against the map\r\n if (\r\n line.indexOf(o + d) === 0 && // If it is a tag\r\n line.indexOf(o + d + d) !== 0\r\n ) {\r\n // and is not escaped\r\n closing = matches[index + 2];\r\n if (!(closing == d + c || closing == '-' + d + c || closing == '_' + d + c)) {\r\n throw new Error('Could not find matching close tag for \"' + line + '\".');\r\n }\r\n }\r\n self.scanLine(line);\r\n });\r\n }\r\n },\r\n\r\n parseTemplateText: function () {\r\n var str = this.templateText;\r\n var pat = this.regex;\r\n var result = pat.exec(str);\r\n var arr = [];\r\n var firstPos;\r\n\r\n while (result) {\r\n firstPos = result.index;\r\n\r\n if (firstPos !== 0) {\r\n arr.push(str.substring(0, firstPos));\r\n str = str.slice(firstPos);\r\n }\r\n\r\n arr.push(result[0]);\r\n str = str.slice(result[0].length);\r\n result = pat.exec(str);\r\n }\r\n\r\n if (str) {\r\n arr.push(str);\r\n }\r\n\r\n return arr;\r\n },\r\n\r\n _addOutput: function (line) {\r\n if (this.truncate) {\r\n // Only replace single leading linebreak in the line after\r\n // -%> tag -- this is the single, trailing linebreak\r\n // after the tag that the truncation mode replaces\r\n // Handle Win / Unix / old Mac linebreaks -- do the \\r\\n\r\n // combo first in the regex-or\r\n line = line.replace(/^(?:\\r\\n|\\r|\\n)/, '');\r\n this.truncate = false;\r\n }\r\n if (!line) {\r\n return line;\r\n }\r\n\r\n // Preserve literal slashes\r\n line = line.replace(/\\\\/g, '\\\\\\\\');\r\n\r\n // Convert linebreaks\r\n line = line.replace(/\\n/g, '\\\\n');\r\n line = line.replace(/\\r/g, '\\\\r');\r\n\r\n // Escape double-quotes\r\n // - this will be the delimiter during execution\r\n line = line.replace(/\"/g, '\\\\\"');\r\n this.source += ' ; __append(\"' + line + '\")' + '\\n';\r\n },\r\n\r\n scanLine: function (line) {\r\n var self = this;\r\n var d = this.opts.delimiter;\r\n var o = this.opts.openDelimiter;\r\n var c = this.opts.closeDelimiter;\r\n var newLineCount = 0;\r\n\r\n newLineCount = line.split('\\n').length - 1;\r\n\r\n switch (line) {\r\n case o + d:\r\n case o + d + '_':\r\n this.mode = Template.modes.EVAL;\r\n break;\r\n case o + d + '=':\r\n this.mode = Template.modes.ESCAPED;\r\n break;\r\n case o + d + '-':\r\n this.mode = Template.modes.RAW;\r\n break;\r\n case o + d + '#':\r\n this.mode = Template.modes.COMMENT;\r\n break;\r\n case o + d + d:\r\n this.mode = Template.modes.LITERAL;\r\n this.source += ' ; __append(\"' + line.replace(o + d + d, o + d) + '\")' + '\\n';\r\n break;\r\n case d + d + c:\r\n this.mode = Template.modes.LITERAL;\r\n this.source += ' ; __append(\"' + line.replace(d + d + c, d + c) + '\")' + '\\n';\r\n break;\r\n case d + c:\r\n case '-' + d + c:\r\n case '_' + d + c:\r\n if (this.mode == Template.modes.LITERAL) {\r\n this._addOutput(line);\r\n }\r\n\r\n this.mode = null;\r\n this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;\r\n break;\r\n default:\r\n // In script mode, depends on type of tag\r\n if (this.mode) {\r\n // If '//' is found without a line break, add a line break.\r\n switch (this.mode) {\r\n case Template.modes.EVAL:\r\n case Template.modes.ESCAPED:\r\n case Template.modes.RAW:\r\n if (line.lastIndexOf('//') > line.lastIndexOf('\\n')) {\r\n line += '\\n';\r\n }\r\n }\r\n switch (this.mode) {\r\n // Just executing code\r\n case Template.modes.EVAL:\r\n this.source += ' ; ' + line + '\\n';\r\n break;\r\n // Exec, esc, and output\r\n case Template.modes.ESCAPED:\r\n this.source +=\r\n ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\\n';\r\n break;\r\n // Exec and output\r\n case Template.modes.RAW:\r\n this.source += ' ; __append(' + stripSemi(line) + ')' + '\\n';\r\n break;\r\n case Template.modes.COMMENT:\r\n // Do nothing\r\n break;\r\n // Literal <%% mode, append as raw output\r\n case Template.modes.LITERAL:\r\n this._addOutput(line);\r\n break;\r\n }\r\n }\r\n // In string mode, just add the output\r\n else {\r\n this._addOutput(line);\r\n }\r\n }\r\n\r\n if (self.opts.compileDebug && newLineCount) {\r\n this.currentLine += newLineCount;\r\n this.source += ' ; __line = ' + this.currentLine + '\\n';\r\n }\r\n },\r\n };\r\n\r\n /**\r\n * Escape characters reserved in XML.\r\n *\r\n * This is simply an export of {@link module:utils.escapeXML}.\r\n *\r\n * If `markup` is `undefined` or `null`, the empty string is returned.\r\n *\r\n * @param {String} markup Input string\r\n * @return {String} Escaped string\r\n * @public\r\n * @func\r\n * */\r\n exports.escapeXML = utils.escapeXML;\r\n\r\n /**\r\n * Express.js support.\r\n *\r\n * This is an alias for {@link module:ejs.renderFile}, in order to support\r\n * Express.js out-of-the-box.\r\n *\r\n * @func\r\n */\r\n\r\n exports.__express = exports.renderFile;\r\n\r\n /**\r\n * Version of EJS.\r\n *\r\n * @readonly\r\n * @type {String}\r\n * @public\r\n */\r\n\r\n exports.VERSION = _VERSION_STRING;\r\n\r\n /**\r\n * Name for detection of EJS.\r\n *\r\n * @readonly\r\n * @type {String}\r\n * @public\r\n */\r\n\r\n exports.name = _NAME;\r\n\r\n /* istanbul ignore if */\r\n if (typeof window != 'undefined') {\r\n window.ejs = exports;\r\n }\r\n },\r\n { '../package.json': 6, './utils': 2, fs: 3, path: 4 },\r\n ],\r\n 2: [\r\n function (require, module, exports) {\r\n /*\r\n * EJS Embedded JavaScript templates\r\n * Copyright 2112 Matthew Eernisse (mde@fleegix.org)\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\r\n */\r\n\r\n /**\r\n * Private utility functions\r\n * @module utils\r\n * @private\r\n */\r\n\r\n 'use strict';\r\n\r\n var regExpChars = /[|\\\\{}()[\\]^$+*?.]/g;\r\n\r\n /**\r\n * Escape characters reserved in regular expressions.\r\n *\r\n * If `string` is `undefined` or `null`, the empty string is returned.\r\n *\r\n * @param {String} string Input string\r\n * @return {String} Escaped string\r\n * @static\r\n * @private\r\n */\r\n exports.escapeRegExpChars = function (string) {\r\n // istanbul ignore if\r\n if (!string) {\r\n return '';\r\n }\r\n return String(string).replace(regExpChars, '\\\\$&');\r\n };\r\n\r\n var _ENCODE_HTML_RULES = {\r\n '&': '&amp;',\r\n '<': '&lt;',\r\n '>': '&gt;',\r\n '\"': '&#34;',\r\n \"'\": '&#39;',\r\n };\r\n var _MATCH_HTML = /[&<>'\"]/g;\r\n\r\n function encode_char(c) {\r\n return _ENCODE_HTML_RULES[c] || c;\r\n }\r\n\r\n /**\r\n * Stringified version of constants used by {@link module:utils.escapeXML}.\r\n *\r\n * It is used in the process of generating {@link ClientFunction}s.\r\n *\r\n * @readonly\r\n * @type {String}\r\n */\r\n\r\n var escapeFuncStr =\r\n 'var _ENCODE_HTML_RULES = {\\n' +\r\n ' \"&\": \"&amp;\"\\n' +\r\n ' , \"<\": \"&lt;\"\\n' +\r\n ' , \">\": \"&gt;\"\\n' +\r\n ' , \\'\"\\': \"&#34;\"\\n' +\r\n ' , \"\\'\": \"&#39;\"\\n' +\r\n ' }\\n' +\r\n ' , _MATCH_HTML = /[&<>\\'\"]/g;\\n' +\r\n 'function encode_char(c) {\\n' +\r\n ' return _ENCODE_HTML_RULES[c] || c;\\n' +\r\n '};\\n';\r\n\r\n /**\r\n * Escape characters reserved in XML.\r\n *\r\n * If `markup` is `undefined` or `null`, the empty string is returned.\r\n *\r\n * @implements {EscapeCallback}\r\n * @param {String} markup Input string\r\n * @return {String} Escaped string\r\n * @static\r\n * @private\r\n */\r\n\r\n exports.escapeXML = function (markup) {\r\n return markup == undefined ? '' : String(markup).replace(_MATCH_HTML, encode_char);\r\n };\r\n exports.escapeXML.toString = function () {\r\n return Function.prototype.toString.call(this) + ';\\n' + escapeFuncStr;\r\n };\r\n\r\n /**\r\n * Naive copy of properties from one object to another.\r\n * Does not recurse into non-scalar properties\r\n * Does not check to see if the property has a value before copying\r\n *\r\n * @param {Object} to Destination object\r\n * @param {Object} from Source object\r\n * @return {Object} Destination object\r\n * @static\r\n * @private\r\n */\r\n exports.shallowCopy = function (to, from) {\r\n from = from || {};\r\n for (var p in from) {\r\n to[p] = from[p];\r\n }\r\n return to;\r\n };\r\n\r\n /**\r\n * Naive copy of a list of key names, from one object to another.\r\n * Only copies property if it is actually defined\r\n * Does not recurse into non-scalar properties\r\n *\r\n * @param {Object} to Destination object\r\n * @param {Object} from Source object\r\n * @param {Array} list List of properties to copy\r\n * @return {Object} Destination object\r\n * @static\r\n * @private\r\n */\r\n exports.shallowCopyFromList = function (to, from, list) {\r\n for (var i = 0; i < list.length; i++) {\r\n var p = list[i];\r\n if (typeof from[p] != 'undefined') {\r\n to[p] = from[p];\r\n }\r\n }\r\n return to;\r\n };\r\n\r\n /**\r\n * Simple in-process cache implementation. Does not implement limits of any\r\n * sort.\r\n *\r\n * @implements Cache\r\n * @static\r\n * @private\r\n */\r\n exports.cache = {\r\n _data: {},\r\n set: function (key, val) {\r\n this._data[key] = val;\r\n },\r\n get: function (key) {\r\n return this._data[key];\r\n },\r\n remove: function (key) {\r\n delete this._data[key];\r\n },\r\n reset: function () {\r\n this._data = {};\r\n },\r\n };\r\n },\r\n {},\r\n ],\r\n 3: [function (require, module, exports) {}, {}],\r\n 4: [\r\n function (require, module, exports) {\r\n (function (process) {\r\n // Copyright Joyent, Inc. and other Node contributors.\r\n //\r\n // Permission is hereby granted, free of charge, to any person obtaining a\r\n // copy of this software and associated documentation files (the\r\n // \"Software\"), to deal in the Software without restriction, including\r\n // without limitation the rights to use, copy, modify, merge, publish,\r\n // distribute, sublicense, and/or sell copies of the Software, and to permit\r\n // persons to whom the Software is furnished to do so, subject to the\r\n // following conditions:\r\n //\r\n // The above copyright notice and this permission notice shall be included\r\n // in all copies or substantial portions of the Software.\r\n //\r\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n // resolves . and .. elements in a path array with directory names there\r\n // must be no slashes, empty elements, or device names (c:\\) in the array\r\n // (so also no leading and trailing slashes - it does not distinguish\r\n // relative and absolute paths)\r\n function normalizeArray(parts, allowAboveRoot) {\r\n // if the path tries to go above the root, `up` ends up > 0\r\n var up = 0;\r\n for (var i = parts.length - 1; i >= 0; i--) {\r\n var last = parts[i];\r\n if (last === '.') {\r\n parts.splice(i, 1);\r\n } else if (last === '..') {\r\n parts.splice(i, 1);\r\n up++;\r\n } else if (up) {\r\n parts.splice(i, 1);\r\n up--;\r\n }\r\n }\r\n\r\n // if the path is allowed to go above the root, restore leading ..s\r\n if (allowAboveRoot) {\r\n for (; up--; up) {\r\n parts.unshift('..');\r\n }\r\n }\r\n\r\n return parts;\r\n }\r\n\r\n // Split a filename into [root, dir, basename, ext], unix version\r\n // 'root' is just a slash, or nothing.\r\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\r\n var splitPath = function (filename) {\r\n return splitPathRe.exec(filename).slice(1);\r\n };\r\n\r\n // path.resolve([from ...], to)\r\n // posix version\r\n exports.resolve = function () {\r\n var resolvedPath = '',\r\n resolvedAbsolute = false;\r\n\r\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\r\n var path = i >= 0 ? arguments[i] : process.cwd();\r\n\r\n // Skip empty and invalid entries\r\n if (typeof path !== 'string') {\r\n throw new TypeError('Arguments to path.resolve must be strings');\r\n } else if (!path) {\r\n continue;\r\n }\r\n\r\n resolvedPath = path + '/' + resolvedPath;\r\n resolvedAbsolute = path.charAt(0) === '/';\r\n }\r\n\r\n // At this point the path should be resolved to a full absolute path, but\r\n // handle relative paths to be safe (might happen when process.cwd() fails)\r\n\r\n // Normalize the path\r\n resolvedPath = normalizeArray(\r\n filter(resolvedPath.split('/'), function (p) {\r\n return !!p;\r\n }),\r\n !resolvedAbsolute,\r\n ).join('/');\r\n\r\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\r\n };\r\n\r\n // path.normalize(path)\r\n // posix version\r\n exports.normalize = function (path) {\r\n var isAbsolute = exports.isAbsolute(path),\r\n trailingSlash = substr(path, -1) === '/';\r\n\r\n // Normalize the path\r\n path = normalizeArray(\r\n filter(path.split('/'), function (p) {\r\n return !!p;\r\n }),\r\n !isAbsolute,\r\n ).join('/');\r\n\r\n if (!path && !isAbsolute) {\r\n path = '.';\r\n }\r\n if (path && trailingSlash) {\r\n path += '/';\r\n }\r\n\r\n return (isAbsolute ? '/' : '') + path;\r\n };\r\n\r\n // posix version\r\n exports.isAbsolute = function (path) {\r\n return path.charAt(0) === '/';\r\n };\r\n\r\n // posix version\r\n exports.join = function () {\r\n var paths = Array.prototype.slice.call(arguments, 0);\r\n return exports.normalize(\r\n filter(paths, function (p, index) {\r\n if (typeof p !== 'string') {\r\n throw new TypeError('Arguments to path.join must be strings');\r\n }\r\n return p;\r\n }).join('/'),\r\n );\r\n };\r\n\r\n // path.relative(from, to)\r\n // posix version\r\n exports.relative = function (from, to) {\r\n from = exports.resolve(from).substr(1);\r\n to = exports.resolve(to).substr(1);\r\n\r\n function trim(arr) {\r\n var start = 0;\r\n for (; start < arr.length; start++) {\r\n if (arr[start] !== '') break;\r\n }\r\n\r\n var end = arr.length - 1;\r\n for (; end >= 0; end--) {\r\n if (arr[end] !== '') break;\r\n }\r\n\r\n if (start > end) return [];\r\n return arr.slice(start, end - start + 1);\r\n }\r\n\r\n var fromParts = trim(from.split('/'));\r\n var toParts = trim(to.split('/'));\r\n\r\n var length = Math.min(fromParts.length, toParts.length);\r\n var samePartsLength = length;\r\n for (var i = 0; i < length; i++) {\r\n if (fromParts[i] !== toParts[i]) {\r\n samePartsLength = i;\r\n break;\r\n }\r\n }\r\n\r\n var outputParts = [];\r\n for (var i = samePartsLength; i < fromParts.length; i++) {\r\n outputParts.push('..');\r\n }\r\n\r\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\r\n\r\n return outputParts.join('/');\r\n };\r\n\r\n exports.sep = '/';\r\n exports.delimiter = ':';\r\n\r\n exports.dirname = function (path) {\r\n var result = splitPath(path),\r\n root = result[0],\r\n dir = result[1];\r\n\r\n if (!root && !dir) {\r\n // No dirname whatsoever\r\n return '.';\r\n }\r\n\r\n if (dir) {\r\n // It has a dirname, strip trailing slash\r\n dir = dir.substr(0, dir.length - 1);\r\n }\r\n\r\n return root + dir;\r\n };\r\n\r\n exports.basename = function (path, ext) {\r\n var f = splitPath(path)[2];\r\n // TODO: make this comparison case-insensitive on windows?\r\n if (ext && f.substr(-1 * ext.length) === ext) {\r\n f = f.substr(0, f.length - ext.length);\r\n }\r\n return f;\r\n };\r\n\r\n exports.extname = function (path) {\r\n return splitPath(path)[3];\r\n };\r\n\r\n function filter(xs, f) {\r\n if (xs.filter) return xs.filter(f);\r\n var res = [];\r\n for (var i = 0; i < xs.length; i++) {\r\n if (f(xs[i], i, xs)) res.push(xs[i]);\r\n }\r\n return res;\r\n }\r\n\r\n // String.prototype.substr - negative index don't work in IE8\r\n var substr =\r\n 'ab'.substr(-1) === 'b'\r\n ? function (str, start, len) {\r\n return str.substr(start, len);\r\n }\r\n : function (str, start, len) {\r\n if (start < 0) start = str.length + start;\r\n return str.substr(start, len);\r\n };\r\n }).call(this, require('_process'));\r\n },\r\n { _process: 5 },\r\n ],\r\n 5: [\r\n function (require, module, exports) {\r\n // shim for using process in browser\r\n var process = (module.exports = {});\r\n\r\n // cached from whatever global is present so that test runners that stub it\r\n // don't break things. But we need to wrap it in a try catch in case it is\r\n // wrapped in strict mode code which doesn't define any globals. It's inside a\r\n // function because try/catches deoptimize in certain engines.\r\n\r\n var cachedSetTimeout;\r\n var cachedClearTimeout;\r\n\r\n function defaultSetTimout() {\r\n throw new Error('setTimeout has not been defined');\r\n }\r\n function defaultClearTimeout() {\r\n throw new Error('clearTimeout has not been defined');\r\n }\r\n (function () {\r\n try {\r\n if (typeof setTimeout === 'function') {\r\n cachedSetTimeout = setTimeout;\r\n } else {\r\n cachedSetTimeout = defaultSetTimout;\r\n }\r\n } catch (e) {\r\n cachedSetTimeout = defaultSetTimout;\r\n }\r\n try {\r\n if (typeof clearTimeout === 'function') {\r\n cachedClearTimeout = clearTimeout;\r\n } else {\r\n cachedClearTimeout = defaultClearTimeout;\r\n }\r\n } catch (e) {\r\n cachedClearTimeout = defaultClearTimeout;\r\n }\r\n })();\r\n function runTimeout(fun) {\r\n if (cachedSetTimeout === setTimeout) {\r\n //normal enviroments in sane situations\r\n return setTimeout(fun, 0);\r\n }\r\n // if setTimeout wasn't available but was latter defined\r\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\r\n cachedSetTimeout = setTimeout;\r\n return setTimeout(fun, 0);\r\n }\r\n try {\r\n // when when somebody has screwed with setTimeout but no I.E. maddness\r\n return cachedSetTimeout(fun, 0);\r\n } catch (e) {\r\n try {\r\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\r\n return cachedSetTimeout.call(null, fun, 0);\r\n } catch (e) {\r\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\r\n return cachedSetTimeout.call(this, fun, 0);\r\n }\r\n }\r\n }\r\n function runClearTimeout(marker) {\r\n if (cachedClearTimeout === clearTimeout) {\r\n //normal enviroments in sane situations\r\n return clearTimeout(marker);\r\n }\r\n // if clearTimeout wasn't available but was latter defined\r\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\r\n cachedClearTimeout = clearTimeout;\r\n return clearTimeout(marker);\r\n }\r\n try {\r\n // when when somebody has screwed with setTimeout but no I.E. maddness\r\n return cachedClearTimeout(marker);\r\n } catch (e) {\r\n try {\r\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\r\n return cachedClearTimeout.call(null, marker);\r\n } catch (e) {\r\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\r\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\r\n return cachedClearTimeout.call(this, marker);\r\n }\r\n }\r\n }\r\n var queue = [];\r\n var draining = false;\r\n var currentQueue;\r\n var queueIndex = -1;\r\n\r\n function cleanUpNextTick() {\r\n if (!draining || !currentQueue) {\r\n return;\r\n }\r\n draining = false;\r\n if (currentQueue.length) {\r\n queue = currentQueue.concat(queue);\r\n } else {\r\n queueIndex = -1;\r\n }\r\n if (queue.length) {\r\n drainQueue();\r\n }\r\n }\r\n\r\n function drainQueue() {\r\n if (draining) {\r\n return;\r\n }\r\n var timeout = runTimeout(cleanUpNextTick);\r\n draining = true;\r\n\r\n var len = queue.length;\r\n while (len) {\r\n currentQueue = queue;\r\n queue = [];\r\n while (++queueIndex < len) {\r\n if (currentQueue) {\r\n currentQueue[queueIndex].run();\r\n }\r\n }\r\n queueIndex = -1;\r\n len = queue.length;\r\n }\r\n currentQueue = null;\r\n draining = false;\r\n runClearTimeout(timeout);\r\n }\r\n\r\n process.nextTick = function (fun) {\r\n var args = new Array(arguments.length - 1);\r\n if (arguments.length > 1) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n }\r\n queue.push(new Item(fun, args));\r\n if (queue.length === 1 && !draining) {\r\n runTimeout(drainQueue);\r\n }\r\n };\r\n\r\n // v8 likes predictible objects\r\n function Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n }\r\n Item.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n };\r\n process.title = 'browser';\r\n process.browser = true;\r\n process.env = {};\r\n process.argv = [];\r\n process.version = ''; // empty string to avoid regexp issues\r\n process.versions = {};\r\n\r\n function noop() {}\r\n\r\n process.on = noop;\r\n process.addListener = noop;\r\n process.once = noop;\r\n process.off = noop;\r\n process.removeListener = noop;\r\n process.removeAllListeners = noop;\r\n process.emit = noop;\r\n process.prependListener = noop;\r\n process.prependOnceListener = noop;\r\n\r\n process.listeners = function (name) {\r\n return [];\r\n };\r\n\r\n process.binding = function (name) {\r\n throw new Error('process.binding is not supported');\r\n };\r\n\r\n process.cwd = function () {\r\n return '/';\r\n };\r\n process.chdir = function (dir) {\r\n throw new Error('process.chdir is not supported');\r\n };\r\n process.umask = function () {\r\n return 0;\r\n };\r\n },\r\n {},\r\n ],\r\n 6: [\r\n function (require, module, exports) {\r\n module.exports = {\r\n name: 'ejs',\r\n description: 'Embedded JavaScript templates',\r\n keywords: ['template', 'engine', 'ejs'],\r\n version: '3.0.1',\r\n author: 'Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)',\r\n license: 'Apache-2.0',\r\n main: './lib/ejs.js',\r\n repository: {\r\n type: 'git',\r\n url: 'git://github.com/mde/ejs.git',\r\n },\r\n bugs: 'https://github.com/mde/ejs/issues',\r\n homepage: 'https://github.com/mde/ejs',\r\n dependencies: {},\r\n devDependencies: {\r\n browserify: '^13.1.1',\r\n eslint: '^4.14.0',\r\n 'git-directory-deploy': '^1.5.1',\r\n jake: '^10.3.1',\r\n jsdoc: '^3.4.0',\r\n 'lru-cache': '^4.0.1',\r\n mocha: '^5.0.5',\r\n 'uglify-js': '^3.3.16',\r\n },\r\n engines: {\r\n node: '>=0.10.0',\r\n },\r\n scripts: {\r\n test: 'mocha',\r\n postinstall: 'node ./postinstall.js',\r\n },\r\n };\r\n },\r\n {},\r\n ],\r\n },\r\n {},\r\n [1],\r\n )(1);\r\n});\r\n", "import './jsontemplate.js';\nimport './ejs.js';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAEE;AAFF;AAAA;AAEE,gBAAW;AAAA;AAAA;;;ACFb;AAAA;AAAA;AAUA;AAEA,YAAM,4CAA4C,EAAE,KAAK,CAAM,QAAO;AAClE,cAAM,OAAO,MAAM,IAAI,KAAK;AAE5B,UAAE,OAAO,MAAM,kBAAkB,IAAI;AAAA,MACzC,EAAC;AAED,UAAM,oBAAoB,oBAAI,IAAI,CAAC,YAAY,YAAY,QAAQ,MAAM,SAAS,UAAU,MAAM,CAAC;AACnG,UAAM,iBAAiB,oBAAI,IAAI;AAAA,QAC3B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ,CAAC;AAED,eAAS,4BAA4B,OAAO;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BACA,MAAM;AAAA,kBACN,UAAU;AAAA,kBACV,cAAc,CAAC;AAAA,kBACf,iBAAiB;AAAA,oBACb,YAAY;AAAA,oBACZ,QAAQ;AAAA,oBACR,wBAAwB;AAAA,oBACxB,MAAM;AAAA,oBACN,OAAO;AAAA,oBACP,aAAa;AAAA,oBACb,OAAO;AAAA,oBACP,aAAa;AAAA,kBACjB;AAAA,kBACA,SAAS;AAAA,oBACL,MAAM;AAAA,kBACV;AAAA,kBACA,SAAS;AAAA,oBACL,MAAM;AAAA,oBACN,aAAa;AAAA,kBACjB;AAAA,gBACJ;AAAA,cACJ;AAAA,cACA,CAAC;AAAA,YACL;AAAA,UACJ;AAAA,UACA,CAAC;AAAA,UACD,CAAC,CAAC;AAAA,QACN,EAAE,CAAC;AAAA,MACP,CAAC;AAAA;AAAA;;;ACplDD,4BAAO;AACP,mBAAO;",
4
+ "sourcesContent": ["{\n \"name\": \"iobroker.vis-jsontemplate\",\n \"version\": \"4.6.3\",\n \"description\": \"vis-jsontemplate\",\n \"author\": {\n \"name\": \"oweitman\",\n \"email\": \"oweitman@gmx.de\"\n },\n \"homepage\": \"https://github.com/oweitman/ioBroker.vis-jsontemplate\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/oweitman/ioBroker.vis-jsontemplate.git\"\n },\n \"keywords\": [\n \"ioBroker\",\n \"visualization\",\n \"widgets\",\n \"JSON template\",\n \"Smart Home\"\n ],\n \"devDependencies\": {\n \"@alcalzone/release-script\": \"^5.2.1\",\n \"@alcalzone/release-script-plugin-iobroker\": \"^5.2.0\",\n \"@alcalzone/release-script-plugin-license\": \"^5.2.2\",\n \"@alcalzone/release-script-plugin-manual-review\": \"^5.2.0\",\n \"@iobroker/adapter-dev\": \"^1.5.0\",\n \"@iobroker/build-tools\": \"^3.0.3\",\n \"@iobroker/eslint-config\": \"^2.2.0\",\n \"@iobroker/testing\": \"^6.3.1\",\n \"@iobroker/vis-2-widgets-react-dev\": \"^4.0.4\",\n \"@iobroker/vis-2-widgets-testing\": \"^1.0.6\",\n \"@types/node\": \"^25.9.9\"\n },\n \"main\": \"widgets/vis2jsontemplate/customWidgets.js\",\n \"files\": [\n \"admin/\",\n \"widgets/\",\n \"io-package.json\",\n \"LICENSE\"\n ],\n \"scripts\": {\n \"test:package\": \"mocha test/package --exit\",\n \"test:widgets\": \"mocha ./test/*.test.js\",\n \"test:integration\": \"mocha test/widgets.test.js --exit\",\n \"testbakcip\": \"npm run test:package && npm run test:widgets\",\n \"test\": \"npm run test:package \",\n \"prepublishOnly\": \"npm run build-vis1widgets && npm run build-vis2widgets\",\n \"lint\": \"npm run lint-adapter && npm run lint-vis1widgets && npm run lint-vis2widgets\",\n \"lint-adapter\": \"eslint -c eslint.config.mjs .\",\n \"lint-vis1widgets\": \"cd widgets/ && npm run lint && cd ../..\",\n \"lint-vis2widgets\": \"cd src-widgets/ && npm run lint && cd ../..\",\n \"build\": \"npm run build-vis1widgets && npm run build-vis2widgets\",\n \"build-vis2widgets\": \"node tasks --javascript-vite\",\n \"build-vis1widgets\": \"cd widgets/vis-jsontemplate && npm run build && cd ../..\",\n \"dev:upload\": \"dev-server upload\",\n \"dev:run\": \"dev-server run\",\n \"dev:watch\": \"dev-server watch --noStart\",\n \"dev:watchvis2widgets\": \"npm run start --prefix src-widgets\",\n \"dev:watchvis1widgets\": \"npm run watch --prefix widgets\",\n \"release\": \"release-script --all\",\n \"update-packages\": \"ncu --upgrade && cd src-widgets && ncu --upgrade && cd ..\",\n \"npm\": \"npm run npm:main && npm run npm:vis1widgets && npm run npm:vis2widgets\",\n \"npm:main\": \"npm i -f\",\n \"npm:vis2widgets\": \"cd src-widgets && npm i -f && cd ..\",\n \"npm:vis1widgets\": \"cd widgets && npm i && cd ..\",\n \"repochecker\": \"npx github:oweitman/ioBroker.repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate --noinfo --local --env=../iobroker.env\",\n \"translate\": \"translate-adapter\",\n \"translate-widgets-vis2\": \"node ./bin/translate.js --source src-widgets/src/i18n/\",\n \"translate-widgets-vis1\": \"node ./bin/translate.js --source widgets/vis-jsontemplate/myi18n/en.json --format single\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/oweitman/ioBroker.vis-jsontemplate/issues\"\n },\n \"readmeFilename\": \"README.md\"\n}\n", "/*\n ioBroker.vis jsontemplate Widget-Set\n\n Copyright 2020-2025 oweitman oweitman@gmx.de\n*/\n'use strict';\n/* jshint -W069 */\n/* globals $,window,document,systemDictionary,vis,ejs,ace,_ */\n\n// add translations for edit mode\nimport { version as pkgVersion } from '../../../package.json';\n\nfetch('widgets/vis-jsontemplate/myi18n/words.json').then(async res => {\n const i18n = await res.json();\n\n $.extend(true, systemDictionary, i18n);\n});\n\nconst EJS_CONTEXT_NAMES = new Set(['widgetid', 'widgetID', 'data', 'dp', 'style', 'widget', 'I18n']);\nconst RESERVED_WORDS = new Set([\n 'await',\n 'break',\n 'case',\n 'catch',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'else',\n 'enum',\n 'export',\n 'extends',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'interface',\n 'let',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'static',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'while',\n 'with',\n 'yield',\n]);\n\nfunction isValidJavaScriptIdentifier(value) {\n if (typeof value !== 'string' || !value) {\n return false;\n }\n\n // ZWNJ and ZWJ are explicitly permitted after the first character by ECMAScript.\n // eslint-disable-next-line no-misleading-character-class\n return /^[$_\\p{ID_Start}][$\\u200C\\u200D_\\p{ID_Continue}]*$/u.test(value) && !RESERVED_WORDS.has(value);\n}\n\nfunction getDatapointVariableName(data, index) {\n const value = data?.[`json_dp_variable${index}`] ?? data?.[`json_dp_variable-${index}`] ?? '';\n return typeof value === 'string' ? value.trim() : '';\n}\n\nfunction buildDatapointVariables(data, dpCount) {\n const variables = {};\n const usedNames = new Set();\n\n for (let i = 1; i <= dpCount; i++) {\n const name = getDatapointVariableName(data, i);\n if (!name) {\n continue;\n }\n if (!isValidJavaScriptIdentifier(name)) {\n throw new Error(`Invalid JavaScript variable name: ${name}`);\n }\n\n const valueName = `${name}_value`;\n if (EJS_CONTEXT_NAMES.has(name) || EJS_CONTEXT_NAMES.has(valueName)) {\n throw new Error(`Variable name is already used by the template context: ${name}`);\n }\n if (usedNames.has(name) || usedNames.has(valueName)) {\n throw new Error(`Variable name is used more than once: ${name}`);\n }\n usedNames.add(name);\n usedNames.add(valueName);\n\n const oid = data[`json_dp${i}`];\n if (oid) {\n Object.defineProperty(variables, name, {\n value: oid,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n Object.defineProperty(variables, valueName, {\n value: vis.states.attr(`${oid}.val`),\n enumerable: true,\n configurable: true,\n writable: true,\n });\n }\n }\n\n return variables;\n}\n\n// this code can be placed directly in jsontemplate.html\nvis.binds['jsontemplate'] = {\n version: pkgVersion,\n _assetCache: (vis.binds['jsontemplate'] && vis.binds['jsontemplate']._assetCache) || new Map(),\n _widgetInit: (vis.binds['jsontemplate'] && vis.binds['jsontemplate']._widgetInit) || new Map(),\n\n /**\n * Log the version of jsontemplate and remove it.\n * Should be called from the main thread, as it logs to the console.\n */\n showVersion: function () {\n if (vis.binds['jsontemplate'].version) {\n console.log(`Version jsontemplate: ${vis.binds['jsontemplate'].version}`);\n vis.binds['jsontemplate'].version = null;\n }\n },\n jsontemplate4: {\n /**\n * Initializes and creates a JSON template widget.\n *\n * @param widgetID - The ID of the widget element.\n * @param view - The view object containing widget information.\n * @param data - Contains configuration data for the widget, including JSON object ID and template.\n * @param style - Style settings for the widget. *\n * The function checks for the widget element by its ID. If not found, it retries after a delay.\n * It parses the JSON data from the specified object ID, processes additional data points,\n * and binds states if necessary. It then renders the widget using the EJS template with\n * the provided data and style.\n \n Testtemplate:\n \n <%\n \n debugger;\n req = await sendToAsync(\"admin.0\",\"selectSendTo\");\n console.log(JSON.stringify(req));\n %>\n <%- JSON.stringify(req) %>\n <%\n async function sendToAsync(instance, command, sendData) {\n return new Promise((resolve, reject) => {\n try {\n vis.conn.sendTo(instance, command, sendData, function (receiveData) {\n resolve(receiveData);\n });\n } catch (error) {\n reject(error);\n }\n });\n }\n %>\n */\n createWidget: async function (widgetID, view, data, style) {\n const $div = $(`#${widgetID}`);\n // if nothing found => wait\n if (!$div.length) {\n return setTimeout(function () {\n vis.binds['jsontemplate'].jsontemplate4.createWidget(widgetID, view, data, style);\n }, 100);\n }\n const bound = [];\n // const oiddata = data.json_oid ? JSON.parse(vis.states.attr(`${data.json_oid}.val`)) : {};\n // const template = data.json_template ? data.json_template : '';\n if (data.json_oid) {\n bound.push(data.json_oid);\n }\n\n const dpCount = data.json_dpCount ? data.json_dpCount : 1;\n const datapoints = [];\n\n for (let i = 1; i <= dpCount; i++) {\n if (data[`json_dp${i}`]) {\n datapoints[data[`json_dp${i}`]] = vis.states.attr(`${data[`json_dp${i}`]}.val`);\n bound.push(data[`json_dp${i}`]);\n }\n }\n\n const scriptCount = data.json_scriptCount ? data.json_scriptCount : 1;\n const scripts = [];\n for (let i = 1; i <= scriptCount; i++) {\n if (data[`json_script${i}`]) {\n scripts.push(data[`json_script${i}`]);\n }\n }\n const cssCount = data.json_cssCount ? data.json_cssCount : 1;\n const css = [];\n for (let i = 1; i <= cssCount; i++) {\n if (data[`json_css${i}`]) {\n css.push(data[`json_css${i}`]);\n }\n }\n\n if (bound) {\n if (!vis.editMode) {\n await vis.binds['jsontemplate'].bindStatesAsync(\n $div,\n bound,\n vis.binds['jsontemplate'].jsontemplate4.onChange.bind({\n widgetID: widgetID,\n view: view,\n data: data,\n style: style,\n }),\n );\n }\n }\n // Assets einmalig laden (nicht in render, da render bei jedem DP-Change l\u00E4uft)\n try {\n await vis.binds['jsontemplate'].initWidgetAssetsOnce(widgetID, scripts, css);\n } catch (e) {\n // Fehler sichtbar machen und abbrechen\n let msg = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n msg = msg.replace(/ /gm, '&nbsp;');\n $div.html(`<code style=\"color:red;\">${msg}</code>`);\n return;\n }\n\n await this.render(widgetID, view, data, style);\n },\n\n /**\n * Will be called if the value of the bound data point changes.\n *\n * @param e event object\n * @param newVal new value of the bound data point\n */\n onChange: function (e, newVal) {\n if (newVal) {\n vis.binds['jsontemplate'].jsontemplate4.render(this.widgetID, this.view, this.data, this.style);\n }\n },\n\n /**\n * Renders the widget using the provided EJS template.\n *\n * @param widgetID - The ID of the widget element to be rendered.\n * @param view - The view object containing widget information.\n * @param data - Contains configuration data for the widget, including JSON object ID and template.\n *\n * The function retrieves data associated with the JSON object ID and additional data points.\n * It then uses EJS to render the template with the provided data and updates the widget's HTML content.\n * In case of an error during rendering, it escapes and formats the error message to display it in the widget.\n */\n render: async function (widgetID, view, data, style) {\n const oiddata = data.json_oid ? JSON.parse(vis.states.attr(`${data.json_oid}.val`)) : {};\n const dpCount = data.json_dpCount ? data.json_dpCount : 1;\n const template = data.json_template ? data.json_template : '';\n const datapoints = [];\n\n for (let i = 1; i <= dpCount; i++) {\n if (data[`json_dp${i}`]) {\n datapoints[data[`json_dp${i}`]] = vis.states.attr(`${data[`json_dp${i}`]}.val`);\n }\n }\n let text = '';\n try {\n const datapointVariables = buildDatapointVariables(data, dpCount);\n text = await ejs.render(\n template,\n {\n ...datapointVariables,\n widgetID: widgetID,\n widgetid: widgetID,\n data: oiddata,\n dp: datapoints,\n widget: data,\n style: style,\n },\n { async: true },\n );\n } catch (e) {\n text = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n console.error(e.message);\n text = text.replace(/ /gm, '&nbsp;');\n text = `<code style=\"color:red;\">${text}</code>`;\n }\n $(`#${widgetID}`).html(text);\n },\n },\n /**\n * Bind states to an element.\n *\n * First unbind all previously bound states and then get the current values of the states.\n * Then subscribe to the states and bind the callback to the states.\n * Finally, update the states of the element.\n *\n * @param elem - the element to bind the states to\n * @param bound - the states to bind\n * @param change_callback - the callback to call if one of the states changes\n */\n bindStates: function (elem, bound, change_callback) {\n const $div = $(elem);\n const boundstates = $div.data('bound');\n if (boundstates) {\n for (let i = 0; i < boundstates.length; i++) {\n vis.states.unbind(boundstates[i], change_callback);\n }\n }\n $div.data('bound', null);\n $div.data('bindHandler', null);\n\n vis.conn.gettingStates = 0;\n vis.conn.getStates(\n bound,\n function (error, states) {\n vis.conn.subscribe(bound);\n $div.data('bound', bound);\n $div.data('bindHandler', change_callback);\n for (let i = 0; i < bound.length; i++) {\n bound[i] = `${bound[i]}.val`;\n vis.states.bind(bound[i], change_callback);\n }\n vis.updateStates(states);\n }.bind({ change_callback }),\n );\n },\n bindStatesAsync: async function (elem, bound, change_callback) {\n return new Promise((resolve, reject) => {\n try {\n const $div = $(elem);\n const boundstates = $div.data('bound');\n if (boundstates) {\n for (let i = 0; i < boundstates.length; i++) {\n vis.states.unbind(boundstates[i], change_callback);\n }\n }\n $div.data('bound', null);\n $div.data('bindHandler', null);\n\n vis.conn.gettingStates = 0;\n vis.conn.getStates(\n bound,\n function (error, states) {\n vis.conn.subscribe(bound);\n $div.data('bound', bound);\n $div.data('bindHandler', change_callback);\n for (let i = 0; i < bound.length; i++) {\n bound[i] = `${bound[i]}.val`;\n vis.states.bind(bound[i], change_callback);\n }\n vis.updateStates(states);\n resolve();\n }.bind({ change_callback }),\n );\n } catch (error) {\n reject(error);\n }\n });\n },\n /**\n * Escapes HTML special characters in a given string.\n *\n * @param html - The string to escape.\n * @returns The escaped string.\n */\n escapeHTML: function (html) {\n let escapeEl = document.createElement('textarea');\n escapeEl.textContent = html;\n const ret = escapeEl.innerHTML;\n escapeEl = null;\n return ret;\n },\n /**\n * Shows a dialog for editing a template.\n *\n * @param widAttr - The attribute of the widget to edit.\n * @returns A object with two properties: 'input' and 'button'. 'input' is a string containing the HTML of a\n * 'textarea' element with id 'inspect_<widAttr>'. 'button' is an object with properties 'icon', 'text', 'title',\n * 'click'. 'click' is a function which is called when the button is clicked. The function shows a dialog with\n * the 'textarea' element. The dialog has a 'save' and a 'cancel' button. The 'save' button saves the changes to\n * the attribute and closes the dialog. The 'cancel' button just closes the dialog.\n */\n editEjs: function (widAttr) {\n const that = vis;\n const line = {\n input: `<textarea id=\"inspect_${widAttr}\"></textarea>`,\n };\n\n line.button = {\n icon: 'ui-icon-note',\n text: false,\n title: _('Select color'),\n click: function (/*event*/) {\n const wdata = $(this).data('wdata');\n let data = {};\n if (that.config['dialog-edit-text']) {\n data = JSON.parse(that.config['dialog-edit-text']);\n }\n ace.config.setModuleUrl('ace/mode/ejs', 'widgets/jsontemplate/js/mode-ejs.js');\n const editor = ace.edit('dialog-edit-text-textarea');\n let changed = false;\n $('#dialog-edit-text')\n .dialog({\n autoOpen: true,\n width: data.width || 800,\n height: data.height || 600,\n modal: true,\n resize: function () {\n editor.resize();\n },\n open: function (event) {\n $(event.target).parent().find('.ui-dialog-titlebar-close .ui-button-text').html('');\n $(this).parent().css({ 'z-index': 1000 });\n if (data.top !== undefined) {\n if (data.top >= 0) {\n $(this).parent().css({ top: data.top });\n } else {\n $(this).parent().css({ top: 0 });\n }\n }\n if (data.left !== undefined) {\n if (data.left >= 0) {\n $(this).parent().css({ left: data.left });\n } else {\n $(this).parent().css({ left: 0 });\n }\n }\n editor.getSession().setMode('ace/mode/ejs');\n editor.setOptions({\n enableBasicAutocompletion: true,\n enableLiveAutocompletion: true,\n });\n editor.$blockScrolling = Infinity;\n editor.getSession().setUseWrapMode(true);\n editor.setValue($(`#inspect_${wdata.attr}`).val());\n editor.navigateFileEnd();\n editor.focus();\n editor.getSession().on('change', function () {\n changed = true;\n });\n },\n beforeClose: function () {\n const $parent = $('#dialog-edit-text').parent();\n const pos = $parent.position();\n that.editSaveConfig(\n 'dialog-edit-text',\n JSON.stringify({\n top: pos.top > 0 ? pos.top : 0,\n left: pos.left > 0 ? pos.left : 0,\n width: $parent.width(),\n height: $parent.height() + 9,\n }),\n );\n\n if (changed) {\n if (!window.confirm(_('Changes are not saved!. Continue?'))) {\n return false;\n }\n }\n },\n buttons: [\n {\n text: _('Ok'),\n click: function () {\n $(`#inspect_${wdata.attr}`).val(editor.getValue()).trigger('change');\n changed = false;\n $(this).dialog('close');\n },\n },\n {\n text: _('Cancel'),\n click: function () {\n $(this).dialog('close');\n },\n },\n ],\n })\n .show();\n },\n };\n return line;\n },\n loadAsset: function (url, kind /* 'js' | 'css' */) {\n const u = (url || '').trim();\n if (!u) {\n return Promise.resolve();\n }\n\n const cache = vis.binds['jsontemplate']._assetCache;\n if (cache.has(u)) {\n return cache.get(u);\n }\n\n const p = new Promise((resolve, reject) => {\n try {\n const isCss = kind === 'css' || u.toLowerCase().endsWith('.css');\n const isJs = kind === 'js' || u.toLowerCase().endsWith('.js') || !isCss;\n\n if (isCss) {\n // Verhindern, dass die gleiche CSS-Datei mehrfach in <head> landet\n // (zus\u00E4tzlich zum Promise-Cache; hilfreich bei Reload/Hot)\n const existing = document.querySelector(`link[rel=\"stylesheet\"][href=\"${CSS.escape(u)}\"]`);\n if (existing) {\n return resolve();\n }\n\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = u;\n link.onload = () => resolve();\n link.onerror = () => reject(new Error(`CSS konnte nicht geladen werden: ${u}`));\n document.head.appendChild(link);\n return;\n }\n\n if (isJs) {\n // Verhindern, dass das gleiche Script mehrfach eingebunden wird\n const existing = document.querySelector(`script[src=\"${CSS.escape(u)}\"]`);\n if (existing) {\n return resolve();\n }\n\n const s = document.createElement('script');\n s.src = u;\n\n // wichtig f\u00FCr Abh\u00E4ngigkeiten: Reihenfolge muss stimmen\n s.async = false;\n s.defer = false;\n\n s.onload = () => resolve();\n s.onerror = () => reject(new Error(`Script konnte nicht geladen werden: ${u}`));\n document.head.appendChild(s);\n return;\n }\n\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n\n cache.set(u, p);\n return p;\n },\n loadAssetsInOrder: async function (assets) {\n if (!assets || !assets.length) {\n return;\n }\n for (const a of assets) {\n if (!a) {\n continue;\n }\n if (typeof a === 'string') {\n // String => auto-detect per Endung\n await vis.binds['jsontemplate'].loadAsset(a);\n } else {\n // Objektform: { url, kind }\n await vis.binds['jsontemplate'].loadAsset(a.url, a.kind);\n }\n }\n },\n /**\n * L\u00E4dt CSS und Scripts (einmalig) in definierter Reihenfolge:\n * 1) CSS (Reihenfolge beibehalten, relevant f\u00FCr Overrides)\n * 2) JS (sequentiell, relevant f\u00FCr Abh\u00E4ngigkeiten)\n */\n loadScriptsAndCssOnce: async function (scripts, css) {\n // CSS zuerst\n if (Array.isArray(css) && css.length) {\n const cssAssets = css\n .map(u => (u || '').trim())\n .filter(Boolean)\n .map(u => ({ url: u, kind: 'css' }));\n await vis.binds['jsontemplate'].loadAssetsInOrder(cssAssets);\n }\n\n // danach Scripts\n if (Array.isArray(scripts) && scripts.length) {\n const scriptAssets = scripts\n .map(u => (u || '').trim())\n .filter(Boolean)\n .map(u => ({ url: u, kind: 'js' }));\n await vis.binds['jsontemplate'].loadAssetsInOrder(scriptAssets);\n }\n },\n\n /**\n * Einmalige Initialisierung pro WidgetID + Asset-Set.\n * Dadurch wird bei render()-Aufrufen (State changes) nicht erneut geladen.\n * Wenn sich Assets in den Properties \u00E4ndern, erzeugt der Key ein neues Init-Promise.\n */\n initWidgetAssetsOnce: function (widgetID, scripts, css) {\n const initMap = vis.binds['jsontemplate']._widgetInit;\n\n // Key enth\u00E4lt auch die Assets, damit \u00C4nderungen (im Editor) neu laden k\u00F6nnen\n const key =\n `${widgetID}::` +\n `css=${(css || [])\n .map(s => String(s).trim())\n .filter(Boolean)\n .join('|')}::` +\n `js=${(scripts || [])\n .map(s => String(s).trim())\n .filter(Boolean)\n .join('|')}`;\n\n if (initMap.has(key)) {\n return initMap.get(key);\n }\n\n const p = (async () => {\n await vis.binds['jsontemplate'].loadScriptsAndCssOnce(scripts, css);\n })();\n\n initMap.set(key, p);\n return p;\n },\n};\n\nvis.binds['jsontemplate'].showVersion();\n\n/* remember for strip tag function\nstr='this string has <i>html</i> code i want to <b>remove</b><br>Link Number 1 -><a href=\"http://www.bbc.co.uk\">BBC</a> Link Number 1<br><p>Now back to normal text and stuff</p>\n';\nstr=str.replace(/<br>/gi, \"\\n\");\nstr=str.replace(/<p.*>/gi, \"\\n\");\nstr=str.replace(/<a.*href=\"(.*?)\".*>(.*?)<\\/a>/gi, \" $2 (Link->$1) \");\nstr=str.replace(/<(?:.|\\s)*?>/g, \"\");\n*/\n", "(function (f) {\r\n if (typeof exports === 'object' && typeof module !== 'undefined') {\r\n module.exports = f();\r\n } else if (typeof define === 'function' && define.amd) {\r\n define([], f);\r\n } else {\r\n var g;\r\n if (typeof window !== 'undefined') {\r\n g = window;\r\n } else if (typeof global !== 'undefined') {\r\n g = global;\r\n } else if (typeof self !== 'undefined') {\r\n g = self;\r\n } else {\r\n g = this;\r\n }\r\n g.ejs = f();\r\n }\r\n})(function () {\r\n var define, module, exports;\r\n return (function () {\r\n function e(t, n, r) {\r\n function s(o, u) {\r\n if (!n[o]) {\r\n if (!t[o]) {\r\n var a = typeof require == 'function' && require;\r\n if (!u && a) return a(o, !0);\r\n if (i) return i(o, !0);\r\n var f = new Error(\"Cannot find module '\" + o + \"'\");\r\n throw ((f.code = 'MODULE_NOT_FOUND'), f);\r\n }\r\n var l = (n[o] = { exports: {} });\r\n t[o][0].call(\r\n l.exports,\r\n function (e) {\r\n var n = t[o][1][e];\r\n return s(n ? n : e);\r\n },\r\n l,\r\n l.exports,\r\n e,\r\n t,\r\n n,\r\n r,\r\n );\r\n }\r\n return n[o].exports;\r\n }\r\n var i = typeof require == 'function' && require;\r\n for (var o = 0; o < r.length; o++) s(r[o]);\r\n return s;\r\n }\r\n return e;\r\n })()(\r\n {\r\n 1: [\r\n function (require, module, exports) {\r\n /*\r\n * EJS Embedded JavaScript templates\r\n * Copyright 2112 Matthew Eernisse (mde@fleegix.org)\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\r\n */\r\n\r\n 'use strict';\r\n\r\n /**\r\n * @file Embedded JavaScript templating engine. {@link http://ejs.co}\r\n * @author Matthew Eernisse <mde@fleegix.org>\r\n * @author Tiancheng \"Timothy\" Gu <timothygu99@gmail.com>\r\n * @project EJS\r\n * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}\r\n */\r\n\r\n /**\r\n * EJS internal functions.\r\n *\r\n * Technically this \"module\" lies in the same file as {@link module:ejs}, for\r\n * the sake of organization all the private functions re grouped into this\r\n * module.\r\n *\r\n * @module ejs-internal\r\n * @private\r\n */\r\n\r\n /**\r\n * Embedded JavaScript templating engine.\r\n *\r\n * @module ejs\r\n * @public\r\n */\r\n\r\n var fs = require('fs');\r\n var path = require('path');\r\n var utils = require('./utils');\r\n\r\n var scopeOptionWarned = false;\r\n var _VERSION_STRING = require('../package.json').version;\r\n var _DEFAULT_OPEN_DELIMITER = '<';\r\n var _DEFAULT_CLOSE_DELIMITER = '>';\r\n var _DEFAULT_DELIMITER = '%';\r\n var _DEFAULT_LOCALS_NAME = 'locals';\r\n var _NAME = 'ejs';\r\n var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)';\r\n var _OPTS_PASSABLE_WITH_DATA = [\r\n 'delimiter',\r\n 'scope',\r\n 'context',\r\n 'debug',\r\n 'compileDebug',\r\n 'client',\r\n '_with',\r\n 'rmWhitespace',\r\n 'strict',\r\n 'filename',\r\n 'async',\r\n ];\r\n // We don't allow 'cache' option to be passed in the data obj for\r\n // the normal `render` call, but this is where Express 2 & 3 put it\r\n // so we make an exception for `renderFile`\r\n var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache');\r\n var _BOM = /^\\uFEFF/;\r\n\r\n /**\r\n * EJS template function cache. This can be a LRU object from lru-cache NPM\r\n * module. By default, it is {@link module:utils.cache}, a simple in-process\r\n * cache that grows continuously.\r\n *\r\n * @type {Cache}\r\n */\r\n\r\n exports.cache = utils.cache;\r\n\r\n /**\r\n * Custom file loader. Useful for template preprocessing or restricting access\r\n * to a certain part of the filesystem.\r\n *\r\n * @type {fileLoader}\r\n */\r\n\r\n exports.fileLoader = fs.readFileSync;\r\n\r\n /**\r\n * Name of the object containing the locals.\r\n *\r\n * This variable is overridden by {@link Options}`.localsName` if it is not\r\n * `undefined`.\r\n *\r\n * @type {String}\r\n * @public\r\n */\r\n\r\n exports.localsName = _DEFAULT_LOCALS_NAME;\r\n\r\n /**\r\n * Promise implementation -- defaults to the native implementation if available\r\n * This is mostly just for testability\r\n *\r\n * @type {Function}\r\n * @public\r\n */\r\n\r\n exports.promiseImpl = new Function('return this;')().Promise;\r\n\r\n /**\r\n * Get the path to the included file from the parent file path and the\r\n * specified path.\r\n *\r\n * @param {String} name specified path\r\n * @param {String} filename parent file path\r\n * @param {Boolean} isDir parent file path whether is directory\r\n * @return {String}\r\n */\r\n exports.resolveInclude = function (name, filename, isDir) {\r\n var dirname = path.dirname;\r\n var extname = path.extname;\r\n var resolve = path.resolve;\r\n var includePath = resolve(isDir ? filename : dirname(filename), name);\r\n var ext = extname(name);\r\n if (!ext) {\r\n includePath += '.ejs';\r\n }\r\n return includePath;\r\n };\r\n\r\n /**\r\n * Get the path to the included file by Options\r\n *\r\n * @param {String} path specified path\r\n * @param {Options} options compilation options\r\n * @return {String}\r\n */\r\n function getIncludePath(path, options) {\r\n var includePath;\r\n var filePath;\r\n var views = options.views;\r\n var match = /^[A-Za-z]+:\\\\|^\\//.exec(path);\r\n\r\n // Abs path\r\n if (match && match.length) {\r\n includePath = exports.resolveInclude(path.replace(/^\\/*/, ''), options.root || '/', true);\r\n }\r\n // Relative paths\r\n else {\r\n // Look relative to a passed filename first\r\n if (options.filename) {\r\n filePath = exports.resolveInclude(path, options.filename);\r\n if (fs.existsSync(filePath)) {\r\n includePath = filePath;\r\n }\r\n }\r\n // Then look in any views directories\r\n if (!includePath) {\r\n if (\r\n Array.isArray(views) &&\r\n views.some(function (v) {\r\n filePath = exports.resolveInclude(path, v, true);\r\n return fs.existsSync(filePath);\r\n })\r\n ) {\r\n includePath = filePath;\r\n }\r\n }\r\n if (!includePath) {\r\n throw new Error(\r\n 'Could not find the include file \"' + options.escapeFunction(path) + '\"',\r\n );\r\n }\r\n }\r\n return includePath;\r\n }\r\n\r\n /**\r\n * Get the template from a string or a file, either compiled on-the-fly or\r\n * read from cache (if enabled), and cache the template if needed.\r\n *\r\n * If `template` is not set, the file specified in `options.filename` will be\r\n * read.\r\n *\r\n * If `options.cache` is true, this function reads the file from\r\n * `options.filename` so it must be set prior to calling this function.\r\n *\r\n * @memberof module:ejs-internal\r\n * @param {Options} options compilation options\r\n * @param {String} [template] template source\r\n * @return {(TemplateFunction|ClientFunction)}\r\n * Depending on the value of `options.client`, either type might be returned.\r\n * @static\r\n */\r\n\r\n function handleCache(options, template) {\r\n var func;\r\n var filename = options.filename;\r\n var hasTemplate = arguments.length > 1;\r\n\r\n if (options.cache) {\r\n if (!filename) {\r\n throw new Error('cache option requires a filename');\r\n }\r\n func = exports.cache.get(filename);\r\n if (func) {\r\n return func;\r\n }\r\n if (!hasTemplate) {\r\n template = fileLoader(filename).toString().replace(_BOM, '');\r\n }\r\n } else if (!hasTemplate) {\r\n // istanbul ignore if: should not happen at all\r\n if (!filename) {\r\n throw new Error('Internal EJS error: no file name or template ' + 'provided');\r\n }\r\n template = fileLoader(filename).toString().replace(_BOM, '');\r\n }\r\n func = exports.compile(template, options);\r\n if (options.cache) {\r\n exports.cache.set(filename, func);\r\n }\r\n return func;\r\n }\r\n\r\n /**\r\n * Try calling handleCache with the given options and data and call the\r\n * callback with the result. If an error occurs, call the callback with\r\n * the error. Used by renderFile().\r\n *\r\n * @memberof module:ejs-internal\r\n * @param {Options} options compilation options\r\n * @param {Object} data template data\r\n * @param {RenderFileCallback} cb callback\r\n * @static\r\n */\r\n\r\n function tryHandleCache(options, data, cb) {\r\n var result;\r\n if (!cb) {\r\n if (typeof exports.promiseImpl == 'function') {\r\n return new exports.promiseImpl(function (resolve, reject) {\r\n try {\r\n result = handleCache(options)(data);\r\n resolve(result);\r\n } catch (err) {\r\n reject(err);\r\n }\r\n });\r\n } else {\r\n throw new Error('Please provide a callback function');\r\n }\r\n } else {\r\n try {\r\n result = handleCache(options)(data);\r\n } catch (err) {\r\n return cb(err);\r\n }\r\n\r\n cb(null, result);\r\n }\r\n }\r\n\r\n /**\r\n * fileLoader is independent\r\n *\r\n * @param {String} filePath ejs file path.\r\n * @return {String} The contents of the specified file.\r\n * @static\r\n */\r\n\r\n function fileLoader(filePath) {\r\n return exports.fileLoader(filePath);\r\n }\r\n\r\n /**\r\n * Get the template function.\r\n *\r\n * If `options.cache` is `true`, then the template is cached.\r\n *\r\n * @memberof module:ejs-internal\r\n * @param {String} path path for the specified file\r\n * @param {Options} options compilation options\r\n * @return {(TemplateFunction|ClientFunction)}\r\n * Depending on the value of `options.client`, either type might be returned\r\n * @static\r\n */\r\n\r\n function includeFile(path, options) {\r\n var opts = utils.shallowCopy({}, options);\r\n opts.filename = getIncludePath(path, opts);\r\n return handleCache(opts);\r\n }\r\n\r\n /**\r\n * Re-throw the given `err` in context to the `str` of ejs, `filename`, and\r\n * `lineno`.\r\n *\r\n * @implements RethrowCallback\r\n * @memberof module:ejs-internal\r\n * @param {Error} err Error object\r\n * @param {String} str EJS source\r\n * @param {String} filename file name of the EJS file\r\n * @param {String} lineno line number of the error\r\n * @static\r\n */\r\n\r\n function rethrow(err, str, flnm, lineno, esc) {\r\n var lines = str.split('\\n');\r\n var start = Math.max(lineno - 3, 0);\r\n var end = Math.min(lines.length, lineno + 3);\r\n var filename = esc(flnm); // eslint-disable-line\r\n // Error context\r\n var context = lines\r\n .slice(start, end)\r\n .map(function (line, i) {\r\n var curr = i + start + 1;\r\n return (curr == lineno ? ' >> ' : ' ') + curr + '| ' + line;\r\n })\r\n .join('\\n');\r\n\r\n // Alter exception message\r\n err.path = filename;\r\n err.message = (filename || 'ejs') + ':' + lineno + '\\n' + context + '\\n\\n' + err.message;\r\n\r\n throw err;\r\n }\r\n\r\n function stripSemi(str) {\r\n return str.replace(/;(\\s*$)/, '$1');\r\n }\r\n\r\n /**\r\n * Compile the given `str` of ejs into a template function.\r\n *\r\n * @param {String} template EJS template\r\n *\r\n * @param {Options} opts compilation options\r\n *\r\n * @return {(TemplateFunction|ClientFunction)}\r\n * Depending on the value of `opts.client`, either type might be returned.\r\n * Note that the return type of the function also depends on the value of `opts.async`.\r\n * @public\r\n */\r\n\r\n exports.compile = function compile(template, opts) {\r\n var templ;\r\n\r\n // v1 compat\r\n // 'scope' is 'context'\r\n // FIXME: Remove this in a future version\r\n if (opts && opts.scope) {\r\n if (!scopeOptionWarned) {\r\n console.warn('`scope` option is deprecated and will be removed in EJS 3');\r\n scopeOptionWarned = true;\r\n }\r\n if (!opts.context) {\r\n opts.context = opts.scope;\r\n }\r\n delete opts.scope;\r\n }\r\n templ = new Template(template, opts);\r\n return templ.compile();\r\n };\r\n\r\n /**\r\n * Render the given `template` of ejs.\r\n *\r\n * If you would like to include options but not data, you need to explicitly\r\n * call this function with `data` being an empty object or `null`.\r\n *\r\n * @param {String} template EJS template\r\n * @param {Object} [data={}] template data\r\n * @param {Options} [opts={}] compilation and rendering options\r\n * @return {(String|Promise<String>)}\r\n * Return value type depends on `opts.async`.\r\n * @public\r\n */\r\n\r\n exports.render = function (template, d, o) {\r\n var data = d || {};\r\n var opts = o || {};\r\n\r\n // No options object -- if there are optiony names\r\n // in the data, copy them to options\r\n if (arguments.length == 2) {\r\n utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);\r\n }\r\n\r\n return handleCache(opts, template)(data);\r\n };\r\n\r\n /**\r\n * Render an EJS file at the given `path` and callback `cb(err, str)`.\r\n *\r\n * If you would like to include options but not data, you need to explicitly\r\n * call this function with `data` being an empty object or `null`.\r\n *\r\n * @param {String} path path to the EJS file\r\n * @param {Object} [data={}] template data\r\n * @param {Options} [opts={}] compilation and rendering options\r\n * @param {RenderFileCallback} cb callback\r\n * @public\r\n */\r\n\r\n exports.renderFile = function () {\r\n var args = Array.prototype.slice.call(arguments);\r\n var filename = args.shift();\r\n var cb;\r\n var opts = { filename: filename };\r\n var data;\r\n var viewOpts;\r\n\r\n // Do we have a callback?\r\n if (typeof arguments[arguments.length - 1] == 'function') {\r\n cb = args.pop();\r\n }\r\n // Do we have data/opts?\r\n if (args.length) {\r\n // Should always have data obj\r\n data = args.shift();\r\n // Normal passed opts (data obj + opts obj)\r\n if (args.length) {\r\n // Use shallowCopy so we don't pollute passed in opts obj with new vals\r\n utils.shallowCopy(opts, args.pop());\r\n }\r\n // Special casing for Express (settings + opts-in-data)\r\n else {\r\n // Express 3 and 4\r\n if (data.settings) {\r\n // Pull a few things from known locations\r\n if (data.settings.views) {\r\n opts.views = data.settings.views;\r\n }\r\n if (data.settings['view cache']) {\r\n opts.cache = true;\r\n }\r\n // Undocumented after Express 2, but still usable, esp. for\r\n // items that are unsafe to be passed along with data, like `root`\r\n viewOpts = data.settings['view options'];\r\n if (viewOpts) {\r\n utils.shallowCopy(opts, viewOpts);\r\n }\r\n }\r\n // Express 2 and lower, values set in app.locals, or people who just\r\n // want to pass options in their data. NOTE: These values will override\r\n // anything previously set in settings or settings['view options']\r\n utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);\r\n }\r\n opts.filename = filename;\r\n } else {\r\n data = {};\r\n }\r\n\r\n return tryHandleCache(opts, data, cb);\r\n };\r\n\r\n /**\r\n * Clear intermediate JavaScript cache. Calls {@link Cache#reset}.\r\n * @public\r\n */\r\n\r\n /**\r\n * EJS template class\r\n * @public\r\n */\r\n exports.Template = Template;\r\n\r\n exports.clearCache = function () {\r\n exports.cache.reset();\r\n };\r\n\r\n function Template(text, opts) {\r\n opts = opts || {};\r\n var options = {};\r\n this.templateText = text;\r\n this.mode = null;\r\n this.truncate = false;\r\n this.currentLine = 1;\r\n this.source = '';\r\n this.dependencies = [];\r\n options.client = opts.client || false;\r\n options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;\r\n options.compileDebug = opts.compileDebug !== false;\r\n options.debug = !!opts.debug;\r\n options.filename = opts.filename;\r\n options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;\r\n options.closeDelimiter =\r\n opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;\r\n options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;\r\n options.strict = opts.strict || false;\r\n options.context = opts.context;\r\n options.cache = opts.cache || false;\r\n options.rmWhitespace = opts.rmWhitespace;\r\n options.root = opts.root;\r\n options.outputFunctionName = opts.outputFunctionName;\r\n options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;\r\n options.views = opts.views;\r\n options.async = opts.async;\r\n options.destructuredLocals = opts.destructuredLocals;\r\n options.legacyInclude = typeof opts.legacyInclude != 'undefined' ? !!opts.legacyInclude : true;\r\n\r\n if (options.strict) {\r\n options._with = false;\r\n } else {\r\n options._with = typeof opts._with != 'undefined' ? opts._with : true;\r\n }\r\n\r\n this.opts = options;\r\n\r\n this.regex = this.createRegex();\r\n }\r\n\r\n Template.modes = {\r\n EVAL: 'eval',\r\n ESCAPED: 'escaped',\r\n RAW: 'raw',\r\n COMMENT: 'comment',\r\n LITERAL: 'literal',\r\n };\r\n\r\n Template.prototype = {\r\n createRegex: function () {\r\n var str = _REGEX_STRING;\r\n var delim = utils.escapeRegExpChars(this.opts.delimiter);\r\n var open = utils.escapeRegExpChars(this.opts.openDelimiter);\r\n var close = utils.escapeRegExpChars(this.opts.closeDelimiter);\r\n str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);\r\n return new RegExp(str);\r\n },\r\n\r\n compile: function () {\r\n var src;\r\n var fn;\r\n var opts = this.opts;\r\n var prepended = '';\r\n var appended = '';\r\n var escapeFn = opts.escapeFunction;\r\n var ctor;\r\n\r\n if (!this.source) {\r\n this.generateSource();\r\n prepended +=\r\n ' var __output = \"\";\\n' +\r\n ' function __append(s) { if (s !== undefined && s !== null) __output += s }\\n';\r\n if (opts.outputFunctionName) {\r\n prepended += ' var ' + opts.outputFunctionName + ' = __append;' + '\\n';\r\n }\r\n if (opts.destructuredLocals && opts.destructuredLocals.length) {\r\n var destructuring = ' var __locals = (' + opts.localsName + ' || {}),\\n';\r\n for (var i = 0; i < opts.destructuredLocals.length; i++) {\r\n var name = opts.destructuredLocals[i];\r\n if (i > 0) {\r\n destructuring += ',\\n ';\r\n }\r\n destructuring += name + ' = __locals.' + name;\r\n }\r\n prepended += destructuring + ';\\n';\r\n }\r\n if (opts._with !== false) {\r\n prepended += ' with (' + opts.localsName + ' || {}) {' + '\\n';\r\n appended += ' }' + '\\n';\r\n }\r\n appended += ' return __output;' + '\\n';\r\n this.source = prepended + this.source + appended;\r\n }\r\n\r\n if (opts.compileDebug) {\r\n src =\r\n 'var __line = 1' +\r\n '\\n' +\r\n ' , __lines = ' +\r\n JSON.stringify(this.templateText) +\r\n '\\n' +\r\n ' , __filename = ' +\r\n (opts.filename ? JSON.stringify(opts.filename) : 'undefined') +\r\n ';' +\r\n '\\n' +\r\n 'try {' +\r\n '\\n' +\r\n this.source +\r\n '} catch (e) {' +\r\n '\\n' +\r\n ' rethrow(e, __lines, __filename, __line, escapeFn);' +\r\n '\\n' +\r\n '}' +\r\n '\\n';\r\n } else {\r\n src = this.source;\r\n }\r\n\r\n if (opts.client) {\r\n src = 'escapeFn = escapeFn || ' + escapeFn.toString() + ';' + '\\n' + src;\r\n if (opts.compileDebug) {\r\n src = 'rethrow = rethrow || ' + rethrow.toString() + ';' + '\\n' + src;\r\n }\r\n }\r\n\r\n if (opts.strict) {\r\n src = '\"use strict\";\\n' + src;\r\n }\r\n if (opts.debug) {\r\n console.log(src);\r\n }\r\n if (opts.compileDebug && opts.filename) {\r\n src = src + '\\n' + '//# sourceURL=' + opts.filename + '\\n';\r\n }\r\n\r\n try {\r\n if (opts.async) {\r\n // Have to use generated function for this, since in envs without support,\r\n // it breaks in parsing\r\n try {\r\n ctor = new Function('return (async function(){}).constructor;')();\r\n } catch (e) {\r\n if (e instanceof SyntaxError) {\r\n throw new Error('This environment does not support async/await');\r\n } else {\r\n throw e;\r\n }\r\n }\r\n } else {\r\n ctor = Function;\r\n }\r\n fn = new ctor(opts.localsName + ', escapeFn, include, rethrow', src);\r\n } catch (e) {\r\n // istanbul ignore else\r\n if (e instanceof SyntaxError) {\r\n if (opts.filename) {\r\n e.message += ' in ' + opts.filename;\r\n }\r\n e.message += ' while compiling ejs\\n\\n';\r\n e.message += 'If the above error is not helpful, you may want to try EJS-Lint:\\n';\r\n e.message += 'https://github.com/RyanZim/EJS-Lint';\r\n if (!opts.async) {\r\n e.message += '\\n';\r\n e.message +=\r\n 'Or, if you meant to create an async function, pass `async: true` as an option.';\r\n }\r\n }\r\n throw e;\r\n }\r\n\r\n // Return a callable function which will execute the function\r\n // created by the source-code, with the passed data as locals\r\n // Adds a local `include` function which allows full recursive include\r\n var returnedFn = opts.client\r\n ? fn\r\n : function anonymous(data) {\r\n var include = function (path, includeData) {\r\n var d = utils.shallowCopy({}, data);\r\n if (includeData) {\r\n d = utils.shallowCopy(d, includeData);\r\n }\r\n return includeFile(path, opts)(d);\r\n };\r\n return fn.apply(opts.context, [data || {}, escapeFn, include, rethrow]);\r\n };\r\n returnedFn.dependencies = this.dependencies;\r\n if (opts.filename && typeof Object.defineProperty === 'function') {\r\n var filename = opts.filename;\r\n var basename = path.basename(filename, path.extname(filename));\r\n try {\r\n Object.defineProperty(returnedFn, 'name', {\r\n value: basename,\r\n writable: false,\r\n enumerable: false,\r\n configurable: true,\r\n });\r\n } catch (e) {\r\n /* ignore */\r\n }\r\n }\r\n return returnedFn;\r\n },\r\n\r\n generateSource: function () {\r\n var opts = this.opts;\r\n\r\n if (opts.rmWhitespace) {\r\n // Have to use two separate replace here as `^` and `$` operators don't\r\n // work well with `\\r` and empty lines don't work well with the `m` flag.\r\n this.templateText = this.templateText\r\n .replace(/[\\r\\n]+/g, '\\n')\r\n .replace(/^\\s+|\\s+$/gm, '');\r\n }\r\n\r\n // Slurp spaces and tabs before <%_ and after _%>\r\n this.templateText = this.templateText\r\n .replace(/[ \\t]*<%_/gm, '<%_')\r\n .replace(/_%>[ \\t]*/gm, '_%>');\r\n\r\n var self = this;\r\n var matches = this.parseTemplateText();\r\n var d = this.opts.delimiter;\r\n var o = this.opts.openDelimiter;\r\n var c = this.opts.closeDelimiter;\r\n\r\n if (matches && matches.length) {\r\n matches.forEach(function (line, index) {\r\n var closing;\r\n // If this is an opening tag, check for closing tags\r\n // FIXME: May end up with some false positives here\r\n // Better to store modes as k/v with openDelimiter + delimiter as key\r\n // Then this can simply check against the map\r\n if (\r\n line.indexOf(o + d) === 0 && // If it is a tag\r\n line.indexOf(o + d + d) !== 0\r\n ) {\r\n // and is not escaped\r\n closing = matches[index + 2];\r\n if (!(closing == d + c || closing == '-' + d + c || closing == '_' + d + c)) {\r\n throw new Error('Could not find matching close tag for \"' + line + '\".');\r\n }\r\n }\r\n self.scanLine(line);\r\n });\r\n }\r\n },\r\n\r\n parseTemplateText: function () {\r\n var str = this.templateText;\r\n var pat = this.regex;\r\n var result = pat.exec(str);\r\n var arr = [];\r\n var firstPos;\r\n\r\n while (result) {\r\n firstPos = result.index;\r\n\r\n if (firstPos !== 0) {\r\n arr.push(str.substring(0, firstPos));\r\n str = str.slice(firstPos);\r\n }\r\n\r\n arr.push(result[0]);\r\n str = str.slice(result[0].length);\r\n result = pat.exec(str);\r\n }\r\n\r\n if (str) {\r\n arr.push(str);\r\n }\r\n\r\n return arr;\r\n },\r\n\r\n _addOutput: function (line) {\r\n if (this.truncate) {\r\n // Only replace single leading linebreak in the line after\r\n // -%> tag -- this is the single, trailing linebreak\r\n // after the tag that the truncation mode replaces\r\n // Handle Win / Unix / old Mac linebreaks -- do the \\r\\n\r\n // combo first in the regex-or\r\n line = line.replace(/^(?:\\r\\n|\\r|\\n)/, '');\r\n this.truncate = false;\r\n }\r\n if (!line) {\r\n return line;\r\n }\r\n\r\n // Preserve literal slashes\r\n line = line.replace(/\\\\/g, '\\\\\\\\');\r\n\r\n // Convert linebreaks\r\n line = line.replace(/\\n/g, '\\\\n');\r\n line = line.replace(/\\r/g, '\\\\r');\r\n\r\n // Escape double-quotes\r\n // - this will be the delimiter during execution\r\n line = line.replace(/\"/g, '\\\\\"');\r\n this.source += ' ; __append(\"' + line + '\")' + '\\n';\r\n },\r\n\r\n scanLine: function (line) {\r\n var self = this;\r\n var d = this.opts.delimiter;\r\n var o = this.opts.openDelimiter;\r\n var c = this.opts.closeDelimiter;\r\n var newLineCount = 0;\r\n\r\n newLineCount = line.split('\\n').length - 1;\r\n\r\n switch (line) {\r\n case o + d:\r\n case o + d + '_':\r\n this.mode = Template.modes.EVAL;\r\n break;\r\n case o + d + '=':\r\n this.mode = Template.modes.ESCAPED;\r\n break;\r\n case o + d + '-':\r\n this.mode = Template.modes.RAW;\r\n break;\r\n case o + d + '#':\r\n this.mode = Template.modes.COMMENT;\r\n break;\r\n case o + d + d:\r\n this.mode = Template.modes.LITERAL;\r\n this.source += ' ; __append(\"' + line.replace(o + d + d, o + d) + '\")' + '\\n';\r\n break;\r\n case d + d + c:\r\n this.mode = Template.modes.LITERAL;\r\n this.source += ' ; __append(\"' + line.replace(d + d + c, d + c) + '\")' + '\\n';\r\n break;\r\n case d + c:\r\n case '-' + d + c:\r\n case '_' + d + c:\r\n if (this.mode == Template.modes.LITERAL) {\r\n this._addOutput(line);\r\n }\r\n\r\n this.mode = null;\r\n this.truncate = line.indexOf('-') === 0 || line.indexOf('_') === 0;\r\n break;\r\n default:\r\n // In script mode, depends on type of tag\r\n if (this.mode) {\r\n // If '//' is found without a line break, add a line break.\r\n switch (this.mode) {\r\n case Template.modes.EVAL:\r\n case Template.modes.ESCAPED:\r\n case Template.modes.RAW:\r\n if (line.lastIndexOf('//') > line.lastIndexOf('\\n')) {\r\n line += '\\n';\r\n }\r\n }\r\n switch (this.mode) {\r\n // Just executing code\r\n case Template.modes.EVAL:\r\n this.source += ' ; ' + line + '\\n';\r\n break;\r\n // Exec, esc, and output\r\n case Template.modes.ESCAPED:\r\n this.source +=\r\n ' ; __append(escapeFn(' + stripSemi(line) + '))' + '\\n';\r\n break;\r\n // Exec and output\r\n case Template.modes.RAW:\r\n this.source += ' ; __append(' + stripSemi(line) + ')' + '\\n';\r\n break;\r\n case Template.modes.COMMENT:\r\n // Do nothing\r\n break;\r\n // Literal <%% mode, append as raw output\r\n case Template.modes.LITERAL:\r\n this._addOutput(line);\r\n break;\r\n }\r\n }\r\n // In string mode, just add the output\r\n else {\r\n this._addOutput(line);\r\n }\r\n }\r\n\r\n if (self.opts.compileDebug && newLineCount) {\r\n this.currentLine += newLineCount;\r\n this.source += ' ; __line = ' + this.currentLine + '\\n';\r\n }\r\n },\r\n };\r\n\r\n /**\r\n * Escape characters reserved in XML.\r\n *\r\n * This is simply an export of {@link module:utils.escapeXML}.\r\n *\r\n * If `markup` is `undefined` or `null`, the empty string is returned.\r\n *\r\n * @param {String} markup Input string\r\n * @return {String} Escaped string\r\n * @public\r\n * @func\r\n * */\r\n exports.escapeXML = utils.escapeXML;\r\n\r\n /**\r\n * Express.js support.\r\n *\r\n * This is an alias for {@link module:ejs.renderFile}, in order to support\r\n * Express.js out-of-the-box.\r\n *\r\n * @func\r\n */\r\n\r\n exports.__express = exports.renderFile;\r\n\r\n /**\r\n * Version of EJS.\r\n *\r\n * @readonly\r\n * @type {String}\r\n * @public\r\n */\r\n\r\n exports.VERSION = _VERSION_STRING;\r\n\r\n /**\r\n * Name for detection of EJS.\r\n *\r\n * @readonly\r\n * @type {String}\r\n * @public\r\n */\r\n\r\n exports.name = _NAME;\r\n\r\n /* istanbul ignore if */\r\n if (typeof window != 'undefined') {\r\n window.ejs = exports;\r\n }\r\n },\r\n { '../package.json': 6, './utils': 2, fs: 3, path: 4 },\r\n ],\r\n 2: [\r\n function (require, module, exports) {\r\n /*\r\n * EJS Embedded JavaScript templates\r\n * Copyright 2112 Matthew Eernisse (mde@fleegix.org)\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n *\r\n */\r\n\r\n /**\r\n * Private utility functions\r\n * @module utils\r\n * @private\r\n */\r\n\r\n 'use strict';\r\n\r\n var regExpChars = /[|\\\\{}()[\\]^$+*?.]/g;\r\n\r\n /**\r\n * Escape characters reserved in regular expressions.\r\n *\r\n * If `string` is `undefined` or `null`, the empty string is returned.\r\n *\r\n * @param {String} string Input string\r\n * @return {String} Escaped string\r\n * @static\r\n * @private\r\n */\r\n exports.escapeRegExpChars = function (string) {\r\n // istanbul ignore if\r\n if (!string) {\r\n return '';\r\n }\r\n return String(string).replace(regExpChars, '\\\\$&');\r\n };\r\n\r\n var _ENCODE_HTML_RULES = {\r\n '&': '&amp;',\r\n '<': '&lt;',\r\n '>': '&gt;',\r\n '\"': '&#34;',\r\n \"'\": '&#39;',\r\n };\r\n var _MATCH_HTML = /[&<>'\"]/g;\r\n\r\n function encode_char(c) {\r\n return _ENCODE_HTML_RULES[c] || c;\r\n }\r\n\r\n /**\r\n * Stringified version of constants used by {@link module:utils.escapeXML}.\r\n *\r\n * It is used in the process of generating {@link ClientFunction}s.\r\n *\r\n * @readonly\r\n * @type {String}\r\n */\r\n\r\n var escapeFuncStr =\r\n 'var _ENCODE_HTML_RULES = {\\n' +\r\n ' \"&\": \"&amp;\"\\n' +\r\n ' , \"<\": \"&lt;\"\\n' +\r\n ' , \">\": \"&gt;\"\\n' +\r\n ' , \\'\"\\': \"&#34;\"\\n' +\r\n ' , \"\\'\": \"&#39;\"\\n' +\r\n ' }\\n' +\r\n ' , _MATCH_HTML = /[&<>\\'\"]/g;\\n' +\r\n 'function encode_char(c) {\\n' +\r\n ' return _ENCODE_HTML_RULES[c] || c;\\n' +\r\n '};\\n';\r\n\r\n /**\r\n * Escape characters reserved in XML.\r\n *\r\n * If `markup` is `undefined` or `null`, the empty string is returned.\r\n *\r\n * @implements {EscapeCallback}\r\n * @param {String} markup Input string\r\n * @return {String} Escaped string\r\n * @static\r\n * @private\r\n */\r\n\r\n exports.escapeXML = function (markup) {\r\n return markup == undefined ? '' : String(markup).replace(_MATCH_HTML, encode_char);\r\n };\r\n exports.escapeXML.toString = function () {\r\n return Function.prototype.toString.call(this) + ';\\n' + escapeFuncStr;\r\n };\r\n\r\n /**\r\n * Naive copy of properties from one object to another.\r\n * Does not recurse into non-scalar properties\r\n * Does not check to see if the property has a value before copying\r\n *\r\n * @param {Object} to Destination object\r\n * @param {Object} from Source object\r\n * @return {Object} Destination object\r\n * @static\r\n * @private\r\n */\r\n exports.shallowCopy = function (to, from) {\r\n from = from || {};\r\n for (var p in from) {\r\n to[p] = from[p];\r\n }\r\n return to;\r\n };\r\n\r\n /**\r\n * Naive copy of a list of key names, from one object to another.\r\n * Only copies property if it is actually defined\r\n * Does not recurse into non-scalar properties\r\n *\r\n * @param {Object} to Destination object\r\n * @param {Object} from Source object\r\n * @param {Array} list List of properties to copy\r\n * @return {Object} Destination object\r\n * @static\r\n * @private\r\n */\r\n exports.shallowCopyFromList = function (to, from, list) {\r\n for (var i = 0; i < list.length; i++) {\r\n var p = list[i];\r\n if (typeof from[p] != 'undefined') {\r\n to[p] = from[p];\r\n }\r\n }\r\n return to;\r\n };\r\n\r\n /**\r\n * Simple in-process cache implementation. Does not implement limits of any\r\n * sort.\r\n *\r\n * @implements Cache\r\n * @static\r\n * @private\r\n */\r\n exports.cache = {\r\n _data: {},\r\n set: function (key, val) {\r\n this._data[key] = val;\r\n },\r\n get: function (key) {\r\n return this._data[key];\r\n },\r\n remove: function (key) {\r\n delete this._data[key];\r\n },\r\n reset: function () {\r\n this._data = {};\r\n },\r\n };\r\n },\r\n {},\r\n ],\r\n 3: [function (require, module, exports) {}, {}],\r\n 4: [\r\n function (require, module, exports) {\r\n (function (process) {\r\n // Copyright Joyent, Inc. and other Node contributors.\r\n //\r\n // Permission is hereby granted, free of charge, to any person obtaining a\r\n // copy of this software and associated documentation files (the\r\n // \"Software\"), to deal in the Software without restriction, including\r\n // without limitation the rights to use, copy, modify, merge, publish,\r\n // distribute, sublicense, and/or sell copies of the Software, and to permit\r\n // persons to whom the Software is furnished to do so, subject to the\r\n // following conditions:\r\n //\r\n // The above copyright notice and this permission notice shall be included\r\n // in all copies or substantial portions of the Software.\r\n //\r\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\r\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\r\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\r\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n // resolves . and .. elements in a path array with directory names there\r\n // must be no slashes, empty elements, or device names (c:\\) in the array\r\n // (so also no leading and trailing slashes - it does not distinguish\r\n // relative and absolute paths)\r\n function normalizeArray(parts, allowAboveRoot) {\r\n // if the path tries to go above the root, `up` ends up > 0\r\n var up = 0;\r\n for (var i = parts.length - 1; i >= 0; i--) {\r\n var last = parts[i];\r\n if (last === '.') {\r\n parts.splice(i, 1);\r\n } else if (last === '..') {\r\n parts.splice(i, 1);\r\n up++;\r\n } else if (up) {\r\n parts.splice(i, 1);\r\n up--;\r\n }\r\n }\r\n\r\n // if the path is allowed to go above the root, restore leading ..s\r\n if (allowAboveRoot) {\r\n for (; up--; up) {\r\n parts.unshift('..');\r\n }\r\n }\r\n\r\n return parts;\r\n }\r\n\r\n // Split a filename into [root, dir, basename, ext], unix version\r\n // 'root' is just a slash, or nothing.\r\n var splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\r\n var splitPath = function (filename) {\r\n return splitPathRe.exec(filename).slice(1);\r\n };\r\n\r\n // path.resolve([from ...], to)\r\n // posix version\r\n exports.resolve = function () {\r\n var resolvedPath = '',\r\n resolvedAbsolute = false;\r\n\r\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\r\n var path = i >= 0 ? arguments[i] : process.cwd();\r\n\r\n // Skip empty and invalid entries\r\n if (typeof path !== 'string') {\r\n throw new TypeError('Arguments to path.resolve must be strings');\r\n } else if (!path) {\r\n continue;\r\n }\r\n\r\n resolvedPath = path + '/' + resolvedPath;\r\n resolvedAbsolute = path.charAt(0) === '/';\r\n }\r\n\r\n // At this point the path should be resolved to a full absolute path, but\r\n // handle relative paths to be safe (might happen when process.cwd() fails)\r\n\r\n // Normalize the path\r\n resolvedPath = normalizeArray(\r\n filter(resolvedPath.split('/'), function (p) {\r\n return !!p;\r\n }),\r\n !resolvedAbsolute,\r\n ).join('/');\r\n\r\n return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\r\n };\r\n\r\n // path.normalize(path)\r\n // posix version\r\n exports.normalize = function (path) {\r\n var isAbsolute = exports.isAbsolute(path),\r\n trailingSlash = substr(path, -1) === '/';\r\n\r\n // Normalize the path\r\n path = normalizeArray(\r\n filter(path.split('/'), function (p) {\r\n return !!p;\r\n }),\r\n !isAbsolute,\r\n ).join('/');\r\n\r\n if (!path && !isAbsolute) {\r\n path = '.';\r\n }\r\n if (path && trailingSlash) {\r\n path += '/';\r\n }\r\n\r\n return (isAbsolute ? '/' : '') + path;\r\n };\r\n\r\n // posix version\r\n exports.isAbsolute = function (path) {\r\n return path.charAt(0) === '/';\r\n };\r\n\r\n // posix version\r\n exports.join = function () {\r\n var paths = Array.prototype.slice.call(arguments, 0);\r\n return exports.normalize(\r\n filter(paths, function (p, index) {\r\n if (typeof p !== 'string') {\r\n throw new TypeError('Arguments to path.join must be strings');\r\n }\r\n return p;\r\n }).join('/'),\r\n );\r\n };\r\n\r\n // path.relative(from, to)\r\n // posix version\r\n exports.relative = function (from, to) {\r\n from = exports.resolve(from).substr(1);\r\n to = exports.resolve(to).substr(1);\r\n\r\n function trim(arr) {\r\n var start = 0;\r\n for (; start < arr.length; start++) {\r\n if (arr[start] !== '') break;\r\n }\r\n\r\n var end = arr.length - 1;\r\n for (; end >= 0; end--) {\r\n if (arr[end] !== '') break;\r\n }\r\n\r\n if (start > end) return [];\r\n return arr.slice(start, end - start + 1);\r\n }\r\n\r\n var fromParts = trim(from.split('/'));\r\n var toParts = trim(to.split('/'));\r\n\r\n var length = Math.min(fromParts.length, toParts.length);\r\n var samePartsLength = length;\r\n for (var i = 0; i < length; i++) {\r\n if (fromParts[i] !== toParts[i]) {\r\n samePartsLength = i;\r\n break;\r\n }\r\n }\r\n\r\n var outputParts = [];\r\n for (var i = samePartsLength; i < fromParts.length; i++) {\r\n outputParts.push('..');\r\n }\r\n\r\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\r\n\r\n return outputParts.join('/');\r\n };\r\n\r\n exports.sep = '/';\r\n exports.delimiter = ':';\r\n\r\n exports.dirname = function (path) {\r\n var result = splitPath(path),\r\n root = result[0],\r\n dir = result[1];\r\n\r\n if (!root && !dir) {\r\n // No dirname whatsoever\r\n return '.';\r\n }\r\n\r\n if (dir) {\r\n // It has a dirname, strip trailing slash\r\n dir = dir.substr(0, dir.length - 1);\r\n }\r\n\r\n return root + dir;\r\n };\r\n\r\n exports.basename = function (path, ext) {\r\n var f = splitPath(path)[2];\r\n // TODO: make this comparison case-insensitive on windows?\r\n if (ext && f.substr(-1 * ext.length) === ext) {\r\n f = f.substr(0, f.length - ext.length);\r\n }\r\n return f;\r\n };\r\n\r\n exports.extname = function (path) {\r\n return splitPath(path)[3];\r\n };\r\n\r\n function filter(xs, f) {\r\n if (xs.filter) return xs.filter(f);\r\n var res = [];\r\n for (var i = 0; i < xs.length; i++) {\r\n if (f(xs[i], i, xs)) res.push(xs[i]);\r\n }\r\n return res;\r\n }\r\n\r\n // String.prototype.substr - negative index don't work in IE8\r\n var substr =\r\n 'ab'.substr(-1) === 'b'\r\n ? function (str, start, len) {\r\n return str.substr(start, len);\r\n }\r\n : function (str, start, len) {\r\n if (start < 0) start = str.length + start;\r\n return str.substr(start, len);\r\n };\r\n }).call(this, require('_process'));\r\n },\r\n { _process: 5 },\r\n ],\r\n 5: [\r\n function (require, module, exports) {\r\n // shim for using process in browser\r\n var process = (module.exports = {});\r\n\r\n // cached from whatever global is present so that test runners that stub it\r\n // don't break things. But we need to wrap it in a try catch in case it is\r\n // wrapped in strict mode code which doesn't define any globals. It's inside a\r\n // function because try/catches deoptimize in certain engines.\r\n\r\n var cachedSetTimeout;\r\n var cachedClearTimeout;\r\n\r\n function defaultSetTimout() {\r\n throw new Error('setTimeout has not been defined');\r\n }\r\n function defaultClearTimeout() {\r\n throw new Error('clearTimeout has not been defined');\r\n }\r\n (function () {\r\n try {\r\n if (typeof setTimeout === 'function') {\r\n cachedSetTimeout = setTimeout;\r\n } else {\r\n cachedSetTimeout = defaultSetTimout;\r\n }\r\n } catch (e) {\r\n cachedSetTimeout = defaultSetTimout;\r\n }\r\n try {\r\n if (typeof clearTimeout === 'function') {\r\n cachedClearTimeout = clearTimeout;\r\n } else {\r\n cachedClearTimeout = defaultClearTimeout;\r\n }\r\n } catch (e) {\r\n cachedClearTimeout = defaultClearTimeout;\r\n }\r\n })();\r\n function runTimeout(fun) {\r\n if (cachedSetTimeout === setTimeout) {\r\n //normal enviroments in sane situations\r\n return setTimeout(fun, 0);\r\n }\r\n // if setTimeout wasn't available but was latter defined\r\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\r\n cachedSetTimeout = setTimeout;\r\n return setTimeout(fun, 0);\r\n }\r\n try {\r\n // when when somebody has screwed with setTimeout but no I.E. maddness\r\n return cachedSetTimeout(fun, 0);\r\n } catch (e) {\r\n try {\r\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\r\n return cachedSetTimeout.call(null, fun, 0);\r\n } catch (e) {\r\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\r\n return cachedSetTimeout.call(this, fun, 0);\r\n }\r\n }\r\n }\r\n function runClearTimeout(marker) {\r\n if (cachedClearTimeout === clearTimeout) {\r\n //normal enviroments in sane situations\r\n return clearTimeout(marker);\r\n }\r\n // if clearTimeout wasn't available but was latter defined\r\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\r\n cachedClearTimeout = clearTimeout;\r\n return clearTimeout(marker);\r\n }\r\n try {\r\n // when when somebody has screwed with setTimeout but no I.E. maddness\r\n return cachedClearTimeout(marker);\r\n } catch (e) {\r\n try {\r\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\r\n return cachedClearTimeout.call(null, marker);\r\n } catch (e) {\r\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\r\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\r\n return cachedClearTimeout.call(this, marker);\r\n }\r\n }\r\n }\r\n var queue = [];\r\n var draining = false;\r\n var currentQueue;\r\n var queueIndex = -1;\r\n\r\n function cleanUpNextTick() {\r\n if (!draining || !currentQueue) {\r\n return;\r\n }\r\n draining = false;\r\n if (currentQueue.length) {\r\n queue = currentQueue.concat(queue);\r\n } else {\r\n queueIndex = -1;\r\n }\r\n if (queue.length) {\r\n drainQueue();\r\n }\r\n }\r\n\r\n function drainQueue() {\r\n if (draining) {\r\n return;\r\n }\r\n var timeout = runTimeout(cleanUpNextTick);\r\n draining = true;\r\n\r\n var len = queue.length;\r\n while (len) {\r\n currentQueue = queue;\r\n queue = [];\r\n while (++queueIndex < len) {\r\n if (currentQueue) {\r\n currentQueue[queueIndex].run();\r\n }\r\n }\r\n queueIndex = -1;\r\n len = queue.length;\r\n }\r\n currentQueue = null;\r\n draining = false;\r\n runClearTimeout(timeout);\r\n }\r\n\r\n process.nextTick = function (fun) {\r\n var args = new Array(arguments.length - 1);\r\n if (arguments.length > 1) {\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n }\r\n queue.push(new Item(fun, args));\r\n if (queue.length === 1 && !draining) {\r\n runTimeout(drainQueue);\r\n }\r\n };\r\n\r\n // v8 likes predictible objects\r\n function Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n }\r\n Item.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n };\r\n process.title = 'browser';\r\n process.browser = true;\r\n process.env = {};\r\n process.argv = [];\r\n process.version = ''; // empty string to avoid regexp issues\r\n process.versions = {};\r\n\r\n function noop() {}\r\n\r\n process.on = noop;\r\n process.addListener = noop;\r\n process.once = noop;\r\n process.off = noop;\r\n process.removeListener = noop;\r\n process.removeAllListeners = noop;\r\n process.emit = noop;\r\n process.prependListener = noop;\r\n process.prependOnceListener = noop;\r\n\r\n process.listeners = function (name) {\r\n return [];\r\n };\r\n\r\n process.binding = function (name) {\r\n throw new Error('process.binding is not supported');\r\n };\r\n\r\n process.cwd = function () {\r\n return '/';\r\n };\r\n process.chdir = function (dir) {\r\n throw new Error('process.chdir is not supported');\r\n };\r\n process.umask = function () {\r\n return 0;\r\n };\r\n },\r\n {},\r\n ],\r\n 6: [\r\n function (require, module, exports) {\r\n module.exports = {\r\n name: 'ejs',\r\n description: 'Embedded JavaScript templates',\r\n keywords: ['template', 'engine', 'ejs'],\r\n version: '3.0.1',\r\n author: 'Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)',\r\n license: 'Apache-2.0',\r\n main: './lib/ejs.js',\r\n repository: {\r\n type: 'git',\r\n url: 'git://github.com/mde/ejs.git',\r\n },\r\n bugs: 'https://github.com/mde/ejs/issues',\r\n homepage: 'https://github.com/mde/ejs',\r\n dependencies: {},\r\n devDependencies: {\r\n browserify: '^13.1.1',\r\n eslint: '^4.14.0',\r\n 'git-directory-deploy': '^1.5.1',\r\n jake: '^10.3.1',\r\n jsdoc: '^3.4.0',\r\n 'lru-cache': '^4.0.1',\r\n mocha: '^5.0.5',\r\n 'uglify-js': '^3.3.16',\r\n },\r\n engines: {\r\n node: '>=0.10.0',\r\n },\r\n scripts: {\r\n test: 'mocha',\r\n postinstall: 'node ./postinstall.js',\r\n },\r\n };\r\n },\r\n {},\r\n ],\r\n },\r\n {},\r\n [1],\r\n )(1);\r\n});\r\n", "import './jsontemplate.js';\nimport './ejs.js';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAEE;AAFF;AAAA;AAEE,gBAAW;AAAA;AAAA;;;ACFb;AAAA;AAAA;AAUA;AAEA,YAAM,4CAA4C,EAAE,KAAK,CAAM,QAAO;AAClE,cAAM,OAAO,MAAM,IAAI,KAAK;AAE5B,UAAE,OAAO,MAAM,kBAAkB,IAAI;AAAA,MACzC,EAAC;AAED,UAAM,oBAAoB,oBAAI,IAAI,CAAC,YAAY,YAAY,QAAQ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
  }
@@ -296,6 +296,7 @@ vis.binds['jsontemplate'] = {
296
296
  );
297
297
  } catch (e) {
298
298
  text = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\r\n|\r|\n)/g, '<br>');
299
+ console.error(e.message);
299
300
  text = text.replace(/ /gm, '&nbsp;');
300
301
  text = `<code style="color:red;">${text}</code>`;
301
302
  }
@@ -1,4 +1,4 @@
1
- import{j as Ut}from"./jsx-runtime-qZ4C1rVi.js";import{v as Ge}from"./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js";import{p as $t}from"./index-DYmfCyJR.js";import{c as be}from"./_commonjsHelpers-DsqdWQfm.js";import{v as ke}from"./JSONTemplateWidget-BxJj3J2G.js";import"./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js";import"./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js";import"./preload-helper-BDBacUwf.js";var We={},Oe={},qt={exports:{}};(function(P,D){(function(){var w="ace",A=(function(){return this})();!A&&typeof window<"u"&&(A=window);var I=function(t,o,i){if(typeof t!="string"){I.original?I.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(i=o),I.modules[t]||(I.payloads[t]=i,I.modules[t]=null)};I.modules={},I.payloads={};var f=function(t,o,i){if(typeof o=="string"){var n=a(t,o);if(n!=null)return i&&i(),n}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var e=[],r=0,s=o.length;r<s;++r){var c=a(t,o[r]);if(c==null&&v.original)return;e.push(c)}return i&&i.apply(null,e)||!0}},v=function(t,o){var i=f("",t,o);return i==null&&v.original?v.original.apply(this,arguments):i},m=function(t,o){if(o.indexOf("!")!==-1){var i=o.split("!");return m(t,i[0])+"!"+m(t,i[1])}if(o.charAt(0)=="."){var n=t.split("/").slice(0,-1).join("/");for(o=n+"/"+o;o.indexOf(".")!==-1&&e!=o;){var e=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},a=function(t,o){o=m(t,o);var i=I.modules[o];if(!i){if(i=I.payloads[o],typeof i=="function"){var n={},e={id:o,uri:"",exports:n,packaged:!0},r=function(c,u){return f(o,c,u)},s=i(r,n,e);n=s||e.exports,I.modules[o]=n,delete I.payloads[o]}i=I.modules[o]=n||i}return i};function l(t){var o=A;A[t]||(A[t]={}),o=A[t],(!o.define||!o.define.packaged)&&(I.original=o.define,o.define=I,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(v.original=o.require,o.require=v,o.require.packaged=!0)}l(w)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(w,A,I){function f(v,m,a){Object.defineProperty(v,m,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||f(String.prototype,"startsWith",function(v,m){return m=m||0,this.lastIndexOf(v,m)===m}),String.prototype.endsWith||f(String.prototype,"endsWith",function(v,m){var a=this;(m===void 0||m>a.length)&&(m=a.length),m-=v.length;var l=a.indexOf(v,m);return l!==-1&&l===m}),String.prototype.repeat||f(String.prototype,"repeat",function(v){for(var m="",a=this;v>0;)v&1&&(m+=a),(v>>=1)&&(a+=a);return m}),String.prototype.includes||f(String.prototype,"includes",function(v,m){return this.indexOf(v,m)!=-1}),Object.assign||(Object.assign=function(v){if(v==null)throw new TypeError("Cannot convert undefined or null to object");for(var m=Object(v),a=1;a<arguments.length;a++){var l=arguments[a];l!=null&&Object.keys(l).forEach(function(t){m[t]=l[t]})}return m}),Object.values||(Object.values=function(v){return Object.keys(v).map(function(m){return v[m]})}),Array.prototype.find||f(Array.prototype,"find",function(v){for(var m=this.length,a=arguments[1],l=0;l<m;l++){var t=this[l];if(v.call(a,t,l,this))return t}}),Array.prototype.findIndex||f(Array.prototype,"findIndex",function(v){for(var m=this.length,a=arguments[1],l=0;l<m;l++){var t=this[l];if(v.call(a,t,l,this))return l}}),Array.prototype.includes||f(Array.prototype,"includes",function(v,m){return this.indexOf(v,m)!=-1}),Array.prototype.fill||f(Array.prototype,"fill",function(v){for(var m=this,a=m.length>>>0,l=arguments[1],t=l>>0,o=t<0?Math.max(a+t,0):Math.min(t,a),i=arguments[2],n=i===void 0?a:i>>0,e=n<0?Math.max(a+n,0):Math.min(n,a);o<e;)m[o]=v,o++;return m}),Array.of||f(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(w,A,I){w("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(w,A,I){A.deepCopy=function f(v){if(typeof v!="object"||!v)return v;var m;if(Array.isArray(v)){m=[];for(var a=0;a<v.length;a++)m[a]=f(v[a]);return m}if(Object.prototype.toString.call(v)!=="[object Object]")return v;m={};for(var a in v)m[a]=f(v[a]);return m}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(w,A,I){A.last=function(m){return m[m.length-1]},A.stringReverse=function(m){return m.split("").reverse().join("")},A.stringRepeat=function(m,a){for(var l="";a>0;)a&1&&(l+=m),(a>>=1)&&(m+=m);return l};var f=/^\s\s*/,v=/\s\s*$/;A.stringTrimLeft=function(m){return m.replace(f,"")},A.stringTrimRight=function(m){return m.replace(v,"")},A.copyObject=function(m){var a={};for(var l in m)a[l]=m[l];return a},A.copyArray=function(m){for(var a=[],l=0,t=m.length;l<t;l++)m[l]&&typeof m[l]=="object"?a[l]=this.copyObject(m[l]):a[l]=m[l];return a},A.deepCopy=w("./deep_copy").deepCopy,A.arrayToMap=function(m){for(var a={},l=0;l<m.length;l++)a[m[l]]=1;return a},A.createMap=function(m){var a=Object.create(null);for(var l in m)a[l]=m[l];return a},A.arrayRemove=function(m,a){for(var l=0;l<=m.length;l++)a===m[l]&&m.splice(l,1)},A.escapeRegExp=function(m){return m.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},A.escapeHTML=function(m){return(""+m).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},A.getMatchOffsets=function(m,a){var l=[];return m.replace(a,function(t){l.push({offset:arguments[arguments.length-2],length:t.length})}),l},A.deferredCall=function(m){var a=null,l=function(){a=null,m()},t=function(o){return t.cancel(),a=setTimeout(l,o||0),t};return t.schedule=t,t.call=function(){return this.cancel(),m(),t},t.cancel=function(){return clearTimeout(a),a=null,t},t.isPending=function(){return a},t},A.delayedCall=function(m,a){var l=null,t=function(){l=null,m()},o=function(i){l==null&&(l=setTimeout(t,i||a))};return o.delay=function(i){l&&clearTimeout(l),l=setTimeout(t,i||a)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){l&&clearTimeout(l),l=null},o.isPending=function(){return l},o},A.sleep=function(m){return new Promise(function(a){setTimeout(a,m)})},A.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},A.skipEmptyMatch=function(m,a,l){return l&&m.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(w,A,I){A.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},A.getOS=function(){return A.isMac?A.OS.MAC:A.isLinux?A.OS.LINUX:A.OS.WINDOWS};var f=typeof navigator=="object"?navigator:{},v=(/mac|win|linux/i.exec(f.platform)||["other"])[0].toLowerCase(),m=f.userAgent||"",a=f.appName||"";A.isWin=v=="win",A.isMac=v=="mac",A.isLinux=v=="linux",A.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((m.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((m.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),A.isOldIE=A.isIE&&A.isIE<9,A.isGecko=A.isMozilla=m.match(/ Gecko\/\d+/),A.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",A.isWebKit=parseFloat(m.split("WebKit/")[1])||void 0,A.isChrome=parseFloat(m.split(" Chrome/")[1])||void 0,A.isSafari=parseFloat(m.split(" Safari/")[1])&&!A.isChrome||void 0,A.isEdge=parseFloat(m.split(" Edge/")[1])||void 0,A.isAIR=m.indexOf("AdobeAIR")>=0,A.isAndroid=m.indexOf("Android")>=0,A.isChromeOS=m.indexOf(" CrOS ")>=0,A.isIOS=/iPad|iPhone|iPod/.test(m)&&!window.MSStream,A.isIOS&&(A.isMac=!0),A.isMobile=A.isIOS||A.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(w,A,I){var f=w("./useragent"),v="http://www.w3.org/1999/xhtml";A.buildDom=function i(n,e,r){if(typeof n=="string"&&n){var s=document.createTextNode(n);return e&&e.appendChild(s),s}if(!Array.isArray(n))return n&&n.appendChild&&e&&e.appendChild(n),n;if(typeof n[0]!="string"||!n[0]){for(var c=[],u=0;u<n.length;u++){var _=i(n[u],e,r);_&&c.push(_)}return c}var b=document.createElement(n[0]),p=n[1],h=1;p&&typeof p=="object"&&!Array.isArray(p)&&(h=2);for(var u=h;u<n.length;u++)i(n[u],b,r);return h==2&&Object.keys(p).forEach(function($){var k=p[$];$==="class"?b.className=Array.isArray(k)?k.join(" "):k:typeof k=="function"||$=="value"||$[0]=="$"?b[$]=k:$==="ref"?r&&(r[k]=b):$==="style"?typeof k=="string"&&(b.style.cssText=k):k!=null&&b.setAttribute($,k)}),e&&e.appendChild(b),b},A.getDocumentHead=function(i){return i||(i=document),i.head||i.getElementsByTagName("head")[0]||i.documentElement},A.createElement=function(i,n){return document.createElementNS?document.createElementNS(n||v,i):document.createElement(i)},A.removeChildren=function(i){i.innerHTML=""},A.createTextNode=function(i,n){var e=n?n.ownerDocument:document;return e.createTextNode(i)},A.createFragment=function(i){var n=i?i.ownerDocument:document;return n.createDocumentFragment()},A.hasCssClass=function(i,n){var e=(i.className+"").split(/\s+/g);return e.indexOf(n)!==-1},A.addCssClass=function(i,n){A.hasCssClass(i,n)||(i.className+=" "+n)},A.removeCssClass=function(i,n){for(var e=i.className.split(/\s+/g);;){var r=e.indexOf(n);if(r==-1)break;e.splice(r,1)}i.className=e.join(" ")},A.toggleCssClass=function(i,n){for(var e=i.className.split(/\s+/g),r=!0;;){var s=e.indexOf(n);if(s==-1)break;r=!1,e.splice(s,1)}return r&&e.push(n),i.className=e.join(" "),r},A.setCssClass=function(i,n,e){e?A.addCssClass(i,n):A.removeCssClass(i,n)},A.hasCssString=function(i,n){var e=0,r;if(n=n||document,r=n.querySelectorAll("style")){for(;e<r.length;)if(r[e++].id===i)return!0}},A.removeElementById=function(i,n){n=n||document,n.getElementById(i)&&n.getElementById(i).remove()};var m,a=[];A.useStrictCSP=function(i){m=i,i==!1?l():a||(a=[])};function l(){var i=a;a=null,i&&i.forEach(function(n){t(n[0],n[1])})}function t(i,n,e){if(!(typeof document>"u")){if(a){if(e)l();else if(e===!1)return a.push([i,n])}if(!m){var r=e;!e||!e.getRootNode?r=document:(r=e.getRootNode(),(!r||r==e)&&(r=document));var s=r.ownerDocument||r;if(n&&A.hasCssString(n,r))return null;n&&(i+=`
1
+ import{j as Ut}from"./jsx-runtime-qZ4C1rVi.js";import{v as Ge}from"./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js";import{p as $t}from"./index-DYmfCyJR.js";import{c as be}from"./_commonjsHelpers-DsqdWQfm.js";import{v as ke}from"./JSONTemplateWidget-BrIGyvVS.js";import"./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js";import"./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js";import"./preload-helper-BDBacUwf.js";var We={},Oe={},qt={exports:{}};(function(P,D){(function(){var w="ace",A=(function(){return this})();!A&&typeof window<"u"&&(A=window);var I=function(t,o,i){if(typeof t!="string"){I.original?I.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(i=o),I.modules[t]||(I.payloads[t]=i,I.modules[t]=null)};I.modules={},I.payloads={};var f=function(t,o,i){if(typeof o=="string"){var n=a(t,o);if(n!=null)return i&&i(),n}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var e=[],r=0,s=o.length;r<s;++r){var c=a(t,o[r]);if(c==null&&v.original)return;e.push(c)}return i&&i.apply(null,e)||!0}},v=function(t,o){var i=f("",t,o);return i==null&&v.original?v.original.apply(this,arguments):i},m=function(t,o){if(o.indexOf("!")!==-1){var i=o.split("!");return m(t,i[0])+"!"+m(t,i[1])}if(o.charAt(0)=="."){var n=t.split("/").slice(0,-1).join("/");for(o=n+"/"+o;o.indexOf(".")!==-1&&e!=o;){var e=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},a=function(t,o){o=m(t,o);var i=I.modules[o];if(!i){if(i=I.payloads[o],typeof i=="function"){var n={},e={id:o,uri:"",exports:n,packaged:!0},r=function(c,u){return f(o,c,u)},s=i(r,n,e);n=s||e.exports,I.modules[o]=n,delete I.payloads[o]}i=I.modules[o]=n||i}return i};function l(t){var o=A;A[t]||(A[t]={}),o=A[t],(!o.define||!o.define.packaged)&&(I.original=o.define,o.define=I,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(v.original=o.require,o.require=v,o.require.packaged=!0)}l(w)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(w,A,I){function f(v,m,a){Object.defineProperty(v,m,{value:a,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||f(String.prototype,"startsWith",function(v,m){return m=m||0,this.lastIndexOf(v,m)===m}),String.prototype.endsWith||f(String.prototype,"endsWith",function(v,m){var a=this;(m===void 0||m>a.length)&&(m=a.length),m-=v.length;var l=a.indexOf(v,m);return l!==-1&&l===m}),String.prototype.repeat||f(String.prototype,"repeat",function(v){for(var m="",a=this;v>0;)v&1&&(m+=a),(v>>=1)&&(a+=a);return m}),String.prototype.includes||f(String.prototype,"includes",function(v,m){return this.indexOf(v,m)!=-1}),Object.assign||(Object.assign=function(v){if(v==null)throw new TypeError("Cannot convert undefined or null to object");for(var m=Object(v),a=1;a<arguments.length;a++){var l=arguments[a];l!=null&&Object.keys(l).forEach(function(t){m[t]=l[t]})}return m}),Object.values||(Object.values=function(v){return Object.keys(v).map(function(m){return v[m]})}),Array.prototype.find||f(Array.prototype,"find",function(v){for(var m=this.length,a=arguments[1],l=0;l<m;l++){var t=this[l];if(v.call(a,t,l,this))return t}}),Array.prototype.findIndex||f(Array.prototype,"findIndex",function(v){for(var m=this.length,a=arguments[1],l=0;l<m;l++){var t=this[l];if(v.call(a,t,l,this))return l}}),Array.prototype.includes||f(Array.prototype,"includes",function(v,m){return this.indexOf(v,m)!=-1}),Array.prototype.fill||f(Array.prototype,"fill",function(v){for(var m=this,a=m.length>>>0,l=arguments[1],t=l>>0,o=t<0?Math.max(a+t,0):Math.min(t,a),i=arguments[2],n=i===void 0?a:i>>0,e=n<0?Math.max(a+n,0):Math.min(n,a);o<e;)m[o]=v,o++;return m}),Array.of||f(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(w,A,I){w("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(w,A,I){A.deepCopy=function f(v){if(typeof v!="object"||!v)return v;var m;if(Array.isArray(v)){m=[];for(var a=0;a<v.length;a++)m[a]=f(v[a]);return m}if(Object.prototype.toString.call(v)!=="[object Object]")return v;m={};for(var a in v)m[a]=f(v[a]);return m}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(w,A,I){A.last=function(m){return m[m.length-1]},A.stringReverse=function(m){return m.split("").reverse().join("")},A.stringRepeat=function(m,a){for(var l="";a>0;)a&1&&(l+=m),(a>>=1)&&(m+=m);return l};var f=/^\s\s*/,v=/\s\s*$/;A.stringTrimLeft=function(m){return m.replace(f,"")},A.stringTrimRight=function(m){return m.replace(v,"")},A.copyObject=function(m){var a={};for(var l in m)a[l]=m[l];return a},A.copyArray=function(m){for(var a=[],l=0,t=m.length;l<t;l++)m[l]&&typeof m[l]=="object"?a[l]=this.copyObject(m[l]):a[l]=m[l];return a},A.deepCopy=w("./deep_copy").deepCopy,A.arrayToMap=function(m){for(var a={},l=0;l<m.length;l++)a[m[l]]=1;return a},A.createMap=function(m){var a=Object.create(null);for(var l in m)a[l]=m[l];return a},A.arrayRemove=function(m,a){for(var l=0;l<=m.length;l++)a===m[l]&&m.splice(l,1)},A.escapeRegExp=function(m){return m.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},A.escapeHTML=function(m){return(""+m).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},A.getMatchOffsets=function(m,a){var l=[];return m.replace(a,function(t){l.push({offset:arguments[arguments.length-2],length:t.length})}),l},A.deferredCall=function(m){var a=null,l=function(){a=null,m()},t=function(o){return t.cancel(),a=setTimeout(l,o||0),t};return t.schedule=t,t.call=function(){return this.cancel(),m(),t},t.cancel=function(){return clearTimeout(a),a=null,t},t.isPending=function(){return a},t},A.delayedCall=function(m,a){var l=null,t=function(){l=null,m()},o=function(i){l==null&&(l=setTimeout(t,i||a))};return o.delay=function(i){l&&clearTimeout(l),l=setTimeout(t,i||a)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){l&&clearTimeout(l),l=null},o.isPending=function(){return l},o},A.sleep=function(m){return new Promise(function(a){setTimeout(a,m)})},A.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},A.skipEmptyMatch=function(m,a,l){return l&&m.codePointAt(a)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(w,A,I){A.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},A.getOS=function(){return A.isMac?A.OS.MAC:A.isLinux?A.OS.LINUX:A.OS.WINDOWS};var f=typeof navigator=="object"?navigator:{},v=(/mac|win|linux/i.exec(f.platform)||["other"])[0].toLowerCase(),m=f.userAgent||"",a=f.appName||"";A.isWin=v=="win",A.isMac=v=="mac",A.isLinux=v=="linux",A.isIE=a=="Microsoft Internet Explorer"||a.indexOf("MSAppHost")>=0?parseFloat((m.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((m.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),A.isOldIE=A.isIE&&A.isIE<9,A.isGecko=A.isMozilla=m.match(/ Gecko\/\d+/),A.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",A.isWebKit=parseFloat(m.split("WebKit/")[1])||void 0,A.isChrome=parseFloat(m.split(" Chrome/")[1])||void 0,A.isSafari=parseFloat(m.split(" Safari/")[1])&&!A.isChrome||void 0,A.isEdge=parseFloat(m.split(" Edge/")[1])||void 0,A.isAIR=m.indexOf("AdobeAIR")>=0,A.isAndroid=m.indexOf("Android")>=0,A.isChromeOS=m.indexOf(" CrOS ")>=0,A.isIOS=/iPad|iPhone|iPod/.test(m)&&!window.MSStream,A.isIOS&&(A.isMac=!0),A.isMobile=A.isIOS||A.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(w,A,I){var f=w("./useragent"),v="http://www.w3.org/1999/xhtml";A.buildDom=function i(n,e,r){if(typeof n=="string"&&n){var s=document.createTextNode(n);return e&&e.appendChild(s),s}if(!Array.isArray(n))return n&&n.appendChild&&e&&e.appendChild(n),n;if(typeof n[0]!="string"||!n[0]){for(var c=[],u=0;u<n.length;u++){var _=i(n[u],e,r);_&&c.push(_)}return c}var b=document.createElement(n[0]),p=n[1],h=1;p&&typeof p=="object"&&!Array.isArray(p)&&(h=2);for(var u=h;u<n.length;u++)i(n[u],b,r);return h==2&&Object.keys(p).forEach(function($){var k=p[$];$==="class"?b.className=Array.isArray(k)?k.join(" "):k:typeof k=="function"||$=="value"||$[0]=="$"?b[$]=k:$==="ref"?r&&(r[k]=b):$==="style"?typeof k=="string"&&(b.style.cssText=k):k!=null&&b.setAttribute($,k)}),e&&e.appendChild(b),b},A.getDocumentHead=function(i){return i||(i=document),i.head||i.getElementsByTagName("head")[0]||i.documentElement},A.createElement=function(i,n){return document.createElementNS?document.createElementNS(n||v,i):document.createElement(i)},A.removeChildren=function(i){i.innerHTML=""},A.createTextNode=function(i,n){var e=n?n.ownerDocument:document;return e.createTextNode(i)},A.createFragment=function(i){var n=i?i.ownerDocument:document;return n.createDocumentFragment()},A.hasCssClass=function(i,n){var e=(i.className+"").split(/\s+/g);return e.indexOf(n)!==-1},A.addCssClass=function(i,n){A.hasCssClass(i,n)||(i.className+=" "+n)},A.removeCssClass=function(i,n){for(var e=i.className.split(/\s+/g);;){var r=e.indexOf(n);if(r==-1)break;e.splice(r,1)}i.className=e.join(" ")},A.toggleCssClass=function(i,n){for(var e=i.className.split(/\s+/g),r=!0;;){var s=e.indexOf(n);if(s==-1)break;r=!1,e.splice(s,1)}return r&&e.push(n),i.className=e.join(" "),r},A.setCssClass=function(i,n,e){e?A.addCssClass(i,n):A.removeCssClass(i,n)},A.hasCssString=function(i,n){var e=0,r;if(n=n||document,r=n.querySelectorAll("style")){for(;e<r.length;)if(r[e++].id===i)return!0}},A.removeElementById=function(i,n){n=n||document,n.getElementById(i)&&n.getElementById(i).remove()};var m,a=[];A.useStrictCSP=function(i){m=i,i==!1?l():a||(a=[])};function l(){var i=a;a=null,i&&i.forEach(function(n){t(n[0],n[1])})}function t(i,n,e){if(!(typeof document>"u")){if(a){if(e)l();else if(e===!1)return a.push([i,n])}if(!m){var r=e;!e||!e.getRootNode?r=document:(r=e.getRootNode(),(!r||r==e)&&(r=document));var s=r.ownerDocument||r;if(n&&A.hasCssString(n,r))return null;n&&(i+=`
2
2
  /*# sourceURL=ace/css/`+n+" */");var c=A.createElement("style");c.appendChild(s.createTextNode(i)),n&&(c.id=n),r==s&&(r=A.getDocumentHead(s)),r.insertBefore(c,r.firstChild)}}}if(A.importCssString=t,A.importCssStylsheet=function(i,n){A.buildDom(["link",{rel:"stylesheet",href:i}],A.getDocumentHead(n))},A.$fixPositionBug=function(i){var n=i.getBoundingClientRect();if(i.style.left){var e=parseFloat(i.style.left),r=+n.left;Math.abs(e-r)>1&&(i.style.left=2*e-r+"px")}if(i.style.right){var e=parseFloat(i.style.right),r=window.innerWidth-n.right;Math.abs(e-r)>1&&(i.style.right=2*e-r+"px")}if(i.style.top){var e=parseFloat(i.style.top),r=+n.top;Math.abs(e-r)>1&&(i.style.top=2*e-r+"px")}if(i.style.bottom){var e=parseFloat(i.style.bottom),r=window.innerHeight-n.bottom;Math.abs(e-r)>1&&(i.style.bottom=2*e-r+"px")}},A.scrollbarWidth=function(i){var n=A.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var e=A.createElement("ace_outer"),r=e.style;r.position="absolute",r.left="-10000px",r.overflow="hidden",r.width="200px",r.minWidth="0px",r.height="150px",r.display="block",e.appendChild(n);var s=i&&i.documentElement||document&&document.documentElement;if(!s)return 0;s.appendChild(e);var c=n.offsetWidth;r.overflow="scroll";var u=n.offsetWidth;return c===u&&(u=e.clientWidth),s.removeChild(e),c-u},A.computedStyle=function(i,n){return window.getComputedStyle(i,"")||{}},A.setStyle=function(i,n,e){i[n]!==e&&(i[n]=e)},A.HAS_CSS_ANIMATION=!1,A.HAS_CSS_TRANSFORMS=!1,A.HI_DPI=f.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,f.isChromeOS&&(A.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");A.HI_DPI&&o.style.transform!==void 0&&(A.HAS_CSS_TRANSFORMS=!0),!f.isEdge&&typeof o.style.animationName<"u"&&(A.HAS_CSS_ANIMATION=!0),o=null}A.HAS_CSS_TRANSFORMS?A.translate=function(i,n,e){i.style.transform="translate("+Math.round(n)+"px, "+Math.round(e)+"px)"}:A.translate=function(i,n,e){i.style.top=Math.round(e)+"px",i.style.left=Math.round(n)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(w,A,I){var f=w("./dom");A.get=function(v,m){var a=new XMLHttpRequest;a.open("GET",v,!0),a.onreadystatechange=function(){a.readyState===4&&m(a.responseText)},a.send(null)},A.loadScript=function(v,m){var a=f.getDocumentHead(),l=document.createElement("script");l.src=v,a.appendChild(l),l.onload=l.onreadystatechange=function(t,o){(o||!l.readyState||l.readyState=="loaded"||l.readyState=="complete")&&(l=l.onload=l.onreadystatechange=null,o||m())}},A.qualifyURL=function(v){var m=document.createElement("a");return m.href=v,m.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(w,A,I){A.inherits=function(f,v){f.super_=v,f.prototype=Object.create(v.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}})},A.mixin=function(f,v){for(var m in v)f[m]=v[m];return f},A.implement=function(f,v){A.mixin(f,v)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(w,A,I){var f={},v=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};f._emit=f._dispatchEvent=function(a,l){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var t=this._eventRegistry[a]||[],o=this._defaultHandlers[a];if(!(!t.length&&!o)){(typeof l!="object"||!l)&&(l={}),l.type||(l.type=a),l.stopPropagation||(l.stopPropagation=v),l.preventDefault||(l.preventDefault=m),t=t.slice();for(var i=0;i<t.length&&(t[i](l,this),!l.propagationStopped);i++);if(o&&!l.defaultPrevented)return o(l,this)}},f._signal=function(a,l){var t=(this._eventRegistry||{})[a];if(t){t=t.slice();for(var o=0;o<t.length;o++)t[o](l,this)}},f.once=function(a,l){var t=this;if(this.on(a,function o(){t.off(a,o),l.apply(null,arguments)}),!l)return new Promise(function(o){l=o})},f.setDefaultHandler=function(a,l){var t=this._defaultHandlers;if(t||(t=this._defaultHandlers={_disabled_:{}}),t[a]){var o=t[a],i=t._disabled_[a];i||(t._disabled_[a]=i=[]),i.push(o);var n=i.indexOf(l);n!=-1&&i.splice(n,1)}t[a]=l},f.removeDefaultHandler=function(a,l){var t=this._defaultHandlers;if(t){var o=t._disabled_[a];if(t[a]==l)o&&this.setDefaultHandler(a,o.pop());else if(o){var i=o.indexOf(l);i!=-1&&o.splice(i,1)}}},f.on=f.addEventListener=function(a,l,t){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[a];return o||(o=this._eventRegistry[a]=[]),o.indexOf(l)==-1&&o[t?"unshift":"push"](l),l},f.off=f.removeListener=f.removeEventListener=function(a,l){this._eventRegistry=this._eventRegistry||{};var t=this._eventRegistry[a];if(t){var o=t.indexOf(l);o!==-1&&t.splice(o,1)}},f.removeAllListeners=function(a){a||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[a]=void 0),this._defaultHandlers&&(this._defaultHandlers[a]=void 0)},A.EventEmitter=f}),ace.define("ace/lib/report_error",["require","exports","module"],function(w,A,I){A.reportError=function(v,m){var a=new Error(v);a.data=m,typeof console=="object"&&console.error&&console.error(a),setTimeout(function(){throw a})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(w,A,I){var f={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor gutter","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions","editor.tooltip.disable-editing":"Editing is disabled"};A.defaultEnglishMessages=f}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(w,A,I){"no use strict";var f=w("./oop"),v=w("./event_emitter").EventEmitter,m=w("./report_error").reportError,a=w("./default_english_messages").defaultEnglishMessages,l={setOptions:function(e){Object.keys(e).forEach(function(r){this.setOption(r,e[r])},this)},getOptions:function(e){var r={};if(e)Array.isArray(e)||(e=Object.keys(e));else{var s=this.$options;e=Object.keys(s).filter(function(c){return!s[c].hidden})}return e.forEach(function(c){r[c]=this.getOption(c)},this),r},setOption:function(e,r){if(this["$"+e]!==r){var s=this.$options[e];if(!s)return t('misspelled option "'+e+'"');if(s.forwardTo)return this[s.forwardTo]&&this[s.forwardTo].setOption(e,r);s.handlesSet||(this["$"+e]=r),s&&s.set&&s.set.call(this,r)}},getOption:function(e){var r=this.$options[e];return r?r.forwardTo?this[r.forwardTo]&&this[r.forwardTo].getOption(e):r&&r.get?r.get.call(this):this["$"+e]:t('misspelled option "'+e+'"')}};function t(e){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,i,n=(function(){function e(){this.$defaultOptions={},o=a,i="dollarSigns"}return e.prototype.defineOptions=function(r,s,c){return r.$options||(this.$defaultOptions[s]=r.$options={}),Object.keys(c).forEach(function(u){var _=c[u];typeof _=="string"&&(_={forwardTo:_}),_.name||(_.name=u),r.$options[_.name]=_,"initialValue"in _&&(r["$"+_.name]=_.initialValue)}),f.implement(r,l),this},e.prototype.resetOptions=function(r){Object.keys(r.$options).forEach(function(s){var c=r.$options[s];"value"in c&&r.setOption(s,c.value)})},e.prototype.setDefaultValue=function(r,s,c){if(!r){for(r in this.$defaultOptions)if(this.$defaultOptions[r][s])break;if(!this.$defaultOptions[r][s])return!1}var u=this.$defaultOptions[r]||(this.$defaultOptions[r]={});u[s]&&(u.forwardTo?this.setDefaultValue(u.forwardTo,s,c):u[s].value=c)},e.prototype.setDefaultValues=function(r,s){Object.keys(s).forEach(function(c){this.setDefaultValue(r,c,s[c])},this)},e.prototype.setMessages=function(r,s){o=r,s&&s.placeholders&&(i=s.placeholders)},e.prototype.nls=function(r,s,c){o[r]||(t("No message found for the key '"+r+"' in messages with id "+o.$id+", trying to find a translation for the default string '"+s+"'."),o[s]||t("No message found for the default string '"+s+"' in the provided messages. Falling back to the default English message."));var u=o[r]||o[s]||s;return c&&(i==="dollarSigns"&&(u=u.replace(/\$(\$|[\d]+)/g,function(_,b){return b=="$"?"$":c[b]})),i==="curlyBrackets"&&(u=u.replace(/\{([^\}]+)\}/g,function(_,b){return c[b]}))),u},e})();n.prototype.warn=t,n.prototype.reportError=m,f.implement(n.prototype,v),A.AppConfig=n}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(w,A,I){I.exports=`.ace-tm .ace_gutter {
3
3
  background: #f0f0f0;
4
4
  color: #333;
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./EJSAceEditor-D2dSaoYC.js","./jsx-runtime-qZ4C1rVi.js","./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js","./_commonjsHelpers-DsqdWQfm.js","./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./index-DYmfCyJR.js","./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js","./preload-helper-BDBacUwf.js"])))=>i.map(i=>d[i]);
2
- import{j as _}from"./jsx-runtime-qZ4C1rVi.js";import{P}from"./index-DYmfCyJR.js";import{v as fe,a as he}from"./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js";import{v as w,R as A}from"./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js";import{v as x,a as F}from"./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{g as pe,a as _e}from"./_commonjsHelpers-DsqdWQfm.js";const{loadShare:ge}=he,{initPromise:ve}=fe,ye=ve.then(e=>ge("@iobroker/adapter-react-v5",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),we=await ye.then(e=>e());var T=we,G=function(e,n,t,i){function l(o){return o instanceof t?o:new t(function(c){c(o)})}return new(t||(t=Promise))(function(o,c){function m(h){try{u(i.next(h))}catch(p){c(p)}}function v(h){try{u(i.throw(h))}catch(p){c(p)}}function u(h){h.done?o(h.value):l(h.value).then(m,v)}u((i=i.apply(e,n||[])).next())})};const Q=["background-color","border","background","background-image","background-position","background-repeat","background-size","background-clip","background-origin","color","box-sizing","border-width","border-style","border-color","border-radius","box-shadow","text-align","text-shadow","font-family","font-size","font-weight","line-height","font-style","font-variant","letter-spacing","word-spacing"];class ee extends w.Component{constructor(n){super(n),this.refService=A.createRef(),this.getIdSubscribeState=(i,l)=>G(this,void 0,void 0,function*(){const o=yield this.props.context.socket.getState(i);this.props.context.socket.subscribeState(i,()=>l(i,o))}),this.onStateChanged=this.onStateChanged.bind(this);const t=this.props.context.views[this.props.view].widgets[this.props.id];this.state={values:{},data:JSON.parse(JSON.stringify(t.data||{})),style:JSON.parse(JSON.stringify(t.style||{})),rxData:JSON.parse(JSON.stringify(t.data||{})),rxStyle:JSON.parse(JSON.stringify(t.style||{}))},this.linkContext={IDs:[],bindings:{},visibility:{},lastChanges:{},signals:{},widgetAttrInfo:{}}}getWidgetInfo(){throw new Error("not implemented")}static getI18nPrefix(){return""}static getText(n){return n?typeof n=="object"?n[T.I18n.getLanguage()]||n.en:n:""}static t(n,...t){return T.I18n.t(`${this.getI18nPrefix()}${n}`,...t)}static getLanguage(){return T.I18n.getLanguage()}renderWidgetBody(n){return null}onStateUpdated(n,t){}formatValue(n,t){var i;return typeof n=="number"&&(t===0?n=Math.round(n):n=Math.round(n*100)/100,!((i=this.props.context.systemConfig)===null||i===void 0)&&i.common&&this.props.context.systemConfig.common.isFloatComma&&(n=n.toString().replace(".",","))),n==null?"":n.toString()}wrapContent(n,t,i,l,o,c){var m,v;const u=(c==null?void 0:c.Card)||x.Card,h=(c==null?void 0:c.CardContent)||x.CardContent,p=Object.assign({width:"calc(100% - 8px)",height:"calc(100% - 8px)",margin:4},(v=(m=this.props.customSettings)===null||m===void 0?void 0:m.viewStyle)===null||v===void 0?void 0:v.visCard);Object.keys(this.state.rxStyle).forEach(b=>{const I=this.state.rxStyle[b];I!=null&&Q.includes(b)&&(b=b.replace(/(-\w)/g,L=>L[1].toUpperCase()),p[b]=I)}),this.wrappedContent=!0;const E=this.state.rxData.widgetTitle;return A.createElement(u,{className:"vis_rx_widget_card",style:p,onClick:o},A.createElement(h,{className:"vis_rx_widget_card_content",style:Object.assign({display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100% - 32px)",paddingBottom:16,position:"relative"},i)},E?A.createElement("div",{className:"vis_rx_widget_card_name",style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"}},A.createElement("div",{className:"vis_rx_widget_card_name_div",style:Object.assign({fontSize:24,paddingTop:0,paddingBottom:4},l)},E),t||null):t||null,n))}onStateChanged(n,t){if(!t)return;const i=JSON.parse(JSON.stringify(this.state.values));t.val!==void 0&&(i[`${n}.val`]=t.val),t.ts!==void 0&&(i[`${n}.ts`]=t.ts),t.from!==void 0&&(i[`${n}.from`]=t.from),t.lc!==void 0&&(i[`${n}.lc`]=t.lc),t.ts!==void 0&&(i[`${n}.ts`]=t.ts),this.onStateUpdated(n,t),this.setState({values:i})}componentDidMount(){return G(this,void 0,void 0,function*(){var n,t;(t=(n=this.getWidgetInfo())===null||n===void 0?void 0:n.visAttrs)===null||t===void 0||t.forEach(i=>{var l;return(l=i==null?void 0:i.fields)===null||l===void 0?void 0:l.forEach(o=>{(o==null?void 0:o.type)==="id"&&Object.keys(this.state.data).forEach(c=>{if(c.match(new RegExp(`^${o.name}[0-9]*$`))){const m=this.state.data[c];this.linkContext.IDs.includes(m)||this.linkContext.IDs.push(m)}})})});for(let i=0;i<this.linkContext.IDs.length;i++)yield this.getIdSubscribeState(this.linkContext.IDs[i],this.onStateChanged)})}componentWillUnmount(){this.linkContext.IDs.forEach(n=>this.props.context.socket.unsubscribeState(n,this.onStateChanged))}getWidgetView(n,t){return A.createElement("div",{style:{width:"100%",height:"100%"}},"DEMO VIEW")}getWidgetInWidget(n,t,i){return null}render(){var n,t;return A.createElement("div",{ref:this.refService,style:{width:(n=this.state.style)===null||n===void 0?void 0:n.width,height:(t=this.state.style)===null||t===void 0?void 0:t.height}},this.renderWidgetBody({className:"",overlayClassNames:[],style:{},id:"defaultID",refService:this.refService,widget:{tpl:"tplDemo",data:{},style:{},widgetSet:"demoSet"}}))}}ee.POSSIBLE_MUI_STYLES=Q;const be=e=>{const n=w.useRef(null),[t,i]=w.useState(!!e.fullScreen),l=w.useRef(t),{onResize:o,resizable:c}=e,[m,v]=w.useState({height:600,width:typeof e.minWidth=="number"?Math.max(e.minWidth+48,900):900});return w.useEffect(()=>{if(!c||t||!n.current)return;const u=n.current,h=new ResizeObserver(()=>{if(l.current)return;const p=u.getBoundingClientRect();v(E=>Math.abs(E.width-p.width)<1&&Math.abs(E.height-p.height)<1?E:{width:p.width,height:p.height}),o==null||o()});return h.observe(u),()=>h.disconnect()},[t,o,c]),w.useEffect(()=>{const u=requestAnimationFrame(()=>o==null?void 0:o());return()=>cancelAnimationFrame(u)},[t,o]),e.open?_.jsxs(x.Dialog,{onClose:e.closeDisabled?void 0:e.onClose,open:!0,fullScreen:t,maxWidth:e.resizable?!1:e.maxWidth||"md",slotProps:{paper:{ref:n,sx:e.resizable&&!t?{boxSizing:"border-box",height:m.height,maxHeight:"calc(100vh - 64px)",maxWidth:"calc(100vw - 64px)",minHeight:360,minWidth:e.minWidth||500,overflow:"hidden",resize:"both",width:m.width}:void 0}},children:[_.jsxs(x.DialogTitle,{sx:{alignItems:"center",display:"flex",gap:1},children:[_.jsx(x.Box,{sx:{flexGrow:1},children:e.noTranslation?e.title:T.I18n.t(e.title)}),e.onSearch?_.jsx(x.IconButton,{"aria-label":"Search",onClick:e.onSearch,title:"Search",children:_.jsx(F.Search,{})}):null,e.resizable?_.jsx(x.IconButton,{"aria-label":t?"Restore window":"Full screen",onClick:()=>{const u=!t;if(u&&n.current){const h=n.current.getBoundingClientRect();v({height:h.height,width:h.width})}l.current=u,i(u)},title:t?"Restore window":"Full screen",children:t?_.jsx(F.FullscreenExit,{}):_.jsx(F.Fullscreen,{})}):null]}),_.jsx(x.DialogContent,{sx:{display:"flex",flexDirection:"column",minHeight:0,minWidth:e.minWidth||void 0},onKeyUp:u=>{e.action&&!e.actionDisabled&&!e.keyboardDisabled&&u.key==="Enter"&&(e.action(),e.actionNoClose||e.onClose())},children:e.children}),_.jsxs(x.DialogActions,{children:[e.dialogActions||null,e.actionTitle?_.jsx(x.Button,{variant:"contained",onClick:()=>{e.action&&e.action(),e.actionNoClose||e.onClose()},color:e.actionColor||"primary",disabled:e.actionDisabled,startIcon:e.ActionIcon?_.jsx(e.ActionIcon,{}):void 0,children:e.noTranslation?e.actionTitle:T.I18n.t(e.actionTitle)}):null,_.jsx(x.Button,{variant:"contained",sx:{backgroundColor:"grey"},onClick:e.onClose,disabled:e.closeDisabled,startIcon:_.jsx(F.Close,{}),children:e.noTranslation&&e.closeTitle?e.closeTitle:T.I18n.t(e.closeTitle||"Cancel")})]})]}):null},Se=w.lazy(()=>me(()=>import("./EJSAceEditor-D2dSaoYC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),Ee=e=>{const[n,t]=w.useState(""),i=w.useRef(null),l=w.useCallback(()=>{var c,m;return(m=(c=i.current)==null?void 0:c.editor)==null?void 0:m.resize()},[]),o=w.useCallback(()=>{var c,m;return(m=(c=i.current)==null?void 0:c.editor)==null?void 0:m.execCommand("find")},[]);return w.useEffect(()=>{t(e.value)},[e.open,e.value]),e.open?_.jsx(be,{keyboardDisabled:!0,title:T.I18n.t("vis-jsontemplate_json_dialog_title"),open:!0,actionTitle:T.I18n.t("vis-jsontemplate_json_dialog_save"),action:()=>e.onChange(n),onClose:e.onClose,minWidth:800,actionDisabled:n===e.value,onResize:l,onSearch:o,resizable:!0,children:_.jsx(w.Suspense,{fallback:null,children:_.jsx(Se,{value:n,focus:!0,height:"100%",onChange:c=>t(c),refEditor:i,themeType:e.themeType})})}):null},Ce=({field:e,data:n,onDataChange:t,props:i})=>{const[o,c]=w.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsx(x.TextField,{sx:{".MuiInputBase-input":{fontSize:"80%"}},size:"small",variant:"standard",value:(n==null?void 0:n[e.name])??"",fullWidth:!0,error:!1,helperText:T.I18n.t(""),onChange:m=>{t({[e.name]:m.target.value})},slotProps:{input:{endAdornment:_.jsx(x.Button,{size:"small","aria-label":T.I18n.t("vis-jsontemplate_json_dialog_title"),onClick:()=>c(!0),children:_.jsx(F.Edit,{})})}},rows:2}),o?_.jsx(Ee,{open:!0,value:(n==null?void 0:n[e.name])??"",onChange:m=>t({[e.name]:m}),onClose:()=>c(!1),themeType:i.context.theme.name}):null]})};function xe(){return window}function je(e,n){const t=(e||"").trim();return t?`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./EJSAceEditor-q4P5vgCv.js","./jsx-runtime-qZ4C1rVi.js","./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js","./_commonjsHelpers-DsqdWQfm.js","./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./index-DYmfCyJR.js","./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js","./preload-helper-BDBacUwf.js"])))=>i.map(i=>d[i]);
2
+ import{j as _}from"./jsx-runtime-qZ4C1rVi.js";import{P}from"./index-DYmfCyJR.js";import{v as fe,a as he}from"./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js";import{v as w,R as A}from"./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js";import{v as x,a as F}from"./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js";import{_ as me}from"./preload-helper-BDBacUwf.js";import{g as pe,a as _e}from"./_commonjsHelpers-DsqdWQfm.js";const{loadShare:ge}=he,{initPromise:ve}=fe,ye=ve.then(e=>ge("@iobroker/adapter-react-v5",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),we=await ye.then(e=>e());var T=we,G=function(e,n,t,i){function l(o){return o instanceof t?o:new t(function(c){c(o)})}return new(t||(t=Promise))(function(o,c){function m(h){try{u(i.next(h))}catch(p){c(p)}}function v(h){try{u(i.throw(h))}catch(p){c(p)}}function u(h){h.done?o(h.value):l(h.value).then(m,v)}u((i=i.apply(e,n||[])).next())})};const Q=["background-color","border","background","background-image","background-position","background-repeat","background-size","background-clip","background-origin","color","box-sizing","border-width","border-style","border-color","border-radius","box-shadow","text-align","text-shadow","font-family","font-size","font-weight","line-height","font-style","font-variant","letter-spacing","word-spacing"];class ee extends w.Component{constructor(n){super(n),this.refService=A.createRef(),this.getIdSubscribeState=(i,l)=>G(this,void 0,void 0,function*(){const o=yield this.props.context.socket.getState(i);this.props.context.socket.subscribeState(i,()=>l(i,o))}),this.onStateChanged=this.onStateChanged.bind(this);const t=this.props.context.views[this.props.view].widgets[this.props.id];this.state={values:{},data:JSON.parse(JSON.stringify(t.data||{})),style:JSON.parse(JSON.stringify(t.style||{})),rxData:JSON.parse(JSON.stringify(t.data||{})),rxStyle:JSON.parse(JSON.stringify(t.style||{}))},this.linkContext={IDs:[],bindings:{},visibility:{},lastChanges:{},signals:{},widgetAttrInfo:{}}}getWidgetInfo(){throw new Error("not implemented")}static getI18nPrefix(){return""}static getText(n){return n?typeof n=="object"?n[T.I18n.getLanguage()]||n.en:n:""}static t(n,...t){return T.I18n.t(`${this.getI18nPrefix()}${n}`,...t)}static getLanguage(){return T.I18n.getLanguage()}renderWidgetBody(n){return null}onStateUpdated(n,t){}formatValue(n,t){var i;return typeof n=="number"&&(t===0?n=Math.round(n):n=Math.round(n*100)/100,!((i=this.props.context.systemConfig)===null||i===void 0)&&i.common&&this.props.context.systemConfig.common.isFloatComma&&(n=n.toString().replace(".",","))),n==null?"":n.toString()}wrapContent(n,t,i,l,o,c){var m,v;const u=(c==null?void 0:c.Card)||x.Card,h=(c==null?void 0:c.CardContent)||x.CardContent,p=Object.assign({width:"calc(100% - 8px)",height:"calc(100% - 8px)",margin:4},(v=(m=this.props.customSettings)===null||m===void 0?void 0:m.viewStyle)===null||v===void 0?void 0:v.visCard);Object.keys(this.state.rxStyle).forEach(b=>{const I=this.state.rxStyle[b];I!=null&&Q.includes(b)&&(b=b.replace(/(-\w)/g,L=>L[1].toUpperCase()),p[b]=I)}),this.wrappedContent=!0;const E=this.state.rxData.widgetTitle;return A.createElement(u,{className:"vis_rx_widget_card",style:p,onClick:o},A.createElement(h,{className:"vis_rx_widget_card_content",style:Object.assign({display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100% - 32px)",paddingBottom:16,position:"relative"},i)},E?A.createElement("div",{className:"vis_rx_widget_card_name",style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"}},A.createElement("div",{className:"vis_rx_widget_card_name_div",style:Object.assign({fontSize:24,paddingTop:0,paddingBottom:4},l)},E),t||null):t||null,n))}onStateChanged(n,t){if(!t)return;const i=JSON.parse(JSON.stringify(this.state.values));t.val!==void 0&&(i[`${n}.val`]=t.val),t.ts!==void 0&&(i[`${n}.ts`]=t.ts),t.from!==void 0&&(i[`${n}.from`]=t.from),t.lc!==void 0&&(i[`${n}.lc`]=t.lc),t.ts!==void 0&&(i[`${n}.ts`]=t.ts),this.onStateUpdated(n,t),this.setState({values:i})}componentDidMount(){return G(this,void 0,void 0,function*(){var n,t;(t=(n=this.getWidgetInfo())===null||n===void 0?void 0:n.visAttrs)===null||t===void 0||t.forEach(i=>{var l;return(l=i==null?void 0:i.fields)===null||l===void 0?void 0:l.forEach(o=>{(o==null?void 0:o.type)==="id"&&Object.keys(this.state.data).forEach(c=>{if(c.match(new RegExp(`^${o.name}[0-9]*$`))){const m=this.state.data[c];this.linkContext.IDs.includes(m)||this.linkContext.IDs.push(m)}})})});for(let i=0;i<this.linkContext.IDs.length;i++)yield this.getIdSubscribeState(this.linkContext.IDs[i],this.onStateChanged)})}componentWillUnmount(){this.linkContext.IDs.forEach(n=>this.props.context.socket.unsubscribeState(n,this.onStateChanged))}getWidgetView(n,t){return A.createElement("div",{style:{width:"100%",height:"100%"}},"DEMO VIEW")}getWidgetInWidget(n,t,i){return null}render(){var n,t;return A.createElement("div",{ref:this.refService,style:{width:(n=this.state.style)===null||n===void 0?void 0:n.width,height:(t=this.state.style)===null||t===void 0?void 0:t.height}},this.renderWidgetBody({className:"",overlayClassNames:[],style:{},id:"defaultID",refService:this.refService,widget:{tpl:"tplDemo",data:{},style:{},widgetSet:"demoSet"}}))}}ee.POSSIBLE_MUI_STYLES=Q;const be=e=>{const n=w.useRef(null),[t,i]=w.useState(!!e.fullScreen),l=w.useRef(t),{onResize:o,resizable:c}=e,[m,v]=w.useState({height:600,width:typeof e.minWidth=="number"?Math.max(e.minWidth+48,900):900});return w.useEffect(()=>{if(!c||t||!n.current)return;const u=n.current,h=new ResizeObserver(()=>{if(l.current)return;const p=u.getBoundingClientRect();v(E=>Math.abs(E.width-p.width)<1&&Math.abs(E.height-p.height)<1?E:{width:p.width,height:p.height}),o==null||o()});return h.observe(u),()=>h.disconnect()},[t,o,c]),w.useEffect(()=>{const u=requestAnimationFrame(()=>o==null?void 0:o());return()=>cancelAnimationFrame(u)},[t,o]),e.open?_.jsxs(x.Dialog,{onClose:e.closeDisabled?void 0:e.onClose,open:!0,fullScreen:t,maxWidth:e.resizable?!1:e.maxWidth||"md",slotProps:{paper:{ref:n,sx:e.resizable&&!t?{boxSizing:"border-box",height:m.height,maxHeight:"calc(100vh - 64px)",maxWidth:"calc(100vw - 64px)",minHeight:360,minWidth:e.minWidth||500,overflow:"hidden",resize:"both",width:m.width}:void 0}},children:[_.jsxs(x.DialogTitle,{sx:{alignItems:"center",display:"flex",gap:1},children:[_.jsx(x.Box,{sx:{flexGrow:1},children:e.noTranslation?e.title:T.I18n.t(e.title)}),e.onSearch?_.jsx(x.IconButton,{"aria-label":"Search",onClick:e.onSearch,title:"Search",children:_.jsx(F.Search,{})}):null,e.resizable?_.jsx(x.IconButton,{"aria-label":t?"Restore window":"Full screen",onClick:()=>{const u=!t;if(u&&n.current){const h=n.current.getBoundingClientRect();v({height:h.height,width:h.width})}l.current=u,i(u)},title:t?"Restore window":"Full screen",children:t?_.jsx(F.FullscreenExit,{}):_.jsx(F.Fullscreen,{})}):null]}),_.jsx(x.DialogContent,{sx:{display:"flex",flexDirection:"column",minHeight:0,minWidth:e.minWidth||void 0},onKeyUp:u=>{e.action&&!e.actionDisabled&&!e.keyboardDisabled&&u.key==="Enter"&&(e.action(),e.actionNoClose||e.onClose())},children:e.children}),_.jsxs(x.DialogActions,{children:[e.dialogActions||null,e.actionTitle?_.jsx(x.Button,{variant:"contained",onClick:()=>{e.action&&e.action(),e.actionNoClose||e.onClose()},color:e.actionColor||"primary",disabled:e.actionDisabled,startIcon:e.ActionIcon?_.jsx(e.ActionIcon,{}):void 0,children:e.noTranslation?e.actionTitle:T.I18n.t(e.actionTitle)}):null,_.jsx(x.Button,{variant:"contained",sx:{backgroundColor:"grey"},onClick:e.onClose,disabled:e.closeDisabled,startIcon:_.jsx(F.Close,{}),children:e.noTranslation&&e.closeTitle?e.closeTitle:T.I18n.t(e.closeTitle||"Cancel")})]})]}):null},Se=w.lazy(()=>me(()=>import("./EJSAceEditor-q4P5vgCv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),Ee=e=>{const[n,t]=w.useState(""),i=w.useRef(null),l=w.useCallback(()=>{var c,m;return(m=(c=i.current)==null?void 0:c.editor)==null?void 0:m.resize()},[]),o=w.useCallback(()=>{var c,m;return(m=(c=i.current)==null?void 0:c.editor)==null?void 0:m.execCommand("find")},[]);return w.useEffect(()=>{t(e.value)},[e.open,e.value]),e.open?_.jsx(be,{keyboardDisabled:!0,title:T.I18n.t("vis-jsontemplate_json_dialog_title"),open:!0,actionTitle:T.I18n.t("vis-jsontemplate_json_dialog_save"),action:()=>e.onChange(n),onClose:e.onClose,minWidth:800,actionDisabled:n===e.value,onResize:l,onSearch:o,resizable:!0,children:_.jsx(w.Suspense,{fallback:null,children:_.jsx(Se,{value:n,focus:!0,height:"100%",onChange:c=>t(c),refEditor:i,themeType:e.themeType})})}):null},Ce=({field:e,data:n,onDataChange:t,props:i})=>{const[o,c]=w.useState(!1);return _.jsxs(_.Fragment,{children:[_.jsx(x.TextField,{sx:{".MuiInputBase-input":{fontSize:"80%"}},size:"small",variant:"standard",value:(n==null?void 0:n[e.name])??"",fullWidth:!0,error:!1,helperText:T.I18n.t(""),onChange:m=>{t({[e.name]:m.target.value})},slotProps:{input:{endAdornment:_.jsx(x.Button,{size:"small","aria-label":T.I18n.t("vis-jsontemplate_json_dialog_title"),onClick:()=>c(!0),children:_.jsx(F.Edit,{})})}},rows:2}),o?_.jsx(Ee,{open:!0,value:(n==null?void 0:n[e.name])??"",onChange:m=>t({[e.name]:m}),onClose:()=>c(!1),themeType:i.context.theme.name}):null]})};function xe(){return window}function je(e,n){const t=(e||"").trim();return t?`
3
3
  (() => {
4
4
  const __cleanupKey = ${JSON.stringify(n)};
5
5
  const __cleanupStore = (window.__visJsonTemplateCleanup = window.__visJsonTemplateCleanup || {});
@@ -77,4 +77,4 @@ try {
77
77
  `;break;case y.modes.ESCAPED:this.source+=" ; __append(escapeFn("+q(s)+`))
78
78
  `;break;case y.modes.RAW:this.source+=" ; __append("+q(s)+`)
79
79
  `;break;case y.modes.COMMENT:break;case y.modes.LITERAL:this._addOutput(s);break}}else this._addOutput(s)}d.opts.compileDebug&&g&&(this.currentLine+=g,this.source+=" ; __line = "+this.currentLine+`
80
- `)}},e.escapeXML=i.escapeXML,e.__express=e.renderFile,e.VERSION=o,e.name=h,typeof window<"u"&&(window.ejs=e)})(ie);const Ve=_e(ie);function $e(e){if(e==null||e==="")return{};if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return{}}}function ze(e,n){const t={},i=Math.max(0,Number((e==null?void 0:e.dpcount)||1));for(let l=1;l<=i;l++){const o=e[`json_dp${l}`]||e[`json_dp-${l}`]||e[`datapoint-oid${l}`];o&&(t[o]=n==null?void 0:n[`${o}.val`])}return t}const $=new Set(["widgetid","widgetID","data","dp","style","widget","I18n"]),Ue=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"]);function se(e){return typeof e!="string"||!e?!1:/^[$_\p{ID_Start}][$\u200C\u200D_\p{ID_Continue}]*$/u.test(e)&&!Ue.has(e)}function z(e,n){const t=(e==null?void 0:e[`json_dp_variable${n}`])??(e==null?void 0:e[`json_dp_variable-${n}`])??"";return typeof t=="string"?t.trim():""}function He(e,n){const t=z(e,n);if(!t)return!1;const i=new Set([t,`${t}_value`]);if([...i].some(o=>!se(o))||[...i].some(o=>$.has(o)))return!0;const l=Math.max(0,Number((e==null?void 0:e.dpcount)||1));for(let o=1;o<=l;o++){if(o===n)continue;const c=z(e,o);if(c&&(i.has(c)||i.has(`${c}_value`)))return!0}return!1}function Be(e,n){const t={},i=new Set,l=Math.max(0,Number((e==null?void 0:e.dpcount)||1));for(let o=1;o<=l;o++){const c=z(e,o);if(!c)continue;if(!se(c))throw new Error(`Invalid JavaScript variable name: ${c}`);const m=`${c}_value`;if($.has(c)||$.has(m))throw new Error(`Variable name is already used by the template context: ${c}`);if(i.has(c)||i.has(m))throw new Error(`Variable name is used more than once: ${c}`);i.add(c),i.add(m);const v=e[`json_dp${o}`]||e[`json_dp-${o}`]||e[`datapoint-oid${o}`];v&&(Object.defineProperty(t,c,{value:v,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(t,m,{value:n==null?void 0:n[`${v}.val`],enumerable:!0,configurable:!0,writable:!0}))}return t}async function qe(e,n){return Ve.render(e,n,{async:!0})}function Ke(e){const n=document.createElement("textarea");return n.textContent=String(e),n.innerHTML}class k extends(window.visRxWidget||ee){constructor(n){super(n);const t=this.state;this.state={...t,renderedHtml:" ",renderVersion:0},this._currentAssetKey="",this._assetsReady=!1,this._renderSeq=0}get widgetState(){return this.state}static getWidgetInfo(){return{id:"tplJSONTemplate4",visSet:"vis-jsontemplate",visSetLabel:"json_jsontemplate",visName:"JSON Widget",visAttrs:[{name:"common",fields:[{name:"oid",type:"id",label:"json_oid"},{name:"template",type:"custom",label:"json_template",component:(n,t,i,l)=>_.jsx(Ce,{visSocket:l.context.socket,field:n,data:t,onDataChange:i,props:l})},{name:"dpcount",type:"number",default:1,min:1,max:Number.MAX_SAFE_INTEGER,step:1,label:"json_dpcount",onChange:(n,t,i)=>{const l=Number(t.dpcount||1);for(let o=1;o<=l;o++)t[`g_datapoints-${o}`]=!0;i(t)}},{name:"scriptcount",type:"number",default:1,min:1,max:Number.MAX_SAFE_INTEGER,step:1,label:"json_scriptcount",onChange:(n,t,i)=>{const l=Number(t.scriptcount||1);for(let o=1;o<=l;o++)t[`g_scriptfiles-${o}`]=!0;i(t)}},{name:"csscount",type:"number",default:1,min:1,max:Number.MAX_SAFE_INTEGER,step:1,label:"json_csscount",onChange:(n,t,i)=>{const l=Number(t.csscount||1);for(let o=1;o<=l;o++)t[`g_cssfiles-${o}`]=!0;i(t)}}]},{name:"datapoints",label:"json_datapointsgroup",indexFrom:1,indexTo:"dpcount",onChange:(n,t,i)=>{i(t)},fields:[{name:"json_dp",label:"json_datapoints_oid",type:"id"},{name:"json_dp_variable",label:"json_datapoints_variable",tooltip:"json_datapoints_variable_tooltip",type:"text",noBinding:!0,error:(n,t)=>He(n,t)}]},{name:"scriptfiles",label:"json_scriptsgroup",indexFrom:1,indexTo:"scriptcount",onChange:(n,t,i)=>{i(t)},fields:[{name:"scriptfile",label:"json_scriptfile",type:"text"}]},{name:"cssfiles",label:"json_cssgroup",indexFrom:1,indexTo:"csscount",onChange:(n,t,i)=>{i(t)},fields:[{name:"cssfile",label:"json_cssfile",type:"text"}]}],visDefaultStyle:{width:300,height:300},visPrev:"widgets/vis2vis-jsontemplate/img/jsontemplate.png"}}componentDidMount(){super.componentDidMount(),this.propertiesUpdate()}getWidgetInfo(){return k.getWidgetInfo()}static getI18nPrefix(){return"vis-jsontemplate_"}onRxDataChanged(){this.propertiesUpdate()}onRxStyleChanged(){this.propertiesUpdate()}onStateUpdated(n,t){const i={...this.widgetState.values};(t==null?void 0:t.val)!==void 0&&(i[`${n}.val`]=t.val),this.propertiesUpdate(i)}async ensureAssetsLoaded(n){const{scripts:t,css:i}=Le(n),l=De(t,i);if(this._currentAssetKey===l&&this._assetsReady)return;this._currentAssetKey=l,this._assetsReady=!1;const o=l;await Pe(t,i),this._currentAssetKey===o&&(this._assetsReady=!0)}async propertiesUpdate(n=this.widgetState.values){const t=++this._renderSeq;try{const i=this.widgetState.data||{},l=this.widgetState.rxData||i,o=this.widgetState.style;if(await this.ensureAssetsLoaded(i),t!==this._renderSeq)return;const c=(l==null?void 0:l.oid)||(i==null?void 0:i.oid),m=c?n==null?void 0:n[`${c}.val`]:void 0,v=$e(m),u=ze(i,n),h=Be(i,n),p=(i==null?void 0:i.template)||"",E=await qe(p,{...h,widgetid:this.props.id,widgetID:this.props.id,data:v,dp:u,style:o,widget:i,I18n:T.I18n});if(t!==this._renderSeq)return;const b=`${E} `;this.setState(I=>({renderedHtml:b,renderVersion:I.renderVersion+1}))}catch(i){if(t!==this._renderSeq)return;const l=i instanceof Error?i.message:String(i);let o=Ke(l).replace(/(?:\r\n|\r|\n)/g,"<br>");o=o.replace(/ /gm,"&nbsp;");const c=`<code style="color:red;">${o}</code>`;this.setState(m=>({renderedHtml:c,renderVersion:m.renderVersion+1}))}}renderWidgetBody(n){return super.renderWidgetBody(n),_.jsx(Ae,{html:this.widgetState.renderedHtml,renderVersion:this.widgetState.renderVersion})}}k.propTypes={systemConfig:P.object,socket:P.object,style:P.object,data:P.object,id:P.string};const nt=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));export{nt as J,T as v};
80
+ `)}},e.escapeXML=i.escapeXML,e.__express=e.renderFile,e.VERSION=o,e.name=h,typeof window<"u"&&(window.ejs=e)})(ie);const Ve=_e(ie);function $e(e){if(e==null||e==="")return{};if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return{}}}function ze(e,n){const t={},i=Math.max(0,Number((e==null?void 0:e.dpcount)||1));for(let l=1;l<=i;l++){const o=e[`json_dp${l}`]||e[`json_dp-${l}`]||e[`datapoint-oid${l}`];o&&(t[o]=n==null?void 0:n[`${o}.val`])}return t}const $=new Set(["widgetid","widgetID","data","dp","style","widget","I18n"]),Ue=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","implements","import","in","instanceof","interface","let","new","null","package","private","protected","public","return","static","super","switch","this","throw","true","try","typeof","var","void","while","with","yield"]);function se(e){return typeof e!="string"||!e?!1:/^[$_\p{ID_Start}][$\u200C\u200D_\p{ID_Continue}]*$/u.test(e)&&!Ue.has(e)}function z(e,n){const t=(e==null?void 0:e[`json_dp_variable${n}`])??(e==null?void 0:e[`json_dp_variable-${n}`])??"";return typeof t=="string"?t.trim():""}function He(e,n){const t=z(e,n);if(!t)return!1;const i=new Set([t,`${t}_value`]);if([...i].some(o=>!se(o))||[...i].some(o=>$.has(o)))return!0;const l=Math.max(0,Number((e==null?void 0:e.dpcount)||1));for(let o=1;o<=l;o++){if(o===n)continue;const c=z(e,o);if(c&&(i.has(c)||i.has(`${c}_value`)))return!0}return!1}function Be(e,n){const t={},i=new Set,l=Math.max(0,Number((e==null?void 0:e.dpcount)||1));for(let o=1;o<=l;o++){const c=z(e,o);if(!c)continue;if(!se(c))throw new Error(`Invalid JavaScript variable name: ${c}`);const m=`${c}_value`;if($.has(c)||$.has(m))throw new Error(`Variable name is already used by the template context: ${c}`);if(i.has(c)||i.has(m))throw new Error(`Variable name is used more than once: ${c}`);i.add(c),i.add(m);const v=e[`json_dp${o}`]||e[`json_dp-${o}`]||e[`datapoint-oid${o}`];v&&(Object.defineProperty(t,c,{value:v,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(t,m,{value:n==null?void 0:n[`${v}.val`],enumerable:!0,configurable:!0,writable:!0}))}return t}async function qe(e,n){return Ve.render(e,n,{async:!0})}function Ke(e){const n=document.createElement("textarea");return n.textContent=String(e),n.innerHTML}class k extends(window.visRxWidget||ee){constructor(n){super(n);const t=this.state;this.state={...t,renderedHtml:" ",renderVersion:0},this._currentAssetKey="",this._assetsReady=!1,this._renderSeq=0}get widgetState(){return this.state}static getWidgetInfo(){return{id:"tplJSONTemplate4",visSet:"vis-jsontemplate",visSetLabel:"json_jsontemplate",visName:"JSON Widget",visAttrs:[{name:"common",fields:[{name:"oid",type:"id",label:"json_oid"},{name:"template",type:"custom",label:"json_template",component:(n,t,i,l)=>_.jsx(Ce,{visSocket:l.context.socket,field:n,data:t,onDataChange:i,props:l})},{name:"dpcount",type:"number",default:1,min:1,max:Number.MAX_SAFE_INTEGER,step:1,label:"json_dpcount",onChange:(n,t,i)=>{const l=Number(t.dpcount||1);for(let o=1;o<=l;o++)t[`g_datapoints-${o}`]=!0;i(t)}},{name:"scriptcount",type:"number",default:1,min:1,max:Number.MAX_SAFE_INTEGER,step:1,label:"json_scriptcount",onChange:(n,t,i)=>{const l=Number(t.scriptcount||1);for(let o=1;o<=l;o++)t[`g_scriptfiles-${o}`]=!0;i(t)}},{name:"csscount",type:"number",default:1,min:1,max:Number.MAX_SAFE_INTEGER,step:1,label:"json_csscount",onChange:(n,t,i)=>{const l=Number(t.csscount||1);for(let o=1;o<=l;o++)t[`g_cssfiles-${o}`]=!0;i(t)}}]},{name:"datapoints",label:"json_datapointsgroup",indexFrom:1,indexTo:"dpcount",onChange:(n,t,i)=>{i(t)},fields:[{name:"json_dp",label:"json_datapoints_oid",type:"id"},{name:"json_dp_variable",label:"json_datapoints_variable",tooltip:"json_datapoints_variable_tooltip",type:"text",noBinding:!0,error:(n,t)=>He(n,t)}]},{name:"scriptfiles",label:"json_scriptsgroup",indexFrom:1,indexTo:"scriptcount",onChange:(n,t,i)=>{i(t)},fields:[{name:"scriptfile",label:"json_scriptfile",type:"text"}]},{name:"cssfiles",label:"json_cssgroup",indexFrom:1,indexTo:"csscount",onChange:(n,t,i)=>{i(t)},fields:[{name:"cssfile",label:"json_cssfile",type:"text"}]}],visDefaultStyle:{width:300,height:300},visPrev:"widgets/vis2vis-jsontemplate/img/jsontemplate.png"}}componentDidMount(){super.componentDidMount(),this.propertiesUpdate()}getWidgetInfo(){return k.getWidgetInfo()}static getI18nPrefix(){return"vis-jsontemplate_"}onRxDataChanged(){this.propertiesUpdate()}onRxStyleChanged(){this.propertiesUpdate()}onStateUpdated(n,t){const i={...this.widgetState.values};(t==null?void 0:t.val)!==void 0&&(i[`${n}.val`]=t.val),this.propertiesUpdate(i)}async ensureAssetsLoaded(n){const{scripts:t,css:i}=Le(n),l=De(t,i);if(this._currentAssetKey===l&&this._assetsReady)return;this._currentAssetKey=l,this._assetsReady=!1;const o=l;await Pe(t,i),this._currentAssetKey===o&&(this._assetsReady=!0)}async propertiesUpdate(n=this.widgetState.values){const t=++this._renderSeq;try{const i=this.widgetState.data||{},l=this.widgetState.rxData||i,o=this.widgetState.style;if(await this.ensureAssetsLoaded(i),t!==this._renderSeq)return;const c=(l==null?void 0:l.oid)||(i==null?void 0:i.oid),m=c?n==null?void 0:n[`${c}.val`]:void 0,v=$e(m),u=ze(i,n),h=Be(i,n),p=(i==null?void 0:i.template)||"",E=await qe(p,{...h,widgetid:this.props.id,widgetID:this.props.id,data:v,dp:u,style:o,widget:i,I18n:T.I18n});if(t!==this._renderSeq)return;const b=`${E} `;this.setState(I=>({renderedHtml:b,renderVersion:I.renderVersion+1}))}catch(i){if(t!==this._renderSeq)return;const l=i instanceof Error?i.message:String(i);let o=Ke(l).replace(/(?:\r\n|\r|\n)/g,"<br>");console.error(l),o=o.replace(/ /gm,"&nbsp;");const c=`<code style="color:red;">${o}</code>`;this.setState(m=>({renderedHtml:c,renderVersion:m.renderVersion+1}))}}renderWidgetBody(n){return super.renderWidgetBody(n),_.jsx(Ae,{html:this.widgetState.renderedHtml,renderVersion:this.widgetState.renderVersion})}}k.propTypes={systemConfig:P.object,socket:P.object,style:P.object,data:P.object,id:P.string};const nt=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));export{nt as J,T as v};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../customWidgets.js","./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./virtualExposes-D1kD3d-x.js","./preload-helper-BDBacUwf.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../customWidgets.js","./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./virtualExposes-DaLISvQh.js","./preload-helper-BDBacUwf.js"])))=>i.map(i=>d[i]);
2
2
  import{_ as i}from"./preload-helper-BDBacUwf.js";const r=i(()=>import("../customWidgets.js"),__vite__mapDeps([0,1,2,3]),import.meta.url);Promise.resolve(r).then(e=>Promise.resolve(e.__tla).then(e.init).catch(e.init));
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./JSONTemplateWidget-BxJj3J2G.js","./jsx-runtime-qZ4C1rVi.js","./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js","./_commonjsHelpers-DsqdWQfm.js","./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./index-DYmfCyJR.js","./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js","./preload-helper-BDBacUwf.js"])))=>i.map(i=>d[i]);
2
- import{_ as o}from"./preload-helper-BDBacUwf.js";const s={"./JSONTemplateWidget":async()=>{const t=await o(()=>import("./JSONTemplateWidget-BxJj3J2G.js").then(r=>r.J),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),e={};return Object.assign(e,t),Object.defineProperty(e,"__esModule",{value:!0,enumerable:!1}),e},"./translations":async()=>{const t=await o(()=>import("./translations-BLfiYlPH.js"),[],import.meta.url),e={};return Object.assign(e,t),Object.defineProperty(e,"__esModule",{value:!0,enumerable:!1}),e}};export{s as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./JSONTemplateWidget-BrIGyvVS.js","./jsx-runtime-qZ4C1rVi.js","./vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js","./_commonjsHelpers-DsqdWQfm.js","./vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./index-DYmfCyJR.js","./vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js","./preload-helper-BDBacUwf.js"])))=>i.map(i=>d[i]);
2
+ import{_ as o}from"./preload-helper-BDBacUwf.js";const s={"./JSONTemplateWidget":async()=>{const t=await o(()=>import("./JSONTemplateWidget-BrIGyvVS.js").then(r=>r.J),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),e={};return Object.assign(e,t),Object.defineProperty(e,"__esModule",{value:!0,enumerable:!1}),e},"./translations":async()=>{const t=await o(()=>import("./translations-BLfiYlPH.js"),[],import.meta.url),e={};return Object.assign(e,t),Object.defineProperty(e,"__esModule",{value:!0,enumerable:!1}),e}};export{s as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-CLFlWYIu.js","./assets/defaultTheme-C8WuaZ7a.js","./assets/vis2visjsonTemplateWidgets__loadShare__react__loadShare__-0QLxPQ7P.js","./assets/_commonjsHelpers-DsqdWQfm.js","./assets/vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js","./assets/vis2visjsonTemplateWidgets__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BKKWnUxj.js","./assets/index-DYmfCyJR.js","./assets/useTheme-D9YWiQkn.js","./assets/index-DjWtqlw1.js","./assets/jsx-runtime-qZ4C1rVi.js","./assets/createSvgIcon-CEbEJbZ6.js","./assets/index-DbRsMwdu.js","./assets/index-DN8zaYv1.js","./assets/index-DbFKRAxQ.js"])))=>i.map(i=>d[i]);
2
- import{i as d,v as p}from"./assets/vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js";import s from"./assets/virtualExposes-D1kD3d-x.js";import{_ as o}from"./assets/preload-helper-BDBacUwf.js";const i={"@iobroker/adapter-react-v5":async()=>await o(()=>import("./assets/index-CLFlWYIu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),"@mui/icons-material":async()=>await o(()=>import("./assets/index-DjWtqlw1.js"),__vite__mapDeps([8,9,2,3,4,10,1]),import.meta.url),"@mui/material":async()=>await o(()=>import("./assets/index-DbRsMwdu.js"),__vite__mapDeps([11,1,2,3,4,10,9,7,6]),import.meta.url),react:async()=>await o(()=>import("./assets/index-DN8zaYv1.js").then(r=>r.i),__vite__mapDeps([12,3]),import.meta.url),"react-dom":async()=>await o(()=>import("./assets/index-DbFKRAxQ.js").then(r=>r.i),__vite__mapDeps([13,3,2,4]),import.meta.url)},a={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"8.3.2",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/icons-material":{name:"@mui/icons-material",version:"6.5.0",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["@mui/icons-material"].loaded=!0;const{"@mui/icons-material":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.5.0",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["@mui/material"].loaded=!0;const{"@mui/material":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a.react.loaded=!0;const{react:e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["react-dom"].loaded=!0;const{"react-dom":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}}},f=[],u={},l="default",m="vis2visjsonTemplateWidgets";async function y(e={},r=[]){const t=d({name:m,remotes:f,shared:a,plugins:[],shareStrategy:"version-first"});var n=u[l];if(n||(n=u[l]={from:m}),!(r.indexOf(n)>=0)){r.push(n),t.initShareScopeMap("default",e);try{await Promise.all(await t.initializeSharing("default",{strategy:"version-first",from:"build",initScope:r}))}catch(c){console.error(c)}return p.initResolve(t),t}}function k(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(r=>()=>r)}export{k as get,y as init};
2
+ import{i as d,v as p}from"./assets/vis2visjsonTemplateWidgets__mf_v__runtimeInit__mf_v__-CTz9hcql.js";import s from"./assets/virtualExposes-DaLISvQh.js";import{_ as o}from"./assets/preload-helper-BDBacUwf.js";const i={"@iobroker/adapter-react-v5":async()=>await o(()=>import("./assets/index-CLFlWYIu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url),"@mui/icons-material":async()=>await o(()=>import("./assets/index-DjWtqlw1.js"),__vite__mapDeps([8,9,2,3,4,10,1]),import.meta.url),"@mui/material":async()=>await o(()=>import("./assets/index-DbRsMwdu.js"),__vite__mapDeps([11,1,2,3,4,10,9,7,6]),import.meta.url),react:async()=>await o(()=>import("./assets/index-DN8zaYv1.js").then(r=>r.i),__vite__mapDeps([12,3]),import.meta.url),"react-dom":async()=>await o(()=>import("./assets/index-DbFKRAxQ.js").then(r=>r.i),__vite__mapDeps([13,3,2,4]),import.meta.url)},a={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"8.3.2",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/icons-material":{name:"@mui/icons-material",version:"6.5.0",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["@mui/icons-material"].loaded=!0;const{"@mui/icons-material":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.5.0",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["@mui/material"].loaded=!0;const{"@mui/material":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a.react.loaded=!0;const{react:e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"vis2visjsonTemplateWidgets",async get(){a["react-dom"].loaded=!0;const{"react-dom":e}=i,t={...await e()};return Object.defineProperty(t,"__esModule",{value:!0,enumerable:!1}),function(){return t}},shareConfig:{singleton:!0,requiredVersion:"*"}}},f=[],u={},l="default",m="vis2visjsonTemplateWidgets";async function y(e={},r=[]){const t=d({name:m,remotes:f,shared:a,plugins:[],shareStrategy:"version-first"});var n=u[l];if(n||(n=u[l]={from:m}),!(r.indexOf(n)>=0)){r.push(n),t.initShareScopeMap("default",e);try{await Promise.all(await t.initializeSharing("default",{strategy:"version-first",from:"build",initScope:r}))}catch(c){console.error(c)}return p.initResolve(t),t}}function k(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(r=>()=>r)}export{k as get,y as init};