node-red-contrib-power-saver 3.4.4 → 3.5.0
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/.github/workflows/{firebase-hosting-merge.yml → publish-doc-on-merge.yml} +6 -6
- package/.github/workflows/publish-to-npm.yml +23 -0
- package/.github/workflows/test-on-pull-request.yaml +13 -0
- package/docs/.vuepress/components/BestSaveVerificator.vue +1 -0
- package/docs/.vuepress/config.js +6 -43
- package/docs/.vuepress/navbar.js +43 -0
- package/docs/changelog/README.md +7 -1
- package/docs/examples/example-cascade-temperature-control.md +0 -13
- package/docs/examples/example-heat-capacitor.md +9 -20
- package/docs/examples/example-nordpool-current-state.md +0 -13
- package/docs/examples/example-nordpool-events-state.md +0 -13
- package/docs/examples/example-tibber-mqtt.md +0 -13
- package/docs/guide/README.md +20 -12
- package/docs/images/best-save-config.png +0 -0
- package/docs/images/lowest-price-config.png +0 -0
- package/docs/nodes/ps-strategy-best-save.md +67 -11
- package/docs/nodes/ps-strategy-lowest-price.md +69 -0
- package/package.json +1 -1
- package/src/elvia/elvia-add-tariff.html +1 -1
- package/src/handle-input.js +30 -10
- package/src/receive-price-functions.js +2 -0
- package/src/strategy-best-save.html +14 -0
- package/src/strategy-best-save.js +6 -2
- package/src/strategy-lowest-price.html +15 -2
- package/src/strategy-lowest-price.js +3 -1
- package/src/utils.js +3 -3
- package/test/data/lowest-price-result-cont.json +1 -0
- package/test/data/lowest-price-result-missing-end.json +1 -0
- package/test/data/lowest-price-result-split-allday.json +1 -0
- package/test/data/lowest-price-result-split-allday10.json +1 -0
- package/test/data/lowest-price-result-split.json +1 -0
- package/test/data/tibber-result-end-0-24h.json +1 -0
- package/test/data/tibber-result-end-0.json +1 -0
- package/.github/workflows/firebase-hosting-pull-request.yml +0 -17
- package/docs/.vuepress/dist/404.html +0 -33
- package/docs/.vuepress/dist/Ukraine-heart-shape-flag.png +0 -0
- package/docs/.vuepress/dist/assets/404.32f46df8.js +0 -1
- package/docs/.vuepress/dist/assets/404.html.bee13de6.js +0 -1
- package/docs/.vuepress/dist/assets/404.html.f166316b.js +0 -1
- package/docs/.vuepress/dist/assets/BestSaveVerificator.574001b7.js +0 -1
- package/docs/.vuepress/dist/assets/DonateButtons.ab660315.js +0 -1
- package/docs/.vuepress/dist/assets/Layout.1b8eeaf1.js +0 -1
- package/docs/.vuepress/dist/assets/add-tariff-flow.9e258f5b.png +0 -0
- package/docs/.vuepress/dist/assets/app.b3d8926b.js +0 -8
- package/docs/.vuepress/dist/assets/back-to-top.8efcbe56.svg +0 -1
- package/docs/.vuepress/dist/assets/best-save-config.70d29386.png +0 -0
- package/docs/.vuepress/dist/assets/best-save-viewer.html.bb64949a.js +0 -1
- package/docs/.vuepress/dist/assets/best-save-viewer.html.e897b3ac.js +0 -1
- package/docs/.vuepress/dist/assets/copy-payload-best-save.8b51cdf4.png +0 -0
- package/docs/.vuepress/dist/assets/elvia-config-no-config.7ea35c3b.png +0 -0
- package/docs/.vuepress/dist/assets/elvia-config-no-tariff.a208a0f3.png +0 -0
- package/docs/.vuepress/dist/assets/elvia-config-select-tariff.48562d43.png +0 -0
- package/docs/.vuepress/dist/assets/elvia-config-subscription-key.3368b931.png +0 -0
- package/docs/.vuepress/dist/assets/elvia-flow.a8b126d6.png +0 -0
- package/docs/.vuepress/dist/assets/example-cascade-temperature-control.html.3632cc6c.js +0 -272
- package/docs/.vuepress/dist/assets/example-cascade-temperature-control.html.5a363ecf.js +0 -1
- package/docs/.vuepress/dist/assets/example-flow-1.971bbb87.png +0 -0
- package/docs/.vuepress/dist/assets/example-flow-2.a0c62ed7.png +0 -0
- package/docs/.vuepress/dist/assets/example-heat-capacitor.html.89cdea26.js +0 -1
- package/docs/.vuepress/dist/assets/example-heat-capacitor.html.b87ab267.js +0 -215
- package/docs/.vuepress/dist/assets/example-next-schedule-entity.html.dd06a4d6.js +0 -11
- package/docs/.vuepress/dist/assets/example-next-schedule-entity.html.fc8e9124.js +0 -1
- package/docs/.vuepress/dist/assets/example-nordpool-current-state.html.278abccb.js +0 -1
- package/docs/.vuepress/dist/assets/example-nordpool-current-state.html.8eca9b26.js +0 -174
- package/docs/.vuepress/dist/assets/example-nordpool-events-state.html.05c3331c.js +0 -159
- package/docs/.vuepress/dist/assets/example-nordpool-events-state.html.47dbda83.js +0 -1
- package/docs/.vuepress/dist/assets/example-tibber-mqtt.html.bed6459b.js +0 -1
- package/docs/.vuepress/dist/assets/example-tibber-mqtt.html.ce7f09e2.js +0 -167
- package/docs/.vuepress/dist/assets/heat-capacitor-temperatureVsPrice.19bc8932.png +0 -0
- package/docs/.vuepress/dist/assets/index.html.21bfa52e.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.350682d1.js +0 -38
- package/docs/.vuepress/dist/assets/index.html.3bbc4fe4.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.485a4abc.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.49024575.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.4c0ec52b.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.54f6072c.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.75c4e015.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.7857db23.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.797b027e.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.88f59477.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.c4e8bf36.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.c98d742c.js +0 -1
- package/docs/.vuepress/dist/assets/index.html.edb1389f.js +0 -1
- package/docs/.vuepress/dist/assets/lowest-price-config.d7043621.png +0 -0
- package/docs/.vuepress/dist/assets/migrate-best-save.dcc20d06.js +0 -1
- package/docs/.vuepress/dist/assets/migrate-best-save.ec036b00.png +0 -0
- package/docs/.vuepress/dist/assets/migrate-power-saver.98ee9f2e.png +0 -0
- package/docs/.vuepress/dist/assets/mysterious-plan.687d8b75.png +0 -0
- package/docs/.vuepress/dist/assets/next-schedule-entity.418ab6ec.png +0 -0
- package/docs/.vuepress/dist/assets/next-schedule-flow.862dea60.png +0 -0
- package/docs/.vuepress/dist/assets/next-schedule-sensor.87198baf.png +0 -0
- package/docs/.vuepress/dist/assets/node-power-saver.3a115c24.js +0 -1
- package/docs/.vuepress/dist/assets/node-power-saver.feb2d4fb.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-elvia-add-tariff.0bff05a9.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-elvia-add-tariff.57baddc7.js +0 -1
- package/docs/.vuepress/dist/assets/node-ps-general-add-tariff.17755af1.js +0 -1
- package/docs/.vuepress/dist/assets/node-ps-general-add-tariff.5a5c98c6.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-receive-price.3587e62e.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-receive-price.dbc5e137.js +0 -1
- package/docs/.vuepress/dist/assets/node-ps-strategy-best-save.13861759.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-strategy-best-save.516d9e66.js +0 -1
- package/docs/.vuepress/dist/assets/node-ps-strategy-heat-capacitor-cascade-control.f35cce75.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-strategy-heat-capacitor-simple-flow-example.099aa155.js +0 -1
- package/docs/.vuepress/dist/assets/node-ps-strategy-heat-capacitor-simple-flow-example.5b712b3b.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-strategy-heat-capacitor.e7736c9e.js +0 -1
- package/docs/.vuepress/dist/assets/node-ps-strategy-lowest-price.4e5c38ee.png +0 -0
- package/docs/.vuepress/dist/assets/node-ps-strategy-lowest-price.83209fac.js +0 -1
- package/docs/.vuepress/dist/assets/old-power-saver-doc.html.c7324541.js +0 -1
- package/docs/.vuepress/dist/assets/old-power-saver-doc.html.f428e475.js +0 -83
- package/docs/.vuepress/dist/assets/oven-setpoint-calculation.47b65429.png +0 -0
- package/docs/.vuepress/dist/assets/overshoot-time.2c4e3929.png +0 -0
- package/docs/.vuepress/dist/assets/plugin-vue_export-helper.21dcd24c.js +0 -1
- package/docs/.vuepress/dist/assets/power-saver-nordpool-current-state.cbe8e48a.png +0 -0
- package/docs/.vuepress/dist/assets/power-saver-nordpool-events-state.a764b813.png +0 -0
- package/docs/.vuepress/dist/assets/power-saver-tibber-mqtt.c04fb150.png +0 -0
- package/docs/.vuepress/dist/assets/power-saver.html.4baca6ba.js +0 -1
- package/docs/.vuepress/dist/assets/power-saver.html.875a1f0e.js +0 -1
- package/docs/.vuepress/dist/assets/ps-elvia-add-tariff.html.05d3ab1b.js +0 -1
- package/docs/.vuepress/dist/assets/ps-elvia-add-tariff.html.dce36de0.js +0 -1
- package/docs/.vuepress/dist/assets/ps-general-add-tariff.html.3056f433.js +0 -1
- package/docs/.vuepress/dist/assets/ps-general-add-tariff.html.3cce3e4d.js +0 -1
- package/docs/.vuepress/dist/assets/ps-receive-price.html.0d762910.js +0 -66
- package/docs/.vuepress/dist/assets/ps-receive-price.html.53dde398.js +0 -1
- package/docs/.vuepress/dist/assets/ps-strategy-best-save.html.503ecfbe.js +0 -1
- package/docs/.vuepress/dist/assets/ps-strategy-best-save.html.9b0747bf.js +0 -72
- package/docs/.vuepress/dist/assets/ps-strategy-heat-capacitor.html.53b3383d.js +0 -228
- package/docs/.vuepress/dist/assets/ps-strategy-heat-capacitor.html.b7849bf7.js +0 -1
- package/docs/.vuepress/dist/assets/ps-strategy-lowest-price.html.1e419f56.js +0 -92
- package/docs/.vuepress/dist/assets/ps-strategy-lowest-price.html.f006d811.js +0 -1
- package/docs/.vuepress/dist/assets/strategy-input.html.6d452f16.js +0 -26
- package/docs/.vuepress/dist/assets/strategy-input.html.8a16d321.js +0 -1
- package/docs/.vuepress/dist/assets/style.a8aae67b.css +0 -1
- package/docs/.vuepress/dist/assets/temperature-manipulation-config.a0e0439b.png +0 -0
- package/docs/.vuepress/dist/changelog/index.html +0 -33
- package/docs/.vuepress/dist/contribute/index.html +0 -33
- package/docs/.vuepress/dist/euro.png +0 -0
- package/docs/.vuepress/dist/examples/example-cascade-temperature-control.html +0 -304
- package/docs/.vuepress/dist/examples/example-heat-capacitor.html +0 -247
- package/docs/.vuepress/dist/examples/example-next-schedule-entity.html +0 -43
- package/docs/.vuepress/dist/examples/example-nordpool-current-state.html +0 -206
- package/docs/.vuepress/dist/examples/example-nordpool-events-state.html +0 -191
- package/docs/.vuepress/dist/examples/example-tibber-mqtt.html +0 -199
- package/docs/.vuepress/dist/examples/index.html +0 -33
- package/docs/.vuepress/dist/faq/best-save-viewer.html +0 -33
- package/docs/.vuepress/dist/faq/index.html +0 -33
- package/docs/.vuepress/dist/guide/index.html +0 -70
- package/docs/.vuepress/dist/index.html +0 -33
- package/docs/.vuepress/dist/logo.png +0 -0
- package/docs/.vuepress/dist/nodes/index.html +0 -33
- package/docs/.vuepress/dist/nodes/old-power-saver-doc.html +0 -115
- package/docs/.vuepress/dist/nodes/power-saver.html +0 -33
- package/docs/.vuepress/dist/nodes/ps-elvia-add-tariff.html +0 -33
- package/docs/.vuepress/dist/nodes/ps-general-add-tariff.html +0 -33
- package/docs/.vuepress/dist/nodes/ps-receive-price.html +0 -98
- package/docs/.vuepress/dist/nodes/ps-strategy-best-save.html +0 -104
- package/docs/.vuepress/dist/nodes/ps-strategy-heat-capacitor.html +0 -260
- package/docs/.vuepress/dist/nodes/ps-strategy-lowest-price.html +0 -124
- package/docs/.vuepress/dist/nodes/strategy-input.html +0 -58
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</script>
|
|
68
68
|
|
|
69
69
|
<script type="text/markdown" data-help-name="ps-elvia-add-tariff">
|
|
70
|
-
# Elvia Add Tariff
|
|
70
|
+
# Elvia Add Tariff (deprecated)
|
|
71
71
|
|
|
72
72
|
A node to get the tariff from Elvia and add it to the price before it is sent to the power saver strategy nodes.
|
|
73
73
|
Use this node between the receive-price node and any of the strategy nodes.
|
package/src/handle-input.js
CHANGED
|
@@ -8,13 +8,29 @@ function handleStrategyInput(node, msg, doPlanning) {
|
|
|
8
8
|
if (!validateInput(node, msg)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
+
if (msg.payload.commands && !anyLegalCommands(msg.payload.commands)) {
|
|
12
|
+
const message = "Illegal command";
|
|
13
|
+
node.warn(message);
|
|
14
|
+
node.status({ fill: "yellow", shape: "dot", text: message });
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
11
17
|
if (msg.payload.commands && msg.payload.commands.reset) {
|
|
12
18
|
node.warn("Resetting node context by command");
|
|
13
19
|
// Reset all saved data
|
|
14
|
-
node
|
|
20
|
+
node
|
|
21
|
+
.context()
|
|
22
|
+
.set(["lastPlan", "lastPriceData", "lastSource"], [undefined, undefined, undefined], node.contextStorage);
|
|
15
23
|
deleteSavedScheduleBefore(node, DateTime.now().plus({ days: 2 }), 100);
|
|
16
24
|
}
|
|
17
|
-
|
|
25
|
+
let { priceData, source } = getPriceData(node, msg);
|
|
26
|
+
if (!priceData) {
|
|
27
|
+
// Use last saved price data
|
|
28
|
+
priceData = node.context().get("lastPriceData");
|
|
29
|
+
source = node.context().get("lastSource");
|
|
30
|
+
const message = "Using saved prices";
|
|
31
|
+
node.warn(message);
|
|
32
|
+
node.status({ fill: "green", shape: "ring", text: message });
|
|
33
|
+
}
|
|
18
34
|
if (!priceData) {
|
|
19
35
|
const message = "No price data";
|
|
20
36
|
node.warn(message);
|
|
@@ -38,7 +54,7 @@ function handleStrategyInput(node, msg, doPlanning) {
|
|
|
38
54
|
const plan = doPlanning(node, effectiveConfig, priceData, planFromTime, dateDayBefore, dateToday);
|
|
39
55
|
|
|
40
56
|
// Save schedule
|
|
41
|
-
node.context().set("lastPlan", plan);
|
|
57
|
+
node.context().set("lastPlan", plan, node.contextStorage);
|
|
42
58
|
dates.forEach((d) => saveDayData(node, d, extractPlanForDate(plan, d)));
|
|
43
59
|
|
|
44
60
|
const sentOnCommand = !!msg.payload.commands?.sendSchedule;
|
|
@@ -84,14 +100,14 @@ function getPriceData(node, msg) {
|
|
|
84
100
|
const isCommandMsg = !!msg?.payload?.commands;
|
|
85
101
|
const isPriceMsg = !!msg?.payload?.priceData;
|
|
86
102
|
if ((isConfigMsg || isCommandMsg) && !isPriceMsg) {
|
|
87
|
-
const priceData = node.context().get("lastPriceData");
|
|
88
|
-
const source = node.context().get("lastSource");
|
|
103
|
+
const priceData = node.context().get("lastPriceData", node.contextStorage);
|
|
104
|
+
const source = node.context().get("lastSource", node.contextStorage);
|
|
89
105
|
return { priceData, source };
|
|
90
106
|
}
|
|
91
107
|
const priceData = msg.payload.priceData;
|
|
92
108
|
const source = msg.payload.source;
|
|
93
|
-
node.context().set("lastPriceData", priceData);
|
|
94
|
-
node.context().set("lastSource", source);
|
|
109
|
+
node.context().set("lastPriceData", priceData, node.contextStorage);
|
|
110
|
+
node.context().set("lastSource", source, node.contextStorage);
|
|
95
111
|
return { priceData, source };
|
|
96
112
|
}
|
|
97
113
|
|
|
@@ -129,14 +145,14 @@ function deleteSavedScheduleBefore(node, day, checkDays = 0) {
|
|
|
129
145
|
let count = 0;
|
|
130
146
|
do {
|
|
131
147
|
date = date.plus({ days: -1 });
|
|
132
|
-
data = node.context().get(date.toISODate());
|
|
133
|
-
node.context().set(date.toISODate(), undefined);
|
|
148
|
+
data = node.context().get(date.toISODate(), node.contextStorage);
|
|
149
|
+
node.context().set(date.toISODate(), undefined, node.contextStorage);
|
|
134
150
|
count++;
|
|
135
151
|
} while (data !== undefined || count <= checkDays);
|
|
136
152
|
}
|
|
137
153
|
|
|
138
154
|
function saveDayData(node, date, plan) {
|
|
139
|
-
node.context().set(date, plan);
|
|
155
|
+
node.context().set(date, plan, node.contextStorage);
|
|
140
156
|
}
|
|
141
157
|
|
|
142
158
|
function sendSwitch(node, onOff) {
|
|
@@ -181,6 +197,10 @@ function validateInput(node, msg) {
|
|
|
181
197
|
return true;
|
|
182
198
|
}
|
|
183
199
|
|
|
200
|
+
function anyLegalCommands(commands) {
|
|
201
|
+
return ["reset", "replan", "sendOutput", "sendSchedule"].some((v) => commands.hasOwnProperty(v));
|
|
202
|
+
}
|
|
203
|
+
|
|
184
204
|
module.exports = {
|
|
185
205
|
handleStrategyInput,
|
|
186
206
|
validateInput,
|
|
@@ -14,6 +14,8 @@ function getPriceData(node, msg) {
|
|
|
14
14
|
priceData = [...input.today, ...input.tomorrow];
|
|
15
15
|
const source = input.source;
|
|
16
16
|
node.context().set("lastPriceData", priceData);
|
|
17
|
+
const statusMsg = priceData.length + " hours from " + source;
|
|
18
|
+
node.status({ fill: "green", shape: "ring", text: statusMsg });
|
|
17
19
|
return { priceData, source };
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
align: "left",
|
|
27
27
|
},
|
|
28
28
|
outputIfNoSchedule: { value: "true", required: true, align: "left" },
|
|
29
|
+
contextStorage: { value: "default", required: false, align: "left" },
|
|
29
30
|
},
|
|
30
31
|
inputs: 1,
|
|
31
32
|
outputs: 3,
|
|
@@ -47,6 +48,14 @@
|
|
|
47
48
|
},
|
|
48
49
|
],
|
|
49
50
|
});
|
|
51
|
+
$("#node-input-contextStorage").typedInput({
|
|
52
|
+
types: [
|
|
53
|
+
{
|
|
54
|
+
value: "storages",
|
|
55
|
+
options: RED.settings.context.stores.map((s) => ({ value: s, label: s })),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
});
|
|
50
59
|
},
|
|
51
60
|
});
|
|
52
61
|
</script>
|
|
@@ -86,6 +95,11 @@
|
|
|
86
95
|
<input type="text" id="node-input-outputIfNoSchedule" style="width: 80px">
|
|
87
96
|
</label>
|
|
88
97
|
</div>
|
|
98
|
+
<h3>Context storage</h3>
|
|
99
|
+
<div class="form-row">
|
|
100
|
+
<label for="node-input-contextStorage"><i class="fa fa-archive"></i> Context storage</label>
|
|
101
|
+
<input type="text" id="node-input-contextStorage" style="width: 160px">
|
|
102
|
+
</div>
|
|
89
103
|
</script>
|
|
90
104
|
|
|
91
105
|
<script type="text/markdown" data-help-name="ps-strategy-best-save">
|
|
@@ -9,14 +9,18 @@ module.exports = function (RED) {
|
|
|
9
9
|
RED.nodes.createNode(this, config);
|
|
10
10
|
const node = this;
|
|
11
11
|
|
|
12
|
+
node.status({});
|
|
13
|
+
|
|
12
14
|
const originalConfig = {
|
|
13
15
|
maxHoursToSaveInSequence: config.maxHoursToSaveInSequence,
|
|
14
16
|
minHoursOnAfterMaxSequenceSaved: config.minHoursOnAfterMaxSequenceSaved,
|
|
15
17
|
minSaving: parseFloat(config.minSaving),
|
|
16
18
|
sendCurrentValueWhenRescheduling: config.sendCurrentValueWhenRescheduling,
|
|
17
19
|
outputIfNoSchedule: config.outputIfNoSchedule === "true",
|
|
20
|
+
contextStorage: config.contextStorage || "default",
|
|
18
21
|
};
|
|
19
|
-
node.context().set("config", originalConfig);
|
|
22
|
+
node.context().set("config", originalConfig, originalConfig.contextStorage);
|
|
23
|
+
node.contextStorage = originalConfig.contextStorage;
|
|
20
24
|
|
|
21
25
|
node.on("close", function () {
|
|
22
26
|
clearTimeout(node.schedulingTimeout);
|
|
@@ -55,7 +59,7 @@ function doPlanning(node, _, priceData, _, dateDayBefore, _) {
|
|
|
55
59
|
const values = priceData.map((d) => d.value);
|
|
56
60
|
const startTimes = priceData.map((d) => d.start);
|
|
57
61
|
const onOffBefore = dataJustBefore.hours.map((h) => h.onOff);
|
|
58
|
-
const lastPlanHours = node.context().get("lastPlan")?.hours ?? [];
|
|
62
|
+
const lastPlanHours = node.context().get("lastPlan", node.contextStorage)?.hours ?? [];
|
|
59
63
|
const plan = makePlan(node, values, startTimes, onOffBefore);
|
|
60
64
|
const includeFromLastPlanHours = lastPlanHours.filter(
|
|
61
65
|
(h) => h.start < plan.hours[0].start && h.start >= priceData[0].start
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
outputIfNoSchedule: { value: "true", required: true, align: "left" },
|
|
57
57
|
outputOutsidePeriod: { value: "false", required: true, align: "left" },
|
|
58
|
+
contextStorage: { value: "default", required: false, align: "left" },
|
|
58
59
|
},
|
|
59
60
|
inputs: 1,
|
|
60
61
|
outputs: 3,
|
|
@@ -115,6 +116,14 @@
|
|
|
115
116
|
},
|
|
116
117
|
],
|
|
117
118
|
});
|
|
119
|
+
$("#node-input-contextStorage").typedInput({
|
|
120
|
+
types: [
|
|
121
|
+
{
|
|
122
|
+
value: "storages",
|
|
123
|
+
options: RED.settings.context.stores.map((s) => ({ value: s, label: s })),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
});
|
|
118
127
|
},
|
|
119
128
|
});
|
|
120
129
|
</script>
|
|
@@ -125,11 +134,11 @@
|
|
|
125
134
|
<input type="text" id="node-input-name" placeholder="Name" style="width: 240px">
|
|
126
135
|
</div>
|
|
127
136
|
<div class="form-row">
|
|
128
|
-
<label for="node-input-fromTime"><i class="fa fa-
|
|
137
|
+
<label for="node-input-fromTime"><i class="fa fa-clock-o"></i> From time</label>
|
|
129
138
|
<input type="text" id="node-input-fromTime" style="width: 80px">
|
|
130
139
|
</div>
|
|
131
140
|
<div class="form-row">
|
|
132
|
-
<label for="node-input-toTime"><i class="fa fa-
|
|
141
|
+
<label for="node-input-toTime"><i class="fa fa-clock-o"></i> To time</label>
|
|
133
142
|
<input type="text" id="node-input-toTime" style="width: 80px">
|
|
134
143
|
</div>
|
|
135
144
|
<div class="form-row">
|
|
@@ -159,6 +168,10 @@
|
|
|
159
168
|
<input type="text" id="node-input-outputOutsidePeriod" style="width: 80px">
|
|
160
169
|
</label>
|
|
161
170
|
</div>
|
|
171
|
+
<div class="form-row">
|
|
172
|
+
<label for="node-input-contextStorage"><i class="fa fa-archive"></i> Context storage</label>
|
|
173
|
+
<input type="text" id="node-input-contextStorage" style="width: 160px">
|
|
174
|
+
</div>
|
|
162
175
|
</script>
|
|
163
176
|
|
|
164
177
|
<script type="text/markdown" data-help-name="ps-strategy-lowest-price">
|
|
@@ -7,6 +7,7 @@ module.exports = function (RED) {
|
|
|
7
7
|
function StrategyLowestPriceNode(config) {
|
|
8
8
|
RED.nodes.createNode(this, config);
|
|
9
9
|
const node = this;
|
|
10
|
+
node.status({});
|
|
10
11
|
|
|
11
12
|
const originalConfig = {
|
|
12
13
|
fromTime: config.fromTime,
|
|
@@ -16,8 +17,9 @@ module.exports = function (RED) {
|
|
|
16
17
|
sendCurrentValueWhenRescheduling: booleanConfig(config.sendCurrentValueWhenRescheduling),
|
|
17
18
|
outputIfNoSchedule: booleanConfig(config.outputIfNoSchedule),
|
|
18
19
|
outputOutsidePeriod: booleanConfig(config.outputOutsidePeriod),
|
|
20
|
+
contextStorage: config.contextStorage || "default",
|
|
19
21
|
};
|
|
20
|
-
node.context().set("config", originalConfig);
|
|
22
|
+
node.context().set("config", originalConfig, node.contextStorage);
|
|
21
23
|
|
|
22
24
|
node.on("close", function () {
|
|
23
25
|
clearTimeout(node.schedulingTimeout);
|
package/src/utils.js
CHANGED
|
@@ -57,14 +57,14 @@ function getDiff(large, small) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function getEffectiveConfig(node, msg) {
|
|
60
|
-
const res = node.context().get("config");
|
|
60
|
+
const res = node.context().get("config", node.contextStorage);
|
|
61
61
|
const isConfigMsg = !!msg?.payload?.config;
|
|
62
62
|
if (isConfigMsg) {
|
|
63
63
|
const inputConfig = msg.payload.config;
|
|
64
64
|
Object.keys(inputConfig).forEach((key) => {
|
|
65
65
|
res[key] = inputConfig[key];
|
|
66
66
|
});
|
|
67
|
-
node.context().set("config", res);
|
|
67
|
+
node.context().set("config", res, node.contextStorage);
|
|
68
68
|
}
|
|
69
69
|
return res;
|
|
70
70
|
}
|
|
@@ -73,7 +73,7 @@ function loadDayData(node, date) {
|
|
|
73
73
|
// Load saved schedule for the date (YYYY-MM-DD)
|
|
74
74
|
// Return null if not found
|
|
75
75
|
const key = date.toISODate();
|
|
76
|
-
const saved = node.context().get(key);
|
|
76
|
+
const saved = node.context().get(key, node.contextStorage);
|
|
77
77
|
const res = saved ?? {
|
|
78
78
|
schedule: [],
|
|
79
79
|
hours: [],
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by the Firebase CLI
|
|
2
|
-
# https://github.com/firebase/firebase-tools
|
|
3
|
-
|
|
4
|
-
name: Deploy to Firebase Hosting on PR
|
|
5
|
-
'on': pull_request
|
|
6
|
-
jobs:
|
|
7
|
-
build_and_preview:
|
|
8
|
-
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v2
|
|
12
|
-
- run: 'npm run docs:build'
|
|
13
|
-
- uses: FirebaseExtended/action-hosting-deploy@v0
|
|
14
|
-
with:
|
|
15
|
-
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
|
16
|
-
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_POWERSAVER_C98D0 }}'
|
|
17
|
-
projectId: powersaver-c98d0
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en-US">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<meta name="generator" content="VuePress 2.0.0-beta.36">
|
|
7
|
-
<style>
|
|
8
|
-
:root {
|
|
9
|
-
--c-bg: #fff;
|
|
10
|
-
}
|
|
11
|
-
html.dark {
|
|
12
|
-
--c-bg: #22272e;
|
|
13
|
-
}
|
|
14
|
-
html, body {
|
|
15
|
-
background-color: var(--c-bg);
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
18
|
-
<script>
|
|
19
|
-
const userMode = localStorage.getItem('vuepress-color-scheme');
|
|
20
|
-
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
21
|
-
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
|
22
|
-
document.documentElement.classList.toggle('dark', true);
|
|
23
|
-
}
|
|
24
|
-
</script>
|
|
25
|
-
<link rel="shortcut icon" type="image/x-icon" href="euro.png"><title>Power Saver</title><meta name="description" content="A Node-RED note to save money on hourly changing power prices">
|
|
26
|
-
<link rel="modulepreload" href="/assets/app.b3d8926b.js"><link rel="modulepreload" href="/assets/404.html.f166316b.js"><link rel="modulepreload" href="/assets/404.html.bee13de6.js"><link rel="modulepreload" href="/assets/plugin-vue_export-helper.21dcd24c.js">
|
|
27
|
-
<link rel="stylesheet" href="/assets/style.a8aae67b.css">
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<div id="app"><!--[--><div class="theme-container"><div class="theme-default-content"><h1>404</h1><blockquote>How did we get here?</blockquote><a href="/" class="">Take me home</a></div></div><!----><!--]--></div>
|
|
31
|
-
<script type="module" src="/assets/app.b3d8926b.js" defer></script>
|
|
32
|
-
</body>
|
|
33
|
-
</html>
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as i,z as _,A as p,m as f,o as k,d as v,f as o,t as c,q as L,s as g,u as l,l as x}from"./app.b3d8926b.js";const B={class:"theme-container"},N={class:"theme-default-content"},T=o("h1",null,"404",-1),b=i({setup(C){var s,a,n;const u=_(),e=p(),t=(s=e.value.notFound)!=null?s:["Not Found"],r=()=>t[Math.floor(Math.random()*t.length)],m=(a=e.value.home)!=null?a:u.value,h=(n=e.value.backToHome)!=null?n:"Back to home";return(M,R)=>{const d=f("RouterLink");return k(),v("div",B,[o("div",N,[T,o("blockquote",null,c(r()),1),L(d,{to:l(m)},{default:g(()=>[x(c(l(h)),1)]),_:1},8,["to"])])])}}});export{b as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as r}from"./plugin-vue_export-helper.21dcd24c.js";const _={};function e(t,c){return null}var a=r(_,[["render",e]]);export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t={key:"v-3706649a",path:"/404.html",title:"",lang:"en-US",frontmatter:{layout:"404"},excerpt:"",headers:[],git:{},filePathRelative:null};export{t as data};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Qn=Object.defineProperty,Kn=Object.defineProperties;var Xn=Object.getOwnPropertyDescriptors;var Ve=Object.getOwnPropertySymbols;var Mt=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var kt=(n,e,t)=>e in n?Qn(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,m=(n,e)=>{for(var t in e||(e={}))Mt.call(e,t)&&kt(n,t,e[t]);if(Ve)for(var t of Ve(e))Et.call(e,t)&&kt(n,t,e[t]);return n},ee=(n,e)=>Kn(n,Xn(e));var Ke=(n,e)=>{var t={};for(var r in n)Mt.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&Ve)for(var r of Ve(n))e.indexOf(r)<0&&Et.call(n,r)&&(t[r]=n[r]);return t};import{r as _e,c as Nt,w as er,a as G,b as tr,o as b,d as F,e as R,v as nr,f,t as E,u as N,F as oe,g as ge,h as rr,i as It,j as sr,p as ir,k as ar,n as Xe,l as ae}from"./app.b3d8926b.js";import{_ as or}from"./plugin-vue_export-helper.21dcd24c.js";class fe extends Error{}class ur extends fe{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class lr extends fe{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class cr extends fe{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ie extends fe{}class Kt extends fe{constructor(e){super(`Invalid unit ${e}`)}}class P extends fe{}class re extends fe{constructor(){super("Zone is an abstract class")}}const c="numeric",Q="short",W="long",ut={year:c,month:c,day:c},Xt={year:c,month:Q,day:c},dr={year:c,month:Q,day:c,weekday:Q},en={year:c,month:W,day:c},tn={year:c,month:W,day:c,weekday:W},nn={hour:c,minute:c},rn={hour:c,minute:c,second:c},sn={hour:c,minute:c,second:c,timeZoneName:Q},an={hour:c,minute:c,second:c,timeZoneName:W},on={hour:c,minute:c,hourCycle:"h23"},un={hour:c,minute:c,second:c,hourCycle:"h23"},ln={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:Q},cn={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:W},dn={year:c,month:c,day:c,hour:c,minute:c},fn={year:c,month:c,day:c,hour:c,minute:c,second:c},hn={year:c,month:Q,day:c,hour:c,minute:c},mn={year:c,month:Q,day:c,hour:c,minute:c,second:c},fr={year:c,month:Q,day:c,weekday:Q,hour:c,minute:c},yn={year:c,month:W,day:c,hour:c,minute:c,timeZoneName:Q},gn={year:c,month:W,day:c,hour:c,minute:c,second:c,timeZoneName:Q},wn={year:c,month:W,day:c,weekday:W,hour:c,minute:c,timeZoneName:W},pn={year:c,month:W,day:c,weekday:W,hour:c,minute:c,second:c,timeZoneName:W};function T(n){return typeof n=="undefined"}function de(n){return typeof n=="number"}function Ye(n){return typeof n=="number"&&n%1===0}function hr(n){return typeof n=="string"}function mr(n){return Object.prototype.toString.call(n)==="[object Date]"}function Sn(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch{return!1}}function yr(n){return Array.isArray(n)?n:[n]}function Dt(n,e,t){if(n.length!==0)return n.reduce((r,s)=>{const i=[e(s),s];return r&&t(r[0],i[0])===r[0]?r:i},null)[1]}function gr(n,e){return e.reduce((t,r)=>(t[r]=n[r],t),{})}function Se(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function te(n,e,t){return Ye(n)&&n>=e&&n<=t}function wr(n,e){return n-e*Math.floor(n/e)}function L(n,e=2){const t=n<0;let r;return t?r="-"+(""+-n).padStart(e,"0"):r=(""+n).padStart(e,"0"),r}function se(n){if(!(T(n)||n===null||n===""))return parseInt(n,10)}function ue(n){if(!(T(n)||n===null||n===""))return parseFloat(n)}function yt(n){if(!(T(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function gt(n,e,t=!1){const r=10**e;return(t?Math.trunc:Math.round)(n*r)/r}function be(n){return n%4===0&&(n%100!==0||n%400===0)}function xe(n){return be(n)?366:365}function ze(n,e){const t=wr(e-1,12)+1,r=n+(e-t)/12;return t===2?be(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function wt(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function Re(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,r=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||r===3?53:52}function lt(n){return n>99?n:n>60?1900+n:2e3+n}function vn(n,e,t,r=null){const s=new Date(n),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const a=m({timeZoneName:e},i),o=new Intl.DateTimeFormat(t,a).formatToParts(s).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function Ge(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const r=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-r:r;return t*60+s}function Tn(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new P(`Invalid unit value ${n}`);return e}function Ue(n,e){const t={};for(const r in n)if(Se(n,r)){const s=n[r];if(s==null)continue;t[e(r)]=Tn(s)}return t}function Pe(n,e){const t=Math.trunc(Math.abs(n/60)),r=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${L(t,2)}:${L(r,2)}`;case"narrow":return`${s}${t}${r>0?`:${r}`:""}`;case"techie":return`${s}${L(t,2)}${L(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Je(n){return gr(n,["hour","minute","second","millisecond"])}const pr=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z0-9_+-]{1,256}(\/[A-Za-z0-9_+-]{1,256})?)?/,Sr=["January","February","March","April","May","June","July","August","September","October","November","December"],On=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vr=["J","F","M","A","M","J","J","A","S","O","N","D"];function kn(n){switch(n){case"narrow":return[...vr];case"short":return[...On];case"long":return[...Sr];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Mn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],En=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Tr=["M","T","W","T","F","S","S"];function Nn(n){switch(n){case"narrow":return[...Tr];case"short":return[...En];case"long":return[...Mn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const In=["AM","PM"],Or=["Before Christ","Anno Domini"],kr=["BC","AD"],Mr=["B","A"];function Dn(n){switch(n){case"narrow":return[...Mr];case"short":return[...kr];case"long":return[...Or];default:return null}}function Er(n){return In[n.hour<12?0:1]}function Nr(n,e){return Nn(e)[n.weekday-1]}function Ir(n,e){return kn(e)[n.month-1]}function Dr(n,e){return Dn(e)[n.year<0?0:1]}function xr(n,e,t="always",r=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&i){const M=n==="days";switch(e){case 1:return M?"tomorrow":`next ${s[n][0]}`;case-1:return M?"yesterday":`last ${s[n][0]}`;case 0:return M?"today":`this ${s[n][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=s[n],w=r?u?l[1]:l[2]||l[1]:u?s[n][0]:n;return a?`${o} ${w} ago`:`in ${o} ${w}`}function xt(n,e){let t="";for(const r of n)r.literal?t+=r.val:t+=e(r.val);return t}const br={D:ut,DD:Xt,DDD:en,DDDD:tn,t:nn,tt:rn,ttt:sn,tttt:an,T:on,TT:un,TTT:ln,TTTT:cn,f:dn,ff:hn,fff:yn,ffff:wn,F:fn,FF:mn,FFF:gn,FFFF:pn};class H{static create(e,t={}){return new H(e,t)}static parseFormat(e){let t=null,r="",s=!1;const i=[];for(let a=0;a<e.length;a++){const o=e.charAt(a);o==="'"?(r.length>0&&i.push({literal:s,val:r}),t=null,r="",s=!s):s||o===t?r+=o:(r.length>0&&i.push({literal:!1,val:r}),r=o,t=o)}return r.length>0&&i.push({literal:s,val:r}),i}static macroTokenToFormatOpts(e){return br[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,m(m({},this.opts),t)).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,m(m({},this.opts),t)).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,m(m({},this.opts),t)).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,m(m({},this.opts),t)).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return L(e,t);const r=m({},this.opts);return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(y,$)=>this.loc.extract(e,y,$),a=y=>e.isOffsetFixed&&e.offset===0&&y.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,y.format):"",o=()=>r?Er(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(y,$)=>r?Ir(e,y):i($?{month:y}:{month:y,day:"numeric"},"month"),l=(y,$)=>r?Nr(e,y):i($?{weekday:y}:{weekday:y,month:"long",day:"numeric"},"weekday"),w=y=>{const $=H.macroTokenToFormatOpts(y);return $?this.formatWithSystemDefault(e,$):y},M=y=>r?Dr(e,y):i({era:y},"era"),I=y=>{switch(y){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?i({day:"numeric"},"day"):this.num(e.day);case"dd":return s?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return s?i({month:"numeric"},"month"):this.num(e.month);case"MM":return s?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return s?i({year:"numeric"},"year"):this.num(e.year);case"yy":return s?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return M("short");case"GG":return M("long");case"GGGGG":return M("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return w(y)}};return xt(H.parseFormat(t),I)}formatDurationFromString(e,t){const r=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},s=u=>l=>{const w=r(l);return w?this.num(u.get(w),l.length):l},i=H.parseFormat(t),a=i.reduce((u,{literal:l,val:w})=>l?u:u.concat(w),[]),o=e.shiftTo(...a.map(r).filter(u=>u));return xt(i,s(o))}}class j{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Fe{get type(){throw new re}get name(){throw new re}get isUniversal(){throw new re}offsetName(e,t){throw new re}formatOffset(e,t){throw new re}offset(e){throw new re}equals(e){throw new re}get isValid(){throw new re}}let et=null;class pt extends Fe{static get instance(){return et===null&&(et=new pt),et}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return vn(e,t,r)}formatOffset(e,t){return Pe(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let He={};function Fr(n){return He[n]||(He[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),He[n]}const Cr={year:0,month:1,day:2,hour:3,minute:4,second:5};function Vr(n,e){const t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t),[,s,i,a,o,u,l]=r;return[a,s,i,o,u,l]}function _r(n,e){const t=n.formatToParts(e),r=[];for(let s=0;s<t.length;s++){const{type:i,value:a}=t[s],o=Cr[i];T(o)||(r[o]=parseInt(a,10))}return r}let Le={};class ne extends Fe{static create(e){return Le[e]||(Le[e]=new ne(e)),Le[e]}static resetCache(){Le={},He={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super();this.zoneName=e,this.valid=ne.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return vn(e,t,r,this.name)}formatOffset(e,t){return Pe(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const r=Fr(this.name),[s,i,a,o,u,l]=r.formatToParts?_r(r,t):Vr(r,t),M=wt({year:s,month:i,day:a,hour:o===24?0:o,minute:u,second:l,millisecond:0});let I=+t;const y=I%1e3;return I-=y>=0?y:1e3+y,(M-I)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let tt=null;class Z extends Fe{static get utcInstance(){return tt===null&&(tt=new Z(0)),tt}static instance(e){return e===0?Z.utcInstance:new Z(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Z(Ge(t[1],t[2]))}return null}constructor(e){super();this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Pe(this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Pe(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Lr extends Fe{constructor(e){super();this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ie(n,e){if(T(n)||n===null)return e;if(n instanceof Fe)return n;if(hr(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?Z.utcInstance:Z.parseSpecifier(t)||ne.create(n)}else return de(n)?Z.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Lr(n)}let bt=()=>Date.now(),Ft="system",Ct=null,Vt=null,_t=null,Lt;class A{static get now(){return bt}static set now(e){bt=e}static set defaultZone(e){Ft=e}static get defaultZone(){return ie(Ft,pt.instance)}static get defaultLocale(){return Ct}static set defaultLocale(e){Ct=e}static get defaultNumberingSystem(){return Vt}static set defaultNumberingSystem(e){Vt=e}static get defaultOutputCalendar(){return _t}static set defaultOutputCalendar(e){_t=e}static get throwOnInvalid(){return Lt}static set throwOnInvalid(e){Lt=e}static resetCaches(){x.resetCache(),ne.resetCache()}}let At={};function Ar(n,e={}){const t=JSON.stringify([n,e]);let r=At[t];return r||(r=new Intl.ListFormat(n,e),At[t]=r),r}let ct={};function dt(n,e={}){const t=JSON.stringify([n,e]);let r=ct[t];return r||(r=new Intl.DateTimeFormat(n,e),ct[t]=r),r}let ft={};function $r(n,e={}){const t=JSON.stringify([n,e]);let r=ft[t];return r||(r=new Intl.NumberFormat(n,e),ft[t]=r),r}let ht={};function Zr(n,e={}){const a=e,{base:t}=a,r=Ke(a,["base"]),s=JSON.stringify([n,r]);let i=ht[s];return i||(i=new Intl.RelativeTimeFormat(n,e),ht[s]=i),i}let De=null;function qr(){return De||(De=new Intl.DateTimeFormat().resolvedOptions().locale,De)}function Hr(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const r=n.substring(0,e);try{t=dt(n).resolvedOptions()}catch{t=dt(r).resolvedOptions()}const{numberingSystem:s,calendar:i}=t;return[r,s,i]}}function Wr(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function zr(n){const e=[];for(let t=1;t<=12;t++){const r=g.utc(2016,t,1);e.push(n(r))}return e}function Rr(n){const e=[];for(let t=1;t<=7;t++){const r=g.utc(2016,11,13+t);e.push(n(r))}return e}function Ae(n,e,t,r,s){const i=n.listingMode(t);return i==="error"?null:i==="en"?r(e):s(e)}function Ur(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Pr{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const o=r,{padTo:s,floor:i}=o,a=Ke(o,["padTo","floor"]);if(!t||Object.keys(a).length>0){const u=m({useGrouping:!1},r);r.padTo>0&&(u.minimumIntegerDigits=r.padTo),this.inf=$r(e,u)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):gt(e,3);return L(t,this.padTo)}}}class Yr{constructor(e,t,r){this.opts=r;let s;if(e.zone.isUniversal){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&ne.create(o).valid?(s=o,this.dt=e):(s="UTC",r.timeZoneName?this.dt=e:this.dt=e.offset===0?e:g.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const i=m({},this.opts);s&&(i.timeZone=s),this.dtf=dt(t,i)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Gr{constructor(e,t,r){this.opts=m({style:"long"},r),!t&&Sn()&&(this.rtf=Zr(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):xr(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class x{static fromOpts(e){return x.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,r,s=!1){const i=e||A.defaultLocale,a=i||(s?"en-US":qr()),o=t||A.defaultNumberingSystem,u=r||A.defaultOutputCalendar;return new x(a,o,u,i)}static resetCache(){De=null,ct={},ft={},ht={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r}={}){return x.create(e,t,r)}constructor(e,t,r,s){const[i,a,o]=Hr(e);this.locale=i,this.numberingSystem=t||a||null,this.outputCalendar=r||o||null,this.intl=Wr(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ur(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:x.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone(ee(m({},e),{defaultToEN:!0}))}redefaultToSystem(e={}){return this.clone(ee(m({},e),{defaultToEN:!1}))}months(e,t=!1,r=!0){return Ae(this,e,r,kn,()=>{const s=t?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=zr(a=>this.extract(a,s,"month"))),this.monthsCache[i][e]})}weekdays(e,t=!1,r=!0){return Ae(this,e,r,Nn,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=t?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=Rr(a=>this.extract(a,s,"weekday"))),this.weekdaysCache[i][e]})}meridiems(e=!0){return Ae(this,void 0,e,()=>In,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[g.utc(2016,11,13,9),g.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Ae(this,e,t,Dn,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[g.utc(-40,1,1),g.utc(2017,1,1)].map(s=>this.extract(s,r,"era"))),this.eraCache[e]})}extract(e,t,r){const s=this.dtFormatter(e,t),i=s.formatToParts(),a=i.find(o=>o.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new Pr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Yr(e,this.intl,t)}relFormatter(e={}){return new Gr(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Ar(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function ve(...n){const e=n.reduce((t,r)=>t+r.source,"");return RegExp(`^${e}$`)}function he(...n){return e=>n.reduce(([t,r,s],i)=>{const[a,o,u]=i(e,s);return[m(m({},t),a),r||o,u]},[{},null,1]).slice(0,2)}function Te(n,...e){if(n==null)return[null,null];for(const[t,r]of e){const s=t.exec(n);if(s)return r(s)}return[null,null]}function xn(...n){return(e,t)=>{const r={};let s;for(s=0;s<n.length;s++)r[n[s]]=se(e[t+s]);return[r,null,t+s]}}const bn=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,St=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Fn=RegExp(`${St.source}${bn.source}?`),vt=RegExp(`(?:T${Fn.source})?`),Jr=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Br=/(\d{4})-?W(\d\d)(?:-?(\d))?/,jr=/(\d{4})-?(\d{3})/,Qr=xn("weekYear","weekNumber","weekDay"),Kr=xn("year","ordinal"),Xr=/(\d{4})-(\d\d)-(\d\d)/,Cn=RegExp(`${St.source} ?(?:${bn.source}|(${pr.source}))?`),es=RegExp(`(?: ${Cn.source})?`);function pe(n,e,t){const r=n[e];return T(r)?t:se(r)}function Vn(n,e){return[{year:pe(n,e),month:pe(n,e+1,1),day:pe(n,e+2,1)},null,e+3]}function me(n,e){return[{hours:pe(n,e,0),minutes:pe(n,e+1,0),seconds:pe(n,e+2,0),milliseconds:yt(n[e+3])},null,e+4]}function Oe(n,e){const t=!n[e]&&!n[e+1],r=Ge(n[e+1],n[e+2]),s=t?null:Z.instance(r);return[{},s,e+3]}function _n(n,e){const t=n[e]?ne.create(n[e]):null;return[{},t,e+1]}const ts=RegExp(`^T?${St.source}$`),ns=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function rs(n){const[e,t,r,s,i,a,o,u,l]=n,w=e[0]==="-",M=u&&u[0]==="-",I=(y,$=!1)=>y!==void 0&&($||y&&w)?-y:y;return[{years:I(ue(t)),months:I(ue(r)),weeks:I(ue(s)),days:I(ue(i)),hours:I(ue(a)),minutes:I(ue(o)),seconds:I(ue(u),u==="-0"),milliseconds:I(yt(l),M)}]}const ss={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Tt(n,e,t,r,s,i,a){const o={year:e.length===2?lt(se(e)):se(e),month:On.indexOf(t)+1,day:se(r),hour:se(s),minute:se(i)};return a&&(o.second=se(a)),n&&(o.weekday=n.length>3?Mn.indexOf(n)+1:En.indexOf(n)+1),o}const is=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function as(n){const[,e,t,r,s,i,a,o,u,l,w,M]=n,I=Tt(e,s,r,t,i,a,o);let y;return u?y=ss[u]:l?y=0:y=Ge(w,M),[I,new Z(y)]}function os(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const us=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ls=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,cs=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function $t(n){const[,e,t,r,s,i,a,o]=n;return[Tt(e,s,r,t,i,a,o),Z.utcInstance]}function ds(n){const[,e,t,r,s,i,a,o]=n;return[Tt(e,o,t,r,s,i,a),Z.utcInstance]}const fs=ve(Jr,vt),hs=ve(Br,vt),ms=ve(jr,vt),ys=ve(Fn),gs=he(Vn,me,Oe),ws=he(Qr,me,Oe),ps=he(Kr,me,Oe),Ss=he(me,Oe);function vs(n){return Te(n,[fs,gs],[hs,ws],[ms,ps],[ys,Ss])}function Ts(n){return Te(os(n),[is,as])}function Os(n){return Te(n,[us,$t],[ls,$t],[cs,ds])}function ks(n){return Te(n,[ns,rs])}const Ms=he(me);function Es(n){return Te(n,[ts,Ms])}const Ns=ve(Xr,es),Is=ve(Cn),Ds=he(Vn,me,Oe,_n),xs=he(me,Oe,_n);function bs(n){return Te(n,[Ns,Ds],[Is,xs])}const Fs="Invalid Duration",Ln={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Cs=m({years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3}},Ln),U=146097/400,we=146097/4800,Vs=m({years:{quarters:4,months:12,weeks:U/7,days:U,hours:U*24,minutes:U*24*60,seconds:U*24*60*60,milliseconds:U*24*60*60*1e3},quarters:{months:3,weeks:U/28,days:U/4,hours:U*24/4,minutes:U*24*60/4,seconds:U*24*60*60/4,milliseconds:U*24*60*60*1e3/4},months:{weeks:we/7,days:we,hours:we*24,minutes:we*24*60,seconds:we*24*60*60,milliseconds:we*24*60*60*1e3}},Ln),ce=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],_s=ce.slice(0).reverse();function le(n,e,t=!1){const r={values:t?e.values:m(m({},n.values),e.values||{}),loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new O(r)}function Ls(n){return n<0?Math.floor(n):Math.ceil(n)}function An(n,e,t,r,s){const i=n[s][t],a=e[t]/i,o=Math.sign(a)===Math.sign(r[s]),u=!o&&r[s]!==0&&Math.abs(a)<=1?Ls(a):Math.trunc(a);r[s]+=u,e[t]-=u*i}function As(n,e){_s.reduce((t,r)=>T(e[r])?t:(t&&An(n,e,t,e,r),r),null)}class O{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||x.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Vs:Cs,this.isLuxonDuration=!0}static fromMillis(e,t){return O.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new P(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new O({values:Ue(e,O.normalizeUnit),loc:x.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(de(e))return O.fromMillis(e);if(O.isDuration(e))return e;if(typeof e=="object")return O.fromObject(e);throw new P(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=ks(e);return r?O.fromObject(r,t):O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=Es(e);return r?O.fromObject(r,t):O.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new P("need to specify a reason the Duration is invalid");const r=e instanceof j?e:new j(e,t);if(A.throwOnInvalid)throw new cr(r);return new O({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Kt(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r=ee(m({},t),{floor:t.round!==!1&&t.floor!==!1});return this.isValid?H.create(this.loc,r).formatDurationFromString(this,e):Fs}toHuman(e={}){const t=ce.map(r=>{const s=this.values[r];return T(s)?null:this.loc.numberFormatter(ee(m({style:"unit",unitDisplay:"long"},e),{unit:r.slice(0,-1)})).format(s)}).filter(r=>r);return this.loc.listFormatter(m({type:"conjunction",style:e.listStyle||"narrow"},e)).format(t)}toObject(){return this.isValid?m({},this.values):{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=gt(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e=m({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e);const r=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||r.milliseconds!==0)&&(s+=".SSS"));let i=r.toFormat(s);return e.includePrefix&&(i="T"+i),i}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=O.fromDurationLike(e),r={};for(const s of ce)(Se(t.values,s)||Se(this.values,s))&&(r[s]=t.get(s)+this.get(s));return le(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=O.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=Tn(e(this.values[r],r));return le(this,{values:t},!0)}get(e){return this[O.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t=m(m({},this.values),Ue(e,O.normalizeUnit));return le(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),i={loc:s};return r&&(i.conversionAccuracy=r),le(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return As(this.matrix,e),le(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>O.normalizeUnit(a));const t={},r={},s=this.toObject();let i;for(const a of ce)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in r)o+=this.matrix[l][a]*r[l],r[l]=0;de(s[a])&&(o+=s[a]);const u=Math.trunc(o);t[a]=u,r[a]=(o*1e3-u*1e3)/1e3;for(const l in s)ce.indexOf(l)>ce.indexOf(a)&&An(this.matrix,s,l,t,a)}else de(s[a])&&(r[a]=s[a]);for(const a in r)r[a]!==0&&(t[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return le(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return le(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(r,s){return r===void 0||r===0?s===void 0||s===0:r===s}for(const r of ce)if(!t(this.values[r],e.values[r]))return!1;return!0}}const ke="Invalid Interval";function $s(n,e){return!n||!n.isValid?C.invalid("missing or invalid start"):!e||!e.isValid?C.invalid("missing or invalid end"):e<n?C.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class C{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new P("need to specify a reason the Interval is invalid");const r=e instanceof j?e:new j(e,t);if(A.throwOnInvalid)throw new lr(r);return new C({invalid:r})}static fromDateTimes(e,t){const r=Ne(e),s=Ne(t),i=$s(r,s);return i==null?new C({start:r,end:s}):i}static after(e,t){const r=O.fromDurationLike(t),s=Ne(e);return C.fromDateTimes(s,s.plus(r))}static before(e,t){const r=O.fromDurationLike(t),s=Ne(e);return C.fromDateTimes(s.minus(r),s)}static fromISO(e,t){const[r,s]=(e||"").split("/",2);if(r&&s){let i,a;try{i=g.fromISO(r,t),a=i.isValid}catch{a=!1}let o,u;try{o=g.fromISO(s,t),u=o.isValid}catch{u=!1}if(a&&u)return C.fromDateTimes(i,o);if(a){const l=O.fromISO(s,t);if(l.isValid)return C.after(i,l)}else if(u){const l=O.fromISO(r,t);if(l.isValid)return C.before(o,l)}}return C.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds"){if(!this.isValid)return NaN;const t=this.start.startOf(e),r=this.end.startOf(e);return Math.floor(r.diff(t,e).get(e))+1}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?C.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ne).filter(a=>this.contains(a)).sort(),r=[];let{s}=this,i=0;for(;s<this.e;){const a=t[i]||this.e,o=+a>+this.e?this.e:a;r.push(C.fromDateTimes(s,o)),s=o,i+=1}return r}splitBy(e){const t=O.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:r}=this,s=1,i;const a=[];for(;r<this.e;){const o=this.start.plus(t.mapUnits(u=>u*s));i=+o>+this.e?this.e:o,a.push(C.fromDateTimes(r,i)),r=i,s+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:C.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return C.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((s,i)=>s.s-i.s).reduce(([s,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[s,i.union(a)]:[s.concat([i]),a]:[s,a],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const s=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)r+=u.type==="s"?1:-1,r===1?t=u.time:(t&&+t!=+u.time&&s.push(C.fromDateTimes(t,u.time)),t=null);return C.merge(s)}difference(...e){return C.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:ke}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ke}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ke}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ke}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ke}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):O.invalid(this.invalidReason)}mapEndpoints(e){return C.fromDateTimes(e(this.s),e(this.e))}}class $e{static hasDST(e=A.defaultZone){const t=g.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return ne.isValidZone(e)}static normalizeZone(e){return ie(e,A.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||x.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||x.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||x.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||x.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return x.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return x.create(t,null,"gregory").eras(e)}static features(){return{relative:Sn()}}}function Zt(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=t(e)-t(n);return Math.floor(O.fromMillis(r).as("days"))}function Zs(n,e,t){const r=[["years",(o,u)=>u.year-o.year],["quarters",(o,u)=>u.quarter-o.quarter],["months",(o,u)=>u.month-o.month+(u.year-o.year)*12],["weeks",(o,u)=>{const l=Zt(o,u);return(l-l%7)/7}],["days",Zt]],s={};let i,a;for(const[o,u]of r)if(t.indexOf(o)>=0){i=o;let l=u(n,e);a=n.plus({[o]:l}),a>e?(n=n.plus({[o]:l-1}),l-=1):n=a,s[o]=l}return[n,s,a,i]}function qs(n,e,t,r){let[s,i,a,o]=Zs(n,e,t);const u=e-s,l=t.filter(M=>["hours","minutes","seconds","milliseconds"].indexOf(M)>=0);l.length===0&&(a<e&&(a=s.plus({[o]:1})),a!==s&&(i[o]=(i[o]||0)+u/(a-s)));const w=O.fromObject(i,r);return l.length>0?O.fromMillis(u,r).shiftTo(...l).plus(w):w}const Ot={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},qt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Hs=Ot.hanidec.replace(/[\[|\]]/g,"").split("");function Ws(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);if(n[t].search(Ot.hanidec)!==-1)e+=Hs.indexOf(n[t]);else for(const s in qt){const[i,a]=qt[s];r>=i&&r<=a&&(e+=r-i)}}return parseInt(e,10)}else return e}function J({numberingSystem:n},e=""){return new RegExp(`${Ot[n||"latn"]}${e}`)}const zs="missing Intl.DateTimeFormat.formatToParts support";function k(n,e=t=>t){return{regex:n,deser:([t])=>e(Ws(t))}}const Rs=String.fromCharCode(160),$n=`( |${Rs})`,Zn=new RegExp($n,"g");function Us(n){return n.replace(/\./g,"\\.?").replace(Zn,$n)}function Ht(n){return n.replace(/\./g,"").replace(Zn," ").toLowerCase()}function B(n,e){return n===null?null:{regex:RegExp(n.map(Us).join("|")),deser:([t])=>n.findIndex(r=>Ht(t)===Ht(r))+e}}function Wt(n,e){return{regex:n,deser:([,t,r])=>Ge(t,r),groups:e}}function nt(n){return{regex:n,deser:([e])=>e}}function Ps(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ys(n,e){const t=J(e),r=J(e,"{2}"),s=J(e,"{3}"),i=J(e,"{4}"),a=J(e,"{6}"),o=J(e,"{1,2}"),u=J(e,"{1,3}"),l=J(e,"{1,6}"),w=J(e,"{1,9}"),M=J(e,"{2,4}"),I=J(e,"{4,6}"),y=_=>({regex:RegExp(Ps(_.val)),deser:([ye])=>ye,literal:!0}),z=(_=>{if(n.literal)return y(_);switch(_.val){case"G":return B(e.eras("short",!1),0);case"GG":return B(e.eras("long",!1),0);case"y":return k(l);case"yy":return k(M,lt);case"yyyy":return k(i);case"yyyyy":return k(I);case"yyyyyy":return k(a);case"M":return k(o);case"MM":return k(r);case"MMM":return B(e.months("short",!0,!1),1);case"MMMM":return B(e.months("long",!0,!1),1);case"L":return k(o);case"LL":return k(r);case"LLL":return B(e.months("short",!1,!1),1);case"LLLL":return B(e.months("long",!1,!1),1);case"d":return k(o);case"dd":return k(r);case"o":return k(u);case"ooo":return k(s);case"HH":return k(r);case"H":return k(o);case"hh":return k(r);case"h":return k(o);case"mm":return k(r);case"m":return k(o);case"q":return k(o);case"qq":return k(r);case"s":return k(o);case"ss":return k(r);case"S":return k(u);case"SSS":return k(s);case"u":return nt(w);case"uu":return nt(o);case"uuu":return k(t);case"a":return B(e.meridiems(),0);case"kkkk":return k(i);case"kk":return k(M,lt);case"W":return k(o);case"WW":return k(r);case"E":case"c":return k(t);case"EEE":return B(e.weekdays("short",!1,!1),1);case"EEEE":return B(e.weekdays("long",!1,!1),1);case"ccc":return B(e.weekdays("short",!0,!1),1);case"cccc":return B(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Wt(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Wt(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return nt(/[a-z_+-/]{1,256}?/i);default:return y(_)}})(n)||{invalidReason:zs};return z.token=n,z}const Gs={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function Js(n,e,t){const{type:r,value:s}=n;if(r==="literal")return{literal:!0,val:s};const i=t[r];let a=Gs[r];if(typeof a=="object"&&(a=a[i]),a)return{literal:!1,val:a}}function Bs(n){return[`^${n.map(t=>t.regex).reduce((t,r)=>`${t}(${r.source})`,"")}$`,n]}function js(n,e,t){const r=n.match(e);if(r){const s={};let i=1;for(const a in t)if(Se(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(i,i+u))),i+=u}return[r,s]}else return[r,{}]}function Qs(n){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,r;return T(n.z)||(t=ne.create(n.z)),T(n.Z)||(t||(t=new Z(n.Z)),r=n.Z),T(n.q)||(n.M=(n.q-1)*3+1),T(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),T(n.u)||(n.S=yt(n.u)),[Object.keys(n).reduce((i,a)=>{const o=e(a);return o&&(i[o]=n[a]),i},{}),t,r]}let rt=null;function Ks(){return rt||(rt=g.fromMillis(1555555555555)),rt}function Xs(n,e){if(n.literal)return n;const t=H.macroTokenToFormatOpts(n.val);if(!t)return n;const i=H.create(e,t).formatDateTimeParts(Ks()).map(a=>Js(a,e,t));return i.includes(void 0)?n:i}function ei(n,e){return Array.prototype.concat(...n.map(t=>Xs(t,e)))}function qn(n,e,t){const r=ei(H.parseFormat(t),n),s=r.map(a=>Ys(a,n)),i=s.find(a=>a.invalidReason);if(i)return{input:e,tokens:r,invalidReason:i.invalidReason};{const[a,o]=Bs(s),u=RegExp(a,"i"),[l,w]=js(e,u,o),[M,I,y]=w?Qs(w):[null,null,void 0];if(Se(w,"a")&&Se(w,"H"))throw new Ie("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:u,rawMatches:l,matches:w,result:M,zone:I,specificOffset:y}}}function ti(n,e,t){const{result:r,zone:s,specificOffset:i,invalidReason:a}=qn(n,e,t);return[r,s,i,a]}const Hn=[0,31,59,90,120,151,181,212,243,273,304,334],Wn=[0,31,60,91,121,152,182,213,244,274,305,335];function Y(n,e){return new j("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function zn(n,e,t){const r=new Date(Date.UTC(n,e-1,t)).getUTCDay();return r===0?7:r}function Rn(n,e,t){return t+(be(n)?Wn:Hn)[e-1]}function Un(n,e){const t=be(n)?Wn:Hn,r=t.findIndex(i=>i<e),s=e-t[r];return{month:r+1,day:s}}function mt(n){const{year:e,month:t,day:r}=n,s=Rn(e,t,r),i=zn(e,t,r);let a=Math.floor((s-i+10)/7),o;return a<1?(o=e-1,a=Re(o)):a>Re(e)?(o=e+1,a=1):o=e,m({weekYear:o,weekNumber:a,weekday:i},Je(n))}function zt(n){const{weekYear:e,weekNumber:t,weekday:r}=n,s=zn(e,1,4),i=xe(e);let a=t*7+r-s-3,o;a<1?(o=e-1,a+=xe(o)):a>i?(o=e+1,a-=xe(e)):o=e;const{month:u,day:l}=Un(o,a);return m({year:o,month:u,day:l},Je(n))}function st(n){const{year:e,month:t,day:r}=n,s=Rn(e,t,r);return m({year:e,ordinal:s},Je(n))}function Rt(n){const{year:e,ordinal:t}=n,{month:r,day:s}=Un(e,t);return m({year:e,month:r,day:s},Je(n))}function ni(n){const e=Ye(n.weekYear),t=te(n.weekNumber,1,Re(n.weekYear)),r=te(n.weekday,1,7);return e?t?r?!1:Y("weekday",n.weekday):Y("week",n.week):Y("weekYear",n.weekYear)}function ri(n){const e=Ye(n.year),t=te(n.ordinal,1,xe(n.year));return e?t?!1:Y("ordinal",n.ordinal):Y("year",n.year)}function Pn(n){const e=Ye(n.year),t=te(n.month,1,12),r=te(n.day,1,ze(n.year,n.month));return e?t?r?!1:Y("day",n.day):Y("month",n.month):Y("year",n.year)}function Yn(n){const{hour:e,minute:t,second:r,millisecond:s}=n,i=te(e,0,23)||e===24&&t===0&&r===0&&s===0,a=te(t,0,59),o=te(r,0,59),u=te(s,0,999);return i?a?o?u?!1:Y("millisecond",s):Y("second",r):Y("minute",t):Y("hour",e)}const it="Invalid DateTime",Ut=864e13;function Ze(n){return new j("unsupported zone",`the zone "${n.name}" is not supported`)}function at(n){return n.weekData===null&&(n.weekData=mt(n.c)),n.weekData}function Me(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new g(ee(m(m({},t),e),{old:t}))}function Gn(n,e,t){let r=n-e*60*1e3;const s=t.offset(r);if(e===s)return[r,e];r-=(s-e)*60*1e3;const i=t.offset(r);return s===i?[r,s]:[n-Math.min(s,i)*60*1e3,Math.max(s,i)]}function Pt(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function We(n,e,t){return Gn(wt(n),e,t)}function Yt(n,e){const t=n.o,r=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i=ee(m({},n.c),{year:r,month:s,day:Math.min(n.c.day,ze(r,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7}),a=O.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=wt(i);let[u,l]=Gn(o,t,n.zone);return a!==0&&(u+=a,l=n.zone.offset(u)),{ts:u,o:l}}function Ee(n,e,t,r,s,i){const{setZone:a,zone:o}=t;if(n&&Object.keys(n).length!==0){const u=e||o,l=g.fromObject(n,ee(m({},t),{zone:u,specificOffset:i}));return a?l:l.setZone(o)}else return g.invalid(new j("unparsable",`the input "${s}" can't be parsed as ${r}`))}function qe(n,e,t=!0){return n.isValid?H.create(x.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function ot(n,e){const t=n.c.year>9999||n.c.year<0;let r="";return t&&n.c.year>=0&&(r+="+"),r+=L(n.c.year,t?6:4),e?(r+="-",r+=L(n.c.month),r+="-",r+=L(n.c.day)):(r+=L(n.c.month),r+=L(n.c.day)),r}function Gt(n,e,t,r,s){let i=L(n.c.hour);return e?(i+=":",i+=L(n.c.minute),(n.c.second!==0||!t)&&(i+=":")):i+=L(n.c.minute),(n.c.second!==0||!t)&&(i+=L(n.c.second),(n.c.millisecond!==0||!r)&&(i+=".",i+=L(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0?i+="Z":n.o<0?(i+="-",i+=L(Math.trunc(-n.o/60)),i+=":",i+=L(Math.trunc(-n.o%60))):(i+="+",i+=L(Math.trunc(n.o/60)),i+=":",i+=L(Math.trunc(n.o%60)))),i}const Jn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},si={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ii={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Bn=["year","month","day","hour","minute","second","millisecond"],ai=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],oi=["year","ordinal","hour","minute","second","millisecond"];function Jt(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Kt(n);return e}function Bt(n,e){const t=ie(e.zone,A.defaultZone),r=x.fromObject(e),s=A.now();let i,a;if(T(n.year))i=s;else{for(const l of Bn)T(n[l])&&(n[l]=Jn[l]);const o=Pn(n)||Yn(n);if(o)return g.invalid(o);const u=t.offset(s);[i,a]=We(n,u,t)}return new g({ts:i,zone:t,loc:r,o:a})}function jt(n,e,t){const r=T(t.round)?!0:t.round,s=(a,o)=>(a=gt(a,r||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(n,a)?0:e.startOf(a).diff(n.startOf(a),a).get(a):e.diff(n,a).get(a);if(t.unit)return s(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return s(o,a)}return s(n>e?-0:0,t.units[t.units.length-1])}function Qt(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class g{constructor(e){const t=e.zone||A.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new j("invalid input"):null)||(t.isValid?null:Ze(t));this.ts=T(e.ts)?A.now():e.ts;let s=null,i=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,i]=[e.old.c,e.old.o];else{const o=t.offset(this.ts);s=Pt(this.ts,o),r=Number.isNaN(s.year)?new j("invalid input"):null,s=r?null:s,i=r?null:o}this._zone=t,this.loc=e.loc||x.create(),this.invalid=r,this.weekData=null,this.c=s,this.o=i,this.isLuxonDateTime=!0}static now(){return new g({})}static local(){const[e,t]=Qt(arguments),[r,s,i,a,o,u,l]=t;return Bt({year:r,month:s,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=Qt(arguments),[r,s,i,a,o,u,l]=t;return e.zone=Z.utcInstance,Bt({year:r,month:s,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const r=mr(e)?e.valueOf():NaN;if(Number.isNaN(r))return g.invalid("invalid input");const s=ie(t.zone,A.defaultZone);return s.isValid?new g({ts:r,zone:s,loc:x.fromObject(t)}):g.invalid(Ze(s))}static fromMillis(e,t={}){if(de(e))return e<-Ut||e>Ut?g.invalid("Timestamp out of range"):new g({ts:e,zone:ie(t.zone,A.defaultZone),loc:x.fromObject(t)});throw new P(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(de(e))return new g({ts:e*1e3,zone:ie(t.zone,A.defaultZone),loc:x.fromObject(t)});throw new P("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=ie(t.zone,A.defaultZone);if(!r.isValid)return g.invalid(Ze(r));const s=A.now(),i=T(t.specificOffset)?r.offset(s):t.specificOffset,a=Ue(e,Jt),o=!T(a.ordinal),u=!T(a.year),l=!T(a.month)||!T(a.day),w=u||l,M=a.weekYear||a.weekNumber,I=x.fromObject(t);if((w||o)&&M)throw new Ie("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new Ie("Can't mix ordinal dates with month/day");const y=M||a.weekday&&!w;let $,z,_=Pt(s,i);y?($=ai,z=si,_=mt(_)):o?($=oi,z=ii,_=st(_)):($=Bn,z=Jn);let ye=!1;for(const h of $){const p=a[h];T(p)?ye?a[h]=z[h]:a[h]=_[h]:ye=!0}const q=y?ni(a):o?ri(a):Pn(a),Ce=q||Yn(a);if(Ce)return g.invalid(Ce);const Be=y?zt(a):o?Rt(a):a,[je,Qe]=We(Be,i,r),S=new g({ts:je,zone:r,o:Qe,loc:I});return a.weekday&&w&&e.weekday!==S.weekday?g.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${S.toISO()}`):S}static fromISO(e,t={}){const[r,s]=vs(e);return Ee(r,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,s]=Ts(e);return Ee(r,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,s]=Os(e);return Ee(r,s,t,"HTTP",t)}static fromFormat(e,t,r={}){if(T(e)||T(t))throw new P("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:i=null}=r,a=x.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0}),[o,u,l,w]=ti(a,e,t);return w?g.invalid(w):Ee(o,u,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return g.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,s]=bs(e);return Ee(r,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new P("need to specify a reason the DateTime is invalid");const r=e instanceof j?e:new j(e,t);if(A.throwOnInvalid)throw new ur(r);return new g({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?at(this).weekYear:NaN}get weekNumber(){return this.isValid?at(this).weekNumber:NaN}get weekday(){return this.isValid?at(this).weekday:NaN}get ordinal(){return this.isValid?st(this.c).ordinal:NaN}get monthShort(){return this.isValid?$e.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?$e.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?$e.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?$e.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return be(this.year)}get daysInMonth(){return ze(this.year,this.month)}get daysInYear(){return this.isValid?xe(this.year):NaN}get weeksInWeekYear(){return this.isValid?Re(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:s}=H.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(Z.instance(e),t)}toLocal(){return this.setZone(A.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if(e=ie(e,A.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||r){const i=e.offset(this.ts),a=this.toObject();[s]=We(a,i,e)}return Me(this,{ts:s,zone:e})}else return g.invalid(Ze(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return Me(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Ue(e,Jt),r=!T(t.weekYear)||!T(t.weekNumber)||!T(t.weekday),s=!T(t.ordinal),i=!T(t.year),a=!T(t.month)||!T(t.day),o=i||a,u=t.weekYear||t.weekNumber;if((o||s)&&u)throw new Ie("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new Ie("Can't mix ordinal dates with month/day");let l;r?l=zt(m(m({},mt(this.c)),t)):T(t.ordinal)?(l=m(m({},this.toObject()),t),T(t.day)&&(l.day=Math.min(ze(l.year,l.month),l.day))):l=Rt(m(m({},st(this.c)),t));const[w,M]=We(l,this.o,this.zone);return Me(this,{ts:w,o:M})}plus(e){if(!this.isValid)return this;const t=O.fromDurationLike(e);return Me(this,Yt(this,t))}minus(e){if(!this.isValid)return this;const t=O.fromDurationLike(e).negate();return Me(this,Yt(this,t))}startOf(e){if(!this.isValid)return this;const t={},r=O.normalizeUnit(e);switch(r){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(r==="weeks"&&(t.weekday=1),r==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?H.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):it}toLocaleString(e=ut,t={}){return this.isValid?H.create(this.loc.clone(t),e).formatDateTime(this):it}toLocaleParts(e={}){return this.isValid?H.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:s=!0}={}){if(!this.isValid)return null;const i=e==="extended";let a=ot(this,i);return a+="T",a+=Gt(this,i,t,r,s),a}toISODate({format:e="extended"}={}){return this.isValid?ot(this,e==="extended"):null}toISOWeekDate(){return qe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:s=!1,format:i="extended"}={}){return this.isValid?(s?"T":"")+Gt(this,i==="extended",t,e,r):null}toRFC2822(){return qe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return qe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ot(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(r&&(s+=" "),t?s+="z":e&&(s+="ZZ")),qe(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():it}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t=m({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return O.invalid("created by diffing an invalid DateTime");const s=m({locale:this.locale,numberingSystem:this.numberingSystem},r),i=yr(t).map(O.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,u=a?e:this,l=qs(o,u,i,s);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(g.now(),e,t)}until(e){return this.isValid?C.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const r=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=r&&r<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||g.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(s=e.unit,i=void 0),jt(t,this.plus(r),ee(m({},e),{numeric:"always",units:s,unit:i}))}toRelativeCalendar(e={}){return this.isValid?jt(e.base||g.fromObject({},{zone:this.zone}),this,ee(m({},e),{numeric:"auto",units:["years","months","days"],calendary:!0})):null}static min(...e){if(!e.every(g.isDateTime))throw new P("min requires all arguments be DateTimes");return Dt(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(g.isDateTime))throw new P("max requires all arguments be DateTimes");return Dt(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:s=null,numberingSystem:i=null}=r,a=x.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0});return qn(a,e,t)}static fromStringExplain(e,t,r={}){return g.fromFormatExplain(e,t,r)}static get DATE_SHORT(){return ut}static get DATE_MED(){return Xt}static get DATE_MED_WITH_WEEKDAY(){return dr}static get DATE_FULL(){return en}static get DATE_HUGE(){return tn}static get TIME_SIMPLE(){return nn}static get TIME_WITH_SECONDS(){return rn}static get TIME_WITH_SHORT_OFFSET(){return sn}static get TIME_WITH_LONG_OFFSET(){return an}static get TIME_24_SIMPLE(){return on}static get TIME_24_WITH_SECONDS(){return un}static get TIME_24_WITH_SHORT_OFFSET(){return ln}static get TIME_24_WITH_LONG_OFFSET(){return cn}static get DATETIME_SHORT(){return dn}static get DATETIME_SHORT_WITH_SECONDS(){return fn}static get DATETIME_MED(){return hn}static get DATETIME_MED_WITH_SECONDS(){return mn}static get DATETIME_MED_WITH_WEEKDAY(){return fr}static get DATETIME_FULL(){return yn}static get DATETIME_FULL_WITH_SECONDS(){return gn}static get DATETIME_HUGE(){return wn}static get DATETIME_HUGE_WITH_SECONDS(){return pn}}function Ne(n){if(g.isDateTime(n))return n;if(n&&n.valueOf&&de(n.valueOf()))return g.fromJSDate(n);if(n&&typeof n=="object")return g.fromObject(n);throw new P(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const V=n=>(ir("data-v-ba8c6c0c"),n=n(),ar(),n),ui={key:0,class:"config"},li=V(()=>f("h3",null,"Config:",-1)),ci=V(()=>f("h3",null,"Meta data:",-1)),di=V(()=>f("hr",null,null,-1)),fi=V(()=>f("h3",null,"Days:",-1)),hi=V(()=>f("th",null,"Date",-1)),mi=ae("Hours"),yi=[mi],gi=ae("Count on"),wi=[gi],pi=ae("Count off"),Si=[pi],vi=ae("Avg price"),Ti=[vi],Oi=ae("Count saved"),ki=[Oi],Mi=ae("Sum saved"),Ei=[Mi],Ni=ae("Avg saved 1"),Ii=[Ni],Di=ae("Avg saved 2"),xi=[Di],bi=V(()=>f("h3",null,"Hours:",-1)),Fi=V(()=>f("label",{for:"showNegative"},"Show negative",-1)),Ci=V(()=>f("label",{style:{"margin-left":"40px"}},"Show saving per sequence as:",-1)),Vi=V(()=>f("label",{for:"sum"},"Sum",-1)),_i=V(()=>f("label",{for:"avg"},"Average",-1)),Li=V(()=>f("th",{colspan:"5"},"Input data",-1)),Ai=V(()=>f("th",{class:"sepcol"},null,-1)),$i=["colspan"],Zi=V(()=>f("th",{class:"sepcol"},null,-1)),qi=["colspan"],Hi=V(()=>f("th",null,"Date",-1)),Wi=V(()=>f("th",null,"Hour",-1)),zi=V(()=>f("th",null,"Price",-1)),Ri=V(()=>f("th",null,"On/Off",-1)),Ui=V(()=>f("th",null,"Saving",-1)),Pi=V(()=>f("th",{class:"sepcol"},null,-1)),Yi=V(()=>f("th",{class:"sepcol"},null,-1)),Gi=V(()=>f("td",{class:"sepcol"},null,-1)),Ji=["onClick"],Bi=V(()=>f("td",{class:"sepcol"},null,-1)),ji=["onClick"],Qi={setup(n){const e=_e(""),t=_e(!1),r=_e("avg"),s=Nt(()=>r.value==="sum");function i(S){return Math.round(S*1e4)/1e4}const a=_e("");er(a,S=>{u(S),y(),z.length=0,_.row=null,_.col=null,q.row=null,q.col=null});const o=G({});function u(S){var h;try{const p=JSON.parse(S),d=(h=p.payload)!=null?h:p;Object.keys(d).forEach(v=>o[v]=d[v]),e.value=""}catch{e.value="No legal JSON data"}}const l=G([]),w=G([]),M=G([]),I=G([]);function y(){console.log("calculatePotentialSavings"),console.log({roundPrice:i});const S=o.hours;for(let h=0;h<o.config.maxHoursToSaveInSequence;h++)w[h]=h+1;for(let h=0;h<S.length;h++){const p=G([]);for(let d=0;d<w.length;d++)p[d]=h+d+1<S.length?i(S[h].price-S[h+d+1].price):null;l[h]=p}for(let h=0;h<S.length;h++){const p=G([]),d=G([]);for(let v=0;v<w.length;v++){p[v]=0;for(let D=0;D<=v;D++){const K=p[v]+(h+D<S.length?l[h+D][v-D]:0);p[v]=i(K),d[v]=i(K/(v+1))}M[h]=p,I[h]=d}}}const $=Nt(()=>{const S=o.hours,p=[...new Set(S.map(d=>g.fromISO(d.start).toISODate()))].map(d=>({date:d}));return p.forEach(d=>{const v=S.filter(D=>g.fromISO(D.start).toISODate()===d.date);d.countHours=v.length,d.countOn=v.filter(D=>D.onOff).length,d.countOff=v.filter(D=>!D.onOff).length,d.countSaved=v.filter(D=>D.saving!==null).length,d.avgPrice=i(v.reduce((D,K)=>D+K.price,0)/d.countHours),d.sumSaved=d.countSaved>0?i(v.reduce((D,K)=>D+K.saving,0)):null,d.avgSaved1=d.countSaved>0?i(d.sumSaved/d.countSaved):null,d.avgSaved2=d.countSaved>0?i(d.sumSaved/d.countHours):null}),p}),z=G([]),_=G({row:null,col:null});function ye(S,h){const p=S===_.row&&h===_.col;z.length=0,_.row=p?null:S,_.col=p?null:h;for(let d=0;d<=h&&!p;d++)z.push({row:S+d,col:h-d})}const q=G({row:null,col:null});function Ce(S,h){const p=S===q.row&&h===q.col;q.row=p?null:S,q.col=p?null:h}function Be(S){return(q.row===null?!1:q.row===S||q.row+q.col===S-1)?"highlightSaving ":" "}function je(S,h){const p=z.some(D=>D.row===S&&D.col===h),d=S===q.row&&h===q.col,v="selectable ";return p&d?v+"highlightBoth":p?v+"highlightSequence":d?v+"highlightSaving":v}function Qe(S,h){let p=_.row===S&&_.col===h?"highlightSequence ":" ";return I[S][h]<o.config.minSaving&&(p=p+"belowMin "),p+"selectable"}return(S,h)=>{const p=tr("tooltip");return b(),F(oe,null,[R(f("textarea",{rows:"5",cols:"80",name:"rawData",placeHolder:"Paste data here","onUpdate:modelValue":h[0]||(h[0]=d=>a.value=d)},null,512),[[nr,a.value]]),f("p",null,E(e.value),1),e.value===""&&N(o).version?(b(),F("div",ui,[li,f("p",null,"Max in sequence: "+E(N(o).config.maxHoursToSaveInSequence),1),f("p",null,"Min on after max: "+E(N(o).config.minHoursOnAfterMaxSequenceSaved),1),f("p",null,"Minimum saving: "+E(N(o).config.minSaving),1),f("p",null," Send when rescheduling: "+E(N(o).config.sendCurrentValueWhenRescheduling?"Yes":"No"),1),f("p",null," If no schedule, output: "+E(N(o).config.outputIfNoSchedule?"On":"Off"),1),ci,f("p",null,"Node version: "+E(N(o).version),1),f("p",null,"Data timestamp: "+E(N(o).time),1),f("p",null,"Price source: "+E(N(o).source),1),f("p",null,"Current output: "+E(N(o).current?"On":"Off"),1),di,fi,f("table",null,[f("tr",null,[hi,R((b(),F("th",null,yi)),[[p,"Number of hours for the day"]]),R((b(),F("th",null,wi)),[[p,"Number of hours that are on"]]),R((b(),F("th",null,Si)),[[p,"Number of hours that are off"]]),R((b(),F("th",null,Ti)),[[p,"Average price for the day"]]),R((b(),F("th",null,ki)),[[p,"Number of hours that are turned off (saved)"]]),R((b(),F("th",null,Ei)),[[p,"Sum saved per kWh for the hours that are saved"]]),R((b(),F("th",null,Ii)),[[p,"Sum saved / count saved"]]),R((b(),F("th",null,xi)),[[p,"Sum saved / Hours (whole day)"]])]),(b(!0),F(oe,null,ge(N($),d=>(b(),F("tr",{key:d.date},[f("td",null,E(d.date),1),f("td",null,E(d.countHours),1),f("td",null,E(d.countOn),1),f("td",null,E(d.countOff),1),f("td",null,E(d.avgPrice),1),f("td",null,E(d.countSaved),1),f("td",null,E(d.sumSaved),1),f("td",null,E(d.avgSaved1),1),f("td",null,E(d.avgSaved2),1)]))),128))]),bi,f("div",null,[R(f("input",{type:"checkbox",id:"showNegative","onUpdate:modelValue":h[1]||(h[1]=d=>t.value=d)},null,512),[[rr,t.value]]),Fi,Ci,R(f("input",{type:"radio",id:"sum",value:"sum","onUpdate:modelValue":h[2]||(h[2]=d=>r.value=d)},null,512),[[It,r.value]]),Vi,R(f("input",{type:"radio",id:"avg",value:"avg","onUpdate:modelValue":h[3]||(h[3]=d=>r.value=d)},null,512),[[It,r.value]]),_i]),f("table",null,[f("tr",null,[Li,Ai,f("th",{colspan:N(w).length},"Saving if turned off x hours",8,$i),Zi,f("th",{colspan:N(w).length},"Saving for sequence of x hours",8,qi)]),f("tr",null,[Hi,Wi,zi,Ri,Ui,Pi,(b(!0),F(oe,null,ge(N(w),d=>(b(),F("th",{key:d},E(d),1))),128)),Yi,(b(!0),F(oe,null,ge(N(w),d=>(b(),F("th",{key:d},E(d),1))),128))]),(b(!0),F(oe,null,ge(N(o).hours,(d,v)=>{var D;return b(),F("tr",{key:d.start},[f("td",null,E(N(g).fromISO(d.start).day),1),f("td",null,E(N(g).fromISO(d.start).toLocaleString(N(g).TIME_SIMPLE)),1),f("td",{class:Xe(Be(v))},E(d.price),3),f("td",null,E(d.onOff?"On":"Off"),1),f("td",null,E((D=d.saving)!=null?D:""),1),Gi,(b(!0),F(oe,null,ge(N(w),(K,X)=>(b(),F("td",{key:K,onClick:jn=>Ce(v,X),class:Xe(je(v,X))},E(t.value||N(l)[v][X]>0?N(l)[v][X]:""),11,Ji))),128)),Bi,(b(!0),F(oe,null,ge(N(w),(K,X)=>(b(),F("td",{key:K,onClick:jn=>ye(v,X),class:Xe(Qe(v,X))},E(t.value||N(M)[v][X]>0?""+(N(s)?N(M)[v][X]:N(I)[v][X]):""),11,ji))),128))])}),128))])])):sr("",!0)],64)}}};var ta=or(Qi,[["__scopeId","data-v-ba8c6c0c"]]);export{ta as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o,d as n,F as s,p as r,k as p,f as e}from"./app.b3d8926b.js";import{_ as i}from"./plugin-vue_export-helper.21dcd24c.js";const c={},a=t=>(r("data-v-611afafb"),t=t(),p(),t),d=a(()=>e("div",{class:"box"},[e("div",{class:"left"},[e("form",{action:"https://www.paypal.com/donate",method:"post",target:"_blank"},[e("input",{type:"hidden",name:"business",value:"5K5SRZU27TAC8"}),e("input",{type:"hidden",name:"no_recurring",value:"0"}),e("input",{type:"hidden",name:"item_name",value:"One of my hobbies is creating software for smart homes"}),e("input",{type:"hidden",name:"currency_code",value:"NOK"}),e("input",{type:"image",src:"https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif",border:"0",name:"submit",title:"PayPal - The safer, easier way to pay online!",alt:"Donate with PayPal button"})])]),e("div",{class:"right"},[e("a",{class:"patreonButton",href:"https://www.patreon.com/bePatron?u=65948417","data-patreon-widget-type":"become-patron-button",target:"_blank"},"Become a Patron! ")])],-1)),_=a(()=>e("div",null,[e("br")],-1));function l(t,u){return o(),n(s,null,[d,_],64)}var h=i(c,[["render",l],["__scopeId","data-v-611afafb"]]);export{h as default};
|