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