iobroker.vis-jsontemplate 4.0.1 → 4.0.2
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 +4 -0
- package/io-package.json +14 -14
- package/package.json +1 -1
- package/widgets/vis-jsontemplate/dist/jsontemplate-dist.js +1 -1
- package/widgets/vis-jsontemplate/dist/jsontemplate-dist.js.map +1 -1
- package/widgets/vis2vis-jsontemplate/assets/{index-s1k6Tdvt.js → index-M14hy5bj.js} +39 -39
- package/widgets/vis2vis-jsontemplate/customWidgets.js +2 -2
package/README.md
CHANGED
|
@@ -507,6 +507,10 @@ Loop over the attributes of an object
|
|
|
507
507
|
Placeholder for the next version (at the beginning of the line):
|
|
508
508
|
### **WORK IN PROGRESS**
|
|
509
509
|
-->
|
|
510
|
+
### 4.0.2 (2025-08-28)
|
|
511
|
+
|
|
512
|
+
- remove v4.0.0 from io-package
|
|
513
|
+
|
|
510
514
|
### 4.0.1 (2025-08-28)
|
|
511
515
|
|
|
512
516
|
- move vis1 and vis2 widgets to vis-jsontemplate adapter
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "vis-jsontemplate",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"4.0.2": {
|
|
7
|
+
"en": "remove v4.0.0 from io-package",
|
|
8
|
+
"de": "entfernen v4.0.0 von io-package",
|
|
9
|
+
"ru": "удалить v4.0.0 из пакета io",
|
|
10
|
+
"pt": "remover v4.0.0 do pacote io",
|
|
11
|
+
"nl": "v4.0.0 uit io-package verwijderen",
|
|
12
|
+
"fr": "supprimer v4.0.0 du io-package",
|
|
13
|
+
"it": "rimuovere v4.0.0 da io-package",
|
|
14
|
+
"es": "quitar v4.0.0 de io-paquete",
|
|
15
|
+
"pl": "usunąć v4.0.0 z opakowania jo-",
|
|
16
|
+
"uk": "remove v4.0.0 від io-package",
|
|
17
|
+
"zh-cn": "从 io 包装中删除 v4. 0.0"
|
|
18
|
+
},
|
|
6
19
|
"4.0.1": {
|
|
7
20
|
"en": "move vis1 and vis2 widgets to vis-jsontemplate adapter",
|
|
8
21
|
"de": "vis1 und vis2 widgets zu vis-jsontemplate adapter verschieben",
|
|
@@ -15,19 +28,6 @@
|
|
|
15
28
|
"pl": "przesuń widżety vis1 i vis2 do adaptera vis- jsonszablon",
|
|
16
29
|
"uk": "перемістіть віджети vis1 і vis2 до адаптера vis-jsontemplate",
|
|
17
30
|
"zh-cn": "将粘度1和粘度2的部件移动到粘度调试器上"
|
|
18
|
-
},
|
|
19
|
-
"4.0.0": {
|
|
20
|
-
"en": "initial release",
|
|
21
|
-
"de": "Erstveröffentlichung",
|
|
22
|
-
"ru": "Начальная версия",
|
|
23
|
-
"pt": "lançamento inicial",
|
|
24
|
-
"nl": "Eerste uitgave",
|
|
25
|
-
"fr": "Première version",
|
|
26
|
-
"it": "Versione iniziale",
|
|
27
|
-
"es": "Versión inicial",
|
|
28
|
-
"pl": "Pierwsze wydanie",
|
|
29
|
-
"uk": "Початкова версія",
|
|
30
|
-
"zh-cn": "首次出版"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"titleLang": {
|
package/package.json
CHANGED
|
@@ -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.0.1\",\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\": \"^3.8.0\",\n \"@alcalzone/release-script-plugin-iobroker\": \"^3.7.2\",\n \"@alcalzone/release-script-plugin-license\": \"^3.7.0\",\n \"@alcalzone/release-script-plugin-manual-review\": \"^3.7.0\",\n \"@iobroker/build-tools\": \"^2.0.15\",\n \"@iobroker/eslint-config\": \"^2.1.0\",\n \"@iobroker/vis-2-widgets-react-dev\": \"^4.0.4\",\n \"@iobroker/vis-2-widgets-testing\": \"^1.0.6\",\n \"@iobroker/adapter-dev\": \"^1.4.0\",\n \"@iobroker/testing\": \"^5.1.0\",\n \"@types/gulp\": \"^4.0.17\",\n \"@types/mocha\": \"^10.0.10\",\n \"@types/node\": \"^24.3.0\",\n \"mocha\": \"^11.7.1\"\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\": \"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 i -f && cd src-widgets && npm i -f && cd ..\",\n \"debug\": \"npx dev-server watch --noStart --doNotWatch widgets/vis2vis-jsontemplate/**\",\n \"repochecker\": \"npx github:oweitman/ioBroker.repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate --local\",\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/i18n/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\n// add translations for edit mode\nimport { version as pkgVersion } from '../../../package.json';\n\nfetch('widgets/vis-jsontemplate/i18n/words.json').then(async res => {\n const i18n = await res.json();\n\n $.extend(true, systemDictionary, i18n);\n});\n\n// this code can be placed directly in jsontemplate.html\nvis.binds['jsontemplate'] = {\n version: pkgVersion,\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: 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 if (bound) {\n if (!vis.editMode) {\n vis.binds['jsontemplate'].bindStates(\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 this.render(widgetID, view, data);\n // let text = '';\n // try {\n // text = ejs.render(template, { widgetID: widgetID, data: oiddata, dp: datapoints });\n // } catch (e) {\n // text = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n // text = text.replace(/ /gm, ' ');\n // text = `<code style=\"color:red;\">${text}</code>`;\n // }\n // $(`#${widgetID}`).html(text);\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) {\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 text = await ejs.render(\n template,\n { widgetID: widgetID, data: oiddata, dp: datapoints },\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, ' ');\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 /**\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};\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\n/*\nRemember JSON Path finder https://github.com/joebeachjoebeach/json-path-finder\nRemember JSON Formatter https://github.com/mohsen1/json-formatter-js\n\n*/\n", "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.ejs = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[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\nvar fs = require('fs');\r\nvar path = require('path');\r\nvar utils = require('./utils');\r\n\r\nvar scopeOptionWarned = false;\r\nvar _VERSION_STRING = require('../package.json').version;\r\nvar _DEFAULT_OPEN_DELIMITER = '<';\r\nvar _DEFAULT_CLOSE_DELIMITER = '>';\r\nvar _DEFAULT_DELIMITER = '%';\r\nvar _DEFAULT_LOCALS_NAME = 'locals';\r\nvar _NAME = 'ejs';\r\nvar _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)';\r\nvar _OPTS_PASSABLE_WITH_DATA = ['delimiter', 'scope', 'context', 'debug', 'compileDebug',\r\n 'client', '_with', 'rmWhitespace', 'strict', 'filename', 'async'];\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\nvar _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache');\r\nvar _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\nexports.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\nexports.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\nexports.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\nexports.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\nexports.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\nfunction 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 (Array.isArray(views) && views.some(function (v) {\r\n filePath = exports.resolveInclude(path, v, true);\r\n return fs.existsSync(filePath);\r\n })) {\r\n includePath = filePath;\r\n }\r\n }\r\n if (!includePath) {\r\n throw new Error('Could not find the include file \"' +\r\n options.escapeFunction(path) + '\"');\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\nfunction 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 }\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 '\r\n + '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\nfunction 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 }\r\n catch (err) {\r\n reject(err);\r\n }\r\n });\r\n }\r\n else {\r\n throw new Error('Please provide a callback function');\r\n }\r\n }\r\n else {\r\n try {\r\n result = handleCache(options)(data);\r\n }\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\nfunction 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\nfunction 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\nfunction 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.slice(start, end).map(function (line, i){\r\n var curr = i + start + 1;\r\n return (curr == lineno ? ' >> ' : ' ')\r\n + curr\r\n + '| '\r\n + line;\r\n }).join('\\n');\r\n\r\n // Alter exception message\r\n err.path = filename;\r\n err.message = (filename || 'ejs') + ':'\r\n + lineno + '\\n'\r\n + context + '\\n\\n'\r\n + err.message;\r\n\r\n throw err;\r\n}\r\n\r\nfunction 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\nexports.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\nexports.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\nexports.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 }\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\nexports.Template = Template;\r\n\r\nexports.clearCache = function () {\r\n exports.cache.reset();\r\n};\r\n\r\nfunction 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 = 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 }\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\nTemplate.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\nTemplate.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)\r\n .replace(/</g, open)\r\n .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 = 'var __line = 1' + '\\n'\r\n + ' , __lines = ' + JSON.stringify(this.templateText) + '\\n'\r\n + ' , __filename = ' + (opts.filename ?\r\n JSON.stringify(opts.filename) : 'undefined') + ';' + '\\n'\r\n + 'try {' + '\\n'\r\n + this.source\r\n + '} catch (e) {' + '\\n'\r\n + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\\n'\r\n + '}' + '\\n';\r\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'\r\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 }\r\n catch(e) {\r\n if (e instanceof SyntaxError) {\r\n throw new Error('This environment does not support async/await');\r\n }\r\n else {\r\n throw e;\r\n }\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 }\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 += '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 ? fn : 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) {/* ignore */}\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 =\r\n this.templateText.replace(/[\\r\\n]+/g, '\\n').replace(/^\\s+|\\s+$/gm, '');\r\n }\r\n\r\n // Slurp spaces and tabs before <%_ and after _%>\r\n this.templateText =\r\n this.templateText.replace(/[ \\t]*<%_/gm, '<%_').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 ( line.indexOf(o + d) === 0 // If it is a tag\r\n && line.indexOf(o + d + d) !== 0) { // 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\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 += ' ; __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\nexports.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\nexports.__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\nexports.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\nexports.name = _NAME;\r\n\r\n/* istanbul ignore if */\r\nif (typeof window != 'undefined') {\r\n window.ejs = exports;\r\n}\r\n\r\n},{\"../package.json\":6,\"./utils\":2,\"fs\":3,\"path\":4}],2:[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\nvar 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\nexports.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\nvar _ENCODE_HTML_RULES = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n \"'\": '''\r\n};\r\nvar _MATCH_HTML = /[&<>'\"]/g;\r\n\r\nfunction 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\nvar escapeFuncStr =\r\n 'var _ENCODE_HTML_RULES = {\\n'\r\n+ ' \"&\": \"&\"\\n'\r\n+ ' , \"<\": \"<\"\\n'\r\n+ ' , \">\": \">\"\\n'\r\n+ ' , \\'\"\\': \""\"\\n'\r\n+ ' , \"\\'\": \"'\"\\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\nexports.escapeXML = function (markup) {\r\n return markup == undefined\r\n ? ''\r\n : String(markup)\r\n .replace(_MATCH_HTML, encode_char);\r\n};\r\nexports.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\nexports.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\nexports.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\nexports.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},{}],3:[function(require,module,exports){\r\n\r\n},{}],4:[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\nfunction 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\nvar splitPathRe =\r\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\r\nvar 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\nexports.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(filter(resolvedPath.split('/'), function(p) {\r\n return !!p;\r\n }), !resolvedAbsolute).join('/');\r\n\r\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\r\n};\r\n\r\n// path.normalize(path)\r\n// posix version\r\nexports.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(filter(path.split('/'), function(p) {\r\n return !!p;\r\n }), !isAbsolute).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\nexports.isAbsolute = function(path) {\r\n return path.charAt(0) === '/';\r\n};\r\n\r\n// posix version\r\nexports.join = function() {\r\n var paths = Array.prototype.slice.call(arguments, 0);\r\n return exports.normalize(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\nexports.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\nexports.sep = '/';\r\nexports.delimiter = ':';\r\n\r\nexports.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\r\nexports.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\r\nexports.extname = function(path) {\r\n return splitPath(path)[3];\r\n};\r\n\r\nfunction 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\nvar substr = 'ab'.substr(-1) === 'b'\r\n ? function (str, start, len) { return str.substr(start, len) }\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;\r\n\r\n}).call(this,require('_process'))\r\n},{\"_process\":5}],5:[function(require,module,exports){\r\n// shim for using process in browser\r\nvar 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\nvar cachedSetTimeout;\r\nvar cachedClearTimeout;\r\n\r\nfunction defaultSetTimout() {\r\n throw new Error('setTimeout has not been defined');\r\n}\r\nfunction 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\nfunction 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\r\n}\r\nfunction 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\r\n\r\n}\r\nvar queue = [];\r\nvar draining = false;\r\nvar currentQueue;\r\nvar queueIndex = -1;\r\n\r\nfunction 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\nfunction 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\nprocess.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\nfunction Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n}\r\nItem.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n};\r\nprocess.title = 'browser';\r\nprocess.browser = true;\r\nprocess.env = {};\r\nprocess.argv = [];\r\nprocess.version = ''; // empty string to avoid regexp issues\r\nprocess.versions = {};\r\n\r\nfunction noop() {}\r\n\r\nprocess.on = noop;\r\nprocess.addListener = noop;\r\nprocess.once = noop;\r\nprocess.off = noop;\r\nprocess.removeListener = noop;\r\nprocess.removeAllListeners = noop;\r\nprocess.emit = noop;\r\nprocess.prependListener = noop;\r\nprocess.prependOnceListener = noop;\r\n\r\nprocess.listeners = function (name) { return [] }\r\n\r\nprocess.binding = function (name) {\r\n throw new Error('process.binding is not supported');\r\n};\r\n\r\nprocess.cwd = function () { return '/' };\r\nprocess.chdir = function (dir) {\r\n throw new Error('process.chdir is not supported');\r\n};\r\nprocess.umask = function() { return 0; };\r\n\r\n},{}],6:[function(require,module,exports){\r\nmodule.exports={\r\n \"name\": \"ejs\",\r\n \"description\": \"Embedded JavaScript templates\",\r\n \"keywords\": [\r\n \"template\",\r\n \"engine\",\r\n \"ejs\"\r\n ],\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},{}]},{},[1])(1)\r\n});\r\n", "import './jsontemplate.js';\nimport './ejs.js';\n"],
|
|
4
|
+
"sourcesContent": ["{\n \"name\": \"iobroker.vis-jsontemplate\",\n \"version\": \"4.0.2\",\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\": \"^3.8.0\",\n \"@alcalzone/release-script-plugin-iobroker\": \"^3.7.2\",\n \"@alcalzone/release-script-plugin-license\": \"^3.7.0\",\n \"@alcalzone/release-script-plugin-manual-review\": \"^3.7.0\",\n \"@iobroker/build-tools\": \"^2.0.15\",\n \"@iobroker/eslint-config\": \"^2.1.0\",\n \"@iobroker/vis-2-widgets-react-dev\": \"^4.0.4\",\n \"@iobroker/vis-2-widgets-testing\": \"^1.0.6\",\n \"@iobroker/adapter-dev\": \"^1.4.0\",\n \"@iobroker/testing\": \"^5.1.0\",\n \"@types/gulp\": \"^4.0.17\",\n \"@types/mocha\": \"^10.0.10\",\n \"@types/node\": \"^24.3.0\",\n \"mocha\": \"^11.7.1\"\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\": \"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 i -f && cd src-widgets && npm i -f && cd ..\",\n \"debug\": \"npx dev-server watch --noStart --doNotWatch widgets/vis2vis-jsontemplate/**\",\n \"repochecker\": \"npx github:oweitman/ioBroker.repochecker https://github.com/oweitman/ioBroker.vis-jsontemplate --local\",\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/i18n/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\n// add translations for edit mode\nimport { version as pkgVersion } from '../../../package.json';\n\nfetch('widgets/vis-jsontemplate/i18n/words.json').then(async res => {\n const i18n = await res.json();\n\n $.extend(true, systemDictionary, i18n);\n});\n\n// this code can be placed directly in jsontemplate.html\nvis.binds['jsontemplate'] = {\n version: pkgVersion,\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: 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 if (bound) {\n if (!vis.editMode) {\n vis.binds['jsontemplate'].bindStates(\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 this.render(widgetID, view, data);\n // let text = '';\n // try {\n // text = ejs.render(template, { widgetID: widgetID, data: oiddata, dp: datapoints });\n // } catch (e) {\n // text = vis.binds['jsontemplate'].escapeHTML(e.message).replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n // text = text.replace(/ /gm, ' ');\n // text = `<code style=\"color:red;\">${text}</code>`;\n // }\n // $(`#${widgetID}`).html(text);\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) {\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 text = await ejs.render(\n template,\n { widgetID: widgetID, data: oiddata, dp: datapoints },\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, ' ');\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 /**\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};\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\n/*\nRemember JSON Path finder https://github.com/joebeachjoebeach/json-path-finder\nRemember JSON Formatter https://github.com/mohsen1/json-formatter-js\n\n*/\n", "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.ejs = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[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\nvar fs = require('fs');\r\nvar path = require('path');\r\nvar utils = require('./utils');\r\n\r\nvar scopeOptionWarned = false;\r\nvar _VERSION_STRING = require('../package.json').version;\r\nvar _DEFAULT_OPEN_DELIMITER = '<';\r\nvar _DEFAULT_CLOSE_DELIMITER = '>';\r\nvar _DEFAULT_DELIMITER = '%';\r\nvar _DEFAULT_LOCALS_NAME = 'locals';\r\nvar _NAME = 'ejs';\r\nvar _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)';\r\nvar _OPTS_PASSABLE_WITH_DATA = ['delimiter', 'scope', 'context', 'debug', 'compileDebug',\r\n 'client', '_with', 'rmWhitespace', 'strict', 'filename', 'async'];\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\nvar _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat('cache');\r\nvar _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\nexports.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\nexports.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\nexports.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\nexports.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\nexports.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\nfunction 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 (Array.isArray(views) && views.some(function (v) {\r\n filePath = exports.resolveInclude(path, v, true);\r\n return fs.existsSync(filePath);\r\n })) {\r\n includePath = filePath;\r\n }\r\n }\r\n if (!includePath) {\r\n throw new Error('Could not find the include file \"' +\r\n options.escapeFunction(path) + '\"');\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\nfunction 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 }\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 '\r\n + '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\nfunction 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 }\r\n catch (err) {\r\n reject(err);\r\n }\r\n });\r\n }\r\n else {\r\n throw new Error('Please provide a callback function');\r\n }\r\n }\r\n else {\r\n try {\r\n result = handleCache(options)(data);\r\n }\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\nfunction 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\nfunction 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\nfunction 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.slice(start, end).map(function (line, i){\r\n var curr = i + start + 1;\r\n return (curr == lineno ? ' >> ' : ' ')\r\n + curr\r\n + '| '\r\n + line;\r\n }).join('\\n');\r\n\r\n // Alter exception message\r\n err.path = filename;\r\n err.message = (filename || 'ejs') + ':'\r\n + lineno + '\\n'\r\n + context + '\\n\\n'\r\n + err.message;\r\n\r\n throw err;\r\n}\r\n\r\nfunction 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\nexports.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\nexports.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\nexports.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 }\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\nexports.Template = Template;\r\n\r\nexports.clearCache = function () {\r\n exports.cache.reset();\r\n};\r\n\r\nfunction 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 = 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 }\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\nTemplate.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\nTemplate.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)\r\n .replace(/</g, open)\r\n .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 = 'var __line = 1' + '\\n'\r\n + ' , __lines = ' + JSON.stringify(this.templateText) + '\\n'\r\n + ' , __filename = ' + (opts.filename ?\r\n JSON.stringify(opts.filename) : 'undefined') + ';' + '\\n'\r\n + 'try {' + '\\n'\r\n + this.source\r\n + '} catch (e) {' + '\\n'\r\n + ' rethrow(e, __lines, __filename, __line, escapeFn);' + '\\n'\r\n + '}' + '\\n';\r\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'\r\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 }\r\n catch(e) {\r\n if (e instanceof SyntaxError) {\r\n throw new Error('This environment does not support async/await');\r\n }\r\n else {\r\n throw e;\r\n }\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 }\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 += '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 ? fn : 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) {/* ignore */}\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 =\r\n this.templateText.replace(/[\\r\\n]+/g, '\\n').replace(/^\\s+|\\s+$/gm, '');\r\n }\r\n\r\n // Slurp spaces and tabs before <%_ and after _%>\r\n this.templateText =\r\n this.templateText.replace(/[ \\t]*<%_/gm, '<%_').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 ( line.indexOf(o + d) === 0 // If it is a tag\r\n && line.indexOf(o + d + d) !== 0) { // 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\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 += ' ; __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\nexports.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\nexports.__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\nexports.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\nexports.name = _NAME;\r\n\r\n/* istanbul ignore if */\r\nif (typeof window != 'undefined') {\r\n window.ejs = exports;\r\n}\r\n\r\n},{\"../package.json\":6,\"./utils\":2,\"fs\":3,\"path\":4}],2:[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\nvar 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\nexports.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\nvar _ENCODE_HTML_RULES = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n \"'\": '''\r\n};\r\nvar _MATCH_HTML = /[&<>'\"]/g;\r\n\r\nfunction 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\nvar escapeFuncStr =\r\n 'var _ENCODE_HTML_RULES = {\\n'\r\n+ ' \"&\": \"&\"\\n'\r\n+ ' , \"<\": \"<\"\\n'\r\n+ ' , \">\": \">\"\\n'\r\n+ ' , \\'\"\\': \""\"\\n'\r\n+ ' , \"\\'\": \"'\"\\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\nexports.escapeXML = function (markup) {\r\n return markup == undefined\r\n ? ''\r\n : String(markup)\r\n .replace(_MATCH_HTML, encode_char);\r\n};\r\nexports.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\nexports.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\nexports.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\nexports.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},{}],3:[function(require,module,exports){\r\n\r\n},{}],4:[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\nfunction 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\nvar splitPathRe =\r\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\r\nvar 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\nexports.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(filter(resolvedPath.split('/'), function(p) {\r\n return !!p;\r\n }), !resolvedAbsolute).join('/');\r\n\r\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\r\n};\r\n\r\n// path.normalize(path)\r\n// posix version\r\nexports.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(filter(path.split('/'), function(p) {\r\n return !!p;\r\n }), !isAbsolute).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\nexports.isAbsolute = function(path) {\r\n return path.charAt(0) === '/';\r\n};\r\n\r\n// posix version\r\nexports.join = function() {\r\n var paths = Array.prototype.slice.call(arguments, 0);\r\n return exports.normalize(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\nexports.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\nexports.sep = '/';\r\nexports.delimiter = ':';\r\n\r\nexports.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\r\nexports.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\r\nexports.extname = function(path) {\r\n return splitPath(path)[3];\r\n};\r\n\r\nfunction 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\nvar substr = 'ab'.substr(-1) === 'b'\r\n ? function (str, start, len) { return str.substr(start, len) }\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;\r\n\r\n}).call(this,require('_process'))\r\n},{\"_process\":5}],5:[function(require,module,exports){\r\n// shim for using process in browser\r\nvar 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\nvar cachedSetTimeout;\r\nvar cachedClearTimeout;\r\n\r\nfunction defaultSetTimout() {\r\n throw new Error('setTimeout has not been defined');\r\n}\r\nfunction 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\nfunction 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\r\n}\r\nfunction 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\r\n\r\n}\r\nvar queue = [];\r\nvar draining = false;\r\nvar currentQueue;\r\nvar queueIndex = -1;\r\n\r\nfunction 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\nfunction 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\nprocess.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\nfunction Item(fun, array) {\r\n this.fun = fun;\r\n this.array = array;\r\n}\r\nItem.prototype.run = function () {\r\n this.fun.apply(null, this.array);\r\n};\r\nprocess.title = 'browser';\r\nprocess.browser = true;\r\nprocess.env = {};\r\nprocess.argv = [];\r\nprocess.version = ''; // empty string to avoid regexp issues\r\nprocess.versions = {};\r\n\r\nfunction noop() {}\r\n\r\nprocess.on = noop;\r\nprocess.addListener = noop;\r\nprocess.once = noop;\r\nprocess.off = noop;\r\nprocess.removeListener = noop;\r\nprocess.removeAllListeners = noop;\r\nprocess.emit = noop;\r\nprocess.prependListener = noop;\r\nprocess.prependOnceListener = noop;\r\n\r\nprocess.listeners = function (name) { return [] }\r\n\r\nprocess.binding = function (name) {\r\n throw new Error('process.binding is not supported');\r\n};\r\n\r\nprocess.cwd = function () { return '/' };\r\nprocess.chdir = function (dir) {\r\n throw new Error('process.chdir is not supported');\r\n};\r\nprocess.umask = function() { return 0; };\r\n\r\n},{}],6:[function(require,module,exports){\r\nmodule.exports={\r\n \"name\": \"ejs\",\r\n \"description\": \"Embedded JavaScript templates\",\r\n \"keywords\": [\r\n \"template\",\r\n \"engine\",\r\n \"ejs\"\r\n ],\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},{}]},{},[1])(1)\r\n});\r\n", "import './jsontemplate.js';\nimport './ejs.js';\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAEE;AAFF;AAAA;AAEE,gBAAW;AAAA;AAAA;;;ACFb;AAAA;AAAA;AAWA;AAEA,YAAM,0CAA0C,EAAE,KAAK,CAAM,QAAO;AAChE,cAAM,OAAO,MAAM,IAAI,KAAK;AAE5B,UAAE,OAAO,MAAM,kBAAkB,IAAI;AAAA,MACzC,EAAC;AAGD,UAAI,MAAM,cAAc,IAAI;AAAA,QACxB;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,aAAa,WAAY;AACrB,cAAI,IAAI,MAAM,cAAc,EAAE,SAAS;AACnC,oBAAQ,IAAI,yBAAyB,IAAI,MAAM,cAAc,EAAE,OAAO,EAAE;AACxE,gBAAI,MAAM,cAAc,EAAE,UAAU;AAAA,UACxC;AAAA,QACJ;AAAA,QACA,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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