eatopia-ds 0.0.948 → 0.0.950
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/build/index10.js +327 -299
- package/build/index10.js.map +1 -1
- package/build/index11.js +23 -21
- package/build/index11.js.map +1 -1
- package/build/index18.js +657 -570
- package/build/index18.js.map +1 -1
- package/build/index31.js +2 -2
- package/build/index32.js +1 -1
- package/build/index34.js +2 -2
- package/build/index35.js +1 -1
- package/build/index46.js.map +1 -1
- package/build/index47.js +66 -52
- package/build/index47.js.map +1 -1
- package/build/index48.js +26 -22
- package/build/index48.js.map +1 -1
- package/build/index49.js.map +1 -1
- package/build/index50.js +52 -66
- package/build/index50.js.map +1 -1
- package/build/index51.js +22 -26
- package/build/index51.js.map +1 -1
- package/package.json +1 -1
package/build/index18.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
const
|
|
1
|
+
import { j as a } from "./index24.js";
|
|
2
|
+
import { useMemo as L, useCallback as P, useRef as et, useState as J, useEffect as xt } from "react";
|
|
3
|
+
import { createPortal as De } from "react-dom";
|
|
4
|
+
const Me = {
|
|
5
5
|
light: {
|
|
6
6
|
stockSafe: "#00E676",
|
|
7
7
|
stockPast: "#c4ccd0",
|
|
@@ -50,7 +50,7 @@ const fe = {
|
|
|
50
50
|
selectedQtyBar: "#42A5F5"
|
|
51
51
|
// Azul mais claro para tema escuro
|
|
52
52
|
}
|
|
53
|
-
},
|
|
53
|
+
}, Fe = {
|
|
54
54
|
sm: {
|
|
55
55
|
height: 170,
|
|
56
56
|
segmentRatio: 0.2,
|
|
@@ -96,35 +96,60 @@ const fe = {
|
|
|
96
96
|
pillPaddingY: 4,
|
|
97
97
|
pillFontSize: 11
|
|
98
98
|
}
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
}, Ce = (i) => {
|
|
100
|
+
i.roundRect || (i.roundRect = function(b, v, S, E, c) {
|
|
101
|
+
S < 2 * c && (c = S / 2), E < 2 * c && (c = E / 2), this.beginPath(), this.moveTo(b + c, v), this.arcTo(b + S, v, b + S, v + E, c), this.arcTo(b + S, v + E, b, v + E, c), this.arcTo(b, v + E, b, v, c), this.arcTo(b, v, b + S, v, c), this.closePath();
|
|
102
102
|
});
|
|
103
|
-
},
|
|
104
|
-
const
|
|
105
|
-
return "#" + (16777216 + (
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
}, bt = (i, b) => {
|
|
104
|
+
const v = parseInt(i.replace("#", ""), 16), S = Math.round(2.55 * b), E = (v >> 16) + S, c = (v >> 8 & 255) + S, w = (v & 255) + S;
|
|
105
|
+
return "#" + (16777216 + (E < 255 ? E < 1 ? 0 : E : 255) * 65536 + (c < 255 ? c < 1 ? 0 : c : 255) * 256 + (w < 255 ? w < 1 ? 0 : w : 255)).toString(16).slice(1);
|
|
106
|
+
};
|
|
107
|
+
function se(i) {
|
|
108
|
+
const b = i.split("-").map(Number);
|
|
109
|
+
return b.length !== 3 || b.some(Number.isNaN) ? /* @__PURE__ */ new Date(NaN) : new Date(b[0], b[1] - 1, b[2]);
|
|
110
|
+
}
|
|
111
|
+
function K(i) {
|
|
112
|
+
const b = i.split("T")[0], v = i.includes("T") ? i.split("T")[1] : null, S = se(b);
|
|
113
|
+
if (isNaN(S.getTime())) return S;
|
|
114
|
+
if (v) {
|
|
115
|
+
const [E, c, w] = v.split(":"), m = parseInt(E ?? "0", 10), nt = parseInt(c ?? "0", 10), Ft = w !== void 0 && parseInt(w.slice(0, 2), 10) || 0, s = w != null && w.includes(".") && parseInt(w.split(".")[1].slice(0, 3), 10) || 0;
|
|
116
|
+
Number.isNaN(m) || S.setHours(m, nt, Ft, s);
|
|
117
|
+
}
|
|
118
|
+
return S;
|
|
119
|
+
}
|
|
120
|
+
function Bt(i) {
|
|
121
|
+
return i.includes("T") ? K(i) : yt(se(i));
|
|
122
|
+
}
|
|
123
|
+
function yt(i) {
|
|
124
|
+
const b = new Date(i);
|
|
125
|
+
return b.setHours(23, 59, 59, 999), b;
|
|
126
|
+
}
|
|
127
|
+
const Ee = (i) => {
|
|
128
|
+
const b = K(i.todayDate).getTime(), v = Bt(i.stockEndDate).getTime(), S = K(i.deliveryDate).getTime(), E = K(
|
|
129
|
+
i.restockSuggestionStart
|
|
130
|
+
).getTime(), c = Bt(
|
|
131
|
+
i.restockSuggestionEnd
|
|
132
|
+
).getTime();
|
|
133
|
+
if (S >= v) {
|
|
134
|
+
const m = Math.ceil((S - v) / 864e5);
|
|
110
135
|
return {
|
|
111
136
|
status: "critical",
|
|
112
137
|
title: "Risco de Ruptura",
|
|
113
|
-
message:
|
|
138
|
+
message: m > 0 ? `A entrega chegará ${m} dia(s) após o estoque acabar.` : "A entrega está prevista para o mesmo dia do fim do estoque."
|
|
114
139
|
};
|
|
115
140
|
}
|
|
116
|
-
if (
|
|
141
|
+
if (b >= v)
|
|
117
142
|
return {
|
|
118
143
|
status: "critical",
|
|
119
144
|
title: "Estoque Esgotado",
|
|
120
145
|
message: "Seu estoque previsto chegou ao fim."
|
|
121
146
|
};
|
|
122
|
-
const
|
|
123
|
-
return
|
|
147
|
+
const w = Math.floor((v - S) / (1e3 * 60 * 60 * 24));
|
|
148
|
+
return w <= 2 ? {
|
|
124
149
|
status: "urgent",
|
|
125
150
|
title: "Atenção ao Prazo",
|
|
126
|
-
message: `Margem de segurança baixa: entrega prevista para ${
|
|
127
|
-
} :
|
|
151
|
+
message: `Margem de segurança baixa: entrega prevista para ${w} dia(s) antes do fim do estoque.`
|
|
152
|
+
} : b >= E && b <= c ? {
|
|
128
153
|
status: "warning",
|
|
129
154
|
title: "Sugestão de Compra",
|
|
130
155
|
message: "Momento ideal para realizar o pedido de reposição."
|
|
@@ -134,27 +159,28 @@ const fe = {
|
|
|
134
159
|
message: "Nível de estoque adequado. Nenhuma ação necessária."
|
|
135
160
|
};
|
|
136
161
|
};
|
|
137
|
-
function
|
|
138
|
-
data:
|
|
139
|
-
className:
|
|
140
|
-
style:
|
|
141
|
-
controls:
|
|
142
|
-
showLegend:
|
|
162
|
+
function Be({
|
|
163
|
+
data: i,
|
|
164
|
+
className: b,
|
|
165
|
+
style: v,
|
|
166
|
+
controls: S = !1,
|
|
167
|
+
showLegend: E = !0,
|
|
143
168
|
size: c = "md",
|
|
144
|
-
selectedQty:
|
|
145
|
-
selectedQtyDays:
|
|
146
|
-
showSuggestionBar:
|
|
169
|
+
selectedQty: w,
|
|
170
|
+
selectedQtyDays: m,
|
|
171
|
+
showSuggestionBar: nt = !0,
|
|
172
|
+
unitLabel: Ft = "kg"
|
|
147
173
|
}) {
|
|
148
|
-
const
|
|
149
|
-
() =>
|
|
150
|
-
[
|
|
151
|
-
), H =
|
|
152
|
-
() =>
|
|
153
|
-
[
|
|
154
|
-
),
|
|
155
|
-
(
|
|
156
|
-
if (!
|
|
157
|
-
const
|
|
174
|
+
const s = L(() => Fe[c], [c]), p = L(
|
|
175
|
+
() => Me[i.config.theme || "light"],
|
|
176
|
+
[i.config.theme]
|
|
177
|
+
), H = L(
|
|
178
|
+
() => Ee(i.timeline),
|
|
179
|
+
[i.timeline]
|
|
180
|
+
), re = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SAB"], ae = P(
|
|
181
|
+
(e) => {
|
|
182
|
+
if (!i.timeline.dailyConsumptionAverage) return null;
|
|
183
|
+
const g = [
|
|
158
184
|
"0-domingo",
|
|
159
185
|
"1-segunda",
|
|
160
186
|
"2-terca",
|
|
@@ -162,96 +188,101 @@ function Te({
|
|
|
162
188
|
"4-quinta",
|
|
163
189
|
"5-sexta",
|
|
164
190
|
"6-sabado"
|
|
165
|
-
][
|
|
166
|
-
return
|
|
191
|
+
][e];
|
|
192
|
+
return i.timeline.dailyConsumptionAverage[g] ?? null;
|
|
167
193
|
},
|
|
168
|
-
[
|
|
169
|
-
),
|
|
194
|
+
[i]
|
|
195
|
+
), ot = et(null), jt = et(null), [T, Nt] = J({
|
|
170
196
|
isHovering: !1,
|
|
171
197
|
hoveredSection: null,
|
|
172
198
|
mouseX: 0,
|
|
173
199
|
mouseY: 0,
|
|
174
200
|
dateAtCursor: null
|
|
175
|
-
}), [
|
|
176
|
-
|
|
177
|
-
), Y =
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}, [
|
|
181
|
-
const
|
|
182
|
-
() =>
|
|
183
|
-
[
|
|
184
|
-
),
|
|
185
|
-
() =>
|
|
186
|
-
[
|
|
187
|
-
),
|
|
188
|
-
() =>
|
|
189
|
-
[
|
|
190
|
-
),
|
|
191
|
-
() =>
|
|
192
|
-
[
|
|
193
|
-
),
|
|
194
|
-
() =>
|
|
195
|
-
[
|
|
196
|
-
),
|
|
197
|
-
() =>
|
|
198
|
-
[
|
|
199
|
-
),
|
|
200
|
-
() =>
|
|
201
|
-
[
|
|
202
|
-
),
|
|
203
|
-
(
|
|
204
|
-
const t = (
|
|
205
|
-
return
|
|
201
|
+
}), [qt, le] = J({ x: 0, y: 0 }), Lt = L(() => [0.6, 0.9, 1, 1.4, 1.8], []), [Gt, Ut] = J(3), [q, it] = J(0), [vt, ce] = J(!1), [de, zt] = J(
|
|
202
|
+
nt
|
|
203
|
+
), Y = S ? de : nt;
|
|
204
|
+
xt(() => {
|
|
205
|
+
zt(nt);
|
|
206
|
+
}, [nt]);
|
|
207
|
+
const M = L(
|
|
208
|
+
() => K(i.timeline.lastRestockDate),
|
|
209
|
+
[i.timeline.lastRestockDate]
|
|
210
|
+
), st = L(
|
|
211
|
+
() => K(i.timeline.todayDate),
|
|
212
|
+
[i.timeline.todayDate]
|
|
213
|
+
), C = L(
|
|
214
|
+
() => Bt(i.timeline.stockEndDate),
|
|
215
|
+
[i.timeline.stockEndDate]
|
|
216
|
+
), Vt = L(
|
|
217
|
+
() => K(i.timeline.restockSuggestionStart),
|
|
218
|
+
[i.timeline.restockSuggestionStart]
|
|
219
|
+
), U = L(
|
|
220
|
+
() => Bt(i.timeline.restockSuggestionEnd),
|
|
221
|
+
[i.timeline.restockSuggestionEnd]
|
|
222
|
+
), I = L(
|
|
223
|
+
() => K(i.timeline.deliveryDate),
|
|
224
|
+
[i.timeline.deliveryDate]
|
|
225
|
+
), A = 1e3 * 60 * 60 * 24, X = L(
|
|
226
|
+
() => i.config.pixelsPerDay * Lt[Gt],
|
|
227
|
+
[i.config.pixelsPerDay, Gt, Lt]
|
|
228
|
+
), y = P(
|
|
229
|
+
(e) => {
|
|
230
|
+
const t = (e.getTime() - M.getTime()) / A;
|
|
231
|
+
return s.padding.left + t * X - q;
|
|
206
232
|
},
|
|
207
233
|
[
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
234
|
+
M,
|
|
235
|
+
X,
|
|
236
|
+
s.padding.left,
|
|
237
|
+
q,
|
|
238
|
+
A
|
|
213
239
|
]
|
|
214
|
-
),
|
|
215
|
-
(
|
|
216
|
-
const t = (
|
|
217
|
-
return
|
|
240
|
+
), _t = P(
|
|
241
|
+
(e) => {
|
|
242
|
+
const t = (e - s.padding.left + q) / X, g = new Date(M);
|
|
243
|
+
return g.setDate(g.getDate() + Math.floor(t)), g;
|
|
218
244
|
},
|
|
219
|
-
[
|
|
220
|
-
),
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
245
|
+
[M, X, s.padding.left, q]
|
|
246
|
+
), ge = (e) => `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}`, St = (e) => {
|
|
247
|
+
const t = e.getDate().toString().padStart(2, "0"), g = (e.getMonth() + 1).toString().padStart(2, "0");
|
|
248
|
+
if (e.getHours() === 0 && e.getMinutes() === 0) return `${t}/${g}`;
|
|
249
|
+
const F = e.getHours().toString().padStart(2, "0"), d = e.getMinutes().toString().padStart(2, "0");
|
|
250
|
+
return `${t}/${g} ${F}:${d}`;
|
|
251
|
+
}, Tt = P(() => {
|
|
252
|
+
const e = ot.current;
|
|
253
|
+
if (!e) return;
|
|
254
|
+
const t = e.getContext("2d");
|
|
224
255
|
if (!t) return;
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
t.fillStyle =
|
|
230
|
-
const
|
|
231
|
-
t.fillRect(
|
|
256
|
+
Ce(t);
|
|
257
|
+
const g = window.devicePixelRatio || 1, d = e.getBoundingClientRect().width, u = s.height;
|
|
258
|
+
if (e.width = d * g, e.height = u * g, t.scale(g, g), t.clearRect(0, 0, d, u), t.fillStyle = p.background, t.roundRect(0, 0, d, u, 12), t.fill(), T.isHovering && T.dateAtCursor) {
|
|
259
|
+
const n = y(T.dateAtCursor), o = i.config.theme === "dark";
|
|
260
|
+
t.fillStyle = o ? "rgba(255, 255, 255, 0.05)" : "rgba(0, 0, 0, 0.05)";
|
|
261
|
+
const r = s.padding.top, l = u - s.padding.bottom - s.padding.top;
|
|
262
|
+
t.fillRect(n, r, X, l);
|
|
232
263
|
}
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
t.strokeStyle =
|
|
237
|
-
let
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
264
|
+
const W = y(M), B = y(st), j = y(C), O = y(I);
|
|
265
|
+
y(Vt);
|
|
266
|
+
const z = y(U), V = s.padding.top, R = (u - s.padding.top - s.padding.bottom) * s.segmentRatio, N = V + 5, _ = N + R + 2;
|
|
267
|
+
t.strokeStyle = p.textSecondary, t.lineWidth = 1, t.setLineDash([]);
|
|
268
|
+
let wt = Math.max(
|
|
269
|
+
U.getTime(),
|
|
270
|
+
I.getTime(),
|
|
271
|
+
C.getTime()
|
|
241
272
|
);
|
|
242
|
-
if (typeof
|
|
243
|
-
const
|
|
244
|
-
Math.max(
|
|
245
|
-
),
|
|
246
|
-
|
|
247
|
-
);
|
|
248
|
-
|
|
273
|
+
if (typeof m == "number" && m > 0) {
|
|
274
|
+
const n = new Date(
|
|
275
|
+
Math.max(I.getTime(), C.getTime())
|
|
276
|
+
), o = new Date(
|
|
277
|
+
n.getTime() + (m - 1) * A
|
|
278
|
+
), r = yt(o);
|
|
279
|
+
wt = Math.max(wt, r.getTime());
|
|
249
280
|
}
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
(
|
|
254
|
-
),
|
|
281
|
+
const gt = new Date(wt);
|
|
282
|
+
gt.setDate(gt.getDate() + 2);
|
|
283
|
+
const $ = Math.ceil(
|
|
284
|
+
(gt.getTime() - M.getTime()) / (1e3 * 60 * 60 * 24)
|
|
285
|
+
), ut = [
|
|
255
286
|
"JAN",
|
|
256
287
|
"FEV",
|
|
257
288
|
"MAR",
|
|
@@ -264,52 +295,52 @@ function Te({
|
|
|
264
295
|
"OUT",
|
|
265
296
|
"NOV",
|
|
266
297
|
"DEZ"
|
|
267
|
-
],
|
|
268
|
-
const
|
|
269
|
-
return
|
|
270
|
-
},
|
|
271
|
-
const
|
|
272
|
-
return
|
|
298
|
+
], kt = (n) => {
|
|
299
|
+
const o = n % 2 === 0;
|
|
300
|
+
return i.config.theme === "dark" ? o ? "rgba(71, 85, 105, 0.25)" : "rgba(51, 65, 85, 0.4)" : o ? "rgba(241, 245, 249, 0.6)" : "rgba(203, 213, 225, 0.5)";
|
|
301
|
+
}, Dt = (n, o) => {
|
|
302
|
+
const r = n % 2 === 0;
|
|
303
|
+
return i.config.theme === "dark" ? r ? "rgba(148, 163, 184, 1)" : "rgba(226, 232, 240, 1)" : r ? "rgba(100, 116, 139, 1)" : "rgba(51, 65, 85, 1)";
|
|
273
304
|
}, Mt = [];
|
|
274
|
-
let
|
|
275
|
-
for (let
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
(l !==
|
|
280
|
-
month:
|
|
281
|
-
year:
|
|
282
|
-
startX:
|
|
283
|
-
endX:
|
|
284
|
-
}),
|
|
305
|
+
let ht = -1, Xt = -1, Wt = s.padding.left;
|
|
306
|
+
for (let n = 0; n <= $; n++) {
|
|
307
|
+
const o = new Date(M);
|
|
308
|
+
o.setDate(o.getDate() + n);
|
|
309
|
+
const r = y(o), l = o.getMonth(), f = o.getFullYear();
|
|
310
|
+
(l !== ht || f !== Xt) && (ht !== -1 && Mt.push({
|
|
311
|
+
month: ht,
|
|
312
|
+
year: Xt,
|
|
313
|
+
startX: Wt,
|
|
314
|
+
endX: r
|
|
315
|
+
}), ht = l, Xt = f, Wt = r);
|
|
285
316
|
}
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
month:
|
|
290
|
-
year:
|
|
291
|
-
startX:
|
|
292
|
-
endX:
|
|
317
|
+
if (ht !== -1) {
|
|
318
|
+
const n = new Date(M);
|
|
319
|
+
n.setDate(n.getDate() + $), Mt.push({
|
|
320
|
+
month: ht,
|
|
321
|
+
year: Xt,
|
|
322
|
+
startX: Wt,
|
|
323
|
+
endX: y(n) + X
|
|
293
324
|
});
|
|
294
325
|
}
|
|
295
|
-
const
|
|
296
|
-
for (const
|
|
297
|
-
const
|
|
326
|
+
const te = V, ee = u - s.padding.bottom - V;
|
|
327
|
+
for (const n of Mt) {
|
|
328
|
+
const o = Math.max(n.startX, s.padding.left), l = Math.min(n.endX, d - s.padding.right) - o;
|
|
298
329
|
if (l > 0) {
|
|
299
|
-
t.fillStyle =
|
|
300
|
-
const
|
|
301
|
-
t.fillStyle =
|
|
302
|
-
const h = `bold ${(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
), t.restore()),
|
|
330
|
+
t.fillStyle = kt(n.month), t.fillRect(o, te, l, ee);
|
|
331
|
+
const f = te + ee - 15;
|
|
332
|
+
t.fillStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.35)" : "rgba(100, 116, 139, 0.25)";
|
|
333
|
+
const h = `bold ${(s.fontSize + 4) * 2}px system-ui, -apple-system, sans-serif`, x = new Date(n.year, n.month, 2), D = y(x), tt = D >= s.padding.left && D <= d - s.padding.right, pt = new Date(n.year, n.month + 1, 2), ft = y(pt);
|
|
334
|
+
ft >= s.padding.left && ft <= d - s.padding.right && (t.save(), t.font = h, t.textAlign = "right", t.textBaseline = "bottom", t.fillText(
|
|
335
|
+
ut[n.month],
|
|
336
|
+
ft - 4,
|
|
337
|
+
f
|
|
338
|
+
), t.restore()), tt && (t.save(), t.font = h, t.textAlign = "left", t.textBaseline = "bottom", t.fillText(ut[n.month], D + 4, f), t.restore());
|
|
308
339
|
}
|
|
309
340
|
}
|
|
310
|
-
const
|
|
311
|
-
if (!
|
|
312
|
-
const
|
|
341
|
+
const Te = ["DOM", "SEG", "TER", "QUA", "QUI", "SEX", "SAB"], ne = (n) => {
|
|
342
|
+
if (!i.timeline.dailyConsumptionAverage) return null;
|
|
343
|
+
const r = [
|
|
313
344
|
"0-domingo",
|
|
314
345
|
"1-segunda",
|
|
315
346
|
"2-terca",
|
|
@@ -317,405 +348,448 @@ function Te({
|
|
|
317
348
|
"4-quinta",
|
|
318
349
|
"5-sexta",
|
|
319
350
|
"6-sabado"
|
|
320
|
-
][
|
|
321
|
-
return
|
|
351
|
+
][n];
|
|
352
|
+
return i.timeline.dailyConsumptionAverage[r] ?? null;
|
|
322
353
|
};
|
|
323
|
-
for (let
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
const ue = le[l];
|
|
343
|
-
t.fillStyle = ft(h), t.font = `${d ? "bold " : ""}${e.fontSize - 2}px system-ui, -apple-system, sans-serif`;
|
|
344
|
-
const me = g - e.padding.bottom - 4;
|
|
345
|
-
t.textBaseline = "bottom", t.fillText(ue, Bt, me);
|
|
346
|
-
}
|
|
354
|
+
for (let n = 0; n <= $; n++) {
|
|
355
|
+
const o = new Date(
|
|
356
|
+
M.getFullYear(),
|
|
357
|
+
M.getMonth(),
|
|
358
|
+
M.getDate() + n
|
|
359
|
+
), r = y(o);
|
|
360
|
+
if (r >= s.padding.left && r <= d - s.padding.right) {
|
|
361
|
+
const l = o.getDay(), f = l === 0 || l === 6, h = o.getMonth();
|
|
362
|
+
o.getDate() === 1 && (t.save(), t.strokeStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.8)" : "rgba(71, 85, 105, 0.6)", t.lineWidth = 2, t.beginPath(), t.moveTo(r, V), t.lineTo(r, u - s.padding.bottom + 20), t.stroke(), t.restore()), t.strokeStyle = p.textSecondary, t.lineWidth = 1, t.beginPath(), t.moveTo(r, V), t.lineTo(r, u - s.padding.bottom), t.stroke();
|
|
363
|
+
const D = r + X / 2, tt = u - s.padding.bottom + 8;
|
|
364
|
+
t.fillStyle = Dt(h), t.font = `${s.fontSize}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "top", t.fillText(o.getDate().toString().padStart(2, "0"), D, tt);
|
|
365
|
+
const pt = ne(l), ft = pt !== null ? pt : 0;
|
|
366
|
+
t.fillStyle = i.config.theme === "dark" ? "rgba(148, 163, 184, 0.7)" : "rgba(100, 116, 139, 0.7)", t.font = `${s.fontSize - 3}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "bottom";
|
|
367
|
+
const Rt = u - s.padding.bottom - 18;
|
|
368
|
+
t.fillText(ft.toFixed(2), D, Rt);
|
|
369
|
+
const Yt = Te[l];
|
|
370
|
+
t.fillStyle = Dt(h), t.font = `${f ? "bold " : ""}${s.fontSize - 2}px system-ui, -apple-system, sans-serif`;
|
|
371
|
+
const ke = u - s.padding.bottom - 4;
|
|
372
|
+
t.textBaseline = "bottom", t.fillText(Yt, D, ke);
|
|
347
373
|
}
|
|
348
374
|
}
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
).filter((
|
|
353
|
-
for (let
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
359
|
-
h.push({ x:
|
|
375
|
+
if (vt && i.timeline.dailyConsumptionAverage) {
|
|
376
|
+
const n = Object.values(
|
|
377
|
+
i.timeline.dailyConsumptionAverage
|
|
378
|
+
).filter((x) => typeof x == "number"), o = n.length > 0 ? Math.max(...n, 1) : 1, r = s.padding.bottom * 0.5, l = u - s.padding.bottom, f = r, h = [];
|
|
379
|
+
for (let x = 0; x <= $; x++) {
|
|
380
|
+
const D = new Date(M);
|
|
381
|
+
D.setDate(D.getDate() + x);
|
|
382
|
+
const tt = y(D);
|
|
383
|
+
if (tt >= s.padding.left && tt <= d - s.padding.right) {
|
|
384
|
+
const pt = D.getDay(), Rt = (ne(pt) ?? 0) / o, Yt = l - Rt * f;
|
|
385
|
+
h.push({ x: tt + X / 2, y: Yt });
|
|
360
386
|
}
|
|
361
387
|
}
|
|
362
388
|
if (h.length > 1) {
|
|
363
389
|
t.save(), t.strokeStyle = "rgba(0, 0, 0, 0.25)", t.lineWidth = 2, t.lineCap = "round", t.lineJoin = "round", t.miterLimit = 2, t.beginPath(), t.moveTo(h[0].x, h[0].y);
|
|
364
|
-
for (let
|
|
365
|
-
t.lineTo(h[
|
|
390
|
+
for (let x = 1; x < h.length; x++)
|
|
391
|
+
t.lineTo(h[x].x, h[x].y);
|
|
366
392
|
t.stroke(), t.restore();
|
|
367
393
|
}
|
|
368
394
|
}
|
|
369
|
-
const
|
|
370
|
-
const l = t.createLinearGradient(0,
|
|
371
|
-
return l.addColorStop(0,
|
|
372
|
-
},
|
|
373
|
-
const l = t.createLinearGradient(
|
|
374
|
-
return l.addColorStop(0,
|
|
375
|
-
},
|
|
376
|
-
if (!
|
|
377
|
-
const h = (
|
|
378
|
-
t.textAlign = "center", t.font = `${
|
|
395
|
+
const mt = Math.max(W, s.padding.left), we = (n, o, r) => {
|
|
396
|
+
const l = t.createLinearGradient(0, o, 0, o + r);
|
|
397
|
+
return l.addColorStop(0, n), l.addColorStop(1, bt(n, -15)), l;
|
|
398
|
+
}, Ot = (n, o, r) => {
|
|
399
|
+
const l = t.createLinearGradient(o, 0, o + r, 0);
|
|
400
|
+
return l.addColorStop(0, n), l.addColorStop(1, bt(n, -10)), l;
|
|
401
|
+
}, $t = (n, o, r, l, f) => {
|
|
402
|
+
if (!f) return;
|
|
403
|
+
const h = (n + o) / 2, x = r + l / 2;
|
|
404
|
+
t.textAlign = "center", t.font = `${s.fontSize - 1}px system-ui, -apple-system, sans-serif`, t.fillStyle = "#FFFFFF", t.textBaseline = "middle", t.shadowColor = "rgba(0, 0, 0, 0.35)", t.shadowBlur = 3, t.shadowOffsetY = 1, t.fillText(f, h, x), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0;
|
|
379
405
|
};
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const
|
|
406
|
+
t.lineWidth = 1, t.lineJoin = "round";
|
|
407
|
+
const oe = new Date(
|
|
408
|
+
Math.min(st.getTime(), C.getTime())
|
|
409
|
+
), Ht = y(oe);
|
|
410
|
+
if (Ht > mt) {
|
|
411
|
+
const n = Ht - mt;
|
|
412
|
+
t.beginPath(), t.globalAlpha = 1, t.fillStyle = we(p.stockPast, N, R), t.strokeStyle = bt(p.stockPast, -20), t.lineWidth = 1.5;
|
|
413
|
+
const o = mt, r = N, l = n, f = R, h = 6;
|
|
414
|
+
t.moveTo(o + h, r), t.lineTo(o + l, r), t.lineTo(o + l, r + f), t.lineTo(o + h, r + f), t.quadraticCurveTo(o, r + f, o, r + f - h), t.lineTo(o, r + h), t.quadraticCurveTo(o, r, o + h, r), t.fill(), t.stroke(), t.closePath();
|
|
415
|
+
const x = Math.max(
|
|
386
416
|
0,
|
|
387
|
-
Math.round(
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
417
|
+
Math.round(
|
|
418
|
+
(oe.getTime() - M.getTime()) / A
|
|
419
|
+
)
|
|
420
|
+
), D = `${x} dia${x === 1 ? "" : "s"} consumido${x === 1 ? "" : "s"}`;
|
|
421
|
+
$t(
|
|
422
|
+
mt,
|
|
423
|
+
Ht,
|
|
424
|
+
N,
|
|
425
|
+
R,
|
|
426
|
+
D
|
|
395
427
|
);
|
|
396
428
|
}
|
|
397
|
-
if (
|
|
398
|
-
const
|
|
399
|
-
t.beginPath(), t.globalAlpha = 1, t.fillStyle =
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
), t.strokeStyle =
|
|
404
|
-
const
|
|
405
|
-
t.moveTo(
|
|
406
|
-
const
|
|
429
|
+
if (j > B) {
|
|
430
|
+
const n = j - B;
|
|
431
|
+
t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ot(
|
|
432
|
+
p.stockFuture,
|
|
433
|
+
B,
|
|
434
|
+
n
|
|
435
|
+
), t.strokeStyle = bt(p.stockFuture, -20), t.lineWidth = 1.5;
|
|
436
|
+
const o = B, r = N, l = n, f = R, h = 6;
|
|
437
|
+
t.moveTo(o, r), t.lineTo(o + l - h, r), t.quadraticCurveTo(o + l, r, o + l, r + h), t.lineTo(o + l, r + f - h), t.quadraticCurveTo(o + l, r + f, o + l - h, r + f), t.lineTo(o, r + f), t.lineTo(o, r), t.fill(), t.stroke(), t.closePath();
|
|
438
|
+
const x = Math.max(
|
|
407
439
|
0,
|
|
408
|
-
Math.round((
|
|
409
|
-
),
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
440
|
+
Math.round((C.getTime() - st.getTime()) / A)
|
|
441
|
+
), D = `${x} dia${x === 1 ? "" : "s"} restante${x === 1 ? "" : "s"}`;
|
|
442
|
+
$t(
|
|
443
|
+
B,
|
|
444
|
+
j,
|
|
445
|
+
N,
|
|
446
|
+
R,
|
|
447
|
+
D
|
|
416
448
|
);
|
|
417
449
|
}
|
|
418
|
-
const
|
|
419
|
-
if (Y &&
|
|
420
|
-
const
|
|
421
|
-
t.beginPath(), t.globalAlpha = 1, t.fillStyle =
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
), t.strokeStyle =
|
|
450
|
+
const Q = Math.max(O, j);
|
|
451
|
+
if (Y && z > Q && Q >= s.padding.left) {
|
|
452
|
+
const n = z - Q;
|
|
453
|
+
t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ot(
|
|
454
|
+
p.alert,
|
|
455
|
+
Q,
|
|
456
|
+
n
|
|
457
|
+
), t.strokeStyle = bt(p.alert, -20), t.lineWidth = 1.5, t.roundRect(
|
|
458
|
+
Q,
|
|
426
459
|
_,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
E,
|
|
460
|
+
n,
|
|
461
|
+
R,
|
|
430
462
|
6
|
|
431
463
|
), t.fill(), t.stroke(), t.closePath();
|
|
432
|
-
const
|
|
464
|
+
const o = Math.max(
|
|
433
465
|
0,
|
|
434
|
-
Math.round(
|
|
435
|
-
),
|
|
436
|
-
|
|
466
|
+
Math.round(n / X)
|
|
467
|
+
), r = `${o} dia${o === 1 ? "" : "s"}`;
|
|
468
|
+
$t(
|
|
469
|
+
Q,
|
|
470
|
+
z,
|
|
437
471
|
_,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
E,
|
|
441
|
-
s
|
|
472
|
+
R,
|
|
473
|
+
r
|
|
442
474
|
);
|
|
443
475
|
}
|
|
444
|
-
if (typeof
|
|
445
|
-
const
|
|
446
|
-
Math.max(
|
|
447
|
-
),
|
|
448
|
-
|
|
449
|
-
),
|
|
450
|
-
if (
|
|
451
|
-
const
|
|
452
|
-
t.beginPath(), t.globalAlpha = 1, t.fillStyle =
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
), t.strokeStyle =
|
|
457
|
-
|
|
476
|
+
if (typeof m == "number" && m > 0 && typeof w == "number") {
|
|
477
|
+
const n = new Date(
|
|
478
|
+
Math.max(I.getTime(), C.getTime())
|
|
479
|
+
), o = Math.max(O, j), r = new Date(
|
|
480
|
+
n.getTime() + (m - 1) * A
|
|
481
|
+
), l = yt(r), h = y(l) - o;
|
|
482
|
+
if (h > 0) {
|
|
483
|
+
const x = R * 0.5, D = _ + R + 4;
|
|
484
|
+
t.beginPath(), t.globalAlpha = 1, t.fillStyle = Ot(
|
|
485
|
+
p.selectedQtyBar,
|
|
486
|
+
o,
|
|
487
|
+
h
|
|
488
|
+
), t.strokeStyle = bt(
|
|
489
|
+
p.selectedQtyBar,
|
|
458
490
|
-20
|
|
459
491
|
), t.lineWidth = 1.5, t.roundRect(
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
d,
|
|
492
|
+
o,
|
|
493
|
+
D,
|
|
463
494
|
h,
|
|
495
|
+
x,
|
|
464
496
|
4
|
|
465
497
|
), t.fill(), t.stroke(), t.closePath();
|
|
466
498
|
}
|
|
467
499
|
}
|
|
468
|
-
if (
|
|
469
|
-
if (t.save(), t.globalAlpha = 0.18, t.fillStyle =
|
|
500
|
+
if (T.isHovering && T.hoveredSection) {
|
|
501
|
+
if (t.save(), t.globalAlpha = 0.18, t.fillStyle = i.config.theme === "dark" ? "#FFFFFF" : "#000000", T.hoveredSection === "stock")
|
|
470
502
|
t.fillRect(
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
503
|
+
mt,
|
|
504
|
+
N,
|
|
505
|
+
j - mt,
|
|
506
|
+
R
|
|
475
507
|
);
|
|
476
|
-
else if (
|
|
508
|
+
else if (T.hoveredSection === "suggestion" && Y)
|
|
477
509
|
t.fillRect(
|
|
510
|
+
Q,
|
|
478
511
|
_,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
E
|
|
512
|
+
z - Q,
|
|
513
|
+
R
|
|
482
514
|
);
|
|
483
|
-
else if (
|
|
484
|
-
const
|
|
485
|
-
Math.max(
|
|
486
|
-
),
|
|
487
|
-
|
|
488
|
-
), l =
|
|
515
|
+
else if (T.hoveredSection === "selectedQty" && typeof m == "number" && m > 0) {
|
|
516
|
+
const n = Math.max(O, j), o = new Date(
|
|
517
|
+
Math.max(I.getTime(), C.getTime())
|
|
518
|
+
), r = new Date(
|
|
519
|
+
o.getTime() + (m - 1) * A
|
|
520
|
+
), l = yt(r), f = y(l), h = R * 0.5, x = _ + R + 4;
|
|
489
521
|
t.fillRect(
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
522
|
+
n,
|
|
523
|
+
x,
|
|
524
|
+
f - n,
|
|
525
|
+
h
|
|
494
526
|
);
|
|
495
527
|
}
|
|
496
528
|
t.restore();
|
|
497
529
|
}
|
|
498
|
-
const
|
|
499
|
-
t.font = `bold ${
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
const
|
|
530
|
+
const ie = (n, o, r, l) => {
|
|
531
|
+
t.font = `bold ${s.pillFontSize}px system-ui, -apple-system, sans-serif`;
|
|
532
|
+
const f = t.measureText(r.toUpperCase()), h = s.pillPaddingX;
|
|
533
|
+
s.pillPaddingY;
|
|
534
|
+
const x = s.pillHeight, D = f.width + h * 2;
|
|
503
535
|
t.shadowColor = "rgba(0, 0, 0, 0.1)", t.shadowBlur = 4, t.shadowOffsetY = 2, t.fillStyle = l, t.beginPath(), t.roundRect(
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
), t.fill(), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0, t.fillStyle = "#FFFFFF", t.textAlign = "center", t.textBaseline = "middle", t.fillText(
|
|
536
|
+
n - D / 2,
|
|
537
|
+
o,
|
|
538
|
+
D,
|
|
539
|
+
x,
|
|
540
|
+
x / 2
|
|
541
|
+
), t.fill(), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0, t.fillStyle = "#FFFFFF", t.textAlign = "center", t.textBaseline = "middle", t.fillText(r.toUpperCase(), n, o + x / 2 + 1);
|
|
510
542
|
};
|
|
511
|
-
if (
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
543
|
+
if (B >= s.padding.left && B <= d - s.padding.right) {
|
|
544
|
+
const n = B, o = X, r = V, l = u - s.padding.bottom;
|
|
545
|
+
t.globalAlpha = 0.12, t.fillStyle = p.todayIndicator, t.fillRect(
|
|
546
|
+
n,
|
|
547
|
+
r,
|
|
548
|
+
o,
|
|
549
|
+
l - r
|
|
550
|
+
), t.globalAlpha = 1, t.strokeStyle = p.todayIndicator, t.lineWidth = 1.5, t.beginPath(), t.moveTo(n, r), t.lineTo(n, l), t.stroke();
|
|
551
|
+
const f = n + o / 2;
|
|
552
|
+
ie(
|
|
553
|
+
f,
|
|
554
|
+
u - s.padding.bottom + 20,
|
|
555
|
+
"Hoje",
|
|
556
|
+
p.todayIndicator
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
if (O >= s.padding.left && O <= d - s.padding.right && (t.globalAlpha = 1, t.strokeStyle = p.deliveryBar, t.lineWidth = 1.5, t.setLineDash([3, 3]), t.beginPath(), t.moveTo(O, 0), t.lineTo(O, u - s.padding.bottom), t.stroke(), t.setLineDash([]), ie(
|
|
560
|
+
O,
|
|
561
|
+
u - s.padding.bottom + 20,
|
|
519
562
|
"Entrega",
|
|
520
|
-
|
|
563
|
+
p.deliveryBar
|
|
521
564
|
)), Y) {
|
|
522
|
-
const
|
|
565
|
+
const n = s.fontSize + 6, o = Q + X / 2 - n / 2, r = _ - n - 4, l = H.status === "critical" ? p.alertCritical : H.status === "urgent" ? p.alertUrgent : H.status === "warning" ? p.alertWarning : H.status === "success" ? p.alertSuccess : p.alertInfo;
|
|
523
566
|
t.beginPath(), t.arc(
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
567
|
+
o + n / 2,
|
|
568
|
+
r + n / 2,
|
|
569
|
+
n / 2,
|
|
527
570
|
0,
|
|
528
571
|
Math.PI * 2
|
|
529
|
-
), t.fillStyle = l, t.fill(), t.shadowColor = "rgba(0, 0, 0, 0.2)", t.shadowBlur = 4, t.shadowOffsetY = 2, t.fillStyle = "#FFFFFF", t.font = `bold ${
|
|
530
|
-
const
|
|
572
|
+
), t.fillStyle = l, t.fill(), t.shadowColor = "rgba(0, 0, 0, 0.2)", t.shadowBlur = 4, t.shadowOffsetY = 2, t.fillStyle = "#FFFFFF", t.font = `bold ${n * 0.6}px system-ui, -apple-system, sans-serif`, t.textAlign = "center", t.textBaseline = "middle";
|
|
573
|
+
const f = H.status === "critical" || H.status === "urgent" || H.status === "warning" ? "!" : H.status === "success" ? "✓" : "i";
|
|
531
574
|
t.fillText(
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
575
|
+
f,
|
|
576
|
+
o + n / 2,
|
|
577
|
+
r + n / 2
|
|
535
578
|
), t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetY = 0;
|
|
536
579
|
}
|
|
537
580
|
t.globalAlpha = 1;
|
|
538
581
|
}, [
|
|
539
|
-
|
|
540
|
-
b,
|
|
541
|
-
w,
|
|
542
|
-
tt,
|
|
543
|
-
T,
|
|
544
|
-
Lt,
|
|
545
|
-
z,
|
|
546
|
-
P,
|
|
547
|
-
u,
|
|
548
|
-
e,
|
|
582
|
+
i,
|
|
549
583
|
y,
|
|
550
584
|
M,
|
|
551
|
-
|
|
552
|
-
|
|
585
|
+
st,
|
|
586
|
+
C,
|
|
587
|
+
Vt,
|
|
588
|
+
U,
|
|
589
|
+
I,
|
|
553
590
|
p,
|
|
591
|
+
s,
|
|
592
|
+
T,
|
|
593
|
+
A,
|
|
594
|
+
X,
|
|
595
|
+
w,
|
|
596
|
+
m,
|
|
554
597
|
H,
|
|
555
|
-
|
|
598
|
+
vt,
|
|
556
599
|
Y
|
|
557
|
-
]),
|
|
558
|
-
(
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
const
|
|
600
|
+
]), Qt = P(
|
|
601
|
+
(e, t) => {
|
|
602
|
+
const g = ot.current;
|
|
603
|
+
if (!g) return null;
|
|
604
|
+
const F = g.getBoundingClientRect(), d = e - F.left, u = t - F.top, W = s.padding.top, B = s.height - s.padding.top - s.padding.bottom, j = B * s.segmentRatio, O = W + 5, z = O + j + 2, V = z + j + 4, It = j * 0.5, R = y(M);
|
|
605
|
+
y(st);
|
|
606
|
+
const N = y(C), _ = y(I), wt = y(U), gt = Math.max(_, N);
|
|
564
607
|
if (Y) {
|
|
565
|
-
const
|
|
608
|
+
const $ = s.fontSize + 6, ut = gt + X / 2 - $ / 2, kt = z - $ - 4;
|
|
566
609
|
if (Math.sqrt(
|
|
567
|
-
Math.pow(
|
|
568
|
-
) <=
|
|
610
|
+
Math.pow(d - (ut + $ / 2), 2) + Math.pow(u - (kt + $ / 2), 2)
|
|
611
|
+
) <= $ / 2 + 4)
|
|
569
612
|
return "alertIcon";
|
|
570
613
|
}
|
|
571
|
-
if (
|
|
614
|
+
if (u < W || u > W + B + It + 10)
|
|
572
615
|
return null;
|
|
573
|
-
if (typeof
|
|
574
|
-
const
|
|
575
|
-
Math.max(
|
|
576
|
-
),
|
|
577
|
-
|
|
578
|
-
),
|
|
579
|
-
if (
|
|
616
|
+
if (typeof m == "number" && m > 0 && typeof w == "number") {
|
|
617
|
+
const $ = Math.max(_, N), ut = new Date(
|
|
618
|
+
Math.max(I.getTime(), C.getTime())
|
|
619
|
+
), kt = new Date(
|
|
620
|
+
ut.getTime() + (m - 1) * A
|
|
621
|
+
), Dt = yt(kt), Mt = y(Dt);
|
|
622
|
+
if (u >= V && u <= V + It && d >= $ && d <= Mt)
|
|
580
623
|
return "selectedQty";
|
|
581
624
|
}
|
|
582
|
-
return
|
|
625
|
+
return u >= O && u <= O + j && d >= R && d <= N ? "stock" : Y && u >= z && u <= z + j && d >= gt && d <= wt ? "suggestion" : null;
|
|
583
626
|
},
|
|
584
627
|
[
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
628
|
+
y,
|
|
629
|
+
st,
|
|
630
|
+
C,
|
|
631
|
+
U,
|
|
632
|
+
M,
|
|
633
|
+
I,
|
|
634
|
+
s,
|
|
589
635
|
w,
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
j,
|
|
593
|
-
p,
|
|
636
|
+
m,
|
|
637
|
+
X,
|
|
594
638
|
A,
|
|
595
|
-
M,
|
|
596
639
|
Y
|
|
597
640
|
]
|
|
598
|
-
),
|
|
599
|
-
let
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
641
|
+
), Jt = L(() => {
|
|
642
|
+
let e = Math.max(
|
|
643
|
+
U.getTime(),
|
|
644
|
+
I.getTime(),
|
|
645
|
+
C.getTime()
|
|
603
646
|
);
|
|
604
|
-
if (typeof
|
|
605
|
-
const
|
|
606
|
-
Math.max(
|
|
607
|
-
),
|
|
608
|
-
|
|
609
|
-
);
|
|
610
|
-
|
|
647
|
+
if (typeof m == "number" && m > 0) {
|
|
648
|
+
const g = new Date(
|
|
649
|
+
Math.max(I.getTime(), C.getTime())
|
|
650
|
+
), F = new Date(
|
|
651
|
+
g.getTime() + (m - 1) * A
|
|
652
|
+
), d = yt(F);
|
|
653
|
+
e = Math.max(e, d.getTime());
|
|
611
654
|
}
|
|
612
|
-
const t = new Date(
|
|
655
|
+
const t = new Date(e);
|
|
613
656
|
return t.setDate(t.getDate() + 2), t;
|
|
614
|
-
}, [
|
|
615
|
-
(
|
|
616
|
-
), [
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
]), [
|
|
622
|
-
|
|
623
|
-
const
|
|
624
|
-
|
|
657
|
+
}, [U, I, C, m, A]), Kt = L(() => Math.ceil(
|
|
658
|
+
(Jt.getTime() - M.getTime()) / A
|
|
659
|
+
), [Jt, M, A]), rt = L(() => s.padding.left + Kt * X + s.padding.right, [
|
|
660
|
+
Kt,
|
|
661
|
+
X,
|
|
662
|
+
s.padding.left,
|
|
663
|
+
s.padding.right
|
|
664
|
+
]), [Z, ue] = J(0);
|
|
665
|
+
xt(() => {
|
|
666
|
+
const e = () => {
|
|
667
|
+
ot.current && ue(ot.current.getBoundingClientRect().width);
|
|
625
668
|
};
|
|
626
|
-
return
|
|
669
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
627
670
|
}, []);
|
|
628
|
-
const
|
|
629
|
-
(
|
|
630
|
-
|
|
671
|
+
const k = L(() => Z === 0 ? 0 : Math.max(0, rt - Z), [rt, Z]), Zt = et(null), [Ct, at] = J(!1), G = et(!1), lt = et(0), ct = et(0), [Et, At] = J(!1), dt = et(!1), he = P(
|
|
672
|
+
(e) => {
|
|
673
|
+
e.preventDefault(), G.current = !0, at(!0), lt.current = e.clientX, ct.current = q;
|
|
631
674
|
},
|
|
632
|
-
[
|
|
633
|
-
),
|
|
634
|
-
(
|
|
635
|
-
|
|
675
|
+
[q]
|
|
676
|
+
), me = P(
|
|
677
|
+
(e) => {
|
|
678
|
+
e.touches.length === 1 && (e.preventDefault(), G.current = !0, at(!0), lt.current = e.touches[0].clientX, ct.current = q);
|
|
636
679
|
},
|
|
637
|
-
[
|
|
638
|
-
),
|
|
639
|
-
(
|
|
640
|
-
const t =
|
|
680
|
+
[q]
|
|
681
|
+
), pe = P(
|
|
682
|
+
(e) => {
|
|
683
|
+
const t = ot.current;
|
|
641
684
|
if (!t) return;
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
644
|
-
|
|
685
|
+
if (G.current && k > 0) {
|
|
686
|
+
const W = lt.current - e.clientX, B = ct.current + W;
|
|
687
|
+
it(Math.max(0, Math.min(k, B)));
|
|
645
688
|
return;
|
|
646
689
|
}
|
|
647
|
-
const
|
|
648
|
-
|
|
690
|
+
const g = t.getBoundingClientRect(), F = e.clientX - g.left, d = Qt(e.clientX, e.clientY), u = _t(F);
|
|
691
|
+
Nt({
|
|
649
692
|
isHovering: !0,
|
|
650
|
-
hoveredSection:
|
|
651
|
-
mouseX:
|
|
652
|
-
mouseY:
|
|
653
|
-
dateAtCursor:
|
|
654
|
-
}),
|
|
693
|
+
hoveredSection: d,
|
|
694
|
+
mouseX: e.clientX,
|
|
695
|
+
mouseY: e.clientY,
|
|
696
|
+
dateAtCursor: u
|
|
697
|
+
}), le({ x: e.clientX, y: e.clientY });
|
|
655
698
|
},
|
|
656
|
-
[
|
|
657
|
-
),
|
|
658
|
-
|
|
699
|
+
[Qt, _t, k]
|
|
700
|
+
), fe = P(() => {
|
|
701
|
+
Nt({
|
|
659
702
|
isHovering: !1,
|
|
660
703
|
hoveredSection: null,
|
|
661
704
|
mouseX: 0,
|
|
662
705
|
mouseY: 0,
|
|
663
706
|
dateAtCursor: null
|
|
664
707
|
});
|
|
665
|
-
}, []),
|
|
666
|
-
|
|
667
|
-
}, []),
|
|
668
|
-
(
|
|
669
|
-
if (
|
|
670
|
-
|
|
671
|
-
const t =
|
|
672
|
-
|
|
708
|
+
}, []), xe = P(() => {
|
|
709
|
+
G.current = !1, at(!1);
|
|
710
|
+
}, []), be = P(
|
|
711
|
+
(e) => {
|
|
712
|
+
if (e.touches.length === 1 && G.current && k > 0) {
|
|
713
|
+
e.preventDefault();
|
|
714
|
+
const t = lt.current - e.touches[0].clientX, g = ct.current + t;
|
|
715
|
+
it(Math.max(0, Math.min(k, g)));
|
|
673
716
|
}
|
|
674
717
|
},
|
|
675
|
-
[
|
|
676
|
-
),
|
|
677
|
-
|
|
718
|
+
[k]
|
|
719
|
+
), ye = P(() => {
|
|
720
|
+
G.current = !1, at(!1);
|
|
678
721
|
}, []);
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
if (
|
|
682
|
-
const
|
|
683
|
-
|
|
722
|
+
xt(() => {
|
|
723
|
+
const e = (d) => {
|
|
724
|
+
if (G.current && k > 0) {
|
|
725
|
+
const u = lt.current - d.clientX, W = ct.current + u;
|
|
726
|
+
it(Math.max(0, Math.min(k, W)));
|
|
684
727
|
}
|
|
685
728
|
}, t = () => {
|
|
686
|
-
|
|
687
|
-
},
|
|
688
|
-
if (
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
|
|
729
|
+
G.current = !1, at(!1);
|
|
730
|
+
}, g = (d) => {
|
|
731
|
+
if (d.touches.length === 1 && G.current && k > 0) {
|
|
732
|
+
d.preventDefault();
|
|
733
|
+
const u = lt.current - d.touches[0].clientX, W = ct.current + u;
|
|
734
|
+
it(Math.max(0, Math.min(k, W)));
|
|
692
735
|
}
|
|
693
|
-
},
|
|
694
|
-
|
|
736
|
+
}, F = () => {
|
|
737
|
+
G.current = !1, at(!1);
|
|
738
|
+
};
|
|
739
|
+
return Ct && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", g, {
|
|
740
|
+
passive: !1
|
|
741
|
+
}), window.addEventListener("touchend", F)), () => {
|
|
742
|
+
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", F);
|
|
743
|
+
};
|
|
744
|
+
}, [Ct, k]);
|
|
745
|
+
const Pt = P(
|
|
746
|
+
(e) => {
|
|
747
|
+
const t = Zt.current;
|
|
748
|
+
if (!t || k <= 0) return;
|
|
749
|
+
const g = t.getBoundingClientRect(), F = g.width, d = Z / rt * F, u = F - d;
|
|
750
|
+
if (u <= 0) return;
|
|
751
|
+
const B = e - g.left - d / 2, j = Math.max(0, Math.min(1, B / u));
|
|
752
|
+
it(j * k);
|
|
753
|
+
},
|
|
754
|
+
[k, Z, rt]
|
|
755
|
+
), ve = P((e) => {
|
|
756
|
+
e.preventDefault(), e.stopPropagation(), dt.current = !0, At(!0);
|
|
757
|
+
}, []), Se = P((e) => {
|
|
758
|
+
e.stopPropagation(), e.touches.length === 1 && (dt.current = !0, At(!0));
|
|
759
|
+
}, []);
|
|
760
|
+
return xt(() => {
|
|
761
|
+
const e = (d) => {
|
|
762
|
+
dt.current && Pt(d.clientX);
|
|
763
|
+
}, t = () => {
|
|
764
|
+
dt.current = !1, At(!1);
|
|
765
|
+
}, g = (d) => {
|
|
766
|
+
d.touches.length === 1 && dt.current && (d.preventDefault(), Pt(d.touches[0].clientX));
|
|
767
|
+
}, F = () => {
|
|
768
|
+
dt.current = !1, At(!1);
|
|
695
769
|
};
|
|
696
|
-
return
|
|
770
|
+
return Et && (window.addEventListener("mousemove", e), window.addEventListener("mouseup", t), window.addEventListener("touchmove", g, {
|
|
697
771
|
passive: !1
|
|
698
|
-
}), window.addEventListener("touchend",
|
|
699
|
-
window.removeEventListener("mousemove",
|
|
772
|
+
}), window.addEventListener("touchend", F)), () => {
|
|
773
|
+
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", t), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", F);
|
|
700
774
|
};
|
|
701
|
-
}, [
|
|
702
|
-
|
|
703
|
-
}, [
|
|
704
|
-
const
|
|
705
|
-
|
|
775
|
+
}, [Et, Pt]), xt(() => {
|
|
776
|
+
Tt();
|
|
777
|
+
}, [Tt]), xt(() => {
|
|
778
|
+
const e = () => {
|
|
779
|
+
Tt();
|
|
706
780
|
};
|
|
707
|
-
window.addEventListener("resize",
|
|
781
|
+
window.addEventListener("resize", e);
|
|
708
782
|
const t = new ResizeObserver(() => {
|
|
709
|
-
|
|
783
|
+
Tt();
|
|
710
784
|
});
|
|
711
|
-
return
|
|
712
|
-
window.removeEventListener("resize",
|
|
785
|
+
return jt.current && t.observe(jt.current), () => {
|
|
786
|
+
window.removeEventListener("resize", e), t.disconnect();
|
|
713
787
|
};
|
|
714
|
-
}, [
|
|
788
|
+
}, [Tt]), /* @__PURE__ */ a.jsxs(
|
|
715
789
|
"div",
|
|
716
790
|
{
|
|
717
|
-
ref:
|
|
718
|
-
className:
|
|
791
|
+
ref: jt,
|
|
792
|
+
className: b,
|
|
719
793
|
style: {
|
|
720
794
|
position: "relative",
|
|
721
795
|
width: "100%",
|
|
@@ -723,10 +797,10 @@ function Te({
|
|
|
723
797
|
overflow: "hidden",
|
|
724
798
|
touchAction: "pan-x pan-y",
|
|
725
799
|
// Permite gestos de pan (scroll) em mobile
|
|
726
|
-
...
|
|
800
|
+
...v
|
|
727
801
|
},
|
|
728
802
|
children: [
|
|
729
|
-
|
|
803
|
+
S && /* @__PURE__ */ a.jsxs(
|
|
730
804
|
"div",
|
|
731
805
|
{
|
|
732
806
|
style: {
|
|
@@ -734,14 +808,14 @@ function Te({
|
|
|
734
808
|
justifyContent: "flex-end",
|
|
735
809
|
gap: c === "sm" ? 6 : 8,
|
|
736
810
|
paddingBottom: 8,
|
|
737
|
-
paddingRight:
|
|
811
|
+
paddingRight: s.padding.right
|
|
738
812
|
},
|
|
739
813
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ a.jsx(
|
|
741
815
|
"button",
|
|
742
816
|
{
|
|
743
817
|
type: "button",
|
|
744
|
-
onClick: () =>
|
|
818
|
+
onClick: () => Ut((e) => Math.max(0, e - 1)),
|
|
745
819
|
style: {
|
|
746
820
|
width: c === "sm" ? 36 : 44,
|
|
747
821
|
height: c === "sm" ? 36 : 44,
|
|
@@ -749,7 +823,7 @@ function Te({
|
|
|
749
823
|
minHeight: c === "sm" ? 36 : 44,
|
|
750
824
|
borderRadius: 999,
|
|
751
825
|
border: "1px solid rgba(0,0,0,0.16)",
|
|
752
|
-
background:
|
|
826
|
+
background: i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
|
|
753
827
|
display: "flex",
|
|
754
828
|
alignItems: "center",
|
|
755
829
|
justifyContent: "center",
|
|
@@ -762,12 +836,12 @@ function Te({
|
|
|
762
836
|
children: "-"
|
|
763
837
|
}
|
|
764
838
|
),
|
|
765
|
-
/* @__PURE__ */
|
|
839
|
+
/* @__PURE__ */ a.jsx(
|
|
766
840
|
"button",
|
|
767
841
|
{
|
|
768
842
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
770
|
-
(
|
|
843
|
+
onClick: () => Ut(
|
|
844
|
+
(e) => Math.min(Lt.length - 1, e + 1)
|
|
771
845
|
),
|
|
772
846
|
style: {
|
|
773
847
|
width: c === "sm" ? 36 : 44,
|
|
@@ -776,7 +850,7 @@ function Te({
|
|
|
776
850
|
minHeight: c === "sm" ? 36 : 44,
|
|
777
851
|
borderRadius: 999,
|
|
778
852
|
border: "1px solid rgba(0,0,0,0.16)",
|
|
779
|
-
background:
|
|
853
|
+
background: i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
|
|
780
854
|
display: "flex",
|
|
781
855
|
alignItems: "center",
|
|
782
856
|
justifyContent: "center",
|
|
@@ -789,11 +863,11 @@ function Te({
|
|
|
789
863
|
children: "+"
|
|
790
864
|
}
|
|
791
865
|
),
|
|
792
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ a.jsx(
|
|
793
867
|
"button",
|
|
794
868
|
{
|
|
795
869
|
type: "button",
|
|
796
|
-
onClick: () =>
|
|
870
|
+
onClick: () => zt((e) => !e),
|
|
797
871
|
style: {
|
|
798
872
|
width: c === "sm" ? 36 : 44,
|
|
799
873
|
height: c === "sm" ? 36 : 44,
|
|
@@ -801,14 +875,14 @@ function Te({
|
|
|
801
875
|
minHeight: c === "sm" ? 36 : 44,
|
|
802
876
|
borderRadius: 999,
|
|
803
877
|
border: "1px solid rgba(0,0,0,0.16)",
|
|
804
|
-
background: Y ?
|
|
878
|
+
background: Y ? i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)" : i.config.theme === "dark" ? "rgba(0,0,0,0.7)" : "rgba(0,0,0,0.5)",
|
|
805
879
|
display: "flex",
|
|
806
880
|
alignItems: "center",
|
|
807
881
|
justifyContent: "center",
|
|
808
882
|
fontSize: c === "sm" ? 14 : 16,
|
|
809
883
|
cursor: "pointer",
|
|
810
884
|
boxShadow: "0 1px 2px rgba(0,0,0,0.25)",
|
|
811
|
-
color: Y ?
|
|
885
|
+
color: Y ? i.config.theme === "dark" ? "#ECEFF1" : "#263238" : "#FFFFFF",
|
|
812
886
|
fontWeight: "bold",
|
|
813
887
|
touchAction: "manipulation",
|
|
814
888
|
WebkitTapHighlightColor: "transparent"
|
|
@@ -817,11 +891,11 @@ function Te({
|
|
|
817
891
|
children: "S"
|
|
818
892
|
}
|
|
819
893
|
),
|
|
820
|
-
|
|
894
|
+
i.timeline.dailyConsumptionAverage && /* @__PURE__ */ a.jsx(
|
|
821
895
|
"button",
|
|
822
896
|
{
|
|
823
897
|
type: "button",
|
|
824
|
-
onClick: () =>
|
|
898
|
+
onClick: () => ce((e) => !e),
|
|
825
899
|
style: {
|
|
826
900
|
width: c === "sm" ? 36 : 44,
|
|
827
901
|
height: c === "sm" ? 36 : 44,
|
|
@@ -829,84 +903,96 @@ function Te({
|
|
|
829
903
|
minHeight: c === "sm" ? 36 : 44,
|
|
830
904
|
borderRadius: 999,
|
|
831
905
|
border: "1px solid rgba(0,0,0,0.16)",
|
|
832
|
-
background:
|
|
906
|
+
background: vt ? i.config.theme === "dark" ? "rgba(0,0,0,0.7)" : "rgba(0,0,0,0.5)" : i.config.theme === "dark" ? "rgba(38,50,56,0.9)" : "rgba(255,255,255,0.9)",
|
|
833
907
|
display: "flex",
|
|
834
908
|
alignItems: "center",
|
|
835
909
|
justifyContent: "center",
|
|
836
910
|
fontSize: c === "sm" ? 14 : 16,
|
|
837
911
|
cursor: "pointer",
|
|
838
912
|
boxShadow: "0 1px 2px rgba(0,0,0,0.25)",
|
|
839
|
-
color:
|
|
913
|
+
color: vt ? "#FFFFFF" : i.config.theme === "dark" ? "#ECEFF1" : "#263238",
|
|
840
914
|
fontWeight: "bold",
|
|
841
915
|
touchAction: "manipulation",
|
|
842
916
|
WebkitTapHighlightColor: "transparent"
|
|
843
917
|
},
|
|
844
|
-
title:
|
|
918
|
+
title: vt ? "Ocultar linha de consumo" : "Mostrar linha de consumo",
|
|
845
919
|
children: "C"
|
|
846
920
|
}
|
|
847
921
|
)
|
|
848
922
|
]
|
|
849
923
|
}
|
|
850
924
|
),
|
|
851
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ a.jsxs(
|
|
852
926
|
"div",
|
|
853
927
|
{
|
|
854
928
|
style: {
|
|
855
929
|
position: "relative",
|
|
856
930
|
width: "100%",
|
|
857
|
-
minHeight:
|
|
931
|
+
minHeight: k > 0 ? s.height + 8 + 15 : s.height
|
|
858
932
|
},
|
|
859
933
|
children: [
|
|
860
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ a.jsx(
|
|
861
935
|
"canvas",
|
|
862
936
|
{
|
|
863
|
-
ref:
|
|
864
|
-
onMouseMove:
|
|
865
|
-
onMouseLeave:
|
|
866
|
-
onMouseDown:
|
|
867
|
-
onMouseUp:
|
|
868
|
-
onTouchStart:
|
|
869
|
-
onTouchMove:
|
|
870
|
-
onTouchEnd:
|
|
937
|
+
ref: ot,
|
|
938
|
+
onMouseMove: pe,
|
|
939
|
+
onMouseLeave: fe,
|
|
940
|
+
onMouseDown: he,
|
|
941
|
+
onMouseUp: xe,
|
|
942
|
+
onTouchStart: me,
|
|
943
|
+
onTouchMove: be,
|
|
944
|
+
onTouchEnd: ye,
|
|
871
945
|
style: {
|
|
872
946
|
width: "100%",
|
|
873
|
-
height: `${
|
|
947
|
+
height: `${s.height}px`,
|
|
874
948
|
display: "block",
|
|
875
|
-
cursor:
|
|
949
|
+
cursor: k > 0 ? Ct ? "grabbing" : "grab" : "pointer",
|
|
876
950
|
touchAction: "pan-x"
|
|
877
951
|
}
|
|
878
952
|
}
|
|
879
953
|
),
|
|
880
|
-
|
|
954
|
+
k > 0 && /* @__PURE__ */ a.jsx(
|
|
881
955
|
"div",
|
|
882
956
|
{
|
|
957
|
+
ref: Zt,
|
|
883
958
|
style: {
|
|
884
959
|
position: "absolute",
|
|
885
|
-
top:
|
|
886
|
-
left:
|
|
887
|
-
right:
|
|
888
|
-
height:
|
|
889
|
-
backgroundColor:
|
|
890
|
-
borderRadius:
|
|
891
|
-
cursor: "pointer"
|
|
960
|
+
top: s.height + 8,
|
|
961
|
+
left: 0,
|
|
962
|
+
right: 0,
|
|
963
|
+
height: 15,
|
|
964
|
+
backgroundColor: i.config.theme === "dark" ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)",
|
|
965
|
+
borderRadius: 7.5,
|
|
966
|
+
cursor: "pointer",
|
|
967
|
+
display: "flex",
|
|
968
|
+
alignItems: "center"
|
|
892
969
|
},
|
|
893
|
-
onClick: (
|
|
894
|
-
|
|
895
|
-
|
|
970
|
+
onClick: (e) => {
|
|
971
|
+
if (e.target !== e.currentTarget) return;
|
|
972
|
+
const t = e.currentTarget.getBoundingClientRect(), F = (e.clientX - t.left) / t.width;
|
|
973
|
+
it(F * k);
|
|
896
974
|
},
|
|
897
|
-
children: /* @__PURE__ */
|
|
975
|
+
children: /* @__PURE__ */ a.jsx(
|
|
898
976
|
"div",
|
|
899
977
|
{
|
|
978
|
+
role: "slider",
|
|
979
|
+
"aria-valuenow": q,
|
|
980
|
+
"aria-valuemin": 0,
|
|
981
|
+
"aria-valuemax": k,
|
|
982
|
+
onMouseDown: ve,
|
|
983
|
+
onTouchStart: Se,
|
|
900
984
|
style: {
|
|
901
985
|
position: "absolute",
|
|
902
|
-
top:
|
|
903
|
-
|
|
904
|
-
width: `${Math.max(10,
|
|
986
|
+
top: "50%",
|
|
987
|
+
transform: "translateY(-50%)",
|
|
988
|
+
width: `${Math.max(10, Z / rt * 100)}%`,
|
|
989
|
+
left: `${k > 0 ? q / k * (100 - Math.max(10, Z / rt * 100)) : 0}%`,
|
|
905
990
|
maxWidth: "100%",
|
|
906
|
-
height:
|
|
907
|
-
backgroundColor:
|
|
908
|
-
borderRadius:
|
|
909
|
-
|
|
991
|
+
height: 9,
|
|
992
|
+
backgroundColor: i.config.theme === "dark" ? "rgba(255,255,255,0.4)" : "rgba(0,0,0,0.3)",
|
|
993
|
+
borderRadius: 4.5,
|
|
994
|
+
cursor: Et ? "grabbing" : "grab",
|
|
995
|
+
transition: Ct || Et ? "none" : "left 0.1s ease-out"
|
|
910
996
|
}
|
|
911
997
|
}
|
|
912
998
|
)
|
|
@@ -915,16 +1001,16 @@ function Te({
|
|
|
915
1001
|
]
|
|
916
1002
|
}
|
|
917
1003
|
),
|
|
918
|
-
|
|
919
|
-
/* @__PURE__ */
|
|
1004
|
+
T.isHovering && (T.dateAtCursor || T.hoveredSection === "alertIcon") && typeof document < "u" && De(
|
|
1005
|
+
/* @__PURE__ */ a.jsx(
|
|
920
1006
|
"div",
|
|
921
1007
|
{
|
|
922
1008
|
style: {
|
|
923
1009
|
position: "fixed",
|
|
924
|
-
left: `${
|
|
925
|
-
top: `${
|
|
926
|
-
backgroundColor:
|
|
927
|
-
color:
|
|
1010
|
+
left: `${qt.x}px`,
|
|
1011
|
+
top: `${qt.y}px`,
|
|
1012
|
+
backgroundColor: p.tooltipBackground,
|
|
1013
|
+
color: p.tooltipText,
|
|
928
1014
|
padding: "6px 10px",
|
|
929
1015
|
borderRadius: "6px",
|
|
930
1016
|
fontSize: "10px",
|
|
@@ -934,84 +1020,85 @@ function Te({
|
|
|
934
1020
|
transform: "translate(-50%, calc(-100% - 10px))",
|
|
935
1021
|
whiteSpace: "nowrap"
|
|
936
1022
|
},
|
|
937
|
-
children:
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
] }) : /* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
/* @__PURE__ */
|
|
1023
|
+
children: T.hoveredSection === "alertIcon" ? /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1024
|
+
/* @__PURE__ */ a.jsx("div", { style: { fontWeight: "bold", marginBottom: "4px" }, children: H.title }),
|
|
1025
|
+
/* @__PURE__ */ a.jsx("div", { children: H.message })
|
|
1026
|
+
] }) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1027
|
+
/* @__PURE__ */ a.jsx("div", { style: { fontWeight: "bold", marginBottom: "4px" }, children: T.dateAtCursor && ge(T.dateAtCursor) }),
|
|
1028
|
+
T.dateAtCursor && !T.hoveredSection && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1029
|
+
/* @__PURE__ */ a.jsx("div", { style: { marginBottom: 2 }, children: re[T.dateAtCursor.getDay()] }),
|
|
1030
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
945
1031
|
"Consumo médio:",
|
|
946
1032
|
" ",
|
|
947
1033
|
(() => {
|
|
948
|
-
const
|
|
1034
|
+
const e = T.dateAtCursor.getDay(), t = ae(e);
|
|
949
1035
|
return t !== null ? `${t.toFixed(2)}` : "0.0";
|
|
950
1036
|
})()
|
|
951
1037
|
] })
|
|
952
1038
|
] }),
|
|
953
|
-
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
|
|
956
|
-
" —
|
|
957
|
-
|
|
1039
|
+
T.hoveredSection === "stock" && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1040
|
+
/* @__PURE__ */ a.jsxs("div", { style: { marginBottom: 2 }, children: [
|
|
1041
|
+
St(M),
|
|
1042
|
+
" —",
|
|
1043
|
+
" ",
|
|
1044
|
+
St(C)
|
|
958
1045
|
] }),
|
|
959
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
960
1047
|
"Estoque disponível até ",
|
|
961
|
-
|
|
1048
|
+
St(C)
|
|
962
1049
|
] }),
|
|
963
|
-
/* @__PURE__ */
|
|
964
|
-
const
|
|
1050
|
+
/* @__PURE__ */ a.jsx("div", { style: { marginTop: 2 }, children: (() => {
|
|
1051
|
+
const e = Math.max(
|
|
965
1052
|
0,
|
|
966
1053
|
Math.round(
|
|
967
|
-
(
|
|
1054
|
+
(C.getTime() - M.getTime()) / A
|
|
968
1055
|
)
|
|
969
|
-
), t =
|
|
970
|
-
return `${
|
|
1056
|
+
), t = i.timeline.stockWeightKg ?? i.timeline.restockSuggestionWeight;
|
|
1057
|
+
return `${e} dia(s) de estoque${t ? ` • ${t} ${Ft}` : ""}`;
|
|
971
1058
|
})() })
|
|
972
1059
|
] }),
|
|
973
|
-
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
const
|
|
1060
|
+
T.hoveredSection === "suggestion" && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
1061
|
+
/* @__PURE__ */ a.jsx("div", { style: { marginBottom: 2 }, children: (() => {
|
|
1062
|
+
const e = new Date(
|
|
976
1063
|
Math.max(
|
|
977
|
-
|
|
978
|
-
|
|
1064
|
+
I.getTime(),
|
|
1065
|
+
C.getTime()
|
|
979
1066
|
)
|
|
980
1067
|
);
|
|
981
|
-
return `${
|
|
1068
|
+
return `${St(e)} — ${St(U)}`;
|
|
982
1069
|
})() }),
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
const
|
|
1070
|
+
/* @__PURE__ */ a.jsx("div", { children: "Período crítico para compra" }),
|
|
1071
|
+
/* @__PURE__ */ a.jsx("div", { style: { marginTop: 2 }, children: (() => {
|
|
1072
|
+
const e = new Date(
|
|
986
1073
|
Math.max(
|
|
987
|
-
|
|
988
|
-
|
|
1074
|
+
I.getTime(),
|
|
1075
|
+
C.getTime()
|
|
989
1076
|
)
|
|
990
1077
|
), t = Math.max(
|
|
991
1078
|
0,
|
|
992
1079
|
Math.round(
|
|
993
|
-
(
|
|
1080
|
+
(U.getTime() - e.getTime()) / A
|
|
994
1081
|
)
|
|
995
|
-
),
|
|
996
|
-
return `${t} dia(s) de sugestão${
|
|
1082
|
+
), g = i.timeline.restockSuggestionWeight;
|
|
1083
|
+
return `${t} dia(s) de sugestão${g ? ` • ${g} ${Ft}` : ""}`;
|
|
997
1084
|
})() })
|
|
998
1085
|
] }),
|
|
999
|
-
|
|
1086
|
+
T.hoveredSection === "selectedQty" && typeof w == "number" && typeof m == "number" && /* @__PURE__ */ a.jsxs("div", { children: [
|
|
1000
1087
|
"O estoque selecionado de ",
|
|
1001
|
-
|
|
1088
|
+
w,
|
|
1002
1089
|
" deve durar",
|
|
1003
1090
|
" ",
|
|
1004
|
-
|
|
1091
|
+
m % 1 === 0 ? m : m.toFixed(1),
|
|
1005
1092
|
" ",
|
|
1006
1093
|
"dia",
|
|
1007
|
-
|
|
1094
|
+
m === 1 ? "" : "s"
|
|
1008
1095
|
] })
|
|
1009
1096
|
] })
|
|
1010
1097
|
}
|
|
1011
1098
|
),
|
|
1012
1099
|
document.body
|
|
1013
1100
|
),
|
|
1014
|
-
|
|
1101
|
+
E && /* @__PURE__ */ a.jsxs(
|
|
1015
1102
|
"div",
|
|
1016
1103
|
{
|
|
1017
1104
|
style: {
|
|
@@ -1020,88 +1107,88 @@ function Te({
|
|
|
1020
1107
|
flexWrap: "wrap",
|
|
1021
1108
|
justifyContent: "flex-end",
|
|
1022
1109
|
gap: "8px",
|
|
1023
|
-
backgroundColor:
|
|
1110
|
+
backgroundColor: p.legendBackground,
|
|
1024
1111
|
padding: "8px 10px",
|
|
1025
1112
|
marginTop: "8px",
|
|
1026
1113
|
borderRadius: "4px",
|
|
1027
1114
|
fontSize: "10px",
|
|
1028
|
-
color:
|
|
1115
|
+
color: p.textPrimary
|
|
1029
1116
|
},
|
|
1030
1117
|
children: [
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
1119
|
+
/* @__PURE__ */ a.jsx(
|
|
1033
1120
|
"div",
|
|
1034
1121
|
{
|
|
1035
1122
|
style: {
|
|
1036
1123
|
width: "10px",
|
|
1037
1124
|
height: "10px",
|
|
1038
|
-
backgroundColor:
|
|
1125
|
+
backgroundColor: p.stockPast,
|
|
1039
1126
|
borderRadius: "2px"
|
|
1040
1127
|
}
|
|
1041
1128
|
}
|
|
1042
1129
|
),
|
|
1043
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ a.jsx("span", { children: "Estoque Passado" })
|
|
1044
1131
|
] }),
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
1133
|
+
/* @__PURE__ */ a.jsx(
|
|
1047
1134
|
"div",
|
|
1048
1135
|
{
|
|
1049
1136
|
style: {
|
|
1050
1137
|
width: "10px",
|
|
1051
1138
|
height: "10px",
|
|
1052
|
-
backgroundColor:
|
|
1139
|
+
backgroundColor: p.stockFuture,
|
|
1053
1140
|
borderRadius: "2px"
|
|
1054
1141
|
}
|
|
1055
1142
|
}
|
|
1056
1143
|
),
|
|
1057
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ a.jsx("span", { children: "Previsão Estoque" })
|
|
1058
1145
|
] }),
|
|
1059
|
-
Y && /* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1146
|
+
Y && /* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
1147
|
+
/* @__PURE__ */ a.jsx(
|
|
1061
1148
|
"div",
|
|
1062
1149
|
{
|
|
1063
1150
|
style: {
|
|
1064
1151
|
width: "10px",
|
|
1065
1152
|
height: "10px",
|
|
1066
|
-
backgroundColor:
|
|
1153
|
+
backgroundColor: p.alert,
|
|
1067
1154
|
borderRadius: "2px"
|
|
1068
1155
|
}
|
|
1069
1156
|
}
|
|
1070
1157
|
),
|
|
1071
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ a.jsx("span", { children: "Sugestão Compra" })
|
|
1072
1159
|
] }),
|
|
1073
|
-
/* @__PURE__ */
|
|
1074
|
-
/* @__PURE__ */
|
|
1160
|
+
/* @__PURE__ */ a.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
1161
|
+
/* @__PURE__ */ a.jsx(
|
|
1075
1162
|
"div",
|
|
1076
1163
|
{
|
|
1077
1164
|
style: {
|
|
1078
1165
|
width: "2px",
|
|
1079
1166
|
height: "10px",
|
|
1080
|
-
borderLeft: `2px dashed ${
|
|
1167
|
+
borderLeft: `2px dashed ${p.deliveryBar}`,
|
|
1081
1168
|
marginLeft: "4px",
|
|
1082
1169
|
marginRight: "4px"
|
|
1083
1170
|
}
|
|
1084
1171
|
}
|
|
1085
1172
|
),
|
|
1086
|
-
/* @__PURE__ */
|
|
1173
|
+
/* @__PURE__ */ a.jsx("span", { children: "Data Entrega" })
|
|
1087
1174
|
] }),
|
|
1088
|
-
typeof
|
|
1175
|
+
typeof m == "number" && m > 0 && typeof w == "number" && /* @__PURE__ */ a.jsxs(
|
|
1089
1176
|
"div",
|
|
1090
1177
|
{
|
|
1091
1178
|
style: { display: "flex", alignItems: "center", gap: "6px" },
|
|
1092
1179
|
children: [
|
|
1093
|
-
/* @__PURE__ */
|
|
1180
|
+
/* @__PURE__ */ a.jsx(
|
|
1094
1181
|
"div",
|
|
1095
1182
|
{
|
|
1096
1183
|
style: {
|
|
1097
1184
|
width: "10px",
|
|
1098
1185
|
height: "5px",
|
|
1099
|
-
backgroundColor:
|
|
1186
|
+
backgroundColor: p.selectedQtyBar,
|
|
1100
1187
|
borderRadius: "2px"
|
|
1101
1188
|
}
|
|
1102
1189
|
}
|
|
1103
1190
|
),
|
|
1104
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ a.jsx("span", { children: "Qtd. Selecionada" })
|
|
1105
1192
|
]
|
|
1106
1193
|
}
|
|
1107
1194
|
)
|
|
@@ -1113,6 +1200,6 @@ function Te({
|
|
|
1113
1200
|
);
|
|
1114
1201
|
}
|
|
1115
1202
|
export {
|
|
1116
|
-
|
|
1203
|
+
Be as StockLeadTime
|
|
1117
1204
|
};
|
|
1118
1205
|
//# sourceMappingURL=index18.js.map
|