vendor: 38,588 bytes, lines 1-1273
1import { WsSelect as fd, WsSelectOption as ll, WsInputDatePicker as NE, toast as qt, ToastStatus as ri, WsButton as Xs, prompt as SS, PromptResult as yp, WsDialogForm as xv, WsDialogSection as Mv, WsInput as Hu, WsAlert as vL, WsToggle as yL, WsDialogActions as Av, openDialog as Vu, WsMenu as xS, WsMenuItem as Za, WsSelectTrigger as G6, WsSelectPanel as z6, WsSelectSearchInput as H6, WsSelectHeader as CL, WsSelectOptions as V6, WsTooltip as ca, WsIconButton as MS, WsColorPicker as U6, useQuasarPlugin as W6 } from "@mfl/common-components"; 2import { bootstrapMicrofrontend as j6 } from "@mfl/vue-common"; 3import { shallowRef as $6, unref as Z, shallowReactive as Y6, defineComponent as Mt, reactive as bL, inject as ua, computed as Qe, h as AS, provide as Xu, ref as De, watch as Gn, nextTick as wL, openBlock as we, createElementBlock as Ne, Fragment as yi, renderList as hs, normalizeClass as da, createTextVNode as ut, toDisplayString as ke, createBlock as Wt, createCommentVNode as di, createElementVNode as fe, createVNode as Re, withCtx as Ve, onMounted as Cn, onUnmounted as Nd, useTemplateRef as K6, toRefs as Z6, useModel as Dv, getCurrentInstance as Pb, markRaw as q6, mergeModels as md, mergeDefaults as Q6, isRef as SL, isReactive as X6, isProxy as J6, toRaw as eU, render as _E, mergeProps as Ev, resolveComponent as xL, toValue as Sf, onBeforeUnmount as tU, withDirectives as Tu, vShow as Lu, renderSlot as iU, withModifiers as ML, normalizeStyle as Em, withKeys as BE, resolveDynamicComponent as sU, toHandlers as nU } from "vue"; 4import { navigateTo as bl, preventPageUnload as oU, releasePageUnload as Fb } from "@mfl/framework"; 5import { auth4Sdks as bc, reportUserAnalyticEvent as gr, currentUser as Z0, PURCHASE_PLANS_URL as rU } from "@mfl/platform-shell"; 6import { QSpinner as aU } from "quasar"; 7import { B as lU, W as cU, C as uU, t as ge, T as Ws, a as AL, R as GE } from "./links.strings-CQ_6Y8V9.js"; 8import { HeaderMode as zE, headerMode as HE } from "@mfe/core-header"; 9import { NavigationBarMode as VE, navigationBarMode as UE } from "@mfe/core-navigation"; 10import { openCompanyProfileDialog as dU } from "@mfl/company-profile-dialog"; 11const ku = typeof document < "u"; 12function DL(e) { 13 return typeof e == "object" || "displayName" in e || "props" in e || "__vccOpts" in e; 14} 15function hU(e) { 16 return e.__esModule || e[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not 17 // add the Module string tag 18 e.default && DL(e.default); 19} 20const Ut = Object.assign; 21function Ob(e, t) { 22 const i = {}; 23 for (const s in t) { 24 const n = t[s]; 25 i[s] = $o(n) ? n.map(e) : e(n); 26 } 27 return i; 28} 29const Zh = () => { 30}, $o = Array.isArray, EL = /#/g, pU = /&/g, gU = /\//g, fU = /=/g, mU = /\?/g, IL = /\+/g, vU = /%5B/g, yU = /%5D/g, RL = /%5E/g, CU = /%60/g, TL = /%7B/g, bU = /%7C/g, LL = /%7D/g, wU = /%20/g; 31function DS(e) { 32 return encodeURI("" + e).replace(bU, "|").replace(vU, "[").replace(yU, "]"); 33} 34function SU(e) { 35 return DS(e).replace(TL, "{").replace(LL, "}").replace(RL, "^"); 36} 37function q0(e) { 38 return DS(e).replace(IL, "%2B").replace(wU, "+").replace(EL, "%23").replace(pU, "%26").replace(CU, "`").replace(TL, "{").replace(LL, "}").replace(RL, "^"); 39} 40function xU(e) { 41 return q0(e).replace(fU, "%3D"); 42} 43function MU(e) { 44 return DS(e).replace(EL, "%23").replace(mU, "%3F"); 45} 46function AU(e) { 47 return e == null ? "" : MU(e).replace(gU, "%2F"); 48} 49function Cp(e) { 50 try { 51 return decodeURIComponent("" + e); 52 } catch { 53 } 54 return "" + e; 55} 56const DU = /\/$/, EU = (e) => e.replace(DU, ""); 57function Nb(e, t, i = "/") { 58 let s, n = {}, o = "", r = ""; 59 const a = t.indexOf("#"); 60 let l = t.indexOf("?"); 61 return a < l && a >= 0 && (l = -1), l > -1 && (s = t.slice(0, l), o = t.slice(l + 1, a > -1 ? a : t.length), n = e(o)), a > -1 && (s = s || t.slice(0, a), r = t.slice(a, t.length)), s = LU(s ?? t, i), { 62 fullPath: s + (o && "?") + o + r, 63 path: s, 64 query: n, 65 hash: Cp(r) 66 }; 67} 68function IU(e, t) { 69 const i = t.query ? e(t.query) : ""; 70 return t.path + (i && "?") + i + (t.hash || ""); 71} 72function WE(e, t) { 73 return !t || !e.toLowerCase().startsWith(t.toLowerCase()) ? e : e.slice(t.length) || "/"; 74} 75function RU(e, t, i) { 76 const s = t.matched.length - 1, n = i.matched.length - 1; 77 return s > -1 && s === n && vd(t.matched[s], i.matched[n]) && kL(t.params, i.params) && e(t.query) === e(i.query) && t.hash === i.hash; 78} 79function vd(e, t) { 80 return (e.aliasOf || e) === (t.aliasOf || t); 81} 82function kL(e, t) { 83 if (Object.keys(e).length !== Object.keys(t).length) 84 return !1; 85 for (const i in e) 86 if (!TU(e[i], t[i])) 87 return !1; 88 return !0; 89} 90function TU(e, t) { 91 return $o(e) ? jE(e, t) : $o(t) ? jE(t, e) : e === t; 92} 93function jE(e, t) { 94 return $o(t) ? e.length === t.length && e.every((i, s) => i === t[s]) : e.length === 1 && e[0] === t; 95} 96function LU(e, t) { 97 if (e.startsWith("/")) 98 return e; 99 if (!e) 100 return t; 101 const i = t.split("/"), s = e.split("/"), n = s[s.length - 1]; 102 (n === ".." || n === ".") && s.push(""); 103 let o = i.length - 1, r, a; 104 for (r = 0; r < s.length; r++) 105 if (a = s[r], a !== ".") 106 if (a === "..") 107 o > 1 && o--; 108 else 109 break; 110 return i.slice(0, o).join("/") + "/" + s.slice(r).join("/"); 111} 112const Ua = { 113 path: "/", 114 // TODO: could we use a symbol in the future? 115 name: void 0, 116 params: {}, 117 query: {}, 118 hash: "", 119 fullPath: "/", 120 matched: [], 121 meta: {}, 122 redirectedFrom: void 0 123}; 124var bp; 125(function(e) { 126 e.pop = "pop", e.push = "push"; 127})(bp || (bp = {})); 128var qh; 129(function(e) { 130 e.back = "back", e.forward = "forward", e.unknown = ""; 131})(qh || (qh = {})); 132function kU(e) { 133 if (!e) 134 if (ku) { 135 const t = document.querySelector("base"); 136 e = t && t.getAttribute("href") || "/", e = e.replace(/^\w+:\/\/[^\/]+/, ""); 137 } else 138 e = "/"; 139 return e[0] !== "/" && e[0] !== "#" && (e = "/" + e), EU(e); 140} 141const PU = /^[^#]+#/; 142function FU(e, t) { 143 return e.replace(PU, "#") + t; 144} 145function OU(e, t) { 146 const i = document.documentElement.getBoundingClientRect(), s = e.getBoundingClientRect(); 147 return { 148 behavior: t.behavior, 149 left: s.left - i.left - (t.left || 0), 150 top: s.top - i.top - (t.top || 0) 151 }; 152} 153const Iv = () => ({ 154 left: window.scrollX, 155 top: window.scrollY 156}); 157function NU(e) { 158 let t; 159 if ("el" in e) { 160 const i = e.el, s = typeof i == "string" && i.startsWith("#"), n = typeof i == "string" ? s ? document.getElementById(i.slice(1)) : document.querySelector(i) : i; 161 if (!n) 162 return; 163 t = OU(n, e); 164 } else 165 t = e; 166 "scrollBehavior" in document.documentElement.style ? window.scrollTo(t) : window.scrollTo(t.left != null ? t.left : window.scrollX, t.top != null ? t.top : window.scrollY); 167} 168function $E(e, t) { 169 return (history.state ? history.state.position - t : -1) + e; 170} 171const Q0 = /* @__PURE__ */ new Map(); 172function _U(e, t) { 173 Q0.set(e, t); 174} 175function BU(e) { 176 const t = Q0.get(e); 177 return Q0.delete(e), t; 178} 179let GU = () => location.protocol + "//" + location.host; 180function PL(e, t) { 181 const { pathname: i, search: s, hash: n } = t, o = e.indexOf("#"); 182 if (o > -1) { 183 let a = n.includes(e.slice(o)) ? e.slice(o).length : 1, l = n.slice(a); 184 return l[0] !== "/" && (l = "/" + l), WE(l, ""); 185 } 186 return WE(i, e) + s + n; 187} 188function zU(e, t, i, s) { 189 let n = [], o = [], r = null; 190 const a = ({ state: p }) => { 191 const f = PL(e, location), m = i.value, y = t.value; 192 let b = 0; 193 if (p) { 194 if (i.value = f, t.value = p, r && r === m) { 195 r = null; 196 return; 197 } 198 b = y ? p.position - y.position : 0; 199 } else 200 s(f); 201 n.forEach((C) => { 202 C(i.value, m, { 203 delta: b, 204 type: bp.pop, 205 direction: b ? b > 0 ? qh.forward : qh.back : qh.unknown 206 }); 207 }); 208 }; 209 function l() { 210 r = i.value; 211 } 212 function c(p) { 213 n.push(p); 214 const f = () => { 215 const m = n.indexOf(p); 216 m > -1 && n.splice(m, 1); 217 }; 218 return o.push(f), f; 219 } 220 function u() { 221 const { history: p } = window; 222 p.state && p.replaceState(Ut({}, p.state, { scroll: Iv() }), ""); 223 } 224 function d() { 225 for (const p of o) 226 p(); 227 o = [], window.removeEventListener("popstate", a), window.removeEventListener("beforeunload", u); 228 } 229 return window.addEventListener("popstate", a), window.addEventListener("beforeunload", u, { 230 passive: !0 231 }), { 232 pauseListeners: l, 233 listen: c, 234 destroy: d 235 }; 236} 237function YE(e, t, i, s = !1, n = !1) { 238 return { 239 back: e, 240 current: t, 241 forward: i, 242 replaced: s, 243 position: window.history.length, 244 scroll: n ? Iv() : null 245 }; 246} 247function HU(e) { 248 const { history: t, location: i } = window, s = { 249 value: PL(e, i) 250 }, n = { value: t.state }; 251 n.value || o(s.value, { 252 back: null, 253 current: s.value, 254 forward: null, 255 // the length is off by one, we need to decrease it 256 position: t.length - 1, 257 replaced: !0, 258 // don't add a scroll as the user may have an anchor, and we want 259 // scrollBehavior to be triggered without a saved position 260 scroll: null 261 }, !0); 262 function o(l, c, u) { 263 const d = e.indexOf("#"), p = d > -1 ? (i.host && document.querySelector("base") ? e : e.slice(d)) + l : GU() + e + l; 264 try { 265 t[u ? "replaceState" : "pushState"](c, "", p), n.value = c; 266 } catch (f) { 267 console.error(f), i[u ? "replace" : "assign"](p); 268 } 269 } 270 function r(l, c) { 271 const u = Ut({}, t.state, YE( 272 n.value.back, 273 // keep back and forward entries but override current position 274 l, 275 n.value.forward, 276 !0 277 ), c, { position: n.value.position }); 278 o(l, u, !0), s.value = l; 279 } 280 function a(l, c) { 281 const u = Ut( 282 {}, 283 // use current history state to gracefully handle a wrong call to 284 // history.replaceState 285 // https://github.com/vuejs/router/issues/366 286 n.value, 287 t.state, 288 { 289 forward: l, 290 scroll: Iv() 291 } 292 ); 293 o(u.current, u, !0); 294 const d = Ut({}, YE(s.value, l, null), { position: u.position + 1 }, c); 295 o(l, d, !1), s.value = l; 296 } 297 return { 298 location: s, 299 state: n, 300 push: a, 301 replace: r 302 }; 303} 304function VU(e) { 305 e = kU(e); 306 const t = HU(e), i = zU(e, t.state, t.location, t.replace); 307 function s(o, r = !0) { 308 r || i.pauseListeners(), history.go(o); 309 } 310 const n = Ut({ 311 // it's overridden right after 312 location: "", 313 base: e, 314 go: s, 315 createHref: FU.bind(null, e) 316 }, t, i); 317 return Object.defineProperty(n, "location", { 318 enumerable: !0, 319 get: () => t.location.value 320 }), Object.defineProperty(n, "state", { 321 enumerable: !0, 322 get: () => t.state.value 323 }), n; 324} 325function UU(e) { 326 return typeof e == "string" || e && typeof e == "object"; 327} 328function FL(e) { 329 return typeof e == "string" || typeof e == "symbol"; 330} 331const OL = /* @__PURE__ */ Symbol(""); 332var KE; 333(function(e) { 334 e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated"; 335})(KE || (KE = {})); 336function yd(e, t) { 337 return Ut(new Error(), { 338 type: e, 339 [OL]: !0 340 }, t); 341} 342function Vr(e, t) { 343 return e instanceof Error && OL in e && (t == null || !!(e.type & t)); 344} 345const ZE = "[^/]+?", WU = { 346 sensitive: !1, 347 strict: !1, 348 start: !0, 349 end: !0 350}, jU = /[.+*?^${}()[\]/\\]/g; 351function $U(e, t) { 352 const i = Ut({}, WU, t), s = []; 353 let n = i.start ? "^" : ""; 354 const o = []; 355 for (const c of e) { 356 const u = c.length ? [] : [ 357 90 358 /* PathScore.Root */ 359 ]; 360 i.strict && !c.length && (n += "/"); 361 for (let d = 0; d < c.length; d++) { 362 const p = c[d]; 363 let f = 40 + (i.sensitive ? 0.25 : 0); 364 if (p.type === 0) 365 d || (n += "/"), n += p.value.replace(jU, "\\$&"), f += 40; 366 else if (p.type === 1) { 367 const { value: m, repeatable: y, optional: b, regexp: C } = p; 368 o.push({ 369 name: m, 370 repeatable: y, 371 optional: b 372 }); 373 const w = C || ZE; 374 if (w !== ZE) { 375 f += 10; 376 try { 377 new RegExp(`(${w})`); 378 } catch (A) { 379 throw new Error(`Invalid custom RegExp for param "${m}" (${w}): ` + A.message); 380 } 381 } 382 let M = y ? `((?:${w})(?:/(?:${w}))*)` : `(${w})`; 383 d || (M = // avoid an optional / if there are more segments e.g. /:p?-static 384 // or /:p?-:p2 385 b && c.length < 2 ? `(?:/${M})` : "/" + M), b && (M += "?"), n += M, f += 20, b && (f += -8), y && (f += -20), w === ".*" && (f += -50); 386 } 387 u.push(f); 388 } 389 s.push(u); 390 } 391 if (i.strict && i.end) { 392 const c = s.length - 1; 393 s[c][s[c].length - 1] += 0.7000000000000001; 394 } 395 i.strict || (n += "/?"), i.end ? n += "$" : i.strict && !n.endsWith("/") && (n += "(?:/|$)"); 396 const r = new RegExp(n, i.sensitive ? "" : "i"); 397 function a(c) { 398 const u = c.match(r), d = {}; 399 if (!u) 400 return null; 401 for (let p = 1; p < u.length; p++) { 402 const f = u[p] || "", m = o[p - 1]; 403 d[m.name] = f && m.repeatable ? f.split("/") : f; 404 } 405 return d; 406 } 407 function l(c) { 408 let u = "", d = !1; 409 for (const p of e) { 410 (!d || !u.endsWith("/")) && (u += "/"), d = !1; 411 for (const f of p) 412 if (f.type === 0) 413 u += f.value; 414 else if (f.type === 1) { 415 const { value: m, repeatable: y, optional: b } = f, C = m in c ? c[m] : ""; 416 if ($o(C) && !y) 417 throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`); 418 const w = $o(C) ? C.join("/") : C; 419 if (!w) 420 if (b) 421 p.length < 2 && (u.endsWith("/") ? u = u.slice(0, -1) : d = !0); 422 else 423 throw new Error(`Missing required param "${m}"`); 424 u += w; 425 } 426 } 427 return u || "/"; 428 } 429 return { 430 re: r, 431 score: s, 432 keys: o, 433 parse: a, 434 stringify: l 435 }; 436} 437function YU(e, t) { 438 let i = 0; 439 for (; i < e.length && i < t.length; ) { 440 const s = t[i] - e[i]; 441 if (s) 442 return s; 443 i++; 444 } 445 return e.length < t.length ? e.length === 1 && e[0] === 80 ? -1 : 1 : e.length > t.length ? t.length === 1 && t[0] === 80 ? 1 : -1 : 0; 446} 447function NL(e, t) { 448 let i = 0; 449 const s = e.score, n = t.score; 450 for (; i < s.length && i < n.length; ) { 451 const o = YU(s[i], n[i]); 452 if (o) 453 return o; 454 i++; 455 } 456 if (Math.abs(n.length - s.length) === 1) { 457 if (qE(s)) 458 return 1; 459 if (qE(n)) 460 return -1; 461 } 462 return n.length - s.length; 463} 464function qE(e) { 465 const t = e[e.length - 1]; 466 return e.length > 0 && t[t.length - 1] < 0; 467} 468const KU = { 469 type: 0, 470 value: "" 471}, ZU = /[a-zA-Z0-9_]/; 472function qU(e) { 473 if (!e) 474 return [[]]; 475 if (e === "/") 476 return [[KU]]; 477 if (!e.startsWith("/")) 478 throw new Error(`Invalid path "${e}"`); 479 function t(f) { 480 throw new Error(`ERR (${i})/"${c}": ${f}`); 481 } 482 let i = 0, s = i; 483 const n = []; 484 let o; 485 function r() { 486 o && n.push(o), o = []; 487 } 488 let a = 0, l, c = "", u = ""; 489 function d() { 490 c && (i === 0 ? o.push({ 491 type: 0, 492 value: c 493 }) : i === 1 || i === 2 || i === 3 ? (o.length > 1 && (l === "*" || l === "+") && t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`), o.push({ 494 type: 1, 495 value: c, 496 regexp: u, 497 repeatable: l === "*" || l === "+", 498 optional: l === "*" || l === "?" 499 })) : t("Invalid state to consume buffer"), c = ""); 500 } 501 function p() { 502 c += l; 503 } 504 for (; a < e.length; ) { 505 if (l = e[a++], l === "\\" && i !== 2) { 506 s = i, i = 4; 507 continue; 508 } 509 switch (i) { 510 case 0: 511 l === "/" ? (c && d(), r()) : l === ":" ? (d(), i = 1) : p(); 512 break; 513 case 4: 514 p(), i = s; 515 break; 516 case 1: 517 l === "(" ? i = 2 : ZU.test(l) ? p() : (d(), i = 0, l !== "*" && l !== "?" && l !== "+" && a--); 518 break; 519 case 2: 520 l === ")" ? u[u.length - 1] == "\\" ? u = u.slice(0, -1) + l : i = 3 : u += l; 521 break; 522 case 3: 523 d(), i = 0, l !== "*" && l !== "?" && l !== "+" && a--, u = ""; 524 break; 525 default: 526 t("Unknown state"); 527 break; 528 } 529 } 530 return i === 2 && t(`Unfinished custom RegExp for param "${c}"`), d(), r(), n; 531} 532function QU(e, t, i) { 533 const s = $U(qU(e.path), i), n = Ut(s, { 534 record: e, 535 parent: t, 536 // these needs to be populated by the parent 537 children: [], 538 alias: [] 539 }); 540 return t && !n.record.aliasOf == !t.record.aliasOf && t.children.push(n), n; 541} 542function XU(e, t) { 543 const i = [], s = /* @__PURE__ */ new Map(); 544 t = eI({ strict: !1, end: !0, sensitive: !1 }, t); 545 function n(d) { 546 return s.get(d); 547 } 548 function o(d, p, f) { 549 const m = !f, y = XE(d); 550 y.aliasOf = f && f.record; 551 const b = eI(t, d), C = [y]; 552 if ("alias" in d) { 553 const A = typeof d.alias == "string" ? [d.alias] : d.alias; 554 for (const I of A) 555 C.push( 556 // we need to normalize again to ensure the `mods` property 557 // being non enumerable 558 XE(Ut({}, y, { 559 // this allows us to hold a copy of the `components` option 560 // so that async components cache is hold on the original record 561 components: f ? f.record.components : y.components, 562 path: I, 563 // we might be the child of an alias 564 aliasOf: f ? f.record : y 565 // the aliases are always of the same kind as the original since they 566 // are defined on the same record 567 })) 568 ); 569 } 570 let w, M; 571 for (const A of C) { 572 const { path: I } = A; 573 if (p && I[0] !== "/") { 574 const L = p.record.path, k = L[L.length - 1] === "/" ? "" : "/"; 575 A.path = p.record.path + (I && k + I); 576 } 577 if (w = QU(A, p, b), f ? f.alias.push(w) : (M = M || w, M !== w && M.alias.push(w), m && d.name && !JE(w) && r(d.name)), _L(w) && l(w), y.children) { 578 const L = y.children; 579 for (let k = 0; k < L.length; k++) 580 o(L[k], w, f && f.children[k]); 581 } 582 f = f || w; 583 } 584 return M ? () => { 585 r(M); 586 } : Zh; 587 } 588 function r(d) { 589 if (FL(d)) { 590 const p = s.get(d); 591 p && (s.delete(d), i.splice(i.indexOf(p), 1), p.children.forEach(r), p.alias.forEach(r)); 592 } else { 593 const p = i.indexOf(d); 594 p > -1 && (i.splice(p, 1), d.record.name && s.delete(d.record.name), d.children.forEach(r), d.alias.forEach(r)); 595 } 596 } 597 function a() { 598 return i; 599 } 600 function l(d) { 601 const p = tW(d, i); 602 i.splice(p, 0, d), d.record.name && !JE(d) && s.set(d.record.name, d); 603 } 604 function c(d, p) { 605 let f, m = {}, y, b; 606 if ("name" in d && d.name) { 607 if (f = s.get(d.name), !f) 608 throw yd(1, { 609 location: d 610 }); 611 b = f.record.name, m = Ut( 612 // paramsFromLocation is a new object 613 QE( 614 p.params, 615 // only keep params that exist in the resolved location 616 // only keep optional params coming from a parent record 617 f.keys.filter((M) => !M.optional).concat(f.parent ? f.parent.keys.filter((M) => M.optional) : []).map((M) => M.name) 618 ), 619 // discard any existing params in the current location that do not exist here 620 // #1497 this ensures better active/exact matching 621 d.params && QE(d.params, f.keys.map((M) => M.name)) 622 ), y = f.stringify(m); 623 } else if (d.path != null) 624 y = d.path, f = i.find((M) => M.re.test(y)), f && (m = f.parse(y), b = f.record.name); 625 else { 626 if (f = p.name ? s.get(p.name) : i.find((M) => M.re.test(p.path)), !f) 627 throw yd(1, { 628 location: d, 629 currentLocation: p 630 }); 631 b = f.record.name, m = Ut({}, p.params, d.params), y = f.stringify(m); 632 } 633 const C = []; 634 let w = f; 635 for (; w; ) 636 C.unshift(w.record), w = w.parent; 637 return { 638 name: b, 639 path: y, 640 params: m, 641 matched: C, 642 meta: eW(C) 643 }; 644 } 645 e.forEach((d) => o(d)); 646 function u() { 647 i.length = 0, s.clear(); 648 } 649 return { 650 addRoute: o, 651 resolve: c, 652 removeRoute: r, 653 clearRoutes: u, 654 getRoutes: a, 655 getRecordMatcher: n 656 }; 657} 658function QE(e, t) { 659 const i = {}; 660 for (const s of t) 661 s in e && (i[s] = e[s]); 662 return i; 663} 664function XE(e) { 665 const t = { 666 path: e.path, 667 redirect: e.redirect, 668 name: e.name, 669 meta: e.meta || {}, 670 aliasOf: e.aliasOf, 671 beforeEnter: e.beforeEnter, 672 props: JU(e), 673 children: e.children || [], 674 instances: {}, 675 leaveGuards: /* @__PURE__ */ new Set(), 676 updateGuards: /* @__PURE__ */ new Set(), 677 enterCallbacks: {}, 678 // must be declared afterwards 679 // mods: {}, 680 components: "components" in e ? e.components || null : e.component && { default: e.component } 681 }; 682 return Object.defineProperty(t, "mods", { 683 value: {} 684 }), t; 685} 686function JU(e) { 687 const t = {}, i = e.props || !1; 688 if ("component" in e) 689 t.default = i; 690 else 691 for (const s in e.components) 692 t[s] = typeof i == "object" ? i[s] : i; 693 return t; 694} 695function JE(e) { 696 for (; e; ) { 697 if (e.record.aliasOf) 698 return !0; 699 e = e.parent; 700 } 701 return !1; 702} 703function eW(e) { 704 return e.reduce((t, i) => Ut(t, i.meta), {}); 705} 706function eI(e, t) { 707 const i = {}; 708 for (const s in e) 709 i[s] = s in t ? t[s] : e[s]; 710 return i; 711} 712function tW(e, t) { 713 let i = 0, s = t.length; 714 for (; i !== s; ) { 715 const o = i + s >> 1; 716 NL(e, t[o]) < 0 ? s = o : i = o + 1; 717 } 718 const n = iW(e); 719 return n && (s = t.lastIndexOf(n, s - 1)), s; 720} 721function iW(e) { 722 let t = e; 723 for (; t = t.parent; ) 724 if (_L(t) && NL(e, t) === 0) 725 return t; 726} 727function _L({ record: e }) { 728 return !!(e.name || e.components && Object.keys(e.components).length || e.redirect); 729} 730function sW(e) { 731 const t = {}; 732 if (e === "" || e === "?") 733 return t; 734 const s = (e[0] === "?" ? e.slice(1) : e).split("&"); 735 for (let n = 0; n < s.length; ++n) { 736 const o = s[n].replace(IL, " "), r = o.indexOf("="), a = Cp(r < 0 ? o : o.slice(0, r)), l = r < 0 ? null : Cp(o.slice(r + 1)); 737 if (a in t) { 738 let c = t[a]; 739 $o(c) || (c = t[a] = [c]), c.push(l); 740 } else 741 t[a] = l; 742 } 743 return t; 744} 745function tI(e) { 746 let t = ""; 747 for (let i in e) { 748 const s = e[i]; 749 if (i = xU(i), s == null) { 750 s !== void 0 && (t += (t.length ? "&" : "") + i); 751 continue; 752 } 753 ($o(s) ? s.map((o) => o && q0(o)) : [s && q0(s)]).forEach((o) => { 754 o !== void 0 && (t += (t.length ? "&" : "") + i, o != null && (t += "=" + o)); 755 }); 756 } 757 return t; 758} 759function nW(e) { 760 const t = {}; 761 for (const i in e) { 762 const s = e[i]; 763 s !== void 0 && (t[i] = $o(s) ? s.map((n) => n == null ? null : "" + n) : s == null ? s : "" + s); 764 } 765 return t; 766} 767const oW = /* @__PURE__ */ Symbol(""), iI = /* @__PURE__ */ Symbol(""), Rv = /* @__PURE__ */ Symbol(""), ES = /* @__PURE__ */ Symbol(""), X0 = /* @__PURE__ */ Symbol(""); 768function wh() { 769 let e = []; 770 function t(s) { 771 return e.push(s), () => { 772 const n = e.indexOf(s); 773 n > -1 && e.splice(n, 1); 774 }; 775 } 776 function i() { 777 e = []; 778 } 779 return { 780 add: t, 781 list: () => e.slice(), 782 reset: i 783 }; 784} 785function Xa(e, t, i, s, n, o = (r) => r()) { 786 const r = s && // name is defined if record is because of the function overload 787 (s.enterCallbacks[n] = s.enterCallbacks[n] || []); 788 return () => new Promise((a, l) => { 789 const c = (p) => { 790 p === !1 ? l(yd(4, { 791 from: i, 792 to: t 793 })) : p instanceof Error ? l(p) : UU(p) ? l(yd(2, { 794 from: t, 795 to: p 796 })) : (r && // since enterCallbackArray is truthy, both record and name also are 797 s.enterCallbacks[n] === r && typeof p == "function" && r.push(p), a()); 798 }, u = o(() => e.call(s && s.instances[n], t, i, c)); 799 let d = Promise.resolve(u); 800 e.length < 3 && (d = d.then(c)), d.catch((p) => l(p)); 801 }); 802} 803function _b(e, t, i, s, n = (o) => o()) { 804 const o = []; 805 for (const r of e) 806 for (const a in r.components) { 807 let l = r.components[a]; 808 if (!(t !== "beforeRouteEnter" && !r.instances[a])) 809 if (DL(l)) { 810 const u = (l.__vccOpts || l)[t]; 811 u && o.push(Xa(u, i, s, r, a, n)); 812 } else { 813 let c = l(); 814 o.push(() => c.then((u) => { 815 if (!u) 816 throw new Error(`Couldn't resolve component "${a}" at "${r.path}"`); 817 const d = hU(u) ? u.default : u; 818 r.mods[a] = u, r.components[a] = d; 819 const f = (d.__vccOpts || d)[t]; 820 return f && Xa(f, i, s, r, a, n)(); 821 })); 822 } 823 } 824 return o; 825} 826function sI(e) { 827 const t = ua(Rv), i = ua(ES), s = Qe(() => { 828 const l = Z(e.to); 829 return t.resolve(l); 830 }), n = Qe(() => { 831 const { matched: l } = s.value, { length: c } = l, u = l[c - 1], d = i.matched; 832 if (!u || !d.length) 833 return -1; 834 const p = d.findIndex(vd.bind(null, u)); 835 if (p > -1) 836 return p; 837 const f = nI(l[c - 2]); 838 return ( 839 // we are dealing with nested routes 840 c > 1 && // if the parent and matched route have the same path, this link is 841 // referring to the empty child. Or we currently are on a different 842 // child of the same parent 843 nI(u) === f && // avoid comparing the child with its parent 844 d[d.length - 1].path !== f ? d.findIndex(vd.bind(null, l[c - 2])) : p 845 ); 846 }), o = Qe(() => n.value > -1 && uW(i.params, s.value.params)), r = Qe(() => n.value > -1 && n.value === i.matched.length - 1 && kL(i.params, s.value.params)); 847 function a(l = {}) { 848 if (cW(l)) { 849 const c = t[Z(e.replace) ? "replace" : "push"]( 850 Z(e.to) 851 // avoid uncaught errors are they are logged anyway 852 ).catch(Zh); 853 return e.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => c), c; 854 } 855 return Promise.resolve(); 856 } 857 return { 858 route: s, 859 href: Qe(() => s.value.href), 860 isActive: o, 861 isExactActive: r, 862 navigate: a 863 }; 864} 865function rW(e) { 866 return e.length === 1 ? e[0] : e; 867} 868const aW = /* @__PURE__ */ Mt({ 869 name: "RouterLink", 870 compatConfig: { MODE: 3 }, 871 props: { 872 to: { 873 type: [String, Object], 874 required: !0 875 }, 876 replace: Boolean, 877 activeClass: String, 878 // inactiveClass: String, 879 exactActiveClass: String, 880 custom: Boolean, 881 ariaCurrentValue: { 882 type: String, 883 default: "page" 884 }, 885 viewTransition: Boolean 886 }, 887 useLink: sI, 888 setup(e, { slots: t }) { 889 const i = bL(sI(e)), { options: s } = ua(Rv), n = Qe(() => ({ 890 [oI(e.activeClass, s.linkActiveClass, "router-link-active")]: i.isActive, 891 // [getLinkClass( 892 // props.inactiveClass, 893 // options.linkInactiveClass, 894 // 'router-link-inactive' 895 // )]: !link.isExactActive, 896 [oI(e.exactActiveClass, s.linkExactActiveClass, "router-link-exact-active")]: i.isExactActive 897 })); 898 return () => { 899 const o = t.default && rW(t.default(i)); 900 return e.custom ? o : AS("a", { 901 "aria-current": i.isExactActive ? e.ariaCurrentValue : null, 902 href: i.href, 903 // this would override user added attrs but Vue will still add 904 // the listener, so we end up triggering both 905 onClick: i.navigate, 906 class: n.value 907 }, o); 908 }; 909 } 910}), lW = aW; 911function cW(e) { 912 if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button !== void 0 && e.button !== 0)) { 913 if (e.currentTarget && e.currentTarget.getAttribute) { 914 const t = e.currentTarget.getAttribute("target"); 915 if (/\b_blank\b/i.test(t)) 916 return; 917 } 918 return e.preventDefault && e.preventDefault(), !0; 919 } 920} 921function uW(e, t) { 922 for (const i in t) { 923 const s = t[i], n = e[i]; 924 if (typeof s == "string") { 925 if (s !== n) 926 return !1; 927 } else if (!$o(n) || n.length !== s.length || s.some((o, r) => o !== n[r])) 928 return !1; 929 } 930 return !0; 931} 932function nI(e) { 933 return e ? e.aliasOf ? e.aliasOf.path : e.path : ""; 934} 935const oI = (e, t, i) => e ?? t ?? i, dW = /* @__PURE__ */ Mt({ 936 name: "RouterView", 937 // #674 we manually inherit them 938 inheritAttrs: !1, 939 props: { 940 name: { 941 type: String, 942 default: "default" 943 }, 944 route: Object 945 }, 946 // Better compat for @vue/compat users 947 // https://github.com/vuejs/router/issues/1315 948 compatConfig: { MODE: 3 }, 949 setup(e, { attrs: t, slots: i }) { 950 const s = ua(X0), n = Qe(() => e.route || s.value), o = ua(iI, 0), r = Qe(() => { 951 let c = Z(o); 952 const { matched: u } = n.value; 953 let d; 954 for (; (d = u[c]) && !d.components; ) 955 c++; 956 return c; 957 }), a = Qe(() => n.value.matched[r.value]); 958 Xu(iI, Qe(() => r.value + 1)), Xu(oW, a), Xu(X0, n); 959 const l = De(); 960 return Gn(() => [l.value, a.value, e.name], ([c, u, d], [p, f, m]) => { 961 u && (u.instances[d] = c, f && f !== u && c && c === p && (u.leaveGuards.size || (u.leaveGuards = f.leaveGuards), u.updateGuards.size || (u.updateGuards = f.updateGuards))), c && u && // if there is no instance but to and from are the same this might be 962 // the first visit 963 (!f || !vd(u, f) || !p) && (u.enterCallbacks[d] || []).forEach((y) => y(c)); 964 }, { flush: "post" }), () => { 965 const c = n.value, u = e.name, d = a.value, p = d && d.components[u]; 966 if (!p) 967 return rI(i.default, { Component: p, route: c }); 968 const f = d.props[u], m = f ? f === !0 ? c.params : typeof f == "function" ? f(c) : f : null, b = AS(p, Ut({}, m, t, { 969 onVnodeUnmounted: (C) => { 970 C.component.isUnmounted && (d.instances[u] = null); 971 }, 972 ref: l 973 })); 974 return ( 975 // pass the vnode to the slot as a prop. 976 // h and <component :is="..."> both accept vnodes 977 rI(i.default, { Component: b, route: c }) || b 978 ); 979 }; 980 } 981}); 982function rI(e, t) { 983 if (!e) 984 return null; 985 const i = e(t); 986 return i.length === 1 ? i[0] : i; 987} 988const hW = dW; 989function pW(e) { 990 const t = XU(e.routes, e), i = e.parseQuery || sW, s = e.stringifyQuery || tI, n = e.history, o = wh(), r = wh(), a = wh(), l = $6(Ua); 991 let c = Ua; 992 ku && e.scrollBehavior && "scrollRestoration" in history && (history.scrollRestoration = "manual"); 993 const u = Ob.bind(null, (U) => "" + U), d = Ob.bind(null, AU), p = ( 994 // @ts-expect-error: intentionally avoid the type check 995 Ob.bind(null, Cp) 996 ); 997 function f(U, j) { 998 let J, ne; 999 return FL(U) ? (J = t.getRecordMatcher(U), ne = j) : ne = U, t.addRoute(ne, J); 1000 } 1001 function m(U) { 1002 const j = t.getRecordMatcher(U); 1003 j && t.removeRoute(j); 1004 } 1005 function y() { 1006 return t.getRoutes().map((U) => U.record); 1007 } 1008 function b(U) { 1009 return !!t.getRecordMatcher(U); 1010 } 1011 function C(U, j) { 1012 if (j = Ut({}, j || l.value), typeof U == "string") { 1013 const H = Nb(i, U, j.path), Q = t.resolve({ path: H.path }, j), re = n.createHref(H.fullPath); 1014 return Ut(H, Q, { 1015 params: p(Q.params), 1016 hash: Cp(H.hash), 1017 redirectedFrom: void 0, 1018 href: re 1019 }); 1020 } 1021 let J; 1022 if (U.path != null) 1023 J = Ut({}, U, { 1024 path: Nb(i, U.path, j.path).path 1025 }); 1026 else { 1027 const H = Ut({}, U.params); 1028 for (const Q in H) 1029 H[Q] == null && delete H[Q]; 1030 J = Ut({}, U, { 1031 params: d(H) 1032 }), j.params = d(j.params); 1033 } 1034 const ne = t.resolve(J, j), me = U.hash || ""; 1035 ne.params = u(p(ne.params)); 1036 const V = IU(s, Ut({}, U, { 1037 hash: SU(me), 1038 path: ne.path 1039 })), X = n.createHref(V); 1040 return Ut({ 1041 fullPath: V, 1042 // keep the hash encoded so fullPath is effectively path + encodedQuery + 1043 // hash 1044 hash: me, 1045 query: ( 1046 // if the user is using a custom query lib like qs, we might have 1047 // nested objects, so we keep the query as is, meaning it can contain 1048 // numbers at `$route.query`, but at the point, the user will have to 1049 // use their own type anyway. 1050 // https://github.com/vuejs/router/issues/328#issuecomment-649481567 1051 s === tI ? nW(U.query) : U.query || {} 1052 ) 1053 }, ne, { 1054 redirectedFrom: void 0, 1055 href: X 1056 }); 1057 } 1058 function w(U) { 1059 return typeof U == "string" ? Nb(i, U, l.value.path) : Ut({}, U); 1060 } 1061 function M(U, j) { 1062 if (c !== U) 1063 return yd(8, { 1064 from: j, 1065 to: U 1066 }); 1067 } 1068 function A(U) { 1069 return k(U); 1070 } 1071 function I(U) { 1072 return A(Ut(w(U), { replace: !0 })); 1073 } 1074 function L(U) { 1075 const j = U.matched[U.matched.length - 1]; 1076 if (j && j.redirect) { 1077 const { redirect: J } = j; 1078 let ne = typeof J == "function" ? J(U) : J; 1079 return typeof ne == "string" && (ne = ne.includes("?") || ne.includes("#") ? ne = w(ne) : ( 1080 // force empty params 1081 { path: ne } 1082 ), ne.params = {}), Ut({ 1083 query: U.query, 1084 hash: U.hash, 1085 // avoid transferring params if the redirect has a path 1086 params: ne.path != null ? {} : U.params 1087 }, ne); 1088 } 1089 } 1090 function k(U, j) { 1091 const J = c = C(U), ne = l.value, me = U.state, V = U.force, X = U.replace === !0, H = L(J); 1092 if (H) 1093 return k( 1094 Ut(w(H), { 1095 state: typeof H == "object" ? Ut({}, me, H.state) : me, 1096 force: V, 1097 replace: X 1098 }), 1099 // keep original redirectedFrom if it exists 1100 j || J 1101 ); 1102 const Q = J; 1103 Q.redirectedFrom = j; 1104 let re; 1105 return !V && RU(s, ne, J) && (re = yd(16, { to: Q, from: ne }), _( 1106 ne, 1107 ne, 1108 // this is a push, the only way for it to be triggered from a 1109 // history.listen is with a redirect, which makes it become a push 1110 !0, 1111 // This cannot be the first navigation because the initial location 1112 // cannot be manually navigated to 1113 !1 1114 )), (re ? Promise.resolve(re) : W(Q, ne)).catch((Se) => Vr(Se) ? ( 1115 // navigation redirects still mark the router as ready 1116 Vr( 1117 Se, 1118 2 1119 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */ 1120 ) ? Se : G(Se) 1121 ) : ( 1122 // reject any unknown error 1123 E(Se, Q, ne) 1124 )).then((Se) => { 1125 if (Se) { 1126 if (Vr( 1127 Se, 1128 2 1129 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */ 1130 )) 1131 return k( 1132 // keep options 1133 Ut({ 1134 // preserve an existing replacement but allow the redirect to override it 1135 replace: X 1136 }, w(Se.to), { 1137 state: typeof Se.to == "object" ? Ut({}, me, Se.to.state) : me, 1138 force: V 1139 }), 1140 // preserve the original redirectedFrom if any 1141 j || Q 1142 ); 1143 } else 1144 Se = ue(Q, ne, !0, X, me); 1145 return se(Q, ne, Se), Se; 1146 }); 1147 } 1148 function B(U, j) { 1149 const J = M(U, j); 1150 return J ? Promise.reject(J) : Promise.resolve(); 1151 } 1152 function N(U) { 1153 const j = ae.values().next().value; 1154 return j && typeof j.runWithContext == "function" ? j.runWithContext(U) : U(); 1155 } 1156 function W(U, j) { 1157 let J; 1158 const [ne, me, V] = gW(U, j); 1159 J = _b(ne.reverse(), "beforeRouteLeave", U, j); 1160 for (const H of ne) 1161 H.leaveGuards.forEach((Q) => { 1162 J.push(Xa(Q, U, j)); 1163 }); 1164 const X = B.bind(null, U, j); 1165 return J.push(X), oe(J).then(() => { 1166 J = []; 1167 for (const H of o.list()) 1168 J.push(Xa(H, U, j)); 1169 return J.push(X), oe(J); 1170 }).then(() => { 1171 J = _b(me, "beforeRouteUpdate", U, j); 1172 for (const H of me) 1173 H.updateGuards.forEach((Q) => { 1174 J.push(Xa(Q, U, j)); 1175 }); 1176 return J.push(X), oe(J); 1177 }).then(() => { 1178 J = []; 1179 for (const H of V) 1180 if (H.beforeEnter) 1181 if ($o(H.beforeEnter)) 1182 for (const Q of H.beforeEnter) 1183 J.push(Xa(Q, U, j)); 1184 else 1185 J.push(Xa(H.beforeEnter, U, j)); 1186 return J.push(X), oe(J); 1187 }).then(() => (U.matched.forEach((H) => H.enterCallbacks = {}), J = _b(V, "beforeRouteEnter", U, j, N), J.push(X), oe(J))).then(() => { 1188 J = []; 1189 for (const H of r.list()) 1190 J.push(Xa(H, U, j)); 1191 return J.push(X), oe(J); 1192 }).catch((H) => Vr( 1193 H, 1194 8 1195 /* ErrorTypes.NAVIGATION_CANCELLED */ 1196 ) ? H : Promise.reject(H)); 1197 } 1198 function se(U, j, J) { 1199 a.list().forEach((ne) => N(() => ne(U, j, J))); 1200 } 1201 function ue(U, j, J, ne, me) { 1202 const V = M(U, j); 1203 if (V) 1204 return V; 1205 const X = j === Ua, H = ku ? history.state : {}; 1206 J && (ne || X ? n.replace(U.fullPath, Ut({ 1207 scroll: X && H && H.scroll 1208 }, me)) : n.push(U.fullPath, me)), l.value = U, _(U, j, J, X), G(); 1209 } 1210 let Ce; 1211 function te() { 1212 Ce || (Ce = n.listen((U, j, J) => { 1213 if (!be.listening) 1214 return; 1215 const ne = C(U), me = L(ne); 1216 if (me) { 1217 k(Ut(me, { replace: !0, force: !0 }), ne).catch(Zh); 1218 return; 1219 } 1220 c = ne; 1221 const V = l.value; 1222 ku && _U($E(V.fullPath, J.delta), Iv()), W(ne, V).catch((X) => Vr( 1223 X, 1224 12 1225 /* ErrorTypes.NAVIGATION_CANCELLED */ 1226 ) ? X : Vr( 1227 X, 1228 2 1229 /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */ 1230 ) ? (k( 1231 Ut(w(X.to), { 1232 force: !0 1233 }), 1234 ne 1235 // avoid an uncaught rejection, let push call triggerError 1236 ).then((H) => { 1237 Vr( 1238 H, 1239 20 1240 /* ErrorTypes.NAVIGATION_DUPLICATED */ 1241 ) && !J.delta && J.type === bp.pop && n.go(-1, !1); 1242 }).catch(Zh), Promise.reject()) : (J.delta && n.go(-J.delta, !1), E(X, ne, V))).then((X) => { 1243 X = X || ue( 1244 // after navigation, all matched components are resolved 1245 ne, 1246 V, 1247 !1 1248 ), X && (J.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history 1249 // entry while a different route is displayed 1250 !Vr( 1251 X, 1252 8 1253 /* ErrorTypes.NAVIGATION_CANCELLED */ 1254 ) ? n.go(-J.delta, !1) : J.type === bp.pop && Vr( 1255 X, 1256 20 1257 /* ErrorTypes.NAVIGATION_DUPLICATED */ 1258 ) && n.go(-1, !1)), se(ne, V, X); 1259 }).catch(Zh); 1260 })); 1261 } 1262 let q = wh(), $ = wh(), T; 1263 function E(U, j, J) { 1264 G(U); 1265 const ne = $.list(); 1266 return ne.length ? ne.forEach((me) => me(U, j, J)) : console.error(U), Promise.reject(U); 1267 } 1268 function P() { 1269 return T && l.value !== Ua ? Promise.resolve() : new Promise((U, j) => { 1270 q.add([U, j]); 1271 }); 1272 } 1273 function G(U) {
1274 return T || (T = !U, te(), q.list().forEach(([j, J]) => U ? J(U) : j()), q.reset()), U; 1275 } 1276 function _(U, j, J, ne) { 1277 const { scrollBehavior: me } = e; 1278 if (!ku || !me) 1279 return Promise.resolve(); 1280 const V = !J && BU($E(U.fullPath, 0)) || (ne || !J) && history.state && history.state.scroll || null; 1281 return wL().then(() => me(U, j, V)).then((X) => X && NU(X)).catch((X) => E(X, U, j)); 1282 } 1283 const K = (U) => n.go(U); 1284 let ce; 1285 const ae = /* @__PURE__ */ new Set(), be = { 1286 currentRoute: l, 1287 listening: !0, 1288 addRoute: f, 1289 removeRoute: m, 1290 clearRoutes: t.clearRoutes, 1291 hasRoute: b, 1292 getRoutes: y, 1293 resolve: C, 1294 options: e, 1295 push: A, 1296 replace: I, 1297 go: K, 1298 back: () => K(-1), 1299 forward: () => K(1), 1300 beforeEach: o.add, 1301 beforeResolve: r.add, 1302 afterEach: a.add, 1303 onError: $.add, 1304 isReady: P, 1305 install(U) { 1306 const j = this; 1307 U.component("RouterLink", lW), U.component("RouterView", hW), U.config.globalProperties.$router = j, Object.defineProperty(U.config.globalProperties, "$route", { 1308 enumerable: !0, 1309 get: () => Z(l) 1310 }), ku && // used for the initial navigation client side to avoid pushing 1311 // multiple times when the router is used in multiple apps 1312 !ce && l.value === Ua && (ce = !0, A(n.location).catch((me) => { 1313 })); 1314 const J = {}; 1315 for (const me in Ua) 1316 Object.defineProperty(J, me, { 1317 get: () => l.value[me], 1318 enumerable: !0 1319 }); 1320 U.provide(Rv, j), U.provide(ES, Y6(J)), U.provide(X0, l); 1321 const ne = U.unmount; 1322 ae.add(U), U.unmount = function() { 1323 ae.delete(U), ae.size < 1 && (c = Ua, Ce && Ce(), Ce = null, l.value = Ua, ce = !1, T = !1), ne(); 1324 }; 1325 } 1326 }; 1327 function oe(U) { 1328 return U.reduce((j, J) => j.then(() => N(J)), Promise.resolve()); 1329 } 1330 return be; 1331} 1332function gW(e, t) { 1333 const i = [], s = [], n = [], o = Math.max(t.matched.length, e.matched.length); 1334 for (let r = 0; r < o; r++) { 1335 const a = t.matched[r]; 1336 a && (e.matched.find((c) => vd(c, a)) ? s.push(a) : i.push(a)); 1337 const l = e.matched[r]; 1338 l && (t.matched.find((c) => vd(c, l)) || n.push(l)); 1339 } 1340 return [i, s, n]; 1341} 1342function fW() { 1343 return ua(Rv); 1344} 1345function IS(e) { 1346 return ua(ES); 1347} 1348const mW = "1", vW = "2", yW = 1e5, aI = 470, CW = 30, Bb = { 1349 domainId: mW, 1350 displayOrder: yW 1351}, lI = { 1352 domainId: vW 1353}, Cd = "/v1/links", es = "links_page_flow", bW = { class: "link-tabs" }, wW = ["aid", "onClick"], SW = /* @__PURE__ */ Mt({ 1354 __name: "link-tabs", 1355 props: { 1356 tabItems: { default: () => [] }, 1357 selectedTabKey: { default: "" }, 1358 page: {} 1359 }, 1360 emits: ["change-tab"], 1361 setup(e) { 1362 return (t, i) => (we(), Ne("div", bW, [ 1363 (we(!0), Ne(yi, null, hs(e.tabItems, (s) => (we(), Ne("p", { 1364 key: s.key, 1365 aid: `${e.page}-tab-${s.key}`, 1366 class: da(["link-tab-item", { selected: s.key == e.selectedTabKey }]), 1367 onClick: (n) => t.$emit("change-tab", s.key) 1368 }, [ 1369 ut(ke(s.title) + " ", 1), 1370 s.loading ? (we(), Wt(Z(aU), { 1371 key: 0, 1372 class: "loader", 1373 size: "12px", 1374 color: "currentColor" 1375 })) : di("", !0) 1376 ], 10, wW))), 128)) 1377 ])); 1378 } 1379}), ii = (e, t) => { 1380 const i = e.__vccOpts || e; 1381 for (const [s, n] of t) 1382 i[s] = n; 1383 return i; 1384}, xW = /* @__PURE__ */ ii(SW, [["__scopeId", "data-v-50440ef7"]]); 1385var J0; 1386(function(e) { 1387 e[e.LINK_RISK_STATUS_UNDEFINED = 0] = "LINK_RISK_STATUS_UNDEFINED", e[e.LINK_RISK_STATUS_SAFE = 1] = "LINK_RISK_STATUS_SAFE", e[e.LINK_RISK_STATUS_BLOCKED = 2] = "LINK_RISK_STATUS_BLOCKED"; 1388})(J0 || (J0 = {})); 1389const MW = [ 1390 "create", 1391 "list", 1392 "update", 1393 "delete", 1394 "isSlugExists", 1395 "isURLDomainExists", 1396 "getReport", 1397 "isLimitReached", 1398 "isLinkCreationTrustPolicyAllowed", 1399 "getLinkById", 1400 "getAccountEmployees", 1401 "reassignOwnership", 1402 "fetchPageTitle", 1403 "trackQRGeneration", 1404 "isQRGenerationLimitReached", 1405 "getLinkEngagementMetrics", 1406 "getTotalEngagementChartData", 1407 "getLinkLocationDistribution", 1408 "getLinkDeviceDistribution", 1409 "getLinkReferrerDistribution", 1410 "getLinkClicksSummary", 1411 "uploadQRCodeLogo", 1412 "proxyImage", 1413 "fetchCompanyLogo" 1414], AW = [ 1415 "createDomain", 1416 "deleteDomain", 1417 "verifyDomain", 1418 "certifyDomain", 1419 "getDomainList" 1420]; 1421var cI; 1422(function(e) { 1423 e[e.VERIFYING = 0] = "VERIFYING", e[e.ACTIVE = 1] = "ACTIVE", e[e.INACTIVE = 2] = "INACTIVE"; 1424})(cI || (cI = {})); 1425const DW = [ 1426 "getAvailableDomainList", 1427 "createCustomDomain", 1428 "deleteCustomDomain", 1429 "listAllLinksCustomDomains", 1430 "verifyCustomDomain", 1431 "certifyCustomDomain",
1432 "isCustomDomainLimitReached", 1433 "downloadCustomDomainGuide" 1434]; 1435class EW extends Error { 1436 url; 1437 constructor(t, i) { 1438 super(t), this.url = i, this.name = "RateLimitError"; 1439 } 1440} 1441async function IW(e, t, i, s) { 1442 if (t.status === 429) { 1443 let o = "Too many requests, please try again later."; 1444 if (s.includeResponseBodyInMessage) 1445 try { 1446 const r = await i(), a = JSON.parse(r); 1447 a.message && (o = a.message); 1448 } catch { 1449 } 1450 throw new EW(o, e); 1451 } 1452 const n = s.includeResponseBodyInMessage ? " - " + await i() : ""; 1453 throw new Error(`${e} failed: ${t.status} - ${t.statusText}${n}`); 1454} 1455function Il(e) { 1456 return new RW(e); 1457} 1458class RW { 1459 options; 1460 baseUrl; 1461 _auth; 1462 requireAuth; 1463 constructor(t) { 1464 this.options = t; 1465 const { methods: i, requireAuth: s } = t; 1466 i.forEach((n) => { 1467 this[n] = (o) => this.sdkMethod(n, o); 1468 }), Array.isArray(s) ? this.requireAuth = new Set(s) : s && (this.requireAuth = new Set(i)); 1469 } 1470 /** 1471 * 1472 * @param localPort Intended ONLY for service test 1473 */ 1474 async init(t, i) { 1475 this.baseUrl = await this.getBaseUrl(i), this._auth = t, console.log(`${this.options.sdkPackageName} Initialized`); 1476 } 1477 async getBaseUrl(t) { 1478 const { baseRoute: i } = this.options; 1479 return t ? `http://localhost:${t}/${i}` : window.location.host.includes("local") ? `http://${window.location.hostname}:37000/${i}` : `https://webapp.wisestamp.com/${i}`; 1480 } 1481 checkInit() { 1482 if (!this.baseUrl) 1483 throw new Error(`${this.options.sdkPackageName} Not initialized`); 1484 } 1485 /** 1486 * Perform a POST request 1487 * 1488 * CONSIDER: Auto logs and metric (configurable with a flag) 1489 * @param method The route to call 1490 * @param request The request POJO to stringify 1491 * @returns The response as a POJO (or throws an error) 1492 */ 1493 async sdkMethod(t, i) { 1494 this.checkInit(); 1495 const s = `${this.baseUrl}/${t}`; 1496 console.log({ 1497 message: `${this.options.sdkPackageName}: Calling ${t}`, 1498 request: i 1499 }); 1500 const n = JSON.stringify(i), o = { 1501 "content-type": "application/json" 1502 }, r = this.requireAuth?.has(t); 1503 if (r) { 1504 if (!this._auth) 1505 throw new Error(`${this.options.sdkPackageName} is missing iAuth`); 1506 const l = await this.getAccessToken(); 1507 o["ws-auth"] = l; 1508 } 1509 let a = await this.doFetch(s, n, o); 1510 return a.status === 401 && r && (o["ws-auth"] = await this._auth?.refresh() || "", a = await this.doFetch(s, n, o)), a.ok || await IW(s, a, () => a.text(), { 1511 includeResponseBodyInMessage: !!this.baseUrl?.includes("localhost") 1512 }), await a.json(); 1513 } 1514 async doFetch(t, i, s) { 1515 return await fetch(t, { 1516 method: "POST", 1517 body: i, 1518 headers: s, 1519 mode: "cors", 1520 redirect: "follow", 1521 // need this only on local 1522 credentials: "include" 1523 }); 1524 } 1525 async getAccessToken() { 1526 if (!this._auth) 1527 return; 1528 const t = this._auth.getCurrentAccessToken(); 1529 return t || await this._auth.refresh(); 1530 } 1531} 1532const wt = Il({ 1533 baseRoute: lU, 1534 methods: MW, 1535 sdkPackageName: "@msl/links-gateway-sdk", 1536 requireAuth: !0 1537}); 1538Il({ 1539 baseRoute: cU, 1540 methods: AW, 1541 sdkPackageName: "@msl/links-gateway-sdk", 1542 requireAuth: !0 1543}); 1544const uI = Il({ 1545 baseRoute: uU, 1546 methods: DW, 1547 sdkPackageName: "@msl/links-gateway-sdk", 1548 requireAuth: !0 1549}), TW = 200; 1550class LW { 1551 /** 1552 * Invalid characters that are not allowed in slugs 1553 */ 1554 INVALID_SLUG_CHARS = [ 1555 "~", 1556 "<", 1557 ">", 1558 ";", 1559 "'", 1560 ":", 1561 '"', 1562 "/", 1563 "\\", 1564 "[", 1565 "]", 1566 "^", 1567 "{", 1568 "}", 1569 "(", 1570 ")", 1571 "=", 1572 "+", 1573 "!", 1574 "*", 1575 "@", 1576 "&", 1577 "$", 1578 "?", 1579 "%", 1580 "#", 1581 "|" 1582 ]; 1583 /** 1584 * Regular expression for valid slug format 1585 * Allows alphanumeric characters, hyphens, and underscores, 1-20 characters 1586 */ 1587 SLUG_REGEX = /^[a-zA-Z0-9_-]{1,20}$/; 1588 /** 1589 * Validates if a slug contains invalid characters 1590 * @param slug - The slug to validate 1591 * @returns true if the slug contains invalid characters, false otherwise 1592 */ 1593 hasInvalidSlugChars(t) { 1594 return this.INVALID_SLUG_CHARS.some((i) => t.includes(i)); 1595 } 1596 /** 1597 * Validates if a slug matches the required format 1598 * @param slug - The slug to validate 1599 * @returns true if the slug is valid, false otherwise 1600 */ 1601 isValidSlugFormat(t) { 1602 return this.SLUG_REGEX.test(t); 1603 } 1604 /** 1605 * Comprehensive slug validation that checks both format and invalid characters 1606 * @param slug - The slug to validate 1607 * @returns true if the slug is valid, false otherwise 1608 */ 1609 isValidSlug(t) { 1610 return t ? this.isValidSlugFormat(t) && !this.hasInvalidSlugChars(t) : !1; 1611 } 1612 /** 1613 * Validates a slug and returns detailed validation result 1614 * @param slug - The slug to validate 1615 * @returns ValidationResult with detailed error information 1616 */ 1617 validateSlug(t) { 1618 const i = []; 1619 return t ? (this.isValidSlugFormat(t) || i.push({ 1620 field: "slug", 1621 message: "Slug must be 1-20 characters long and contain only letters, numbers, hyphens, and underscores" 1622 }), this.hasInvalidSlugChars(t) && i.push({ 1623 field: "slug",
1624 message: this.getSlugValidationErrorMessage() 1625 }), { 1626 isValid: i.length === 0, 1627 errors: i 1628 }) : (i.push({ 1629 field: "slug", 1630 message: "Slug is required" 1631 }), { isValid: !1, errors: i }); 1632 } 1633 /** 1634 * Gets a user-friendly error message for invalid slugs 1635 * @returns Error message describing invalid slug characters 1636 */ 1637 getSlugValidationErrorMessage() { 1638 return "The characters `~,<>;':\"/\\[]^{}()=+!*@&$?%#| are not allowed"; 1639 } 1640 /** 1641 * Validates if a link title is within the allowed length (1â200 characters after trim) 1642 * @param title - The title to validate 1643 * @returns true if the title is valid, false otherwise 1644 */ 1645 isValidLinkTitle(t) { 1646 const i = t.trim().length; 1647 return i >= 1 && i <= TW; 1648 } 1649 /** 1650 * Gets a user-friendly error message for invalid link titles 1651 * @returns Error message describing the title length limit 1652 */ 1653 getLinkTitleValidationErrorMessage() { 1654 return "Name must be at most 200 characters"; 1655 } 1656} 1657const xf = new LW(), Dt = { 1658 clicks: "clicks", 1659 clicksMetric: "Clicks", 1660 scansMetric: "Scans", 1661 topReferrerMetric: "Top Referrer", 1662 totalEngagementTitle: "Total Engagement", 1663 viewBySelectLabelDays: "Days", 1664 viewBySelectLabelWeeks: "Weeks", 1665 viewBySelectLabelMonths: "Months", 1666 fetchErrorMessage: "Failed to fetch data. Please try again.", 1667 engagementOverTimeTitle: "Engagement Over Time", 1668 noDataMessage: "No engagement data available for the selected time period.", 1669 timeFrameLabel: "Time frame", 1670 timeFrameOneWeek: "Last 7 days", 1671 timeFrameTwoWeeks: "Last 14 days", 1672 timeFrameOneMonth: "Last 30 days", 1673 timeFrameThreeMonths: "Last 90 days", 1674 timeFrameSelectLabelTwoWeeks: "Last 14 days", 1675 timeFrameSelectLabelMonth: "Last 30 days", 1676 timeFrameSelectLabelHalfYear: "Last 6 months", 1677 timeFrameSelectLabelYear: "Last 12 months", 1678 timeFrameSelectLabelTwoYears: "Last 24 months", 1679 timeFrameSelectLabel: "Time frame", 1680 totalClicks: "Total Clicks", 1681 totalScans: "Total Scans", 1682 topCountry: "Top Country", 1683 topReferrer: "Top Referrer", 1684 viewBySelectLabel: "View by", 1685 emptyStateImage: "Empty state image", 1686 emptyStateMessage: "No data to show for this time frame", 1687 exposureTitle: "Total clicks", 1688 from: "From", 1689 to: "To", 1690 invalidDateRangeMessage: "Please select both start and end dates", 1691 invalidDateFormatMessage: "Please select valid dates", 1692 futureDateMessage: "Start date cannot be in the future", 1693 futureEndDateMessage: "End date cannot be in the future", 1694 dateRangeTooLargeMessage: "Date range cannot exceed 2 years", 1695 dateRangeErrorMessage: "Failed to process date range selection", 1696 locationDistributionTitle: "Location Distribution", 1697 deviceDistributionTitle: "Device Distribution", 1698 referrerDistributionTitle: "Referrer Distribution" 1699}, kW = { class: "engagement-metrics-card" }, PW = { class: "metric-value" }, FW = { class: "metric-description" }, OW = /* @__PURE__ */ Mt({ 1700 __name: "engagement-metrics-card", 1701 props: { 1702 metric: {}, 1703 description: {} 1704 }, 1705 setup(e) { 1706 const t = e; 1707 return (i, s) => (we(), Ne("div", kW, [ 1708 fe("div", PW, ke(t.metric), 1), 1709 fe("div", FW, ke(t.description), 1) 1710 ])); 1711 } 1712}), NW = /* @__PURE__ */ ii(OW, [["__scopeId", "data-v-7a47aaef"]]), _W = { class: "link-engagement-metrics-container" }, BW = { 1713 key: 0, 1714 class: "loader" 1715}, GW = { 1716 key: 1, 1717 class: "link-engagement-metrics-cards" 1718}, zW = /* @__PURE__ */ Mt({ 1719 __name: "engagement-metrics-container", 1720 props: { 1721 isLoading: { type: Boolean }, 1722 metricsCards: {} 1723 }, 1724 setup(e) { 1725 const t = e; 1726 return (i, s) => (we(), Ne("div", _W, [ 1727 t.isLoading ? (we(), Ne("div", BW, [...s[0] || (s[0] = [ 1728 fe("div", null, [ 1729 fe("span", { 1730 id: "frame-loader", 1731 "aria-hidden": "true" 1732 }) 1733 ], -1) 1734 ])])) : (we(), Ne("div", GW, [ 1735 (we(!0), Ne(yi, null, hs(e.metricsCards, (n) => (we(), Wt(NW, { 1736 key: n.description, 1737 metric: n.metric, 1738 description: n.description 1739 }, null, 8, ["metric", "description"]))), 128)) 1740 ])) 1741 ])); 1742 } 1743}), HW = /* @__PURE__ */ ii(zW, [["__scopeId", "data-v-e24a3119"]]); 1744var qr = /* @__PURE__ */ ((e) => (e.Days = "days", e.Weeks = "weeks", e.Months = "months", e))(qr || {}), _o = /* @__PURE__ */ ((e) => (e.AREA = "area", e.BAR = "bar", e.DONUT = "donut", e))(_o || {}); 1745const VW = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABEgAAAK4CAMAAABQ5zjHAAAB0VBMVEUAAAAovpkYK1Mgj/cYLVIZLFIgMFAekPoYLFQYLFMekPoYMFAYLFIfkPrT5v8gj/8gj/8YLFIekPoZLFLP5/8ov5kgj/sovZkovpoov5kovZgZLFMovpoovpcnw
1745ZgbLVQovpkZLFEej/kYMFgmuJafz/8ej/sekPqf0P8ZLFIovpoej/sfkPoov5ydz/+fz/8aLVMekPoovpogj/oej/oYLFIov5f90d//z98fkPqfz/8ov5+f0P8fkPoYKFgZLVKf0P8ekPr70t/9vQj/z9+e0P/80d/7vQQov5qfz/+e0P/80eCdz//T5v+ez/8ovpoov5n7uwSe0P8zvpn80t/80t/80d8pv5n7vATT5f/U5P+dz//8vQT80uD7vQTT5f/6z9/a3//90d/T5P/70ODV6P/7vAQZLFP/vxAnv5kekPv7vQTU5f8pvZn70d3T5v/6vAX80d+fz//T5f8pvpnU5v+f0P/7vAT80t/8vAWf0P/7vAT80N8ekPr7vQQgkfqfz//S5P/7vAT6uwX/vwD6vAUpwJme0f+ez/8ZLVSbz/8ekPoYLFIovpme0P/T5f/80d/7vARMpft4uv2r0v7F3/8plfuPxf1nsvw6nfuEv/2t52YdAAAAi3RSTlMAmZ8g3+8Q30C/gCBgv78QIICfcCBAQIC/c07Pn2AmMN+QcCATQGDvv69gUN85gCBQsIYwkH8f3yDvYCCfzyCP389AIBDv79+PEN+AcECgzzBAkAq/kGBWv4BYYKCfYLAwEM+QcDCAbxCwj+/Pr4BwcFAw7+/fz8+vUK+vn4+Pb1CgkDAQkGlfsI9AEDKkuQAAN2JJREFUeNrs3bGN20AQBdAFFBAgQFBgwAIUiAGZEFZywTWkHlzBNG1ZgM+CzyeJO8ruvSI+Zv8suQUAXmo/FoCctSkAOV0UgJwm9gUgo49QkgA5Y8ShAGQcIoYCkLFGWNsAOU2EthXIViRKEiBniIuuANRr4re+ANSa46otALW6uJqMJECtXVyoW4Fk1WokAfK7Xy0JkNHEh8mlNKBGGzfWAlDbtOpbgWp9ExcON0DCEP9obG6AqoJETQLkc+TWzwJQlyNukwC1OWImARLO8aXO7gZ4wq6LOxpJAjw0T/GHogSosVvjylACVOrbKZ4xiBLgboyIEqDWeJ5ii3UuAH/183mKzabhaC4B+v1+PLZDE9WatT2OvuaD72yMPE96wjfXj/OhXd8joVlPBxMJUMp46KJCd3KqAW7sjl1s8tY60QCf7IZ4WjcWgP9HiRgB0nZLPLS4igbc18YDJwUrkBtK3o4FIPVno8WqBnjOKb7w7lgDPKuVI0BaK0eAtCE+WeQIsM27nhV4+Rb4RwHYaPQKBfDaJfBSALbrF39BA7Lm+HAq/GLvjlWkBsIAjg9MEVgICyn2AQJeBMEjWB1osYXFHWJxj2FpYWcvfJBn9lwUThdvzWWDyc7v9whb/PfLZDIDPEvtjQ0w1c5KK3CukaQzkADP1sZBk3hCjqiqal/XTbNpX+3e2AEMv9neeGVzWo4/dPv+U7vzq8HjvSTvEqdDcqyrm9aFHfBzubVNjAvJY/u+dVY2pbvxlc20kBx09UZMKFltd/yUkDxWt4pMqdqIPjE9JAdVYzChSDtLJCflGKHrr6y/UpxthD/RE3KM1LtijNLc2EVySo7ROs84lGUfiekhOVZdKTTl6KvEiJCMYSyhGI2QzBOSg8rKK2XYGsBPyTFB1fiBgUNIJpESIOUIKQEmh0RKgP8fEimBwuUIKQGWEZKIjZRAqXKcTXWVgCLlOKPKUAJF+hUSSyXAUkLi+QZKlOPcekMJlCbH2XWOpYPC5JhBbSiBouQ4MJQASwuJ1zdQlBwzqZygBsXIMZtNAsqQYz57jzdQhhwzqtzzCUU4ConHG2BhIYmvCbh4OY5YKAEWFhJnC8DlyzG7zrXjcOH+EhJLrsDCQqIkcNmeCImXN8CiQhJNghl9fJ0YY6UhiXqbYDYv7xNjrDUksVcS5vPlW2KM1YZESZjP7XCXGGO9IVESZvNiGK4TI6w4JErCXO6H4UNihDWHREmYyd0wvEyMsOqQRJ/g/D4PD24T/27dIbGfhDm8HR7YSTLGykNijyvndz388N5IMsLaQ+K7G76zdz+tTQRhAMaHksQU48ljDz2FpgiNFzGEYKR0hcSQQ7C9iCAieBP0EKQnbx52GN6PbBqLpDVNd3fW8s7M8/sQD+/82dnajZxjJCkp+JDk/DwLtQ8kaxknwMWFH5KcP96gVlO3xsFNGRGE5Ig301CjE3eNuyQlRBASXl9EjWZuQ9egmBhCkj8xQD1+uU3Zd4NCoggJh8CoryOURIESIeHoBurM3G3ZT4MCIgnJEX/zhLfJwt3AdZL/p/XqeefpeO94v9Fo2JU9HSHJH/H9Hjx1p26rKfdJarQKyPj4oGk3aAoJG67w0+25O41ISQ1ah0/HfwuiNiRsk6C6ybDndrpkq8TLq874wK6pD0nONgmqmHyf9TJ3r+zyPSc4lRw+PV7PIaGEhG0SlDZ6nbki+PymmlZnbx2RkELCbRKU1u/+nM2XrpDlYsYCp4z2i327ElxIcn4vjkr6w567R2/I8ySltMdXo0iYIeHzPVTVn7u7ZSdUpEJFgg0JZ8D4HylZkJEyWi8a1tqgQ8IZMDwMp26LKZ8Al9G+2hcJPiRHnNyguv7S/eOScaTMMNK0NoaQ8IMKeJnzpY3nMBJJSHh4EV7mdKSiziojEYWEa2nwcklHqq5pogoJ/6eAl8nUOV5/rpCR2ELCZRJ46We8H1A+I/GFhMskqOmZtPcGxTISZUjYb4WfpVsbGdyrs8pIrCF5ZAAPXbfGwuZe7QNr4w0J91vhp8dAUsTjfWujDgn3W+FlyM+ximyOWBt5SDgChpdJ5tzUYJfnDRt/SBhJ4Hu/dWGwe1WTQEgYSeBlyMpmpy9Nm0ZIGEngo+8yg13jSCIhYSSBl6xnHszp6cCE5GocSSYkjCTwsRyZByPy1oTjzziSTEgYSeBjfmIeypnIuQnG9TiSTkgYSeBhMTMP5aPIBxOI1p79I52QMJIgDKcin0wYDhv2WkIhYSRBED6LvDRB2FjWJBQSvrhBEM5F5Mzod2NZk1JI+AgYIXgnIh+Neo8P7IaUQsK7JAjBGxG5MNq1m3ZTUiHhqTToNxAJ4Pz3i70pqZDkvN4K9b6J6D+2Gdtb0goJJ8BQ71xE+25ra9/ellZIOAGGep/kyqnRa9s2a1ohyZ8ZQLWBiPJNkscN+6/EQsJ2K5S7kBXNV9K232ZNLCQ5axvo9kNE9drmsGm3SS0kbLdCtTO59tWo1LHbpRYS1jZQ7UJE89rmzo6kFhJut0K1dyKK1zZ3dyS5kLC2gWIDWVF7brOjI8mFhC/3oNgH+euNujtpuzqSXEhY20CvwUsR0brdurMj6YXkN3t37JtGDMVx/CkCxClUKs3IwFCpXVu1yF4apNPpFq9wGxJCSN0qsTHwJ3h4f3KTENEmAc5HuLtn+/f5I77y2c8+fNuAWAWz2CXJ2J4TX0h+EYBQilnqkqRkfiS+kOAKMEhVMEtdkpTNxUcYEry4CDJpxSx0SVLakQhDgpk0kMkwC12S9Eo7EmFI8JYAiKT5mbxZksSWiTAkOAAGkRZ8IGy8dWpLxRiSnwQgTsGviHlycWLLxRgSHACDPFrxMWtq3TfrIMaQ4FESkGfBR0j4w43bgU2UIcGDiyDNmk9QGVXn94GNNyHBJgkIo/mkBbXqxjqJMiTYJAFZtOIn8rZJJtZNlCHBJgnIsuIDWWfAY+sozpBgkgQkmfNZuaYq/N9o9SYkuG4DghguoTS5C2GDxJeQfCIAKQyz0JL8ts7iDAneWwQxDLPQktx2rbM4Q4LdVpDCMEstSce6izQk2G0FGebMUksysRVEGhLstoIE2Zad5Rtq1K2tItKQYLcVBNCKqzBUJpgPG19CgtlWaN8m52oWGZ0VzoeNLyH5SgDtyuZ8IG+j5NZWE2lIcGwDLVsqfiby82Zkq4k1JD8IoIr2lyMuixI//6rncUi+EEBrUsWXW2g6JYA7Np6FBD/uhNakM34XZeioIO7YeBYSnP+CK2EZeaQKeiOknVZ/QvKdABxIzMgjZTS9ENROqz8hwbU9aF5mcr6eRUr/hLXT6k9IMEgCDcvWM74y9X9Lgplp9SokGCSBJqVmxrVQi40OcUHiTUg+EkADMl3MZznXabVdp1lIR78+hQQTaVArXRgz360UNyRfzeZBXLLxLCT4SRbUKuXGKe+fRfMwJBhthVotlcr5LJkhETCL5lVI8LQR1C9bpuv9Dkm91M4USx3KLJpXIcGMPDRmWewU1ySfmTQLajjer5Dg/7/QqOV6VUNFds8RCWk43q+Q4LINNE0bxdc0O1QkmHfREBIAB5stX0luMrq6nowZEoQEoITeMYu9/itjqNWrkHwgACfyUvI6I2HdskFIAJzo2fs+augg2AUJQgJQrlB8qXlGdUmsHAgJPLgfD+6GN3vD4aA/7hFc4/tGpfRCmGe/CAlQbzBNuvaNbjIdjAkONkrWckTQMBpCEr3+tGPP6CbDPsGe3vITKb//7Qm5roeQxG486dpy3WTwmeCR4UpWmt4IdKsVIYlXP7HORndoSeW//+4yOiKsJ58RktgdMuIqQUoeaMWu/lC9xlYUX0KCydaWMnLQRUmeSiKkI7K2WhGSGPWm9hIJgXNJ1nRCiFOtCEmU+h17GcyW7EsioiN9K4svIcHDRtcytSd0O6PkwehkZ+4J/rJ39zxOxEAYgEcr27KVlWBZiWaLKFCgFRRLgbiGnBShNLRAh3RCSNR09yNc5CcDiQiXu91kP+ycZ/I+Zero1XpmPN4myeOfa5I72SBILsys8g+prGzupoSxTVFX+CLpTJLHzxFKaoiEUZBg+XOsR1BcuaRWxpZOo0bS4mZ9fJyV4mt8YhAkl2SuH6SIoaPsovI7Cl2bvV9H59Coi+CTDZsgeU4QPEecpR5mZYU5kv4zru+vqIPkkw2bIMFLe8FzxFnqy1jURw593nS5oQ6SezZ8ggRv/wbOEV0STCm4Di+0Sj7ZsAkSgolmChPvAa02rT5TN7nTaHyC5BVByIXjBcFEXzYt1ld0nMh7NoyCBHf2Qn4M65xgqo/rRzvYUOmTwyRI3hIEe0lJY/NZCF+HPwsucVkrryDBi50B1ntiICSszx0dm/h8epgEyQuCKRS+R/bi1Vu/0TGSm79sguQ1QaCDDZawRvskuaLzWPj0MAkSzKOFOthgfCScqyEfJLJLJFyChCBMx2ZBEM5t/w8S4SUSJkHygSDITVGFUfeQVv0/SISXSJgECcZIAlVa0bAhilUlWdEJgqdIuAQJur8T5BhojWbVsj0gutoniEeQoGkT5INEEQS23vzzlU4Ru0KAT5CgaRPkRI3J+L3wi0k+0ikS3w5nFiQEoznsSoxoNaDUKnXLIp8gQa11vBlG0aJ6v9n5RedS+BSxCBLUWsfL8EES0f5ss6bjpNdaeQQJNj+Pp/BBEtVqs3VLJ8l8PJxVkKDWOlqOlk1k6zP3bIxPEocgwXq08Wq0bCK77bdAQPZcK48gQa11NIN38mL70XOjkeymDYsgwTKSAP+6jCCKm54lEtlNGxZBgsexRstQao1pXyT5QSdIb9qwCBKCTma5tFvzpaGHFEqt0X3veWFP8DISHkGCEkkbY8vrWml/l3J10czpP4uTTXzfes3Hy75pwyJIUCK5b1lmynersnx+/8J5QxDJj17jaMK7vxyCBFMkB+y18qepOn9J5NCzie9rvxUCct/GYhIkbwjupIj2vVWlxnh8fDd9HuqUPkbCIEieEeyY3PlBsKr1HK7OefWXcp+m9IMES412zDvth8EbFGfxcbP5RMfJHyNhECRPCEbGCMZaz6LXGInkN21YBAmav3/l2k+SYetzPO9PX9kTP4+WfpBghQCRdX4yh9ONCInOo6UfJE/p0pmsu8e7KPPG7uRlUTuNKBEOQYKTzTg/tW+hFvm8Y+A1q3DAkUv5NKUeJJd+spk5/4B2paFjTJMpRIlMiU7IJx8kF36yafkc2abIabPS+Rb6HQFnPlGJB8lbumQtnyOZndopVLh2w5lPVOJBctEnm0b7Q7owNECNUok4qd7ZSzxILvqezfXUAHC+g8L+Vq7SfGYv+SC54Hs2Mze5e6swoCYOggQbBFqZeZMXW7mdG9qbK39A5xMK/IV1+CiRAUEyxgeSzNiyVv5AVRfWtI3EL8yUulxBlCt/zzUBPwgSlFoPmLJzCtWVL9/5A8pOK/DnRC1RonC84QdBMsIbsRd/rfMDLMzE/1zefgNd43jDDoIEpdaRGwGUnfyfa/79kvlDmE7jBkGCqdZxi0Xcy+n/OUtbLeebCscbXhAkmGrdz7wPURCFDBKaZSiUcIYgwQN7f9jKD6PzUEHS9VGiMTHPCYIEU62/2TubXadhIAqPLNtycCRURWKTRRSyQrDogixY0Ps4PAuSHxoJiUC4uJlpLXrszrelupcrpSfzc2aG/EuSY/vCQkLRaKGkWlRItPcbbMrgrJWvSZQLycZJlaRWdNbm6QOS9V8K0s39dKGfXMJ5zujJWqhrsxGtetMqJYECKySNBSS+e60ic6A90eXym+VuH8me+HMyWC8D10cCBVVIGgtIJsvYoOptyrLeEwX3h/dRRr1XUQm6avGZA5LecRaLmHQFu9z+8hr+/X9SJakQFZInDkjWtMf4o0+N02tVGUjIgRklWlWS+tAt8s8bkKysxSLxr/AjmnvbN5tQzKRK0gp6IOtpA5K9jrhcYGFfpTHR3Jfe2KNaqh9VSWrDJEwwhaSlgGTNDbfkPzblRmPScFMU3PEeyw+kwKNHxJ80INnry
1745MxxLA5XnpuXW15elrLM2gWuiyFhAikkDW1YXJmTMzYnNpE9r5sXCUd5TupxrYo+YYIoJA3tIVmZJY5vacP668GsXeQvL89VkoEUbKaECaKQtLOHZM3HEtmwY8n968Ygfnld2Fn3RAo0qFN7gELyhlqh5zZFzPUFJH6+yeY67YZt8px0P0lFJEzwhKSdSuvkdiY01lvGZrIUly25cn7swO8EdKRAA2ptxROSZlq/u4zEML0BS/6HyUuubl+/zWN0FLgaQB1pcELSTKXVW65FIzLaw+SNvORqt18vMV4HUoCZEyRoQvKlmUrrC9s0anbywLQiuSB4eVmJ6ll1uCIDaiRBE5L31Ahr4n41Y9ro6RrnfaGkF7y8PB0QnSY3dXBOkIAJSTOV1r9G8JgBiaTqktxEB/SCrm7Q5KYOQPu/YELSSmLjbdpwC8kCkjxxFCnJJLGezNq5qQOXEMESkmYsJCb95swNGywdM0sqrl40RdOpwbUKxoQIlJA0k9j0ghNXlhWQbJwkSjLuNIpfJnFab8UFs22DJCTNdGzibgTvOiEfkDC8aaNnPnMXWT/gRAoqmG0bJCFppmNjBL1UIx7in9hGN+plyUqnIUkFYI7tAQlJM1a0fldoZZfOFn7Aw5278bL6adCQpAIwb2ThCMmnFhObge8K+CAZ4uHaSUZZiDFrSFIBkNVWHCFpRUfIpA0j+HBPfCZuE3iWeUO808YNPpDVVhghaabzexYNxNhND0hCz/TNBmEF5qReEnwgl6ShCEkzBRKybIOZ/Isun/x3slzFO7W3wgPpbQURkk9vqRG+pQ0jiVLP8viWk4YY4S+YtdyKD6K3FUNImnGQ/FlptYuk4Uoc5JP/QZCr7D/vSAEF8bYNhpB8pFYwmcRG3p6VTf4zchXP0yfNbeBBtKRBCEkzhVaKaWOkY4KsSSKf/JfnKoPmNvAgFkkQhOQzNYNJG4uoZDrdWb0/l8pVvPZt8AHc2wogJF+pGaLwal13X0FiTgwDmbQP06knDR5AJ8njhaQZRyt/aeKGY9paGUfATSlryKBFEngAt6Q9XEha0pEo3Ogx3VuPiO64c+OFm8+CmlvhARy3ebSQfGnozi93aeLG+e6X/8Do3HSydMs7vSkOT5fQuEFItPHLWJootKf6Ak/U6XimdyEGo1Zb4cFrAN8iJHoNq0xAQh8YtVZBcrOUCUnM779CAQWvASwWEjWQFAtIqCvw7h+OZ276W3vSpKACl9tIhER15Crf0y+s1A5gyjxS4bADbET2FO3/wnJKYAiERHWEv8WZB6NpI0puxuOnLkiE5EIKKHC5DV9IVEfYZyXED0Nf6OXUHw7cdCokbYCW27CFRHXkgFHsvwiMOEE2vWf9odacVUiaAC234QqJ6gh/++EiFpKJckh3NjO0RoWkBdA8aUwhUR0h4VmJUlXNMmckesGJ8EG7NjUAlttwhUT9I8XOSpT/xoa0MXB7O3lmXW1UA2CetIcIyZd31Bo9o5zJN2yUt8KFrJc+rzkjKbh4rIWLjxCSTy3N17x64/dyIbEFm4Eh66LdeGGPJCvAYO0SYAqJzvteJ4p6v+W96OYwIIqOOZo86Yq0OggJif8vJF+bWRj/z8zGlBGS8iHJkDbcpPtIGgCq3MoREj1gIzCRhIcICXXHpz873uUuqw75SoAqtzKERNu+oszmMUISjpcuRsdRkqA7W2vhB3tns9s0EATglbVr4toInAgScJBjgiIZOATxI0VR4coN3gJx4MZjjN8ZpEgkMW6ya0/tWc9890pV23ydv50hVW7tVyS7Ma0fafzfMMMWiXtIktr8B8tCixdDAm0oTbdeE4mUWd0ym3V/InGPJAKoxSRXVg4ItKE03dqnSKZjLLOeZzaZcqBAEInTtvhQXzNJbEAWLfpDCWToUSQv1VhJHDIb5zkS9zi3sNqnBiZpOjgqPRuPINQBvigSmUJzrU+s2330ceNcY/uXF6z/84iUWr2CTge4L5F8GGtac/YR1i1LtMh/VBPblqH+eKqSHwakQuIXdEKSfkSyG98jvRO2jUkF2gYhdy8VDpX+YHvo33yeaQCQColnkAlJehHJw7F2a+rNkElLAX1GDozceoYmijIDZ2gJSPyATEjSg0h2462y1pq/RjmRIxc2IzsxpXAHkth4CJWQ5H+RSDjSuvlbtv3CpNexuMRAM3Ks0z+ohCR1kUg44kzS2gfI72xD25ZLrKEJefbrI0RCkgaRyAyaG0HrhEAjlzYj2xwrDiQeGQtEQpJ7Fcnb8W1Cu6QDrRzJkFcIFfZFl0TDHWiZRPMLGiHJPYpkN86XvnXi5p/lEFd2Jw5BRVxAI4UsD/AMGiFJXSQygtZ+iiRpH0FgvysvbQwYaKgTSTjiHwEQ4L5E8pBFVnNug7VyA/+CTOQY4iSlgSM6zZXgHyT2ktRFIhpB+PC6D5Ik2FILlSX5Ng3KMgjSRM5h+QqFvST3IZJbRho56eGWHfq1BXYneqsENoQaBgdfJG9H/a7mP/IuXVON3LaJpYXLEgL11rpIJKmxAG3peonctlFGHt2xZPgWcF0kohGcsoT7F6OQyZU8lsSD11sxRTLlp5HTA5cUahonkykCJwY/TYEmkt0Nk7kRzAOXMXa1NZWjNEyJwA2iImGY01jUWh00FKlGBp9METwhBydIioRrMHI+1zrptAbchAqDiexu5koKTpATye4D12AEIZdAP7Qby3krtmTgADGR7KZP+QYjtZCiXQSBvZJERMKWHFwgJBKxyGmNK1KKQpFElhPxZQb2kBHJLe+M5h+mY9slQm6zaBEJXyKwhoRIdtONhCIHwq4z6TPkXETLaCtfnMbSBhbJg+lm7MucUbok7oltICIROrIFfPBF8uDdzRuJRO6a28i75kZGROLK88Vi8Wu5XM7n89evXz9/8uTJfr9XnCkAEXyR7G6nL6Ww6nq+133PKgIRJ5G8qJr5vVp9Ozjm68ExT9g4JgME0EXy4Pbdh5eb96IQh7ct7ZOjQiISFJEccHDM9/3+lRoJCGUSFJE8mk6nNzc3m82bp4+lFoLQ/XXYk2dEJI7MK0xWB8ccUqVnf1MlLx0zgf6QY9EIoB2UKFFzG32Mb8aPhUjQHLM4dQxluaRgg4iEFgjzXwlgrkkznOZI5tVAkK62BGCDiIQSFmMkLrlNSMJs/jCYSBRlwgwsEJFQIsdYTBQcbSSP9pxYVnbwEomKNVggIiEEyqv9CeC9t8lZrREQkTSTG7iKiIQSOHuETO3TjzLayOHWlYjkDhK4ioiEEjOUm5sp3m9jxmrV4s9qGFaKOilcQURCihRlBiQHtHJrcfyGGLCorGAokusmEZFQAmlpe4TWa4lYnaMQkdBpAotIUPajRUiVDROi7bRnwFAi+aY84LJJRCSkiJD6LQYpJMlZjZGob9UwLJQPZHAJEQklsN7apkghyZZV91etKiuYiuTiYJqIhBRYT+RCpJAkYNW0EZEQMomIhMSG1JOQZC2nf6mL5JfygwsmEZGQAq0kERqMp3sxs19rNRBL5QkXTCIioQRebTMFhPJGwuqljYiEkklEJCgiSRReSKLD7vMoa8WByg7GIlFhCY2ISCjhcNfOJST50jqz4VUiGUwkc+URATQiIiEE5qP9UHdObhLgtB5NqU+VHbxF0jwtLyKhxFEkW4ybJF2Tm4zV018RCSmTiEhQRDLBPbj4pdteE61Y8Ie9u+dtGorCOH5kXVux7MWyWJrBqpjMlIUVhgwe22wZoo6oCCF1qyqkLGU8Hu43JryEpCFpfO0TfO3z/L5CxR/nvh2ExKOhwAiJNyHZnySQd3xpTYXbuifvaGAKw4cQEo/IhoRy7nIsLWFlezb0pm4GIfn39UWExCcT2ZBQ3GWZJGBVN38REidJzC8gJD45CInoj5u4/QfJjHToLSRXNEAZ70NIfCIdEsq59YJrqW2pleiq7skbGqI85D0IiUfEQ0Il77wnBykrOx7vMPoXITmyUIKQeCQRD0lk2pUkMfo+SBASV1HAfyEkHpEPCRVhq5IECj9I+gvJLQ1VzlsIiUcuEBJKuUVJ3rPCDxKM/vXp5w1C4ssR+a3MvSQFs7LT8QhJ14klCIlHLjNpN+A9ZdRk11jn3xMhaWVmeAMh8ciRkIg/RmPeunytGiWHWp1Dompi5xlJwMwIiUeiIyERL0mYn71HoXGlFaN/O0gNQuKVY/+A5VfEgrd0WhoyK3uHBCHpLLlGSHzCWxmJl6TRmmv0kfcYFUMoEBIft28Qki7C4yGRf7TXpHTMxDArXSDZ+Fy70DX6t4HcICS+MA1+Uwg92muCgg5MYmbWufOLGeK+LboiJD5M2mt2W9N8nES7iryf8obWhVaEREIyRUi80GD2r/Bx5jAugyAopyGz9o70FpIbGo/UICQeKFu+HiK/Hhbq6wjd1A70jf5tnBKEpHeBwCAZkduaRtv6CGaIy8kMQtKzQOCqnMR/F1Nl+zUIiagkMwiJAIEF0
1745ZAuJeMT1J5D6z0kX2l0ktQgJJ08rWTWQ6kp+U26eEI61S50jv51kBqEpIOV/S7yeMgHupwkCPkko3CVFSG5iDRGSFr7Zucij7YWdEnRqb9xrOXFeITkVf0fUdMekkf75NvLRsclaRkeViT7QJrVDjRP7HRcLEFI2rD2wbsHSU4qZlkQx1MzjYPrfKLrhh5G//4vk8AgJK6erV35eP0XEJIepSVC4ubO2srXyzaAkPQmSWOExMHK2k7bNlNt83Y9cls7UT36t+WqHELSVGWtvZO4bDMlaGzgo3+VhOSnWWAQkgYWdmMp8bZ/SHAWQjJASVqGCMkZK7vx5bvE0VbteyhNjCQkV6RNkZYGIXlFZX968P1oKxxzVTvA6N+uolkWhwjJqT2bjr9tCt7SfMTU2bBH/+oMyS/RJL+OQ4TkwNL+thCYbJMTnIOQjENUzPLrMjYIyW6ptesnSaj8Kr+TkYTkluCPD8VklqbZhuYv8ke7tcBBkuHB6F/wwp39a+nvG2mAkIDP7iu789D5IAkTnIGQwAit7Z4vc+z/Do1LSDCxEy7kyb6wpHYKxXNlWsPoXxiLeWVf+oT934FBSKB395U99ESthNhIbwohgbFZ2X98eaY2Ytz/7cnn2gVG/4K8T/aIao5tmyHBDHHo2dpasZLkvKVxaqYThATG5H5lT6iesW0zHH2F5IYAiOaP9rQHchVpH5zZm5vaAUb/gqxFZV+zbv/+c0zQ0KBH/yIkQPdruyOzUFLitcWGEBIYiUVlz1u7pSTHIfmGRhKSrwS6LZa2keqOHMyw2upo4BM7xzv6FwQycpCSOVZbfVc3g5CAnPkP9u6fR4kgDMD4O0YIRBtijGENGCKVCYmhsNRiC66721xxFISSYIgJHTEkFvinWor5xtqAo64cAzO67Pv8PsSTmdnZeWcr62eScdpabtvjEBKEMc8+je0JFuvpZ6+3jWqMpDikKiHRMLETrnQ6nX1aj+wZFuP1LDv6tLUhuB+jf3FZpjaImRzW4CWBoxASXKg0zT4uJ2N7ssX66zSby2H1Gg9AH4OQ4LLNs6+jU3Y1y1SO0uRK2n9ws/XC6F+E8Hni15Lxci7H6nElrdtut791OndJkgwGg+4P/X5filz+6F9Cols6HR2fkUw8vOaQpGuKXQ2Hz35vzJsfjSEkuGDLUbCMuOq5+kOSgfHhNqbT6SRJ8nTfmNvShyQRaJdO7L1Gmfh6rv6QZGBCGg6HbbcxfSmQbD0w+hdh3bu/2czFW0/9TZKBiWlQqtG/hAQ/pGt7wGIqRbhJco+nxkFIoMEsyGMkrnqu/XebxDgqHpIbAQ6WZJXKaZr5jtLfbeKGpFuqiZ2M/sXhu/OruZyole+8FpUICTSahu2INLS/SXJnHIQEWswCnI+4aso/AL8yjoqHRIC9TdCOyAPlH4DjhqTP6F+U1ersGeKux/lOSzQiJFAqXXg8OuLxAfihaNQ2DkICRZbWMZIzNXXvbeKG5FYKvN/6YPQvYhnbnzI50xPde5u4ISnV6F9Cgl9ldm8iIuxtCAkhwQkmdicVYW9zjqFxVDsk1wL8InUXJOxtShuSKylyvfXA6F9EtA63IJF6rvlOWtSQDEs1+peQ4C+nJGsRYW9zlivzEyGBNuPdXbQAnmh+cNE4Kh6SDwIU/XIzkiDqNcWjO01M7VJN7GT0L4qPWycSRlPxO2nGQUigzmi3swmgofedtFvjICRQZ2Ot/SKB1NQet/aNo+IhYWIn/vTR2rGE0lK7JIkbkg6jf1FyqbUbCeVFrvXpVkIC5RZ2KcE0td5u7RoHIYE+K5tJMI1c6RfguCG5kwI3Wy+M/kVUE5tKODWlS5K4IUlKNfqXkKDAxkpALaVLEkIC5WZWAqorXZIMjKPiIUkE+MM8FZYkJQ/JUymQbD0w+heXRemSJGZIyjb6l5DgH3igckny1DgICXCuR/neO1EjMY6Kh+RGgPge5HsvRAtmiANhPaop/OOGkACBtXJ975LcGQchAYJ+uKm9FB1eGUfFQyLAP/EkV7e5YYY4ENxzdZsbQgIE18i1zbhpGwchAYLo5XtvRYO4IbmVAu+3Phj9iwtUf0hIginZ6F9CAg+hNjcPRQVCAjiCb24eiwpD46h2SK4F+Hd6qv4AjhqSKylyvfXA6F9cqkbvQU/NeJuIISnb6F9C8p29u1dtGwrAMHx0ER7q3aClNnQ0HrQYnBCaEA++hgxdOnTI1LkgXXPd/NSCCBsFjnWk8zwX8cI3fRDLrjgREiC969+0QvIjAK9GFZK0Hjtd/8I7IRESSM2+aBESIL3r37RC4rET3owrJK5/IQtCAiT+2CkkkIW4ITmEDg91L65/IXk+xAEhERIY3teiZeIhmQfgn5GFZBY6zOseXP/CCMQMSWrXv0ICkcyKFiEB0rv+FRLIgg9xQEiEBIZ3KFqEBEjv+jetkATgxchC4voXsiAkQOKPnUICWYgbkn3o8FT34foX0udDHBASIYHhfStaph2S+wC8GFdIdqHLfd2D618YgYghSe36V0ggll1xIiRAete/QgJ5KOJJ7bHT9S+8ExIhgdTsixYhgWn4U5bl82bzuFwu1+v1YrH4uVqtQodRXP+mFRKPnWRj3XTbVtWvY2M2m80xMXf/G3OTdkhc/8Ig7preqqoq2435/dYYIREScrVsLunfmOdjY16n0ur8Y6eQwDQsm5gWVw7JIXR4qPtw/Qu5hySt618hIRuPTYuQCAl8xvcmpsX569+Jh2QeIBNxQ7K6ckhmocO87sFjJ2QfEte/MIiyaYsfklnRIiQwDXFDcnP++ldIYBrihiSJD/EvdQ+uf0FIkrr+FRKyUTUxhQ8ORYuQwDREDcn2wvXvxEMSIBdRQ3LrQxyysG1OhERI4FOamG4vPHYKCUxDE1N57ZDsQ4enug/Xv5B7SP6ydwcvbQRRHMdf8BAQNEGaQnssNREsLeJNWqgHIRZF0YOoBxHxUBE8qGfxPGQGurXY/rWlUPStWSc7yjiT936fs+TmF7Iv7C+r6V+EBNRYtQxCgpAAPMUnG9PciOlf2SHZIAAl4obk8wuHpJ9VSLDYCWrICgmmfwGSmLUl8UPSb9xDSABkiBuSLf/0L0ICIEPckHzMYkP8YhAA078ACElO078ICaixZLn4IdluMAgJgAxxQ7Lmn/4VHhIsdoIacUOyjw1xAA3WLIOQICQA+U3/7vsXOxESABlkbYjvUIXNQQhM/wJoD0le078ICaixZRmEBCEByG/6d9Y//Ss8JG8JQAlZG+KdrEKCxU5QQ1ZIMP0LUNv4LHYOh6TTYBASABnihmTVP/2LkADIoGBD/M0gAKZ/ARCSrKZ/ERJQ46uNiYbsNBiEBECGqCFZGTH9Kzwk7wlAiaqQYENcwPTvwXQKhwQ6rdh7CImckBy6FM4JlLIxfRux2ImQRLPuUpgmUMpWGdvp322q8H0QQMr0755L4YBAKcuMf0iyWuxMGpJdl8IugU6rlkFI5ITk2qWwR6DTJxvT3IjpX9kh2aCEpl0K6wQ6ydoQ72cVkqSLnZcuBVx/tZIVEkz/3nFJECg1a0vih6TfuIeQRHPsUjglUCpuSLb8078IScn4/4wE11+1NGyIXwzqkzL9e+ZSOCJQSkNIBvWICsmRS+GMQKkly8UPyXaDQUgewPUXxlTckKz5p3+Fh6RP6Zy6FI4JlHokJNgQH/PpX/c8N24UXH+BW7MMQiIlJK/cs9wW7ikuCbT6aGPa9y92IiRluVx/b82vG+eHlwiA4A3xHaqwOQgiYvp3zz1DYYz54fxw/QXBIclr+jc4JHm8RKAw/1jnhZcIQMmWZRASKSE5cMHKHRn15QYvEYAXnP6d9U//Cg/JWwqTxc9ICvPfrfPB9RcEb4h3sgpJh5I5d09UmDs/nUf6lwi02ndaVF+baVV+bndmuWmM6U3NdNv+D+KfpJ2skGD61/cK+bCOhD9vPaeX0zox995RbZOGWaAhr6cMN/NoSiYM86FN2s1ZLn5IOg0GIWFyuP4WhvvjqqW//rYme4Z5TXVdGW5yqA4sI+xvKrSahpkn9eKGZNU//YuQeMS//vo7Ev689YAi4xnh2lTTojG+///5nhk2Q1VOyrEBBRvibwYhREz/7rpgvCPe563prr88I1yPappompJFz9cef0m6hvlAoCEkCjfEr10o3hHv89bU19+rnnloKqQjnKcjXHf4k3p4QOKd/o0fkp0Gg5BEMu3CFWbYbxdinaLrNs2wBapn2ZR9IW7ePKbXogea5c5A5JCsjJj+FR6S95TKpQtWmCqFC3BIkfGTSvgjihNvgCaa5lHvfKefv+ydz2vUQBTHX/EQCGRTgg3oMeiukL2E3csePPQgVLEoepDWQymlB6XQg3oWz8PuQG2t9a9V/LWTzuRlXqbT7Cbvc7Nul54+JPPefL9TYCpEwh3i6179KzFwjzict4KGP43QZyYhLqBEVBNB9bPLmFdIfvNksYRF0hGRHEsNskfoyyQnQISuETMTsGCIC+iOUHg83EzHQiGufHaZ8QHJLVT/Pqtp7GSR+GFXIqAeQc9b25z+vhfVgAWTkdBIKx5IihgA4lnVM0/JaBkwHewQfw0G3s0JdKL691Qi0Dwiri6kJUfgkUhU8pgysFGJzQ8ko03tVSirekVKgOmiSFaqsbM9kRxJ6ewR+nnrKXhkJiopQAHbQ0XWT4a6HHLzgeqEV+NNPF0osEg6IpKBpHkER3kkaW36G4tqwobPM5H6Af2NJ9Xcoj/asEdup/r3UU31b7dF8gLa4sTFI/h5a0shAqmoJicMbFSmZk+NABNJwqvxPegQ31kpkbTX2En2CM6ltAI8kolq0mYeEZnZUxEmks/ldyqmmyLh6t/f3HXwCGmZxD1CPrScvUxFNTHg5JiAdNWEhmOTkLMDaI2d/kWys7GERaLSyvT3UiDQLu8NoAGFNnshD21GgHNnVC+gQntTMk5t4qAsIuaWRPIKr/5lkfhh39EjOufk6S/5+ktk+TkREa7sYavvowpPTQxySTk7gDvE4ePcnk5U/+45eAQ5b/URImB7ZWWpjTQWZabkwa8uIPVDcaVchuXtFaZnIpnb0R2RHLh6ROeHpIUI0IOGMpvPRak+wMkAo7BaP1EfVEw/4+wAWvWvf5G83lBgkfhh0MAj7uetx25T3bT+vHScmwY4KWFgoxKaRRKYBjmcHdCuSJ7j1b8dF8kOtMSHBh5xP289dJvqxnU+GA/NA5y4mUdEjoqkfNbK2QENRcId4mtc/Xvo4BHSeat7hPzUcvZSiFmonV3gv6jf99dyFlGRBNc+mnO4IsbzhQKLpBMi2W3uEYfLewO3q3gRLpIwVg9GVSLLwe9sc1Z9ZzjQxJSq2uDsgJarf9/ijZ0sEi/sEzxC4KuHEIGZ5ZZoXH3rprAc/KYxcmdYH/WqvzusyA6YZEkUBNtREfJKSbc6xN+AgZdzEutf/bvXwCPu5617blfxwqa3bkK7wW8IKSIg9dxlOwaIk9KARssO0MLsg6TnDyndEslqVf86iMRzhPy5aMLZjU9/0wYVU7ntlb3imm4yRECpKEkhGV375EQLV9TC7IN+z3FeLRRYJJ0QyaDWI99E
1745I85vOkQg144+6dGrE9tuzikiICzuZKxlByiNfLzqeivVvw/x6t+Oi+Q+tMMnTx7Bz1sPvV3ZwzfMbDwyjvVpT2o7J97UsgN+i4VN0uEO8a2VEskWtIMvj+DLJM5X9ujlNMgvpvo13W1s/SSeiQrCa9kByTWP8DW+DoqEq39/cUzwCJVztwj5NCkTLIeuSZkYqhBlCosbvxPDtGdkGXgSatkBSANOAL1Fa+z0LJKtDQUWiQ92/XlEnLlNf6fCFtsacBHWD34z07QnsvvbQkN2QCRK8OK8f5E8xat/WSQ+OJUIF2fVXP0f9FZ/5twpRCASOsRg+NRiaBNvG1ST190ZDoXGLDdkBwxFNRH0lR50iN+bU1j/6t8j2ZAF/tyBc0o838ApwITtlb3EZIyw9s7wcCzKJDEADK+LIlBNEw6z0m/1tnavByLpW4f4QDbkR92ZqvP0V9gSQhVJ/ZW90NioWdQLCIaPlfOOcNOYHTC89m+Ix/xuo1X/ehfJmw0FFokPTmRDvteGjziGCEyELbnt21EAGp/1gQ0+tFGJ02yaJNNwuAlgzg4ItB2WjG8FexbJk5rq346L5AG0gmzKmfjLQtKhLqXiTGyLsiLUVurtOm1oQ19/C8158xNu3jOLhDvE17n6965syhmt7pceIR8KW2LboqwpPrDJNb/QTkX17IBEf4+5w6etAE8WS1gkXRDJrmzKN1q1Hj1EoLj5oU2GRz0HS4Qw/c8QEEzZAepPNlkkt1P9+6ymsZNF4oF92RTxD0nn6EaHNlHjoU0uaKSAEWk7IhOD7iYskq51iL8GA+/mBNa/+ndP0tCvBF9JOntgQVgmUk4fyuSgY5ezGAoaE0AwhCvmhhl1yuV7XRPJSjV2tiSSA9mQc5c1kn2gM6XctLHMWSwEiREg6NkB5kq+nKc28HShwCLpgkgGsiGXLmskx75yFvG3owgRjds7lJYdYFvJ10/8Vv8+qqn+7bZIXkArfJAN+YpnKuIcOuUsTsEWUSbRv5NEAWC3+pZhlXx8/7djHeI7KyWSdho7DyURfR/tUpL54JazmIElk7qhjaARQgVadgBSybfNK/IdEwlX/zpMf53WSAbeyrHwoUxq/k7nDVotO8D0xPNPiNzjqTV2+hfJzsYSFslfVmP6e+UgkgMv5Vj0nMXspoY2cWD+mNBFkvNiq2+RvMKrf1kkf1mJ6a/TGsmet3KsOFDREpcVMuU7bQEjWnaAuW3ccJaSQ0/pQ4f4x7k961/9+0U25OJ/Gomks+9taJMKW3LlOx03aPXsgOozkjtcwNcTkczt6IhIBhLHzxrJLtDZtnohyEivKUVUgSgxi/4Qgo4hOwBt0kr4zUar/vUvktcbCiwSDe8R8p5ijQ7dhjY+0xnNOYs42sU/458Taac2/S3J8iuS53j1b8dFsgP2rECIgFOsESjQJ7m5h3RG9LlmSsoOqG7SyrJI8AMJIhLuEF/X6t9jScc91ujEsRzLbzqjoRyLlB2gEmNNWv19IIHnCwUWyfqLZFfScY81OnArx/KczoiXY+Gr8ePNmgE0r8ffQvXvW7yxk0Vy85xKOu77aEdu5Vj+0hmRnEVCdgDySML39brYIf4GDLyck1jz6t8j2ZQrh1ijU6ehTeE5nVHPWSRkB+DHLbzU2kmRrFb1L0EkKzD9ddpH2wU6w/+kN5LOSLiiExGyA3QSYSLq6y2bP7xaKLBI1l8kJ7IhFy6xRsfgins6I2H6O6WEK+ok/F5zy9W/D/Hq346L5D5YshLTX6d9NHDGPZ2RMP3NCNkBVo9JUV/TAzraIb61UiIhNHauQIS8S6zRJ/BGYEsICGFQIoUq8kBhWv3ckoxZIx0WCVf/7ko67rFGA+gfaTYtoihKwrzfhyNIY6dPkWxtKLBIlrQeIuASa3QETM/xK5KnePUvi+Rne/fP2jYQxnH88RvoVGFZyEaDDF5kgwcNQoMWg1xsYuLBtB1Chw6FlkKbdujUvgBJ0LGvtk4uf5REkU65KHen+31eQZZ8wT7z/G7IPyIg8jOStwSGM2BDfJS1ofn071nRnvhZo3cEhjMgJEZtiL8q2hOf2ftIYLgk7xI9cBiUICTX5J+QFzpr9IHAcJ2GZNUw/dvzkPjET/oJeZGZve8EpqsKCTbEtZ3+3RY1xH6PhtdfqLHKbyEk2ofk6a+/+d8r/4rWzghMl3fpTcNiJ0JyQY3X30Z4/QVjNsT3VOFT1oLm079/is7g9ReMCYlSi53cIVHi9VfElsBw67wEIdE+JD+KzuD1F2RN/84apn/7HZIT4qXAEQEhBKbr14Z4qlRIbOIn/YS8iM8EputXSIyf/t0W4vD6C6otdlaEJB3cQkiuKHBCvhmOCICskJzWT/8iJNfkn5AX8ZXAdCZsiJ9n/DSf/sXrL/BBSB6n2vQvf0jkn5DngCMCIGP6tzok+0EJQnIJr7+gvW5Dsqmf/u15SFJ6ca+lIDDeIyHBhriu078AMmzyEoQEIQFQb/r3ff1iJ0IC0A/92hA/UIVd1orm078APBCSOg5VCsPQsixnPB4Ph8PUdb/Ytu15XnYXQgLwZOvF4tt0Ov0dRZv5fB7H8Ww2+5kkSUchob3v+5PJZBcEluNc/G+PjpbLZRchaeaH4Y41ZnRsjOu6NmsMQgLwXBasMVEUHRNzGse/WGNWbULCjTUmvN+YYbkx4iFp35hxuTEnnneecXMIABoaM73fmORhYxYkrtyYIAiOiTncNCYd3GXRiwhZY0oflVhjFFjsBOgJ1hj2UWlN3WMflVhjQpKNfR3DGiP/rwG9/QfJjeZOMnuWSAAAAABJRU5ErkJggg=="; 1746var BL = Object.defineProperty, UW = Object.getOwnPropertyDescriptor, Zo = (e, t) => { 1747 for (var i in t) 1748 BL(e, i, { get: t[i], enumerable: !0 }); 1749}, S = (e, t, i, s) => { 1750 for (var n = s > 1 ? void 0 : s ? UW(t, i) : t, o = e.length - 1, r; o >= 0; o--) 1751 (r = e[o]) && (n = (s ? r(t, i, n) : r(n)) || n); 1752 return s && n && BL(t, i, n), n; 1753}, WW = {
1754 // Screen reader announcement when focusing an item in the chart 1755 ariaAnnounceHoverDatum: "${datum}", 1756 // Screen reader announcement when focusing a chart 1757 ariaAnnounceChart: "chart, ${seriesCount}[number] series", 1758 // Screen reader announcement when focusing a hierarchy chart 1759 ariaAnnounceHierarchyChart: "hierarchy chart, ${caption}", 1760 // Screen reader announcement when focusing a gauge chart 1761 ariaAnnounceGaugeChart: "gauge chart, ${caption}", 1762 // Screen reader announcement when focusing an item in a treemap or sunburst chart 1763 ariaAnnounceHierarchyDatum: "level ${level}[number], ${count}[number] children, ${description}", 1764 // Screen reader announcement when focusing a link in a Sankey or chord chart 1765 ariaAnnounceFlowProportionLink: "link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}", 1766 // Screen reader announcement when focusing a node in a Sankey or chord chart 1767 ariaAnnounceFlowProportionNode: "node ${index} of ${count}, ${description}", 1768 // Screen reader description for legend items 1769 ariaDescriptionLegendItem: "Press Space or Enter to toggle visibility", 1770 // Screen reader for the '+' horizontal line button on the Y-axis 1771 ariaLabelAddHorizontalLine: "Add Horizontal Line", 1772 // Screen reader text for annotation-options toolbar 1773 ariaLabelAnnotationOptionsToolbar: "Annotation Options", 1774 // Screen reader text for annotation-settings dialog 1775 ariaLabelAnnotationSettingsDialog: "Annotation Settings", 1776 // Screen reader text for the color picker dialog 1777 ariaLabelColorPicker: "Color picker", 1778 // Screen reader text for the financial charts toolbar 1779 ariaLabelFinancialCharts: "Financial Charts", 1780 // Screen reader text for the legend toolbar 1781 ariaLabelLegend: "Legend", 1782 // Screen reader text for the legend pagination button 1783 ariaLabelLegendPagination: "Legend Pagination", 1784 // Screen reader text for the previous legend page button 1785 ariaLabelLegendPagePrevious: "Previous Legend Page", 1786 // Screen reader text for the next legend page button 1787 ariaLabelLegendPageNext: "Next Legend Page", 1788 // Screen reader text for the an item in the legend 1789 ariaLabelLegendItem: "${label}, Legend item ${index}[number] of ${count}[number]", 1790 // Screen reader text for the an unknown item in the legend 1791 ariaLabelLegendItemUnknown: "Unknown legend item", 1792 // Screen reader text for the navigator element 1793 ariaLabelNavigator: "Navigator", 1794 // Screen reader text for an accessibility control that changes the position of the navigator's range 1795 ariaLabelNavigatorRange: "Range", 1796 // Screen reader text for an accessibility control that changes the start of the navigator's range 1797 ariaLabelNavigatorMinimum: "Minimum", 1798 // Screen reader text for an accessibility control that changes the end of the navigator's range 1799 ariaLabelNavigatorMaximum: "Maximum", 1800 // Screen reader text for ranges toolbar 1801 ariaLabelRangesToolbar: "Ranges", 1802 // Screen reader text for the settings dialog tab-bar 1803 ariaLabelSettingsTabBar: "Settings", 1804 // Screen reader text for zoom toolbar 1805 ariaLabelZoomToolbar: "Zoom", 1806 // Screen reader text for the value of the navigator's range 1807 ariaValuePanRange: "${min}[percent] to ${max}[percent]", 1808 // Alt-text for the solid line dash style menu item icon 1809 iconAltTextLineStyleSolid: "Solid", 1810 // Alt-text for the long-dashed line dash style menu item icon 1811 iconAltTextLineStyleDashed: "Long-dashed", 1812 // Alt-text for the short-dashed line dash style menu item icon 1813 iconAltTextLineStyleDotted: "Short-dashed", 1814 // Alt-text for the 'position-top' icon 1815 iconAltTextPositionTop: "Top", 1816 // Alt-text for the 'position-center' icon 1817 iconAltTextPositionCenter: "Center", 1818 // Alt-text for the 'position-bottom' icon 1819 iconAltTextPositionBottom: "Bottom", 1820 // Alt-text for the 'position-left' icon 1821 iconAltTextAlignLeft: "Left", 1822 // Alt-text for the 'align-center' icon 1823 iconAltTextAlignCenter: "Center", 1824 // Alt-text for the 'position-right' icon 1825 iconAltTextAlignRight: "Right", 1826 // Alt-text for the 'close' icon 1827 iconAltTextClose: "Close", 1828 // Default text for the 'loading data' overlay 1829 overlayLoadingData: "Loading data...", 1830 // Default text for the 'no data' overlay 1831 overlayNoData: "No data to display", 1832 // Default text for the 'no visible series' overlay 1833 overlayNoVisibleSeries: "No visible series", 1834 // Default text for the 'unsupported browser' overlay 1835 overlayUnsupportedBrowser: "Incompatible browser version. Please upgrade your browser.", 1836 // Text for frequency label in Histogram Series tooltip 1837 seriesHistogramTooltipFrequency: "Frequency", 1838 // Text for sum label in Histogram Series tooltip 1839 seriesHistogramTooltipSum: "${yName} (sum)", 1840 // Text for sum label in Histogram Series tooltip 1841 seriesHistogramTooltipCount: "${yName} (count)", 1842 // Text for sum label in Histogram Series tooltip 1843 seriesHistogramTooltipMean: "${yName} (mean)", 1844 // Text for the series type toolbar's chart type button 1845 toolbarSeriesTypeDropdown: "Chart Type", 1846 // Text for the series type toolbar's OHLC chart type button 1847 toolbarSeriesTypeOHLC: "OHLC", 1848 // Text for the series type toolbar's HLC chart type button 1849 toolbarSeriesTypeHLC: "HLC", 1850 // Text for the series type toolbar's high low chart type button 1851 toolbarSeriesTypeHighLow: "High Low", 1852 // Text for the series type toolbar's candles chart type button 1853 toolbarSeriesTypeCandles: "Candles", 1854 // Text for the series type toolbar's hollow candles chart type button 1855 toolbarSeriesTypeHollowCandles: "Hollow Candles", 1856 // Text for the series type toolbar's line chart type button 1857 toolbarSeriesTypeLine: "Line", 1858 // Text for the series type toolbar's line with markers chart type button 1859 toolbarSeriesTypeLineWithMarkers: "Line with Markers", 1860 // Text for the series type toolbar's line with step line chart type button 1861 toolbarSeriesTypeStepLine: "Step Line", 1862 // Text for the annotation toolbar's trend line button 1863 toolbarAnnotationsTrendLine: "Trend Line", 1864 // Text for the annotation toolbar's Fibonacci Retracement button 1865 toolbarAnnotationsFibonacciRetracement: "Fib Retracement", 1866 // Text for the annotation toolbar's horizontal line button 1867 toolbarAnnotationsHorizontalLine: "Horizontal Line", 1868 // Text for the annotation toolbar's vertical line button 1869 toolbarAnnotationsVerticalLine: "Vertical Line", 1870 // Text for the annotation toolbar's parallel channel button 1871 toolbarAnnotationsParallelChannel: "Parallel Channel", 1872 // Text for the annotation toolbar's disjoint channel button 1873 toolbarAnnotationsDisjointChannel: "Disjoint Channel", 1874 // Text for the annotation toolbar's clear all button 1875 toolbarAnnotationsClearAll: "Clear All", 1876 // Text for the annotation toolbar's fill color picker annotation button 1877 toolbarAnnotationsFillColor: "Fill Color", 1878 // Text for the annotation toolbar's line color picker annotation button 1879 toolbarAnnotationsLineColor: "Line Color", 1880 // Text for the annotation toolbar's line style type button 1881 toolbarAnnotationsLineStyle: "Line Style", 1882 // Text for the annotation toolbar's line stroke width button 1883 toolbarAnnotationsLineStrokeWidth: "Line Stroke Width", 1884 // Text for the annotation toolbar's settings annotation button 1885 toolbarAnnotationsSettings: "Settings", 1886 // Text for the annotation toolbar's text color picker annotation button 1887 toolbarAnnotationsTextColor: "Text Color", 1888 // Text for the annotation toolbar's text size picker annotation button 1889 toolbarAnnotationsTextSize: "Text Size", 1890 // Text for the annotation toolbar's lock annotation button 1891 toolbarAnnotationsLock: "Lock", 1892 // Text for the annotation toolbar's unlock annotation button 1893 toolbarAnnotationsUnlock: "Unlock", 1894 // Text for the annotation toolbar's delete annotation button 1895 toolbarAnnotationsDelete: "Delete", 1896 // Text for the annotation toolbar's drag handle 1897 toolbarAnnotationsDragHandle: "Drag Toolbar", 1898 // Text for the annotation toolbar's line drawings menu button 1899 toolbarAnnotationsLineAnnotations: "Trend Lines", 1900 // Text for the annotation toolbar's Fibonacci drawings menu button 1901 toolbarAnnotationsFibonacciAnnotations: "Fibonacci", 1902 // Text for the annotation toolbar's text annotations menu button 1903 toolbarAnnotationsTextAnnotations: "Text Annotations", 1904 // Text for the annotation toolbar's shapes menu button 1905 toolbarAnnotationsShapeAnnotations: "Arrows", 1906 // Text for the annotation toolbar's measurers menu button 1907 toolbarAnnotationsMeasurerAnnotations: "Measurers", 1908 // Text for the annotation toolbar's callout button 1909 toolbarAnnotationsCallout: "Callout", 1910 // Text for the annotation toolbar's comment button 1911 toolbarAnnotationsComment: "Comment", 1912 // Text for the annotation toolbar's note button 1913 toolbarAnnotationsNote: "Note", 1914 // Text for the annotation toolbar's text button 1915 toolbarAnnotationsText: "Text", 1916 // Text for the annotation toolbar's arrow button 1917 toolbarAnnotationsArrow: "Arrow", 1918 // Text for the annotation toolbar's arrow up button 1919 toolbarAnnotationsArrowUp: "Arrow Up", 1920 // Text for the annotation toolbar's arrow down button 1921 toolbarAnnotationsArrowDown: "Arrow Down", 1922 // Text for the annotation toolbar's date range button 1923 toolbarAnnotationsDateRange: "Date Range", 1924 // Text for the annotation toolbar's price range button 1925 toolbarAnnotationsPriceRange: "Price Range", 1926 // Text for the annotation toolbar's date and price range button 1927 toolbarAnnotationsDatePriceRange: "Date and Price", 1928 // Text for the annotation toolbar's quick date and price range button 1929 toolbarAnnotationsQuickDatePriceRange: "Measure", 1930 // Text for the range toolbar's 1 month button 1931 toolbarRange1Month: "1M",
1932 // Aria label for the range toolbar's 1 month button 1933 toolbarRange1MonthAria: "1 month", 1934 // Text for the range toolbar's 3 month button 1935 toolbarRange3Months: "3M", 1936 // Aria label for the range toolbar's 3 month button 1937 toolbarRange3MonthsAria: "3 months", 1938 // Text for the range toolbar's 6 month button 1939 toolbarRange6Months: "6M", 1940 // Aria label for the range toolbar's 6 month button 1941 toolbarRange6MonthsAria: "6 months", 1942 // Text for the range toolbar's year to date button 1943 toolbarRangeYearToDate: "YTD", 1944 // Aria label for the range toolbar's year to date month button 1945 toolbarRangeYearToDateAria: "Year to date", 1946 // Text for the range toolbar's 1 year button 1947 toolbarRange1Year: "1Y", 1948 // Aria label for the range toolbar's 1 year button 1949 toolbarRange1YearAria: "1 year", 1950 // Text for the range toolbar's full range button 1951 toolbarRangeAll: "All", 1952 // Aria label for the range toolbar's full range button 1953 toolbarRangeAllAria: "All", 1954 // Text for the zoom toolbar's zoom out button 1955 toolbarZoomZoomOut: "Zoom out", 1956 // Text for the zoom toolbar's zoom in button 1957 toolbarZoomZoomIn: "Zoom in", 1958 // Text for the zoom toolbar's pan left button 1959 toolbarZoomPanLeft: "Pan left", 1960 // Text for the zoom toolbar's pan right button 1961 toolbarZoomPanRight: "Pan right", 1962 // Text for the zoom toolbar's pan to the start button 1963 toolbarZoomPanStart: "Pan to the start", 1964 // Text for the zoom toolbar's pan to the end button 1965 toolbarZoomPanEnd: "Pan to the end", 1966 // Text for the zoom toolbar's pan reset button 1967 toolbarZoomReset: "Reset the zoom", 1968 // Text for the context menu's download button 1969 contextMenuDownload: "Download", 1970 // Text for the context menu's toggle series visibility button 1971 contextMenuToggleSeriesVisibility: "Toggle Visibility", 1972 // Text for the context menu's toggle other series visibility button 1973 contextMenuToggleOtherSeries: "Toggle Other Series", 1974 // Text for the context menu's zoom to point button 1975 contextMenuZoomToCursor: "Zoom to here", 1976 // Text for the context menu's pan to point button 1977 contextMenuPanToCursor: "Pan to here", 1978 // Text for the annotation dialog's header channel tab label 1979 dialogHeaderChannel: "Channel", 1980 // Text for the annotation dialog's header line tab label 1981 dialogHeaderLine: "Line", 1982 // Text for the annotation dialog's header fibonacci retracement line tab label 1983 dialogHeaderFibonacciRange: "Fib Retracement", 1984 // Text for the annotation dialog's header date range tab label 1985 dialogHeaderDateRange: "Date Range", 1986 // Text for the annotation dialog's header price range tab label 1987 dialogHeaderPriceRange: "Price Range", 1988 // Text for the annotation dialog's header date and price range tab label 1989 dialogHeaderDatePriceRange: "Date and Price", 1990 // Text for the annotation dialog's header text tab label 1991 dialogHeaderText: "Text", 1992 // Text for the annotation dialog's text alignment radio label 1993 dialogInputAlign: "Align", 1994 // Text for the annotation dialog's color picker label 1995 dialogInputColorPicker: "Color", 1996 // Text for the annotation dialog's color picker alt text 1997 dialogInputColorPickerAltText: "Text Color", 1998 // Text for the annotation dialog's fill color picker label 1999 dialogInputFillColorPicker: "Fill", 2000 // Text for the annotation dialog's fill color picker alt text 2001 dialogInputFillColorPickerAltText: "Fill Color", 2002 // Text for the annotation dialog's extend channel start checkbox 2003 dialogInputExtendChannelStart: "Extend channel start", 2004 // Text for the annotation dialog's extend channel end checkbox 2005 dialogInputExtendChannelEnd: "Extend channel end", 2006 // Text for the annotation dialog's extend line start checkbox 2007 dialogInputExtendLineStart: "Extend line start", 2008 // Text for the annotation dialog's extend line end checkbox 2009 dialogInputExtendLineEnd: "Extend line end", 2010 // Text for the annotation dialog's extend above checkbox 2011 dialogInputExtendAbove: "Extend above", 2012 // Text for the annotation dialog's extend below checkbox 2013 dialogInputExtendBelow: "Extend below", 2014 // Text for the annotation dialog's extend left checkbox 2015 dialogInputExtendLeft: "Extend left", 2016 // Text for the annotation dialog's extend right checkbox 2017 dialogInputExtendRight: "Extend right", 2018 // Text for the annotation dialog's reverse checkbox 2019 dialogInputReverse: "Reverse", 2020 // Text for the annotation dialog's show fill checkbox 2021 dialogInputShowFill: "Show Fill", 2022 // Text for the annotation dialog's font size select box label 2023 dialogInputFontSize: "Size", 2024 // Text for the annotation dialog's font size select box alt text 2025 dialogInputFontSizeAltText: "Font Size", 2026 // Text for the annotation dialog's line style radio label 2027 dialogInputLineStyle: "Dash", 2028 // Text for the annotation dialog's text position radio label 2029 dialogInputPosition: "Position", 2030 // Text for the annotation dialog's stroke width label 2031 dialogInputStrokeWidth: "Weight", 2032 // Text for the annotation dialog's stroke width label 2033 dialogInputStrokeWidthAltText: "Line Weight", 2034 // Text for the annotation dialog's Fibonacci bands label 2035 dialogInputFibonacciBands: "Bands", 2036 // Text for the annotation dialog's Fibonacci bands label 2037 dialogInputFibonacciBandsAltText: "Fibonacci Bands", 2038 // Text for text area input placeholders 2039 inputTextareaPlaceholder: "Add Text", 2040 // Text for the measurer statistics date range bars value 2041 measurerDateRangeBars: "${value}[number] bars", 2042 // Text for the measurer statistics price range value 2043 measurerPriceRangeValue: "${value}[number]", 2044 // Text for the measurer statistics price range percentage 2045 measurerPriceRangePercent: "${value}[percent]", 2046 // Text for the measurer statistics volume value 2047 measurerVolume: "Vol ${value}" 2048}, GL = /* @__PURE__ */ ((e) => (e.POINTER = "pointer", e.NODE = "node", e.TOP = "top", e.RIGHT = "right", e.BOTTOM = "bottom", e.LEFT = "left", e.TOP_LEFT = "top-left", e.TOP_RIGHT = "top-right", e.BOTTOM_RIGHT = "bottom-right", e.BOTTOM_LEFT = "bottom-left", e))(GL || {}), zL = {}; 2049Zo(zL, { 2050 NODE_UPDATE_STATE_TO_PHASE_MAPPING: () => Zs, 2051 fromToMotion: () => Mi, 2052 staticFromToMotion: () => Mr 2053}); 2054var ew = /* @__PURE__ */ new Map(); 2055function jW() { 2056 ew.clear(); 2057} 2058function So(e) { 2059 const t = e.constructor, i = Object.hasOwn(t, "className") ? t.className : t.name; 2060 if (!i) 2061 throw new Error(`The ${t} is missing the 'className' property.`); 2062 const s = (ew.get(i) ?? 0) + 1; 2063 return ew.set(i, s), `${i}-${s}`; 2064} 2065function $W() { 2066 return crypto.randomUUID?.() ?? YW(); 2067} 2068function YW() { 2069 const e = new Uint8Array(16); 2070 crypto.getRandomValues(e), e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128; 2071 let t = ""; 2072 for (let i = 0; i < e.length; i++) 2073 (i === 4 || i === 6 || i === 8 || i === 10) && (t += "-"), t += e[i].toString(16).padStart(2, "0"); 2074 return t; 2075} 2076function* vc(...e) { 2077 for (const t of e) 2078 yield* t; 2079} 2080function HL(e) { 2081 return e != null && typeof e == "object" && Symbol.iterator in e ? e : [e]; 2082} 2083var Tv = { containsPoint: KW, isEmpty: ZW, normalize: qW }; 2084function KW(e, t, i) { 2085 return t >= e.x && t <= e.x + e.width && i >= e.y && i <= e.y + e.height; 2086} 2087function ZW(e) { 2088 return e == null || e.height === 0 || e.width === 0 || isNaN(e.height) || isNaN(e.width); 2089} 2090function qW(e) { 2091 let { x: t, y: i, width: s, height: n } = e; 2092 return (s == null || s > 0) && (n == null || n > 0) ? e : (t != null && s != null && s < 0 && (s = -s, t = t - s), i != null && n != null && n < 0 && (n = -n, i = i
2092- n), { x: t, y: i, width: s, height: n }); 2093} 2094var Lv = /* @__PURE__ */ Symbol("interpolate"), Im = (e) => e[Lv] != null; 2095function kv(e, t, i, s = 1 / 0) { 2096 const n = { nearest: void 0, distanceSquared: s }; 2097 for (const o of i) { 2098 const r = o.distanceSquared(e, t); 2099 if (r === 0) 2100 return { nearest: o, distanceSquared: 0 }; 2101 r < n.distanceSquared && (n.nearest = o, n.distanceSquared = r); 2102 } 2103 return n; 2104} 2105function QW(e, t, i, s = 1 / 0) { 2106 const { x: n = e, y: o = t } = i.transformPoint?.(e, t) ?? {}, r = { nearest: void 0, distanceSquared: s }; 2107 for (const a of i.children) { 2108 const { nearest: l, distanceSquared: c } = a.nearestSquared(n, o, r.distanceSquared); 2109 if (c === 0) 2110 return { nearest: l, distanceSquared: c }; 2111 c < r.distanceSquared && (r.nearest = l, r.distanceSquared = c); 2112 } 2113 return r; 2114} 2115function ot(e, t, i) { 2116 return Math.min(i, Math.max(e, t)); 2117} 2118function tw(e, t) { 2119 const [i, s] = Ds(t); 2120 return ot(i, e, s); 2121} 2122function Ds(e) { 2123 if (e.length === 0) 2124 return []; 2125 const t = [1 / 0, -1 / 0]; 2126 for (const i of e) 2127 i < t[0] && (t[0] = i), i > t[1] && (t[1] = i); 2128 return t; 2129} 2130function wp(e) { 2131 const [t, i] = Ds(e); 2132 return i - t; 2133} 2134function VL(e, t, i = 1e-10) { 2135 return e >= t[0] - i && e <= t[1] + i; 2136} 2137function Qh(e, t, i = 1e-10) { 2138 return Math.abs(e - t) < i; 2139} 2140function Pv(e) { 2141 return Math.sign(e) === -1 || Object.is(e, -0); 2142} 2143function UL(e) { 2144 return e % 1 === 0; 2145} 2146function RS(e, t = 2) { 2147 const i = 10 ** t; 2148 return Math.round(e * i) / i; 2149} 2150function TS(e, t) { 2151 return Math.floor(e % t + (e < 0 ? t : 0)); 2152} 2153function Fv(e) { 2154 if (Math.floor(e) === e) 2155 return 0; 2156 let t = String(e), i = 0; 2157 if (e < 1e-6 || e >= 1e21) { 2158 let n; 2159 [t, n] = t.split("e"), n != null && (i = Number(n)); 2160 } 2161 const s = t.split(".")[1]?.length ?? 0; 2162 return Math.max(s - i, 0); 2163} 2164var Sp = class Pu { 2165 constructor(t, i, s, n) { 2166 this.x = t, this.y = i, this.width = s, this.height = n; 2167 } 2168 static fromDOMRect({ x: t, y: i, width: s, height: n }) { 2169 return new Pu(t, i, s, n); 2170 } 2171 static merge(t) { 2172 let i = 1 / 0, s = 1 / 0, n = -1 / 0, o = -1 / 0; 2173 for (const r of t) 2174 r.x < i && (i = r.x), r.y < s && (s = r.y), r.x + r.width > n && (n = r.x + r.width), r.y + r.height > o && (o = r.y + r.height); 2175 return new Pu(i, s, n - i, o - s); 2176 } 2177 static nearestBox(t, i, s) { 2178 return kv(t, i, s); 2179 } 2180 toDOMRect() { 2181 return { 2182 x: this.x, 2183 y: this.y, 2184 width: this.width, 2185 height: this.height, 2186 top: this.y, 2187 left: this.x, 2188 right: this.x + this.width, 2189 bottom: this.y + this.height, 2190 toJSON() { 2191 return {}; 2192 } 2193 }; 2194 } 2195 clone() { 2196 const { x: t, y: i, width: s, height: n } = this; 2197 return new Pu(t, i, s, n); 2198 } 2199 equals(t) { 2200 return this.x === t.x && this.y === t.y && this.width === t.width && this.height === t.height; 2201 } 2202 containsPoint(t, i) { 2203 return Tv.containsPoint(this, t, i); 2204 } 2205 containsBBox(t) { 2206 const [i, s] = [this.x, this.x + this.width], [n, o] = [this.y, this.y + this.height], [r, a] = [t.x, t.x + t.width], [l, c] = [t.y, t.y + t.height]; 2207 return Math.min(i, r) === i && Math.max(s, a) === s && Math.min(n, l) === n && Math.max(o, c) === o; 2208 } 2209 intersection(t) { 2210 if (!this.collidesBBox(t)) 2211 return; 2212 const i = ot(t.x, this.x, t.x + t.width), s = ot(t.y, this.y, t.y + t.height), n = ot(t.x, this.x + this.width, t.x + t.width), o = ot(t.y, this.y + this.height, t.y + t.height); 2213 return new Pu(i, s, n - i, o - s); 2214 } 2215 collidesBBox(t) { 2216 return this.x < t.x + t.width && this.x + this.width > t.x && this.y < t.y + t.height && this.y + this.height > t.y; 2217 } 2218 computeCenter() { 2219 return { x: this.x + this.width / 2, y: this.y + this.height / 2 }; 2220 } 2221 isFinite() { 2222 return Number.isFinite(this.x) && Number.isFinite(this.y) && Number.isFinite(this.width) && Number.isFinite(this.height); 2223 } 2224 distanceSquared(t, i) { 2225 if (this.containsPoint(t, i)) 2226 return 0; 2227 const s = t - ot(this.x, t, this.x + this.width), n = i - ot(this.y, i, this.y + this.height); 2228 return s * s + n * n; 2229 } 2230 shrink(t, i) { 2231 if (typeof t == "number") 2232 this.applyMargin(t, i); 2233 else 2234 for (const [s, n] of Object.entries(t)) 2235 this.applyMargin(n, s); 2236 return this.width < 0 && (this.width = 0), this.height < 0 && (this.height = 0), this; 2237 } 2238 grow(t, i) { 2239 if (typeof t == "number") 2240 this.applyMargin(-t, i); 2241 else 2242 for (const [s, n] of Object.entries(t)) 2243 this.applyMargin(-n, s); 2244 return this; 2245 } 2246 applyMargin(t, i) { 2247 switch (i) { 2248 case "top": 2249 this.y += t; 2250 case "bottom": 2251 this.height -= t; 2252 break;
2253 case "left": 2254 this.x += t; 2255 case "right": 2256 this.width -= t; 2257 break; 2258 case "vertical": 2259 this.y += t, this.height -= t * 2; 2260 break; 2261 case "horizontal": 2262 this.x += t, this.width -= t * 2; 2263 break; 2264 case void 0: 2265 this.x += t, this.y += t, this.width -= t * 2, this.height -= t * 2; 2266 break; 2267 } 2268 } 2269 translate(t, i) { 2270 return this.x += t, this.y += i, this; 2271 } 2272 combine(t) { 2273 const { x: i, y: s, width: n, height: o } = this; 2274 this.x = Math.min(i, t.x), this.y = Math.min(s, t.y), this.width = Math.max(i + n, t.x + t.width) - this.x, this.height = Math.max(s + o, t.y + t.height) - this.y; 2275 } 2276 [Lv](t, i) { 2277 return new Pu( 2278 this.x * (1 - i) + t.x * i, 2279 this.y * (1 - i) + t.y * i, 2280 this.width * (1 - i) + t.width * i, 2281 this.height * (1 - i) + t.height * i 2282 ); 2283 } 2284}; 2285Sp.zero = Object.freeze(new Sp(0, 0, 0, 0)); 2286Sp.NaN = Object.freeze(new Sp(NaN, NaN, NaN, NaN)); 2287var _e = Sp; 2288function Ge(e) { 2289 return function(t, i) { 2290 const s = `__${i}`; 2291 t[i] || XW(t, i, s, e); 2292 }; 2293} 2294function XW(e, t, i, s) { 2295 const { type: n = "normal", changeCb: o, convertor: r, checkDirtyOnAssignment: a = !1 } = s ?? {}, l = { changeCb: o, checkDirtyOnAssignment: a, convertor: r }; 2296 let c; 2297 switch (n) { 2298 case "normal": 2299 c = i8(i, l); 2300 break; 2301 case "transform": 2302 c = s8(i); 2303 break; 2304 case "path": 2305 c = n8(i); 2306 break; 2307 } 2308 c = t8( 2309 e8(JW(c, l), l), 2310 l 2311 ), Object.defineProperty(e, t, { 2312 set: c, 2313 get: function() { 2314 return this[i]; 2315 }, 2316 enumerable: !0, 2317 configurable: !0 2318 }); 2319} 2320function JW(e, t) { 2321 const { convertor: i } = t; 2322 return i ? function(s) { 2323 e.call(this, i(s)); 2324 } : e; 2325} 2326var ng = /* @__PURE__ */ Symbol("no-change"); 2327function e8(e, t) { 2328 const { changeCb: i } = t; 2329 return i ? function(s) { 2330 const n = e.call(this, s); 2331 return n !== ng && i.call(this, this), n; 2332 } : e; 2333} 2334function t8(e, t) { 2335 const { checkDirtyOnAssignment: i } = t; 2336 return i ? function(s) { 2337 const n = e.call(this, s); 2338 return n !== ng && s?._dirty === !0 && this.markDirty(), n; 2339 } : e; 2340} 2341function i8(e, t) { 2342 const { changeCb: i } = t; 2343 return function(s) { 2344 const n = this[e]; 2345 return s !== n ? (this[e] = s, this.markDirty(), i?.(this), s) : ng; 2346 }; 2347} 2348function s8(e) { 2349 return function(t) { 2350 const i = this[e]; 2351 return t !== i ? (this[e] = t, this.markDirtyTransform(), t) : ng; 2352 }; 2353} 2354function n8(e) { 2355 return function(t) { 2356 const i = this[e]; 2357 return t !== i ? (this[e] = t, this._dirtyPath || (this._dirtyPath = !0, this.markDirty()), t) : ng; 2358 }; 2359} 2360var WL = /* @__PURE__ */ ((e) => (e[e.All = 0] = "All", e[e.None = 1] = "None", e))(WL || {}), Ov = class jL { 2361 constructor(t) { 2362 this.serialNumber = jL._nextSerialNumber++, this.childNodeCounts = { groups: 0, nonGroups: 0, thisComplexity: 0, complexity: 0 }, this.id = So(this), this.pointerEvents = 0, this._dirty = !0, this.dirtyZIndex = !1, this.isContainerNode = !1, this.visible = !0, this.zIndex = 0, this.name = t?.name, this.tag = t?.tag ?? NaN, this.zIndex = t?.zIndex ?? 0; 2363 } 2364 static toSVG(t, i, s) { 2365 const n = t?.toSVG(); 2366 if (n == null || !n.elements.length && !n.defs?.length) 2367 return; 2368 const o = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 2369 if (o.setAttribute("width", String(i)), o.setAttribute("height", String(s)), o.setAttribute("viewBox", `0 0 ${i} ${s}`), n.defs?.length) { 2370 const r = document.createElementNS("http://www.w3.org/2000/svg", "def
2370s"); 2371 r.append(...n.defs), o.append(r); 2372 } 2373 return o.append(...n.elements), o.outerHTML; 2374 } 2375 static *extractBBoxes(t, i) { 2376 for (const s of t) 2377 if (!i || s.visible && !s.transitionOut) { 2378 const n = s.getBBox(); 2379 n && (yield n); 2380 } 2381 } 2382 /** 2383 * Some arbitrary data bound to the node. 2384 */ 2385 get datum() { 2386 return this._datum ?? this.parentNode?.datum; 2387 } 2388 set datum(t) { 2389 this._datum !== t && (this._previousDatum = this._datum, this._datum = t); 2390 } 2391 get previousDatum() { 2392 return this._previousDatum; 2393 } 2394 get layerManager() { 2395 return this._layerManager; 2396 } 2397 get dirty() { 2398 return this._dirty; 2399 } 2400 /** Perform any pre-rendering initialization. */ 2401 preRender(t = 1) { 2402 this.childNodeCounts.groups = 0, this.childNodeCounts.nonGroups = 1, this.childNodeCounts.complexity = t, this.childNodeCounts.thisComplexity = t; 2403 for (const i of this.children()) { 2404 const s = i.preRender(); 2405 this.childNodeCounts.groups += s.groups, this.childNodeCounts.nonGroups += s.nonGroups, this.childNodeCounts.complexity += s.complexity; 2406 } 2407 return this.childNodeCounts; 2408 } 2409 render(t) { 2410 const { stats: i } = t; 2411 if (this._dirty = !1, t.debugNodeSearch) { 2412 const s = this.name ?? this.id; 2413 t.debugNodeSearch.some((n) => typeof n == "string" ? n === s : n.test(s)) && (t.debugNodes[this.name ?? this.id] = this); 2414 } 2415 i && (i.nodesRendered++, i.opsPerformed += this.childNodeCounts.thisComplexity); 2416 } 2417 _setLayerManager(t) { 2418 this._layerManager = t, this._debug = t?.debug; 2419 for (const i of this.children()) 2420 i._setLayerManager(t); 2421 } 2422 sortChildren(t) { 2423 if (this.dirtyZIndex = !1, !this.childNodes) 2424 return; 2425 const i = [...this.childNodes].sort(t); 2426 this.childNodes.clear(); 2427 for (const s of i) 2428 this.childNodes.add(s); 2429 } 2430 *traverseUp(t) { 2431 let i = this; 2432 for (t && (yield i); i = i.parentNode; ) 2433 yield i; 2434 } 2435 *children() { 2436 if (this.childNodes) 2437 for (const t of this.childNodes) 2438 yield t; 2439 } 2440 /** 2441 * Checks if the node is a leaf (has no children). 2442 */ 2443 isLeaf() { 2444 return !this.childNodes?.size; 2445 } 2446 /** 2447 * Checks if the node is the root (has no parent). 2448 */ 2449 isRoot() { 2450 return !this.parentNode; 2451 } 2452 /** 2453 * Appends one or more new node instances to this parent. 2454 * If one needs to: 2455 * - move a child to the end of the list of children 2456 * - move a child from one parent to another (including parents in other scenes) 2457 * one should use the {@link insertBefore} method instead. 2458 * @param nodes A node or nodes to append. 2459 */ 2460 append(t) { 2461 this.childNodes ?? (this.childNodes = /* @__PURE__ */ new Set()); 2462 for (const i of HL(t)) 2463 i.parentNode?.removeChild(i), this.childNodes.add(i), i.parentNode = this, i._setLayerManager(this.layerManager); 2464 this.invalidateCachedBBox(), this.dirtyZIndex = !0, this.markDirty(); 2465 } 2466 appendChild(t) { 2467 return this.append(t), t; 2468 } 2469 removeChild(t) { 2470 return this.childNodes?.delete(t) ? (delete t.parentNode, t._setLayerManager(), this.invalidateCachedBBox(), this.dirtyZIndex = !0, this.markDirty(), !0) : !1; 2471 } 2472 remove() { 2473 return this.parentNode?.removeChild(this) ?? !1; 2474 } 2475 clear() { 2476 for (const t of this.children()) 2477 delete t.parentNode, t._setLayerManager(); 2478 this.childNodes?.clear(), this.invalidateCachedBBox(); 2479 } 2480 destroy() { 2481 this.parentNode?.removeChild(this); 2482 } 2483 setProperties(t, i) { 2484 if (i) 2485 for (const s of i) 2486 this[s] = t[s]; 2487 else 2488 Object.assign(this, t); 2489 return this; 2490 } 2491 containsPoint(t, i) { 2492 return !1; 2493 } 2494 /** 2495 * Hit testing method. 2496 * Recursively checks if the given point is inside this node or any of its children. 2497 * Returns the first matching node or `undefined`. 2498 * Nodes that render later (show on top) are hit tested first. 2499 */ 2500 pickNode(t, i, s = !1) { 2501 if (!this.visible || this.pointerEvents === 1 || !this.containsPoint(t, i)) 2502 return; 2503 const n = [...this.children()]; 2504 if (n.length > 1e3) 2505 for (let o = n.length - 1; o >= 0; o--) { 2506 const r = n[o], l = r.containsPoint(t, i) ? r.pickNode(t, i) : void 0; 2507 if (l) 2508 return l; 2509 } 2510 else if (n.length) 2511 for (let o = n.length - 1; o >= 0; o--) { 2512 const r = n[o].pickNode(t, i); 2513 if (r) 2514 return r; 2515 } 2516 else if (!this.isContainerNode) 2517 return this; 2518 } 2519 invalidateCachedBBox() { 2520 this.cachedBBox != null && (this.cachedBBox = void 0, this.parentNode?.invali
2520dateCachedBBox()); 2521 } 2522 getBBox() { 2523 return this.cachedBBox == null && (this.cachedBBox = Object.freeze(this.computeBBox())), this.cachedBBox; 2524 } 2525 computeBBox() { 2526 } 2527 markDirty() { 2528 const { _dirty: t } = this; 2529 this.cachedBBox == null && t || (this.invalidateCachedBBox(), this._dirty = !0, this.parentNode && this.parentNode.markDirty()); 2530 } 2531 markClean() { 2532 if (this._dirty) { 2533 this._dirty = !1; 2534 for (const t of this.children()) 2535 t.markClean(); 2536 } 2537 } 2538 onZIndexChange() { 2539 const { parentNode: t } = this; 2540 t && (t.dirtyZIndex = !0); 2541 } 2542 toSVG() { 2543 } 2544}; 2545Ov._nextSerialNumber = 0; 2546S([ 2547 Ge() 2548], Ov.prototype, "visible", 2); 2549S([ 2550 Ge({ 2551 changeCb: (e) => e.onZIndexChange() 2552 }) 2553], Ov.prototype, "zIndex", 2); 2554var wl = Ov, Mf = (e, t, i) => e * (1 - i) + t * i, Gb = (e) => { 2555 const t = e < 0 ? -1 : 1, i = Math.abs(e); 2556 return i <= 0.04045 ? e / 12.92 : t * ((i + 0.055) / 1.055) ** 2.4; 2557}, zb = (e) => { 2558 const t = e < 0 ? -1 : 1, i = Math.abs(e); 2559 return i > 31308e-7 ? t * (1.055 * i ** (1 / 2.4) - 0.055) : 12.92 * e; 2560}, $L = class ei { 2561 /** 2562 * Every color component should be in the [0, 1] range. 2563 * Some easing functions (such as elastic easing) can overshoot the target value by some amount. 2564 * So, when animating colors, if the source or target color components are already near 2565 * or at the edge of the allowed [0, 1] range, it is possible for the intermediate color 2566 * component value to end up outside of that range mid-animation. For this reason the constructor 2567 * performs range checking/constraining. 2568 * @param r Red component. 2569 * @param g Green component. 2570 * @param b Blue component. 2571 * @param a Alpha (opacity) component. 2572 */ 2573 constructor(t, i, s, n = 1) { 2574 this.r = ot(0, t || 0, 1), this.g = ot(0, i || 0, 1), this.b = ot(0, s || 0, 1), this.a = ot(0, n || 0, 1); 2575 } 2576 /** 2577 * A color string can be in one of the following formats to be valid: 2578 * - #rgb 2579 * - #rrggbb 2580 * - rgb(r, g, b) 2581 * - rgba(r, g, b, a) 2582 * - CSS color name such as 'white', 'orange', 'cyan', etc. 2583 */ 2584 static validColorString(t) { 2585 return t.indexOf("#") >= 0 ? !!ei.parseHex(t) : t.indexOf("rgb") >= 0 ? !!ei.stringToRgba(t) : !!ei.nameToHex.has(t.toLowerCase()); 2586 } 2587 /** 2588 * The given string can be in one of the following formats: 2589 * - #rgb 2590 * - #rrggbb 2591 * - rgb(r, g, b) 2592 * - rgba(r, g, b, a) 2593 * - CSS color name such as 'white', 'orange', 'cyan', etc. 2594 * @param str 2595 */ 2596 static fromString(t) { 2597 if (t.indexOf("#") >= 0) 2598 return ei.fromHexString(t); 2599 const i = ei.nameToHex.get(t.toLowerCase()); 2600 if (i) 2601 return ei.fromHexString(i); 2602 if (t.indexOf("rgb") >= 0) 2603 return ei.fromRgbaString(t); 2604 throw new Error(`Invalid color string: '${t}'`); 2605 } 2606 // See https://drafts.csswg.org/css-color/#hex-notation 2607 static parseHex(t) { 2608 t = t.replace(/ /g, "").slice(1); 2609 let i; 2610 switch (t.length) { 2611 case 6: 2612 case 8: 2613 i = []; 2614 for (let s = 0; s < t.length; s += 2) 2615 i.push(parseInt(`${t[s]}${t[s + 1]}`, 16)); 2616 break; 2617 case 3: 2618 case 4: 2619 i = t.split("").map((s) => parseInt(s, 16)).map((s) => s + s * 16); 2620 break; 2621 } 2622 if (i?.length >= 3 && i.every((s) => s >= 0)) 2623 return i.length === 3 && i.push(255), i; 2624 } 2625 static fromHexString(t) { 2626 const i = ei.parseHex(t); 2627 if (i) { 2628 const [s, n, o, r] = i; 2629 return new ei(s / 255, n / 255, o / 255, r / 255); 2630 } 2631 throw new Error(`Malformed hexadecimal color string: '${t}'`); 2632 } 2633 static stringToRgba(t) { 2634 let i = -1, s = -1; 2635 for (let a = 0; a < t.length; a++) { 2636 const l = t[a]; 2637 if (i === -1 && l === "(") 2638 i = a; 2639 else if (l === ")") { 2640 s = a; 2641 break; 2642 } 2643 } 2644 if (i === -1 || s === -1) 2645 return; 2646 const o = t.substring(i + 1, s).split(","), r = []; 2647 for (let a = 0; a < o.length; a++) { 2648 const l = o[a]; 2649 let c = parseFloat(l); 2650 if (!Number.isFinite(c)) 2651 return; 2652 l.indexOf("%") >= 0 ? (c = ot(0, c, 100), c /= 100) : a === 3 ? c = ot(0, c, 1) : (c = ot(0, c, 255), c /= 255), r.push(c); 2653 } 2654 return r; 2655 } 2656 static fromRgbaString(t) { 2657 const i = ei.stringToRgba(t); 2658 if (i) { 2659 if (i.length === 3) 2660 return new ei(i[0], i[1], i[2]); 2661 if (i.length === 4) 2662 return new ei(i[0], i[1], i[2], i[3]); 2663 } 2664 throw new Error(`Malformed rgb/rgba color string: '${t}'`); 2665 } 2666 static fromArray(t) { 2667 if (t.length === 4) 2668 return new ei(t[0], t[1], t[2], t[3]); 2669 if (t.length === 3) 2670 return new ei(t[0], t[1], t[2]); 2671 throw new Error("The given array should contain 3 or 4 color components (numbers)."); 2672 } 2673 static fromHSB(t, i, s, n = 1) { 2674 const o = ei.HSBtoRGB(t, i, s); 2675 return new ei(o[0], o[1], o[2], n); 2676 } 2677 static fromHSL(t, i, s, n = 1) { 2678 const o = ei.HSLtoRGB(t, i, s); 2679 return new ei(o[0], o[1], o[2], n); 2680 } 2681 static fromOKLCH(t, i, s, n = 1) { 2682 const o = ei.OKLCHtoRGB(t, i, s); 2683 return new ei(o[0], o[1], o[2], n); 2684 } 2685 static padHex(t) { 2686 return t.length === 1 ? "0" + t : t; 2687 } 2688 toHexString() { 2689 let t = "#" + ei.padHex(Math.round(this.r * 255).toString(16)) + ei.padHex(Math.round(this.g * 255).toString(16)) + ei.padHex(Math.round(this.b * 255).toString(16)); 2690 return this.a < 1 && (t += ei.padHex(Math.round(this.a * 255).toString(16))), t; 2691 } 2692 toRgbaString(t = 3) { 2693 const i = [Math.round(this.r * 255), Math.round(this.g * 255), Math.round(this.b * 255)], s = Math.pow(10, t); 2694 return this.a !== 1 ? (i.push(Math.round(this.a * s) / s), `rgba(${i.join(", ")})`) : `rgb(${i.join(", ")})`; 2695 } 2696 toString() { 2697 return this.a === 1 ? this.toHexString() : this.toRgbaString(); 2698 } 2699 toHSB() { 2700 return ei.RGBtoHSB(this.r, this.g, this.b); 2701 } 2702 static RGBtoOKLCH(t, i, s) { 2703 const n = Gb(t), o = Gb(i), r = Gb(s), a = Math.cbrt(0.4122214708 * n + 0.5363325363 * o + 0.0514459929 * r), l = Math.
2703cbrt(0.2119034982 * n + 0.6806995451 * o + 0.1073969566 * r), c = Math.cbrt(0.0883024619 * n + 0.2817188376 * o + 0.6299787005 * r), u = 0.2104542553 * a + 0.793617785 * l - 0.0040720468 * c, d = 1.9779984951 * a - 2.428592205 * l + 0.4505937099 * c, p = 0.0259040371 * a + 0.7827717662 * l - 0.808675766 * c, f = Math.atan2(p, d) * 180 / Math.PI, m = u, y = Math.hypot(d, p), b = f >= 0 ? f : f + 360; 2704 return [m, y, b]; 2705 } 2706 static OKLCHtoRGB(t, i, s) { 2707 const n = t, o = i * Math.cos(s * Math.PI / 180), r = i * Math.sin(s * Math.PI / 180), a = (n + 0.3963377774 * o + 0.2158037573 * r) ** 3, l = (n - 0.1055613458 * o - 0.0638541728 * r) ** 3, c = (n - 0.0894841775 * o - 1.291485548 * r) ** 3, u = 4.0767416621 * a - 3.3077115913 * l + 0.2309699292 * c, d = -1.2684380046 * a + 2.6097574011 * l - 0.3413193965 * c, p = -0.0041960863 * a - 0.7034186147 * l + 1.707614701 * c, f = zb(u), m = zb(d), y = zb(p); 2708 return [f, m, y]; 2709 } 2710 static RGBtoHSL(t, i, s) { 2711 const n = Math.min(t, i, s), o = Math.max(t, i, s), r = (o + n) / 2; 2712 let a, l; 2713 if (o === n) 2714 a = 0, l = 0; 2715 else { 2716 const c = o - n; 2717 l = r > 0.5 ? c / (2 - o - n) : c / (o + n), o === t ? a = (i - s) / c + (i < s ? 6 : 0) : o === i ? a = (s - t) / c + 2 : a = (t - i) / c + 4, a *= 360 / 6; 2718 } 2719 return [a, l, r]; 2720 } 2721 static HSLtoRGB(t, i, s) { 2722 if (t = (t % 360 + 360) % 360, i === 0) 2723 return [s, s, s]; 2724 const n = s < 0.5 ? s * (1 + i) : s + i - s * i, o = 2 * s - n; 2725 function r(u) { 2726 return u < 0 && (u += 1), u > 1 && (u -= 1), u < 1 / 6 ? o + (n - o) * 6 * u : u < 1 / 2 ? n : u < 2 / 3 ? o + (n - o) * (2 / 3 - u) * 6 : o; 2727 } 2728 const a = r(t / 360 + 1 / 3), l = r(t / 360), c = r(t / 360 - 1 / 3); 2729 return [a, l, c]; 2730 } 2731 /** 2732 * Converts the given RGB triple to an array of HSB (HSV) components. 2733 */ 2734 static RGBtoHSB(t, i, s) { 2735 const n = Math.min(t, i, s), o = Math.max(t, i, s), r = o === 0 ? 0 : (o - n) / o; 2736 let a = 0; 2737 if (n !== o) { 2738 const l = o - n, c = (o - t) / l, u = (o - i) / l, d = (o - s) / l; 2739 t === o ? a = d - u : i === o ? a = 2 + c - d : a = 4 + u - c, a /= 6, a < 0 && (a = a + 1); 2740 } 2741 return [a * 360, r, o]; 2742 } 2743 /** 2744 * Converts the given HSB (HSV) triple to an array of RGB components. 2745 */ 2746 static HSBtoRGB(t, i, s) { 2747 t = (t % 360 + 360) % 360 / 360; 2748 let n = 0, o = 0, r = 0; 2749 if (i === 0) 2750 n = o = r = s; 2751 else { 2752 const a = (t - Math.floor(t)) * 6, l = a - Math.floor(a), c = s * (1 - i), u = s * (1 - i * l), d = s * (1 - i * (1 - l)); 2753 switch (a >> 0) { 2754 case 0: 2755 n = s, o = d, r = c; 2756 break; 2757 case 1: 2758 n = u, o = s, r = c; 2759 break; 2760 case 2: 2761 n = c, o = s, r = d; 2762 break; 2763 case 3: 2764 n = c, o = u, r = s; 2765 break; 2766 case 4: 2767 n = d, o = c, r = s; 2768 break; 2769 case 5: 2770 n = s, o = c, r = u; 2771 break; 2772 } 2773 } 2774 return [n, o, r]; 2775 } 2776 static mix(t, i, s) { 2777 return new ei(Mf(t.r, i.r, s), Mf(t.g, i.g, s), Mf(t.b, i.b, s), Mf(t.a, i.a, s)); 2778 } 2779}; 2780$L.nameToHex = /* @__PURE__ */ new Map([ 2781 ["aliceblue", "#F0F8FF"], 2782 ["antiquewhite", "#FAEBD7"], 2783 ["aqua", "#00FFFF"], 2784 ["aquamarine", "#7FFFD4"], 2785 ["azure", "#F0FFFF"], 2786 ["beige", "#F5F5DC"], 2787 ["bisque", "#FFE4C4"], 2788 ["black", "#000000"], 2789 ["blanchedalmond", "#FFEBCD"], 2790 ["blue", "#0000FF"], 2791 ["blueviolet", "#8A2BE2"], 2792 ["brown", "#A52A2A"], 2793 ["burlywood", "#DEB887"], 2794 ["cadetblue", "#5F9EA0"], 2795 ["chartreuse", "#7FFF00"], 2796 ["chocolate", "#D2691E"], 2797 ["coral", "#FF7F50"], 2798 ["cornflowerblue", "#6495ED"], 2799 ["cornsilk", "#FFF8DC"], 2800 ["crimson", "#DC143C"], 2801 ["cyan", "#00FFFF"], 2802 ["darkblue", "#00008B"], 2803 ["darkcyan", "#008B8B"], 2804 ["darkgoldenrod", "#B8860B"], 2805 ["darkgray", "#A9A9A9"], 2806 ["darkgreen", "#006400"], 2807 ["darkgrey", "#A9A9A9"], 2808 ["darkkhaki", "#BDB76B"], 2809 ["darkmagenta", "#8B008B"], 2810 ["darkolivegreen", "#556B2F"], 2811 ["darkorange", "#FF8C00"], 2812 ["darkorchid", "#9932CC"], 2813 ["darkred", "#8B0000"], 2814 ["darksalmon", "#E9967A"], 2815 ["darkseagreen", "#8FBC8F"], 2816 ["darkslateblue", "#483D8B"], 2817 ["darkslategray", "#2F4F4F"], 2818 ["darkslategrey", "#2F4F4F"], 2819 ["darkturquoise", "#00CED1"], 2820 ["darkviolet", "#9400D3"], 2821 ["deeppink", "#FF1493"], 2822 ["deepskyblue", "#00BFFF"], 2823 ["dimgray", "#696969"], 2824 ["dimgrey", "#696969"], 2825 ["dodgerblue", "#1E90FF"], 2826 ["firebrick", "#B22222"], 2827 ["floralwhite", "#FFFAF0"], 2828 ["forestgreen", "#228B22"], 2829 ["fuchsia", "#FF00FF"], 2830 ["gainsboro", "#DCDCDC"], 2831 ["ghostwhite", "#F8F8FF"], 2832 ["gold", "#FFD700"], 2833 ["goldenrod", "#DAA520"], 2834 ["gray", "#808080"], 2835 ["green", "#008000"], 2836 ["greenyellow", "#ADFF2F"], 2837 ["grey", "#808080"], 2838 ["honeydew", "#F0FFF0"], 2839 ["hotpink", "#FF69B4"], 2840 ["indianred", "#CD5C5C"], 2841 ["indigo", "#4B0082"], 2842 ["ivory", "#FFFFF0"], 2843 ["khaki", "#F0E68C"], 2844 ["lavender", "#E6E6FA"], 2845 ["lavenderblush", "#FFF0F5"], 2846 ["lawngreen", "#7CFC00"], 2847 ["lemonchiffon", "#FFFACD"], 2848 ["lightblue", "#ADD8E6"], 2849 ["lightcoral", "#F08080"], 2850 ["lightcyan", "#E0FFFF"], 2851 ["lightgoldenrodyellow", "#FAFAD2"], 2852 ["lightgray", "#D3D3D3"], 2853 ["lightgreen", "#90EE90"], 2854 ["lightgrey", "#D3D3D3"], 2855 ["lightpink", "#FFB6C1"], 2856 ["lightsalmon", "#FFA07A"], 2857 ["lightseagreen", "#20B2AA"], 2858 ["lightskyblue", "#87CEFA"], 2859 ["lightslategray", "#778899"], 2860 ["lightslategrey", "#778899"], 2861 ["lightsteelblue", "#B0C4DE"], 2862 ["lightyellow", "#FFFFE0"], 2863 ["lime", "#00FF00"], 2864 ["limegreen", "#32CD32"], 2865 ["linen", "#FAF0E6"], 2866 ["magenta", "#FF00FF"], 2867 ["maroon", "#800000"], 2868 ["mediumaquamarine", "#66CDAA"], 2869 ["mediumblue", "#0000CD"], 2870 ["mediumorchid", "#BA55D3"], 2871 ["mediumpurple", "#9370DB"], 2872 ["mediumseagreen", "#3CB371"], 2873 ["mediumslateblue", "#7B68EE"], 2874 ["mediumspringgreen", "#00FA9A"], 2875 ["mediumturquoise", "#48D1CC"], 2876 ["mediumvioletred", "#C71585"], 2877 ["midnightblue", "#191970"], 2878 ["mintcream", "#F5FFFA"], 2879 ["mistyrose", "#FFE4E1"], 2880 ["moccasin", "#FFE4B5"], 2881 ["navajowhite", "#FFDEAD"], 2882 ["navy", "#000080"], 2883 ["oldlace", "#FDF5E6"], 2884 ["olive", "#808000"], 2885 ["olivedrab", "#6B8E23"], 2886 ["orange", "#FFA500"], 2887 ["orangered", "#FF4500"], 2888 ["orchid", "#DA70D6"], 2889 ["palegoldenrod", "#EEE8AA"], 2890 ["palegreen", "#98FB98"], 2891 ["paleturquoise", "#AFEEEE"], 2892 ["palevioletred", "#DB7093"], 2893 ["papayawhip", "#FFEFD5"], 2894 ["peachpuff", "#FFDAB9"], 2895 ["peru", "#CD853F"], 2896 ["pink", "#FFC0CB"], 2897 ["plum", "#DDA0DD"], 2898 ["powderblue", "#B0E0E6"], 2899 ["purple", "#800080"], 2900 ["rebeccapurple", "#663399"], 2901 ["red", "#FF0000"], 2902 ["rosybrown", "#BC8F8F"], 2903 ["royalblue", "#4169E1"], 2904 ["saddlebrown", "#8B4513"], 2905 ["salmon", "#FA8072"], 2906 ["sandybrown", "#F4A460"], 2907 ["seagreen", "#2E8B57"], 2908 ["seashell", "#FFF5EE"], 2909 ["sienna", "#A0522D"], 2910 ["silver", "#C0C0C0"], 2911 ["skyblue", "#87CEEB"], 2912 ["slateblue", "#6A5ACD"], 2913 ["slategray", "#708090"], 2914 ["slategrey", "#708090"], 2915 ["snow", "#FFFAFA"], 2916 ["springgreen", "#00FF7F"], 2917 ["steelblue", "#4682B4"], 2918 ["tan", "#D2B48C"], 2919 ["teal", "#008080"], 2920 ["thistle", "#D8BFD8"], 2921 ["tomato", "#FF6347"], 2922 ["transparent", "#00000000"], 2923 ["turquoise", "#40E0D0"], 2924 ["violet", "#EE82EE"],
2925 ["wheat", "#F5DEB3"], 2926 ["white", "#FFFFFF"], 2927 ["whitesmoke", "#F5F5F5"], 2928 ["yellow", "#FFFF00"], 2929 ["yellowgreen", "#9ACD32"] 2930]); 2931var Bo = $L; 2932function o8(e, t) { 2933 return (i) => Number(e) * (1 - i) + Number(t) * i; 2934} 2935function YL(e, t) { 2936 if (typeof e == "string") 2937 try { 2938 e = Bo.fromString(e); 2939 } catch { 2940 e = Bo.fromArray([0, 0, 0]); 2941 } 2942 if (typeof t == "string") 2943 try { 2944 t = Bo.fromString(t); 2945 } catch { 2946 t = Bo.fromArray([0, 0, 0]); 2947 } 2948 return (i) => Bo.mix(e, t, i).toRgbaString(); 2949} 2950var Rm = /* @__PURE__ */ Symbol("BREAK"), Ju = "__decorator_config"; 2951function KL(e, t) { 2952 Object.getOwnPropertyDescriptor(e, Ju) == null && Object.defineProperty(e, Ju, { value: {} }); 2953 const i = e[Ju], s = t.toString(); 2954 if (typeof i[s] < "u") 2955 return i[s]; 2956 const n = /* @__PURE__ */ new WeakMap(); 2957 i[s] = { setters: [], getters: [], observers: [], valuesMap: n }; 2958 const o = Object.getOwnPropertyDescriptor(e, t), r = o?.set, a = o?.get; 2959 return Object.defineProperty(e, t, { 2960 set: function(u) { 2961 const { setters: d, observers: p } = i[s]; 2962 let f; 2963 d.some((m) => m.length > 2) && (f = a ? a.call(this) : n.get(this)); 2964 for (const m of d) 2965 if (u = m(this, t, u, f), u === Rm) 2966 return; 2967 r ? r.call(this, u) : n.set(this, u); 2968 for (const m of p) 2969 m(this, u, f); 2970 }, 2971 get: function() { 2972 let u = a ? a.call(this) : n.get(this); 2973 for (const d of i[s].getters) 2974 if (u = d(this, t, u), u === Rm) 2975 return; 2976 return u; 2977 }, 2978 enumerable: !0, 2979 configurable: !1 2980 }), i[s]; 2981} 2982function ha(e, t, i) { 2983 return (s, n) => { 2984 const o = KL(s, n); 2985 o.setters.push(e), t && o.getters.unshift(t), i && Object.assign(o, i); 2986 }; 2987} 2988function ZL(e) { 2989 return (t, i) => { 2990 KL(t, i).observers.push(e); 2991 }; 2992} 2993function Nv(e) { 2994 return typeof e < "u" && Ju in e; 2995} 2996function wc(e) { 2997 const t = /* @__PURE__ */ new Set(); 2998 for (; Nv(e); ) 2999 t.add(e?.[Ju]), e = Object.getPrototypeOf(e); 3000 return Array.from(t).flatMap((i) => Object.keys(i)); 3001} 3002function qL(e) { 3003 return wc(e).reduce((t, i) => (t[i] = e[i] ?? null, t), {}); 3004} 3005function r8(e, t) { 3006 const i = t.toString(); 3007 for (; Nv(e); ) { 3008 const s = e[Ju]; 3009 if (Object.hasOwn(s, i)) 3010 return s[i]; 3011 e = Object.getPrototypeOf(e); 3012 } 3013} 3014function cl(e) { 3015 return e != null; 3016} 3017function hi(e) { 3018 return Array.isArray(e); 3019} 3020function LS(e) { 3021 return typeof e == "boolean"; 3022} 3023function og(e) { 3024 return e instanceof Date; 3025} 3026function _v(e) { 3027 return og(e) && !isNaN(Number(e)); 3028} 3029function QL(e) { 3030 return e instanceof RegExp; 3031} 3032function Rl(e) { 3033 return typeof e == "function"; 3034} 3035function Qs(e) { 3036 return typeof e == "object" && e !== null && !hi(e); 3037} 3038function a8(e) { 3039 return hi(e) || Js(e); 3040} 3041function Js(e) { 3042 return typeof e == "object" && e !== null && Object.getPrototypeOf(e) === Object.prototype; 3043} 3044function mn(e) { 3045 return typeof e == "string"; 3046} 3047function zo(e) { 3048 return typeof e == "number"; 3049} 3050function kt(e) { 3051 return Number.isFinite(e); 3052} 3053function XL(e) { 3054 return typeof window < "u" && e instanceof HTMLElement; 3055} 3056function l8(e, t) { 3057 return mn(t) && Object.keys(e).includes(t); 3058} 3059function JL(e, t) { 3060 return Object.values(e).includes(t); 3061} 3062function ek(e) { 3063 return typeof e == "symbol"; 3064} 3065function tk(e, t) { 3066 return e.type !== t; 3067} 3068function kc(e, t) { 3069 return Array.isArray(e) ? !Array.isArray(t) || e.length !== t.length ? !1 : e.every((i, s) => kc(i, t[s])) : Js(e) ? Js(t) ? kS(e, t, kc) : !1 : e === t; 3070} 3071function kS(e, t, i) { 3072 for (const s of Object.keys(t)) 3073 if (!(s in e)) 3074 return !1; 3075 for (const s of Object.keys(e)) 3076 if (!(s in t) || !i(e[s], t[s])) 3077 return !1; 3078 return !0; 3079} 3080function c8(...e) { 3081 return ht(...e.reverse()); 3082} 3083function ht(...e) { 3084 const t = {}; 3085 for (const i of e) { 3086 if (!Qs(i)) 3087 continue; 3088 const s = Nv(i) ? wc(i) : Object.keys(i); 3089 for (const n of s) 3090 Js(t[n]) && Js(i[n]) ? t[n] = ht(t[n], i[n]) : t[n] ?? (t[n] = i[n]); 3091 } 3092 return t; 3093} 3094function Tm(e, ...t) { 3095 return t && hi(e) ? e.map((i) => ht(i, ...t)) : e; 3096} 3097function u8(e, t) { 3098 return Object.entries(e).reduce( 3099 (i, [s, n]) => (i[s] = t(n, s, e), i), 3100 {} 3101 ); 3102} 3103function iw(e, t) { 3104 const i = { ...e }; 3105 for (const s of t) 3106 delete i[s]; 3107 return i; 3108} 3109function PS(e, t) { 3110 return (hi(t) ? t : t.split(".")).reduce((s, n) => s[n], e); 3111} 3112var FS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); 3113function OS(e, t, i) { 3114 const s = hi(t) ? t.slice() : t.split("."), n = s.pop(); 3115 if (s.some((r) => FS.has(r))) 3116 return; 3117 const o = s.reduce((r, a) => r[a], e); 3118 return o[n] = i, o[n]; 3119} 3120function tl(e, t, i) { 3121 if (i === void 0) 3122 return t; 3123 for (const s of e) { 3124 const n = i[s]; 3125 n !== void 0 && (t[s] = n); 3126 } 3127 return t; 3128} 3129function Xh(e) { 3130 return Object.freeze(e), Object.getOwnPropertyNames(e).forEach((t) => { 3131 const i = e[t]; 3132 i !== null && (typeof i == "object" || typeof i == "function") && !Object.isFrozen(i) && Xh(i); 3133 }), e; 3134} 3135var sw = {}; 3136Zo(sw, { 3137 easeIn: () => d8, 3138 easeInOut: () => h8, 3139 easeInOutQuad: () => f8, 3140 easeInQuad: () => p8, 3141 easeOut: () => xp, 3142 easeOutQuad: () => g8, 3143 inverseEaseOut: () => sk, 3144 linear: () => ik 3145}); 3146var ik = (e) => e, d8 = (e) => 1 - Math.cos(e * Math.PI / 2), xp = (e) => Math.sin(e * Math.PI / 2), h8 = (e) => -(Math.cos(e * Math.PI) - 1) / 2, p8 = (e) => e * e, g8 = (e) => 1 - (1 - e) ** 2, f8 = (e) => e < 0.5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2, sk = (e) => 2 * Math.asin(e) / Math.PI, Lm = 0.2, Fu = ["initial", "remove", "update", "add", "trailing", "end", "none"], Mp = { 3147 initial: { 3148 animationDuration: 1, 3149 animationDelay: 0 3150 }, 3151 add: { 3152 animationDuration: 0.25, 3153 animationDelay: 0.75 3154 }, 3155 remove: { 3156 animationDuration: 0.25, 3157 animationDelay: 0 3158 }, 3159 update: { 3160 animationDuration: 0.5, 3161 animationDelay: 0.25 3162 }, 3163 trailing: { 3164 animationDuration: Lm, 3165 animationDelay: 1, 3166 skipIfNoEarlierAnimations: !0 3167 }, 3168 end: { 3169 animationDelay: 1 + Lm, 3170 animationDuration: 0, 3171 skipIfNoEarlierAnimations: !0 3172 }, 3173 none: { 3174 animationDuration: 0, 3175 animationDelay: 0 3176 } 3177}, nk = /* @__PURE__ */ ((e) => (e.Loop = "loop", e.Reverse = "reverse", e))(nk || {}); 3178function m8(e) { 3179 return e.every((t) => t instanceof wl); 3180} 3181function Bv(e) { 3182 return m8(e) ? { nodes: e, selections: [] } : { nodes: [], selections: e }; 3183} 3184function nw(e, t) { 3185 return e === t ? !0 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((i, s) => nw(i, t[s])) : Im(e) && Im(t) ? e.equals(t) : Js(e) && Js(t) ? kS(e, t, nw) : !1; 3186} 3187var ok = class { 3188 constructor(e) {
3189 this.isComplete = !1, this.elapsed = 0, this.iteration = 0, this.isPlaying = !1, this.isReverse = !1, this.id = e.id, this.groupId = e.groupId, this.autoplay = e.autoplay ?? !0, this.ease = e.ease ?? ik, this.phase = e.phase; 3190 const t = e.duration ?? Mp[this.phase].animationDuration; 3191 this.duration = t * e.defaultDuration, this.delay = (e.delay ?? 0) * e.defaultDuration, this.onComplete = e.onComplete, this.onPlay = e.onPlay, this.onStop = e.onStop, this.onUpdate = e.onUpdate, this.interpolate = this.createInterpolator(e.from, e.to), this.from = e.from, e.skip === !0 && (this.onUpdate?.(e.to, !1, this), this.onStop?.(this), this.onComplete?.(this), this.isComplete = !0), e.collapsable !== !1 && (this.duration = this.checkCollapse(e, this.duration)); 3192 } 3193 checkCollapse(e, t) { 3194 return nw(e.from, e.to) ? 0 : t; 3195 } 3196 play(e = !1) { 3197 this.isPlaying || this.isComplete || (this.isPlaying = !0, this.onPlay?.(this), this.autoplay && (this.autoplay = !1, e && this.onUpdate?.(this.from, !0, this))); 3198 } 3199 pause() { 3200 this.isPlaying = !1; 3201 } 3202 stop() { 3203 this.isPlaying = !1, this.isComplete || (this.isComplete = !0, this.onStop?.(this)); 3204 } 3205 update(e) { 3206 if (this.isComplete) 3207 return e; 3208 !this.isPlaying && this.autoplay && this.play(!0); 3209 const t = this.elapsed; 3210 if (this.elapsed += e, this.delay > this.elapsed) 3211 return 0; 3212 const i = this.interpolate(this.isReverse ? 1 - this.delta : this.delta); 3213 this.onUpdate?.(i, !1, this); 3214 const s = this.delay + this.duration; 3215 return this.elapsed >= s ? (this.stop(), this.isComplete = !0, this.onComplete?.(this), e - (s - t)) : 0; 3216 } 3217 get delta() { 3218 return this.ease(ot(0, (this.elapsed - this.delay) / this.duration, 1)); 3219 } 3220 createInterpolator(e, t) { 3221 if (typeof t != "object" || Im(t)) 3222 return this.interpolateValue(e, t); 3223 const i = []; 3224 for (const s of Object.keys(t)) { 3225 const n = this.interpolateValue(e[s], t[s]); 3226 n != null && i.push([s, n]); 3227 } 3228 return (s) => { 3229 const n = {}; 3230 for (const [o, r] of i) 3231 n[o] = r(s); 3232 return n; 3233 }; 3234 } 3235 interpolateValue(e, t) { 3236 if (!(e == null || t == null)) { 3237 if (Im(e)) 3238 return (i) => e[Lv](t, i); 3239 try { 3240 switch (typeof e) { 3241 case "number": 3242 return o8(e, t); 3243 case "string": 3244 return YL(e, t); 3245 case "boolean": 3246 if (e === t) 3247 return () => e; 3248 break; 3249 } 3250 } catch { 3251 } 3252 throw new Error(`Unable to interpolate values: ${e}, ${t}`); 3253 } 3254 } 3255}, Zs = { 3256 added: "add", 3257 updated: "update", 3258 removed: "remove", 3259 unknown: "initial", 3260 "no-op": "none" 3261}; 3262function Mi(e, t, i, s, n, o, r) { 3263 const { fromFn: a, toFn: l, applyFn: c = (m, y) => m.setProperties(y) } = n, { nodes: u, selections: d } = Bv(s), p = (m, y) => { 3264 let b, C = 0, w = 0; 3265 for (const M of y) { 3266 const A = m[C] === M, I = { 3267 last: w >= y.length - 1, 3268 lastLive: C >= m.length - 1, 3269 prev: y[w - 1], 3270 prevFromProps: b, 3271 prevLive: m[C - 1], 3272 next: y[w + 1], 3273 nextLive: m[C + (A ? 1 : 0)] 3274 }, L = `${e}_${t}_${M.id}`; 3275 i.stopByAnimationId(L); 3276 let k = "unknown"; 3277 A ? o && r && (k = v8(M, M.datum, o, r)) : k = "removed", M.transitionOut = k === "removed"; 3278 const { phase: B, start: N, finish: W, delay: se, duration: ue, ...Ce } = a(M, M.datum, k, I), { 3279 phase: te, 3280 start: q, 3281 finish: $, 3282 delay: T, 3283 duration: E, 3284 ...P 3285 } = l(M, M.datum, k, I), G = W == null; 3286 i.animate({ 3287 id: L, 3288 groupId: e, 3289 phase: B ?? te ?? "update", 3290 duration: ue ?? E, 3291 delay: se ?? T, 3292 from: Ce, 3293 to: P, 3294 ease: xp, 3295 collapsable: G, 3296 onPlay: () => { 3297 c(M, { ...N, ...q, ...Ce }); 3298 }, 3299 onUpdate(_) { 3300 c(M, _); 3301 }, 3302 onStop: () => { 3303 c(M, { 3304 ...N, 3305 ...q, 3306 ...Ce, 3307 ...P, 3308 ...W, 3309 ...$ 3310 }); 3311 } 3312 }), A && C++, w++, b = Ce; 3313 } 3314 }; 3315 let f = 0; 3316 for (const m of d) { 3317 const y = m.nodes(), b = y.filter((C) => !m.isGarbage(C)); 3318 p(b, y), i.animate({ 3319 id: `${e}_${t}_selection_${f}`, 3320 groupId: e, 3321 phase: "end", 3322 from: 0, 3323 to: 1, 3324 ease: xp, 3325 onStop() { 3326 m.cleanup(); 3327 } 3328 }), f++; 3329 } 3330 p(u, u); 3331} 3332function Mr(e, t, i, s, n, o, r) { 3333 const { nodes: a, selections: l } = Bv(s), { start: c, finish: u, phase: d } = r; 3334 i.animate({ 3335 id: `${e}_${t}`, 3336 groupId: e, 3337 phase: d ?? "update", 3338 from: n, 3339 to: o, 3340 ease: xp, 3341 onPlay: () => { 3342 if (c) { 3343 for (const p of a) 3344 p.setProperties(c); 3345 for (const p of l) 3346 for (const f of p.nodes()) 3347 f.setProperties(c); 3348 } 3349 }, 3350 onUpdate(p) { 3351 for (const f of a) 3352 f.setProperties(p); 3353 for (const f of l) 3354 for (const m of f.nodes()) 3355 m.setProperties(p); 3356 }, 3357 onStop: () => { 3358 for (const p of a) 3359 p.setProperties({ ...o, ...u }); 3360 for (const p of l) { 3361 for (const f of p.nodes()) 3362 f.setProperties({ ...o, ...u }); 3363 p.cleanup(); 3364 } 3365 } 3366 }); 3367} 3368function v8(e, t, i, s) { 3369 const n = i(e, t); 3370 return s.added.has(n) ? "added" : s.removed.has(n) ? "removed" : "updated"; 3371} 3372var ow = /* @__PURE__ */ new Map(); 3373function km(e, t) { 3374 ow.has(t) || (ow.set(t, !0), e()); 3375} 3376km.clear = () => ow.clear(); 3377function rw(e) { 3378 return e; 3379} 3380function y8(e, t = 0, i) { 3381 const { leading: s = !1, trailing: n = !0, maxWait: o = 1 / 0 } = i ?? {}; 3382 let r, a; 3383 if (o < t) 3384 throw new Error("Value of maxWait cannot be lower than waitMs."); 3385 function l(...c) { 3386 if (s && !a) { 3387 a = Date.now(), r = setTimeout(() => a = null, t), e(...c); 3388 return; 3389 } 3390 let u = t; 3391 if (o !== 1 / 0 && a) { 3392 const d = Date.now() - a; 3393 t > o - d && (u = o - d); 3394 } 3395 clearTimeout(r), a ?? (a = Date.now()), r = setTimeout(() => { 3396 a = null, n && e(...c); 3397 }, u); 3398 } 3399 return Object.assign(l, { 3400 cancel() { 3401 clearTimeout(r), a = null; 3402 } 3403 }); 3404} 3405function aw(e, t, i) { 3406 const { leading: s = !0, trailing: n = !0 } = i ?? {}; 3407 let o, r, a = !1; 3408 function l() { 3409 n && r ? (o = setTimeout(l, t), e(...r)) : a = !1, r = null; 3410 } 3411 function c(...u) { 3412 a ? r = u : (a = !0, o = setTimeout(l, t), s ? e(...u) : r = u); 3413 } 3414 return Object.assign(c, { 3415 cancel() { 3416 clearTimeout(o), a = !1, r = null; 3417 } 3418 }); 3419} 3420var Ee = { 3421 log(...e) { 3422 console.log(...e); 3423 }, 3424 warn(e, ...t) { 3425 console.warn(`AG Charts - ${e}`, ...t); 3426 }, 3427 error(e, ...t) { 3428 typeof e == "object" ? console.error("AG Charts error", e, ...t) : console.error(`AG Charts - ${e}`, ...t); 3429 }, 3430 table(...e) { 3431 console.table(...e); 3432 }, 3433 warnOnce(e, ...t) { 3434 km(() =>
3434 Ee.warn(e, ...t), `Logger.warn: ${e}`); 3435 }, 3436 errorOnce(e, ...t) { 3437 km(() => Ee.error(e, ...t), `Logger.error: ${e}`); 3438 } 3439}, os = (e, t) => { 3440 const i = Symbol(String(t)); 3441 e[i] = void 0, Object.defineProperty(e, t, { 3442 get() { 3443 return this[i]; 3444 }, 3445 set(s) { 3446 this[i] !== s && (this[i] = s, this.invalid = !0); 3447 }, 3448 enumerable: !0, 3449 configurable: !1 3450 }); 3451}, Ar = class lw { 3452 constructor(t, i) { 3453 this.invalid = !0, this.nice = !1, this.interval = void 0, this.tickCount = lw.defaultTickCount, this.minTickCount = 0, this.maxTickCount = 1 / 0, this.niceDomain = [], this.defaultClamp = !1, this.domain = t, this.range = i; 3454 } 3455 static is(t) { 3456 return t instanceof lw; 3457 } 3458 transform(t) { 3459 return t; 3460 } 3461 transformInvert(t) { 3462 return t; 3463 } 3464 calcBandwidth(t = 1) { 3465 const i = this.getDomain(), s = this.getPixelRange(), n = Math.abs(i[1] - i[0]) / t + 1, o = Math.floor(s), r = Math.min(n, o); 3466 return s / Math.max(1, r); 3467 } 3468 getDomain() { 3469 return this.nice && (this.refresh(), this.niceDomain.length) ? this.niceDomain : this.domain; 3470 } 3471 convert(t, i) { 3472 if (!this.domain || this.domain.length < 2) 3473 return NaN; 3474 this.refresh(); 3475 const s = this.getDomain().map((c) => this.transform(c)), [n, o] = s, { range: r } = this, [a, l] = r; 3476 if (t = this.transform(t), i ?? this.defaultClamp) { 3477 const [c, u] = Ds(s.map(Number)); 3478 if (Number(t) < c) 3479 return a; 3480 if (Number(t) > u) 3481 return l; 3482 } 3483 return n === o ? (a + l) / 2 : t === n ? a : t === o ? l : a + (Number(t) - Number(n)) / (Number(o) - Number(n)) * (l - a); 3484 } 3485 invert(t, i) { 3486 this.refresh(); 3487 const s = this.getDomain().map((f) => this.transform(f)), [n, o] = s, { range: r } = this, [a, l] = r, c = a > l, u = c ? l : a, d = c ? a : l; 3488 if (i ?? this.defaultClamp) { 3489 if (t < u) 3490 return c ? o : n; 3491 if (t > d) 3492 return c ? n : o; 3493 } 3494 let p; 3495 return a === l ? p = this.toDomain((Number(n) + Number(o)) / 2) : p = this.toDomain(Number(n) + (t - a) / (l - a) * (Number(o) - Number(n))), this.transformInvert(p); 3496 } 3497 refresh() { 3498 this.invalid && (this.invalid = !1, this.update(), this.invalid && Ee.warnOnce("Expected update to not invalidate scale")); 3499 } 3500 getPixelRange() { 3501 const [t, i] = this.range; 3502 return Math.abs(i - t); 3503 } 3504}; 3505Ar.defaultTickCount = 5; 3506Ar.defaultMaxTickCount = 6; 3507S([ 3508 os 3509], Ar.prototype, "domain", 2); 3510S([ 3511 os 3512], Ar.prototype, "range", 2); 3513S([ 3514 os 3515], Ar.prototype, "nice", 2); 3516S([ 3517 os 3518], Ar.prototype, "interval", 2); 3519S([ 3520 os 3521], Ar.prototype, "tickCount", 2); 3522S([ 3523 os 3524], Ar.prototype, "minTickCount", 2); 3525S([ 3526 os 3527], Ar.prototype, "maxTickCount", 2); 3528var ti = Ar; 3529function ma(e) { 3530 if (e.length === 0) 3531 return null; 3532 let t = 1 / 0, i = -1 / 0; 3533 for (let n of e) 3534 n instanceof Date && (n = n.getTime()), typeof n == "number" && (n < t && (t = n), n > i && (i = n)); 3535 const s = [t, i]; 3536 return s.every(isFinite) ? s : null; 3537} 3538function NS(e, t, i) { 3539 let s = !1; 3540 return e.length > 2 && (e = ma(e) ?? [NaN, NaN]), isNaN(t) || (s || (s = t > e[0]), e = [t, e[1]]), isNaN(i) || (s || (s = i < e[1]), e = [e[0], i]), e[0] > e[1] && (e = []), { extent: e, clipped: s }; 3541} 3542function ul(e, t) { 3543 if (e == null || t == null || e.length !== t.length) 3544 return !1; 3545 for (let i = 0; i < e.length; i++) 3546 if (Array.isArray(e[i]) && Array.isArray(t[i])) { 3547 if (!ul(e[i], t[i])) 3548 return !1; 3549 } else if (e[i] !== t[i]) 3550 return !1; 3551 return !0; 3552} 3553function Ap(e) { 3554 return typeof e > "u" ? [] : Array.isArray(e) ? e : [e]; 3555} 3556function _S(e) { 3557 return Array.from(new Set(e)); 3558} 3559function Gv(e, t) { 3560 return e.reduce((i, s) => { 3561 const n = t(s); 3562 return i[n] ?? (i[n] = []), i[n].push(s), i; 3563 }, {}); 3564} 3565function cw(e, t, i = 0) { 3566 if (e.length === 0) 3567 return []; 3568 const s = []; 3569 for (let n = 0; n < t; n++) 3570 s.push(e.at((n + i) % e.length)); 3571 return s; 3572} 3573function rk(e, t) { 3574 const i = /* @__PURE__ */ new Map(); 3575 return t.forEach((s, n) => { 3576 i.set(s, n); 3577 }), e.sort((s, n) => { 3578 const o = i.get(s) ?? 1 / 0, r = i.get(n) ?? 1 / 0; 3579 return o - r; 3580 }); 3581} 3582function BS(e, t) { 3583 return e.includes(t); 3584} 3585var il = 1e3, ds = il * 60, Ys = ds * 60, fo = Ys * 24, Qr = fo * 7, Sh = fo * 30, bd = fo * 365, wd = class { 3586 constructor(e, t, i) { 3587 this._encode = e, this._decode = t, this._rangeCallback = i; 3588 } 3589 /** 3590 * Returns a new date representing the latest interval boundary date before or equal to date. 3591 * For example, `day.floor(date)` typically returns 12:00 AM local time on the given date. 3592 * @param date 3593 */ 3594 floor(e) { 3595 const t = new Date(e), i = this._encode(t); 3596 return this._decode(i); 3597 } 3598 /** 3599 * Returns a new date representing the earliest interval boundary date after or equal to date. 3600 * @param date 3601 */ 3602 ceil(e) { 3603 const t = new Date(Number(e) - 1), i = this._encode(t); 3604 return this._decode(i + 1); 3605 } 3606 /** 3607 * Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive). 3608 * @param start Range start. 3609 * @param stop Range end. 3610 * @param extend If specified, the requested range will be extended to the closest "nice" values. 3611 */ 3612 range(e, t, i) { 3613 const s = this._rangeCallback?.(e, t), n = this._encode(i ? this.floor(e) : this.ceil(e)), o = this._encode(i ? this.ceil(t) : this.floor(t)); 3614 if (o < n) 3615 return []; 3616 const r = []; 3617 for (let a = n; a <= o; a++) { 3618 const l = this._decode(a); 3619 r.push(l); 3620 } 3621 return s?.(), r; 3622 } 3623}, zn = class extends wd { 3624 getOffset(e, t) { 3625 const i = typeof e == "number" || e instanceof Date ? this._encode(ne
3625w Date(e)) : 0; 3626 return Math.floor(i) % t; 3627 } 3628 /** 3629 * Returns a filtered view of this interval representing every step'th date. 3630 * It can be a number of minutes, hours, days etc. 3631 * Must be a positive integer. 3632 * @param step 3633 */ 3634 every(e, t) { 3635 let i = 0, s; 3636 const n = e; 3637 e = Math.max(1, Math.round(e)), n !== e && Ee.warnOnce(`interval step of [${n}] rounded to [${e}].`); 3638 const { snapTo: o = "start" } = t ?? {}; 3639 if (typeof o == "string") { 3640 const l = i; 3641 s = (c, u) => { 3642 const d = o === "start" ? c : u; 3643 return i = this.getOffset(d, e), () => i = l; 3644 }; 3645 } else typeof o == "number" ? i = this.getOffset(new Date(o), e) : o instanceof Date && (i = this.getOffset(o, e)); 3646 const r = (l) => { 3647 const c = this._encode(l); 3648 return Math.floor((c - i) / e); 3649 }, a = (l) => this._decode(l * e + i); 3650 return new wd(r, a, s); 3651 } 3652}; 3653function C8(e) { 3654 const t = e.getTimezoneOffset() * ds; 3655 return Math.floor((e.getTime() - t) / fo); 3656} 3657function b8(e) { 3658 const t = new Date(1970, 0, 1); 3659 return t.setDate(t.getDate() + e), t; 3660} 3661var Pm = new zn(C8, b8), ak = (/* @__PURE__ */ new Date()).getTimezoneOffset() * ds; 3662function w8(e) { 3663 return Math.floor((e.getTime() - ak) / Ys); 3664} 3665function S8(e) { 3666 return new Date(ak + e * Ys); 3667} 3668var Uu = new zn(w8, S8), lk = (/* @__PURE__ */ new Date()).getTimezoneOffset() * ds; 3669function x8(e) { 3670 return Math.floor((e.getTime() - lk) / ds); 3671} 3672function M8(e) { 3673 return new Date(lk + e * ds); 3674} 3675var Wu = new zn(x8, M8); 3676function A8(e) { 3677 return e.getFullYear() * 12 + e.getMonth(); 3678} 3679function D8(e) { 3680 const t = Math.floor(e / 12), i = e - t * 12; 3681 return new Date(t, i, 1); 3682} 3683var mc = new zn(A8, D8), ck = (/* @__PURE__ */ new Date()).getTimezoneOffset() * ds; 3684function E8(e) { 3685 return Math.floor((e.getTime() - ck) / il); 3686} 3687function I8(e) { 3688 return new Date(ck + e * il); 3689} 3690var ju = new zn(E8, I8); 3691function zc(e) { 3692 const i = (7 + e - 4) % 7; 3693 function s(o) { 3694 const r = o.getTimezoneOffset() * ds; 3695 return Math.floor((o.getTime() - r) / Qr - i / 7); 3696 } 3697 function n(o) { 3698 const r = new Date(1970, 0, 1); 3699 return r.setDate(r.getDate() + o * 7 + i), r; 3700 } 3701 return new zn(s, n); 3702} 3703var Jh = zc(0), R8 = zc(1), T8 = zc(2), L8 = zc(3), k8 = zc(4), P8 = zc(5), F8 = zc(6); 3704function O8(e) { 3705 return e.getFullYear(); 3706} 3707function N8(e) { 3708 const t = /* @__PURE__ */ new Date(); 3709 return t.setFullYear(e), t.setMonth(0, 1), t.setHours(0, 0, 0, 0), t; 3710} 3711var zv = new zn(O8, N8), Af = { 3712 days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], 3713 shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 3714 months: [ 3715 "January", 3716 "February", 3717 "March", 3718 "April", 3719 "May", 3720 "June", 3721 "July", 3722 "August", 3723 "September", 3724 "October", 3725 "November", 3726 "December" 3727 ], 3728 shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] 3729}; 3730function GS(e, t = new Date(e.getFullYear(), 0, 1)) { 3731 const i = e.getTimezoneOffset() - t.getTimezoneOffset(), s = e.getTime() - t.getTime() + i * 6e4, n = 36e5 * 24; 3732 return Math.floor(s / n); 3733} 3734function dI(e, t) { 3735 const s = new Date(e.getFullYear(), 0, 1).getDay(), n = (t - s + 7) % 7, o = new Date(e.getFullYear(), 0, n + 1); 3736 return o <= e ? Math.floor(GS(e, o) / 7) + 1 : 0; 3737} 3738var _8 = 0, uk = 1, hI = 4; 3739function dk(e, t = e.getFullYear()) { 3740 const s = new Date(t, 0, 1).getDay(), n = (hI - s + 7) % 7, o = new Date(t, 0, n - (hI - uk) + 1); 3741 return o <= e ? Math.floor(GS(e, o) / 7) + 1 : dk(e, t - 1); 3742} 3743function B8(e) { 3744 const t = e.getTimezoneOffset(), i = Math.abs(t); 3745 return `${t > 0 ? "-" : "+"}${us(Math.floor(i / 60), 2, "0")}${us(Math.floor(i % 60), 2, "0")}`; 3746} 3747var G8 = { 3748 a: (e) => Af.shortDays[e.getDay()], 3749 A: (e) => Af.days[e.getDay()], 3750 b: (e) => Af.shortMonths[e.getMonth()], 3751 B: (e) => Af.months[e.getMonth()], 3752 c: "%x, %X", 3753 d: (e, t) => us(e.getDate(), 2, t ?? "0"), 3754 e: "%_d", 3755 f: (e, t) => us(e.getMilliseconds() * 1e3, 6, t ?? "0"), 3756 H: (e, t) => us(e.getHours(), 2, t ?? "0"), 3757 I: (e, t) => { 3758 const i = e.getHours() % 12; 3759 return i === 0 ? "12" : us(i, 2, t ?? "0"); 3760 }, 3761 j: (e, t) => us(GS(e) + 1, 3, t ?? "0"), 3762 m: (e, t) => us(e.getMonth() + 1, 2, t ?? "0"), 3763 M: (e, t) => us(e.getMinutes(), 2, t ?? "0"), 3764 L: (e, t) => us(e.getMilliseconds(), 3, t ?? "0"), 3765 p: (e) => e.getHours() < 12 ? "AM" : "PM", 3766 Q: (e) => String(e.getTime()), 3767 s: (e) => String(Math.floor(e.getTime() / 1e3)), 3768 S: (e, t) => us(e.getSeconds(), 2, t ?? "0"), 3769 u: (e) => { 3770 let t = e.getDay(); 3771 return t < 1 && (t += 7), String(t % 7); 3772 }, 3773 U: (e, t) => us(dI(e, _8), 2, t ?? "0"), 3774 V: (e, t) => us(dk(e), 2, t ?? "0"), 3775 w: (e, t) => us(e.getDay(), 2, t ?? "0"), 3776 W: (e, t) => us(dI(e, uk), 2, t ?? "0"), 3777 x: "%-m/%-d/%Y", 3778 X: "%-I:%M:%S %p", 3779 y: (e, t) => us(e.getFullYear() % 100, 2, t ?? "0"), 3780 Y: (e, t) => us(e.getFullYear(), 4, t ?? "0"), 3781 Z: (e) => B8(e), 3782 "%": () => "%" 3783}, z8 = { 3784 _: " ", 3785 0: "0", 3786 "-": "" 3787}; 3788function us(e, t, i) { 3789 const s = String(Math.floor(e)); 3790 return s.length >= t ? s : `${i.repeat(t - s.length)}${s}`; 3791} 3792function rg(e) { 3793 const t = []; 3794 for (; e.length > 0; ) { 3795 let i = e.indexOf("%"); 3796 if (i !== 0) { 3797 const a = i > 0 ? e.substring(0, i) : e; 3798 t.push(a); 3799 } 3800 if (i < 0) 3801 break; 3802 const s = e[i + 1], n = z8[s]; 3803 n != null && i++; 3804 const o = e[i + 1], r = G8[o]; 3805 if (typeof r == "function") 3806 t.push([r, n]); 3807 else if (typeof r == "string") { 3808 const a = rg(r); 3809 t.push([a, n]); 3810 } else 3811 t.push(`${n ?? ""}${o}`); 3812 e = e.substring(i + 2); 3813 } 3814 return (i) => { 3815 const s = typeof i == "number" ? new Date(i) : i; 3816 return t.map((n) => typeof n == "string" ? n : n[0](s, n[1])).join(""); 3817 }; 3818} 3819function hn(e) { 3820 return e instanceof Date ? e.getTime() : e; 3821} 3822function zS(e, t, i) { 3823 const s = hk(e, t, i), n = rg(s); 3824 return (o) => n(o); 3825} 3826function hk(e = [], t = e, i = 0) { 3827 let s = 1 / 0; 3828 for (let l = 1; l < e.length; l++) 3829 s = Math.min(s, Math.abs(e[l] - e[l - 1])); 3830 const n = new Date(t[0]).getFullYear(), r = new Date(t.at(-1)).getFullYear() - n > 0, a = isFinite(s) ? H8(s, e) : V8(e[0]); 3831 return W8(Math.max(a - i, 0), r, e); 3832} 3833function H8(e, t) { 3834 return e < il ? 0 : e < ds ? 1 : e < Ys ? 2 : e < fo ? 3 : e < Qr ? 4 : e < fo * 28 || e < fo * 31 && U8(t) ? 5 : e < bd ? 6 : 7; 3835} 3836function V8(e) { 3837 return ju.floor(e) < e ? 0 : Wu.floor(e) < e ? 1 : Uu.floor(e) < e ? 2 : Pm.floor(e) < e ? 3 : mc.floor(e) < e ? Jh.floor(e) < e ? 4 : 5 : zv.floor(e) < e ? 6 : 7; 3838} 3839function U8(e) { 3840 let t = new Date(e[0]).getMonth(); 3841 for (let i = 1; i < e.length; i++) { 3842 const s = new Date(e[i]).getMonth(); 3843 if (t === s) 3844 return !0; 3845 t = s; 3846 } 3847 return !1; 3848} 3849function W8(e, t, i) { 3850 const s = hn(i[0]), n = hn(i.at(-1)), o = Math.abs(n - s), r = t || e === 7, a = o === 0, c = [ 3851 ["hour", 6 * Ys, 14 * fo, 3, "%I %p"], 3852 ["hour", ds, 6 * Ys, 3, "%I:%M"], 3853 ["second", 1e3, 6 * Ys, 1, ":%S"], 3854 ["ms", 0, 6 * Ys, 0, ".%L"], 3855 ["am/pm", ds, 6 * Ys, 3, "%p"], 3856 " ", 3857 ["day", fo, Qr, 4, "%a"], 3858 ["month", a ? 0 : Qr, 52 * Qr, 5, "%b %d"], 3859 ["month", 5 * Qr, 10 * bd, 6, "%B"], 3860 " ", 3861 ["year", r ? 0 : bd, 1 / 0, 7, "%Y"] 3862 ].filter((p) => { 3863 if (typeof p == "string") 3864 return !0; 3865 const [f, m, y, b] = p; 3866 return b >= e && m <= o && o < y; 3867 }).reduce( 3868 (p, f) => (typeof f == "string" ? p.result.push(f) : p.used.has(f[0]) || (p.result.push(f), p.used.add(f[0])), p), 3869 { result: [], used: /* @__PURE__ */ new Set() } 3870 ).result, u = c.findIndex((p) => typeof p != "string"), d = c.findLastIndex((p) => typeof p != "string"); 3871 return c.slice(u, d + 1).map((p) => typeof p == "string" ? p : p[4]).join("").replaceAll(/\s+/g, " ").trim(); 3872} 3873var Hv = class pk { 3874 constructor() { 3875 this.type = "band", this.invalid = !0, this.range = [0, 1], this.round = !1, this.interval = void 0, this.index = /* @__PURE__ */ new Map(), this._domain = [], this._bandwidth = 1, this._step = 1, this._inset = 1, this._rawBandwidth = 1, this._paddingInner = 0, this._paddingOuter = 0; 3876 } 3877 static is(t) { 3878 return t instanceof pk; 3879 } 3880 refresh() { 3881 this.invalid && (this.invalid = !1, this.update(), this.invalid && Ee.warnOnce("Expected update to not invalidate scale")); 3882 } 3883 set domain(t) { 3884 this.index = /* @__PURE__ */ new Map(), this.invalid = !0, this._domain = []; 3885 for (const i of t) { 3886 const s = hn(i); 3887 this.getIndex(s) === void 0 && this.index.set(s, this._domain.push(i) - 1); 3888 } 3889 } 3890 get domain() { 3891 return this._domain; 3892 } 3893 getDomain() { 3894 return this._domain; 3895 } 3896 ticks() { 3897 return this.refresh(), this._domain; 3898 } 3899 convert(t) { 3900 this.refresh(); 3901 const i = this.getIndex(t); 3902 return i == null || i < 0 || i >= this.domain.length ? NaN : this.ordinalRange(i); 3903 } 3904 invertNearestIndex(t) { 3905 this.refresh(); 3906 const { domain: i } = this; 3907 if (i.length === 0) 3908 return -1; 3909 let s = 0, n = i.length - 1, o = 1 / 0, r = 0; 3910 for (; s <= n; ) { 3911 const a = (n + s) / 2 | 0, l = this.ordinalRange(a), c = Math.abs(l - t); 3912 if (c === 0) 3913 return a; 3914 c < o && (o = c, r = a), l < t ? s = a + 1 : n = a - 1; 3915 } 3916 return r; 3917 } 3918 invert(t) { 3919 this.refresh(); 3920 const i = this.invertNearestIndex(t), s = this.ordinalRange(i); 3921 return t === s ? this.domain[i] : void 0; 3922 } 3923 invertNearest(t) { 3924 const i = this.invertNearestIndex(t); 3925 return this.domain[i]; 3926 } 3927 get bandwidth() { 3928 return this.refresh(), this._bandwidth; 3929 } 3930 get step() { 3931 return this.refresh(), this._step; 3932 } 3933 get inset() { 3934 return this.refresh(), this._inset; 3935 } 3936 get rawBandwidth() { 3937 return this.refresh(), this._rawBandwidth; 3938 } 3939 set padding(t) { 3940 t = ot(0, t, 1), this._paddingInner = t, this._paddingOuter = t; 3941 } 3942 get padding() { 3943 return this._paddingInner; 3944 } 3945 set paddingInner(t) { 3946 this._paddingInner = ot(0, t, 1); 3947 } 3948 get paddingInner() { 3949 return this._paddingInner; 3950 } 3951 set paddingOuter(t) { 3952 this._paddingOuter = ot(0, t, 1); 3953 } 3954 get paddingOuter() { 3955 return this._paddingOuter; 3956 } 3957 update() { 3958 const t = this._domain.length; 3959 if (t === 0) 3960 return; 3961 const [i, s] = this.range; 3962 let { _paddingInner: n } = this;
3963 const { _paddingOuter: o, round: r } = this, a = s - i; 3964 let l; 3965 t === 1 ? (n = 0, l = a * (1 - o * 2)) : l = a / Math.max(1, t - n + o * 2); 3966 const c = r ? Math.floor(l) : l; 3967 let u = i + (a - c * (t - n)) / 2, d = c * (1 - n); 3968 r && (u = Math.round(u), d = Math.round(d)), this._step = c, this._inset = u, this._bandwidth = d, this._rawBandwidth = l * (1 - n); 3969 } 3970 ordinalRange(t) { 3971 const { _inset: i, _step: s, range: n } = this, o = Math.min(n[0], n[1]), r = Math.max(n[0], n[1]); 3972 return ot(o, i + s * t, r); 3973 } 3974 getIndex(t) { 3975 return this.index.get(t instanceof Date ? t.getTime() : t); 3976 } 3977}; 3978S([ 3979 os 3980], Hv.prototype, "range", 2); 3981S([ 3982 os 3983], Hv.prototype, "round", 2); 3984S([ 3985 os 3986], Hv.prototype, "interval", 2); 3987var Tl = Hv, it = class { 3988 set(e) { 3989 const { className: t = this.constructor.name } = this.constructor; 3990 if (typeof e != "object") 3991 return Ee.warn(`unable to set ${t} - expecting a properties object`), this; 3992 const i = new Set(Object.keys(e)); 3993 for (const s of wc(this)) 3994 if (i.has(s)) { 3995 const n = e[s], o = this; 3996 if (br(o[s])) 3997 if (o[s] instanceof ag) { 3998 const r = o[s].reset(n); 3999 r != null ? o[s] = r : Ee.warn(`unable to set [${s}] - expecting a properties array`); 4000 } else 4001 o[s].set(n); 4002 else 4003 o[s] = n; 4004 i.delete(s); 4005 } 4006 for (const s of i) 4007 Ee.warn(`unable to set [${s}] in ${t} - property is unknown`); 4008 return this; 4009 } 4010 isValid(e) { 4011 return wc(this).every((t) => { 4012 const { optional: i } = r8(this, t), s = i === !0 || typeof this[t] < "u"; 4013 return s || Ee.warnOnce(`${e ?? ""}[${t}] is required.`), s; 4014 }); 4015 } 4016 toJson() { 4017 return wc(this).reduce((e, t) => { 4018 const i = this[t]; 4019 return e[t] = br(i) ? i.toJson() : i, e; 4020 }, {}); 4021 } 4022}, ag = class gk extends Array { 4023 constructor(t, ...i) { 4024 super(i.length); 4025 const n = ((o) => !!o?.prototype?.constructor?.name)(t) ? (o) => new t().set(o) : t; 4026 Object.defineProperty(this, "itemFactory", { value: n, enumerable: !1, configurable: !1 }), this.set(i); 4027 } 4028 set(t) { 4029 if (hi(t)) { 4030 this.length = t.length; 4031 for (let i = 0; i < t.length; i++) 4032 this[i] = this.itemFactory(t[i]); 4033 } 4034 return this; 4035 } 4036 reset(t) { 4037 if (Array.isArray(t)) 4038 return new gk(this.itemFactory, ...t); 4039 } 4040 toJson() { 4041 return this.map((t) => t?.toJson?.() ?? t); 4042 } 4043}; 4044function br(e) { 4045 return e instanceof it || e instanceof ag; 4046} 4047function D(e, t = {}) { 4048 const { optional: i = !1, property: s } = t; 4049 return ha( 4050 (n, o, r) => { 4051 const a = { ...t, target: n, property: o }; 4052 if (i && typeof r > "u" || e(r, a)) 4053 return br(n[o]) && !br(r) ? (n[o].set(r), n[o]) : r; 4054 const l = s ?? String(o).replace(/^_*/, ""), c = n.constructor.className ?? n.constructor.name.replace(/Properties$/, ""); 4055 let u = ep(r); 4056 const d = 50; 4057 if (u != null && u.length > d) { 4058 const p = u.length - d; 4059 u = u.slice(0, d) + `... (+${p} characters)`; 4060 } 4061 return Ee.warn( 4062 `Property [${l}] of [${c}] cannot be set to [${u}]${e.message ? `; expecting ${dg(e, a)}` : ""}, ignoring.` 4063 ), Rm; 4064 }, 4065 void 0, 4066 { optional: i } 4067 ); 4068} 4069var Dr = (...e) => { 4070 const t = []; 4071 return jt( 4072 (i, s) => (t.length = 0, e.every((n) => { 4073 const o = n(i, s); 4074 return o || t.push(dg(n, s)), o; 4075 })), 4076 () => t.filter(Boolean).join(" AND ") 4077 ); 4078}, Hc = (...e) => jt( 4079 (t, i) => e.some((s) => s(t, i)), 4080 (t) => e.map(e7(t)).filter(Boolean).join(" OR ") 4081), Be = xk( 4082 jt( 4083 (e, t) => br(e) || Qs(e) && br(t.target[t.property]), 4084 "a properties object" 4085 ) 4086), fk = xk(jt((e) => Qs(e), "an object")), je = jt(LS, "a boolean"), tn = jt(Rl, "a function"), Me = jt(mn, "a string"), At = i7(jt(kt, "a number")), mk = jt((e) => zo(e) && !isNaN(e), "a real number"), Vv = jt((e) => zo(e) && isNaN(e), "NaN"), Te = At.restrict({ min: 0 }), Pt = At.restrict({ min: 0, max: 1 }), _d = Hc(At, Vv), lg = t7(jt(hi, "an array")), va = (e, t) => jt( 4087 (i, s) => hi(i) && i.every((n) => e(n, s)), 4088 (i) => { 4089 const s = dg(lg, i) ?? ""; 4090 return typeof t == "function" ? `${s} of ${t(i)}` : t ? `${s} of ${t}` : s; 4091 } 4092), Fm = (e) => kt(e) || _v(e), cg = (e) => jt( 4093 (t, i) => !Fm(t) || !Fm(i.target[e]) || t < i.target[e], 4094 `to be less than ${e}` 4095), ug = (e) => jt( 4096 (t, i) => !Fm(t) || !Fm(i.target[e]) || t > i.target[e], 4097 `to be greater than ${e}` 4098), HS = jt(_v, "Date object"), VS = Hc(HS, Te), vk = "A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc", Ft = jt( 4099 (e) => mn(e) && Bo.validColorString(e),
4100 `color String. ${vk}` 4101), xo = jt(va(Ft), `color strings. ${vk}`), j8 = va(je, "boolean values"), Uv = va(At, "numbers"), yk = va(Me, "strings"), $8 = jt(va(HS), "Date objects"), US = jt(va(Be), "objects"), Y8 = si(["butt", "round", "square"], "a line cap"), K8 = si(["round", "bevel", "miter"], "a line join"), Z8 = si(["solid", "dashed", "dotted"], "a line style"), ya = jt( 4102 va(Te), 4103 "numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels." 4104), WS = si(["top", "right", "bottom", "left"], "a position"), Ca = si(["normal", "italic", "oblique"], "a font style"), ba = Hc( 4105 si(["normal", "bold", "bolder", "lighter"], "a font weight"), 4106 At.restrict({ min: 1, max: 1e3 }) 4107), Wv = si(["never", "always", "hyphenate", "on-space"], "a text wrap strategy"), Ck = si(["left", "center", "right"], "a text align"), q8 = si(["top", "middle", "bottom"], "a vertical align"), Q8 = si(["ellipsis", "hide"], "an overflow strategy"), bk = si(["horizontal", "vertical"], "a direction"), X8 = si(["inside", "outside"], "a placement"), jv = Hc(si(["exact", "nearest"], "interaction range"), At), jS = si(["top", "bottom", "left", "right"]); 4108function si(e, t = "a") { 4109 return jt( 4110 (i, s) => { 4111 const n = e.find((o) => { 4112 const r = typeof o == "string" ? o : o.value; 4113 return i === r; 4114 }); 4115 if (n == null) 4116 return !1; 4117 if (typeof n != "string" && (n.deprecated === !0 || n.deprecatedTo != null)) { 4118 const o = [`Property [%s] with value '${n.value}' is deprecated.`]; 4119 n.deprecatedTo && o.push(`Use ${n.deprecatedTo} instead.`), Ee.warnOnce(o.join(" "), s.property); 4120 } 4121 return !0; 4122 }, 4123 `${t} keyword such as ${J8(e)}` 4124 ); 4125} 4126var wk = Hc(Dr(At.restrict({ min: 1 }), cg("maxSpacing")), Vv), Sk = Hc(Dr(At.restrict({ min: 1 }), ug("minSpacing")), Vv); 4127function jt(e, t) { 4128 return e.message = t, e; 4129} 4130function J8(e) { 4131 const t = e.filter((s) => typeof s == "string" || s.undocumented !== !0).map((s) => `'${typeof s == "string" ? s : s.value}'`); 4132 if (t.length === 1) 4133 return t[0]; 4134 const i = t.pop(); 4135 return `${t.join(", ")} or ${i}`; 4136} 4137function dg(e, t) { 4138 return Rl(e.message) ? e.message(t) : e.message; 4139} 4140function e7(e) { 4141 return (t) => dg(t, e); 4142} 4143function t7(e) { 4144 return Object.assign(e, { 4145 restrict({ length: t, minLength: i } = {}) { 4146 let s = "an array"; 4147 return zo(i) && i > 0 ? s = "a non-empty array" : zo(t) && (s = `an array of length ${t}`), jt( 4148 (n) => hi(n) && (zo(t) ? n.length === t : !0) && (zo(i) ? n.length >= i : !0), 4149 s 4150 ); 4151 } 4152 }); 4153} 4154function i7(e) { 4155 return Object.assign(e, { 4156 restrict({ min: t, max: i } = {}) { 4157 const s = ["a number"], n = zo(t), o = zo(i); 4158 return n && o ? s.push(`between ${t} and ${i} inclusive`) : n ? s.push(`greater than or equal to ${t}`) : o && s.push(`less than or equal to ${i}`), jt( 4159 (r) => kt(r) && (n ? r >= t : !0) && (o ? r <= i : !0), 4160 s.join(" ") 4161 ); 4162 } 4163 }); 4164} 4165function xk(e) { 4166 return Object.assign(e, { 4167 restrict(t) { 4168 return jt( 4169 (i) => i instanceof t, 4170 (i) => dg(e, i) ?? `an instance of ${t.name}` 4171 ); 4172 } 4173 }); 4174} 4175function ep(e) { 4176 if (typeof e == "number") { 4177 if (isNaN(e)) 4178 return "NaN"; 4179 if (e === 1 / 0) 4180 return "Infinity"; 4181 if (e === -1 / 0) 4182 return "-Infinity"; 4183 } 4184 return JSON.stringify(e); 4185} 4186var $S = /* @__PURE__ */ ((e) => (e.X = "x", e.Y = "y", e))($S || {}), YS = class { 4187 constructor() { 4188 this.moduleMap = /* @__PURE__ */ new Map(); 4189 } 4190 *modules() { 4191 for (const e of this.moduleMap.values()) 4192 yield e.moduleInstance; 4193 } 4194 addModule(e, t) { 4195 if (this.moduleMap.has(e.optionsKey)) 4196 throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`); 4197 this.moduleMap.set(e.optionsKey, { module: e, moduleInstance: t(e) }); 4198 } 4199 removeModule(e) { 4200 const t = mn(e) ? e : e.optionsKey; 4201 this.moduleMap.get(t)?.moduleInstance.destroy(), this.moduleMap.delete(t); 4202 } 4203 getModule(e) { 4204 return this.moduleMap.get(mn(e) ? e : e.optionsKey)?.moduleInstance; 4205 } 4206 isEnabled(e) { 4207 return this.moduleMap.has(mn(e) ? e : e.optionsKey); 4208 } 4209 mapModules(e) { 4210 return Array.from(this.moduleMap.values(), (t, i) => e(t.moduleInstance, i)); 4211 } 4212 destroy() { 4213 for (const e of this.moduleMap.keys()) 4214 this.moduleMap.get(e)?.moduleInstance.destroy(); 4215 this.moduleMap.clear(); 4216 } 4217}, Mk = {}; 4218Zo(Mk, { 4219 resetMotion: () => zi 4220}); 4221function zi(e, t) { 4222 const { nodes: i, selections: s } = Bv(e); 4223 for (const n of s) { 4224 for (const o of n.nodes()) { 4225 const r = t(o, o.datum); 4226 o.setProperties(r); 4227 } 4228 n.cleanup(); 4229 } 4230 for (const n of i) { 4231 const o = t(n, n.datum); 4232 n.setProperties(o); 4233 } 4234} 4235function Ak(e) { 4236 let t, i; 4237 const s = n7.exec(e); 4238 s && ([, t, e, i] = s); 4239 const n = s7.exec(e); 4240 if (!n)
4241 throw new Error(`The number formatter is invalid: ${e}`); 4242 const [, o, r, a, l, c, u, d, p, f, m] = n; 4243 return { 4244 fill: o, 4245 align: r, 4246 sign: a, 4247 symbol: l, 4248 zero: c, 4249 width: parseInt(u), 4250 comma: d, 4251 precision: parseInt(p), 4252 trim: !!f, 4253 type: m, 4254 prefix: t, 4255 suffix: i 4256 }; 4257} 4258function Dk(e) { 4259 const t = typeof e == "string" ? Ak(e) : e, { fill: i, align: s, sign: n = "-", symbol: o, zero: r, width: a, comma: l, type: c, prefix: u = "", suffix: d = "", precision: p } = t; 4260 let { trim: f } = t; 4261 const m = p == null || isNaN(p); 4262 let y; 4263 if (!c) 4264 y = ao.g, f = !0; 4265 else if (c in ao && c in $u) 4266 y = m ? $u[c] : ao[c]; 4267 else if (c in ao) 4268 y = ao[c]; 4269 else if (c in $u) 4270 y = $u[c]; 4271 else 4272 throw new Error(`The number formatter type is invalid: ${c}`); 4273 let b; 4274 return p == null || m ? b = c ? 6 : 12 : b = p, (C) => { 4275 let w = y(C, b); 4276 return f && (w = a7(w)), l && (w = l7(w, l)), w = u7(C, w, n), o && o !== "#" && (w = `${o}${w}`), o === "#" && c === "x" && (w = `0x${w}`), c === "s" && (w = `${w}${c7(C)}`), (c === "%" || c === "p") && (w = `${w}%`), a != null && !isNaN(a) && (w = d7(w, a, i ?? r, s)), w = `${u}${w}${d}`, w; 4277 }; 4278} 4279var s7 = /^(?:(.)?([<>=^]))?([+\-( ])?([$â¬Â£Â¥â£â¹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i, n7 = /^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/, $u = { 4280 b: (e) => Df(e).toString(2), 4281 c: (e) => String.fromCharCode(e), 4282 d: (e) => Math.round(Math.abs(e)).toFixed(0), 4283 o: (e) => Df(e).toString(8), 4284 x: (e) => Df(e).toString(16), 4285 X: (e) => $u.x(e).toUpperCase(), 4286 n: (e) => $u.d(e), 4287 "%": (e) => `${Df(e * 100).toFixed(0)}` 4288}, ao = { 4289 e: (e, t) => Math.abs(e).toExponential(t), 4290 E: (e, t) => ao.e(e, t).toUpperCase(), 4291 f: (e, t) => Math.abs(e).toFixed(t), 4292 F: (e, t) => ao.f(e, t).toUpperCase(), 4293 g: (e, t) => { 4294 if (e === 0) 4295 return "0"; 4296 const i = Math.abs(e), s = Math.floor(Math.log10(i)); 4297 return s >= -4 && s < t ? i.toFixed(t - 1 - s) : i.toExponential(t - 1); 4298 }, 4299 G: (e, t) => ao.g(e, t).toUpperCase(), 4300 n: (e, t) => ao.g(e, t), 4301 p: (e, t) => ao.r(e * 100, t), 4302 r: (e, t) => { 4303 if (e === 0) 4304 return "0"; 4305 const i = Math.abs(e), n = Math.floor(Math.log10(i)) - (t - 1); 4306 if (n <= 0) 4307 return i.toFixed(-n); 4308 const o = 10 ** n; 4309 return (Math.round(i / o) * o).toFixed(); 4310 }, 4311 s: (e, t) => { 4312 const i = Rk(e); 4313 return ao.r(e / 10 ** i, t); 4314 }, 4315 "%": (e, t) => ao.f(e * 100, t) 4316}, Ek = -24, Ik = 24, o7 = { 4317 [Ek]: "y", 4318 [-21]: "z", 4319 [-18]: "a", 4320 [-15]: "f", 4321 [-12]: "p", 4322 [-9]: "n", 4323 [-6]: "µ", 4324 [-3]: "m", 4325 0: "", 4326 3: "k", 4327 6: "M", 4328 9: "G", 4329 12: "T", 4330 15: "P", 4331 18: "E", 4332 21: "Z", 4333 [Ik]: "Y" 4334}, r7 = "â"; 4335function Df(e) { 4336 return Math.floor(Math.abs(e)); 4337} 4338function a7(e) { 4339 return e.replace(/\.0+$/, "").replace(/(\.[1-9])0+$/, "$1"); 4340} 4341function l7(e, t) { 4342 let i = e.indexOf("."); 4343 i < 0 && (i = e.length); 4344 const s = e.substring(0, i).split(""), n = e.substring(i); 4345 for (let o = s.length - 3; o > 0; o -= 3) 4346 s.splice(o, 0, t); 4347 return `${s.join("")}${n}`; 4348} 4349function c7(e) { 4350 return o7[Rk(e)]; 4351} 4352function Rk(e) { 4353 return ot(Ek, e ? Math.floor(Math.log10(Math.abs(e)) / 3) * 3 : 0, Ik); 4354} 4355function u7(e, t, i = "") { 4356 if (i === "(") 4357 return e >= 0 ? t : `(${t})`; 4358 const s = i === "+" ? "+" : ""; 4359 return `${e >= 0 ? s : r7}${t}`; 4360} 4361function d7(e, t, i = " ", s = ">") { 4362 let n = e; 4363 if (s === ">" || !s) 4364 n = n.padStart(t, i); 4365 else if (s === "<") 4366 n = n.padEnd(t, i); 4367 else if (s === "^") { 4368 const o = Math.max(0, t - n.length), r = Math.ceil(o / 2), a = Math.floor(o / 2); 4369 n = n.padStart(r + n.length, i), n = n.padEnd(a + n.length, i); 4370 } 4371 return n; 4372} 4373function h7(e) { 4374 return e.getTime(); 4375} 4376function p7(e) { 4377 return new Date(e); 4378} 4379var Tk = new zn(h7, p7), wi = (e, t, i) => ({ 4380 duration: t * i, 4381 timeInterval: e, 4382 step: i 4383}), Gh = [ 4384 wi(ju, il, 1), 4385 wi(ju, il, 5), 4386 wi(ju, il, 15), 4387 wi(ju, il, 30), 4388 wi(Wu, ds, 1), 4389 wi(Wu, ds, 5), 4390 wi(Wu, ds, 15), 4391 wi(Wu, ds, 30), 4392 wi(Uu, Ys, 1), 4393 wi(Uu, Ys, 3), 4394 wi(Uu, Ys, 6), 4395 wi(Uu, Ys, 12), 4396 wi(Pm, fo, 1), 4397 wi(Pm, fo, 2), 4398 wi(Jh, Qr, 1), 4399 wi(Jh, Qr, 2), 4400 wi(Jh, Qr, 3), 4401 wi(mc, Sh, 1), 4402 wi(mc, Sh, 2), 4403 wi(mc, Sh, 3), 4404 wi(mc, Sh, 4), 4405 wi(mc, Sh, 6), 4406 wi(zv, bd, 1) 4407], Lk = [1, 2, 5, 10]; 4408function pI(e, t) { 4409 return Math.abs(Math.round(e) - e) < t; 4410} 4411function KS(e, t, i, s, n) { 4412 if (i < 2) 4413 return [e, t]; 4414 const o = Dp(e, t, i, s, n);
4415 return Number.isFinite(o) ? (pI(e / o, 1e-12) || (e = Math.ceil(e / o) * o), pI(t / o, 1e-12) || (t = Math.floor(t / o) * o), $v(e, t, o)) : []; 4416} 4417function gI(e, t, i, s, n, o) { 4418 const r = Math.abs(t - e) / Math.max(i, 1); 4419 let a = 0; 4420 for (const p of Gh) { 4421 if (r <= p.duration) 4422 break; 4423 a++; 4424 } 4425 if (a === 0) { 4426 const p = Math.max(Dp(e, t, i, s, n), 1); 4427 return Tk.every(p); 4428 } else if (a === Gh.length) { 4429 const p = Dp(e / bd, t / bd, i, s, n); 4430 return zv.every(p); 4431 } 4432 const l = Gh[a - 1], c = Gh[a], { timeInterval: u, step: d } = r - l.duration < c.duration - r ? l : c; 4433 return u.every(d); 4434} 4435function Dp(e, t, i, s = 0, n = 1 / 0) { 4436 if (e === t) 4437 return ot(1, s, n); 4438 if (i < 1) 4439 return NaN; 4440 const o = Math.abs(t - e), r = 10 ** Math.floor(Math.log10(o / i)); 4441 let a = NaN, l = 1 / 0, c = !1; 4442 for (const u of Lk) { 4443 const d = Math.ceil(o / (u * r)), p = d >= s && d <= n; 4444 if (c && !p) 4445 continue; 4446 const f = Math.abs(d - i); 4447 (l > f || c !== p) && (c || (c = p), l = f, a = u); 4448 } 4449 return a * r; 4450} 4451function fI(e) { 4452 for (let t = e.length - 1; t >= 0; t -= 1) 4453 if (e[t] !== "0") 4454 return t + 1; 4455 return 0; 4456} 4457function g7(e, t) { 4458 const i = Ak(t ?? ",f"); 4459 (i.precision == null || isNaN(i.precision)) && (!i.type || "eEFgGnprs".includes(i.type) ? i.precision = Math.max( 4460 ...e.map((n) => { 4461 if (!Number.isFinite(n)) 4462 return 0; 4463 const [o, r] = n.toExponential((i.type ? 6 : 12) - 1).split(/[.e]/g); 4464 return (o !== "1" && o !== "-1" ? 1 : 0) + fI(r) + 1; 4465 }) 4466 ) : "f%".includes(i.type) && (i.precision = Math.max( 4467 ...e.map((n) => { 4468 if (!Number.isFinite(n) || n === 0) 4469 return 0; 4470 const o = Math.floor(Math.log10(Math.abs(n))), r = i.type ? 6 : 12, a = n.toExponential(r - 1).split(/[.e]/g)[1], l = fI(a); 4471 return Math.max(0, l - o); 4472 }) 4473 ))); 4474 const s = Dk(i); 4475 return (n) => s(Number(n)); 4476} 4477function $v(e, t, i) { 4478 if (!Number.isFinite(i) || i <= 0) 4479 return []; 4480 const s = 10 ** Fv(i), n = Math.min(e, t), o = Math.max(e, t), r = []; 4481 for (let a = 0; ; a += 1) { 4482 const l = Math.round((n + i * a) * s) / s; 4483 if (l > o) 4484 break; 4485 r.push(l); 4486 } 4487 return r; 4488} 4489function Ep(e, t) { 4490 return e >= t ? (Ee.warnOnce( 4491 "the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration" 4492 ), !0) : !1; 4493} 4494function f7(e, t) { 4495 const i = Math.abs(t - e), s = 10 ** Math.floor(Math.log10(i)); 4496 let n = 1 / 0, o = [e, t]; 4497 for (const r of Lk) { 4498 const a = r * s, l = Math.floor(e / a) * a, c = Math.ceil(t / a) * a, u = 1 - i / Math.abs(c - l); 4499 n > u && (n = u, o = [l, c]); 4500 } 4501 return o; 4502} 4503function kk(e, t, i, s, n) { 4504 n = Math.max(n, e / (s + 1)), isNaN(t) && (t = n), isNaN(i) && (i = e), t > i && (t === n ? t = i : i = t); 4505 const o = Math.max(1, Math.floor(e / t)), r = Math.min(o, Math.ceil(e / i)), a = ot(r, s, o); 4506 return { minTickCount: r, maxTickCount: o, tickCount: a }; 4507} 4508var Pk = class uw extends ti { 4509 constructor() { 4510 super([1, 10], [0, 1]), this.type = "log", this.base = 10, this.baseLog = rw, this.basePow = rw, this.log = (t) => Math.min(...this.domain) >= 0 ? this.baseLog(t) : -this.baseLog(-t), this.pow = (t) => Math.min(...this.domain) >= 0 ? this.basePow(t) : -this.basePow(-t), this.defaultClamp = !0; 4511 } 4512 toDomain(t) { 4513 return t; 4514 } 4515 transform(t) { 4516 return Math.min(...this.domain) >= 0 ? Math.log(t) : -Math.log(-t); 4517 } 4518 transformInvert(t) { 4519 return Math.min(...this.domain) >= 0 ? Math.exp(t) : -Math.exp(-t); 4520 } 4521 refresh() { 4522 this.base <= 0 && (this.base = 0, Ee.warnOnce("expecting a finite Number greater than to 0")), super.refresh(); 4523 } 4524 update() { 4525 !this.domain || this.domain.length < 2 || (this.baseLog = uw.getBaseLogMethod(this.base), this.basePow = uw.getBasePowerMethod(this.base), this.nice && this.updateNiceDomain()); 4526 } 4527 updateNiceDomain() { 4528 const [t, i] = this.domain, s = t > i ? Math.ceil : Math.floor, n = t > i ? Math.floor : Math.ceil, o = this.pow(s(this.log(t))), r = this.pow(n(this.log(i))); 4529 this.niceDomain = [o, r]; 4530 } 4531 ticks() { 4532 const t = this.tickCount ?? 10;
4533 if (!this.domain || this.domain.length < 2 || t < 1) 4534 return []; 4535 this.refresh(); 4536 const i = this.base, [s, n] = this.getDomain(), o = Math.min(s, n), r = Math.max(s, n); 4537 let a = this.log(o), l = this.log(r); 4538 if (this.interval) { 4539 const f = (b) => b >= o && b <= r, m = Math.min(Math.abs(this.interval), Math.abs(l - a)), y = $v(a, l, m).map(this.pow).filter(f); 4540 if (!Ep(y.length, this.getPixelRange())) 4541 return y; 4542 } 4543 if (!UL(i) || l - a >= t) 4544 return KS(a, l, Math.min(l - a, t)).map(this.pow); 4545 const c = [], u = o > 0; 4546 a = Math.floor(a) - 1, l = Math.round(l) + 1; 4547 const d = wp(this.range) / t; 4548 let p = 1 / 0; 4549 for (let f = a; f <= l; f++) { 4550 const m = this.convert(this.pow(f + 1)); 4551 for (let y = 1; y < i; y++) { 4552 const b = u ? y : i - y + 1, C = this.pow(f) * b, w = this.convert(C), M = Math.abs(p - w), A = Math.abs(w - m), I = M >= d && A >= d; 4553 C >= o && C <= r && (y === 1 || I || c.length === 0) && (c.push(C), p = w); 4554 } 4555 } 4556 return c; 4557 } 4558 tickFormat({ specifier: t }) { 4559 return t ?? (t = this.base === 10 ? ".0e" : ","), mn(t) ? Dk(t) : t; 4560 } 4561 static getBaseLogMethod(t) { 4562 switch (t) { 4563 case 10: 4564 return Math.log10; 4565 case Math.E: 4566 return Math.log; 4567 case 2: 4568 return Math.log2; 4569 default: 4570 return (i) => Math.log(i) / Math.log(t); 4571 } 4572 } 4573 static getBasePowerMethod(t) { 4574 switch (t) { 4575 case 10: 4576 return (i) => i >= 0 ? 10 ** i : 1 / 10 ** -i; 4577 case Math.E: 4578 return Math.exp; 4579 default: 4580 return (i) => t ** i; 4581 } 4582 } 4583}; 4584S([ 4585 os 4586], Pk.prototype, "base", 2); 4587var ZS = Pk; 4588function Fk(e, t, i) { 4589 if (e > t) 4590 return; 4591 let s; 4592 for (; t >= e; ) { 4593 const n = Math.floor((t + e) / 2); 4594 i(n) ? (s = n, e = n + 1) : t = n - 1; 4595 } 4596 return s; 4597} 4598function Ok(e, t, i) { 4599 if (e > t) 4600 return; 4601 let s; 4602 for (; t >= e; ) { 4603 const n = Math.floor((t + e) / 2); 4604 i(n) ? (s = n, t = n - 1) : e = n + 1; 4605 } 4606 return s; 4607} 4608function m7(e, t, i) { 4609 if (e > t) 4610 return; 4611 let s; 4612 for (; t >= e; ) { 4613 const n = Math.floor((t + e) / 2), o = i(n); 4614 o == null ? t = n - 1 : (s = o, e = n + 1); 4615 } 4616 return s; 4617} 4618function Nk(e, t, i) { 4619 if (e > t) 4620 return; 4621 let s; 4622 for (; t >= e; ) { 4623 const n = Math.floor((t + e) / 2), o = i(n); 4624 o == null ? e = n + 1 : (s = o, t = n - 1); 4625 } 4626 return s; 4627} 4628function _k(e, t) { 4629 return e.valueOf() - t.valueOf(); 4630} 4631function v7(e) { 4632 let t = NaN; 4633 const i = []; 4634 for (const s of e) { 4635 const n = s.valueOf(); 4636 t !== n && i.push(s), t = n; 4637 } 4638 return i; 4639} 4640function Bk(e) { 4641 const t = e.slice().sort(_k); 4642 return qS(e) == null ? v7(t) : t; 4643} 4644function qS(e) { 4645 if (e.length === 0) 4646 return 1; 4647 const t = Number(e[e.length - 1]) > Number(e[0]) ? 1 : -1; 4648 let i = -1 / 0 * t; 4649 for (const s of e) { 4650 const n = s.valueOf(); 4651 if (Math.sign(n - i) !== t) 4652 return; 4653 i = n; 4654 } 4655 return t; 4656} 4657var QS = class om extends ti { 4658 constructor() { 4659 super([], [0, 1]), this.type = "time"; 4660 } 4661 toDomain(t) { 4662 return new Date(t); 4663 } 4664 convert(t, i) { 4665 return t instanceof Date || (t = new Date(t)), super.convert(t, i); 4666 } 4667 invert(t) { 4668 return new Date(super.invert(t)); 4669 } 4670 /** 4671 * Returns uniformly-spaced dates that represent the scale's domain. 4672 */ 4673 ticks() { 4674 if (!this.domain || this.domain.length < 2) 4675 return []; 4676 this.refresh(); 4677 const { interval: t, nice: i, tickCount: s, minTickCount: n, maxTickCount: o } = this, [r, a] = Ds(this.getDomain().map(hn)); 4678 return t != null ? om.getTicksForInterval({ start: r, stop: a, interval: t, availableRange: this.getPixelRange() }) ?? om.getDefaultTicks({ start: r, stop: a, tickCount: s, minTickCount: n, maxTickCount: o }) : i && s === 2 ? this.niceDomain : i && s === 1 ? this.niceDomain.slice(0, 1) : om.getDefaultTicks({ start: r, stop: a, tickCount: s, minTickCount: n, maxTickCount: o }); 4679 } 4680 static getDefaultTicks({ 4681 start: t, 4682 stop: i, 4683 tickCount: s, 4684 minTickCount: n, 4685 maxTickCount: o 4686 }) { 4687 const r = gI(t, i, s, n, o); 4688 return r ? r.range(new Date(t), new Date(i)) : []; 4689 } 4690 static getTicksForInterval({ 4691 start: t, 4692 stop: i, 4693 interval: s, 4694 availableRange: n 4695 }) { 4696 if (!s) 4697 return []; 4698 if (s instanceof wd) { 4699 const u = s.range(new Date(t), new Date(i)); 4700 return Ep(u.length, n) ? void 0 : u; 4701 } 4702 const o = Math.abs(s); 4703 if (Ep((i - t) / o, n)) 4704 return; 4705 const r = Gh.findLast((u) => o % u.duration === 0); 4706 if (r) 4707 return r.timeInterval.every(o / (r.duration / r.step)).range(new Date(t), new Date(i)); 4708 let a = new Date(t); 4709 const l = new Date(i), c = []; 4710 for (; a <= l; ) 4711 c.push(a), a = new Date(a), a.setMilliseconds(a.getMilliseconds() + o); 4712 return c; 4713 } 4714 /** 4715 * Returns a time format function suitable for displaying tick values. 4716 * 4717 * @param ticks Optional array of tick values for custom formatting. 4718 * @param domain Optional array representing the [min, max] values of the time axis. 4719 * @param specifier Optional format specifier string for custom date formatting (e.g., `%Y`, `%m`, `%d`). 4720 * @param formatOffset Optional number for applying an offset to the format (e.g., timezone shifts). 4721 * @returns A function that formats a `Date` object into a string based on the provided specifier or default format. 4722 */ 4723 tickFormat({ 4724 ticks: t, 4725 domain: i, 4726 specifier: s, 4727 formatOffset: n 4728 }) { 4729 return s == null ? zS(t, i, n) : rg(s); 4730 } 4731 update() { 4732 !this.domain || this.domain.length < 2 || this.nice && this.updateNiceDomain(); 4733 } 4734 /** 4735 * Extends the domain so that it starts and ends on nice round values. 4736 * This method typically modifies the scaleâs domain, and may only extend the bounds to the nearest roun
4736d value. 4737 */ 4738 updateNiceDomain() { 4739 let [i, s] = this.domain; 4740 for (let n = 0; n < 4; n++) { 4741 this.updateNiceDomainIteration(i, s); 4742 const [o, r] = this.niceDomain; 4743 if (hn(i) === hn(o) && hn(s) === hn(r)) 4744 break; 4745 i = o, s = r; 4746 } 4747 } 4748 updateNiceDomainIteration(t, i) { 4749 const s = Math.min(hn(t), hn(i)), n = Math.max(hn(t), hn(i)), o = t > i, { interval: r } = this; 4750 let a; 4751 if (r instanceof wd) 4752 a = r; 4753 else { 4754 const l = typeof r == "number" ? (n - s) / Math.max(r, 1) : this.tickCount; 4755 a = gI(s, n, l, this.minTickCount, this.maxTickCount); 4756 } 4757 if (a) { 4758 const l = a.range(new Date(s), new Date(n), !0), c = o ? [...l].reverse() : l, u = c[0], d = c.at(-1); 4759 this.niceDomain = [u, d]; 4760 } 4761 } 4762}, hg = class Gk extends Tl { 4763 constructor() { 4764 super(...arguments), this.type = "ordinal-time", this.tickCount = ti.defaultTickCount, this.minTickCount = 0, this.maxTickCount = 1 / 0, this.interval = void 0, this._domain = [], this.sortedTimestamps = [], this.visibleRange = [0, 1], this.isReversed = !1, this._values = void 0; 4765 } 4766 static is(t) { 4767 return t instanceof Gk; 4768 } 4769 setVisibleRange(t) { 4770 this.visibleRange = t; 4771 } 4772 set domain(t) { 4773 if (t === this._values) 4774 return; 4775 this.invalid = !0; 4776 const i = qS(t), s = i == null ? Bk(t) : t, n = i === -1, o = s.map(hn); 4777 n && o.reverse(), this._values = t, this._domain = s, this.isReversed = n, this.sortedTimestamps = o, this.prec
4777omputedSteps = void 0; 4778 const r = t.length < 1e4 ? o.length : Math.ceil(o.length / 16); 4779 if (r <= 1) 4780 return; 4781 this.refresh(); 4782 const a = new Int32Array(r), l = o[0].valueOf(), u = o[o.length - 1].valueOf() - l; 4783 for (let d = 0; d < a.length; d += 1) 4784 a[d] = this.findInterval(l + d / r * u); 4785 this.precomputedSteps = a; 4786 } 4787 get domain() { 4788 return this._domain; 4789 } 4790 ticks() { 4791 if (!this._domain.length) 4792 return []; 4793 this.refresh(); 4794 const { domain: t, isReversed: i, interval: s } = this, [n, o] = [t[0].valueOf(), t.at(-1).valueOf()], r = Math.min(n, o), a = Math.max(n, o); 4795 if (s == null) 4796 return this.getDefaultTicks(this.maxTickCount, i); 4797 const [l, c] = this.range, u = Math.abs(c - l), d = QS.getTicksForInterval({ start: r, stop: a, interval: s, availableRange: u }) ?? []; 4798 let p = -1; 4799 return d.filter((f) => { 4800 const m = this.findInterval(f.valueOf()), y = m === p; 4801 return p = m, !y; 4802 }); 4803 } 4804 getDefaultTicks(t, i) { 4805 const { domain: s, visibleRange: n }
4805 = this, o = [], r = Math.ceil(s.length * (n[1] - n[0]) / t), a = Math.floor(r / 2); 4806 for (let l = 0; l < s.length; l += 1) { 4807 const c = s[l], u = i ? s.length - 1 - l : l; 4808 (r <= 0 || (u + a) % r === 0) && o.push(c); 4809 } 4810 return i && o.reverse(), o; 4811 } 4812 convert(t) { 4813 this.refresh(); 4814 const i = Number(t); 4815 if (i < this.sortedTimestamps[0]) 4816 return NaN; 4817 let s = this.findInterval(i); 4818 return this.isReversed && (s = this.domain.length - s - 1), this.ordinalRange(s); 4819 } 4820 findInterval(t) { 4821 const { sortedTimestamps: i, precomputedSteps: s } = this; 4822 let n, o; 4823 if (s == null) 4824 n = 0, o = i.length - 1; 4825 else { 4826 const r = i[0].valueOf(), a = i[i.length - 1].valueOf(), l = Math.min( 4827 (t - r) / (a - r) * s.length | 0, 4828 s.length - 1 | 0 4829 ); 4830 n = s[l], o = l < s.length - 2 ? s[l + 1] : i.length - 1; 4831 } 4832 for (; n <= o; ) { 4833 const r = (n + o) / 2 | 0; 4834 if (i[r] === t) 4835 return r; 4836 i[r] < t ? n = r + 1 : o = r - 1; 4837 } 4838 return n; 4839 } 4840 /** 4841 * Returns a time format function suitable for displaying tick values. 4842 * @param specifier If the specifier string is provided, this method is equivalent to 4843 * the {@link TimeLocaleObject.format} method. 4844 * If no specifier is provided, this method returns the default time format function. 4845 */ 4846 tickFormat({ 4847 ticks: t, 4848 domain: i, 4849 specifier: s 4850 }) { 4851 return s == null ? zS(t, i) : rg(s); 4852 } 4853 invert(t) { 4854 this.refresh(); 4855 const { domain: i } = this; 4856 return Nk(0, i.length - 1, (n) => this.ordinalRange(n) >= t ? i[n] : void 0) ?? i[0]; 4857 } 4858 invertNearest(t) { 4859 return super.invertNearest(t); 4860 } 4861}; 4862S([ 4863 os 4864], hg.prototype, "tickCount", 2); 4865S([ 4866 os 4867], hg.prototype, "minTickCount", 2); 4868S([ 4869 os 4870], hg.prototype, "maxTickCount", 2); 4871S([ 4872 os 4873], hg.prototype, "interval", 2); 4874var Oo = hg; 4875function y7(e, t) { 4876 return typeof e == "number" && typeof t == "number" ? e - t : typeof e == "string" && typeof t == "string" ? e.localeCompare(t) : e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : String(e).localeCompare(String(t)); 4877} 4878var zk = [1, 0, 0, 1, 0, 0]; 4879function Cu(e, t, i = 1e-8) { 4880 return e === t || Math.abs(t - e) < i; 4881} 4882var dw = class Ou { 4883 get e() { 4884 return [...this.elements]; 4885 } 4886 constructor(t = [...zk]) { 4887 this.elements = t; 4888 } 4889 setElements(t) { 4890 const i = this.elements; 4891 return i[0] = t[0], i[1] = t[1], i[2] = t[2], i[3] = t[3], i[4] = t[4], i[5] = t[5], this; 4892 } 4893 get identity() { 4894 const t = this.elements; 4895 return Cu(t[0], 1) && Cu(t[1], 0) && Cu(t[2], 0) && Cu(t[3], 1) && Cu(t[4], 0) && Cu(t[5], 0); 4896 } 4897 /** 4898 * Performs the AxB matrix multiplication and saves the result 4899 * to `C`, if given, or to `A` otherwise. 4900 */ 4901 AxB(t, i, s) { 4902 const n = t[0] * i[0] + t[2] * i[1], o = t[1] * i[0] + t[3] * i[1], r = t[0] * i[2] + t[2] * i[3], a = t[1] * i[2] + t[3] * i[3], l = t[0] * i[4] + t[2] * i[5] + t[4], c = t[1] * i[4] + t[3] * i[5] + t[5]; 4903 s = s ?? t, s[0] = n, s[1] = o, s[2] = r, s[3] = a, s[4] = l, s[5] = c; 4904 } 4905 /** 4906 * The `other` matrix gets post-multiplied to the current matrix. 4907 * Returns the current matrix. 4908 * @param other 4909 */ 4910 multiplySelf(t) { 4911 return this.AxB(this.elements, t.elements), this; 4912 } 4913 /** 4914 * The `other` matrix gets post-multiplied to the current matrix. 4915 * Returns a new matrix. 4916 * @param other 4917 */ 4918 multiply(t) { 4919 const i = new Array(6); 4920 return t instanceof Ou ? this.AxB(this.elements, t.elements, i) : this.AxB(this.elements, [t.a, t.b, t.c, t.d, t.e, t.f], i), new Ou(i); 4921 } 4922 preMultiplySelf(t) { 4923 return this.AxB(t.elements, this.elements, this.elements), this; 4924 } 4925 /** 4926 * Returns the inverse of this matrix as a new matrix. 4927 */ 4928 inverse() { 4929 const t = this.elements; 4930 let i = t[0], s = t[1], n = t[2], o = t[3]; 4931 const r = t[4], a = t[5], l = 1 / (i * o - s * n); 4932 return i *= l, s *= l, n *= l, o *= l, new Ou([o, -s, -n, i, n * a - o * r, s * r - i * a]); 4933 } 4934 /** 4935 * Save the inverse of this matrix to the given matrix. 4936 */ 4937 inverseTo(t) { 4938 const i = this.elements; 4939 let s = i[0], n = i[1], o = i[2], r = i[3]; 4940 const a = i[4], l = i[5], c = 1 / (s * r - n * o); 4941 return s *= c, n *= c, o *= c, r *= c, t.setElements([r, -n, -o, s, o * l - r * a, n * a - s * l]), this; 4942 } 4943 invertSelf() { 4944 const t = this.elements; 4945 let i = t[0], s = t[1], n = t[2], o = t[3]; 4946 const r = t[4], a = t[5], l = 1 / (i * o - s * n); 4947 return i *= l, s *= l, n *= l, o *= l, t[0] = o, t[1] = -s, t[2] = -n, t[3] = i, t[4] = n * a - o * r, t[5] = s * r - i * a, this; 4948 } 4949 transformPoint(t, i) { 4950 const s = this.elements; 4951 return { 4952 x: t * s[0] + i * s[2] + s[4], 4953 y: t * s[1] + i * s[3] + s[5] 4954 }; 4955 } 4956 transformBBox(t, i) { 4957 const s = this.elements, n = s[0], o = s[1], r = s[2], a = s[3], l = t.width * 0.5, c = t.height * 0.5, u = t.x + l, d = t.y + c, p = Math.abs(l * n) + Math.abs(c * r), f = Math.abs(l * o) + Math.abs(c * a); 4958 return i ?? (i = new _e(0, 0, 0, 0)), i.x = u * n + d * r + s[4] - p, i.y = u * o + d * a + s[5] - f, i.width = p + p, i.height = f + f, i; 4959 } 4960 toContext(t) { 4961 if (this.identity) 4962 return; 4963 const i = this.elements; 4964 t.transform(i[0], i[1], i[2], i[3], i[4], i[5]); 4965 } 4966 static flyweight(t) { 4967 return Ou.instance.setElements(t.elements); 4968 } 4969 static updateTransformMatrix(t, i, s, n, o, r, a) { 4970 const l = i, c = s; 4971 let u, d; 4972 l === 1 && c === 1 ? (u = 0, d = 0) : (u = a?.scalingCenterX ?? 0, d = a?.scalingCenterY ?? 0);
4973 const p = n, f = Math.cos(p), m = Math.sin(p); 4974 let y, b; 4975 p === 0 ? (y = 0, b = 0) : (y = a?.rotationCenterX ?? 0, b = a?.rotationCenterY ?? 0); 4976 const C = o, w = r, M = u * (1 - l) - y, A = d * (1 - c) - b; 4977 return t.setElements([ 4978 f * l, 4979 m * l, 4980 -m * c, 4981 f * c, 4982 f * M - m * A + y + C, 4983 m * M + f * A + b + w 4984 ]), t; 4985 } 4986 static fromContext(t) { 4987 const i = t.getTransform(); 4988 return new Ou([i.a, i.b, i.c, i.d, i.e, i.f]); 4989 } 4990}; 4991dw.instance = new dw(); 4992var Ho = dw; 4993function Wa(e) { 4994 return Vk(e.constructor); 4995} 4996var Hk = /* @__PURE__ */ Symbol("isMatrixTransform"); 4997function Vk(e) { 4998 return e[Hk] === !0; 4999} 5000function XS(e) { 5001 var t, i; 5002 const s = e; 5003 if (Vk(e)) 5004 return e; 5005 const n = /* @__PURE__ */ Symbol("matrix_combined_transform"); 5006 class o extends s { 5007 constructor() { 5008 super(...arguments), this[i] = new Ho(), this._dirtyTransform = !0; 5009 } 5010 markDirtyTransform() { 5011 this._dirtyTransform = !0, super.markDirty(); 5012 } 5013 updateMatrix(a) { 5014 } 5015 computeTransformMatrix() { 5016 this._dirtyTransform && (this[n].setElements(zk), this.updateMatrix(this[n]), this._dirtyTransform = !1); 5017 } 5018 toParent(a) { 5019 return this.computeTransformMatrix(), this[n].identity ? a.clone() : this[n].transformBBox(a); 5020 } 5021 toParentPoint(a, l) { 5022 return this.computeTransformMatrix(), this[n].identity ? { x: a, y: l } : this[n].transformPoint(a, l); 5023 } 5024 fromParent(a) { 5025 return this.computeTransformMatrix(), this[n].identity ? a.clone() : this[n].inverse().transformBBox(a); 5026 } 5027 fromParentPoint(a, l) { 5028 return this.computeTransformMatrix(), this[n].identity ? { x: a, y: l } : this[n].inverse().transformPoint(a, l); 5029 } 5030 computeBBox() { 5031 const a = super.computeBBox(); 5032 return a && this.toParent(a); 5033 } 5034 computeBBoxWithoutTransforms() { 5035 return super.computeBBox(); 5036 } 5037 pickNode(a, l, c = !1) { 5038 return c || ({ x: a, y: l } = this.fromParentPoint(a, l)), super.pickNode(a, l); 5039 } 5040 render(a) { 5041 this.computeTransformMatrix(); 5042 const { ctx: l } = a, c = this[n]; 5043 let u = !1; 5044 c.identity || (l.save(), u = !0, c.toContext(l)), super.render(a), u && l.restore(); 5045 } 5046 toSVG() { 5047 this.computeTransformMatrix(); 5048 const a = super.toSVG(), l = this[n]; 5049 if (l.identity || a == null) 5050 return a; 5051 const c = document.createElementNS("http://www.w3.org/2000/svg", "g"); 5052 c.append(...a.elements); 5053 const [u, d, p, f, m, y] = l.e; 5054 return c.setAttribute("transform", `matrix(${u} ${d} ${p} ${f} ${m} ${y})`), { 5055 elements: [c], 5056 defs: a.defs 5057 }; 5058 } 5059 } 5060 return t = Hk, i = n, o[t] = !0, o; 5061} 5062function Vc(e) { 5063 var t; 5064 const i = e, s = /* @__PURE__ */ Symbol("matrix_rotation"); 5065 class n extends XS(i) { 5066 constructor() { 5067 super(...arguments), this[t] = new Ho(), this.rotationCenterX = null, this.rotationCenterY = null, this.rotation = 0; 5068 } 5069 updateMatrix(r) { 5070 super.updateMatrix(r); 5071 const { rotation: a, rotationCenterX: l, rotationCenterY: c } = this; 5072 a !== 0 && (Ho.updateTransformMatrix(this[s], 1, 1, a, 0, 0, { 5073 rotationCenterX: l, 5074 rotationCenterY: c 5075 }), r.multiplySelf(this[s])); 5076 } 5077 } 5078 return t = s, S([ 5079 Ge({ type: "transform" }) 5080 ], n.prototype, "rotationCenterX", 2), S([ 5081 Ge({ type: "transform" }) 5082 ], n.prototype, "rotationCenterY", 2), S([ 5083 Ge({ type: "transform" }) 5084 ], n.prototype, "rotation", 2), n; 5085} 5086function JS(e) { 5087 var t; 5088 const i = e, s = /* @__PURE__ */ Symbol("matrix_scale"); 5089 class n extends XS(i) { 5090 constructor() { 5091 super(...arguments), this[t] = new Ho(), this.scalingX = 1, this.scalingY = 1, this.scalingCenterX = null, this.scalingCenterY = null; 5092 } 5093 updateMatrix(r) { 5094 super.updateMatrix(r); 5095 const { scalingX: a, scalingY: l, scalingCenterX: c, scalingCenterY: u } = this; 5096 a === 1 && l === 1 || (Ho.updateTransformMatrix(this[s], a, l, 0, 0, 0, { 5097 scalingCenterX: c, 5098 scalingCenterY: u 5099 }), r.multiplySelf(this[s])); 5100 } 5101 } 5102 return t = s, S([ 5103 Ge({ type: "transform" }) 5104 ], n.prototype, "scalingX", 2), S([ 5105 Ge({ type: "transform" }) 5106 ], n.prototype, "scalingY", 2), S([ 5107 Ge({ type: "transform" }) 5108 ], n.prototype, "scalingCenterX", 2), S([ 5109 Ge({ type: "transform" }) 5110 ], n.prototype, "scalingCenterY", 2), n; 5111} 5112function Uc(e) { 5113 var t; 5114 const i = e, s = /* @__PURE__ */ Symbol("matrix_translation"); 5115 class n extends XS(i) { 5116 constructor() { 5117 super(...arguments), this[t] = new Ho(), this.translationX = 0, this.translationY = 0; 5118 } 5119 updateMatrix(r) { 5120 super.updateMatrix(r); 5121 const { translationX: a, translationY: l } = this; 5122 a === 0 && l === 0 || (Ho.updateTransformMatrix(this[s], 1, 1, 0, a, l), r.multiplySelf(this[s])); 5123 } 5124 } 5125 return t = s, S([ 5126 Ge({ type: "transform" }) 5127 ], n.prototype, "translationX", 2), S([ 5128 Ge({ type: "transform" }) 5129 ], n.prototype, "translationY", 2), n; 5130} 5131var Ii = class { 5132 /** 5133 * Converts a BBox from canvas coordinate space into the coordinate space of the given Node. 5134 */ 5135 static fromCanvas(e, t) { 5136 const i = []; 5137 for (const s of e.traverseUp()) 5138 Wa(s) && i.unshift(s); 5139 for (const s of i) 5140 t = s.fromParent(t); 5141 return Wa(e) && (t = e.fromParent(t)), t; 5142 } 5143 /** 5144 * Converts a Nodes BBox (or an arbitrary BBox if supplied) from local Node coordinate space 5145 * into the Canvas coordinate space. 5146 */ 5147 static toCanvas(e, t) { 5148 t == null ? t = e.getBBox() : Wa(e) && (t = e.toParent(t)); 5149 for (const i of e.traverseUp()) 5150 Wa(i) && (t = i.toParent(t)); 5151 return t; 5152 } 5153 /** 5154 * Converts a point from canvas coordinate space into the coordinate space of the given Node. 5155 */ 5156 static fromCanvasPoint(e, t, i) { 5157 const s = []; 5158 for (const n of e.traverseUp()) 5159 Wa(n) && s.unshift(n); 5160 for (const n of s) 5161 ({ x: t, y: i } = n.fromParentPoint(t, i)); 5162 return Wa(e) && ({ x: t, y: i } = e.fromParentPoint(t, i)), { x: t, y: i }; 5163 } 5164 /** 5165 * Converts a point from a Nodes local coordinate space into the Canvas coordinate space. 5166 */ 5167 static toCanvasPoint(e, t, i) { 5168 Wa(e) && ({ x: t, y: i } = e.toParentPoint(t, i)); 5169 for (const s of e.traverseUp()) 5170 Wa(s) && ({ x: t, y: i } = s.toParentPoint(t, i)); 5171 return { x: t, y: i }; 5172 } 5173}, Hb = (e, t) => Math.sign(e - t); 5174function Uk(e, t) { 5175 if (typeof e == "number" && typeof t == "number") 5176 return Hb(e, t); 5177 const i = typeof e == "number" ? [e] : e, s = typeof t == "number" ? [t] : t, n = Math.min(i.length, s.length); 5178 for (let o = 0; o < n; o += 1) { 5179 const r = Hb(i[o], s[o]); 5180 if (r !== 0) 5181 return r; 5182 } 5183 return Hb(i.length, s.length); 5184} 5185var ex = class rm extends wl { 5186 constructor(t) { 5187 super(t), this.opacity = 1, this.layer = void 0, this.renderToOffscreenCanvas = !1, this.isContainerNode = !0, this.renderToOffscreenCanvas = t?.renderToOffscreenCanvas === !0; 5188 } 5189 static is(t) { 5190 return t instanceof rm; 5191 } 5192 static computeChildrenBBox(t, i = !0) { 5193 return _e.merge(wl.extractBBoxes(t, i)); 5194 } 5195 static compareChildren(t, i) { 5196 return Uk(t.zIndex, i.zIndex) || y7(t.serialNumber, i.serialNumber); 5197 } 5198 // We consider a group to be boundless, thus any point belongs to it. 5199 containsPoint(t, i) { 5200 return !0; 5201 } 5202 computeBBox() { 5203 return rm.computeChildrenBBox(this.children()); 5204 } 5205 isDirty(t) { 5206 const { resized: i } = t, { dirty: s, dirtyZIndex: n } = this; 5207 if (s || n || i) 5208 return !0; 5209 for (const o of this.children()) 5210 if (o.dirty) 5211 return !0; 5212 return !1; 5213 } 5214 preRender() { 5215 const t = super.preRender(0); 5216 return t.groups += 1, t.nonGroups -= 1, this.renderToOffscreenCanvas && t.nonGroups > 0 && this.getVisibility() ? this.layer ?? (this.layer = this._layerManager?.addLayer({ name: this.name })) : this.layer != null && (this._layerManager?.removeLayer(this.layer), this.layer = void 0), t; 5217 } 5218 render(t) { 5219 const { layer: i } = this, s = { ...t }; 5220 if (i == null) { 5221 this.renderInContext(s), super.render(s); 5222 return; 5223 } 5224 const { ctx: n, stats: o } = t; 5225 if (this.isDirty(t)) { 5226 const r = n.getTransform(), { globalAlpha: a } = n, l = i.context; 5227 s.ctx = l, i.clear(), l.save(), l.setTransform(r), l.globalAlpha = a, this.renderInContext(s), l.restore(
5227), l.verifyDepthZero?.(), o && o.layersRendered++; 5228 } else 5229 this.skipRender(s), o && o.layersSkipped++; 5230 n.save(), n.resetTransform(), i.drawImage(n), n.restore(), super.render(s); 5231 } 5232 skipRender(t) { 5233 const { stats: i } = t; 5234 for (const s of this.children()) 5235 s.markClean(), i && (i.nodesSkipped += this.childNodeCounts.groups + this.childNodeCounts.nonGroups, i.opsSkipped += this.childNodeCounts.complexity); 5236 } 5237 applyClip(t, i) { 5238 const { x: s, y: n, width: o, height: r } = i; 5239 t.beginPath(), t.rect(s, n, o, r), t.clip(); 5240 } 5241 renderInContext(t) { 5242 const { ctx: i, stats: s } = t; 5243 this.dirtyZIndex && this.sortChildren(rm.compareChildren), i.save(), i.globalAlpha *= this.opacity, this.clipRect != null && (this.applyClip(i, this.clipRect), t.clipBBox = Ii.toCanvas(this, this.clipRect)); 5244 for (const n of this.children()) { 5245 if (!n.visible) { 5246 n.markClean(), s && (s.nodesSkipped += n.childNodeCounts.nonGroups + n.childNodeCounts.groups, s.opsSkipped += n.childNodeCounts.complexity); 5247 continue; 5248 } 5249 i.save(), n.render(t), i.restore(); 5250 } 5251 i.restore(); 5252 } 5253 /** 5254 * Transforms bbox given in the canvas coordinate space to bbox in this group's coordinate space and 5255 * sets this group's clipRect to the transformed bbox. 5256 * @param bbox clipRect bbox in the canvas coordinate space. 5257 */ 5258 setClipRect(t) { 5259 this.clipRect = t ? Ii.fromCanvas(this, t) : void 0; 5260 } 5261 /** 5262 * Set the clip rect within the canvas coordinate space. 5263 * @param bbox clipRect bbox in the canvas coordinate space. 5264 */ 5265 setClipRectCanvasSpace(t) { 5266 this.clipRect = t; 5267 } 5268 _setLayerManager(t) { 5269 this.layer && (this._layerManager?.removeLayer(this.layer), this.layer = void 0), super._setLayerManager(t); 5270 } 5271 getVisibility() { 5272 for (const t of this.traverseUp(!0)) 5273 if (!t.visible) 5274 return !1; 5275 return !0; 5276 } 5277 toSVG() { 5278 if (!this.visible) 5279 return; 5280 const t = [], i = []; 5281 for (const s of this.children()) { 5282 const n = s.toSVG(); 5283 n != null && (i.push(...n.elements), n.defs != null && t.push(...n.defs)); 5284 } 5285 return { elements: i, defs: t }; 5286 } 5287}; 5288ex.className = "Group"; 5289S([ 5290 Ge({ convertor: (e) => ot(0, e, 1) }) 5291], ex.prototype, "opacity", 2); 5292var Ye = ex, C7 = class extends JS(Ye) { 5293}, b7 = class extends Vc(Ye) { 5294}, Ks = class extends Uc(Ye) { 5295}, xh = class extends Vc(Uc(Ye)) { 5296}, wr = {}; 5297typeof window < "u" ? wr.window = window : typeof global < "u" && (wr.window = global.window); 5298typeof document < "u" ? wr.document = document : typeof global < "u" && (wr.document = global.document); 5299function Xi(e) { 5300 return e ? wr.document?.[e] : wr.document; 5301} 5302function pi(e) { 5303 return e ? wr.window?.[e] : wr.window; 5304} 5305function Gt(e, t, i) { 5306 const s = Xi().createElement(e); 5307 if (typeof t == "object" && (i = t, t = void 0), t) 5308 for (const n of t.split(" ")) 5309 s.classList.add(n); 5310 return i && Object.assign(s.style, i), s; 5311} 5312function hw(e, t) { 5313 return Xi().createElementNS(e, t); 5314} 5315function Wk(e, t) { 5316 const { body: i } = Xi(), s = Gt("a", { display: "none" }); 5317 s.href = e, s.download = t, i.appendChild(s), s.click(), setTimeout(() => i.removeChild(s)); 5318} 5319function jk(e) { 5320 wr.document = e; 5321} 5322function $k(e) { 5323 wr.window = e; 5324} 5325function Ip(e, t) { 5326 e && (t = Tv.normalize(t), t.width == null ? e.style.removeProperty("width") : e.style.width = `${t.width}px`, t.height == null ? e.style.removeProperty("height") : e.style.height = `${t.height}
5326px`, t.x == null ? e.style.removeProperty("left") : e.style.left = `${t.x}px`, t.y == null ? e.style.removeProperty("top") : e.style.top = `${t.y}px`); 5327} 5328function Yk(e) { 5329 const t = parseFloat(e.style.width) || e.offsetWidth, i = parseFloat(e.style.height) || e.offsetHeight, s = parseFloat(e.style.left) || e.offsetLeft, n = parseFloat(e.style.top) || e.offsetTop; 5330 return { x: s, y: n, width: t, height: i }; 5331} 5332function w7(e) { 5333 if (e.focus({ preventScroll: !0 }), e.lastChild?.textContent == null) 5334 return; 5335 const t = Xi().createRange(); 5336 t.setStart(e.lastChild, e.lastChild.textContent.length), t.setEnd(e.lastChild, e.lastChild.textContent.length); 5337 const i = pi().getSelection(); 5338 i?.removeAllRanges(), i?.addRange(t); 5339} 5340var S7 = 0; 5341function x7(e) { 5342 return `${e ?? "ag-charts-element"}-${S7++}`; 5343} 5344function Kk() { 5345 const e = pi().navigator; 5346 if ("scheduling" in e) { 5347 const t = e.scheduling; 5348 if ("isInputPending" in t) 5349 return t.isInputPending({ includeContinuous: !0 }); 5350 } 5351 return !1; 5352} 5353function Yv(e) { 5354 return `ag-charts-icon ag-charts-icon-${e}`; 5355} 5356var M7 = 2e3, mI = Date.now(), A7 = () => { 5357 const e = Date.now() - mI; 5358 if (e > M7) { 5359 const t = (Math.floor(e / 100) / 10).toFixed(1); 5360 Ee.log(`**** ${t}s since last log message ****`); 5361 } 5362 mI = Date.now(); 5363}, Xt = { 5364 create(...e) { 5365 return Object.assign((...i) => { 5366 Xt.check(...e) && (typeof i[0] == "function" && (i = Ap(i[0]())), A7(), Ee.log(...i)); 5367 }, { check: () => Xt.check(...e) }); 5368 }, 5369 check(...e) { 5370 return e.length === 0 && e.push(!0), Ap(pi("agChartsDebug")).some((i) => e.includes(i)); 5371 } 5372}, _i = class hc { 5373 constructor(t, i, s = !0) { 5374 this.parentNode = t, this.autoCleanup = s, this.garbageBin = /* @__PURE__ */ new Set(), this._nodesMap = /* @__PURE__ */ new Map(), this._nodes = [], this.data = [], this.debug = Xt.create(!0, "scene", "scene:selections"), this.nodeFactory = Object.prototype.isPrototypeOf.call(wl, i) ? () => new i() : i; 5375 } 5376 static select(t, i, s = !0) { 5377 return new hc(t, i, s); 5378 } 5379 static selectAll(t, i) { 5380 const s = [], n = (o) => { 5381 i(o) && s.push(o); 5382 for (const r of o.children()) 5383 n(r); 5384 }; 5385 return n(t), s; 5386 } 5387 static selectByClass(t, ...i) { 5388 return hc.selectAll(t, (s) => i.some((n) => s instanceof n)); 5389 } 5390 static selectByTag(t, i) { 5391 return hc.selectAll(t, (s) => s.tag === i); 5392 } 5393 createNode(t, i, s) { 5394 const n = this.nodeFactory(t); 5395 return n.datum = t, i?.(n), s == null ? this._nodes.push(n) : this._nodes.splice(s, 0, n), this.parentNode.appendChild(n), n; 5396 } 5397 /** 5398 * Update the data in a selection. If an `getDatumId()` function is provided, maintain a list of ids related to 5399 * the nodes. Otherwise, take the more efficient route of simply creating and destroying nodes at the end 5400 * of the array. 5401 */ 5402 update(t, i, s) { 5403 if (this.garbageBin.size > 0 && this.debug("Selection - update() called with pending garbage", t), s) { 5404 const n = new Map( 5405 t.map((o, r) => [s(o), [o, r]]) 5406 ); 5407 for (const [o, r] of this._nodesMap.entries()) 5408 if (n.has(r)) { 5409 const [a] = n.get(r); 5410 o.datum = a, this.garbageBin.delete(o), n.delete(r); 5411 } else 5412 this.garbageBin.add(o); 5413 for (const [o, [r, a]] of n.entries()) 5414 this._nodesMap.set(this.createNode(r, i, a), o); 5415 } else { 5416 const n = Math.max(t.length, this.data.length); 5417 for (let o = 0; o < n; o++) 5418 o >= t.length ? this.garbageBin.add(this._nodes[o]) : o >= this._nodes.length ? this.createNode(t[o], i) : (this._nodes[o].datum = t[o], this.garbageBin.delete(this._nodes[o])); 5419 } 5420 return this.data = t.slice(), this.autoCleanup && this.cleanup(), this; 5421 } 5422 cleanup() { 5423 return this.garbageBin.size === 0 ? this : (this._nodes = this._nodes.filter((t) => this.garbageBin.has(t) ? (this._nodesMap.delete(t), this.garbageBin.delete(t), t.destroy(), !1) : !0), this); 5424 } 5425 clear() { 5426 return this.update([]), this; 5427 } 5428 isGarbage(t) { 5429 return this.garbageBin.has(t); 5430 } 5431 hasGarbage() { 5432 return this.garbageBin.size > 0; 5433 } 5434 each(t) { 5435 for (const i of this._nodes.entries()) 5436 t(i[1], i[1].datum, i[0]); 5437 return this; 5438 } 5439 *[Symbol.iterator]() { 5440 for (let t = 0; t < this._nodes.length; t++) { 5441 const i = this._nodes[t]; 5442 yield { node: i, datum: i.datum, index: t }; 5443 } 5444 } 5445 select(t) { 5446 return hc.selectAll(this.parentNode, t); 5447 } 5448 selectByClass(t) { 5449 return hc.selectByClass(this.parentNode, t); 5450 } 5451 selectByTag(t) { 5452 return hc.selectByTag(this.parentNode, t); 5453 } 5454 nodes() { 5455 return this._nodes; 5456 } 5457 at(t) { 5458 return this._nodes.at(t); 5459 } 5460 get length() { 5461 return this._nodes.length; 5462 } 5463}, Ms = Math.PI * 2, Mh = Math.PI / 2; 5464function zt(e) {
5465 return e %= Ms, e += Ms, e %= Ms, e; 5466} 5467function Zk(e) { 5468 return e %= Ms, e += Ms, e !== Ms && (e %= Ms), e; 5469} 5470function Rp(e) { 5471 return e %= Ms, e < -Math.PI ? e += Ms : e >= Math.PI && (e -= Ms), e; 5472} 5473function uo(e, t, i) { 5474 const s = zt(e), n = zt(t), o = zt(i); 5475 return n < o ? n <= s && s <= o : n > o ? n <= s || s <= o : !0; 5476} 5477function Es(e) { 5478 return e / 180 * Math.PI; 5479} 5480function D7(e) { 5481 return e / Math.PI * 180; 5482} 5483function E7(e, t, i) { 5484 i && ([e, t] = [t, e]); 5485 const s = zt(e); 5486 return (zt(t) + Ms - s) % Ms; 5487} 5488function pg(e, t) { 5489 return e = zt(e), t = zt(t), t - e + (e > t ? Ms : 0); 5490} 5491function I7(e, t, i, s) { 5492 const n = e + i * Math.cos(s), o = t + i * Math.sin(s); 5493 return { x: n, y: o }; 5494} 5495var R7 = 1e-6; 5496function qk(e, t) { 5497 return pg(e, t) < R7 ? t : zt(e - t) + t; 5498} 5499function T7(e, t, i = 0) { 5500 const n = Math.abs(t - e) >= Ms ? Ms : zt(t - e); 5501 return e = qk(e, i), t = e + n, { startAngle: e, endAngle: t }; 5502} 5503function Qk(e) { 5504 const t = zt(e); 5505 return t <= Mh ? t / Mh : t <= Math.PI ? (Math.PI - t) / Mh : t <= 1.5 * Math.PI ? (t - Math.PI) / Mh : (Ms - t) / Mh; 5506} 5507function tp(e, t, i, s) { 5508 const n = e - i, o = t - s; 5509 return n * n + o * o; 5510} 5511function ip(e, t, i, s, n, o, r) { 5512 if (i === n && s === o) 5513 return Math.min(r, tp(e, t, i, s)); 5514 const a = n - i, l = o - s, c = Math.max(0, Math.min(1, ((e - i) * a + (t - s) * l) / (a * a + l * l))), u = i + c * a, d = s + c * l; 5515 return Math.min(r, tp(e, t, u, d)); 5516} 5517function L7(e, t, i, s, n, o, r, a, l) { 5518 a && ([r, o] = [o, r]); 5519 const c = Math.atan2(t - s, e - i); 5520 if (!uo(c, o, r)) { 5521 const d = i + Math.cos(o) * n, p = s + Math.sin(o) * n, f = i + Math.cos(o) * n, m = s + Math.sin(o) * n; 5522 return Math.min(l, tp(e, t, d, p), tp(e, t, f, m)); 5523 } 5524 const u = n - Math.sqrt(tp(e, t, i, s)); 5525 return Math.min(l, u * u); 5526} 5527var vI = (e) => { 5528 const t = Bo.fromString(e), [i, s, n] = Bo.RGBtoOKLCH(t.r, t.g, t.b); 5529 return { l: i, c: s, h: n, a: t.a }; 5530}, Vb = 1e-6, yI = (e) => e.c < Vb || e.l < Vb || e.l > 1 - Vb, k7 = (e, t, i) => { 5531 i = ot(0, i, 1); 5532 let s; 5533 if (yI(e)) 5534 s = t.h; 5535 else if (yI(t)) 5536 s = e.h; 5537 else { 5538 const a = e.h; 5539 let l = t.h; 5540 const c = t.h - e.h; 5541 c > 180 ? l -= 360 : c < -180 && (l += 360), s = a * (1 - i) + l * i; 5542 } 5543 const n = e.c * (1 - i) + t.c * i, o = e.l * (1 - i) + t.l * i, r = e.a * (1 - i) + t.a * i; 5544 return Bo.fromOKLCH(o, n, s, r); 5545}, Wc = class { 5546 constructor() { 5547 this.type = "color", this.invalid = !0, this.domain = [0, 1], this.range = ["red", "blue"], this.parsedRange = this.range.map(vI); 5548 } 5549 update() { 5550 const { domain: e, range: t } = this; 5551 e.length < 2 && (Ee.warnOnce("`colorDomain` should have at least 2 values."), e.length === 0 ? e.push(0, 1) : e.length === 1 && e.push(e[0] + 1)); 5552 for (let i = 1; i < e.length; i++) { 5553 const s = e[i - 1], n = e[i]; 5554 if (s >= n) { 5555 Ee.warnOnce("`colorDomain` values should be supplied in ascending order."), e.sort((o, r) => o - r); 5556 break; 5557 } 5558 } 5559 if (t.length < e.length) 5560 for (let i = t.length; i < e.length; i++) 5561 t.push(t.length > 0 ? t[0] : "black"); 5562 this.parsedRange = this.range.map(vI); 5563 } 5564 convert(e) { 5565 this.refresh(); 5566 const { domain: t, range: i, parsedRange: s } = this, n = t[0], o = t.at(-1), r = i[0], a = i[i.length - 1]; 5567 if (e <= n) 5568 return r; 5569 if (e >= o) 5570 return a; 5571 let l, c; 5572 if (t.length === 2) { 5573 const p = (e - n) / (o - n), f = 1 / (i.length - 1); 5574 l = i.length <= 2 ? 0 : Math.min(Math.floor(p * (i.length - 1)), i.length - 2), c = (p - l * f) / f; 5575 } else { 5576 for (l = 0; l < t.length - 2 && !(e < t[l + 1]); l++) 5577 ; 5578 const p = t[l], f = t[l + 1]; 5579 c = (e - p) / (f - p); 5580 } 5581 const u = s[l], d = s[l + 1]; 5582 return k7(u, d, c).toRgbaString(); 5583 } 5584 refresh() { 5585 this.invalid && (this.invalid = !1, this.update(), this.invalid && Ee.warnOnce("Expected update to not invalidate scale")); 5586 } 5587}; 5588S([ 5589 os 5590], Wc.prototype, "domain", 2); 5591S([ 5592 os 5593], Wc.prototype, "range", 2); 5594var Kv = class { 5595 constructor(e, t = [], i) { 5596 this.colorSpace = e, this.stops = t, this.bbox = i, this._cache = void 0; 5597 } 5598 createGradient(e, t) { 5599 const i = this.bbox ?? t; 5600 if (this._cache != null && this._cache.ctx === e && this._cache.bbox.equals(i)) 5601 return this._cache.gradient; 5602 const { stops: s, colorSpace: n } = this; 5603 if (s.length === 0) 5604 return; 5605 if (s.length === 1)
5606 return s[0].color; 5607 let o = this.createCanvasGradient(e, i); 5608 if (o == null) 5609 return; 5610 const r = n === "oklch", a = 0.05; 5611 let l = s[0]; 5612 o.addColorStop(l.offset, l.color); 5613 for (let c = 1; c < s.length; c += 1) { 5614 const u = s[c]; 5615 if (r) { 5616 const d = new Wc(); 5617 d.domain = [l.offset, u.offset], d.range = [l.color, u.color]; 5618 for (let p = l.offset + a; p < u.offset; p += a) 5619 o.addColorStop(p, d.convert(p)); 5620 } 5621 o.addColorStop(u.offset, u.color), l = u; 5622 } 5623 return "createPattern" in o && (o = o.createPattern()), this._cache = { ctx: e, bbox: i, gradient: o }, o; 5624 } 5625}, Xk = class extends Kv { 5626 constructor(e, t, i = 0, s) { 5627 super(e, t, s), this.angle = i; 5628 } 5629 createCanvasGradient(e, t) { 5630 const { angle: s } = this, n = zt(Es(s + 90)), o = Math.cos(n), r = Math.sin(n), a = t.width, l = t.height, c = t.x + a * 0.5, u = t.y + l * 0.5, d = Math.sqrt(l * l + a * a) / 2, p = Math.atan2(l, a); 5631 let f; 5632 n < Math.PI / 2 ? f = n : n < Math.PI ? f = Math.PI - n : n < 1.5 * Math.PI ? f = n - Math.PI : f = 2 * Math.PI - n; 5633 const m = d * Math.abs(Math.cos(f - p)); 5634 return e.createLinearGradient(c + o * m, u + r * m, c - o * m, u - r * m); 5635 } 5636}, P7 = /^linear-gradient\((-?[\d.]+)deg,(.*?)\)$/i, bn = class ar extends wl { 5637 constructor() { 5638 super(...arguments), this.fillOpacity = 1, this.strokeOpacity = 1, this.fill = ar.defaultStyles.fill, this.stroke = ar.defaultStyles.stroke, this.strokeWidth = ar.defaultStyles.strokeWidth, this.lineDash = ar.defaultStyles.lineDash, this.lineDashOffset = ar.defaultStyles.lineDashOffset, this.lineCap = ar.defaultStyles.lineCap, this.lineJoin = ar.defaultStyles.lineJoin, this.miterLimit = void 0, this.opacity = ar.defaultStyles.opacity, this.fillShadow = ar.defaultStyles.fillShadow; 5639 } 5640 /** 5641 * Restores the default styles introduced by this subclass. 5642 */ 5643 restoreOwnStyles() { 5644 const { defaultStyles: t } = this.constructor; 5645 Object.assign(this, t); 5646 } 5647 getGradient(t) { 5648 let i; 5649 if (t instanceof Kv) 5650 return t; 5651 if (t?.startsWith("linear-gradient") && (i = P7.exec(t))) { 5652 const s = parseFloat(i[1]), n = [], o = i[2], r = /(#[0-9a-f]+)|(rgba?\(.+?\))|([a-z]+)/gi; 5653 let a; 5654 for (; a = r.exec(o); ) 5655 n.push(a[0]); 5656 return new Xk( 5657 "rgb", 5658 n.map((l, c) => ({ color: l, offset: c / (n.length - 1) })), 5659 s 5660 ); 5661 } else 5662 return; 5663 } 5664 onFillChange() { 5665 this.fillGradient = this.getGradient(this.fill); 5666 } 5667 onStrokeChange() { 5668 this.strokeGradient = this.getGradient(this.stroke); 5669 } 5670 /** 5671 * Returns a device-pixel aligned coordinate (or length if length is supplied). 5672 * 5673 * NOTE: Not suitable for strokes, since the stroke needs to be offset to the middle 5674 * of a device pixel. 5675 */ 5676 align(t, i) { 5677 const s = this.layerManager?.canvas?.pixelRatio ?? 1, n = Math.round(t * s) / s; 5678 return i == null ? n : i === 0 ? 0 : i < 1 ? Math.ceil(i * s) / s : Math.round((i + t) * s) / s - n; 5679 } 5680 fillStroke(t, i) { 5681 this.renderFill(t, i), this.renderStroke(t, i); 5682 } 5683 renderFill(t, i) { 5684 if (this.fill) { 5685 const { globalAlpha: s } = t; 5686 this.applyFill(t), this.applyFillAlpha(t), this.applyShadow(t), this.executeFill(t, i), t.globalAlpha = s; 5687 } 5688 t.shadowColor = "rgba(0, 0, 0, 0)"; 5689 } 5690 executeFill(t, i) { 5691 i ? t.fill(i) : t.fill(); 5692 } 5693 applyFill(t) { 5694 t.fillStyle = this.fillGradient?.createGradient(t, this.getBBox()) ?? (typeof this.fill == "string" ? this.fill : void 0) ?? "black"; 5695 } 5696 applyStroke(t) { 5697 t.strokeStyle = this.strokeGradient?.createGradient(t, this.getBBox()) ?? (typeof this.stroke == "string" ? this.stroke : void 0) ?? "black"; 5698 } 5699 applyFillAlpha(t) { 5700 t.globalAlpha *= this.opacity * this.fillOpacity; 5701 } 5702 applyShadow(t) { 5703 const i = this.layerManager?.canvas.pixelRatio ?? 1, s = this.fillShadow; 5704 s?.enabled && (t.shadowColor = s.color, t.shadowOffsetX = s.xOffset * i, t.shadowOffsetY = s.yOffset * i, t.shadowBlur = s.blur * i); 5705 } 5706 renderStroke(t, i) { 5707 if (this.stroke && this.strokeWidth) { 5708 const { globalAlpha: s } = t; 5709 this.applyStroke(t), t.globalAlpha *= this.opacity * this.strokeOpacity, t.lineWidth = this.strokeWidth, this.lineDash && t.setLineDash(this.lineDash), this.lineDashOffset && (t.lineDashOffset = this.lineDashOffset), this.lineCap && (t.lineCap = this.lineCap), this.lineJoin && (t.lineJoin = this.lineJoin), this.miterLimit != null && (t.miterLimit = this.miterLimit), this.executeStroke(t, i), t.globalAlpha = s; 5710 } 5711 } 5712 executeStroke(t, i) { 5713 i ? t.stroke(i) : t.stroke(); 5714 } 5715 containsPoint(t, i) { 5716 return this.isPointInPath(t, i); 5717 } 5718 applySvgFillAttributes(t) { 5719 t.setAttribute("fill", typeof this.fill == "string" ? this.fill : "none"), t.setAttribute("fill-opacity", String(this.fillOpacity)); 5720 } 5721 applySvgStrokeAttributes(t) { 5722 this.stroke != null && (t.setAttribute("stroke", typeof this.stroke == "string" ? this.stroke : "none"), t.setAttribute("stroke-opacity", String(this.strokeOpacity)), t.setAttribute("stroke-width", String(this.strokeWidth))
5722), this.lineDash != null && t.setAttribute("stroke-dasharray", this.lineDash.join(" ")); 5723 } 5724}; 5725bn.defaultStyles = { 5726 fill: "black", 5727 stroke: void 0, 5728 strokeWidth: 0, 5729 lineDash: void 0, 5730 lineDashOffset: 0, 5731 lineCap: void 0, 5732 lineJoin: void 0, 5733 opacity: 1, 5734 fillShadow: void 0 5735}; 5736S([ 5737 Ge() 5738], bn.prototype, "fillOpacity", 2); 5739S([ 5740 Ge() 5741], bn.prototype, "strokeOpacity", 2); 5742S([ 5743 Ge({ changeCb: (e) => e.onFillChange() }) 5744], bn.prototype, "fill", 2); 5745S([ 5746 Ge({ changeCb: (e) => e.onStrokeChange() }) 5747], bn.prototype, "stroke", 2); 5748S([ 5749 Ge() 5750], bn.prototype, "strokeWidth", 2); 5751S([ 5752 Ge() 5753], bn.prototype, "lineDash", 2); 5754S([ 5755 Ge() 5756], bn.prototype, "lineDashOffset", 2); 5757S([ 5758 Ge() 5759], bn.prototype, "lineCap", 2); 5760S([ 5761 Ge() 5762], bn.prototype, "lineJoin", 2); 5763S([ 5764 Ge() 5765], bn.prototype, "miterLimit", 2); 5766S([ 5767 Ge({ convertor: (e) => ot(0, e, 1) }) 5768], bn.prototype, "opacity", 2); 5769S([ 5770 Ge({ checkDirtyOnAssignment: !0 }) 5771], bn.prototype, "fillShadow", 2); 5772var Co = bn, Hn = class extends Co { 5773 constructor(e = {}) { 5774 super(e), this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.restoreOwnStyles(); 5775 } 5776 set x(e) { 5777 this.x1 = e, this.x2 = e; 5778 } 5779 set y(e) { 5780 this.y1 = e, this.y2 = e; 5781 } 5782 get midPoint() { 5783 return { x: (this.x1 + this.x2) / 2, y: (this.y1 + this.y2) / 2 }; 5784 } 5785 computeBBox() { 5786 return new _e( 5787 Math.min(this.x1, this.x2), 5788 Math.min(this.y1, this.y2), 5789 Math.abs(this.x2 - this.x1), 5790 Math.abs(this.y2 - this.y1) 5791 ); 5792 } 5793 isPointInPath(e, t) { 5794 return this.x1 === this.x2 || this.y1 === this.y2 ? this.getBBox().clone().grow(this.strokeWidth / 2).containsPoint(e, t) : !1; 5795 } 5796 distanceSquared(e, t) { 5797 const { x1: i, y1: s, x2: n, y2: o } = this; 5798 return ip(e, t, i, s, n, o, 1 / 0); 5799 } 5800 render(e) { 5801 const { ctx: t, devicePixelRatio: i } = e; 5802 let { x1: s, y1: n, x2: o, y2: r } = this; 5803 if (s === o) { 5804 const { strokeWidth: a } = this, l = Math.round(s * i) / i + Math.trunc(a * i) % 2 / (i * 2); 5805 s = l, o = l; 5806 } else if (n === r) { 5807 const { strokeWidth: a } = this, l = Math.round(n * i) / i + Math.trunc(a * i) % 2 / (i * 2); 5808 n = l, r = l; 5809 } 5810 t.beginPath(), t.moveTo(s, n), t.lineTo(o, r), this.fillStroke(t), this.fillShadow?.markClean(), super.render(e); 5811 } 5812 toSVG() { 5813 if (!this.visible) 5814 return; 5815 const e = document.createElementNS("http://www.w3.org/2000/svg", "line"); 5816 return e.setAttribute("x1", String(this.x1)), e.setAttribute("y1", String(this.y1)), e.setAttribute("x2", String(this.x2)), e.setAttribute("y2", String(this.y2)), this.applySvgStrokeAttributes(e), { 5817 elements: [e] 5818 }; 5819 } 5820}; 5821Hn.className = "Line"; 5822Hn.defaultStyles = { ...Co.defaultStyles, fill: void 0, strokeWidth: 1 }; 5823S([ 5824 Ge() 5825], Hn.prototype, "x1", 2); 5826S([ 5827 Ge() 5828], Hn.prototype, "y1", 2); 5829S([ 5830 Ge() 5831], Hn.prototype, "x2", 2); 5832S([ 5833 Ge() 5834], Hn.prototype, "y2", 2); 5835function F7(e = 0, t = 0) { 5836 return new OffscreenCanvas(e, t).getContext("2d"); 5837} 5838var tx = class { 5839 constructor(e = 5) { 5840 this.maxCacheSize = e, this.store = /* @__PURE__ */ new Map(); 5841 } 5842 get(e) { 5843 if (!this.store.has(e)) 5844 return; 5845 const t = this.store.get(e); 5846 return this.store.delete(e), this.store.set(e, t), t; 5847 } 5848 has(e) { 5849 return this.store.has(e); 5850 } 5851 set(e, t) { 5852 if (this.store.set(e, t), this.store.size > this.maxCacheSize) { 5853 const i = this.store.keys(); 5854 let s = this.store.size - this.maxCacheSize; 5855 for (; s > 0; ) { 5856 const n = i.next(); 5857 n.done || this.store.delete(n.value), s--; 5858 } 5859 } 5860 return t; 5861 } 5862 clear() { 5863 this.store.clear(); 5864 } 5865}, wa = class { 5866 // Measures the dimensions of the provided text, handling multiline if needed. 5867 static measureText(e, t) { 5868 return this.getMeasurer(t).measureText(e); 5869 } 5870 static measureLines(e, t) { 5871 return this.getMeasurer(t).measureLines(e); 5872 } 5873 // Gets a TextMeasurer instance, configuring text alignment and baseline if provided. 5874 static getMeasurer(e) { 5875 const t = typeof e.font == "string" ? e.font : vi.toFontString(e.font), i = `${t}-${e.textAlign ?? "start"}-${e.textBaseline ?? "alphabetic"}`; 5876 return this.instanceMap.get(i) ?? this.createFontMeasurer(t, e, i); 5877 } 5878 // Creates or retrieves a TextMeasurer instance for a specific font. 5879 static createFontMeasurer(e, t, i) { 5880 const s = F7(); 5881 s.font = e, s.textAlign = t.textAlign ?? "start", s.textBaseline = t.textBaseline ?? "alphabetic"; 5882 const n = new Jk(s, t); 5883 return this.instanceMap.set(i, n), n; 5884 } 5885}; 5886wa.instanceMap = new tx(10); 5887var Jk = class { 5888 constructor(e, t) { 5889 this.ctx = e, this.measureMap = new tx(100), t.textAlign && (e.textAlign = t.textAlign), t.textBaseline && (e.textBaseline = t.textBaseline), e.font = typeof t.font == "string" ? t.font : vi.toFontString(t.font), this.textMeasurer = new ix( 5890 (i) => this.cachedCtxMeasureText(i), 5891 t.textBaseline ?? "alphabetic" 5892 ); 5893 } 5894 textWidth(e, t) { 5895 return this.textMeasurer.textWidth(e, t); 5896 } 5897 measureText(e) { 5898 return this.textMeasurer.measureText(e); 5899 } 5900 measureLines(e) { 5901 return this.textMeasurer.measureLines(e); 5902 } 5903 cachedCtxMeasureText(e) { 5904 if (!this.measureMap.has(e)) { 5905 const t = this.ctx.measureText(e); 5906 this.measureMap.set(e, { 5907 actualBoundingBoxAscent: t.actualBoundingBoxAscent, 5908 emHeightAscent: t.emHeightAscent, 5909 emHeightDescent: t.emHeightDescent, 5910 actualBoundingBoxDescent: t.actualBoundingBoxDescent, 5911 actualBoundingBoxLeft: t.actualBoundingBoxLeft, 5912 actualBoundingBoxRight: t.actualBoundingBoxRight, 5913 alphabeticBaseline: t.alphabeticBaseline, 5914 fontBoundingBoxAscent: t.fontBoundingBoxAscent, 5915 fontBoundingBoxDescent: t.fontBoundingBoxDescent, 5916 hangingBaseline: t.hangingBaseline, 5917 ideographicBaseline: t.ideographicBaseline, 5918 width: t.width 5919 }); 5920 } 5921 return this.measureMap.get(e); 5922 } 5923}, vi = class { 5924 static toFontString({ fontSize: e = 10, fontStyle: t, fontWeight: i, fontFamily: s, lineHeight: n }) { 5925 let o = ""; 5926 return t && (o += `${t} `), i && (o += `${i} `), o += `${e}px`, n && (o += `/${n}px`), o += ` ${s}`, o.trim(); 5927 } 5928 static getLineHeight(e) { 5929 return Math.ceil(e * this.defaultLineHeight); 5930 } 5931 // Determines vertical offset modifier based on text baseline. 5932 static getVerticalModifier(e) { 5933 switch (e) { 5934 case "hanging": 5935 case "top": 5936 return 0; 5937 case "middle": 5938 return 0.5; 5939 default: 5940 return 1; 5941 } 5942 } 5943};
5944vi.EllipsisChar = "â¦"; 5945vi.defaultLineHeight = 1.15; 5946vi.lineSplitter = /\r?\n/g; 5947var ix = class { 5948 constructor(e, t = "alphabetic") { 5949 this.measureTextFn = e, this.textBaseline = t, this.charMap = /* @__PURE__ */ new Map(); 5950 } 5951 // Measures metrics for a single line of text. 5952 getMetrics(e) { 5953 const t = this.measureTextFn(e); 5954 return t.fontBoundingBoxAscent ?? (t.fontBoundingBoxAscent = t.emHeightAscent), t.fontBoundingBoxDescent ?? (t.fontBoundingBoxDescent = t.emHeightDescent), { 5955 width: t.width, 5956 height: t.actualBoundingBoxAscent + t.actualBoundingBoxDescent, 5957 lineHeight: t.fontBoundingBoxAscent + t.fontBoundingBoxDescent, 5958 offsetTop: t.actualBoundingBoxAscent, 5959 offsetLeft: t.actualBoundingBoxLeft 5960 }; 5961 } 5962 // Calculates aggregated metrics for multiline text. 5963 getMultilineMetrics(e) { 5964 let t = 0, i = 0, s = 0, n = 0, o = 0; 5965 const r = vi.getVerticalModifier(this.textBaseline), a = []; 5966 let l = 0; 5967 const c = e.length; 5968 for (const u of e) { 5969 const d = this.measureTextFn(u); 5970 d.fontBoundingBoxAscent ?? (d.fontBoundingBoxAscent = d.emHeightAscent), d.fontBoundingBoxDescent ?? (d.fontBoundingBoxDescent = d.emHeightDescent), t < d.width && (t = d.width), n < d.actualBoundingBoxLeft && (n = d.actualBoundingBoxLeft), l === 0 ? (i += d.actualBoundingBoxAscent, s += d.actualBoundingBoxAscent) : o += d.fontBoundingBoxAscent, l === c - 1 ? i += d.actualBoundingBoxDescent : o += d.fontBoundingBoxDescent, a.push({ 5971 text: u, 5972 width: d.width, 5973 height: d.actualBoundingBoxAscent + d.actualBoundingBoxDescent, 5974 lineHeight: d.fontBoundingBoxAscent + d.fontBoundingBoxDescent, 5975 offsetTop: d.actualBoundingBoxAscent, 5976 offsetLeft: d.actualBoundingBoxLeft 5977 }), l++; 5978 } 5979 return i += o, s += o * r, { width: t, height: i, offsetTop: s, offsetLeft: n, lineMetrics: a }; 5980 } 5981 textWidth(e, t) { 5982 if (t) { 5983 let i = 0; 5984 for (let s = 0; s < e.length; s++) 5985 i += this.textWidth(e.charAt(s)); 5986 return i; 5987 } 5988 return e.length > 1 ? this.measureTextFn(e).width : this.charMap.get(e) ?? this.charWidth(e); 5989 } 5990 measureText(e) { 5991 return this.getMetrics(e); 5992 } 5993 // Measures the dimensions of the provided text, handling multiline if needed. 5994 measureLines(e) { 5995 const t = typeof e == "string" ? e.split(vi.lineSplitter) : e; 5996 return this.getMultilineMetrics(t); 5997 } 5998 charWidth(e) { 5999 const { width: t } = this.measureTextFn(e); 6000 return this.charMap.set(e, t), t; 6001 } 6002}, Vn = class am extends Co { 6003 constructor() { 6004 super(...arguments), this.x = 0, this.y = 0, this.lines = [], this.text = void 0, this.fontSize = 10, this.fontFamily = "sans-serif", this.textAlign = am.defaultStyles.textAlign, this.textBaseline = am.defaultStyles.textBaseline; 6005 } 6006 onTextChange() { 6007 this.lines = this.text?.split(` 6008`).map((t) => t.trim()) ?? []; 6009 } 6010 static computeBBox(t, i, s, n) { 6011 const { offsetTop: o, offsetLeft: r, width: a, height: l } = wa.measureLines(t, n); 6012 return new _e(i - r, s - o, a, l); 6013 } 6014 computeBBox() { 6015 const { x: t, y: i, lines: s, textBaseline: n, textAlign: o } = this; 6016 return am.computeBBox(s, t, i, { font: this, textBaseline: n, textAlign: o }); 6017 } 6018 isPointInPath(t, i) { 6019 const s = this.getBBox(); 6020 return s ? s.containsPoint(t, i) : !1; 6021 } 6022 render(t) { 6023 const { ctx: i, stats: s } = t; 6024 if (!this.lines.length || !this.layerManager) 6025 return s && (s.nodesSkipped += 1), super.render(t); 6026 const { fill: n, stroke: o, strokeWidth: r } = this, { pixelRatio: a } = this.layerManager.canvas; 6027 if (i.font = vi.toFontString(this), i.textAlign = this.textAlign, i.textBaseline = this.textBaseline, n) { 6028 this.applyFill(i), i.globalAlpha *= this.opacity * this.fillOpacity; 6029 const { fillShadow: l } = this; 6030 l?.enabled && (i.shadowColor = l.color, i.shadowOffsetX = l.xOffset * a, i.shadowOffsetY = l.yOffset * a, i.shadowBlur = l.blur * a), this.renderLines((c, u, d) => i.fillText(c, u, d)); 6031 } 6032 if (o && r) { 6033 this.applyStroke(i), i.lineWidth = r, i.globalAlpha *= this.opacity * this.strokeOpacity; 6034 const { lineDash: l, lineDashOffset: c, lineCap: u, lineJoin: d } = this; 6035 l && i.setLineDash(l), c && (i.lineDashOffset = c), u && (i.lineCap = u), d && (i.lineJoin = d), this.renderLines((p, f, m) => i.strokeText(p, f, m)); 6036 } 6037 super.render(t); 6038 } 6039 renderLines(t) { 6040 const { lines: i, x: s, y: n } = this, o = this.lineHeight ?? vi.getLineHeight(this.fontSize); 6041 let r = (o - o * i.length) * vi.getVerticalModifier(this.textBaseline); 6042 for (const a of i) 6043 t(a, s, n + r), r += o; 6044 } 6045 setFont(t) { 6046 this.fontFamily = t.fontFamily, this.fontSize = t.fontSize, this.fontStyle = t.fontStyle, this.fontWeight = t.fontWeight; 6047 } 6048 setAlign(t) { 6049 this.textAlign = t.textAlign, this.textBaseline = t.textBaseline; 6050 } 6051 toSVG() { 6052 if (!this.visible || !this.text) 6053 return; 6054 const t = document.createElementNS("http://www.w3.org/2000/svg", "text"); 6055 return this.applySvgFillAttributes(t), t.setAttribute("font-family", this.fontFamily?.split(",")[0] ?? ""), t.setAttribute("font-size", Str
6055ing(this.fontSize)), t.setAttribute("font-style", this.fontStyle ?? ""), t.setAttribute("font-weight", String(this.fontWeight ?? "")), t.setAttribute( 6056 "text-anchor", 6057 { 6058 center: "middle", 6059 left: "start", 6060 right: "end", 6061 start: "start", 6062 end: "end" 6063 }[this.textAlign ?? "start"] 6064 ), t.setAttribute( 6065 "alignment-baseline", 6066 { 6067 alphabetic: "alphabetic", 6068 top: "top", 6069 bottom: "bottom", 6070 hanging: "hanging", 6071 middle: "middle", 6072 ideographic: "ideographic" 6073 }[this.textBaseline ?? "alphabetic"] 6074 ), t.setAttribute("x", String(this.x)), t.setAttribute("y", String(this.y)), t.textContent = this.text ?? "", { elements: [t] }; 6075 } 6076}; 6077Vn.className = "Text"; 6078Vn.defaultStyles = { 6079 ...Co.defaultStyles, 6080 textAlign: "start", 6081 fontStyle: void 0, 6082 fontWeight: void 0, 6083 fontSize: 10, 6084 fontFamily: "sans-serif", 6085 textBaseline: "alphabetic" 6086}; 6087S([ 6088 Ge() 6089], Vn.prototype, "x", 2); 6090S([ 6091 Ge() 6092], Vn.prototype, "y", 2); 6093S([ 6094 Ge({ changeCb: (e) => e.onTextChange() }) 6095], Vn.prototype, "text", 2); 6096S([ 6097 Ge() 6098], Vn.prototype, "fontStyle", 2); 6099S([ 6100 Ge() 6101], Vn.prototype, "fontWeight", 2); 6102S([ 6103 Ge() 6104], Vn.prototype, "fontSize", 2); 6105S([ 6106 Ge() 6107], Vn.prototype, "fontFamily", 2); 6108S([ 6109 Ge() 6110], Vn.prototype, "textAlign", 2); 6111S([ 6112 Ge() 6113], Vn.prototype, "textBaseline", 2); 6114S([ 6115 Ge() 6116], Vn.prototype, "lineHeight", 2); 6117var Qi = Vn, eP = class extends Vc(Qi) { 6118}, Sd = class extends Vc(Uc(Qi)) { 6119}; 6120function O7(e, t, i, s, n, o) { 6121 if (e.size === 0) 6122 return !1; 6123 let r = e.x, a = e.y; 6124 t != null && (r -= (t.x - 0.5) * e.size, a -= (t.y - 0.5) * e.size); 6125 let l = r; 6126 r < i ? l = i : r > i + n && (l = i + n); 6127 let c = a; 6128 a < s ? c = s : a > s + o && (c = s + o); 6129 const u = r - l, d = a - c; 6130 return Math.sqrt(u * u + d * d) <= e.size * 0.5; 6131} 6132function tP(e, t, i, s, n) { 6133 const o = e.x + e.width > t && e.x < t + s, r = e.y + e.height > i && e.y < i + n; 6134 return o && r; 6135} 6136function N7(e, t, i, s, n) { 6137 return t + s < e.x + e.width && t > e.x && i > e.y && i + n < e.y + e.height; 6138} 6139function _7(e) { 6140 return e != null && typeof e.point == "object" && typeof e.label == "object"; 6141} 6142var B7 = { 6143 top: { x: 0, y: -1 }, 6144 bottom: { x: 0, y: 1 }, 6145 left: { x: -1, y: 0 }, 6146 right: { x: 1, y: 0 }, 6147 "top-left": { x: -1, y: -1 }, 6148 "top-right": { x: 1, y: -1 }, 6149 "bottom-left": { x: -1, y: 1 }, 6150 "bottom-right": { x: 1, y: 1 } 6151}; 6152function G7(e, t, i = 5) { 6153 const s = /* @__PURE__ */ new Map(), n = [], o = new Map( 6154 [...e.entries()].map(([a, l]) => [a, l.toSorted((c, u) => u.point.size - c.point.size)]) 6155 ), r = [...o.values()].flat(); 6156 for (const [a, l] of o.entries()) { 6157 const c = []; 6158 if (l[0]?.label) { 6159 for (let u = 0, d = l.length; u < d; u++) { 6160 const p = l[u], { point: f, label: m, marker: y } = p, { text: b, width: C, height: w } = m, M = f.size * 0.5; 6161 let A = 0, I = 0; 6162 if (M > 0 && p.placement != null) { 6163 const ue = B7[p.placement]; 6164 A = (C * 0.5 + M + i) * ue.x, I = (w * 0.5 + M + i) * ue.y; 6165 } 6166 const L = f.x - C * 0.5 + A - ((y?.center.x ?? 0.5) - 0.5) * f.size, k = f.y - w * 0.5 + I - ((y?.center.y ?? 0.5) - 0.5) * f.size; 6167 if (!(!t || N7(t, L, k, C, w)) || r.some( 6168 (ue) => O7(ue.point, ue.marker?.center, L, k, C, w) 6169 ) || n.some((ue) => tP(ue, L, k, C, w))) 6170 continue; 6171 const se = { index: u, text: b, x: L, y: k, width: C, height: w, datum: p }; 6172 c.push(se), n.push(se); 6173 } 6174 s.set(a, c); 6175 } 6176 } 6177 return s; 6178} 6179function z7(e, t = 0) { 6180 const i = []; 6181 for (let s = 0; s < e.length; s++) { 6182 const n = e[s], { 6183 point: { x: o, y: r }, 6184 label: { text: a } 6185 } = n; 6186 let { width: l, height: c } = n.label; 6187 if (l += t, c += t, i.some((u) => tP(u, o, r, l, c))) 6188 return !0; 6189 i.push({ index: s, text: a, x: o, y: r, width: l, height: c, datum: n }); 6190 } 6191 return !1; 6192} 6193function H7(e, t) { 6194 const i = Math.max(e.length, t.length), s = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(); 6195 for (let o = 0; o < i; o++) { 6196 const r = e[o], a = t[o]; 6197 r !== a && (n.has(a) ? n.delete(a) : a && s.add(a), s.has(r) ? s.delete(r) : r && n.add(r)); 6198 } 6199 return { changed: s.size > 0 || n.size > 0, added: s, removed: n }; 6200} 6201var V7 = new Intl.NumberFormat("en-US", { maximumFractionDigits: 2, useGrouping: !1 }), U7 = new Intl.NumberFormat("en-US", { style: "percent" }); 6202function Tp(e, t = 2) { 6203 return typeof e == "number" ? sP(e, t) : String(e ?? ""); 6204} 6205function iP(e) { 6206 return U7.format(e); 6207} 6208function sP(e, t) { 6209 return t === 2 ? V7.format(e) : new Intl.NumberFormat("en-US", { maximumFractionDigits: t, useGrouping: !1 }).format(e); 6210} 6211var pw = "class-instance"; 6212function Sr(e, t, i) { 6213 if (hi(t)) { 6214 if (!hi(e) || e.length !== t.length || t.some((s, n) => Sr(e[n], s) != null)) 6215 return t; 6216 } else if (Js(t)) { 6217 if (!Js(e)) 6218 return t; 6219 const s = {}, n = /* @__PURE__ */ new Set([ 6220 ...Object.keys(e), 6221 ...Object.keys(t) 6222 ]); 6223 for (const o of n) 6224 if (!(e[o] === t[o] || i?.includes(o))) 6225 if (typeof e[o] == typeof t[o]) { 6226 const r = Sr(e[o], t[o]); 6227 r !== null && (s[o] = r); 6228 } else 6229 s[o] = t[o]; 6230 return Object.keys(s).length ? s : null; 6231 } else if (e !== t) 6232 return t; 6233 return null; 6234} 6235function nP(e, t) { 6236 for (const i of Object.keys(e)) 6237 if (e[i] !== t?.[i]) 6238 return !1; 6239 return !0; 6240} 6241function As(e, t) { 6242 return hi(e) ? e.map((i) => As(i, t)) : Js(e) ? W7(e, t) : e instanceof Map ? new Map(As(Array.from(e))) : sx(e); 6243} 6244function W7(e, t) { 6245 const i = {}; 6246 for (const s of Object.keys(e)) 6247 i[s] = t?.has(s) ? sx(e[s]) : As(e[s], t); 6248 return i; 6249} 6250function sx(e) { 6251 return hi(e) ? e.slice(0) : Js(e) ? { ...e } : og(e) ? new Date(e) : QL(e) ? new RegExp(e.source, e.flags) : e; 6252} 6253function Xr(e, t, i, s, n) { 6254 if (hi(e)) { 6255 t(e, s, n); 6256 let o = 0; 6257 for (const r of e) 6258 Xr(r, t, i, s?.[o], n), o++; 6259 } else if (Js(e)) { 6260 t(e, s, n); 6261 for (const o of Object.keys(e)) { 6262 if (i?.has(o)) 6263 continue; 6264 const r = e[o]; 6265 Xr(r, t, i, s?.[o], n); 6266 } 6267 } 6268} 6269function sp(e, t, i = {}) { 6270 const { path: s, matcherPath: n = s?.replace(/(\[[0-9+]+])/i, "[]"), skip: o = [] } = i; 6271 if (e == null) 6272 throw new Error(`AG Charts - target is uninitialised: ${s ?? "<root>"}`); 6273 if (t == null) 6274 return e; 6275 if (br(e)) 6276 return e.set(t); 6277 const r = e, a = Ub(e); 6278 for (const l of Object.keys(t)) { 6279 if (FS.has(l)) 6280 continue; 6281 const c = `${n ? n + "." : ""}${l}`; 6282 if (o.includes(c)) 6283 continue; 6284 const u = t[l], d = `${s ? s + "." : ""}${l}`, p = r.constructor, f = r[l]; 6285 try { 6286 const m = Ub(f), y = Ub(u); 6287 if (a === pw && !(l in e)) { 6288 if (u === void 0) 6289 continue; 6290 Ee.warn(`unable to set [${d}] in ${p?.name} - property is unknown`); 6291 continue; 6292 } 6293 if (m != null && y != null && y !== m && (m !== pw || y !== "object")) { 6294 Ee.warn( 6295 `unable to set [${d}] in ${p?.name} - can't apply type of [${y}], allowed types are: [${m}]` 6296 ); 6297 continue; 6298 } 6299 br(f) ? r[l].set(u) : y === "object" ? (f == null && (r[l] = {}), sp(f ?? r[l], u, { 6300 ...i, 6301 path: d, 6302 matcherPath: c 6303 })) : r[l] = u; 6304 } catch (m) { 6305 Ee.warn(`unable to set [${d}] in [${p?.name}]; nested error is: ${m.message}`); 6306 } 6307 } 6308 return e; 6309} 6310function Ub(e) { 6311 return e == null ? null : XL(e) || og(e) ? "primitive" : hi(e) ? "array" : Qs(e) ? Js(e) ? "object" : pw : Rl(e) ? "function" : "primitive"; 6312} 6313function Ri(e, t) { 6314 const i = hi(e) ? e : e.split("."); 6315 if (i.length === 1) { 6316 const [s] = i; 6317 return ha( 6318 (n, o, r) => n[s] = r, 6319 (n) => n[s], 6320 t 6321 ); 6322 } 6323 return ha( 6324 (s, n, o) =>
6324 OS(s, i, o), 6325 (s) => PS(s, i), 6326 t 6327 ); 6328} 6329function j7(e) { 6330 return ha((t, i, s) => t[e] = s); 6331} 6332function rs(e, t) { 6333 return ha((i, s, n) => i[e][t ?? s] = n); 6334} 6335function Un(e) { 6336 const { newValue: t, oldValue: i, changeValue: s } = e; 6337 return ha((n, o, r, a) => (r !== a && (a !== void 0 && i?.call(n, a), r !== void 0 && t?.call(n, r), s?.call(n, r, a)), r)); 6338} 6339function jc(e) { 6340 return ZL(e); 6341} 6342var Wb = "color: green", jb = "color: grey"; 6343function $7() { 6344 return ZL(() => { 6345 }); 6346} 6347function gw(e, t) { 6348 const i = wc(t); 6349 if (i.length === 0) 6350 return; 6351 const s = qL(e); 6352 for (const n of i) 6353 n in s && (t[n] = s[n]); 6354} 6355var oP = class { 6356 transitionRoot(e, t) { 6357 this.parent ? this.parent.transitionRoot(e, t) : this.transition(e, t); 6358 } 6359}, nx = class cn extends oP { 6360 constructor(t, i, s) { 6361 super(), this.defaultState = t, this.states = i, this.enterEach = s, this.debug = Xt.create(!0, "animation"), this.state = t, this.debug(`%c${this.constructor.name} | init -> ${t}`, Wb); 6362 } 6363 // TODO: handle events which do not require data without requiring `undefined` to be passed as as parameter, while 6364 // also still requiring data to be passed to those events which do require it. 6365 transition(t, i) { 6366 if (!this.transitionChild(t, i) || this.state === cn.child || this.state === cn.parent) 6367 return; 6368 const n = this.state, o = this.states[this.state]; 6369 let r = o[t]; 6370 const a = `%c${this.constructor.name} | ${this.state} -> ${t} ->`; 6371 if (Array.isArray(r)) 6372 r = r.find((u) => { 6373 if (!u.guard) 6374 return !0; 6375 const d = u.guard(i); 6376 return d || this.debug(`${a} (guarded)`, u.target, jb), d; 6377 }); 6378 else if (typeof r == "object" && !(r instanceof cn) && r.guard && !r.guard(i)) { 6379 this.debug(`${a} (guarded)`, r.target, jb); 6380 return; 6381 } 6382 if (!r) { 6383 this.debug(`${a} ${this.state}`, jb); 6384 return; 6385 } 6386 const l = this.getDestinationState(r), c = l === this.state ? void 0 : o.onExit; 6387 this.debug(`${a} ${l}`, Wb), this.state = l, typeof r == "function" ? r(i) : typeof r == "object" && !(r instanceof cn) && r.action?.(i), c?.(), this.enterEach?.(n, l), l !== n && l !== cn.child && l !== cn.parent && this.states[l].onEnter?.(n, i); 6388 } 6389 transitionAsync(t, i) { 6390 setTimeout(() => { 6391 this.transition(t, i); 6392 }, 0); 6393 } 6394 is(t) { 6395 return this.state === cn.child && this.childState ? this.childState.is(t) : this.state === t; 6396 } 6397 resetHierarchy() { 6398 this.debug( 6399 `%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`, 6400 "color: green" 6401 ), this.state = this.defaultState; 6402 } 6403 transitionChild(t, i) { 6404 return this.state !== cn.child || !this.childState || (gw(this, this.childState), this.childState.transition(t, i), !this.childState.is(cn.parent)) ? !0 : (this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`, Wb), this.state = this.defaultState, this.states[this.state].onEnter?.(), this.childState.resetHierarchy(), !1); 6405 } 6406 getDestinationState(t) { 6407 let i = this.state; 6408 return typeof t == "string" ? i = t : t instanceof cn ? (this.childState = t, this.childState.parent = this, i = cn.child) : typeof t == "object" && (t.target instanceof cn ? (this.childState = t.target, this.childState.parent = this, i = cn.child) : t.target != null && (i = t.target)), i; 6409 } 6410}; 6411nx.child = "__child"; 6412nx.parent = "__parent"; 6413var gg = nx, Y7 = class extends oP { 6414 constructor(...e) { 6415 super(), this.stateMachines = e; 6416 for (const t of e) 6417 t.parent = this; 6418 } 6419 transition(e, t) { 6420 for (const i of this.stateMachines) 6421 gw(this, i), i.transition(e, t); 6422 } 6423 transitionAsync(e, t) { 6424 for (const i of this.stateMachines) 6425 gw(this, i), i.transitionAsync(e, t); 6426 } 6427}; 6428function ox() { 6429 const e = /* @__PURE__ */ new Map(); 6430 return (t) => { 6431 const i = e.get(t); 6432 return i ? (e.set(t, i + 1), `${t}_${i}`) : (e.set(t, 1), t); 6433 }; 6434} 6435var rx = class { 6436 static wrapText(e, t) { 6437 return this.wrapLines(e, t).join(` 6438`); 6439 } 6440 static wrapLines(e, t) { 6441 const i = this.textWrap(e, t); 6442 return t.overflow === "hide" && i.some((s) =>
6442 s.endsWith(vi.EllipsisChar)) ? [] : i; 6443 } 6444 static appendEllipsis(e) { 6445 return e.replace(/[.,]{1,5}$/, "") + vi.EllipsisChar; 6446 } 6447 static truncateLine(e, t, i, s) { 6448 const n = t.textWidth(vi.EllipsisChar); 6449 let o = 0, r = 0; 6450 for (; r < e.length; r++) { 6451 const a = t.textWidth(e.charAt(r)); 6452 if (o + a > i) 6453 break; 6454 o += a; 6455 } 6456 if (e.length === r && (!s || o + n <= i)) 6457 return s ? e + vi.EllipsisChar : e; 6458 for (e = e.slice(0, r).trimEnd(); e.length && t.textWidth(e) + n > i; ) 6459 e = e.slice(0, -1).trimEnd(); 6460 return e + vi.EllipsisChar; 6461 } 6462 static textWrap(e, t) { 6463 const i = e.split(vi.lineSplitter), s = wa.getMeasurer(t); 6464 if (t.textWrap === "never") 6465 return i.map((a) => this.truncateLine(a.trimEnd(), s, t.maxWidth)); 6466 const n = [], o = t.textWrap === "hyphenate", r = t.textWrap == null || t.textWrap === "on-space"; 6467 for (const a of i) { 6468 let l = a.trimEnd(); 6469 if (l === "") { 6470 n.push(l); 6471 continue; 6472 } 6473 for (let c = 0, u = 0, d = 0; c < l.length; c++) { 6474 const p = l.charAt(c); 6475 if (u += s.textWidth(p), p === " " && (d = c), u > t.maxWidth) { 6476 if (c === 0) 6477 break; 6478 const f = s.textWidth(l.slice(0, c + 1)); 6479 if (f <= t.maxWidth) { 6480 u = f; 6481 continue; 6482 } 6483 if (d) { 6484 const b = this.getWordAt(l, d + 1), C = s.textWidth(b); 6485 if (C <= t.maxWidth) { 6486 n.push(l.slice(0, d).trimEnd()), l = l.slice(d).trimStart(), c = -1, u = 0, d = 0; 6487 continue; 6488 } else r && C > t.maxWidth && n.push( 6489 l.slice(0, d).trimEnd(), 6490 this.truncateLine( 6491 l.slice(d).trimStart(), 6492 s, 6493 t.maxWidth, 6494 !0 6495 ) 6496 ); 6497 } else r && n.push(this.truncateLine(l, s, t.maxWidth, !0)); 6498 if (r) { 6499 l = ""; 6500 break; 6501 } 6502 const m = o ? "-" : ""; 6503 let y = l.slice(0, c).trim(); 6504 for (; y.length && s.textWidth(y + m) > t.maxWidth; ) 6505 y = y.slice(0, -1).trimEnd(); 6506 if (n.push(y + m), !y.length) { 6507 l = ""; 6508 break; 6509 } 6510 l = l.slice(y.length).trimStart(), c = -1, u = 0, d = 0; 6511 } 6512 } 6513 l && n.push(l); 6514 } 6515 return this.avoidOrphans(n, s, t), this.clipLines(n, s, t); 6516 } 6517 static getWordAt(e, t) { 6518 const i = e.indexOf(" ", t); 6519 return i === -1 ? e.slice(t) : e.slice(t, i); 6520 } 6521 static clipLines(e, t, i) { 6522 if (!i.maxHeight) 6523 return e; 6524 const { height: s, lineMetrics: n } = t.measureLines(e); 6525 if (s <= i.maxHeight) 6526 return e; 6527 for (let o = 0, r = 0; o < n.length; o++) { 6528 const { lineHeight: a } = n[o]; 6529 if (r += a, r > i.maxHeight) { 6530 if (i.overflow === "hide") 6531 return []; 6532 const l = e.slice(0, o || 1), c = l.pop(); 6533 return l.concat(this.truncateLine(c, t, i.maxWidth, !0)); 6534 } 6535 } 6536 return e; 6537 } 6538 static avoidOrphans(e, t, i) { 6539 if (i.avoidOrphans === !1 || e.length < 2) 6540 return; 6541 const { length: s } = e, n = e[s - 1], o = e[s - 2]; 6542 if (o.length < n.length) 6543 return; 6544 const r = o.lastIndexOf(" "); 6545 if (r === -1 || r === o.indexOf(" ") || n.includes(" ")) 6546 return; 6547 const a = o.slice(r + 1); 6548 t.textWidth(n + a) <= i.maxWidth && (e[s - 2] = o.slice(0, r), e[s - 1] = a + " " + n); 6549 } 6550}, Qt = class extends it { 6551 constructor() { 6552 super(...arguments), this.id = So(this), this.node = new eP({ zIndex: 1 }).setProperties({ 6553 textAlign: "center", 6554 pointerEvents: 1 6555 /* None */ 6556 }), this.enabled = !1, this.textAlign = "center", this.fontSize = 10, this.fontFamily = "sans-serif", this.wrapping = "always", this.padding = 0, this.layoutStyle = "block", this.truncated = !1; 6557 } 6558 registerInteraction(e, t) { 6559 return e.layoutManager.addListener("layout:complete", () => this.updateA11yText(e, t)); 6560 } 6561 computeTextWrap(e, t) { 6562 const { text: i, padding: s, wrapping: n } = this, o = Math.min(this.maxWidth ?? 1 / 0, e) - s * 2, r = this.maxHeight ?? t - s * 2; 6563 if (!isFinite(o) && !isFinite(r)) { 6564 this.node.text = i; 6565 return; 6566 } 6567 const a = rx.wrapText(i ?? "", { maxWidth: o, maxHeight: r, font: this, textWrap: n }); 6568 this.node.text = a, this.truncated = a.includes(vi.EllipsisCh
6568ar); 6569 } 6570 updateA11yText(e, t) { 6571 const { proxyInteractionService: i } = e; 6572 if (this.enabled && this.text) { 6573 const s = Ii.toCanvas(this.node); 6574 if (s) { 6575 const { id: n } = this; 6576 this.proxyText ?? (this.proxyText = i.createProxyElement({ type: "text", domManagerId: n, where: t })), this.proxyText.textContent = this.text, this.proxyText.setBounds(s), this.proxyText.addListener("mousemove", (o) => this.handleMouseMove(e, o)), this.proxyText.addListener("mouseleave", (o) => this.handleMouseLeave(e, o)); 6577 } 6578 } else 6579 this.proxyText?.destroy(), this.proxyText = void 0; 6580 } 6581 handleMouseMove(e, t) { 6582 if (t != null && this.enabled && this.node.visible && this.truncated) { 6583 const { x: i, y: s } = Ii.toCanvas(this.node), n = t.sourceEvent.offsetX + i, o = t.sourceEvent.offsetY + s, r = { type: "hover", canvasX: n, canvasY: o }; 6584 e.tooltipManager.updateTooltip( 6585 this.id, 6586 { canvasX: n, canvasY: o, lastPointerEvent: r, showArrow: !1 }, 6587 { title: this.text } 6588 ); 6589 } 6590 } 6591 handleMouseLeave(e, t) { 6592 e.tooltipManager.removeTooltip(this.id); 6593 } 6594}; 6595Qt.SMALL_PADDING = 10; 6596Qt.LARGE_PADDING = 20; 6597S([ 6598 D(je), 6599 rs("node", "visible") 6600], Qt.prototype, "enabled", 2); 6601S([ 6602 D(Me, { optional: !0 }), 6603 rs("node") 6604], Qt.prototype, "text", 2); 6605S([ 6606 D(Ck, { optional: !0 }), 6607 rs("node") 6608], Qt.prototype, "textAlign", 2); 6609S([ 6610 D(Ca, { optional: !0 }), 6611 rs("node") 6612], Qt.prototype, "fontStyle", 2); 6613S([ 6614 D(ba, { optional: !0 }), 6615 rs("node") 6616], Qt.prototype, "fontWeight", 2); 6617S([ 6618 D(Te), 6619 rs("node") 6620], Qt.prototype, "fontSize", 2); 6621S([ 6622 D(Me), 6623 rs("node") 6624], Qt.prototype, "fontFamily", 2); 6625S([ 6626 D(Ft, { optional: !0 }), 6627 rs("node", "fill") 6628], Qt.prototype, "color", 2); 6629S([ 6630 D(Te, { optional: !0 }) 6631], Qt.prototype, "spacing", 2); 6632S([ 6633 D(Te, { optional: !0 }) 6634], Qt.prototype, "maxWidth", 2); 6635S([ 6636 D(Te, { optional: !0 }) 6637], Qt.prototype, "maxHeight", 2); 6638S([ 6639 D(Wv) 6640], Qt.prototype, "wrapping", 2); 6641S([ 6642 D(Te) 6643], Qt.prototype, "padding", 2); 6644S([ 6645 D(Me) 6646], Qt.prototype, "layoutStyle", 2); 6647var qo = class extends Co { 6648 constructor(e = {}) { 6649 super(e), this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.startLine = !1, this.endLine = !1, this.isRange = !1, this.restoreOwnStyles(); 6650 } 6651 computeBBox() { 6652 return new _e(this.x1, this.y1, this.x2 - this.x1, this.y2 - this.y1); 6653 } 6654 isPointInPath(e, t) { 6655 return !1; 6656 } 6657 render(e) { 6658 const { ctx: t } = e; 6659 let { x1: i, y1: s, x2: n, y2: o } = this; 6660 i = this.align(i), s = this.align(s), n = this.align(n), o = this.align(o); 6661 const { fill: r, opacity: a, isRange: l } = this; 6662 if (!!(l && r)) { 6663 const { fillOpacity: y } = this; 6664 this.applyFill(t), t.globalAlpha = a * y, t.beginPath(), t.moveTo(i, s), t.lineTo(n, s), t.lineTo(n, o), t.lineTo(i, o), t.closePath(), t.fill(); 6665 } 6666 const { stroke: u, strokeWidth: d, startLine: p, endLine: f } = this; 6667 if (!!((p || f) && u && d)) { 6668 const { strokeOpacity: y, lineDash: b, lineDashOffset: C, lineCap: w, lineJoin: M } = this; 6669 this.applyStroke(t), t.globalAlpha = a * y, t.lineWidth = d, b && t.setLineDash(b), C && (t.lineDashOffset = C), w && (t.lineCap = w), M && (t.lineJoin = M), t.beginPath(), p && (t.moveTo(i, s), t.lineTo(n, s)), f && (t.moveTo(n, o), t.lineTo(i, o)), t.stroke(); 6670 } 6671 this.fillShadow?.markClean(), super.render(e); 6672 } 6673}; 6674qo.className = "Range"; 6675qo.defaultStyles = { 6676 ...Co.defaultStyles, 6677 strokeWidth: 1 6678}; 6679S([ 6680 Ge() 6681], qo.prototype, "x1", 2); 6682S([ 6683 Ge() 6684], qo.prototype, "y1", 2); 6685S([ 6686 Ge() 6687], qo.prototype, "x2", 2); 6688S([ 6689 Ge() 6690], qo.prototype, "y2", 2); 6691S([ 6692 Ge() 6693], qo.prototype, "startLine", 2); 6694S([ 6695 Ge() 6696], qo.prototype, "endLine", 2); 6697S([ 6698 Ge() 6699], qo.prototype, "isRange", 2); 6700var ts = class extends it { 6701 constructor() { 6702 super(...arguments), this.enabled = !0, this.fontSize = 12, this.fontFamily = "Verdana, sans-serif"; 6703 } 6704 getFont() { 6705 return vi.toFontString(this); 6706 } 6707}; 6708S([ 6709 D(je) 6710], ts.prototype, "enabled", 2); 6711S([ 6712 D(Ft, { optional: !0 }) 6713], ts.prototype, "color", 2); 6714S([ 6715 D(Ca, { optional: !0 }) 6716], ts.prototype, "fontStyle", 2); 6717S([ 6718 D(ba, { optional: !0 }) 6719], ts.prototype, "fontWeight", 2); 6720S([ 6721 D(Te) 6722], ts.prototype, "fontSize", 2); 6723S([ 6724 D(Me) 6725], ts.prototype, "fontFamily", 2); 6726S([ 6727 D(tn, { optional: !0 }) 6728], ts.prototype, "formatter", 2);
6729function Om(e) { 6730 const { parallelFlipRotation: t = 0, regularFlipRotation: i = 0 } = e, s = e.rotation ? zt(Es(e.rotation)) : 0, n = !s && t >= 0 && t <= Math.PI ? -1 : 1, o = !s && i >= 0 && i <= Math.PI ? -1 : 1; 6731 let r = 0; 6732 return e.parallel ? r = n * Math.PI / 2 : o === -1 && (r = Math.PI), { configuredRotation: s, defaultRotation: r, parallelFlipFlag: n, regularFlipFlag: o }; 6733} 6734function K7(e, t) { 6735 return isNaN(e) ? t ? 0 : 10 : e; 6736} 6737function Z7(e, t, i, s) { 6738 return e && !t ? i * s === -1 ? "hanging" : "bottom" : "middle"; 6739} 6740function $b(e, t, i, s, n) { 6741 const o = t > 0 && t <= Math.PI, r = i > 0 && i <= Math.PI, a = o || r ? -1 : 1; 6742 if (e) 6743 if (t || i) { 6744 if (s * a === -1) 6745 return "end"; 6746 } else 6747 return "center"; 6748 else if (s * n === -1) 6749 return "end"; 6750 return "start"; 6751} 6752function q7(e, t, i, s) { 6753 const n = []; 6754 for (const { tickLabel: o, translationY: r } of e) { 6755 if (!o) 6756 continue; 6757 const { width: a, height: l } = s.measureLines(o), c = new _e(t, r, a, l), u = new _e(t, r, 0, 0); 6758 i.transformBBox(u, c); 6759 const { x: d, y: p } = c; 6760 n.push({ 6761 point: { x: d, y: p }, 6762 label: { text: o, width: a, height: l } 6763 }); 6764 } 6765 return n; 6766} 6767function Q7(e) { 6768 return e != null && Object.hasOwn(e, "toString") && mn(e.toString()); 6769} 6770function X7(e) { 6771 return e != null && Object.hasOwn(e, "valueOf") && kt(e.valueOf()); 6772} 6773function Zv(e) { 6774 return kt(e) || _v(e) || X7(e); 6775} 6776function CI(e, t) { 6777 return e != null && (!t || Zv(e)); 6778} 6779function fw(e) { 6780 return Q7(e) && Object.hasOwn(e, "id") ? e.id : e; 6781} 6782var ax = (e) => e === "value" ? jt( 6783 (t, i) => i.target.type === "line", 6784 (t) => t.target.type === "range" ? "crossLine type 'range' to have a 'range' property instead of 'value'" : "crossLine property 'type' to be 'line'" 6785) : jt( 6786 (t, i) => i.target.type === "range", 6787 (t) => t.target.type === "line" ? "crossLine type 'line' to have a 'value' property instead of 'range'" : "crossLine property 'type' to be 'range'" 6788), rP = (e, t, i, s, n) => { 6789 const o = e === "line" && t !== void 0, r = e === "range" && i !== void 0; 6790 if (!o && !r) 6791 return !0; 6792 const [a, l] = i ?? [t, void 0], c = ti.is(s) || Oo.is(s), u = CI(a, c) && !isNaN(s.convert(a)), d = CI(l, c) && !isNaN(s.convert(l)); 6793 if (o && u || r && u && d) 6794 return n?.() ?? !0; 6795 const p = ["Expecting crossLine"]; 6796 return r ? (u || p.push(`range start ${ep(a)}`), d || p.push(`${u ? "" : "and "}range end ${ep(l)}`)) : p.push(`value ${ep(a)}`), p.push("to match the axis scale domain."), Ee.warnOnce(p.join(" ")), !1; 6797}, J7 = { 6798 top: { xTranslationDirection: 0, yTranslationDirection: -1 }, 6799 bottom: { xTranslationDirection: 0, yTranslationDirection: 1 }, 6800 left: { xTranslationDirection: -1, yTranslationDirection: 0 }, 6801 right: { xTranslationDirection: 1, yTranslationDirection: 0 }, 6802 "top-left": { xTranslationDirection: 1, yTranslationDirection: -1 }, 6803 "top-right": { xTranslationDirection: -1, yTranslationDirection: -1 }, 6804 "bottom-left": { xTranslationDirection: 1, yTranslationDirection: 1 }, 6805 "bottom-right": { xTranslationDirection: -1, yTranslationDirection: 1 }, 6806 inside: { xTranslationDirection: 0, yTranslationDirection: 0 }, 6807 "inside-left": { xTranslationDirection: 1, yTranslationDirection: 0 }, 6808 "inside-right": { xTranslationDirection: -1, yTranslationDirection: 0 }, 6809 "inside-top": { xTranslationDirection: 0, yTranslationDirection: 1 }, 6810 "inside-bottom": { xTranslationDirection: 0, yTranslationDirection: -1 }, 6811 "inside-top-left": { xTranslationDirection: 1, yTranslationDirection: 1 }, 6812 "inside-bottom-left": { xTranslationDirection: 1, yTranslationDirection: -1 }, 6813 "inside-top-right": { xTranslationDirection: -1, yTranslationDirection: 1 }, 6814 "inside-bottom-right": { xTranslationDirection: -1, yTranslationDirection: -1 } 6815}, ej = { 6816 top: { xTranslationDirection: 1, yTranslationDirection: 0 }, 6817 bottom: { xTranslationDirection: -1, yTranslationDirection: 0 }, 6818 left: { xTranslationDirection: 0, yTranslationDirection: -1 }, 6819 right: { xTranslationDirection: 0, yTranslationDirection: 1 }, 6820 "top-left": { xTranslationDirection: -1, yTranslationDirection: -1 }, 6821 "top-right": { xTranslationDirection: -1, yTranslationDirection: 1 }, 6822 "bottom-left": { xTranslationDirection: 1, yTranslationDirection: -1 }, 6823 "bottom-right": { xTranslationDirection: 1, yTranslationDirection: 1 }, 6824 inside: { xTranslationDirection: 0, yTranslationDirection: 0 }, 6825 "inside-left": { xTranslationDirection: 0, yTranslationDirection: 1 }, 6826 "inside-right": { xTranslationDirection: 0, yTranslationDirection: -1 }, 6827 "inside-top": { xTranslationDirection: -1, yTranslationDirection: 0 }, 6828 "inside-bottom": { xTranslationDirection: 1, yTranslationDirection: 0 }, 6829 "inside-top-left": { xTranslationDirection: -1, yTranslationDirection: 1 }, 6830 "inside-bottom-left": { xTranslationDirection: 1, yTranslationDirection: 1 }, 6831 "inside-top-right": { xTranslationDirection: -1, yTranslationDirection: -1 }, 6832 "inside-bottom-right": { xTranslationDirection: 1, yTranslationDirection: -1 } 6833}
6833; 6834function mw({ 6835 yDirection: e, 6836 padding: t = 0, 6837 position: i = "top", 6838 bbox: s 6839}) { 6840 const n = e ? J7 : ej, { xTranslationDirection: o, yTranslationDirection: r } = n[i], a = o * (t + s.width / 2), l = r * (t + s.height / 2); 6841 return { 6842 xTranslation: a, 6843 yTranslation: l 6844 }; 6845} 6846function aP({ 6847 yDirection: e, 6848 bbox: t, 6849 padding: i = 0, 6850 position: s = "top" 6851}) { 6852 const n = {}; 6853 return s.startsWith("inside") || (s === "top" && !e ? n.top = i + t.height : s === "bottom" && !e ? n.bottom = i + t.height : s === "left" && e ? n.left = i + t.width : s === "right" && e && (n.right = i + t.width)), n; 6854} 6855var Nm = ({ direction: e, xEnd: t, yStart: i, yEnd: s }) => e === "y" ? { x: t / 2, y: i } : { x: t, y: isNaN(s) ? i : (i + s) / 2 }, bI = ({ direction: e, xStart: t, xEnd: i, yStart: s, yEnd: n }) => e === "y" ? { x: t, y: isNaN(n) ? s : (s + n) / 2 } : { x: i / 2, y: s }, wI = ({ direction: e, xEnd: t, yStart: i, yEnd: s }) => e === "y" ? { x: t, y: isNaN(s) ? i : (i + s) / 2 } : { x: t / 2, y: isNaN(s) ? i : s }, SI = ({ direction: e, xStart: t, xEnd: i, yStart: s, yEnd: n }) => e === "y" ? { x: i / 2, y: isNaN(n) ? s : n } : { x: t, y: isNaN(n) ? s : (s + n) / 2 }, tj = ({ xEnd: e, yStart: t, yEnd: i }) => ({ x: e / 2, y: isNaN(i) ? t : (t + i) / 2 }), xI = ({ direction: e, xStart: t, xEnd: i, yStart: s }) => e === "y" ? { x: t / 2, y: s } : { x: i, y: s }, MI = ({ direction: e, xStart: t, yStart: i, yEnd: s }) => e === "y" ? { x: t, y: isNaN(s) ? i : s } : { x: t, y: i }, AI = ({ direction: e, xEnd: t, yStart: i, yEnd: s }) => e === "y" ? { x: t, y: i } : { x: t, y: isNaN(s) ? i : s }, DI = ({ direction: e, xStart: t, xEnd: i, yStart: s, yEnd: n }) => e === "y" ? { x: i, y: isNaN(n) ? s : n } : { x: t, y: isNaN(n) ? s : n }, lP = { 6856 top: { c: Nm }, 6857 bottom: { c: SI }, 6858 left: { c: bI }, 6859 right: { c: wI }, 6860 "top-left": { c: xI }, 6861 "top-right": { c: AI }, 6862 "bottom-left": { c: MI }, 6863 "bottom-right": { c: DI }, 6864 inside: { c: tj }, 6865 "inside-left": { c: bI }, 6866 "inside-right": { c: wI }, 6867 "inside-top": { c: Nm }, 6868 "inside-bottom": { c: SI }, 6869 "inside-top-left": { c: xI }, 6870 "inside-bottom-left": { c: MI }, 6871 "inside-top-right": { c: AI }, 6872 "inside-bottom-right": { c: DI } 6873}, ij = si( 6874 [ 6875 "top", 6876 "left", 6877 "right", 6878 "bottom", 6879 "top-left", 6880 "top-right", 6881 "bottom-left", 6882 "bottom-right", 6883 "inside", 6884 "inside-left", 6885 "inside-right", 6886 "inside-top", 6887 "inside-bottom", 6888 "inside-top-left", 6889 "inside-bottom-left", 6890 "inside-top-right", 6891 "inside-bottom-right" 6892 ], 6893 "crossLine label position" 6894), Mo = class extends it { 6895 constructor() { 6896 super(...arguments), this.fontSize = 14, this.fontFamily = "Verdana, sans-serif", this.padding = 5, this.color = "rgba(87, 87, 87, 1)"; 6897 } 6898}; 6899S([ 6900 D(je, { optional: !0 }) 6901], Mo.prototype, "enabled", 2); 6902S([ 6903 D(Me, { optional: !0 }) 6904], Mo.prototype, "text", 2); 6905S([ 6906 D(Ca, { optional: !0 }) 6907], Mo.prototype, "fontStyle", 2); 6908S([ 6909 D(ba, { optional: !0 }) 6910], Mo.prototype, "fontWeight", 2); 6911S([ 6912 D(Te) 6913], Mo.prototype, "fontSize", 2); 6914S([ 6915 D(Me) 6916], Mo.prototype, "fontFamily", 2); 6917S([ 6918 D(At) 6919], Mo.prototype, "padding", 2); 6920S([ 6921 D(Ft, { optional: !0 }) 6922], Mo.prototype, "color", 2); 6923S([ 6924 D(ij, { optional: !0 }) 6925], Mo.prototype, "position", 2); 6926S([ 6927 D(At, { optional: !0 }) 6928], Mo.prototype, "rotation", 2); 6929S([ 6930 D(je, { optional: !0 }) 6931], Mo.prototype, "parallel", 2); 6932var wn = class extends it { 6933 constructor() { 6934 super(), this.id = So(this), this.label = new Mo(), this.scale = void 0, this.clippedRange = [-1 / 0, 1 / 0], this.gridLength = 0, this.sideFlag = -1, this.parallelFlipRotation = 0, this.regularFlipRotation = 0, this.direction = "x", this.rangeGroup = new Ye({ name: this.id }), this.lineGroup = new Ye({ name: this.id }), this.labelGroup = new Ye({ name: this.id }), this.crossLineRange = new qo(), this.crossLineLabel = new Sd(), this.labelPoint = void 0, this.data = [], this.startLine = !1, this.endLine = !1, this.isRange = !1, this._isRange = void 0, this.lineGroup.append(this.crossLineRange), this.labelGroup.append(this.crossLineLabel), this.crossLineRange.pointerEvents = 1; 6935 } 6936 update(e) { 6937 const { enabled: t, data: i, type: s, value: n, range: o, scale: r }
6937 = this; 6938 if (!s || !r || !t || !e || !rP(s, n, o, r) || i.length === 0) { 6939 this.rangeGroup.visible = !1, this.lineGroup.visible = !1, this.labelGroup.visible = !1; 6940 return; 6941 } 6942 this.rangeGroup.visible = e, this.lineGroup.visible = e, this.labelGroup.visible = e, this.updateNodes(); 6943 const { isRange: a } = this; 6944 a !== this._isRange && (a ? this.rangeGroup.appendChild(this.crossLineRange) : this.lineGroup.appendChild(this.crossLineRange)), this._isRange = a; 6945 } 6946 calculateLayout(e, t) { 6947 if (!e) 6948 return; 6949 const { 6950 scale: i, 6951 gridLength: s, 6952 sideFlag: n, 6953 direction: o, 6954 label: { position: r = "top" }, 6955 clippedRange: a, 6956 strokeWidth: l = 0 6957 } = this; 6958 if (this.data = [], !i) 6959 return; 6960 const c = i.bandwidth ?? 0, u = i.step ?? 0, d = (t ? -1 : 1) * (i instanceof Tl ? (u - c) / 2 : 0), [p, f] = [0, n * s]; 6961 let [m, y] = this.getRange(); 6962 const b = y === void 0 && Oo.is(i) ? c / 2 + d : 0; 6963 let [C, w] = [ 6964 Number(i.convert(m, !0)) - d + b, 6965 i.convert(y, !0) + c + d 6966 ]; 6967 C = tw(C, a), w = tw(w, a), [m, y] = [Number(i.convert(m)) + b, i.convert(y) + c]; 6968 const M = (m === C || y === w || C !== w) && Math.abs(w - C) > 0; 6969 if (M && C > w && ([C, w] = [w, C], [m, y] = [y, m]), m - d >= C && (m -= d), y + d <= w && (y += d), this.isRange = M, this.startLine = l > 0 && m >= C && m <= C + d, this.endLine = l > 0 && y >= w - c - d && y <= w, !M && !this.startLine && !this.endLine || (this.data = [C, w], !this.label.enabled)) 6970 return; 6971 const { c: A = Nm } = lP[r] ?? {}, { x: I, y: L } = A({ 6972 direction: o, 6973 xStart: p, 6974 xEnd: f, 6975 yStart: C, 6976 yEnd: w 6977 }); 6978 this.labelPoint = { 6979 x: I, 6980 y: L 6981 }; 6982 } 6983 updateNodes() { 6984 this.updateRangeNode(), this.label.enabled && (this.updateLabel(), this.positionLabel()); 6985 } 6986 updateRangeNode() { 6987 const { 6988 crossLineRange: e, 6989 sideFlag: t, 6990 gridLength: i, 6991 data: s, 6992 startLine: n, 6993 endLine: o, 6994 isRange: r, 6995 fill: a, 6996 fillOpacity: l, 6997 stroke: c, 6998 strokeWidth: u, 6999 lineDash: d 7000 } = this; 7001 e.x1 = 0, e.x2 = t * i, e.y1 = s[0], e.y2 = s[1], e.startLine = n, e.endLine = o, e.isRange = r, e.fill = a, e.fillOpacity = l ?? 1, e.stroke = c, e.strokeWidth = u ?? 1, e.strokeOpacity = this.strokeOpacity ?? 1, e.lineDash = d; 7002 } 7003 updateLabel() { 7004 const { crossLineLabel: e, label: t } = this; 7005 t.text && (e.fontStyle = t.fontStyle, e.fontWeight = t.fontWeight, e.fontSize = t.fontSize, e.fontFamily = t.fontFamily, e.fill = t.color, e.text = t.text); 7006 } 7007 positionLabel() { 7008 const { 7009 crossLineLabel: e, 7010 labelPoint: { x: t = void 0, y: i = void 0 } = {},
7011 label: { parallel: s, rotation: n, position: o = "top", padding: r = 0 }, 7012 direction: a, 7013 parallelFlipRotation: l, 7014 regularFlipRotation: c 7015 } = this; 7016 if (t === void 0 || i === void 0) 7017 return; 7018 const { defaultRotation: u, configuredRotation: d } = Om({ 7019 rotation: n, 7020 parallel: s, 7021 regularFlipRotation: c, 7022 parallelFlipRotation: l 7023 }); 7024 e.rotation = u + d, e.textBaseline = "middle", e.textAlign = "center"; 7025 const p = e.getBBox(); 7026 if (!p) 7027 return; 7028 const f = a === "y", { xTranslation: m, yTranslation: y } = mw({ 7029 yDirection: f, 7030 padding: r, 7031 position: o, 7032 bbox: p 7033 }); 7034 e.translationX = t + m, e.translationY = i + y; 7035 } 7036 getRange() { 7037 const { value: e, range: t, scale: i } = this, s = ti.is(i) || Oo.is(i), n = t?.[0] ?? e; 7038 let o = t?.[1]; 7039 return !s && o === void 0 && (o = n), s && n === o && (o = void 0), [n, o]; 7040 } 7041 computeLabelBBox() { 7042 const { label: e } = this; 7043 if (!e.enabled) 7044 return; 7045 const t = new Sd(); 7046 t.fontFamily = e.fontFamily, t.fontSize = e.fontSize, t.fontStyle = e.fontStyle, t.fontWeight = e.fontWeight, t.text = e.text; 7047 const { 7048 labelPoint: { x: i = void 0, y: s = void 0 } = {}, 7049 label: { parallel: n, rotation: o, position: r = "top", padding: a = 0 }, 7050 direction: l, 7051 parallelFlipRotation: c, 7052 regularFlipRotation: u 7053 } = this; 7054 if (i === void 0 || s === void 0) 7055 return; 7056 const { configuredRotation: d } = Om({ 7057 rotation: o, 7058 parallel: n, 7059 regularFlipRotation: u, 7060 parallelFlipRotation: c 7061 }); 7062 t.rotation = d, t.textBaseline = "middle", t.textAlign = "center"; 7063 const p = t.getBBox(); 7064 if (!p) 7065 return; 7066 const f = l === "y", { xTranslation: m, yTranslation: y } = mw({ 7067 yDirection: f, 7068 padding: a, 7069 position: r, 7070 bbox: p 7071 }); 7072 return t.x = i + m, t.y = s + y, t.getBBox(); 7073 } 7074 calculatePadding(e) { 7075 const { 7076 isRange: t, 7077 startLine: i, 7078 endLine: s, 7079 direction: n, 7080 label: { padding: o = 0, position: r = "top" } 7081 } = this; 7082 if (!t && !i && !s) 7083 return; 7084 const a = this.computeLabelBBox(); 7085 if (a?.x == null || a?.y == null) 7086 return; 7087 const l = aP({ 7088 yDirection: n === "y", 7089 padding: o, 7090 position: r, 7091 bbox: a 7092 }); 7093 e.left = Math.max(e.left ?? 0, l.left ?? 0), e.right = Math.max(e.right ?? 0, l.right ?? 0), e.top = Math.max(e.top ?? 0, l.top ?? 0), e.bottom = Math.max(e.bottom ?? 0, l.bottom ?? 0); 7094 } 7095}; 7096wn.className = "CrossLine"; 7097S([ 7098 D(je, { optional: !0 }) 7099], wn.prototype, "enabled", 2); 7100S([ 7101 D(si(["range", "line"], "a crossLine type"), { optional: !0 }) 7102], wn.prototype, "type", 2); 7103S([ 7104 D(Dr(ax("range"), lg.restrict({ length: 2 })), { 7105 optional: !0 7106 }) 7107], wn.prototype, "range", 2); 7108S([ 7109 D(ax("value"), { optional: !0 }) 7110], wn.prototype, "value", 2); 7111S([ 7112 D(Ft, { optional: !0 }) 7113], wn.prototype, "fill", 2); 7114S([ 7115 D(Pt, { optional: !0 }) 7116], wn.prototype, "fillOpacity", 2); 7117S([ 7118 D(Ft, { optional: !0 }) 7119], wn.prototype, "stroke", 2); 7120S([ 7121 D(At, { optional: !0 }) 7122], wn.prototype, "strokeWidth", 2); 7123S([ 7124 D(Pt, { optional: !0 }) 7125], wn.prototype, "strokeOpacity", 2); 7126S([ 7127 D(ya, { optional: !0 }) 7128], wn.prototype, "lineDash", 2); 7129S([ 7130 D(Be) 7131], wn.prototype, "label", 2); 7132var cP = /* @__PURE__ */ ((e) => (e[e.CHART_BACKGROUND = 0] = "CHART_BACKGROUND", e[e.AXIS_GRID = 1] = "AXIS_GRID", e[e.AXIS = 2] = "AXIS", e[e.SERIES_CROSSLINE_RANGE = 3] = "SERIES_CROSSLINE_RANGE", e[e.SERIES_LAYER = 4] = "SERIES_LAYER", e[e.AXIS_FOREGROUND = 5] = "AXIS_FOREGROUND", e[e.SERIES_CROSSHAIR = 6] = "SERIES_CROSSHAIR", e[e.SERIES_CROSSLINE_LINE = 7] = "SERIES_CROSSLINE_LINE", e[e.SERIES_ANNOTATION = 8] = "SERIES_ANNOTATION", e[e.CHART_ANNOTATION = 9] = "CHART_ANNOTATION", e[e.CHART_ANNOTATION_FOCUSED = 10] = "CHART_ANNOTATION_FOCUSED", e[e.STATUS_BAR = 11] = "STATUS_BAR", e[e.SERIES_LABEL = 12] = "SERIES_LABEL", e[e.LEGEND = 13] = "LEGEND", e[e.NAVIGATOR = 14] = "NAVIGATOR", e[e.FOREGROUND = 15] = "FOREGROUND", e))(cP || {}), sj = ["stroke", "lineDash"], nj = va( 7133 (e) => Qs(e) && Object.keys(e).every((t) => sj.includes(t)), 7134 "objects with gridline style properties such as 'stroke' or 'lineDash'" 7135), qv = class { 7136 constructor() { 7137 this.enabled = !0, this.width = 1, this.style = [ 7138 { 7139 stroke: void 0, 7140 lineDash: [] 7141 } 7142 ]; 7143 } 7144}; 7145S([ 7146 D(je) 7147], qv.prototype, "enabled", 2); 7148S([ 7149 D(Te) 7150], qv.prototype, "width", 2); 7151S([ 7152 D(nj) 7153], qv.prototype, "style", 2); 7154function Ll(e, t = [void 0]) { 7155 return ha((i, s, n) => t.includes(n) ? Rl(e) ? e(n) : e : n); 7156} 7157var oj = {}; 7158Zo(oj, { 7159 TimeInterval: () => wd, 7160 day: () => Pm, 7161 friday: () => P8, 7162 hour: () => Uu, 7163 millisecond: () => Tk, 7164 minute: () => Wu, 7165 monday: () => R8, 7166 month: () => mc, 7167 saturday: () => F8, 7168 second: () => ju, 7169 sunday: () => Jh, 7170 thursday: () => k8, 7171 tuesday: () => T8, 7172 utcDay: () => gj, 7173 utcHour: () => dj, 7174 utcMinute: () => lj, 7175 utcMonth: () => vj, 7176 utcYear: () => bj, 7177 wednesday: () => L8, 7178 year: () => zv 7179}); 7180function rj(e) { 7181 return Math.floor(e.getTime() / ds); 7182} 7183function aj(e) { 7184 return new Date(e * ds); 7185} 7186var lj = new zn(rj, aj); 7187function cj(e) { 7188 return Math.floor(e.getTime() / Ys); 7189} 7190function uj(e) { 7191 return new Date(e * Ys); 7192} 7193var dj = new zn(cj, uj); 7194function hj(e) { 7195 return Math.floor(e.getTime() / fo); 7196} 7197function pj(e) { 7198 const t = /* @__PURE__ */ new Date(0); 7199 return t.setUTCDate(t.getUTCDate() + e), t.setUTCHours(0, 0, 0, 0), t; 7200} 7201var gj = new zn(hj, pj); 7202function fj(e) { 7203 return e.getUTCFullYear() * 12 + e.getUTCMonth(); 7204} 7205function mj(e) { 7206 const t = Math.floor(e / 12), i = e - t * 12; 7207 return new Date(Date.UTC(t, i, 1)); 7208} 7209var vj = new zn(fj, mj); 7210function yj(e) { 7211 return e.getUTCFullYear(); 7212} 7213function Cj(e) { 7214 const t = /* @__PURE__ */ new Date(); 7215 return t.setUTCFullYear(e), t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0), t; 7216} 7217var bj = new zn(yj, Cj), uP = jt( 7218 (e) => kt(e) && e > 0 || e instanceof wd, 7219 "a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'" 7220), $c = class extends it { 7221 constructor() { 7222 super(...arguments), this.minSpacing = NaN, this.maxSpacing = NaN; 7223 } 7224}; 7225S([ 7226 D(uP, { optional: !0 }) 7227], $c.prototype, "step", 2); 7228S([ 7229 D(lg, { optional: !0 }) 7230], $c.prototype, "values", 2); 7231S([ 7232 D(wk), 7233 Ll(NaN) 7234], $c.prototype, "minSpacing", 2); 7235S([ 7236 D(Sk), 7237 Ll(NaN) 7238], $c.prototype, "maxSpacing", 2); 7239var is = class extends it { 7240 constructor() { 7241 super(...arguments), this.enabled = !0, this.fontSize = 12, this.fontFamily = "Verdana, sans-serif", this.spacing = 5, this.minSpacing = NaN, this.color = "#575757", this.avoidCollisions = !0, this.mirrored = !1, this.parallel = !1; 7242 } 7243 /** 7244 * The side of the axis line to position the labels on. 7245 * -1 = left (default) 7246 * 1 = right 7247 */ 7248 getSideFlag() { 7249 return this.mirrored ? 1 : -1; 7250 } 7251}; 7252S([ 7253 D(je) 7254], is.prototype, "enabled", 2); 7255S([ 7256 D(Ca, { optional: !0 }) 7257], is.prototype, "fontStyle", 2); 7258S([ 7259 D(ba, { optional: !0 }) 7260], is.prototype, "fontWeight", 2); 7261S([ 7262 D(At.restrict({ min: 1 })) 7263], is.prototype, "fontSize", 2); 7264S([ 7265 D(Me) 7266], is.prototype, "fontFamily", 2); 7267S([ 7268 D(Te) 7269], is.prototype, "spacing", 2); 7270S([ 7271 D(_d), 7272 Ll(NaN) 7273], is.prototype, "minSpacing", 2); 7274S([ 7275 D(Ft, { optional: !0 }) 7276], is.prototype, "color", 2); 7277S([ 7278 D(At, { optional: !0 }) 7279], is.prototype, "rotation", 2); 7280S([ 7281 D(je) 7282], is.prototype, "avoidCollisions", 2); 7283S([ 7284 D(je) 7285], is.prototype, "mirrored", 2); 7286S([ 7287 D(je) 7288], is.prototype, "parallel", 2); 7289S([ 7290 D(tn, { optional: !0 }) 7291], is.prototype, "itemStyler", 2); 7292S([ 7293 D(tn, { optional: !0 }) 7294], is.prototype, "formatter", 2); 7295S([ 7296 D(Me, { optional: !0 }) 7297], is.prototype, "format", 2); 7298var Qv = class { 7299 constructor() { 7300 this.enabled = !0, this.width = 1, this.stroke = void 0; 7301 } 7302}; 7303S([ 7304 D(je) 7305], Qv.prototype, "enabled", 2); 7306S([ 7307 D(Te) 7308], Qv.prototype, "width", 2); 7309S([ 7310 D(Ft, { optional: !0 }) 7311], Qv.prototype, "stroke", 2); 7312var Bd = class extends it { 7313 constructor() { 7314 super(...arguments), this.enabled = !0, this.width = 1, this.size = 6; 7315 } 7316}; 7317S([ 7318 D(je) 7319], Bd.prototype, "enabled", 2); 7320S([ 7321 D(Te) 7322], Bd.prototype, "width", 2); 7323S([ 7324 D(Te) 7325], Bd.prototype, "size", 2); 7326S([ 7327 D(Ft, { optional: !0 }) 7328], Bd.prototype, "stroke", 2); 7329var Qo = class extends it { 7330 constructor() { 7331 super(...arguments), this.caption = new Qt(), this.enabled = !1, this.spacing = Qt.SMALL_PADD
7331ING, this.fontSize = 10, this.fontFamily = "sans-serif", this.wrapping = "always"; 7332 } 7333}; 7334S([ 7335 D(je) 7336], Qo.prototype, "enabled", 2); 7337S([ 7338 D(Me, { optional: !0 }) 7339], Qo.prototype, "text", 2); 7340S([ 7341 D(Te, { optional: !0 }) 7342], Qo.prototype, "spacing", 2); 7343S([ 7344 D(Ca, { optional: !0 }) 7345], Qo.prototype, "fontStyle", 2); 7346S([ 7347 D(ba, { optional: !0 }) 7348], Qo.prototype, "fontWeight", 2); 7349S([ 7350 D(Te) 7351], Qo.prototype, "fontSize", 2); 7352S([ 7353 D(Me) 7354], Qo.prototype, "fontFamily", 2); 7355S([ 7356 D(Ft, { optional: !0 }) 7357], Qo.prototype, "color", 2); 7358S([ 7359 D(Wv) 7360], Qo.prototype, "wrapping", 2); 7361S([ 7362 D(tn, { optional: !0 }) 7363], Qo.prototype, "formatter", 2); 7364function vw(e) { 7365 const [t, i] = Ds(e.range), s = Math.floor(t), n = Math.ceil(i); 7366 return { min: s, max: n, visible: s !== n }; 7367} 7368var yw = Math.PI * 2, wj = yw / 2; 7369function Sj(e, t) { 7370 return Math.abs(t - e) < wj ? t : e > t ? t + yw : t - yw; 7371} 7372function dP(e) { 7373 const t = (r, a) => { 7374 const [l = e.min, c = e.max] = Ds(a ?? []); 7375 return r < l || r > c; 7376 }; 7377 return { tick: { 7378 fromFn(r, a, l) { 7379 let c = r.y1 + r.translationY, u = r.opacity; 7380 return (l === "added" || t(r.datum.translationY, r.datum.range)) && (c = a.translationY, u = 0), { y: 0, translationY: c, opacity: u, phase: Zs[l] }; 7381 }, 7382 toFn(r, a, l) { 7383 const c = a.translationY; 7384 let u = 1; 7385 return l === "removed" && (u = 0), { 7386 y: 0, 7387 translationY: c, 7388 opacity: u, 7389 finish: { 7390 // Set explicit y after animation so it's pixel aligned 7391 y: c, 7392 translationY: 0 7393 } 7394 }; 7395 }, 7396 applyFn(r, a) { 7397 r.setProperties(a), r.visible = !t(r.y); 7398 } 7399 }, line: { 7400 fromFn(r, a) { 7401 return { 7402 ...r.previousDatum ?? a, 7403 phase: Zs.updated 7404 }; 7405 }, 7406 toFn(r, a) { 7407 return { ...a }; 7408 } 7409 }, label: { 7410 fromFn(r, a, l) { 7411 const c = r.previousDatum ?? a, u = c.x, d = c.y, p = c.rotationCenterX; 7412 let f = Math.round(r.translationY), m = c.rotation, y = r.opacity; 7413 return l === "removed" || t(c.y, c.range) ? m = a.rotation : (l === "added" || t(r.datum.y, r.datum.range)) && (f = Math.round(c.translationY), y = 0, m = a.rotation), { 7414 x: u, 7415 y: d, 7416 rotationCenterX: p, 7417 translationY: f, 7418 rotation: m, 7419 opacity: y, 7420 phase: Zs[l] 7421 }; 7422 }, 7423 toFn(r, a, l) { 7424 const c = a.x, u = a.y, d = a.rotationCenterX, p = Math.round(a.translationY); 7425 let f = 0, m = 1; 7426 return l === "added" ? f = a.rotation : l === "removed" ? (m = 0, f = a.rotation) : f = Sj(r.previousDatum?.rotation ?? a.rotation, a.rotation), { x: c, y: u, rotationCenterX: d, translationY: p, rotation: f, opacity: m, finish: { rotation: a.rotation } }; 7427 } 7428 }, group: { 7429 fromFn(r, a) { 7430 const { rotation: l, translationX: c, translationY: u } = r; 7431 return { 7432 rotation: l, 7433 translationX: c, 7434 translationY: u, 7435 phase: Zs.updated 7436 }; 7437 }, 7438 toFn(r, a) { 7439 const { rotation: l, translationX: c, translationY: u } = a; 7440 return { 7441 rotation: l, 7442 translationX: c, 7443 translationY: u 7444 }; 7445 } 7446 } }; 7447} 7448function hP() { 7449 return (e, t) => ({ 7450 rotation: t.rotation, 7451 rotationCenterX: t.rotationCenterX, 7452 rotationCenterY: t.rotationCenterY, 7453 translationX: t.translationX, 7454 translationY: t.translationY 7455 }); 7456} 7457function pP(e) { 7458 const { visible: t, min: i, max: s } = e; 7459 return (n, o) => { 7460 const r = o.translationY, a = t && r >= i && r <= s; 7461 return { 7462 y: r, 7463 translationY: 0, 7464 opacity: 1, 7465 visible: a 7466 }; 7467 }; 7468} 7469function gP() { 7470 return (e, t) => ({ 7471 x: t.x, 7472 y: t.y, 7473 translationY: t.translationY, 7474 rotation: t.rotation, 7475 rotationCenterX: t.rotationCenterX 7476 }); 7477} 7478function fP() { 7479 return (e, t) => ({ ...t }); 7480} 7481var xj = Object.freeze({ 7482 tickData: { ticks: [], rawTicks: [], labelCount: 0, fractionDigits: 0 }, 7483 combinedRotation: 0, 7484 textAlign: "center", 7485 textBaseline: "bottom", 7486 labelData: [] 7487}), Yb = class extends Uc(Hn) { 7488}, Sa = class mP { 7489 constructor(t, i) { 7490 this.moduleCtx = t, this.scale = i, this.id = So(this), this.nice = !0, this.reverse = !1, this.keys = [], this.interval = new $c(), this.dataDomain = { domain: [], clipped: !1 }, this.layoutConstraints = { 7491 stacked: !0, 7492 align: "start", 7493 width: 100, 7494 unit: "percent" 7495 }, this.boundSeries = [], this.includeInvisibleDomains = !1, this.interactionEnabled = !0, this.axisGroup = new xh({ name: `${this.id}-axis` }), this.tickLineGroup = this.axisGroup.appendChild(new Ye({ name: `${this.id}-Axis-tick-lines` })), this.lineNode = this.axisGroup.appendChild(new Yb({ name: `${this.id}-Axis-line` })), this.tickLabelGroup = this.axisGroup.appendChild(new Ye({ name: `${this.id}-Axis-tick-labels` })), this.labelGroup = new Ye({ 7496 name: `${this.id}-Labels`, 7497 zIndex: 8 7498 /* SERIES_ANNOTATION */ 7499 }), this.gridGroup = new xh({ 7500 name: `${this.id}-Axis-grid`, 7501 zIndex: 1 7502 /* AXIS_GRID */ 7503 }), this.gridLineGroup = this.gridGroup.appendChild(new Ye({ name: `${this.id}-gridLines` })), this.crossLineRangeGroup = new xh({ 7504 name: `${this.id}-CrossLines-Range`, 7505 zIndex: 3 7506 /* SERIES_CROSSLINE_RANGE */ 7507 }), this.crossLineLineGroup = new xh({ 7508 name: `${this.id}-CrossLines-Line`, 7509 zIndex: 7 7510 /* SERIES_CROSSLINE_LINE */ 7511 }), this.crossLineLabelGroup = new xh({ 7512 name: `${this.id}-CrossLines-Label`, 7513 zIndex: 12 7514 /* SERIES_LABEL */ 7515 }), this.tickLineGroupSelection = _i.select(this.tickLineGroup, Yb, !1), this.tickLabelGroupSelection = _i.select( 7516 this.tickLabelGroup, 7517 Sd, 7518 !1 7519 ), this.gridLineGroupSelection = _i.select(this.gridLineGroup, Yb, !1), this._crossLines = [], this.line = new Qv(), this.tick = new Bd(), this.gridLine = new qv(), this.label = this.createLabel(), this.tempText = new Sd(), this.tempCaption = new Qt(), this.defaultTickMinSpacing = mP.defaultTickMinSpacing, this.translation = { x: 0, y: 0 }, this.rotation = 0, this.layout = { 7520 label: { 7521 fractionDigits: 0, 7522 spacing: this.label.spacing, 7523 format: this.label.format 7524 } 7525 }, this.destroyFns = [], this.range = [0, 1], this.visibleRange = [0, 1], this.title = new Qo(), this.gridLength = 0, this.gridPadding = 0, this.seriesAreaPadding = 0, this.tickGenerationResult = void 0, this._domainCalculated = !1, this.moduleMap = new YS(), this.range = this.scale.range.slice(), this.crossLines.forEac
7525h((n) => this.initCrossLine(n)), this.axisGroup.appendChild(this.title.caption.node), this.animationManager = t.animationManager, this.animationState = new gg("empty", { 7526 empty: { 7527 update: { 7528 target: "ready", 7529 action: () => this.resetSelectionNodes() 7530 }, 7531 reset: "empty" 7532 }, 7533 ready: { 7534 update: (n) => this.animateReadyUpdate(n), 7535 resize: () => this.resetSelectionNodes(), 7536 reset: "empty" 7537 } 7538 }); 7539 let s; 7540 this.destroyFns.push( 7541 this.title.caption.registerInteraction(this.moduleCtx, "afterend"), 7542 t.layoutManager.addListener("layout:complete", (n) => { 7543 s != null && Sr(n.chart, s) != null && this.animationState.transition("resize"), s = { ...n.chart }; 7544 }) 7545 ); 7546 } 7547 get type() { 7548 return this.constructor.type ?? ""; 7549 } 7550 set crossLines(t) { 7551 const { CrossLineConstructor: i } = this.constructor; 7552 this._crossLines.forEach((s) => this.detachCrossLine(s)), this._crossLines = t.map((s) => { 7553 const n = new i(); 7554 return n.set(s), n; 7555 }), this._crossLines.forEach((s) => { 7556 this.attachCrossLine(s), this.initCrossLine(s); 7557 }); 7558 } 7559 get crossLines() { 7560 return this._crossLines; 7561 } 7562 resetAnimation(t) { 7563 t === "initial" && this.animationState.transition("reset"); 7564 } 7565 attachCrossLine(t) { 7566 this.crossLineRangeGroup.appendChild(t.rangeGroup), this.crossLineLineGroup.appendChild(t.lineGroup), this.crossLineLabelGroup.appendChild(t.labelGroup); 7567 } 7568 detachCrossLine(t) { 7569 this.crossLineRangeGroup.removeChild(t.rangeGroup), this.crossLineLineGroup.removeChild(t.lineGroup), this.crossLineLabelGroup.removeChild(t.labelGroup); 7570 } 7571 destroy() { 7572 this.moduleMap.destroy(), this.destroyFns.forEach((t) => t()); 7573 } 7574 updateRange() { 7575 const { range: t, visibleRange: i, scale: s } = this, n = (t[1] - t[0]) / (i[1] - i[0]), o = n * i[0], r = t[0] - o; 7576 s.setVisibleRange?.(i), s.range = [r, r + n], this.crossLines.forEach((a) => { 7577 a.clippedRange = [t[0], t[1]]; 7578 }); 7579 } 7580 setCrossLinesVisible(t) { 7581 this.crossLineRangeGroup.visible = t, this.crossLineLineGroup.visible = t, this.crossLineLabelGroup.visible = t; 7582 } 7583 attachAxis(t) { 7584 t.gridNode.appendChild(this.gridGroup), t.axisNode.appendChild(this.axisGroup), t.labelNode.appendChild(this.labelGroup), t.crossLineRangeNode.appendChild(this.crossLineRangeGroup), t.crossLineLineNode.appendChild(this.crossLineLineGroup), t.crossLineLabelNode.appendChild(this.crossLineLabelGroup); 7585 } 7586 detachAxis(t) { 7587 t.gridNode.removeChild(this.gridGroup), t.axisNode.removeChild(this.axisGroup), t.labelNode.removeChild(this.labelGroup), t.crossLineRangeNode.removeChild(this.crossLineRangeGroup), t.crossLineLineNode.removeChild(this.crossLineLineGroup), t.crossLineLabelNode.removeChild(this.crossLineLabelGroup); 7588 } 7589 attachLabel(t) { 7590 this.labelGroup.append(t); 7591 } 7592 /** 7593 * Checks if a point or an object is in range. 7594 * @param value A point (or object's starting point). 7595 * @param tolerance Expands the range on both ends by this amount. 7596 */ 7597 inRange(t, i = 0) { 7598 const [s, n] = Ds(this.range); 7599 return t >= s - i && t <= n + i; 7600 } 7601 onFormatChange(t, i, s, n) { 7602 const { scale: o } = this, r = o instanceof ZS; 7603 if (n && o?.tickFormat) 7604 try { 7605 const a = o.tickFormat({ ticks: t, specifier: n }); 7606 this.labelFormatter = a, this.datumFormatter = a; 7607 return; 7608 } catch { 7609 Ee.warnOnce(`the axis label format string ${n}
7609 is invalid. No formatting will be applied`); 7610 } 7611 this.labelFormatter = r ? String : (a) => Tp(a, i), this.datumFormatter = r ? String : (a) => Tp(a, i + 1); 7612 } 7613 onGridLengthChange(t, i) { 7614 i ^ t && this.onGridVisibilityChange(), this.crossLines.forEach((s) => this.initCrossLine(s)); 7615 } 7616 onGridVisibilityChange() { 7617 this.gridLineGroupSelection.clear(); 7618 } 7619 createLabel() { 7620 return new is(); 7621 } 7622 /** 7623 * Creates/removes/updates the scene graph nodes that constitute the axis. 7624 */ 7625 update(t = !0) { 7626 if (!this.tickGenerationResult) 7627 return; 7628 this.updatePosition(); 7629 const i = this.getAxisLineCoordinates(), { tickData: s, combinedRotation: n, textBaseline: o, textAlign: r } = this.tickGenerationResult, a = this.tickLabelGroupSelection.nodes().slice(); 7630 if (this.updateSelections(i, s.ticks, { 7631 combinedRotation: n, 7632 textAlign: r, 7633 textBaseline: o, 7634 range: this.scale.range 7635 }), !t || this.animationManager.isSkipped()) 7636 this.resetSelectionNodes(); 7637 else { 7638 const d = H7( 7639 a.map((p) => p.datum.tickId), 7640 s.ticks.map((p) => p.tickId) 7641 ); 7642 this.animationState.transition("update", d); 7643 } 7644 this.tickLineGroup.visible = this.tick.enabled, this.gridLineGroup.visible = this.gridLine.enabled, this.tickLabelGroup.visible = this.label.enabled; 7645 const { enabled: l, stroke: c, width: u } = this.line; 7646 this.lineNode.setProperties({ stroke: c, strokeWidth: l ? u : 0 }), this.updateLabels(), this.updateGridLines(), this.updateTickLines(), this.updateTitle(!s.ticks.length), this.updateCrossLines(); 7647 } 7648 getAxisLineCoordinates() { 7649 const [t, i] = Ds(this.range); 7650 return { x: 0, y1: t, y2: i }; 7651 } 7652 getTickLineCoordinates(t) { 7653 const s = this.label.getSideFlag() * this.getTickSize(), n = Math.min(0, s), o = n + Math.abs(s), r = t.translationY; 7654 return { x1: n, x2: o, y: r }; 7655 } 7656 getLabelStyles(t, i) { 7657 const { label: s } = this, n = { 7658 color: s.color, 7659 spacing: s.spacing, 7660 fontFamily: s.fontFamily, 7661 fontSize: s.fontSize, 7662 fontStyle: s.fontStyle, 7663 fontWeight: s.fontWeight 7664 }; 7665 let o; 7666 s.itemStyler && (o = this.moduleCtx.callbackCache.call(s.itemStyler, { 7667 ...t, 7668 ...n 7669 })); 7670 const { 7671 color: r, 7672 fontFamily: a, 7673 fontSize: l, 7674 fontStyle: c, 7675 fontWeight: u, 7676 spacing: d 7677 } = ht(o, i, n); 7678 return { fill: r, fontFamily: a, fontSize: l, fontStyle: c, fontWeight: u, spacing: d }; 7679 } 7680 getTickLabelProps(t, i) { 7681 const { label: s } = this, { combinedRotation: n, textBaseline: o, textAlign: r, range: a } = i, l = t.tickLabel, u = s.getSideFlag() * (this.getTickSize() + s.spacing + this.seriesAreaPadding), d = l !== "" && l != null; 7682 return { 7683 ...this.getLabelStyles({ value: t.tickLabel }), 7684 tickId: t.tickId, 7685 rotation: n, 7686 rotationCenterX: u, 7687 translationY: t.translationY, 7688 text: l, 7689 textAlign: r, 7690 textBaseline: o, 7691 visible: d, 7692 x: u, 7693 y: 0, 7694 range: a 7695 }; 7696 } 7697 getTickSize() { 7698 return this.tick.enabled ? this.tick.size : 0; 7699 } 7700 setTitleProps(t, i) { 7701 const { title: s } = this; 7702 if (!s.enabled) { 7703 t.enabled = !1, t.node.visible = !1; 7704 return; 7705 } 7706 t.color = s.color, t.fontFamily = s.fontFamily, t.fontSize = s.fontSize, t.fontStyle = s.fontStyle, t.fontWeight = s.fontWeight, t.enabled = s.enabled, t.wrapping = s.wrapping; 7707 const n = t.node, o = (s.spacing ?? 0) + i.spacing, r = this.label.getSideFlag(), a = zt(this.rotation), l = r === -1 && a > Math.PI && a < Math.PI * 2 ? -1 : 1, c = l * r * Math.PI / 2, u = l === 1 ? "bottom" : "top", { range: d } = this, p = Math.floor(l * r * (d[0] + d[1]) / 2), f = Math.floor(r === -1 ? l * -o : -o), { callbackCache: m } = this.moduleCtx, { formatter: y = (C) => C.defaultValue } = s, b = m.call(y, this.getTitleFormatterParams()); 7708 t.text = b, n.setProperties({ visible: !0, text: b, textBaseline: u, x: p, y: f, rotation: c }); 7709 } 7710 processData() { 7711 this._domainCalculated = !1; 7712 } 7713 calculateLayout(t, i) { 7714 const { rotation: s, parallelFlipRotation: n, regularFlipRotation: o } = this.calculateRotations(), r = this.label.getSideFlag(); 7715 this.updateScale({ domain: t, skipDomainCalculation: this._domainCalculated }), this._domainCalculated = t == null; 7716 const a = this.processTicks(i, n, o); 7717 this.tickGenerationResult = a.tickGenerationResult; 7718 const l = _e.merge(a.boxes), c = this.getTransformBox(l), u = this.isAnySeriesActive();
7719 return this.crossLines.forEach((d) => { 7720 var p; 7721 d.sideFlag = -r, d.direction = s === -Math.PI / 2 ? "x" : "y", d instanceof wn && ((p = d.label).parallel ?? (p.parallel = this.label.parallel)), d.parallelFlipRotation = n, d.regularFlipRotation = o, d.calculateLayout?.(u, this.reverse); 7722 }), { 7723 primaryTickCount: a.tickGenerationResult?.primaryTickCount ?? i, 7724 bbox: c 7725 }; 7726 } 7727 processTicks(t, i, s) { 7728 const n = this.label.getSideFlag(), o = n * (this.getTickSize() + this.label.spacing + this.seriesAreaPadding), a = this.label.enabled || this.tick.enabled || this.gridLine.enabled ? this.generateTicks({ 7729 primaryTickCount: t, 7730 parallelFlipRotation: i, 7731 regularFlipRotation: s, 7732 labelX: o, 7733 sideFlag: n 7734 }) : xj, { tickData: l, combinedRotation: c, textBaseline: u, textAlign: d } = a; 7735 this.updateLayoutState(l.fractionDigits); 7736 const p = [], { x: f, y1: m, y2: y } = this.getAxisLineCoordinates(), b = new _e( 7737 f + Math.min(n * this.seriesAreaPadding, 0), 7738 m, 7739 this.seriesAreaPadding, 7740 y - m 7741 ); 7742 p.push(b), this.tick.enabled && l.ticks.forEach((w) => { 7743 const { x1: M, x2: A, y: I } = this.getTickLineCoordinates(w), L = new _e(M, I, A - M, 0); 7744 p.push(L); 7745 }); 7746 const { tempText: C } = this; 7747 if (this.label.enabled && l.ticks.forEach((w) => { 7748 const M = this.getTickLabelProps(w, { 7749 combinedRotation: c, 7750 textAlign: d, 7751 textBaseline: u, 7752 range: this.scale.range 7753 }); 7754 if (!M.visible) 7755 return; 7756 C.setProperties({ 7757 ...M, 7758 translationY: Math.round(w.translationY) 7759 }); 7760 const A = C.getBBox(); 7761 A && p.push(A); 7762 }), this.title?.enabled) { 7763 const w = _e.merge(p).width; 7764 this.setTitleProps(this.tempCaption, { spacing: w }); 7765 const M = this.tempCaption.node.getBBox(); 7766 M && p.push(M); 7767 } 7768 return { tickGenerationResult: a, boxes: p }; 7769 } 7770 updateLayoutState(t) { 7771 this.layout.label = { 7772 fractionDigits: t, 7773 spacing: this.label.spacing, 7774 format: this.label.format 7775 }; 7776 } 7777 getTransformBox(t) { 7778 const i = new Ho(), { rotation: s, translationX: n, translationY: o } = this.getAxisTransform(); 7779 return Ho.updateTransformMatrix(i, 1, 1, s, n, o), i.transformBBox(t); 7780 } 7781 setDomain(t) { 7782 this.dataDomain = this.normaliseDataDomain(t), this.reverse && this.dataDomain.domain.reverse(), this.scale.domain = this.dataDomain.domain; 7783 } 7784 updateScale(t) { 7785 const i = t?.domain; 7786 (t?.skipDomainCalculation ?? !1) || (i ? this.setDomain(i) : this.calculateDomain()), this.updateRange(), this.scale.interval = this.interval.step, ti.is(this.scale) && (this.scale.nice = this.nice, this.scale.update()); 7787 } 7788 calculateRotations() { 7789 const t = Es(this.rotation), i = zt(t), s = zt(t - Math.PI / 2); 7790 return { rotation: t, parallelFlipRotation: i, regularFlipRotation: s }; 7791 } 7792 generateTicks({ 7793 primaryTickCount: t, 7794 parallelFlipRotation: i, 7795 regularFlipRotation: s, 7796 labelX: n, 7797 sideFlag: o 7798 }) { 7799 const { 7800 scale: r, 7801 interval: { minSpacing: a, maxSpacing: l }, 7802 label: { parallel: c, rotation: u, fontFamily: d, fontSize: p, fontStyle: f, fontWeight: m } 7803 } = this, y = t !== void 0, { defaultRotation: b, configuredRotation: C, parallelFlipFlag: w, regularFlipFlag: M } = Om({ 7804 rotation: u, 7805 parallel: c, 7806 regularFlipRotation: s, 7807 parallelFlipRotation: i 7808 }), A = C + b, I = new Ho(), { maxTickCount: L } = this.estimateTickCount(a, l), B = !(ti.is(r) || Oo.is(r)) || isNaN(L) ? 10 : L; 7809 let N = $b(c, C, 0, o, M); 7810 const W = Z7(c, C, o, w), se = vi.toFontString({ fontFamily: d, fontSize: p, fontStyle: f, fontWeight: m }), ue = wa.getMeasurer({ font: se }), Ce = { 7811 fontFamily: d, 7812 fontSize: p, 7813 fontStyle: f, 7814 fontWeight: m, 7815 textBaseline: W, 7816 textAlign: N 7817 }; 7818 let te = { 7819 ticks: [], 7820 rawTicks: [], 7821 fractionDigits: 0, 7822 labelCount: 0 7823 }, q = 0, $ = 0, T = !0, E = [], P = !1; 7824 for (; T && q <= B && !P; ) { 7825 $ = 0, N = $b(c, C, 0, o, M); 7826 const _ = this.getTickStrategies({ secondaryAxis: y, index: q }); 7827 for (const K of _) { 7828 ({ tickData: te, index: q, autoRotation: $, terminate: P } = K({ 7829 index: q, 7830 tickData: te, 7831 textProps: Ce, 7832 labelOverlap: T, 7833 terminate: P, 7834 primaryTickCount: t 7835 })); 7836 const ce = C !== 0 || $ !== 0, ae = A + $, be = K7(this.label.minSpacing, ce); 7837 Ho.updateTransformMatrix(I, 1, 1, ae, 0, 0), N = $b(c, C, $, o, M), E = q7(te.ticks, n, I, ue), T = this.label.avoidCollisions ? z7(E, be) : !1; 7838 } 7839 } 7840 const G = b + C + $; 7841 return !y && te.rawTicks.length > 0 && (t = te.rawTicks.length), { tickData: te, primaryTickCount: t, combinedRotation: G, textBaseline: W, textAlign: N, labelData: E }; 7842 } 7843 getTickStrategies({ 7844 index: t, 7845 secondaryAxis: i 7846 }) { 7847 const { scale: s, label: n } = this, { minSpacing: o } = this.interval, r = ti.is(s) || Oo.is(s), a = n.enabled && n.avoidCollisions, l = !r && t !== 0 && a, c = n.autoRotate === !0 && n.rotation === void 0, u = []; 7848 let d; 7849 this.interval.values ? d = 3 : i ? d = 1 : l ? d = 2 : d = 0; 7850 const p = ({ index: f, tickData: m, primaryTickCount: y, terminate: b }) => this.createTickData(d, f, m, b, y); 7851 if (u.push(p), !r && !isNaN(o)) { 7852 const f = ({ index: m, tickData: y, primaryTickCount: b, terminate: C }) => this.createTickData(2, m, y, C, b); 7853 u.push(f); 7854 } 7855 if (a && c) { 7856 const f = ({ index: m, tickData: y, labelOverlap: b, terminate: C }) => ({ 7857 index: m, 7858 tickData: y, 7859 autoRotation: b ? zt(Es(this.label.autoRotateAngle ?? 0)) : 0, 7860 terminate: C 7861 }); 7862 u.push(f); 7863 } 7864 return u; 7865 } 7866 createTickData(t, i, s, n, o) { 7867 const { scale: r }
7867 = this, { step: a, values: l, minSpacing: c, maxSpacing: u } = this.interval, { maxTickCount: d, minTickCount: p, tickCount: f } = this.estimateTickCount(c, u), m = ti.is(r) || Oo.is(r), y = !m || isNaN(d) ? 10 : d, b = (w) => m ? Math.max(f - w, p) : d, C = a == null && l == null && b(i) > p && (m || t === 2); 7868 for (; i <= y; ) { 7869 const w = s.rawTicks; 7870 if (s = this.getTicks({ 7871 tickGenerationType: t, 7872 previousTicks: w, 7873 minTickCount: p, 7874 maxTickCount: d, 7875 primaryTickCount: o, 7876 tickCount: b(i) 7877 }), i++, !C || !ul(s.rawTicks, w)) 7878 break; 7879 } 7880 return n || (n = a != null || l != null), { tickData: s, index: i, autoRotation: 0, terminate: n }; 7881 } 7882 getTicks({ 7883 tickGenerationType: t, 7884 previousTicks: i, 7885 tickCount: s, 7886 minTickCount: n, 7887 maxTickCount: o, 7888 primaryTickCount: r 7889 }) { 7890 const { range: a, scale: l, visibleRange: c } = this, u = ox(); 7891 let d; 7892 switch (t) { 7893 case 3: 7894 if (d = this.interval.values, ti.is(l)) { 7895 const [M, A] = Ds(l.getDomain().map(Number)); 7896 d = d.filter((I) => I >= M && I <= A).sort((I, L) => I - L); 7897 } 7898 break; 7899 case 1: 7900 ti.is(l) ? d = this.updateSecondaryAxisTicks(r) : d = this.createTicks(s, n, o); 7901 break; 7902 case 2: 7903 d = this.filterTicks(i, s); 7904 break; 7905 default: 7906 d = this.createTicks(s, n, o); 7907 break; 7908 } 7909 const p = d.reduce( 7910 (M, A) => Math.max(M, typeof A == "number" ? Fv(A) : 0), 7911 0 7912 ), f = (l.bandwidth ?? 0) / 2, m = []; 7913 let y = 0; 7914 const b = Math.max(0, Math.floor(c[0] * d.length)), C = Math.min(d.length, Math.ceil(c[1] * d.length)), w = d.slice(b, C); 7915 this.onFormatChange(w, p, d, this.label.format); 7916 for (let M = 0; M < w.length; M++) { 7917 const A = w[M], I = l.convert(A) + f; 7918 if (a.length > 0 && !this.inRange(I, 1e-3)) 7919 continue; 7920 const L = this.formatTick(A, b + M, p); 7921 m.push({ tick: A, tickId: u(L), tickLabel: L, translationY: Math.floor(I) }), !(L === "" || L == null) && y++; 7922 } 7923 return { rawTicks: d, fractionDigits: p, ticks: m, labelCount: y }; 7924 } 7925 filterTicks(t, i) { 7926 const { minSpacing: s, maxSpacing: n } = this.interval, r = !isNaN(s) || !isNaN(n) ? Math.ceil(t.length / i) : 2; 7927 return t.filter((a, l) => l % r === 0); 7928 } 7929 createTicks(t, i, s) { 7930 const { scale: n } = this; 7931 return t && (ti.is(n) || Oo.is(n)) && (n.tickCount = t, n.minTickCount = i ?? 0, n.maxTickCount = s ?? 1 / 0), n.ticks?.() ?? []; 7932 } 7933 estimateTickCount(t, i) { 7934 return kk( 7935 this.calculateRangeWithBleed(), 7936 t, 7937 i, 7938 ti.defaultTickCount, 7939 this.defaultTickMinSpacing 7940 ); 7941 } 7942 updateCrossLines() { 7943 const t = this.isAnySeriesActive(); 7944 this.crossLines.forEach((i) => { 7945 i.update(t); 7946 }); 7947 } 7948 updateTickLines() { 7949 const { tick: t, label: i } = this, s = i.getSideFlag(); 7950 this.tickLineGroupSelection.each((n, o) => { 7951 n.strokeWidth = o.tickWidth ?? t.width, n.stroke = o.tickStroke ?? t.stroke, n.x1 = s * (o.tickSize ?? this.getTickSize()), n.x2 = 0; 7952 }); 7953 } 7954 calculateAvailableRange() { 7955 return wp(this.range); 7956 } 7957 /** 7958 * Calculates the available range with an additional "bleed" beyond the canvas that encompasses the full axis when 7959 * the visible range is only a portion of the axis. 7960 */ 7961 calculateRangeWithBleed() { 7962 return RS(this.calculateAvailableRange() / wp(this.visibleRange), 2); 7963 } 7964 calculateDomain() { 7965 const { includeInvisibleDomains: t, boundSeries: i, direction: s } = this, n = t ? i : i.filter((r) => r.isEnabled()), o = n.length === 1 ? n[0].getDomain(s) : n.flatMap((r) => r.getDomain(s)); 7966 this.setDomain(o); 7967 } 7968 getAxisTransform() { 7969 return { 7970 rotation: Es(this.rotation), 7971 translationX: Math.floor(this.translation.x), 7972 translationY: Math.floor(this.translation.y) 7973 }; 7974 } 7975 updatePosition() { 7976 const { crossLineRangeGroup: t, crossLineLineGroup: i, crossLineLabelGroup: s, axisGroup: n, gridGroup: o, translation: r } = this, { rotation: a } = this.calculateRotations(), l = Math.floor(r.x), c = Math.floor(r.y); 7977 t.setProperties({ rotation: a, translationX: l, translationY: c }), i.setProperties({ rotation: a, translationX: l, translationY: c }), s.setProperties({ rotation: a, translationX: l, translationY: c }), o.setProperties({ rotation: a, translationX: l, translationY: c }), n.datum = this.getAxisTransform(); 7978 } 7979 updateSecondaryAxisTicks(t) { 7980 throw new Error("AG Charts - unexpected call to updateSecondaryAxisTicks() - check axes configuration."); 7981 } 7982 updateSelections(t, i, s) { 7983 const n = (r) => r.tickId, o = i.map((r) => this.getTickLabelProps(r, s)); 7984 this.lineNode.datum = t, this.gridLineGroupSelection.update(this.gridLength ? i : [], void 0, n), this.tickLineGroupSelection.update(i, void 0, n), this.tickLabelGroupSelection.update(o, void 0, n); 7985 } 7986 updateGridLines() { 7987 const t = this.label.getSideFlag(), { 7988 gridLine: { style: i, width: s }, 7989 gridPadding: n, 7990 gridLength: o 7991 } = this; 7992 o === 0 || i.length === 0 || this.gridLineGroupSelection.each((r, a, l) => { 7993 const { stroke: c, lineDash: u } = i[l % i.length]; 7994 r.setProperties({ 7995 x1: n, 7996 x2: -t * o + n, 7997 stroke: c, 7998 strokeWidth: s, 7999 lineDash: u 8000 }); 8001 }); 8002 } 8003 updateLabels() { 8004 this.label.enabled && this.tickLabelGroupSelection.each((t, i) => { 8005 t.setProperties(i, [ 8006 "fill", 8007 "fontFamily", 8008 "fontSize", 8009 "fontStyle", 8010 "fontWeight", 8011 "text", 8012 "textAlign", 8013 "textBaseline" 8014 ]); 8015 }); 8016 } 8017 updateTitle(t, i) { 8018 const { title: s, lineNode: n, tickLineGroup: o, tickLabelGroup: r } = this; 8019 s.enabled && !t && i == null && (i = Ye.computeChildrenBBox([o, r, n]).width + (this.tickLabelGroup.visible ? 0 : this.seriesAreaPadding)), i ?? (i = 0), this.setTitleProps(s.caption, { spacing: i }); 8020 } 8021 // For formatting (nice rounded) tick values. 8022 formatTick(t, i, s) { 8023 const { 8024 labelFormatter: n, 8025 label: { formatter: o },
8026 moduleCtx: { callbackCache: r } 8027 } = this; 8028 let a; 8029 return o ? a = r.call(o, { value: t, index: i, fractionDigits: s }) : n && (a = r.call(n, t)), String(a ?? t); 8030 } 8031 // For formatting arbitrary values between the ticks. 8032 formatDatum(t) { 8033 const { 8034 label: { formatter: i }, 8035 moduleCtx: { callbackCache: s }, 8036 datumFormatter: n = this.labelFormatter 8037 } = this; 8038 let o; 8039 return i ? o = s.call(i, { value: t, index: NaN }) : n ? o = s.call(n, t) : hi(t) && (o = t.filter(Boolean).join(" - ")), String(o ?? t); 8040 } 8041 getScaleValueFormatter(t) { 8042 if (t && this.scale.tickFormat) 8043 try { 8044 return this.scale.tickFormat({ specifier: t }); 8045 } catch { 8046 Ee.warnOnce(`the format string ${t} is invalid, ignoring.`); 8047 } 8048 return (i) => this.formatDatum(i); 8049 } 8050 getBBox() { 8051 return this.axisGroup.getBBox(); 8052 } 8053 initCrossLine(t) { 8054 t.scale = this.scale, t.gridLength = this.gridLength; 8055 } 8056 isAnySeriesActive() { 8057 return this.boundSeries.some((t) => this.includeInvisibleDomains || t.isEnabled()); 8058 } 8059 clipTickLines(t, i, s, n) { 8060 this.tickLineGroup.setClipRect(new _e(t, i, s, n)); 8061 } 8062 clipGrid(t, i, s, n) { 8063 this.gridGroup.setClipRect(new _e(t, i, s, n)); 8064 } 8065 getTitleFormatterParams() { 8066 const { direction: t } = this, i = []; 8067 for (const s of this.boundSeries) { 8068 const n = s.getKeys(t), o = s.getNames(t); 8069 for (let r = 0; r < n.length; r++) 8070 i.push({ key: n[r], name: o[r] }); 8071 } 8072 return { direction: t, boundSeries: i, defaultValue: this.title?.text }; 8073 } 8074 normaliseDataDomain(t) { 8075 return { domain: [...t], clipped: !1 }; 8076 } 8077 getLayoutState() { 8078 return { 8079 id: this.id, 8080 rect: this.getBBox(), 8081 gridPadding: this.gridPadding, 8082 seriesAreaPadding: this.seriesAreaPadding, 8083 tickSize: this.getTickSize(), 8084 direction: this.direction, 8085 domain: this.dataDomain.domain, 8086 scale: this.scale, 8087 ...this.layout 8088 }; 8089 } 8090 getModuleMap() { 8091 return this.moduleMap; 8092 } 8093 createModuleContext() { 8094 return this.axisContext ?? (this.axisContext = this.createAxisContext()), { ...this.moduleCtx, parent: this.axisContext }; 8095 } 8096 createAxisContext() { 8097 const { scale: t } = this; 8098 return { 8099 axisId: this.id, 8100 scale: this.scale, 8101 direction: this.direction, 8102 continuous: ti.is(t) || Oo.is(t), 8103 getCanvasBounds: () => Ii.toCanvas(this.axisGroup), 8104 seriesKeyProperties: () => this.boundSeries.reduce((i, s) => (s.getKeyProperties(this.direction).forEach((o) => { 8105 i.indexOf(o) < 0 && i.push(o); 8106 }), i), []), 8107 scaleValueFormatter: (i) => this.getScaleValueFormatter(i), 8108 scaleInvert: Oo.is(t) ? (i) => t.invertNearest?.(i) : (i) => t.invert?.(i), 8109 scaleInvertNearest: (i) => t.invertNearest?.(i), 8110 attachLabel: (i) => this.attachLabel(i), 8111 inRange: (i, s) => this.inRange(i, s) 8112 }; 8113 } 8114 animateReadyUpdate(t) { 8115 const { animationManager: i } = this.moduleCtx, s = vw(this), n = dP(s); 8116 Mi(this.id, "axis-group", i, [this.axisGroup], n.group), Mi(this.id, "line", i, [this.lineNode], n.line), Mi( 8117 this.id, 8118 "line-paths", 8119 i, 8120 [this.gridLineGroupSelection, this.tickLineGroupSelection], 8121 n.tick, 8122 (o, r) => r.tickId, 8123 t 8124 ), Mi( 8125 this.id, 8126 "tick-labels", 8127 i, 8128 [this.tickLabelGroupSelection], 8129 n.label, 8130 (o, r) => r.tickId, 8131 t 8132 ); 8133 } 8134 resetSelectionNodes() { 8135 const t = vw(this); 8136 zi([this.axisGroup], hP()), zi([this.gridLineGroupSelection, this.tickLineGroupSelection], pP(t)), zi([this.tickLabelGroupSelection], gP()), zi([this.lineNode], fP()); 8137 } 8138 isReversed() { 8139 return this.reverse; 8140 } 8141}; 8142Sa.defaultTickMinSpacing = 50; 8143Sa.CrossLineConstructor = wn; 8144S([ 8145 D(je) 8146], Sa.prototype, "nice", 2); 8147S([ 8148 D(je) 8149], Sa.prototype, "reverse", 2); 8150S([ 8151 D(yk) 8152], Sa.prototype, "keys", 2); 8153S([ 8154 D(Be) 8155], Sa.prototype, "interval", 2); 8156S([ 8157 D(Be) 8158], Sa.prototype, "title", 2); 8159S([ 8160 jc((e, t, i) => e.onGridLengthChange(t, i)) 8161], Sa.prototype, "gridLength", 2); 8162var lx = Sa, cx = class extends is { 8163 constructor() { 8164 super(...arguments), this.autoRotateAngle = 335; 8165 } 8166}; 8167S([ 8168 D(je, { optional: !0 }) 8169], cx.prototype, "autoRotate", 2); 8170S([ 8171 D(At) 8172], cx.prototype, "autoRotateAngle", 2); 8173var ux = class vP extends lx { 8174 static is(t) { 8175 return t instanceof vP; 8176 } 8177 get direction() { 8178 return this.position === "top" || this.position === "bottom" ? "x" : "y"; 8179 } 8180 updateDirection() { 8181 switch (this.position) { 8182 case "top": 8183 this.rotation = -90, this.label.mirrored = !0, this.label.parallel = !0; 8184 break; 8185 case "right": 8186 this.rotation = 0, this.label.mirrored = !0, this.label.parallel = !1; 8187 break; 8188 case "bottom": 8189 this.rotation = -90, this.label.mirrored = !1, this.label.parallel = !0; 8190 break;
8191 case "left": 8192 this.rotation = 0, this.label.mirrored = !1, this.label.parallel = !1; 8193 break; 8194 } 8195 this.axisContext && (this.axisContext.position = this.position, this.axisContext.direction = this.direction); 8196 } 8197 update(t) { 8198 this.updateDirection(), super.update(t); 8199 } 8200 calculateLayout(t, i) { 8201 return this.updateDirection(), super.calculateLayout(t, i); 8202 } 8203 createAxisContext() { 8204 return { ...super.createAxisContext(), position: this.position }; 8205 } 8206 createLabel() { 8207 return new cx(); 8208 } 8209}; 8210S([ 8211 D(Te, { optional: !0 }) 8212], ux.prototype, "thickness", 2); 8213S([ 8214 D(WS) 8215], ux.prototype, "position", 2); 8216var Pc = ux, Gd = class yP extends Pc { 8217 constructor(t, i = new Tl()) { 8218 super(t, i), this.groupPaddingInner = 0.1, this.categoryAnimatable = !0, this.includeInvisibleDomains = !0; 8219 } 8220 static is(t) { 8221 return t instanceof yP; 8222 } 8223 domainOrderedToNormalizedDomain(t, i) { 8224 let s = -1; 8225 for (const n of t) { 8226 const o = i.indexOf(n); 8227 if (o === -1) 8228 s = 1 / 0; 8229 else { 8230 if (o <= s) 8231 return !1; 8232 s = o; 8233 } 8234 } 8235 return !0; 8236 } 8237 calculateDomain() { 8238 let t; 8239 const i = /* @__PURE__ */ new Set(); 8240 let s = !0; 8241 for (const n of this.boundSeries) { 8242 if (!this.includeInvisibleDomains && !n.isEnabled()) 8243 continue; 8244 const o = n.getDomain(this.direction); 8245 i.has(o) || (i.add(o), t == null ? t = this.normaliseDataDomain(o).domain : (s && (s = this.domainOrderedToNormalizedDomain(o, t)), t = this.normaliseDataDomain([...t, ...o]).domain)); 8246 } 8247 t ?? (t = []), this.setDomain(t), this.categoryAnimatable = s; 8248 } 8249 update() { 8250 super.update(), this.categoryAnimatable || this.moduleCtx.animationManager.skip(); 8251 } 8252 normaliseDataDomain(t) { 8253 const i = [], s = /* @__PURE__ */ new Set(); 8254 for (const n of t) { 8255 const o = n instanceof Date ? n.getTime() : n; 8256 s.has(o) || (s.add(o), i.push(n)); 8257 } 8258 return { domain: i, clipped: !1 }; 8259 } 8260 updateScale(t) { 8261 let { paddingInner: i, paddingOuter: s } = this; 8262 if (!kt(i) || !kt(s)) { 8263 const n = this.reduceBandScalePadding(); 8264 i ?? (i = n.inner), s ?? (s = n.outer); 8265 } 8266 this.scale.paddingInner = i ?? 0, this.scale.paddingOuter = s ?? 0, super.updateScale(t); 8267 } 8268 reduceBandScalePadding() { 8269 return this.boundSeries.reduce( 8270 (t, i) => { 8271 const s = i.getBandScalePadding?.(); 8272 return s && (t.inner > s.inner && (t.inner = s.inner), t.outer < s.outer && (t.outer = s.outer)), t; 8273 }, 8274 { inner: 1 / 0, outer: -1 / 0 } 8275 ); 8276 } 8277}; 8278Gd.className = "CategoryAxis"; 8279Gd.type = "category"; 8280S([ 8281 D(Pt) 8282], Gd.prototype, "groupPaddingInner", 2); 8283S([ 8284 D(Pt, { optional: !0 }) 8285], Gd.prototype, "paddingInner", 2); 8286S([ 8287 D(Pt, { optional: !0 }) 8288], Gd.prototype, "paddingOuter", 2); 8289var zd = Gd, Xv = class { 8290 constructor() { 8291 this.destroyFns = []; 8292 } 8293 destroy() { 8294 for (const e of this.destroyFns) 8295 e(); 8296 } 8297}, CP = class { 8298 constructor() { 8299 this.modules = [], this.dependencies = /* @__PURE__ */ new Map(), this.modulesByOptionKey = /* @__PURE__ */ new Map(); 8300 } 8301 register(...t) { 8302 for (const i of t) { 8303 this.registerDependencies(i); 8304 const s = this.modules.find( 8305 (n) => i.type === n.type && ("optionsKey" in i && "optionsKey" in n ? i.optionsKey === n.optionsKey : !0) && i.identifier === n.identifier 8306 ); 8307 if (s) { 8308 if (i.packageType === "enterprise" && s.packageType === "community") { 8309 const n = this.modules.indexOf(s); 8310 this.modules.splice(n, 1, i), "optionsKey" in i && this.modulesByOptionKey.set(i.optionsKey, i); 8311 } 8312 } else 8313 this.modules.push(i), "optionsKey" in i && this.modulesByOptionKey.set(i.optionsKey, i); 8314 } 8315 } 8316 hasEnterpriseModules() { 8317 return this.modules.some((t) => t.packageType === "enterprise"); 8318 } 8319 *byType(...t) { 8320 const i = /* @__PURE__ */ new Set(), s = this.modules.filter((r) => t.includes(r.type)), n = (r) => { 8321 const a = this.dependencies.get(r); 8322 return a?.flatMap(n).concat(a) ?? []; 8323 }, o = []; 8324 for (const r of s) { 8325 const a = "optionsKey" in r ? r.optionsKey : r.contextKey; 8326 if (!i.has(a)) { 8327 for (const l of n(a)) { 8328 if (i.has(l)) 8329 continue; 8330 const c = this.modulesByOptionKey.get(l); 8331 if (!c) { 8332 o.push(l); 8333 continue; 8334 } 8335 t.includes(c.type) && (yield c, i.add(l)); 8336 } 8337 yield r, i.add(a); 8338 } 8339 } 8340 if (o.length > 0) 8341 throw new Error(`Could not resolve module dependencies: ${o}`); 8342 } 8343 registerDependencies(t) {
8344 if (t.dependencies == null || t.dependencies.length === 0) 8345 return; 8346 const i = "optionsKey" in t ? t.optionsKey : t.contextKey; 8347 this.dependencies.set(i, t.dependencies); 8348 } 8349}, fr = new CP(), EI = class { 8350 constructor() { 8351 this.queue = []; 8352 } 8353 await(e = 50) { 8354 return new Promise((t) => { 8355 const i = () => { 8356 clearTimeout(n), t(!0); 8357 }, n = setTimeout(() => { 8358 const o = this.queue.indexOf(i); 8359 o < 0 || (this.queue.splice(o, 1), t(!1)); 8360 }, e); 8361 this.queue.push(i); 8362 }); 8363 } 8364 notify() { 8365 this.queue.splice(0).forEach((e) => e()); 8366 } 8367}; 8368function Mj() { 8369 return new Promise((e) => { 8370 setTimeout(e, 0); 8371 }); 8372} 8373var Aj = class { 8374 constructor() { 8375 this.available = !0, this.acquireQueue = []; 8376 } 8377 acquire(e) { 8378 return new Promise((t) => { 8379 this.acquireQueue.push([e, t]), this.available && this.dispatchNext().catch((i) => Ee.errorOnce(i)); 8380 }); 8381 } 8382 async acquireImmediately(e) { 8383 return this.available ? (await this.acquire(e), !0) : !1; 8384 } 8385 async waitForClearAcquireQueue() { 8386 return this.acquire(() => Promise.resolve(void 0)); 8387 } 8388 async dispatchNext() { 8389 this.available = !1; 8390 let [e, t] = this.acquireQueue.shift() ?? []; 8391 for (; e; ) { 8392 try { 8393 await e(), t?.(); 8394 } catch (i) { 8395 Ee.error("mutex callback error", i), t?.(); 8396 } 8397 [e, t] = this.acquireQueue.shift() ?? []; 8398 } 8399 this.available = !0; 8400 } 8401}, bP = class { 8402 constructor() { 8403 this.eventListeners = /* @__PURE__ */ new Map(); 8404 } 8405 addEventListener(e, t) { 8406 if (typeof t != "function") 8407 throw new Error("AG Charts - listener must be a Function"); 8408 const i = this.eventListeners.get(e); 8409 i ? i.add(t) : this.eventListeners.set(e, /* @__PURE__ */ new Set([t])); 8410 } 8411 removeEventListener(e, t) { 8412 this.eventListeners.get(e)?.delete(t), this.eventListeners.size === 0 && this.eventListeners.delete(e); 8413 } 8414 hasEventListener(e) { 8415 return this.eventListeners.has(e); 8416 } 8417 clearEventListeners() { 8418 this.eventListeners.clear(); 8419 } 8420 fireEvent(e) { 8421 this.eventListeners.get(e.type)?.forEach((t) => t(e)); 8422 } 8423}, kl = class extends it { 8424 constructor(e = 0, t = e, i = e, s = t) { 8425 super(), this.top = e, this.right = t, this.bottom = i, this.left = s; 8426 } 8427}; 8428S([ 8429 D(Te) 8430], kl.prototype, "top", 2); 8431S([ 8432 D(Te) 8433], kl.prototype, "right", 2); 8434S([ 8435 D(Te) 8436], kl.prototype, "bottom", 2); 8437S([ 8438 D(Te) 8439], kl.prototype, "left", 2); 8440function Dj(e) { 8441 return wP((t, i) => pi().requestAnimationFrame(t), e); 8442} 8443function Ej(e) { 8444 return wP((t, i = 0) => { 8445 i === 0 ? queueMicrotask(t) : setTimeout(t, i); 8446 }, e); 8447} 8448function wP(e, t) { 8449 let i = 0, s = !1, n, o; 8450 const r = () => s, a = () => { 8451 s = !1, o?.(), o = void 0, n = void 0, i > 0 && e(l); 8452 }, l = () => { 8453 const c = i; 8454 i = 0, s = !0; 8455 const u = t({ count: c }); 8456 if (!u) { 8457 a(); 8458 return; 8459 } 8460 u.then(a, a); 8461 }; 8462 return { 8463 schedule(c) { 8464 i === 0 && !r() && e(l, c), i++; 8465 }, 8466 async await() { 8467 if (r()) 8468 for (n == null && (n = new Promise((c) => { 8469 o = c; 8470 })); r(); ) 8471 await n; 8472 } 8473 }; 8474} 8475var SP = class { 8476 constructor() { 8477 this.events = /* @__PURE__ */ new Map(); 8478 } 8479 /** 8480 * Registers an event listener. 8481 * @param eventName The event name to listen for. 8482 * @param listener The callback to be invoked on the event. 8483 * @returns A function to unregister the listener. 8484 */ 8485 on(t, i) { 8486 return this.events.has(t) || this.events.set(t, /* @__PURE__ */ new Set()), this.events.get(t)?.add(i), () => this.off(t, i); 8487 } 8488 /** 8489 * Unregisters an event listener. 8490 * @param eventName The event name to stop listening for. 8491 * @param listener The callback to be removed. 8492 */ 8493 off(t, i) { 8494 const s = this.events.get(t); 8495 s && (s.delete(i), s.size === 0 && this.events.delete(t)); 8496 } 8497 /** 8498 * Emits an event to all registered listeners. 8499 * @param eventName The name of the event to emit. 8500 * @param event The event payload. 8501 */ 8502 emit(t, i) { 8503 for (const s of this.events.get(t) ?? []) { 8504 const n = s(i); 8505 n && n.catch((o) => Ee.error(o)); 8506 } 8507 } 8508 /** 8509 * Clears all listeners for a specific event or all events if no event name is provided. 8510 * @param eventName (Optional) The name of the event to clear listeners for. If not provided, all listeners for all events are cleared. 8511 */ 8512 clear(t) { 8513 t ? this.events.delete(t) : this.events.clear(); 8514 } 8515}, dx = /* @__PURE__ */ ((e) => (e[e.Caption = 0] = "Caption", e[e.Legend = 1] = "Legend", e[e.ToolbarLeft = 2] = "ToolbarLeft", e[e.ToolbarBottom = 3] = "ToolbarBottom", e[e.Navigator = 4] = "Navigator", e[e.Overlay = 5] = "Overlay", e))(dx || {}), xP = class { 8516 constructor() { 8517 this.events = new SP(), this.elements = /* @__PURE__ */ new Map(); 8518 } 8519 addListener(e, t) { 8520 return this.events.on(e, t); 8521 } 8522 registerElement(e, t) { 8523 return this.elements.has(e) ? this.elements.get(e).add(t) : this.elements.set(e, /* @__P
8523URE__ */ new Set([t])), () => this.elements.get(e)?.delete(t); 8524 } 8525 createContext(e, t) { 8526 const i = new Ij(e, t); 8527 for (const s of Object.values(dx)) 8528 typeof s == "number" && this.elements.get(s)?.forEach((n) => { 8529 n(i)?.catch((o) => Ee.error(o)); 8530 }); 8531 return i; 8532 } 8533 emitLayoutComplete(e, t) { 8534 const i = "layout:complete", { width: s, height: n } = e; 8535 this.events.emit(i, { 8536 type: i, 8537 axes: t.axes ?? [], 8538 chart: { width: s, height: n }, 8539 clipSeries: t.clipSeries ?? !1, 8540 series: t.series 8541 }); 8542 } 8543}, Ij = class { 8544 constructor(e, t) { 8545 this.width = e, this.height = t, this.layoutBox = new _e(0, 0, e, t); 8546 } 8547}, Jv = class { 8548 constructor() { 8549 this.title = new Qt(), this.subtitle = new Qt(), this.footnote = new Qt(); 8550 } 8551 positionCaptions(e) { 8552 const { title: t, subtitle: i, footnote: s } = this, n = e.layoutBox.height / 10; 8553 if (t.enabled) { 8554 const { spacing: o = i.enabled ? Qt.SMALL_PADDING : Qt.LARGE_PADDING } = t; 8555 this.positionCaption("top", t, e.layoutBox, n), this.shrinkLayoutByCaption("top", t, e.layoutBox, o); 8556 } 8557 i.enabled && (this.positionCaption("top", i, e.layoutBox, n), this.shrinkLayoutByCaption("top", i, e.layoutBox, i.spacing)), s.enabled && (this.positionCaption("bottom", s, e.layoutBox, n), this.shrinkLayoutByCaption("bottom", s, e.layoutBox, s.spacing)); 8558 } 8559 positionAbsoluteCaptions(e) { 8560 const { title: t, subtitle: i, footnote: s } = this, { rect: n } = e.series; 8561 for (const o of [t, i, s]) 8562 if (o.layoutStyle === "overlay") { 8563 if (o.textAlign === "left") 8564 o.node.x = n.x + o.padding; 8565 else if (o.textAlign === "right") { 8566 const r = o.node.getBBox(); 8567 o.node.x = n.x + n.width - r.width - o.padding; 8568 } 8569 } 8570 } 8571 computeX(e, t) {
8572 return e === "left" ? t.x : e === "right" ? t.x + t.width : t.x + t.width / 2; 8573 } 8574 positionCaption(e, t, i, s) { 8575 const n = Math.max(vi.getLineHeight(t.fontSize), s); 8576 t.node.x = this.computeX(t.textAlign, i) + t.padding, t.node.y = i.y + (e === "top" ? 0 : i.height) + t.padding, t.node.textBaseline = e, t.computeTextWrap(i.width, n); 8577 } 8578 shrinkLayoutByCaption(e, t, i, s = 0) { 8579 if (t.layoutStyle === "block") { 8580 const n = t.node.getBBox(); 8581 i.shrink( 8582 Math.ceil(e === "top" ? n.y - i.y + n.height + s : i.y + i.height - n.y + s), 8583 e 8584 ); 8585 } 8586 } 8587}; 8588S([ 8589 D(Be) 8590], Jv.prototype, "title", 2); 8591S([ 8592 D(Be) 8593], Jv.prototype, "subtitle", 2); 8594S([ 8595 D(Be) 8596], Jv.prototype, "footnote", 2); 8597var Rj = [ 8598 "candlestick", 8599 "hollow-candlestick", 8600 "ohlc", 8601 "line", 8602 "step-line", 8603 "hlc", 8604 "high-low" 8605], Tj = class { 8606 constructor(e) { 8607 this.chartService = e, this.mementoOriginatorKey = "chartType"; 8608 } 8609 createMemento() { 8610 let e = this.chartService.publicApi?.getOptions()?.chartType; 8611 return e == null && (e = "candlestick"), e; 8612 } 8613 guardMemento(e) { 8614 return e == null || mn(e) && BS(Rj, e); 8615 } 8616 restoreMemento(e, t, i) { 8617 if (i == null) 8618 return; 8619 const s = { chartType: i }; 8620 this.chartService.publicApi?.updateDelta(s).catch((n) => Ee.error("error restoring state", n)); 8621 } 8622}, Er = class { 8623 constructor() { 8624 this.registeredListeners = /* @__PURE__ */ new Map(); 8625 } 8626 addListener(e, t) { 8627 const i = { symbol: Symbol(e), handler: t }; 8628 return this.registeredListeners.has(e) ? this.registeredListeners.get(e).push(i) : this.registeredListeners.set(e, [i]), () => this.removeListener(i.symbol); 8629 } 8630 removeListener(e) { 8631 for (const [t, i] of this.registeredListeners.entries()) { 8632 const s = i.findIndex((n) => n.symbol === e); 8633 if (s >= 0) { 8634 i.splice(s, 1), i.length === 0 && this.registeredListeners.delete(t); 8635 break; 8636 } 8637 } 8638 } 8639 dispatch(e, ...t) { 8640 for (const i of this.getListenersByType(e)) 8641 try { 8642 i.handler(...t); 8643 } catch (s) { 8644 Ee.errorOnce(s); 8645 } 8646 } 8647 dispatchWrapHandlers(e, t, ...i) { 8648 for (const s of this.getListenersByType(e)) 8649 try { 8650 t(s.handler, ...i); 8651 } catch (n) { 8652 Ee.errorOnce(n); 8653 } 8654 } 8655 getListenersByType(e) { 8656 return this.registeredListeners.get(e) ?? []; 8657 } 8658 destroy() { 8659 this.registeredListeners.clear(); 8660 } 8661}, Ir = class { 8662 constructor() { 8663 this.listeners = new Er(), this.destroyFns = []; 8664 } 8665 addListener(e, t) { 8666 return this.listeners.addListener(e, t); 8667 } 8668 destroy() { 8669 this.listeners.destroy(), this.destroyFns.forEach((e) => e()); 8670 } 8671}, hx = /* @__PURE__ */ ((e) => (e[e.Default = 32] = "Default", e[e.ZoomDrag = 16] = "ZoomDrag", e[e.Annotations = 8] = "Annotations", e[e.ContextMenu = 4] = "ContextMenu", e[e.Animation = 2] = "Animation", e[e.AnnotationsSelected = 1] = "AnnotationsSelected", e[e.All = 63] = "All", e))(hx || {}), MP = class extends Ir { 8672 // Wrapper to only broadcast events when the InteractionManager is a given state. 8673 addListener(e, t, i = 32) { 8674 return super.addListener(e, (s) => {
8675 this.getState() & i && t(s); 8676 }); 8677 } 8678}, AP = class { 8679 constructor() { 8680 this.destroyFns = []; 8681 } 8682 destroy() { 8683 this.destroyFns.forEach((e) => e()), this.destroyFns.length = 0; 8684 } 8685 setFns(e) { 8686 this.destroy(), this.destroyFns = e; 8687 } 8688 push(...e) { 8689 this.destroyFns.push(...e); 8690 } 8691}, _m = "11.0.3", II = /* @__PURE__ */ Symbol("previous-memento-not-found"), Lj = class { 8692 constructor(e) { 8693 this.history = [], this.historyIndex = -1, this.originators = /* @__PURE__ */ new Map(), this.clearState = /* @__PURE__ */ new Map(), this.maxHistoryLength = 100, this.debug = Xt.create(!0, "history"), this.destroyFns = new AP(), this.destroyFns.setFns([ 8694 e.addListener( 8695 "undo", 8696 this.undo.bind(this), 8697 63 8698 /* All */ 8699 ), 8700 e.addListener( 8701 "redo", 8702 this.redo.bind(this), 8703 63 8704 /* All */ 8705 ) 8706 ]); 8707 } 8708 destroy() { 8709 this.destroyFns.destroy(); 8710 } 8711 addMementoOriginator(e) { 8712 this.originators.set(e.mementoOriginatorKey, e), this.clearState.set(e.mementoOriginatorKey, e.createMemento()), this.debugEvent("History add originator:", e.mementoOriginatorKey); 8713 } 8714 clear() { 8715 this.debug("History clear:", Object.keys(this.originators)), this.history = [], this.historyIndex = -1; 8716 for (const [e, t] of this.originators.entries()) 8717 this.clearState.set(e, t.createMemento()); 8718 } 8719 record(e, ...t) { 8720 this.historyIndex < this.history.length - 1 && (this.history = this.history.slice(0, this.historyIndex + 1)), this.history.length > this.maxHistoryLength && (this.history = this.history.slice(-this.maxHistoryLength)); 8721 const i = /* @__PURE__ */ new Map(); 8722 for (const s of t) { 8723 if (!this.originators.has(s.mementoOriginatorKey)) 8724 throw new Error( 8725 `Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.` 8726 ); 8727 i.set(s.mementoOriginatorKey, s.createMemento()); 8728 } 8729 this.history.push({ label: e, mementos: i }), this.historyIndex = this.history.length - 1, this.debugEvent(`History record: [${e}]`); 8730 } 8731 undo() { 8732 const e = this.history[this.historyIndex]; 8733 if (e) { 8734 for (const t of e.mementos.keys()) { 8735 const i = this.findPreviousMemento(t); 8736 if (i === II) 8737 throw new Error(`Could not find previous memento for [${t}].`); 8738 this.restoreMemento(t, i); 8739 } 8740 this.historyIndex -= 1, this.debugEvent(`History undo: [${e.label}]`); 8741 } 8742 } 8743 redo() { 8744 const e = this.history[this.historyIndex + 1]; 8745 if (e) { 8746 for (const [t, i] of e.mementos.entries()) 8747 this.restoreMemento(t, i); 8748 this.historyIndex += 1, this.debugEvent(`History redo: [${e.label}]`); 8749 } 8750 } 8751 findPreviousMemento(e) { 8752 for (let t = this.historyIndex - 1; t >= 0; t--) 8753 if (this.history[t].mementos.has(e)) 8754 return this.history[t].mementos.get(e); 8755 return this.clearState.has(e) ? this.clearState.get(e) : II; 8756 } 8757 restoreMemento(e, t) { 8758 this.originators.get(e)?.restoreMemento(_m, _m, t); 8759 } 8760 debugEvent(...e) { 8761 this.debug( 8762 ...e, 8763 this.history.map((t, i) => i === this.historyIndex ? `** ${t.label} **` : t.label) 8764 ); 8765 } 8766}, DP = class Cw { 8767 constructor(t) { 8768 this.version = t.split("-")[0]; 8769 } 8770 save(...t) { 8771 const i = { version: this.version }; 8772 for (const s of Object.values(t)) 8773 i[s.mementoOriginatorKey] = this.encode(s, s.createMemento()); 8774 return i; 8775 } 8776 restore(t, ...i) { 8777 if (typeof t != "object") { 8778 Ee.warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`); 8779 return; 8780 } 8781 if (t == null) { 8782 Ee.warnOnce("Could not restore data of type [null], expecting an object, ignoring."); 8783 return; 8784 } 8785 if (!("version" in t) || typeof t.version != "string") { 8786 Ee.warnOnce("Could not restore data, missing [version] string in object, ignoring."); 8787 return; 8788 } 8789 for (const s of i) { 8790 const n = this.decode(s, t[s.mementoOriginatorKey]); 8791 if (!s.guardMemento(n)) { 8792 Ee.warnOnce( 8793 `Could not restore [${s.mementoOriginatorKey}
8793] data, value was invalid, ignoring.`, 8794 n 8795 ); 8796 return; 8797 } 8798 s.restoreMemento(this.version, t.version, n); 8799 } 8800 } 8801 /** 8802 * Encode a memento as a serializable object, encoding any non-serializble types. 8803 */ 8804 encode(t, i) { 8805 try { 8806 return JSON.parse(JSON.stringify(i, Cw.encodeTypes)); 8807 } catch (s) { 8808 throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${s}].`, { 8809 cause: s 8810 }); 8811 } 8812 } 8813 /** 8814 * Decode an encoded memento, decoding any non-serializable types. 8815 */ 8816 decode(t, i) { 8817 if (i == null) 8818 return i; 8819 try { 8820 return JSON.parse(JSON.stringify(i), Cw.decodeTypes); 8821 } catch (s) { 8822 throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`, { 8823 cause: s 8824 }); 8825 } 8826 } 8827 static encodeTypes(t, i) { 8828 return og(this[t]) ? { __type: "date", value: this[t].toISOString() } : i; 8829 } 8830 static decodeTypes(t, i) { 8831 return Qs(this[t]) && "__type" in this[t] && this[t].__type === "date" ? new Date(this[t].value) : i; 8832 } 8833}, kj = class { 8834 constructor() { 8835 this.caretaker = new DP(_m), this.state = /* @__PURE__ */ new Map(); 8836 } 8837 setState(e, t) { 8838 kc(this.state.get(e.mementoOriginatorKey), t) || this.setStateAndRestore(e, t); 8839 } 8840 setStateAndRestore(e, t) { 8841 this.state.set(e.mementoOriginatorKey, t), this.restoreState(e); 8842 } 8843 restoreState(e) { 8844 const { caretaker: t, state: i } = this; 8845 if (!i.has(e.mementoOriginatorKey)) 8846 return; 8847 const s = i.get(e.mementoOriginatorKey); 8848 t.restore({ version: t.version, [e.mementoOriginatorKey]: s }, e); 8849 } 8850}, Pj = `.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{position:relative;user-select:none}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--ag-charts-align);justify-content:var(--ag-charts-justify)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{display:block;pointer-events:none}.ag-charts-series-area{outline:none;pointer-events:none;position:absolute}.ag-charts-swapchain{outline:none;opacity:0;pointer-events:auto;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-active-color: var(--ag-active-color, #2196f3);--ag-charts-background-color: var(--ag-background-color, #fff);--ag-charts-foreground-color: var(--ag-foreground-color, #181d1f);--ag-charts-border-color: var(--ag-border-color, #dddddd);--ag-charts-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12%);--ag-charts-font-family: "Verdana", sans-serif;--ag-charts-font-size: var(--ag-font-size, 14px);--ag-charts-size: var(--ag-grid-size, 8px);--ag-charts-border: var(--ag-charts-border-color) var(--ag-borders, solid 1px);--ag-charts-border-critical: var(--ag-borders-critical, solid 1px);--ag-charts-floating-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1;--ag-charts-align: center;--ag-charts-justify: center;--ag-charts-axis-label-background-color: #474747;--ag-charts-axis-label-color: #ffffff;--ag-charts-tooltip-background-color: #fafafb;--ag-charts-tooltip-text-color: var(--ag-charts-foreground-color);--ag-charts-tooltip-border: 1px solid var(--ag-charts-border-color);--ag-charts-content-padding: 8px 12px;--ag-charts-content-gap: 8px;--ag-charts-content-compact-padding: 3px 6px;--ag-charts-tooltip-border-radius: 4px;--ag-charts-toolbar-foreground-color: var(--ag-header-foreground-color, var(--ag-charts-foreground-color));--ag-charts-toolbar-background-color: var( --ag-header-background-color, color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 2%) );--ag-charts-toolbar-shadow: var(--ag-charts-floating-shadow);--ag-charts-toolbar-size: 34px;--ag-charts-toolbar-size-small: 24px;--ag-charts-toolbar-border: var(--ag-charts-border-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-toolbar-hover-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 12% );--ag-charts-toolbar-focus-color: var(--ag-charts-active-color);--ag-charts-toolbar-active-background-color: var(--ag-charts-toolbar-hover-color);--ag-charts-toolbar-active-color: var(--ag-charts-active-color);--ag-charts-toolbar-disabled-foreground-color: var( --ag-disabled-foreground-color, color-mix(in srgb, transparent, var(--ag-charts-toolbar-foreground-color) 50%) );--ag-charts-toolbar-disabled-background-color: color-mix( in srgb, var(--ag-charts-toolbar-background-color), var(--ag-charts-toolbar-foreground-color) 6% );--ag-charts-toolbar-gap: var(--ag-charts-size);--ag-charts-toolbar-font-size: 13px;--ag-charts-toolbar-font-size-small: 12px;--ag-charts-toolbar-button-padding: 6px;--ag-charts-toolbar-button-padding-small: 1px;--ag-charts-popover-background-color: var(--ag-charts-toolbar-background-color);--ag-charts-popover-foreground-color: var(--ag-charts-toolbar-foreground-color);--ag-charts-popover-border: var(--ag-charts-toolbar-border);--ag-charts-popover-border-radius: var(--ag-border-radius, 4px);--ag-charts-popover-active-color: var(--ag-charts-toolbar-active-color);--ag-charts-popover-hover-color: var(--ag-charts-toolbar-hover-color);--ag-charts-popover-active-background-color: var(--ag-charts-toolbar-active-background-color);--ag-charts-popover-font-size: 14px;--ag-charts-popover-font-size-small: var(--ag-charts-toolbar-font-size-small);--ag-charts-popover-shadow: var(--ag-charts-floating-shadow);--ag-charts-dialog-input-group-label-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color) 55%);--ag-charts-dialog-tab-color--inactive: color-mix(in srgb, transparent, var(--ag-charts-foreground-color) 55%);--ag-charts-button-radius: var(--ag-border-radius, 4px);--ag-charts-focus-border-color: var(--ag-input-focus-border-color, var(--ag-charts-active-color));--ag-charts-focus-border: solid 1px var(--ag-charts-focus-border-color);
8850--ag-charts-focus-border-shadow: var( --ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-input-focus-border-color, var(--ag-charts-active-color)) 20%) );--ag-charts-focus-box-shadow: var(--box-shadow), 0 0 0 2px #fff8, var(--ag-charts-focus-border-shadow);--ag-charts-icon-font-family: "agChartsDefault";--ag-charts-icon-font-weight: normal;--ag-charts-icon-font-color: color-mix(in srgb, transparent, var(--ag-charts-foreground-color), 90%);--ag-charts-icon-size: 20px;--ag-charts-input-background-color: var(--ag-charts-background-color);--ag-charts-input-background-color--hover: var(--ag-charts-hover-color);--ag-charts-input-background-color--active: var(--ag-charts-hover-color);--ag-charts-input-border-color: var(--ag-charts-border-color);--ag-charts-input-border-color--active: var(--ag-charts-active-color);--ag-charts-input-border-radius: var(--ag-border-radius, 4px);--ag-charts-input-color--active: var(--ag-charts-active-color);--ag-charts-input-focus-outline: var(--ag-charts-focus-border);--ag-charts-input-focus-box-shadow: var(--ag-charts-focus-border-shadow);--ag-charts-input-font-family: var(--ag-charts-font-family);--ag-charts-input-font-size: var(--ag-charts-font-size);--ag-charts-input-padding: 8px;--ag-charts-input-padding-large: 10px;--ag-charts-input-placeholder-color: #888888;--ag-charts-input-spacing: 8px;--ag-charts-input-transition-duration: .25s;--ag-charts-input-transition-duration--fast: .1s;--ag-charts-input-transition-timing-function: ease-out;--ag-charts-input-checkbox-background-color: #babbbc;--ag-charts-input-checkbox-background-color--checked: var(--ag-charts-active-color)}.ag-charts-theme-default-dark{--ag-charts-background-color: var(--ag-background-color, color-mix(in srgb, #fff, #182230 97%));--ag-charts-foreground-color: var(--ag-foreground-color, #fff);--ag-charts-border-color: var(--ag-border-color, rgba(255, 255, 255, .16));--ag-charts-hover-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 18%);--ag-charts-floating-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--ag-charts-axis-label-background-color: #9caebb;--ag-charts-axis-label-color: #000000;--ag-charts-tooltip-background-color: #28313e;--ag-charts-tooltip-border: 1px solid #474e59
vendor: 9,286 bytes, line 8850
8850;--ag-charts-toolbar-background-color: var(--ag-header-background-color, color-mix(in srgb, #fff, #182230 93%));--ag-charts-toolbar-hover-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-active-color) 18% );--ag-charts-dialog-input-group-label-text-color: #ffffff;--ag-charts-focus-border-shadow: var( --ag-input-focus-box-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-input-focus-border-color, var(--ag-charts-active-color)) 20%) );--ag-charts-input-placeholder-color: #aaaaaa}.ag-charts-icon{display:block;width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size);speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fi
8850bonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAw
8850MCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAw
8850MCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1I
8850DEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAw
8850MCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;color:inherit;font-family:var(--ag-charts-input-font-family);font-size:var(--ag-charts-input-font-size);transition-duration:var(--ag-charts-input-transition-duration);transition-property:none;transition-timing-function:var(--ag-charts-input-transition-timing-function)}.ag-charts-input:focus-visible{outline:var(--ag-charts-input-focus-outline);
8850box-shadow:var(--ag-charts-input-focus-box-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);cursor:pointer;padding:var(--ag-charts-input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-input-background-color--hover)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{appearance:none;background:var(--ag-charts-input-checkbox-background-color);border-radius:9px;cursor:pointer;height:18px;margin:0;transition-duration:var(--ag-charts-input-transition-duration--fast);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:7px;content:" ";height:14px;margin:2px;transition-duration:var(--ag-charts-input-transition-duration--fast);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-input-checkbox-background-color--checked)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--line-height: 1.38;background:var(--ag-charts-input-background-color);border:1px solid var(--ag-charts-input-border-color);border-radius:var(--ag-charts-input-border-radius);line-height:var(--line-height);font-family:var(--ag-charts-input-font-family);font-size:var(--ag-charts-input-font-size);padding:var(--ag-charts-input-padding-large) var(--ag-charts-input-padding)}.ag-charts-textarea[placeholder]:empty:before{color:var(--ag-charts-input-placeholder);content:attr(placeholder)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:var(--ag-charts-focus-border);outline-width:2px;box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;stroke:var(--ag-charts-focus-border-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{position:fixed;inset:unset;margin:0;padding:0;overflow:visible;width:max-content;max-width:100%;font:12px Verdana,sans-serif;color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border:var(--ag-charts-tooltip-border);border-radius:var(--ag-charts-tooltip-border-radius);box-shadow:0 4px 8px #00000014}.ag-charts-tooltip--compact{--ag-charts-content-padding: var(--ag-charts-content-compact-padding)}.ag-charts-tooltip--arrow:before{--tooltip-arrow-size: 8px;content:"";position:absolute;top:100%;left:50%;margin:0 auto;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(45deg);display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;background:inherit;border-top:none;border-left:none;clip-path:polygon(0 100%,100% 0,100% 100%)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none}
8850.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:var(--ag-charts-content-padding);gap:var(--ag-charts-content-gap)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;align-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:16px;align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-popover{position:absolute;border:var(--ag-charts-popover-border);border-radius:var(--ag-charts-popover-border-radius);background:var(--ag-charts-popover-background-color);color:var(--ag-charts-popover-foreground-color);font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-popover-font-size);box-shadow:var(--ag-charts-popover-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-popover-foreground-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-popover-font-size-small)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-popover-hover-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-popover-active-color);background:var(--ag-charts-popover-active-background-color);color:var(--ag-charts-popover-active-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-toolbar-background-color);border:var(--ag-charts-toolbar-border);color:var(--ag-charts-toolbar-foreground-color);cursor:pointer;display:flex;font:var(--ag-charts-toolbar-font-size) var(--ag-charts-font-family);justify-content:center;min-height:var(--ag-charts-toolbar-size);min-width:var(--ag-charts-toolbar-size);padding:var(--ag-charts-toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-toolbar-hover-color);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active{background:var(--ag-charts-toolbar-active-background-color);border-color:var(--ag-charts-toolbar-active-color);color:var(--ag-charts-toolbar-active-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-toolbar-disabled-background-color);color:var(--ag-charts-toolbar-disabled-foreground-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-button-radius);border-top-left-radius:var(--ag-charts-button-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-button-radius);border-top-right-radius:var(--ag-charts-button-radius)}}
8850.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-button-radius);border-top-right-radius:var(--ag-charts-button-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-button-radius);border-bottom-right-radius:var(--ag-charts-button-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--ag-charts-toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-toolbar-background-color);border:var(--ag-charts-toolbar-border);border-bottom-left-radius:var(--ag-charts-button-radius);border-top-left-radius:var(--ag-charts-button-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing} 8851`; 8852function ec(e) { 8853 return e === "true"; 8854} 8855function Fj(e) { 8856 return Number(e); 8857} 8858function ko(e) { 8859 return e; 8860} 8861var Oj = { 8862 role: ko, 8863 "aria-checked": ec, 8864 "aria-controls": ko, 8865 "aria-describedby": ko, 8866 "aria-disabled": ec, 8867 "aria-expanded": ec, 8868 "aria-haspopup": ec, 8869 "aria-hidden": ec, 8870 "aria-label": ko, 8871 "aria-labelledby": ko, 8872 "aria-live": ko, 8873 "aria-orientation": ko, 8874 "aria-selected": ec, 8875 "data-preventdefault": ec, 8876 class: ko, 8877 id: ko, 8878 tabindex: Fj, 8879 title: ko, 8880 placeholder: ko 8881}; 8882function Yt(e, t, i) { 8883 i == null || i === "" || i === "" ? e?.removeAttribute(t) : e?.setAttribute(t, i.toString()); 8884} 8885function Fc(e, t) { 8886 if (t != null) 8887 for (const [i, s] of Object.entries(t)) 8888 i !== "class" && Yt(e, i, s); 8889} 8890function ey(e, t, i) { 8891 if (!(e instanceof HTMLElement)) 8892 return; 8893 const s = e.getAttribute(t); 8894 return s === null ? i : Oj[t]?.(s) ?? void 0; 8895} 8896function Vo(e, t, i) { 8897 e != null && (i == null ? e.style.removeProperty(t) : e.style.setProperty(t, i.toString())); 8898} 8899function Nj(e, t) { 8900 for (const [i, s] of Object.entries(t)) 8901 Vo(e, i, s); 8902} 8903var _j = class lm { 8904 constructor(t, i, s) { 8905 this.element = t, this.topTabGuard = i, this.bottomTabGuard = s, this.destroyFns = [], this.guardTabIndex = 0, this.hasFocus = !1, this.initTabGuard(this.topTabGuard, (n) => this.onTab(n, !1)), this.initTabGuard(this.bottomTabGuard, (n) => this.onTab(n, !0)), this.element.addEventListener("focus", () => this.onFocus(), { capture: !0 }), this.element.addEventListener("blur", (n) => this.onBlur(n), { capture: !0 }); 8906 } 8907 set tabIndex(t) { 8908 this.guardTabIndex = t, this.guardTabIndex === 0 ? this.setGuardIndices(void 0) : this.hasFocus || this.setGuardIndices(this.guardTabIndex); 8909 } 8910 destroy() { 8911 for (const t of this.destroyFns) 8912 t(); 8913 this.destroyFns.length = 0; 8914 } 8915 initTabGuard(t, i) { 8916 const s = () => i(t); 8917 t.addEventListener("focus", s), this.destroyFns.push(() => t.removeEventListener("focus", s)); 8918 } 8919 setGuardIndices(t) { 8920 const i = t; 8921 Yt(this.topTabGuard, "tabindex", i), Yt(this.bottomTabGuard, "tabindex", i); 8922 } 8923 onFocus() { 8924 this.hasFocus = !0, this.guardTabIndex !== 0 && this.setGuardIndices(0); 8925 } 8926 onBlur({ relatedTarget: t }) { 8927 const { topTabGuard: i, bottomTabGuard: s } = this; 8928 this.hasFocus = !1, this.guardTabIndex !== 0 && t !== i && t !== s && this.setGuardIndices(this.guardTabIndex); 8929 } 8930 onTab(t, i) { 8931 if (this.guardTabIndex !== 0) { 8932 let s; 8933 t.tabIndex === 0 ? (s = this.findExitTarget(!i), this.setGuardIndices(this.guardTabIndex)) : s = this.findEnterTarget(i), s?.focus(); 8934 } 8935 } 8936 static queryFocusable(t, i) { 8937 const s = pi(); 8938 return Array.from(t.querySelectorAll(i)).filter((n) => { 8939 if (n instanceof HTMLElement) { 8940 const o = s.getComputedStyle(n); 8941 return o.display !== "none" && o.visibility !== "none"; 8942 } 8943 return !1; 8944 }); 8945 } 8946 findEnterTarget(t) { 8947 const i = lm.queryFocusable(this.element, '[tabindex="0"]'), s = t ? i.length - 1 : 0; 8948 return i[s]; 8949 } 8950 findExitTarget(t) { 8951 const i = lm.queryFocusable(Xi(), "[tabindex]").filter((o) => o.tabIndex > 0).sort((o, r) => o.tabIndex - r.tabIndex), { before: s, after: n } = lm.findBeforeAndAfter(i, this.guardTabIndex); 8952 return t ? s : n; 8953 } 8954 static findBeforeAndAfter(t, i) { 8955 let s = 0, n = t.length - 1, o, r; 8956 for (; s <= n; ) { 8957 const a = Math.floor((s + n) / 2), l = t[a].tabIndex; 8958 if (l === i) { 8959 o = t[a - 1] || void 0, r = t[a + 1] || void 0; 8960 break; 8961 } else l < i ? (o = t[a], s = a + 1) : (r = t[a], n = a - 1); 8962 } 8963 return { before: o, after: r }; 8964 } 8965}; 8966function ta(e, t, i, s) { 8967 t.addEventListener(i, s); 8968 const n = () => t.removeEventListener(i, s); 8969 return e.push(n), n; 8970} 8971function EP(e, t, i) { 8972 ta(e, t, "keydown", (s) => { 8973 s.key === "Escape" && i(s); 8974 }); 8975} 8976function Bj(e, t, i) { 8977 const s = ta(e, window, "mousedown", (n) => { 8978 [0, 2].includes(n.button) && !Gj(t, n) && (i(), s()); 8979 }); 8980 return s; 8981} 8982function Gj(e, t) { 8983 if (t.target instanceof Element) { 8984 const { x: i, y: s, width: n, height: o } = e.getBoundingClientRect(), { clientX: r, clientY: a } = t; 8985 return r >= i && a >= s && r <= i + n && a <= s + o; 8986 } 8987 return !1; 8988} 8989function ty(e) { 8990 return !(e.shiftKey || e.altKey || e.ctrlKey || e.metaKey); 8991} 8992function px(e, t, ...i) { 8993 return ty(e) && (e.key === t || i.some((s) => e.key === s)); 8994} 8995function RI(e, t, i, s) { 8996 i && ta(e, t, "keydown", (n) => { 8997 px(n, s) && i.focus(); 8998 }); 8999} 9000function zj(e, t, i, s, n, o) { 9001 RI(e, t, n, o), RI(e, t, i, s), ta(e, t, "keydown", (r) => { 9002 px(r, s, o) && r.preventDefault(); 9003 }); 9004} 9005var ed = { 9006 horizontal: { nextKey: "ArrowRight", prevKey: "ArrowLeft" }, 9007 vertical: { nextKey: "ArrowDown", prevKey: "ArrowUp" } 9008}; 9009function Hj(e) { 9010 return e.toolbar.role = "toolbar", e.toolbar.ariaOrientation = e.orientation, e.toolbar.ariaHidden = (e.buttons.length === 0).toString(), gx(e); 9011} 9012function gx(e) { 9013 const { orientation: t, buttons: i, wrapAround: s = !1, onEscape: n, onFocus: o, onBlur: r } = e, { nextKey: a, prevKey: l } = ed[t], c = (f) => { 9014 f.target && "tabIndex" in f.target && (i.forEach((m) => m.tabIndex = -1), f.target.tabIndex = 0); 9015 }, [u, d] = s ? [i.length, i.length] : [0, 1 / 0], p = []; 9016 for (let f = 0; f < i.length; f++) { 9017 const m = i[(u + f - 1) % d], y = i[f], b = i[(u + f + 1) % d]; 9018 ta(p, y, "focus", c), o && ta(p, y, "focus", o), r && ta(p, y, "blur", r), n && EP(p, y, n), zj(p, y, b, a, m, l), y.tabIndex = f === 0 ? 0 : -1; 9019 } 9020 return p; 9021} 9022var Vj = class { 9023 constructor(e, t, i) { 9024 this.lastFocus = t, this.closeCallback = i, this.destroyFns = [], this.destroyFns.push(Bj(this.destroyFns, e, () => this.close(!0))); 9025 } 9026 close(e) { 9027 this.destroyFns.forEach((t) => t()), this.destroyFns.length = 0, this.closeCallback(), this.finishClosing(e); 9028 } 9029 finishClosing(e) { 9030 this.destroyFns.forEach((t) => t()), this.destroyFns.length = 0, Yt(this.lastFocus, "aria-expanded", !1), e || this.lastFocus?.focus({ preventScroll: !0 }), this.lastFocus = void 0; 9031 } 9032}; 9033function IP(e) { 9034 const { sourceEvent: t, orientation: i, menu: s, buttons: n, closeCallback: o, autoCloseOnBlur: r = !1 } = e, { nextKey: a, prevKey: l } = ed[i], c = mx(t); 9035 Yt(c, "aria-expanded", !0); 9036 const u = new Vj(s, c, o), d = () => u.close(), { destroyFns: p } = u; 9037 if (s.role = "menu", s.ariaOrientation = i, p.push(...gx({ orientation: i, buttons: n, onEscape: d, wrapAround: !0 })), s.tabIndex = -1, EP(p, s, d), ta(p, s, "keydown", (f) => { 9038 f.target === s && (f.key === a || f.key === l) && (f.preventDefault(), n[0]?.focu
9038s()); 9039 }), r) { 9040 const f = (m) => { 9041 !n.includes(m.relatedTarget) && d(); 9042 }; 9043 for (const m of n) 9044 ta(p, m, "blur", f); 9045 } 9046 return n[0]?.focus({ preventScroll: !0 }), u; 9047} 9048function Uj(e, t) { 9049 return (i) => { 9050 if (e.ariaDisabled === "true") 9051 return i.preventDefault(); 9052 t(i); 9053 }; 9054} 9055function fx(e) { 9056 return "button" in e ? e.button === 0 : ty(e) && (e.code === "Space" || e.key === "Enter"); 9057} 9058function mx(e) { 9059 if (e?.target instanceof HTMLElement && "tabindex" in e.target.attributes) 9060 return e.target; 9061} 9062function RP(e) { 9063 const t = (i) => { 9064 if (i.defaultPrevented) 9065 return; 9066 ey(i.target, "data-preventdefault", !0) && px(i, "ArrowRight", "ArrowLeft", "ArrowDown", "ArrowUp") && i.preventDefault(); 9067 }; 9068 return e.addEventListener("keydown", t), () => e.removeEventListener("keydown", t); 9069} 9070var Wj = class { 9071 constructor() { 9072 this.elements = /* @__PURE__ */ new Map(), this.documentReady = !1, this.queuedObserveRequests = [], this.onLoad = () => { 9073 this.documentReady = !0, this.queuedObserveRequests.forEach(([e, t]) => this.observe(e, t)), this.queuedObserveRequests = []; 9074 }, !(typeof ResizeObserver > "u") && (this.resizeObserver = new ResizeObserver((e) => { 9075 for (const { 9076 target: t, 9077 contentRect: { width: i, height: s } 9078 } of e) { 9079 const n = this.elements.get(t); 9080 this.checkSize(n, t, i, s); 9081 } 9082 }), this.documentReady = Xi("readyState") === "complete", this.documentReady || pi()?.addEventListener("load", this.onLoad)); 9083 } 9084 destroy() { 9085 pi()?.removeEventListener("load", this.onLoad), this.resizeObserver?.disconnect(), this.resizeObserver = null; 9086 } 9087 checkSize(e, t, i, s) { 9088 e && (i !== e.size?.width || s !== e.size?.height) && (e.size = { width: i, height: s }, e.cb(e.size, t)); 9089 } 9090 // Only a single callback is supported. 9091 observe(e, t) { 9092 if (!this.documentReady) { 9093 this.queuedObserveRequests.push([e, t]); 9094 return; 9095 } 9096 this.elements.has(e) ? this.removeFromQueue(e) : this.resizeObserver?.observe(e); 9097 const i = { cb: t }; 9098 this.elements.set(e, i); 9099 } 9100 unobserve(e) { 9101 this.resizeObserver?.unobserve(e), this.elements.delete(e), this.removeFromQueue(e), this.elements.size || this.destroy(); 9102 } 9103 removeFromQueue(e) { 9104 this.queuedObserveRequests = this.queuedObserveRequests.filter(([t]) => t !== e); 9105 } 9106}, jj = '<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay"></div></div></div></div>', $j = [ 9107 "styles", 9108 "canvas", 9109 "canvas-center", 9110 "canvas-container", 9111 "canvas-overlay", 9112 "canvas-proxy", 9113 "series-area" 9114], Yj = /* @__PURE__ */ new Map([ 9115 ["styles", { childElementType: "style" }], 9116 ["canvas", { childElementType: "canvas" }], 9117 ["canvas-proxy", { childElementType: "div" }], 9118 ["canvas-overlay", { childElementType: "div" }], 9119 ["canvas-center", { childElementType: "div" }], 9120 ["series-area", { childElementType: "div" }] 9121]); 9122function Kj(e, t) { 9123 if (typeof IntersectionObserver > "u") 9124 return; 9125 const i = new IntersectionObserver( 9126 (s) => { 9127 for (const n of s) 9128 n.target === e && t(n.intersectionRatio); 9129 }, 9130 { root: e } 9131 ); 9132 return i.observe(e), i; 9133} 9134var TP = { 9135 x: 0, 9136 y: 0, 9137 width: 0, 9138 height: 0, 9139 top: 0, 9140 bottom: 0, 9141 left: 0, 9142 right: 0, 9143 toJSON() { 9144 return TP; 9145 } 9146}; 9147function TI(e, t) { 9148 const i = Gt("div"); 9149 return i.className = "ag-charts-tab-guard", e.insertAdjacentElement(t, i), i; 9150} 9151var LP = class extends Ir { 9152 constructor(e, t) { 9153 super(), this.styles = /* @__PURE__ */ new Map(), this.container = void 0, this.containerSize = void 0, this.sizeMonitor = new Wj(); 9154 const i = Gt("div"); 9155 i.innerHTML = jj, this.element = i.children.item(0), this.styleRootElement = t, this.rootElements = $j.reduce( 9156 (a, l) => { 9157 const c = `ag-charts-${l}`, u = this.element.classList.contains(c) ? this.element : this.element.querySelector(`.${c}`); 9158 if (!u) 9159 throw new Error(`AG Charts - unable to find DOM element ${c}`); 9160 return a[l] = { element: u, children: /* @__PURE__ */ new Map(), listeners: [] }, a; 9161 }, 9162 {} 9163 ); 9164 let s = !1; 9165 this.observer = Kj(this.element, (a) => { 9166 a === 0 && !s && this.listeners.dispatch("hidden", { type: "hidden" }), s = a === 0; 9167 }), this.setSizeOptions(), this.addStyles("ag-charts-community", Pj), e && this.setContainer(e), this.destroyFns.push(RP(this.element)); 9168 const n = this.element.querySelector(".ag-charts-canvas-center"); 9169 if (n == null) 9170 throw new Error("Error initializing tab guards"); 9171 const o = TI(n, "beforebegin"), r = TI(n, "afterend"); 9172 this.tabGuards = new _j(n, o, r); 9173 } 9174 destroy() { 9175 super.destroy(), this.observer?.unobserve(this.element), this.container && this.sizeMonitor.unobserve(this.container), Object.values(this.rootElements).forEac
9175h((e) => { 9176 e.children.forEach((t) => t.remove()), e.element.remove(); 9177 }), this.element.remove(); 9178 } 9179 setSizeOptions(e = 300, t = 300, i, s) { 9180 const { style: n } = this.element; 9181 n.width = `${i ?? e}px`, n.height = `${s ?? t}px`; 9182 } 9183 updateContainerSize() { 9184 const { style: e } = this.rootElements["canvas-center"].element; 9185 e.width = `${this.containerSize?.width ?? 0}px`, e.height = `${this.containerSize?.height ?? 0}px`; 9186 } 9187 setTabGuardIndex(e) { 9188 this.tabGuards.tabIndex = e; 9189 } 9190 setContainer(e) { 9191 if (e === this.container) 9192 return; 9193 if (this.container && (this.container.removeChild(this.element), this.sizeMonitor.unobserve(this.container)), !(this.getShadowDocumentRoot(e) != null)) 9194 for (const i of this.rootElements.styles.children.keys()) 9195 this.removeChild("styles", i); 9196 this.container = e; 9197 for (const [i, s] of this.styles) 9198 this.addStyles(i, s); 9199 e.appendChild(this.element), this.sizeMonitor.observe(e, (i) => { 9200 this.containerSize = i, this.updateContainerSize(), this.listeners.dispatch("resize", { type: "resize" }); 9201 }), this.listeners.dispatch("container-changed", { type: "container-changed" }); 9202 } 9203 setThemeClass(e) { 9204 const t = "ag-charts-theme-"; 9205 this.element.classList.forEach((i) => { 9206 i.startsWith(t) && i !== e && this.element.classList.remove(i); 9207 }), this.element.classList.add(e); 9208 } 9209 updateCanvasLabel(e) { 9210 Yt(this.rootElements["canvas-proxy"].element, "aria-label", e); 9211 } 9212 getEventElement(e, t) { 9213 return ["focus", "blur", "keydown", "keyup"].includes(t) ? this.rootElements["series-area"].element : e; 9214 } 9215 addEventListener(e, t, i) { 9216 this.getEventElement(this.element, e).addEventListener(e, t, i); 9217 } 9218 removeEventListener(e, t, i) { 9219 this.getEventElement(this.element, e).removeEventListener(e, t, i); 9220 } 9221 /** Get the main chart area client bound rect. */ 9222 getBoundingClientRect() { 9223 return this.rootElements.canvas.element.getBoundingClientRect(); 9224 } 9225 /** 9226 * Get the client bounding rect for overlay elements that might float outside the bounds of the 9227 * main chart area. 9228 */ 9229 getOverlayClientRect() { 9230 const e = pi(), t = new _e(0, 0, e.innerWidth, e.innerHeight), i = this.getRawOverlayClientRect(); 9231 return t.intersection(i)?.toDOMRect() ?? TP; 9232 } 9233 getRawOverlayClientRect() { 9234 let e = this.element; 9235 for (; e != null; ) { 9236 const o = e.computedStyleMap?.()?.get("overflow-y")?.toString(); 9237 if (o === "auto" || o === "scroll") 9238 return _e.fromDOMRect(e.getBoundingClientRect()); 9239 e = e.parentElement; 9240 } 9241 const t = this.getShadowDocumentRoot(); 9242 if (t != null) 9243 return _e.fromDOMRect(t.getBoundingClientRect()); 9244 const { innerWidth: i, innerHeight: s } = pi(); 9245 return new _e(0, 0, i, s); 9246 } 9247 getShadowDocumentRoot(e = this.container) { 9248 const t = e?.ownerDocument?.body ?? Xi("body"); 9249 for (; e != null; ) { 9250 if (e === t) 9251 return; 9252 if (e.parentNode instanceof DocumentFragment) 9253 return e; 9254 e = e.parentNode; 9255 } 9256 return this.container; 9257 } 9258 getParent(e) { 9259 return this.rootElements[e].element; 9260 } 9261 getChildBoundingClientRect(e) { 9262 const { children: t } = this.rootElements[e], i = []; 9263 for (const s of t.values()) 9264 i.push(_e.fromDOMRect(s.getBoundingClientRect())); 9265 return _e.merge(i); 9266 } 9267 calculateCanvasPosition(e) { 9268 let t = 0, i = 0; 9269 const { x: s = 0, y: n = 0 } = this.getChildBoundingClientRect("canvas") ?? {}, o = e.getBoundingClientRect(); 9270 return t = o.x - s, i = o.y - n, { x: t, y: i }; 9271 } 9272 isManagedChildDOMElement(e, t, i) { 9273 const { children: s } = this.rootElements[t], n = s?.get(i); 9274 return n != null && e.contains(n); 9275 } 9276 contains(e, t) { 9277 return t == null ? this.element.contains(e) : this.rootElements[t].element.contains(e); 9278 } 9279 addStyles(e, t) { 9280 const i = "data-ag-charts"; 9281 if (this.styles.set(e, t), this.container == null) 9282 return; 9283 const s = (r) => r.getAttribute(i) === e, n = (r) => { 9284 const a = /* @__PURE__ */ new Set(["TITLE", "META"]); 9285 let l = !0, c; 9286 for (const d of r.children) { 9287 if (l && a.has(d.tagName)) { 9288 c = d; 9289 continue; 9290 } 9291 if (l = !1, s(d)) 9292 return; 9293 d.hasAttribute(i) && (c = d); 9294 } 9295 const u = Gt("style"); 9296 return c != null ? r.insertBefore(u, c.nextSibling) : r.prepend(u), u; 9297 }; 9298 let o; 9299 this.styleRootElement ? o = n(this.styleRootElement) : this.get
9299ShadowDocumentRoot(this.container) != null ? o = this.addChild("styles", e) : o = n(Xi("head")), !(o == null || s(o)) && (o.setAttribute(i, e), o.innerHTML = t); 9300 } 9301 removeStyles(e) { 9302 this.removeChild("styles", e); 9303 } 9304 updateCursor(e) { 9305 this.element.style.cursor = e; 9306 } 9307 getCursor() { 9308 return this.element.style.cursor; 9309 } 9310 addChild(e, t, i, s) { 9311 const { element: n, children: o, listeners: r } = this.rootElements[e]; 9312 if (!o) 9313 throw new Error("AG Charts - unable to create DOM elements after destroy()"); 9314 if (o.has(t)) 9315 return o.get(t); 9316 const { childElementType: a = "div" } = Yj.get(e) ?? {}; 9317 if (i && i.tagName.toLowerCase() !== a.toLowerCase()) 9318 throw new Error("AG Charts - mismatching DOM element type"); 9319 const l = i ?? Gt(a); 9320 for (const [c, u, d] of r) 9321 l.addEventListener(c, u, d); 9322 if (o.set(t, l), s) { 9323 const c = n.querySelector(s.query); 9324 if (c == null) 9325 throw new Error(`AG Charts - addChild query failed ${s.query}`); 9326 c.insertAdjacentElement(s.where, l); 9327 } else 9328 n?.appendChild(l); 9329 return l; 9330 } 9331 removeChild(e, t) { 9332 const { children: i } = this.rootElements[e]; 9333 i && (i.get(t)?.remove(), i.delete(t)); 9334 } 9335 incrementDataCounter(e) { 9336 const { dataset: t } = this.element; 9337 t[e] ?? (t[e] = "0"), t[e] = String(Number(t[e]) + 1); 9338 } 9339 setDataBoolean(e, t) { 9340 this.element.dataset[e] = String(t); 9341 } 9342}, vx = [ 9343 "blur", 9344 "change", 9345 "contextmenu", 9346 "focus", 9347 "keydown", 9348 "keyup", 9349 "click", 9350 "dblclick", 9351 "mouseenter", 9352 "mousemove", 9353 "mouseleave", 9354 "wheel" 9355]; 9356function bu(e, t) { 9357 const { offsetX: i, offsetY: s, clientX: n, clientY: o } = t; 9358 return { type: e, offsetX: i, offsetY: s, clientX: n, clientY: o, sourceEvent: t }; 9359} 9360var Zj = { 9361 blur: (e) => ({ type: "blur", sourceEvent: e }), 9362 change: (e) => ({ type: "change", sourceEvent: e }), 9363 contextmenu: (e) => bu("contextmenu", e),
9364 focus: (e) => ({ type: "focus", sourceEvent: e }), 9365 keydown: (e) => ({ type: "keydown", sourceEvent: e }), 9366 keyup: (e) => ({ type: "keyup", sourceEvent: e }), 9367 click: (e) => bu("click", e), 9368 dblclick: (e) => bu("dblclick", e), 9369 mouseenter: (e) => bu("mouseenter", e), 9370 mousemove: (e) => bu("mousemove", e), 9371 mouseleave: (e) => bu("mouseleave", e), 9372 wheel: (e) => { 9373 const { offsetX: t, offsetY: i, clientX: s, clientY: n, deltaX: o, deltaY: r } = e; 9374 return { type: "wheel", offsetX: t, offsetY: i, clientX: s, clientY: n, deltaX: o, deltaY: r, sourceEvent: e }; 9375 } 9376}, Lp = class { 9377 static alloc(e, t) { 9378 return Zj[e](t); 9379 } 9380 static isHTMLEvent(e) { 9381 return vx.includes(e); 9382 } 9383}, qj = class { 9384 constructor() { 9385 this.maps = {}; 9386 } 9387 lazyGetMap(e) { 9388 let t = this.maps[e]; 9389 return t === void 0 && (t = /* @__PURE__ */ new Map(), this.maps[e] = t), t; 9390 } 9391 add(e, t, i) { 9392 const s = this.lazyGetMap(e); 9393 if (s.has(i)) 9394 throw new Error("AG Charts - duplicate add(handler)"); 9395 const n = (o) => { 9396 const r = Lp.alloc(e, o); 9397 i(r, t); 9398 }; 9399 t.getElement().addEventListener(e, n), s.set(i, n); 9400 } 9401 remove(e, t, i) { 9402 const s = this.lazyGetMap(e), n = s.get(i); 9403 n && t.getElement().removeEventListener(e, n), s.delete(i); 9404 } 9405 destroy(e) { 9406 for (const t of Object.keys(this.maps)) 9407 this.typedDestroy(t, e); 9408 } 9409 typedDestroy(e, t) { 9410 const i = this.maps[e]; 9411 if (i != null) 9412 for (const [s, n] of i.entries()) 9413 t.getElement().removeEventListener(e, n); 9414 } 9415}; 9416function Kb(e, t, i) { 9417 const s = i.pageX - t.pageX, n = i.pageY - t.pageY; 9418 return { 9419 type: e, 9420 offsetX: t.offsetX + s, 9421 offsetY: t.offsetY + n, 9422 clientX: i.clientX, 9423 clientY: i.clientY, 9424 originDeltaX: s, 9425 originDeltaY: n, 9426 sourceEvent: i 9427 }; 9428} 9429function Qj(e, t, i) { 9430 if (e.globalDragCallbacks != null) 9431 return; 9432 const s = pi(), n = (a) => { 9433 a.stopPropagation(), a.stopImmediatePropagation(); 9434 }, o = (a) => { 9435 a.stopPropagation(), a.stopImmediatePropagation(), e.globalDragCallbacks?.move(a); 9436 }, r = (a) => { 9437 a.button === 0 && (a.stopPropagation(), a.stopImmediatePropagation(), s.removeEventListener("mousedown", n, { capture: !0 }), s.removeEventListener("mouseenter", n, { capture: !0 }), s.removeEventListener("mouseleave", n, { capture: !0 }), s.removeEventListener("mouseout", n, { capture: !0 }), s.removeEventListener("mouseover", n, { capture: !0 }), s.removeEventListener("mousemove", o, { capture: !0 }), s.removeEventListener("mouseup", r, { capture: !0 }), e.globalDragCallbacks?.up(a), e.globalDragCallbacks = void 0); 9438 }; 9439 s.addEventListener("mousedown", n, { capture: !0 }), s.addEventListener("mouseenter", n, { capture: !0 }), s.addEventListener("mouseleave", n, { capture: !0 }), s.addEventListener("mouseout", n, { capture: !0 }), s.addEventListener("mouseover", n, { capture: !0 }), s.addEventListener("mousemove", o, { capture: !0 }), s.addEventListener("mouseup", r, { capture: !0 }), e.globalDragCallbacks = t, e.globalDragCallbacks.down(i); 9440} 9441var Xj = class cm { 9442 destroy() { 9443 this.dragTriggerRemovers?.forEach((t) => t()), this.dragTriggerRemovers = void 0, this.dragStartListeners = void 0, this.dragMoveListeners = void 0, this.dragEndListeners = void 0, cm.globalDragCallbacks === this.localDragCallbacks && (cm.globalDragCallbacks = void 0); 9444 } 9445 add(t, i, s) { 9446 switch (t) { 9447 case "drag-start": { 9448 this.dragStartListeners ?? (this.dragStartListeners = []), this.dragStartListeners.push(s), this.registerDragTrigger(i, s); 9449 break; 9450 } 9451 case "drag-move": { 9452 this.dragMoveListeners ?? (this.dragMoveListeners = []), this.dragMoveListeners.push(s); 9453 break; 9454 } 9455 case "drag-end": { 9456 this.dragEndListeners ?? (this.dragEndListeners = []), this.dragEndListeners.push(s); 9457 break; 9458 } 9459 } 9460 } 9461 remove(t, i, s) { 9462 switch (t) { 9463 case "drag-start": 9464 return this.removeHandler(this.dragStartListeners, s); 9465 case "drag-move": 9466 return this.removeHandler(this.dragMoveListeners, s); 9467 case "drag-end": 9468 return this.removeHandler(this.dragEndListeners, s); 9469 } 9470 } 9471 removeHandler(t, i) { 9472 const s = t?.indexOf(i); 9473 s !== void 0 && t?.splice(s, 1); 9474 } 9475 registerDragTrigger(t, i) { 9476 const s = (n) => n.button === 0 && this.startDrag(t, n); 9477 t.getElement().addEventListener("mousedown", s), this.dragTriggerRemovers ?? (this.dragTriggerRemovers = /* @__PURE__ */ new Map()), this.dragTriggerRemovers.set( 9478 i, 9479 () => t.getElement().removeEventListener("mousedown", s) 9480 ); 9481 } 9482 startDrag(t, i) { 9483 const s = { pageX: NaN, pageY: NaN, offsetX: NaN, offsetY: NaN }; 9484 tl(["pageX", "pageY", "offsetX", "offsetY"], s, i); 9485 const n = { 9486 down: (o) => { 9487 this.localDragCallbacks = n; 9488 const r = Kb("drag-start", s, o); 9489 this.dispatch("drag-start", t, r); 9490 }, 9491 move: (o) => { 9492 const r = Kb("drag-move", s, o); 9493 this.dispatch("drag-move", t, r); 9494 }, 9495 up: (o) => { 9496 const r = Kb("drag-end", s, o); 9497 this.dispatch("drag-end", t, r), this.endDrag(t, r); 9498 } 9499 }; 9500 Qj(cm, n, i); 9501 } 9502 endDrag(t, { sourceEvent: i, clientX: s, clientY: n }) { 9503 const o = t.getElement(), r = o.getBoundingClientRect(); 9504 Tv.containsPoint(r, s, n) || (o.dispatchEvent(new MouseEvent("mouseleave", i)), i.target?.dispatchEvent(new MouseEvent("mouseenter", i))); 9505 } 9506 dispatch(t, i, s) { 9507 switch (t) { 9508 case "drag-start": 9509 return this.dragStartListeners?.forEach((n) => n(s, i)); 9510 case "drag-move": 9511 return this.dragMoveListeners?.forEach((n) => n(s, i)); 9512 case "drag-end": 9513 return this.dragEndListeners?.forEach((n) => n(s, i)); 9514 } 9515 } 9516}, Jj = class { 9517 constructor(e) { 9518 this.elem = e; 9519 } 9520 setBounds(e) { 9521 Ip(this.elemContainer ?? this.elem, e); 9522 } 9523 getBounds() { 9524 return Yk(this.elemContainer ?? this.elem); 9525 } 9526 static setElementContainer(e, t) { 9527 const i = e.getBounds(); 9528 Ip(t, i), Nj(e.elem, { width: "100%", height: "100%" }), e.elem.remove(), e.elemContainer = t, e.elemContainer.replaceChildren(e.elem); 9529 } 9530}, xa = class extends Jj { 9531 constructor(e) { 9532 super(e), this.elem = e, this.index = NaN, this.children = []; 9533 } 9534 getElement() { 9535 return this.elem; 9536 } 9537 get clientWidth() { 9538 return this.elem.clientWidth; 9539 } 9540 get clientHeight() { 9541 return this.elem.clientHeight; 9542 } 9543 destroy() {
9544 this.parent?.removeChild(this), this.children.forEach((e) => { 9545 e.parent = void 0, e.destroy(); 9546 }), this.children.length = 0, this.destructor(), this.elem.remove(), this.elemContainer?.remove(), this.internalListener?.destroy(), this.htmlListener?.destroy(this); 9547 } 9548 setHidden(e) { 9549 Vo(this.elem, "display", e ? "none" : void 0); 9550 } 9551 isHidden() { 9552 return pi()?.getComputedStyle?.(this.elem).display === "none"; 9553 } 9554 setCursor(e) { 9555 Vo(this.elem, "cursor", e); 9556 } 9557 setTextContent(e) { 9558 this.elem.textContent = e ?? null; 9559 } 9560 setAriaDescribedBy(e) { 9561 Yt(this.elem, "aria-describedby", e); 9562 } 9563 setAriaHidden(e) { 9564 Yt(this.elem, "aria-hidden", e); 9565 } 9566 setAriaLabel(e) { 9567 Yt(this.elem, "aria-label", e); 9568 } 9569 setInnerHTML(e) { 9570 this.elem.innerHTML = e; 9571 } 9572 isDisabled() { 9573 return ey(this.elem, "aria-disabled", !1); 9574 } 9575 parseFloat(e) { 9576 return e === "" ? 0 : parseFloat(e); 9577 } 9578 cssLeft() { 9579 return this.parseFloat(this.elem.style.left); 9580 } 9581 cssTop() { 9582 return this.parseFloat(this.elem.style.top); 9583 } 9584 focus() { 9585 this.elem.focus(); 9586 } 9587 setPreventsDefault(e) { 9588 Yt(this.elem, "data-preventdefault", e); 9589 } 9590 setTabIndex(e) { 9591 Yt(this.elem, "tabindex", e); 9592 } 9593 addChild(e) { 9594 this.addChildToDOM(e, this.getBefore(e)), this.children.push(e), e.index = this.children.length - 1, e.parent = this, this.onChildAdded(e); 9595 } 9596 removeChild(e) { 9597 const t = this.children.findIndex((i) => i === e); 9598 this.children.splice(t, 1), this.removeChildFromDOM(e), this.onChildRemoved(e); 9599 } 9600 addClass(...e) { 9601 this.elem.classList.add(...e); 9602 } 9603 removeClass(...e) { 9604 this.elem.classList.remove(...e); 9605 } 9606 toggleClass(e, t) { 9607 this.elem.classList.toggle(e, t); 9608 } 9609 appendOrInsert(e, t) { 9610 t ? t.getElement().insertAdjacentElement("beforebegin", e) : this.elem.appendChild(e); 9611 } 9612 addChildToDOM(e, t) { 9613 this.appendOrInsert(e.getElement(), t); 9614 } 9615 removeChildFromDOM(e) { 9616 this.elem.removeChild(e.getElement()); 9617 } 9618 onChildAdded(e) { 9619 } 9620 onChildRemoved(e) { 9621 } 9622 getBefore({ domIndex: e }) { 9623 if (e !== void 0) 9624 return this.children.filter((t) => t.domIndex !== void 0 && t.domIndex > e).reduce((t, i) => !t || i.domIndex < t.domIndex ? i : t, void 0); 9625 } 9626 addListener(e, t) { 9627 Lp.isHTMLEvent(e) ? (this.htmlListener ?? (this.htmlListener = new qj()), this.htmlListener.add(e, this, t)) : (this.internalListener ?? (this.internalListener = new Xj()), this.internalListener.add(e, this, t)); 9628 } 9629 removeListener(e, t) { 9630 Lp.isHTMLEvent(e) ? this.htmlListener?.remove(e, this, t) : this.htmlListener != null && this.internalListener?.remove(e, this, t); 9631 } 9632}, e9 = class extends xa { 9633 constructor() { 9634 super(Xi().createElement("div")), this.textElement = hw("http://www.w3.org/2000/svg", "text"), this.textElement.role = "presentation", this.svgElement = hw("http://www.w3.org/2000/svg", "svg"), this.svgElement.appendChild(this.textElement), this.svgElement.style.width = "100%", this.svgElement.style.opacity = "0", this.svgElement.role = "presentation", this.elem.appendChild(this.svgElement), this.elem.role = "presentation"; 9635 } 9636 set textContent(e) { 9637 this.textElement.textContent = e; 9638 const i = this.textElement.getBBox?.(); 9639 i && this.svgElement.setAttribute("viewBox", `${i.x} ${i.y} ${i.width} ${i.height}`); 9640 } 9641 get textContent() { 9642 return this.textElement.textContent; 9643 } 9644 destructor() { 9645 } 9646}, fg = class extends xa { 9647 constructor() { 9648 super(Xi().createElement("button")), this.setEnabled(!0); 9649 } 9650 destructor() { 9651 } 9652 setEnabled(e) { 9653 Yt(this.elem, "aria-disabled", !e), Vo(this.elem, "pointer-events", e ? void 0 : "none"); 9654 } 9655 addListener(e, t) { 9656 return super.addListener(e, (i, s) => { 9657 (e === "click" || e === "dblclick") && this.isDisabled() || t(i, s); 9658 }); 9659 } 9660}, t9 = class extends xa { 9661 constructor() { 9662 super(Xi().createElement("div")), Yt(this.elem, "role", "group"); 9663 } 9664 destructor() { 9665 } 9666}, kP = class extends xa { 9667 constructor(e, t) { 9668 super(Xi().createElement("div")), this.focusedChildIndex = 0, this.onChildFocus = (i, s) => { 9669 const n = this.children[this.focusedChildIndex]; 9670 this.focusedChildIndex = s.index, n?.setTabIndex(-1), s.setTabIndex(0); 9671 }, this.onChildKeyDown = (i, s) => { 9672 const n = this.orientation, [o, r] = n === "both" ? [ed.horizontal, ed.vertical] : [ed[n], void 0]; 9673 let a = -1; 9674 if (ty(i.sourceEvent)) { 9675 const l = i.sourceEvent.key; 9676 l === o.nextKey || l === r?.nextKey ? a = s.index + 1 : (l === o.prevKey || l === r?.prevKey) && (a = s.index - 1); 9677 } 9678 this.children[a]?.focus(); 9679 }, this.orientation = e, Yt(this.elem, "role", t); 9680 } 9681 get orientation() { 9682 return ey(this.elem, "aria-orientation") ?? "both"; 9683 } 9684 set orientation(e) { 9685 Yt(this.elem, "aria-orientation", e !== "both" ? e : void 0); 9686 } 9687 focus() { 9688 this.children[this.focusedChildIndex]?.focus(); 9689 } 9690 onChildAdded(e) { 9691 e.addListener("focus", this.onChildFocus), e.addListener("keydown", this.onChildKeyDown), e.setTabIndex(this.children.length === 1 ? 0 : -1); 9692 } 9693 onChildRemoved(e) { 9694 e.removeListener("focus", this.onChildFocus), e.removeListener("keydown", this.onChildKeyDown); 9695 } 9696}, i9 = class extends kP { 9697 constructor() { 9698 super("both", "list"), this.setHidden(!0); 9699 } 9700 destructor() {
9701 this.children.forEach((e) => e.getElement().parentElement.remove()); 9702 } 9703 addChildToDOM(e, t) { 9704 const i = Xi().createElement("div"); 9705 Yt(i, "role", "listitem"), Vo(i, "position", "absolute"), xa.setElementContainer(e, i), this.appendOrInsert(i, t), this.setHidden(!1); 9706 } 9707 removeChildFromDOM(e) { 9708 e.getElement().parentElement.remove(), this.setHidden(this.children.length === 0); 9709 } 9710 setHidden(e) { 9711 this.children.length === 0 && (e = !0), super.setHidden(e); 9712 } 9713}, dl = class extends xa { 9714 constructor(e) { 9715 super(e); 9716 } 9717 destructor() { 9718 } 9719}, yx = class zh extends xa { 9720 constructor() { 9721 super(Xi().createElement("input")), this._step = zh.STEP_ONE, this.orientation = "both"; 9722 } 9723 get step() { 9724 return this._step; 9725 } 9726 set step(t) { 9727 this._step = t, this.getElement().step = t.attributeValue; 9728 } 9729 get keyboardStep() { 9730 return this._keyboardStep?.step ?? this._step; 9731 } 9732 set keyboardStep(t) { 9733 if (t !== this._keyboardStep?.step && (this._keyboardStep !== void 0 && (this.removeListener("keydown", this._keyboardStep.onKeyDown), this.removeListener("keyup", this._keyboardStep.onKeyUp), this.removeListener("blur", this._keyboardStep.onBlur), this._keyboardStep = void 0), t !== void 0)) { 9734 const i = () => this.getElement().step = t.attributeValue, s = () => this.getElement().step = this._step.attributeValue; 9735 this._keyboardStep = { step: t, onKeyDown: i, onKeyUp: s, onBlur: s }, this.addListener("keydown", this._keyboardStep.onKeyDown), this.addListener("keyup", this._keyboardStep.onKeyUp), this.addListener("blur", this._keyboardStep.onBlur); 9736 } 9737 } 9738 get orientation() { 9739 return ey(this.elem, "aria-orientation") ?? "both"; 9740 } 9741 set orientation(t) { 9742 Yt(this.elem, "aria-orientation", t !== "both" ? t : void 0), zh.registerDefaultPreventers(this, t); 9743 } 9744 destructor() { 9745 } 9746 clampValueRatio(t, i) { 9747 const s = this.getValueRatio(), n = ot(t, s, i); 9748 return n !== s && this.setValueRatio(n), n; 9749 } 9750 setValueRatio(t, i) { 9751 const { divider: s } = this.step, n = Math.round(t * 1e4) / s, { ariaValueText: o = iP(n / s) } = i ?? {}, r = this.getElement(); 9752 r.value = `${n}`, r.ariaValueText = o; 9753 } 9754 getValueRatio() { 9755 return parseFloat(this.getElement().value) / this.step.divider; 9756 } 9757 static registerDefaultPreventers(t, i) { 9758 i === "both" ? t.removeListener("keydown", zh.onKeyDown) : t.addListener("keydown", zh.onKeyDown); 9759 } 9760 static onKeyDown(t, i) { 9761 let s = []; 9762 const { orientation: n } = i; 9763 n === "horizontal" ? s = ["ArrowUp", "ArrowDown"] : n === "vertical" && (s = ["ArrowLeft", "ArrowRight"]), s.includes(t.sourceEvent.code) && t.sourceEvent.preventDefault(); 9764 } 9765}; 9766yx.STEP_ONE = { attributeValue: "1", divider: 1 }; 9767yx.STEP_HUNDRETH = { attributeValue: "0.01", divider: 100 }; 9768var Cx = yx, s9 = class extends fg { 9769 constructor() { 9770 super(), Yt(this.elem, "role", "switch"), this.setChecked(!1); 9771 } 9772 setChecked(e) { 9773 Yt(this.elem, "aria-checked", e); 9774 } 9775}, iy = class extends kP { 9776 constructor(e = "horizontal") { 9777 super(e, "toolbar"); 9778 } 9779 destructor() { 9780 } 9781}; 9782function wu(e, t) { 9783 return t.params?.type === e; 9784} 9785function n9(e) { 9786 if (e === "button") 9787 return new fg(); 9788 if (e === "slider") 9789 return new Cx(); 9790 if (e === "toolbar") 9791 return new iy(); 9792 if (e === "group") 9793 return new t9(); 9794 if (e === "list") 9795 return new i9(); 9796 if (e === "region") 9797 return new dl(Gt("div")); 9798 if (e === "text") 9799 return new e9(); 9800 if (e === "listswitch") 9801 return new s9(); 9802 throw Error("AG Charts - error allocating meta"); 9803} 9804function LI(e) { 9805 const t = { params: e, result: void 0 }; 9806 return t.result = n9(t.params.type), t; 9807} 9808var PP = class { 9809 constructor(e, t) { 9810 this.localeManager = e, this.domManager = t, this.destroyFns = []; 9811 } 9812 destroy() { 9813 this.destroyFns.forEach((e) => e()); 9814 } 9815 addLocalisation(e) { 9816 e(), this.destroyFns.push(this.localeManager.addListener("locale-changed", e)); 9817 } 9818 createProxyContainer(e) { 9819 const t = LI(e), { params: i, result: s } = t, n = s.getElement(); 9820 return this.domManager.addChild("canvas-proxy", i.domManagerId, n), n.classList.add(...i.classList, "ag-charts-proxy-container"), n.role = i.type, "ariaOrientation" in i && (n.ariaOrientation = i.ariaOrientation), wu("toolbar", t) && (t.result.orientation = t.params.orientation), this.addLocalisation(() => { 9821 n.ariaLabel = this.localeManager.t(i.ariaLabel.id, i.ariaLabel.params); 9822 }), s; 9823 } 9824 createProxyElement(e) { 9825 const t = LI(e); 9826 if (wu("button", t)) { 9827 const { params: i, result: s } = t, n = s.getElement(); 9828 if (this.initInteract(i, s), typeof i.textContent == "string") 9829 n.textContent = i.textContent; 9830 else { 9831 const { textContent: o } = i; 9832 this.addLocalisation(() => { 9833 n.textContent = this.localeManager.t(o.id, o.params); 9834 }); 9835 } 9836 this.setParent(t.params, t.result); 9837 } 9838 if (wu("slider", t)) { 9839 const { params: i, result: s } = t, n = s.getElement(); 9840 this.initInteract(i, s), n.type = "range", n.role = "presentation", n.style.margin = "0px", this.addLocalisation(() => { 9841 n.ariaLabel = this.localeManager.t(i.ariaLabel.id, i.ariaLabel.params); 9842 }), this.setParent(t.params, t.result); 9843 } 9844 if (wu("text", t)) { 9845 const { params: i, result: s } = t; 9846 this.initElement(i, s), this.setParent(t.params, t.result); 9847 } 9848 if (wu("listswitch", t)) { 9849 const { params: i, result: s } = t; 9850 this.initInteract(i, s), s.setTextContent(i.textContent), s.setChecked(i.ariaChecked), s.setAriaDescribedBy(i.ariaDescribedBy), this.setParent(t.params, t.result); 9851 } 9852 if (wu("region", t)) { 9853 const { params: i, result: s } = t, n = s.getElement();
9854 this.initInteract(i, s), n.role = "region", this.setParent(t.params, t.result); 9855 } 9856 return t.result; 9857 } 9858 initElement(e, t) { 9859 const i = t.getElement(); 9860 return Yt(i, "id", e.id), Vo(i, "cursor", e.cursor), i.classList.toggle("ag-charts-proxy-elem", !0), i; 9861 } 9862 initInteract(e, t) { 9863 const { tabIndex: i, domIndex: s } = e, n = this.initElement(e, t); 9864 i !== void 0 && (n.tabIndex = i), s !== void 0 && (t.domIndex = s); 9865 } 9866 setParent(e, t) { 9867 if ("parent" in e) 9868 e.parent?.addChild(t); 9869 else { 9870 const i = { where: e.where, query: ".ag-charts-series-area" }; 9871 this.domManager.addChild("canvas-proxy", e.domManagerId, t.getElement(), i); 9872 } 9873 } 9874}, o9 = /\$\{(\w+)}(?:\[(\w+)])?/gi, Zb = { 9875 number: new Intl.NumberFormat("en-US"), 9876 percent: new Intl.NumberFormat("en-US", { style: "percent", minimumFractionDigits: 2, maximumFractionDigits: 2 }), 9877 date: new Intl.DateTimeFormat("en-US", { dateStyle: "full" }), 9878 time: new Intl.DateTimeFormat("en-US", { timeStyle: "full" }), 9879 datetime: new Intl.DateTimeFormat("en-US", { dateStyle: "full", timeStyle: "full" }) 9880}, r9 = ({ defaultValue: e, variables: t }) => e?.replaceAll(o9, (i, s, n) => { 9881 const o = t[s], r = n != null ? Zb[n] : null; 9882 return n != null && r == null && Ee.warnOnce(`Format style [${n}] is not supported`), r != null ? r.format(o) : typeof o == "number" ? Zb.number.format(o) : o instanceof Date ? Zb.datetime.format(o) : String(o); 9883}), a9 = class extends Er { 9884 constructor() { 9885 super(...arguments), this.localeText = void 0, this.getLocaleText = void 0; 9886 } 9887 setLocaleText(t) { 9888 this.localeText !== t && (this.localeText = t, this.dispatch("locale-changed")); 9889 } 9890 setLocaleTextFormatter(t) { 9891 this.getLocaleText = t, this.getLocaleText !== t && (this.getLocaleText = t, this.dispatch("locale-changed")); 9892 } 9893 t(t, i = {}) { 9894 const { localeText: s = WW, getLocaleText: n } = this, o = s[t]; 9895 return n?.({ key: t, defaultValue: o, variables: i }) ?? r9({ defaultValue: o, variables: i }) ?? t; 9896 } 9897}; 9898function FP({ 9899 context: e, 9900 pixelRatio: t, 9901 width: i, 9902 height: s 9903}) { 9904 e.save(), e.setTransform(t, 0, 0, t, 0, 0), e.clearRect(0, 0, i, s), e.restore(); 9905} 9906function OP(e) { 9907 if (Xt.check("canvas")) { 9908 const t = e.save.bind(e), i = e.restore.bind(e); 9909 let s = 0; 9910 Object.assign(e, { 9911 save() { 9912 t(), s++; 9913 }, 9914 restore() { 9915 if (s === 0) 9916 throw new Error("AG Charts - Unable to restore() past depth 0"); 9917 i(), s--; 9918 }, 9919 verifyDepthZero() { 9920 if (s !== 0) 9921 throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`); 9922 } 9923 }); 9924 } 9925} 9926var bx = class { 9927 constructor(e) { 9928 this.enabled = !0, this.width = 600, this.height = 300; 9929 const { width: t, height: i, pixelRatio: s, canvasElement: n, willReadFrequently: o = !1 } = e; 9930 this.pixelRatio = s ?? pi("devicePixelRatio"), this.element = n ?? Gt("canvas"), this.element.style.display = "block", this.element.style.width = (t ?? this.width) + "px", this.element.style.height = (i ?? this.height) + "px", this.element.width = Math.round((t ?? this.width) * this.pixelRatio), this.element.height = Math.round((i ?? this.height) * this.pixelRatio), this.context = this.element.getContext("2d", { willReadFrequently: o }), this.onEnabledChange(), this.resize(t ?? 0, i ?? 0), OP(this.context); 9931 } 9932 drawImage(e, t = 0, i = 0) { 9933 return e.drawImage(this.context.canvas, t, i); 9934 } 9935 toDataURL(e) { 9936 return this.element.toDataURL(e); 9937 } 9938 resize(e, t) { 9939 if (!(e > 0 && t > 0)) 9940 return; 9941 const { element: i, context: s, pixelRatio: n } = this; 9942 i.width = Math.round(e * n), i.height = Math.round(t * n), s.setTransform(n, 0, 0, n, 0, 0), i.style.width = e + "px", i.style.height = t + "px", this.width = e, this.height = t; 9943 } 9944 clear() { 9945 FP(this); 9946 } 9947 destroy() { 9948 this.element.remove(), this.element.width = 0, this.element.height = 0, this.context.clearRect(0, 0, 0, 0), Object.freeze(this); 9949 } 9950 onEnabledChange() { 9951 this.element && (this.element.style.display = this.enabled ? "" : "none"); 9952 } 9953}; 9954S([ 9955 jc((e) => e.onEnabledChange()) 9956], bx.prototype, "enabled", 2); 9957var l9 = class { 9958 constructor(e) { 9959 this.width = 600, this.height = 300; 9960 const { width: t, height: i, pixelRatio: s, willReadFrequently: n = !1 } = e; 9961 this.pixelRatio = s ?? pi("devicePixelRatio"), this.canvas = new OffscreenCanvas(t ?? this.width, i ?? this.height), this.context = this.canvas.getContext("2d", { willReadFrequently: n }), this.resize(t ?? 0, i ?? 0), OP(this.context); 9962 } 9963 drawImage(e, t = 0, i = 0) { 9964 return e.drawImage(this.context.canvas, t, i); 9965 } 9966 resize(e, t) { 9967 if (!(e > 0 && t > 0)) 9968 return; 9969 const { canvas: i, context: s, pixelRatio: n } = this; 9970 i.width = Math.round(e * n), i.height = Math.round(t * n), s.setTransform(n, 0, 0, n, 0, 0), this.width = e, this.height = t; 9971 } 9972 clear() { 9973 FP(this); 9974 } 9975 destroy() { 9976 this.canvas.width = 0, this.canvas.height = 0, this.context.clearRect(0, 0, 0, 0), this.canvas = null, this.context = null, Object.freeze(this); 9977 } 9978}, c9 = class { 9979 constructor(e) { 9980 this.canvas = e, this.debug = Xt.create(!0, "scene"), this.layersMap = /* @__PURE__ */ new Map(), this.nextLayerId = 0; 9981 } 9982 get size() { 9983 return this.layersMap.size; 9984 } 9985 resize(e, t) {
9986 this.canvas.resize(e, t), this.layersMap.forEach(({ canvas: i }) => i.resize(e, t)); 9987 } 9988 addLayer(e) { 9989 const { width: t, height: i, pixelRatio: s } = this.canvas, { name: n } = e, o = new l9({ width: t, height: i, pixelRatio: s }); 9990 return this.layersMap.set(o, { 9991 id: this.nextLayerId++, 9992 name: n, 9993 canvas: o 9994 }), this.debug("Scene.addLayer() - layers", this.layersMap), o; 9995 } 9996 removeLayer(e) { 9997 this.layersMap.has(e) && (this.layersMap.delete(e), e.destroy(), this.debug("Scene.removeLayer() - layers", this.layersMap)); 9998 } 9999 clear() { 10000 for (const e of this.layersMap.values()) 10001 e.canvas.destroy(); 10002 this.layersMap.clear(); 10003 } 10004}, NP = class _P { 10005 constructor() { 10006 this.offscreenCanvas = new OffscreenCanvas(1, 1), _P.offscreenCanvasCount++; 10007 const t = this.offscreenCanvas.getContext("2d"); 10008 if (t == null) 10009 throw new TypeError("AG Charts - invalid 2d context"); 10010 this.renderCtx = { 10011 ctx: t, 10012 devicePixelRatio: 1, 10013 resized: !1, 10014 debugNodes: {} 10015 }; 10016 } 10017 resize({ spritePixelRatio: t, spriteWidth: i, spriteHeight: s }) { 10018 this.offscreenCanvas.width = Math.max(i, 0) * t, this.offscreenCanvas.height = Math.max(s, 0) * t; 10019 } 10020 renderSprite(t, i) { 10021 t = HL(t); 10022 const { 10023 renderCtx: s, 10024 renderCtx: { ctx: n }, 10025 offscreenCanvas: o 10026 } = this, { scale: r = 1, translateX: a = 0, translateY: l = 0 } = i ?? {}; 10027 n.save(), n.resetTransform(), n.clearRect(0, 0, o.width, o.height), n.beginPath(), n.setTransform(r, 0, 0, r, a, l); 10028 for (const c of t) 10029 c.preRender(), c.render(s); 10030 return n.closePath(), n.restore(), o.transferToImageBitmap(); 10031 } 10032}; 10033NP.offscreenCanvasCount = 0; 10034var BP = NP; 10035function u9(e) { 10036 for (const t of ["B", "KB", "MB", "GB"]) { 10037 if (e < 1536) 10038 return `${e.toFixed(1)}${t}`; 10039 e /= 1024; 10040 } 10041 return `${e.toFixed(1)}TB}`; 10042} 10043function d9() { 10044 if (!("memory" in performance)) 10045 return; 10046 const { totalJSHeapSize: e, usedJSHeapSize: t, jsHeapSizeLimit: i } = performance.memory, s = []; 10047 for (const n of [t, e, i]) 10048 typeof n == "number" && s.push(u9(n)); 10049 return `Heap ${s.join(" / ")}`; 10050} 10051function kI(e, t, i, s, n = {}, o = _e.zero) { 10052 if (!Xt.check( 10053 "scene:stats", 10054 "scene:stats:verbose" 10055 /* SCENE_STATS_VERBOSE */ 10056 )) 10057 return; 10058 const { 10059 layersRendered: r = 0, 10060 layersSkipped: a = 0, 10061 nodesRendered: l = 0, 10062 nodesSkipped: c = 0, 10063 opsPerformed: u = 0, 10064 opsSkipped: d = 0 10065 } = s ?? {}, p = performance.now(), { start: f, ...m } = t, y = Object.entries(m).map(([W, se]) => PI(W, se)).filter((W) => W != null).join(" + "), b = Object.entries(n).map(([W, se]) => `${W}: ${JSON.stringify(se)}`).join(" ; "), C = Xt.check( 10066 "scene:stats:verbose" 10067 /* SCENE_STATS_VERBOSE */ 10068 ), w = d9(), M = [ 10069 `${PI("â±ï¸", f, p)} (${y})`, 10070 `${b}`, 10071 `Layers: ${C ? qb(r, a) : e.size}; Sprites: ${BP.offscreenCanvasCount}`, 10072 C ? `Nodes: ${qb(l, c)}` : null, 10073 C ? `Ops: ${qb(u, d)}` : null, 10074 C && w ? w : null 10075 ].filter(mn), A = new ix((W) => i.measureText(W)), I = new Map(M.map((W) => [W, A.measureLines(W)])), L = Math.max(...Array.from(I.values(), (W) => W.width)), k = v9(I.values(), (W) => W.height), B = 2 + o.x; 10076 i.save(), i.fillStyle = "white", i.fillRect(B, 0, L, k), i.fillStyle = "black"; 10077 let N = 0; 10078 for (const [W, se] of I.entries()) 10079 N += se.height, i.fillText(W, B, N); 10080 i.restore(); 10081} 10082function h9(e) { 10083 const t = Ap(pi("agChartsSceneDebug")), i = []; 10084 for (const s of t) 10085 s === "layout" ? i.push("seriesRoot", "legend", "root", /.*Axis-\d+-axis.*/) : i.push(s); 10086 e.debugNodeSearch = i; 10087} 10088function p9(e, t) { 10089 e.save(); 10090 for (const [i, s] of Object.entries(t)) { 10091 const n = Ii.toCanvas(s); 10092 if (!n) { 10093 Ee.log(`Scene.render() - no bbox for debugged node [${i}].`); 10094 continue; 10095 } 10096 e.globalAlpha = 0.8, e.strokeStyle = "red", e.lineWidth = 1, e.strokeRect(n.x, n.y, n.width, n.height), e.fillStyle = "red", e.strokeStyle = "white", e.font = "16px sans-serif", e.textBaseline = "top", e.textAlign = "left", e.lineWidth = 2, e.strokeText(i, n.x, n.y, n.width), e.fillText(i, n.x, n.y, n.width); 10097 }
10098 e.restore(); 10099} 10100var g9 = /* @__PURE__ */ new Set(), f9 = /* @__PURE__ */ new Set([ 10101 "gradient", 10102 // '_datum', 10103 "zIndex", 10104 "clipRect", 10105 "cachedBBox", 10106 "childNodeCounts", 10107 "path", 10108 "__zIndex", 10109 "name", 10110 "__scalingCenterX", 10111 "__scalingCenterY", 10112 "__rotationCenterX", 10113 "__rotationCenterY", 10114 "_previousDatum", 10115 "__fill", 10116 "__lineDash", 10117 "borderPath", 10118 "borderClipPath", 10119 "_clipPath" 10120]); 10121function m9(e) { 10122 const { ...t } = e; 10123 for (const i of Object.keys(t)) 10124 f9.has(i) || typeof t[i] != "number" && typeof t[i] != "string" && typeof t[i] != "boolean" && (g9.add(i), delete t[i]); 10125 return t; 10126} 10127function um(e, t) { 10128 if (!Xt.check( 10129 !0, 10130 "scene" 10131 /* SCENE */ 10132 )) 10133 return {}; 10134 let i = 0; 10135 return { 10136 node: t === "json" ? m9(e) : e, 10137 name: e.name ?? e.id, 10138 dirty: e.dirty, 10139 ...Array.from(e.children(), (s) => um(s, t)).reduce( 10140 (s, n) => { 10141 let { name: o } = n; 10142 const { 10143 node: { visible: r, opacity: a, zIndex: l, translationX: c, translationY: u, rotation: d, scalingX: p, scalingY: f }, 10144 node: m 10145 } = n; 10146 (!r || a <= 0) && (o = `(${o})`), Ye.is(m) && m.renderToOffscreenCanvas && (o = `*${o}*`); 10147 const y = Array.isArray(l) ? `(${l.join(", ")})` : l, b = [ 10148 `${(i++).toString().padStart(3, "0")}|`, 10149 `${o ?? "<unknown>"}`, 10150 `z: ${y}`, 10151 c && `x: ${c}`, 10152 u && `y: ${u}`, 10153 d && `r: ${d}`, 10154 p != null && p !== 1 && `sx: ${p}`, 10155 f != null && f !== 1 && `sy: ${f}` 10156 ].filter((M) => !!M).join(" "); 10157 let C = b, w = 1; 10158 for (; s[C] != null && w < 100; ) 10159 C = `${b} (${w++})`; 10160 return s[C] = n, s; 10161 }, 10162 {} 10163 ) 10164 }; 10165} 10166function GP(e) { 10167 if (!e.dirty) 10168 return { dirtyTree: {}, paths: [] }; 10169 const t = Array.from(e.children(), (n) => GP(n)).filter((n) => n.paths.length > 0), i = Ye.is(e) ? e.name ?? e.id : e.id, s = t.length ? t.flatMap((n) => n.paths).map((n) => `${i}.${n}`) : [i]; 10170 return { 10171 dirtyTree: { 10172 name: i, 10173 node: e, 10174 dirty: e.dirty, 10175 ...t.map((n) => n.dirtyTree).filter((n) => n.dirty != null).reduce((n, o) => (n[o.name ?? "<unknown>"] = o, n), {}) 10176 }, 10177 paths: s 10178 }; 10179} 10180function qb(e, t) { 10181 const i = e + t; 10182 return `${e} / ${i} (${Math.round(100 * e / i)}%)`; 10183} 10184function PI(e, t, i) { 10185 const s = i != null ? i - t : t; 10186 return `${e}: ${Math.round(s * 100) / 100}ms`; 10187} 10188function v9(e, t) { 10189 let i = 0; 10190 for (const s of e) 10191 i += t(s); 10192 return i; 10193} 10194var sy = class { 10195 constructor(e) { 10196 this.debug = Xt.create( 10197 !0, 10198 "scene" 10199 /* SCENE */ 10200 ), this.id = So(this), this.root = null, this.pendingSize = null, this.isDirty = !1, this.canvas = new bx(e), this.layersManager = new c9(this.canvas); 10201 } 10202 get width() { 10203 return this.pendingSize?.[0] ?? this.canvas.width; 10204 } 10205 get height() { 10206 return this.pendingSize?.[1] ?? this.canvas.height; 10207 } 10208 /** @deprecated v10.2.0 Only used by AG Grid Sparklines */ 10209 setContainer(e) { 10210 const { element: t } = this.canvas; 10211 return t.parentElement?.removeChild(t), e.appendChild(t), this; 10212 } 10213 setRoot(e) { 10214 return this.root === e ? this : (this.isDirty = !0, this.root?._setLayerManager(), this.root = e, e && (e.visible = !0, e._setLayerManager(this.layersManager)), this); 10215 } 10216 clear() { 10217 this.canvas.clear(); 10218 } 10219 attachNode(e) { 10220 return this.appendChild(e), () => this.removeChild(e); 10221 } 10222 appendChild(e) { 10223 return this.root?.appendChild(e), this; 10224 } 10225 removeChild(e) { 10226 return this.root?.removeChild(e), this; 10227 } 10228 download(e, t) { 10229 Wk(this.canvas.toDataURL(t), e?.trim() ?? "image"); 10230 } 10231 /** NOTE: Integrated Charts undocumented image download method. */ 10232 getDataURL(e) { 10233 return this.canvas.toDataURL(e); 10234 } 10235 resize(e, t) { 10236 return e = Math.round(e), t = Math.round(t), e > 0 && t > 0 && (e !== this.width || t !== this.height) ? (this.pendingSize = [e, t], this.isDirty = !0, !0) : !1; 10237 } 10238 render(e) { 10239 const { debugSplitTimes: t = { start: performance.now() }, extraDebugStats: i, seriesRect: s } = e ?? {}, { canvas: n, canvas: { context: o } = {}, root: r, pendingSize: a } = this; 10240 if (!o) 10241 return; 10242 const l = performance.now(); 10243 if (a && (this.layersManager.resize(...a), this.pendingSize = null), r && !r.visible) { 10244 this.isDirty = !1; 10245 return; 10246 } 10247 if (r?.dirty === !1 && !this.isDirty) { 10248 this.debug.check() && this.debug("Scene.render() - no-op", { 10249 tree: um(r, "console") 10250 }), kI(this.layersManager, t, o, void 0, i, s); 10251 return; 10252 } 10253 const c = { 10254 ctx: o, 10255 devicePixelRatio: this.canvas.pixelRatio ?? 1, 10256 resized: !!a, 10257 debugNodes: {} 10258 }; 10259 Xt.check( 10260 "scene:stats:verbose" 10261 /* SCENE_STATS_VERBOSE */ 10262 ) && (c.stats = { 10263 layersRendered: 0, 10264 layersSkipped: 0, 10265 nodesRendered: 0, 10266 nodesSkipped: 0, 10267 opsPerformed: 0, 10268 opsSkipped: 0 10269 }), h9(c); 10270 let u = !1; 10271 if (r?.dirty !== !1 && (u = !0, n.clear()), r && Xt.check(
10272 "scene:dirtyTree" 10273 /* SCENE_DIRTY_TREE */ 10274 )) { 10275 const { dirtyTree: d, paths: p } = GP(r); 10276 Xt.create( 10277 "scene:dirtyTree" 10278 /* SCENE_DIRTY_TREE */ 10279 )("Scene.render() - dirtyTree", { dirtyTree: d, paths: p }); 10280 } 10281 if (r && u) { 10282 if (r.visible && r.preRender(), this.debug.check()) { 10283 const d = um(r, "console"); 10284 this.debug("Scene.render() - before", { 10285 canvasCleared: u, 10286 tree: d 10287 }); 10288 } 10289 r.visible && (o.save(), r.render(c), o.restore()); 10290 } 10291 t["âï¸"] = performance.now() - l, o.verifyDepthZero?.(), this.isDirty = !1, kI(this.layersManager, t, o, c.stats, i, s), p9(o, c.debugNodes), r && this.debug.check() && this.debug("Scene.render() - after", { 10292 tree: um(r, "console"), 10293 canvasCleared: u 10294 }); 10295 } 10296 toSVG() { 10297 const { root: e, width: t, height: i } = this; 10298 if (e != null) 10299 return wl.toSVG(e, t, i); 10300 } 10301 /** Alternative to destroy() that preserves re-usable resources. */ 10302 strip() { 10303 const { context: e, pixelRatio: t } = this.canvas; 10304 e.setTransform(t, 0, 0, t, 0, 0), this.layersManager.clear(), this.setRoot(null), this.isDirty = !1; 10305 } 10306 destroy() { 10307 this.strip(), this.canvas.destroy(), Object.assign(this, { canvas: void 0 }); 10308 } 10309}; 10310sy.className = "Scene"; 10311var y9 = class { 10312 constructor() { 10313 this.cache = /* @__PURE__ */ new WeakMap(); 10314 } 10315 call(e, ...t) { 10316 let i, s = this.cache.get(e); 10317 try { 10318 i = JSON.stringify(t); 10319 } catch { 10320 return this.invoke(e, t, s); 10321 } 10322 return s == null && (s = /* @__PURE__ */ new Map(), this.cache.set(e, s)), s.has(i) ? s.get(i) : this.invoke(e, t, s, i); 10323 } 10324 invoke(e, t, i, s) { 10325 try { 10326 const n = e(...t); 10327 return i && s != null && i.set(s, n), n; 10328 } catch (n) { 10329 Ee.warnOnce("User callback errored, ignoring", n); 10330 return; 10331 } 10332 } 10333 invalidateCache() { 10334 this.cache = /* @__PURE__ */ new WeakMap(); 10335 } 10336}, C9 = class extends Ir { 10337 constructor(e) { 10338 super(), this.annotationRoot = e, this.mementoOriginatorKey = "annotations", this.annotations = []; 10339 } 10340 createMemento() { 10341 return this.annotations; 10342 } 10343 guardMemento(e) { 10344 return e == null || hi(e); 10345 } 10346 restoreMemento(e, t, i) { 10347 this.annotations = this.cleanData(i ?? []).map((s) => { 10348 const n = this.getAnnotationTypeStyles(s.type); 10349 return ht(s, n); 10350 }), this.listeners.dispatch("restore-annotations", { 10351 type: "restore-annotations", 10352 annotations: this.annotations 10353 }); 10354 } 10355 updateData(e) { 10356 this.annotations = this.cleanData(e ?? []); 10357 } 10358 attachNode(e) { 10359 return this.annotationRoot.append(e), () => (this.annotationRoot?.removeChild(e), this); 10360 } 10361 setAnnotationStyles(e) { 10362 this.styles = e; 10363 } 10364 getAnnotationTypeStyles(e) { 10365 return this.styles?.[e]; 10366 } 10367 cleanData(e) { 10368 for (const t of e) 10369 "textAlign" in t && delete t.textAlign; 10370 return e; 10371 } 10372}, b9 = class { 10373 constructor(e) { 10374 this.sceneRoot = e, this.axes = /* @__PURE__ */ new Map(), this.axisGridGroup = new Ye({ 10375 name: "Axes-Grids", 10376 zIndex: 1 10377 /* AXIS_GRID */ 10378 }), this.axisGroup = new Ye({ 10379 name: "Axes", 10380 zIndex: 2 10381 /* AXIS */ 10382 }), this.axisLabelGroup = new Ye({ 10383 name: "Axes-Labels", 10384 zIndex: 12 10385 /* SERIES_LABEL */ 10386 }), this.axisCrosslineRangeGroup = new Ye({ 10387 name: "Axes-Crosslines-Range", 10388 zIndex: 3 10389 /* SERIES_CROSSLINE_RANGE */ 10390 }), this.axisCrosslineLineGroup = new Ye({ 10391 name: "Axes-Crosslines-Line", 10392 zIndex: 7 10393 /* SERIES_CROSSLINE_LINE */ 10394 }), this.axisCrosslineLabelGroup = new Ye({ 10395 name: "Axes-Crosslines-Label", 10396 zIndex: 12 10397 /* SERIES_LABEL */ 10398 }), this.sceneRoot.appendChild(this.axisGroup), this.sceneRoot.appendChild(this.axisGridGroup), this.sceneRoot.appendChild(this.axisLabelGroup), this.sceneRoot.appendChild(this.axisCrosslineRangeGroup), this.sceneRoot.appendChild(this.axisCrosslineLineGroup), this.sceneRoot.appendChild(this.axisCrosslineLabelGroup); 10399 } 10400 updateAxes(e, t) { 10401 const i = { 10402 axisNode: this.axisGroup,
10403 gridNode: this.axisGridGroup, 10404 labelNode: this.axisLabelGroup, 10405 crossLineRangeNode: this.axisCrosslineRangeGroup, 10406 crossLineLineNode: this.axisCrosslineLineGroup, 10407 crossLineLabelNode: this.axisCrosslineLabelGroup 10408 }; 10409 for (const s of e) 10410 t.includes(s) || (s.detachAxis(i), s.destroy()); 10411 for (const s of t) 10412 e?.includes(s) || s.attachAxis(i); 10413 this.axes.clear(); 10414 for (const s of t) { 10415 const n = s.createAxisContext(); 10416 this.axes.has(n.direction) ? this.axes.get(n.direction)?.push(n) : this.axes.set(n.direction, [n]); 10417 } 10418 } 10419 getAxisContext(e) { 10420 return this.axes.get(e) ?? []; 10421 } 10422 destroy() { 10423 this.axes.clear(), this.sceneRoot.removeChild(this.axisGroup), this.sceneRoot.removeChild(this.axisGridGroup); 10424 } 10425}, ny = class extends Er { 10426 constructor(e) { 10427 super(), this.animationManager = e, this.dispatchOnlyLatest = !0, this.dispatchThrottle = 0, this.requestThrottle = 300, this.isLoadingInitialData = !1, this.isLoadingData = !1, this.freshRequests = [], this.requestCounter = 0, this.debug = Xt.create(!0, "data-model", "data-source"), this.throttledFetch = this.createThrottledFetch(this.requestThrottle), this.throttledDispatch = this.createThrottledDispatch(this.dispatchThrottle); 10428 } 10429 updateCallback(e) { 10430 typeof e == "function" && (this.debug("DataService - updated data source callback"), this.dataSourceCallback = e, this.isLoadingInitialData = !0, this.animationManager.skip(), this.dispatch("data-source-change")); 10431 } 10432 clearCallback() { 10433 this.dataSourceCallback = void 0; 10434 } 10435 load(e) { 10436 this.isLoadingData = !0, this.throttledFetch(e); 10437 } 10438 isLazy() { 10439 return this.dataSourceCallback != null; 10440 } 10441 isLoading() { 10442 return this.isLazy() && (this.isLoadingInitialData || this.isLoadingData); 10443 } 10444 createThrottledFetch(e) { 10445 return aw( 10446 (t) => this.fetch(t).catch((i) => Ee.error("callback failed", i)), 10447 e, 10448 { 10449 leading: !1, 10450 trailing: !0 10451 } 10452 ); 10453 } 10454 createThrottledDispatch(e) { 10455 return aw( 10456 (t, i) => { 10457 this.debug(`DataService - dispatching 'data-load' | ${t}`), this.dispatch("data-load", { type: "data-load", data: i }); 10458 }, 10459 e, 10460 { 10461 leading: !0, 10462 trailing: !0 10463 } 10464 ); 10465 } 10466 async fetch(e) { 10467 if (!this.dataSourceCallback) 10468 throw new Error("DataService - [dataSource.getData] callback not initialised"); 10469 const t = performance.now(), i = this.requestCounter++; 10470 this.debug(`DataService - requesting | ${i}`), this.freshRequests.push(i); 10471 let s; 10472 try { 10473 s = await this.dataSourceCallback(e), this.debug(`DataService - response | ${performance.now() - t}ms | ${i}`); 10474 } catch (o) { 10475 this.debug(`DataService - request failed | ${i}`), Ee.errorOnce(`DataService - request failed | [${o}]`); 10476 } 10477 this.isLoadingInitialData = !1; 10478 const n = this.freshRequests.findIndex((o) => o === i); 10479 if (n === -1 || this.dispatchOnlyLatest && n !== this.freshRequests.length - 1) { 10480 this.debug(`DataService - discarding stale request | ${i}`); 10481 return; 10482 } 10483 this.freshRequests = this.freshRequests.slice(n + 1), this.freshRequests.length === 0 && (this.isLoadingData = !1), Array.isArray(s) ? this.throttledDispatch(i, s) : this.dispatch("data-error"); 10484 } 10485}; 10486S([ 10487 Un({ 10488 newValue(e) { 10489 this.throttledDispatch = this.createThrottledDispatch(e); 10490 } 10491 }) 10492], ny.prototype, "dispatchThrottle", 2); 10493S([ 10494 Un({ 10495 newValue(e) { 10496 this.throttledFetch = this.createThrottledFetch(e); 10497 } 10498 }) 10499], ny.prototype, "requestThrottle", 2); 10500var FI = class { 10501 constructor(e) { 10502 this.maxAnimationTime = e, this.debug = Xt.create(!0, "animation"), this.controllers = /* @__PURE__ */ new Map(), this.stoppedCbs = /* @__PURE__ */ new Set(), this.currentPhase = 0, this.phases = new Map(Fu.map((t) => [t, []])), this.skipAnimations = !1, this.animationTimeConsumed = 0, this.isReady = !1; 10503 } 10504 get size() { 10505 return this.controllers.size; 10506 } 10507 get consumedTimeMs() { 10508 return this.animationTimeConsumed; 10509 } 10510 isActive() { 10511 return this.controllers.size > 0; 10512 } 10513 getActiveControllers() { 10514 return this.phases.get(Fu[this.currentPhase]) ?? []; 10515 } 10516 checkOverlappingId(e) { 10517 e != null && this.controllers.has(e) && (this.controllers.get(e).stop(), this.debug(`Skipping animation batch due to update of existing animation: ${e}`), this.skip()); 10518 } 10519 addAnimation(e) { 10520 if (e.isComplete) 10521 return; 10522 if (Fu.indexOf(e.phase) < this.currentPhase) { 10523 this.debug("Skipping animation due to being for an earlier phase", e.id), e.stop(); 10524 return; 10525 } 10526 this.controllers.set(e.id, e), this.phases.get(e.phase)?.push(e); 10527 } 10528 removeAnimation(e) { 10529 this.controllers.delete(e.id); 10530 const t = this.phases.get(e.phase), i = t?.indexOf(e); 10531 i != null && i >= 0 && t?.splice(i, 1); 10532 } 10533 progress(e) { 10534 if (!this.isReady) 10535 return; 10536 let t = e === 0 ? 0.01 : e; 10537 const i = () => { 10538 const c = Fu[this.currentPhase]; 10539 return { 10540 phaseControllers: [...this.getActiveControllers()], 10541 phase: c, 10542 phaseMeta: Mp[c] 10543 }; 10544 };
10545 let { phase: s, phaseControllers: n, phaseMeta: o } = i(); 10546 const r = () => Fu[this.currentPhase] == null, a = () => { 10547 for ({ phase: s, phaseControllers: n, phaseMeta: o } = i(); !r() && n.length === 0; ) 10548 this.currentPhase++, { phase: s, phaseControllers: n, phaseMeta: o } = i(), this.debug(`AnimationBatch - phase changing to ${s}`, { unusedTime: t }, n); 10549 }, l = this.controllers.size; 10550 this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${n?.length} of ${l}`); 10551 do { 10552 const c = t, u = o.skipIfNoEarlierAnimations && this.animationTimeConsumed === 0; 10553 let d = 0; 10554 for (const p of n) 10555 u ? p.stop() : t = Math.min(p.update(c), t), p.isComplete && (d++, this.removeAnimation(p)); 10556 this.animationTimeConsumed += c - t, this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`), this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`), a(); 10557 } while (t > 0 && !r()); 10558 this.animationTimeConsumed > this.maxAnimationTime && (this.debug("Animation batch exceeded max animation time, skipping", [...this.controllers]), this.stop()); 10559 } 10560 ready() { 10561 if (this.isReady) 10562 return; 10563 this.isReady = !0, this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`, [...this.controllers]); 10564 let e = !0; 10565 for (const [, t] of this.controllers) 10566 if (t.duration > 0 && Mp[t.phase].skipIfNoEarlierAnimations !== !0) { 10567 e = !1; 10568 break; 10569 } 10570 if (!e) 10571 for (const [, t] of this.controllers) 10572 t.autoplay && t.play(!0); 10573 } 10574 skip(e = !0) { 10575 if (this.skipAnimations === !1 && e === !0) { 10576 for (const t of this.controllers.values()) 10577 t.stop(); 10578 this.controllers.clear(); 10579 } 10580 this.skipAnimations = e; 10581 } 10582 play() { 10583 for (const e of this.controllers.values()) 10584 e.play(); 10585 } 10586 pause() { 10587 for (const e of this.controllers.values()) 10588 e.pause(); 10589 } 10590 stop() { 10591 for (const e of this.controllers.values()) 10592 try { 10593 e.stop(), this.removeAnimation(e); 10594 } catch (t) { 10595 Ee.error("Error during animation stop", t); 10596 } 10597 this.dispatchStopped(); 10598 } 10599 stopByAnimationId(e) { 10600 if (e != null && this.controllers.has(e)) { 10601 const t = this.controllers.get(e); 10602 t && (t.stop(), this.removeAnimation(t)); 10603 } 10604 } 10605 stopByAnimationGroupId(e) { 10606 for (const t of this.controllers.values()) 10607 t.groupId === e && this.stopByAnimationId(t.id); 10608 } 10609 dispatchStopped() { 10610 this.stoppedCbs.forEach((e) => e()), this.stoppedCbs.clear(); 10611 } 10612 isSkipped() { 10613 return this.skipAnimations; 10614 } 10615 destroy() { 10616 this.stop(), this.controllers.clear(); 10617 } 10618}; 10619function mg(e) { 10620 const t = { 10621 ...e, 10622 preventDefault() { 10623 t.sourceEvent?.preventDefault(); 10624 } 10625 }; 10626 return t; 10627} 10628function zP(e, t) { 10629 e.dispatchWrapHandlers(t.type, (i, s) => i(s), mg(t)); 10630} 10631var HP = [ 10632 "click", 10633 "dblclick", 10634 "contextmenu", 10635 "hover", 10636 "leave", 10637 "enter", 10638 "page-left", 10639 "wheel" 10640], w9 = ["keydown", "keyup"], Qb = ["mousemove", "mouseup"], OI = ["pagehide", "mousemove", "mouseup"], NI = [ 10641 "click", 10642 "dblclick", 10643 "contextmenu", 10644 "mousedown", 10645 "mouseleave", 10646 "mouseenter", 10647 "touchstart", 10648 "touchmove", 10649 "touchend", 10650 "touchcancel", 10651 "wheel", 10652 "keydown", 10653 "keyup" 10654]; 10655function S9(e) { 10656 return HP.includes(e); 10657} 10658function x9(e) { 10659 return w9.includes(e); 10660} 10661var VP = class dm extends MP { 10662 constructor(t, i) { 10663 super(), this.keyboardOptions = t, this.domManager = i, this.debug = Xt.create(!0, "interaction"), this.eventHandler = (s) => this.processEvent(s), this.clickHistory = [{ offsetX: NaN, offsetY: NaN, type: "mousedown" }], this.dblclickHistory = [ 10664 { offsetX: NaN, offsetY: NaN, type: "mousedown" }, 10665 { offsetX: NaN, offsetY: NaN, type: "mouseup" }, 10666 { offsetX: NaN, offsetY: NaN, type: "mousedown" } 10667 ], this.stateQueue = 34, this.rootElement = this.domManager.getShadowDocumentRoot(); 10668 for (const s of NI) 10669 s.startsWith("touch") || s === "wheel" ? this.domManager.addEventListener(s, this.eventHandler, { passive: !1 }) : this.domManager.addEventListener(s, this.eventHandler); 10670 for (const s of OI) 10671 pi().addEventListener(s, this.eventHandler); 10672 this.containerChanged(!0), this.domManager.addListener("container-changed", () => this.containerChanged()); 10673 } 10674 containerChanged(t = !1) { 10675 const i = this.domManager.getShadowDocumentRoot(); 10676 if (!(!t && i === this.rootElement)) { 10677 for (const s of Qb) 10678 this.rootElement?.removeEventListener(s, this.eventHandler); 10679 this.rootElement = i, this.debug("[InteractionManager] Switching rootElement to:", this.rootElement); 10680 for (const s of Qb) 10681 this.rootElement?.addEventListener(s, this.eventHandler); 10682 } 10683 } 10684 destroy() { 10685 super.destroy(); 10686 for (const t of OI) 10687 pi().removeEventListener(t, this.eventHandler); 10688 for (const t of Qb) 10689 this.rootElement?.removeEventListener(t, this.eventHandler); 10690 for (const t of NI) 10691 this.domManager.removeEventListener(t, this.eventHandler); 10692 this.domManager.removeStyles("interactionManager"); 10693 } 10694 pushState(t) { 10695 this.stateQueue |= t; 10696 } 10697 popState(t) { 10698 this.stateQueue &= ~t; 10699 } 10700 getState() { 10701 return this.stateQueue & -this.stateQueue; 10702 } 10703 processEvent(t) { 10704 this.debug("Received raw event", t); 10705 let i = this.decideInteractionEventTypes(t); 10706 i != null && !Array.isArray(i) && (i = [i]); 10707 for (const s of i ?? []) 10708 this.dispatchEvent(t, s); 10709 } 10710 dispatchEvent(t, i) { 10711 if (S9(i)) { 10712 this.dispatchPointerEvent(t, i); 10713 return; 10714 } 10715 const { relatedElement: s, targetElement: n } = this.extractElements(t); 10716 if (x9(i)) { 10717 const o = t; 10718 this.dispatchTypedEvent(this.listeners, { type: i, sourceEvent: o, relatedElement: s, targetElement: n }); 10719 } 10720 } 10721 dispatchTypedEvent(t, i) { 10722 const s = mg(i);
10723 this.debug("Dispatching typed event", s, this.getState()), t.dispatchWrapHandlers(i.type, (n, o) => n(o), s); 10724 } 10725 extractElements(t) { 10726 let i, s; 10727 return "relatedTarget" in t && t.relatedTarget instanceof HTMLElement && (i = t.relatedTarget), "target" in t && t.target instanceof HTMLElement && (s = t.target), { relatedElement: i, targetElement: s }; 10728 } 10729 dispatchPointerEvent(t, i) { 10730 const s = this.calculateCoordinates(t); 10731 if (s == null) 10732 return; 10733 const n = this.buildPointerEvent({ type: i, event: t, ...s }); 10734 this.debug("Dispatching pointer event", n, this.getState()), zP(this.listeners, n); 10735 } 10736 getEventHTMLTarget(t) { 10737 if (t.target instanceof HTMLElement) 10738 return t.target; 10739 if (t.currentTarget instanceof HTMLElement) 10740 return t.currentTarget; 10741 } 10742 recordDown(t) { 10743 t instanceof MouseEvent && (tl(["offsetX", "offsetY"], this.clickHistory[0], t), tl(["offsetX", "offsetY"], this.dblclickHistory[2], this.dblclickHistory[0]), tl(["offsetX", "offsetY"], this.dblclickHistory[0], t)); 10744 } 10745 recordUp(t) { 10746 t instanceof MouseEvent && tl(["offsetX", "offsetY"], this.dblclickHistory[1], t); 10747 } 10748 decideInteractionEventTypes(t) { 10749 switch (t.type) { 10750 case "keydown": 10751 case "keyup": 10752 return this.keyboardOptions.enabled ? t.type : void 0; 10753 case "click": 10754 case "dblclick": 10755 return t.type; 10756 case "contextmenu": 10757 case "wheel": 10758 return t.type; 10759 case "touchstart": 10760 case "mousedown": 10761 if (!this.isEventOverElement(t)) 10762 return; 10763 this.recordDown(t); 10764 return; 10765 case "touchmove": 10766 case "mousemove": 10767 return this.isEventOverElement(t) ? "hover" : void 0; 10768 case "mouseup": 10769 case "touchend": 10770 if (!this.isEventOverElement(t)) 10771 return; 10772 this.recordUp(t); 10773 return; 10774 case "mouseleave": 10775 case "touchcancel": 10776 return "leave"; 10777 case "mouseenter": 10778 return "enter"; 10779 case "pagehide": 10780 return "page-left"; 10781 } 10782 } 10783 isEventOverElement(t) { 10784 return t.target instanceof HTMLElement && this.domManager.contains(t.target); 10785 } 10786 calculateCoordinates(t) { 10787 if (t instanceof MouseEvent) 10788 return this.getMouseEventCoords(t); 10789 if (typeof TouchEvent < "u" && t instanceof TouchEvent) { 10790 const i = t.touches[0] ?? t.changedTouches[0], { clientX: s, clientY: n, pageX: o, pageY: r } = i; 10791 return { ...dm.NULL_COORDS, clientX: s, clientY: n, pageX: o, pageY: r }; 10792 } else if (t instanceof PageTransitionEvent) 10793 return t.persisted ? void 0 : dm.NULL_COORDS; 10794 } 10795 getMouseEventCoords(t) { 10796 const { clientX: i, clientY: s, pageX: n, pageY: o } = t; 10797 let { offsetX: r, offsetY: a } = t; 10798 const l = this.getEventHTMLTarget(t), { x: c = 0, y: u = 0 } = l ? this.domManager.calculateCanvasPosition(l) : {}; 10799 return r += c, a += u, { clientX: i, clientY: s, pageX: n, pageY: o, offsetX: r, offsetY: a }; 10800 } 10801 static isWheelEvent(t) { 10802 return t.type === "wheel"; 10803 } 10804 static getWheelDeltas(t) { 10805 let [i, s] = [NaN, NaN]; 10806 if (this.isWheelEvent(t)) { 10807 const n = t.deltaMode === 0 ? 0.01 : 1; 10808 i = t.deltaX * n, s = t.deltaY * n; 10809 } 10810 return { deltaX: i, deltaY: s }; 10811 } 10812 buildPointerEvent(t) { 10813 const { type: i, event: s, clientX: n, clientY: o } = t; 10814 let { offsetX: r, offsetY: a, pageX: l, pageY: c } = t; 10815 if (!kt(r) || !kt(a)) { 10816 const C = this.domManager.getBoundingClientRect(); 10817 r = n - C.left, a = o - C.top; 10818 } 10819 if (!kt(l) || !kt(c)) { 10820 const C = this.rootElement?.getBoundingClientRect(); 10821 l = n - (C?.left ?? 0), c = o - (C?.top ?? 0); 10822 } 10823 const { deltaX: u, deltaY: d } = dm.getWheelDeltas(s); 10824 let p = []; 10825 s.type === "click" ? p = this.clickHistory : s.type === "dblclick" && (p = this.dblclickHistory); 10826 const { relatedElement: f, targetElement: m } = this.extractElements(s), y = "button" in s ? Number(s.button) : 0, b = { 10827 type: i, 10828 offsetX: r, 10829 offsetY: a, 10830 pageX: l, 10831 pageY: c, 10832 deltaX: u, 10833 deltaY: d, 10834 button: y, 10835 pointerHistory: p, 10836 sourceEvent: s, 10837 relatedElement: f, 10838 targetElement: m 10839 }; 10840 return this.debug("InteractionManager - builtEvent: ", b, this.get
10840State()), b; 10841 } 10842}; 10843VP.NULL_COORDS = { 10844 clientX: -1 / 0, 10845 clientY: -1 / 0, 10846 pageX: -1 / 0, 10847 pageY: -1 / 0, 10848 offsetX: -1 / 0, 10849 offsetY: -1 / 0 10850}; 10851var wx = VP; 10852function _I(e) { 10853 return e == null ? !0 : !isNaN(e) && e >= 0 && e <= 2; 10854} 10855var UP = class { 10856 constructor(e, t) { 10857 this.interactionManager = e, this.chartUpdateMutex = t, this.defaultDuration = 1e3, this.batch = new FI(this.defaultDuration * 1.5), this.debug = Xt.create(!0, "animation"), this.events = new SP(), this.rafAvailable = typeof requestAnimationFrame < "u", this.isPlaying = !0, this.requestId = null, this.skipAnimations = !0, this.currentAnonymousAnimationId = 0; 10858 } 10859 addListener(e, t) { 10860 return this.events.on(e, t); 10861 } 10862 /** 10863 * Create an animation to tween a value between the `from` and `to` properties. If an animation already exists 10864 * with the same `id`, immediately stop it. 10865 */ 10866 animate(e) { 10867 const t = this.batch; 10868 try { 10869 t.checkOverlappingId(e.id); 10870 } catch (a) { 10871 this.failsafeOnError(a); 10872 return; 10873 } 10874 let { id: i } = e; 10875 i == null && (i = `__${this.currentAnonymousAnimationId}`, this.currentAnonymousAnimationId += 1); 10876 const s = this.isSkipped() || e.phase === "none"; 10877 s && this.debug("AnimationManager - skipping animation"); 10878 const { delay: n, duration: o } = e; 10879 if (!_I(n)) 10880 throw new Error(`Animation delay of ${n} is unsupported (${i})`); 10881 if (!_I(o)) 10882 throw new Error(`Animation duration of ${o} is unsupported (${i})`); 10883 const r = new ok({ 10884 ...e, 10885 id: i, 10886 skip: s, 10887 autoplay: this.isPlaying ? e.autoplay : !1, 10888 phase: e.phase, 10889 defaultDuration: this.defaultDuration 10890 }); 10891 if (!this.forceTimeJump(r, this.defaultDuration)) 10892 return this.batch.addAnimation(r), r; 10893 } 10894 play() { 10895 if (!this.isPlaying) { 10896 this.isPlaying = !0, this.debug("AnimationManager.play()");
10897 try { 10898 this.batch.play(); 10899 } catch (e) { 10900 this.failsafeOnError(e); 10901 } 10902 this.requestAnimation(); 10903 } 10904 } 10905 pause() { 10906 if (this.isPlaying) { 10907 this.isPlaying = !1, this.cancelAnimation(), this.debug("AnimationManager.pause()"); 10908 try { 10909 this.batch.pause(); 10910 } catch (e) { 10911 this.failsafeOnError(e); 10912 } 10913 } 10914 } 10915 stop() { 10916 this.isPlaying = !1, this.cancelAnimation(), this.debug("AnimationManager.stop()"), this.batch.stop(); 10917 } 10918 stopByAnimationId(e) { 10919 try { 10920 this.batch.stopByAnimationId(e); 10921 } catch (t) { 10922 this.failsafeOnError(t); 10923 } 10924 } 10925 stopByAnimationGroupId(e) { 10926 try { 10927 this.batch.stopByAnimationGroupId(e); 10928 } catch (t) { 10929 this.failsafeOnError(t); 10930 } 10931 } 10932 reset() { 10933 this.isPlaying ? (this.stop(), this.play()) : this.stop(); 10934 } 10935 skip(e = !0) { 10936 this.skipAnimations = e; 10937 } 10938 isSkipped() { 10939 return !this.rafAvailable || this.skipAnimations || this.batch.isSkipped(); 10940 } 10941 isActive() { 10942 return this.isPlaying && this.batch.isActive(); 10943 } 10944 skipCurrentBatch() { 10945 this.debug.check() && this.debug("AnimationManager - skipCurrentBatch()", { stack: new Error().stack }), this.batch.skip(); 10946 } 10947 /** Mocking point for tests to guarantee that animation updates happen. */ 10948 isSkippingFrames() { 10949 return !0; 10950 } 10951 /** Mocking point for tests to capture requestAnimationFrame callbacks. */ 10952 scheduleAnimationFrame(e) { 10953 this.requestId = pi().requestAnimationFrame((t) => { 10954 e(t).catch((i) => Ee.error(i)); 10955 }); 10956 } 10957 /** Mocking point for tests to skip animations to a specific point in time. */ 10958 forceTimeJump(e, t) { 10959 return !1; 10960 } 10961 requestAnimation() { 10962 if (!this.rafAvailable || !this.batch.isActive() || this.requestId !== null) 10963 return; 10964 let e; 10965 const t = async (i) => { 10966 const s = () => { 10967 const n = i - (e ?? i); 10968 e = i, this.debug("AnimationManager - onAnimationFrame()", { 10969 controllersCount: this.batch.size, 10970 deltaTime: n 10971 }), this.interactionManager.pushState( 10972 2 10973 /* Animation */ 10974 ); 10975 try { 10976 this.batch.progress(n); 10977 } catch (o) { 10978 this.failsafeOnError(o); 10979 } 10980 this.events.emit("animation-frame", { 10981 type: "animation-frame", 10982 deltaMs: n 10983 }); 10984 }; 10985 this.isSkippingFrames() ? await this.chartUpdateMutex.acquireImmediately(s) : await this.chartUpdateMutex.acquire(s), this.batch.isActive() ? this.scheduleAnimationFrame(t) : (this.batch.stop(), this.events.emit("animation-stop", { 10986 type: "animation-stop", 10987 deltaMs: this.batch.consumedTimeMs 10988 })); 10989 }; 10990 this.events.emit("animation-start", { 10991 type: "animation-start", 10992 deltaMs: 0 10993 }), this.scheduleAnimationFrame(t); 10994 } 10995 cancelAnimation() { 10996 this.requestId !== null && (cancelAnimationFrame(this.requestId), this.requestId = null, this.startBatch()); 10997 } 10998 failsafeOnError(e, t = !0) { 10999 Ee.error("Error during animation, skipping animations", e), t && this.cancelAnimation(); 11000 } 11001 startBatch(e) { 11002 this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`), this.reset(), this.batch.destroy(), this.batch = new FI(this.defaultDuration * 1.5), e === !0 && this.batch.skip(); 11003 } 11004 endBatch() { 11005 this.batch.isActive() ? (this.batch.ready(), this.requestAnimation()) : (this.interactionManager.popState( 11006 2 11007 /* Animation */ 11008 ), this.batch.isSkipped() && this.batch.skip(!1)); 11009 } 11010 onBatchStop(e) { 11011 this.batch.stoppedCbs.add(e); 11012 } 11013 destroy() { 11014 this.stop(), this.events.clear(); 11015 } 11016}, WP = class extends Ir { 11017 legendItemClick(e, t, i, s, n) { 11018 const o = { 11019 type: "legend-item-click", 11020 legendType: e, 11021 series: t, 11022 itemId: i, 11023 enabled: s, 11024 legendItemName: n 11025 }; 11026 this.listeners.dispatch("legend-item-click", o); 11027 } 11028 legendItemDoubleClick(e, t, i, s, n, o) { 11029 const r = { 11030 type: "legend-item-double-click", 11031 legendType: e, 11032 series: t, 11033 itemId: i, 11034 enabled: s, 11035 legendItemName: o, 11036 numVisibleItems: n 11037 }; 11038 this.listeners.dispatch("legend-item-double-click", r); 11039 } 11040 axisHover(e, t) { 11041 const i = { 11042 type: "axis-hover", 11043 axisId: e, 11044 direction: t 11045 }; 11046 this.listeners.dispatch("axis-hover", i); 11047 } 11048}, jP = class { 11049 constructor() { 11050 this.defaultActions = [], this.disabledActions = /* @__PURE__ */ new Set(), this.hiddenActions = /* @__PURE__ */ new Set(), this.listeners = new Er(); 11051 } 11052 static check(e, t) { 11053 return t.type === e; 11054 } 11055 static checkCallback(e, t, i) { 11056 return e === t; 11057 } 11058 dispatchContext(e, t, i, s) { 11059 const { sourceEvent: n } = t, o = s?.x ?? t.canvasX, r = s?.y ?? t.canvasY; 11060 n.stopPropagation(), this.listeners.dispatch("", mg({ type: e, x: o, y: r, context: i, sourceEvent: n })); 11061 } 11062 addListener(e) { 11063 return this.listeners.addListener("", e); 11064 } 11065 filterActions(e) { 11066 return this.defaultActions.filter((t) => t.id && !this.hiddenActions.has(t.id) && ["all", e].includes(t.type)); 11067 } 11068 registerDefaultAction(e) { 11069 const t = e.id != null && !this.defaultActions.some(({ id: i }) => i === e.id); 11070 return t && this.defaultActions.push(e), () => { 11071 const i = t ? this.defaultActions.findIndex(({ id: s }) => s === e.id) : -1; 11072 i !== -1 && this.defaultActions.splice(i, 1); 11073 }; 11074 } 11075 enableAction(e) { 11076 this.disabledActions.delete(e); 11077 } 11078 disableAction(e) { 11079 this.disabledActions.add(e); 11080 } 11081 showAction(e) { 11082 this.hiddenActions.add(e); 11083 } 11084 hideAction(e) { 11085 this.hiddenActions.delete(e); 11086 } 11087 isDisabled(e) { 11088 return this.disabledActions.has(e); 11089 } 11090}, xd = class extends Map { 11091 constructor(e, t) { 11092 super(), this.defaultValue = e, this.defaultState = t; 11093 } 11094 set(e, t) { 11095 return this.delete(e), typeof t < "u" && super.set(e, t), this; 11096 } 11097 stateId() { 11098 return Array.from(this.keys()).pop() ?? this.defaultState; 11099 } 11100 stateValue() { 11101 return Array.from(this.values()).pop() ?? this.defaultValue; 11102 } 11103}, $P = /* @__PURE__ */ ((e) => (e.Auto = "auto", e.Default = "default", e.Grab = "grab", e.Grabbing = "grabbing", e.Move = "move", e.NotAllowed = "not-allowed", e.Pointer = "pointer", e.EWResize = "ew-resize", e.NSResize = "ns-resize", e.ZoomIn = "zoom-in", e.ZoomOut = "zoom-out", e))($P || {}), YP = class { 11104 constructor(e) { 11105 this.domManager = e, this.stateTracker = new xd("default"); 11106 } 11107 updateCursor(e, t) { 11108 this.stateTracker.set(e, t), this.domManager.updateCursor(this.stateTracker.stateValue()); 11109 } 11110 getCursor() { 11111 return this.domManager.getCursor(); 11112 } 11113}; 11114function M9(e, t) { 11115 const i = e.screenX - t.screenX, s = e.screenY - t.screenY; 11116 return i * i + s * s; 11117} 11118function BI(e, t) { 11119 return Math.sqrt(M9(e, t)); 11120} 11121var A9 = 1, KP = class extends Ir {
11122 constructor(e) { 11123 super(), this.domManager = e, this.touchstart = (t) => this.onTouchStart(t), this.touchmove = (t) => this.onTouchMove(t), this.touchend = (t) => this.onTouchEnd(t), this.touchcancel = (t) => this.onTouchCancel(t), this.pinch = { 11124 finger1: { identifier: NaN, screenX: NaN, screenY: NaN }, 11125 finger2: { identifier: NaN, screenX: NaN, screenY: NaN }, 11126 origin: { x: NaN, y: NaN }, 11127 distance: NaN, 11128 status: 0 11129 /* Off */ 11130 }, this.domManager.addEventListener("touchstart", this.touchstart, { passive: !0 }), this.domManager.addEventListener("touchmove", this.touchmove, { passive: !1 }), this.domManager.addEventListener("touchend", this.touchend), this.domManager.addEventListener("touchcancel", this.touchcancel); 11131 } 11132 destroy() { 11133 this.domManager.removeEventListener("touchstart", this.touchstart), this.domManager.removeEventListener("touchmove", this.touchmove), this.domManager.removeEventListener("touchend", this.touchend), this.domManager.removeEventListener("touchcancel", this.touchcancel); 11134 } 11135 findPinchTouches(e) { 11136 const { touches: t } = e, { finger1: i, finger2: s } = this.pinch; 11137 if (this.pinch.status !== 0 && t.length === 2) { 11138 if (t[0].identifier === i.identifier && t[1].identifier === s.identifier) 11139 return [t[0], t[1]]; 11140 if (t[0].identifier === s.identifier && t[1].identifier === i.identifier) 11141 return [t[1], t[0]]; 11142 } 11143 } 11144 copyTouchData(e) { 11145 const t = ["identifier", "screenX", "screenY"]; 11146 tl(t, this.pinch.finger1, e.touches[0]), tl(t, this.pinch.finger2, e.touches[1]), this.pinch.distance = BI(this.pinch.finger1, this.pinch.finger2); 11147 } 11148 dispatchPinchEvent(e, t, i) { 11149 const { finger1: s, finger2: n, origin: o } = this.pinch; 11150 this.listeners.dispatch(e, mg({ sourceEvent: i, type: e, finger1: s, finger2: n, deltaDistance: t, origin: o })); 11151 } 11152 onTouchStart(e) { 11153 this.stopPinchTracking(e); 11154 const { pinch: t } = this; 11155 e.touches.length === 2 && (t.status = 1, this.copyTouchData(e), t.origin.x = (e.touches[0].clientX + e.touches[1].clientX) / 2, t.origin.y = (e.touches[0].clientY + e.touches[1].clientY) / 2); 11156 } 11157 onTouchMove(e) { 11158 const t = this.findPinchTouches(e); 11159 if (t !== void 0) { 11160 const [i, s] = t, { pinch: n } = this, o = BI(i, s), r = o - n.distance; 11161 n.status === 1 ? Math.abs(r) > A9 && (n.status = 2, this.copyTouchData(e), this.dispatchPinchEvent("pinch-start", 0, e)) : n.status === 2 ? (n.distance = o, this.copyTouchData(e), this.dispatchPinchEvent("pinch-move", r, e)) : Ee.error(`unexpected pinch.status: ${n.status}`); 11162 } 11163 } 11164 onTouchEnd(e) { 11165 this.stopPinchTracking(e); 11166 } 11167 onTouchCancel(e) { 11168 this.stopPinchTracking(e); 11169 } 11170 stopPinchTracking(e) { 11171 const { pinch: t } = this; 11172 t.status === 2 && this.dispatchPinchEvent("pinch-end", 0, e), this.pinch.status = 0; 11173 } 11174}, ZP = class extends Ir { 11175 constructor() { 11176 super(...arguments), this.highlightStates = new xd(); 11177 } 11178 updateHighlight(e, t) { 11179 const { activeHighlight: i } = this; 11180 this.highlightStates.set(e, t), this.activeHighlight = this.highlightStates.stateValue(), this.isEqual(this.activeHighlight, i) || this.listeners.dispatch("highlight-change", { 11181 type: "highlight-change", 11182 currentHighlight: this.activeHighlight, 11183 previousHighlight: i, 11184 callerId: e 11185 }); 11186 } 11187 getActiveHighlight() { 11188 return this.activeHighlight; 11189 } 11190 isEqual(e, t) { 11191 return e === t || e != null && t != null && e?.series === t?.series && e?.itemId === t?.itemId && e?.datum === t?.datum; 11192 } 11193}, qP = class extends MP { 11194 constructor(e, t) { 11195 super(), this.interactionManager = e, this.previousInputDevice = "keyboard"; 11196 const i = t.getRegion("series"), s = 41; 11197 this.destroyFns.push( 11198 e.addListener("hover", () => this.onMouse(), s), 11199 e.addListener("wheel", () => this.onClick(), s), 11200 e.addListener( 11201 "keydown", 11202 (n) => this.onKeyDown(n), 11203 63 11204 /* All */ 11205 ), 11206 i.addListener("click", () => this.onClick(), s), 11207 i.addListener("drag-start", () => this.onClick(), s) 11208 ); 11209 } 11210 getState() { 11211 return this.interactionManager.getState(); 11212 } 11213 destroy() { 11214 super.destroy(); 11215 } 11216 onClick() { 11217 this.focusIndicator?.overrideFocusVisible(!1), this.previousInputDevice = "mouse"; 11218 } 11219 onMouse() { 11220 this.previousInputDevice = "mouse"; 11221 } 11222 onKeyDown(e) {
11223 const t = this.getState(), { key: i, code: s, altKey: n, shiftKey: o, metaKey: r, ctrlKey: a } = e.sourceEvent; 11224 if (a || r) { 11225 if (i === "y" || i === "z" && o) 11226 return this.focusIndicator?.overrideFocusVisible(this.previousInputDevice === "keyboard"), this.dispatch("redo", 0, e); 11227 if (i === "z") 11228 return this.focusIndicator?.overrideFocusVisible(this.previousInputDevice === "keyboard"), this.dispatch("undo", 0, e); 11229 } 11230 if (t & 9) { 11231 this.focusIndicator?.overrideFocusVisible(!1); 11232 return; 11233 } 11234 switch (i) { 11235 case "+": 11236 return this.dispatch("nav-zoom", 1, e); 11237 case "-": 11238 return this.dispatch("nav-zoom", -1, e); 11239 } 11240 if (!(n || o || r || a)) 11241 switch (this.focusIndicator?.overrideFocusVisible(!0), s) { 11242 case "ArrowDown": 11243 return this.dispatch("nav-vert", 1, e); 11244 case "ArrowUp": 11245 return this.dispatch("nav-vert", -1, e); 11246 case "ArrowLeft": 11247 return this.dispatch("nav-hori", -1, e); 11248 case "ArrowRight": 11249 return this.dispatch("nav-hori", 1, e); 11250 case "ZoomIn": 11251 case "Add": 11252 return this.dispatch("nav-zoom", 1, e); 11253 case "ZoomOut": 11254 case "Substract": 11255 return this.dispatch("nav-zoom", -1, e); 11256 case "Space": 11257 case "Enter": 11258 return this.dispatch("submit", 0, e); 11259 } 11260 } 11261 dispatch(e, t, i) { 11262 const { previousInputDevice: s } = this; 11263 zP(this.listeners, { type: e, delta: t, sourceEvent: i, previousInputDevice: s }); 11264 const n = ["redo", "undo", "nav-zoom"]; 11265 i.type === "keydown" && !n.includes(e) && (this.previousInputDevice = "keyboard"); 11266 } 11267}, Xb = class extends Er { 11268}, D9 = 300, E9 = 3; 11269function GI(e, t, i, s, n = 32) { 11270 return e?.addListener(i, (o) => { 11271 t.getState() & n && s(o); 11272 }) ?? (() => { 11273 }); 11274} 11275function I9(e) { 11276 if (e == null || !(e instanceof HTMLElement)) 11277 return; 11278 let t = e; 11279 for (; t != null && !t?.classList.contains("ag-charts-wrapper"); ) { 11280 if (t.classList.contains("ag-charts-tooltip")) 11281 return t; 11282 t = t.parentElement; 11283 } 11284} 11285function R9(e) { 11286 const { sourceEvent: t } = e, { className: i, classList: s, ariaHidden: n } = e.sourceEvent?.target ?? {}; 11287 return i === "ag-charts-proxy-elem" || !(s instanceof DOMTokenList) ? "leave" : ( 11288 // Handle drag event on the axis 'add horizontal line annotation' button as canvas events. 11289 s.contains("ag-charts-annotations__axis-button-icon") || i === "ag-charts-swapchain" || i === "ag-charts-canvas-container" || i === "ag-charts-canvas-proxy" || t?.target instanceof HTMLCanvasElement ? "none" : I9(t.target) && n !== "true" ? "wait" : "leave" 11290 ); 11291} 11292var QP = class { 11293 constructor(e) { 11294 this.interactionManager = e, this.debug = Xt.create(!0, "region"), this.regions = { 11295 root: { properties: { name: "root" }, listeners: new Xb() }, 11296 series: { properties: { name: "series" }, listeners: new Xb() } 11297 }, this.destroyFns = [], this.allRegionsListeners = new Xb(), this.isDragMoving = !1, this.blockNextClickEvent = !1, this.processPointerEvent = (t) => { 11298 const i = R9(t), { current: s } = this; 11299 let n = s; 11300 if (!this.isDragMoving && this.deferredDragStart == null) 11301 switch (i) { 11302 case "wait": 11303 return; 11304 case "none": 11305 n = this.pickRegion(t); 11306 break; 11307 case "leave": 11308 n = void 0; 11309 break; 11310 } 11311 const o = n; 11312 s !== void 0 && o?.properties.name !== s.properties.name && this.dispatch(s, t, "leave"), o !== void 0 && o.properties.name !== s?.properties.name && this.dispatch(n, t, "enter"), o !== void 0 && this.dispatch(n, t), this.current = n; 11313 }; 11314 } 11315 destroy() { 11316 this.destroyFns.forEach((e) => e()), this.current = void 0, this.regions.root.listeners.destroy(), this.regions.series.listeners.destroy(); 11317 } 11318 initRegions(e, t) { 11319 this.regions.root.properties.widget = e, this.regions.series.properties.widget = t, e.addListener("wheel", this.processPointerEvent), e.addListener("contextmenu", this.processPointerEvent), e.addListener("click", this.processPointerEvent), e.addListener("dblclick", this.processPointerEvent), e.addListener("mouseenter", this.processPointerEvent), e.addListener("mousemove", this.processPointerEvent), e.addListener("mouseleave", this.processPointerEvent), e.addListener("drag-start", this.processPointerEvent), e.addListener("drag-move", this.processPointerEvent), e.addListener("drag-end", this.processPointerEvent); 11320 } 11321 getRegion(e) { 11322 return this.makeObserver(this.regions[e]); 11323 } 11324 listenAll(e, t, i = 32) { 11325 return GI(this.allRegionsListeners, this.interactionManager, e, t, i); 11326 } 11327 // This method return a wrapper object that matches the interface of InteractionManager.addListener. 11328 // The intent is to allow the InteractionManager and RegionManager to be used almost interchangeably. 11329 makeObserver(e) { 11330 const { interactionManager: t } = this; 11331 class i { 11332 addListener(n, o, r = 32) { 11333 return GI(e?.listeners, t, n, o, r); 11334 } 11335 } 11336 return new i(); 11337 } 11338 widgetEventTypeToRegionEventType(e, t) { 11339 return t !== void 0 ? t : { 11340 contextmenu: "contextmenu", 11341 click: "click", 11342 dblclick: "dblclick", 11343 mouseenter: "enter", 11344 mousemove: "hover", 11345 mouseleave: "leave", 11346 wheel: "wheel", 11347 "drag-start": "drag-start", 11348 "drag-move": "drag", 11349 "drag-end": "drag-end" 11350 }[e.type]; 11351 } 11352 computeEventOffsets(e, t, i) { 11353 const { deltaX: s, deltaY: n } = wx.getWheelDeltas(i.sourceEvent); 11354 if ("mockRegion" in i.sourceEvent) { 11355 const a = i.sourceEvent.mockRegion; 11356 if (a) 11357 return { deltaX: s, deltaY: n, ...a }; 11358 } 11359 const o = t.getElement().getBoundingClientRect(), r = e.getElement().getBoundingClientRect(); 11360 return { 11361 canvasX: i.clientX - o.x, 11362 canvasY: i.clientY - o.y, 11363 regionX: i.clientX - r.x, 11364 regionY: i.clientY - r.y, 11365 deltaX: s, 11366 deltaY: n 11367 }; 11368 } 11369 // Create and dispatch a copy of the InteractionEvent. 11370 dispatch(e, t, i) { 11371 const { widget: s } = e?.properties ?? {}, { widget: n } = this.regions.root.properties; 11372 if (e == null || s == null || n == null) 11373 return; 11374 const o = mg({ 11375 ...this.computeEventOffsets(s, n, t), 11376 sourceEvent: t.sourceEvent, 11377 type: this.widgetEventTypeToRegionEventType(t, i), 11378 region: e.properties.name, 11379 timestamp: Date.now() 11380 }); 11381 switch (o.type) { 11382 case "drag-start": { 11383 this.deferredDragStart = o; 11384 break; 11385 } 11386 case "drag": { 11387 if (this.deferredDragStart) 11388 if (this.canStartDrag(o)) 11389 this.dispatchEvent(e, this.deferredDragStart); 11390 else 11391 return; 11392 this.dispatchEvent(e, o), this.deferredDragStart = void 0, this.isDragMoving = !0, this.blockNext
11392ClickEvent = !0; 11393 break; 11394 } 11395 case "drag-end": { 11396 this.isDragMoving && this.dispatchEvent(e, o), this.deferredDragStart = void 0, this.isDragMoving = !1; 11397 break; 11398 } 11399 case "click": { 11400 this.blockNextClickEvent || this.dispatchEvent(e, o), this.blockNextClickEvent = !1; 11401 break; 11402 } 11403 case "leave": 11404 case "enter": 11405 (!this.isDragMoving || this.deferredDragStart != null) && this.dispatchEvent(e, o); 11406 break; 11407 case "hover": { 11408 this.blockNextClickEvent = !1, this.dispatchEvent(e, o); 11409 break; 11410 } 11411 default: { 11412 this.dispatchEvent(e, o); 11413 break; 11414 } 11415 } 11416 } 11417 dispatchEvent(e, t) { 11418 this.debug("Dispatching region event: ", t), this.allRegionsListeners.dispatch(t.type, t), e.listeners.dispatch(t.type, t); 11419 } 11420 pickRegion({ sourceEvent: e }) { 11421 return "mockRegion" in e && e.mockRegion ? e.mockRegion.region === "series" ? this.regions.series : this.regions.root : e.target == this.regions.root?.properties.widget?.getElement() ? this.regions.root : this.regions.series; 11422 } 11423 canStartDrag(e) { 11424 return this.deferredDragStart ? e.timestamp - this.deferredDragStart.timestamp > D9 ? !0 : Math.abs(e.canvasX - this.deferredDragStart.canvasX) + Math.abs(e.canvasY - this.deferredDragStart.canvasY) > E9 : !1; 11425 } 11426}; 11427function Sx(e) { 11428 const t = e.yBar?.upperPoint ?? e.midPoint ?? e.series.datumMidPoint?.(e); 11429 if (t) { 11430 const { x: i, y: s } = Ii.toCanvasPoint(e.series.contentGroup, t.x, t.y); 11431 return { canvasX: Math.round(i), canvasY: Math.round(s) }; 11432 } 11433} 11434var Bm = class { 11435 constructor(e, t) { 11436 this.domManager = e, this.tooltip = t, this.stateTracker = new xd(), this.suppressState = new xd(!1), this.appliedState = null, t.setup(e), e.addListener("hidden", () => this.tooltip.hide()); 11437 } 11438 updateTooltip(e, t, i) { 11439 this.tooltip.enabled && (i ?? (i = this.stateTracker.get(e)?.content), this.stateTracker.set(e, { content: i, meta: t }), this.applyStates()); 11440 } 11441 removeTooltip(e) { 11442 this.tooltip.enabled && (this.stateTracker.delete(e), this.applyStates()); 11443 } 11444 suppressTooltip(e) { 11445 this.suppressState.set(e, !0); 11446 } 11447 unsuppressTooltip(e) { 11448 this.suppressState.delete(e); 11449 } 11450 getTooltipMeta(e) { 11451 return this.stateTracker.get(e)?.meta; 11452 } 11453 destroy() { 11454 this.domManager.removeStyles("tooltip"); 11455 } 11456 applyStates() { 11457 const e = this.stateTracker.stateId(), t = e ? this.stateTracker.get(e) : null; 11458 if (this.suppressState.stateValue() || t?.meta == null || t?.content == null) { 11459 this.appliedState = null, this.tooltip.hide(); 11460 return; 11461 } 11462 const i = this.domManager.getBoundingClientRect(), s = this.tooltip.bounds === "extended" ? this.domManager.getOverlayClientRect() : i; 11463 if (this.appliedState?.content === t?.content) { 11464 const n = this.tooltip.isVisible(); 11465 this.tooltip.show(s, i, t?.meta, null, n); 11466 } else 11467 this.tooltip.show(s, i, t?.meta, t?.content); 11468 this.appliedState = t; 11469 } 11470 static makeTooltipMeta(e, t) { 11471 const { canvasX: i, canvasY: s } = e, n = t.series.properties.tooltip, o = { 11472 canvasX: i, 11473 canvasY: s, 11474 enableInteraction: n.interaction?.enabled ?? !1, 11475 lastPointerEvent: { type: e.type, canvasX: i, canvasY: s }, 11476 showArrow: n.showArrow, 11477 position: { 11478 type: n.position.type, 11479 xOffset: n.position.xOffset, 11480 yOffset: n.position.yOffset 11481 } 11482 }, r = Sx(t); 11483 return (n.position.type === "node" || n.position.type === "sparkline") && r ? { ...o, canvasX: r.canvasX, canvasY: r.canvasY } : o; 11484 } 11485}, bw = { 11486 bottomCenter: F9, 11487 center: P9, 11488 clone: B9, 11489 end: L9, 11490 from: G9, 11491 height: N9, 11492 round: _9, 11493 start: T9, 11494 topCenter: k9, 11495 origin: z9, 11496 width: O9 11497}; 11498function T9(e) { 11499 return { x: e.x1, y: e.y1 }; 11500} 11501function L9(e) { 11502 return { x: e.x2, y: e.y2 }; 11503} 11504function k9(e) { 11505 return { x: (e.x1 + e.x2) / 2, y: Math.min(e.y1, e.y2) }; 11506} 11507function P9(e) { 11508 return { x: (e.x1 + e.x2) / 2, y: (e.y1 + e.y2) / 2 }; 11509} 11510function F9(e) { 11511 return { x: (e.x1 + e.x2) / 2, y: Math.max(e.y1, e.y2) }; 11512} 11513function O9(e) { 11514 return Math.abs(e.x2 - e.x1); 11515} 11516function N9(e) { 11517 return Math.abs(e.y2 - e.y1); 11518} 11519function _9(e) { 11520 return { x1: Math.round(e.x1), y1: Math.round(e.y1), x2: Math.round(e.x2), y2: Math.round(e.y2) }; 11521} 11522function B9(e) { 11523 return { x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2 }; 11524} 11525function G9(e, t, i, s) { 11526 if (typeof e == "number") 11527 return { x1: e, y1: t, x2: i, y2: s }; 11528 if ("width" in e) 11529 return { 11530 x1: e.x, 11531 y1: e.y, 11532 x2: e.x + e.width, 11533 y2: e.y + e.height 11534 }; 11535 throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`); 11536} 11537function z9() { 11538 return { x1: 0, y1: 0, x2: 0, y2: 0 }; 11539} 11540function Ef(e, t, i, s, n) { 11541 return t + (s - t) * ((n - e) / (i - e)); 11542} 11543function zI(e, t, i, s, n) { 11544 return e + (n - t) * ((i - e) / (s - t)); 11545} 11546function HI(e, t, i) { 11547 return [ 11548 zI(e, i.min, t, i.max, 0),
11549 zI(e, i.min, t, i.max, 1) 11550 ]; 11551} 11552function H9(e, t, i) { 11553 const [s, n] = HI(e.x1, e.x2, t), [o, r] = HI(e.y1, e.y2, i); 11554 return { x1: s, x2: n, y1: o, y2: r }; 11555} 11556function VI(e, t, i, s, n, o) { 11557 if (i <= n && o <= s) 11558 return i; 11559 const r = n - i, a = o - s, l = Math.abs(r) < Math.abs(a) ? r : a; 11560 return ot(e, i + l, t); 11561} 11562function V9(e, t, i) { 11563 const { x: s = { min: 0, max: 1 }, y: n = { min: 0, max: 1 } } = t, o = bw.from(i), r = bw.from(e), a = H9(r, s, n), l = VI(a.x1, a.x2, r.x1, r.x2, o.x1, o.x2), c = VI(a.y1, a.y2, r.y1, r.y2, o.y1, o.y2); 11564 return { 11565 x: { 11566 min: Ef(r.x1, s.min, r.x2, s.max, l), 11567 max: Ef(r.x1, s.min, r.x2, s.max, l + e.width) 11568 }, 11569 y: { 11570 min: Ef(r.y1, n.min, r.y2, n.max, c), 11571 max: Ef(r.y1, n.min, r.y2, n.max, c + e.height) 11572 } 11573 }; 11574} 11575var U9 = ["rangeX", "rangeY", "ratioX", "ratioY", "autoScaleYAxis"], W9 = class { 11576 constructor() { 11577 this.enabled = !1, this.padding = 0, this.manuallyAdjusted = !1; 11578 } 11579}, XP = class extends Ir { 11580 constructor() { 11581 super(...arguments), this.mementoOriginatorKey = "zoom", this.axisZoomManagers = /* @__PURE__ */ new Map(), this.state = new xd(void 0, "initial"), this.axes = [], this.didLayoutAxes = !1, this.autoScaleYAxis = new W9(), this.lastRestoredState = void 0, this.independentAxes = !1, this.navigatorModule = !1, this.zoomModule = !1, this.pendingMemento = void 0; 11582 } 11583 addLayoutListeners(e) { 11584 this.destroyFns.push( 11585 e.addListener("layout:complete", () => { 11586 const { pendingMemento: t } = this, i = !this.didLayoutAxes; 11587 this.didLayoutAxes = !0, t ? this.restoreMemento(t.version, t.mementoVersion, t.memento) : i && this.autoScaleYZoom("zoom-manager"); 11588 }) 11589 ); 11590 } 11591 createMemento() { 11592 const e = this.getDefinedZoom(), t = { 11593 rangeX: this.getRangeDirection( 11594 e.x, 11595 "x" 11596 /* X */ 11597 ), 11598 rangeY: this.getRangeDirection( 11599 e.y, 11600 "y" 11601 /* Y */ 11602 ), 11603 ratioX: { start: e.x.min, end: e.x.max }, 11604 ratioY: { start: e.y.min, end: e.y.max } 11605 }; 11606 return this.autoScaleYAxis.enabled && (t.autoScaleYAxis = !this.autoScaleYAxis.manuallyAdjusted), t; 11607 } 11608 guardMemento(e) { 11609 if (e == null) 11610 return !0; 11611 if (!Qs(e)) 11612 return !1; 11613 for (const t of Object.keys(e)) 11614 if (!BS(U9, t)) 11615 return !1; 11616 return !0; 11617 } 11618 restoreMemento(e, t, i) { 11619 const { independentAxes: s } = this; 11620 if (!this.axes || !this.didLayoutAxes) { 11621 this.pendingMemento = { version: e, mementoVersion: t, memento: i }; 11622 return; 11623 } 11624 this.pendingMemento = void 0; 11625 const n = this.getDefinedZoom(); 11626 if (i?.rangeX ? n.x = this.rangeToRatio( 11627 i.rangeX, 11628 "x" 11629 /* X */ 11630 ) ?? { min: 0, max: 1 } : i?.ratioX ? n.x = { 11631 min: i.ratioX.start ?? 0, 11632 max: i.ratioX.end ?? 1 11633 } : n.x = { min: 0, max: 1 }, (!this.navigatorModule || this.zoomModule) && (i?.rangeY ? n.y = this.rangeToRatio( 11634 i.rangeY, 11635 "y" 11636 /* Y */ 11637 ) ?? { min: 0, max: 1 } : i?.ratioY ? n.y = { 11638 min: i.ratioY.start ?? 0, 11639 max: i.ratioY.end ?? 1 11640 } : n.y = { min: 0, max: 1 }), i?.autoScaleYAxis != null && (this.autoScaleYAxis.manuallyAdjusted = !i.autoScaleYAxis), this.lastRestoredState = n, s !== !0) { 11641 this.updateZoom("zoom-manager", n); 11642 return; 11643 } 11644 const o = this.getPrimaryAxis( 11645 "x" 11646 /* X */ 11647 ), r = this.getPrimaryAxis( 11648 "y" 11649 /* Y */ 11650 ); 11651 for (const a of [o, r]) 11652 a && this.updateAxisZoom("zoom-manager", a.id, n[a.direction]); 11653 } 11654 updateAxes(e) { 11655 this.axes = e; 11656 const t = new Map(e.map((i) => [i.id, this.axisZoomManagers.get(i.id)])); 11657 this.axisZoomManagers.clear(); 11658 for (const i of e) 11659 this.axisZoomManagers.set(i.id, t.get(i.id) ?? new j9(i)); 11660 this.state.size > 0 && e.length > 0 && this.updateZoom(this.state.stateId(), this.state.stateValue()); 11661 } 11662 setIndependentAxes(e = !0) { 11663 this.independentAxes = e; 11664 } 11665 setAutoScaleYAxis(e, t) { 11666 this.autoScaleYAxis.enabled = e, this.autoScaleYAxis.padding = t; 11667 } 11668 setNavigatorEnabled(e = !0) { 11669 this.navigatorModule = e; 11670 } 11671 setZoomModuleEnabled(e = !0) { 11672 this.zoomModule = e; 11673 } 11674 isZoomEnabled() { 11675 return this.zoomModule; 11676 } 11677 updateZoom(e, t) { 11678 if (this.axisZoomManagers.size === 0) { 11679 const i = this.state.stateId(); 11680 (i === "initial" || i === e) && this.state.set(e, t); 11681 return; 11682 }
11683 this.state.set(e, t), this.axisZoomManagers.forEach((i) => { 11684 i.updateZoom(e, t?.[i.getDirection()]); 11685 }), this.applyChanges(e); 11686 } 11687 updateAxisZoom(e, t, i) { 11688 this.axisZoomManagers.get(t)?.updateZoom(e, i), this.applyChanges(e); 11689 } 11690 resetZoom(e) { 11691 this.autoScaleYAxis.manuallyAdjusted = !1; 11692 const t = this.getRestoredZoom(); 11693 this.updateZoom(e, { 11694 x: { min: t?.x?.min ?? 0, max: t?.x?.max ?? 1 }, 11695 y: { min: t?.y?.min ?? 0, max: t?.y?.max ?? 1 } 11696 }); 11697 } 11698 resetAxisZoom(e, t) { 11699 const s = this.axisZoomManagers.get(t)?.getDirection(); 11700 s != null && (s === "y" && (this.autoScaleYAxis.manuallyAdjusted = !1), this.updateAxisZoom(e, t, this.getRestoredZoom()?.[s] ?? { min: 0, max: 1 })); 11701 } 11702 setAxisManuallyAdjusted(e, t) { 11703 this.axisZoomManagers.get(t)?.getDirection() === "y" && (this.autoScaleYAxis.manuallyAdjusted = !0); 11704 } 11705 updatePrimaryAxisZoom(e, t, i) { 11706 const s = this.getPrimaryAxis(t); 11707 s && this.updateAxisZoom(e, s.id, i); 11708 } 11709 panToBBox(e, t, i) { 11710 const s = this.getZoom(); 11711 if (s === void 0 || !s.x && !s.y) 11712 return; 11713 if (!(t.width > 0 && t.height > 0 && Math.abs(i.width) <= Math.abs(t.width) && Math.abs(i.height) <= Math.abs(t.height))) { 11714 Ee.warnOnce("cannot pan to target BBox - chart too small?"); 11715 return; 11716 } 11717 const o = V9(t, s, i); 11718 this.independentAxes ? (this.updatePrimaryAxisZoom(e, "x", o.x), this.updatePrimaryAxisZoom(e, "y", o.y)) : this.updateZoom(e, o); 11719 } 11720 // Fire this event to signal to listeners that the view is changing through a zoom and/or pan change. 11721 fireZoomPanStartEvent(e) { 11722 this.listeners.dispatch("zoom-pan-start", { type: "zoom-pan-start", callerId: e }); 11723 } 11724 extendToEnd(e, t, i) { 11725 return this.extendWith(e, t, (s) => Number(s) - i); 11726 } 11727 extendWith(e, t, i) { 11728 const s = this.getPrimaryAxis(t); 11729 if (!s) 11730 return; 11731 const n = this.getDomainExtents(s); 11732 if (!n) 11733 return; 11734 const [, o] = n, r = i(o), a = this.rangeToRatio({ start: r, end: o }, t); 11735 a && this.updateZoom(e, { [t]: a }); 11736 } 11737 updateWith(e, t, i) { 11738 const s = this.getPrimaryAxis(t); 11739 if (!s) 11740 return; 11741 const n = this.getDomainExtents(s); 11742 if (!n) 11743 return; 11744 let [o, r] = n; 11745 [o, r] = i(o, r); 11746 const a = this.rangeToRatio({ start: o, end: r }, t); 11747 a && this.updateZoom(e, { [t]: a }); 11748 } 11749 getZoom() { 11750 let e, t; 11751 if (this.axisZoomManagers.forEach((i) => { 11752 i.getDirection() === "x" ? e ?? (e = i.getZoom()) : i.getDirection() === "y" && (t ?? (t = i.getZoom())); 11753 }), e || t) 11754 return { x: e, y: t }; 11755 } 11756 getAxisZoom(e) { 11757 return this.axisZoomManagers.get(e)?.getZoom() ?? { min: 0, max: 1 }; 11758 } 11759 getAxisZooms() { 11760 const e = {}; 11761 for (const [t, i] of this.axisZoomManagers.entries()) 11762 e[t] = { 11763 direction: i.getDirection(), 11764 zoom: i.getZoom() 11765 }; 11766 return e; 11767 } 11768 getRestoredZoom() { 11769 return this.lastRestoredState; 11770 } 11771 autoScaleYZoom(e, t = !0) { 11772 const { independentAxes: i, autoScaleYAxis: s } = this, n = this.getZoom(); 11773 if (n?.x == null || !s.enabled || s.manuallyAdjusted) 11774 return; 11775 const { padding: o } = s, r = i ? this.primaryAxisZoom("y", n.x, { padding: o }) : this.combinedAxisZoom("y", n.x, { padding: o }); 11776 if (r != null) { 11777 if (i) { 11778 const a = this.getPrimaryAxis( 11779 "y" 11780 /* Y */ 11781 ); 11782 (a == null ? void 0 : this.axisZoomManagers.get(a.id))?.updateZoom("zoom-manager", r); 11783 } else 11784 for (const a of this.axisZoomManagers.values()) 11785 a.getDirection() === "y" && a.updateZoom("zoom-manager", r); 11786 t && this.applyChanges(e); 11787 } 11788 } 11789 applyChanges(e) { 11790 if (this.autoScaleYZoom(e, !1), !Array.from(this.axisZoomManagers.values(), (s) => s.applyChanges()).includes(!0)) 11791 return; 11792 const i = {}; 11793 for (const [s, n] of this.axisZoomManagers.entries()) 11794 i[s] = n.getZoom(); 11795 this.listeners.dispatch("zoom-change", { type: "zoom-change", ...this.getZoom(), axes: i, callerId: e }); 11796 } 11797 getRangeDirection(e, t) { 11798 const i = this.getPrimaryAxis(t); 11799 if (!i || !ti.is(i.scale) && !Oo.is(i.scale)) 11800 return; 11801 const s = this.getDomainPixelExtents(i); 11802 if (!s) 11803 return; 11804 const [n, o] = s; 11805 let r, a; 11806 return n <= o ? (r = i.scale.invert?.(0), a = i.scale.invert?.(n + (o
11806- n) * e.max)) : (r = i.scale.invert?.(n - (n - o) * e.min), a = i.scale.invert?.(0)), { start: r, end: a }; 11807 } 11808 rangeToRatio(e, t) { 11809 const i = this.getPrimaryAxis(t); 11810 if (!i) 11811 return; 11812 const s = this.getDomainPixelExtents(i); 11813 if (!s) 11814 return; 11815 const [n, o] = s, r = e.start == null ? n : i.scale.convert?.(e.start), a = e.end == null ? o : i.scale.convert?.(e.end); 11816 if (!kt(r) || !kt(a)) 11817 return; 11818 const l = o - n, c = Math.abs((r - n) / l), u = Math.abs((a - n) / l); 11819 return { min: c, max: u }; 11820 } 11821 getPrimaryAxis(e) { 11822 return this.axes?.find((t) => t.direction === e); 11823 } 11824 getDomainExtents(e) { 11825 const t = e.scale.getDomain?.(), i = t?.at(0), s = t?.at(-1); 11826 if (!(i == null || s == null)) 11827 return [i, s]; 11828 } 11829 getDomainPixelExtents(e) { 11830 const t = e.scale.getDomain?.(), i = e.scale.convert?.(t?.at(0)), s = e.scale.convert?.(t?.at(-1)); 11831 if (!(!kt(i) || !kt(s))) 11832 return [i, s]; 11833 } 11834 getDefinedZoom() { 11835 const e = this.getZoom(); 11836 return { 11837 x: { min: e?.x?.min ?? 0, max: e?.x?.max ?? 1 }, 11838 y: { min: e?.y?.min ?? 0, max: e?.y?.max ?? 1 } 11839 }; 11840 } 11841 zoomBounds(e, t, i, s) { 11842 const n = e.scale, o = n.range; 11843 n.range = [0, 1]; 11844 const [r, a] = Ds(t.scale.domain); 11845 let l = 1, c = !1, u = 0, d = !1; 11846 for (const m of t.boundSeries) { 11847 const [y, b] = m.getRange("y", [i.min, i.max]); 11848 let C = (y - r) / (a - r), w = (b - r) / (a - r); 11849 if ([C, w] = Ds([C, w]), !Number.isFinite(C) || !Number.isFinite(w)) 11850 continue; 11851 const { connectsToYAxis: M } = m; 11852 C < l && (l = C, c = !M || y < 0), w > u && (u = w, d = !M || b > 0); 11853 } 11854 n.range = o; 11855 const p = (c ? s : 0) + (d ? s : 0), f = (u - l) * (1 + p); 11856 if (!(f <= 0 || f >= 1)) { 11857 if (c && d) { 11858 const m = (u + l) / 2; 11859 l = m - f / 2, u = m + f / 2; 11860 } else !c && d ? u = l + f : c && !d && (l = u - f); 11861 return l < 0 ? (u += -l, l = 0) : u > 1 && (l -= u - 1, u = 1), { min: l, max: u }; 11862 } 11863 } 11864 primaryAxisZoom(e, t, { padding: i = 0 } = {}) { 11865 const s = e === "x" ? "y" : "x", n = this.getPrimaryAxis(s), o = this.getPrimaryAxis(e); 11866 if (!(n == null || o == null)) 11867 return this.zoomBounds(n, o, t, i); 11868 } 11869 combinedAxisZoom(e, t, { padding: i = 0 } = {}) { 11870 const s = e === "x" ? "y" : "x", n = /* @__PURE__ */ new Map(); 11871 for (const a of this.axes) 11872 if (a.direction === s) 11873 for (const l of a.boundSeries) 11874 n.set(l, a); 11875 let o = 1, r = 0; 11876 for (const a of this.axes) 11877 if (a.direction === e) 11878 for (const l of a.boundSeries) { 11879 const c = n.get(l); 11880 if (c == null) 11881 continue; 11882 const u = this.zoomBounds(c, a, t, i); 11883 if (u == null) 11884 return; 11885 o = Math.min(o, u.min), r = Math.max(r, u.max); 11886 } 11887 if (!(o > r)) 11888 return { min: o, max: r }; 11889 } 11890}, j9 = class { 11891 constructor(e) { 11892 this.axis = e; 11893 const [t = 0, i = 1] = e.visibleRange; 11894 this.state = new xd({ min: t, max: i }), this.currentZoom = this.state.stateValue(); 11895 } 11896 getDirection() { 11897 return this.axis.direction; 11898 } 11899 updateZoom(e, t) { 11900 this.state.set(e, t); 11901 } 11902 getZoom() { 11903 return As(this.state.stateValue()); 11904 } 11905 hasChanges() { 11906 const e = this.currentZoom, t = this.state.stateValue(); 11907 return e.min !== t.min || e.max !== t.max; 11908 } 11909 applyChanges() { 11910 const e = this.hasChanges(); 11911 return this.currentZoom = this.state.stateValue(), e; 11912 } 11913}, $9 = class { 11914 constructor() { 11915 this.labelData = /* @__PURE__ */ new Map(); 11916 } 11917 updateLabels(e, t, i = _e.zero) { 11918 const s = { 11919 x: -t.left, 11920 y: -t.top, 11921 width: i.width + t.left + t.right, 11922 height: i.height + t.top + t.bottom 11923 }, n = new Set(e.map((r) => r.id)); 11924 for (const r of this.labelData.keys()) 11925 n.has(r) || this.labelData.delete(r); 11926 for (const r of e) { 11927 const a = r.getLabelData(); 11928 a.every(_7) && this.labelData.set(r.id, a); 11929 } 11930 const o = G7(this.labelData, s, 5); 11931 for (const r of e) 11932 r.updatePlacedLabelData?.(o.get(r.id) ?? []); 11933 } 11934}, Y9 = class extends Ir {
11935 constructor(e) { 11936 super(), this.chartService = e, this.mementoOriginatorKey = "legend", this.legendDataMap = /* @__PURE__ */ new Map(); 11937 } 11938 createMemento() { 11939 return this.getData().filter(({ hideInLegend: e, isFixed: t }) => !e && !t).map(({ enabled: e, seriesId: t, itemId: i, legendItemName: s }) => ({ 11940 visible: e, 11941 seriesId: t, 11942 itemId: i, 11943 legendItemName: s 11944 })); 11945 } 11946 guardMemento(e) { 11947 return e == null || hi(e); 11948 } 11949 restoreMemento(e, t, i) { 11950 i?.forEach((s) => { 11951 const { seriesId: n, data: o } = this.getRestoredData(s) ?? {}; 11952 !n || !o || this.updateData(n, o); 11953 }), this.update(); 11954 } 11955 getRestoredData(e) { 11956 const { seriesId: t, itemId: i, legendItemName: s, visible: n } = e; 11957 if (t) { 11958 const r = (this.legendDataMap.get(t) ?? []).map((a) => { 11959 const l = a.seriesId === t && (!i || a.itemId === i); 11960 return l && a.isFixed && this.warnFixed(a.seriesId, a.itemId), !a.isFixed && l ? { ...a, enabled: n } : a; 11961 }); 11962 return { seriesId: t, data: r }; 11963 } 11964 if (!(i == null && s == null)) 11965 for (const o of this.getData()) { 11966 if (i != null && o.itemId !== i || s != null && o.legendItemName !== s) 11967 continue; 11968 if (o.isFixed) { 11969 this.warnFixed(o.seriesId, i); 11970 return; 11971 } 11972 const r = (this.legendDataMap.get(o.seriesId) ?? []).map( 11973 (a) => a.itemId === i || a.legendItemName === s ? { ...a, enabled: n } : a 11974 ); 11975 return { 11976 seriesId: o.seriesId, 11977 data: r 11978 }; 11979 } 11980 } 11981 warnFixed(e, t) { 11982 Ee.warnOnce( 11983 `The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.` 11984 ); 11985 } 11986 update(e) { 11987 this.listeners.dispatch("legend-change", { 11988 type: "legend-change", 11989 legendData: e ?? this.getData() 11990 }); 11991 } 11992 updateData(e, t = []) { 11993 this.legendDataMap.set(e, t); 11994 } 11995 clearData() { 11996 this.legendDataMap.clear(); 11997 } 11998 toggleItem({ 11999 enabled: e, 12000 seriesId: t, 12001 itemId: i, 12002 legendItemName: s 12003 }) { 12004 if (s) { 12005 this.getData().forEach((a) => { 12006 const l = (this.legendDataMap.get(a.seriesId) ?? []).map( 12007 (c) => c.legendItemName === s ? { ...c, enabled: e } : c 12008 ); 12009 this.updateData(a.seriesId, l); 12010 }); 12011 return; 12012 } 12013 const n = this.getData(t), o = n.length === 1, r = n.map( 12014 (a) => i == null && o || a.itemId === i ? { ...a, enabled: e } : a 12015 ); 12016 this.updateData(t, r); 12017 } 12018 getData(e) { 12019 return e ? this.legendDataMap.get(e) ?? [] : [...this.legendDataMap].reduce( 12020 (t, [i, s]) => t.concat(s), 12021 [] 12022 ); 12023 } 12024 getDatum({ seriesId: e, itemId: t } = {}) { 12025 return this.getData(e).find((i) => i.itemId === t); 12026 } 12027 getSeriesEnabled(e) { 12028 const t = this.getData(e); 12029 if (t.length > 0) 12030 return t.some((i) => i.enabled); 12031 } 12032 getItemEnabled({ seriesId: e, itemId: t } = {}) { 12033 return this.getDatum({ seriesId: e, itemId: t })?.enabled ?? !0; 12034 } 12035}, K9 = class { 12036 constructor() { 12037 this.groups = {}; 12038 } 12039 registerSeries({ internalId: e, seriesGrouping: t, visible: i, type: s }) { 12040 var n; 12041 t && ((n = this.groups)[s] ?? (n[s] = {}), this.groups[s][e] = { grouping: t, visible: i }); 12042 } 12043 updateSeries({ internalId: e, seriesGrouping: t, visible: i, type: s }) { 12044 if (!t) 12045 return; 12046 const n = this.groups[s]?.[e]; 12047 n && (n.grouping = t, n.visible = i); 12048 } 12049 deregisterSeries({ internalId: e, type: t }) { 12050 this.groups[t] && delete this.groups[t][e], this.groups[t] && Object.keys(this.groups[t]).length === 0 && delete this.groups[t]; 12051 } 12052 getVisiblePeerGroupIndex({ type: e, seriesGrouping: t, visible: i }) { 12053 if (!t) 12054 return { visibleGroupCount: i ? 1 : 0, visibleSameStackCount: i ? 1 : 0, index: 0 }; 12055 const s = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(); 12056 for (const r of Object.values(this.groups[e] ?? {})) 12057 r.visible && (s.add(r.grouping.groupIndex), r.grouping.groupIndex === t.groupIndex && n.add(r.grouping.stackIndex)); 12058 const o = Array.from(s); 12059 return o.sort((r, a) => r - a), { 12060 visibleGroupCount: o.length, 12061 visibleSameStackCount: n.size, 12062 index: o.indexOf(t.groupIndex) 12063 }; 12064 } 12065}, np = /* @__PURE__ */ ((e) => (e[e.FULL = 0] = "FULL", e[e.UPDATE_DATA = 1] = "UPDATE_DATA", e[e.PROCESS_DATA = 2] = "PROCESS_DATA", e[e.PERFORM_LAYOUT = 3] = "PERFORM_LAYOUT", e[e.SERIES_UPDATE = 4] = "SERIES_UPDATE", e[e.PRE_SCENE_RENDER = 5] = "PRE_SCENE_RENDER", e[e.SCENE_RENDER = 6] = "SCENE_RENDER", e[e.NONE = 7] = "NONE", e))(np || {}
12065), JP = class extends Er { 12066 constructor(e) { 12067 super(), this.updateCallback = e; 12068 } 12069 update(e = 0, t) { 12070 this.updateCallback(e, t); 12071 } 12072 dispatchUpdateComplete(e) { 12073 this.dispatch("update-complete", { 12074 type: "update-complete", 12075 minRect: e?.minRect, 12076 minVisibleRect: e?.minVisibleRect 12077 }); 12078 } 12079 dispatchPreDomUpdate() { 12080 this.dispatch("pre-dom-update", { type: "pre-dom-update" }); 12081 } 12082 dispatchPreSceneRender(e) { 12083 this.dispatch("pre-scene-render", { type: "pre-scene-render", ...e }); 12084 } 12085}, Z9 = class { 12086 constructor(e, t) { 12087 this.callbackCache = new y9(), this.chartEventManager = new WP(), this.highlightManager = new ZP(), this.layoutManager = new xP(), this.localeManager = new a9(), this.seriesStateManager = new K9(), this.stateManager = new kj(), this.zoomManager = new XP(), this.seriesLabelLayoutManager = new $9(), this.contextModules = []; 12088 const { 12089 scene: i, 12090 root: s, 12091 syncManager: n, 12092 container: o, 12093 updateCallback: r, 12094 updateMutex: a, 12095 pixelRatio: l, 12096 styleContainer: c, 12097 chartType: u 12098 } = t; 12099 this.chartService = e, this.syncManager = n, this.domManager = new LP(o, c); 12100 const d = this.domManager.addChild( 12101 "canvas", 12102 "scene-canvas", 12103 i?.canvas.element 12104 ); 12105 this.scene = i ?? new sy({ pixelRatio: l, canvasElement: d }), this.scene.setRoot(s), this.axisManager = new b9(s), this.legendManager = new Y9(this.chartService), this.annotationManager = new C9(e.annotationRoot), this.chartTypeOriginator = new Tj(e), this.cursorManager = new YP(this.domManager), this.interactionManager = new wx(e.keyboard, this.domManager), this.regionManager = new QP(this.interactionManager), this.keyNavManager = new qP(this.interactionManager, this.regionManager), this.contextMenuRegistry = new jP(), this.gestureDetector = new KP(this.domManager), this.updateService = new JP(r), this.proxyInteractionService = new PP(this.localeManager, this.domManager), this.historyManager = new Lj(this.keyNavManager), this.animationManager = new UP(this.interactionManager, a), this.dataService = new ny(this.animationManager), this.tooltipManager = new Bm(this.domManager, e.tooltip), this.zoomManager.addLayoutListeners(this.layoutManager); 12106 for (const p of fr.byType("context")) { 12107 if (!p.chartTypes.includes(u)) 12108 continue; 12109 const f = p.moduleFactory(this); 12110 this.contextModules.push(f), this[p.contextKey] = f; 12111 } 12112 } 12113 destroy() { 12114 this.animationManager.destroy(), this.highlightManager.destroy(), this.axisManager.destroy(), this.callbackCache.invalidateCache(), this.chartEventManager.destroy(), this.domManager.destroy(), this.highlightManager.destroy(), this.keyNavManager.destroy(), this.regionManager.destroy(), this.interactionManager.destroy(), this.proxyInteractionService.destroy(), this.syncManager.destroy(), this.tooltipManager.destroy(), this.zoomManager.destroy(), this.contextModules.forEach((e) => e.destroy()); 12115 } 12116}, eF = class extends it { 12117 constructor() { 12118 super(...arguments), this.range = "tooltip"; 12119 } 12120}; 12121S([ 12122 D(si(["tooltip", "node"], "a range")) 12123], eF.prototype, "range", 2); 12124function q9(e, t) { 12125 if (e.size !== t.size) 12126 return !1; 12127 for (const i of e) 12128 if (!t.has(i)) 12129 return !1; 12130 return !0; 12131} 12132function Q9(e, t) { 12133 if (e == null || t == null) 12134 return e === t; 12135 if (e.size !== t.size) 12136 return !1; 12137 for (const [i, s] of e) { 12138 const n = t.get(i); 12139 if (n == null || !q9(s, n)) 12140 return !1; 12141 } 12142 return !0; 12143} 12144function X9(e, t) { 12145 if (e.length !== t.length) 12146 return !1; 12147 for (let i = 0; i < e.length; i += 1) { 12148 const { idsMap: s, ...n } = e[i], { idsMap: o, ...r } = t[i]; 12149 if (!kc(n, r) || !Q9(s, o)) 12150 return !1; 12151 } 12152 return !0; 12153} 12154function J9(e, t) { 12155 const { props: i, ...s } = e, { props: n, ...o } = t; 12156 return kc(s, o) && X9(i, n); 12157} 12158function e$(e, t, i, s) { 12159 return t === e.data && ul(i, e.ids) && J9(s, e.opts); 12160} 12161var UI = class tF { 12162 constructor() { 12163 this.domain = /* @__PURE__ */ new Set(); 12164 } 12165 static is(t) { 12166 return t instanceof tF; 12167 } 12168 extend(t) { 12169 this.domain.add(t); 12170 } 12171 getDomain() { 12172 return Array.from(this.domain); 12173 } 12174}, qa = class iF { 12175 constructor() { 12176 this.domain = [1 / 0, -1 / 0]; 12177 } 12178 static is(t) { 12179 return t instanceof iF; 12180 } 12181 static extendDomain(t, i = [1 / 0, -1 / 0]) { 12182 for (const s of t) 12183 typeof s == "number" && (i[0] > s && (i[0] = s), i[1] < s && (i[1] = s)); 12184 return i; 12185 } 12186 extend(t) { 12187 this.domain[0] > t && (this.domain[0] = t), this.domain[1] < t && (this.domain[1] = t); 12188 } 12189 getDomain() { 12190 return [...this.domain]; 12191 } 12192}, Su = 0, xu = 1, nr = 2, t$ = class { 12193 constructor(e) { 12194 const t = e.reduce((o, r) => Math.max(o, r.length), 0);
12195 let s = 1 << 32 - Math.clz32(t); 12196 t === s / 2 && (s = s >>> 1), this.maxLevelSize = s; 12197 const n = new Float64Array((s * 2 - 1) * 2).fill(NaN); 12198 for (const o of e) 12199 for (let r = 0; r < o.length; r += 1) { 12200 const a = Number(o[r]), l = s + r - 1, c = (l * nr | 0) + Su, u = (l * nr | 0) + xu, d = n[c], p = n[u]; 12201 (!Number.isFinite(d) || a < d) && (n[c] = a), (!Number.isFinite(p) || a > p) && (n[u] = a); 12202 } 12203 for (let o = s / 2 | 0; o >= 1; o = o / 2 | 0) { 12204 const r = o - 1 | 0, a = r + o | 0; 12205 for (let l = 0; l < o; l += 1) { 12206 const c = r + l, u = a + l * 2, d = u + 1, p = n[(u * nr | 0) + Su], f = n[(d * nr | 0) + Su]; 12207 n[(c * nr | 0) + Su] = !Number.isFinite(f) || p < f ? p : f; 12208 const m = n[(u * nr | 0) + xu], y = n[(d * nr | 0) + xu]; 12209 n[(c * nr | 0) + xu] = !Number.isFinite(y) || m > y ? m : y; 12210 } 12211 } 12212 this.buffer = n; 12213 } 12214 computeRangeInto(e, t, i, s, n, o, r) { 12215 const a = n + o - 1; 12216 if (a < t || n > i) 12217 return r; 12218 if (n >= t && a <= i) { 12219 const l = e[(s * nr | 0) + Su], c = e[(s * nr | 0) + xu]; 12220 Number.isFinite(l) && (r[0] = Math.min(r[0], l)), Number.isFinite(c) && (r[1] = Math.max(r[1], c)); 12221 } else o > 1 && (s = s * 2 | 0, o = o / 2 | 0, this.computeRangeInto(e, t, i, s + 1 | 0, n, o, r), this.computeRangeInto(e, t, i, s + 2 | 0, n + o, o, r)); 12222 return r; 12223 } 12224 rangeBetween(e, t) { 12225 const { maxLevelSize: i, buffer: s } = this, n = [1 / 0, -1 / 0]; 12226 return this.computeRangeInto(s, e, t, 0, 0, i, n), n; 12227 } 12228 get range() { 12229 const { buffer: e } = this; 12230 return [e[Su], e[xu]]; 12231 } 12232}, WI = /* @__PURE__ */ Symbol("domain-ranges"); 12233function i$(e) { 12234 return e.map((t) => Qs(t) ? JSON.stringify(t) : t).join("-"); 12235} 12236function jI(e) { 12237 return Number.isInteger(e) ? e : Math.abs(e) > 1e4 ? Math.trunc(e) : Math.round(e * 1e4) / 1e4; 12238} 12239function vn(e) { 12240 const t = e?.map(Number); 12241 return t?.every(Number.isFinite) ? t : []; 12242} 12243function xx(e, t) { 12244 return t?.get(e.id) ?? 0; 12245} 12246var Ah = /* @__PURE__ */ Symbol("invalid"); 12247function If(e, t) { 12248 const i = []; 12249 for (let s = 0; s < e; s += 1) 12250 i[s] = t; 12251 return i; 12252} 12253function kp(e, t) { 12254 const i = []; 12255 for (const s of e) { 12256 const n = s[t]; 12257 if (n == null) 12258 return; 12259 i.push(n); 12260 } 12261 return i; 12262} 12263function sF(e) { 12264 const t = []; 12265 let i = 0, s; 12266 const n = new RegExp(`((?:(?:^|\\.)\\s*\\w+|\\[\\s*(?:'(?:[^']|(?<!\\\\)\\\\')*'|"(?:[^"]|(?<!\\\\)\\\\")*"|-?\\d+)\\s*\\])\\s*)`, "g"); 12267 for (; s = n.exec(e); ) { 12268 if (s.index !== i) 12269 return; 12270 i = s.index + s[0].length; 12271 const o = s[1].trim(); 12272 if (o.startsWith(".")) 12273 t.push(o.slice(1).trim()); 12274 else if (o.startsWith("[")) { 12275 const r = o.slice(1, -1).trim(); 12276 r.startsWith("'") ? t.push(r.slice(1, -1).replace(new RegExp("(?<!\\\\)\\\\'", "g"), "'")) : r.startsWith('"') ? t.push(r.slice(1, -1).replace(new RegExp('(?<!\\\\)\\\\"', "g"), '"')) : t.push(r); 12277 } else 12278 t.push(o); 12279 } 12280 if (i === e.length) 12281 return t; 12282} 12283function s$(e) { 12284 return (t) => { 12285 let i = t; 12286 for (const s of e) 12287 i = i[s]; 12288 return i; 12289 }; 12290} 12291var nF = class { 12292 constructor(e, t = "standalone", i = !1) { 12293 this.opts = e, this.mode = t, this.suppressFieldDotNotation = i, this.debug = Xt.create(!0, "data-model"), this.scopeCache = /* @__PURE__ */ new Map(), this.keys = [], this.values = [], this.aggregates = [], this.groupProcessors = [], this.propertyProcessors = [], this.reducers = [], this.processors = []; 12294 let s = !0; 12295 for (const o of e.props) { 12296 if (o.type === "key" && !s) 12297 throw new Error("AG Charts - internal config error: keys must come before values."); 12298 o.type === "value" && s && (s = !1); 12299 } 12300 const n = ({ matchGroupIds: o = [] }) => { 12301 for (const r of o) 12302 if (this.values.every((a) => a.groupId !== r)) 12303 throw new Error( 12304 `AG Charts - internal config error: matchGroupIds properties must match defined groups (${r}).` 12305 ); 12306 }; 12307 for (const o of e.props) 12308 switch (o.type) { 12309 case "key": 12310 this.keys.push({ ...o, index: this.keys.length, missing: /* @__PURE__ */ new Map() }); 12311 break; 12312 case "value": 12313 if (o.property == null) 12314 throw new Error(
12315 `AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify( 12316 o 12317 )}` 12318 ); 12319 this.values.push({ ...o, index: this.values.length, missing: /* @__PURE__ */ new Map() }); 12320 break; 12321 case "aggregate": 12322 n(o), this.aggregates.push({ ...o, index: this.aggregates.length }); 12323 break; 12324 case "group-value-processor": 12325 n(o), this.groupProcessors.push({ ...o, index: this.groupProcessors.length }); 12326 break; 12327 case "property-value-processor": 12328 this.propertyProcessors.push({ ...o, index: this.propertyProcessors.length }); 12329 break; 12330 case "reducer": 12331 this.reducers.push({ ...o, index: this.reducers.length }); 12332 break; 12333 case "processor": 12334 this.processors.push({ ...o, index: this.processors.length }); 12335 break; 12336 } 12337 } 12338 resolveProcessedDataDefById(e, t) { 12339 const i = this.scopeCache.get(e.id)?.get(t); 12340 if (!i) 12341 throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`); 12342 return { index: i.index, def: i }; 12343 } 12344 resolveProcessedDataIndexById(e, t) { 12345 return this.resolveProcessedDataDefById(e, t).index; 12346 } 12347 resolveProcessedDataDefsByIds(e, t) { 12348 return t.map((i) => [i, this.resolveProcessedDataDefById(e, i)]); 12349 } 12350 resolveKeysById(e, t, i) { 12351 const s = this.resolveProcessedDataIndexById(e, t), n = i.keys[s]; 12352 if (n == null) 12353 throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`); 12354 return n; 12355 } 12356 resolveColumnById(e, t, i) { 12357 const s = this.resolveProcessedDataIndexById(e, t), n = i.columns?.[s]; 12358 if (n == null) 12359 throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`); 12360 return n; 12361 } 12362 resolveProcessedDataDefsValues(e, { keys: t, values: i }) { 12363 const s = {}; 12364 for (const [n, { index: o, def: r }] of e) { 12365 const a = r.type === "key" ? t : i; 12366 s[n] = a[o]; 12367 } 12368 return s; 12369 } 12370 getDomain(e, t, i, s) { 12371 return this.getDomainsByType(i ?? "value", s)?.[this.resolveProcessedDataIndexById(e, t)] ?? []; 12372 } 12373 getDomainBetweenRange(e, t, [i, s], n) { 12374 const o = t.map((c) => this.resolveProcessedDataIndexById(e, c)), r = o.join(":"), a = n[WI]; 12375 let l = a.get(r); 12376 if (l == null) { 12377 const c = o.map((u) => n.columns[u]); 12378 l = new t$(c), a.set(r, l); 12379 } 12380 return l.rangeBetween(i, s); 12381 } 12382 getDomainsByType(e, t) { 12383 switch (e) { 12384 case "key": 12385 return t.domain.keys; 12386 case "value": 12387 return t.domain.values; 12388 case "aggregate": 12389 return t.domain.aggValues; 12390 case "group-value-processor": 12391 return t.domain.groups; 12392 default: 12393 return null; 12394 } 12395 } 12396 processData(e, t) { 12397 const { 12398 opts: { groupByKeys: i, groupByFn: s }, 12399 aggregates: n, 12400 groupProcessors: o, 12401 reducers: r, 12402 processors: a, 12403 propertyProcessors: l 12404 } = this, c = performance.now(); 12405 if (i && this.keys.length === 0) 12406 return; 12407 let u = this.extractData(e, t); 12408 i ? u = this.groupData(u) : s && (u = this.groupData(u, s(u))), o.length > 0 && this.postProcessGroups(u), n.length > 0 && this.aggregateData(u), l.length > 0 && this.postProcessProperties(u), r.length > 0 && this.reduceData(u), a.length > 0 && this.postProcessData(u), this.warnDataMissingProperties(e); 12409 const d = performance.now(); 12410 return u.time = d - c, this.debug.check() && n$(u), this.processScopeCache(), u; 12411 } 12412 warnDataMissingProperties(e) { 12413 if (e.length !== 0) 12414 for (const t of vc(this.keys, this.values)) 12415 for (const [i, s] of t.missing) { 12416 if (s < e.length) 12417 continue; 12418 const n = i == null ? "" : ` for ${i}`; 12419 Ee.warnOnce(`the key '${t.property}' was not found in any data element${n}.`); 12420 } 12421 } 12422 processScopeCache() { 12423 this.scopeCache.clear(); 12424 for (const e of vc(this.keys, this.values, this.aggregates)) 12425 if (e.idsMap) 12426 for (const [t, i] of e.idsMap) 12427 for (const s of i) 12428 if (!this.scopeCache.has(t))
12429 this.scopeCache.set(t, /* @__PURE__ */ new Map([[s, e]])); 12430 else { 12431 if (this.scopeCache.get(t)?.has(s)) 12432 throw new Error("duplicate definition ids on the same scope are not allowed."); 12433 this.scopeCache.get(t).set(s, e); 12434 } 12435 } 12436 valueGroupIdxLookup({ matchGroupIds: e }) { 12437 const t = []; 12438 for (const [i, s] of this.values.entries()) 12439 (!e || s.groupId && e.includes(s.groupId)) && t.push(i); 12440 return t; 12441 } 12442 valueIdxLookup(e, t) { 12443 const i = e == null || e.length === 0, s = typeof t == "string" ? t : t.id, n = (r) => { 12444 if (r.idsMap) { 12445 for (const [a, l] of r.idsMap) 12446 if (e?.includes(a) && l.has(s)) 12447 return !0; 12448 } 12449 return !1; 12450 }, o = this.values.reduce((r, a, l) => ((a.scopes == null || i && !a.scopes.length || a.scopes.some((u) => e?.includes(u))) && (a.property === s || a.id === s || n(a)) && r.push(l), r), []); 12451 if (o.length === 0) 12452 throw new Error( 12453 `AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify( 12454 e 12455 )}` 12456 ); 12457 return o; 12458 } 12459 extractData(e, t) { 12460 const { dataDomain: i, processValue: s, scopes: n, allScopesHaveSameDefs: o } = this.initDataDomainProcessor(), r = new Map(t?.map((w) => [w.id, w])), { keys: a, values: l } = this, c = e.length; 12461 let u = 0, d, p; 12462 const f = a.map((w) => { 12463 const { invalidValue: M } = w; 12464 return e.map((A, I) => { 12465 const L = s(w, A, I); 12466 return L !== Ah ? L : (d ?? (d = If(c, !1)), d[I] = !0, p ?? (p = If(c, !1)), p[I] = !0, M); 12467 }); 12468 }); 12469 let m; 12470 const y = (w, M) => { 12471 m ?? (m = /* @__PURE__ */ new Map()); 12472 let A = m.get(w); 12473 A == null && (A = If(c, !1), m.set(w, A)), A[M] = !0, p ?? (p = If(c, !1)), p[M] = !0; 12474 }, b = []; 12475 l.forEach((w) => { 12476 const { invalidValue: M } = w, A = b.length > 0 ? b[b.length - 1] : void 0, I = e.map((L, k) => { 12477 const B = d?.[k] === !0; 12478 let N = A?.[k]; 12479 for (const W of w.scopes ?? n) { 12480 const ue = r.get(W)?.data[k] ?? L; 12481 N = s(w, ue, k, N, W), (B || N === Ah) && y(W, k); 12482 } 12483 return B ? M : N === Ah ? (u += 1, M) : N; 12484 }); 12485 b.push(I); 12486 }); 12487 const C = (w) => { 12488 const M = i.get(w), A = M.getDomain(); 12489 return qa.is(M) && A[0] > A[1] ? [] : A; 12490 }; 12491 return { 12492 type: "ungrouped", 12493 input: { count: e.length }, 12494 rawData: e, 12495 rawDataSources: t != null ? new Map(t.map((w) => [w.id, w.data])) : void 0, 12496 aggregation: void 0, 12497 keys: f, 12498 columns: b, 12499 invalidKeys: d, 12500 invalidDataScopes: m, 12501 invalidData: p, 12502 domain: { 12503 keys: a.map(C), 12504 values: l.map(C) 12505 }, 12506 defs: { 12507 allScopesHaveSameDefs: o, 12508 keys: a, 12509 values: l 12510 }, 12511 partialValidDataCount: u, 12512 time: 0, 12513 [WI]: /* @__PURE__ */ new Map() 12514 }; 12515 } 12516 groupData(e, t) { 12517 const i = /* @__PURE__ */ new Map(), { rawData: s, keys: n, invalidKeys: o, invalidDataScopes: r, invalidData: a } = e; 12518 for (let u = 0; u < s.length; u += 1) { 12519 const d = s[u], p = kp(n, u); 12520 if (p == null || p.length === 0) 12521 continue; 12522 const f = t?.({ 12523 index: u, 12524 keys: p, 12525 values: void 0, 12526 aggValues: void 0, 12527 datum: d, 12528 validScopes: void 0 12529 }) ?? p, m = i$(f); 12530 if (o?.[u] === !0) 12531 continue; 12532 let y; 12533 if (r != null && a?.[u] === !0 && (y = /* @__PURE__ */ new Set(), r.forEach((C, w) => { 12534 C[u] === !1 && y.add(w); 12535 }), y.size === 0)) 12536 continue; 12537 const b = i.get(m); 12538 if (b != null) { 12539 if (b.datumIndices.push(u), y != null && b.validScopes != null) 12540 for (const C of b.validScopes) 12541 y.has(C) || b.validScopes.delete(C); 12542 } else 12543 i.set(m, { 12544 keys: f, 12545 datumIndices: [u], 12546 validScopes: y 12547 }); 12548 } 12549 const l = [], c = []; 12550 for (const { keys: u, datumIndices: d, validScopes: p } of i.values()) 12551 p?.size !== 0 && (l.push(u), c.push({ 12552 datumIndices: d, 12553 keys: u, 12554 aggregation: [], 12555 validScopes: p 12556 })); 12557 return { 12558 ...e, 12559 type: "grouped", 12560 domain: { 12561 ...e.domain, 12562 groups: l 12563 }, 12564 groups: c 12565 }; 12566 } 12567 aggregateData(e) { 12568 const t = this.aggregates.map(() => [1 / 0, -1 / 0]); 12569 e.domain.aggValues = t; 12570 const { keys: i, columns: s, rawData: n } = e; 12571 if (e.type === "ungrouped") { 12572 const o = n.map((r, a) => { 12573 const l = []; 12574 for (const [c, u] of this.aggregates.entries()) { 12575 const d = this.valueGroupIdxLookup(u); 12576 let p = u.groupAggregateFunction?.() ?? [1 / 0, -1 / 0]; 12577 const f = d.map((C) => s[C][a]), m = kp(i, a), y = m != null ? u.aggregateFunction(f, m) : void 0; 12578 y && (p = u.groupAggregateFunction?.(y, p) ?? qa.extendDomain(y, p)); 12579 const b = (u.finalFunction?.(p) ?? p).map( 12580 (C) => jI(C) 12581 ); 12582 l[c] = b, qa.extendDomain(b, t[c]); 12583 } 12584 return l; 12585 }); 12586 e.aggregation = o; 12587 } else 12588 for (const [o, r] of this.aggregates.entries()) { 12589 const a = this.valueGroupIdxLookup(r); 12590 for (const l of e.groups) { 12591 if (l.aggregation ?? (l.aggregation = []), l.validScopes != null) 12592 continue; 12593 const c = l.keys; 12594 let u = r.groupAggregateFunction?.() ?? [1 / 0, -1 / 0]; 12595 for (const p of l.datumIndices) { 12596 const f = a.map((y) => s[y][p]), m = r.aggregateFunction(f, c); 12597 m && (u = r.groupAggregateFunction?.(m, u) ?? qa.extendDomain(m, u)); 12598 } 12599 const d = (r.finalFunction?.(u) ?? u).map( 12600 (p) => jI(p) 12601 ); 12602 l.aggregation[o] = d, qa.extendDomain(d, t[o]); 12603 } 12604 } 12605 } 12606 postProcessGroups(e) { 12607 const { groupProcessors: t } = this, { rawData: i, columns: s, invalidData: n } = e; 12608 for (const o of t) { 12609 const r = this.valueGroupIdxLookup(o), a = o.adjust()(); 12610 for (let l = 0; l < i.length; l += 1) 12611 n?.[l] !== !0 && a(s, r, l); 12612 for (const l of r) { 12613 const u = this.values[l].valueType === "category", d = s[l], p = u ? new UI() : new qa(); 12614 for (let f = 0; f < i.length; f += 1) 12615 n?.[f] !== !0 && p.extend(d[f]); 12616 e.domain.values[l] = p.getDomain(); 12617 } 12618 } 12619 } 12620 postProcessProperties(e) { 12621 for (const { adjust: t, property: i, scopes: s } of this.propertyProcessors)
12622 for (const n of this.valueIdxLookup(s, i)) 12623 t()(e, n); 12624 } 12625 reduceData(e) { 12626 e.reduced ?? (e.reduced = {}); 12627 for (const t of this.reducers) { 12628 const i = t.reducer(); 12629 let s = t.initialValue; 12630 const { rawData: n, keys: o, columns: r } = e; 12631 if (e.type === "grouped") 12632 for (const a of e.groups) 12633 (!a.validScopes || t.scopes?.some((l) => a.validScopes?.has(l))) && (s = i(s, { 12634 index: a.datumIndices, 12635 // Why is flatMap needed? 12636 keys: a.datumIndices.flatMap((l) => o.map((c) => c[l])), 12637 values: a.datumIndices.map((l) => r[l]), 12638 datum: a.datumIndices.map((l) => n[l]) 12639 })); 12640 else 12641 for (let a = 0; a < n.length; a += 1) 12642 s = i(s, { 12643 index: [a], 12644 keys: o.map((l) => l[a]), 12645 values: [r[a]], 12646 datum: [n[a]] 12647 }); 12648 e.reduced[t.property] = s; 12649 } 12650 } 12651 postProcessData(e) { 12652 e.reduced ?? (e.reduced = {}); 12653 for (const t of this.processors) 12654 e.reduced[t.property] = t.calculate( 12655 e, 12656 e.reduced[t.property] 12657 ); 12658 } 12659 initDataDomainProcessor() { 12660 const { keys: e, values: t } = this, i = /* @__PURE__ */ new Set(); 12661 for (const c of t) 12662 if (c.scopes) 12663 for (const u of c.scopes) 12664 i.add(u); 12665 const s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(); 12666 let o = !0; 12667 const r = () => { 12668 for (const c of vc(e, t)) 12669 c.valueType === "category" ? s.set(c, new UI()) : (s.set(c, new qa()), o && (o = (c.scopes ?? []).length === i.size)); 12670 }; 12671 r(); 12672 const a = this.buildAccessors(vc(e, t)); 12673 return { dataDomain: s, processValue: (c, u, d, p, f) => { 12674 let m, y; 12675 if (a.has(c.property)) { 12676 try { 12677 y = a.get(c.property)(u); 12678 } catch { 12679 } 12680 m = y != null; 12681 } else 12682 m = c.property in u, y = m ? u[c.property] : c.missingValue; 12683 c.forceValue != null && (y = m && Pv(y) ? -1 * c.forceValue : c.forceValue, m = !0); 12684 const b = "missingValue" in c; 12685 if (!m && !b) { 12686 const C = c.missing.get(f) ?? 0; 12687 c.missing.set(f, C + 1); 12688 } 12689 if (s.has(c) || r(), m && c.validation?.(y, u, d) === !1) 12690 if ("invalidValue" in c) 12691 y = c.invalidValue; 12692 else 12693 return this.mode !== "integrated" && Ee.warnOnce( 12694 `invalid value of type [${typeof y}] for [${c.scopes} / ${c.id}] ignored:`, 12695 `[${y}]` 12696 ), Ah; 12697 return c.processor && (n.has(c) || n.set(c, c.processor()), y = n.get(c)?.(y, p === Ah ? void 0 : p)), s.get(c)?.extend(y), y; 12698 }, initDataDomain: r, scopes: i, allScopesHaveSameDefs: o }; 12699 } 12700 buildAccessors(e) { 12701 const t = /* @__PURE__ */ new Map(); 12702 if (this.suppressFieldDotNotation) 12703 return t; 12704 for (const i of e) { 12705 if (!(i.property.includes(".") || i.property.includes("["))) 12706 continue; 12707 const n = sF(i.property); 12708 if (n == null) { 12709 Ee.warnOnce("Invalid property path [%s]", i.property); 12710 continue; 12711 } 12712 const o = s$(n); 12713 t.set(i.property, o); 12714 } 12715 return t; 12716 } 12717}; 12718function n$(e) { 12719 const t = (i, s) => { 12720 s.length > 0 && (Ee.log(`DataModel.processData() - ${i}`), Ee.table(s)); 12721 }; 12722 Ee.log("DataModel.processData() - processedData", e), t("Key Domains", e.domain.keys), t("Group Domains", e.domain.groups ?? []), t("Value Domains", e.domain.values), t("Aggregate Domains", e.domain.aggValues ?? []); 12723} 12724var oF = class Yr { 12725 constructor(t, i) { 12726 this.mode = t, this.suppressFieldDotNotation = i, this.debug = Xt.create(!0, "data-model"), this.requested = [], this.status = "setup"; 12727 } 12728 async request(t, i, s) { 12729 if (this.status !== "setup") 12730 throw new Error("AG Charts - data request after data setup phase."); 12731 return new Promise((n, o) => { 12732 this.requested.push({ id: t, opts: s, data: i, resolve: n, reject: o }); 12733 }); 12734 } 12735 execute(t) { 12736 if (this.status !== "setup") 12737 throw new Error("AG Charts - data request after data setup phase."); 12738 this.status = "executed", this.debug("DataController.execute() - requested", this.requested); 12739 const i = this.validateRequests(this.requested); 12740 this.debug("DataController.execute() - validated", i); 12741 const s = this.mergeRequested(i); 12742 this.debug("DataController.execute() - merged", s), this.debug.check() && (pi().processedData = []); 12743 const n = []; 12744 for (const { data: o, ids: r, opts: a, resolves: l, rejects: c } of s) { 12745 const u = t?.find((f) => e$(f, o, r, a)); 12746 let d, p; 12747 if (u == null) 12748 try { 12749 d = new nF(a, this.mode, this.suppressFieldDotNotation), p = d.processData(o, i); 12750 } catch (f) {
12751 c.forEach((m) => m(f)); 12752 continue; 12753 } 12754 else 12755 ({ dataModel: d, processedData: p } = u); 12756 n.push({ opts: a, data: o, ids: r, dataModel: d, processedData: p }), this.debug.check() && pi("processedData").push(p), p?.partialValidDataCount === 0 ? l.forEach( 12757 (f) => f({ 12758 dataModel: d, 12759 processedData: p 12760 }) 12761 ) : p ? this.splitResult(d, p, r, l) : c.forEach((f) => f(new Error("AG Charts - no processed data generated"))); 12762 } 12763 return n; 12764 } 12765 validateRequests(t) { 12766 const i = []; 12767 for (const [s, n] of t.entries()) 12768 s > 0 && n.data.length !== t[0].data.length && n.opts.groupByData === !1 ? n.reject( 12769 new Error("all series[].data arrays must be of the same length and have matching keys.") 12770 ) : i.push(n); 12771 return i; 12772 } 12773 mergeRequested(t) { 12774 const i = []; 12775 for (const s of t) { 12776 const n = i.find(Yr.groupMatch(s)); 12777 n ? n.push(s) : i.push([s]); 12778 } 12779 return i.map(Yr.mergeRequests); 12780 } 12781 splitResult(t, i, s, n) { 12782 for (let o = 0; o < s.length; o++) { 12783 const r = n[o]; 12784 r({ 12785 dataModel: t, 12786 processedData: i 12787 }); 12788 } 12789 } 12790 static groupMatch({ data: t, opts: i }) { 12791 function s(c) { 12792 return c.filter((u) => u.type === "key").map((u) => u.property).join(";"); 12793 } 12794 const { groupByData: n, groupByKeys: o = !1, groupByFn: r, props: a } = i, l = s(a); 12795 return ([c]) => (n === !1 || c.data === t) && (c.opts.groupByKeys ?? !1) === o && c.opts.groupByFn === r && s(c.opts.props) === l; 12796 } 12797 static mergeRequests(t) { 12798 return t.reduce( 12799 (i, { id: s, data: n, resolve: o, reject: r, opts: { props: a, ...l } }) => { 12800 i.ids.push(s), i.rejects.push(r), i.resolves.push(o), i.data ?? (i.data = n), i.opts ?? (i.opts = { ...l, props: [] }); 12801 for (const c of a) { 12802 const u = { ...c, scopes: [s] }; 12803 Yr.createIdsMap(s, u); 12804 const d = i.opts.props.find( 12805 (p) => p.type === u.type && Yr.deepEqual(p, u) 12806 ); 12807 if (!d) { 12808 i.opts.props.push(u); 12809 continue; 12810 } 12811 d.scopes ?? (d.scopes = []), d.scopes.push(...u.scopes ?? []), (d.type === "key" || d.type === "value") && u.idsMap?.size && Yr.mergeIdsMap(u.idsMap, d.idsMap); 12812 } 12813 return i; 12814 }, 12815 { ids: [], rejects: [], resolves: [], data: null, opts: null } 12816 ); 12817 } 12818 static mergeIdsMap(t, i) { 12819 for (const [s, n] of t) { 12820 const o = i.get(s); 12821 if (o == null) 12822 i.set(s, new Set(n)); 12823 else 12824 for (const r of n) 12825 o.add(r); 12826 } 12827 } 12828 static createIdsMap(t, i) { 12829 i.id != null && (i.idsMap ?? (i.idsMap = /* @__PURE__ */ new Map()), i.idsMap.has(t) ? i.idsMap.get(t).add(i.id) : i.idsMap.set(t, /* @__PURE__ */ new Set([i.id]))); 12830 } 12831 static deepEqual(t, i) { 12832 if (t === i) 12833 return !0; 12834 if (t && i && typeof t == "object" && typeof i == "object") { 12835 if (t.constructor !== i.constructor) 12836 return !1; 12837 let s, n; 12838 if (Array.isArray(t)) { 12839 if (n = t.length, n !== i.length) 12840 return !1; 12841 for (s = n - 1; s >= 0; s--) 12842 if (!Yr.deepEqual(t[s], i[s])) 12843 return !1; 12844 return !0; 12845 } 12846 const o = Object.keys(t); 12847 if (n = o.length, n !== Object.keys(i).length) 12848 return !1; 12849 for (s = n - 1; s >= 0; s--) { 12850 const r = o[s]; 12851 if (!Yr.skipKeys.has(r) && (!Object.hasOwn(i, r) || !Yr.deepEqual(t[r], i[r]))) 12852 return !1; 12853 } 12854 return !0; 12855 } 12856 return !1; 12857 } 12858}; 12859oF.skipKeys = /* @__PURE__ */ new Set(["id", "idsMap", "type", "scopes"]); 12860var rF = oF, o$ = class { 12861 constructor() { 12862 this.axesMap = /* @__PURE__ */ new Map(), this.hidden = /* @__PURE__ */ new Set(), this.themeTemplates = /* @__PURE__ */ new Map(); 12863 } 12864 register(e, t) { 12865 this.axesMap.set(e, t.moduleFactory), t.themeTemplate && this.setThemeTemplate(e, t.themeTemplate), t.hidden && this.hidden.add(e); 12866 } 12867 create(e, t) { 12868 const i = this.axesMap.get(e); 12869 if (i) 12870 return i(t); 12871 throw new Error(`AG Charts - unknown axis type: ${e}`); 12872 } 12873 has(e) { 12874 return this.axesMap.has(e); 12875 } 12876 keys() { 12877 return this.axesMap.keys(); 12878 } 12879 publicKeys() { 12880 return [...this.keys()].filter((e) => !this.hidden.has(e)); 12881 } 12882 setThemeTemplate(e, t) { 12883 return this.themeTemplates.set(e, t), this; 12884 } 12885 getThemeTemplate(e) { 12886 return this.themeTemplates.get(e); 12887 } 12888}, ia = new o$(), Hd = [ 12889 { 12890 type: "root", 12891 optionsKey: "animation", 12892 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"] 12893 }, 12894 { type: "root", optionsKey: "annotations", chartTypes: ["cartesian"] }, 12895 { 12896 type: "root", 12897 optionsKey: "background", 12898 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"], 12899 optionsInnerKey: "image" 12900 }, 12901 { 12902 type: "root", 12903 optionsKey: "foreground", 12904 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"], 12905 optionsInnerKey: "image" 12906 }, 12907 { 12908 type: "root", 12909 optionsKey: "chartToolbar", 12910 chartTypes: ["cartesian"] 12911 }, 12912 { 12913 type: "root", 12914 optionsKey: "contextMenu", 12915 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"] 12916 }, 12917 { type: "root", optionsKey: "statusBar", chartTypes: ["cartesian"], identifier: "status-bar" }, 12918 { 12919 type: "root", 12920 optionsKey: "dataSource", 12921 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"] 12922 }, 12923 { type: "root", optionsKey: "sync", chartTypes: ["cartesian"] }, 12924 { type: "root", optionsKey: "zoom", chartTypes: ["cartesian", "topology"] }, 12925 { type: "root", optionsKey: "ranges", chartTypes: ["cartesian"] }, 12926 { 12927 type: "legend", 12928 optionsKey: "gradientLegend", 12929 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"], 12930 identifier: "gradient" 12931 }, 12932 { type: "root", optionsKey: "navigator", chartTypes: ["cartesian"] }, 12933 { type: "axis", optionsKey: "axes[]", chartTypes: ["polar"], identifier: "angle-category" }, 12934 { type: "axis", optionsKey: "axes[]", chartTypes: ["polar"], identifier: "angle-number" }, 12935 { type: "axis", optionsKey: "axes[]", chartTypes: ["polar"], identifier: "radius-category" }, 12936 { type: "axis", optionsKey: "axes[]", chartTypes: ["polar"], identifier: "radius-number" }, 12937 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "bar", community: !0 }, 12938 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "line", community: !0 }, 12939 { type: "axis", optionsKey: "axes[]", chartTypes: ["cartesian"], identifier: "ordinal-time" }, 12940 { type: "axis-option", optionsKey: "crosshair", chartTypes: ["cartesian"] }, 12941 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "box-plot" }, 12942 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "candlestick" }, 12943 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "cone-funnel" }, 12944 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "funnel" }, 12945 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "ohlc" }, 12946 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "heatmap" }, 12947 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "range-area" }, 12948 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "range-bar" }, 12949 { type: "series", optionsKey: "series[]", chartTypes: ["cartesian"], identifier: "waterfall" }, 12950 { type: "series", optionsKey: "series[]", chartTypes: ["polar"], identifier: "nightingale" }, 12951 { type: "series", optionsKey: "series[]", chartTypes: ["polar"], identifier: "radar-area" }, 12952 { type: "series", optionsKey: "series[]", chartTypes: ["polar"], identifier: "radar-line" }, 12953 { type: "series", optionsKey: "series[]", chartTypes: ["polar"], identifier: "radial-bar" }, 12954 { type: "series", optionsKey: "series[]", chartTypes: ["polar"], identifier: "radial-column" }, 12955 { type: "series", optionsKey: "series[]", chartTypes: ["hierarchy"], identifier: "sunburst" }, 12956 { type: "series", optionsKey: "series[]", chartTypes: ["hierarchy"], identifier: "treemap" }, 12957 { type: "series", optionsKey: "series[]", chartTypes: ["topology"], identifier: "map-shape" }, 12958 { type: "series", optionsKey: "series[]", chartTypes: ["topology"], identifier: "map-line" }, 12959 { type: "series", optionsKey: "series[]", chartTypes: ["topology"], identifier: "map-marker" }, 12960 { type: "series", optionsKey: "series[]", chartTypes: ["topology"], identifier: "map-shape-background" }, 12961 { type: "series", optionsKey: "series[]", chartTypes: ["topology"], identifier: "map-line-background" }, 12962 { type: "series", optionsKey: "series[]", chartTypes: ["flow-proportion"], identifier: "chord" }, 12963 { type: "series", optionsKey: "series[]", chartTypes: ["flow-proportion"], identifier: "sankey" }, 12964 { type: "series", optionsKey: "series[]", chartTypes: ["standalone"], identifier: "pyramid" }, 12965 { type: "series", optionsKey: "series[]", chartTypes: ["gauge"], identifier: "linear-gauge" }, 12966 { type: "series", optionsKey: "series[]", chartTypes: ["gauge"], identifier: "radial-gauge" }, 12967 { type: "series-option", optionsKey: "errorBar", chartTypes: ["cartesian"], identifier: "error-bars" }, 12968 { type: "context", contextKey: "sharedToolbar", chartTypes: ["cartesian"] } 12969]; 12970function r$(e) { 12971 return Hd.some((t) => t.type === "series" && t.identifier === e); 12972} 12973function Yc(e) { 12974 return Hd.find((t) => t.type === "series" && t.identifier === e)?.chartTypes; 12975} 12976function a$(e) { 12977 return Yc(e)?.find((i) => i === "cartesian") === "cartesian"; 12978} 12979function l$(e) { 12980 return Yc(e)?.find((i) => i === "polar") === "polar";
12981} 12982function c$(e) { 12983 return Yc(e)?.find((i) => i === "hierarchy") === "hierarchy"; 12984} 12985function u$(e) { 12986 return Yc(e)?.find((i) => i === "topology") === "topology"; 12987} 12988function d$(e) { 12989 return Yc(e)?.find((i) => i === "flow-proportion") === "flow-proportion"; 12990} 12991function h$(e) { 12992 return Yc(e)?.find((i) => i === "standalone") === "standalone"; 12993} 12994function p$(e) { 12995 return Yc(e)?.find((i) => i === "gauge") === "gauge"; 12996} 12997function g$(e) { 12998 return e.packageType === "enterprise"; 12999} 13000function f$(e) { 13001 if (!g$(e)) 13002 throw new Error("AG Charts - internal configuration error, only enterprise modules need verification."); 13003 const t = Hd.find((i) => i.type === e.type && ("optionsKey" in i && "optionsKey" in e ? i.optionsKey === e.optionsKey : !0) && ("contextKey" in i && "contextKey" in e ? i.contextKey === e.contextKey : !0) && i.identifier === e.identifier && e.chartTypes.every((s) => i.chartTypes.includes(s))); 13004 return t && (t.useCount ?? (t.useCount = 0), t.useCount++), t != null; 13005} 13006function m$() { 13007 return Hd.filter(({ useCount: e }) => e == null || e === 0); 13008} 13009var v$ = class { 13010 constructor() { 13011 this.legendMap = /* @__PURE__ */ new Map(), this.themeTemplates = /* @__PURE__ */ new Map(); 13012 } 13013 register(e, { optionsKey: t, moduleFactory: i, themeTemplate: s }) { 13014 this.legendMap.set(e, { optionsKey: t, moduleFactory: i }), this.themeTemplates.set(t, s); 13015 } 13016 create(e, t) { 13017 const i = this.legendMap.get(e)?.moduleFactory; 13018 if (i) 13019 return i(t); 13020 throw new Error(`AG Charts - unknown legend type: ${e}`); 13021 } 13022 getThemeTemplates() { 13023 return Object.fromEntries(this.themeTemplates); 13024 } 13025 getKeys() { 13026 return Array.from(this.legendMap.entries()).reduce( 13027 (e, [t, i]) => (e[t] = i.optionsKey, e), 13028 {} 13029 ); 13030 } 13031}, Mx = new v$(), aF = class extends Map { 13032 get(e) { 13033 return super.get(e) ?? "unknown"; 13034 } 13035 isCartesian(e) { 13036 return this.get(e) === "cartesian"; 13037 } 13038 isPolar(e) { 13039 return this.get(e) === "polar"; 13040 } 13041 isHierarchy(e) { 13042 return this.get(e) === "hierarchy"; 13043 } 13044 isTopology(e) { 13045 return this.get(e) === "topology"; 13046 } 13047 isFlowProportion(e) { 13048 return this.get(e) === "flow-proportion"; 13049 } 13050 isStandalone(e) { 13051 return this.get(e) === "standalone"; 13052 } 13053 isGauge(e) { 13054 return this.get(e) === "gauge"; 13055 } 13056 get seriesTypes() { 13057 return Array.from(this.keys()); 13058 } 13059 get cartesianTypes() { 13060 return this.seriesTypes.filter((e) => this.isCartesian(e)); 13061 } 13062 get polarTypes() { 13063 return this.seriesTypes.filter((e) => this.isPolar(e)); 13064 } 13065 get hierarchyTypes() { 13066 return this.seriesTypes.filter((e) => this.isHierarchy(e)); 13067 } 13068 get topologyTypes() { 13069 return this.seriesTypes.filter((e) => this.isTopology(e)); 13070 } 13071 get flowProportionTypes() { 13072 return this.seriesTypes.filter((e) => this.isFlowProportion(e)); 13073 } 13074 get standaloneTypes() { 13075 return this.seriesTypes.filter((e) => this.isStandalone(e)); 13076 } 13077 get gaugeTypes() { 13078 return this.seriesTypes.filter((e) => this.isGauge(e)); 13079 } 13080}, y$ = class extends Map { 13081 set(e, t) { 13082 return super.set(e, ht(t, this.get(e))); 13083 } 13084}, ci = new aF(), lF = new aF(), ww = new y$(), C$ = class { 13085 constructor() { 13086 this.seriesMap = /* @__PURE__ */ new Map(), this.themeTemplates = /* @__PURE__ */ new Map(); 13087 } 13088 register(e, { 13089 chartTypes: [t], 13090 moduleFactory: i, 13091 tooltipDefaults: s, 13092 defaultAxes: n, 13093 themeTemplate: o, 13094 paletteFactory: r, 13095 solo: a, 13096 stackable: l, 13097 groupable: c, 13098 stackedByDefault: u, 13099 hidden: d 13100 }) { 13101 this.setThemeTemplate(e, o), this.seriesMap.set(e, { 13102 moduleFactory: i, 13103 tooltipDefaults: s, 13104 defaultAxes: n, 13105 paletteFactory: r, 13106 solo: a, 13107 stackable: l, 13108 groupable: c, 13109 stackedByDefault: u 13110 }), ci.set(e, t), d || lF.set(e, t); 13111 } 13112 create(e, t) { 13113 const i = this.seriesMap.get(e)?.moduleFactory; 13114 if (i) 13115 return i(t); 13116 throw new Error(`AG Charts - unknown series type: ${e}`); 13117 } 13118 cloneDefaultAxes(e, t) { 13119 const i = this.seriesMap.get(e)?.defaultAxes; 13120 if (i == null) 13121 return null; 13122 const s = typeof i == "function" ? i(t) : i; 13123 return { axes: As(s) }; 13124 } 13125 setThemeTemplate(e, t) { 13126 const i = this.themeTemplates.get(e); 13127 this.themeTemplates.set(e, ht(t, i)); 13128 } 13129 getThemeTemplate(e) { 13130 return this.themeTemplates.get(e); 13131 } 13132 getPaletteFactory(e) { 13133 return this.seriesMap.get(e)?.paletteFactory; 13134 } 13135 getTooltipDefauls(e) { 13136 return this.seriesMap.get(e)?.tooltipDefaults; 13137 } 13138 isSolo(e) { 13139 return this.seriesMap.get(e)?.solo ?? !1; 13140 } 13141 isGroupable(e) { 13142 return this.seriesMap.get(e)?.groupable ?? !1; 13143 } 13144 isStackable(e) { 13145 return this.seriesMap.get(e)?.stackable ?? !1; 13146 } 13147 isStackedByDefault(e) { 13148 return this.seriesMap.get(e)?.stackedByDefault ?? !1; 13149 } 13150}, Nn = new C$(), Ax = class pc extends Ir {
13151 constructor(t) { 13152 super(), this.chart = t; 13153 } 13154 subscribe(t = pc.DEFAULT_GROUP) { 13155 let i = this.get(t); 13156 return i || (i = /* @__PURE__ */ new Set(), pc.chartsGroups.set(t, i)), i.add(this.chart), this; 13157 } 13158 unsubscribe(t = pc.DEFAULT_GROUP) { 13159 return this.get(t)?.delete(this.chart), this; 13160 } 13161 getChart() { 13162 return this.chart; 13163 } 13164 getGroup(t = pc.DEFAULT_GROUP) { 13165 const i = this.get(t); 13166 return i ? Array.from(i) : []; 13167 } 13168 getGroupSiblings(t = pc.DEFAULT_GROUP) { 13169 return this.getGroup(t).filter((i) => i !== this.chart); 13170 } 13171 get(t) { 13172 return pc.chartsGroups.get(t); 13173 } 13174}; 13175Ax.chartsGroups = /* @__PURE__ */ new Map(); 13176Ax.DEFAULT_GROUP = /* @__PURE__ */ Symbol("sync-group-default"); 13177var b$ = Ax, Dx = class extends it { 13178 constructor() { 13179 super(...arguments), this.enabled = !1; 13180 } 13181}; 13182S([ 13183 D(je) 13184], Dx.prototype, "enabled", 2); 13185S([ 13186 D(At) 13187], Dx.prototype, "tabIndex", 2); 13188var cF = ["top", "right", "bottom", "left"]; 13189function w$(e) { 13190 return typeof e == "string" && cF.includes(e); 13191} 13192function S$(e) { 13193 const t = [], i = [], s = [...cF]; 13194 for (const n of e) 13195 n instanceof Pc && (w$(n.position) ? i.push(n.position) : t.push(n)); 13196 for (const n of t) { 13197 let o; 13198 do 13199 o = s.pop(); 13200 while (o && i.includes(o)); 13201 if (o == null) 13202 break; 13203 n.position = o; 13204 } 13205} 13206var x$ = ["direction", "xKey", "yKey", "sizeKey", "angleKey", "radiusKey", "normalizedTo"]; 13207function M$(e, t, i) { 13208 const s = (c, u, d) => { 13209 const p = [c]; 13210 for (const f of x$) 13211 f in u && u[f] != null && p.push(`${f}=${u[f]}`); 13212 return d?.seriesGrouping && p.push(`seriesGrouping.groupId=${d?.seriesGrouping.groupId}`), p.join(";"); 13213 }, n = /* @__PURE__ */ new Map(); 13214 let o = 0; 13215 for (const c of e) { 13216 const u = s(c.type, c.properties, i?.[o]); 13217 n.has(u) || n.set(u, []), n.get(u)?.push([c, o++]); 13218 } 13219 const r = /* @__PURE__ */ new Map(); 13220 o = 0; 13221 for (const c of t) { 13222 const u = s(c.type, c, c); 13223 r.has(u) || r.set(u, []), r.get(u)?.push([c, o++]); 13224 } 13225 if (![...n.keys()].some((c) => r.has(c))) 13226 return { status: "no-overlap", oldKeys: n.keys(), newKeys: r.keys() }; 13227 const l = []; 13228 for (const [c, u] of r.entries()) 13229 for (const [d, p] of u) { 13230 const f = n.get(c); 13231 if (f == null || f.length < 1) { 13232 l.push({ opts: d, targetIdx: p, idx: p, status: "add" }), n.delete(c); 13233 continue; 13234 } 13235 const [m, y] = f.shift(), b = i?.[y] ?? {}, C = Sr(b, d ?? {}), { groupIndex: w, stackIndex: M } = C?.seriesGrouping ?? {}; 13236 w != null || M != null ? l.push({ 13237 opts: d, 13238 series: m, 13239 diff: C, 13240 targetIdx: p, 13241 idx: y, 13242 status: "series-grouping" 13243 }) : C ? l.push({ 13244 opts: d, 13245 series: m, 13246 diff: C, 13247 targetIdx: p, 13248 idx: y, 13249 status: "update" 13250 }) : l.push({ opts: d, series: m, targetIdx: p, idx: y, status: "no-op" }), f.length === 0 && n.delete(c); 13251 } 13252 for (const c of n.values()) 13253 for (const [u, d] of c) 13254 l.push({ series: u, idx: d, targetIdx: -1, status: "remove" }); 13255 return { status: "overlap", changes: l }; 13256} 13257function Ma(e) { 13258 const { series: t } = e; 13259 if (t) 13260 return t[0]?.type ?? "line"; 13261} 13262function Pp(e) { 13263 const t = Ma(e); 13264 return t == null ? !1 : ci.isCartesian(t) || a$(t); 13265} 13266function oy(e) { 13267 const t = Ma(e); 13268 return t == null ? !1 : ci.isPolar(t) || l$(t); 13269} 13270function Ex(e) { 13271 const t = Ma(e); 13272 return t == null ? !1 : ci.isHierarchy(t) || c$(t); 13273} 13274function Ix(e) { 13275 const t = Ma(e); 13276 return t == null ? !1 : ci.isTopology(t) || u$(t); 13277} 13278function Rx(e) { 13279 const t = Ma(e); 13280 return t == null ? !1 : ci.isFlowProportion(t) || d$(t); 13281} 13282function Gm(e) { 13283 const t = Ma(e); 13284 return t == null ? !1 : ci.isStandalone(t) || h$(t); 13285} 13286function ry(e) { 13287 const t = Ma(e); 13288 return t == null ? !1 : ci.isGauge(t) || p$(t); 13289} 13290function A$(e) { 13291 const t = Ma(e); 13292 return oy(e) && t !== "pie" && t !== "donut"; 13293} 13294function D$(e) { 13295 return e == null ? !1 : ci.has(e); 13296} 13297function E$(e) { 13298 return e == null ? !1 : ia.has(e); 13299} 13300var I$ = class extends YS { 13301 applyOptions(e) { 13302 for (const t of this.moduleMap.values()) 13303 t.module.optionsKey in e && br(t.moduleInstance) && t.moduleInstance.set(e[t.module.optionsKey]); 13304 } 13305 *legends() { 13306 for (const { module: e, moduleInstance: t } of this.moduleMap.values()) 13307 e.type === "legend" && (yield {
13308 legendType: e.identifier, 13309 legend: t 13310 }); 13311 } 13312}, Sw = "ag-charts-overlay", $I = "ag-charts-dark-overlay", yc = class extends it { 13313 constructor(e, t) { 13314 super(), this.className = e, this.defaultMessageId = t, this.enabled = !0; 13315 } 13316 getText(e) { 13317 return e.t(this.text ?? this.defaultMessageId); 13318 } 13319 getElement(e, t, i) { 13320 if (this.content?.remove(), this.focusBox = i, this.renderer) { 13321 const s = this.renderer(); 13322 if (s instanceof HTMLElement) 13323 this.content = s; 13324 else { 13325 const n = Gt("div"); 13326 n.innerHTML = s, this.content = n.firstElementChild; 13327 } 13328 } else { 13329 const s = Gt("div", { 13330 display: "flex", 13331 alignItems: "center", 13332 justifyContent: "center", 13333 boxSizing: "border-box", 13334 height: "100%", 13335 margin: "8px", 13336 font: "12px Verdana, sans-serif" 13337 }); 13338 s.innerText = this.getText(t), this.content = s, e?.animate({ 13339 from: 0, 13340 to: 1, 13341 id: "overlay", 13342 phase: "add", 13343 groupId: "opacity", 13344 onUpdate(n) { 13345 s.style.opacity = String(n); 13346 }, 13347 onStop() { 13348 s.style.opacity = "1"; 13349 } 13350 }); 13351 } 13352 return this.content; 13353 } 13354 removeElement(e = () => this.content?.remove(), t) { 13355 if (this.content) { 13356 if (t) { 13357 const { content: i } = this; 13358 t.animate({ 13359 from: 1, 13360 to: 0, 13361 phase: "remove", 13362 id: "overlay", 13363 groupId: "opacity", 13364 onUpdate(s) { 13365 i.style.opacity = String(s); 13366 }, 13367 onStop() { 13368 e?.(); 13369 } 13370 }); 13371 } else 13372 e?.(); 13373 this.content = void 0, this.focusBox = void 0; 13374 } 13375 } 13376}; 13377S([ 13378 D(je) 13379], yc.prototype, "enabled", 2); 13380S([ 13381 D(Me, { optional: !0 }) 13382], yc.prototype, "text", 2); 13383S([ 13384 D(tn, { optional: !0 }) 13385], yc.prototype, "renderer", 2); 13386var Vd = class extends it { 13387 constructor() { 13388 super(...arguments), this.darkTheme = !1, this.loading = new yc("ag-charts-loading-overlay", "overlayLoadingData"), this.noData = new yc("ag-charts-no-data-overlay", "overlayNoData"), this.noVisibleSeries = new yc("ag-charts-no-visible-series", "overlayNoVisibleSeries"), this.unsupportedBrowser = new yc("ag-charts-unsupported-browser", "overlayUnsupportedBrowser"); 13389 } 13390 getFocusInfo(e) { 13391 for (const t of [this.loading, this.noData, this.noVisibleSeries, this.unsupportedBrowser]) 13392 if (t.focusBox !== void 0) 13393 return { text: t.getText(e), rect: t.focusBox }; 13394 } 13395 destroy() { 13396 this.loading.removeElement(), this.noData.removeElement(), this.noVisibleSeries.removeElement(), this.unsupportedBrowser.removeElement(); 13397 } 13398}; 13399S([ 13400 D(je) 13401], Vd.prototype, "darkTheme", 2); 13402S([ 13403 D(Be) 13404], Vd.prototype, "loading", 2); 13405S([ 13406 D(Be) 13407], Vd.prototype, "noData", 2); 13408S([ 13409 D(Be) 13410], Vd.prototype, "noVisibleSeries", 2); 13411S([ 13412 D(Be) 13413], Vd.prototype, "unsupportedBrowser", 2); 13414function R$(e, t) { 13415 const { animationDuration: i } = Mp.add, s = i * t, n = Gt("div", `${Sw}--loading`, { 13416 display: "flex", 13417 alignItems: "center", 13418 justifyContent: "center", 13419 flexDirection: "column", 13420 height: "100%", 13421 boxSizing: "border-box", 13422 font: "13px Verdana, sans-serif", 13423 // FONT_SIZE.MEDIUM 13424 userSelect: "none", 13425 animation: `ag-charts-loading ${s}ms linear 50ms both` 13426 }), o = Gt("span", { 13427 width: "45px", 13428 height: "40px", 13429 backgroundImage: [ 13430 "linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ", 13431 "linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ", 13432 "linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)" 13433 ].join(""), 13434 backgroundSize: "10px 400%", 13435 backgroundRepeat: "no-repeat", 13436 animation: "ag-charts-loading-matrix 1s infinite linear" 13437 }), r = Gt("p", { marginTop: "1em" }); 13438 r.innerText = e; 13439 const a = Gt("div", `${Sw}__loading-background`, { 13440 position: "absolute", 13441 inset: "0", 13442 opacity: "0.5", 13443 zIndex: "-1" 13444 }), l = Gt("style"); 13445 return l.innerText = [ 13446 "@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }", 13447 "@keyframes ag-charts-loading-matrix {", 13448 "0% { background-position: 0% 0%, 50% 0%, 100% 0%; }", 13449 "100% { background-position: 0% 100%, 50% 100%, 100% 100%; }", 13450 "}" 13451 ].join(" "), n.replaceChildren(l, o, r, a), n; 13452} 13453var uF = /* @__PURE__ */ ((e) => (e[e.BACKGROUND = 0] = "BACKGROUND", e[e.ANY_CONTENT = 1] = "ANY_CONTENT", e))(uF || {}), dF = /* @__PURE__ */ ((e) => (e[e.FOREGROUND = 0] = "FOREGROUND", e[e.HIGHLIGHT = 1] = "HIGHLIGHT", e[e.LABEL = 2] = "LABEL", e))(dF || {}), hF = /* @__PURE__ */ ((e) => (e[e.EXACT_SHAPE_MATCH = 0] = "EXACT_SHAPE_MATCH", e[e.NEAREST_NODE = 1] = "NEAREST_NODE", e[e.AXIS_ALIGNED = 2] = "AXIS_ALIGNED", e))(hF || {}), T$ = 0.25, L$ = 0.125, vg = class { 13454 constructor(e, t, { datum: i }, s) { 13455 this.type = e, this.event = t, this.datum = i, this.seriesId = s.id; 13456 } 13457}, Tx = class { 13458 constructor(e, t, i) { 13459 this.series = e, this.seriesGrouping = t, this.oldGrouping = i, this.type = "groupingChanged"; 13460 } 13461}, Ud = class extends bP {
13462 constructor(e) { 13463 super(), this.destroyFns = [], this.usesPlacedLabels = !1, this.seriesGrouping = void 0, this.NodeEvent = vg, this.internalId = So(this), this.contentGroup = new Ks({ 13464 name: `${this.internalId}-content`, 13465 zIndex: 1 13466 /* ANY_CONTENT */ 13467 }), this.highlightGroup = new Ks({ 13468 name: `${this.internalId}-highlight`, 13469 zIndex: 1 13470 /* ANY_CONTENT */ 13471 }), this.annotationGroup = new Ks({ 13472 name: `${this.internalId}-annotation` 13473 }), this.labelGroup = new Ks({ 13474 name: `${this.internalId}-series-labels` 13475 }), this.axes = { 13476 x: void 0, 13477 y: void 0 13478 }, this.directions = [ 13479 "x", 13480 "y" 13481 /* Y */ 13482 ], this.nodeDataRefresh = !0, this.moduleMap = new YS(), this.datumCallbackCache = /* @__PURE__ */ new Map(), this.connectsToYAxis = !1, this._declarationOrder = -1, this.seriesListeners = new Er(), this._pickNodeCache = new tx(); 13483 const { 13484 moduleCtx: t, 13485 pickModes: i, 13486 directionKeys: s = {}, 13487 directionNames: n = {}, 13488 canHaveAxes: o = !1, 13489 usesPlacedLabels: r = !1 13490 } = e; 13491 this.ctx = t, this.directionKeys = s, this.directionNames = n, this.canHaveAxes = o, this.usesPlacedLabels = r, this.highlightGroup = new Ks({ 13492 name: `${this.internalId}-highlight` 13493 }), this.highlightNode = this.highlightGroup.appendChild(new Ye({ name: "highlightNode", zIndex: 0 })), this.highlightLabel = this.highlightGroup.appendChild(new Ye({ name: "highlightLabel", zIndex: 10 })), this.pickModes = i; 13494 } 13495 get pickModeAxis() { 13496 return "main"; 13497 } 13498 get id() { 13499 return this.properties?.id ?? this.internalId; 13500 } 13501 get type() { 13502 return this.constructor.type ?? ""; 13503 } 13504 get data() { 13505 return this._data ?? this._chartData; 13506 } 13507 set visible(e) { 13508 this.properties.visible = e, this.ctx.legendManager.toggleItem({ enabled: e, seriesId: this.id }), this.ctx.legendManager.update(), this.visibleMaybeChanged(); 13509 } 13510 get visible() { 13511 return this.ctx.legendManager.getSeriesEnabled(this.id) ?? this.properties.visible; 13512 } 13513 get hasData() { 13514 return this.data != null && this.data.length > 0; 13515 } 13516 get tooltipEnabled() { 13517 return this.properties.tooltip?.enabled ?? !1; 13518 } 13519 onDataChange() { 13520 this.nodeDataRefresh = !0, this._pickNodeCache.clear(); 13521 } 13522 setOptionsData(e) { 13523 this._data = e, this.onDataChange(); 13524 } 13525 setChartData(e) { 13526 this._chartData = e, this.data === e && this.onDataChange(); 13527 } 13528 onSeriesGroupingChange(e, t) { 13529 const { internalId: i, type: s, visible: n } = this; 13530 e && this.ctx.seriesStateManager.deregisterSeries(this), t && this.ctx.seriesStateManager.registerSeries({ internalId: i, type: s, visible: n, seriesGrouping: t }), this.fireEvent(new Tx(this, t, e)); 13531 } 13532 getBandScalePadding() { 13533 return { inner: 1, outer: 0 }; 13534 } 13535 attachSeries(e, t, i) { 13536 e.appendChild(this.contentGroup), t.appendChild(this.highlightGroup), t.appendChild(this.labelGroup), i?.appendChild(this.annotationGroup); 13537 } 13538 detachSeries(e, t, i) { 13539 e?.removeChild(this.contentGroup), t.removeChild(this.highlightGroup), t.removeChild(this.labelGroup), i?.removeChild(this.annotationGroup); 13540 } 13541 setSeriesIndex(e) { 13542 return e === this._declarationOrder ? !1 : (this._declarationOrder = e, this.contentGroup.zIndex = [ 13543 1, 13544 e, 13545 0 13546 /* FOREGROUND */ 13547 ], this.highlightGroup.zIndex = [ 13548 1, 13549 e, 13550 1 13551 /* HIGHLIGHT */ 13552 ], this.labelGroup.zIndex = [ 13553 1, 13554 e, 13555 2 13556 /* LABEL */ 13557 ], this.annotationGroup.zIndex = e, !0); 13558 } 13559 renderToOffscreenCanvas() { 13560 return !1; 13561 } 13562 addEventListener(e, t) { 13563 return super.addEventListener(e, t); 13564 } 13565 addListener(e, t) { 13566 return this.seriesListeners.addListener(e, t); 13567 } 13568 dispatch(e, t) { 13569 this.seriesListeners.dispatch(e, t); 13570 } 13571 addChartEventListeners() { 13572 } 13573 destroy() { 13574 this.destroyFns.forEach((e) => e()), this.destroyFns = [], this.resetDatumCallbackCache(), this.ctx.seriesStateManager.deregisterSeries(this); 13575 } 13576 getDirectionValues(e, t) { 13577 const i = this.resolveKeyDirection(e), s = t?.[i], n = []; 13578 if (!s) 13579 return n; 13580 const o = (...r) => { 13581 for (const a of r) 13582 Array.isArray(a) ? o(...a) : typeof a == "object" ? o(...Object.values(a)) : n.push(a); 13583 }; 13584 return o(...s.map((r) => this.properties[r])), n; 13585 } 13586 getKeys(e) { 13587 return this.getDirectionValues(e, this.directionKeys); 13588 } 13589 getKeyProperties(e) { 13590 return this.directionKeys[this.resolveKeyDirection(e)] ?? []; 13591 } 13592 getNames(e) { 13593 return this.getDirectionValues(e, this.directionNames); 13594 } 13595 resolveKeyDirection(e) { 13596 return e; 13597 } 13598 // The union of the series domain ('community') and series-option domains ('enterprise'). 13599 getDomain(e) {
13600 const t = this.getSeriesDomain(e), i = this.moduleMap.mapModules((s) => s.getDomain(e)).flat(); 13601 return i.length !== 0 ? t.concat(i) : t; 13602 } 13603 getRange(e, t) { 13604 return this.getSeriesRange(e, t); 13605 } 13606 // Indicate that something external changed and we should recalculate nodeData. 13607 markNodeDataDirty() { 13608 this.nodeDataRefresh = !0, this._pickNodeCache.clear(), this.visibleMaybeChanged(); 13609 } 13610 visibleMaybeChanged() { 13611 this.ctx.seriesStateManager.updateSeries(this); 13612 } 13613 getOpacity() { 13614 const { dimOpacity: t = 1, enabled: i = !0 } = this.properties.highlightStyle.series; 13615 if (!i || t === 1) 13616 return 1; 13617 switch (this.isItemIdHighlighted()) { 13618 case 0: 13619 case 1: 13620 return 1; 13621 default: 13622 return t; 13623 } 13624 } 13625 getStrokeWidth(e) { 13626 const { strokeWidth: t, enabled: i = !0 } = this.properties.highlightStyle.series; 13627 if (!i || t === void 0) 13628 return e; 13629 switch (this.isItemIdHighlighted()) { 13630 case 1: 13631 return t; 13632 case 0: 13633 case 2: 13634 return e; 13635 } 13636 } 13637 isItemIdHighlighted() { 13638 const e = this.ctx.highlightManager?.getActiveHighlight()?.series; 13639 return e == null ? 0 : e !== this ? 2 : 1; 13640 } 13641 getModuleTooltipParams() { 13642 return this.moduleMap.mapModules((e) => e.getTooltipParams()).reduce((e, t) => Object.assign(e, t), {}); 13643 } 13644 pickNode(e, t, i = !1) { 13645 const { pickModes: s, pickModeAxis: n, visible: o, contentGroup: r } = this; 13646 if (!o || !r.visible || t === "highlight" && !this.properties.highlight.enabled || t === "highlight-tooltip" && !this.properties.highlight.enabled) 13647 return; 13648 let a = 1 / 0; 13649 if (t === "tooltip" || t === "highlight-tooltip") { 13650 const { tooltip: p } = this.properties; 13651 a = typeof p.range == "number" ? p.range : 1 / 0, i || (i = p.range === "exact"); 13652 } else if (t === "event" || t === "context-menu") { 13653 const { nodeClickRange: p } = this.properties; 13654 a = typeof p == "number" ? p : 1 / 0, i || (i = p === "exact"); 13655 } 13656 const l = s.filter( 13657 (p) => !i || p === 0 13658 /* EXACT_SHAPE_MATCH */ 13659 ), { x: c, y: u } = e, d = JSON.stringify({ x: c, y: u, maxDistance: a, selectedPickModes: l }); 13660 if (this._pickNodeCache.has(d)) 13661 return this._pickNodeCache.get(d); 13662 for (const p of l) { 13663 let f; 13664 switch (p) { 13665 case 0: 13666 f = this.pickNodeExactShape(e); 13667 break; 13668 case 1: 13669 f = this.pickNodeClosestDatum(e); 13670 break; 13671 case 2: 13672 f = n != null ? this.pickNodeMainAxisFirst(e, n === "main-category") : void 0; 13673 break; 13674 } 13675 if (f && f.distance <= a) 13676 return this._pickNodeCache.set(d, { pickMode: p, match: f.datum, distance: f.distance }); 13677 } 13678 return this._pickNodeCache.set(d, void 0); 13679 } 13680 pickNodeExactShape(e) { 13681 const t = this.contentGroup.pickNode(e.x, e.y); 13682 if (t && t.datum.missing !== !0) 13683 return { datum: t.datum, distance: 0 }; 13684 } 13685 pickNodeClosestDatum(e) { 13686 throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented"); 13687 } 13688 pickNodeNearestDistantObject(e, t) { 13689 const i = kv(e.x, e.y, t); 13690 if (i.nearest !== void 0 && i.nearest.datum.missing !== !0) 13691 return { datum: i.nearest.datum, distance: Math.sqrt(i.distanceSquared) }; 13692 } 13693 pickNodeMainAxisFirst(e, t) { 13694 throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented"); 13695 } 13696 getLabelData() { 13697 return []; 13698 } 13699 updatePlacedLabelData(e) { 13700 } 13701 fireNodeClickEvent(e, t) { 13702 this.fireEvent(new this.NodeEvent("nodeClick", e, t, this)); 13703 } 13704 fireNodeDoubleClickEvent(e, t) { 13705 this.fireEvent(new this.NodeEvent("nodeDoubleClick", e, t, this)); 13706 } 13707 createNodeContextMenuActionEvent(e, t) { 13708 return new this.NodeEvent("nodeContextMenuAction", e, t, this); 13709 } 13710 onLegendInitialState(e, t) { 13711 const { visible: i = !0, itemId: s, legendItemName: n } = t ?? {}; 13712 this.toggleSeriesItem(i, e, s, n); 13713 } 13714 onLegendItemClick(e) { 13715 const { enabled: t, itemId: i, series: s, legendType: n } = e, o = "legendItemName" in this.properties ? this.properties.legendItemName : void 0, r = "legendItemKey" in this.properties ? this.properties.legendItemKey : void 0, a = o != null && o === e.legendItemName; 13716 (s.id === this.id || a || r != null) && this.toggleSeriesItem(t, n, i, o, e); 13717 } 13718 onLegendItemDoubleClick(e) { 13719 const { enabled: t, itemId: i, series: s, numVisibleItems: n, legendT
13719ype: o } = e, r = "legendItemName" in this.properties ? this.properties.legendItemName : void 0, a = "legendItemKey" in this.properties ? this.properties.legendItemKey : void 0, l = r != null && r === e.legendItemName; 13720 s.id === this.id || l || a != null ? this.toggleSeriesItem(!0, o, i, r, e) : t && n === 1 ? this.toggleSeriesItem(!0, o, void 0, r) : this.toggleSeriesItem(!1, o, void 0, r); 13721 } 13722 toggleSeriesItem(e, t, i, s, n) { 13723 const o = this.id; 13724 (e || t !== "category") && (this.visible = e), this.nodeDataRefresh = !0, this._pickNodeCache.clear(); 13725 const r = { 13726 type: "seriesVisibilityChange", 13727 seriesId: o, 13728 itemId: i, 13729 legendItemName: n?.legendItemName ?? s, 13730 visible: e 13731 }; 13732 this.fireEvent(r), this.ctx.legendManager.toggleItem({ enabled: e, seriesId: o, itemId: i, legendItemName: s }); 13733 } 13734 isEnabled() { 13735 return this.visible; 13736 } 13737 getModuleMap() { 13738 return this.moduleMap; 13739 } 13740 createModuleContext() { 13741 return { ...this.ctx, series: this }; 13742 } 13743 getLabelText(e, t, i = Tp) { 13744 return e.formatter ? this.ctx.callbackCache.call(e.formatter, { seriesId: this.id, ...t }) ?? i(t.value) : i(t.value); 13745 } 13746 getMarkerStyle(e, t, i = e.getStyle()) { 13747 const s = { size: t.datum.point?.size ?? 0 }, n = ht(s, i); 13748 if (e.itemStyler) { 13749 const o = this.ctx.callbackCache.call(e.itemStyler, { 13750 seriesId: this.id, 13751 ...n, 13752 ...t, 13753 datum: t.datum.datum 13754 }); 13755 return ht(o, n); 13756 } 13757 return n; 13758 } 13759 updateMarkerStyle(e, t, i, s = t.getStyle(), { applyTranslation: n = !0, selected: o = !0 } = {}) { 13760 const { point: r } = i.datum, a = this.getMarkerStyle(t, i, s), l = this.visible && a.size > 0 && r && !isNaN(r.x) && !isNaN(r.y); 13761 if (n ? e.setProperties({ visible: l, ...a, translationX: r?.x, translationY: r?.y }) : e.setProperties({ visible: l, ...a }), o || (e.fillOpacity *= T$, e.strokeOpacity *= L$), typeof t.shape == "function" && !e.dirtyPath) { 13762 e.path.clear(!0), e.updatePath(), e.checkPathDirty(); 13763 const c = e.getBBox(); 13764 if (r !== void 0 && c.isFinite()) { 13765 const u = c.computeCenter(), [d, p] = ["x", "y"].map( 13766 (m) => (a.strokeWidth ?? 0) + Math.abs(u[m] - r[m]) 13767 ), f = Math.max(c.width + d, c.height + p); 13768 r.focusSize = f; 13769 } 13770 } 13771 } 13772 getMinRects(e, t) { 13773 } 13774 get nodeDataDependencies() { 13775 return this._nodeDataDependencies ?? { seriesRectWidth: NaN, seriesRectHeight: NaN }; 13776 } 13777 checkResize(e) { 13778 const { width: t, height: i } = e ?? { width: NaN, height: NaN }, s = e ? { seriesRectWidth: t, seriesRectHeight: i } : void 0, n = Sr(this.nodeDataDependencies, s) != null; 13779 return n && (this._nodeDataDependencies = s, this.markNodeDataDirty()), n; 13780 } 13781 pickFocus(e) { 13782 } 13783 resetDatumCallbackCache() { 13784 this.datumCallbackCache.clear(); 13785 } 13786 cachedDatumCallback(e, t) { 13787 const { datumCallbackCache: i } = this, s = i.get(e); 13788 if (s != null) 13789 return s; 13790 const n = t(); 13791 return i.set(e, n), n; 13792 } 13793}; 13794Ud.highlightedZIndex = 1e12; 13795S([ 13796 Un({ 13797 changeValue: function(e, t) { 13798 this.onSeriesGroupingChange(t, e); 13799 } 13800 }) 13801], Ud.prototype, "seriesGrouping", 2); 13802function k$(e, t) { 13803 const i = -t / e; 13804 return e !== 0 && i >= 0 && i <= 1 ? [i] : []; 13805} 13806function P$(e, t, i) { 13807 if (e === 0) 13808 return k$(t, i); 13809 const s = t * t - 4 * e * i, n = []; 13810 if (s === 0) { 13811 const o = -t / (2 * e); 13812 o >= 0 && o <= 1 && n.push(o); 13813 } else if (s > 0) { 13814 const o = Math.sqrt(s), r = (-t - o) / (2 * e), a = (-t + o) / (2 * e); 13815 r >= 0 && r <= 1 && n.push(r), a >= 0 && a <= 1 && n.push(a); 13816 } 13817 return n; 13818} 13819function F$(e, t, i, s) { 13820 if (e === 0) 13821 return P$(t, i, s); 13822 const n = t / e, o = i / e, r = s / e, a = (3 * o - n * n) / 9, l = (9 * n * o - 27 * r - 2 * n * n * n) / 54, c = a * a * a + l * l, u = 1 / 3, d = []; 13823 if (c >= 0) { 13824 const p = Math.sqrt(c), f = Math.sign(l + p) * Math.pow(Math.abs(l + p), u), m = Math.sign(l - p) * Math.pow(Math.abs(l - p), u), y = Math.abs(Math.sqrt(3) * (f - m) / 2), b = -u * n + (f + m); 13825 if (b >= 0 && b <= 1 && d.push(b), y === 0) { 13826 const C = -u * n - (f + m) / 2; 13827 C >= 0 && C <= 1 && d.push(C); 13828 } 13829 } else { 13830 const p = Math.acos(l / Math.sqrt(-a * a * a)), f = u * n, m = 2 * Math.sqrt(-a), y = m * Math.cos(u * p) - f, b = m * Math.cos(u * (p + 2 * Math.PI)) - f, C = m * Math.cos(u * (p + 4 * Math.PI)) - f; 13831 y >= 0 && y <= 1 && d.push(y), b >= 0 && b <= 1 && d.push(b), C >= 0 && C <= 1 && d.push(C); 13832 } 13833 return d; 13834} 13835function Yu(e, t, i, s, n, o, r, a) { 13836 const l = (i - e) * (a - o) - (s - t) * (r - n); 13837 if (l === 0) 13838 return 0; 13839 const c = ((r - n) * (t - o) - (e - n) * (a - o)) / l, u = ((i - e) * (t - o) - (s - t) * (e - n)) / l; 13840 return c >= 0 && c <= 1 && u >= 0 && u <= 1 ? 1 : 0; 13841} 13842function O$(e, t, i, s, n, o, r, a, l, c, u, d) { 13843 let p = 0; 13844 const f = c - d, m = u - l, y = l * (d - c) - c * (u - l), b = YI(e, i, n, r), C = YI(t, s, o, a), w = f * b[0] + m * C[0], M = f * b[1] + m * C[1], A = f * b[2] + m * C[2], I = f * b[3] + m * C[3] + y, L = F$(w, M, A, I); 13845 for (const k of L) { 13846 const B = k * k, N = k * B, W = b[0] * N + b[1] * B + b[2] * k + b[3], se = C[0] * N + C[1] * B + C[2] * k + C[3]; 13847 let ue; 13848 l === u ? ue = (se - c) / (d - c) : ue = (W - l) / (u - l), ue >= 0 && ue <= 1 && p++; 13849 } 13850 return p; 13851} 13852function YI(e, t, i, s) { 13853 return [ 13854 // Bézier expressed as matrix operations: 13855 -e + 3 * t - 3 * i + s, 13856 // |-1 3 -3 1| |P1| 13857 3 * e - 6 * t + 3 * i, 13858 // [t^3 t^2 t 1] | 3 -6 3 0| |P2| 13859 -3 * e + 3 * t, 13860 // |-3 3 0 0| |P3| 13861 e 13862 // | 1 0 0 0| |P4| 13863 ]; 13864} 13865function pF(e, t, i, s, n, o, r, a, l, c) { 13866 if (isNaN(e) || isNaN(t)) 13867 return 0; 13868 o && ([n, s] = [s, n]); 13869 const u = (c - a) / (l - r), d = a - u * r, p = Math.pow(u, 2) + 1, f = 2 * (u * (d - t) - e), m = Math.pow(e, 2) + Math.pow(d - t, 2) - Math.pow(i, 2), y = Math.pow(f, 2) - 4 * p * m; 13870 if (y < 0) 13871 return 0; 13872 const b = (-f + Math.sqrt(y)) / 2 / p, C = (-f - Math.sqrt(y)) / 2 / p; 13873 let w = 0;
13874 return [b, C].forEach((M) => { 13875 if (!(M >= Math.min(r, l) && M <= Math.max(r, l))) 13876 return; 13877 const I = u * M + d, L = M - e, k = I - t, B = Math.atan2(k, L); 13878 uo(B, s, n) && w++; 13879 }), w; 13880} 13881function zm(e, t, i, s, n) { 13882 return (1 - n) ** 3 * e + 3 * (1 - n) ** 2 * n * t + 3 * (1 - n) * n ** 2 * i + n ** 3 * s; 13883} 13884function Hm(e, t, i, s, n) { 13885 if (n <= Math.min(e, s)) 13886 return e < s ? 0 : 1; 13887 if (n >= Math.max(e, s)) 13888 return e < s ? 1 : 0; 13889 let o = 0, r = 1, a = NaN; 13890 for (let l = 0; l < 12; l += 1) 13891 a = (o + r) / 2, zm(e, t, i, s, a) < n ? o = a : r = a; 13892 return a; 13893} 13894function Vm(e, t, i, s, n, o, r, a, l) { 13895 const c = (1 - l) * e + l * i, u = (1 - l) * t + l * s, d = (1 - l) * i + l * n, p = (1 - l) * s + l * o, f = (1 - l) * n + l * r, m = (1 - l) * o + l * a, y = (1 - l) * c + l * d, b = (1 - l) * u + l * p, C = (1 - l) * d + l * f, w = (1 - l) * p + l * m, M = (1 - l) * y + l * C, A = (1 - l) * b + l * w; 13896 return [ 13897 [ 13898 { x: e, y: t }, 13899 { x: c, y: u }, 13900 { x: y, y: b }, 13901 { x: M, y: A } 13902 ], 13903 [ 13904 { x: M, y: A }, 13905 { x: C, y: w }, 13906 { x: f, y: m }, 13907 { x: r, y: a } 13908 ] 13909 ]; 13910} 13911function xw(e, t, i, s) { 13912 const n = -e + 3 * t - 3 * i + s, o = 3 * e - 6 * t + 3 * i, r = -3 * e + 3 * t; 13913 if (n === 0) { 13914 if (o !== 0) { 13915 const l = -r / o; 13916 if (l > 0 && l < 1) 13917 return [l]; 13918 } 13919 return []; 13920 } 13921 const a = o * o - 4 * n * r; 13922 if (a >= 0) { 13923 const l = Math.sqrt(a), c = (-o + l) / (2 * n), u = (-o - l) / (2 * n); 13924 return [c, u].filter((d) => d > 0 && d < 1); 13925 } 13926 return []; 13927} 13928function gF(e, t, i, s, n, o, r, a) { 13929 const l = xw(e, i, n, r), c = xw(t, s, o, a); 13930 return [...l, ...c]; 13931} 13932var Fp = class { 13933 constructor() { 13934 this.path2d = new Path2D(), this.previousCommands = [], this.previousParams = [], this.previousClosedPath = !1, this.commands = [], this.params = [], this.openedPath = !1, this.closedPath = !1; 13935 } 13936 isEmpty() { 13937 return this.commands.length === 0; 13938 } 13939 isDirty() { 13940 return this.closedPath !== this.previousClosedPath || this.previousCommands.length !== this.commands.length || this.previousParams.length !== this.params.length || this.previousCommands.toString() !== this.commands.toString() || this.previousParams.toString() !== this.params.toString(); 13941 } 13942 getPath2D() { 13943 return this.path2d; 13944 } 13945 moveTo(e, t) { 13946 this.openedPath = !0, this.path2d.moveTo(e, t), this.commands.push( 13947 0 13948 /* Move */ 13949 ), this.params.push(e, t); 13950 } 13951 lineTo(e, t) { 13952 this.openedPath ? (this.path2d.lineTo(e, t), this.commands.push( 13953 1 13954 /* Line */ 13955 ), this.params.push(e, t)) : this.moveTo(e, t); 13956 } 13957 rect(e, t, i, s) { 13958 this.moveTo(e, t), this.lineTo(e + i, t), this.lineTo(e + i, t + s), this.lineTo(e, t + s), this.closePath(); 13959 } 13960 roundRect(e, t, i, s, n) { 13961 n = Math.min(n, i / 2, s / 2), this.moveTo(e, t + n), this.arc(e + n, t + n, n, Math.PI, 1.5 * Math.PI), this.lineTo(e + n, t), this.lineTo(e + i - n, t), this.arc(e + i - n, t + n, n, 1.5 * Math.PI, 2 * Math.PI), this.lineTo(e + i, t + n), this.lineTo(e + i, t + s - n), this.arc(e + i - n, t + s - n, n, 0, Math.PI / 2), this.lineTo(e + i - n, t + s), this.lineTo(e + n, t + s), this.arc(e + +n, t + s - n, n, Math.PI / 2, Math.PI), this.lineTo(e, t + s - n), this.closePath(); 13962 } 13963 arc(e, t, i, s, n, o) { 13964 this.openedPath = !0, this.path2d.arc(e, t, i, s, n, o), this.commands.push( 13965 2 13966 /* Arc */ 13967 ), this.params.push(e, t, i, s, n, o ? 1 : 0); 13968 }
13969 cubicCurveTo(e, t, i, s, n, o) { 13970 this.openedPath || this.moveTo(e, t), this.path2d.bezierCurveTo(e, t, i, s, n, o), this.commands.push( 13971 3 13972 /* Curve */ 13973 ), this.params.push(e, t, i, s, n, o); 13974 } 13975 closePath() { 13976 this.openedPath && (this.path2d.closePath(), this.commands.push( 13977 4 13978 /* ClosePath */ 13979 ), this.openedPath = !1, this.closedPath = !0); 13980 } 13981 clear(e) { 13982 e && (this.previousCommands = this.commands, this.previousParams = this.params, this.previousClosedPath = this.closedPath), this.path2d = new Path2D(), this.openedPath = !1, this.closedPath = !1, this.commands = [], this.params = []; 13983 } 13984 isPointInPath(e, t) { 13985 const i = this.commands, s = this.params, n = i.length, o = -1e4, r = -1e4; 13986 let a = NaN, l = NaN, c = 0, u = 0, d = 0; 13987 for (let p = 0, f = 0; p < n; p++) 13988 switch (i[p]) { 13989 case 0: 13990 d += Yu(a, l, c, u, o, r, e, t), c = s[f++], a = c, u = s[f++], l = u; 13991 break; 13992 case 1: 13993 d += Yu(c, u, s[f++], s[f++], o, r, e, t), c = s[f - 2], u = s[f - 1]; 13994 break; 13995 case 3: 13996 d += O$( 13997 c, 13998 u, 13999 s[f++], 14000 s[f++], 14001 s[f++], 14002 s[f++], 14003 s[f++], 14004 s[f++], 14005 o, 14006 r, 14007 e, 14008 t 14009 ), c = s[f - 2], u = s[f - 1]; 14010 break; 14011 case 2: { 14012 const m = s[f++], y = s[f++], b = s[f++], C = s[f++], w = s[f++], M = !!s[f++]; 14013 if (d += pF( 14014 m, 14015 y, 14016 b, 14017 C, 14018 w, 14019 M, 14020 o, 14021 r, 14022 e, 14023 t 14024 ), !isNaN(a)) { 14025 const A = m + Math.cos(C) * b, I = y + Math.sin(C) * b; 14026 d += Yu(c, u, A, I, o, r, e, t); 14027 } 14028 c = m + Math.cos(w) * b, u = y + Math.sin(w) * b; 14029 break; 14030 } 14031 case 4: 14032 d += Yu(a, l, c, u, o, r, e, t); 14033 break; 14034 } 14035 return d % 2 === 1; 14036 } 14037 distanceSquared(e, t) { 14038 let i = 1 / 0; 14039 const s = this.commands, n = this.params, o = s.length; 14040 let r = NaN, a = NaN, l = 0, c = 0; 14041 for (let u = 0, d = 0; u < o; u++) 14042 switch (s[u]) { 14043 case 0: 14044 l = r = n[d++], c = a = n[d++]; 14045 break; 14046 case 1: { 14047 const p = n[d++], f = n[d++]; 14048 i = ip(e, t, l, c, p, f, i); 14049 break; 14050 } 14051 case 3: 14052 Ee.error("Command.Curve distanceSquare not implemented"); 14053 break; 14054 case 2: { 14055 const p = n[d++], f = n[d++], m = n[d++], y = n[d++], b = n[d++], C = p + Math.cos(y) * m, w = f + Math.sin(y) * m, M = !!n[d++]; 14056 i = ip(e, t, l, c, C, w, i), i = L7(e, t, p, f, m, y, b, M, i), l = p + Math.cos(b) * m, c = f + Math.sin(b) * m; 14057 break; 14058 } 14059 case 4: 14060 i = ip(e, t, l, c, r, a, i); 14061 break; 14062 } 14063 return i; 14064 } 14065 getPoints() { 14066 const { commands: e, params: t } = this, i = []; 14067 let s = 0; 14068 for (const n of e) 14069 switch (n) { 14070 case 0: 14071 case 1: 14072 i.push({ x: t[s++], y: t[s++] }); 14073 break; 14074 case 3: 14075 s += 4, i.push({ x: t[s++], y: t[s++] }); 14076 break; 14077 case 2: 14078 i.push({ x: t[s++], y: t[s++] }), s += 4; 14079 break; 14080 } 14081 return i; 14082 } 14083 // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d 14084 toSVG(e = (t, i) => ({ x: t, y: i })) { 14085 const t = [], { commands: i, params: s } = this, n = (r, ...a) => { 14086 t.push(r); 14087 for (let l = 0; l < a.length; l += 2) { 14088 const { x: c, y: u } = e(a[l], a[l + 1]); 14089 t.push(c, u); 14090 } 14091 }; 14092 let o = 0; 14093 for (const r of i) 14094 switch (r) { 14095 case 0: 14096 n("M", s[o++], s[o++]); 14097 break; 14098 case 1: 14099 n("L", s[o++], s[o++]); 14100 break; 14101 case 3: 14102 n("C", s[o++], s[o++], s[o++], s[o++], s[o++], s[o++]); 14103 break; 14104 case 2: { 14105 const a = s[o++], l = s[o++], c = s[o++], u = s[o++], d = s[o++], p = s[o++]; 14106 let f = p ? u - d : d - u; 14107 f < 0 && (f += Math.ceil(-f / (2 * Math.PI)) * 2 * Math.PI), p && (f = -f); 14108 const m = Math.max(Math.ceil(Math.abs(f) / (Math.PI / 2)), 1), y = f / m, b = 4 / 3 * Math.tan(y / 4), C = t.length === 0 ? "M" : "L";
14109 n(C, a + Math.cos(u) * c, l + Math.sin(u) * c); 14110 for (let w = 0; w < m; w += 1) { 14111 const M = u + y * (w + 0), A = u + y * (w + 1), I = c * Math.sin(M), L = c * Math.cos(M), k = c * Math.sin(A), B = c * Math.cos(A); 14112 n( 14113 "C", 14114 a + L - b * I, 14115 l + I + b * L, 14116 a + B + b * k, 14117 l + k - b * B, 14118 a + B, 14119 l + k 14120 ); 14121 } 14122 break; 14123 } 14124 case 4: 14125 t.push("Z"); 14126 break; 14127 } 14128 return t.join(" "); 14129 } 14130 computeBBox() { 14131 const { commands: e, params: t } = this; 14132 let [i, s, n, o] = [1 / 0, 1 / 0, -1 / 0, -1 / 0], [r, a] = [NaN, NaN], [l, c] = [NaN, NaN]; 14133 const u = (p, f, m) => { 14134 i = Math.min(f, i), s = Math.min(p, s), n = Math.max(p, n), o = Math.max(f, o), m && ([r, a] = [p, f]); 14135 }; 14136 let d = 0; 14137 for (const p of e) 14138 switch (p) { 14139 case 0: 14140 u(t[d++], t[d++], !0), [l, c] = [r, a]; 14141 break; 14142 case 1: 14143 u(t[d++], t[d++], !0); 14144 break; 14145 case 3: { 14146 const f = t[d++], m = t[d++], y = t[d++], b = t[d++], C = t[d++], w = t[d++]; 14147 u(C, w, !0), gF(r, a, f, m, y, b, C, w).forEach((A) => { 14148 const I = zm(r, f, y, C, A), L = zm(a, m, b, w, A); 14149 u(I, L); 14150 }); 14151 break; 14152 } 14153 case 2: { 14154 const f = t[d++], m = t[d++], y = t[d++]; 14155 let b = zt(t[d++]), C = zt(t[d++]); 14156 t[d++] && ([b, C] = [C, b]); 14157 const M = (I, L) => { 14158 const k = f + y * Math.cos(I), B = m + y * Math.sin(I); 14159 u(k, B, L); 14160 }; 14161 M(b), M(C, !0); 14162 const A = [0, Math.PI / 2, Math.PI, 3 * Math.PI / 2]; 14163 for (const I of A) 14164 (b < C && b <= I && I <= C || b > C && (b <= I || I <= C)) && M(I); 14165 break; 14166 } 14167 case 4: 14168 [r, a] = [l, c]; 14169 break; 14170 } 14171 return new _e(s, i, n - s, o - i); 14172 } 14173}; 14174function Je(e) { 14175 const { changeCb: t, convertor: i } = e ?? {}; 14176 return Ge({ type: "path", convertor: i, changeCb: t }); 14177} 14178var sn = class extends Co { 14179 constructor() { 14180 super(...arguments), this.path = new Fp(), this._clipX = NaN, this._clipY = NaN, this.clip = !1, this._dirtyPath = !0; 14181 } 14182 set clipX(e) { 14183 this._clipX = e, this.dirtyPath = !0; 14184 } 14185 set clipY(e) { 14186 this._clipY = e, this.dirtyPath = !0; 14187 } 14188 set dirtyPath(e) { 14189 this._dirtyPath !== e && (this._dirtyPath = e, e && this.markDirty()); 14190 } 14191 get dirtyPath() { 14192 return this._dirtyPath; 14193 } 14194 checkPathDirty() { 14195 this._dirtyPath || (this.dirtyPath = this.path.isDirty() || (this.fillShadow?.isDirty() ?? !1) || (this._clipPath?.isDirty() ?? !1)); 14196 } 14197 isPointInPath(e, t) { 14198 return this.updatePathIfDirty(), this.path.closedPath && this.path.isPointInPath(e, t); 14199 } 14200 distanceSquared(e, t) { 14201 return this.distanceSquaredTransformedPoint(e, t); 14202 } 14203 svgPathData(e) { 14204 return this.updatePathIfDirty(), this.path.toSVG(e); 14205 } 14206 distanceSquaredTransformedPoint(e, t) { 14207 return this.updatePathIfDirty(), this.path.closedPath && this.path.isPointInPath(e, t) ? 0 : this.path.distanceSquared(e, t); 14208 } 14209 isDirtyPath() { 14210 return !1; 14211 } 14212 updatePath() { 14213 } 14214 updatePathIfDirty() { 14215 (this.dirtyPath || this.isDirtyPath()) && (this.updatePath(), this.dirtyPath = !1); 14216 } 14217 preRender() { 14218 return this.updatePathIfDirty(), super.preRender(this.path.commands.length); 14219 } 14220 render(e) { 14221 const { ctx: t } = e; 14222 if (this.clip && !isNaN(this._clipX) && !isNaN(this._clipY)) { 14223 t.save(); 14224 const i = this.strokeWidth / 2; 14225 this._clipPath ?? (this._clipPath = new Fp()), this._clipPath.clear(), this._clipPath.rect(-i, -i, this._clipX + i, this._clipY + i + i), t.clip(this._clipPath?.getPath2D()), this._clipX > 0 && this._clipY > 0 && this.drawPath(t), t.restore(); 14226 } else 14227 this._clipPath = void 0, this.drawPath(t); 14228 this.fillShadow?.markClean(), super.render(e); 14229 } 14230 drawPath(e) { 14231 this.fillStroke(e, this.path.getPath2D()); 14232 } 14233 toSVG() { 14234 if (!this.visible) 14235 return; 14236 const e = document.createElementNS("http://www.w3.org/2000/svg", "path"); 14237 return e.setAttribute("d", this.svgPathData()), this.applySvgFillAttributes(e), this.applySvgStrokeAttributes(e), { 14238 elements: [e] 14239 }; 14240 } 14241}; 14242sn.className = "Path"; 14243S([ 14244 Je() 14245], sn.prototype, "clip", 2); 14246S([ 14247 Je() 14248], sn.prototype, "clipX", 1); 14249S([ 14250 Je() 14251], sn.prototype, "clipY", 1); 14252var N$ = class { 14253 constructor(e) { 14254 this.swapChain = e, this.div = Xi().createElement("div"), this.svg = Xi().createElementNS("http://www.w3.org/2000/svg", "svg"), this.path = Xi().createElementNS("http://www.w3.org/2000/svg", "path"), this.svg.append(this.path), this.element = Xi().createElement("div"), this.element.classList.add("ag-charts-focus-indicator"), this.element.ariaHidden = "true", this.element.append(this.svg), this.swapChain.addListener("swap", (t) => this.onSwap(t)); 14255 } 14256 updateBounds(e, t, i = 0, s = 0) { 14257 if (e !== void 0) 14258 if (e instanceof sn) { 14259 const n = (o, r) => { 14260 let { x: a, y: l } = Ii.toCanvasPoint(e, o, r); 14261 return a -= i, l -= s, { x: a, y: l }; 14262 }; 14263 this.path.setAttribute("d", e.svgPathData(n)), this.show(this.svg); 14264 } else { 14265 if (t == null) 14266 Ip(this.div, e); 14267 else { 14268 const n = Math.max(e.x, t.x), o = Math.max(e.y, t.y), r = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height); 14269 Ip(this.div, new _e(n, o, r - n, a - o)); 14270 } 14271 this.show(this.div); 14272 } 14273 } 14274 onSwap(e) { 14275 e !== this.element.parentElement && (this.element.remove(), e.appendChild(this.element), this.overrideFocusVisible(this.focusVisible)); 14276 } 14277 show(e) { 14278 this.element.innerHTML = "", this.element.append(e); 14279 } 14280 overrideFocusVisible(e) { 14281 this.focusVisible = e; 14282 const t = { true: "1", false: "0", undefined: "" }; 14283 this.element.parentElement?.style.setProperty("opacity", t[`${e}`]); 14284 } 14285 // Get the `:focus-visible` CSS state. 14286 isFocusVisible() { 14287 const e = this.element.parentElement; 14288 return e != null && pi().getComputedStyle(e).opacity === "1"; 14289 } 14290}, _$ = class { 14291 constructor(e, t, i, s) { 14292 this.label1 = e, this.label2 = t, this.hasFocus = !1, this.skipDispatch = !1, this.listeners = { 14293 blur: [], 14294 focus: [], 14295 swap: [] 14296 }, this.onBlur = (n) => !this.skipDispatch && this.dispatch("blur", n), this.onFocus = (n) => !this.skipDispatch && this.dispatch("focus", n), Yt(this.label1, "id", `${i}-label1`), Yt(this.label2, "id", `${i}-label2`), Vo(this.label1, "display", "none"), Vo(this.label2, "display", "none"), this.activeAnnouncer = this.createAnnouncer(s), this.inactiveAnnouncer = this.createAnnouncer(s), Yt(this.activeAnnouncer, "tabindex", 0), this.label2.insertAdjacentElement("afterend", this.activeAnnouncer), this.label2.insertAdjacentElement("afterend", this.inactiveAnnouncer), this.swap(""); 14297 } 14298 createAnnouncer(e) { 14299 const t = Gt("div"); 14300 return t.role = e, t.className = "ag-charts-swapchain", t.addEventListener("blur", this.onBlur), t.addEventListener("focus", this.onFocus), t; 14301 } 14302 destroy() { 14303 for (const e of [this.activeAnnouncer, this.inactiveAnnouncer]) 14304 e.removeEventListener("blur", this.onBlur), e.removeEventListener("focus", this.onFocus), e.remove(); 14305 } 14306 focus() { 14307 this.activeAnnouncer.focus(); 14308 } 14309 update(e) { 14310 this.skipDispatch = !0, this.swap(e), this.hasFocus && this.activeAnnouncer.focus(), this.skipDispatch = !1; 14311 } 14312 addListener(e, t) { 14313 this.listeners[e].push(t), e === "swap" && t(this.activeAnnouncer); 14314 } 14315 dispatch(e, t) { 14316 e === "focus" ? this.hasFocus = !0 : e === "blur" && (this.hasFocus = !1), this.listeners[e].forEach((i) => i(t)); 14317 } 14318 swap(e) { 14319 const t = this.activeAnnouncer.tabIndex; 14320 this.label2.textContent = e, [this.inactiveAnnouncer, this.activeAnnouncer] = [this.activeAnnouncer, this.inactiveAnnouncer], [this.label1, this.label2] = [this.label2, this.label1], Fc(this.inactiveAnnouncer, { 14321 "aria-labelledby": this.label1.id, 14322 "aria-hidden": !0, 14323 tabindex: void 0 14324 }), Fc(this.activeAnnouncer, { 14325 "aria-labelledby": this.label1.id, 14326 "aria-hidden": !1, 14327 tabindex: t 14328 }), Vo(this.inactiveAnnouncer, "pointer-events", "none"), Vo(this.activeAnnouncer, "pointer-events", void 0), this.dispatch("swap", this.activeAnnouncer); 14329 } 14330}; 14331function B$(e, t) { 14332 const i = Sx(t.datum); 14333 if (i != null) 14334 return { x: i.canvasX, y: i.canvasY }; 14335 const s = t.bounds; 14336 if (s != null) { 14337 if (s instanceof _e) { 14338 const { x: n, y: o } = s.computeCenter(); 14339 return { 14340 x: e.x + n, 14341 y: e.y + o 14342 }; 14343 } 14344 return Ii.toCanvas(s).computeCenter(); 14345 } 14346} 14347function G$(e, t, i, s, n) { 14348 const { bounds: o, showFocusBox: r, clipFocusBox: a = !0 } = i; 14349 r && t?.updateBounds( 14350 o, 14351 a ? e : void 0, 14352 s, 14353 n 14354 ); 14355} 14356function z$({ bounds: e }) { 14357 return e instanceof _e ? e : e != null ? e.getBBox() : _e.NaN; 14358} 14359function H$(e, t) { 14360 const { x: i, y: s } = B$(e, t) ?? {}; 14361 if (i !== void 0 && s !== void 0) 14362 return { type: "keyboard", canvasX: i, canvasY: s }; 14363} 14364function Mw(e, t, i, s) { 14365 let { top: n, right: o, bottom: r, left: a, width: l, height: c } = s; 14366 return a != null ? l != null ? o = i.width - a + l : o != null && (l = i.width - a - o) : o != null && l != null && (a = i.width - o - l), n != null ? c != null ? r = i.height - n - c : r != null && (c = i.height - r - n) : r != null && c != null && (n = i.height - r - c), l == null ? c == null ? (l = e, c = t) : l = Math.
14366ceil(e * c / t) : c == null && (c = Math.ceil(t * l / e)), a == null && (o == null ? a = Math.floor((i.width - l) / 2) : a = i.width - o - l), n == null && (r == null ? n = Math.floor((i.height - c) / 2) : n = i.height - c - r), { x: a, y: n, width: l, height: c }; 14367} 14368var Rf = null; 14369function td(e) { 14370 if (e != null) 14371 return e === "" ? "" : (Rf ?? (Rf = Gt("div")), Rf.textContent = String(e), Rf.innerHTML); 14372} 14373var V$ = [ 14374 "ArrowDown", 14375 "ArrowUp", 14376 "Circle", 14377 "Cross", 14378 "Diamond", 14379 "Heart", 14380 "MapPin", 14381 "Plus", 14382 "Square", 14383 "Star", 14384 "Triangle" 14385], U$ = Object.freeze({ x: 0.5, y: 0.5 }), ay = class extends sn { 14386 constructor() { 14387 super(...arguments), this.x = 0, this.y = 0, this.size = 12; 14388 } 14389 isBuiltIn() { 14390 return V$.includes(this.constructor.className ?? ""); 14391 } 14392 computeBBox() { 14393 if (!this.isBuiltIn()) 14394 return this.updatePathIfDirty(), this.path.computeBBox(); 14395 const { x: e, y: t, size: i } = this, { center: s } = this.constructor; 14396 return new _e(e - i * s.x, t - i * s.y, i, i); 14397 } 14398 applyPath(e, t) { 14399 const { path: i } = this; 14400 let { x: s, y: n } = this; 14401 i.clear(); 14402 for (const { x: o, y: r, t: a } of t) 14403 s += o * e, n += r * e, a === "move" ? i.moveTo(s, n) : i.lineTo(s, n); 14404 i.closePath(); 14405 } 14406 executeFill(e, t) { 14407 if (t) 14408 return super.executeFill(e, t); 14409 } 14410 executeStroke(e, t) { 14411 if (t) 14412 return super.executeStroke(e, t); 14413 } 14414}; 14415S([ 14416 Je() 14417], ay.prototype, "x", 2); 14418S([ 14419 Je() 14420], ay.prototype, "y", 2); 14421S([ 14422 Je({ convertor: Math.abs }) 14423], ay.prototype, "size", 2); 14424var Sn = class extends Vc(JS(Uc(ay))) { 14425}; 14426Sn.center = U$; 14427var hl = class extends Sn { 14428 updatePath() { 14429 const { x: e, y: t, path: i, size: s } = this, n = s / 2; 14430 i.clear(), i.arc(e, t, n, 0, Math.PI * 2), i.closePath(); 14431 } 14432}; 14433hl.className = "Circle"; 14434var Lx = class fF extends Sn { 14435 updatePath() { 14436 const t = this.size / 4.2; 14437 super.applyPath(t, fF.moves); 14438 } 14439}; 14440Lx.className = "Cross"; 14441Lx.moves = [ 14442 { x: -1, y: 0, t: "move" }, 14443 { x: -1, y: -1 }, 14444 { x: 1, y: -1 }, 14445 { x: 1, y: 1 }, 14446 { x: 1, y: -1 }, 14447 { x: 1, y: 1 }, 14448 { x: -1, y: 1 }, 14449 { x: 1, y: 1 }, 14450 { x: -1, y: 1 }, 14451 { x: -1, y: -1 }, 14452 { x: -1, y: 1 }, 14453 { x: -1, y: -1 } 14454]; 14455var W$ = Lx, kx = class mF extends Sn { 14456 updatePath() { 14457 const t = this.size / 2; 14458 super.applyPath(t, mF.moves); 14459 } 14460}; 14461kx.className = "Diamond"; 14462kx.moves = [ 14463 { x: 0, y: -1, t: "move" }, 14464 { x: 1, y: 1 }, 14465 { x: -1, y: 1 }, 14466 { x: -1, y: -1 }, 14467 { x: 1, y: -1 } 14468]; 14469var vF = kx, yF = class CF extends Sn { 14470 static rad(t) { 14471 return t / 180 * Math.PI; 14472 } 14473 updatePath() { 14474 const { x: t, path: i, size: s } = this, { rad: n } = CF, o = s / 4, r = this.y + o / 2; 14475 i.clear(), i.arc(t - o, r - o, o, n(130), n(330)), i.arc(t + o, r - o, o, n(220), n(50)), i.lineTo(t, r + o), i.closePath(); 14476 } 14477}; 14478yF.className = "Heart"; 14479var j$ = yF, Px = class extends Sn { 14480 updatePath() { 14481 const { path: e, x: t, y: i } = this, s = this.size, n = 0.5, o = 1; 14482 e.clear(), e.moveTo(t + (0.15625 - n) * s, i + (0.34375 - o) * s), e.cubicCurveTo( 14483 t + (0.15625 - n) * s, 14484 i + (0.151491 - o) * s, 14485 t + (0.307741 - n) * s, 14486 i + (0 - o) * s, 14487 t + (0.5 - n) * s, 14488 i + (0 - o) * s 14489 ), e.cubicCurveTo( 14490 t + (0.692259 - n) * s, 14491 i + (0 - o) * s, 14492 t + (0.84375 - n) * s, 14493 i + (0.151491 - o) * s, 14494 t + (0.84375 - n) * s, 14495 i + (0.34375 - o) * s 14496 ), e.cubicCurveTo( 14497 t + (0.84375 - n) * s, 14498 i + (0.493824 - o) * s, 14499 t + (0.784625 - n) * s, 14500 i + (0.600181 - o) * s, 14501 t + (0.716461 - n) * s, 14502 i + (0.695393 - o) * s 14503 ), e.cubicCurveTo( 14504 t + (0.699009 - n) * s, 14505 i + (0.719769 - o) * s, 14506 t + (0.681271 - n) * s, 14507 i + (0.743104 - o) * s, 14508 t + (0.663785 - n) * s, 14509 i + (0.766105 - o) * s 14510 ), e.cubicCurveTo( 14511 t + (0.611893 - n) * s, 14512 i + (0.834367 - o) * s, 14513 t + (0.562228 - n) * s, 14514 i + (0.899699 - o) * s, 14515 t + (0.528896 - n) * s, 14516 i + (0.980648 - o) * s 14517 ), e.cubicCurveTo( 14518 t + (0.524075 - n) * s, 14519 i + (0.992358 - o) * s, 14520 t + (0.512663 - n) * s, 14521 i + (1 - o) * s,
14522 t + (0.5 - n) * s, 14523 i + (1 - o) * s 14524 ), e.cubicCurveTo( 14525 t + (0.487337 - n) * s, 14526 i + (1 - o) * s, 14527 t + (0.475925 - n) * s, 14528 i + (0.992358 - o) * s, 14529 t + (0.471104 - n) * s, 14530 i + (0.980648 - o) * s 14531 ), e.cubicCurveTo( 14532 t + (0.487337 - n) * s, 14533 i + (1 - o) * s, 14534 t + (0.475925 - n) * s, 14535 i + (0.992358 - o) * s, 14536 t + (0.471104 - n) * s, 14537 i + (0.980648 - o) * s 14538 ), e.cubicCurveTo( 14539 t + (0.437772 - n) * s, 14540 i + (0.899699 - o) * s, 14541 t + (0.388107 - n) * s, 14542 i + (0.834367 - o) * s, 14543 t + (0.336215 - n) * s, 14544 i + (0.766105 - o) * s 14545 ), e.cubicCurveTo( 14546 t + (0.318729 - n) * s, 14547 i + (0.743104 - o) * s, 14548 t + (0.300991 - n) * s, 14549 i + (0.719769 - o) * s, 14550 t + (0.283539 - n) * s, 14551 i + (0.695393 - o) * s 14552 ), e.cubicCurveTo( 14553 t + (0.215375 - n) * s, 14554 i + (0.600181 - o) * s, 14555 t + (0.15625 - n) * s, 14556 i + (0.493824 - o) * s, 14557 t + (0.15625 - n) * s, 14558 i + (0.34375 - o) * s 14559 ), e.closePath(); 14560 } 14561}; 14562Px.className = "MapPin"; 14563Px.center = { x: 0.5, y: 1 }; 14564var Fx = class bF extends Sn { 14565 updatePath() { 14566 const t = this.size / 3; 14567 super.applyPath(t, bF.moves); 14568 } 14569}; 14570Fx.className = "Plus"; 14571Fx.moves = [ 14572 { x: -0.5, y: -0.5, t: "move" }, 14573 { x: 0, y: -1 }, 14574 { x: 1, y: 0 }, 14575 { x: 0, y: 1 }, 14576 { x: 1, y: 0 }, 14577 { x: 0, y: 1 }, 14578 { x: -1, y: 0 }, 14579 { x: 0, y: 1 }, 14580 { x: -1, y: 0 }, 14581 { x: 0, y: -1 }, 14582 { x: -1, y: 0 }, 14583 { x: 0, y: -1 } 14584]; 14585var $$ = Fx, ly = class extends Sn { 14586 updatePath() { 14587 const { path: e, x: t, y: i } = this, s = this.size / 2; 14588 e.clear(), e.moveTo(this.align(t - s), this.align(i - s)), e.lineTo(this.align(t + s), this.align(i - s)), e.lineTo(this.align(t + s), this.align(i + s)), e.lineTo(this.align(t - s), this.align(i + s)), e.closePath(); 14589 } 14590}; 14591ly.className = "Square"; 14592var wF = class extends Sn { 14593 updatePath() { 14594 const { x: e, y: t, path: i, size: s } = this, n = 5, o = s / 2, r = o / 2, a = Math.PI / 2; 14595 i.clear(); 14596 for (let l = 0; l < n * 2; l++) { 14597 const c = l % 2 === 0 ? o : r, u = l * Math.PI / n - a, d = e + Math.cos(u) * c, p = t + Math.sin(u) * c; 14598 i.lineTo(d, p); 14599 } 14600 i.closePath(); 14601 } 14602}; 14603wF.className = "Star"; 14604var Ox = class SF extends Sn { 14605 updatePath() { 14606 const t = this.size * 1.1; 14607 super.applyPath(t, SF.moves); 14608 } 14609}; 14610Ox.className = "Triangle"; 14611Ox.moves = [ 14612 { x: 0, y: -0.48, t: "move" }, 14613 { x: 0.5, y: 0.87 }, 14614 { x: -1, y: 0 } 14615]; 14616var op = Ox, xF = { 14617 circle: hl, 14618 cross: W$, 14619 diamond: vF, 14620 heart: j$, 14621 pin: Px, 14622 plus: $$, 14623 square: ly, 14624 star: wF, 14625 triangle: op 14626}, Y$ = Object.keys(xF); 14627function MF(e) { 14628 return typeof e == "string" && Y$.includes(e); 14629} 14630function K$(e) { 14631 return class extends Sn { 14632 updatePath() { 14633 const { path: i, x: s, y: n, size: o } = this; 14634 e({ path: i, x: s, y: n, size: o }); 14635 } 14636 }; 14637} 14638function bo(e = "square") { 14639 return MF(e) ? xF[e] : typeof e == "function" ? K$(e) : ly; 14640} 14641function AF(e, t, i = t * (5 / 3)) { 14642 const s = new Ye(), n = Math.min(e.marker.strokeWidth, 2), o = Math.min(e.line?.strokeWidth ?? 0, 2), r = Math.max(e.marker.enabled === !1 ? 0 : t, e.line == null ? 0 : i), a = Math.max(e.marker.enabled === !1 ? 0 : t, o); 14643 if (e.line != null) { 14644 const { stroke: l, strokeOpacity: c, lineDash: u } = e.line, d = new Hn(); 14645 d.x1 = 0, d.y1 = a / 2, d.x2 = r, d.y2 = a / 2, d.stroke = l, d.strokeOpacity = c, d.strokeWidth = o, d.lineDash = u, s.append(d); 14646 } 14647 if (e.marker.enabled !== !1) { 14648 const { shape: l, fill: c, fillOpacity: u, stroke: d, strokeOpacity: p } = e.marker, f = bo(l), m = new f(), { center: y } = f; 14649 m.size = t, m.translationX = r / 2 + (y.x - 0.5) * t, m.translationY = a / 2 + (y.y - 0.5) * t, m.fill = c, m.fillOpacity = u, m.stroke = d, m.strokeOpacity = p, m.strokeWidth = n; 14650 const b = r / 2 + (y.x - 0.5) * t, C = a / 2 + (y.y - 0.5) * t; 14651 if (typeof l == "string") { 14652 const w = t / (t + n); 14653 m.translationX = b, m.translationY = C, m.scalingX = w, m.scalingY = w; 14654 } else { 14655 const w = m.getBBox(), M = Math.min( 14656 r / (w.width + n), 14657 a / (w.height + n), 14658 1 14659 ); 14660 m.translationX = b * M - w.x * M + (r - w.width * M) / 2, m.translationY = C * M - w.y * M + (a - w.height * M) / 2, m.scalingX = M, m.scalingY = M; 14661 } 14662 s.append(m); 14663 } 14664 return Ye.toSVG(s, r, a); 14665}
14666var KI = 0.1, ZI = 200, qI = 12, Z$ = 0.5, q$ = class extends Er { 14667 constructor() { 14668 super(...arguments), this.x1 = NaN, this.y1 = NaN, this.x = NaN, this.y = NaN, this.vx = 0, this.vy = 0, this.t0 = NaN, this.animationFrameHandle = void 0; 14669 } 14670 reset() { 14671 this.x = NaN, this.y = NaN, this.animationFrameHandle != null && (cancelAnimationFrame(this.animationFrameHandle), this.animationFrameHandle = void 0); 14672 } 14673 update(e, t) { 14674 if (Number.isNaN(this.x) || Number.isNaN(this.y)) { 14675 this.x = e, this.y = t, this.vx = 0, this.vy = 0, this.emitUpdate(), this.animationFrameHandle != null && (cancelAnimationFrame(this.animationFrameHandle), this.animationFrameHandle = void 0); 14676 return; 14677 } 14678 this.x1 = e, this.y1 = t, this.t0 = Date.now(), this.animationFrameHandle == null && (this.animationFrameHandle = requestAnimationFrame(this.onFrame.bind(this))); 14679 } 14680 onFrame() { 14681 this.animationFrameHandle = void 0; 14682 const { x1: e, y1: t, t0: i } = this, s = Date.now(), n = s - i; 14683 this.t0 = s; 14684 const o = 1e-3, r = Math.ceil(n / (o * 1e3)) | 0; 14685 let { x: a, y: l, vx: c, vy: u } = this; 14686 for (let d = 0; d < r; d += 1) { 14687 const p = a - e, f = l - t, m = -(ZI * p + qI * c) / KI, y = -(ZI * f + qI * u) / KI; 14688 c += m * o, u += y * o, a += c * o, l += u * o; 14689 } 14690 Math.hypot(a - e, l - t) < Z$ ? (this.x = this.x1, this.y = this.y1, this.vx = 0, this.vy = 0) : (this.x = a, this.y = l, this.vx = c, this.vy = u, this.animationFrameHandle = requestAnimationFrame(this.onFrame.bind(this))), this.emitUpdate(); 14691 } 14692 emitUpdate() { 14693 this.dispatch("update", { type: "update", x: this.x, y: this.y }); 14694 } 14695}, ws = "ag-charts-tooltip", DF = "ag-charts-tooltip--dark"; 14696function EF(e) { 14697 if (typeof e == "string") 14698 return ""; 14699 const t = []; 14700 return e.heading != null && t.push(e.heading), e.title != null && t.push(e.title), e.data?.forEach((i) => { 14701 t.push(i.label ?? i.fallbackLabel, i.value); 14702 }), t.join("; "); 14703} 14704function QI(e, t, i) { 14705 let s = ""; 14706 e == null ? s += `<span class="${ws}-label">${td(t)}</span>` : (s += `<span class="${ws}-label">${td(e)}</span>`, s += " ", s += `<span class="${ws}-value">${td(t)}</span>`); 14707 const n = [`${ws}-row`]; 14708 return i && n.push(`${ws}-row--inline`), s = `<div class="${n.join(" ")}">${s}</div>`, s; 14709} 14710function Q$(e) { 14711 if (typeof e == "string") 14712 return e; 14713 let t = ""; 14714 if ((e.heading == null || e.title == null) && e.data?.length === 1 && e.data[0].label == null && e.data[0].value != null) { 14715 const i = e.data[0]; 14716 t += QI(e.heading ?? e.title, i.value, !1); 14717 } else { 14718 const i = e.title == null && e.data?.length === 1; 14719 e.heading != null && (t += `<span class="${ws}-heading">${td(e.heading)}</span>`, t += " "); 14720 const s = e.symbol == null ? void 0 : AF(e.symbol, 12); 14721 s != null && (e.title != null || e.data?.length) && (t += `<span class="${ws}-symbol">${s}</span>`), e.title != null && (t += `<span class="${ws}-title">${td(e.title)}</span>`, t += " "), e.data?.forEach((n) => { 14722 t += QI(n.label ?? n.fallbackLabel, n.value, i), t += " "; 14723 }); 14724 } 14725 return t = `<div class="${ws}-content">${t.trimEnd()}</div>`, t; 14726} 14727var Wd = class extends it { 14728 constructor() { 14729 super(...arguments), this.type = "pointer", this.xOffset = 0, this.yOffset = 0; 14730 } 14731}; 14732S([ 14733 D( 14734 si( 14735 [ 14736 "pointer", 14737 "node", 14738 "top", 14739 "right", 14740 "bottom", 14741 "left", 14742 "top-left", 14743 "top-right", 14744 "bottom-right", 14745 "bottom-left", 14746 { value: "sparkline", undocumented: !0 }, 14747 { value: "sparkline-", undocumented: !0 } 14748 ], 14749 "a position type" 14750 ) 14751 ) 14752], Wd.prototype, "type", 2); 14753S([ 14754 D(At) 14755], Wd.prototype, "xOffset", 2); 14756S([ 14757 D(At) 14758], Wd.prototype, "yOffset", 2); 14759var Rr = class extends it { 14760 constructor() { 14761 super(), this.enabled = !0, this.delay = 0, this.range = void 0, this.wrapping = "hyphenate", this.position = new Wd(), this.darkTheme = !1, this.bounds = "extended", this.destroyFns = [], this.springAnimation = new q$(), this.enableInteraction = !1, this.wrapTypes = ["always", "hyphenate", "on-space", "never"], this.showTimeout = 0, this._showArrow = !0, this._compact = !1, this._visible = !1, this.positionParams = void 0, this.destroyFns.push(this.springAnimation.addListener("update", this.updateTooltipPosition.bind(this))); 14762 } 14763 get interactive() { 14764 return this.enableInteraction; 14765 } 14766 setup(e) { 14767 "togglePopover" in pi().HTMLElement.prototype && (this.element = e.addChild("canvas-overlay", ws), this.element.setAttribute("popover", "manual"), this.element.className = ws); 14768 } 14769 destroy(e) { 14770 e.removeChild("canvas-overlay", ws); 14771 } 14772 isVisible() { 14773 return this._visible; 14774 } 14775 updateTooltipPosition() { 14776 const { element: e, positionParams: t } = this; 14777 if (e == null || t == null) 14778 return; 14779 const { canvasRect: i, relativeRect: s, meta: n } = t, { x: o, y: r } = this.springAnimation, a = n.position?.type ?? this.position.type, l = n.position?.xOffset ?? 0, c = n.position?.yOffset ?? 0, u = s.x, d = s.y, p = s.width - e.clientWidth - 1 + u, f = s.height - e.clientHeight + d; 14780 let m = this.getTooltipBounds({ positionType: a, canvasX: o, canvasY: r, yOffset: c, xOffset: l, canvasRect: i }), y = Mw(e.clientWidth, e.clientHeight, s, m); 14781 a === "sparkline" && (y.x <= u || y.x >= p) && (m = this.getTooltipBounds({ 14782 positionType: "sparkline-constrained", 14783 canvasX: o, 14784 canvasY: r, 14785 yOffset: c, 14786 xOffset: l, 14787 canvasRect: i 14788 }), y = Mw(e.clientWidth, e.clientHeight, s, m)); 14789 const b = ot(u, y.x, p), C = ot(d, y.y, f), w = b !== y.x || C !== y.y, M = (a === "node" || a === "pointer") && !w && !l && !c, A = n.showArrow ?? this.showArrow ?? M; 14790 this.updateShowArrow(A), this.updateCompact(a === "sparkline" || a === "sparkline-constrained"), e.style.transform = `translate(${b}px, ${C}
14790px)`; 14791 } 14792 /** 14793 * Shows tooltip at the given event's coordinates. 14794 * If the `html` parameter is missing, moves the existing tooltip to the new position. 14795 */ 14796 show(e, t, i, s, n = !1) { 14797 const { element: o } = this; 14798 if (o != null && s != null) 14799 o.innerHTML = Q$(s); 14800 else if (o == null || o.innerHTML === "") { 14801 this.toggle(!1); 14802 return; 14803 } 14804 const r = { 14805 x: e.x - t.x, 14806 y: e.y - t.y, 14807 width: e.width, 14808 height: e.height 14809 }; 14810 this.positionParams = { 14811 canvasRect: t, 14812 relativeRect: r, 14813 meta: i 14814 }, this.springAnimation.update(i.canvasX, i.canvasY), o.style.top = `${t.top}px`, o.style.left = `${t.left}px`, i.enableInteraction ? (this.enableInteraction = !0, o.style.pointerEvents = "auto", o.removeAttribute("aria-hidden")) : (this.enableInteraction = !1, o.style.pointerEvents = "none", o.setAttribute("aria-hidden", "true")), this.delay > 0 && !n ? (this.toggle(!1), this.showTimeout = setTimeout(() => { 14815 this.toggle(!0); 14816 }, this.delay)) : this.toggle(!0); 14817 } 14818 hide() { 14819 this.springAnimation.reset(), this.toggle(!1); 14820 } 14821 toggle(e) { 14822 if (!this.element?.isConnected) 14823 return; 14824 this._visible = e; 14825 const { classList: t } = this.element, i = (s, n) => t.toggle(`${ws}--${s}`, n); 14826 e || clearTimeout(this.showTimeout), i("no-interaction", !this.enableInteraction), i("arrow", this._showArrow), i("compact", this._compact), t.toggle(DF, this.darkTheme), this.element.togglePopover(e), e && this.updateTooltipPosition(); 14827 for (const s of this.wrapTypes) 14828 t.toggle(`${ws}--wrap-${s}`, s === this.wrapping); 14829 } 14830 updateShowArrow(e) { 14831 this._showArrow = e; 14832 } 14833 updateCompact(e) { 14834 this._compact = e; 14835 } 14836 getTooltipBounds(e) { 14837 if (!this.element) 14838 return {}; 14839 const { positionType: t, canvasX: i, canvasY: s, yOffset: n, xOffset: o, canvasRect: r } = e, { clientWidth: a, clientHeight: l } = this.element, c = { width: a, height: l }; 14840 switch (t) { 14841 case "node": 14842 case "pointer": 14843 return c.top = s + n - l - 8, c.left = i + o - a / 2, c; 14844 case "top": 14845 return c.top = n, c.left = r.width / 2 - a / 2 + o, c; 14846 case "right": 14847 return c.top = r.height / 2 - l / 2 + n, c.left = r.width - a / 2 + o, c; 14848 case "left": 14849 return c.top = r.height / 2 - l / 2 + n, c.left = o, c; 14850 case "bottom": 14851 return c.top = r.height - l + n, c.left = r.width / 2 - a / 2 + o, c; 14852 case "top-left": 14853 return c.top = n, c.left = o, c; 14854 case "top-right": 14855 return c.top = n, c.left = r.width - a + o, c; 14856 case "bottom-right": 14857 return c.top = r.height - l + n, c.left = r.width - a + o, c; 14858 case "bottom-left": 14859 return c.top = r.height - l + n, c.left = o, c; 14860 case "sparkline": 14861 return c.top = s + n - l / 2, c.left = i + o + 8, c; 14862 case "sparkline-constrained": 14863 return c.top = s + n - l / 2, c.left = i + o - 8 - a, c; 14864 } 14865 } 14866}; 14867S([ 14868 D(je) 14869], Rr.prototype, "enabled", 2); 14870S([ 14871 D(je, { optional: !0 }) 14872], Rr.prototype, "showArrow", 2); 14873S([ 14874 D(Te) 14875], Rr.prototype, "delay", 2); 14876S([ 14877 D(jv, { optional: !0 }) 14878], Rr.prototype, "range", 2); 14879S([ 14880 D(Wv) 14881], Rr.prototype, "wrapping", 2); 14882S([ 14883 D(Be) 14884], Rr.prototype, "position", 2); 14885S([ 14886 D(je) 14887], Rr.prototype, "darkTheme", 2); 14888S([ 14889 D(si(["extended", "canvas"])) 14890], Rr.prototype, "bounds", 2); 14891function Nu(e, t, i, s) { 14892 const n = [...e].reverse(); 14893 let o; 14894 for (const r of n) { 14895 if (!r.visible || !r.contentGroup.visible) 14896 continue; 14897 const { match: a, distance: l } = r.pickNode(t, i, s) ?? {}; 14898 if (!(!a || l == null) && ((!o || o.distance > l) && (o = { series: r, distance: l, datum: a }), l === 0)) 14899 break; 14900 } 14901 return o; 14902} 14903function XI(e, t) { 14904 if (e == null || t.length === 0) 14905 return [!1, !1]; 14906 const i = e.valueOf(), s = t[0], n = t[t.length - 1]; 14907 if (typeof s == "string") 14908 return [i === s, i === n]; 14909 let o = s.valueOf(), r = n.valueOf(); 14910 return o > r && ([o, r] = [r, o]), [i === o, i === r]; 14911} 14912function pl(e, t, i, s, n) { 14913 const { xValue: o, yValue: r } = e, [a, l] = XI(r, n), [c, u] = XI(o, s); 14914 return { 14915 datum: e, 14916 xKey: t, 14917 yKey: i, 14918 xValue: o, 14919 yValue: r, 14920 first: c, 14921 last: u, 14922 min: a, 14923 max: l 14924 }; 14925} 14926function cy(e, [t, i], s) { 14927 const n = Ok(0, e - 1, (r) => { 14928 const a = s(r)?.[1]; 14929 return !Number.isFinite(a) || a > t; 14930 }) ?? 0; 14931 let o = Fk(0, e - 1, (r) => { 14932 const a = s(r)?.[0]; 14933 return !Number.isFinite(a) || a < i; 14934 }) ?? e - 1; 14935 return o = Math.min(o + 1, e), [n, o]; 14936} 14937var X$ = class extends Ir {
14938 constructor(e) { 14939 super(), this.chart = e, this.id = So(this), this.series = [], this.highlight = { 14940 /** Last received event that still needs to be applied. */ 14941 pendingHoverEvent: void 0, 14942 /** Last applied event. */ 14943 appliedHoverEvent: void 0, 14944 /** Last applied event, which has been temporarily stashed during the main chart update cycle. */ 14945 stashedHoverEvent: void 0 14946 }, this.tooltip = { 14947 lastHover: void 0 14948 }, this.hoverDevice = "mouse", this.focus = { 14949 sortedSeries: [], 14950 series: void 0, 14951 seriesIndex: 0, 14952 datumIndex: 0, 14953 datum: void 0 14954 }, this.hoverScheduler = Dj(() => { 14955 if (!(!this.tooltip.lastHover && !this.highlight.pendingHoverEvent)) { 14956 if (this.chart.getUpdateType() <= 4) { 14957 this.hoverScheduler.schedule(); 14958 return; 14959 } 14960 this.highlight.pendingHoverEvent && this.handleHoverHighlight(!1), this.tooltip.lastHover && this.handleHoverTooltip(this.tooltip.lastHover, !1); 14961 } 14962 }); 14963 const t = 41, i = 34, s = 63, { domManager: n } = e.ctx, o = "series-area", r = n.addChild(o, "series-area-aria-label1"), a = n.addChild(o, "series-area-aria-label2"); 14964 this.seriesWidget = new dl(n.getParent(o)), this.chartWidget = new dl(n.getParent("canvas-proxy")), this.containerWidget = new dl(n.getParent("canvas-container")), e.ctx.regionManager.initRegions(this.containerWidget, this.seriesWidget), this.swapChain = new _$(r, a, this.id, "img"), this.swapChain.addListener("blur", () => this.onBlur(i)), this.swapChain.addListener("focus", () => this.onFocus(i)), this.focusIndicator = new N$(this.swapChain), this.focusIndicator.overrideFocusVisible(e.mode === "integrated" ? !1 : void 0), this.chart.ctx.keyNavManager.focusIndicator = this.focusIndicator; 14965 const l = e.ctx.regionManager.getRegion("series"); 14966 this.destroyFns.push( 14967 () => e.ctx.domManager.removeChild(o, "series-area-aria-label1"), 14968 () => e.ctx.domManager.removeChild(o, "series-area-aria-label2"), 14969 l.addListener("drag", (c) => this.onHoverLikeEvent(c), t), 14970 l.addListener("hover", (c) => this.onHover(c), t), 14971 l.addListener("leave", () => this.onLeave(), t), 14972 e.ctx.animationManager.addListener("animation-start", () => this.clearAll()), 14973 e.ctx.domManager.addListener("resize", () => this.clearAll()), 14974 e.ctx.highlightManager.addListener("highlight-change", (c) => this.changeHighlightDatum(c)), 14975 e.ctx.keyNavManager.addListener("nav-hori", (c) => this.onNavHori(c), i), 14976 e.ctx.keyNavManager.addListener("nav-vert", (c) => this.onNavVert(c), i), 14977 e.ctx.keyNavManager.addListener("submit", (c) => this.onSubmit(c), i), 14978 e.ctx.layoutManager.addListener("layout:complete", (c) => this.layoutComplete(c)), 14979 e.ctx.regionManager.listenAll("contextmenu", (c) => this.onContextMenu(c), s), 14980 e.ctx.regionManager.listenAll("click", (c) => this.onClick(c)), 14981 e.ctx.regionManager.listenAll("dblclick", (c) => this.onClick(c)), 14982 e.ctx.updateService.addListener("pre-scene-render", () => this.preSceneRender()), 14983 e.ctx.zoomManager.addListener("zoom-change", () => this.clearAll()), 14984 e.ctx.zoomManager.addListener("zoom-pan-start", () => this.clearAll()) 14985 ); 14986 } 14987 dataChanged() { 14988 var e; 14989 (e = this.highlight).stashedHoverEvent ?? (e.stashedHoverEvent = this.highlight.appliedHoverEvent), this.chart.ctx.tooltipManager.removeTooltip(this.id), this.focusIndicator.updateBounds(void 0), this.clearHighlight(); 14990 } 14991 preSceneRender() { 14992 this.focusIndicator.isFocusVisible() && this.handleSeriesFocus(0, 0, !0), this.highlight.stashedHoverEvent != null && (this.highlight.pendingHoverEvent = this.highlight.stashedHoverEvent, this.highlight.stashedHoverEvent = void 0, this.handleHoverHighlight(!0)), this.tooltip.lastHover != null && this.handleHoverTooltip(this.tooltip.lastHover, !0); 14993 } 14994 update(e, t) { 14995 this.chart.ctx.updateService.update(e, t); 14996 } 14997 seriesChanged(e) { 14998 this.focus.sortedSeries = [...e].sort((t, i) => { 14999 let s = t.properties.focusPriority ?? 1 / 0, n = i.properties.focusPriority ?? 1 / 0; 15000 return s === n && ([s, n] = [t._declarationOrder, i._declarationOrder]), s < n ? -1 : s > n ? 1 : 0; 15001 }), this.series = e; 15002 } 15003 layoutComplete(e) { 15004 this.seriesRect = e.series.rect, this.hoverRect = e.series.paddedRect, this.seriesWidget.setBounds(e.series.paddedRect), this.chartWidget.setBounds(e.chart); 15005 } 15006 onContextMenu(e) { 15007 const { Default: t, ContextMenu: i } = hx; 15008 if (e.region === "root") { 15009 this.chart.ctx.interactionManager.getState() & (t | i) && this.chart.ctx.contextMenuRegistry.dispatchContext("all", e, {}); 15010 return; 15011 } 15012 let s, n; 15013 if (this.focusIndicator.isFocusVisible()) 15014 s = this.chart.ctx.highlightManager.getActiveHighlight(), s && this.seriesRect && s.midPoint && (n = Ii.toCanvasPoint( 15015 s.series.contentGroup, 15016 s.midPoint.x, 15017 s.midPoint.y 15018 )); 15019 else if (this.chart.ctx.interactionManager.getState() & (t | i)) { 15020 const r = Nu(this.series, { x: e.regionX, y: e.regionY }, "context-menu"); 15021 r && (this.chart.ctx.highlightManager.updateHighlight(this.id
15021), s = r.datum); 15022 } 15023 const o = s?.series; 15024 this.clearAll(), this.chart.ctx.contextMenuRegistry.dispatchContext( 15025 "series-area", 15026 e, 15027 { pickedSeries: o, pickedNode: s }, 15028 n 15029 ); 15030 } 15031 onLeave() { 15032 this.chart.ctx.cursorManager.updateCursor(this.id), this.focusIndicator.isFocusVisible() || this.clearAll(); 15033 } 15034 onHover(e) { 15035 this.hoverDevice = "mouse", this.onHoverLikeEvent(e); 15036 } 15037 onHoverLikeEvent(e) { 15038 if (tk(e, "drag") && (this.tooltip.lastHover = e), this.highlight.pendingHoverEvent = e, this.hoverScheduler.schedule(), this.chart.ctx.interactionManager.getState() === 32) { 15039 const { regionX: t, regionY: i } = e, s = Nu(this.series, { x: t, y: i }, "event"); 15040 s?.series.hasEventListener("nodeClick") || s?.series.hasEventListener("nodeDoubleClick") ? this.chart.ctx.cursorManager.updateCursor(this.id, "pointer") : this.chart.ctx.cursorManager.updateCursor(this.id); 15041 } 15042 } 15043 onClick(e) { 15044 if (this.hoverDevice = "mouse", this.onHoverLikeEvent(e), this.seriesRect?.containsPoint(e.canvasX, e.canvasY) && this.checkSeriesNodeClick(e)) { 15045 this.update( 15046 4 15047 /* SERIES_UPDATE */ 15048 ), e.preventDefault(); 15049 return; 15050 } 15051 const t = { type: e.type === "click" ? "click" : "doubleClick", event: e.sourceEvent }; 15052 this.chart.fireEvent(t); 15053 } 15054 onFocus(e) { 15055 this.chart.ctx.interactionManager.getState() & e && (this.hoverDevice = this.focusIndicator.isFocusVisible() ? "keyboard" : "mouse", this.handleFocus(0, 0)); 15056 } 15057 onBlur(e) { 15058 this.chart.ctx.interactionManager.getState() & e && (this.hoverDevice = "mouse", this.clearAll(), this.focusIndicator.overrideFocusVisible(void 0)); 15059 } 15060 onNavVert(e) { 15061 this.hoverDevice = "keyboard", this.focus.seriesIndex += e.delta, this.handleFocus(e.delta, 0), e.preventDefault(); 15062 } 15063 onNavHori(e) { 15064 this.hoverDevice = "keyboard", this.focus.datumIndex += e.delta, this.handleFocus(0, e.delta), e.preventDefault(); 15065 } 15066 onSubmit(e) { 15067 const { series: t, datum: i } = this.focus, s = e.sourceEvent.sourceEvent; 15068 t !== void 0 && i !== void 0 ? t.fireNodeClickEvent(s, i) : this.chart.fireEvent({ 15069 type: "click", 15070 event: s 15071 }), e.preventDefault(); 15072 } 15073 checkSeriesNodeClick(e) { 15074 let t = { x: e.regionX, y: e.regionY }; 15075 e.region !== "series" && (t = Ii.fromCanvasPoint(this.chart.seriesRoot, e.canvasX, e.canvasY)); 15076 const i = Nu(this.series, t, "event"); 15077 return i == null ? !1 : e.type === "click" ? (i.series.fireNodeClickEvent(e.sourceEvent, i.datum), !0) : e.type === "dblclick" ? (e.preventZoomDblClick = i.distance === 0, i.series.fireNodeDoubleClickEvent(e.sourceEvent, i.datum), !0) : !1; 15078 } 15079 handleFocus(e, t) { 15080 const i = this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager); 15081 i == null ? this.handleSeriesFocus(e, t) : this.focusIndicator.updateBounds(new _e(0, 0, i.rect.width, i.rect.height)); 15082 } 15083 handleSeriesFocus(e, t, i = !1) { 15084 if (this.chart.chartType === "hierarchy") { 15085 this.handleHierarchySeriesFocus(e, t, i); 15086 return; 15087 } 15088 const { focus: s, seriesRect: n } = this, o = s.sortedSeries.filter((c) => c.visible); 15089 if (o.length === 0) 15090 return; 15091 s.seriesIndex = ot(0, s.seriesIndex, o.length - 1), s.series = o[s.seriesIndex]; 15092 const { datumIndex: r, seriesIndex: a } = s, l = s.series.pickFocus({ datumIndex: r, datumIndexDelta: t, otherIndex: a, otherIndexDelta: e, seriesRect: n }); 15093 this.updatePickedFocus(l, i); 15094 } 15095 handleHierarchySeriesFocus(e, t, i) { 15096 this.focus.series = this.focus.sortedSeries[0]; 15097 const { 15098 focus: { series: s, seriesIndex: n, datumIndex: o }, 15099 seriesRect: r 15100 } = this; 15101 if (s == null) 15102 return; 15103 const a = s.pickFocus({ datumIndex: o, datumIndexDelta: t, otherIndex: n, otherIndexDelta: e, seriesRect: r }); 15104 this.updatePickedFocus(a, i); 15105 } 15106 updatePickedFocus(e, t) { 15107 const { focus: i, hoverRect: s, seriesRect: n } = this; 15108 if (e === void 0 || i.series === void 0 || s === void 0) 15109 return; 15110 const { datum: o, datumIndex: r } = e; 15111 if (i.datumIndex = r, i.datum = o, this.focusIndicator.isFocusVisible() && this.chart.ctx.animationManager.reset(), this.focusIndicator.isFocusVisible()) { 15112 let l = z$(e); 15113 if (n != null) { 15114 const d = l.clone(); 15115 d.x += n.x, d.y += n.y, l = d; 15116 } 15117 const { x: c, y: u } = l.computeCenter(); 15118 s.containsPoint(c, u) || this.chart.ctx.zoomManager.panToBBox(this.id, s, l); 15119 } 15120 G$( 15121 n != null ? new _e(0, 0, n.width, n?.height) : void 0, 15122 this.focusIndicator, 15123 e, 15124 n?.x, 15125 n?.y 15126 ); 15127 const a = H$(s, e); 15128 if (a !== void 0 && this.hoverDevice === "keyboard") { 15129 this.tooltip.lastHover = void 0, this.highlight.appliedHoverEvent = void 0, this.highlight.pendingHoverEvent = void 0, this.highlight.stashedHoverEvent = void 0; 15130 const l = i.series.getTooltipContent(o), c = Bm.makeTooltipMeta(a, o); 15131 this.chart.ctx.highlightManager.updateHighlight(this.id, o), this.chart.ctx.tooltipManager.updateTooltip(this.id, c, l), t || this.swapChain.update(this.getDatumAriaText(o, l)); 15132 } 15133 } 15134 getDatumAriaText(e, t) { 15135 const i = t == null ? "" : EF(t); 15136 return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum", { 15137 datum: e.series.getDatumAriaText?.(e, i) ?? i 15138 }); 15139 } 15140 clearHighlight() { 15141 this.highlight.pendingHoverEvent = void 0, this.highlight.appliedHoverEvent = void 0, this.chart.ctx.highlightManager.updateHighlight(this.id
15141); 15142 } 15143 clearTooltip() { 15144 this.chart.ctx.tooltipManager.removeTooltip(this.id), this.tooltip.lastHover = void 0; 15145 } 15146 clearAll() { 15147 this.clearHighlight(), this.clearTooltip(), this.focusIndicator.updateBounds(void 0); 15148 } 15149 handleHoverHighlight(e) { 15150 this.highlight.appliedHoverEvent = this.highlight.pendingHoverEvent, this.highlight.pendingHoverEvent = void 0; 15151 const t = this.highlight.appliedHoverEvent; 15152 if (!t) 15153 return; 15154 const i = this.chart.ctx.interactionManager.getState(); 15155 if (i !== 32 && i !== 8 && i !== 1) 15156 return; 15157 const { canvasX: s, canvasY: n } = t; 15158 if (e ? this.chart.ctx.animationManager.isActive() : !this.hoverRect?.containsPoint(s, n)) { 15159 this.clearHighlight(); 15160 return; 15161 } 15162 let o = { x: t.regionX, y: t.regionY }; 15163 t.region !== "series" && (o = Ii.fromCanvasPoint(this.chart.seriesRoot, s, n)); 15164 const { range: r } = this.chart.highlight, a = r === "tooltip" ? "highlight-tooltip" : "highlight", l = Nu(this.series, o, a); 15165 if (l) { 15166 this.chart.ctx.highlightManager.updateHighlight(this.id, l.datum), this.hoverDevice = "mouse"; 15167 return; 15168 } 15169 this.chart.ctx.highlightManager.updateHighlight(this.id); 15170 } 15171 handleHoverTooltip(e, t) { 15172 const i = this.chart.ctx.interactionManager.getState(); 15173 if (i !== 32 && i !== 8 && i !== 1) 15174 return; 15175 const { canvasX: s, canvasY: n, regionX: o, regionY: r } = e, a = e.sourceEvent.target; 15176 if (t ? this.chart.ctx.animationManager.isActive() : !this.hoverRect?.containsPoint(s, n)) { 15177 this.hoverDevice == "mouse" && this.clearTooltip(); 15178 return; 15179 } 15180 if (a && this.chart.tooltip.interactive && this.chart.ctx.domManager.isManagedChildDOMElement(a, "canvas-overlay", ws)) 15181 return; 15182 let l = { x: o, y: r }; 15183 e.region !== "series" && (l = Ii.fromCanvasPoint(this.chart.seriesRoot, s, n)); 15184 const c = Nu(this.series, l, "tooltip"); 15185 if (!c) { 15186 this.hoverDevice == "mouse" && this.clearTooltip(); 15187 return; 15188 } 15189 this.hoverDevice = "mouse"; 15190 const u = c.series.getTooltipContent(c.datum); 15191 if (this.chart.tooltip.enabled && c.series.tooltipEnabled && u != null) { 15192 const f = Bm.makeTooltipMeta(e, c.datum); 15193 this.chart.ctx.tooltipManager.updateTooltip(this.id, f, u); 15194 } 15195 } 15196 changeHighlightDatum(e) { 15197 const t = /* @__PURE__ */ new Set(), { series: i = void 0, datum: s } = e.currentHighlight ?? {}, { series: n = void 0, datum: o } = e.previousHighlight ?? {}; 15198 n && t.add(n), i && t.add(i), n?.properties.cursor && o && this.chart.ctx.cursorManager.updateCursor(n.id), i?.properties.cursor && i?.properties.cursor !== "default" && s && this.chart.ctx.cursorManager.updateCursor(i.id, i.properties.cursor), i == null || n == null ? this.update( 15199 4 15200 /* SERIES_UPDATE */ 15201 ) : this.update(4, { seriesToUpdate: t }); 15202 } 15203}, JI = 30, J$ = class { 15204 constructor(e) { 15205 this.seriesRoot = e, this.groups = /* @__PURE__ */ new Map(), this.series = /* @__PURE__ */ new Map(), this.expectedSeriesCount = 1, this.mode = "normal"; 15206 } 15207 setSeriesCount(e) { 15208 this.expectedSeriesCount = e; 15209 } 15210 requestGroup(e) { 15211 const { internalId: t, type: i, contentGroup: s, seriesGrouping: n } = e, { groupIndex: o = t } = n ?? {}, r = this.series.get(t); 15212 if (r != null) 15213 throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(r)}`); 15214 this.series.size === 0 && (this.mode = this.expectedSeriesCount >= JI ? "aggressive-grouping" : "normal"); 15215 let a = this.groups.get(i); 15216 a == null && (a = /* @__PURE__ */ new Map(), this.groups.set(i, a)); 15217 const l = this.lookupIdx(o); 15218 let c = a.get(l); 15219 return c == null && (c = { 15220 type: i, 15221 id: l, 15222 seriesIds: [], 15223 group: this.seriesRoot.appendChild( 15224 new Ye({ 15225 name: `${e.contentGroup.name ?? i}-managed-layer`, 15226 zIndex: e.contentGroup.zIndex, 15227 // Set in updateLayerCompositing 15228 renderToOffscreenCanvas: !1 15229 }) 15230 ) 15231 }, a.set(l, c)), this.series.set(t, { layerState: c, seriesConfig: e }), c.seriesIds.push(t), c.group.appendChild(s), c.group; 15232 } 15233 changeGroup(e) { 15234 const { internalId: t, seriesGrouping: i, type: s, contentGroup: n, oldGrouping: o } = e, { groupIndex: r = t } = i ?? {}; 15235 this.groups.get(s)?.get(r)?.seriesIds.includes(t) || (this.series.has(t) && this.releaseGroup({ 15236 internalId: t, 15237 seriesGrouping: o, 15238 type: s, 15239 contentGroup: n 15240 }), this.requestGroup(e)); 15241 } 15242 releaseGroup(e) { 15243 const { internalId: t, contentGroup: i, type: s } = e; 15244 if (!this.series.has(t)) 15245 throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`); 15246 const n = this.series.get(t)?.layerState; 15247 n && (n.seriesIds = n.seriesIds.filter((o) => o !== t), n.group.removeChild(i)), n?.seriesIds.length === 0 ? (this.seriesRoot.removeChild(n.group), this.groups.get(n.type)?.delete(n.id), this.groups.get(s)?.delete(t)) : n != null && n.seriesIds.length > 0 && (n.group.zIndex = this.getLowestSeriesZIndex(n.seriesIds)), this.series.delete(t); 15248 }
15249 updateLayerCompositing() { 15250 this.groups.forEach((e) => { 15251 e.forEach((t) => { 15252 const { group: i, seriesIds: s } = t; 15253 let n; 15254 s.length === 0 ? n = !1 : s.length > 1 ? n = !0 : n = this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas() === !0, i.renderToOffscreenCanvas = n, i.zIndex = this.getLowestSeriesZIndex(s); 15255 }); 15256 }); 15257 } 15258 lookupIdx(e) { 15259 return this.mode === "normal" ? e : typeof e == "string" && (e = Number(e.split("-").at(-1)), !e) ? 0 : Math.floor( 15260 ot(0, e / this.expectedSeriesCount, 1) * JI 15261 ); 15262 } 15263 destroy() { 15264 this.groups.forEach((e) => { 15265 e.forEach((t) => { 15266 this.seriesRoot.removeChild(t.group); 15267 }); 15268 }), this.groups.clear(), this.series.clear(); 15269 } 15270 getLowestSeriesZIndex(e) { 15271 return e.reduce((i, s) => { 15272 const o = this.series.get(s)?.seriesConfig.contentGroup.zIndex; 15273 return i == null || o == null ? o : Uk(i, o) <= 0 ? i : o; 15274 }, void 0) ?? 1; 15275 } 15276}, eY = class { 15277 constructor(e, t, i, s, n) { 15278 this.chart = e, this.dataService = t, this.updateService = i, this.zoomManager = s, this.animationManager = n, this.dirtyZoom = !1, this.dirtyDataSource = !1, this.lastAxisZooms = /* @__PURE__ */ new Map(), this.destroyFns = [], this.destroyFns.push( 15279 this.dataService.addListener("data-source-change", () => this.onDataSourceChange()), 15280 this.dataService.addListener("data-load", () => this.onDataLoad()), 15281 this.dataService.addListener("data-error", () => this.onDataError()), 15282 this.updateService.addListener("update-complete", () => this.onUpdateComplete()), 15283 this.zoomManager.addListener("zoom-change", () => this.onZoomChange()) 15284 ); 15285 } 15286 destroy() { 15287 this.destroyFns.forEach((e) => e()); 15288 } 15289 onDataLoad() { 15290 this.animationManager.skip(), this.updateService.update( 15291 1 15292 /* UPDATE_DATA */ 15293 ); 15294 } 15295 onDataError() { 15296 this.updateService.update( 15297 3 15298 /* PERFORM_LAYOUT */ 15299 ); 15300 } 15301 onDataSourceChange() { 15302 this.dirtyDataSource = !0; 15303 } 15304 onUpdateComplete() { 15305 !this.dirtyZoom && !this.dirtyDataSource || this.updateWindow(); 15306 } 15307 onZoomChange() { 15308 this.dirtyZoom = !0; 15309 } 15310 updateWindow() { 15311 if (!this.dataService.isLazy()) 15312 return; 15313 const e = this.getValidAxis(); 15314 let t, i = !0; 15315 if (e) { 15316 const s = this.zoomManager.getAxisZoom(e.id); 15317 t = this.getAxisWindow(e, s), i = this.shouldRefresh(e, s); 15318 } 15319 this.dirtyZoom = !1, this.dirtyDataSource = !1, i && this.dataService.load({ windowStart: t?.min, windowEnd: t?.max }); 15320 } 15321 getValidAxis() { 15322 return this.chart.axes.find((e) => e.type === "time"); 15323 } 15324 shouldRefresh(e, t) { 15325 if (this.dirtyDataSource) 15326 return !0; 15327 if (!this.dirtyZoom) 15328 return !1; 15329 const i = this.lastAxisZooms.get(e.id); 15330 return i && t.min === i.min && t.max === i.max ? !1 : (this.lastAxisZooms.set(e.id, t), !0); 15331 } 15332 getAxisWindow(e, t) { 15333 const i = e.scale.getDomain?.(); 15334 if (!t || !i || i.length === 0 || isNaN(Number(i[0]))) 15335 return; 15336 const s = Number(i[1]) - Number(i[0]), n = new Date(Number(i[0]) + s * t.min), o = new Date(Number(i[0]) + s * t.max); 15337 return { min: n, max: o }; 15338 } 15339}, tY = /^((?!chrome|android).)*safari/i, iY = /Version\/(\d+(\.\d+)?)/, sY = /Chrome/, nY = /Chrome\/(\d+)/, oY = /Edg/, rY = /OPR/; 15340function aY() { 15341 const { userAgent: e } = pi().navigator; 15342 if (tY.test(e)) { 15343 const t = parseFloat(iY.exec(e)?.[1] ?? "0"), i = Math.floor(t) > 16; 15344 return i || Ee.warnOnce(`Unsupported Safari version: ${t} ; ${e}`), !i; 15345 } else if (sY.test(e) && !oY.test(e) && !rY.test(e)) { 15346 const t = parseInt(nY.exec(e)?.[1] ?? "0", 10), i = t > 126; 15347 return i || Ee.warnOnce(`Unsupported Chrome version: ${t} ; ${e}`), !i; 15348 } 15349 return !1; 15350} 15351var lY = class { 15352 constructor(e, t, i, s, n, o, r) { 15353 this.chartLike = e, this.overlays = t, this.dataService = i, this.layoutManager = s, this.localeManager = n, this.animationManager = o, this.domManager = r, this.destroyFns = [], this.overlayElem = this.domManager.addChild("canvas-overlay", "overlay"), this.overlayElem.role = "status", this.overlayElem.ariaAtomic = "false", this.overlayElem.ariaLive = "polite", this.overlayElem.classList.toggle(Sw), this.destroyFns.push(this.layoutManager.addListener("layout:complete", (a) => this.onLayoutComplete(a))); 15354 } 15355 destroy() { 15356 this.destroyFns.forEach((e) => e()), this.domManager.removeStyles("overlays"), this.domManager.removeChild("canvas-overlay", "overlay"); 15357 } 15358 onLayoutComplete({ series: { rect: e } }) { 15359 const t = this.dataService.isLoading(), i = this.chartLike.series.some((c) => c.hasData), s = this.chartLike.series.some((c) => c.visible); 15360 this.overlays.darkTheme ? this.overlayElem.classList.add($I) : this.overlayElem.classList.remove($I), this.overlayElem.style.left = `${e.x}px`, this.overlayElem.style.top = `${e.y}px`, this.overlayElem.style.width = `${e.width}px`, this.overlayElem.style.height = `${e.height}px`; 15361 const n = t, o = !t && !i, r = i && !s, a = this.overlays.unsupportedBrowser.enabled && aY(); 15362 n ? this.showOverlay(this.overlays.loading, e) : this.hideOverlay(this.overlays.loading), o ? this.showOverlay(this.overlays.noData, e) : this.hideOverlay(this.overlays.noData), r ? this.showOverlay(this.overlays.noVisibleSeries, e) : this.hideOverlay(this.overlays.noVisibleSeries), a ? this.showOverlay(this.overlays.unsupportedBrowser, e) : this.hideOverlay(this.overlays.unsupportedBrowser); 15363 const l = n || o || r || a; 15364 Yt(this.overlayElem, "aria-hidden", !l); 15365 } 15366 showOverlay(e, t) { 15367 if (!e.enabled) 15368 return; 15369 const i = e.getElement(this.animationManager, this.localeManager, t); 15370 this.overlayElem.appendChild(i); 15371 } 15372 hideOverlay(e) { 15373 e.removeElement(() => { 15374 this.overlayElem.innerText = "Â "; 15375 }, this.animationManager); 15376 } 15377}, Po = Xt.create(!0, "opts"), Nx = class extends it { 15378 constructor() { 15379 super(...arguments), this.padding = new kl(0); 15380 } 15381}; 15382S([ 15383 D(je, { optional: !0 }) 15384], Nx.prototype, "clip", 2); 15385S([ 15386 D(Be) 15387], Nx.prototype, "padding", 2); 15388var Ji = class IF extends bP {
15389 constructor(t, i) { 15390 var s; 15391 super(), this.id = So(this), this.seriesRoot = new Ks({ 15392 name: `${this.id}-series-root`, 15393 zIndex: 4 15394 /* SERIES_LAYER */ 15395 }), this.annotationRoot = new Ks({ 15396 name: `${this.id}-annotation-root`, 15397 zIndex: 8 15398 /* SERIES_ANNOTATION */ 15399 }), this.titleGroup = new Ye({ 15400 name: "titles", 15401 zIndex: 12 15402 /* SERIES_LABEL */ 15403 }), this.debug = Xt.create(), this.extraDebugStats = {}, this.data = [], this._firstAutoSize = !0, this._autoSizeNotify = new EI(), this.padding = new kl(20), this.seriesArea = new Nx(), this.keyboard = new Dx(), this.mode = "standalone", this.chartCaptions = new Jv(), this.suppressFieldDotNotation = !1, this.destroyed = !1, this._destroyFns = [], this.skipSync = !1, this.chartAnimationPhase = "initial", this.modulesManager = new I$(), this.processors = [], this.queuedUserOptions = [], this.queuedChartOptions = [], this.firstApply = !0, this._pendingFactoryUpdatesCount = 0, this._performUpdateSkipAnimations = !1, this._performUpdateNotify = new EI(), this.performUpdateType = 7, this.runningUpdateType = 7, this.updateShortcutCount = 0, this.seriesToUpdate = /* @__PURE__ */ new Set(), this.updateMutex = new Aj(), this.updateRequestors = {}, this.performUpdateTrigger = Ej(({ count: u }) => { 15404 this.destroyed || this.updateMutex.acquire(async () => { 15405 try { 15406 await this.performUpdate(u); 15407 } catch (d) { 15408 Ee.error("update error", d); 15409 } 15410 }).catch((d) => Ee.errorOnce(d)); 15411 }), this._performUpdateSplits = {}, this.axes = [], this.series = [], this._cachedData = void 0, this.onSeriesNodeClick = (u) => { 15412 this.fireEvent({ ...u, type: "seriesNodeClick" }); 15413 }, this.onSeriesNodeDoubleClick = (u) => { 15414 this.fireEvent({ ...u, type: "seriesNodeDoubleClick" }); 15415 }, this.onSeriesVisibilityChange = (u) => { 15416 this.fireEvent(u); 15417 }, this.seriesGroupingChanged = (u) => { 15418 if (!(u instanceof Tx)) 15419 return; 15420 const { series: d, seriesGrouping: p, oldGrouping: f } = u; 15421 d.contentGroup.isRoot() || this.seriesLayerManager.changeGroup({ 15422 internalId: d.internalId, 15423 type: d.type, 15424 contentGroup: d.contentGroup, 15425 renderToOffscreenCanvas: () => d.renderToOffscreenCanvas(), 15426 seriesGrouping: p, 15427 oldGrouping: f 15428 }); 15429 }, this.chartOptions = t; 15430 const n = i?.scene, o = i?.container ?? t.processedOptions.container ?? void 0, r = i?.styleContainer ?? t.specialOverrides.styleContainer, a = new Ye({ name: "root" }); 15431 a.visible = !1, a.append(this.seriesRoot), a.append(this.annotationRoot), a.append(this.titleGroup), this.titleGroup.append(this.title.node), this.titleGroup.append(this.subtitle.node), this.titleGroup.append(this.footnote.node), this.tooltip = new Rr(), this.seriesLayerManager = new J$(this.seriesRoot), this.mode = t.userOptions.mode ?? this.mode; 15432 const l = this.ctx = new Z9(this, { 15433 chartType: this.getChartType(), 15434 scene: n, 15435 root: a, 15436 container: o, 15437 styleContainer: r, 15438 syncManager: new b$(this), 15439 pixelRatio: t.specialOverrides.overrideDevicePixelRatio, 15440 updateCallback: (u, d) => this.update(u, d), 15441 updateMutex: this.updateMutex 15442 }); 15443 this._destroyFns.push( 15444 l.domManager.addListener("resize", () => this.parentResize(l.domManager.containerSize)) 15445 ), this.overlays = new Vd(), (s = this.overlays.loading).renderer ?? (s.renderer = () => R$(this.overlays.loading.getText(l.localeManager), l.animationManager.defaultDuration)), this.processors = [ 15446 new eY(this, l.dataService, l.updateService, l.zoomManager, l.animationManager), 15447 new lY( 15448 this, 15449 this.overlays, 15450 l.dataService, 15451 l.layoutManager, 15452 l.localeManager, 15453 l.animationManager, 15454 l.domManager 15455 ) 15456 ], this.highlight = new eF(), this.container = o; 15457 const c = this.getModuleContext(); 15458 l.domManager.setDataBoolean("animating", !1), this.seriesAreaManager = new X$(this.initSeriesAreaDependencies()), this._destroyFns.push( 15459 l.layoutManager.registerElement(0, (u) => { 15460 u.layoutBox.shrink(this.padding.toJson()), this.chartCaptions.positionCaptions(u); 15461 }), 15462 l.layoutManager.addListener("layout:complete", (u) => this.chartCaptions.positionAbsoluteCaptions(u)), 15463 l.dataService.addListener("data-load", (u) => { 15464 this.data = u.data; 15465 }), 15466 this.title.registerInteraction(c, "beforebegin"), 15467 this.subtitle.registerInteraction(c, "beforebegin"), 15468 this.footnote.registerInteraction(c, "afterend"), 15469 l.interactionManager.addListener("page-left", () => this.destroy()), 15470 l.animationManager.addListener("animation-frame", () => { 15471 this.update( 15472 6 15473 /* SCENE_RENDER */ 15474 ); 15475 }), 15476 l.animationManager.addListener("animation-start", () => l.domManager.setDataBoolean("animating", !0)), 15477 l.animationManager.addListener("animation-stop", () => l.domManager.setDataBoolean("animating", !1)), 15478 l.zoomManager.addListener("zoom-change", () => {
15479 this.series.forEach((d) => d.animationState?.transition("updateData")); 15480 const u = this.chartAnimationPhase !== "initial"; 15481 this.update(3, { forceNodeDataRefresh: !0, skipAnimations: u }); 15482 }) 15483 ), this.parentResize(l.domManager.containerSize); 15484 } 15485 static getInstance(t) { 15486 return IF.chartsInstances.get(t); 15487 } 15488 /** NOTE: This is exposed for use by Integrated charts only. */ 15489 get canvasElement() { 15490 return this.ctx.scene.canvas.element; 15491 } 15492 download(t, i) { 15493 this.ctx.scene.download(t, i); 15494 } 15495 getCanvasDataURL(t) { 15496 return this.ctx.scene.getDataURL(t); 15497 } 15498 toSVG() { 15499 return this.ctx.scene.toSVG(); 15500 } 15501 getOptions() { 15502 return this.queuedUserOptions.at(-1) ?? this.chartOptions.userOptions; 15503 } 15504 getChartOptions() { 15505 return this.queuedChartOptions.at(-1) ?? this.chartOptions; 15506 } 15507 initSeriesAreaDependencies() { 15508 const { ctx: t, tooltip: i, highlight: s, overlays: n, seriesRoot: o, mode: r } = this, a = this.getChartType(); 15509 return { fireEvent: this.fireEvent.bind(this), getUpdateType: () => this.performUpdateType, chartType: a, ctx: t, tooltip: i, highlight: s, overlays: n, seriesRoot: o, mode: r }; 15510 } 15511 getModuleContext() { 15512 return this.ctx; 15513 } 15514 getCaptionText() { 15515 return [this.title, this.subtitle, this.footnote].filter((t) => t.enabled && t.text).map((t) => t.text).join(". "); 15516 } 15517 getAriaLabel() { 15518 return this.ctx.localeManager.t("ariaAnnounceChart", { seriesCount: this.series.length }); 15519 } 15520 resetAnimations() { 15521 this.chartAnimationPhase = "initial"; 15522 for (const t of this.series) 15523 t.resetAnimation(this.chartAnimationPhase); 15524 for (const t of this.axes) 15525 t.resetAnimation(this.chartAnimationPhase); 15526 this.animationRect = void 0, this.ctx.animationManager.reset(); 15527 } 15528 skipAnimations() { 15529 this.ctx.animationManager.skipCurrentBatch(), this._performUpdateSkipAnimations = !0; 15530 } 15531 detachAndClear() { 15532 this.container = void 0, this.ctx.scene.clear(); 15533 } 15534 destroy(t) { 15535 if (this.destroyed) 15536 return; 15537 const i = t?.keepTransferableResources; 15538 let s; 15539 return this.performUpdateType = 7, this._destroyFns.forEach((n) => n()), this.processors.forEach((n) => n.destroy()), this.tooltip.destroy(this.ctx.domManager), this.overlays.destroy(), this.modulesManager.destroy(), i ? (this.ctx.scene.strip(), s = { 15540 container: this.container, 15541 scene: this.ctx.scene 15542 }) : (this.ctx.scene.destroy(), this.container = void 0), this.destroySeries(this.series), this.seriesLayerManager.destroy(), this.axes.forEach((n) => n.destroy()), this.axes = [], this.animationRect = void 0, this.ctx.destroy(), this.destroyed = !0, Object.freeze(this), s; 15543 } 15544 requestFactoryUpdate(t) { 15545 this.destroyed || (this._pendingFactoryUpdatesCount++, this.updateMutex.acquire(async () => { 15546 if (!this.destroyed) 15547 try { 15548 await t(this); 15549 } finally { 15550 this.destroyed || this._pendingFactoryUpdatesCount--; 15551 } 15552 }).catch((i) => Ee.errorOnce(i))); 15553 } 15554 update(t = 0, i) { 15555 const { 15556 forceNodeDataRefresh: s = !1, 15557 skipAnimations: n, 15558 seriesToUpdate: o = this.series, 15559 newAnimationBatch: r 15560 } = i ?? {}; 15561 s && this.series.forEach((a) => a.markNodeDataDirty()); 15562 for (const a of o) 15563 this.seriesToUpdate.add(a); 15564 if (n && (this.ctx.animationManager.skipCurrentBatch(), this._performUpdateSkipAnimations = !0), r && this.ctx.animationManager.isActive() && (this._performUpdateSkipAnimations = !0), this.skipSync = i?.skipSync ?? !1, this.debug.check()) { 15565 let a = new Error().stack ?? "<unknown>"; 15566 a = a.replace(/\([^)]*/g, ""), this.updateRequestors[a] = t; 15567 } 15568 t < this.performUpdateType && (this.performUpdateType = t, this.ctx.domManager.setDataBoolean("updatePending", !0), this.performUpdateTrigger.schedule(i?.backOffMs)); 15569 } 15570 async performUpdate(t) { 15571 const { performUpdateType: i, extraDebugStats: s, _performUpdateSplits: n, ctx: o } = this, r = [...this.seriesToUpdate]; 15572 this.performUpdateType = 7, this.seriesToUpdate.clear(), this.runningUpdateType = i, this.updateShortcutCount === 0 && i < 6 && (o.animationManager.startBatch(this._performUpdateSkipAnimations), o.animationManager.onBatchStop(() => this.chartAnimationPhase = "ready")), this.debug("Chart.performUpdate() - start", np[i]); 15573 let a = performance.now(); 15574 n.start ?? (n.start = a); 15575 const l = (u) => { 15576 n[u] ?? (n[u] = 0), n[u] += performance.now() - a, a = performance.now(); 15577 }; 15578 switch (i) { 15579 case 0: 15580 if (this.checkUpdateShortcut( 15581 0 15582 /* FULL */ 15583 )) 15584 break; 15585 this.ctx.updateService.dispatchPreDomUpdate(), this.updateDOM(); 15586 case 1: 15587 if (this.checkUpdateShortcut( 15588 1 15589 /* UPDATE_DATA */ 15590 )) 15591 break; 15592 await this.updateData(), l("â¬ï¸"); 15593 case 2: 15594 if (this.checkUpdateShortcut( 15595 2 15596 /* PROCESS_DATA */ 15597 )) 15598 break; 15599 await this.processData(), this.seriesAreaManager.dataChanged(), l("ð"); 15600 case 3: 15601 if (await this.checkFirstAutoSize(), this.checkUpdateShortcut( 15602 3
15603 /* PERFORM_LAYOUT */ 15604 )) 15605 break; 15606 await this.processLayout(), l("â"); 15607 case 4: { 15608 if (this.checkUpdateShortcut( 15609 4 15610 /* SERIES_UPDATE */ 15611 )) 15612 break; 15613 await this.updateSeries(r), l("ð¤"), this.updateAriaLabels(), this.seriesLayerManager.updateLayerCompositing(); 15614 } 15615 case 5: 15616 if (this.checkUpdateShortcut( 15617 5 15618 /* PRE_SCENE_RENDER */ 15619 )) 15620 break; 15621 o.updateService.dispatchPreSceneRender(this.getMinRects()), l("â"); 15622 case 6: 15623 if (this.checkUpdateShortcut( 15624 6 15625 /* SCENE_RENDER */ 15626 )) 15627 break; 15628 o.animationManager.endBatch(), s.updateShortcutCount = this.updateShortcutCount, o.scene.render({ debugSplitTimes: n, extraDebugStats: s, seriesRect: this.seriesRect }), this.extraDebugStats = {}; 15629 for (const u of Object.keys(n)) 15630 delete n[u]; 15631 this.ctx.domManager.incrementDataCounter("sceneRenders"); 15632 case 7: 15633 this.updateShortcutCount = 0, this.updateRequestors = {}, this._performUpdateSkipAnimations = !1, o.animationManager.endBatch(); 15634 } 15635 this.destroyed || (o.updateService.dispatchUpdateComplete(this.getMinRects()), this.ctx.domManager.setDataBoolean("updatePending", !1), this.runningUpdateType = 7), this._performUpdateNotify.notify(); 15636 const c = performance.now(); 15637 this.debug("Chart.performUpdate() - end", { 15638 chart: this, 15639 durationMs: Math.round((c - n.start) * 100) / 100, 15640 count: t, 15641 performUpdateType: np[i] 15642 }); 15643 } 15644 updateThemeClassName() { 15645 const t = "ag-charts-theme-", i = [`${t}default`, `${t}default-dark`]; 15646 let s = i[0], n = !1, { theme: o } = this.chartOptions.processedOptions; 15647 for (; typeof o != "string" && o != null; ) 15648 o = o.baseTheme; 15649 typeof o == "string" && (s = o.replace("ag-", t), n = o.includes("-dark")), i.includes(s) || (s = n ? i[1] : i[0]), this.ctx.domManager.setThemeClass(s); 15650 } 15651 updateDOM() { 15652 this.updateThemeClassName(); 15653 const { enabled: t, tabIndex: i } = this.keyboard; 15654 this.ctx.domManager.setTabGuardIndex(t ? i ?? 0 : -1); 15655 } 15656 updateAriaLabels() { 15657 this.ctx.domManager.updateCanvasLabel(this.getAriaLabel()); 15658 } 15659 checkUpdateShortcut(t) { 15660 return this.destroyed ? !0 : this.updateShortcutCount > 3 ? (Ee.warn( 15661 "exceeded the maximum number of simultaneous updates (4), discarding changes and rendering", 15662 this.updateRequestors 15663 ), !1) : this.performUpdateType <= t ? (this.updateShortcutCount++, !0) : !1; 15664 } 15665 async checkFirstAutoSize() { 15666 this.width != null && this.height != null || this._lastAutoSize || await this._autoSizeNotify.await(500) || this.debug("Chart.checkFirstAutoSize() - timeout for first size update."); 15667 } 15668 onAxisChange(t, i) { 15669 i == null && t.length === 0 || this.ctx.axisManager.updateAxes(i ?? [], t); 15670 } 15671 onSeriesChange(t, i) { 15672 const s = i?.filter((n) => !t.includes(n)) ?? []; 15673 this.destroySeries(s), this.seriesLayerManager?.setSeriesCount(t.length); 15674 for (const n of t) { 15675 if (i?.includes(n)) 15676 continue; 15677 const o = this.seriesLayerManager.requestGroup(n); 15678 n.attachSeries(o, this.seriesRoot, this.annotationRoot); 15679 const r = this; 15680 n.chart = { 15681 get mode() { 15682 return r.mode; 15683 }, 15684 get isMiniChart() { 15685 return !1; 15686 }, 15687 get seriesRect() { 15688 return r.seriesRect; 15689 } 15690 }, n.resetAnimation(this.chartAnimationPhase), this.addSeriesListeners(n), n.addChartEventListeners(); 15691 } 15692 this.seriesAreaManager?.seriesChanged(t); 15693 } 15694 destroySeries(t) { 15695 t?.forEach((i) => { 15696 i.removeEventListener("nodeClick", this.onSeriesNodeClick), i.removeEventListener("nodeDoubleClick", this.onSeriesNodeDoubleClick), i.removeEventListener("groupingChanged", this.seriesGroupingChanged), i.destroy(), this.seriesLayerManager.releaseGroup(i), i.detachSeries(void 0, this.seriesRoot, this.annotationRoot), i.chart = void 0; 15697 }); 15698 } 15699 addSeriesListeners(t) { 15700 this.hasEventListener("seriesNodeClick") && t.addEventListener("nodeClick", this.onSeriesNodeClick), this.hasEventListener("seriesNodeDoubleClick") && t.addEventListener("nodeDoubleClick", this.onSeriesNodeDoubleClick), this.hasEventListener("seriesVisibilityChange") && t.addEventListener("seriesVisibilityChange", this.onSeriesVisibilityChange), t.addEventListener("groupingChanged", this.seriesGroupingChanged); 15701 } 15702 assignSeriesToAxes() { 15703 for (const t of this.axes) 15704 t.boundSeries = this.series.filter((i) => i.axes[t.direction] === t); 15705 } 15706 assignAxesToSeries() { 15707 const t = Gv(this.axes, (i) => i.direction); 15708 for (const i of this.series) 15709 for (const s of i.directions) { 15710 const n = t[s]; 15711 if (!n) { 15712 Ee.warnOnce( 15713 `no available axis for direction [${s}]; check series and axes configuration.` 15714 ); 15715 return; 15716 } 15717 const o = i.getKeys(s), r = n.find( 15718 (a) => !a.keys.length || o.some((l) => a.keys.includes(l)) 15719 ); 15720 if (!r) { 15721 Ee.warnOnce( 15722 `no matching axis for direction [${s}
15722] and keys [${o}]; check series and axes configuration.` 15723 ); 15724 return; 15725 } 15726 i.axes[s] = r; 15727 } 15728 } 15729 parentResize(t) { 15730 if (t == null || this.width != null && this.height != null) 15731 return; 15732 let { width: i, height: s } = t; 15733 if (i = Math.floor(i), s = Math.floor(s), i === 0 && s === 0) 15734 return; 15735 const [n = 0, o = 0] = this._lastAutoSize ?? []; 15736 n === i && o === s || (this._lastAutoSize = [i, s], this.resize("SizeMonitor", {})); 15737 } 15738 resize(t, i) { 15739 const { scene: s, animationManager: n } = this.ctx, { inWidth: o, inHeight: r, inMinWidth: a, inMinHeight: l } = i; 15740 this.ctx.domManager.setSizeOptions( 15741 a ?? this.minWidth, 15742 l ?? this.minHeight, 15743 o ?? this.width, 15744 r ?? this.height 15745 ); 15746 const c = o ?? this.width ?? this._lastAutoSize?.[0], u = r ?? this.height ?? this._lastAutoSize?.[1]; 15747 if (this.debug(`Chart.resize() from ${t}`, { width: c, height: u, stack: new Error().stack }), !(c == null || u == null || !kt(c) || !kt(u)) && s.resize(c, u)) { 15748 n.reset(); 15749 let d = !0; 15750 (this.width == null || this.height == null) && this._firstAutoSize && (d = !1, this._firstAutoSize = !1), this.update(3, { forceNodeDataRefresh: !0, skipAnimations: d }), this._autoSizeNotify.notify(); 15751 } 15752 } 15753 async updateData() { 15754 this.series.forEach((i) => i.setChartData(this.data)); 15755 const t = this.modulesManager.mapModules((i) => i.updateData?.(this.data)); 15756 await Promise.all(t); 15757 } 15758 async processData() { 15759 this.series.some((n) => n.canHaveAxes) && (this.assignAxesToSeries(), this.assignSeriesToAxes()); 15760 for (const n of this.axes) 15761 n.processData(); 15762 const t = new rF(this.mode, this.suppressFieldDotNotation), i = this.series.map((n) => (n.resetDatumCallbackCache(), n.processData(t))), s = this.modulesManager.mapModules((n) => n.processData?.(t)); 15763 this._cachedData = t.execute(this._cachedData), await Promise.all([...i, ...s]), this.updateLegends(); 15764 } 15765 updateLegends(t) { 15766 for (const { legend: i, legendType: s } of this.modulesManager.legends()) 15767 s === "category" ? this.setCategoryLegendData(t) : this.setLegendData(s, i); 15768 } 15769 setCategoryLegendData(t) { 15770 var i; 15771 const { 15772 ctx: { legendManager: s, stateManager: n } 15773 } = this; 15774 t && this.series.forEach((r) => { 15775 const a = t.find((l) => l.seriesId === r.id); 15776 r.onLegendInitialState("category", a); 15777 }); 15778 const o = this.series.flatMap((r) => { 15779 const a = r.getLegendData("category"); 15780 return s.updateData(r.id, a), a; 15781 }); 15782 if (t) { 15783 n.setStateAndRestore(s, t); 15784 return; 15785 } 15786 if (this.mode !== "integrated") { 15787 const r = {}, a = new Map(this.series.map((l) => [l.id, l.type])); 15788 for (const { 15789 seriesId: l, 15790 symbol: { marker: c }, 15791 label: u 15792 } of o.filter((d) => !d.hideInLegend)) { 15793 if (c.fill == null) 15794 continue; 15795 const d = a.get(l), p = r[d] ?? (r[d] = {}); 15796 p[i = u.text] ?? (p[i] = c.fill), p[u.text] !== c.fill && Ee.warnOnce( 15797 `legend item '${u.text}' has multiple fill colors, this may cause unexpected behaviour.` 15798 ); 15799 } 15800 } 15801 s.update(); 15802 } 15803 setLegendData(t, i) { 15804 i.data = this.series.filter((s) => s.properties.showInLegend).flatMap((s) => s.getLegendData(t)); 15805 } 15806 async processLayout() { 15807 const t = this.animationRect, { width: i, height: s } = this.ctx.scene, n = this.ctx.layoutManager.createContext(i, s); 15808 await this.performLayout(n), t && !this.animationRect?.equals(t) && this.ctx.animationManager.skipCurrentBatch(), this.debug("Chart.performUpdate() - seriesRect", this.seriesRect); 15809 } 15810 async updateSeries(t) { 15811 const { seriesRect: i } = this; 15812 await Promise.all(t.map((s) => s.update({ seriesRect: i }))), this.ctx.seriesLabelLayoutManager.updateLabels( 15813 this.series.filter((s) => s.visible && s.usesPlacedLabels), 15814 this.padding, 15815 this.seriesRect 15816 ); 15817 } 15818 async waitForUpdate(t = 1e4, i = !1) { 15819 const s = performance.now(); 15820 for (; this._pendingFactoryUpdatesCount > 0 || this.performUpdateType !== 7 || this.runningUpdateType !== 7; ) {
15821 if (this._pendingFactoryUpdatesCount > 0 && await this.updateMutex.waitForClearAcquireQueue(), (this.performUpdateType !== 7 || this.runningUpdateType !== 7) && await this._performUpdateNotify.await(), performance.now() - s > t) { 15822 const n = `Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`; 15823 if (i) 15824 throw new Error(n); 15825 Ee.warnOnce(n); 15826 } 15827 Kk() && await Mj(); 15828 } 15829 } 15830 getMinRects() { 15831 const { width: t, height: i } = this.ctx.scene, s = this.series.map((u) => u.getMinRects(t, i)).filter(cl); 15832 if (s.length === 0) 15833 return; 15834 let n = 0, o = 0, r = 0, a = 0; 15835 for (const { minRect: u, minVisibleRect: d } of s) 15836 n = Math.max(n, u.width), o = Math.max(o, u.height), r = Math.max(r, d.width), a = Math.max(a, d.height); 15837 const l = new _e(0, 0, n, o); 15838 let c = l.clone(); 15839 return r > 0 && a > 0 && (c = new _e(0, 0, r, a)), { minRect: l, minVisibleRect: c }; 15840 } 15841 filterMiniChartSeries(t) { 15842 return t?.filter((i) => i.showInMiniChart !== !1); 15843 } 15844 applyOptions(t) { 15845 const i = this.firstApply ? t.processedOptions : t.diffOptions(this.chartOptions); 15846 if (i == null || Object.keys(i).length === 0) 15847 return; 15848 const s = this.firstApply ? {} : this.chartOptions.processedOptions, n = t.processedOptions; 15849 Po("Chart.applyOptions() - applying delta", i); 15850 const o = this.applyModules(n), r = [ 15851 "type", 15852 "data", 15853 "series", 15854 "listeners", 15855 "preset", 15856 "theme", 15857 "legend.listeners", 15858 "navigator.miniChart.series", 15859 "navigator.miniChart.label", 15860 "locale.localeText", 15861 "axes", 15862 "topology", 15863 "nodes", 15864 "initialState", 15865 "styleContainer" 15866 ]; 15867 i.listeners && this.registerListeners(this, i.listeners), sp(this, i, { skip: r }); 15868 let a = !1, l = "no-op"; 15869 i.series != null && (l = this.applySeries(this, i.series, s?.series), a = !0), l === "replaced" && this.resetAnimations(), this.applyAxes(this, n, s, l, []) && (a = !0), i.data && (this.data = i.data), i.legend?.listeners && this.modulesManager.isEnabled("legend") && Object.assign(this.legend.listeners, i.legend.listeners), i.locale?.localeText && (this.modulesManager.getModule("locale").localeText = i.locale?.localeText), this.chartOptions = t; 15870 const c = this.modulesManager.getModule("navigator"), u = this.modulesManager.getModule("zoom"); 15871 !c?.enabled && !u?.enabled && this.ctx.zoomManager.updateZoom("chart"); 15872 const d = c?.miniChart, p = n.navigator?.miniChart?.series ?? n.series; 15873 d?.enabled === !0 && p != null ? this.applyMiniChartOptions(d, p, n, s) : d?.enabled === !1 && (d.series = [], d.axes = []), this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes), a || (a = this.shouldForceNodeDataRefresh(i, l)); 15874 const m = a || o ? 0 : 3; 15875 this.maybeResetAnimations(l), Po("Chart.applyOptions() - update type", np[m], { 15876 seriesStatus: l, 15877 forceNodeDataRefresh: a 15878 }), this.update(m, { forceNodeDataRefresh: a, newAnimationBatch: !0 }), this.ctx.legendManager.clearData(), this.applyInitialState(n), this.firstApply = !1; 15879 } 15880 applyInitialState(t) { 15881 const { annotationManager: i, chartTypeOriginator: s, historyManager: n, stateManager: o, zoomManager: r } = this.ctx, { initialState: a } = t; 15882 if ("annotations" in t && t.annotations?.enabled && a?.annotations != null) { 15883 const l = a.annotations.map((c) => { 15884 const u = i.getAnnotationTypeStyles(c.type); 15885 return ht(c, u); 15886 }); 15887 o.setState(i, l); 15888 } 15889 a?.chartType != null && o.setState(s, a.chartType), (t.navigator?.enabled || t.zoom?.enabled) && a?.zoom != null && o.setState(r, a.zoom), a?.legend != null && this.updateLegends(a.legend), a != null && n.clear(); 15890 } 15891 maybeResetAnimations(t) { 15892 if (this.mode === "standalone") 15893 switch (t) { 15894 case "series-grouping-change": 15895 case "replaced": 15896 this.resetAnimations(); 15897 break; 15898 } 15899 } 15900 shouldForceNodeDataRefresh(t, i) { 15901 const s = !!t.data || i === "data-change" || i === "replaced", n = Mx.getKeys(), o = Object.values(n).some( 15902 (a) => t[a] != null 15903 ), r = t.title != null && t.subtitle != null; 15904 return s || o || r; 15905 } 15906 applyMiniChartOptions(t, i, s, n) { 15907 const o = n?.navigator?.miniChart?.series ?? n?.series, r = this.applySeries( 15908 t,
15909 this.filterMiniChartSeries(i), 15910 this.filterMiniChartSeries(o) 15911 ); 15912 this.applyAxes(t, s, n, r, [ 15913 "axes[].tick", 15914 "axes[].thickness", 15915 "axes[].title", 15916 "axes[].crosshair", 15917 "axes[].gridLine", 15918 "axes[].label" 15919 ]); 15920 const a = t.series; 15921 for (const u of a) 15922 u.properties.id = void 0; 15923 const l = t.axes, c = l.find( 15924 (u) => u.direction === "x" 15925 /* X */ 15926 ); 15927 for (const u of l) 15928 u.gridLine.enabled = !1, u.label.enabled = u === c, u.tick.enabled = !1, u.interactionEnabled = !1; 15929 if (c != null) { 15930 const u = s.navigator?.miniChart, d = u?.label, p = u?.label?.interval; 15931 if (c.line.enabled = !1, c.label.set( 15932 iw(d, ["interval", "rotation", "minSpacing", "autoRotate", "autoRotateAngle"]) 15933 ), c.tick.set( 15934 iw(p, ["enabled", "width", "size", "color", "interval", "step"]) 15935 ), c.type === "grouped-category") { 15936 c.label.enabled = !1, c.label.rotation = 0; 15937 const { depthOptions: m } = c; 15938 if (m.length === 0) 15939 m.set([{ label: { enabled: !0 } }]); 15940 else 15941 for (let y = 1; y < m.length; y++) 15942 m[y].label.enabled = !1; 15943 } 15944 const f = p?.step; 15945 f != null && (c.interval.step = f); 15946 } 15947 } 15948 applyModules(t) { 15949 const { type: i } = this.constructor; 15950 let s = !1; 15951 for (const n of fr.byType("root", "legend")) { 15952 const r = t[n.optionsKey] != null && n.chartTypes.includes(i); 15953 r !== this.modulesManager.isEnabled(n) && (r ? (this.modulesManager.addModule(n, (a) => a.moduleFactory(this.getModuleContext())), n.type === "legend" && this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene), this[n.optionsKey] = this.modulesManager.getModule(n)) : (this.modulesManager.removeModule(n), delete this[n.optionsKey]), s = !0); 15954 } 15955 return s; 15956 } 15957 initSeriesDeclarationOrder(t) { 15958 for (let i = 0; i < t.length; i++) 15959 t[i].setSeriesIndex(i); 15960 } 15961 applySeries(t, i, s) { 15962 if (!i) 15963 return "no-change"; 15964 const n = M$(t.series, i, s); 15965 if (n.status === "no-overlap") { 15966 Po(`Chart.applySeries() - creating new series instances, status: ${n.status}`, n); 15967 const u = i.map((d) => this.createSeries(d)); 15968 return this.initSeriesDeclarationOrder(u), t.series = u, "replaced"; 15969 } 15970 Po("Chart.applySeries() - matchResult", n); 15971 const o = []; 15972 let r = !1, a = !1, l = !1; 15973 const c = n.changes.toSorted((u, d) => u.targetIdx - d.targetIdx); 15974 for (const u of c) 15975 switch (a || (a = u.status === "series-grouping"), r || (r = u.diff?.data != null), l || (l = u.status !== "no-op"), u.status) { 15976 case "add": { 15977 const d = this.createSeries(u.opts); 15978 o.push(d), Po("Chart.applySeries() - created new series", d); 15979 break; 15980 } 15981 case "remove": 15982 Po(`Chart.applySeries() - removing series at previous idx ${u.idx}`, u.series); 15983 break; 15984 case "no-op": 15985 o.push(u.series), Po(`Chart.applySeries() - no change to series at previous idx ${u.idx}`, u.series); 15986 break; 15987 default: { 15988 const { series: d, diff: p, idx: f } = u; 15989 Po(`Chart.applySeries() - applying series diff previous idx ${f}`, p, d), this.applySeriesValues(d, p), d.markNodeDataDirty(), o.push(d); 15990 } 15991 } 15992 return this.initSeriesDeclarationOrder(o), Po("Chart.applySeries() - final series instances", o), t.series = o, a ? "series-grouping-change" : r ? "data-change" : l ? "updated" : "no-op"; 15993 } 15994 applyAxes(t, i, s, n, o = []) { 15995 if (!("axes" in i) || !i.axes) 15996 return !1; 15997 o = ["axes[].type", ...o]; 15998 const { axes: r } = i; 15999 return !(n === "replaced") && t.axes.length === r.length && t.axes.every((c, u) => c.type === r[u].type) && Pp(s) ? (t.axes.forEach((c, u) => { 16000 const d = s.axes?.[u] ?? {}, p = Sr(d, r[u]); 16001 Po(`Chart.applyAxes() - applying axis diff idx ${u}`, p); 16002 const f = `axes[${u}]`; 16003 sp(c, p, { path: f, skip: o }); 16004 }), !0) : (Po(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`), t.axes = this.createAxis(r, o), !0); 16005 } 16006 createSeries(t) { 16007 const i = Nn.create(t.type, this.getModuleContext()); 16008 return this.applySeriesOptionModules(i, t), this.applySeriesValues(i, t), i; 16009 } 16010 applySeriesOptionModules(t, i) { 16011 const s = t.createModuleContext(), n = t.getModuleMap(); 16012 for (const o of fr.byType("series-option")) 16013 o.optionsKey in i && o.seriesTypes.includes(t.type) && n.addModule(o, (r) => r.moduleFactory(s)); 16014 } 16015 applySeriesValues(t, i) { 16016 const s = t.getModuleMap(), { type: n, data: o, listeners: r, seriesGrouping: a, showInMiniChart: l, ...c } = i; 16017 for (const u of Hd) 16018 if (u.type === "series-option" && u.optionsKey in c) { 16019 const d = s.getModule(u.optionsKey); 16020 if (d) { 16021 const p = c[u.optionsKey];
16022 delete c[u.optionsKey], d.properties.set(p); 16023 } 16024 } 16025 t.properties.set(c), "data" in i && t.setOptionsData(o), r && this.registerListeners(t, r), "seriesGrouping" in i && (a == null ? t.seriesGrouping = void 0 : t.seriesGrouping = { ...t.seriesGrouping, ...a }); 16026 } 16027 createAxis(t, i) { 16028 const s = [], n = this.getModuleContext(); 16029 for (let o = 0; o < t.length; o++) { 16030 const r = t[o], a = ia.create(r.type, n); 16031 this.applyAxisModules(a, r), sp(a, r, { path: `axes[${o}]`, skip: i }), s.push(a); 16032 } 16033 return S$(s), s; 16034 } 16035 applyAxisModules(t, i) { 16036 const s = t.createModuleContext(), n = t.getModuleMap(); 16037 for (const o of fr.byType("axis-option")) { 16038 const r = i[o.optionsKey] != null; 16039 r !== n.isEnabled(o) && (r ? (n.addModule(o, (a) => a.moduleFactory(s)), t[o.optionsKey] = n.getModule(o)) : (n.removeModule(o), delete t[o.optionsKey])); 16040 } 16041 } 16042 registerListeners(t, i) { 16043 t.clearEventListeners(); 16044 for (const [s, n] of Object.entries(i)) 16045 Rl(n) && t.addEventListener(s, n); 16046 } 16047}; 16048Ji.chartsInstances = /* @__PURE__ */ new WeakMap(); 16049S([ 16050 Un({ 16051 newValue(e) { 16052 this.destroyed || (this.ctx.domManager.setContainer(e), Ji.chartsInstances.set(e, this)); 16053 }, 16054 oldValue(e) { 16055 Ji.chartsInstances.delete(e); 16056 } 16057 }) 16058], Ji.prototype, "container", 2); 16059S([ 16060 Un({ 16061 newValue(e) { 16062 this.resize("width option", { inWidth: e }); 16063 } 16064 }) 16065], Ji.prototype, "width", 2); 16066S([ 16067 Un({ 16068 newValue(e) { 16069 this.resize("height option", { inHeight: e }); 16070 } 16071 }) 16072], Ji.prototype, "height", 2); 16073S([ 16074 Un({ 16075 newValue(e) { 16076 this.resize("minWidth option", { inMinWidth: e }); 16077 } 16078 }) 16079], Ji.prototype, "minWidth", 2); 16080S([ 16081 Un({ 16082 newValue(e) { 16083 this.resize("minHeight option", { inMinHeight: e }); 16084 } 16085 }) 16086], Ji.prototype, "minHeight", 2); 16087S([ 16088 D(Be) 16089], Ji.prototype, "padding", 2); 16090S([ 16091 D(Be) 16092], Ji.prototype, "seriesArea", 2); 16093S([ 16094 D(Be) 16095], Ji.prototype, "keyboard", 2); 16096S([ 16097 D(si(["standalone", "integrated"], "a chart mode")) 16098], Ji.prototype, "mode", 2); 16099S([ 16100 Ri("chartCaptions.title") 16101], Ji.prototype, "title", 2); 16102S([ 16103 Ri("chartCaptions.subtitle") 16104], Ji.prototype, "subtitle", 2); 16105S([ 16106 Ri("chartCaptions.footnote") 16107], Ji.prototype, "footnote", 2); 16108S([ 16109 D(je) 16110], Ji.prototype, "suppressFieldDotNotation", 2); 16111S([ 16112 Un({ 16113 changeValue(e, t) { 16114 this.onAxisChange(e, t); 16115 } 16116 }) 16117], Ji.prototype, "axes", 2); 16118S([ 16119 Un({ 16120 changeValue(e, t) { 16121 this.onSeriesChange(e, t); 16122 } 16123 }) 16124], Ji.prototype, "series", 2); 16125var Pl = Ji, cY = class { 16126 constructor(e, t, i) { 16127 this.root = new hY(e, t, i); 16128 } 16129 clear(e) { 16130 this.root.clear(e); 16131 } 16132 addValue(e, t) { 16133 const i = { 16134 hitTester: e, 16135 value: t, 16136 distanceSquared: (s, n) => e.distanceSquared(s, n) 16137 }; 16138 this.root.addElem(i); 16139 } 16140 find(e, t) { 16141 const i = { best: { nearest: void 0, distanceSquared: 1 / 0 } }; 16142 return this.root.find(e, t, i), i.best; 16143 } 16144}, uY = class { 16145 constructor(e, t, i, s) { 16146 this.nw = e, this.ne = t, this.sw = i, this.se = s; 16147 } 16148 addElem(e) { 16149 this.nw.addElem(e), this.ne.addElem(e), this.sw.addElem(e), this.se.addElem(e); 16150 } 16151 find(e, t, i) { 16152 this.nw.find(e, t, i), this.ne.find(e, t, i), this.sw.find(e, t, i), this.se.find(e, t, i); 16153 } 16154}, dY = class { 16155 constructor(e, t, i) { 16156 this.capacity = e, this.maxdepth = t, this.boundary = i ?? _e.NaN, this.elems = [], this.subdivisions = void 0; 16157 } 16158 clear(e) { 16159 this.elems.length = 0, this.boundary = e, this.subdivisions = void 0; 16160 } 16161 addElem(e) { 16162 this.addCondition(e) && (this.subdivisions === void 0 ? this.maxdepth === 0 || this.elems.length < this.capacity ? this.elems.push(e) : this.subdivide(e) : this.subdivisions.addElem(e)); 16163 } 16164 find(e, t, i) { 16165 this.findCondition(e, t, i) && (this.subdivisions === void 0 ? this.findAction(e, t, i) : this.subdivisions.find(e, t, i)); 16166 } 16167 subdivide(e) { 16168 this.subdivisions = this.makeSubdivisions(); 16169 for (const t of this.elems) 16170 this.subdivisions.addElem(t); 16171 this.subdivisions.addElem(e), this.elems.length = 0; 16172 } 16173 makeSubdivisions() { 16174 const { x: e, y: t, width: i, height: s } = this.boundary, { capacity: n } = this, o = this.maxdepth - 1, r = i / 2, a = s / 2, l = new _e(e, t, r, a), c = new _e(e + r, t, r, a), u = new _e(e, t + a, r, a), d = new _e(e + r, t + a, r, a); 16175 return new uY( 16176 this.child(n, o, l), 16177 this.child(n, o, c), 16178 this.child(n, o, u), 16179 this.child(n, o, d) 16180 ); 16181 } 16182}, hY = class RF extends dY { 16183 addCondition(t) { 16184 const { x: i, y: s } = t.hitTester.midPoint; 16185 return this.boundary.containsPoint(i, s); 16186 } 16187 findCondition(t, i, s) { 16188 const { best: n } = s; 16189 return n.distanceSquared !== 0 && this.boundary.distanceSquared(t, i) < n.distanceSquared; 16190 } 16191 findAction(t, i, s) { 16192 const n = kv(t, i, this.elems, s.best.distanceSquared); 16193 n.nearest !== void 0 && n.distanceSquared < s.best.distanceSquared && (s.best = n); 16194 } 16195 child(t, i, s) { 16196 return new RF(t, i, s); 16197 } 16198}, _x = class extends Ud { 16199 constructor() {
16200 super(...arguments), this.showFocusBox = !0, this.clipFocusBox = !0; 16201 } 16202 getScaleInformation({ 16203 xScale: e, 16204 yScale: t 16205 }) { 16206 const i = ti.is(e), s = ti.is(t); 16207 return { isContinuousX: i, isContinuousY: s, xScaleType: e?.type, yScaleType: t?.type }; 16208 } 16209 getModulePropertyDefinitions() { 16210 const e = this.axes.x?.scale, t = this.axes.y?.scale; 16211 return this.moduleMap.mapModules((i) => i.getPropertyDefinitions(this.getScaleInformation({ xScale: e, yScale: t }))).flat(); 16212 } 16213 // Request data, but with message dispatching to series-options (modules). 16214 async requestDataModel(e, t, i) { 16215 i.props.push(...this.getModulePropertyDefinitions()); 16216 const { dataModel: s, processedData: n } = await e.request(this.id, t ?? [], i); 16217 return this.dataModel = s, this.processedData = n, this.dispatch("data-processed", { dataModel: s, processedData: n }), { dataModel: s, processedData: n }; 16218 } 16219 isProcessedDataAnimatable() { 16220 const e = this.processedData?.reduced?.animationValidation; 16221 if (!e) 16222 return !0; 16223 const { orderedKeys: t, uniqueKeys: i } = e; 16224 return t && i; 16225 } 16226 checkProcessedDataAnimatable() { 16227 this.isProcessedDataAnimatable() || this.ctx.animationManager.skipCurrentBatch(); 16228 } 16229 pickFocus(e) { 16230 const t = this.getNodeData(); 16231 if (t === void 0 || t.length === 0) 16232 return; 16233 const i = this.computeFocusDatumIndex(e, t); 16234 if (i === void 0) 16235 return; 16236 const { showFocusBox: s, clipFocusBox: n } = this, o = t[i], r = { ...e, datumIndex: i }, a = this.computeFocusBounds(r); 16237 if (a !== void 0) 16238 return { bounds: a, showFocusBox: s, clipFocusBox: n, datum: o, datumIndex: i }; 16239 } 16240 computeFocusDatumIndex(e, t) { 16241 const i = (a) => { 16242 const { missing: l = !1, enabled: c = !0, focusable: u = !0 } = t[a]; 16243 return !l && c && u; 16244 }, s = (a) => { 16245 for (; a >= 0 && !i(a); ) 16246 a += e.datumIndexDelta; 16247 return a === -1 ? void 0 : a; 16248 }, n = (a) => { 16249 for (; a < t.length && !i(a); ) 16250 a += e.datumIndexDelta; 16251 return a === t.length ? void 0 : a; 16252 }; 16253 let o; 16254 const r = ot(0, e.datumIndex, t.length - 1); 16255 return e.datumIndexDelta < 0 ? o = s(r) : e.datumIndexDelta > 0 ? o = n(r) : o = n(r) ?? s(r), o === void 0 ? e.datumIndexDelta === 0 ? void 0 : e.datumIndex - e.datumIndexDelta : o; 16256 } 16257}, Aa = class extends it { 16258 constructor() { 16259 super(...arguments), this.fill = "rgba(255,255,255, 0.33)", this.stroke = "rgba(0, 0, 0, 0.4)", this.strokeWidth = 2; 16260 } 16261}; 16262S([ 16263 D(Ft, { optional: !0 }) 16264], Aa.prototype, "fill", 2); 16265S([ 16266 D(Pt, { optional: !0 }) 16267], Aa.prototype, "fillOpacity", 2); 16268S([ 16269 D(Ft, { optional: !0 }) 16270], Aa.prototype, "stroke", 2); 16271S([ 16272 D(Te, { optional: !0 }) 16273], Aa.prototype, "strokeWidth", 2); 16274S([ 16275 D(Pt, { optional: !0 }) 16276], Aa.prototype, "strokeOpacity", 2); 16277S([ 16278 D(ya, { optional: !0 }) 16279], Aa.prototype, "lineDash", 2); 16280S([ 16281 D(Te, { optional: !0 }) 16282], Aa.prototype, "lineDashOffset", 2); 16283var uy = class extends it { 16284}; 16285S([ 16286 D(Te, { optional: !0 }) 16287], uy.prototype, "strokeWidth", 2); 16288S([ 16289 D(Pt, { optional: !0 }) 16290], uy.prototype, "dimOpacity", 2); 16291S([ 16292 D(je, { optional: !0 }) 16293], uy.prototype, "enabled", 2); 16294var TF = class extends it { 16295 constructor() { 16296 super(...arguments), this.color = "black"; 16297 } 16298}; 16299S([ 16300 D(Ft, { optional: !0 }) 16301], TF.prototype, "color", 2); 16302var Bx = class extends it { 16303 constructor() { 16304 super(...arguments), this.enabled = !0; 16305 } 16306}; 16307S([ 16308 D(je, { optional: !0 }) 16309], Bx.prototype, "enabled", 2); 16310var yg = class extends it { 16311 constructor() { 16312 super(...arguments), this.item = new Aa(), this.series = new uy(), this.text = new TF(); 16313 } 16314}; 16315S([ 16316 D(Be) 16317], yg.prototype, "item", 2); 16318S([ 16319 D(Be) 16320], yg.prototype, "series", 2); 16321S([ 16322 D(Be) 16323], yg.prototype, "text", 2); 16324var Wn = class extends it { 16325 constructor() { 16326 super(...arguments), this.visible = !0, this.focusPriority = 1 / 0, this.showInLegend = !0, this.cursor = "default", this.nodeClickRange = "exact", this.highlight = new Bx(), this.highlightStyle = new yg(); 16327 } 16328}; 16329S([ 16330 D(Me, { optional: !0 }) 16331], Wn.prototype, "id", 2); 16332S([ 16333 D(je) 16334], Wn.prototype, "visible", 2); 16335S([ 16336 D(mk, { optional: !0 })
16337], Wn.prototype, "focusPriority", 2); 16338S([ 16339 D(je) 16340], Wn.prototype, "showInLegend", 2); 16341S([ 16342 D(Me) 16343], Wn.prototype, "cursor", 2); 16344S([ 16345 D(jv) 16346], Wn.prototype, "nodeClickRange", 2); 16347S([ 16348 D(Be) 16349], Wn.prototype, "highlight", 2); 16350S([ 16351 D(Be) 16352], Wn.prototype, "highlightStyle", 2); 16353var Kc = { 16354 x: ["xKey"], 16355 y: ["yKey"] 16356}, Zc = { 16357 x: ["xName"], 16358 y: ["yName"] 16359}, Gx = class extends vg { 16360 constructor(e, t, i, s) { 16361 super(e, t, i, s), this.xKey = s.properties.xKey, this.yKey = s.properties.yKey; 16362 } 16363}, Da = class extends Wn { 16364 constructor() { 16365 super(...arguments), this.pickOutsideVisibleMinorAxis = !1; 16366 } 16367}; 16368S([ 16369 D(Me, { optional: !0 }) 16370], Da.prototype, "legendItemName", 2); 16371S([ 16372 D(je, { optional: !0 }) 16373], Da.prototype, "pickOutsideVisibleMinorAxis", 2); 16374var Um = 100, Fl = class extends _x { 16375 constructor({ 16376 pathsPerSeries: e = ["path"], 16377 hasMarkers: t = !1, 16378 hasHighlightedLabels: i = !1, 16379 pathsZIndexSubOrderOffset: s = [], 16380 datumSelectionGarbageCollection: n = !0, 16381 markerSelectionGarbageCollection: o = !0, 16382 animationAlwaysUpdateSelections: r = !1, 16383 animationResetFns: a, 16384 directionKeys: l, 16385 directionNames: c, 16386 ...u 16387 }) { 16388 if (super({ 16389 directionKeys: l, 16390 directionNames: c, 16391 canHaveAxes: !0, 16392 ...u 16393 }), this.NodeEvent = Gx, this.dataNodeGroup = this.contentGroup.appendChild( 16394 new Ye({ name: `${this.id}-series-dataNodes`, zIndex: 0 }) 16395 ), this.markerGroup = this.contentGroup.appendChild( 16396 new Ye({ name: `${this.id}-series-markers`, zIndex: 1 }) 16397 ), this.labelGroup = this.contentGroup.appendChild( 16398 new Ks({ name: `${this.id}-series-labels` }) 16399 ), this.labelSelection = _i.select(this.labelGroup, Qi), this.highlightSelection = _i.select( 16400 this.highlightNode, 16401 () => this.opts.hasMarkers ? this.markerFactory() : this.nodeFactory() 16402 ), this.highlightLabelSelection = _i.select(this.highlightLabel, Qi), this.annotationSelections = /* @__PURE__ */ new Set(), this.minRectsCache = { 16403 dirtyNodeData: !0 16404 }, this.debug = Xt.create(), !l || !c) 16405 throw new Error(`Unable to initialise series type ${this.type}`); 16406 this.opts = { 16407 pathsPerSeries: e, 16408 hasMarkers: t, 16409 hasHighlightedLabels: i, 16410 pathsZIndexSubOrderOffset: s, 16411 directionKeys: l, 16412 directionNames: c, 16413 animationResetFns: a, 16414 animationAlwaysUpdateSelections: r, 16415 datumSelectionGarbageCollection: n, 16416 markerSelectionGarbageCollection: o 16417 }, this.paths = e.map((d) => new sn({ name: `${this.id}-${d}` })), this.datumSelection = _i.select( 16418 this.dataNodeGroup, 16419 () => this.nodeFactory(), 16420 n 16421 ), this.markerSelection = _i.select( 16422 this.markerGroup, 16423 () => this.markerFactory(), 16424 o 16425 ), this.animationState = new gg( 16426 "empty", 16427 { 16428 empty: { 16429 update: { 16430 target: "ready", 16431 action: (d) => this.animateEmptyUpdateReady(d) 16432 }, 16433 reset: "empty", 16434 skip: "ready", 16435 disable: "disabled" 16436 }, 16437 ready: { 16438 updateData: "waiting", 16439 clear: "clearing", 16440 highlight: (d) => this.animateReadyHighlight(d), 16441 highlightMarkers: (d) => this.animateReadyHighlightMarkers(d), 16442 resize: (d) => this.animateReadyResize(d), 16443 reset: "empty", 16444 skip: "ready", 16445 disable: "disabled" 16446 }, 16447 waiting: { 16448 update: { 16449 target: "ready", 16450 action: (d) => { 16451 this.ctx.animationManager.isSkipped() ? this.resetAllAnimation(d) : this.animateWaitingUpdateReady(d); 16452 } 16453 }, 16454 reset: "empty", 16455 skip: "ready", 16456 disable: "disabled" 16457 }, 16458 disabled: { 16459 update: (d) => this.resetAllAnimation(d), 16460 reset: "empty" 16461 }, 16462 clearing: { 16463 update: { 16464 target: "empty", 16465 action: (d) => this.animateClearingUpdateEmpty(d) 16466 }, 16467 reset: "empty", 16468 skip: "ready" 16469 } 16470 }, 16471 () => this.checkProcessedDataAnimatable() 16472 ); 16473 } 16474 get contextNodeData() { 16475 return this._contextNodeData; 16476 } 16477 getNodeData() { 16478 return this.contextNodeData?.nodeData; 16479 } 16480 attachSeries(e, t, i) { 16481 super.attachSeries(e, t, i), this.attachPaths(this.paths, t, i); 16482 } 16483 detachSeries(e, t, i) { 16484 super.detachSeries(e, t, i), this.detachPaths(this.paths, t, i); 16485 } 16486 attachPaths(e, t, i) { 16487 for (const s of e) 16488 this.contentGroup.appendChild(s); 16489 } 16490 detachPaths(e, t, i) { 16491 for (const s of e) 16492 this.contentGroup.removeChild(s); 16493 } 16494 renderToOffscreenCanvas() { 16495 const e = this.getNodeData(); 16496 return e != null && e.length > Um; 16497 } 16498 resetAnimation(e) { 16499 e === "initial" ? this.animationState.transition("reset") : e === "ready" ? this.animationState.transition("skip") : e === "disabled" && this.animationState.transition("disable"); 16500 } 16501 addChartEventListeners() { 16502 this.destroyFns.push( 16503 this.ctx.chartEventManager.addListener("legend-item-click", (e) => this.onLegendItemClick(e)), 16504 this.ctx.chartEventManager.addListener( 16505 "legend-item-double-click", 16506 (e) => this.onLegendItemDoubleClick(e) 16507 ) 16508 ); 16509 } 16510 destroy() { 16511 super.destroy(), this._contextNodeData = void 0; 16512 } 16513 update({ seriesRect: e }) { 16514 const { visible: t, _contextNodeData: i } = this, n = this.ctx.highlightManager?.getActiveHighlight()?.series === this, o = this.checkResize(e), r = this.updateHighlightSelection(n); 16515 this.updateSelections(t), this.updateNodes(r, n, t); 16516 const a = this.getAnimationData(e, i); 16517 a && (o && this.animationState.transition("resize", a), this.animationState.transition("update", a)); 16518 } 16519 updateSelections(e) { 16520 var t;
16521 const i = !this.opts.animationAlwaysUpdateSelections && this.ctx.animationManager.isSkipped(); 16522 if (!(!e && i) && !(!this.nodeDataRefresh && !this.isPathOrSelectionDirty())) { 16523 if (this.nodeDataRefresh) { 16524 this.nodeDataRefresh = !1, this.debug("CartesianSeries.updateSelections() - calling createNodeData() for", this.id), this.markQuadtreeDirty(), this._contextNodeData = this.createNodeData(); 16525 const s = this.isProcessedDataAnimatable(); 16526 this._contextNodeData && ((t = this._contextNodeData).animationValid ?? (t.animationValid = s)), this.minRectsCache.dirtyNodeData = !0; 16527 const { dataModel: n, processedData: o } = this; 16528 n !== void 0 && o !== void 0 && this.dispatch("data-update", { dataModel: n, processedData: o }); 16529 } 16530 this.updateSeriesSelections(); 16531 } 16532 } 16533 updateSeriesSelections(e) { 16534 const { datumSelection: t, labelSelection: i, markerSelection: s, paths: n } = this, o = this._contextNodeData; 16535 if (!o) 16536 return; 16537 const { nodeData: r, labelData: a, itemId: l } = o; 16538 this.updatePaths({ seriesHighlighted: e, itemId: l, contextData: o, paths: n }), this.datumSelection = this.updateDatumSelection({ nodeData: r, datumSelection: t }), this.labelSelection = this.updateLabelSelection({ labelData: a, labelSelection: i }) ?? i, this.opts.hasMarkers && (this.markerSelection = this.updateMarkerSelection({ nodeData: r, markerSelection: s })); 16539 } 16540 markerFactory() { 16541 const e = bo(); 16542 return new e(); 16543 } 16544 updateNodes(e, t, i) { 16545 const { 16546 highlightSelection: s, 16547 highlightLabelSelection: n, 16548 opts: { hasMarkers: o, hasHighlightedLabels: r } 16549 } = this, a = !this.ctx.animationManager.isSkipped(), l = this.visible && this._contextNodeData != null && i; 16550 this.contentGroup.visible = a || l, this.highlightGroup.visible = (a || l) && t; 16551 const c = this.getOpacity(); 16552 o ? (this.updateMarkerNodes({ 16553 markerSelection: s, 16554 isHighlight: !0 16555 }), this.animationState.transition("highlightMarkers", s)) : (this.updateDatumNodes({ 16556 datumSelection: s, 16557 isHighlight: !0 16558 }), this.animationState.transition("highlight", s)), r && this.updateLabelNodes({ labelSelection: n }); 16559 const { dataNodeGroup: u, markerGroup: d, datumSelection: p, labelSelection: f, markerSelection: m, paths: y, labelGroup: b } = this, { itemId: C } = this.contextNodeData ?? {}; 16560 u.opacity = c, u.visible = a || l, b.visible = l, o && (d.opacity = c, d.visible = l), b && (b.opacity = c), this.updatePathNodes({ 16561 seriesHighlighted: t, 16562 itemId: C, 16563 paths: y, 16564 opacity: c, 16565 visible: l, 16566 animationEnabled: a 16567 }), u.visible && (this.updateDatumNodes({ datumSelection: p, highlightedItems: e, isHighlight: !1 }), this.usesPlacedLabels || this.updateLabelNodes({ labelSelection: f }), o && this.updateMarkerNodes({ markerSelection: m, isHighlight: !1 })); 16568 } 16569 getHighlightLabelData(e, t) { 16570 const i = e.filter( 16571 (s) => s.datum === t.datum && s.itemId === t.itemId 16572 ); 16573 return i.length === 0 ? void 0 : i; 16574 } 16575 getHighlightData(e, t) { 16576 return t ? [t] : void 0; 16577 } 16578 updateHighlightSelection(e) { 16579 const { highlightSelection: t, highlightLabelSelection: i, _contextNodeData: s } = this; 16580 if (!s) 16581 return; 16582 const n = this.ctx.highlightManager?.getActiveHighlight(), o = e && n?.datum ? n : void 0; 16583 let r, a; 16584 if (o != null) { 16585 const l = this.isLabelEnabled(), { labelData: c, nodeData: u } = s; 16586 a = this.getHighlightData(u, o), r = l ? this.getHighlightLabelData(c, o) : void 0; 16587 } 16588 return this.highlightSelection = this.updateHighlightSelectionItem({ 16589 items: a, 16590 highlightSelection: t 16591 }), this.highlightLabelSelection = this.updateHighlightSelectionLabel({ 16592 items: r, 16593 highlightLabelSelection: i 16594 }), a; 16595 } 16596 markQuadtreeDirty() { 16597 this.quadtree = void 0; 16598 } 16599 *datumNodesIter() { 16600 for (const { node: e } of this.datumSelection) 16601 e.datum.missing !== !0 && (yield e); 16602 } 16603 getQuadTree() { 16604 if (this.quadtree === void 0) { 16605 const { width: e, height: t } = this.ctx.scene.canvas, i = new _e(0, 0, e, t); 16606 this.quadtree = new cY(100, 10, i), this.initQuadTree(this.quadtree); 16607 } 16608 return this.quadtree; 16609 } 16610 initQuadTree(e) { 16611 } 16612 pickNodeExactShape(e) { 16613 const t = super.pickNodeExactShape(e); 16614 if (t) 16615 return t; 16616 const { x: i, y: s } = e, { 16617 opts: { hasMarkers: n } 16618 } = this; 16619 let o; 16620 const { dataNodeGroup: r, markerGroup: a } = this; 16621 if (o = r.pickNode(i, s), !o && n && (o = a?.pickNode(i, s)), o && o.datum.missing !== !0) 16622 return { datum: o.datum, distance: 0 }; 16623 for (const l of this.moduleMap.modules()) { 16624 const { datum: c } = l.pickNodeExact(e) ?? {}; 16625 if (c != null && c?.missing !== !0) 16626 return { datum: c, distance: 0 }; 16627 } 16628 } 16629 pickNodeClosestDatum(e) { 16630 const { x: t, y: i } = e, { axes: s, _contextNodeData: n } = this; 16631 if (!n) 16632 return; 16633 const o = s.x, r = s.y, a = { x: t, y: i }; 16634 let l = 1 / 0, c; 16635 for (const u of n.nodeData) { 16636 const { point: { x: d = NaN, y: p = NaN } = {} } = u; 16637 if (isNaN(d) || isNaN(p) || !(o?.inRange(d) && r?.inRange(p))) 16638 continue; 16639 const m = Math.max((a.x - d) ** 2 + (a.y - p) ** 2, 0); 16640 m < l && (l = m, c = u); 16641 } 16642 for (const u of this.moduleMap.modules()) { 16643 const d = u.pickNodeNearest(e); 16644 if (d !== void 0 && d.distanceSquared < l) { 16645 l = d.distanceSquared, c = d.datum; 16646 break; 16647 } 16648 } 16649 if (c) { 16650 const u = Math.max(Math.sqrt(l) - (c.point?.size ?? 0), 0); 16651 return { datum: c, distance: u }; 16652 } 16653 } 16654 pickNodeMainAxisFirst(e, t) { 16655 const { x: i, y: s } = e, { axes: n, _contextNodeData: o } = this, { pickOutsideVisibleMinorAxis: r } = this.properties; 16656 if (!o) 16657 return; 16658 const a = n.x, l = n.y, c = [a, l].filter(zd.is).map((m) => m.direction); 16659 if (t && c.length === 0) 16660 return; 16661 const [ 16662 u = "x" 16663 /* X */ 16664 ] = c, d = [i, s]; 16665 u !== "x" && d.reverse(); 16666 const p = [1 / 0, 1 / 0]; 16667 let f; 16668 for (const m of o.nodeData) { 16669 const { x: y = NaN, y: b = NaN } = m.point ?? m.midPoint ?? {}; 16670 if (isNaN(y) || isNaN(b) || m.missing === !0) 16671 continue; 16672 const C = [a?.inRange(y), l?.inRange(b)]; 16673 if (u !== "x" && C.reverse(), !C[0] || !r && !C[1]) 16674 continue; 16675 const w = [y, b]; 16676 u !== "x" && w.reverse(); 16677 let M = !0; 16678 for (let A = 0; A < w.length; A++) { 16679 const I = Math.abs(w[A] - d[A]); 16680 if (I > p[A]) { 16681 M = !1; 16682 break; 16683 } else I < p[A] && (p[A] = I, p.fill(1 / 0, A + 1, p.length)); 16684 } 16685 M && (f = m); 16686 } 16687 if (f) { 16688 let m = Math.max( 16689 p[0] ** 2 + p[1] ** 2 - (f.point?.size ?? 0), 16690 0 16691 ); 16692 for (const y of this.moduleMap.modules()) { 16693 const b = y.pickNodeMainAxisFirst(e); 16694 if (b !== void 0 && b.distanceSquared < m) { 16695 f = b.datum, m = b.distanceSquared; 16696 break; 16697 } 16698 } 16699 return { datum: f, distance: Math.sqrt(m) }; 16700 } 16701 } 16702 isPathOrSelectionDirty() { 16703 return !1; 16704 } 16705 shouldFlipXY() { 16706 return !1; 16707 } 16708 /** 16709 * Get the minimum bounding box that contains any adjacent two nodes. The axes are treated independently, so this
16710 * may not represent the same two points for both directions. The dimensions represent the greatest distance 16711 * between any two adjacent nodes. 16712 */ 16713 getMinRects(e, t) { 16714 const { dirtyNodeData: i, sizeCache: s, minRect: n, minVisibleRect: o } = this.minRectsCache, r = JSON.stringify({ width: e, height: t }); 16715 if (!(r !== s) && !i && n && o) 16716 return { minRect: n, minVisibleRect: o }; 16717 const l = this.computeMinRects(e, t); 16718 return this.minRectsCache = { 16719 dirtyNodeData: !1, 16720 sizeCache: r, 16721 minRect: l?.minRect, 16722 minVisibleRect: l?.minVisibleRect 16723 }, l; 16724 } 16725 computeMinRects(e, t) { 16726 const i = this._contextNodeData; 16727 if (!i?.nodeData.length) 16728 return; 16729 const { nodeData: s } = i, n = Array(s.length), o = Array(s.length); 16730 for (const [w, { midPoint: M }] of s.entries()) 16731 n[w] = M?.x ?? 0, o[w] = M?.y ?? 0; 16732 n.sort((w, M) => w - M), o.sort((w, M) => w - M); 16733 let r, a, l, c, u = 0, d = 0; 16734 for (let w = 1; w < s.length; w++) 16735 n[w] >= 0 && (r ?? (r = w)), n[w] > e && (a ?? (a = w)), o[w] >= 0 && (l ?? (l = w)), o[w] > t && (c ?? (c = w)), u = Math.max(u, n[w] - n[w - 1]), d = Math.max(d, o[w] - o[w - 1]); 16736 a ?? (a = s.length), c ?? (c = s.length); 16737 const p = r != null && a != null ? n.slice(r, a) : [], f = l != null && c != null ? o.slice(l, c) : []; 16738 let m = 0, y = 0; 16739 for (let w = 1; w < Math.max(p.length, f.length); w++) { 16740 const M = p[w], A = p[w - 1], I = f[w], L = f[w - 1]; 16741 M != null && A != null && (m = Math.max(m, M - A)), I != null && L != null && (y = Math.max(y, I - L)); 16742 } 16743 const b = new _e(0, 0, u, d), C = new _e(0, 0, m, y); 16744 return { minRect: b, minVisibleRect: C }; 16745 } 16746 updateHighlightSelectionItem(e) { 16747 const { 16748 opts: { hasMarkers: t } 16749 } = this, { items: i, highlightSelection: s } = e, n = i ?? []; 16750 if (t) { 16751 const o = s; 16752 return this.updateMarkerSelection({ nodeData: n, markerSelection: o }); 16753 } else 16754 return this.updateDatumSelection({ 16755 nodeData: n, 16756 datumSelection: s 16757 }); 16758 } 16759 updateHighlightSelectionLabel(e) { 16760 return this.updateLabelSelection({ 16761 labelData: e.items ?? [], 16762 labelSelection: e.highlightLabelSelection 16763 }); 16764 } 16765 updateDatumSelection(e) { 16766 return e.datumSelection; 16767 } 16768 updateDatumNodes(e) { 16769 } 16770 updateMarkerSelection(e) { 16771 return e.markerSelection; 16772 } 16773 updateMarkerNodes(e) { 16774 } 16775 updatePaths(e) { 16776 e.paths.forEach((t) => t.visible = !1); 16777 } 16778 updatePathNodes(e) { 16779 const { paths: t, opacity: i, visible: s } = e; 16780 for (const n of t) 16781 n.opacity = i, n.visible = s; 16782 } 16783 resetPathAnimation(e) { 16784 const { path: t } = this.opts?.animationResetFns ?? {}; 16785 t && e.paths.forEach((i) => { 16786 zi([i], t); 16787 }); 16788 } 16789 resetDatumAnimation(e) { 16790 const { datum: t } = this.opts?.animationResetFns ?? {}; 16791 t && zi([e.datumSelection], t); 16792 } 16793 resetLabelAnimation(e) { 16794 const { label: t } = this.opts?.animationResetFns ?? {}; 16795 t && zi([e.labelSelection], t); 16796 } 16797 resetMarkerAnimation(e) { 16798 const { marker: t } = this.opts?.animationResetFns ?? {}; 16799 t && this.opts.hasMarkers && zi([e.markerSelection], t); 16800 } 16801 resetAllAnimation(e) { 16802 this.ctx.animationManager.stopByAnimationGroupId(this.id), this.resetPathAnimation(e), this.resetDatumAnimation(e), this.resetLabelAnimation(e), this.resetMarkerAnimation(e), e.contextData?.animationValid === !1 && this.ctx.animationManager.skipCurrentBatch(); 16803 } 16804 animateEmptyUpdateReady(e) { 16805 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(e); 16806 } 16807 animateWaitingUpdateReady(e) { 16808 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(e); 16809 } 16810 animateReadyHighlight(e) { 16811 const { datum: t } = this.opts?.animationResetFns ?? {}; 16812 t && zi([e], t); 16813 } 16814 animateReadyHighlightMarkers(e) { 16815 const { marker: t } = this.opts?.animationResetFns ?? {}; 16816 t && zi([e], t); 16817 } 16818 animateReadyResize(e) { 16819 this.resetAllAnimation(e); 16820 } 16821 animateClearingUpdateEmpty(e) { 16822 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(e); 16823 } 16824 getAnimationData(e, t) { 16825 const { _contextNodeData: i } = this; 16826 return i ? { 16827 datumSelection: this.datumSelection, 16828 markerSelection: this.markerSelection, 16829 labelSelection: this.labelSelection, 16830 annotationSelections: [...this.annotationSelections], 16831 contextData: i, 16832 previousContextData: t, 16833 paths: this.paths, 16834 seriesRect: e 16835 } : void 0; 16836 } 16837 updateLabelSelection(e) { 16838 return e.labelSelection; 16839 } 16840 getScaling(e) { 16841 if (e instanceof ZS) { 16842 const { range: t, domain: i } = e; 16843 return { 16844 type: "log", 16845 convert: (s) => e.convert(s), 16846 domain: [i[0], i[1]], 16847 range: [t[0], t[1]] 16848 }; 16849 } else if (e instanceof ti) { 16850 const { range: t } = e, i = e.getDomain(); 16851 return { 16852 type: "continuous", 16853 domain: [i[0], i[1]], 16854 range: [t[0], t[1]] 16855 }; 16856 } else if (e instanceof Tl) { 16857 const { domain: t } = e; 16858 return { 16859 type: "category", 16860 domain: t, 16861 inset: e.inset, 16862 step: e.step 16863 }; 16864 } 16865 } 16866 calculateScaling() { 16867 const e = {}; 16868 for (const t of Object.values($S)) { 16869 const i = this.axes[t]; 16870 if (!i) 16871 continue;
16872 const s = this.getScaling(i.scale); 16873 s != null && (e[t] = s); 16874 } 16875 return e; 16876 } 16877}, pY = ["top", "right", "bottom", "left"], dy = class LF extends Pl { 16878 constructor(t, i) { 16879 super(t, i), this.paired = !0, this.firstSeriesTranslation = !0, this.lastUpdateClipRect = void 0; 16880 } 16881 onAxisChange(t, i) { 16882 super.onAxisChange(t, i), this.ctx != null && this.ctx.zoomManager.updateAxes(t); 16883 } 16884 destroySeries(t) { 16885 super.destroySeries(t), this.firstSeriesTranslation = !0; 16886 } 16887 getChartType() { 16888 return "cartesian"; 16889 } 16890 setRootClipRects(t) { 16891 const { seriesRoot: i, annotationRoot: s } = this; 16892 i.setClipRect(t), s.setClipRect(t); 16893 } 16894 performLayout(t) { 16895 const { firstSeriesTranslation: i, seriesRoot: s, annotationRoot: n } = this, { clipSeries: o, seriesRect: r, visible: a } = this.updateAxes(t.layoutBox); 16896 this.seriesRoot.visible = a, this.seriesRect = r, this.animationRect = t.layoutBox; 16897 const { x: l, y: c } = r; 16898 if (i) { 16899 for (const f of [s, n]) 16900 f.translationX = Math.floor(l), f.translationY = Math.floor(c); 16901 this.firstSeriesTranslation = !1; 16902 } else { 16903 const { translationX: f, translationY: m } = s; 16904 Mr( 16905 this.id, 16906 "seriesRect", 16907 this.ctx.animationManager, 16908 [s, n], 16909 { translationX: f, translationY: m }, 16910 { translationX: Math.floor(l), translationY: Math.floor(c) }, 16911 { phase: "update" } 16912 ); 16913 } 16914 const u = r.clone().grow(this.seriesArea.padding), d = this.seriesArea.clip || o ? u : void 0, { lastUpdateClipRect: p } = this; 16915 this.lastUpdateClipRect = d, this.ctx.animationManager.isActive() && p != null ? this.ctx.animationManager.animate({ 16916 id: this.id, 16917 groupId: "clip-rect", 16918 phase: "update", 16919 from: p, 16920 to: u, 16921 onUpdate: (f) => this.setRootClipRects(f), 16922 onComplete: () => this.setRootClipRects(d) 16923 }) : this.setRootClipRects(d), this.ctx.layoutManager.emitLayoutComplete(t, { 16924 axes: this.axes.map((f) => f.getLayoutState()), 16925 series: { 16926 visible: a, 16927 rect: r, 16928 paddedRect: u, 16929 shouldFlipXY: this.shouldFlipXY() 16930 }, 16931 clipSeries: o 16932 }); 16933 } 16934 updateAxes(t) { 16935 const { clipSeries: i, seriesRect: s, overflows: n } = this.resolveAxesLayout(t); 16936 for (const o of this.axes) 16937 o.update(), o.setCrossLinesVisible(!n), this.clipAxis(o, s, t); 16938 return { clipSeries: i, seriesRect: s, visible: !n }; 16939 } 16940 // Iteratively try to resolve axis widths - since X axis width affects Y axis range, 16941 // and vice-versa, we need to iteratively try and find a fit for the axes and their 16942 // ticks/labels. 16943 resolveAxesLayout(t) { 16944 let i, s, n = 0; 16945 const o = 10; 16946 do 16947 if (s = i ?? this.getDefaultState(), i = this.updateAxesPass(new Map(s.axisAreaWidths), t.clone()), n++ > o) { 16948 Ee.warn("Max iterations reached. Unable to stabilize axes layout."); 16949 break; 16950 } 16951 while (!this.isLayoutStable(i, s)); 16952 return this.lastAreaWidths = i.axisAreaWidths, i; 16953 } 16954 updateAxesPass(t, i) { 16955 const s = /* @__PURE__ */ new Map(), n = {}; 16956 let o = !1, r = !1; 16957 for (const C of pY) { 16958 const w = this.seriesArea.padding[C], M = this.axes.findLast((A) => A.position === C); 16959 M ? M.seriesAreaPadding = w : i.shrink(w, C); 16960 } 16961 const a = (t.get("left") ?? 0) + (t.get("right") ?? 0), l = (t.get("top") ?? 0) + (t.get("bottom") ?? 0), c = this.buildCrossLinePadding(t); 16962 i.width <= a + c.hPadding || i.height <= l + c.vPadding ? o = !0 : i.shrink(c); 16963 const u = i.clone().shrink(Object.fromEntries(t)); 16964 for (const C of this.axes) { 16965 const { position: w = "left", direction: M } = C; 16966 this.sizeAxis(C, u, w); 16967 const A = this.getSyncedDomain(C), I = M === "y", L = C.calculateLayout(A, C.nice ? n[M] : void 0); 16968 n[M] ?? (n[M] = L.primaryTickCount), r || (r = C.dataDomain.clipped || C.visibleRange[0] > 0 || C.visibleRange[1] < 1), s.set(C.id, Math.ceil(C.thickness ?? (I ? L.bbox.width : L.bbox.height))); 16969 } 16970 const d = Object.entries(Gv(this.axes, (C) => C.position ?? "left")), { width: p, height: f, canvas: m } = this.ctx.scene, y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(); 16971 for (const [C, w] of d) { 16972 let A = C === "left" || C === "right" ? f % m.pixelRatio : p % m.pixelRatio, I = 0; 16973 for (const L of w) { 16974 b.set(L.id, A);
16975 const k = s.get(L.id) ?? 0; 16976 I = Math.max(I, A + k), L.layoutConstraints.stacked && (A += k + LF.AxesPadding); 16977 } 16978 y.set(C, Math.ceil(I)); 16979 } 16980 for (const [C, w] of d) 16981 this.positionAxes({ 16982 axes: w, 16983 position: C, 16984 axisWidths: s, 16985 axisOffsets: b, 16986 axisAreaWidths: y, 16987 axisBound: i, 16988 seriesRect: u 16989 }); 16990 return { clipSeries: r, seriesRect: u, axisAreaWidths: y, overflows: o }; 16991 } 16992 buildCrossLinePadding(t) { 16993 const i = { top: 0, right: 0, bottom: 0, left: 0, hPadding: 0, vPadding: 0 }; 16994 this.axes.forEach((s) => { 16995 s.crossLines?.forEach((n) => { 16996 n.calculatePadding?.(i); 16997 }); 16998 }); 16999 for (const [s, n = 0] of Object.entries(i)) 17000 i[s] = Math.max(n - (t.get(s) ?? 0), 0); 17001 return i.hPadding = i.left + i.right, i.vPadding = i.top + i.bottom, i; 17002 } 17003 clampToOutsideSeriesRect(t, i, s, n) { 17004 const o = s === "x" ? t.x : t.y, r = s === "x" ? t.width : t.height; 17005 return n === 1 ? Math.min(i, o + r) : Math.max(i, o); 17006 } 17007 getSyncedDomain(t) { 17008 const i = this.modulesManager.getModule("sync"); 17009 if (!i?.enabled) 17010 return; 17011 const s = i.getSyncedDomain(t); 17012 if (s && t.dataDomain.domain.length) { 17013 let n; 17014 const { domain: o } = t.scale; 17015 if (ti.is(t.scale)) { 17016 const [r, a] = Ds(s); 17017 n = r !== o[0] || a !== o[1]; 17018 } else 17019 n = !ul(s, o); 17020 n && !this.skipSync && i.updateSiblings(); 17021 } 17022 return s; 17023 } 17024 sizeAxis(t, i, s) { 17025 const n = t instanceof zd, o = s === "left" || s === "right", { width: r, height: a } = i, l = o ? a : r; 17026 let c = 0, u = l, { min: d, max: p } = this.ctx.zoomManager.getAxisZoom(t.id); 17027 const { width: f, unit: m, align: y } = t.layoutConstraints; 17028 m === "px" ? u = c + f : u = u * f / 100, y === "end" && (c = l - (u - c), u = l), o && (n ? [d, p] = [1 - p, 1 - d] : [c, u] = [u, c]), t.range = [c, u], t.visibleRange = [d, p], t.gridLength = o ? r : a; 17029 } 17030 positionAxes(t) { 17031 const { axes: i, axisBound: s, axisWidths: n, axisOffsets: o, axisAreaWidths: r, seriesRect: a, position: l } = t, c = r.get(l) ?? 0; 17032 let u = "x", d = "y", p = 1; 17033 (l === "top" || l === "bottom") && (u = "y", d = "x"); 17034 let f = s[u]; 17035 (l === "right" || l === "bottom") && (p = -1, f += u === "x" ? s.width : s.height); 17036 for (const m of i) { 17037 const y = r.get(d === "x" ? "left" : "top") ?? 0, b = n.get(m.id) ?? 0, C = o.get(m.id) ?? 0; 17038 m.gridPadding = c - C - b, m.translation[d] = s[d] + y, m.translation[u] = this.clampToOutsideSeriesRect( 17039 a, 17040 f + p * (C + b), 17041 u, 17042 p 17043 ); 17044 } 17045 } 17046 shouldFlipXY() { 17047 return this.series.every((t) => t instanceof Fl && t.shouldFlipXY()); 17048 } 17049 getDefaultState() { 17050 const t = /* @__PURE__ */ new Map(); 17051 if (this.lastAreaWidths) 17052 for (const { position: i = "left" } of this.axes) { 17053 const s = this.lastAreaWidths.get(i); 17054 s != null && t.set(i, s); 17055 }
17056 return { axisAreaWidths: t, clipSeries: !1, overflows: !1 }; 17057 } 17058 isLayoutStable(t, i) { 17059 if (i.overflows !== t.overflows || i.clipSeries !== t.clipSeries) 17060 return !1; 17061 for (const s of t.axisAreaWidths.keys()) 17062 if (!i.axisAreaWidths.has(s)) 17063 return !1; 17064 for (const [s, n] of i.axisAreaWidths.entries()) { 17065 const o = t.axisAreaWidths.get(s); 17066 if ((n != null || o != null) && n !== o) 17067 return !1; 17068 } 17069 return !0; 17070 } 17071 clipAxis(t, i, s) { 17072 const n = Math.ceil(t.gridLine?.width ?? 0), o = Math.ceil(t.line?.width ?? 0); 17073 let { width: r, height: a } = i; 17074 switch (r += t.direction === "x" ? n : o, a += t.direction === "y" ? n : o, t.clipGrid(i.x, i.y, r, a), t.position) { 17075 case "left": 17076 case "right": 17077 t.clipTickLines( 17078 s.x, 17079 i.y - n, 17080 s.width + n, 17081 i.height + n * 2 17082 ); 17083 break; 17084 case "top": 17085 case "bottom": 17086 t.clipTickLines( 17087 i.x - n, 17088 s.y, 17089 i.width + n * 2, 17090 s.height + n 17091 ); 17092 break; 17093 } 17094 } 17095}; 17096dy.className = "CartesianChart"; 17097dy.type = "cartesian"; 17098dy.AxesPadding = 15; 17099var gY = dy, rp = class kF { 17100 constructor(t, i, s) { 17101 this.factoryApi = i, this.licenseManager = s, this.chart = t; 17102 } 17103 static isInstance(t) { 17104 return t instanceof kF || t.constructor?.name === "AgChartInstanceProxy" && t.chart != null ? !0 : t.chart != null && this.validateImplementation(t); 17105 } 17106 static validateImplementation(t) { 17107 const i = ["getOptions", "destroy"], s = Object.keys(Object.getPrototypeOf(t) ?? {}); 17108 return i.every((n) => s.includes(n)); 17109 } 17110 async update(t) { 17111 this.factoryApi.update(t, this), await this.chart.waitForUpdate(); 17112 } 17113 async updateDelta(t) { 17114 this.factoryApi.updateUserDelta(this, t), await this.chart.waitForUpdate(); 17115 } 17116 getOptions() { 17117 const t = As(this.chart.getOptions()); 17118 for (const i of Object.keys(t)) 17119 i.startsWith("_") && delete t[i]; 17120 return t; 17121 } 17122 waitForUpdate() { 17123 return this.chart.waitForUpdate(); 17124 } 17125 async download(t) { 17126 const i = await this.prepareResizedChart(this, t); 17127 try { 17128 i.chart.download(t?.fileName, t?.fileFormat); 17129 } finally { 17130 i.destroy(); 17131 } 17132 } 17133 async __toSVG(t) { 17134 const i = await this.prepareResizedChart(this, { width: 600, height: 300, ...t }); 17135 try { 17136 return i.chart.toSVG(); 17137 } finally { 17138 i.destroy(); 17139 } 17140 } 17141 async getImageDataURL(t) { 17142 const i = await this.prepareResizedChart(this, t); 17143 try { 17144 return i.chart.getCanvasDataURL(t?.fileFormat); 17145 } finally { 17146 i.destroy(); 17147 } 17148 } 17149 getState() { 17150 return this.factoryApi.caretaker.save(...this.getEnabledOriginators()); 17151 } 17152 async setState(t) { 17153 const i = this.getEnabledOriginators(); 17154 if (!i.includes(this.chart.ctx.legendManager)) { 17155 await this.setStateOriginators(t, i); 17156 return; 17157 } 17158 await this.setStateOriginators( 17159 t, 17160 i.filter((s) => s !== this.chart.ctx.zoomManager) 17161 ), await this.setStateOriginators(t, [this.chart.ctx.zoomManager]); 17162 } 17163 resetAnimations() { 17164 this.chart.resetAnimations(); 17165 } 17166 skipAnimations() { 17167 this.chart.skipAnimations(); 17168 } 17169 destroy() { 17170 this.releaseChart ? (this.releaseChart(), this.chart = null) : (this.chart.publicApi = void 0, this.chart.destroy()); 17171 } 17172 async prepareResizedChart(t, i = {}) { 17173 const { chart: s } = t, n = i.width ?? s.width ?? s.ctx.scene.canvas.width, o = i.height ?? s.height ?? s.ctx.scene.canvas.height, r = t.getState(), a = fr.hasEnterpriseModules(), l = { 17174 ...s.chartOptions.processedOverrides, 17175 container: document.createElement("div"), 17176 width: n, 17177 height: o 17178 }, c = s.getOptions(); 17179 a && (l.animation = { enabled: !1 }, this.licenseManager?.isDisplayWatermark() && (l.foreground = { 17180 text: this.licenseManager.getWatermarkMessage(), 17181 image: { 17182 url: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjY
17182yMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=", 17183 width: 170, 17184 height: 25, 17185 right: 25, 17186 bottom: 50, 17187 opacity: 0.7 17188 } 17189 })); 17190 const u = { ...s.chartOptions.specialOverrides }, d = { ...s.chartOptions.optionMetadata }; 17191 i.width != null && i.height != null && (u.overrideDevicePixelRatio = 1); 17192 const p = this.factoryApi.create(c, l, u, d);
17193 await p.setState(r), p.chart.ctx.zoomManager.updateZoom("chartProxy", s.ctx.zoomManager.getZoom()), p.chart.ctx.legendManager.clearData(), p.chart.ctx.legendManager.update(s.ctx.legendManager.getData()), s.series.forEach((m, y) => { 17194 m.visible || (p.chart.series[y].visible = !1); 17195 }); 17196 const f = []; 17197 for (const m of s.modulesManager.legends()) 17198 f.push(m.legend.pagination?.currentPage ?? 0); 17199 for (const m of p.chart.modulesManager.legends()) { 17200 const y = f.shift() ?? 0; 17201 m.legend.pagination && m.legend.pagination.setPage(y); 17202 } 17203 return p.chart.update(0, { forceNodeDataRefresh: !0 }), await p.waitForUpdate(), p; 17204 } 17205 getEnabledOriginators() { 17206 const { 17207 chartOptions: { processedOptions: t, optionMetadata: i }, 17208 ctx: { annotationManager: s, chartTypeOriginator: n, zoomManager: o, legendManager: r } 17209 } = this.chart, a = []; 17210 return "annotations" in t && t.annotations?.enabled && a.push(s), i.presetType === "price-volume" && a.push(n), (t.navigator?.enabled || t.zoom?.enabled) && a.push(o), "legend" in this.chart && a.push(r), a; 17211 } 17212 async setStateOriginators(t, i) { 17213 this.factoryApi.caretaker.restore(t, ...i), this.chart.ctx.updateService.update(2, { forceNodeDataRefresh: !0 }), await this.chart.waitForUpdate(); 17214 } 17215}; 17216rp.chartInstances = /* @__PURE__ */ new WeakMap(); 17217S([ 17218 Un({ 17219 oldValue(e) { 17220 e.destroyed || (e.publicApi = void 0), rp.chartInstances.delete(e); 17221 }, 17222 newValue(e) { 17223 e && (e.publicApi = this, rp.chartInstances.set(e, this)); 17224 } 17225 }) 17226], rp.prototype, "chart", 2); 17227var eR = rp, zx = class extends Xv { 17228 constructor(e) { 17229 super(), this.ctx = e, this.localeText = void 0; 17230 } 17231}; 17232S([ 17233 jc((e) => { 17234 e.ctx.localeManager.setLocaleText(e.localeText); 17235 }), 17236 D(fk, { optional: !0 }) 17237], zx.prototype, "localeText", 2); 17238S([ 17239 jc((e) => { 17240 e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText); 17241 }), 17242 D(tn, { optional: !0 }) 17243], zx.prototype, "getLocaleText", 2); 17244var fY = { 17245 type: "root", 17246 optionsKey: "locale", 17247 packageType: "community", 17248 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"], 17249 moduleFactory: (e) => new zx(e) 17250}; 17251function mY(e, t = 1 / 0) { 17252 switch (typeof e) { 17253 case "undefined": 17254 return "undefined"; 17255 case "number": 17256 if (isNaN(e)) 17257 return "NaN"; 17258 if (e === 1 / 0) 17259 return "Infinity"; 17260 if (e === -1 / 0) 17261 return "-Infinity"; 17262 default: 17263 return e = JSON.stringify(e), e.length > t ? `${e.slice(0, t)}... (+${e.length - t} characters)` : e; 17264 } 17265} 17266function vY(e) { 17267 let t = 1; 17268 for (let i = 0; i < e.length; i++) 17269 e.charCodeAt(i) === 10 && t++; 17270 return t; 17271} 17272var Dh = /* @__PURE__ */ new WeakMap(); 17273function Wm(e, t) { 17274 const i = JSON.stringify(e, null, 0); 17275 return Dh.has(t) || Dh.set(t, /* @__PURE__ */ new Map()), Dh.get(t)?.has(i) || Dh.get(t)?.set(i, t(e)), Dh.get(t)?.get(i); 17276} 17277function Us(e) { 17278 const t = /* @__PURE__ */ new Map(), i = (...o) => o.map((r) => typeof r == "object" || typeof r == "symbol" ? r : (t.has(r) || t.set(r, { v: r }), t.get(r))), s = {}, n = /* @__PURE__ */ new WeakMap(); 17279 return (...o) => { 17280 const r = o.length === 0 ? [s] : i(...o); 17281 let a = n; 17282 for (const u of r.slice(0, -1)) 17283 a.has(u) || a.set(u, /* @__PURE__ */ new WeakMap()), a = a.get(u); 17284 const l = r.at(-1); 17285 let c = a.get(l); 17286 return c || (c = e(...o), a.set(l, c)), c; 17287 }; 17288} 17289function hy(e, t = [0, 0]) { 17290 for (const i of e) 17291 typeof i == "number" && (i < 0 && (t[0] += i), i > 0 && (t[1] += i)); 17292 return t; 17293} 17294function yY(e, t) { 17295 return { 17296 id: e, 17297 matchGroupIds: [t], 17298 type: "aggregate", 17299 aggregateFunction: (s) => hy(s) 17300 }; 17301} 17302function PF(e, t) { 17303 return { 17304 id: e, 17305 type: "aggregate", 17306 matchGroupIds: t ? [t] : void 0, 17307 aggregateFunction: (i) => hy(i), 17308 groupAggregateFunction: (i, s = [0, 0]) => (s[0] += i?.[0] ?? 0, s[1] += i?.[1] ?? 0, s) 17309 }; 17310} 17311function CY(e, t) { 17312 return { 17313 id: e, 17314 matchGroupIds: [t], 17315 type: "aggregate", 17316 aggregateFunction: (s) => qa.extendDomain(s) 17317 }; 17318} 17319function Aw(e) { 17320 return { 17321 id: e, 17322 type: "aggregate", 17323 aggregateFunction: () => [0, 1], 17324 groupAggregateFunction: (t, i = [0, 0]) => (i[0] += t?.[0] ?? 0, i[1] += t?.[1] ?? 0, i) 17325 }; 17326} 17327function FF(e, t) { 17328 return { 17329 id: e, 17330 matchGroupIds: t ? [t] : void 0, 17331 type: "aggregate", 17332 aggregateFunction: (s) => hy(s), 17333 groupAggregateFunction: (s, n = [0, 0, -1]) => (n[0] += s?.[0] ?? 0, n[1] += s?.[1] ?? 0, n[2]++, n), 17334 finalFunction: (s = [0, 0, 0]) => { 17335 const n = s[0] + s[1]; 17336 return n >= 0 ? [0, n / s[2]] : [n / s[2], 0]; 17337 } 17338 }; 17339} 17340function Dw(e, t, i) { 17341 const s = { 17342 id: e, 17343 matchGroupIds: i ? [i] : void 0, 17344 type: "aggregate", 17345 aggregateFunction: (n, o = []) => { 17346 const r = o[1] - o[0]; 17347 return t.aggregateFunction(n).map((a) => a / r); 17348 } 17349 }; 17350 return t.groupAggregateFunction && (s.groupAggregateFunction = t.groupAggregateFunction), s; 17351} 17352function OF(e) { 17353 return () => { 17354 let t = 0; 17355 return (i) => kt(i) ? (t += e ? Math.max(0, i) : i, t) : i; 17356 }; 17357} 17358function NF() { 17359 return () => { 17360 let e = 0; 17361 return (t) => { 17362 if (!kt(t)) 17363 return t; 17364 const i = e; 17365 return e += t, i; 17366 }; 17367 }; 17368} 17369function _F(e) { 17370 return e != null && Zv(e); 17371} 17372function bY(e) { 17373 return e != null; 17374} 17375function BF(e) { 17376 switch (e) { 17377 case "number": 17378 case "log": 17379 case "ordinal-time": 17380 case "time": 17381 case "color": 17382 return _F; 17383 default: 17384 return bY; 17385 } 17386} 17387function GF(e) { 17388 switch (e) { 17389 case "number": 17390 case "log": 17391 case "time": 17392 case "color": 17393 return "range"; 17394 default: 17395 return "category"; 17396 } 17397} 17398function Uo(e, t, i = {}) { 17399 return { 17400 property: e, 17401 type: "key", 17402 valueType: GF(t), 17403 validation: BF(t), 17404 ...i 17405 }; 17406} 17407function pt(e, t, i = {}) { 17408 return { 17409 property: e, 17410 type: "value", 17411 valueType: GF(t), 17412 validation: BF(t), 17413 ...i 17414 }; 17415} 17416function Hx(e, t = {}) { 17417 const { min: i = -1 / 0, max: s = 1 / 0, ...n } = t; 17418 return { 17419 type: "value", 17420 property: e, 17421 valueType: "range", 17422 validation: _F, 17423 processor: () => (o) => kt(o) ? ot(i, o, s) : o, 17424 ...n 17425 }; 17426} 17427function Op(e, t, i = {}) { 17428 const { onlyPositive: s, ...n } = i; 17429 return { 17430 ...pt(e, t, n), 17431 processor: OF(s) 17432 }; 17433} 17434function wY(e, t, i = {}) { 17435 return { 17436 ...pt(e, t, i), 17437 processor: NF() 17438 }; 17439} 17440function gl(e, t, i, s, n) { 17441 return [ 17442 pt(e, n, s), 17443 WF(s.groupId, t, i, s.separateNegative), 17444 ...s.rangeId != null ? [CY(s.rangeId, s.groupId)] : [] 17445 ]; 17446} 17447function zF(e, t, i) { 17448 return [pt(e, t, i), jF(i.groupId)]; 17449} 17450var HF = { 17451 type: "reducer", 17452 property: "smallestKeyInterval", 17453 initialValue: 1 / 0, 17454 reducer: () => { 17455 let e = NaN; 17456 return (t = 1 / 0, i) => { 17457 const s = i.keys[0], n = Math.abs(s - e); 17458 return e = s, !isNaN(n) && n > 0 && n < t ? n : t; 17459 }; 17460 } 17461}, VF = { 17462 type: "reducer", 17463 property: "largestKeyInterval", 17464 initialValue: -1 / 0, 17465 reducer: () => { 17466 let e = NaN; 17467 return (t = -1 / 0, i) => { 17468 const s = i.keys[0], n = Math.abs(s - e); 17469 return e = s, !isNaN(n) && n > 0 && n > t ? n : t; 17470 }; 17471 } 17472}, UF = { 17473 type: "processor", 17474 property: "sortedGroupDomain", 17475 calculate: ({ domain: { groups: e } }) => e?.slice().sort((t, i) => { 17476 for (let s = 0; s < t.length; s++) { 17477 const n = t[s] - i[s]; 17478 if (n !== 0) 17479 return n; 17480 } 17481 return 0; 17482 }) 17483}; 17484function SY({ normaliseTo: e, mode: t }) { 17485 const i = (s, n) => { 17486 if (n === 0) 17487 return null; 17488 const o = (s ?? 0) * e / n; 17489 return o >= 0 ? Math.min(e, o) : Math.max(-e, o); 17490 }; 17491 return () => () => (s, n, o) => { 17492 const r = xY(t, s, n, o); 17493 for (const a of n) { 17494 const l = s[a], c = l[o]; 17495 if (c == null) { 17496 l[o] = void 0; 17497 continue; 17498 } 17499 l[o] = // eslint-disable-next-line sonarjs/no-nested-functions 17500 typeof c == "number" ? i(c, r) : c.map((u) => i(u, r)); 17501 } 17502 }; 17503} 17504function xY(e, t, i, s) { 17505 const n = [0, 0]; 17506 for (const o of i) { 17507 const a = t[o][s]; 17508 if (a == null) 17509 continue; 17510 const l = typeof a == "number" ? a : Math.max(...a.map((u) => u ?? 0)), c = l < 0 ? 0 : 1; 17511 e === "sum" ? n[c] += l : c === 0 ? n[c] = Math.min(n[c], l) : n[c] = Math.max(n[c], l); 17512 } 17513 return Math.max(Math.abs(n[0]), n[1]); 17514} 17515function py(e, t, i = "sum") { 17516 return { 17517 type: "group-value-processor", 17518 matchGroupIds: e, 17519 adjust: Wm({ normaliseTo: t, mode: i }, SY) 17520 }; 17521} 17522function MY({ 17523 normaliseTo: e, 17524 zeroDomain: t, 17525 rangeMin: i, 17526 rangeMax: s 17527}) { 17528 const n = e[1] - e[0], o = (r, a, l) => { 17529 const c = e[0] + (r - a) / l * n; 17530 return l === 0 ? t : c >= e[1] ? e[1] : c < e[0] ? e[0] : c; 17531 }; 17532 return () => (r, a) => { 17533 let [l, c] = r.domain.values[a]; 17534 i != null && (l = i), s != null && (c = s); 17535 const u = c - l; 17536 r.domain.values[a] = [e[0], e[1]]; 17537 const { rawData: d } = r, p = r.columns[a]; 17538 for (let f = 0; f < d.length; f += 1) 17539 p[f] = o(p[f], l, u); 17540 }; 17541} 17542function Sc(e, t, i, s, n) { 17543 return { 17544 type: "property-value-processor", 17545 property: e, 17546 adjust: Wm({ normaliseTo: t, rangeMin: s, rangeMax: n, zeroDomain: i }, MY) 17547 }; 17548} 17549var ap = 1, jm = 2, tR = (e, t, i, s) => { 17550 let n = ap | jm; 17551 if (t.valueType === "category") 17552 return i.length !== e && (n &= ~ap), n; 17553 let o = s[0]?.valueOf(); 17554 for (let r = 1; n !== 0 && r < s.length; r++) { 17555 const a = s[r]?.valueOf(); 17556 (!Number.isFinite(a) || o > a) && (n &= ~jm), Number.isFinite(a) && o === a && (n &= ~ap), o = a; 17557 } 17558 return n; 17559};
17560function jd(e) { 17561 return { 17562 type: "processor", 17563 property: "animationValidation", 17564 calculate(t) { 17565 const { keys: i, values: s } = t.defs, { 17566 input: { count: n }, 17567 domain: { keys: o, values: r }, 17568 rawData: a, 17569 keys: l, 17570 columns: c 17571 } = t; 17572 let u = ap | jm; 17573 if (a.length !== 0) { 17574 for (let d = 0; u !== 0 && d < i.length; d++) 17575 u &= tR(n, i[d], o[d], l[d]); 17576 for (let d = 0; u !== 0 && d < s.length; d++) { 17577 const p = s[d]; 17578 e?.includes(p.id) && (u &= tR(n, p, r[d], c[d])); 17579 } 17580 } 17581 return { 17582 uniqueKeys: (u & ap) !== 0, 17583 orderedKeys: (u & jm) !== 0 17584 }; 17585 } 17586 }; 17587} 17588function AY({ mode: e, separateNegative: t }) { 17589 return () => () => (i, s, n) => { 17590 const o = [0, 0]; 17591 for (const r of s) { 17592 const a = i[r], l = a[n], c = Pv(l) && t ? 0 : 1; 17593 kt(l) && (e === "normal" && (o[c] += l), a[n] = o[c], e === "trailing" && (o[c] += l)); 17594 } 17595 }; 17596} 17597function DY({ mode: e, sum: t }) { 17598 return () => { 17599 const i = []; 17600 let s = !0; 17601 return () => (n, o, r) => { 17602 let a = 0; 17603 for (const l of o) { 17604 const c = n[l], u = c[r], d = s && t === "current" ? 0 : i[l]; 17605 i[l] = u; 17606 const p = t === "current" ? u : d; 17607 if (!kt(u) || !kt(d)) { 17608 c[r] = a; 17609 continue; 17610 } 17611 e === "normal" && (a += p), c[r] = a, e === "trailing" && (a += p); 17612 } 17613 s = !1; 17614 }; 17615 }; 17616} 17617function WF(e, t, i, s = !1) { 17618 let n; 17619 if (t.startsWith("window")) { 17620 const o = t.endsWith("-trailing") ? "trailing" : "normal"; 17621 n = Wm({ mode: o, sum: i }, DY); 17622 } else 17623 n = Wm({ mode: t, separateNegative: s }, AY); 17624 return { 17625 type: "group-value-processor", 17626 matchGroupIds: [e], 17627 adjust: n 17628 }; 17629} 17630function EY() { 17631 return () => (e, t, i) => { 17632 const s = new Float64Array(32); 17633 let n = 0; 17634 for (const o of t) { 17635 const r = e[o], a = r[i]; 17636 s[n] = Number.isFinite(a) ? a : NaN, n += 1, r[i] = s.subarray(0, n); 17637 } 17638 }; 17639} 17640function jF(e) { 17641 return { 17642 type: "group-value-processor", 17643 matchGroupIds: [e], 17644 adjust: EY 17645 }; 17646} 17647function iR(e) { 17648 return e.id ?? e.property; 17649} 17650function IY(e, t, i) { 17651 const s = /* @__PURE__ */ new Map(), n = t.defs.values; 17652 for (let a = 0; a < n.length; a += 1) { 17653 const l = n[a]; 17654 if (l.scopes?.includes(e) === !1) 17655 continue; 17656 const c = iR(l); 17657 if (s.has(c)) 17658 return; 17659 s.set(c, a); 17660 } 17661 const o = [], r = i.defs.values; 17662 for (let a = 0; a < r.length; a += 1) { 17663 const l = r[a]; 17664 if (l.scopes?.includes(e) === !1) 17665 continue; 17666 const c = iR(l), u = s.get(c); 17667 if (u == null) 17668 return; 17669 s.delete(c), o.push({ previousIndex: u, nextIndex: a }); 17670 } 17671 if (s.size === 0) 17672 return o; 17673} 17674function Jb(e, t, i, s, n) { 17675 for (const { previousIndex: o, nextIndex: r } of i) { 17676 const a = e[o], l = t[r], c = a[s], u = l[n]; 17677 if (c !== u) 17678 return !1; 17679 } 17680 return !0; 17681} 17682function $d(e, t, i = !0) { 17683 return { 17684 type: "processor", 17685 property: "diff", 17686 calculate(s, n) { 17687 const o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), c = t.keys, u = s.keys, d = t.columns, p = s.columns, f = IY(e, t, s); 17688 if (f == null) 17689 return n; 17690 const m = Math.max(t.rawData.length, s.rawData.length); 17691 for (let C = 0; C < m; C++) { 17692 const w = C < t.rawData.length, M = C < s.rawData.length, A = w ? kp(c, C) : void 0, I = A != null ? ps(A) : "", L = M ? kp(u, C) : void 0, k = L != null ? ps(L) : ""; 17693 if (M && w && I === k) { 17694 Jb(d, p, f, C, C) || a.set(k, C); 17695 continue; 17696 } 17697 const B = l.get(k); 17698 B != null ? ((i || !Jb(d, p, f, B, C)) && (a.set(k, C), o.set(k, C)), l.delete(k)) : M && r.set(k, C); 17699 const N = r.get(I); 17700 N != null ? ((i || !Jb(d, p, f, N, C)) && (a.set(I, C), o.set(I, C)), r.delete(I)) : w && (a.delete(I), l.set(I, C)); 17701 } 17702 const b = { 17703 changed: r.size > 0 || a.size > 0 || l.size > 0, 17704 added: new Set(r.keys()), 17705 updated: new Set(a.keys()), 17706 removed: new Set(l.keys()), 17707 moved: new Set(o.keys()) 17708 }; 17709 return { 17710 ...n, 17711 [e]: b 17712 }; 17713 } 17714 }; 17715} 17716function ps(e, ...t) { 17717 let i; 17718 return hi(e) ? i = e.map((n) => fw(n)).join("___") : i = fw(e), (typeof i == "string" || typeof i == "number" || typeof i == "boolean" || i instanceof Date) && t.length > 0 && (i += `___${t.join("___")}`), i; 17719} 17720var RY = class { 17721 constructor() { 17722 this.top = 1 / 0, this.right = -1 / 0, this.bottom = -1 / 0, this.left = 1 / 0; 17723 } 17724 update(e, t) { 17725 e > this.right && (this.right = e), e < this.left && (this.left = e), t > this.bottom && (this.bottom = t), t < this.top && (this.top = t); 17726 } 17727}, TY = class $F { 17728 constructor(t = "", i, s) { 17729 this.label = t, this.parent = i, this.refId = s, this.x = 0, this.y = 0, this.subtreeLeft = NaN, this.subtreeRight = NaN, this.children = [], this.leafCount = 0, this.prelim = 0, this.mod = 0, this.ancestor = this, this.change = 0, this.shift = 0, this.index = 0, this.screenX = 0, this.screenY = 0, this.depth = i ? i.depth + 1 : 0; 17730 } 17731 insertTick(t, i) { 17732 let s = this; 17733 for (let n = 0; n < t.length; n++) { 17734 const o = t[n], r = n !== t.length - 1, { children: a } = s, l = a.find((c) => c.label === o); 17735 if (l && r) 17736 s = l; 17737 else { 17738 const c = new $F(o, s, i); 17739 c.index = a.length, a.push(c), r && (s = c); 17740 } 17741 } 17742 } 17743 getLeftSibling() { 17744 return this.index > 0 ? this.parent?.children[this.index - 1] : void 0; 17745 } 17746 getLeftmostSibling() { 17747 return this.index > 0 ? this.parent?.children[0] : void 0; 17748 } 17749 // traverse the left contour of a subtree, return the successor of v on this contour 17750 nextLeft() { 17751 return this.children[0]; 17752 } 17753 // traverse the right contour of a subtree, return the successor of v on this contour 17754 nextRight() { 17755 return this.children.at(-1); 17756 } 17757 getSiblings() { 17758 return this.parent?.children.filter((t, i) => i !== this.index) ?? []; 17759 } 17760}; 17761function LY(e) { 17762 const t = e.reduce((s, n) => s < n.length ? n.length : s, 0), i = new TY(); 17763 for (let s = 0; s < e.length; s++) { 17764 const n = e[s]; 17765 for (; n.length < t; ) 17766 n.push(""); 17767 i.insertTick(n, s); 17768 } 17769 return i; 17770} 17771function kY(e, t, i) { 17772 const s = t.index - e.index, n = i / s; 17773 t.change -= n, t.shift += i, e.change += n, t.prelim += i, t.mod += i; 17774} 17775function PY(e, t, i) { 17776 return t.getSiblings().indexOf(e.ancestor) >= 0 ? e.ancestor : i; 17777} 17778function FY({ children: e }) { 17779 let t = 0, i = 0; 17780 for (let s = e.length - 1; s >= 0; s--) { 17781 const n = e[s]; 17782 n.prelim += t, n.mod += t, i += n.change, t += n.shift + i; 17783 } 17784} 17785function OY(e, t) { 17786 const i = e.getLeftSibling(); 17787 if (i) { 17788 let s = e, n = e, o = i, r = n.getLeftmostSibling(), a = n.mod, l = s.mod, c = o.mod, u = r.mod; 17789 for (; o.nextRight() && n.nextLeft(); ) { 17790 o = o.nextRight(), n = n.nextLeft(), r = r.nextLeft(), s = s.nextRight(), s.ancestor = e; 17791 const d = o.prelim + c - (n.prelim + a) + 1; 17792 d > 0 && (kY(PY(o, e, t), e, d), a += d, l += d), c += o.mod, a += n.mod, u += r.mod, l += s.mod; 17793 } 17794 o.nextRight() && !s.nextRight() ? s.mod += c - l : (n.nextLeft() && !r.nextLeft() && (r.mod += a - u), t = e); 17795 } 17796 return t; 17797} 17798function YF(e) { 17799 const { children: t } = e; 17800 if (t.length) { 17801 let [i] = t; 17802 for (const o of t) 17803 YF(o), i = OY(o, i); 17804 FY(e); 17805 const s = (t[0].prelim + t.at(-1).prelim) / 2, n = e.getLeftSibling(); 17806 n ? (e.prelim = n.prelim + 1, e.mod = e.prelim - s) : e.prelim = s; 17807 } else { 17808 const i = e.getLeftSibling(); 17809 e.prelim = i ? i.prelim + 1 : 0; 17810 } 17811} 17812function KF(e, t, i) { 17813 e.x = e.prelim + t, e.y = e.depth, i.insertNode(e); 17814 for (const s of e.children) 17815 KF(s, t + e.mod, i); 17816} 17817function ZF(e) { 17818 const { children: t } = e; 17819 let i = 0; 17820 for (const s of t) 17821 ZF(s), s.children.length ? i += s.leafCount : i++; 17822 e.leafCount = i, t.length ? (e.subtreeLeft = t[0].subtreeLeft, e.subtreeRight = t[t.length - 1].subtreeRight, e.x = (e.subtreeLeft + e.subtreeRight) / 2) : (e.subtreeLeft = e.x, e.subtreeRight = e.x); 17823} 17824function NY(e) { 17825 const t = new _Y(), i = LY(e); 17826 return YF(i), KF(i, -i.prelim, t), ZF(i), t;
17827} 17828var _Y = class { 17829 constructor() { 17830 this.dimensions = new RY(), this.nodes = [], this.depth = 0; 17831 } 17832 insertNode(e) { 17833 this.depth < e.depth && (this.depth = e.depth), this.dimensions.update(e.x, e.y), this.nodes.push(e); 17834 } 17835 scalingX(e, t) { 17836 let i = 1; 17837 if (e > 0) { 17838 const { left: s, right: n } = this.dimensions; 17839 i = e / (n - s); 17840 } 17841 return t && (i *= -1), i; 17842 } 17843 scalingY(e, t) { 17844 let i = 1; 17845 if (e > 0) { 17846 const { top: s, bottom: n } = this.dimensions; 17847 i = e / (n - s); 17848 } 17849 return t && (i *= -1), i; 17850 } 17851}, Ea = class extends it { 17852 constructor() { 17853 super(...arguments), this.enabled = !0; 17854 } 17855}; 17856S([ 17857 D(je) 17858], Ea.prototype, "enabled", 2); 17859S([ 17860 D(je, { optional: !0 }) 17861], Ea.prototype, "avoidCollisions", 2); 17862S([ 17863 D(Ft, { optional: !0 }) 17864], Ea.prototype, "color", 2); 17865S([ 17866 D(Te, { optional: !0 }) 17867], Ea.prototype, "spacing", 2); 17868S([ 17869 D(Ca, { optional: !0 }) 17870], Ea.prototype, "fontStyle", 2); 17871S([ 17872 D(ba, { optional: !0 }) 17873], Ea.prototype, "fontWeight", 2); 17874S([ 17875 D(At.restrict({ min: 1 }), { optional: !0 }) 17876], Ea.prototype, "fontSize", 2); 17877S([ 17878 D(Me, { optional: !0 }) 17879], Ea.prototype, "fontFamily", 2); 17880var gy = class extends it { 17881 constructor() { 17882 super(...arguments), this.enabled = !0; 17883 } 17884}; 17885S([ 17886 D(je) 17887], gy.prototype, "enabled", 2); 17888S([ 17889 D(Te, { optional: !0 }) 17890], gy.prototype, "width", 2); 17891S([ 17892 D(Ft, { optional: !0 }) 17893], gy.prototype, "stroke", 2); 17894var Vx = class extends it { 17895 constructor() { 17896 super(...arguments), this.label = new Ea(), this.tick = new gy(); 17897 } 17898}; 17899S([ 17900 D(Be) 17901], Vx.prototype, "label", 2); 17902S([ 17903 D(Be) 17904], Vx.prototype, "tick", 2); 17905var Oc = class extends zd { 17906 constructor(e) { 17907 super(e), this.tickScale = new Tl(), this.depthOptions = new ag(Vx), this.includeInvisibleDomains = !0, this.tickScale.paddingInner = 1, this.tickScale.paddingOuter = 0; 17908 } 17909 resizeTickTree() { 17910 if (!this.tickTreeLayout) 17911 return; 17912 const { nodes: e } = this.tickTreeLayout, { range: t, step: i, inset: s, bandwidth: n } = this.scale, o = Math.abs(t[1] - t[0]) - i, r = this.tickTreeLayout.scalingX(o, t[0] > t[1]), a = s + n / 2; 17913 let l = 0; 17914 for (const c of e) { 17915 const u = c.x * r; 17916 l > u && (l = u), c.screenX = u + a; 17917 } 17918 for (const c of e) 17919 c.screenX -= l; 17920 } 17921 getDepthOptionsMap(e) { 17922 const t = [], { depthOptions: i, label: s } = this; 17923 for (let n = 0; n < e; n++) 17924 t.push( 17925 i[n]?.label.enabled ?? s.enabled ? { 17926 enabled: !0, 17927 spacing: i[n]?.label.spacing ?? s.spacing, 17928 lineHeight: vi.getLineHeight(i[n]?.label.fontSize ?? s.fontSize ?? 10), 17929 avoidCollisions: i[n]?.label.avoidCollisions ?? s.avoidCollisions 17930 } : { enabled: !1, spacing: 0, lineHeight: 0, avoidCollisions: !1 } 17931 ); 17932 return t; 17933 } 17934 updateCategoryLabels() { 17935 this.computedLayout && this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e, t) => e.setProperties(t)); 17936 } 17937 updateAxisLine() { 17938 this.computedLayout && (this.lineNode.visible = this.line.enabled, this.lineNode.stroke = this.line.stroke, this.lineNode.strokeWidth = this.line.width); 17939 } 17940 computeLayout() { 17941 if (this.updateDirection(), this.updateScale(), this.updateRange(), this.resizeTickTree(), !this.tickTreeLayout?.depth) 17942 return { bbox: _e.zero, separatorLayout: [], tickLabelLayout: [] }; 17943 const { step: e } = this.scale, { title: t, label: i, range: s, depthOptions: n } = this, { depth: o, nodes: r } = this.tickTreeLayout, a = Math.ceil(i.fontSize / e), l = Es(this.rotation), c = this.position === "top" || this.position === "bottom", u = i.getSideFlag(), d = [], p = /* @__PURE__ */ new Map(), f = new Sd(), { defaultRotation: m, configuredRotation: y } = Om({ 17944 rotation: i.rotation, 17945 parallel: i.parallel, 17946 regularFlipRotation: zt(l - Math.PI / 2), 17947 parallelFlipRotation: zt(l) 17948 }), b = m + y, C = this.getDepthOptionsMap(o), w = (q, $) => { 17949 const T = o - q.depth; 17950 if (!C[T]?.enabled || $ % a !== 0 || !VL(q.screenX, s)) 17951 return !1; 17952 const E = this.formatTick(q.label, $ - 1), P = this.getLabelStyles({ value: E, depth: T }, n[T]?.label); 17953 return f.setProperties({ 17954 ...P, 17955 text: E, 17956 textAlign: "center", 17957 textBaseline: i.parallel ? "hanging" : "bottom", 17958 rotation: 0, 17959 translationX: 0, 17960 translationY: q.screenX 17961 }), !0; 17962 }; 17963 let M = 0; 17964 const A = {}; 17965 r.forEach((q, $) => { 17966 const T = o - q.depth, E = vY(q.label); 17967 if (A[T] ?? (A[T] = 1), A[T] < E && (A[T] = E), !(!w(q, $) || !f.getBBox()) && (p.set($, f.getBBox()), !q.leafCount)) { 17968 f.rotation = b; 17969 const { width: G } = f.getBBox(); 17970 M < G && (M = G); 17971 } 17972 }); 17973 const I = ox(), L = u * C[0].spacing, k = /* @__PURE__ */ new Map(), B = (q) => { 17974 let $ = M; 17975 for (let T = 1; T <= q; T++) 17976 $ += C[T].spacing, (i.mirrored || T !== q) && ($ += A[T] * C[T].lineHeight); 17977 return $; 17978 }; 17979 r.forEach((q, $) => { 17980 if ($ === 0) 17981 return; 17982 const T = w(q, $), E = !q.children.length, P = o - q.depth; 17983 if (q.parent) { 17984 const _ = E ? q.x : q.x - (q.leafCount - 1) / 2; 17985 if (!k.has(_)) { 17986 const K = this.depthOptions[P]?.tick; 17987 let ce = M; 17988 for (let ae = 0; ae <= P; ae++) 17989 ce += C[ae].spacing, ae !== 0 && (ce += A[ae] * C[ae].lineHeight); 17990 k.set(_, { 17991 tickSize: ce, 17992 tickStroke: K?.stroke, 17993 tickWidth: K?.enabled !== !1 ? K?.width : 0 17994 }); 17995 } 17996 } 17997 if (!T) 17998 return; 17999 if (f.x = L, f.y = 0, E) { 18000 const { width: _ } = p.get($), K = Qk(b); 18001 f.rotation = b, f.textAlign = "end", f.textBaseline = "middle", f.rotationCenterX = L - _ / 2, f.translationX = (C[P].spacing - _) / 2 * K * u, i.mirrored && (f.translationX += _); 18002 } else 18003 f.rotation = c ? m : -Math.PI / 2, f.rotationCenterX = L, f.translationX = u * B(P); 18004 if (C[P].avoidCollisions) { 18005 const _ = E ? e : q.leafCount * e; 18006 if (f.getBBox().height > _) { 18007 p.delete($); 18008 return; 18009 } 18010 } 18011 const { text: G = "" } = f; 18012 d.push({ 18013 text: G, 18014 visible: !0, 18015 range: this.scale.range, 18016 tickId: I(G), 18017 fill: f.fill, 18018 fontFamily: f.fontFamily, 18019 fontSize: f.fontSize, 18020 fontStyle: f.fontStyle, 18021 fontWeight: f.fontWeight, 18022 rotation: f.rotation, 18023 rotationCenterX: f.rotationCenterX, 18024 textAlign: f.textAlign, 18025 textBaseline: f.textBaseline, 18026 translationX: f.translationX, 18027 translationY: f.translationY, 18028 x: f.x,
18029 y: f.y 18030 }), p.set($, Ii.toCanvas(f)); 18031 }); 18032 const { enabled: N, stroke: W, width: se } = this.line; 18033 this.lineNode.datum = { x: 0, y1: s[0], y2: s[1] }, this.lineNode.setProperties({ stroke: W, strokeWidth: N ? se : 0 }); 18034 const ue = [...k.values()]; 18035 ue.push(ue[0]); 18036 const Ce = [this.lineNode.getBBox(), new _e(0, 0, ue[0].tickSize * u, 0)]; 18037 t.enabled && (this.updateTitle(!1, ue[0].tickSize), Ce.push(t.caption.node.getBBox())); 18038 const te = _e.merge(vc(p.values(), Ce)); 18039 return { 18040 bbox: this.getTransformBox(te), 18041 separatorLayout: ue, 18042 tickLabelLayout: d 18043 }; 18044 } 18045 /** 18046 * Creates/removes/updates the scene graph nodes that constitute the axis. 18047 * Supposed to be called _manually_ after changing _any_ of the axis properties. 18048 * This allows to bulk set axis properties before updating the nodes. 18049 * The node changes made by this method are rendered on the next animation frame. 18050 * We could schedule this method call automatically on the next animation frame 18051 * when any of the axis properties change (the way we do when properties of scene graph's 18052 * nodes change), but this will mean that we first wait for the next animation 18053 * frame to make changes to the nodes of the axis, then wait for another animation 18054 * frame to render those changes. It's nice to have everything update automatically, 18055 * but this extra level of async indirection will not just introduce an unwanted delay, 18056 * it will also make it harder to reason about the program. 18057 */ 18058 update() { 18059 if (!this.computedLayout) 18060 return; 18061 const { tickScale: e, gridLine: t, gridLength: i } = this, { separatorLayout: s } = this.computedLayout, n = e.ticks().map((o, r) => ({ 18062 ...s[r], 18063 tick: o, 18064 tickId: ps(o, r), 18065 tickLabel: o.filter(Boolean).join(" - "), 18066 translationY: Math.round(e.convert(o)) 18067 })); 18068 this.gridLineGroupSelection.update(t.enabled && i ? n : []), this.tickLineGroupSelection.update(this.tick.enabled ? n : []), this.updatePosition(), this.updateCategoryLabels(), this.updateAxisLine(), this.updateGridLines(), this.updateTickLines(), this.updateTitle(), this.resetSelectionNodes(); 18069 } 18070 calculateLayout() { 18071 const { separatorLayout: e, tickLabelLayout: t, bbox: i } = this.computeLayout(); 18072 return this.computedLayout = { separatorLayout: e, tickLabelLayout: t }, { bbox: i, primaryTickCount: void 0 }; 18073 } 18074 /** 18075 * The length of the grid. The grid is only visible in case of a non-zero value. 18076 */ 18077 onGridVisibilityChange() { 18078 this.gridLineGroupSelection.clear(), this.tickLabelGroupSelection.clear(); 18079 } 18080 updateRange() { 18081 super.updateRange(), this.tickScale.range = this.scale.range; 18082 } 18083 calculateDomain() { 18084 const { direction: e } = this, t = this.boundSeries.filter((n) => n.visible).flatMap((n) => n.getDomain(e)); 18085 this.setDomain(ma(t) ?? _S(t)); 18086 const i = this.dataDomain.domain.map(Ap); 18087 this.tickTreeLayout = NY(i); 18088 const s = [];
18089 for (const n of this.tickTreeLayout.nodes) 18090 n.leafCount || n.refId == null || s.push(this.dataDomain.domain[n.refId]); 18091 this.scale.domain = rk(this.dataDomain.domain, s), this.tickScale.domain = i.concat([[""]]); 18092 } 18093 updateGridLines() { 18094 if (!this.gridLength) 18095 return; 18096 const { width: e, style: t } = this.gridLine, i = this.gridLength * -this.label.getSideFlag(); 18097 this.gridLineGroupSelection.each((s, n, o) => { 18098 const { stroke: r, lineDash: a } = t[o % t.length], l = n.translationY; 18099 s.visible = this.inRange(l), s.x1 = 0, s.x2 = i, s.y = l, s.stroke = r, s.strokeWidth = e, s.lineDash = a; 18100 }); 18101 } 18102 updateScale(e) { 18103 super.updateScale(e), this.scale.paddingOuter = this.scale.paddingInner / 2; 18104 } 18105}; 18106Oc.className = "GroupedCategoryAxis"; 18107Oc.type = "grouped-category"; 18108S([ 18109 D(US) 18110], Oc.prototype, "depthOptions", 2); 18111function Ux(e, t, i) { 18112 let [s, n] = Ds(e); 18113 s = BY(Math.floor(s), n, t); 18114 const o = zY(s, n, t), r = t - 1; 18115 n = s + r * o; 18116 const a = i ? [n, s] : [s, n], l = GY(s, o, t); 18117 return { domain: a, ticks: l }; 18118} 18119function BY(e, t, i) { 18120 const s = Math.abs(t - e) / (i - 1), n = Math.floor(Math.log10(s)), o = Math.pow(10, n); 18121 return Math.floor(e / o) * o; 18122} 18123function GY(e, t, i) { 18124 const s = Math.floor(Math.log10(t)), n = t > 0 && t < 1 ? Math.abs(s) : 0, o = Math.pow(10, n), r = []; 18125 for (let a = 0; a < i; a++) { 18126 const l = e + t * a; 18127 r[a] = Math.round(l * o) / o; 18128 } 18129 return r; 18130} 18131function zY(e, t, i) { 18132 const s = i - 1, n = (t - e) / s; 18133 return HY(n); 18134} 18135function HY(e) { 18136 const t = Math.floor(Math.log10(e)), i = Math.pow(10, t), s = e / i * 10; 18137 return s > 0 && s <= 1 ? i / 10 : s > 1 && s <= 2 ? 2 * i / 10 : s > 1 && s <= 5 ? 5 * i / 10 : s > 5 && s <= 10 ? 10 * i / 10 : s > 10 && s <= 20 ? 20 * i / 10 : s > 20 && s <= 40 ? 40 * i / 10 : s > 40 && s <= 50 ? 50 * i / 10 : s > 50 && s <= 100 ? 100 * i / 10 : s; 18138} 18139var mo = class extends ti { 18140 constructor() { 18141 super([0, 1], [0, 1]), this.type = "number"; 18142 } 18143 toDomain(e) { 18144 return e; 18145 } 18146 ticks() { 18147 const e = this.tickCount ?? ti.defaultTickCount; 18148 if (!this.domain || this.domain.length < 2 || e < 1 || !this.domain.every(isFinite)) 18149 return []; 18150 this.refresh(); 18151 const [t, i] = this.getDomain(); 18152 if (this.interval) { 18153 const s = Math.abs(this.interval); 18154 if (!Ep((i - t) / s, this.getPixelRange())) 18155 return $v(t, i, s); 18156 } 18157 return KS(t, i, e, this.minTickCount, this.maxTickCount); 18158 } 18159 update() { 18160 !this.domain || this.domain.length < 2 || this.nice && this.updateNiceDomain(); 18161 } 18162 getTickStep(e, t) { 18163 return this.interval ?? Dp(e, t, this.tickCount, this.minTickCount, this.maxTickCount); 18164 } 18165 /** 18166 * Extends the domain so that it starts and ends on nice round values. 18167 */ 18168 updateNiceDomain() { 18169 const e = this.tickCount; 18170 let [t, i] = this.domain; 18171 if (e === 1) 18172 [t, i] = f7(t, i); 18173 else if (e > 1) { 18174 const s = t > i ? Math.ceil : Math.floor, n = t > i ? Math.floor : Math.ceil, o = 4; 18175 for (let r = 0; r < o; r++) { 18176 const a = t, l = i, c = this.getTickStep(t, i), [u, d] = this.domain; 18177 if (t = s(u / c) * c, i = n(d / c) * c, t === a && i === l) 18178 break; 18179 } 18180 } 18181 this.niceDomain = [t, i]; 18182 } 18183 tickFormat({ ticks: e, specifier: t }) { 18184 return g7(e ?? this.ticks(), t); 18185 } 18186}, Sl = class extends Pc { 18187 constructor(e, t = new mo()) { 18188 super(e, t), this.min = NaN, this.max = NaN; 18189 } 18190 normaliseDataDomain(e) { 18191 const { min: t, max: i } = this, { extent: s, clipped: n } = NS(e, t, i); 18192 return { domain: s, clipped: n }; 18193 } 18194 updateSecondaryAxisTicks(e) { 18195 if (!this.dataDomain?.domain.length) 18196 return []; 18197 const { domain: t, ticks: i } = Ux( 18198 this.dataDomain.domain, 18199 e ?? 0, 18200 this.reverse 18201 ); 18202 return this.scale.nice = !1, this.scale.domain = t, this.scale.update(), i; 18203 } 18204}; 18205Sl.className = "NumberAxis"; 18206Sl.type = "number"; 18207S([ 18208 D(Dr(_d, cg("max"))), 18209 Ll(NaN) 18210], Sl.prototype, "min", 2); 18211S([ 18212 D(Dr(_d, ug("min"))), 18213 Ll(NaN) 18214], Sl.prototype, "max", 2); 18215var qF = jt((e) => zo(e) && e !== 0, "a non-zero number"), qc = class extends Sl { 18216 constructor(e) {
18217 super(e, new ZS()), this.min = NaN, this.max = NaN; 18218 } 18219 normaliseDataDomain(e) { 18220 const { min: t, max: i } = this, { extent: s, clipped: n } = NS(e, t, i); 18221 return s[0] < 0 && s[1] > 0 ? (Ee.warn( 18222 "The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information." 18223 ), { domain: [], clipped: n }) : s[0] === 0 || s[1] === 0 ? (Ee.warn( 18224 "The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information." 18225 ), { domain: [], clipped: n }) : { domain: s, clipped: n }; 18226 } 18227 set base(e) { 18228 this.scale.base = e; 18229 } 18230 get base() { 18231 return this.scale.base; 18232 } 18233 updateSecondaryAxisTicks(e) { 18234 if (!this.dataDomain?.domain.length) 18235 return []; 18236 const { domain: t, ticks: i } = Ux( 18237 this.dataDomain.domain, 18238 e ?? 0, 18239 this.reverse 18240 ); 18241 return this.scale.nice = !1, this.scale.domain = t, this.scale.update(), i; 18242 } 18243}; 18244qc.className = "LogAxis"; 18245qc.type = "log"; 18246S([ 18247 D(Dr(_d, qF, cg("max"))), 18248 Ll(NaN) 18249], qc.prototype, "min", 2); 18250S([ 18251 D(Dr(_d, qF, ug("min"))), 18252 Ll(NaN) 18253], qc.prototype, "max", 2); 18254var Yd = class extends Pc { 18255 constructor(e) { 18256 super(e, new QS()), this.min = void 0, this.max = void 0; 18257 } 18258 normaliseDataDomain(e) { 18259 let { min: t, max: i } = this, s = !1; 18260 return typeof t == "number" && (t = new Date(t)), typeof i == "number" && (i = new Date(i)), e.length > 2 && (e = ma(e)?.map((n) => new Date(n)) ?? []), t instanceof Date && (s || (s = t > e[0]), e = [t, e[1]]), i instanceof Date && (s || (s = i < e[1]), e = [e[0], i]), e[0] > e[1] && (e = []), { domain: e, clipped: s }; 18261 } 18262 onFormatChange(e, t, i, s) { 18263 s ? super.onFormatChange(e, t, i, s) : (this.labelFormatter = this.scale.tickFormat({ ticks: e, domain: i }), this.datumFormatter = this.scale.tickFormat({ ticks: e, domain: i, formatOffset: 1 })); 18264 } 18265 updateSecondaryAxisTicks(e) { 18266 if (!this.dataDomain?.domain.length) 18267 return []; 18268 const { domain: t, ticks: i } = Ux( 18269 this.dataDomain.domain.map(Number), 18270 e ?? 0, 18271 this.reverse 18272 ); 18273 return this.scale.nice = !1, this.scale.domain = t.map((s) => new Date(s)), this.scale.update(), i; 18274 } 18275}; 18276Yd.className = "TimeAxis"; 18277Yd.type = "time"; 18278S([ 18279 D(Dr(VS, cg("max")), { optional: !0 }) 18280], Yd.prototype, "min", 2); 18281S([ 18282 D(Dr(VS, ug("min")), { optional: !0 }) 18283], Yd.prototype, "max", 2); 18284var Hh = (e, { x0: t, y0: i, x1: s, y1: n, cx: o, cy: r }, a, l) => { 18285 if (l && e.moveTo(t, i), t !== s || i !== n) { 18286 const c = Math.atan2(i - r, t - o), u = Math.atan2(n - r, s - o); 18287 e.arc(o, r, a, c, u); 18288 } else 18289 e.lineTo(t, i); 18290}, sR = 1e-6, Tf = (e, t, i, s, n) => { 18291 let o = !1, r = !1, a = s - Math.sqrt(Math.max(n ** 2 - i ** 2, 0)), l = 0, c = 0, u = i - Math.sqrt(Math.max(n ** 2 - s ** 2, 0)); 18292 return a > e ? (o = !0, a = e, l = i - Math.sqrt(Math.max(n ** 2 - (s - e) ** 2))) : a < sR && (a = 0), u > t ? (r = !0, c = s - Math.sqrt(Math.max(n ** 2 - (i - t) ** 2)), u = t) : u < sR && (u = 0), { leading0: a, leading1: l, trailing0: c, trailing1: u, leadingClipped: o, trailingClipped: r }; 18293}, hm = (e, t, i, s, n, o, r) => { 18294 let { 18295 topLeft: a, 18296 topRight: l, 18297 bottomRight: c, 18298 bottomLeft: u 18299 } = o; 18300 const d = Math.max( 18301 a + u, 18302 l + c 18303 ), p = Math.max( 18304 a + l, 18305 u + c 18306 ); 18307 if (d <= 0 && p <= 0) { 18308 r == null ? e.rect(t, i, s, n) : e.rect(r.x, r.y, r.width, r.height); 18309 return; 18310 } else if (r == null && a === l && a === c && a === u) { 18311 e.roundRect(t, i, s, n, a); 18312 return; 18313 } 18314 if (s < 0 && (t += s, s = Math.abs(s)), n < 0 && (i += n, n = Math.abs(n)), s <= 0 || n <= 0) 18315 return; 18316 if (r == null) 18317 r = new _e(t, i, s, n); 18318 else { 18319 const k = Math.max(t, r.x), B = Math.min(t + s, r.x + r.width), N = Math.max(i, r.y), W = Math.min(i + n, r.y + r.height); 18320 r = new _e(k, N, B - k, W - N); 18321 } 18322 const f = Math.max(d / n, p / s, 1); 18323 f > 1 && (a /= f, l /= f, c /= f, u /= f); 18324 let m = !0, y = !0, b = !0, C = !0, w, M, A, I; 18325 if (m) { 18326 const k = Tf( 18327 r.height, 18328 r.width, 18329 Math.max(t + a - r.x, 0), 18330 Math.max(i + a - r.y, 0), 18331 a 18332 ); 18333 k.leadingClipped && (C = !1), k.trailingClipped && (y = !1); 18334 const B = Math.max(r.x + k.leading1, r.x), N = Math.max(r.y + k.leading0, r.y), W = Math.max(r.x + k.trailing1, r.x), se = Math.max(r.y + k.trailing0, r.y), ue = t + a, Ce = i + a; 18335 w = { x0: B, y0: N, x1: W, y1: se, cx: ue, cy: Ce }; 18336 } 18337 if (y) {
18338 const k = Tf( 18339 r.width, 18340 r.height, 18341 Math.max(i + l - r.y, 0), 18342 Math.max(r.x + r.width - (t + s - l), 0), 18343 l 18344 ); 18345 k.leadingClipped && (m = !1), k.trailingClipped && (b = !1); 18346 const B = Math.min(r.x + r.width - k.leading0, r.x + r.width), N = Math.max(r.y + k.leading1, r.y), W = Math.min(r.x + r.width - k.trailing0, r.x + r.width), se = Math.max(r.y + k.trailing1, r.y), ue = t + s - l, Ce = i + l; 18347 M = { x0: B, y0: N, x1: W, y1: se, cx: ue, cy: Ce }; 18348 } 18349 if (b) { 18350 const k = Tf( 18351 r.height, 18352 r.width, 18353 Math.max(r.x + r.width - (t + s - c), 0), 18354 Math.max(r.y + r.height - (i + n - c), 0), 18355 c 18356 ); 18357 k.leadingClipped && (y = !1), k.trailingClipped && (C = !1); 18358 const B = Math.min(r.x + r.width - k.leading1, r.x + r.width), N = Math.min(r.y + r.height - k.leading0, r.y + r.height), W = Math.min(r.x + r.width - k.trailing1, r.x + r.width), se = Math.min(r.y + r.height - k.trailing0, r.y + r.height), ue = t + s - c, Ce = i + n - c; 18359 A = { x0: B, y0: N, x1: W, y1: se, cx: ue, cy: Ce }; 18360 } 18361 if (C) { 18362 const k = Tf( 18363 r.width, 18364 r.height, 18365 Math.max(r.y + r.height - (i + n - u), 0), 18366 Math.max(t + u - r.x, 0), 18367 u 18368 ); 18369 k.leadingClipped && (b = !1), k.trailingClipped && (m = !1); 18370 const B = Math.max(r.x + k.leading0, r.x), N = Math.min(r.y + r.height - k.leading1, r.y + r.height), W = Math.max(r.x + k.trailing0, r.x), se = Math.min(r.y + r.height - k.trailing1, r.y + r.height), ue = t + u, Ce = i + n - u; 18371 I = { x0: B, y0: N, x1: W, y1: se, cx: ue, cy: Ce }; 18372 } 18373 let L = !1; 18374 m && w != null && (Hh(e, w, a, !L), L || (L = !0)), y && M != null && (Hh(e, M, l, !L), L || (L = !0)), b && A != null && (Hh(e, A, c, !L), L || (L = !0)), C && I != null && Hh(e, I, u, !L), e.closePath(); 18375}, Ts = class extends sn { 18376 constructor() { 18377 super(...arguments), this.borderPath = new Fp(), this.x = 0, this.y = 0, this.width = 10, this.height = 10, this.topLeftCornerRadius = 0, this.topRightCornerRadius = 0, this.bottomRightCornerRadius = 0, this.bottomLeftCornerRadius = 0, this.clipBBox = void 0, this.crisp = !1, this.lastUpdatePathStrokeWidth = Co.defaultStyles.strokeWidth, this.effectiveStrokeWidth = Co.defaultStyles.strokeWidth, this.hittester = super.isPointInPath.bind(this), this.distanceCalculator = super.distanceSquaredTransformedPoint.bind(this), this.microPixelEffectOpacity = 1; 18378 } 18379 set cornerRadius(e) { 18380 this.topLeftCornerRadius = e, this.topRightCornerRadius = e, this.bottomRightCornerRadius = e, this.bottomLeftCornerRadius = e; 18381 } 18382 isDirtyPath() { 18383 return this.lastUpdatePathStrokeWidth !== this.strokeWidth || !!(this.path.isDirty() || this.borderPath.isDirty()); 18384 } 18385 updatePath() { 18386 const { 18387 path: e, 18388 borderPath: t, 18389 crisp: i, 18390 topLeftCornerRadius: s, 18391 topRightCornerRadius: n, 18392 bottomRightCornerRadius: o, 18393 bottomLeftCornerRadius: r 18394 } = this; 18395 let { x: a, y: l, width: c, height: u, strokeWidth: d, clipBBox: p } = this; 18396 const m = 1 / (this.layerManager?.canvas.pixelRatio ?? 1); 18397 let y = 1; 18398 if (e.clear(!0), t.clear(!0), i && (c <= m && (y *= c / m), u <= m && (y *= u / m), c = this.align(a, c), u = this.align(l, u), a = this.align(a), l = this.align(l), p = p != null ? new _e( 18399 this.align(p.x), 18400 this.align(p.y), 18401 this.align(p.x, p.width), 18402 this.align(p.y, p.height) 18403 ) : void 0), d) 18404 if (c < m) { 18405 const b = a + m / 2; 18406 t.moveTo(b, l), t.lineTo(b, l + u), d = m, this.borderClipPath = void 0; 18407 } else if (u < m) { 18408 const b = l + m / 2; 18409 t.moveTo(a, b), t.lineTo(a + c, b), d = m, this.borderClipPath = void 0; 18410 } else if (d < c && d < u) { 18411 const b = d / 2; 18412 a += b, l += b, c -= d, u -= d; 18413 const C = p?.clone().shrink(b), w = { 18414 topLeft: s > 0 ? s - d : 0, 18415 topRight: n > 0 ? n - d : 0, 18416 bottomRight: o > 0 ? o - d : 0, 18417 bottomLeft: r > 0 ? r - d : 0 18418 }; 18419 this.borderClipPath = void 0, c > 0 && u > 0 && (C == null || C?.width > 0 && C?.height > 0) && (hm(e, a, l, c, u, w, C), hm(t, a, l, c, u, w, C)); 18420 } else 18421 this.borderClipPath = this.borderClipPath ?? new Fp(), this.borderClipPath.clear(!0), this.borderClipPath.rect(a, l, c, u), t.rect(a, l, c, u); 18422 else { 18423 const b = { topLeft: s, topRight: n, bottomRight: o, bottomLeft: r }; 18424 this.borderClipPath = void 0, hm(e, a, l, c, u, b, p); 18425 } 18426 if ([s, n, o, r].every((b) => b === 0)) { 18427 const b = this.getBBox(); 18428 this.hittester = b.containsPoint.bind(b), this.distanceSquared = (C, w) => this.getBBox().distanceSquared(C, w); 18429 } else 18430 this.hittester = super.isPointInPath, this.distanceCalculator = super.distanceSquaredTransformedPoint; 18431 this.effectiveStrokeWidth = d, this.lastUpdatePathStrokeWidth = d, this.microPixelEffectOpacity = y; 18432 } 18433 computeBBox() { 18434 const { x: e, y: t, width: i, height: s, clipBBox: n } = this; 18435 return n?.clone() ?? new _e(e, t, i, s); 18436 } 18437 isPointInPath(e, t) { 18438 return this.hittester(e, t); 18439 } 18440 get midPoint() { 18441 return { x: this.x + this.width / 2, y: this.y + this.height / 2 }; 18442 } 18443 distanceSquared(e, t) { 18444 return this.distanceCalculator(e, t); 18445 } 18446 applyFillAlpha(e) { 18447 const { fillOpacity: t, microPixelEffectOpacity: i, opacity: s } = this; 18448 e.globalAlpha *= s * t * i; 18449 } 18450 renderStroke(e) { 18451 const { stroke: t, effectiveStrokeWidth: i } = this; 18452 if (t && i) { 18453 const { globalAlpha: s } = e, { 18454 strokeOpacity: n, 18455 lineDash: o, 18456 lineDashOffset: r, 18457 lineCap: a, 18458 lineJoin: l, 18459 borderPath: c, 18460 borderClipPath: u, 18461 opacity: d, 18462 microPixelEffectOpacity: p 18463 } = this; 18464 u && e.clip(u.getPath2D()), this.applyStroke(e), e.globalAlpha *= d * n * p, e.lineWidth = i, o && e.setLineDash(o), r && (e.lineDashOffset = r), a && (e.lineCap = a), l && (e.lineJoin = l), e.stroke(c.getPath2D()), e.globalAlpha = s; 18465 } 18466 } 18467}; 18468Ts.className = "Rect"; 18469S([ 18470 Je() 18471], Ts.prototype, "x", 2); 18472S([ 18473 Je() 18474], Ts.prototype, "y", 2); 18475S([ 18476 Je() 18477], Ts.prototype, "width", 2); 18478S([ 18479 Je() 18480], Ts.prototype, "height", 2); 18481S([ 18482 Je() 18483], Ts.prototype, "topLeftCornerRadius", 2); 18484S([ 18485 Je() 18486], Ts.prototype, "topRightCornerRadius", 2); 18487S([ 18488 Je() 18489], Ts.prototype, "bottomRightCornerRadius", 2); 18490S([ 18491 Je() 18492], Ts.prototype, "bottomLeftCornerRadius", 2); 18493S([ 18494 Je() 18495], Ts.prototype, "clipBBox", 2); 18496S([ 18497 Je() 18498], Ts.prototype, "crisp", 2); 18499var Kd = class extends Xv { 18500 constructor(e) { 18501 super(), this.ctx = e, this.rectNode = new Ts(), this.textNode = new Qi(), this.fill = "white", this.node = this.createNode(), this.node.append([this.rectNode, this.textNode]), this.visible = !0, this.destroyFns.push( 18502 e.scene.attachNode(this.node), 18503 e.layoutManager.addListener("layout:complete", (t) => this.onLayoutComplete(t)) 18504 ); 18505 } 18506 createNode() { 18507 return new Ye({ 18508 name: "background", 18509 zIndex: 0 18510 /* CHART_BACKGROUND */ 18511 }); 18512 } 18513 onLayoutComplete(e) { 18514 const { width: t, height: i } = e.chart; 18515 this.rectNode.width = t, this.rectNode.height = i; 18516 } 18517}; 18518S([ 18519 D(je), 18520 rs("node", "visible") 18521], Kd.prototype, "visible", 2); 18522S([ 18523 D(Ft, { optional: !0 }), 18524 rs("rectNode", "fill") 18525], Kd.prototype, "fill", 2); 18526S([ 18527 D(Be, { optional: !0 }) 18528], Kd.prototype, "image", 2); 18529S([ 18530 D(Me, { optional: !0 }), 18531 rs("textNode") 18532], Kd.prototype, "text", 2); 18533var QF = { 18534 type: "root", 18535 optionsKey: "background", 18536 packageType: "community", 18537 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"], 18538 moduleFactory: (e) => new Kd(e) 18539}; 18540function VY({ 18541 orientation: e, 18542 bboxes: t, 18543 maxHeight: i, 18544 maxWidth: s, 18545 itemPaddingY: n = 0, 18546 itemPaddingX: o = 0, 18547 forceResult: r = !1 18548}) { 18549 const a = e === "horizontal", l = { 18550 max: a ? s : i, 18551 fn: a ? (p) => p.width : (p) => p.height, 18552 padding: a ? o : n 18553 }, c = { 18554 max: a ? i : s, 18555 fn: a ? (p) => p.height : (p) => p.width, 18556 padding: a ? n : o 18557 }; 18558 let u = 0; 18559 const d = []; 18560 for (; u < t.length; ) { 18561 const p = t.slice(u), f = UY(p, u, l, c, r); 18562 if (!f) 18563 return; 18564 u += f.processedBBoxCount, d.push(f.pageIndices); 18565 } 18566 return jY(d, e, t, n, o); 18567} 18568function UY(e, t, i, s, n) { 18569 let r = YY(e, i); 18570 if (r < 1) { 18571 if (!n) 18572 return; 18573 r = 1; 18574 } 18575 let a = r; 18576 for (; a >= 1; ) { 18577 const l = WY(e, t, a, i, s, n); 18578 if (l == null && a <= 1) 18579 return; 18580 if (l == null) { 18581 a--; 18582 continue; 18583 } 18584 if (typeof l == "number") { 18585 if (l <= 1) 18586 return; 18587 a = l < a && l > 1 ? l : a, a--; 18588 continue; 18589 } 18590 return { processedBBoxCount: l.length * l[0].length, pageIndices: l }; 18591 } 18592} 18593function WY(e, t, i, s, n, o) { 18594 const r = []; 18595 let a = 0, l = 0, c = []; 18596 const u = []; 18597 for (let d = 0; d < e.length; d++) { 18598 const p = (d + i) % i; 18599 p === 0 && (a += l, l = 0, c.length > 0 && r.push(c), c = []); 18600 const f = s.fn(e[d]) + s.padding; 18601 u[p] = Math.max(u[p] ?? 0, f), l = Math.max(l, n.fn(e[d]) + n.padding); 18602 const m = a + l, y = !o || r.length > 0; 18603 if (m > n.max && y) { 18604 c = []; 18605 break; 18606 } 18607 if (u.reduce((C, w) => C + w, 0) > s.max && !o) 18608 return u.length < i ? u.length : void 0; 18609 c.push(d + t); 18610 } 18611 return c.length > 0 && r.push(c), r.length > 0 ? r : void 0; 18612} 18613function jY(e, t, i, s, n) { 18614 let o = 0, r = 0; 18615 return { pages: e.map((l) => { 18616 t === "horizontal" && (l = $Y(l));
18617 let c = 0; 18618 const u = l.map((f) => { 18619 const m = f.map((C) => (c = Math.max(C, c), i[C])); 18620 let y = 0, b = 0; 18621 return m.forEach((C) => { 18622 y += C.height + s, b = Math.max(b, C.width + n); 18623 }), { 18624 indices: f, 18625 bboxes: m, 18626 columnHeight: Math.ceil(y), 18627 columnWidth: Math.ceil(b) 18628 }; 18629 }); 18630 let d = 0, p = 0; 18631 return u.forEach((f) => { 18632 d += f.columnWidth, p = Math.max(p, f.columnHeight); 18633 }), o = Math.max(d, o), r = Math.max(p, r), { 18634 columns: u, 18635 startIndex: l[0][0], 18636 endIndex: c, 18637 pageWidth: d, 18638 pageHeight: p 18639 }; 18640 }), maxPageWidth: o, maxPageHeight: r }; 18641} 18642function $Y(e) { 18643 const t = []; 18644 for (const i of e[0]) 18645 t.push([]); 18646 return e.forEach((i, s) => { 18647 i.forEach((n, o) => { 18648 t[o][s] = n; 18649 }); 18650 }), t; 18651} 18652function YY(e, t) { 18653 const i = e.length; 18654 let s = 0; 18655 for (let n = 0; n < i; n++) 18656 if (s += t.fn(e[n]) + t.padding, s > t.max) 18657 return i / n < 2 ? Math.ceil(i / 2) : n; 18658 return i; 18659} 18660var Zd = class extends it { 18661 constructor() { 18662 super(...arguments), this.color = "black", this.fontStyle = void 0, this.fontWeight = void 0, this.fontSize = 12, this.fontFamily = "Verdana, sans-serif"; 18663 } 18664}; 18665S([ 18666 D(Ft) 18667], Zd.prototype, "color", 2); 18668S([ 18669 D(Ca, { optional: !0 }) 18670], Zd.prototype, "fontStyle", 2); 18671S([ 18672 D(ba, { optional: !0 }) 18673], Zd.prototype, "fontWeight", 2); 18674S([ 18675 D(Te) 18676], Zd.prototype, "fontSize", 2); 18677S([ 18678 D(Me) 18679], Zd.prototype, "fontFamily", 2); 18680var sa = class extends it { 18681 constructor() { 18682 super(...arguments), this.size = 15, this.fill = void 0, this.fillOpacity = void 0, this.stroke = void 0, this.strokeWidth = 1, this.strokeOpacity = 1; 18683 } 18684}; 18685S([ 18686 D(Te) 18687], sa.prototype, "size", 2); 18688S([ 18689 D(Ft, { optional: !0 }) 18690], sa.prototype, "fill", 2); 18691S([ 18692 D(Pt, { optional: !0 }) 18693], sa.prototype, "fillOpacity", 2); 18694S([ 18695 D(Ft, { optional: !0 }) 18696], sa.prototype, "stroke", 2); 18697S([ 18698 D(Te) 18699], sa.prototype, "strokeWidth", 2); 18700S([ 18701 D(Pt) 18702], sa.prototype, "strokeOpacity", 2); 18703var fy = class extends it { 18704 constructor(e) { 18705 super(), this.parent = e, this.shape = "triangle", this.size = 15, this.padding = 8; 18706 } 18707}; 18708S([ 18709 Un({ 18710 changeValue() { 18711 this.parent.marker === this && this.parent.onMarkerShapeChange(); 18712 } 18713 }) 18714], fy.prototype, "shape", 2); 18715S([ 18716 D(Te) 18717], fy.prototype, "size", 2); 18718S([ 18719 D(Te) 18720], fy.prototype, "padding", 2); 18721var Qc = class extends it { 18722 constructor(e, t) { 18723 super(), this.chartUpdateCallback = e, this.pageUpdateCallback = t, this.id = So(this), this.marker = new fy(this), this.activeStyle = new sa(), this.inactiveStyle = new sa(), this.highlightStyle = new sa(), this.label = new Zd(), this.group = new Ks({ name: "pagination" }), this.labelNode = new Qi(), this.destroyFns = [], this.totalPages = 0, this.currentPage = 0, this.translationX = 0, this.translationY = 0, this.nextButtonDisabled = !1, this.previousButtonDisabled = !1, this._visible = !0, this._enabled = !0, this._orientation = "vertical", this._nextButton = new op(), this._previousButton = new op(), this.labelNode.setProperties({ 18724 textBaseline: "middle", 18725 fontSize: 12, 18726 fontFamily: "Verdana, sans-serif", 18727 fill: "black", 18728 y: 1 18729 }), this.group.append([this.nextButton, this.previousButton, this.labelNode]), this.update(), this.updateMarkers(); 18730 } 18731 destroy() { 18732 this.destroyFns.forEach((e) => e()); 18733 } 18734 set visible(e) { 18735 this._visible = e, this.updateGroupVisibility(); 18736 } 18737 get visible() { 18738 return this._visible; 18739 } 18740 set enabled(e) { 18741 this._enabled = e, this.updateGroupVisibility(); 18742 } 18743 get enabled() { 18744 return this._enabled; 18745 } 18746 updateGroupVisibility() { 18747 this.group.visible = this.enabled && this.visible; 18748 } 18749 set orientation(e) { 18750 this._orientation = e, e === "horizontal" ? (this.previousButton.rotation = -Math.PI / 2, this.nextButton.rotation = Math.PI / 2) : (this.previousButton.rotation = 0, this.nextButton.rotation = Math.PI); 18751 } 18752 get orientation() { 18753 return this._orientation; 18754 } 18755 set nextButton(e) { 18756 this._nextButton !== e && (this.group.removeChild(this._nextButton), this._nextButton = e, this.group.appendChild(e)); 18757 } 18758 get nextButton() { 18759 return this._nextButton; 18760 } 18761 set previousButton(e) { 18762 this._previousButton !== e && (this.group.removeChild(this._previousButton), this._previousButton = e, this.group.appendChild(e)); 18763 } 18764 get previousButton() { 18765 return this._previousButton; 18766 } 18767 update() { 18768 this.updateLabel(), this.updatePositions(), this.enableOrDisableButtons(); 18769 } 18770 updatePositions() { 18771 this.group.translationX = this.translationX, this.group.translationY = this.translationY, this.updateLabelPosition(), this.updateNextButtonPosition(); 18772 } 18773 updateLabelPosition() { 18774 const { size: e, padding: t } = this.marker; 18775 this.nextButton.size = e, this.previousButton.size = e, this.labelNode.x = e / 2 + t; 18776 } 18777 updateNextButtonPosition() { 18778 const e = this.labelNode.getBBox(); 18779 this.nextButton.translationX = e.width + (this.marker.size / 2 + this.marker.padding) * 2; 18780 } 18781 updateLabel() { 18782 const { 18783 currentPage: e, 18784 totalPages: t, 18785 labelNode: i, 18786 label: { color: s, fontStyle: n, fontWeight: o, fontSize: r, fontFamily: a } 18787 } = this; 18788 i.text = `${e + 1} / ${t}`, i.fill = s, i.fontStyle = n, i.fontWeight = o, i.fontSize = r, i.fontFamily = a; 18789 } 18790 updateMarkers() { 18791 const { 18792 nextButton: e, 18793 previousButton: t, 18794 nextButtonDisabled: i, 18795 previousButtonDisabled: s, 18796 activeStyle: n, 18797 inactiveStyle: o, 18798 highlightStyle: r, 18799 highlightActive: a 18800 } = this, l = (c, u) => u ? o : c === a ? r : n; 18801 this.updateMarker(e, l("next", i)), this.updateMarker(t, l("previous", s)); 18802 } 18803 updateMarker(e, t) { 18804 const { size: i } = this.marker; 18805 e.size = i, e.fill = t.fill, e.fillOpacity = t.fillOpacity ?? 1, e.stroke = t.stroke, e.strokeWidth = t.strokeWidth, e.strokeOpacity = t.strokeOpacity; 18806 } 18807 enableOrDisableButtons() { 18808 const { currentPage: e, totalPages: t } = this, i = t === 0, s = e === t - 1, n = e === 0; 18809 this.nextButtonDisabled = s || i, this.previousButtonDisabled = n || i; 18810 } 18811 setPage(e) { 18812 e = ot(0, e, Math.max(0, this.totalPages - 1)), this.currentPage !== e && (this.currentPage = e, this.onPaginationChanged()); 18813 } 18814 getCursor(e) { 18815 return { previous: this.previousButtonDisabled, next: this.nextButtonDisabled }[e] ? void 0 : "pointer"; 18816 } 18817 onClick(e, t) { 18818 e.preventDefault(), t === "next" && !this.nextButtonDisabled ? (this.incrementPage(), this.onPaginationChanged()) : t === "previous" && !this.previousButtonDisabled && (this.decrementPage(), this.onPaginationChanged()); 18819 } 18820 onMouseHover(e) { 18821 this.highlightActive = e, this.updateMarkers(), this.chartUpdateCallback( 18822 6 18823 /* SCENE_RENDER */ 18824 ); 18825 } 18826 onPaginationChanged() { 18827 this.pageUpdateCallback(this.currentPage); 18828 } 18829 incrementPage() { 18830 this.currentPage = Math.min(this.currentPage + 1, this.totalPages - 1); 18831 } 18832 decrementPage() { 18833 this.currentPage = Math.max(this.currentPage - 1, 0); 18834 } 18835 onMarkerShapeChange() { 18836 const e = Vc(bo(this.marker.shape || op)); 18837 this.previousButton = new e(), this.nextButton = new e(), this.updatePositions(), this.updateMarkers(), this.chartUpdateCallback( 18838 6 18839 /* SCENE_RENDER */ 18840 ); 18841 } 18842 attachPagination(e) { 18843 e.append(this.group); 18844 } 18845 getBBox() { 18846 return this.group.getBBox(); 18847 } 18848 computeCSSBounds() { 18849 const e = Ii.toCanvas(this.previousButton), t = Ii.toCanvas(this.nextButton); 18850 return { prev: e, next: t }; 18851 } 18852}; 18853Qc.className = "Pagination"; 18854S([ 18855 D(Be) 18856], Qc.prototype, "marker", 2); 18857S([ 18858 D(Be) 18859], Qc.prototype, "activeStyle", 2); 18860S([ 18861 D(Be) 18862], Qc.prototype, "inactiveStyle", 2); 18863S([ 18864 D(Be) 18865], Qc.prototype, "highlightStyle", 2); 18866S([ 18867 D(Be) 18868], Qc.prototype, "label", 2); 18869var KY = class { 18870 constructor(e, t) { 18871 this.idPrefix = t, this.dirty = !0, this.destroyFns = new AP(), this.itemList = e.proxyInteractionService.createProxyContainer({ 18872 type: "list", 18873 domManagerId: `${t}-toolbar`, 18874 classList: ["ag-charts-proxy-legend-toolbar"], 18875 ariaLabel: { id: "ariaLabelLegend" } 18876 }), this.paginationGroup = e.proxyInteractionService.createProxyContainer({ 18877 type: "group", 18878 domManagerId: `${t}-pagination`, 18879 classList: ["ag-charts-proxy-legend-pagination"], 18880 ariaLabel: { id: "ariaLabelLegendPagination" }, 18881 ariaOrientation: "horizontal" 18882 }), this.itemDescription = Gt("p"), this.itemDescription.style.display = "none", this.itemDescription.id = `${t}-ariaDescription`, this.itemDescription.textContent = this.getItemAriaDescription(e.localeManager), this.itemList.getElement().append(this.itemDescription); 18883 } 18884 destroy() { 18885 this.destroyFns.destroy(); 18886 } 18887 initLegendList(e) { 18888 if (!this.dirty) 18889 return; 18890 const { ctx: t, itemSelection: i, datumReader: s, itemListener: n } = e, o = t.localeManager, r = i.length; 18891 i.each((a, l, c) => { 18892 a.proxyButton?.destroy(), a.proxyButton = t.proxyInteractionService.createProxyElement({ 18893 type: "listswitch", 18894 textContent: this.getItemAriaText(o, s.getItemLabel(l), c, r), 18895 ariaChecked: !!a.datum.enabled, 18896 ariaDescribedBy: this.itemDescription.id, 18897 parent: this.itemList 18898 }); 18899 const u = a.proxyButton; 18900 u.addListener("click", (d) => n.onClick(d.sourceEvent, a.datum, u)), u.addListener("dblclick", (d) => n.onDoubleClick(d.sourceEvent, a.datum)), u.addListener("mouseenter", (d) => n.onHover(d.sourceEvent, a)), u.addListener("mouseleave", () =>
18900 n.onLeave()), u.addListener("contextmenu", (d) => n.onContextClick(d.sourceEvent, a)), u.addListener("blur", () => n.onLeave()), u.addListener("focus", (d) => n.onHover(d.sourceEvent, a)); 18901 }), this.dirty = !1; 18902 } 18903 update(e) { 18904 this.updateVisibility(e.visible), e.visible && (this.initLegendList(e), this.updateItemProxyButtons(e), this.updatePaginationProxyButtons(e)); 18905 } 18906 updateVisibility(e) { 18907 this.itemList.setHidden(!e), this.paginationGroup.setHidden(!e); 18908 } 18909 updateItemProxyButtons({ itemSelection: e, group: t, pagination: i, interactive: s }) { 18910 const n = Ii.toCanvas(t); 18911 this.itemList.setBounds(n); 18912 const o = Math.max(...e.nodes().map((r) => r.getBBox().height)); 18913 e.each((r, a) => { 18914 if (r.proxyButton) { 18915 const l = r.pageIndex === i.currentPage, { x: c, y: u, height: d, width: p } = Ii.toCanvas(r), f = (o - d) / 2, m = { x: c - n.x, y: u - f - n.y, height: o, width: p }; 18916 r.proxyButton.setCursor("pointer"), r.proxyButton.setEnabled(s && l), r.proxyButton.setBounds(m); 18917 } 18918 }); 18919 } 18920 updatePaginationProxyButtons(e) { 18921 const { ctx: t, pagination: i, oldPages: s, newPages: n } = e; 18922 this.paginationGroup.setHidden(!i.visible); 18923 const o = (s?.length ?? n.length) > 1, r = n.length > 1; 18924 o !== r && (r ? (this.prevButton = t.proxyInteractionService.createProxyElement({ 18925 type: "button", 18926 id: `${this.idPrefix}-prev-page`, 18927 textContent: { id: "ariaLabelLegendPagePrevious" }, 18928 tabIndex: 0, 18929 parent: this.paginationGroup 18930 }), this.prevButton.addListener("click", (c) => i.onClick(c.sourceEvent, "previous")), this.prevButton.addListener("mouseenter", () => i.onMouseHover("previous")), this.prevButton.addListener("mouseleave", () => i.onMouseHover(void 0)), this.nextButton ?? (this.nextButton = t.proxyInteractionService.createProxyElement({ 18931 type: "button", 18932 id: `${this.idPrefix}-next-page`, 18933 textContent: { id: "ariaLabelLegendPageNext" }, 18934 tabIndex: 0, 18935 parent: this.paginationGroup 18936 })), this.nextButton.addListener("click", (c) => i.onClick(c.sourceEvent, "next")), this.nextButton.addListener("mouseenter", () => i.onMouseHover("next")), this.nextButton.addListener("mouseleave", () => i.onMouseHover(void 0))) : (this.nextButton?.destroy(), this.prevButton?.destroy(), this.nextButton = void 0, this.prevButton = void 0)); 18937 const { prev: a, next: l } = i.computeCSSBounds(); 18938 this.prevButton?.setBounds(a), this.nextButton?.setBounds(l), this.updatePaginationCursors(e); 18939 } 18940 updatePaginationCursors({ pagination: e }) { 18941 this.nextButton?.setCursor(e.getCursor("next")), this.prevButton?.setCursor(e.getCursor("previous")); 18942 } 18943 onDataUpdate(e, t) { 18944 this.dirty = e.length !== t.length || e.some((i, s, n) => { 18945 const [o, r] = [t[s], e[s]]; 18946 return o.id !== r.id; 18947 }); 18948 } 18949 onLocaleChanged(e, t, i) { 18950 const s = t.length; 18951 t.each(({ proxyButton: n }, o, r) => { 18952 const a = n?.getElement(); 18953 if (a != null) { 18954 const l = i.getItemLabel(o); 18955 a.textContent = this.getItemAriaText(e, l, r, s); 18956 } 18957 }), this.itemDescription.textContent = this.getItemAriaDescription(e); 18958 } 18959 onPageChange(e) { 18960 this.updateItemProxyButtons(e), this.updatePaginationCursors(e); 18961 } 18962 getItemAriaText(e, t, i, s) { 18963 return i >= 0 && t ? (i++, e.t("ariaLabelLegendItem", { label: t, index: i, count: s })) : e.t("ariaLabelLegendItemUnknown"); 18964 } 18965 getItemAriaDescription(e) { 18966 return e.t("ariaDescriptionLegendItem"); 18967 } 18968}; 18969function nR(e, t, i, s) { 18970 const n = { 18971 defaultPrevented: !1, 18972 apiEvent: { 18973 type: e, 18974 itemId: t, 18975 seriesId: i, 18976 event: s, 18977 preventDefault: () => n.defaultPrevented = !0 18978 } 18979 }; 18980 return n; 18981} 18982var Xc = class extends wl { 18983 constructor(t) { 18984 super(), this.sourceImage = t, this.x = 0, this.y = 0, this.width = 0, this.height = 0, this.opacity = 1; 18985 } 18986 updateBitmap(t, i, s, n) { 18987 this.sourceImage = t, this.width = t.width / i, this.height = t.height / i, this.x = s / i, this.y = n / i, this.markDirty(); 18988 } 18989 render(t) { 18990 const { ctx: i } = t, s = this.sourceImage; 18991 s && (i.globalAlpha = this.opacity, i.drawImage(s, 0, 0, s.width, s.height, this.x, this.y, this.width, this.height)), super.render(t); 18992 } 18993}; 18994S([ 18995 Ge() 18996], Xc.prototype, "x", 2); 18997S([ 18998 Ge() 18999], Xc.prototype, "y", 2); 19000S([ 19001 Ge() 19002], Xc.prototype, "width", 2); 19003S([ 19004 Ge() 19005], Xc.prototype, "height", 2); 19006S([ 19007 Ge() 19008], Xc.prototype, "opacity", 2); 19009var Ia = class extends Uc(Ye) { 19010 constructor() { 19011 super({ name: "markerLabelGroup" }), this.label = new Qi(), this.symbolsGroup = new Ye({ 19012 name: "legend-markerLabel-symbols" 19013 }), this.bitmap = new Xc(), this.bitmapDirty = !0, this.enabled = !0, this.pageIndex = NaN, this._marker = void 0, this._line = void 0; 19014 const { marker: e, label: t, line: i } = this; 19015 t.textBaseline = "middle", t.fontSize = 12, t.fontFamily = "Verdana, sans-serif", t.fill = "black", t.y = 1, this.updateSymbols(e, i), this.append([this.symbolsGroup, t]); 19016 } 19017 destroy() { 19018 super.destroy(), this.proxyButton?.destroy(); 19019 } 19020 get marker() { 19021 return this._marker; 19022 } 19023 get line() { 19024 return this._line; 19025 } 19026 updateSymbols(e, t) { 19027 this._marker === e && this._line === t || (this.bitmapDirty = !0, this._marker = e, this._line = t, this.symbolsGroup.clear(), this.symbolsGroup.append([this.bitmap, t, e].filter(cl))); 19028 } 19029 setEnabled(e) { 19030 this.enabled = e, this.refreshVisibilities(); 19031 } 19032 refreshVisibilities() { 19033 const e = this.enabled ? 1 : 0.5;
19034 this.label.opacity = e, this.opacity = e, this.bitmap.opacity = e, this.setBitmapVisibility(!this.enabled); 19035 } 19036 setBitmapVisibility(e) { 19037 const { line: t, marker: i } = this; 19038 i != null && (i.visible = !e), t != null && (t.visible = !e), this.bitmap.visible = e; 19039 } 19040 // The BBox of this.bitmap is `spritePadding` pixels bigger in each direction than BBox of the markers and lines. 19041 // This padding allows the SpriteRenderer to draw antialiasing pixels that can extend beyond the shapes' bounds. 19042 update(e, { spriteAAPadding: t, spritePixelRatio: i }, s) { 19043 const { marker: n, line: o } = this, { length: r, spacing: a, isCustomMarker: l } = s; 19044 let c = 1 / 0, u = 1 / 0, d = 1 / 0, p = 1 / 0, f = 1 / 0, m = 0, y = 0; 19045 if (n) { 19046 const { size: A } = n, I = n.constructor.center, L = (A + n.strokeWidth) / 2; 19047 m = (I.x - 0.5) * A, y = (I.y - 0.5) * A, l ? (n.x = 0, n.y = 0, n.translationX = m * A + r / 2, n.translationY = y * A, p = n.translationY - L, f = n.translationX - L) : (n.x = m + r / 2, n.y = y, p = n.y - L, f = n.x - L); 19048 } 19049 o && (o.x1 = 0, o.x2 = r, o.y1 = 0, o.y2 = 0, o.markDirty(), c = -o.strokeWidth / 2, u = o.x1, d = o.x2); 19050 const b = Math.min(u, d, f), C = Math.min(c, p), w = o?.x2 ?? -1 / 0, M = (n?.x ?? 0) + (n?.size ?? 0) / 2; 19051 if (this.label.x = Math.max(w, M) + a, this.bitmapDirty) { 19052 this.setBitmapVisibility(!1); 19053 const A = m + (t + b) * i, I = y + (t - C) * i, L = e.renderSprite(this.symbolsGroup, { 19054 scale: i, 19055 translateX: Math.floor(A), 19056 translateY: Math.floor(I) 19057 }); 19058 this.bitmap.updateBitmap(L, i, Math.ceil(-A), Math.ceil(-I)), this.bitmapDirty = !1, this.refreshVisibilities(); 19059 } 19060 } 19061 computeBBox() { 19062 const { label: e, line: t, marker: i } = this; 19063 return this.toParent(Ye.computeChildrenBBox([e, t, i].filter(cl), !1)); 19064 } 19065}; 19066Ia.className = "MarkerLabel"; 19067S([ 19068 rs("label") 19069], Ia.prototype, "text", 2); 19070S([ 19071 rs("label") 19072], Ia.prototype, "fontStyle", 2); 19073S([ 19074 rs("label") 19075], Ia.prototype, "fontWeight", 2); 19076S([ 19077 rs("label") 19078], Ia.prototype, "fontSize", 2); 19079S([ 19080 rs("label") 19081], Ia.prototype, "fontFamily", 2); 19082S([ 19083 rs("label", "fill") 19084], Ia.prototype, "color", 2); 19085var Ol = class extends it { 19086 constructor() { 19087 super(...arguments), this.maxLength = void 0, this.color = "black", this.fontStyle = void 0, this.fontWeight = void 0, this.fontSize = 12, this.fontFamily = "Verdana, sans-serif"; 19088 } 19089}; 19090S([ 19091 D(Te, { optional: !0 }) 19092], Ol.prototype, "maxLength", 2); 19093S([ 19094 D(Ft) 19095], Ol.prototype, "color", 2); 19096S([ 19097 D(Ca, { optional: !0 }) 19098], Ol.prototype, "fontStyle", 2); 19099S([ 19100 D(ba, { optional: !0 }) 19101], Ol.prototype, "fontWeight", 2); 19102S([ 19103 D(Te) 19104], Ol.prototype, "fontSize", 2); 19105S([ 19106 D(Me) 19107], Ol.prototype, "fontFamily", 2); 19108S([ 19109 D(tn, { optional: !0 }) 19110], Ol.prototype, "formatter", 2); 19111var qd = class extends it { 19112 constructor() { 19113 super(...arguments), this.size = 15, this.padding = 8; 19114 } 19115}; 19116S([ 19117 jc((e) => e.parent?.onMarkerShapeChange()) 19118], qd.prototype, "shape", 2); 19119S([ 19120 D(Te) 19121], qd.prototype, "size", 2); 19122S([ 19123 D(Te) 19124], qd.prototype, "padding", 2); 19125S([ 19126 D(Te, { optional: !0 }) 19127], qd.prototype, "strokeWidth", 2); 19128S([ 19129 D(je) 19130], qd.prototype, "enabled", 2); 19131var Wx = class extends it { 19132}; 19133S([ 19134 D(Te, { optional: !0 }) 19135], Wx.prototype, "strokeWidth", 2); 19136S([ 19137 D(Te, { optional: !0 }) 19138], Wx.prototype, "length", 2); 19139var Nl = class extends it { 19140 constructor() { 19141 super(...arguments), this.paddingX = 16, this.paddingY = 8, this.showSeriesStroke = !1, this.marker = new qd(), this.label = new Ol(), this.line = new Wx(); 19142 } 19143}; 19144S([ 19145 D(Te, { optional: !0 }) 19146], Nl.prototype, "maxWidth", 2); 19147S([ 19148 D(Te) 19149], Nl.prototype, "paddingX", 2); 19150S([ 19151 D(Te) 19152], Nl.prototype, "paddingY", 2); 19153S([ 19154 D(je) 19155], Nl.prototype, "showSeriesStroke", 2); 19156S([ 19157 D(Be) 19158], Nl.prototype, "marker", 2); 19159S([ 19160 D(Be) 19161], Nl.prototype, "label", 2); 19162S([ 19163 D(Be) 19164], Nl.prototype, "line", 2); 19165var jx = class extends it { 19166}; 19167S([ 19168 D(tn, { optional: !0 }) 19169], jx.prototype, "legendItemClick", 2); 19170S([ 19171 D(tn, { optional: !0 }) 19172], jx.prototype, "legendItemDoubleClick", 2); 19173var Eh = "legend-visibility", e0 = "legend-other-series", xn = class extends it { 19174 constructor(e) { 19175 super(), this.ctx = e, this.id = So(this), this.group = new Ks({ 19176 name: "legend", 19177 zIndex: 13 19178 /* LEGEND */ 19179 }), this.itemSelection = _i.select( 19180 this.group, 19181 Ia 19182 ), this.spriteRenderer = void 0, this.oldSize = [0, 0], this.pages = [], this.maxPageSize = [0, 0], this.paginationTrackingIndex = 0, this.truncatedItems = /* @__PURE__ */ new Set(), this._data = [], this._symbolsDirty = !0, this.toggleSeries = !0, this.item = new
19182Nl(), this.listeners = new jx(), this.enabled = !0, this.position = "bottom", this.spacing = 20, this.destroyFns = [], this.size = [0, 0], this._visible = !0, this.item.marker.parent = this, this.pagination = new Qc( 19183 (t) => e.updateService.update(t), 19184 (t) => this.updatePageNumber(t) 19185 ), this.pagination.attachPagination(this.group), this.destroyFns.push( 19186 e.contextMenuRegistry.registerDefaultAction({ 19187 id: Eh, 19188 type: "legend", 19189 label: "contextMenuToggleSeriesVisibility", 19190 action: (t) => this.contextToggleVisibility(t) 19191 }), 19192 e.contextMenuRegistry.registerDefaultAction({ 19193 id: e0, 19194 type: "legend", 19195 label: "contextMenuToggleOtherSeries", 19196 action: (t) => this.contextToggleOtherSeries(t) 19197 }), 19198 e.legendManager.addListener("legend-change", this.onLegendDataChange.bind(this)) 19199 ), this.destroyFns.push( 19200 e.layoutManager.registerElement(1, (t) => this.positionLegend(t)), 19201 e.localeManager.addListener("locale-changed", () => this.onLocaleChanged()), 19202 () => this.group.remove() 19203 ), this.domProxy = new KY(this.ctx, this.id), this.ctx.historyManager.addMementoOriginator(e.legendManager); 19204 } 19205 set data(e) { 19206 this.domProxy.onDataUpdate(this._data, e), this._data = e, this._symbolsDirty = !0, this.updateGroupVisibility(); 19207 } 19208 get data() { 19209 return this._data; 19210 } 19211 onLegendDataChange({ legendData: e = [] }) { 19212 if (!this.enabled) 19213 return; 19214 const t = e.filter((s) => !s.hideInLegend), { data: i } = this; 19215 kc(e, i) || (this.data = t); 19216 } 19217 destroy() { 19218 this.ctx.domManager.removeChild("canvas-overlay", `${this.id}-toolbar`), this.ctx.domManager.removeChild("canvas-overlay", `${this.id}-pagination`), this.destroyFns.forEach((e) => e()), this.pagination.destroy(), this.itemSelection.clear(), this.domProxy.destroy(); 19219 } 19220 onMarkerShapeChange() { 19221 this.itemSelection.clear(), this.group.markDirty(); 19222 } 19223 getOrientation() { 19224 if (this.orientation !== void 0) 19225 return this.orientation; 19226 switch (this.position) { 19227 case "right": 19228 case "left": 19229 return "vertical"; 19230 case "bottom": 19231 case "top": 19232 return "horizontal"; 19233 } 19234 } 19235 set visible(e) { 19236 this._visible = e, this.updateGroupVisibility(); 19237 } 19238 get visible() { 19239 return this._visible; 19240 } 19241 updateGroupVisibility() { 19242 this.group.visible = this.enabled && this.visible && this.data.length > 0; 19243 } 19244 attachLegend(e) { 19245 e.appendChild(this.group); 19246 } 19247 getItemLabel(e) { 19248 const { 19249 ctx: { callbackCache: t } 19250 } = this, { formatter: i } = this.item.label; 19251 if (i) { 19252 const s = e.datum; 19253 return t.call(i, { 19254 itemId: e.itemId, 19255 value: e.label.text, 19256 seriesId: e.seriesId, 19257 ...s && { datum: s } 19258 }); 19259 } 19260 return e.label.text; 19261 } 19262 /** 19263 * The method is given the desired size of the legend, which only serves as a hint. 19264 * The vertically oriented legend will take as much horizontal space as needed, but will 19265 * respect the height constraints, and the horizontal legend will take as much vertical 19266 * space as needed in an attempt not to exceed the given width. 19267 * After the layout is done, the {@link size} will contain the actual size of the legend. 19268 * If the actual size is not the same as the previous actual size, the legend will fire 19269 * the 'layoutChange' event to communicate that another layout is needed, and the above 19270 * process should be repeated. 19271 * @param width 19272 * @param height 19273 */ 19274 calcLayout(e, t) { 19275 const { 19276 paddingX: i, 19277 paddingY: s, 19278 label: n, 19279 maxWidth: o, 19280 label: { maxLength: r = 1 / 0, fontStyle: a, fontWeight: l, fontSize: c, fontFamily: u } 19281 } = this.item, d = [...this.data]; 19282 this.reverseOrder && d.reverse(), this.itemSelection.update(d); 19283 const p = [], f = vi.toFontString(n), y = o ?? e * 0.8, b = this.calculateSpriteDimensions(); 19284 if (this.spriteRenderer ?? (this.spriteRenderer = new BP()), this.spriteRenderer.resize(b), this.itemSelection.each((N, W) => { 19285 N.fontStyle = a, N.fontWeight = l, N.fontSize = c, N.fontFamily = u; 19286 const se = this.updateMarkerLabel(this.spriteRenderer, N, W, b), ue = W.itemId ?? W.id, te = (this.getItemLabel(W) ?? "<unknown>").replace(/\r?\n/g, " "); 19287 N.text = this.truncate(te, r, y, se, f, ue), p.push(N.getBBox()); 19288 }), this._symbolsDirty = !1, e = Math.max(1, e), t = Math.max(1, t), !isFinite(e)) 19289 return {}; 19290 const C = this.size, w = this.oldSize; 19291 C[0] = e, C[1] = t, (C[0] !== w[0] || C[1] !== w[1]) && (w[0] = C[0], w[1] = C[1]); 19292 const { pages: M, maxPageHeight: A, maxPageWidth: I } = this.updatePagination(p, e, t), L = this.pages; 19293 this.pages = M, this.maxPageSize = [I - i, A - s];
19294 const k = this.pagination.currentPage, B = this.pages[k]; 19295 return this.pages.length < 1 || !B ? (this.visible = !1, { oldPages: L }) : (this.visible = !0, this.updatePositions(k), this.update(), { oldPages: L }); 19296 } 19297 isCustomMarker(e, t) { 19298 return e && t !== void 0 && typeof t != "string"; 19299 } 19300 calcSymbolsEnabled(e) { 19301 const { showSeriesStroke: t, marker: i } = this.item, s = !!i.enabled || !t || (e.marker.enabled ?? !0), n = !!(e.line && t), o = this.isCustomMarker(s, e.marker.shape); 19302 return { markerEnabled: s, lineEnabled: n, isCustomMarker: o }; 19303 } 19304 calcSymbolsLengths(e) { 19305 const { marker: t, line: i } = this.item, { markerEnabled: s, lineEnabled: n } = this.calcSymbolsEnabled(e), { strokeWidth: o } = this.getMarkerStyles(e), { strokeWidth: r } = n ? this.getLineStyles(e) : { strokeWidth: 0 }; 19306 let a; 19307 const { shape: l } = e.marker; 19308 if (this.isCustomMarker(s, l)) { 19309 const d = bo(l), p = new d(); 19310 p.updatePath(); 19311 const f = p.getBBox(); 19312 a = Math.max(f.width, f.height); 19313 } 19314 const c = s ? t.size : 0, u = n ? i.length ?? 25 : 0; 19315 return { markerLength: c, markerStrokeWidth: o, lineLength: u, lineStrokeWidth: r, customMarkerSize: a }; 19316 } 19317 calculateSpriteDimensions() { 19318 let e = 0, t = 0, i = 0, s = 0; 19319 return this.itemSelection.each((o, r) => { 19320 const { symbol: a } = r, { 19321 markerLength: l, 19322 markerStrokeWidth: c, 19323 lineLength: u, 19324 lineStrokeWidth: d, 19325 customMarkerSize: p = -1 / 0 19326 } = this.calcSymbolsLengths(a), f = l + c; 19327 s = Math.max(s, u, p, l), t = Math.max(t, u, p, f), i = Math.max(i, d, f), e = Math.max(e, c + 0.5); 19328 }), t += e * 2, i += e * 2, { spritePixelRatio: pi().devicePixelRatio, spriteAAPadding: e, spriteWidth: t, spriteHeight: i, markerWidth: s }; 19329 } 19330 updateMarkerLabel(e, t, i, s) { 19331 const { marker: n, paddingX: o } = this.item, { markerWidth: r } = s, { symbol: a } = i; 19332 let l = o; 19333 const { markerEnabled: c, lineEnabled: u, isCustomMarker: d } = this.calcSymbolsEnabled(a); 19334 if (this._symbolsDirty) { 19335 const { shape: b = a.marker.shape } = n, C = bo(b); 19336 t.updateSymbols(new C({ zIndex: 1 }), new Hn({ zIndex: 0 })); 19337 } 19338 const p = n.padding, { marker: f, line: m } = t; 19339 f != null && (f.size = c || !u ? n.size : 0); 19340 const y = { length: r, spacing: p, isCustomMarker: d }; 19341 if ((c || u) && (l += p + r), f) { 19342 const { strokeWidth: b, fill: C, stroke: w, fillOpacity: M, strokeOpacity: A } = this.getMarkerStyles(a); 19343 f.fill = C, f.stroke = w, f.strokeWidth = b, f.fillOpacity = M, f.strokeOpacity = A; 19344 } 19345 if (!u && m != null) 19346 m.strokeWidth = 0; 19347 else if (m) { 19348 const b = this.getLineStyles(a); 19349 m.stroke = b.stroke, m.strokeOpacity = b.strokeOpacity, m.strokeWidth = b.strokeWidth, m.lineDash = b.lineDash; 19350 } 19351 return t.update(e, s, y), l; 19352 } 19353 truncate(e, t, i, s, n, o) { 19354 let r = !1; 19355 e.length > t && (e = e.substring(0, t), r = !0); 19356 const a = wa.getMeasurer({ font: n }), l = rx.truncateLine(e, a, i - s, r); 19357 return l.endsWith(vi.EllipsisChar) ? this.truncatedItems.add(o) : this.truncatedItems.delete(o), l; 19358 } 19359 updatePagination(e, t, i) { 19360 const s = this.getOrientation(), n = Math.min(this.paginationTrackingIndex, e.length); 19361 this.pagination.orientation = s, this.pagination.translationX = 0, this.pagination.translationY = 0; 19362 const { pages: o, maxPageHeight: r, maxPageWidth: a, paginationBBox: l, paginationVertical: c } = this.calculatePagination( 19363 e, 19364 t, 19365 i 19366 ), u = o.findIndex((M) => M.endIndex >= n); 19367 this.pagination.currentPage = ot(0, u, o.length - 1); 19368 const { paddingX: d, paddingY: p } = this.item, f = 8, m = a - d, y = r - p; 19369 let b = 0, C = -l.y - this.item.marker.size / 2; 19370 c ? C += y + f : (b += -l.x + m + f, C += (y - l.height) / 2), this.pagination.translationX = b, this.pagination.translationY = C, this.pagination.update(), this.pagination.updateMarkers(); 19371 let w = 0; 19372 return this.itemSelection.each((M, A, I) => { 19373 I > (o[w]?.endIndex ?? 1 / 0) && w++, M.pageIndex = w; 19374 }), { 19375 maxPageHeight: r, 19376 maxPageWidth: a, 19377 pages: o 19378 }; 19379 } 19380 calculatePagination(e, t, i) { 19381 const { paddingX: s, paddingY: n } = this.item, o = this.getOrientation(), r = ["left", "right"].includes(this.position); 19382 let a = this.pagination.getBBox(), l = new _e(0, 0, 0, 0), c = [], u = 0, d = 0, p = 0; 19383 const f = (y) => y.width === a.width && y.height === a.height, m = this.maxWidth !== void 0 && this.maxHeight !== void 0; 19384 do { 19385 if (p++ > 10) { 19386 Ee.warn("unable to find stable legend layout."); 19387 break; 19388 } 19389 a = l; 19390 const y = t - (r ? 0 : a.width), b = i - (r ? a.height : 0), C = VY({ 19391 orientation: o, 19392 bboxes: e, 19393 maxHeight: b, 19394 maxWidth: y, 19395 itemPaddingY: n, 19396 itemPaddingX: s, 19397 forceResult: m 19398 }); 19399 c = C?.pages ?? [], u = C?.maxPageWidth ?? 0, d = C?.maxPageHeight ?? 0; 19400 const w = c.length; 19401 if (this.pagination.visible = w > 1, this.pagination.totalPages = w, this.pagination.update(), this.pagination.updateMarkers(), l = this.pagination.getBBox(), !this.pagination.visible) 19402 break; 19403 } while (!f(l)); 19404 return { maxPageWidth: u, maxPageHeight: d, pages: c, paginationBBox: l, paginationVertical: r }; 19405 } 19406 updatePositions(e = 0) { 19407 const { 19408 item: { paddingY: t }, 19409 itemSelection: i, 19410 pages: s 19411 } = this; 19412 if (s.length < 1 || !s[e]) 19413 return; 19414 const { columns: n, startIndex: o, endIndex: r } = s[e]; 19415 let a = 0, l = 0; 19416 const c = n.length, u = n[0].indices.length, d = this.getOrientation() === "horizontal", p = n[0].bboxes[0].height + t, f = []; 19417 i.each((m, y, b) => { 19418 if (b < o || b > r) { 19419 m.visible = !1; 19420 return; 19421 } 19422 const C = b - o; 19423 let w, M; 19424 d ? (w = C % c, M = Math.floor(C / c)) : (w = Math.floor(C / u), M = C % u), m.visible = !0; 19425 const A = n[w]; 19426 A && (l = Math.floor(p * M), a = Math.floor(f[M] ?? 0), f[M] = (f[M] ?? 0) + A.columnWidth, m.translationX = a, m.translationY = l); 19427 }); 19428 } 19429 updatePageNumber(e) { 19430 const { itemSelection: t, group: i, pagination: s, pages: n, toggleSeries: o } = this, { startIndex: r, endIndex: a } = n[e]; 19431 r === 0 ? this.paginationTrackingIndex = 0 : e === n.length - 1 ? this.paginationTrackingIndex = a : this.paginationTrackingIndex = Math.floor((r + a) / 2), this.pagination.update(), this.pagination.updateMarkers(), this.updatePositions(e), this.domProxy.onPageChange({ itemSelection: t, group: i, pagination: s, interactive: o }), this.ctx.updateService.update( 19432 6 19433 /* SCENE_RENDER */ 19434 ); 19435 } 19436 update() { 19437 const { 19438 label: { color: e } 19439 } = this.item; 19440 this.itemSelection.each((t, i) => { 19441 t.setEnabled(i.enabled), t.color = e; 19442 }), this.updateContextMenu(); 19443 } 19444 updateContextMenu() { 19445 const { 19446 toggleSeries: e, 19447 ctx: { contextMenuRegistry: t } 19448 } = this;
19449 e ? (t.hideAction(Eh), t.hideAction(e0)) : (t.showAction(Eh), t.showAction(e0)); 19450 } 19451 getLineStyles(e) { 19452 const { stroke: t, strokeOpacity: i = 1, strokeWidth: s, lineDash: n } = e.line ?? {}, o = Math.min(2, s ?? 1); 19453 return { 19454 stroke: t, 19455 strokeOpacity: i, 19456 strokeWidth: this.item.line.strokeWidth ?? o, 19457 lineDash: n 19458 }; 19459 } 19460 getMarkerStyles(e) { 19461 const { fill: t, stroke: i, strokeOpacity: s = 1, fillOpacity: n = 1, strokeWidth: o } = e.marker, r = Math.min(2, o ?? 1); 19462 return { 19463 fill: t, 19464 stroke: i, 19465 strokeOpacity: s, 19466 fillOpacity: n, 19467 strokeWidth: this.item.marker.strokeWidth ?? r 19468 }; 19469 } 19470 computePagedBBox() { 19471 const e = Ye.computeChildrenBBox(this.group.children()); 19472 if (this.pages.length > 1) { 19473 const [t, i] = this.maxPageSize; 19474 e.height = Math.max(i, e.height), e.width = Math.max(t, e.width); 19475 } 19476 return e; 19477 } 19478 findNode(e) { 19479 const { datum: t, proxyButton: i } = this.itemSelection.select((s) => s.datum?.itemId === e.itemId)[0] ?? {}; 19480 if (t === void 0 || i === void 0) 19481 throw new Error( 19482 `AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }` 19483 ); 19484 return { datum: t, proxyButton: i }; 19485 } 19486 contextToggleVisibility(e) { 19487 const { datum: t, proxyButton: i } = this.findNode(e); 19488 this.doClick(e.event, t, i); 19489 } 19490 contextToggleOtherSeries(e) { 19491 this.doDoubleClick(e.event, this.findNode(e).datum); 19492 } 19493 onContextClick(e, t) { 19494 const i = t.datum; 19495 this.preventHidingAll && this.contextMenuDatum?.enabled && this.getVisibleItemCount() <= 1 ? this.ctx.contextMenuRegistry.disableAction(Eh) : this.ctx.contextMenuRegistry.enableAction(Eh); 19496 const { offsetX: s, offsetY: n } = e, { x: o, y: r } = Ii.toCanvasPoint(t, s, n); 19497 this.ctx.contextMenuRegistry.dispatchContext("legend", { sourceEvent: e, canvasX: o, canvasY: r }, { legendItem: i }); 19498 } 19499 onClick(e, t, i) { 19500 this.doClick(e, t, i) && e.preventDefault(); 19501 } 19502 getVisibleItemCount() { 19503 return this.ctx.chartService.series.flatMap((e) => e.getLegendData("category")).filter((e) => e.enabled).length; 19504 } 19505 doClick(e, t, i) { 19506 const { 19507 listeners: { legendItemClick: s }, 19508 ctx: { chartService: n, highlightManager: o }, 19509 preventHidingAll: r, 19510 toggleSeries: a 19511 } = this; 19512 if (!t) 19513 return !1; 19514 const { legendType: l, seriesId: c, itemId: u, enabled: d } = t, p = n.series.find((y) => y.id === c); 19515 if (!p) 19516 return !1; 19517 let f = d; 19518 const m = nR("click", u, p.id, e); 19519 return s?.(m.apiEvent), m.defaultPrevented || (a && (f = !d, r && !f && this.getVisibleItemCount() < 2 && (f = !0), i.setChecked(f), this.ctx.chartEventManager.legendItemClick(l, p, u, f, t.legendItemName)), f ? o.updateHighlight(this.id, { 19520 series: p, 19521 itemId: u, 19522 datum: void 0 19523 }) : o.updateHighlight(this.id), this.ctx.legendManager.update(), this.ctx.updateService.update(2, { 19524 forceNodeDataRefresh: !0, 19525 skipAnimations: t.skipAnimations ?? !1 19526 })), !0; 19527 } 19528 onDoubleClick(e, t) { 19529 this.doDoubleClick(e, t) && e.preventDefault(); 19530 } 19531 doDoubleClick(e, t) { 19532 const { 19533 listeners: { legendItemDoubleClick: i }, 19534 ctx: { chartService: s }, 19535 toggleSeries: n 19536 } = this; 19537 if (s.mode === "integrated" || !t) 19538 return !1; 19539 const { legendType: o, id: r, itemId: a, seriesId: l } = t, c = s.series.find((d) => d.id === r); 19540 if (!c) 19541 return !1; 19542 const u = nR("dblclick", a, c.id, e); 19543 if (i?.(u.apiEvent), u.defaultPrevented) 19544 return !0; 19545 if (n) { 19546 const d = s.series.flatMap((m) => m.getLegendData("category")), p = d.filter((m) => m.enabled).length, f = d.find((m) => m.itemId === a && m.seriesId === l); 19547 this.ctx.chartEventManager.legendItemDoubleClick( 19548 o, 19549 c, 19550 a, 19551 f?.enabled ?? !1, 19552 p, 19553 f?.legendItemName 19554 ); 19555 } 19556 return this.ctx.legendManager.update(), this.ctx.updateService.update(2, { forceNodeDataRefresh: !0 }), !0; 19557 } 19558 toTooltipMeta(e, t) { 19559 let i; 19560 if (e instanceof FocusEvent) { 19561 const { x: o, y: r } = Ii.toCanvas(t).computeCenter(); 19562 i = { type: "keyboard", canvasX: o, canvasY: r }; 19563 } else { 19564 e.preventDefault(); 19565 const { x: o, y: r } = Ii.toCanvasPoint(t, e.offsetX, e.offsetY); 19566 i = { type: "hover", canvasX: o, canvasY: r }; 19567 } 19568 const { canvasX: s, canvasY: n } = i; 19569 return { canvasX: s, canvasY: n, lastPointerEvent: i, showArrow: !1 }; 19570 } 19571 onHover(e, t) { 19572 if (!this.enabled) 19573 throw new Error("AG Charts - onHover handler called on disabled legend"); 19574 this.pagination.setPage(t.pageIndex); 19575 const i = t.datum, s = i ? this.ctx.chartService.series.find((n) => n.id === i?.id) : void 0; 19576 if (i && this.truncatedItems.has(i.itemId ?? i.id)) { 19577 const n = this.toTooltipMeta(e, t); 19578 this.ctx.tooltipManager.updateTooltip(this.id, n, { title: this.getItemLabel(i) }); 19579 } else 19580 this.ctx.tooltipManager.removeTooltip(this.id); 19581 i?.enabled && s ? this.updateHighlight({ series: s, itemId: i?.itemId, datum: void 0 }) : this.updateHighlight(); 19582 } 19583 onLeave() { 19584 this.ctx.tooltipManager.removeTooltip(this.id), this.updateHighlight(); 19585 } 19586 updateHighlight(e) { 19587 const t = this.ctx.interactionManager.getState(); 19588 t === 32 ? this.ctx.highlightManager.updateHighlight(this.id, e) : t === 2 && (this.pendingHighlightDatum = e, this.ctx.animationManager.onBatchStop(() => { 19589 this.ctx.highlightManager.updateHighlight(this.id, this.pendingHighlightDatum); 19590 })); 19591 } 19592 onLocaleChanged() { 19593 this.domProxy.onLocaleChanged(this.ctx.localeManager, this.itemSelection, this); 19594 } 19595 positionLegend(e) { 19596 const t = this.positionLegendScene(e); 19597 this.positionLegendDOM(t); 19598 } 19599 positionLegendScene(e) { 19600 if (!this.enabled || !this.data.length) 19601 return; 19602 const { layoutBox: t } = e, { x: i, y: s, width: n, height: o } = t, [r, a] = this.calculateLegendDimensions(t), { oldPages: l } = this.calcLayout(r, a), c = this.computePagedBBox(), u = () => { 19603 switch (this.position) { 19604 case "top":
19605 case "left": 19606 return 0; 19607 case "bottom": 19608 return o - c.height; 19609 default: 19610 return n - c.width; 19611 } 19612 }; 19613 if (this.visible) { 19614 const d = this.spacing; 19615 let p, f; 19616 switch (this.position) { 19617 case "top": 19618 case "bottom": 19619 p = (n - c.width) / 2, f = u(), t.shrink(c.height + d, this.position); 19620 break; 19621 default: 19622 p = u(), f = (o - c.height) / 2, t.shrink(c.width + d, this.position); 19623 } 19624 this.group.translationX = Math.floor(i + p - c.x), this.group.translationY = Math.floor(s + f - c.y); 19625 } 19626 return l; 19627 } 19628 positionLegendDOM(e) { 19629 const { ctx: t, itemSelection: i, pagination: s, pages: n, toggleSeries: o, group: r } = this, a = this.visible && this.enabled; 19630 this.domProxy.update({ 19631 visible: a, 19632 interactive: o, 19633 ctx: t, 19634 itemSelection: i, 19635 group: r, 19636 pagination: s, 19637 oldPages: e, 19638 newPages: n, 19639 datumReader: this, 19640 itemListener: this 19641 }); 19642 } 19643 calculateLegendDimensions(e) { 19644 const { width: t, height: i } = e, s = t / i, n = 0.5, o = 0.2, r = 0.25; 19645 let a, l; 19646 switch (this.position) { 19647 case "top": 19648 case "bottom": { 19649 const c = s < 1 ? Math.min(n, o * (1 / s)) : o; 19650 a = this.maxWidth ? Math.min(this.maxWidth, t) : t, l = this.maxHeight ? Math.min(this.maxHeight, i) : Math.round(i * c); 19651 break; 19652 } 19653 default: { 19654 const c = s > 1 ? Math.min(n, r * s) : r; 19655 a = this.maxWidth ? Math.min(this.maxWidth, t) : Math.round(t * c), l = this.maxHeight ? Math.min(this.maxHeight, i) : i; 19656 } 19657 } 19658 return [a, l]; 19659 } 19660}; 19661xn.className = "Legend"; 19662S([ 19663 D(je) 19664], xn.prototype, "toggleSeries", 2); 19665S([ 19666 D(Be) 19667], xn.prototype, "pagination", 2); 19668S([ 19669 D(Be) 19670], xn.prototype, "item", 2); 19671S([ 19672 D(Be) 19673], xn.prototype, "listeners", 2); 19674S([ 19675 jc((e, t, i) => { 19676 if (e.updateGroupVisibility(), t === i) 19677 return; 19678 const { 19679 ctx: { legendManager: s, stateManager: n } 19680 } = e; 19681 i === !1 && t === !0 && n.restoreState(s); 19682 }), 19683 D(je) 19684], xn.prototype, "enabled", 2); 19685S([ 19686 D(WS) 19687], xn.prototype, "position", 2); 19688S([ 19689 D(Te, { optional: !0 }) 19690], xn.prototype, "maxWidth", 2); 19691S([ 19692 D(Te, { optional: !0 }) 19693], xn.prototype, "maxHeight", 2); 19694S([ 19695 D(je, { optional: !0 }) 19696], xn.prototype, "reverseOrder", 2); 19697S([ 19698 D(si(["horizontal", "vertical"], "an orientation"), { optional: !0 }) 19699], xn.prototype, "orientation", 2); 19700S([ 19701 D(je, { optional: !0 }) 19702], xn.prototype, "preventHidingAll", 2); 19703S([ 19704 D(Te) 19705], xn.prototype, "spacing", 2); 19706var ZY = { 19707 type: "legend", 19708 optionsKey: "legend", 19709 identifier: "category", 19710 chartTypes: ["cartesian", "polar", "hierarchy", "topology", "flow-proportion", "standalone", "gauge"], 19711 moduleFactory: (e) => new xn(e), 19712 packageType: "community", 19713 removable: "standalone-only" 19714}, XF = {}; 19715Zo(XF, { 19716 CARTESIAN_AXIS_TYPE: () => t2, 19717 CARTESIAN_POSITION: () => e2, 19718 FONT_SIZE: () => JF, 19719 POLAR_AXIS_SHAPE: () => s2, 19720 POLAR_AXIS_TYPE: () => i2 19721}); 19722var JF = /* @__PURE__ */ ((e) => (e[e.SMALL = 12] = "SMALL", e[e.MEDIUM = 13] = "MEDIUM", e[e.LARGE = 17] = "LARGE", e))(JF || {}), e2 = /* @__PURE__ */ ((e) => (e.TOP = "top", e.RIGHT = "right", e.BOTTOM = "bottom", e.LEFT = "left", e))(e2 || {}), t2 = /* @__PURE__ */ ((e) => (e.CATEGORY = "category", e.GROUPED_CATEGORY = "grouped-category", e.ORDINAL_TIME = "ordinal-time", e.NUMBER = "number", e.TIME = "time", e.LOG = "log", e))(t2 || {}), i2 = /* @__PURE__ */ ((e) => (e.ANGLE_CATEGORY = "angle-category", e.ANGLE_NUMBER = "angle-number", e.RADIUS_CATEGORY = "radius-category", e.RADIUS_NUMBER = "radius-number", e))(i2 || {}), s2 = /* @__PURE__ */ ((e) => (e.CIRCLE = "circle", e.POLYGON = "polygon", e))(s2 || {}), $x = {}; 19723Zo($x, { 19724 DEFAULT_ANNOTATION_BACKGROUND_FILL: () => Dn, 19725 DEFAULT_ANNOTATION_COLOR: () => An, 19726 DEFAULT_ANNOTATION_HANDLE_FILL: () => Ry, 19727 DEFAULT_ANNOTATION_STATISTICS_COLOR: () => ky, 19728 DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE: () => Py, 19729 DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL: () => i1, 19730 DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE: () => s1, 19731 DEFAULT_ANNOTATION_STATISTICS_FILL: () => Ty, 19732 DEFAULT_ANNOTATION_STATISTICS_STROKE: () => Ly, 19733 DEFAULT_AXIS_GRID_COLOUR: () => xl, 19734 DEFAULT_AXIS_LINE_COLOUR: () => lp, 19735 DEFAULT_BACKGROUND_COLOUR: () => Np, 19736 DEFAULT_CAPTION_ALIGNMENT: () => nl, 19737 DEFAULT_CAPTION_LAYOUT_STYLE: () => sl, 19738 DEFAULT_COLOURS: () => n2, 19739 DEFAULT_CROSS_LINES_COLOUR: () => sd, 19740 DEFAULT_DIVERGING_SERIES_COLOR_RANGE: () => Mn, 19741 DEFAULT_FIBONACCI_STROKES: () => t1, 19742 DEFAULT_FONT_FAMILY: () => Si, 19743 DEFAULT_FUNNEL_SERIES_COLOR_RANGE: () => Tr, 19744 DEFAULT_GAUGE_SERIES_COLOR_RANGE: () => Ao, 19745 DEFAULT_GRIDLINE_ENABLED: () => dr, 19746 DEFAULT_HIERARCHY_FILLS: () => Dy, 19747 DEFAULT_HIERARCHY_STROKES: () => Ey, 19748 DEFAULT_INSIDE_SERIES_LABEL_COLOUR: () => _l, 19749 DEFAULT_INVERTED_BACKGROUND_COLOUR: () => my, 19750 DEFAULT_INVERTED_LABEL_COLOUR: () => Zx, 19751 DEFAULT_LABEL_COLOUR: () => Zi, 19752 DEFAULT_MUTED_LABEL_COLOUR: () => fl, 19753 DEFAULT_NAVIGATOR_STROKE: () => vy, 19754 DEFAULT_PADDING: () => Zr, 19755 DEFAULT_POLAR_SERIES_STROKE: () => My, 19756 DEFAULT_SEPARATION_LINES_COLOUR: () => Cg, 19757 DEFAULT_SHADOW_COLOUR: () => Bl, 19758 DEFAULT_SPARKLINE_CROSSHAIR_STROKE: () => Ay, 19759 DEFAULT_TEXTBOX_COLOR: () => Ny, 19760 DEFAULT_TEXTBOX_FILL: () => Fy, 19761 DEFAULT_TEXTBOX_STROKE: () => Oy, 19762 DEFAULT_TEXT_ANNOTATION_COLOR: () => Iy, 19763 DEFAULT_TOOLBAR_POSITION: () => bg, 19764 IS_COMMUNITY: () => Yx, 19765 IS_DARK_THEME: () => id, 19766 IS_ENTERPRISE: () => Kx, 19767 PALETTE_ALT_DOWN_FILL: () => Jx, 19768 PALETTE_ALT_DOWN_STROKE: () => Qx, 19769 PALETTE_ALT_NEUTRAL_FILL: () => e1, 19770 PALETTE_ALT_NEUTRAL_STROKE: () => xy, 19771 PALETTE_ALT_UP_FILL: () => Xx, 19772 PALETTE_ALT_UP_STROKE: () => qx, 19773 PALETTE_DOWN_FILL: () => wy, 19774 PALETTE_DOWN_STROKE: () => Cy, 19775 PALETTE_NEUTRAL_FILL: () => Sy, 19776 PALETTE_NEUTRAL_STROKE: () => Qd, 19777 PALETTE_UP_FILL: () => by, 19778 PALETTE_UP_STROKE: () => yy 19779}); 19780var id = /* @__PURE__ */ Symbol("is-dark-theme"), Yx = /* @__PURE__ */ Symbol("is-community"), Kx = /* @__PURE__ */ Symbol("is-enterprise"), Si = /* @__PURE__ */ Symbol("default-font"), Zi = /* @__PURE__ */ Symbol("default-label-colour"), Zx = /* @__PURE__ */ Symbol("default-inverted-label-colour"), _l = /* @__PURE__ */ Symbol("default-inside-series-label-colour"), fl = /* @__PURE__ */ Symbol("default-muted-label-colour"), xl = /* @__PURE__ */ Symbol("default-axis-grid-colour"), lp = /* @__PURE__ */ Symbol("default-axis-line-colour"), sd = /* @__PURE__ */ Symbol("default-cross-lines-colour"), Cg = /* @__PURE__ */ Symbol("default-separation-lines-colour"), Np = /* @__PURE__ */ Symbol("default-background-colour"), my = /* @__PURE__ */ Symbol("default-inverted-background-colour"), Bl = /* @__PURE__ */ Symbol("default-shadow-colour"), n2 = /* @__PURE__ */ Symbol("default-colours"), Zr = /* @__PURE__ */ Symbol("default-padding"), sl = /* @__PURE__ */ Symbol("default-caption-layout-style"), nl = /* @__PURE__ */ Symbol("default-caption-alignment"), vy = /* @__PURE__ */ Symbol("default-navigator-stroke"), yy = /* @__PURE__ */ Symbol("palette-up-stroke"), Cy = /* @__PURE__ */ Symbol("palette-down-stroke"), by = /* @__PURE__ */ Symbol("palette-up-fill"), wy = /* @__PURE__ */ Symbol("palette-down-fill"), Qd = /* @__PURE__ */ Symbol("palette-neutral-stroke"), Sy = /* @__PURE__ */ Symbol("palette-neutral-fill"), qx = /* @__PURE__ */ Symbol("palette-alt-up-stroke"), Qx = /* @__PURE__ */ Symbol("palette-alt-down-stroke"), Xx = /* @__PURE__ */ Symbol("palette-alt-up-fill"), Jx = /* @__PURE__ */ Symbol("palette-alt-down-fill"), e1 = /* @__PURE__ */ Symbol("palette-gray-fill"), xy
19780= /* @__PURE__ */ Symbol("palette-gray-stroke"), My = /* @__PURE__ */ Symbol("default-polar-series-stroke"), Mn = /* @__PURE__ */ Symbol( 19781 "default-diverging-series-colour-range" 19782), Ay = /* @__PURE__ */ Symbol("default-sparkline-crosshair-stroke"), Ao = /* @__PURE__ */ Symbol("default-gauge-series-colour-range"), Tr = /* @__PURE__ */ Symbol("default-funnel-series-colour-range"), Dy = /* @__PURE__ */ Symbol("default-hierarchy-fills"), Ey = /* @__PURE__ */ Symbol("default-hierarchy-strokes"), An = /* @__PURE__ */ Symbol("default-annotation-stroke"), t1 = /* @__PURE__ */ Symbol("default-hierarchy-strokes"), Iy = /* @__PURE__ */ Symbol("default-text-annotation-color"), Dn = /* @__PURE__ */ Symbol("default-annotation-background-fill"), Ry = /* @__PURE__ */ Symbol("default-annotation-handle-fill"), Ty = /* @__PURE__ */ Symbol("default-annotation-statistics-fill"), Ly = /* @__PURE__ */ Symbol("default-annotation-statistics-stroke"), ky = /* @__PURE__ */ Symbol("default-annotation-statistics-color"), Py = /* @__PURE__ */ Symbol( 19783 "default-annotation-statistics-divider-stroke" 19784), i1 = /* @__PURE__ */ Symbol( 19785 "default-annotation-statistics-fill" 19786), s1 = /* @__PURE__ */ Symbol( 19787 "default-annotation-statistics-stroke" 19788), Fy = /* @__PURE__ */ Symbol("default-textbox-fill"), Oy = /* @__PURE__ */ Symbol("default-textbox-stroke"), Ny = /* @__PURE__ */ Symbol("default-textbox-color"), bg = /* @__PURE__ */ Symbol("default-toolbar-position"), dr = /* @__PURE__ */ Symbol("default-gridline-enabled"); 19789function o2(e, t) { 19790 return (i) => t(i) ? [ 19791 { ...e[0], position: e[1].position }, 19792 { ...e[1], position: e[0].position } 19793 ] : e; 19794} 19795function wg({ takeColors: e }) { 19796 const { 19797 fills: [t], 19798 strokes: [i] 19799 } = e(1); 19800 return { fill: t, stroke: i }; 19801} 19802function n1(e) { 19803 return { marker: wg(e) }; 19804} 19805function $m(e, t, i, s, n) { 19806 const { addPhaseFn: o, updatePhaseFn: r, removePhaseFn: a } = n, l = (c, u, d) => { 19807 i.animate({ 19808 id: `${e}_${t}_${u.id}_${c}`, 19809 groupId: e, 19810 from: 0, 19811 to: 1, 19812 ease: xp, 19813 collapsable: !1, 19814 onUpdate(p, f) { 19815 f && c !== "removed" || (u.path.clear(!0), d(p, u), u.checkPathDirty()); 19816 }, 19817 onStop() { 19818 c === "added" && (u.path.clear(!0), d(1, u), u.checkPathDirty()); 19819 }, 19820 phase: Zs[c] 19821 }); 19822 }; 19823 for (const c of s) 19824 i.isSkipped() || (l("removed", c, a), l("updated", c, r)), l("added", c, o); 19825} 19826function Et({ id: e }, t, i, ...s) { 19827 Mr( 19828 e, 19829 t, 19830 i, 19831 s, 19832 { opacity: 0 }, 19833 { opacity: 1 }, 19834 { phase: "trailing" } 19835 ); 19836} 19837function ol({ id: e }, t, i, ...s) { 19838 Mr( 19839 e, 19840 t, 19841 i, 19842 s, 19843 { opacity: 1 }, 19844 { opacity: 0 }, 19845 { phase: "remove" } 19846 ); 19847} 19848function Ra(e) { 19849 return { opacity: 1 }; 19850} 19851var o1 = class extends it { 19852 constructor() { 19853 super(...arguments), this._dirty = !0; 19854 } 19855 markDirty() { 19856 this._dirty = !0; 19857 } 19858 markClean(e) { 19859 this._dirty = !1; 19860 } 19861 isDirty() { 19862 return this._dirty; 19863 } 19864}, Xo = class extends o1 { 19865 constructor() { 19866 super(...arguments), this.enabled = !0, this.color = "rgba(0, 0, 0, 0.5)", this.xOffset = 0, this.yOffset = 0, this.blur = 5; 19867 } 19868}; 19869S([ 19870 D(je), 19871 Ge() 19872], Xo.prototype, "enabled", 2); 19873S([ 19874 D(Ft), 19875 Ge() 19876], Xo.prototype, "color", 2); 19877S([ 19878 D(At), 19879 Ge() 19880], Xo.prototype, "xOffset", 2); 19881S([ 19882 D(At), 19883 Ge() 19884], Xo.prototype, "yOffset", 2); 19885S([ 19886 D(Te), 19887 Ge() 19888], Xo.prototype, "blur", 2); 19889var r2 = jt( 19890 (e) => MF(e) || typeof e == "function", 19891 "a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class" 19892), En = class extends o1 { 19893 constructor() { 19894 super(...arguments), this.enabled = !0, this.shape = "circle", this.size = 6, this.fillOpacity = 1, this.strokeWidth = 1, this.strokeOpacity = 1; 19895 } 19896 getStyle() { 19897 const { size: e, shape: t, fill: i, fillOpacity: s, stroke: n, strokeWidth: o, strokeOpacity: r } = this; 19898 return { size: e, shape: t, fill: i, fillOpacity: s, stroke: n, strokeWidth: o, strokeOpacity: r }; 19899 } 19900 getDiameter() { 19901 return this.size + this.strokeWidth; 19902 } 19903}; 19904S([ 19905 D(je), 19906 Ge() 19907], En.prototype, "enabled", 2); 19908S([ 19909 D(r2), 19910 Ge() 19911], En.prototype, "shape", 2); 19912S([ 19913 D(Te), 19914 Ge() 19915], En.prototype, "size", 2); 19916S([ 19917 D(Ft, { optional: !0 }), 19918 Ge() 19919], En.prototype, "fill", 2); 19920S([ 19921 D(Pt), 19922 Ge() 19923], En.prototype, "fillOpacity", 2); 19924S([ 19925 D(Ft, { optional: !0 }), 19926 Ge() 19927], En.prototype, "stroke", 2); 19928S([ 19929 D(Te), 19930 Ge() 19931], En.prototype, "strokeWidth", 2); 19932S([ 19933 D(Pt), 19934 Ge() 19935], En.prototype, "strokeOpacity", 2); 19936S([ 19937 D(tn, { optional: !0 }), 19938 Ge() 19939], En.prototype, "itemStyler", 2); 19940var a2 = class extends it { 19941 constructor() { 19942 super(...arguments), this.enabled = !1; 19943 } 19944}; 19945S([ 19946 D(je) 19947], a2.prototype, "enabled", 2); 19948var Ls = class extends it { 19949 constructor() { 19950 super(...arguments), this.enabled = !0, this.interaction = new a2(), this.position = new Wd(), this.range = void 0, this.class = void 0; 19951 } 19952 formatTooltip(e, t) { 19953 const i = this.renderer?.(t); 19954 return typeof i == "string" ? i : i != null ? { ...e, ...i } : e; 19955 } 19956}; 19957S([ 19958 D(je) 19959], Ls.prototype, "enabled", 2); 19960S([ 19961 D(je, { optional: !0 }) 19962], Ls.prototype, "showArrow", 2); 19963S([ 19964 D(tn, { optional: !0 }) 19965], Ls.prototype, "renderer", 2); 19966S([ 19967 D(Be) 19968], Ls.prototype, "interaction", 2); 19969S([ 19970 D(Be) 19971], Ls.prototype, "position", 2); 19972S([ 19973 D(jv, { optional: !0 }) 19974], Ls.prototype, "range", 2); 19975S([ 19976 D(Me, { optional: !0 }) 19977], Ls.prototype, "class", 2); 19978var l2 = si(["linear", "smooth", "step"], "a line style"), c2 = si(["start", "middle", "end"]), Xd = class extends it { 19979 constructor() { 19980 super(...arguments), this.type = "linear", this.tension = 1, this.position = "end"; 19981 } 19982}; 19983S([ 19984 D(l2) 19985], Xd.prototype, "type", 2); 19986S([ 19987 D(Pt) 19988], Xd.prototype, "tension", 2); 19989S([ 19990 D(c2) 19991], Xd.prototype, "position", 2); 19992var Hi = class extends Da { 19993 constructor() { 19994 super(...arguments), this.xName = void 0, this.fill = "#c16068", this.fillOpacity = 1, this.stroke = "#874349", this.strokeWidth = 2, this.strokeOpacity = 1, this.lineDash = [0], this.lineDashOffset = 0, this.interpolation = new Xd(), this.shadow = new Xo(), this.marker = new En(), this.label = new ts(), this.tooltip = new Ls(), this.connectMissingData = !1; 19995 } 19996}; 19997S([ 19998 D(Me) 19999], Hi.prototype, "xKey", 2); 20000S([ 20001 D(Me, { optional: !0 }) 20002], Hi.prototype, "xName", 2); 20003S([ 20004 D(Me) 20005], Hi.prototype, "yKey", 2); 20006S([ 20007 D(Me, { optional: !0 }) 20008], Hi.prototype, "yName", 2); 20009S([ 20010 D(Me, { optional: !0 }) 20011], Hi.prototype, "yFilterKey", 2); 20012S([ 20013 D(Te, { optional: !0 }) 20014], Hi.prototype, "normalizedTo", 2); 20015S([ 20016 D(Ft) 20017], Hi.prototype, "fill", 2); 20018S([ 20019 D(Pt) 20020], Hi.prototype, "fillOpacity", 2); 20021S([ 20022 D(Ft) 20023], Hi.prototype, "stroke", 2); 20024S([ 20025 D(Te) 20026], Hi.prototype, "strokeWidth", 2); 20027S([ 20028 D(Pt) 20029], Hi.prototype, "strokeOpacity", 2); 20030S([ 20031 D(ya) 20032], Hi.prototype, "lineDash", 2); 20033S([ 20034 D(Te) 20035], Hi.prototype, "lineDashOffset", 2); 20036S([ 20037 D(Be) 20038], Hi.prototype, "interpolation", 2); 20039S([ 20040 D(Be) 20041], Hi.prototype, "shadow", 2); 20042S([ 20043 D(Be) 20044], Hi.prototype, "marker", 2); 20045S([ 20046 D(Be) 20047], Hi.prototype, "label", 2); 20048S([ 20049 D(Be) 20050], Hi.prototype, "tooltip", 2); 20051S([ 20052 D(je) 20053], Hi.prototype, "connectMissingData", 2); 20054function xr(e) { 20055 switch (e.type) { 20056 case "linear": 20057 case "step": 20058 return [ 20059 { x: e.x0, y: e.y0 }, 20060 { x: e.x1, y: e.y1 } 20061 ]; 20062 case "cubic": 20063 return [ 20064 { x: e.cp0x, y: e.cp0y },
20065 { x: e.cp3x, y: e.cp3y } 20066 ]; 20067 } 20068} 20069function qY(e) { 20070 const t = xr(e); 20071 return t[0].x > t[1].x && t.reverse(), t; 20072} 20073function QY(e, t) { 20074 const { x: i, y: s } = t; 20075 switch (e.type) { 20076 case "linear": 20077 return { 20078 type: "linear", 20079 moveTo: e.moveTo, 20080 x0: i, 20081 y0: s, 20082 x1: i, 20083 y1: s 20084 }; 20085 case "step": 20086 return { 20087 type: "step", 20088 moveTo: e.moveTo, 20089 x0: i, 20090 y0: s, 20091 x1: i, 20092 y1: s, 20093 stepX: i 20094 }; 20095 case "cubic": 20096 return { 20097 type: "cubic", 20098 moveTo: e.moveTo, 20099 cp0x: i, 20100 cp0y: s, 20101 cp1x: i, 20102 cp1y: s, 20103 cp2x: i, 20104 cp2y: s, 20105 cp3x: i, 20106 cp3y: s 20107 }; 20108 } 20109} 20110function _p(e, t, i) { 20111 const [s, n] = xr(e), o = n.x !== s.x ? (i.x - t.x) / (n.x - s.x) : 0, r = n.y !== s.y ? (i.y - t.y) / (n.y - s.y) : 0; 20112 switch (e.type) { 20113 case "linear": 20114 return { 20115 type: "linear", 20116 moveTo: e.moveTo, 20117 x0: t.x, 20118 y0: t.y, 20119 x1: i.x, 20120 y1: i.y 20121 }; 20122 case "cubic": 20123 return { 20124 type: "cubic", 20125 moveTo: e.moveTo, 20126 cp0x: t.x, 20127 cp0y: t.y, 20128 cp1x: i.x - (e.cp2x - s.x) * o, 20129 cp1y: i.y - (e.cp2y - s.y) * r, 20130 cp2x: i.x - (e.cp1x - s.x) * o, 20131 cp2y: i.y - (e.cp1y - s.y) * r, 20132 cp3x: i.x, 20133 cp3y: i.y 20134 }; 20135 case "step": 20136 return { 20137 type: "step", 20138 moveTo: e.moveTo, 20139 x0: t.x, 20140 y0: t.y, 20141 x1: i.x, 20142 y1: i.y, 20143 stepX: i.x - (e.stepX - s.x) * o 20144 }; 20145 } 20146} 20147function u2(e, t, i) { 20148 const { moveTo: s } = e, [n, o] = qY(e), { x: r, y: a } = n, { x: l, y: c } = o; 20149 if (i < r) 20150 return _p(e, n, n); 20151 if (t > l) 20152 return _p(e, o, o); 20153 switch (e.type) { 20154 case "linear": { 20155 const u = a === c ? void 0 : (c - a) / (l - r), d = u == null ? a : u * (t - r) + a, p = u == null ? a : u * (i - r) + a; 20156 return { type: "linear", moveTo: s, x0: t, y0: d, x1: i, y1: p }; 20157 } 20158 case "step": 20159 if (i <= e.stepX) { 20160 const u = e.y0; 20161 return { type: "step", moveTo: s, x0: t, y0: u, x1: i, y1: u, stepX: i }; 20162 } else if (t >= e.stepX) { 20163 const u = e.y1; 20164 return { type: "step", moveTo: s, x0: t, y0: u, x1: i, y1: u, stepX: t }; 20165 } else { 20166 const { y0: u, y1: d, stepX: p } = e; 20167 return { type: "step", moveTo: s, x0: t, y0: u, x1: i, y1: d, stepX: p }; 20168 } 20169 case "cubic": { 20170 const u = Hm(e.cp0x, e.cp1x, e.cp2x, e.cp3x, t); 20171 let [d, p] = Vm( 20172 e.cp0x, 20173 e.cp0y, 20174 e.cp1x, 20175 e.cp1y, 20176 e.cp2x, 20177 e.cp2y, 20178 e.cp3x, 20179 e.cp3y, 20180 u 20181 ); 20182 const f = Hm(p[0].x, p[1].x, p[2].x, p[3].x, i); 20183 return [p, d] = Vm( 20184 p[0].x, 20185 p[0].y, 20186 p[1].x, 20187 p[1].y, 20188 p[2].x, 20189 p[2].y, 20190 p[3].x, 20191 p[3].y, 20192 f 20193 ), { 20194 type: "cubic", 20195 moveTo: s, 20196 cp0x: p[0].x, 20197 cp0y: p[0].y, 20198 cp1x: p[1].x, 20199 cp1y: p[1].y, 20200 cp2x: p[2].x, 20201 cp2y: p[2].y, 20202 cp3x: p[3].x, 20203 cp3y: p[3].y 20204 }; 20205 } 20206 } 20207} 20208function XY(e) { 20209 const t = []; 20210 let i = 0, s = NaN, n = NaN; 20211 for (const { x: o, y: r } of e) { 20212 if (i > 0) { 20213 const a = i === 1; 20214 t.push({ type: "linear", moveTo: a, x0: s, y0: n, x1: o, y1: r }); 20215 } 20216 i += 1, s = o, n = r; 20217 } 20218 return t; 20219} 20220var JY = { 20221 start: 0, 20222 middle: 0.5, 20223 end: 1 20224}; 20225function eK(e, t) { 20226 const i = []; 20227 let s = 0, n = NaN, o = NaN; 20228 const r = typeof t == "number" ? t : JY[t]; 20229 for (const { x: a, y: l } of e) { 20230 if (s > 0) { 20231 const c = s === 1, u = n + (a - n) * r; 20232 i.push({ type: "step", moveTo: c, x0: n, y0: o, x1: a, y1: l, stepX: u }); 20233 } 20234 s += 1, n = a, o = l; 20235 } 20236 return i; 20237} 20238var Lf = 0.05; 20239function tK(e, t) { 20240 const i = Array.isArray(e) ? e : Array.from(e); 20241 if (i.length <= 1) 20242 return []; 20243 const s = i.map((o, r) => { 20244 const a = r === 0 ? o : i[r - 1], l = r === i.length - 1 ? o : i[r + 1], c = r === 0 || r === i.length - 1; 20245 if (Math.sign(a.y - o.y) === Math.sign(l.y - o.y)) 20246 return 0; 20247 if (!c) { 20248 const u = Math.abs(a.y - l.y), d = Math.abs(o.y - a.y) / u, p = Math.abs(o.y - l.y) / u; 20249 if (d <= Lf || 1 - d <= Lf || p <= Lf || 1 - p <= Lf) 20250 return 0; 20251 } 20252 return (l.y - a.y) / (l.x - a.x); 20253 }); 20254 s[1] === 0 && (s[0] *= 2), s[s.length - 2] === 0 && (s[s.length - 1] *= 2); 20255 const n = []; 20256 for (let o = 1; o < i.length; o += 1) { 20257 const r = i[o - 1], a = s[o - 1], l = i[o], c = s[o], u = l.x - r.x, d = l.y - r.y; 20258 let p = u * t / 3, f = u * a * t / 3, m = u * t / 3, y = u * c * t / 3; 20259 c === 0 && Math.abs(f) > Math.abs(d) && (p *= Math.abs(d / f), f = Math.sign(f) * Math.abs(d)), a === 0 && Math.abs(y) > Math.abs(d) && (m *= Math.abs(d / y), y = Math.sign(y) * Math.abs(d)), n.push({ 20260 type: "cubic",
20261 moveTo: o === 1, 20262 cp0x: r.x, 20263 cp0y: r.y, 20264 cp1x: r.x + p, 20265 cp1y: r.y + f, 20266 cp2x: l.x - m, 20267 cp2y: l.y - y, 20268 cp3x: l.x, 20269 cp3y: l.y 20270 }); 20271 } 20272 return n; 20273} 20274function Gi(e, t, i) { 20275 return (t - e) * i + e; 20276} 20277function iK(e, t) { 20278 const { x0: i, y0: s, x1: n, y1: o } = e, a = (o - s) / (n - i) * (t - i) + s; 20279 return { 20280 leftCp1x: i, 20281 leftCp1y: s, 20282 leftCp2x: t, 20283 leftCp2y: a, 20284 stepX: t, 20285 stepY0: a, 20286 stepY1: a, 20287 rightCp1x: t, 20288 rightCp1y: a, 20289 rightCp2x: n, 20290 rightCp2y: o 20291 }; 20292} 20293function sK(e, t) { 20294 const { cp0x: i, cp0y: s, cp1x: n, cp1y: o, cp2x: r, cp2y: a, cp3x: l, cp3y: c } = e, u = Hm(i, n, r, l, t), [d, p] = Vm(i, s, n, o, r, a, l, c, u), f = d[3].y; 20295 return { 20296 leftCp1x: d[1].x, 20297 leftCp1y: d[1].y, 20298 leftCp2x: d[2].x, 20299 leftCp2y: d[2].y, 20300 stepX: t, 20301 stepY0: f, 20302 stepY1: f, 20303 rightCp1x: p[1].x, 20304 rightCp1y: p[1].y, 20305 rightCp2x: p[2].x, 20306 rightCp2y: p[2].y 20307 }; 20308} 20309function nK(e) { 20310 const { x0: t, y0: i, x1: s, y1: n, stepX: o } = e; 20311 return { 20312 leftCp1x: (t + o) / 2, 20313 leftCp1y: i, 20314 leftCp2x: (t + o) / 2, 20315 leftCp2y: i, 20316 stepX: o, 20317 stepY0: i, 20318 stepY1: n, 20319 rightCp1x: (o + s) / 2, 20320 rightCp1y: n, 20321 rightCp2x: (o + s) / 2, 20322 rightCp2y: n 20323 }; 20324} 20325function oR(e, t) { 20326 return e.type === "linear" ? iK(e, t) : e.type === "cubic" ? sK(e, t) : nK(e); 20327} 20328function d2(e, t, i, s, n, o, r) { 20329 switch (t) { 20330 case 0: 20331 r ? e.moveTo(n, o) : e.moveTo(i, s); 20332 break; 20333 case 1: 20334 r ? e.lineTo(n, o) : e.lineTo(i, s); 20335 break; 20336 } 20337} 20338function h2(e, t, i, s, n, o) { 20339 o ? e.lineTo(t, i) : e.lineTo(s, n); 20340} 20341function p2(e, t, i, s, n, o, r, a, l, c) { 20342 c ? e.cubicCurveTo(o, r, s, n, t, i) : e.cubicCurveTo(s, n, o, r, a, l); 20343} 20344function g2(e, t, i, s, n, o, r) { 20345 r ? (e.lineTo(o, n), e.lineTo(o, i), e.lineTo(t, i)) : (e.lineTo(o, i), e.lineTo(o, n), e.lineTo(s, n)); 20346} 20347function Ew(e, t, i, s) { 20348 const [n, o] = xr(t); 20349 switch (d2(e, i, n.x, n.y, o.x, o.y, s), t.type) { 20350 case "linear": 20351 h2(e, t.x0, t.y0, t.x1, t.y1, s); 20352 break; 20353 case "cubic": 20354 p2( 20355 e, 20356 t.cp0x, 20357 t.cp0y, 20358 t.cp1x, 20359 t.cp1y, 20360 t.cp2x, 20361 t.cp2y, 20362 t.cp3x, 20363 t.cp3y, 20364 s 20365 ); 20366 break; 20367 case "step": 20368 g2(e, t.x0, t.y0, t.x1, t.y1, t.stepX, s); 20369 break; 20370 } 20371} 20372function f2(e, t, i) { 20373 const [s, n] = xr(e), [o, r] = xr(t), a = Gi(s.x, o.x, i), l = Gi(s.y, o.y, i), c = Gi(n.x, r.x, i), u = Gi(n.y, r.y, i); 20374 return [ 20375 { x: a, y: l }, 20376 { x: c, y: u } 20377 ]; 20378} 20379function Iw(e, t, i, s, n, o) { 20380 const [{ x: r, y: a }, { x: l, y: c }] = f2(t, i, s); 20381 if (d2(e, n, r, a, l, c, o), t.type === "cubic" && i.type === "cubic") { 20382 const u = Gi(t.cp1x, i.cp1x, s), d = Gi(t.cp1y, i.cp1y, s), p = Gi(t.cp2x, i.cp2x, s), f = Gi(t.cp2y, i.cp2y, s); 20383 p2(e, r, a, u, d, p, f, l, c, o); 20384 } else if (t.type === "step" && i.type === "step") { 20385 const u = Gi(t.stepX, i.stepX, s); 20386 g2(e, r, a, l, c, u, o); 20387 } else if (t.type === "linear" && i.type === "linear") 20388 h2(e, r, a, l, c, o); 20389 else { 20390 let u; 20391 t.type === "step" ? u = t.stepX : i.type === "step" ? u = i.stepX : u = (r + l) / 2; 20392 const d = oR(t, u), p = oR(i, u), f = Gi(d.leftCp1x, p.leftCp1x, s), m = Gi(d.leftCp1y, p.leftCp1y, s), y = Gi(d.leftCp2x, p.leftCp2x, s), b = Gi(d.leftCp2y, p.leftCp2y, s), C = Gi(d.stepX, p.stepX, s), w = Gi(d.stepY0, p.stepY0, s), M = Gi(d.stepY1, p.stepY1, s), A = Gi(d.rightCp1x, p.rightCp1x, s), I = Gi(d.rightCp1y, p.rightCp1y, s), L = Gi(d.rightCp2x, p.rightCp2x, s), k = Gi(d.rightCp2y, p.rightCp2y, s); 20393 o ? (e.cubicCurveTo(L, k, A, I, C, M), e.lineTo(C, w), e.cubicCurveTo(y, b, f, m, r, a)) : (e.cubicCurveTo(f, m, y, b, C, w), e.lineTo(C, M), e.cubicCurveTo(A, I, L, k, l, c)); 20394 } 20395} 20396var m2 = /* @__PURE__ */ ((e) => (e[e.Zero = 0] = "Zero", e[e.Split = 1] = "Split", e))(m2 || {}); 20397function oK(e, t) { 20398 return e == null || t == null || typeof e != "object" || typeof t != "object" ? !1 : "id" in e && "id" in t ? e.id === t.id : e.toString() === t.toString(); 20399} 20400function Cs(e, t) { 20401 if (!t) 20402 return NaN; 20403 if (e instanceof Date && (e = e.getTime()), t.type === "continuous" && typeof e == "number") 20404 return (e - t.domain[0]) / (t.domain[1] - t.domain[0]) * (t.range[1] - t.range[0]) + t.range[0]; 20405 if (t.type === "log" && typeof e == "number") 20406 return t.convert(e); 20407 if (t.type !== "category") 20408 return NaN; 20409 const i = t.domain.findIndex((n) => n === e); 20410 return i >= 0 || t.domain.findIndex((n) => oK(e, n)) >= 0 ? t.inset + t.step * i : NaN; 20411} 20412function ho(e) { 20413 return fw(e).valueOf(); 20414} 20415function rR({ data: e }, t) { 20416 return e.map((i, s) => ({ 20417 xValue0Index: t.indexOf(ho(i.xValue0)), 20418 xValue1Index: t.indexOf(ho(i.xValue1)), 20419 datumIndex: s 20420 })); 20421} 20422function rK(e, t) { 20423 const i = t.scales.x, s = e.scales.x; 20424 if (i?.type !== "category" || s?.type !== "category") 20425 return !0; 20426 let n = -1 / 0; 20427 for (const o of i.domain) { 20428 const r = Cs(o, s); 20429 if (Number.isFinite(r)) { 20430 if (r < n) 20431 return !1; 20432 n = r; 20433 } else continue; 20434 } 20435 return !0; 20436} 20437function aK(e, t) { 20438 let i = -1 / 0; 20439 for (const s of e) { 20440 const n = Cs(s.value, t.scales.x); 20441 if (Number.isFinite(n)) { 20442 if (n < i) 20443 return !1; 20444 i = n; 20445 } else continue; 20446 } 20447 return !0; 20448} 20449function lK(e, t) { 20450 const i = /* @__PURE__ */ new Map(); 20451 for (const { xValue0: u, xValue1: d } of e.data) { 20452 const p = ho(u), f = ho(d); 20453 i.set(p, u).set(f, d); 20454 } 20455 const s = Array.from(i, ([u, d]) => ({ axisValue: u, value: d })); 20456 s.sort((u, d) => Cs(u.value, e.scales.x) - Cs(d.value, e.scales.x)); 20457 const n = []; 20458 for (const { xValue0: u, xValue1: d } of t.data) { 20459 const p = ho(u), f = ho(d);
20460 i.has(p) || (i.set(p, u), n.push({ axisValue: p, value: u })), i.has(f) || (i.set(f, d), n.push({ axisValue: f, value: d })); 20461 } 20462 n.sort((u, d) => Cs(u.value, t.scales.x) - Cs(d.value, t.scales.x)); 20463 const o = s; 20464 let r = 0; 20465 for (const u of n) { 20466 for (let d = o.length - 1; d > r; d -= 1) { 20467 const p = Cs(u.value, t.scales.x), f = Cs(o[d].value, t.scales.x); 20468 if (p > f) { 20469 r = d + 1; 20470 break; 20471 } 20472 } 20473 o.splice(r, 0, u), r += 1; 20474 } 20475 if (!aK(o, t)) 20476 return; 20477 const a = o.map((u) => u.axisValue), l = rR(t, a), c = rR(e, a); 20478 return { axisValues: a, oldDataAxisIndices: l, newDataAxisIndices: c }; 20479} 20480function aR(e, t, i) { 20481 if (i.xValue1Index === i.xValue0Index + 1) 20482 return e; 20483 const s = xr(e), n = (s[1].x - s[0].x) / (i.xValue1Index - i.xValue0Index), o = s[0].x + (t - i.xValue0Index) * n, r = o + n; 20484 return u2(e, o, r); 20485} 20486function v2(e, t) { 20487 const [i, s] = xr(e), n = Cs(0, t.scales.y); 20488 return _p(e, { x: i.x, y: n }, { x: s.x, y: n }); 20489} 20490function y2(e) { 20491 const [t, i] = xr(e); 20492 return QY(e, { 20493 x: (t.x + i.x) / 2, 20494 y: (t.y + i.y) / 2 20495 }); 20496} 20497function C2(e, t, i, s, n, o) { 20498 let r, a; 20499 if (n.xValue0Index >= o.xValue1Index) { 20500 const d = s.findLast((f) => f.xValue1Index <= o.xValue1Index)?.datumIndex, p = d != null ? i.data[d] : void 0; 20501 r = p?.xValue1, a = p?.yValue1; 20502 } else if (n.xValue0Index <= o.xValue0Index) { 20503 const d = s.find((f) => f.xValue0Index >= o.xValue0Index)?.datumIndex, p = d != null ? i.data[d] : void 0; 20504 r = p?.xValue0, a = p?.yValue0; 20505 } 20506 if (r == null || a == null) 20507 switch (t) { 20508 case 0: 20509 return v2(e, i); 20510 case 1: 20511 return y2(e); 20512 } 20513 const l = Cs(r, i.scales.x), c = Cs(a, i.scales.y), u = { x: l, y: c }; 20514 return _p(e, u, u); 20515} 20516function r1(e, t) { 20517 if (t == null) 20518 return; 20519 const i = ho(e.xValue0), s = ho(e.xValue1); 20520 return t.find( 20521 (n) => ho(n.xValue0) === i && ho(n.xValue1) === s 20522 )?.span; 20523} 20524function lR(e, t, i, s, n, o, r) { 20525 const a = e.data[s.datumIndex], l = a.span, c = r1(a, n); 20526 if (c != null) 20527 r.removed.push({ from: c, to: c }), r.moved.push({ from: c, to: l }), r.added.push({ from: l, to: l }); 20528 else { 20529 const u = C2(l, t, e, i, s, o); 20530 r.added.push({ from: u, to: l }); 20531 } 20532} 20533function cR(e, t, i, s, n, o, r) { 20534 const a = e.data[s.datumIndex], l = a.span, c = r1(a, n); 20535 if (c != null) 20536 r.removed.push({ from: l, to: l }), r.moved.push({ from: l, to: c }), r.added.push({ from: c, to: c }); 20537 else { 20538 const u = C2(l, t, e, i, s, o); 20539 r.removed.push({ from: l, to: u }); 20540 } 20541} 20542function uR(e, t, i, s, n) { 20543 const o = t[n.xValue0Index], r = i.data.find((b) => ho(b.xValue0) === o), a = t[n.xValue1Index], l = i.data.find((b) => ho(b.xValue1) === a); 20544 if (r == null || l == null) 20545 return; 20546 const [{ x: c }, { x: u }] = xr(e), d = Cs(r.xValue0, i.scales.x), p = Cs(r.yValue0, i.scales.y), f = Cs(l.xValue1, i.scales.x), m = Cs(l.yValue1, i.scales.y); 20547 let y = s.data[n.datumIndex].span; 20548 return y = _p(y, { x: d, y: p }, { x: f, y: m }), y = u2(y, c, u), y; 20549} 20550function cK(e, t, i, s, n, o, r, a, l) { 20551 const c = n + 1, u = r.find((M) => M.xValue0Index <= n && M.xValue1Index >= c), d = o.find((M) => M.xValue0Index <= n && M.xValue1Index >= c), p = t.zeroData, f = e.zeroData; 20552 if (u == null && d != null) { 20553 lR(e, i, o, d, p, a, l); 20554 return; 20555 } else if (u != null && d == null) { 20556 cR(t, i, r, u, f, a, l); 20557 return; 20558 } else if (u == null || d == null) 20559 return; 20560 let m; 20561 u.xValue0Index === d.xValue0Index && u.xValue1Index === d.xValue1Index ? m = 0 : u.xValue0Index <= d.xValue0Index && u.xValue1Index >= d.xValue1Index ? m = -1 : u.xValue0Index >= d.xValue0Index && u.xValue1Index <= d.xValue1Index ? m = 1 : m = 0; 20562 const y = t.data[u.datumIndex], b = aR(y.span, n, u), C = e.data[d.datumIndex], w = aR(C.span, n, d); 20563 if (m === 1) { 20564 const M = uR( 20565 b, 20566 s, 20567 t, 20568 e, 20569 d 20570 ); 20571 M != null ? (l.removed.push({ from: b, to: M }), l.moved.push({ from: M, to: w }), l.added.push({ from: w, to: w })) : cR(t, i, r, u, f, a, l); 20572 } else if (m === -1) { 20573 const M = uR( 20574 w, 20575 s, 20576 e, 20577 t, 20578 u 20579 ); 20580 M != null ? (l.removed.push({ from: b, to: b }), l.moved.push({ from: b, to: M }), l.added.push({ from: M, to: w })) : lR(e, i, o, d, p, a, l); 20581 } else 20582 l.removed.push({ from: b, to: b }), l.moved.push({ from: b, to: w }), l.added.push({ from: w, to: w }); 20583} 20584function uK(e, t, i, s) { 20585 const n = { 20586 removed: [], 20587 moved: [], 20588 added: [] 20589 }, { axisValues: o, oldDataAxisIndices: r, newDataAxisIndices: a } = e, l = { 20590 xValue0Index: Math.max( 20591 r.at(0)?.xValue0Index ?? -1 / 0, 20592 a.at(0)?.xValue0Index ?? -1 / 0 20593 ), 20594 xValue1Index: Math.min( 20595 r.at(-1)?.xValue1Index ?? 1 / 0, 20596 a.at(-1)?.xValue1Index ?? 1 / 0 20597 ) 20598 }; 20599 for (let c = 0; c < o.length - 1; c += 1) 20600 cK( 20601 t, 20602 i, 20603 s, 20604 o, 20605 c, 20606 a, 20607 r, 20608 l, 20609 n 20610 ); 20611 return n; 20612} 20613function dR(e, t, i) { 20614 const { span: s } = t; 20615 switch (i) { 20616 case 0: 20617 return r1(t, e.zeroData) ?? v2(s, e); 20618 case 1: 20619 return y2(s); 20620 } 20621} 20622function dK(e, t, i) { 20623 const s = [], n = []; 20624 for (const o of t.data) { 20625 const r = o.span, a = dR(t, o, i); 20626 n.push({ from: r, to: a }); 20627 } 20628 for (const o of e.data) { 20629 const r = o.span, a = dR(e, o, i); 20630 s.push({ from: a, to: r }); 20631 } 20632 return { 20633 removed: n, 20634 moved: [], 20635 added: s 20636 }; 20637} 20638function cp(e, t, i) { 20639 if (!rK(e, t)) 20640 return; 20641 const s = lK(e, t); 20642 return s == null ? dK(e, t, i) : uK(s, e, t, i); 20643} 20644function hR(e) { 20645 return e.type === "continuous" || e.type === "log"; 20646} 20647function pR(e) { 20648 return e.type === "category"; 20649}
20650function nd(e, t) { 20651 return e === void 0 || t === void 0 ? e !== void 0 || t !== void 0 : hR(e) && hR(t) ? e.type === t.type && ul(e.domain, t.domain) && ul(e.range, t.range) : pR(e) && pR(t) ? e.inset === t.inset && e.step === t.step && ul(e.domain, t.domain) : !1; 20652} 20653function Bp(e) { 20654 return e == null ? !1 : e.type === "category" ? e.domain.every((t) => t != null) : e.domain.every((t) => Number.isFinite(t) || t instanceof Date) && e.range.every((t) => Number.isFinite(t)); 20655} 20656function Ym(e, t) { 20657 let i; 20658 const s = e.map((n) => n.point); 20659 switch (t.type) { 20660 case "linear": 20661 i = XY(s); 20662 break; 20663 case "smooth": 20664 i = tK(s, t.tension); 20665 break; 20666 case "step": 20667 i = eK(s, t.position); 20668 break; 20669 } 20670 return i.map((n, o) => ({ 20671 span: n, 20672 xValue0: e[o].xDatum, 20673 yValue0: e[o].yDatum, 20674 xValue1: e[o + 1].xDatum, 20675 yValue1: e[o + 1].yDatum 20676 })); 20677} 20678function b2(e, t, i = 1e-3) { 20679 return Math.abs(e.x - t.x) < i && Math.abs(e.y - t.y) < i; 20680} 20681function a1({ path: e }, t) { 20682 let i; 20683 for (const { span: s } of t) { 20684 const [n, o] = xr(s), r = i != null && b2(i, n) ? 1 : 0; 20685 Ew(e, s, r, !1), i = o; 20686 } 20687} 20688function pm(e, t, i) { 20689 let s; 20690 for (const n of i) { 20691 const [o, r] = f2(n.from, n.to, e), a = s != null && b2(s, o) ? 1 : 0; 20692 Iw(t.path, n.from, n.to, e, a, !1), s = r; 20693 } 20694} 20695function l1(e, t, i) { 20696 const s = (a, l) => pm(a, l, t.removed), n = (a, l) => pm(a, l, t.moved), o = (a, l) => pm(a, l, t.added), r = c1(e, i); 20697 return { status: e, path: { addPhaseFn: o, updatePhaseFn: n, removePhaseFn: s }, pathProperties: r }; 20698} 20699function c1(e, t) { 20700 const i = t === "none" ? "updated" : e, s = { 20701 fromFn: (n) => { 20702 let o; 20703 return e === "removed" ? o = { finish: { visible: !1 } } : e === "added" ? o = { start: { visible: !0 } } : o = {}, { phase: Zs[i], ...o }; 20704 }, 20705 toFn: (n) => ({ phase: Zs[i] }) 20706 }; 20707 return t === "fade" ? { 20708 fromFn: (n) => ({ opacity: e === "added" ? 0 : n.opacity, ...s.fromFn(n) }), 20709 toFn: (n) => ({ opacity: e === "removed" ? 0 : 1, ...s.toFn(n) }) 20710 } : s; 20711} 20712function w2(e, t, i) { 20713 const s = e.scales.x?.type === "category", n = t.scales.x?.type === "category"; 20714 if (s !== n || !Bp(e.scales.x) || !Bp(t.scales.x) || e.strokeData == null || t.strokeData == null) 20715 return; 20716 let o = "updated"; 20717 t.visible && !e.visible ? o = "removed" : !t.visible && e.visible && (o = "added"); 20718 const r = cp( 20719 { scales: e.scales, data: e.strokeData.spans }, 20720 { scales: t.scales, data: t.strokeData.spans }, 20721 1 20722 /* Split */ 20723 ); 20724 if (r == null) 20725 return; 20726 const a = l1(o, r, "fade"), l = (i?.changed ?? !0) || !nd(e.scales.x, t.scales.x) || !nd(e.scales.y, t.scales.y) || o !== "updated"; 20727 return { status: o, stroke: a, hasMotion: l }; 20728} 20729function S2({ path: e }, { spans: t, phantomSpans: i }) { 20730 for (let s = 0; s < t.length; s += 1) { 20731 const { span: n } = t[s], o = i[s].span; 20732 Ew(e, n, 0, !1), Ew(e, o, 1, !0), e.closePath(); 20733 } 20734} 20735function gm(e, { path: t }, i, s) { 20736 for (let n = 0; n < i.length; n += 1) { 20737 const o = i[n], r = s[n]; 20738 Iw(t, o.from, o.to, e, 0, !1), Iw(t, r.from, r.to, e, 1, !0), t.closePath(); 20739 } 20740} 20741function x2(e, t, i, s) { 20742 const n = (l, c) => gm(l, c, t.removed, i.removed), o = (l, c) => gm(l, c, t.moved, i.moved), r = (l, c) => gm(l, c, t.added, i.added), a = c1(e, s); 20743 return { status: e, path: { addPhaseFn: r, updatePhaseFn: o, removePhaseFn: n }, pathProperties: a }; 20744} 20745function M2(e, t) { 20746 const i = e.scales.x?.type === "category", s = t.scales.x?.type === "category"; 20747 if (i !== s || !Bp(e.scales.x) || !Bp(t.scales.x)) 20748 return; 20749 let n = "updated"; 20750 t.visible && !e.visible ? n = "removed" : !t.visible && e.visible && (n = "added"); 20751 const o = cp( 20752 { scales: e.scales, data: e.fillData.spans }, 20753 { scales: t.scales, data: t.fillData.spans }, 20754 0 20755 /* Zero */ 20756 ); 20757 if (o == null) 20758 return; 20759 const r = cp( 20760 { scales: e.scales, data: e.fillData.phantomSpans }, 20761 { scales: t.scales, data: t.fillData.phantomSpans }, 20762 0 20763 /* Zero */ 20764 ); 20765 if (r == null) 20766 return; 20767 const a = cp( 20768 { 20769 scales: e.scales, 20770 data: e.strokeData.spans, 20771 zeroData: e.fillData.phantomSpans 20772 }, 20773 { 20774 scales: t.scales, 20775 data: t.strokeData.spans, 20776 zeroData: t.fillData.phantomSpans 20777 }, 20778 0 20779 /* Zero */ 20780 ); 20781 if (a == null) 20782 return; 20783 const l = "none", c = x2(n, o, r, l), u = l1(n, a, l); 20784 return { status: n, fill: c, stroke: u }; 20785} 20786function Gp({ id: e }, t, i, ...s) {
20787 const n = { phase: i ? Zs[i] : "trailing" }; 20788 Mr(e, "markers", t, s, { opacity: 0 }, { opacity: 1 }, n), s.forEach((o) => o.cleanup()); 20789} 20790function u1({ id: e }, t, ...i) { 20791 Mr( 20792 e, 20793 "markers", 20794 t, 20795 i, 20796 { scalingX: 0, scalingY: 0 }, 20797 { scalingX: 1, scalingY: 1 }, 20798 { phase: "initial" } 20799 ), i.forEach((s) => s.cleanup()); 20800} 20801function d1({ id: e, nodeDataDependencies: t }, i, ...s) { 20802 const n = t.seriesRectWidth; 20803 Mi(e, "markers", i, s, { fromFn: (a, l) => { 20804 const c = l.midPoint?.x ?? n; 20805 let u = ot(0, sk(c / n), 1); 20806 return isNaN(u) && (u = 0), { scalingX: 0, scalingY: 0, delay: u, duration: Lm, phase: "initial" }; 20807 }, toFn: () => ({ scalingX: 1, scalingY: 1 }) }); 20808} 20809function Sg(e) { 20810 return { opacity: 1, scalingX: 1, scalingY: 1 }; 20811} 20812function zp(e, t) { 20813 return { 20814 translationX: t.point?.x ?? NaN, 20815 translationY: t.point?.y ?? NaN 20816 }; 20817} 20818function hK(e, t) { 20819 const i = (r, a) => { 20820 const l = e[a][r]; 20821 return Array.isArray(l) ? l[0] : l; 20822 }, s = (r) => { 20823 const { xValue: a } = r; 20824 return e.moved[a] ? { point: i(a, "moved"), status: "updated" } : e.removed[a] ? { point: i(a, "removed"), status: "removed" } : e.added[a] ? { point: i(a, "added"), status: "added" } : { status: "unknown" }; 20825 }; 20826 return { fromFn: (r, a) => { 20827 const { status: l, point: c } = s(a); 20828 if (l === "unknown") 20829 return { opacity: 0 }; 20830 const u = { 20831 translationX: c?.from?.x ?? r.translationX, 20832 translationY: c?.from?.y ?? r.translationY, 20833 opacity: r.opacity, 20834 phase: Zs[l] 20835 }; 20836 return t === "added" ? { 20837 ...u, 20838 opacity: 0, 20839 translationX: c?.to?.x, 20840 translationY: c?.to?.y, 20841 phase: Zs.added 20842 } : (l === "added" && (u.opacity = 0), u); 20843 }, toFn: (r, a) => { 20844 const { status: l, point: c } = s(a); 20845 if (l === "unknown") 20846 return { opacity: 0 }; 20847 const u = { 20848 translationX: a.point.x, 20849 translationY: a.point.y, 20850 opacity: 1, 20851 phase: Zs[l] 20852 }; 20853 return l === "removed" || t === "removed" ? { 20854 ...u, 20855 translationX: c?.to?.x, 20856 translationY: c?.to?.y, 20857 opacity: 0, 20858 phase: Zs.removed 20859 } : u; 20860 } }; 20861} 20862function xg(e, { datumIndex: t }) { 20863 const i = e.getNodeData(); 20864 if (i === void 0) 20865 return; 20866 const s = i[t], { point: n } = s; 20867 if (s == null || n == null) 20868 return; 20869 const o = n.focusSize ?? e.getFormattedMarkerStyle(s).size, r = o / 2, a = s.point.x - r, l = s.point.y - r; 20870 return new _e(a, l, o, o); 20871} 20872function pK(e, t, i) { 20873 let s = i; 20874 for (const { x: n, y: o } of t) 20875 s ? e.lineTo(n, o) : (e.moveTo(n, o), s = !0); 20876} 20877var kf = 0.05; 20878function gK(e, t, i, s) { 20879 const n = Array.isArray(t) ? t : Array.from(t); 20880 if (n.length === 0 || (s ? e.lineTo(n[0].x, n[0].y) : e.moveTo(n[0].x, n[0].y), n.length <= 1)) 20881 return; 20882 const o = n.map((r, a) => { 20883 const l = a === 0 ? r : n[a - 1], c = a === n.length - 1 ? r : n[a + 1], u = a === 0 || a === n.length - 1; 20884 if (Math.sign(l.y - r.y) === Math.sign(c.y - r.y)) 20885 return 0; 20886 if (!u) { 20887 const d = Math.abs(l.y - c.y), p = Math.abs(r.y - l.y) / d, f = Math.abs(r.y - c.y) / d; 20888 if (p <= kf || 1 - p <= kf || f <= kf || 1 - f <= kf) 20889 return 0; 20890 } 20891 return (c.y - l.y) / (c.x - l.x); 20892 }); 20893 o[1] === 0 && (o[0] *= 2), o[o.length - 2] === 0 && (o[o.length - 1] *= 2); 20894 for (let r = 1; r < n.length; r += 1) { 20895 const a = n[r - 1], l = o[r - 1], c = n[r], u = o[r], d = c.x - a.x, p = c.y - a.y; 20896 let f = d * i / 3, m = d * l * i / 3, y = d * i / 3, b = d * u * i / 3; 20897 u === 0 && Math.abs(m) > Math.abs(p) && (f *= Math.abs(p / m), m = Math.sign(m) * Math.abs(p)), l === 0 && Math.abs(b) > Math.abs(p) && (y *= Math.abs(p / b), b = Math.sign(b) * Math.abs(p)), e.cubicCurveTo(a.x + f, a.y + m, c.x - y, c.y - b, c.x, c.y); 20898 } 20899} 20900function fK(e, t, i, s) { 20901 let n; 20902 for (const o of t) { 20903 if (n != null) { 20904 const r = n.x < o.x ? i : 1 - i, a = (o.x - n.x) * r + n.x; 20905 e.lineTo(a, n?.y ?? o.y), e.lineTo(a, o.y), e.lineTo(o.x, o.y); 20906 } else s ? e.lineTo(o.x, o.y) : e.moveTo(o.x, o.y); 20907 n = o; 20908 } 20909} 20910function mK(e) { 20911 return e.reduce( 20912 ({ min: t, max: i }, s) => ((t == null || t.point.x > s.point.x) && (t = s), (i == null || i.point.x < s.point.x) && (i = s), { min: t, max: i }), 20913 {} 20914 ); 20915} 20916function gR(e, t, i) {
20917 const s = (t.y - e.y) / (t.x - e.x), n = (i - e.x) * s + e.y; 20918 return { x: i, y: n }; 20919} 20920function fR(e, t, i, s) { 20921 let n = -1, o = 0; 20922 const r = []; 20923 for (; o < e.length; ) { 20924 if (e[o].change === t) { 20925 r.push(e[o]), o++; 20926 continue; 20927 } 20928 if (e[o].change === i) { 20929 o++; 20930 continue; 20931 } 20932 r.length > 0 && (s(r, n, o), r.length = 0), n = o, o++; 20933 } 20934 r.length > 0 && s(r, n, o); 20935} 20936function vK(e, t) { 20937 fR(e, "out", "in", (i, s, n) => { 20938 s === -1 && e[n] ? i.forEach((o) => o.to = e[n].from) : n === e.length && e[s] ? i.forEach((o) => o.to = e[s].from) : t === "intersect" && e[s]?.from && e[n]?.from ? i.forEach((o) => o.to = gR(e[s].from, e[n].from, o.from.x)) : i.forEach((o) => o.to = o.from); 20939 }), fR(e, "in", "out", (i, s, n) => { 20940 s === -1 && e[n] ? i.forEach((o) => o.from = e[n].to) : n === e.length && e[s] ? i.forEach((o) => o.from = e[s].to) : t === "intersect" && e[s]?.to && e[n]?.to ? i.forEach((o) => o.from = gR(e[s].to, e[n].to, o.to.x)) : i.forEach((o) => o.from = o.to); 20941 }); 20942} 20943function mR(e, t, i) { 20944 const s = isNaN(e.x) ? t.x : e.x, n = isNaN(e.y) ? t.y : e.y, o = t.x - e.x, r = t.y - e.y, a = isNaN(o) ? 0 : o * i, l = isNaN(r) ? 0 : r * i; 20945 return { 20946 x: s + a, 20947 y: n + l 20948 }; 20949} 20950var yK = { 20951 start: 0, 20952 middle: 0.5, 20953 end: 1 20954}; 20955function A2(e, t, i, s = !1) { 20956 const { path: n } = t; 20957 i?.type === "smooth" ? gK(n, e, i.tension ?? 1, s) : i?.type === "step" ? fK(n, e, yK[i.position ?? "end"], s) : pK(n, e, s); 20958} 20959function D2(e, t) { 20960 let i, s; 20961 const n = [], o = () => { 20962 s != null && (n.push(s), s = void 0); 20963 }; 20964 for (const r of e) { 20965 const { from: a, to: l } = r, c = t[r.change]; 20966 if (c == null || a == null || l == null) 20967 continue; 20968 const u = mR(a, l, c); 20969 if (r.moveTo === !1) 20970 s ?? (s = []), s.push(u); 20971 else if (r.moveTo === !0 || !i) 20972 o(), s = [u]; 20973 else if (i) { 20974 const d = r.moveTo === "in" ? c : 1 - c, { x: p, y: f } = mR(i, u, d); 20975 s ?? (s = []), s.push({ x: p, y: f }), o(), s = [u]; 20976 } 20977 i = u; 20978 } 20979 return o(), n; 20980} 20981function CK(e, t, i, s) { 20982 D2(e, t).forEach((n) => { 20983 A2(n, i, s); 20984 }); 20985} 20986function h1({ id: e, visible: t, nodeDataDependencies: i }, s, ...n) { 20987 const { seriesRectWidth: o, seriesRectHeight: r } = i; 20988 Mr( 20989 e, 20990 "path_properties", 20991 s, 20992 n, 20993 { clipX: 0 }, 20994 { clipX: o }, 20995 { 20996 phase: "initial", 20997 start: { clip: !0, clipY: r, visible: t }, 20998 finish: { clip: !1, visible: t } 20999 } 21000 ); 21001} 21002function Km({ id: e }, t, i, s = "add", ...n) { 21003 Mr(e, t, i, n, { opacity: 0 }, { opacity: 1 }, { phase: s }); 21004} 21005function bK({ id: e }, t, i, ...s) { 21006 Mr(e, t, i, s, { opacity: 1 }, { opacity: 0 }, { phase: "remove" }); 21007} 21008function p1(e) { 21009 return (t) => ({ 21010 visible: e.getVisible(), 21011 opacity: e.getOpacity(), 21012 clipScalingX: 1, 21013 clip: !1 21014 }); 21015} 21016function Zm({ nodeDataDependencies: e }, t) { 21017 const i = (s) => isFinite(s) ? s : 0; 21018 t.clipX = i(e.seriesRectWidth), t.clipY = i(e.seriesRectHeight); 21019} 21020var wK = 0.125, SK = 0.25, g1 = class extends Fl { 21021 constructor(e) { 21022 super({ 21023 moduleCtx: e, 21024 directionKeys: Kc, 21025 directionNames: Zc, 21026 pathsPerSeries: ["fill", "stroke"], 21027 pathsZIndexSubOrderOffset: [0, 1e3], 21028 hasMarkers: !0, 21029 markerSelectionGarbageCollection: !1, 21030 pickModes: [ 21031 2, 21032 0 21033 /* EXACT_SHAPE_MATCH */ 21034 ], 21035 animationResetFns: { 21036 path: p1({ getVisible: () => this.visible, getOpacity: () => this.getOpacity() }), 21037 label: Ra, 21038 marker: (t, i) => ({ ...Sg(), ...zp(t, i) }) 21039 } 21040 }), this.properties = new Hi(), this.connectsToYAxis = !0, this.backgroundGroup = new Ye({ 21041 name: `${this.id}-background`, 21042 zIndex: 0 21043 /* BACKGROUND */ 21044 }), this._isStacked = void 0; 21045 } 21046 get pickModeAxis() { 21047 return "main"; 21048 } 21049 renderToOffscreenCanvas() { 21050 return super.renderToOffscreenCanvas() || this.contextNodeData != null && (this.contextNodeData.fillData.spans.length > Um || this.contextNodeData.strokeData.spans.length > Um); 21051 } 21052 attachSeries(e, t, i) { 21053 super.attachSeries(e, t, i), e.appendChild(this.backgroundGroup); 21054 } 21055 detachSeries(e, t, i) { 21056 super.detachSeries(e, t, i), e?.removeChild(this.backgroundGroup); 21057 } 21058 attachPaths([e, t]) { 21059 this.backgroundGroup.appendChild(e), this.contentGroup.appendChild(t), t.zIndex = -1; 21060 } 21061 isStacked() { 21062 return (this.seriesGrouping?.stackCount ?? 1) > 1; 21063 } 21064 setSeriesIndex(e) { 21065 const t = this.isStacked(); 21066 return !super.setSeriesIndex(e) && this._isStacked === t ? !1 : (this._isStacked = t, t ? (this.backgroundGroup.zIndex = [0, e], this.contentGroup.zIndex = [ 21067 1, 21068 e, 21069 0 21070 /* FOREGROUND */ 21071 ]) : (this.backgroundGroup.zIndex = [1, e, 0, 0], this.contentGroup.zIndex = [1, e, 0, 1]), !0); 21072 } 21073 async processData(e) { 21074 if (this.data == null || !this.properties.isValid()) 21075 return; 21076 const { data: t, visible: i, seriesGrouping: { groupIndex: s = this.id, stackCount: n = 1 } = {} } = this, { xKey: o, yKey: r, yFilterKey: a, connectMissingData: l, normalizedTo: c } = this.properties, u = !this.ctx.animationManager.isSkipped(), d = this.axes.x?.scale, p = this.axes.y?.scale, { xScaleType: f, yScaleType: m }
21076 = this.getScaleInformation({ xScale: d, yScale: p }), y = { 21077 value: `area-stack-${s}-yValue`, 21078 values: `area-stack-${s}-yValues`, 21079 stack: `area-stack-${s}-yValue-stack`, 21080 marker: `area-stack-${s}-yValues-marker` 21081 }, b = []; 21082 cl(c) && b.push(py(Object.values(y), c, "range")), u && b.push(jd()); 21083 const C = { invalidValue: null }; 21084 (cl(c) || l) && n > 1 && (C.invalidValue = 0), i || (C.forceValue = 0), await this.requestDataModel(e, t, { 21085 props: [ 21086 Uo(o, f, { id: "xValue" }), 21087 pt(r, m, { id: "yValueRaw", ...C }), 21088 ...a != null ? [pt(a, m, { id: "yFilterRaw" })] : [], 21089 ...zF(r, m, { id: "yValueStack", ...C, groupId: y.stack }), 21090 pt(r, m, { id: "yValue", ...C, groupId: y.value }), 21091 ...gl( 21092 r, 21093 "window", 21094 "current", 21095 { id: "yValueEnd", ...C, groupId: y.values }, 21096 m 21097 ), 21098 ...gl( 21099 r, 21100 "normal", 21101 "current", 21102 { id: "yValueCumulative", ...C, groupId: y.marker }, 21103 m 21104 ), 21105 ...b 21106 ], 21107 groupByKeys: !0, 21108 groupByData: !1 21109 }), this.animationState.transition("updateData"); 21110 } 21111 getSeriesDomain(e) { 21112 const { processedData: t, dataModel: i, axes: s } = this; 21113 if (!t || !i || !t.rawData?.length) 21114 return []; 21115 const n = s.y, o = i.resolveProcessedDataDefById(this, "xValue"), r = i.getDomain(this, "xValue", "key", t), a = i.getDomain(this, "yValueEnd", "value", t); 21116 if (e === "x") 21117 return o?.def.type === "key" && o.def.valueType === "category" ? r : vn(ma(r)); 21118 if (n instanceof qc || n instanceof Yd) 21119 return vn(a); 21120 { 21121 const l = [a[0] > 0 ? 0 : a[0], a[1] < 0 ? 0 : a[1]]; 21122 return vn(l); 21123 } 21124 } 21125 getSeriesRange(e, t) { 21126 const { dataModel: i, processedData: s } = this; 21127 if (!i || !s) 21128 return [NaN, NaN]; 21129 const n = this.axes.x.scale, o = i.resolveKeysById(this, "xValue", s), [r, a] = cy(o.length, t, (u) => { 21130 const d = n.convert(o[u]); 21131 return [d, d]; 21132 }), [l, c] = i.getDomainBetweenRange(this, ["yValueEnd"], [r, a], s); 21133 return [Math.min(l, 0), Math.max(c, 0)]; 21134 } 21135 createNodeData() { 21136 const { axes: e, data: t, processedData: i, dataModel: s } = this, n = e.x, o = e.y; 21137 if (!n || !o || !t || !s || !i?.rawData.length || i.type !== "grouped" || !this.properties.isValid()) 21138 return; 21139 const { 21140 yKey: r, 21141 xKey: a, 21142 yFilterKey: l, 21143 marker: c, 21144 label: u, 21145 fill: d, 21146 stroke: p, 21147 connectMissingData: f, 21148 interpolation: m 21149 } = this.properties, { scale: y } = n, { scale: b } = o, { isContinuousY: C } = this.getScaleInformation({ xScale: y, yScale: b }), w = (y.bandwidth ?? 0) / 2, M = s.resolveKeysById(this, "xValue", i), A = s.resolveColumnById(this, "yValueEnd", i), I = s.resolveColumnById(this, "yValueRaw", i), L = s.resolveColumnById(this, "yValueCumulative", i), k = l != null ? s.resolveColumnById(this, "yFilterRaw", i) : void 0, B = s.resolveColumnById(this, "yValueStack", i), N = (oe, U, j) => { 21150 let J; 21151 return (cl(this.properties.normalizedTo) ? C && Zv(j) : !isNaN(j)) && (J = U), { 21152 x: y.convert(oe) + w, 21153 y: b.convert(J), 21154 size: c.size 21155 }; 21156 }, W = [], se = [], { visibleSameStackCount: ue } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this); 21157 let Ce = !1; 21158 const { rawData: te } = i; 21159 i.groups.forEach(({ datumIndices: oe }) => { 21160 oe.forEach((U) => { 21161 const j = M[U]; 21162 if (j == null) 21163 return; 21164 const J = te[U], ne = I[U], me = L[U], V = A[U], X = Number.isFinite(ne), H = N(j, +me, ne), Q = k != null ? k[U] === ne : void 0; 21165 if (Q === !1 && (Ce = !0), X && c && se.push({ 21166 index: U, 21167 series: this, 21168 itemId: r, 21169 datum: J, 21170 datumIndex: U, 21171 midPoint: { x: H.x, y: H.y }, 21172 cumulativeValue: V, 21173 yValue: ne, 21174 xValue: j, 21175 yKey: r, 21176 xKey: a, 21177 point: H, 21178 fill: c.fill ?? d, 21179 stroke: c.stroke ?? p,
21180 strokeWidth: c.strokeWidth ?? this.getStrokeWidth(this.properties.strokeWidth), 21181 selected: Q 21182 }), X && u) { 21183 const re = this.getLabelText(u, { 21184 value: ne, 21185 datum: J, 21186 xKey: a, 21187 yKey: r, 21188 xName: this.properties.xName, 21189 yName: this.properties.yName 21190 }); 21191 W.push({ 21192 index: U, 21193 series: this, 21194 itemId: r, 21195 datum: J, 21196 x: H.x, 21197 y: H.y, 21198 labelText: re 21199 }); 21200 } 21201 }); 21202 }); 21203 const q = (oe) => oe.flatMap((U) => Array.isArray(U) ? Ym(U, m) : new Array(U.skip).fill(null)), $ = i.groups.flatMap((oe) => oe.datumIndices), T = (oe, U) => ({ 21204 point: { 21205 x: y.convert(oe) + w, 21206 y: b.convert(U) 21207 }, 21208 xDatum: oe, 21209 yDatum: U 21210 }), E = (oe) => { 21211 const U = []; 21212 for (let j = 0; j < $.length; j += 1) { 21213 const J = $[j], ne = M[J], me = B[J], V = me[oe], X = Number.isFinite(V); 21214 if (f && !X) 21215 continue; 21216 const H = j > 0 ? B[$[j - 1]] : void 0, Q = j < $.length - 1 ? B[$[j + 1]] : void 0; 21217 let re = 0, Se = 0; 21218 for (let ze = 0; ze <= oe; ze += 1) { 21219 const Ke = me[ze]; 21220 if (Number.isFinite(Ke)) { 21221 const st = H == null || Number.isFinite(H[ze]), tt = Q == null || Number.isFinite(Q[ze]); 21222 st && (re += Ke), tt && (Se += Ke); 21223 } 21224 } 21225 const Le = U[U.length - 1]; 21226 if (!f && (re !== Se || !X)) 21227 if (!X && Array.isArray(Le) && Le.length === 1) 21228 U[U.length - 1] = { skip: 1 }; 21229 else { 21230 const ze = T(ne, re), Ke = T(ne, Se); 21231 Array.isArray(Le) ? Le.push(ze) : Le != null && (Le.skip += 1), U.push(X ? [Ke] : { skip: 0 }); 21232 } 21233 else { 21234 const ze = Math.max(re, Se), Ke = T(ne, ze); 21235 Array.isArray(Le) ? Le.push(Ke) : Le != null ? (Le.skip += 1, U.push([Ke])) : U.push([Ke]); 21236 } 21237 } 21238 return q(U); 21239 }, P = this.seriesGrouping?.stackIndex ?? 0, G = () => { 21240 const oe = $.map((U) => { 21241 const j = M[U], ne = B[U][P]; 21242 if (!(f && !Number.isFinite(ne))) 21243 return T(j, 0); 21244 }).filter((U) => U != null); 21245 return Ym(oe, m); 21246 }, _ = E(P), K = _.map(() => null); 21247 for (let oe = P - 1; oe >= -1; oe -= 1) { 21248 let U; 21249 for (let j = 0; j < K.length; j += 1) 21250 K[j] == null && (U ?? (U = oe !== -1 ? E(oe) : G()), K[j] = U[j]); 21251 } 21252 const ce = _.map((oe, U) => oe ?? K[U]), ae = _.filter((oe) => oe != null); 21253 return { 21254 itemId: r, 21255 fillData: { itemId: r, spans: ce, phantomSpans: K }, 21256 strokeData: { itemId: r, spans: ae }, 21257 labelData: W, 21258 nodeData: se, 21259 scales: this.calculateScaling(), 21260 visible: this.visible, 21261 stackVisible: ue > 0, 21262 crossFiltering: Ce 21263 }; 21264 } 21265 isPathOrSelectionDirty() { 21266 return this.properties.marker.isDirty(); 21267 } 21268 markerFactory() { 21269 const { shape: e } = this.properties.marker, t = bo(e); 21270 return new t(); 21271 } 21272 updatePathNodes(e) { 21273 const { opacity: t, visible: i, animationEnabled: s } = e, [n, o] = e.paths, r = this.contextNodeData?.crossFiltering === !0, a = this.getStrokeWidth(this.properties.strokeWidth); 21274 o.setProperties({ 21275 fill: void 0, 21276 lineCap: "round", 21277 lineJoin: "round", 21278 pointerEvents: 1, 21279 stroke: this.properties.stroke, 21280 strokeWidth: a, 21281 strokeOpacity: this.properties.strokeOpacity * (r ? SK : 1), 21282 lineDash: this.properties.lineDash, 21283 lineDashOffset: this.properties.lineDashOffset, 21284 opacity: t, 21285 visible: i || s 21286 }), n.setProperties({ 21287 stroke: void 0, 21288 lineJoin: "round", 21289 pointerEvents: 1, 21290 fill: this.properties.fill, 21291 fillOpacity: this.properties.fillOpacity * (r ? wK : 1), 21292 fillShadow: this.properties.shadow, 21293 opacity: t, 21294 visible: i || s 21295 }), Zm(this, o), Zm(this, n); 21296 } 21297 updatePaths(e) { 21298 this.updateAreaPaths(e.paths, e.contextData); 21299 } 21300 updateAreaPaths(e, t) { 21301 for (const i of e) 21302 i.visible = t.visible; 21303 if (t.visible) 21304 this.updateFillPath(e, t), this.updateStrokePath(e, t); 21305 else 21306 for (const i of e) 21307 i.path.clear(), i.markDirty(); 21308 } 21309 updateFillPath(e, t) { 21310 const [i] = e; 21311 i.path.clear(), S2(i, t.fillData), i.markDirty(); 21312 } 21313 updateStrokePath(e, t) { 21314 const { spans: i } = t.strokeData, [, s] = e; 21315 s.path.clear(), a1(s, i), s.markDirty(); 21316 } 21317 updateMarkerSelection(e) { 21318 const { nodeData: t, markerSelection: i } = e, s = this.properties.marker.enabled || this.contextNodeData?.crossFiltering === !0; 21319 return this.properties.marker.isDirty() && (i.clear(), i.cleanup()), i.update(s ? t : []); 21320 } 21321 getMarkerItemBaseStyle(e) { 21322 const { marker: t } = this.properties, i = e ? this.properties.highlightStyle.item : void 0; 21323 return { 21324 fill: i?.fill ?? t.fill, 21325 fillOpacity: i?.fillOpacity ?? t.fillOpacity, 21326 stroke: i?.stroke ?? t.stroke, 21327 strokeWidth: i?.strokeWidth ?? t.strokeWidth, 21328 strokeOpacity: i?.strokeOpacity ?? t.strokeOpacity 21329 }; 21330 } 21331 getMarkerItemStyleOverrides(e, t, i, s, n, o) { 21332 const { marker: r } = this.properties, { itemStyler: a } = r; 21333 if (a == null) 21334 return; 21335 const { id: l, properties: c } = this, { xKey: u, yKey: d } = c, { xDomain: p, yDomain: f } = this.cachedDatumCallback("domain", () => ({
21336 xDomain: this.getSeriesDomain( 21337 "x" 21338 /* X */ 21339 ), 21340 yDomain: this.getSeriesDomain( 21341 "y" 21342 /* Y */ 21343 ) 21344 })); 21345 return this.cachedDatumCallback(ps(e, o ? "highlight" : "node"), () => a({ 21346 seriesId: l, 21347 ...pl(t, u, d, p, f), 21348 xValue: i, 21349 yValue: s, 21350 highlighted: o, 21351 ...n 21352 })); 21353 } 21354 updateMarkerNodes(e) { 21355 const { markerSelection: t, isHighlight: i } = e, { xKey: s, yKey: n, marker: o, fill: r, stroke: a, strokeWidth: l, fillOpacity: c, strokeOpacity: u, highlightStyle: d } = this.properties, p = this.getSeriesDomain( 21356 "x" 21357 /* X */ 21358 ), f = this.getSeriesDomain( 21359 "y" 21360 /* Y */ 21361 ), m = ht(i && d.item, o.getStyle(), { 21362 fill: r, 21363 stroke: a, 21364 strokeWidth: l, 21365 fillOpacity: c, 21366 strokeOpacity: u 21367 }); 21368 t.each((y, b) => { 21369 this.updateMarkerStyle( 21370 y, 21371 o, 21372 { ...pl(b, s, n, p, f), highlighted: i }, 21373 m, 21374 { selected: b.selected } 21375 ); 21376 }), i || this.properties.marker.markClean(); 21377 } 21378 updateLabelSelection(e) { 21379 const { labelData: t, labelSelection: i } = e; 21380 return i.update(t); 21381 } 21382 updateLabelNodes(e) { 21383 const { labelSelection: t } = e, { enabled: i, fontStyle: s, fontWeight: n, fontSize: o, fontFamily: r, color: a } = this.properties.label; 21384 t.each((l, c) => { 21385 const { x: u, y: d, labelText: p } = c; 21386 p && i && this.visible ? (l.fontStyle = s, l.fontWeight = n, l.fontSize = o, l.fontFamily = r, l.textAlign = "center", l.textBaseline = "bottom", l.text = p, l.x = u, l.y = d - 10, l.fill = a, l.visible = !0) : l.visible = !1; 21387 }); 21388 } 21389 getTooltipContent(e) { 21390 const { id: t, dataModel: i, processedData: s, axes: n, properties: o } = this, { xKey: r, xName: a, yKey: l, yName: c, tooltip: u } = o, d = n.x, p = n.y; 21391 if (!i || !s || s.rawData.length === 0 || !d || !p) 21392 return; 21393 const { datumIndex: f } = e, m = s.rawData[f], y = i.resolveKeysById(this, "xValue", s)[f], b = i.resolveColumnById(this, "yValueRaw", s)[f]; 21394 if (y == null) 21395 return; 21396 const C = this.getMarkerItemBaseStyle(!1); 21397 return Object.assign( 21398 C, 21399 this.getMarkerItemStyleOverrides(String(f), m, y, b, C, !1) 21400 ), u.formatTooltip( 21401 { 21402 heading: d.formatDatum(y), 21403 symbol: this.legendItemSymbol(), 21404 data: [{ label: c, fallbackLabel: l, value: p.formatDatum(b) }] 21405 }, 21406 { 21407 seriesId: t, 21408 datum: m, 21409 title: c, 21410 xKey: r, 21411 xName: a, 21412 yKey: l, 21413 yName: c, 21414 ...C, 21415 ...this.getModuleTooltipParams() 21416 } 21417 ); 21418 } 21419 legendItemSymbol() { 21420 const { fill: e, stroke: t, fillOpacity: i, strokeOpacity: s, strokeWidth: n, lineDash: o, marker: r } = this.properties, a = !r.enabled || r.fill === void 0; 21421 return { 21422 marker: { 21423 shape: r.shape, 21424 fill: a ? e : r.fill, 21425 fillOpacity: a ? i : r.fillOpacity, 21426 stroke: r.stroke ?? t, 21427 strokeOpacity: r.strokeOpacity ?? s, 21428 strokeWidth: r.strokeWidth ?? 0, 21429 enabled: r.enabled || n <= 0 21430 }, 21431 line: { 21432 stroke: t, 21433 strokeOpacity: s, 21434 strokeWidth: n, 21435 lineDash: o 21436 } 21437 }; 21438 } 21439 getLegendData(e) { 21440 if (!this.properties.isValid() || e !== "category") 21441 return []; 21442 const { 21443 id: t, 21444 ctx: { legendManager: i }, 21445 visible: s 21446 } = this, { yKey: n, yName: o, legendItemName: r, showInLegend: a } = this.properties; 21447 return [ 21448 { 21449 legendType: e, 21450 id: t, 21451 itemId: n, 21452 seriesId: t, 21453 enabled: s && i.getItemEnabled({ seriesId: t, itemId: n }), 21454 label: { 21455 text: r ?? o ?? n 21456 }, 21457 symbol: this.legendItemSymbol(), 21458 legendItemName: r, 21459 hideInLegend: !a 21460 } 21461 ]; 21462 } 21463 animateEmptyUpdateReady(e) { 21464 const { markerSelection: t, labelSelection: i, contextData: s, paths: n } = e, { animationManager: o } = this.ctx; 21465 this.updateAreaPaths(n, s), h1(this, o, ...n), zi([t], zp), d1(this, o, t), Et(this, "labels", o, i); 21466 } 21467 animateReadyResize(e) { 21468 const { contextData: t, paths: i } = e; 21469 this.updateAreaPaths(i, t), super.animateReadyResize(e); 21470 } 21471 animateWaitingUpdateReady(e) { 21472 const { animationManager: t } = this.ctx, { markerSelection: i, labelSelection: s, contextData: n, paths: o, previousContextData: r } = e, [a, l] = o; 21473 if (a == null && l == null) 21474 return; 21475 this.resetMarkerAnimation(e), this.resetLabelAnimation(e); 21476 const c = () => { 21477 this.resetPathAnimation(e), this.updateAreaPaths(o, n); 21478 }, u = () => { 21479 t.skipCurrentBatch(), c(); 21480 }; 21481 if (n == null || r == null) { 21482 c(), Gp(this, t, "added", i), Km(this, "fill_path_properties", t, "add", a), Km(this, "stroke_path_properties", t, "add", l), Et(this, "labels", t, s); 21483 return; 21484 } 21485 if (n.crossFiltering !== r.crossFiltering) { 21486 u(); 21487 return; 21488 } 21489 const d = M2(n, r); 21490 if (d === void 0) { 21491 u(); 21492 return; 21493 }
21493 else if (d.status === "no-op") 21494 return; 21495 Gp(this, t, void 0, i), Mi(this.id, "fill_path_properties", t, [a], d.fill.pathProperties), $m(this.id, "fill_path_update", t, [a], d.fill.path), Mi(this.id, "stroke_path_properties", t, [l], d.stroke.pathProperties), $m(this.id, "stroke_path_update", t, [l], d.stroke.path), Et(this, "labels", t, s), this.ctx.animationManager.animate({ 21496 id: this.id, 21497 groupId: "reset_after_animation", 21498 phase: "trailing", 21499 from: {}, 21500 to: {}, 21501 onComplete: () => this.updateAreaPaths(o, n) 21502 }); 21503 } 21504 isLabelEnabled() { 21505 return this.properties.label.enabled; 21506 } 21507 nodeFactory() { 21508 return new Ye(); 21509 } 21510 getFormattedMarkerStyle(e) { 21511 const { xKey: t, yKey: i } = e, s = this.getSeriesDomain( 21512 "x" 21513 /* X */ 21514 ), n = this.getSeriesDomain( 21515 "y" 21516 /* Y */ 21517 ); 21518 return this.getMarkerStyle(this.properties.marker, { 21519 ...pl(e, t, i, s, n), 21520 highlighted: !0 21521 }); 21522 } 21523 computeFocusBounds(e) { 21524 return xg(this, e); 21525 } 21526}; 21527g1.className = "AreaSeries"; 21528g1.type = "area"; 21529var xK = { 21530 type: "series", 21531 optionsKey: "series[]", 21532 packageType: "community", 21533 chartTypes: ["cartesian"], 21534 identifier: "area", 21535 moduleFactory: (e) => new g1(e), 21536 stackable: !0, 21537 tooltipDefaults: { range: "nearest" }, 21538 defaultAxes: [ 21539 { 21540 type: "number", 21541 position: "left" 21542 /* LEFT */ 21543 }, 21544 { 21545 type: "category", 21546 position: "bottom" 21547 /* BOTTOM */ 21548 } 21549 ], 21550 themeTemplate: { 21551 series: { 21552 nodeClickRange: "nearest", 21553 tooltip: { position: { type: "node" } }, 21554 fillOpacity: 0.8, 21555 strokeOpacity: 1, 21556 strokeWidth: 0, 21557 lineDash: [0], 21558 lineDashOffset: 0, 21559 shadow: { 21560 enabled: !1, 21561 color: Bl, 21562 xOffset: 3, 21563 yOffset: 3, 21564 blur: 5 21565 }, 21566 interpolation: { 21567 type: "linear", 21568 // @ts-expect-error - users shouldn't specify all options, but we have to for theming to work 21569 tension: 1, 21570 position: "end" 21571 }, 21572 marker: { 21573 enabled: !1, 21574 shape: "circle", 21575 size: 7, 21576 strokeWidth: 0 21577 }, 21578 label: { 21579 enabled: !1, 21580 fontSize: 12, 21581 fontFamily: Si, 21582 color: Zi 21583 } 21584 } 21585 }, 21586 paletteFactory: (e) => { 21587 const { marker: t } = n1(e); 21588 return { fill: t.fill, stroke: t.stroke, marker: t }; 21589 } 21590}; 21591function f1(e, t) { 21592 for (const i of t) { 21593 const s = i.datum; 21594 s === void 0 ? Ee.error("undefined datum") : e.addValue(i, s); 21595 } 21596} 21597function m1(e, t) { 21598 const { x: i, y: s } = t, { nearest: n, distanceSquared: o } = e.getQuadTree().find(i, s); 21599 if (n !== void 0) 21600 return { datum: n.value, distance: Math.sqrt(o) }; 21601} 21602var v1 = class extends Da { 21603 constructor() { 21604 super(...arguments), this.direction = "vertical"; 21605 } 21606}; 21607S([ 21608 D(bk) 21609], v1.prototype, "direction", 2); 21610var E2 = class extends Fl { 21611 constructor() { 21612 super(...arguments), this.groupScale = new Tl(), this.smallestDataInterval = void 0, this.largestDataInterval = void 0; 21613 } 21614 padBandExtent(e, t) { 21615 const i = typeof t == "boolean" ? 1 : 0.5, s = kt(this.smallestDataInterval) ? this.smallestDataInterval * i : 0, n = ma(e) ?? [NaN, NaN]; 21616 return typeof t == "boolean" ? n[t ? 0 : 1] -= (t ? 1 : -1) * s : (n[0] -= s, n[1] += s), vn(n); 21617 } 21618 getBandScalePadding() { 21619 return { inner: 0.3, outer: 0.15 }; 21620 } 21621 shouldFlipXY() { 21622 return !this.isVertical(); 21623 } 21624 isVertical() { 21625 return this.properties.direction === "vertical"; 21626 } 21627 getBarDirection() { 21628 return this.shouldFlipXY() ? "x" : "y"; 21629 } 21630 getCategoryDirection() { 21631 return this.shouldFlipXY() ? "y" : "x"; 21632 } 21633 getValueAxis() { 21634 const e = this.getBarDirection(); 21635 return this.axes[e]; 21636 } 21637 getCategoryAxis() { 21638 const e = this.getCategoryDirection(); 21639 return this.axes[e]; 21640 } 21641 getBandwidth(e) { 21642 return ti.is(e.scale) ? e.scale.calcBandwidth(this.smallestDataInterval) : e.scale.bandwidth; 21643 } 21644 updateGroupScale(e) { 21645 const t = [], { groupScale: i } = this, s = this.getBandwidth(e), { index: n, visibleGroupCount: o } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this); 21646 for (let a = 0; a < o; a++) 21647 t.push(String(a)); 21648 return i.domain = t, i.range = [0, s ?? 0], e instanceof Oc ? i.paddingInner = e.groupPaddingInner : e instanceof zd ? (i.paddingInner = e.groupPaddingInner, i.roun
21648d = i.padding !== 0) : i.padding = 0, { barWidth: i.bandwidth >= 1 ? ( 21649 // Pixel-rounded value for low-volume bar charts. 21650 i.bandwidth 21651 ) : ( 21652 // Handle high-volume bar charts gracefully. 21653 i.rawBandwidth 21654 ), groupIndex: n }; 21655 } 21656 resolveKeyDirection(e) { 21657 return this.getBarDirection() === "x" ? e === "x" ? "y" : "x" : e; 21658 } 21659 initQuadTree(e) { 21660 f1(e, this.datumNodesIter()); 21661 } 21662 pickNodeClosestDatum(e) { 21663 return m1(this, e); 21664 } 21665}, y1 = class extends ts { 21666 constructor() { 21667 super(...arguments), this.placement = "inside-center", this.padding = 0; 21668 } 21669}; 21670S([ 21671 D(si(["inside-center", "inside-start", "inside-end", "outside-start", "outside-end"], "a placement")) 21672], y1.prototype, "placement", 2); 21673S([ 21674 D(At) 21675], y1.prototype, "padding", 2); 21676var Ai = class extends v1 { 21677 constructor() { 21678 super(...arguments), this.fill = "#c16068", this.fillOpacity = 1, this.stroke = "#874349", this.strokeWidth = 1, this.strokeOpacity = 1, this.lineDash = [0], this.lineDashOffset = 0, this.cornerRadius = 0, this.crisp = void 0, this.shadow = new Xo(), this.label = new y1(), this.tooltip = new Ls(), this.sparklineMode = !1, this.fastDataProcessing = !1; 21679 } 21680}; 21681S([ 21682 D(Me) 21683], Ai.prototype, "xKey", 2); 21684S([ 21685 D(Me, { optional: !0 }) 21686], Ai.prototype, "xName", 2); 21687S([ 21688 D(Me) 21689], Ai.prototype, "yKey", 2); 21690S([ 21691 D(Me, { optional: !0 }) 21692], Ai.prototype, "yName", 2); 21693S([ 21694 D(Me, { optional: !0 }) 21695], Ai.prototype, "yFilterKey", 2); 21696S([ 21697 D(Me, { optional: !0 }) 21698], Ai.prototype, "stackGroup", 2); 21699S([ 21700 D(At, { optional: !0 }) 21701], Ai.prototype, "normalizedTo", 2); 21702S([ 21703 D(Ft) 21704], Ai.prototype, "fill", 2); 21705S([ 21706 D(Pt) 21707], Ai.prototype, "fillOpacity", 2); 21708S([ 21709 D(Ft) 21710], Ai.prototype, "stroke", 2); 21711S([ 21712 D(Te) 21713], Ai.prototype, "strokeWidth", 2); 21714S([ 21715 D(Pt) 21716], Ai.prototype, "strokeOpacity", 2); 21717S([ 21718 D(ya) 21719], Ai.prototype, "lineDash", 2); 21720S([ 21721 D(Te) 21722], Ai.prototype, "lineDashOffset", 2); 21723S([ 21724 D(Te) 21725], Ai.prototype, "cornerRadius", 2); 21726S([ 21727 D(je, { optional: !0 }) 21728], Ai.prototype, "crisp", 2); 21729S([ 21730 D(tn, { optional: !0 }) 21731], Ai.prototype, "itemStyler", 2); 21732S([ 21733 D(Be, { optional: !0 }) 21734], Ai.prototype, "shadow", 2); 21735S([ 21736 D(Be) 21737], Ai.prototype, "label", 2); 21738S([ 21739 D(Be) 21740], Ai.prototype, "tooltip", 2); 21741S([ 21742 D(je) 21743], Ai.prototype, "sparklineMode", 2); 21744S([ 21745 D(je) 21746], Ai.prototype, "fastDataProcessing", 2); 21747function I2(e, t) { 21748 e.crisp = t.crisp ?? !0, e.fill = t.fill, e.stroke = t.stroke, e.strokeWidth = t.strokeWidth, e.fillOpacity = t.fillOpacity, e.strokeOpacity = t.strokeOpacity, e.lineDash = t.lineDash, e.lineDashOffset = t.lineDashOffset, e.fillShadow = t.fillShadow, e.topLeftCornerRadius = t.topLeftCornerRadius !== !1 ? t.cornerRadius ?? 0 : 0, e.topRightCornerRadius = t.topRightCornerRadius !== !1 ? t.cornerRadius ?? 0 : 0, e.bottomRightCornerRadius = t.bottomRightCornerRadius !== !1 ? t.cornerRadius ?? 0 : 0, e.bottomLeftCornerRadius = t.bottomLeftCornerRadius !== !1 ? t.cornerRadius ?? 0 : 0, e.visible = t.visible ?? !0; 21749} 21750function R2(e, t, { 21751 datum: i, 21752 isHighlighted: s, 21753 style: n, 21754 highlightStyle: o, 21755 itemStyler: r, 21756 seriesId: a, 21757 ...l 21758}) { 21759 const { 21760 fill: c, 21761 fillOpacity: u, 21762 stroke: d, 21763 strokeWidth: p, 21764 strokeOpacity: f, 21765 lineDash: m, 21766 lineDashOffset: y, 21767 cornerRadius: b = 0 21768 } = ht(s && o, n); 21769 let C; 21770 return r && (C = e.cachedDatumCallback( 21771 ps(t, s ? "highlight" : "node"), 21772 () => r({ 21773 datum: i.datum, 21774 xKey: i.xKey, 21775 fill: c, 21776 fillOpacity: u, 21777 stroke: d, 21778 strokeWidth: p, 21779 strokeOpacity: f, 21780 lineDash: m, 21781 lineDashOffset: y, 21782 cornerRadius: b, 21783 highlighted: s, 21784 seriesId: a, 21785 ...l 21786 }) 21787 )), { 21788 fill: C?.fill ?? c, 21789 fillOpacity: C?.fillOpacity ?? u, 21790 stroke: C?.stroke ?? d, 21791 strokeWidth: C?.strokeWidth ?? p, 21792 strokeOpacity: C?.strokeOpacity ?? f, 21793 lineDash: C?.lineDash ?? m, 21794 lineDashOffset: C?.lineDashOffset ?? y, 21795 cornerRadius: C?.cornerRadius ?? b, 21796 topLeftCornerRadius: n.topLeftCornerRadius, 21797 topRightCornerRadius: n.topRightCornerRadius, 21798 bottomRightCornerRadius: n.bottomRightCornerRadius, 21799 bottomLeftCornerRadius: n.bottomLeftCornerRadius, 21800 fillShadow: n.fillShadow 21801 }; 21802} 21803function T2(e, t, i, s) { 21804 if (t != null) { 21805 const [n, o] = t; 21806 if (n !== 0 || o !== 1) 21807 return !1; 21808 } 21809 if (ti.is(e)) { 21810 const n = e.calcBandwidth(s) - e.calcBandwidth(i); 21811 if (n > 0 && n < 1) 21812 return !1; 21813 } 21814 return !0; 21815} 21816var t0 = (e) => Pv(e.yValue ?? 0); 21817function Hp(e, t, i) { 21818 const { startingX: s, startingY: n } = AK(e, t); 21819 return { isVertical: e, calculate: (r, a) => { 21820 let l = e ? r.x : s, c = e ? n : r.y, u = e ? r.width : 0, d = e ? 0 : r.height; 21821 const { opacity: p } = r; 21822 a && (isNaN(l) || isNaN(c)) && ({ x: l, y: c } = a, u = e ? a.width : 0, d = e ? 0 : a.height, e && !t0(a) ? c += a.height : !e && t0(a) && (l += a.width)); 21823 let f; 21824 return r.clipBBox == null ? f = void 0 : t0(r) ? f = e ? new _e(l, c - d, u, d) : new _e(l - u, c, u, d) : f = new _e(l, c, u, d), { x: l, y: c, width: u, height: d, clipBBox: f, opacity: p }; 21825 }, mode: i }; 21826} 21827function MK(e, t) { 21828 return { 21829 isVertical: e, 21830 calculate: (i) => ({ 21831 x: e ? i.x : i.x + i.width / 2, 21832 y: e ? i.y + i.height / 2 : i.y, 21833 width: e ? i.width : 0, 21834 height: e ? 0 : i.height, 21835 clipBBox: i.clipBBox, 21836 opacity: i.opacity 21837 }), 21838 mode: t 21839 }; 21840} 21841function Vp(e) { 21842 const t = (n) => n == null || isNaN(n.x) || isNaN(n.y); 21843 return { toFn: (n, o, r) => r === "removed" && n.datum == null && e.mode === "fade" ? { ...Up(n, o), opacity: 0 } : r === "removed" || t(o) ? e.calculate(o, n.previousDatum) : { 21844 x: o.x, 21845 y: o.y, 21846 width: o.width, 21847 height: o.height, 21848 clipBBox: o.clipBBox, 21849 opacity: o.opacity 21850 }, fromFn: (n, o, r) => { 21851 r === "updated" && t(o) ? r = "removed" : r === "updated" && t(n.previousDatum) && (r = "added"); 21852 let a; 21853 r === "added" && n.previousDatum == null && e.mode === "fade" ? a = { 21854 ...Up(n, o), 21855 opacity: 0 21856 } : r === "unknown" || r === "added" ? a = e.calculate(o, n.previousDatum) : a = { 21857 x: n.x, 21858 y: n.y, 21859 width: n.width, 21860 height: n.height, 21861 clipBBox: n.clipBBox, 21862 opacity: n.opacity 21863 }; 21864 const l = Zs[r]; 21865 return { ...a, phase: l }; 21866 } }; 21867} 21868function AK(e, t) { 21869 const i = t[
21870 e ? "y" : "x" 21871 /* X */ 21872 ]; 21873 let s = 1 / 0, n = 0; 21874 return i ? (e ? n = i.scale.convert(ti.is(i.scale) ? 0 : Math.max(...i.range)) : s = i.scale.convert(ti.is(i.scale) ? 0 : Math.min(...i.range)), { startingX: s, startingY: n }) : { startingX: s, startingY: n }; 21875} 21876function Up(e, { x: t, y: i, width: s, height: n, clipBBox: o, opacity: r }) { 21877 return { x: t, y: i, width: s, height: n, clipBBox: o, opacity: r }; 21878} 21879function C1(e) { 21880 if (e === void 0) 21881 return; 21882 const { x: t, y: i, width: s, height: n } = e; 21883 return new _e(t, i, s, n); 21884} 21885function L2(e, t, i) { 21886 if (t.enabled && i) { 21887 const { x: s, y: n, text: o, textAlign: r, textBaseline: a } = i, { color: l, fontStyle: c, fontWeight: u, fontSize: d, fontFamily: p } = t; 21888 e.setProperties({ 21889 visible: !0, 21890 x: s, 21891 y: n, 21892 text: o, 21893 fill: l, 21894 fontStyle: c, 21895 fontWeight: u, 21896 fontSize: d, 21897 fontFamily: p, 21898 textAlign: r, 21899 textBaseline: a 21900 }); 21901 } else 21902 e.visible = !1; 21903} 21904var DK = { 21905 "inside-start": { inside: !0, direction: -1, textAlignment: 1 }, 21906 "inside-end": { inside: !0, direction: 1, textAlignment: -1 }, 21907 "outside-start": { inside: !1, direction: -1, textAlignment: -1 }, 21908 "outside-end": { inside: !1, direction: 1, textAlignment: 1 } 21909}; 21910function k2({ 21911 isUpward: e, 21912 isVertical: t, 21913 placement: i, 21914 padding: s = 0, 21915 rect: n 21916}) { 21917 let o = n.x + n.width / 2, r = n.y + n.height / 2, a = "center", l = "middle"; 21918 if (i !== "inside-center") { 21919 const c = (e ? 1 : -1) * (t ? -1 : 1), { direction: u, textAlignment: d } = DK[i], p = (u + 1) * 0.5; 21920 if (t) { 21921 const f = e ? n.y + n.height : n.y, m = n.height * c; 21922 r = f + m * p + s * d * c, l = d === c ? "top" : "bottom"; 21923 } else { 21924 const f = e ? n.x : n.x + n.width, m = n.width * c; 21925 o = f + m * p + s * d * c, a = d === c ? "left" : "right"; 21926 } 21927 } 21928 return { x: o, y: r, textAlign: a, textBaseline: l }; 21929} 21930var vR = 0, yR = 1, EK = 2, IK = 3, CR = 4, _y = class extends E2 { 21931 constructor(e) { 21932 super({ 21933 moduleCtx: e, 21934 directionKeys: Kc, 21935 directionNames: Zc, 21936 pickModes: [ 21937 2, 21938 // Only used in sparklineMode 21939 1, 21940 0 21941 /* EXACT_SHAPE_MATCH */ 21942 ], 21943 pathsPerSeries: [], 21944 hasHighlightedLabels: !0, 21945 datumSelectionGarbageCollection: !1, 21946 animationAlwaysUpdateSelections: !0, 21947 animationResetFns: { 21948 datum: Up, 21949 label: Ra 21950 } 21951 }), this.properties = new Ai(), this.connectsToYAxis = !0, this.dataAggregationFilters = void 0; 21952 } 21953 get pickModeAxis() { 21954 return this.properties.sparklineMode ? "main" : void 0; 21955 } 21956 crossFilteringEnabled() { 21957 return this.properties.yFilterKey != null && (this.seriesGrouping == null || this.seriesGrouping.stackIndex === 0); 21958 } 21959 async processData(e) { 21960 if (!this.properties.isValid() || !this.data) 21961 return; 21962 const { xKey: t, yKey: i, yFilterKey: s, normalizedTo: n, fastDataProcessing: o } = this.properties, { seriesGrouping: { groupIndex: r = this.id } = {}, data: a } = this, l = this.seriesGrouping?.groupCount ?? 0, c = this.seriesGrouping?.stackCount ?? 0, u = !o || n != null || l > 1 || c > 1, d = !this.ctx.animationManager.isSkipped(), p = this.getCategoryAxis()?.scale, f = this.getValueAxis()?.scale, { isContinuousX: m, xScaleType: y, yScaleType: b } = this.getScaleInformation({ xScale: p, yScale: f }), C = `bar-stack-${r}-yValues`, w = `${C}-trailing`, M = this.visible ? {} : { forceValue: 0 }, A = [ 21963 Uo(t, y, { id: "xValue" }), 21964 pt(i, b, { id: "yValue-raw", invalidValue: null, ...M }) 21965 ]; 21966 this.crossFilteringEnabled() && A.push( 21967 pt(s, b, { 21968 id: "yFilterValue", 21969 invalidValue: null, 21970 ...M 21971 }) 21972 ), u && A.push( 21973 ...gl( 21974 i, 21975 "normal", 21976 "current", 21977 { 21978 id: "yValue-end", 21979 rangeId: "yValue-range", 21980 invalidValue: null, 21981 missingValue: 0, 21982 groupId: C, 21983 separateNegative: !0, 21984 ...M 21985 }, 21986 b 21987 ), 21988 ...gl( 21989 i, 21990 "trailing", 21991 "current", 21992 { 21993 id: "yValue-start", 21994 invalidValue: null, 21995 missingValue: 0, 21996 groupId: w, 21997 separateNegative: !0, 21998 ...M 21999 }, 22000 b 22001 ) 22002 ), m && A.push(HF, VF), kt(n) && A.push(py([C, w], Math.abs(n), "range")), d && this.processedData && A.push($d(this.id, this.processedData)), (d || !u) && A.push(jd()); 22003 const { dataModel: I, processedData: L } = await this.requestDataModel(e, a, { 22004 props: A, 22005 groupByKeys: u, 22006 groupByData: !u 22007 }); 22008 this.dataAggregationFilters = this.aggregateData(I, L), this.smallestDataInterval = L.reduced?.smallestKeyInterval, this.largestDataInterval = L.reduced?.largestKeyInterval, this.animationState.transition("updateData"); 22009 } 22010 getSeriesDomain(e) { 22011 const { processedData: t, dataModel: i } = this; 22012 if (i == null || t == null) 22013 return [];
22014 const s = t.rawDataSources?.get(this.id) ?? t.rawData; 22015 if (s == null || s.length === 0) 22016 return []; 22017 const n = i.resolveProcessedDataDefById(this, "xValue"), o = i.getDomain(this, "xValue", "key", t); 22018 let r = t.type === "grouped" ? i.getDomain(this, "yValue-end", "value", t) : i.getDomain(this, "yValue-raw", "value", t); 22019 const a = this.crossFilteringEnabled() ? i.getDomain(this, "yFilterValue", "value", t) : void 0; 22020 if (a != null && (r = [Math.min(r[0], a[0]), Math.max(r[1], a[1])]), e === this.getCategoryDirection()) 22021 return n?.def.type === "key" && n.def.valueType === "category" ? o : this.padBandExtent(o); 22022 if (this.getValueAxis() instanceof qc) 22023 return vn(r); 22024 { 22025 const l = [Math.min(0, r[0]), Math.max(0, r[1])]; 22026 return vn(l); 22027 } 22028 } 22029 getSeriesRange(e, t) { 22030 const { dataModel: i, processedData: s } = this; 22031 if (!i || !s || this.getBarDirection() === "x") 22032 return [NaN, NaN]; 22033 const n = this.axes.x.scale, o = i.resolveKeysById(this, "xValue", s), r = n.bandwidth ?? 0, [a, l] = cy(o.length, t, (d) => { 22034 const p = n.convert(o[d]); 22035 return [p, p + r]; 22036 }), [c, u] = i.getDomainBetweenRange( 22037 this, 22038 s.type === "ungrouped" ? ["yValue-raw"] : ["yValue-end"], 22039 [a, l], 22040 s 22041 ); 22042 return [Math.min(c, 0), Math.max(u, 0)]; 22043 } 22044 aggregateData(e, t) { 22045 } 22046 visibleRange(e, t, i, s) { 22047 return [0, e]; 22048 } 22049 createNodeData() { 22050 const { dataModel: e, processedData: t, groupScale: i, dataAggregationFilters: s } = this, n = this.getCategoryAxis(), o = this.getValueAxis(); 22051 if (!e || !t || !n || !o || !this.properties.isValid()) 22052 return; 22053 const r = t.rawDataSources?.get(this.id) ?? t.rawData; 22054 if (r == null || r.length === 0) 22055 return; 22056 const a = n.scale, l = o.scale, { xKey: c, yKey: u, xName: d, yName: p, fill: f, stroke: m, strokeWidth: y, cornerRadius: b, legendItemName: C, label: w } = this.properties, M = o.isReversed(), { barWidth: A, groupIndex: I } = this.updateGroupScale(n), L = i.convert(String(I)), k = ti.is(a) ? A * -0.5 : 0, B = e.resolveKeysById(this, "xValue", t), N = e.resolveColumnById(this, "yValue-raw", t), W = this.crossFilteringEnabled() ? e.resolveColumnById(this, "yFilterValue", t) : void 0, se = !this.ctx.animationManager.isSkipped(), ue = (be) => a.convert(B[be]) + L + k, Ce = l.convert(0), te = ({ 22057 datum: be, 22058 datumIndex: oe, 22059 valueIndex: U, 22060 xValue: j, 22061 yValue: J, 22062 cumulativeValue: ne, 22063 phantom: me, 22064 currY: V, 22065 prevY: X, 22066 x: H, 22067 width: Q, 22068 isPositive: re, 22069 yRange: Se, 22070 labelText: Le, 22071 opacity: ze, 22072 crossScale: Ke = 1 22073 }) => { 22074 const st = re !== M, tt = l.convert(V), Zt = l.convert(X), Ot = l.convert(Se), lt = this.getBarDirection() === "x", at = Q * 0.5 * (1 - Ke), Ue = { 22075 x: lt ? Math.min(tt, Zt) : H + at, 22076 y: lt ? H + at : Math.min(tt, Zt), 22077 width: lt ? Math.abs(Zt - tt) : Q * Ke, 22078 height: lt ? Q * Ke : Math.abs(Zt - tt) 22079 }, Nt = new _e(Ue.x, Ue.y, Ue.width, Ue.height), _t = { 22080 x: lt ? Math.min(Ce, Ot) : H + at, 22081 y: lt ? H + at : Math.min(Ce, Ot), 22082 width: lt ? Math.abs(Ce - Ot) : Q * Ke, 22083 height: lt ? Q * Ke : Math.abs(Ce - Ot) 22084 }, Xe = this.shouldFlipXY() ? Ue.height : Ue.width; 22085 return { 22086 series: this, 22087 itemId: me ? ps(u, me) : u, 22088 datum: be, 22089 datumIndex: oe, 22090 valueIndex: U, 22091 cumulativeValue: ne, 22092 phantom: me, 22093 xValue: j, 22094 yValue: J, 22095 yKey: u, 22096 xKey: c, 22097 capDefaults: { 22098 lengthRatioMultiplier: Xe, 22099 lengthMax: Xe 22100 }, 22101 x: _t.x, 22102 y: _t.y, 22103 width: _t.width, 22104 height: _t.height, 22105 midPoint: { x: Ue.x + Ue.width / 2, y: Ue.y + Ue.height / 2 }, 22106 fill: f, 22107 stroke: m, 22108 opacity: ze, 22109 strokeWidth: y, 22110 cornerRadius: b, 22111 topLeftCornerRadius: lt !== st, 22112 topRightCornerRadius: st, 22113 bottomRightCornerRadius: lt === st, 22114 bottomLeftCornerRadius: !st, 22115 clipBBox: Nt, 22116 label: Le != null ? { 22117 text: Le, 22118 ...k2({ 22119 isUpward: st, 22120 isVertical: !lt, 22121 placement: w.placement, 22122 padding: w.padding, 22123 rect: Ue 22124 }) 22125 } : void 0, 22126 missing: J == null, 22127 focusable: !me 22128 }; 22129 }, q = [], $ = [], T = [], E = (be, oe, U, j, J, ne, me, V) => { 22130 const X = B[be]; 22131 if (X == null) 22132 return; 22133 const H = N[be], Q = W != null ? Number(W[be]) : void 0, re = H >= 0 && !Object.is(H, -0); 22134 if (!Number.isFinite(ne) || Q != null && !Number.isFinite(Q)) 22135 return; 22136 const Se = H != null ? this.getLabelText(this.properties.label, { 22137 datum: r[be], 22138 value: Q ?? H, 22139 xKey: c, 22140 yKey: u, 22141 xName: d, 22142 yName: p, 22143 legendItemName: C 22144 }) : void 0, Le = Q != null && Q > H, ze = te({ 22145 datum: r[be], 22146 datumIndex: be, 22147 valueIndex: oe, 22148 xValue: X, 22149 yValue: Q ?? H, 22150 cumulativeValue: Q ?? ne, 22151 phantom: !1, 22152 currY: Q != null ? J + Q : ne, 22153 prevY: J, 22154 x: U, 22155 width: j, 22156 isPositive: re, 22157 yRange: Math.max(J + (Q ?? -1 / 0), me),
22158 labelText: Se, 22159 opacity: V, 22160 crossScale: Le ? 0.6 : void 0 22161 }); 22162 if ($.push(ze), T.push(ze), Q != null) { 22163 const Ke = te({ 22164 datum: r[be], 22165 datumIndex: be, 22166 valueIndex: oe, 22167 xValue: X, 22168 yValue: Q, 22169 cumulativeValue: Q, 22170 phantom: !0, 22171 currY: ne, 22172 prevY: J, 22173 x: U, 22174 width: j, 22175 isPositive: re, 22176 yRange: me, 22177 labelText: void 0, 22178 opacity: V, 22179 crossScale: void 0 22180 }); 22181 q.push(Ke); 22182 } 22183 }, [P, G] = Ds(n.range), [_, K] = a.range, ce = K - _, ae = s?.find((be) => be.maxRange > ce); 22184 if (t.type === "grouped") { 22185 const be = A, oe = e.resolveColumnById(this, "yValue-start", t), U = e.resolveColumnById(this, "yValue-end", t), j = e.resolveProcessedDataIndexById(this, "yValue-range"); 22186 t.groups.forEach(({ datumIndices: J, aggregation: ne }) => { 22187 const me = ne[j]; 22188 J.forEach((V, X) => { 22189 const H = ue(V), Q = N[V], re = Q >= 0 && !Object.is(Q, -0), Se = Number(oe[V]), Le = Number(U[V]), ze = me[re ? 1 : 0]; 22190 E(V, X, H, be, Se, Le, ze, 1); 22191 }); 22192 }); 22193 } else if (ae == null) { 22194 const be = A; 22195 let [oe, U] = this.visibleRange(r.length, P, G, ue); 22196 t.rawData.length < 1e3 && (oe = 0, U = t.rawData.length); 22197 for (let j = oe; j < U; j += 1) { 22198 const J = ue(j), ne = Number(N[j]); 22199 E(j, 0, J, be, 0, ne, ne, 1); 22200 } 22201 } else { 22202 const { maxRange: be, indexData: oe } = ae, [U, j] = this.visibleRange(be, P, G, (J) => { 22203 const ne = J * CR, me = oe[ne + vR], V = oe[ne + yR], X = (me + V) / 2 | 0; 22204 return me !== -1 ? ue(X) : NaN; 22205 }); 22206 for (let J = U; J < j; J += 1) { 22207 const ne = J * CR, me = oe[ne + vR], V = oe[ne + yR], X = oe[ne + EK], H = oe[ne + IK]; 22208 if (me === -1) 22209 continue; 22210 const Q = ue((me + V) / 2 | 0), re = Math.abs(ue(V) - ue(me)) + A, Se = B[H] != null ? Number(N[H]) : NaN, Le = B[X] != null ? Number(N[X]) : NaN; 22211 if (Se > 0) { 22212 const ze = Le >= 0 ? Le / Se : 1; 22213 E(H, 0, Q, re, 0, Se, Se, ze); 22214 } 22215 if (Le < 0) { 22216 const ze = Se <= 0 ? Se / Le : 1; 22217 E(X, 1, Q, re, 0, Le, Le, ze); 22218 } 22219 } 22220 } 22221 return { 22222 itemId: u, 22223 nodeData: q.length > 0 ? [...q, ...$] : $, 22224 labelData: T, 22225 scales: this.calculateScaling(), 22226 visible: this.visible || se, 22227 groupScale: this.getScaling(this.groupScale) 22228 }; 22229 } 22230 nodeFactory() { 22231 return new Ts(); 22232 } 22233 getHighlightData(e, t) { 22234 const i = e.find( 22235 (s) => s.datum === t.datum && !s.phantom 22236 ); 22237 return i != null ? [i] : void 0; 22238 } 22239 updateDatumSelection(e) { 22240 return e.datumSelection.update(e.nodeData, void 0, (t) => this.getDatumId(t)); 22241 } 22242 getItemBaseStyle(e) { 22243 const { properties: t } = this, { cornerRadius: i } = t, s = e ? t.highlightStyle.item : void 0; 22244 return { 22245 fill: s?.fill ?? t.fill, 22246 fillOpacity: s?.fillOpacity ?? t.fillOpacity, 22247 stroke: s?.stroke ?? t.stroke, 22248 strokeWidth: s?.strokeWidth ?? t.strokeWidth, 22249 strokeOpacity: s?.strokeOpacity ?? t.strokeOpacity, 22250 lineDash: s?.lineDash ?? t.lineDash ?? [], 22251 lineDashOffset: s?.lineDashOffset ?? t.lineDashOffset, 22252 cornerRadius: i 22253 }; 22254 } 22255 getItemStyleOverrides(e, t, i, s, n, o) { 22256 const { id: r, properties: a } = this, { xKey: l, yKey: c, itemStyler: u } = a; 22257 if (u == null) 22258 return; 22259 const { xDomain: d, yDomain: p } = this.cachedDatumCallback("domain", () => ({ 22260 xDomain: this.getSeriesDomain( 22261 "x" 22262 /* X */ 22263 ), 22264 yDomain: this.getSeriesDomain( 22265 "y" 22266 /* Y */ 22267 ) 22268 })); 22269 return this.cachedDatumCallback(ps(e, o ? "highlight" : "node"), () => u({ 22270 seriesId: r, 22271 ...pl(t, l, c, d, p), 22272 xValue: i, 22273 yValue: s, 22274 highlighted: o, 22275 ...n 22276 })); 22277 } 22278 updateDatumNodes(e) { 22279 if (!this.properties.isValid()) 22280 return; 22281 const { 22282 xKey: t, 22283 yKey: i, 22284 stackGroup: s, 22285 fill: n, 22286 fillOpacity: o, 22287 stroke: r, 22288 strokeWidth: a, 22289 strokeOpacity: l, 22290 lineDash: c, 22291 lineDashOffset: u, 22292 itemStyler: d, 22293 shadow: p, 22294 highlightStyle: { item: f } 22295 } = this.properties, m = this.axes.x, y = this.properties.crisp ?? T2(m?.scale, m?.visibleRange, this.smallestDataInterval, this.largestDataInterval), b = this.getCategoryDirection() === "x", C = { 22296 fill: n, 22297 stroke: r, 22298 lineDash: c, 22299 lineDashOffset: u, 22300 fillShadow: p,
22301 strokeWidth: this.getStrokeWidth(a), 22302 fillOpacity: 0, 22303 strokeOpacity: 0 22304 }, w = this.getSeriesDomain( 22305 "x" 22306 /* X */ 22307 ), M = this.getSeriesDomain( 22308 "y" 22309 /* Y */ 22310 ); 22311 e.datumSelection.each((A, I) => { 22312 const L = { 22313 seriesId: this.id, 22314 isHighlighted: e.isHighlight, 22315 highlightStyle: f, 22316 style: C, 22317 itemStyler: d, 22318 stackGroup: s, 22319 ...pl(I, t, i, w, M) 22320 }; 22321 C.fillOpacity = o * (I.phantom ? 0.2 : 1), C.strokeOpacity = l * (I.phantom ? 0.2 : 1), C.cornerRadius = I.cornerRadius, C.topLeftCornerRadius = I.topLeftCornerRadius, C.topRightCornerRadius = I.topRightCornerRadius, C.bottomRightCornerRadius = I.bottomRightCornerRadius, C.bottomLeftCornerRadius = I.bottomLeftCornerRadius; 22322 const k = b ? (I.clipBBox?.width ?? I.width) > 0 : (I.clipBBox?.height ?? I.height) > 0, B = R2(this, this.getDatumId(I), L); 22323 B.crisp = y, B.visible = k, I2(A, B); 22324 }); 22325 } 22326 updateLabelSelection(e) { 22327 const t = this.isLabelEnabled() ? e.labelData : []; 22328 return e.labelSelection.update(t, (i) => { 22329 i.pointerEvents = 1; 22330 }); 22331 } 22332 updateLabelNodes(e) { 22333 e.labelSelection.each((t, i) => { 22334 L2(t, this.properties.label, i.label); 22335 }); 22336 } 22337 getTooltipContent(e) { 22338 const { id: t, dataModel: i, processedData: s, properties: n } = this, { xKey: o, xName: r, yKey: a, yName: l, legendItemName: c, stackGroup: u, tooltip: d } = n, p = this.getCategoryAxis(), f = this.getValueAxis(); 22339 if (!i || !s || s.rawData.length === 0 || !p || !f) 22340 return; 22341 const { datumIndex: m } = e, y = s.rawData[m], b = i.resolveKeysById(this, "xValue", s)[m], C = i.resolveColumnById(this, "yValue-raw", s)[m]; 22342 if (b == null) 22343 return; 22344 const w = this.getItemBaseStyle(!1); 22345 return Object.assign(w, this.getItemStyleOverrides(String(m), y, b, C, w, !1)), d.formatTooltip( 22346 { 22347 heading: p.formatDatum(b), 22348 symbol: this.legendItemSymbol(), 22349 data: [{ label: l, fallbackLabel: a, value: f.formatDatum(C) }] 22350 }, 22351 { 22352 seriesId: t, 22353 datum: y, 22354 title: l, 22355 xKey: o, 22356 xName: r, 22357 yKey: a, 22358 yName: l, 22359 legendItemName: c, 22360 stackGroup: u, 22361 ...w, 22362 ...this.getModuleTooltipParams() 22363 } 22364 ); 22365 } 22366 legendItemSymbol() { 22367 const { fill: e, stroke: t, strokeWidth: i, fillOpacity: s, strokeOpacity: n } = this.properties; 22368 return { 22369 marker: { 22370 fill: e, 22371 fillOpacity: s, 22372 stroke: t, 22373 strokeWidth: i, 22374 strokeOpacity: n 22375 } 22376 }; 22377 } 22378 getLegendData(e) { 22379 const { showInLegend: t } = this.properties; 22380 if (e !== "category" || !this.properties.isValid()) 22381 return []; 22382 const { 22383 id: i, 22384 ctx: { legendManager: s }, 22385 visible: n 22386 } = this, { yKey: o, yName: r, legendItemName: a } = this.properties; 22387 return [ 22388 { 22389 legendType: "category", 22390 id: i, 22391 itemId: o, 22392 seriesId: i, 22393 enabled: n && s.getItemEnabled({ seriesId: i, itemId: o }), 22394 label: { text: a ?? r ?? o }, 22395 symbol: this.legendItemSymbol(), 22396 legendItemName: a, 22397 hideInLegend: !t 22398 } 22399 ]; 22400 } 22401 animateEmptyUpdateReady({ datumSelection: e, labelSelection: t, annotationSelections: i }) { 22402 const s = Vp(Hp(this.isVertical(), this.axes, "normal")); 22403 Mi(this.id, "nodes", this.ctx.animationManager, [e], s), Et(this, "labels", this.ctx.animationManager, t), Et(this, "annotations", this.ctx.animationManager, ...i); 22404 } 22405 animateWaitingUpdateReady(e) { 22406 const { datumSelection: t, labelSelection: i, annotationSelections: s, previousContextData: n } = e; 22407 this.ctx.animationManager.stopByAnimationGroupId(this.id); 22408 let o = this.processedData?.reduced?.diff?.[this.id]; 22409 o == null && this.processedData?.reduced?.diff != null && (o = { 22410 changed: !0, 22411 added: new Set(Array.from(t, ({ datum: u }) => this.getDatumId(u))), 22412 updated: /* @__PURE__ */ new Set(), 22413 removed: /* @__PURE__ */ new Set(), 22414 moved: /* @__PURE__ */ new Set() 22415 }); 22416 const r = n == null ? "fade" : "normal", a = Vp(Hp(this.isVertical(), this.axes, r)); 22417 Mi( 22418 this.id, 22419 "nodes", 22420 this.ctx.animationManager, 22421 [t], 22422 a, 22423 (u, d) => this.getDatumId(d), 22424 o 22425 ); 22426 const l = n != null && (!nd(e.contextData.scales.x, n.scales.x) || !nd(e.contextData.scales.y, n.scales.y) || !nd( 22427 e.contextData.groupScale, 22428 e.previousContextData.groupScale 22429 )); 22430 ((o?.changed ?? !1) || l) && (Et(this, "labels", this.ctx.animationManager, i), Et(this, "annotations", this.ctx.animationManager, ...s)); 22431 } 22432 getDatumId(e) {
22433 return ps(e.xValue, e.valueIndex, e.phantom); 22434 } 22435 isLabelEnabled() { 22436 return this.properties.label.enabled; 22437 } 22438 computeFocusBounds({ datumIndex: e }) { 22439 const t = this.contextNodeData?.nodeData[e].clipBBox; 22440 return C1(t); 22441 } 22442}; 22443_y.className = "BarSeries"; 22444_y.type = "bar"; 22445var P2 = { 22446 type: "series", 22447 optionsKey: "series[]", 22448 packageType: "community", 22449 chartTypes: ["cartesian"], 22450 identifier: "bar", 22451 moduleFactory: (e) => new _y(e), 22452 stackable: !0, 22453 groupable: !0, 22454 tooltipDefaults: { range: "exact" }, 22455 defaultAxes: o2( 22456 [ 22457 { 22458 type: "number", 22459 position: "left" 22460 /* LEFT */ 22461 }, 22462 { 22463 type: "category", 22464 position: "bottom" 22465 /* BOTTOM */ 22466 } 22467 ], 22468 (e) => e?.direction === "horizontal" 22469 ), 22470 themeTemplate: { 22471 series: { 22472 direction: "vertical", 22473 fillOpacity: 1, 22474 strokeWidth: 0, 22475 lineDash: [0], 22476 lineDashOffset: 0, 22477 label: { 22478 enabled: !1, 22479 fontWeight: "normal", 22480 fontSize: 12, 22481 fontFamily: Si, 22482 color: _l, 22483 placement: "inside-center" 22484 }, 22485 shadow: { 22486 enabled: !1, 22487 color: Bl, 22488 xOffset: 3, 22489 yOffset: 3, 22490 blur: 5 22491 }, 22492 errorBar: { 22493 cap: { 22494 lengthRatio: 0.3 22495 } 22496 } 22497 } 22498 }, 22499 paletteFactory: wg 22500}, b1 = class extends En { 22501 constructor() { 22502 super(...arguments), this.maxSize = 30; 22503 } 22504}; 22505S([ 22506 D(Te), 22507 Ge() 22508], b1.prototype, "maxSize", 2); 22509S([ 22510 D(Uv, { optional: !0 }), 22511 Ge() 22512], b1.prototype, "domain", 2); 22513var F2 = class extends ts { 22514 constructor() { 22515 super(...arguments), this.placement = "top"; 22516 } 22517}; 22518S([ 22519 D(jS) 22520], F2.prototype, "placement", 2); 22521var Kt = class extends Da { 22522 constructor() { 22523 super(...arguments), this.colorRange = ["#ffff00", "#00ff00", "#0000ff"], this.label = new F2(), this.tooltip = new Ls(), this.marker = new b1(); 22524 } 22525}; 22526S([ 22527 D(Me) 22528], Kt.prototype, "xKey", 2); 22529S([ 22530 D(Me) 22531], Kt.prototype, "yKey", 2); 22532S([ 22533 D(Me) 22534], Kt.prototype, "sizeKey", 2); 22535S([ 22536 D(Me, { optional: !0 }) 22537], Kt.prototype, "labelKey", 2); 22538S([ 22539 D(Me, { optional: !0 }) 22540], Kt.prototype, "colorKey", 2); 22541S([ 22542 D(Me, { optional: !0 }) 22543], Kt.prototype, "xFilterKey", 2); 22544S([ 22545 D(Me, { optional: !0 }) 22546], Kt.prototype, "yFilterKey", 2); 22547S([ 22548 D(Me, { optional: !0 }) 22549], Kt.prototype, "sizeFilterKey", 2); 22550S([ 22551 D(Me, { optional: !0 }) 22552], Kt.prototype, "xName", 2); 22553S([ 22554 D(Me, { optional: !0 }) 22555], Kt.prototype, "yName", 2); 22556S([ 22557 D(Me, { optional: !0 }) 22558], Kt.prototype, "sizeName", 2); 22559S([ 22560 D(Me, { optional: !0 }) 22561], Kt.prototype, "labelName", 2); 22562S([ 22563 D(Me, { optional: !0 }) 22564], Kt.prototype, "colorName", 2); 22565S([ 22566 D(Uv, { optional: !0 }) 22567], Kt.prototype, "colorDomain", 2); 22568S([ 22569 D(xo) 22570], Kt.prototype, "colorRange", 2); 22571S([ 22572 D(Me, { optional: !0 }) 22573], Kt.prototype, "title", 2); 22574S([ 22575 Ri("marker.shape") 22576], Kt.prototype, "shape", 2); 22577S([ 22578 Ri("marker.size") 22579], Kt.prototype, "size", 2); 22580S([ 22581 Ri("marker.maxSize") 22582], Kt.prototype, "maxSize", 2); 22583S([ 22584 Ri("marker.domain", { optional: !0 }) 22585], Kt.prototype, "domain", 2); 22586S([ 22587 Ri("marker.fill", { optional: !0 }) 22588], Kt.prototype, "fill", 2); 22589S([ 22590 Ri("marker.fillOpacity") 22591], Kt.prototype, "fillOpacity", 2); 22592S([ 22593 Ri("marker.stroke", { optional: !0 }) 22594], Kt.prototype, "stroke", 2); 22595S([ 22596 Ri("marker.strokeWidth") 22597], Kt.prototype, "strokeWidth", 2); 22598S([ 22599 Ri("marker.strokeOpacity") 22600], Kt.prototype, "strokeOpacity", 2); 22601S([ 22602 Ri("marker.itemStyler", { optional: !0 }) 22603], Kt.prototype, "itemStyler", 2); 22604S([ 22605 D(Be) 22606], Kt.prototype, "label", 2); 22607S([ 22608 D(Be) 22609], Kt.prototype, "tooltip", 2); 22610var RK = class extends Gx { 22611 constructor(e, t, i, s) { 22612 super(e, t, i, s), this.sizeKey = s.properties.sizeKey; 22613 } 22614}, w1 = class extends Fl { 22615 constructor(e) { 22616 super({ 22617 moduleCtx: e, 22618 directionKeys: Kc, 22619 directionNames: Zc, 22620 pickModes: [ 22621 2, 22622 1, 22623 0 22624 /* EXACT_SHAPE_MATCH */ 22625 ], 22626 pathsPerSeries: [], 22627 hasMarkers: !0, 22628 markerSelectionGarbageCollection: !1, 22629 animationResetFns: { 22630 label: Ra, 22631 marker: Sg 22632 }, 22633 usesPlacedLabels: !0 22634 }), this.NodeEvent = RK, this.clipFocusBox = !1, this.properties = new Kt(), this.sizeScale = new mo(), this.colorScale = new Wc(); 22635 } 22636 get pickModeAxis() { 22637 return "main-category"; 22638 } 22639 async processData(e) { 22640 if (!this.properties.isValid() || this.data == null || !this.visible) 22641 return; 22642 const t = this.axes.x?.scale, i = this.axes.y?.scale, { xScaleType: s, yScaleType: n }
22642 = this.getScaleInformation({ xScale: t, yScale: i }), o = this.colorScale.type, r = this.sizeScale.type, { 22643 xKey: a, 22644 yKey: l, 22645 sizeKey: c, 22646 xFilterKey: u, 22647 yFilterKey: d, 22648 sizeFilterKey: p, 22649 labelKey: f, 22650 colorDomain: m, 22651 colorRange: y, 22652 colorKey: b, 22653 marker: C 22654 } = this.properties, { dataModel: w, processedData: M } = await this.requestDataModel(e, this.data, { 22655 props: [ 22656 pt(a, s, { id: "xValue" }), 22657 pt(l, n, { id: "yValue" }), 22658 ...u != null ? [pt(u, s, { id: "xFilterValue" })] : [], 22659 ...d != null ? [pt(d, n, { id: "yFilterValue" })] : [], 22660 ...p != null ? [pt(p, r, { id: "sizeFilterValue" })] : [], 22661 pt(c, r, { id: "sizeValue" }), 22662 ...b ? [pt(b, o, { id: "colorValue" })] : [], 22663 ...f ? [pt(f, "band", { id: "labelValue" })] : [] 22664 ] 22665 }), A = w.resolveProcessedDataIndexById(this, "sizeValue"), I = M.domain.values[A] ?? []; 22666 if (this.sizeScale.domain = C.domain ? C.domain : I, b) { 22667 const L = w.resolveProcessedDataIndexById(this, "colorValue"); 22668 this.colorScale.domain = m ?? M.domain.values[L] ?? [], this.colorScale.range = y, this.colorScale.update(); 22669 } 22670 this.animationState.transition("updateData"); 22671 } 22672 getSeriesDomain(e) { 22673 const { dataModel: t, processedData: i } = this; 22674 if (!i || !t) 22675 return []; 22676 const s = e === "x" ? "xValue" : "yValue", n = t.resolveProcessedDataDefById(this, s), o = t.getDomain(this, s, "value", i); 22677 return n?.def.type === "value" && n?.def.valueType === "category" ? o : vn(ma(o)); 22678 } 22679 getSeriesRange(e, t) { 22680 return [NaN, NaN]; 22681 } 22682 createNodeData() { 22683 const { axes: e, dataModel: t, processedData: i, colorScale: s, sizeScale: n, visible: o } = this, { 22684 xKey: r, 22685 yKey: a, 22686 sizeKey: l, 22687 xFilterKey: c, 22688 yFilterKey: u, 22689 sizeFilterKey: d, 22690 labelKey: p, 22691 xName: f, 22692 yName: m, 22693 sizeName: y, 22694 labelName: b, 22695 label: C, 22696 colorKey: w, 22697 marker: M 22698 } = this.properties, A = bo(M.shape), { placement: I } = C, L = e.x, k = e.y; 22699 if (!(t && i?.rawData.length && o && L && k)) 22700 return; 22701 const B = t.resolveColumnById(this, "xValue", i), N = t.resolveColumnById(this, "yValue", i), W = l != null ? t.resolveColumnById(this, "sizeValue", i) : void 0, se = w != null ? t.resolveColumnById(this, "colorValue", i) : void 0, ue = p != null ? t.resolveColumnById(this, "labelValue", i) : void 0, Ce = c != null ? t.resolveColumnById(this, "xFilterValue", i) : void 0, te = u != null ? t.resolveColumnById(this, "yFilterValue", i) : void 0, q = d != null ? t.resolveColumnById(this, "sizeFilterValue", i) : void 0, $ = L.scale, T = k.scale, E = ($.bandwidth ?? 0) / 2, P = (T.bandwidth ?? 0) / 2, G = []; 22702 n.range = [M.size, M.maxSize]; 22703 const _ = C.getFont(), K = wa.getMeasurer({ font: _ }); 22704 return i.rawData.forEach((ce, ae) => { 22705 const be = B[ae], oe = N[ae], U = W?.[ae], j = $.convert(be) + E, J = T.convert(oe) + P; 22706 let ne; 22707 Ce != null && te != null && (ne = Ce[ae] === be && te[ae] === oe, q != null && ne && (ne = q[ae] === U)); 22708 const me = this.getLabelText(C, { 22709 value: ue != null ? ue[ae] : oe, 22710 datum: ce, 22711 xKey: r, 22712 yKey: a, 22713 sizeKey: l, 22714 labelKey: p, 22715 xName: f, 22716 yName: m, 22717 sizeName: y, 22718 labelName: b 22719 }), V = K.measureText(String(me)), X = U != null ? n.convert(U) : M.size, H = se != null ? s.convert(se[ae]) : void 0; 22720 G.push({ 22721 series: this, 22722 itemId: a, 22723 yKey: a, 22724 xKey: r, 22725 datum: ce, 22726 datumIndex: ae, 22727 xValue: be, 22728 yValue: oe, 22729 sizeValue: U, 22730 point: { x: j, y: J, size: X }, 22731 midPoint: { x: j, y: J }, 22732 fill: H, 22733 label: { text: me, ...V }, 22734 marker: A, 22735 placement: I, 22736 selected: ne 22737 }); 22738 }), { 22739 itemId: a, 22740 nodeData: G, 22741 labelData: G, 22742 scales: this.calculateScaling(), 22743 visible: this.visible 22744 }; 22745 } 22746 isPathOrSelectionDirty() { 22747 return this.properties.marker.isDirty(); 22748 } 22749 getLabelData() { 22750 return this.isLabelEnabled() ? this.contextNodeData?.labelData ?? [] : []; 22751 } 22752 markerFactory() { 22753 const { shape: e } = this.properties.marker, t = bo(e); 22754 return new t(); 22755 } 22756 updateMarkerSelection(e) { 22757 const { nodeData: t, markerSelection: i } = e; 22758 this.properties.marker.isDirty() && (i.clear(), i.cleanup()); 22759 const s = this.properties.marker.enabled ? t : []; 22760 return i.update( 22761 s, 22762 void 0, 22763 (n) => ps([n.xValue, n.yValue, n.label.text]) 22764 ); 22765 } 22766 getMarkerItemBaseStyle(e) { 22767 const { properties: t } = this, { marker: i } = t, s = e ? t.highlightStyle.item : void 0; 22768 return { 22769 fill: s?.fill ?? i.fill, 22770 fillOpacity: s?.fillOpacity ?? i.fillOpacity, 22771 stroke: s?.stroke ?? i.stroke, 22772 strokeWidth: s?.strokeWidth ?? i.strokeWidth, 22773 strokeOpacity: s?.strokeOpacity ?? i.strokeOpacity 22774 }; 22775 } 22776 getMarkerItemStyleOverrides(e, t, i, s) { 22777 const { id: n, properties: o } = this, { xKey: r, yKey: a, sizeKey: l, labelKey: c, marker: u } = o, { itemStyler: d } = u; 22778 if (d != null) 22779 return this.cachedDatumCallback(ps(e, s ? "highlight" : "node"), () => d({ 22780 seriesId: n, 22781 datum: t, 22782 xKey: r, 22783 yKey: a, 22784 sizeKey: l, 22785 labelKey: c, 22786 highlighted: s, 22787 ...i 22788 })); 22789 } 22790 updateMarkerNodes(e) { 22791 const { markerSelection: t, isHighlight: i } = e, { xKey: s, yKey: n, sizeKey: o, labelKey: r, marker: a } = this.properties, { size: l, shape: c, fill: u, fillOpacity: d, stroke: p, strokeWidth: f, strokeOpacity: m } = ht( 22792 i && this.properties.highlightStyle.item, 22793 a.getStyle() 22794 ), y = { size: l, shape: c, fill: u, fillOpacity: d, stroke: p, strokeWidth: f, strokeOpacity: m }; 22795 this.sizeScale.range = [a.size, a.maxSize], t.each((b, C) => { 22796 this.updateMarkerStyle(b, a, { datum: C, highlighted: i, xKey: s, yKey: n, sizeKey: o, labelKey: r }, y, { 22797 selected: C.selected 22798 }); 22799 }), i || this.properties.marker.markClean(); 22800 } 22801 updatePlacedLabelData(e) { 22802 this.labelSelection.update( 22803 e.map((t) => ({ 22804 ...t.datum, 22805 point: { 22806 x: t.x, 22807 y: t.y, 22808 size: t.datum.point.size 22809 } 22810 })), 22811 (t) => { 22812 t.pointerEvents = 1; 22813 } 22814 ), this.updateLabelNodes({ labelSelection: this.labelSelection }); 22815 } 22816 updateLabelNodes(e) { 22817 const { label: t } = this.properties; 22818 e.labelSelection.each((i, s) => { 22819 i.text = s.label.text, i.fill = t.color, i.x = s.point?.x ?? 0, i.y = s.point?.y ?? 0, i.fontStyle = t.fontStyle, i.fontWeight = t.fontWeight, i.fontSize = t.fontSize, i.fontFamily = t.fontFamily, i.textAlign = "left", i.textBaseline = "top"; 22820 }); 22821 } 22822 getTooltipContent(e) { 22823 const { id: t, dataModel: i, processedData: s, axes: n, properties: o } = this, { xKey: r, xName: a, yKey: l, yName: c, sizeKey: u, sizeName: d, labelKey: p, labelName: f, title: m, tooltip: y } = o, b = n.x, C = n.y; 22824 if (!i || !s || s.rawData.length === 0 || !b || !C) 22825 return; 22826 const { datumIndex: w } = e, M = s.rawData[w], A = i.resolveColumnById(this, "xValue", s)[w], I = i.resolveColumnById(this, "yValue", s)[w]; 22827 if (A == null) 22828 return; 22829 const L = [ 22830 { label: a, fallbackLabel: r, value: b.formatDatum(A) }, 22831 { label: c, fallbackLabel: l, value: C.formatDatum(I) } 22832 ]; 22833 if (u != null) { 22834 const B = i.resolveColumnById(this, "sizeValue", s)[w]; 22835 L.push({ label: d, fallbackLabel: u, value: String(B) }); 22836 }
22837 const k = this.getMarkerItemBaseStyle(!1); 22838 return Object.assign(k, this.getMarkerItemStyleOverrides(String(w), M, k, !1)), y.formatTooltip( 22839 { 22840 title: m, 22841 symbol: this.legendItemSymbol(), 22842 data: L 22843 }, 22844 { 22845 seriesId: t, 22846 datum: M, 22847 title: l, 22848 xKey: r, 22849 xName: a, 22850 yKey: l, 22851 yName: c, 22852 sizeKey: u, 22853 sizeName: d, 22854 labelKey: p, 22855 labelName: f, 22856 ...k, 22857 ...this.getModuleTooltipParams() 22858 } 22859 ); 22860 } 22861 legendItemSymbol() { 22862 const { marker: e } = this.properties, { shape: t, fill: i, stroke: s, fillOpacity: n, strokeOpacity: o, strokeWidth: r } = e; 22863 return { 22864 marker: { 22865 shape: t, 22866 fill: i ?? "rgba(0, 0, 0, 0)", 22867 stroke: s ?? "rgba(0, 0, 0, 0)", 22868 fillOpacity: n ?? 1, 22869 strokeOpacity: o ?? 1, 22870 strokeWidth: r ?? 0 22871 } 22872 }; 22873 } 22874 getLegendData() { 22875 if (!this.properties.isValid()) 22876 return []; 22877 const { 22878 id: e, 22879 ctx: { legendManager: t }, 22880 visible: i 22881 } = this, { yKey: s, yName: n, title: o } = this.properties; 22882 return [ 22883 { 22884 legendType: "category", 22885 id: e, 22886 itemId: s, 22887 seriesId: e, 22888 enabled: i && t.getItemEnabled({ seriesId: e, itemId: s }), 22889 label: { 22890 text: o ?? n ?? s 22891 }, 22892 symbol: this.legendItemSymbol() 22893 } 22894 ]; 22895 } 22896 animateEmptyUpdateReady({ markerSelection: e, labelSelection: t }) { 22897 u1(this, this.ctx.animationManager, e), Et(this, "labels", this.ctx.animationManager, t); 22898 } 22899 isLabelEnabled() { 22900 return this.properties.label.enabled; 22901 } 22902 nodeFactory() { 22903 return new Ye(); 22904 } 22905 getFormattedMarkerStyle(e) { 22906 const { xKey: t, yKey: i, sizeKey: s, labelKey: n } = this.properties; 22907 return this.getMarkerStyle(this.properties.marker, { 22908 datum: e, 22909 xKey: t, 22910 yKey: i, 22911 sizeKey: s, 22912 labelKey: n, 22913 highlighted: !1 22914 }); 22915 } 22916 computeFocusBounds(e) { 22917 return xg(this, e); 22918 } 22919}; 22920w1.className = "BubbleSeries"; 22921w1.type = "bubble"; 22922var TK = { 22923 type: "series", 22924 optionsKey: "series[]", 22925 packageType: "community", 22926 chartTypes: ["cartesian"], 22927 identifier: "bubble", 22928 moduleFactory: (e) => new w1(e), 22929 tooltipDefaults: { range: "nearest" }, 22930 defaultAxes: [ 22931 { 22932 type: "number", 22933 position: "bottom" 22934 /* BOTTOM */ 22935 }, 22936 { 22937 type: "number", 22938 position: "left" 22939 /* LEFT */ 22940 } 22941 ], 22942 themeTemplate: { 22943 series: { 22944 shape: "circle", 22945 size: 7, 22946 maxSize: 30, 22947 fillOpacity: 0.8, 22948 tooltip: { position: { type: "node" } }, 22949 label: { 22950 enabled: !1, 22951 fontSize: 12, 22952 fontFamily: Si, 22953 color: Zi 22954 } 22955 } 22956 }, 22957 paletteFactory: wg 22958}, Vi = class extends Da { 22959 constructor() { 22960 super(...arguments), this.fillOpacity = 1, this.strokeWidth = 1, this.strokeOpacity = 1, this.lineDash = [0], this.lineDashOffset = 0, this.cornerRadius = 0, this.areaPlot = !1, this.aggregation = "sum", this.shadow = new Xo(), this.label = new ts(), this.tooltip = new Ls(); 22961 } 22962}; 22963S([ 22964 D(Me) 22965], Vi.prototype, "xKey", 2); 22966S([ 22967 D(Me, { optional: !0 }) 22968], Vi.prototype, "yKey", 2); 22969S([ 22970 D(Me, { optional: !0 }) 22971], Vi.prototype, "xName", 2); 22972S([ 22973 D(Me, { optional: !0 }) 22974], Vi.prototype, "yName", 2); 22975S([ 22976 D(Ft, { optional: !0 }) 22977], Vi.prototype, "fill", 2); 22978S([ 22979 D(Pt) 22980], Vi.prototype, "fillOpacity", 2); 22981S([ 22982 D(Ft, { optional: !0 }) 22983], Vi.prototype, "stroke", 2); 22984S([ 22985 D(Te) 22986], Vi.prototype, "strokeWidth", 2); 22987S([ 22988 D(Pt) 22989], Vi.prototype, "strokeOpacity", 2); 22990S([ 22991 D(ya) 22992], Vi.prototype, "lineDash", 2); 22993S([ 22994 D(Te) 22995], Vi.prototype, "lineDashOffset", 2); 22996S([ 22997 D(Te) 22998], Vi.prototype, "cornerRadius", 2); 22999S([ 23000 D(je) 23001], Vi.prototype, "areaPlot", 2); 23002S([ 23003 D(lg, { optional: !0 }) 23004], Vi.prototype, "bins", 2); 23005S([ 23006 D(si(["count", "sum", "mean"], "a histogram aggregation")) 23007], Vi.prototype, "aggregation", 2); 23008S([ 23009 D(Te, { optional: !0 }) 23010], Vi.prototype, "binCount", 2); 23011S([ 23012 D(Be) 23013], Vi.prototype, "shadow", 2); 23014S([ 23015 D(Be) 23016], Vi.prototype, "label", 2); 23017S([ 23018 D(Be) 23019], Vi.prototype, "tooltip", 2); 23020var bR = 10, S1 = class extends Fl {
23021 constructor(e) { 23022 super({ 23023 moduleCtx: e, 23024 directionKeys: Kc, 23025 directionNames: Zc, 23026 pickModes: [ 23027 1, 23028 0 23029 /* EXACT_SHAPE_MATCH */ 23030 ], 23031 datumSelectionGarbageCollection: !1, 23032 animationResetFns: { 23033 datum: Up, 23034 label: Ra 23035 } 23036 }), this.properties = new Vi(), this.calculatedBins = []; 23037 } 23038 // During processData phase, used to unify different ways of the user specifying 23039 // the bins. Returns bins in format[[min1, max1], [min2, max2], ... ]. 23040 deriveBins(e) { 23041 const t = KS(e[0], e[1], bR), i = Dp(e[0], e[1], bR), [s] = t, n = (o) => [o, o + i]; 23042 return [[s - i, s], ...t.map(n)]; 23043 } 23044 calculateNiceBins(e, t) { 23045 const i = Math.floor(e[0]), s = e[1], n = t || 1, { start: o, binSize: r } = this.calculateNiceStart(i, s, n); 23046 return this.getBins(o, s, r, n); 23047 } 23048 getBins(e, t, i, s) { 23049 const n = [], o = this.calculatePrecision(i); 23050 for (let r = 0; r < s; r++) { 23051 const a = Math.round((e + r * i) * o) / o; 23052 let l = Math.round((e + (r + 1) * i) * o) / o; 23053 r === s - 1 && (l = Math.max(l, t)), n[r] = [a, l]; 23054 } 23055 return n; 23056 } 23057 calculatePrecision(e) { 23058 let t = 10; 23059 if (isFinite(e) && e > 0) 23060 for (; e < 1; ) 23061 t *= 10, e *= 10; 23062 return t; 23063 } 23064 calculateNiceStart(e, t, i) { 23065 const s = Math.abs(t - e) / i, n = Math.floor(Math.log10(s)), o = Math.pow(10, n); 23066 return { 23067 start: Math.floor(e / o) * o, 23068 binSize: s 23069 }; 23070 } 23071 async processData(e) { 23072 this.visible || (this.processedData = void 0, this.animationState.transition("updateData")); 23073 const { xKey: t, yKey: i, areaPlot: s, aggregation: n } = this.properties, o = this.axes.x?.scale, r = this.axes.y?.scale, { xScaleType: a, yScaleType: l } = this.getScaleInformation({ yScale: r, xScale: o }), c = [Uo(t, a), UF]; 23074 if (i) { 23075 let d = Aw("groupAgg"); 23076 n === "count" || (n === "sum" ? d = PF("groupAgg") : n === "mean" && (d = FF("groupAgg"))), s && (d = Dw("groupAgg", d)), c.push(pt(i, l, { invalidValue: void 0 }), d); 23077 } else { 23078 let d = Aw("groupAgg"); 23079 s && (d = Dw("groupAgg", d)), c.push(d); 23080 } 23081 const u = (d) => { 23082 const p = vn(d.domain.keys[0]); 23083 if (p.length === 0) 23084 return d.domain.groups = [], () => []; 23085 const f = zo(this.properties.binCount) ? this.calculateNiceBins(p, this.properties.binCount) : this.properties.bins ?? this.deriveBins(p), m = f.length; 23086 return this.calculatedBins = [...f], (y) => { 23087 const b = y.keys[0]; 23088 for (let C = 0; C < m; C++) { 23089 const w = f[C]; 23090 if (b >= w[0] && b < w[1] || C === m - 1 && b <= w[1]) 23091 return w; 23092 } 23093 return []; 23094 }; 23095 }; 23096 !this.ctx.animationManager.isSkipped() && this.processedData && c.push($d(this.id, this.processedData, !1)), await this.requestDataModel(e, this.data, { 23097 props: c, 23098 groupByFn: u 23099 }), this.animationState.transition("updateData"); 23100 } 23101 getSeriesDomain(e) { 23102 const { processedData: t, dataModel: i } = this; 23103 if (!t || !i || !this.calculatedBins.length) 23104 return []; 23105 const s = i.getDomain(this, "groupAgg", "aggregate", t), n = this.calculatedBins?.[0][0], o = this.calculatedBins?.[(this.calculatedBins?.length ?? 0) - 1][1]; 23106 return vn(e === "x" ? [n, o] : s); 23107 } 23108 getSeriesRange(e, t) { 23109 return [NaN, NaN]; 23110 } 23111 createNodeData() { 23112 const { id: e, axes: t, processedData: i } = this, s = t.x, n = t.y; 23113 if (!s || !n) 23114 return; 23115 const { scale: o } = s, { scale: r } = n, { xKey: a, yKey: l, xName: c, yName: u, fill: d, stroke: p, strokeWidth: f, cornerRadius: m } = this.properties, y = this.properties.label.formatter ?? ((M) => String(M.value)), b = [], C = { 23116 itemId: this.properties.yKey ?? this.id, 23117 nodeData: b, 23118 labelData: b, 23119 scales: this.calculateScaling(), 23120 animationValid: !0, 23121 visible: this.visible 23122 }; 23123 if (!this.visible || i == null || i.rawData.length === 0 || i.type !== "grouped") 23124 return C; 23125 const { rawData: w } = i; 23126 return i.groups.forEach(({ keys: M, datumIndices: A, aggregation: I }, L) => { 23127 const [[k, B] = [0, 0]] = I, N = A.length, W = M, [se, ue] = W, Ce = A.map((oe) => w[oe]), te = o.convert(se), q = o.convert(ue), $ = k + B, T = r.convert(0), E = r.convert($), P = Math.abs(q - te), G = Math.abs(E - T), _ = Math.min(te, q), K = Math.min(T, E); 23128 let ce; 23129 $ !== 0 && (ce = { 23130 x: _ + P / 2, 23131 y: K + G / 2, 23132 text: this.cachedDatumCallback( 23133 ps(L, "label"), 23134 () => y({ 23135 value: $, 23136 datum: Ce, 23137 seriesId: e, 23138 xKey: a, 23139 yKey: l, 23140 xName: c, 23141 yName: u 23142 }) 23143 ) ?? String($) 23144 }); 23145 const ae = { 23146 x: _ + P / 2, 23147 y: K + G / 2 23148 }, be = n.isReversed(); 23149 b.push({ 23150 series: this, 23151 datumIndex: L, 23152 datum: Ce, 23153 // required by SeriesNodeDatum, but might not make sense here 23154 // since each selection is an aggregation of multiple data. 23155 aggregatedValue: $, 23156 frequency: N, 23157 domain: W, 23158 yKey: l, 23159 xKey: a, 23160 x: _, 23161 y: K, 23162 xValue: te, 23163 yValue: E, 23164 width: P, 23165 height: G, 23166 midPoint: ae, 23167 fill: d, 23168 stroke: p, 23169 cornerRadius: m, 23170 topLeftCornerRadius: !be, 23171 topRightCornerRadius: !be, 23172 bottomRightCornerRadius: be, 23173 bottomLeftCornerRadius: be, 23174 opacity: 1, 23175 strokeWidth: f, 23176 label: ce 23177 }); 23178 }), b.sort((M, A) => M.x - A.x), C; 23179 } 23180 nodeFactory() { 23181 return new Ts(); 23182 } 23183 updateDatumSelection(e) { 23184 const { nodeData: t, datumSelection: i } = e; 23185 return i.update( 23186 t, 23187 (s) => { 23188 s.crisp = !0; 23189 }, 23190 (s) => s.domain.join("_") 23191 ); 23192 } 23193 getItemBaseStyle(e) { 23194 const { properties: t } = this, i = e ? t.highlightStyle.item : void 0; 23195 return { 23196 fill: i?.fill ?? t.fill, 23197 fillOpacity: i?.fillOpacity ?? t.fillOpacity, 23198 stroke: i?.stroke ?? t.stroke, 23199 strokeWidth: i?.strokeWidth ?? t.strokeWidth, 23200 strokeOpacity: i?.strokeOpacity ?? t.strokeOpacity 23201 }; 23202 } 23203 updateDatumNodes(e) { 23204 const { isHighlight: t } = e, { 23205 fillOpacity: i, 23206 strokeOpacity: s, 23207 lineDash: n, 23208 lineDashOffset: o, 23209 shadow: r, 23210 highlightStyle: { 23211 item: { 23212 fill: a, 23213 fillOpacity: l = i, 23214 stroke: c, 23215 strokeWidth: u 23216 } 23217 } 23218 } = this.properties; 23219 e.datumSelection.each((d, p, f) => { 23220 const { 23221 cornerRadius: m, 23222 topLeftCornerRadius: y, 23223 topRightCornerRadius: b, 23224 bottomRightCornerRadius: C, 23225 bottomLeftCornerRadius: w 23226 } = p, M = t && u !== void 0 ? u : p.strokeWidth, A = t ? l : i; 23227 d.fill = (t ? a : void 0) ?? p.fill, d.stroke = (t ? c : void 0) ?? p.stroke, d.fillOpacity = A, d.strokeOpacity = s, d.strokeWidth = M, d.lineDash = n, d.lineDashOffset = o, d.topLeftCornerRadius = y ? m : 0, d.topRightCornerRadius = b ? m : 0, d.bottomRightCornerRadius = C ? m : 0, d.bottomLeftCornerRadius = w ? m : 0, d.fillShadow = r, d.zIndex = t ? Ud.highlightedZIndex : f, d.visible = p.height > 0; 23228 }); 23229 } 23230 updateLabelSelection(e) { 23231 const { labelData: t, labelSelection: i } = e; 23232 return i.update(t, (s) => { 23233 s.pointerEvents = 1, s.textAlign = "center", s.textBaseline = "middle"; 23234 }); 23235 } 23236 updateLabelNodes(e) { 23237 const { fontStyle: t, fontWeight: i, fontFamily: s, fontSize: n, color: o } = this.properties.label, r = this.isLabelEnabled(); 23238 e.labelSelection.each((a, l) => { 23239 r && l?.label ? (a.text = l.label.text, a.x = l.label.x, a.y = l.label.y, a.fontStyle = t, a.fontWeight = i, a.fontFamily = s, a.fontSize = n, a.fill = o, a.visible = !0) : a.visible = !1; 23240 }); 23241 } 23242 initQuadTree(e) { 23243 const { value: t } = this.contentGroup.children().next(); 23244 t && f1(e, t.children()); 23245 } 23246 pickNodeClosestDatum(e) { 23247 return m1(this, e); 23248 } 23249 getTooltipContent(e) { 23250 const { 23251 id: t, 23252 dataModel: i, 23253 processedData: s, 23254 axes: n, 23255 properties: o, 23256 ctx: { localeManager: r } 23257 } = this, { xKey: a, xName: l, yKey: c, yName: u, tooltip: d } = o, p = n.x, f = n.y; 23258 if (!i || s?.type !== "grouped" || s.rawData.length === 0 || !p || !f) 23259 return; 23260 const m = e.datumIndex, { aggregation: y, datumIndices: b, keys: C } = s.groups[m], [[w, M] = [0, 0]] = y, A = b.length, I = C, [L, k] = I, B = w + M, N = { 23261 data: b.map((se) => s.rawData[se]), 23262 aggregatedValue: B, 23263 frequency: A, 23264 domain: I 23265 }, W = [ 23266 { 23267 label: l, 23268 fallbackLabel: a, 23269 value: `${p.formatDatum(L)} - ${p.formatDatum(k)}` 23270 }, 23271 { label: r.t("seriesHistogramTooltipFrequency"), value: f.formatDatum(A) } 23272 ]; 23273 if (c != null) { 23274 let se; 23275 switch (o.aggregation) { 23276 case "sum": 23277 se = r.t("seriesHistogramTooltipSum", { yName: u }); 23278 break; 23279 case "mean": 23280 se = r.t("seriesHistogramTooltipMean", { yName: u }); 23281 break; 23282 case "count": 23283 se = r.t("seriesHistogramTooltipCount", { yName: u }); 23284 break; 23285 } 23286 W.push({ label: se, value: f.formatDatum(B) }); 23287 } 23288 return d.formatTooltip( 23289 { 23290 symbol: this.legendItemSymbol(), 23291 data: W 23292 }, 23293 { 23294 seriesId: t, 23295 datum: N, 23296 title: u, 23297 xKey: a, 23298 xName: l, 23299 yKey: c, 23300 yName: u, 23301 xRange: [L, k], 23302 frequency: A, 23303 ...this.getItemBaseStyle(!1) 23304 } 23305 ); 23306 } 23307 legendItemSymbol() { 23308 const { fill: e, fillOpacity: t, stroke: i, strokeWidth: s, strokeOpacity: n } = this.properties; 23309 return { 23310 marker: { 23311 fill: e ?? "rgba(0, 0, 0, 0)", 23312 stroke: i ?? "rgba(0, 0, 0, 0)", 23313 fillOpacity: t, 23314 strokeOpacity: n, 23315 strokeWidth: s 23316 } 23317 }; 23318 } 23319 getLegendData(e) { 23320 if (e !== "category") 23321 return []; 23322 const { 23323 id: t, 23324 ctx: { legendManager: i }, 23325 visible: s 23326 } = this, { xKey: n, yName: o, showInLegend: r } = this.properties; 23327 return [ 23328 {
23329 legendType: "category", 23330 id: t, 23331 itemId: n, 23332 seriesId: t, 23333 enabled: s && i.getItemEnabled({ seriesId: t, itemId: n }), 23334 label: { 23335 text: o ?? n ?? "Frequency" 23336 }, 23337 symbol: this.legendItemSymbol(), 23338 hideInLegend: !r 23339 } 23340 ]; 23341 } 23342 animateEmptyUpdateReady({ datumSelection: e, labelSelection: t }) { 23343 const i = Vp(Hp(!0, this.axes, "normal")); 23344 Mi(this.id, "datums", this.ctx.animationManager, [e], i), Et(this, "labels", this.ctx.animationManager, t); 23345 } 23346 animateWaitingUpdateReady(e) { 23347 const t = this.processedData?.reduced?.diff?.[this.id], i = Vp(Hp(!0, this.axes, "normal")); 23348 Mi( 23349 this.id, 23350 "datums", 23351 this.ctx.animationManager, 23352 [e.datumSelection], 23353 i, 23354 (s, n) => ps(n.domain), 23355 t 23356 ), Et(this, "labels", this.ctx.animationManager, e.labelSelection); 23357 } 23358 isLabelEnabled() { 23359 return this.properties.label.enabled; 23360 } 23361 computeFocusBounds({ datumIndex: e }) { 23362 return C1(this.contextNodeData?.nodeData[e]); 23363 } 23364}; 23365S1.className = "HistogramSeries"; 23366S1.type = "histogram"; 23367var LK = { 23368 type: "series", 23369 optionsKey: "series[]", 23370 packageType: "community", 23371 chartTypes: ["cartesian"], 23372 identifier: "histogram", 23373 moduleFactory: (e) => new S1(e), 23374 tooltipDefaults: { range: "exact" }, 23375 defaultAxes: [ 23376 { 23377 type: "number", 23378 position: "bottom" 23379 /* BOTTOM */ 23380 }, 23381 { 23382 type: "number", 23383 position: "left" 23384 /* LEFT */ 23385 } 23386 ], 23387 themeTemplate: { 23388 series: { 23389 strokeWidth: 1, 23390 fillOpacity: 1, 23391 strokeOpacity: 1, 23392 lineDash: [0], 23393 lineDashOffset: 0, 23394 label: { 23395 enabled: !1, 23396 fontSize: 12, 23397 fontFamily: Si, 23398 color: _l 23399 }, 23400 shadow: { 23401 enabled: !1, 23402 color: Bl, 23403 xOffset: 3, 23404 yOffset: 3, 23405 blur: 5 23406 } 23407 } 23408 }, 23409 paletteFactory: ({ takeColors: e }) => { 23410 const { 23411 fills: [t], 23412 strokes: [i] 23413 } = e(1); 23414 return { fill: t, stroke: i }; 23415 } 23416}, Ui = class extends Da { 23417 constructor() { 23418 super(...arguments), this.stroke = "#874349", this.strokeWidth = 2, this.strokeOpacity = 1, this.lineDash = [0], this.lineDashOffset = 0, this.interpolation = new Xd(), this.marker = new En(), this.label = new ts(), this.tooltip = new Ls(), this.connectMissingData = !1, this.sparklineMode = !1; 23419 } 23420}; 23421S([ 23422 D(Me) 23423], Ui.prototype, "xKey", 2); 23424S([ 23425 D(Me) 23426], Ui.prototype, "yKey", 2); 23427S([ 23428 D(Me, { optional: !0 }) 23429], Ui.prototype, "xName", 2); 23430S([ 23431 D(Me, { optional: !0 }) 23432], Ui.prototype, "yName", 2); 23433S([ 23434 D(Me, { optional: !0 }) 23435], Ui.prototype, "yFilterKey", 2); 23436S([ 23437 D(Me, { optional: !0 }) 23438], Ui.prototype, "stackGroup", 2); 23439S([ 23440 D(Te, { optional: !0 }) 23441], Ui.prototype, "normalizedTo", 2); 23442S([ 23443 D(Me, { optional: !0 }) 23444], Ui.prototype, "title", 2); 23445S([ 23446 D(Ft) 23447], Ui.prototype, "stroke", 2); 23448S([ 23449 D(Te) 23450], Ui.prototype, "strokeWidth", 2); 23451S([ 23452 D(Pt) 23453], Ui.prototype, "strokeOpacity", 2); 23454S([ 23455 D(ya) 23456], Ui.prototype, "lineDash", 2); 23457S([ 23458 D(Te) 23459], Ui.prototype, "lineDashOffset", 2); 23460S([ 23461 D(Be) 23462], Ui.prototype, "interpolation", 2); 23463S([ 23464 D(Be) 23465], Ui.prototype, "marker", 2); 23466S([ 23467 D(Be) 23468], Ui.prototype, "label", 2); 23469S([ 23470 D(Be) 23471], Ui.prototype, "tooltip", 2); 23472S([ 23473 D(je) 23474], Ui.prototype, "connectMissingData", 2); 23475S([ 23476 D(je) 23477], Ui.prototype, "sparklineMode", 2); 23478var kK = 0.25, By = class extends Fl { 23479 constructor(e) { 23480 super({ 23481 moduleCtx: e, 23482 directionKeys: Kc, 23483 directionNames: Zc, 23484 hasMarkers: !0, 23485 pickModes: [ 23486 2, 23487 1, 23488 0 23489 /* EXACT_SHAPE_MATCH */ 23490 ], 23491 markerSelectionGarbageCollection: !1, 23492 animationResetFns: { 23493 path: p1({ getVisible: () => this.visible, getOpacity: () => this.getOpacity() }), 23494 label: Ra, 23495 marker: (t, i) => ({ ...Sg(), ...zp(t, i) }) 23496 } 23497 }), this.clipFocusBox = !1, this.properties = new Ui(), this.dataAggregationFilters = void 0; 23498 } 23499 get pickModeAxis() { 23500 return this.properties.sparklineMode ? "main" : "main-category"; 23501 } 23502 async processData(e) { 23503 if (this.data == null || !this.properties.isValid()) 23504 return; 23505 const { data: t, visible: i, seriesGrouping: { groupIndex: s = this.id, stackCount: n = 1 } = {} } = this, { xKey: o, yKey: r, yFilterKey: a, connectMissingData: l, normalizedTo: c } = this.properties, u = !this.ctx.animationManager.isSkipped(), d = this.axes.x?.scale, p = this.axes.y?.scale, { isContinuousX: f, xScaleType: m, yScaleType: y }
23505 = this.getScaleInformation({ xScale: d, yScale: p }), b = { invalidValue: null }; 23506 l && n > 1 && (b.invalidValue = 0, i || (b.forceValue = 0)); 23507 const C = []; 23508 if (f || C.push(Uo(o, m, { id: "xKey" })), C.push( 23509 pt(o, m, { id: "xValue" }), 23510 pt(r, y, { 23511 id: "yValueRaw", 23512 ...b, 23513 invalidValue: void 0 23514 }) 23515 ), a != null && C.push(pt(a, y, { id: "yFilterRaw" })), n > 1) { 23516 const A = [ 23517 `line-stack-${s}-yValues`, 23518 `line-stack-${s}-yValues-trailing`, 23519 `line-stack-${s}-yValues-marker` 23520 ]; 23521 C.push( 23522 ...gl( 23523 r, 23524 "window", 23525 "current", 23526 { id: "yValueEnd", ...b, groupId: A[0] }, 23527 y 23528 ), 23529 ...gl( 23530 r, 23531 "window-trailing", 23532 "current", 23533 { id: "yValueStart", ...b, groupId: A[1] }, 23534 y 23535 ), 23536 ...gl( 23537 r, 23538 "normal", 23539 "current", 23540 { id: "yValueCumulative", ...b, groupId: A[2] }, 23541 y 23542 ) 23543 ), cl(c) && C.push(py([A[0], A[1], A[2]], c, "range")); 23544 } 23545 u && (C.push(jd(f ? ["xValue"] : void 0)), this.processedData && C.push($d(this.id, this.processedData))); 23546 const { dataModel: w, processedData: M } = await this.requestDataModel(e, t, { 23547 props: C 23548 }); 23549 this.dataAggregationFilters = this.aggregateData(w, M), this.animationState.transition("updateData"); 23550 } 23551 getSeriesDomain(e) { 23552 const { dataModel: t, processedData: i } = this; 23553 if (!t || !i?.rawData.length) 23554 return []; 23555 const s = t.resolveProcessedDataDefById(this, "xValue"); 23556 if (e === "x") { 23557 const n = t.getDomain(this, "xValue", "value", i); 23558 return s?.def.type === "value" && s.def.valueType === "category" ? n : vn(ma(n)); 23559 } else { 23560 const o = (this.seriesGrouping?.stackCount ?? 1) > 1 ? t.getDomain(this, "yValueEnd", "value", i) : t.getDomain(this, "yValueRaw", "value", i); 23561 return vn(o); 23562 } 23563 } 23564 visibleRangeIndices(e, t) { 23565 const { dataModel: i, processedData: s } = this; 23566 if (!i || !s) 23567 return [0, 0]; 23568 const n = this.axes.x.scale, o = i.resolveColumnById(this, "xValue", s); 23569 return cy(t?.length ?? o.length, e, (r) => { 23570 const a = n.convert(o[t?.[r] ?? r]); 23571 return [a, a]; 23572 }); 23573 } 23574 getSeriesRange(e, t) { 23575 const { dataModel: i, processedData: s } = this; 23576 if (!i || !s) 23577 return [NaN, NaN]; 23578 const [n, o] = this.visibleRangeIndices(t); 23579 return i.getDomainBetweenRange(this, ["yValueRaw"], [n, o], s); 23580 } 23581 aggregateData(e, t) { 23582 } 23583 createNodeData() { 23584 const { dataModel: e, processedData: t, axes: i, dataAggregationFilters: s } = this, n = i.x, o = i.y; 23585 if (!e || !t || t.rawData.length === 0 || !n || !o) 23586 return; 23587 const { 23588 xKey: r, 23589 yKey: a, 23590 yFilterKey: l, 23591 xName: c, 23592 yName: u, 23593 marker: d, 23594 label: p, 23595 connectMissingData: f, 23596 interpolation: m, 23597 legendItemName: y 23598 } = this.properties, b = (this.seriesGrouping?.stackCount ?? 1) > 1, C = n.scale, w = o.scale, M = (C.bandwidth ?? 0) / 2, A = (w.bandwidth ?? 0) / 2, I = d.enabled ? d.size : 0, { rawData: L } = t, k = e.resolveColumnById(this, "xValue", t), B = e.resolveColumnById(this, "yValueRaw", t), N = b ? e.resolveColumnById(this, "yValueEnd", t) : void 0, W = b ? e.resolveColumnById(this, "yValueCumulative", t) : B, se = l != null ? e.resolveColumnById(this, "yFilterRaw", t) : void 0, ue = (j) => C.convert(k[j]) + M, Ce = (j) => w.convert(W[j]) + A, te = { 23599 lengthRatioMultiplier: this.properties.marker.getDiameter(), 23600 lengthMax: 1 / 0 23601 }, q = []; 23602 let $; 23603 const T = (j) => { 23604 const J = L[j], ne = k[j], me = B[j], V = N?.[j], X = se?.[j], H = ue(j), Q = Ce(j); 23605 if (!Number.isFinite(H)) 23606 return; 23607 if (me != null) { 23608 const Se = p.enabled ? this.getLabelText(p, { 23609 value: me, 23610 datum: J, 23611 xKey: r, 23612 yKey: a, 23613 xName: c, 23614 yName: u, 23615 legendItemName: y 23616 }) : void 0; 23617 q.push({ 23618 series: this, 23619 datum: J, 23620 datumIndex: j, 23621 yKey: a, 23622 xKey: r, 23623 point: { x: H, y: Q, size: I }, 23624 midPoint: { x: H, y: Q }, 23625 cumulativeValue: V, 23626 yValue: me, 23627 xValue: ne, 23628 capDefaults: te,
23629 labelText: Se, 23630 selected: X 23631 }); 23632 } 23633 if ($ == null) 23634 return; 23635 const re = $[$.length - 1]; 23636 if (me != null) { 23637 const Se = { 23638 point: { x: H, y: Q }, 23639 xDatum: ne, 23640 yDatum: me 23641 }; 23642 Array.isArray(re) ? re.push(Se) : re != null ? (re.skip += 1, $.push([Se])) : $.push([Se]); 23643 } else f || (Array.isArray(re) || re == null ? $.push({ skip: 0 }) : re.skip += 1); 23644 }, [E, P] = C.range, G = P - E, K = s?.find((j) => j.maxRange > G)?.indices; 23645 let [ce, ae] = this.visibleRangeIndices(n.range, K); 23646 ce = Math.max(ce - 1, 0), ae = Math.min(ae + 1, K?.length ?? k.length), t.rawData.length < 1e3 && (ce = 0, ae = t.rawData.length), K == null && ($ = []); 23647 for (let j = ce; j < ae; j += 1) 23648 T(K?.[j] ?? j); 23649 const be = $?.flatMap((j) => Array.isArray(j) ? Ym(j, m) : []), oe = be != null ? { itemId: a, spans: be } : void 0, U = se?.some((j, J) => j === B[J]) ?? !1; 23650 return { 23651 itemId: a, 23652 nodeData: q, 23653 labelData: q, 23654 strokeData: oe, 23655 scales: this.calculateScaling(), 23656 visible: this.visible, 23657 crossFiltering: U 23658 }; 23659 } 23660 isPathOrSelectionDirty() { 23661 return this.properties.marker.isDirty(); 23662 } 23663 markerFactory() { 23664 const { shape: e } = this.properties.marker, t = bo(e); 23665 return new t(); 23666 } 23667 updatePathNodes(e) { 23668 const { 23669 paths: [t], 23670 opacity: i, 23671 visible: s, 23672 animationEnabled: n 23673 } = e, o = this.contextNodeData?.crossFiltering === !0; 23674 t.setProperties({ 23675 fill: void 0, 23676 lineJoin: "round", 23677 pointerEvents: 1, 23678 opacity: i, 23679 stroke: this.properties.stroke, 23680 strokeWidth: this.getStrokeWidth(this.properties.strokeWidth), 23681 strokeOpacity: this.properties.strokeOpacity * (o ? kK : 1), 23682 lineDash: this.properties.lineDash, 23683 lineDashOffset: this.properties.lineDashOffset 23684 }), n || (t.visible = s), Zm(this, t); 23685 } 23686 updateMarkerSelection(e) { 23687 let { nodeData: t } = e; 23688 const { markerSelection: i } = e; 23689 return t = this.properties.marker.enabled || this.contextNodeData?.crossFiltering === !0 ? t : [], this.properties.marker.isDirty() && (i.clear(), i.cleanup()), i.update(t, void 0, (n) => ps(n.xValue)); 23690 } 23691 updateMarkerNodes(e) { 23692 const { markerSelection: t, isHighlight: i } = e, { xKey: s, yKey: n, stroke: o, strokeWidth: r, strokeOpacity: a, marker: l, highlightStyle: c } = this.properties, u = this.getSeriesDomain( 23693 "x" 23694 /* X */ 23695 ), d = this.getSeriesDomain( 23696 "y" 23697 /* Y */ 23698 ), p = ht(i && c.item, l.getStyle(), { 23699 stroke: o, 23700 strokeWidth: r, 23701 strokeOpacity: a 23702 }), f = this.ctx.animationManager.isSkipped(); 23703 t.each((m, y) => { 23704 this.updateMarkerStyle( 23705 m, 23706 l, 23707 { ...pl(y, s, n, u, d), highlighted: i }, 23708 p, 23709 { applyTranslation: f, selected: y.selected } 23710 ); 23711 }), i || l.markClean(); 23712 } 23713 updateLabelSelection(e) { 23714 return e.labelSelection.update(this.isLabelEnabled() ? e.labelData : []); 23715 } 23716 updateLabelNodes(e) { 23717 const { enabled: t, fontStyle: i, fontWeight: s, fontSize: n, fontFamily: o, color: r } = this.properties.label; 23718 e.labelSelection.each((a, l) => { 23719 t && l?.labelText ? (a.fontStyle = i, a.fontWeight = s, a.fontSize = n, a.fontFamily = o, a.textAlign = "center", a.textBaseline = "bottom", a.text = l.labelText, a.x = l.point.x, a.y = l.point.y - 10, a.fill = r, a.visible = !0) : a.visible = !1; 23720 }); 23721 } 23722 getTooltipContent(e) { 23723 const { id: t, dataModel: i, processedData: s, axes: n, properties: o } = this, { xKey: r, xName: a, yKey: l, yName: c, tooltip: u } = o, d = n.x, p = n.y; 23724 if (!i || !s || s.rawData.length === 0 || !d || !p) 23725 return; 23726 const { datumIndex: f } = e, m = s.rawData[f], y = i.resolveColumnById(this, "xValue", s)[f], b = i.resolveColumnById(this, "yValueRaw", s)[f]; 23727 if (y != null) 23728 return u.formatTooltip( 23729 { 23730 heading: d.formatDatum(y), 23731 symbol: this.legendItemSymbol(), 23732 data: [{ label: c, fallbackLabel: l, value: p.formatDatum(b) }] 23733 }, 23734 { 23735 seriesId: t, 23736 datum: m, 23737 title: c, 23738 xKey: r, 23739 xName: a, 23740 yKey: l, 23741 yName: c, 23742 ...this.getModuleTooltipParams() 23743 } 23744 ); 23745 } 23746 legendItemSymbol() { 23747 const e = "rgba(0, 0, 0, 0)", { stroke: t, strokeOpacity: i, strokeWidth: s, lineDash: n, marker: o } = this.properties; 23748 return { 23749 marker: { 23750 shape: o.shape, 23751 fill: o.fill ?? e, 23752 stroke: o.stroke ?? t ?? e, 23753 fillOpacity: o.fillOpacity ?? 1, 23754 strokeOpacity: o.strokeOpacity ?? i ?? 1, 23755 strokeWidth: o.strokeWidth ?? 0, 23756 enabled: o.enabled 23757 }, 23758 line: { 23759 stroke: t ?? e, 23760 strokeOpacity: i, 23761 strokeWidth: s, 23762 lineDash: n 23763 } 23764 }; 23765 } 23766 getLegendData(e) { 23767 if (!(this.properties.isValid() && e === "category")) 23768 return []; 23769 const { 23770 id: t, 23771 ctx: { legendManager: i }, 23772 visible: s 23773 } = this, { yKey: n, yName: o, title: r, legendItemName: a, showInLegend: l } = this.properties; 23774 return [ 23775 {
23776 legendType: "category", 23777 id: t, 23778 itemId: n, 23779 legendItemName: a, 23780 seriesId: t, 23781 enabled: s && i.getItemEnabled({ seriesId: t, itemId: n }), 23782 label: { 23783 text: a ?? r ?? o ?? n 23784 }, 23785 symbol: this.legendItemSymbol(), 23786 hideInLegend: !l 23787 } 23788 ]; 23789 } 23790 updatePaths(e) { 23791 this.updateLinePaths(e.paths, e.contextData); 23792 } 23793 plotNodeDataPoints(e, t) { 23794 if (t.length === 0) 23795 return; 23796 const i = t[0].point; 23797 e.moveTo(i.x, i.y); 23798 for (let s = 1; s < t.length; s += 1) { 23799 const { x: n, y: o } = t[s].point; 23800 e.lineTo(n, o); 23801 } 23802 } 23803 updateLinePaths(e, t) { 23804 const i = t.strokeData?.spans, [s] = e; 23805 s.path.clear(), i != null ? a1(s, i) : this.plotNodeDataPoints(s.path, t.nodeData), s.markDirty(); 23806 } 23807 animateEmptyUpdateReady(e) { 23808 const { markerSelection: t, labelSelection: i, annotationSelections: s, contextData: n, paths: o } = e, { animationManager: r } = this.ctx; 23809 this.updateLinePaths(o, n), h1(this, r, ...o), zi([t], zp), d1(this, r, t), Et(this, "labels", r, i), Et(this, "annotations", r, ...s); 23810 } 23811 animateReadyResize(e) { 23812 const { contextData: t, paths: i } = e; 23813 this.updateLinePaths(i, t), super.animateReadyResize(e); 23814 } 23815 animateWaitingUpdateReady(e) { 23816 const { animationManager: t } = this.ctx, { 23817 markerSelection: i, 23818 labelSelection: s, 23819 annotationSelections: n, 23820 contextData: o, 23821 paths: r, 23822 previousContextData: a 23823 } = e, [l] = r; 23824 this.resetMarkerAnimation(e), this.resetLabelAnimation(e); 23825 const c = () => { 23826 this.resetPathAnimation(e), this.updateLinePaths(r, o); 23827 }, u = () => { 23828 t.skipCurrentBatch(), c(); 23829 }; 23830 if (o == null || a == null) { 23831 c(), Gp(this, t, "added", i), Km(this, "path_properties", t, "add", l), Et(this, "labels", t, s), Et(this, "annotations", t, ...n); 23832 return; 23833 } 23834 if (o.crossFiltering !== a.crossFiltering) { 23835 u(); 23836 return; 23837 } 23838 const d = w2( 23839 o, 23840 a, 23841 this.processedData?.reduced?.diff?.[this.id] 23842 ); 23843 if (d === void 0) { 23844 u(); 23845 return; 23846 } else if (d.status === "no-op") 23847 return; 23848 Mi(this.id, "path_properties", t, [l], d.stroke.pathProperties), d.status === "added" ? this.updateLinePaths(r, o) : d.status === "removed" ? this.updateLinePaths(r, a) : $m(this.id, "path_update", t, [l], d.stroke.path), d.hasMotion && (Gp(this, t, void 0, i), Et(this, "labels", t, s), Et(this, "annotations", t, ...n)); 23849 } 23850 isLabelEnabled() { 23851 return this.properties.label.enabled; 23852 } 23853 getBandScalePadding() { 23854 return { inner: 1, outer: 0.1 }; 23855 } 23856 nodeFactory() { 23857 return new Ye(); 23858 } 23859 getFormattedMarkerStyle(e) { 23860 const { xKey: t, yKey: i } = this.properties, s = this.getSeriesDomain( 23861 "x" 23862 /* X */ 23863 ), n = this.getSeriesDomain( 23864 "y" 23865 /* Y */ 23866 ); 23867 return this.getMarkerStyle(this.properties.marker, { 23868 ...pl(e, t, i, s, n), 23869 highlighted: !0 23870 }); 23871 } 23872 computeFocusBounds(e) { 23873 return xg(this, e); 23874 } 23875}; 23876By.className = "LineSeries"; 23877By.type = "line"; 23878var O2 = { 23879 type: "series", 23880 optionsKey: "series[]", 23881 packageType: "community", 23882 chartTypes: ["cartesian"], 23883 identifier: "line", 23884 moduleFactory: (e) => new By(e), 23885 stackable: !0, 23886 tooltipDefaults: { range: "nearest" }, 23887 defaultAxes: [ 23888 { 23889 type: "number", 23890 position: "left" 23891 /* LEFT */ 23892 }, 23893 { 23894 type: "category", 23895 position: "bottom" 23896 /* BOTTOM */ 23897 } 23898 ], 23899 themeTemplate: { 23900 series: { 23901 tooltip: { position: { type: "node" } }, 23902 strokeWidth: 2, 23903 strokeOpacity: 1, 23904 lineDash: [0], 23905 lineDashOffset: 0, 23906 interpolation: { 23907 type: "linear", 23908 // @ts-expect-error - users shouldn't specify all options, but we have to for theming to work 23909 tension: 1, 23910 position: "end" 23911 }, 23912 marker: { 23913 shape: "circle", 23914 size: 7, 23915 strokeWidth: 0 23916 }, 23917 label: { 23918 enabled: !1, 23919 fontSize: 12, 23920 fontFamily: Si, 23921 color: Zi 23922 }, 23923 errorBar: { 23924 cap: { 23925 lengthRatio: 1 23926 } 23927 } 23928 } 23929 }, 23930 paletteFactory: (e) => { 23931 const { marker: t } = n1(e); 23932 return { stroke: t.fill, marker: t }; 23933 } 23934}, N2 = class extends ts { 23935 constructor() { 23936 super(...arguments), this.placement = "top"; 23937 } 23938}; 23939S([ 23940 D(jS) 23941], N2.prototype, "placement", 2); 23942var Ci = class extends Da { 23943 constructor() { 23944 super(...arguments), this.colorRange = ["#ffff00", "#00ff00", "#0000ff"], this.label = new
23944N2(), this.tooltip = new Ls(), this.marker = new En(); 23945 } 23946}; 23947S([ 23948 D(Me) 23949], Ci.prototype, "xKey", 2); 23950S([ 23951 D(Me) 23952], Ci.prototype, "yKey", 2); 23953S([ 23954 D(Me, { optional: !0 }) 23955], Ci.prototype, "labelKey", 2); 23956S([ 23957 D(Me, { optional: !0 }) 23958], Ci.prototype, "colorKey", 2); 23959S([ 23960 D(Me, { optional: !0 }) 23961], Ci.prototype, "xFilterKey", 2); 23962S([ 23963 D(Me, { optional: !0 }) 23964], Ci.prototype, "yFilterKey", 2); 23965S([ 23966 D(Me, { optional: !0 }) 23967], Ci.prototype, "xName", 2); 23968S([ 23969 D(Me, { optional: !0 }) 23970], Ci.prototype, "yName", 2); 23971S([ 23972 D(Me, { optional: !0 }) 23973], Ci.prototype, "labelName", 2); 23974S([ 23975 D(Me, { optional: !0 }) 23976], Ci.prototype, "colorName", 2); 23977S([ 23978 D(Uv, { optional: !0 }) 23979], Ci.prototype, "colorDomain", 2); 23980S([ 23981 D(xo) 23982], Ci.prototype, "colorRange", 2); 23983S([ 23984 D(Me, { optional: !0 }) 23985], Ci.prototype, "title", 2); 23986S([ 23987 Ri("marker.shape") 23988], Ci.prototype, "shape", 2); 23989S([ 23990 Ri("marker.size") 23991], Ci.prototype, "size", 2); 23992S([ 23993 Ri("marker.fill") 23994], Ci.prototype, "fill", 2); 23995S([ 23996 Ri("marker.fillOpacity") 23997], Ci.prototype, "fillOpacity", 2); 23998S([ 23999 Ri("marker.stroke") 24000], Ci.prototype, "stroke", 2); 24001S([ 24002 Ri("marker.strokeWidth") 24003], Ci.prototype, "strokeWidth", 2); 24004S([ 24005 Ri("marker.strokeOpacity") 24006], Ci.prototype, "strokeOpacity", 2); 24007S([ 24008 Ri("marker.itemStyler", { optional: !0 }) 24009], Ci.prototype, "itemStyler", 2); 24010S([ 24011 D(Be) 24012], Ci.prototype, "label", 2); 24013S([ 24014 D(Be) 24015], Ci.prototype, "tooltip", 2); 24016var x1 = class extends Fl { 24017 constructor(e) { 24018 super({ 24019 moduleCtx: e, 24020 directionKeys: Kc, 24021 directionNames: Zc, 24022 pickModes: [ 24023 2, 24024 1, 24025 0 24026 /* EXACT_SHAPE_MATCH */ 24027 ], 24028 pathsPerSeries: [], 24029 hasMarkers: !0, 24030 markerSelectionGarbageCollection: !1, 24031 animationResetFns: { 24032 marker: Sg, 24033 label: Ra 24034 }, 24035 usesPlacedLabels: !0 24036 }), this.clipFocusBox = !1, this.properties = new Ci(), this.colorScale = new Wc(); 24037 } 24038 get pickModeAxis() { 24039 return "main-category"; 24040 } 24041 async processData(e) { 24042 if (!this.properties.isValid() || this.data == null || !this.visible) 24043 return; 24044 const t = this.axes.x?.scale, i = this.axes.y?.scale, { xScaleType: s, yScaleType: n } = this.getScaleInformation({ xScale: t, yScale: i }), o = this.colorScale.type, { xKey: r, yKey: a, xFilterKey: l, yFilterKey: c, labelKey: u, colorKey: d, colorDomain: p, colorRange: f } = this.properties, { dataModel: m, processedData: y } = await this.requestDataModel(e, this.data, { 24045 props: [ 24046 pt(r, s, { id: "xValue" }), 24047 pt(a, n, { id: "yValue" }), 24048 ...l != null ? [pt(l, s, { id: "xFilterValue" })] : [], 24049 ...c != null ? [pt(c, n, { id: "yFilterValue" })] : [], 24050 ...d ? [pt(d, o, { id: "colorValue" })] : [], 24051 ...u ? [pt(u, "band", { id: "labelValue" })] : [] 24052 ] 24053 }); 24054 if (d) { 24055 const b = m.resolveProcessedDataIndexById(this, "colorValue"); 24056 this.colorScale.domain = p ?? y.domain.values[b] ?? [], this.colorScale.range = f, this.colorScale.update(); 24057 } 24058 this.animationState.transition("updateData"); 24059 } 24060 getSeriesDomain(e) { 24061 const { dataModel: t, processedData: i } = this; 24062 if (!i || !t) 24063 return []; 24064 const s = e === "x" ? "xValue" : "yValue", n = t.resolveProcessedDataDefById(this, s), o = t.getDomain(this, s, "value", i); 24065 return n?.def.type === "value" && n?.def.valueType === "category" ? o : vn(ma(o)); 24066 } 24067 getSeriesRange(e, t) { 24068 return [NaN, NaN]; 24069 } 24070 createNodeData() { 24071 const { axes: e, dataModel: t, processedData: i, colorScale: s, visible: n } = this, { xKey: o, yKey: r, xFilterKey: a, yFilterKey: l, labelKey: c, colorKey: u, xName: d, yName: p, labelName: f, marker: m, label: y } = this.properties, { placement: b } = y, C = bo(m.shape), w = e.x, M = e.y; 24072 if (!(t && i?.rawData.length && n && w && M)) 24073 return; 24074 const A = t.resolveColumnById(this, "xValue", i), I = t.resolveColumnById(this, "yValue", i), L = u != null ? t.resolveColumnById(this, "colorValue", i) : void 0, k = c != null ? t.resolveColumnById(this, "labelValue", i) : void 0, B = a != null ? t.resolveColumnById(this, "xFilterValue", i) : void 0, N = l != null ? t.resolve
24074ColumnById(this, "yFilterValue", i) : void 0, W = w.scale, se = M.scale, ue = (W.bandwidth ?? 0) / 2, Ce = (se.bandwidth ?? 0) / 2, te = [], q = y.getFont(), $ = wa.getMeasurer({ font: q }); 24075 return i.rawData.forEach((T, E) => { 24076 const P = A[E], G = I[E], _ = W.convert(P) + ue, K = se.convert(G) + Ce, ce = B != null && N != null ? B[E] === P && N[E] === G : void 0, ae = this.getLabelText(y, { 24077 value: k != null ? k?.[E] : G, 24078 datum: T, 24079 xKey: o, 24080 yKey: r, 24081 labelKey: c, 24082 xName: d, 24083 yName: p, 24084 labelName: f 24085 }), be = $.measureText(ae), oe = L != null ? s.convert(L[E]) : void 0; 24086 te.push({ 24087 series: this, 24088 itemId: r, 24089 yKey: r, 24090 xKey: o, 24091 datum: T, 24092 datumIndex: E, 24093 xValue: P, 24094 yValue: G, 24095 capDefaults: { lengthRatioMultiplier: m.getDiameter(), lengthMax: 1 / 0 }, 24096 point: { x: _, y: K, size: m.size }, 24097 midPoint: { x: _, y: K }, 24098 fill: oe, 24099 label: { text: ae, ...be }, 24100 marker: C, 24101 placement: b, 24102 selected: ce 24103 }); 24104 }), { 24105 itemId: r, 24106 nodeData: te, 24107 labelData: te, 24108 scales: this.calculateScaling(), 24109 visible: this.visible 24110 }; 24111 } 24112 isPathOrSelectionDirty() { 24113 return this.properties.marker.isDirty(); 24114 } 24115 getLabelData() { 24116 return this.isLabelEnabled() ? this.contextNodeData?.labelData ?? [] : []; 24117 } 24118 markerFactory() { 24119 const { shape: e } = this.properties.marker, t = bo(e); 24120 return new t(); 24121 } 24122 updateMarkerSelection(e) { 24123 const { nodeData: t, markerSelection: i } = e; 24124 return this.properties.marker.isDirty() && (i.clear(), i.cleanup()), i.update(this.properties.marker.enabled ? t : []); 24125 } 24126 getMarkerItemBaseStyle(e) { 24127 const { properties: t } = this, { marker: i } = t, s = e ? t.highlightStyle.item : void 0; 24128 return { 24129 fill: s?.fill ?? i.fill, 24130 fillOpacity: s?.fillOpacity ?? i.fillOpacity, 24131 stroke: s?.stroke ?? i.stroke, 24132 strokeWidth: s?.strokeWidth ?? i.strokeWidth, 24133 strokeOpacity: s?.strokeOpacity ?? i.strokeOpacity 24134 }; 24135 } 24136 getMarkerItemStyleOverrides(e, t, i, s) { 24137 const { id: n, properties: o } = this, { xKey: r, yKey: a, labelKey: l, marker: c } = o, { itemStyler: u } = c; 24138 if (u != null) 24139 return this.cachedDatumCallback(ps(e, s ? "highlight" : "node"), () => u({ 24140 seriesId: n, 24141 datum: t, 24142 xKey: r, 24143 yKey: a, 24144 labelKey: l, 24145 highlighted: s, 24146 ...i 24147 })); 24148 } 24149 updateMarkerNodes(e) { 24150 const { markerSelection: t, isHighlight: i } = e, { xKey: s, yKey: n, labelKey: o, marker: r, highlightStyle: a } = this.properties, l = ht(i && a.item, r.getStyle()); 24151 t.each((c, u) => { 24152 this.updateMarkerStyle(c, r, { datum: u, highlighted: i, xKey: s, yKey: n, labelKey: o }, l, { 24153 selected: u.selected 24154 }); 24155 }), i || r.markClean(); 24156 } 24157 updatePlacedLabelData(e) { 24158 this.labelSelection.update( 24159 e.map((t) => ({ 24160 ...t.datum, 24161 point: { 24162 x: t.x, 24163 y: t.y, 24164 size: t.datum.point.size 24165 } 24166 })), 24167 (t) => { 24168 t.pointerEvents = 1; 24169 } 24170 ), this.updateLabelNodes({ labelSelection: this.labelSelection }); 24171 } 24172 updateLabelNodes(e) { 24173 const { label: t } = this.properties; 24174 e.labelSelection.each((i, s) => { 24175 i.text = s.label.text, i.fill = t.color, i.x = s.point?.x ?? 0, i.y = s.point?.y ?? 0, i.fontStyle = t.fontStyle, i.fontWeight = t.fontWeight, i.fontSize = t.fontSize, i.fontFamily = t.fontFamily, i.textAlign = "left", i.textBaseline = "top"; 24176 }); 24177 } 24178 getTooltipContent(e) { 24179 const { id: t, dataModel: i, processedData: s, axes: n, properties: o } = this, { xKey: r, xName: a, yKey: l, yName: c, labelKey: u, labelName: d, title: p, tooltip: f } = o, m = n.x, y = n.y; 24180 if (!i || !s || s.rawData.length === 0 || !m || !y) 24181 return; 24182 const { datumIndex: b } = e, C = s.rawData[b], w = i.resolveColumnById(this, "xValue", s)[b], M = i.resolveColumnById(this, "yValue", s)[b]; 24183 if (w == null) 24184 return; 24185 const A = this.getMarkerItemBaseStyle(!1); 24186 return Object.assign(A, this.getMarkerItemStyleOverrides(String(b), C, A, !1)), f.formatTooltip( 24187 { 24188 symbol: this.legendItemSymbol(), 24189 title: p, 24190 data: [ 24191 { label: a, fallbackLabel: r, value: m.formatDatum(w) }, 24192 { label: c, fallbackLabel: l, value: y.formatDatum(M) } 24193 ] 24194 }, 24195 { 24196 seriesId: t, 24197 datum: C, 24198 title: c, 24199 xKey: r, 24200 xName: a, 24201 yKey: l, 24202 yName: c, 24203 labelKey: u, 24204 labelName: d, 24205 ...A, 24206 ...this.getModuleTooltipParams() 24207 } 24208 ); 24209 } 24210 legendItemSymbol() { 24211 const { shape: e, fill: t, stroke: i, fillOpacity: s, strokeOpacity: n, strokeWidth: o } = this.properties.marker; 24212 return { 24213 marker: { 24214 shape: e, 24215 fill: t ?? "rgba(0, 0, 0, 0)", 24216 stroke: i ?? "rgba(0, 0, 0, 0)", 24217 fillOpacity: s ?? 1, 24218 strokeOpacity: n ?? 1, 24219 strokeWidth: o ?? 0 24220 } 24221 }; 24222 } 24223 getLegendData(e) { 24224 if (!this.properties.isValid() || e !== "category") 24225 return []; 24226 const { yKey: t, yName: i, title: s, showInLegend: n } = this.properties, { 24227 id: o, 24228 ctx: { legendManager: r }, 24229 visible: a 24230 } = this; 24231 return [ 24232 {
24233 legendType: "category", 24234 id: o, 24235 itemId: t, 24236 seriesId: o, 24237 enabled: a && r.getItemEnabled({ seriesId: o, itemId: t }), 24238 label: { 24239 text: s ?? i ?? t 24240 }, 24241 symbol: this.legendItemSymbol(), 24242 hideInLegend: !n 24243 } 24244 ]; 24245 } 24246 animateEmptyUpdateReady(e) { 24247 const { markerSelection: t, labelSelection: i, annotationSelections: s } = e; 24248 u1(this, this.ctx.animationManager, t), Et(this, "labels", this.ctx.animationManager, i), Et(this, "annotations", this.ctx.animationManager, ...s); 24249 } 24250 isLabelEnabled() { 24251 return this.properties.label.enabled; 24252 } 24253 nodeFactory() { 24254 return new Ye(); 24255 } 24256 getFormattedMarkerStyle(e) { 24257 const { xKey: t, yKey: i, labelKey: s } = this.properties; 24258 return this.getMarkerStyle(this.properties.marker, { datum: e, xKey: t, yKey: i, labelKey: s, highlighted: !0 }); 24259 } 24260 computeFocusBounds(e) { 24261 return xg(this, e); 24262 } 24263}; 24264x1.className = "ScatterSeries"; 24265x1.type = "scatter"; 24266var PK = { 24267 type: "series", 24268 optionsKey: "series[]", 24269 packageType: "community", 24270 chartTypes: ["cartesian"], 24271 identifier: "scatter", 24272 moduleFactory: (e) => new x1(e), 24273 tooltipDefaults: { range: "nearest" }, 24274 defaultAxes: [ 24275 { 24276 type: "number", 24277 position: "bottom" 24278 /* BOTTOM */ 24279 }, 24280 { 24281 type: "number", 24282 position: "left" 24283 /* LEFT */ 24284 } 24285 ], 24286 themeTemplate: { 24287 series: { 24288 shape: "circle", 24289 size: 7, 24290 fillOpacity: 0.8, 24291 tooltip: { position: { type: "node" } }, 24292 label: { 24293 enabled: !1, 24294 fontSize: 12, 24295 fontFamily: Si, 24296 color: Zi 24297 }, 24298 errorBar: { 24299 cap: { 24300 lengthRatio: 1 24301 } 24302 } 24303 } 24304 }, 24305 paletteFactory: wg 24306}, _2 = class Rw { 24307 constructor(t, i, s, n) { 24308 this.startAngle = t, this.endAngle = i, this.innerRadius = s, this.outerRadius = n; 24309 } 24310 clone() { 24311 const { startAngle: t, endAngle: i, innerRadius: s, outerRadius: n } = this; 24312 return new Rw(t, i, s, n); 24313 } 24314 equals(t) { 24315 return this.startAngle === t.startAngle && this.endAngle === t.endAngle && this.innerRadius === t.innerRadius && this.outerRadius === t.outerRadius; 24316 } 24317 [Lv](t, i) { 24318 return new Rw( 24319 this.startAngle * (1 - i) + t.startAngle * i, 24320 this.endAngle * (1 - i) + t.endAngle * i, 24321 this.innerRadius * (1 - i) + t.innerRadius * i, 24322 this.outerRadius * (1 - i) + t.outerRadius * i 24323 ); 24324 } 24325}; 24326function M1({ startAngle: e, endAngle: t, innerRadius: i, outerRadius: s }) { 24327 let n = 1 / 0, o = 1 / 0, r = -1 / 0, a = -1 / 0; 24328 const l = (c, u) => { 24329 n = Math.min(c, n), o = Math.min(u, o), r = Math.max(c, r), a = Math.max(u, a); 24330 }; 24331 return l(i * Math.cos(e), i * Math.sin(e)), l(i * Math.cos(t), i * Math.sin(t)), l(s * Math.cos(e), s * Math.sin(e)), l(s * Math.cos(t), s * Math.sin(t)), uo(0, e, t) && l(s, 0), uo(Math.PI * 0.5, e, t) && l(0, s), uo(Math.PI, e, t) && l(-s, 0), uo(Math.PI * 1.5, e, t) && l(0, -s), new _e(n, o, r - n, a - o); 24332} 24333function qm(e, t, i) { 24334 const s = Math.sqrt(Math.pow(e, 2) + Math.pow(t, 2)), { innerRadius: n, outerRadius: o } = i; 24335 if (i.startAngle === i.endAngle || s < Math.min(n, o) || s > Math.max(n, o)) 24336 return !1; 24337 const r = Rp(i.startAngle), a = Rp(i.endAngle), l = Math.atan2(t, e); 24338 return r < a ? l <= a && l >= r : l <= a && l >= -Math.PI || l >= r && l <= Math.PI; 24339} 24340function wR(e, t) { 24341 const { startAngle: i, endAngle: s, innerRadius: n, outerRadius: o } = t, r = { x: o * Math.cos(i), y: o * Math.sin(i) }, a = { x: o * Math.cos(s), y: o * Math.sin(s) }, l = n === 0 ? { x: 0, y: 0 } : { x: n * Math.cos(i), y: n * Math.sin(i) }, c = n === 0 ? { x: 0, y: 0 } : { x: n * Math.cos(s), y: n * Math.sin(s) }; 24342 return Yu( 24343 e.start.x, 24344 e.start.y, 24345 e.end.x, 24346 e.end.y, 24347 r.x, 24348 r.y, 24349 l.x, 24350 l.y 24351 ) || Yu( 24352 e.start.x, 24353 e.start.y, 24354 e.end.x, 24355 e.end.y, 24356 a.x, 24357 a.y, 24358 c.x, 24359 c.y 24360 ) || pF( 24361 0, 24362 0, 24363 o, 24364 i, 24365 s, 24366 !0, 24367 e.start.x, 24368 e.start.y, 24369 e.end.x, 24370 e.end.y 24371 ); 24372} 24373function B2(e, t) { 24374 const i = { x: e.x, y: e.y }, s = { x: e.x + e.width, y: e.y }, n = { x: e.x, y: e.y + e.height }, o = { x: e.x + e.width, y: e.y + e.height }; 24375 return wR({ start: i, end: s }, t) || wR({ start: n, end: o }, t); 24376} 24377function SR(e, t, i, s) { 24378 if (i === 0 && s === 0) 24379 return 0; 24380 if (Math.asin(Math.abs(1 * i) / (e + 1 * i)) + Math.asin(Math.abs(1 * s) / (e + 1 *
24380s)) - t < 0) 24381 return 1; 24382 let o = 0, r = 1; 24383 for (let a = 0; a < 8; a += 1) { 24384 const l = (o + r) / 2; 24385 Math.asin(Math.abs(l * i) / (e + l * i)) + Math.asin(Math.abs(l * s) / (e + l * s)) - t < 0 ? o = l : r = l; 24386 } 24387 return o; 24388} 24389var FK = 1e-6; 24390function ml(e, t) { 24391 return pg(e, t) < FK ? t : zt(e - t) + t; 24392} 24393function Pf(e, t, i = 0) { 24394 const n = Math.abs(t - e) >= 2 * Math.PI ? 2 * Math.PI : zt(t - e); 24395 return e = ml(e, i), t = e + n, { startAngle: e, endAngle: t }; 24396} 24397function Ff(e, t, i, s, n, o) { 24398 const r = Math.sin(o), a = Math.cos(o), l = e ** 2 + t ** 2 - i ** 2; 24399 let c, u, d, p; 24400 if (a > 0.5) { 24401 const M = r / a, A = 1 + M ** 2, I = -2 * (e + t * M), L = I ** 2 - 4 * A * l; 24402 if (L < 0) 24403 return; 24404 const k = (-I + Math.sqrt(L)) / (2 * A), B = (-I - Math.sqrt(L)) / (2 * A); 24405 c = k, u = k * M, d = B, p = B * M; 24406 } else { 24407 const M = a / r, A = 1 + M ** 2, I = -2 * (t + e * M), L = I ** 2 - 4 * A * l; 24408 if (L < 0) 24409 return; 24410 const k = (-I + Math.sqrt(L)) / (2 * A), B = (-I - Math.sqrt(L)) / (2 * A); 24411 c = k * M, u = k, d = B * M, p = B; 24412 } 24413 const f = a, m = r, y = c * f + u * m, b = d * f + p * m, C = y > 0 ? ml(Math.atan2(u - t, c - e), s) : NaN, w = b > 0 ? ml(Math.atan2(p - t, d - e), s) : NaN; 24414 if (C >= s && C <= n) 24415 return C; 24416 if (w >= s && w <= n) 24417 return w; 24418} 24419function Of(e, t, i, s, n, o) { 24420 const r = Math.hypot(e, t), a = (r ** 2 - i ** 2 + o ** 2) / (2 * r), l = r - a, c = Math.atan2(t, e), u = Math.acos(-l / i), d = ml(c + u, s), p = ml(c - u, s); 24421 if (d >= s && d <= n) 24422 return d; 24423 if (p >= s && p <= n) 24424 return p; 24425} 24426var i0 = class { 24427 constructor(e, t, i, s, n) { 24428 this.cx = e, this.cy = t, this.r = i, this.a0 = s, this.a1 = n, this.a0 >= this.a1 && (this.a0 = NaN, this.a1 = NaN); 24429 } 24430 isValid() { 24431 return Number.isFinite(this.a0) && Number.isFinite(this.a1); 24432 } 24433 pointAt(e) { 24434 return { 24435 x: this.cx + this.r * Math.cos(e), 24436 y: this.cy + this.r * Math.sin(e) 24437 }; 24438 } 24439 clipStart(e) { 24440 e == null || !this.isValid() || e < this.a0 || (this.a0 = e, (Number.isNaN(e) || this.a0 >= this.a1) && (this.a0 = NaN, this.a1 = NaN)); 24441 } 24442 clipEnd(e) { 24443 e == null || !this.isValid() || e > this.a1 || (this.a1 = e, (Number.isNaN(e) || this.a0 >= this.a1) && (this.a0 = NaN, this.a1 = NaN)); 24444 } 24445}, as = class extends sn { 24446 constructor() { 24447 super(...arguments), this.centerX = 0, this.centerY = 0, this.innerRadius = 10, this.outerRadius = 20, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clipSector = void 0, this.concentricEdgeInset = 0, this.radialEdgeInset = 0, this.startOuterCornerRadius = 0, this.endOuterCornerRadius = 0, this.startInnerCornerRadius = 0, this.endInnerCornerRadius = 0; 24448 } 24449 set inset(e) { 24450 this.concentricEdgeInset = e, this.radialEdgeInset = e; 24451 } 24452 set cornerRadius(e) { 24453 this.startOuterCornerRadius = e, this.endOuterCornerRadius = e, this.startInnerCornerRadius = e, this.endInnerCornerRadius = e; 24454 } 24455 computeBBox() { 24456 return M1(this).translate(this.centerX, this.centerY); 24457 } 24458 normalizedRadii() { 24459 const { concentricEdgeInset: e } = this; 24460 let { innerRadius: t, outerRadius: i } = this; 24461 return t = t > 0 ? t + e : 0, i = Math.max(i - e, 0), { innerRadius: t, outerRadius: i }; 24462 } 24463 normalizedClipSector() { 24464 const { clipSector: e } = this; 24465 if (e == null) 24466 return; 24467 const { startAngle: t, endAngle: i } = Pf(this.startAngle, this.endAngle), { innerRadius: s, outerRadius: n } = this.normalizedRadii(), o = Pf(e.startAngle, e.endAngle, t); 24468 return new _2( 24469 Math.max(t, o.startAngle), 24470 Math.min(i, o.endAngle), 24471 Math.max(s, e.innerRadius), 24472 Math.min(n, e.outerRadius) 24473 ); 24474 } 24475 getAngleOffset(e) { 24476 return e > 0 ? this.radialEdgeInset / e : 0; 24477 } 24478 arc(e, t, i, s, n, o, r, a) { 24479 if (e <= 0) 24480 return; 24481 const { startAngle: l, endAngle: c } = Pf(this.startAngle, this.endAngle), { innerRadius: u, outerRadius: d } = this.normalizedRadii(), p = this.normalizedClipSector(); 24482 if (a && u <= 0) 24483 return; 24484 const f = a ? this.getAngleOffset(u + e) : this.getAngleOffset(d - e), m = r ? l + f + t : c - f - t, y = a ? u + e : d - e, b = y * Math.cos(m), C = y * Math.sin(m); 24485 if (p != null && (!r && !(m >= l - 1e-6 && m <= p.endAngle - 1e-6) || r && !(m >= p.startAngle + 1e-6 && m <= c - 1e-6) || a && y < p.innerRadius - 1e-6 || !a && y > p.outerRadius + 1e-6)) 24486 return; 24487 const w = new i0(b, C, e, i, s); 24488 if (p != null) { 24489 a ? (w.clipStart(Ff(b, C, e, i, s, p.endAngle)), w.clipEnd(Ff(b, C, e, i, s, p.startAngle))) : (w.clipStart(Ff(b, C, e, i, s, p.startAngle)), w.clipEnd(Ff(b, C, e, i, s, p.endAngle))); 24490 let k, B; 24491 if (r ? (k = Of(b, C, e, i, s, p.innerRadius), B = Of(b, C, e, i, s, p.outerRadius)) : (k
24491= Of(b, C, e, i, s, p.outerRadius), B = Of(b, C, e, i, s, p.innerRadius)), w.clipStart(k), w.clipEnd(B), k != null) { 24492 const { x: N, y: W } = w.pointAt(k), se = ml(Math.atan2(W, N), l); 24493 r ? o?.clipStart(se) : n.clipEnd(se); 24494 } 24495 if (B != null) { 24496 const { x: N, y: W } = w.pointAt(B), se = ml(Math.atan2(W, N), l); 24497 r ? n.clipStart(se) : o?.clipEnd(se); 24498 } 24499 } 24500 if (p != null) { 24501 const { x: k, y: B } = w.pointAt((w.a0 + w.a1) / 2); 24502 if (!qm(k, B, p)) 24503 return; 24504 } 24505 const { x: M, y: A } = w.pointAt(r === a ? w.a0 : w.a1), I = ml(Math.atan2(A, M), l), L = a ? o : n; 24506 return r ? L?.clipStart(I) : L?.clipEnd(I), w; 24507 } 24508 updatePath() { 24509 const { path: t, centerX: i, centerY: s, concentricEdgeInset: n, radialEdgeInset: o } = this; 24510 let { startOuterCornerRadius: r, endOuterCornerRadius: a, startInnerCornerRadius: l, endInnerCornerRadius: c } = this; 24511 const { startAngle: u, endAngle: d } = Pf(this.startAngle, this.endAngle), { innerRadius: p, outerRadius: f } = this.normalizedRadii(), m = this.normalizedClipSector(), y = d - u, b = y >= 2 * Math.PI - 1e-6; 24512 if (t.clear(), p === 0 && f === 0 || p > f) 24513 return; 24514 if ((m?.startAngle ?? u) === (m?.endAngle ?? d)) 24515 return; 24516 if (b && this.clipSector == null && r === 0 && a === 0 && l === 0 && c === 0) { 24517 t.moveTo(i + f * Math.cos(u), s + f * Math.sin(u)), t.arc(i, s, f, u, d), p > n && (t.moveTo(i + p * Math.cos(d), s + p * Math.sin(d)), t.arc(i, s, p, d, u, !0)), t.closePath(); 24518 return; 24519 } else if (this.clipSector == null && Math.abs(p - f) < 1e-6) { 24520 t.arc(i, s, f, u, d, !1), t.arc(i, s, f, d, u, !0), t.closePath(); 24521 return; 24522 } 24523 const C = this.getAngleOffset(p), w = this.getAngleOffset(f); 24524 if (y < 2 * w) 24525 return; 24526 const A = (m?.innerRadius ?? p) > n, I = p < n || y < 2 * C, L = f - p, k = Math.max( 24527 r, 24528 l, 24529 a, 24530 c 24531 ), B = k > 0 ? Math.min(L / k, 1) : 1; 24532 r *= B, a *= B, l *= B, c *= B; 24533 const N = SR( 24534 f, 24535 y - 2 * w, 24536 -r, 24537 -a 24538 ); 24539 if (r *= N, a *= N, !I && A) { 24540 const j = SR( 24541 p, 24542 y - 2 * C, 24543 l, 24544 c 24545 ); 24546 l *= j, c *= j; 24547 } else 24548 l = 0, c = 0; 24549 const W = Math.max( 24550 r + l, 24551 a + c 24552 ), se = W > 0 ? Math.min(L / W, 1) : 1; 24553 r *= se, a *= se, l *= se, c *= se; 24554 let ue = 0, Ce = 0; 24555 const te = r / (f - r), q = a / (f - a); 24556 if (te >= 0 && te < 1 - 1e-6) 24557 ue = Math.asin(te); 24558 else { 24559 ue = y / 2; 24560 const j = f / (1 / Math.sin(ue) + 1); 24561 r = Math.min(j, r); 24562 } 24563 if (q >= 0 && q < 1 - 1e-6) 24564 Ce = Math.asin(q); 24565 else { 24566 Ce = y / 2; 24567 const j = f / (1 / Math.sin(Ce) + 1); 24568 a = Math.min(j, a); 24569 } 24570 const $ = Math.asin( 24571 l / (p + l) 24572 ), T = Math.asin(c / (p + c)), E = m?.outerRadius ?? f, P = this.getAngleOffset(E), G = new i0( 24573 0, 24574 0, 24575 E, 24576 u + P, 24577 d - P 24578 ), _ = m?.innerRadius ?? p, K = this.getAngleOffset(_), ce = A ? new i0(0, 0, _, u + K, d - K) : void 0; 24579 m != null && (G.clipStart(m.startAngle), G.clipEnd(m.endAngle), ce?.clipStart(m.startAngle), ce?.clipEnd(m.endAngle)); 24580 const ae = this.arc( 24581 r, 24582 ue, 24583 u - Math.PI * 0.5, 24584 u + ue, 24585 G, 24586 ce, 24587 !0, 24588 !1 24589 ), be = this.arc( 24590 a, 24591 Ce, 24592 d - Ce, 24593 d + Math.PI * 0.5, 24594 G, 24595 ce, 24596 !1, 24597 !1 24598 ), oe = this.arc( 24599 c, 24600 T, 24601 d + Math.PI * 0.5, 24602 d + Math.PI - T, 24603 G, 24604 ce, 24605 !1, 24606 !0 24607 ), U = this.arc( 24608 l, 24609 $, 24610 u + Math.PI + $, 24611 u + Math.PI * 1.5, 24612 G, 24613 ce, 24614 !0, 24615 !0 24616 ); 24617 if (I) { 24618 const j = y < Math.PI * 0.5 ? o * (1 + Math.cos(y)) / Math.sin(y) : NaN; 24619 let J; 24620 j > 0 && j < f ? J = Math.max(Math.hypot(o, j), p) : J = o, J = Math.max(J, p); 24621 const ne = u + y * 0.5; 24622 t.moveTo(i + J * Math.cos(ne), s + J * Math.sin(ne)); 24623 } else if (!(U?.isValid() === !0 || ce?.isValid() === !0)) { 24624 const j = u + y / 2, J = p * Math.cos(j), ne = p * Math.sin(j); 24625 t.moveTo(i + J, s + ne); 24626 } 24627 if (ae?.isValid() === !0) { 24628 const { cx: j, cy: J, r: ne, a0: me, a1: V } = ae; 24629 t.arc(i + j, s + J, ne, me, V); 24630 } 24631 if (G.isValid()) { 24632 const { r: j, a0: J, a1: ne } = G; 24633 t.arc(i, s, j, J, ne); 24634 } 24635 if (be?.isValid() === !0) { 24636 const { cx: j, cy: J, r: ne, a0: me, a1: V } = be; 24637 t.arc(i + j, s + J, ne, me, V); 24638 } 24639 if (!I) { 24640 if (oe?.isValid() === !0) { 24641 const { cx: j, cy: J, r: ne, a0: me, a1: V } = oe; 24642 t.arc(i + j, s + J, ne, me, V); 24643 } 24644 if (ce?.isValid() === !0) { 24645 const { r: j, a0: J, a1: ne } = ce; 24646 t.arc(i, s, j, ne, J, !0); 24647 } 24648 if (U?.isValid() === !0) { 24649 const { cx: j, cy: J, r: ne, a0: me, a1: V } = U; 24650 t.arc(i + j, s + J, ne, me, V); 24651 } 24652 } 24653 t.closePath(); 24654 } 24655 isPointInPath(e, t) { 24656 const { startAngle: i, endAngle: s, innerRadius: n, outerRadius: o } = this.clipSector ?? this; 24657 return qm(e - this.centerX, t - this.centerY, { 24658 startAngle: i, 24659 endAngle: s, 24660 innerRadius: Math.min(n, o), 24661 outerRadius: Math.max(n, o) 24662 }); 24663 } 24664}; 24665as.className = "Sector"; 24666S([ 24667 Je() 24668], as.prototype, "centerX", 2); 24669S([ 24670 Je() 24671], as.prototype, "centerY", 2); 24672S([ 24673 Je() 24674], as.prototype, "innerRadius", 2); 24675S([ 24676 Je() 24677], as.prototype, "outerRadius", 2); 24678S([ 24679 Je() 24680], as.prototype, "startAngle", 2); 24681S([ 24682 Je() 24683], as.prototype, "endAngle", 2); 24684S([ 24685 Je() 24686], as.prototype, "clipSector", 2); 24687S([ 24688 Je() 24689], as.prototype, "concentricEdgeInset", 2); 24690S([ 24691 Je() 24692], as.prototype, "radialEdgeInset", 2); 24693S([ 24694 Je() 24695], as.prototype, "startOuterCornerRadius", 2); 24696S([ 24697 Je() 24698], as.prototype, "endOuterCornerRadius", 2); 24699S([ 24700 Je() 24701], as.prototype, "startInnerCornerRadius", 2); 24702S([ 24703 Je() 24704], as.prototype, "endInnerCornerRadius", 2); 24705var Ki = { 24706 BLUE: "#5090dc", 24707 ORANGE: "#ffa03a", 24708 GREEN: "#459d55", 24709 CYAN: "#34bfe1", 24710 YELLOW: "#e1cc00",
24711 VIOLET: "#9669cb", 24712 GRAY: "#b5b5b5", 24713 MAGENTA: "#bd5aa7", 24714 BROWN: "#8a6224", 24715 RED: "#ef5452" 24716}, cr = { 24717 BLUE: "#2b5c95", 24718 ORANGE: "#cc6f10", 24719 GREEN: "#1e652e", 24720 CYAN: "#18859e", 24721 YELLOW: "#a69400", 24722 VIOLET: "#603c88", 24723 GRAY: "#575757", 24724 MAGENTA: "#7d2f6d", 24725 BROWN: "#4f3508", 24726 RED: "#a82529" 24727}, G2 = class extends Qt { 24728 constructor() { 24729 super(...arguments), this.showInLegend = !1; 24730 } 24731}; 24732S([ 24733 D(je) 24734], G2.prototype, "showInLegend", 2); 24735var A1 = class extends ts { 24736 constructor() { 24737 super(...arguments), this.spacing = 2; 24738 } 24739 set(e, t) { 24740 return super.set(e); 24741 } 24742}; 24743S([ 24744 D(Me) 24745], A1.prototype, "text", 2); 24746S([ 24747 D(At) 24748], A1.prototype, "spacing", 2); 24749var D1 = class extends it { 24750 constructor() { 24751 super(...arguments), this.fill = "transparent", this.fillOpacity = 1; 24752 } 24753}; 24754S([ 24755 D(Ft) 24756], D1.prototype, "fill", 2); 24757S([ 24758 D(Pt) 24759], D1.prototype, "fillOpacity", 2); 24760var Jd = class extends ts { 24761 constructor() { 24762 super(...arguments), this.offset = 3, this.minAngle = 0, this.minSpacing = 4, this.maxCollisionOffset = 50, this.avoidCollisions = !0; 24763 } 24764}; 24765S([ 24766 D(Te) 24767], Jd.prototype, "offset", 2); 24768S([ 24769 D(At.restrict({ min: 0, max: 360 })) 24770], Jd.prototype, "minAngle", 2); 24771S([ 24772 D(Te) 24773], Jd.prototype, "minSpacing", 2); 24774S([ 24775 D(Te) 24776], Jd.prototype, "maxCollisionOffset", 2); 24777S([ 24778 D(je) 24779], Jd.prototype, "avoidCollisions", 2); 24780var E1 = class extends ts { 24781 constructor() { 24782 super(...arguments), this.positionOffset = 0, this.positionRatio = 0.5; 24783 } 24784}; 24785S([ 24786 D(At) 24787], E1.prototype, "positionOffset", 2); 24788S([ 24789 D(Pt) 24790], E1.prototype, "positionRatio", 2); 24791var Gy = class extends it { 24792 constructor() { 24793 super(...arguments), this.length = 10, this.strokeWidth = 1; 24794 } 24795}; 24796S([ 24797 D(xo, { optional: !0 }) 24798], Gy.prototype, "colors", 2); 24799S([ 24800 D(Te) 24801], Gy.prototype, "length", 2); 24802S([ 24803 D(Te) 24804], Gy.prototype, "strokeWidth", 2); 24805var Ct = class extends Wn { 24806 constructor() { 24807 super(...arguments), this.fills = Object.values(Ki), this.strokes = Object.values(cr), this.fillOpacity = 1, this.strokeOpacity = 1, this.lineDash = [0], this.lineDashOffset = 0, this.cornerRadius = 0, this.rotation = 0, this.outerRadiusOffset = 0, this.outerRadiusRatio = 1, this.strokeWidth = 1, this.sectorSpacing = 0, this.hideZeroValueSectorsInLegend = !1, this.innerLabels = new ag(A1), this.title = new G2(), this.innerCircle = new D1(), this.shadow = new Xo(), this.calloutLabel = new Jd(), this.sectorLabel = new E1(), this.calloutLine = new Gy(), this.tooltip = new Ls(); 24808 } 24809 isValid() { 24810 const e = super.isValid(); 24811 return this.innerRadiusRatio == null && this.innerRadiusOffset == null ? (Ee.w
24811arnOnce( 24812 "Either an [innerRadiusRatio] or an [innerRadiusOffset] must be set to render a donut series." 24813 ), !1) : e; 24814 } 24815}; 24816S([ 24817 D(Me) 24818], Ct.prototype, "angleKey", 2); 24819S([ 24820 D(Me, { optional: !0 }) 24821], Ct.prototype, "angleName", 2); 24822S([ 24823 D(Me, { optional: !0 }) 24824], Ct.prototype, "angleFilterKey", 2); 24825S([ 24826 D(Me, { optional: !0 }) 24827], Ct.prototype, "radiusKey", 2); 24828S([ 24829 D(Me, { optional: !0 }) 24830], Ct.prototype, "radiusName", 2); 24831S([ 24832 D(Te, { optional: !0 }) 24833], Ct.prototype, "radiusMin", 2); 24834S([ 24835 D(Te, { optional: !0 }) 24836], Ct.prototype, "radiusMax", 2); 24837S([ 24838 D(Me, { optional: !0 }) 24839], Ct.prototype, "calloutLabelKey", 2); 24840S([ 24841 D(Me, { optional: !0 }) 24842], Ct.prototype, "calloutLabelName", 2); 24843S([ 24844 D(Me, { optional: !0 }) 24845], Ct.prototype, "sectorLabelKey", 2); 24846S([ 24847 D(Me, { optional: !0 }) 24848], Ct.prototype, "sectorLabelName", 2); 24849S([ 24850 D(Me, { optional: !0 }) 24851], Ct.prototype, "legendItemKey", 2); 24852S([ 24853 D(xo) 24854], Ct.prototype, "fills", 2); 24855S([ 24856 D(xo) 24857], Ct.prototype, "strokes", 2); 24858S([ 24859 D(Pt) 24860], Ct.prototype, "fillOpacity", 2); 24861S([ 24862 D(Pt) 24863], Ct.prototype, "strokeOpacity", 2); 24864S([ 24865 D(ya) 24866], Ct.prototype, "lineDash", 2); 24867S([ 24868 D(Te) 24869], Ct.prototype, "lineDashOffset", 2); 24870S([ 24871 D(Te) 24872], Ct.prototype, "cornerRadius", 2); 24873S([ 24874 D(tn, { optional: !0 }) 24875], Ct.prototype, "itemStyler", 2); 24876S([ 24877 D(At) 24878], Ct.prototype, "rotation", 2); 24879S([ 24880 D(At) 24881], Ct.prototype, "outerRadiusOffset", 2); 24882S([ 24883 D(Pt) 24884], Ct.prototype, "outerRadiusRatio", 2); 24885S([ 24886 D(At, { optional: !0 }) 24887], Ct.prototype, "innerRadiusOffset", 2); 24888S([ 24889 D(Pt, { optional: !0 }) 24890], Ct.prototype, "innerRadiusRatio", 2); 24891S([ 24892 D(Te) 24893], Ct.prototype, "strokeWidth", 2); 24894S([ 24895 D(At) 24896], Ct.prototype, "sectorSpacing", 2); 24897S([ 24898 D(je) 24899], Ct.prototype, "hideZeroValueSectorsInLegend", 2); 24900S([ 24901 D(US) 24902], Ct.prototype, "innerLabels", 2); 24903S([ 24904 D(Be) 24905], Ct.prototype, "title", 2); 24906S([ 24907 D(Be) 24908], Ct.prototype, "innerCircle", 2); 24909S([ 24910 D(Be) 24911], Ct.prototype, "shadow", 2); 24912S([ 24913 D(Be) 24914], Ct.prototype, "calloutLabel", 2); 24915S([ 24916 D(Be) 24917], Ct.prototype, "sectorLabel", 2); 24918S([ 24919 D(Be) 24920], Ct.prototype, "calloutLine", 2); 24921S([ 24922 D(Be) 24923], Ct.prototype, "tooltip", 2); 24924function xc(e, t, i, s) { 24925 const n = [i.convert(0), i.convert(1)], o = [s.convert(0), s.convert(1)], r = Math.PI / -2 + Es(t), a = e ? "initial" : "update", l = ({ radius: m }) => ({ innerRadius: n[0], outerRadius: n[0] + (n[1] - n[0]) * m }), c = ({ radius: m }) => ({ innerRadius: o[0], outerRadius: o[0] + (o[1] - o[0]) * m }); 24926 return { nodes: { toFn: (m, y, b, { prevLive: C }) => { 24927 let { startAngle: w, endAngle: M, innerRadius: A, outerRadius: I } = y; 24928 const { stroke: L, fill: k } = y.sectorFormat; 24929 if (b === "removed" && C ? (w = C.datum?.endAngle, M = C.datum?.endAngle) : b === "removed" && !C && (w = r, M = r), b === "removed") { 24930 const B = l(y); 24931 A = B.innerRadius, I = B.outerRadius; 24932 } 24933 return { startAngle: w, endAngle: M, outerRadius: I, innerRadius: A, stroke: L, fill: k }; 24934 }, fromFn: (m, y, b, { prevFromProps: C }) => { 24935 let { startAngle: w, endAngle: M, innerRadius: A, outerRadius: I } = m, { fill: L, stroke: k } = y.sectorFormat; 24936 if (b === "unknown" || b === "added" && !C ? (w = r, M = r, A = y.innerRadius, I = y.outerRadius) : b === "added" && C && (w = C.endAngle ?? r, M = C.endAngle ?? r, A = C.innerRadius ?? y.innerRadius, I = C.outerRadius ?? y.outerRadius), b === "added" && !e) { 24937 const B = c(y); 24938 A = B.innerRadius, I = B.outerRadius; 24939 } 24940 return b === "updated" && (L = m.fill ?? L, k = (typeof m.stroke == "string" ? m.stroke : void 0) ?? k), { startAngle: w, endAngle: M, innerRadius: A, outerRadius: I, fill: L, stroke: k, phase: a }; 24941 } }, innerCircle: { fromFn: (m, y) => ({ size: m.previousDatum?.radius ?? m.size ?? 0, phase: a }), toFn: (m, y) => ({ size: y.radius ?? 0 }) } }; 24942} 24943function I1(e, t) { 24944 return { 24945 startAngle: t.startAngle, 24946 endAngle: t.endAngle, 24947 innerRadius: t.innerRadius, 24948 outerRadius: t.outerRadius, 24949 fill: t.sectorFormat.fill, 24950 stroke: t.sectorFormat.stroke 24951 }; 24952} 24953function R1(e, t) { 24954 const i = t.y - e.centerY, s = t.x - e.centerX, n = Math.atan2(i, s), o = e.getItemNodes(); 24955 for (const r of o) 24956 if (r.datum.missing !== !0 && uo(n, r.startAngle, r.endAngle)) { 24957 const a = Math.sqrt(s * s + i * i); 24958 let l = 0; 24959 return a < r.innerRadius ? l = r.innerRadius - a : a > r.outerRadius && (l = a - r.outerRadius), { datum: r.datum, distance: l }; 24960 } 24961} 24962var z2 = /* @__PURE__ */ ((e) => (e[e.BACKGROUND = 0] = "BACKGROUND", e[e.FOREGROUND = 1] = "FOREGROUND", e[e.HIGHLIGHT = 2] = "HIGHLIGHT", e[e.LABEL = 3] = "LABEL", e))(z2 || {}), zy = class extends _x { 24963 constructor({ 24964 useLabelLayer: e = !1, 24965 pickModes: t = [ 24966 1, 24967 0 24968 /* EXACT_SHAPE_MATCH */ 24969 ], 24970 canHaveAxes: i = !1, 24971 animationResetFns: s, 24972 ...n 24973 }) { 24974 super({ 24975 ...n, 24976 useLabelLayer: e, 24977 pickModes: t, 24978 directionKeys: { 24979 x: ["angleKey"], 24980 y: ["radiusKey"] 24981 }, 24982 directionNames: { 24983 x: ["angleName"], 24984 y: ["radiusName"] 24985 }, 24986 canHaveAxes: i 24987 }), this.itemGroup = this.contentGroup.appendChild(new Ye()), this.nodeData = [], this.itemSelection = _i.select( 24988 this.itemGroup, 24989 () => this.nodeFactory(), 24990 !1 24991 ), this.labelSelection = _i.select( 24992 this.labelGroup, 24993 () => this.labelFactory(), 24994 !1 24995 ), this.highlightSelection = _i.select( 24996 this.highlightGroup, 24997 () => this.nodeFactory() 24998 ), this.highlightLabelSelection = _i.select( 24999 this.highlightLabel, 25000 () => this.labelFactory() 25001 ), this.centerX = 0, this.centerY = 0, this.radius = 0, this.animationResetFns = s, this.animationState = new gg( 25002 "empty", 25003 { 25004 empty: { 25005 update: { 25006 target: "ready", 25007 action: (o) => this.animateEmptyUpdateReady(o) 25008 }, 25009 reset: "empty", 25010 skip: "ready" 25011 }, 25012 ready: { 25013 updateData: "waiting", 25014 clear: "clearing", 25015 highlight: (o) => this.animateReadyHighlight(o), 25016 highlightMarkers: (o) => this.animateReadyHighlightMarkers(o), 25017 resize: (o) => this.animateReadyResize(o), 25018 reset: "empty", 25019 skip: "ready" 25020 }, 25021 waiting: { 25022 update: { 25023 target: "ready", 25024 action: (o) => this.animateWaitingUpdateReady(o) 25025 }, 25026 reset: "empty", 25027 skip: "ready" 25028 }, 25029 clearing: { 25030 update: { 25031 target: "empty", 25032 action: (o) => this.animateClearingUpdateEmpty(o) 25033 }, 25034 reset: "empty", 25035 skip: "ready" 25036 } 25037 }, 25038 () => this.checkProcessedDataAnimatable() 25039 ); 25040 } 25041 getItemNodes() { 25042 return [...this.itemGroup.children()]; 25043 } 25044 getNodeData() { 25045 return this.nodeData; 25046 } 25047 setSeriesIndex(e) { 25048 return super.setSeriesIndex(e) ? (this.contentGroup.zIndex = [ 25049 e, 25050 1 25051 /* FOREGROUND */ 25052 ], this.highlightGroup.zIndex = [ 25053 e, 25054 2 25055 /* HIGHLIGHT */ 25056 ], this.labelGroup.zIndex = [ 25057 e, 25058 3 25059 /* LABEL */ 25060 ], !0) : !1; 25061 } 25062 resetAnimation(e) { 25063 e === "initial" ? this.animationState.transition("reset") : e === "ready" && this.animationState.transition("skip"); 25064 } 25065 labelFactory() { 25066 const e = new Qi(); 25067 return e.pointerEvents = 1, e; 25068 } 25069 addChartEventListeners() { 25070 this.destroyFns.push( 25071 this.ctx.chartEventManager?.addListener("legend-item-click", (e) => this.onLegendItemClick(e)) 25072 ); 25073 } 25074 getInnerRadius() { 25075 return 0; 25076 } 25077 computeLabelsBBox(e, t) { 25078 return null; 25079 } 25080 resetAllAnimation() { 25081 const { item: e, label: t } = this.animationResetFns ?? {}; 25082 this.ctx.animationManager.stopByAnimationGroupId(this.id), e && zi([this.itemSelection, this.highlightSelection], e), t && zi([this.labelSelection, this.highlightLabelSelection], t), this.itemSelection.cleanup(), this.labelSelection.cleanup(), this.highlightSelection.cleanup(), this.highlightLabelSelection.cleanup(); 25083 } 25084 animateEmptyUpdateReady(e) { 25085 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(); 25086 } 25087 animateWaitingUpdateReady(e) { 25088 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(); 25089 } 25090 animateReadyHighlight(e) { 25091 const { item: t, label: i } = this.animationResetFns ?? {}; 25092 t && zi([this.highlightSelection], t), i && zi([this.highlightLabelSelection], i); 25093 } 25094 animateReadyHighlightMarkers(e) { 25095 } 25096 animateReadyResize(e) { 25097 this.resetAllAnimation(); 25098 } 25099 animateClearingUpdateEmpty(e) { 25100 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(); 25101 } 25102 computeFocusBounds(e) { 25103 const t = this.getNodeData()?.[e.datumIndex]; 25104 if (t !== void 0) 25105 return this.itemSelection.select((i) => i instanceof sn && i.datum === t)[0]; 25106 } 25107 getSeriesRange(e, t) { 25108 return [NaN, NaN]; 25109 } 25110}, OK = class extends vg { 25111 constructor(e, t, i, s) { 25112 super(e, t, i, s), this.angleKey = s.properties.angleKey, this.radiusKey = s.properties.radiusKey, this.calloutLabelKey = s.properties.calloutLabelKey, this.sectorLabelKey = s.properties.sectorLabelKey; 25113 } 25114}, T1 = class extends zy { 25115 constructor(e) { 25116 super({
25117 moduleCtx: e, 25118 pickModes: [ 25119 1, 25120 0 25121 /* EXACT_SHAPE_MATCH */ 25122 ], 25123 useLabelLayer: !0, 25124 animationResetFns: { item: I1, label: Ra } 25125 }), this.properties = new Ct(), this.phantomNodeData = void 0, this.backgroundGroup = new Ks({ 25126 name: `${this.id}-background`, 25127 zIndex: 0 25128 /* BACKGROUND */ 25129 }), this.noVisibleData = !1, this.previousRadiusScale = new mo(), this.radiusScale = new mo(), this.phantomGroup = this.backgroundGroup.appendChild(new Ye({ name: "phantom" })), this.phantomSelection = _i.select( 25130 this.phantomGroup, 25131 () => this.nodeFactory(), 25132 !1 25133 ), this.calloutLabelGroup = this.contentGroup.appendChild(new Ye({ name: "pieCalloutLabels" })), this.calloutLabelSelection = new _i( 25134 this.calloutLabelGroup, 25135 Ye 25136 ), this.zerosumRingsGroup = this.backgroundGroup.appendChild(new Ye({ name: `${this.id}-zerosumRings` })), this.zerosumOuterRing = this.zerosumRingsGroup.appendChild(new hl()), this.zerosumInnerRing = this.zerosumRingsGroup.appendChild(new hl()), this.innerLabelsGroup = this.contentGroup.appendChild(new Ye({ name: "innerLabels" })), this.innerCircleGroup = this.backgroundGroup.appendChild(new Ye({ name: `${this.id}-innerCircle` })), this.innerLabelsSelection = _i.select(this.innerLabelsGroup, Qi), this.innerCircleSelection = _i.select( 25137 this.innerCircleGroup, 25138 hl 25139 ), this.surroundingRadius = void 0, this.NodeEvent = OK, this.angleScale = new mo(), this.angleScale.domain = [0, 1], this.angleScale.range = [-Math.PI, Math.PI].map((t) => t + Math.PI / 2), this.phantomGroup.opacity = 0.2; 25140 } 25141 get calloutNodeData() { 25142 return this.phantomNodeData ?? this.nodeData; 25143 } 25144 attachSeries(e, t, i) { 25145 super.attachSeries(e, t, i), e?.appendChild(this.backgroundGroup); 25146 } 25147 detachSeries(e, t, i) { 25148 super.detachSeries(e, t, i), e?.removeChild(this.backgroundGroup); 25149 } 25150 setSeriesIndex(e) { 25151 return super.setSeriesIndex(e) ? (this.backgroundGroup.zIndex = [0, e], !0) : !1; 25152 } 25153 nodeFactory() { 25154 return new as(); 25155 } 25156 getSeriesDomain(e) { 25157 return e === "x" ? this.angleScale.domain : this.radiusScale.domain; 25158 } 25159 async processData(e) { 25160 if (this.data == null || !this.properties.isValid()) 25161 return; 25162 const { visible: t, id: i } = this, { angleKey: s, angleFilterKey: n, radiusKey: o, calloutLabelKey: r, sectorLabelKey: a, legendItemKey: l } = this.properties, c = (y, b, C) => t && this.ctx.legendManager.getItemEnabled({ seriesId: i, itemId: C }), u = !this.ctx.animationManager.isSkipped(), d = [], p = []; 25163 l ? d.push(Uo(l, "band", { id: "legendItemKey" })) : r ? d.push(Uo(r, "band", { id: "calloutLabelKey" })) : a && d.push(Uo(a, "band", { id: "sectorLabelKey" })); 25164 const f = this.radiusScale.type, m = this.angleScale.type; 25165 o && p.push( 25166 Hx(o, { 25167 id: "radiusValue", 25168 min: this.properties.radiusMin ?? 0, 25169 max: this.properties.radiusMax 25170 }), 25171 pt(o, f, { id: "radiusRaw" }), 25172 // Raw value pass-through. 25173 Sc("radiusValue", [0, 1], 1, this.properties.radiusMin ?? 0, this.properties.radiusMax) 25174 ), r && p.push(pt(r, "band", { id: "calloutLabelValue" })), a && p.push(pt(a, "band", { id: "sectorLabelValue" })), l && p.push(pt(l, "band", { id: "legendItemValue" })), n && p.push( 25175 Op(n, m, { 25176 id: "angleFilterValue", 25177 onlyPositive: !0, 25178 validation: c, 25179 invalidValue: 0 25180 }), 25181 pt(n, m, { id: "angleFilterRaw" }), 25182 Sc("angleFilterValue", [0, 1], 0, 0) 25183 ), u && this.processedData && d.length > 0 && p.push($d(this.id, this.processedData)), p.push(jd()), await this.requestDataModel(e, this.data, { 25184 props: [ 25185 ...d, 25186 Op(s, m, { 25187 id: "angleValue", 25188 onlyPositive: !0, 25189 validation: c, 25190 invalidValue: 0 25191 }), 25192 pt(s, m, { id: "angleRaw" }), 25193 // Raw value pass-through. 25194 Sc("angleValue", [0, 1], 0, 0), 25195 ...p 25196 ] 25197 }); 25198 for (const y of this.processedData?.defs?.values ?? []) { 25199 const { id: b, missing: C, property: w } = y, M = xx(this, C); 25200 b !== "angleRaw" && M > 0 && Ee.warnOnce( 25201 `no value was found for the key '${String(w)}' on ${M} data element${M > 1 ? "s" : ""}` 25202 ); 25203 } 25204 this.animationState.transition("updateData"); 25205 } 25206 maybeRefreshNodeData() { 25207 if (!this.nodeDataRefresh) 25208 return; 25209 const { nodeData: e = [], phantomNodeData: t } = this.createNodeData() ?? {}; 25210 this.nodeData = e, this.phantomNodeData = t, this.nodeDataRefresh = !1; 25211 } 25212 getProcessedDataValues(e, t) {
25213 const i = e.resolveColumnById(this, "angleValue", t), s = e.resolveColumnById(this, "angleRaw", t), n = this.properties.angleFilterKey != null ? e.resolveColumnById(this, "angleFilterValue", t) : void 0, o = this.properties.angleFilterKey != null ? e.resolveColumnById(this, "angleFilterRaw", t) : void 0, r = this.properties.radiusKey ? e.resolveColumnById(this, "radiusValue", t) : void 0, a = this.properties.radiusKey ? e.resolveColumnById(this, "radiusRaw", t) : void 0, l = this.properties.calloutLabelKey ? e.resolveColumnById(this, "calloutLabelValue", t) : void 0, c = this.properties.sectorLabelKey ? e.resolveColumnById(this, "sectorLabelValue", t) : void 0, u = this.properties.legendItemKey ? e.resolveColumnById(this, "legendItemValue", t) : void 0; 25214 return { 25215 angleValues: i, 25216 angleRawValues: s, 25217 angleFilterValues: n, 25218 angleFilterRawValues: o, 25219 radiusValues: r, 25220 radiusRawValues: a, 25221 calloutLabelValues: l, 25222 sectorLabelValues: c, 25223 legendItemValues: u 25224 }; 25225 } 25226 createNodeData() { 25227 const { 25228 id: e, 25229 processedData: t, 25230 dataModel: i, 25231 angleScale: s, 25232 ctx: { legendManager: n }, 25233 visible: o 25234 } = this, { rotation: r, innerRadiusRatio: a } = this.properties; 25235 if (!this.properties.isValid()) 25236 return this.zerosumOuterRing.visible = !0, this.zerosumInnerRing.visible = !0, { itemId: e, nodeData: [], labelData: [] }; 25237 if (!t?.rawData.length || !i || t.type !== "ungrouped") 25238 return; 25239 const { 25240 angleValues: l, 25241 angleRawValues: c, 25242 angleFilterValues: u, 25243 angleFilterRawValues: d, 25244 radiusValues: p, 25245 radiusRawValues: f, 25246 calloutLabelValues: m, 25247 sectorLabelValues: y, 25248 legendItemValues: b 25249 } = this.getProcessedDataValues(i, t), C = d?.some((L, k) => L > c[k]) ?? !1; 25250 let w = 0, M = 0; 25251 const A = [], I = d != null ? [] : void 0; 25252 return t.rawData.forEach((L, k) => { 25253 const B = C ? u[k] : l[k], N = d != null && !C ? Math.sqrt(d[k] / c[k]) : 1, W = s.convert(w) + Es(r); 25254 w = B, M += B; 25255 const se = s.convert(w) + Es(r), ue = Math.abs(se - W), Ce = W + ue / 2, te = c[k], $ = (p?.[k] ?? 1) * N, T = f?.[k], E = b?.[k], P = this.getLabels( 25256 L, 25257 Ce, 25258 ue, 25259 !0, 25260 m?.[k], 25261 y?.[k], 25262 E 25263 ), G = this.getSectorFormat(L, k, !1), _ = { 25264 itemId: k, 25265 series: this, 25266 datum: L, 25267 datumIndex: k, 25268 angleValue: te, 25269 midAngle: Ce, 25270 midCos: Math.cos(Ce), 25271 midSin: Math.sin(Ce), 25272 startAngle: W, 25273 endAngle: se, 25274 radius: $, 25275 innerRadius: Math.max(this.radiusScale.convert(0), 0), 25276 outerRadius: Math.max(this.radiusScale.convert($), 0), 25277 sectorFormat: G, 25278 radiusValue: T, 25279 legendItemValue: E, 25280 enabled: o && n.getItemEnabled({ seriesId: e, itemId: k }), 25281 focusable: !0, 25282 ...P 25283 }; 25284 A.push(_), I?.push({ 25285 ..._, 25286 radius: 1, 25287 innerRadius: Math.max(this.radiusScale.convert(0), 0), 25288 outerRadius: Math.max(this.radiusScale.convert(1), 0), 25289 focusable: !1 25290 }); 25291 }), this.zerosumOuterRing.visible = M === 0, this.zerosumInnerRing.visible = M === 0 && a != null && a !== 1 && a > 0, { 25292 itemId: e, 25293 nodeData: A, 25294 labelData: A, 25295 phantomNodeData: I 25296 }; 25297 } 25298 getLabels(e, t, i, s, n, o, r) { 25299 const { calloutLabel: a, sectorLabel: l, legendItemKey: c } = this.properties, u = !s || a.enabled ? this.properties.calloutLabelKey : void 0, d = !s || l.enabled ? this.properties.sectorLabelKey : void 0; 25300 if (!u && !d && !c) 25301 return {}; 25302 const p = { 25303 datum: e, 25304 angleKey: this.properties.angleKey, 25305 angleName: this.properties.angleName, 25306 radiusKey: this.properties.radiusKey, 25307 radiusName: this.properties.radiusName, 25308 calloutLabelKey: this.properties.calloutLabelKey, 25309 calloutLabelName: this.properties.calloutLabelName, 25310 sectorLabelKey: this.properties.sectorLabelKey, 25311 sectorLabelName: this.properties.sectorLabelName, 25312 legendItemKey: this.properties.legendItemKey 25313 }, f = {}; 25314 return u && i > Es(a.minAngle) && (f.calloutLabel = { 25315 ...this.getTextAlignment(t), 25316 text: this.getLabelText(a, { 25317 ...p, 25318 value: n 25319 }), 25320 hidden: !1, 25321 collisionTextAlign: void 0, 25322 collisionOffsetY: 0, 25323 box: void 0 25324 }), d && (f.sectorLabel = { 25325 text: this.getLabelText(l, { 25326 ...p, 25327 value: o 25328 }) 25329 }
25329), c != null && r != null && (f.legendItem = { key: c, text: r }), f; 25330 } 25331 getTextAlignment(e) { 25332 const t = [ 25333 { textAlign: "center", textBaseline: "bottom" }, 25334 { textAlign: "left", textBaseline: "middle" }, 25335 { textAlign: "center", textBaseline: "hanging" }, 25336 { textAlign: "right", textBaseline: "middle" } 25337 ], i = Rp(e), s = -0.75 * Math.PI, n = i - s, o = Math.floor(n / (Math.PI / 2)), r = TS(o, t.length); 25338 return t[r]; 25339 } 25340 getSectorFormat(e, t, i) { 25341 const { angleKey: s, radiusKey: n, calloutLabelKey: o, sectorLabelKey: r, legendItemKey: a, fills: l, strokes: c, itemStyler: u } = this.properties, d = c[t % c.length], { fill: p, fillOpacity: f, stroke: m, strokeWidth: y, strokeOpacity: b, lineDash: C, lineDashOffset: w, cornerRadius: M } = ht( 25342 i && this.properties.highlightStyle.item, 25343 { 25344 fill: l.length > 0 ? l[t % l.length] : void 0, 25345 stroke: d, 25346 strokeWidth: this.getStrokeWidth(this.properties.strokeWidth), 25347 strokeOpacity: this.getOpacity() 25348 }, 25349 this.properties 25350 ); 25351 let A; 25352 return u && (A = this.cachedDatumCallback( 25353 ps(this.getDatumIdFromData(e), i ? "highlight" : "hide"), 25354 () => u({ 25355 datum: e, 25356 angleKey: s, 25357 radiusKey: n, 25358 calloutLabelKey: o, 25359 sectorLabelKey: r, 25360 legendItemKey: a, 25361 fill: p, 25362 fillOpacity: f, 25363 stroke: m, 25364 strokeWidth: y, 25365 strokeOpacity: b, 25366 lineDash: C, 25367 lineDashOffset: w, 25368 cornerRadius: M, 25369 highlighted: i, 25370 seriesId: this.id 25371 }) 25372 )), { 25373 fill: A?.fill ?? p, 25374 fillOpacity: A?.fillOpacity ?? f, 25375 stroke: A?.stroke ?? m, 25376 strokeWidth: A?.strokeWidth ?? y, 25377 strokeOpacity: A?.strokeOpacity ?? b, 25378 lineDash: A?.lineDash ?? C, 25379 lineDashOffset: A?.lineDashOffset ?? w, 25380 cornerRadius: A?.cornerRadius ?? M 25381 }; 25382 } 25383 getInnerRadius() { 25384 const { radius: e } = this, { innerRadiusRatio: t = 1, innerRadiusOffset: i = 0 } = this.properties, s = e * t + i; 25385 return s === e || s < 0 ? 0 : s; 25386 } 25387 getOuterRadius() { 25388 const { outerRadiusRatio: e, outerRadiusOffset: t } = this.properties; 25389 return Math.max(this.radius * e + t, 0); 25390 } 25391 updateRadiusScale(e) { 25392 const t = [this.getInnerRadius(), this.getOuterRadius()]; 25393 this.radiusScale.range = t, e && (this.previousRadiusScale.range = t); 25394 const i = (s) => ({ 25395 ...s, 25396 innerRadius: Math.max(this.radiusScale.convert(0), 0), 25397 outerRadius: Math.max(this.radiusScale.convert(s.radius), 0) 25398 }); 25399 this.nodeData = this.nodeData.map(i), this.phantomNodeData = this.phantomNodeData?.map(i); 25400 } 25401 getTitleTranslationY() { 25402 const e = Math.max(0, this.radiusScale.range[1]); 25403 if (e === 0) 25404 return NaN; 25405 const i = 2 + (this.properties.title?.spacing ?? 0), s = Math.max(0, -e); 25406 return -e - i - s; 25407 } 25408 update({ seriesRect: e }) { 25409 const { title: t } = this.properties, i = { 25410 seriesRectWidth: e?.width, 25411 seriesRectHeight: e?.height 25412 }, s = Sr(this.nodeDataDependencies, i) != null; 25413 if (s && (this._nodeDataDependencies = i), this.maybeRefreshNodeData(), this.updateTitleNodes(), this.updateRadiusScale(s), this.contentGroup.translationX = this.centerX, this.contentGroup.translationY = this.centerY, this.highlightGroup.translationX = this.centerX, this.highlightGroup.translationY = this.centerY, this.backgroundGroup.translationX = this.centerX, this.backgroundGroup.translationY = this.centerY, this.labelGroup && (this.labelGroup.translationX = this.centerX, this.labelGroup.translationY = this.centerY), t) { 25414 const n = this.getTitleTranslationY(); 25415 t.node.y = isFinite(n) ? n : 0; 25416 const o = t.node.getBBox(); 25417 t.node.visible = t.enabled && isFinite(n) && !this.bboxIntersectsSurroundingSeries(o); 25418 } 25419 for (const n of [this.zerosumInnerRing, this.zerosumOuterRing]) 25420 n.fillOpacity = 0, n.stroke = this.properties.calloutLabel.color, n.strokeWidth = 1, n.strokeOpacity = 1; 25421 this.updateNodeMidPoint(), this.updateSelections(), this.updateNodes(e); 25422 } 25423 updateTitleNodes() { 25424 const { oldTitle: e } = this, { title: t } = this.properties; 25425 e !== t && (e && this.labelGroup?.removeChild(e.node), t && (t.node.textBaseline = "bottom", this.labelGroup?.appendChild(t.node)), this.oldTitle = t); 25426 } 25427 updateNodeMidPoint() { 25428 const e = (t) => { 25429 const i = t.innerRadius + (t.outerRadius - t.innerRadius) / 2; 25430 t.midPoint = { 25431 x: t.midCos * Math.max(0, i), 25432 y: t.midSin * Math.max(0, i) 25433 }; 25434 }; 25435 this.nodeData.forEach(e), this.phantomNodeData?.forEach(e); 25436 } 25437 updateSelections() { 25438 this.updateGroupSelection(), this.updateInnerCircleSelection(); 25439 } 25440 updateGroupSelection() { 25441 const { 25442 itemSelection: e, 25443 highlightSelection: t, 25444 phantomSelection: i, 25445 highlightLabelSelection: s, 25446 calloutLabelSelection: n, 25447 labelSelection: o,
25448 innerLabelsSelection: r 25449 } = this, a = this.nodeData.map((c) => ({ 25450 ...c, 25451 // Allow mutable sectorFormat, so formatted sector styles can be updated and varied 25452 // between normal and highlighted cases. 25453 sectorFormat: { ...c.sectorFormat } 25454 })), l = (c, u) => { 25455 c.update(u, void 0, (d) => this.getDatumId(d)), this.ctx.animationManager.isSkipped() && c.cleanup(); 25456 }; 25457 l(e, this.nodeData), l(t, a), l(i, this.phantomNodeData ?? []), n.update(this.calloutNodeData, (c) => { 25458 const u = new Hn(); 25459 u.tag = 0, u.pointerEvents = 1, c.appendChild(u); 25460 const d = new Qi(); 25461 d.tag = 1, d.pointerEvents = 1, c.appendChild(d); 25462 }), o.update(this.nodeData), s.update(a), r.update(this.properties.innerLabels, (c) => { 25463 c.pointerEvents = 1; 25464 }); 25465 } 25466 updateInnerCircleSelection() { 25467 const { innerCircle: e } = this.properties; 25468 let t = 0; 25469 const i = this.getInnerRadius(); 25470 if (i > 0) { 25471 const n = Math.min(i, this.getOuterRadius()); 25472 t = Math.ceil(n * 2 + 1); 25473 } 25474 const s = e ? [{ radius: t }] : []; 25475 this.innerCircleSelection.update(s); 25476 } 25477 updateNodes(e) { 25478 const t = this.ctx.highlightManager.getActiveHighlight(), { visible: i } = this; 25479 this.backgroundGroup.visible = i, this.contentGroup.visible = i, this.highlightGroup.visible = i && t?.series === this, this.highlightLabel.visible = i && t?.series === this, this.labelGroup.visible = i, this.contentGroup.opacity = this.getOpacity(), this.innerCircleSelection.each((o, { radius: r }) => { 25480 o.setProperties({ 25481 fill: this.properties.innerCircle?.fill, 25482 opacity: this.properties.innerCircle?.fillOpacity, 25483 size: r 25484 }); 25485 }); 25486 const s = this.ctx.animationManager.isSkipped(), n = (o, r, a, l) => { 25487 const c = this.getSectorFormat(r.datum, r.itemId, l); 25488 r.sectorFormat.fill = c.fill, r.sectorFormat.stroke = c.stroke, s && (o.startAngle = r.startAngle, o.endAngle = r.endAngle, o.innerRadius = r.innerRadius, o.outerRadius = r.outerRadius), (l || s) && (o.fill = c.fill, o.stroke = c.stroke), o.strokeWidth = c.strokeWidth, o.fillOpacity = c.fillOpacity, o.strokeOpacity = c.strokeOpacity, o.lineDash = c.lineDash, o.lineDashOffset = c.lineDashOffset, o.cornerRadius = c.cornerRadius, o.fillShadow = this.properties.shadow; 25489 const u = Math.max( 25490 (this.properties.sectorSpacing + (c.stroke != null ? c.strokeWidth : 0)) / 2, 25491 0 25492 ); 25493 o.inset = u, o.lineJoin = this.properties.sectorSpacing >= 0 || u > 0 ? "miter" : "round"; 25494 }; 25495 this.itemSelection.each((o, r, a) => n(o, r, a, !1)), this.highlightSelection.each((o, r, a) => { 25496 n(o, r, a, !0), o.visible = r.itemId === t?.itemId; 25497 }), this.phantomSelection.each((o, r, a) => n(o, r, a, !1)), this.updateCalloutLineNodes(), this.updateCalloutLabelNodes(e), this.updateSectorLabelNodes(), this.updateInnerLabelNodes(), this.updateZerosumRings(), this.animationState.transition("update"); 25498 } 25499 updateCalloutLineNodes() { 25500 const { calloutLine: e } = this.properties, t = e.length, i = e.strokeWidth, s = e.colors ?? this.properties.strokes, { offset: n } = this.properties.calloutLabel; 25501 this.calloutLabelSelection.selectByTag( 25502 0 25503 /* Callout */ 25504 ).forEach((o, r) => { 25505 const a = o.datum, { calloutLabel: l, outerRadius: c } = a; 25506 if (l?.text && !l.hidden && c !== 0) { 25507 o.visible = !0, o.strokeWidth = i, o.stroke = s[r % s.length], o.fill = void 0; 25508 const u = a.midCos * c, d = a.midSin * c; 25509 let p = a.midCos * (c + t), f = a.midSin * (c + t); 25510 if ((l.collisionTextAlign ?? l.collisionOffsetY !== 0) && l.box != null) { 25511 const y = l.box; 25512 let b = p, C = f; 25513 p < y.x ? b = y.x : p > y.x + y.width && (b = y.x + y.width), f < y.y ? C = y.y : f > y.y + y.height && (C = y.y + y.height); 25514 const w = b - p, M = C - f, A = Math.sqrt(Math.pow(w, 2) + Math.pow(M, 2)), I = A - n; 25515 I > 0 && (p = p + w * I / A, f = f + M * I / A); 25516 } 25517 o.x1 = u, o.y1 = d, o.x2 = p, o.y2 = f; 25518 } else 25519 o.visible = !1; 25520 }); 25521 } 25522 getLabelOverflow(e, t, i) {
25523 const s = -this.centerX, n = s + i.width, o = -this.centerY, r = o + i.height, a = 1; 25524 let l = 1; 25525 t.x + a < s ? l = (t.x + t.width - s) / t.width : t.x + t.width - a > n && (l = (n - t.x) / t.width); 25526 const c = t.y + a < o || t.y + t.height - a > r, u = l === 1 ? e.length : Math.floor(e.length * l) - 1, d = this.bboxIntersectsSurroundingSeries(t); 25527 return { textLength: u, hasVerticalOverflow: c, hasSurroundingSeriesOverflow: d }; 25528 } 25529 bboxIntersectsSurroundingSeries(e) { 25530 const { surroundingRadius: t } = this; 25531 if (t == null) 25532 return !1; 25533 const i = [ 25534 { x: e.x, y: e.y }, 25535 { x: e.x + e.width, y: e.y }, 25536 { x: e.x + e.width, y: e.y + e.height }, 25537 { x: e.x, y: e.y + e.height } 25538 ], s = t ** 2; 25539 return i.some((n) => n.x ** 2 + n.y ** 2 > s); 25540 } 25541 computeCalloutLabelCollisionOffsets() { 25542 const { radiusScale: e } = this, { calloutLabel: t, calloutLine: i } = this.properties, { offset: s, minSpacing: n } = t, o = e.convert(0), r = (C) => !C.calloutLabel || C.outerRadius === 0, a = this.calloutNodeData, l = a.filter((C) => !r(C)); 25543 if (l.forEach((C) => { 25544 const w = C.calloutLabel; 25545 w != null && (w.hidden = !1, w.collisionTextAlign = void 0, w.collisionOffsetY = 0); 25546 }), l.length <= 1) 25547 return; 25548 const c = l.filter((C) => C.midCos < 0).sort((C, w) => C.midSin - w.midSin), u = l.filter((C) => C.midCos >= 0).sort((C, w) => C.midSin - w.midSin), d = l.filter((C) => C.midSin < 0 && C.calloutLabel?.textAlign === "center").sort((C, w) => C.midCos - w.midCos), p = l.filter((C) => C.midSin >= 0 && C.calloutLabel?.textAlign === "center").sort((C, w) => C.midCos - w.midCos), f = (C) => { 25549 const w = C.calloutLabel; 25550 if (w == null) 25551 return _e.zero.clone(); 25552 const M = C.outerRadius + i.length + s, A = C.midCos * M, I = C.midSin * M + w.collisionOffsetY, L = w.collisionTextAlign ?? w.textAlign, k = w.textBaseline; 25553 return Qi.computeBBox(w.text, A, I, { 25554 font: this.properties.calloutLabel, 25555 textAlign: L, 25556 textBaseline: k 25557 }); 25558 }, m = (C, w, M) => { 25559 const A = f(C).grow(n / 2), I = f(w).grow(n / 2); 25560 if (A.x < I.x + I.width && A.x + A.width > I.x && (M === "to-top" ? A.y < I.y + I.height : A.y + A.height > I.y)) { 25561 const k = M === "to-top" ? A.y - I.y - I.height : A.y + A.height - I.y; 25562 w.calloutLabel.collisionOffsetY = k; 25563 } 25564 }, y = (C) => { 25565 const w = C.slice().sort((A, I) => Math.abs(A.midSin) - Math.abs(I.midSin))[0], M = C.indexOf(w); 25566 for (let A = M - 1; A >= 0; A--) { 25567 const I = C[A + 1], L = C[A]; 25568 m(I, L, "to-top"); 25569 } 25570 for (let A = M + 1; A < C.length; A++) { 25571 const I = C[A - 1], L = C[A]; 25572 m(I, L, "to-bottom"); 25573 } 25574 }, b = (C) => { 25575 const w = l.some((B) => B.calloutLabel.collisionOffsetY !== 0), M = C.map((B) => f(B)), A = M.map((B) => B.clone().grow(n / 2)); 25576 let I = !1; 25577 for (let B = 0; B < A.length && !I; B++) { 25578 const N = A[B]; 25579 for (let W = B + 1; W < C.length; W++) { 25580 const se = A[W]; 25581 if (N.collidesBBox(se)) { 25582 I = !0; 25583 break; 25584 } 25585 } 25586 } 25587 const L = a.map((B) => { 25588 const { startAngle: N, endAngle: W, outerRadius: se } = B; 25589 return { startAngle: N, endAngle: W, innerRadius: o, outerRadius: se }; 25590 }), k = M.some((B) => L.some((N) => B2(B, N))); 25591 !I && !w && !k || C.filter((B) => B.calloutLabel.textAlign === "center").forEach((B) => { 25592 const N = B.calloutLabel; 25593 B.midCos < 0 ? N.collisionTextAlign = "right" : B.midCos > 0 ? N.collisionTextAlign = "left" : N.collisionTextAlign = "center"; 25594 }); 25595 }; 25596 y(c), y(u), b(d), b(p); 25597 } 25598 updateCalloutLabelNodes(e) { 25599 const { radiusScale: t } = this, { calloutLabel: i, calloutLine: s } = this.properties, n = s.length, { offset: o, color: r } = i, a = new Qi(); 25600 this.calloutLabelSelection.selectByTag( 25601 1 25602 /* Label */ 25603 ).forEach((l) => { 25604 const { datum: c } = l, u = c.calloutLabel, d = t.convert(c.radius), p = Math.max(0, d); 25605 if (!u?.text || p === 0 || u.hidden) { 25606 l.visible = !1; 25607 return; 25608 } 25609 const f = p + n + o, m = c.midCos * f, y = c.midSin * f + u.collisionOffsetY, b = { 25610 textAlign: u.collisionTextAlign ?? u.textAlign, 25611 textBaseline: u.textBaseline 25612 }; 25613 a.text = u.text, a.x = m, a.y = y, a.setFont(this.properties.calloutLabel), a.setAlign(b); 25614 const C = a.getBBox(); 25615 let w = u.text, M = !0; 25616 if (i.avoidCollisions) { 25617 const { textLength: A, hasVerticalOverflow: I } = this.getLabelOverflow(u.text, C, e); 25618 w = u.text.length === A ? u.text : `${u.text.substring(0, A)}â¦`, M = !I; 25619 } 25620 l.text = w, l.x = m, l.y = y, l.setFont(this.properties.calloutLabel), l.setAlign(b), l.fill = r, l.visible = M; 25621 }); 25622 } 25623 computeLabelsBBox(e, t) { 25624 const { calloutLabel: i, calloutLine: s } = this.properties, n = s.length, { offset: o, maxCollisionOffset: r, minSpacing: a } = i; 25625 if (!i.avoidCollisions) 25626 return null; 25627 this.maybeRefreshNodeData(), this.updateRadiusScale(!1), this.computeCalloutLabelCollisionOffsets(); 25628 const l = [], c = new Qi(); 25629 let u; 25630 const { title: d } = this.properties; 25631 if (d?.text && d.enabled) { 25632 const p = this.getTitleTranslationY(); 25633 isFinite(p) && (c.text = d.text, c.x = 0, c.y = p, c.setFont(d), c.setAlign({ 25634 textBaseline: "bottom", 25635 textAlign: "center" 25636 }), u = c.getBBox(), l.push(u)); 25637 } 25638 return this.calloutNodeData.forEach((p) => { 25639 const f = p.calloutLabel; 25640 if (!f || p.outerRadius === 0) 25641 return null; 25642 const m = p.outerRadius + n + o, y = p.midCos * m, b = p.midSin * m + f.collisionOffsetY;
25643 c.text = f.text, c.x = y, c.y = b, c.setFont(this.properties.calloutLabel), c.setAlign({ 25644 textAlign: f.collisionTextAlign ?? f.textAlign, 25645 textBaseline: f.textBaseline 25646 }); 25647 const C = c.getBBox(); 25648 if (f.box = C, Math.abs(f.collisionOffsetY) > r) { 25649 f.hidden = !0; 25650 return; 25651 } 25652 if (u) { 25653 const w = -this.centerY, M = new _e( 25654 u.x - a, 25655 w, 25656 u.width + 2 * a, 25657 u.y + u.height + a - w 25658 ); 25659 if (C.collidesBBox(M)) { 25660 f.hidden = !0; 25661 return; 25662 } 25663 } 25664 if (e.hideWhenNecessary) { 25665 const { textLength: w, hasVerticalOverflow: M, hasSurroundingSeriesOverflow: A } = this.getLabelOverflow( 25666 f.text, 25667 C, 25668 t 25669 ), I = f.text.length > 2 && w < 2; 25670 if (M || I || A) { 25671 f.hidden = !0; 25672 return; 25673 } 25674 } 25675 f.hidden = !1, l.push(C); 25676 }), l.length === 0 ? null : _e.merge(l); 25677 } 25678 updateSectorLabelNodes() { 25679 const { radiusScale: e } = this, t = e.convert(0), { fontSize: i, fontStyle: s, fontWeight: n, fontFamily: o, positionOffset: r, positionRatio: a, color: l } = this.properties.sectorLabel, c = (u, d) => { 25680 const { sectorLabel: p, outerRadius: f } = d; 25681 let m = !1; 25682 if (p && f !== 0) { 25683 const y = t * (1 - a) + f * a + r; 25684 u.fill = l, u.fontStyle = s, u.fontWeight = n, u.fontSize = i, u.fontFamily = o, u.text = p.text, u.x = d.midCos * y, u.y = d.midSin * y, u.textAlign = "center", u.textBaseline = "middle"; 25685 const b = u.getBBox(), C = [ 25686 [b.x, b.y], 25687 [b.x + b.width, b.y], 25688 [b.x + b.width, b.y + b.height], 25689 [b.x, b.y + b.height] 25690 ], { startAngle: w, endAngle: M } = d, A = { startAngle: w, endAngle: M, innerRadius: t, outerRadius: f }; 25691 C.every(([I, L]) => qm(I, L, A)) && (m = !0); 25692 } 25693 u.visible = m; 25694 }; 25695 this.labelSelection.each(c), this.highlightLabelSelection.each(c); 25696 } 25697 updateInnerLabelNodes() { 25698 const e = [], t = []; 25699 this.innerLabelsSelection.each((u, d) => { 25700 const { fontStyle: p, fontWeight: f, fontSize: m, fontFamily: y, color: b } = d; 25701 u.fontStyle = p, u.fontWeight = f, u.fontSize = m, u.fontFamily = y, u.text = d.text, u.x = 0, u.y = 0, u.fill = b, u.textAlign = "center", u.textBaseline = "alphabetic", e.push(u.getBBox()), t.push(d.spacing); 25702 }); 25703 const i = (u) => u === 0 ? 0 : t[u], s = (u) => u === t.length - 1 ? 0 : t[u], n = e.reduce((u, d, p) => u + d.height + i(p) + s(p), 0), o = Math.max(...e.map((u) => u.width)), r = this.getInnerRadius(), l = Math.sqrt(Math.pow(o / 2, 2) + Math.pow(n / 2, 2)) <= (r > 0 ? r : this.getOuterRadius()), c = []; 25704 for (let u = 0, d = -n / 2; u < e.length; u++) { 25705 const f = e[u].height + d + i(u); 25706 c.push(f), d = f + s(u); 25707 } 25708 this.innerLabelsSelection.each((u, d, p) => { 25709 u.y = c[p], u.visible = l; 25710 }); 25711 } 25712 updateZerosumRings() { 25713 this.zerosumOuterRing.size = this.getOuterRadius() * 2, this.zerosumInnerRing.size = this.getInnerRadius() * 2; 25714 } 25715 pickNodeClosestDatum(e) { 25716 return R1(this, e); 25717 } 25718 getTooltipContent(e) { 25719 const { id: t, dataModel: i, processedData: s, properties: n } = this, { 25720 legendItemKey: o, 25721 calloutLabelKey: r, 25722 calloutLabelName: a, 25723 sectorLabelKey: l, 25724 sectorLabelName: c, 25725 angleKey: u, 25726 angleName: d, 25727 radiusKey: p, 25728 radiusName: f, 25729 tooltip: m 25730 } = n, y = this.properties.title.text; 25731 if (!i || !s || s.rawData.length === 0) 25732 return; 25733 const { datumIndex: b } = e, C = s.rawData[b], { angleRawValues: w, legendItemValues: M, calloutLabelValues: A, sectorLabelValues: I } = this.getProcessedDataValues( 25734 i, 25735 s 25736 ), L = w[b], k = M?.[b] ?? (r === u ? void 0 : A?.[b]) ?? (l === u ? void 0 : I?.[b]) ?? d; 25737 return m.formatTooltip( 25738 { 25739 title: y, 25740 symbol: this.legendItemSymbol(b), 25741 data: [ 25742 { 25743 label: k, 25744 fallbackLabel: u, 25745 value: String(L) 25746 } 25747 ] 25748 }, 25749 { 25750 seriesId: t, 25751 datum: C, 25752 title: d, 25753 legendItemKey: o, 25754 calloutLabelKey: r, 25755 calloutLabelName: a, 25756 sectorLabelKey: l, 25757 sectorLabelName: c, 25758 angleKey: u, 25759 angleName: d, 25760 radiusKey: p, 25761 radiusName: f,
25762 ...this.getSectorFormat(C, b, !1) 25763 } 25764 ); 25765 } 25766 legendItemSymbol(e) { 25767 const t = this.processedData?.rawData[e], i = this.getSectorFormat(t, e, !1); 25768 return { 25769 marker: { 25770 fill: i.fill, 25771 stroke: i.stroke, 25772 fillOpacity: this.properties.fillOpacity, 25773 strokeOpacity: this.properties.strokeOpacity, 25774 strokeWidth: this.properties.strokeWidth 25775 } 25776 }; 25777 } 25778 getLegendData(e) { 25779 const { 25780 visible: t, 25781 processedData: i, 25782 dataModel: s, 25783 id: n, 25784 ctx: { legendManager: o } 25785 } = this; 25786 if (!s || !i || !this.properties.isValid() || e !== "category") 25787 return []; 25788 const { angleKey: r, calloutLabelKey: a, sectorLabelKey: l, legendItemKey: c, showInLegend: u } = this.properties; 25789 if (!c && (!a || a === r) && (!l || l === r)) 25790 return []; 25791 const { angleRawValues: d, calloutLabelValues: p, sectorLabelValues: f, legendItemValues: m } = this.getProcessedDataValues( 25792 s, 25793 i 25794 ), y = this.properties.title?.showInLegend && this.properties.title.text, b = [], C = this.properties.hideZeroValueSectorsInLegend; 25795 for (let w = 0; w < i.rawData.length; w++) { 25796 const M = i.rawData[w], A = d[w]; 25797 if (C && A === 0) 25798 continue; 25799 const I = []; 25800 y && I.push(y); 25801 const L = this.getLabels( 25802 M, 25803 2 * Math.PI, 25804 2 * Math.PI, 25805 !1, 25806 p?.[w], 25807 f?.[w], 25808 m?.[w] 25809 ); 25810 c && L.legendItem !== void 0 ? I.push(L.legendItem.text) : a && a !== r && L.calloutLabel?.text !== void 0 ? I.push(L.calloutLabel?.text) : l && l !== r && L.sectorLabel?.text !== void 0 && I.push(L.sectorLabel?.text), I.length !== 0 && b.push({ 25811 legendType: "category", 25812 id: n, 25813 datum: M, 25814 itemId: w, 25815 seriesId: n, 25816 enabled: t && o.getItemEnabled({ seriesId: n, itemId: w }), 25817 label: { 25818 text: I.join(" - ") 25819 }, 25820 symbol: this.legendItemSymbol(w), 25821 legendItemName: c != null ? M[c] : void 0, 25822 hideInLegend: !u 25823 }); 25824 } 25825 return b; 25826 } 25827 // Used for grid 25828 setLegendState(e) { 25829 const { 25830 id: t, 25831 ctx: { legendManager: i, updateService: s } 25832 } = this; 25833 e.forEach((n, o) => i.toggleItem({ enabled: n, seriesId: t, itemId: o })), i.update(), s.update( 25834 4 25835 /* SERIES_UPDATE */ 25836 ); 25837 } 25838 animateEmptyUpdateReady(e) { 25839 const { animationManager: t } = this.ctx, i = xc( 25840 !0, 25841 this.properties.rotation, 25842 this.radiusScale, 25843 this.previousRadiusScale 25844 ); 25845 Mi( 25846 this.id, 25847 "nodes", 25848 t, 25849 [this.itemSelection, this.highlightSelection, this.phantomSelection], 25850 i.nodes, 25851 (s, n) => this.getDatumId(n) 25852 ), Mi(this.id, "innerCircle", t, [this.innerCircleSelection], i.innerCircle), Et(this, "callout", t, this.calloutLabelSelection), Et(this, "sector", t, this.labelSelection), Et(this, "highlight", t, this.highlightLabelSelection), Et(this, "inner", t, this.innerLabelsSelection), this.previousRadiusScale.range = this.radiusScale.range; 25853 } 25854 animateWaitingUpdateReady() { 25855 const { itemSelection: e, highlightSelection: t, phantomSelection: i, processedData: s, radiusScale: n, previousRadiusScale: o } = this, { animationManager: r } = this.ctx, a = s?.reduced?.diff?.[this.id]; 25856 this.ctx.animationManager.stopByAnimationGroupId(this.id); 25857 const l = (a?.moved.size ?? 0) === 0, c = (s?.defs.keys.length ?? 0) > 0, u = s?.reduced?.animationValidation?.uniqueKeys ?? !0; 25858 (!l || !c || !u) && this.ctx.animationManager.skipCurrentBatch(); 25859 const d = !this.nodeData.some((f) => f.enabled), p = xc( 25860 !1, 25861 this.properties.rotation, 25862 n, 25863 o 25864 ); 25865 Mi( 25866 this.id, 25867 "nodes", 25868 r, 25869 [e, t, i], 25870 p.nodes, 25871 (f, m) => this.getDatumId(m), 25872 a 25873 ), Mi(this.id, "innerCircle", r, [this.innerCircleSelection], p.innerCircle), Et(this, "callout", this.ctx.animationManager, this.calloutLabelSelection), Et(this, "sector", this.ctx.animationManager, this.labelSelection), Et(this, "highlight", this.ctx.animationManager, this.highlightLabelSelection), this.noVisibleData !== d && (this.noVisibleData = d, Et(this, "inner", this.ctx.animationManager, this.innerLabelsSelection)), this.previousRadiusScale.range = this.radiusScale.range; 25874 } 25875 animateClearingUpdateEmpty() { 25876 const { itemSelection: e, highlightSelection: t, phantomSelection: i, radiusScale: s, previousRadiusScale: n } = this, { animationManager: o } = this.ctx, r = xc( 25877 !1, 25878 this.properties.rotation, 25879 s, 25880 n 25881 ); 25882 Mi( 25883 this.id, 25884 "nodes", 25885 o, 25886 [e, t, i],
25887 r.nodes, 25888 (a, l) => this.getDatumId(l) 25889 ), Mi(this.id, "innerCircle", o, [this.innerCircleSelection], r.innerCircle), ol(this, "callout", this.ctx.animationManager, this.calloutLabelSelection), ol(this, "sector", this.ctx.animationManager, this.labelSelection), ol(this, "highlight", this.ctx.animationManager, this.highlightLabelSelection), ol(this, "inner", this.ctx.animationManager, this.innerLabelsSelection), this.previousRadiusScale.range = this.radiusScale.range; 25890 } 25891 getDatumIdFromData(e) { 25892 const { calloutLabelKey: t, sectorLabelKey: i, legendItemKey: s } = this.properties; 25893 if (this.processedData?.reduced?.animationValidation?.uniqueKeys) { 25894 if (s) 25895 return e[s]; 25896 if (t) 25897 return e[t]; 25898 if (i) 25899 return e[i]; 25900 } 25901 } 25902 getDatumId(e) { 25903 const { datumIndex: t } = e, i = this.getDatumIdFromData(e.datum); 25904 return String(i ?? t); 25905 } 25906}; 25907T1.className = "DonutSeries"; 25908T1.type = "donut"; 25909var NK = { 25910 series: { 25911 title: { 25912 enabled: !0, 25913 fontWeight: "normal", 25914 fontSize: 14, 25915 fontFamily: Si, 25916 color: fl, 25917 spacing: 5 25918 }, 25919 calloutLabel: { 25920 enabled: !0, 25921 fontSize: 12, 25922 fontFamily: Si, 25923 color: Zi, 25924 offset: 3, 25925 minAngle: 0 25926 }, 25927 sectorLabel: { 25928 enabled: !0, 25929 fontWeight: "normal", 25930 fontSize: 12, 25931 fontFamily: Si, 25932 color: _l, 25933 positionOffset: 0, 25934 positionRatio: 0.5 25935 }, 25936 calloutLine: { 25937 length: 10, 25938 strokeWidth: 2 25939 }, 25940 fillOpacity: 1, 25941 strokeOpacity: 1, 25942 strokeWidth: 0, 25943 lineDash: [0], 25944 lineDashOffset: 0, 25945 rotation: 0, 25946 sectorSpacing: 1, 25947 shadow: { 25948 enabled: !1, 25949 color: Bl, 25950 xOffset: 3, 25951 yOffset: 3, 25952 blur: 5 25953 }, 25954 innerLabels: { 25955 fontSize: 12, 25956 fontFamily: Si, 25957 color: Zi, 25958 spacing: 2 25959 } 25960 } 25961}, _K = { 25962 series: { 25963 title: { 25964 enabled: !0, 25965 fontWeight: "normal", 25966 fontSize: 14, 25967 fontFamily: Si, 25968 color: fl, 25969 spacing: 5 25970 }, 25971 calloutLabel: { 25972 enabled: !0, 25973 fontSize: 12, 25974 fontFamily: Si, 25975 color: Zi, 25976 offset: 3, 25977 minAngle: 0 25978 }, 25979 sectorLabel: { 25980 enabled: !0, 25981 fontWeight: "normal", 25982 fontSize: 12, 25983 fontFamily: Si, 25984 color: _l, 25985 positionOffset: 0, 25986 positionRatio: 0.5 25987 }, 25988 calloutLine: { 25989 length: 10, 25990 strokeWidth: 2 25991 }, 25992 fillOpacity: 1, 25993 strokeOpacity: 1, 25994 strokeWidth: 0, 25995 lineDash: [0], 25996 lineDashOffset: 0, 25997 rotation: 0, 25998 sectorSpacing: 1, 25999 shadow: { 26000 enabled: !1, 26001 color: Bl, 26002 xOffset: 3, 26003 yOffset: 3, 26004 blur: 5 26005 } 26006 } 26007}, H2 = ({ takeColors: e, colorsCount: t }) => { 26008 const { fills: i, strokes: s } = e(t); 26009 return { fills: i, strokes: s, calloutLine: { colors: s } }; 26010}, BK = { 26011 type: "series", 26012 optionsKey: "series[]", 26013 packageType: "community", 26014 chartTypes: ["polar"], 26015 identifier: "donut", 26016 moduleFactory: (e) => new T1(e), 26017 tooltipDefaults: { range: "exact" }, 26018 themeTemplate: NK, 26019 paletteFactory: H2 26020}, V2 = class extends Qt { 26021 constructor() { 26022 super(...arguments), this.showInLegend = !1; 26023 } 26024}; 26025S([ 26026 D(je) 26027], V2.prototype, "showInLegend", 2); 26028var eh = class extends ts { 26029 constructor() { 26030 super(...arguments), this.offset = 3, this.minAngle = 0, this.minSpacing = 4, this.maxCollisionOffset = 50, this.avoidCollisions = !0; 26031 } 26032}; 26033S([ 26034 D(Te) 26035], eh.prototype, "offset", 2); 26036S([ 26037 D(At.restrict({ min: 0, max: 360 })) 26038], eh.prototype, "minAngle", 2); 26039S([ 26040 D(Te) 26041], eh.prototype, "minSpacing", 2); 26042S([ 26043 D(Te) 26044], eh.prototype, "maxCollisionOffset", 2); 26045S([ 26046 D(je) 26047], eh.prototype, "avoidCollisions", 2); 26048var L1 = class extends ts { 26049 constructor() { 26050 super(...arguments), this.positionOffset = 0, this.positionRatio = 0.5; 26051 } 26052}; 26053S([ 26054 D(At) 26055], L1.prototype, "positionOffset", 2); 26056S([ 26057 D(Pt) 26058], L1.prototype, "positionRatio", 2); 26059var Hy = class extends it { 26060 constructor() { 26061 super(...arguments), this.length = 10, this.strokeWidth = 1; 26062 } 26063}; 26064S([ 26065 D(xo, { optional: !0 }) 26066], Hy.prototype, "colors", 2); 26067S([ 26068 D(Te) 26069], Hy.prototype, "length", 2); 26070S([ 26071 D(Te) 26072], Hy.prototype, "strokeWidth", 2); 26073var Lt = class extends Wn { 26074 constructor() { 26075 super(...arguments), this.fills = Object.values(Ki), this.strokes = Object.values(cr), this.fillOpacity = 1, this.strokeOpacity = 1, this.lineDash = [0], this.lineDashOffset = 0, this.cornerRadius = 0, this.rotation = 0, this.outerRadiusOffset = 0, this.outerRadiusRatio = 1, this.strokeWidth = 1, this.sectorSpacing = 0, this.hideZeroValueSectorsInLegend = !1, this.title = new V2(), this.shadow = new Xo(), this.calloutLabel = new eh(), this.sectorLabel = new L1(), this.calloutLine = new Hy(), this.tooltip = new Ls(); 26076 } 26077}; 26078S([ 26079 D(Me) 26080], Lt.prototype, "angleKey", 2); 26081S([ 26082 D(Me, { optional: !0 }) 26083], Lt.prototype, "angleName", 2); 26084S([ 26085 D(Me, { optional: !0 }) 26086], Lt.prototype, "angleFilterKey", 2); 26087S([ 26088 D(Me, { optional: !0 })
26089], Lt.prototype, "radiusKey", 2); 26090S([ 26091 D(Me, { optional: !0 }) 26092], Lt.prototype, "radiusName", 2); 26093S([ 26094 D(Te, { optional: !0 }) 26095], Lt.prototype, "radiusMin", 2); 26096S([ 26097 D(Te, { optional: !0 }) 26098], Lt.prototype, "radiusMax", 2); 26099S([ 26100 D(Me, { optional: !0 }) 26101], Lt.prototype, "calloutLabelKey", 2); 26102S([ 26103 D(Me, { optional: !0 }) 26104], Lt.prototype, "calloutLabelName", 2); 26105S([ 26106 D(Me, { optional: !0 }) 26107], Lt.prototype, "sectorLabelKey", 2); 26108S([ 26109 D(Me, { optional: !0 }) 26110], Lt.prototype, "sectorLabelName", 2); 26111S([ 26112 D(Me, { optional: !0 }) 26113], Lt.prototype, "legendItemKey", 2); 26114S([ 26115 D(xo) 26116], Lt.prototype, "fills", 2); 26117S([ 26118 D(xo) 26119], Lt.prototype, "strokes", 2); 26120S([ 26121 D(Pt) 26122], Lt.prototype, "fillOpacity", 2); 26123S([ 26124 D(Pt) 26125], Lt.prototype, "strokeOpacity", 2); 26126S([ 26127 D(ya) 26128], Lt.prototype, "lineDash", 2); 26129S([ 26130 D(Te) 26131], Lt.prototype, "lineDashOffset", 2); 26132S([ 26133 D(Te) 26134], Lt.prototype, "cornerRadius", 2); 26135S([ 26136 D(tn, { optional: !0 }) 26137], Lt.prototype, "itemStyler", 2); 26138S([ 26139 D(At) 26140], Lt.prototype, "rotation", 2); 26141S([ 26142 D(At) 26143], Lt.prototype, "outerRadiusOffset", 2); 26144S([ 26145 D(Pt) 26146], Lt.prototype, "outerRadiusRatio", 2); 26147S([ 26148 D(Te) 26149], Lt.prototype, "strokeWidth", 2); 26150S([ 26151 D(At) 26152], Lt.prototype, "sectorSpacing", 2); 26153S([ 26154 D(je) 26155], Lt.prototype, "hideZeroValueSectorsInLegend", 2); 26156S([ 26157 D(Be) 26158], Lt.prototype, "title", 2); 26159S([ 26160 D(Be) 26161], Lt.prototype, "shadow", 2); 26162S([ 26163 D(Be) 26164], Lt.prototype, "calloutLabel", 2); 26165S([ 26166 D(Be) 26167], Lt.prototype, "sectorLabel", 2); 26168S([ 26169 D(Be) 26170], Lt.prototype, "calloutLine", 2); 26171S([ 26172 D(Be) 26173], Lt.prototype, "tooltip", 2); 26174var GK = class extends vg { 26175 constructor(e, t, i, s) { 26176 super(e, t, i, s), this.angleKey = s.properties.angleKey, this.radiusKey = s.properties.radiusKey, this.calloutLabelKey = s.properties.calloutLabelKey, this.sectorLabelKey = s.properties.sectorLabelKey; 26177 } 26178}, k1 = class extends zy { 26179 constructor(e) { 26180 super({ 26181 moduleCtx: e, 26182 pickModes: [ 26183 1, 26184 0 26185 /* EXACT_SHAPE_MATCH */ 26186 ], 26187 useLabelLayer: !0, 26188 animationResetFns: { item: I1, label: Ra } 26189 }), this.properties = new Lt(), this.phantomNodeData = void 0, this.backgroundGroup = new Ks({ 26190 name: `${this.id}-background`, 26191 zIndex: 0 26192 /* BACKGROUND */ 26193 }), this.previousRadiusScale = new mo(), this.radiusScale = new mo(), this.phantomGroup = this.backgroundGroup.appendChild(new Ye({ name: "phantom" })), this.phantomSelection = _i.select( 26194 this.phantomGroup, 26195 () => this.nodeFactory(), 26196 !1 26197 ), this.calloutLabelGroup = this.contentGroup.appendChild(new Ye({ name: "pieCalloutLabels" })), this.calloutLabelSelection = new _i( 26198 this.calloutLabelGroup, 26199 Ye 26200 ), this.zerosumRingsGroup = this.backgroundGroup.appendChild(new Ye({ name: `${this.id}-zerosumRings` })), this.zerosumOuterRing = this.zerosumRingsGroup.appendChild(new hl()), this.surroundingRadius = void 0, this.NodeEvent = GK, this.angleScale = new mo(), this.angleScale.domain = [0, 1], this.angleScale.range = [-Math.PI, Math.PI].map((t) => t + Math.PI / 2), this.phantomGroup.opacity = 0.2; 26201 } 26202 get calloutNodeData() { 26203 return this.phantomNodeData ?? this.nodeData; 26204 } 26205 attachSeries(e, t, i) { 26206 super.attachSeries(e, t, i), e.appendChild(this.backgroundGroup); 26207 } 26208 detachSeries(e, t, i) { 26209 super.detachSeries(e, t, i), e?.removeChild(this.backgroundGroup); 26210 } 26211 setSeriesIndex(e) { 26212 return super.setSeriesIndex(e) ? (this.backgroundGroup.zIndex = [0, e], !0) : !1; 26213 } 26214 nodeFactory() { 26215 const e = new as(); 26216 return e.miterLimit = 1e9, e; 26217 } 26218 getSeriesDomain(e) { 26219 return e === "x" ? this.angleScale.domain : this.radiusScale.domain; 26220 } 26221 async processData(e) { 26222 if (this.data == null || !this.properties.isValid()) 26223 return; 26224 const { 26225 visible: t, 26226 id: i, 26227 ctx: { legendManager: s } 26228 } = this, { angleKey: n, angleFilterKey: o, radiusKey: r, calloutLabelKey: a, sectorLabelKey: l, legendItemKey: c } = this.properties, u = (b, C, w) => t && s.getItemEnabled({ seriesId: i, itemId: w }), d = !this.ctx.animationManager.isSkipped(), p = [], f = []; 26229 c ? p.push(Uo(c, "band", { id: "legendItemKey" })) : a ? p.push(Uo(a, "band", { id: "calloutLabelKey" })) : l && p.push(Uo(l, "band", { id: "sectorLabelKey" })); 26230 const m = this.radiusScale.type, y = this.angleScale.type; 26231 r && f.push( 26232 Hx(r, { 26233 id: "radiusValue", 26234 min: this.properties.radiusMin ?? 0, 26235 max: this.properties.radiusMax 26236 }), 26237 pt(r, m, { id: "radiusRaw" }), 26238 // Raw value pass-through. 26239 Sc("radiusValue", [0, 1], 1, this.properties.radiusMin ?? 0, this.properties.radiusMax) 26240 ), a && f.push(pt(a, "band", { id: "calloutLabelValue" })), l && f.push(pt(l, "band", { id: "sectorLabelValue" })), c && f.push(pt(c, "band", { id: "legendItemValue" })), o && f.push( 26241 Op(o, y, { 26242 id: "angleFilterValue", 26243 onlyPositive: !0, 26244 validation: u, 26245 invalidValue: 0 26246 }), 26247 pt(o, y, { id: "angleFilterRaw" }), 26248 Sc("angleFilterValue", [0, 1], 0, 0) 26249 ), d && this.processedData?.reduced?.animationValidation?.uniqueKeys && p.length > 0 && f.push($d(this.id, this.processedData)), f.push(jd()), await this.requestDataModel(e, this.data, { 26250 props: [ 26251 ...p, 26252 Op(n, y, { 26253 id: "angleValue", 26254 onlyPositive: !0, 26255 validation: u, 26256 invalidValue: 0 26257 }), 26258 pt(n, y, { id: "angleRaw" }), 26259 // Raw value pass-through. 26260 Sc("angleValue", [0, 1], 0, 0), 26261 ...f 26262 ] 26263 }); 26264 for (const b of this.processedData?.defs?.values ?? []) { 26265 const { id: C, missing: w, property: M } = b, A = xx(this, w); 26266 C !== "angleRaw" && A > 0 && Ee.warnOnce( 26267 `no value was found for the key '${String(M)}' on ${A} data element${A > 1 ? "s" : ""}` 26268 ); 26269 } 26270 this.animationState.transition("updateData"); 26271 } 26272 maybeRefreshNodeData() { 26273 if (!this.nodeDataRefresh) 26274 return; 26275 const { nodeData: e = [], phantomNodeData: t } = this.createNodeData() ?? {}; 26276 this.nodeData = e, this.phantomNodeData = t, this.nodeDataRefresh = !1; 26277 } 26278 getProcessedDataValues(e, t) {
26279 const i = e.resolveColumnById(this, "angleValue", t), s = e.resolveColumnById(this, "angleRaw", t), n = this.properties.angleFilterKey != null ? e.resolveColumnById(this, "angleFilterValue", t) : void 0, o = this.properties.angleFilterKey != null ? e.resolveColumnById(this, "angleFilterRaw", t) : void 0, r = this.properties.radiusKey ? e.resolveColumnById(this, "radiusValue", t) : void 0, a = this.properties.radiusKey ? e.resolveColumnById(this, "radiusRaw", t) : void 0, l = this.properties.calloutLabelKey ? e.resolveColumnById(this, "calloutLabelValue", t) : void 0, c = this.properties.sectorLabelKey ? e.resolveColumnById(this, "sectorLabelValue", t) : void 0, u = this.properties.legendItemKey ? e.resolveColumnById(this, "legendItemValue", t) : void 0; 26280 return { 26281 angleValues: i, 26282 angleRawValues: s, 26283 angleFilterValues: n, 26284 angleFilterRawValues: o, 26285 radiusValues: r, 26286 radiusRawValues: a, 26287 calloutLabelValues: l, 26288 sectorLabelValues: c, 26289 legendItemValues: u 26290 }; 26291 } 26292 createNodeData() { 26293 const { 26294 id: e, 26295 processedData: t, 26296 dataModel: i, 26297 angleScale: s, 26298 ctx: { legendManager: n }, 26299 visible: o 26300 } = this, { rotation: r } = this.properties; 26301 if (!t?.rawData.length || !i || t.type !== "ungrouped") 26302 return; 26303 const { 26304 angleValues: a, 26305 angleRawValues: l, 26306 angleFilterValues: c, 26307 angleFilterRawValues: u, 26308 radiusValues: d, 26309 radiusRawValues: p, 26310 calloutLabelValues: f, 26311 sectorLabelValues: m, 26312 legendItemValues: y 26313 } = this.getProcessedDataValues(i, t), b = u?.some((I, L) => I > l[L]) ?? !1; 26314 let C = 0, w = 0; 26315 const M = [], A = u != null ? [] : void 0; 26316 return t.rawData.forEach((I, L) => { 26317 const k = b ? c[L] : a[L], B = u != null && !b ? Math.sqrt(u[L] / l[L]) : 1, N = s.convert(C) + Es(r); 26318 C = k, w += k; 26319 const W = s.convert(C) + Es(r), se = Math.abs(W - N), ue = N + se / 2, Ce = l[L], q = (d?.[L] ?? 1) * B, $ = p?.[L], T = y?.[L], E = this.getLabels( 26320 I, 26321 ue, 26322 se, 26323 !0, 26324 f?.[L], 26325 m?.[L], 26326 T 26327 ), P = this.getSectorFormat(I, L, !1), G = { 26328 itemId: L, 26329 series: this, 26330 datum: I, 26331 datumIndex: L, 26332 angleValue: Ce, 26333 midAngle: ue, 26334 midCos: Math.cos(ue), 26335 midSin: Math.sin(ue), 26336 startAngle: N, 26337 endAngle: W, 26338 radius: q, 26339 innerRadius: Math.max(this.radiusScale.convert(0), 0), 26340 outerRadius: Math.max(this.radiusScale.convert(q), 0), 26341 sectorFormat: P, 26342 radiusValue: $, 26343 legendItemValue: T, 26344 enabled: o && n.getItemEnabled({ seriesId: e, itemId: L }), 26345 ...E 26346 }; 26347 M.push(G), A?.push({ 26348 ...G, 26349 radius: 1, 26350 innerRadius: Math.max(this.radiusScale.convert(0), 0), 26351 outerRadius: Math.max(this.radiusScale.convert(1), 0) 26352 }); 26353 }), this.zerosumOuterRing.visible = w === 0, { 26354 itemId: e, 26355 nodeData: M, 26356 labelData: M, 26357 phantomNodeData: A 26358 }; 26359 } 26360 getLabels(e, t, i, s, n, o, r) { 26361 const { calloutLabel: a, sectorLabel: l, legendItemKey: c } = this.properties, u = !s || a.enabled ? this.properties.calloutLabelKey : void 0, d = !s || l.enabled ? this.properties.sectorLabelKey : void 0; 26362 if (!u && !d && !c) 26363 return {}; 26364 const p = { 26365 datum: e, 26366 angleKey: this.properties.angleKey, 26367 angleName: this.properties.angleName, 26368 radiusKey: this.properties.radiusKey, 26369 radiusName: this.properties.radiusName, 26370 calloutLabelKey: this.properties.calloutLabelKey, 26371 calloutLabelName: this.properties.calloutLabelName, 26372 sectorLabelKey: this.properties.sectorLabelKey, 26373 sectorLabelName: this.properties.sectorLabelName, 26374 legendItemKey: this.properties.legendItemKey 26375 }, f = {}; 26376 return u && i > Es(a.minAngle) && (f.calloutLabel = { 26377 ...this.getTextAlignment(t), 26378 text: this.getLabelText(a, { 26379 ...p, 26380 value: n 26381 }), 26382 hidden: !1, 26383 collisionTextAlign: void 0, 26384 collisionOffsetY: 0, 26385 box: void 0 26386 }), d && (f.sectorLabel = { 26387 text: this.getLabelText(l, { 26388 ...p, 26389 value: o 26390 }) 26391 }
26391), c != null && r != null && (f.legendItem = { key: c, text: r }), f; 26392 } 26393 getTextAlignment(e) { 26394 const t = [ 26395 { textAlign: "center", textBaseline: "bottom" }, 26396 { textAlign: "left", textBaseline: "middle" }, 26397 { textAlign: "center", textBaseline: "hanging" }, 26398 { textAlign: "right", textBaseline: "middle" } 26399 ], i = Rp(e), s = -0.75 * Math.PI, n = i - s, o = Math.floor(n / (Math.PI / 2)), r = TS(o, t.length); 26400 return t[r]; 26401 } 26402 getSectorFormat(e, t, i) { 26403 const { angleKey: s, radiusKey: n, calloutLabelKey: o, sectorLabelKey: r, legendItemKey: a, fills: l, strokes: c, itemStyler: u } = this.properties, d = c[t % c.length], { fill: p, fillOpacity: f, stroke: m, strokeWidth: y, strokeOpacity: b, lineDash: C, lineDashOffset: w, cornerRadius: M } = ht( 26404 i && this.properties.highlightStyle.item, 26405 { 26406 fill: l.length > 0 ? l[t % l.length] : void 0, 26407 stroke: d, 26408 strokeWidth: this.getStrokeWidth(this.properties.strokeWidth), 26409 strokeOpacity: this.getOpacity() 26410 }, 26411 this.properties 26412 ); 26413 let A; 26414 return u && (A = this.cachedDatumCallback( 26415 ps(this.getDatumIdFromData(e), i ? "highlight" : "hide"), 26416 () => u({ 26417 datum: e, 26418 angleKey: s, 26419 radiusKey: n, 26420 calloutLabelKey: o, 26421 sectorLabelKey: r, 26422 legendItemKey: a, 26423 fill: p, 26424 strokeOpacity: b, 26425 stroke: m, 26426 strokeWidth: y, 26427 fillOpacity: f, 26428 lineDash: C, 26429 lineDashOffset: w, 26430 cornerRadius: M, 26431 highlighted: i, 26432 seriesId: this.id 26433 }) 26434 )), { 26435 fill: A?.fill ?? p, 26436 fillOpacity: A?.fillOpacity ?? f, 26437 stroke: A?.stroke ?? m, 26438 strokeWidth: A?.strokeWidth ?? y, 26439 strokeOpacity: A?.strokeOpacity ?? b, 26440 lineDash: A?.lineDash ?? C, 26441 lineDashOffset: A?.lineDashOffset ?? w, 26442 cornerRadius: A?.cornerRadius ?? M 26443 }; 26444 } 26445 getOuterRadius() { 26446 return Math.max(this.radius * this.properties.outerRadiusRatio + this.properties.outerRadiusOffset, 0); 26447 } 26448 updateRadiusScale(e) { 26449 const t = [0, this.getOuterRadius()]; 26450 this.radiusScale.range = t, e && (this.previousRadiusScale.range = t); 26451 const i = (s) => ({ 26452 ...s, 26453 innerRadius: Math.max(this.radiusScale.convert(0), 0), 26454 outerRadius: Math.max(this.radiusScale.convert(s.radius), 0) 26455 }); 26456 this.nodeData = this.nodeData.map(i), this.phantomNodeData = this.phantomNodeData?.map(i); 26457 } 26458 getTitleTranslationY() { 26459 const e = Math.max(0, this.radiusScale.range[1]); 26460 if (e === 0) 26461 return NaN; 26462 const i = 2 + (this.properties.title?.spacing ?? 0), s = Math.max(0, -e); 26463 return -e - i - s; 26464 } 26465 update({ seriesRect: e }) { 26466 const { title: t } = this.properties, i = { 26467 seriesRectWidth: e?.width, 26468 seriesRectHeight: e?.height 26469 }, s = Sr(this.nodeDataDependencies, i) != null; 26470 if (s && (this._nodeDataDependencies = i), this.maybeRefreshNodeData(), this.updateTitleNodes(), this.updateRadiusScale(s), this.contentGroup.translationX = this.centerX, this.contentGroup.translationY = this.centerY, this.highlightGroup.translationX = this.centerX, this.highlightGroup.translationY = this.centerY, this.backgroundGroup.translationX = this.centerX, this.backgroundGroup.translationY = this.centerY, this.labelGroup && (this.labelGroup.translationX = this.centerX, this.labelGroup.translationY = this.centerY), t) { 26471 const n = this.getTitleTranslationY(); 26472 t.node.y = isFinite(n) ? n : 0; 26473 const o = t.node.getBBox(); 26474 t.node.visible = t.enabled && isFinite(n) && !this.bboxIntersectsSurroundingSeries(o); 26475 } 26476 this.zerosumOuterRing.fillOpacity = 0, this.zerosumOuterRing.stroke = this.properties.calloutLabel.color, this.zerosumOuterRing.strokeWidth = 1, this.zerosumOuterRing.strokeOpacity = 1, this.updateNodeMidPoint(), this.updateSelections(), this.updateNodes(e); 26477 } 26478 updateTitleNodes() { 26479 const { oldTitle: e } = this, { title: t } = this.properties; 26480 e !== t && (e && this.labelGroup?.removeChild(e.node), t && (t.node.textBaseline = "bottom", this.labelGroup?.appendChild(t.node)), this.oldTitle = t); 26481 } 26482 updateNodeMidPoint() { 26483 const e = (t) => { 26484 const i = t.innerRadius + (t.outerRadius - t.innerRadius) / 2; 26485 t.midPoint = { 26486 x: t.midCos * Math.max(0, i), 26487 y: t.midSin * Math.max(0, i) 26488 }; 26489 }; 26490 this.nodeData.forEach(e), this.phantomNodeData?.forEach(e); 26491 } 26492 updateSelections() { 26493 this.updateGroupSelection(); 26494 } 26495 updateGroupSelection() { 26496 const { 26497 itemSelection: e, 26498 highlightSelection: t, 26499 phantomSelection: i, 26500 highlightLabelSelection: s, 26501 calloutLabelSelection: n, 26502 labelSelection: o 26503 } = this, r = this.nodeData.map((l) => ({ 26504 ...l, 26505 // Allow mutable sectorFormat, so formatted sector styles can be updated and varied 26506 // between normal and highlighted cases. 26507 sectorFormat: { ...l.sectorFormat } 26508 })), a = (l, c) => { 26509 l.update(c, void 0, (u) => this.getDatumId(u)), this.ctx.animationManager.isSkipped() && l.cleanup(); 26510 }; 26511 a(e, this.nodeData), a(t, r), a(i, this.phantomNodeData ?? []), n.update(this.calloutNodeData, (l) => { 26512 const c = new Hn(); 26513 c.tag = 0, c.pointerEvents = 1, l.appendChild(c); 26514 const u = new Qi(); 26515 u.tag = 1, u.pointerEvents = 1, l.appendChild(u); 26516 }), o.update(this.nodeData), s.update(r); 26517 } 26518 updateNodes(e) { 26519 const t = this.ctx.highlightManager.getActiveHighlight(), { visible: i } = this; 26520 this.backgroundGroup.visible = i, this.contentGroup.visible = i, this.highlightGroup.visible = i && t?.series === this, this.highlightLabel.visible = i && t?.series === this, this.labelGroup && (this.labelGroup.visible = i), this.contentGroup.opacity = this.getOpacity(); 26521 const s = this.ctx.animationManager.isSkipped(), n = (o, r, a, l) => {
26522 const c = this.getSectorFormat(r.datum, r.itemId, l); 26523 r.sectorFormat.fill = c.fill, r.sectorFormat.stroke = c.stroke, s && (o.startAngle = r.startAngle, o.endAngle = r.endAngle, o.innerRadius = r.innerRadius, o.outerRadius = r.outerRadius), (l || s) && (o.fill = c.fill, o.stroke = c.stroke), o.strokeWidth = c.strokeWidth, o.fillOpacity = c.fillOpacity, o.strokeOpacity = c.strokeOpacity, o.lineDash = c.lineDash, o.lineDashOffset = c.lineDashOffset, o.cornerRadius = c.cornerRadius, o.fillShadow = this.properties.shadow; 26524 const u = Math.max( 26525 (this.properties.sectorSpacing + (c.stroke != null ? c.strokeWidth : 0)) / 2, 26526 0 26527 ); 26528 o.inset = u, o.lineJoin = this.properties.sectorSpacing >= 0 || u > 0 ? "miter" : "round"; 26529 }; 26530 this.itemSelection.each((o, r, a) => n(o, r, a, !1)), this.highlightSelection.each((o, r, a) => { 26531 n(o, r, a, !0), o.visible = r.itemId === t?.itemId; 26532 }), this.phantomSelection.each((o, r, a) => n(o, r, a, !1)), this.updateCalloutLineNodes(), this.updateCalloutLabelNodes(e), this.updateSectorLabelNodes(), this.updateZerosumRings(), this.animationState.transition("update"); 26533 } 26534 updateCalloutLineNodes() { 26535 const { calloutLine: e } = this.properties, t = e.length, i = e.strokeWidth, s = e.colors ?? this.properties.strokes, { offset: n } = this.properties.calloutLabel; 26536 this.calloutLabelSelection.selectByTag( 26537 0 26538 /* Callout */ 26539 ).forEach((o, r) => { 26540 const a = o.datum, { calloutLabel: l, outerRadius: c } = a; 26541 if (l?.text && !l.hidden && c !== 0) { 26542 o.visible = !0, o.strokeWidth = i, o.stroke = s[r % s.length], o.fill = void 0; 26543 const u = a.midCos * c, d = a.midSin * c; 26544 let p = a.midCos * (c + t), f = a.midSin * (c + t); 26545 if ((l.collisionTextAlign ?? l.collisionOffsetY !== 0) && l.box != null) { 26546 const y = l.box; 26547 let b = p, C = f; 26548 p < y.x ? b = y.x : p > y.x + y.width && (b = y.x + y.width), f < y.y ? C = y.y : f > y.y + y.height && (C = y.y + y.height); 26549 const w = b - p, M = C - f, A = Math.sqrt(Math.pow(w, 2) + Math.pow(M, 2)), I = A - n; 26550 I > 0 && (p = p + w * I / A, f = f + M * I / A); 26551 } 26552 o.x1 = u, o.y1 = d, o.x2 = p, o.y2 = f; 26553 } else 26554 o.visible = !1; 26555 }); 26556 } 26557 getLabelOverflow(e, t, i) { 26558 const s = -this.centerX, n = s + i.width, o = -this.centerY, r = o + i.height, a = 1; 26559 let l = 1; 26560 t.x + a < s ? l = (t.x + t.width - s) / t.width : t.x + t.width - a > n && (l = (n - t.x) / t.width); 26561 const c = t.y + a < o || t.y + t.height - a > r, u = l === 1 ? e.length : Math.floor(e.length * l) - 1, d = this.bboxIntersectsSurroundingSeries(t); 26562 return { textLength: u, hasVerticalOverflow: c, hasSurroundingSeriesOverflow: d }; 26563 } 26564 bboxIntersectsSurroundingSeries(e) { 26565 const { surroundingRadius: t } = this; 26566 if (t == null) 26567 return !1; 26568 const i = [ 26569 { x: e.x, y: e.y }, 26570 { x: e.x + e.width, y: e.y }, 26571 { x: e.x + e.width, y: e.y + e.height }, 26572 { x: e.x, y: e.y + e.height } 26573 ], s = t ** 2; 26574 return i.some((n) => n.x ** 2 + n.y ** 2 > s); 26575 } 26576 computeCalloutLabelCollisionOffsets() { 26577 const { radiusScale: e } = this, { calloutLabel: t, calloutLine: i } = this.properties, { offset: s, minSpacing: n } = t, o = e.convert(0), r = (C) => !C.calloutLabel || C.outerRadius === 0, a = this.calloutNodeData, l = a.filter((C) => !r(C)); 26578 if (l.forEach((C) => { 26579 const w = C.calloutLabel; 26580 w != null && (w.hidden = !1, w.collisionTextAlign = void 0, w.collisionOffsetY = 0); 26581 }), l.length <= 1) 26582 return; 26583 const c = l.filter((C) => C.midCos < 0).sort((C, w) => C.midSin - w.midSin), u = l.filter((C) => C.midCos >= 0).sort((C, w) => C.midSin - w.midSin), d = l.filter((C) => C.midSin < 0 && C.calloutLabel?.textAlign === "center").sort((C, w) => C.midCos - w.midCos), p = l.filter((C) => C.midSin >= 0 && C.calloutLabel?.textAlign === "center").sort((C, w) => C.midCos - w.midCos), f = (C) => { 26584 const w = C.calloutLabel; 26585 if (w == null) 26586 return _e.zero.clone(); 26587 const M = C.outerRadius + i.length + s, A = C.midCos * M, I = C.midSin * M + w.collisionOffsetY, L = w.collisionTextAlign ?? w.textAlign, k = w.textBaseline; 26588 return Qi.computeBBox(w.text, A, I, { 26589 font: this.properties.calloutLabel, 26590 textAlign: L, 26591 textBaseline: k 26592 }); 26593 }, m = (C, w, M) => { 26594 const A = f(C).grow(n / 2), I = f(w).grow(n / 2); 26595 if (A.x < I.x + I.width && A.x + A.width > I.x && (M === "to-top" ? A.y < I.y + I.height : A.y + A.height > I.y)) {
26596 const k = M === "to-top" ? A.y - I.y - I.height : A.y + A.height - I.y; 26597 w.calloutLabel.collisionOffsetY = k; 26598 } 26599 }, y = (C) => { 26600 const w = C.slice().sort((A, I) => Math.abs(A.midSin) - Math.abs(I.midSin))[0], M = C.indexOf(w); 26601 for (let A = M - 1; A >= 0; A--) { 26602 const I = C[A + 1], L = C[A]; 26603 m(I, L, "to-top"); 26604 } 26605 for (let A = M + 1; A < C.length; A++) { 26606 const I = C[A - 1], L = C[A]; 26607 m(I, L, "to-bottom"); 26608 } 26609 }, b = (C) => { 26610 const w = l.some((B) => B.calloutLabel.collisionOffsetY !== 0), M = C.map((B) => f(B)), A = M.map((B) => B.clone().grow(n / 2)); 26611 let I = !1; 26612 for (let B = 0; B < A.length && !I; B++) { 26613 const N = A[B]; 26614 for (let W = B + 1; W < C.length; W++) { 26615 const se = A[W]; 26616 if (N.collidesBBox(se)) { 26617 I = !0; 26618 break; 26619 } 26620 } 26621 } 26622 const L = a.map((B) => { 26623 const { startAngle: N, endAngle: W, outerRadius: se } = B; 26624 return { startAngle: N, endAngle: W, innerRadius: o, outerRadius: se }; 26625 }), k = M.some((B) => L.some((N) => B2(B, N))); 26626 !I && !w && !k || C.filter((B) => B.calloutLabel.textAlign === "center").forEach((B) => { 26627 const N = B.calloutLabel; 26628 B.midCos < 0 ? N.collisionTextAlign = "right" : B.midCos > 0 ? N.collisionTextAlign = "left" : N.collisionTextAlign = "center"; 26629 }); 26630 }; 26631 y(c), y(u), b(d), b(p); 26632 } 26633 updateCalloutLabelNodes(e) { 26634 const { radiusScale: t } = this, { calloutLabel: i, calloutLine: s } = this.properties, n = s.length, { offset: o, color: r } = i, a = new Qi(); 26635 this.calloutLabelSelection.selectByTag( 26636 1 26637 /* Label */ 26638 ).forEach((l) => { 26639 const { datum: c } = l, u = c.calloutLabel, d = t.convert(c.radius), p = Math.max(0, d); 26640 if (!u?.text || p === 0 || u.hidden) { 26641 l.visible = !1; 26642 return; 26643 } 26644 const f = p + n + o, m = c.midCos * f, y = c.midSin * f + u.collisionOffsetY, b = { 26645 textAlign: u.collisionTextAlign ?? u.textAlign, 26646 textBaseline: u.textBaseline 26647 }; 26648 a.text = u.text, a.x = m, a.y = y, a.setFont(this.properties.calloutLabel), a.setAlign(b); 26649 const C = a.getBBox(); 26650 let w = u.text, M = !0; 26651 if (i.avoidCollisions) { 26652 const { textLength: A, hasVerticalOverflow: I } = this.getLabelOverflow(u.text, C, e); 26653 w = u.text.length === A ? u.text : `${u.text.substring(0, A)}â¦`, M = !I; 26654 } 26655 l.text = w, l.x = m, l.y = y, l.setFont(this.properties.calloutLabel), l.setAlign(b), l.fill = r, l.visible = M; 26656 }); 26657 } 26658 computeLabelsBBox(e, t) { 26659 const { calloutLabel: i, calloutLine: s } = this.properties, n = s.length, { offset: o, maxCollisionOffset: r, minSpacing: a } = i; 26660 if (!i.avoidCollisions) 26661 return null; 26662 this.maybeRefreshNodeData(), this.updateRadiusScale(!1), this.computeCalloutLabelCollisionOffsets(); 26663 const l = [], c = new Qi(); 26664 let u; 26665 const { title: d } = this.properties; 26666 if (d?.text && d.enabled) { 26667 const p = this.getTitleTranslationY(); 26668 isFinite(p) && (c.text = d.text, c.x = 0, c.y = p, c.setFont(d), c.setAlign({ 26669 textBaseline: "bottom", 26670 textAlign: "center" 26671 }), u = c.getBBox(), l.push(u)); 26672 } 26673 return this.calloutNodeData.forEach((p) => { 26674 const f = p.calloutLabel; 26675 if (!f || p.outerRadius === 0) 26676 return null; 26677 const m = p.outerRadius + n + o, y = p.midCos * m, b = p.midSin * m + f.collisionOffsetY; 26678 c.text = f.text, c.x = y, c.y = b, c.setFont(this.properties.calloutLabel), c.setAlign({ 26679 textAlign: f.collisionTextAlign ?? f.textAlign, 26680 textBaseline: f.textBaseline 26681 }); 26682 const C = c.getBBox(); 26683 if (f.box = C, Math.abs(f.collisionOffsetY) > r) { 26684 f.hidden = !0; 26685 return; 26686 } 26687 if (u) { 26688 const w = -this.centerY, M = new _e( 26689 u.x - a, 26690 w, 26691 u.width + 2 * a, 26692 u.y + u.height + a - w 26693 ); 26694 if (C.collidesBBox(M)) { 26695 f.hidden = !0; 26696 return; 26697 } 26698 } 26699 if (e.hideWhenNecessary) { 26700 const { textLength: w, hasVerticalOverflow: M, hasSurroundingSeriesOverflow: A } = this.getLabelOverflow( 26701 f.text, 26702 C, 26703 t 26704 ), I = f.text.length > 2 && w < 2; 26705 if (M || I || A) { 26706 f.hidden = !0; 26707 return; 26708 } 26709 } 26710 f.hidden = !1, l.push(C); 26711 }), l.length === 0 ? null : _e.merge(l); 26712 } 26713 updateSectorLabelNodes() { 26714 const { radiusScale: e } = this, t = e.convert(0), { fontSize: i, fontStyle: s, fontWeight: n, fontFamily: o, positionOffset: r, positionRatio: a, color: l } = this.properties.sectorLabel, c = t > 0, u = this.ctx.legendManager.getData(this.id)?.filter((p) => p.enabled).length === 1, d = (p, f) => { 26715 const { sectorLabel: m, outerRadius: y, startAngle: b, endAngle: C } = f; 26716 let w = !1; 26717 if (m && y !== 0) { 26718 const M = t * (1 - a) + y * a + r; 26719 p.fill = l, p.fontStyle = s, p.fontWeight = n, p.fontSize = i, p.fontFamily = o, p.text = m.text, !c && u ? (p.x = 0, p.y = 0) : (p.x = f.midCos * M, p.y = f.midSin * M), p.textAlign = "center", p.textBaseline = "middle"; 26720 const I = p.getBBox(), L = [ 26721 [I.x, I.y], 26722 [I.x + I.width, I.y], 26723 [I.x + I.width, I.y + I.height], 26724 [I.x, I.y + I.height] 26725 ], k = { startAngle: b, endAngle: C, innerRadius: t, outerRadius: y }; 26726 L.every(([B, N]) => qm(B, N, k)) && (w = !0); 26727 } 26728 p.visible = w; 26729 }; 26730 this.labelSelection.each(d), this.highlightLabelSelection.each(d); 26731 } 26732 updateZerosumRings() { 26733 this.zerosumOuterRing.size = this.getOuterRadius() * 2; 26734 } 26735 pickNodeClosestDatum(e) { 26736 return R1(this, e); 26737 } 26738 getTooltipContent(e) { 26739 const { id: t, dataModel: i, processedData: s, properties: n } = this, { 26740 legendItemKey: o, 26741 calloutLabelKey: r, 26742 calloutLabelName: a, 26743 sectorLabelKey: l, 26744 sectorLabelName: c, 26745 angleKey: u, 26746 angleName: d, 26747 radiusKey: p, 26748 radiusName: f, 26749 tooltip: m 26750 } = n, y = this.properties.title.text; 26751 if (!i || !s || s.rawData.length === 0) 26752 return; 26753 const { datumIndex: b } = e, C = s.rawData[b], { angleRawValues: w, legendItemValues: M, calloutLabelValues: A, sectorLabelValues: I } = this.getProcessedDataValues( 26754 i, 26755 s 26756 ), L = w[b], k = M?.[b] ?? (r === u ? void 0 : A?.[b]) ?? (l === u ? void 0 : I?.[b]) ?? d; 26757 return m.formatTooltip( 26758 { 26759 title: y, 26760 symbol: this.legendItemSymbol(b), 26761 data: [ 26762 { 26763 label: k, 26764 fallbackLabel: u, 26765 value: String(L) 26766 } 26767 ] 26768 }, 26769 { 26770 seriesId: t, 26771 datum: C, 26772 title: d, 26773 legendItemKey: o, 26774 calloutLabelKey: r, 26775 calloutLabelName: a, 26776 sectorLabelKey: l, 26777 sectorLabelName: c, 26778 angleKey: u, 26779 angleName: d, 26780 radiusKey: p, 26781 radiusName: f,
26782 ...this.getSectorFormat(C, b, !1) 26783 } 26784 ); 26785 } 26786 legendItemSymbol(e) { 26787 const t = this.processedData?.rawData[e], i = this.getSectorFormat(t, e, !1); 26788 return { 26789 marker: { 26790 fill: i.fill, 26791 stroke: i.stroke, 26792 fillOpacity: this.properties.fillOpacity, 26793 strokeOpacity: this.properties.strokeOpacity, 26794 strokeWidth: this.properties.strokeWidth 26795 } 26796 }; 26797 } 26798 getLegendData(e) { 26799 const { 26800 id: t, 26801 visible: i, 26802 processedData: s, 26803 dataModel: n, 26804 ctx: { legendManager: o } 26805 } = this; 26806 if (!n || !s || e !== "category") 26807 return []; 26808 const { angleKey: r, calloutLabelKey: a, sectorLabelKey: l, legendItemKey: c, showInLegend: u } = this.properties; 26809 if (!c && (!a || a === r) && (!l || l === r)) 26810 return []; 26811 const { calloutLabelValues: d, sectorLabelValues: p, legendItemValues: f, angleRawValues: m } = this.getProcessedDataValues( 26812 n, 26813 s 26814 ), y = this.properties.title?.showInLegend && this.properties.title.text, b = [], C = this.properties.hideZeroValueSectorsInLegend; 26815 for (let w = 0; w < s.rawData.length; w++) { 26816 const M = s.rawData[w], A = m[w]; 26817 if (C && A === 0) 26818 continue; 26819 const I = []; 26820 y && I.push(y); 26821 const L = this.getLabels( 26822 M, 26823 2 * Math.PI, 26824 2 * Math.PI, 26825 !1, 26826 d?.[w], 26827 p?.[w], 26828 f?.[w] 26829 ); 26830 c && L.legendItem !== void 0 ? I.push(L.legendItem.text) : a && a !== r && L.calloutLabel?.text !== void 0 ? I.push(L.calloutLabel?.text) : l && l !== r && L.sectorLabel?.text !== void 0 && I.push(L.sectorLabel?.text), I.length !== 0 && b.push({ 26831 legendType: "category", 26832 id: t, 26833 datum: M, 26834 itemId: w, 26835 seriesId: t, 26836 enabled: i && o.getItemEnabled({ seriesId: t, itemId: w }), 26837 label: { 26838 text: I.join(" - ") 26839 }, 26840 symbol: this.legendItemSymbol(w), 26841 legendItemName: c != null ? M[c] : void 0, 26842 hideInLegend: !u 26843 }); 26844 } 26845 return b; 26846 } 26847 // Used for grid 26848 setLegendState(e) { 26849 const { 26850 id: t, 26851 ctx: { legendManager: i, updateService: s } 26852 } = this; 26853 e.forEach((n, o) => i.toggleItem({ enabled: n, seriesId: t, itemId: o })), i.update(), s.update( 26854 4 26855 /* SERIES_UPDATE */ 26856 ); 26857 } 26858 animateEmptyUpdateReady(e) { 26859 const { animationManager: t } = this.ctx, i = xc( 26860 !0, 26861 this.properties.rotation, 26862 this.radiusScale, 26863 this.previousRadiusScale 26864 ); 26865 Mi( 26866 this.id, 26867 "nodes", 26868 t, 26869 [this.itemSelection, this.highlightSelection, this.phantomSelection], 26870 i.nodes, 26871 (s, n) => this.getDatumId(n) 26872 ), Et(this, "callout", t, this.calloutLabelSelection), Et(this, "sector", t, this.labelSelection), Et(this, "highlight", t, this.highlightLabelSelection), this.previousRadiusScale.range = this.radiusScale.range; 26873 } 26874 animateWaitingUpdateReady() { 26875 const { itemSelection: e, highlightSelection: t, phantomSelection: i, processedData: s, radiusScale: n, previousRadiusScale: o } = this, { animationManager: r } = this.ctx, a = s?.reduced?.diff?.[this.id]; 26876 this.ctx.animationManager.stopByAnimationGroupId(this.id); 26877 const l = (a?.moved.size ?? 0) === 0, c = (s?.defs.keys.length ?? 0) > 0, u = s?.reduced?.animationValidation?.uniqueKeys ?? !0; 26878 (!l || !c || !u) && this.ctx.animationManager.skipCurrentBatch(); 26879 const d = xc( 26880 !1, 26881 this.properties.rotation, 26882 n, 26883 o 26884 ); 26885 Mi( 26886 this.id, 26887 "nodes", 26888 r, 26889 [e, t, i], 26890 d.nodes, 26891 (p, f) => this.getDatumId(f), 26892 a 26893 ), Et(this, "callout", this.ctx.animationManager, this.calloutLabelSelection), Et(this, "sector", this.ctx.animationManager, this.labelSelection), Et(this, "highlight", this.ctx.animationManager, this.highlightLabelSelection), this.previousRadiusScale.range = this.radiusScale.range; 26894 } 26895 animateClearingUpdateEmpty() { 26896 const { itemSelection: e, highlightSelection: t, phantomSelection: i, radiusScale: s, previousRadiusScale: n } = this, { animationManager: o } = this.ctx, r = xc( 26897 !1, 26898 this.properties.rotation, 26899 s, 26900 n 26901 ); 26902 Mi( 26903 this.id, 26904 "nodes", 26905 o, 26906 [e, t, i],
26907 r.nodes, 26908 (a, l) => this.getDatumId(l) 26909 ), ol(this, "callout", this.ctx.animationManager, this.calloutLabelSelection), ol(this, "sector", this.ctx.animationManager, this.labelSelection), ol(this, "highlight", this.ctx.animationManager, this.highlightLabelSelection), this.previousRadiusScale.range = this.radiusScale.range; 26910 } 26911 getDatumIdFromData(e) { 26912 const { calloutLabelKey: t, sectorLabelKey: i, legendItemKey: s } = this.properties; 26913 if (this.processedData?.reduced?.animationValidation?.uniqueKeys) { 26914 if (s) 26915 return e[s]; 26916 if (t) 26917 return e[t]; 26918 if (i) 26919 return e[i]; 26920 } 26921 } 26922 getDatumId(e) { 26923 const { datumIndex: t } = e, i = this.getDatumIdFromData(e.datum); 26924 return i != null ? String(i) : `${t}`; 26925 } 26926}; 26927k1.className = "PieSeries"; 26928k1.type = "pie"; 26929var zK = { 26930 type: "series", 26931 optionsKey: "series[]", 26932 packageType: "community", 26933 chartTypes: ["polar"], 26934 identifier: "pie", 26935 moduleFactory: (e) => new k1(e), 26936 tooltipDefaults: { range: "exact" }, 26937 themeTemplate: _K, 26938 paletteFactory: H2 26939}; 26940function HK() { 26941 fr.register( 26942 QF, 26943 ZY, 26944 fY, 26945 xK, 26946 P2, 26947 TK, 26948 O2, 26949 PK, 26950 BK, 26951 zK, 26952 LK 26953 ); 26954 for (const e of [Sl, zd, Yd, Oc, qc]) 26955 ia.register(e.type, { 26956 moduleFactory: (t) => new e(t), 26957 hidden: e === Oc 26958 }); 26959} 26960function VK() { 26961 for (const e of fr.modules) { 26962 if (e.packageType === "enterprise" && !f$(e) && Ee.errorOnce("Unexpected enterprise module registered: " + e.identifier), e.type === "root" && e.themeTemplate) 26963 for (const t of e.chartTypes) 26964 ww.set(t, e.themeTemplate); 26965 if (e.type === "series") { 26966 if (e.chartTypes.length > 1) 26967 throw new Error(`AG Charts - Module definition error: ${e.identifier}`); 26968 Nn.register(e.identifier, e); 26969 } 26970 if (e.type === "series-option" && e.themeTemplate) 26971 for (const t of e.seriesTypes) 26972 Nn.setThemeTemplate(t, e.themeTemplate); 26973 if (e.type === "axis-option" && e.themeTemplate) 26974 for (const t of e.axisTypes) { 26975 const i = ia.getThemeTemplate(t), s = ht(e.themeTemplate, i); 26976 ia.setThemeTemplate(t, s); 26977 } 26978 e.type === "axis" && ia.register(e.identifier, e), e.type === "legend" && Mx.register(e.identifier, e); 26979 } 26980 if (fr.hasEnterpriseModules()) { 26981 const e = m$(); 26982 e.length > 0 && Ee.errorOnce("Enterprise modules expected but not registered: ", e); 26983 } 26984} 26985function UK(e) { 26986 return e.type === "sankey" || e.type === "chord"; 26987} 26988var P1 = class extends Pl { 26989 getChartType() { 26990 return "flow-proportion"; 26991 } 26992 async updateData() { 26993 await super.updateData(); 26994 const { nodes: e } = this.getOptions(); 26995 this.series.forEach((t) => { 26996 UK(t) && t.setChartNodes(e); 26997 }); 26998 } 26999 performLayout(e) { 27000 const { seriesRoot: t, annotationRoot: i } = this, { layoutBox: s } = e; 27001 s.shrink(this.seriesArea.padding.toJson()); 27002 const n = s.clone(); 27003 this.seriesRect = n, this.animationRect = n, t.visible = this.series.some((o) => o.visible); 27004 for (const o of [t, i]) 27005 o.translationX = Math.floor(n.x), o.translationY = Math.floor(n.y); 27006 this.ctx.layoutManager.emitLayoutComplete(e, { 27007 series: { visible: t.visible, rect: n, paddedRect: n } 27008 }); 27009 } 27010}; 27011P1.className = "FlowProportionChart"; 27012P1.type = "flow-proportion"; 27013var Nc = class extends lx { 27014 constructor() { 27015 super(...arguments), this.shape = "polygon", this.innerRadiusRatio = 0, this.defaultTickMinSpacing = 20; 27016 } 27017 computeLabelsBBox(e, t) { 27018 return null; 27019 } 27020 computeRange() { 27021 } 27022 getAxisLinePoints() { 27023 } 27024}; 27025S([ 27026 D(si(["polygon", "circle"], "a polar axis shape")) 27027], Nc.prototype, "shape", 2); 27028S([ 27029 D(Pt) 27030], Nc.prototype, "innerRadiusRatio", 2); 27031function WK(e) { 27032 return e.type === "radial-gauge"; 27033} 27034function jK(e) { 27035 return e.type === "linear-gauge"; 27036} 27037var F1 = class extends Pl { 27038 getChartType() { 27039 return "gauge"; 27040 } 27041 updateRadialGauge(e, t) { 27042 const i = this.axes.find( 27043 (N) => N.direction === "x" 27044 /* X */ 27045 ); 27046 if (!(i instanceof Nc)) 27047 return; 27048 i.computeRange(); 27049 const s = e.x, n = s + e.width, o = e.y, r = o + e.height, [a, l] = i.range, u = Zk(l - a) > Math.PI, d = u || uo(1.5 * Math.PI, a, l), p = u || uo(0 * Math.PI, a, l), f = u || uo(0.5 * Math.PI, a, l), m = u || uo(1 * Math.PI, a, l); 27050 let y; 27051 m && !p ? y = "right" : !m && p ? y = "left" : y = "center"; 27052 let b; 27053 d && !f ? b = "bottom" : !d && f ? b = "top" : b = "middle"; 27054 const C = M1({ 27055 startAngle: a, 27056 endAngle: l, 27057 innerRadius: 0, 27058 outerRadius: 0.5 27059 }), w = -(C.x + C.width / 2) * 2, M = -(C.y + C.height / 2) * 2, { minimumRadius: A = 0, maximumRadius: I } = t, L = Math.max( 27060 0.5 * Math.min(e.width / C.width, e.height / C.height), 27061 // seriesRect may have negative size 27062 0 27063 ); 27064 let k = Math.min(I ?? 1 / 0, Math.max(L, A ?? 0)); 27065 const B = 8; 27066 for (let N = 0; N < B; N += 1) { 27067 const W = k <= A || N === B - 1, se = e.x + e.width / 2 + w * k, ue = e.y + e.height / 2 + M * k; 27068 i.translation.x = se, i.translation.y = ue, i.gridLength = k, i.calculateLayout(); 27069 const Ce = i.computeLabelsBBox({ hideWhenNecessary: W }, e); 27070 if (W) 27071 break; 27072 let te = 0; 27073 if (Ce != null) { 27074 const q = Ce.x + se, $ = q + Ce.width, T = Ce.y + ue, E = T + Ce.height; 27075 te = Math.max( 27076 o - T, 27077 s - q, 27078 E - r, 27079 $ - n, 27080 0 27081 ); 27082 } 27083 if (te > 0) 27084 k = Math.max(k - te, A); 27085 else 27086 break; 27087 } 27088 i.translation.x = e.x + e.width / 2 + w * k, i.translation.y = e.y + e.height / 2 + M * k, t.centerX = e.width / 2 + w * k, t.centerY = e.height / 2 + M * k, t.radiu
27088s = k, t.textAlign = y, t.verticalAlign = b, (k === 0 || k > L) && Ee.warnOnce("There was insufficient space to display the Radial Gauge."); 27089 } 27090 updateLinearGauge(e, t) { 27091 const i = this.axes.find( 27092 (b) => b.direction === "x" 27093 /* X */ 27094 ), s = this.axes.find( 27095 (b) => b.direction === "y" 27096 /* Y */ 27097 ); 27098 if (!(i instanceof Pc) || !(s instanceof Pc)) 27099 return e; 27100 const { horizontal: n, thickness: o } = t; 27101 let r = 0, a = 0; 27102 const l = new mo(); 27103 l.domain = [0, 100], l.range = n ? i.range : s.range; 27104 const c = l.ticks(); 27105 n ? r = t.computeInset("x", c) : a = t.computeInset("y", c); 27106 const u = e.width - Math.abs(r), d = e.height - Math.abs(a), p = Math.max(n ? u : o, 0), f = Math.max(n ? o : d, 0), m = e.x + (u - p) / 2 + Math.max(r, 0), y = e.y + (d - f) / 2 - Math.min(a, 0); 27107 i.range = [0, p], i.gridLength = p, i.calculateLayout(), i.translation.x = m, i.translation.y = y + (i.position === "bottom" ? o : 0), s.range = [0, f], s.gridLength = f, s.calculateLayout(), s.translation.x = m + (s.position === "right" ? o : 0), s.translation.y = y, t.originX = m - e.x, t.originY = y - e.y, (p === 0 || f === 0) && Ee.warnOnce("There was insufficient space to display the Linear Gauge."); 27108 } 27109 performLayout(e) { 27110 const { seriesRoot: t, annotationRoot: i, series: s, seriesArea: n } = this, { layoutBox: o } = e, r = o.clone(); 27111 o.shrink(n.padding.toJson()); 27112 const a = this.series[0]; 27113 WK(a) ? this.updateRadialGauge(o, a) : jK(a) && this.updateLinearGauge(o, a), this.axes.forEach((l) => l.update()), this.seriesRect = r.clone().translate(r.x - o.x, r.y - o.y), this.animationRect = o, t.visible = s.some((l) => l.visible); 27114 for (const l of [t, i]) 27115 l.translationX = Math.floor(o.x), l.translationY = Math.floor(o.y); 27116 this.ctx.layoutManager.emitLayoutComplete(e, { 27117 series: { visible: t.visible, rect: r, paddedRect: o } 27118 }); 27119 } 27120 getAriaLabel() { 27121 const e = [], t = this.getCaptionText(); 27122 t.length !== 0 && e.push(t); 27123 for (const s of this.series) 27124 e.push(s.getCaptionText()); 27125 const i = e.join(". "); 27126 return this.ctx.localeManager.t("ariaAnnounceGaugeChart", { caption: i }); 27127 } 27128}; 27129F1.className = "GaugeChart"; 27130F1.type = "gauge"; 27131var O1 = class extends Pl { 27132 constructor(e, t) { 27133 super(e, t); 27134 } 27135 getChartType() { 27136 return "hierarchy"; 27137 } 27138 performLayout(e) { 27139 const { seriesRoot: t, annotationRoot: i } = this, { layoutBox: s } = e; 27140 s.shrink(this.seriesArea.padding.toJson()); 27141 const n = s.clone(); 27142 this.seriesRect = n, this.animationRect = n; 27143 for (const o of [t, i]) 27144 o.translationX = Math.floor(n.x), o.translationY = Math.floor(n.y); 27145 t.visible = this.series[0].visible, t.setClipRect(n.clone()), this.ctx.layoutManager.emitLayoutComplete(e, { 27146 series: { visible: !0, rect: n, paddedRect: n } 27147 }); 27148 } 27149 getAriaLabel() { 27150 const e = this.getCaptionText(); 27151 return this.ctx.localeManager.t("ariaAnnounceHierarchyChart", { caption: e }); 27152 } 27153}; 27154O1.className = "HierarchyChart"; 27155O1.type = "hierarchy"; 27156var N1 = class extends Pl { 27157 constructor(e, t) { 27158 super(e, t), this.padding = new kl(40), this.ctx.axisManager.axisGroup.zIndex = 5; 27159 } 27160 getChartType() { 27161 return "polar"; 27162 } 27163 async performLayout(e) { 27164 const { layoutBox: t } = e; 27165 t.shrink(this.seriesArea.padding.toJson()); 27166 const i = t.clone(); 27167 this.seriesRect = i, this.animationRect = i, this.seriesRoot.translationX = i.x, this.seriesRoot.translationY = i.y, await this.computeCircle(i), this.axes.forEach((s) => s.update()), this.ctx.layoutManager.emitLayoutComplete(e, { 27168 series: { visible: !0, rect: i, paddedRect: i } 27169 }); 27170 } 27171 updateAxes(e, t, i, s) { 27172 const n = this.axes.find( 27173 (l) => l.direction === "x" 27174 /* X */ 27175 ), o = this.axes.find( 27176 (l) => l.direction === "y" 27177 /* Y */ 27178 ); 27179 if (!(n instanceof Nc) || !(o instanceof Nc)) 27180 return; 27181 const r = n.scale, a = o.innerRadiusRatio; 27182 n.innerRadiusRatio = a, n.computeRange(), n.gridLength = s, o.gridAngles = r.ticks?.().map((l) => r.convert(l)), o.gridRange = n.range, o.range = [s, s * a], [n, o].forEac
27182h((l) => { 27183 l.translation.x = e.x + t, l.translation.y = e.y + i, l.calculateLayout(); 27184 }); 27185 } 27186 async computeCircle(e) { 27187 const t = this.series.filter($K), i = this.axes.filter(YK), s = (c, u, d) => { 27188 this.updateAxes(e, c, u, d), t.forEach((f) => { 27189 f.centerX = c, f.centerY = u, f.radius = d; 27190 }); 27191 const p = t.filter((f) => f.type === "donut" || f.type === "pie"); 27192 if (p.length > 1) { 27193 const f = p.map((m) => { 27194 const y = m.getInnerRadius(); 27195 return { series: m, innerRadius: y }; 27196 }).sort((m, y) => m.innerRadius - y.innerRadius); 27197 f.at(-1).series.surroundingRadius = void 0; 27198 for (let m = 0; m < f.length - 1; m++) 27199 f[m].series.surroundingRadius = f[m + 1].innerRadius; 27200 } 27201 }, n = e.width / 2, o = e.height / 2, r = Math.max(0, Math.min(e.width, e.height) / 2); 27202 let a = r; 27203 s(n, o, a); 27204 const l = async ({ hideWhenNecessary: c = !1 } = {}) => { 27205 const u = []; 27206 for (const f of vc(i, t)) { 27207 const m = await f.computeLabelsBBox({ hideWhenNecessary: c }, e); 27208 m && u.push(m); 27209 } 27210 if (u.length === 0) { 27211 s(n, o, r); 27212 return; 27213 } 27214 const d = _e.merge(u), p = this.refineCircle(d, a, e); 27215 s(p.centerX, p.centerY, p.radius), a = p.radius; 27216 }; 27217 await l(), await l(), await l(), await l({ hideWhenNecessary: !0 }), await l({ hideWhenNecessary: !0 }); 27218 for (const c of vc(i, t)) 27219 await c.computeLabelsBBox({ hideWhenNecessary: !0 }, e); 27220 return { radius: a, centerX: n, centerY: o }; 27221 } 27222 refineCircle(e, t, i) { 27223 const n = -t, o = -t, r = t, a = t; 27224 let l = Math.max(0, n - e.x), c = Math.max(0, o - e.y), u = Math.max(0, e.x + e.width - r), d = Math.max(0, e.y + e.height - a); 27225 l = u = Math.max(l, u), c = d = Math.max(c, d); 27226 const p = i.width - l - u, f = i.height - c - d; 27227 let m = Math.min(p, f) / 2; 27228 const y = 0.5 * i.width / 2, b = 0.5 * i.height / 2, C = Math.min(y, b); 27229 if (m < C) { 27230 m = C; 27231 const A = l + u, I = c + d; 27232 if (2 * m + I > i.height) { 27233 const L = i.height - 2 * m; 27234 Math.min(c, d) * 2 > L ? (c = L / 2, d = L / 2) : c > d ? c = L - d : d = L - c; 27235 } 27236 if (2 * m + A > i.width) { 27237 const L = i.width - 2 * m; 27238 Math.min(l, u) * 2 > L ? (l = L / 2, u = L / 2) : l > u ? l = L - u : u = L - l; 27239 } 27240 } 27241 const w = l + 2 * m + u, M = c + 2 * m + d; 27242 return { 27243 centerX: (i.width - w) / 2 + l + m, 27244 centerY: (i.height - M) / 2 + c + m, 27245 radius: m 27246 }; 27247 } 27248}; 27249N1.className = "PolarChart"; 27250N1.type = "polar"; 27251function $K(e) { 27252 return e instanceof zy; 27253} 27254function YK(e) { 27255 return e instanceof Nc; 27256} 27257var _1 = class extends Pl { 27258 constructor(e, t) { 27259 super(e, t); 27260 } 27261 getChartType() { 27262 return "standalone"; 27263 } 27264 performLayout(e) { 27265 const { seriesRoot: t, annotationRoot: i } = this, { layoutBox: s } = e, n = s.clone(); 27266 s.shrink(this.seriesArea.padding.toJson()), this.seriesRect = s, this.animationRect = s; 27267 for (const o of [t, i]) 27268 o.translationX = Math.floor(s.x), o.translationY = Math.floor(s.y); 27269 t.visible = this.series[0].visible, this.ctx.layoutManager.emitLayoutComplete(e, { 27270 series: { visible: !0, rect: n, paddedRect: s } 27271 }); 27272 } 27273 getAriaLabel() { 27274 const e = this.getCaptionText(); 27275 return this.ctx.localeManager.t("ariaAnnounceHierarchyChart", { caption: e }); 27276 } 27277}; 27278_1.className = "StandaloneChart"; 27279_1.type = "standalone"; 27280var Vy = Math.PI / 180, s0 = (e) => e * Vy, n0 = (e) => -Math.log(Math.tan(Math.PI * 0.25 + e * Vy * 0.5)), o0 = (e) => e / Vy, r0 = (e) => (Math.atan(Math.exp(-e)) - Math.PI * 0.25) / (Vy * 0.5), Tw = class Lw { 27281 constructor(t, i) { 27282 this.domain = t, this.range = i, this.type = "mercator", this.bounds = Lw.bounds(t); 27283 } 27284 static bounds(t) { 27285 const [[i, s], [n, o]] = t, r = s0(i), a = n0(s), l = s0(n), c = n0(o); 27286 return new _e(Math.min(r, l), Math.min(a, c), Math.abs(l - r), Math.abs(c - a)); 27287 } 27288 static fixedScale() { 27289 return new Lw( 27290 [ 27291 [o0(0), r0(0)], 27292 [o0(1), r0(1)] 27293 ], 27294 [ 27295 [0, 0], 27296 [1, 1] 27297 ] 27298 ); 27299 } 27300 convert([t, i]) { 27301 const [[s, n], [o, r]] = this.range, a = (o - s) / this.bounds.width, l = (r - n) / this.bounds.height; 27302 return [(s0(t) - this.bounds.x) * a + s, (n0(i) - this.bounds.y) * l + n]; 27303 } 27304 invert([t, i]) { 27305 const [[s, n], [o, r]] = this.range, a = (o - s) / this.bounds.width, l = (r - n) / this.bounds.height; 27306 return [o0((t - s) / a + this.bounds.x), r0((i - n) / l + this.bounds.y)]; 27307 } 27308}; 27309function xR(e) { 27310 return e.type === "map-shape" || e.type === "map-line" || e.type === "map-marker" || e.type === "map-shape-background" || e.type === "map-line-background"; 27311} 27312var B1 = class extends Pl { 27313 constructor(e, t) { 27314 super(e, t), this.xAxis = new Sl(this.getModuleContext()), this.xAxis.position = "bottom", this.yAxis = new Sl(this.getModuleContext()), this.yAxis.position = "left", this.ctx.zoomManager.updateAxes([this.xAxis, this.yAxis]); 27315 } 27316 getChartType() { 27317 return "topology"; 27318 } 27319 async updateData() { 27320 await super.updateData(); 27321 const { topology: e } = this.getOptions();
27322 this.series.forEach((t) => { 27323 xR(t) && t.setChartTopology(e); 27324 }); 27325 } 27326 performLayout(e) { 27327 const { seriesRoot: t, annotationRoot: i } = this, { layoutBox: s } = e; 27328 s.shrink(this.seriesArea.padding.toJson()); 27329 const n = s.clone(); 27330 this.seriesRect = n, this.animationRect = n; 27331 const o = this.series.filter(xR), r = o.reduce((c, u) => { 27332 if (!u.visible) 27333 return c; 27334 const d = u.topologyBounds; 27335 return d == null ? c : c == null ? d : (c.merge(d), c); 27336 }, void 0); 27337 let a; 27338 if (r != null) { 27339 const { lon0: c, lat0: u, lon1: d, lat1: p } = r, f = [ 27340 [c, u], 27341 [d, p] 27342 ], m = Tw.bounds(f), { width: y, height: b } = n, C = Math.min(y / m.width, b / m.height), w = m.width * C, M = m.height * C, A = (y - w) / 2, I = (b - M) / 2, L = A, k = I, B = A + w, N = I + M, W = this.ctx.zoomManager.getAxisZoom(this.xAxis.id), se = this.ctx.zoomManager.getAxisZoom(this.yAxis.id), ue = (B - L) / (W.max - W.min), Ce = L - ue * W.min, te = (N - k) / (1 - se.min - (1 - se.max)), q = k - te * (1 - se.max); 27343 a = new Tw(f, [ 27344 [Ce, q], 27345 [Ce + ue, q + te] 27346 ]); 27347 } 27348 o.forEach((c) => { 27349 c.scale = a; 27350 }); 27351 const l = this.series.some((c) => c.visible); 27352 t.visible = l; 27353 for (const c of [t, i]) 27354 c.translationX = Math.floor(n.x), c.translationY = Math.floor(n.y), c.setClipRect(n.clone()); 27355 this.ctx.layoutManager.emitLayoutComplete(e, { 27356 series: { visible: l, rect: n, paddedRect: n } 27357 }); 27358 } 27359}; 27360B1.className = "TopologyChart"; 27361B1.type = "topology"; 27362var na = { 27363 isEnterprise: !1 27364}, ro = /* @__PURE__ */ Symbol("IGNORED_PROP"); 27365function Bn(e, t) { 27366 const i = {}; 27367 for (const [s, n] of Object.entries(t)) 27368 n !== ro && Object.hasOwn(e, s) && (i[s] = n); 27369 return i; 27370} 27371function KK(e) { 27372 return e.type === "radial-gauge"; 27373} 27374function ZK(e) { 27375 return e.type === "linear-gauge"; 27376} 27377function qK(e) { 27378 const { 27379 animation: t, 27380 background: i, 27381 container: s, 27382 contextMenu: n, 27383 footnote: o, 27384 height: r, 27385 listeners: a, 27386 locale: l, 27387 minHeight: c, 27388 minWidth: u, 27389 padding: d, 27390 subtitle: p, 27391 theme: f, 27392 title: m, 27393 width: y, 27394 type: b, 27395 cursor: C, 27396 nodeClickRange: w, 27397 tooltip: M, 27398 value: A, 27399 scale: I = {}, 27400 startAngle: L, 27401 endAngle: k, 27402 highlightStyle: B, 27403 segmentation: N, 27404 bar: W, 27405 needle: se, 27406 targets: ue, 27407 outerRadius: Ce, 27408 innerRadius: te, 27409 outerRadiusRatio: q, 27410 innerRadiusRatio: $, 27411 cornerRadius: T, 27412 cornerMode: E, 27413 label: P, 27414 secondaryLabel: G, 27415 spacing: _, 27416 ...K 27417 } = e, { 27418 fills: ce, 27419 fillMode: ae, 27420 fill: be, 27421 fillOpacity: oe, 27422 stroke: U, 27423 strokeWidth: j, 27424 strokeOpacity: J, 27425 lineDash: ne, 27426 lineDashOffset: me, 27427 min: V = 0, 27428 max: X = 1, 27429 interval: H = {}, 27430 label: Q = {} 27431 } = I, re = Bn(e, { 27432 animation: t, 27433 background: i, 27434 container: s, 27435 contextMenu: n, 27436 footnote: o, 27437 height: r, 27438 listeners: a, 27439 locale: l, 27440 minHeight: c, 27441 minWidth: u, 27442 padding: d, 27443 subtitle: p, 27444 theme: f, 27445 title: m, 27446 width: y 27447 }), Se = Bn(I, { 27448 fills: ce, 27449 fillMode: ae, 27450 fill: be, 27451 fillOpacity: oe, 27452 stroke: U, 27453 strokeWidth: j, 27454 strokeOpacity: J, 27455 lineDash: ne, 27456 lineDashOffset: me 27457 }), Le = Bn(e, { 27458 startAngle: ro, 27459 endAngle: ro, 27460 needle: se != null ? { enabled: !0, ...se } : ro, 27461 scale: Se, 27462 type: b, 27463 cursor: C, 27464 nodeClickRange: w, 27465 listeners: a, 27466 tooltip: M, 27467 value: A, 27468 highlightStyle: B, 27469 segmentation: N, 27470 bar: W, 27471 targets: ue, 27472 outerRadius: Ce, 27473 innerRadius: te, 27474 outerRadiusRatio: q, 27475 innerRadiusRatio: $, 27476 cornerRadius: T, 27477 cornerMode: E, 27478 label: P, 27479 secondaryLabel: G, 27480 spacing: _, 27481 ...K 27482 }); 27483 return { 27484 ...re, 27485 series: [Le], 27486 axes: [ 27487 { 27488 type: "angle-number", 27489 min: V, 27490 max: X, 27491 startAngle: L, 27492 endAngle: k, 27493 interval: H ?? {}, 27494 label: Q ?? {} 27495 }, 27496 { type: "radius-number" } 27497 ] 27498 }; 27499} 27500function QK(e) { 27501 const { 27502 animation: t, 27503 background: i, 27504 container: s, 27505 contextMenu: n, 27506 footnote: o, 27507 height: r, 27508 listeners: a, 27509 locale: l, 27510 minHeight: c, 27511 minWidth: u, 27512 padding: d, 27513 subtitle: p, 27514 theme: f, 27515 title: m, 27516 width: y, 27517 type: b, 27518 cursor: C, 27519 nodeClickRange: w, 27520 tooltip: M, 27521 value: A, 27522 scale: I = {}, 27523 direction: L = "vertical", 27524 thickness: k, 27525 highlightStyle: B, 27526 segmentation: N, 27527 bar: W, 27528 targets: se, 27529 cornerRadius: ue, 27530 cornerMode: Ce, 27531 label: te, 27532 ...q 27533 } = e, { 27534 fills: $, 27535 fillMode: T, 27536 fill: E, 27537 fillOpacity: P, 27538 stroke: G, 27539 strokeWidth: _, 27540 strokeOpacity: K, 27541 lineDash: ce, 27542 lineDashOffset: ae, 27543 min: be = 0, 27544 max: oe = 1, 27545 interval: U = {}, 27546 label: j = {} 27547 } = I, J = Bn(e, { 27548 animation: t, 27549 background: i, 27550 container: s, 27551 contextMenu: n, 27552 footnote: o, 27553 height: r, 27554 listeners: a, 27555 locale: l, 27556 minHeight: c, 27557 minWidth: u, 27558 padding: d, 27559 subtitle: p, 27560 theme: f, 27561 title: m, 27562 width: y 27563 }), ne = Bn(I, { 27564 fills: $, 27565 fillMode: T, 27566 fill: E, 27567 fillOpacity: P, 27568 stroke: G, 27569 strokeWidth: _, 27570 strokeOpacity: K, 27571 lineDash: ce, 27572 lineDashOffset: ae 27573 }), me = Bn(e, { 27574 scale: ne, 27575 type: b, 27576 cursor: C, 27577 nodeClickRange: w, 27578 listeners: a, 27579 tooltip: M, 27580 value: A, 27581 direction: L, 27582 thickness: k, 27583 highlightStyle: B, 27584 segmentation: N, 27585 bar: W, 27586 targets: se, 27587 cornerRadius: ue, 27588 cornerMode: Ce, 27589 label: te, 27590 ...q 27591 }), { placement: V, ...X } = j; 27592 let H, Q; 27593 const re = L === "horizontal"; 27594 re ? (H = V === "before" ? "top" : "bottom", Q = "left") : (H = V === "after" ? "right" : "left", Q = "bottom"); 27595 const Se = { 27596 type: "number", 27597 position: H, 27598 min: be, 27599 max: oe, 27600 reverse: !re, 27601 interval: U, 27602 label: X, 27603 nice: !1 27604 }, Le = { 27605 type: "number", 27606 position: Q, 27607 min: 0, 27608 max: 1, 27609 label: { 27610 enabled: !1 27611 } 27612 }; 27613 return { 27614 ...J, 27615 series: [me], 27616 axes: re ? [Se, Le] : [Le, Se] 27617 }; 27618} 27619function MR(e, t) { 27620 if (t == null) 27621 return e; 27622 const { targets: i, ...s } = t; 27623 return e = ht(e, s), e.targets != null && i != null && (e.targets = Tm(e.targets, i)), e; 27624} 27625function XK(e, t) { 27626 if (KK(e)) { 27627 const C = MR(e, t); 27628 return qK(C); 27629 } else if (ZK(e)) { 27630 const C = MR(e, t); 27631 return QK(C); 27632 } 27633 const { 27634 animation: i, 27635 background: s, 27636 container: n, 27637 contextMenu: o, 27638 footnote: r, 27639 height: a, 27640 listeners: l, 27641 locale: c, 27642 minHeight: u, 27643 minWidth: d, 27644 padding: p, 27645 subtitle: f, 27646 theme: m, 27647 title: y, 27648 width: b 27649 } = e; 27650 return Bn(e, { 27651 animation: i, 27652 background: s, 27653 container: n, 27654 contextMenu: o, 27655 footnote: r, 27656 height: a, 27657 listeners: l, 27658 locale: c, 27659 minHeight: u, 27660 minWidth: d, 27661 padding: p, 27662 subtitle: f, 27663 theme: m, 27664 title: y, 27665 width: b 27666 }); 27667} 27668function qi(e, t) { 27669 if (Qs(e)) 27670 return t(e); 27671} 27672var JK = ["ohlc", "line", "step-line", "hlc", "high-low", "candlestick", "hollow-candlestick"]; 27673function eZ(e, t, i) { 27674 const { 27675 dateKey: s = "date", 27676 highKey: n = "high", 27677 openKey: o = "open", 27678 lowKey: r = "low", 27679 closeKey: a = "close", 27680 volumeKey: l = "volume", 27681 chartType: c = "candlestick", 27682 navigator: u = !1, 27683 volume: d = !0, 27684 rangeButtons: p = !0, 27685 statusBar: f = !0, 27686 toolbar: m = !0, 27687 zoom: y = !0, 27688 theme: b, 27689 data: C, 27690 ...w 27691 } = e, M = iZ(b, c, s, n, r, o, a), A = tZ(b, i, o, a, d, l), L = { 27692 navigator: { 27693 enabled: u, 27694 ...d ? {
27695 miniChart: { 27696 enabled: u, 27697 series: [ 27698 { 27699 type: "line", 27700 xKey: s, 27701 yKey: l, 27702 marker: { enabled: !1 } 27703 } 27704 ] 27705 }, 27706 height: 40, 27707 minHandle: { 27708 height: 46 27709 }, 27710 maxHandle: { 27711 height: 46 27712 } 27713 } : null 27714 } 27715 }, k = { 27716 annotations: { 27717 enabled: m, 27718 toolbar: { 27719 enabled: m 27720 }, 27721 optionsToolbar: { 27722 enabled: m 27723 }, 27724 // @ts-expect-error undocumented option 27725 data: C, 27726 xKey: s, 27727 volumeKey: d ? l : void 0 27728 } 27729 }, B = f ? { 27730 statusBar: { 27731 enabled: !0, 27732 data: C, 27733 highKey: n, 27734 openKey: o, 27735 lowKey: r, 27736 closeKey: a, 27737 volumeKey: d ? l : void 0 27738 } 27739 } : null, N = { 27740 zoom: { 27741 enabled: y, 27742 // @todo(AG-13612) autoScaling?: AgZoomAutoScaling; 27743 // autoScaling: { 27744 // enabled: true, 27745 // }, 27746 // @ts-expect-error undocumented option 27747 enableIndependentAxes: !0 27748 } 27749 }, W = { 27750 ranges: { 27751 enabled: p 27752 } 27753 }, se = d ? [ 27754 { 27755 type: "number", 27756 position: "left", 27757 keys: [l], 27758 label: { enabled: !1 }, 27759 crosshair: { enabled: !1 }, 27760 gridLine: { enabled: !1 }, 27761 nice: !1, 27762 // @ts-expect-error undocumented option 27763 layoutConstraints: { 27764 stacked: !1, 27765 width: 20, 27766 unit: "percentage", 27767 align: "end" 27768 } 27769 } 27770 ] : []; 27771 return { 27772 theme: { 27773 baseTheme: typeof b == "string" ? b : "ag-financial", 27774 ...ht(typeof b == "object" ? b : null, { 27775 overrides: { 27776 common: { 27777 title: { padding: 4 }, 27778 padding: { 27779 top: 6, 27780 right: 8, 27781 bottom: 5 27782 }, 27783 chartToolbar: { 27784 enabled: m 27785 } 27786 } 27787 } 27788 }) 27789 }, 27790 animation: { enabled: !1 }, 27791 legend: { enabled: !1 }, 27792 series: [...A, ...M], 27793 seriesArea: { clip: !0 }, 27794 axes: [ 27795 { 27796 type: "number", 27797 position: "right", 27798 keys: [o, a, n, r], 27799 interval: { 27800 maxSpacing: qi(b, (ue) => ue.overrides?.common?.axes?.number?.interval?.maxSpacing) ?? 45 27801 }, 27802 label: { 27803 format: qi(b, (ue) => ue.overrides?.common?.axes?.number?.label?.format) ?? ".2f" 27804 }, 27805 crosshair: { 27806 enabled: !0, 27807 snap: !1 27808 }, 27809 // @ts-expect-error undocumented option 27810 layoutConstraints: { 27811 stacked: !1, 27812 width: 100, 27813 unit: "percentage", 27814 align: "start" 27815 } 27816 }, 27817 ...se, 27818 { 27819 type: "ordinal-time", 27820 position: "bottom", 27821 line: { 27822 enabled: !1 27823 }, 27824 label: { 27825 enabled: !0 27826 }, 27827 crosshair: { 27828 enabled: !0 27829 } 27830 } 27831 ], 27832 tooltip: { enabled: !1 }, 27833 data: C, 27834 ...k, 27835 ...L, 27836 ...B, 27837 ...N, 27838 ...W, 27839 ...w 27840 }; 27841} 27842function tZ(e, t, i, s, n, o) { 27843 if (!n) 27844 return []; 27845 const r = qi(e, (l) => l.overrides?.bar?.series?.fill), a = r ? { fill: r } : { 27846 itemStyler({ datum: l }) { 27847 const { up: c, down: u } = t().palette; 27848 return { fill: l[i] < l[s] ? c?.fill : u?.fill }; 27849 } 27850 }; 27851 return [ 27852 { 27853 type: "bar", 27854 xKey: "date", 27855 yKey: o, 27856 tooltip: { enabled: !1 }, 27857 highlight: { enabled: !1 }, 27858 fillOpacity: qi(e, (l) => l.overrides?.bar?.series?.fillOpacity) ?? 0.5, 27859 ...a, 27860 // @ts-expect-error undocumented option 27861 focusPriority: 1, 27862 fastDataProcessing: !0 27863 } 27864 ]; 27865} 27866var a0 = "range-area"; 27867function iZ(e, t, i, s, n, o, r) { 27868 const a = { 27869 xKey: i, 27870 openKey: o, 27871 closeKey: r, 27872 highKey: s, 27873 lowKey: n 27874 }, l = { 27875 xKey: i, 27876 yKey: r 27877 }, c = { 27878 pickOutsideVisibleMinorAxis: !0 27879 }; 27880 switch (t ?? "candlestick") { 27881 case "ohlc": 27882 return sZ(c, a); 27883 case "line": 27884 return nZ(c, e, l); 27885 case "step-line": 27886 return oZ(c, e, l); 27887 case "hlc": 27888 return rZ(c, e, l, a); 27889 case "high-low": 27890 return aZ(c, e, a); 27891 case "candlestick": 27892 return AR(c, a); 27893 case "hollow-candlestick": 27894 return lZ(c, e, a); 27895 default: 27896 return Ee.warnOnce(`unknown chart type: ${t}; expected one of: ${JK.join(", ")}`), AR(c, a); 27897 } 27898} 27899function sZ(e, t) { 27900 return [ 27901 { 27902 type: "ohlc", 27903 // @ts-expect-error undocumented option 27904 focusPriority: 0, 27905 ...e, 27906 ...t 27907 } 27908 ]; 27909} 27910function nZ(e, t, i) { 27911 return [ 27912 { 27913 type: "line", 27914 // @ts-expect-error undocumented option 27915 focusPriority: 0, 27916 ...e, 27917 ...i, 27918 stroke: qi(t, (s) => s.overrides?.line?.series?.stroke) ?? Qd, 27919 marker: qi(t, (s) => s.overrides?.line?.series?.marker) ?? { enabled: !1 } 27920 } 27921 ]; 27922} 27923function oZ(e, t, i) { 27924 return [ 27925 { 27926 type: "line", 27927 // @ts-expect-error undocumented option 27928 focusPriority: 0, 27929 ...e, 27930 ...i, 27931 stroke: qi(t, (s) => s.overrides?.line?.series?.stroke) ?? Qd, 27932 interpolation: qi(t, (s) => s.overrides?.line?.series?.interpolation) ?? { 27933 type: "step" 27934 }, 27935 marker: qi(t, (s) => s.overrides?.line?.series?.marker) ?? { enabled: !1 } 27936 } 27937 ]; 27938} 27939function rZ(e, t, i, { xKey: s, highKey: n, closeKey: o, lowKey: r }) { 27940 const a = U2(a0, t); 27941 return [ 27942 { 27943 type: a0, 27944 // @ts-expect-error undocumented option 27945 focusPriority: 0, 27946 ...e, 27947 xKey: s, 27948 yHighKey: n, 27949 yLowKey: o, 27950 fill: a.fill ?? by, 27951 stroke: a.stroke ?? yy, 27952 fillOpacity: qi(t, (l) => l.overrides?.["range-area"]?.series?.fillOpacity) ?? 0.3, 27953 strokeWidth: qi(t, (l) => l.overrides?.["range-area"]?.series?.strokeWidth) ?? 2 27954 }, 27955 { 27956 type: a0, 27957 // @ts-expect-error undocumented option 27958 focusPriority: 0, 27959 ...e, 27960 xKey: s, 27961 yHighKey: o, 27962 yLowKey: r, 27963 fill: a.fill ?? wy, 27964 stroke: a.stroke ?? Cy, 27965 fillOpacity: qi(t, (l) => l.overrides?.["range-area"]?.series?.fillOpacity) ?? 0.3, 27966 strokeWidth: qi(t, (l) => l.overrides?.["range-area"]?.series?.strokeWidth) ?? 2 27967 }, 27968 { 27969 type: "line", 27970 ...e, 27971 ...i, 27972 stroke: qi(t, (l) => l.overrides?.line?.series?.stroke) ?? xy, 27973 strokeWidth: qi(t, (l) => l.overrides?.line?.series?.strokeWidth) ?? 2, 27974 marker: qi(t, (l) => l.overrides?.line?.series?.marker) ?? { enabled: !1 } 27975 } 27976 ]; 27977} 27978function aZ(e, t, { xKey: i, highKey: s, lowKey: n }) { 27979 const o = U2("range-bar", t); 27980 return [ 27981 { 27982 type: "range-bar", 27983 ...e, 27984 xKey: i, 27985 yHighKey: s, 27986 yLowKey: n, 27987 fill: o.fill ?? Sy, 27988 stroke: o.stroke ?? Qd, 27989 tooltip: { 27990 range: "nearest" 27991 }, 27992 // @ts-expect-error undocumented option 27993 focusPriority: 0, 27994 fastDataProcessing: !0 27995 } 27996 ]; 27997} 27998function AR(e, t) { 27999 return [ 28000 { 28001 type: "candlestick", 28002 // @ts-expect-error undocumented option 28003 focusPriority: 0, 28004 ...e, 28005 ...t 28006 } 28007 ]; 28008} 28009function lZ(e, t, i) { 28010 const s = qi(t, (n) => n.overrides?.candlestick?.series?.item); 28011 return [ 28012 { 28013 type: "candlestick", 28014 // @ts-expect-error undocumented option 28015 focusPriority: 0, 28016 ...e, 28017 ...i, 28018 item: { 28019 up: { 28020 fill: s?.up?.fill ?? "transparent" 28021 } 28022 } 28023 } 28024 ]; 28025} 28026function U2(e, t) { 28027 const i = qi(t, (n) => n.overrides?.[e]?.series?.fill), s = qi(t, (n) => n.overrides?.[e]?.series?.stroke); 28028 return { fill: i, stroke: s }; 28029} 28030var W2 = { 28031 title: { 28032 enabled: !1 28033 }, 28034 label: { 28035 enabled: !1 28036 }, 28037 line: { 28038 enabled: !1 28039 }, 28040 gridLine: { 28041 enabled: !1 28042 }, 28043 crosshair: { 28044 enabled: !1, 28045 stroke: Ay, 28046 lineDash: [0], 28047 label: { 28048 enabled: !1 28049 } 28050 } 28051}, l0 = { 28052 ...W2, 28053 nice: !1 28054}, c0 = { 28055 position: { 28056 type: "sparkline" 28057 } 28058}, u0 = { 28059 style: [{ stroke: xl }], 28060 width: 2 28061}, cZ = { 28062 number: { 28063 gridLine: u0 28064 }, 28065 time: { 28066 gridLine: u0 28067 }, 28068 category: { 28069 gridLine: u0 28070 } 28071}, uZ = { 28072 overrides: { 28073 common: { 28074 animation: { enabled: !1 }, 28075 contextMenu: { enabled: !1 }, 28076 keyboard: { enabled: !1 }, 28077 background: { visible: !1 }, 28078 padding: { 28079 top: 0, 28080 right: 0, 28081 bottom: 0, 28082 left: 0 28083 }, 28084 axes: { 28085 number: { 28086 ...l0, 28087 interval: { 28088 values: [0] 28089 } 28090 }, 28091 log: { 28092 ...l0 28093 }, 28094 time: { 28095 ...l0 28096 }, 28097 category: { 28098 ...W2 28099 } 28100 } 28101 }, 28102 bar: { 28103 series: { 28104 crisp: !1, 28105 label: { 28106 placement: "inside-end", 28107 padding: 4 28108 }, 28109 // @ts-expect-error undocumented option 28110 sparklineMode: !0 28111 }, 28112 tooltip: { 28113 ...c0, 28114 range: "nearest" 28115 }, 28116 axes: cZ 28117 }, 28118 line: { 28119 seriesArea: { 28120 padding: { 28121 top: 2, 28122 right: 2, 28123 bottom: 2, 28124 left: 2 28125 } 28126 }, 28127 series: { 28128 // @ts-expect-error undocumented option 28129 sparklineMode: !0, 28130 strokeWidth: 1, 28131 marker: { 28132 enabled: !1, 28133 size: 3 28134 }, 28135 tooltip: c0 28136 } 28137 }, 28138 area: { 28139 seriesArea: { 28140 padding: { 28141 top: 1, 28142 right: 0, 28143 bottom: 1, 28144 left: 0 28145 } 28146 }, 28147 series: { 28148 strokeWidth: 1, 28149 fillOpacity: 0.4, 28150 tooltip: c0 28151 } 28152 } 28153 } 28154}, j2 = Us(dZ); 28155function dZ(e, t) { 28156 return typeof e == "string" ? { 28157 ...t, 28158 baseTheme: e 28159 } : e != null ? { 28160 ...e, 28161 // @ts-expect-error internal implementation 28162 baseTheme: j2(e.baseTheme, t) 28163 } : t; 28164} 28165function $2(e) { 28166 if (Array.isArray(e) && e.length !== 0) { 28167 const t = e[0]; 28168 if (typeof t == "number") 28169 return { data: e.map((s, n) => ({ x: n, y: s })), series: [{ xKey: "x", yKey: "y" }], datumKey: "y" }; 28170 if (Array.isArray(t)) 28171 return { data: e.map((s) => ({ x: s[0], y: s[1], datum: s })), series: [{ xKey: "x", yKey: "y" }], datumKey: "datum" }; 28172 } 28173 return { data: e }; 28174} 28175function hZ(e, t) { 28176 switch (e?.type) { 28177 case "number": { 28178 const { type: i, visible: s, stroke: n, strokeWidth: o, min: r, max: a, reverse: l } = e; 28179 return Bn(e, { 28180 type: i, 28181 reverse: l, 28182 min: r, 28183 max: a 28184 }); 28185 } 28186 case "time": { 28187 const { type: i, visible: s, stroke: n, strokeWidth: o, min: r, max: a, reverse: l } = e; 28188 return Bn(e, { 28189 type: i, 28190 reverse: l, 28191 min: r, 28192 max: a 28193 }); 28194 } 28195 case "category": { 28196 const { 28197 type: i, 28198 visible: s, 28199 stroke: n, 28200 strokeWidth: o, 28201 paddingInner: r, 28202 paddingOuter: a, 28203 reverse: l 28204 } = e; 28205 return Bn(e, { 28206 type: i, 28207 reverse: l, 28208 paddingInner: r, 28209 paddingOuter: a 28210 }); 28211 } 28212 } 28213 return { type: t }; 28214} 28215function pZ(e, t, i) { 28216 const s = {}; 28217 return e?.stroke != null && (s.style = [{ stroke: e?.stroke }], s.enabled ?? (s.enabled = !0)), e?.strokeWidth != null && (s.width = e?.strokeWidth, s.enabled ?? (s.enabled = !0)), i.type === "bar" && i.direction !== "horizontal" && (s.enabled ?? (s.enabled = !0)), e?.visible != null && (s.enabled = e.visible), s.enabled ?? (s.enabled = t), s; 28218} 28219var gZ = Us((e, t, i) => (s) => { 28220 const n = s.datum[s.xKey], o = s.datum[s.yKey], r = i != null ? s.datum[i] : s.datum, a = t?.renderer?.({ context: e, datum: r, xValue: n, yValue: o }); 28221 if (typeof a == "string") 28222 return a; 28223 const l = a?.title, c = a?.content; 28224 return l != null && c != null ? { 28225 heading: l, 28226 title: void 0, 28227 // Undocumented 'compact' tooltip mode 28228 data: [{ label: void 0, value: c }] 28229 } : { 28230 heading: l ?? c ?? o.toFixed(2), 28231 title: void 0, 28232 data: [] 28233 }; 28234}); 28235function fZ(e) { 28236 const { 28237 background: t, 28238 container: i, 28239 height: s, 28240 listeners: n, 28241 locale: o, 28242 minHeight: r, 28243 minWidth: a, 28244 padding: l, 28245 width: c, 28246 theme: u, 28247 data: d, 28248 crosshair: p, 28249 axis: f, 28250 min: m, 28251 max: y, 28252 tooltip: b, 28253 context: C, 28254 ...w 28255 } = e, M = Bn(e, { 28256 background: t, 28257 container: i, 28258 height: s, 28259 listeners: n, 28260 locale: o, 28261 minHeight: r, 28262 minWidth: a, 28263 padding: l, 28264 width: c, 28265 tooltip: ro, 28266 context: ro, 28267 data: ro, 28268 crosshair: ro, 28269 axis: ro, 28270 min: ro, 28271 max: ro, 28272 theme: ro 28273 }), { data: A, series: [I] = [], datumKey: L } = $2(d), k = w; 28274 I != null && Object.assign(k, I), k.tooltip = { 28275 ...b, 28276 renderer: gZ(C, b, L) 28277 }, M.theme = j2(u, uZ), M.data = A, M.series = [k]; 28278 const B = k.type !== "bar" || k.direction !== "horizontal", [N, W] = B ? ["bottom", "left"] : ["left", "bottom"], se = { 28279 ...hZ(f, "category"), 28280 position: N, 28281 ...Bn(e, { crosshair: p }) 28282 }, ue = { 28283 type: "number", 28284 gridLine: pZ(f, !1, e), 28285 position: W, 28286 ...Bn(e, { min: m, max: y }) 28287 }; 28288 return M.axes = B ? [ue, se] : [se, ue], M; 28289} 28290var mZ = { 28291 "price-volume": eZ, 28292 gauge: XK, 28293 sparkline: fZ 28294}, vZ = { 28295 sparkline: $2 28296}; 28297function DR(e, t) { 28298 let i = []; 28299 const s = ry(e), n = Ma(e), o = n ? ci.get(n) : "unknown"; 28300 for (const r of Hd) 28301 if (!(o !== "unknown" && !r.chartTypes.includes(o))) { 28302 if (r.type === "root" || r.type === "legend") { 28303 const a = e[r.optionsKey]; 28304 if (a == null) 28305 continue; 28306 r.optionsInnerKey ? a[r.optionsInnerKey] && (i.push(`${r.optionsKey}.${r.optionsInnerKey}`), delete a[r.optionsInnerKey]) : (i.push(r.optionsKey), delete e[r.optionsKey]); 28307 } else if (r.type === "axis") { 28308 if (!("axes" in e) || !e.axes?.some((a) => a.type === r.identifier)) 28309 continue; 28310 i.push(`axis[type=${r.identifier}]`), e.axes = e.axes.filter((a) => a.type !== r.identifier); 28311 } else if (r.type === "axis-option") { 28312 if (!("axes" in e) || !e.axes?.some((a) => a[r.optionsKey])) 28313 continue; 28314 i.push(`axis.${r.optionsKey}
28314`), e.axes.forEach((a) => { 28315 a[r.optionsKey] && delete a[r.optionsKey]; 28316 }); 28317 } else if (r.type === "series") { 28318 if (r.community || !e.series?.some((a) => a.type === r.identifier)) 28319 continue; 28320 i.push(`series[type=${r.identifier}]`), e.series = e.series.filter((a) => a.type !== r.identifier); 28321 } else if (r.type === "series-option") { 28322 if (!e.series?.some((a) => a[r.optionsKey])) 28323 continue; 28324 i.push(`series.${r.optionsKey}`), e.series.forEach((a) => { 28325 a[r.optionsKey] && delete a[r.optionsKey]; 28326 }); 28327 } 28328 } 28329 if (i.length && !t) { 28330 s && (i = ["AgCharts.createGauge"]); 28331 let r = "ag-charts-enterprise", a = "https://ag-grid.com/charts/javascript/installation/"; 28332 e.mode === "integrated" && (r = "ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise", a = "https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"), Ee.warnOnce( 28333 [ 28334 `unable to use these enterprise features as '${r}' has not been loaded:`, 28335 "", 28336 ...i, 28337 "", 28338 `See: ${a}` 28339 ].join(` 28340`) 28341 ); 28342 } 28343} 28344function yZ(e) { 28345 const t = "mode" in e && e.mode === "integrated"; 28346 for (const i of fr.byType("root", "legend")) { 28347 const s = e[i.optionsKey], n = s != null && s.enabled === !1, o = !("removable" in i) || i.removable === !0 || i.removable === "standalone-only" && !t; 28348 n && o && delete e[i.optionsKey]; 28349 } 28350} 28351var Uy = /* @__PURE__ */ Symbol("description"), CZ = /* @__PURE__ */ Symbol("required"); 28352function bZ(e, t, i) { 28353 const { errors: s } = Y2(e, t, i); 28354 for (const { message: n } of s) 28355 Ee.warn(n); 28356 return s.length === 0; 28357} 28358function ER(e, t, i) { 28359 const s = mn(i) ? i : i[Uy], n = s ? `; expecting ${s}` : ""; 28360 return `${e ? `Option \`${e}\`` : "Value"} cannot be set to \`${mY(t)}\`${n}, ignoring.`; 28361} 28362function Y2(e, t, i = "") { 28363 if (!Qs(e)) 28364 return { 28365 valid: null, 28366 errors: [{ path: i, value: e, message: ER(i, e, "an object") }] 28367 }; 28368 const s = new Set(Object.keys(e)), n = [], o = {}; 28369 function r(a) { 28370 return hi(t) ? `${i}[${a}]` : i ? `${i}.${a}` : a; 28371 } 28372 for (const [a, l] of Object.entries(t)) { 28373 s.delete(a); 28374 const c = e[a]; 28375 if (!(!l[CZ] && typeof c > "u")) 28376 if (Rl(l)) 28377 l(c) ? o[a] = c : n.push({ key: a, path: i, value: c, message: ER(r(a), c, l) }); 28378 else { 28379 const u = Y2(c, l, r(a)); 28380 o[a] = u.valid, n.push(...u.errors); 28381 } 28382 } 28383 for (const a of s) 28384 n.push({ 28385 key: a, 28386 path: i, 28387 unknown: !0, 28388 message: `Unknown option \`${r(a)}\`, ignoring.` 28389 }); 28390 return { valid: o, errors: n }; 28391} 28392function Lr(e, t) { 28393 return Object.assign((i) => e(i), { [Uy]: t }); 28394} 28395var wZ = (...e) => Lr( 28396 (t) => e.some((i) => i(t)), 28397 e.map((t) => t[Uy]).filter(Boolean).join(" or ") 28398); 28399Lr(hi, "an array"); 28400Lr(LS, "a boolean"); 28401Lr(Rl, "a function"); 28402Lr(kt, "a number"); 28403var IR = Lr(Qs, "an object"), Ur = Lr(mn, "a string"), SZ = (e, t = !0) => Lr( 28404 (i) => kt(i) && (i > e || t && i === e), 28405 `a number greater than ${t ? "or equal to " : ""}${e}` 28406), xZ = (e, t) => Lr( 28407 (i) => kt(i) && i >= e && i <= t, 28408 `a number between ${e} and ${t} inclusive` 28409); 28410SZ(0); 28411xZ(0, 1); 28412var RR = (e, t) => Lr( 28413 (i) => hi(i) && i.every(e), 28414 `${e[Uy]} array` 28415); 28416function kw(e) { 28417 return e?.up || e?.down || e?.neutral ? "user-full" : e?.fills || e?.strokes ? "user-indexed" : "inbuilt"; 28418} 28419var Nf = "white", Pw = { 28420 get cartesian() { 28421 return { seriesTypes: ci.cartesianTypes, commonOptions: ["zoom", "navigator"] }; 28422 }, 28423 get polar() { 28424 return { seriesTypes: ci.polarTypes, commonOptions: [] }; 28425 }, 28426 get hierarchy() { 28427 return { seriesTypes: ci.hierarchyTypes, commonOptions: [] }; 28428 }, 28429 get topology() { 28430 return { seriesTypes: ci.topologyTypes, commonOptions: [] }; 28431 }, 28432 get "flow-proportion"() { 28433 return { seriesTypes: ci.flowProportionTypes, commonOptions: [] }; 28434 }, 28435 get standalone() { 28436 return { seriesTypes: ci.standaloneTypes, commonOptions: [] }; 28437 }, 28438 get gauge() { 28439 return { seriesTypes: ci.gaugeTypes, commonOptions: [] }; 28440 } 28441}, MZ = { 28442 "radial-gauge": !0, 28443 "linear-gauge": !0 28444}; 28445function TR(e) { 28446 return MZ[e] === !0; 28447} 28448var AZ = Object.values(Pw).reduce((e, { commonOptions: t }) => e.concat(t), []), so = class Fw { 28449 static getAxisDefaults(t) { 28450 return ht(t, { 28451 title: { 28452 enabled: !1, 28453 text: "Axis Title", 28454 spacing: 25, 28455 fontWeight: "normal", 28456 fontSize: 13, 28457 fontFamily: Si, 28458 color: Zi 28459 }, 28460 label: { 28461 fontSize: 12, 28462 fontFamily: Si, 28463 spacing: 11, 28464 color: Zi, 28465 avoidCollisions: !0 28466 }, 28467 line: { 28468 enabled: !0, 28469 width: 1, 28470 stroke: lp 28471 }, 28472 tick: { 28473 enabled: !1, 28474 width: 1, 28475 stroke: lp 28476 }, 28477 gridLine: { 28478 enabled: !0, 28479 style: [{ stroke: xl, lineDash: [] }] 28480 }, 28481 crossLines: { 28482 enabled: !1, 28483 fill: sd, 28484 stroke: sd, 28485 fillOpacity: 0.1, 28486 strokeWidth: 1, 28487 label: { 28488 enabled: !1, 28489 fontSize: 12, 28490 fontFamily: Si, 28491 padding: 5, 28492 color: Zi 28493 } 28494 }, 28495 crosshair: { 28496 enabled: !0 28497 } 28498 }); 28499 } 28500 getChartDefaults() { 28501 return { 28502 minHeight: 300, 28503 minWidth: 300, 28504 background: { visible: !0, fill: Np }, 28505 padding: { top: Zr, right: Zr, bottom: Zr, left: Zr }, 28506 keyboard: { enabled: !0 }, 28507 title: { 28508 enabled: !1, 28509 text: "Title", 28510 fontWeight: "normal", 28511 fontSize: 17, 28512 fontFamily: Si, 28513 color: Zi, 28514 wrapping: "hyphenate", 28515 layoutStyle: sl, 28516 textAlign: nl 28517 }, 28518 subtitle: { 28519 enabled: !1, 28520 text: "Subtitle", 28521 spacing: 20, 28522 fontSize: 13, 28523 fontFamily: Si, 28524 color: fl, 28525 wrapping: "hyphenate", 28526 layoutStyle: sl, 28527 textAlign: nl 28528 }, 28529 footnote: { 28530 enabled: !1, 28531 text: "Footnote", 28532 spacing: 20, 28533 fontSize: 13, 28534 fontFamily: Si, 28535 color: "rgb(140, 140, 140)", 28536 wrapping: "hyphenate", 28537 layoutStyle: sl, 28538 textAlign: nl 28539 }, 28540 legend: { 28541 position: "bottom", 28542 spacing: 30, 28543 listeners: {}, 28544 toggleSeries: !0, 28545 item: { 28546 paddingX: 16, 28547 paddingY: 8, 28548 marker: { size: 15, padding: 8 }, 28549 showSeriesStroke: !0, 28550 label: { 28551 color: Zi, 28552 fontSize: 12, 28553 fontFamily: Si 28554 } 28555 }, 28556 reverseOrder: !1, 28557 pagination: { 28558 marker: { size: 12 }, 28559 activeStyle: { fill: Zi }, 28560 inactiveStyle: { fill: fl }, 28561 highlightStyle: { fill: Zi }, 28562 label: { color: Zi } 28563 } 28564 }, 28565 tooltip: { 28566 enabled: !0, 28567 darkTheme: id, 28568 delay: 0 28569 }, 28570 overlays: { darkTheme: id }, 28571 listeners: {} 28572 }; 28573 } 28574 constructor(t = {}) { 28575 const { overrides: i, palette: s } = As(t), n = this.createChartConfigPerChartType(this.getDefaults()), o = {}; 28576 i && this.mergeOverrides(n, o, i); 28577 const { fills: r, strokes: a, ...l } = this.getDefaultColors(); 28578 this.palette = Xh( 28579 ht(s, { 28580 fills: Object.values(r), 28581 strokes: Object.values(a), 28582 ...l 28583 }) 28584 ), this.paletteType = kw(s), this.config = Xh(this.templateTheme(n)), this.presets = Xh(o); 28585 } 28586 mergeOverrides(t, i, s) { 28587 for (const { seriesTypes: n, commonOptions: o } of Object.values(Pw)) { 28588 const r = { ...s.common }; 28589 for (const a of AZ) 28590 o.includes(a) || delete r[a]; 28591 if (r) 28592 for (const a of n) { 28593 const l = a; 28594 TR(l) || (t[l] = ht(r, t[l])); 28595 } 28596 }
28597 ci.seriesTypes.forEach((n) => { 28598 const o = n, r = s[o]; 28599 TR(o) ? i[o] = r : t[o] = ht(r, t[o]); 28600 }); 28601 } 28602 createChartConfigPerChartType(t) { 28603 for (const [i, { seriesTypes: s }] of Object.entries(Pw)) { 28604 const n = ww.get(i); 28605 for (const o of s) 28606 t[o] ?? (t[o] = As(n)); 28607 } 28608 return t; 28609 } 28610 getDefaults() { 28611 const t = (i, s) => { 28612 const n = {}, o = { 28613 axes: {}, 28614 ...Mx.getThemeTemplates(), 28615 ...this.getChartDefaults(), 28616 ...ww.get(i) 28617 }; 28618 for (const r of s) { 28619 n[r] = ht( 28620 Nn.getThemeTemplate(r), 28621 n[r] ?? As(o) 28622 ); 28623 const { axes: a } = n[r]; 28624 for (const l of ia.keys()) 28625 a[l] = ht( 28626 a[l], 28627 ia.getThemeTemplate(l), 28628 Fw.cartesianAxisDefault[l] 28629 ); 28630 } 28631 return n; 28632 }; 28633 return ht( 28634 t("cartesian", ci.cartesianTypes), 28635 t("polar", ci.polarTypes), 28636 t("hierarchy", ci.hierarchyTypes), 28637 t("topology", ci.topologyTypes), 28638 t("flow-proportion", ci.flowProportionTypes), 28639 t("standalone", ci.standaloneTypes), 28640 t("gauge", ci.gaugeTypes) 28641 ); 28642 } 28643 static applyTemplateTheme(t, i, s) { 28644 if (hi(t)) 28645 for (let n = 0; n < t.length; n++) { 28646 const o = t[n]; 28647 typeof o == "symbol" && s?.has(o) && (t[n] = s.get(o)); 28648 } 28649 else 28650 for (const [n, o] of Object.entries(t)) 28651 typeof o == "symbol" && s?.has(o) && (t[n] = s.get(o)); 28652 } 28653 templateTheme(t, i = !0) { 28654 const s = i ? As(t) : t, n = this.getTemplateParameters(); 28655 return Xr(s, Fw.applyTemplateTheme, void 0, void 0, n), s; 28656 } 28657 getDefaultColors() { 28658 return { 28659 fills: Ki, 28660 strokes: cr, 28661 up: { fill: Ki.GREEN, stroke: cr.GREEN }, 28662 down: { fill: Ki.RED, stroke: cr.RED }, 28663 neutral: { fill: Ki.GRAY, stroke: cr.GRAY }, 28664 altUp: { fill: Ki.BLUE, stroke: cr.BLUE }, 28665 altDown: { fill: Ki.ORANGE, stroke: cr.ORANGE }, 28666 altNeutral: { fill: Ki.GRAY, stroke: cr.GRAY } 28667 }; 28668 } 28669 getTemplateParameters() { 28670 const { isEnterprise: t } = na, i = /* @__PURE__ */ new Map(); 28671 i.set(id, !1), i.set(Kx, t), i.set(Yx, !t), i.set(Si, "Verdana, sans-serif"), i.set(Zi, "#464646"), i.set(Zx, "#fff"), i.set(fl, "#8c8c8c"), i.set(xl, "#e0eaf1"), i.set(lp, "#c3c3c3"), i.set(sd, "#464646"), i.set(Cg, "#d9d9d9"), i.set(vy, "#ddd"), i.set(_l, Nf), i.set(Np, Nf), i.set(my, "black"), i.set(Bl, "#00000080"), i.set(Mn, [ 28672 Ki.ORANGE, 28673 Ki.YELLOW, 28674 Ki.GREEN 28675 ]), i.set(Ay, "#aaa"), i.set(Ao, [Ki.GREEN, Ki.YELLOW, Ki.RED]), i.set(Tr, [ 28676 "#5090dc", 28677 "#629be0", 28678 "#73a6e3", 28679 "#85b1e7", 28680 "#96bcea", 28681 "#a8c8ee", 28682 "#b9d3f1", 28683 "#cbdef5" 28684 ]), i.set(Zr, 20), i.set(sl, "block"), i.set(nl, "center"), i.set(Dy, ["#fff", "#e0e5ea", "#c1ccd5", "#a3b4c1", "#859cad"]), i.set(Ey, ["#fff", "#c5cbd1", "#a4b1bd", "#8498a9", "#648096"]), i.set(t1, [ 28685 "#797b86", 28686 "#e24c4a", 28687 "#f49d2d", 28688 "#65ab58", 28689 "#409682", 28690 "#4db9d2", 28691 "#5090dc", 28692 "#3068f9", 28693 "#e24c4a", 28694 "#913aac", 28695 "#d93e64" 28696 ]), i.set(My, Nf), i.set(An, Ki.BLUE), i.set(Iy, Ki.BLUE), i.set(Dn, Ki.BLUE), i.set(Ry, Nf), i.set(Ty, "#fafafa"), i.set(Ly, "#ddd"), i.set(ky, "#000"), i.set(Py, "#181d1f"), i.set(i1, "#e35c5c"), i.set(s1, "#e35c5c"), i.set(Fy, "#fafafa"), i.set(Oy, "#ddd"), i.set(Ny, "#000"), i.set(bg, "top"), i.set(dr, !1); 28697 const s = this.getDefaultColors(); 28698 return i.set(yy, this.palette.up?.stroke ?? s.up.stroke), i.set(by, this.palette.up?.fill ?? s.up.fill), i.set(Cy, this.palette.down?.stroke ?? s.down.stroke), i.set(wy, this.palette.down?.fill ?? s.down.fill), i.set(Qd, this.palette.neutral?.stroke ?? s.neutral.stroke), i.set(Sy, this.palette.neutral?.fill ?? s.neutral.fill), i.set(qx, this.palette.altUp?.stroke ?? s.up.stroke), i.set(Xx, this.palette.altUp?.fill ?? s.up.fill), i.set(Qx, this.palette.altDown?.stroke ?? s.down.stroke), i.set(Jx, this.palette.altDown?.fill ?? s.down.fill), i.set(e1, this.palette.altNeutral?.fill ?? s.altNeutral.fill), i.set(xy, this.palette.altNeutral?.stroke ?? s.altNeutral.stroke), i; 28699 } 28700}; 28701so.cartesianAxisDefault = { 28702 number: so.getAxisDefaults({ 28703 line: { enabled: !1 } 28704 }), 28705 log: so.getAxisDefaults({ 28706 base: 10, 28707 line: { enabled: !1 },
28708 interval: { minSpacing: NaN } 28709 }), 28710 category: so.getAxisDefaults({ 28711 groupPaddingInner: 0.1, 28712 label: { autoRotate: !0 }, 28713 gridLine: { enabled: dr }, 28714 crosshair: { enabled: !1 } 28715 }), 28716 "grouped-category": so.getAxisDefaults({ 28717 tick: { enabled: !0, stroke: Cg }, 28718 label: { spacing: 10, rotation: 270 }, 28719 paddingInner: 0.4, 28720 groupPaddingInner: 0.2, 28721 crosshair: { enabled: !1 } 28722 }), 28723 time: so.getAxisDefaults({ gridLine: { enabled: dr } }), 28724 "ordinal-time": so.getAxisDefaults({ 28725 groupPaddingInner: 0, 28726 label: { autoRotate: !1 }, 28727 gridLine: { enabled: dr } 28728 }), 28729 "angle-category": so.getAxisDefaults({ 28730 label: { spacing: 5 }, 28731 gridLine: { enabled: dr } 28732 }), 28733 "angle-number": so.getAxisDefaults({ 28734 label: { spacing: 5 }, 28735 gridLine: { enabled: dr } 28736 }), 28737 "radius-category": so.getAxisDefaults({ 28738 line: { enabled: !1 } 28739 }), 28740 "radius-number": so.getAxisDefaults({ 28741 line: { enabled: !1 } 28742 }) 28743}; 28744var Ta = so, _f = "#192232", Ns = { 28745 BLUE: "#5090dc", 28746 ORANGE: "#ffa03a", 28747 GREEN: "#459d55", 28748 CYAN: "#34bfe1", 28749 YELLOW: "#e1cc00", 28750 VIOLET: "#9669cb", 28751 GRAY: "#b5b5b5", 28752 MAGENTA: "#bd5aa7", 28753 BROWN: "#8a6224", 28754 RED: "#ef5452" 28755}, tc = { 28756 BLUE: "#74a8e6", 28757 ORANGE: "#ffbe70", 28758 GREEN: "#6cb176", 28759 CYAN: "#75d4ef", 28760 YELLOW: "#f6e559", 28761 VIOLET: "#aa86d8", 28762 GRAY: "#a1a1a1", 28763 MAGENTA: "#ce7ab9", 28764 BROWN: "#997b52", 28765 RED: "#ff7872" 28766}, th = class extends Ta { 28767 getDefaultColors() { 28768 return { 28769 fills: Ns, 28770 strokes: tc, 28771 up: { fill: Ns.GREEN, stroke: tc.GREEN },
28772 down: { fill: Ns.RED, stroke: tc.RED }, 28773 neutral: { fill: Ns.GRAY, stroke: tc.GRAY }, 28774 altUp: { fill: Ns.BLUE, stroke: tc.BLUE }, 28775 altDown: { fill: Ns.ORANGE, stroke: tc.ORANGE }, 28776 altNeutral: { fill: Ns.GRAY, stroke: tc.GRAY } 28777 }; 28778 } 28779 getTemplateParameters() { 28780 const e = super.getTemplateParameters(); 28781 return e.set(id, !0), e.set(My, _f), e.set(vy, "#4b525d"), e.set(Zi, "#fff"), e.set(fl, "#7d91a0"), e.set(xl, "#545a6e"), e.set(sd, "#fff"), e.set(Cg, "#7f8389"), e.set(Mn, [ 28782 Ns.ORANGE, 28783 Ns.YELLOW, 28784 Ns.GREEN 28785 ]), e.set(Ao, [ 28786 Ns.GREEN, 28787 Ns.YELLOW, 28788 Ns.RED 28789 ]), e.set(Tr, [ 28790 "#5090dc", 28791 "#4882c6", 28792 "#4073b0", 28793 "#38659a", 28794 "#305684", 28795 "#28486e", 28796 "#203a58", 28797 "#182b42" 28798 ]), e.set(Dy, ["#192834", "#253746", "#324859", "#3f596c", "#4d6a80"]), e.set(Ey, ["#192834", "#3b5164", "#496275", "#577287", "#668399"]), e.set(Np, _f), e.set(my, "white"), e.set(_l, _f), e.set(An, Ns.BLUE), e.set(Iy, "#fff"), e.set(Dn, Ns.BLUE), e.set(Ry, _f), e.set(Ty, "#28313e"), e.set(Ly, "#4b525d"), e.set(ky, "#fff"), e.set(Py, "#fff"), e.set(Fy, "#28313e"), e.set(Oy, "#4b525d"), e.set(Ny, "#fff"), e; 28799 } 28800 constructor(e) { 28801 super(e); 28802 } 28803}, Xn = { 28804 GREEN: "#089981", 28805 RED: "#F23645", 28806 BLUE: "#5090dc", 28807 GRAY: "#A9A9A9" 28808}, ic = { 28809 GREEN: "#089981", 28810 RED: "#F23645", 28811 BLUE: "#5090dc", 28812 GRAY: "#909090" 28813}, DZ = class extends th { 28814 getDefaultColors() { 28815 return { 28816 fills: { ...Xn }, 28817 strokes: { ...ic }, 28818 up: { fill: Xn.GREEN, stroke: ic.GREEN }, 28819 down: { fill: Xn.RED, stroke: ic.RED }, 28820 neutral: { fill: Xn.BLUE, stroke: ic.BLUE }, 28821 altUp: { fill: Xn.GREEN, stroke: ic.GREEN }, 28822 altDown: { fill: Xn.RED, stroke: ic.RED }, 28823 altNeutral: { fill: Xn.GRAY, stroke: ic.GRAY } 28824 }; 28825 } 28826 getTemplateParameters() { 28827 const e = super.getTemplateParameters(); 28828 return e.set(Mn, [ 28829 Xn.GREEN, 28830 Xn.BLUE, 28831 Xn.RED 28832 ]), e.set(An, Xn.BLUE), e.set(Dn, Xn.BLUE), e.set(xl, "#343A4E"), e.set(Zr, 0), e.set(sl, "overlay"), e.set(nl, "left"), e.set(bg, "bottom"), e.set(dr, !0), e; 28833 } 28834}, Jn = { 28835 GREEN: "#089981", 28836 RED: "#F23645", 28837 BLUE: "#5090dc", 28838 GRAY: "#A9A9A9" 28839}, sc = { 28840 GREEN: "#089981", 28841 RED: "#F23645", 28842 BLUE: "#5090dc", 28843 GRAY: "#909090" 28844}, EZ = class extends Ta { 28845 getDefaultColors() { 28846 return { 28847 fills: { ...Jn }, 28848 strokes: { ...sc }, 28849 up: { fill: Jn.GREEN, stroke: sc.GREEN }, 28850 down: { fill: Jn.RED, stroke: sc.RED }, 28851 neutral: { fill: Jn.BLUE, stroke: sc.BLUE }, 28852 altUp: { fill: Jn.GREEN, stroke: sc.GREEN }, 28853 altDown: { fill: Jn.RED, stroke: sc.RED }, 28854 altNeutral: { fill: Jn.GRAY, stroke: sc.GRAY } 28855 }; 28856 } 28857 getTemplateParameters() { 28858 const e = super.getTemplateParameters(); 28859 return e.set(Mn, [ 28860 Jn.GREEN, 28861 Jn.BLUE, 28862 Jn.RED 28863 ]), e.set(An, Jn.BLUE), e.set(Dn, Jn.BLUE), e.set(xl, "#F2F3F3"), e.set(Zr, 0), e.set(sl, "overlay"), e.set(nl, "left"), e.set(bg, "bottom"), e.set(dr, !0), e; 28864 } 28865}, _s = { 28866 BLUE: "#2196F3", 28867 ORANGE: "#FF9800", 28868 GREEN: "#4CAF50", 28869 CYAN: "#00BCD4", 28870 YELLOW: "#FFEB3B", 28871 VIOLET: "#7E57C2", 28872 GRAY: "#9E9E9E", 28873 MAGENTA: "#F06292", 28874 BROWN: "#795548", 28875 RED: "#F44336" 28876}, nc = { 28877 BLUE: "#90CAF9", 28878 ORANGE: "#FFCC80", 28879 GREEN: "#A5D6A7", 28880 CYAN: "#80DEEA", 28881 YELLOW: "#FFF9C4", 28882 VIOLET: "#B39DDB", 28883 GRAY: "#E0E0E0", 28884 MAGENTA: "#F48FB1", 28885 BROWN: "#A1887F", 28886 RED: "#EF9A9A" 28887}, IZ = class extends th { 28888 getDefaultColors() { 28889 return { 28890 fills: _s, 28891 strokes: nc, 28892 up: { fill: _s.GREEN, stroke: nc.GREEN }, 28893 down: { fill: _s.RED, stroke: nc.RED }, 28894 neutral: { fill: _s.GRAY, stroke: nc.GRAY }, 28895 altUp: { fill: _s.BLUE, stroke: nc.BLUE }, 28896 altDown: { fill: _s.RED, stroke: nc.RED }, 28897 altNeutral: { fill: _s.GRAY, stroke: nc.GRAY } 28898 }; 28899 } 28900 getTemplateParameters() { 28901 const e = super.getTemplateParameters(); 28902 return e.set(Mn, [ 28903 _s.ORANGE, 28904 _s.YELLOW, 28905 _s.GREEN 28906 ]), e.set(Tr, [ 28907 "#2196f3", 28908 // 500 28909 "#208FEC", 28910 // (interpolated) 28911 "#1E88E5", 28912 // 600 28913 "#1C7FDC", 28914 // (interpolated) 28915 "#1976d2", 28916 // 700 28917 "#176EC9", 28918 // (interpolated) 28919 "#1565c0" 28920 // 800 28921 ]), e.set(Ao, [ 28922 _s.GREEN, 28923 _s.YELLOW, 28924 _s.RED 28925 ]), e.set(An, _s.BLUE), e.set(Dn, _s.BLUE), e; 28926 } 28927}, Bs = { 28928 BLUE: "#2196F3", 28929 ORANGE: "#FF9800", 28930 GREEN: "#4CAF50", 28931 CYAN: "#00BCD4", 28932 YELLOW: "#FFEB3B",
28933 VIOLET: "#7E57C2", 28934 GRAY: "#9E9E9E", 28935 MAGENTA: "#F06292", 28936 BROWN: "#795548", 28937 RED: "#F44336" 28938}, oc = { 28939 BLUE: "#1565C0", 28940 ORANGE: "#E65100", 28941 GREEN: "#2E7D32", 28942 CYAN: "#00838F", 28943 YELLOW: "#F9A825", 28944 VIOLET: "#4527A0", 28945 GRAY: "#616161", 28946 MAGENTA: "#C2185B", 28947 BROWN: "#4E342E", 28948 RED: "#B71C1C" 28949}, RZ = class extends Ta { 28950 getDefaultColors() { 28951 return { 28952 fills: Bs, 28953 strokes: oc, 28954 up: { fill: Bs.GREEN, stroke: oc.GREEN }, 28955 down: { fill: Bs.RED, stroke: oc.RED }, 28956 neutral: { fill: Bs.GRAY, stroke: oc.GRAY }, 28957 altUp: { fill: Bs.BLUE, stroke: oc.BLUE }, 28958 altDown: { fill: Bs.RED, stroke: oc.RED }, 28959 altNeutral: { fill: Bs.GRAY, stroke: oc.GRAY } 28960 }; 28961 } 28962 getTemplateParameters() { 28963 const e = super.getTemplateParameters(); 28964 return e.set(Mn, [ 28965 Bs.ORANGE, 28966 Bs.YELLOW, 28967 Bs.GREEN 28968 ]), e.set(Tr, [ 28969 "#2196f3", 28970 // 500 28971 "#329EF4", 28972 // (interpolated) 28973 "#42a5f5", 28974 // 400 28975 "#53ADF6", 28976 // (interpolated) 28977 "#64b5f6", 28978 // 300 28979 "#7AC0F8", 28980 // (interpolated) 28981 "#90caf9" 28982 // 200 28983 ]), e.set(Ao, [ 28984 Bs.GREEN, 28985 Bs.YELLOW, 28986 Bs.RED 28987 ]), e.set(An, Bs.BLUE), e.set(Dn, Bs.BLUE), e; 28988 } 28989}, Pi = { 28990 BLUE: "#436ff4", 28991 PURPLE: "#9a7bff", 28992 MAGENTA: "#d165d2", 28993 PINK: "#f0598b", 28994 RED: "#f47348", 28995 ORANGE: "#f2a602", 28996 YELLOW: "#e9e201", 28997 GREEN: "#21b448", 28998 CYAN: "#00b9a2", 28999 MODERATE_BLUE: "#00aee4", 29000 GRAY: "#bbbbbb" 29001}, rc = { 29002 BLUE: "#6698ff", 29003 PURPLE: "#c0a3ff", 29004 MAGENTA: "#fc8dfc", 29005 PINK: "#ff82b1", 29006 RED: "#ff9b70", 29007 ORANGE: "#ffcf4e", 29008 YELLOW: "#ffff58", 29009 GREEN: "#58dd70", 29010 CYAN: "#51e2c9", 29011 MODERATE_BLUE: "#4fd7ff", 29012 GRAY: "#eeeeee" 29013}, TZ = class extends th { 29014 getDefaultColors() { 29015 return { 29016 fills: Pi, 29017 strokes: rc, 29018 up: { fill: Pi.GREEN, stroke: rc.GREEN }, 29019 down: { fill: Pi.RED, stroke: rc.RED }, 29020 neutral: { fill: Pi.GRAY, stroke: rc.GRAY }, 29021 altUp: { fill: Pi.BLUE, stroke: rc.BLUE }, 29022 altDown: { fill: Pi.RED, stroke: rc.RED }, 29023 altNeutral: { fill: Pi.GRAY, stroke: rc.GRAY } 29024 }; 29025 } 29026 getTemplateParameters() { 29027 const e = super.getTemplateParameters(); 29028 return e.set(Mn, [Pi.BLUE, Pi.RED]), e.set(Tr, [ 29029 Pi.BLUE, 29030 Pi.PURPLE, 29031 Pi.MAGENTA, 29032 Pi.PINK, 29033 Pi.RED, 29034 Pi.ORANGE, 29035 Pi.YELLOW, 29036 Pi.GREEN 29037 ]), e.set(Ao, [Pi.BLUE, Pi.RED]), e.set(An, Pi.BLUE), e.set(Dn, Pi.BLUE), e; 29038 } 29039}, Fi = { 29040 BLUE: "#436ff4", 29041 PURPLE: "#9a7bff", 29042 MAGENTA: "#d165d2", 29043 PINK: "#f0598b", 29044 RED: "#f47348", 29045 ORANGE: "#f2a602", 29046 YELLOW: "#e9e201", 29047 GREEN: "#21b448", 29048 CYAN: "#00b9a2", 29049 MODERATE_BLUE: "#00aee4", 29050 GRAY: "#bbbbbb" 29051}, ac = { 29052 BLUE: "#2346c9", 29053 PURPLE: "#7653d4", 29054 MAGENTA: "#a73da9", 29055 PINK: "#c32d66", 29056 RED: "#c84b1c", 29057 ORANGE: "#c87f00", 29058 YELLOW: "#c1b900", 29059 GREEN: "#008c1c", 29060 CYAN: "#00927c", 29061 MODERATE_BLUE: "#0087bb", 29062 GRAY: "#888888" 29063}, LZ = class extends Ta { 29064 getDefaultColors() { 29065 return { 29066 fills: Fi, 29067 strokes: ac, 29068 up: { fill: Fi.GREEN, stroke: ac.GREEN }, 29069 down: { fill: Fi.RED, stroke: ac.RED }, 29070 neutral: { fill: Fi.GRAY, stroke: ac.GRAY }, 29071 altUp: { fill: Fi.BLUE, stroke: ac.BLUE }, 29072 altDown: { fill: Fi.RED, stroke: ac.RED }, 29073 altNeutral: { fill: Fi.GRAY, stroke: ac.GRAY } 29074 }; 29075 } 29076 getTemplateParameters() { 29077 const e = super.getTemplateParameters(); 29078 return e.set(Mn, [Fi.BLUE, Fi.RED]), e.set(Tr, [ 29079 Fi.BLUE, 29080 Fi.PURPLE, 29081 Fi.MAGENTA, 29082 Fi.PINK, 29083 Fi.RED, 29084 Fi.ORANGE, 29085 Fi.YELLOW, 29086 Fi.GREEN 29087 ]), e.set(Ao, [Fi.BLUE, Fi.RED]), e.set(An, Fi.BLUE), e.set(Dn, Fi.BLUE), e; 29088 } 29089}, ys = { 29090 BLUE: "#4472C4", 29091 ORANGE: "#ED7D31", 29092 GRAY: "#A5A5A5", 29093 YELLOW: "#FFC000", 29094 MODERATE_BLUE: "#5B9BD5", 29095 GREEN: "#70AD47", 29096 DARK_GRAY: "#7B7B7B", 29097 DARK_BLUE: "#264478", 29098 VERY_DARK_GRAY: "#636363", 29099 DARK_YELLOW: "#997300" 29100}, ja = { 29101 BLUE: "#6899ee", 29102 ORANGE: "#ffa55d", 29103 GRAY: "#cdcdcd", 29104 YELLOW: "#ffea53", 29105 MODERATE_BLUE: "#82c3ff", 29106 GREEN: "#96d56f", 29107 DARK_GRAY: "#a1a1a1", 29108 DARK_BLUE: "#47689f", 29109 VERY_DARK_GRAY: "#878787", 29110 DARK_YELLOW: "#c0993d" 29111}, kZ = class extends th { 29112 getDefaultColors() { 29113 return { 29114 fills: { ...ys, RED: ys.ORANGE }, 29115 strokes: { ...ja, RED: ja.ORANGE }, 29116 up: { fill: ys.GREEN, stroke: ja.GREEN },
29117 down: { fill: ys.ORANGE, stroke: ja.ORANGE }, 29118 neutral: { fill: ys.GRAY, stroke: ja.GRAY }, 29119 altUp: { fill: ys.BLUE, stroke: ja.BLUE }, 29120 altDown: { fill: ys.ORANGE, stroke: ja.ORANGE }, 29121 altNeutral: { fill: ys.GRAY, stroke: ja.GRAY } 29122 }; 29123 } 29124 getTemplateParameters() { 29125 const e = super.getTemplateParameters(); 29126 return e.set(Mn, [ 29127 ys.ORANGE, 29128 ys.YELLOW, 29129 ys.GREEN 29130 ]), e.set(Ao, [ 29131 ys.GREEN, 29132 ys.YELLOW, 29133 ys.ORANGE 29134 ]), e.set(An, ys.BLUE), e.set(Dn, ys.BLUE), e; 29135 } 29136}, Gs = { 29137 BLUE: "#5281d5", 29138 ORANGE: "#ff8d44", 29139 GRAY: "#b5b5b5", 29140 YELLOW: "#ffd02f", 29141 MODERATE_BLUE: "#6aabe6", 29142 GREEN: "#7fbd57", 29143 DARK_GRAY: "#8a8a8a", 29144 DARK_BLUE: "#335287", 29145 VERY_DARK_GRAY: "#717171", 29146 DARK_YELLOW: "#a98220" 29147}, Wr = { 29148 BLUE: "#214d9b", 29149 ORANGE: "#c25600", 29150 GRAY: "#7f7f7f", 29151 YELLOW: "#d59800", 29152 MODERATE_BLUE: "#3575ac", 29153 GREEN: "#4b861a", 29154 DARK_GRAY: "#575757", 29155 DARK_BLUE: "#062253", 29156 VERY_DARK_GRAY: "#414141", 29157 DARK_YELLOW: "#734f00" 29158}, PZ = class extends Ta { 29159 getDefaultColors() { 29160 return { 29161 fills: { ...Gs, RED: Gs.ORANGE }, 29162 strokes: { ...Wr, RED: Wr.ORANGE }, 29163 up: { fill: Gs.GREEN, stroke: Wr.GREEN }, 29164 down: { fill: Gs.ORANGE, stroke: Wr.ORANGE }, 29165 neutral: { fill: Wr.GRAY, stroke: Wr.GRAY }, 29166 altUp: { fill: Gs.BLUE, stroke: Wr.BLUE }, 29167 altDown: { fill: Gs.ORANGE, stroke: Wr.ORANGE }, 29168 altNeutral: { fill: Gs.GRAY, stroke: Wr.GRAY } 29169 }; 29170 } 29171 getTemplateParameters() { 29172 const e = super.getTemplateParameters(); 29173 return e.set(Mn, [ 29174 Gs.ORANGE, 29175 Gs.YELLOW, 29176 Gs.GREEN 29177 ]), e.set(Ao, [ 29178 Gs.GREEN, 29179 Gs.YELLOW, 29180 Gs.ORANGE 29181 ]), e.set(An, Gs.BLUE), e.set(Dn, Gs.BLUE), e; 29182 } 29183}, zs = { 29184 BLUE: "#0083ff", 29185 ORANGE: "#ff6600", 29186 GREEN: "#00af00", 29187 CYAN: "#00ccff", 29188 YELLOW: "#f7c700", 29189 VIOLET: "#ac26ff", 29190 GRAY: "#a7a7b7", 29191 MAGENTA: "#e800c5", 29192 BROWN: "#b54300", 29193 RED: "#ff0000" 29194}, lc = { 29195 BLUE: "#67b7ff", 29196 ORANGE: "#ffc24d", 29197 GREEN: "#5cc86f", 29198 CYAN: "#54ebff", 29199 VIOLET: "#fff653", 29200 YELLOW: "#c18aff", 29201 GRAY: "#aeaeae", 29202 MAGENTA: "#f078d4", 29203 BROWN: "#ba8438", 29204 RED: "#ff726e" 29205}, FZ = class extends th { 29206 getDefaultColors() { 29207 return { 29208 fills: zs, 29209 strokes: lc, 29210 up: { fill: zs.GREEN, stroke: lc.GREEN }, 29211 down: { fill: zs.RED, stroke: lc.RED }, 29212 neutral: { fill: zs.GRAY, stroke: lc.GRAY }, 29213 altUp: { fill: zs.BLUE, stroke: lc.BLUE }, 29214 altDown: { fill: zs.ORANGE, stroke: lc.ORANGE }, 29215 altNeutral: { fill: zs.GRAY, stroke: lc.GRAY } 29216 }; 29217 } 29218 getTemplateParameters() { 29219 const e = super.getTemplateParameters(); 29220 return e.set(Mn, [ 29221 zs.ORANGE, 29222 zs.YELLOW, 29223 zs.GREEN 29224 ]), e.set(Tr, [ 29225 "#0083ff", 29226 "#0076e6", 29227 "#0069cc", 29228 "#005cb3", 29229 "#004f99", 29230 "#004280", 29231 "#003466", 29232 "#00274c" 29233 ]), e.set(Ao, [ 29234 zs.GREEN, 29235 zs.YELLOW, 29236 zs.RED 29237 ]), e.set(An, zs.BLUE), e.set(Dn, zs.BLUE), e; 29238 } 29239}, Hs = { 29240 BLUE: "#0083ff", 29241 ORANGE: "#ff6600", 29242 GREEN: "#00af00", 29243 CYAN: "#00ccff", 29244 YELLOW: "#f7c700", 29245 VIOLET: "#ac26ff", 29246 GRAY: "#a7a7b7", 29247 MAGENTA: "#e800c5", 29248 BROWN: "#b54300", 29249 RED: "#ff0000" 29250}, cc = { 29251 BLUE: "#0f68c0", 29252 ORANGE: "#d47100", 29253 GREEN: "#007922", 29254 CYAN: "#009ac2", 29255 VIOLET: "#bca400", 29256 YELLOW: "#753cac", 29257 GRAY: "#646464", 29258 MAGENTA: "#9b2685", 29259 BROWN: "#6c3b00", 29260 RED: "#cb0021" 29261}, OZ = class extends Ta { 29262 getDefaultColors() { 29263 return { 29264 fills: Hs, 29265 strokes: cc, 29266 up: { fill: Hs.GREEN, stroke: cc.GREEN }, 29267 down: { fill: Hs.RED, stroke: cc.RED }, 29268 neutral: { fill: Hs.GRAY, stroke: cc.GRAY }, 29269 altUp: { fill: Hs.BLUE, stroke: cc.BLUE }, 29270 altDown: { fill: Hs.ORANGE, stroke: cc.ORANGE }, 29271 altNeutral: { fill: Hs.GRAY, stroke: cc.GRAY } 29272 }; 29273 } 29274 getTemplateParameters() { 29275 const e = super.getTemplateParameters(); 29276 return e.set(Mn, [Hs.ORANGE, Hs.YELLOW, Hs.GREEN]), e.set(Tr, [ 29277 "#0083ff", 29278 "#1a8fff", 29279 "#339cff", 29280 "#4da8ff", 29281 "#66b5ff", 29282 "#80c1ff", 29283 "#99cdff", 29284 "#b3daff" 29285 ]), e.set(Ao, [Hs.GREEN, Hs.YELLOW, Hs.RED]), e.set(An, Hs.BLUE), e.set(Dn, Hs.BLUE), e; 29286 } 29287}, od = Us(() => new Ta()), NZ = Us(() => new th()), G1 = { 29288 // darkThemes, 29289 "ag-default-dark": NZ, 29290 "ag-sheets-dark": Us(() => new kZ()), 29291 "ag-polychroma-dark": Us(() => new TZ()), 29292 "ag-vivid-dark": Us(() => new FZ()), 29293 "ag-material-dark": Us(() => new IZ()), 29294 "ag-financial-dark": Us(() => new DZ()), 29295 // lightThemes, 29296 null: od, 29297 undefined: od, 29298 "ag-default": od, 29299 "ag-sheets": Us(() => new PZ()), 29300 "ag-polychroma": Us(() => new LZ()), 29301 "ag-vivid": Us(() => new OZ()), 29302 "ag-material": Us(() => new RZ()), 29303 "ag-financial": Us(() => new EZ()) 29304}, Qm = Us(_Z); 29305function _Z(e) { 29306 if (e instanceof Ta) 29307 return e; 29308 if (e == null || typeof e == "string") { 29309 const t = G1[e]; 29310 return t ? t() : (Ee.warnOnce(`the theme [${e}
29310] is invalid, using [ag-default] instead.`), od()); 29311 } 29312 if (bZ(e, GZ, "theme")) { 29313 const t = BZ(e), i = t.baseTheme ? Qm(t.baseTheme) : od(); 29314 return new i.constructor(t); 29315 } 29316 return od(); 29317} 29318function BZ(e) { 29319 let t = e, i; 29320 const s = []; 29321 for (; typeof t == "object"; ) 29322 i ?? (i = t.palette), t.overrides && s.push(t.overrides), t = t.baseTheme; 29323 return { 29324 baseTheme: t, 29325 overrides: ht(...s), 29326 palette: i 29327 }; 29328} 29329var GZ = { 29330 baseTheme: wZ(Ur, IR), 29331 overrides: IR, 29332 palette: { 29333 fills: RR(Ur), 29334 strokes: RR(Ur), 29335 up: { fill: Ur, stroke: Ur }, 29336 down: { fill: Ur, stroke: Ur }, 29337 neutral: { fill: Ur, stroke: Ur } 29338 } 29339}, zZ = /* @__PURE__ */ new Set(["map-shape-background", "map-line-background"]), z1 = class lr { 29340 constructor(t, i, s, n, o, r = !1) { 29341 this.debug = Xt.create(!0, "opts"), this.optionMetadata = n ?? {}, this.processedOverrides = i ?? {}; 29342 let a = null; 29343 if (t instanceof lr) { 29344 if (a = t, this.specialOverrides = a.specialOverrides, !o) 29345 throw new Error("AG Charts - internal error: deltaOptions must be supplied."); 29346 this.userOptions = ht( 29347 o, 29348 As(a.userOptions, lr.OPTIONS_CLONE_OPTS) 29349 ); 29350 } else 29351 this.userOptions = t, this.specialOverrides = this.specialOverridesDefaults({ ...s }); 29352 r && this.removeLeftoverSymbols(this.userOptions); 29353 let l, c, u, d; 29354 !r && o != null && lr.isFastPathDelta(o) && a != null ? { activeTheme: l, processedOptions: c, defaultAxes: u, fastDelta: d } = this.fastSetup( 29355 o, 29356 a 29357 ) : { activeTheme: l, processedOptions: c, defaultAxes: u } = this.slowSetup( 29358 i, 29359 o, 29360 r 29361 ), this.activeTheme = l, this.processedOptions = c, this.defaultAxes = u, this.fastDelta = d; 29362 } 29363 static isFastPathDelta(t) { 29364 for (const i of Object.keys(t)) 29365 if (!this.FAST_PATH_OPTIONS.has(i)) 29366 return !1; 29367 return !0; 29368 } 29369 fastSetup(t, i) { 29370 const { activeTheme: s, defaultAxes: n, processedOptions: o } = i, { presetType: r } = this.optionMetadata, a = r ? vZ[r] : void 0; 29371 r != null && t.data != null && a != null && (t = ht(a(t.data), t)), this.fastSeriesSetup(t, o); 29372 const l = ht(t, o); 29373 return { activeTheme: s, defaultAxes: n, processedOptions: l, fastDelta: t }; 29374 } 29375 fastSeriesSetup(t, i) { 29376 t.series && (t.series?.every((s, n) => nP(s, i.series?.[n] ?? {})) ? delete t.series : t.series = t.series.map((s, n) => ht(s, i.series?.[n] ?? {}))); 29377 } 29378 slowSetup(t, i, s = !1) { 29379 let n = As(this.userOptions, lr.OPTIONS_CLONE_OPTS); 29380 i && (n = ht(i, n), s && this.removeLeftoverSymbols(n)); 29381 const { presetType: o } = this.optionMetadata; 29382 if (o != null) { 29383 const b = mZ[o], C = this.userOptions, w = this.userOptions.type, M = w != null ? Qm(this.userOptions.theme).presets[w] : void 0; 29384 this.debug(">>> AgCharts.createOrUpdate() - applying preset", C), n = b?.(C, M, () => this.activeTheme) ?? n; 29385 } 29386 na.isEnterprise || DR(n); 29387 const r = Qm(n.theme); 29388 this.sanityCheck(n), this.removeDisabledOptions(n); 29389 const a = this.getDefaultAxes(n), l = this.optionsType(n), { 29390 axes: c = {}, 29391 annotations: u = {}, 29392 series: d, 29393 ...p 29394 } = this.getSeriesThemeConfig(l, r), [f, m] = this.splitAnnotationsOptions(u); 29395 let y = ht( 29396 t, 29397 n, 29398 f, 29399 p, 29400 a 29401 ); 29402 return this.processAxesOptions(y, c), this.processSeriesOptions(y, r), this.processMiniChartSeriesOptions(y, r), this.annotationThemes = m, y = As(y, lr.OPTIONS_CLONE_OPTS), (Pp(y) || Gm(y) || A$(y)) && y.legend?.enabled == null && (y.legend ?? (y.legend = {}), y.legend.enabled = y.series.length > 1), this.enableConfiguredOptions(y, this.userOptions), r.templateTheme(y, !1), this.removeDisabledOptions(n), yZ(y), na.isEnterprise || DR(y, !0), this.debug("AgCharts.createOrUpdate() - processed options", y), { activeTheme: r, processedOptions: y, defaultAxes: a }; 29403 } 29404 diffOptions(t) { 29405 return this === t ? {} : t == null ? this.processedOptions : this.fastDelta ?? Sr(t.processedOptions, this.processedOptions); 29406 } 29407 getSeriesThemeConfig(t, i) { 29408 return i?.config[t] ?? {}; 29409 } 29410 getDefaultAxes(t) { 29411 const i = this.optionsType(t), s = t.series?.find((n) => (n.type ?? "line") === i) ?? {}; 29412 return Nn.cloneDefaultAxes(i, s); 29413 } 29414 optionsType(t) { 29415 return t.series?.[0]?.type ?? "line"; 29416 } 29417 sanityCheck(t) { 29418 this.axesTypeIntegrity(t), this.seriesTypeIntegrity(t), this.soloSeriesIntegrity(t); 29419 } 29420 splitAnnotationsOptions(t) { 29421 const { 29422 axesButtons: i = null, 29423 enabled: s = null, 29424 optionsToolbar: n = null, 29425 toolbar: o = null, 29426 ...r 29427 } = t; 29428 return i == null && s == null && n == null && o == null ? [{}, r] : [{ annotations: { axesButtons: i, enabled: s, optionsToolbar: n, toolbar: o } }, r]; 29429 } 29430 processAxesOptions(t, i) { 29431 "axes" in t && (t.axes = t.axes?.map((s) => { 29432 const { crossLines: n, ...o } = ht( 29433 i[s.type]?.[s.position], 29434 i[s.type] 29435 ); 29436 s.crossLines && (s.crossLines = Tm(s.crossLines, n)); 29437 const r = o.gridLine?.style; 29438 s.gridLine?.style && r?.length && (s.gridLine.style = s.gridLine.style.map( 29439 (p, f) => p.stroke != null || p.lineDash != null ? ht(p, r.at(f % r.length)) : p 29440 )); 29441 const { top: a, right: l, bottom: c, left: u, ...d } = ht(s, o); 29442 return d; 29443 })); 29444 } 29445 processSeriesOptions(t, i) { 29446 const s = this.getTooltipPositionDefaults(t), n = Qs(t.theme) ? kw(t.theme?.palette) : "inbuilt", o = { 29447 colourIndex: 0, 29448 userPalette: n 29449 }, r = t.series?.map((a) => { 29450 a.type ?? (a.type = this.getDefaultSeriesType(t));
29451 const { innerLabels: l, ...c } = this.getSeriesThemeConfig(a.type, i).series ?? {}, u = zZ.has(a.type) ? { colourIndex: 0, userPalette: n } : o, d = this.getSeriesPalette(a.type, u, i), p = this.getTooltipRangeDefaults(t, a.type), f = ht( 29452 this.getSeriesGroupingOptions(a), 29453 a, 29454 s, 29455 p, 29456 c, 29457 d, 29458 { visible: !0 } 29459 ); 29460 return f.innerLabels && (f.innerLabels = Tm(f.innerLabels, l)), f; 29461 }); 29462 t.series = this.setSeriesGroupingOptions(r ?? []); 29463 } 29464 processMiniChartSeriesOptions(t, i) { 29465 let s = t.navigator?.miniChart?.series; 29466 if (s == null) 29467 return; 29468 const n = { 29469 colourIndex: 0, 29470 userPalette: Qs(t.theme) ? kw(t.theme.palette) : "inbuilt" 29471 }; 29472 s = s.map((o) => { 29473 o.type ?? (o.type = "line"); 29474 const { innerLabels: r, ...a } = this.getSeriesThemeConfig(o.type, i).series ?? {}; 29475 return ht( 29476 this.getSeriesGroupingOptions(o), 29477 o, 29478 a, 29479 this.getSeriesPalette(o.type, n, i) 29480 ); 29481 }), t.navigator.miniChart.series = this.setSeriesGroupingOptions(s); 29482 } 29483 getSeriesPalette(t, i, s) { 29484 const n = Nn.getPaletteFactory(t), { colourIndex: o, userPalette: r } = i, { fills: a = [], strokes: l = [] } = s.palette; 29485 return n?.({ 29486 userPalette: r, 29487 colorsCount: Math.max(a.length, l.length), 29488 themeTemplateParameters: s.getTemplateParameters(), 29489 palette: s.palette, 29490 takeColors(c) { 29491 return i.colourIndex += c, { 29492 fills: cw(a, c, o), 29493 strokes: cw(l, c, o) 29494 }; 29495 } 29496 }); 29497 } 29498 getSeriesGroupingOptions(t) { 29499 const i = Nn.isGroupable(t.type), s = Nn.isStackable(t.type), n = Nn.isStackedByDefault(t.type); 29500 t.grouped && !i && Ee.warnOnce(`unsupported grouping of series type "${t.type}".`), (t.stacked || t.stackGroup) && !s && Ee.warnOnce(`unsupported stacking of series type "${t.type}".`); 29501 let { grouped: o, stacked: r } = t; 29502 return r ?? (r = (n || t.stackGroup != null) && !(i && o)), o ?? (o = !0), { 29503 stacked: s && r, 29504 grouped: i && o && !(s && r) 29505 }; 29506 } 29507 setSeriesGroupingOptions(t) { 29508 const i = this.getSeriesGrouping(t); 29509 this.debug("setSeriesGroupingOptions() - series grouping: ", i); 29510 const s = {}, n = i.reduce((o, r) => { 29511 var a; 29512 return r.groupType === "default" || (o[a = r.seriesType] ?? (o[a] = 0), o[r.seriesType] += r.groupType === "stack" ? 1 : r.series.length), o; 29513 }, {}); 29514 return i.flatMap((o) => { 29515 var r; 29516 switch (s[r = o.seriesType] ?? (s[r] = 0), o.groupType) { 29517 case "stack": { 29518 const a = s[o.seriesType]++; 29519 return o.series.map( 29520 (l, c) => Object.assign(l, { 29521 seriesGrouping: { 29522 groupId: o.groupId, 29523 groupIndex: a, 29524 groupCount: n[o.seriesType], 29525 stackIndex: c, 29526 stackCount: o.series.length 29527 } 29528 }) 29529 ); 29530 } 29531 case "group": 29532 return o.series.map( 29533 (a) => Object.assign(a, { 29534 seriesGrouping: { 29535 groupId: o.groupId, 29536 groupIndex: s[o.seriesType]++, 29537 groupCount: n[o.seriesType], 29538 stackIndex: 0, 29539 stackCount: 0 29540 } 29541 }) 29542 ); 29543 } 29544 return o.series; 29545 }).map(({ stacked: o, grouped: r, ...a }) => a); 29546 } 29547 getSeriesGroupId(t) { 29548 return [t.type, t.xKey, t.stacked ? t.stackGroup ?? "stacked" : "grouped"].filter(Boolean).join("-"); 29549 } 29550 getSeriesGrouping(t) { 29551 const i = /* @__PURE__ */ new Map(); 29552 return t.reduce((s, n) => { 29553 const o = n.type; 29554 if (!n.stacked && !n.grouped) 29555 s.push({ groupType: "default", seriesType: o, series: [n], groupId: "__default__" }); 29556 else { 29557 const r = this.getSeriesGroupId(n); 29558 if (!i.has(r)) { 29559 const l = { groupType: n.stacked ? "stack" : "group", seriesType: o, series: [], groupId: r }; 29560 i.set(r, l), s.push(l); 29561 } 29562 i.get(r).series.push(n); 29563 } 29564 return s; 29565 }, []); 29566 } 29567 getDefaultSeriesType(t) { 29568 if (Pp(t)) 29569 return "line"; 29570 if (oy(t)) 29571 return "pie"; 29572 if (Ex(t)) 29573 return "treemap"; 29574 if (Ix(t)) 29575 return "map-shape"; 29576 if (Rx(t)) 29577 return "sankey"; 29578 if (Gm(t)) 29579 return "pyramid"; 29580 if (ry(t)) 29581 return "radial-gauge";
29582 throw new Error("Invalid chart options type detected."); 29583 } 29584 getTooltipPositionDefaults(t) { 29585 const i = t.tooltip?.position; 29586 if (!Js(i)) 29587 return; 29588 const { type: s, xOffset: n, yOffset: o } = i, r = {}; 29589 return mn(s) && JL(GL, s) && (r.type = s), kt(n) && (r.xOffset = n), kt(o) && (r.yOffset = o), { tooltip: { position: r } }; 29590 } 29591 // AG-11591 Support for new series-specific & legacy chart-global 'tooltip.range' options 29592 // 29593 // The `chart.series[].tooltip.range` option is a bit different for legacy reason. This use to be 29594 // global option (`chart.tooltip.range`) that could override the theme. But now, the tooltip range 29595 // option is series-specific. 29596 // 29597 // To preserve backward compatibility, the `chart.tooltip.range` theme default has been changed from 29598 // 'nearest' to undefined. 29599 getTooltipRangeDefaults(t, i) { 29600 return { 29601 tooltip: { 29602 range: t.tooltip?.range ?? Nn.getTooltipDefauls(i)?.range 29603 } 29604 }; 29605 } 29606 axesTypeIntegrity(t) { 29607 if ("axes" in t && t.axes) { 29608 const i = t.axes; 29609 for (const { type: s } of i) 29610 if (!E$(s)) { 29611 delete t.axes; 29612 const n = ia.publicKeys().join(", "); 29613 Ee.warnOnce(`unknown axis type: ${s}; expected one of: ${n}`); 29614 } 29615 } 29616 } 29617 seriesTypeIntegrity(t) { 29618 t.series = t.series?.filter(({ type: i }) => { 29619 if (i == null || D$(i) || r$(i)) 29620 return !0; 29621 Ee.warnOnce( 29622 `unknown series type: ${JSON.stringify(i)}; expected one of: ${lF.seriesTypes.join(", ")}` 29623 ); 29624 }); 29625 } 29626 soloSeriesIntegrity(t) { 29627 const i = t.series; 29628 if (i && i.length > 1 && i.some((s) => Nn.isSolo(s.type))) { 29629 const s = this.optionsType(t); 29630 if (Nn.isSolo(s)) 29631 Ee.warn( 29632 `series[0] of type '${s}' is incompatible with other series types. Only processing series[0]` 29633 ), t.series = i.slice(0, 1); 29634 else { 29635 const { solo: n, nonSolo: o } = Gv( 29636 i, 29637 (a) => Nn.isSolo(a.type) ? "solo" : "nonSolo" 29638 ), r = _S(n.map((a) => a.type)).join(", "); 29639 Ee.warn(`Unable to mix these series types with the lead series type: ${r}`), t.series = o; 29640 } 29641 } 29642 } 29643 static enableConfiguredJsonOptions(t, i) { 29644 i && "enabled" in i && !i._enabledFromTheme && t.enabled == null && (i.enabled = !0); 29645 } 29646 static cleanupEnabledFromThemeJsonOptions(t) { 29647 t._enabledFromTheme != null && delete t._enabledFromTheme; 29648 } 29649 enableConfiguredOptions(t, i) { 29650 Xr(i, lr.enableConfiguredJsonOptions, /* @__PURE__ */ new Set(["data", "theme"]), t), Xr(t, lr.cleanupEnabledFromThemeJsonOptions, /* @__PURE__ */ new Set(["data", "theme"])); 29651 } 29652 static removeDisabledOptionJson(t) { 29653 "enabled" in t && t.enabled === !1 && Object.keys(t).forEach((i) => { 29654 i !== "enabled" && delete t[i]; 29655 }); 29656 } 29657 removeDisabledOptions(t) { 29658 Xr(t, lr.removeDisabledOptionJson, /* @__PURE__ */ new Set(["data", "theme"])); 29659 } 29660 static removeLeftoverSymbolsJson(t) { 29661 if (!(!t || !Qs(t))) 29662 for (const [i, s] of Object.entries(t)) 29663 ek(s) && delete t[i]; 29664 } 29665 removeLeftoverSymbols(t) { 29666 Xr(t, lr.removeLeftoverSymbolsJson, /* @__PURE__ */ new Set(["data"])); 29667 } 29668 specialOverridesDefaults(t) { 29669 if (t.window != null ? $k(t.window) : typeof window < "u" ? t.window = window : typeof global < "u" && (t.window = global.window), t.document != null ? jk(t.document) : typeof document < "u" ? t.document = document : typeof global < "u" && (t.document = global.document), t.window == null) 29670 throw new Error("AG Charts - unable to resolve global window"); 29671 if (t.document == null) 29672 throw new Error("AG Charts - unable to resolve global document"); 29673 return t; 29674 } 29675}; 29676z1.OPTIONS_CLONE_OPTS = /* @__PURE__ */ new Set(["data", "container"]); 29677z1.FAST_PATH_OPTIONS = /* @__PURE__ */ new Set(["data", "width", "height"]); 29678var K2 = z1, HZ = 100, H1 = class gc { 29679 constructor(t, i, s, n, o, r = HZ) { 29680 this.name = t, this.buildItem = i, this.releaseItem = s, this.destroyItem = n, this.maxPoolSize = o, this.cleanupTimeMs = r, this.freePool = [], this.busyPool = /* @__PURE__ */ new Set(); 29681 } 29682 static getPool(t, i, s, n, o) { 29683 return this.pools.has(t) || this.pools.set(t, new gc(t, i, s, n, o)), this.pools.get(t); 29684 } 29685 isFull() { 29686 return this.freePool.length + this.busyPool.size >= this.maxPoolSize; 29687 } 29688 obtain(t) { 29689 if (this.freePool.length === 0 && this.isFull()) 29690 throw new Error("AG Charts - pool exhausted"); 29691 let i = this.freePool.pop(); 29692 return i == null ? (i = this.buildItem(t), gc.debug( 29693 `Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size + 1} / ${this.maxPoolSize})`, 29694 i 29695 )) : gc.debug( 29696 `Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size + 1} / ${this.maxPoolSize})`, 29697 i 29698 ), this.busyPool.add(i), { item: i, release: () => this.release(i) }; 29699 } 29700 release(t) { 29701 if (!this.busyPool.has(t)) 29702 throw new Error("AG Charts - cannot free item from pool which is not tracked as busy."); 29703 gc.debug( 29704 `Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`, 29705 t 29706 ), this.releaseItem(t), this.busyPool.delete(t), this.freePool.push(t), gc.debug( 29707 `Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`, 29708 t 29709 ), this.cleanPoolTimer && clearTimeout(this.cleanPoolTimer), this.cleanPoolTimer = setTimeout(() => { 29710 this.cleanPool(); 29711 }, this.cleanupTimeMs); 29712 } 29713 cleanPool() { 29714 const t = this.freePool.splice(0); 29715 for (const i of t) 29716 this.destroyItem(i); 29717 gc.debug( 29718 `Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})` 29719 ); 29720 } 29721 destroy() { 29722 this.cleanPool(); 29723 for (const t of this.busyPool.values()) 29724 this.destroyItem(t); 29725 this.busyPool.clear(); 29726 } 29727}; 29728H1.pools = /* @__PURE__ */ new Map(); 29729H1.debug = Xt.create(!0, "pool"); 29730var VZ = H1, Bf = Xt.create(!0, "opts"); 29731function LR(e) { 29732 if (Pp(e)) 29733 return "cartesian"; 29734 if (oy(e)) 29735 return "polar";
29736 if (Ex(e)) 29737 return "hierarchy"; 29738 if (Ix(e)) 29739 return "topology"; 29740 if (Rx(e)) 29741 return "flow-proportion"; 29742 if (Gm(e)) 29743 return "standalone"; 29744 if (ry(e)) 29745 return "gauge"; 29746 throw new Error(`AG Chart - unknown type of chart for options with type: ${e.type}`); 29747} 29748var rl = class { 29749 static licenseCheck(t) { 29750 this.licenseChecked || (this.licenseManager = na.licenseManager?.(t), this.licenseManager?.validateLicense(), this.licenseChecked = !0); 29751 } 29752 static getLicenseDetails(t) { 29753 return na.licenseManager?.({}).getLicenseDetails(t); 29754 } 29755 /** 29756 * Returns the `AgChartInstance` for a DOM node, if there is one. 29757 */ 29758 static getInstance(t) { 29759 return kR.getInstance(t); 29760 } 29761 /** 29762 * Create a new `AgChartInstance` based upon the given configuration options. 29763 */ 29764 static create(t, i) { 29765 this.licenseCheck(t); 29766 const s = kR.createOrUpdate({ 29767 userOptions: t, 29768 licenseManager: this.licenseManager, 29769 optionsMetadata: i 29770 }); 29771 return this.licenseManager?.isDisplayWatermark() && this.licenseManager && na.injectWatermark?.(s.chart.ctx.domManager, this.licenseManager.getWatermarkMessage()), s; 29772 } 29773 static createFinancialChart(t) { 29774 return this.create(t, { presetType: "price-volume" }); 29775 } 29776 static createGauge(t) { 29777 return this.create(t, { presetType: "gauge" }); 29778 } 29779 static __createSparkline(t) { 29780 const { pool: i, ...s } = t; 29781 return this.create(s, { presetType: "sparkline", pool: i ?? !0 }); 29782 } 29783}; 29784rl.licenseChecked = !1; 29785var Go = class no { 29786 static getInstance(t) { 29787 const i = Pl.getInstance(t); 29788 return i ? eR.chartInstances.get(i) : void 0; 29789 } 29790 static initialiseModules() { 29791 no.initialised || (HK(), VK(), no.initialised = !0); 29792 } 29793 static createOrUpdate(t) { 29794 let { proxy: i } = t; 29795 const { 29796 userOptions: s, 29797 licenseManager: n, 29798 processedOverrides: o = i?.chart.chartOptions.processedOverrides ?? {}, 29799 specialOverrides: r = i?.chart.chartOptions.specialOverrides ?? {}, 29800 optionsMetadata: a = i?.chart.chartOptions.optionMetadata ?? {}, 29801 deltaOptions: l, 29802 stripSymbols: c = !1 29803 } = t, u = na.styles != null ? [["ag-charts-enterprise", na.styles]] : [], { presetType: d } = a; 29804 no.initialiseModules(), Bf(">>> AgCharts.createOrUpdate() user options", s); 29805 let p = s; 29806 rl.optionsMutationFn && p && (p = rl.optionsMutationFn(As(p), d), Bf(">>> AgCharts.createOrUpdate() MUTATED user options", p)); 29807 const { 29808 overrideDevicePixelRatio: f, 29809 document: m, 29810 window: y, 29811 styleContainer: b, 29812 ...C 29813 } = p ?? {}, w = (l ? i?.chart.getChartOptions() : C) ?? C, M = new K2( 29814 w, 29815 o, 29816 { 29817 ...r, 29818 document: m, 29819 window: y, 29820 overrideDevicePixelRatio: f, 29821 styleContainer: b 29822 }, 29823 a, 29824 l, 29825 c 29826 ); 29827 let A = !1, I = i?.chart, L; 29828 return (I == null || LR(M.processedOptions) !== LR(I?.chartOptions.processedOptions)) && (L = this.getPool(M)?.obtain(M), L ? I = L.item : (A = !0, I = no.createChartInstance(M, I)), u?.forEach(([k, B]) => { 29829 I?.ctx.domManager.addStyles(k, B); 29830 })), i == null ? (i = new eR(I, no.callbackApi, n), i.releaseChart = L?.release) : (L || A) && (i.releaseChart?.(), i.chart = I, i.releaseChart = L?.release), Bf.check() && typeof window < "u" && (window.agChartInstances ?? (window.agChartInstances = {}), window.agChartInstances[I.id] = I), I.queuedUserOptions.push(M.userOptions), I.queuedChartOptions.push(M), I.requestFactoryUpdate((k) => { 29831 k.applyOptions(M); 29832 const B = k.queuedUserOptions.indexOf(M.userOptions) + 1; 29833 k.queuedUserOptions.splice(0, B), k.queuedChartOptions.splice(0, B); 29834 }), i; 29835 } 29836 static markRemovedProperties(t) { 29837 if (typeof t == "object") 29838 for (const [i, s] of Object.entries(t)) 29839 typeof s > "u" && (no.markedRemovedProperties = !0, Object.assign(t, { [i]: /* @__PURE__ */ Symbol("UNSET") })); 29840 } 29841 static updateUserDelta(t, i) { 29842 i = As(i, /* @__PURE__ */ new Set(["data"])), no.markedRemovedProperties = !1, Xr(i, no.markRemovedProperties, /* @__PURE__ */ new Set(["data"])), Bf(">>> AgCharts.updateUserDelta() user delta", i), no.createOrUpdate({ 29843 proxy: t, 29844 deltaOptions: i,
29845 stripSymbols: no.markedRemovedProperties 29846 }); 29847 } 29848 static createChartInstance(t, i) { 29849 const s = i?.destroy({ keepTransferableResources: !0 }), n = no.getChartByOptions(t.processedOptions); 29850 return new n(t, s); 29851 } 29852 static getChartByOptions(t) { 29853 if (Pp(t)) 29854 return gY; 29855 if (Ex(t)) 29856 return O1; 29857 if (oy(t)) 29858 return N1; 29859 if (Ix(t)) 29860 return B1; 29861 if (Rx(t)) 29862 return P1; 29863 if (Gm(t)) 29864 return _1; 29865 if (ry(t)) 29866 return F1; 29867 throw new Error( 29868 "AG Charts - couldn't apply configuration, check options are correctly structured and series types are specified" 29869 ); 29870 } 29871 static getPool(t) { 29872 if (t.optionMetadata.pool === !0) 29873 return VZ.getPool( 29874 t.optionMetadata.presetType ?? "default", 29875 this.createChartInstance, 29876 this.detachAndClear, 29877 this.destroy, 29878 1 / 0 29879 // AG-13480 - Prevent Grid exhausting pool during sorting. 29880 ); 29881 } 29882}; 29883Go.caretaker = new DP(_m); 29884Go.initialised = !1; 29885Go.callbackApi = { 29886 caretaker: Go.caretaker, 29887 create(e, t, i, s) { 29888 return Go.createOrUpdate({ 29889 userOptions: e, 29890 processedOverrides: t, 29891 specialOverrides: i, 29892 optionsMetadata: s 29893 }); 29894 }, 29895 update(e, t) { 29896 return Go.createOrUpdate({ userOptions: e, proxy: t }); 29897 }, 29898 updateUserDelta(e, t) { 29899 return Go.updateUserDelta(e, t); 29900 } 29901}; 29902Go.markedRemovedProperties = !1; 29903Go.detachAndClear = (e) => e.detachAndClear(); 29904Go.destroy = (e) => e.destroy(); 29905var kR = Go, UZ = {}; 29906Zo(UZ, { 29907 Arc: () => Jo, 29908 BBox: () => _e, 29909 BandScale: () => Tl, 29910 Caption: () => Qt, 29911 Circle: () => hl, 29912 Group: () => Ye, 29913 Line: () => Hn, 29914 LinearScale: () => mo, 29915 Path: () => sn, 29916 RadialColumnShape: () => Do, 29917 Rect: () => Ts, 29918 Scene: () => sy, 29919 Sector: () => as, 29920 Shape: () => Co, 29921 TranslatableGroup: () => Ks, 29922 getRadialColumnWidth: () => Z2, 29923 toRadians: () => Es 29924}); 29925var Jo = class extends sn { 29926 constructor() { 29927 super(), this.centerX = 0, this.centerY = 0, this.radius = 10, this.startAngle = 0, this.endAngle = Math.PI * 2, this.counterClockwise = !1, this.type = 0, this.restoreOwnStyles(); 29928 } 29929 get fullPie() { 29930 return Qh(zt(this.startAngle), zt(this.endAngle)); 29931 } 29932 updatePath() { 29933 const e = this.path; 29934 e.clear(), e.arc(this.centerX, this.centerY, this.radius, this.startAngle, this.endAngle, this.counterClockwise), this.type === 1 ? e.closePath() : this.type === 2 && !this.fullPie && (e.lineTo(this.centerX, this.centerY), e.closePath()); 29935 } 29936 computeBBox() { 29937 return new _e(this.centerX - this.radius, this.centerY - this.radius, this.radius * 2, this.radius * 2); 29938 } 29939 isPointInPath(e, t) { 29940 const i = this.getBBox(); 29941 return this.type !== 0 && i.containsPoint(e, t) && this.path.isPointInPath(e, t); 29942 } 29943}; 29944Jo.className = "Arc"; 29945Jo.defaultStyles = { ...Co.defaultStyles, lineWidth: 1, fillStyle: null }; 29946S([ 29947 Je() 29948], Jo.prototype, "centerX", 2); 29949S([ 29950 Je() 29951], Jo.prototype, "centerY", 2); 29952S([ 29953 Je() 29954], Jo.prototype, "radius", 2); 29955S([ 29956 Je() 29957], Jo.prototype, "startAngle", 2); 29958S([ 29959 Je() 29960], Jo.prototype, "endAngle", 2); 29961S([ 29962 Je() 29963], Jo.prototype, "counterClockwise", 2); 29964S([ 29965 Je() 29966], Jo.prototype, "type", 2); 29967function d0(e, t, i) { 29968 const s = Math.sqrt(e ** 2 + t ** 2), o = Math.atan2(t, e) + i; 29969 return { 29970 x: Math.cos(o) * s, 29971 y: Math.sin(o) * s 29972 }; 29973} 29974var Do = class extends sn { 29975 constructor() { 29976 super(...arguments), this.isBeveled = !0, this.columnWidth = 0, this.startAngle = 0, this.endAngle = 0, this.outerRadius = 0, this.innerRadius = 0, this.axisInnerRadius = 0, this.axisOuterRadius = 0, this.isRadiusAxisReversed = !1; 29977 } 29978 set cornerRadius(e) { 29979 } 29980 computeBBox() { 29981 const { innerRadius: e, outerRadius: t, columnWidth: i } = this, s = this.getRotation(), n = -i / 2, o = i / 2, r = -t, a = -e; 29982 let l = 1 / 0, c = 1 / 0, u = -1 / 0, d = -1 / 0; 29983 for (let p = 0; p < 4; p += 1) { 29984 const { x: f, y: m } = d0(p % 2 === 0 ? n : o, p < 2 ? r : a, s); 29985 l = Math.min(f, l), c = Math.min(m, c), u = Math.max(f, u), d = Math.max(m, d); 29986 } 29987 return new _e(l, c, u - l, d - c); 29988 } 29989 getRotation() { 29990 const { startAngle: e, endAngle: t } = this, i = pg(e, t); 29991 return zt(e + i / 2 + Math.PI / 2); 29992 } 29993 updatePath() { 29994 const { isBeveled: e } = this; 29995 e ? this.updateBeveledPath() : this.updateRectangularPath(), this.checkPathDirty(); 29996 } 29997 updateRectangularPath() { 29998 const { columnWidth: e, innerRadius: t, outerRadius: i, path: s } = this, n = -e / 2, o = e / 2, r = -i, a = -t, l = this.getRotation(), c = [ 29999 [n, a], 30000 [n, r], 30001 [o, r], 30002 [o, a] 30003 ].map(([u, d]) => d0(u, d, l)); 30004 s.clear(!0), s.moveTo(c[0].x, c[0].y), s.lineTo(c[1].x, c[1].y), s.lineTo(c[2].x, c[2].y), s.lineTo(c[3].x, c[3].y), s.closePath(); 30005 } 30006 updateBeveledPath() { 30007 const { columnWidth: e, path: t, outerRadius: i, innerRadius: s, axisInnerRadius: n, axisOuterRadius: o, isRadiusAxisReversed: r } = this, a = Qh(s, n), l = Math.asin(e / 2 / s), c = this.getRotation(), u = (B, N) => d0(B, N, c), d = (B, N) => Math.sqrt(B ** 2 + N ** 2), p = (B, N) => N > B ? 0 : Math.sqrt(B ** 2 - N ** 2), f = (B, N, W) => W ? B < N : B > N, m = a && !isNaN(l) && l < Math.PI / 6;
30008 let y = -e / 2, b = e / 2; 30009 const C = -i, w = -s * (m ? Math.cos(l) : 1), M = f( 30010 o, 30011 d(s, e / 2), 30012 !r 30013 ); 30014 if (M) { 30015 const B = p(o, s); 30016 y = -B, b = B; 30017 } 30018 t.clear(!0); 30019 const A = u(y, w); 30020 t.moveTo(A.x, A.y); 30021 const I = Qh(s, i), L = f( 30022 o, 30023 d(i, e / 2), 30024 !r 30025 ); 30026 if (I && m) 30027 t.arc( 30028 0, 30029 0, 30030 s, 30031 zt(-l - Math.PI / 2) + c, 30032 zt(l - Math.PI / 2) + c, 30033 !1 30034 ); 30035 else if (L) { 30036 const B = -p(o, e / 2), N = p(o, i); 30037 if (!M) { 30038 const W = u(y, B); 30039 t.lineTo(W.x, W.y); 30040 } 30041 if (t.arc( 30042 0, 30043 0, 30044 o, 30045 Math.atan2(B, y) + c, 30046 Math.atan2(C, -N) + c, 30047 !1 30048 ), !Qh(N, 0)) { 30049 const W = u(N, C); 30050 t.lineTo(W.x, W.y); 30051 } 30052 t.arc( 30053 0, 30054 0, 30055 o, 30056 Math.atan2(C, N) + c, 30057 Math.atan2(B, b) + c, 30058 !1 30059 ); 30060 } else { 30061 const B = u(y, C), N = u(b, C); 30062 t.lineTo(B.x, B.y), t.lineTo(N.x, N.y); 30063 } 30064 const k = u(b, w); 30065 if (t.lineTo(k.x, k.y), m) 30066 t.arc( 30067 0, 30068 0, 30069 s, 30070 zt(l - Math.PI / 2) + c, 30071 zt(-l - Math.PI / 2) + c, 30072 !0 30073 ); 30074 else { 30075 const B = u(y, w); 30076 t.lineTo(B.x, B.y); 30077 } 30078 t.closePath(); 30079 } 30080}; 30081Do.className = "RadialColumnShape"; 30082S([ 30083 Je() 30084], Do.prototype, "isBeveled", 2); 30085S([ 30086 Je() 30087], Do.prototype, "columnWidth", 2); 30088S([ 30089 Je() 30090], Do.prototype, "startAngle", 2); 30091S([ 30092 Je() 30093], Do.prototype, "endAngle", 2); 30094S([ 30095 Je() 30096], Do.prototype, "outerRadius", 2); 30097S([ 30098 Je() 30099], Do.prototype, "innerRadius", 2); 30100S([ 30101 Je() 30102], Do.prototype, "axisInnerRadius", 2); 30103S([ 30104 Je() 30105], Do.prototype, "axisOuterRadius", 2); 30106S([ 30107 Je() 30108], Do.prototype, "isRadiusAxisReversed", 2); 30109function Z2(e, t, i, s, n) { 30110 const o = pg(e, t), r = o * (1 - s) / 2; 30111 if (e += r, t -= r, o < 1e-3) 30112 return 2 * i * n; 30113 if (o >= 2 * Math.PI) { 30114 const f = e + o / 2; 30115 e = f - Math.PI, t = f + Math.PI; 30116 } 30117 const a = i * Math.cos(e), l = i * Math.sin(e), c = i * Math.cos(t), u = i * Math.sin(t), d = Math.floor(Math.sqrt((a - c) ** 2 + (l - u) ** 2)), p = 2 * i * n; 30118 return Math.max(1, Math.min(p, d)); 30119} 30120var WZ = {}; 30121Zo(WZ, { 30122 ChartTheme: () => Ta, 30123 DEFAULT_ANNOTATION_BACKGROUND_FILL: () => Dn, 30124 DEFAULT_ANNOTATION_COLOR: () => An, 30125 DEFAULT_ANNOTATION_HANDLE_FILL: () => Ry, 30126 DEFAULT_ANNOTATION_STATISTICS_COLOR: () => ky, 30127 DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE: () => Py, 30128 DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL: () => i1, 30129 DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE: () => s1, 30130 DEFAULT_ANNOTATION_STATISTICS_FILL: () => Ty, 30131 DEFAULT_ANNOTATION_STATISTICS_STROKE: () => Ly, 30132 DEFAULT_AXIS_GRID_COLOUR: () => xl, 30133 DEFAULT_AXIS_LINE_COLOUR: () => lp, 30134 DEFAULT_BACKGROUND_COLOUR: () => Np, 30135 DEFAULT_CAPTION_ALIGNMENT: () => nl, 30136 DEFAULT_CAPTION_LAYOUT_STYLE: () => sl, 30137 DEFAULT_COLOURS: () => n2, 30138 DEFAULT_CROSS_LINES_COLOUR: () => sd, 30139 DEFAULT_DIVERGING_SERIES_COLOR_RANGE: () => Mn, 30140 DEFAULT_FIBONACCI_STROKES: () => t1, 30141 DEFAULT_FONT_FAMILY: () => Si, 30142 DEFAULT_FUNNEL_SERIES_COLOR_RANGE: () => Tr, 30143 DEFAULT_GAUGE_SERIES_COLOR_RANGE: () => Ao, 30144 DEFAULT_GRIDLINE_ENABLED: () => dr, 30145 DEFAULT_HIERARCHY_FILLS: () => Dy, 30146 DEFAULT_HIERARCHY_STROKES: () => Ey, 30147 DEFAULT_INSIDE_SERIES_LABEL_COLOUR: () => _l, 30148 DEFAULT_INVERTED_BACKGROUND_COLOUR: () => my, 30149 DEFAULT_INVERTED_LABEL_COLOUR: () => Zx, 30150 DEFAULT_LABEL_COLOUR: () => Zi, 30151 DEFAULT_MUTED_LABEL_COLOUR: () => fl, 30152 DEFAULT_NAVIGATOR_STROKE: () => vy, 30153 DEFAULT_PADDING: () => Zr, 30154 DEFAULT_POLAR_SERIES_STROKE: () => My, 30155 DEFAULT_SEPARATION_LINES_COLOUR: () => Cg, 30156 DEFAULT_SHADOW_COLOUR: () => Bl, 30157 DEFAULT_SPARKLINE_CROSSHAIR_STROKE: () => Ay, 30158 DEFAULT_TEXTBOX_COLOR: () => Ny, 30159 DEFAULT_TEXTBOX_FILL: () => Fy, 30160 DEFAULT_TEXTBOX_STROKE: () => Oy, 30161 DEFAULT_TEXT_ANNOTATION_COLOR: () => Iy, 30162 DEFAULT_TOOLBAR_POSITION: () => bg, 30163 IS_COMMUNITY: () => Yx, 30164 IS_DARK_THEME: () => id, 30165 IS_ENTERPRISE: () => Kx, 30166 PALETTE_ALT_DOWN_FILL: () => Jx, 30167 PALETTE_ALT_DOWN_STROKE: () => Qx, 30168 PALETTE_ALT_NEUTRAL_FILL: () => e1, 30169 PALETTE_ALT_NEUTRAL_STROKE: () => xy, 30170 PALETTE_ALT_UP_FILL: () => Xx, 30171 PALETTE_ALT_UP_STROKE: () => qx, 30172 PALETTE_DOWN_FILL: () => wy, 30173 PALETTE_DOWN_STROKE: () => Cy, 30174 PALETTE_NEUTRAL_FILL: () => Sy, 30175 PALETTE_NEUTRAL_STROKE: () => Qd, 30176 PALETTE_UP_FILL: () => by, 30177 PALETTE_UP_STROKE: () => yy, 30178 getChartTheme: () => Qm, 30179 themeNames: () => jZ, 30180 themeSymbols: () => $x, 30181 themes: () => G1 30182}); 30183var jZ = Object.keys(G1), $Z = {}; 30184Zo($Z, { 30185 Color: () => Bo, 30186 interpolateColor: () => YL 30187}); 30188rl.create.bind(rl), rl.__createSparkline.bind(rl); 30189var YZ = {}; 30190Zo(YZ, { 30191 AND: () => Dr, 30192 ARRAY: () => lg, 30193 ARRAY_OF: () => va, 30194 AbstractBarSeries: () => E2, 30195 AbstractBarSeriesProperties: () => v1, 30196 ActionOnSet: () => Un, 30197 AnchoredPopover: () => tO, 30198 Animation: () => ok, 30199 AnimationManager: () => UP, 30200 Arc: () => Jo, 30201 ArrowDown: () => eO, 30202 ArrowUp: () => J2, 30203 Axis: () => lx, 30204 AxisInterval: () => $c, 30205 AxisLabel: () => is, 30206 AxisTick: () => Bd, 30207 AxisTicks: () => fq, 30208 BBox: () => _e, 30209 BBoxValues: () => Tv, 30210 BOOLEAN: () => je, 30211 BOOLEAN_ARRAY: () => j8,
30212 Background: () => Kd, 30213 BackgroundModule: () => QF, 30214 BandScale: () => Tl, 30215 BarSeries: () => _y, 30216 BarSeriesModule: () => P2, 30217 BaseModuleInstance: () => Xv, 30218 BaseProperties: () => it, 30219 BaseToolbar: () => q1, 30220 ButtonWidget: () => fg, 30221 COLOR_STRING: () => Ft, 30222 COLOR_STRING_ARRAY: () => xo, 30223 CachedTextMeasurer: () => Jk, 30224 CachedTextMeasurerPool: () => wa, 30225 Caption: () => Qt, 30226 CartesianAxis: () => Pc, 30227 CartesianSeries: () => Fl, 30228 CartesianSeriesNodeEvent: () => Gx, 30229 CartesianSeriesProperties: () => Da, 30230 CategoryAxis: () => zd, 30231 ChangeDetectableProperties: () => o1, 30232 ChartAxisDirection: () => $S, 30233 ChartEventManager: () => WP, 30234 ChartOptions: () => K2, 30235 ChartUpdateType: () => np, 30236 Circle: () => hl, 30237 CollapseMode: () => m2, 30238 Color: () => Bo, 30239 ColorScale: () => Wc, 30240 ConicGradient: () => wq, 30241 ContextMenuRegistry: () => jP, 30242 ContinuousScale: () => ti, 30243 Cursor: () => $P, 30244 CursorManager: () => YP, 30245 DATE: () => HS, 30246 DATE_ARRAY: () => $8, 30247 DATE_OR_DATETIME_MS: () => VS, 30248 DEFAULT_CARTESIAN_DIRECTION_KEYS: () => Kc, 30249 DEFAULT_CARTESIAN_DIRECTION_NAMES: () => Zc, 30250 DEFAULT_TOOLTIP_CLASS: () => ws, 30251 DEFAULT_TOOLTIP_DARK_CLASS: () => DF, 30252 DIRECTION: () => bk, 30253 DOMManager: () => LP, 30254 DataController: () => rF, 30255 DataModel: () => nF, 30256 DataModelSeries: () => _x, 30257 DataService: () => ny, 30258 Debug: () => Xt, 30259 Default: () => Ll, 30260 Deprecated: () => KZ, 30261 DeprecatedAndRenamedTo: () => ZZ, 30262 Diamond: () => vF, 30263 DraggablePopover: () => iO, 30264 DropShadow: () => Xo, 30265 ExtendedPath2D: () => Fp, 30266 FONT_STYLE: () => Ca, 30267 FONT_WEIGHT: () => ba, 30268 FUNCTION: () => tn, 30269 FloatingToolbar: () => Dq, 30270 GREATER_THAN: () => ug, 30271 GestureDetector: () => KP, 30272 Gradient: () => Kv, 30273 Group: () => Ye, 30274 GroupedCategoryAxis: () => Oc, 30275 HdpiCanvas: () => bx, 30276 HierarchyNode: () => Vh, 30277 HierarchySeries: () => pq, 30278 HierarchySeriesProperties: () => Gl, 30279 HighlightManager: () => ZP, 30280 HighlightProperties: () => Bx, 30281 HighlightStyle: () => yg, 30282 INTERACTION_RANGE: () => jv, 30283 INTERPOLATION_STEP_POSITION: () => c2, 30284 INTERPOLATION_TYPE: () => l2, 30285 Image: () => Xc, 30286 InteractionManager: () => wx, 30287 InteractionState: () => hx, 30288 InterpolationProperties: () => Xd, 30289 Invalidating: () => os, 30290 KeyNavManager: () => qP, 30291 LABEL_PLACEMENT: () => jS, 30292 LARGEST_KEY_INTERVAL: () => VF, 30293 LESS_THAN: () => cg, 30294 LINE_CAP: () => Y8, 30295 LINE_DASH: () => ya, 30296 LINE_JOIN: () => K8, 30297 LINE_STYLE: () => Z8, 30298 Label: () => ts, 30299 LayoutElement: () => dx, 30300 LayoutManager: () => xP, 30301 LegendMarkerLabel: () => Ia, 30302 Line: () => Hn, 30303 LineSeries: () => By, 30304 LineSeriesModule: () => O2, 30305 LinearGradient: () => Xk, 30306 LinearScale: () => mo, 30307 Listeners: () => Er, 30308 Logger: () => Ee, 30309 LonLatBBox: () => gq, 30310 MARKER_SHAPE: () => r2, 30311 MATCHING_CROSSLINE_TYPE: () => ax,
30312 MAX_SPACING: () => Sk, 30313 MIN_SPACING: () => wk, 30314 Marker: () => Sn, 30315 Menu: () => xq, 30316 MercatorScale: () => Tw, 30317 ModuleRegistry: () => CP, 30318 Motion: () => sw, 30319 NAN: () => Vv, 30320 NODE_UPDATE_STATE_TO_PHASE_MAPPING: () => Zs, 30321 NUMBER: () => At, 30322 NUMBER_ARRAY: () => Uv, 30323 NUMBER_OR_NAN: () => _d, 30324 NativeWidget: () => dl, 30325 Node: () => wl, 30326 OBJECT: () => Be, 30327 OBJECT_ARRAY: () => US, 30328 OR: () => Hc, 30329 OVERFLOW_STRATEGY: () => Q8, 30330 ObserveChanges: () => jc, 30331 OrdinalTimeScale: () => Oo, 30332 PHASE_METADATA: () => Mp, 30333 PHASE_ORDER: () => Fu, 30334 PLACEMENT: () => X8, 30335 PLAIN_OBJECT: () => fk, 30336 POINTER_INTERACTION_TYPES: () => HP, 30337 POSITION: () => WS, 30338 POSITION_TOP_COORDINATES: () => Nm, 30339 POSITIVE_NUMBER: () => Te, 30340 PREV_NEXT_KEYS: () => ed, 30341 Padding: () => kl, 30342 ParallelStateMachine: () => Y7, 30343 Path: () => sn, 30344 PointerEvents: () => WL, 30345 PolarAxis: () => Nc, 30346 PolarSeries: () => zy, 30347 PolarZIndexMap: () => z2, 30348 Popover: () => Z1, 30349 PropertiesArray: () => ag, 30350 ProxyInteractionService: () => PP, 30351 ProxyOnWrite: () => j7, 30352 ProxyProperty: () => Ri, 30353 ProxyPropertyOnWrite: () => rs, 30354 QUICK_TRANSITION: () => Lm, 30355 RATIO: () => Pt, 30356 REAL_NUMBER: () => mk, 30357 RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD: () => Um, 30358 RadialColumnShape: () => Do, 30359 Range: () => qo, 30360 Rect: () => Ts, 30361 RegionManager: () => QP, 30362 RepeatType: () => nk, 30363 Rotatable: () => Vc, 30364 RotatableGroup: () => b7, 30365 RotatableText: () => eP, 30366 SKIP_JS_BUILTINS: () => FS, 30367 SMALLEST_KEY_INTERVAL: () => HF, 30368 SORT_DOMAIN_GROUPS: () => UF, 30369 STRING: () => Me, 30370 STRING_ARRAY: () => yk, 30371 Scalable: () => JS, 30372 ScalableGroup: () => C7, 30373 Scene: () => sy, 30374 SceneChangeDetection: () => Ge, 30375 ScenePathChangeDetection: () => Je, 30376 Sector: () => as, 30377 SectorBox: () => _2, 30378 Selection: () => _i, 30379 Series: () => Ud, 30380 SeriesContentZIndexMap: () => dF, 30381 SeriesGroupingChangedEvent: () => Tx, 30382 SeriesItemHighlightStyle: () => Aa, 30383 SeriesMarker: () => En, 30384 SeriesNodeEvent: () => vg, 30385 SeriesNodePickMode: () => hF, 30386 SeriesProperties: () => Wn, 30387 SeriesTooltip: () => Ls, 30388 SeriesZIndexMap: () => uF, 30389 Shape: () => Co, 30390 SimpleTextMeasurer: () => ix, 30391 SliderWidget: () => Cx, 30392 Square: () => ly, 30393 StateMachine: () => gg, 30394 StateMachineProperty: () => $7, 30395 SvgPath: () => Y1, 30396 TEXT_ALIGN: () => Ck, 30397 TEXT_WRAP: () => Wv, 30398 TICK_INTERVAL: () => uP, 30399 Text: () => Qi, 30400 TextUtils: () => vi, 30401 TextWrapper: () => rx, 30402 ThemeConstants: () => XF, 30403 ThemeSymbols: () => $x, 30404 TimeScale: () => QS, 30405 Toolbar: () => Mq, 30406 ToolbarButtonProperties: () => Mg, 30407 ToolbarButtonWidget: () => sO, 30408 ToolbarWidget: () => iy, 30409 Tooltip: () => Rr, 30410 TooltipManager: () => Bm, 30411 TooltipPosition: () => Wd, 30412 Transformable: () => Ii, 30413 TransformableText: () => Sd, 30414 Translatable: () => Uc, 30415 TranslatableGroup: () => Ks, 30416 Triangle: () => op, 30417 UNION: () => si, 30418 UpdateService: () => JP, 30419 VERTICAL_ALIGN: () => q8, 30420 Validate: () => D, 30421 Vec2: () => _u, 30422 Vec4: () => bw, 30423 WIDGET_HTML_EVENTS: () => vx, 30424 Widget: () => xa, 30425 WidgetEventUtil: () => Lp, 30426 ZIndexMap: () => cP, 30427 ZoomManager: () => XP, 30428 __FORCE_MODULE_DETECTION: () => mq, 30429 accumulateGroup: () => WF, 30430 accumulateStack: () => jF, 30431 accumulatedValue: () => OF, 30432 accumulativeValueProperty: () => Op, 30433 addHitTestersToQuadtree: () => f1, 30434 adjustLabelPlacement: () => k2, 30435 angleBetween: () => pg, 30436 angleDiff: () => E7, 30437 animationValidation: () => jd, 30438 areScalingEqual: () => nd, 30439 area: () => Dw, 30440 arraysEqual: () => ul, 30441 backfillPathPointData: () => vK, 30442 buildFormatter: () => rg, 30443 buildResetPathFn: () => p1, 30444 calculateDefaultTimeTickFormat: () => hk, 30445 calculateDerivativeExtrema: () => xw, 30446 calculateDerivativeExtremaXY: () => gF, 30447 calculateLabelChartPadding: () => aP, 30448 calculateLabelTranslation: () => mw, 30449 calculatePlacement: () => Mw, 30450 checkCrisp: () => T2, 30451 circularSliceArray: () => cw, 30452 clamp: () => ot, 30453 clampArray: () => tw, 30454 clippedRoundRect: () => hm, 30455 clockwiseAngle: () => qk, 30456 clockwiseAngles: () => T7, 30457 collapsedStartingBarPosition: () => Hp, 30458 compareDates: () => _k, 30459 computeBarFocusBounds: () => C1, 30460 computeMarkerFocusBounds: () => xg, 30461 countFractionDigits: () => Fv, 30462 createButton: () => vq, 30463 createCheckbox: () => yq, 30464 createDatumId: () => ps, 30465 createDeprecationWarning: () => V1, 30466 createElement: () => Gt, 30467 createElementId: () => x7, 30468 createElementNS: () => hw,
30469 createIcon: () => Q2, 30470 createId: () => So, 30471 createSelect: () => Cq, 30472 createTextArea: () => bq, 30473 dateToNumber: () => hn, 30474 datesSortOrder: () => qS, 30475 datumKeys: () => kp, 30476 datumStylerProperties: () => pl, 30477 debounce: () => y8, 30478 deconstructSelectionsOrNodes: () => Bv, 30479 deepClone: () => As, 30480 deepFreeze: () => Xh, 30481 deepMerge: () => c8, 30482 defaultTimeTickFormat: () => zS, 30483 diff: () => $d, 30484 displacePointFromVector: () => I7, 30485 doOnce: () => km, 30486 downloadUrl: () => Wk, 30487 drawCorner: () => Hh, 30488 easing: () => sw, 30489 enterpriseModule: () => na, 30490 evaluateBezier: () => zm, 30491 excludesType: () => tk, 30492 extent: () => ma, 30493 extractDecoratedProperties: () => qL, 30494 findMaxIndex: () => Fk, 30495 findMaxValue: () => m7, 30496 findMinIndex: () => Ok, 30497 findMinMax: () => Ds, 30498 findMinValue: () => Nk, 30499 findQuadtreeMatch: () => m1, 30500 findRangeExtent: () => wp, 30501 fixNumericExtent: () => vn, 30502 focusCursorAtEnd: () => w7, 30503 formatNumber: () => sP, 30504 formatPercent: () => iP, 30505 formatValue: () => Tp, 30506 fromToMotion: () => Mi, 30507 generateUUID: () => $W, 30508 getAngleRatioRadians: () => Qk, 30509 getDatumRefPoint: () => Sx, 30510 getDocument: () => Xi, 30511 getElementBBox: () => Yk, 30512 getIconClassNames: () => Yv, 30513 getLastFocus: () => mx, 30514 getMarker: () => bo, 30515 getMissCount: () => xx, 30516 getPath: () => PS, 30517 getPathComponents: () => sF, 30518 getRadialColumnWidth: () => Z2, 30519 getRectConfig: () => R2, 30520 getWindow: () => pi, 30521 groupAccumulativeValueProperty: () => gl, 30522 groupAverage: () => FF, 30523 groupBy: () => Gv, 30524 groupCount: () => Aw, 30525 groupStackValueProperty: () => zF, 30526 groupSum: () => PF, 30527 hasNoModifiers: () => ty, 30528 identity: () => rw, 30529 inRange: () => VL, 30530 includes: () => BS, 30531 initMenuKeyNav: () => IP, 30532 initRovingTabIndex: () => gx, 30533 initToolbarKeyNav: () => Hj, 30534 interpolatePoints: () => Ym, 30535 isArray: () => hi, 30536 isBetweenAngles: () => uo, 30537 isBoolean: () => LS, 30538 isButtonClickEvent: () => fx, 30539 isContinuous: () => Zv, 30540 isDate: () => og, 30541 isDecoratedObject: () => Nv, 30542 isDefined: () => cl, 30543 isDenseInterval: () => Ep, 30544 isEnumKey: () => l8, 30545 isEnumValue: () => JL, 30546 isFiniteNumber: () => kt, 30547 isFunction: () => Rl, 30548 isHtmlElement: () => XL, 30549 isInputPending: () => Kk, 30550 isInteger: () => UL, 30551 isNegative: () => Pv, 30552 isNumber: () => zo, 30553 isNumberEqual: () => Qh, 30554 isObject: () => Qs, 30555 isObjectLike: () => a8, 30556 isPlainObject: () => Js, 30557 isProperties: () => br, 30558 isRegExp: () => QL, 30559 isScaleValid: () => Bp, 30560 isString: () => mn, 30561 isSymbol: () => ek, 30562 isValidDate: () => _v, 30563 jsonApply: () => sp, 30564 jsonDiff: () => Sr, 30565 jsonPropertyCompare: () => nP, 30566 jsonWalk: () => Xr, 30567 keyProperty: () => Uo, 30568 labelDirectionHandling: () => lP, 30569 legendSymbolSvg: () => AF, 30570 lineDistanceSquared: () => ip, 30571 listDecoratedProperties: () => wc, 30572 makeAccessibleClickListener: () => Uj, 30573 mapValues: () => u8, 30574 markerFadeInAnimation: () => Gp, 30575 markerPaletteFactory: () => n1, 30576 markerScaleInAnimation: () => u1, 30577 markerSwipeScaleInAnimation: () => d1, 30578 mergeArrayDefaults: () => Tm, 30579 mergeDefaults: () => ht, 30580 midpointStartingBarPosition: () => MK, 30581 minMax: () => mK, 30582 mod: () => TS, 30583 moduleRegistry: () => fr, 30584 motion: () => Iq, 30585 nearestSquared: () => kv, 30586 nearestSquaredInContainer: () => QW, 30587 normaliseGroupTo: () => py, 30588 normalisePropertyTo: () => Sc, 30589 normalisedExtentWithMetadata: () => NS, 30590 normalizeAngle180: () => Rp, 30591 normalizeAngle360: () => zt, 30592 normalizeAngle360Inclusive: () => Zk, 30593 objectsEqual: () => kc, 30594 objectsEqualWith: () => kS, 30595 pairUpSpans: () => cp, 30596 partialAssign: () => tl, 30597 pathFadeInAnimation: () => Km, 30598 pathFadeOutAnimation: () => bK, 30599 pathMotion: () => $m, 30600 pathSwipeInAnimation: () => h1, 30601 pickByMatchingAngle: () => R1, 30602 pickNode: () => Nu, 30603 plotAreaPathFill: () => S2, 30604 plotInterpolatedAreaSeriesFillSpans: () => gm, 30605 plotInterpolatedLinePathStroke: () => pm, 30606 plotLinePathStroke: () => a1, 30607 plotPath: () => A2, 30608 predicateWithMessage: () => jt, 30609 prepareAreaFillAnimationFns: () => x2, 30610 prepareAreaPathAnimation: () => M2, 30611 prepareAxisAnimationContext: () => vw, 30612 prepareAxisAnimationFunctions: () => dP, 30613 prepareBarAnimationFunctions: () => Vp, 30614 prepareLinePathAnimation: () => w2, 30615 prepareLinePathPropertyAnimation: () => c1, 30616 prepareLinePathStrokeAnimationFns: () => l1, 30617 prepareMarkerAnimation: () => hK, 30618 preparePieSeriesAnimationFunctions: () => xc, 30619 range: () => $v, 30620 rangedValueProperty: () => Hx, 30621 renderPartialPath: () => CK, 30622 resetAxisGroupFn: () => hP, 30623 resetAxisLabelSelectionFn: () => gP, 30624 resetAxisLineSelectionFn: () => fP, 30625 resetAxisSelectionFn: () => pP, 30626 resetBarSelectionsFn: () => Up, 30627 resetIds: () => jW, 30628 resetLabelFn: () => Ra, 30629 resetMarkerFn: () => Sg, 30630 resetMarkerPositionFn: () => zp, 30631 resetMotion: () => zi, 30632 resetPieSelectionsFn: () => I1, 30633 round: () => RS, 30634 sanitizeHtml: () => td, 30635 scale: () => Cs,
30636 sectorBox: () => M1, 30637 seriesLabelFadeInAnimation: () => Et, 30638 seriesLabelFadeOutAnimation: () => ol, 30639 setAttribute: () => Yt, 30640 setAttributes: () => Fc, 30641 setDocument: () => jk, 30642 setElementBBox: () => Ip, 30643 setElementStyle: () => Vo, 30644 setPath: () => OS, 30645 setWindow: () => $k, 30646 shallowClone: () => sx, 30647 singleSeriesPaletteFactory: () => wg, 30648 solveBezier: () => Hm, 30649 sortAndUniqueDates: () => Bk, 30650 sortBasedOnArray: () => rk, 30651 splitBezier: () => Vm, 30652 splitPairData: () => D2, 30653 staticFromToMotion: () => Mr, 30654 stopPageScrolling: () => RP, 30655 stringify: () => ep, 30656 sum: () => yY, 30657 sumValues: () => hy, 30658 swapAxisCondition: () => o2, 30659 throttle: () => aw, 30660 toArray: () => Ap, 30661 toDegrees: () => D7, 30662 toRadians: () => Es, 30663 tooltipContentAriaLabel: () => EF, 30664 trailingAccumulatedValue: () => NF, 30665 trailingAccumulatedValueProperty: () => wY, 30666 unique: () => _S, 30667 updateClipPath: () => Zm, 30668 updateLabelNode: () => L2, 30669 updateRect: () => I2, 30670 validateCrossLineValues: () => rP, 30671 valueProperty: () => pt, 30672 visibleRangeIndices: () => cy, 30673 without: () => iw 30674}); 30675function V1() { 30676 return (e, t) => { 30677 const i = [`Property [${e}] is deprecated.`, t].filter(Boolean).join(" "); 30678 Ee.warnOnce(i); 30679 }; 30680} 30681function KZ(e, t) { 30682 const i = V1(), s = t?.default; 30683 return ha((n, o, r) => (r !== s && i(o.toString(), e), r)); 30684} 30685function ZZ(e, t) { 30686 const i = V1(); 30687 return ha( 30688 (s, n, o) => (o !== s[e] && (i(n.toString(), `Use [${e}] instead.`), OS(s, e, t ? t(o) : o)), Rm), 30689 (s, n) => (i(n.toString(), `Use [${e}] instead.`), PS(s, e)) 30690 ); 30691} 30692var _u = { 30693 add: qZ, 30694 angle: iq, 30695 apply: dq, 30696 equal: cq, 30697 distance: JZ, 30698 distanceSquared: eq, 30699 from: uq, 30700 gradient: nq, 30701 intercept: oq, 30702 intersectAtX: aq, 30703 intersectAtY: rq, 30704 length: W1, 30705 lengthSquared: XZ, 30706 multiply: QZ, 30707 normalized: tq, 30708 origin: j1, 30709 required: hq, 30710 rotate: sq, 30711 round: lq, 30712 sub: U1 30713}; 30714function qZ(e, t) { 30715 return typeof t == "number" ? { x: e.x + t, y: e.y + t } : { x: e.x + t.x, y: e.y + t.y }; 30716} 30717function U1(e, t) { 30718 return typeof t == "number" ? { x: e.x - t, y: e.y - t } : { x: e.x - t.x, y: e.y - t.y }; 30719} 30720function QZ(e, t) { 30721 return typeof t == "number" ? { x: e.x * t, y: e.y * t } : { x: e.x * t.x, y: e.y * t.y }; 30722} 30723function W1(e) { 30724 return Math.sqrt(e.x * e.x + e.y * e.y); 30725} 30726function XZ(e) { 30727 return e.x * e.x + e.y * e.y; 30728} 30729function JZ(e, t) { 30730 const i = U1(e, t); 30731 return Math.sqrt(i.x * i.x + i.y * i.y); 30732} 30733function eq(e, t) { 30734 const i = U1(e, t); 30735 return i.x * i.x + i.y * i.y; 30736} 30737function tq(e) { 30738 const t = W1(e); 30739 return { x: e.x / t, y: e.y / t }; 30740} 30741function iq(e, t = j1()) { 30742 return Math.atan2(e.y, e.x) - Math.atan2(t.y, t.x); 30743} 30744function sq(e, t, i = j1()) { 30745 const s = W1(e); 30746 return { x: i.x + s * Math.cos(t), y: i.y + s * Math.sin(t) }; 30747} 30748function nq(e, t, i) { 30749 const s = t.x - e.x; 30750 return (i == null ? t.y - e.y : i - t.y - (i - e.y)) / s; 30751} 30752function oq(e, t, i) { 30753 return (i == null ? e.y : i - e.y) - t * e.x; 30754} 30755function rq(e, t, i = 0, s) { 30756 return { 30757 x: e === 1 / 0 ? 1 / 0 : (i - t) / e, 30758 y: s == null ? i : s - i 30759 }; 30760} 30761function aq(e, t, i = 0, s) { 30762 const n = e === 1 / 0 ? 1 / 0 : e * i + t; 30763 return { x: i, y: s == null ? n : s - n }; 30764} 30765function lq(e) { 30766 return { x: Math.round(e.x), y: Math.round(e.y) }; 30767} 30768function cq(e, t) { 30769 return e.x === t.x && e.y === t.y; 30770} 30771function uq(e, t) { 30772 if (typeof e == "number") 30773 return { x: e, y: t }; 30774 if ("regionX" in e) 30775 return { x: e.regionX, y: e.regionY }; 30776 if ("offsetWidth" in e) 30777 return { x: e.offsetWidth, y: e.offsetHeight }; 30778 if ("width" in e) 30779 return [ 30780 { x: e.x, y: e.y }, 30781 { x: e.x + e.width, y: e.y + e.height } 30782 ]; 30783 if ("x1" in e) 30784 return [ 30785 { x: e.x1, y: e.y1 }, 30786 { x: e.x2, y: e.y2 } 30787 ]; 30788 throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`); 30789} 30790function dq(e, t) { 30791 return e.x = t.x, e.y = t.y, e; 30792} 30793function hq(e) { 30794 return { x: e?.x ?? 0, y: e?.y ?? 0 }; 30795} 30796function j1() { 30797 return { x: 0, y: 0 }; 30798} 30799var q2 = class fm { 30800 constructor(t, i, s, n, o, r, a, l, c, u) { 30801 this.series = t, this.index = i, this.rootIndex = s, this.datum = n, this.sizeValue = o, this.colorValue = r, this.sumSize = a, this.depth = l, this.parent = c, this.children = u, this.midPoint = { x: 0, y: 0 }; 30802 } 30803 contains(t) { 30804 let i = t; 30805 for (; i != null && i.index >= this.index; ) { 30806 if (i === this) 30807 return !0; 30808 i = i.parent; 30809 } 30810 return !1; 30811 } 30812 walk(t, i = fm.Walk.PreOrder) {
30813 i === fm.Walk.PreOrder && t(this), this.children.forEach((s) => { 30814 s.walk(t, i); 30815 }), i === fm.Walk.PostOrder && t(this); 30816 } 30817 *[Symbol.iterator]() { 30818 yield this; 30819 for (const t of this.children) 30820 yield* t; 30821 } 30822}; 30823q2.Walk = { 30824 PreOrder: 0, 30825 PostOrder: 1 30826}; 30827var Vh = q2, pq = class extends Ud { 30828 constructor(e) { 30829 super({ 30830 moduleCtx: e, 30831 pickModes: [ 30832 1, 30833 0 30834 /* EXACT_SHAPE_MATCH */ 30835 ] 30836 }), this.rootNode = new Vh(this, 0, 0, void 0, 0, void 0, 0, void 0, void 0, []), this.colorDomain = [0, 0], this.maxDepth = 0, this.colorScale = new Wc(), this.focusPath = [], this.animationState = new gg( 30837 "empty", 30838 { 30839 empty: { 30840 update: { 30841 target: "ready", 30842 action: (t) => this.animateEmptyUpdateReady(t) 30843 }, 30844 reset: "empty", 30845 skip: "ready" 30846 }, 30847 ready: { 30848 updateData: "waiting", 30849 clear: "clearing", 30850 highlight: (t) => this.animateReadyHighlight(t), 30851 resize: (t) => this.animateReadyResize(t), 30852 reset: "empty", 30853 skip: "ready" 30854 }, 30855 waiting: { 30856 update: { 30857 target: "ready", 30858 action: (t) => this.animateWaitingUpdateReady(t) 30859 }, 30860 reset: "empty", 30861 skip: "ready" 30862 }, 30863 clearing: { 30864 update: { 30865 target: "empty", 30866 action: (t) => this.animateClearingUpdateEmpty(t) 30867 }, 30868 reset: "empty", 30869 skip: "ready" 30870 } 30871 }, 30872 () => this.checkProcessedDataAnimatable() 30873 ); 30874 } 30875 resetAnimation(e) { 30876 e === "initial" ? this.animationState.transition("reset") : e === "ready" && this.animationState.transition("skip"); 30877 } 30878 processData() { 30879 const { childrenKey: e, sizeKey: t, colorKey: i, colorRange: s } = this.properties; 30880 let n = 0; 30881 const o = () => (n += 1, n); 30882 let r = 0, a = 1 / 0, l = -1 / 0; 30883 const c = (f, m, y) => { 30884 const b = o(), C = y.depth != null ? y.depth + 1 : 0, w = e != null ? f[e] : void 0, M = w == null || w.length === 0; 30885 let A = t != null ? f[t] : void 0; 30886 Number.isFinite(A) ? A = Math.max(A, 0) : A = M ? 1 : 0; 30887 const I = A; 30888 r = Math.max(r, C); 30889 const L = i != null ? f[i] : void 0; 30890 return typeof L == "number" && (a = Math.min(a, L), l = Math.max(l, L)), u( 30891 new Vh( 30892 this, 30893 b, 30894 m ?? 0, 30895 f, 30896 A, 30897 L, 30898 I, 30899 C, 30900 y, 30901 [] 30902 ), 30903 m, 30904 w 30905 ); 30906 }, u = (f, m, y) => (y?.forEach((b, C) => { 30907 const w = c(b, m ?? C, f); 30908 f.children.push(w), f.sumSize += w.sumSize; 30909 }), f), d = u( 30910 new Vh(this, 0, 0, void 0, 0, void 0, 0, void 0, void 0, []), 30911 void 0, 30912 this.data 30913 ), p = [a, l]; 30914 this.colorScale.domain = a < l ? [a, l] : [0, 1], this.colorScale.range = s ?? ["black"], this.colorScale.update(), this.rootNode = d, this.maxDepth = r, this.colorDomain = p, this.focusPath = [{ nodeDatum: this.rootNode, childIndex: 0 }]; 30915 } 30916 update({ seriesRect: e }) { 30917 this.updateSelections(), this.updateNodes(); 30918 const t = this.getAnimationData(); 30919 this.checkResize(e) && this.animationState.transition("resize", t), this.animationState.transition("update", t); 30920 } 30921 resetAllAnimation(e) { 30922 const t = this.animationResetFns?.datum; 30923 this.ctx.animationManager.stopByAnimationGroupId(this.id), t != null && zi(e.datumSelections, t); 30924 } 30925 animateEmptyUpdateReady(e) { 30926 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(e); 30927 } 30928 animateWaitingUpdateReady(e) { 30929 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(e); 30930 } 30931 animateReadyHighlight(e) { 30932 const t = this.animationResetFns?.datum; 30933 t != null && zi([e], t); 30934 } 30935 animateReadyResize(e) { 30936 this.resetAllAnimation(e); 30937 } 30938 animateClearingUpdateEmpty(e) { 30939 this.ctx.animationManager.skipCurrentBatch(), this.resetAllAnimation(e); 30940 } 30941 isProcessedDataAnimatable() { 30942 return !0; 30943 } 30944 checkProcessedDataAnimatable() { 30945 this.isProcessedDataAnimatable() || this.ctx.animationManager.skipCurrentBatch(); 30946 } 30947 getSeriesDomain() { 30948 return [NaN, NaN]; 30949 } 30950 getSeriesRange(e, t) { 30951 return [NaN, NaN]; 30952 } 30953 getLegendData(e) { 30954 const { colorKey: t, colorName: i, colorRange: s } = this.properties, { 30955 id: n, 30956 ctx: { legendManager: o }, 30957 visible: r 30958 } = this; 30959 return e === "gradient" && t != null && s != null ? [ 30960 {
30961 legendType: "gradient", 30962 enabled: r && o.getItemEnabled({ seriesId: n }), 30963 seriesId: n, 30964 colorName: i, 30965 colorRange: s, 30966 colorDomain: this.colorDomain 30967 } 30968 ] : []; 30969 } 30970 getDatumIdFromData(e) { 30971 return `${e.index}`; 30972 } 30973 getDatumId(e) { 30974 return this.getDatumIdFromData(e); 30975 } 30976 pickFocus(e) { 30977 if (this.rootNode.children.length === 0) 30978 return; 30979 this.focusPath.length === 0 && Ee.error("this.focusPath should not be empty"); 30980 const { datumIndexDelta: t, otherIndexDelta: i } = e, { focusPath: s } = this, n = s.length - 2; 30981 if (i !== 0 || s.length === 1) { 30982 const o = Math.max(0, n + i); 30983 if (s[o + 1] == null) { 30984 let r = s[s.length - 1]; 30985 for (; r.nodeDatum.children.length > 0 && (r.nodeDatum.depth ?? -1) < o; ) { 30986 const a = { nodeDatum: r.nodeDatum.children[0], childIndex: 0 }; 30987 s.push(a), r = a; 30988 } 30989 return this.computeFocusOutputs(r); 30990 } else 30991 return s.length = o + 2, this.computeFocusOutputs(s[o + 1]); 30992 } else { 30993 if (t === 0) 30994 return this.computeFocusOutputs(s[s.length - 1]); 30995 { 30996 const o = s[n + 1].childIndex + t, r = s[n].nodeDatum, a = r?.children?.length; 30997 if (a != null) { 30998 const l = ot(0, o, a - 1), c = { nodeDatum: r.children[l], childIndex: l }; 30999 return s[n + 1] = c, s.length = n + 2, this.computeFocusOutputs(c); 31000 } 31001 } 31002 } 31003 } 31004 getDatumAriaText(e, t) { 31005 if (!(e instanceof Vh)) { 31006 Ee.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`); 31007 return; 31008 } 31009 return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum", { 31010 level: (e.depth ?? -1) + 1, 31011 count: e.children.length, 31012 description: t 31013 }); 31014 } 31015 computeFocusOutputs({ nodeDatum: e, childIndex: t }) { 31016 const i = this.computeFocusBounds(e); 31017 if (i) 31018 return { 31019 datum: e, 31020 datumIndex: t, 31021 otherIndex: e.depth, 31022 bounds: i, 31023 showFocusBox: !0, 31024 clipFocusBox: !0 31025 }; 31026 } 31027}, Gl = class extends Wn { 31028 constructor() { 31029 super(...arguments), this.childrenKey = "children", this.fills = Object.values(Ki), this.strokes = Object.values(cr); 31030 } 31031}; 31032S([ 31033 D(Me) 31034], Gl.prototype, "childrenKey", 2); 31035S([ 31036 D(Me, { optional: !0 }) 31037], Gl.prototype, "sizeKey", 2); 31038S([ 31039 D(Me, { optional: !0 }) 31040], Gl.prototype, "colorKey", 2); 31041S([ 31042 D(Me, { optional: !0 }) 31043], Gl.prototype, "colorName", 2); 31044S([ 31045 D(xo) 31046], Gl.prototype, "fills", 2); 31047S([ 31048 D(xo) 31049], Gl.prototype, "strokes", 2); 31050S([ 31051 D(xo, { optional: !0 }) 31052], Gl.prototype, "colorRange", 2); 31053var gq = class { 31054 constructor(e, t, i, s) { 31055 this.lon0 = e, this.lat0 = t, this.lon1 = i, this.lat1 = s; 31056 } 31057 merge(e) { 31058 this.lon0 = Math.min(this.lon0, e.lon0), this.lat0 = Math.min(this.lat0, e.lat0), this.lon1 = Math.max(this.lon1, e.lon1), this.lat1 = Math.max(this.lat1, e.lat1); 31059 } 31060}, $1 = class Ow { 31061 constructor() { 31062 this.id = So(this), this.axisGroup = new Ks({ 31063 name: `${this.id}-AxisTicks`, 31064 zIndex: 2 31065 /* AXIS */ 31066 }), this.labelSelection = _i.select(this.axisGroup, Qi), this.interval = new $c(), this.label = new is(), this.scale = new mo(), this.position = "bottom", this.translationX = 0, this.translationY = 0, this.padding = 0; 31067 } 31068 attachAxis(t) { 31069 t.appendChild(this.axisGroup); 31070 } 31071 calculateLayout() { 31072 this.scale.interval = this.interval.step; 31073 const t = [], i = this.generateTicks(), { translationX: s, translationY: n } = this; 31074 return this.labelSelection.update( 31075 i.ticks.map((o) => this.createLabelDatum(o)), 31076 void 0, 31077 (o) => o.tickId 31078 ), this.labelSelection.each((o, r) => { 31079 o.setProperties(r), r.visible && t.push(o.getBBox()); 31080 }), this.axisGroup.setProperties({ translationX: s, translationY: n }), _e.merge(t); 31081 } 31082 getLabelParams(t) { 31083 const { padding: i } = this, { translate: s } = t; 31084 switch (this.position) { 31085 case "top": 31086 case "bottom": 31087 return { 31088 x: s, 31089 y: i, 31090 textAlign: "center", 31091 textBaseline: "top" 31092 };
31093 case "left": 31094 case "right": 31095 return { 31096 x: i, 31097 y: s, 31098 textAlign: "start", 31099 textBaseline: "middle" 31100 }; 31101 } 31102 } 31103 inRange(t, i = 1e-3) { 31104 const [s, n] = Ds(this.scale.range); 31105 return t >= s - i && t <= n + i; 31106 } 31107 createLabelDatum(t) { 31108 const { x: i, y: s, textBaseline: n, textAlign: o } = this.getLabelParams(t); 31109 return { 31110 visible: !!t.tickLabel, 31111 tickId: t.tickId, 31112 fill: this.label.color, 31113 fontFamily: this.label.fontFamily, 31114 fontSize: this.label.fontSize, 31115 fontStyle: this.label.fontStyle, 31116 fontWeight: this.label.fontWeight, 31117 rotation: 0, 31118 rotationCenterX: 0, 31119 text: t.tickLabel, 31120 textAlign: o, 31121 textBaseline: n, 31122 x: i, 31123 y: s 31124 }; 31125 } 31126 generateTicks() { 31127 const { minSpacing: t, maxSpacing: i } = this.interval, s = RS(wp(this.scale.range), 2), { maxTickCount: n, minTickCount: o, tickCount: r } = kk( 31128 s, 31129 t, 31130 i, 31131 Ow.DefaultTickCount, 31132 Ow.DefaultMinSpacing 31133 ); 31134 r && (this.scale.tickCount = r, this.scale.minTickCount = o, this.scale.maxTickCount = n); 31135 const a = this.getTicksData(); 31136 if (this.position === "bottom" || this.position === "top") { 31137 const l = wa.getMeasurer({ font: this.label }), c = this.scale.getDomain(), d = c[0] > c[1] ? -1 : 1; 31138 let p = -1 / 0 * d; 31139 a.ticks = a.ticks.filter((f) => Math.sign(f.translate - p) !== d ? !1 : (p = f.translate + l.textWidth(f.tickLabel, !0) * d, !0)); 31140 } 31141 return a; 31142 } 31143 getTicksData() { 31144 const t = [], i = this.scale.ticks(), s = i.reduce((r, a) => Math.max(r, Fv(a)), 0), n = ox(), o = this.label.format ? this.scale.tickFormat({ ticks: i, specifier: this.label.format }) : (r) => Tp(r, s); 31145 for (let r = 0; r < i.length; r++) { 31146 const a = i[r], l = this.scale.convert(a); 31147 if (!this.inRange(l)) 31148 continue; 31149 const c = this.label.formatter?.({ value: a, index: r, fractionDigits: s }) ?? o(a), u = n(c); 31150 t.push({ tick: a, tickId: u, tickLabel: c, translate: l }); 31151 } 31152 return { rawTicks: i, fractionDigits: s, ticks: t }; 31153 } 31154}; 31155$1.DefaultTickCount = 5; 31156$1.DefaultMinSpacing = 50; 31157var fq = $1, mq = 0; 31158function vq(e, t) { 31159 const i = Gt("button", Wy("ag-charts-input ag-charts-button", t)); 31160 return e.label !== void 0 ? i.append(e.label) : (i.append(Q2(e.icon)), i.ariaLabel = e.altText), i.addEventListener("click", e.onPress), Fc(i, t), i; 31161} 31162function yq(e, t) { 31163 const i = Gt("input", Wy("ag-charts-input ag-charts-checkbox", t)); 31164 return i.type = "checkbox", i.checked = e.checked, i.addEventListener("change", (s) => e.onChange(i.checked, s)), i.addEventListener("keydown", (s) => { 31165 fx(s) && (s.preventDefault(), i.click()); 31166 }), Fc(i, t), i; 31167} 31168function Cq(e, t) { 31169 const i = Gt("select", Wy("ag-charts-input ag-charts-select", t)); 31170 return i.append( 31171 ...e.options.map((s) => { 31172 const n = Gt("option"); 31173 return n.value = s.value, n.textContent = s.label, n; 31174 }) 31175 ), Yt(i, "data-preventdefault", !1), i.value = e.value, i.addEventListener("change", (s) => e.onChange(i.value, s)), Fc(i, t), i; 31176} 31177function bq(e, t) { 31178 const i = Gt("textarea", Wy("ag-charts-input ag-charts-textarea", t)); 31179 return i.value = e.value, i.addEventListener("input", (s) => e.onChange(i.value, s)), Fc(i, t), Yt(i, "data-preventdefault", !1), i; 31180} 31181function Q2(e) { 31182 const t = Gt("span", `ag-charts-icon ag-charts-icon-${e}`); 31183 return Yt(t, "aria-hidden", !0), t; 31184} 31185function Wy(e, t) { 31186 return t == null ? e : `${e} ${t.class}`; 31187} 31188var wq = class extends Kv { 31189 constructor(e, t, i = 0, s) { 31190 super(e, t, s), this.angle = i; 31191 } 31192 createCanvasGradient(e, t) { 31193 const { angle: s } = this, n = zt(Es(s + 90)), o = t.x + t.width * 0.5, r = t.y + t.height * 0.5; 31194 return e.createConicGradient(n, o, r); 31195 } 31196}, Y1 = class extends sn { 31197 constructor(e = "") { 31198 super(), this.x = 0, this.y = 0, this.commands = [], this._d = "", this.d = e; 31199 } 31200 get d() { 31201 return this._d; 31202 } 31203 set d(e) { 31204 if (e !== this._d) { 31205 this._d = e, this.commands.length = 0; 31206 for (const [t, i, s] of e.matchAll(/([A-Z])([0-9. ]*)/g)) { 31207 const n = s.split(/\s+/g).map(Number); 31208 this.commands.push([i, n]); 31209 } 31210 this.checkPathDirty(); 31211 } 31212 } 31213 updatePath() { 31214 const { path: e, x: t, y: i } = this; 31215 e.clear(); 31216 let s = t, n = i; 31217 for (const [o, r] of this.commands) 31218 switch (o) { 31219 case "M": 31220 e.moveTo(t + r[0], i + r[1]), s = t + r[0]; 31221 break; 31222 case "C": 31223 e.cubicCurveTo( 31224 t + r[0], 31225 i + r[1], 31226 t + r[2], 31227 i + r[3], 31228 t + r[4], 31229 i + r[5] 31230 ), s = t + r[4], n = i + r[5]; 31231 break; 31232 case "H": 31233 e.lineTo(t + r[0], n), s = i + r[0]; 31234 break; 31235 case "L": 31236 e.lineTo(t + r[0], i + r[1]), s = t + r[0], n = i + r[1]; 31237 break; 31238 case "V": 31239 e.lineTo(s, i + r[0]), n = i + r[0]; 31240 break; 31241 case "Z": 31242 e.closePath(); 31243 break; 31244 default: 31245 throw new Error(`Could not translate command '${o}' with '${r.join(" ")}'`); 31246 } 31247 e.closePath(); 31248 } 31249}; 31250S([ 31251 Je() 31252], Y1.prototype, "x", 2); 31253S([ 31254 Je() 31255], Y1.prototype, "y", 2); 31256var K1 = class X2 extends Sn { 31257 updatePath() { 31258 const t = this.size / 2; 31259 super.applyPath(t, X2.moves); 31260 } 31261}; 31262K1.className = "ArrowUp"; 31263K1.moves = [ 31264 { x: 0, y: 0, t: "move" }, 31265 { x: 1, y: 1.2 }, 31266 { x: -0.5, y: 0 }, 31267 { x: 0, y: 0.8 }, 31268 { x: -1, y: 0 }, 31269 { x: 0, y: -0.8 }, 31270 { x: -0.5, y: 0 } 31271]; 31272var J2 = K1, eO = class extends Sn { 31273 updatePath() { 31274 const e = this.size / 2; 31275 super.applyPath( 31276 e, 31277 J2.moves.map((t) => ({ x: t.x * -1, y: t.y * -1 })) 31278 ); 31279 } 31280}; 31281eO.className = "ArrowDown"; 31282var Sq = {}; 31283Zo(Sq, { 31284 ButtonWidget: () => fg, 31285 NativeWidget: () => dl, 31286 SliderWidget: () => Cx, 31287 ToolbarWidget: () => iy,
31288 WIDGET_HTML_EVENTS: () => vx, 31289 Widget: () => xa, 31290 WidgetEventUtil: () => Lp 31291}); 31292var PR = "canvas-overlay", Z1 = class extends Xv { 31293 constructor(e, t, i) { 31294 super(), this.ctx = e, this.hideFns = [], this.moduleId = `popover-${t}`, i?.detached ? this.element = Gt("div") : this.element = e.domManager.addChild(PR, this.moduleId), this.element.setAttribute("role", "presentation"), this.destroyFns.push(() => e.domManager.removeChild(PR, this.moduleId)); 31295 } 31296 attachTo(e) { 31297 this.element.parentElement || e.element.append(this.element); 31298 } 31299 hide(e) { 31300 const { lastFocus: t = this.lastFocus } = e ?? {}; 31301 this.element.children.length !== 0 && (this.hideFns.forEach((i) => i()), t?.focus(), this.lastFocus = void 0); 31302 } 31303 removeChildren() { 31304 this.element.replaceChildren(); 31305 } 31306 showWithChildren(e, t) { 31307 if (!this.element.parentElement) 31308 throw new Error("Can not show popover that has not been attached to a parent."); 31309 const i = Gt("div", "ag-charts-popover"); 31310 if (t.ariaLabel != null && i.setAttribute("aria-label", t.ariaLabel), t.class != null && i.classList.add(t.class), i.replaceChildren(...e), this.element.replaceChildren(i), this.hideFns.push(() => this.removeChildren()), t.onHide && this.hideFns.push(t.onHide), t.initialFocus && t.sourceEvent) { 31311 const s = mx(t.sourceEvent); 31312 s !== void 0 && (this.lastFocus = s, this.initialFocus = t.initialFocus); 31313 } 31314 return i; 31315 } 31316 getPopoverElement() { 31317 return this.element.firstElementChild; 31318 } 31319 updatePosition(e) { 31320 const t = this.getPopoverElement(); 31321 t && (t.style.setProperty("right", "unset"), t.style.setProperty("bottom", "unset"), e.x != null && t.style.setProperty("left", `${Math.floor(e.x)}px`), e.y != null && t.style.setProperty("top", `${Math.floor(e.y)}px`), this.initialFocus?.focus(), this.initialFocus = void 0); 31322 } 31323}, tO = class extends Z1 { 31324 setAnchor(e, t) { 31325 this.anchor = e, this.fallbackAnchor = t, this.updatePosition(e), this.repositionWithinBounds(); 31326 } 31327 showWithChildren(e, t) { 31328 const i = t.anchor ?? this.anchor, s = t.fallbackAnchor ?? this.fallbackAnchor, n = super.showWithChildren(e, t); 31329 return i && this.setAnchor(i, s), pi().requestAnimationFrame(() => { 31330 this.repositionWithinBounds(); 31331 }), n; 31332 } 31333 repositionWithinBounds() { 31334 const { anchor: e, ctx: t, fallbackAnchor: i } = this, s = this.getPopoverElement(); 31335 if (!e || !s) 31336 return; 31337 const n = t.domManager.getBoundingClientRect(), { offsetWidth: o, offsetHeight: r } = s; 31338 let a = ot(0, e.x, n.width - o), l = ot(0, e.y, n.height - r); 31339 a !== e.x && i?.x != null && (a = ot(0, i.x - o, n.width - o)), l !== e.y && i?.y != null && (l = ot(0, i.y - r, n.height - r)), this.updatePosition({ x: a, y: l }); 31340 } 31341}, xq = class extends tO { 31342 show(e) { 31343 const t = e.items.map((s) => this.createRow(e, s)), i = this.showWithChildren(t, e); 31344 i.classList.add("ag-charts-menu"), i.setAttribute("role", "menu"), this.menuCloser = IP({ 31345 orientation: "vertical", 31346 menu: i, 31347 buttons: t, 31348 sourceEvent: e.sourceEvent, 31349 closeCallback: () => this.hide() 31350 }), this.hideFns.push(() => { 31351 this.menuCloser?.finishClosing(), this.menuCloser = void 0; 31352 }); 31353 } 31354 createRow(e, t) { 31355 const { menuItemRole: i = "menuitem" } = e, s = t.value === e.value, n = Gt("div", "ag-charts-menu__row"); 31356 if (n.setAttribute("role", i), i === "menuitemradio" && n.setAttribute("aria-checked", (e.value === t.value).toString()), typeof t.value == "string" && (n.dataset.popoverId = t.value), n.classList.toggle("ag-charts-menu__row--active", s), t.icon != null) { 31357 const l = Gt("span", `ag-charts-menu__icon ${Yv(t.icon)}`); 31358 n.appendChild(l); 31359 } 31360 const o = t.strokeWidth != null; 31361 if (o && (n.classList.toggle("ag-charts-menu__row--stroke-width-visible", o), n.style.setProperty("--strokeWidth", o ? `${t.strokeWidth}px` : null)), t.label != null) { 31362 const l = Gt("span", "ag-charts-menu__label"); 31363 l.textContent = this.ctx.localeManager.t(t.label), n.appendChild(l); 31364 } 31365 "altText" in t && (n.ariaLabel = this.ctx.localeManager.t(t.altText)); 31366 const r = () => { 31367 e.onPress?.(t); 31368 }, a = (l) => { 31369 fx(l) && (r(), l.preventDefault(), l.stopPropagation()); 31370 }; 31371 return n.addEventListener("keydown", a), n.addEventListener("click", a), n.addEventListener("mousemove", () => { 31372 n.focus({ preventScroll: !0 }); 31373 }), n; 31374 } 31375}, iO = class extends Z1 { 31376 constructor() { 31377 super(...arguments), this.dragged = !1; 31378 } 31379 setDragHandle(e) { 31380 e.addListener("drag-start", (t) => { 31381 e.addClass(this.dragHandleDraggingClass), this.onDragStart(t); 31382 }), e.addListener("drag-move", this.onDragMove.bind(this)), e.addListener("drag-end", () => { 31383 e.removeClass(this.dragHandleDraggingClass), this.onDragEnd.bind(this); 31384 }); 31385 } 31386 onDragStart(e) { 31387 const t = this.getPopoverElement(); 31388 t && (e.sourceEvent.preventDefault(), this.dragged = !0, this.dragStartState = { 31389 client: _u.from(e.clientX, e.clientY), 31390 position: _u.from( 31391 Number(t.style.getPropertyValue("left").replace("px", "")), 31392 Number(t.style.getPropertyValue("top").replace("px", "")) 31393 ) 31394 }); 31395 } 31396 onDragMove(e) { 31397 const { dragStartState: t } = this, i = this.getPopoverElement(); 31398 if (!t || !i) 31399 return; 31400 const s = _u.sub(_u.from(e.clientX, e.clientY), t.client), n = _u.add(t.position, s), o = this.ctx.domManager.getBoundingClientRect(), r = {}; 31401 n.x >= o.x && n.x + i.offsetWidth <= o.width && (r.x = n.x), n.y >= o.y && n.y + i.offsetHeight <= o.height && (r.y = n.y), this.updatePosition(r); 31402 } 31403 onDragEnd() { 31404 this.dragStartState = void 0; 31405 } 31406}, Mg = class extends it { 31407}; 31408S([ 31409 D(Me, { optional: !0 }) 31410], Mg.prototype, "icon", 2); 31411S([ 31412 D(Me, { optional: !0 }) 31413], Mg.prototype, "label", 2); 31414S([ 31415 D(Me, { optional: !0 }) 31416], Mg.prototype, "ariaLabel", 2); 31417S([ 31418 D(Me, { optional: !0 }) 31419], Mg.prototype, "tooltip", 2); 31420var sO = class extends fg { 31421 constructor(e) { 31422 super(), this.localeManager = e; 31423 } 31424 update(e) { 31425 const { localeManager: t } = this; 31426 e.tooltip && (this.elem.title = t.t(e.tooltip)); 31427 let i = ""; 31428 if (e.icon != null && (i = `<span class="${Yv(e.icon)} ag-charts-toolbar__icon"></span>`), e.label != null) { 31429 const s = t.t(e.label); 31430 i = `${i}<span class="ag-charts-toolbar__label">${s}</span>`;
31431 } 31432 this.elem.innerHTML = i; 31433 } 31434 setChecked(e) { 31435 Yt(this.elem, "aria-checked", e); 31436 } 31437}, FR = "ag-charts-toolbar__button--active", q1 = class extends iy { 31438 constructor(e, t = "horizontal") { 31439 super(t), this.localeManager = e, this.horizontalSpacing = 10, this.verticalSpacing = 10, this.events = new Er(), this.hasPrefix = !1, this.buttonWidgets = [], this.addClass("ag-charts-toolbar"), this.toggleClass("ag-charts-toolbar--horizontal", t === "horizontal"), this.toggleClass("ag-charts-toolbar--vertical", t === "vertical"); 31440 } 31441 addToolbarListener(e, t) { 31442 return this.events.addListener(e, t); 31443 } 31444 clearButtons() { 31445 for (const e of this.buttonWidgets) 31446 e.destroy(); 31447 this.buttonWidgets.splice(0); 31448 } 31449 updateButtons(e) { 31450 const { buttonWidgets: t } = this; 31451 for (const [i, s] of e.entries()) 31452 (this.buttonWidgets.at(i) ?? this.createButton(i, s)).update(s); 31453 for (let i = e.length; i < t.length; i++) 31454 this.buttonWidgets.at(i)?.destroy(); 31455 this.buttonWidgets.splice(e.length), this.refreshButtonClasses(); 31456 } 31457 updateButtonByIndex(e, t) { 31458 this.buttonWidgets.at(e)?.update(t); 31459 } 31460 clearActiveButton() { 31461 for (const e of this.buttonWidgets) 31462 e.toggleClass(FR, !1); 31463 } 31464 toggleActiveButtonByIndex(e) { 31465 if (e !== -1) 31466 for (const [t, i] of this.buttonWidgets.entries()) 31467 i.toggleClass(FR, e != null && e === t); 31468 } 31469 toggleButtonEnabledByIndex(e, t) { 31470 e !== -1 && this.buttonWidgets.at(e)?.setEnabled(t); 31471 } 31472 toggleSwitchCheckedByIndex(e, t) { 31473 e !== -1 && this.buttonWidgets.at(e)?.setChecked(t); 31474 } 31475 getButtonBounds() { 31476 return this.buttonWidgets.map((e) => this.getButtonWidgetBounds(e)); 31477 } 31478 setButtonHiddenByIndex(e, t) { 31479 this.buttonWidgets.at(e)?.setHidden(t); 31480 } 31481 getButtonWidgetBounds(e) { 31482 const t = this.getBounds(), i = e.getBounds(); 31483 return new _e(i.x + t.x, i.y + t.y, i.width, i.height); 31484 } 31485 refreshButtonClasses() { 31486 const { buttonWidgets: e, hasPrefix: t } = this; 31487 let i, s, n; 31488 for (const [o, r] of e.entries()) 31489 i = !t && o === 0 || n != r.section, s = o === e.length - 1 || r.section != e.at(o + 1)?.section, r.toggleClass("ag-charts-toolbar__button--first", i), r.toggleClass("ag-charts-toolbar__button--last", s), r.toggleClass("ag-charts-toolbar__button--gap", o > 0 && i), n = r.section; 31490 } 31491 createButton(e, t) { 31492 const i = this.createButtonWidget(); 31493 return i.addClass("ag-charts-toolbar__button"), i.addListener("click", (s) => { 31494 const n = { index: e, ...t instanceof it ? t.toJson() : t }, o = this.getButtonWidgetBounds(i); 31495 this.events.dispatch("button-pressed", { event: s, button: n, buttonBounds: o }); 31496 }), i.addListener("focus", () => { 31497 this.events.dispatch("button-focused", { button: { index: e } }); 31498 }), t.section && (i.section = t.section), this.buttonWidgets.push(i), this.addChild(i), i; 31499 } 31500}, Mq = class extends q1 { 31501 createButtonWidget() { 31502 return new sO(this.localeManager); 31503 } 31504}, Aq = class extends iO { 31505 constructor(e, t, i) { 31506 super(e, t), this.onPopoverMoved = i, this.dragHandleDraggingClass = "ag-charts-floating-toolbar__drag-handle--dragging"; 31507 } 31508 show(e, t) { 31509 this.showWithChildren(e, { 31510 ...t, 31511 class: "ag-charts-floating-toolbar" 31512 }); 31513 } 31514 hide() { 31515 this.dragged = !1, super.hide(); 31516 } 31517 getBounds() { 31518 const e = this.getPopoverElement(); 31519 return new _e( 31520 e?.offsetLeft ?? 0, 31521 e?.offsetTop ?? 0, 31522 e?.offsetWidth ?? 0, 31523 e?.offsetHeight ?? 0 31524 ); 31525 } 31526 hasBeenDragged() { 31527 return this.dragged; 31528 } 31529 setAnchor(e, t, i) { 31530 const s = this.getPopoverElement(); 31531 if (!s) 31532 return; 31533 const n = e.position ?? "above", { offsetWidth: o, offsetHeight: r } = s; 31534 let a = e.y - r - i, l = e.x - o / 2; 31535 n === "below" ? a = e.y + i : n === "right" ? (a = e.y - r / 2, l = e.x + t) : n === "above-left" && (l = e.x), this.updatePosition({ x: l, y: a }); 31536 } 31537 ignorePointerEvents() { 31538 const e = this.getPopoverElement(); 31539 e && (e.style.pointerEvents = "none"); 31540 } 31541 capturePointerEvents() { 31542 const e = this.getPopoverElement(); 31543 e && (e.style.pointerEvents = "unset"); 31544 } 31545 updatePosition(e) { 31546 const t = this.getBounds(), i = this.ctx.domManager.getBoundingClientRect(); 31547 e.x = Math.floor(ot(0, e.x, i.width - t.width)), e.y = Math.floor(ot(0, e.y, i.height - t.height)), super.updatePosition(e), this.onPopoverMoved(); 31548 } 31549}, Dq = class extends q1 { 31550 constructor(e, t) { 31551 super(e.localeManager), this.hasPrefix = !0, this.popover = new Aq(e, t, this.onPopoverMoved.bind(this)), this.dragHandle = new Eq(e.localeManager.t("toolbarAnnotationsDragHandle")), this.popover.setDragHandle(this.dragHandle); 31552 } 31553 show(e) { 31554 this.popover.show([this.dragHandle.getElement(), this.getElement()], e); 31555 } 31556 hide() { 31557 this.popover.hide(); 31558 } 31559 setAnchor(e) { 31560 this.popover.setAnchor(e, this.horizontalSpacing, this.verticalSpacing); 31561 } 31562 hasBeenDragged() { 31563 return this.popover.hasBeenDragged(); 31564 } 31565 ignorePointerEvents() { 31566 this.popover.ignorePointerEvents(); 31567 } 31568 capturePointerEvents() { 31569 this.popover.capturePointerEvents(); 31570 }
31571 onPopoverMoved() { 31572 const e = this.popover.getBounds(); 31573 if (this.popoverBounds?.equals(e)) 31574 return; 31575 this.popoverBounds = e.clone(); 31576 const t = this.getButtonBounds(); 31577 this.events.dispatch("toolbar-moved", { popoverBounds: e, buttonBounds: t }); 31578 } 31579 getButtonWidgetBounds(e) { 31580 const t = this.popover.getBounds(), i = super.getButtonWidgetBounds(e), s = this.dragHandle.getBounds(); 31581 return new _e( 31582 i.x + t.x - s.width, 31583 i.y + t.y, 31584 i.width, 31585 i.height 31586 ); 31587 } 31588}, Eq = class extends dl { 31589 constructor(e) { 31590 super(Gt("div", "ag-charts-floating-toolbar__drag-handle")); 31591 const t = new dl( 31592 Gt("span", `${Yv("drag-handle")} ag-charts-toolbar__icon`) 31593 ); 31594 t.setAriaHidden(!0), this.addChild(t), this.elem.title = e; 31595 } 31596}, Iq = { ...zL, ...Mk }, Rq = /* @__PURE__ */ Mt({ 31597 props: { 31598 options: { 31599 type: Object, 31600 default: () => ({}) 31601 } 31602 }, 31603 setup() { 31604 return { 31605 chart: void 0 31606 }; 31607 }, 31608 render() { 31609 return AS("div"); 31610 }, 31611 watch: { 31612 options(e) { 31613 this.chart?.update({ ...e, container: this.$el }); 31614 } 31615 }, 31616 mounted() { 31617 const { options: e } = this; 31618 this.chart = rl.create({ ...e, container: this.$el }); 31619 }, 31620 unmounted() { 31621 this.chart?.destroy(), this.chart = void 0; 31622 } 31623}); 31624const jy = [ 31625 "Jan", 31626 "Feb", 31627 "Mar", 31628 "Apr", 31629 "May", 31630 "Jun", 31631 "Jul", 31632 "Aug", 31633 "Sep", 31634 "Oct", 31635 "Nov", 31636 "Dec" 31637], Tq = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Ih = { 31638 OVERVIEW: "overview", 31639 ENGAGEMENT: "engagement" 31640}, Mu = { 31641 PRESETS: "Presets", 31642 CUSTOM: "Custom" 31643}, Lq = 33, kq = { 31644 palette: { 31645 fills: ["#B2CDFE", "#1E90FA", "#28BE99", "#FFB066", "#FF0097", "#9426C2"] 31646 } 31647}, Pq = /* @__PURE__ */ Mt({ 31648 __name: "chart-view", 31649 props: { 31650 data: {}, 31651 timeFrame: { default: Ws.TWO_WEEKS }, 31652 viewBy: { default: qr.Days }, 31653 tooltipLabel: { default: ge.clicks }, 31654 type: { default: _o.AREA }, 31655 metricValue: {}, 31656 showLegendCount: { type: Boolean, default: !1 } 31657 }, 31658 setup(e) { 31659 const t = e, i = De(null), s = (a) => { 31660 const l = () => { 31661 switch (t.viewBy) { 31662 case qr.Days: 31663 return ge.daily; 31664 case qr.Weeks: 31665 return ge.weekly; 31666 case qr.Months: 31667 return ge.monthly; 31668 default: 31669 return ge.daily; 31670 } 31671 }; 31672 return `<div style="display: flex;flex-direction: column; justify-content: center;font-size: 10px; font-family: Mulish"><div style="background-color:#E0E0E0; padding: .5rem ">${a.datum.xAxis}</div><div style=" padding: .5rem">${l()} ${t.tooltipLabel}:<b> ${a.datum.yAxis}</b></div></div>`; 31673 }, n = { 31674 area: { 31675 type: "area", 31676 xKey: "xAxis", 31677 yKey: "yAxis", 31678 stroke: "#1E90FA", 31679 strokeWidth: 3, 31680 fillOpacity: 0.15, 31681 interpolation: { 31682 type: "smooth", 31683 tension: 1 31684 }, 31685 label: { 31686 enabled: !0, 31687 fontFamily: "Mulish", 31688 fontSize: 10 31689 }, 31690 marker: { enabled: !0 }, 31691 tooltip: { showArrow: !0, renderer: s } 31692 }, 31693 bar: { 31694 type: "bar", 31695 xKey: "xAxis", 31696 yKey: "yAxis", 31697 stroke: "#1E90FA", 31698 strokeWidth: 3, 31699 fill: "#1E90FA", 31700 fillOpacity: 1, 31701 cornerRadius: 10, 31702 tooltip: { showArrow: !0, renderer: s } 31703 }, 31704 donut: { 31705 type: "donut", 31706 angleKey: "yAxis", 31707 sectorLabelKey: "xAxis", 31708 sectorLabel: { 31709 enabled: !1 31710 }, 31711 innerRadiusRatio: 0.6, 31712 highlightStyle: { 31713 item: { 31714 fill: "black", 31715 fillOpacity: 0.1, 31716 // Makes the color darker (reduces opacity) 31717 strokeWidth: 0 31718 // Removes the stroke on hover 31719 } 31720 }, 31721 tooltip: { 31722 enabled: !0, 31723 // eslint-disable-next-line @typescript-eslint/no-explicit-any 31724 renderer: (a) => `<div style="display: flex;flex-direction: column; justify-content: center;font-size: 10px; font-family: Mulish; padding: .5rem"> 31725 <div style="font-weight: bold; margin-bottom: 4px;">${a.datum.xAxis}</div> 31726 <div>Count: <b>${a.datum.yAxis}</b></div> 31727 <div>Percentage: <b>${a.datum.percentage}%</b></div> 31728 </div>` 31729 } 31730 } 31731 }, o = Qe(() => t.type === _o.DONUT ? [n.donut] : t.type === _o.BAR || t.viewBy === "months" ? [n.bar] : [{ 31732 ...n.area,
31733 label: { 31734 ...n.area.label, 31735 enabled: t.data.length <= Lq 31736 } 31737 }]), r = Qe(() => { 31738 const a = { 31739 container: i.value, 31740 data: t.data, 31741 series: o.value, 31742 height: 380, 31743 padding: { top: 50, bottom: 0, left: 10, right: 20 } 31744 }; 31745 return t.type === _o.DONUT ? { 31746 ...a, 31747 theme: kq, 31748 legend: { 31749 toggleSeries: !1, 31750 position: "right", 31751 spacing: 30, 31752 maxWidth: 400, 31753 item: { 31754 paddingY: 20, 31755 marker: { 31756 shape: "circle", 31757 size: 12 31758 }, 31759 label: { 31760 fontFamily: "Mulish", 31761 fontSize: 14, 31762 fontWeight: 600, 31763 formatter: (l) => { 31764 if (t.showLegendCount) 31765 return `${l.datum.yAxis} ${l.value}`; 31766 const c = t.data.reduce( 31767 (d, p) => d + p.yAxis, 31768 0 31769 ); 31770 return `${c > 0 ? Math.round(l.datum.yAxis * 100 / c) : 0}% ${l.value}`; 31771 } 31772 } 31773 } 31774 } 31775 } : { 31776 ...a, 31777 axes: [ 31778 { 31779 type: "category", 31780 position: "bottom", 31781 label: { 31782 fontSize: 10, 31783 fontFamily: "Mulish" 31784 }, 31785 ...t.type !== _o.BAR && { interval: { minSpacing: 70 } } 31786 }, 31787 { 31788 type: "number", 31789 position: "left", 31790 label: { 31791 fontSize: 10, 31792 fontFamily: "Mulish" 31793 } 31794 } 31795 ] 31796 }; 31797 }); 31798 return (a, l) => (we(), Ne("div", { 31799 id: "chartView", 31800 ref_key: "chartView", 31801 ref: i 31802 }, [ 31803 Re(Z(Rq), { options: r.value }, null, 8, ["options"]) 31804 ], 512)); 31805 } 31806}), Fq = /* @__PURE__ */ ii(Pq, [["__scopeId", "data-v-db45e76b"]]), Oq = { class: "chart-container" }, Nq = { 31807 key: 0, 31808 class: "view-by-select" 31809}, _q = { class: "label" }, Bq = { 31810 key: 1, 31811 class: "loader" 31812}, Gq = { 31813 key: 2, 31814 class: "empty-state" 31815}, zq = ["alt"], Hq = { class: "text-xl font-bold" }, Vq = /* @__PURE__ */ Mt({ 31816 __name: "chart-container", 31817 props: { 31818 hasData: { type: Boolean }, 31819 chartData: {}, 31820 selectedTimeFrame: {}, 31821 selectedViewBy: {}, 31822 getViewByLabel: {}, 31823 handleViewByChange: {}, 31824 viewBySelectOptions: {}, 31825 tooltipLabel: {}, 31826 type: { default: _o.AREA }, 31827 isLoading: { type: Boolean }, 31828 metricValue: {}, 31829 showLegendCount: { type: Boolean } 31830 }, 31831 setup(e) { 31832 const t = e; 31833 return (i, s) => (we(), Ne("div", Oq, [ 31834 e.selectedViewBy ? (we(), Ne("div", Nq, [ 31835 fe("div", null, [ 31836 fe("span", _q, ke(Z(Dt).viewBySelectLabel), 1) 31837 ]), 31838 Re(Z(fd), { 31839 "model-value": e.selectedViewBy, 31840 class: "time-frame-select", 31841 "label-position": "outside", 31842 aid: "LINKS_ANALYTICS_SELECT_VIEW_BY", 31843 variant: "text", 31844 underline: "", 31845 size: "lg", 31846 "option-key": (n) => n, 31847 "option-label": (n) => e.getViewByLabel ? e.getViewByLabel(n) ?? "" : "", 31848 "onUpdate:modelValue": s[0] || (s[0] = (n) => { 31849 t.handleViewByChange?.(n); 31850 }) 31851 }, { 31852 default: Ve(() => [ 31853 (we(!0), Ne(yi, null, hs(e.viewBySelectOptions, (n) => (we(), Wt(Z(ll), { 31854 key: n.value, 31855 aid: n.aid, 31856 value: n.value, 31857 label: n.label 31858 }, { 31859 default: Ve(() => [ 31860 ut(ke(n.label), 1) 31861 ]), 31862 _: 2 31863 }, 1032, ["aid", "value", "label"]))), 128)) 31864 ]), 31865 _: 1 31866 }, 8, ["model-value", "option-key", "option-label"]) 31867 ])) : di("", !0), 31868 e.isLoading ? (we(), Ne("div", Bq, [...s[1] || (s[1] = [ 31869 fe("div", null, [ 31870 fe("span", { 31871 id: "frame-loader", 31872 "aria-hidden": "true" 31873 }) 31874 ], -1) 31875 ])])) : !e.hasData && !e.isLoading ? (we(), Ne("div", Gq, [ 31876 fe("img", { 31877 src: VW, 31878 style: { width: "280px" }, 31879 alt: Z(Dt).emptyStateImage 31880 }, null, 8, zq), 31881 fe("span", Hq, ke(Z(Dt).emptyStateMessage), 1) 31882 ])) : (we(), Wt(Fq, { 31883 key: 3, 31884 data: e.chartData, 31885 "time-frame": e.selectedTimeFrame, 31886 "view-by": e.selectedViewBy ?? Z(qr).Days, 31887 type: e.type, 31888 "metric-value": e.metricValue, 31889 "tooltip-label": e.tooltipLabel ?? Z(Dt).clicks, 31890 "show-legend-count": e.showLegendCount 31891 }, null, 8, ["data", "time-frame", "view-by", "type", "metric-value", "tooltip-label", "show-legend-count"])) 31892 ])); 31893 } 31894}), Uq = /* @__PURE__ */ ii(Vq, [["__scopeId", "data-v-3c7c4486"]]), Wq = { class: "base-chart-container" }, jq = { class: "chart-header" }, $q = { class: "chart-label" }, Yq = { class: "text-lg font-bold" }, Kq = { 31895 key: 0, 31896 class: "metric-display" 31897}, Zq = { class: "text-2xl font-bold" }, qq = /* @__PURE__ */ Mt({ 31898 __name: "base-chart", 31899 props: { 31900 config: {}, 31901 isLoading: { type: Boolean } 31902 }, 31903 setup(e) {
31904 const t = e, i = ua("requestParams"), s = ua("selectedTimeFrame"), n = De(qr.Days), o = De([]), r = De([]), a = [ 31905 { 31906 label: Dt.viewBySelectLabelDays, 31907 value: "days", 31908 aid: "VIEW_BY_SELECT_DAYS" 31909 }, 31910 { 31911 label: Dt.viewBySelectLabelWeeks, 31912 value: "weeks", 31913 aid: "VIEW_BY_SELECT_WEEKS" 31914 }, 31915 { 31916 label: Dt.viewBySelectLabelMonths, 31917 value: "months", 31918 aid: "VIEW_BY_SELECT_MONTHS" 31919 } 31920 ], l = { 31921 days: Dt.viewBySelectLabelDays, 31922 weeks: Dt.viewBySelectLabelWeeks, 31923 months: Dt.viewBySelectLabelMonths 31924 }, c = (y) => l[y] || l.days, u = (y) => { 31925 t.config.dataAggregator && r.value.length > 0 && (o.value = t.config.dataAggregator( 31926 r.value, 31927 y 31928 )); 31929 }, d = (y) => { 31930 n.value = y, u(y); 31931 }, p = async (y) => { 31932 if (!(!t.config.rawDataFetcher && !t.config.dataAggregator)) 31933 try { 31934 if (t.config.rawDataFetcher && t.config.dataAggregator) { 31935 const b = await t.config.rawDataFetcher(y); 31936 r.value = b, o.value = t.config.dataAggregator( 31937 b, 31938 n.value 31939 ); 31940 } 31941 } catch (b) { 31942 console.error("Error fetching chart data:", b); 31943 } 31944 }, f = Qe(() => o.value.length > 0), m = Qe(() => t.config.metricCalculator && o.value.length > 0 ? t.config.metricCalculator(o.value) : ""); 31945 return Gn( 31946 () => i.value, 31947 (y) => { 31948 y && (t.config.rawDataFetcher || t.config.dataAggregator) && p(y); 31949 }, 31950 { immediate: !0 } 31951 ), (y, b) => (we(), Ne("div", Wq, [ 31952 fe("div", jq, [ 31953 fe("div", $q, [ 31954 fe("span", Yq, ke(e.config.title), 1) 31955 ]), 31956 t.config.showMetricDisplay ? (we(), Ne("div", Kq, [ 31957 fe("span", Zq, ke(m.value || "0"), 1) 31958 ])) : di("", !0) 31959 ]), 31960 Re(Uq, { 31961 class: "chart-content", 31962 "is-loading": e.isLoading, 31963 "has-data": f.value, 31964 "chart-data": o.value, 31965 "selected-time-frame": Z(s), 31966 "selected-view-by": e.config.showViewBySelector ? n.value : void 0, 31967 "get-view-by-label": e.config.showViewBySelector ? c : void 0, 31968 "handle-view-by-change": e.config.showViewBySelector ? d : void 0, 31969 "view-by-select-options": e.config.showViewBySelector ? a : void 0, 31970 "tooltip-label": e.config.tooltipLabel, 31971 type: e.config.type, 31972 "max-y-value": e.config.maxYValue, 31973 "show-legend-count": e.config.showLegendCount 31974 }, null, 8, ["is-loading", "has-data", "chart-data", "selected-time-frame", "selected-view-by", "get-view-by-label", "handle-view-by-change", "view-by-select-options", "tooltip-label", "type", "max-y-value", "show-legend-count"]) 31975 ])); 31976 } 31977}), Gf = /* @__PURE__ */ ii(qq, [["__scopeId", "data-v-3c63be25"]]); 31978function Qq(e) { 31979 return e >= 1e6 ? (e / 1e6).toFixed(1) + "M" : e >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toString(); 31980} 31981const Xq = (e) => [...e].sort((t, i) => t.year !== i.year ? Number(t.year) - Number(i.year) : t.month !== i.month ? Number(t.month) - Number(i.month) : Number(t.day) - Number(i.day)), nO = (e, t, i, s) => { 31982 const n = jy[e.getMonth()], o = Tq[e.getDay()]; 31983 return `${s === "days" ? o + ", " : ""}${n} ${t}, ${i}`; 31984}, Jq = (e, t) => e.map((i) => { 31985 const s = new Date( 31986 Number(i.year), 31987 Number(i.month) - 1, 31988 Number(i.day) 31989 ), n = ("0" + i.day).slice(-2), o = jy[s.getMonth()], r = `${n}-${o}`, a = nO( 31990 s, 31991 n, 31992 String(i.year), 31993 t 31994 ); 31995 return { 31996 xAxis: r, 31997 yAxis: i.count ? i.count : 0, 31998 fullDate: a 31999 }; 32000}), eQ = (e, t) => { 32001 const i = [], s = [...e].reverse(); 32002 for (let n = 0; n < s.length; n += 7) { 32003 const o = s.slice(n, n + 7); 32004 if (o.length === 0) continue; 32005 const r = o[0], a = new Date( 32006 Number(r.year), 32007 Number(r.month) - 1, 32008 r.day 32009 ), l = ("0" + r.day).slice(-2), c = jy[a.getMonth()], u = `${l}-${c}`, d = nO( 32010 a, 32011 l, 32012 String(r.year), 32013 t 32014 ), p = o.reduce( 32015 (f, m) => f + Number(m.count), 32016 0 32017 ); 32018 i.push({ 32019 xAxis: u, 32020 yAxis: p, 32021 fullDate: d 32022 }); 32023 } 32024 return i.reverse(); 32025}, tQ = (e) => { 32026 const t = {}; 32027 return e.forEach((i) => { 32028 const s = `${i.year}-${i.month}`;
32029 t[s] || (t[s] = { 32030 month: Number(i.month), 32031 year: Number(i.year), 32032 count: 0 32033 }), t[s].count += Number(i.count); 32034 }), Object.values(t).map((i) => { 32035 const n = `${jy[i.month - 1]} ${i.year}`; 32036 return { 32037 xAxis: n, 32038 yAxis: i.count, 32039 fullDate: n 32040 }; 32041 }); 32042}, iQ = (e, t) => { 32043 if (!e || !Array.isArray(e)) 32044 return console.warn( 32045 "aggregateData: Invalid data parameter - expected array of ChartPoint objects" 32046 ), []; 32047 if (!t || !["days", "weeks", "months"].includes(t)) 32048 return console.warn( 32049 'aggregateData: Invalid viewBy parameter - expected "days", "weeks", or "months"' 32050 ), []; 32051 if (e.length === 0) 32052 return []; 32053 const i = Xq(e); 32054 switch (t) { 32055 case qr.Days: 32056 return Jq(i, t); 32057 case qr.Weeks: 32058 return eQ(i, t); 32059 default: 32060 return tQ(i); 32061 } 32062}, h0 = (e) => !e || !Array.isArray(e) ? (console.warn("aggregateDistributionData: Invalid data parameter"), []) : e.length === 0 ? [] : e.map((t) => ({ 32063 xAxis: t.distributionValue || "Other", 32064 yAxis: t.count || 0, 32065 percentage: t.percentage || 0 32066})); 32067function OR(e) { 32068 const i = e.getFullYear().toString().slice(-2), s = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0"); 32069 return `${s}/${n}/${i}`; 32070} 32071function Xm(e) { 32072 const t = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date(); 32073 switch (e) { 32074 case Ws.TWO_WEEKS: 32075 i.setDate(t.getDate() - 14); 32076 break; 32077 case Ws.MONTH: 32078 i.setMonth(t.getMonth() - 1); 32079 break; 32080 case Ws.HALF_YEAR: 32081 i.setMonth(t.getMonth() - 6); 32082 break; 32083 case Ws.YEAR: 32084 i.setFullYear(t.getFullYear() - 1); 32085 break; 32086 case Ws.TWO_YEARS: 32087 i.setFullYear(t.getFullYear() - 2); 32088 break; 32089 default: 32090 i.setDate(t.getDate() - 14); 32091 } 32092 return { 32093 startDate: OR(i), 32094 endDate: OR(t) 32095 }; 32096} 32097function oO(e, t) { 32098 if (!e || !t || e.trim() === "" || t.trim() === "") return !1; 32099 const i = new Date(e), s = new Date(t); 32100 return !(isNaN(i.getTime()) || isNaN(s.getTime())); 32101} 32102function $a(e) { 32103 const [t, i, s] = e.split("/").map(Number), n = s < 100 ? 2e3 + s : s, o = new Date(n, t - 1, i), r = new Date( 32104 Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()) 32105 ); 32106 return Math.floor(r.getTime()); 32107} 32108const sQ = { 32109 ref: "containerRef", 32110 class: "date-range-container" 32111}, nQ = { class: "time-frame-label" }, oQ = { class: "date-range-wrapper" }, rQ = { class: "time-frame-type-select-wrapper" }, aQ = { 32112 key: 0, 32113 class: "presets-content" 32114}, lQ = { 32115 key: 1, 32116 class: "custom-date-pickers" 32117}, cQ = /* @__PURE__ */ Mt({ 32118 __name: "time-frame-container", 32119 props: { 32120 selectedTimeFrame: {}, 32121 startDate: {}, 32122 endDate: {} 32123 }, 32124 emits: ["update:timeFrame", "update:customDateRange"], 32125 setup(e, { emit: t }) { 32126 const i = { 32127 [Ws.TWO_WEEKS]: Dt.timeFrameSelectLabelTwoWeeks, 32128 [Ws.MONTH]: Dt.timeFrameSelectLabelMonth, 32129 [Ws.HALF_YEAR]: Dt.timeFrameSelectLabelHalfYear, 32130 [Ws.YEAR]: Dt.timeFrameSelectLabelYear, 32131 [Ws.TWO_YEARS]: Dt.timeFrameSelectLabelTwoYears 32132 }, s = t, n = e, o = [ 32133 Mu.PRESETS, 32134 Mu.CUSTOM 32135 ], r = De(Mu.PRESETS), a = De(n.startDate), l = De(n.endDate); 32136 Cn(() => { 32137 const m = Xm(Ws.MONTH); 32138 a.value = m.startDate, l.value = m.endDate; 32139 }), Nd(() => { 32140 }); 32141 const c = (m) => { 32142 const y = m.getFullYear(), b = String(m.getMonth() + 1).padStart(2, "0"); 32143 return `${y}/${b}`; 32144 }, u = Qe(() => { 32145 const m = /* @__PURE__ */ new Date(); 32146 return m.setFullYear(m.getFullYear() - 2), c(m); 32147 }), d = Qe(() => { 32148 if (!a.value) return c(/* @__PURE__ */ new Date()); 32149 const m = new Date(a.value); 32150 return isNaN(m.getTime()) ? c(/* @__PURE__ */ new Date()) : c(m); 32151 }), p = (m) => { 32152 if (Array.isArray(m)) { 32153 m.length > 0 && (r.value = m[0]); 32154 return; 32155 } 32156 m !== null && o.includes(m) && (r.value = m); 32157 }, f = (m) => { 32158 if (Array.isArray(m)) { 32159 m.length > 0 && f(m[0]); 32160 return; 32161 } 32162 if (m === null || !Object.values(Ws).includes(m)) 32163 return; 32164 const y = Xm(m); 32165 a.value = y.startDate, l.value = y.endDate, s("update:timeFrame", { 32166 timeFrame: m, 32167 startDate: a.value, 32168 endDate: l.value 32169 }); 32170 }; 32171 return Gn([a, l], () => { 32172 r.value === Mu.CUSTOM && oO(a.value, l.value) && s("update:customDateRange", { 32173 startDate: a.value, 32174 endDate: l.value 32175 }); 32176 }), (m, y) => (we(), Ne("div", sQ, [ 32177 fe("div", nQ, ke(Z(Dt).timeFrameLabel), 1), 32178 fe("div", oQ, [ 32179 fe("div", rQ, [ 32180 Re(Z(fd), { 32181 size: "md", 32182 "model-value": r.value, 32183 "option-key": (b) => b, 32184 "option-label": (b) => b, 32185 "onUpdate:modelValue": p, 32186 aid: "LINKS_ANALYTICS_TIME_FRAME_TYPE_SELECT" 32187 }, { 32188 default: Ve(() => [ 32189 (we(), Ne(yi, null, hs(o, (b) => Re(Z(ll), { 32190 key: b.toLowerCase(), 32191 value: b 32192 }, { 32193 default: Ve(() => [ 32194 ut(ke(b), 1) 32195 ]), 32196 _: 2 32197 }, 1032, ["value"])), 64)) 32198 ]), 32199 _: 1 32200 }, 8, ["model-value", "option-key", "option-label"]) 32201 ]), 32202 r.value === Z(Mu).PRESETS ? (we(), Ne("div", aQ, [ 32203 Re(Z(fd), { 32204 size: "md", 32205 "model-value": e.selectedTimeFrame, 32206 "option-key": (b) => b, 32207 "option-label": (b) => i[b], 32208 "onUpdate:modelValue": f, 32209 aid: "LINKS_ANALYTICS_PRESET_TIME_FRAME_SELECT" 32210 }, { 32211 default: Ve(() => [ 32212 (we(!0), Ne(yi, null, hs(Object.values(Z(Ws)).filter( 32213 (b) => typeof b == "number" 32214 ), (b) => (we(), Wt(Z(ll), { 32215 key: b, 32216 value: b 32217 }, { 32218 default: Ve(() => [ 32219 ut(ke(i[b]), 1) 32220 ]), 32221 _: 2 32222 }, 1032, ["value"]))), 128)) 32223 ]), 32224 _: 1 32225 }, 8, ["model-value", "option-key", "option-label"]) 32226 ])) : di("", !0), 32227 r.value === Z(Mu).CUSTOM ? (we(), Ne("div", lQ, [ 32228 Re(Z(NE), { 32229 modelValue: a.value, 32230 "onUpdate:modelValue": y[0] || (y[0] = (b) => a.value = b), 32231 placeholder: Z(Dt).from, 32232 "min-year-month": u.value, 32233 aid: "LINKS_ANALYTICS_START_DATE", 32234 size: "md", 32235 type: "date" 32236 }, null, 8, ["modelValue", "placeholder", "min-year-month"]), 32237 Re(Z(NE), { 32238 modelValue: l.value, 32239 "onUpdate:modelValue": y[1] || (y[1] = (b) => l.value = b), 32240 placeholder: Z(Dt).to, 32241 "min-year-month": d.value, 32242 aid: "LINKS_ANALYTICS_END_DATE", 32243 size: "md", 32244 type: "date" 32245 }, null, 8, ["modelValue", "placeholder", "min-year-month"]) 32246 ])) : di("", !0) 32247 ]) 32248 ], 512)); 32249 } 32250}), uQ = /* @__PURE__ */ ii(cQ, [["__scopeId", "data-v-28f98dad"]]), dQ = async (e) => { 32251 const { chart: t } = await wt.getTotalEngagementChartData(e); 32252 return t?.points || []; 32253}, hQ = async (e) => { 32254 const { chart: t } = await wt.getLinkLocationDistribution(e); 32255 return t?.points || []; 32256}, pQ = async (e) => { 32257 const { chart: t } = await wt.getLinkReferrerDistribution(e); 32258 return t?.points || []; 32259}, gQ = async (e) => { 32260 const { chart: t } = await wt.getLinkDeviceDistribution(e); 32261 return t?.points || []; 32262}, fQ = (e) => e.reduce((t, i) => t + (i.yAxis || 0), 0), zf = { 32263 totalEngagement: { 32264 type: _o.AREA, 32265 title: Dt.totalEngagementTitle, 32266 tooltipLabel: "clicks", 32267 showViewBySelector: !0, 32268 showMetricDisplay: !0, 32269 metricFormatter: Qq, 32270 metricCalculator: (e) => fQ(e), 32271 rawDataFetcher: dQ, 32272 dataAggregator: (e, t) => iQ(e, t) 32273 }, 32274 locationDistribution: { 32275 type: _o.DONUT, 32276 title: Dt.locationDistributionTitle, 32277 tooltipLabel: "clicks", 32278 showViewBySelector: !1, 32279 showMetricDisplay: !1, 32280 showLegendCount: !0, 32281 rawDataFetcher: hQ, 32282 dataAggregator: (e) => h0(e) 32283 }, 32284 referrerDistribution: { 32285 type: _o.DONUT, 32286 title: Dt.referrerDistributionTitle, 32287 tooltipLabel: "clicks", 32288 showViewBySelector: !1, 32289 showMetricDisplay: !1, 32290 rawDataFetcher: pQ, 32291 dataAggregator: (e) => h0(e) 32292 }, 32293 deviceDistribution: { 32294 type: _o.DONUT, 32295 title: Dt.deviceDistributionTitle, 32296 tooltipLabel: "clicks", 32297 showViewBySelector: !1, 32298 showMetricDisplay: !1, 32299 rawDataFetcher: gQ, 32300 dataAggregator: (e) => h0(e) 32301 } 32302}, mQ = { class: "distribution-charts-container" }, vQ = /* @__PURE__ */ Mt({ 32303 __name: "overview-container", 32304 props: { 32305 linkId: {} 32306 }, 32307 emits: ["clicks-update"], 32308 setup(e, { emit: t }) { 32309 const i = e, s = t, n = Ws.MONTH, o = De({ 32310 clicks: 0, 32311 scans: 0, 32312 topCountry: "N/A", 32313 topReferrer: "N/A" 32314 }), r = De(0), a = De(!1), l = De(n), c = De(""), u = De(""), d = De(null);
32315 Xu("requestParams", d), Xu("selectedTimeFrame", l), Xu("isLoading", a); 32316 const p = { 32317 clicks: Dt.totalClicks, 32318 scans: Dt.totalScans, 32319 topCountry: Dt.topCountry, 32320 topReferrer: Dt.topReferrer 32321 }, f = Qe(() => { 32322 const C = []; 32323 for (const [w, M] of Object.entries(o.value)) 32324 M != null && p[w] && C.push({ 32325 metric: typeof M == "number" ? M.toString() : M, 32326 description: p[w] 32327 }); 32328 return C; 32329 }), m = async (C) => { 32330 try { 32331 if (a.value = !0, !C.startDate || !C.endDate) { 32332 const L = Xm(n); 32333 c.value = L.startDate, u.value = L.endDate, l.value = n; 32334 const k = { 32335 linkId: i.linkId, 32336 dateFrom: $a(c.value), 32337 dateTo: $a(u.value) 32338 }; 32339 d.value = k, await b(d.value); 32340 return; 32341 } 32342 if (!oO(C.startDate, C.endDate)) { 32343 qt({ 32344 status: ri.Error, 32345 aid: "LINKS_ANALYTICS_INVALID_DATE_FORMAT", 32346 message: Dt.invalidDateFormatMessage || "Please select valid dates" 32347 }); 32348 return; 32349 } 32350 const w = new Date(C.startDate), M = /* @__PURE__ */ new Date(); 32351 if (M.setHours(23, 59, 59, 999), w > M) { 32352 qt({ 32353 status: ri.Error, 32354 aid: "LINKS_ANALYTICS_FUTURE_DATE", 32355 message: Dt.futureDateMessage || "Start date cannot be in the future" 32356 }); 32357 return; 32358 } 32359 const A = new Date(C.endDate); 32360 if (A > M) { 32361 qt({ 32362 status: ri.Error, 32363 aid: "LINKS_ANALYTICS_FUTURE_END_DATE", 32364 message: Dt.futureEndDateMessage || "End date cannot be in the future" 32365 }); 32366 return; 32367 } 32368 if (w > A) { 32369 qt({ 32370 status: ri.Error, 32371 aid: "LINKS_ANALYTICS_INVALID_DATE_RANGE", 32372 message: "Start date cannot be after end date" 32373 }); 32374 return; 32375 } 32376 c.value = C.startDate, u.value = C.endDate; 32377 const I = { 32378 linkId: i.linkId, 32379 dateFrom: $a(c.value), 32380 dateTo: $a(u.value) 32381 }; 32382 d.value = I, await b(d.value); 32383 } catch (w) { 32384 console.error("Error handling custom date range change:", w), qt({ 32385 status: ri.Error, 32386 aid: "LINKS_ANALYTICS_DATE_RANGE_ERROR", 32387 message: Dt.dateRangeErrorMessage || "Failed to process date range selection" 32388 }); 32389 } finally { 32390 a.value = !1; 32391 } 32392 }, y = async (C) => { 32393 try { 32394 a.value = !0, c.value = C.startDate, u.value = C.endDate, l.value = C.timeFrame; 32395 const w = { 32396 linkId: i.linkId, 32397 dateFrom: $a(c.value), 32398 dateTo: $a(u.value) 32399 }; 32400 d.value = w, await b(w); 32401 } catch (w) { 32402 console.error("Error handling time frame change:", w), qt({ 32403 status: ri.Error, 32404 aid: "LINKS_ANALYTICS_TIME_FRAME_ERROR", 32405 message: Dt.fetchErrorMessage 32406 }); 32407 } finally { 32408 a.value = !1; 32409 } 32410 }; 32411 async function b(C) { 32412 try { 32413 if (!C) 32414 throw new Error("Missing request parameters for engagement metrics"); 32415 o.value = await wt.getLinkEngagementMetrics(C); 32416 } catch (w) { 32417 qt({ 32418 status: ri.Error, 32419 aid: "LINKS_ANALYTICS_FETCH_ENGAGEMENT_METRICS_ERROR", 32420 message: Dt.fetchErrorMessage 32421 }), console.error(w, { message: "Failed to fetch engagement metrics" }); 32422 } 32423 } 32424 return Gn( 32425 () => o.value.clicks, 32426 (C) => { 32427 r.value = C || 0; 32428 }, 32429 { immediate: !0 } 32430 ), Gn( 32431 r, 32432 (C) => { 32433 s("clicks-update", C); 32434 }, 32435 { immediate: !0 } 32436 ), Cn(async () => { 32437 try { 32438 a.value = !0, await wt.init(bc()); 32439 const { startDate: C, endDate: w } = Xm(l.value); 32440 c.value = C, u.value = w; 32441 const M = { 32442 linkId: i.linkId, 32443 dateFrom: $a(c.value), 32444 dateTo: $a(u.value) 32445 }; 32446 d.value = M, await b(d.value); 32447 } catch (C) { 32448 console.error(C, {
32449 message: "Failed to fetch engagement metrics and chart data" 32450 }), qt({ 32451 status: ri.Error, 32452 aid: "LINKS_ANALYTICS_FETCH_ENGAGEMENT_METRICS_ERROR", 32453 message: Dt.fetchErrorMessage 32454 }); 32455 } finally { 32456 a.value = !1; 32457 } 32458 }), (C, w) => (we(), Ne(yi, null, [ 32459 Re(uQ, { 32460 "selected-time-frame": l.value, 32461 "start-date": c.value, 32462 "end-date": u.value, 32463 "onUpdate:timeFrame": y, 32464 "onUpdate:customDateRange": m 32465 }, null, 8, ["selected-time-frame", "start-date", "end-date"]), 32466 Re(HW, { 32467 "is-loading": a.value, 32468 "metrics-cards": f.value 32469 }, null, 8, ["is-loading", "metrics-cards"]), 32470 Re(Gf, { 32471 "is-loading": a.value, 32472 config: Z(zf).totalEngagement 32473 }, null, 8, ["is-loading", "config"]), 32474 fe("div", mQ, [ 32475 Re(Gf, { 32476 "is-loading": a.value, 32477 config: Z(zf).locationDistribution 32478 }, null, 8, ["is-loading", "config"]), 32479 Re(Gf, { 32480 "is-loading": a.value, 32481 config: Z(zf).deviceDistribution 32482 }, null, 8, ["is-loading", "config"]), 32483 Re(Gf, { 32484 "is-loading": a.value, 32485 config: Z(zf).referrerDistribution 32486 }, null, 8, ["is-loading", "config"]) 32487 ]) 32488 ], 64)); 32489 } 32490}), yQ = /* @__PURE__ */ ii(vQ, [["__scopeId", "data-v-e356ffdb"]]); 32491var ih = class { 32492 constructor() { 32493 this.allSyncListeners = /* @__PURE__ */ new Map(), this.allAsyncListeners = /* @__PURE__ */ new Map(), this.globalSyncListeners = /* @__PURE__ */ new Set(), this.globalAsyncListeners = /* @__PURE__ */ new Set(), this.asyncFunctionsQueue = [], this.scheduled = !1, this.firedEvents = {}; 32494 } 32495 setFrameworkOverrides(e) { 32496 this.frameworkOverrides = e; 32497 } 32498 getListeners(e, t, i) { 32499 const s = t ? this.allAsyncListeners : this.allSyncListeners; 32500 let n = s.get(e); 32501 return !n && i && (n = /* @__PURE__ */ new Set(), s.set(e, n)), n; 32502 } 32503 noRegisteredListenersExist() { 32504 return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0; 32505 } 32506 addEventListener(e, t, i = !1) { 32507 this.getListeners(e, i, !0).add(t); 32508 } 32509 removeEventListener(e, t, i = !1) { 32510 const s = this.getListeners(e, i, !1); 32511 s && (s.delete(t), s.size === 0 && (i ? this.allAsyncListeners : this.allSyncListeners).delete(e)); 32512 } 32513 addGlobalListener(e, t = !1) { 32514 (t ? this.globalAsyncListeners : this.globalSyncListeners).add(e); 32515 } 32516 removeGlobalListener(e, t = !1) { 32517 (t ? this.globalAsyncListeners : this.globalSyncListeners).delete(e); 32518 } 32519 dispatchEvent(e) { 32520 const t = e; 32521 this.dispatchToListeners(t, !0), this.dispatchToListeners(t, !1), this.firedEvents[t.type] = !0; 32522 } 32523 dispatchEventOnce(e) { 32524 this.firedEvents[e.type] || this.dispatchEvent(e); 32525 } 32526 dispatchToListeners(e, t) { 32527 const i = e.type; 32528 if (t && "event" in e) { 32529 const a = e.event; 32530 a instanceof Event && (e.eventPath = a.composedPath()); 32531 } 32532 const s = (a, l) => a.forEach((c) => { 32533 if (!l.has(c)) 32534 return; 32535 const u = this.frameworkOverrides ? () => this.frameworkOverrides.wrapIncoming(() => c(e)) : () => c(e); 32536 t ? this.dispatchAsync(u) : u(); 32537 }), n = this.getListeners(i, t, !1) ?? /* @__PURE__ */ new Set(), o = new Set(n); 32538 o.size > 0 && s(o, n), new Set( 32539 t ? this.globalAsyncListeners : this.globalSyncListeners 32540 ).forEach((a) => { 32541 const l = this.frameworkOverrides ? () => this.frameworkOverrides.wrapIncoming(() => a(i, e)) : () => a(i, e); 32542 t ? this.dispatchAsync(l) : l(); 32543 }); 32544 } 32545 // this gets called inside the grid's thread, for each event that it 32546 // wants to set async. the grid then batches the events into one setTimeout() 32547 // because setTimeout() is an expensive operation. ideally we would have 32548 // each event in it's own setTimeout(), but we batch for performance. 32549 dispatchAsync(e) { 32550 if (this.asyncFunctionsQueue.push(e), !this.scheduled) { 32551 const t = () => { 32552 window.setTimeout(this.flushAsyncQueue.bind(this), 0); 32553 }; 32554 this.frameworkOverrides ? this.frameworkOverrides.wrapIncoming(t) : t(), this.scheduled = !0; 32555 } 32556 } 32557 // this happens in the next VM turn only, and empties the queue of events 32558 flushAsyncQueue() { 32559 this.scheduled = !1; 32560 const e = this.asyncFunctionsQueue.slice(); 32561 this.asyncFunctionsQueue = [], e.forEach((t) => t()); 32562 } 32563}; 32564function CQ(e, t) { 32565 return t; 32566} 32567function rO(e) { 32568 return e?.getLocaleTextFunc() ?? CQ; 32569} 32570function La(e, t, i) { 32571 i == null || typeof i == "string" && i == "" ? aO(e, t) : er(e, t, i); 32572} 32573function er(e, t, i) { 32574 e.setAttribute(lO(t), i.toString()); 32575} 32576function aO(e, t) { 32577 e.removeAttribute(lO(t)); 32578} 32579function lO(e) { 32580 return `aria-${e}`; 32581} 32582function en(e, t) { 32583 t ? e.setAttribute("role", t) : e.removeAttribute("role"); 32584} 32585function bQ(e) { 32586 let t; 32587 return e === "asc" ? t = "ascending" : e === "desc" ? t = "descending" : e === "mixed" ? t = "other" : t = "none", t; 32588} 32589function wQ(e) { 32590 return e.getAttribute("aria-label"); 32591} 32592function $y(e, t) { 32593 La(e, "label", t); 32594} 32595function Nw(e, t) { 32596 La(e, "labelledby", t); 32597} 32598function cO(e, t) { 32599 La(e, "live", t); 32600} 32601function SQ(e, t) { 32602 La(e, "atomic", t); 32603} 32604function xQ(e, t) { 32605 La(e, "relevant", t); 32606} 32607function MQ(e, t) { 32608 La(e, "disabled", t); 32609} 32610function uO(e, t) { 32611 La(e, "hidden", t); 32612} 32613function _w(e, t) { 32614 er(e, "expanded", t); 32615} 32616function AQ(e, t) { 32617 er(e, "setsize", t); 32618} 32619function DQ(e, t) { 32620 er(e, "posinset", t); 32621} 32622function EQ(e, t) { 32623 er(e, "multiselectable", t); 32624} 32625function IQ(e, t) { 32626 er(e, "rowcount", t); 32627} 32628function dO(e, t) { 32629 er(e, "rowindex", t); 32630} 32631function RQ(e, t) { 32632 er(e, "colcount", t); 32633} 32634function hO(e, t) { 32635 er(e, "colindex", t); 32636} 32637function TQ(e, t) { 32638 er(e, "colspan", t); 32639} 32640function LQ(e, t) { 32641 er(e, "sort", t); 32642} 32643function kQ(e) { 32644 aO(e, "sort"); 32645} 32646function Bw(e, t) { 32647 La(e, "selected", t); 32648} 32649function PQ(e, t) { 32650 La(e, "controls", t.id), Nw(t, e.id); 32651} 32652function Q1(e, t) { 32653 return t === void 0 ? e("ariaIndeterminate", "indeterminate") : t === !0 ? e("ariaChecked", "checked") : e("ariaUnchecked", "unchecked"); 32654} 32655var p0, g0, f0, m0, v0, Gw, zw, y0;
32656function Jc() { 32657 return p0 === void 0 && (p0 = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), p0; 32658} 32659function pO() { 32660 if (g0 === void 0) { 32661 const e = window; 32662 g0 = !!e.chrome && (!!e.chrome.webstore || !!e.chrome.runtime) || /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); 32663 } 32664 return g0; 32665} 32666function gO() { 32667 return f0 === void 0 && (f0 = /(firefox)/i.test(navigator.userAgent)), f0; 32668} 32669function fO() { 32670 return m0 === void 0 && (m0 = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)), m0; 32671} 32672function Mc() { 32673 return v0 === void 0 && (v0 = /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1), v0; 32674} 32675function Hw(e) { 32676 if (!e) 32677 return null; 32678 const t = e.tabIndex, i = e.getAttribute("tabIndex"); 32679 return t === -1 && (i === null || i === "" && !gO()) ? null : t.toString(); 32680} 32681function FQ() { 32682 if (y0 !== void 0) 32683 return y0; 32684 if (!document.body) 32685 return -1; 32686 let e = 1e6; 32687 const t = gO() ? 6e6 : 1e9, i = document.createElement("div"); 32688 for (document.body.appendChild(i); ; ) { 32689 const s = e * 2; 32690 if (i.style.height = s + "px", s > t || i.clientHeight !== s) 32691 break; 32692 e = s; 32693 } 32694 return document.body.removeChild(i), y0 = e, e; 32695} 32696function OQ() { 32697 return zw == null && mO(), zw; 32698} 32699function mO() { 32700 const e = document.body, t = document.createElement("div"); 32701 t.style.width = t.style.height = "100px", t.style.opacity = "0", t.style.overflow = "scroll", t.style.msOverflowStyle = "scrollbar", t.style.position = "absolute", e.appendChild(t); 32702 let i = t.offsetWidth - t.clientWidth; 32703 i === 0 && t.clientWidth === 0 && (i = null), t.parentNode && t.parentNode.removeChild(t), i != null && (zw = i, Gw = i === 0); 32704} 32705function vO() { 32706 return Gw == null && mO(), Gw; 32707} 32708var Hf, NQ = "[tabindex], input, select, button, textarea, [href]", yO = "[disabled], .ag-disabled:not(.ag-button), .ag-disabled *"; 32709function X1(e) { 32710 const t = Element.prototype.matches || Element.prototype.msMatchesSelector, s = t.call(e, "input, select, button, textarea"), n = t.call(e, yO), o = Yo(e); 32711 return s && !n && o; 32712} 32713function ui(e, t, i = {}) { 32714 const { skipAriaHidden: s } = i; 32715 e.classList.toggle("ag-hidden", !t), s || uO(e, !t); 32716} 32717function _Q(e, t, i = {}) { 32718 const { skipAriaHidden: s } = i; 32719 e.classList.toggle("ag-invisible", !t), s || uO(e, !t); 32720} 32721function Wp(e, t) { 32722 const i = "disabled", s = t ? (n) => n.setAttribute(i, "") : (n) => n.removeAttribute(i); 32723 s(e), AO(e.querySelectorAll("input"), (n) => s(n)); 32724} 32725function Ac(e, t, i) { 32726 let s = 0; 32727 for (; e; ) { 32728 if (e.classList.contains(t)) 32729 return !0; 32730 if (e = e.parentElement, typeof i == "number") { 32731 if (++s > i) 32732 break; 32733 } else if (e === i) 32734 break; 32735 } 32736 return !1; 32737} 32738function eu(e) { 32739 const { 32740 height: t, 32741 width: i, 32742 borderTopWidth: s, 32743 borderRightWidth: n, 32744 borderBottomWidth: o, 32745 borderLeftWidth: r, 32746 paddingTop: a, 32747 paddingRight: l, 32748 paddingBottom: c, 32749 paddingLeft: u, 32750 marginTop: d, 32751 marginRight: p, 32752 marginBottom: f, 32753 marginLeft: m, 32754 boxSizing: y 32755 } = window.getComputedStyle(e); 32756 return { 32757 height: parseFloat(t || "0"), 32758 width: parseFloat(i || "0"), 32759 borderTopWidth: parseFloat(s || "0"), 32760 borderRightWidth: parseFloat(n || "0"), 32761 borderBottomWidth: parseFloat(o || "0"), 32762 borderLeftWidth: parseFloat(r || "0"), 32763 paddingTop: parseFloat(a || "0"), 32764 paddingRight: parseFloat(l || "0"), 32765 paddingBottom: parseFloat(c || "0"), 32766 paddingLeft: parseFloat(u || "0"), 32767 marginTop: parseFloat(d || "0"), 32768 marginRight: parseFloat(p || "0"), 32769 marginBottom: parseFloat(f || "0"), 32770 marginLeft: parseFloat(m || "0"), 32771 boxSizing: y 32772 }; 32773} 32774function J1(e) { 32775 const t = eu(e); 32776 return t.boxSizing === "border-box" ? t.height - t.paddingTop - t.paddingBottom : t.height; 32777} 32778function jp(e) { 32779 const t = eu(e); 32780 return t.boxSizing === "border-box" ? t.width - t.paddingLeft - t.paddingRight : t.width; 32781} 32782function CO(e) { 32783 const { height: t, marginBottom: i, marginTop: s } = eu(e); 32784 return Math.floor(t + i + s); 32785} 32786function Jm(e) { 32787 const { width: t, marginLeft: i, marginRight: s } = eu(e); 32788 return Math.floor(t + i + s); 32789} 32790function bO(e) { 32791 const t = e.getBoundingClientRect(), { borderTopWidth: i, borderLeftWidth: s, borderRightWidth: n, borderBottomWidth: o } = eu(e); 32792 return { 32793 top: t.top + (i || 0), 32794 left: t.left + (s || 0), 32795 right: t.right + (n || 0), 32796 bottom: t.bottom + (o || 0) 32797 }; 32798} 32799function ev() { 32800 if (typeof Hf == "boolean") 32801 return Hf; 32802 const e = document.createElement("div"); 32803 return e.style.direction = "rtl", e.style.width = "1px", e.style.height = "1px", e.style.position = "fixed", e.style.top = "0px", e.style.overflow = "hidden", e.dir = "rtl", e.innerHTML = /* html */ 32804 `<div style="width: 2px">
32805 <span style="display: inline-block; width: 1px"></span> 32806 <span style="display: inline-block; width: 1px"></span> 32807 </div>`, document.body.appendChild(e), e.scrollLeft = 1, Hf = Math.floor(e.scrollLeft) === 0, document.body.removeChild(e), Hf; 32808} 32809function tv(e, t) { 32810 let i = e.scrollLeft; 32811 return t && (i = Math.abs(i), pO() && !ev() && (i = e.scrollWidth - e.getBoundingClientRect().width - i)), i; 32812} 32813function iv(e, t, i) { 32814 i && (ev() ? t *= -1 : (Jc() || pO()) && (t = e.scrollWidth - e.getBoundingClientRect().width - t)), e.scrollLeft = t; 32815} 32816function Is(e) { 32817 for (; e && e.firstChild; ) 32818 e.removeChild(e.firstChild); 32819} 32820function pr(e) { 32821 e && e.parentNode && e.parentNode.removeChild(e); 32822} 32823function wO(e) { 32824 return !!e.offsetParent; 32825} 32826function Yo(e) { 32827 const t = e; 32828 return t.checkVisibility ? t.checkVisibility({ checkVisibilityCSS: !0 }) : !(!wO(e) || window.getComputedStyle(e).visibility !== "visible"); 32829} 32830function $p(e) { 32831 const t = document.createElement("div"); 32832 return t.innerHTML = (e || "").trim(), t.firstChild; 32833} 32834function SO(e, t, i) { 32835 i && i.nextSibling === t || (i ? i.nextSibling ? e.insertBefore(t, i.nextSibling) : e.appendChild(t) : e.firstChild && e.firstChild !== t && e.insertAdjacentElement("afterbegin", t)); 32836} 32837function xO(e, t) { 32838 for (let i = 0; i < t.length; i++) { 32839 const s = t[i], n = e.children[i]; 32840 n !== s && e.insertBefore(s, n); 32841 } 32842} 32843function BQ(e, t, i) { 32844 i ? i.insertAdjacentElement("afterend", t) : e.firstChild ? e.insertAdjacentElement("afterbegin", t) : e.appendChild(t); 32845} 32846function GQ(e) { 32847 return e.replace(/[A-Z]/g, (t) => `-${t.toLocaleLowerCase()}`); 32848} 32849function MO(e, t) { 32850 if (t) 32851 for (const [i, s] of Object.entries(t)) { 32852 if (!i || !i.length || s == null) 32853 continue; 32854 const n = GQ(i), o = s.toString(), r = o.replace(/\s*!important/g, ""), a = r.length != o.length ? "important" : void 0; 32855 e.style.setProperty(n, r, a); 32856 } 32857} 32858function zQ(e) { 32859 return e.clientWidth < e.scrollWidth; 32860} 32861function HQ(e) { 32862 return e.clientHeight < e.scrollHeight; 32863} 32864function sv(e, t) { 32865 t === "flex" ? (e.style.removeProperty("width"), e.style.removeProperty("minWidth"), e.style.removeProperty("maxWidth"), e.style.flex = "1 1 auto") : mr(e, t); 32866} 32867function mr(e, t) { 32868 t = eM(t), e.style.width = t.toString(), e.style.maxWidth = t.toString(), e.style.minWidth = t.toString(); 32869} 32870function up(e, t) { 32871 t = eM(t), e.style.height = t.toString(), e.style.maxHeight = t.toString(), e.style.minHeight = t.toString(); 32872} 32873function eM(e) { 32874 return typeof e == "number" ? `${e}px` : e; 32875} 32876function tM(e) { 32877 return e instanceof Node || e instanceof HTMLElement; 32878} 32879function VQ(e) { 32880 if (e == null) 32881 return []; 32882 const t = []; 32883 return AO(e, (i) => t.push(i)), t; 32884} 32885function UQ(e, t) { 32886 if (e) 32887 for (let i = 0; i < e.length; i++) { 32888 const s = e[i]; 32889 t(s.name, s.value); 32890 } 32891} 32892function vo(e, t, i) { 32893 i == null || i === "" ? e.removeAttribute(t) : e.setAttribute(t, i.toString()); 32894} 32895function AO(e, t) { 32896 if (e != null) 32897 for (let i = 0; i < e.length; i++) 32898 t(e[i]); 32899} 32900function zl(e, t, i) { 32901 const n = FO(e).ResizeObserver, o = n ? new n(i) : null; 32902 return o?.observe(t), () => o?.disconnect(); 32903} 32904function oa(e) { 32905 return e == null || e === "" ? null : e; 32906} 32907function Ie(e) { 32908 return e != null && e !== ""; 32909} 32910function ai(e) { 32911 return !Ie(e); 32912} 32913function Vw(e) { 32914 return e != null && typeof e.toString == "function" ? e.toString() : null; 32915} 32916function Yp(e, t) { 32917 const i = e ? JSON.stringify(e) : null, s = t ? JSON.stringify(t) : null; 32918 return i === s; 32919} 32920function WQ(e, t, i = !1) { 32921 const s = e == null, n = t == null; 32922 if (e && e.toNumber && (e = e.toNumber()), t && t.toNumber && (t = t.toNumber()), s && n) 32923 return 0; 32924 if (s) 32925 return -1; 32926 if (n) 32927 return 1; 32928 function o(r, a) { 32929 return r > a ? 1 : r < a ? -1 : 0; 32930 } 32931 if (typeof e != "string" || !i) 32932 return o(e, t); 32933 try { 32934 return e.localeCompare(t); 32935 } catch { 32936 return o(e, t); 32937 } 32938} 32939var DO = "https://www.ag-grid.com", NR = {}; 32940function EO(e, t) { 32941 NR[t] || (e(), NR[t] = !0); 32942} 32943function Ml(e, t, ...i) { 32944 e.get("debug") && console.log("AG Grid: " + t, ...i); 32945} 32946function dp(e, ...t) { 32947 EO(() => console.warn("AG Grid: " + e, ...t), e + t?.join("")); 32948} 32949function rd(e, ...t) { 32950 EO(() => console.error("AG Grid: " + e, ...t), e + t?.join("")); 32951} 32952var C0 = [], b0 = !1; 32953function _R(e) { 32954 C0.push(e), !b0 && (b0 = !0, window.setTimeout(() => { 32955 const t = C0.slice(); 32956 C0.length = 0, b0 = !1, t.forEach((i) => i()); 32957 }, 0)); 32958} 32959function qs(e, t, i) { 32960 let s; 32961 return function(...n) { 32962 const o = this; 32963 window.clearTimeout(s), s = window.setTimeout(function() { 32964 e.isAlive() && t.apply(o, n); 32965 }, i); 32966 }; 32967} 32968function BR(e, t) { 32969 let i = 0; 32970 return function(...s) { 32971 const n = this, o = (/* @__PURE__ */ new Date()).getTime(); 32972 o - i < t || (i = o, e.apply(n, s)); 32973 }; 32974} 32975function jQ(e, t, i = 100, s) { 32976 const n = (/* @__PURE__ */ new Date()).getTime(); 32977 let o = null, r = !1; 32978 const a = () => { 32979 const l = (/* @__PURE__ */ new Date()).getTime() - n > i; 32980 (e() || l) && (t(), r = !0, o != null && (window.clearInterval(o), o = null)); 32981 }; 32982 a(), r || (o = window.setInterval(a, 10)); 32983} 32984var Fe = "33.0.4", GR = 2e3, zR = 100, IO = "_version_", RO = null, Md = `${DO}/javascript-data-grid`; 32985function $Q(e) { 32986 RO = e; 32987} 32988function YQ(e) { 32989 Md = e; 32990} 32991function TO(e, t, i) { 32992 return RO?.getConsoleMessage(e, t) ?? [QQ(e, t, i)]; 32993} 32994function iM(e, t, i, s) { 32995 e(`error #${t}`, ...TO(t, i, s)); 32996} 32997function KQ(e) { 32998 if (!e) 32999 return String(e); 33000 const t = {}; 33001 for (const i of Object.keys(e)) 33002 typeof e[i] != "object" && typeof e[i] != "function" && (t[i] = e[i]); 33003 return JSON.stringify(t); 33004} 33005function ZQ(e) { 33006 let t = e; 33007 return e instanceof Error ? t = e.toString() : typeof e == "object" && (t = KQ(e)), t;
33008} 33009function nv(e) { 33010 return e === void 0 ? "undefined" : e === null ? "null" : e; 33011} 33012function Uw(e, t) { 33013 return `${e}?${t.toString()}`; 33014} 33015function qQ(e, t, i) { 33016 const s = Array.from(t.entries()).sort((o, r) => r[1].length - o[1].length); 33017 let n = Uw(e, t); 33018 for (const [o, r] of s) { 33019 if (o === IO) 33020 continue; 33021 const a = n.length - i; 33022 if (a <= 0) 33023 break; 33024 const l = "...", c = a + l.length, u = r.length - c > zR ? r.slice(0, r.length - c) + l : r.slice(0, zR) + l; 33025 t.set(o, u), n = Uw(e, t); 33026 } 33027 return n; 33028} 33029function LO(e, t) { 33030 const i = new URLSearchParams(); 33031 i.append(IO, Fe), t && Object.entries(t).forEach(([o, r]) => { 33032 i.append(o, ZQ(r)); 33033 }); 33034 const s = `${Md}/errors/${e}`, n = Uw(s, i); 33035 return n.length <= GR ? n : qQ(s, i, GR); 33036} 33037var QQ = (e, t, i) => { 33038 const s = LO(e, t); 33039 return `${i ? i + ` 33040` : ""}Visit ${s}${i ? "" : ` 33041 Alternatively register the ValidationModule to see the full message in the console.`}`; 33042}; 33043function Ae(...e) { 33044 iM(dp, e[0], e[1]); 33045} 33046function Rt(...e) { 33047 iM(rd, e[0], e[1]); 33048} 33049function Ww(e, t, i) { 33050 iM(rd, e, t, i); 33051} 33052function XQ(e, t) { 33053 const i = t[0]; 33054 return `error #${i} ` + TO(i, t[1], e).join(" "); 33055} 33056function vl(...e) { 33057 return XQ(void 0, e); 33058} 33059function kO(e, t) { 33060 return e.get("rowModelType") === t; 33061} 33062function $s(e, t) { 33063 return kO(e, "clientSide"); 33064} 33065function Ag(e, t) { 33066 return kO(e, "serverSide"); 33067} 33068function gs(e, t) { 33069 return e.get("domLayout") === t; 33070} 33071function Dc(e) { 33072 return rv(e) !== void 0; 33073} 33074function PO(e) { 33075 return typeof e.get("getRowHeight") == "function"; 33076} 33077function JQ(e, t) { 33078 return t ? !e.get("enableStrictPivotColumnOrder") : e.get("maintainColumnOrder"); 33079} 33080function _c(e, t, i = !1, s) {
33081 const { gos: n, environment: o } = e; 33082 if (s == null && (s = o.getDefaultRowHeight()), PO(n)) { 33083 if (i) 33084 return { height: s, estimated: !0 }; 33085 const l = { 33086 node: t, 33087 data: t.data 33088 }, c = n.getCallback("getRowHeight")(l); 33089 if (jw(c)) 33090 return c === 0 && Ae(23), { height: Math.max(1, c), estimated: !1 }; 33091 } 33092 if (t.detail && n.get("masterDetail")) 33093 return eX(n); 33094 const r = n.get("rowHeight"); 33095 return { height: r && jw(r) ? r : s, estimated: !1 }; 33096} 33097function eX(e) { 33098 if (e.get("detailRowAutoHeight")) 33099 return { height: 1, estimated: !1 }; 33100 const t = e.get("detailRowHeight"); 33101 return jw(t) ? { height: t, estimated: !1 } : { height: 300, estimated: !1 }; 33102} 33103function Ec(e) { 33104 const { environment: t, gos: i } = e, s = i.get("rowHeight"); 33105 if (!s || ai(s)) 33106 return t.getDefaultRowHeight(); 33107 const n = t.refreshRowHeightVariable(); 33108 return n !== -1 ? n : (Ae(24), t.getDefaultRowHeight()); 33109} 33110function jw(e) { 33111 return !isNaN(e) && typeof e == "number" && isFinite(e); 33112} 33113function ov(e, t, i) { 33114 const s = t[e.getDomDataKey()]; 33115 return s ? s[i] : void 0; 33116} 33117function Bc(e, t, i, s) { 33118 const n = e.getDomDataKey(); 33119 let o = t[n]; 33120 ai(o) && (o = {}, t[n] = o), o[i] = s; 33121} 33122function Ei(e) { 33123 const { gos: t, eGridDiv: i } = e; 33124 let s = null; 33125 const n = t.get("getDocument"); 33126 return n && Ie(n) ? s = n() : i && (s = i.ownerDocument), s && Ie(s) ? s : document; 33127} 33128function FO(e) { 33129 return Ei(e).defaultView || window; 33130} 33131function Kp(e) { 33132 return e.eGridDiv.getRootNode(); 33133} 33134function gi(e) { 33135 return Kp(e).activeElement; 33136} 33137function sM(e) { 33138 let t = null, i = null; 33139 try { 33140 t = Ei(e).fullscreenElement; 33141 } catch { 33142 } finally { 33143 t || (t = Kp(e)); 33144 const s = t.querySelector("body"); 33145 s ? i = s : t instanceof ShadowRoot ? i = t : t instanceof Document ? i = t?.documentElement : i = t; 33146 } 33147 return i; 33148} 33149function tX(e) { 33150 return sM(e)?.clientWidth ?? (window.innerHeight || -1); 33151} 33152function iX(e) { 33153 return sM(e)?.clientHeight ?? (window.innerHeight || -1); 33154} 33155function sX(e, t, i) { 33156 const n = e.getBoundingClientRect().height, o = tX(i) - 2, r = iX(i) - 2; 33157 if (!e.offsetParent) 33158 return; 33159 const l = bO(e.offsetParent), { clientY: c, clientX: u } = t; 33160 let d = c - l.top - n / 2, p = u - l.left - 10; 33161 const f = Ei(i), m = f.defaultView || window, y = m.pageYOffset || f.documentElement.scrollTop, b = m.pageXOffset || f.documentElement.scrollLeft; 33162 o > 0 && p + e.clientWidth > o + b && (p = o + b - e.clientWidth), p < 0 && (p = 0), r > 0 && d + e.clientHeight > r + y && (d = r + y - e.clientHeight), d < 0 && (d = 0), e.style.left = `${p}px`, e.style.top = `${d}px`; 33163} 33164function OO(e) { 33165 const t = Ei(e), i = gi(e); 33166 return i === null || i === t.body; 33167} 33168function ad(e) { 33169 return e.get("ensureDomOrder") ? !1 : e.get("animateRows"); 33170} 33171function NO(e) { 33172 return !(e.get("paginateChildRows") || e.get("groupHideOpenParents") || gs(e, "print")); 33173} 33174function hr(e) { 33175 return !e.get("autoGroupColumnDef")?.comparator && !e.get("treeData"); 33176} 33177function $w(e) { 33178 const t = e.get("groupAggFiltering"); 33179 if (typeof t == "function") 33180 return e.getCallback("groupAggFiltering"); 33181 if (t === !0) 33182 return () => !0; 33183} 33184function nX(e) { 33185 return e.exists("groupDisplayType") ? e.get("groupDisplayType") === "multipleColumns" : e.get("groupHideOpenParents"); 33186} 33187function nM(e, t) { 33188 return t ? !1 : e.get("groupDisplayType") === "groupRows"; 33189} 33190function Ad(e) { 33191 const t = e.getCallback("getRowId"); 33192 return t === void 0 ? t : (i) => { 33193 let s = t(i); 33194 return typeof s != "string" && (Ae(25, { id: s }), s = String(s)), s; 33195 }; 33196} 33197function oX(e, t) { 33198 const i = e.get("groupHideParentOfSingleChild"); 33199 return !!(i === !0 || i === "leafGroupsOnly" && t.leafGroup || e.get("groupRemoveSingleChildren") || e.get("groupRemoveLowestSingleChildren") && t.leafGroup); 33200} 33201function rX(e) { 33202 const t = e.get("maxConcurrentDatasourceRequests"); 33203 return t > 0 ? t : void 0; 33204} 33205function ld(e) { 33206 return e?.checkboxes ?? !0; 33207} 33208function mm(e) { 33209 return e?.mode === "multiRow" && (e.headerCheckbox ?? !0); 33210} 33211function Yw(e) { 33212 if (typeof e == "object") 33213 return e.checkboxLocation ?? "selectionColumn"; 33214} 33215function w0(e) { 33216 return e?.hideDisabledCheckboxes ?? !1; 33217} 33218function aX(e) { 33219 return typeof e.get("rowSelection") != "string"; 33220} 33221function pa(e) { 33222 const t = e.get("cellSelection"); 33223 return t !== void 0 ? !!t : e.get("enableRangeSelection"); 33224} 33225function _O(e) { 33226 const t = e.get("rowSelection") ?? "single"; 33227 if (typeof t == "string") { 33228 const i = e.get("suppressRowClickSelection"), s = e.get("suppressRowDeselection"); 33229 return i && s ? !1 : i ? "enableDeselection" : s ? "enableSelection" : !0; 33230 } 33231 return t.mode === "singleRow" || t.mode === "multiRow" ? t.enableClickSelection ?? !1 : !1; 33232} 33233function lX(e) { 33234 const t = _O(e); 33235 return t === !0 || t === "enableSelection"; 33236} 33237function HR(e) { 33238 const t = _O(e); 33239 return t === !0 || t === "enableDeselection"; 33240} 33241function Kw(e) { 33242 const t = e.get("rowSelection"); 33243 return typeof t == "string" ? e.get("isRowSelectable") : t?.isRowSelectable; 33244} 33245function rv(e) { 33246 const t = e.get("rowSelection"); 33247 if (typeof t == "string") 33248 switch (t) { 33249 case "multiple": 33250 return "multiRow"; 33251 case "single": 33252 return "singleRow"; 33253 default: 33254 return; 33255 } 33256 switch (t?.mode) { 33257 case "multiRow": 33258 case "singleRow": 33259 return t.mode; 33260 default: 33261 return; 33262 } 33263} 33264function Yy(e) { 33265 return rv(e) === "multiRow"; 33266} 33267function cX(e) { 33268 const t = e.get("rowSelection"); 33269 return typeof t == "string" ? e.get("rowMultiSelectWithClick") : t?.enableSelectionWithoutKeys ?? !1; 33270} 33271function av(e) { 33272 const t = e.get("rowSelection"); 33273 if (typeof t == "string") { 33274 const i = e.get("groupSelectsChildren"), s = e.get("groupSelectsFiltered");
33275 return i && s ? "filteredDescendants" : i ? "descendants" : "self"; 33276 } 33277 return t?.mode === "multiRow" ? t.groupSelects : void 0; 33278} 33279function BO(e, t = !0) { 33280 const i = e.get("rowSelection"); 33281 return typeof i != "object" ? t ? "all" : void 0 : i.mode === "multiRow" ? i.selectAll : "all"; 33282} 33283function Zp(e) { 33284 const t = av(e); 33285 return t === "descendants" || t === "filteredDescendants"; 33286} 33287function S0(e) { 33288 return e.isModuleRegistered("SetFilter") && !e.get("suppressSetFilterByDefault"); 33289} 33290function _n(e) { 33291 return e.get("columnMenu") === "legacy"; 33292} 33293function uX(e) { 33294 return !_n(e); 33295} 33296function oM(e) { 33297 return !e || e.length < 2 ? e : "on" + e[0].toUpperCase() + e.substring(1); 33298} 33299function dX(e, t, i) { 33300 typeof e != "object" && (e = {}); 33301 const s = { ...e }; 33302 return i.forEach((n) => { 33303 const o = t[n]; 33304 typeof o < "u" && (s[n] = o); 33305 }), s; 33306} 33307function hX(e, t) { 33308 if (!e) 33309 return; 33310 const i = {}; 33311 let s = !1; 33312 if (Object.keys(e).forEach((r) => { 33313 i[r] = e[r], s = !0; 33314 }), !s) 33315 return; 33316 const n = { 33317 type: "gridOptionsChanged", 33318 options: i 33319 }; 33320 t.dispatchEvent(n); 33321 const o = { 33322 type: "componentStateChanged", 33323 ...i 33324 }; 33325 t.dispatchEvent(o); 33326} 33327var GO = "__ag_Grid_Stop_Propagation", pX = ["touchstart", "touchend", "touchmove", "touchcancel", "scroll"], gX = ["wheel"], x0 = {}; 33328function Dd(e) { 33329 e[GO] = !0; 33330} 33331function ra(e) { 33332 return e[GO] === !0; 33333} 33334var zO = /* @__PURE__ */ (() => { 33335 const e = { 33336 select: "input", 33337 change: "input", 33338 submit: "form", 33339 reset: "form", 33340 error: "img", 33341 load: "img", 33342 abort: "img" 33343 }; 33344 return (i) => { 33345 if (typeof x0[i] == "boolean") 33346 return x0[i]; 33347 const s = document.createElement(e[i] || "div"); 33348 return i = "on" + i, x0[i] = i in s; 33349 }; 33350})(); 33351function HO(e, t, i) { 33352 let s = t; 33353 for (; s; ) { 33354 const n = ov(e, s, i); 33355 if (n) 33356 return n; 33357 s = s.parentElement; 33358 } 33359 return null; 33360} 33361function fX(e, t) { 33362 return !t || !e ? !1 : vX(t).indexOf(e) >= 0; 33363} 33364function mX(e) { 33365 const t = []; 33366 let i = e.target; 33367 for (; i; ) 33368 t.push(i), i = i.parentElement; 33369 return t; 33370} 33371function vX(e) { 33372 const t = e; 33373 return t.path ? t.path : t.composedPath ? t.composedPath() : mX(t); 33374} 33375function yX(e, t, i, s) { 33376 const n = VO(i); 33377 let o; 33378 n != null && (o = { passive: n }), e && e.addEventListener && e.addEventListener(t, i, s, o); 33379} 33380var VO = (e) => { 33381 const t = pX.includes(e), i = gX.includes(e); 33382 if (t) 33383 return !0; 33384 if (i) 33385 return !1; 33386}, he = class { 33387 constructor() { 33388 this.destroyFunctions = [], this.destroyed = !1, this.__v_skip = !0, this.propertyListenerId = 0, this.lastChangeSetIdLookup = {}, this.isAlive = () => !this.destroyed; 33389 } 33390 preWireBeans(e) { 33391 this.beans = e, this.stubContext = e.context, this.eventSvc = e.eventSvc, this.gos = e.gos; 33392 } 33393 // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are 33394 // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed 33395 // points to a bean or component that was not properly disposed of. 33396 // constructor() { 33397 // setTimeout(()=> { 33398 // if (this.isAlive()) { 33399 // let prototype: any = Object.getPrototypeOf(this); 33400 // const constructor: any = prototype.constructor; 33401 // const constructorString = constructor.toString(); 33402 // const beanName = constructorString.substring(9, constructorString.indexOf("(")); 33403 // console.log('is alive ' + beanName); 33404 // } 33405 // }, 5000); 33406 // } 33407 destroy() { 33408 const { destroyFunctions: e } = this; 33409 for (let t = 0; t < e.length; t++) 33410 e[t](); 33411 e.length = 0, this.destroyed = !0, this.dispatchLocalEvent({ type: "destroyed" }); 33412 } 33413 // The typing of AgEventListener<any, any, any> is not ideal, but it's the best we can do at the moment to enable 33414 // eventSvc to have the best typing at the expense of BeanStub local events 33415 /** Add a local event listener against this BeanStub */ 33416 addEventListener(e, t, i) { 33417 this.localEventService || (this.localEventService = new ih()), this.localEventService.addEventListener(e, t, i); 33418 } 33419 /** Remove a local event listener from this BeanStub */ 33420 removeEventListener(e, t, i) { 33421 this.localEventService?.removeEventListener(e, t, i); 33422 } 33423 dispatchLocalEvent(e) { 33424 this.localEventService?.dispatchEvent(e); 33425 } 33426 addManagedElementListeners(e, t) { 33427 return this._setupListeners(e, t); 33428 } 33429 addManagedEventListeners(e) { 33430 return this._setupListeners(this.eventSvc, e); 33431 } 33432 addManagedListeners(e, t) { 33433 return this._setupListeners(e, t); 33434 } 33435 _setupListeners(e, t) { 33436 const i = []; 33437 for (const s of Object.keys(t)) { 33438 const n = t[s]; 33439 n && i.push(this._setupListener(e, s, n)); 33440 } 33441 return i; 33442 } 33443 _setupListener(e, t, i) { 33444 if (this.destroyed) 33445 return () => null; 33446 e instanceof HTMLElement ? yX(this.beans.frameworkOverrides, e, t, i) : e.addEventListener(t, i); 33447 const s = () => (e.removeEventListener(t, i), null); 33448 return this.destroyFunctions.push(s), () => (s(), this.destroyFunctions = this.destroyFunctions.filter((n) => n !== s), null); 33449 } 33450 /** 33451 * Setup a managed property listener for the given GridOption property. 33452 * However, stores the destroy function in the beanStub so that if this bean 33453 * is a component the destroy function will be called when the component is destroyed 33454 * as opposed to being cleaned up only when the GridOptionsService is destroyed. 33455 */
33456 setupGridOptionListener(e, t) { 33457 const { gos: i } = this; 33458 i.addPropertyEventListener(e, t); 33459 const s = () => (i.removePropertyEventListener(e, t), null); 33460 return this.destroyFunctions.push(s), () => (s(), this.destroyFunctions = this.destroyFunctions.filter((n) => n !== s), null); 33461 } 33462 /** 33463 * Setup a managed property listener for the given GridOption property. 33464 * @param event GridOption property to listen to changes for. 33465 * @param listener Listener to run when property value changes 33466 */ 33467 addManagedPropertyListener(e, t) { 33468 return this.destroyed ? () => null : this.setupGridOptionListener(e, t); 33469 } 33470 /** 33471 * Setup managed property listeners for the given set of GridOption properties. 33472 * The listener will be run if any of the property changes but will only run once if 33473 * multiple of the properties change within the same framework lifecycle event. 33474 * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired. 33475 * @param events Array of GridOption properties to listen for changes too. 33476 * @param listener Shared listener to run if any of the properties change 33477 */ 33478 addManagedPropertyListeners(e, t) { 33479 if (this.destroyed) 33480 return; 33481 const i = e.join("-") + this.propertyListenerId++, s = (n) => { 33482 if (n.changeSet) { 33483 if (n.changeSet && n.changeSet.id === this.lastChangeSetIdLookup[i]) 33484 return; 33485 this.lastChangeSetIdLookup[i] = n.changeSet.id; 33486 } 33487 const o = { 33488 type: "gridPropertyChanged", 33489 changeSet: n.changeSet, 33490 source: n.source 33491 }; 33492 t(o); 33493 }; 33494 e.forEach((n) => this.setupGridOptionListener(n, s)); 33495 } 33496 getLocaleTextFunc() { 33497 return rO(this.beans.localeSvc); 33498 } 33499 addDestroyFunc(e) { 33500 this.isAlive() ? this.destroyFunctions.push(e) : e(); 33501 } 33502 /** doesn't throw an error if `bean` is undefined */ 33503 createOptionalManagedBean(e, t) { 33504 return e ? this.createManagedBean(e, t) : void 0; 33505 } 33506 createManagedBean(e, t) { 33507 const i = this.createBean(e, t); 33508 return this.addDestroyFunc(this.destroyBean.bind(this, e, t)), i; 33509 } 33510 createBean(e, t, i) { 33511 return (t || this.stubContext).createBean(e, i); 33512 } 33513 /** 33514 * Destroys a bean and returns undefined to support destruction and clean up in a single line. 33515 * this.dateComp = this.context.destroyBean(this.dateComp); 33516 */ 33517 destroyBean(e, t) { 33518 return (t || this.stubContext).destroyBean(e); 33519 } 33520 /** 33521 * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line. 33522 * this.dateComps = this.context.destroyBeans(this.dateComps); 33523 */ 33524 destroyBeans(e, t) { 33525 return (t || this.stubContext).destroyBeans(e); 33526 } 33527}, UO = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]); 33528function CX(e, t) { 33529 if (e != null) { 33530 if (Array.isArray(e)) { 33531 for (let i = 0; i < e.length; i++) 33532 t(i.toString(), e[i]); 33533 return; 33534 } 33535 for (const [i, s] of Object.entries(e)) 33536 t(i, s); 33537 } 33538} 33539function Ss(e, t, i = !0, s = !1) { 33540 Ie(t) && CX(t, (n, o) => { 33541 if (UO.has(n)) 33542 return; 33543 let r = e[n]; 33544 r !== o && (s && r == null && o != null && typeof o == "object" && o.constructor === Object && (r = {}, e[n] = r), VR(o) && VR(r) && !Array.isArray(r) ? Ss(r, o, i, s) : (i || o !== void 0) && (e[n] = o)); 33545 }); 33546} 33547function hp(e, t, i) { 33548 if (!t || !e) 33549 return; 33550 if (!i) 33551 return e[t]; 33552 const s = t.split("."); 33553 let n = e; 33554 for (let o = 0; o < s.length; o++) { 33555 if (n == null) 33556 return; 33557 n = n[s[o]]; 33558 } 33559 return n; 33560} 33561function VR(e) { 33562 return typeof e == "object" && e !== null; 33563} 33564var bX = { 33565 resizable: !0, 33566 sortable: !0 33567}, wX = 0; 33568function WO() { 33569 return wX++; 33570} 33571function Al(e) { 33572 return e instanceof rM; 33573} 33574var rM = class extends he { 33575 constructor(e, t, i, s) { 33576 super(), this.colDef = e, this.userProvidedColDef = t, this.colId = i, this.primary = s, this.isColumn = !0, this.instanceId = WO(), this.autoHeaderHeight = null, this.moving = !1, this.menuVisible = !1, this.lastLeftPinned = !1, this.firstRightPinned = !1, this.filterActive = !1, this.colEventSvc = new ih(), this.tooltipEnabled = !1, this.rowGroupActive = !1, this.pivotActive = !1, this.aggregationActive = !1, this.flex = null; 33577 } 33578 getInstanceId() { 33579 return this.instanceId; 33580 } 33581 setState() { 33582 const { 33583 colDef: e, 33584 beans: { sortSvc: t, pinnedCols: i, colFlex: s } 33585 } = this; 33586 t?.initCol(this); 33587 const n = e.hide; 33588 n !== void 0 ? this.visible = !n : this.visible = !e.initialHide, i?.initCol(this), s?.initCol(this); 33589 } 33590 // gets called when user provides an alternative colDef, eg 33591 setColDef(e, t, i) { 33592 this.colDef = e, this.userProvidedColDef = t, this.initMinAndMaxWidths(), this.initDotNotation(), this.initTooltip(), this.dispatchColEvent("colDefChanged", i); 33593 } 33594 getUserProvidedColDef() { 33595 return this.userProvidedColDef; 33596 } 33597 getParent() { 33598 return this.parent; 33599 } 33600 getOriginalParent() { 33601 return this.originalParent; 33602 } 33603 // this is done after constructor as it uses gridOptionsService 33604 postConstruct() { 33605 this.setState(), this.initMinAndMaxWidths(), this.resetActualWidth("gridInitializing"), this.initDotNotation(), this.initTooltip(); 33606 } 33607 initDotNotation() { 33608 const { 33609 gos: e, 33610 colDef: { field: t, tooltipField: i } 33611 } = this, s = e.get("suppressFieldDotNotation"); 33612 this.fieldContainsDots = Ie(t) && t.indexOf(".") >= 0 && !s, this.tooltipFieldContainsDots = Ie(i) && i.indexOf(".") >= 0 && !s; 33613 } 33614 initMinAndMaxWidths() { 33615 const e = this.colDef; 33616 this.minWidth = e.minWidth ?? this.beans.environment.getDefaultColumnMinWidth(), this.maxWidth = e.maxWidth ?? Number.MAX_SAFE_INTEGER; 33617 } 33618 initTooltip() { 33619 this.beans.tooltipSvc?.initCol(this); 33620 } 33621 resetActualWidth(e) { 33622 const t = this.calculateColInitialWidth(this.colDef); 33623 this.setActualWidth(t, e, !0); 33624 } 33625 calculateColInitialWidth(e) { 33626 let t; 33627 const i = e.width, s = e.initialWidth; 33628 return i != null ? t = i : s != null ? t = s : t = 200, Math.max(Math.min(t, this.maxWidth), this.minWidth); 33629 } 33630 isEmptyGroup() { 33631 return !1; 33632 } 33633 isRowGroupDisplayed(e) { 33634 return this.beans.showRowGroupCols?.isRowGroupDisplayed(this, e) ?? !1; 33635 } 33636 isPrimary() { 33637 return this.primary; 33638 } 33639 isFilterAllowed() { 33640 return !!this.colDef.filter; 33641 } 33642 isFieldContainsDots() { 33643 return this.fieldContainsDots; 33644 } 33645 isTooltipEnabled() { 33646 return this.tooltipEnabled; 33647 } 33648 isTooltipFieldContainsDots() { 33649 return this.tooltipFieldContainsDots; 33650 } 33651 getHighlighted() { 33652 return this.highlighted; 33653 } 33654 addEventListener(e, t) { 33655 this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.( 33656 this.frameworkEventListenerService, 33657 this.colEventSvc 33658 ); 33659 const i = this.frameworkEventListenerService?.wrap(t) ?? t; 33660 this.colEventSvc.addEventListener(e, i); 33661 } 33662 removeEventListener(e, t) { 33663 const i = this.frameworkEventListenerService?.unwrap(t) ?? t; 33664 this.colEventSvc.removeEventListener(e, i); 33665 } 33666 createColumnFunctionCallbackParams(e) { 33667 return this.gos.addGridCommonParams({ 33668 node: e, 33669 data: e.data, 33670 column: this, 33671 colDef: this.colDef 33672 }); 33673 } 33674 isSuppressNavigable(e) { 33675 return this.beans.cellNavigation?.isSuppressNavigable(this, e) ?? !1; 33676 } 33677 isCellEditable(e) { 33678 return this.beans.editSvc?.isCellEditable(this, e) ?? !1; 33679 } 33680 isSuppressFillHandle() { 33681 return !!this.colDef.suppressFillHandle; 33682 } 33683 isAutoHeight() { 33684 return !!this.colDef.autoHeight; 33685 } 33686 isAutoHeaderHeight() { 33687 return !!this.colDef.autoHeaderHeight; 33688 } 33689 isRowDrag(e) { 33690 return this.isColumnFunc(e, this.colDef.rowDrag); 33691 } 33692 isDndSource(e) { 33693 return this.isColumnFunc(e, this.colDef.dndSource); 33694 } 33695 isCellCheckboxSelection(e) { 33696 return this.beans.selectionSvc?.isCellCheckboxSelection(this, e) ?? !1; 33697 } 33698 isSuppressPaste(e) { 33699 return this.isColumnFunc(e, this.colDef?.suppressPaste ?? null); 33700 } 33701 isResizable() { 33702 return !!this.getColDefValue("resizable"); 33703 } 33704 /** Get value from ColDef or default if it exists. */ 33705 getColDefValue(e) { 33706 return this.colDef[e] ?? bX[e]; 33707 } 33708 isColumnFunc(e, t) { 33709 if (typeof t == "boolean") 33710 return t; 33711 if (typeof t == "function") { 33712 const i = this.createColumnFunctionCallbackParams(e); 33713 return t(i); 33714 } 33715 return !1; 33716 } 33717 createColumnEvent(e, t) { 33718 return this.gos.addGridCommonParams({ 33719 type: e, 33720 column: this, 33721 columns: [this], 33722 source: t 33723 }); 33724 } 33725 isMoving() { 33726 return this.moving; 33727 } 33728 getSort() { 33729 return this.sort; 33730 } 33731 isSortable() { 33732 return !!this.getColDefValue("sortable"); 33733 } 33734 /** @deprecated v32 use col.getSort() === 'asc */ 33735 isSortAscending() { 33736 return this.sort === "asc"; 33737 } 33738 /** @deprecated v32 use col.getSort() === 'desc */ 33739 isSortDescending() { 33740 return this.sort === "desc"; 33741 } 33742 /** @deprecated v32 use col.getSort() === undefined */ 33743 isSortNone() { 33744 return ai(this.sort); 33745 } 33746 /** @deprecated v32 use col.getSort() !== undefined */ 33747 isSorting() { 33748 return Ie(this.sort); 33749 } 33750 getSortIndex() { 33751 return this.sortIndex; 33752 } 33753 isMenuVisible() { 33754 return this.menuVisible; 33755 } 33756 getAggFunc() { 33757 return this.aggFunc; 33758 } 33759 getLeft() { 33760 return this.left; 33761 } 33762 getOldLeft() { 33763 return this.oldLeft; 33764 } 33765 getRight() { 33766 return this.left + this.actualWidth; 33767 } 33768 setLeft(e, t) { 33769 this.oldLeft = this.left, this.left !== e && (this.left = e, this.dispatchColEvent("leftChanged", t)); 33770 } 33771 isFilterActive() { 33772 return this.filterActive; 33773 } 33774 /** @deprecated v33 Use `api.isColumnHovered(column)` instead. */ 33775 isHovered() { 33776 return Ae(261), !!this.beans.colHover?.isHovered(this); 33777 } 33778 setFirstRightPinned(e, t) { 33779 this.firstRightPinned !== e && (this.firstRightPinned = e, this.dispatchColEvent("firstRightPinnedChanged", t)); 33780 } 33781 setLastLeftPinned(e, t) { 33782 this.lastLeftPinned !== e && (this.lastLeftPinned = e, this.dispatchColEvent("lastLeftPinnedChanged", t)); 33783 } 33784 isFirstRightPinned() { 33785 return this.firstRightPinned; 33786 } 33787 isLastLeftPinned() { 33788 return this.lastLeftPinned; 33789 } 33790 isPinned() { 33791 return this.pinned === "left" || this.pinned === "right"; 33792 } 33793 isPinnedLeft() { 33794 return this.pinned === "left"; 33795 } 33796 isPinnedRight() { 33797 return this.pinned === "right"; 33798 } 33799 getPinned() { 33800 return this.pinned; 33801 } 33802 setVisible(e, t) { 33803 const i = e === !0; 33804 this.visible !== i && (this.visible = i, this.dispatchColEvent("visibleChanged", t)), this.dispatchStateUpdatedEvent("hide"); 33805 } 33806 isVisible() { 33807 return this.visible; 33808 } 33809 isSpanHeaderHeight() {
33810 return !this.getColDef().suppressSpanHeaderHeight; 33811 } 33812 getColumnGroupPaddingInfo() { 33813 let e = this.getParent(); 33814 if (!e || !e.isPadding()) 33815 return { numberOfParents: 0, isSpanningTotal: !1 }; 33816 const t = e.getPaddingLevel() + 1; 33817 let i = !0; 33818 for (; e; ) { 33819 if (!e.isPadding()) { 33820 i = !1; 33821 break; 33822 } 33823 e = e.getParent(); 33824 } 33825 return { numberOfParents: t, isSpanningTotal: i }; 33826 } 33827 getColDef() { 33828 return this.colDef; 33829 } 33830 getDefinition() { 33831 return this.colDef; 33832 } 33833 getColumnGroupShow() { 33834 return this.colDef.columnGroupShow; 33835 } 33836 getColId() { 33837 return this.colId; 33838 } 33839 getId() { 33840 return this.colId; 33841 } 33842 getUniqueId() { 33843 return this.colId; 33844 } 33845 getActualWidth() { 33846 return this.actualWidth; 33847 } 33848 getAutoHeaderHeight() { 33849 return this.autoHeaderHeight; 33850 } 33851 /** Returns true if the header height has changed */ 33852 setAutoHeaderHeight(e) { 33853 const t = e !== this.autoHeaderHeight; 33854 return this.autoHeaderHeight = e, t; 33855 } 33856 createBaseColDefParams(e) { 33857 return this.gos.addGridCommonParams({ 33858 node: e, 33859 data: e.data, 33860 colDef: this.colDef, 33861 column: this 33862 }); 33863 } 33864 getColSpan(e) { 33865 if (ai(this.colDef.colSpan)) 33866 return 1; 33867 const t = this.createBaseColDefParams(e), i = this.colDef.colSpan(t); 33868 return Math.max(i, 1); 33869 } 33870 getRowSpan(e) { 33871 if (ai(this.colDef.rowSpan)) 33872 return 1; 33873 const t = this.createBaseColDefParams(e), i = this.colDef.rowSpan(t); 33874 return Math.max(i, 1); 33875 } 33876 setActualWidth(e, t, i = !1) { 33877 e = Math.max(e, this.minWidth), e = Math.min(e, this.maxWidth), this.actualWidth !== e && (this.actualWidth = e, this.flex && t !== "flex" && t !== "gridInitializing" && (this.flex = null), i || this.fireColumnWidthChangedEvent(t)), this.dispatchStateUpdatedEvent("width"); 33878 } 33879 fireColumnWidthChangedEvent(e) { 33880 this.dispatchColEvent("widthChanged", e); 33881 } 33882 isGreaterThanMax(e) { 33883 return e > this.maxWidth; 33884 } 33885 getMinWidth() { 33886 return this.minWidth; 33887 } 33888 getMaxWidth() { 33889 return this.maxWidth; 33890 } 33891 getFlex() { 33892 return this.flex; 33893 } 33894 isRowGroupActive() { 33895 return this.rowGroupActive; 33896 } 33897 isPivotActive() { 33898 return this.pivotActive; 33899 } 33900 isAnyFunctionActive() { 33901 return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive(); 33902 } 33903 isAnyFunctionAllowed() { 33904 return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue(); 33905 } 33906 isValueActive() { 33907 return this.aggregationActive; 33908 } 33909 isAllowPivot() { 33910 return this.colDef.enablePivot === !0; 33911 } 33912 isAllowValue() { 33913 return this.colDef.enableValue === !0; 33914 } 33915 isAllowRowGroup() { 33916 return this.colDef.enableRowGroup === !0; 33917 } 33918 dispatchColEvent(e, t, i) { 33919 const s = this.createColumnEvent(e, t); 33920 i && Ss(s, i), this.colEventSvc.dispatchEvent(s); 33921 } 33922 dispatchStateUpdatedEvent(e) { 33923 this.colEventSvc.dispatchEvent({ 33924 type: "columnStateUpdated", 33925 key: e 33926 }); 33927 } 33928}; 33929function js(e) { 33930 return e instanceof vm; 33931} 33932var vm = class extends he { 33933 constructor(e, t, i, s) { 33934 super(), this.colGroupDef = e, this.groupId = t, this.padding = i, this.level = s, this.isColumn = !1, this.expandable = !1, this.instanceId = WO(), this.expandableListenerRemoveCallback = null, this.expanded = !!e?.openByDefault; 33935 } 33936 destroy() { 33937 this.expandableListenerRemoveCallback && this.reset(null, void 0), super.destroy(); 33938 } 33939 reset(e, t) { 33940 this.colGroupDef = e, this.level = t, this.originalParent = null, this.expandableListenerRemoveCallback && this.expandableListenerRemoveCallback(), this.children = void 0, this.expandable = void 0; 33941 } 33942 getInstanceId() { 33943 return this.instanceId; 33944 } 33945 getOriginalParent() { 33946 return this.originalParent; 33947 } 33948 getLevel() { 33949 return this.level; 33950 } 33951 isVisible() { 33952 return this.children ? this.children.some((e) => e.isVisible()) : !1; 33953 } 33954 isPadding() { 33955 return this.padding; 33956 } 33957 setExpanded(e) { 33958 this.expanded = e === void 0 ? !1 : e, this.dispatchLocalEvent({ type: "expandedChanged" }); 33959 } 33960 isExpandable() { 33961 return this.expandable; 33962 } 33963 isExpanded() { 33964 return this.expanded; 33965 } 33966 getGroupId() { 33967 return this.groupId; 33968 } 33969 getId() { 33970 return this.getGroupId(); 33971 } 33972 setChildren(e) { 33973 this.children = e; 33974 } 33975 getChildren() { 33976 return this.children; 33977 } 33978 getColGroupDef() { 33979 return this.colGroupDef; 33980 } 33981 getLeafColumns() { 33982 const e = []; 33983 return this.addLeafColumns(e), e; 33984 } 33985 addLeafColumns(e) {
33986 this.children && this.children.forEach((t) => { 33987 Al(t) ? e.push(t) : js(t) && t.addLeafColumns(e); 33988 }); 33989 } 33990 getColumnGroupShow() { 33991 const e = this.colGroupDef; 33992 if (e) 33993 return e.columnGroupShow; 33994 } 33995 // need to check that this group has at least one col showing when both expanded and contracted. 33996 // if not, then we don't allow expanding and contracting on this group 33997 setupExpandable() { 33998 this.setExpandable(), this.expandableListenerRemoveCallback && this.expandableListenerRemoveCallback(); 33999 const e = this.onColumnVisibilityChanged.bind(this); 34000 this.getLeafColumns().forEach((t) => t.addEventListener("visibleChanged", e)), this.expandableListenerRemoveCallback = () => { 34001 this.getLeafColumns().forEach((t) => t.removeEventListener("visibleChanged", e)), this.expandableListenerRemoveCallback = null; 34002 }; 34003 } 34004 setExpandable() { 34005 if (this.isPadding()) 34006 return; 34007 let e = !1, t = !1, i = !1; 34008 const s = this.findChildrenRemovingPadding(); 34009 for (let o = 0, r = s.length; o < r; o++) { 34010 const a = s[o]; 34011 if (!a.isVisible()) 34012 continue; 34013 const l = a.getColumnGroupShow(); 34014 l === "open" ? (e = !0, i = !0) : l === "closed" ? (t = !0, i = !0) : (e = !0, t = !0); 34015 } 34016 const n = e && t && i; 34017 this.expandable !== n && (this.expandable = n, this.dispatchLocalEvent({ type: "expandableChanged" })); 34018 } 34019 findChildrenRemovingPadding() { 34020 const e = [], t = (i) => { 34021 i.forEach((s) => { 34022 js(s) && s.isPadding() ? t(s.children) : e.push(s); 34023 }); 34024 }; 34025 return t(this.children), e; 34026 } 34027 onColumnVisibilityChanged() { 34028 this.setExpandable(); 34029 } 34030}, SX = { 34031 numericColumn: { 34032 headerClass: "ag-right-aligned-header", 34033 cellClass: "ag-right-aligned-cell" 34034 }, 34035 rightAligned: { 34036 headerClass: "ag-right-aligned-header", 34037 cellClass: "ag-right-aligned-cell" 34038 } 34039}, xX = class { 34040 constructor() { 34041 this.existingKeys = {}; 34042 } 34043 addExistingKeys(e) { 34044 for (let t = 0; t < e.length; t++) 34045 this.existingKeys[e[t]] = !0; 34046 } 34047 getUniqueKey(e, t) { 34048 e = Vw(e); 34049 let i = 0; 34050 for (; ; ) { 34051 let s = e ?? t; 34052 if (s ? i !== 0 && (s += "_" + i) : s = i, !this.existingKeys[s]) 34053 return this.existingKeys[s] = !0, String(s); 34054 i++; 34055 } 34056 } 34057}, UR = Object.freeze([]); 34058function It(e) { 34059 if (e?.length) 34060 return e[e.length - 1]; 34061} 34062function tu(e, t, i) { 34063 return e == null && t == null ? !0 : e != null && t != null && e.length === t.length && e.every((s, n) => i ? i(s, t[n]) : t[n] === s); 34064} 34065function MX(e) { 34066 return e.sort((t, i) => t - i); 34067} 34068function Ko(e, t) { 34069 const i = e.indexOf(t); 34070 i >= 0 && e.splice(i, 1); 34071} 34072function WR(e, t, i) { 34073 for (let s = 0; s < t.length; s++) 34074 Ko(e, t[s]); 34075 for (let s = t.length - 1; s >= 0; s--) 34076 e.splice(i, 0, t[s]); 34077} 34078function jO(e, t) { 34079 const i = [], s = [], n = []; 34080 return e.forEach((r) => { 34081 const a = r.getColDef().lockPosition; 34082 a === "right" ? n.push(r) : a === "left" || a === !0 ? i.push(r) : s.push(r); 34083 }), t.get("enableRtl") ? [...n, ...s, ...i] : [...i, ...s, ...n]; 34084} 34085function $O(e, t) { 34086 let i = !0; 34087 return aa(null, t, (s) => { 34088 if (!js(s)) 34089 return; 34090 const n = s, o = n.getColGroupDef(); 34091 if (!(o && o.marryChildren)) 34092 return; 34093 const a = []; 34094 n.getLeafColumns().forEach((p) => { 34095 const f = e.indexOf(p); 34096 a.push(f); 34097 }); 34098 const l = Math.max.apply(Math, a), c = Math.min.apply(Math, a), u = l - c, d = n.getLeafColumns().length - 1; 34099 u > d && (i = !1); 34100 }), i; 34101} 34102function YO(e, t) { 34103 if (!e || e.length == 0) 34104 return; 34105 const i = t(e[0]); 34106 for (let s = 1; s < e.length; s++) 34107 if (i !== t(e[s])) 34108 return; 34109 return i; 34110} 34111function KO(e, t, i) { 34112 if (!t.length) 34113 return; 34114 const s = t.length === 1 ? t[0] : null, n = YO(t, (o) => o.getPinned()); 34115 e.dispatchEvent({ 34116 type: "columnPinned", 34117 // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned' 34118 pinned: n ?? null, 34119 columns: t, 34120 column: s, 34121 source: i 34122 }); 34123} 34124function AX(e, t, i) { 34125 if (!t.length) 34126 return; 34127 const s = t.length === 1 ? t[0] : null, n = YO(t, (o) => o.isVisible()); 34128 e.dispatchEvent({ 34129 type: "columnVisible", 34130 visible: n, 34131 columns: t, 34132 column: s, 34133 source: i 34134 }); 34135} 34136function DX(e, t, i, s) { 34137 e.dispatchEvent({ 34138 type: t, 34139 columns: i, 34140 column: i && i.length == 1 ? i[0] : null, 34141 source: s 34142 }); 34143} 34144function Ed(e, t, i, s, n = null) { 34145 t?.length && e.dispatchEvent({ 34146 type: "columnResized", 34147 columns: t, 34148 column: t.length === 1 ? t[0] : null, 34149 flexColumns: n, 34150 finished: i, 34151 source: s 34152 }); 34153} 34154function Wo(e, t, i) { 34155 const { 34156 colModel: s, 34157 rowGroupColsSvc: n, 34158 pivotColsSvc: o, 34159 autoColSvc: r, 34160 selectionColSvc: a, 34161 colAnimation: l, 34162 visibleCols: c, 34163 pivotResultCols: u, 34164 environment: d, 34165 valueColsSvc: p, 34166 eventSvc: f, 34167 gos: m 34168 } = e, y = s.getColDefCols() || []; 34169 if (!y?.length) 34170 return !1; 34171 if (t?.state && !t.state.forEach) 34172 return Ae(32), !1; 34173 const b = (A, I, L, k, B) => { 34174 if (!A) 34175 return; 34176 const N = FX(I, t.defaultState), W = N("flex").value1; 34177 if (sN( 34178 e, 34179 A, 34180 N("hide").value1, 34181 N("sort").value1, 34182 N("sortIndex").value1, 34183 N("pinned").value1, 34184 W, 34185 i 34186 ), W == null) { 34187 const se = N("width").value1; 34188 if (se != null) { 34189 const ue = A.getColDef().minWidth ?? d.getDefaultColumnMinWidth(); 34190 ue != null && se >= ue && A.setActualWidth(se, i); 34191 } 34192 } 34193 B || !A.isPrimary() || (p?.syncColumnWithState(A, i, N), n?.syncColumnWithState(A, i, N, L), o?.syncColumnWithState(A, i, N, k)); 34194 }, C = (A, I, L) => {
34195 const k = ZO(e, i), B = I.slice(), N = {}, W = {}, se = [], ue = [], Ce = []; 34196 let te = 0; 34197 const q = n?.columns.slice() ?? [], $ = o?.columns.slice() ?? []; 34198 A.forEach((P) => { 34199 const G = P.colId; 34200 if (G.startsWith(Ky)) { 34201 se.push(P), Ce.push(P); 34202 return; 34203 } 34204 if (vr(G)) { 34205 ue.push(P), Ce.push(P); 34206 return; 34207 } 34208 const K = L(G); 34209 K ? (b(K, P, N, W, !1), Ko(B, K)) : (Ce.push(P), te += 1); 34210 }); 34211 const T = (P) => b(P, null, N, W, !1); 34212 B.forEach(T), n?.sortColumns(jR.bind(n, N, q)), o?.sortColumns(jR.bind(o, W, $)), s.refreshCols(!1); 34213 const E = (P, G, _ = []) => { 34214 G.forEach((K) => { 34215 const ce = P(K.colId); 34216 Ko(_, ce), b(ce, K, null, null, !0); 34217 }), _.forEach(T); 34218 }; 34219 return E( 34220 (P) => r?.getAutoCol(P) ?? null, 34221 se, 34222 r?.getAutoCols()?.slice() 34223 ), E( 34224 (P) => a?.getSelectionCol(P) ?? null, 34225 ue, 34226 a?.getSelectionCols()?.slice() 34227 ), IX(t, s, m), c.refresh(i), f.dispatchEvent({ 34228 type: "columnEverythingChanged", 34229 source: i 34230 }), k(), { unmatchedAndAutoStates: Ce, unmatchedCount: te }; 34231 }; 34232 l?.start(); 34233 let { unmatchedAndAutoStates: w, unmatchedCount: M } = C( 34234 t.state || [], 34235 y, 34236 (A) => s.getColDefCol(A) 34237 ); 34238 if (w.length > 0 || Ie(t.defaultState)) { 34239 const A = u?.getPivotResultCols()?.list ?? []; 34240 M = C( 34241 w, 34242 A, 34243 (I) => u?.getPivotResultCol(I) ?? null 34244 ).unmatchedCount; 34245 } 34246 return l?.finish(), M === 0; 34247} 34248function EX(e, t) { 34249 const { colModel: i, autoColSvc: s } = e; 34250 if (!i.getColDefCols()?.length) 34251 return; 34252 const o = i.getColDefColTree(), r = eN(o), a = []; 34253 let l = 1e3, c = 1e3, u = []; 34254 const d = s?.getAutoCols(); 34255 d && (u = u.concat(d)), r && (u = u.concat(r)), u.forEach((p) => { 34256 const f = qO(p); 34257 ai(f.rowGroupIndex) && f.rowGroup && (f.rowGroupIndex = l++), ai(f.pivotIndex) && f.pivot && (f.pivotIndex = c++), a.push(f); 34258 }), Wo(e, { state: a, applyOrder: !0 }, t); 34259} 34260function ZO(e, t) { 34261 const { rowGroupColsSvc: i, pivotColsSvc: s, valueColsSvc: n, colModel: o, sortSvc: r, eventSvc: a } = e, l = { 34262 rowGroupColumns: i?.columns.slice() ?? [], 34263 pivotColumns: s?.columns.slice() ?? [], 34264 valueColumns: n?.columns.slice() ?? [] 34265 }, c = qp(e), u = {}; 34266 return c.forEach((d) => { 34267 u[d.colId] = d; 34268 }), () => { 34269 const d = o.getAllCols(), p = (k, B, N, W) => { 34270 const se = B.map(W), ue = N.map(W); 34271 if (tu(se, ue)) 34272 return; 34273 const te = new Set(B); 34274 N.forEach(($) => { 34275 te.delete($) || te.add($); 34276 }); 34277 const q = [...te]; 34278 a.dispatchEvent({ 34279 type: k, 34280 columns: q, 34281 column: q.length === 1 ? q[0] : null, 34282 source: t 34283 }); 34284 }, f = (k) => { 34285 const B = []; 34286 return d.forEach((N) => { 34287 const W = u[N.getColId()]; 34288 W && k(W, N) && B.push(N); 34289 }), B; 34290 }, m = (k) => k.getColId(); 34291 p( 34292 "columnRowGroupChanged", 34293 l.rowGroupColumns, 34294 i?.columns ?? [], 34295 m 34296 ), p( 34297 "columnPivotChanged", 34298 l.pivotColumns, 34299 s?.columns ?? [], 34300 m 34301 ); 34302 const b = f((k, B) => { 34303 const N = k.aggFunc != null, W = N != B.isValueActive(), se = N && k.aggFunc != B.getAggFunc(); 34304 return W || se; 34305 }); 34306 b.length > 0 && DX(a, "columnValueChanged", b, t), Ed(a, f((k, B) => k.width != B.getActualWidth()), !0, t), KO(a, f((k, B) => k.pinned != B.getPinned()), t), AX(a, f((k, B) => k.hide == B.isVisible()), t); 34307 const I = f((k, B) => k.sort != B.getSort() || k.sortIndex != B.getSortIndex()); 34308 I.length > 0 && r?.dispatchSortChangedEvents(t, I); 34309 const L = qp(e); 34310 TX(c, L, t, o, a); 34311 }; 34312} 34313function qp(e) { 34314 const { colModel: t, rowGroupColsSvc: i, pivotColsSvc: s } = e, n = t.getColDefCols(); 34315 if (ai(n) || !t.isAlive()) 34316 return []; 34317 const o = t.getAllCols(), r = i?.columns, a = s?.columns, l = (d) => { 34318 const p = d.isRowGroupActive() && r ? r.indexOf(d) : null, f = d.isPivotActive() && a ? a.indexOf(d) : null, m = d.isValueActive() ? d.getAggFunc() : null, y = d.getSort() != null ? d.getSort() : null, b = d.getSortIndex() != null ? d.getSortIndex() : null; 34319 return { 34320 colId: d.getColId(), 34321 width: d.getActualWidth(), 34322 hide: !d.isVisible(), 34323 pinned: d.getPinned(), 34324 sort: y, 34325 sortIndex: b, 34326 aggFunc: m, 34327 rowGroup: d.isRowGroupActive(), 34328 rowGroupIndex: p, 34329 pivot: d.isPivotActive(), 34330 pivotIndex: f, 34331 flex: d.getFlex() ?? null 34332 }; 34333 }, c = o.map((d) => l(d)), u = new Map( 34334 t.getCols().map((d, p) => [d.getColId(), p]) 34335 ); 34336 return c.sort((d, p) => { 34337 const f = u.has(d.colId) ? u.get(d.colId) : -1, m = u.has(p.colId) ? u.get(p.colId) : -1; 34338 return f - m; 34339 }), c; 34340} 34341function qO(e) { 34342 const t = (m, y) => m ?? y ?? null, i = e.getColDef(), s = t(i.sort, i.initialSort), n = t(i.sortIndex, i.initialSortIndex), o = t(i.hide, i.initialHide), r = t(i.pinned, i.initialPinned), a = t(i.width, i.initialWidth), l = t(i.flex, i.initialFlex); 34343 let c = t(i.rowGroupIndex, i.initialRowGroupIndex), u = t(i.rowGroup, i.initialRowGroup); 34344 c == null && (u == null || u == !1) && (c = null, u = null); 34345 let d = t(i.pivotIndex, i.initialPivotIndex), p = t(i.pivot, i.initialPivot); 34346 d == null && (p == null || p == !1) && (d = null, p = null); 34347 const f = t(i.aggFunc, i.initialAggFunc); 34348 return { 34349 colId: e.getColId(), 34350 sort: s, 34351 sortIndex: n, 34352 hide: o, 34353 pinned: r, 34354 width: a, 34355 flex: l, 34356 rowGroup: u, 34357 rowGroupIndex: c, 34358 pivot: p, 34359 pivotIndex: d, 34360 aggFunc: f 34361 }; 34362} 34363function IX(e, t, i) { 34364 if (!e.applyOrder || !e.state) 34365 return; 34366 const s = []; 34367 e.state.forEach((n) => { 34368 n.colId != null && s.push(n.colId); 34369 }), RX(t.cols, s, t, i); 34370} 34371function RX(e, t, i, s) { 34372 if (e == null) 34373 return; 34374 let n = []; 34375 const o = {}; 34376 t.forEach((a) => { 34377 if (o[a]) 34378 return; 34379 const l = e.map[a]; 34380 l && (n.push(l), o[a] = !0); 34381 }); 34382 let r = 0; 34383 if (e.list.forEach((a) => { 34384 const l = a.getColId(); 34385 if (o[l] != null) 34386 return; 34387 l.startsWith(Ky) ? n.splice(r++, 0, a) : n.push(a); 34388 }), n = jO(n, s), !$O(n, i.getColTree())) { 34389 Ae(39); 34390 return; 34391 } 34392 e.list = n; 34393} 34394function TX(e, t, i, s, n) { 34395 const o = {}; 34396 t.forEach((u) => o[u.colId] = u); 34397 const r = {}; 34398 e.forEach((u) => { 34399 o[u.colId] && (r[u.colId] = !0); 34400 }); 34401 const a = e.filter((u) => r[u.colId]), l = t.filter((u) => r[u.colId]), c = []; 34402 l.forEach((u, d) => { 34403 const p = a && a[d]; 34404 if (p && p.colId !== u.colId) { 34405 const f = s.getCol(p.colId); 34406 f && c.push(f); 34407 } 34408 }), c.length && n.dispatchEvent({ 34409 type: "columnMoved", 34410 columns: c, 34411 column: c.length === 1 ? c[0] : null, 34412 finished: !0, 34413 source: i 34414 }); 34415} 34416var jR = (e, t, i, s) => { 34417 const n = e[i.getId()], o = e[s.getId()], r = n != null, a = o != null; 34418 if (r && a) 34419 return n - o; 34420 if (r) 34421 return -1; 34422 if (a) 34423 return 1; 34424 const l = t.indexOf(i), c = t.indexOf(s), u = l >= 0, d = c >= 0; 34425 return u && d ? l - c : u ? -1 : 1; 34426}, QO = "ag-Grid-SelectionColumn", LX = class extends he {
34427 constructor() { 34428 super(...arguments), this.beanName = "selectionColSvc"; 34429 } 34430 postConstruct() { 34431 this.addManagedPropertyListener("rowSelection", (e) => { 34432 this.onSelectionOptionsChanged( 34433 e.currentValue, 34434 e.previousValue, 34435 cd(e.source) 34436 ); 34437 }); 34438 } 34439 addSelectionCols(e) { 34440 const t = this.selectionCols; 34441 t != null && (e.list = t.list.concat(e.list), e.tree = t.tree.concat(e.tree), PX(e)); 34442 } 34443 createSelectionCols(e, t) { 34444 const i = () => { 34445 lv(this.beans, this.selectionCols?.tree), this.selectionCols = null; 34446 }, s = e.treeDepth, o = (this.selectionCols?.treeDepth ?? -1) == s, r = this.generateSelectionCols(); 34447 if (kX(r, this.selectionCols?.list ?? []) && o) 34448 return; 34449 i(); 34450 const { colGroupSvc: l } = this.beans, c = l?.findDepth(e.tree) ?? 0, u = l?.balanceTreeForAutoCols(r, c) ?? []; 34451 this.selectionCols = { 34452 list: r, 34453 tree: u, 34454 treeDepth: c, 34455 map: {} 34456 }, t((p) => { 34457 if (!p) 34458 return null; 34459 const f = p.filter((m) => !vr(m)); 34460 return [...r, ...f]; 34461 }); 34462 } 34463 isSelectionColumnEnabled() { 34464 const { gos: e, beans: t } = this, i = e.get("rowSelection"); 34465 if (typeof i != "object" || !Dc(e)) 34466 return !1; 34467 const s = (t.autoColSvc?.getAutoCols()?.length ?? 0) > 0; 34468 if (i.checkboxLocation === "autoGroupColumn" && s) 34469 return !1; 34470 const n = !!ld(i), o = mm(i); 34471 return n || o; 34472 } 34473 generateSelectionCols() { 34474 if (!this.isSelectionColumnEnabled()) 34475 return []; 34476 const { gos: e, validation: t } = this.beans, i = e.get("selectionColumnDef"), n = { 34477 // overridable properties 34478 width: 50, 34479 resizable: !1, 34480 suppressHeaderMenuButton: !0, 34481 sortable: !1, 34482 suppressMovable: !0, 34483 lockPosition: e.get("enableRtl") ? "right" : "left", 34484 comparator(a, l, c, u) { 34485 const d = c.isSelected(), p = u.isSelected(); 34486 return d === p ? 0 : d ? 1 : -1; 34487 }, 34488 editable: !1, 34489 suppressFillHandle: !0, 34490 // overrides 34491 ...i, 34492 // non-overridable properties 34493 colId: QO 34494 }, o = n.colId; 34495 t?.validateColDef(n, o, !0); 34496 const r = new rM(n, null, o, !1); 34497 return this.createBean(r), [r]; 34498 } 34499 putSelectionColsFirstInList(e, t) { 34500 if (!t) 34501 return null; 34502 const i = t.filter((s) => !vr(s)); 34503 return [...e, ...i]; 34504 } 34505 getSelectionCol(e) { 34506 return this.selectionCols?.list.find((t) => tN(t, e)) ?? null; 34507 } 34508 getSelectionCols() { 34509 return this.selectionCols?.list ?? null; 34510 } 34511 onSelectionOptionsChanged(e, t, i) { 34512 const s = t && typeof t != "string" ? ld(t) : void 0, n = e && typeof e != "string" ? ld(e) : void 0, o = s !== n, r = t && typeof t != "string" ? mm(t) : void 0, a = e && typeof e != "string" ? mm(e) : void 0, l = r !== a, c = Yw(e), u = Yw(t); 34513 (o || l || c !== u) && this.beans.colModel.refreshAll(i); 34514 } 34515 destroy() { 34516 lv(this.beans, this.selectionCols?.tree), super.destroy(); 34517 } 34518 refreshVisibility(e) { 34519 if (!this.isSelectionColumnEnabled()) 34520 return; 34521 const t = this.beans, i = t.visibleCols.getAllTrees() ?? []; 34522 if (i.length !== 0) { 34523 if (!i.some(XO)) { 34524 const s = qp(t).find((n) => vr(n.colId)); 34525 s && Wo( 34526 t, 34527 { 34528 state: [{ colId: s.colId, hide: !s.hide }] 34529 }, 34530 e 34531 ); 34532 } 34533 if (i.length === 1) { 34534 const s = i[0], n = JO(s); 34535 if (!n) 34536 return; 34537 Wo(t, { state: [{ colId: n.getColId(), hide: !0 }] }, e); 34538 } 34539 } 34540 } 34541}, XO = (e) => e.isColumn ? vr(e) : e.getChildren()?.some(XO) ?? !1; 34542function JO(e) { 34543 if (e.isColumn) 34544 return vr(e) ? e : null; 34545 const t = e.getChildren() ?? []; 34546 for (const i of t) { 34547 const s = JO(i); 34548 if (s) 34549 return s; 34550 } 34551 return null; 34552} 34553var Ky = "ag-Grid-AutoColumn"; 34554function eN(e) { 34555 const t = [], i = (s) => { 34556 for (let n = 0; n < s.length; n++) { 34557 const o = s[n]; 34558 Al(o) ? t.push(o) : js(o) && i(o.getChildren()); 34559 } 34560 }; 34561 return i(e), t; 34562} 34563function Kr(e) { 34564 return e.reduce((t, i) => t + i.getActualWidth(), 0); 34565} 34566function lv(e, t, i) { 34567 const s = {}; 34568 if (!t) 34569 return; 34570 aa(null, t, (o) => { 34571 s[o.getInstanceId()] = o; 34572 }
34572), i && aa(null, i, (o) => { 34573 s[o.getInstanceId()] = null; 34574 }); 34575 const n = Object.values(s).filter((o) => o != null); 34576 e.context.destroyBeans(n); 34577} 34578function aM(e) { 34579 return e.getId().startsWith(Ky); 34580} 34581function vr(e) { 34582 return (typeof e == "string" ? e : "getColId" in e ? e.getColId() : e.colId)?.startsWith(QO) ?? !1; 34583} 34584function cv(e) { 34585 let t = []; 34586 return e instanceof Array ? t = e : typeof e == "string" && (t = e.split(",")), t; 34587} 34588function kX(e, t) { 34589 return tu(e, t, (i, s) => i.getColId() === s.getColId()); 34590} 34591function PX(e) { 34592 e.map = {}, e.list.forEach((t) => e.map[t.getId()] = t); 34593} 34594function cd(e) { 34595 return e === "gridOptionsUpdated" ? "gridOptionsChanged" : e; 34596} 34597function tN(e, t) { 34598 const i = e === t, s = e.getColDef() === t, n = e.getColId() == t; 34599 return i || s || n; 34600} 34601var FX = (e, t) => (i, s) => { 34602 const n = { 34603 value1: void 0, 34604 value2: void 0 34605 }; 34606 let o = !1; 34607 return e && (e[i] !== void 0 && (n.value1 = e[i], o = !0), Ie(s) && e[s] !== void 0 && (n.value2 = e[s], o = !0)), !o && t && (t[i] !== void 0 && (n.value1 = t[i]), Ie(s) && t[s] !== void 0 && (n.value2 = t[s])), n; 34608}; 34609function OX(e, t = null, i, s, n) { 34610 const o = new xX(), { existingCols: r, existingGroups: a, existingColKeys: l } = NX(s); 34611 o.addExistingKeys(l); 34612 const c = iN( 34613 e, 34614 t, 34615 0, 34616 i, 34617 r, 34618 o, 34619 a, 34620 n 34621 ), { colGroupSvc: u } = e, d = u?.findMaxDepth(c, 0) ?? 0, p = u ? u.balanceColumnTree(c, 0, d, o) : c; 34622 return aa(null, p, (m, y) => { 34623 js(m) && m.setupExpandable(), m.originalParent = y; 34624 }), { 34625 columnTree: p, 34626 treeDept: d 34627 }; 34628} 34629function NX(e) { 34630 const t = [], i = [], s = []; 34631 return e && aa(null, e, (n) => { 34632 if (js(n)) { 34633 const o = n; 34634 i.push(o); 34635 } else { 34636 const o = n; 34637 s.push(o.getId()), t.push(o); 34638 } 34639 }), { existingCols: t, existingGroups: i, existingColKeys: s }; 34640} 34641function iN(e, t, i, s, n, o, r, a) { 34642 if (!t) 34643 return []; 34644 const { colGroupSvc: l } = e, c = new Array(t.length); 34645 for (let u = 0; u < c.length; u++) { 34646 const d = t[u]; 34647 l && VX(d) ? c[u] = l.createProvidedColumnGroup( 34648 s, 34649 d, 34650 i, 34651 n, 34652 o, 34653 r, 34654 a 34655 ) : c[u] = _X(e, s, d, n, o, a); 34656 } 34657 return c; 34658} 34659function _X(e, t, i, s, n, o) { 34660 const r = GX(i, s); 34661 r && s?.splice(r.idx, 1); 34662 let a = r?.column; 34663 if (a) { 34664 const l = Zw(e, i, a.getColId()); 34665 a.setColDef(l, i, o), BX(e, a, l, o); 34666 } else { 34667 const l = n.getUniqueKey(i.colId, i.field), c = Zw(e, i, l); 34668 a = new rM(c, i, l, t), e.context.createBean(a); 34669 } 34670 return e.dataTypeSvc?.addColumnListeners(a), a; 34671} 34672function sN(e, t, i, s, n, o, r, a) { 34673 const { sortSvc: l, pinnedCols: c, colFlex: u } = e; 34674 i !== void 0 && t.setVisible(!i, a), l && (l.updateColSort(t, s, a), n !== void 0 && l.setColSortIndex(t, n)), o !== void 0 && c?.setColPinned(t, o), r !== void 0 && u?.setColFlex(t, r); 34675} 34676function BX(e, t, i, s) { 34677 sN( 34678 e, 34679 t, 34680 i.hide, 34681 i.sort, 34682 i.sortIndex, 34683 i.pinned, 34684 i.flex, 34685 s 34686 ); 34687 const n = t.getFlex(); 34688 if (!(n != null && n > 0)) 34689 if (i.width != null) 34690 t.setActualWidth(i.width, s); 34691 else { 34692 const o = t.getActualWidth(); 34693 t.setActualWidth(o, s); 34694 } 34695} 34696function GX(e, t) { 34697 if (t) 34698 for (let i = 0; i < t.length; i++) { 34699 const s = t[i].getUserProvidedColDef(); 34700 if (!s) 34701 continue; 34702 if (e.colId != null) { 34703 if (t[i].getId() === e.colId) 34704 return { idx: i, column: t[i] }; 34705 continue; 34706 } 34707 if (e.field != null) { 34708 if (s.field === e.field) 34709 return { idx: i, column: t[i] }; 34710 continue; 34711 } 34712 if (s === e) 34713 return { idx: i, column: t[i] }; 34714 } 34715} 34716function Zw(e, t, i, s) {
34717 const { gos: n, dataTypeSvc: o, validation: r } = e, a = {}, l = n.get("defaultColDef"); 34718 Ss(a, l, !1, !0); 34719 const c = zX(e, a, t, i); 34720 c && HX(e, c, a), Ss(a, t, !1, !0); 34721 const u = n.get("autoGroupColumnDef"), d = hr(n); 34722 return t.rowGroup && u && d && Ss( 34723 a, 34724 { sort: u.sort, initialSort: u.initialSort }, 34725 !1, 34726 !0 34727 ), o?.validateColDef(a), r?.validateColDef(a, i, s), a; 34728} 34729function zX(e, t, i, s) { 34730 const n = e.dataTypeSvc?.updateColDefAndGetColumnType(t, i, s), o = i.type ?? n ?? t.type; 34731 return t.type = o, o ? cv(o) : void 0; 34732} 34733function HX(e, t, i) { 34734 if (!t.length) 34735 return; 34736 const s = Object.assign({}, SX), n = e.gos.get("columnTypes") || {}; 34737 for (const [o, r] of Object.entries(n)) 34738 o in s ? Ae(34, { key: o }) : (r.type && Ae(35), s[o] = r); 34739 t.forEach((o) => { 34740 const r = s[o.trim()]; 34741 r ? Ss(i, r, !1, !0) : Ae(36, { t: o }); 34742 }); 34743} 34744function VX(e) { 34745 return e.children !== void 0; 34746} 34747function aa(e, t, i) { 34748 if (t) 34749 for (let s = 0; s < t.length; s++) { 34750 const n = t[s]; 34751 js(n) && aa(n, n.getChildren(), i), i(n, e); 34752 } 34753} 34754var UX = class extends he { 34755 constructor() { 34756 super(...arguments), this.beanName = "colModel", this.pivotMode = !1, this.ready = !1, this.changeEventsDispatching = !1; 34757 } 34758 postConstruct() { 34759 this.pivotMode = this.gos.get("pivotMode"), this.addManagedPropertyListeners( 34760 ["groupDisplayType", "treeData", "treeDataDisplayType", "groupHideOpenParents"], 34761 (e) => this.refreshAll(cd(e.source)) 34762 ), this.addManagedPropertyListeners( 34763 ["defaultColDef", "defaultColGroupDef", "columnTypes", "suppressFieldDotNotation"], 34764 (e) => this.recreateColumnDefs(cd(e.source)) 34765 ), this.addManagedPropertyListener( 34766 "pivotMode", 34767 (e) => this.setPivotMode(this.gos.get("pivotMode"), cd(e.source)) 34768 ); 34769 } 34770 // called from SyncService, when grid has finished initialising 34771 createColsFromColDefs(e) { 34772 const { beans: t } = this, { 34773 valueCache: i, 34774 colAutosize: s, 34775 rowGroupColsSvc: n, 34776 pivotColsSvc: o, 34777 valueColsSvc: r, 34778 visibleCols: a, 34779 colViewport: l, 34780 eventSvc: c 34781 } = t, u = this.colDefs ? ZO(t, e) : void 0; 34782 i?.expire(); 34783 const d = this.colDefCols?.list, p = this.colDefCols?.tree, f = OX(t, this.colDefs, !0, p, e); 34784 lv(t, this.colDefCols?.tree, f.columnTree); 34785 const m = f.columnTree, y = f.treeDept, b = eN(m), C = {}; 34786 b.forEach((w) => C[w.getId()] = w), this.colDefCols = { tree: m, treeDepth: y, list: b, map: C }, n?.extractCols(e, d), o?.extractCols(e, d), r?.extractCols(e, d), this.ready = !0, this.refreshCols(!0), a.refresh(e), l.checkViewportColumns(), c.dispatchEvent({ 34787 type: "columnEverythingChanged", 34788 source: e 34789 }), u && (this.changeEventsDispatching = !0, u(), this.changeEventsDispatching = !1), c.dispatchEvent({ 34790 type: "newColumnsLoaded", 34791 source: e 34792 }), e === "gridInitializing" && s?.applyAutosizeStrategy(); 34793 } 34794 // called from: buildAutoGroupColumns (events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents') 34795 // createColsFromColDefs (recreateColumnDefs, setColumnsDefs), 34796 // setPivotMode, applyColumnState, 34797 // functionColsService.setPrimaryColList, functionColsService.updatePrimaryColList, 34798 // pivotResultCols.setPivotResultCols 34799 refreshCols(e) { 34800 if (!this.colDefCols) 34801 return; 34802 const t = this.cols?.tree; 34803 this.saveColOrder(); 34804 const { 34805 autoColSvc: i, 34806 selectionColSvc: s, 34807 quickFilter: n, 34808 pivotResultCols: o, 34809 showRowGroupCols: r, 34810 rowAutoHeight: a, 34811 visibleCols: l, 34812 colViewport: c, 34813 eventSvc: u 34814 } = this.beans, d = this.selectCols(o, this.colDefCols); 34815 i?.createAutoCols(d, (m) => { 34816 this.lastOrder = m(this.lastOrder), this.lastPivotOrder = m(this.lastPivotOrder); 34817 }), i?.addAutoCols(d), s?.createSelectionCols(d, (m) => { 34818 this.lastOrder = m(this.lastOrder) ?? null, this.lastPivotOrder = m(this.lastPivotOrder) ?? null; 34819 }), s?.addSelectionCols(d); 34820 const p = JQ(this.gos, this.showingPivotResult); 34821 (!e || p) && this.restoreColOrder(d), this.positionLockedCols(d), r?.refresh(), n?.refreshCols(), this.setColSpanActive(), a?.setAutoHeightActive(d), l.clear(), c.clear(), !tu(t, this.cols.tree) && u.dispatchEvent({ 34822 type: "gridColumnsChanged" 34823 }); 34824 } 34825 selectCols(e, t) { 34826 const i = e?.getPivotResultCols() ?? null; 34827 this.showingPivotResult = i != null; 34828 const { map: s, list: n, tree: o, treeDepth: r } = i ?? t; 34829 return this.cols = { 34830 list: n.slice(), 34831 map: { ...s }, 34832 tree: o.slice(), 34833 treeDepth: r 34834 }, i && (i.list.some((l) => this.cols?.map[l.getColId()] !== void 0) || (this.lastPivotOrder = null)), this.cols; 34835 } 34836 getColsToShow() { 34837 if (!this.cols) 34838 return []; 34839 const e = this.isPivotMode() && !this.showingPivotResult, t = this.beans.valueColsSvc?.columns; 34840 return this.cols.list.filter((s) => { 34841 const n = aM(s); 34842 if (e) { 34843 const o = t?.includes(s); 34844 return n || o; 34845 } else 34846 return n || s.isVisible(); 34847 }); 34848 } 34849 // on events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents' 34850 refreshAll(e) { 34851 this.ready && (this.refreshCols(!1), this.beans.visibleCols.refresh(e)); 34852 } 34853 setColsVisible(e, t = !1, i) { 34854 Wo( 34855 this.beans, 34856 { 34857 state: e.map((s) => ({ 34858 colId: typeof s == "string" ? s : s.getColId(), 34859 hide: !t 34860 })) 34861 }, 34862 i 34863 ); 34864 } 34865 restoreColOrder(e) { 34866 const t = this.showingPivotResult ? this.lastPivotOrder : this.lastOrder; 34867 if (!t) 34868 return; 34869 const i = new Map(t.map((c, u) => [c, u])); 34870 if (!e.list.some((c) => i.has(c))) 34871 return; 34872 const n = new Map(e.list.map((c) => [c, !0])), o = t.filter((c) => n.has(c)), r = new Map(o.map((c) => [c, !0])), a = e.list.filter((c) => !r.has(c)), l = o.slice(); 34873 a.forEach((c) => { 34874 let u = c.getOriginalParent(); 34875 if (!u) { 34876 l.push(c); 34877 return; 34878 } 34879 const d = []; 34880 for (; !d.length && u; )
34881 u.getLeafColumns().forEach((y) => { 34882 const b = l.indexOf(y) >= 0, C = d.indexOf(y) < 0; 34883 b && C && d.push(y); 34884 }), u = u.getOriginalParent(); 34885 if (!d.length) { 34886 l.push(c); 34887 return; 34888 } 34889 const p = d.map((m) => l.indexOf(m)), f = Math.max(...p); 34890 l.splice(f + 1, 0, c); 34891 }), e.list = l; 34892 } 34893 positionLockedCols(e) { 34894 e.list = jO(e.list, this.gos); 34895 } 34896 saveColOrder() { 34897 this.showingPivotResult ? this.lastPivotOrder = this.cols?.list ?? null : this.lastOrder = this.cols?.list ?? null; 34898 } 34899 getColumnDefs() { 34900 return this.colDefCols ? this.beans.colDefFactory?.getColumnDefs( 34901 this.colDefCols.list, 34902 this.showingPivotResult, 34903 this.lastOrder, 34904 this.cols?.list ?? [] 34905 ) : void 0; 34906 } 34907 setColSpanActive() { 34908 this.colSpanActive = !!this.cols?.list.some((e) => e.getColDef().colSpan != null); 34909 } 34910 isPivotMode() { 34911 return this.pivotMode; 34912 } 34913 setPivotMode(e, t) { 34914 if (e === this.pivotMode || (this.pivotMode = e, !this.ready)) 34915 return; 34916 this.refreshCols(!1); 34917 const { visibleCols: i, eventSvc: s } = this.beans; 34918 i.refresh(t), s.dispatchEvent({ 34919 type: "columnPivotModeChanged" 34920 }); 34921 } 34922 // + clientSideRowModel 34923 isPivotActive() { 34924 const e = this.beans.pivotColsSvc?.columns; 34925 return this.pivotMode && !!e?.length; 34926 } 34927 // called when dataTypes change 34928 recreateColumnDefs(e) { 34929 this.cols && (this.beans.autoColSvc?.updateAutoCols(e), this.createColsFromColDefs(e)); 34930 } 34931 setColumnDefs(e, t) { 34932 this.colDefs = e, this.createColsFromColDefs(t); 34933 } 34934 destroy() { 34935 lv(this.beans, this.colDefCols?.tree), super.destroy(); 34936 } 34937 getColTree() { 34938 return this.cols?.tree ?? []; 34939 } 34940 // + columnSelectPanel 34941 getColDefColTree() { 34942 return this.colDefCols?.tree ?? []; 34943 } 34944 // + clientSideRowController -> sorting, building quick filter text 34945 // + headerRenderer -> sorting (clearing icon) 34946 getColDefCols() { 34947 return this.colDefCols?.list ?? null; 34948 } 34949 // + moveColumnController 34950 getCols() { 34951 return this.cols?.list ?? []; 34952 } 34953 // returns colDefCols, pivotResultCols and autoCols 34954 getAllCols() { 34955 const { pivotResultCols: e, autoColSvc: t, selectionColSvc: i } = this.beans, s = e?.getPivotResultCols()?.list; 34956 return [ 34957 this.colDefCols?.list ?? [], 34958 t?.autoCols?.list ?? [], 34959 i?.selectionCols?.list ?? [], 34960 s ?? [] 34961 ].flat(); 34962 } 34963 getColsForKeys(e) { 34964 return e ? e.map((t) => this.getCol(t)).filter((t) => t != null) : []; 34965 } 34966 getColDefCol(e) { 34967 return this.colDefCols?.list ? this.getColFromCollection(e, this.colDefCols) : null; 34968 } 34969 getCol(e) { 34970 return e == null ? null : this.getColFromCollection(e, this.cols); 34971 } 34972 getColFromCollection(e, t) { 34973 if (t == null) 34974 return null; 34975 const { map: i, list: s } = t; 34976 if (typeof e == "string" && i[e]) 34977 return i[e]; 34978 for (let n = 0; n < s.length; n++) 34979 if (tN(s[n], e)) 34980 return s[n]; 34981 return this.beans.autoColSvc?.getAutoCol(e) ?? null; 34982 } 34983}, nN = class { 34984 constructor() { 34985 this.existingIds = {}; 34986 } 34987 getInstanceIdForKey(e) { 34988 const t = this.existingIds[e]; 34989 let i; 34990 return typeof t != "number" ? i = 0 : i = t + 1, this.existingIds[e] = i, i; 34991 } 34992}; 34993function Dg(e, t, i) { 34994 return i && e.addDestroyFunc(() => t.destroyBean(i)), i ?? e; 34995} 34996var WX = class { 34997 constructor(e) { 34998 this.cssClassStates = {}, this.getGui = e; 34999 } 35000 addCssClass(e) { 35001 this.addOrRemoveCssClass(e, !0); 35002 } 35003 removeCssClass(e) { 35004 this.addOrRemoveCssClass(e, !1); 35005 } 35006 containsCssClass(e) { 35007 const t = this.getGui(); 35008 return t ? t.classList.contains(e) : !1; 35009 } 35010 addOrRemoveCssClass(e, t) { 35011 if (!e) 35012 return; 35013 if (e.indexOf(" ") >= 0) { 35014 const s = (e || "").split(" "); 35015 if (s.length > 1) { 35016 s.forEach((n) => this.addOrRemoveCssClass(n, t)); 35017 return; 35018 } 35019 } 35020 if (this.cssClassStates[e] !== t && e.length) { 35021 const s = this.getGui(); 35022 s && s.classList.toggle(e, t), this.cssClassStates[e] = t; 35023 } 35024 } 35025}, jX = 0, Pe = null, Tt = class extends he {
35026 constructor(e, t) { 35027 super(), this.suppressDataRefValidation = !1, this.displayed = !0, this.visible = !0, this.compId = jX++, this.cssClassManager = new WX(() => this.eGui), this.componentSelectors = new Map((t ?? []).map((i) => [i.selector, i])), e && this.setTemplate(e); 35028 } 35029 preConstruct() { 35030 this.wireTemplate(this.getGui()); 35031 const e = "component-" + Object.getPrototypeOf(this)?.constructor?.name; 35032 this.css?.forEach((t) => this.beans.environment.addGlobalCSS(t, e)); 35033 } 35034 wireTemplate(e, t) { 35035 e && this.gos && (this.applyElementsToComponent(e), this.createChildComponentsFromTags(e, t)); 35036 } 35037 getCompId() { 35038 return this.compId; 35039 } 35040 getDataRefAttribute(e) { 35041 return e.getAttribute ? e.getAttribute("data-ref") : null; 35042 } 35043 applyElementsToComponent(e, t, i, s = null) { 35044 if (t === void 0 && (t = this.getDataRefAttribute(e)), t) { 35045 const n = this[t]; 35046 if (n === Pe) 35047 this[t] = s ?? e; 35048 else { 35049 const o = i && i[t]; 35050 if (!this.suppressDataRefValidation && !o) 35051 throw new Error(`data-ref: ${t} on ${this.constructor.name} with ${n}`); 35052 } 35053 } 35054 } 35055 // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag 35056 createChildComponentsFromTags(e, t) { 35057 VQ(e.childNodes).forEach((s) => { 35058 if (!(s instanceof HTMLElement)) 35059 return; 35060 const n = this.createComponentFromElement( 35061 s, 35062 (o) => { 35063 o.getGui() && this.copyAttributesFromNode(s, o.getGui()); 35064 }, 35065 t 35066 ); 35067 if (n) { 35068 if (n.addItems && s.children.length) { 35069 this.createChildComponentsFromTags(s, t); 35070 const o = Array.prototype.slice.call(s.children); 35071 n.addItems(o); 35072 } 35073 this.swapComponentForNode(n, e, s); 35074 } else s.childNodes && this.createChildComponentsFromTags(s, t); 35075 }); 35076 } 35077 createComponentFromElement(e, t, i) { 35078 const s = e.nodeName, n = this.getDataRefAttribute(e), o = s.indexOf("AG-") === 0, r = o ? this.componentSelectors.get(s) : null; 35079 let a = null; 35080 if (r) { 35081 const l = i && n ? i[n] : void 0; 35082 a = new r.component(l), a.setParentComponent(this), this.createBean(a, null, t); 35083 } else if (o) 35084 throw new Error(`selector: ${s}`); 35085 return this.applyElementsToComponent(e, n, i, a), a; 35086 } 35087 copyAttributesFromNode(e, t) { 35088 UQ(e.attributes, (i, s) => t.setAttribute(i, s)); 35089 } 35090 swapComponentForNode(e, t, i) { 35091 const s = e.getGui(); 35092 t.replaceChild(s, i), t.insertBefore(document.createComment(i.nodeName), s), this.addDestroyFunc(this.destroyBean.bind(this, e)); 35093 } 35094 activateTabIndex(e) { 35095 const t = this.gos.get("tabIndex"); 35096 e || (e = []), e.length || e.push(this.getGui()), e.forEach((i) => i.setAttribute("tabindex", t.toString())); 35097 } 35098 setTemplate(e, t, i) { 35099 const s = $p(e); 35100 this.setTemplateFromElement(s, t, i); 35101 } 35102 setTemplateFromElement(e, t, i, s = !1) { 35103 if (this.eGui = e, this.suppressDataRefValidation = s, t) 35104 for (let n = 0; n < t.length; n++) { 35105 const o = t[n]; 35106 this.componentSelectors.set(o.selector, o); 35107 } 35108 this.wireTemplate(e, i); 35109 } 35110 getGui() { 35111 return this.eGui; 35112 } 35113 getFocusableElement() { 35114 return this.eGui; 35115 } 35116 getAriaElement() { 35117 return this.getFocusableElement(); 35118 } 35119 setParentComponent(e) { 35120 this.parentComponent = e; 35121 } 35122 getParentComponent() { 35123 return this.parentComponent; 35124 } 35125 // this method is for older code, that wants to provide the gui element, 35126 // it is not intended for this to be in ag-Stack 35127 setGui(e) { 35128 this.eGui = e; 35129 } 35130 queryForHtmlElement(e) { 35131 return this.eGui.querySelector(e); 35132 } 35133 getContainerAndElement(e, t) { 35134 let i = t; 35135 return e == null ? null : (i || (i = this.eGui), tM(e) ? { 35136 element: e, 35137 parent: i 35138 } : { 35139 element: e.getGui(), 35140 parent: i 35141 }); 35142 } 35143 prependChild(e, t) { 35144 const { element: i, parent: s } = this.getContainerAndElement(e, t) || {}; 35145 !i || !s || s.insertAdjacentElement("afterbegin", i); 35146 } 35147 appendChild(e, t) { 35148 const { element: i, parent: s } = this.getContainerAndElement(e, t) || {}; 35149 !i || !s || s.appendChild(i); 35150 } 35151 isDisplayed() { 35152 return this.displayed; 35153 } 35154 setVisible(e, t = {}) { 35155 if (e !== this.visible) { 35156 this.visible = e; 35157 const { skipAriaHidden: i } = t; 35158 _Q(this.eGui, e, { skipAriaHidden: i }); 35159 } 35160 } 35161 setDisplayed(e, t = {}) { 35162 if (e !== this.displayed) { 35163 this.displayed = e; 35164 const { skipAriaHidden: i } = t; 35165 ui(this.eGui, e, { skipAriaHidden: i }); 35166 const s = { 35167 type: "displayChanged", 35168 visible: this.displayed 35169 }; 35170 this.dispatchLocalEvent(s); 35171 } 35172 } 35173 destroy() { 35174 this.parentComponent && (this.parentComponent = void 0), super.destroy(); 35175 } 35176 addGuiEventListener(e, t, i) { 35177 this.eGui.addEventListener(e, t, i), this.addDestroyFunc(() => this.eGui.removeEventListener(e, t)); 35178 } 35179 addCssClass(e) { 35180 this.cssClassManager.addCssClass(e); 35181 } 35182 removeCssClass(e) { 35183 this.cssClassManager.removeCssClass(e); 35184 } 35185 containsCssClass(e) { 35186 return this.cssClassManager.containsCssClass(e); 35187 } 35188 addOrRemoveCssClass(e, t) { 35189 this.cssClassManager.addOrRemoveCssClass(e, t); 35190 } 35191 registerCSS(e) { 35192 this.css || (this.css = []), this.css.push(e); 35193 } 35194}, gn = class Uh { 35195 constructor(t) { 35196 this.status = 0, this.resolution = null, this.waiters = [], t( 35197 (i) => this.onDone(i), 35198 (i) => this.onReject(i) 35199 ); 35200 } 35201 static all(t) { 35202 return t.length ? new Uh((i) => { 35203 let s = t.length; 35204 const n = new Array(s); 35205 t.forEach((o, r) => { 35206 o.then((a) => { 35207 n[r] = a, s--, s === 0 && i(n); 35208 }); 35209 }); 35210 }) : Uh.resolve(); 35211 } 35212 static resolve(t = null) { 35213 return new Uh((i) => i(t)); 35214 } 35215 then(t) { 35216 return new Uh((i) => { 35217 this.status === 1 ? i(t(this.resolution)) : this.waiters.push((s) => i(t(s))); 35218 }); 35219 } 35220 onDone(t) {
35221 this.status = 1, this.resolution = t, this.waiters.forEach((i) => i(t)); 35222 } 35223 onReject(t) { 35224 } 35225}; 35226function $X(e) { 35227 return e ? e.prototype && "getGui" in e.prototype : !1; 35228} 35229function oN(e, t, i, s) { 35230 const { name: n } = i; 35231 let o, r, a, l, c, u; 35232 if (t) { 35233 const d = t, p = d[n + "Selector"], f = p ? p(s) : null, m = (y) => { 35234 typeof y == "string" ? o = y : y != null && y !== !0 && (e.isFrameworkComponent(y) ? a = y : r = y); 35235 }; 35236 f ? (m(f.component), l = f.params, c = f.popup, u = f.popupPosition) : m(d[n]); 35237 } 35238 return { compName: o, jsComp: r, fwComp: a, paramsFromSelector: l, popupFromSelector: c, popupPositionFromSelector: u }; 35239} 35240var YX = class extends he { 35241 constructor() { 35242 super(...arguments), this.beanName = "userCompFactory"; 35243 } 35244 wireBeans(e) { 35245 this.agCompUtils = e.agCompUtils, this.registry = e.registry, this.frameworkCompWrapper = e.frameworkCompWrapper, this.gridOptions = e.gridOptions; 35246 } 35247 getCompDetailsFromGridOptions(e, t, i, s = !1) { 35248 return this.getCompDetails(this.gridOptions, e, t, i, s); 35249 } 35250 getCompDetails(e, t, i, s, n = !1) { 35251 const { name: o, cellRenderer: r } = t; 35252 let { compName: a, jsComp: l, fwComp: c, paramsFromSelector: u, popupFromSelector: d, popupPositionFromSelector: p } = oN(this.beans.frameworkOverrides, e, t, s), f; 35253 const m = (w) => { 35254 const M = this.registry.getUserComponent(o, w); 35255 M && (l = M.componentFromFramework ? void 0 : M.component, c = M.componentFromFramework ? M.component : void 0, f = M.params); 35256 }; 35257 if (a != null && m(a), l == null && c == null && i != null && m(i), l && r && !$X(l) && (l = this.agCompUtils?.adaptFunction(t, l)), !l && !c) { 35258 const { validation: w } = this.beans; 35259 n && (a !== i || !i) ? a ? w?.isProvidedUserComp(a) || Rt(50, { compName: a }) : i ? w || Rt(260, { 35260 ...this.gos.getModuleErrorParams(), 35261 propName: o, 35262 compName: i 35263 }) : Rt(216, { name: o }) : i && !w && Rt(146, { comp: i }); 35264 return; 35265 }
35266 const y = this.mergeParams(e, t, s, u, f), b = l == null, C = l ?? c; 35267 return { 35268 componentFromFramework: b, 35269 componentClass: C, 35270 params: y, 35271 type: t, 35272 popupFromSelector: d, 35273 popupPositionFromSelector: p, 35274 newAgStackInstance: () => this.newAgStackInstance(C, b, y, t) 35275 }; 35276 } 35277 newAgStackInstance(e, t, i, s) { 35278 const n = !t; 35279 let o; 35280 n ? o = new e() : o = this.frameworkCompWrapper.wrap( 35281 e, 35282 s.mandatoryMethods, 35283 s.optionalMethods, 35284 s 35285 ), this.createBean(o); 35286 const r = o.init?.(i); 35287 return r == null ? gn.resolve(o) : r.then(() => o); 35288 } 35289 /** 35290 * merges params with application provided params 35291 * used by Floating Filter 35292 */ 35293 mergeParams(e, t, i, s = null, n) { 35294 const o = this.gos.getGridCommonParams(); 35295 Ss(o, i), n && Ss(o, n); 35296 const r = e, a = r && r[t.name + "Params"]; 35297 if (typeof a == "function") { 35298 const l = a(i); 35299 Ss(o, l); 35300 } else typeof a == "object" && Ss(o, a); 35301 return Ss(o, s), o; 35302 } 35303}, KX = { 35304 name: "dateComponent", 35305 mandatoryMethods: ["getDate", "setDate"], 35306 optionalMethods: ["afterGuiAttached", "setInputPlaceholder", "setInputAriaLabel", "setDisabled", "refresh"] 35307}, ZX = { 35308 name: "dragAndDropImageComponent", 35309 mandatoryMethods: ["setIcon", "setLabel"] 35310}, qX = { name: "headerComponent", optionalMethods: ["refresh"] }, QX = { name: "innerHeaderComponent" }, XX = { name: "innerHeaderGroupComponent" }, JX = { name: "headerGroupComponent" }, eJ = { 35311 name: "cellRenderer", 35312 optionalMethods: ["refresh", "afterGuiAttached"], 35313 cellRenderer: !0 35314}, tJ = { name: "loadingCellRenderer", cellRenderer: !0 }, iJ = { 35315 name: "cellEditor", 35316 mandatoryMethods: ["getValue"], 35317 optionalMethods: [ 35318 "isPopup", 35319 "isCancelBeforeStart", 35320 "isCancelAfterEnd", 35321 "getPopupPosition", 35322 "focusIn", 35323 "focusOut", 35324 "afterGuiAttached", 35325 "refresh" 35326 ] 35327}, sJ = { name: "loadingOverlayComponent", optionalMethods: ["refresh"] }, nJ = { name: "noRowsOverlayComponent", optionalMethods: ["refresh"] }, oJ = { name: "tooltipComponent" }, lM = { 35328 name: "filter", 35329 mandatoryMethods: ["isFilterActive", "doesFilterPass", "getModel", "setModel"], 35330 optionalMethods: [ 35331 "afterGuiAttached", 35332 "afterGuiDetached", 35333 "onNewRowsLoaded", 35334 "getModelAsString", 35335 "onFloatingFilterChanged", 35336 "onAnyFilterChanged", 35337 "refresh" 35338 ] 35339}, rJ = { 35340 name: "floatingFilterComponent", 35341 mandatoryMethods: ["onParentModelChanged"], 35342 optionalMethods: ["afterGuiAttached", "refresh"] 35343}, aJ = { 35344 name: "fullWidthCellRenderer", 35345 optionalMethods: ["refresh", "afterGuiAttached"], 35346 cellRenderer: !0 35347}, lJ = { name: "loadingCellRenderer", cellRenderer: !0 }, cJ = { 35348 name: "groupRowRenderer", 35349 optionalMethods: ["afterGuiAttached"], 35350 cellRenderer: !0 35351}, uJ = { name: "detailCellRenderer", optionalMethods: ["refresh"], cellRenderer: !0 }; 35352function dJ(e, t) { 35353 return e.getCompDetailsFromGridOptions(ZX, "agDragAndDropImage", t, !0); 35354} 35355function hJ(e, t, i) { 35356 return e.getCompDetails(t, qX, "agColumnHeader", i); 35357} 35358function pJ(e, t, i) { 35359 return e.getCompDetails(t, QX, void 0, i); 35360} 35361function gJ(e, t) { 35362 const i = t.columnGroup.getColGroupDef(); 35363 return e.getCompDetails(i, JX, "agColumnGroupHeader", t); 35364} 35365function fJ(e, t, i) { 35366 return e.getCompDetails(t, XX, void 0, i); 35367} 35368function mJ(e, t) { 35369 return e.getCompDetailsFromGridOptions(aJ, void 0, t, !0); 35370} 35371function vJ(e, t) { 35372 return e.getCompDetailsFromGridOptions(lJ, "agLoadingCellRenderer", t, !0); 35373} 35374function yJ(e, t) { 35375 return e.getCompDetailsFromGridOptions(cJ, "agGroupRowRenderer", t, !0); 35376} 35377function CJ(e, t) { 35378 return e.getCompDetailsFromGridOptions(uJ, "agDetailCellRenderer", t, !0); 35379} 35380function bJ(e, t, i) { 35381 return e.getCompDetails(t, eJ, void 0, i); 35382} 35383function wJ(e, t, i) { 35384 return e.getCompDetails(t, tJ, "agSkeletonCellRenderer", i, !0); 35385} 35386function $R(e, t, i) { 35387 return e.getCompDetails(t, iJ, "agCellEditor", i, !0); 35388} 35389function SJ(e, t, i, s) { 35390 return e.getCompDetails(t, lM, s, i, !0); 35391} 35392function xJ(e, t) { 35393 return e.getCompDetailsFromGridOptions(KX, "agDateInput", t, !0); 35394} 35395function MJ(e, t) {
35396 return e.getCompDetailsFromGridOptions(sJ, "agLoadingOverlay", t, !0); 35397} 35398function AJ(e, t) { 35399 return e.getCompDetailsFromGridOptions(nJ, "agNoRowsOverlay", t, !0); 35400} 35401function DJ(e, t) { 35402 return e.getCompDetails(t.colDef, oJ, "agTooltipComponent", t, !0); 35403} 35404function EJ(e, t, i, s) { 35405 return e.getCompDetails(t, rJ, s, i); 35406} 35407function IJ(e, t) { 35408 return oN(e, t, lM); 35409} 35410function RJ(e, t, i) { 35411 return e.mergeParams(t, lM, i); 35412} 35413function Qp(e) { 35414 const t = e; 35415 return t != null && t.getFrameworkComponentInstance != null ? t.getFrameworkComponentInstance() : e; 35416} 35417var rN = /* @__PURE__ */ new Set(), uv = {}, ud = {}, ym, aN = !1; 35418function TJ(e) { 35419 const [t, i] = e.version.split(".") || [], [s, n] = ym.split(".") || []; 35420 return t === s && i === n; 35421} 35422function LJ(e) { 35423 ym || (ym = e.version); 35424 const t = (i) => `You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${i} Please update all modules to the same version.`; 35425 if (e.version ? TJ(e) || rd( 35426 t( 35427 `'${e.moduleName}' is version ${e.version} but the other modules are version ${ym}.` 35428 ) 35429 ) : rd(t(`'${e.moduleName}' is incompatible.`)), e.validate) { 35430 const i = e.validate(); 35431 i.isValid || rd(`${i.message}`); 35432 } 35433} 35434function Xp(e, t) { 35435 LJ(e); 35436 const i = e.rowModels ?? ["all"]; 35437 rN.add(e); 35438 let s; 35439 t !== void 0 ? (aN = !0, ud[t] === void 0 && (ud[t] = {}), s = ud[t]) : s = uv, i.forEach((n) => { 35440 s[n] === void 0 && (s[n] = {}), s[n][e.moduleName] = e; 35441 }), e.dependsOn && e.dependsOn.forEach((n) => Xp(n, t)); 35442} 35443function kJ(e) { 35444 delete ud[e]; 35445} 35446function lN(e, t, i) { 35447 const s = (n) => !!uv[n]?.[e] || !!ud[t]?.[n]?.[e]; 35448 return s(i) || s("all"); 35449} 35450function cM() { 35451 return aN; 35452} 35453function PJ(e, t) { 35454 const i = ud[e] ?? {}; 35455 return [ 35456 ...Object.values(uv.all ?? {}), 35457 ...Object.values(i.all ?? {}), 35458 ...Object.values(uv[t] ?? {}), 35459 ...Object.values(i[t] ?? {}) 35460 ]; 35461} 35462function FJ() { 35463 return new Set(rN); 35464} 35465var uM = class { 35466 /** 35467 * @deprecated v33 Use `registerModules([module])` instead. 35468 */ 35469 static register(e) { 35470 Xp(e, void 0); 35471 } 35472 /** 35473 * Globally register the given modules for all grids. 35474 * @param modules - modules to register 35475 */ 35476 static registerModules(e) { 35477 e.forEach((t) => Xp(t, void 0)); 35478 } 35479}, OJ = class { 35480 constructor(e) { 35481 this.beans = {}, this.createdBeans = [], this.destroyed = !1, !(!e || !e.beanClasse
35481s) && (this.beanDestroyComparator = e.beanDestroyComparator, this.init(e)); 35482 } 35483 init(e) { 35484 Object.entries(e.providedBeanInstances).forEach(([t, i]) => { 35485 this.beans[t] = i; 35486 }), e.beanClasses.forEach((t) => { 35487 const i = new t(); 35488 i.beanName ? this.beans[i.beanName] = i : console.error(`Bean ${t.name} is missing beanName`), this.createdBeans.push(i); 35489 }), e.derivedBeans?.forEach((t) => { 35490 const { beanName: i, bean: s } = t(this); 35491 this.beans[i] = s, this.createdBeans.push(s); 35492 }), e.beanInitComparator && this.createdBeans.sort(e.beanInitComparator), this.initBeans(this.createdBeans); 35493 } 35494 getBeanInstances() { 35495 return Object.values(this.beans); 35496 } 35497 createBean(e, t) { 35498 if (!e) 35499 throw Error("null bean"); 35500 return this.initBeans([e], t), e; 35501 } 35502 initBeans(e, t) { 35503 e.forEach((i) => { 35504 i.preWireBeans?.(this.beans), i.wireBeans?.(this.beans); 35505 }), e.forEach((i) => i.preConstruct?.()), t && e.forEach(t), e.forEach((i) => i.postConstruct?.()); 35506 } 35507 getBeans() { 35508 return this.beans; 35509 } 35510 getBean(e) { 35511 return this.beans[e]; 35512 } 35513 destroy() { 35514 if (this.destroyed) 35515 return; 35516 this.destroyed = !0; 35517 const e = this.getBeanInstances(); 35518 this.beanDestroyComparator && e.sort(this.beanDestroyComparator), this.destroyBeans(e), this.beans = {}, this.createdBeans = []; 35519 } 35520 /** 35521 * Destroys a bean and returns undefined to support destruction and clean up in a single line. 35522 * this.dateComp = this.context.destroyBean(this.dateComp); 35523 */ 35524 destroyBean(e) { 35525 e?.destroy?.(); 35526 } 35527 /** 35528 * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line. 35529 * this.dateComps = this.context.destroyBeans(this.dateComps); 35530 */ 35531 destroyBeans(e) { 35532 if (e) 35533 for (let t = 0; t < e.length; t++) 35534 this.destroyBean(e[t]); 35535 return []; 35536 } 35537 isDestroyed() { 35538 return this.destroyed; 35539 } 35540}, NJ = class extends OJ { 35541 init(e) { 35542 this.gridId = e.gridId, this.beans.context = this, this.destroyCallback = e.destroyCallback, super.init(e); 35543 } 35544 destroy() { 35545 super.destroy(), kJ(this.gridId), this.destroyCallback?.(); 35546 } 35547 getGridId() { 35548 return this.gridId; 35549 } 35550}, _J = "ag-column-first", BJ = "ag-column-last"; 35551function cN(e, t, i, s) { 35552 return ai(e) ? [] : zJ(e.headerClass, e, t, i, s); 35553} 35554function uN(e, t, i) { 35555 e.addOrRemoveCssClass(_J, i.isColAtEdge(t, "first")), e.addOrRemoveCssClass(BJ, i.isColAtEdge(t, "last")); 35556} 35557function GJ(e, t, i, s) { 35558 return t.addGridCommonParams({ 35559 // bad naming, as colDef here can be a group or a column, 35560 // however most people won't appreciate the difference, 35561 // so keeping it as colDef to avoid confusion. 35562 colDef: e, 35563 column: i, 35564 columnGroup: s 35565 }); 35566} 35567function zJ(e, t, i, s, n) { 35568 if (ai(e)) 35569 return []; 35570 let o; 35571 if (typeof e == "function") { 35572 const r = GJ(t, i, s, n); 35573 o = e(r); 35574 } else 35575 o = e; 35576 return typeof o == "string" ? [o] : Array.isArray(o) ? [...o] : []; 35577} 35578function Hl(e, t) { 35579 const i = FO(e); 35580 i.requestAnimationFrame ? i.requestAnimationFrame(t) : i.webkitRequestAnimationFrame ? i.webkitRequestAnimationFrame(t) : i.setTimeout(t, 0); 35581} 35582var HJ = class extends he { 35583 constructor() { 35584 super(...arguments), this.beanName = "animationFrameSvc", this.createTasksP1 = { list: [], sorted: !1 }, this.createTasksP2 = { list: [], sorted: !1 }, this.destroyTasks = [], this.ticking = !1, this.scrollGoingDown = !0, this.lastPage = 0, this.lastScrollTop = 0, this.taskCount = 0, this.cancelledTasks = /* @__PURE__ */ new Set(); 35585 } 35586 setScrollTop(e) { 35587 const { gos: t, pagination: i } = this.beans, s = t.get("pagination"); 35588 if (this.scrollGoingDown = e >= this.lastScrollTop, s && e === 0) { 35589 const n = i?.getCurrentPage() ?? 0; 35590 n !== this.lastPage && (this.lastPage = n, this.scrollGoingDown = !0); 35591 } 35592 this.lastScrollTop = e; 35593 } 35594 postConstruct() { 35595 this.active = !this.gos.get("suppressAnimationFrame"); 35596 } 35597 // this method is for our AG Grid sanity only - if animation frames are turned off, 35598 // then no place in the code should be looking to add any work to be done in animation 35599 // frames. this stops bugs - where some code is asking for a frame to be executed 35600 // when it should not. 35601 verifyAnimationFrameOn(e) { 35602 this.active === !1 && Ae(92, { methodName: e }); 35603 } 35604 createTask(e, t, i) { 35605 this.verifyAnimationFrameOn(i);
35606 const s = { task: e, index: t, createOrder: ++this.taskCount }; 35607 this.addTaskToList(this[i], s), this.schedule(); 35608 } 35609 cancelTask(e) { 35610 this.cancelledTasks.add(e); 35611 } 35612 addTaskToList(e, t) { 35613 e.list.push(t), e.sorted = !1; 35614 } 35615 sortTaskList(e) { 35616 if (e.sorted) 35617 return; 35618 const t = this.scrollGoingDown ? 1 : -1; 35619 e.list.sort( 35620 (i, s) => i.index !== s.index ? t * (s.index - i.index) : s.createOrder - i.createOrder 35621 ), e.sorted = !0; 35622 } 35623 addDestroyTask(e) { 35624 this.verifyAnimationFrameOn("createTasksP3"), this.destroyTasks.push(e), this.schedule(); 35625 } 35626 executeFrame(e) { 35627 this.verifyAnimationFrameOn("executeFrame"); 35628 const t = this.createTasksP1, i = t.list, s = this.createTasksP2, n = s.list, o = this.destroyTasks, r = (/* @__PURE__ */ new Date()).getTime(); 35629 let a = (/* @__PURE__ */ new Date()).getTime() - r; 35630 const l = e <= 0, c = this.beans.ctrlsSvc.getScrollFeature(); 35631 for (; l || a < e; ) { 35632 if (!c.scrollGridIfNeeded()) { 35633 let d; 35634 if (i.length) 35635 this.sortTaskList(t), d = i.pop().task; 35636 else if (n.length) 35637 this.sortTaskList(s), d = n.pop().task; 35638 else if (o.length) 35639 d = o.pop(); 35640 else { 35641 this.cancelledTasks.clear(); 35642 break; 35643 } 35644 this.cancelledTasks.has(d) || d(); 35645 } 35646 a = (/* @__PURE__ */ new Date()).getTime() - r; 35647 } 35648 i.length || n.length || o.length ? this.requestFrame() : this.ticking = !1; 35649 } 35650 flushAllFrames() { 35651 this.active && this.executeFrame(-1); 35652 } 35653 schedule() { 35654 this.active && (this.ticking || (this.ticking = !0, this.requestFrame())); 35655 } 35656 requestFrame() { 35657 const e = this.executeFrame.bind(this, 60); 35658 Hl(this.beans, e); 35659 } 35660 isQueueEmpty() { 35661 return !this.ticking; 35662 } 35663}, de = { 35664 BACKSPACE: "Backspace", 35665 TAB: "Tab", 35666 ENTER: "Enter", 35667 ESCAPE: "Escape", 35668 SPACE: " ", 35669 LEFT: "ArrowLeft", 35670 UP: "ArrowUp", 35671 RIGHT: "ArrowRight", 35672 DOWN: "ArrowDown", 35673 DELETE: "Delete", 35674 F2: "F2", 35675 PAGE_UP: "PageUp", 35676 PAGE_DOWN: "PageDown", 35677 PAGE_HOME: "Home", 35678 PAGE_END: "End", 35679 // these should be used with `event.code` instead of `event.key` 35680 // as `event.key` changes when non-latin keyboards are used 35681 A: "KeyA", 35682 C: "KeyC", 35683 D: "KeyD", 35684 V: "KeyV", 35685 X: "KeyX", 35686 Y: "KeyY", 35687 Z: "KeyZ" 35688}, qw = !1, dv = 0; 35689function VJ(e) { 35690 dv > 0 || (e.addEventListener("keydown", hv), e.addEventListener("mousedown", hv)); 35691} 35692function UJ(e) { 35693 dv > 0 || (e.removeEventListener("keydown", hv), e.removeEventListener("mousedown", hv)); 35694} 35695function hv(e) { 35696 const t = qw, i = e.type === "keydown"; 35697 i && (e.ctrlKey || e.metaKey || e.altKey) || t !== i && (qw = i); 35698} 35699function WJ(e) { 35700 const t = Ei(e); 35701 return VJ(t), dv++, () => { 35702 dv--, UJ(t); 35703 }; 35704} 35705function jJ() { 35706 return qw; 35707} 35708function $J(e, t, i) { 35709 t.addManagedElementListeners(i, { 35710 keydown: (s) => { 35711 if (!s.defaultPrevented && s.key === de.TAB) { 35712 const n = s.shiftKey; 35713 iu(e, i, !1, n) || Id(e, n) && s.preventDefault(); 35714 } 35715 } 35716 }); 35717} 35718function dd(e, t, i = !1) { 35719 const s = NQ; 35720 let n = yO; 35721 t && (n += ", " + t), i && (n += ', [tabindex="-1"]'); 35722 const o = Array.prototype.slice.apply(e.querySelectorAll(s)).filter((l) => Yo(l)), r = Array.prototype.slice.apply(e.querySelectorAll(n)); 35723 return r.length ? ((l, c) => l.filter((u) => c.indexOf(u) === -1))(o, r) : o; 35724} 35725function Gc(e, t = !1, i = !1) { 35726 const s = dd(e, null, i), n = t ? It(s) : s[0]; 35727 return n ? (n.focus({ preventScroll: !0 }), !0) : !1; 35728} 35729function iu(e, t, i, s) { 35730 const n = dd(t, i ? ':not([tabindex="-1"])' : null), o = gi(e); 35731 let r; 35732 i ? r = n.findIndex((l) => l.contains(o)) : r = n.indexOf(o); 35733 const a = r + (s ? -1 : 1); 35734 return a < 0 || a >= n.length ? null : n[a]; 35735} 35736function dN(e, t = 5) { 35737 let i = 0; 35738 for (; e && Hw(e) === null && ++i <= t; ) 35739 e = e.parentElement; 35740 return Hw(e) === null ? null : e; 35741} 35742function YJ(e, t) { 35743 return e.ctrlsSvc.get("gridCtrl").focusInnerElement(t); 35744} 35745function hd(e) { 35746 return e.gos.get("suppressHeaderFocus") || !!e.overlays?.isExclusive(); 35747} 35748function hN(e) { 35749 return e.gos.get("suppressCellFocus") || !!e.overlays?.isExclusive(); 35750} 35751function Id(e, t, i = !1) { 35752 const s = e.ctrlsSvc.get("gridCtrl"); 35753 return !i && s.focusNextInnerContainer(t) ? !0 : ((i || !t && !s.isDetailGrid()) && s.forceFocusOutOfContainer(t), !1); 35754} 35755var KJ = /[&<>"']/g, ZJ = { 35756 "&": "&", 35757 "<": "<", 35758 ">": ">", 35759 '"': """, 35760 "'": "'" 35761}; 35762function yr(e, t) { 35763 if (e == null) 35764 return null; 35765 const i = e.toString().toString(); 35766 return t ? i : i.replace(KJ, (s) => ZJ[s]); 35767} 35768function qJ(e, t = !1) {
35769 return e === de.DELETE ? !0 : !t && e === de.BACKSPACE ? fO() : !1; 35770} 35771var QJ = class extends he { 35772 constructor(e, t, i, s) { 35773 super(), this.cellCtrl = e, this.rowNode = i, this.rowCtrl = s, this.beans = t; 35774 } 35775 setComp(e) { 35776 this.eGui = e; 35777 } 35778 onKeyDown(e) { 35779 const t = e.key; 35780 switch (t) { 35781 case de.ENTER: 35782 this.onEnterKeyDown(e); 35783 break; 35784 case de.F2: 35785 this.onF2KeyDown(e); 35786 break; 35787 case de.ESCAPE: 35788 this.onEscapeKeyDown(e); 35789 break; 35790 case de.TAB: 35791 this.onTabKeyDown(e); 35792 break; 35793 case de.BACKSPACE: 35794 case de.DELETE: 35795 this.onBackspaceOrDeleteKeyDown(t, e); 35796 break; 35797 case de.DOWN: 35798 case de.UP: 35799 case de.RIGHT: 35800 case de.LEFT: 35801 this.onNavigationKeyDown(e, t); 35802 break; 35803 } 35804 } 35805 onNavigationKeyDown(e, t) { 35806 this.cellCtrl.editing || (e.shiftKey && this.cellCtrl.isRangeSelectionEnabled() ? this.onShiftRangeSelect(e) : this.beans.navigation?.navigateToNextCell(e, t, this.cellCtrl.cellPosition, !0), e.preventDefault()); 35807 } 35808 onShiftRangeSelect(e) { 35809 const { rangeSvc: t, navigation: i } = this.beans; 35810 if (!t) 35811 return; 35812 const s = t.extendLatestRangeInDirection(e); 35813 s && i?.ensureCellVisible(s); 35814 } 35815 onTabKeyDown(e) { 35816 this.beans.navigation?.onTabKeyDown(this.cellCtrl, e); 35817 } 35818 onBackspaceOrDeleteKeyDown(e, t) { 35819 const { cellCtrl: i, beans: s, rowNode: n } = this, { gos: o, rangeSvc: r, eventSvc: a } = s; 35820 if (!i.editing) { 35821 if (a.dispatchEvent({ type: "keyShortcutChangedCellStart" }), qJ(e, o.get("enableCellEditingOnBackspace"))) { 35822 if (r && pa(o)) 35823 r.clearCellRangeCellValues({ dispatchWrapperEvents: !0, wrapperEventSource: "deleteKey" }); 35824 else if (i.isCellEditable()) { 35825 const { column: l } = i, c = this.beans.valueSvc.getDeleteValue(l, n); 35826 n.setDataValue(l, c, "cellClear"); 35827 } 35828 } else 35829 s.editSvc?.startRowOrCellEdit(i, e, t); 35830 a.dispatchEvent({ type: "keyShortcutChangedCellEnd" }); 35831 } 35832 } 35833 onEnterKeyDown(e) { 35834 const { cellCtrl: t, beans: i } = this; 35835 if (t.editing || this.rowCtrl.editing) 35836 t.stopEditingAndFocus(!1, e.shiftKey); 35837 else if (i.gos.get("enterNavigatesVertically")) { 35838 const s = e.shiftKey ? de.UP : de.DOWN; 35839 i.navigation?.navigateToNextCell(null, s, t.cellPosition, !1); 35840 } else 35841 i.editSvc?.startRowOrCellEdit(t, de.ENTER, e), t.editing && e.preventDefault(); 35842 } 35843 onF2KeyDown(e) { 35844 const { cellCtrl: t, beans: i } = this; 35845 t.editing || i.editSvc?.startRowOrCellEdit(t, de.F2, e); 35846 } 35847 // eslint-disable-next-line @typescript-eslint/no-unused-vars 35848 onEscapeKeyDown(e) { 35849 const { cellCtrl: t, beans: i } = this; 35850 t.editing && (i.editSvc?.stopRowOrCellEdit(t, !0), t.focusCell(!0)); 35851 } 35852 processCharacter(e) { 35853 if (e.target !== this.eGui || this.cellCtrl.editing) 35854 return; 35855 const s = e.key; 35856 s === de.SPACE ? this.onSpaceKeyDown(e) : this.beans.editSvc?.startRowOrCellEdit(this.cellCtrl, s, e) && e.preventDefault(); 35857 } 35858 onSpaceKeyDown(e) { 35859 const { gos: t } = this.beans; 35860 !this.cellCtrl.editing && Dc(t) && this.beans.selectionSvc?.handleSelectionEvent(e, this.rowNode, "spaceKey"), e.preventDefault(); 35861 } 35862 destroy() { 35863 super.destroy(); 35864 } 35865}, XJ = class extends he { 35866 constructor(e, t, i) { 35867 super(), this.cellCtrl = e, this.column = i, this.beans = t; 35868 } 35869 onMouseEvent(e, t) { 35870 if (!ra(t)) 35871 switch (e) { 35872 case "click": 35873 this.onCellClicked(t); 35874 break; 35875 case "mousedown": 35876 case "touchstart": 35877 this.onMouseDown(t); 35878 break; 35879 case "dblclick": 35880 this.onCellDoubleClicked(t); 35881 break; 35882 case "mouseout": 35883 this.onMouseOut(t); 35884 break; 35885 case "mouseover": 35886 this.onMouseOver(t); 35887 break; 35888 } 35889 } 35890 onCellClicked(e) { 35891 if (this.beans.touchSvc?.handleCellDoubleClick(this, e)) 35892 return; 35893 const { eventSvc: t, rangeSvc: i, gos: s, editSvc: n } = this.beans, o = e.ctrlKey || e.metaKey; 35894 i && o && i.getCellRangeCount(this.cellCtrl.cellPosition) > 1 && i.intersectLastRange(!0); 35895 const r = this.cellCtrl.createEvent(e, "cellClicked"); 35896 t.dispatchEvent(r); 35897 const a = this.column.getColDef(); 35898 a.onCellClicked && window.setTimeout(() => { 35899 this.beans.frameworkOverrides.wrapOutgoing(() => { 35900 a.onCellClicked(r); 35901 }); 35902 }, 0), (s.get("singleClickEdit") || a.singleClickEdit) && !s.get("suppressClickEdit") && !(e.shiftKey && i?.getCellRanges().length != 0) && n?.startRowOrCellEdit(this.cellCtrl); 35903 } 35904 onCellDoubleClicked(e) { 35905 const { column: t, beans: i, cellCtrl: s } = this, { eventSvc: n, frameworkOverrides: o, gos: r, editSvc: a } = i, l = t.getColDef(), c = s.createEvent(e, "cellDoubleClicked"); 35906 n.dispatchEvent(c), typeof l.onCellDoubleClicked == "function" && window.setTimeout(() => { 35907 o.wrapOutgoing(() => { 35908 l.onCellDoubleClicked(c); 35909 }); 35910 }, 0), !r.get("singleClickEdit") && !r.get("suppressClickEdit") && a?.startRowOrCellEdit(s, null, e); 35911 } 35912 onMouseDown(e) {
35913 const { ctrlKey: t, metaKey: i, shiftKey: s } = e, n = e.target, { cellCtrl: o, beans: r } = this, { eventSvc: a, rangeSvc: l, focusSvc: c, gos: u } = r; 35914 if (this.isRightClickInExistingRange(e)) 35915 return; 35916 const d = l && !l.isEmpty(), p = this.containsWidget(n), { cellPosition: f } = o; 35917 if (!s || !d) { 35918 const y = u.get("enableCellTextSelection") && e.defaultPrevented, b = (Jc() || y) && !o.editing && !X1(n) && !p; 35919 o.focusCell(b); 35920 } 35921 if (s && d && !c.isCellFocused(f)) { 35922 e.preventDefault(); 35923 const m = c.getFocusedCell(); 35924 if (m) { 35925 const { column: y, rowIndex: b, rowPinned: C } = m, M = r.rowRenderer.getRowByPosition({ rowIndex: b, rowPinned: C })?.getCellCtrl(y); 35926 M?.editing && M.stopEditing(), c.setFocusedCell({ 35927 column: y, 35928 rowIndex: b, 35929 rowPinned: C, 35930 forceBrowserFocus: !0, 35931 preventScrollOnBrowserFocus: !0 35932 }); 35933 } 35934 } 35935 if (!p) { 35936 if (l) 35937 if (s) 35938 l.extendLatestRangeToCell(f); 35939 else { 35940 const m = t || i; 35941 l.setRangeToCell(f, m); 35942 } 35943 a.dispatchEvent(this.cellCtrl.createEvent(e, "cellMouseDown")); 35944 } 35945 } 35946 isRightClickInExistingRange(e) { 35947 const { rangeSvc: t } = this.beans; 35948 if (t) { 35949 const i = t.isCellInAnyRange(this.cellCtrl.cellPosition), s = e.button === 2 || e.ctrlKey && this.beans.gos.get("allowContextMenuWithControlKey"); 35950 if (i && s) 35951 return !0; 35952 } 35953 return !1; 35954 } 35955 containsWidget(e) { 35956 return Ac(e, "ag-selection-checkbox", 3) || Ac(e, "ag-drag-handle", 3); 35957 } 35958 onMouseOut(e) { 35959 if (this.mouseStayingInsideCell(e)) 35960 return; 35961 const { eventSvc: t, colHover: i } = this.beans; 35962 t.dispatchEvent(this.cellCtrl.createEvent(e, "cellMouseOut")), i?.clearMouseOver(); 35963 } 35964 onMouseOver(e) { 35965 if (this.mouseStayingInsideCell(e)) 35966 return; 35967 const { eventSvc: t, colHover: i } = this.beans; 35968 t.dispatchEvent(this.cellCtrl.createEvent(e, "cellMouseOver")), i?.setMouseOver([this.column]); 35969 } 35970 mouseStayingInsideCell(e) { 35971 if (!e.target || !e.relatedTarget) 35972 return !1; 35973 const { eGui: t } = this.cellCtrl, i = t.contains(e.target), s = t.contains(e.relatedTarget); 35974 return i && s; 35975 } 35976 destroy() { 35977 super.destroy(); 35978 } 35979}, JJ = class extends he { 35980 constructor(e, t) { 35981 super(), this.cellCtrl = e, this.beans = t, this.column = e.column, this.rowNode = e.rowNode; 35982 } 35983 setupRowSpan() { 35984 this.rowSpan = this.column.getRowSpan(this.rowNode), this.addManagedListeners(this.beans.eventSvc, { newColumnsLoaded: () => this.onNewColumnsLoaded() }); 35985 } 35986 setComp(e) { 35987 this.eGui = e, this.setupColSpan(), this.setupRowSpan(), this.onLeftChanged(), this.onWidthChanged(), this.applyRowSpan(); 35988 } 35989 onNewColumnsLoaded() { 35990 const e = this.column.getRowSpan(this.rowNode); 35991 this.rowSpan !== e && (this.rowSpan = e, this.applyRowSpan(!0)); 35992 } 35993 onDisplayColumnsChanged() { 35994 const e = this.getColSpanningList(); 35995 tu(this.colsSpanning, e) || (this.colsSpanning = e, this.onWidthChanged(), this.onLeftChanged()); 35996 } 35997 setupColSpan() { 35998 this.column.getColDef().colSpan != null && (this.colsSpanning = this.getColSpanningList(), this.addManagedListeners(this.beans.eventSvc, { 35999 // because we are col spanning, a reorder of the cols can change what cols we are spanning over 36000 displayedColumnsChanged: this.onDisplayColumnsChanged.bind(this), 36001 // because we are spanning over multiple cols, we check for width any time any cols width changes. 36002 // this is expensive - really we should be explicitly checking only the cols we are spanning over 36003 // instead of every col, however it would be tricky code to track the cols we are spanning over, so 36004 // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code. 36005 displayedColumnsWidthChanged: this.onWidthChanged.bind(this) 36006 })); 36007 } 36008 onWidthChanged() { 36009 if (!this.eGui) 36010 return; 36011 const e = this.getCellWidth(); 36012 this.eGui.style.width = `${e}px`; 36013 } 36014 getCellWidth() { 36015 return this.colsSpanning ? this.colsSpanning.reduce((e, t) => e + t.getActualWidth(), 0) : this.column.getActualWidth(); 36016 }
36017 getColSpanningList() { 36018 const { column: e, rowNode: t } = this, i = e.getColSpan(t), s = []; 36019 if (i === 1) 36020 s.push(e); 36021 else { 36022 let n = e; 36023 const o = e.getPinned(); 36024 for (let r = 0; n && r < i && (s.push(n), n = this.beans.visibleCols.getColAfter(n), !(!n || ai(n) || o !== n.getPinned())); r++) 36025 ; 36026 } 36027 return s; 36028 } 36029 onLeftChanged() { 36030 if (!this.eGui) 36031 return; 36032 const e = this.modifyLeftForPrintLayout(this.getCellLeft()); 36033 this.eGui.style.left = e + "px"; 36034 } 36035 getCellLeft() { 36036 let e; 36037 return this.beans.gos.get("enableRtl") && this.colsSpanning ? e = It(this.colsSpanning) : e = this.column, e.getLeft(); 36038 } 36039 modifyLeftForPrintLayout(e) { 36040 if (!this.cellCtrl.printLayout || this.column.getPinned() === "left") 36041 return e; 36042 const { visibleCols: t } = this.beans, i = t.getColsLeftWidth(); 36043 if (this.column.getPinned() === "right") { 36044 const s = t.bodyWidth; 36045 return i + s + (e || 0); 36046 } 36047 return i + (e || 0); 36048 } 36049 applyRowSpan(e) { 36050 if (this.rowSpan === 1 && !e) 36051 return; 36052 const i = Ec(this.beans) * this.rowSpan; 36053 this.eGui.style.height = `${i}px`, this.eGui.style.zIndex = "1"; 36054 } 36055 // overriding to make public, as we don't dispose this bean via context 36056 destroy() { 36057 super.destroy(); 36058 } 36059}, eee = "ag-cell", tee = "ag-cell-auto-height", iee = "ag-cell-normal-height", see = "ag-cell-focus", nee = "ag-cell-first-right-pinned", oee = "ag-cell-last-left-pinned", ree = "ag-cell-not-inline-editing", aee = "ag-cell-wrap-text", pv = "cellCtrl"; 36060function pN(e, t) { 36061 return HO(e, t, pv); 36062} 36063var lee = 0, Cm = class extends he { 36064 constructor(e, t, i, s) { 36065 super(), this.column = e, this.rowNode = t, this.rowCtrl = s, this.rangeFeature = void 0, this.positionFeature = void 0, this.customStyleFeature = void 0, this.tooltipFeature = void 0, this.mouseListener = void 0, this.keyboardListener = void 0, this.suppressRefreshCell = !1, this.onCompAttachedFuncs = [], this.onEditorAttachedFuncs = [], this.beans = i, this.instanceId = e.getId() + "-" + lee++, this.colIdSanitised = yr(this.column.getId()), this.createCellPosition(), this.updateAndFormatValue(!1); 36066 } 36067 shouldRestoreFocus() { 36068 return this.beans.focusSvc.shouldRestoreFocus(this.cellPosition); 36069 } 36070 onFocusOut() { 36071 this.beans.focusSvc.clearRestoreFocus(); 36072 } 36073 addFeatures() { 36074 const { beans: e } = this; 36075 this.positionFeature = new JJ(this, e), this.customStyleFeature = e.cellStyles?.createCellCustomStyleFeature(this, e), this.mouseListener = new XJ(this, e, this.column), this.keyboardListener = new QJ(this, e, this.rowNode, this.rowCtrl), this.column.isTooltipEnabled() && this.enableTooltipFeature(); 36076 const { rangeSvc: t } = e; 36077 t && pa(e.gos) && (this.rangeFeature = t.createCellRangeFeature(e, this)); 36078 } 36079 removeFeatures() { 36080 const e = this.beans.context; 36081 this.positionFeature = e.destroyBean(this.positionFeature), this.customStyleFeature = e.destroyBean(this.customStyleFeature), this.mouseListener = e.destroyBean(this.mouseListener), this.keyboardListener = e.destroyBean(this.keyboardListener), this.rangeFeature = e.destroyBean(this.rangeFeature), this.disableTooltipFeature(); 36082 } 36083 enableTooltipFeature(e, t) { 36084 this.tooltipFeature = this.beans.tooltipSvc?.enableCellTooltipFeature(this, e, t); 36085 } 36086 disableTooltipFeature() { 36087 this.tooltipFeature = this.beans.context.destroyBean(this.tooltipFeature); 36088 } 36089 setComp(e, t, i, s, n, o) { 36090 this.comp = e, this.eGui = t, this.printLayout = s, o ?? (o = this), this.addDomData(o), this.addFeatures(), o.addDestroyFunc(() => this.removeFeatures()), this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")), this.onCellFocused(this.focusEventToRestore), this.applyStaticCssClasses(), this.setWrapText(), this.onFirstRightPinnedChanged(), this.onLastLeftPinnedChanged(), this.onColumnHover(), this.setupControlComps(), this.setupAutoHeight(i, o), this.refreshFirstAndLastStyles(), this.refreshAriaColIndex(), this.positionFeature?.setComp(t), this.customStyleFeature?.setComp(e), this.tooltipFeature?.refreshTooltip(), this.keyboardListener?.setComp(this.eGui), this.rangeFeature && this.rangeFeature.setComp(e, t), n && this.isCellEditable() ? this.beans.editSvc?.startEditing(this) : this.showValue(), this.onCompAttachedFuncs.length && (this.onCompAttachedFuncs.forEach((r) => r()), this.onCompAttachedFuncs = []); 36091 } 36092 setupAutoHeight(e, t) { 36093 this.isAutoHeight = this.column.isAutoHeight(), !(!this.isAutoHeight || !e) && this.beans.rowAutoHeight?.setupCellAutoHeight(this, e, t); 36094 } 36095 getCellAriaRole() { 36096 return this.column.getColDef().cellAriaRole ?? "gridcell"; 36097 } 36098 isCellRenderer() { 36099 const e = this.column.getColDef(); 36100 return e.cellRenderer != null || e.cellRendererSelector != null; 36101 } 36102 getValueToDisplay() { 36103 return this.valueFormatted ?? this.value; 36104 } 36105 showValue(e = !1) {
36106 const { beans: t, column: i, rowNode: s, rangeFeature: n } = this, { userCompFactory: o } = t, r = this.getValueToDisplay(); 36107 let a; 36108 if (s.stub && s.groupData?.[i.getId()] == null) { 36109 const c = this.createCellRendererParams(); 36110 a = wJ(o, i.getColDef(), c); 36111 } else if (this.isCellRenderer()) { 36112 const c = this.createCellRendererParams(); 36113 a = bJ(o, i.getColDef(), c); 36114 } 36115 this.comp.setRenderDetails(a, r, e), n && Hl(t, () => n?.refreshHandle()); 36116 } 36117 setupControlComps() { 36118 const e = this.column.getColDef(); 36119 this.includeSelection = this.isIncludeControl(this.isCheckboxSelection(e)), this.includeRowDrag = this.isIncludeControl(e.rowDrag), this.includeDndSource = this.isIncludeControl(e.dndSource), this.comp.setIncludeSelection(this.includeSelection), this.comp.setIncludeDndSource(this.includeDndSource), this.comp.setIncludeRowDrag(this.includeRowDrag); 36120 } 36121 isForceWrapper() { 36122 return this.beans.gos.get("enableCellTextSelection") || this.column.isAutoHeight(); 36123 } 36124 // eslint-disable-next-line @typescript-eslint/ban-types 36125 isIncludeControl(e) { 36126 return this.rowNode.rowPinned != null ? !1 : typeof e == "function" || e === !0; 36127 } 36128 isCheckboxSelection(e) { 36129 const { rowSelection: t } = this.beans.gridOptions; 36130 return e.checkboxSelection || vr(this.column) && t && typeof t != "string" && ld(t); 36131 } 36132 refreshShouldDestroy() { 36133 const e = this.column.getColDef(), t = this.includeSelection != this.isIncludeControl(this.isCheckboxSelection(e)), i = this.includeRowDrag != this.isIncludeControl(e.rowDrag), s = this.includeDndSource != this.isIncludeControl(e.dndSource), n = this.isAutoHeight != this.column.isAutoHeight(); 36134 return t || i || s || n; 36135 } 36136 onPopupEditorClosed() { 36137 this.editing && this.stopEditingAndFocus(); 36138 } 36139 /** 36140 * Ends the Cell Editing 36141 * @param cancel `True` if the edit process is being canceled. 36142 * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`. 36143 */ 36144 stopEditing(e = !1) { 36145 return this.beans.editSvc?.stopEditing(this, e) ?? !1; 36146 } 36147 createCellRendererParams() { 36148 const { 36149 value: e, 36150 valueFormatted: t, 36151 column: i, 36152 rowNode: s, 36153 comp: n, 36154 eGui: o, 36155 beans: { valueSvc: r, gos: a } 36156 } = this; 36157 return a.addGridCommonParams({ 36158 value: e, 36159 valueFormatted: t, 36160 getValue: () => r.getValueForDisplay(i, s), 36161 setValue: (c) => r.setValue(s, i, c), 36162 formatValue: this.formatValue.bind(this), 36163 data: s.data, 36164 node: s, 36165 pinned: i.getPinned(), 36166 colDef: i.getColDef(), 36167 column: i, 36168 refreshCell: this.refreshCell.bind(this), 36169 eGridCell: o, 36170 eParentOfValue: n.getParentOfValue(), 36171 registerRowDragger: (c, u, d, p) => this.registerRowDragger(c, u, p), 36172 setTooltip: (c, u) => { 36173 a.assertModuleRegistered("Tooltip", 3), this.tooltipFeature && this.disableTooltipFeature(), this.enableTooltipFeature(c, u), this.tooltipFeature?.refreshTooltip(); 36174 } 36175 }); 36176 } 36177 onCellChanged(e) { 36178 e.column === this.column && this.refreshCell({}); 36179 } 36180 refreshOrDestroyCell(e) { 36181 this.refreshShouldDestroy() ? this.rowCtrl?.recreateCell(this) : this.refreshCell(e); 36182 } 36183 // + stop editing {forceRefresh: true, suppressFlash: true} 36184 // + event cellChanged {} 36185 // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything 36186 // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update} 36187 // + rowCtrl: api refreshCells() {animate: true/false} 36188 // + rowRenderer: api softRefreshView() {} 36189 refreshCell(e) { 36190 if (this.suppressRefreshCell || this.editing) 36191 return; 36192 const t = this.column.getColDef(), i = e != null && !!e.newData, s = e != null && !!e.suppressFlash, n = t.field == null && t.valueGetter == null && t.showRowGroup == null, o = e && e.forceRefresh || n || i, r = !!this.comp, a = this.updateAndFormatValue(r), l = o || a; 36193 if (r) { 36194 if (l) { 36195 this.showValue(i); 36196 const c = this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering(); 36197 !s && !c && t.enableCellChangeFlash && this.beans.cellFlashSvc?.flashCell(this), this.customStyleFeature?.applyUserStyles(), this.customStyleFeature?.applyClassesFromColDef(); 36198 } 36199 this.tooltipFeature?.refreshTooltip(), this.customStyleFeature?.applyCellClassRules(); 36200 } 36201 } 36202 // cell editors call this, when they want to stop for reasons other 36203 // than what we pick up on. eg selecting from a dropdown ends editing. 36204 stopEditingAndFocus(e = !1, t = !1) { 36205 this.beans.editSvc?.stopEditingAndFocus(this, e, t); 36206 } 36207 isCellEditable() { 36208 return this.column.isCellEditable(this.rowNode); 36209 } 36210 formatValue(e) { 36211 return this.callValueFormatter(e) ?? e; 36212 } 36213 callValueFormatter(e) { 36214 return this.beans.valueSvc.formatValue(this.column, this.rowNode, e); 36215 } 36216 updateAndFormatValue(e) { 36217 const t = this.value, i = this.valueFormatted; 36218 return this.value = this.beans.valueSvc.getValueForDisplay(this.column, this.rowNode), this.valueFormatted = this.callValueFormatter(this.value), e ? !this.valuesAreEqual(t, this.value) || this.valueFormatted != i : !0; 36219 } 36220 valuesAreEqual(e, t) { 36221 const i = this.column.getColDef(); 36222 return i.equals ? i.equals(e, t) : e === t; 36223 } 36224 addDomData(e) { 36225 const t = this.eGui; 36226 Bc(this.beans.gos, t, pv, this), e.addDestroyFunc(() => Bc(this.beans.gos, t, pv, null)); 36227 } 36228 createEvent(e, t) { 36229 const { rowNode: i, column: s, value: n } = this; 36230 return this.beans.gos.addGridCommonParams({ 36231 type: t, 36232 node: i, 36233 data: i.data, 36234 value: n, 36235 column: s, 36236 colDef: s.getColDef(), 36237 rowPinned: i.rowPinned, 36238 event: e, 36239 rowIndex: i.rowIndex 36240 }); 36241 } 36242 processCharacter(e) { 36243 this.keyboardListener?.processCharacter(e); 36244 } 36245 onKeyDown(e) { 36246 this.keyboardListener?.onKeyDown(e); 36247 } 36248 onMouseEvent(e, t) { 36249 this.mouseListener?.onMouseEvent(e, t); 36250 }
36251 getColSpanningList() { 36252 return this.positionFeature.getColSpanningList(); 36253 } 36254 onLeftChanged() { 36255 this.comp && this.positionFeature?.onLeftChanged(); 36256 } 36257 onDisplayedColumnsChanged() { 36258 this.eGui && (this.refreshAriaColIndex(), this.refreshFirstAndLastStyles()); 36259 } 36260 refreshFirstAndLastStyles() { 36261 const { comp: e, column: t, beans: i } = this; 36262 uN(e, t, i.visibleCols); 36263 } 36264 refreshAriaColIndex() { 36265 const e = this.beans.visibleCols.getAriaColIndex(this.column); 36266 hO(this.eGui, e); 36267 } 36268 onWidthChanged() { 36269 return this.positionFeature?.onWidthChanged(); 36270 } 36271 getRowPosition() { 36272 const { rowIndex: e, rowPinned: t } = this.cellPosition; 36273 return { 36274 rowIndex: e, 36275 rowPinned: t 36276 }; 36277 } 36278 updateRangeBordersIfRangeCount() { 36279 this.comp && this.rangeFeature?.updateRangeBordersIfRangeCount(); 36280 } 36281 onCellSelectionChanged() { 36282 this.comp && this.rangeFeature?.onCellSelectionChanged(); 36283 } 36284 isRangeSelectionEnabled() { 36285 return this.rangeFeature != null; 36286 } 36287 focusCell(e = !1) { 36288 this.beans.focusSvc.setFocusedCell({ 36289 rowIndex: this.cellPosition.rowIndex, 36290 column: this.column, 36291 rowPinned: this.rowNode.rowPinned, 36292 forceBrowserFocus: e 36293 }); 36294 } 36295 onRowIndexChanged() { 36296 this.createCellPosition(), this.onCellFocused(), this.rangeFeature?.onCellSelectionChanged(); 36297 } 36298 onSuppressCellFocusChanged(e) { 36299 this.eGui && vo(this.eGui, "tabindex", e ? void 0 : -1); 36300 } 36301 onFirstRightPinnedChanged() { 36302 if (!this.comp) 36303 return; 36304 const e = this.column.isFirstRightPinned(); 36305 this.comp.addOrRemoveCssClass(nee, e); 36306 } 36307 onLastLeftPinnedChanged() { 36308 if (!this.comp) 36309 return; 36310 const e = this.column.isLastLeftPinned(); 36311 this.comp.addOrRemoveCssClass(oee, e); 36312 } 36313 onCellFocused(e) { 36314 const { beans: t } = this; 36315 if (hN(t)) 36316 return; 36317 const i = t.focusSvc.isCellFocused(this.cellPosition); 36318 if (!this.comp) { 36319 i && e?.forceBrowserFocus && (this.focusEventToRestore = e); 36320 return; 36321 } 36322 if (this.focusEventToRestore = void 0, this.comp.addOrRemoveCssClass(see, i), i && e && e.forceBrowserFocus) { 36323 let n = this.comp.getFocusableElement(); 36324 if (this.editing) { 36325 const o = dd(n, null, !0); 36326 o.length && (n = o[0]); 36327 } 36328 n.focus({ preventScroll: !!e.preventScrollOnBrowserFocus }); 36329 } 36330 const s = t.gos.get("editType") === "fullRow"; 36331 !i && !s && this.editing && t.editSvc?.stopRowOrCellEdit(this), i && this.rowCtrl.announceDescription(); 36332 } 36333 createCellPosition() { 36334 const { rowIndex: e, rowPinned: t } = this.rowNode; 36335 this.cellPosition = { 36336 rowIndex: e, 36337 rowPinned: oa(t), 36338 column: this.column 36339 }; 36340 } 36341 setInlineEditingCss() { 36342 this.beans.editSvc?.setInlineEditingCss(this.rowCtrl); 36343 } 36344 // CSS Classes that only get applied once, they never change 36345 applyStaticCssClasses() { 36346 const { comp: e } = this; 36347 e.addOrRemoveCssClass(eee, !0), e.addOrRemoveCssClass(ree, !0); 36348 const t = this.column.isAutoHeight() == !0; 36349 e.addOrRemoveCssClass(tee, t), e.addOrRemoveCssClass(iee, !t); 36350 } 36351 onColumnHover() { 36352 this.beans.colHover?.onCellColumnHover(this.column, this.comp); 36353 } 36354 onColDefChanged() { 36355 this.comp && (this.column.isTooltipEnabled() ? (this.disableTooltipFeature(), this.enableTooltipFeature()) : this.disableTooltipFeature(), this.setWrapText(), this.editing ? this.beans.editSvc?.handleColDefChanged(this) : this.refreshOrDestroyCell({ forceRefresh: !0, suppressFlash: !0 })); 36356 } 36357 setWrapText() { 36358 const e = this.column.getColDef().wrapText == !0; 36359 this.comp.addOrRemoveCssClass(aee, e); 36360 } 36361 dispatchCellContextMenuEvent(e) { 36362 const t = this.column.getColDef(), i = this.createEvent(e, "cellContextMenu"), { beans: s } = this; 36363 s.eventSvc.dispatchEvent(i), t.onCellContextMenu && window.setTimeout(() => { 36364 s.frameworkOverrides.wrapOutgoing(() => { 36365 t.onCellContextMenu(i); 36366 }); 36367 }, 0); 36368 } 36369 getCellRenderer() { 36370 return this.comp?.getCellRenderer() ?? null; 36371 } 36372 destroy() { 36373 this.onCompAttachedFuncs = [], this.onEditorAttachedFuncs = [], super.destroy(); 36374 } 36375 createSelectionCheckbox() { 36376 const e = this.beans.selectionSvc?.createCheckboxSelectionComponent(); 36377 if (e) 36378 return this.beans.context.createBean(e), e.init({ rowNode: this.rowNode, column: this.column }), e; 36379 } 36380 createDndSource() { 36381 const e = this.beans.registry.createDynamicBean( 36382 "dndSourceComp", 36383 !1, 36384 this.rowNode, 36385 this.column, 36386 this.eGui 36387 ); 36388 return e && this.beans.context.createBean(e), e; 36389 } 36390 registerRowDragger(e, t, i) { 36391 if (this.customRowDragComp) { 36392 this.customRowDragComp.setDragElement(e, t); 36393 return; 36394 } 36395 const s = this.createRowDragComp(e, t, i); 36396 s && (this.customRowDragComp = s, this.addDestroyFunc(() => { 36397 this.beans.context.destroyBean(s), this.customRowDragComp = null; 36398 })); 36399 } 36400 createRowDragComp(e, t, i) { 36401 const s = this.beans.rowDragSvc?.createRowDragCompForCell( 36402 this.rowNode, 36403 this.column, 36404 () => this.value, 36405 e, 36406 t, 36407 i 36408 ); 36409 if (s) 36410 return this.beans.context.createBean(s), s; 36411 } 36412 cellEditorAttached() { 36413 this.onEditorAttachedFuncs.forEach((e) => e()), this.onEditorAttachedFuncs = []; 36414 } 36415}, gN = "__ag_grid_instance"; 36416function fN(e, t) { 36417 t[gN] = e.gridInstanceId; 36418}
36419function gv(e, t) { 36420 return mN(e, t.target); 36421} 36422function mN(e, t) { 36423 let i = t; 36424 for (; i; ) { 36425 const s = i[gN]; 36426 if (Ie(s)) 36427 return s === e.gridInstanceId; 36428 i = i.parentElement; 36429 } 36430 return !1; 36431} 36432function cee(e, t) { 36433 return pN(e, t.target)?.cellPosition ?? null; 36434} 36435function M0(e, t) { 36436 const i = gs(e.gos, "normal"), s = t; 36437 let n, o; 36438 if (s.clientX != null || s.clientY != null ? (n = s.clientX, o = s.clientY) : (n = s.x, o = s.y), i) { 36439 const r = e.ctrlsSvc.getScrollFeature(), a = r.getVScrollPosition(), l = r.getHScrollPosition(); 36440 n += l.left, o += a.top; 36441 } 36442 return { x: n, y: o }; 36443} 36444var uee = class extends he { 36445 constructor() { 36446 super(...arguments), this.beanName = "dragAndDrop", this.dragSourceAndParamsList = [], this.dropTargets = []; 36447 } 36448 wireBeans(e) { 36449 this.ctrlsSvc = e.ctrlsSvc, this.dragSvc = e.dragSvc, this.environment = e.environment, this.userCompFactory = e.userCompFactory; 36450 } 36451 addDragSource(e, t = !1) { 36452 const i = { 36453 eElement: e.eElement, 36454 dragStartPixels: e.dragStartPixels, 36455 onDragStart: this.onDragStart.bind(this, e), 36456 onDragStop: this.onDragStop.bind(this), 36457 onDragging: this.onDragging.bind(this), 36458 onDragCancel: this.onDragCancel.bind(this), 36459 includeTouch: t 36460 }; 36461 this.dragSourceAndParamsList.push({ params: i, dragSource: e }), this.dragSvc.addDragSource(i); 36462 } 36463 getDragAndDropImageComponent() { 36464 const { dragAndDropImageComp: e } = this; 36465 return !e || !e.comp ? null : e.comp; 36466 } 36467 removeDragSource(e) { 36468 const { dragSourceAndParamsList: t, dragSvc: i } = this, s = t.find((n) => n.dragSource === e); 36469 s && (i.removeDragSource(s.params), Ko(t, s)); 36470 } 36471 destroy() { 36472 const { dragSourceAndParamsList: e, dragSvc: t, dropTargets: i } = this; 36473 e.forEach((s) => t.removeDragSource(s.params)), e.length = 0, i.length = 0, this.clearDragAndDropProperties(), super.destroy(); 36474 } 36475 nudge() { 36476 this.dragging && this.onDragging(this.eventLastTime, !0); 36477 } 36478 onDragStart(e, t) { 36479 this.dragging = !0, this.dragSource = e, this.eventLastTime = t, this.dragItem = e.getDragItem(), e.onDragStarted?.(), this.createDragAndDropImageComponent(); 36480 } 36481 onDragStop(e) { 36482 this.dragSource?.onDragStopped?.(); 36483 const { lastDropTarget: t } = this; 36484 if (t?.onDragStop) { 36485 const i = this.createDropTargetEvent(t, e, null, null, !1); 36486 t.onDragStop(i); 36487 } 36488 this.clearDragAndDropProperties(); 36489 } 36490 onDragCancel() { 36491 const { dragSource: e, lastDropTarget: t } = this; 36492 e?.onDragCancelled?.(), t?.onDragCancel && t.onDragCancel( 36493 this.createDropTargetEvent(t, this.eventLastTime, null, null, !1) 36494 ), this.clearDragAndDropProperties(); 36495 } 36496 clearDragAndDropProperties() { 36497 this.eventLastTime = null, this.dragging = !1, this.lastDropTarget = void 0, this.dragItem = null, this.dragSource = null, this.removeDragAndDropImageComponent(); 36498 } 36499 onDragging(e, t = !1) { 36500 const i = this.getHorizontalDirection(e), s = this.getVerticalDirection(e); 36501 this.eventLastTime = e, this.positionDragAndDropImageComp(e); 36502 const n = this.dropTargets.filter((u) => this.isMouseOnDropTarget(e, u)), o = this.findCurrentDropTarget(e, n), { lastDropTarget: r, dragSource: a, dragAndDropImageComp: l, dragItem: c } = this; 36503 if (o !== r) { 36504 if (this.leaveLastTargetIfExists(e, i, s, t), r !== null && o === null && a?.onGridExit?.(c), r === null && o !== null && a?.onGridEnter?.(c), this.enterDragTargetIfExists(o, e, i, s, t), o && l) { 36505 const { comp: u, promise: d } = l; 36506 u ? u.setIcon(o.getIconName ? o.getIconName() : null, !1) : d.then((p) => { 36507 p && p.setIcon(o.getIconName ? o.getIconName() : null, !1); 36508 }); 36509 } 36510 this.lastDropTarget = o; 36511 } else if (o && o.onDragging) { 36512 const u = this.createDropTargetEvent(o, e, i, s, t); 36513 o.onDragging(u); 36514 } 36515 } 36516 getAllContainersFromDropTarget(e) { 36517 const t = e.getSecondaryContainers ? e.getSecondaryContainers() : null, i = [[e.getContainer()]]; 36518 return t ? i.concat(t) : i; 36519 } 36520 // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers 36521 isMouseOnDropTarget(e, t) { 36522 const i = this.getAllContainersFromDropTarget(t); 36523 let s = !1; 36524 const n = (a, l) => { 36525 for (const c of l) { 36526 const { width: u, height: d, left: p, right: f, top: m, bottom: y } = c.getBoundingClientRect(); 36527 if (u === 0 || d === 0) 36528 return !1; 36529 const b = a.clientX >= p && a.clientX < f, C = a.clientY >= m && a.clientY < y; 36530 if (!b || !C) 36531 return !1; 36532 } 36533 return !0; 36534 }; 36535 for (const a of i) 36536 if (n(e, a)) { 36537 s = !0; 36538 break; 36539 } 36540 const { eElement: o, type: r } = this.dragSource; 36541 return t.targetContainsSource && !t.getContainer().contains(o) ? !1 : s && t.isInterestedIn(r, o); 36542 } 36543 findCurrentDropTarget(e, t) { 36544 const i = t.length; 36545 if (i === 0) 36546 return null; 36547 if (i === 1) 36548 return t[0]; 36549 const n = Kp(this.beans).elementsFromPoint(e.clientX, e.clientY); 36550 for (const o of n) 36551 for (const r of t) 36552 if (this.getAllContainersFromDropTarget(r).flatMap((l) => l).indexOf(o) !== -1) 36553 return r; 36554 return null; 36555 } 36556 enterDragTargetIfExists(e, t, i, s, n) { 36557 if (e && e.onDragEnter) { 36558 const o = this.createDropTargetEvent( 36559 e, 36560 t, 36561 i, 36562 s, 36563 n 36564 ); 36565 e.onDragEnter(o); 36566 } 36567 } 36568 leaveLastTargetIfExists(e, t, i, s) { 36569 const { lastDropTarget: n } = this; 36570 if (!n) 36571 return; 36572 if (n.onDragLeave) { 36573 const r = this.createDropTargetEvent( 36574 n, 36575 e, 36576 t, 36577 i, 36578 s 36579 ); 36580 n.onDragLeave(r); 36581 } 36582 const o = this.getDragAndDropImageComponent(); 36583 o && o.setIcon(null, !1); 36584 } 36585 addDropTarget(e) { 36586 this.dropTargets.push(e); 36587 } 36588 removeDropTarget(e) { 36589 this.dropTargets = this.dropTargets.filter((t) => t.getContainer() !== e.getContainer()); 36590 } 36591 hasExternalDropZones() { 36592 return this.dropTargets.some((e) => e.external); 36593 } 36594 findExternalZone(e) { 36595 return this.dropTargets.filter((i) => i.external).find((i) => i.getContainer() === e.getContainer()) || null; 36596 } 36597 isDropZoneWithinThisGrid(e) { 36598 const i = this.ctrlsSvc.getGridBodyCtrl().eGridBody, { dropZoneTarget: s } = e; 36599 return i.contains(s); 36600 } 36601 getHorizontalDirection(e) { 36602 const t = this.eventLastTime?.clientX, i = e.clientX; 36603 return t === i ? null : t > i ? "left" : "right"; 36604 } 36605 getVerticalDirection(e) { 36606 const t = this.eventLastTime?.clientY, i = e.clientY; 36607 return t === i ? null : t > i ? "up" : "down"; 36608 } 36609 createDropTargetEvent(e, t, i, s, n) { 36610 const o = e.getContainer(), r = o.getBoundingClientRect(), { dragItem: a, dragSource: l, gos: c } = this, u = t.clientX - r.left, d = t.clientY - r.top; 36611 return c.addGridCommonParams({ 36612 event: t, 36613 x: u, 36614 y: d, 36615 vDirection: s, 36616 hDirection: i, 36617 dragSource: l, 36618 fromNudge: n, 36619 dragItem: a, 36620 dropZoneTarget: o 36621 }); 36622 } 36623 positionDragAndDropImageComp(e) { 36624 const t = this.getDragAndDropImageComponent(); 36625 t && sX(t.getGui(), e, this.beans); 36626 } 36627 removeDragAndDropImageComponent() { 36628 const { dragAndDropImageComp: e } = this; 36629 if (e) { 36630 const { comp: t } = e; 36631 if (t) { 36632 const i = t.getGui(); 36633 this.dragAndDropImageParent?.removeChild(i), this.destroyBean(t); 36634 } 36635 } 36636 this.dragAndDropImageComp = null; 36637 } 36638 createDragAndDropImageComponent() { 36639 const { dragSource: e } = this; 36640 if (!e) 36641 return; 36642 const t = dJ(this.userCompFactory, { 36643 dragSource: e 36644 }); 36645 if (!t) 36646 return; 36647 const i = t.newAgStackInstance(); 36648 this.dragAndDropImageComp = { 36649 promise: i 36650 }, i.then((s) => { 36651 !s || !this.isAlive() || (this.processDragAndDropImageComponent(s), this.dragAndDropImageComp.comp = s); 36652 }); 36653 } 36654 processDragAndDropImageComponent(e) { 36655 const { dragSource: t, environment: i } = this; 36656 if (!t) 36657 return; 36658 const s = e.getGui(); 36659 s.style.setProperty("position", "absolute"), s.style.setProperty("z-index", "9999"), fN(this.gos, s), i.applyThemeClasses(s), e.setIcon(null, !1); 36660 let { dragItemName: n } = t; 36661 typeof n == "function" && (n = n()), e.setLabel(n || ""), s.style.top = "20px", s.style.left = "20px"; 36662 const o = sM(this.beans); 36663 this.dragAndDropImageParent = o, o ? o.appendChild(s) : Ae(54); 36664 } 36665 registerGridDropTarget(e, t) { 36666 const i = { 36667 getContainer: e, 36668 isInterestedIn: (s) => s === 1 || s === 0, 36669 getIconName: () => "notAllowed" 36670 }; 36671 this.addDropTarget(i), t.addDestroyFunc(() => this.removeDropTarget(i)); 36672 } 36673}, dee = class { 36674 constructor(e) { 36675 this.tickingInterval = null, this.onScrollCallback = null, this.scrollContainer = e.scrollC
36675ontainer, this.scrollHorizontally = e.scrollAxis.indexOf("x") !== -1, this.scrollVertically = e.scrollAxis.indexOf("y") !== -1, this.scrollByTick = e.scrollByTick != null ? e.scrollByTick : 20, e.onScrollCallback && (this.onScrollCallback = e.onScrollCallback), this.scrollVertically && (this.getVerticalPosition = e.getVerticalPosition, this.setVerticalPosition = e.setVerticalPosition), this.scrollHorizontally && (this.getHorizontalPosition = e.getHorizontalPosition, this.setHorizontalPosition = e.setHorizontalPosition), this.shouldSkipVerticalScroll = e.shouldSkipVerticalScroll || (() => !1), this.shouldSkipHorizontalScroll = e.shouldSkipHorizontalScroll || (() => !1); 36676 } 36677 check(e, t = !1) { 36678 const i = t || this.shouldSkipVerticalScroll(); 36679 if (i && this.shouldSkipHorizontalScroll()) 36680 return; 36681 const s = this.scrollContainer.getBoundingClientRect(), n = this.scrollByTick; 36682 this.tickLeft = e.clientX < s.left + n, this.tickRight = e.clientX > s.right - n, this.tickUp = e.clientY < s.top + n && !i, this.tickDown = e.clientY > s.bottom - n && !i, this.tickLeft || this.tickRight || this.tickUp || this.tickDown ? this.ensureTickingStarted() : this.ensureCleared(); 36683 } 36684 ensureTickingStarted() { 36685 this.tickingInterval === null && (this.tickingInterval = window.setInterval(this.doTick.bind(this), 100), this.tickCount = 0); 36686 } 36687 doTick() { 36688 this.tickCount++; 36689 const e = this.tickCount > 20 ? 200 : this.tickCount > 10 ? 80 : 40; 36690 if (this.scrollVertically) { 36691 const t = this.getVerticalPosition(); 36692 this.tickUp && this.setVerticalPosition(t - e), this.tickDown && this.setVerticalPosition(t + e); 36693 } 36694 if (this.scrollHorizontally) { 36695 const t = this.getHorizontalPosition(); 36696 this.tickLeft && this.setHorizontalPosition(t - e), this.tickRight && this.setHorizontalPosition(t + e); 36697 } 36698 this.onScrollCallback && this.onScrollCallback(); 36699 } 36700 ensureCleared() { 36701 this.tickingInterval && (window.clearInterval(this.tickingInterval), this.tickingInterval = null); 36702 } 36703}; 36704function hee(e) { 36705 const { rowIndex: t, rowPinned: i, column: s } = e; 36706 return `${t}.${i ?? "null"}.${s.getId()}`; 36707} 36708function Qw(e, t) { 36709 const i = e.column === t.column, s = e.rowPinned === t.rowPinned, n = e.rowIndex === t.rowIndex; 36710 return i && s && n; 36711} 36712function pee(e, t) { 36713 switch (e.rowPinned) { 36714 case "top": 36715 if (t.rowPinned !== "top") 36716 return !0; 36717 break; 36718 case "bottom": 36719 if (t.rowPinned !== "bottom") 36720 return !1; 36721 break; 36722 default: 36723 if (Ie(t.rowPinned)) 36724 return t.rowPinned !== "top"; 36725 break; 36726 } 36727 return e.rowIndex < t.rowIndex; 36728} 36729function gee(e, t) { 36730 return !e && !t ? !0 : e && !t || !e && t ? !1 : e.rowIndex === t.rowIndex && e.rowPinned == t.rowPinned; 36731} 36732function fee(e) { 36733 let t = 0, i; 36734 const { pinnedRowModel: s, rowModel: n, pageBounds: o } = e; 36735 return s?.getPinnedTopRowCount() ? i = "top" : n.getRowCount() ? (i = null, t = o.getFirstRow()) : s?.getPinnedBottomRowCount() && (i = "bottom"), i === void 0 ? null : { rowIndex: t, rowPinned: i }; 36736} 36737function mee(e) { 36738 let t, i = null; 36739 const { pinnedRowModel: s, pageBounds: n } = e, o = s?.getPinnedBottomRowCount(), r = s?.getPinnedTopRowCount(); 36740 return o ? (i = "bottom", t = o - 1) : e.rowModel.getRowCount() ? (i = null, t = n.getLastRow()) : r && (i = "top", t = r - 1), t === void 0 ? null : { rowIndex: t, rowPinned: i }; 36741} 36742function Xw(e, t) { 36743 switch (t.rowPinned) { 36744 case "top": 36745 return e.pinnedRowModel?.getPinnedTopRow(t.rowIndex); 36746 case "bottom": 36747 return e.pinnedRowModel?.getPinnedBottomRow(t.rowIndex); 36748 default: 36749 return e.rowModel.getRow(t.rowIndex); 36750 } 36751} 36752function Ku(e, t) { 36753 const i = e.rowRenderer.getRowByPosition(t); 36754 return i ? i.getCellCtrl(t.column) : null; 36755} 36756var vee = class extends he { 36757 constructor(e) { 36758 super(), this.eContainer = e; 36759 } 36760 postConstruct() { 36761 const { rowModel: e, gos: t, ctrlsSvc: i } = this.beans; 36762 $s(t) && (this.clientSideRowModel = e), i.whenReady(this, (s) => { 36763 const n = s.gridBodyCtrl; 36764 this.autoScrollService = new dee({ 36765 scrollContainer: n.eBodyViewport, 36766 scrollAxis: "y", 36767 getVerticalPosition: () => n.scrollFeature.getVScrollPosition().top, 36768 setVerticalPosition: (o) => n.scrollFeature.setVerticalScrollPosition(o), 36769 onScrollCallback: () => { 36770 this.onDragging(this.lastDraggingEvent); 36771 } 36772 }); 36773 }); 36774 } 36775 getContainer() { 36776 return this.eContainer; 36777 } 36778 isInterestedIn(e) { 36779 return e === 2; 36780 } 36781 getIconName() { 36782 return this.gos.get("rowDragManaged") && this.shouldPreventRowMove() ? "notAllowed" : "move"; 36783 } 36784 shouldPreventRowMove() { 36785 const { rowGroupColsSvc: e, filterManager: t, sortSvc: i } = this.beans; 36786 return !!((e?.columns ?? []).length || t?.isAnyFilterPresent() || i?.isSortActive()); 36787 } 36788 getRowNodes(e) { 36789 if (!this.isFromThisGrid(e)) 36790 return e.dragItem.rowNodes || []; 36791 const t = e.dragItem.rowNode; 36792 if (this.gos.get("rowDragMultiRow")) { 36793 const s = [...this.beans.selectionSvc?.getSelectedNodes() ?? []].sort((n, o) => n.rowIndex == null || o.rowIndex == null ? 0 : this.getRowIndexNumber(n) - this.getRowIndexNumber(o)); 36794 if (s.indexOf(t) !== -1) 36795 return s; 36796 } 36797 return [t]; 36798 } 36799 onDragEnter(e) { 36800 e.dragItem.rowNodes = this.getRowNodes(e), this.dispatchGridEvent("rowDragEnter", e), this.getRowNodes(e).forEach((t) => { 36801 this.setRowNodeDragging(t, !0); 36802 }), this.onEnterOrDragging(e); 36803 } 36804 onDragging(e) { 36805 this.onEnterOrDragging(e); 36806 } 36807 isFromThisGrid(e) { 36808 const { dragSourceDomDataKey: t } = e.dragSource; 36809 return t === this.gos.getDomDataKey(); 36810 } 36811 onEnterOrDragging(e) { 36812 this.dispatchGridEvent("rowDragMove", e), this.lastDraggingEvent = e; 36813 const t = M0(this.beans, e).y; 36814 this.gos.get("rowDragManaged") && this.doManagedDrag(e, t), this.autoScrollService.check(e.event); 36815 } 36816 doManagedDrag(e, t) { 36817 const { dragAndDrop: i, gos: s } = this.beans, n = this.isFromThisGrid(e), o = s.get("rowDragManaged"), r = e.dragItem.rowNodes; 36818 o && this.shouldPreventRowMove() || (s.get("suppressMoveWhenRowDragging") || !n ? i.isDropZoneWithinThisGrid(e) && this.clientSideRowModel.highlightRowAtPixel(r[0], t) : this.moveRows(r, t)); 36819 } 36820 getRowIndexNumber(e) { 36821 const t = e.getRowIndexString(); 36822 return parseInt(It(t.split("-")), 10); 36823 } 36824 moveRowAndClearHighlight(e) { 36825 const t = this.clientSideRowModel, i = t.getLastHighlightedRowNode(), s = i && i.highlighted === "Below", n = M0(this.beans, e).y, o = e.dragItem.rowNodes; 36826 let r = s ? 1 : 0; 36827 if (this.isFromThisGrid(e)) 36828 o.forEach((a) => { 36829 a.rowTop < n && (r -= 1); 36830 }), this.moveRows(o, n, r); 36831 else { 36832 const a = Ad(this.gos); 36833 let l = t.getRowIndexAtPixel(n) + 1; 36834 t.getHighlightPosition(n) === "Above" && l--, t.updateRowData({ 36835 add: o.filter( 36836 (c) => !t.getRowNode( 36837 a?.({ data: c.data, level: 0, rowPinned: c.rowPinned }) ?? c.data.id 36838 ) 36839 ).map((c) => c.data), 36840 addIndex: l 36841 }); 36842 } 36843 this.clearRowHighlight(); 36844 } 36845 clearRowHighlight() { 36846 this.clientSideRowModel.highlightRowAtPixel(null); 36847 } 36848 moveRows(e, t, i = 0) { 36849 const s = this.beans.focusSvc, n = s.getFocusedCell(), o = n && Ku(this.beans, n); 36850 this.clientSideRowModel.ensureRowsAtPixel(e, t, i) && (o ? o.focusCell() : s.clearFocusedCell()); 36851 } 36852 addRowDropZone(e) { 36853 if (!e.getContainer()) { 36854 Ae(55); 36855 return; 36856 } 36857 const t = this.beans.dragAndDrop; 36858 if (t.findExternalZone(e)) { 36859 Ae(56); 36860 return; 36861 } 36862 let i = { 36863 getContainer: e.getContainer 36864 }; 36865 e.fromGrid ? i = e : (e.onDragEnter && (i.onDragEnter = (n) => { 36866 e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter", n)); 36867 }), e.onDragLeave && (i.onDragLeave = (n) => { 36868 e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave", n)); 36869 }), e.onDragging && (i.onDragging = (n) => { 36870 e.onDragging(this.draggingToRowDragEvent("rowDragMove", n)); 36871 }), e.onDragStop && (i.onDragStop = (n) => { 36872 e.onDragStop(this.draggingToRowDragEvent("rowDragEnd", n)); 36873 }
36873), e.onDragCancel && (i.onDragCancel = (n) => { 36874 e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel", n)); 36875 })); 36876 const s = { 36877 isInterestedIn: (n) => n === 2, 36878 getIconName: () => "move", 36879 external: !0, 36880 ...i 36881 }; 36882 t.addDropTarget(s), this.addDestroyFunc(() => t.removeDropTarget(s)); 36883 } 36884 getRowDropZone(e) { 36885 const t = this.getContainer.bind(this), i = this.onDragEnter.bind(this), s = this.onDragLeave.bind(this), n = this.onDragging.bind(this), o = this.onDragStop.bind(this), r = this.onDragCancel.bind(this); 36886 let a; 36887 return e ? a = { 36888 getContainer: t, 36889 onDragEnter: e.onDragEnter ? (l) => { 36890 i(l), e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter", l)); 36891 } : i, 36892 onDragLeave: e.onDragLeave ? (l) => { 36893 s(l), e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave", l)); 36894 } : s, 36895 onDragging: e.onDragging ? (l) => { 36896 n(l), e.onDragging(this.draggingToRowDragEvent("rowDragMove", l)); 36897 } : n, 36898 onDragStop: e.onDragStop ? (l) => { 36899 o(l), e.onDragStop(this.draggingToRowDragEvent("rowDragEnd", l)); 36900 } : o, 36901 onDragCancel: e.onDragCancel ? (l) => { 36902 r(l), e.onDragCancel(this.draggingToRowDragEvent("rowDragCancel", l)); 36903 } : r, 36904 fromGrid: !0 36905 } : a = { 36906 getContainer: t, 36907 onDragEnter: i, 36908 onDragLeave: s, 36909 onDragging: n, 36910 onDragStop: o, 36911 onDragCancel: r, 36912 /* @private */ 36913 fromGrid: !0 36914 }, a; 36915 } 36916 draggingToRowDragEvent(e, t) { 36917 const i = this.beans, { pageBounds: s, rowModel: n, gos: o } = i, r = M0(i, t).y, a = r > s.getCurrentPageHeight(); 36918 let l = -1, c; 36919 return a || (l = n.getRowIndexAtPixel(r), c = n.getRow(l)), o.addGridCommonParams({ 36920 type: e, 36921 event: t.event, 36922 node: t.dragItem.rowNode, 36923 nodes: t.dragItem.rowNodes, 36924 overIndex: l, 36925 overNode: c, 36926 y: r, 36927 vDirection: t.vDirection 36928 }); 36929 } 36930 dispatchGridEvent(e, t) { 36931 const i = this.draggingToRowDragEvent(e, t); 36932 this.eventSvc.dispatchEvent(i); 36933 } 36934 onDragLeave(e) { 36935 this.dispatchGridEvent("rowDragLeave", e), this.stopDragging(e), this.gos.get("rowDragManaged") && this.clearRowHighlight(); 36936 } 36937 onDragStop(e) { 36938 this.dispatchGridEvent("rowDragEnd", e), this.stopDragging(e); 36939 const { dragAndDrop: t, gos: i } = this.beans; 36940 i.get("rowDragManaged") && (i.get("suppressMoveWhenRowDragging") || !this.isFromThisGrid(e)) && t.isDropZoneWithinThisGrid(e) && this.moveRowAndClearHighlight(e); 36941 } 36942 onDragCancel(e) { 36943 this.dispatchGridEvent("rowDragCancel", e), this.stopDragging(e); 36944 const { dragAndDrop: t, gos: i } = this.beans; 36945 i.get("rowDragManaged") && (i.get("suppressMoveWhenRowDragging") || !this.isFromThisGrid(e)) && t.isDropZoneWithinThisGrid(e) && this.clearRowHighlight(); 36946 } 36947 stopDragging(e) { 36948 this.autoScrollService.ensureCleared(), this.getRowNodes(e).forEach((t) => { 36949 this.setRowNodeDragging(t, !1); 36950 }); 36951 } 36952 setRowNodeDragging(e, t) { 36953 e.dragging !== t && (e.dragging = t, e.dispatchRowEvent("draggingChanged")); 36954 } 36955}; 36956function vN(e, t, i) { 36957 if (i === 0) 36958 return !1; 36959 const s = Math.abs(e.clientX - t.clientX), n = Math.abs(e.clientY - t.clientY); 36960 return Math.max(s, n) <= i; 36961} 36962var yee = class extends he { 36963 constructor() { 36964 super(...arguments), this.beanName = "dragSvc", this.dragEndFunctions = [], this.dragSources = []; 36965 } 36966 destroy() { 36967 const { dragSources: e } = this; 36968 e.forEach(this.removeListener.bind(this)), e.length = 0, super.destroy(); 36969 } 36970 removeListener(e) { 36971 const t = e.dragSource.eElement, i = e.mouseDownListener; 36972 if (t.removeEventListener("mousedown", i), e.touchEnabled) { 36973 const s = e.touchStartListener; 36974 t.removeEventListener("touchstart", s, { passive: !0 }); 36975 } 36976 } 36977 removeDragSource(e) { 36978 const { dragSources: t } = this, i = t.find((s) => s.dragSource === e); 36979 i && (this.removeListener(i), Ko(t, i)); 36980 } 36981 addDragSource(e) { 36982 const t = this.onMouseDown.bind(this, e), { eElement: i, includeTouch: s, stopPropagationForTouch: n } = e; 36983 i.addEventListener("mousedown", t); 36984 let o = null; 36985 const r = this.gos.get("suppressTouch"); 36986 s && !r && (o = (a) => { 36987 X1(a.target) || (n && a.stopPropagation(), this.onTouchStart(e, a)); 36988 }, i.addEventListener("touchstart", o, { passive: !1 })), this.dragSources.push({ 36989 dragSource: e, 36990 mouseDownListener: t, 36991 touchStartListener: o, 36992 touchEnabled: !!s 36993 }); 36994 } 36995 // gets called whenever mouse down on any drag source 36996 onTouchStart(e, t) { 36997 this.currentDragParams = e, this.dragging = !1; 36998 const i = t.touches[0]; 36999 this.touchLastTime = i, this.touchStart = i; 37000 const s = (l) => this.onTouchMove(l, e.eElement), n = (l) => this.onTouchUp(l, e.eElement), o = (l) => { 37001 l.cancelable && l.preventDefault(); 37002 }, r = t.target, a = [
37003 // Prevents the page document from moving while we are dragging items around. 37004 // preventDefault needs to be called in the touchmove listener and never inside the 37005 // touchstart, because using touchstart causes the click event to be cancelled on touch devices. 37006 { 37007 target: Kp(this.beans), 37008 type: "touchmove", 37009 listener: o, 37010 options: { passive: !1 } 37011 }, 37012 { target: r, type: "touchmove", listener: s, options: { passive: !0 } }, 37013 { target: r, type: "touchend", listener: n, options: { passive: !0 } }, 37014 { target: r, type: "touchcancel", listener: n, options: { passive: !0 } } 37015 ]; 37016 this.addTemporaryEvents(a), e.dragStartPixels === 0 && this.onCommonMove(i, this.touchStart, e.eElement); 37017 } 37018 // gets called whenever mouse down on any drag source 37019 onMouseDown(e, t) { 37020 const i = t; 37021 if (e.skipMouseEvent && e.skipMouseEvent(t) || i._alreadyProcessedByDragService || (i._alreadyProcessedByDragService = !0, t.button !== 0)) 37022 return; 37023 this.shouldPreventMouseEvent(t) && t.preventDefault(), this.currentDragParams = e, this.dragging = !1, this.mouseStartEvent = t, this.startTarget = t.target; 37024 const s = (c) => this.onMouseMove(c, e.eElement), n = (c) => this.onMouseUp(c, e.eElement), o = (c) => c.preventDefault(), r = (c) => { 37025 c.key === de.ESCAPE && this.cancelDrag(e.eElement); 37026 }, a = Kp(this.beans), l = [ 37027 { target: a, type: "mousemove", listener: s }, 37028 { target: a, type: "mouseup", listener: n }, 37029 { target: a, type: "contextmenu", listener: o }, 37030 { target: a, type: "keydown", listener: r } 37031 ]; 37032 this.addTemporaryEvents(l), e.dragStartPixels === 0 && this.onMouseMove(t, e.eElement); 37033 } 37034 addTemporaryEvents(e) { 37035 e.forEach((t) => { 37036 const { target: i, type: s, listener: n, options: o } = t; 37037 i.addEventListener(s, n, o); 37038 }), this.dragEndFunctions.push(() => { 37039 e.forEach((t) => { 37040 const { target: i, type: s, listener: n, options: o } = t; 37041 i.removeEventListener(s, n, o); 37042 }); 37043 }); 37044 } 37045 // returns true if the event is close to the original event by X pixels either vertically or horizontally. 37046 // we only start dragging after X pixels so this allows us to know if we should start dragging yet. 37047 isEventNearStartEvent(e, t) { 37048 const { dragStartPixels: i } = this.currentDragParams, s = Ie(i) ? i : 4; 37049 return vN(e, t, s); 37050 } 37051 getFirstActiveTouch(e) { 37052 for (let t = 0; t < e.length; t++) 37053 if (e[t].identifier === this.touchStart.identifier) 37054 return e[t]; 37055 return null; 37056 } 37057 onCommonMove(e, t, i) { 37058 if (!this.dragging) { 37059 if (this.isEventNearStartEvent(e, t)) 37060 return; 37061 if (this.dragging = !0, this.eventSvc.dispatchEvent({ 37062 type: "dragStarted", 37063 target: i 37064 }), this.currentDragParams.onDragStart(t), !this.currentDragParams) { 37065 this.dragging = !1; 37066 return; 37067 } 37068 this.currentDragParams.onDragging(t); 37069 } 37070 this.currentDragParams?.onDragging(e); 37071 } 37072 onTouchMove(e, t) { 37073 const i = this.getFirstActiveTouch(e.touches); 37074 i && this.onCommonMove(i, this.touchStart, t); 37075 } 37076 // only gets called after a mouse down - as this is only added after mouseDown 37077 // and is removed when mouseUp happens 37078 onMouseMove(e, t) { 37079 Jc() && Ei(this.beans).getSelection()?.removeAllRanges(), this.shouldPreventMouseEvent(e) && e.preventDefault(), this.onCommonMove(e, this.mouseStartEvent, t); 37080 } 37081 shouldPreventMouseEvent(e) { 37082 const { gos: t } = this, i = t.get("enableCellTextSelection"), s = e.type === "mousemove", n = (o) => !!o.target?.tagName.toLocaleLowerCase()?.match("^a$|textarea|input|select|button"); 37083 return ( 37084 // when `isEnableCellTextSelect` is `true`, we need to preventDefault on mouseMove 37085 // to avoid the grid text being selected while dragging components. 37086 i && s && e.cancelable && gv(t, e) && !n(e) 37087 ); 37088 } 37089 onTouchUp(e, t) { 37090 let i = this.getFirstActiveTouch(e.changedTouches); 37091 i || (i = this.touchLastTime), this.onUpCommon(i, t); 37092 } 37093 onMouseUp(e, t) { 37094 this.onUpCommon(e, t); 37095 } 37096 onUpCommon(e, t) { 37097 this.dragging && (this.dragging = !1, this.currentDragParams.onDragStop(e), this.eventSvc.dispatchEvent({ 37098 type: "dragStopped", 37099 target: t 37100 })), this.resetDragProperties(); 37101 } 37102 cancelDrag(e) { 37103 this.eventSvc.dispatchEvent({ 37104 type: "dragCancelled", 37105 target: e 37106 }), this.currentDragParams?.onDragCancel?.(), this.resetDragProperties(); 37107 } 37108 resetDragProperties() { 37109 this.mouseStartEvent = null, this.startTarget = null, this.touchStart = null, this.touchLastTime = null, this.currentDragParams = null; 37110 const { dragEndFunctions: e } = this; 37111 e.forEach((t) => t()), e.length = 0; 37112 } 37113}; 37114function yN(e, t) { 37115 return e + "_" + t; 37116} 37117function xi(e) { 37118 return e instanceof CN; 37119} 37120var CN = class extends he {
37121 constructor(e, t, i, s) { 37122 super(), this.providedColumnGroup = e, this.groupId = t, this.partId = i, this.pinned = s, this.isColumn = !1, this.displayedChildren = [], this.autoHeaderHeight = null, this.parent = null; 37123 } 37124 // as the user is adding and removing columns, the groups are recalculated. 37125 // this reset clears out all children, ready for children to be added again 37126 reset() { 37127 this.parent = null, this.children = null, this.displayedChildren = null; 37128 } 37129 getParent() { 37130 return this.parent; 37131 } 37132 getUniqueId() { 37133 return yN(this.groupId, this.partId); 37134 } 37135 isEmptyGroup() { 37136 return this.displayedChildren.length === 0; 37137 } 37138 isMoving() { 37139 const e = this.getProvidedColumnGroup().getLeafColumns(); 37140 return !e || e.length === 0 ? !1 : e.every((t) => t.isMoving()); 37141 } 37142 checkLeft() { 37143 if (this.displayedChildren.forEach((e) => { 37144 xi(e) && e.checkLeft(); 37145 }), this.displayedChildren.length > 0) 37146 if (this.gos.get("enableRtl")) { 37147 const t = It(this.displayedChildren).getLeft(); 37148 this.setLeft(t); 37149 } else { 37150 const e = this.displayedChildren[0].getLeft(); 37151 this.setLeft(e); 37152 } 37153 else 37154 this.setLeft(null); 37155 } 37156 getLeft() { 37157 return this.left; 37158 } 37159 getOldLeft() { 37160 return this.oldLeft; 37161 } 37162 setLeft(e) { 37163 this.oldLeft = this.left, this.left !== e && (this.left = e, this.dispatchLocalEvent({ type: "leftChanged" })); 37164 } 37165 getPinned() { 37166 return this.pinned; 37167 } 37168 getGroupId() { 37169 return this.groupId; 37170 } 37171 getPartId() { 37172 return this.partId; 37173 } 37174 getActualWidth() { 37175 let e = 0; 37176 return this.displayedChildren?.forEach((t) => { 37177 e += t.getActualWidth(); 37178 }), e; 37179 } 37180 isResizable() { 37181 if (!this.displayedChildren) 37182 return !1; 37183 let e = !1; 37184 return this.displayedChildren.forEach((t) => { 37185 t.isResizable() && (e = !0); 37186 }), e; 37187 } 37188 getMinWidth() { 37189 let e = 0; 37190 return this.displayedChildren.forEach((t) => { 37191 e += t.getMinWidth(); 37192 }), e; 37193 } 37194 addChild(e) { 37195 this.children || (this.children = []), this.children.push(e); 37196 } 37197 getDisplayedChildren() { 37198 return this.displayedChildren; 37199 } 37200 getLeafColumns() { 37201 const e = []; 37202 return this.addLeafColumns(e), e; 37203 } 37204 getDisplayedLeafColumns() { 37205 const e = []; 37206 return this.addDisplayedLeafColumns(e), e; 37207 } 37208 getDefinition() { 37209 return this.providedColumnGroup.getColGroupDef(); 37210 } 37211 getColGroupDef() { 37212 return this.providedColumnGroup.getColGroupDef(); 37213 } 37214 isPadding() { 37215 return this.providedColumnGroup.isPadding(); 37216 } 37217 isExpandable() { 37218 return this.providedColumnGroup.isExpandable(); 37219 } 37220 isExpanded() { 37221 return this.providedColumnGroup.isExpanded(); 37222 } 37223 setExpanded(e) { 37224 this.providedColumnGroup.setExpanded(e); 37225 } 37226 isAutoHeaderHeight() { 37227 return !!this.getColGroupDef()?.autoHeaderHeight; 37228 } 37229 getAutoHeaderHeight() { 37230 return this.autoHeaderHeight; 37231 } 37232 /** Returns true if the header height has changed */ 37233 setAutoHeaderHeight(e) { 37234 const t = e !== this.autoHeaderHeight; 37235 return this.autoHeaderHeight = e, t; 37236 } 37237 addDisplayedLeafColumns(e) { 37238 this.displayedChildren.forEach((t) => { 37239 Al(t) ? e.push(t) : xi(t) && t.addDisplayedLeafColumns(e); 37240 }); 37241 } 37242 addLeafColumns(e) { 37243 this.children.forEach((t) => { 37244 Al(t) ? e.push(t) : xi(t) && t.addLeafColumns(e); 37245 }); 37246 } 37247 getChildren() { 37248 return this.children; 37249 } 37250 getColumnGroupShow() { 37251 return this.providedColumnGroup.getColumnGroupShow(); 37252 } 37253 getProvidedColumnGroup() { 37254 return this.providedColumnGroup; 37255 } 37256 getPaddingLevel() { 37257 const e = this.getParent(); 37258 return !this.isPadding() || !e || !e.isPadding() ? 0 : 1 + e.getPaddingLevel(); 37259 } 37260 calculateDisplayedColumns() { 37261 this.displayedChildren = []; 37262 let e = this; 37263 for (; e != null && e.isPadding(); ) 37264 e = e.getParent(); 37265 if (!(e ? e.getProvidedColumnGroup().isExpandable() : !1)) { 37266 this.displayedChildren = this.children, this.dispatchLocalEvent({ type: "displayedChildrenChanged" }); 37267 return; 37268 } 37269 this.children.forEach((i) => { 37270 if (xi(i) && (!i.displayedChildren || !i.displayedChildren.length)) 37271 return; 37272 switch (i.getColumnGroupShow()) { 37273 case "open": 37274 e.getProvidedColumnGroup().isExpanded() && this.displayedChildren.push(i); 37275 break; 37276 case "closed": 37277 e.getProvidedColumnGroup().isExpanded() || this.displayedChildren.push(i); 37278 break; 37279 default: 37280 this.displayedChildren.push(i); 37281 break; 37282 } 37283 }), this.dispatchLocalEvent({ type: "displayedChildrenChanged" }); 37284 } 37285}, Jw = "row-group-", bN = "t-", wN = "b-", Cee = 0, Rd = class { 37286 constructor(e) { 37287 this.master = !1, this.detail = void 0, this.rowIndex = null, this.key = null, this.sourceRowIndex = -1, this.childrenMapped = {}, this.treeNode = null, this.treeNodeFlags = 0, this.displayed = !1, this.rowTop = null, this.oldRowTop = null, this.selectable = !0, this.__objectId = Cee++, this.alreadyRendered = !1, this.highlighted = null, this.hovered = !1, this.__selected = !1, this.beans = e; 37288 } 37289 /** 37290 * Replaces the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed. 37291 */ 37292 setData(e) { 37293 this.setDataCommon(e, !1); 37294 } 37295 // similar to setRowData, however it is expected that the data is the same data item. this 37296 // is intended to be used with Redux type stores, where the whole data can be changed. we are 37297 // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the 37298 // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving 37299 // dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions). 37300 /** 37301 * Updates the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed. 37302 */ 37303 updateData(e) { 37304 this.setDataCommon(e, !0); 37305 } 37306 setDataCommon(e, t) { 37307 const i = this.data; 37308 this.data = e, this.beans.valueCache?.onDataChanged(), this.updateDataOnDetailNode(), this.beans.selectionSvc?.updateRowSelectable(this), this.resetQuickFilterAggregateText(); 37309 const s = this.createDataChangedEvent(e, i, t); 37310 this.__localEventService?.dispatchEvent(s); 37311 } 37312 // when we are doing master / detail, the detail node is lazy created, but then kept around. 37313 // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data 37314 // in sync, otherwise expand/collapse of the detail would still show the old values. 37315 updateDataOnDetailNode() { 37316 this.detailNode && (this.detailNode.data = this.data); 37317 } 37318 createDataChangedEvent(e, t, i) { 37319 return { 37320 type: "dataChanged", 37321 node: this, 37322 oldData: t, 37323 newData: e, 37324 update: i 37325 }; 37326 } 37327 getRowIndexString() { 37328 return this.rowIndex == null ? (Rt(13), null) : this.rowPinned === "top" ? bN + this.rowIndex : this.rowPinned === "bottom" ? wN + this.rowIndex : this.rowIndex.toString(); 37329 } 37330 setDataAndId(e, t) { 37331 const { selectionSvc: i } = this.beans, s = i?.createDaemonNode?.(this), n = this.data; 37332 this.data = e, this.updateDataOnDetailNode(), this.setId(t), i && (i.updateRowSelectable(this), i.syncInRowNode(this, s)); 37333 const o = this.createDataChangedEvent(e, n, !1); 37334 this.__localEventService?.dispatchEvent(o); 37335 } 37336 setId(e) { 37337 const t = Ad(this.beans.gos); 37338 if (t) 37339 if (this.data) { 37340 const i = this.parent?.getRoute() ?? []; 37341 this.id = t({ 37342 data: this.data, 37343 parentKeys: i.length > 0 ? i : void 0, 37344 level: this.level, 37345 rowPinned: this.rowPinned 37346 }), this.id.startsWith(Jw) && Rt(14, { 37347 groupPrefix: Jw 37348 }); 37349 } else 37350 this.id = void 0; 37351 else 37352 this.id = e; 37353 } 37354 setRowTop(e) { 37355 this.oldRowTop = this.rowTop, this.rowTop !== e && (this.rowTop = e, this.dispatchRowEvent("topChanged"), this.setDisplayed(e !== null)); 37356 } 37357 clearRowTopAndRowIndex() { 37358 this.oldRowTop = null, this.setRowTop(null), this.setRowIndex(null); 37359 } 37360 setHovered(e) { 37361 this.hovered = e; 37362 } 37363 isHovered() { 37364 return this.hovered; 37365 } 37366 /** 37367 * Sets the row height. 37368 * Call if you want to change the height initially assigned to the row. 37369 * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */ 37370 setRowHeight(e, t = !1) { 37371 this.rowHeight = e, this.rowHeightEstimated = t, this.dispatchRowEvent("heightChanged"); 37372 } 37373 setExpanded(e, t, i) { 37374 this.beans.expansionSvc?.setExpanded(this, e, t, i); 37375 } 37376 /** 37377 * Replaces the value on the `rowNode` for the specified column. When complete, 37378 * the grid will refresh the rendered cell on the required row only. 37379 * **Note**: This method only fires `onCellEditRequest` when the Grid is in **Read Only** mode. 37380 * 37381 * @param colKey The column where the value should be updated 37382 * @param newValue The new value 37383 * @param eventSource The source of the event 37384 * @returns `true` if the value was changed, otherwise `false`. 37385 */ 37386 setDataValue(e, t, i) { 37387 const { colModel: s, valueSvc: n, gos: o, selectionSvc: r } = this.beans, a = typeof e != "string" ? e : s.getCol(e) ?? s.getColDefCol(e); 37388 if (!a) 37389 return !1; 37390 const l = n.getValueForDisplay(a, this); 37391 if (o.get("readOnlyEdit")) { 37392 const { 37393 beans: { eventSvc: u }, 37394 data: d, 37395 rowIndex: p, 37396 rowPinned: f 37397 } = this; 37398 return u.dispatchEvent({ 37399 type: "cellEditRequest", 37400 event: null, 37401 rowIndex: p, 37402 rowPinned: f, 37403 column: a, 37404 colDef: a.colDef, 37405 data: d, 37406 node: this, 37407 oldValue: l, 37408 newValue: t, 37409 value: t, 37410 source: i 37411 }), !1; 37412 } 37413 const c = n.setValue(this, a, t, i); 37414 return this.dispatchCellChangedEvent(a, t, l), r?.updateRowSelectable(this), c; 37415 } 37416 updateHasChildren() { 37417 let e = this.group && !this.footer || this.childrenAfterGroup && this.childrenAfterGroup.length > 0; 37418 const { rowChildrenSvc: t } = this.beans; 37419 t && (e = t.getHasChildrenValue(this)), e !== this.__hasChildren && (this.__hasChildren = !!e, this.dispatchRowEvent("hasChildrenChanged")); 37420 } 37421 hasChildren() { 37422 return this.__hasChildren == null && this.updateHasChildren(), this.__hasChildren; 37423 } 37424 dispatchCellChangedEvent(e, t, i) { 37425 const s = { 37426 type: "cellChanged", 37427 node: this, 37428 column: e, 37429 newValue: t, 37430 oldValue: i 37431 }; 37432 this.__localEventService?.dispatchEvent(s); 37433 } 37434 /** 37435 * The first time `quickFilter` runs, the grid creates a one-off string representation of the row. 37436 * This string is then used for the quick filter instead of hitting each column separately. 37437 * When you edit, using grid editing, this string gets cleared down. 37438 * However if you edit without using grid editing, you will need to clear this string down for the row to be updated with the new values. 37439 * Otherwise new values will not work with the `quickFilter`. */ 37440 resetQuickFilterAggregateText() { 37441 this.quickFilterAggregateText = null; 37442 } 37443 /** Returns: 37444 * - `true` if the node can be expanded, i.e it is a group or master row. 37445 * - `false` if the node cannot be expanded 37446 */ 37447 isExpandable() { 37448 return this.beans.expansionSvc?.isExpandable(this) ?? !1; 37449 } 37450 /** Returns: 37451 * - `true` if node is selected, 37452 * - `false` if the node isn't selected 37453 * - `undefined` if it's partially selected (group where not all children are selected). */ 37454 isSelected() { 37455 return this.footer ? this.sibling.isSelected() : this.__selected; 37456 } 37457 /** Perform a depth-first search of this node and its children. */ 37458 depthFirstSearch(e) { 37459 this.childrenAfterGroup?.forEach((t) => t.depthFirstSearch(e)), e(this); 37460 } 37461 dispatchRowEvent(e) { 37462 this.__localEventService?.dispatchEvent({ 37463 type: e, 37464 node: this 37465 }); 37466 } 37467 /** 37468 * Select (or deselect) the node. 37469 * @param newValue -`true` for selection, `false` for deselection. 37470 * @param clearSelection - If selecting, then passing `true` will select the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact. 37471 * @param source - Source property that will appear in the `selectionChanged` event. 37472 */ 37473 setSelected(e, t = !1, i = "api") {
37474 this.beans.selectionSvc?.setNodesSelected({ 37475 nodes: [this], 37476 newValue: e, 37477 clearSelection: t, 37478 source: i 37479 }); 37480 } 37481 /** 37482 * Returns: 37483 * - `true` if node is either pinned to the `top` or `bottom` 37484 * - `false` if the node isn't pinned 37485 */ 37486 isRowPinned() { 37487 return !!this.rowPinned; 37488 } 37489 /** Add an event listener. */ 37490 addEventListener(e, t) { 37491 this.beans.validation?.checkRowEvents(e), this.__localEventService || (this.__localEventService = new ih()), this.frameworkEventListenerService = this.beans.frameworkOverrides.createLocalEventListenerWrapper?.( 37492 this.frameworkEventListenerService, 37493 this.__localEventService 37494 ); 37495 const i = this.frameworkEventListenerService?.wrap(t) ?? t; 37496 this.__localEventService.addEventListener(e, i); 37497 } 37498 /** Remove event listener. */ 37499 removeEventListener(e, t) { 37500 if (!this.__localEventService) 37501 return; 37502 const i = this.frameworkEventListenerService?.unwrap(t) ?? t; 37503 this.__localEventService.removeEventListener(e, i), this.__localEventService.noRegisteredListenersExist() && (this.__localEventService = null); 37504 } 37505 /** 37506 * @deprecated v32.2.0 Check `node.detail` then user provided callback `isFullWidthRow` instead. 37507 * 37508 * Returns: 37509 * - `true` if the node is a full width cell 37510 * - `false` if the node is not a full width cell 37511 */ 37512 isFullWidthCell() { 37513 if (Ae(61), this.detail) 37514 return !0; 37515 const e = this.beans.gos.getCallback("isFullWidthRow"); 37516 return e ? e({ rowNode: this }) : !1; 37517 } 37518 /** 37519 * Returns the route of keys to the row node. Returns undefined if the node has no key. 37520 */ 37521 getRoute() { 37522 if (this.level === -1) 37523 return []; 37524 if (this.key == null) 37525 return; 37526 const e = []; 37527 let t = this; 37528 for (; t && t.key != null; ) 37529 e.push(t.key), t = t.parent; 37530 return e.reverse(); 37531 } 37532 setFirstChild(e) { 37533 this.firstChild !== e && (this.firstChild = e, this.dispatchRowEvent("firstChildChanged")); 37534 } 37535 setDisplayed(e) { 37536 this.displayed !== e && (this.displayed = e, this.dispatchRowEvent("displayedChanged")); 37537 } 37538 setRowIndex(e) { 37539 this.rowIndex !== e && (this.rowIndex = e, this.dispatchRowEvent("rowIndexChanged")); 37540 } 37541 setAllChildrenCount(e) { 37542 this.allChildrenCount !== e && (this.allChildrenCount = e, this.dispatchRowEvent("allChildrenCountChanged")); 37543 } 37544 setUiLevel(e) { 37545 this.uiLevel !== e && (this.uiLevel = e, this.dispatchRowEvent("uiLevelChanged")); 37546 } 37547}; 37548function bee(e, t, i) { 37549 return t.addGridCommonParams({ 37550 type: i, 37551 node: e, 37552 data: e.data, 37553 rowIndex: e.rowIndex, 37554 rowPinned: e.rowPinned 37555 }); 37556} 37557var wee = class extends Tt { 37558 constructor(e, t) { 37559 super( 37560 /* html */ 37561 '<div class="ag-filter"></div>' 37562 ), this.column = e, this.source = t, this.filterWrapper = null; 37563 } 37564 postConstruct() { 37565 this.createFilter(!0), this.addManagedEventListeners({ filterDestroyed: this.onFilterDestroyed.bind(this) }); 37566 } 37567 hasFilter() { 37568 return !!this.filterWrapper; 37569 } 37570 getFilter() { 37571 return this.filterWrapper?.filterPromise ?? null; 37572 } 37573 afterInit() { 37574 return this.filterWrapper?.filterPromise?.then(() => { 37575 }) ?? gn.resolve(); 37576 } 37577 afterGuiAttached(e) { 37578 this.filterWrapper?.filterPromise?.then((t) => { 37579 t?.afterGuiAttached?.(e); 37580 }); 37581 } 37582 afterGuiDetached() { 37583 this.filterWrapper?.filterPromise?.then((e) => { 37584 e?.afterGuiDetached?.(); 37585 }); 37586 } 37587 createFilter(e) { 37588 const { column: t, source: i } = this; 37589 this.filterWrapper = this.beans.filterManager?.getOrCreateFilterWrapper(t) ?? null, this.filterWrapper?.filterPromise && this.filterWrapper.filterPromise.then((s) => { 37590 const n = s.getGui(); 37591 Ie(n) || Ae(69, { guiFromFilter: n }), this.appendChild(n), e && this.eventSvc.dispatchEvent({ 37592 type: "filterOpened", 37593 column: t, 37594 source: i, 37595 eGui: this.getGui() 37596 }); 37597 }); 37598 } 37599 onFilterDestroyed(e) { 37600 (e.source === "api" || e.source === "paramsUpdated") && e.column.getId() === this.column.getId() && this.beans.colModel.getColDefCol(this.column) && (Is(this.getGui()), this.createFilter()); 37601 } 37602 destroy() { 37603 this.filterWrapper = null, super.destroy(); 37604 } 37605}, SN = "ag-resizer-wrapper", Ya = (e, t) => `<div data-ref="${e}Resizer" class="ag-resizer ag-resizer-${t}"></div>`, See = ( 37606 /* html */ 37607 `<div class="${SN}"> 37608 ${Ya("eTopLeft", "topLeft")} 37609 ${Ya("eTop", "top")} 37610 ${Ya("eTopRight", "topRight")} 37611 ${Ya("eRight", "right")} 37612 ${Ya("eBottomRight", "bottomRight")} 37613 ${Ya("eBottom", "bottom")} 37614 ${Ya("eBottomLeft", "bottomLeft")} 37615 ${Ya("eLeft", "left")} 37616 </div>` 37617), xee = class extends he {
37618 constructor(e, t) { 37619 super(), this.element = e, this.dragStartPosition = { 37620 x: 0, 37621 y: 0 37622 }, this.position = { 37623 x: 0, 37624 y: 0 37625 }, this.lastSize = { 37626 width: -1, 37627 height: -1 37628 }, this.positioned = !1, this.resizersAdded = !1, this.resizeListeners = [], this.boundaryEl = null, this.isResizing = !1, this.isMoving = !1, this.resizable = {}, this.movable = !1, this.currentResizer = null, this.config = Object.assign({}, { popup: !1 }, t); 37629 } 37630 wireBeans(e) { 37631 this.popupSvc = e.popupSvc, this.dragSvc = e.dragSvc; 37632 } 37633 center() { 37634 const { clientHeight: e, clientWidth: t } = this.offsetParent, i = t / 2 - this.getWidth() / 2, s = e / 2 - this.getHeight() / 2; 37635 this.offsetElement(i, s); 37636 } 37637 initialisePosition() { 37638 if (this.positioned) 37639 return; 37640 const { centered: e, forcePopupParentAsOffsetParent: t, minWidth: i, width: s, minHeight: n, height: o, x: r, y: a } = this.config; 37641 this.offsetParent || this.setOffsetParent(); 37642 let l = 0, c = 0; 37643 const u = Yo(this.element); 37644 if (u) { 37645 const d = this.findBoundaryElement(), p = window.getComputedStyle(d); 37646 if (p.minWidth != null) { 37647 const f = d.offsetWidth - this.element.offsetWidth; 37648 c = parseInt(p.minWidth, 10) - f; 37649 } 37650 if (p.minHeight != null) { 37651 const f = d.offsetHeight - this.element.offsetHeight; 37652 l = parseInt(p.minHeight, 10) - f; 37653 } 37654 } 37655 if (this.minHeight = n || l, this.minWidth = i || c, s && this.setWidth(s), o && this.setHeight(o), (!s || !o) && this.refreshSize(), e) 37656 this.center(); 37657 else if (r || a) 37658 this.offsetElement(r, a); 37659 else if (u && t) { 37660 let d = this.boundaryEl, p = !0; 37661 if (d || (d = this.findBoundaryElement(), p = !1), d) { 37662 const f = parseFloat(d.style.top), m = parseFloat(d.style.left); 37663 p ? this.offsetElement(isNaN(m) ? 0 : m, isNaN(f) ? 0 : f) : this.setPosition(m, f); 37664 } 37665 } 37666 this.positioned = !!this.offsetParent; 37667 } 37668 isPositioned() { 37669 return this.positioned; 37670 } 37671 getPosition() { 37672 return this.position; 37673 } 37674 setMovable(e, t) { 37675 if (!this.config.popup || e === this.movable) 37676 return; 37677 this.movable = e; 37678 const i = this.moveElementDragListener || { 37679 eElement: t, 37680 onDragStart: this.onMoveStart.bind(this), 37681 onDragging: this.onMove.bind(this), 37682 onDragStop: this.onMoveEnd.bind(this) 37683 }; 37684 e ? (this.dragSvc?.addDragSource(i), this.moveElementDragListener = i) : (this.dragSvc?.removeDragSource(i), this.moveElementDragListener = void 0); 37685 } 37686 setResizable(e) { 37687 if (this.clearResizeListeners(), e ? this.addResizers() : this.removeResizers(), typeof e == "boolean") { 37688 if (e === !1) 37689 return; 37690 e = { 37691 topLeft: e, 37692 top: e, 37693 topRight: e, 37694 right: e, 37695 bottomRight: e, 37696 bottom: e, 37697 bottomLeft: e, 37698 left: e 37699 }; 37700 } 37701 Object.keys(e).forEach((t) => { 37702 const s = !!e[t], n = this.getResizerElement(t), o = { 37703 dragStartPixels: 0, 37704 eElement: n, 37705 onDragStart: (r) => this.onResizeStart(r, t), 37706 onDragging: this.onResize.bind(this), 37707 onDragStop: (r) => this.onResizeEnd(r, t) 37708 }; 37709 (s || !this.isAlive() && !s) && (s ? (this.dragSvc?.addDragSource(o), this.resizeListeners.push(o), n.style.pointerEvents = "all") : n.style.pointerEvents = "none", this.resizable[t] = s); 37710 }); 37711 } 37712 removeSizeFromEl() { 37713 this.element.style.removeProperty("height"), this.element.style.removeProperty("width"), this.element.style.removeProperty("flex"); 37714 } 37715 restoreLastSize() { 37716 this.element.style.flex = "0 0 auto"; 37717 const { height: e, width: t } = this.lastSize; 37718 t !== -1 && (this.element.style.width = `${t}px`), e !== -1 && (this.element.style.height = `${e}px`); 37719 } 37720 getHeight() { 37721 return this.element.offsetHeight; 37722 } 37723 setHeight(e) { 37724 const { popup: t } = this.config, i = this.element; 37725 let s = !1; 37726 if (typeof e == "string" && e.indexOf("%") !== -1) 37727 up(i, e), e = CO(i), s = !0; 37728 else if (e = Math.max(this.minHeight, e), this.positioned) { 37729 const n = this.getAvailableHeight(); 37730 n && e > n && (e = n); 37731 } 37732 this.getHeight() !== e && (s ? (i.style.maxHeight = "unset", i.style.minHeight = "unset") : t ? up(i, e) : (i.style.height = `${e}px`, i.style.flex = "0 0 auto", this.lastSize.height = typeof e == "number" ? e : parseFloat(e))); 37733 } 37734 getAvailableHeight() { 37735 const { popup: e, forcePopupParentAsOffsetParent: t } = this.config; 37736 this.positioned || this.initialisePosition(); 37737 const { clientHeight: i } = this.offsetParent; 37738 if (!i) 37739 return null; 37740 const s = this.element.getBoundingClientRect(), n = this.offsetParent.getBoundingClientRect(), o = e ? this.position.y : s.top, r = e ? 0 : n.top; 37741 let a = 0; 37742 if (t) { 37743 const c = this.element.parentElement; 37744 if (c) { 37745 const { bottom: u } = c.getBoundingClientRect(); 37746 a = u - s.bottom; 37747 } 37748 } 37749 return i + r - o - a; 37750 } 37751 getWidth() { 37752 return this.element.offsetWidth; 37753 } 37754 setWidth(e) { 37755 const t = this.element, { popup: i } = this.config; 37756 let s = !1; 37757 if (typeof e == "string" && e.indexOf("%") !== -1) 37758 mr(t, e), e = Jm(t), s = !0; 37759 else if (this.positioned) { 37760 e = Math.max(this.minWidth, e); 37761 const { clientWidth: n } = this.offsetParent, o = i ? this.position.x : this.element.getBoundingClientRect().left; 37762 n && e + o > n && (e = n - o); 37763 } 37764 this.getWidth() !== e && (s ? (t.style.maxWidth = "unset", t.style.minWidth = "unset") : this.config.popup ? mr(t, e) : (t.style.width = `${e}px`, t.style.flex = " unset", this.lastSize.width = typeof e == "number" ? e : parseFloat(e))); 37765 } 37766 offsetElement(e = 0, t = 0) { 37767 const { forcePopupParentAsOffsetParent: i } = this.config, s = i ? this.boundaryEl : this.element; 37768 s && (this.popupSvc?.positionPopup({ 37769 ePopup: s, 37770 keepWithinBounds: !0, 37771 skipObserver: this.movable || this.isResizable(), 37772 updatePosition: () => ({ x: e, y: t }) 37773 }), this.setPosition(parseFloat(s.style.left), parseFloat(s.style.top))); 37774 } 37775 constrainSizeToAvailableHeight(e) { 37776 if (!this.config.forcePopupParentAsOffsetParent) 37777 return; 37778 const t = () => { 37779 const i = this.getAvailableHeight(); 37780 this.element.style.setProperty("max-height", `${i}px`); 37781 }; 37782 e && this.popupSvc ? this.resizeObserverSubscriber = zl( 37783 this.beans, 37784 this.popupSvc?.getPopupParent(), 37785 t 37786 ) : (this.element.style.removeProperty("max-height"), this.resizeObserverSubscriber && (this.resizeObserverSubscriber(), this.resizeObserverSubscriber = void 0)); 37787 } 37788 setPosition(e, t) { 37789 this.position.x = e, this.position.y = t; 37790 } 37791 updateDragStartPosition(e, t) { 37792 this.dragStartPosition = { x: e, y: t }; 37793 } 37794 calculateMouseMovement(e) { 37795 const { e: t, isLeft: i, isTop: s, anywhereWithin: n, topBuffer: o } = e, r = t.clientX - this.dragStartPosition.x, a = t.clientY - this.dragStartPosition.y, l = this.shouldSkipX(t, !!i, !!n, r) ? 0 : r, c = this.shouldSkipY(t, !!s, o, a) ? 0 : a; 37796 return { movementX: l, movementY: c }; 37797 } 37798 shouldSkipX(e, t, i, s) { 37799 const n = this.element.getBoundingClientRect(), o = this.offsetParent.getBoundingClientRect(), r = this.boundaryEl.getBoundingClientRect(), a = this.config.popup ? this.position.x : n.left; 37800 let l = a <= 0 && o.left >= e.clientX || o.right <= e.clientX && o.right <= r.right; 37801 return l ? !0 : (t ? l = // skip if we are moving to the left and the cursor 37802 // is positioned to the right of the left side anchor 37803 s < 0 && e.clientX > a + o.left || // skip if we are moving to the right and the cursor 37804 // is positioned to the left of the dialog 37805 s > 0 && e.clientX < a + o.left : i ? l = s < 0 && e.clientX > r.right || s > 0 && e.clientX < a + o.left : l = // if the movement is bound to the right side of the dialog 37806 // we skip if we are moving to the left and the cursor 37807 // is to the right of the dialog 37808 s < 0 && e.clientX > r.right || // or skip if we are moving to the right and the cursor 37809 // is to the left of the right side anchor 37810 s > 0 && e.clientX < r.right, l); 37811 } 37812 shouldSkipY(e, t, i = 0, s) { 37813 const n = this.element.getBoundingClientRect(), o = this.offsetParent.getBoundingClientRect(), r = this.boundaryEl.getBoundingClientRect(), a = this.config.popup ? this.position.y : n.top; 37814 let l = a <= 0 && o.top >= e.clientY || o.bottom <= e.clientY && o.bottom <= r.bottom; 37815 return l ? !0 : (t ? l = // skip if we are moving to towards top and the cursor is 37816 // below the top anchor + topBuffer 37817 // note: topBuffer is used when moving the dialog using the title bar 37818 s < 0 && e.clientY > a + o.top + i || // skip if we are moving to the bottom and the cursor is 37819 // above the top anchor 37820 s > 0 && e.clientY < a + o.top : l = // skip if we are moving towards the top and the cursor
37821 // is below the bottom anchor 37822 s < 0 && e.clientY > r.bottom || // skip if we are moving towards the bottom and the cursor 37823 // is above the bottom anchor 37824 s > 0 && e.clientY < r.bottom, l); 37825 } 37826 createResizeMap() { 37827 const e = this.element; 37828 this.resizerMap = { 37829 topLeft: { element: e.querySelector("[data-ref=eTopLeftResizer]") }, 37830 top: { element: e.querySelector("[data-ref=eTopResizer]") }, 37831 topRight: { element: e.querySelector("[data-ref=eTopRightResizer]") }, 37832 right: { element: e.querySelector("[data-ref=eRightResizer]") }, 37833 bottomRight: { element: e.querySelector("[data-ref=eBottomRightResizer]") }, 37834 bottom: { element: e.querySelector("[data-ref=eBottomResizer]") }, 37835 bottomLeft: { element: e.querySelector("[data-ref=eBottomLeftResizer]") }, 37836 left: { element: e.querySelector("[data-ref=eLeftResizer]") } 37837 }; 37838 } 37839 addResizers() { 37840 if (this.resizersAdded) 37841 return; 37842 const e = this.element; 37843 if (!e) 37844 return; 37845 const i = new DOMParser().parseFromString(See, "text/html").body; 37846 e.appendChild(i.firstChild), this.createResizeMap(), this.resizersAdded = !0; 37847 } 37848 removeResizers() { 37849 this.resizerMap = void 0; 37850 const e = this.element.querySelector(`.${SN}`); 37851 e && this.element.removeChild(e), this.resizersAdded = !1; 37852 } 37853 getResizerElement(e) { 37854 return this.resizerMap[e].element; 37855 } 37856 onResizeStart(e, t) { 37857 this.boundaryEl = this.findBoundaryElement(), this.positioned || this.initialisePosition(), this.currentResizer = { 37858 isTop: !!t.match(/top/i), 37859 isRight: !!t.match(/right/i), 37860 isBottom: !!t.match(/bottom/i), 37861 isLeft: !!t.match(/left/i) 37862 }, this.element.classList.add("ag-resizing"), this.resizerMap[t].element.classList.add("ag-active"); 37863 const { popup: i, forcePopupParentAsOffsetParent: s } = this.config; 37864 !i && !s && this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop), this.isResizing = !0, this.updateDragStartPosition(e.clientX, e.clientY); 37865 } 37866 getSiblings() { 37867 const t = this.element.parentElement; 37868 return t ? Array.prototype.slice.call(t.children).filter((i) => !i.classList.contains("ag-hidden")) : null; 37869 } 37870 getMinSizeOfSiblings() { 37871 const e = this.getSiblings() || []; 37872 let t = 0, i = 0; 37873 for (let s = 0; s < e.length; s++) { 37874 const n = e[s], o = !!n.style.flex && n.style.flex !== "0 0 auto"; 37875 if (n === this.element) 37876 continue; 37877 let r = this.minHeight || 0, a = this.minWidth || 0; 37878 if (o) { 37879 const l = window.getComputedStyle(n); 37880 l.minHeight && (r = parseInt(l.minHeight, 10)), l.minWidth && (a = parseInt(l.minWidth, 10)); 37881 } else 37882 r = n.offsetHeight, a = n.offsetWidth; 37883 t += r, i += a; 37884 } 37885 return { height: t, width: i }; 37886 } 37887 applySizeToSiblings(e) { 37888 let t = null; 37889 const i = this.getSiblings(); 37890 if (i) { 37891 for (let s = 0; s < i.length; s++) { 37892 const n = i[s]; 37893 n !== t && (e ? n.style.height = `${n.offsetHeight}px` : n.style.width = `${n.offsetWidth}px`, n.style.flex = "0 0 auto", n === this.element && (t = i[s + 1])); 37894 } 37895 t && (t.style.removeProperty("height"), t.style.removeProperty("min-height"), t.style.removeProperty("max-height"), t.style.flex = "1 1 auto"); 37896 } 37897 } 37898 isResizable() { 37899 return Object.values(this.resizable).some((e) => e); 37900 } 37901 onResize(e) { 37902 if (!this.isResizing || !this.currentResizer) 37903 return; 37904 const { popup: t, forcePopupParentAsOffsetParent: i } = this.config, { isTop: s, isRight: n, isBottom: o, isLeft: r } = this.currentResizer, a = n || r, l = o || s, { movementX: c, movementY: u } = this.calculateMouseMovement({ e, isLeft: r, isTop: s }), d = this.position.x, p = this.position.y; 37905 let f = 0, m = 0; 37906 if (a && c) { 37907 const y = r ? -1 : 1, b = this.getWidth(), C = b + c * y; 37908 let w = !1; 37909 r && (f = b - C, (d + f <= 0 || C <= this.minWidth) && (w = !0, f = 0)), w || this.setWidth(C); 37910 } 37911 if (l && u) { 37912 const y = s ? -1 : 1, b = this.getHeight(), C = b + u * y; 37913 let w = !1; 37914 s ? (m = b - C, (p + m <= 0 || C <= this.minHeight) && (w = !0, m = 0)) : !this.config.popup && !this.config.forcePopupParentAsOffsetParent && b < C && this.getMinSizeOfSiblings().height + C > this.element.parentElement.offsetHeight && (w = !0), w || this.setHeight(C); 37915 } 37916 this.updateDragStartPosition(e.clientX, e.clientY), ((t || i) && f || m) && this.offsetElement(d + f, p + m); 37917 } 37918 onResizeEnd(e, t) { 37919 this.isResizing = !1, this.currentResizer = null, this.boundaryEl = null, this.element.classList.remove("ag-resizing"), this.resizerMap[t].element.classList.remove("ag-active"), this.dispatchLocalEvent({ type: "resize" }); 37920 } 37921 refreshSize() { 37922 const e = this.element; 37923 this.config.popup && (this.config.width || this.setWidth(e.offsetWidth), this.config.height || this.setHeight(e.offsetHeight)); 37924 } 37925 onMoveStart(e) { 37926 this.boundaryEl = this.findBoundaryElement(), this.positioned || this.initialisePosition(), this.isMoving = !0, this.element.classList.add("ag-moving"), this.updateDragStartPosition(e.clientX, e.clientY); 37927 } 37928 onMove(e) { 37929 if (!this.isMoving) 37930 return; 37931 const { x: t, y: i } = this.position; 37932 let s; 37933 this.config.calculateTopBuffer && (s = this.config.calculateTopBuffer()); 37934 const { movementX: n, movementY: o } = this.calculateMouseMovement({ 37935 e, 37936 isTop: !0, 37937 anywhereWithin: !0, 37938 topBuffer: s 37939 }); 37940 this.offsetElement(t + n, i + o), this.updateDragStartPosition(e.clientX, e.clientY); 37941 } 37942 onMoveEnd() { 37943 this.isMoving = !1, this.boundaryEl = null, this.element.classList.remove("ag-moving"); 37944 } 37945 setOffsetParent() { 37946 this.config.forcePopupParentAsOffsetParent && this.popupSvc ? this.offsetParent = this.popupSvc.getPopupParent() : this.offsetParent = this.element.offsetParent; 37947 } 37948 findBoundaryElement() { 37949 let e = this.element; 37950 for (; e; ) { 37951 if (window.getComputedStyle(e).position !== "static") 37952 return e; 37953 e = e.parentElement; 37954 } 37955 return this.element; 37956 } 37957 clearResizeListeners() { 37958 for (; this.resizeListeners.length; ) { 37959 const e = this.resizeListeners.pop(); 37960 this.dragSvc?.removeDragSource(e); 37961 } 37962 } 37963 destroy() { 37964 super.destroy(), this.moveElementDragListener && this.dragSvc?.removeDragSource(this.moveElementDragListener), this.constrainSizeToAvailableHeight(!1), this.clearResizeListeners(), this.removeResizers(); 37965 } 37966}, Mee = "ag-focus-managed", sh = class extends he {
37967 constructor(e, t = {}) { 37968 super(), this.eFocusable = e, this.callbacks = t, this.callbacks = { 37969 shouldStopEventPropagation: () => !1, 37970 onTabKeyDown: (i) => { 37971 if (i.defaultPrevented) 37972 return; 37973 const s = iu(this.beans, this.eFocusable, !1, i.shiftKey); 37974 s && (s.focus(), i.preventDefault()); 37975 }, 37976 ...t 37977 }; 37978 } 37979 postConstruct() { 37980 const { 37981 eFocusable: e, 37982 callbacks: { onFocusIn: t, onFocusOut: i } 37983 } = this; 37984 e.classList.add(Mee), this.addKeyDownListeners(e), t && this.addManagedElementListeners(e, { focusin: t }), i && this.addManagedElementListeners(e, { focusout: i }); 37985 } 37986 addKeyDownListeners(e) { 37987 this.addManagedElementListeners(e, { 37988 keydown: (t) => { 37989 if (t.defaultPrevented || ra(t)) 37990 return; 37991 const { callbacks: i } = this; 37992 if (i.shouldStopEventPropagation(t)) { 37993 Dd(t); 37994 return; 37995 } 37996 t.key === de.TAB ? i.onTabKeyDown(t) : i.handleKeyDown && i.handleKeyDown(t); 37997 } 37998 }); 37999 } 38000}, xN = { 38001 applyFilter: "Apply", 38002 clearFilter: "Clear", 38003 resetFilter: "Reset", 38004 cancelFilter: "Cancel", 38005 textFilter: "Text Filter", 38006 numberFilter: "Number Filter", 38007 dateFilter: "Date Filter", 38008 setFilter: "Set Filter", 38009 filterOoo: "Filter...", 38010 empty: "Choose one", 38011 equals: "Equals", 38012 notEqual: "Does not equal", 38013 lessThan: "Less than", 38014 greaterThan: "Greater than", 38015 inRange: "Between", 38016 inRangeStart: "From", 38017 inRangeEnd: "To", 38018 lessThanOrEqual: "Less than or equal to", 38019 greaterThanOrEqual: "Greater than or equal to", 38020 contains: "Contains", 38021 notContains: "Does not contain", 38022 startsWith: "Begins with", 38023 endsWith: "Ends with", 38024 blank: "Blank", 38025 notBlank: "Not blank", 38026 before: "Before", 38027 after: "After", 38028 andCondition: "AND", 38029 orCondition: "OR", 38030 dateFormatOoo: "yyyy-mm-dd" 38031}; 38032function dM(e, t) { 38033 const { debounceMs: i } = e; 38034 return fv(e) ? (i != null && Ae(71), 0) : i ?? t; 38035} 38036function fv(e) { 38037 return (e.buttons?.indexOf("apply") ?? -1) >= 0; 38038} 38039var Aee = class extends Tt { 38040 constructor(e) { 38041 super(), this.filterNameKey = e, this.applyActive = !1, this.hidePopup = null, this.debouncePending = !1, this.appliedModel = null, this.eFilterBody = Pe, this.buttonListeners = [], this.defaultDebounceMs = 0; 38042 } 38043 postConstruct() { 38044 this.resetTemplate(), this.createManagedBean( 38045 new sh(this.getFocusableElement(), { 38046 handleKeyDown: this.handleKeyDown.bind(this) 38047 }) 38048 ), this.positionableFeature = new xee(this.getPositionableElement(), { 38049 forcePopupParentAsOffsetParent: !0 38050 }), this.createBean(this.positionableFeature); 38051 } 38052 // override 38053 // eslint-disable-next-line @typescript-eslint/no-unused-vars 38054 handleKeyDown(e) { 38055 } 38056 getFilterTitle() { 38057 return this.translate(this.filterNameKey); 38058 } 38059 isFilterActive() { 38060 return !!this.appliedModel; 38061 } 38062 resetTemplate(e) { 38063 let t = this.getGui(); 38064 t && t.removeEventListener("submit", this.onFormSubmit); 38065 const i = ( 38066 /* html */ 38067 ` 38068 <form class="ag-filter-wrapper"> 38069 <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody"> 38070 ${this.createBodyTemplate()} 38071 </div> 38072 </form>` 38073 ); 38074 this.setTemplate(i, this.getAgComponents(), e), t = this.getGui(), t?.addEventListener("submit", this.onFormSubmit); 38075 } 38076 isReadOnly() { 38077 return !!this.params.readOnly; 38078 } 38079 init(e) { 38080 this.setParams(e), this.resetUiToDefaults(!0).then(() => { 38081 this.updateUiVisibility(), this.setupOnBtApplyDebounce(); 38082 }); 38083 } 38084 setParams(e) { 38085 this.params = e, this.applyActive = fv(e), this.resetButtonsPanel(e); 38086 } 38087 updateParams(e) { 38088 this.params = e, this.applyActive = fv(e), this.resetUiToActiveModel(this.getModel(), () => { 38089 this.updateUiVisibility(), this.setupOnBtApplyDebounce(); 38090 }); 38091 } 38092 resetButtonsPanel(e, t) { 38093 const { buttons: i, readOnly: s } = t ?? {}, { buttons: n, readOnly: o } = e; 38094 if (s === o && Yp(i, n)) 38095 return; 38096 const r = n && n.length > 0 && !this.isReadOnly(); 38097 if (this.eButtonsPanel ? (Is(this.eButtonsPanel), this.buttonListeners.forEac
38097h((c) => c()), this.buttonListeners = []) : r && (this.eButtonsPanel = document.createElement("div"), this.eButtonsPanel.classList.add("ag-filter-apply-panel")), !r) { 38098 this.eButtonsPanel && pr(this.eButtonsPanel); 38099 return; 38100 } 38101 const a = document.createDocumentFragment(), l = (c) => { 38102 let u; 38103 const d = c ? this.translate(`${c}Filter`) : void 0; 38104 switch (c) { 38105 case "apply": 38106 u = (m) => this.onBtApply(!1, !1, m); 38107 break; 38108 case "clear": 38109 u = () => this.onBtClear(); 38110 break; 38111 case "reset": 38112 u = () => this.onBtReset(); 38113 break; 38114 case "cancel": 38115 u = (m) => { 38116 this.onBtCancel(m); 38117 }; 38118 break; 38119 default: 38120 Ae(75); 38121 return; 38122 } 38123 const f = $p( 38124 /* html */ 38125 `<button 38126 type="${c === "apply" ? "submit" : "button"}" 38127 data-ref="${c}FilterButton" 38128 class="ag-button ag-standard-button ag-filter-apply-panel-button" 38129 >${d} 38130 </button>` 38131 ); 38132 this.buttonListeners.push(...this.addManagedElementListeners(f, { click: u })), a.append(f); 38133 };
38134 n.forEach((c) => l(c)), this.eButtonsPanel.append(a), this.getGui().appendChild(this.eButtonsPanel); 38135 } 38136 setupOnBtApplyDebounce() { 38137 const e = dM(this.params, this.defaultDebounceMs), t = qs(this, this.checkApplyDebounce.bind(this), e); 38138 this.onBtApplyDebounce = () => { 38139 this.debouncePending = !0, t(); 38140 }; 38141 } 38142 checkApplyDebounce() { 38143 this.debouncePending && (this.debouncePending = !1, this.onBtApply()); 38144 } 38145 getModel() { 38146 return this.appliedModel ?? null; 38147 } 38148 setModel(e) { 38149 return (e != null ? this.setModelIntoUi(e) : this.resetUiToDefaults()).then(() => { 38150 this.updateUiVisibility(), this.applyModel("api"); 38151 }); 38152 } 38153 onBtCancel(e) { 38154 this.resetUiToActiveModel(this.getModel(), () => { 38155 this.handleCancelEnd(e); 38156 }); 38157 } 38158 handleCancelEnd(e) { 38159 this.params.closeOnApply && this.close(e); 38160 } 38161 resetUiToActiveModel(e, t) { 38162 const i = () => { 38163 this.onUiChanged(!1, "prevent"), t?.(); 38164 }; 38165 e != null ? this.setModelIntoUi(e).then(i) : this.resetUiToDefaults().then(i); 38166 } 38167 onBtClear() { 38168 this.resetUiToDefaults().then(() => this.onUiChanged()); 38169 } 38170 onBtReset() { 38171 this.onBtClear(), this.onBtApply(); 38172 } 38173 /** 38174 * Applies changes made in the UI to the filter, and returns true if the model has changed. 38175 */ 38176 // eslint-disable-next-line @typescript-eslint/no-unused-vars 38177 applyModel(e = "api") { 38178 const t = this.getModelFromUi(); 38179 if (!this.isModelValid(t)) 38180 return !1; 38181 const i = this.appliedModel; 38182 return this.appliedModel = t, !this.areModelsEqual(i, t); 38183 } 38184 // eslint-disable-next-line @typescript-eslint/no-unused-vars 38185 isModelValid(e) { 38186 return !0; 38187 } 38188 onFormSubmit(e) { 38189 e.preventDefault(); 38190 } 38191 onBtApply(e = !1, t = !1, i) { 38192 i && i.preventDefault(), this.applyModel(t ? "rowDataUpdated" : "ui") && this.params.filterChangedCallback({ afterFloatingFilter: e, afterDataChange: t, source: "columnFilter" }); 38193 const { closeOnApply: s } = this.params; 38194 s && this.applyActive && !e && !t && this.close(i); 38195 } 38196 onNewRowsLoaded() { 38197 } 38198 close(e) { 38199 if (!this.hidePopup) 38200 return; 38201 const t = e, i = t && t.key; 38202 let s; 38203 (i === "Enter" || i === "Space") && (s = { keyboardEvent: t }), this.hidePopup(s), this.hidePopup = null; 38204 } 38205 /** 38206 * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no 38207 * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can 38208 * be adjusted by using the apply parameter. 38209 */ 38210 onUiChanged(e = !1, t) { 38211 if (this.updateUiVisibility(), this.params.filterModifiedCallback(), this.applyActive && !this.isReadOnly()) { 38212 const i = this.isModelValid(this.getModelFromUi()), s = this.queryForHtmlElement('[data-ref="applyFilterButton"]'); 38213 s && Wp(s, !i); 38214 } 38215 e && !t || t === "immediately" ? this.onBtApply(e) : (!this.applyActive && !t || t === "debounce") && this.onBtApplyDebounce(); 38216 } 38217 afterGuiAttached(e) { 38218 e && (this.hidePopup = e.hidePopup), this.refreshFilterResizer(e?.container); 38219 } 38220 refreshFilterResizer(e) { 38221 const { positionableFeature: t, gos: i } = this; 38222 if (!t || e === "toolPanel") 38223 return; 38224 e === "floatingFilter" || e === "columnFilter" ? (t.restoreLastSize(), t.setResizable( 38225 i.get("enableRtl") ? { bottom: !0, bottomLeft: !0, left: !0 } : { bottom: !0, bottomRight: !0, right: !0 } 38226 )) : (t.removeSizeFromEl(), t.setResizable(!1)), t.constrainSizeToAvailableHeight(!0); 38227 } 38228 afterGuiDetached() { 38229 this.checkApplyDebounce(), this.positionableFeature?.constrainSizeToAvailableHeight(!1); 38230 } 38231 refresh(e) { 38232 const t = this.params; 38233 return this.params = e, this.resetButtonsPanel(e, t), !0; 38234 } 38235 destroy() { 38236 const e = this.getGui(); 38237 e && e.removeEventListener("submit", this.onFormSubmit), this.hidePopup = null, this.positionableFeature && (this.positionableFeature = this.destroyBean(this.positionableFeature)), this.appliedModel = null, super.destroy(); 38238 } 38239 translate(e) { 38240 return this.getLocaleTextFunc()(e, xN[e]); 38241 } 38242 getCellValue(e) { 38243 return this.params.getValue(e); 38244 } 38245 // override to control positionable feature 38246 getPositionableElement() { 38247 return this.eFilterBody; 38248 } 38249}; 38250function Dee(e, t, i) { 38251 if (t == null) 38252 return null; 38253 let s = null; 38254 const { compName: n, jsComp: o, fwComp: r } = IJ(e, t); 38255 return n ? s = { 38256 agSetColumnFilter: "agSetColumnFloatingFilter", 38257 agMultiColumnFilter: "agMultiColumnFloatingFilter", 38258 agGroupColumnFilter: "agGroupColumnFloatingFilter", 38259 agNumberColumnFilter: "agNumberColumnFloatingFilter", 38260 agDateColumnFilter: "agDateColumnFloatingFilter", 38261 agTextColumnFilter: "agTextColumnFloatingFilter" 38262 }[n] : o == null && r == null && t.filter === !0 && (s = i()), s; 38263} 38264var No = { 38265 AUTO_HEIGHT: "ag-layout-auto-height", 38266 NORMAL: "ag-layout-normal", 38267 PRINT: "ag-layout-print" 38268}, hM = class extends he {
38269 constructor(e) { 38270 super(), this.view = e; 38271 } 38272 postConstruct() { 38273 this.addManagedPropertyListener("domLayout", this.updateLayoutClasses.bind(this)), this.updateLayoutClasses(); 38274 } 38275 updateLayoutClasses() { 38276 const e = this.gos.get("domLayout"), t = { 38277 autoHeight: e === "autoHeight", 38278 normal: e === "normal", 38279 print: e === "print" 38280 }, i = t.autoHeight ? No.AUTO_HEIGHT : t.print ? No.PRINT : No.NORMAL; 38281 this.view.updateLayoutClasses(i, t); 38282 } 38283}, Ka = "Viewport", YR = "fakeVScrollComp", KR = [ 38284 "fakeHScrollComp", 38285 "centerHeader", 38286 "topCenter", 38287 "bottomCenter", 38288 "stickyTopCenter", 38289 "stickyBottomCenter" 38290], Eee = class extends he { 38291 constructor(e) { 38292 super(), this.lastScrollSource = [null, null], this.scrollLeft = -1, this.nextScrollTop = -1, this.scrollTop = -1, this.lastOffsetHeight = -1, this.lastScrollTop = -1, this.scrollTimer = 0, this.needsRefreshedScrollPosition = !0, this.eBodyViewport = e, this.resetLastHScrollDebounced = qs( 38293 this, 38294 () => this.lastScrollSource[ 38295 1 38296 /* Horizontal */ 38297 ] = null, 38298 500 38299 ), this.resetLastVScrollDebounced = qs( 38300 this, 38301 () => this.lastScrollSource[ 38302 0 38303 /* Vertical */ 38304 ] = null, 38305 500 38306 ); 38307 } 38308 wireBeans(e) { 38309 this.ctrlsSvc = e.ctrlsSvc, this.animationFrameSvc = e.animationFrameSvc, this.visibleCols = e.visibleCols; 38310 } 38311 destroy() { 38312 super.destroy(), window.clearTimeout(this.scrollTimer); 38313 } 38314 postConstruct() { 38315 this.enableRtl = this.gos.get("enableRtl"); 38316 const e = this.requireUpdatedScrollPosition.bind(this); 38317 this.addManagedEventListeners({ 38318 displayedColumnsWidthChanged: this.onDisplayedColumnsWidthChanged.bind(this), 38319 gridSizeChanged: e 38320 }), this.addManagedElementListeners(this.eBodyViewport, { 38321 scroll: e 38322 }), this.ctrlsSvc.whenReady(this, (t) => { 38323 this.centerRowsCtrl = t.center, this.onDisplayedColumnsWidthChanged(), this.addScrollListener(); 38324 }); 38325 } 38326 requireUpdatedScrollPosition() { 38327 this.needsRefreshedScrollPosition = !0; 38328 } 38329 addScrollListener() { 38330 this.addHorizontalScrollListeners(), this.addVerticalScrollListeners(); 38331 } 38332 addHorizontalScrollListeners() { 38333 this.addManagedElementListeners(this.centerRowsCtrl.eViewport, { 38334 scroll: this.onHScroll.bind(this, Ka) 38335 }); 38336 for (const e of KR) { 38337 const t = this.ctrlsSvc.get(e); 38338 this.registerScrollPartner(t, this.onHScroll.bind(this, e)); 38339 } 38340 } 38341 addVerticalScrollListeners() { 38342 const e = this.ctrlsSvc.get("fakeVScrollComp"), t = this.gos.get("debounceVerticalScrollbar"), i = t ? qs(this, this.onVScroll.bind(this, Ka), 100) : this.onVScroll.bind(this, Ka), s = t ? qs(this, this.onVScroll.bind(this, YR), 100) : this.onVScroll.bind(this, YR); 38343 this.addManagedElementListeners(this.eBodyViewport, { scroll: i }), this.registerScrollPartner(e, s); 38344 } 38345 registerScrollPartner(e, t) { 38346 e.onScrollCallback(t); 38347 } 38348 onDisplayedColumnsWidthChanged() { 38349 this.enableRtl && this.horizontallyScrollHeaderCenterAndFloatingCenter(); 38350 } 38351 horizontallyScrollHeaderCenterAndFloatingCenter(e) { 38352 this.centerRowsCtrl != null && (e === void 0 && (e = this.centerRowsCtrl.getCenterViewportScrollLeft()), this.setScrollLeftForAllContainersExceptCurrent(Math.abs(e))); 38353 } 38354 setScrollLeftForAllContainersExceptCurrent(e) { 38355 for (const t of [...KR, Ka]) { 38356 if (this.lastScrollSource[ 38357 1 38358 /* Horizontal */ 38359 ] === t) 38360 continue; 38361 const i = this.getViewportForSource(t); 38362 iv(i, e, this.enableRtl); 38363 } 38364 } 38365 getViewportForSource(e) { 38366 return e === Ka ? this.centerRowsCtrl.eViewport : this.ctrlsSvc.get(e).eViewport; 38367 } 38368 isControllingScroll(e, t) { 38369 return this.lastScrollSource[t] == null ? (t === 0 ? this.lastScrollSource[0] = e : this.lastScrollSource[1] = e, !0) : this.lastScrollSource[t] === e; 38370 } 38371 onHScroll(e) { 38372 if (!this.isControllingScroll( 38373 e, 38374 1 38375 /* Horizontal */ 38376 )) 38377 return; 38378 const t = this.centerRowsCtrl.eViewport, { scrollLeft: i } = t; 38379 if (this.shouldBlockScrollUpdate(1, i, !0)) 38380 return; 38381 const s = tv(this.getViewportForSource(e), this.enableRtl); 38382 this.doHorizontalScroll(s), this.resetLastHScrollDebounced(); 38383 } 38384 onVScroll(e) { 38385 if (!this.isControllingScroll( 38386 e, 38387 0 38388 /* Vertical */ 38389 )) 38390 return; 38391 let t; 38392 if (e === Ka ? t = this.eBodyViewport.scrollTop : t = this.ctrlsSvc.get("fakeVScrollComp").getScrollPosition(), this.shouldBlockScrollUpdate(0, t, !0)) 38393 return; 38394 const { animationFrameSvc: i } = this; 38395 i?.setScrollTop(t), this.nextScrollTop = t, e === Ka ? this.ctrlsSvc.get("fakeVScrollComp").setScrollPosition(t) : this.eBodyViewport.scrollTop = t, !i || this.gos.get("suppressAnimationFrame") ? this.scrollGridIfNeeded() : i.schedule(), this.resetLastVScrollDebounced(); 38396 } 38397 doHorizontalScroll(e) { 38398 const t = this.ctrlsSvc.get("fakeHScrollComp").getScrollPosition(); 38399 this.scrollLeft === e && e === t || (this.scrollLeft = e, this.fireScrollEvent( 38400 1 38401 /* Horizontal */
38402 ), this.horizontallyScrollHeaderCenterAndFloatingCenter(e), this.centerRowsCtrl.onHorizontalViewportChanged(!0)); 38403 } 38404 fireScrollEvent(e) { 38405 const t = { 38406 type: "bodyScroll", 38407 direction: e === 1 ? "horizontal" : "vertical", 38408 left: this.scrollLeft, 38409 top: this.scrollTop 38410 }; 38411 this.eventSvc.dispatchEvent(t), window.clearTimeout(this.scrollTimer), this.scrollTimer = window.setTimeout(() => { 38412 this.scrollTimer = 0, this.eventSvc.dispatchEvent({ 38413 ...t, 38414 type: "bodyScrollEnd" 38415 }); 38416 }, 100); 38417 } 38418 shouldBlockScrollUpdate(e, t, i = !1) { 38419 return i && !Mc() ? !1 : e === 0 ? this.shouldBlockVerticalScroll(t) : this.shouldBlockHorizontalScroll(t); 38420 } 38421 shouldBlockVerticalScroll(e) { 38422 const t = J1(this.eBodyViewport), { scrollHeight: i } = this.eBodyViewport; 38423 return e < 0 || e + t > i; 38424 } 38425 shouldBlockHorizontalScroll(e) { 38426 const t = this.centerRowsCtrl.getCenterWidth(), { scrollWidth: i } = this.centerRowsCtrl.eViewport; 38427 if (this.enableRtl && ev()) { 38428 if (e > 0) 38429 return !0; 38430 } else if (e < 0) 38431 return !0; 38432 return Math.abs(e) + t > i; 38433 } 38434 redrawRowsAfterScroll() { 38435 this.fireScrollEvent( 38436 0 38437 /* Vertical */ 38438 ); 38439 } 38440 // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again. 38441 // (which happens with some implementations of tabbing). this can result in horizontal scroll getting 38442 // reset back to the left, however no scroll event is fired. so we need to get header to also scroll 38443 // back to the left to be kept in sync. 38444 // adding and removing the grid from the DOM both resets the scroll position and 38445 // triggers a resize event, so notify listeners if the scroll position has changed 38446 checkScrollLeft() { 38447 this.scrollLeft !== this.centerRowsCtrl.getCenterViewportScrollLeft() && this.onHScroll(Ka); 38448 } 38449 scrollGridIfNeeded() { 38450 const e = this.scrollTop != this.nextScrollTop; 38451 return e && (this.scrollTop = this.nextScrollTop, this.redrawRowsAfterScroll()), e; 38452 } 38453 // called by scrollHorizontally method and alignedGridsService 38454 setHorizontalScrollPosition(e, t = !1) { 38455 const s = this.centerRowsCtrl.eViewport.scrollWidth - this.centerRowsCtrl.getCenterWidth(); 38456 !t && this.shouldBlockScrollUpdate(1, e) && (this.enableRtl && ev() ? e = e > 0 ? 0 : s : e = Math.min(Math.max(e, 0), s)), iv(this.centerRowsCtrl.eViewport, Math.abs(e), this.enableRtl), this.doHorizontalScroll(e); 38457 } 38458 setVerticalScrollPosition(e) { 38459 this.eBodyViewport.scrollTop = e; 38460 } 38461 getVScrollPosition() { 38462 if (!this.needsRefreshedScrollPosition) { 38463 const { lastOffsetHeight: i, lastScrollTop: s } = this; 38464 return { 38465 top: s, 38466 bottom: s + i 38467 }; 38468 } 38469 this.needsRefreshedScrollPosition = !1; 38470 const { scrollTop: e, offsetHeight: t } = this.eBodyViewport; 38471 return this.lastScrollTop = e, this.lastOffsetHeight = t, { 38472 top: e, 38473 bottom: e + t 38474 }; 38475 } 38476 /** Get an approximate scroll position that returns the last real value read. 38477 * This is useful for avoiding repeated DOM reads that force the browser to recalculate styles. 38478 * This can have big performance improvements but may not be 100% accurate so only use if this is acceptable. 38479 */ 38480 getApproximateVScollPosition() { 38481 return this.lastScrollTop >= 0 && this.lastOffsetHeight >= 0 ? { 38482 top: this.scrollTop, 38483 bottom: this.scrollTop + this.lastOffsetHeight 38484 } : this.getVScrollPosition(); 38485 } 38486 getHScrollPosition() { 38487 return this.centerRowsCtrl.getHScrollPosition(); 38488 } 38489 isHorizontalScrollShowing() { 38490 return this.centerRowsCtrl.isHorizontalScrollShowing(); 38491 } 38492 // called by the headerRootComp and moveColumnController 38493 scrollHorizontally(e) { 38494 const t = this.centerRowsCtrl.eViewport.scrollLeft; 38495 return this.setHorizontalScrollPosition(t + e), this.centerRowsCtrl.eViewport.scrollLeft - t; 38496 } 38497 // gets called by rowRenderer when new data loaded, as it will want to scroll to the top 38498 scrollToTop() { 38499 this.eBodyViewport.scrollTop = 0; 38500 } 38501 // Valid values for position are bottom, middle and top 38502 ensureNodeVisible(e, t = null) { 38503 const { rowModel: i } = this.beans, s = i.getRowCount(); 38504 let n = -1; 38505 for (let o = 0; o < s; o++) { 38506 const r = i.getRow(o); 38507 if (typeof e == "function") { 38508 if (r && e(r)) { 38509 n = o; 38510 break; 38511 } 38512 } else if (e === r || e === r.data) { 38513 n = o; 38514 break; 38515 } 38516 } 38517 n >= 0 && this.ensureIndexVisible(n, t); 38518 } 38519 // Valid values for position are bottom, middle and top 38520 // position should be {'top','middle','bottom', or undefined/null}. 38521 // if undefined/null, then the grid will to the minimal amount of scrolling, 38522 // eg if grid needs to scroll up, it scrolls until row is on top, 38523 // if grid needs to scroll down, it scrolls until row is on bottom, 38524 // if row is already in view, grid does not scroll 38525 ensureIndexVisible(e, t) { 38526 if (gs(this.gos, "print")) 38527 return; 38528 const { rowModel: i } = this.beans, s = i.getRowCount(); 38529 if (typeof e != "number" || e < 0 || e >= s) { 38530 Ae(88, { index: e }); 38531 return; 38532 } 38533 const o = this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel"), { 38534 frameworkOverrides: r, 38535 pagination: a, 38536 pageBounds: l, 38537 rowContainerHeight: c, 38538 rowRenderer: u 38539 } = this.beans; 38540 r.wrapIncoming(() => { 38541 o || a?.goToPageWithIndex(e); 38542 const d = this.ctrlsSvc.getGridBodyCtrl(), p = d.stickyTopHeight, f = d.stickyBottomHeight, m = i.getRow(e); 38543 let y; 38544 do { 38545 const b = m.rowTop, C = m.rowHeight, w = l.getPixelOffset(), M = m.rowTop - w, A = M + m.rowHeight, I = this.getVScrollPosition(), L = c.divStretchOffset, k = I.top + L, B = I.bottom + L, N = B - k, W = c.getScrollPositionForPixel(M), se = c.getScrollPositionForPixel(A - N), ue = Math.min((W + se) / 2, M), Ce = k + p > M, te = B - f < A; 38546 let q = null; 38547 t === "top" ? q = W : t === "bottom" ? q = se : t === "middle" ? q = ue : Ce ? q = W - p : te && (q = se + f), q !== null && (this.setVerticalScrollPosition(q), u.redraw({ afterScroll: !0 })), y = b !== m.rowTop || C !== m.rowHeight; 38548 } while (y); 38549 this.animationFrameSvc?.flushAllFrames(); 38550 }); 38551 } 38552 ensureColumnVisible(e, t = "auto") { 38553 const { colModel: i, frameworkOverrides: s } = this.beans, n = i.getCol(e); 38554 if (!n || n.isPinned() || !this.visibleCols.isColDisplayed(n)) 38555 return; 38556 const o = this.getPositionedHorizontalScroll(n, t); 38557 s.wrapIncoming(() => { 38558 o !== null && this.centerRowsCtrl.setCenterViewportScrollLeft(o), this.centerRowsCtrl.onHorizontalViewportChanged(), this.animationFrameSvc?.flushAllFrames(); 38559 }); 38560 } 38561 getPositionedHorizontalScroll(e, t) { 38562 const { columnBeforeStart: i, columnAfterEnd: s } = this.isColumnOutsideViewport(e), n = this.centerRowsCtrl.getCenterWidth() < e.getActualWidth(), o = this.centerRowsCtrl.getCenterWidth(), r = this.enableRtl; 38563 let a = (r ? i : s) || n, l = r ? s : i; 38564 t !== "auto" && (a = t === "start", l = t === "end"); 38565 const c = t === "middle"; 38566 if (a || l || c) { 38567 const { colLeft: u, colMiddle: d, colRight: p } = this.getColumnBounds(e); 38568 return c ? d - o / 2 : a ? r ? p : u : r ? u - o : p - o; 38569 } 38570 return null; 38571 } 38572 isColumnOutsideViewport(e) { 38573 const { start: t, end: i } = this.getViewportBounds(), { colLeft: s, colRight: n } = this.getColumnBounds(e), o = this.enableRtl, r = o ? t > n : i < n, a = o ? i < s : t > s; 38574 return { columnBeforeStart: r, columnAfterEnd: a }; 38575 } 38576 getColumnBounds(e) { 38577 const t = this.enableRtl, i = this.visibleCols.bodyWidth, s = e.getActualWidth(), n = e.getLeft(), o = t ? -1 : 1, r = t ? i - n : n, a = r + s * o, l = r + s / 2 * o; 38578 return { colLeft: r, colMiddle: l, colRight: a }; 38579 } 38580 getViewportBounds() { 38581 const e = this.centerRowsCtrl.getCenterWidth(), t = this.centerRowsCtrl.getCenterViewportScrollLeft(), i = t, s = e + t; 38582 return { start: i, end: s, width: e }; 38583 } 38584}, pM = class extends he {
38585 constructor(e, t = !1) { 38586 super(), this.callback = e, this.addSpacer = t; 38587 } 38588 postConstruct() { 38589 const e = this.setWidth.bind(this); 38590 this.addManagedPropertyListener("domLayout", e), this.addManagedEventListeners({ 38591 columnContainerWidthChanged: e, 38592 displayedColumnsChanged: e, 38593 leftPinnedWidthChanged: e 38594 }), this.addSpacer && this.addManagedEventListeners({ 38595 rightPinnedWidthChanged: e, 38596 scrollVisibilityChanged: e, 38597 scrollbarWidthChanged: e 38598 }), this.setWidth(); 38599 } 38600 setWidth() { 38601 const e = gs(this.gos, "print"), { visibleCols: t, scrollVisibleSvc: i } = this.beans, s = t.bodyWidth, n = t.getColsLeftWidth(), o = t.getDisplayedColumnsRightWidth(); 38602 let r; 38603 e ? r = s + n + o : (r = s, this.addSpacer && (this.gos.get("enableRtl") ? n : o) === 0 && i.verticalScrollShowing && (r += i.getScrollbarWidth())), this.callback(r); 38604 } 38605}, Iee = class extends he { 38606 constructor(e) { 38607 super(), this.centerContainerCtrl = e; 38608 } 38609 wireBeans(e) { 38610 this.scrollVisibleSvc = e.scrollVisibleSvc; 38611 } 38612 postConstruct() { 38613 this.beans.ctrlsSvc.whenReady(this, (e) => { 38614 this.gridBodyCtrl = e.gridBodyCtrl, this.listenForResize(); 38615 }), this.addManagedEventListeners({ scrollbarWidthChanged: this.onScrollbarWidthChanged.bind(this) }), this.addManagedPropertyListeners(["alwaysShowHorizontalScroll", "alwaysShowVerticalScroll"], () => { 38616 this.checkViewportAndScrolls(); 38617 }); 38618 } 38619 listenForResize() { 38620 const { beans: e, centerContainerCtrl: t, gridBodyCtrl: i } = this, s = () => { 38621 Hl(e, () => { 38622 this.onCenterViewportResized(); 38623 }); 38624 }; 38625 t.registerViewportResizeListener(s), i.registerBodyViewportResizeListener(s); 38626 } 38627 onScrollbarWidthChanged() { 38628 this.checkViewportAndScrolls(); 38629 } 38630 onCenterViewportResized() { 38631 if (this.scrollVisibleSvc.updateScrollGap(), this.centerContainerCtrl.isViewportInTheDOMTree()) { 38632 const { pinnedCols: e, colFlex: t } = this.beans; 38633 e?.keepPinnedColumnsNarrowerThanViewport(), this.checkViewportAndScrolls(); 38634 const i = this.centerContainerCtrl.getCenterWidth(); 38635 i !== this.centerWidth && (this.centerWidth = i, t?.refreshFlexedColumns({ 38636 viewportWidth: this.centerWidth, 38637 updateBodyWidths: !0, 38638 fireResizedEvent: !0 38639 })); 38640 } else 38641 this.bodyHeight = 0; 38642 } 38643 // gets called every time the viewport size changes. we use this to check visibility of scrollbars 38644 // in the grid panel, and also to check size and position of viewport for row and column virtualisation. 38645 checkViewportAndScrolls() { 38646 this.updateScrollVisibleService(), this.checkBodyHeight(), this.onHorizontalViewportChanged(), this.gridBodyCtrl.scrollFeature.checkScrollLeft(); 38647 } 38648 getBodyHeight() { 38649 return this.bodyHeight; 38650 } 38651 checkBodyHeight() { 38652 const e = this.gridBodyCtrl.eBodyViewport, t = J1(e); 38653 this.bodyHeight !== t && (this.bodyHeight = t, this.eventSvc.dispatchEvent({ 38654 type: "bodyHeightChanged" 38655 })); 38656 } 38657 updateScrollVisibleService() { 38658 this.updateScrollVisibleServiceImpl(), setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500); 38659 } 38660 updateScrollVisibleServiceImpl() { 38661 const e = { 38662 horizontalScrollShowing: this.centerContainerCtrl.isHorizontalScrollShowing(), 38663 verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing() 38664 }; 38665 this.scrollVisibleSvc.setScrollsVisible(e); 38666 } 38667 // this gets called whenever a change in the viewport, so we can inform column controller it has to work 38668 // out the virtual columns again. gets called from following locations: 38669 // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged 38670 onHorizontalViewportChanged() { 38671 const e = this.centerContainerCtrl.getCenterWidth(), t = this.centerContainerCtrl.getViewportScrollLeft(); 38672 this.beans.colViewport.setScrollPosition(e, t); 38673 } 38674}; 38675function gM(e, t, i, s, n, o) { 38676 if (i == null && t == null) 38677 return; 38678 const r = {}, a = {}, l = (c, u) => { 38679 c.split(" ").forEach((d) => { 38680 d.trim() != "" && u(d); 38681 }); 38682 }; 38683 if (i) { 38684 const c = Object.keys(i); 38685 for (let u = 0; u < c.length; u++) { 38686 const d = c[u], p = i[d]; 38687 let f; 38688 typeof p == "string" ? f = e ? e.evaluate(p, s) : !0 : typeof p == "function" && (f = p(s)), l(d, (m) => { 38689 f ? r[m] = !0 : a[m] = !0; 38690 }); 38691 } 38692 } 38693 t && o && Object.keys(t).forEach( 38694 (c) => l(c, (u) => { 38695 r[u] || (a[u] = !0); 38696 })
38697 ), o && Object.keys(a).forEach(o), Object.keys(r).forEach(n); 38698} 38699function ZR(e) { 38700 if (e.group) 38701 return e.level; 38702 const t = e.parent; 38703 return t ? t.level + 1 : 0; 38704} 38705var Ree = class extends he { 38706 constructor() { 38707 super(...arguments), this.beanName = "rowStyleSvc"; 38708 } 38709 processClassesFromGridOptions(e, t) { 38710 const i = this.gos, s = (r) => { 38711 typeof r == "string" ? e.push(r) : Array.isArray(r) && r.forEach((a) => e.push(a)); 38712 }, n = i.get("rowClass"); 38713 n && s(n); 38714 const o = i.getCallback("getRowClass"); 38715 if (o) { 38716 const r = { 38717 data: t.data, 38718 node: t, 38719 rowIndex: t.rowIndex 38720 }, a = o(r); 38721 s(a); 38722 } 38723 } 38724 preProcessRowClassRules(e, t) { 38725 this.processRowClassRules( 38726 t, 38727 (i) => { 38728 e.push(i); 38729 }, 38730 () => { 38731 } 38732 ); 38733 } 38734 processRowClassRules(e, t, i) { 38735 const { gos: s, expressionSvc: n } = this.beans, o = s.addGridCommonParams({ 38736 data: e.data, 38737 node: e, 38738 rowIndex: e.rowIndex 38739 }); 38740 gM( 38741 n, 38742 void 0, 38743 s.get("rowClassRules"), 38744 o, 38745 t, 38746 i 38747 ); 38748 } 38749 processStylesFromGridOptions(e) { 38750 const t = this.gos, i = t.get("rowStyle"), s = t.getCallback("getRowStyle"); 38751 let n; 38752 if (s) { 38753 const o = { 38754 data: e.data, 38755 node: e, 38756 rowIndex: e.rowIndex 38757 }; 38758 n = s(o); 38759 } 38760 if (n || i) 38761 return Object.assign({}, i, n); 38762 } 38763}, Tee = 0, Jp = "renderedRow", eS = class extends he { 38764 constructor(e, t, i, s, n) { 38765 super(), this.rowNode = e, this.useAnimationFrameForCreate = s, this.printLayout = n, this.allRowGuis = [], this.active = !0, this.centerCellCtrls = { list: [], map: {} }, this.leftCellCtrls = { list: [], map: {} }, this.rightCellCtrls = { list: [], map: {} }, this.slideInAnimation = { 38766 left: !1, 38767 center: !1, 38768 right: !1, 38769 fullWidth: !1 38770 }, this.fadeInAnimation = { 38771 left: !1, 38772 center: !1, 38773 right: !1, 38774 fullWidth: !1 38775 }, this.rowDragComps = [], this.lastMouseDownOnDragger = !1, this.emptyStyle = {}, this.updateColumnListsPending = !1, this.rowId = null, this.businessKey = null, this.beans = t, this.gos = t.gos, this.paginationPage = t.pagination?.getCurrentPage() ?? 0, this.suppressRowTransform = this.gos.get("suppressRowTransform"), this.instanceId = e.id + "-" + Tee++, this.rowId = yr(e.id), this.initRowBusinessKey(), this.rowFocused = t.focusSvc.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned), this.rowLevel = ZR(this.rowNode), this.setRowType(), this.setAnimateFlags(i), this.rowStyles = this.processStylesFromGridOptions(), this.addListeners(); 38776 } 38777 initRowBusinessKey() { 38778 this.businessKeyForNodeFunc = this.gos.get("getBusinessKeyForNode"), this.updateRowBusinessKey(); 38779 } 38780 updateRowBusinessKey() { 38781 if (typeof this.businessKeyForNodeFunc != "function") 38782 return; 38783 const e = this.businessKeyForNodeFunc(this.rowNode); 38784 this.businessKey = yr(e); 38785 } 38786 updateGui(e, t) { 38787 e === "left" ? this.leftGui = t : e === "right" ? this.rightGui = t : e === "fullWidth" ? this.fullWidthGui = t : this.centerGui = t; 38788 } 38789 setComp(e, t, i, s) { 38790 s = Dg(this, this.beans.context, s); 38791 const n = { rowComp: e, element: t, containerType: i, compBean: s }; 38792 this.allRowGuis.push(n), this.updateGui(i, n), this.initialiseRowComp(n), this.rowType !== "FullWidthLoading" && !this.rowNode.rowPinned && this.beans.rowRenderer.dispatchFirstDataRenderedEvent(); 38793 } 38794 unsetComp(e) { 38795 this.allRowGuis = this.allRowGuis.filter((t) => t.containerType !== e), this.updateGui(e, void 0); 38796 } 38797 isCacheable() { 38798 return this.rowType === "FullWidthDetail" && this.gos.get("keepDetailRows"); 38799 } 38800 setCached(e) { 38801 const t = e ? "none" : ""; 38802 this.allRowGuis.forEach((i) => i.element.style.display = t); 38803 } 38804 initialiseRowComp(e) { 38805 const t = this.gos; 38806 this.onSuppressCellFocusChanged(this.beans.gos.get("suppressCellFocus")), this.listenOnDomOrder(e), this.beans.rowAutoHeight?.checkAutoHeights(this.rowNode), this.onRowHeightChanged(e), this.updateRowIndexes(e), this.setFocusedClasses(e), this.setStylesFromGridOptions(!1, e), Dc(t) && this.rowNode.selectable && this.onRowSelected(e), this.updateColumnLists(!this.useAnimationFrameForCreate); 38807 const i = e.rowComp; 38808 this.getInitialRowClasses(e.containerType).forEach((n) => i.addOrRemoveCssClass(n, !0)), this.executeSlideAndFadeAnimations(e), this.rowNode.group && _w(e.element, this.rowNode.expanded == !0), this.setRowCompRowId(i), this.setRowCompRowBusinessKey(i), Bc(t, e.element, Jp, this), e.compBean.addDestroyFunc(() => Bc(t, e.element, Jp, null)), this.useAnimationFrameForCreate ? this.beans.animationFrameSvc.createTask( 38809 this.addHoverFunctionality.bind(this, e), 38810 this.rowNode.rowIndex, 38811 "createTasksP2" 38812 ) : this.addHoverFunctionality(e), this.isFullWidth() && this.setupFullWidth(e), t.get("rowDragEntireRow") && this.addRowDraggerToRow(e), this.useAnimationFrameForCreate && this.beans.animationFrameSvc.addDestroyTask(() => { 38813 this.isAlive() && e.rowComp.addOrRemoveCssClass("ag-after-created", !0); 38814 }), this.executeProcessRowPostCreateFunc(); 38815 } 38816 setRowCompRowBusinessKey(e) { 38817 this.businessKey != null && e.setRowBusinessKey(this.businessKey); 38818 } 38819 setRowCompRowId(e) { 38820 const t = yr(this.rowNode.id); 38821 this.rowId = t, t != null && e.setRowId(t); 38822 } 38823 executeSlideAndFadeAnimations(e) { 38824 const { containerType: t } = e; 38825 this.slideInAnimation[t] && (_R(() => { 38826 this.onTopChanged(); 38827 }), this.slideInAnimation[t] = !1), this.fadeInAnimation[t] && (_R(() => { 38828 e.rowComp.addOrRemoveCssClass("ag-opacity-zero", !1); 38829 }), this.fadeInAnimation[t] = !1); 38830 } 38831 addRowDraggerToRow(e) { 38832 const t = this.beans.rowDragSvc?.createRowDragCompForRow(this.rowNode, e.element); 38833 if (!t) 38834 return; 38835 const i = this.createBean(t, this.beans.context); 38836 this.rowDragComps.push(i), e.compBean.addDestroyFunc(() => { 38837 this.rowDragComps = this.rowDragComps.filter((s) => s !== i), this.destroyBean(i, this.beans.context); 38838 }); 38839 } 38840 setupFullWidth(e) { 38841 const t = this.getPinnedForContainer(e.containerType), i = this.createFullWidthCompDetail
38841s(e.element, t); 38842 e.rowComp.showFullWidth(i); 38843 } 38844 getFullWidthCellRenderers() { 38845 return this.gos.get("embedFullWidthRows") ? this.allRowGuis.map((e) => e?.rowComp?.getFullWidthCellRenderer()) : [this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]; 38846 } 38847 executeProcessRowPostCreateFunc() { 38848 const e = this.gos.getCallback("processRowPostCreate"); 38849 if (!e || !this.areAllContainersReady()) 38850 return; 38851 const t = { 38852 // areAllContainersReady asserts that centerGui is not null 38853 eRow: this.centerGui.element, 38854 ePinnedLeftRow: this.leftGui ? this.leftGui.element : void 0, 38855 ePinnedRightRow: this.rightGui ? this.rightGui.element : void 0, 38856 node: this.rowNode, 38857 rowIndex: this.rowNode.rowIndex, 38858 addRenderedRowListener: this.addEventListener.bind(this) 38859 }; 38860 e(t); 38861 } 38862 areAllContainersReady() { 38863 const { 38864 leftGui: e, 38865 centerGui: t, 38866 rightGui: i, 38867 beans: { visibleCols: s } 38868 } = this, n = !!e || !s.isPinningLeft(), o = !!t, r = !!i || !s.isPinningRight(); 38869 return n && o && r; 38870 } 38871 isNodeFullWidthCell() { 38872 if (this.rowNode.detail) 38873 return !0; 38874 const e = this.beans.gos.getCallback("isFullWidthRow"); 38875 return e ? e({ rowNode: this.rowNode }) : !1; 38876 } 38877 setRowType() { 38878 const e = this.rowNode.stub && !this.gos.get("suppressServerSideFullWidthLoadingRow") && !this.gos.get("groupHideOpenParents"), t = this.isNodeFullWidthCell(), i = this.gos.get("masterDetail") && this.rowNode.detail, s = this.beans.colModel.isPivotMode(), o = !!this.rowNode.group && !this.rowNode.footer && nM(this.gos, s); 38879 e ? this.rowType = "FullWidthLoading" : i ? this.rowType = "FullWidthDetail" : t ? this.rowType = "FullWidth" : o ? this.rowType = "FullWidthGroup" : this.rowType = "Normal"; 38880 } 38881 updateColumnLists(e = !1, t = !1) { 38882 if (this.isFullWidth()) 38883 return; 38884 const { animationFrameSvc: i } = this.beans; 38885 if (!i || e || this.gos.get("suppressAnimationFrame") || this.printLayout) { 38886 this.updateColumnListsImpl(t); 38887 return; 38888 } 38889 this.updateColumnListsPending || (i.createTask( 38890 () => { 38891 this.active && this.updateColumnListsImpl(!0); 38892 }, 38893 this.rowNode.rowIndex, 38894 "createTasksP1" 38895 ), this.updateColumnListsPending = !0); 38896 } 38897 createCellCtrls(e, t, i = null) { 38898 const s = { 38899 list: [], 38900 map: {} 38901 }, n = (o, r) => { 38902 s.list.push(r), s.map[o] = r; 38903 }; 38904 return t.forEach((o) => { 38905 const r = o.getInstanceId(); 38906 let a = e.map[r]; 38907 a || (a = new Cm(o, this.rowNode, this.beans, this)), n(r, a); 38908 }), e.list.forEach((o) => { 38909 const r = o.column.getInstanceId(); 38910 if (s.map[r] != null) 38911 return; 38912 if (!this.isCellEligibleToBeRemoved(o, i)) { 38913 n(r, o); 38914 return; 38915 } 38916 o.destroy(); 38917 }), s; 38918 } 38919 updateColumnListsImpl(e) { 38920 this.updateColumnListsPending = !1, this.createAllCellCtrls(), this.setCellCtrls(e); 38921 } 38922 setCellCtrls(e) { 38923 this.allRowGuis.forEach((t) => { 38924 const i = this.getCellCtrlsForContainer(t.containerType); 38925 t.rowComp.setCellCtrls(i, e); 38926 }); 38927 } 38928 getCellCtrlsForContainer(e) { 38929 switch (e) { 38930 case "left": 38931 return this.leftCellCtrls.list; 38932 case "right": 38933 return this.rightCellCtrls.list; 38934 case "fullWidth": 38935 return []; 38936 case "center": 38937 return this.centerCellCtrls.list; 38938 } 38939 } 38940 createAllCellCtrls() { 38941 const e = this.beans.colViewport, t = this.beans.visibleCols; 38942 if (this.printLayout) 38943 this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, t.allCols), this.leftCellCtrls = { list: [], map: {} }, this.rightCellCtrls = { list: [], map: {} }; 38944 else { 38945 const i = e.getColsWithinViewport(this.rowNode); 38946 this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, i); 38947 const s = t.getLeftColsForRow(this.rowNode); 38948 this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, s, "left"); 38949 const n = t.getRightColsForRow(this.rowNode); 38950 this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, n, "right"); 38951 } 38952 } 38953 isCellEligibleToBeRemoved(e, t) { 38954 const { column: n } = e; 38955 if (n.getPinned() != t) 38956 return !0; 38957 const { editing: o, cellPosition: r } = e, { focusSvc: a, visibleCols: l } = this.beans, c = a.isCellFocused(r); 38958 return o || c ? !(l.allCols.indexOf(n) >= 0) : !0; 38959 } 38960 getDomOrder() { 38961 return this.gos.get("ensureDomOrder") || gs(this.gos, "print"); 38962 } 38963 listenOnDomOrder(e) { 38964 const t = () => { 38965 e.rowComp.setDomOrder(this.getDomOrder()); 38966 };
38967 e.compBean.addManagedPropertyListeners(["domLayout", "ensureDomOrder"], t); 38968 } 38969 setAnimateFlags(e) { 38970 if (this.rowNode.sticky || !e) 38971 return; 38972 const t = Ie(this.rowNode.oldRowTop), { visibleCols: i } = this.beans, s = i.isPinningLeft(), n = i.isPinningRight(); 38973 if (t) { 38974 const { slideInAnimation: o } = this; 38975 if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) { 38976 o.fullWidth = !0; 38977 return; 38978 } 38979 o.center = !0, o.left = s, o.right = n; 38980 } else { 38981 const { fadeInAnimation: o } = this; 38982 if (this.isFullWidth() && !this.gos.get("embedFullWidthRows")) { 38983 o.fullWidth = !0; 38984 return; 38985 } 38986 o.center = !0, o.left = s, o.right = n; 38987 } 38988 } 38989 isFullWidth() { 38990 return this.rowType !== "Normal"; 38991 } 38992 refreshFullWidth() { 38993 const e = (r, a) => r ? r.rowComp.refreshFullWidth(() => this.createFullWidthCompDetails(r.element, a).params) : !0, t = e(this.fullWidthGui, null), i = e(this.centerGui, null), s = e(this.leftGui, "left"), n = e(this.rightGui, "right"); 38994 return t && i && s && n; 38995 } 38996 addListeners() { 38997 this.addManagedListeners(this.rowNode, { 38998 heightChanged: () => this.onRowHeightChanged(), 38999 rowSelected: () => this.onRowSelected(), 39000 rowIndexChanged: this.onRowIndexChanged.bind(this), 39001 topChanged: this.onTopChanged.bind(this), 39002 ...this.beans.expansionSvc?.getRowExpandedListeners(this) ?? {} 39003 }), this.rowNode.detail && this.addManagedListeners(this.rowNode.parent, { dataChanged: this.onRowNodeDataChanged.bind(this) }), this.addManagedListeners(this.rowNode, { 39004 dataChanged: this.onRowNodeDataChanged.bind(this), 39005 cellChanged: this.postProcessCss.bind(this), 39006 rowHighlightChanged: this.onRowNodeHighlightChanged.bind(this), 39007 draggingChanged: this.postProcessRowDragging.bind(this), 39008 uiLevelChanged: this.onUiLevelChanged.bind(this) 39009 }), this.addManagedListeners(this.beans.eventSvc, { 39010 paginationPixelOffsetChanged: this.onPaginationPixelOffsetChanged.bind(this), 39011 heightScaleChanged: this.onTopChanged.bind(this), 39012 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), 39013 virtualColumnsChanged: this.onVirtualColumnsChanged.bind(this), 39014 cellFocused: this.onCellFocusChanged.bind(this), 39015 cellFocusCleared: this.onCellFocusChanged.bind(this), 39016 paginationChanged: this.onPaginationChanged.bind(this), 39017 modelUpdated: this.refreshFirstAndLastRowStyles.bind(this), 39018 columnMoved: () => this.updateColumnLists() 39019 }), this.addDestroyFunc(() => { 39020 this.rowDragComps = this.destroyBeans(this.rowDragComps, this.beans.context), this.tooltipFeature = this.destroyBean(this.tooltipFeature, this.beans.context); 39021 }), this.addManagedPropertyListeners( 39022 ["rowStyle", "getRowStyle", "rowClass", "getRowClass", "rowClassRules"], 39023 this.postProcessCss.bind(this) 39024 ), this.addManagedPropertyListener("rowDragEntireRow", () => { 39025 if (this.gos.get("rowDragEntireRow")) { 39026 this.allRowGuis.forEach((t) => { 39027 this.addRowDraggerToRow(t); 39028 }); 39029 return; 39030 } 39031 this.rowDragComps = this.destroyBeans(this.rowDragComps, this.beans.context); 39032 }), this.addListenersForCellComps(); 39033 } 39034 addListenersForCellComps() { 39035 this.addManagedListeners(this.rowNode, { 39036 rowIndexChanged: () => { 39037 this.getAllCellCtrls().forEach((e) => e.onRowIndexChanged()); 39038 }, 39039 cellChanged: (e) => { 39040 this.getAllCellCtrls().forEach((t) => t.onCellChanged(e)); 39041 } 39042 }); 39043 } 39044 onRowNodeDataChanged(e) { 39045 if (this.isFullWidth() !== !!this.isNodeFullWidthCell()) { 39046 this.beans.rowRenderer.redrawRow(this.rowNode); 39047 return; 39048 } 39049 if (this.isFullWidth()) { 39050 this.refreshFullWidth() || this.beans.rowRenderer.redrawRow(this.rowNode); 39051 return; 39052 } 39053 this.getAllCellCtrls().forEach( 39054 (i) => i.refreshCell({ 39055 suppressFlash: !e.update, 39056 newData: !e.update 39057 }) 39058 ), this.allRowGuis.forEach((i) => { 39059 this.setRowCompRowId(i.rowComp), this.updateRowBusinessKey(), this.setRowCompRowBusinessKey(i.rowComp); 39060 }), this.onRowSelected(), this.postProcessCss(); 39061 } 39062 postProcessCss() { 39063 this.setStylesFromGridOptions(!0), this.postProcessClassesFromGridOptions(), this.postProcessRowClassRules(), this.postProcessRowDragging(); 39064 } 39065 onRowNodeHighlightChanged() { 39066 const e = this.rowNode.highlighted; 39067 this.allRowGuis.forEach((t) => { 39068 const i = e === "Above", s = e === "Below"; 39069 t.rowComp.addOrRemoveCssClass("ag-row-highlight-above", i), t.rowComp.addOrRemoveCssClass("ag-row-highlight-below", s); 39070 }); 39071 } 39072 postProcessRowDragging() { 39073 const e = this.rowNode.dragging; 39074 this.allRowGuis.forEach((t) => t.rowComp.addOrRemoveCssClass("ag-row-dragging", e)); 39075 } 39076 onDisplayedColumnsChanged() { 39077 this.updateColumnLists(!0), this.beans.rowAutoHeight?.checkAutoHeights(this.rowNode); 39078 } 39079 onVirtualColumnsChanged() { 39080 this.updateColumnLists(!1, !0); 39081 } 39082 getRowPosition() { 39083 return { 39084 rowPinned: oa(this.rowNode.rowPinned), 39085 rowIndex: this.rowNode.rowIndex 39086 }; 39087 } 39088 findFullWidthRowGui(e) { 39089 return this.allRowGuis.find((t) => t.element.contains(e)); 39090 } 39091 onKeyboardNavigate(e) { 39092 const t = this.findFullWidthRowGui(e.target); 39093 if (!((t ? t.element : null) === e.target)) 39094 return; 39095 const n = this.rowNode, { focusSvc: o, navigation: r } = this.beans, a = o.getFocusedCell(), l = { 39096 rowIndex: n.rowIndex, 39097 rowPinned: n.rowPinned, 39098 column: a?.column ?? this.getColumnForFullWidth(t) 39099 }; 39100 r?.navigateToNextCell(e, e.key, l, !0), e.preventDefault(); 39101 } 39102 onTabKeyDown(e) { 39103 if (e.defaultPrevented || ra(e)) 39104 return; 39105 const t = this.allRowGuis.find( 39106 (a) => a.element.contains(e.target) 39107 ), i = t ? t.element : null, s = i === e.target, n = gi(this.beans); 39108 let o = !1; 39109 i && n && (o = i.contains(n) && n.classList.contains("ag-cell")); 39110 let r = null; 39111 !s && !o && (r = iu(this.beans, i, !1, e.shiftKey)), (this.isFullWidth() && s || !r) && this.beans.navigation?.onTabKeyDown(this, e); 39112 } 39113 getFullWidthElement() { 39114 return this.fullWidthGui ? this.fullWidthGui.element : null; 39115 } 39116 getRowYPosition() { 39117 const e = this.allRowGuis.find((t) => Yo(t.element))?.element; 39118 return e ? e.getBoundingClientRect().top : 0; 39119 } 39120 onSuppressCellFocusChanged(e) { 39121 const t = this.isFullWidth() && e ? void 0 : -1; 39122 this.allRowGuis.forEach((i) => { 39123 vo(i.element, "tabindex", t); 39124 }); 39125 } 39126 onFullWidthRowFocused(e) { 39127 const t = this.rowNode, i = e ? this.isFullWidth() && e.rowIndex === t.rowIndex && e.rowPinned == t.rowPinned : !1, s = this.fullWidthGui ? this.fullWidthGui.element : this.centerGui?.element; 39128 s && (s.classList.toggle("ag-full-width-focus", i), i && e?.forceBrowserFocus && s.focus({ preventScroll: !0 })); 39129 } 39130 recreateCell(e) { 39131 this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, e), this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, e), this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, e), e.destroy(), this.updateColumnLists(); 39132 } 39133 removeCellCtrl(e, t) { 39134 const i = { 39135 list: [], 39136 map: {} 39137 }; 39138 return e.list.forEach((s) => {
39139 s !== t && (i.list.push(s), i.map[s.column.getInstanceId()] = s); 39140 }), i; 39141 } 39142 onMouseEvent(e, t) { 39143 switch (e) { 39144 case "dblclick": 39145 this.onRowDblClick(t); 39146 break; 39147 case "click": 39148 this.onRowClick(t); 39149 break; 39150 case "touchstart": 39151 case "mousedown": 39152 this.onRowMouseDown(t); 39153 break; 39154 } 39155 } 39156 createRowEvent(e, t) { 39157 const { rowNode: i } = this; 39158 return this.gos.addGridCommonParams({ 39159 type: e, 39160 node: i, 39161 data: i.data, 39162 rowIndex: i.rowIndex, 39163 rowPinned: i.rowPinned, 39164 event: t 39165 }); 39166 } 39167 createRowEventWithSource(e, t) { 39168 const i = this.createRowEvent(e, t); 39169 return i.source = this, i; 39170 } 39171 onRowDblClick(e) { 39172 ra(e) || this.beans.eventSvc.dispatchEvent(this.createRowEventWithSource("rowDoubleClicked", e)); 39173 } 39174 getColumnForFullWidth(e) { 39175 const { visibleCols: t } = this.beans; 39176 switch (e?.containerType) { 39177 case "center": 39178 return t.centerCols[0]; 39179 case "left": 39180 return t.leftCols[0]; 39181 case "right": 39182 return t.rightCols[0]; 39183 default: 39184 return t.allCols[0]; 39185 } 39186 } 39187 onRowMouseDown(e) { 39188 if (this.lastMouseDownOnDragger = Ac(e.target, "ag-row-drag", 3), !this.isFullWidth()) 39189 return;
39190 const t = this.rowNode, { rangeSvc: i, focusSvc: s } = this.beans; 39191 i?.removeAllCellRanges(); 39192 const n = this.findFullWidthRowGui(e.target), o = n?.element, r = e.target; 39193 let a = !0; 39194 o && o.contains(r) && X1(r) && (a = !1), s.setFocusedCell({ 39195 rowIndex: t.rowIndex, 39196 column: this.getColumnForFullWidth(n), 39197 rowPinned: t.rowPinned, 39198 forceBrowserFocus: a 39199 }); 39200 } 39201 onRowClick(e) { 39202 if (ra(e) || this.lastMouseDownOnDragger) 39203 return; 39204 const { eventSvc: i, selectionSvc: s } = this.beans; 39205 i.dispatchEvent(this.createRowEventWithSource("rowClicked", e)), s?.handleSelectionEvent(e, this.rowNode, "rowClicked"); 39206 } 39207 setupDetailRowAutoHeight(e) { 39208 this.rowType === "FullWidthDetail" && this.beans.masterDetailSvc?.setupDetailRowAutoHeight(this, e); 39209 } 39210 createFullWidthCompDetails(e, t) { 39211 const { gos: i, rowNode: s } = this, n = i.addGridCommonParams({ 39212 fullWidth: !0, 39213 data: s.data, 39214 node: s, 39215 value: s.key, 39216 valueFormatted: s.key, 39217 // these need to be taken out, as part of 'afterAttached' now 39218 eGridCell: e, 39219 eParentOfValue: e, 39220 pinned: t, 39221 addRenderedRowListener: this.addEventListener.bind(this), 39222 registerRowDragger: (r, a, l, c) => this.addFullWidthRowDragging(r, a, l, c), 39223 setTooltip: (r, a) => { 39224 i.assertModuleRegistered("Tooltip", 3), this.refreshRowTooltip(r, a); 39225 } 39226 }), o = this.beans.userCompFactory; 39227 switch (this.rowType) { 39228 case "FullWidthDetail": 39229 return CJ(o, n); 39230 case "FullWidthGroup": 39231 return yJ(o, n); 39232 case "FullWidthLoading": 39233 return vJ(o, n); 39234 default: 39235 return mJ(o, n); 39236 } 39237 } 39238 refreshRowTooltip(e, t) { 39239 this.fullWidthGui && (this.tooltipFeature = this.beans.tooltipSvc?.refreshRowTooltip( 39240 this.tooltipFeature, 39241 this, 39242 e, 39243 t 39244 )); 39245 } 39246 addFullWidthRowDragging(e, t, i = "", s) { 39247 const { rowDragSvc: n, context: o } = this.beans; 39248 if (!n || !this.isFullWidth()) 39249 return; 39250 const r = n.createRowDragComp( 39251 () => i, 39252 this.rowNode, 39253 void 0, 39254 e, 39255 t, 39256 s 39257 ); 39258 this.createBean(r, o), this.addDestroyFunc(() => { 39259 this.destroyBean(r, o); 39260 }); 39261 } 39262 onUiLevelChanged() { 39263 const e = ZR(this.rowNode); 39264 if (this.rowLevel != e) { 39265 const t = "ag-row-level-" + e, i = "ag-row-level-" + this.rowLevel; 39266 this.allRowGuis.forEach((s) => { 39267 s.rowComp.addOrRemoveCssClass(t, !0), s.rowComp.addOrRemoveCssClass(i, !1); 39268 }); 39269 } 39270 this.rowLevel = e; 39271 } 39272 isFirstRowOnPage() { 39273 return this.rowNode.rowIndex === this.beans.pageBounds.getFirstRow(); 39274 } 39275 isLastRowOnPage() { 39276 return this.rowNode.rowIndex === this.beans.pageBounds.getLastRow(); 39277 } 39278 refreshFirstAndLastRowStyles() { 39279 const e = this.isFirstRowOnPage(), t = this.isLastRowOnPage(); 39280 this.firstRowOnPage !== e && (this.firstRowOnPage = e, this.allRowGuis.forEach((i) => i.rowComp.addOrRemoveCssClass("ag-row-first", e))), this.lastRowOnPage !== t && (this.lastRowOnPage = t, this.allRowGuis.forEach((i) => i.rowComp.addOrRemoveCssClass("ag-row-last", t))); 39281 } 39282 getAllCellCtrls() { 39283 return this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0 ? this.centerCellCtrls.list : [...this.centerCellCtrls.list, ...this.leftCellCtrls.list, ...this.rightCellCtrls.list]; 39284 } 39285 postProcessClassesFromGridOptions() { 39286 const e = []; 39287 this.beans.rowStyleSvc?.processClassesFromGridOptions(e, this.rowNode), e.length && e.forEach((t) => { 39288 this.allRowGuis.forEach((i) => i.rowComp.addOrRemoveCssClass(t, !0)); 39289 }); 39290 } 39291 postProcessRowClassRules() { 39292 this.beans.rowStyleSvc?.processRowClassRules( 39293 this.rowNode, 39294 (e) => { 39295 this.allRowGuis.forEach((t) => t.rowComp.addOrRemoveCssClass(e, !0)); 39296 }, 39297 (e) => { 39298 this.allRowGuis.forEach((t) => t.rowComp.addOrRemoveCssClass(e, !1)); 39299 } 39300 ); 39301 } 39302 setStylesFromGridOptions(e, t) { 39303 e && (this.rowStyles = this.processStylesFromGridOptions()), this.forEachGui(t, (i) => i.rowComp.setUserStyles(this.rowStyles)); 39304 } 39305 getPinnedForContainer(e) { 39306 return e === "left" || e === "right" ? e : null; 39307 } 39308 getInitialRowClasses(e) { 39309 const t = this.getPinnedForContainer(e), i = this.isFullWidth(), { rowNode: s, beans: n } = this, o = []; 39310 o.push("ag-row"), o.push(this.rowFocused ? "ag-row-focus" : "ag-row-no-focus"), this.fadeInAnimation[e] && o.push("ag-opacity-zero"), o.push(s.rowIndex % 2 === 0 ? "ag-row-even" : "ag-row-odd"), s.isRowPinned() && o.push("ag-row-pinned"), s.isSelected() && o.push("ag-row-selected"), s.footer && o.push("ag-row-footer"), o.push("ag-row-level-" + this.rowLevel), s.stub && o.push("ag-row-loading"), i && o.push("ag-full-width-row"), n.expansionSvc?.addExpandedCss(o, s), s.dragging && o.push("ag-row-dragging"); 39311 const { rowStyleSvc: r } = n; 39312 return r && (r.processClassesFromGridOptions(o, s), r.preProcessRowClassRules(o, s)), o.push(this.printLayout ? "ag-row-position-relative" : "ag-row-position-absolute"), this.isFirstRowOnPage() && o.push("ag-row-first"), this.isLastRowOnPage() && o.push("ag-row-last"), i && (t === "left" && o.push("ag-cell-last-left-pinned"), t === "right" && o.push("ag-cell-first-right-pinned")), o; 39313 } 39314 processStylesFromGridOptions() { 39315 return this.beans.rowStyleSvc?.processStylesFromGridOptions(this.rowNode) ?? this.emptyStyle; 39316 } 39317 onRowSelected(e) { 39318 this.beans.selectionSvc?.onRowCtrlSelected( 39319 this, 39320 (t) => { 39321 (t === this.centerGui || t === this.fullWidthGui) && this.announceDescription(); 39322 }, 39323 e 39324 ); 39325 } 39326 announceDescription() { 39327 this.beans.selectionSvc?.announceAriaRowSelection(this.rowNode); 39328 } 39329 addHoverFunctionality(e) { 39330 if (!this.active) 39331 return; 39332 const { element: t, compBean: i } = e, { rowNode: s, beans: n, gos: o } = this; 39333 i.addManagedListeners(t, { 39334 mouseenter: () => s.dispatchRowEvent("mouseEnter"), 39335 mouseleave: () => s.dispatchRowEvent("mouseLeave") 39336 }), i.addManagedListeners(s, { 39337 mouseEnter: () => { 39338 !n.dragSvc?.dragging && !o.get("suppressRowHoverHighlight") && (t.classList.add("ag-row-hover"), s.setHovered(!0)); 39339 }, 39340 mouseLeave: () => { 39341 t.classList.remove("ag-row-hover"), s.setHovered(!1); 39342 } 39343 }); 39344 } 39345 // for animation, we don't want to animate entry or exit to a very far away pixel, 39346 // otherwise the row would move so fast, it would appear to disappear. so this method 39347 // moves the row closer to the viewport if it is far away, so the row slide in / out 39348 // at a speed the user can see. 39349 roundRowTopToBounds(e) {
39350 const t = this.beans.ctrlsSvc.getScrollFeature().getApproximateVScollPosition(), i = this.applyPaginationOffset(t.top, !0) - 100, s = this.applyPaginationOffset(t.bottom, !0) + 100; 39351 return Math.min(Math.max(i, e), s); 39352 } 39353 forEachGui(e, t) { 39354 e ? t(e) : this.allRowGuis.forEach(t); 39355 } 39356 onRowHeightChanged(e) { 39357 if (this.rowNode.rowHeight == null) 39358 return; 39359 const t = this.rowNode.rowHeight, i = this.beans.environment.getDefaultRowHeight(), n = PO(this.gos) ? _c(this.beans, this.rowNode).height : void 0, o = n ? `${Math.min(i, n) - 2}px` : void 0; 39360 this.forEachGui(e, (r) => { 39361 r.element.style.height = `${t}px`, o && r.element.style.setProperty("--ag-line-height", o); 39362 }); 39363 } 39364 // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons. 39365 destroyFirstPass(e = !1) { 39366 this.active = !1; 39367 const { rowNode: t } = this; 39368 if (!e && ad(this.gos) && !t.sticky) 39369 if (t.rowTop != null) { 39370 const n = this.roundRowTopToBounds(t.rowTop); 39371 this.setRowTop(n); 39372 } else 39373 this.allRowGuis.forEach((n) => n.rowComp.addOrRemoveCssClass("ag-opacity-zero", !0)); 39374 t.setHovered(!1); 39375 const i = this.createRowEvent("virtualRowRemoved"); 39376 this.dispatchLocalEvent(i), this.beans.eventSvc.dispatchEvent(i), super.destroy(); 39377 } 39378 destroySecondPass() { 39379 this.allRowGuis.length = 0, this.beans.editSvc?.stopRowEditing(this); 39380 const e = (t) => (t.list.forEach((i) => i.destroy()), { list: [], map: {} }); 39381 this.centerCellCtrls = e(this.centerCellCtrls), this.leftCellCtrls = e(this.leftCellCtrls), this.rightCellCtrls = e(this.rightCellCtrls); 39382 } 39383 setFocusedClasses(e) { 39384 this.forEachGui(e, (t) => { 39385 t.rowComp.addOrRemoveCssClass("ag-row-focus", this.rowFocused), t.rowComp.addOrRemoveCssClass("ag-row-no-focus", !this.rowFocused); 39386 }); 39387 } 39388 onCellFocusChanged() { 39389 const { focusSvc: e, editSvc: t } = this.beans, i = e.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned); 39390 i !== this.rowFocused && (this.rowFocused = i, this.setFocusedClasses()), !i && this.editing && t?.stopRowEditing(this, !1); 39391 } 39392 onPaginationChanged() { 39393 const e = this.beans.pagination?.getCurrentPage() ?? 0; 39394 this.paginationPage !== e && (this.paginationPage = e, this.onTopChanged()), this.refreshFirstAndLastRowStyles(); 39395 } 39396 onTopChanged() { 39397 this.setRowTop(this.rowNode.rowTop); 39398 } 39399 onPaginationPixelOffsetChanged() { 39400 this.onTopChanged(); 39401 } 39402 // applies pagination offset, eg if on second page, and page height is 500px, then removes 39403 // 500px from the top position, so a row with rowTop 600px is displayed at location 100px. 39404 // reverse will take the offset away rather than add. 39405 applyPaginationOffset(e, t = !1) { 39406 if (this.rowNode.isRowPinned() || this.rowNode.sticky) 39407 return e; 39408 const i = this.beans.pageBounds.getPixelOffset(); 39409 return e + i * (t ? 1 : -1); 39410 } 39411 setRowTop(e) { 39412 if (!this.printLayout && Ie(e)) { 39413 const t = this.applyPaginationOffset(e), n = `${this.rowNode.isRowPinned() || this.rowNode.sticky ? t : this.beans.rowContainerHeight.getRealPixelPosition(t)}px`; 39414 this.setRowTopStyle(n); 39415 } 39416 } 39417 // the top needs to be set into the DOM element when the element is created, not updated afterwards. 39418 // otherwise the transition would not work, as it would be transitioning from zero (the unset value). 39419 // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows 39420 // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered, 39421 // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised 39422 // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation 39423 // time, the row would animate down (ie from position zero). 39424 getInitialRowTop(e) { 39425 return this.suppressRowTransform ? this.getInitialRowTopShared(e) : void 0; 39426 } 39427 getInitialTransform(e) { 39428 return this.suppressRowTransform ? void 0 : `translateY(${this.getInitialRowTopShared(e)})`; 39429 } 39430 getInitialRowTopShared(e) { 39431 if (this.printLayout) 39432 return ""; 39433 const t = this.rowNode; 39434 let i; 39435 if (t.sticky) 39436 i = t.stickyRowTop; 39437 else { 39438 const s = this.slideInAnimation[e] ? this.roundRowTopToBounds(t.oldRowTop) : t.rowTop, n = this.applyPaginationOffset(s); 39439 i = t.isRowPinned() ? n : this.beans.rowContainerHeight.getRealPixelPosition(n); 39440 } 39441 return i + "px"; 39442 } 39443 setRowTopStyle(e) { 39444 this.allRowGuis.forEach( 39445 (t) => this.suppressRowTransform ? t.rowComp.setTop(e) : t.rowComp.setTransform(`translateY(${e})`) 39446 ); 39447 } 39448 getCellCtrl(e, t = !1) { 39449 let i = null;
39450 return this.getAllCellCtrls().forEach((s) => { 39451 s.column == e && (i = s); 39452 }), i != null || t || this.getAllCellCtrls().forEach((s) => { 39453 s.getColSpanningList().indexOf(e) >= 0 && (i = s); 39454 }), i; 39455 } 39456 onRowIndexChanged() { 39457 this.rowNode.rowIndex != null && (this.onCellFocusChanged(), this.updateRowIndexes(), this.postProcessCss()); 39458 } 39459 updateRowIndexes(e) { 39460 const t = this.rowNode.getRowIndexString(); 39461 if (t === null) 39462 return; 39463 const i = (this.beans.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.beans.filterManager?.getHeaderRowCount() ?? 0), s = this.rowNode.rowIndex % 2 === 0, n = i + this.rowNode.rowIndex + 1; 39464 this.forEachGui(e, (o) => { 39465 o.rowComp.setRowIndex(t), o.rowComp.addOrRemoveCssClass("ag-row-even", s), o.rowComp.addOrRemoveCssClass("ag-row-odd", !s), dO(o.element, n); 39466 }); 39467 } 39468}; 39469function MN(e) { 39470 return e.altKey || e.ctrlKey || e.metaKey ? !1 : e.key?.length === 1; 39471} 39472function tS(e, t, i, s, n) { 39473 const o = s ? s.getColDef().suppressKeyboardEvent : void 0; 39474 if (!o) 39475 return !1; 39476 const r = e.addGridCommonParams({ 39477 event: t, 39478 editing: n, 39479 column: s, 39480 node: i, 39481 data: i.data, 39482 colDef: s.getColDef() 39483 }); 39484 return !!(o && o(r)); 39485} 39486var Lee = 65, kee = 67, Pee = 86, Fee = 68, Oee = 90, Nee = 89; 39487function _ee(e) { 39488 const { keyCode: t } = e; 39489 let i; 39490 switch (t) { 39491 case Lee: 39492 i = de.A; 39493 break; 39494 case kee: 39495 i = de.C; 39496 break; 39497 case Pee: 39498 i = de.V; 39499 break; 39500 case Fee: 39501 i = de.D; 39502 break; 39503 case Oee: 39504 i = de.Z; 39505 break; 39506 case Nee: 39507 i = de.Y; 39508 break; 39509 default: 39510 i = e.code; 39511 } 39512 return i; 39513} 39514var Bee = class extends he { 39515 constructor(e) { 39516 super(), this.element = e; 39517 } 39518 postConstruct() { 39519 this.addKeyboardListeners(), this.addMouseListeners(), this.beans.touchSvc?.mockRowContextMenu(this); 39520 } 39521 addKeyboardListeners() { 39522 const e = "keydown", t = this.processKeyboardEvent.bind(this, e); 39523 this.addManagedElementListeners(this.element, { [e]: t }); 39524 } 39525 addMouseListeners() { 39526 ["dblclick", "contextmenu", "mouseover", "mouseout", "click", zO("touchstart") ? "touchstart" : "mousedown"].forEach((i) => { 39527 const s = this.processMouseEvent.bind(this, i); 39528 this.addManagedElementListeners(this.element, { [i]: s }); 39529 }); 39530 } 39531 processMouseEvent(e, t) { 39532 if (!gv(this.gos, t) || ra(t)) 39533 return; 39534 const { cellCtrl: i, rowCtrl: s } = this.getControlsForEventTarget(t.target); 39535 e === "contextmenu" ? (i?.column && i.dispatchCellContextMenuEvent(t), this.beans.contextMenuSvc?.handleContextMenuMouseEvent(t, void 0, s, i)) : (i && i.onMouseEvent(e, t), s && s.onMouseEvent(e, t)); 39536 } 39537 getControlsForEventTarget(e) { 39538 const { gos: t } = this; 39539 return { 39540 cellCtrl: pN(t, e), 39541 rowCtrl: HO(t, e, Jp) 39542 }; 39543 } 39544 processKeyboardEvent(e, t) { 39545 const { cellCtrl: i, rowCtrl: s } = this.getControlsForEventTarget(t.target); 39546 t.defaultPrevented || (i ? this.processCellKeyboardEvent(i, e, t) : s && s.isFullWidth() && this.processFullWidthRowKeyboardEvent(s, e, t)); 39547 } 39548 processCellKeyboardEvent(e, t, i) { 39549 const { rowNode: s, column: n, editing: o } = e; 39550 !tS( 39551 this.gos, 39552 i, 39553 s, 39554 n, 39555 o 39556 ) && t === "keydown" && (!o && this.beans.navigation?.handlePageScrollingKey(i) || e.onKeyDown(i), this.doGridOperations(i, e.editing), MN(i) && e.processCharacter(i)), t === "keydown" && this.eventSvc.dispatchEvent(e.createEvent(i, "cellKeyDown")); 39557 } 39558 processFullWidthRowKeyboardEvent(e, t, i) { 39559 const { rowNode: s } = e, { focusSvc: n, navigation: o } = this.beans, r = n.getFocusedCell(), a = r && r.column; 39560 if (!tS(this.gos, i, s, a, !1)) { 39561 const c = i.key; 39562 if (t === "keydown") 39563 switch (c) { 39564 case de.PAGE_HOME: 39565 case de.PAGE_END: 39566 case de.PAGE_UP: 39567 case de.PAGE_DOWN: 39568 o?.handlePageScrollingKey(i, !0); 39569 break; 39570 case de.UP: 39571 case de.DOWN: 39572 e.onKeyboardNavigate(i); 39573 break; 39574 case de.TAB: 39575 e.onTabKeyDown(i); 39576 break; 39577 } 39578 } 39579 t === "keydown" && this.eventSvc.dispatchEvent(e.createRowEvent("cellKeyDown", i)); 39580 } 39581 doGridOperations(e, t) { 39582 if (!e.ctrlKey && !e.metaKey || t || !gv(this.gos, e)) 39583 return; 39584 const i = _ee(e), { clipboardSvc: s, undoRedo: n } = this.beans; 39585 if (i === de.A) 39586 return this.onCtrlAndA(e); 39587 if (i === de.C) 39588 return this.onCtrlAndC(s, e); 39589 if (i === de.D) 39590 return this.onCtrlAndD(s, e); 39591 if (i === de.V) 39592 return this.onCtrlAndV(s, e); 39593 if (i === de.X) 39594 return this.onCtrlAndX(s, e); 39595 if (i === de.Y) 39596 return this.onCtrlAndY(n); 39597 if (i === de.Z) 39598 return this.onCtrlAndZ(n, e); 39599 } 39600 onCtrlAndA(e) { 39601 const { 39602 beans: { pinnedRowModel: t, rowModel: i, visibleCols: s, rangeSvc: n, selectionSvc: o }, 39603 gos: r 39604 } = this; 39605 if (n && pa(r) && i.isRowsToRender()) { 39606 const [a, l] = [ 39607 t?.isEmpty("top") ?? !0, 39608 t?.isEmpty("bottom") ?? !0 39609 ], c = a ? null : "top"; 39610 let u, d; 39611 l ? (u = null, d = i.getRowCount() - 1) : (u = "bottom", d = t?.getPinnedBottomRowCount() ?? -1); 39612 const p = s.allCols; 39613 if (!p?.length) 39614 return; 39615 n.setCellRange({ 39616 rowStartIndex: 0, 39617 rowStartPinned: c, 39618 rowEndIndex: d, 39619 rowEndPinned: u, 39620 columnStart: p[0], 39621 columnEnd: It(p) 39622 }); 39623 } else o && o?.selectAllRowNodes({ source: "keyboardSelectAll", selectAll: BO(r) }); 39624 e.preventDefault(); 39625 } 39626 onCtrlAndC(e, t) { 39627 if (!e || this.gos.get("enableCellTextSelection")) 39628 return; 39629 const { cellCtrl: i, rowCtrl: s } = this.getControlsForEventTarget(t.target); 39630 i?.editing || s?.editing || (t.preventDefault(), e.copyToClipboard()); 39631 } 39632 onCtrlAndX(e, t) { 39633 if (!e || this.gos.get("enableCellTextSelection") || this.gos.get("suppressCutToClipboard")) 39634 return; 39635 const { cellCtrl: i, rowCtrl: s } = this.getControlsForEventTarget(t.target); 39636 i?.editing || s?.editing || (t.preventDefault(), e.cutToClipboard(void 0, "ui")); 39637 } 39638 onCtrlAndV(e, t) { 39639 const { cellCtrl: i, rowCtrl: s } = this.getControlsForEventTarget(t.target); 39640 i?.editing || s?.editing || e && !this.gos.get("suppressClipboardPaste") && e.pasteFromClipboard(); 39641 } 39642 onCtrlAndD(e, t) { 39643 e && !this.gos.get("suppressClipboardPaste") && e.copyRangeDown(), t.preventDefault(); 39644 } 39645 onCtrlAndZ(e, t) { 39646 !this.gos.get("undoRedoCellEditing") || !e || (t.preventDefault(), t.shiftKey ? e.redo("ui") : e.undo("ui")); 39647 } 39648 onCtrlAndY(e) { 39649 e?.redo("ui"); 39650 } 39651}, AN = class extends he {
39652 constructor(e, t) { 39653 super(), this.eContainer = e, this.eViewport = t; 39654 } 39655 postConstruct() { 39656 this.addManagedEventListeners({ 39657 rowContainerHeightChanged: this.onHeightChanged.bind(this, this.beans.rowContainerHeight) 39658 }); 39659 } 39660 onHeightChanged(e) { 39661 const t = e.uiContainerHeight, i = t != null ? `${t}px` : ""; 39662 this.eContainer.style.height = i, this.eViewport && (this.eViewport.style.height = i); 39663 } 39664}, Vf = (e) => e.topRowCtrls, Uf = (e) => e.getStickyTopRowCtrls(), Wf = (e) => e.getStickyBottomRowCtrls(), jf = (e) => e.bottomRowCtrls, $f = (e) => e.allRowCtrls, Gee = { 39665 center: { 39666 type: "center", 39667 container: "ag-center-cols-container", 39668 viewport: "ag-center-cols-viewport", 39669 getRowCtrls: $f 39670 }, 39671 left: { 39672 type: "left", 39673 container: "ag-pinned-left-cols-container", 39674 pinnedType: "left", 39675 getRowCtrls: $f 39676 }, 39677 right: { 39678 type: "right", 39679 container: "ag-pinned-right-cols-container", 39680 pinnedType: "right", 39681 getRowCtrls: $f 39682 }, 39683 fullWidth: { 39684 type: "fullWidth", 39685 container: "ag-full-width-container", 39686 fullWidth: !0, 39687 getRowCtrls: $f 39688 }, 39689 topCenter: { 39690 type: "center", 39691 container: "ag-floating-top-container", 39692 viewport: "ag-floating-top-viewport", 39693 getRowCtrls: Vf 39694 }, 39695 topLeft: { 39696 type: "left", 39697 container: "ag-pinned-left-floating-top", 39698 pinnedType: "left", 39699 getRowCtrls: Vf 39700 },
39701 topRight: { 39702 type: "right", 39703 container: "ag-pinned-right-floating-top", 39704 pinnedType: "right", 39705 getRowCtrls: Vf 39706 }, 39707 topFullWidth: { 39708 type: "fullWidth", 39709 container: "ag-floating-top-full-width-container", 39710 fullWidth: !0, 39711 getRowCtrls: Vf 39712 }, 39713 stickyTopCenter: { 39714 type: "center", 39715 container: "ag-sticky-top-container", 39716 viewport: "ag-sticky-top-viewport", 39717 getRowCtrls: Uf 39718 }, 39719 stickyTopLeft: { 39720 type: "left", 39721 container: "ag-pinned-left-sticky-top", 39722 pinnedType: "left", 39723 getRowCtrls: Uf 39724 }, 39725 stickyTopRight: { 39726 type: "right", 39727 container: "ag-pinned-right-sticky-top", 39728 pinnedType: "right", 39729 getRowCtrls: Uf 39730 }, 39731 stickyTopFullWidth: { 39732 type: "fullWidth", 39733 container: "ag-sticky-top-full-width-container", 39734 fullWidth: !0, 39735 getRowCtrls: Uf 39736 }, 39737 stickyBottomCenter: { 39738 type: "center", 39739 container: "ag-sticky-bottom-container", 39740 viewport: "ag-sticky-bottom-viewport", 39741 getRowCtrls: Wf 39742 }, 39743 stickyBottomLeft: { 39744 type: "left", 39745 container: "ag-pinned-left-sticky-bottom", 39746 pinnedType: "left", 39747 getRowCtrls: Wf 39748 }, 39749 stickyBottomRight: { 39750 type: "right", 39751 container: "ag-pinned-right-sticky-bottom", 39752 pinnedType: "right", 39753 getRowCtrls: Wf 39754 }, 39755 stickyBottomFullWidth: { 39756 type: "fullWidth", 39757 container: "ag-sticky-bottom-full-width-container", 39758 fullWidth: !0, 39759 getRowCtrls: Wf 39760 }, 39761 bottomCenter: { 39762 type: "center", 39763 container: "ag-floating-bottom-container", 39764 viewport: "ag-floating-bottom-viewport", 39765 getRowCtrls: jf 39766 }, 39767 bottomLeft: { 39768 type: "left", 39769 container: "ag-pinned-left-floating-bottom", 39770 pinnedType: "left", 39771 getRowCtrls: jf 39772 }, 39773 bottomRight: { 39774 type: "right", 39775 container: "ag-pinned-right-floating-bottom", 39776 pinnedType: "right", 39777 getRowCtrls: jf 39778 }, 39779 bottomFullWidth: { 39780 type: "fullWidth", 39781 container: "ag-floating-bottom-full-width-container", 39782 fullWidth: !0, 39783 getRowCtrls: jf 39784 } 39785}; 39786function Zu(e) { 39787 return Gee[e]; 39788} 39789var zee = ["topCenter", "topLeft", "topRight"], Hee = ["bottomCenter", "bottomLeft", "bottomRight"], Vee = ["center", "left", "right"], Uee = ["center", "left", "right", "fullWidth"], Wee = ["stickyTopCenter", "stickyBottomCenter", "center", "topCenter", "bottomCenter"], jee = ["left", "bottomLeft", "topLeft", "stickyTopLeft", "stickyBottomLeft"], $ee = ["right", "bottomRight", "topRight", "stickyTopRight", "stickyBottomRight"], DN = ["stickyTopCenter", "stickyTopLeft", "stickyTopRight"], EN = ["stickyBottomCenter", "stickyBottomLeft", "stickyBottomRight"], Yee = [ 39790 ...DN, 39791 "stickyTopFullWidth", 39792 ...EN, 39793 "stickyBottomFullWidth" 39794], Kee = [ 39795 ...zee, 39796 ...Hee, 39797 ...Vee, 39798 ...DN, 39799 ...EN 39800], Zee = class extends he { 39801 constructor(e) { 39802 super(), this.name = e, this.visible = !0, this.EMPTY_CTRLS = [], this.options = Zu(e); 39803 } 39804 postConstruct() { 39805 this.enableRtl = this.gos.get("enableRtl"), this.forContainers(["center"], () => { 39806 this.viewportSizeFeature = this.createManagedBean(new Iee(this)), this.addManagedEventListeners({ 39807 stickyTopOffsetChanged: this.onStickyTopOffsetChanged.bind(this) 39808 }); 39809 }); 39810 } 39811 onStickyTopOffsetChanged(e) { 39812 this.comp.setOffsetTop(`${e.offset}px`); 39813 } 39814 registerWithCtrlsService() { 39815 this.options.fullWidth || this.beans.ctrlsSvc.register(this.name, this); 39816 } 39817 forContainers(e, t) { 39818 e.indexOf(this.name) >= 0 && t(); 39819 } 39820 setComp(e, t, i) { 39821 this.comp = e, this.eContainer = t, this.eViewport = i, this.createManagedBean(new Bee(this.eContainer)), this.addPreventScrollWhileDragging(), this.listenOnDomOrder(); 39822 const { pinnedCols: s, rangeSvc: n } = this.beans, o = () => this.onPinnedWidthChanged(); 39823 this.forContainers(jee, () => { 39824 this.pinnedWidthFeature = this.createOptionalManagedBean( 39825 s?.createPinnedWidthFeature(this.eContainer, !0) 39826 ), this.addManagedEventListeners({ leftPinnedWidthChanged: o }); 39827 }), this.forContainers($ee, () => { 39828 this.pinnedWidthFeature = this.createOptionalManagedBean( 39829 s?.createPinnedWidthFeature(this.eContainer, !1) 39830 ), this.addManagedEventListeners({ rightPinnedWidthChanged: o }); 39831 }), this.forContainers( 39832 Uee, 39833 () => this.createManagedBean( 39834 new AN(this.eContainer, this.name === "center" ? i : void 0) 39835 ) 39836 ), n && this.forContainers( 39837 Kee, 39838 () => this.createManagedBean(n.createDragListenerFeature(this.eContainer)) 39839 ), this.forContainers( 39840 Wee, 39841 () => this.createManagedBean(new pM((r) => this.comp.setContainerWidth(`${r}px`))) 39842 ), this.visible = this.isContainerVisible(), this.addListeners(), this.registerWithCtrlsService(); 39843 } 39844 onScrollCallback(e) { 39845 this.addManagedElementListeners(this.eViewport, { scroll: e }); 39846 } 39847 addListeners() { 39848 this.addManagedEventListeners({ 39849 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), 39850 displayedColumnsWidthChanged: this.onDisplayedColumnsChanged.bind(this), 39851 displayedRowsChanged: (e) => this.onDisplayedRowsChanged(e.afterScroll) 39852 }), this.onDisplayedColumnsChanged(), this.onDisplayedRowsChanged(); 39853 } 39854 listenOnDomOrder() { 39855 if (Yee.indexOf(this.name) >= 0) { 39856 this.comp.setDomOrder(!0); 39857 return; 39858 } 39859 const t = () => { 39860 const i = this.gos.get("ensureDomOrder"), s = gs(this.gos, "print"); 39861 this.comp.setDomOrder(i || s); 39862 }; 39863 this.addManagedPropertyListener("domLayout", t), t(); 39864 } 39865 onDisplayedColumnsChanged() { 39866 this.forContainers(["center"], () => this.onHorizontalViewportChanged()); 39867 } 39868 // this methods prevents the grid views from being scrolled while the dragService is being used 39869 // eg. the view should not scroll up and down while dragging rows using the rowDragComp. 39870 addPreventScrollWhileDragging() { 39871 const { dragSvc: e } = this.beans; 39872 if (!e) 39873 return; 39874 const t = (i) => { 39875 e.dragging && i.cancelable && i.preventDefault(); 39876 }; 39877 this.eContainer.addEventListener("touchmove", t, { passive: !1 }), this.addDestroyFunc(() => this.eContainer.removeEventListener("touchmove", t)); 39878 } 39879 // this gets called whenever a change in the viewport, so we can inform column controller it has to work 39880 // out the virtual columns again. gets called from following locations: 39881 // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged 39882 onHorizontalViewportChanged(e = !1) { 39883 const t = this.getCenterWidth(), i = this.getCenterViewportScrollLeft(); 39884 this.beans.colViewport.setScrollPosition(t, i, e); 39885 } 39886 hasHorizontalScrollGap() { 39887 return this.eContainer.clientWidth - this.eViewport.clientWidth < 0; 39888 } 39889 hasVerticalScrollGap() { 39890 return this.eContainer.clientHeight - this.eViewport.clientHeight < 0; 39891 } 39892 getCenterWidth() { 39893 return jp(this.eViewport); 39894 } 39895 getCenterViewportScrollLeft() { 39896 return tv(this.eViewport, this.enableRtl); 39897 } 39898 registerViewportResizeListener(e) { 39899 const t = zl(this.beans, this.eViewport, e); 39900 this.addDestroyFunc(() => t()); 39901 } 39902 isViewportInTheDOMTree() { 39903 return wO(this.eViewport); 39904 } 39905 getViewportScrollLeft() { 39906 return tv(this.eViewport, this.enableRtl); 39907 } 39908 isHorizontalScrollShowing() { 39909 return this.gos.get("alwaysShowHorizontalScroll") || zQ(this.eViewport); 39910 } 39911 setHorizontalScroll(e) { 39912 this.comp.setHorizontalScroll(e); 39913 } 39914 getHScrollPosition() { 39915 return { 39916 left: this.eViewport.scrollLeft, 39917 right: this.eViewport.scrollLeft + this.eViewport.offsetWidth 39918 }; 39919 } 39920 setCenterViewportScrollLeft(e) { 39921 iv(this.eViewport, e, this.enableRtl); 39922 } 39923 isContainerVisible() { 39924 return !(this.options.pinnedType != null) || !!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0; 39925 } 39926 onPinnedWidthChanged() { 39927 const e = this.isContainerVisible(); 39928 this.visible != e && (this.visible = e, this.onDisplayedRowsChanged()); 39929 } 39930 onDisplayedRowsChanged(e = !1) { 39931 const t = this.options.getRowCtrls(this.beans.rowRenderer); 39932 if (!this.visible || t.length === 0) { 39933 this.comp.setRowCtrls({ rowCtrls: this.EMPTY_CTRLS }); 39934 return; 39935 } 39936 const i = gs(this.gos, "print"), n = this.gos.get("embedFullWidthRows") || i, o = t.filter((r) => { 39937 const a = r.isFullWidth(); 39938 return this.options.fullWidth ? !n && a : n || !a; 39939 }); 39940 this.comp.setRowCtrls({ rowCtrls: o, useFlushSync: e }); 39941 } 39942}, IN = "ag-force-vertical-scroll", qee = "ag-selectable", Qee = "ag-column-moving", Xee = class extends he {
39943 constructor() { 39944 super(...arguments), this.stickyTopHeight = 0, this.stickyBottomHeight = 0; 39945 } 39946 wireBeans(e) { 39947 this.ctrlsSvc = e.ctrlsSvc, this.colModel = e.colModel, this.scrollVisibleSvc = e.scrollVisibleSvc, this.pinnedRowModel = e.pinnedRowModel, this.filterManager = e.filterManager, this.rowGroupColsSvc = e.rowGroupColsSvc; 39948 } 39949 setComp(e, t, i, s, n, o, r) { 39950 this.comp = e, this.eGridBody = t, this.eBodyViewport = i, this.eTop = s, this.eBottom = n, this.eStickyTop = o, this.eStickyBottom = r, this.eCenterColsViewport = i.querySelector( 39951 `.${Zu("center").viewport}` 39952 ), this.eFullWidthContainer = i.querySelector( 39953 `.${Zu("fullWidth").container}` 39954 ), this.eStickyTopFullWidthContainer = o.querySelector( 39955 `.${Zu("stickyTopFullWidth").container}` 39956 ), this.eStickyBottomFullWidthContainer = r.querySelector( 39957 `.${Zu("stickyBottomFullWidth").container}` 39958 ), this.setCellTextSelection(this.gos.get("enableCellTextSelection")), this.addManagedPropertyListener( 39959 "enableCellTextSelection", 39960 (a) => this.setCellTextSelection(a.currentValue) 39961 ), this.createManagedBean(new hM(this.comp)), this.scrollFeature = this.createManagedBean(new Eee(this.eBodyViewport)), this.beans.rowDragSvc?.setupRowDrag(this.eBodyViewport, this), this.setupRowAnimationCssClass(), this.addEventListeners(), this.addFocusListeners([s, i, n, o, r]), this.setGridRootRole(), this.onGridColumnsChanged(), this.addBodyViewportListener(), this.setFloatingHeights(), this.disableBrowserDragging(), this.addStopEditingWhenGridLosesFocus(), this.updateScrollingClasses(), this.filterManager?.setupAdvFilterHeaderComp(s), this.ctrlsSvc.register("gridBodyCtrl", this); 39962 } 39963 addEventListeners() { 39964 const e = this.setFloatingHeights.bind(this), t = this.setGridRootRole.bind(this); 39965 this.addManagedEventListeners({ 39966 gridColumnsChanged: this.onGridColumnsChanged.bind(this), 39967 scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this), 39968 scrollGapChanged: this.updateScrollingClasses.bind(this), 39969 pinnedRowDataChanged: e, 39970 pinnedHeightChanged: e, 39971 headerHeightChanged: this.setStickyTopOffsetTop.bind(this), 39972 columnRowGroupChanged: t, 39973 columnPivotChanged: t 39974 }), this.addManagedPropertyListener("treeData", t); 39975 } 39976 onGridColumnsChanged() { 39977 const e = this.beans.colModel.getCols(); 39978 this.comp.setColumnCount(e.length); 39979 } 39980 onScrollVisibilityChanged() { 39981 const { scrollVisibleSvc: e } = this, t = e.verticalScrollShowing; 39982 this.setVerticalScrollPaddingVisible(t), this.setStickyWidth(t), this.setStickyBottomOffsetBottom(); 39983 const i = t && e.getScrollbarWidth() || 0, s = vO() ? 16 : 0, n = `calc(100% + ${i + s}px)`; 39984 Hl(this.beans, () => this.comp.setBodyViewportWidth(n)), this.updateScrollingClasses(); 39985 } 39986 setGridRootRole() { 39987 const { rowGroupColsSvc: e, colModel: t } = this; 39988 let i = this.gos.get("treeData"); 39989 if (!i) { 39990 const s = t.isPivotMode(); 39991 i = (e ? e.columns.length : 0) >= (s ? 2 : 1); 39992 } 39993 this.comp.setGridRootRole(i ? "treegrid" : "grid"); 39994 } 39995 addFocusListeners(e) { 39996 e.forEach((t) => { 39997 this.addManagedElementListeners(t, { 39998 focusin: (i) => { 39999 const { target: s } = i, n = Ac(s, "ag-root", t); 40000 t.classList.toggle("ag-has-focus", !n); 40001 }, 40002 focusout: (i) => { 40003 const { target: s, relatedTarget: n } = i, o = t.contains(n), r = Ac( 40004 n, 40005 "ag-root", 40006 t 40007 ); 40008 Ac(s, "ag-root", t) || (!o || r) && t.classList.remove("ag-has-focus"); 40009 } 40010 }); 40011 }); 40012 } 40013 // used by ColumnAnimationService 40014 setColumnMovingCss(e) { 40015 this.comp.setColumnMovingCss(Qee, e); 40016 } 40017 setCellTextSelection(e = !1) { 40018 this.comp.setCellSelectableCss(qee, e); 40019 } 40020 updateScrollingClasses() { 40021 const { 40022 eGridBody: { classList: e }, 40023 scrollVisibleSvc: t 40024 } = this; 40025 e.toggle("ag-body-vertical-content-no-gap", !t.verticalScrollGap), e.toggle("ag-body-horizontal-content-no-gap", !t.horizontalScrollGap); 40026 } 40027 // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer) 40028 // and then that will start the browser native drag n' drop, which messes up with our own drag and drop. 40029 disableBrowserDragging() { 40030 this.addManagedElementListeners(this.eGridBody, { 40031 dragstart: (e) => { 40032 if (e.target instanceof HTMLImageElement) 40033 return e.preventDefault(), !1; 40034 } 40035 }); 40036 } 40037 addStopEditingWhenGridLosesFocus() { 40038 this.beans.editSvc?.addStopEditingWhenGridLosesFocus([ 40039 this.eBodyViewport, 40040 this.eBottom, 40041 this.eTop, 40042 this.eStickyTop, 40043 this.eStickyBottom 40044 ]); 40045 } 40046 updateRowCount() { 40047 const e = (this.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0) + (this.filterManager?.getHeaderRowCount() ?? 0), { rowModel: t } = this.beans, i = t.isLastRowIndexKnown() ? t.getRowCount() : -1, s = i === -1 ? -1 : e + i; 40048 this.comp.setRowCount(s); 40049 } 40050 registerBodyViewportResizeListener(e) { 40051 this.comp.registerBodyViewportResizeListener(e); 40052 } 40053 setVerticalScrollPaddingVisible(e) { 40054 const t = e ? "scroll" : "hidden"; 40055 this.comp.setPinnedTopBottomOverflowY(t); 40056 } 40057 isVerticalScrollShowing() { 40058 const e = this.gos.get("alwaysShowVerticalScroll"), t = e ? IN : null, i = gs(this.gos, "normal"); 40059 return this.comp.setAlwaysVerticalScrollClass(t, e), e || i && HQ(this.eBodyViewport); 40060 } 40061 setupRowAnimationCssClass() { 40062 const { rowContainerHeight: e, environment: t } = this.beans; 40063 let i = t.sizesMeasured; 40064 const s = () => { 40065 const n = i && ad(this.gos) && !e.stretching, o = n ? "ag-row-animation" : "ag-row-no-animation"; 40066 this.comp.setRowAnimationCssOnBodyViewport(o, n); 40067 }; 40068 s(), this.addManagedEventListeners({ heightScaleChanged: s }), this.addManagedPropertyListener("animateRows", s), this.addManagedEventListeners({ 40069 gridStylesChanged: () => { 40070 !i && t.sizesMeasured && (i = !0, s()); 40071 } 40072 }); 40073 } 40074 addBodyViewportListener() { 40075 const { popupSvc: e, touchSvc: t } = this.beans, i = this.onBodyViewportContextMenu.bind(this); 40076 this.addManagedElementListeners(this.eBodyViewport, { contextmenu: i }), t?.mockBodyContextMenu(this, i), this.addManagedElementListeners(this.eBodyViewport, { 40077 wheel: this.onBodyViewportWheel.bind(this, e) 40078 }), this.addManagedElementListeners(this.eStickyTop, { wheel: this.onStickyWheel.bind(this) }), this.addManagedElementListeners(this.eStickyBottom, { wheel: this.onStickyWheel.bind(this) }), this.addFullWidthContainerWheelListener(); 40079 } 40080 addFullWidthContainerWheelListener() { 40081 this.addManagedElementListeners(this.eFullWidthContainer, { 40082 wheel: (e) => this.onFullWidthContainerWheel(e) 40083 }); 40084 } 40085 onFullWidthContainerWheel(e) {
40086 const { deltaX: t, deltaY: i, shiftKey: s } = e; 40087 (s || Math.abs(t) > Math.abs(i)) && gv(this.gos, e) && this.scrollGridBodyToMatchEvent(e); 40088 } 40089 onStickyWheel(e) { 40090 const { deltaX: t, deltaY: i, shiftKey: s } = e, n = s || Math.abs(t) > Math.abs(i), o = e.target; 40091 n ? (this.eStickyTopFullWidthContainer.contains(o) || this.eStickyBottomFullWidthContainer.contains(o)) && this.scrollGridBodyToMatchEvent(e) : (e.preventDefault(), this.scrollVertically(i)); 40092 } 40093 scrollGridBodyToMatchEvent(e) { 40094 const { deltaX: t, deltaY: i } = e; 40095 e.preventDefault(), this.eCenterColsViewport.scrollBy({ left: t || i }); 40096 } 40097 onBodyViewportContextMenu(e, t, i) { 40098 if (!e && !i) 40099 return; 40100 this.gos.get("preventDefaultOnContextMenu") && (e || i).preventDefault(); 40101 const { target: s } = e || t; 40102 (s === this.eBodyViewport || s === this.ctrlsSvc.get("center").eViewport) && this.beans.contextMenuSvc?.showContextMenu({ 40103 mouseEvent: e, 40104 touchEvent: i, 40105 value: null, 40106 anchorToElement: this.eGridBody 40107 }); 40108 } 40109 onBodyViewportWheel(e, t) { 40110 this.gos.get("suppressScrollWhenPopupsAreOpen") && e?.hasAnchoredPopup() && t.preventDefault(); 40111 } 40112 // called by rowDragFeature 40113 scrollVertically(e) { 40114 const t = this.eBodyViewport.scrollTop; 40115 return this.scrollFeature.setVerticalScrollPosition(t + e), this.eBodyViewport.scrollTop - t; 40116 } 40117 setFloatingHeights() { 40118 const { pinnedRowModel: e } = this, t = e?.getPinnedTopTotalHeight() ?? 0, i = e?.getPinnedBottomTotalHeight() ?? 0; 40119 this.comp.setTopHeight(t), this.comp.setBottomHeight(i), this.comp.setTopDisplay(t ? "inherit" : "none"), this.comp.setBottomDisplay(i ? "inherit" : "none"), this.setStickyTopOffsetTop(), this.setStickyBottomOffsetBottom(); 40120 } 40121 setStickyTopHeight(e = 0) { 40122 this.comp.setStickyTopHeight(`${e}px`), this.stickyTopHeight = e; 40123 } 40124 setStickyBottomHeight(e = 0) { 40125 this.comp.setStickyBottomHeight(`${e}px`), this.stickyBottomHeight = e; 40126 } 40127 setStickyWidth(e) { 40128 if (!e) 40129 this.comp.setStickyTopWidth("100%"), this.comp.setStickyBottomWidth("100%"); 40130 else { 40131 const t = this.scrollVisibleSvc.getScrollbarWidth(); 40132 this.comp.setStickyTopWidth(`calc(100% - ${t}px)`), this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`); 40133 } 40134 } 40135 setStickyTopOffsetTop() { 40136 const t = this.ctrlsSvc.get("gridHeaderCtrl").headerHeight + (this.filterManager?.getHeaderHeight() ?? 0), i = this.pinnedRowModel?.getPinnedTopTotalHeight() ?? 0; 40137 let s = 0; 40138 t > 0 && (s += t), i > 0 && (s += i), s > 0 && (s += 1), this.comp.setStickyTopTop(`${s}px`); 40139 } 40140 setStickyBottomOffsetBottom() { 40141 const { pinnedRowModel: e, scrollVisibleSvc: t, comp: i } = this, s = e?.getPinnedBottomTotalHeight() ?? 0, o = t.horizontalScrollShowing && t.getScrollbarWidth() || 0, r = s + o; 40142 i.setStickyBottomBottom(`${r}px`); 40143 } 40144}, RN = class extends Tt { 40145 constructor(e, t) { 40146 super(), this.direction = t, this.eViewport = Pe, this.eContainer = Pe, this.hideTimeout = 0, this.setTemplate(e); 40147 } 40148 postConstruct() { 40149 this.addManagedEventListeners({ 40150 scrollVisibilityChanged: this.onScrollVisibilityChanged.bind(this) 40151 }), this.onScrollVisibilityChanged(), this.addOrRemoveCssClass("ag-apple-scrollbar", fO() || Mc()); 40152 } 40153 destroy() { 40154 super.destroy(), window.clearTimeout(this.hideTimeout); 40155 } 40156 initialiseInvisibleScrollbar() { 40157 this.invisibleScrollbar === void 0 && (this.invisibleScrollbar = vO(), this.invisibleScrollbar && (this.hideAndShowInvisibleScrollAsNeeded(), this.addActiveListenerToggles())); 40158 } 40159 addActiveListenerToggles() { 40160 const e = this.getGui(), t = () => this.addOrRemoveCssClass("ag-scrollbar-active", !0), i = () => this.addOrRemoveCssClass("ag-scrollbar-active", !1); 40161 this.addManagedListeners(e, { 40162 mouseenter: t, 40163 mousedown: t, 40164 touchstart: t, 40165 mouseleave: i, 40166 touchend: i 40167 }); 40168 } 40169 onScrollVisibilityChanged() { 40170 this.invisibleScrollbar === void 0 && this.initialiseInvisibleScrollbar(), Hl(this.beans, () => this.setScrollVisible()); 40171 } 40172 hideAndShowInvisibleScrollAsNeeded() { 40173 this.addManagedEventListeners({ 40174 bodyScroll: (e) => { 40175 e.direction === this.direction && (this.hideTimeout && (window.clearTimeout(this.hideTimeout), this.hideTimeout = 0), this.addOrRemoveCssClass("ag-scrollbar-scrolling", !0)); 40176 }, 40177 bodyScrollEnd: () => { 40178 this.hideTimeout = window.setTimeout(() => { 40179 this.addOrRemoveCssClass("ag-scrollbar-scrolling", !1), this.hideTimeout = 0; 40180 }, 400); 40181 } 40182 }); 40183 } 40184 attemptSettingScrollPosition(e) { 40185 const t = this.eViewport; 40186 jQ( 40187 () => Yo(t), 40188 () => this.setScrollPosition(e), 40189 100 40190 ); 40191 } 40192 onScrollCallback(e) { 40193 this.addManagedElementListeners(this.eViewport, { scroll: e }); 40194 } 40195}, Jee = class extends RN { 40196 constructor() { 40197 super( 40198 /* html */ 40199 `<div class="ag-body-horizontal-scroll" aria-hidden="true"> 40200 <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div> 40201 <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport"> 40202 <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div> 40203 </div> 40204 <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div> 40205 </div>`, 40206 "horizontal" 40207 ), this.eLeftSpacer = Pe, this.eRightSpacer = Pe, this.setScrollVisibleDebounce = 0; 40208 } 40209 wireBeans(e) { 40210 this.visibleCols = e.visibleCols, this.scrollVisibleSvc = e.scrollVisibleSvc; 40211 } 40212 postConstruct() { 40213 super.postConstruct(); 40214 const e = this.setFakeHScrollSpacerWidths.bind(this); 40215 this.addManagedEventListeners({ 40216 displayedColumnsChanged: e, 40217 displayedColumnsWidthChanged: e, 40218 pinnedRowDataChanged: this.refreshCompBottom.bind(this) 40219 }), this.addManagedPropertyListener("domLayout", e), this.beans.ctrlsSvc.register("fakeHScrollComp", this), this.createManagedBean(new pM((t) => this.eContainer.style.width = `${t}px`)), this.addManagedPropertyListeners(["suppressHorizontalScroll"], this.onScrollVisibilityChanged.bind(this)); 40220 } 40221 destroy() { 40222 window.clearTimeout(this.setScrollVisibleDebounce), super.destroy(); 40223 } 40224 initialiseInvisibleScrollbar() { 40225 this.invisibleScrollbar === void 0 && (this.enableRtl = this.gos.get("enableRtl"), super.initialiseInvisibleScrollbar(), this.invisibleScrollbar && this.refreshCompBottom()); 40226 } 40227 refreshCompBottom() { 40228 if (!this.invisibleScrollbar) 40229 return; 40230 const e = this.beans.pinnedRowModel?.getPinnedBottomTotalHeight() ?? 0; 40231 this.getGui().style.bottom = `${e}px`; 40232 } 40233 onScrollVisibilityChanged() { 40234 super.onScrollVisibilityChanged(), this.setFakeHScrollSpacerWidths(); 40235 } 40236 setFakeHScrollSpacerWidths() { 40237 const e = this.scrollVisibleSvc.verticalScrollShowing; 40238 let t = this.visibleCols.getDisplayedColumnsRightWidth(); 40239 const i = !this.enableRtl && e, s = this.scrollVisibleSvc.getScrollbarWidth(); 40240 i && (t += s), mr(this.eRightSpacer, t), this.eRightSpacer.classList.toggle("ag-scroller-corner", t <= s); 40241 let n = this.visibleCols.getColsLeftWidth(); 40242 this.enableRtl && e && (n += s), mr(this.eLeftSpacer, n), this.eLeftSpacer.classList.toggle("ag-scroller-corner", n <= s); 40243 } 40244 setScrollVisible() { 40245 const e = this.scrollVisibleSvc.horizontalScrollShowing, t = this.invisibleScrollbar, i = this.gos.get("suppressHorizontalScroll"), s = e && this.scrollVisibleSvc.getScrollbarWidth() || 0, o = i ? 0 : s === 0 && t ? 16 : s, r = () => { 40246 this.setScrollVisibleDebounce = 0, this.addOrRemoveCssClass("ag-scrollbar-invisible", t), up(this.getGui(), o), up(this.eViewport, o), up(this.eContainer, o), this.setDisplayed(e, { skipAriaHidden: !0 }); 40247 }; 40248 window.clearTimeout(this.setScrollVisibleDebounce), e ? this.setScrollVisibleDebounce = window.setTimeout(r, 100) : r(); 40249 } 40250 getScrollPosition() { 40251 return tv(this.eViewport, this.enableRtl); 40252 } 40253 setScrollPosition(e) { 40254 Yo(this.eViewport) || this.attemptSettingScrollPosition(e), iv(this.eViewport, e, this.enableRtl); 40255 } 40256}, ete = { 40257 selector: "AG-FAKE-HORIZONTAL-SCROLL", 40258 component: Jee 40259}, tte = class extends RN { 40260 constructor() { 40261 super( 40262 /* html */ 40263 `<div class="ag-body-vertical-scroll" aria-hidden="true"> 40264 <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport"> 40265 <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div> 40266 </div> 40267 </div>`, 40268 "vertical" 40269 ); 40270 } 40271 postConstruct() { 40272 super.postConstruct(), this.createManagedBean(new AN(this.eContainer)); 40273 const { ctrlsSvc: e } = this.beans; 40274 e.register("fakeVScrollComp", this), this.addManagedEventListeners({
40275 rowContainerHeightChanged: this.onRowContainerHeightChanged.bind(this, e) 40276 }); 40277 } 40278 setScrollVisible() { 40279 const { scrollVisibleSvc: e } = this.beans, t = e.verticalScrollShowing, i = this.invisibleScrollbar, s = t && e.getScrollbarWidth() || 0, n = s === 0 && i ? 16 : s; 40280 this.addOrRemoveCssClass("ag-scrollbar-invisible", i), mr(this.getGui(), n), mr(this.eViewport, n), mr(this.eContainer, n), this.setDisplayed(t, { skipAriaHidden: !0 }); 40281 } 40282 onRowContainerHeightChanged(e) { 40283 const i = e.getGridBodyCtrl().eBodyViewport, s = this.getScrollPosition(), n = i.scrollTop; 40284 s != n && this.setScrollPosition(n, !0); 40285 } 40286 getScrollPosition() { 40287 return this.eViewport.scrollTop; 40288 } 40289 setScrollPosition(e, t) { 40290 !t && !Yo(this.eViewport) && this.attemptSettingScrollPosition(e), this.eViewport.scrollTop = e; 40291 } 40292}, ite = { 40293 selector: "AG-FAKE-VERTICAL-SCROLL", 40294 component: tte 40295}; 40296function ste(e) { 40297 return e.cols ? e.cols.treeDepth + 1 : -1; 40298} 40299function Jr(e) { 40300 return e.ctrlsSvc.getHeaderRowContainerCtrl()?.getRowCount() ?? 0; 40301} 40302function fM(e) { 40303 const t = [], i = e.ctrlsSvc.getHeaderRowContainerCtrls(); 40304 for (const s of i) { 40305 if (!s) 40306 continue; 40307 const n = s.getGroupRowCount() || 0; 40308 for (let o = 0; o < n; o++) { 40309 const r = s.getGroupRowCtrlAtIndex(o), a = t[o]; 40310 if (r) { 40311 const l = nte(e, r); 40312 (a == null || l > a) && (t[o] = l); 40313 } 40314 } 40315 } 40316 return t; 40317} 40318function nte(e, t) { 40319 const i = e.colModel.isPivotMode() ? rte(e) : LN(e); 40320 let s = 0; 40321 const n = t.getHeaderCtrls(); 40322 for (const o of n) { 40323 const { column: r } = o; 40324 if (r.isAutoHeaderHeight()) { 40325 const a = r.getAutoHeaderHeight(); 40326 a != null && a > s && (s = a); 40327 } 40328 } 40329 return Math.max(i, s); 40330} 40331function mM(e) { 40332 const t = e.colModel.isPivotMode() ? ote(e) : Eg(e), s = e.visibleCols.allCols.filter((n) => n.isAutoHeaderHeight()).map((n) => n.getAutoHeaderHeight() || 0); 40333 return Math.max(t, ...s); 40334} 40335function Eg(e) { 40336 return e.gos.get("headerHeight") ?? e.environment.getDefaultHeaderHeight(); 40337} 40338function TN(e) { 40339 return e.gos.get("floatingFiltersHeight") ?? Eg(e); 40340} 40341function LN(e) { 40342 return e.gos.get("groupHeaderHeight") ?? Eg(e); 40343} 40344function ote(e) { 40345 return e.gos.get("pivotHeaderHeight") ?? Eg(e); 40346} 40347function rte(e) { 40348 return e.gos.get("pivotGroupHeaderHeight") ?? LN(e); 40349} 40350var ate = class extends he { 40351 setComp(e, t, i) { 40352 this.comp = e, this.eGui = t; 40353 const { beans: s } = this, { headerNavigation: n, touchSvc: o, ctrlsSvc: r } = s; 40354 n && this.createManagedBean( 40355 new sh(i, { 40356 onTabKeyDown: this.onTabKeyDown.bind(this), 40357 handleKeyDown: this.handleKeyDown.bind(this), 40358 onFocusOut: this.onFocusOut.bind(this) 40359 }) 40360 ), this.addManagedEventListeners({ 40361 columnPivotModeChanged: this.onPivotModeChanged.bind(this, s), 40362 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this, s) 40363 }), this.onPivotModeChanged(s), this.setupHeaderHeight(); 40364 const a = this.onHeaderContextMenu.bind(this); 40365 this.addManagedElementListeners(this.eGui, { contextmenu: a }), o?.mockHeaderContextMenu(this, a), r.register("gridHeaderCtrl", this); 40366 } 40367 setupHeaderHeight() { 40368 const e = this.setHeaderHeight.bind(this); 40369 e(), this.addManagedPropertyListeners( 40370 [ 40371 "headerHeight", 40372 "pivotHeaderHeight", 40373 "groupHeaderHeight", 40374 "pivotGroupHeaderHeight", 40375 "floatingFiltersHeight" 40376 ], 40377 e 40378 ), this.addManagedEventListeners({ 40379 displayedColumnsChanged: e, 40380 columnHeaderHeightChanged: e, 40381 // add this to the animation frame to avoid a feedback loop 40382 columnGroupHeaderHeightChanged: () => Hl(this.beans, () => e()), 40383 gridStylesChanged: e, 40384 advancedFilterEnabledChanged: e 40385 }); 40386 } 40387 setHeaderHeight() { 40388 const { beans: e } = this; 40389 let t = 0; 40390 const i = fM(e).reduce((o, r) => o + r, 0), s = mM(e); 40391 if (e.filterManager?.hasFloatingFilters() && (t += TN(e)), t += i, t += s, this.headerHeight === t) 40392 return; 40393 this.headerHeight = t; 40394 const n = `${t + 1}px`; 40395 this.comp.setHeightAndMinHeight(n), this.eventSvc.dispatchEvent({
40396 type: "headerHeightChanged" 40397 }); 40398 } 40399 onPivotModeChanged(e) { 40400 const t = e.colModel.isPivotMode(); 40401 this.comp.addOrRemoveCssClass("ag-pivot-on", t), this.comp.addOrRemoveCssClass("ag-pivot-off", !t); 40402 } 40403 onDisplayedColumnsChanged(e) { 40404 const i = e.visibleCols.allCols.some((s) => s.isSpanHeaderHeight()); 40405 this.comp.addOrRemoveCssClass("ag-header-allow-overflow", i); 40406 } 40407 onTabKeyDown(e) { 40408 const t = this.gos.get("enableRtl"), i = e.shiftKey, s = i !== t ? "LEFT" : "RIGHT", { beans: n } = this, { headerNavigation: o, focusSvc: r } = n; 40409 (o.navigateHorizontally(s, !0, e) || !i && r.focusOverlay(!1) || Id(n, i, !0)) && e.preventDefault(); 40410 } 40411 handleKeyDown(e) { 40412 let t = null; 40413 const { headerNavigation: i } = this.beans; 40414 switch (e.key) { 40415 case de.LEFT: 40416 t = "LEFT"; 40417 case de.RIGHT: { 40418 Ie(t) || (t = "RIGHT"), i.navigateHorizontally(t, !1, e) && e.preventDefault(); 40419 break; 40420 } 40421 case de.UP: 40422 t = "UP"; 40423 case de.DOWN: { 40424 Ie(t) || (t = "DOWN"), i.navigateVertically(t, null, e) && e.preventDefault(); 40425 break; 40426 } 40427 default: 40428 return; 40429 } 40430 } 40431 onFocusOut(e) { 40432 const { relatedTarget: t } = e, { eGui: i, beans: s } = this; 40433 !t && i.contains(gi(s)) || i.contains(t) || (s.focusSvc.focusedHeader = null); 40434 } 40435 onHeaderContextMenu(e, t, i) { 40436 const { menuSvc: s, ctrlsSvc: n } = this.beans; 40437 if (!e && !i || !s?.isHeaderContextMenuEnabled()) 40438 return; 40439 const { target: o } = e ?? t; 40440 (o === this.eGui || o === n.getHeaderRowContainerCtrl()?.eViewport) && s.showHeaderContextMenu(void 0, e, i); 40441 } 40442}, vM = class extends Tt { 40443 constructor(e, t) { 40444 super(e), this.ctrl = t; 40445 } 40446 getCtrl() { 40447 return this.ctrl; 40448 } 40449}, lte = class extends vM { 40450 constructor(e) { 40451 super( 40452 /* html */ 40453 `<div class="ag-header-cell" role="columnheader"> 40454 <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div> 40455 <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div> 40456 </div>`, 40457 e 40458 ), this.eResize = Pe, this.eHeaderCompWrapper = Pe, this.headerCompVersion = 0; 40459 } 40460 postConstruct() { 40461 const e = this.getGui(); 40462 ((n, o) => { 40463 o != null && o != "" ? e.setAttribute(n, o) : e.removeAttribute(n); 40464 })("col-id", this.ctrl.column.getColId()); 40465 const i = { 40466 setWidth: (n) => e.style.width = n, 40467 addOrRemoveCssClass: (n, o) => this.addOrRemoveCssClass(n, o), 40468 setAriaSort: (n) => n ? LQ(e, n) : kQ(e), 40469 setUserCompDetails: (n) => this.setUserCompDetails(n), 40470 getUserCompInstance: () => this.headerComp 40471 }; 40472 this.ctrl.setComp(i, this.getGui(), this.eResize, this.eHeaderCompWrapper, void 0); 40473 const s = this.ctrl.getSelectAllGui(); 40474 s && this.eResize.insertAdjacentElement("afterend", s); 40475 } 40476 destroy() { 40477 this.destroyHeaderComp(), super.destroy(); 40478 } 40479 destroyHeaderComp() { 40480 this.headerComp && (this.eHeaderCompWrapper.removeChild(this.headerCompGui), this.headerComp = this.destroyBean(this.headerComp), this.headerCompGui = void 0); 40481 } 40482 setUserCompDetails(e) { 40483 this.headerCompVersion++; 40484 const t = this.headerCompVersion; 40485 e.newAgStackInstance().then((i) => this.afterCompCreated(t, i)); 40486 } 40487 afterCompCreated(e, t) { 40488 if (e != this.headerCompVersion || !this.isAlive()) { 40489 this.destroyBean(t); 40490 return; 40491 } 40492 this.destroyHeaderComp(), this.headerComp = t, this.headerCompGui = t.getGui(), this.eHeaderCompWrapper.appendChild(this.headerCompGui), this.ctrl.setDragSource(this.getGui()); 40493 } 40494}, cte = class extends vM { 40495 constructor(e) { 40496 super( 40497 /* html */ 40498 `<div class="ag-header-group-cell" role="columnheader"> 40499 <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div> 40500 <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div> 40501 </div>`, 40502 e 40503 ), this.eResize = Pe, this.eHeaderCompWrapper = Pe; 40504 } 40505 postConstruct() { 40506 const e = this.getGui(), t = (s, n) => n != null ? e.setAttribute(s, n) : e.removeAttribute(s); 40507 e.setAttribute("col-id", this.ctrl.column.getUniqueId()); 40508 const i = { 40509 addOrRemoveCssClass: (s, n) => this.addOrRemoveCssClass(s, n), 40510 setHeaderWrapperHidden: (s) => { 40511 s ? this.eHeaderCompWrapper.style.setProperty("display", "none") : this.eHeaderCompWrapper.style.removeProperty("display"); 40512 }, 40513 setHeaderWrapperMaxHeight: (s) => { 40514 s != null ? this.eHeaderCompWrapper.style.setProperty("max-height", `${s}px`) : this.eHeaderCompWrapper.style.removeProperty("max-height"), this.eHeaderCompWrapper.classList.toggle("ag-header-cell-comp-wrapper-limited-height", s != null); 40515 }, 40516 setResizableDisplayed: (s) => ui(this.eResize, s), 40517 setWidth: (s) => e.style.width = s, 40518 setAriaExpanded: (s) => t("aria-expanded", s),
40519 setUserCompDetails: (s) => this.setUserCompDetails(s), 40520 getUserCompInstance: () => this.headerGroupComp 40521 }; 40522 this.ctrl.setComp(i, e, this.eResize, this.eHeaderCompWrapper, void 0); 40523 } 40524 setUserCompDetails(e) { 40525 e.newAgStackInstance().then((t) => this.afterHeaderCompCreated(t)); 40526 } 40527 afterHeaderCompCreated(e) { 40528 const t = () => this.destroyBean(e); 40529 if (!this.isAlive()) { 40530 t(); 40531 return; 40532 } 40533 const i = this.getGui(), s = e.getGui(); 40534 this.eHeaderCompWrapper.appendChild(s), this.addDestroyFunc(t), this.headerGroupComp = e, this.ctrl.setDragSource(i); 40535 } 40536 addOrRemoveHeaderWrapperStyle(e, t) { 40537 const { eHeaderCompWrapper: i } = this; 40538 t ? i.style.setProperty(e, t) : i.style.removeProperty(e); 40539 } 40540}, ute = class extends vM { 40541 constructor(e) { 40542 super( 40543 /* html */ 40544 `<div class="ag-header-cell ag-floating-filter" role="gridcell"> 40545 <div data-ref="eFloatingFilterBody" role="presentation"></div> 40546 <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation"> 40547 <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button> 40548 </div> 40549 </div>`, 40550 e 40551 ), this.eFloatingFilterBody = Pe, this.eButtonWrapper = Pe, this.eButtonShowMainFilter = Pe; 40552 } 40553 postConstruct() { 40554 const e = this.getGui(), t = { 40555 addOrRemoveCssClass: (i, s) => this.addOrRemoveCssClass(i, s), 40556 addOrRemoveBodyCssClass: (i, s) => this.eFloatingFilterBody.classList.toggle(i, s), 40557 setButtonWrapperDisplayed: (i) => ui(this.eButtonWrapper, i), 40558 setCompDetails: (i) => this.setCompDetails(i), 40559 getFloatingFilterComp: () => this.compPromise, 40560 setWidth: (i) => e.style.width = i, 40561 setMenuIcon: (i) => this.eButtonShowMainFilter.appendChild(i) 40562 }; 40563 this.ctrl.setComp(t, e, this.eButtonShowMainFilter, this.eFloatingFilterBody, void 0); 40564 } 40565 setCompDetails(e) { 40566 if (!e) { 40567 this.destroyFloatingFilterComp(), this.compPromise = null; 40568 return; 40569 } 40570 this.compPromise = e.newAgStackInstance(), this.compPromise.then((t) => this.afterCompCreated(t)); 40571 } 40572 destroy() { 40573 this.destroyFloatingFilterComp(), super.destroy(); 40574 } 40575 destroyFloatingFilterComp() { 40576 this.floatingFilterComp && (this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()), this.floatingFilterComp = this.destroyBean(this.floatingFilterComp)); 40577 } 40578 afterCompCreated(e) { 40579 if (e) { 40580 if (!this.isAlive()) { 40581 this.destroyBean(e); 40582 return; 40583 } 40584 this.destroyFloatingFilterComp(), this.floatingFilterComp = e, this.eFloatingFilterBody.appendChild(e.getGui()), e.afterGuiAttached && e.afterGuiAttached(); 40585 } 40586 } 40587}, dte = class extends Tt { 40588 constructor(e) { 40589 super(), this.headerComps = {}, this.ctrl = e, this.setTemplate( 40590 /* html */ 40591 `<div class="${this.ctrl.headerRowClass}" role="row"></div>` 40592 ); 40593 } 40594 postConstruct() { 40595 dO(this.getGui(), this.ctrl.getAriaRowIndex()); 40596 const e = { 40597 setHeight: (t) => this.getGui().style.height = t, 40598 setTop: (t) => this.getGui().style.top = t, 40599 setHeaderCtrls: (t, i) => this.setHeaderCtrls(t, i), 40600 setWidth: (t) => this.getGui().style.width = t 40601 }; 40602 this.ctrl.setComp(e, void 0); 40603 } 40604 destroy() { 40605 this.setHeaderCtrls([], !1), super.destroy(); 40606 } 40607 setHeaderCtrls(e, t) { 40608 if (!this.isAlive()) 40609 return; 40610 const i = this.headerComps; 40611 if (this.headerComps = {}, e.forEach((s) => { 40612 const n = s.instanceId; 40613 let o = i[n]; 40614 delete i[n], o == null && (o = this.createHeaderComp(s), this.getGui().appendChild(o.getGui())), this.headerComps[n] = o; 40615 }), Object.values(i).forEach((s) => { 40616 this.getGui().removeChild(s.getGui()), this.destroyBean(s); 40617 }), t) { 40618 const s = Object.values(this.headerComps); 40619 s.sort( 40620 (o, r) => { 40621 const a = o.getCtrl().column.getLeft(), l = r.getCtrl().column.getLeft(); 40622 return a - l; 40623 } 40624 ); 40625 const n = s.map((o) => o.getGui()); 40626 xO(this.getGui(), n); 40627 } 40628 } 40629 createHeaderComp(e) { 40630 let t; 40631 switch (this.ctrl.type) { 40632 case "group": 40633 t = new cte(e); 40634 break; 40635 case "filter": 40636 t = new ute(e); 40637 break; 40638 default: 40639 t = new lte(e); 40640 break; 40641 } 40642 return this.createBean(t), t.setParentComponent(this), t;
40643 } 40644}, yM = class extends he { 40645 constructor(e, t, i, s) { 40646 super(), this.columnOrGroup = e, this.eCell = t, this.colsSpanning = s, this.columnOrGroup = e, this.ariaEl = t.querySelector("[role=columnheader]") || t, this.beans = i; 40647 } 40648 setColsSpanning(e) { 40649 this.colsSpanning = e, this.onLeftChanged(); 40650 } 40651 getColumnOrGroup() { 40652 const { beans: e, colsSpanning: t } = this; 40653 return e.gos.get("enableRtl") && t ? It(t) : this.columnOrGroup; 40654 } 40655 postConstruct() { 40656 const e = this.onLeftChanged.bind(this); 40657 this.addManagedListeners(this.columnOrGroup, { leftChanged: e }), this.setLeftFirstTime(), this.addManagedEventListeners({ displayedColumnsWidthChanged: e }), this.addManagedPropertyListener("domLayout", e); 40658 } 40659 setLeftFirstTime() { 40660 const { gos: e, colAnimation: t } = this.beans, i = e.get("suppressColumnMoveAnimation"), s = Ie(this.columnOrGroup.getOldLeft()); 40661 t?.isActive() && s && !i ? this.animateInLeft() : this.onLeftChanged(); 40662 } 40663 animateInLeft() { 40664 const e = this.getColumnOrGroup(), t = this.modifyLeftForPrintLayout(e, e.getOldLeft()), i = this.modifyLeftForPrintLayout(e, e.getLeft()); 40665 this.setLeft(t), this.actualLeft = i, this.beans.colAnimation.executeNextVMTurn(() => { 40666 this.actualLeft === i && this.setLeft(i); 40667 }); 40668 } 40669 onLeftChanged() { 40670 const e = this.getColumnOrGroup(), t = e.getLeft(); 40671 this.actualLeft = this.modifyLeftForPrintLayout(e, t), this.setLeft(this.actualLeft); 40672 } 40673 modifyLeftForPrintLayout(e, t) { 40674 const { gos: i, visibleCols: s } = this.beans; 40675 if (!gs(i, "print") || e.getPinned() === "left") 40676 return t; 40677 const o = s.getColsLeftWidth(); 40678 if (e.getPinned() === "right") { 40679 const r = s.bodyWidth; 40680 return o + r + t; 40681 } 40682 return o + t; 40683 } 40684 setLeft(e) { 40685 if (Ie(e) && (this.eCell.style.left = `${e}px`), xi(this.columnOrGroup)) { 40686 const t = this.columnOrGroup.getLeafColumns(); 40687 if (!t.length) 40688 return; 40689 t.length > 1 && TQ(this.ariaEl, t.length); 40690 } 40691 } 40692}, hte = 0, kN = "headerCtrl", CM = class extends he { 40693 constructor(e, t) { 40694 super(), this.column = e, this.rowCtrl = t, this.resizeToggleTimeout = 0, this.resizeMultiplier = 1, this.resizeFeature = null, this.lastFocusEvent = null, this.dragSource = null, this.instanceId = e.getUniqueId() + "-" + hte++; 40695 } 40696 postConstruct() { 40697 const e = this.refreshTabIndex.bind(this); 40698 this.addManagedPropertyListeners(["suppressHeaderFocus"], e), this.addManagedEventListeners({ 40699 overlayExclusiveChanged: e 40700 }); 40701 } 40702 shouldStopEventPropagation(e) { 40703 const { headerRowIndex: t, column: i } = this.beans.focusSvc.focusedHeader, s = i.getDefinition(), n = s && s.suppressHeaderKeyboardEvent; 40704 if (!Ie(n)) 40705 return !1; 40706 const o = this.gos.addGridCommonParams({ 40707 colDef: s, 40708 column: i, 40709 headerRowIndex: t, 40710 event: e 40711 }); 40712 return !!n(o); 40713 } 40714 getWrapperHasFocus() { 40715 return gi(this.beans) === this.eGui; 40716 } 40717 setGui(e, t) { 40718 this.eGui = e, this.addDomData(t), t.addManagedListeners(this.beans.eventSvc, { 40719 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this) 40720 }), t.addManagedElementListeners(this.eGui, { 40721 focus: this.onGuiFocus.bind(this) 40722 }), this.onDisplayedColumnsChanged(), this.refreshTabIndex(); 40723 } 40724 onGuiFocus() { 40725 this.eventSvc.dispatchEvent({ 40726 type: "headerFocused", 40727 column: this.column 40728 }); 40729 } 40730 setupAutoHeight(e) { 40731 const { wrapperElement: t, checkMeasuringCallback: i, compBean: s } = e, { beans: n } = this, o = (d) => { 40732 if (!this.isAlive() || !s.isAlive()) 40733 return; 40734 const { paddingTop: p, paddingBottom: f, borderBottomWidth: m, borderTopWidth: y } = eu(this.eGui), b = p + f + m + y, w = t.offsetHeight + b; 40735 if (d < 5) { 40736 const M = Ei(n), A = !M || !M.contains(t), I = w == 0; 40737 if (A || I) { 40738 Hl(n, () => o(d + 1)); 40739 return; 40740 } 40741 } 40742 this.setColHeaderHeight(this.column, w); 40743 }; 40744 let r = !1, a; 40745 const l = () => { 40746 const d = this.column.isAutoHeaderHeight(); 40747 d && !r && c(), !d && r && u(); 40748 }, c = () => { 40749 r = !0, o(0), this.comp.addOrRemoveCssClass("ag-header-cell-auto-height", !0), a = zl(this.beans, t, () => o(0)); 40750 }, u = () => { 40751 r = !1, a && a(), this.comp.addOrRemoveCssClass("ag-header-cell-auto-height", !1), a = void 0; 40752 }; 40753 l(), s.addDestroyFunc(() =>
40753 u()), s.addManagedListeners(this.column, { widthChanged: () => r && o(0) }), s.addManagedEventListeners({ 40754 sortChanged: () => { 40755 r && window.setTimeout(() => o(0)); 40756 } 40757 }), i && i(l); 40758 } 40759 onDisplayedColumnsChanged() { 40760 const { comp: e, column: t, beans: i, eGui: s } = this; 40761 !e || !t || !s || (uN(e, t, i.visibleCols), hO(s, i.visibleCols.getAriaColIndex(t))); 40762 } 40763 addResizeAndMoveKeyboardListeners(e) { 40764 e.addManagedListeners(this.eGui, { 40765 keydown: this.onGuiKeyDown.bind(this), 40766 keyup: this.onGuiKeyUp.bind(this) 40767 }); 40768 } 40769 refreshTabIndex() { 40770 const e = hd(this.beans); 40771 this.eGui && vo(this.eGui, "tabindex", e ? null : "-1"); 40772 } 40773 onGuiKeyDown(e) { 40774 const t = gi(this.beans), i = e.key === de.LEFT || e.key === de.RIGHT; 40775 if (this.isResizing && (e.preventDefault(), e.stopImmediatePropagation()), // if elements within the header are focused, we don't process the event 40776 t !== this.eGui || // if shiftKey and altKey are not pressed, it's cell navigation so we don't process the event 40777 !e.shiftKey && !e.altKey || ((this.isResizing || i) && (e.preventDefault(), e.stopImmediatePropagation()), !i)) 40778 return; 40779 const n = e.key === de.LEFT !== this.gos.get("enableRtl") ? "left" : "right"; 40780 if (e.altKey) { 40781 this.isResizing = !0, this.resizeMultiplier += 1; 40782 const o = this.getViewportAdjustedResizeDiff(e); 40783 this.resizeHeader(o, e.shiftKey), this.resizeFeature?.toggleColumnResizing(!0); 40784 } else 40785 this.moveHeader(n); 40786 } 40787 moveHeader(e) { 40788 this.beans.colMoves?.moveHeader(e, this.eGui, this.column, this.rowCtrl.pinned, this); 40789 } 40790 getViewportAdjustedResizeDiff(e) { 40791 const t = this.getResizeDiff(e), { pinnedCols: i } = this.beans; 40792 return i ? i.getHeaderResizeDiff(t, this.column) : t; 40793 } 40794 getResizeDiff(e) { 40795 const { gos: t, column: i } = this; 40796 let s = e.key === de.LEFT !== t.get("enableRtl"); 40797 const n = i.getPinned(), o = t.get("enableRtl"); 40798 return n && o !== (n === "right") && (s = !s), (s ? -1 : 1) * this.resizeMultiplier; 40799 } 40800 onGuiKeyUp() { 40801 this.isResizing && (this.resizeToggleTimeout && (window.clearTimeout(this.resizeToggleTimeout), this.resizeToggleTimeout = 0), this.isResizing = !1, this.resizeMultiplier = 1, this.resizeToggleTimeout = window.setTimeout(() => { 40802 this.resizeFeature?.toggleColumnResizing(!1); 40803 }, 150)); 40804 } 40805 handleKeyDown(e) { 40806 const t = this.getWrapperHasFocus(); 40807 switch (e.key) { 40808 case de.PAGE_DOWN: 40809 case de.PAGE_UP: 40810 case de.PAGE_HOME: 40811 case de.PAGE_END: 40812 t && e.preventDefault(); 40813 } 40814 } 40815 addDomData(e) { 40816 const t = kN, { eGui: i, gos: s } = this; 40817 Bc(s, i, t, this), e.addDestroyFunc(() => Bc(s, i, t, null)); 40818 } 40819 focus(e) { 40820 const { eGui: t } = this; 40821 return t ? (this.lastFocusEvent = e || null, t.focus(), !0) : !1; 40822 } 40823 focusThis() { 40824 this.beans.focusSvc.focusedHeader = { headerRowIndex: this.rowCtrl.rowIndex, column: this.column }; 40825 } 40826 removeDragSource() { 40827 this.dragSource && (this.beans.dragAndDrop?.removeDragSource(this.dragSource), this.dragSource = null); 40828 } 40829 handleContextMenuMouseEvent(e, t, i) { 40830 const s = e ?? t, { menuSvc: n, gos: o } = this.beans; 40831 o.get("preventDefaultOnContextMenu") && s.preventDefault(), n?.isHeaderContextMenuEnabled(i) && n.showHeaderContextMenu(i, e, t), this.dispatchColumnMouseEvent("columnHeaderContextMenu", i); 40832 } 40833 dispatchColumnMouseEvent(e, t) { 40834 this.eventSvc.dispatchEvent({ 40835 type: e, 40836 column: t 40837 }); 40838 } 40839 setColHeaderHeight(e, t) { 40840 if (!e.setAutoHeaderHeight(t)) 40841 return; 40842 const { eventSvc: i } = this; 40843 e.isColumn ? i.dispatchEvent({ 40844 type: "columnHeaderHeightChanged", 40845 column: e, 40846 columns: [e], 40847 source: "autosizeColumnHeaderHeight" 40848 }) : i.dispatchEvent({ 40849 type: "columnGroupHeaderHeightChanged", 40850 columnGroup: e, 40851 source: "autosizeColumnGroupHeaderHeight" 40852 }); 40853 } 40854 clearComponent() { 40855 this.removeDragSource(), this.resizeFeature = null, this.comp = null, this.eGui = null; 40856 } 40857 destroy() { 40858 super.destroy(), this.column = null, this.lastFocusEvent = null, this.rowCtrl = null; 40859 } 40860}, pte = class extends CM { 40861 constructor() { 40862 super(...arguments), this.refreshFunctions = {}, this.userHeaderClasses = /* @__PURE__ */ new Set(), this.ariaDescriptionProperties = /* @__PURE__ */ new Map(); 40863 } 40864 setComp(e, t, i, s, n) { 40865 this.comp = e; 40866 const { colResize: o, context: r, colHover: a } = this.beans, l = Dg(this, r, n); 40867 this.setGui(t, l), this.updateState(), this.setupWidth(l), this.setupMovingCss(l), this.setupMenuClass(l), this.setupSortableClass(l), this.setupWrapTextClass(), this.refreshSpanHeaderHeight(), this.setupAutoHeight({ 40868 wrapperElement: s, 40869 checkMeasuringCallback: (u) => this.setRefreshFunction("measuring", u), 40870 compBean: l 40871 }), this.addColumnHoverListener(l), this.setupFilterClass(l), this.setupClasse
40871sFromColDef(), this.setupTooltip(), this.addActiveHeaderMouseListeners(l), this.setupSelectAll(l), this.setupUserComp(), this.refreshAria(), o ? this.resizeFeature = l.createManagedBean( 40872 o.createResizeFeature(this.rowCtrl.pinned, this.column, i, e, this) 40873 ) : ui(i, !1), a?.createHoverFeature(l, [this.column], t), l.createManagedBean(new yM(this.column, t, this.beans)), l.createManagedBean( 40874 new sh(t, { 40875 shouldStopEventPropagation: (u) => this.shouldStopEventPropagation(u), 40876 onTabKeyDown: () => null, 40877 handleKeyDown: this.handleKeyDown.bind(this), 40878 onFocusIn: this.onFocusIn.bind(this), 40879 onFocusOut: this.onFocusOut.bind(this) 40880 }) 40881 ), this.addResizeAndMoveKeyboardListeners(l), l.addManagedPropertyListeners( 40882 ["suppressMovableColumns", "suppressMenuHide", "suppressAggFuncInHeader"], 40883 () => this.refresh() 40884 ), l.addManagedListeners(this.column, { colDefChanged: () => this.refresh() }), l.addManagedListeners(this.column, { headerHighlightChanged: this.onHeaderHighlightChanged.bind(this) }); 40885 const c = () => this.checkDisplayName(); 40886 l.addManagedEventListeners({ 40887 columnValueChanged: c, 40888 columnRowGroupChanged: c, 40889 columnPivotChanged: c, 40890 headerHeightChanged: this.onHeaderHeightChanged.bind(this) 40891 }), l.addDestroyFunc(() => { 40892 this.refreshFunctions = {}, this.selectAllFeature = null, this.dragSourceElement = void 0, this.userCompDetails = null, this.userHeaderClasses.clear(), this.ariaDescriptionProperties.clear(), this.clearComponent(); 40893 }); 40894 } 40895 resizeHeader(e, t) { 40896 this.beans.colResize?.resizeHeader(this.column, e, t); 40897 } 40898 setupUserComp() { 40899 const e = this.lookupUserCompDetails(); 40900 e && this.setCompDetails(e); 40901 } 40902 setCompDetails(e) { 40903 this.userCompDetails = e, this.comp.setUserCompDetails(e); 40904 } 40905 lookupUserCompDetails() { 40906 const e = this.createParams(), t = this.column.getColDef(); 40907 return hJ(this.beans.userCompFactory, t, e); 40908 } 40909 createParams() { 40910 const { menuSvc: e, sortSvc: t, colFilter: i, gos: s } = this.beans; 40911 return s.addGridCommonParams({ 40912 column: this.column, 40913 displayName: this.displayName, 40914 enableSorting: this.column.isSortable(), 40915 enableMenu: this.menuEnabled, 40916 enableFilterButton: this.openFilterEnabled && !!e?.isHeaderFilterButtonEnabled(this.column), 40917 enableFilterIcon: !!i && (!this.openFilterEnabled || _n(this.gos)), 40918 showColumnMenu: (o) => { 40919 e?.showColumnMenu({ 40920 column: this.column, 40921 buttonElement: o, 40922 positionBy: "button" 40923 }); 40924 }, 40925 showColumnMenuAfterMouseClick: (o) => { 40926 e?.showColumnMenu({ 40927 column: this.column, 40928 mouseEvent: o, 40929 positionBy: "mouse" 40930 }); 40931 }, 40932 showFilter: (o) => { 40933 e?.showFilterMenu({ 40934 column: this.column, 40935 buttonElement: o, 40936 containerType: "columnFilter", 40937 positionBy: "button" 40938 }); 40939 }, 40940 progressSort: (o) => { 40941 t?.progressSort(this.column, !!o, "uiColumnSorted"); 40942 }, 40943 setSort: (o, r) => { 40944 t?.setSortForColumn(this.column, o, !!r, "uiColumnSorted"); 40945 }, 40946 eGridHeader: this.eGui, 40947 setTooltip: (o, r) => { 40948 s.assertModuleRegistered("Tooltip", 3), this.setupTooltip(o, r); 40949 } 40950 }); 40951 } 40952 setupSelectAll(e) { 40953 const { selectionSvc: t } = this.beans; 40954 t && (this.selectAllFeature = e.createManagedBean(t.createSelectAllFeature(this.column)), this.selectAllFeature.setComp(this)); 40955 } 40956 getSelectAllGui() { 40957 return this.selectAllFeature?.getCheckboxGui(); 40958 } 40959 handleKeyDown(e) { 40960 super.handleKeyDown(e), e.key === de.SPACE && this.selectAllFeature?.onSpaceKeyDown(e), e.key === de.ENTER && this.onEnterKeyDown(e), e.key === de.DOWN && e.altKey && this.showMenuOnKeyPress(e, !1); 40961 } 40962 onEnterKeyDown(e) { 40963 e.ctrlKey || e.metaKey ? this.showMenuOnKeyPress(e, !0) : this.sortable && this.beans.sortSvc?.progressSort(this.column, e.shiftKey, "uiColumnSorted"); 40964 } 40965 showMenuOnKeyPress(e, t) { 40966 const i = this.comp.getUserCompInstance(); 40967 qR(i) && i.onMenuKeyboardShortcut(t) && e.preventDefault(); 40968 } 40969 onFocusIn(e) { 40970 this.eGui.contains(e.relatedTarget) || (this.focusThis(), this.announceAriaDescription()), jJ() && this.setActiveHeader(!0); 40971 } 40972 onFocusOut(e) { 40973 this.eGui.contains(e.relatedTarget) || this.setActiveHeader(!1); 40974 } 40975 setupTooltip(e, t) { 40976 this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderTooltip( 40977 this.tooltipFeature, 40978 this, 40979 e, 40980 t 40981 ); 40982 }
40983 setupClassesFromColDef() { 40984 const e = () => { 40985 const t = this.column.getColDef(), i = cN(t, this.gos, this.column, null), s = this.userHeaderClasses; 40986 this.userHeaderClasses = new Set(i), i.forEach((n) => { 40987 s.has(n) ? s.delete(n) : this.comp.addOrRemoveCssClass(n, !0); 40988 }), s.forEach((n) => this.comp.addOrRemoveCssClass(n, !1)); 40989 }; 40990 this.setRefreshFunction("headerClasses", e), e(); 40991 } 40992 setDragSource(e) { 40993 this.dragSourceElement = e, this.removeDragSource(), !(!e || !this.draggable) && (this.dragSource = this.beans.colMoves?.setDragSourceForHeader(e, this.column, this.displayName) ?? null); 40994 } 40995 updateState() { 40996 const { menuSvc: e } = this.beans; 40997 this.menuEnabled = !!e?.isColumnMenuInHeaderEnabled(this.column), this.openFilterEnabled = !!e?.isFilterMenuInHeaderEnabled(this.column), this.sortable = this.column.isSortable(), this.displayName = this.calculateDisplayName(), this.draggable = this.workOutDraggable(); 40998 } 40999 setRefreshFunction(e, t) { 41000 this.refreshFunctions[e] = t; 41001 } 41002 refresh() { 41003 this.updateState(), this.refreshHeaderComp(), this.refreshAria(), Object.values(this.refreshFunctions).forEach((e) => e()); 41004 } 41005 refreshHeaderComp() { 41006 const e = this.lookupUserCompDetails(); 41007 if (!e) 41008 return; 41009 (this.comp.getUserCompInstance() != null && this.userCompDetails.componentClass == e.componentClass ? this.attemptHeaderCompRefresh(e.params) : !1) ? this.setDragSource(this.dragSourceElement) : this.setCompDetails(e); 41010 } 41011 attemptHeaderCompRefresh(e) { 41012 const t = this.comp.getUserCompInstance(); 41013 return !t || !t.refresh ? !1 : t.refresh(e); 41014 } 41015 calculateDisplayName() { 41016 return this.beans.colNames.getDisplayNameForColumn(this.column, "header", !0); 41017 } 41018 checkDisplayName() { 41019 this.displayName !== this.calculateDisplayName() && this.refresh(); 41020 } 41021 workOutDraggable() { 41022 const e = this.column.getColDef(); 41023 return !!(!this.gos.get("suppressMovableColumns") && !e.suppressMovable && !e.lockPosition) || !!e.enableRowGroup || !!e.enablePivot; 41024 } 41025 setupWidth(e) { 41026 const t = () => { 41027 const i = this.column.getActualWidth(); 41028 this.comp.setWidth(`${i}px`); 41029 }; 41030 e.addManagedListeners(this.column, { widthChanged: t }), t(); 41031 } 41032 setupMovingCss(e) { 41033 const t = () => { 41034 this.comp.addOrRemoveCssClass("ag-header-cell-moving", this.column.isMoving()); 41035 }; 41036 e.addManagedListeners(this.column, { movingChanged: t }), t(); 41037 } 41038 setupMenuClass(e) { 41039 const t = () => { 41040 this.comp.addOrRemoveCssClass("ag-column-menu-visible", this.column.isMenuVisible()); 41041 }; 41042 e.addManagedListeners(this.column, { menuVisibleChanged: t }), t(); 41043 } 41044 setupSortableClass(e) { 41045 const t = () => { 41046 this.comp.addOrRemoveCssClass("ag-header-cell-sortable", !!this.sortable); 41047 }; 41048 t(), this.setRefreshFunction("updateSortable", t), e.addManagedEventListeners({ sortChanged: this.refreshAriaSort.bind(this) }); 41049 } 41050 setupFilterClass(e) { 41051 const t = () => { 41052 const i = this.column.isFilterActive(); 41053 this.comp.addOrRemoveCssClass("ag-header-cell-filtered", i), this.refreshAria(); 41054 }; 41055 e.addManagedListeners(this.column, { filterActiveChanged: t }), t(); 41056 } 41057 setupWrapTextClass() { 41058 const e = () => { 41059 const t = !!this.column.getColDef().wrapHeaderText; 41060 this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text", t); 41061 }; 41062 e(), this.setRefreshFunction("wrapText", e); 41063 } 41064 onHeaderHighlightChanged() { 41065 const e = this.column.getHighlighted(), t = e === 0, i = e === 1; 41066 this.comp.addOrRemoveCssClass("ag-header-highlight-before", t), this.comp.addOrRemoveCssClass("ag-header-highlight-after", i); 41067 } 41068 onDisplayedColumnsChanged() { 41069 super.onDisplayedColumnsChanged(), this.isAlive() && this.onHeaderHeightChanged(); 41070 } 41071 onHeaderHeightChanged() { 41072 this.refreshSpanHeaderHeight(); 41073 } 41074 refreshSpanHeaderHeight() { 41075 const { eGui: e, column: t, comp: i, beans: s } = this, n = fM(this.beans), o = n.reduce((u, d) => u += d, 0) === 0; 41076 if (i.addOrRemoveCssClass("ag-header-parent-hidden", o), !t.isSpanHeaderHeight()) { 41077 e.style.removeProperty("top"), e.style.removeProperty("height"), i.addOrRemoveCssClass("ag-header-span-height", !1), i.addOrRemoveCssClass("ag-header-span-total", !1); 41078 return; 41079 } 41080 const { numberOfParents: r, isSpanningTotal: a } = this.column.getColumnGroupPaddingInfo(); 41081 i.addOrRemoveCssClass("ag-header-span-height", r > 0); 41082 const l = mM(s); 41083 if (r === 0) { 41084 i.addOrRemoveCssClass("ag-header-span-total", !1), e.style.setProperty("top", "0px"), e.style.setProperty("height", `${l}px`); 41085 return; 41086 } 41087 i.addOrRemoveCssClass("ag-header-span-total", a);
41088 let c = 0; 41089 for (let u = 0; u < r; u++) 41090 c += n[n.length - 1 - u]; 41091 e.style.setProperty("top", `${-c}px`), e.style.setProperty("height", `${l + c}px`); 41092 } 41093 refreshAriaSort() { 41094 if (this.sortable) { 41095 const e = this.getLocaleTextFunc(), t = this.beans.sortSvc?.getDisplaySortForColumn(this.column) || null; 41096 this.comp.setAriaSort(bQ(t)), this.setAriaDescriptionProperty("sort", e("ariaSortableColumn", "Press ENTER to sort")); 41097 } else 41098 this.comp.setAriaSort(), this.setAriaDescriptionProperty("sort", null); 41099 } 41100 refreshAriaMenu() { 41101 if (this.menuEnabled) { 41102 const e = this.getLocaleTextFunc(); 41103 this.setAriaDescriptionProperty("menu", e("ariaMenuColumn", "Press ALT DOWN to open column menu")); 41104 } else 41105 this.setAriaDescriptionProperty("menu", null); 41106 } 41107 refreshAriaFilterButton() { 41108 if (this.openFilterEnabled && !_n(this.gos)) { 41109 const e = this.getLocaleTextFunc(); 41110 this.setAriaDescriptionProperty( 41111 "filterButton", 41112 e("ariaFilterColumn", "Press CTRL ENTER to open filter") 41113 ); 41114 } else 41115 this.setAriaDescriptionProperty("filterButton", null); 41116 } 41117 refreshAriaFiltered() { 41118 const e = this.getLocaleTextFunc(); 41119 this.column.isFilterActive() ? this.setAriaDescriptionProperty("filter", e("ariaColumnFiltered", "Column Filtered")) : this.setAriaDescriptionProperty("filter", null); 41120 } 41121 setAriaDescriptionProperty(e, t) { 41122 t != null ? this.ariaDescriptionProperties.set(e, t) : this.ariaDescriptionProperties.delete(e); 41123 } 41124 announceAriaDescription() { 41125 if (!this.eGui.contains(gi(this.beans))) 41126 return; 41127 const e = Array.from(this.ariaDescriptionProperties.keys()).sort((t, i) => t === "filter" ? -1 : i.charCodeAt(0) - t.charCodeAt(0)).map((t) => this.ariaDescriptionProperties.get(t)).join(". "); 41128 this.beans.ariaAnnounce?.announceValue(e, "columnHeader"); 41129 } 41130 refreshAria() { 41131 this.refreshAriaSort(), this.refreshAriaMenu(), this.refreshAriaFilterButton(), this.refreshAriaFiltered(); 41132 } 41133 addColumnHoverListener(e) { 41134 this.beans.colHover?.addHeaderColumnHoverListener(e, this.comp, this.column); 41135 } 41136 addActiveHeaderMouseListeners(e) { 41137 const t = (n) => this.handleMouseOverChange(n.type === "mouseenter"), i = () => this.dispatchColumnMouseEvent("columnHeaderClicked", this.column), s = (n) => this.handleContextMenuMouseEvent(n, void 0, this.column); 41138 e.addManagedListeners(this.eGui, { 41139 mouseenter: t, 41140 mouseleave: t, 41141 click: i, 41142 contextmenu: s 41143 }); 41144 } 41145 handleMouseOverChange(e) { 41146 this.setActiveHeader(e), this.eventSvc.dispatchEvent({ 41147 type: e ? "columnHeaderMouseOver" : "columnHeaderMouseLeave", 41148 column: this.column 41149 }); 41150 } 41151 setActiveHeader(e) { 41152 this.comp.addOrRemoveCssClass("ag-header-active", e); 41153 } 41154 getAnchorElementForMenu(e) { 41155 const t = this.comp.getUserCompInstance(); 41156 return qR(t) ? t.getAnchorElementForMenu(e) : this.eGui; 41157 } 41158 destroy() { 41159 this.tooltipFeature = this.destroyBean(this.tooltipFeature), super.destroy(); 41160 } 41161}; 41162function qR(e) { 41163 return typeof e.getAnchorElementForMenu == "function" && typeof e.onMenuKeyboardShortcut == "function"; 41164} 41165var gte = 0, A0 = class extends he { 41166 constructor(e, t, i) { 41167 super(), this.rowIndex = e, this.pinned = t, this.type = i, this.instanceId = gte++; 41168 const s = i == "group" ? "ag-header-row-column-group" : i == "filter" ? "ag-header-row-column-filter" : "ag-header-row-column"; 41169 this.headerRowClass = `ag-header-row ${s}`; 41170 } 41171 postConstruct() { 41172 this.isPrintLayout = gs(this.gos, "print"), this.isEnsureDomOrder = this.gos.get("ensureDomOrder"); 41173 } 41174 /** Checks that every header cell that is currently visible has been rendered. 41175 * Can only be false under some circumstances when using React 41176 */ 41177 areCellsRendered() { 41178 return this.comp ? this.getHeaderCellCtrls().every((e) => e.eGui != null) : !1; 41179 } 41180 /** 41181 * 41182 * @param comp Proxy to the actual component 41183 * @param initCompState Should the component be initialised with the current state of the controller. Default: true 41184 */ 41185 setComp(e, t, i = !0) { 41186 this.comp = e, t = Dg(this, this.beans.context, t), i && (this.onRowHeightChanged(), this.onVirtualColumnsChanged()), this.setWidth(), this.addEventListeners(t); 41187 } 41188 getAriaRowIndex() { 41189 return this.rowIndex + 1; 41190 } 41191 addEventListeners(e) { 41192 const t = this.onRowHeightChanged.bind(this); 41193 e.addManagedEventListeners({ 41194 columnResized: this.setWidth.bind(this), 41195 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), 41196 virtualColumnsChanged: (i) => this.onVirtualColumnsChanged(i.afterScroll),
41197 columnGroupHeaderHeightChanged: t, 41198 columnHeaderHeightChanged: t, 41199 gridStylesChanged: t, 41200 advancedFilterEnabledChanged: t 41201 }), e.addManagedPropertyListener("domLayout", this.onDisplayedColumnsChanged.bind(this)), e.addManagedPropertyListener("ensureDomOrder", (i) => this.isEnsureDomOrder = i.currentValue), e.addManagedPropertyListeners( 41202 [ 41203 "headerHeight", 41204 "pivotHeaderHeight", 41205 "groupHeaderHeight", 41206 "pivotGroupHeaderHeight", 41207 "floatingFiltersHeight" 41208 ], 41209 t 41210 ); 41211 } 41212 getHeaderCellCtrl(e) { 41213 if (this.headerCellCtrls) { 41214 for (const t of this.headerCellCtrls.values()) 41215 if (t.column === e) 41216 return t; 41217 } 41218 } 41219 onDisplayedColumnsChanged() { 41220 this.isPrintLayout = gs(this.gos, "print"), this.onVirtualColumnsChanged(), this.setWidth(), this.onRowHeightChanged(); 41221 } 41222 setWidth() { 41223 const e = this.getWidthForRow(); 41224 this.comp.setWidth(`${e}px`); 41225 } 41226 getWidthForRow() { 41227 const { visibleCols: e } = this.beans; 41228 return this.isPrintLayout ? this.pinned != null ? 0 : e.getContainerWidth("right") + e.getContainerWidth("left") + e.getContainerWidth(null) : e.getContainerWidth(this.pinned); 41229 } 41230 onRowHeightChanged() { 41231 const { topOffset: e, rowHeight: t } = this.getTopAndHeight(); 41232 this.comp.setTop(e + "px"), this.comp.setHeight(t + "px"); 41233 } 41234 getTopAndHeight() { 41235 const { filterManager: e } = this.beans, t = [], i = fM(this.beans), s = mM(this.beans); 41236 t.push(...i), t.push(s), e?.hasFloatingFilters() && t.push(TN(this.beans)); 41237 let n = 0; 41238 for (let r = 0; r < this.rowIndex; r++) 41239 n += t[r]; 41240 const o = t[this.rowIndex]; 41241 return { topOffset: n, rowHeight: o }; 41242 } 41243 onVirtualColumnsChanged(e = !1) { 41244 const t = this.getHeaderCtrls(), i = this.isEnsureDomOrder || this.isPrintLayout; 41245 this.comp.setHeaderCtrls(t, i, e); 41246 } 41247 getHeaderCtrls() { 41248 const e = this.headerCellCtrls; 41249 this.headerCellCtrls = /* @__PURE__ */ new Map(); 41250 const t = this.getColumnsInViewport(); 41251 for (const s of t) 41252 this.recycleAndCreateHeaderCtrls(s, e); 41253 const i = (s) => { 41254 const { focusSvc: n, visibleCols: o } = this.beans; 41255 return n.isHeaderWrapperFocused(s) ? o.isVisible(s.column) : !1; 41256 }; 41257 if (e) 41258 for (const [s, n] of e) 41259 i(n) ? this.headerCellCtrls.set(s, n) : this.destroyBean(n); 41260 return this.getHeaderCellCtrls(); 41261 } 41262 getHeaderCellCtrls() { 41263 return Array.from(this.headerCellCtrls?.values() ?? []); 41264 } 41265 recycleAndCreateHeaderCtrls(e, t) { 41266 if (!this.headerCellCtrls || e.isEmptyGroup()) 41267 return; 41268 const i = e.getUniqueId(); 41269 let s; 41270 if (t && (s = t.get(i), t.delete(i)), s && s.column != e && (this.destroyBean(s), s = void 0), s == null) 41271 switch (this.type) { 41272 case "filter": { 41273 s = this.createBean( 41274 this.beans.registry.createDynamicBean( 41275 "headerFilterCellCtrl", 41276 !0, 41277 e, 41278 this 41279 ) 41280 ); 41281 break; 41282 } 41283 case "group": 41284 s = this.createBean( 41285 this.beans.registry.createDynamicBean( 41286 "headerGroupCellCtrl", 41287 !0, 41288 e, 41289 this 41290 ) 41291 ); 41292 break; 41293 default: 41294 s = this.createBean(new pte(e, this)); 41295 break; 41296 } 41297 this.headerCellCtrls.set(i, s); 41298 } 41299 getColumnsInViewport() { 41300 return this.isPrintLayout ? this.getColumnsInViewportPrintLayout() : this.getColumnsInViewportNormalLayout(); 41301 } 41302 getColumnsInViewportPrintLayout() { 41303 if (this.pinned != null) 41304 return []; 41305 let e = []; 41306 const t = this.getActualDepth(), { colViewport: i } = this.beans; 41307 return ["left", null, "right"].forEach((s) => { 41308 const n = i.getHeadersToRender(s, t); 41309 e = e.concat(n); 41310 }), e; 41311 } 41312 getActualDepth() { 41313 return this.type == "filter" ? this.rowIndex - 1 : this.rowIndex; 41314 } 41315 getColumnsInViewportNormalLayout() { 41316 return this.beans.colViewport.getHeadersToRender(this.pinned, this.getActualDepth()); 41317 } 41318 findHeaderCellCtrl(e) { 41319 if (!this.headerCellCtrls) 41320 return; 41321 const t = this.getHeaderCellCtrls(); 41322 let i; 41323 return typeof e == "function" ? i = t.find(e) : i = t.find((s) => s.column == e), i; 41324 } 41325 focusHeader(e, t) { 41326 const i = this.findHeaderCellCtrl(e); 41327 return i ? i.focus(t) : !1; 41328 } 41329 destroy() { 41330 this.headerCellCtrls?.forEach((e) => { 41331 this.destroyBean(e); 41332 }), this.headerCellCtrls = void 0, super.destroy(); 41333 } 41334}, fte = class extends he {
41335 constructor(e) { 41336 super(), this.pinned = e, this.hidden = !1, this.includeFloatingFilter = !1, this.groupsRowCtrls = []; 41337 } 41338 setComp(e, t) { 41339 this.comp = e, this.eViewport = t; 41340 const { pinnedCols: i, ctrlsSvc: s, colModel: n, colMoves: o, filterManager: r } = this.beans; 41341 this.setupCenterWidth(), i?.setupHeaderPinnedWidth(this), this.setupDragAndDrop(o, this.eViewport); 41342 const a = this.onDisplayedColumnsChanged.bind(this, r); 41343 this.addManagedEventListeners({ 41344 gridColumnsChanged: this.onGridColumnsChanged.bind(this), 41345 displayedColumnsChanged: a, 41346 advancedFilterEnabledChanged: a 41347 }); 41348 const l = `${typeof this.pinned == "string" ? this.pinned : "center"}Header`; 41349 s.register(l, this), n.ready && this.refresh(); 41350 } 41351 getAllCtrls() { 41352 const e = [...this.groupsRowCtrls]; 41353 return this.columnsRowCtrl && e.push(this.columnsRowCtrl), this.filtersRowCtrl && e.push(this.filtersRowCtrl), e; 41354 } 41355 refresh(e = !1) { 41356 const { focusSvc: t, colModel: i, filterManager: s } = this.beans; 41357 let n = 0; 41358 const o = t.getFocusHeaderToUseAfterRefresh(), r = () => { 41359 const u = ste(i) - 1; 41360 this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls); 41361 for (let d = 0; d < u; d++) { 41362 const p = this.createBean(new A0(n++, this.pinned, "group")); 41363 this.groupsRowCtrls.push(p); 41364 } 41365 }, a = () => { 41366 const u = n++, d = !this.hidden && (this.columnsRowCtrl == null || !e || this.columnsRowCtrl.rowIndex !== u); 41367 (d || this.hidden) && (this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl)), d && (this.columnsRowCtrl = this.createBean(new A0(u, this.pinned, "column"))); 41368 }, l = () => { 41369 this.includeFloatingFilter = !!s?.hasFloatingFilters() && !this.hidden; 41370 const u = () => { 41371 this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl); 41372 }; 41373 if (!this.includeFloatingFilter) { 41374 u(); 41375 return; 41376 } 41377 const d = n++; 41378 if (this.filtersRowCtrl) { 41379 const p = this.filtersRowCtrl.rowIndex !== d; 41380 (!e || p) && u(); 41381 } 41382 this.filtersRowCtrl || (this.filtersRowCtrl = this.createBean(new A0(d, this.pinned, "filter"))); 41383 }; 41384 r(), a(), l(); 41385 const c = this.getAllCtrls(); 41386 this.comp.setCtrls(c), this.restoreFocusOnHeader(t, o); 41387 } 41388 getHeaderCtrlForColumn(e) { 41389 if (Al(e)) 41390 return this.columnsRowCtrl?.getHeaderCellCtrl(e); 41391 if (this.groupsRowCtrls.length !== 0) 41392 for (let t = 0; t < this.groupsRowCtrls.length; t++) { 41393 const i = this.groupsRowCtrls[t].getHeaderCellCtrl(e); 41394 if (i) 41395 return i; 41396 } 41397 } 41398 getHtmlElementForColumnHeader(e) { 41399 return this.getHeaderCtrlForColumn(e)?.eGui ?? null; 41400 } 41401 getRowType(e) { 41402 return this.getAllCtrls()[e]?.type; 41403 } 41404 focusHeader(e, t, i) { 41405 const n = this.getAllCtrls()[e]; 41406 return n ? n.focusHeader(t, i) : !1; 41407 } 41408 getGroupRowCount() { 41409 return this.groupsRowCtrls.length; 41410 } 41411 getGroupRowCtrlAtIndex(e) { 41412 return this.groupsRowCtrls[e]; 41413 } 41414 getRowCount() { 41415 return this.groupsRowCtrls.length + (this.columnsRowCtrl ? 1 : 0) + (this.filtersRowCtrl ? 1 : 0); 41416 } 41417 setHorizontalScroll(e) { 41418 this.comp.setViewportScrollLeft(e); 41419 } 41420 onScrollCallback(e) { 41421 this.addManagedElementListeners(this.eViewport, { scroll: e }); 41422 } 41423 destroy() { 41424 this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl), this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl), this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls), super.destroy(); 41425 } 41426 setupDragAndDrop(e, t) { 41427 const i = e?.createBodyDropTarget(this.pinned, t); 41428 i && this.createManagedBean(i); 41429 } 41430 restoreFocusOnHeader(e, t) { 41431 if (!t) 41432 return; 41433 const { column: i } = t; 41434 i.getPinned() == this.pinned && e.focusHeaderPosition({ headerPosition: t }); 41435 } 41436 // grid cols have changed - this also means the number of rows in the header can have 41437 // changed. so we remove all the old rows and insert new ones for a complete refresh 41438 onGridColumnsChanged() { 41439 this.refresh(!0); 41440 } 41441 onDisplayedColumnsChanged(e) { 41442 const t = !!e?.hasFloatingFilters() && !this.hidden;
41443 this.includeFloatingFilter !== t && this.refresh(!0); 41444 } 41445 setupCenterWidth() { 41446 this.pinned == null && this.createManagedBean(new pM((e) => this.comp.setCenterWidth(`${e}px`), !0)); 41447 } 41448}, mte = class extends he { 41449 constructor() { 41450 super(...arguments), this.beanName = "menuSvc"; 41451 } 41452 postConstruct() { 41453 const { enterpriseMenuFactory: e, filterMenuFactory: t } = this.beans; 41454 this.activeMenuFactory = e ?? t; 41455 } 41456 showColumnMenu(e) { 41457 this.showColumnMenuCommon(this.activeMenuFactory, e, "columnMenu"); 41458 } 41459 showFilterMenu(e) { 41460 const { enterpriseMenuFactory: t, filterMenuFactory: i } = this.beans, s = t && _n(this.gos) ? t : i; 41461 this.showColumnMenuCommon(s, e, e.containerType, !0); 41462 } 41463 showHeaderContextMenu(e, t, i) { 41464 this.activeMenuFactory?.showMenuAfterContextMenuEvent(e, t, i); 41465 } 41466 hidePopupMenu() { 41467 this.beans.contextMenuSvc?.hideActiveMenu(), this.activeMenuFactory?.hideActiveMenu(); 41468 } 41469 isColumnMenuInHeaderEnabled(e) { 41470 const { suppressHeaderMenuButton: t } = e.getColDef(); 41471 return !t && !!this.activeMenuFactory?.isMenuEnabled(e) && (_n(this.gos) || !!this.beans.enterpriseMenuFactory); 41472 } 41473 isFilterMenuInHeaderEnabled(e) { 41474 return !e.getColDef().suppressHeaderFilterButton && !!this.beans.filterManager?.isFilterAllowed(e); 41475 } 41476 isHeaderContextMenuEnabled(e) { 41477 return !(e && Al(e) ? e.getColDef() : e?.getColGroupDef())?.suppressHeaderContextMenu && this.gos.get("columnMenu") === "new"; 41478 } 41479 isHeaderMenuButtonAlwaysShowEnabled() { 41480 return this.isSuppressMenuHide(); 41481 } 41482 isHeaderMenuButtonEnabled() { 41483 const e = !this.isSuppressMenuHide(); 41484 return !(Mc() && e); 41485 } 41486 isHeaderFilterButtonEnabled(e) { 41487 return this.isFilterMenuInHeaderEnabled(e) && !_n(this.gos) && !this.isFloatingFilterButtonDisplayed(e); 41488 } 41489 isFilterMenuItemEnabled(e) { 41490 return !!this.beans.filterManager?.isFilterAllowed(e) && !_n(this.gos) && !this.isFilterMenuInHeaderEnabled(e) && !this.isFloatingFilterButtonDisplayed(e); 41491 } 41492 isFloatingFilterButtonEnabled(e) { 41493 return !e.getColDef().suppressFloatingFilterButton; 41494 } 41495 isFloatingFilterButtonDisplayed(e) { 41496 return !!e.getColDef().floatingFilter && this.isFloatingFilterButtonEnabled(e); 41497 } 41498 isSuppressMenuHide() { 41499 const e = this.gos, t = e.get("suppressMenuHide"); 41500 return _n(e) ? e.exists("suppressMenuHide") ? t : !1 : t; 41501 } 41502 showColumnMenuCommon(e, t, i, s) { 41503 const { positionBy: n } = t, o = t.column; 41504 if (n === "button") { 41505 const { buttonElement: r } = t; 41506 e?.showMenuAfterButtonClick(o, r, i, s); 41507 } else if (n === "mouse") { 41508 const { mouseEvent: r } = t; 41509 e?.showMenuAfterMouseEvent(o, r, i, s); 41510 } else if (o) { 41511 const r = this.beans, a = r.ctrlsSvc; 41512 a.getScrollFeature().ensureColumnVisible(o, "auto"), Hl(r, () => { 41513 const l = a.getHeaderRowContainerCtrl(o.getPinned())?.getHeaderCtrlForColumn(o); 41514 l && e?.showMenuAfterButtonClick( 41515 o, 41516 l.getAnchorElementForMenu(s), 41517 i, 41518 !0 41519 ); 41520 }); 41521 } 41522 } 41523}; 41524function QR(e, t, i) { 41525 e.menuVisible !== t && (e.menuVisible = t, e.dispatchColEvent("menuVisibleChanged", i)); 41526} 41527var PN = class extends Tt { 41528 constructor() { 41529 super(); 41530 } 41531}, vte = class extends PN { 41532 init() { 41533 const e = oa(this.gos.get("overlayLoadingTemplate")?.trim()); 41534 if (this.setTemplate( 41535 e ?? /* html */ 41536 '<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>' 41537 ), !e) { 41538 const t = this.getLocaleTextFunc(); 41539 setTimeout(() => { 41540 this.getGui().textContent = t("loadingOoo", "Loading..."); 41541 }); 41542 } 41543 } 41544}, yte = class extends PN { 41545 init() { 41546 const e = oa(this.gos.get("overlayNoRowsTemplate")?.trim()); 41547 if (this.setTemplate(e ?? /* html */ 41548 '<span class="ag-overlay-no-rows-center"></span>'), !e) { 41549 const t = this.getLocaleTextFunc(); 41550 setTimeout(() => { 41551 this.getGui().textContent = t("noRowsToShow", "No Rows To Show"); 41552 }); 41553 } 41554 } 41555}; 41556function Cte(e, t, i) { 41557 const s = po(e, t, i); 41558 if (s) { 41559 const { className: o } = s; 41560 if (typeof o == "string" && o.indexOf("ag-icon") > -1 || typeof o == "object" && o["ag-icon"]) 41561 return s; 41562 } 41563 const n = document.createElement("span"); 41564 return n.appendChild(s), n; 41565} 41566function po(e, t, i) { 41567 let s = null; 41568 e === "smallDown" ? Ae(262) : e === "smallLeft" ? Ae(263) : e === "smallRight" && Ae(264); 41569 const n = i && i.getColDef().icons; 41570 if (n && (s = n[e]), t.gos && !s) { 41571 const o = t.gos.get("icons"); 41572 o && (s = o[e]); 41573 } 41574 if (s) { 41575 let o; 41576 if (typeof s == "function") 41577 o = s(); 41578 else if (typeof s == "string") 41579 o = s; 41580 else { 41581 Ae(38, { iconName: e }); 41582 return; 41583 } 41584 if (typeof o == "string") 41585 return $p(o); 41586 if (tM(o)) 41587 return o; 41588 Ae(133, { iconName: e }); 41589 return; 41590 } else { 41591 const o = document.createElement("span"), r = t.registry.getIcon(e); 41592 r || t.validation?.validateIcon(e); 41593 const a = r ?? e; 41594 return o.setAttribute("class", `ag-icon ag-icon-${a}`), o.setAttribute("unselectable", "on"), en(o, "presentation"), o; 41595 } 41596} 41597var bte = ( 41598 /*css*/ 41599 ".ag-dnd-ghost{align-items:center;background-color:var(--ag-drag-and-drop-image-background-color);border:var(--ag-drag-and-drop-image-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-drag-and-drop-image-shadow);color:var(--ag-text-color);cursor:move;display:flex;font-weight:500;gap:var(--ag-cell-widget-spacing);height:var(--ag-header-height);overflow:hidden;padding-left:var(--ag-cell-horizontal-padding);padding-right:var(--ag-cell-horizontal-padding);text-overflow:ellipsis;transform:translateY(calc(var(--ag-spacing)*2));white-space:nowrap}" 41600), wte = class extends Tt { 41601 constructor() { 41602 super(), this.dragSource = null, this.eIcon = Pe, this.eLabel = Pe, this.registerCSS(bte); 41603 } 41604 postConstruct() { 41605 const e = (t) => Cte(t, this.beans, null); 41606 this.dropIconMap = { 41607 pinned: e("columnMovePin"), 41608 hide: e("columnMoveHide"), 41609 move: e("columnMoveMove"), 41610 left: e("columnMoveLeft"), 41611 right: e("columnMoveRight"), 41612 group: e("columnMoveGroup"), 41613 aggregate: e("columnMoveValue"), 41614 pivot: e("columnMovePivot"),
41615 notAllowed: e("dropNotAllowed") 41616 }; 41617 } 41618 init(e) { 41619 this.dragSource = e.dragSource, this.setTemplate( 41620 /* html */ 41621 `<div class="ag-dnd-ghost ag-unselectable"> 41622 <span data-ref="eIcon" class="ag-dnd-ghost-icon ag-shake-left-to-right"></span> 41623 <div data-ref="eLabel" class="ag-dnd-ghost-label"></div> 41624 </div>` 41625 ); 41626 } 41627 destroy() { 41628 this.dragSource = null, super.destroy(); 41629 } 41630 setIcon(e, t) { 41631 const { eIcon: i, dragSource: s, dropIconMap: n, gos: o } = this; 41632 Is(i); 41633 let r = null; 41634 e || (e = s?.getDefaultIconName ? s.getDefaultIconName() : "notAllowed"), r = n[e], i.classList.toggle("ag-shake-left-to-right", t), !(r === n.hide && o.get("suppressDragLeaveHidesColumns")) && r && i.appendChild(r); 41635 } 41636 setLabel(e) { 41637 this.eLabel.textContent = yr(e); 41638 } 41639}, Ste = ( 41640 /*css*/ 41641 ".ag-label{white-space:nowrap}:where(.ag-ltr) .ag-label{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-label-align-right) .ag-label{order:1}:where(.ag-ltr) :where(.ag-label-align-right) .ag-label{margin-left:var(--ag-spacing)}:where(.ag-rtl) :where(.ag-label-align-right) .ag-label{margin-right:var(--ag-spacing)}.ag-label-align-right>*{flex:none}.ag-label-align-top{align-items:flex-start;flex-direction:column;>*{align-self:stretch}}.ag-label-ellipsis{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-label-align-top) .ag-label{margin-bottom:calc(var(--ag-spacing)*.5)}" 41642), xte = class extends Tt { 41643 constructor(e, t, i) { 41644 super(t, i), this.labelSeparator = "", this.labelAlignment = "left", this.disabled = !1, this.label = "", this.config = e || {}, this.registerCSS(Ste); 41645 } 41646 postConstruct() { 41647 this.addCssClass("ag-labeled"), this.eLabel.classList.add("ag-label"); 41648 const { labelSeparator: e, label: t, labelWidth: i, labelAlignment: s, disabled: n } = this.config; 41649 n != null && this.setDisabled(n), e != null && this.setLabelSeparator(e), t != null && this.setLabel(t), i != null && this.setLabelWidth(i), this.setLabelAlignment(s || this.labelAlignment), this.refreshLabel(); 41650 } 41651 refreshLabel() { 41652 const { label: e, eLabel: t } = this; 41653 Is(t), typeof e == "string" ? t.innerText = e + this.labelSeparator : e && t.appendChild(e), e === "" ? (ui(t, !1), en(t, "presentation")) : (ui(t, !0), en(t, null)); 41654 } 41655 setLabelSeparator(e) { 41656 return this.labelSeparator === e ? this : (this.labelSeparator = e, this.label != null && this.refreshLabel(), this); 41657 } 41658 getLabelId() { 41659 const e = this.eLabel; 41660 return e.id = e.id || `ag-${this.getCompId()}-label`, e.id; 41661 } 41662 getLabel() { 41663 return this.label; 41664 } 41665 setLabel(e) { 41666 return this.label === e ? this : (this.label = e, this.refreshLabel(), this); 41667 } 41668 setLabelAlignment(e) { 41669 const i = this.getGui().classList; 41670 return i.toggle("ag-label-align-left", e === "left"), i.toggle("ag-label-align-right", e === "right"), i.toggle("ag-label-align-top", e === "top"), this; 41671 } 41672 setLabelEllipsis(e) { 41673 return this.eLabel.classList.toggle("ag-label-ellipsis", e), this; 41674 } 41675 setLabelWidth(e) { 41676 return this.label == null ? this : (sv(this.eLabel, e), this); 41677 } 41678 setDisabled(e) { 41679 e = !!e; 41680 const t = this.getGui(); 41681 return Wp(t, e), t.classList.toggle("ag-disabled", e), this.disabled = e, this; 41682 } 41683 isDisabled() { 41684 return !!this.disabled; 41685 } 41686}, FN = class extends xte { 41687 constructor(e, t, i, s) { 41688 super(e, t, i), this.className = s; 41689 } 41690 postConstruct() { 41691 super.postConstruct(); 41692 const { width: e, value: t, onValueChange: i } = this.config; 41693 e != null && this.setWidth(e), t != null && this.setValue(t), i != null && this.onValueChange(i), this.className && this.addCssClass(this.className), this.refreshAriaLabelledBy(); 41694 } 41695 setLabel(e) { 41696 return super.setLabel(e), this.refreshAriaLabelledBy(), this; 41697 } 41698 refreshAriaLabelledBy() { 41699 const e = this.getAriaElement(), t = this.getLabelId(), i = this.getLabel(); 41700 i == null || i == "" || wQ(e) !== null ? Nw(e, "") : Nw(e, t ?? ""); 41701 } 41702 setAriaLabel(e) { 41703 return $y(this.getAriaElement(), e), this.refreshAriaLabelledBy(), this; 41704 } 41705 onValueChange(e) { 41706 return this.addManagedListeners(this, { fieldValueChanged: () => e(this.getValue()) }), this; 41707 } 41708 getWidth() { 41709 return this.getGui().clientWidth; 41710 } 41711 setWidth(e) { 41712 return mr(this.getGui(), e), this; 41713 } 41714 getPreviousValue() { 41715 return this.previousValue; 41716 } 41717 getValue() { 41718 return this.value; 41719 } 41720 setValue(e, t) { 41721 return this.value === e ? this : (this.previousValue = this.value, this.value = e, t || this.dispatchLocalEvent({ type: "fieldValueChanged" }), this); 41722 } 41723}, Cc = class extends FN { 41724 constructor(e, t, i = "text", s = "input") { 41725 super( 41726 e, 41727 e?.template ?? /* html */ 41728 ` 41729 <div role="presentation"> 41730 <div data-ref="eLabel" class="ag-input-field-label"></div> 41731 <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation"> 41732 <${s} data-ref="eInput" class="ag-input-field-input"></${s}> 41733 </div> 41734 </div>`, 41735 [], 41736 t 41737 ), this.inputType = i, this.displayFieldTag = s, this.eLabel = Pe, this.eWrapper = Pe, this.eInput = Pe; 41738 } 41739 postConstruct() { 41740 super.postConstruct(), this.setInputType(); 41741 const { eLabel: e, eWrapper: t, eInput: i, className: s } = this; 41742 e.classList.add(`${s}-label`), t.classList.add(`${s}-input-wrapper`), i.classList.add(`${s}-input`), this.addCssClass("ag-input-field"), i.id = i.id || `ag-${this.getCompId()}-input`;
41743 const { inputName: n, inputWidth: o } = this.config; 41744 n != null && this.setInputName(n), o != null && this.setInputWidth(o), this.addInputListeners(), this.activateTabIndex([i]); 41745 } 41746 addInputListeners() { 41747 this.addManagedElementListeners(this.eInput, { input: (e) => this.setValue(e.target.value) }); 41748 } 41749 setInputType() { 41750 this.displayFieldTag === "input" && this.eInput.setAttribute("type", this.inputType); 41751 } 41752 getInputElement() { 41753 return this.eInput; 41754 } 41755 setInputWidth(e) { 41756 return sv(this.eWrapper, e), this; 41757 } 41758 setInputName(e) { 41759 return this.getInputElement().setAttribute("name", e), this; 41760 } 41761 getFocusableElement() { 41762 return this.eInput; 41763 } 41764 setMaxLength(e) { 41765 const t = this.eInput; 41766 return t.maxLength = e, this; 41767 } 41768 setInputPlaceholder(e) { 41769 return vo(this.eInput, "placeholder", e), this; 41770 } 41771 setInputAriaLabel(e) { 41772 return $y(this.eInput, e), this.refreshAriaLabelledBy(), this; 41773 } 41774 setDisabled(e) { 41775 return Wp(this.eInput, e), super.setDisabled(e); 41776 } 41777 setAutoComplete(e) { 41778 if (e === !0) 41779 vo(this.eInput, "autocomplete", null); 41780 else { 41781 const t = typeof e == "string" ? e : "off"; 41782 vo(this.eInput, "autocomplete", t); 41783 } 41784 return this; 41785 } 41786}, bM = class extends Cc { 41787 constructor(e, t = "ag-checkbox", i = "checkbox") { 41788 super(e, t, i), this.labelAlignment = "right", this.selected = !1, this.readOnly = !1, this.passive = !1; 41789 } 41790 postConstruct() { 41791 super.postConstruct(); 41792 const { readOnly: e, passive: t } = this.config; 41793 typeof e == "boolean" && this.setReadOnly(e), typeof t == "boolean" && this.setPassive(t); 41794 } 41795 addInputListeners() { 41796 this.addManagedElementListeners(this.eInput, { click: this.onCheckboxClick.bind(this) }), this.addManagedElementListeners(this.eLabel, { click: this.toggle.bind(this) }); 41797 } 41798 getNextValue() { 41799 return this.selected === void 0 ? !0 : !this.selected; 41800 } 41801 setPassive(e) { 41802 this.passive = e; 41803 } 41804 isReadOnly() { 41805 return this.readOnly; 41806 } 41807 setReadOnly(e) { 41808 this.eWrapper.classList.toggle("ag-disabled", e), this.eInput.disabled = e, this.readOnly = e; 41809 } 41810 setDisabled(e) { 41811 return this.eWrapper.classList.toggle("ag-disabled", e), super.setDisabled(e); 41812 } 41813 toggle() { 41814 if (this.eInput.disabled) 41815 return; 41816 const e = this.isSelected(), t = this.getNextValue(); 41817 this.passive ? this.dispatchChange(t, e) : this.setValue(t); 41818 } 41819 getValue() { 41820 return this.isSelected(); 41821 } 41822 setValue(e, t) { 41823 return this.refreshSelectedClass(e), this.setSelected(e, t), this; 41824 } 41825 setName(e) { 41826 const t = this.getInputElement(); 41827 return t.name = e, this; 41828 } 41829 isSelected() { 41830 return this.selected; 41831 } 41832 setSelected(e, t) { 41833 if (this.isSelected() === e) 41834 return; 41835 this.previousValue = this.isSelected(), e = this.selected = typeof e == "boolean" ? e : void 0; 41836 const i = this.eInput; 41837 i.checked = e, i.indeterminate = e === void 0, t || this.dispatchChange(this.selected, this.previousValue); 41838 } 41839 dispatchChange(e, t, i) { 41840 this.dispatchLocalEvent({ type: "fieldValueChanged", selected: e, previousValue: t, event: i }); 41841 const s = this.getInputElement(); 41842 this.eventSvc.dispatchEvent({ 41843 type: "checkboxChanged", 41844 id: s.id, 41845 name: s.name, 41846 selected: e, 41847 previousValue: t 41848 }); 41849 } 41850 onCheckboxClick(e) { 41851 if (this.passive || this.eInput.disabled) 41852 return; 41853 const t = this.isSelected(), i = this.selected = e.target.checked; 41854 this.refreshSelectedClass(i), this.dispatchChange(i, t, e); 41855 } 41856 refreshSelectedClass(e) { 41857 const t = this.eWrapper.classList; 41858 t.toggle("ag-checked", e === !0), t.toggle("ag-indeterminate", e == null); 41859 } 41860}, wM = { 41861 selector: "AG-CHECKBOX", 41862 component: bM 41863}, Mte = ( 41864 /*css*/ 41865 ".ag-checkbox-cell{height:100%}" 41866), Ate = class extends Tt { 41867 constructor() { 41868 super( 41869 /* html*/ 41870 ` 41871 <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation"> 41872 <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox> 41873 </div>`, 41874 [wM] 41875 ), this.eCheckbox = Pe, this.registerCSS(Mte); 41876 } 41877 init(e) { 41878 this.refresh(e); 41879 const { eCheckbox: t, beans: i } = this, s = t.getInputElement(); 41880 s.setAttribute("tabindex", "-1"), cO(s, "polite"), this.addManagedListeners(s, { 41881 click: (n) => { 41882 if (Dd(n), t.isDisabled()) 41883 return; 41884 const o = t.getValue(); 41885 this.onCheckboxChanged(o); 41886 }, 41887 dblclick: (n) => { 41888 Dd(n); 41889 } 41890 }), this.addManagedElementListeners(e.eGridCell, { 41891 keydown: (n) => { 41892 if (n.key === de.SPACE && !t.isDisabled()) {
41893 e.eGridCell === gi(i) && t.toggle(); 41894 const o = t.getValue(); 41895 this.onCheckboxChanged(o), n.preventDefault(); 41896 } 41897 } 41898 }); 41899 } 41900 refresh(e) { 41901 return this.params = e, this.updateCheckbox(e), !0; 41902 } 41903 updateCheckbox(e) { 41904 let t, i = !0; 41905 const { value: s, column: n, node: o } = e; 41906 if (o.group && n) 41907 if (typeof s == "boolean") 41908 t = s; 41909 else { 41910 const d = n.getColId(); 41911 d.startsWith(Ky) ? t = s == null || s === "" ? void 0 : s === "true" : o.aggData && o.aggData[d] !== void 0 ? t = s ?? void 0 : i = !1; 41912 } 41913 else 41914 t = s ?? void 0; 41915 const { eCheckbox: r } = this; 41916 if (!i) { 41917 r.setDisplayed(!1); 41918 return; 41919 } 41920 r.setValue(t); 41921 const a = e.disabled ?? !n?.isCellEditable(o); 41922 r.setDisabled(a); 41923 const l = this.getLocaleTextFunc(), c = Q1(l, t), u = a ? c : `${l("ariaToggleCellValue", "Press SPACE to toggle cell value")} (${c})`; 41924 r.setInputAriaLabel(u); 41925 } 41926 onCheckboxChanged(e) { 41927 const { eventSvc: t, params: i } = this, { column: s, node: n, value: o } = i, r = { 41928 column: s, 41929 colDef: s.getColDef(), 41930 data: n.data, 41931 node: n, 41932 rowIndex: n.rowIndex, 41933 rowPinned: n.rowPinned, 41934 value: o 41935 }; 41936 t.dispatchEvent({ 41937 type: "cellEditingStarted", 41938 ...r 41939 }); 41940 const a = n.setDataValue(s, e, "edit"); 41941 t.dispatchEvent({ 41942 type: "cellEditingStopped", 41943 ...r, 41944 oldValue: o, 41945 newValue: e, 41946 valueChanged: a 41947 }), a || this.updateCheckbox(i); 41948 } 41949}, Dte = "ROOT_NODE_ID", Ete = class extends he { 41950 constructor() { 41951 super(...arguments), this.nextId = 0, this.allNodesMap = {}, this.rootNode = null; 41952 } 41953 get treeData() { 41954 return !1; 41955 } 41956 getRowNode(e) { 41957 return this.allNodesMap[e]; 41958 } 41959 extractRowData() { 41960 return this.rootNode?.allLeafChildren?.map((e) => e.data); 41961 } 41962 activate(e) { 41963 this.rootNode = e, e.group = !0, e.level = -1, e.id = Dte, e.allLeafChildren = [], e.childrenAfterGroup = [], e.childrenAfterSort = [], e.childrenAfterAggFilter = [], e.childrenAfterFilter = [], this.updateRootSiblingArrays(e); 41964 } 41965 deactivate() { 41966 this.rootNode && (this.allNodesMap = {}, this.rootNode = null); 41967 } 41968 destroy() { 41969 super.destroy(), this.allNodesMap = {}, this.rootNode = null; 41970 } 41971 setNewRowData(e) { 41972 const t = this.rootNode; 41973 t && (this.dispatchRowDataUpdateStartedEvent(e), t.childrenAfterFilter = null, t.childrenAfterGroup = null, t.childrenAfterAggFilter = null, t.childrenAfterSort = null, t.childrenMapped = null, t.updateHasChildren(), this.allNodesMap = {}, this.nextId = 0, this.loadNewRowData(e), this.updateRootSiblingArrays(t)); 41974 } 41975 updateRootSiblingArrays(e) { 41976 const t = e.sibling; 41977 t && (t.childrenAfterFilter = e.childrenAfterFilter, t.childrenAfterGroup = e.childrenAfterGroup, t.childrenAfterAggFilter = e.childrenAfterAggFilter, t.childrenAfterSort = e.childrenAfterSort, t.childrenMapped = e.childrenMapped, t.allLeafChildren = e.allLeafChildren); 41978 } 41979 loadNewRowData(e) { 41980 this.rootNode.allLeafChildren = e?.map((t, i) => this.createRowNode(t, i)) ?? []; 41981 } 41982 setImmutableRowData(e, t) { 41983 const i = this.createTransactionForRowData(t), s = this.updateRowData(i, e.changedRowNodes); 41984 let n = !1; 41985 this.gos.get("suppressMaintainUnsortedOrder") || (n = this.updateRowOrderFromRowData(t)); 41986 const { rowNodeTransaction: o, rowsInserted: r } = s, { add: a, remove: l, update: c } = o; 41987 (r || n || a.length || l.length || c.length) && (e.step = "group", e.rowDataUpdated = !0, e.rowNodeTransactions = [o], e.rowNodesOrderChanged = r || n); 41988 } 41989 updateRowData(e, t) { 41990 this.dispatchRowDataUpdateStartedEvent(e.add); 41991 const i = { 41992 changedRowNodes: t, 41993 rowNodeTransaction: { remove: [], update: [], add: [] }, 41994 rowsInserted: !1 41995 }, s = [], n = Ad(this.gos); 41996 return this.executeRemove(n, e, i, s), this.executeUpdate(n, e, i, s), this.executeAdd(e, i), this.deselectNodes(s), i; 41997 } 41998 /** Converts the setRowData() command to a transaction */ 41999 createTransactionForRowData(e) { 42000 const t = Ad(this.gos), i = { ...this.allNodesMap }, s = [], n = [], o = []; 42001 Ie(e) && e.forEach((r) => { 42002 const a = t({ data: r, level: 0 }), l = i[a]; 42003 l ? (l.data !== r && n.push(r), i[a] = void 0) : o.push(r); 42004 }); 42005 for (const r of Object.values(i)) 42006 r && s.push(r.data); 42007 return { remove: s, update: n, add: o }; 42008 } 42009 /** 42010 * Used by setImmutableRowData, after updateRowData, after updating with a generated transaction to 42011 * apply the order as specified by the the new data. We use sourceRowIndex to determine the order of the rows. 42012 * Time complexity is O(n) where n is the number of rows/rowData
42013 * @returns true if the order changed, otherwise false 42014 */ 42015 updateRowOrderFromRowData(e) { 42016 const t = this.rootNode?.allLeafChildren, i = t?.length ?? 0, s = /* @__PURE__ */ new Map(); 42017 let n = -1, o = -1; 42018 for (let r = 0; r < i; ++r) { 42019 const a = t[r], l = a.data; 42020 l !== e[r] && (o < 0 && (n = r), o = r, s.set(l, a)); 42021 } 42022 if (n < 0) 42023 return !1; 42024 for (let r = n; r <= o; ++r) { 42025 const a = s.get(e[r]); 42026 a !== void 0 && (t[r] = a, a.sourceRowIndex = r); 42027 } 42028 return !0; 42029 } 42030 executeAdd(e, t) { 42031 const i = e.add; 42032 if (!i?.length) 42033 return; 42034 let s = this.rootNode.allLeafChildren, n = s.length; 42035 if (typeof e.addIndex == "number" && (n = this.sanitizeAddIndex(e.addIndex), n > 0 && this.gos.get("treeData") && this.gos.get("getDataPath"))) { 42036 for (let d = 0; d < s.length; d++) 42037 if (s[d]?.rowIndex == n - 1) { 42038 n = d + 1; 42039 break; 42040 } 42041 } 42042 const o = i.length, r = t.changedRowNodes, a = new Array(o); 42043 for (let u = 0; u < o; u++) { 42044 const d = this.createRowNode(i[u], n + u); 42045 r.add(d), a[u] = d; 42046 } 42047 const l = this.rootNode; 42048 if (n < s.length) { 42049 const u = s.slice(0, n), d = s.slice(n, s.length), p = u.length + a.length; 42050 for (let f = 0, m = d.length; f < m; ++f) 42051 d[f].sourceRowIndex = p + f; 42052 s = [...u, ...a, ...d], t.rowsInserted = !0; 42053 } else 42054 s = s.concat(a); 42055 l.allLeafChildren = s; 42056 const c = l.sibling; 42057 c && (c.allLeafChildren = s), t.rowNodeTransaction.add = a; 42058 } 42059 executeRemove(e, t, { changedRowNodes: i, rowNodeTransaction: s }, n) { 42060 const { remove: o } = t; 42061 if (!o?.length) 42062 return; 42063 const r = {}; 42064 o.forEach((c) => { 42065 const u = this.lookupRowNode(e, c); 42066 u && (u.isSelected() && n.push(u), u.clearRowTopAndRowIndex(), r[u.id] = !0, delete this.allNodesMap[u.id], s.remove.push(u), i.remove(u)); 42067 }); 42068 const a = this.rootNode; 42069 a.allLeafChildren = a.allLeafChildren?.filter((c) => !r[c.id]) ?? null, a.allLeafChildren?.forEach((c, u) => { 42070 c.sourceRowIndex = u; 42071 }); 42072 const l = a.sibling; 42073 l && (l.allLeafChildren = a.allLeafChildren); 42074 } 42075 executeUpdate(e, t, { changedRowNodes: i, rowNodeTransaction: s }, n) { 42076 const { update: o } = t; 42077 o?.length && o.forEach((r) => { 42078 const a = this.lookupRowNode(e, r); 42079 a && (a.updateData(r), !a.selectable && a.isSelected() && n.push(a), s.update.push(a), i.update(a)); 42080 }); 42081 } 42082 dispatchRowDataUpdateStartedEvent(e) { 42083 this.eventSvc.dispatchEvent({ 42084 type: "rowDataUpdateStarted", 42085 firstRowData: e?.length ? e[0] : null 42086 }); 42087 } 42088 deselectNodes(e) { 42089 const t = "rowDataChanged", i = this.beans.selectionSvc, s = e.length > 0; 42090 s && i?.setNodesSelected({ 42091 newValue: !1, 42092 nodes: e, 42093 suppressFinishActions: !0, 42094 source: t 42095 }), i?.updateGroupsFromChildrenSelections?.(t), s && this.eventSvc.dispatchEvent({ 42096 type: "selectionChanged", 42097 source: t 42098 }); 42099 } 42100 sanitizeAddIndex(e) { 42101 const t = this.rootNode.allLeafChildren?.length ?? 0; 42102 return e < 0 || e >= t || Number.isNaN(e) ? t : Math.ceil(e); 42103 } 42104 createRowNode(e, t) { 42105 const i = new Rd(this.beans); 42106 return i.parent = this.rootNode, i.level = 0, i.group = !1, i.expanded = !1, i.sourceRowIndex = t, i.setDataAndId(e, String(this.nextId)), this.allNodesMap[i.id] && Ae(2, { nodeId: i.id }), this.allNodesMap[i.id] = i, this.nextId++, i; 42107 } 42108 lookupRowNode(e, t) { 42109 let i; 42110 if (e) { 42111 const s = e({ data: t, level: 0 }); 42112 if (i = this.allNodesMap[s], !i) 42113 return Rt(4, { id: s }), null; 42114 } else if (i = this.rootNode?.allLeafChildren?.find((s) => s.data === t), !i) 42115 return Rt(5, { data: t }), null; 42116 return i || null; 42117 } 42118}, Ite = class extends Tt { 42119 constructor() { 42120 super( 42121 /* html*/ 42122 ` 42123 <div class="ag-selection-checkbox" role="presentation"> 42124 <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox> 42125 </div>`, 42126 [wM] 42127 ), this.eCheckbox = Pe; 42128 } 42129 postConstruct() { 42130 this.eCheckbox.setPassive(!0); 42131 } 42132 getCheckboxId() { 42133 return this.eCheckbox.getInputElement().id; 42134 } 42135 onDataChanged() { 42136 this.onSelectionChanged(); 42137 } 42138 onSelectableChanged() { 42139 this.showOrHideSelect(); 42140 } 42141 onSelectionChanged() { 42142 const e = this.getLocaleTextFunc(), { rowNode: t, eCheckbox: i } = this, s = t.isSelected(), n = Q1(e, s), [o, r] = t.selectable ? ["ariaRowToggleSelection", "Press Space to toggle row selection"] : ["ariaRowSelectionDisabled", "Row Selection is disabled for this row"], a = e(o, r); 42143 i.setValue(s, !0), i.setInputAriaLabel(`${a} (${n})`); 42144 } 42145 init(e) { 42146 if (this.rowNode = e.rowNode, this.column = e.column, this.overrides = e.overrides, this.onSelectionChanged(), this.addManagedListeners(this.eCheckbox.getInputElement(), { 42147 // we don't want double click on this icon to open a group 42148 dblclick: Dd, 42149 click: (s) => { 42150 Dd(s), this.beans.selectionSvc?.handleSelectionEvent(s, this.rowNode, "checkboxSelected"); 42151 } 42152 }), this.addManagedListeners(this.rowNode, { 42153 rowSelected: this.onSelectionChanged.bind(this), 42154 dataChanged: this.onDataChanged.bind(this), 42155 selectableChanged: this.onSelectableChanged.bind(this) 42156 }), this.addManagedPropertyListener("rowSelection", ({ currentValue: s, previousValue: n }) => { 42157 const o = typeof s == "object" ? w0(s) : void 0, r = typeof n == "object" ? w0(n) : void 0; 42158 o !== r && this.onSelectableChanged(); 42159 }), Kw(this.gos) || typeof this.getIsVisible() == "function") { 42160 const s = this.showOrHideSelect.bind(this); 42161 this.addManagedEventListeners({ displayedColumnsChanged: s }), this.addManagedListeners(this.rowNode, { 42162 dataChanged: s, 42163 cellChanged: s 42164 }), this.showOrHideSelect(); 42165 } 42166 this.eCheckbox.getInputElement().setAttribute("tabindex", "-1"); 42167 } 42168 showOrHideSelect() { 42169 const { column: e, rowNode: t, overrides: i, gos: s } = this; 42170 let n = t.selectable; 42171 const o = this.getIsVisible(); 42172 if (n) 42173 if (typeof o == "function") { 42174 const l = i?.callbackParams; 42175 if (!e) 42176 n = o({ ...l, node: t, data: t.data }); 42177 else { 42178 const c = e.createColumnFunctionCallbackParams(t); 42179 n = o({ ...l, ...c }); 42180 } 42181 } else 42182 n = o ?? !1; 42183 const r = s.get("rowSelection"); 42184 if (r && typeof r != "string" ? !w0(r) : e?.getColDef().showDisabledCheckboxes) { 42185 this.eCheckbox.setDisabled(!n), this.setVisible(!0), this.setDisplayed(!0); 42186 return; 42187 } 42188 if (i?.removeHidden) { 42189 this.setDisplayed(n); 42190 return; 42191 } 42192 this.setVisible(n); 42193 } 42194 getIsVisible() { 42195 const e = this.overrides; 42196 if (e) 42197 return e.isVisible; 42198 const t = this.gos.get("rowSelection"); 42199 return t && typeof t != "string" ? ld(t) : this.column?.getColDef()?.checkboxSelection; 42200 } 42201}, Rte = class { 42202 constructor(e) { 42203 this.rootId = null, this.endId = null, this.cachedRange = [], this.rowModel = e; 42204 } 42205 reset() { 42206 this.rootId = null, this.endId = null, this.cachedRange.length = 0; 42207 } 42208 setRoot(e) { 42209 this.rootId = e.id, this.endId = null, this.cachedRange.length = 0; 42210 } 42211 setEndRange(e) { 42212 this.endId = e.id, this.cachedRange.length = 0; 42213 } 42214 getRange() { 42215 if (this.cachedRange.length === 0) { 42216 const e = this.getRoot(), t = this.getEnd(); 42217 if (e == null || t == null) 42218 return this.cachedRange; 42219 this.cachedRange = this.rowModel.getNodesInRangeForSelection(e, t) ?? []; 42220 } 42221 return this.cachedRange; 42222 } 42223 isInRange(e) { 42224 return this.rootId === null ? !1 : this.getRange().some((t) => t.id === e.id); 42225 } 42226 getRoot() { 42227 return this.rootId ? this.rowModel.getRowNode(this.rootId) ?? null : null; 42228 } 42229 getEnd() { 42230 return this.endId ? this.rowModel.getRowNode(this.endId) ?? null : null; 42231 } 42232 /** 42233 * Truncates the range to the given node (assumed to be within the current range). 42234 * Returns nodes that remain in the current range and those that should be removed 42235 * 42236 * @param node - Node at which to truncate the range 42237 * @returns Object of nodes to either keep or discard (i.e. deselect) from the range 42238 */ 42239 truncate(e) { 42240 const t = this.getRange(); 42241 if (t.length === 0) 42242 return { keep: [], discard: [] }; 42243 const i = t[0].id === this.rootId, s = t.findIndex((n) => n.id === e.id); 42244 if (s > -1) { 42245 const n = t.slice(0, s), o = t.slice(s + 1); 42246 return this.setEndRange(e), i ? { keep: n, discard: o } : { keep: o, discard: n }; 42247 } else 42248 return { keep: t, discard: [] }; 42249 } 42250 /** 42251 * Extends the range to the given node. Returns nodes that remain in the current range 42252 * and those that should be removed. 42253 * 42254 * @param node - Node marking the new end of the range 42255 * @returns Object of nodes to either keep or discard (i.e. deselect) from the range 42256 */ 42257 extend(e, t = !1) { 42258 const i = this.getRoot(); 42259 if (i == null) { 42260 const n = this.getRange().slice(); 42261 return t && e.depthFirstSearch((o) => !o.group && n.push(o)), n.push(e), this.setRoot(e), { keep: n, discard: [] }; 42262 } 42263 const s = this.rowModel.getNodesInRangeForSelection(i, e); 42264 if (!s) 42265 return this.setRoot(e), { keep: [e], discard: [] }; 42266 if (s.find((n) => n.id === this.endId)) 42267 return this.setEndRange(e), { keep: this.getRange(), discard: [] }; 42268 { 42269 const n = this.getRange().slice(); 42270 return this.setEndRange(e), { keep: this.getRange(), discard: n }; 42271 } 42272 } 42273}, Tte = class extends he {
42274 constructor(e) { 42275 super(), this.column = e, this.cbSelectAllVisible = !1, this.processingEventFromCheckbox = !1; 42276 } 42277 onSpaceKeyDown(e) { 42278 const t = this.cbSelectAll; 42279 t.isDisplayed() && !t.getGui().contains(gi(this.beans)) && (e.preventDefault(), t.setValue(!t.getValue())); 42280 } 42281 getCheckboxGui() { 42282 return this.cbSelectAll.getGui(); 42283 } 42284 setComp(e) { 42285 this.headerCellCtrl = e; 42286 const t = this.createManagedBean(new bM()); 42287 this.cbSelectAll = t, t.addCssClass("ag-header-select-all"), en(t.getGui(), "presentation"), this.showOrHideSelectAll(), this.addManagedEventListeners({ 42288 newColumnsLoaded: this.showOrHideSelectAll.bind(this), 42289 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), 42290 selectionChanged: this.onSelectionChanged.bind(this), 42291 paginationChanged: this.onSelectionChanged.bind(this), 42292 modelUpdated: this.onModelChanged.bind(this) 42293 }), this.addManagedListeners(t, { fieldValueChanged: this.onCbSelectAll.bind(this) }), t.getInputElement().setAttribute("tabindex", "-1"), this.refreshSelectAllLabel(); 42294 } 42295 onDisplayedColumnsChanged() { 42296 this.isAlive() && this.showOrHideSelectAll(); 42297 } 42298 showOrHideSelectAll() { 42299 const e = this.isCheckboxSelection(); 42300 this.cbSelectAllVisible = e, this.cbSelectAll.setDisplayed(e), e && (this.checkRightRowModelType("selectAllCheckbox"), this.checkSelectionType("selectAllCheckbox"), this.updateStateOfCheckbox()), this.refreshSelectAllLabel(); 42301 } 42302 onModelChanged() { 42303 this.cbSelectAllVisible && this.updateStateOfCheckbox(); 42304 } 42305 onSelectionChanged() { 42306 this.cbSelectAllVisible && this.updateStateOfCheckbox(); 42307 } 42308 updateStateOfCheckbox() { 42309 if (this.processingEventFromCheckbox) 42310 return; 42311 this.processingEventFromCheckbox = !0; 42312 const e = this.getSelectAllMode(), t = this.beans.selectionSvc, i = this.cbSelectAll, s = t.getSelectAllState(e); 42313 i.setValue(s); 42314 const n = t.hasNodesToSelect(e); 42315 i.setDisabled(!n), this.refreshSelectAllLabel(), this.processingEventFromCheckbox = !1; 42316 } 42317 refreshSelectAllLabel() { 42318 const e = this.getLocaleTextFunc(), { headerCellCtrl: t, cbSelectAll: i, cbSelectAllVisible: s } = this, o = i.getValue() ? e("ariaChecked", "checked") : e("ariaUnchecked", "unchecked"), r = e("ariaRowSelectAll", "Press Space to toggle all rows selection"); 42319 t.setAriaDescriptionProperty( 42320 "selectAll", 42321 s ? `${r} (${o})` : null 42322 ), i.setInputAriaLabel(e("ariaHeaderSelection", "Column with Header Selection")), t.announceAriaDescription(); 42323 } 42324 checkSelectionType(e) { 42325 return Yy(this.gos) ? !0 : (Ae(128, { feature: e }), !1); 42326 } 42327 checkRightRowModelType(e) { 42328 const { gos: t, rowModel: i } = this.beans; 42329 return $s(t) || Ag(t) ? !0 : (Ae(129, { feature: e, rowModel: i.getType() }), !1); 42330 } 42331 onCbSelectAll() { 42332 if (this.processingEventFromCheckbox || !this.cbSelectAllVisible) 42333 return; 42334 const e = this.cbSelectAll.getValue(), t = this.getSelectAllMode(); 42335 let i = "uiSelectAll"; 42336 t === "currentPage" ? i = "uiSelectAllCurrentPage" : t === "filtered" && (i = "uiSelectAllFiltered"); 42337 const s = { source: i, selectAll: t }, n = this.beans.selectionSvc; 42338 e ? n.selectAllRowNodes(s) : n.deselectAllRowNodes(s); 42339 } 42340 /** 42341 * Checkbox is enabled when either the `headerCheckbox` option is enabled in the new selection API 42342 * or `headerCheckboxSelection` is enabled in the legacy API. 42343 */ 42344 isCheckboxSelection() { 42345 const { column: e, gos: t, beans: i } = this, s = t.get("rowSelection"), n = e.getColDef(), { headerCheckboxSelection: o } = n; 42346 let r = !1; 42347 const a = typeof s == "object"; 42348 if (a) { 42349 const c = vr(e), u = aM(e); 42350 (Yw(s) === "autoGroupColumn" && u || c && i.selectionColSvc?.isSelectionColumnEnabled()) && (r = mm(s)); 42351 } else 42352 typeof o == "function" ? r = o(t.addGridCommonParams({ column: e, colDef: n })) : r = !!o; 42353 const l = a ? "headerCheckbox" : "headerCheckboxSelection"; 42354 return r && this.checkRightRowModelType(l) && this.checkSelectionType(l); 42355 } 42356 getSelectAllMode() { 42357 const e = BO(this.gos, !1); 42358 if (e) 42359 return e; 42360 const { headerCheckboxSelectionCurrentPageOnly: t, headerCheckboxSelectionFilteredOnly: i } = this.column.getColDef();
42361 return t ? "currentPage" : i ? "filtered" : "all"; 42362 } 42363}, Lte = class extends he { 42364 postConstruct() { 42365 const { gos: e, beans: t } = this; 42366 this.selectionCtx = new Rte(t.rowModel), this.addManagedPropertyListeners(["isRowSelectable", "rowSelection"], () => { 42367 const i = Kw(e); 42368 i !== this.isRowSelectable && (this.isRowSelectable = i, this.updateSelectable()); 42369 }), this.isRowSelectable = Kw(e); 42370 } 42371 destroy() { 42372 super.destroy(), this.selectionCtx.reset(); 42373 } 42374 createCheckboxSelectionComponent() { 42375 return new Ite(); 42376 } 42377 createSelectAllFeature(e) { 42378 return new Tte(e); 42379 } 42380 isMultiSelect() { 42381 return Yy(this.gos); 42382 } 42383 onRowCtrlSelected(e, t, i) { 42384 const s = !!e.rowNode.isSelected(); 42385 e.forEachGui(i, (n) => { 42386 n.rowComp.addOrRemoveCssClass("ag-row-selected", s); 42387 const o = n.element; 42388 Bw(o, s), o.contains(gi(this.beans)) && t(n); 42389 }); 42390 } 42391 announceAriaRowSelection(e) { 42392 if (this.isRowSelectionBlocked(e)) 42393 return; 42394 const t = e.isSelected(); 42395 if (t && !HR(this.gos)) 42396 return; 42397 const s = this.getLocaleTextFunc()( 42398 t ? "ariaRowDeselect" : "ariaRowSelect", 42399 `Press SPACE to ${t ? "deselect" : "select"} this row` 42400 ); 42401 this.beans.ariaAnnounce?.announceValue(s, "rowSelection"); 42402 } 42403 dispatchSelectionChanged(e) { 42404 this.eventSvc.dispatchEvent({ 42405 type: "selectionChanged", 42406 source: e 42407 }); 42408 } 42409 isRowSelectionBlocked(e) { 42410 return !e.selectable || !!e.rowPinned || !Dc(this.gos); 42411 } 42412 updateRowSelectable(e, t) { 42413 const i = this.isRowSelectable?.(e) ?? !0; 42414 return this.setRowSelectable(e, i, t), i; 42415 } 42416 setRowSelectable(e, t, i) { 42417 if (e.selectable !== t) { 42418 if (e.selectable = t, e.dispatchRowEvent("selectableChanged"), i) 42419 return; 42420 if (Zp(this.gos)) { 42421 const n = this.calculateSelectedFromChildren(e); 42422 this.setNodesSelected({ nodes: [e], newValue: n ?? !1, source: "selectableChanged" }); 42423 return; 42424 } 42425 e.isSelected() && !e.selectable && this.setNodesSelected({ nodes: [e], newValue: !1, source: "selectableChanged" }); 42426 } 42427 } 42428 calculateSelectedFromChildren(e) { 42429 let t = !1, i = !1; 42430 if (!e.childrenAfterGroup?.length) 42431 return e.selectable ? e.__selected : null; 42432 for (let s = 0; s < e.childrenAfterGroup.length; s++) { 42433 const n = e.childrenAfterGroup[s]; 42434 let o = n.isSelected(); 42435 if (!n.selectable) { 42436 const r = this.calculateSelectedFromChildren(n); 42437 if (r === null) 42438 continue; 42439 o = r; 42440 } 42441 switch (o) { 42442 case !0: 42443 t = !0; 42444 break; 42445 case !1: 42446 i = !0; 42447 break; 42448 default: 42449 return; 42450 } 42451 } 42452 if (!(t && i)) 42453 return t ? !0 : i ? !1 : e.selectable ? e.__selected : null; 42454 } 42455 selectRowNode(e, t, i, s = "api") { 42456 const n = !e.selectable && t, o = e.__selected === t; 42457 if (n || o) 42458 return !1; 42459 e.__selected = t, e.dispatchRowEvent("rowSelected"); 42460 const r = e.sibling; 42461 return r && r.footer && r.__localEventService && r.dispatchRowEvent("rowSelected"), this.eventSvc.dispatchEvent({ 42462 ...bee(e, this.gos, "rowSelected"), 42463 event: i || null, 42464 source: s 42465 }), !0; 42466 } 42467 isCellCheckboxSelection(e, t) { 42468 const i = this.gos.get("rowSelection"); 42469 if (i && typeof i != "string") { 42470 const s = vr(e) && ld(i); 42471 return e.isColumnFunc(t, s); 42472 } else 42473 return e.isColumnFunc(t, e.colDef.checkboxSelection); 42474 } 42475 inferNodeSelections(e, t, i, s) {
42476 const { gos: n, selectionCtx: o } = this, r = e.isSelected(), a = Zp(n), l = lX(n), c = HR(n), u = s === "rowClicked"; 42477 if (u && a && e.group || u && !(l || c)) 42478 return null; 42479 if (t && i && this.isMultiSelect()) { 42480 const d = o.getRoot(); 42481 if (d) 42482 if (d.isSelected()) { 42483 const p = o.isInRange(e) ? o.truncate(e) : o.extend(e, a); 42484 return { 42485 deselect: p.discard, 42486 select: p.keep, 42487 reset: !1 42488 }; 42489 } else { 42490 const p = o.extend(e, a); 42491 return { 42492 select: [], 42493 deselect: p.keep, 42494 reset: !1 42495 }; 42496 } 42497 else return null; 42498 } else if (t && this.isMultiSelect()) { 42499 const d = o.getRoot(), p = o.isInRange(e) ? o.truncate(e) : o.extend(e, a); 42500 return { 42501 select: p.keep, 42502 deselect: p.discard, 42503 reset: !!(d && !d.isSelected()) 42504 }; 42505 } else { 42506 if (i) 42507 return o.setRoot(e), u && r && !c ? null : { 42508 node: e, 42509 newValue: !r, 42510 clearSelection: !this.isMultiSelect() 42511 }; 42512 { 42513 o.setRoot(e); 42514 const d = cX(n), p = av(n) === "filteredDescendants", f = u && (!d || !l); 42515 if (p && r === void 0 && $s(n)) 42516 return { 42517 node: e, 42518 newValue: !1, 42519 clearSelection: !this.isMultiSelect() || f 42520 }; 42521 if (u) { 42522 const m = r ? !d : l; 42523 return m === r ? null : { 42524 node: e, 42525 newValue: m, 42526 clearSelection: !this.isMultiSelect() || f 42527 }; 42528 } 42529 return { 42530 node: e, 42531 newValue: !r, 42532 clearSelection: !this.isMultiSelect() || f 42533 }; 42534 } 42535 } 42536 } 42537}, kte = class extends bM { 42538 constructor(e) { 42539 super(e, "ag-radio-button", "radio"); 42540 } 42541 isSelected() { 42542 return this.eInput.checked; 42543 } 42544 toggle() { 42545 this.eInput.disabled || this.isSelected() || this.setValue(!0); 42546 } 42547 addInputListeners() { 42548 super.addInputListeners(), this.addManagedEventListeners({ checkboxChanged: this.onChange.bind(this) }); 42549 } 42550 /** 42551 * This ensures that if another radio button in the same named group is selected, we deselect this radio button. 42552 * By default the browser does this for you, but we are managing classes ourselves in order to ensure input 42553 * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected, 42554 * not deselected, so we need to use our own event. 42555 */ 42556 onChange(e) { 42557 const t = this.eInput; 42558 e.selected && e.name && t.name && t.name === e.name && e.id && t.id !== e.id && this.setValue(!1, !0); 42559 } 42560}, su = class extends Cc { 42561 constructor(e, t = "ag-text-field", i = "text") { 42562 super(e, t, i); 42563 } 42564 postConstruct() { 42565 super.postConstruct(), this.config.allowedCharPattern && this.preventDisallowedCharacters(); 42566 } 42567 setValue(e, t) { 42568 const i = this.eInput; 42569 return i.value !== e && (i.value = Ie(e) ? e : ""), super.setValue(e, t); 42570 } 42571 /** Used to set an initial value into the input without necessarily setting `this.value` or triggering events (e.g. to set an invalid value) */ 42572 setStartValue(e) { 42573 this.setValue(e, !0); 42574 } 42575 preventDisallowedCharacters() { 42576 const e = new RegExp(`[${this.config.allowedCharPattern}]`), t = (i) => { 42577 MN(i) && i.key && !e.test(i.key) && i.preventDefault(); 42578 }; 42579 this.addManagedListeners(this.eInput, { 42580 keydown: t, 42581 paste: (i) => { 42582 const s = i.clipboardData?.getData("text"); 42583 s && s.split("").some((n) => !e.test(n)) && i.preventDefault(); 42584 } 42585 }); 42586 } 42587}, Zy = { 42588 selector: "AG-INPUT-TEXT-FIELD", 42589 component: su 42590}, Pte = class extends Cc { 42591 constructor(e) { 42592 super(e, "ag-text-area", null, "textarea"); 42593 } 42594 setValue(e, t) { 42595 const i = super.setValue(e, t); 42596 return this.eInput.value = e, i; 42597 } 42598 setCols(e) { 42599 return this.eInput.cols = e, this; 42600 } 42601 setRows(e) { 42602 return this.eInput.rows = e, this; 42603 } 42604}, Fte = { 42605 selector: "AG-INPUT-TEXT-AREA", 42606 component: Pte 42607}, SM = class extends su { 42608 constructor(e) { 42609 super(e, "ag-number-field", "number"); 42610 } 42611 postConstruct() { 42612 super.postConstruct(); 42613 const e = this.eInput; 42614 this.addManagedListeners(e, { 42615 blur: () => { 42616 const o = parseFloat(e.value), r = isNaN(o) ? "" : this.normalizeValue(o.toString()); 42617 this.value !== r && this.setValue(r); 42618 }, 42619 wheel: this.onWheel.bind(this) 42620 }
42620), e.step = "any"; 42621 const { precision: t, min: i, max: s, step: n } = this.config; 42622 typeof t == "number" && this.setPrecision(t), typeof i == "number" && this.setMin(i), typeof s == "number" && this.setMax(s), typeof n == "number" && this.setStep(n); 42623 } 42624 onWheel(e) { 42625 gi(this.beans) === this.eInput && e.preventDefault(); 42626 } 42627 normalizeValue(e) { 42628 if (e === "") 42629 return ""; 42630 this.precision != null && (e = this.adjustPrecision(e)); 42631 const t = parseFloat(e), { min: i, max: s } = this; 42632 return i != null && t < i ? e = i.toString() : s != null && t > s && (e = s.toString()), e; 42633 } 42634 adjustPrecision(e, t) { 42635 const i = this.precision; 42636 if (i == null) 42637 return e; 42638 if (t) { 42639 const n = parseFloat(e).toFixed(i); 42640 return parseFloat(n).toString(); 42641 } 42642 const s = String(e).split("."); 42643 if (s.length > 1) { 42644 if (s[1].length <= i) 42645 return e; 42646 if (i > 0) 42647 return `${s[0]}.${s[1].slice(0, i)}`; 42648 } 42649 return s[0]; 42650 } 42651 setMin(e) { 42652 return this.min === e ? this : (this.min = e, vo(this.eInput, "min", e), this); 42653 } 42654 setMax(e) { 42655 return this.max === e ? this : (this.max = e, vo(this.eInput, "max", e), this); 42656 } 42657 setPrecision(e) { 42658 return this.precision = e, this; 42659 } 42660 setStep(e) { 42661 return this.step === e ? this : (this.step = e, vo(this.eInput, "step", e), this); 42662 } 42663 setValue(e, t) { 42664 return this.setValueOrInputValue( 42665 (i) => super.setValue(i, t), 42666 () => this, 42667 e 42668 ); 42669 } 42670 setStartValue(e) { 42671 return this.setValueOrInputValue( 42672 (t) => super.setValue(t, !0), 42673 (t) => { 42674 this.eInput.value = t; 42675 }, 42676 e 42677 ); 42678 } 42679 setValueOrInputValue(e, t, i) { 42680 if (Ie(i)) { 42681 let s = this.isScientificNotation(i); 42682 if (s && this.eInput.validity.valid) 42683 return e(i); 42684 if (!s) { 42685 i = this.adjustPrecision(i); 42686 const n = this.normalizeValue(i); 42687 s = i != n; 42688 } 42689 if (s) 42690 return t(i); 42691 } 42692 return e(i); 42693 } 42694 getValue() { 42695 const e = this.eInput; 42696 if (!e.validity.valid) 42697 return; 42698 const t = e.value; 42699 return this.isScientificNotation(t) ? this.adjustPrecision(t, !0) : super.getValue(); 42700 } 42701 isScientificNotation(e) { 42702 return typeof e == "string" && e.includes("e"); 42703 } 42704}, Ote = { 42705 selector: "AG-INPUT-NUMBER-FIELD", 42706 component: SM 42707}; 42708function pp(e, t) { 42709 return e.toString().padStart(t, "0"); 42710} 42711function yo(e, t = !0, i = "-") { 42712 if (!e) 42713 return null; 42714 let s = [e.getFullYear(), e.getMonth() + 1, e.getDate()].map((n) => pp(n, 2)).join(i); 42715 return t && (s += " " + [e.getHours(), e.getMinutes(), e.getSeconds()].map((n) => pp(n, 2)).join(":")), s; 42716} 42717var D0 = (e) => { 42718 if (e > 3 && e < 21) 42719 return "th"; 42720 switch (e % 10) { 42721 case 1: 42722 return "st"; 42723 case 2: 42724 return "nd"; 42725 case 3: 42726 return "rd"; 42727 } 42728 return "th"; 42729}; 42730function gp(e, t = "YYYY-MM-DD") { 42731 const i = pp(e.getFullYear(), 4), s = [ 42732 "January", 42733 "February", 42734 "March", 42735 "April", 42736 "May", 42737 "June", 42738 "July", 42739 "August", 42740 "September", 42741 "October", 42742 "November", 42743 "December" 42744 ], n = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], o = { 42745 YYYY: () => i.slice(i.length - 4, i.length), 42746 YY: () => i.slice(i.length - 2, i.length), 42747 Y: () => `${e.getFullYear()}`, 42748 MMMM: () => s[e.getMonth()], 42749 MMM: () => s[e.getMonth()].slice(0, 3), 42750 MM: () => pp(e.getMonth() + 1, 2), 42751 Mo: () => `${e.getMonth() + 1}${D0(e.getMonth() + 1)}`, 42752 M: () => `${e.getMonth() + 1}`, 42753 Do: () => `${e.getDate()}${D0(e.getDate())}`, 42754 DD: () => pp(e.getDate(), 2), 42755 D: () => `${e.getDate()}`, 42756 dddd: () => n[e.getDay()], 42757 ddd: () => n[e.getDay()].slice(0, 3), 42758 dd: () => n[e.getDay()].slice(0, 2), 42759 do: () => `${e.getDay()}${D0(e.getDay())}`, 42760 d: () => `${e.getDay()}` 42761 }, r = new RegExp(Object.keys(o).join("|"), "g"); 42762 return t.replace(r, (a) => a in o ? o[a]() : a); 42763} 42764function fn(e) { 42765 if (!e) 42766 return null; 42767 const [t, i] = e.split(" "); 42768 if (!t) 42769 return null; 42770 const s = t.split("-").map((d) => parseInt(d, 10)); 42771 if (s.filter((d) => !isNaN(d)).length !== 3) 42772 return null; 42773 const [n, o, r] = s, a = new Date(n, o - 1, r); 42774 if (a.getFullYear() !== n || a.getMonth() !== o - 1 || a.getDate() !== r) 42775 return null; 42776 if (!i || i === "00:00:00") 42777 return a; 42778 const [l, c, u] = i.split(":").map((d) => parseInt(d, 10)); 42779 return l >= 0 && l < 24 && a.setHours(l), c >= 0 && c < 60 && a.setMinutes(c), u >= 0 && u < 60 && a.setSeconds(u), a; 42780} 42781var Nte = class extends su { 42782 constructor(e) { 42783 super(e, "ag-date-field", "date"); 42784 } 42785 postConstruct() { 42786 super.postConstruct(); 42787 const e = Jc(); 42788 this.addManagedListeners(this.eInput, { 42789 wheel: this.onWheel.bind(this), 42790 mousedown: () => { 42791 this.isDisabled() || e || this.eInput.focus(); 42792 } 42793 }), this.eInput.step = "any"; 42794 } 42795 onWheel(e) { 42796 gi(this.beans) === this.eInput && e.preventDefault(); 42797 } 42798 setMin(e) { 42799 const t = e instanceof Date ? yo(e ?? null, !1) ?? void 0 : e; 42800 return this.min === t ? this : (this.min = t, vo(this.eInput, "min", t), this); 42801 } 42802 setMax(e) { 42803 const t = e instanceof Date ? yo(e ?? null, !1) ?? void 0 : e; 42804 return this.max === t ? this : (this.max = t, vo(this.eInput, "max", t), this); 42805 } 42806 setStep(e) { 42807 return this.step === e ? this : (this.step = e, vo(this.eInput, "step", e), this); 42808 } 42809 getDate() { 42810 if (this.eInput.validity.valid) 42811 return fn(this.getValue()) ?? void 0; 42812 } 42813 setDate(e, t) { 42814 this.setValue(yo(e ?? null, !1), t); 42815 } 42816}, ON = { 42817 selector: "AG-INPUT-DATE-FIELD", 42818 component: Nte 42819}, _te = 1e3, Bte = 1e3, XR = 100, JR, Yf = !1, Gte = class extends he {
42820 constructor(e, t) { 42821 super(), this.tooltipCtrl = e, this.getTooltipValue = t, this.interactionEnabled = !1, this.isInteractingWithTooltip = !1, this.state = 0, this.tooltipInstanceCount = 0, this.tooltipMouseTrack = !1; 42822 } 42823 wireBeans(e) { 42824 this.popupSvc = e.popupSvc, this.userCompFactory = e.userCompFactory; 42825 } 42826 postConstruct() { 42827 this.gos.get("tooltipInteraction") && (this.interactionEnabled = !0), this.tooltipTrigger = this.getTooltipTrigger(), this.tooltipMouseTrack = this.gos.get("tooltipMouseTrack"); 42828 const e = this.tooltipCtrl.getGui(); 42829 this.tooltipTrigger === 0 && this.addManagedListeners(e, { 42830 mouseenter: this.onMouseEnter.bind(this), 42831 mouseleave: this.onMouseLeave.bind(this) 42832 }), this.tooltipTrigger === 1 && this.addManagedListeners(e, { 42833 focusin: this.onFocusIn.bind(this), 42834 focusout: this.onFocusOut.bind(this) 42835 }), this.addManagedListeners(e, { mousemove: this.onMouseMove.bind(this) }), this.interactionEnabled || this.addManagedListeners(e, { 42836 mousedown: this.onMouseDown.bind(this), 42837 keydown: this.onKeyDown.bind(this) 42838 }); 42839 } 42840 getGridOptionsTooltipDelay(e) { 42841 const t = this.gos.get(e); 42842 return Math.max(200, t); 42843 } 42844 getTooltipDelay(e) { 42845 return e === "show" ? this.tooltipCtrl.getTooltipShowDelayOverride?.() ?? this.getGridOptionsTooltipDelay("tooltipShowDelay") : this.tooltipCtrl.getTooltipHideDelayOverride?.() ?? this.getGridOptionsTooltipDelay("tooltipHideDelay"); 42846 } 42847 destroy() { 42848 this.setToDoNothing(), super.destroy(); 42849 } 42850 getTooltipTrigger() { 42851 const e = this.gos.get("tooltipTrigger"); 42852 return !e || e === "hover" ? 0 : 1; 42853 } 42854 onMouseEnter(e) { 42855 this.interactionEnabled && this.interactiveTooltipTimeoutId && (this.unlockService(), this.startHideTimeout()), !Mc() && (Yf ? this.showTooltipTimeoutId = window.setTimeout(() => { 42856 this.prepareToShowTooltip(e); 42857 }, XR) : this.prepareToShowTooltip(e)); 42858 } 42859 onMouseMove(e) { 42860 this.lastMouseEvent && (this.lastMouseEvent = e), this.tooltipMouseTrack && this.state === 2 && this.tooltipComp && this.positionTooltip(); 42861 } 42862 onMouseDown() { 42863 this.setToDoNothing(); 42864 } 42865 onMouseLeave() { 42866 this.interactionEnabled ? this.lockService() : this.setToDoNothing(); 42867 } 42868 onFocusIn() { 42869 this.prepareToShowTooltip(); 42870 } 42871 onFocusOut(e) { 42872 const t = e.relatedTarget, i = this.tooltipCtrl.getGui(), s = this.tooltipComp?.getGui(); 42873 this.isInteractingWithTooltip || i.contains(t) || this.interactionEnabled && s?.contains(t) || this.setToDoNothing(); 42874 } 42875 onKeyDown() { 42876 this.isInteractingWithTooltip && (this.isInteractingWithTooltip = !1), this.setToDoNothing(); 42877 } 42878 prepareToShowTooltip(e) { 42879 if (this.state != 0 || Yf) 42880 return; 42881 let t = 0; 42882 e && (t = this.isLastTooltipHiddenRecently() ? 200 : this.getTooltipDelay("show")), this.lastMouseEvent = e || null, this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), t), this.state = 1; 42883 } 42884 isLastTooltipHiddenRecently() { 42885 return (/* @__PURE__ */ new Date()).getTime() - JR < _te; 42886 } 42887 setToDoNothing(e) { 42888 !e && this.state === 2 && this.hideTooltip(), this.onBodyScrollEventCallback && (this.onBodyScrollEventCallback(), this.onBodyScrollEventCallback = void 0), this.onColumnMovedEventCallback && (this.onColumnMovedEventCallback(), this.onColumnMovedEventCallback = void 0), this.onDocumentKeyDownCallback && (this.onDocumentKeyDownCallback(), this.onDocumentKeyDownCallback = void 0), this.clearTimeouts(), this.state = 0, this.lastMouseEvent = null; 42889 } 42890 showTooltip() { 42891 const e = this.getTooltipValue(), t = this.tooltipCtrl; 42892 if (!Ie(e) || t.shouldDisplayTooltip && !t.shouldDisplayTooltip()) { 42893 this.setToDoNothing(); 42894 return; 42895 } 42896 const i = t.getRowNode?.(), s = { 42897 location: t.getLocation?.() ?? "UNKNOWN", 42898 //'cell', 42899 colDef: t.getColDef?.(), 42900 column: t.getColumn?.(), 42901 rowIndex: t.getRowIndex?.(), 42902 node: i, 42903 data: i?.data, 42904 value: e, 42905 valueFormatted: t.getValueFormatted?.(), 42906 hideTooltipCallback: () => this.hideTooltip(!0), 42907 ...t.getAdditionalParams?.() ?? {} 42908 }; 42909 this.state = 2, this.tooltipInstanceCount++; 42910 const n = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount); 42911 DJ(this.userCompFactory, s)?.newAgStackInstance().then(n); 42912 } 42913 hideTooltip(e) { 42914 !e && this.isInteractingWithTooltip || (this.tooltipComp && (this.destroyTooltipComp(), JR = (/* @__PURE__ */ new Date()).getTime()), this.eventSvc.dispatchEvent({ 42915 type: "tooltipHide", 42916 parentGui: this.tooltipCtrl.getGui() 42917 }), e && (this.isInteractingWithTooltip = !1), this.setToDoNothing(!0)); 42918 } 42919 newTooltipComponentCallback(e, t) { 42920 if (this.state !== 2 || this.tooltipInstanceCount !== e) { 42921 this.destroyBean(t); 42922 return; 42923 } 42924 const s = t.getGui(); 42925 this.tooltipComp = t, s.classList.contains("ag-tooltip") || s.classList.add("ag-tooltip-custom"), this.tooltipTrigger === 0 && s.classList.add("ag-tooltip-animate"), this.interactionEnabled && s.classList.add("ag-tooltip-interactive"); 42926 const n = this.getLocaleTextFunc(), o = this.popupSvc?.addPopup({ 42927 eChild: s, 42928 ariaLabel: n("ariaLabelTooltip", "Tooltip") 42929 }); 42930 if (o && (this.tooltipPopupDestroyFunc = o.hideFunc), this.positionTooltip(), this.tooltipTrigger === 1) { 42931 const r = () => this.setToDoNothing(); 42932 [this.onBodyScrollEventCallback, this.onColumnMovedEventCallback] = this.addManagedEventListeners({ 42933 bodyScroll: r, 42934 columnMoved: r 42935 }); 42936 } 42937 this.interactionEnabled && ([this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener] = this.addManagedElementListeners(s, { 42938 mouseenter: this.onTooltipMouseEnter.bind(this), 42939 mouseleave: this.onTooltipMouseLeave.bind(this) 42940 }), [this.onDocumentKeyDownCallback] = this.addManagedElementListeners(Ei(this.beans), { 42941 keydown: (r) => { 42942 s.contains(r?.target) || this.onKeyDown(); 42943 } 42944 }), this.tooltipTrigger === 1 && ([this.tooltipFocusInListener, this.tooltipFocusOutListener] = this.addManagedElementListeners(s, { 42945 focusin: this.onTooltipFocusIn.bind(this), 42946 focusout: this.onTooltipFocusOut.bind(this) 42947 }))), this.eventSvc.dispatchEvent({ 42948 type: "tooltipShow", 42949 tooltipGui: s, 42950 parentGui: this.tooltipCtrl.getGui() 42951 }), this.startHideTimeout(); 42952 } 42953 onTooltipMouseEnter() { 42954 this.isInteractingWithTooltip = !0, this.unlockService(); 42955 } 42956 onTooltipMouseLeave() { 42957 this.isTooltipFocused() || (this.isInteractingWithTooltip = !1, this.lockService()); 42958 } 42959 onTooltipFocusIn() { 42960 this.isInteractingWithTooltip = !0; 42961 } 42962 isTooltipFocused() { 42963 const e = this.tooltipComp?.getGui(), t = gi(this.beans); 42964 return !!e && e.contains(t); 42965 } 42966 onTooltipFocusOut(e) { 42967 const t = this.tooltipCtrl.getGui(); 42968 this.isTooltipFocused() || (this.isInteractingWithTooltip = !1, t.contains(e.relatedTarget) ? this.startHideTimeout() : this.hideTooltip()); 42969 } 42970 positionTooltip() { 42971 const e = { 42972 type: "tooltip", 42973 ePopup: this.tooltipComp.getGui(), 42974 nudgeY: 18, 42975 skipObserver: this.tooltipMouseTrack 42976 }; 42977 this.lastMouseEvent ? this.popupSvc?.positionPopupUnderMouseEvent({ 42978 ...e, 42979 mouseEvent: this.lastMouseEvent 42980 }) : this.popupSvc?.positionPopupByComponent({ 42981 ...e, 42982 eventSource: this.tooltipCtrl.getGui(), 42983 position: "under", 42984 keepWithinBounds: !0, 42985 nudgeY: 5 42986 }); 42987 } 42988 destroyTooltipComp() { 42989 this.tooltipComp.getGui().classList.add("ag-tooltip-hiding"); 42990 const e = this.tooltipPopupDestroyFunc, t = this.tooltipComp, i = this.tooltipTrigger === 0 ? Bte : 0; 42991 window.setTimeout(() => { 42992 e(), this.destroyBean(t); 42993 }, i), this.clearTooltipListeners(), this.tooltipPopupDestroyFunc = void 0, this.tooltipComp = void 0; 42994 } 42995 clearTooltipListeners() { 42996 [ 42997 this.tooltipMouseEnterListener, 42998 this.tooltipMouseLeaveListener, 42999 this.tooltipFocusInListener, 43000 this.tooltipFocusOutListener 43001 ].forEach((e) => { 43002 e && e(); 43003 }), this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener = this.tooltipFocusInListener = this.tooltipFocusOutListener = null; 43004 } 43005 lockService() { 43006 Yf = !0, this.interactiveTooltipTimeoutId = window.setTimeout(() => { 43007 this.unlockService(), this.setToDoNothing(); 43008 }, XR); 43009 } 43010 unlockService() { 43011 Yf = !1, this.clearInteractiveTimeout(); 43012 } 43013 startHideTimeout() { 43014 this.clearHideTimeout(), this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay("hide")); 43015 } 43016 clearShowTimeout() { 43017 this.showTooltipTimeoutId && (window.clearTimeout(this.showTooltipTimeoutId), this.showTooltipTimeoutId = void 0); 43018 } 43019 clearHideTimeout() { 43020 this.hideTooltipTimeoutId && (window.clearTimeout(this.hideTooltipTimeoutId), this.hideTooltipTimeoutId = void 0); 43021 } 43022 clearInteractiveTimeout() { 43023 this.interactiveTooltipTimeoutId && (window.clearTimeout(this.interactiveTooltipTimeoutId), this.interactiveTooltipTimeoutId = void 0); 43024 } 43025 clearTimeouts() { 43026 this.clearShowTimeout(), this.clearHideTimeout(), this.clearInteractiveTimeout(); 43027 } 43028}; 43029function E0(e) { 43030 return e.get("tooltipShowMode") === "whenTruncated"; 43031} 43032function bm(e) { 43033 return () => { 43034 const t = e(); 43035 return t ? t.scrollWidth > t.clientWidth : !0; 43036 }; 43037} 43038var zte = class extends he {
43039 constructor(e, t) { 43040 super(), this.ctrl = e, t && (this.beans = t); 43041 } 43042 postConstruct() { 43043 this.refreshTooltip(); 43044 } 43045 setBrowserTooltip(e) { 43046 const t = "title", i = this.ctrl.getGui(); 43047 i && (e != null && e != "" ? i.setAttribute(t, e) : i.removeAttribute(t)); 43048 } 43049 updateTooltipText() { 43050 const { getTooltipValue: e } = this.ctrl; 43051 e && (this.tooltip = e()); 43052 } 43053 createTooltipFeatureIfNeeded() { 43054 this.tooltipManager == null && (this.tooltipManager = this.createBean( 43055 new Gte(this.ctrl, () => this.tooltip), 43056 this.beans.context 43057 )); 43058 } 43059 setTooltipAndRefresh(e) { 43060 this.tooltip = e, this.refreshTooltip(); 43061 } 43062 refreshTooltip() { 43063 this.browserTooltips = this.beans.gos.get("enableBrowserTooltips"), this.updateTooltipText(), this.browserTooltips ? (this.setBrowserTooltip(this.tooltip), this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context)) : (this.setBrowserTooltip(null), this.createTooltipFeatureIfNeeded()); 43064 } 43065 destroy() { 43066 this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context), super.destroy(); 43067 } 43068}, Hte = class extends Tt { 43069 constructor(e = "default", t = !1) { 43070 super( 43071 /* html */ 43072 `<div class="ag-list ag-${e}-list" role="listbox"></div>` 43073 ), this.cssIdentifier = e, this.unFocusable = t, this.activeClass = "ag-active-item", this.options = [], this.itemEls = []; 43074 } 43075 postConstruct() { 43076 const e = this.getGui(); 43077 this.addManagedElementListeners(e, { mouseleave: () => this.clearHighlighted() }), !this.unFocusable && this.addManagedElementListeners(e, { keydown: this.handleKeyDown.bind(this) }); 43078 } 43079 handleKeyDown(e) { 43080 const t = e.key; 43081 switch (t) { 43082 case de.ENTER: 43083 if (!this.highlightedEl) 43084 this.setValue(this.getValue()); 43085 else { 43086 const i = this.itemEls.indexOf(this.highlightedEl); 43087 this.setValueByIndex(i); 43088 } 43089 break; 43090 case de.DOWN: 43091 case de.UP: 43092 e.preventDefault(), this.navigate(t); 43093 break; 43094 case de.PAGE_DOWN: 43095 case de.PAGE_UP: 43096 case de.PAGE_HOME: 43097 case de.PAGE_END: 43098 e.preventDefault(), this.navigateToPage(t); 43099 break; 43100 } 43101 } 43102 navigate(e) { 43103 const t = e === de.DOWN; 43104 let i; 43105 const { itemEls: s, highlightedEl: n } = this; 43106 if (!n) 43107 i = s[t ? 0 : s.length - 1]; 43108 else { 43109 let r = s.indexOf(n) + (t ? 1 : -1); 43110 r = Math.min(Math.max(r, 0), s.length - 1), i = s[r]; 43111 } 43112 this.highlightItem(i); 43113 } 43114 navigateToPage(e) { 43115 const { itemEls: t, highlightedEl: i } = this; 43116 if (!i || t.length === 0) 43117 return; 43118 const s = t.indexOf(i), n = this.options.length - 1, o = t[0].clientHeight, r = Math.floor(this.getGui().clientHeight / o); 43119 let a = -1; 43120 e === de.PAGE_HOME ? a = 0 : e === de.PAGE_END ? a = n : e === de.PAGE_DOWN ? a = Math.min(s + r, n) : e === de.PAGE_UP && (a = Math.max(s - r, 0)), a !== -1 && this.highlightItem(t[a]); 43121 } 43122 addOptions(e) { 43123 return e.forEach((t) => this.addOption(t)), this; 43124 } 43125 addOption(e) { 43126 const { value: t, text: i } = e, s = i || t; 43127 return this.options.push({ value: t, text: s }), this.renderOption(t, s), this.updateIndices(), this; 43128 } 43129 clearOptions() { 43130 this.options = [], this.reset(!0), this.itemEls.forEach((e) => { 43131 pr(e); 43132 }), this.itemEls = []; 43133 } 43134 updateIndices() { 43135 const e = this.getGui().querySelectorAll(".ag-list-item"); 43136 e.forEach((t, i) => { 43137 DQ(t, i + 1), AQ(t, e.length); 43138 }); 43139 } 43140 renderOption(e, t) { 43141 const i = Ei(this.beans), s = i.createElement("div"); 43142 en(s, "option"), s.classList.add("ag-list-item", `ag-${this.cssIdentifier}-list-item`); 43143 const n = i.createElement("span"); 43144 s.appendChild(n), n.textContent = t, this.unFocusable || (s.tabIndex = -1), this.itemEls.push(s), this.addManagedListeners(s, { 43145 mouseover: () => this.highlightItem(s), 43146 mousedown: (o) => { 43147 o.preventDefault(), o.stopPropagation(), this.setValue(e); 43148 } 43149 }), this.createOptionalManagedBean( 43150 this.beans.registry.createDynamicBean("tooltipFeature", !1, { 43151 getTooltipValue: () => t, 43152 getGui: () => s, 43153 getLocation: () => "UNKNOWN", 43154 // only show tooltips for items where the text cannot be fully displayed 43155 shouldDisplayTooltip: () => n.scrollWidth > n.clientWidth 43156 }) 43157 ), this.getGui().appendChild(s); 43158 } 43159 setValue(e, t) { 43160 if (this.value === e) 43161 return this.fireItemSelected(), this; 43162 if (e == null) 43163 return this.reset(t), this; 43164 const i = this.options.findIndex((s) => s.value === e); 43165 if (i !== -1) { 43166 const s = this.options[i]; 43167 this.value = s.value, this.displayValue = s.text, this.highlightItem(this.itemEls[i]), t || this.fireChangeEvent(); 43168 } 43169 return this; 43170 } 43171 setValueByIndex(e) { 43172 return this.setValue(this.options[e].value); 43173 } 43174 getValue() { 43175 return this.value; 43176 } 43177 getDisplayValue() { 43178 return this.displayValue; 43179 } 43180 refreshHighlighted() { 43181 this.clearHighlighted(); 43182 const e = this.options.findIndex((t) => t.value === this.value); 43183 e !== -1 && this.highlightItem(this.itemEls[e]); 43184 } 43185 reset(e) { 43186 this.value = null, this.displayValue = null, this.clearHighlighted(), e || this.fireChangeEvent(); 43187 } 43188 highlightItem(e) { 43189 if (!Yo(e)) 43190 return; 43191 this.clearHighlighted(), this.highlightedEl = e, e.classList.add(this.activeClass), Bw(e, !0); 43192 const t = this.getGui(), { scrollTop: i, clientHeight: s } = t, { offsetTop: n, offsetHeight: o } = e; 43193 (n + o > i + s || n < i) && e.scrollIntoView({ block: "nearest" }), this.unFocusable || e.focus(); 43194 } 43195 clearHighlighted() { 43196 const e = this.highlightedEl; 43197 !e || !Yo(e) || (e.classList.remove(this.activeClass), Bw(e, !1), this.highlightedEl = null); 43198 } 43199 fireChangeEvent() { 43200 this.dispatchLocalEvent({ type: "fieldValueChanged" }), this.fireItemSelected(); 43201 } 43202 fireItemSelected() { 43203 this.dispatchLocalEvent({ type: "selectedItem" }); 43204 } 43205}, Vte = ( 43206 /*css*/ 43207 ".ag-picker-field-display{flex:1 1 auto}.ag-picker-field{align-items:center;display:flex}.ag-picker-field-icon{border:0;cursor:pointer;display:flex;margin:0;padding:0}.ag-picker-field-wrapper{background-color:var(--ag-background-color);border:var(--ag-input-border);border-radius:5px;min-height:max(var(--ag-list-item-height),calc(var(--ag-spacing)*4));overflow:hidden;&:disabled{opacity:.5}&.ag-picker-has-focus,&:focus-within{border:var(--ag-input-focus-border);box-shadow:var(--ag-focus-shadow)}}.ag-picker-field-button{background-color:var(--ag-background-color)}" 43208), Ute = class extends FN { 43209 constructor(e) { 43210 if (super( 43211 e, 43212 e?.template || /* html */ 43213 ` 43214 <div class="ag-picker-field" role="presentation"> 43215 <div data-ref="eLabel"></div> 43216 <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed"> 43217 <div data-ref="eDisplayField" class="ag-picker-field-display"></div> 43218 <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div> 43219 </div> 43220 </div>`, 43221 e?.agComponents || [], 43222 e?.className 43223 ), this.isPickerDisplayed = !1, this.skipClick = !1, this.pickerGap = 4, this.hideCurrentPicker = null, this.eLabel = Pe, this.eWrapper = Pe, this.eDisplayField = Pe, this.eIcon = Pe, this.registerCSS(Vte), this.ariaRole = e?.ariaRole, this.onPickerFocusIn = this.onPickerFocusIn.bind(this), this.onPickerFocusOut = this.onPickerFocusOut.bind(this), !e) 43224 return;
43225 const { pickerGap: t, maxPickerHeight: i, variableWidth: s, minPickerWidth: n, maxPickerWidth: o } = e; 43226 t != null && (this.pickerGap = t), this.variableWidth = !!s, i != null && this.setPickerMaxHeight(i), n != null && this.setPickerMinWidth(n), o != null && this.setPickerMaxWidth(o); 43227 } 43228 postConstruct() { 43229 super.postConstruct(), this.setupAria(); 43230 const e = `ag-${this.getCompId()}-display`; 43231 this.eDisplayField.setAttribute("id", e); 43232 const t = this.getAriaElement(); 43233 this.addManagedElementListeners(t, { keydown: this.onKeyDown.bind(this) }), this.addManagedElementListeners(this.eLabel, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) }), this.addManagedElementListeners(this.eWrapper, { mousedown: this.onLabelOrWrapperMouseDown.bind(this) }); 43234 const { pickerIcon: i, inputWidth: s } = this.config; 43235 if (i) { 43236 const n = po(i, this.beans); 43237 n && this.eIcon.appendChild(n); 43238 } 43239 s != null && this.setInputWidth(s); 43240 } 43241 setupAria() { 43242 const e = this.getAriaElement(); 43243 e.setAttribute("tabindex", this.gos.get("tabIndex").toString()), _w(e, !1), this.ariaRole && en(e, this.ariaRole); 43244 } 43245 onLabelOrWrapperMouseDown(e) { 43246 if (e) { 43247 const t = this.getFocusableElement(); 43248 if (t !== this.eWrapper && e?.target === t) 43249 return; 43250 e.preventDefault(), this.getFocusableElement().focus(); 43251 } 43252 if (this.skipClick) { 43253 this.skipClick = !1; 43254 return; 43255 } 43256 this.isDisabled() || (this.isPickerDisplayed ? this.hidePicker() : this.showPicker()); 43257 } 43258 onKeyDown(e) { 43259 switch (e.key) { 43260 case de.UP: 43261 case de.DOWN: 43262 case de.ENTER: 43263 case de.SPACE: 43264 e.preventDefault(), this.onLabelOrWrapperMouseDown(); 43265 break; 43266 case de.ESCAPE: 43267 this.isPickerDisplayed && (e.preventDefault(), e.stopPropagation(), this.hideCurrentPicker && this.hideCurrentPicker()); 43268 break; 43269 } 43270 } 43271 showPicker() { 43272 this.isPickerDisplayed = !0, this.pickerComponent || (this.pickerComponent = this.createPickerComponent()); 43273 const e = this.pickerComponent.getGui(); 43274 e.addEventListener("focusin", this.onPickerFocusIn), e.addEventListener("focusout", this.onPickerFocusOut), this.hideCurrentPicker = this.renderAndPositionPicker(), this.toggleExpandedStyles(!0); 43275 } 43276 renderAndPositionPicker() { 43277 const e = this.pickerComponent.getGui(); 43278 this.gos.get("suppressScrollWhenPopupsAreOpen") || ([this.destroyMouseWheelFunc] = this.addManagedEventListeners({ 43279 bodyScroll: () => { 43280 this.hidePicker(); 43281 } 43282 })); 43283 const t = this.getLocaleTextFunc(), { 43284 config: { pickerAriaLabelKey: i, pickerAriaLabelValue: s, modalPicker: n = !0 }, 43285 maxPickerHeight: o, 43286 minPickerWidth: r, 43287 maxPickerWidth: a, 43288 variableWidth: l, 43289 beans: c, 43290 eWrapper: u 43291 } = this, d = { 43292 modal: n, 43293 eChild: e, 43294 closeOnEsc: !0, 43295 closedCallback: () => { 43296 const y = OO(c); 43297 this.beforeHidePicker(), y && this.isAlive() && this.getFocusableElement().focus(); 43298 }, 43299 ariaLabel: t(i, s), 43300 anchorToElement: u 43301 }; 43302 e.style.position = "absolute"; 43303 const p = c.popupSvc, f = p.addPopup(d); 43304 l ? (r && (e.style.minWidth = r), e.style.width = eM(Jm(u)), a && (e.style.maxWidth = a)) : sv(e, a ?? Jm(u)); 43305 const m = o ?? `${J1(p.getPopupParent())}px`; 43306 return e.style.setProperty("max-height", m), this.alignPickerToComponent(), f.hideFunc; 43307 } 43308 alignPickerToComponent() { 43309 if (!this.pickerComponent) 43310 return; 43311 const { 43312 pickerGap: e, 43313 config: { pickerType: t }, 43314 beans: { popupSvc: i, gos: s }, 43315 eWrapper: n, 43316 pickerComponent: o 43317 } = this, r = s.get("enableRtl") ? "right" : "left"; 43318 i.positionPopupByComponent({ 43319 type: t, 43320 eventSource: n, 43321 ePopup: o.getGui(), 43322 position: "under", 43323 alignSide: r, 43324 keepWithinBounds: !0, 43325 nudgeY: e 43326 }); 43327 } 43328 beforeHidePicker() { 43329 this.destroyMouseWheelFunc && (this.destroyMouseWheelFunc(), this.destroyMouseWheelFunc = void 0), this.toggleExpandedStyles(!1); 43330 const e = this.pickerComponent.getGui(); 43331 e.removeEventListener("focusin", this.onPickerFocusIn), e.removeEventListener("focusout", this.onPickerFocusOut), this.isPickerDisplayed = !1, this.pickerComponent = void 0, this.hideCurrentPicker = null; 43332 } 43333 toggleExpandedStyles(e) { 43334 if (!this.isAlive()) 43335 return; 43336 const t = this.getAriaElement(); 43337 _w(t, e); 43338 const i = this.eWrapper.classList; 43339 i.toggle("ag-picker-expanded", e), i.toggle("ag-picker-collapsed", !e); 43340 } 43341 onPickerFocusIn() { 43342 this.togglePickerHasFocus(!0); 43343 } 43344 onPickerFocusOut(e) { 43345 this.pickerComponent?.getGui().contains(e.relatedTarget) || this.togglePickerHasFocus(!1); 43346 } 43347 togglePickerHasFocus(e) { 43348 this.pickerComponent && this.eWrapper.classList.toggle("ag-picker-has-focus", e); 43349 } 43350 hidePicker() { 43351 this.hideCurrentPicker?.(); 43352 } 43353 setInputWidth(e) { 43354 return sv(this.eWrapper, e), this; 43355 } 43356 getFocusableElement() { 43357 return this.eWrapper; 43358 } 43359 setPickerGap(e) { 43360 return this.pickerGap = e, this; 43361 } 43362 setPickerMinWidth(e) { 43363 return typeof e == "number" && (e = `${e}px`), this.minPickerWidth = e ?? void 0, this; 43364 } 43365 setPickerMaxWidth(e) { 43366 return typeof e == "number" && (e = `${e}px`), this.maxPickerWidth = e ?? void 0, this; 43367 } 43368 setPickerMaxHeight(e) { 43369 return typeof e == "number" && (e = `${e}px`), this.maxPickerHeight = e ?? void 0, this; 43370 } 43371 destroy() { 43372 this.hidePicker(), super.destroy(); 43373 } 43374}, Wte = ( 43375 /*css*/ 43376 ".ag-select{align-items:center;display:flex;&.ag-disabled{opacity:.5}}:where(.ag-select){.ag-picker-field-wrapper{cursor:default}&.ag-disabled .ag-picker-field-wrapper:focus{box-shadow:none}&:not(.ag-cell-editor,.ag-label-align-top){min-height:var(--ag-list-item-height)}.ag-picker-field-display{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ag-picker-field-icon{align-items:center;display:flex}}:where(.ag-ltr) :where(.ag-select){.ag-picker-field-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding)/2);padding-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-select){.ag-picker-field-wrapper{padding-left:var(--ag-spacing);padding-right:calc(var(--ag-cell-horizontal-padding)/2)}}" 43377), xM = class extends Ute { 43378 constructor(e) { 43379 super({ 43380 pickerAriaLabelKey: "ariaLabelSelectField", 43381 pickerAriaLabelValue: "Select Field", 43382 pickerType: "ag-list", 43383 className: "ag-select", 43384 pickerIcon: "selectOpen", 43385 ariaRole: "combobox", 43386 ...e 43387 }), this.registerCSS(Wte); 43388 } 43389 postConstruct() { 43390 this.tooltipFeature = this.createOptionalManagedBean( 43391 this.beans.registry.createDynamicBean("tooltipFeature", !1, { 43392 shouldDisplayTooltip: bm(() => this.eDisplayField), 43393 getGui: () => this.getGui() 43394 }) 43395 ), super.postConstruct(), this.createListComponent(), this.eWrapper.tabIndex = this.gos.get("tabIndex"); 43396 const { options: e, value: t, placeholder: i } = this.config; 43397 e != null && this.addOptions(e), t != null && this.setValue(t, !0), i && t == null && (this.eDisplayField.textContent = i), this.addManagedElementListeners(this.eWrapper, { focusout: this.onWrapperFocusOut.bind(this) }); 43398 } 43399 onWrapperFocusOut(e) { 43400 this.eWrapper.contains(e.relatedTarget) || this.hidePicker(); 43401 } 43402 createListComponent() { 43403 const e = this.createBean(new Hte("select", !0)); 43404 this.listComponent = e, e.setParentComponent(this); 43405 const t = e.getAriaElement(), i = `ag-select-list-${e.getCompId()}`; 43406 t.setAttribute("id", i), PQ(this.getAriaElement(), t), e.addManagedListeners(e, { 43407 selectedItem: () => { 43408 this.hidePicker(), this.dispatchLocalEvent({ type: "selectedItem" }); 43409 } 43410 }), e.addManagedListeners(e, { 43411 fieldValueChanged: () => { 43412 this.listComponent && (this.setValue(this.listComponent.getValue(), !1, !0), this.hidePicker()); 43413 } 43414 }); 43415 } 43416 createPickerComponent() { 43417 return this.listComponent; 43418 } 43419 onKeyDown(e) { 43420 const { key: t } = e; 43421 switch (t === de.TAB && this.hidePicker(), t) { 43422 case de.ENTER: 43423 case de.UP: 43424 case de.DOWN: 43425 case de.PAGE_UP: 43426 case de.PAGE_DOWN: 43427 case de.PAGE_HOME: 43428 case de.PAGE_END: 43429 e.preventDefault(), this.isPickerDisplayed ? this.listComponent?.handleKeyDown(e) : super.onKeyDown(e); 43430 break; 43431 case de.ESCAPE: 43432 super.onKeyDown(e); 43433 break; 43434 case de.SPACE: 43435 this.isPickerDisplayed ? e.preventDefault() : super.onKeyDown(e); 43436 break; 43437 } 43438 } 43439 showPicker() { 43440 const e = this.listComponent; 43441 e && (super.showPicker(), e.refreshHighlighted()); 43442 } 43443 addOptions(e) { 43444 return e.forEach((t) => this.addOption(t)), this; 43445 } 43446 addOption(e) { 43447 return this.listComponent.addOption(e), this; 43448 } 43449 clearOptions() { 43450 return this.listComponent?.clearOptions(), this; 43451 } 43452 setValue(e, t, i) { 43453 const { 43454 listComponent: s, 43455 config: { placeholder: n }, 43456 eDisplayField: o, 43457 tooltipFeature: r 43458 } = this; 43459 if (this.value === e || !s) 43460 return this; 43461 if (i || s.setValue(e, !0), s.getValue() === this.getValue()) 43462 return this; 43463 let l = s.getDisplayValue(); 43464 return l == null && n && (l = n), o.textContent = l, r?.setTooltipAndRefresh(l ?? null), super.setValue(e, t); 43465 } 43466 destroy() { 43467 this.listComponent = this.destroyBean(this.listComponent), super.destroy(); 43468 } 43469}, jte = { 43470 selector: "AG-SELECT", 43471 component: xM 43472}, I0 = { 43473 TAB_GUARD: "ag-tab-guard", 43474 TAB_GUARD_TOP: "ag-tab-guard-top", 43475 TAB_GUARD_BOTTOM: "ag-tab-guard-bottom" 43476}, $te = class extends he {
43477 constructor(e) { 43478 super(), this.skipTabGuardFocus = !1, this.forcingFocusOut = !1, this.allowFocus = !1; 43479 const { 43480 comp: t, 43481 eTopGuard: i, 43482 eBottomGuard: s, 43483 focusTrapActive: n, 43484 forceFocusOutWhenTabGuardsAreEmpty: o, 43485 isFocusableContainer: r, 43486 focusInnerElement: a, 43487 onFocusIn: l, 43488 onFocusOut: c, 43489 shouldStopEventPropagation: u, 43490 onTabKeyDown: d, 43491 handleKeyDown: p, 43492 eFocusableElement: f 43493 } = e; 43494 this.comp = t, this.eTopGuard = i, this.eBottomGuard = s, this.providedFocusInnerElement = a, this.eFocusableElement = f, this.focusTrapActive = !!n, this.forceFocusOutWhenTabGuardsAreEmpty = !!o, this.isFocusableContainer = !!r, this.providedFocusIn = l, this.providedFocusOut = c, this.providedShouldStopEventPropagation = u, this.providedOnTabKeyDown = d, this.providedHandleKeyDown = p; 43495 } 43496 postConstruct() { 43497 this.createManagedBean( 43498 new sh(this.eFocusableElement, { 43499 shouldStopEventPropagation: () => this.shouldStopEventPropagation(), 43500 onTabKeyDown: (e) => this.onTabKeyDown(e), 43501 handleKeyDown: (e) => this.handleKeyDown(e), 43502 onFocusIn: (e) => this.onFocusIn(e), 43503 onFocusOut: (e) => this.onFocusOut(e) 43504 }) 43505 ), this.activateTabGuards(), [this.eTopGuard, this.eBottomGuard].forEach( 43506 (e) => this.addManagedElementListeners(e, { focus: this.onFocus.bind(this) }) 43507 ); 43508 } 43509 handleKeyDown(e) { 43510 this.providedHandleKeyDown && this.providedHandleKeyDown(e); 43511 } 43512 tabGuardsAreActive() { 43513 return !!this.eTopGuard && this.eTopGuard.hasAttribute("tabIndex"); 43514 } 43515 shouldStopEventPropagation() { 43516 return this.providedShouldStopEventPropagation ? this.providedShouldStopEventPropagation() : !1; 43517 } 43518 activateTabGuards() { 43519 if (this.forcingFocusOut) 43520 return; 43521 const e = this.gos.get("tabIndex"); 43522 this.comp.setTabIndex(e.toString()); 43523 } 43524 deactivateTabGuards() { 43525 this.comp.setTabIndex(); 43526 } 43527 onFocus(e) { 43528 if (this.isFocusableContainer && !this.eFocusableElement.contains(e.relatedTarget) && !this.allowFocus) { 43529 this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard); 43530 return; 43531 } 43532 if (this.skipTabGuardFocus) { 43533 this.skipTabGuardFocus = !1; 43534 return; 43535 } 43536 if (this.forceFocusOutWhenTabGuardsAreEmpty && dd(this.eFocusableElement, ".ag-tab-guard").length === 0) { 43537 this.findNextElementOutsideAndFocus(e.target === this.eBottomGuard); 43538 return; 43539 } 43540 if (this.isFocusableContainer && this.eFocusableElement.contains(e.relatedTarget)) 43541 return; 43542 const t = e.target === this.eBottomGuard; 43543 this.providedFocusInnerElement ? this.providedFocusInnerElement(t) : this.focusInnerElement(t); 43544 } 43545 findNextElementOutsideAndFocus(e) { 43546 const t = Ei(this.beans), i = dd(t.body, null, !0), s = i.indexOf(e ? this.eTopGuard : this.eBottomGuard); 43547 if (s === -1) 43548 return; 43549 let n, o; 43550 e ? (n = 0, o = s) : (n = s + 1, o = i.length); 43551 const r = i.slice(n, o), a = this.gos.get("tabIndex"); 43552 r.sort((l, c) => { 43553 const u = parseInt(l.getAttribute("tabindex") || "0"), d = parseInt(c.getAttribute("tabindex") || "0"); 43554 return d === a ? 1 : u === a ? -1 : u === 0 ? 1 : d === 0 ? -1 : u - d; 43555 }
43555), r[e ? r.length - 1 : 0]?.focus(); 43556 } 43557 onFocusIn(e) { 43558 this.focusTrapActive || this.forcingFocusOut || (this.providedFocusIn && this.providedFocusIn(e), this.isFocusableContainer || this.deactivateTabGuards()); 43559 } 43560 onFocusOut(e) { 43561 this.focusTrapActive || (this.providedFocusOut && this.providedFocusOut(e), this.eFocusableElement.contains(e.relatedTarget) || this.activateTabGuards()); 43562 } 43563 onTabKeyDown(e) { 43564 if (this.providedOnTabKeyDown) { 43565 this.providedOnTabKeyDown(e); 43566 return; 43567 } 43568 if (this.focusTrapActive || e.defaultPrevented) 43569 return; 43570 const t = this.tabGuardsAreActive(); 43571 t && this.deactivateTabGuards(); 43572 const i = this.getNextFocusableElement(e.shiftKey); 43573 t && setTimeout(() => this.activateTabGuards(), 0), i && (i.focus(), e.preventDefault()); 43574 } 43575 focusInnerElement(e = !1) { 43576 const t = dd(this.eFocusableElement); 43577 this.tabGuardsAreActive() && (t.splice(0, 1), t.splice(t.length - 1, 1)), t.length && t[e ? t.length - 1 : 0].focus({ preventScroll: !0 }); 43578 } 43579 getNextFocusableElement(e) { 43580 return iu(this.beans, this.eFocusableElement, !1, e); 43581 } 43582 forceFocusOutOfContainer(e = !1) { 43583 if (this.forcingFocusOut) 43584 return; 43585 const t = e ? this.eTopGuard : this.eBottomGuard; 43586 this.activateTabGuards(), this.skipTabGuardFocus = !0, this.forcingFocusOut = !0, t.focus(), window.setTimeout(() => { 43587 this.forcingFocusOut = !1, this.activateTabGuards(); 43588 }); 43589 } 43590 isTabGuard(e, t) { 43591 return e === this.eTopGuard && !t || e === this.eBottomGuard && (t ?? !0); 43592 } 43593 setAllowFocus(e) { 43594 this.allowFocus = e; 43595 } 43596}, Yte = class extends he { 43597 constructor(e) { 43598 super(), this.comp = e; 43599 } 43600 initialiseTabGuard(e) { 43601 this.eTopGuard = this.createTabGuard("top"), this.eBottomGuard = this.createTabGuard("bottom"), this.eFocusableElement = this.comp.getFocusableElement(); 43602 const { eTopGuard: t, eBottomGuard: i, eFocusableElement: s } = this, n = [t, i], o = { 43603 setTabIndex: (y) => { 43604 n.forEach( 43605 (b) => y != null ? b.setAttribute("tabindex", y) : b.removeAttribute("tabindex") 43606 ); 43607 } 43608 }; 43609 this.addTabGuards(t, i); 43610 const { 43611 focusTrapActive: r = !1, 43612 onFocusIn: a, 43613 onFocusOut: l, 43614 focusInnerElement: c, 43615 handleKeyDown: u, 43616 onTabKeyDown: d, 43617 shouldStopEventPropagation: p, 43618 forceFocusOutWhenTabGuardsAreEmpty: f, 43619 isFocusableContainer: m 43620 } = e; 43621 this.tabGuardCtrl = this.createManagedBean( 43622 new $te({ 43623 comp: o, 43624 focusTrapActive: r, 43625 eTopGuard: t, 43626 eBottomGuard: i, 43627 eFocusableElement: s, 43628 onFocusIn: a, 43629 onFocusOut: l, 43630 focusInnerElement: c, 43631 handleKeyDown: u, 43632 onTabKeyDown: d, 43633 shouldStopEventPropagation: p, 43634 forceFocusOutWhenTabGuardsAreEmpty: f, 43635 isFocusableContainer: m 43636 }) 43637 ); 43638 } 43639 getTabGuardCtrl() { 43640 return this.tabGuardCtrl; 43641 } 43642 createTabGuard(e) { 43643 const t = Ei(this.beans).createElement("div"), i = e === "top" ? I0.TAB_GUARD_TOP : I0.TAB_GUARD_BOTTOM; 43644 return t.classList.add(I0.TAB_GUARD, i), en(t, "presentation"), t; 43645 } 43646 addTabGuards(e, t) { 43647 const i = this.eFocusableElement; 43648 i.insertAdjacentElement("afterbegin", e), i.insertAdjacentElement("beforeend", t); 43649 } 43650 removeAllChildrenExceptTabGuards() { 43651 const e = [this.eTopGuard, this.eBottomGuard]; 43652 Is(this.comp.getFocusableElement()), this.addTabGuards(...e); 43653 } 43654 forceFocusOutOfContainer(e = !1) { 43655 this.tabGuardCtrl.forceFocusOutOfContainer(e); 43656 } 43657 appendChild(e, t, i) { 43658 tM(t) || (t = t.getGui()); 43659 const { eBottomGuard: s } = this; 43660 s ? s.insertAdjacentElement("beforebegin", t) : e(t, i); 43661 } 43662}, NN = class extends Tt { 43663 initialiseTabGuard(e) { 43664 this.tabGuardFeature = this.createManagedBean(new Yte(this)), this.tabGuardFeature.initialiseTabGuard(e); 43665 } 43666 forceFocusOutOfContainer(e = !1) { 43667 this.tabGuardFeature.forceFocusOutOfContainer(e); 43668 } 43669 appendChild(e, t) { 43670 this.tabGuardFeature.appendChild(super.appendChild.bind(this), e, t); 43671 } 43672}, nh = class extends Tt { 43673 isPopup() { 43674 return !0; 43675 } 43676 setParentComponent(e) { 43677 e.addCssClass("ag-has-popup"), super.setParentComponent(e); 43678 } 43679 destroy() { 43680 const e = this.parentComponent; 43681 e && e.isAlive() && e.getGui().classList.remove("ag-has-popup"), super.destroy(); 43682 } 43683}, Bu = class { 43684 constructor(e, t = !1) { 43685 this.DOUBLE_TAP_MILLIS = 500, this.destroyFuncs = [], this.touching = !1, this.localEventService = new ih(), this.preventMouseClick = t; 43686 const i = this.onTouchStart.bind(this), s = this.onTouchMove.bind(this), n = this.onTouchEnd.bind(this); 43687 e.addEventListener("touchstart", i, { passive: !0 }), e.addEventListener("touchmove", s, { passive: !0 }), e.addEventListener("touchend", n, { passive: !1 }), this.destroyFuncs.push(() => { 43688 e.removeEventListener("touchstart", i, { passive: !0 }), e.removeEventListener("touchmove", s, { passive: !0 }), e.removeEventListener("touchend", n, { passive: !1 }); 43689 }); 43690 } 43691 getActiveTouch(e) { 43692 for (let t = 0; t < e.length; t++) 43693 if (e[t].identifier === this.touchStart.identifier) 43694 return e[t]; 43695 return null; 43696 } 43697 addEventListener(e, t) { 43698 this.localEventService.addEventListener(e, t); 43699 } 43700 removeEventListener(e, t) { 43701 this.localEventService.removeEventListener(e, t); 43702 } 43703 onTouchStart(e) { 43704 if (this.touching) 43705 return; 43706 this.touchStart = e.touches[0], this.touching = !0, this.moved = !1; 43707 const t = this.touchStart; 43708 window.setTimeout(() => { 43709 const i = this.touchStart === t; 43710 if (this.touching && i && !this.moved) { 43711 this.moved = !0; 43712 const s = { 43713 type: "longTap", 43714 touchStart: this.touchStart, 43715 touchEvent: e 43716 }; 43717 this.localEventService.dispatchEvent(s); 43718 } 43719 }, 500); 43720 } 43721 onTouchMove(e) { 43722 if (!this.touching) 43723 return; 43724 const t = this.getActiveTouch(e.touches); 43725 if (!t) 43726 return; 43727 !vN(t, this.touchStart, 4) && (this.moved = !0); 43728 } 43729 onTouchEnd(e) { 43730 if (this.touching) { 43731 if (!this.moved) { 43732 const t = { 43733 type: "tap", 43734 touchStart: this.touchStart 43735 }; 43736 this.localEventService.dispatchEvent(t), this.checkForDoubleTap(); 43737 } 43738 this.preventMouseClick && e.cancelable && e.preventDefault(), this.touching = !1; 43739 } 43740 } 43741 checkForDoubleTap() { 43742 const e = (/* @__PURE__ */ new Date()).getTime(); 43743 if (this.lastTapTime && this.lastTapTime > 0) 43744 if (e - this.lastTapTime > this.DOUBLE_TAP_MILLIS) { 43745 const i = { 43746 type: "doubleTap", 43747 touchStart: this.touchStart 43748 }; 43749 this.localEventService.dispatchEvent(i), this.lastTapTime = null; 43750 } else 43751 this.lastTapTime = e; 43752 else 43753 this.lastTapTime = e; 43754 } 43755 destroy() { 43756 this.destroyFuncs.forEach((e) => e()); 43757 } 43758}, _N = class { 43759 constructor(e = "javascript") { 43760 this.frameworkName = e, this.renderingEngine = "vanilla", this.wrapIncoming = (t) => t(), this.wrapOutgoing = (t) => t(), this.baseDocLink = `${DO}/${this.frameworkName}-data-grid`, YQ(this.baseDocLink); 43761 } 43762 setInterval(e, t) { 43763 return new gn((i) => { 43764 i(window.setInterval(e, t)); 43765 }); 43766 } 43767 // for Vanilla JS, we just add the event to the element 43768 addEventListener(e, t, i, s) { 43769 let n = {}; 43770 if (typeof s == "object" ? n = s : typeof s == "boolean" && (n = { capture: s }), n.passive == null) { 43771 const o = VO(t); 43772 o != null && (n.passive = o); 43773 } 43774 e.addEventListener(t, i, n); 43775 } 43776 frameworkComponent(e) { 43777 return null; 43778 } 43779 isFrameworkComponent(e) { 43780 return !1; 43781 } 43782 getDocLink(e) { 43783 return `${this.baseDocLink}${e ? `/${e}` : ""}`; 43784 } 43785}; 43786function Kte(e) { 43787 return { 43788 beanName: "gridApi", 43789 bean: e.getBean("apiFunctionSvc").api 43790 }; 43791} 43792var Zte = [ 43793 // Validate license first 43794 "licenseManager", 43795 // core beans only 43796 "environment", 43797 "eventSvc", 43798 "gos", 43799 "paginationAutoPageSizeSvc", 43800 "apiFunctionSvc", 43801 "gridApi", 43802 "registry", 43803 "agCompUtils", 43804 "userCompFactory", 43805 "rowContainerHeight", 43806 "horizontalResizeSvc", 43807 "localeSvc", 43808 "pinnedRowModel", 43809 "dragSvc", 43810 "colGroupSvc", 43811 "visibleCols", 43812 "popupSvc", 43813 "selectionSvc", 43814 "colFilter", 43815 "quickFilter", 43816 "filterManager", 43817 "colModel", 43818 "headerNavigation", 43819 "pageBounds", 43820 "pagination", 43821 "pageBoundsListener", 43822 "stickyRowSvc", 43823 "rowRenderer", 43824 "expressionSvc", 43825 "alignedGridsSvc", 43826 "navigation", 43827 "valueCache", 43828 "valueSvc", 43829 "autoWidthCalc", 43830 "filterMenuFactory", 43831 "dragAndDrop",
43832 "focusSvc", 43833 "cellNavigation", 43834 "cellStyles", 43835 "scrollVisibleSvc", 43836 "sortSvc", 43837 "colHover", 43838 "colAnimation", 43839 "autoColSvc", 43840 "selectionColSvc", 43841 "changeDetectionSvc", 43842 "animationFrameSvc", 43843 "undoRedo", 43844 "colDefFactory", 43845 "rowStyleSvc", 43846 "rowNodeBlockLoader", 43847 "rowNodeSorter", 43848 "ctrlsSvc", 43849 "pinnedCols", 43850 "dataTypeSvc", 43851 "syncSvc", 43852 "overlays", 43853 "stateSvc", 43854 "expansionSvc", 43855 "apiEventSvc", 43856 "ariaAnnounce", 43857 "menuSvc", 43858 "colMoves", 43859 "colAutosize", 43860 "colFlex", 43861 "colResize", 43862 "pivotColsSvc", 43863 "valueColsSvc", 43864 "rowGroupColsSvc", 43865 "funcColsSvc", 43866 "colNames", 43867 "colViewport", 43868 "pivotResultCols", 43869 "showRowGroupCols", 43870 "validation" 43871 // Have validations run last 43872], eT = Object.fromEntries( 43873 Zte.map((e, t) => [e, t]) 43874); 43875function qte(e, t) { 43876 const i = (e.beanName ? eT[e.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER, s = (t.beanName ? eT[t.beanName] : void 0) ?? Number.MAX_SAFE_INTEGER; 43877 return i - s; 43878} 43879function Qte(e, t) { 43880 return e?.beanName === "gridDestroySvc" ? -1 : 0; 43881} 43882var Xte = ( 43883 /* html */ 43884 '<div class="ag-pinned-left-header" role="rowgroup"></div>' 43885), Jte = ( 43886 /* html */ 43887 '<div class="ag-pinned-right-header" role="rowgroup"></div>' 43888), eie = ( 43889 /* html */ 43890 `<div class="ag-header-viewport" role="presentation"> 43891 <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div> 43892 </div>` 43893), R0 = class extends Tt { 43894 constructor(e) { 43895 super(), this.eCenterContainer = Pe, this.headerRowComps = {}, this.rowCompsList = [], this.pinned = e; 43896 } 43897 postConstruct() { 43898 this.selectAndSetTemplate(); 43899 const e = { 43900 setDisplayed: (i) => this.setDisplayed(i), 43901 setCtrls: (i) => this.setCtrls(i), 43902 // only gets called for center section 43903 setCenterWidth: (i) => this.eCenterContainer.style.width = i, 43904 setViewportScrollLeft: (i) => this.getGui().scrollLeft = i, 43905 // only gets called for pinned sections 43906 setPinnedContainerWidth: (i) => { 43907 const s = this.getGui(); 43908 s.style.width = i, s.style.maxWidth = i, s.style.minWidth = i; 43909 } 43910 }; 43911 this.createManagedBean(new fte(this.pinned)).setComp(e, this.getGui()); 43912 } 43913 selectAndSetTemplate() { 43914 const e = this.pinned == "left", t = this.pinned == "right", i = e ? Xte : t ? Jte : eie; 43915 this.setTemplate(i), this.eRowContainer = this.eCenterContainer !== Pe ? this.eCenterContainer : this.getGui(); 43916 } 43917 destroy() { 43918 this.setCtrls([]), super.destroy(); 43919 } 43920 destroyRowComp(e) { 43921 this.destroyBean(e), this.eRowContainer.removeChild(e.getGui()); 43922 } 43923 setCtrls(e) { 43924 const t = this.headerRowComps; 43925 this.headerRowComps = {}, this.rowCompsList = []; 43926 let i; 43927 const s = (n) => { 43928 const o = n.getGui(); 43929 o.parentElement != this.eRowContainer && this.eRowContainer.appendChild(o), i && SO(this.eRowContainer, o, i), i = o; 43930 }; 43931 e.forEach((n) => { 43932 const o = n.instanceId, r = t[o]; 43933 delete t[o]; 43934 const a = r || this.createBean(new dte(n)); 43935 this.headerRowComps[o] = a, this.rowCompsList.push(a), s(a); 43936 }), Object.values(t).forEach((n) => this.destroyRowComp(n)); 43937 } 43938}, tie = class extends Tt { 43939 constructor() { 43940 super( 43941 /* html */ 43942 '<div class="ag-header" role="presentation"/>' 43943 ); 43944 } 43945 postConstruct() { 43946 const e = { 43947 addOrRemoveCssClass: (s, n) => this.addOrRemoveCssClass(s, n), 43948 setHeightAndMinHeight: (s) => { 43949 this.getGui().style.height = s, this.getGui().style.minHeight = s; 43950 } 43951 }; 43952 this.createManagedBean(new ate()).setComp(e, this.getGui(), this.getFocusableElement()); 43953 const i = (s) => { 43954 this.createManagedBean(s), this.appendChild(s); 43955 }; 43956 i(new R0("left")), i(new R0(null)), i(new R0("right")); 43957 } 43958}, iie = { 43959 selector: "AG-HEADER-ROOT", 43960 component: tie 43961}, sie = class extends Tt { 43962 constructor(e, t, i, s, n) { 43963 super(), this.cellCtrl = t, this.rendererVersion = 0, this.editorVersion = 0, this.beans = e, this.column = t.column, this.rowNode = t.rowNode, this.eRow = s; 43964 const o = document.createElement("div"); 43965 o.setAttribute("comp-id", `${this.getCompId()}`), this.setTemplateFromElement(o); 43966 const r = this.getGui(); 43967 this.forceWrapper = t.isForceWrapper(), this.refreshWrapper(!1), en(r, t.getCellAriaRole()), r.setAttribute("col-id", t.colIdSanitised); 43968 const a = { 43969 addOrRemoveCssClass: (l, c) => this.addOrRemoveCssClass(l, c), 43970 setUserStyles: (l) =>
43970 MO(r, l), 43971 getFocusableElement: () => this.getFocusableElement(), 43972 setIncludeSelection: (l) => this.includeSelection = l, 43973 setIncludeRowDrag: (l) => this.includeRowDrag = l, 43974 setIncludeDndSource: (l) => this.includeDndSource = l, 43975 setRenderDetails: (l, c, u) => this.setRenderDetails(l, c, u), 43976 setEditDetails: (l, c, u) => this.setEditDetails(l, c, u), 43977 getCellEditor: () => this.cellEditor || null, 43978 getCellRenderer: () => this.cellRenderer || null, 43979 getParentOfValue: () => this.getParentOfValue() 43980 }; 43981 t.setComp(a, this.getGui(), this.eCellWrapper, i, n, void 0); 43982 } 43983 getParentOfValue() { 43984 return this.eCellValue ? this.eCellValue : this.eCellWrapper ? this.eCellWrapper : this.getGui(); 43985 } 43986 setRenderDetails(e, t, i) { 43987 if (this.cellEditor && !this.cellEditorPopupWrapper) 43988 return; 43989 this.firstRender = this.firstRender == null; 43990 const n = this.refreshWrapper(!1); 43991 this.refreshEditStyles(!1), e ? !(i || n) && this.refreshCellRenderer(e) || (this.destroyRenderer(), this.createCellRendererInstance(e)) : (this.destroyRenderer(), this.insertValueWithoutCellRenderer(t)); 43992 } 43993 setEditDetails(e, t, i) { 43994 e ? this.createCellEditorInstance(e, t, i) : this.destroyEditor(); 43995 } 43996 removeControls() { 43997 this.checkboxSelectionComp = this.beans.context.destroyBean(this.checkboxSelectionComp), this.dndSourceComp = this.beans.context.destroyBean(this.dndSourceComp), this.rowDraggingComp = this.beans.context.destroyBean(this.rowDraggingComp); 43998 } 43999 // returns true if wrapper was changed 44000 refreshWrapper(e) { 44001 const t = this.includeRowDrag || this.includeDndSource || this.includeSelection, i = t || this.forceWrapper, s = i && this.eCellWrapper == null; 44002 if (s) { 44003 const c = document.createElement("div"); 44004 c.setAttribute("role", "presentation"), c.setAttribute("class", "ag-cell-wrapper"), this.eCellWrapper = c, this.getGui().appendChild(this.eCellWrapper); 44005 } 44006 const n = !i && this.eCellWrapper != null; 44007 n && (pr(this.eCellWrapper), this.eCellWrapper = void 0), this.addOrRemoveCssClass("ag-cell-value", !i); 44008 const o = !e && i, r = o && this.eCellValue == null; 44009 if (r) { 44010 const c = document.createElement("span"); 44011 c.setAttribute("role", "presentation"), c.setAttribute("class", "ag-cell-value"), this.eCellValue = c, this.eCellWrapper.appendChild(this.eCellValue); 44012 } 44013 const a = !o && this.eCellValue != null; 44014 a && (pr(this.eCellValue), this.eCellValue = void 0); 44015 const l = s || n || r || a; 44016 return l && this.removeControls(), e || t && this.addControls(), l; 44017 } 44018 addControls() { 44019 this.includeRowDrag && this.rowDraggingComp == null && (this.rowDraggingComp = this.cellCtrl.createRowDragComp(), this.rowDraggingComp && this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(), this.eCellValue)), this.includeDndSource && this.dndSourceComp == null && (this.dndSourceComp = this.cellCtrl.createDndSource(), this.dndSourceComp && this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(), this.eCellValue)), this.includeSelection && this.checkboxSelectionComp == null && (this.checkboxSelectionComp = this.cellCtrl.createSelectionCheckbox(), this.checkboxSelectionComp && this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(), this.eCellValue)); 44020 } 44021 createCellEditorInstance(e, t, i) { 44022 const s = this.editorVersion, n = e.newAgStackInstance(), { params: o } = e; 44023 n.then((a) => this.afterCellEditorCreated(s, a, o, t, i)), ai(this.cellEditor) && o.cellStartedEdit && this.cellCtrl.focusCell(!0); 44024 } 44025 insertValueWithoutCellRenderer(e) { 44026 const t = this.getParentOfValue(); 44027 Is(t); 44028 const i = e != null ? yr(e, !0) : null; 44029 i != null && (t.textContent = i); 44030 } 44031 destroyEditorAndRenderer() { 44032 this.destroyRenderer(), this.destroyEditor(); 44033 } 44034 destroyRenderer() { 44035 const { context: e } = this.beans; 44036 this.cellRenderer = e.destroyBean(this.cellRenderer), pr(this.cellRendererGui), this.cellRendererGui = null, this.rendererVersion++; 44037 } 44038 destroyEditor() { 44039 const { context: e } = this.beans; 44040 this.hideEditorPopup && this.hideEditorPopup(), this.hideEditorPopup = void 0, this.cellEditor = e.destroyBean(this.cellEditor), this.cellEditorPopupWrapper = e.de
44040stroyBean(this.cellEditorPopupWrapper), pr(this.cellEditorGui), this.cellEditorGui = null, this.editorVersion++; 44041 } 44042 refreshCellRenderer(e) { 44043 if (this.cellRenderer == null || this.cellRenderer.refresh == null || this.cellRendererClass !== e.componentClass) 44044 return !1; 44045 const t = this.cellRenderer.refresh(e.params); 44046 return t === !0 || t === void 0; 44047 } 44048 createCellRendererInstance(e) { 44049 const i = !this.beans.gos.get("suppressAnimationFrame") && this.beans.animationFrameSvc, s = this.rendererVersion, { componentClass: n } = e, o = () => { 44050 if (this.rendererVersion !== s || !this.isAlive()) 44051 return; 44052 const a = e.newAgStackInstance(), l = this.afterCellRendererCreated.bind(this, s, n); 44053 a && a.then(l); 44054 }; 44055 i && this.firstRender ? this.beans.animationFrameSvc.createTask(o, this.rowNode.rowIndex, "createTasksP2") : o(); 44056 } 44057 afterCellRendererCreated(e, t, i) { 44058 if (!this.isAlive() || e !== this.rendererVersion) { 44059 this.beans.context.destroyBean(i); 44060 return; 44061 } 44062 if (this.cellRenderer = i, this.cellRendererClass = t, this.cellRendererGui = this.cellRenderer.getGui(), this.cellRendererGui != null) { 44063 const n = this.getParentOfValue(); 44064 Is(n), n.appendChild(this.cellRendererGui); 44065 } 44066 } 44067 afterCellEditorCreated(e, t, i, s, n) { 44068 if (e !== this.editorVersion) { 44069 this.beans.context.destroyBean(t); 44070 return; 44071 } 44072 if (t.isCancelBeforeStart && t.isCancelBeforeStart()) { 44073 this.beans.context.destroyBean(t), this.cellCtrl.stopEditing(!0); 44074 return; 44075 } 44076 if (!t.getGui) { 44077 Ae(97, { colId: this.column.getId() }), this.beans.context.destroyBean(t); 44078 return; 44079 } 44080 this.cellEditor = t, this.cellEditorGui = t.getGui(); 44081 const a = s || t.isPopup !== void 0 && t.isPopup(); 44082 a ? this.addPopupCellEditor(i, n) : this.addInCellEditor(), this.refreshEditStyles(!0, a), t.afterGuiAttached && t.afterGuiAttached(), this.cellCtrl.cellEditorAttached(); 44083 } 44084 refreshEditStyles(e, t) { 44085 this.addOrRemoveCssClass("ag-cell-inline-editing", e && !t), this.addOrRemoveCssClass("ag-cell-popup-editing", e && !!t), this.addOrRemoveCssClass("ag-cell-not-inline-editing", !e || !!t), this.cellCtrl.setInlineEditingCss(); 44086 } 44087 addInCellEditor() { 44088 const e = this.getGui(); 44089 e.contains(gi(this.beans)) && e.focus(), this.destroyRenderer(), this.refreshWrapper(!0), this.clearParentOfValue(), this.cellEditorGui && this.getParentOfValue().appendChild(this.cellEditorGui); 44090 } 44091 addPopupCellEditor(e, t) { 44092 this.beans.gos.get("editType") === "fullRow" && Ae(98); 44093 const i = this.cellEditor; 44094 this.cellEditorPopupWrapper = this.beans.context.createBean( 44095 this.beans.editSvc.createPopupEditorWrapper(e) 44096 ); 44097 const s = this.cellEditorPopupWrapper.getGui(); 44098 this.cellEditorGui && s.appendChild(this.cellEditorGui); 44099 const n = this.beans.popupSvc, o = this.beans.gos.get("stopEditingWhenCellsLoseFocus"), r = t ?? i.getPopupPosition?.() ?? "over", a = this.beans.gos.get("enableRtl"), l = { 44100 ePopup: s, 44101 column: this.column, 44102 rowNode: this.rowNode, 44103 type: "popupCellEditor", 44104 eventSource: this.getGui(), 44105 position: r, 44106 alignSide: a ? "right" : "left", 44107 keepWithinBounds: !0 44108 }, c = n.positionPopupByComponent.bind(n, l), u = rO(this.beans.localeSvc), d = n.addPopup({ 44109 modal: o, 44110 eChild: s, 44111 closeOnEsc: !0, 44112 closedCallback: () => { 44113 this.cellCtrl.onPopupEditorClosed(); 44114 }, 44115 anchorToElement: this.getGui(), 44116 positionCallback: c, 44117 ariaLabel: u("ariaLabelCellEditor", "Cell Editor") 44118 }); 44119 d && (this.hideEditorPopup = d.hideFunc); 44120 } 44121 detach() { 44122 this.eRow.removeChild(this.getGui()); 44123 } 44124 // if the row is also getting destroyed, then we don't need to remove from dom, 44125 // as the row will also get removed, so no need to take out the cells from the row 44126 // if the row is going (removing is an expensive operation, so only need to remove 44127 // the top part) 44128 // 44129 // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons. 44130 destroy() {
44131 this.cellCtrl.stopEditing(), this.destroyEditorAndRenderer(), this.removeControls(), super.destroy(); 44132 } 44133 clearParentOfValue() { 44134 const e = this.getGui(); 44135 e.contains(gi(this.beans)) && e.focus({ preventScroll: !0 }), Is(this.getParentOfValue()); 44136 } 44137}, nie = class extends Tt { 44138 constructor(e, t, i) { 44139 super(), this.cellComps = {}, this.beans = t, this.rowCtrl = e; 44140 const s = document.createElement("div"); 44141 s.setAttribute("comp-id", `${this.getCompId()}`), s.setAttribute("style", this.getInitialStyle(i)), this.setTemplateFromElement(s); 44142 const n = this.getGui(), o = n.style; 44143 this.domOrder = this.rowCtrl.getDomOrder(), en(n, "row"); 44144 const r = { 44145 setDomOrder: (a) => this.domOrder = a, 44146 setCellCtrls: (a) => this.setCellCtrls(a), 44147 showFullWidth: (a) => this.showFullWidth(a), 44148 getFullWidthCellRenderer: () => this.fullWidthCellRenderer, 44149 addOrRemoveCssClass: (a, l) => this.addOrRemoveCssClass(a, l), 44150 setUserStyles: (a) => MO(n, a), 44151 setTop: (a) => o.top = a, 44152 setTransform: (a) => o.transform = a, 44153 setRowIndex: (a) => n.setAttribute("row-index", a), 44154 setRowId: (a) => n.setAttribute("row-id", a), 44155 setRowBusinessKey: (a) => n.setAttribute("row-business-key", a), 44156 refreshFullWidth: (a) => this.fullWidthCellRenderer?.refresh?.(a()) ?? !1 44157 }; 44158 e.setComp(r, this.getGui(), i, void 0), this.addDestroyFunc(() => { 44159 e.unsetComp(i); 44160 }); 44161 } 44162 getInitialStyle(e) { 44163 const t = this.rowCtrl.getInitialTransform(e); 44164 return t ? `transform: ${t}` : `top: ${this.rowCtrl.getInitialRowTop(e)}`; 44165 } 44166 showFullWidth(e) { 44167 const t = (s) => { 44168 if (this.isAlive()) { 44169 const n = s.getGui(); 44170 this.getGui().appendChild(n), this.rowCtrl.setupDetailRowAutoHeight(n), this.setFullWidthRowComp(s); 44171 } else 44172 this.beans.context.destroyBean(s); 44173 }; 44174 e.newAgStackInstance().then(t); 44175 } 44176 setCellCtrls(e) { 44177 const t = Object.assign({}, this.cellComps); 44178 e.forEach((s) => { 44179 const n = s.instanceId; 44180 this.cellComps[n] == null ? this.newCellComp(s) : t[n] = null; 44181 }); 44182 const i = Object.values(t).filter((s) => s != null); 44183 this.destroyCells(i), this.ensureDomOrder(e); 44184 } 44185 ensureDomOrder(e) { 44186 if (!this.domOrder) 44187 return; 44188 const t = []; 44189 e.forEach((i) => { 44190 const s = this.cellComps[i.instanceId]; 44191 s && t.push(s.getGui()); 44192 }), xO(this.getGui(), t); 44193 } 44194 newCellComp(e) { 44195 const t = new sie( 44196 this.beans, 44197 e, 44198 this.rowCtrl.printLayout, 44199 this.getGui(), 44200 this.rowCtrl.editing 44201 ); 44202 this.cellComps[e.instanceId] = t, this.getGui().appendChild(t.getGui()); 44203 } 44204 destroy() { 44205 super.destroy(), this.destroyAllCells(); 44206 } 44207 destroyAllCells() { 44208 const e = Object.values(this.cellComps).filter((t) => t != null); 44209 this.destroyCells(e); 44210 } 44211 setFullWidthRowComp(e) { 44212 this.fullWidthCellRenderer = e, this.addDestroyFunc(() => { 44213 this.fullWidthCellRenderer = this.beans.context.destroyBean(this.fullWidthCellRenderer); 44214 }); 44215 } 44216 destroyCells(e) { 44217 e.forEach((t) => { 44218 if (!t) 44219 return; 44220 const i = t.cellCtrl.instanceId; 44221 this.cellComps[i] === t && (t.detach(), t.destroy(), this.cellComps[i] = null); 44222 }); 44223 } 44224}; 44225function oie(e) { 44226 let t; 44227 return e.type === "center" ? t = /* html */ 44228 `<div class="${e.viewport}" data-ref="eViewport" role="presentation"> 44229 <div class="${e.container}" data-ref="eContainer"></div> 44230 </div>` : t = /* html */ 44231 `<div class="${e.container}" data-ref="eContainer"></div>`, t; 44232} 44233var rie = class extends Tt { 44234 constructor(e) { 44235 super(), this.eViewport = Pe, this.eContainer = Pe, this.rowComps = {}, this.name = e?.name, this.options = Zu(this.name), this.setTemplate(oie(this.options)); 44236 } 44237 postConstruct() { 44238 const e = { 44239 setHorizontalScroll: (i) => this.eViewport.scrollLeft = i, 44240 setViewportHeight: (i) => this.eViewport.style.height = i, 44241 setRowCtrls: ({ rowCtrls: i }) => this.setRowCtrls(i), 44242 setDomOrder: (i) => { 44243 this.domOrder = i; 44244 }, 44245 setContainerWidth: (i) => this.eContainer.style.width = i, 44246 setOffsetTop: (i) => this.eContainer.style.transform = `translateY(${i})` 44247 }; 44248 this.createManagedBean(new Zee(this.name)).setComp(e, this.eContainer, this.eViewport); 44249 } 44250 destroy() { 44251 this.setRowCtrls([]), super.destroy(); 44252 } 44253 setRowCtrls(e) { 44254 const t = { ...this.rowComps }; 44255 this.rowComps = {}, this.lastPlacedElement = null; 44256 const i = (s) => { 44257 const n = s.instanceId, o = t[n]; 44258 if (o) 44259 this.rowComps[n] = o, delete t[n], this.ensureDomOrder(o.getGui()); 44260 else {
44261 if (!s.rowNode.displayed) 44262 return; 44263 const r = new nie(s, this.beans, this.options.type); 44264 this.rowComps[n] = r, this.appendRow(r.getGui()); 44265 } 44266 }; 44267 e.forEach(i), Object.values(t).forEach((s) => { 44268 this.eContainer.removeChild(s.getGui()), s.destroy(); 44269 }), en(this.eContainer, "rowgroup"); 44270 } 44271 appendRow(e) { 44272 this.domOrder ? BQ(this.eContainer, e, this.lastPlacedElement) : this.eContainer.appendChild(e), this.lastPlacedElement = e; 44273 } 44274 ensureDomOrder(e) { 44275 this.domOrder && (SO(this.eContainer, e, this.lastPlacedElement), this.lastPlacedElement = e); 44276 } 44277}, aie = { 44278 selector: "AG-ROW-CONTAINER", 44279 component: rie 44280}; 44281function Rh(e, t) { 44282 return t.map((i) => { 44283 const s = `e${i[0].toUpperCase() + i.substring(1)}RowContainer`; 44284 return e[s] = { name: i }, /* html */ 44285 `<ag-row-container name="${i}" data-ref="${s}"></ag-row-container>`; 44286 }).join(""); 44287} 44288function lie(e) { 44289 const t = {}, i = ( 44290 /* html */ 44291 `<div class="ag-root ag-unselectable" data-ref="eGridRoot"> 44292 <ag-header-root></ag-header-root> 44293 <div class="ag-floating-top" data-ref="eTop" role="presentation"> 44294 ${Rh(t, ["topLeft", "topCenter", "topRight", "topFullWidth"])} 44295 </div> 44296 <div class="ag-body" data-ref="eBody" role="presentation"> 44297 <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation"> 44298 ${Rh(t, ["left", "center", "right", "fullWidth"])} 44299 </div> 44300 <ag-fake-vertical-scroll></ag-fake-vertical-scroll> 44301 </div> 44302 <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation"> 44303 ${Rh(t, ["stickyTopLeft", "stickyTopCenter", "stickyTopRight", "stickyTopFullWidth"])} 44304 </div> 44305 <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation"> 44306 ${Rh(t, ["stickyBottomLeft", "stickyBottomCenter", "stickyBottomRight", "stickyBottomFullWidth"])} 44307 </div> 44308 <div class="ag-floating-bottom" data-ref="eBottom" role="presentation"> 44309 ${Rh(t, ["bottomLeft", "bottomCenter", "bottomRight", "bottomFullWidth"])} 44310 </div> 44311 <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll> 44312 ${e ? ( 44313 /* html */ 44314 "<ag-overlay-wrapper></ag-overlay-wrapper>" 44315 ) : ""} 44316 </div>` 44317 ); 44318 return { paramsMap: t, template: i }; 44319} 44320var cie = class extends Tt { 44321 constructor() { 44322 super(...arguments), this.eGridRoot = Pe, this.eBodyViewport = Pe, this.eStickyTop = Pe, this.eStickyBottom = Pe, this.eTop = Pe, this.eBottom = Pe, this.eBody = Pe; 44323 } 44324 postConstruct() { 44325 const { overlays: e, rangeSvc: t } = this.beans, i = e?.getOverlayWrapperSelector(), { paramsMap: s, template: n } = lie(!!i); 44326 this.setTemplate( 44327 n, 44328 [ 44329 ...i ? [i] : [], 44330 ete, 44331 ite, 44332 iie, 44333 aie 44334 ], 44335 s 44336 ); 44337 const o = (a, l) => { 44338 const c = `${a}px`; 44339 l.style.minHeight = c, l.style.height = c; 44340 }, r = { 44341 setRowAnimationCssOnBodyViewport: (a, l) => this.setRowAnimationCssOnBodyViewport(a, l), 44342 setColumnCount: (a) => RQ(this.getGui(), a), 44343 setRowCount: (a) => IQ(this.getGui(), a), 44344 setTopHeight: (a) => o(a, this.eTop), 44345 setBottomHeight: (a) => o(a, this.eBottom), 44346 setTopDisplay: (a) => this.eTop.style.display = a, 44347 setBottomDisplay: (a) => this.eBottom.style.display = a, 44348 setStickyTopHeight: (a) => this.eStickyTop.style.height = a, 44349 setStickyTopTop: (a) => this.eStickyTop.style.top = a, 44350 setStickyTopWidth: (a) => this.eStickyTop.style.width = a, 44351 setStickyBottomHeight: (a) => { 44352 this.eStickyBottom.style.height = a, this.eStickyBottom.classList.toggle("ag-hidden", a === "0px"); 44353 }, 44354 setStickyBottomBottom: (a) => this.eStickyBottom.style.bottom = a, 44355 setStickyBottomWidth: (a) => this.eStickyBottom.style.width = a, 44356 setColumnMovingCss: (a, l) => this.addOrRemoveCssClass(a, l), 44357 updateLayoutClasses: (a, l) => { 44358 [this.eBodyViewport.classList, this.eBody.classList].forEach((u) => { 44359 u.toggle(No.AUTO_HEIGHT, l.autoHeight), u.toggle(No.NORMAL, l.normal), u.toggle(No.PRINT, l.print); 44360 }), this.addOrRemoveCssClass(No.AUTO_HEIGHT, l.autoHeight), this.addOrRemoveCssClass(No.NORMAL, l.normal), this.addOrRemoveCssClass(No.PRINT, l.print); 44361 }, 44362 setAlwaysVerticalScrollClass: (a, l) => this.eBodyViewport.classList.toggle(IN, l), 44363 registerBodyViewportResizeListener: (a) => { 44364 const l = zl(this.beans, this.eBodyViewport, a); 44365 this.addDestroyFunc(() => l()); 44366 }, 44367 setPinnedTopBottomOverflowY: (a) => this.eTop.style.overflowY = this.eBottom.style.overflowY = a, 44368 setCellSelectableCss: (a, l) => { 44369 [this.eTop, this.eBodyViewport, this.eBottom].forEach( 44370 (c) => c.classList.toggle(a, l) 44371 ); 44372 }, 44373 setBodyViewportWidth: (a) => this.eBodyViewport.style.width = a, 44374 setGridRootRole: (a) => en(this.eGridRoot, a) 44375 };
44376 this.ctrl = this.createManagedBean(new Xee()), this.ctrl.setComp( 44377 r, 44378 this.getGui(), 44379 this.eBodyViewport, 44380 this.eTop, 44381 this.eBottom, 44382 this.eStickyTop, 44383 this.eStickyBottom 44384 ), (t && pa(this.gos) || Yy(this.gos)) && EQ(this.getGui(), !0); 44385 } 44386 setRowAnimationCssOnBodyViewport(e, t) { 44387 const i = this.eBodyViewport.classList; 44388 i.toggle("ag-row-animation", t), i.toggle("ag-row-no-animation", !t); 44389 } 44390}, uie = { 44391 selector: "AG-GRID-BODY", 44392 component: cie 44393}, die = class extends he { 44394 constructor() { 44395 super(...arguments), this.additionalFocusableContainers = /* @__PURE__ */ new Set(); 44396 } 44397 setComp(e, t, i) { 44398 this.view = e, this.eGridHostDiv = t, this.eGui = i, this.eGui.setAttribute("grid-id", this.beans.context.getGridId()); 44399 const { dragAndDrop: s, ctrlsSvc: n } = this.beans; 44400 s?.registerGridDropTarget(() => this.eGui, this), fN(this.gos, t), this.createManagedBean(new hM(this.view)), this.view.setRtlClass(this.gos.get("enableRtl") ? "ag-rtl" : "ag-ltr"); 44401 const o = zl(this.beans, this.eGridHostDiv, this.onGridSizeChanged.bind(this)); 44402 this.addDestroyFunc(() => o()), n.register("gridCtrl", this); 44403 } 44404 isDetailGrid() { 44405 return dN(this.getGui())?.getAttribute("row-id")?.startsWith("detail") || !1; 44406 } 44407 getOptionalSelectors() { 44408 const e = this.beans; 44409 return { 44410 paginationSelector: e.pagination?.getPaginationSelector(), 44411 gridHeaderDropZonesSelector: e.registry.getSelector("AG-GRID-HEADER-DROP-ZONES"), 44412 sideBarSelector: e.sideBar?.getSelector(), 44413 statusBarSelector: e.registry?.getSelector("AG-STATUS-BAR"), 44414 watermarkSelector: e.licenseManager?.getWatermarkSelector() 44415 }; 44416 } 44417 onGridSizeChanged() { 44418 this.eventSvc.dispatchEvent({ 44419 type: "gridSizeChanged", 44420 clientWidth: this.eGridHostDiv.clientWidth, 44421 clientHeight: this.eGridHostDiv.clientHeight 44422 }); 44423 } 44424 destroyGridUi() { 44425 this.view.destroyGridUi(); 44426 } 44427 getGui() { 44428 return this.eGui; 44429 } 44430 setResizeCursor(e) { 44431 this.view.setCursor(e ? "ew-resize" : null); 44432 } 44433 disableUserSelect(e) { 44434 this.view.setUserSelect(e ? "none" : null); 44435 } 44436 focusNextInnerContainer(e) { 44437 const t = this.getFocusableContainers(), { indexWithFocus: i, nextIndex: s } = this.getNextFocusableIndex(t, e); 44438 if (s < 0 || s >= t.length) 44439 return !1; 44440 if (s === 0) { 44441 if (i > 0) { 44442 const { visibleCols: n, focusSvc: o } = this.beans, r = n.allCols, a = It(r); 44443 if (o.focusGridView(a, !0)) 44444 return !0; 44445 } 44446 return !1; 44447 } 44448 return this.focusContainer(t[s], e); 44449 } 44450 focusInnerElement(e) { 44451 const t = this.gos.getCallback("focusGridInnerElement"); 44452 if (t && t({ fromBottom: !!e })) 44453 return !0; 44454 const i = this.getFocusableContainers(), { focusSvc: s, visibleCols: n } = this.beans, o = n.allCols; 44455 if (e) { 44456 if (i.length > 1) 44457 return this.focusContainer(It(i), !0); 44458 const r = It(o); 44459 if (s.focusGridView(r, !0)) 44460 return !0; 44461 } 44462 if (this.gos.get("headerHeight") === 0 || hd(this.beans)) { 44463 if (s.focusGridView(o[0])) 44464 return !0; 44465 for (let r = 1; r < i.length; r++) 44466 if (Gc(i[r].getGui())) 44467 return !0; 44468 return !1; 44469 } 44470 return s.focusFirstHeader(); 44471 } 44472 forceFocusOutOfContainer(e = !1) { 44473 this.view.forceFocusOutOfContainer(e); 44474 } 44475 addFocusableContainer(e) { 44476 this.additionalFocusableContainers.add(e); 44477 } 44478 removeFocusableContainer(e) { 44479 this.additionalFocusableContainers.delete(e); 44480 } 44481 allowFocusForNextCoreContainer(e) { 44482 const t = this.view.getFocusableContainers(), { nextIndex: i, indexWithFocus: s } = this.getNextFocusableIndex(t, e); 44483 if (s === -1 || i < 0 || i >= t.length) 44484 return; 44485 const n = t[i]; 44486 n.setAllowFocus?.(!0), setTimeout(() => { 44487 n.setAllowFocus?.(!1); 44488 }); 44489 } 44490 getNextFocusableIndex(e, t) { 44491 const i = gi(this.beans), s = e.findIndex((o) => o.getGui().contains(i)), n = s + (t ? -1 : 1); 44492 return { 44493 indexWithFocus: s, 44494 nextIndex: n 44495 }; 44496 } 44497 focusContainer(e, t) { 44498 e.setAllowFocus?.(!0); 44499 const i = Gc(e.getGui(), t); 44500 return e.setAllowFocus?.(!1), i; 44501 } 44502 getFocusableContainers() { 44503 return [...this.view.getFocusableContainers(), ...this.additionalFocusableContainers]; 44504 } 44505 destroy() { 44506 this.additionalFocusableContainers.clear(), super.destroy(); 44507 } 44508}, hie = class extends NN { 44509 constructor(e) { 44510 super(), this.gridBody = Pe, this.sideBar = Pe, this.pagination = Pe, this.rootWrapperBody = Pe, this.eGridDiv = e; 44511 } 44512 postConstruct() { 44513 const e = { 44514 destroyGridUi: () => this.destroyBean(this), 44515 setRtlClass: (o) => this.addCssClass(o), 44516 forceFocusOutOfContainer: this.forceFocusOutOfContainer.bind(this), 44517 updateLayoutClasses: this.updateLayoutClasses.bind(this), 44518 getFocusableContainers: this.getFocusableContainers.bind(this), 44519 setUserSelect: (o) => { 44520 this.getGui().style.userSelect = o ?? "", this.getGui().style.webkitUserSelect = o ?? ""; 44521 }, 44522 setCursor: (o) => { 44523 this.getGui().style.cursor = o ?? ""; 44524 } 44525 }, t = this.createManagedBean(new die()), i = t.getOptionalSelectors(), s = this.createTemplate(i), n = [uie, ...Object.values(i).filter((o) => !!o)]; 44526 this.setTemplate(s, n), t.setComp(e, this.eGridDiv, this.getGui()), this.insertGridIntoDom(), this.initialiseTabGuard({ 44527 // we want to override the default behaviour to do nothing for onTabKeyDown 44528 onTabKeyDown: () => { 44529 }, 44530 focusInnerElement: (o) => t.focusInnerElement(o), 44531 forceFocusOutWhenTabGuardsAreEmpty: !0 44532 }); 44533 } 44534 insertGridIntoDom() { 44535 const e = this.getGui(); 44536 this.eGridDiv.appendChild(e), this.addDestroyFunc(() => { 44537 this.eGridDiv.removeChild(e), Ml(this.gos, "Grid removed from DOM"); 44538 }); 44539 } 44540 updateLayoutClasses(e, t) { 44541 const i = this.rootWrapperBody.classList, { AUTO_HEIGHT: s, NORMAL: n, PRINT: o } = No, { autoHeight: r, normal: a, print: l } = t; 44542 i.toggle(s, r), i.toggle(n, a), i.toggle(o, l), this.addOrRemoveCssClass(s, r), this.addOrRemoveCssClass(n, a), this.addOrRemoveCssClass(o, l); 44543 } 44544 createTemplate(e) { 44545 const t = e.gridHeaderDropZonesSelector ? "<ag-grid-header-drop-zones></ag-grid-header-drop-zones>" : "", i = e.sideBarSelector ? '<ag-side-bar data-ref="sideBar"></ag-side-bar>' : "", s = e.statusBarSelector ? "<ag-status-bar></ag-status-bar>" : "", n = e.watermarkSelector ? "<ag-watermark></ag-watermark>" : "", o = e.paginationSelector ? '<ag-pagination data-ref="pagination"></ag-pagination>' : ""; 44546 return ( 44547 /* html */ 44548 `<div class="ag-root-wrapper" role="presentation"> 44549 ${t} 44550 <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation"> 44551 <ag-grid-body data-ref="gridBody"></ag-grid-body> 44552 ${i} 44553 </div> 44554 ${s} 44555 ${o} 44556 ${n} 44557 </div>` 44558 ); 44559 } 44560 getFocusableElement() { 44561 return this.rootWrapperBody; 44562 } 44563 forceFocusOutOfContainer(e = !1) { 44564 if (!e && this.pagination?.isDisplayed()) { 44565 this.pagination.forceFocusOutOfContainer(e); 44566 return; 44567 } 44568 super.forceFocusOutOfContainer(e); 44569 } 44570 getFocusableContainers() { 44571 const e = [this.gridBody];
44572 return [this.sideBar, this.pagination].forEach((t) => { 44573 t && e.push(t); 44574 }), e.filter((t) => Yo(t.getGui())); 44575 } 44576}, et = (e, t) => { 44577 for (const i of Object.keys(t)) 44578 t[i] = e; 44579 return t; 44580}, tT = { 44581 dispatchEvent: "CommunityCore", 44582 // this is always registered 44583 ...et("CommunityCore", { 44584 destroy: 0, 44585 getGridId: 0, 44586 getGridOption: 0, 44587 isDestroyed: 0, 44588 setGridOption: 0, 44589 updateGridOptions: 0 44590 }), 44591 ...et("GridState", { 44592 getState: 0 44593 }), 44594 ...et("SharedRowSelection", { 44595 setNodesSelected: 0, 44596 selectAll: 0, 44597 deselectAll: 0, 44598 selectAllFiltered: 0, 44599 deselectAllFiltered: 0, 44600 selectAllOnCurrentPage: 0, 44601 deselectAllOnCurrentPage: 0, 44602 getSelectedNodes: 0, 44603 getSelectedRows: 0 44604 }), 44605 ...et("RowApi", { 44606 redrawRows: 0, 44607 setRowNodeExpanded: 0, 44608 getRowNode: 0, 44609 addRenderedRowListener: 0, 44610 getRenderedNodes: 0, 44611 forEachNode: 0, 44612 getFirstDisplayedRowIndex: 0, 44613 getLastDisplayedRowIndex: 0, 44614 getDisplayedRowAtIndex: 0, 44615 getDisplayedRowCount: 0 44616 }), 44617 ...et("ScrollApi", { 44618 getVerticalPixelRange: 0, 44619 getHorizontalPixelRange: 0, 44620 ensureColumnVisible: 0, 44621 ensureIndexVisible: 0, 44622 ensureNodeVisible: 0 44623 }), 44624 ...et("KeyboardNavigation", { 44625 getFocusedCell: 0, 44626 clearFocusedCell: 0, 44627 setFocusedCell: 0, 44628 tabToNextCell: 0, 44629 tabToPreviousCell: 0, 44630 setFocusedHeader: 0 44631 }), 44632 ...et("EventApi", { 44633 addEventListener: 0, 44634 addGlobalListener: 0, 44635 removeEventListener: 0, 44636 removeGlobalListener: 0 44637 }), 44638 ...et("ValueCache", { 44639 expireValueCache: 0 44640 }), 44641 ...et("CellApi", { 44642 getCellValue: 0 44643 }), 44644 ...et("SharedMenu", { 44645 showColumnMenu: 0, 44646 hidePopupMenu: 0 44647 }), 44648 ...et("Sort", { 44649 onSortChanged: 0 44650 }), 44651 ...et("PinnedRow", { 44652 getPinnedTopRowCount: 0, 44653 getPinnedBottomRowCount: 0, 44654 getPinnedTopRow: 0, 44655 getPinnedBottomRow: 0 44656 }), 44657 ...et("Overlay", { 44658 showLoadingOverlay: 0, 44659 showNoRowsOverlay: 0, 44660 hideOverlay: 0 44661 }), 44662 ...et("RenderApi", { 44663 setGridAriaProperty: 0, 44664 refreshCells: 0, 44665 refreshHeader: 0, 44666 isAnimationFrameQueueEmpty: 0, 44667 flushAllAnimationFrames: 0, 44668 getSizesForCurrentTheme: 0, 44669 getCellRendererInstances: 0 44670 }), 44671 ...et("HighlightChanges", { 44672 flashCells: 0 44673 }), 44674 ...et("RowDrag", { 44675 addRowDropZone: 0, 44676 removeRowDropZone: 0, 44677 getRowDropZoneParams: 0 44678 }), 44679 ...et("ColumnApi", { 44680 getColumnDefs: 0, 44681 getColumnDef: 0, 44682 getDisplayNameForColumn: 0, 44683 getColumn: 0, 44684 getColumns: 0, 44685 applyColumnState: 0, 44686 getColumnState: 0, 44687 resetColumnState: 0, 44688 isPinning: 0, 44689 isPinningLeft: 0, 44690 isPinningRight: 0, 44691 getDisplayedColAfter: 0, 44692 getDisplayedColBefore: 0, 44693 setColumnsVisible: 0, 44694 setColumnsPinned: 0, 44695 getAllGridColumns: 0, 44696 getDisplayedLeftColumns: 0, 44697 getDisplayedCenterColumns: 0, 44698 getDisplayedRightColumns: 0, 44699 getAllDisplayedColumns: 0, 44700 getAllDisplayedVirtualColumns: 0 44701 }), 44702 ...et("ColumnAutoSize", { 44703 sizeColumnsToFit: 0, 44704 autoSizeColumns: 0, 44705 autoSizeAllColumns: 0 44706 }), 44707 ...et("ColumnGroup", { 44708 setColumnGroupOpened: 0, 44709 getColumnGroup: 0, 44710 getProvidedColumnGroup: 0, 44711 getDisplayNameForColumnGroup: 0, 44712 getColumnGroupState: 0, 44713 setColumnGroupState: 0, 44714 resetColumnGroupState: 0, 44715 getLeftDisplayedColumnGroups: 0, 44716 getCenterDisplayedColumnGroups: 0, 44717 getRightDisplayedColumnGroups: 0, 44718 getAllDisplayedColumnGroups: 0 44719 }), 44720 ...et("ColumnMove", { 44721 moveColumnByIndex: 0, 44722 moveColumns: 0 44723 }), 44724 ...et("ColumnResize", { 44725 setColumnWidths: 0 44726 }), 44727 ...et("ColumnHover", { 44728 isColumnHovered: 0 44729 }), 44730 ...et("EditCore", { 44731 getCellEditorInstances: 0, 44732 getEditingCells: 0, 44733 stopEditing: 0, 44734 startEditingCell: 0 44735 }), 44736 ...et("UndoRedoEdit", { 44737 undoCellEditing: 0, 44738 redoCellEditing: 0, 44739 getCurrentUndoSize: 0, 44740 getCurrentRedoSize: 0 44741 }), 44742 ...et("FilterCore", { 44743 isAnyFilterPresent: 0, 44744 onFilterChanged: 0 44745 }), 44746 ...et("ColumnFilter", { 44747 isColumnFilterPresent: 0, 44748 getColumnFilterInstance: 0, 44749 destroyFilter: 0, 44750 setFilterModel: 0, 44751 getFilterModel: 0, 44752 getColumnFilterModel: 0, 44753 setColumnFilterModel: 0, 44754 showColumnFilter: 0 44755 }), 44756 ...et("QuickFilter", { 44757 isQuickFilterPresent: 0, 44758 getQuickFilter: 0, 44759 resetQuickFilter: 0 44760 }), 44761 ...et("Pagination", { 44762 paginationIsLastPageFound: 0, 44763 paginationGetPageSize: 0, 44764 paginationGetCurrentPage: 0, 44765 paginationGetTotalPages: 0, 44766 paginationGetRowCount: 0, 44767 paginationGoToNextPage: 0, 44768 paginationGoToPreviousPage: 0, 44769 paginationGoToFirstPage: 0, 44770 paginationGoToLastPage: 0, 44771 paginationGoToPage: 0 44772 }), 44773 ...et("CsrmSsrmSharedApi", { 44774 expandAll: 0, 44775 collapseAll: 0, 44776 onRowHeightChanged: 0 44777 }), 44778 ...et("SsrmInfiniteSharedApi", { 44779 setRowCount: 0, 44780 getCacheBlockState: 0, 44781 isLastRowIndexKnown: 0 44782 }), 44783 ...et("ClientSideRowModelApi", { 44784 onGroupExpandedOrCollapsed: 0, 44785 refreshClientSideRowModel: 0, 44786 isRowDataEmpty: 0,
44787 forEachLeafNode: 0, 44788 forEachNodeAfterFilter: 0, 44789 forEachNodeAfterFilterAndSort: 0, 44790 resetRowHeights: 0, 44791 applyTransaction: 0, 44792 applyTransactionAsync: 0, 44793 flushAsyncTransactions: 0, 44794 getBestCostNodeSelection: 0 44795 }), 44796 ...et("CsvExport", { 44797 getDataAsCsv: 0, 44798 exportDataAsCsv: 0 44799 }), 44800 ...et("InfiniteRowModel", { 44801 refreshInfiniteCache: 0, 44802 purgeInfiniteCache: 0, 44803 getInfiniteRowCount: 0 44804 }), 44805 ...et("AdvancedFilter", { 44806 getAdvancedFilterModel: 0, 44807 setAdvancedFilterModel: 0, 44808 showAdvancedFilterBuilder: 0, 44809 hideAdvancedFilterBuilder: 0 44810 }), 44811 ...et("IntegratedCharts", { 44812 getChartModels: 0, 44813 getChartRef: 0, 44814 getChartImageDataURL: 0, 44815 downloadChart: 0, 44816 openChartToolPanel: 0, 44817 closeChartToolPanel: 0, 44818 createRangeChart: 0, 44819 createPivotChart: 0, 44820 createCrossFilterChart: 0, 44821 updateChart: 0, 44822 restoreChart: 0 44823 }), 44824 ...et("Clipboard", { 44825 copyToClipboard: 0, 44826 cutToClipboard: 0, 44827 copySelectedRowsToClipboard: 0, 44828 copySelectedRangeToClipboard: 0, 44829 copySelectedRangeDown: 0, 44830 pasteFromClipboard: 0 44831 }), 44832 ...et("ExcelExport", { 44833 getDataAsExcel: 0, 44834 exportDataAsExcel: 0, 44835 getSheetDataForExcel: 0, 44836 getMultipleSheetsAsExcel: 0, 44837 exportMultipleSheetsAsExcel: 0 44838 }), 44839 ...et("SharedMasterDetail", { 44840 addDetailGridInfo: 0, 44841 removeDetailGridInfo: 0, 44842 getDetailGridInfo: 0, 44843 forEachDetailGridInfo: 0 44844 }), 44845 ...et("ContextMenu", { 44846 showContextMenu: 0 44847 }), 44848 ...et("ColumnMenu", { 44849 showColumnChooser: 0, 44850 hideColumnChooser: 0 44851 }), 44852 ...et("CellSelection", { 44853 getCellRanges: 0, 44854 addCellRange: 0, 44855 clearRangeSelection: 0, 44856 clearCellSelection: 0 44857 }), 44858 ...et("SharedRowGrouping", { 44859 setRowGroupColumns: 0, 44860 removeRowGroupColumns: 0, 44861 addRowGroupColumns: 0, 44862 getRowGroupColumns: 0, 44863 moveRowGroupColumn: 0 44864 }), 44865 ...et("SharedAggregation", { 44866 addAggFuncs: 0, 44867 clearAggFuncs: 0, 44868 setColumnAggFunc: 0 44869 }), 44870 ...et("SharedPivot", { 44871 isPivotMode: 0, 44872 getPivotResultColumn: 0, 44873 setValueColumns: 0, 44874 getValueColumns: 0, 44875 removeValueColumns: 0, 44876 addValueColumns: 0, 44877 setPivotColumns: 0, 44878 removePivotColumns: 0, 44879 addPivotColumns: 0, 44880 getPivotColumns: 0, 44881 setPivotResultColumns: 0, 44882 getPivotResultColumns: 0 44883 }), 44884 ...et("ServerSideRowModelApi", { 44885 getServerSideSelectionState: 0, 44886 setServerSideSelectionState: 0, 44887 applyServerSideTransaction: 0, 44888 applyServerSideTransactionAsync: 0, 44889 applyServerSideRowData: 0, 44890 retryServerSideLoads: 0, 44891 flushServerSideAsyncTransactions: 0, 44892 refreshServerSide: 0, 44893 getServerSideGroupLevelState: 0 44894 }), 44895 ...et("SideBar", { 44896 isSideBarVisible: 0, 44897 setSideBarVisible: 0, 44898 setSideBarPosition: 0, 44899 openToolPanel: 0, 44900 closeToolPanel: 0, 44901 getOpenedToolPanel: 0, 44902 refreshToolPanel: 0, 44903 isToolPanelShowing: 0, 44904 getToolPanelInstance: 0, 44905 getSideBar: 0 44906 }), 44907 ...et("StatusBar", { 44908 getStatusPanel: 0 44909 }) 44910}, T0 = { 44911 isDestroyed: () => !0, 44912 destroy() { 44913 }, 44914 preConstruct() { 44915 }, 44916 postConstruct() { 44917 }, 44918 preWireBeans() { 44919 }, 44920 wireBeans() { 44921 } 44922}, pie = (e, t) => e.eventSvc.dispatchEvent(t), BN = class { 44923}; 44924Reflect.defineProperty(BN, "name", { value: "GridApi" }); 44925var gie = class extends he { 44926 constructor() { 44927 super(), this.beanName = "apiFunctionSvc", this.api = new BN(), this.fns = { 44928 ...T0, 44929 // dispatchEvent is used by frameworks, also used by aligned grids to identify a grid api instance 44930 dispatchEvent: pie 44931 }, this.preDestroyLink = ""; 44932 const { api: e } = this; 44933 for (const t of Object.keys(tT)) 44934 e[t] = this.makeApi(t)[t]; 44935 } 44936 postConstruct() { 44937 this.preDestroyLink = this.beans.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed"); 44938 } 44939 addFunction(e, t) { 44940 const { fns: i, beans: s } = this; 44941 i !== T0 && (i[e] = s?.validation?.validateApiFunction(e, t) ?? t); 44942 } 44943 makeApi(e) { 44944 return { 44945 [e]: (...t) => { 44946 const { 44947 beans: i, 44948 fns: { [e]: s } 44949 } = this; 44950 return s ? s(i, ...t) : this.apiNotFound(e); 44951 } 44952 }; 44953 } 44954 apiNotFound(e) { 44955 const { beans: t, gos: i, preDestroyLink: s } = this; 44956 if (!t) 44957 Ae(26, { fnName: e, preDestroyLink: s }); 44958 else { 44959 const n = tT[e]; 44960 i.assertModuleRegistered(n, `api.${e}`) && Ae(27, { fnName: e, module: n }); 44961 } 44962 } 44963 destroy() { 44964 super.destroy(), this.fns = T0, this.beans = null; 44965 } 44966}; 44967function fie(e) { 44968 return e.context.getGridId(); 44969} 44970function mie(e) { 44971 e.gridDestroySvc.destroy(); 44972} 44973function vie(e) { 44974 return e.gridDestroySvc.destroyCalled; 44975} 44976function yie(e, t) { 44977 return e.gos.get(t); 44978} 44979function Cie(e, t, i) { 44980 GN(e, { [t]: i }); 44981} 44982function GN(e, t) { 44983 e.gos.updateGridOptions({ options: t }); 44984} 44985var bie = class extends Tt { 44986 constructor(e, t, i) { 44987 super( 44988 /* html */ 44989 '<div class="ag-drag-handle ag-row-drag" draggable="true"></div>' 44990 ), this.rowNode = e, this.column = t, this.eCell = i; 44991 } 44992 postConstruct() {
44993 this.getGui().appendChild(po("rowDrag", this.beans, null)), this.addGuiEventListener("mousedown", (t) => { 44994 t.stopPropagation(); 44995 }), this.addDragSource(), this.checkVisibility(); 44996 } 44997 addDragSource() { 44998 this.addGuiEventListener("dragstart", this.onDragStart.bind(this)); 44999 } 45000 onDragStart(e) { 45001 const { rowNode: t, column: i, eCell: s, gos: n } = this, o = i.getColDef().dndSourceOnRowDrag, r = e.dataTransfer; 45002 if (r.setDragImage(s, 0, 0), o) { 45003 const a = n.addGridCommonParams({ 45004 rowNode: t, 45005 dragEvent: e 45006 }); 45007 o(a); 45008 } else 45009 try { 45010 const a = JSON.stringify(t.data); 45011 r.setData("application/json", a), r.setData("text/plain", a); 45012 } catch { 45013 } 45014 } 45015 checkVisibility() { 45016 const e = this.column.isDndSource(this.rowNode); 45017 this.setDisplayed(e); 45018 } 45019}; 45020function wie(e, t) { 45021 e.rowDragSvc?.rowDragFeature?.addRowDropZone(t); 45022} 45023function Sie(e, t) { 45024 const i = e.dragAndDrop?.findExternalZone(t); 45025 i && e.dragAndDrop?.removeDropTarget(i); 45026} 45027function xie(e, t) { 45028 return e.rowDragSvc?.rowDragFeature?.getRowDropZone(t); 45029} 45030var Mie = class extends he { 45031 constructor() { 45032 super(...arguments), this.beanName = "horizontalResizeSvc"; 45033 } 45034 addResizeBar(e) { 45035 const t = { 45036 dragStartPixels: e.dragStartPixels || 0, 45037 eElement: e.eResizeBar, 45038 onDragStart: this.onDragStart.bind(this, e), 45039 onDragStop: this.onDragStop.bind(this, e), 45040 onDragging: this.onDragging.bind(this, e), 45041 onDragCancel: this.onDragStop.bind(this, e), 45042 includeTouch: !0, 45043 stopPropagationForTouch: !0 45044 }, { dragSvc: i } = this.beans; 45045 return i.addDragSource(t), () => i.removeDragSource(t); 45046 } 45047 onDragStart(e, t) { 45048 this.dragStartX = t.clientX, this.setResizeIcons(); 45049 const i = t instanceof MouseEvent && t.shiftKey === !0; 45050 e.onResizeStart(i); 45051 } 45052 setResizeIcons() { 45053 const e = this.beans.ctrlsSvc.get("gridCtrl"); 45054 e.setResizeCursor(!0), e.disableUserSelect(!0); 45055 } 45056 onDragStop(e) { 45057 e.onResizeEnd(this.resizeAmount), this.resetIcons(); 45058 } 45059 resetIcons() { 45060 const e = this.beans.ctrlsSvc.get("gridCtrl"); 45061 e.setResizeCursor(!1), e.disableUserSelect(!1); 45062 } 45063 onDragging(e, t) { 45064 this.resizeAmount = t.clientX - this.dragStartX, e.onResizing(this.resizeAmount); 45065 } 45066}, Aie = class extends Tt { 45067 constructor(e, t, i, s, n, o) { 45068 super(), this.cellValueFn = e, this.rowNode = t, this.column = i, this.customGui = s, this.dragStartPixels = n, this.suppressVisibilityChange = o, this.dragSource = null; 45069 } 45070 isCustomGui() { 45071 return this.customGui != null; 45072 } 45073 postConstruct() { 45074 const { beans: e, rowNode: t, column: i, gos: s } = this; 45075 if (this.customGui ? this.setDragElement(this.customGui, this.dragStartPixels) : (this.setTemplate( 45076 /* html */ 45077 '<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>' 45078 ), this.getGui().appendChild(po("rowDrag", e, null)), this.addDragSource()), !this.suppressVisibilityChange) { 45079 const n = s.get("rowDragManaged") ? new Eie(this, t, i) : new Die(this, t, i); 45080 this.createManagedBean(n, this.beans.context); 45081 } 45082 } 45083 setDragElement(e, t) { 45084 this.setTemplateFromElement(e, void 0, void 0, !0), this.addDragSource(t); 45085 } 45086 getSelectedNodes() { 45087 const e = this.rowNode; 45088 if (!this.gos.get("rowDragMultiRow")) 45089 return [e]; 45090 const i = this.beans.selectionSvc?.getSelectedNodes() ?? []; 45091 return i.indexOf(e) !== -1 ? i : [e]; 45092 } 45093 getDragItem() { 45094 const { column: e, rowNode: t } = this; 45095 return { 45096 rowNode: t, 45097 rowNodes: this.getSelectedNodes(), 45098 columns: e ? [e] : void 0, 45099 defaultTextValue: this.cellValueFn() 45100 }; 45101 } 45102 getRowDragText(e) { 45103 if (e) { 45104 const t = e.getColDef(); 45105 if (t.rowDragText) 45106 return t.rowDragText; 45107 } 45108 return this.gos.get("rowDragText"); 45109 } 45110 addDragSource(e = 4) { 45111 this.dragSource && this.removeDragSource(); 45112 const t = this.getGui(); 45113 this.gos.get("enableCellTextSelection") && (this.removeMouseDownListener(), this.mouseDownListener = this.addManagedElementListeners(t, { 45114 mousedown: (s) => { 45115 s?.preventDefault(); 45116 } 45117 })[0]); 45118 const i = this.getLocaleTextFunc(); 45119 this.dragSource = { 45120 type: 2, 45121 eElement: t, 45122 dragItemName: () => { 45123 const s = this.getDragItem(), n = s.rowNodes?.length || 1, o = this.getRowDragText(this.column); 45124 return o ? o(s, n) : n === 1 ? this.cellValueFn() : `${n} ${i("rowDragRows", "rows")}`; 45125 }, 45126 getDragItem: () => this.getDragItem(), 45127 dragStartPixels: e, 45128 dragSourceDomDataKey: this.gos.getDomDataKey() 45129 }, this.beans.dragAndDrop.addDragSource(this.dragSource, !0); 45130 } 45131 destroy() { 45132 this.removeDragSource(), this.removeMouseDownListener(), super.destroy(); 45133 } 45134 removeDragSource() { 45135 this.dragSource && (this.beans.dragAndDrop.removeDragSource(this.dragSource), this.dragSource = null); 45136 } 45137 removeMouseDownListener() { 45138 this.mouseDownListener && (this.mouseDownListener(), this.mouseDownListener = void 0); 45139 } 45140}, zN = class extends he {
45141 constructor(e, t, i) { 45142 super(), this.parent = e, this.rowNode = t, this.column = i; 45143 } 45144 setDisplayedOrVisible(e) { 45145 const t = { skipAriaHidden: !0 }; 45146 if (e) 45147 this.parent.setDisplayed(!1, t); 45148 else { 45149 let i = !0, s = !1; 45150 const { column: n, rowNode: o, parent: r } = this; 45151 n && (i = n.isRowDrag(o) || r.isCustomGui(), s = typeof n.getColDef().rowDrag == "function"), s ? (r.setDisplayed(!0, t), r.setVisible(i, t)) : (r.setDisplayed(i, t), r.setVisible(!0, t)); 45152 } 45153 } 45154}, Die = class extends zN { 45155 postConstruct() { 45156 this.addManagedPropertyListener("suppressRowDrag", this.onSuppressRowDrag.bind(this)); 45157 const e = this.workOutVisibility.bind(this); 45158 this.addManagedListeners(this.rowNode, { 45159 dataChanged: e, 45160 cellChanged: e 45161 }), this.addManagedListeners(this.beans.eventSvc, { newColumnsLoaded: e }), this.workOutVisibility(); 45162 } 45163 onSuppressRowDrag() { 45164 this.workOutVisibility(); 45165 } 45166 workOutVisibility() { 45167 const e = this.gos.get("suppressRowDrag"); 45168 this.setDisplayedOrVisible(e); 45169 } 45170}, Eie = class extends zN { 45171 postConstruct() { 45172 const e = this.workOutVisibility.bind(this); 45173 this.addManagedListeners(this.beans.eventSvc, { 45174 sortChanged: e, 45175 filterChanged: e, 45176 columnRowGroupChanged: e, 45177 newColumnsLoaded: e 45178 }), this.addManagedListeners(this.rowNode, { 45179 dataChanged: e, 45180 cellChanged: e 45181 }), this.addManagedPropertyListener("suppressRowDrag", this.onSuppressRowDrag.bind(this)), this.workOutVisibility(); 45182 } 45183 onSuppressRowDrag() { 45184 this.workOutVisibility(); 45185 } 45186 workOutVisibility() { 45187 const { rowDragSvc: e, dragAndDrop: t, gos: i } = this.beans, s = e.rowDragFeature, n = s && s.shouldPreventRowMove(), o = i.get("suppressRowDrag"), r = t.hasExternalDropZones(), a = n && !r || o; 45188 this.setDisplayedOrVisible(a); 45189 } 45190}, Iie = class extends he { 45191 constructor() { 45192 super(...arguments), this.beanName = "rowDragSvc"; 45193 } 45194 setupRowDrag(e, t) { 45195 const i = t.createManagedBean(new vee(e)), s = this.beans.dragAndDrop; 45196 s.addDropTarget(i), t.addDestroyFunc(() => s.removeDropTarget(i)), this.rowDragFeature = i; 45197 } 45198 createRowDragComp(e, t, i, s, n, o) { 45199 return new Aie(e, t, i, s, n, o); 45200 } 45201 createRowDragCompForRow(e, t) { 45202 if (pa(this.gos)) 45203 return; 45204 const i = this.getLocaleTextFunc(); 45205 return this.createRowDragComp( 45206 () => `1 ${i("rowDragRow", "row")}`, 45207 e, 45208 void 0, 45209 t, 45210 void 0, 45211 !0 45212 ); 45213 } 45214 createRowDragCompForCell(e, t, i, s, n, o) { 45215 const r = this.gos; 45216 return r.get("rowDragManaged") && (!$s(r) || r.get("pagination")) ? void 0 : this.createRowDragComp( 45217 i, 45218 e, 45219 t, 45220 s, 45221 n, 45222 o 45223 ); 45224 } 45225}, HN = { 45226 moduleName: "Drag", 45227 version: Fe, 45228 beans: [yee] 45229}, Rie = { 45230 moduleName: "DragAndDrop", 45231 version: Fe, 45232 dynamicBeans: { 45233 dndSourceComp: bie 45234 }, 45235 icons: { 45236 // drag handle used to pick up draggable rows 45237 rowDrag: "grip" 45238 } 45239}, VN = { 45240 moduleName: "SharedDragAndDrop", 45241 version: Fe, 45242 beans: [uee], 45243 dependsOn: [HN], 45244 userComponents: { 45245 agDragAndDropImage: wte 45246 }, 45247 icons: { 45248 // shown on drag and drop image component icon while dragging column to the side of the grid to pin 45249 columnMovePin: "pin", 45250 // shown on drag and drop image component icon while dragging over part of the page that is not a drop zone 45251 columnMoveHide: "eye-slash", 45252 // shown on drag and drop image component icon while dragging columns to reorder 45253 columnMoveMove: "arrows", 45254 // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling 45255 columnMoveLeft: "left", 45256 // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling 45257 columnMoveRight: "right", 45258 // shown on drag and drop image component icon while dragging over Row Groups drop zone 45259 columnMoveGroup: "group", 45260 // shown on drag and drop image component icon while dragging over Values drop zone 45261 columnMoveValue: "aggregation", 45262 // shown on drag and drop image component icon while dragging over pivot drop zone 45263 columnMovePivot: "pivot", 45264 // shown on drag and drop image component icon while dragging over drop zone that doesn't support it, e.g. 45265 // string column over aggregation drop zone 45266 dropNotAllowed: "not-allowed", 45267 // drag handle used to pick up draggable rows 45268 rowDrag: "grip" 45269 } 45270}, Tie = { 45271 moduleName: "RowDrag", 45272 version: Fe, 45273 beans: [Iie],
45274 apiFunctions: { 45275 addRowDropZone: wie, 45276 removeRowDropZone: Sie, 45277 getRowDropZoneParams: xie 45278 }, 45279 dependsOn: [VN] 45280}, Lie = { 45281 moduleName: "HorizontalResize", 45282 version: Fe, 45283 beans: [Mie], 45284 dependsOn: [HN] 45285}, kie = ( 45286 /*css*/ 45287 ":where(.ag-ltr) :where(.ag-column-moving){.ag-cell,.ag-header-cell{transition:left .2s}.ag-header-group-cell{transition:left .2s,width .2s}}:where(.ag-rtl) :where(.ag-column-moving){.ag-cell,.ag-header-cell{transition:right .2s}.ag-header-group-cell{transition:right .2s,width .2s}}" 45288), Pie = class extends he { 45289 constructor() { 45290 super(...arguments), this.beanName = "colAnimation", this.executeNextFuncs = [], this.executeLaterFuncs = [], this.active = !1, this.activeNext = !1, this.suppressAnimation = !1, this.animationThreadCount = 0; 45291 } 45292 postConstruct() { 45293 this.beans.ctrlsSvc.whenReady(this, (e) => this.gridBodyCtrl = e.gridBodyCtrl); 45294 } 45295 isActive() { 45296 return this.active && !this.suppressAnimation; 45297 } 45298 setSuppressAnimation(e) { 45299 this.suppressAnimation = e; 45300 } 45301 start() { 45302 if (this.active) 45303 return; 45304 const { gos: e } = this; 45305 e.get("suppressColumnMoveAnimation") || e.get("enableRtl") || (this.ensureAnimationCssClassPresent(), this.active = !0, this.activeNext = !0); 45306 } 45307 finish() { 45308 this.active && this.flush( 45309 () => this.activeNext = !1, 45310 () => this.active = !1 45311 ); 45312 } 45313 executeNextVMTurn(e) { 45314 this.activeNext ? this.executeNextFuncs.push(e) : e(); 45315 } 45316 executeLaterVMTurn(e) { 45317 this.active ? this.executeLaterFuncs.push(e) : e(); 45318 } 45319 ensureAnimationCssClassPresent() { 45320 this.animationThreadCount++; 45321 const e = this.animationThreadCount, { gridBodyCtrl: t } = this; 45322 t.setColumnMovingCss(!0), this.executeLaterFuncs.push(() => { 45323 this.animationThreadCount === e && t.setColumnMovingCss(!1); 45324 }); 45325 } 45326 flush(e, t) { 45327 const { executeNextFuncs: i, executeLaterFuncs: s } = this; 45328 if (i.length === 0 && s.length === 0) { 45329 e(), t(); 45330 return; 45331 } 45332 const n = (o) => { 45333 for (; o.length; ) { 45334 const r = o.pop(); 45335 r && r(); 45336 } 45337 }; 45338 this.beans.frameworkOverrides.wrapIncoming(() => { 45339 window.setTimeout(() => { 45340 e(), n(i); 45341 }, 0), window.setTimeout(() => { 45342 t(), n(s); 45343 }, 200); 45344 }); 45345 } 45346}; 45347function Fie(e, t, i) { 45348 e.colMoves?.moveColumnByIndex(t, i, "api"); 45349} 45350function Oie(e, t, i) { 45351 e.colMoves?.moveColumns(t, i, "api"); 45352} 45353var Nie = class extends he { 45354 constructor(e) { 45355 super(), this.pinned = e, this.columnsToAggregate = [], this.columnsToGroup = [], this.columnsToPivot = []; 45356 } 45357 /** Callback for when drag enters */ 45358 onDragEnter(e) { 45359 if (this.clearColumnsList(), this.gos.get("functionsReadOnly")) 45360 return; 45361 const t = e.dragItem.columns; 45362 t && t.forEach((i) => { 45363 i.isPrimary() && (i.isAnyFunctionActive() || (i.isAllowValue() ? this.columnsToAggregate.push(i) : i.isAllowRowGroup() ? this.columnsToGroup.push(i) : i.isAllowPivot() && this.columnsToPivot.push(i))); 45364 }); 45365 } 45366 getIconName() { 45367 return this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length > 0 ? this.pinned ? "pinned" : "move" : null; 45368 } 45369 /** Callback for when drag leaves */ 45370 // eslint-disable-next-line @typescript-eslint/no-unused-vars 45371 onDragLeave(e) { 45372 this.clearColumnsList(); 45373 } 45374 clearColumnsList() { 45375 this.columnsToAggregate.length = 0, this.columnsToGroup.length = 0, this.columnsToPivot.length = 0; 45376 } 45377 /** Callback for when dragging */ 45378 // eslint-disable-next-line @typescript-eslint/no-unused-vars 45379 onDragging(e) { 45380 } 45381 /** Callback for when drag stops */ 45382 // eslint-disable-next-line @typescript-eslint/no-unused-vars 45383 onDragStop(e) { 45384 const { valueColsSvc: t, rowGroupColsSvc: i, pivotColsSvc: s } = this.beans; 45385 this.columnsToAggregate.length > 0 && t?.addColumns(this.columnsToAggregate, "toolPanelDragAndDrop"), this.columnsToGroup.length > 0 && i?.addColumns(this.columnsToGroup, "toolPanelDragAndDrop"), this.columnsToPivot.length > 0 && s?.addColumns(this.columnsToPivot, "toolPanelDragAndDrop"); 45386 } 45387 onDragCancel() { 45388 this.clearColumnsList(); 45389 } 45390}; 45391function _ie(e, t) { 45392 !t || t.length <= 1 || t.filter((s) => e.indexOf(s) < 0).length > 0 || t.sort((s, n) => { 45393 const o = e.indexOf(s), r = e.indexOf(n); 45394 return o - r; 45395 }); 45396} 45397function UN(e) { 45398 const { isFromHeader: t, fromLeft: i, xPosition: s, fromEnter: n, fakeEvent: o, pinned: r, gos: a, c
45398olModel: l, colMoves: c, visibleCols: u } = e; 45399 let { allMovingColumns: d } = e; 45400 if (t) { 45401 const I = []; 45402 d.forEach((L) => { 45403 let k = null, B = L.getParent(); 45404 for (; B != null && B.getDisplayedLeafColumns().length === 1; ) 45405 k = B, B = B.getParent(); 45406 k != null ? (!!k.getColGroupDef()?.marryChildren ? ( 45407 // when marry children is true, we also have to move hidden 45408 // columns within the group, so grab them from the `providedColumnGroup` 45409 k.getProvidedColumnGroup().getLeafColumns() 45410 ) : k.getLeafColumns()).forEach((se) => { 45411 I.includes(se) || I.push(se); 45412 }) : I.includes(L) || I.push(L); 45413 }), d = I; 45414 } 45415 const p = d.slice(); 45416 _ie(l.getCols(), p); 45417 const f = Hie({ 45418 movingCols: p, 45419 draggingRight: i, 45420 xPosition: s, 45421 pinned: r, 45422 gos: a, 45423 colModel: l, 45424 visibleCols: u 45425 }), m = Bie(p, l); 45426 if (f.length === 0) 45427 return; 45428 const y = f[0]; 45429 let b = m !== null && !n; 45430 if (t && (b = m !== null), b && !o && (!i && y >= m || i && y <= m)) 45431 return; 45432 const C = u.allCols, w = []; 45433 let M = null; 45434 for (let I = 0; I < f.length; I++) { 45435 const L = f[I], k = c.getProposedColumnOrder(p, L); 45436 if (!c.doesOrderPassRules(k)) 45437 continue; 45438 const B = k.filter((W) => C.includes(W)); 45439 if (M === null) 45440 M = B; 45441 else if (!tu(B, M)) 45442 break; 45443 const N = Gie(k); 45444 w.push({ move: L, fragCount: N }); 45445 } 45446 if (w.length === 0) 45447 return; 45448 w.sort((I, L) => I.fragCount - L.fragCount); 45449 const A = w[0].move; 45450 if (!(A > l.getCols().length - d.length)) 45451 return { columns: d, toIndex: A }; 45452} 45453function WN(e) { 45454 const { columns: t, toIndex: i } = UN(e) || {}, { finished: s, colMoves: n } = e; 45455 return !t || i == null ? null : (n.moveColumns(t, i, "uiColumnMoved", s), s ? null : { columns: t, toIndex: i }); 45456} 45457function Bie(e, t) { 45458 const i = t.getCols(), s = MX(e.map((l) => i.indexOf(l))), n = s[0]; 45459 return It(s) - n !== s.length - 1 ? null : n; 45460} 45461function Gie(e) { 45462 function t(s) { 45463 const n = []; 45464 let o = s.getOriginalParent(); 45465 for (; o != null; ) 45466 n.push(o), o = o.getOriginalParent(); 45467 return n; 45468 } 45469 let i = 0; 45470 for (let s = 0; s < e.length - 1; s++) { 45471 let n = t(e[s]), o = t(e[s + 1]); 45472 [n, o] = n.length > o.length ? [n, o] : [o, n], n.forEach((r) => { 45473 o.indexOf(r) === -1 && i++; 45474 }); 45475 } 45476 return i; 45477} 45478function zie(e, t) { 45479 switch (t) { 45480 case "left": 45481 return e.leftCols; 45482 case "right": 45483 return e.rightCols; 45484 default: 45485 return e.centerCols; 45486 } 45487} 45488function Hie(e) { 45489 const { movingCols: t, draggingRight: i, xPosition: s, pinned: n, gos: o, colModel: r, visibleCols: a } = e; 45490 if (o.get("suppressMovableColumns") || t.some((M) => M.getColDef().suppressMovable)) 45491 return []; 45492 const c = zie(a, n), u = r.getCols(), d = c.filter((M) => t.includes(M)), p = c.filter((M) => !t.includes(M)), f = u.filter((M) => !t.includes(M)); 45493 let m = 0, y = s; 45494 if (i) { 45495 let M = 0; 45496 d.forEach((A) => M += A.getActualWidth()), y -= M; 45497 } 45498 if (y > 0) { 45499 for (let M = 0; M < p.length; M++) { 45500 const A = p[M]; 45501 if (y -= A.getActualWidth(), y < 0) 45502 break; 45503 m++; 45504 } 45505 i && m++; 45506 } 45507 let b; 45508 if (m > 0) { 45509 const M = p[m - 1]; 45510 b = f.indexOf(M) + 1; 45511 } else 45512 b = f.indexOf(p[0]), b === -1 && (b = 0); 45513 const C = [b], w = (M, A) => M - A; 45514 if (i) { 45515 let M = b + 1; 45516 const A = u.length - 1; 45517 for (; M <= A; ) 45518 C.push(M), M++; 45519 C.sort(w); 45520 } else { 45521 let M = b; 45522 const A = u.length - 1; 45523 let I = u[M]; 45524 for (; M <= A && c.indexOf(I) < 0; ) 45525 M++, C.push(M), I = u[M]; 45526 M = b - 1; 45527 const L = 0; 45528 for (; M >= L; ) 45529 C.push(M), M--; 45530 C.sort(w).reverse(); 45531 } 45532 return C; 45533} 45534function iS(e) { 45535 const { pinned: t, fromKeyboard: i, gos: s, ctrlsSvc: n, useHeaderRow: o, skipScrollPadding: r } = e; 45536 let a = n.getHeaderRowContainerCtrl(t)?.eViewport, { x: l } = e; 45537 return a ? (i && (l -= a.getBoundingClientRect().left), s.get("enableRtl") && (o && (a = a.querySelector(".ag-header-row")), l = a.clientWidth - l), t == null && !r && (l += n.get("center").getCenterViewportScrollLeft()), l) : 0; 45538} 45539function L0(e, t) { 45540 for (const i of e) 45541 i.moving = t, i.dispatchColEvent("movingChanged", "uiColumnMoved"); 45542} 45543var iT = 7, sS = 100, Kf = sS / 2, Vie = 5, Uie = 100, Wie = class extends he {
45544 constructor(e) { 45545 super(), this.pinned = e, this.needToMoveLeft = !1, this.needToMoveRight = !1, this.lastMovedInfo = null, this.isCenterContainer = !Ie(e); 45546 } 45547 postConstruct() { 45548 this.beans.ctrlsSvc.whenReady(this, (e) => { 45549 this.gridBodyCon = e.gridBodyCtrl; 45550 }); 45551 } 45552 getIconName() { 45553 const { pinned: e, lastDraggingEvent: t } = this, i = t?.dragItem.columns ?? []; 45554 for (const s of i) { 45555 const n = s.getPinned(); 45556 if (s.getColDef().lockPinned) { 45557 if (n == e) 45558 return "move"; 45559 continue; 45560 } 45561 if (n === e || !e) 45562 return "move"; 45563 if (!n && e) 45564 return "pinned"; 45565 } 45566 return "notAllowed"; 45567 } 45568 onDragEnter(e) { 45569 const t = e.dragItem, i = t.columns; 45570 if (e.dragSource.type === 0) 45571 this.setColumnsVisible(i, !0, "uiColumnDragged"); 45572 else { 45573 const n = t.visibleState, o = (i || []).filter((r) => n[r.getId()]); 45574 this.setColumnsVisible(o, !0, "uiColumnDragged"); 45575 } 45576 this.gos.get("suppressMoveWhenColumnDragging") || this.attemptToPinColumns(i, this.pinned), this.onDragging(e, !0, !0); 45577 } 45578 onDragging(e = this.lastDraggingEvent, t = !1, i = !1, s = !1) {
45579 const { gos: n, ctrlsSvc: o } = this.beans, r = n.get("suppressMoveWhenColumnDragging"); 45580 if (s && !r) { 45581 this.finishColumnMoving(); 45582 return; 45583 } 45584 if (this.lastDraggingEvent = e, !e || !s && ai(e.hDirection)) 45585 return; 45586 const a = iS({ 45587 x: e.x, 45588 pinned: this.pinned, 45589 gos: n, 45590 ctrlsSvc: o 45591 }); 45592 t || this.checkCenterForScrolling(a), r ? this.handleColumnDragWhileSuppressingMovement(e, t, i, a, s) : this.handleColumnDragWhileAllowingMovement(e, t, i, a, s); 45593 } 45594 onDragLeave() { 45595 this.ensureIntervalCleared(), this.clearHighlighted(), this.lastMovedInfo = null; 45596 } 45597 onDragStop() { 45598 this.onDragging(this.lastDraggingEvent, !1, !0, !0), this.ensureIntervalCleared(), this.lastMovedInfo = null; 45599 } 45600 onDragCancel() { 45601 this.clearHighlighted(), this.ensureIntervalCleared(), this.lastMovedInfo = null; 45602 } 45603 setColumnsVisible(e, t, i) { 45604 if (!e) 45605 return; 45606 const s = e.filter((n) => !n.getColDef().lockVisible); 45607 this.beans.colModel.setColsVisible(s, t, i); 45608 } 45609 finishColumnMoving() { 45610 this.clearHighlighted(); 45611 const e = this.lastMovedInfo; 45612 if (!e) 45613 return; 45614 const { columns: t, toIndex: i } = e; 45615 this.beans.colMoves.moveColumns(t, i, "uiColumnMoved", !0); 45616 } 45617 handleColumnDragWhileSuppressingMovement(e, t, i, s, n) { 45618 const o = this.getAllMovingColumns(e, !0); 45619 if (n) { 45620 const r = this.isAttemptingToPin(o); 45621 r && this.attemptToPinColumns(o, void 0, !0); 45622 const { fromLeft: a, xPosition: l } = this.getNormalisedXPositionInfo(o, r) || {}; 45623 if (a == null || l == null) { 45624 this.finishColumnMoving(); 45625 return; 45626 } 45627 this.moveColumnsAfterHighlight({ 45628 allMovingColumns: o, 45629 xPosition: l, 45630 fromEnter: t, 45631 fakeEvent: i, 45632 fromLeft: a 45633 }); 45634 } else { 45635 if (!this.beans.dragAndDrop.isDropZoneWithinThisGrid(e)) 45636 return; 45637 this.highlightHoveredColumn(o, s); 45638 } 45639 } 45640 handleColumnDragWhileAllowingMovement(e, t, i, s, n) { 45641 const o = this.getAllMovingColumns(e), r = this.normaliseDirection(e.hDirection) === "right", a = e.dragSource.type === 1, l = this.getMoveColumnParams({ 45642 allMovingColumns: o, 45643 isFromHeader: a, 45644 xPosition: s, 45645 fromLeft: r, 45646 fromEnter: t, 45647 fakeEvent: i 45648 }), c = WN({ ...l, finished: n }); 45649 c && (this.lastMovedInfo = c); 45650 } 45651 getAllMovingColumns(e, t = !1) { 45652 const i = e.dragSource.getDragItem(); 45653 let s = null; 45654 t ? (s = i.columnsInSplit, s || (s = i.columns)) : s = i.columns; 45655 const n = (o) => o.getColDef().lockPinned ? o.getPinned() == this.pinned : !0; 45656 return s ? s.filter(n) : []; 45657 } 45658 getMoveColumnParams(e) { 45659 const { allMovingColumns: t, isFromHeader: i, xPosition: s, fromLeft: n, fromEnter: o, fakeEvent: r } = e, { gos: a, colModel: l, colMoves: c, visibleCols: u } = this.beans; 45660 return { 45661 allMovingColumns: t, 45662 isFromHeader: i, 45663 fromLeft: n, 45664 xPosition: s, 45665 pinned: this.pinned, 45666 fromEnter: o, 45667 fakeEvent: r, 45668 gos: a, 45669 colModel: l, 45670 colMoves: c, 45671 visibleCols: u 45672 }; 45673 } 45674 highlightHoveredColumn(e, t) { 45675 const { gos: i, colModel: s } = this.beans, n = i.get("enableRtl"), o = s.getCols().filter((u) => u.isVisible() && u.getPinned() === this.pinned); 45676 let r = null, a = null, l = null; 45677 for (const u of o) { 45678 if (a = u.getActualWidth(), r = this.getNormalisedColumnLeft(u, 0, n), r != null) { 45679 const d = r + a; 45680 if (r <= t && d >= t) { 45681 l = u; 45682 break; 45683 } 45684 } 45685 r = null, a = null; 45686 } 45687 if (l) 45688 e.indexOf(l) !== -1 && (l = null); 45689 else { 45690 for (let u = o.length - 1; u >= 0; u--) { 45691 const d = o[u], p = o[u].getParent(); 45692 if (!p) { 45693 l = d; 45694 break; 45695 } 45696 const f = p?.getDisplayedLeafColumns(); 45697 if (f.length) { 45698 l = It(f); 45699 break; 45700 } 45701 } 45702 if (!l) 45703 return; 45704 r = this.getNormalisedColumnLeft(l, 0, n), a = l.getActualWidth(); 45705 } 45706 if (this.lastHighlightedColumn?.column !== l && this.clearHighlighted(), l == null || r == null || a == null) 45707 return;
45708 let c; 45709 t - r < a / 2 !== n ? c = 0 : c = 1, sT(l, c), this.lastHighlightedColumn = { column: l, position: c }; 45710 } 45711 getNormalisedXPositionInfo(e, t) { 45712 const { gos: i, visibleCols: s } = this.beans, n = i.get("enableRtl"), { firstMovingCol: o, column: r, position: a } = this.getColumnMoveAndTargetInfo( 45713 e, 45714 t, 45715 n 45716 ); 45717 if (!o || !r || a == null) 45718 return; 45719 const l = s.allCols, c = l.indexOf(o), u = l.indexOf(r), d = a === 0 !== n, p = c < u || c === u && !d; 45720 let f = 0; 45721 if (d ? p && (f -= 1) : p || (f += 1), u + f === c) 45722 return; 45723 const m = l[u + f]; 45724 if (!m) 45725 return; 45726 const y = this.getNormalisedColumnLeft(m, 20, n); 45727 return { fromLeft: p, xPosition: y }; 45728 } 45729 getColumnMoveAndTargetInfo(e, t, i) { 45730 const s = this.lastHighlightedColumn || {}, { firstMovingCol: n, lastMovingCol: o } = jie(e); 45731 if (!n || !o || s.column || !t) 45732 return { 45733 firstMovingCol: n, 45734 ...s 45735 }; 45736 const a = this.getPinDirection() === "left"; 45737 return { 45738 firstMovingCol: n, 45739 position: a ? 1 : 0, 45740 column: a !== i ? n : o 45741 }; 45742 } 45743 normaliseDirection(e) { 45744 if (this.gos.get("enableRtl")) 45745 switch (e) { 45746 case "left": 45747 return "right"; 45748 case "right": 45749 return "left"; 45750 } 45751 return e; 45752 } 45753 getNormalisedColumnLeft(e, t, i) { 45754 const { gos: s, ctrlsSvc: n } = this.beans, o = e.getLeft(); 45755 if (o == null) 45756 return null; 45757 const r = e.getActualWidth(); 45758 return iS({ 45759 x: i ? o + r - t : o + t, 45760 pinned: e.getPinned(), 45761 useHeaderRow: i, 45762 skipScrollPadding: !0, 45763 gos: s, 45764 ctrlsSvc: n 45765 }); 45766 } 45767 isAttemptingToPin(e) { 45768 const t = this.needToMoveLeft || this.needToMoveRight, i = this.failedMoveAttempts > iT; 45769 return t && i || e.some((s) => s.getPinned() !== this.pinned); 45770 } 45771 moveColumnsAfterHighlight(e) { 45772 const { allMovingColumns: t, xPosition: i, fromEnter: s, fakeEvent: n, fromLeft: o } = e, r = this.getMoveColumnParams({ 45773 allMovingColumns: t, 45774 isFromHeader: !0, 45775 xPosition: i, 45776 fromLeft: o, 45777 fromEnter: s, 45778 fakeEvent: n 45779 }), { columns: a, toIndex: l } = UN(r) || {}; 45780 a && l != null && (this.lastMovedInfo = { 45781 columns: a, 45782 toIndex: l 45783 }), this.finishColumnMoving(); 45784 } 45785 clearHighlighted() { 45786 const { lastHighlightedColumn: e } = this; 45787 e && (sT(e.column, null), this.lastHighlightedColumn = null); 45788 } 45789 checkCenterForScrolling(e) { 45790 if (!this.isCenterContainer) 45791 return; 45792 const t = this.beans.ctrlsSvc.get("center"), i = t.getCenterViewportScrollLeft(), s = i + t.getCenterWidth(); 45793 let n, o; 45794 this.gos.get("enableRtl") ? (n = e < i + Kf, o = e > s - Kf) : (o = e < i + Kf, n = e > s - Kf), this.needToMoveRight = n, this.needToMoveLeft = o, o || n ? this.ensureIntervalStarted() : this.ensureIntervalCleared(); 45795 } 45796 ensureIntervalStarted() { 45797 this.movingIntervalId || (this.intervalCount = 0, this.failedMoveAttempts = 0, this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), Uie), this.beans.dragAndDrop.getDragAndDropImageComponent()?.setIcon(this.needToMoveLeft ? "left" : "right", !0)); 45798 } 45799 ensureIntervalCleared() { 45800 this.movingIntervalId && (window.clearInterval(this.movingIntervalId), this.movingIntervalId = null, this.failedMoveAttempts = 0, this.beans.dragAndDrop.getDragAndDropImageComponent()?.setIcon(this.getIconName(), !1)); 45801 } 45802 moveInterval() { 45803 let e; 45804 this.intervalCount++, e = 10 + this.intervalCount * Vie, e > sS && (e = sS); 45805 let t = null; 45806 const i = this.gridBodyCon.scrollFeature; 45807 if (this.needToMoveLeft ? t = i.scrollHorizontally(-e) : this.needToMoveRight && (t = i.scrollHorizontally(e)), t !== 0) 45808 this.onDragging(this.lastDraggingEvent), this.failedMoveAttempts = 0; 45809 else { 45810 this.failedMoveAttempts++; 45811 const { pinnedCols: s, dragAndDrop: n, gos: o } = this.beans; 45812 if (this.failedMoveAttempts <= iT + 1 || !s) 45813 return; 45814 if (n.getDragAndDropImageComponent()?.setIcon("pinned", !1), !o.get("suppressMoveWhenColumnDragging")) { 45815 const r = this.lastDraggingEvent?.dragItem.columns; 45816 this.attemptToPinColumns(r, void 0, !0); 45817 } 45818 } 45819 } 45820 getPinDirection() { 45821 if (this.needToMoveLeft || this.pinned === "left") 45822 return "left"; 45823 if (this.needToMoveRight || this.pinned === "right") 45824 return "right"; 45825 } 45826 attemptToPinColumns(e, t, i = !1) { 45827 const s = (e || []).filter((r) => !r.getColDef().lockPinned); 45828 if (!s.length) 45829 return 0; 45830 i && (t = this.getPinDirection()); 45831 const { pinnedCols: n, dragAndDrop: o } = this.beans; 45832 return n?.setColsPinned(s, t, "uiColumnDragged"), i && o.nudge(), s.length; 45833 } 45834 destroy() { 45835 super.destroy(), this.lastDraggingEvent = null, this.clearHighlighted(), this.lastMovedInfo = null; 45836 } 45837}; 45838function sT(e, t) { 45839 e.highlighted !== t && (e.highlighted = t, e.dispatchColEvent("headerHighlightChanged", "uiColumnMoved")); 45840} 45841function jie(e) { 45842 const t = e.length; 45843 let i, s; 45844 for (let n = 0; n <= t; n++) { 45845 if (!i) { 45846 const o = e[n]; 45847 o.getLeft() != null && (i = o); 45848 } 45849 if (!s) { 45850 const o = e[t - 1 - n]; 45851 o.getLeft() != null && (s = o); 45852 } 45853 if (i && s) 45854 break; 45855 } 45856 return { firstMovingCol: i, lastMovingCol: s }; 45857} 45858var $ie = class extends he {
45859 constructor(e, t) { 45860 super(), this.pinned = e, this.eContainer = t; 45861 } 45862 postConstruct() { 45863 const { ctrlsSvc: e, dragAndDrop: t } = this.beans, i = this.pinned; 45864 e.whenReady(this, (s) => { 45865 let n; 45866 const o = s.gridBodyCtrl.eBodyViewport; 45867 switch (i) { 45868 case "left": 45869 n = [ 45870 [o, s.left.eContainer], 45871 [s.bottomLeft.eContainer], 45872 [s.topLeft.eContainer] 45873 ]; 45874 break; 45875 case "right": 45876 n = [ 45877 [o, s.right.eContainer], 45878 [s.bottomRight.eContainer], 45879 [s.topRight.eContainer] 45880 ]; 45881 break; 45882 default: 45883 n = [ 45884 [o, s.center.eViewport], 45885 [s.bottomCenter.eViewport], 45886 [s.topCenter.eViewport] 45887 ]; 45888 break; 45889 } 45890 this.eSecondaryContainers = n; 45891 }), this.moveColumnFeature = this.createManagedBean(new Wie(i)), this.bodyDropPivotTarget = this.createManagedBean(new Nie(i)), t.addDropTarget(this), this.addDestroyFunc(() => t.removeDropTarget(this)); 45892 } 45893 isInterestedIn(e) { 45894 return e === 1 || e === 0 && this.gos.get("allowDragFromColumnsToolPanel"); 45895 } 45896 getSecondaryContainers() { 45897 return this.eSecondaryContainers; 45898 } 45899 getContainer() { 45900 return this.eContainer; 45901 } 45902 getIconName() { 45903 return this.currentDropListener.getIconName(); 45904 } 45905 // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel 45906 // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when 45907 // dropped into the grid's body. 45908 isDropColumnInPivotMode(e) { 45909 return this.beans.colModel.isPivotMode() && e.dragSource.type === 0; 45910 } 45911 onDragEnter(e) { 45912 this.currentDropListener = this.isDropColumnInPivotMode(e) ? this.bodyDropPivotTarget : this.moveColumnFeature, this.currentDropListener.onDragEnter(e); 45913 } 45914 onDragLeave(e) { 45915 this.currentDropListener.onDragLeave(e); 45916 } 45917 onDragging(e) { 45918 this.currentDropListener.onDragging(e); 45919 } 45920 onDragStop(e) { 45921 this.currentDropListener.onDragStop(e); 45922 } 45923 onDragCancel() { 45924 this.currentDropListener.onDragCancel(); 45925 } 45926}, Yie = class extends he { 45927 constructor() { 45928 super(...arguments), this.beanName = "colMoves"; 45929 } 45930 moveColumnByIndex(e, t, i) { 45931 const s = this.beans.colModel.getCols(); 45932 if (!s) 45933 return; 45934 const n = s[e]; 45935 this.moveColumns([n], t, i); 45936 } 45937 moveColumns(e, t, i, s = !0) { 45938 const { colModel: n, colAnimation: o, visibleCols: r, eventSvc: a } = this.beans, l = n.getCols(); 45939 if (!l) 45940 return; 45941 if (t > l.length - e.length) { 45942 Ae(30, { toIndex: t }); 45943 return; 45944 } 45945 o?.start(); 45946 const c = n.getColsForKeys(e); 45947 this.doesMovePassRules(c, t) && (WR(n.getCols(), c, t), r.refresh(i), a.dispatchEvent({ 45948 type: "columnMoved", 45949 columns: c, 45950 column: c.length === 1 ? c[0] : null, 45951 toIndex: t, 45952 finished: s, 45953 source: i 45954 })), o?.finish(); 45955 } 45956 doesMovePassRules(e, t) { 45957 const i = this.getProposedColumnOrder(e, t); 45958 return this.doesOrderPassRules(i); 45959 } 45960 doesOrderPassRules(e) { 45961 const { colModel: t, gos: i } = this.beans; 45962 return !(!$O(e, t.getColTree()) || !((n) => { 45963 const o = (c) => c ? c === "left" || c === !0 ? -1 : 1 : 0, r = i.get("enableRtl"); 45964 let a = r ? 1 : -1, l = !0; 45965 return n.forEach((c) => { 45966 const u = o(c.getColDef().lockPosition); 45967 r ? u > a && (l = !1) : u < a && (l = !1), a = u; 45968 }), l; 45969 })(e)); 45970 } 45971 getProposedColumnOrder(e, t) { 45972 const s = this.beans.colModel.getCols().slice(); 45973 return WR(s, e, t), s; 45974 } 45975 createBodyDropTarget(e, t) { 45976 return new $ie(e, t); 45977 } 45978 moveHeader(e, t, i, s, n) { 45979 const { ctrlsSvc: o, gos: r, colModel: a, visibleCols: l, focusSvc: c } = this.beans, u = t.getBoundingClientRect(), d = u.left, p = xi(i), f = p ? u.width : i.getActualWidth(), m = e === "left" !== r.get("enableRtl"), y = iS({ 45980 x: m ? d - 20 : d + f + 20, 45981 pinned: s, 45982 fromKeyboard: !0, 45983 gos: r, 45984 ctrlsSvc: o 45985 }), b = c.focusedHeader; 45986 WN({ 45987 allMovingColumns: p ? i.getLeafColumns() : [i], 45988 isFromHeader: !0, 45989 fromLeft: e === "right", 45990 xPosition: y, 45991 pinned: s, 45992 fromEnter: !1, 45993 fakeEvent: !1, 45994 gos: r, 45995 colModel: a, 45996 colMoves: this, 45997 visibleCols: l, 45998 finished: !0 45999 }); 46000 let C; 46001 if (p) { 46002 const w = i.getDisplayedLeafColumns(); 46003 C = m ? w[0] : It(w); 46004 } else 46005 C = i;
46006 if (o.getScrollFeature().ensureColumnVisible(C, "auto"), (!n.isAlive() || r.get("ensureDomOrder")) && b) { 46007 let w; 46008 if (p) { 46009 const M = i.getGroupId(), A = i.getLeafColumns(); 46010 if (!A.length) 46011 return; 46012 const I = A[0].getParent(); 46013 if (!I) 46014 return; 46015 w = Kie(I, M); 46016 } else 46017 w = i; 46018 w && c.focusHeaderPosition({ 46019 headerPosition: { 46020 ...b, 46021 column: w 46022 } 46023 }); 46024 } 46025 } 46026 setDragSourceForHeader(e, t, i) { 46027 const { gos: s, colModel: n, dragAndDrop: o, visibleCols: r } = this.beans; 46028 let a = !s.get("suppressDragLeaveHidesColumns"); 46029 const l = xi(t), c = l ? t.getProvidedColumnGroup().getLeafColumns() : [t], d = { 46030 type: 1, 46031 eElement: e, 46032 getDefaultIconName: () => a ? "hide" : "notAllowed", 46033 getDragItem: l ? () => qie(t, r.allCols) : () => Zie(t), 46034 dragItemName: i, 46035 onDragStarted: () => { 46036 a = !s.get("suppressDragLeaveHidesColumns"), L0(c, !0); 46037 }, 46038 onDragStopped: () => L0(c, !1), 46039 onDragCancelled: () => L0(c, !1), 46040 onGridEnter: (p) => { 46041 if (a) { 46042 const { columns: f = [], visibleState: m } = p ?? {}, y = l ? (C) => !m || m[C.getColId()] : () => !0, b = f.filter( 46043 (C) => !C.getColDef().lockVisible && y(C) 46044 ); 46045 n.setColsVisible(b, !0, "uiColumnMoved"); 46046 } 46047 }, 46048 onGridExit: (p) => { 46049 if (a) { 46050 const f = p?.columns?.filter((m) => !m.getColDef().lockVisible) || []; 46051 n.setColsVisible(f, !1, "uiColumnMoved"); 46052 } 46053 } 46054 }; 46055 return o.addDragSource(d, !0), d; 46056 } 46057}; 46058function Kie(e, t) { 46059 for (; e; ) { 46060 if (e.getGroupId() === t) 46061 return e; 46062 e = e.getParent(); 46063 } 46064} 46065function Zie(e) { 46066 const t = {}; 46067 return t[e.getId()] = e.isVisible(), { 46068 columns: [e], 46069 visibleState: t 46070 }; 46071} 46072function qie(e, t) { 46073 const i = e.getProvidedColumnGroup().getLeafColumns(), s = {}; 46074 i.forEach((a) => s[a.getId()] = a.isVisible()); 46075 const n = []; 46076 t.forEach((a) => { 46077 i.indexOf(a) >= 0 && (n.push(a), Ko(i, a)); 46078 }), i.forEach((a) => n.push(a)); 46079 const o = [], r = e.getLeafColumns(); 46080 for (const a of n) 46081 r.indexOf(a) !== -1 && o.push(a); 46082 return { 46083 columns: n, 46084 columnsInSplit: o, 46085 visibleState: s 46086 }; 46087} 46088var Qie = { 46089 moduleName: "ColumnMove", 46090 version: Fe, 46091 beans: [Yie, Pie], 46092 apiFunctions: { 46093 moveColumnByIndex: Fie, 46094 moveColumns: Oie 46095 }, 46096 dependsOn: [VN], 46097 css: [kie] 46098}, Xie = class extends he { 46099 constructor() { 46100 super(...arguments), this.beanName = "autoWidthCalc"; 46101 } 46102 postConstruct() { 46103 this.beans.ctrlsSvc.whenReady(this, (e) => { 46104 this.centerRowContainerCtrl = e.center; 46105 }); 46106 } 46107 // this is the trick: we create a dummy container and clone all the cells 46108 // into the dummy, then check the dummy's width. then destroy the dummy 46109 // as we don't need it any more. 46110 // drawback: only the cells visible on the screen are considered 46111 getPreferredWidthForColumn(e, t) { 46112 const i = this.getHeaderCellForColumn(e); 46113 if (!i) 46114 return -1; 46115 const s = this.beans.rowRenderer.getAllCellsNotSpanningForColumn(e); 46116 return t || s.push(i), this.addElementsToContainerAndGetWidth(s); 46117 } 46118 getPreferredWidthForColumnGroup(e) { 46119 const t = this.getHeaderCellForColumn(e); 46120 return t ? this.addElementsToContainerAndGetWidth([t]) : -1; 46121 } 46122 addElementsToContainerAndGetWidth(e) { 46123 const t = document.createElement("form"); 46124 t.style.position = "fixed"; 46125 const i = this.centerRowContainerCtrl.eContainer; 46126 e.forEach((o) => this.cloneItemIntoDummy(o, t)), i.appendChild(t); 46127 const s = t.offsetWidth; 46128 i.removeChild(t); 46129 const n = this.gos.get("autoSizePadding"); 46130 return s + n; 46131 } 46132 getHeaderCellForColumn(e) { 46133 let t = null; 46134 return this.beans.ctrlsSvc.getHeaderRowContainerCtrls().forEach((i) => { 46135 const s = i.getHtmlElementForColumnHeader(e); 46136 s != null && (t = s); 46137 }), t; 46138 } 46139 cloneItemIntoDummy(e, t) { 46140 const i = e.cloneNode(!0); 46141 i.style.width = "", i.style.position = "static", i.style.left = ""; 46142 const s = document.createElement("div"), n = s.classList; 46143 ["ag-header-cell", "ag-header-group-cell"].some((a) => i.classList.contains(a)) ? (n.add("ag-header", "ag-header-row"), s.style.position = "static") : n.add("ag-row"); 46144 let r = e.parentElement; 46145 for (; r; ) { 46146 if (["ag-header-row", "ag-row"].some((l) => r.classList.contains(l))) { 46147 for (let l = 0; l < r.classList.length; l++) { 46148 const c = r.classList[l]; 46149 c != "ag-row-position-absolute" && n.add(c); 46150 } 46151 break; 46152 } 46153 r = r.parentElement; 46154 } 46155 s.appendChild(i), t.appendChild(s); 46156 } 46157}, jN = { 46158 moduleName: "AutoWidth", 46159 version: Fe, 46160 beans: [Xie] 46161}; 46162function Jie(e, t, i = !0, s = "api") { 46163 e.colResize?.setColumnWidths(t, !1, i, s); 46164} 46165var ese = class extends he {
46166 constructor(e, t, i, s) { 46167 super(), this.comp = e, this.eResize = t, this.pinned = i, this.columnGroup = s; 46168 } 46169 postConstruct() { 46170 if (!this.columnGroup.isResizable()) { 46171 this.comp.setResizableDisplayed(!1); 46172 return; 46173 } 46174 const { horizontalResizeSvc: e, gos: t, colAutosize: i } = this.beans, s = e.addResizeBar({ 46175 eResizeBar: this.eResize, 46176 onResizeStart: this.onResizeStart.bind(this), 46177 onResizing: this.onResizing.bind(this, !1), 46178 onResizeEnd: this.onResizing.bind(this, !0) 46179 }); 46180 this.addDestroyFunc(s), !t.get("suppressAutoSize") && i && this.addDestroyFunc( 46181 i.addColumnGroupResize( 46182 this.eResize, 46183 this.columnGroup, 46184 () => this.resizeLeafColumnsToFit("uiColumnResized") 46185 ) 46186 ); 46187 } 46188 onResizeStart(e) { 46189 const { 46190 columnsToResize: t, 46191 resizeStartWidth: i, 46192 resizeRatios: s, 46193 groupAfterColumns: n, 46194 groupAfterStartWidth: o, 46195 groupAfterRatios: r 46196 } = this.getInitialValues(e); 46197 this.resizeCols = t, this.resizeStartWidth = i, this.resizeRatios = s, this.resizeTakeFromCols = n, this.resizeTakeFromStartWidth = o, this.resizeTakeFromRatios = r, this.toggleColumnResizing(!0); 46198 } 46199 onResizing(e, t, i = "uiColumnResized") { 46200 const s = this.normaliseDragChange(t), n = this.resizeStartWidth + s; 46201 this.resizeColumnsFromLocalValues(n, i, e); 46202 } 46203 getInitialValues(e) { 46204 const t = (l) => l.reduce((c, u) => c + u.getActualWidth(), 0), i = (l, c) => l.map((u) => u.getActualWidth() / c), s = this.getColumnsToResize(), n = t(s), o = i(s, n), r = { 46205 columnsToResize: s, 46206 resizeStartWidth: n, 46207 resizeRatios: o 46208 }; 46209 let a = null; 46210 if (e && (a = this.beans.colGroupSvc?.getGroupAtDirection(this.columnGroup, "After") ?? null), a) { 46211 const l = a.getDisplayedLeafColumns(), c = r.groupAfterColumns = l.filter( 46212 (d) => d.isResizable() 46213 ), u = r.groupAfterStartWidth = t(c); 46214 r.groupAfterRatios = i(c, u); 46215 } else 46216 r.groupAfterColumns = void 0, r.groupAfterStartWidth = void 0, r.groupAfterRatios = void 0; 46217 return r; 46218 } 46219 resizeLeafColumnsToFit(e) { 46220 const t = this.beans.autoWidthCalc.getPreferredWidthForColumnGroup(this.columnGroup), i = this.getInitialValues(); 46221 t > i.resizeStartWidth && this.resizeColumns(i, t, e, !0); 46222 } 46223 resizeColumnsFromLocalValues(e, t, i = !0) { 46224 if (!this.resizeCols || !this.resizeRatios) 46225 return; 46226 const s = { 46227 columnsToResize: this.resizeCols, 46228 resizeStartWidth: this.resizeStartWidth, 46229 resizeRatios: this.resizeRatios, 46230 groupAfterColumns: this.resizeTakeFromCols, 46231 groupAfterStartWidth: this.resizeTakeFromStartWidth, 46232 groupAfterRatios: this.resizeTakeFromRatios 46233 }; 46234 this.resizeColumns(s, e, t, i); 46235 } 46236 resizeColumns(e, t, i, s = !0) { 46237 const { 46238 columnsToResize: n, 46239 resizeStartWidth: o, 46240 resizeRatios: r, 46241 groupAfterColumns: a, 46242 groupAfterStartWidth: l, 46243 groupAfterRatios: c 46244 } = e, u = []; 46245 if (u.push({ 46246 columns: n, 46247 ratios: r, 46248 width: t 46249 }), a) { 46250 const d = t - o; 46251 u.push({ 46252 columns: a, 46253 ratios: c, 46254 width: l - d 46255 }); 46256 } 46257 this.beans.colResize?.resizeColumnSets({ 46258 resizeSets: u, 46259 finished: s, 46260 source: i 46261 }), s && this.toggleColumnResizing(!1); 46262 } 46263 toggleColumnResizing(e) { 46264 this.comp.addOrRemoveCssClass("ag-column-resizing", e); 46265 } 46266 getColumnsToResize() { 46267 return this.columnGroup.getDisplayedLeafColumns().filter((t) => t.isResizable()); 46268 } 46269 // optionally inverts the drag, depending on pinned and RTL 46270 // note - this method is duplicated in RenderedHeaderCell - should refactor out? 46271 normaliseDragChange(e) { 46272 let t = e; 46273 return this.gos.get("enableRtl") ? this.pinned !== "left" && (t *= -1) : this.pinned === "right" && (t *= -1), t; 46274 } 46275 destroy() { 46276 super.destroy(), this.resizeCols = void 0, this.resizeRatios = void 0, this.resizeTakeFromCols = void 0, this.resizeTakeFromRatios = void 0; 46277 } 46278}, tse = class extends he { 46279 constructor(e, t, i, s, n) { 46280 super(), this.pinned = e, this.column = t, this.eResize = i, this.comp = s, this.ctrl = n; 46281 } 46282 postConstruct() { 46283 const e = []; 46284 let t, i; 46285 const s = () => { 46286 if (ui(this.eResize, t), !t) 46287 return; 46288 const { horizontalResizeSvc: r, colAutosize: a } = this.beans, l = r.addResizeBar({ 46289 eResizeBar: this.eResize, 46290 onResizeStart: this.onResizeStart.bind(this), 46291 onResizing: this.onResizing.bind(this, !1), 46292 onResizeEnd: this.onResizing.bind(this, !0) 46293 }); 46294 e.push(l), i && a && e.push(a.addColumnAutosize(this.eResize, this.column)); 46295 }, n = () => { 46296 e.forEach((r) => r()), e.length = 0; 46297 }, o = () => { 46298 const r = this.column.isResizable(), a = !this.gos.get("suppressAutoSize") && !this.column.getColDef().suppressAutoSize; 46299 (r !== t || a !== i) && (t = r, i = a, n(), s()); 46300 };
46301 o(), this.addDestroyFunc(n), this.ctrl.setRefreshFunction("resize", o); 46302 } 46303 onResizing(e, t) { 46304 const { column: i, lastResizeAmount: s, resizeStartWidth: n, beans: o } = this, r = this.normaliseResizeAmount(t), a = n + r, l = [{ key: i, newWidth: a }], { pinnedCols: c, ctrlsSvc: u, colResize: d } = o; 46305 if (this.column.getPinned()) { 46306 const p = c?.leftWidth ?? 0, f = c?.rightWidth ?? 0, m = jp(u.getGridBodyCtrl().eBodyViewport) - 50; 46307 if (p + f + (r - s) > m) 46308 return; 46309 } 46310 this.lastResizeAmount = r, d?.setColumnWidths(l, this.resizeWithShiftKey, e, "uiColumnResized"), e && this.toggleColumnResizing(!1); 46311 } 46312 onResizeStart(e) { 46313 this.resizeStartWidth = this.column.getActualWidth(), this.lastResizeAmount = 0, this.resizeWithShiftKey = e, this.toggleColumnResizing(!0); 46314 } 46315 toggleColumnResizing(e) { 46316 this.comp.addOrRemoveCssClass("ag-column-resizing", e); 46317 } 46318 // optionally inverts the drag, depending on pinned and RTL 46319 // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out? 46320 normaliseResizeAmount(e) { 46321 let t = e; 46322 const i = this.pinned !== "left", s = this.pinned === "right"; 46323 return this.gos.get("enableRtl") ? i && (t *= -1) : s && (t *= -1), t; 46324 } 46325}, ise = class extends he { 46326 constructor() { 46327 super(...arguments), this.beanName = "colResize"; 46328 } 46329 setColumnWidths(e, t, i, s) { 46330 const n = [], { colModel: o, gos: r, visibleCols: a } = this.beans; 46331 e.forEach((l) => { 46332 const c = o.getColDefCol(l.key) || o.getCol(l.key); 46333 if (!c) 46334 return; 46335 if (n.push({ 46336 width: l.newWidth, 46337 ratios: [1], 46338 columns: [c] 46339 }), r.get("colResizeDefault") === "shift" && (t = !t), t) { 46340 const d = a.getColAfter(c); 46341 if (!d) 46342 return; 46343 const p = c.getActualWidth() - l.newWidth, f = d.getActualWidth() + p; 46344 n.push({ 46345 width: f, 46346 ratios: [1], 46347 columns: [d] 46348 }); 46349 } 46350 }), n.length !== 0 && this.resizeColumnSets({ 46351 resizeSets: n, 46352 finished: i, 46353 source: s 46354 }); 46355 } 46356 // method takes sets of columns and resizes them. either all sets will be resized, or nothing 46357 // be resized. this is used for example when user tries to resize a group and holds shift key, 46358 // then both the current group (grows), and the adjacent group (shrinks), will get resized, 46359 // so that's two sets for this method. 46360 resizeColumnSets(e) { 46361 const { resizeSets: t, finished: i, source: s } = e; 46362 if (!(!t || t.every((u) => sse(u)))) { 46363 if (i) { 46364 const u = t && t.length > 0 ? t[0].columns : null; 46365 Ed(this.eventSvc, u, i, s); 46366 } 46367 return; 46368 } 46369 const o = [], r = []; 46370 t.forEach((u) => { 46371 const { width: d, columns: p, ratios: f } = u, m = {}, y = {}; 46372 p.forEach((w) => r.push(w)); 46373 let b = !0, C = 0; 46374 for (; b; ) { 46375 if (C++, C > 1e3) { 46376 Rt(31); 46377 break; 46378 } 46379 b = !1; 46380 const w = []; 46381 let M = 0, A = d; 46382 p.forEach((L, k) => { 46383 if (y[L.getId()]) 46384 A -= m[L.getId()]; 46385 else { 46386 w.push(L); 46387 const N = f[k]; 46388 M += N; 46389 } 46390 }); 46391 const I = 1 / M; 46392 w.forEach((L, k) => { 46393 const B = k === w.length - 1; 46394 let N; 46395 B ? N = A : (N = Math.round(f[k] * d * I), A -= N); 46396 const W = L.getMinWidth(), se = L.getMaxWidth(); 46397 N < W ? (N = W, y[L.getId()] = !0, b = !0) : se > 0 && N > se && (N = se, y[L.getId()] = !0, b = !0), m[L.getId()] = N; 46398 }); 46399 } 46400 p.forEach((w) => { 46401 const M = m[w.getId()]; 46402 w.getActualWidth() !== M && (w.setActualWidth(M, s), o.push(w)); 46403 }); 46404 }); 46405 const a = o.length > 0; 46406 let l = []; 46407 if (a) { 46408 const { colFlex: u, visibleCols: d, colViewport: p } = this.beans; 46409 l = u?.refreshFlexedColumns({ 46410 resizingCols: r, 46411 skipSetLeft: !0 46412 }) ?? [], d.setLeftValues(s), d.updateBodyWidths(), p.checkViewportColumns(); 46413 } 46414 const c = r.concat(l); 46415 (a || i) && Ed(this.eventSvc, c, i, s, l); 46416 } 46417 resizeHeader(e, t, i) { 46418 if (!e.isResizable()) 46419 return; 46420 const s = e.getActualWidth(), n = e.getMinWidth(), o = e.getMaxWidth(), r = Math.min(Math.max(s + t, n), o); 46421 this.setColumnWidths([{ key: e, newWidth: r }], i, !0, "uiColumnResized"); 46422 }
46423 createResizeFeature(e, t, i, s, n) { 46424 return new tse(e, t, i, s, n); 46425 } 46426 createGroupResizeFeature(e, t, i, s) { 46427 return new ese(e, t, i, s); 46428 } 46429}; 46430function sse(e) { 46431 const { columns: t, width: i } = e; 46432 let s = 0, n = 0, o = !0; 46433 t.forEach((l) => { 46434 const c = l.getMinWidth(); 46435 s += c || 0; 46436 const u = l.getMaxWidth(); 46437 u > 0 ? n += u : o = !1; 46438 }); 46439 const r = i >= s, a = !o || i <= n; 46440 return r && a; 46441} 46442var nse = { 46443 moduleName: "ColumnResize", 46444 version: Fe, 46445 beans: [ise], 46446 apiFunctions: { 46447 setColumnWidths: Jie 46448 }, 46449 dependsOn: [Lie, jN] 46450}, ose = class extends he { 46451 constructor(e, t) { 46452 super(), this.removeChildListenersFuncs = [], this.columnGroup = t, this.comp = e; 46453 } 46454 postConstruct() { 46455 this.addListenersToChildrenColumns(), this.addManagedListeners(this.columnGroup, { 46456 displayedChildrenChanged: this.onDisplayedChildrenChanged.bind(this) 46457 }), this.onWidthChanged(), this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this)); 46458 } 46459 addListenersToChildrenColumns() { 46460 this.removeListenersOnChildrenColumns(); 46461 const e = this.onWidthChanged.bind(this); 46462 this.columnGroup.getLeafColumns().forEach((t) => { 46463 t.addEventListener("widthChanged", e), t.addEventListener("visibleChanged", e), this.removeChildListenersFuncs.push(() => { 46464 t.removeEventListener("widthChanged", e), t.removeEventListener("visibleChanged", e); 46465 }); 46466 }); 46467 } 46468 removeListenersOnChildrenColumns() { 46469 this.removeChildListenersFuncs.forEach((e) => e()), this.removeChildListenersFuncs = []; 46470 } 46471 onDisplayedChildrenChanged() { 46472 this.addListenersToChildrenColumns(), this.onWidthChanged(); 46473 } 46474 onWidthChanged() { 46475 const e = this.columnGroup.getActualWidth(); 46476 this.comp.setWidth(`${e}px`), this.comp.addOrRemoveCssClass("ag-hidden", e === 0); 46477 } 46478}, rse = class extends CM { 46479 constructor() { 46480 super(...arguments), this.onSuppressColMoveChange = () => { 46481 !this.isAlive() || this.isSuppressMoving() ? this.removeDragSource() : this.dragSource || this.setDragSource(this.eGui); 46482 }; 46483 } 46484 setComp(e, t, i, s, n) { 46485 const { column: o, beans: r } = this, { context: a, colNames: l, colHover: c, colResize: u } = r; 46486 this.comp = e, n = Dg(this, a, n), this.setGui(t, n), this.displayName = l.getDisplayNameForColumnGroup(o, "header"), this.addClasses(), this.setupMovingCss(n), this.setupExpandable(n), this.setupTooltip(), this.setupAutoHeight({ 46487 wrapperElement: s, 46488 compBean: n 46489 }), this.setupUserComp(), this.addHeaderMouseListeners(n), this.addManagedPropertyListener("groupHeaderHeight", this.refreshMaxHeaderHeight.bind(this)), this.refreshMaxHeaderHeight(); 46490 const d = this.rowCtrl.pinned, p = o.getProvidedColumnGroup().getLeafColumns(); 46491 c?.createHoverFeature(n, p, t), n.createManagedBean(new yM(o, t, r)), n.createManagedBean(new ose(e, o)), u ? this.resizeFeature = n.createManagedBean( 46492 u.createGroupResizeFeature(e, i, d, o) 46493 ) : e.setResizableDisplayed(!1), n.createManagedBean( 46494 new sh(t, { 46495 shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this), 46496 onTabKeyDown: () => { 46497 }, 46498 handleKeyDown: this.handleKeyDown.bind(this), 46499 onFocusIn: this.onFocusIn.bind(this) 46500 }) 46501 ), this.addHighlightListeners(n, p), n.addManagedPropertyListener("suppressMovableColumns", this.onSuppressColMoveChange), this.addResizeAndMoveKeyboardListeners(n), n.addDestroyFunc(() => this.clearComponent()); 46502 } 46503 refreshMaxHeaderHeight() { 46504 const { gos: e, comp: t } = this, i = e.get("groupHeaderHeight"); 46505 i != null ? i === 0 ? t.setHeaderWrapperHidden(!0) : t.setHeaderWrapperMaxHeight(i) : (t.setHeaderWrapperHidden(!1), t.setHeaderWrapperMaxHeight(null)); 46506 } 46507 addHighlightListeners(e, t) { 46508 if (this.beans.gos.get("suppressMoveWhenColumnDragging")) 46509 for (const i of t) 46510 e.addManagedListeners(i, { 46511 headerHighlightChanged: this.onLeafColumnHighlightChanged.bind(this, i) 46512 }); 46513 } 46514 onLeafColumnHighlightChanged(e) { 46515 const t = this.column.getDisplayedLeafColumns(), i = t[0] === e, s = It(t) === e; 46516 if (!i && !s) 46517 return; 46518 const n = e.getHighlighted(), o = !!this.rowCtrl.findHeaderCellCtrl((l) => l.column.isMoving()); 46519 let r = !1, a = !1; 46520 if (o) { 46521 const l = this.beans.gos.get("enableRtl"), c = n === 1, u = n === 0; 46522 i && (l ? a = c : r = u), s && (l ? r = u : a = c); 46523 } 46524 this.comp.addOrRemoveCssClass("ag-header-highlight-before", r), this.comp.addOrRemoveCssClass("ag-header-highlight-after", a); 46525 } 46526 resizeHeader(e, t) { 46527 const { resizeFeature: i } = this; 46528 if (!i) 46529 return; 46530 const s = i.getInitialValues(t); 46531 i.resizeColumns(s, s.resizeStartWidth + e, "uiColumnResized", !0); 46532 } 46533 resizeLeafColumnsToFit(e) { 46534 this.resizeFeature?.resizeLeafColumnsToFit(e); 46535 } 46536 setupUserComp() { 46537 const { colGroupSvc: e, userCompFactory: t, gos: i } = this.beans, s = i.addGridCommonParams({ 46538 displayName: this.displayName, 46539 columnGroup: this.column, 46540 setExpanded: (o) => { 46541 e.setColumnGroupOpened(this.column.getProvidedColumnGroup(), o, "gridInitializing"); 46542 }, 46543 setTooltip: (o, r) => { 46544 i.assertModuleRegistered("Tooltip", 3), this.setupTooltip(o, r); 46545 } 46546 }), n = gJ(t, s);
46547 n && this.comp.setUserCompDetails(n); 46548 } 46549 addHeaderMouseListeners(e) { 46550 const t = (n) => this.handleMouseOverChange(n.type === "mouseenter"), i = () => this.dispatchColumnMouseEvent("columnHeaderClicked", this.column.getProvidedColumnGroup()), s = (n) => this.handleContextMenuMouseEvent(n, void 0, this.column.getProvidedColumnGroup()); 46551 e.addManagedListeners(this.eGui, { 46552 mouseenter: t, 46553 mouseleave: t, 46554 click: i, 46555 contextmenu: s 46556 }); 46557 } 46558 handleMouseOverChange(e) { 46559 this.eventSvc.dispatchEvent({ 46560 type: e ? "columnHeaderMouseOver" : "columnHeaderMouseLeave", 46561 column: this.column.getProvidedColumnGroup() 46562 }); 46563 } 46564 setupTooltip(e, t) { 46565 this.tooltipFeature = this.beans.tooltipSvc?.setupHeaderGroupTooltip( 46566 this.tooltipFeature, 46567 this, 46568 e, 46569 t 46570 ); 46571 } 46572 setupExpandable(e) { 46573 const t = this.column.getProvidedColumnGroup(); 46574 this.refreshExpanded(); 46575 const i = this.refreshExpanded.bind(this); 46576 e.addManagedListeners(t, { 46577 expandedChanged: i, 46578 expandableChanged: i 46579 }); 46580 } 46581 refreshExpanded() { 46582 const { column: e } = this; 46583 this.expandable = e.isExpandable(); 46584 const t = e.isExpanded(); 46585 this.expandable ? this.comp.setAriaExpanded(t ? "true" : "false") : this.comp.setAriaExpanded(void 0); 46586 } 46587 addClasses() { 46588 const { column: e } = this, t = e.getColGroupDef(), i = cN(t, this.gos, null, e); 46589 e.isPadding() ? (i.push("ag-header-group-cell-no-group"), e.getLeafColumns().every((n) => n.isSpanHeaderHeight()) && i.push("ag-header-span-height")) : (i.push("ag-header-group-cell-with-group"), t?.wrapHeaderText && i.push("ag-header-cell-wrap-text")), i.forEach((s) => this.comp.addOrRemoveCssClass(s, !0)); 46590 } 46591 setupMovingCss(e) { 46592 const { column: t } = this, s = t.getProvidedColumnGroup().getLeafColumns(), n = () => this.comp.addOrRemoveCssClass("ag-header-cell-moving", t.isMoving());
46593 s.forEach((o) => { 46594 e.addManagedListeners(o, { movingChanged: n }); 46595 }), n(); 46596 } 46597 onFocusIn(e) { 46598 this.eGui.contains(e.relatedTarget) || this.focusThis(); 46599 } 46600 handleKeyDown(e) { 46601 super.handleKeyDown(e); 46602 const t = this.getWrapperHasFocus(); 46603 if (!(!this.expandable || !t) && e.key === de.ENTER) { 46604 const i = this.column, s = !i.isExpanded(); 46605 this.beans.colGroupSvc.setColumnGroupOpened( 46606 i.getProvidedColumnGroup(), 46607 s, 46608 "uiColumnExpanded" 46609 ); 46610 } 46611 } 46612 // unlike columns, this will only get called once, as we don't react on props on column groups 46613 // (we will always destroy and recreate this comp if something changes) 46614 setDragSource(e) { 46615 !this.isAlive() || this.isSuppressMoving() || (this.removeDragSource(), e && (this.dragSource = this.beans.colMoves?.setDragSourceForHeader(e, this.column, this.displayName) ?? null)); 46616 } 46617 isSuppressMoving() { 46618 return this.gos.get("suppressMovableColumns") || this.column.getLeafColumns().some((e) => e.getColDef().suppressMovable || e.getColDef().lockPosition); 46619 } 46620 destroy() { 46621 this.tooltipFeature = this.destroyBean(this.tooltipFeature), super.destroy(); 46622 } 46623}; 46624function ase(e, t, i) { 46625 e.colGroupSvc?.setColumnGroupOpened(t, i, "api"); 46626} 46627function lse(e, t, i) { 46628 return e.colGroupSvc?.getColumnGroup(t, i) ?? null; 46629} 46630function cse(e, t) { 46631 return e.colGroupSvc?.getProvidedColGroup(t) ?? null; 46632} 46633function use(e, t, i) { 46634 return e.colNames.getDisplayNameForColumnGroup(t, i) || ""; 46635} 46636function dse(e) { 46637 return e.colGroupSvc?.getColumnGroupState() ?? []; 46638} 46639function hse(e, t) { 46640 e.colGroupSvc?.setColumnGroupState(t, "api"); 46641} 46642function pse(e) { 46643 e.colGroupSvc?.resetColumnGroupState("api"); 46644} 46645function gse(e) { 46646 return e.visibleCols.treeLeft; 46647} 46648function fse(e) { 46649 return e.visibleCols.treeCenter; 46650} 46651function mse(e) { 46652 return e.visibleCols.treeRight; 46653} 46654function vse(e) { 46655 return e.visibleCols.getAllTrees(); 46656} 46657function yse(e, t) { 46658 for (let i = 0; i < t.length; i++) { 46659 const s = e.indexOf(t[i]); 46660 s >= 0 && (e[s] = e[e.length - 1], e.pop()); 46661 } 46662} 46663var Cse = class extends he { 46664 constructor() { 46665 super(...arguments), this.beanName = "visibleCols", this.colsAndGroupsMap = {}, this.leftCols = [], this.rightCols = [], this.centerCols = [], this.allCols = [], this.bodyWidth = 0, this.leftWidth = 0, this.rightWidth = 0, this.isBodyWidthDirty = !0; 46666 } 46667 refresh(e, t = !1) { 46668 const { colModel: i, colGroupSvc: s, colViewport: n } = this.beans; 46669 t || this.buildTrees(i, s), s?.updateOpenClosedVisibility(); 46670 const o = k0(this.treeLeft); 46671 this.leftCols = o, this.centerCols = k0(this.treeCenter); 46672 const r = k0(this.treeRight); 46673 this.rightCols = r, this.joinColsAriaOrder(i), this.joinCols(), this.setLeftValues(e), this.autoHeightCols = this.allCols.filter((a) => a.isAutoHeight()), this.beans.colFlex?.refreshFlexedColumns(), this.updateBodyWidths(), n.checkViewportColumns(!1), this.setFirstRightAndLastLeftPinned(i, o, r, e), this.eventSvc.dispatchEvent({ 46674 type: "displayedColumnsChanged", 46675 source: e 46676 }); 46677 } 46678 // after setColumnWidth or updateGroupsAndPresentedCols 46679 updateBodyWidths() { 46680 const e = Kr(this.centerCols), t = Kr(this.leftCols), i = Kr(this.rightCols); 46681 this.isBodyWidthDirty = this.bodyWidth !== e, (this.bodyWidth !== e || this.leftWidth !== t || this.rightWidth !== i) && (this.bodyWidth = e, this.leftWidth = t, this.rightWidth = i, this.eventSvc.dispatchEvent({ 46682 type: "columnContainerWidthChanged" 46683 }), this.eventSvc.dispatchEvent({ 46684 type: "displayedColumnsWidthChanged" 46685 })); 46686 } 46687 // sets the left pixel position of each column 46688 setLeftValues(e) { 46689 this.setLeftValuesOfCols(e), this.setLeftValuesOfGroups(); 46690 } 46691 setFirstRightAndLastLeftPinned(e, t, i, s) { 46692 let n, o; 46693 this.gos.get("enableRtl") ? (n = t ? t[0] : null, o = i ? It(i) : null) : (n = t ? It(t) : null, o = i ? i[0] : null), e.getCols().forEach((r) => { 46694 r.setLastLeftPinned(r === n, s), r.setFirstRightPinned(r === o, s); 46695 }); 46696 } 46697 buildTrees(e, t) { 46698 const i = e.getColsToShow(), s = i.filter((l) => l.getPinned() == "left"), n = i.filter((l) => l.getPinned() == "right"), o = i.filter((l) => l.getPinned() != "left" && l.getPinned() != "right"), r = new nN(), a = (l) => t ? t.createColumnGroups(l) : l.columns; 46699 this.treeLeft = a({ 46700 columns: s, 46701 idCreator: r, 46702 pinned: "left", 46703 oldDisplayedGroups: this.treeLeft 46704 }), this.treeRight = a({ 46705 columns: n, 46706 idCreator: r, 46707 pinned: "right", 46708 oldDisplayedGroups: this.treeRight 46709 }), this.treeCenter = a({ 46710 columns: o, 46711 idCreator: r, 46712 pinned: null, 46713 oldDisplayedGroups: this.treeCenter 46714 }), this.updateColsAndGroupsMap(); 46715 } 46716 clear() { 46717 this.leftCols = [], this.rightCols = [], this.centerCols = [], this.allCols = [], this.ariaOrderColumns = []; 46718 } 46719 joinColsAriaOrder(e) { 46720 const t = e.getCols(), i = [], s = [], n = []; 46721 for (const o of t) { 46722 const r = o.getPinned(); 46723 r ? r === !0 || r === "left" ? i.push(o) : n.push(o) : s.push(o); 46724 } 46725 this.ariaOrderColumns = i.concat(s).concat(n); 46726 } 46727 getAriaColIndex(e) { 46728 let t; 46729 return xi(e) ? t = e.getLeafColumns()[0] : t = e, this.ariaOrderColumns.indexOf(t) + 1; 46730 } 46731 setLeftValuesOfGroups() { 46732 [this.treeLeft, this.treeRight, this.treeCenter].forEach((e) => { 46733 e.forEach((t) => { 46734 xi(t) && t.checkLeft(); 46735 }); 46736 }); 46737 } 46738 setLeftValuesOfCols(e) { 46739 const { colModel: t } = this.beans; 46740 if (!t.getColDefCols()) 46741 return; 46742 const s = t.getCols().slice(0), n = this.gos.get("enableRtl");
46743 [this.leftCols, this.rightCols, this.centerCols].forEach((o) => { 46744 if (n) { 46745 let r = Kr(o); 46746 o.forEach((a) => { 46747 r -= a.getActualWidth(), a.setLeft(r, e); 46748 }); 46749 } else { 46750 let r = 0; 46751 o.forEach((a) => { 46752 a.setLeft(r, e), r += a.getActualWidth(); 46753 }); 46754 } 46755 yse(s, o); 46756 }), s.forEach((o) => { 46757 o.setLeft(null, e); 46758 }); 46759 } 46760 joinCols() { 46761 this.gos.get("enableRtl") ? this.allCols = this.rightCols.concat(this.centerCols).concat(this.leftCols) : this.allCols = this.leftCols.concat(this.centerCols).concat(this.rightCols); 46762 } 46763 getAllTrees() { 46764 return this.treeLeft && this.treeRight && this.treeCenter ? this.treeLeft.concat(this.treeCenter).concat(this.treeRight) : null; 46765 } 46766 // gridPanel -> ensureColumnVisible 46767 isColDisplayed(e) { 46768 return this.allCols.indexOf(e) >= 0; 46769 } 46770 getLeftColsForRow(e) { 46771 const { 46772 leftCols: t, 46773 beans: { colModel: i } 46774 } = this; 46775 return i.colSpanActive ? this.getColsForRow(e, t) : t; 46776 } 46777 getRightColsForRow(e) { 46778 const { 46779 rightCols: t, 46780 beans: { colModel: i } 46781 } = this; 46782 return i.colSpanActive ? this.getColsForRow(e, t) : t; 46783 } 46784 getColsForRow(e, t, i, s) { 46785 const n = []; 46786 let o = null; 46787 for (let r = 0; r < t.length; r++) { 46788 const a = t[r], l = t.length - r, c = Math.min(a.getColSpan(e), l), u = [a]; 46789 if (c > 1) { 46790 const p = c - 1; 46791 for (let f = 1; f <= p; f++) 46792 u.push(t[r + f]); 46793 r += p; 46794 } 46795 let d; 46796 i ? (d = !1, u.forEach((p) => { 46797 i(p) && (d = !0); 46798 })) : d = !0, d && (n.length === 0 && o && s && s(a) && n.push(o), n.push(a)), o = a; 46799 } 46800 return n; 46801 } 46802 getContainerWidth(e) { 46803 switch (e) { 46804 case "left": 46805 return this.leftWidth; 46806 case "right": 46807 return this.rightWidth; 46808 default: 46809 return this.bodyWidth; 46810 } 46811 } 46812 getColBefore(e) { 46813 const t = this.allCols, i = t.indexOf(e); 46814 return i > 0 ? t[i - 1] : null; 46815 } 46816 isPinningLeft() { 46817 return this.leftCols.length > 0; 46818 } 46819 isPinningRight() { 46820 return this.rightCols.length > 0; 46821 } 46822 updateColsAndGroupsMap() { 46823 this.colsAndGroupsMap = {}; 46824 const e = (t) => { 46825 this.colsAndGroupsMap[t.getUniqueId()] = t; 46826 }; 46827 Ic(this.treeCenter, !1, e), Ic(this.treeLeft, !1, e), Ic(this.treeRight, !1, e); 46828 } 46829 isVisible(e) { 46830 return this.colsAndGroupsMap[e.getUniqueId()] === e; 46831 } 46832 getFirstColumn() { 46833 const e = this.gos.get("enableRtl"), t = ["leftCols", "centerCols", "rightCols"]; 46834 e && t.reverse(); 46835 for (let i = 0; i < t.length; i++) { 46836 const s = this[t[i]]; 46837 if (s.length) 46838 return e ? It(s) : s[0]; 46839 } 46840 return null; 46841 } 46842 // used by: 46843 // + rowRenderer -> for navigation 46844 getColAfter(e) { 46845 const t = this.allCols, i = t.indexOf(e); 46846 return i < t.length - 1 ? t[i + 1] : null; 46847 } 46848 // used by: 46849 // + angularGrid -> setting pinned body width 46850 // note: this should be cached 46851 getColsLeftWidth() { 46852 return Kr(this.leftCols); 46853 } 46854 // note: this should be cached 46855 getDisplayedColumnsRightWidth() { 46856 return Kr(this.rightCols); 46857 } 46858 isColAtEdge(e, t) { 46859 const i = this.allCols; 46860 if (!i.length) 46861 return !1; 46862 const s = t === "first"; 46863 let n; 46864 if (xi(e)) { 46865 const o = e.getDisplayedLeafColumns(); 46866 if (!o.length) 46867 return !1; 46868 n = s ? o[0] : It(o); 46869 } else 46870 n = e; 46871 return (s ? i[0] : It(i)) === n; 46872 } 46873}; 46874function Ic(e, t, i) { 46875 if (e) 46876 for (let s = 0; s < e.length; s++) { 46877 const n = e[s]; 46878 if (xi(n)) { 46879 const o = t ? n.getDisplayedChildren() : n.getChildren(); 46880 Ic(o, t, i); 46881 } 46882 i(n); 46883 } 46884} 46885function k0(e) { 46886 const t = []; 46887 return Ic(e, !0, (i) => { 46888 Al(i) && t.push(i); 46889 }), t; 46890} 46891var bse = class extends he { 46892 constructor() { 46893 super(...arguments), this.beanName = "colGroupSvc"; 46894 } 46895 getColumnGroupState() { 46896 const e = [], t = this.beans.colModel.getColTree(); 46897 return aa(null, t, (i) => { 46898 js(i) && e.push({ 46899 groupId: i.getGroupId(), 46900 open: i.isExpanded() 46901 }); 46902 }), e; 46903 } 46904 resetColumnGroupState(e) { 46905 const t = this.beans.colModel.getColDefColTree(); 46906 if (!t) 46907 return; 46908 const i = []; 46909 aa(null, t, (s) => { 46910 if (js(s)) { 46911 const n = s.getColGroupDef(), o = { 46912 groupId: s.getGroupId(), 46913 open: n ? n.openByDefault : void 0 46914 }; 46915 i.push(o); 46916 } 46917 }), this.setColumnGroupState(i, e); 46918 } 46919 setColumnGroupState(e, t) { 46920 const { colModel: i, colAnimation: s, visibleCols: n, eventSvc: o } = this.beans; 46921 if (!i.getColTree()) 46922 return; 46923 s?.start(); 46924 const a = []; 46925 e.forEach((l) => { 46926 const c = l.groupId, u = l.open, d = this.getProvidedColGroup(c); 46927 d && d.isExpanded() !== u && (d.setExpanded(u), a.push(d)); 46928 }), n.refresh(t, !0), a.length && o.dispatchEvent({ 46929 type: "columnGroupOpened", 46930 columnGroup: a.length === 1 ? a[0] : void 0, 46931 columnGroups: a 46932 }), s?.finish(); 46933 } 46934 // called by headerRenderer - when a header is opened or closed 46935 setColumnGroupOpened(e, t, i) { 46936 let s; 46937 js(e) ? s = e.getId() : s = e || "", this.setColumnGroupState([{ groupId: s, open: t }], i); 46938 } 46939 getProvidedColGroup(e) { 46940 let t = null; 46941 return aa(null, this.beans.colModel.getColTree(), (i) => { 46942 js(i) && i.getId() === e && (t = i); 46943 }), t; 46944 } 46945 getGroupAtDirection(e, t) { 46946 const i = e.getProvidedColumnGroup().getLevel() + e.getPaddingLevel(), s = e.getDisplayedLeafColumns(), n = t === "After" ? It(s) : s[0], o = `getCol${t}`; 46947 for (; ; ) { 46948 const r = this.beans.visibleCols[o](n); 46949 if (!r) 46950 return null; 46951 const a = this.getColGroupAtLevel(r, i); 46952 if (a !== e) 46953 return a; 46954 } 46955 } 46956 getColGroupAtLevel(e, t) { 46957 let i = e.getParent(), s, n; 46958 for (; s = i.getProvidedColumnGroup().getLevel(), n = i.getPaddingLevel(), !(s + n <= t); ) 46959 i = i.getParent(); 46960 return i; 46961 } 46962 updateOpenClosedVisibility() { 46963 const e = this.beans.visibleCols.getAllTrees(); 46964 Ic(e, !1, (t) => { 46965 xi(t) && t.calculateDisplayedColumns(); 46966 }); 46967 } 46968 // returns the group with matching colId and instanceId. If instanceId is missing, 46969 // matches only on the colId. 46970 getColumnGroup(e, t) { 46971 if (!e) 46972 return null; 46973 if (xi(e)) 46974 return e; 46975 const i = this.beans.visibleCols.getAllTrees(), s = typeof t == "number"; 46976 let n = null; 46977 return Ic(i, !1, (o) => { 46978 if (xi(o)) { 46979 const r = o; 46980 let a; 46981 s ? a = e === r.getGroupId() && t === r.getPartId() : a = e === r.getGroupId(), a && (n = r); 46982 } 46983 }), n; 46984 } 46985 createColumnGroups(e) { 46986 const { columns: t, idCreator: i, pinned: s, oldDisplayedGroups: n, isStandaloneStructure: o } = e, r = this.mapOldGroupsById(n), a = []; 46987 let l = t; 46988 for (; l.length; ) { 46989 const c = l; 46990 l = []; 46991 let u = 0; 46992 const d = (p) => { 46993 const f = u; 46994 u = p; 46995 const m = c[f], b = (xi(m) ? m.getProvidedColumnGroup() : m).getOriginalParent(); 46996 if (b == null) { 46997 for (let w = f; w < p; w++) 46998 a.push(c[w]); 46999 return; 47000 } 47001 const C = this.createColumnGroup( 47002 b, 47003 i, 47004 r, 47005 s, 47006 o 47007 ); 47008 for (let w = f; w < p; w++) 47009 C.addChild(c[w]); 47010 l.push(C); 47011 }; 47012 for (let p = 1; p < c.length; p++) { 47013 const f = c[p], y = (xi(f) ? f.getProvidedColumnGroup() : f).getOriginalParent(), b = c[u], w = (xi(b) ? b.getProvidedColumnGroup() : b).getOriginalParent(); 47014 y !== w && d(p); 47015 } 47016 u < c.length && d(c.length); 47017 } 47018 return o || this.setupParentsIntoCols(a, null), a; 47019 } 47020 createProvidedColumnGroup(e, t, i, s, n, o, r) { 47021 const a = n.getUniqueKey(t.groupId || null, null), l = this.createMergedColGroupDef(t, a), c = new vm(l, a, !1, i); 47022 this.createBean(c); 47023 const u = this.findExistingGroup(t, o); 47024 u && o.splice(u.idx, 1); 47025 const d = u?.group; 47026 d && c.setExpanded(d.isExpanded()); 47027 const p = iN( 47028 this.beans, 47029 l.children, 47030 i + 1, 47031 e, 47032 s, 47033 n, 47034 o, 47035 r 47036 ); 47037 return c.setChildren(p), c; 47038 } 47039 balanceColumnTree(e, t, i, s) { 47040 const n = []; 47041 for (let o = 0; o < e.length; o++) { 47042 const r = e[o]; 47043 if (js(r)) { 47044 const a = r, l = this.balanceColumnTree( 47045 a.getChildren(), 47046 t + 1, 47047 i, 47048 s 47049 ); 47050 a.setChildren(l), n.push(a); 47051 } else { 47052 let a, l; 47053 for (let c = i - 1; c >= t; c--) { 47054 const u = s.getUniqueKey(null, null), d = this.createMergedColGroupDef(null, u), p = new vm(d, u, !0, t); 47055 this.createBean(p), l && l.setChildren([p]), l = p, a || (a = l); 47056 } 47057 if (a && l) 47058 if (n.push(a), e.some((u) => js(u))) { 47059 l.setChildren([r]); 47060 continue; 47061 } else { 47062 l.setChildren(e); 47063 break; 47064 } 47065 n.push(r); 47066 } 47067 } 47068 return n; 47069 } 47070 findDepth(e) { 47071 let t = 0, i = e; 47072 for (; i && i[0] && js(i[0]); ) 47073 t++, i = i[0].getChildren(); 47074 return t; 47075 } 47076 findMaxDepth(e, t) { 47077 let i = t; 47078 for (let s = 0; s < e.length; s++) { 47079 const n = e[s]; 47080 if (js(n)) { 47081 const o = n, r = this.findMaxDepth(o.getChildren(), t + 1); 47082 i < r && (i = r); 47083 } 47084 } 47085 return i; 47086 } 47087 /** 47088 * Inserts dummy group columns in the hierarchy above auto-generated columns 47089 * in order to ensure auto-generated columns are leaf nodes (and therefore are 47090 * displayed correctly) 47091 */ 47092 balanceTreeForAutoCols(e, t) { 47093 const i = []; 47094 return e.forEach((s) => { 47095 let n = s; 47096 for (let o = t - 1; o >= 0; o--) { 47097 const r = new vm(null, `FAKE_PATH_${s.getId()}}_${o}`, !0, o); 47098 this.createBean(r), r.setChildren([n]), n.originalParent = r, n = r; 47099 } 47100 t === 0 && (s.originalParent = null), i.push(n); 47101 }), i; 47102 } 47103 createMergedColGroupDef(e, t) { 47104 const i = {}, { gos: s, validation: n } = this.beans; 47105 return Object.assign(i, s.get("defaultColGroupDef")), Object.assign(i, e), n?.validateColDef(i, t), i; 47106 } 47107 findExistingGroup(e, t) { 47108 if (e.groupId != null) 47109 for (let s = 0; s < t.length; s++) { 47110 const n = t[s]; 47111 if (n.getColGroupDef() && n.getId() === e.groupId) 47112 return { idx: s, group: n }; 47113 } 47114 } 47115 createColumnGroup(e, t, i, s, n) { 47116 const o = e.getGroupId(), r = t.getInstanceIdForKey(o), a = yN(o, r); 47117 let l = i[a]; 47118 return l && l.getProvidedColumnGroup() !== e && (l = null), Ie(l) ? l.reset() : (l = new CN(e, o, r, s), n || this.createBean(l)), l; 47119 } 47120 // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup 47121 mapOldGroupsById(e) { 47122 const t = {}, i = (s) => {
47123 s.forEach((n) => { 47124 if (xi(n)) { 47125 const o = n; 47126 t[n.getUniqueId()] = o, i(o.getChildren()); 47127 } 47128 }); 47129 }; 47130 return e && i(e), t; 47131 } 47132 setupParentsIntoCols(e, t) { 47133 e.forEach((i) => { 47134 if (i.parent = t, xi(i)) { 47135 const s = i; 47136 this.setupParentsIntoCols(s.getChildren(), s); 47137 } 47138 }); 47139 } 47140}, wse = { 47141 moduleName: "ColumnGroup", 47142 version: Fe, 47143 dynamicBeans: { headerGroupCellCtrl: rse }, 47144 beans: [bse], 47145 apiFunctions: { 47146 getAllDisplayedColumnGroups: vse, 47147 getCenterDisplayedColumnGroups: fse, 47148 getColumnGroup: lse, 47149 getColumnGroupState: dse, 47150 getDisplayNameForColumnGroup: use, 47151 getLeftDisplayedColumnGroups: gse, 47152 getProvidedColumnGroup: cse, 47153 getRightDisplayedColumnGroups: mse, 47154 resetColumnGroupState: pse, 47155 setColumnGroupOpened: ase, 47156 setColumnGroupState: hse 47157 } 47158}, Sse = { 47159 moduleName: "CheckboxCellRenderer", 47160 version: Fe, 47161 userComponents: { 47162 agCheckboxCellRenderer: Ate 47163 } 47164}; 47165function xse(e, t) { 47166 const i = e.colModel.getColDefCol(t); 47167 return i ? i.getColDef() : null; 47168} 47169function Mse(e) { 47170 return e.colModel.getColumnDefs(); 47171} 47172function Ase(e, t, i) { 47173 return e.colNames.getDisplayNameForColumn(t, i) || ""; 47174} 47175function Dse(e, t) { 47176 return e.colModel.getColDefCol(t); 47177} 47178function Ese(e) { 47179 return e.colModel.getColDefCols(); 47180} 47181function Ise(e, t) { 47182 return Wo(e, t, "api"); 47183} 47184function Rse(e) { 47185 return qp(e); 47186} 47187function Tse(e) { 47188 EX(e, "api"); 47189} 47190function Lse(e) { 47191 return e.visibleCols.isPinningLeft() || e.visibleCols.isPinningRight(); 47192} 47193function kse(e) { 47194 return e.visibleCols.isPinningLeft(); 47195} 47196function Pse(e) { 47197 return e.visibleCols.isPinningRight(); 47198} 47199function Fse(e, t) { 47200 return e.visibleCols.getColAfter(t); 47201} 47202function Ose(e, t) { 47203 return e.visibleCols.getColBefore(t); 47204} 47205function Nse(e, t, i) { 47206 e.colModel.setColsVisible(t, i, "api"); 47207} 47208function _se(e, t, i) { 47209 e.pinnedCols?.setColsPinned(t, i, "api"); 47210} 47211function Bse(e) { 47212 return e.colModel.getCols(); 47213} 47214function Gse(e) { 47215 return e.visibleCols.leftCols; 47216} 47217function zse(e) { 47218 return e.visibleCols.centerCols; 47219} 47220function Hse(e) { 47221 return e.visibleCols.rightCols; 47222} 47223function Vse(e) { 47224 return e.visibleCols.allCols; 47225} 47226function Use(e) { 47227 return e.colViewport.getViewportColumns(); 47228} 47229function nS(e, t) { 47230 if (!e) 47231 return; 47232 const i = e, s = {};
47233 return Object.keys(i).forEach((n) => { 47234 if (t && t.indexOf(n) >= 0 || UO.has(n)) 47235 return; 47236 const o = i[n]; 47237 typeof o == "object" && o !== null && o.constructor === Object ? s[n] = nS(o) : s[n] = o; 47238 }), s; 47239} 47240var Wse = class extends he { 47241 constructor() { 47242 super(...arguments), this.beanName = "colDefFactory"; 47243 } 47244 wireBeans(e) { 47245 this.rowGroupColsSvc = e.rowGroupColsSvc, this.pivotColsSvc = e.pivotColsSvc; 47246 } 47247 getColumnDefs(e, t, i, s) { 47248 const n = e.slice(); 47249 t ? n.sort((a, l) => i.indexOf(a) - i.indexOf(l)) : i && n.sort((a, l) => s.indexOf(a) - s.indexOf(l)); 47250 const o = this.rowGroupColsSvc?.columns, r = this.pivotColsSvc?.columns; 47251 return this.buildColumnDefs(n, o, r); 47252 } 47253 buildColumnDefs(e, t = [], i = []) { 47254 const s = [], n = {}; 47255 return e.forEach((o) => { 47256 const r = this.createDefFromColumn(o, t, i); 47257 let a = !0, l = r, c = o.getOriginalParent(), u = null; 47258 for (; c; ) { 47259 let d = null; 47260 if (c.isPadding()) { 47261 c = c.getOriginalParent(); 47262 continue; 47263 } 47264 const p = n[c.getGroupId()]; 47265 if (p) { 47266 p.children.push(l), a = !1; 47267 break; 47268 } 47269 if (d = this.createDefFromGroup(c), d && (d.children = [l], n[d.groupId] = d, l = d, c = c.getOriginalParent()), c != null && u === c) { 47270 a = !1; 47271 break; 47272 } 47273 u = c; 47274 } 47275 a && s.push(l); 47276 }), s; 47277 } 47278 createDefFromGroup(e) { 47279 const t = nS(e.getColGroupDef(), ["children"]); 47280 return t && (t.groupId = e.getGroupId()), t; 47281 } 47282 createDefFromColumn(e, t, i) { 47283 const s = nS(e.getColDef()); 47284 return s.colId = e.getColId(), s.width = e.getActualWidth(), s.rowGroup = e.isRowGroupActive(), s.rowGroupIndex = e.isRowGroupActive() ? t.indexOf(e) : null, s.pivot = e.isPivotActive(), s.pivotIndex = e.isPivotActive() ? i.indexOf(e) : null, s.aggFunc = e.isValueActive() ? e.getAggFunc() : null, s.hide = e.isVisible() ? void 0 : !0, s.pinned = e.isPinned() ? e.getPinned() : null, s.sort = e.getSort() ? e.getSort() : null, s.sortIndex = e.getSortIndex() != null ? e.getSortIndex() : null, s; 47285 } 47286}, jse = class extends he { 47287 constructor() { 47288 super(...arguments), this.beanName = "colFlex"; 47289 } 47290 refreshFlexedColumns(e = {}) { 47291 const t = e.source ? e.source : "flex"; 47292 e.viewportWidth != null && (this.flexViewportWidth = e.viewportWidth); 47293 const i = this.flexViewportWidth; 47294 if (!i) 47295 return []; 47296 const { visibleCols: s } = this.beans, n = s.centerCols; 47297 let o = -1; 47298 if (e.resizingCols) { 47299 const m = new Set(e.resizingCols); 47300 for (let y = n.length - 1; y >= 0; y--) 47301 if (m.has(n[y])) { 47302 o = y; 47303 break; 47304 } 47305 } 47306 let r = !1; 47307 const a = n.map((m, y) => { 47308 const b = m.getFlex(), C = b != null && b > 0 && y > o; 47309 return r || (r = C), { 47310 col: m, 47311 isFlex: C, 47312 flex: Math.max(0, b ?? 0), 47313 initialSize: m.getActualWidth(), 47314 min: m.getMinWidth(), 47315 max: m.getMaxWidth(), 47316 targetSize: 0 47317 }; 47318 }); 47319 if (!r) 47320 return []; 47321 let l = a.length, c = a.reduce((m, y) => m + y.flex, 0), u = i; 47322 const d = (m, y) => { 47323 m.frozenSize = y, m.col.setActualWidth(y, t), u -= y, c -= m.flex, l -= 1; 47324 }, p = (m) => m.frozenSize != null; 47325 for (const m of a) 47326 m.isFlex || d(m, m.initialSize); 47327 for (; l > 0; ) { 47328 const m = Math.round(c < 1 ? u * c : u); 47329 let y, b = 0, C = 0; 47330 for (const A of a) { 47331 if (p(A)) 47332 continue; 47333 y = A, C += m * (A.flex / c); 47334 const I = C - b, L = Math.round(I); 47335 A.targetSize = L, b += L; 47336 } 47337 y && (y.targetSize += m - b); 47338 let w = 0; 47339 for (const A of a) { 47340 if (p(A)) 47341 continue; 47342 const I = A.targetSize, L = Math.min(Math.max(I, A.min), A.max); 47343 w += L - I, A.violationType = L === I ? void 0 : L < I ? "max" : "min", A.targetSize = L; 47344 } 47345 const M = w === 0 ? "all" : w > 0 ? "min" : "max"; 47346 for (const A of a) 47347 p(A) || (M === "all" || A.violationType === M) && d(A, A.targetSize); 47348 } 47349 e.skipSetLeft || s.setLeftValues(t), e.updateBodyWidths && s.updateBodyWidths(); 47350 const f = a.filter((m) => m.isFlex && !m.violationType).map((m) => m.col); 47351 if (e.fireResizedEvent) { 47352 const m = a.filter((b) => b.initialSize !== b.frozenSize).map((b) => b.col), y = a.filter((b) => b.flex).map((b) => b.col); 47353 Ed(this.eventSvc, m, !0, t, y); 47354 } 47355 return f; 47356 } 47357 initCol(e) { 47358 const { flex: t, initialFlex: i } = e.colDef; 47359 t !== void 0 ? e.flex = t : i !== void 0 && (e.flex = i); 47360 } 47361 // this method should only be used by the colModel to 47362 // change flex when required by the applyColumnState method. 47363 setColFlex(e, t) { 47364 e.flex = t ?? null, e.dispatchStateUpdatedEvent("flex"); 47365 } 47366}, $se = class extends he {
47367 constructor() { 47368 super(...arguments), this.beanName = "dataTypeSvc", this.dataTypeDefinitions = {}, this.isPendingInference = !1, this.isColumnTypeOverrideInDataTypeDefinitions = !1, this.columnStateUpdatesPendingInference = {}, this.columnStateUpdateListenerDestroyFuncs = []; 47369 } 47370 wireBeans(e) { 47371 this.colModel = e.colModel; 47372 } 47373 postConstruct() { 47374 this.processDataTypeDefinitions(), this.addManagedPropertyListener("dataTypeDefinitions", (e) => { 47375 this.processDataTypeDefinitions(), this.colModel.recreateColumnDefs(cd(e.source)); 47376 }); 47377 } 47378 processDataTypeDefinitions() { 47379 const e = this.getDefaultDataTypes(), t = {}; 47380 this.dataTypeDefinitions = t; 47381 const i = {}; 47382 this.formatValueFuncs = i; 47383 const s = (r) => (a) => { 47384 const { column: l, node: c, value: u } = a; 47385 let d = l.getColDef().valueFormatter; 47386 return d === r.groupSafeValueFormatter && (d = r.valueFormatter), this.beans.valueSvc.formatValue(l, c, u, d); 47387 }; 47388 Object.entries(e).forEach(([r, a]) => { 47389 const l = { 47390 ...a, 47391 groupSafeValueFormatter: rT(a, this.gos) 47392 }; 47393 t[r] = l, i[r] = s(l); 47394 }); 47395 const n = this.gos.get("dataTypeDefinitions") ?? {}, o = {}; 47396 this.dataTypeMatchers = o, Object.entries(n).forEach(([r, a]) => { 47397 const l = this.processDataTypeDefinition( 47398 a, 47399 n, 47400 [r], 47401 e 47402 ); 47403 l && (t[r] = l, a.dataTypeMatcher && (o[r] = a.dataTypeMatcher), i[r] = s(l)); 47404 }), this.checkObjectValueHandlers(e), ["dateString", "text", "number", "boolean", "date"].forEach((r) => { 47405 const a = o[r]; 47406 a && delete o[r], o[r] = a ?? e[r].dataTypeMatcher; 47407 }); 47408 } 47409 processDataTypeDefinition(e, t, i, s) { 47410 let n; 47411 const o = e.extendsDataType; 47412 if (e.columnTypes && (this.isColumnTypeOverrideInDataTypeDefinitions = !0), e.extendsDataType === e.baseDataType) { 47413 let r = s[o]; 47414 const a = t[o]; 47415 if (r && a && (r = a), !oT(e, r, o)) 47416 return; 47417 n = nT(r, e); 47418 } else { 47419 if (i.includes(o)) { 47420 Ae(44); 47421 return; 47422 } 47423 const r = t[o]; 47424 if (!oT(e, r, o)) 47425 return; 47426 const a = this.processDataTypeDefinition( 47427 r, 47428 t, 47429 [...i, o], 47430 s 47431 ); 47432 if (!a) 47433 return; 47434 n = nT(a, e); 47435 } 47436 return { 47437 ...n, 47438 groupSafeValueFormatter: rT(n, this.gos) 47439 }; 47440 } 47441 updateColDefAndGetColumnType(e, t, i) { 47442 let { cellDataType: s } = t; 47443 const { field: n } = t; 47444 if (s === void 0 && (s = e.cellDataType), (s == null || s === !0) && (s = this.canInferCellDataType(e, t) ? this.inferCellDataType(n, i) : !1), !s) { 47445 e.cellDataType = !1; 47446 return; 47447 } 47448 const o = this.dataTypeDefinitions[s]; 47449 if (!o) { 47450 Ae(47, { cellDataType: s }); 47451 return; 47452 } 47453 return e.cellDataType = s, o.groupSafeValueFormatter && (e.valueFormatter = o.groupSafeValueFormatter), o.valueParser && (e.valueParser = o.valueParser), o.suppressDefaultProperties || this.setColDefPropertiesForBaseDataType(e, s, o, i), o.columnTypes; 47454 } 47455 addColumnListeners(e) { 47456 if (!this.isPendingInference) 47457 return; 47458 const t = this.columnStateUpdatesPendingInference[e.getColId()]; 47459 if (!t) 47460 return; 47461 const i = (s) => { 47462 t.add(s.key); 47463 }; 47464 e.addEventListener("columnStateUpdated", i), this.columnStateUpdateListenerDestroyFuncs.push( 47465 () => e.removeEventListener("columnStateUpdated", i) 47466 ); 47467 } 47468 canInferCellDataType(e, t) { 47469 const { gos: i } = this; 47470 if (!$s(i)) 47471 return !1; 47472 const s = { cellRenderer: !0, valueGetter: !0, valueParser: !0, refData: !0 }; 47473 if (P0(t, s)) 47474 return !1; 47475 const n = t.type === null ? e.type : t.type; 47476 if (n) { 47477 const o = i.get("columnTypes") ?? {}; 47478 if (cv(n).some((a) => { 47479 const l = o[a.trim()]; 47480 return l && P0(l, s); 47481 })) 47482 return !1; 47483 } 47484 return !P0(e, s); 47485 } 47486 inferCellDataType(e, t) { 47487 if (!e) 47488 return; 47489 let i; 47490 const s = this.getInitialData(); 47491 if (s) { 47492 const o = e.indexOf(".") >= 0 && !this.gos.get("suppressFieldDotNotation"); 47493 i = hp(s, e, o); 47494 } else 47495 this.initWaitForRowData(t); 47496 if (i == null) 47497 return; 47498 const [n] = Object.entries(this.dataTypeMatchers).find( 47499 ([o, r]) => r(i) 47500 ) ?? ["object"]; 47501 return n; 47502 } 47503 getInitialData() { 47504 const e = this.gos.get("rowData"); 47505 if (e?.length) 47506 return e[0]; 47507 if (this.initialData) 47508 return this.initialData; 47509 { 47510 const t = this.beans.rowModel.rootNode?.allLeafChildren; 47511 if (t?.length) 47512 return t[0].data; 47513 } 47514 return null; 47515 } 47516 initWaitForRowData(e) { 47517 if (this.columnStateUpdatesPendingInference[e] = /* @__PURE__ */ new Set(), this.isPendingInference) 47518 return; 47519 this.isPendingInference = !0; 47520 const t = this.isColumnTypeOverrideInDataTypeDefinitions, { colAutosize: i, eventSvc: s } = this.beans; 47521 t && i && (i.shouldQueueResizeOperations = !0); 47522 const [n] = this.addManagedEventListeners({ 47523 rowDataUpdateStarted: (o) => { 47524 const { firstRowData: r } = o; 47525 r && (n?.(), this.isPendingInference = !1, this.processColumnsPendingInference(r, t), this.columnStateUpdatesPendingInference = {}, t && i?.processResizeOperations(), s.dispatchEvent({ 47526 type: "dataTypesInferred" 47527 })); 47528 } 47529 }); 47530 } 47531 processColumnsPendingInference(e, t) { 47532 this.initialData = e; 47533 const i = []; 47534 this.destroyColumnStateUpdateListeners(); 47535 const s = {}, n = {};
47536 Object.entries(this.columnStateUpdatesPendingInference).forEach(([o, r]) => { 47537 const a = this.colModel.getCol(o); 47538 if (!a) 47539 return; 47540 const l = a.getColDef(); 47541 if (!this.resetColDefIntoCol(a, "cellDataTypeInferred")) 47542 return; 47543 const c = a.getColDef(); 47544 if (t && c.type && c.type !== l.type) { 47545 const u = Kse(a, r); 47546 u.rowGroup && u.rowGroupIndex == null && (s[o] = u), u.pivot && u.pivotIndex == null && (n[o] = u), i.push(u); 47547 } 47548 }), t && i.push( 47549 ...this.generateColumnStateForRowGroupAndPivotIndexes( 47550 s, 47551 n 47552 ) 47553 ), i.length && Wo(this.beans, { state: i }, "cellDataTypeInferred"), this.initialData = null; 47554 } 47555 generateColumnStateForRowGroupAndPivotIndexes(e, t) { 47556 const i = {}, { rowGroupColsSvc: s, pivotColsSvc: n } = this.beans; 47557 return s?.restoreColumnOrder(i, e), n?.restoreColumnOrder(i, t), Object.values(i); 47558 } 47559 resetColDefIntoCol(e, t) { 47560 const i = e.getUserProvidedColDef(); 47561 if (!i) 47562 return !1; 47563 const s = Zw(this.beans, i, e.getColId()); 47564 return e.setColDef(s, i, t), !0; 47565 } 47566 checkObjectValueHandlers(e) { 47567 const t = this.dataTypeDefinitions.object, i = e.object; 47568 this.hasObjectValueParser = t.valueParser !== i.valueParser, this.hasObjectValueFormatter = t.valueFormatter !== i.valueFormatter; 47569 } 47570 getDateStringTypeDefinition(e) { 47571 const { dateString: t } = this.dataTypeDefinitions; 47572 return e ? this.getDataTypeDefinition(e) ?? t : t; 47573 } 47574 getDateParserFunction(e) { 47575 return this.getDateStringTypeDefinition(e).dateParser; 47576 } 47577 getDateFormatterFunction(e) { 47578 return this.getDateStringTypeDefinition(e).dateFormatter; 47579 } 47580 getDataTypeDefinition(e) { 47581 const t = e.getColDef(); 47582 if (t.cellDataType) 47583 return this.dataTypeDefinitions[t.cellDataType]; 47584 } 47585 getBaseDataType(e) { 47586 return this.getDataTypeDefinition(e)?.baseDataType; 47587 } 47588 checkType(e, t) { 47589 if (t == null) 47590 return !0; 47591 const i = this.getDataTypeDefinition(e)?.dataTypeMatcher; 47592 return i ? i(t) : !0; 47593 } 47594 validateColDef(e) { 47595 const t = (i) => Ae(48, { property: i }); 47596 if (e.cellDataType === "object") { 47597 const { object: i } = this.dataTypeDefinitions; 47598 e.valueFormatter === i.groupSafeValueFormatter && !this.hasObjectValueFormatter && t("Formatter"), e.editable && e.valueParser === i.valueParser && !this.hasObjectValueParser && t("Parser"); 47599 } 47600 } 47601 getFormatValue(e) { 47602 return this.formatValueFuncs[e]; 47603 } 47604 isColPendingInference(e) { 47605 return this.isPendingInference && !!this.columnStateUpdatesPendingInference[e]; 47606 } 47607 setColDefPropertiesForBaseDataType(e, t, i, s) { 47608 const n = this.formatValueFuncs[t]; 47609 switch (i.baseDataType) { 47610 case "number": { 47611 e.cellEditor = "agNumberCellEditor"; 47612 break; 47613 } 47614 case "boolean": { 47615 e.cellEditor = "agCheckboxCellEditor", e.cellRenderer = "agCheckboxCellRenderer", e.suppressKeyboardEvent = (o) => !!o.colDef.editable && o.event.key === de.SPACE; 47616 break; 47617 } 47618 case "date": { 47619 e.cellEditor = "agDateCellEditor", e.keyCreator = n; 47620 break; 47621 } 47622 case "dateString": { 47623 e.cellEditor = "agDateStringCellEditor", e.keyCreator = n; 47624 break; 47625 } 47626 case "object": { 47627 e.cellEditorParams = { 47628 useFormatter: !0 47629 }, e.comparator = (o, r) => { 47630 const a = this.colModel.getColDefCol(s), l = a?.getColDef(); 47631 if (!a || !l) 47632 return 0; 47633 const c = o == null ? "" : n({ column: a, node: null, value: o }), u = r == null ? "" : n({ column: a, node: null, value: r }); 47634 return c === u ? 0 : c > u ? 1 : -1; 47635 }, e.keyCreator = n; 47636 break; 47637 } 47638 } 47639 this.beans.filterManager?.setColDefPropertiesForDataType(e, i, n); 47640 } 47641 getDefaultDataTypes() { 47642 const e = (i) => !!i.match("^\\d{4}-\\d{2}-\\d{2}$"), t = this.getLocaleTextFunc(); 47643 return { 47644 number: { 47645 baseDataType: "number", 47646 // can be empty space with legacy copy 47647 valueParser: (i) => i.newValue?.trim?.() === "" ? null : Number(i.newValue), 47648 valueFormatter: (i) => i.value == null ? "" : typeof i.value != "number" || isNaN(i.value) ? t("invalidNumber", "Invalid Number") : String(i.value), 47649 dataTypeMatcher: (i) => typeof i == "number" 47650 }, 47651 text: { 47652 baseDataType: "text", 47653 valueParser: (i) => i.newValue === "" ? null : Vw(i.newValue), 47654 dataTypeMatcher: (i) => typeof i == "string" 47655 }, 47656 boolean: { 47657 baseDataType: "boolean", 47658 valueParser: (i) => i.newValue == null ? i.newValue : i.newValue?.trim?.() === "" ? null : String(i.newValue).toLowerCase() === "true", 47659 valueFormatter: (i) => i.value == null ? "" : String(i.value), 47660 dataTypeMatcher: (i) => typeof i == "boolean" 47661 }, 47662 date: { 47663 baseDataType: "date", 47664 valueParser: (i) => fn(i.newValue == null ? null : String(i.newValue)), 47665 valueFormatter: (i) => i.value == null ? "" : !(i.value instanceof Date) || isNaN(i.value.getTime()) ? t("invalidDate", "Invalid Date") : yo(i.value, !1) ?? "", 47666 dataTypeMatcher: (i) => i instanceof Date 47667 }, 47668 dateString: { 47669 baseDataType: "dateString", 47670 dateParser: (i) => fn(i) ?? void 0, 47671 dateFormatter: (i) => yo(i ?? null, !1) ?? void 0, 47672 valueParser: (i) => e(String(i.newValue)) ? i.newValue : null, 47673 valueFormatter: (i) => e(String(i.value)) ? i.value : "", 47674 dataTypeMatcher: (i) => typeof i == "string" && e(i) 47675 }, 47676 object: { 47677 baseDataType: "object", 47678 valueParser: () => null, 47679 valueFormatter: (i) => Vw(i.value) ?? "" 47680 } 47681 }; 47682 } 47683 destroyColumnStateUpdateListeners() { 47684 this.columnStateUpdateListenerDestroyFuncs.forEach((e) => e()), this.columnStateUpdateListenerDestroyFuncs = []; 47685 } 47686 destroy() { 47687 this.dataTypeDefinitions = {}, this.dataTypeMatchers = {}, this.formatValueFuncs = {}, this.columnStateUpdatesPendingInference = {}, this.destroyColumnStateUpdateListeners(), super.destroy(); 47688 } 47689}; 47690function nT(e, t) { 47691 const i = { 47692 ...e, 47693 ...t 47694 }; 47695 return e.columnTypes && t.columnTypes && t.appendColumnTypes && (i.columnTypes = [ 47696 ...cv(e.columnTypes), 47697 ...cv(t.columnTypes) 47698 ]), i; 47699} 47700function oT(e, t, i) { 47701 return t ? t.baseDataType !== e.baseDataType ? (Ae(46), !1) : !0 : (Ae(45, { parentCellDataType: i }), !1); 47702} 47703function rT(e, t) { 47704 if (e.valueFormatter) 47705 return (i) => { 47706 if (i.node?.group) { 47707 const s = (i.colDef.pivotValueColumn ?? i.column).getAggFunc(); 47708 if (s) { 47709 if (s === "first" || s === "last") 47710 return e.valueFormatter(i); 47711 if (e.baseDataType === "number" && s !== "count") { 47712 if (typeof i.value == "number") 47713 return e.valueFormatter(i); 47714 if (typeof i.value == "object") { 47715 if (!i.value) 47716 return; 47717 if ("toNumber" in i.value) 47718 return e.valueFormatter({ 47719 ...i, 47720 value: i.value.toNumber() 47721 }); 47722 if ("value" in i.value) 47723 return e.valueFormatter({ 47724 ...i, 47725 value: i.value.value 47726 }); 47727 } 47728 } 47729 return; 47730 } 47731 if (t.get("groupDisplayType") === "groupRows" && !t.get("treeData")) 47732 return; 47733 } else if (t.get("groupHideOpenParents") && i.column.isRowGroupActive() && typeof i.value == "string" && !e.dataTypeMatcher?.(i.value)) 47734 return; 47735 return e.valueFormatter(i); 47736 }; 47737} 47738function Yse(e, t, i, s) { 47739 if (!t[i]) 47740 return !1; 47741 const n = e[i]; 47742 return n === null ? (t[i] = !1, !1) : s === void 0 ? !!n : n === s; 47743} 47744function P0(e, t) { 47745 return [ 47746 ["cellRenderer", "agSparklineCellRenderer"], 47747 ["valueGetter", void 0], 47748 ["valueParser", void 0], 47749 ["refData", void 0] 47750 ].some( 47751 ([i, s]) => Yse(e, t, i, s) 47752 ); 47753} 47754function Kse(e, t) { 47755 const i = qO(e); 47756 return t.forEach((s) => { 47757 delete i[s], s === "rowGroup" ? delete i.rowGroupIndex : s === "pivot" && delete i.pivotIndex; 47758 }), i; 47759} 47760var Zse = { 47761 moduleName: "DataType", 47762 version: Fe, 47763 beans: [$se], 47764 dependsOn: [Sse] 47765}, qse = { 47766 moduleName: "ColumnFlex", 47767 version: Fe, 47768 beans: [jse] 47769}, Qse = { 47770 moduleName: "ColumnApi", 47771 version: Fe, 47772 beans: [Wse],
47773 apiFunctions: { 47774 getColumnDef: xse, 47775 getDisplayNameForColumn: Ase, 47776 getColumn: Dse, 47777 getColumns: Ese, 47778 applyColumnState: Ise, 47779 getColumnState: Rse, 47780 resetColumnState: Tse, 47781 isPinning: Lse, 47782 isPinningLeft: kse, 47783 isPinningRight: Pse, 47784 getDisplayedColAfter: Fse, 47785 getDisplayedColBefore: Ose, 47786 setColumnsVisible: Nse, 47787 setColumnsPinned: _se, 47788 getAllGridColumns: Bse, 47789 getDisplayedLeftColumns: Gse, 47790 getDisplayedCenterColumns: zse, 47791 getDisplayedRightColumns: Hse, 47792 getAllDisplayedColumns: Vse, 47793 getAllDisplayedVirtualColumns: Use, 47794 getColumnDefs: Mse 47795 } 47796}; 47797function Xse(e) { 47798 if (!e || e == null) 47799 return null; 47800 const t = /([a-z])([A-Z])/g, i = /([A-Z]+)([A-Z])([a-z])/g; 47801 return e.replace(t, "$1 $2").replace(i, "$1 $2$3").replace(/\./g, " ").split(" ").map((n) => n.substring(0, 1).toUpperCase() + (n.length > 1 ? n.substring(1, n.length) : "")).join(" "); 47802} 47803var Jse = class extends he { 47804 constructor() { 47805 super(...arguments), this.beanName = "colNames"; 47806 } 47807 getDisplayNameForColumn(e, t, i = !1) { 47808 if (!e) 47809 return null; 47810 const s = this.getHeaderName(e.getColDef(), e, null, null, t), { aggColNameSvc: n } = this.beans; 47811 return i && n ? n.getHeaderName(e, s) : s; 47812 } 47813 getDisplayNameForProvidedColumnGroup(e, t, i) { 47814 const s = t?.getColGroupDef(); 47815 return s ? this.getHeaderName(s, null, e, t, i) : null; 47816 } 47817 getDisplayNameForColumnGroup(e, t) { 47818 return this.getDisplayNameForProvidedColumnGroup(e, e.getProvidedColumnGroup(), t); 47819 } 47820 // location is where the column is going to appear, ie who is calling us 47821 getHeaderName(e, t, i, s, n) { 47822 const o = e.headerValueGetter; 47823 if (o) { 47824 const r = this.gos.addGridCommonParams({ 47825 colDef: e, 47826 column: t, 47827 columnGroup: i, 47828 providedColumnGroup: s, 47829 location: n 47830 }); 47831 return typeof o == "function" ? o(r) : typeof o == "string" ? this.beans.expressionSvc?.evaluate(o, r) ?? null : ""; 47832 } else { 47833 if (e.headerName != null) 47834 return e.headerName; 47835 if (e.field) 47836 return Xse(e.field); 47837 } 47838 return ""; 47839 } 47840}, ene = class extends he { 47841 constructor() { 47842 super(...arguments), this.beanName = "colViewport", this.colsWithinViewport = [], this.headerColsWithinViewport = [], this.colsWithinViewportHash = "", this.rowsOfHeadersToRenderLeft = {}, this.rowsOfHeadersToRenderRight = {}, this.rowsOfHeadersToRenderCenter = {}; 47843 } 47844 wireBeans(e) { 47845 this.visibleCols = e.visibleCols, this.colModel = e.colModel; 47846 } 47847 postConstruct() { 47848 this.suppressColumnVirtualisation = this.gos.get("suppressColumnVirtualisation"); 47849 } 47850 setScrollPosition(e, t, i = !1) { 47851 const { visibleCols: s } = this, n = s.isBodyWidthDirty; 47852 if (!(e === this.scrollWidth && t === this.scrollPosition && !n)) { 47853 if (this.scrollWidth = e, this.scrollPosition = t, s.isBodyWidthDirty = !0, this.gos.get("enableRtl")) { 47854 const r = s.bodyWidth; 47855 this.viewportLeft = r - t - e, this.viewportRight = r - t; 47856 } else 47857 this.viewportLeft = t, this.viewportRight = e + t; 47858 this.colModel.ready && this.checkViewportColumns(i); 47859 } 47860 } 47861 getHeadersToRender(e, t) { 47862 let i; 47863 switch (e) { 47864 case "left": 47865 i = this.rowsOfHeadersToRenderLeft[t]; 47866 break; 47867 case "right": 47868 i = this.rowsOfHeadersToRenderRight[t]; 47869 break; 47870 default: 47871 i = this.rowsOfHeadersToRenderCenter[t]; 47872 break; 47873 } 47874 return i || []; 47875 } 47876 extractViewportColumns() { 47877 const e = this.visibleCols.centerCols; 47878 this.isColumnVirtualisationSuppressed() ? (this.colsWithinViewport = e, this.headerColsWithinViewport = e) : (this.colsWithinViewport = e.filter(this.isColumnInRowViewport.bind(this)), this.headerColsWithinViewport = e.filter(this.isColumnInHeaderViewport.bind(this))); 47879 } 47880 isColumnVirtualisationSuppressed() { 47881 return this.suppressColumnVirtualisation || this.viewportRight === 0; 47882 } 47883 clear(e) { 47884 this.rowsOfHeadersToRenderLeft = {}, this.rowsOfHeadersToRenderRight = {}, this.rowsOfHeadersToRenderCenter = {}, e || (this.colsWithinViewportHash = ""); 47885 } 47886 isColumnInHeaderViewport(e) { 47887 return e.isAutoHeaderHeight() || tne(e) ? !0 : this.isColumnInRowViewport(e); 47888 } 47889 isColumnInRowViewport(e) { 47890 if (e.isAutoHeight()) 47891 return !0; 47892 const t = e.getLeft() || 0, i = t + e.getActualWidth(), s = this.viewportLeft - 200, n = this.viewportRight + 200, o = t < s && i < s, r = t > n && i > n; 47893 return !o && !r; 47894 } 47895 // used by Grid API only 47896 getViewportColumns() {
47897 const { leftCols: e, rightCols: t } = this.visibleCols; 47898 return this.colsWithinViewport.concat(e).concat(t); 47899 } 47900 // + rowRenderer 47901 // if we are not column spanning, this just returns back the virtual centre columns, 47902 // however if we are column spanning, then different rows can have different virtual 47903 // columns, so we have to work out the list for each individual row. 47904 getColsWithinViewport(e) { 47905 if (!this.colModel.colSpanActive) 47906 return this.colsWithinViewport; 47907 const t = (o) => { 47908 const r = o.getLeft(); 47909 return Ie(r) && r > this.viewportLeft; 47910 }, i = this.isColumnVirtualisationSuppressed() ? void 0 : this.isColumnInRowViewport.bind(this), { visibleCols: s } = this, n = s.centerCols; 47911 return s.getColsForRow(e, n, i, t); 47912 } 47913 // checks what columns are currently displayed due to column virtualisation. dispatches an event 47914 // if the list of columns has changed. 47915 // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit() 47916 checkViewportColumns(e = !1) { 47917 this.extractViewport() && this.eventSvc.dispatchEvent({ 47918 type: "virtualColumnsChanged", 47919 afterScroll: e 47920 }); 47921 } 47922 calculateHeaderRows() { 47923 this.clear(!0); 47924 const e = {}, { leftCols: t, rightCols: i, treeLeft: s, treeRight: n, treeCenter: o } = this.visibleCols; 47925 this.headerColsWithinViewport.concat(t).concat(i).forEach((l) => e[l.getId()] = !0); 47926 const a = (l, c, u) => { 47927 let d = !1; 47928 for (let p = 0; p < l.length; p++) { 47929 const f = l[p]; 47930 let m = !1; 47931 if (Al(f)) 47932 m = e[f.getId()] === !0; 47933 else { 47934 const b = f.getDisplayedChildren(); 47935 b && (m = a(b, c, u + 1)); 47936 } 47937 m && (d = !0, c[u] || (c[u] = []), c[u].push(f)); 47938 } 47939 return d; 47940 }; 47941 a(s, this.rowsOfHeadersToRenderLeft, 0), a(n, this.rowsOfHeadersToRenderRight, 0), a(o, this.rowsOfHeadersToRenderCenter, 0); 47942 } 47943 extractViewport() { 47944 const e = (s) => `${s.getId()}-${s.getPinned() || "normal"}`; 47945 this.extractViewportColumns(); 47946 const t = this.getViewportColumns().map(e).join("#"), i = this.colsWithinViewportHash !== t; 47947 return i && (this.colsWithinViewportHash = t, this.calculateHeaderRows()), i; 47948 } 47949}; 47950function tne(e) { 47951 for (; e; ) { 47952 if (e.isAutoHeaderHeight()) 47953 return !0; 47954 e = e.getParent(); 47955 } 47956 return !1; 47957} 47958var ine = class extends he { 47959 constructor() { 47960 super(...arguments), this.beanName = "agCompUtils"; 47961 } 47962 adaptFunction(e, t) { 47963 if (!e.cellRenderer) 47964 return null; 47965 class i { 47966 refresh() { 47967 return !1; 47968 } 47969 getGui() { 47970 return this.eGui; 47971 } 47972 init(n) { 47973 const o = t(n), r = typeof o; 47974 if (r === "string" || r === "number" || r === "boolean") { 47975 this.eGui = $p("<span>" + o + "</span>"); 47976 return; 47977 } 47978 if (o == null) { 47979 this.eGui = $p("<span></span>"); 47980 return; 47981 } 47982 this.eGui = o; 47983 } 47984 } 47985 return i; 47986 } 47987}, sne = { 47988 moduleName: "CellRendererFunction", 47989 version: Fe, 47990 beans: [ine] 47991}, nne = class extends he { 47992 constructor() { 47993 super(...arguments), this.beanName = "registry", this.agGridDefaults = {}, this.agGridDefaultParams = {}, this.jsComps = {}, this.dynamicBeans = {}, this.selectors = {}, this.icons = {}; 47994 } 47995 postConstruct() { 47996 const e = this.gos.get("components"); 47997 e != null && Object.entries(e).forEach(([t, i]) => { 47998 this.jsComps[t] = i; 47999 }); 48000 } 48001 registerModule(e) { 48002 const { icons: t, userComponents: i, dynamicBeans: s, selectors: n } = e; 48003 if (i) { 48004 const o = (r, a, l) => { 48005 this.agGridDefaults[r] = a, l && (this.agGridDefaultParams[r] = l); 48006 }; 48007 for (const r of Object.keys(i)) { 48008 const a = i[r]; 48009 typeof a == "object" ? o(r, a.classImp, a.params) : o(r, a); 48010 } 48011 } 48012 if (s) 48013 for (const o of Object.keys(s)) 48014 this.dynamicBeans[o] = s[o]; 48015 if (n?.forEach((o) => { 48016 this.selectors[o.selector] = o; 48017 }), t) 48018 for (const o of Object.keys(t)) 48019 this.icons[o] = t[o]; 48020 } 48021 getUserComponent(e, t) { 48022 const i = (a, l, c) => ({ 48023 componentFromFramework: l, 48024 component: a, 48025 params: c 48026 }), { frameworkOverrides: s } = this.beans, n = s.frameworkComponent(t, this.gos.get("components")); 48027 if (n != null) 48028 return i(n, !0); 48029 const o = this.jsComps[t]; 48030 if (o) { 48031 const a = s.isFrameworkComponent(o); 48032 return i(o, a); 48033 } 48034 const r = this.agGridDefaults[t]; 48035 return r ? i(r, !1, this.agGridDefaultParams[t]) : (this.beans.validation?.missingUserComponent(e, t, this.agGridDefaults, this.jsComps), null); 48036 } 48037 createDynamicBean(e, t, ...i) { 48038 const s = this.dynamicBeans[e]; 48039 if (s == null) { 48040 if (t) 48041 throw new Error(vl(256)); 48042 return; 48043 } 48044 return new s(...i); 48045 } 48046 getSelector(e) { 48047 return this.selectors[e]; 48048 } 48049 getIcon(e) { 48050 return this.icons[e]; 48051 } 48052}, one = 23, rne = class extends he {
48053 constructor() { 48054 super(...arguments), this.beanName = "ctrlsSvc", this.params = {}, this.ready = !1, this.readyCallbacks = []; 48055 } 48056 postConstruct() { 48057 this.addEventListener( 48058 "ready", 48059 () => { 48060 this.updateReady(), this.ready && (this.readyCallbacks.forEach((e) => e(this.params)), this.readyCallbacks.length = 0); 48061 }, 48062 this.beans.frameworkOverrides.runWhenReadyAsync?.() ?? !1 48063 ); 48064 } 48065 updateReady() { 48066 const e = Object.values(this.params); 48067 this.ready = e.length === one && e.every((t) => t?.isAlive() ?? !1); 48068 } 48069 whenReady(e, t) { 48070 this.ready ? t(this.params) : this.readyCallbacks.push(t), e.addDestroyFunc(() => { 48071 const i = this.readyCallbacks.indexOf(t); 48072 i >= 0 && this.readyCallbacks.splice(i, 1); 48073 }); 48074 } 48075 register(e, t) { 48076 this.params[e] = t, this.updateReady(), this.ready && this.dispatchLocalEvent({ type: "ready" }), t.addDestroyFunc(() => { 48077 this.updateReady(); 48078 }); 48079 } 48080 get(e) { 48081 return this.params[e]; 48082 } 48083 getGridBodyCtrl() { 48084 return this.params.gridBodyCtrl; 48085 } 48086 getHeaderRowContainerCtrls() { 48087 const { leftHeader: e, centerHeader: t, rightHeader: i } = this.params; 48088 return [e, i, t]; 48089 } 48090 getHeaderRowContainerCtrl(e) { 48091 const t = this.params; 48092 switch (e) { 48093 case "left": 48094 return t.leftHeader; 48095 case "right": 48096 return t.rightHeader; 48097 default: 48098 return t.centerHeader; 48099 } 48100 } 48101 getScrollFeature() { 48102 return this.getGridBodyCtrl().scrollFeature; 48103 } 48104}, ane = ( 48105 /*css*/ 48106 ':where(.ag-root-wrapper,.ag-popup,.ag-dnd-ghost,.ag-chart),:where(.ag-root-wrapper,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]){box-sizing:border-box;&:after,&:before{box-sizing:border-box}&:where(div,span,label):focus-visible{box-shadow:inset var(--ag-focus-shadow);outline:none}}:where(.ag-root-wrapper,.ag-popup,.ag-dnd-ghost,.ag-chart) :where([class^=ag-]) ::-ms-clear{display:none}.ag-aria-description-container{border:0;z-index:9999;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.ag-hidden{display:none!important}.ag-invisible{visibility:hidden!important}.ag-unselectable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-selectable{-webkit-user-select:text;-moz-user-select:text;user-select:text}.ag-tab-guard{display:block;height:0;position:absolute;width:0}:where(.ag-virtual-list-viewport) .ag-tab-guard{position:sticky}.ag-tab-guard-top{top:1px}.ag-tab-guard-bottom{bottom:1px}.ag-shake-left-to-right{animation-direction:alternate;animation-duration:.2s;animation-iteration-count:infinite;animation-name:ag-shake-left-to-right}@keyframes ag-shake-left-to-right{0%{padding-left:6px;padding-right:2px}to{padding-left:2px;padding-right:6px}}.ag-body-horizontal-scroll-viewport,.ag-body-vertical-scroll-viewport,.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport,.ag-virtual-list-viewport{flex:1 1 auto;height:100%;min-width:0;overflow:hidden;position:relative}.ag-body-viewport,.ag-center-cols-viewport,.ag-floating-bottom-viewport,.ag-floating-top-viewport,.ag-header-viewport,.ag-sticky-bottom-viewport,.ag-sticky-top-viewport{overflow-x:auto;-ms-overflow-style:none!important;scrollbar-width:none!important;&::-webkit-scrollbar{display:none!important}}.ag-body-viewport{display:flex;overflow-x:hidden;&:where(.ag-layout-normal){overflow-y:auto;-webkit-overflow-scrolling:touch}}.ag-sticky-bottom-container,.ag-sticky-top-container{min-height:1px}.ag-center-cols-viewport{min-height:100%;width:100%}.ag-body-horizontal-scroll-viewport{overflow-x:scroll}.ag-body-vertical-scroll-viewport{overflow-y:scroll}.ag-virtual-list-viewport{overflow:auto;width:100%}.ag-body-container,.ag-body-horizontal-scroll-container,.ag-body-vertical-scroll-container,.ag-center-cols-container,.ag-floating-bottom-container,.ag-floating-bottom-full-width-container,.ag-floating-top-container,.ag-full-width-container,.ag-header-container,.ag-pinned-left-cols-container,.ag-pinned-right-cols-container,.ag-sticky-bottom-container,.ag-sticky-top-container,.ag-virtual-list-container{position:relative}.ag-floating-bottom-container,.ag-floating-top-container,.ag-header-container,.ag-sticky-bottom-container,.ag-sticky-top-container{height:100%;white-space:nowrap}.ag-center-cols-container,.ag-pinned-right-cols-container{display:block}.ag-body-horizontal-scroll-container{height:100%}.ag-body-vertical-scroll-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container,.ag-full-width-container,.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{pointer-events:none;position:absolute;top:0}:where(.ag-ltr) .ag-floating-bottom-full-width-container,:where(.ag-ltr) .ag-floating-top-full-width-container,:where(.ag-ltr) .ag-full-width-container,:where(.ag-ltr) .ag-sticky-bottom-full-width-container,:where(.ag-ltr) .ag-sticky-top-full-width-container{left:0}:where(.ag-rtl) .ag-floating-bottom-full-width-container,:where(.ag-rtl) .ag-floating-top-full-width-container,:where(.ag-rtl) .ag-full-width-container,:where(.ag-rtl) .ag-sticky-bottom-full-width-container,:where(.ag-rtl) .ag-sticky-top-full-width-container{right:0}.ag-full-width-container{width:100%}.ag-floating-bottom-full-width-container,.ag-floating-top-full-width-container{display:inline-block;height:100%;overflow:hidden;width:100%}.ag-virtual-list-container{overflow:hidden}
48106.ag-body{display:flex;flex:1 1 auto;flex-direction:row!important;min-height:0;position:relative}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:flex;min-height:0;min-width:0;position:relative;&:where(.ag-scrollbar-invisible){bottom:0;position:absolute;&:where(.ag-apple-scrollbar){opacity:0;transition:opacity .4s;visibility:hidden;&:where(.ag-scrollbar-scrolling,.ag-scrollbar-active){opacity:1;visibility:visible}}}}.ag-body-horizontal-scroll{width:100%;&:where(.ag-scrollbar-invisible){left:0;right:0}}.ag-body-vertical-scroll{height:100%;&:where(.ag-scrollbar-invisible){top:0;z-index:10}}:where(.ag-ltr) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){right:0}}:where(.ag-rtl) .ag-body-vertical-scroll{&:where(.ag-scrollbar-invisible){left:0}}.ag-force-vertical-scroll{overflow-y:scroll!important}.ag-horizontal-left-spacer,.ag-horizontal-right-spacer{height:100%;min-width:0;overflow-x:scroll;&:where(.ag-scroller-corner){overflow-x:hidden}}:where(.ag-row-animation) .ag-row{transition:transform .4s,top .4s,opacity .2s;&:where(.ag-after-created){transition:transform .4s,top .4s,height .4s,opacity .2s}}:where(.ag-row-no-animation) .ag-row{transition:none}.ag-row-loading{align-items:center;display:flex}.ag-row-position-absolute{position:absolute}.ag-row-position-relative{position:relative}.ag-full-width-row{overflow:hidden;pointer-events:all}.ag-row-inline-editing{z-index:1}.ag-row-dragging{z-index:2}.ag-stub-cell{align-items:center;display:flex}.ag-cell{display:inline-block;height:100%;position:absolute;white-space:nowrap;&:focus-visible{box-shadow:none}}.ag-cell-value{flex:1 1 auto}.ag-cell-value,.ag-group-value{overflow:hidden;text-overflow:ellipsis}.ag-cell-wrap-text{white-space:normal;word-break:break-word}:where(.ag-cell) .ag-icon{display:inline-block;vertical-align:middle}.ag-floating-top{border-bottom:var(--ag-pinned-row-border)}.ag-floating-bottom,.ag-floating-top{display:flex;overflow:hidden;position:relative;white-space:nowrap;width:100%}.ag-floating-bottom{border-top:var(--ag-pinned-row-border)}.ag-sticky-bottom,.ag-sticky-top{background-color:var(--ag-background-color);display:flex;height:0;overflow:hidden;position:absolute;width:100%}.ag-opacity-zero{opacity:0!important}.ag-cell-label-container{align-items:center;display:flex;flex-direction:row-reverse;height:100%;justify-content:space-between;width:100%}:where(.ag-right-aligned-header){.ag-cell-label-container{flex-direction:row}.ag-header-cell-text{text-align:end}}.ag-column-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr){direction:ltr;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row}}:where(.ag-rtl){direction:rtl;text-align:right;.ag-body,.ag-body-horizontal-scroll,.ag-body-viewport,.ag-floating-bottom,.ag-floating-top,.ag-header,.ag-sticky-bottom,.ag-sticky-top{flex-direction:row-reverse}.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{display:block}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(180deg)}}:where(.ag-rtl){.ag-icon-contracted,.ag-icon-expanded,.ag-icon-tree-closed{transform:rotate(-180deg)}}.ag-measurement-container{height:0;overflow:hidden;visibility:hidden;width:0}.ag-measurement-element-border{display:inline-block;&:before{border-left:var(--ag-internal-measurement-border);content:"";display:block}}.ag-group{position:relative;width:100%}.ag-group-title-bar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-title{display:inline;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(.ag-group-title-bar) .ag-group-title{cursor:default}.ag-group-toolbar{align-items:center;display:flex;padding:var(--ag-spacing)}.ag-group-container{display:flex}.ag-disabled .ag-group-container{pointer-events:none}.ag-disabled-group-container,.ag-disabled-group-title-bar{opacity:.5}.ag-group-container-horizontal{flex-flow:row wrap}.ag-group-container-vertical{flex-direction:column}.ag-group-title-bar-icon{cursor:pointer;flex:none}:where(.ag-ltr) .ag-group-title-bar-icon{margin-right:var(--ag-spacing)}:where(.ag-rtl) .ag-group-title-bar-icon{margin-left:var(--ag-spacing)}:where(.ag-group-item-alignment-stretch) .ag-group-item{align-items:stretch}:where(.ag-group-item-alignment-start) .ag-group-item{align-items:flex-start}:where(.ag-group-item-alignment-end) .ag-group-item{align-items:flex-end}.ag-popup-child{top:0;z-index:5;
48106&:where(:not(.ag-tooltip-custom)){box-shadow:var(--ag-popup-shadow)}}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-large-text-input{display:block}:where(.ag-ltr) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-left:var(--ag-row-group-indent-size)}:where(.ag-rtl) .ag-row:not(.ag-row-level-0) .ag-pivot-leaf-group{margin-right:var(--ag-row-group-indent-size)}:where(.ag-ltr) .ag-row-group-leaf-indent{margin-left:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}:where(.ag-rtl) .ag-row-group-leaf-indent{margin-right:calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size))}.ag-value-change-delta{padding:0 2px}.ag-value-change-delta-up{color:var(--ag-value-change-delta-up-color)}.ag-value-change-delta-down{color:var(--ag-value-change-delta-down-color)}.ag-value-change-value{background-color:transparent;border-radius:1px;padding-left:1px;padding-right:1px;transition:background-color 1s}.ag-value-change-value-highlight{background-color:var(--ag-value-change-value-highlight-background-color);transition:background-color .1s}.ag-cell-data-changed{background-color:var(--ag-value-change-value-highlight-background-color)!important}.ag-cell-data-changed-animation{background-color:transparent}.ag-cell-highlight{background-color:var(--ag-range-selection-highlight-color)!important}.ag-row{background-color:var(--ag-background-color);border-bottom:var(--ag-row-border);color:var(--ag-cell-text-color);font-family:var(--ag-cell-font-family);font-size:var(--ag-data-font-size);height:var(--ag-row-height);white-space:nowrap;width:100%;--ag-internal-content-line-height:calc(min(var(--ag-row-height), var(--ag-line-height, 1000px)) - var(--ag-internal-row-border-width, 1px))}:where(.ag-body-vertical-content-no-gap>div>div>div,.ag-body-vertical-content-no-gap>div>div>div>div)>.ag-row-last{border-bottom-color:transparent}.ag-sticky-bottom{border-top:var(--ag-row-border);box-sizing:content-box!important}.ag-group-contracted,.ag-group-expanded{cursor:pointer}.ag-cell,.ag-full-width-row .ag-cell-wrapper.ag-row-group{border:1px solid transparent;line-height:var(--ag-internal-content-line-height);-webkit-font-smoothing:subpixel-antialiased}:where(.ag-ltr) .ag-cell{border-right:var(--ag-column-border)}:where(.ag-rtl) .ag-cell{border-left:var(--ag-column-border)}:where(.ag-ltr) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-right-color:transparent}:where(.ag-rtl) :where(.ag-body-horizontal-content-no-gap) .ag-column-last{border-left-color:transparent}.ag-cell-wrapper{align-items:center;display:flex;>:where(:not(.ag-cell-value,.ag-group-value)){align-items:center;display:flex;height:var(--ag-internal-content-line-height)}&:where(.ag-row-group){align-items:flex-start}:where(.ag-full-width-row) &:where(.ag-row-group){align-items:center;height:100%}}:where(.ag-ltr) .ag-cell-wrapper{padding-left:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-rtl) .ag-cell-wrapper{padding-right:calc(var(--ag-indentation-level)*var(--ag-row-group-indent-size))}:where(.ag-ltr) .ag-row>.ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}:where(.ag-rtl) .ag-row>.ag-cell-wrapper.ag-row-group{padding-right:calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-cell-focus:not(.ag-cell-range-selected):focus-within,.ag-cell-range-single-cell,.ag-cell-range-single-cell.ag-cell-range-handle,.ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),.ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group{border:1px solid;border-color:var(--ag-range-selection-border-color);border-style:var(--ag-range-selection-border-style);outline:initial}:where(.ag-ltr) .ag-group-contracted,:where(.ag-ltr) .ag-group-expanded,:where(.ag-ltr) .ag-row-drag,:where(.ag-ltr) .ag-selection-checkbox{margin-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-group-contracted,:where(.ag-rtl) .ag-group-expanded,:where(.ag-rtl) .ag-row-drag,:where(.ag-rtl) .ag-selection-checkbox{margin-left:var(--ag-cell-widget-spacing)}:where(.ag-ltr) .ag-group-child-count{margin-left:3px}:where(.ag-rtl) .ag-group-child-count{margin-right:3px}.ag-row-highlight-above:after,.ag-row-highlight-below:after{background-color:var(--ag-range-selection-border-color);content:"";height:1px;position:absolute;width:calc(100% - 1px)}:where(.ag-ltr) .ag-row-highlight-above:after,:where(.ag-ltr) .ag-row-highlight-below:after{left:1px}:where(.ag-rtl) .ag-row-highlight-above:after,:where(.ag-rtl) .ag-row-highlight-below:after{right:1px}.ag-row-highlight-above:after{top:0}.ag-row-highlight-below:after{bottom:0}.ag-row-odd{background-color:var(--ag-odd-row-background-color)}.ag-row-selected:before{background-color:var(--ag-selected-row-background-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-full-width-row.ag-row-group:before,.ag-row-hover:not(.ag-full-width-row):before{background-color:var(--ag-row-hover-color);content:"";display:block;inset:0;pointer-events:none;position:absolute}.ag-row-hover.ag-row-selected:before{background-color:var(--ag-row-hover-color);background-image:linear-gradient(var(--ag-selected-row-background-color),var(--ag-selected-row-background-color))}.ag-row-hover.ag-full-width-row.ag-row-group>*{position:relative}.ag-column-hover{background-color:var(--ag-column-hover-color)}.ag-right-aligned-cell{font-variant-numeric:tabular-nums}:where(.ag-ltr) .ag-right-aligned-cell{text-align:right}:where(.ag-rtl) .ag-right-aligned-cell{text-align:left}.ag-right-aligned-cell .ag-cell-value,.ag-right-aligned-cell .ag-group-value{margin-left:auto}:where(.ag-ltr) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-ltr) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level));padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}:where(.ag-rtl) .ag-cell:not(.ag-cell-inline-editing),:where(.ag-rtl) .ag-full-width-row .ag-cell-wrapper.ag-row-group{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px + var(--ag-row-group-indent-size)*var(--ag-indentation-level))}.ag-row>.ag-cell-wrapper{padding-left:calc(var(--ag-cell-horizontal-padding) - 1px);padding-right:calc(var(--ag-cell-horizontal-padding) - 1px)}.ag-row-dragging{cursor:move;opacity:.5}.ag-details-row{background-color:var(--ag-background-color);padding:calc(var(--ag-spacing)*3.75)}.ag-layout-auto-height,.ag-layout-print{.ag-center-cols-container,.ag-center-cols-viewport{min-height:150px}}.ag-overlay-loading-wrapper{background-color:var(--ag-modal-overlay-background-color)}.ag-skeleton-container{align-content:center;height:100%;width:100%}.ag-skeleton-effect{animation:ag-skeleton-loading 1.5s ease-in-out .5s infinite;background-color:var(--ag-row-loading-skeleton-effect-color);border-radius:.25rem;height:1em;width:100%}:where(.ag-ltr) .ag-right-aligned-cell .ag-skeleton-effect{margin-left:auto}:where(.ag-rtl) .ag-right-aligned-cell .ag-skeleton-effect{margin-right:auto}@keyframes ag-skeleton-loading{0%{opacity:1}50%{opacity:.4}to{opacity:1}}.ag-loading{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-loading{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-loading{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-ltr) .ag-loading-icon{padding-right:var(--ag-cell-widget-spacing)}:where(.ag-rtl) .ag-loading-icon{padding-left:var(--ag-cell-widget-spacing)}.ag-icon-loading{animation-duration:1s;animation-iteration-count:infinite;animation-name:spin;animation-timing-function:linear}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.ag-input-wrapper,.ag-picker-field-wrapper{align-items:center;display:flex;flex:1 1 auto;line-height:normal;position:relative}.ag-input-field{align-items:center;display:flex;flex-direction:row}
48106.ag-input-field-input:where(:not([type=checkbox],[type=radio])){flex:1 1 auto;min-width:0;width:100%}.ag-header{background-color:var(--ag-header-background-color);border-bottom:var(--ag-header-row-border);color:var(--ag-header-text-color);display:flex;font-family:var(--ag-header-font-family);font-size:var(--ag-header-font-size);font-weight:var(--ag-header-font-weight);overflow:hidden;white-space:nowrap;width:100%}.ag-header-row{height:var(--ag-header-height);position:absolute}.ag-floating-filter-button-button,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,:where(.ag-header-cell-sortable) .ag-header-cell-label{cursor:pointer}:where(.ag-ltr) .ag-header-expand-icon{margin-left:4px}:where(.ag-rtl) .ag-header-expand-icon{margin-right:4px}.ag-header-row:where(:not(:first-child)){:where(.ag-header-cell:not(.ag-header-span-height.ag-header-span-total,.ag-header-parent-hidden),.ag-header-group-cell.ag-header-group-cell-with-group){border-top:var(--ag-header-row-border)}}.ag-header-row:where(:not(.ag-header-row-column-group)){overflow:hidden}:where(.ag-header.ag-header-allow-overflow) .ag-header-row{overflow:visible}.ag-header-cell{display:inline-flex;overflow:hidden}.ag-header-group-cell{display:flex}.ag-header-cell,.ag-header-group-cell{align-items:center;gap:var(--ag-cell-widget-spacing);height:100%;padding:0 var(--ag-cell-horizontal-padding);position:absolute}@property --ag-internal-moving-color{syntax:"<color>";inherits:false;initial-value:transparent}@property --ag-internal-hover-color{syntax:"<color>";inherits:false;initial-value:transparent}.ag-header-cell:where(:not(.ag-floating-filter)),.ag-header-group-cell{&:before{background-image:linear-gradient(var(--ag-internal-hover-color),var(--ag-internal-hover-color)),linear-gradient(var(--ag-internal-moving-color),var(--ag-internal-moving-color));content:"";inset:0;position:absolute;--ag-internal-moving-color:transparent;--ag-internal-hover-color:transparent;transition:--ag-internal-moving-color var(--ag-header-cell-background-transition-duration),--ag-internal-hover-color var(--ag-header-cell-background-transition-duration)}&:where(:hover):before{--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}&:where(.ag-header-cell-moving):before{--ag-internal-moving-color:var(--ag-header-cell-moving-background-color);--ag-internal-hover-color:var(--ag-header-cell-hover-background-color)}}:where(.ag-header-cell:not(.ag-floating-filter) *,.ag-header-group-cell *){position:relative;z-index:1}.ag-header-cell-menu-button:where(:not(.ag-header-menu-always-show)){opacity:0;transition:opacity .2s}.ag-header-cell-filter-button,:where(.ag-header-cell.ag-header-active) .ag-header-cell-menu-button{opacity:1}.ag-header-cell-label,.ag-header-group-cell-label{align-items:center;align-self:stretch;display:flex;flex:1 1 auto;overflow:hidden;padding:5px 0}:where(.ag-ltr) .ag-sort-indicator-icon{padding-left:var(--ag-spacing)}:where(.ag-rtl) .ag-sort-indicator-icon{padding-right:var(--ag-spacing)}.ag-header-cell-label{text-overflow:ellipsis}.ag-header-group-cell-label.ag-sticky-label{flex:none;max-width:100%;overflow:visible;position:sticky}:where(.ag-ltr) .ag-header-group-cell-label.ag-sticky-label{left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-header-group-cell-label.ag-sticky-label{right:var(--ag-cell-horizontal-padding)}.ag-header-cell-text,.ag-header-group-text{overflow:hidden;text-overflow:ellipsis}.ag-header-cell-text{word-break:break-word}.ag-header-cell-comp-wrapper{width:100%}:where(.ag-header-group-cell) .ag-header-cell-comp-wrapper{display:flex}:where(.ag-header-cell:not(.ag-header-cell-auto-height)) .ag-header-cell-comp-wrapper{align-items:center;display:flex;height:100%}.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper{white-space:normal}.ag-header-cell-comp-wrapper-limited-height>*{overflow:hidden}:where(.ag-right-aligned-header) .ag-header-cell-label{flex-direction:row-reverse}:where(.ag-ltr) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell:not(.ag-right-aligned-header)){.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-ltr) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-label-icon,.ag-header-menu-icon{margin-right:var(--ag-spacing)}}:where(.ag-rtl) :where(.ag-header-cell.ag-right-aligned-header){.ag-header-label-icon,.ag-header-menu-icon{margin-left:var(--ag-spacing)}}
48106.ag-header-cell:after,.ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{content:"";height:var(--ag-header-column-border-height);position:absolute;top:calc(50% - var(--ag-header-column-border-height)*.5);z-index:1}:where(.ag-ltr) .ag-header-cell:after,:where(.ag-ltr) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-right:var(--ag-header-column-border);right:0}:where(.ag-rtl) .ag-header-cell:after,:where(.ag-rtl) .ag-header-group-cell:where(:not(.ag-header-span-height.ag-header-group-cell-no-group)):after{border-left:var(--ag-header-column-border);left:0}.ag-header-highlight-after:after,.ag-header-highlight-before:after{background-color:var(--ag-accent-color);content:"";height:100%;position:absolute;width:1px}:where(.ag-ltr) .ag-header-highlight-before:after{left:0}:where(.ag-rtl) .ag-header-highlight-before:after{right:0}:where(.ag-ltr) .ag-header-highlight-after:after{right:0;:where(.ag-pinned-left-header) &{right:1px}}:where(.ag-rtl) .ag-header-highlight-after:after{left:0;:where(.ag-pinned-left-header) &{left:1px}}.ag-header-cell-resize{align-items:center;cursor:ew-resize;display:flex;height:100%;position:absolute;top:0;width:8px;z-index:2;&:after{background-color:var(--ag-header-column-resize-handle-color);content:"";height:var(--ag-header-column-resize-handle-height);position:absolute;top:calc(50% - var(--ag-header-column-resize-handle-height)*.5);width:var(--ag-header-column-resize-handle-width);z-index:1}}:where(.ag-ltr) .ag-header-cell-resize{right:-3px;&:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}}:where(.ag-rtl) .ag-header-cell-resize{left:-3px;&:after{right:calc(50% - var(--ag-header-column-resize-handle-width))}}:where(.ag-header-cell.ag-header-span-height) .ag-header-cell-resize:after{height:calc(100% - var(--ag-spacing)*4);top:calc(var(--ag-spacing)*2)}.ag-header-group-cell-no-group:where(.ag-header-span-height){display:none}.ag-sort-indicator-container{display:flex;gap:var(--ag-spacing)}.ag-layout-print{&.ag-body{display:block;height:unset}&.ag-root-wrapper{display:inline-block}.ag-body-horizontal-scroll,.ag-body-vertical-scroll{display:none}&.ag-force-vertical-scroll{overflow-y:visible!important}}@media print{.ag-root-wrapper.ag-layout-print{display:table;.ag-body-horizontal-scroll-viewport,.ag-body-viewport,.ag-center-cols-container,.ag-center-cols-viewport,.ag-root,.ag-root-wrapper-body,.ag-virtual-list-viewport{display:block!important;height:auto!important;overflow:hidden!important}.ag-cell,.ag-row{-moz-column-break-inside:avoid;break-inside:avoid}}}ag-grid,ag-grid-angular{display:block}.ag-chart,.ag-dnd-ghost,.ag-popup,.ag-root-wrapper{cursor:default;line-height:normal;white-space:normal;-webkit-font-smoothing:antialiased;background-color:var(--ag-background-color);color:var(--ag-text-color);color-scheme:var(--ag-browser-color-scheme);font-family:var(--ag-font-family);font-size:var(--ag-font-size);--ag-indentation-level:0}.ag-root-wrapper{border:var(--ag-wrapper-border);border-radius:var(--ag-wrapper-border-radius);display:flex;flex-direction:column;overflow:hidden;position:relative;&.ag-layout-normal{height:100%}}.ag-root-wrapper-body{display:flex;flex-direction:row;&.ag-layout-normal{flex:1 1 auto;height:0;min-height:0}}.ag-root{display:flex;flex-direction:column;position:relative;&.ag-layout-auto-height,&.ag-layout-normal{flex:1 1 auto;overflow:hidden;width:0}&.ag-layout-normal{height:100%}}:where(.ag-button){background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-indent:inherit;text-shadow:inherit;text-transform:inherit;word-spacing:inherit;&:focus-visible{box-shadow:var(--ag-focus-shadow);outline:none}}.ag-standard-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--ag-background-color);border:var(--ag-input-border);border-radius:var(--ag-border-radius);cursor:pointer;font-family:inherit;padding:var(--ag-spacing) calc(var(--ag-spacing)*2);&:hover{background-color:var(--ag-row-hover-color)}&:active{border-color:var(--ag-accent-color)}&:disabled{background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}}.ag-drag-handle{color:var(--ag-drag-handle-color);cursor:grab}.ag-list-item,.ag-virtual-list-item{height:var(--ag-list-item-height)}.ag-virtual-list-item{position:absolute;width:100%}.ag-select-list{background-color:var(--ag-background-color);border:var(--ag-input-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);overflow:hidden auto}.ag-list-item{align-items:center;display:flex;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;&.ag-active-item{background-color:var(--ag-row-hover-color)}}.ag-select-list-item{cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;:where(span){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}:where(.ag-ltr) .ag-select-list-item{padding-left:calc(var(--ag-cell-horizontal-padding)/2)}:where(.ag-rtl) .ag-select-list-item{padding-right:calc(var(--ag-cell-horizontal-padding)/2)}.ag-list-item-hovered:after{background-color:var(--ag-accent-color);content:"";height:1px;left:0;position:absolute;right:0}.ag-item-highlight-top:after{top:0}.ag-item-highlight-bottom:after{bottom:0}.ag-column-select-column-group-readonly,.ag-column-select-column-readonly,.ag-disabled,[disabled]{.ag-icon{opacity:.5}&.ag-icon-grip{opacity:.35}}.ag-column-select-column-readonly{&.ag-icon-grip,.ag-icon-grip{opacity:.35}}.ag-chart-menu-icon,.ag-chart-settings-next,.ag-chart-settings-prev,.ag-column-group-icons,.ag-column-select-header-icon,.ag-filter-toolpanel-expand,.ag-floating-filter-button-button,.ag-group-title-bar-icon,.ag-header-cell-filter-button,.ag-header-cell-menu-button,.ag-header-expand-icon,.ag-panel-title-bar-button,.ag-panel-title-bar-button-icon,.ag-set-filter-group-icons,:where(.ag-group-contracted) .ag-icon,:where(.ag-group-expanded) .ag-icon{&:hover{background-color:var(--ag-icon-button-hover-color);border-radius:1px;box-shadow:0 0 0 4px var(--ag-icon-button-hover-color)}}.ag-filter-active{--ag-icon-button-hover-color:color-mix(in srgb,transparent,var(--ag-accent-color) 28%);background-color:color-mix(in srgb,transparent,var(--ag-accent-color) 14%);border-radius:1px;outline:solid 4px color-mix(in srgb,transparent,var(--ag-accent-color) 14%);position:relative;&:after{background-color:var(--ag-accent-color);border-radius:50%;content:"";height:6px;position:absolute;top:-1px;width:6px}:where(.ag-icon-filter){clip-path:path("M8,0C8,4.415 11.585,8 16,8L16,16L0,16L0,0L8,0Z")}}:where(.ag-ltr) .ag-filter-active{&:after{right:-1px}}:where(.ag-rtl) .ag-filter-active{&:after{left:-1px}}.ag-menu{background-color:var(--ag-menu-background-color);border:var(--ag-menu-border);border-radius:var(--ag-border-radius);box-shadow:var(--ag-menu-shadow);color:var(--ag-menu-text-color);max-height:100%;overflow-y:auto}.ag-menu,.ag-resizer{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.ag-resizer{pointer-events:none;z-index:1}:where(.ag-resizer){&.ag-resizer-topLeft{height:5px;left:0;top:0;width:5px}&.ag-resizer-top{cursor:ns-resize;height:5px;left:5px;right:5px;top:0}&.ag-resizer-topRight{height:5px;right:0;top:0;width:5px}&.ag-resizer-right{bottom:5px;cursor:ew-resize;right:0;top:5px;width:5px}&.ag-resizer-bottomRight{bottom:0;height:5px;right:0;width:5px}&.ag-resizer-bottom{bottom:0;cursor:ns-resize;height:5px;left:5px;right:5px}&.ag-resizer-bottomLeft{bottom:0;height:5px;left:0;width:5px}&.ag-resizer-left{bottom:5px;cursor:ew-resize;left:0;top:5px;width:5px}}:where(.ag-ltr) :where(.ag-resizer){&.ag-resizer-topLeft{cursor:nwse-resize}&.ag-resizer-topRight{cursor:nesw-resize}&.ag-resizer-bottomRight{cursor:nwse-resize}&.ag-resizer-bottomLeft{cursor:nesw-resize}}:where(.ag-rtl) :where(.ag-resizer){&.ag-resizer-topLeft{cursor:nesw-resize}&.ag-resizer-topRight{cursor:nwse-resize}&.ag-resizer-bottomRight{cursor:nesw-resize}&.ag-resizer-bottomLeft{cursor:nwse-resize}}'
48107), MM = typeof window != "object" || !window?.document?.fonts?.forEach, oS = /* @__PURE__ */ new WeakMap(), Td = (e, t, i) => { 48108 if (MM) 48109 return; 48110 const s = t.getRootNode() === document ? document.head : t; 48111 let n = oS.get(s); 48112 if (n || (n = { css: /* @__PURE__ */ new Set() }, oS.set(s, n)), n.css.has(e)) 48113 return; 48114 const o = document.createElement("style"); 48115 o.dataset.agGlobalCss = i, o.textContent = e, n.last ? n.last.insertAdjacentElement("afterend", o) : s.insertBefore(o, s.querySelector(":not(title, meta)")), n.css.add(e), n.last = o; 48116}, $N = (e) => { 48117 Td(ane, e, "core"), Array.from(FJ()).sort((t, i) => t.moduleName.localeCompare(i.moduleName)).forEach( 48118 (t) => t.css?.forEach((i) => Td(i, e, `module-${t.moduleName}`)) 48119 ); 48120}, rS = /* @__PURE__ */ new Set(), lne = (e) => { 48121 rS.add(e); 48122}, cne = (e) => { 48123 if (rS.delete(e), rS.size === 0) { 48124 oS = /* @__PURE__ */ new WeakMap(); 48125 for (const t of document.head.querySelectorAll("style[data-ag-global-css]")) 48126 t.remove(); 48127 } 48128}, Rs = (e) => new YN(e), Ja = "$default", une = 0, YN = class { 48129 constructor({ feature: e, params: t, modeParams: i = {}, css: s, cssImports: n }) { 48130 this.feature = e, this.css = s, this.cssImports = n, this.modeParams = { 48131 // NOTE: it's important that default is defined first, putting it 48132 // first in iteration order, because when merging params the default 48133 // params override any prior modal params, so modal params in this 48134 // part need to come after default params to prevent them from being 48135 // immediately overridden. 48136 [Ja]: { 48137 ...i[Ja] ?? {}, 48138 ...t ?? {} 48139 }, 48140 ...i 48141 }; 48142 } 48143 use(e) { 48144 let t = this._inject; 48145 if (t == null) { 48146 let { css: i } = this; 48147 if (i) { 48148 const s = `ag-theme-${this.feature ?? "part"}-${++une}`; 48149 typeof i == "function" && (i = i()), i = `:where(.${s}) { 48150${i} 48151} 48152`; 48153 for (const n of this.cssImports ?? []) 48154 i = `@import url(${JSON.stringify(n)}); 48155${i}`; 48156 t = { css: i, class: s }; 48157 } else 48158 t = !1; 48159 this._inject = t; 48160 } 48161 return t && e && Td(t.css, e, t.class), t ? t.class : !1; 48162 } 48163}, dne = (e) => e.replace(/[A-Z]/g, (t) => `-${t}`).toLowerCase(), KN = (e) => `--ag-${dne(e)}`, ga = (e) => `var(${KN(e)})`, hne = (e, t, i) => Math.max(t, Math.min(i, e)), pne = (e) => { 48164 const t = /* @__PURE__ */ new Map(); 48165 return (i) => { 48166 const s = i; 48167 return t.has(s) || t.set(s, e(i)), t.get(s); 48168 }; 48169}, el = (e) => ({ ref: "accentColor", mix: e }), un = (e) => ({ ref: "foregroundColor", mix: e }), go = (e) => ({ 48170 ref: "foregroundColor", 48171 mix: e, 48172 onto: "backgroundColor" 48173}), gne = { ref: "foregroundColor" }, la = { ref: "accentColor" }, Ld = { 48174 backgroundColor: "#fff", 48175 foregroundColor: "#181d1f", 48176 borderColor: un(0.15), 48177 chromeBackgroundColor: go(0.02), 48178 browserColorScheme: "light" 48179}, fne = { 48180 ...Ld, 48181 textColor: gne, 48182 accentColor: "#2196f3", 48183 invalidColor: "#e02525", 48184 wrapperBorder: !0, 48185 rowBorder: !0, 48186 headerRowBorder: !0, 48187 footerRowBorder: { 48188 ref: "rowBorder" 48189 }, 48190 columnBorder: { 48191 style: "solid", 48192 width: 1, 48193 color: "transparent" 48194 }, 48195 headerColumnBorder: !1, 48196 headerColumnBorderHeight: "100%", 48197 pinnedColumnBorder: !0, 48198 pinnedRowBorder: !0, 48199 sidePanelBorder: !0, 48200 sideBarPanelWidth: 250, 48201 sideBarBackgroundColor: { 48202 ref: "chromeBackgroundColor" 48203 },
48204 sideButtonBarBackgroundColor: { 48205 ref: "sideBarBackgroundColor" 48206 }, 48207 sideButtonBarTopPadding: 0, 48208 sideButtonSelectedUnderlineWidth: 2, 48209 sideButtonSelectedUnderlineColor: "transparent", 48210 sideButtonSelectedUnderlineTransitionDuration: 0, 48211 sideButtonBackgroundColor: "transparent", 48212 sideButtonTextColor: { ref: "textColor" }, 48213 sideButtonHoverBackgroundColor: { ref: "sideButtonBackgroundColor" }, 48214 sideButtonHoverTextColor: { ref: "sideButtonTextColor" }, 48215 sideButtonSelectedBackgroundColor: { ref: "backgroundColor" }, 48216 sideButtonSelectedTextColor: { ref: "sideButtonTextColor" }, 48217 sideButtonSelectedBorder: !0, 48218 sideButtonLeftPadding: { ref: "spacing" }, 48219 sideButtonRightPadding: { ref: "spacing" }, 48220 sideButtonVerticalPadding: { calc: "spacing * 3" }, 48221 fontFamily: [ 48222 "-apple-system", 48223 "BlinkMacSystemFont", 48224 "Segoe UI", 48225 "Roboto", 48226 "Oxygen-Sans", 48227 "Ubuntu", 48228 "Cantarell", 48229 "Helvetica Neue", 48230 "sans-serif" 48231 ], 48232 headerBackgroundColor: { 48233 ref: "chromeBackgroundColor" 48234 }, 48235 headerFontFamily: { 48236 ref: "fontFamily" 48237 }, 48238 cellFontFamily: { 48239 ref: "fontFamily" 48240 }, 48241 headerFontWeight: 500, 48242 headerFontSize: { 48243 ref: "fontSize" 48244 }, 48245 dataFontSize: { 48246 ref: "fontSize" 48247 }, 48248 headerTextColor: { 48249 ref: "textColor" 48250 }, 48251 headerCellHoverBackgroundColor: "transparent",
48252 headerCellMovingBackgroundColor: { ref: "headerCellHoverBackgroundColor" }, 48253 headerCellBackgroundTransitionDuration: "0.2s", 48254 cellTextColor: { 48255 ref: "textColor" 48256 }, 48257 subtleTextColor: { 48258 ref: "textColor", 48259 mix: 0.5 48260 }, 48261 rangeSelectionBorderStyle: "solid", 48262 rangeSelectionBorderColor: la, 48263 rangeSelectionBackgroundColor: el(0.2), 48264 rangeSelectionChartBackgroundColor: "#0058FF1A", 48265 rangeSelectionChartCategoryBackgroundColor: "#00FF841A", 48266 rangeSelectionHighlightColor: el(0.5), 48267 rowHoverColor: el(0.08), 48268 columnHoverColor: el(0.05), 48269 selectedRowBackgroundColor: el(0.12), 48270 modalOverlayBackgroundColor: { 48271 ref: "backgroundColor", 48272 mix: 0.66 48273 }, 48274 oddRowBackgroundColor: { 48275 ref: "backgroundColor" 48276 }, 48277 borderRadius: 4, 48278 wrapperBorderRadius: 8, 48279 cellHorizontalPadding: { 48280 calc: "spacing * 2 * cellHorizontalPaddingScale" 48281 }, 48282 cellWidgetSpacing: { 48283 calc: "spacing * 1.5" 48284 }, 48285 cellHorizontalPaddingScale: 1, 48286 rowGroupIndentSize: { 48287 calc: "cellWidgetSpacing + iconSize" 48288 }, 48289 valueChangeDeltaUpColor: "#43a047", 48290 valueChangeDeltaDownColor: "#e53935",
48291 valueChangeValueHighlightBackgroundColor: "#16a08580", 48292 spacing: 8, 48293 fontSize: 14, 48294 rowHeight: { 48295 calc: "max(iconSize, dataFontSize) + spacing * 3.25 * rowVerticalPaddingScale" 48296 }, 48297 rowVerticalPaddingScale: 1, 48298 headerHeight: { 48299 calc: "max(iconSize, dataFontSize) + spacing * 4 * headerVerticalPaddingScale" 48300 }, 48301 headerVerticalPaddingScale: 1, 48302 popupShadow: "0 0 16px #00000026", 48303 cardShadow: "0 1px 4px 1px #00000018", 48304 dropdownShadow: { ref: "cardShadow" }, 48305 dragAndDropImageBackgroundColor: { 48306 ref: "backgroundColor" 48307 }, 48308 dragAndDropImageBorder: !0, 48309 dragAndDropImageShadow: { 48310 ref: "popupShadow" 48311 }, 48312 dragHandleColor: un(0.7), 48313 focusShadow: { 48314 spread: 3, 48315 color: el(0.5) 48316 }, 48317 headerColumnResizeHandleHeight: "30%", 48318 headerColumnResizeHandleWidth: 2, 48319 headerColumnResizeHandleColor: { 48320 ref: "borderColor" 48321 }, 48322 widgetContainerHorizontalPadding: { 48323 calc: "spacing * 1.5" 48324 }, 48325 widgetContainerVerticalPadding: { 48326 calc: "spacing * 1.5" 48327 }, 48328 widgetHorizontalSpacing: { 48329 calc: "spacing * 1.5" 48330 }, 48331 widgetVerticalSpacing: { 48332 ref: "spacing" 48333 }, 48334 listItemHeight: { 48335 calc: "iconSize + widgetVerticalSpacing" 48336 }, 48337 iconSize: 16, 48338 toggleButtonWidth: 28, 48339 toggleButtonHeight: 18, 48340 toggleButtonOnBackgroundColor: la, 48341 toggleButtonOffBackgroundColor: go(0.3), 48342 toggleButtonSwitchBackgroundColor: { 48343 ref: "backgroundColor" 48344 }, 48345 toggleButtonSwitchInset: 2, 48346 menuBorder: { 48347 color: un(0.2) 48348 }, 48349 menuBackgroundColor: go(0.03), 48350 menuTextColor: go(0.95), 48351 menuShadow: { 48352 ref: "popupShadow" 48353 }, 48354 menuSeparatorColor: { 48355 ref: "borderColor" 48356 }, 48357 setFilterIndentSize: { 48358 ref: "iconSize" 48359 }, 48360 chartMenuPanelWidth: 260, 48361 chartMenuLabelColor: un(0.8), 48362 iconButtonHoverColor: un(0.1), 48363 dialogShadow: { 48364 ref: "popupShadow" 48365 }, 48366 cellEditingBorder: { 48367 color: la 48368 }, 48369 cellEditingShadow: { ref: "cardShadow" }, 48370 dialogBorder: { 48371 color: un(0.2) 48372 }, 48373 panelBackgroundColor: { 48374 ref: "backgroundColor" 48375 }, 48376 panelTitleBarBackgroundColor: { 48377 ref: "headerBackgroundColor" 48378 }, 48379 panelTitleBarBorder: !0, 48380 columnSelectIndentSize: { 48381 ref: "iconSize" 48382 }, 48383 toolPanelSeparatorBorder: !0, 48384 tooltipBackgroundColor: { 48385 ref: "chromeBackgroundColor" 48386 }, 48387 tooltipTextColor: { 48388 ref: "textColor" 48389 }, 48390 tooltipBorder: !0,
48391 columnDropCellBackgroundColor: un(0.07), 48392 columnDropCellTextColor: { 48393 ref: "textColor" 48394 }, 48395 columnDropCellDragHandleColor: { 48396 ref: "textColor" 48397 }, 48398 columnDropCellBorder: { 48399 color: un(0.13) 48400 }, 48401 selectCellBackgroundColor: un(0.07), 48402 selectCellBorder: { 48403 color: un(0.13) 48404 }, 48405 advancedFilterBuilderButtonBarBorder: !0, 48406 advancedFilterBuilderIndentSize: { 48407 calc: "spacing * 2 + iconSize" 48408 }, 48409 advancedFilterBuilderJoinPillColor: "#f08e8d", 48410 advancedFilterBuilderColumnPillColor: "#a6e194", 48411 advancedFilterBuilderOptionPillColor: "#f3c08b", 48412 advancedFilterBuilderValuePillColor: "#85c0e4", 48413 filterToolPanelGroupIndent: { 48414 ref: "spacing" 48415 }, 48416 iconButtonHoverBackgroundColor: un(0.1), 48417 rowLoadingSkeletonEffectColor: un(0.15) 48418}, mne = [ 48419 "colorScheme", 48420 "color", 48421 "length", 48422 "scale", 48423 "borderStyle", 48424 "border", 48425 "shadow", 48426 "image", 48427 "fontFamily", 48428 "fontWeight", 48429 "duration" 48430], vne = pne((e) => (e = e.toLowerCase(), mne.find((t) => e.endsWith(t.toLowerCase())) ?? "length")), qy = (e) => typeof e == "string" ? e : typeof e == "number" ? String(e) : !1, AM = (e) => { 48431 if (typeof e == "string") 48432 return e; 48433 if (e && "ref" in e) { 48434 const t = ga(e.ref); 48435 return e.mix == null ? t : `color-mix(in srgb, ${e.onto ? ga(e.onto) : "transparent"}, ${t} ${hne(e.mix * 100, 0, 100)}%)`; 48436 } 48437 return !1; 48438}, yne = qy, qu = (e) => typeof e == "string" ? e : typeof e == "number" ? `${e}px` : e && "calc" in e ? `calc(${e.calc.replace(/ ?[*/+] ?/g, " $& ").replace(/-?[a-z][a-z0-9]*\b(?![-(])/gi, (i) => i[0] === "-" ? i : ` ${ga(i)} `)})` : e && "ref" in e ? ga(e.ref) : !1, Cne = qy, bne = (e, t) => typeof e == "string" ? e : e === !0 ? "solid 1px var(--ag-border-color)" : e === !1 ? t === "columnBorder" ? "solid 1px transparent" : "none" : e && "ref" in e ? ga(e.ref) : ZN(e.style ?? "solid") + " " + qu(e.width ?? 1) + " " + AM(e.color ?? { ref: "borderColor" }), wne = (e) => typeof e == "string" ? e : e === !1 ? "none" : e && "ref" in e ? ga(e.ref) : [ 48439 qu(e.offsetX ?? 0), 48440 qu(e.offsetY ?? 0), 48441 qu(e.radius ?? 0), 48442 qu(e.spread ?? 0), 48443 AM(e.color ?? { ref: "foregroundColor" }) 48444].join(" "), ZN = qy, qN = (e) => typeof e == "string" ? e : e && "googleFont" in e ? qN(e.googleFont) : e && "ref" in e ? ga(e.ref) : Array.isArray(e) ? e.map((t) => (typeof t == "object" && "googleFont" in t && (t = t.googleFont), Sne(t))).join(", ") : !1, Sne = (e) => ( 48445 // don't quote var() expressions or quote safe identifier names, so that 48446 // people can specify fonts like sans-serif which are keywords not strings, 48447 // or var(--my-var) 48448 /^[\w-]+$|\w\(/.test(e) ? e : JSON.stringify(e) 48449), xne = qy, QN = (e) => typeof e == "string" ? e : e && "url" in e ? `url(${JSON.stringify(e.url)})` : e && "svg" in e ? QN({ url: `data:image/svg+xml,${encodeURIComponent(e.svg)}` }) : e && "ref" in e ? ga(e.ref) : !1, Mne = (e, t) => typeof e == "string" ? e : typeof e == "number" ? (e >= 10 && Rt(104, { value: e, param: t }), `${e}s`) : e && "ref" in e ? ga(e.ref) : !1, Ane = { 48450 color: AM, 48451 colorScheme: yne, 48452 length: qu, 48453 scale: Cne, 48454 border: bne, 48455 borderStyle: ZN, 48456 shadow: wne, 48457 image: QN, 48458 fontFamily: qN, 48459 fontWeight: xne, 48460 duration: Mne 48461}, Dne = (e, t) => { 48462 const i = vne(e); 48463 return Ane[i](t, e); 48464}, Ene = () => new XN(), XN = class JN { 48465 constructor(t = []) { 48466 this.parts = t; 48467 } 48468 withPart(t) { 48469 return typeof t == "function" && (t = t()), t instanceof YN ? new JN([...this.parts, t]) : (Ww(259, { part: t }, "Invalid part"), this); 48470 } 48471 withoutPart(t) { 48472 return this.withPart(Rs({ feature: t })); 48473 } 48474 withParams(t, i = Ja) { 48475 return this.withPart( 48476 Rs({ 48477 modeParams: { [i]: t } 48478 }) 48479 ); 48480 } 48481 /** 48482 * Called by a grid instance when it starts using the theme. This installs 48483 * the theme's parts into document head, or the shadow DOM if the provided 48484 * container is within a shadow root. 48485 */ 48486 _startUse({ container: t, loadThemeGoogleFonts: i }) { 48487 if (MM) 48488 return; 48489 Rne(), $N(t); 48490 const s = Ine(this); 48491 if (s.length > 0) 48492 for (const n of s) 48493 i && Lne(n); 48494 for (const n of this.parts) 48495 n.use(t); 48496 } 48497 /** 48498 * Return CSS that that applies the params of this theme to elements with 48499 * the provided class name 48500 */ 48501 _getCssClass() { 48502 return this._cssClassCache ?? (this._cssClassCache = aT(this.parts).map((t) =>
48502 t.use()).filter(Boolean).join(" ")); 48503 } 48504 _getModeParams() { 48505 let t = this._paramsCache; 48506 if (!t) { 48507 const i = { 48508 // NOTE: defining the default mode here is important, it ensures 48509 // that the default mode is first in iteration order, which puts 48510 // it first in outputted CSS, allowing other modes to override it 48511 [Ja]: { ...fne } 48512 }; 48513 for (const s of aT(this.parts)) 48514 for (const [n, o] of Object.entries(s.modeParams)) 48515 if (o) { 48516 const r = i[n] ?? (i[n] = {}), a = /* @__PURE__ */ new Set(); 48517 for (const [l, c] of Object.entries(o)) 48518 c !== void 0 && (r[l] = c, a.add(l)); 48519 if (n === Ja) { 48520 for (const [l, c] of Object.entries(i)) 48521 if (l !== Ja) 48522 for (const u of a) 48523 delete c[u]; 48524 } 48525 } 48526 this._paramsCache = t = i; 48527 } 48528 return t; 48529 } 48530 /** 48531 * Return the CSS chunk that is inserted into the grid DOM, and will 48532 * therefore be removed automatically when the grid is destroyed or it 48533 * starts to use a new theme. 48534 * 48535 * @param className a unique class name on the grid wrapper used to scope the returned CSS to the grid instance 48536 */ 48537 _getPerGridCss(t) { 48538 const i = "##SELECTOR##"; 48539 let s = this._paramsCssCache; 48540 if (!s) { 48541 let n = "", o = ""; 48542 for (const [a, l] of Object.entries(this._getModeParams())) { 48543 if (a !== Ja) { 48544 const u = `:where([data-ag-theme-mode="${typeof CSS == "object" ? CSS.escape(a) : a}"]) & { 48545`; 48546 n += u, o += u; 48547 } 48548 for (const [c, u] of Object.entries(l)) { 48549 const d = Dne(c, u); 48550 if (d === !1) 48551 Rt(107, { key: c, value: u }); 48552 else { 48553 const p = KN(c), f = p.replace("--ag-", "--ag-inherited-"); 48554 n += ` ${p}: var(${f}, ${d}); 48555`, o += ` ${f}: var(${p}); 48556`; 48557 } 48558 } 48559 a !== Ja && (n += `} 48560`, o += `} 48561`); 48562 } 48563 let r = `${i} { 48564${n}} 48565`; 48566 r += `:has(> ${i}):not(${i}) { 48567${o}} 48568`, this._paramsCssCache = s = r; 48569 } 48570 return s.replaceAll(i, `:where(.${t})`); 48571 } 48572}, aT = (e) => { 48573 const t = /* @__PURE__ */ new Map(); 48574 for (const s of e) 48575 t.set(s.feature, s); 48576 const i = []; 48577 for (const s of e) 48578 (!s.feature || t.get(s.feature) === s) && i.push(s); 48579 return i; 48580}, Ine = (e) => { 48581 const t = /* @__PURE__ */ new Set(), i = (o) => { 48582 if (Array.isArray(o)) 48583 o.forEach(i); 48584 else { 48585 const r = o?.googleFont; 48586 typeof r == "string" && t.add(r); 48587 } 48588 }; 48589 return Object.values(e._getModeParams()).flatMap((o) => Object.values(o)).forEach(i), Array.from(t).sort(); 48590}, lT = !1, Rne = () => { 48591 if (!lT) { 48592 lT = !0; 48593 for (const e of Array.from(document.head.querySelectorAll('style[data-ag-scope="legacy"]'))) 48594 e.remove(); 48595 } 48596}, Tne = /* @__PURE__ */ new Set(), Lne = async (e) => { 48597 Tne.add(e); 48598 const t = `@import url('https://${kne}/css2?family=${encodeURIComponent(e)}:wght@100;200;300;400;500;600;700;800;900&display=swap'); 48599`; 48600 Td(t, document.head, `googleFont:${e}`); 48601}, kne = "fonts.googleapis.com", Pne = ( 48602 /*css*/ 48603 '.ag-checkbox-input-wrapper,.ag-radio-button-input-wrapper{background-color:var(--ag-checkbox-unchecked-background-color);border:solid var(--ag-checkbox-border-width) var(--ag-checkbox-unchecked-border-color);flex:none;height:var(--ag-icon-size);position:relative;width:var(--ag-icon-size);:where(input){-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;display:block;height:var(--ag-icon-size);margin:0;opacity:0;width:var(--ag-icon-size)}&:after{content:"";display:block;inset:0;-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;pointer-events:none;position:absolute}&:where(.ag-checked){background-color:var(--ag-checkbox-checked-background-color);border-color:var(--ag-checkbox-checked-border-color);&:after{background-color:var(--ag-checkbox-checked-shape-color)}}&:where(:focus-within,:active){box-shadow:var(--ag-focus-shadow)}&:where(.ag-disabled){filter:grayscale();opacity:.5}}.ag-checkbox-input-wrapper{border-radius:var(--ag-checkbox-border-radius);&:where(.ag-checked):after{-webkit-mask-image:var(--ag-checkbox-checked-shape-image);mask-image:var(--ag-checkbox-checked-shape-image)}&:where(.ag-indeterminate){background-color:var(--ag-checkbox-indeterminate-background-color);border-color:var(--ag-checkbox-indeterminate-border-color);&:after{background-color:var(--ag-checkbox-indeterminate-shape-color);-webkit-mask-image:var(--ag-checkbox-indeterminate-shape-image);mask-image:var(--ag-checkbox-indeterminate-shape-image)}}}.ag-radio-button-input-wrapper{border-radius:100%;&:where(.ag-checked):after{-webkit-mask-image:var(--ag-radio-checked-shape-image);mask-image:var(--ag-radio-checked-shape-image)}}' 48604), Fne = Rs({ 48605 feature: "checkboxStyle", 48606 params: { 48607 checkboxBorderWidth: 1, 48608 checkboxBorderRadius: { 48609 ref: "borderRadius" 48610 },
48611 checkboxUncheckedBackgroundColor: { 48612 ref: "backgroundColor" 48613 }, 48614 checkboxUncheckedBorderColor: go(0.3), 48615 checkboxCheckedBackgroundColor: la, 48616 checkboxCheckedBorderColor: la, 48617 checkboxCheckedShapeImage: { 48618 svg: '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="7" fill="none"><path stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M1 3.5 3.5 6l5-5"/></svg>' 48619 }, 48620 checkboxCheckedShapeColor: { 48621 ref: "backgroundColor" 48622 }, 48623 checkboxIndeterminateBackgroundColor: go(0.3), 48624 checkboxIndeterminateBorderColor: go(0.3), 48625 checkboxIndeterminateShapeImage: { 48626 svg: '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="2" fill="none"><rect width="10" height="2" fill="#000" rx="1"/></svg>' 48627 }, 48628 checkboxIndeterminateShapeColor: { 48629 ref: "backgroundColor" 48630 }, 48631 radioCheckedShapeImage: { 48632 svg: '<svg xmlns="http://www.w3.org/2000/svg" width="6" height="6" fill="none"><circle cx="3" cy="3" r="3" fill="#000"/></svg>' 48633 } 48634 }, 48635 css: Pne 48636}); 48637({ 48638 ...Ld 48639}); 48640({ 48641 ...Ld 48642}); 48643var e_ = { 48644 ...Ld, 48645 backgroundColor: "hsl(217, 0%, 17%)", 48646 foregroundColor: "#FFF", 48647 chromeBackgroundColor: go(0.05), 48648 rowHoverColor: el(0.15), 48649 selectedRowBackgroundColor: el(0.2), 48650 menuBackgroundColor: go(0.1), 48651 browserColorScheme: "dark", 48652 popupShadow: "0 0px 20px #000A", 48653 cardShadow: "0 1px 4px 1px #000A", 48654 advancedFilterBuilderJoinPillColor: "#7a3a37", 48655 advancedFilterBuilderColumnPillColor: "#355f2d", 48656 advancedFilterBuilderOptionPillColor: "#5a3168", 48657 advancedFilterBuilderValuePillColor: "#374c86", 48658 checkboxUncheckedBorderColor: go(0.4), 48659 toggleButtonOffBackgroundColor: go(0.4) 48660}, One = { 48661 ...e_, 48662 backgroundColor: "#1f2836" 48663}, Nne = /* @__PURE__ */ Rs({ 48664 feature: "colorScheme", 48665 params: Ld, 48666 modeParams: { 48667 light: Ld, 48668 dark: e_, 48669 "dark-blue": One 48670 } 48671}), t_ = ( 48672 /*css*/ 48673 ':where(.ag-icon):before{align-items:center;background-color:currentcolor;color:inherit;content:"";display:flex;font-family:inherit;font-size:var(--ag-icon-size);font-style:normal;font-variant:normal;height:var(--ag-icon-size);justify-content:center;line-height:var(--ag-icon-size);-webkit-mask-size:contain;mask-size:contain;text-transform:none;width:var(--ag-icon-size)}.ag-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;display:block;height:var(--ag-icon-size);position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ag-icon-size)}' 48674), _ne = ( 48675 /*css*/ 48676 `.ag-icon-aggregation:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eaggregation%3C/title%3E%3Cpath d='M24 5.333H8V8l8.667 8L8 24v2.667h16v-4h-9.333L21.334 16l-6.667-6.667H24z'/%3E%3C/svg%3E")}.ag-icon-arrows:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Earrows%3C/title%3E%3Cpath d='M13.333 11.556h5.333V8h3.556L16 1.778 9.778 8h3.556zm-1.777 1.777H8V9.777l-6.222 6.222L8 22.221v-3.556h3.556zM30.222 16 24 9.778v3.556h-3.556v5.333H24v3.556l6.222-6.222zm-11.555 4.444h-5.333V24H9.778L16 30.222 22.222 24h-3.556z'/%3E%3C/svg%3E")}.ag-icon-asc:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E")}.ag-icon-cancel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecancel%3C/title%3E%3Cpath d='M16 2.667C8.627 2.667 2.667 8.627 2.667 16S8.627 29.333 16 29.333 29.333 23.373 29.333 16 23.373 2.667 16 2.667m6.667 18.12-1.88 1.88L16 17.88l-4.787 4.787-1.88-1.88L14.12 16l-4.787-4.787 1.88-1.88L16 14.12l4.787-4.787 1.88 1.88L17.88 16z'/%3E%3C/svg%3E")}.ag-icon-chart:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Echart%3C/title%3E%3Cpath d='M6.667 12.267h4v13.067h-4zm7.466-5.6h3.733v18.667h-3.733zM21.6 17.333h3.733v8H21.6z'/%3E%3C/svg%3E")}.ag-icon-color-picker:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolor-picker%3C/title%3E%3Cpath d='M23.907 17.587 10.574 4.254l-1.88 1.88 3.173 3.173-8.28 8.28 10.16 10.16zm-16.547 0 6.387-6.387 6.387 6.387H7.361zm18.387 2s-2.667 2.893-2.667 4.667c0 1.467 1.2 2.667 2.667 2.667s2.667-1.2 2.667-2.667c0-1.773-2.667-4.667-2.667-4.667'/%3E%3C/svg%3E")}.ag-icon-columns:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecolumns%3C/title%3E%3Cpath d='M5.333 10.667h5.333V5.334H5.333zm8 16h5.333v-5.333h-5.333zm-8 0h5.333v-5.333H5.333zm0-8h5.333v-5.333H5.333zm8 0h5.333v-5.333h-5.333zm8-13.334v5.333h5.333V5.333zm-8 5.334h5.333V5.334h-5.333zm8 8h5.333v-5.333h-5.333zm0 8h5.333v-5.333h-5.333z'/%3E%3C/svg%3E")}.ag-icon-contracted:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Econtracted%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-copy:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecopy%3C/title%3E%3Cpath d='M22 1.333H6A2.675 2.675 0 0 0 3.333 4v18.667H6V4h16zm4 5.334H11.333a2.675 2.675 0 0 0-2.667 2.667v18.667c0 1.467 1.2 2.667 2.667 2.667H26c1.467 0 2.667-1.2 2.667-2.667V9.334c0-1.467-1.2-2.667-2.667-2.667M26 28H11.333V9.333H26z'/%3E%3C/svg%3E")}.ag-icon-cross:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Ecross%3C/title%3E%3Cpath d='m25.333 8.547-1.88-1.88L16 14.12 8.547 6.667l-1.88 1.88L14.12 16l-7.453 7.453 1.88 1.88L16 17.88l7.453 7.453 1.88-1.88L17.88 16z'/%3E%3C/svg%3E")}.ag-icon-csv:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753
48676-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='matrix(.06285 0 0 .06285 3.934 -.054)'/%3E%3Cpath d='M.688-.226a.2.2 0 0 1-.017.074.28.28 0 0 1-.145.14.412.412 0 0 1-.234.013.28.28 0 0 1-.202-.168.468.468 0 0 1-.04-.19q0-.086.025-.155a.319.319 0 0 1 .182-.191.4.4 0 0 1 .134-.025q.087 0 .155.035a.3.3 0 0 1 .104.085.17.17 0 0 1 .036.097.06.06 0 0 1-.018.044.06.06 0 0 1-.042.019.06.06 0 0 1-.042-.013.2.2 0 0 1-.031-.046.2.2 0 0 0-.066-.079.16.16 0 0 0-.095-.027.17.17 0 0 0-.142.068.3.3 0 0 0-.053.193.4.4 0 0 0 .023.139.2.2 0 0 0 .067.083.2.2 0 0 0 .1.027q.063 0 .106-.031a.2.2 0 0 0 .065-.091.2.2 0 0 1 .023-.046q.014-.018.044-.018a.06.06 0 0 1 .044.018.06.06 0 0 1 .019.045' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 7.122 25.977)'/%3E%3Cpath d='M.622-.215a.2.2 0 0 1-.033.117.23.23 0 0 1-.098.081.4.4 0 0 1-.153.029.34.34 0 0 1-.175-.04.23.23 0 0 1-.079-.077.17.17 0 0 1-.031-.093q0-.027.019-.045a.06.06 0 0 1 .046-.019.06.06 0 0 1 .039.014.1.1 0 0 1 .027.044.3.3 0 0 0 .03.057q.015.023.044.038.03.015.076.015.065 0 .105-.03a.09.09 0 0 0 .04-.075.08.08 0 0 0-.022-.058.14.14 0 0 0-.056-.034 1 1 0 0 0-.092-.025.7.7 0 0 1-.129-.042.2.2 0 0 1-.083-.066.17.17 0 0 1-.03-.104q0-.058.032-.105a.2.2 0 0 1 .093-.07.4.4 0 0 1 .144-.025q.066 0 .114.016a.3.3 0 0 1 .08.044.2.2 0 0 1 .046.057q.015.03.015.058a.07.07 0 0 1-.018.046.06.06 0 0 1-.046.021q-.025 0-.038-.012a.2.2 0 0 1-.028-.041.2.2 0 0 0-.047-.063Q.387-.625.326-.625a.15.15 0 0 0-.09.025q-.035.024-.035.059 0 .021.012.037a.1.1 0 0 0 .032.027.4.4 0 0 0 .111.036q.06.015.11.031.048.018.083.042a.2.2 0 0 1 .054.062.2.2 0 0 1 .019.091' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 13.339 25.977)'/%3E%3Cpath d='m.184-.633.162.48.163-.483q.013-.038.019-.053a.062.062 0 0 1 .061-.039q.018 0 .034.009a.1.1 0 0 1 .025.025q.009.015.009.031L.654-.64l-.007.025-.009.024-.173.468-.019.051a.2.2 0 0 1-.021.042.1.1 0 0 1-.033.03.1.1 0 0 1-.049.012.1.1 0 0 1-.05-.011A.1.1 0 0 1 .26-.03a.2.2 0 0 1-.021-.042L.22-.123.05-.587.041-.612.033-.638.03-.662q0-.025.02-.046a.07.07 0 0 1 .05-.02q.037 0 .053.023.015.023.031.072' style='fill-rule:nonzero' transform='matrix(8.39799 0 0 12.455 18.94 25.977)'/%3E%3C/svg%3E")}.ag-icon-cut:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='m19 3-6 6 2 2 7-7V3m-10 9.5a.503.503 0 0 1-.5-.5c0-.274.226-.5.5-.5s.5.226.5.5-.226.5-.5.5M6 20c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2M6 8c-1.097 0-2-.903-2-2a2 2 0 0 1 2-2c1.097 0 2 .903 2 2a2 2 0 0 1-2 2m3.64-.36c.23-.5.36-1.05.36-1.64 0-2.194-1.806-4-4-4S2 3.806 2 6s1.806 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.194 0-4 1.806-4 4s1.806 4 4 4 4-1.806 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1z' style='fill-rule:nonzero' transform='translate(4 4)'/%3E%3C/svg%3E")}.ag-icon-desc:before,.ag-icon-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Edesc%3C/title%3E%3Cpath d='m26.667 16-1.88-1.88-7.453 7.44V5.333h-2.667V21.56l-7.44-7.453L5.334 16l10.667 10.667L26.668 16z'/%3E%3C/svg%3E")}.ag-icon-excel:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M384 131.9c-7.753-8.433-110.425-128.473-114.9-133L48-.1C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48zm-35.9 2.1H257V27.9zM30 479V27h200l1 105c0 13.3-1.3 29 12 29h111l1 318z' style='fill-rule:nonzero' transform='matrix(.06285 0 0 .06285 3.934 -.054)'/%3E%3Cpath d='m.052-.139.16-.234-.135-.208a.4.4 0 0 1-.028-.052.1.1 0 0 1-.01-.042.05.05 0 0 1 .018-.037.07.07 0 0 1 .045-.016q.03 0 .047.018a1 1 0 0 1 .047.066l.107.174.115-.174.024-.038.019-.026.021-.015a.1.1 0 0 1 .027-.005.06.06 0 0 1 .044.016.05.05 0 0 1 .018.039q0 .033-.038.089l-.141.211.152.234a.3.3 0 0 1 .03.051.1.1 0 0 1 .009.038.1.1 0 0 1-.008.031.1.1 0 0 1-.024.023.1.1 0 0 1-.034.008.1.1 0 0 1-.035-.008.1.1 0 0 1-.023-.022L.427-.067.301-.265l-.134.204-.022.034-.016.019a.
486761.1 0 0 1-.022.015.1.1 0 0 1-.03.005.06.06 0 0 1-.044-.016.06.06 0 0 1-.017-.047q0-.036.036-.088' style='fill-rule:nonzero' transform='matrix(17.82892 0 0 16.50777 10.371 25.928)'/%3E%3C/svg%3E")}.ag-icon-expanded:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eexpanded%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E")}.ag-icon-eye-slash:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye-slash%3C/title%3E%3Cpath d='M21.106 15.088A5.19 5.19 0 0 0 16 10.814a5.17 5.17 0 0 0-3.668 1.522L9.866 9.868a12.2 12.2 0 0 1 6.133-1.646c5.186 0 9.614 3.225 11.408 7.778a12.34 12.34 0 0 1-5.276 6.133l-2.468-2.466a5.17 5.17 0 0 0 1.449-2.802h-2.123c-.148.508-.42.964-.782 1.33l-1.33-1.33h-2.514l2.196 2.196q-.272.049-.56.05a3.11 3.11 0 0 1-2.99-2.245h-2.123a5.19 5.19 0 0 0 7.3 3.836l2.247 2.247a12.2 12.2 0 0 1-4.434.828c-5.186 0-9.614-3.225-11.408-7.778a12.3 12.3 0 0 1 3.781-5.111l2.924 2.924a5.1 5.1 0 0 0-.404 1.275h4.206l-1.296-1.296a3.1 3.1 0 0 1 2.196-.903c1.404 0 2.587.924 2.976 2.199h2.13z'/%3E%3C/svg%3E")}.ag-icon-eye:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eeye%3C/title%3E%3Cpath d='M16 8.222c-5.186 0-9.614 3.225-11.408 7.778 1.794 4.553 6.222 7.778 11.408 7.778S25.614 20.553 27.408 16C25.614 11.447 21.186 8.222 16 8.222m0 12.964c-2.862 0-5.186-2.324-5.186-5.186s2.324-5.186 5.186-5.186 5.186 2.324 5.186 5.186-2.324 5.186-5.186 5.186m0-8.297c-1.721 0-3.111 1.39-3.111 3.111s1.39 3.111 3.111 3.111 3.111-1.39 3.111-3.111-1.39-3.111-3.111-3.111'/%3E%3C/svg%3E")}.ag-icon-filter:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efilter%3C/title%3E%3Cpath d='M13.333 24h5.333v-2.667h-5.333zM4 8v2.667h24V8zm4 9.333h16v-2.667H8z'/%3E%3C/svg%3E")}.ag-icon-first:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Efirst%3C/title%3E%3Cpath d='M24.273 22.12 18.153 16l6.12-6.12L22.393 8l-8 8 8 8zM7.727 8h2.667v16H7.727z'/%3E%3C/svg%3E")}.ag-icon-group:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egroup%3C/title%3E%3Cpath d='M18.667 21.333h8.889A3.555 3.555 0 0 1 24 24.889h-5.333zm8.888-7.111v3.556h-8.889v-3.556zM24 7.111a3.555 3.555 0 0 1 3.556 3.556h-16V7.111zm-8.889 17.778h-3.556v-3.556h3.556zm0-7.111h-3.556v-3.556h3.556zM8 10.667H4.444A3.555 3.555 0 0 1 8 7.111z'/%3E%3C/svg%3E")}.ag-icon-last:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elast%3C/title%3E%3Cpath d='m7.727 9.88 6.12 6.12-6.12 6.12L9.607 24l8-8-8-8zM21.607 8h2.667v16h-2.667z'/%3E%3C/svg%3E")}.ag-icon-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eleft%3C/title%3E%3Cpath d='M26.667 14.667H10.44l7.453-7.453L16 5.334 5.333 16.001 16 26.668l1.88-1.88-7.44-7.453h16.227v-2.667z'/%3E%3C/svg%3E")}.ag-icon-linked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Elinked%3C/title%3E%3Cpath d='M5.2 16a4.136 4.136 0 0 1 4.133-4.133h5.333V9.334H9.333c-3.68 0-6.667 2.987-6.667 6.667s2.987 6.667 6.667 6.667h5.333v-2.533H9.333A4.136 4.136 0 0 1 5.2 16.002zm5.467 1.333h10.667v-2.667H10.667zm12-8h-5.333v2.533h5.333c2.28 0 4.133 1.853 4.133 4.133s-1.853 4.133-4.133 4.133h-5.333v2.533h5.333c3.68 0 6.667-2.987 6.667-6.667s-2.987-6.667-6.667-6.667z'/%3E%3C/svg%3E")}.ag-icon-loading:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eloading%3C/title%3E%3Cpath d='m17.778 11.708 3.25-3.251 2.516 2.516-3.251 3.25h4.597v3.556h-4.597l3.251 3.25-2.516 2.516-3.25-3.251v4.597h-3.556v-4.597l-3.25 3.251-2.516-2.516 3.251-3.25H7.11v-3.556h4.597l-3.251-3.25 2.516-2.516 3.25 3.251V7.111h3.556zm-3.251 7.847h2.944l2.084-2.084v-2.944l-2.084-2.084h-2.944l-2.084 2.084v2.944z'/%3E%3C/svg%3E")}.ag-icon-maximize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emaximize%3C/title%3E%3Cpath d='M4 4h24v2.667H4z'/%3
48676E%3C/svg%3E")}.ag-icon-menu:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Emenu%3C/title%3E%3Cpath d='M4 24h24v-2.667H4zm0-6.667h24v-2.667H4zM4 8v2.667h24V8z'/%3E%3C/svg%3E")}.ag-icon-menu-alt:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 26.667a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 24q0-1.1.784-1.883A2.57 2.57 0 0 1 16 21.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 16q0-1.1.784-1.883A2.57 2.57 0 0 1 16 13.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784m0-8a2.57 2.57 0 0 1-1.883-.784A2.57 2.57 0 0 1 13.333 8q0-1.1.784-1.883A2.57 2.57 0 0 1 16 5.333q1.1 0 1.883.784.784.783.784 1.883t-.784 1.883a2.57 2.57 0 0 1-1.883.784'/%3E%3C/svg%3E")}.ag-icon-minimize:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eminimize%3C/title%3E%3Cpath d='M8 25.333h16V28H8z'/%3E%3C/svg%3E")}.ag-icon-minus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658H7.901v-2.658z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-next:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enext%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-none:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enone%3C/title%3E%3Cpath d='M4 24h16v-2.667H4zM4 8v2.667h24V8zm0 9.333h24v-2.667H4z'/%3E%3C/svg%3E")}.ag-icon-not-allowed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Enot-allowed%3C/title%3E%3Cpath d='M16 2.667C8.64 2.667 2.667 8.64 2.667 16S8.64 29.333 16 29.333 29.333 23.36 29.333 16 23.36 2.667 16 2.667M5.333 16c0-5.893 4.773-10.667 10.667-10.667 2.467 0 4.733.84 6.533 2.253L7.586 22.533A10.54 10.54 0 0 1 5.333 16M16 26.667c-2.467 0-4.733-.84-6.533-2.253L24.414 9.467A10.54 10.54 0 0 1 26.667 16c0 5.893-4.773 10.667-10.667 10.667'/%3E%3C/svg%3E")}.ag-icon-paste:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epaste%3C/title%3E%3Cpath d='M25.333 4H19.76C19.2 2.453 17.733 1.333 16 1.333S12.8 2.453 12.24 4H6.667A2.675 2.675 0 0 0 4 6.667V28c0 1.467 1.2 2.667 2.667 2.667h18.667c1.467 0 2.667-1.2 2.667-2.667V6.667C28.001 5.2 26.801 4 25.334 4zM16 4c.733 0 1.333.6 1.333 1.333s-.6 1.333-1.333 1.333-1.333-.6-1.333-1.333S15.267 4 16 4m9.333 24H6.666V6.667h2.667v4h13.333v-4h2.667z
vendor: 6,162 bytes, line 48676
48676'/%3E%3C/svg%3E")}.ag-icon-pin:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epin%3C/title%3E%3Cpath d='m11.106 22.093-4.444 4.444-1.259-1.259 4.444-4.444zm5.872-16.63 9.618 9.62-.962.962-.962-.962-7.694 3.847 1.924 1.924-2.74 2.74-7.696-7.696 2.741-2.74 1.924 1.925 3.847-7.696-.962-.962z'/%3E%3C/svg%3E")}.ag-icon-pivot:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Epivot%3C/title%3E%3Cpath d='M26.667 30.223H5.334a3.556 3.556 0 0 1-3.556-3.556V5.334a3.556 3.556 0 0 1 3.556-3.556h21.333a3.556 3.556 0 0 1 3.556 3.556v21.333a3.556 3.556 0 0 1-3.556 3.556m-16-8.89H5.334v5.333h5.333zm16-7.11H12.444v12.444h14.223zm-9.15 6.85-2.039 2.037 2.039 2.039-1.257 1.257-3.295-3.296 3.295-3.295q.63.628 1.257 1.257zm-6.85-6.85H5.334v5.333h5.333zm15.74 3.816-1.257 1.256-2.039-2.037-2.037 2.037-1.257-1.256 3.295-3.296zM10.667 5.333H5.334v5.333h5.333zm8.889 0h-7.112v5.333h7.112zm7.111 0h-5.333v5.333h5.333z'/%3E%3C/svg%3E")}.ag-icon-plus:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2' viewBox='0 0 32 32'%3E%3Cpath d='M6.572 6.572a13.32 13.32 0 0 0 0 18.856 13.32 13.32 0 0 0 18.856 0 13.32 13.32 0 0 0 0-18.856 13.32 13.32 0 0 0-18.856 0m17.527 8.099v2.658h-6.77v6.77h-2.658v-6.77h-6.77v-2.658h6.77v-6.77h2.658v6.77z' style='fill-rule:nonzero'/%3E%3C/svg%3E")}.ag-icon-previous:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eprevious%3C/title%3E%3Cpath d='M20.94 9.88 19.06 8l-8 8 8 8 1.88-1.88L14.833 16z'/%3E%3C/svg%3E")}.ag-icon-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eright%3C/title%3E%3Cpath d='m16 5.333-1.88 1.88 7.44 7.453H5.333v2.667H21.56l-7.44 7.453 1.88 1.88 10.667-10.667L16 5.332z'/%3E%3C/svg%3E")}.ag-icon-save:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esave%3C/title%3E%3Cpath d='M25.333 16v9.333H6.666V16H3.999v9.333C3.999 26.8 5.199 28 6.666 28h18.667C26.8 28 28 26.8 28 25.333V16zm-8 .893 3.453-3.44 1.88 1.88L15.999 22l-6.667-6.667 1.88-1.88 3.453 3.44V4h2.667v12.893z'/%3E%3C/svg%3E")}.ag-icon-small-down:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-down%3C/title%3E%3Cpath d='M9.333 12.667 16 19.334l6.667-6.667H9.334z'/%3E%3C/svg%3E")}.ag-icon-small-left:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-left%3C/title%3E%3Cpath d='M19.333 9.333 12.666 16l6.667 6.667V9.334z'/%3E%3C/svg%3E")}.ag-icon-small-right:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-right%3C/title%3E%3Cpath d='M12.667 22.667 19.334 16l-6.667-6.667v13.333z'/%3E%3C/svg%3E")}.ag-icon-small-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Esmall-up%3C/title%3E%3Cpath d='M9.333 19.333 16 12.666l6.667 6.667H9.334z'/%3E%3C/svg%3E")}.ag-icon-tick:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etick%3C/title%3E%3Cpath d='m11.727 21.167-5.56-5.56-1.893 1.88 7.453 7.453 16-16-1.88-1.88z'/%3E%3C/svg%3E")}.ag-icon-tree-closed:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-closed%3C/title%3E%3Cpath d='m12.94 8-1.88 1.88L17.167 16l-6.107 6.12L12.94 24l8-8z'/%3E%3C/svg%3E")}.ag-icon-tree-indeterminate:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-indeterminate%3C/title%3E%3Cpath d='M6.667 14.667h18.667v2.667H6.667z'/%3E%3C/svg%3E")}.ag-icon-tree-open:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Etree-open%3C/title%3E%3Cpath d='M22.12 11.06 16 17.167 9.88 11.06 8 12.94l8 8 8-8z'/%3E%3C/svg%3E")}.ag-icon-unlinked:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Eunlinked%3C/title%3E%3Cpath d='M22.667 9.333h-5.333v2.533h5.333a4.136 4.136 0 0 1 4.133 4.133c0 1.907-1.307 3.507-3.08 3.973l1.947 1.947c2.173-1.107 3.667-3.32 3.667-5.92a6.67 6.67 0 0 0-6.667-6.667zm-1.334 5.334h-2.92l2.667 2.667h.253zM2.667 5.693 6.814 9.84A6.65 6.65 0 0 0 2.667 16a6.67 6.67 0 0 0 6.667 6.667h5.333v-2.533H9.334a4.136 4.136 0 0 1-4.133-4.133c0-2.12 1.613-3.867 3.68-4.093l2.76 2.76h-.973v2.667h3.64l3.027 3.027v2.307h2.307l5.347 5.333 1.68-1.68L4.362 4.002 2.669 5.695z'/%3E%3C/svg%3E")}.ag-icon-up:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Easc%3C/title%3E%3Cpath d='m5.333 16 1.88 1.88 7.453-7.44v16.227h2.667V10.44l7.44 7.453L26.666 16 15.999 5.333z'/%3E%3C/svg%3E")}.ag-icon-grip:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ctitle%3Egrip%3C/title%3E%3Cpath d='M26.667 12H5.334v2.667h21.333zM5.333 20h21.333v-2.667H5.333z'/%3E%3C/svg%3E")}.ag-icon-settings:before{mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='none' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M30 8h-4.1c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2v2h14.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30zm-9 4c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3M2 24h4.1c.5 2.3 2.5 4 4.9 4s4.4-1.7 4.9-4H30v-2H15.9c-.5-2.3-2.5-4-4.9-4s-4.4 1.7-4.9 4H2zm9-4c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3'/%3E%3C/svg%3E")}
48676` 48677), i_ = /* @__PURE__ */ Rs({ 48678 feature: "iconSet", 48679 css: () => t_ + _ne 48680}), s_ = { 48681 aggregation: '<path d="M18 7V4H6l6 8-6 8h12v-3"/>', 48682 arrows: '<polyline points="5 9 2 12 5 15"/><polyline points="9 5 12 2 15 5"/><polyline points="15 19 12 22 9 19"/><polyline points="19 9 22 12 19 15"/><line x1="2" x2="22" y1="12" y2="12"/><line x1="12" x2="12" y1="2" y2="22"/>', 48683 asc: '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>', 48684 cancel: '<path d="m18 6-12 12"/><path d="m6 6 12 12"/>', 48685 chart: '<line x1="18" x2="18" y1="20" y2="10"/><line x1="12" x2="12" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="14"/>', 48686 "color-picker": '<path d="m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11Z"/><path d="m5 2 5 5"/><path d="M2 13h15"/><path d="M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z"/>', 48687 columns: '<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"/>', 48688 contracted: '<path d="m9 18 6-6-6-6"/>', 48689 copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>', 48690 cross: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>', 48691 csv: '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>', 48692 cut: '<circle cx="6" cy="6" r="3"/><path d="M8.12 8.12 12 12"/><path d="M20 4 8.12 15.88"/><circle cx="6" cy="18" r="3"/><path d="M14.8 14.8 20 20"/>', 48693 desc: '<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>', 48694 down: '<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>', 48695 excel: '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><path d="M8 13h2"/><path d="M8 17h2"/><path d="M14 13h2"/><path d="M14 17h2"/>', 48696 expanded: '<path d="m15 18-6-6 6-6"/>', 48697 "eye-slash": '<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/>', 48698 eye: '<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/>', 48699 filter: '<path d="M3 6h18"/><path d="M7 12h10"/><path d="M10 18h4"/>', 48700 first: '<path d="m17 18-6-6 6-6"/><path d="M7 6v12"/>', 48701 group: '<path d="M16 12H3"/><path d="M16 18H3"/><path d="M10 6H3"/><path d="M21 18V8a2 2 0 0 0-2-2h-5"/><path d="m16 8-2-2 2-2"/>', 48702 last: '<path d="m7 18 6-6-6-6"/><path d="M17 6v12"/>', 48703 left: '<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>', 48704 linked: '<path d="M9 17H7A5 5 0 0 1 7 7h2"/><path d="M15 7h2a5 5 0 1 1 0 10h-2"/><line x1="8" x2="16" y1="12" y2="12"/>', 48705 loading: '<line x1="12" x2="12" y1="2" y2="6"/><line x1="12" x2="12" y1="18" y2="22"/><line x1="4.93" x2="7.76" y1="4.93" y2="7.76"/><line x1="16.24" x2="19.07" y1="16.24" y2="19.07"/><line x1="2" x2="6" y1="12" y2="12"/><line x1="18" x2="22" y1="12" y2="12"/><line x1="4.93" x2="7.76" y1="19.07" y2="16.24"/><line x1="16.24" x2="19.07" y1="7.76" y2="4.93"/>', 48706 maximize: '<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>', 48707 menu: '<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>', 48708 "menu-alt": '<circle cx="12" cy="5" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="12" r="0.75" fill="#D9D9D9"/><circle cx="12" cy="19" r="0.75" fill="#D9D9D9"/>', 48709 minimize: '<polyline points="4 14 10 14 10 20"/><polyline points="20 10 14 10 14 4"/><line x1="14" x2="21" y1="10" y2="3"/><line x1="3" x2="10" y1="21" y2="14"/>', 48710 minus: '<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/>', 48711 next: '<path d="m9 18 6-6-6-6"/>', 48712 none: '<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>', 48713 "not-allowed": '<circle cx="12" cy="12" r="10"/><path d="m4.9 4.9 14.2 14.2"/>', 48714 paste: '<path d="M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10"/><path d="m17 10 4 4-4 4"/>', 48715 pin: '<line x1="12" x2="12" y1="17" y2="22"/><path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z"/>', 48716 pivot: '<path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/>', 48717 plus: '<circle cx="12" cy="12" r="10"/><path d="M8 12h8"/><path d="M12 8v8"/>', 48718 previous: '<path d="m15 18-6-6 6-6"/>', 48719 right: '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>', 48720 save: '<path d="M12 17V3"/><path d="m6 11 6 6 6-6"/><path d="M19 21H5"/>', 48721 "small-left": '<path d="m15 18-6-6 6-6"/>', 48722 "small-right": '<path d="m9 18 6-6-6-6"/>', 48723 tick: '<path d="M20 6 9 17l-5-5"/>', 48724 "tree-closed": '<path d="m9 18 6-6-6-6"/>', 48725 "tree-indeterminate": '<path d="M5 12h14"/>', 48726 "tree-open": '<path d="m6 9 6 6 6-6"/>', 48727 unlinked: '<path d="M9 17H7A5 5 0 0 1 7 7"/><path d="M15 7h2a5 5 0 0 1 4 8"/><line x1="8" x2="12" y1="12" y2="12"/><line x1="2" x2="22" y1="2" y2="22"/>', 48728 up: '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>', 48729 grip: '<circle cx="5" cy="8" r="0.5"/><circle cx="12" cy="8" r="0.5"/><circle cx="19" cy="8" r="0.5"/><circle cx="5" cy="16" r="0.5"/><circle cx="12" cy="16" r="0.5"/><circle cx="19" cy="16" r="0.5"/><g stroke="none" fill="currentColor"><circle cx="5" cy="8" r="1"/><circle cx="12" cy="8" r="1"/><circle cx="19" cy="8" r="1"/><circle cx="5" cy="16" r="1"/><circle cx="12" cy="16" r="1"/><circle cx="19" cy="16" r="1"/></g>', 48730 settings: '<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>' 48731}, n_ = { 48732 "small-down": '<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32">
48732<path d="M7.334 10.667 16 21.334l8.667-10.667H7.334Z"/></svg>', 48733 "small-up": '<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="black" stroke="none" viewBox="0 0 32 32"><path d="M7.334 21.333 16 10.666l8.667 10.667H7.334Z"/></svg>' 48734}, Bne = (e = {}) => { 48735 let t = t_; 48736 for (const i of [...Object.keys(s_), ...Object.keys(n_)]) { 48737 const s = Gne(i, e.strokeWidth); 48738 t += `.ag-icon-${i}::before { mask-image: url('data:image/svg+xml,${encodeURIComponent(s)}'); } 48739`; 48740 } 48741 return t; 48742}, Gne = (e, t = 1.5) => { 48743 const i = n_[e]; 48744 if (i) 48745 return i; 48746 const s = s_[e]; 48747 if (!s) 48748 throw new Error(`Missing icon data for ${e}`); 48749 return `<svg xmlns="http://www.w3.org/2000/svg" class="ag-icon" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="black" stroke-width="${t}" viewBox="0 0 24 24"><style>* { vector-effect: non-scaling-stroke; }</style>` + s + "</svg>"; 48750}, zne = (e = {}) => Rs({ 48751 feature: "iconSet", 48752 css: () => Bne(e) 48753}), Hne = /* @__PURE__ */ zne(), DM = ( 48754 /*css*/ 48755 ':where(.ag-input-field-input[type=number]:not(.ag-number-field-input-stepper)){-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}}:where(input.ag-input-field-input:not([type]),input.ag-input-field-input[type=text],input.ag-input-field-input[type=number],input.ag-input-field-input[type=tel],input.ag-input-field-input[type=date],input.ag-input-field-input[type=datetime-local],textarea.ag-input-field-input){background-color:var(--ag-input-background-color);border:var(--ag-input-border);border-radius:var(--ag-input-border-radius);color:var(--ag-input-text-color);font-family:inherit;font-size:inherit;line-height:inherit;margin:0;min-height:var(--ag-input-height);padding:0;&:where(:disabled){background-color:var(--ag-input-disabled-background-color);border:var(--ag-input-disabled-border);color:var(--ag-input-disabled-text-color)}&:where(:focus){background-color:var(--ag-input-focus-background-color);border:var(--ag-input-focus-border);box-shadow:var(--ag-input-focus-shadow);color:var(--ag-input-focus-text-color);outline:none}&:where(:invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&:where(.invalid){background-color:var(--ag-input-invalid-background-color);border:var(--ag-input-invalid-border);color:var(--ag-input-invalid-text-color)}&::-moz-placeholder{color:var(--ag-input-placeholder-text-color)}&::placeholder{color:var(--ag-input-placeholder-text-color)}}:where(.ag-ltr) :where(input.ag-input-field-input:not([type]),input.ag-input-field-input[type=text],input.ag-input-field-input[type=number],input.ag-input-field-input[type=tel],input.ag-input-field-input[type=date],input.ag-input-field-input[type=datetime-local],textarea.ag-input-field-input){padding-left:var(--ag-input-padding-start)}:where(.ag-rtl) :where(input.ag-input-field-input:not([type]),input.ag-input-field-input[type=text],input.ag-input-field-input[type=number],input.ag-input-field-input[type=tel],input.ag-input-field-input[type=date],input.ag-input-field-input[type=datetime-local],textarea.ag-input-field-input){padding-right:var(--ag-input-padding-start)}:where(.ag-column-select-header-filter-wrapper,.ag-filter-toolpanel-search,.ag-mini-filter,.ag-filter-filter){.ag-input-wrapper:before{background-color:currentcolor;color:var(--ag-input-icon-color);content:"";display:block;height:12px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");mask-image:url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMS41Ij48cGF0aCBkPSJNNS4zIDlhMy43IDMuNyAwIDEgMCAwLTcuNSAzLjcgMy43IDAgMCAwIDAgNy41Wk0xMC41IDEwLjUgOC4zIDguMiIvPjwvc3ZnPg==");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;opacity:.5;position:absolute;width:12px}}:where(.ag-ltr) :where(.ag-column-select-header-filter-wrapper,.ag-filter-toolpanel-search,.ag-mini-filter,.ag-filter-filter){.ag-input-wrapper:before{margin-left:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-left:calc(var(--ag-spacing)*1.5 + 12px)}}:where(.ag-rtl) :where(.ag-column-select-header-filter-wrapper,.ag-filter-toolpanel-search,.ag-mini-filter,.ag-filter-filter){.ag-input-wrapper:before{margin-right:var(--ag-spacing)}.ag-number-field-input,.ag-text-field-input{padding-right:calc(var(--ag-spacing)*1.5 + 12px)}}' 48756), Vne = ( 48757 /*css*/ 48758 ":where(input.ag-input-field-input:not([type]),input.ag-input-field-input[type=text],input.ag-input-field-input[type=number],input.ag-input-field-input[type=tel],input.ag-input-field-input[type=date],input.ag-input-field-input[type=datetime-local],textarea.ag-input-field-input){&:focus{box-shadow:var(--ag-focus-shadow)}}" 48759), Une = ( 48760 /*css*/ 48761 ":where(input.ag-input-field-input:not([type]),input.ag-input-field-input[type=text],input.ag-input-field-input[type=number],input.ag-input-field-input[type=tel],input.ag-input-field-input[type=date],input.ag-input-field-input[type=datetime-local],textarea.ag-input-field-input){border-left:none;border-right:none;border-top:none}" 48762), EM = {
48763 inputBackgroundColor: "transparent", 48764 inputBorder: !1, 48765 inputBorderRadius: 0, 48766 inputTextColor: { 48767 ref: "textColor" 48768 }, 48769 inputPlaceholderTextColor: { 48770 ref: "inputTextColor", 48771 mix: 0.5 48772 }, 48773 inputPaddingStart: 0, 48774 inputHeight: { 48775 calc: "max(iconSize, fontSize) + spacing * 2" 48776 }, 48777 inputFocusBackgroundColor: { 48778 ref: "inputBackgroundColor" 48779 }, 48780 inputFocusBorder: { 48781 ref: "inputBorder" 48782 }, 48783 inputFocusShadow: "none", 48784 inputFocusTextColor: { 48785 ref: "inputTextColor" 48786 }, 48787 inputDisabledBackgroundColor: { 48788 ref: "inputBackgroundColor" 48789 }, 48790 inputDisabledBorder: { 48791 ref: "inputBorder" 48792 }, 48793 inputDisabledTextColor: { 48794 ref: "inputTextColor" 48795 }, 48796 inputInvalidBackgroundColor: { 48797 ref: "inputBackgroundColor" 48798 }, 48799 inputInvalidBorder: { 48800 ref: "inputBorder" 48801 }, 48802 inputInvalidTextColor: { 48803 ref: "inputTextColor" 48804 }, 48805 inputIconColor: { 48806 ref: "inputTextColor" 48807 } 48808}; 48809Rs({ 48810 feature: "inputStyle", 48811 params: EM, 48812 css: DM 48813}); 48814var Wne = /* @__PURE__ */ Rs({ 48815 feature: "inputStyle", 48816 params: { 48817 ...EM, 48818 inputBackgroundColor: { 48819 ref: "backgroundColor" 48820 }, 48821 inputBorder: !0, 48822 inputBorderRadius: { 48823 ref: "borderRadius" 48824 }, 48825 inputPaddingStart: { 48826 ref: "spacing" 48827 }, 48828 inputFocusBorder: { 48829 color: la 48830 }, 48831 inputFocusShadow: { 48832 ref: "focusShadow" 48833 }, 48834 inputDisabledBackgroundColor: go(0.06), 48835 inputDisabledTextColor: { 48836 ref: "textColor", 48837 mix: 0.5 48838 }, 48839 inputInvalidBorder: { 48840 color: { ref: "invalidColor" } 48841 } 48842 }, 48843 css: () => DM + Vne 48844}); 48845({ 48846 ...EM, 48847 inputBorder: un(0.3) 48848}); 48849var Ig = ( 48850 /*css*/ 48851 '.ag-tabs-header{background-color:var(--ag-tab-bar-background-color);border-bottom:var(--ag-tab-bar-border);display:flex;flex:1;gap:var(--ag-tab-spacing);padding:var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0}.ag-tabs-header-wrapper{display:flex}.ag-tabs-close-button-wrapper{align-items:center;border:0;display:flex;padding:var(--ag-spacing)}:where(.ag-ltr) .ag-tabs-close-button-wrapper{border-right:1px solid var(--ag-border-color)}:where(.ag-rtl) .ag-tabs-close-button-wrapper{border-left:1px solid var(--ag-border-color)}.ag-tabs-close-button{background-color:unset;border:0;cursor:pointer;padding:0}.ag-tab{align-items:center;background-color:var(--ag-tab-background-color);border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;color:var(--ag-tab-text-color);cursor:pointer;display:flex;flex:1;justify-content:center;padding:var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);position:relative;&:hover{background-color:var(--ag-tab-hover-background-color);color:var(--ag-tab-hover-text-color)}&.ag-tab-selected{background-color:var(--ag-tab-selected-background-color);color:var(--ag-tab-selected-text-color)}&:after{background-color:var(--ag-tab-selected-underline-color);bottom:0;content:"";display:block;height:var(--ag-tab-selected-underline-width);left:0;opacity:0;position:absolute;right:0;transition:opacity var(--ag-tab-selected-underline-transition-duration)}&.ag-tab-selected:after{opacity:1}}:where(.ag-ltr) .ag-tab{&.ag-tab-selected{&:where(:not(:first-of-type)){border-left-color:var(--ag-tab-selected-border-color)}&:where(:not(:last-of-type)){border-right-color:var(--ag-tab-selected-border-color)}}}:where(.ag-rtl) .ag-tab{&.ag-tab-selected{&:where(:not(:first-of-type)){border-right-color:var(--ag-tab-selected-border-color)}&:where(:not(:last-of-type)){border-left-color:var(--ag-tab-selected-border-color)}}}' 48852), jne = ( 48853 /*css*/ 48854 ".ag-tab{border-left:var(--ag-tab-selected-border-width) solid transparent;border-right:var(--ag-tab-selected-border-width) solid transparent;border-top:var(--ag-tab-selected-border-width) solid transparent;flex:0;&.ag-tab-selected{border-left-color:var(--ag-tab-selected-border-color);border-right-color:var(--ag-tab-selected-border-color);border-top-color:var(--ag-tab-selected-border-color);margin-bottom:-1px;padding-bottom:calc(var(--ag-tab-bottom-padding) + 1px)}}" 48855), Rg = {
48856 tabBarBackgroundColor: "transparent", 48857 tabBarHorizontalPadding: 0, 48858 tabBarTopPadding: 0, 48859 tabBackgroundColor: "transparent", 48860 tabTextColor: { 48861 ref: "textColor" 48862 }, 48863 tabHorizontalPadding: { 48864 ref: "spacing" 48865 }, 48866 tabTopPadding: { 48867 ref: "spacing" 48868 }, 48869 tabBottomPadding: { 48870 ref: "spacing" 48871 }, 48872 tabSpacing: "0", 48873 tabHoverBackgroundColor: { 48874 ref: "tabBackgroundColor" 48875 }, 48876 tabHoverTextColor: { 48877 ref: "tabTextColor" 48878 }, 48879 tabSelectedBackgroundColor: { 48880 ref: "tabBackgroundColor" 48881 }, 48882 tabSelectedTextColor: { 48883 ref: "tabTextColor" 48884 }, 48885 tabSelectedBorderWidth: 1, 48886 tabSelectedBorderColor: "transparent", 48887 tabSelectedUnderlineColor: "transparent", 48888 tabSelectedUnderlineWidth: 0, 48889 tabSelectedUnderlineTransitionDuration: 0, 48890 tabBarBorder: !1 48891}; 48892Rs({ 48893 feature: "tabStyle", 48894 params: Rg, 48895 css: Ig 48896}); 48897var $ne = /* @__PURE__ */ Rs({ 48898 feature: "tabStyle", 48899 params: { 48900 ...Rg, 48901 tabBarBorder: !0, 48902 tabBarBackgroundColor: un(0.05), 48903 tabTextColor: { 48904 ref: "textColor", 48905 mix: 0.7 48906 }, 48907 tabSelectedTextColor: { 48908 ref: "textColor" 48909 }, 48910 tabHoverTextColor: { 48911 ref: "textColor" 48912 }, 48913 tabSelectedBorderColor: { 48914 ref: "borderColor" 48915 }, 48916 tabSelectedBackgroundColor: { 48917 ref: "backgroundColor" 48918 } 48919 }, 48920 css: Ig 48921}); 48922({ 48923 ...Rg 48924}); 48925({ 48926 ...Rg 48927}); 48928({ 48929 ...Rg 48930}); 48931var IM = /* @__PURE__ */ Ene().withPart(Fne).withPart(Nne).withPart(Hne).withPart($ne).withPart(() => Wne).withParams({ 48932 fontFamily: [ 48933 { googleFont: "IBM Plex Sans" }, 48934 "-apple-system", 48935 "BlinkMacSystemFont", 48936 "Segoe UI", 48937 "Roboto", 48938 "Oxygen-Sans", 48939 "Ubuntu" 48940 ] 48941}), cT = { 48942 cssName: "--ag-row-height", 48943 changeKey: "rowHeightChanged", 48944 defaultValue: 42 48945}, uT = { 48946 cssName: "--ag-header-height", 48947 changeKey: "headerHeightChanged", 48948 defaultValue: 48 48949}, dT = { 48950 cssName: "--ag-list-item-height", 48951 changeKey: "listItemHeightChanged", 48952 defaultValue: 24 48953}, F0 = { 48954 cssName: "--ag-row-border", 48955 changeKey: "rowBorderWidthChanged", 48956 defaultValue: 1, 48957 border: !0 48958}, Yne = 0, Kne = class extends he { 48959 constructor() { 48960 super(...arguments), this.beanName = "environment", this.sizeEls = /* @__PURE__ */ new Map(), this.lastKnownValues = /* @__PURE__ */ new Map(), this.sizesMeasured = !1, this.paramsClass = `ag-theme-params-${++Yne}`, this.globalCSS = []; 48961 } 48962 wireBeans(e) { 48963 this.eGridDiv = e.eGridDiv; 48964 } 48965 postConstruct() { 48966 this.addManagedPropertyListener("theme", () => this.handleThemeGridOptionChange()), this.handleThemeGridOptionChange(), this.addManagedPropertyListener("rowHeight", () => this.refreshRowHeightVariable()), this.getSizeEl(cT), this.getSizeEl(uT), this.getSizeEl(dT), this.getSizeEl(F0), this.refreshRowBorderWidthVariable(), this.addDestroyFunc(() => cne(this)); 48967 } 48968 getDefaultRowHeight() { 48969 return this.getCSSVariablePixelValue(cT); 48970 } 48971 getDefaultHeaderHeight() { 48972 return this.getCSSVariablePixelValue(uT); 48973 } 48974 getDefaultColumnMinWidth() { 48975 return Math.min(36, this.getDefaultRowHeight()); 48976 } 48977 getDefaultListItemHeight() { 48978 return this.getCSSVariablePixelValue(dT); 48979 } 48980 getRowBorderWidth() { 48981 return this.getCSSVariablePixelValue(F0); 48982 } 48983 applyThemeClasses(e) { 48984 const { gridTheme: t } = this; 48985 let i = ""; 48986 if (t) 48987 i = `${this.paramsClass} ${t._getCssClass()}`; 48988 else { 48989 let s = this.eGridDiv; 48990 for (; s; ) { 48991 for (const n of Array.from(s.classList)) 48992 n.startsWith("ag-theme-") && (i = i ? `${i} ${n}` : n); 48993 s = s.parentElement; 48994 } 48995 } 48996 for (const s of Array.from(e.classList)) 48997 s.startsWith("ag-theme-") && e.classList.remove(s); 48998 if (i) { 48999 const s = e.className; 49000 e.className = s + (s ? " " : "") + i; 49001 } 49002 } 49003 refreshRowHeightVariable() { 49004 const { eGridDiv: e } = this, t = e.style.getPropertyValue("--ag-line-height").trim(), i = this.gos.get("rowHeight"); 49005 if (i == null || isNaN(i) || !isFinite(i)) 49006 return t !== null && e.style.setProperty("--ag-line-height", null), -1; 49007 const s = `${i}px`; 49008 return t != s ? (e.style.setProperty("--ag-line-height", s), i) : t != "" ? parseFloat(t) : -1; 49009 } 49010 addGlobalCSS(e, t) { 49011 this.gridTheme ? Td(e, this.eGridDiv, t) : this.globalCSS.push([e, t]); 49012 } 49013 getCSSVariablePixelValue(e) { 49014 const t = this.lastKnownValues.get(e); 49015 if (t != null) 49016 return t; 49017 const i = this.measureSizeEl(e);
49018 return i === "detached" || i === "no-styles" ? e.defaultValue : (this.lastKnownValues.set(e, i), i); 49019 } 49020 measureSizeEl(e) { 49021 const t = this.getSizeEl(e); 49022 if (t.offsetParent == null) 49023 return "detached"; 49024 const i = t.offsetWidth; 49025 return i === O0 ? "no-styles" : (this.sizesMeasured = !0, i); 49026 } 49027 getMeasurementContainer() { 49028 let e = this.eMeasurementContainer; 49029 return e || (e = this.eMeasurementContainer = document.createElement("div"), e.className = "ag-measurement-container", this.eGridDiv.appendChild(e)), e; 49030 } 49031 getSizeEl(e) { 49032 let t = this.sizeEls.get(e); 49033 if (t) 49034 return t; 49035 const i = this.getMeasurementContainer(); 49036 t = document.createElement("div"); 49037 const { border: s } = e; 49038 s ? (t.className = "ag-measurement-element-border", t.style.setProperty( 49039 "--ag-internal-measurement-border", 49040 `var(${e.cssName}, solid ${O0}px` 49041 )) : t.style.width = `var(${e.cssName}, ${O0}px)`, i.appendChild(t), this.sizeEls.set(e, t); 49042 let n = this.measureSizeEl(e); 49043 n === "no-styles" && Ae(9, { variable: e }); 49044 const o = zl(this.beans, t, () => { 49045 const r = this.measureSizeEl(e); 49046 r === "detached" || r === "no-styles" || (this.lastKnownValues.set(e, r), r !== n && (n = r, this.fireGridStylesChangedEvent(e.changeKey))); 49047 }); 49048 return this.addDestroyFunc(() => o()), t; 49049 } 49050 fireGridStylesChangedEvent(e) { 49051 e === "rowBorderWidthChanged" && this.refreshRowBorderWidthVariable(), this.eventSvc.dispatchEvent({ 49052 type: "gridStylesChanged", 49053 [e]: !0 49054 }); 49055 } 49056 refreshRowBorderWidthVariable() { 49057 const e = this.getCSSVariablePixelValue(F0); 49058 this.eGridDiv.style.setProperty("--ag-internal-row-border-width", `${e}px`); 49059 } 49060 handleThemeGridOptionChange() { 49061 const { gos: e, eGridDiv: t, globalCSS: i, gridTheme: s } = this, n = e.get("theme"); 49062 let o; 49063 if (n === "legacy") 49064 o = void 0; 49065 else { 49066 const r = n ?? IM; 49067 r instanceof XN ? o = r : Rt(240, { theme: r }); 49068 } 49069 if (o !== s) { 49070 if (o) { 49071 lne(this), $N(t); 49072 for (const [a, l] of i) 49073 Td(a, t, l); 49074 i.length = 0; 49075 } 49076 this.gridTheme = o, o?._startUse({ 49077 loadThemeGoogleFonts: e.get("loadThemeGoogleFonts"), 49078 container: t 49079 }); 49080 let r = this.eParamsStyle; 49081 r || (r = this.eParamsStyle = document.createElement("style"), t.appendChild(r)), MM || (r.textContent = o?._getPerGridCss(this.paramsClass) || ""), this.applyThemeClasses(t), this.fireGridStylesChangedEvent("themeChanged"); 49082 } 49083 o && getComputedStyle(this.getMeasurementContainer()).getPropertyValue("--ag-legacy-styles-loaded") && Rt(n ? 106 : 239); 49084 } 49085}, O0 = 15538, Zne = class extends he { 49086 constructor() { 49087 super(...arguments), this.beanName = "eventSvc", this.globalEventService = new ih(); 49088 } 49089 postConstruct() { 49090 const { globalListener: e, globalSyncListener: t } = this.beans; 49091 e && this.addGlobalListener(e, !0), t && this.addGlobalListener(t, !1); 49092 } 49093 addEventListener(e, t, i) { 49094 this.globalEventService.addEventListener(e, t, i); 49095 } 49096 removeEventListener(e, t, i) { 49097 this.globalEventService.removeEventListener(e, t, i); 49098 } 49099 addGlobalListener(e, t = !1) { 49100 this.globalEventService.addGlobalListener(e, t); 49101 } 49102 removeGlobalListener(e, t = !1) { 49103 this.globalEventService.removeGlobalListener(e, t); 49104 } 49105 /** @deprecated DO NOT FIRE LOCAL EVENTS OFF THE EVENT SERVICE */ 49106 dispatchLocalEvent() { 49107 } 49108 dispatchEvent(e) { 49109 this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e)); 49110 } 49111 dispatchEventOnce(e) { 49112 this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e)); 49113 } 49114}; 49115function o_(e) { 49116 return e ? e.getLeafColumns().some((t) => t.isSpanHeaderHeight()) : !1; 49117} 49118function aS(e, t) { 49119 let i; 49120 if (xi(e) && o_(e) && e.isPadding()) { 49121 const s = e; 49122 i = s.getLeafColumns()[0]; 49123 let n = i; 49124 for (; n !== s; ) 49125 t++, n = n.getParent(); 49126 } 49127 return { 49128 column: i || e, 49129 headerRowIndex: t 49130 }; 49131} 49132var qne = class extends he { 49133 constructor() { 49134 super(...arguments), this.beanName = "headerNavigation", this.currentHeaderRowWithoutSpan = -1; 49135 } 49136 postConstruct() { 49137 const e = this.beans; 49138 e.ctrlsSvc.whenReady(this, (i) => { 49139 this.gridBodyCon = i.gridBodyCtrl; 49140 }); 49141 const t = Ei(e); 49142 this.addManagedElementListeners(t, { 49143 mousedown: () => { 49144 this.currentHeaderRowWithoutSpan = -1; 49145 } 49146 }); 49147 } 49148 getHeaderPositionForColumn(e, t) { 49149 let i; 49150 const { colModel: s, colGroupSvc: n, ctrlsSvc: o } = this.beans; 49151 if (typeof e == "string" ? (i = s.getCol(e), i || (i = n?.getColumnGroup(e) ?? null)) : i = e, !i) 49152 return null; 49153 const a = o.getHeaderRowContainerCtrl()?.getAllCtrls(), l = It(a || []).type === "filter", c = Jr(this.beans) - 1; 49154 let u = -1, d = i; 49155 for (; d; ) 49156 u++, d = d.getParent(); 49157 let p = u; 49158 return t && l && p === c - 1 && p++, p === -1 ? null : { 49159 headerRowIndex: p, 49160 column: i 49161 }; 49162 } 49163 /*
49164 * This method navigates grid header vertically 49165 * @return {boolean} true to preventDefault on the event that caused this navigation. 49166 */ 49167 navigateVertically(e, t, i) { 49168 const s = this.beans.focusSvc; 49169 if (t || (t = s.focusedHeader), !t) 49170 return !1; 49171 const { headerRowIndex: n } = t, o = t.column, r = Jr(this.beans), a = e === "UP", l = this.getHeaderRowType(n); 49172 let { 49173 headerRowIndex: c, 49174 column: u, 49175 headerRowIndexWithoutSpan: d 49176 } = a ? Qne(l, o, n) : Xne(l, o, n), p = !1; 49177 return c < 0 && (c = 0, u = o, p = !0), c >= r ? (c = -1, this.currentHeaderRowWithoutSpan = -1) : d !== void 0 && (this.currentHeaderRowWithoutSpan = d), !p && !u ? !1 : s.focusHeaderPosition({ 49178 headerPosition: { headerRowIndex: c, column: u }, 49179 allowUserOverride: !0, 49180 event: i 49181 }); 49182 } 49183 /* 49184 * This method navigates grid header horizontally 49185 * @return {boolean} true to preventDefault on the event that caused this navigation. 49186 */ 49187 navigateHorizontally(e, t = !1, i) { 49188 const { focusSvc: s, gos: n } = this.beans, o = s.focusedHeader; 49189 let r, a; 49190 if (this.currentHeaderRowWithoutSpan !== -1 ? o.headerRowIndex = this.currentHeaderRowWithoutSpan : this.currentHeaderRowWithoutSpan = o.headerRowIndex, e === "LEFT" !== n.get("enableRtl") ? (a = "Before", r = this.findHeader(o, a)) : (a = "After", r = this.findHeader(o, a)), r || !t) 49191 return s.focusHeaderPosition({ 49192 headerPosition: r, 49193 direction: a, 49194 fromTab: t, 49195 allowUserOverride: !0, 49196 event: i 49197 }); 49198 if (t) { 49199 const l = n.getCallback("tabToNextHeader"); 49200 if (l) 49201 return s.focusHeaderPositionFromUserFunc({ 49202 userFunc: l, 49203 headerPosition: r, 49204 direction: a 49205 }); 49206 } 49207 return this.focusNextHeaderRow(o, a, i); 49208 } 49209 focusNextHeaderRow(e, t, i) { 49210 const s = e.headerRowIndex; 49211 let n = null, o; 49212 const r = this.beans; 49213 if (t === "Before" ? s > 0 && (o = s - 1, this.currentHeaderRowWithoutSpan -= 1, n = this.findColAtEdgeForHeaderRow(o, "end")) : (o = s + 1, this.currentHeaderRowWithoutSpan < Jr(r) ? this.currentHeaderRowWithoutSpan += 1 : this.currentHeaderRowWithoutSpan = -1, n = this.findColAtEdgeForHeaderRow(o, "start")), !n) 49214 return !1; 49215 const { column: a, headerRowIndex: l } = aS( 49216 n.column, 49217 n?.headerRowIndex 49218 ); 49219 return r.focusSvc.focusHeaderPosition({ 49220 headerPosition: { column: a, headerRowIndex: l }, 49221 direction: t, 49222 fromTab: !0, 49223 allowUserOverride: !0, 49224 event: i 49225 }); 49226 } 49227 scrollToColumn(e, t = "After") { 49228 if (e.getPinned()) 49229 return; 49230 let i; 49231 if (xi(e)) { 49232 const s = e.getDisplayedLeafColumns(); 49233 i = t === "Before" ? It(s) : s[0]; 49234 } else 49235 i = e; 49236 this.gridBodyCon.scrollFeature.ensureColumnVisible(i); 49237 } 49238 findHeader(e, t) { 49239 let i, s; 49240 const { colGroupSvc: n, visibleCols: o } = this.beans; 49241 if (xi(e.column) ? i = n?.getGroupAtDirection(e.column, t) ?? void 0 : (s = `getCol${t}`, i = o[s](e.column)), !i) 49242 return; 49243 const { headerRowIndex: r } = e; 49244 if (this.getHeaderRowType(r) !== "filter") { 49245 const c = [i]; 49246 for (; i.getParent(); ) 49247 i = i.getParent(), c.push(i); 49248 i = c[Math.max(0, c.length - 1 - r)]; 49249 } 49250 const { column: a, headerRowIndex: l } = aS(i, r); 49251 return { 49252 column: a, 49253 headerRowIndex: l 49254 }; 49255 } 49256 getHeaderRowType(e) { 49257 const t = this.beans.ctrlsSvc.getHeaderRowContainerCtrl(); 49258 if (t) 49259 return t.getRowType(e); 49260 } 49261 findColAtEdgeForHeaderRow(e, t) { 49262 const { visibleCols: i, ctrlsSvc: s, colGroupSvc: n } = this.beans, o = i.allCols, r = o[t === "start" ? 0 : o.length - 1]; 49263 if (!r) 49264 return; 49265 const l = s.getHeaderRowContainerCtrl(r.getPinned())?.getRowType(e); 49266 if (l == "group") { 49267 const c = n?.getColGroupAtLevel(r, e); 49268 return { 49269 headerRowIndex: e, 49270 column: c 49271 }; 49272 } 49273 return { 49274 // if type==null, means the header level didn't exist 49275 headerRowIndex: l == null ? -1 : e, 49276 column: r 49277 }; 49278 } 49279}; 49280function Qne(e, t, i) { 49281 const s = e === "filter", n = e === "column"; 49282 let o = s ? t : t.getParent(), r = i - 1, a = r; 49283 if (n && o_(t.getParent())) { 49284 for (; o && o.isPadding(); ) 49285 o = o.getParent(), r--; 49286 a = r, r < 0 && (o = t, r = i, a = void 0); 49287 } 49288 return { column: o, headerRowIndex: r, headerRowIndexWithoutSpan: a }; 49289} 49290function Xne(e, t, i, s = "After") { 49291 let n = t, o = i + 1; 49292 const r = o; 49293 if (e === "group") { 49294 const a = t.getDisplayedLeafColumns(), l = s === "After" ? a[0] : It(a), c = []; 49295 let u = l; 49296 for (; u.getParent() !== t; ) 49297 u = u.getParent(), c.push(u); 49298 if (n = l, l.isSpanHeaderHeight()) 49299 for (let d = c.length - 1; d >= 0; d--) { 49300 const p = c[d]; 49301 if (!p.isPadding()) { 49302 n = p; 49303 break; 49304 } 49305 o++; 49306 } 49307 else 49308 n = It(c), n || (n = l); 49309 } 49310 return { column: n, headerRowIndex: o, headerRowIndexWithoutSpan: r }; 49311} 49312var Jne = class extends he {
49313 constructor() { 49314 super(...arguments), this.beanName = "focusSvc"; 49315 } 49316 wireBeans(e) { 49317 this.colModel = e.colModel, this.visibleCols = e.visibleCols, this.rowRenderer = e.rowRenderer, this.navigation = e.navigation, this.filterManager = e.filterManager, this.overlays = e.overlays; 49318 } 49319 postConstruct() { 49320 const e = this.clearFocusedCell.bind(this); 49321 this.addManagedEventListeners({ 49322 columnPivotModeChanged: e, 49323 newColumnsLoaded: this.onColumnEverythingChanged.bind(this), 49324 columnGroupOpened: e, 49325 columnRowGroupChanged: e 49326 }), this.addDestroyFunc(WJ(this.beans)); 49327 } 49328 onColumnEverythingChanged() { 49329 if (!this.focusedCell) 49330 return; 49331 const e = this.focusedCell.column, t = this.colModel.getCol(e.getId()); 49332 e !== t && this.clearFocusedCell(); 49333 } 49334 // we check if the browser is focusing something, and if it is, and 49335 // it's the cell we think is focused, then return the cell. so this 49336 // methods returns the cell if a) we think it has focus and b) the 49337 // browser thinks it has focus. this then returns nothing if we 49338 // first focus a cell, then second click outside the grid, as then the 49339 // grid cell will still be focused as far as the grid is concerned, 49340 // however the browser focus will have moved somewhere else. 49341 getFocusCellToUseAfterRefresh() { 49342 return this.gos.get("suppressFocusAfterRefresh") || !this.focusedCell || this.isDomDataMissingInHierarchy(gi(this.beans), Jp) ? null : this.focusedCell; 49343 } 49344 getFocusHeaderToUseAfterRefresh() { 49345 return this.gos.get("suppressFocusAfterRefresh") || !this.focusedHeader || this.isDomDataMissingInHierarchy(gi(this.beans), kN) ? null : this.focusedHeader; 49346 } 49347 isDomDataMissingInHierarchy(e, t) { 49348 let i = e; 49349 for (; i; ) { 49350 if (ov(this.gos, i, t)) 49351 return !1; 49352 i = i.parentNode; 49353 } 49354 return !0; 49355 } 49356 getFocusedCell() { 49357 return this.focusedCell; 49358 } 49359 shouldRestoreFocus(e) { 49360 return this.isCellRestoreFocused(e) ? (setTimeout(() => { 49361 this.restoredFocusedCell = null; 49362 }, 0), !0) : !1; 49363 } 49364 clearRestoreFocus() { 49365 this.restoredFocusedCell = null, this.awaitRestoreFocusedCell = !1; 49366 } 49367 restoreFocusedCell(e, t) { 49368 this.awaitRestoreFocusedCell = !0, setTimeout(() => { 49369 this.awaitRestoreFocusedCell && (this.setRestoreFocusedCell(e), t()); 49370 }); 49371 } 49372 isCellRestoreFocused(e) { 49373 return this.restoredFocusedCell == null ? !1 : Qw(e, this.restoredFocusedCell); 49374 } 49375 setRestoreFocusedCell(e) { 49376 this.beans.frameworkOverrides.renderingEngine === "react" && (this.restoredFocusedCell = e); 49377 } 49378 getFocusEventParams(e) { 49379 const { rowIndex: t, rowPinned: i, column: s } = e, n = { 49380 rowIndex: t, 49381 rowPinned: i, 49382 column: s, 49383 isFullWidthCell: !1 49384 }, o = this.rowRenderer.getRowByPosition({ rowIndex: t, rowPinned: i }); 49385 return o && (n.isFullWidthCell = o.isFullWidth()), n; 49386 } 49387 clearFocusedCell() { 49388 if (this.restoredFocusedCell = null, this.focusedCell == null) 49389 return; 49390 const e = this.getFocusEventParams(this.focusedCell); 49391 this.focusedCell = null, this.eventSvc.dispatchEvent({ 49392 type: "cellFocusCleared", 49393 ...e 49394 }); 49395 } 49396 setFocusedCell(e) { 49397 const { column: t, rowIndex: i, rowPinned: s, forceBrowserFocus: n = !1, preventScrollOnBrowserFocus: o = !1 } = e, r = this.colModel.getCol(t); 49398 if (!r) { 49399 this.focusedCell = null; 49400 return; 49401 } 49402 this.focusedCell = { 49403 rowIndex: i, 49404 rowPinned: oa(s), 49405 column: r 49406 }, this.eventSvc.dispatchEvent({ 49407 type: "cellFocused", 49408 ...this.getFocusEventParams(this.focusedCell), 49409 forceBrowserFocus: n, 49410 preventScrollOnBrowserFocus: o 49411 }); 49412 } 49413 isCellFocused(e) { 49414 return this.focusedCell == null ? !1 : Qw(e, this.focusedCell); 49415 } 49416 isRowNodeFocused(e) { 49417 return this.isRowFocused(e.rowIndex, e.rowPinned); 49418 } 49419 isHeaderWrapperFocused(e) { 49420 if (this.focusedHeader == null) 49421 return !1; 49422 const { 49423 column: t, 49424 rowCtrl: { rowIndex: i, pinned: s } 49425 } = e, { column: n, headerRowIndex: o } = this.focusedHeader; 49426 return t === n && i === o && s == n.getPinned(); 49427 } 49428 focusHeaderPosition(e) { 49429 if (hd(this.beans)) 49430 return !1; 49431 const { direction: t, fromTab: i, allowUserOverride: s, event: n, fromCell: o, rowWithoutSpanValue: r } = e; 49432 let { headerPosition: a } = e; 49433 if (o && this.filterManager?.isAdvFilterHeaderActive()) 49434 return this.focusAdvancedFilter(a); 49435 if (s) {
49436 const l = this.focusedHeader, c = Jr(this.beans); 49437 if (i) { 49438 const u = this.gos.getCallback("tabToNextHeader"); 49439 u && (a = this.getHeaderPositionFromUserFunc({ 49440 userFunc: u, 49441 direction: t, 49442 currentPosition: l, 49443 headerPosition: a, 49444 headerRowCount: c 49445 })); 49446 } else { 49447 const u = this.gos.getCallback("navigateToNextHeader"); 49448 if (u && n) { 49449 const d = { 49450 key: n.key, 49451 previousHeaderPosition: l, 49452 nextHeaderPosition: a, 49453 headerRowCount: c, 49454 event: n 49455 }; 49456 a = u(d); 49457 } 49458 } 49459 } 49460 return a ? this.focusProvidedHeaderPosition({ 49461 headerPosition: a, 49462 direction: t, 49463 event: n, 49464 fromCell: o, 49465 rowWithoutSpanValue: r 49466 }) : !1; 49467 } 49468 focusHeaderPositionFromUserFunc(e) { 49469 if (hd(this.beans)) 49470 return !1; 49471 const { userFunc: t, headerPosition: i, direction: s, event: n } = e, o = this.focusedHeader, r = Jr(this.beans), a = this.getHeaderPositionFromUserFunc({ 49472 userFunc: t, 49473 direction: s, 49474 currentPosition: o, 49475 headerPosition: i, 49476 headerRowCount: r 49477 }); 49478 return !!a && this.focusProvidedHeaderPosition({ 49479 headerPosition: a, 49480 direction: s, 49481 event: n 49482 }); 49483 } 49484 getHeaderPositionFromUserFunc(e) { 49485 const { userFunc: t, direction: i, currentPosition: s, headerPosition: n, headerRowCount: o } = e, a = t({ 49486 backwards: i === "Before", 49487 previousHeaderPosition: s, 49488 nextHeaderPosition: n, 49489 headerRowCount: o 49490 }); 49491 return a === !0 ? s : a === !1 ? null : a; 49492 } 49493 focusProvidedHeaderPosition(e) { 49494 const { headerPosition: t, direction: i, fromCell: s, rowWithoutSpanValue: n, event: o } = e, { column: r, headerRowIndex: a } = t, { filterManager: l, ctrlsSvc: c, headerNavigation: u } = this.beans; 49495 if (a === -1) 49496 return l?.isAdvFilterHeaderActive() ? this.focusAdvancedFilter(t) : this.focusGridView(r); 49497 u?.scrollToColumn(r, i); 49498 const p = c.getHeaderRowContainerCtrl(r.getPinned())?.focusHeader(t.headerRowIndex, r, o) || !1; 49499 return u && p && (n != null || s) && (u.currentHeaderRowWithoutSpan = n ?? -1), p; 49500 } 49501 focusFirstHeader() { 49502 if (this.overlays?.isExclusive() && this.focusOverlay()) 49503 return !0; 49504 let e = this.visibleCols.allCols[0]; 49505 if (!e) 49506 return !1; 49507 const { colGroupSvc: t } = this.beans; 49508 t && e.getParent() && (e = t.getColGroupAtLevel(e, 0)); 49509 const i = aS(e, 0); 49510 return this.focusHeaderPosition({ 49511 headerPosition: i, 49512 rowWithoutSpanValue: 0 49513 }); 49514 } 49515 focusLastHeader(e) { 49516 if (this.overlays?.isExclusive() && this.focusOverlay(!0)) 49517 return !0; 49518 const t = Jr(this.beans) - 1, i = It(this.visibleCols.allCols); 49519 return this.focusHeaderPosition({ 49520 headerPosition: { headerRowIndex: t, column: i }, 49521 rowWithoutSpanValue: -1, 49522 event: e 49523 }); 49524 } 49525 focusPreviousFromFirstCell(e) { 49526 return this.filterManager?.isAdvFilterHeaderActive() ? this.focusAdvancedFilter(null) : this.focusLastHeader(e); 49527 } 49528 isAnyCellFocused() { 49529 return !!this.focusedCell; 49530 } 49531 isRowFocused(e, t) { 49532 return this.focusedCell == null ? !1 : this.focusedCell.rowIndex === e && this.focusedCell.rowPinned === oa(t); 49533 } 49534 focusOverlay(e) { 49535 const t = this.overlays?.isVisible() && this.overlays.eWrapper?.getGui(); 49536 return !!t && Gc(t, e); 49537 } 49538 focusGridView(e, t = !1, i = !0) { 49539 if (this.overlays?.isExclusive()) 49540 return i && this.focusOverlay(t); 49541 if (hN(this.beans)) 49542 return t && !hd(this.beans) ? this.focusLastHeader() : i && this.focusOverlay(t) ? !0 : Id(this.beans, !1); 49543 const s = t ? mee(this.beans) : fee(this.beans); 49544 if (s) { 49545 const { rowIndex: n, rowPinned: o } = s; 49546 if (e ?? (e = this.focusedHeader?.column), e && n !== void 0 && n !== null) 49547 return this.navigation?.ensureCellVisible({ rowIndex: n, column: e, rowPinned: o }), t && this.rowRenderer.getRowByPosition(s)?.isFullWidth() && this.navigation?.tryToFocusFullWidthRow(s, t) || (this.setFocusedCell({ 49548 rowIndex: n, 49549 column: e, 49550 rowPinned: oa(o), 49551 forceBrowserFocus: !0 49552 }), this.beans.rangeSvc?.setRangeToCell({ rowIndex: n, rowPinned: o, column: e })), !0; 49553 } 49554 return !!(i && this.focusOverlay(t) || t && this.focusLastHeader()); 49555 } 49556 focusAdvancedFilter(e) { 49557 return this.advFilterFocusColumn = e?.column, this.beans.advancedFilter?.getCtrl().focusHeaderComp() ?? !1; 49558 } 49559 focusNextFromAdvancedFilter(e, t) { 49560 const i = (t ? void 0 : this.advFilterFocusColumn) ?? this.visibleCols.allCols?.[0]; 49561 return e ? this.focusHeaderPosition({ 49562 headerPosition: { 49563 column: i, 49564 headerRowIndex: Jr(this.beans) - 1 49565 } 49566 }) : this.focusGridView(i); 49567 } 49568 clearAdvancedFilterColumn() { 49569 this.advFilterFocusColumn = void 0; 49570 } 49571}, eoe = class extends he {
49572 constructor() { 49573 super(...arguments), this.beanName = "scrollVisibleSvc"; 49574 } 49575 wireBeans(e) { 49576 this.ctrlsSvc = e.ctrlsSvc, this.colAnimation = e.colAnimation; 49577 } 49578 postConstruct() { 49579 this.getScrollbarWidth(), this.addManagedEventListeners({ 49580 displayedColumnsChanged: this.updateScrollVisible.bind(this), 49581 displayedColumnsWidthChanged: this.updateScrollVisible.bind(this) 49582 }); 49583 } 49584 updateScrollVisible() { 49585 const { colAnimation: e } = this; 49586 e?.isActive() ? e.executeLaterVMTurn(() => { 49587 e.executeLaterVMTurn(() => this.updateScrollVisibleImpl()); 49588 }) : this.updateScrollVisibleImpl(); 49589 } 49590 updateScrollVisibleImpl() { 49591 const e = this.ctrlsSvc.get("center"); 49592 if (!e || this.colAnimation?.isActive()) 49593 return; 49594 const t = { 49595 horizontalScrollShowing: e.isHorizontalScrollShowing(), 49596 verticalScrollShowing: this.verticalScrollShowing 49597 }; 49598 this.setScrollsVisible(t), this.updateScrollGap(); 49599 } 49600 updateScrollGap() { 49601 const e = this.ctrlsSvc.get("center"), t = e.hasHorizontalScrollGap(), i = e.hasVerticalScrollGap(); 49602 (this.horizontalScrollGap !== t || this.verticalScrollGap !== i) && (this.horizontalScrollGap = t, this.verticalScrollGap = i, this.eventSvc.dispatchEvent({ 49603 type: "scrollGapChanged" 49604 })); 49605 } 49606 setScrollsVisible(e) { 49607 (this.horizontalScrollShowing !== e.horizontalScrollShowing || this.verticalScrollShowing !== e.verticalScrollShowing) && (this.horizontalScrollShowing = e.horizontalScrollShowing, this.verticalScrollShowing = e.verticalScrollShowing, this.eventSvc.dispatchEvent({ 49608 type: "scrollVisibilityChanged" 49609 })); 49610 } 49611 // the user might be using some non-standard scrollbar, eg a scrollbar that has zero 49612 // width and overlays (like the Safari scrollbar, but presented in Chrome). so we 49613 // allow the user to provide the scroll width before we work it out. 49614 getScrollbarWidth() { 49615 if (this.scrollbarWidth == null) { 49616 const e = this.gos.get("scrollbarWidth"), i = typeof e == "number" && e >= 0 ? e : OQ(); 49617 i != null && (this.scrollbarWidth = i, this.eventSvc.dispatchEvent({ 49618 type: "scrollbarWidthChanged" 49619 })); 49620 } 49621 return this.scrollbarWidth; 49622 } 49623}, toe = class extends he { 49624 constructor() { 49625 super(...arguments), this.beanName = "gridDestroySvc", this.destroyCalled = !1; 49626 } 49627 destroy() { 49628 if (this.destroyCalled) 49629 return; 49630 const { stateSvc: e, ctrlsSvc: t, context: i } = this.beans; 49631 this.eventSvc.dispatchEvent({ 49632 type: "gridPreDestroyed", 49633 state: e?.getState() ?? {} 49634 }), this.destroyCalled = !0, t.get("gridCtrl")?.destroyGridUi(), i.destroy(), super.destroy(); 49635 } 49636}, fp = /* @__PURE__ */ new Set(["gridPreDestroyed", "fillStart", "pasteStart"]), ioe = { 49637 suppressContextMenu: !1, 49638 preventDefaultOnContextMenu: !1, 49639 allowContextMenuWithControlKey: !1, 49640 suppressMenuHide: !0, 49641 enableBrowserTooltips: !1, 49642 tooltipTrigger: "hover", 49643 tooltipShowDelay: 2e3, 49644 tooltipHideDelay: 1e4, 49645 tooltipMouseTrack: !1, 49646 tooltipShowMode: "standard", 49647 tooltipInteraction: !1, 49648 copyHeadersToClipboard: !1, 49649 copyGroupHeadersToClipboard: !1, 49650 clipboardDelimiter: " ", 49651 suppressCopyRowsToClipboard: !1, 49652 suppressCopySingleCellRanges: !1, 49653 suppressLastEmptyLineOnPaste: !1, 49654 suppressClipboardPaste: !1, 49655 suppressClipboardApi: !1, 49656 suppressCutToClipboard: !1, 49657 maintainColumnOrder: !1, 49658 enableStrictPivotColumnOrder: !1, 49659 suppressFieldDotNotation: !1, 49660 allowDragFromColumnsToolPanel: !1, 49661 suppressMovableColumns: !1, 49662 suppressColumnMoveAnimation: !1, 49663 suppressMoveWhenColumnDragging: !1, 49664 suppressDragLeaveHidesColumns: !1, 49665 suppressRowGroupHidesColumns: !1, 49666 suppressAutoSize: !1, 49667 autoSizePadding: 20, 49668 skipHeaderOnAutoSize: !1, 49669 singleClickEdit: !1, 49670 suppressClickEdit: !1, 49671 readOnlyEdit: !1, 49672 stopEditingWhenCellsLoseFocus: !1, 49673 enterNavigatesVertically: !1, 49674 enterNavigatesVerticallyAfterEdit: !1, 49675 enableCellEditingOnBackspace: !1, 49676 undoRedoCellEditing: !1, 49677 undoRedoCellEditingLimit: 10, 49678 suppressCsvExport: !1, 49679 suppressExcelExport: !1, 49680 cacheQuickFilter: !1, 49681 includeHiddenColumnsInQuickFilter: !1, 49682 excludeChildrenWhenTreeDataFiltering: !1, 49683 enableAdvancedFilter: !1, 49684 includeHiddenColumnsInAdvancedFilter: !1, 49685 enableCharts: !1, 49686 masterDetail: !1, 49687 keepDetailRows: !1, 49688 keepDetailRowsCount: 10, 49689 detailRowAutoHeight: !1, 49690 tabIndex: 0, 49691 rowBuffer: 10, 49692 valueCache: !1, 49693 valueCacheNeverExpires: !1, 49694 enableCellExpressions: !1, 49695 suppressTouch: !1, 49696 suppressFocusAfterRefresh: !1, 49697 suppressBrowserResizeObserver: !1, 49698 suppressPropertyNamesCheck: !1, 49699 suppressChangeDetection: !1, 49700 debug: !1, 49701 suppressLoadingOverlay: !1, 49702 suppressNoRowsOverlay: !1, 49703 pagination: !1, 49704 paginationPageSize: 100, 49705 paginationPageSizeSelector: !0, 49706 paginationAutoPageSize: !1, 49707 paginateChildRows: !1, 49708 suppressPaginationPanel: !1, 49709 pivotMode: !1, 49710 pivotPanelShow: "never", 49711 pivotDefaultExpanded: 0, 49712 pivotSuppressAutoColumn: !1, 49713 suppressExpandablePivotGroups: !1, 49714 functionsReadOnly: !1, 49715 suppressAggFuncInHeader: !1, 49716 alwaysAggregateAtRootLevel: !1, 49717 aggregateOnlyChangedColumns: !1, 49718 suppressAggFilteredOnly: !1, 49719 removePivotHeaderRowWhenSingleValueColumn: !1, 49720 animateRows: !0,
49721 cellFlashDuration: 500, 49722 cellFadeDuration: 1e3, 49723 allowShowChangeAfterFilter: !1, 49724 domLayout: "normal", 49725 ensureDomOrder: !1, 49726 enableRtl: !1, 49727 suppressColumnVirtualisation: !1, 49728 suppressMaxRenderedRowRestriction: !1, 49729 suppressRowVirtualisation: !1, 49730 rowDragManaged: !1, 49731 suppressRowDrag: !1, 49732 suppressMoveWhenRowDragging: !1, 49733 rowDragEntireRow: !1, 49734 rowDragMultiRow: !1, 49735 embedFullWidthRows: !1, 49736 groupDisplayType: "singleColumn", 49737 groupDefaultExpanded: 0, 49738 groupMaintainOrder: !1, 49739 groupSelectsChildren: !1, 49740 groupSuppressBlankHeader: !1, 49741 groupSelectsFiltered: !1, 49742 showOpenedGroup: !1, 49743 groupRemoveSingleChildren: !1, 49744 groupRemoveLowestSingleChildren: !1, 49745 groupHideOpenParents: !1, 49746 groupAllowUnbalanced: !1, 49747 rowGroupPanelShow: "never", 49748 suppressMakeColumnVisibleAfterUnGroup: !1, 49749 treeData: !1, 49750 rowGroupPanelSuppressSort: !1, 49751 suppressGroupRowsSticky: !1, 49752 rowModelType: "clientSide", 49753 asyncTransactionWaitMillis: 50, 49754 suppressModelUpdateAfterUpdateTransaction: !1, 49755 cacheOverflowSize: 1, 49756 infiniteInitialRowCount: 1, 49757 serverSideInitialRowCount: 1, 49758 cacheBlockSize: 100, 49759 maxBlocksInCache: -1, 49760 maxConcurrentDatasourceRequests: 2, 49761 blockLoadDebounceMillis: 0, 49762 purgeClosedRowNodes: !1, 49763 serverSideSortAllLevels: !1, 49764 serverSideOnlyRefreshFilteredGroups: !1, 49765 serverSidePivotResultFieldSeparator: "_", 49766 viewportRowModelPageSize: 5, 49767 viewportRowModelBufferSize: 5, 49768 alwaysShowHorizontalScroll: !1, 49769 alwaysShowVerticalScroll: !1, 49770 debounceVerticalScrollbar: !1, 49771 suppressHorizontalScroll: !1, 49772 suppressScrollOnNewData: !1, 49773 suppressScrollWhenPopupsAreOpen: !1, 49774 suppressAnimationFrame: !1, 49775 suppressMiddleClickScrolls: !1, 49776 suppressPreventDefaultOnMouseWheel: !1, 49777 rowMultiSelectWithClick: !1, 49778 suppressRowDeselection: !1, 49779 suppressRowClickSelection: !1, 49780 suppressCellFocus: !1, 49781 suppressHeaderFocus: !1, 49782 suppressMultiRangeSelection: !1, 49783 enableCellTextSelection: !1, 49784 enableRangeSelection: !1, 49785 enableRangeHandle: !1, 49786 enableFillHandle: !1, 49787 fillHandleDirection: "xy", 49788 suppressClearOnFillReduction: !1, 49789 accentedSort: !1, 49790 unSortIcon: !1, 49791 suppressMultiSort: !1, 49792 alwaysMultiSort: !1, 49793 suppressMaintainUnsortedOrder: !1, 49794 suppressRowHoverHighlight: !1, 49795 suppressRowTransform: !1, 49796 columnHoverHighlight: !1, 49797 deltaSort: !1, 49798 enableGroupEdit: !1, 49799 groupLockGroupColumns: 0, 49800 serverSideEnableClientSideSort: !1, 49801 suppressServerSideFullWidthLoadingRow: !1, 49802 pivotMaxGeneratedColumns: -1, 49803 columnMenu: "new", 49804 reactiveCustomComponents: !0, 49805 suppressSetFilterByDefault: !1 49806}, soe = 0, noe = 0, ooe = class extends he { 49807 constructor() { 49808 super(...arguments), this.beanName = "gos", this.domDataKey = "__AG_" + Math.random().toString(), this.gridInstanceId = noe++, this.propEventSvc = new ih(), this.globalEventHandlerFactory = (e) => (t, i) => { 49809 if (!this.isAlive()) 49810 return; 49811 const s = fp.has(t); 49812 if (s && !e || !s && e) 49813 return; 49814 const n = oM(t), o = this.gridOptions[n]; 49815 typeof o == "function" && this.beans.frameworkOverrides.wrapOutgoing(() => { 49816 o(i); 49817 }); 49818 }; 49819 } 49820 wireBeans(e) { 49821 this.gridOptions = e.gridOptions, this.validation = e.validation, this.api = e.gridApi, this.gridId = e.context.getGridId(); 49822 } 49823 // This is quicker then having code call gridOptionsService.get('context') 49824 get gridOptionsContext() { 49825 return this.gridOptions.context; 49826 } 49827 postConstruct() { 49828 this.eventSvc.addGlobalListener(this.globalEventHandlerFactory().bind(this), !0), this.eventSvc.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this), !1), this.propEventSvc.setFrameworkOverrides(this.beans.frameworkOverrides), this.addManagedEventListeners({ 49829 gridOptionsChanged: ({ options: e }) => { 49830 this.updateGridOptions({ options: e, force: !0, source: "gridOptionsUpdated" }); 49831 } 49832 }); 49833 } 49834 /** 49835 * Get the raw value of the GridOptions property provided. 49836 * @param property 49837 */ 49838 get(e) { 49839 return this.gridOptions[e] ?? ioe[e]; 49840 } 49841 /** 49842 * Get the GridOption callback but wrapped so that the common params of api and context are automatically applied to the params. 49843 * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon 49844 */ 49845 getCallback(e) { 49846 return this.mergeGridCommonParams(this.gridOptions[e]); 49847 } 49848 /** 49849 * Returns `true` if a value has been specified for this GridOption. 49850 * @param property GridOption property 49851 */ 49852 exists(e) { 49853 return Ie(this.gridOptions[e]); 49854 } 49855 /** 49856 * Wrap the user callback and attach the api and context to the params object on the way through. 49857 * @param callback User provided callback 49858 * @returns Wrapped callback where the params object not require api and context 49859 */ 49860 mergeGridCommonParams(e) { 49861 return e && ((i) => e(this.addGridCommonParams(i))); 49862 } 49863 updateGridOptions({ 49864 options: e, 49865 force: t, 49866 source: i = "api" 49867 }) { 49868 const s = { id: soe++, properties: [] }, n = [], { gridOptions: o, validation: r } = this;
49869 Object.entries(e).forEach(([a, l]) => { 49870 r?.warnOnInitialPropertyUpdate(i, a); 49871 const c = t || typeof l == "object" && i === "api", u = o[a]; 49872 if (c || u !== l) { 49873 o[a] = l; 49874 const d = { 49875 type: a, 49876 currentValue: l, 49877 previousValue: u, 49878 changeSet: s, 49879 source: i 49880 }; 49881 n.push(d); 49882 } 49883 }), r?.processGridOptions(this.gridOptions), s.properties = n.map((a) => a.type), n.forEach((a) => { 49884 Ml(this, `Updated property ${a.type} from`, a.previousValue, " to ", a.currentValue), this.propEventSvc.dispatchEvent(a); 49885 }); 49886 } 49887 addPropertyEventListener(e, t) { 49888 this.propEventSvc.addEventListener(e, t); 49889 } 49890 removePropertyEventListener(e, t) { 49891 this.propEventSvc.removeEventListener(e, t); 49892 } 49893 getDomDataKey() { 49894 return this.domDataKey; 49895 } 49896 getGridCommonParams() { 49897 return { 49898 api: this.api, 49899 context: this.gridOptionsContext 49900 }; 49901 } 49902 addGridCommonParams(e) { 49903 const t = e; 49904 return t.api = this.api, t.context = this.gridOptionsContext, t; 49905 } 49906 assertModuleRegistered(e, t) { 49907 const i = Array.isArray(e) ? e.some((s) => this.isModuleRegistered(s)) : this.isModuleRegistered(e); 49908 return i || Rt(200, { 49909 ...this.getModuleErrorParams(), 49910 moduleName: e, 49911 reasonOrId: t 49912 }), i; 49913 } 49914 getModuleErrorParams() { 49915 return { 49916 gridId: this.gridId, 49917 gridScoped: cM(), 49918 rowModelType: this.get("rowModelType") 49919 }; 49920 } 49921 isModuleRegistered(e) { 49922 return lN(e, this.gridId, this.get("rowModelType")); 49923 } 49924}; 49925function roe(e) { 49926 return ( 49927 /* html */ 49928 `<div class="ag-cell-label-container" role="presentation"> 49929 <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span> 49930 <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span> 49931 <div data-ref="eLabel" class="ag-header-cell-label" role="presentation"> 49932 <span data-ref="eText" class="ag-header-cell-text"></span> 49933 <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span> 49934 ${e ? '<ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>' : ""} 49935 </div> 49936 </div>` 49937 ); 49938} 49939var aoe = class extends Tt { 49940 constructor() { 49941 super(...arguments), this.eFilter = Pe, this.eFilterButton = Pe, this.eSortIndicator = Pe, this.eMenu = Pe, this.eLabel = Pe, this.eText = Pe, this.eSortOrder = Pe, this.eSortAsc = Pe, this.eSortDesc = Pe, this.eSortMixed = Pe, this.eSortNone = Pe, this.isLoadingInnerComponent = !1; 49942 } 49943 refresh(e) { 49944 const t = this.params; 49945 return this.params = e, this.workOutTemplate() != this.currentTemplate || this.workOutShowMenu() != this.currentShowMenu || e.enableSorting != this.currentSort || this.currentSuppressMenuHide != null && this.shouldSuppressMenuHide() != this.currentSuppressMenuHide || t.enableFilterButton != e.enableFilterButton || t.enableFilterIcon != e.enableFilterIcon ? !1 : (this.setDisplayName(e), !0); 49946 } 49947 workOutTemplate() { 49948 const { params: e, beans: t } = this, i = e.template ?? roe(!!t.sortSvc); 49949 return i?.trim ? i.trim() : i; 49950 } 49951 init(e) { 49952 this.params = e; 49953 const { sortSvc: t, touchSvc: i, userCompFactory: s } = this.beans; 49954 this.currentTemplate = this.workOutTemplate(), this.setTemplate(this.currentTemplate, t ? [t.getSortIndicatorSelector()] : void 0), i?.setupForHeader(this), this.setMenu(), this.setupSort(), this.setupFilterIcon(), this.setupFilterButton(), this.workOutInnerHeaderComponent(s, e), this.setDisplayName(e); 49955 } 49956 workOutInnerHeaderComponent(e, t) { 49957 const i = pJ(e, t, t); 49958 i && (this.isLoadingInnerComponent = !0, i.newAgStackInstance().then((s) => { 49959 this.isLoadingInnerComponent = !1, s && (this.isAlive() ? (this.innerHeaderComponent = s, this.eText.appendChild(s.getGui())) : this.destroyBean(s)); 49960 })); 49961 } 49962 setDisplayName(e) { 49963 const { displayName: t } = e, i = this.currentDisplayName; 49964 if (this.currentDisplayName = t, i === t || this.innerHeaderComponent || this.isLoadingInnerComponent) 49965 return; 49966 const s = yr(t, !0); 49967 this.eText.textContent = s; 49968 } 49969 addInIcon(e, t, i) { 49970 if (t == null) 49971 return; 49972 const s = po(e, this.beans, i); 49973 s && t.appendChild(s); 49974 } 49975 workOutShowMenu() { 49976 return this.params.enableMenu && !!this.beans.menuSvc?.isHeaderMenuButtonEnabled(); 49977 } 49978 shouldSuppressMenuHide() { 49979 return !!this.beans.menuSvc?.isHeaderMenuButtonAlwaysShowEnabled(); 49980 } 49981 setMenu() { 49982 if (!this.eMenu) 49983 return; 49984 if (this.currentShowMenu = this.workOutShowMenu(), !this.currentShowMenu) { 49985 pr(this.eMenu), this.eMenu = void 0; 49986 return; 49987 } 49988 const { gos: e, eMenu: t, params: i } = this, s = _n(e); 49989 this.addInIcon(s ? "menu" : "menuAlt", t, i.column), t.classList.toggle("ag-header-menu-icon", !s); 49990 const n = this.shouldSuppressMenuHide(); 49991 this.currentSuppressMenuHide = n, this.addManagedElementListeners(t, { click: () => i.showColumnMenu(t) }), t.classList.toggle("ag-header-menu-always-show", n); 49992 } 49993 onMenuKeyboardShortcut(e) { 49994 const { params: t, gos: i, beans: s, eMenu: n, eFilterButton: o } = this, r = t.column, a = _n(i); 49995 if (e && !a) { 49996 if (s.menuSvc?.isFilterMenuInHeaderEnabled(r)) 49997 return t.showFilter(o ?? n ?? this.getGui()), !0; 49998 } else if (t.enableMenu) 49999 return t.showColumnMenu(n ?? o ?? this.getGui()), !0; 50000 return !1; 50001 } 50002 setupSort() { 50003 const { sortSvc: e } = this.beans; 50004 if (!e) 50005 return; 50006 const { enableSorting: t, column: i } = this.params; 50007 if (this.currentSort = t, !this.eSortIndicator) { 50008 this.eSortIndicator = this.createBean(e.createSortIndicator(!0)); 50009 const { eSortIndicator: s, eSortOrder: n, eSortAsc: o, eSortDe
50009sc: r, eSortMixed: a, eSortNone: l } = this; 50010 s.attachCustomElements(n, o, r, a, l); 50011 } 50012 this.eSortIndicator.setupSort(i), this.currentSort && e.setupHeader(this, i, this.eLabel); 50013 } 50014 setupFilterIcon() { 50015 const { eFilter: e, params: t } = this; 50016 e && this.configureFilter(t.enableFilterIcon, e, this.onFilterChangedIcon.bind(this), "filterActive"); 50017 } 50018 setupFilterButton() { 50019 const { eFilterButton: e, params: t } = this; 50020 if (!e) 50021 return; 50022 this.configureFilter( 50023 t.enableFilterButton, 50024 e, 50025 this.onFilterChangedButton.bind(this), 50026 "filter" 50027 ) ? this.addManagedElementListeners(e, { 50028 click: () => t.showFilter(e) 50029 }) : this.eFilterButton = void 0; 50030 } 50031 configureFilter(e, t, i, s) { 50032 if (!e) 50033 return pr(t), !1; 50034 const n = this.params.column; 50035 return this.addInIcon(s, t, n), this.addManagedListeners(n, { filterChanged: i }), i(), !0; 50036 } 50037 onFilterChangedIcon() { 50038 const e = this.params.column.isFilterActive(); 50039 ui(this.eFilter, e, { skipAriaHidden: !0 }); 50040 } 50041 onFilterChangedButton() { 50042 const e = this.params.column.isFilterActive(); 50043 this.eFilterButton.classList.toggle("ag-filter-active", e); 50044 } 50045 getAnchorElementForMenu(e) { 50046 const { eFilterButton: t, eMenu: i } = this; 50047 return e ? t ?? i ?? this.getGui() : i ?? t ?? this.getGui(); 50048 } 50049 destroy() { 50050 super.destroy(), this.innerHeaderComponent && (this.destroyBean(this.innerHeaderComponent), this.innerHeaderComponent = void 0); 50051 } 50052}, loe = class extends Tt { 50053 constructor() { 50054 super( 50055 /* html */ 50056 `<div class="ag-header-group-cell-label" role="presentation"> 50057 <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span> 50058 <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span> 50059 <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span> 50060 </div>` 50061 ), this.agOpened = Pe, this.agClosed = Pe, this.agLabel = Pe, this.isLoadingInnerComponent = !1; 50062 } 50063 init(e) { 50064 const { userCompFactory: t } = this.beans; 50065 this.params = e, this.checkWarnings(), this.workOutInnerHeaderGroupComponent(t, e), this.setupLabel(e), this.addGroupExpandIcon(e), this.setupExpandIcons(); 50066 } 50067 checkWarnings() { 50068 this.params.template && Ae(89); 50069 } 50070 workOutInnerHeaderGroupComponent(e, t) { 50071 const i = fJ(e, t, t); 50072 i && (this.isLoadingInnerComponent = !0, i.newAgStackInstance().then((s) => { 50073 this.isLoadingInnerComponent = !1, s && (this.isAlive() ? (this.innerHeaderGroupComponent = s, this.agLabel.appendChild(s.getGui())) : this.destroyBean(s)); 50074 })); 50075 } 50076 setupExpandIcons() { 50077 const { 50078 agOpened: e, 50079 agClosed: t, 50080 params: { columnGroup: i }, 50081 beans: s 50082 } = this; 50083 this.addInIcon("columnGroupOpened", e), this.addInIcon("columnGroupClosed", t); 50084 const n = (l) => { 50085 if (ra(l)) 50086 return; 50087 const c = !i.isExpanded(); 50088 s.colGroupSvc.setColumnGroupOpened( 50089 i.getProvidedColumnGroup(), 50090 c, 50091 "uiColumnExpanded" 50092 ); 50093 }; 50094 this.addTouchAndClickListeners(s, t, n), this.addTouchAndClickListeners(s, e, n); 50095 const o = (l) => { 50096 Dd(l); 50097 }; 50098 this.addManagedElementListeners(t, { dblclick: o }), this.addManagedElementListeners(e, { dblclick: o }), this.addManagedElementListeners(this.getGui(), { dblclick: n }), this.updateIconVisibility(); 50099 const r = i.getProvidedColumnGroup(), a = this.updateIconVisibility.bind(this); 50100 this.addManagedListeners(r, { 50101 expandedChanged: a, 50102 expandableChanged: a 50103 }); 50104 } 50105 addTouchAndClickListeners(e, t, i) { 50106 e.touchSvc?.setupForHeaderGroup(this, t, i), this.addManagedElementListeners(t, { click: i }); 50107 } 50108 updateIconVisibility() { 50109 const { 50110 agOpened: e, 50111 agClosed: t, 50112 params: { columnGroup: i } 50113 } = this; 50114 if (i.isExpandable()) { 50115 const s = i.isExpanded(); 50116 ui(e, s), ui(t, !s); 50117 } else 50118 ui(e, !1), ui(t, !1); 50119 } 50120 addInIcon(e, t) { 50121 const i = po(e, this.beans, null); 50122 i && t.appendChild(i); 50123 } 50124 addGroupExpandIcon(e) { 50125 if (!e.columnGroup.isExpandable()) { 50126 const { agOpened: t, agClosed: i } = this; 50127 ui(t, !1), ui(i, !1); 50128 return; 50129 } 50130 } 50131 setupLabel(e) { 50132 const { displayName: t, columnGroup: i } = e, s = this.innerHeaderGroupComponent || this.isLoadingInnerComponent; 50133 if (Ie(t) && !s) { 50134 const n = yr(t, !0); 50135 this.agLabel.textContent = n; 50136 } 50137 this.addOrRemoveCssClass("ag-sticky-label", !i.getColGroupDef()?.suppressStickyLabel); 50138 } 50139 destroy() { 50140 super.destroy(), this.innerHeaderGroupComponent && (this.destroyBean(this.innerHeaderGroupComponent), this.innerHeaderGroupComponent = void 0); 50141 } 50142}, coe = { 50143 moduleName: "ColumnHeaderComp", 50144 version: Fe, 50145 userComponents: { 50146 agColumnHeader: aoe 50147 }, 50148 icons: { 50149 // button to launch legacy column menu 50150 menu: "menu", 50151 // button to launch new enterprise column menu 50152 menuAlt: "menu-alt" 50153 } 50154}, uoe = { 50155 moduleName: "ColumnGroupHeaderComp", 50156 version: Fe, 50157 userComponents: { 50158 agColumnGroupHeader: loe 50159 }, 50160 icons: { 50161 // header column group shown when expanded (click to contract) 50162 columnGroupOpened: "expanded", 50163 // header column group shown when contracted (click to expand) 50164 columnGroupClosed: "contracted" 50165 } 50166}, doe = { 50167 moduleName: "AnimationFrame", 50168 version: Fe, 50169 beans: [HJ] 50170}, hoe = class extends he {
50171 constructor() { 50172 super(...arguments), this.beanName = "touchSvc"; 50173 } 50174 mockBodyContextMenu(e, t) { 50175 this.mockContextMenu(e, e.eBodyViewport, t); 50176 } 50177 mockHeaderContextMenu(e, t) { 50178 this.mockContextMenu(e, e.eGui, t); 50179 } 50180 mockRowContextMenu(e) { 50181 if (!Mc()) 50182 return; 50183 const t = (i, s, n) => { 50184 const { rowCtrl: o, cellCtrl: r } = e.getControlsForEventTarget(n?.target ?? null); 50185 r?.column && r.dispatchCellContextMenuEvent(n ?? null), this.beans.contextMenuSvc?.handleContextMenuMouseEvent(void 0, n, o, r); 50186 }; 50187 this.mockContextMenu(e, e.element, t); 50188 } 50189 handleCellDoubleClick(e, t) { 50190 return (() => { 50191 if (!Mc() || zO("dblclick")) 50192 return !1; 50193 const s = (/* @__PURE__ */ new Date()).getTime(), n = s - e.lastIPadMouseClickEvent < 200; 50194 return e.lastIPadMouseClickEvent = s, n; 50195 })() ? (e.onCellDoubleClicked(t), t.preventDefault(), !0) : !1; 50196 } 50197 setupForHeader(e) { 50198 const { gos: t, sortSvc: i } = this.beans; 50199 if (t.get("suppressTouch")) 50200 return; 50201 const { params: s, eMenu: n, eFilterButton: o } = e, r = new Bu(e.getGui(), !0), a = e.shouldSuppressMenuHide(), l = a && Ie(n), c = l ? new Bu(n, !0) : r; 50202 if (s.enableMenu) { 50203 const u = l ? "tap" : "longTap", d = (p) => s.showColumnMenuAfterMouseClick(p.touchStart); 50204 e.addManagedListeners(c, { [u]: d }); 50205 } 50206 if (s.enableSorting) { 50207 const u = (d) => { 50208 const p = d.touchStart.target; 50209 a && (n?.contains(p) || o?.contains(p)) || i?.progressSort(s.column, !1, "uiColumnSorted"); 50210 }; 50211 e.addManagedListeners(r, { tap: u }); 50212 } 50213 if (s.enableFilterButton && o) { 50214 const u = new Bu(o, !0); 50215 e.addManagedListeners(u, { 50216 tap: () => s.showFilter(o) 50217 }), e.addDestroyFunc(() => u.destroy()); 50218 } 50219 e.addDestroyFunc(() => r.destroy()), l && e.addDestroyFunc(() => c.destroy()); 50220 } 50221 setupForHeaderGroup(e, t, i) { 50222 const s = new Bu(t, !0); 50223 e.addManagedListeners(s, { tap: i }), e.addDestroyFunc(() => s.destroy()); 50224 } 50225 mockContextMenu(e, t, i) { 50226 if (!Mc()) 50227 return; 50228 const s = new Bu(t), n = (o) => { 50229 i(void 0, o.touchStart, o.touchEvent); 50230 }; 50231 e.addManagedListeners(s, { longTap: n }), e.addDestroyFunc(() => s.destroy()); 50232 } 50233}, poe = { 50234 moduleName: "Touch", 50235 version: Fe, 50236 beans: [hoe] 50237}, goe = class extends he { 50238 constructor() { 50239 super(...arguments), this.beanName = "cellNavigation"; 50240 } 50241 // returns null if no cell to focus on, ie at the end of the grid 50242 getNextCellToFocus(e, t, i = !1) { 50243 return i ? this.getNextCellToFocusWithCtrlPressed(e, t) : this.getNextCellToFocusWithoutCtrlPressed(e, t); 50244 } 50245 getNextCellToFocusWithCtrlPressed(e, t) { 50246 const i = e === de.UP, s = e === de.DOWN, n = e === de.LEFT; 50247 let o, r; 50248 const { pageBounds: a, gos: l, visibleCols: c } = this.beans; 50249 if (i || s) 50250 r = i ? a.getFirstRow() : a.getLastRow(), o = t.column; 50251 else { 50252 const u = c.allCols, d = l.get("enableRtl"); 50253 r = t.rowIndex, o = n !== d ? u[0] : It(u); 50254 } 50255 return { 50256 rowIndex: r, 50257 rowPinned: null, 50258 column: o 50259 }; 50260 } 50261 getNextCellToFocusWithoutCtrlPressed(e, t) { 50262 let i = t, s = !1; 50263 for (; !s; ) { 50264 switch (e) { 50265 case de.UP: 50266 i = this.getCellAbove(i); 50267 break; 50268 case de.DOWN: 50269 i = this.getCellBelow(i); 50270 break; 50271 case de.RIGHT: 50272 i = this.gos.get("enableRtl") ? this.getCellToLeft(i) : this.getCellToRight(i); 50273 break; 50274 case de.LEFT: 50275 i = this.gos.get("enableRtl") ? this.getCellToRight(i) : this.getCellToLeft(i); 50276 break; 50277 default: 50278 i = null, Ae(8, { key: e }); 50279 break; 50280 } 50281 i ? s = this.isCellGoodToFocusOn(i) : s = !0; 50282 } 50283 return i; 50284 } 50285 isCellGoodToFocusOn(e) { 50286 const t = e.column; 50287 let i; 50288 const { pinnedRowModel: s, rowModel: n } = this.beans; 50289 switch (e.rowPinned) { 50290 case "top": 50291 i = s?.getPinnedTopRow(e.rowIndex); 50292 break; 50293 case "bottom": 50294 i = s?.getPinnedBottomRow(e.rowIndex); 50295 break; 50296 default: 50297 i = n.getRow(e.rowIndex); 50298 break; 50299 } 50300 return i ? !this.isSuppressNavigable(t, i) : !1; 50301 } 50302 getCellToLeft(e) { 50303 if (!e) 50304 return null; 50305 const t = this.beans.visibleCols.getColBefore(e.column); 50306 return t ? { 50307 rowIndex: e.rowIndex, 50308 column: t, 50309 rowPinned: e.rowPinned 50310 } : null; 50311 } 50312 getCellToRight(e) { 50313 if (!e) 50314 return null; 50315 const t = this.beans.visibleCols.getColAfter(e.column); 50316 return t ? { 50317 rowIndex: e.rowIndex, 50318 column: t, 50319 rowPinned: e.rowPinned 50320 } : null; 50321 } 50322 getRowBelow(e) { 50323 const t = e.rowIndex, i = e.rowPinned; 50324 let s = !1; 50325 const { pageBounds: n, pinnedRowModel: o, rowModel: r }
50325 = this.beans; 50326 if (this.isLastRowInContainer(e)) 50327 switch (i) { 50328 case "bottom": 50329 return null; 50330 case "top": 50331 return r.isRowsToRender() ? { rowIndex: n.getFirstRow(), rowPinned: null } : o?.isRowsToRender("bottom") ? { rowIndex: 0, rowPinned: "bottom" } : null; 50332 default: 50333 return o?.isRowsToRender("bottom") ? { rowIndex: 0, rowPinned: "bottom" } : null; 50334 } 50335 else i && (s = !0); 50336 const a = r.getRow(e.rowIndex), l = s ? void 0 : this.getNextStickyPosition(a); 50337 return l || { rowIndex: t + 1, rowPinned: i }; 50338 } 50339 getNextStickyPosition(e, t) { 50340 const { gos: i, rowRenderer: s } = this.beans; 50341 if (!NO(i) || !e || !e.sticky) 50342 return; 50343 const n = s.getStickyTopRowCtrls().some((c) => c.rowNode.rowIndex === e.rowIndex); 50344 let o = []; 50345 n ? o = [...s.getStickyTopRowCtrls()].sort( 50346 (c, u) => c.rowNode.rowIndex - u.rowNode.rowIndex 50347 ) : o = [...s.getStickyBottomRowCtrls()].sort( 50348 (c, u) => u.rowNode.rowIndex - c.rowNode.rowIndex 50349 ); 50350 const r = t ? -1 : 1, a = o.findIndex((c) => c.rowNode.rowIndex === e.rowIndex), l = o[a + r]; 50351 if (l) 50352 return { rowIndex: l.rowNode.rowIndex, rowPinned: null }; 50353 } 50354 getCellBelow(e) { 50355 if (!e) 50356 return null; 50357 const t = this.getRowBelow(e); 50358 return t ? { 50359 rowIndex: t.rowIndex, 50360 column: e.column, 50361 rowPinned: t.rowPinned 50362 } : null; 50363 } 50364 isLastRowInContainer(e) { 50365 const t = e.rowPinned, i = e.rowIndex, { pinnedRowModel: s, pageBounds: n } = this.beans; 50366 return t === "top" ? (s?.getPinnedTopRowCount() ?? -1) <= i : t === "bottom" ? (s?.getPinnedBottomRowCount() ?? -1) <= i : n.getLastRow() <= i; 50367 } 50368 getRowAbove(e) { 50369 const t = e.rowIndex, i = e.rowPinned, { pageBounds: s, pinnedRowModel: n, rowModel: o } = this.beans, r = i ? t === 0 : t === s.getFirstRow(); 50370 let a = !1; 50371 const l = () => ({ rowIndex: n?.getPinnedTopRowCount() ?? -1, rowPinned: "top" }); 50372 if (r) 50373 return i === "top" ? null : i && o.isRowsToRender() ? { rowIndex: s.getLastRow(), rowPinned: null } : n?.isRowsToRender("top") ? l() : null; 50374 i && (a = !0); 50375 const c = o.getRow(e.rowIndex), u = a ? void 0 : this.getNextStickyPosition(c, !0); 50376 return u || { rowIndex: t - 1, rowPinned: i }; 50377 } 50378 getCellAbove(e) { 50379 if (!e) 50380 return null; 50381 const t = this.getRowAbove({ rowIndex: e.rowIndex, rowPinned: e.rowPinned }); 50382 return t ? { 50383 rowIndex: t.rowIndex, 50384 column: e.column, 50385 rowPinned: t.rowPinned 50386 } : null; 50387 } 50388 getNextTabbedCell(e, t) { 50389 return t ? this.getNextTabbedCellBackwards(e) : this.getNextTabbedCellForwards(e); 50390 } 50391 getNextTabbedCellForwards(e) { 50392 const { visibleCols: t, pagination: i } = this.beans, s = t.allCols; 50393 let n = e.rowIndex, o = e.rowPinned, r = t.getColAfter(e.column); 50394 if (!r) { 50395 r = s[0]; 50396 const a = this.getRowBelow(e); 50397 if (ai(a) || !a.rowPinned && !(i?.isRowInPage(a) ?? !0)) 50398 return null; 50399 n = a ? a.rowIndex : null, o = a ? a.rowPinned : null; 50400 } 50401 return { rowIndex: n, column: r, rowPinned: o }; 50402 } 50403 getNextTabbedCellBackwards(e) { 50404 const { visibleCols: t, pagination: i } = this.beans, s = t.allCols; 50405 let n = e.rowIndex, o = e.rowPinned, r = t.getColBefore(e.column); 50406 if (!r) { 50407 r = It(s); 50408 const a = this.getRowAbove({ rowIndex: e.rowIndex, rowPinned: e.rowPinned }); 50409 if (ai(a) || !a.rowPinned && !(i?.isRowInPage(a) ?? !0)) 50410 return null; 50411 n = a ? a.rowIndex : null, o = a ? a.rowPinned : null; 50412 } 50413 return { rowIndex: n, column: r, rowPinned: o }; 50414 } 50415 isSuppressNavigable(e, t) { 50416 const { suppressNavigable: i } = e.colDef; 50417 if (typeof i == "boolean") 50418 return i; 50419 if (typeof i == "function") { 50420 const s = e.createColumnFunctionCallbackParams(t); 50421 return i(s); 50422 } 50423 return !1; 50424 } 50425}; 50426function foe(e) { 50427 return e.focusSvc.getFocusedCell(); 50428} 50429function moe(e) { 50430 return e.focusSvc.clearFocusedCell(); 50431} 50432function voe(e, t, i, s) { 50433 e.focusSvc.setFocusedCell({ rowIndex: t, column: i, rowPinned: s, forceBrowserFocus: !0 }); 50434} 50435function yoe(e, t) { 50436 return e.navigation?.tabToNextCell(!1, t) ?? !1; 50437} 50438function Coe(e, t) { 50439 return e.navigation?.tabToNextCell(!0, t) ?? !1; 50440} 50441function boe(e, t, i = !1) { 50442 const s = e.headerNavigation?.getHeaderPositionForColumn(t, i); 50443 s && e.focusSvc.focusHeaderPosition({ headerPosition: s }); 50444} 50445var woe = class extends he {
50446 constructor() { 50447 super(), this.beanName = "navigation", this.onPageDown = BR(this.onPageDown, 100), this.onPageUp = BR(this.onPageUp, 100); 50448 } 50449 postConstruct() { 50450 this.beans.ctrlsSvc.whenReady(this, (e) => { 50451 this.gridBodyCon = e.gridBodyCtrl; 50452 }); 50453 } 50454 handlePageScrollingKey(e, t = !1) { 50455 const i = e.key, s = e.altKey, n = e.ctrlKey || e.metaKey, o = !!this.beans.rangeSvc && e.shiftKey, r = cee(this.gos, e); 50456 let a = !1; 50457 switch (i) { 50458 case de.PAGE_HOME: 50459 case de.PAGE_END: 50460 !n && !s && (this.onHomeOrEndKey(i), a = !0); 50461 break; 50462 case de.LEFT: 50463 case de.RIGHT: 50464 case de.UP: 50465 case de.DOWN: 50466 if (!r) 50467 return !1; 50468 n && !s && !o && (this.onCtrlUpDownLeftRight(i, r), a = !0); 50469 break; 50470 case de.PAGE_DOWN: 50471 case de.PAGE_UP: 50472 !n && !s && (a = this.handlePageUpDown(i, r, t)); 50473 break; 50474 } 50475 return a && e.preventDefault(), a; 50476 } 50477 handlePageUpDown(e, t, i) { 50478 return i && (t = this.beans.focusSvc.getFocusedCell()), t ? (e === de.PAGE_UP ? this.onPageUp(t) : this.onPageDown(t), !0) : !1; 50479 } 50480 navigateTo(e) { 50481 const { scrollIndex: t, scrollType: i, scrollColumn: s, focusIndex: n, focusColumn: o } = e, { scrollFeature: r } = this.gridBodyCon; 50482 Ie(s) && !s.isPinned() && r.ensureColumnVisible(s), Ie(t) && r.ensureIndexVisible(t, i), e.isAsync || r.ensureIndexVisible(n); 50483 const { focusSvc: a, rangeSvc: l } = this.beans; 50484 a.setFocusedCell({ 50485 rowIndex: n, 50486 column: o, 50487 rowPinned: null, 50488 forceBrowserFocus: !0 50489 }), l?.setRangeToCell({ rowIndex: n, rowPinned: null, column: o }); 50490 } 50491 // this method is throttled, see the `constructor` 50492 onPageDown(e) { 50493 const t = this.beans, i = N0(t), s = this.getViewportHeight(), { pageBounds: n, rowModel: o, rowAutoHeight: r } = t, a = n.getPixelOffset(), l = i.top + s, c = o.getRowIndexAtPixel(l + a); 50494 r?.active ? this.navigateToNextPageWithAutoHeight(e, c) : this.navigateToNextPage(e, c); 50495 } 50496 // this method is throttled, see the `constructor` 50497 onPageUp(e) { 50498 const t = this.beans, i = N0(t), { pageBounds: s, rowModel: n, rowAutoHeight: o } = t, r = s.getPixelOffset(), a = i.top, l = n.getRowIndexAtPixel(a + r); 50499 o?.active ? this.navigateToNextPageWithAutoHeight(e, l, !0) : this.navigateToNextPage(e, l, !0); 50500 } 50501 navigateToNextPage(e, t, i = !1) { 50502 const { pageBounds: s, rowModel: n } = this.beans, o = this.getViewportHeight(), r = s.getFirstRow(), a = s.getLastRow(), l = s.getPixelOffset(), c = n.getRow(e.rowIndex), u = i ? ( 50503 // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain 50504 c?.rowHeight - o - l 50505 ) : o - l, d = c?.rowTop + u; 50506 let p = n.getRowIndexAtPixel(d + l); 50507 if (p === e.rowIndex) { 50508 const m = i ? -1 : 1; 50509 t = p = e.rowIndex + m; 50510 } 50511 let f; 50512 i ? (f = "bottom", p < r && (p = r), t < r && (t = r)) : (f = "top", p > a && (p = a), t > a && (t = a)), this.isRowTallerThanView(n.getRow(p)) && (t = p, f = "top"), this.navigateTo({ 50513 scrollIndex: t, 50514 scrollType: f, 50515 scrollColumn: null, 50516 focusIndex: p, 50517 focusColumn: e.column 50518 }); 50519 } 50520 navigateToNextPageWithAutoHeight(e, t, i = !1) { 50521 this.navigateTo({ 50522 scrollIndex: t, 50523 scrollType: i ? "bottom" : "top", 50524 scrollColumn: null, 50525 focusIndex: t, 50526 focusColumn: e.column 50527 }), setTimeout(() => { 50528 const s = this.getNextFocusIndexForAutoHeight(e, i); 50529 this.navigateTo({ 50530 scrollIndex: t, 50531 scrollType: i ? "bottom" : "top", 50532 scrollColumn: null, 50533 focusIndex: s, 50534 focusColumn: e.column, 50535 isAsync: !0 50536 }); 50537 }, 50); 50538 } 50539 getNextFocusIndexForAutoHeight(e, t = !1) { 50540 const i = t ? -1 : 1, s = this.getViewportHeight(), { pageBounds: n, rowModel: o } = this.beans, r = n.getLastRow(); 50541 let a = 0, l = e.rowIndex; 50542 for (; l >= 0 && l <= r; ) { 50543 const c = o.getRow(l); 50544 if (c) { 50545 const u = c.rowHeight ?? 0; 50546 if (a + u > s) 50547 break; 50548 a += u; 50549 } 50550 l += i; 50551 } 50552 return Math.max(0, Math.min(l, r)); 50553 }
50554 getViewportHeight() { 50555 const e = this.beans, t = N0(e), i = this.beans.scrollVisibleSvc.getScrollbarWidth(); 50556 let s = t.bottom - t.top; 50557 return e.ctrlsSvc.get("center").isHorizontalScrollShowing() && (s -= i), s; 50558 } 50559 isRowTallerThanView(e) { 50560 if (!e) 50561 return !1; 50562 const t = e.rowHeight; 50563 return typeof t != "number" ? !1 : t > this.getViewportHeight(); 50564 } 50565 onCtrlUpDownLeftRight(e, t) { 50566 const i = this.beans.cellNavigation.getNextCellToFocus(e, t, !0), { rowIndex: s } = i, n = i.column; 50567 this.navigateTo({ 50568 scrollIndex: s, 50569 scrollType: null, 50570 scrollColumn: n, 50571 focusIndex: s, 50572 focusColumn: n 50573 }); 50574 } 50575 // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring 50576 // same cell into view (which means either scroll all the way up, or all the way down). 50577 onHomeOrEndKey(e) { 50578 const t = e === de.PAGE_HOME, { visibleCols: i, pageBounds: s } = this.beans, n = i.allCols, o = t ? n[0] : It(n), r = t ? s.getFirstRow() : s.getLastRow(); 50579 this.navigateTo({ 50580 scrollIndex: r, 50581 scrollType: null, 50582 scrollColumn: o, 50583 focusIndex: r, 50584 focusColumn: o 50585 }); 50586 } 50587 // result of keyboard event 50588 onTabKeyDown(e, t) { 50589 const i = t.shiftKey, s = this.tabToNextCellCommon(e, i, t), n = this.beans, { ctrlsSvc: o, pageBounds: r, focusSvc: a, gos: l } = n; 50590 if (s !== !1) { 50591 s ? t.preventDefault() : s === null && o.get("gridCtrl").allowFocusForNextCoreContainer(i); 50592 return; 50593 } 50594 if (i) { 50595 const { rowIndex: c, rowPinned: u } = e.getRowPosition(); 50596 (u ? c === 0 : c === r.getFirstRow()) && (l.get("headerHeight") === 0 || hd(n) ? Id(n, !0, !0) : (t.preventDefault(), a.focusPreviousFromFirstCell(t))); 50597 } else 50598 e instanceof Cm && e.focusCell(!0), (!i && a.focusOverlay(!1) || Id(n, i)) && t.preventDefault(); 50599 } 50600 // comes from API 50601 tabToNextCell(e, t) { 50602 const i = this.beans, { focusSvc: s, rowRenderer: n } = i, o = s.getFocusedCell(); 50603 if (!o) 50604 return !1; 50605 let r = Ku(i, o); 50606 return !r && (r = n.getRowByPosition(o), !r || !r.isFullWidth()) ? !1 : !!this.tabToNextCellCommon(r, e, t); 50607 } 50608 tabToNextCellCommon(e, t, i) { 50609 let s = e.editing; 50610 if (!s && e instanceof Cm) { 50611 const r = e.rowCtrl; 50612 r && (s = r.editing); 50613 } 50614 let n; 50615 return s ? this.gos.get("editType") === "fullRow" ? n = this.moveToNextEditingRow(e, t, i) : n = this.moveToNextEditingCell(e, t, i) : n = this.moveToNextCellNotEditing(e, t), n === null ? n : n || !!this.beans.focusSvc.focusedHeader; 50616 } 50617 // returns null if no navigation should be performed 50618 moveToNextEditingCell(e, t, i = null) { 50619 const s = e.cellPosition; 50620 e.eGui.focus(), e.stopEditing(); 50621 const n = this.findNextCellToFocusOn(s, t, !0); 50622 return n === !1 ? null : n == null ? !1 : (this.beans.editSvc?.startEditing(n, null, !0, i), n.focusCell(!1), !0); 50623 } 50624 // returns null if no navigation should be performed 50625 moveToNextEditingRow(e, t, i = null) { 50626 const s = e.cellPosition, n = this.findNextCellToFocusOn(s, t, !0); 50627 if (n === !1) 50628 return null; 50629 if (n == null) 50630 return !1; 50631 const o = n.cellPosition, r = this.isCellEditable(s), a = this.isCellEditable(o), l = o && s.rowIndex === o.rowIndex && s.rowPinned === o.rowPinned, { editSvc: c, rowEditSvc: u } = this.beans; 50632 if (r && c?.setFocusOutOnEditor(e), !l) { 50633 const d = e.rowCtrl; 50634 c?.stopRowEditing(d); 50635 const p = n.rowCtrl; 50636 u?.startEditing(p, void 0, void 0, i); 50637 } 50638 return a ? (c?.setFocusInOnEditor(n), n.focusCell()) : n.focusCell(!0), !0; 50639 } 50640 // returns null if no navigation should be performed 50641 moveToNextCellNotEditing(e, t) { 50642 const i = this.beans.visibleCols.allCols; 50643 let s; 50644 e instanceof eS ? s = { 50645 ...e.getRowPosition(), 50646 column: t ? i[0] : It(i) 50647 } : s = e.cellPosition; 50648 const n = this.findNextCellToFocusOn(s, t, !1); 50649 if (n === !1) 50650 return null; 50651 if (n instanceof Cm) 50652 n.focusCell(!0); 50653 else if (n) 50654 return this.tryToFocusFullWidthRow(n.getRowPosition(), t); 50655 return Ie(n); 50656 } 50657 /** 50658 * called by the cell, when tab is pressed while editing. 50659 * @return: RenderedCell when navigation successful, false if navigation should not be performed, otherwise null 50660 */ 50661 findNextCellToFocusOn(e, t, i) { 50662 let s = e; 50663 const n = this.beans, { cellNavigation: o, gos: r, focusSvc: a, rowRenderer: l, rangeSvc: c } = n; 50664 for (; ; ) { 50665 e !== s && (e = s), t || (s = this.getLastCellOfColSpan(s)), s = o.getNextTabbedCell(s, t); 50666 const u = r.getCallback("tabToNextCell"); 50667 if (Ie(u)) { 50668 const m = u({ 50669 backwards: t, 50670 editing: i, 50671 previousCellPosition: e, 50672 nextCellPosition: s || null 50673 }); 50674 if (m === !0) 50675 s = e; 50676 else { 50677 if (m === !1) 50678 return !1; 50679 s = { 50680 rowIndex: m.rowIndex, 50681 column: m.column, 50682 rowPinned: m.rowPinned 50683 }; 50684 } 50685 } 50686 if (!s) 50687 return null; 50688 if (s.rowIndex < 0) { 50689 const f = Jr(n); 50690 return a.focusHeaderPosition({ 50691 headerPosition: { 50692 headerRowIndex: f + s.rowIndex, 50693 column: s.column 50694 }, 50695 fromCell: !0 50696 }), null; 50697 } 50698 const d = r.get("editType") === "fullRow"; 50699 if (i && !d && !this.isCellEditable(s)) 50700 continue; 50701 this.ensureCellVisible(s); 50702 const p = Ku(n, s); 50703 if (!p) { 50704 const f = l.getRowByPosition(s); 50705 if (!f || !f.isFullWidth() || i) 50706 continue; 50707 return f; 50708 } 50709 if (!o.isSuppressNavigable(p.column, p.rowNode)) 50710 return c?.setRangeToCell(s), p; 50711 } 50712 } 50713 isCellEditable(e) { 50714 const t = this.lookupRowNodeForCell(e); 50715 return t ? e.column.isCellEditable(t) : !1; 50716 } 50717 lookupRowNodeForCell({ rowIndex: e, rowPinned: t }) { 50718 const { pinnedRowModel: i, rowModel: s } = this.beans; 50719 return t === "top" ? i?.getPinnedTopRow(e) : t === "bottom" ? i?.getPinnedBottomRow(e) : s.getRow(e); 50720 } 50721 // we use index for rows, but column object for columns, as the next column (by index) might not 50722 // be visible (header grouping) so it's not reliable, so using the column object instead. 50723 navigateToNextCell(e, t, i, s) { 50724 let n = i, o = !1; 50725 const r = this.beans, { cellNavigation: a, focusSvc: l, gos: c } = r; 50726 for (; n && (n === i || !this.isValidNavigateCell(n)); ) 50727 c.get("enableRtl") ? t === de.LEFT && (n = this.getLastCellOfColSpan(n)) : t === de.RIGHT && (n = this.getLastCellOfColSpan(n)), n = a.getNextCellToFocus(t, n), o = ai(n); 50728 if (o && e && e.key === de.UP && (n = { 50729 rowIndex: -1, 50730 rowPinned: null, 50731 column: i.column 50732 }), s) { 50733 const d = c.getCallback("navigateToNextCell"); 50734 if (Ie(d)) { 50735 const f = d({ 50736 key: t, 50737 previousCellPosition: i, 50738 nextCellPosition: n || null, 50739 event: e 50740 }); 50741 Ie(f) ? n = { 50742 rowPinned: f.rowPinned, 50743 rowIndex: f.rowIndex, 50744 column: f.column 50745 } : n = null; 50746 } 50747 } 50748 if (!n) 50749 return; 50750 if (n.rowIndex < 0) { 50751 const d = Jr(r); 50752 l.focusHeaderPosition({ 50753 headerPosition: { headerRowIndex: d + n.rowIndex, column: i.column }, 50754 event: e || void 0, 50755 fromCell: !0 50756 }); 50757 return; 50758 } 50759 const u = this.getNormalisedPosition(n); 50760 u ? this.focusPosition(u) : this.tryToFocusFullWidthRow(n); 50761 } 50762 getNormalisedPosition(e) { 50763 this.ensureCellVisible(e); 50764 const t = Ku(this.beans, e); 50765 return t ? (e = t.cellPosition, this.ensureCellVisible(e), e) : null; 50766 } 50767 tryToFocusFullWidthRow(e, t) { 50768 const { visibleCols: i, rowRenderer: s, focusSvc: n, eventSvc: o } = this.beans, r = i.allCols, a = s.getRowByPosition(e); 50769 if (!a || !a.isFullWidth()) 50770 return !1; 50771 const l = n.getFocusedCell(), c = { 50772 rowIndex: e.rowIndex, 50773 rowPinned: e.rowPinned, 50774 column: e.column || (t ? It(r) : r[0]) 50775 }; 50776 this.focusPosition(c); 50777 const u = t ?? (l != null && pee(c, l)); 50778 return o.dispatchEvent({ 50779 type: "fullWidthRowFocused", 50780 rowIndex: c.rowIndex, 50781 rowPinned: c.rowPinned, 50782 column: c.column, 50783 isFullWidthCell: !0, 50784 fromBelow: u
50785 }), !0; 50786 } 50787 focusPosition(e) { 50788 const { focusSvc: t, rangeSvc: i } = this.beans; 50789 t.setFocusedCell({ 50790 rowIndex: e.rowIndex, 50791 column: e.column, 50792 rowPinned: e.rowPinned, 50793 forceBrowserFocus: !0 50794 }), i?.setRangeToCell(e); 50795 } 50796 isValidNavigateCell(e) { 50797 return !!Xw(this.beans, e); 50798 } 50799 getLastCellOfColSpan(e) { 50800 const t = Ku(this.beans, e); 50801 if (!t) 50802 return e; 50803 const i = t.getColSpanningList(); 50804 return i.length === 1 ? e : { 50805 rowIndex: e.rowIndex, 50806 column: It(i), 50807 rowPinned: e.rowPinned 50808 }; 50809 } 50810 ensureCellVisible(e) { 50811 const t = NO(this.gos), i = this.beans.rowModel.getRow(e.rowIndex), s = t && i?.sticky, { scrollFeature: n } = this.gridBodyCon; 50812 !s && ai(e.rowPinned) && n.ensureIndexVisible(e.rowIndex), e.column.isPinned() || n.ensureColumnVisible(e.column); 50813 } 50814}; 50815function N0(e) { 50816 return e.ctrlsSvc.getScrollFeature().getVScrollPosition(); 50817} 50818var Soe = { 50819 moduleName: "KeyboardNavigation", 50820 version: Fe, 50821 beans: [woe, goe, qne], 50822 apiFunctions: { 50823 getFocusedCell: foe, 50824 clearFocusedCell: moe, 50825 setFocusedCell: voe, 50826 setFocusedHeader: boe, 50827 tabToNextCell: yoe, 50828 tabToPreviousCell: Coe 50829 } 50830}, xoe = class extends he { 50831 constructor() { 50832 super(...arguments), this.beanName = "pageBoundsListener"; 50833 } 50834 postConstruct() { 50835 this.addManagedEventListeners({ 50836 modelUpdated: this.onModelUpdated.bind(this), 50837 recalculateRowBounds: this.calculatePages.bind(this) 50838 }), this.onModelUpdated(); 50839 } 50840 onModelUpdated(e) { 50841 this.calculatePages(), this.eventSvc.dispatchEvent({ 50842 type: "paginationChanged", 50843 animate: e?.animate ?? !1, 50844 newData: e?.newData ?? !1, 50845 newPage: e?.newPage ?? !1, 50846 newPageSize: e?.newPageSize ?? !1, 50847 keepRenderedRows: e?.keepRenderedRows ?? !1 50848 }); 50849 } 50850 calculatePages() { 50851 const { pageBounds: e, pagination: t, rowModel: i } = this.beans; 50852 t ? t.calculatePages() : e.calculateBounds(0, i.getRowCount() - 1); 50853 } 50854}, Moe = class extends he { 50855 constructor() { 50856 super(...arguments), this.beanName = "pageBounds", this.pixelOffset = 0; 50857 } 50858 getFirstRow() { 50859 return this.topRowBounds?.rowIndex ?? -1; 50860 } 50861 getLastRow() { 50862 return this.bottomRowBounds?.rowIndex ?? -1; 50863 } 50864 getCurrentPageHeight() { 50865 const { topRowBounds: e, bottomRowBounds: t } = this; 50866 return !e || !t ? 0 : Math.max(t.rowTop + t.rowHeight - e.rowTop, 0); 50867 } 50868 getCurrentPagePixelRange() { 50869 const { topRowBounds: e, bottomRowBounds: t } = this, i = e?.rowTop ?? 0, s = t ? t.rowTop + t.rowHeight : 0; 50870 return { pageFirstPixel: i, pageLastPixel: s }; 50871 } 50872 calculateBounds(e, t) { 50873 const { rowModel: i } = this.beans, s = i.getRowBounds(e); 50874 s && (s.rowIndex = e), this.topRowBounds = s; 50875 const n = i.getRowBounds(t); 50876 n && (n.rowIndex = t), this.bottomRowBounds = n, this.calculatePixelOffset(); 50877 } 50878 getPixelOffset() { 50879 return this.pixelOffset; 50880 } 50881 calculatePixelOffset() { 50882 const e = this.topRowBounds?.rowTop ?? 0; 50883 this.pixelOffset !== e && (this.pixelOffset = e, this.eventSvc.dispatchEvent({ type: "paginationPixelOffsetChanged" })); 50884 } 50885}, Aoe = ( 50886 /*css*/ 50887 ".ag-pinned-left-floating-bottom,.ag-pinned-left-floating-top,.ag-pinned-right-floating-bottom,.ag-pinned-right-floating-top{display:inline-block;min-width:0;overflow:hidden;position:relative}.ag-pinned-left-sticky-top,.ag-pinned-right-sticky-top{height:100%;overflow:hidden;position:relative}.ag-sticky-bottom-full-width-container,.ag-sticky-top-full-width-container{height:100%;overflow:hidden;width:100%}.ag-pinned-left-header,.ag-pinned-right-header{display:inline-block;height:100%;overflow:hidden;position:relative}.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible){.ag-horizontal-left-spacer:not(.ag-scroller-corner){border-right:var(--ag-pinned-column-border)}.ag-horizontal-right-spacer:not(.ag-scroller-corner){border-left:var(--ag-pinned-column-border)}}.ag-pinned-right-header{border-left:var(--ag-pinned-column-border)}.ag-pinned-left-header{border-right:var(--ag-pinned-column-border)}.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-left:var(--ag-pinned-column-border)}.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right,.ag-cell-range-single-cell,.ag-cell-focus:not(.ag-cell-range-selected):focus-within){border-right:var(--ag-pinned-column-border)}.ag-pinned-left-header .ag-header-cell-resize:after{left:calc(50% - var(--ag-header-column-resize-handle-width))}.ag-pinned-right-header .ag-header-cell-resize:after{left:50%}.ag-pinned-left-header .ag-header-cell-resize{right:-3px}.ag-pinned-right-header .ag-header-cell-resize{left:-3px}"
50888), Doe = class extends he { 50889 constructor(e, t) { 50890 super(), this.element = e, this.isLeft = t, this.getWidth = t ? () => this.beans.pinnedCols.leftWidth : () => this.beans.pinnedCols.rightWidth; 50891 } 50892 postConstruct() { 50893 this.addManagedEventListeners({ 50894 [`${this.isLeft ? "left" : "right"}PinnedWidthChanged`]: this.onPinnedWidthChanged.bind(this) 50895 }); 50896 } 50897 onPinnedWidthChanged() { 50898 const e = this.getWidth(), t = e > 0; 50899 ui(this.element, t), mr(this.element, e); 50900 } 50901}, Eoe = class extends he { 50902 constructor() { 50903 super(...arguments), this.beanName = "pinnedCols"; 50904 } 50905 postConstruct() { 50906 this.beans.ctrlsSvc.whenReady(this, (t) => { 50907 this.gridBodyCtrl = t.gridBodyCtrl; 50908 }); 50909 const e = this.checkContainerWidths.bind(this); 50910 this.addManagedEventListeners({ 50911 displayedColumnsChanged: e, 50912 displayedColumnsWidthChanged: e 50913 }), this.addManagedPropertyListener("domLayout", e); 50914 } 50915 checkContainerWidths() { 50916 const { gos: e, visibleCols: t, eventSvc: i } = this.beans, s = gs(e, "print"), n = s ? 0 : t.getColsLeftWidth(), o = s ? 0 : t.getDisplayedColumnsRightWidth(); 50917 n != this.leftWidth && (this.leftWidth = n, i.dispatchEvent({ type: "leftPinnedWidthChanged" })), o != this.rightWidth && (this.rightWidth = o, i.dispatchEvent({ type: "rightPinnedWidthChanged" })); 50918 } 50919 keepPinnedColumnsNarrowerThanViewport() { 50920 const e = this.gridBodyCtrl.eBodyViewport, t = jp(e); 50921 if (t <= 50) 50922 return; 50923 let i = this.getPinnedColumnsOverflowingViewport(t - 50); 50924 const s = this.gos.getCallback("processUnpinnedColumns"); 50925 i.length && (s && (i = s({ 50926 columns: i, 50927 viewportWidth: t 50928 })), this.setColsPinned(i, null, "viewportSizeFeature")); 50929 } 50930 createPinnedWidthFeature(e, t) { 50931 return new Doe(e, t); 50932 } 50933 setColsPinned(e, t, i) { 50934 const { colModel: s, colAnimation: n, visibleCols: o, gos: r } = this.beans; 50935 if (!s.cols || !e?.length) 50936 return; 50937 if (gs(r, "print")) { 50938 Ae(37); 50939 return; 50940 } 50941 n?.start(); 50942 let a; 50943 t === !0 || t === "left" ? a = "left" : t === "right" ? a = "right" : a = null; 50944 const l = []; 50945 e.forEach((c) => { 50946 if (!c) 50947 return; 50948 const u = s.getCol(c); 50949 u && u.getPinned() !== a && (this.setColPinned(u, a), l.push(u)); 50950 }), l.length && (o.refresh(i), KO(this.eventSvc, l, i)), n?.finish(); 50951 } 50952 initCol(e) { 50953 const { pinned: t, initialPinned: i } = e.colDef; 50954 t !== void 0 ? this.setColPinned(e, t) : this.setColPinned(e, i); 50955 } 50956 setColPinned(e, t) { 50957 t === !0 || t === "left" ? e.pinned = "left" : t === "right" ? e.pinned = "right" : e.pinned = null, e.dispatchStateUpdatedEvent("pinned"); 50958 } 50959 setupHeaderPinnedWidth(e) { 50960 const { scrollVisibleSvc: t } = this.beans; 50961 if (e.pinned == null) 50962 return; 50963 const i = e.pinned === "left", s = e.pinned === "right"; 50964 e.hidden = !0; 50965 const n = () => { 50966 const o = i ? this.leftWidth : this.rightWidth; 50967 if (o == null) 50968 return; 50969 const r = o == 0, a = e.hidden !== r, l = this.gos.get("enableRtl"), c = t.getScrollbarWidth(), d = t.verticalScrollShowing && (l && i || !l && s) ? o + c : o; 50970 e.comp.setPinnedContainerWidth(`${d}px`), e.comp.setDisplayed(!r), a && (e.hidden = r, e.refresh()); 50971 }; 50972 e.addManagedEventListeners({ 50973 leftPinnedWidthChanged: n, 50974 rightPinnedWidthChanged: n, 50975 scrollVisibilityChanged: n, 50976 scrollbarWidthChanged: n 50977 }); 50978 } 50979 getHeaderResizeDiff(e, t) { 50980 if (t.getPinned()) { 50981 const { leftWidth: s, rightWidth: n } = this, o = jp(this.beans.ctrlsSvc.getGridBodyCtrl().eBodyViewport) - 50; 50982 if (s + n + e > o) 50983 if (o > s + n) 50984 e = o - s - n; 50985 else 50986 return 0; 50987 } 50988 return e; 50989 } 50990 getPinnedColumnsOverflowingViewport(e) { 50991 const t = this.rightWidth ?? 0, i = this.leftWidth ?? 0, s = t + i; 50992 if (s < e) 50993 return []; 50994 const { visibleCols: n } = this.beans, o = [...n.leftCols], r = [...n.rightCols]; 50995 let a = 0, l = 0; 50996 const c = 0, u = []; 50997 let d = s - c - e; 50998 for (; (l < o.length || a < r.length) && d > 0; ) { 50999 if (a < r.length) { 51000 const p = r[a++]; 51001 d -= p.getActualWidth(), u.push(p); 51002 } 51003 if (l < o.length && d > 0) { 51004 const p = o[l++]; 51005 d -= p.getActualWidth(), u.push(p); 51006 } 51007 } 51008 return u; 51009 } 51010}, Ioe = { 51011 moduleName: "PinnedColumn", 51012 version: Fe, 51013 beans: [Eoe],
51014 css: [Aoe] 51015}, Roe = class extends he { 51016 constructor() { 51017 super(), this.beanName = "ariaAnnounce", this.descriptionContainer = null, this.pendingAnnouncements = /* @__PURE__ */ new Map(), this.lastAnnouncement = "", this.updateAnnouncement = qs(this, this.updateAnnouncement.bind(this), 200); 51018 } 51019 postConstruct() { 51020 const e = this.beans, t = Ei(e), i = this.descriptionContainer = t.createElement("div"); 51021 i.classList.add("ag-aria-description-container"), cO(i, "polite"), xQ(i, "additions text"), SQ(i, !0), e.eGridDiv.appendChild(i); 51022 } 51023 /** 51024 * @param key used for debouncing calls 51025 */ 51026 announceValue(e, t) { 51027 this.pendingAnnouncements.set(t, e), this.updateAnnouncement(); 51028 } 51029 updateAnnouncement() { 51030 if (!this.descriptionContainer) 51031 return; 51032 const e = Array.from(this.pendingAnnouncements.values()).join(". "); 51033 this.pendingAnnouncements.clear(), this.descriptionContainer.textContent = "", setTimeout(() => { 51034 if (this.isAlive() && this.descriptionContainer) { 51035 let t = e; 51036 this.lastAnnouncement === t && (t = `${t}.`), this.lastAnnouncement = t, this.descriptionContainer.textContent = t; 51037 } 51038 }, 50); 51039 } 51040 destroy() { 51041 super.destroy(); 51042 const { descriptionContainer: e } = this; 51043 e && (Is(e), e.parentElement?.removeChild(e)), this.descriptionContainer = null, this.pendingAnnouncements.clear(); 51044 } 51045}, Toe = { 51046 moduleName: "Aria", 51047 version: Fe, 51048 beans: [Roe] 51049}; 51050function Loe(e) { 51051 e.overlays?.showLoadingOverlay(); 51052} 51053function koe(e) { 51054 e.overlays?.showNoRowsOverlay(); 51055} 51056function Poe(e) { 51057 e.overlays?.hideOverlay(); 51058} 51059var Foe = ( 51060 /*css*/ 51061 ".ag-overlay{inset:0;pointer-events:none;position:absolute;z-index:2}.ag-overlay-panel,.ag-overlay-wrapper{display:flex;height:100%;width:100%}.ag-overlay-wrapper{align-items:center;flex:none;justify-content:center;text-align:center}.ag-overlay-loading-wrapper{pointer-events:all}.ag-overlay-loading-center{background:var(--ag-background-color);border:1px solid var(--ag-border-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-popup-shadow);padding:var(--ag-spacing)}" 51062), r_ = class extends Tt { 51063 constructor() { 51064 super( 51065 /* html */ 51066 ` 51067 <div class="ag-overlay" role="presentation"> 51068 <div class="ag-overlay-panel" role="presentation"> 51069 <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div> 51070 </div> 51071 </div>` 51072 ), this.eOverlayWrapper = Pe, this.activePromise = null, this.activeOverlay = null, this.updateListenerDestroyFunc = null, this.activeCssClass = null, this.elToFocusAfter = null, this.registerCSS(Foe); 51073 } 51074 handleKeyDown(e) { 51075 if (e.key !== de.TAB || e.defaultPrevented || ra(e)) 51076 return; 51077 const t = this.beans; 51078 if (iu(t, this.eOverlayWrapper, !1, e.shiftKey)) 51079 return; 51080 let s = !1; 51081 e.shiftKey ? s = t.focusSvc.focusGridView(It(t.visibleCols.allCols), !0, !1) : s = Id(t, !1), s && e.preventDefault(); 51082 } 51083 updateLayoutClasses(e, t) { 51084 const i = this.eOverlayWrapper.classList, { AUTO_HEIGHT: s, NORMAL: n, PRINT: o } = No; 51085 i.toggle(s, t.autoHeight), i.toggle(n, t.normal), i.toggle(o, t.print); 51086 } 51087 postConstruct() { 51088 this.createManagedBean(new hM(this)), this.setDisplayed(!1, { skipAriaHidden: !0 }), this.beans.overlays.setOverlayWrapperComp(this), this.addManagedElementListeners(this.getFocusableElement(), { keydown: this.handleKeyDown.bind(this) }); 51089 } 51090 setWrapperTypeClass(e) { 51091 const t = this.eOverlayWrapper.classList; 51092 this.activeCssClass && t.toggle(this.activeCssClass, !1), this.activeCssClass = e, t.toggle(e, !0); 51093 } 51094 showOverlay(e, t, i, s) { 51095 if (this.setWrapperTypeClass(t), this.destroyActiveOverlay(), this.elToFocusAfter = null, this.activePromise = e, !!e) { 51096 if (this.setDisplayed(!0, { skipAriaHidden: !0 }), i && this.isGridFocused()) { 51097 const n = gi(this.beans); 51098 n && !OO(this.beans) && (this.elToFocusAfter = n); 51099 } 51100 e.then((n) => { 51101 if (this.activePromise !== e) { 51102 this.activeOverlay !== n && (this.destroyBean(n), n = null); 51103 return; 51104 } 51105 if (this.activePromise = null, !!n) { 51106 if (this.activeOverlay !== n && (this.eOverlayWrapper.appendChild(n.getGui()), this.activeOverlay = n, s)) { 51107 const o = n; 51108 this.updateListenerDestroyFunc = this.addManagedPropertyListener(s, ({ currentValue: r }) => { 51109 o.refresh?.(this.gos.addGridCommonParams({ ...r ?? {} })); 51110 }); 51111 } 51112 i && this.isGridFocused() && Gc(this.eOverlayWrapper); 51113 } 51114 }); 51115 } 51116 } 51117 updateOverlayWrapperPaddingTop(e) { 51118 this.eOverlayWrapper.style.setProperty("padding-top", `${e}px`); 51119 } 51120 destroyActiveOverlay() { 51121 this.activePromise = null; 51122 const e = this.activeOverlay; 51123 if (!e) 51124 return; 51125 let t = this.elToFocusAfter; 51126 this.activeOverlay = null, this.elToFocusAfter = null, t && !this.isGridFocused() && (t = null); 51127 const i = this.updateListenerDestroyFunc; 51128 i && (i(), this.updateListenerDestroyFunc = null), this.destroyBean(e), Is(this.eOverlayWrapper), t?.focus?.({ preventScroll: !0 }); 51129 } 51130 hideOverlay() { 51131 this.destroyActiveOverlay(), this.setDisplayed(!1, { skipAriaHidden: !0 }); 51132 } 51133 isGridFocused() { 51134 const e = gi(this.beans); 51135 return !!e && this.beans.eGridDiv.contains(e); 51136 } 51137 destroy() { 51138 this.elToFocusAfter = null, this.destroyActiveOverlay(), this.beans.overlays.setOverlayWrapperComp(void 0), super.destroy(); 51139 } 51140}, Ooe = { 51141 selector: "AG-OVERLAY-WRAPPER", 51142 component: r_ 51143}, Noe = class extends he {
51144 constructor() { 51145 super(...arguments), this.beanName = "overlays", this.state = 0, this.showInitialOverlay = !0, this.wrapperPadding = 0; 51146 } 51147 postConstruct() { 51148 this.isClientSide = $s(this.gos); 51149 const e = () => this.updateOverlayVisibility(); 51150 this.addManagedEventListeners({ 51151 newColumnsLoaded: e, 51152 rowDataUpdated: e, 51153 gridSizeChanged: this.refreshWrapperPadding.bind(this), 51154 rowCountReady: () => { 51155 this.showInitialOverlay = !1, this.updateOverlayVisibility(); 51156 } 51157 }), this.addManagedPropertyListener("loading", e); 51158 } 51159 setOverlayWrapperComp(e) { 51160 this.eWrapper = e, this.updateOverlayVisibility(); 51161 } 51162 /** Returns true if the overlay is visible. */ 51163 isVisible() { 51164 return this.state !== 0 && !!this.eWrapper; 51165 } 51166 /** Returns true if the overlay is visible and is exclusive (popup over the grid) */ 51167 isExclusive() { 51168 return this.state === 1 && !!this.eWrapper; 51169 } 51170 showLoadingOverlay() { 51171 this.showInitialOverlay = !1; 51172 const e = this.gos, t = e.get("loading"); 51173 !t && (t !== void 0 || e.get("suppressLoadingOverlay")) || this.doShowLoadingOverlay(); 51174 } 51175 showNoRowsOverlay() { 51176 this.showInitialOverlay = !1; 51177 const e = this.gos; 51178 e.get("loading") || e.get("suppressNoRowsOverlay") || this.doShowNoRowsOverlay(); 51179 } 51180 hideOverlay() { 51181 if (this.showInitialOverlay = !1, this.gos.get("loading")) { 51182 Ae(99); 51183 return; 51184 } 51185 this.doHideOverlay(); 51186 } 51187 getOverlayWrapperSelector() { 51188 return Ooe; 51189 } 51190 getOverlayWrapperCompClass() { 51191 return r_; 51192 } 51193 updateOverlayVisibility() { 51194 if (!this.eWrapper) { 51195 this.state = 0; 51196 return; 51197 } 51198 const { 51199 state: e, 51200 isClientSide: t, 51201 beans: { gos: i, colModel: s, rowModel: n } 51202 } = this; 51203 let o = this.gos.get("loading"); 51204 o !== void 0 && (this.showInitialOverlay = !1), this.showInitialOverlay && o === void 0 && !i.get("suppressLoadingOverlay") && (o = !i.get("columnDefs") || !s.ready || !i.get("rowData") && t), o ? e !== 1 && this.doShowLoadingOverlay() : (this.showInitialOverlay = !1, n.isEmpty() && !i.get("suppressNoRowsOverlay") && t ? e !== 2 && this.doShowNoRowsOverlay() : e !== 0 && this.doHideOverlay()); 51205 } 51206 doShowLoadingOverlay() { 51207 this.eWrapper && (this.state = 1, this.showOverlay( 51208 MJ(this.beans.userCompFactory, {}), 51209 "ag-overlay-loading-wrapper", 51210 "loadingOverlayComponentParams" 51211 ), this.updateExclusive()); 51212 } 51213 doShowNoRowsOverlay() { 51214 this.eWrapper && (this.state = 2, this.showOverlay( 51215 AJ(this.beans.userCompFactory, {}), 51216 "ag-overlay-no-rows-wrapper", 51217 "noRowsOverlayComponentParams" 51218 ), this.updateExclusive()); 51219 } 51220 doHideOverlay() { 51221 this.eWrapper && (this.state = 0, this.eWrapper.hideOverlay(), this.updateExclusive()); 51222 } 51223 showOverlay(e, t, i) { 51224 const s = e?.newAgStackInstance() ?? null; 51225 this.eWrapper?.showOverlay(s, t, this.isExclusive(), i), this.refreshWrapperPadding(); 51226 } 51227 updateExclusive() { 51228 const e = this.exclusive; 51229 this.exclusive = this.isExclusive(), this.exclusive !== e && this.eventSvc.dispatchEvent({ 51230 type: "overlayExclusiveChanged" 51231 }); 51232 } 51233 refreshWrapperPadding() { 51234 const e = this.eWrapper; 51235 if (!e) 51236 return; 51237 let t = 0; 51238 this.state === 2 ? t = this.beans.ctrlsSvc.get("gridHeaderCtrl")?.headerHeight || 0 : this.wrapperPadding !== 0 && (t = 0), this.wrapperPadding !== t && (this.wrapperPadding = t, e.updateOverlayWrapperPaddingTop(t)); 51239 } 51240}, _oe = { 51241 moduleName: "Overlay", 51242 version: Fe, 51243 userComponents: { 51244 agLoadingOverlay: vte, 51245 agNoRowsOverlay: yte 51246 }, 51247 apiFunctions: { 51248 showLoadingOverlay: Loe, 51249 showNoRowsOverlay: koe, 51250 hideOverlay: Poe 51251 }, 51252 beans: [Noe] 51253}, Boe = class extends he { 51254 constructor() { 51255 super(...arguments), this.beanName = "rowContainerHeight", this.scrollY = 0, this.uiBodyHeight = 0; 51256 } 51257 postConstruct() { 51258 this.addManagedEventListeners({ bodyHeightChanged: this.updateOffset.bind(this) }), this.maxDivHeight = FQ(), Ml(this.gos, "RowContainerHeightService - maxDivHeight = " + this.maxDivHeight); 51259 } 51260 updateOffset() { 51261 if (!this.stretching) 51262 return;
51263 const e = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition().top, t = this.getUiBodyHeight(); 51264 (e !== this.scrollY || t !== this.uiBodyHeight) && (this.scrollY = e, this.uiBodyHeight = t, this.calculateOffset()); 51265 } 51266 calculateOffset() { 51267 this.setUiContainerHeight(this.maxDivHeight), this.pixelsToShave = this.modelHeight - this.uiContainerHeight, this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight; 51268 const e = this.scrollY / this.maxScrollY, t = e * this.pixelsToShave; 51269 Ml( 51270 this.gos, 51271 `RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})` 51272 ), this.setDivStretchOffset(t); 51273 } 51274 setUiContainerHeight(e) { 51275 e !== this.uiContainerHeight && (this.uiContainerHeight = e, this.eventSvc.dispatchEvent({ type: "rowContainerHeightChanged" })); 51276 } 51277 clearOffset() { 51278 this.setUiContainerHeight(this.modelHeight), this.pixelsToShave = 0, this.setDivStretchOffset(0); 51279 } 51280 setDivStretchOffset(e) { 51281 const t = typeof e == "number" ? Math.floor(e) : null; 51282 this.divStretchOffset !== t && (this.divStretchOffset = t, this.eventSvc.dispatchEvent({ type: "heightScaleChanged" })); 51283 } 51284 setModelHeight(e) { 51285 this.modelHeight = e, this.stretching = e != null && // null happens when in print layout 51286 this.maxDivHeight > 0 && e > this.maxDivHeight, this.stretching ? this.calculateOffset() : this.clearOffset(); 51287 } 51288 getRealPixelPosition(e) { 51289 return e - this.divStretchOffset; 51290 } 51291 getUiBodyHeight() { 51292 const e = this.beans.ctrlsSvc.getScrollFeature().getVScrollPosition(); 51293 return e.bottom - e.top; 51294 } 51295 getScrollPositionForPixel(e) { 51296 if (this.pixelsToShave <= 0) 51297 return e; 51298 const t = this.modelHeight - this.getUiBodyHeight(), i = e / t; 51299 return this.maxScrollY * i; 51300 } 51301}, Goe = 400, zoe = class extends he { 51302 constructor() { 51303 super(...arguments), this.beanName = "rowRenderer", this.destroyFuncsForColumnListeners = [], this.rowCtrlsByRowIndex = {}, this.zombieRowCtrls = {}, this.allRowCtrls = [], this.topRowCtrls = [], this.bottomRowCtrls = [], this.refreshInProgress = !1, this.dataFirstRenderedFired = !1, this.setupRangeSelectionListeners = () => { 51304 const e = () => { 51305 this.getAllCellCtrls().forEach((o) => o.onCellSelectionChanged()); 51306 }, t = () => { 51307 this.getAllCellCtrls().forEach((o) => o.updateRangeBordersIfRangeCount()); 51308 }, i = () => { 51309 this.eventSvc.addEventListener("cellSelectionChanged", e), this.eventSvc.addEventListener("columnMoved", t), this.eventSvc.addEventListener("columnPinned", t), this.eventSvc.addEventListener("columnVisible", t); 51310 }, s = () => { 51311 this.eventSvc.removeEventListener("cellSelectionChanged", e), this.eventSvc.removeEventListener("columnMoved", t), this.eventSvc.removeEventListener("columnPinned", t), this.eventSvc.removeEventListener("columnVisible", t); 51312 }; 51313 this.addDestroyFunc(() => s()), this.addManagedPropertyListeners(["enableRangeSelection", "cellSelection"], () => { 51314 pa(this.gos) ? i() : s(); 51315 }), pa(this.gos) && i(); 51316 }; 51317 } 51318 wireBeans(e) { 51319 this.pageBounds = e.pageBounds, this.colModel = e.colModel, this.pinnedRowModel = e.pinnedRowModel, this.rowModel = e.rowModel, this.focusSvc = e.focusSvc, this.rowContainerHeight = e.rowContainerHeight, this.ctrlsSvc = e.ctrlsSvc; 51320 } 51321 postConstruct() { 51322 this.ctrlsSvc.whenReady(this, (e) => { 51323 this.gridBodyCtrl = e.gridBodyCtrl, this.initialise(); 51324 }); 51325 } 51326 initialise() { 51327 this.addManagedEventListeners({ 51328 paginationChanged: this.onPageLoaded.bind(this), 51329 pinnedRowDataChanged: this.onPinnedRowDataChanged.bind(this), 51330 displayedColumnsChanged: this.onDisplayedColumnsChanged.bind(this), 51331 bodyScroll: this.onBodyScroll.bind(this), 51332 bodyHeightChanged: this.redraw.bind(this, {}) 51333 }), this.addManagedPropertyListeners(["domLayout", "embedFullWidthRows"], () => this.onDomLayoutChanged()), this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction", "rowBuffer"], () => this.redraw()), this.addManagedPropertyListener("suppressCellFocus", (i) => this.onSuppressCellFocusChanged(i.currentValue)), this.addManagedPropertyListeners( 51334 [ 51335 "groupSuppressBlankHeader", 51336 "getBusinessKeyForNode", 51337 "fullWidthCellRenderer", 51338 "fullWidthCellRendererParams", 51339 "suppressStickyTotalRow", 51340 "groupRowRenderer", 51341 "groupRowRendererParams", 51342 // maybe only needs to refresh FW rows... 51343 "loadingCellRenderer", 51344 "loadingCellRendererParams", 51345 "detailCellRenderer", 51346 "detailCellRendererParams", 51347 "enableRangeSelection", 51348 "enableCellTextSelection" 51349 ], 51350 () => this.redrawRows() 51351 ), this.addManagedPropertyListener("cellSelection", ({ currentValue: i, previousValue: s }) => { 51352 (!s && i || s && !i) && this.redrawRows(); 51353 }); 51354 const { stickyRowSvc: e, gos: t } = this.beans; 51355 if (e) 51356 this.stickyRowFeature = e.createStickyRowFeature( 51357 this, 51358 this.createRowCon.bind(this), 51359 this.destroyRowCtrls.bind(this) 51360 ); 51361 else { 51362 const i = this.gridBodyCtrl; 51363 i.setStickyTopHeight(0), i.setStickyBottomHeight(0); 51364 } 51365 this.registerCellEventListeners(), this.initialiseCache(), this.printLayout = gs(t, "print"), this.embedFullWidthRows = this.printLayout || t.get("embedFullWidthRows"), this.redrawAfterModelUpdate(); 51366 } 51367 initialiseCache() { 51368 if (this.gos.get("keepDetailRows")) { 51369 const e = this.getKeepDetailRowsCount(), t = e ?? 3; 51370 this.cachedRowCtrls = new Hoe(t); 51371 } 51372 } 51373 getKeepDetailRowsCount() { 51374 return this.gos.get("keepDetailRowsCount"); 51375 } 51376 getStickyTopRowCtrls() { 51377 return this.stickyRowFeature?.stickyTopRowCtrls ?? []; 51378 } 51379 getStickyBottomRowCtrls() { 51380 return this.stickyRowFeature?.stickyBottomRowCtrls ?? []; 51381 } 51382 updateAllRowCtrls() { 51383 const e = Object.values(this.rowCtrlsByRowIndex), t = Object.values(this.zombieRowCtrls), i = this.cachedRowCtrls?.getEntries() ?? []; 51384 t.length > 0 || i.length > 0 ? this.allRowCtrls = [...e, ...t, ...i] : this.allRowCtrls = e; 51385 } 51386 onCellFocusChanged(e) {
51387 this.getAllCellCtrls().forEach((t) => t.onCellFocused(e)), this.getFullWidthRowCtrls().forEach((t) => t.onFullWidthRowFocused(e)); 51388 } 51389 onSuppressCellFocusChanged(e) { 51390 this.getAllCellCtrls().forEach((t) => t.onSuppressCellFocusChanged(e)), this.getFullWidthRowCtrls().forEach((t) => t.onSuppressCellFocusChanged(e)); 51391 } 51392 // in a clean design, each cell would register for each of these events. however when scrolling, all the cells 51393 // registering and de-registering for events is a performance bottleneck. so we register here once and inform 51394 // all active cells. 51395 registerCellEventListeners() { 51396 this.addManagedEventListeners({ 51397 cellFocused: (e) => { 51398 this.onCellFocusChanged(e); 51399 }, 51400 cellFocusCleared: () => this.onCellFocusChanged(), 51401 flashCells: (e) => { 51402 const { cellFlashSvc: t } = this.beans; 51403 t && this.getAllCellCtrls().forEach((i) => t.onFlashCells(i, e)); 51404 }, 51405 columnHoverChanged: () => { 51406 this.getAllCellCtrls().forEach((e) => e.onColumnHover()); 51407 }, 51408 displayedColumnsChanged: () => { 51409 this.getAllCellCtrls().forEach((e) => e.onDisplayedColumnsChanged()); 51410 }, 51411 displayedColumnsWidthChanged: () => { 51412 this.printLayout && this.getAllCellCtrls().forEach((e) => e.onLeftChanged()); 51413 } 51414 }), this.setupRangeSelectionListeners(), this.refreshListenersToColumnsForCellComps(), this.addManagedEventListeners({ 51415 gridColumnsChanged: this.refreshListenersToColumnsForCellComps.bind(this) 51416 }), this.addDestroyFunc(this.removeGridColumnListeners.bind(this)); 51417 } 51418 // executes all functions in destroyFuncsForColumnListeners and then clears the list 51419 removeGridColumnListeners() { 51420 this.destroyFuncsForColumnListeners.forEach((e) => e()), this.destroyFuncsForColumnListeners.length = 0; 51421 } 51422 // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for. 51423 // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to 51424 // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here 51425 // once instead. 51426 refreshListenersToColumnsForCellComps() { 51427 this.removeGridColumnListeners(), this.colModel.getCols().forEach((t) => { 51428 const i = (l) => { 51429 this.getAllCellCtrls().forEach((c) => { 51430 c.column === t && l(c); 51431 }); 51432 }, s = () => { 51433 i((l) => l.onLeftChanged()); 51434 }, n = () => { 51435 i((l) => l.onWidthChanged()); 51436 }, o = () => { 51437 i((l) => l.onFirstRightPinnedChanged()); 51438 }, r = () => { 51439 i((l) => l.onLastLeftPinnedChanged()); 51440 }, a = () => { 51441 i((l) => l.onColDefChanged()); 51442 }; 51443 t.addEventListener("leftChanged", s), t.addEventListener("widthChanged", n), t.addEventListener("firstRightPinnedChanged", o), t.addEventListener("lastLeftPinnedChanged", r), t.addEventListener("colDefChanged", a), this.destroyFuncsForColumnListeners.push(() => { 51444 t.removeEventListener("leftChanged", s), t.removeEventListener("widthChanged", n), t.removeEventListener("firstRightPinnedChanged", o), t.removeEventListener("lastLeftPinnedChanged", r), t.removeEventListener("colDefChanged", a); 51445 }); 51446 }); 51447 } 51448 onDomLayoutChanged() { 51449 const e = gs(this.gos, "print"), t = e || this.gos.get("embedFullWidthRows"), i = t !== this.embedFullWidthRows || this.printLayout !== e; 51450 this.printLayout = e, this.embedFullWidthRows = t, i && this.redrawAfterModelUpdate({ domLayoutChanged: !0 }); 51451 } 51452 // for row models that have datasources, when we update the datasource, we need to force the rowRenderer 51453 // to redraw all rows. otherwise the old rows from the old datasource will stay displayed. 51454 datasourceChanged() { 51455 this.firstRenderedRow = 0, this.lastRenderedRow = -1; 51456 const e = Object.keys(this.rowCtrlsByRowIndex); 51457 this.removeRowCtrls(e); 51458 } 51459 onPageLoaded(e) { 51460 const t = { 51461 recycleRows: e.keepRenderedRows, 51462 animate: e.animate, 51463 newData: e.newData, 51464 newPage: e.newPage, 51465 // because this is a model updated event (not pinned rows), we 51466 // can skip updating the pinned rows. this is needed so that if user 51467 // is doing transaction updates, the pinned rows are not getting constantly 51468 // trashed - or editing cells in pinned rows are not refreshed and put into read mode 51469 onlyBody: !0 51470 }; 51471 this.redrawAfterModelUpdate(t); 51472 } 51473 /** 51474 * @param column AgColumn 51475 * @returns An array with HTMLElement for every cell of the column passed as param. 51476 * If the cell is spanning across multiple columns, it only returns the html element 51477 * if the column passed is the first column of the span (used for auto width calculation). 51478 */ 51479 getAllCellsNotSpanningForColumn(e) { 51480 const t = [];
51481 return this.getAllRowCtrls().forEach((i) => { 51482 const s = i.getCellCtrl(e, !0)?.eGui; 51483 s && t.push(s); 51484 }), t; 51485 } 51486 refreshFloatingRowComps() { 51487 this.refreshFloatingRows(this.topRowCtrls, "top"), this.refreshFloatingRows(this.bottomRowCtrls, "bottom"); 51488 } 51489 /** 51490 * Determines which row controllers need to be destroyed and re-created vs which ones can 51491 * be re-used. 51492 * 51493 * This is operation is to pinned/floating rows as `this.recycleRows` is to normal/body rows. 51494 * 51495 * All `RowCtrl` instances in `rowCtrls` that don't correspond to `RowNode` instances in `rowNodes` are destroyed. 51496 * All `RowNode` instances in `rowNodes` that don't correspond to `RowCtrl` instances in `rowCtrls` are created. 51497 * All instances in `rowCtrls` must be in the same order as their corresponding nodes in `rowNodes`. 51498 * 51499 * @param rowCtrls The list of existing row controllers 51500 * @param rowNodes The canonical list of row nodes that should have associated controllers 51501 */ 51502 refreshFloatingRows(e, t) { 51503 const { pinnedRowModel: i, beans: s, printLayout: n } = this, o = Object.fromEntries(e.map((a) => [a.rowNode.id, a])); 51504 i?.forEachPinnedRow(t, (a, l) => { 51505 const c = e[l]; 51506 c && i.getPinnedRowById(c.rowNode.id, t) === void 0 && (c.destroyFirstPass(), c.destroySecondPass()), a.id in o ? (e[l] = o[a.id], delete o[a.id]) : e[l] = new eS(a, s, !1, !1, n); 51507 }); 51508 const r = (t === "top" ? i?.getPinnedTopRowCount() : i?.getPinnedBottomRowCount()) ?? 0; 51509 e.length = r; 51510 } 51511 onPinnedRowDataChanged() { 51512 const e = { 51513 recycleRows: !0 51514 }; 51515 this.redrawAfterModelUpdate(e); 51516 } 51517 redrawRow(e, t = !1) { 51518 if (e.sticky) 51519 this.stickyRowFeature?.refreshStickyNode(e); 51520 else if (this.cachedRowCtrls?.has(e)) { 51521 this.cachedRowCtrls.removeRow(e); 51522 return; 51523 } else { 51524 const i = (s) => { 51525 const n = s[e.rowIndex]; 51526 n && n.rowNode === e && (n.destroyFirstPass(), n.destroySecondPass(), s[e.rowIndex] = this.createRowCon(e, !1, !1)); 51527 }; 51528 switch (e.rowPinned) { 51529 case "top": 51530 i(this.topRowCtrls); 51531 break; 51532 case "bottom": 51533 i(this.bottomRowCtrls); 51534 break; 51535 default: 51536 i(this.rowCtrlsByRowIndex), this.updateAllRowCtrls(); 51537 } 51538 } 51539 t || this.dispatchDisplayedRowsChanged(!1); 51540 } 51541 redrawRows(e) { 51542 if (e != null) { 51543 e?.forEach((i) => this.redrawRow(i, !0)), this.dispatchDisplayedRowsChanged(!1); 51544 return; 51545 } 51546 this.redrawAfterModelUpdate(); 51547 } 51548 getCellToRestoreFocusToAfterRefresh(e) { 51549 const t = e?.suppressKeepFocus ? null : this.focusSvc.getFocusCellToUseAfterRefresh(); 51550 if (t == null) 51551 return null; 51552 const i = gi(this.beans), s = ov(this.gos, i, pv), n = ov(this.gos, i, Jp); 51553 return s || n ? t : null; 51554 } 51555 // gets called from: 51556 // +) initialisation (in registerGridComp) params = null 51557 // +) onDomLayoutChanged, params = null 51558 // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true 51559 // +) onPinnedRowDataChanged, recycleRows = true 51560 // +) redrawRows (from Grid API), recycleRows = true/false 51561 redrawAfterModelUpdate(e = {}) { 51562 this.getLockOnRefresh(); 51563 const t = this.getCellToRestoreFocusToAfterRefresh(e); 51564 this.updateContainerHeights(), this.scrollToTopIfNewData(e); 51565 const i = !e.domLayoutChanged && !!e.recycleRows, s = e.animate && ad(this.gos), n = i ? this.getRowsToRecycle() : null; 51566 i || this.removeAllRowComps(), this.workOutFirstAndLastRowsToRender(); 51567 const { stickyRowFeature: o } = this; 51568 if (o) { 51569 o.checkStickyRows(); 51570 const r = o.extraTopHeight + o.extraBottomHeight; 51571 r && this.updateContainerHeights(r); 51572 } 51573 this.recycleRows(n, s), this.gridBodyCtrl.updateRowCount(), e.onlyBody || this.refreshFloatingRowComps(), this.dispatchDisplayedRowsChanged(), t != null && this.restoreFocusedCell(t), this.releaseLockOnRefresh(); 51574 } 51575 scrollToTopIfNewData(e) { 51576 const t = e.newData || e.newPage, i = this.gos.get("suppressScrollOnNewData"); 51577 t && !i && (this.gridBodyCtrl.scrollFeature.scrollToTop(), this.stickyRowFeature?.resetOffsets()); 51578 } 51579 updateContainerHeights(e = 0) { 51580 const { rowContainerHeight: t } = this; 51581 if (this.printLayout) { 51582 t.setModelHeight(null); 51583 return; 51584 } 51585 let i = this.pageBounds.getCurrentPageHeight(); 51586 i === 0 && (i = 1), t.setModelHeight(i + e); 51587 } 51588 getLockOnRefresh() { 51589 if (this.refreshInProgress) 51590 throw new Error(vl(252)); 51591 this.refreshInProgress = !0, this.beans.frameworkOverrides.getLockOnRefresh?.(); 51592 } 51593 releaseLockOnRefresh() { 51594 this.refreshInProgress = !1, this.beans.frameworkOverrides.releaseLockOnRefresh?.(); 51595 } 51596 isRefreshInProgress() { 51597 return this.refreshInProgress; 51598 } 51599 // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without 51600 // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits 51601 // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the 51602 // edited cell). 51603 restoreFocusedCell(e) { 51604 e && this.focusSvc.restoreFocusedCell(e, () => { 51605 this.onCellFocusChanged( 51606 this.gos.addGridCommonParams({ 51607 rowIndex: e.rowIndex, 51608 column: e.column, 51609 rowPinned: e.rowPinned, 51610 forceBrowserFocus: !0, 51611 preventScrollOnBrowserFocus: !0, 51612 type: "cellFocused" 51613 }) 51614 ); 51615 }); 51616 } 51617 getAllCellCtrls() { 51618 const e = [], t = this.getAllRowCtrls(), i = t.length; 51619 for (let s = 0; s < i; s++) { 51620 const n = t[s].getAllCellCtrls(), o = n.length; 51621 for (let r = 0; r < o; r++) 51622 e.push(n[r]); 51623 } 51624 return e; 51625 } 51626 getAllRowCtrls() {
51627 const e = this.getStickyTopRowCtrls(), t = this.getStickyBottomRowCtrls(); 51628 return [ 51629 ...this.topRowCtrls, 51630 ...this.bottomRowCtrls, 51631 ...e, 51632 ...t, 51633 ...Object.values(this.rowCtrlsByRowIndex) 51634 ]; 51635 } 51636 addRenderedRowListener(e, t, i) { 51637 const s = this.rowCtrlsByRowIndex[t]; 51638 s && s.addEventListener(e, i); 51639 } 51640 refreshCells(e = {}) { 51641 const t = { 51642 forceRefresh: e.force, 51643 newData: !1, 51644 suppressFlash: e.suppressFlash 51645 }; 51646 for (const i of this.getCellCtrls(e.rowNodes, e.columns)) 51647 i.refreshOrDestroyCell(t); 51648 this.refreshFullWidth(e.rowNodes); 51649 } 51650 refreshFullWidth(e) { 51651 if (!e) 51652 return; 51653 let t = null; 51654 this.stickyRowFeature && (t = this.getCellToRestoreFocusToAfterRefresh() || null); 51655 for (const i of this.getRowCtrls(e)) { 51656 if (!i.isFullWidth()) 51657 continue; 51658 i.refreshFullWidth() || this.redrawRow(i.rowNode, !0); 51659 } 51660 this.dispatchDisplayedRowsChanged(!1), t && this.restoreFocusedCell(t); 51661 } 51662 /** 51663 * @param rowNodes if provided, returns the RowCtrls for the provided rowNodes. otherwise returns all RowCtrls. 51664 */ 51665 getRowCtrls(e) { 51666 const t = lS(e), i = this.getAllRowCtrls(); 51667 return !e || !t ? i : i.filter((s) => { 51668 const n = s.rowNode; 51669 return cS(n, t); 51670 }); 51671 } 51672 // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node 51673 // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned. 51674 getCellCtrls(e, t) { 51675 let i; 51676 Ie(t) && (i = {}, t.forEach((n) => { 51677 const o = this.colModel.getCol(n); 51678 Ie(o) && (i[o.getId()] = !0); 51679 })); 51680 const s = []; 51681 return this.getRowCtrls(e).forEach((n) => { 51682 n.getAllCellCtrls().forEach((o) => { 51683 const r = o.column.getId(); 51684 i && !i[r] || s.push(o); 51685 }); 51686 }), s; 51687 } 51688 destroy() { 51689 this.removeAllRowComps(!0), super.destroy(); 51690 } 51691 removeAllRowComps(e = !1) { 51692 const t = Object.keys(this.rowCtrlsByRowIndex); 51693 this.removeRowCtrls(t, e), this.stickyRowFeature?.destroyStickyCtrls(); 51694 } 51695 getRowsToRecycle() { 51696 const e = []; 51697 for (const [i, s] of Object.entries(this.rowCtrlsByRowIndex)) 51698 s.rowNode.id == null && e.push(i); 51699 this.removeRowCtrls(e); 51700 const t = {}; 51701 for (const i of Object.values(this.rowCtrlsByRowIndex)) { 51702 const s = i.rowNode; 51703 t[s.id] = i; 51704 } 51705 return this.rowCtrlsByRowIndex = {}, t; 51706 } 51707 // takes array of row indexes 51708 removeRowCtrls(e, t = !1) { 51709 e.forEach((i) => { 51710 const s = this.rowCtrlsByRowIndex[i]; 51711 s && (s.destroyFirstPass(t), s.destroySecondPass()), delete this.rowCtrlsByRowIndex[i]; 51712 }); 51713 } 51714 onBodyScroll(e) { 51715 e.direction === "vertical" && this.redraw({ afterScroll: !0 }); 51716 } 51717 // gets called when rows don't change, but viewport does, so after: 51718 // 1) height of grid body changes, ie number of displayed rows has changed 51719 // 2) grid scrolled to new position 51720 // 3) ensure index visible (which is a scroll) 51721 redraw(e = {}) { 51722 const { afterScroll: t } = e; 51723 let i; 51724 const s = this.stickyRowFeature; 51725 s && (i = this.getCellToRestoreFocusToAfterRefresh() || void 0); 51726 const n = this.firstRenderedRow, o = this.lastRenderedRow; 51727 this.workOutFirstAndLastRowsToRender(); 51728 let r = !1; 51729 if (s) { 51730 r = s.checkStickyRows(); 51731 const l = s.extraTopHeight + s.extraBottomHeight; 51732 l && this.updateContainerHeights(l); 51733 } 51734 const a = this.firstRenderedRow !== n || this.lastRenderedRow !== o; 51735 if (!(t && !r && !a) && (this.getLockOnRefresh(), this.recycleRows(null, !1, t), this.releaseLockOnRefresh(), this.dispatchDisplayedRowsChanged(t && !r), i != null)) { 51736 const l = this.getCellToRestoreFocusToAfterRefresh(); 51737 i != null && l == null && (this.beans.animationFrameSvc?.flushAllFrames(), this.restoreFocusedCell(i)); 51738 } 51739 } 51740 removeRowCompsNotToDraw(e, t) { 51741 const i = {}; 51742 e.forEach((o) => i[o] = !0); 51743 const n = Object.keys(this.rowCtrlsByRowIndex).filter((o) => !i[o]); 51744 this.removeRowCtrls(n, t); 51745 } 51746 calculateIndexesToDraw(e) { 51747 const t = [];
51748 for (let n = this.firstRenderedRow; n <= this.lastRenderedRow; n++) 51749 t.push(n); 51750 const i = (n) => { 51751 const o = n.rowNode.rowIndex; 51752 o != null && (o < this.firstRenderedRow || o > this.lastRenderedRow) && this.doNotUnVirtualiseRow(n) && t.push(o); 51753 }; 51754 for (const n of Object.values(this.rowCtrlsByRowIndex)) 51755 i(n); 51756 if (e) 51757 for (const n of Object.values(e)) 51758 i(n); 51759 t.sort((n, o) => n - o); 51760 const s = []; 51761 for (let n = 0; n < t.length; n++) { 51762 const o = t[n], r = this.rowModel.getRow(o); 51763 r && !r.sticky && s.push(o); 51764 } 51765 return s; 51766 } 51767 recycleRows(e, t = !1, i = !1) { 51768 const s = this.calculateIndexesToDraw(e); 51769 if ((this.printLayout || i) && (t = !1), this.removeRowCompsNotToDraw(s, !t), s.forEach((n) => { 51770 this.createOrUpdateRowCtrl(n, e, t, i); 51771 }), e) { 51772 const { animationFrameSvc: n } = this.beans; 51773 n && i && !this.gos.get("suppressAnimationFrame") && !this.printLayout ? n.addDestroyTask(() => { 51774 this.destroyRowCtrls(e, t), this.updateAllRowCtrls(), this.dispatchDisplayedRowsChanged(); 51775 }) : this.destroyRowCtrls(e, t); 51776 } 51777 this.updateAllRowCtrls(); 51778 } 51779 dispatchDisplayedRowsChanged(e = !1) { 51780 this.eventSvc.dispatchEvent({ 51781 type: "displayedRowsChanged", 51782 afterScroll: e 51783 }); 51784 } 51785 onDisplayedColumnsChanged() { 51786 const { visibleCols: e } = this.beans, t = e.isPinningLeft(), i = e.isPinningRight(); 51787 (this.pinningLeft !== t || i !== this.pinningRight) && (this.pinningLeft = t, this.pinningRight = i, this.embedFullWidthRows && this.redrawFullWidthEmbeddedRows()); 51788 } 51789 // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse, 51790 // then it should go into the pinned left area if pinning left, or the center area if not pinning. 51791 redrawFullWidthEmbeddedRows() { 51792 const e = []; 51793 this.getFullWidthRowCtrls().forEach((t) => { 51794 const i = t.rowNode.rowIndex; 51795 e.push(i.toString()); 51796 }), this.refreshFloatingRowComps(), this.removeRowCtrls(e), this.redraw({ afterScroll: !0 }); 51797 } 51798 getFullWidthRowCtrls(e) { 51799 const t = lS(e); 51800 return this.getAllRowCtrls().filter((i) => { 51801 if (!i.isFullWidth()) 51802 return !1; 51803 const s = i.rowNode; 51804 return !(t != null && !cS(s, t)); 51805 }); 51806 } 51807 createOrUpdateRowCtrl(e, t, i, s) { 51808 let n, o = this.rowCtrlsByRowIndex[e]; 51809 if (o || (n = this.rowModel.getRow(e), Ie(n) && Ie(t) && t[n.id] && n.alreadyRendered && (o = t[n.id], t[n.id] = null)), !o) 51810 if (n || (n = this.rowModel.getRow(e)), Ie(n)) 51811 o = this.createRowCon(n, i, s); 51812 else 51813 return; 51814 return n && (n.alreadyRendered = !0), this.rowCtrlsByRowIndex[e] = o, o; 51815 } 51816 destroyRowCtrls(e, t) { 51817 const i = []; 51818 if (e) { 51819 for (const s of Object.values(e)) 51820 if (s) { 51821 if (this.cachedRowCtrls && s.isCacheable()) { 51822 this.cachedRowCtrls.addRow(s); 51823 continue; 51824 } 51825 if (s.destroyFirstPass(!t), t) { 51826 const n = s.instanceId; 51827 this.zombieRowCtrls[n] = s, i.push(() => { 51828 s.destroySecondPass(), delete this.zombieRowCtrls[n]; 51829 }); 51830 } else 51831 s.destroySecondPass(); 51832 } 51833 } 51834 t && (i.push(() => { 51835 this.updateAllRowCtrls(), this.dispatchDisplayedRowsChanged(); 51836 }), window.setTimeout(() => i.forEach((s) => s()), Goe)); 51837 } 51838 getRowBuffer() { 51839 return this.gos.get("rowBuffer"); 51840 } 51841 getRowBufferInPixels() { 51842 const e = this.getRowBuffer(), t = Ec(this.beans); 51843 return e * t; 51844 } 51845 workOutFirstAndLastRowsToRender() { 51846 const { rowContainerHeight: e, pageBounds: t, rowModel: i } = this; 51847 e.updateOffset(); 51848 let s, n; 51849 if (!i.isRowsToRender()) 51850 s = 0, n = -1; 51851 else if (this.printLayout) 51852 this.beans.environment.refreshRowHeightVariable(), s = t.getFirstRow(), n = t.getLastRow(); 51853 else { 51854 const u = this.getRowBufferInPixels(), d = this.ctrlsSvc.getScrollFeature(), p = this.gos.get("suppressRowVirtualisation"); 51855 let f = !1, m, y; 51856 do { 51857 const A = t.getPixelOffset(), { pageFirstPixel: I, pageLastPixel: L } = t.getCurrentPagePixelRange(), k = e.divStretchOffset, B = d.getVScrollPosition(), N = B.top, W = B.bottom; 51858 p ? (m = I + k, y = L + k) : (m = Math.max(N + A - u, I) + k, y = Math.min(W + A + u, L) + k), this.first
51858VisibleVPixel = Math.max(N + A, I) + k, this.lastVisibleVPixel = Math.min(W + A, L) + k, f = this.ensureAllRowsInRangeHaveHeightsCalculated(m, y); 51859 } while (f); 51860 let b = i.getRowIndexAtPixel(m), C = i.getRowIndexAtPixel(y); 51861 const w = t.getFirstRow(), M = t.getLastRow(); 51862 b < w && (b = w), C > M && (C = M), s = b, n = C; 51863 } 51864 const o = gs(this.gos, "normal"), r = this.gos.get("suppressMaxRenderedRowRestriction"), a = Math.max(this.getRowBuffer(), 500); 51865 o && !r && n - s > a && (n = s + a); 51866 const l = s !== this.firstRenderedRow, c = n !== this.lastRenderedRow; 51867 (l || c) && (this.firstRenderedRow = s, this.lastRenderedRow = n, this.eventSvc.dispatchEvent({ 51868 type: "viewportChanged", 51869 firstRow: s, 51870 lastRow: n 51871 })); 51872 } 51873 /** 51874 * This event will only be fired once, and is queued until after the browser next renders. 51875 * This allows us to fire an event during the start of the render cycle, when we first see data being rendered 51876 * but not execute the event until all of the data has finished being rendered to the dom. 51877 */ 51878 dispatchFirstDataRenderedEvent() { 51879 this.dataFirstRenderedFired || (this.dataFirstRenderedFired = !0, window.requestAnimationFrame(() => { 51880 this.beans.eventSvc.dispatchEvent({ 51881 type: "firstDataRendered", 51882 firstRow: this.firstRenderedRow, 51883 lastRow: this.lastRenderedRow 51884 }); 51885 })); 51886 } 51887 ensureAllRowsInRangeHaveHeightsCalculated(e, t) { 51888 const i = this.pinnedRowModel?.ensureRowHeightsValid(), s = this.stickyRowFeature?.ensureRowHeightsValid(), { pageBounds: n, rowModel: o } = this, r = o.ensureRowHeightsValid( 51889 e, 51890 t, 51891 n.getFirstRow(), 51892 n.getLastRow() 51893 ); 51894 return (r || s) && this.eventSvc.dispatchEvent({ 51895 type: "recalculateRowBounds" 51896 }), s || r || i ? (this.updateContainerHeights(), !0) : !1; 51897 } 51898 // check that none of the rows to remove are editing or focused as: 51899 // a) if editing, we want to keep them, otherwise the user will loose the context of the edit, 51900 // eg user starts editing, enters some text, then scrolls down and then up, next time row rendered 51901 // the edit is reset - so we want to keep it rendered. 51902 // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard, 51903 // otherwise the user can range select and drag (with focus cell going out of the viewport) 51904 // and then ctrl+c, nothing will happen if cell is removed from dom. 51905 // c) if detail record of master detail, as users complained that the context of detail rows 51906 // was getting lost when detail row out of view. eg user expands to show detail row, 51907 // then manipulates the detail panel (eg sorts the detail grid), then context is lost 51908 // after detail panel is scrolled out of / into view. 51909 doNotUnVirtualiseRow(e) { 51910 const s = e.rowNode, n = this.focusSvc.isRowNodeFocused(s), o = e.editing, r = s.detail; 51911 return n || o || r ? !!this.isRowPresent(s) : !1; 51912 } 51913 isRowPresent(e) { 51914 return this.rowModel.isRowPresent(e) ? this.beans.pagination?.isRowPresent(e) ?? !0 : !1; 51915 } 51916 createRowCon(e, t, i) { 51917 const s = this.cachedRowCtrls?.getRow(e) ?? null; 51918 if (s) 51919 return s; 51920 const n = this.gos.get("suppressAnimationFrame"), o = i && !n && !this.printLayout && !!this.beans.animationFrameSvc; 51921 return new eS(e, this.beans, t, o, this.printLayout); 51922 } 51923 getRenderedNodes() { 51924 const e = this.rowCtrlsByRowIndex; 51925 return Object.values(e).map((t) => t.rowNode); 51926 } 51927 getRowByPosition(e) { 51928 let t; 51929 const { rowIndex: i } = e; 51930 switch (e.rowPinned) { 51931 case "top": 51932 t = this.topRowCtrls[i]; 51933 break; 51934 case "bottom": 51935 t = this.bottomRowCtrls[i]; 51936 break; 51937 default: 51938 t = this.rowCtrlsByRowIndex[i], t || (t = this.getStickyTopRowCtrls().find((s) => s.rowNode.rowIndex === i) || null, t || (t = this.getStickyBottomRowCtrls().find((s) => s.rowNode.rowIndex === i) || null)); 51939 break; 51940 } 51941 return t; 51942 } 51943 // returns true if any row between startIndex and endIndex is rendered. used by 51944 // SSRM or IRM, as they don't want to purge visible blocks from cache. 51945 isRangeInRenderedViewport(e, t) { 51946 if (e == null || t == null) 51947 return !1; 51948 const s = e > this.lastRenderedRow;
51949 return !(t < this.firstRenderedRow) && !s; 51950 } 51951}, Hoe = class { 51952 constructor(e) { 51953 this.entriesMap = {}, this.entriesList = [], this.maxCount = e; 51954 } 51955 addRow(e) { 51956 if (this.entriesMap[e.rowNode.id] = e, this.entriesList.push(e), e.setCached(!0), this.entriesList.length > this.maxCount) { 51957 const t = this.entriesList[0]; 51958 t.destroyFirstPass(), t.destroySecondPass(), this.removeFromCache(t); 51959 } 51960 } 51961 getRow(e) { 51962 if (e == null || e.id == null) 51963 return null; 51964 const t = this.entriesMap[e.id]; 51965 return t ? (this.removeFromCache(t), t.setCached(!1), t.rowNode != e ? null : t) : null; 51966 } 51967 has(e) { 51968 return this.entriesMap[e.id] != null; 51969 } 51970 removeRow(e) { 51971 const t = e.id, i = this.entriesMap[t]; 51972 delete this.entriesMap[t], Ko(this.entriesList, i); 51973 } 51974 removeFromCache(e) { 51975 const t = e.rowNode.id; 51976 delete this.entriesMap[t], Ko(this.entriesList, e); 51977 } 51978 getEntries() { 51979 return this.entriesList; 51980 } 51981}; 51982function lS(e) { 51983 if (!e) 51984 return; 51985 const t = { 51986 top: {}, 51987 bottom: {}, 51988 normal: {} 51989 }; 51990 return e.forEach((i) => { 51991 const s = i.id; 51992 switch (i.rowPinned) { 51993 case "top": 51994 t.top[s] = i; 51995 break; 51996 case "bottom": 51997 t.bottom[s] = i; 51998 break; 51999 default: 52000 t.normal[s] = i; 52001 break; 52002 } 52003 }), t; 52004} 52005function cS(e, t) { 52006 const i = e.id; 52007 switch (e.rowPinned) { 52008 case "top": 52009 return t.top[i] != null; 52010 case "bottom": 52011 return t.bottom[i] != null; 52012 default: 52013 return t.normal[i] != null; 52014 } 52015} 52016var Voe = class extends he { 52017 constructor() { 52018 super(...arguments), this.beanName = "rowNodeSorter"; 52019 } 52020 postConstruct() { 52021 const { gos: e } = this; 52022 this.isAccentedSort = e.get("accentedSort"), this.primaryColumnsSortGroups = hr(e), this.addManagedPropertyListener( 52023 "accentedSort", 52024 (t) => this.isAccentedSort = t.currentValue 52025 ), this.addManagedPropertyListener( 52026 "autoGroupColumnDef", 52027 () => this.primaryColumnsSortGroups = hr(e) 52028 ); 52029 } 52030 doFullSort(e, t) { 52031 const i = e.map((s, n) => ({ 52032 currentPos: n, 52033 rowNode: s 52034 })); 52035 return i.sort(this.compareRowNodes.bind(this, t)), i.map((s) => s.rowNode); 52036 } 52037 compareRowNodes(e, t, i) { 52038 const s = t.rowNode, n = i.rowNode; 52039 for (let o = 0, r = e.length; o < r; o++) { 52040 const a = e[o], l = a.sort === "desc", c = this.getValue(s, a.column), u = this.getValue(n, a.column); 52041 let d; 52042 const p = this.getComparator(a, s); 52043 if (p ? d = p(c, u, s, n, l) : d = WQ(c, u, this.isAccentedSort), !isNaN(d) && d !== 0) 52044 return a.sort === "asc" ? d : d * -1; 52045 } 52046 return t.currentPos - i.currentPos; 52047 } 52048 getComparator(e, t) { 52049 const i = e.column, s = i.getColDef().comparator; 52050 if (s != null) 52051 return s; 52052 if (!i.getColDef().showRowGroup) 52053 return; 52054 const n = !t.group && i.getColDef().field; 52055 if (!n) 52056 return; 52057 const o = this.beans.colModel.getColDefCol(n); 52058 if (o) 52059 return o.getColDef().comparator; 52060 } 52061 getValue(e, t) { 52062 const { valueSvc: i, colModel: s, showRowGroupCols: n, gos: o } = this.beans; 52063 if (!this.primaryColumnsSortGroups) 52064 return i.getValue(t, e, !1); 52065 if (e.rowGroupColumn === t) { 52066 if (nM(o, s.isPivotActive())) { 52067 const c = e.allLeafChildren?.[0]; 52068 return c ? i.getValue(t, c, !1) : void 0; 52069 } 52070 const l = n?.getShowRowGroupCol(t.getId()); 52071 return l ? e.groupData?.[l.getId()] : void 0; 52072 } 52073 if (!(e.group && t.getColDef().showRowGroup)) 52074 return i.getValue(t, e, !1); 52075 } 52076}; 52077function Uoe(e) { 52078 e.sortSvc?.onSortChanged("api"); 52079} 52080function Th(e, t) { 52081 return ( 52082 /* html */ 52083 `<span data-ref="eSort${e}" class="ag-sort-indicator-icon ag-sort-${t} ag-hidden" aria-hidden="true"></span>` 52084 ); 52085} 52086var Woe = ( 52087 /* html */ 52088 `<span class="ag-sort-indicator-container"> 52089 ${Th("Order", "order")} 52090 ${Th("Asc", "ascending-icon")} 52091 ${Th("Desc", "descending-icon")} 52092 ${Th("Mixed", "mixed-icon")} 52093 ${Th("None", "none-icon")} 52094 </span>` 52095), RM = class extends Tt { 52096 constructor(e) { 52097 super(), this.eSortOrder = Pe, this.eSortAsc = Pe, this.eSortDe
52097sc = Pe, this.eSortMixed = Pe, this.eSortNone = Pe, e || this.setTemplate(Woe); 52098 } 52099 attachCustomElements(e, t, i, s, n) { 52100 this.eSortOrder = e, this.eSortAsc = t, this.eSortDesc = i, this.eSortMixed = s, this.eSortNone = n; 52101 } 52102 setupSort(e, t = !1) { 52103 if (this.column = e, this.suppressOrder = t, this.setupMultiSortIndicator(), !e.isSortable() && !e.getColDef().showRowGroup) 52104 return; 52105 this.addInIcon("sortAscending", this.eSortAsc, e), this.addInIcon("sortDescending", this.eSortDesc, e), this.addInIcon("sortUnSort", this.eSortNone, e); 52106 const i = this.updateIcons.bind(this), s = this.onSortChanged.bind(this); 52107 this.addManagedPropertyListener("unSortIcon", i), this.addManagedEventListeners({ 52108 newColumnsLoaded: i, 52109 // Watch global events, as row group columns can effect their display column. 52110 sortChanged: s, 52111 // when grouping changes so can sort indexes and icons 52112 columnRowGroupChanged: s 52113 }), this.onSortChanged(); 52114 } 52115 addInIcon(e, t, i) { 52116 if (t == null) 52117 return; 52118 const s = po(e, this.beans, i); 52119 s && t.appendChild(s); 52120 } 52121 onSortChanged() { 52122 this.updateIcons(), this.suppressOrder || this.updateSortOrder(); 52123 } 52124 updateIcons() { 52125 const { eSortAsc: e, eSortDesc: t, eSortNone: i, column: s, gos: n, beans: o } = this, r = o.sortSvc.getDisplaySortForColumn(s); 52126 if (e && ui(e, r === "asc", { skipAriaHidden: !0 }), t && ui(t, r === "desc", { skipAriaHidden: !0 }), i) { 52127 const a = !s.getColDef().unSortIcon && !n.get("unSortIcon"), l = r == null; 52128 ui(i, !a && l, { skipAriaHidden: !0 }); 52129 } 52130 } 52131 setupMultiSortIndicator() { 52132 const { eSortMixed: e, column: t, gos: i } = this; 52133 this.addInIcon("sortUnSort", e, t); 52134 const s = t.getColDef().showRowGroup; 52135 hr(i) && s && (this.addManagedEventListeners({ 52136 // Watch global events, as row group columns can effect their display column. 52137 sortChanged: this.updateMultiSortIndicator.bind(this), 52138 // when grouping changes so can sort indexes and icons 52139 columnRowGroupChanged: this.updateMultiSortIndicator.bind(this) 52140 }), this.updateMultiSortIndicator()); 52141 } 52142 updateMultiSortIndicator() { 52143 const { eSortMixed: e, beans: t, column: i } = this; 52144 if (e) { 52145 const s = t.sortSvc.getDisplaySortForColumn(i) === "mixed"; 52146 ui(e, s, { skipAriaHidden: !0 }); 52147 } 52148 } 52149 // we listen here for global sort events, NOT column sort events, as we want to do this 52150 // when sorting has been set on all column (if we listened just for our col (where we 52151 // set the asc / desc icons) then it's possible other cols are yet to get their sorting state. 52152 updateSortOrder() { 52153 const { 52154 eSortOrder: e, 52155 column: t, 52156 beans: { sortSvc: i } 52157 } = this; 52158 if (!e) 52159 return; 52160 const s = i.getColumnsWithSortingOrdered(), n = i.getDisplaySortIndexForColumn(t) ?? -1, o = s.some( 52161 (a) => i.getDisplaySortIndexForColumn(a) ?? !1 52162 ), r = n >= 0 && o; 52163 ui(e, r, { skipAriaHidden: !0 }), n >= 0 ? e.textContent = (n + 1).toString() : Is(e); 52164 } 52165}, joe = { 52166 selector: "AG-SORT-INDICATOR", 52167 component: RM 52168}, eg = ["asc", "desc", null], $oe = class extends he { 52169 constructor() { 52170 super(...arguments), this.beanName = "sortSvc"; 52171 } 52172 progressSort(e, t, i) { 52173 const s = this.getNextSortDirection(e); 52174 this.setSortForColumn(e, s, t, i); 52175 } 52176 progressSortFromEvent(e, t) { 52177 const s = this.gos.get("multiSortKey") === "ctrl" ? t.ctrlKey || t.metaKey : t.shiftKey; 52178 this.progressSort(e, s, "uiColumnSorted"); 52179 } 52180 setSortForColumn(e, t, i, s) { 52181 t !== "asc" && t !== "desc" && (t = null);
52182 const { gos: n, showRowGroupCols: o } = this.beans, r = hr(n); 52183 let a = [e]; 52184 if (r && e.getColDef().showRowGroup) { 52185 const d = o?.getSourceColumnsForGroupColumn?.(e)?.filter((p) => p.isSortable()); 52186 d && (a = [e, ...d]); 52187 } 52188 a.forEach((u) => this.setColSort(u, t, s)); 52189 const l = (i || n.get("alwaysMultiSort")) && !n.get("suppressMultiSort"), c = []; 52190 if (!l) { 52191 const u = this.clearSortBarTheseColumns(a, s); 52192 c.push(...u); 52193 } 52194 this.updateSortIndex(e), c.push(...a), this.dispatchSortChangedEvents(s, c); 52195 } 52196 updateSortIndex(e) { 52197 const { gos: t, colModel: i, showRowGroupCols: s } = this.beans, n = hr(t), o = s?.getShowRowGroupCol(e.getId()), r = n && o || e, a = this.getColumnsWithSortingOrdered(); 52198 i.getAllCols().forEach((u) => this.setColSortIndex(u, null)); 52199 const l = a.filter((u) => n && u.getColDef().showRowGroup ? !1 : u !== r); 52200 (r.getSort() ? [...l, r] : l).forEach((u, d) => this.setColSortIndex(u, d)); 52201 } 52202 // gets called by API, so if data changes, use can call this, which will end up 52203 // working out the sort order again of the rows. 52204 onSortChanged(e, t) { 52205 this.dispatchSortChangedEvents(e, t); 52206 } 52207 isSortActive() { 52208 const t = this.beans.colModel.getAllCols().filter((i) => !!i.getSort()); 52209 return t && t.length > 0; 52210 } 52211 dispatchSortChangedEvents(e, t) { 52212 const i = { 52213 type: "sortChanged", 52214 source: e 52215 }; 52216 t && (i.columns = t), this.eventSvc.dispatchEvent(i); 52217 } 52218 clearSortBarTheseColumns(e, t) { 52219 const i = []; 52220 return this.beans.colModel.getAllCols().forEach((s) => { 52221 e.includes(s) || (s.getSort() && i.push(s), this.setColSort(s, void 0, t)); 52222 }), i; 52223 } 52224 getNextSortDirection(e) { 52225 const t = e.getColDef().sortingOrder ?? this.gos.get("sortingOrder") ?? eg, i = t.indexOf(e.getSort()), s = i < 0, n = i == t.length - 1; 52226 return s || n ? t[0] : t[i + 1]; 52227 } 52228 /** 52229 * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices 52230 */ 52231 getIndexedSortMap() { 52232 const { gos: e, colModel: t, showRowGroupCols: i, rowGroupColsSvc: s } = this.beans; 52233 let n = t.getAllCols().filter((c) => !!c.getSort()); 52234 if (t.isPivotMode()) { 52235 const c = hr(e); 52236 n = n.filter((u) => { 52237 const d = !!u.getAggFunc(), p = !u.isPrimary(), f = c ? i?.getShowRowGroupCol(u.getId()) : u.getColDef().showRowGroup; 52238 return d || p || f; 52239 }); 52240 } 52241 const o = s?.columns.filter((c) => !!c.getSort()) ?? [], r = {};
52242 n.forEach((c, u) => r[c.getId()] = u), n.sort((c, u) => { 52243 const d = c.getSortIndex(), p = u.getSortIndex(); 52244 if (d != null && p != null) 52245 return d - p; 52246 if (d == null && p == null) { 52247 const f = r[c.getId()], m = r[u.getId()]; 52248 return f > m ? 1 : -1; 52249 } else return p == null ? -1 : 1; 52250 }); 52251 const a = hr(e) && !!o.length; 52252 a && (n = [ 52253 ...new Set( 52254 // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness 52255 n.map((c) => i?.getShowRowGroupCol(c.getId()) ?? c) 52256 ) 52257 ]); 52258 const l = /* @__PURE__ */ new Map(); 52259 return n.forEach((c, u) => l.set(c, u)), a && o.forEach((c) => { 52260 const u = i.getShowRowGroupCol(c.getId()); 52261 l.set(c, l.get(u)); 52262 }), l; 52263 } 52264 getColumnsWithSortingOrdered() { 52265 return [...this.getIndexedSortMap().entries()].sort(([e, t], [i, s]) => t - s).map(([e]) => e); 52266 } 52267 // used by server side row models, to sent sort to server 52268 getSortModel() { 52269 return this.getColumnsWithSortingOrdered().filter((e) => e.getSort()).map((e) => ({ 52270 sort: e.getSort(), 52271 colId: e.getId() 52272 })); 52273 } 52274 getSortOptions() { 52275 return this.getColumnsWithSortingOrdered().filter((e) => e.getSort()).map((e) => ({ 52276 sort: e.getSort(), 52277 column: e 52278 })); 52279 } 52280 canColumnDisplayMixedSort(e) { 52281 const t = hr(this.gos), i = !!e.getColDef().showRowGroup; 52282 return t && i; 52283 } 52284 getDisplaySortForColumn(e) { 52285 const t = this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(e); 52286 if (!this.canColumnDisplayMixedSort(e) || !t?.length) 52287 return e.getSort(); 52288 const s = e.getColDef().field != null || !!e.getColDef().valueGetter ? [e, ...t] : t, n = s[0].getSort(); 52289 return s.every((r) => r.getSort() == n) ? n : "mixed"; 52290 } 52291 getDisplaySortIndexForColumn(e) { 52292 return this.getIndexedSortMap().get(e); 52293 } 52294 setupHeader(e, t, i) { 52295 let s = 0; 52296 e.addManagedListeners(t, { 52297 movingChanged: () => { 52298 s = (/* @__PURE__ */ new Date()).getTime(); 52299 } 52300 }), i && e.addManagedElementListeners(i, { 52301 click: (o) => { 52302 const r = t.isMoving(), l = (/* @__PURE__ */ new Date()).getTime() - s < 50; 52303 r || l || this.progressSortFromEvent(t, o); 52304 } 52305 }); 52306 const n = () => { 52307 const o = t.getSort(); 52308 if (e.addOrRemoveCssClass("ag-header-cell-sorted-asc", o === "asc"), e.addOrRemoveCssClass("ag-header-cell-sorted-desc", o === "desc"), e.addOrRemoveCssClass("ag-header-cell-sorted-none", !o), t.getColDef().showRowGroup) { 52309 const l = !this.beans.showRowGroupCols?.getSourceColumnsForGroupColumn(t)?.every( 52310 (c) => t.getSort() == c.getSort() 52311 ); 52312 e.addOrRemoveCssClass("ag-header-cell-sorted-mixed", l); 52313 } 52314 }; 52315 e.addManagedEventListeners({ 52316 sortChanged: n, 52317 columnRowGroupChanged: n 52318 }); 52319 } 52320 initCol(e) { 52321 const { sort: t, initialSort: i, sortIndex: s, initialSortIndex: n } = e.colDef; 52322 t !== void 0 ? (t === "asc" || t === "desc") && (e.sort = t) : (i === "asc" || i === "desc") && (e.sort = i), s !== void 0 ? s !== null && (e.sortIndex = s) : n !== null && (e.sortIndex = n); 52323 } 52324 updateColSort(e, t, i) { 52325 t !== void 0 && (t === "desc" || t === "asc" ? this.setColSort(e, t, i) : this.setColSort(e, void 0, i)); 52326 } 52327 setColSort(e, t, i) { 52328 e.sort !== t && (e.sort = t, e.dispatchColEvent("sortChanged", i)), e.dispatchStateUpdatedEvent("sort"); 52329 } 52330 setColSortIndex(e, t) { 52331 e.sortIndex = t, e.dispatchStateUpdatedEvent("sortIndex"); 52332 } 52333 createSortIndicator(e) { 52334 return new RM(e); 52335 } 52336 getSortIndicatorSelector() { 52337 return joe; 52338 } 52339}, a_ = { 52340 moduleName: "Sort", 52341 version: Fe, 52342 beans: [$oe, Voe], 52343 apiFunctions: { 52344 onSortChanged: Uoe 52345 }, 52346 userComponents: { 52347 agSortIndicator: RM 52348 }, 52349 icons: { 52350 // show on column header when column is sorted ascending 52351 sortAscending: "asc", 52352 // show on column header when column is sorted descending 52353 sortDescending: "desc", 52354 // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true 52355 sortUnSort: "none" 52356 } 52357}, Yoe = class extends he {
52358 constructor() { 52359 super(...arguments), this.beanName = "syncSvc", this.waitingForColumns = !1; 52360 } 52361 postConstruct() { 52362 this.addManagedPropertyListener("columnDefs", (e) => this.setColumnDefs(e)); 52363 } 52364 start() { 52365 this.beans.ctrlsSvc.whenReady(this, () => { 52366 const e = this.gos.get("columnDefs"); 52367 e ? this.setColumnsAndData(e) : this.waitingForColumns = !0, this.gridReady(); 52368 }); 52369 } 52370 setColumnsAndData(e) { 52371 const { colModel: t, rowModel: i } = this.beans; 52372 t.setColumnDefs(e ?? [], "gridInitializing"), i.start(); 52373 } 52374 gridReady() { 52375 const { eventSvc: e, gos: t } = this; 52376 e.dispatchEvent({ 52377 type: "gridReady" 52378 }), Ml(t, `initialised successfully, enterprise = ${t.isModuleRegistered("EnterpriseCore")}`); 52379 } 52380 setColumnDefs(e) { 52381 const t = this.gos.get("columnDefs"); 52382 if (t) { 52383 if (this.waitingForColumns) { 52384 this.waitingForColumns = !1, this.setColumnsAndData(t); 52385 return; 52386 } 52387 this.beans.colModel.setColumnDefs(t, cd(e.source)); 52388 } 52389 } 52390}; 52391function Koe(e) { 52392 e.valueCache?.expire(); 52393} 52394function Zoe(e, t) { 52395 const { colKey: i, rowNode: s, useFormatter: n } = t, o = e.colModel.getColDefCol(i) ?? e.colModel.getCol(i); 52396 if (ai(o)) 52397 return null; 52398 const r = e.valueSvc.getValueForDisplay(o, s); 52399 return n ? e.valueSvc.formatValue(o, s, r) ?? yr(r, !0) : r; 52400} 52401var mv = class { 52402 constructor(e, t) { 52403 this.active = !0, this.nodeIdsToColumns = {}, this.mapToItems = {}, this.keepingColumns = e, this.pathRoot = { 52404 rowNode: t, 52405 children: null 52406 }, this.mapToItems[t.id] = this.pathRoot; 52407 } 52408 depthFirstSearchChangedPath(e, t) { 52409 const { rowNode: i, children: s } = e; 52410 if (s) 52411 for (let n = 0; n < s.length; ++n) 52412 this.depthFirstSearchChangedPath(s[n], t); 52413 t(i); 52414 } 52415 depthFirstSearchEverything(e, t, i) { 52416 const s = e.childrenAfterGroup; 52417 if (s) 52418 for (let n = 0, o = s.length; n < o; ++n) { 52419 const r = s[n]; 52420 r.childrenAfterGroup ? this.depthFirstSearchEverything(r, t, i) : i && t(r); 52421 } 52422 t(e); 52423 } 52424 // traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback 52425 // will be called for child nodes in addition to parent nodes. 52426 forEachChangedNodeDepthFirst(e, t = !1, i = !1) { 52427 this.active && !i ? this.depthFirstSearchChangedPath(this.pathRoot, e) : this.depthFirstSearchEverything(this.pathRoot.rowNode, e, t); 52428 } 52429 executeFromRootNode(e) { 52430 e(this.pathRoot.rowNode); 52431 } 52432 createPathItems(e) { 52433 let t = e, i = 0; 52434 for (; !this.mapToItems[t.id]; ) { 52435 const s = { 52436 rowNode: t, 52437 children: null 52438 }; 52439 this.mapToItems[t.id] = s, i++, t = t.parent; 52440 } 52441 return i; 52442 } 52443 populateColumnsMap(e, t) { 52444 if (!this.keepingColumns || !t) 52445 return; 52446 let i = e; 52447 for (; i; ) 52448 this.nodeIdsToColumns[i.id] || (this.nodeIdsToColumns[i.id] = {}), t.forEach((s) => this.nodeIdsToColumns[i.id][s.getId()] = !0), i = i.parent; 52449 } 52450 linkPathItems(e, t) { 52451 let i = e; 52452 for (let s = 0; s < t; s++) { 52453 const n = this.mapToItems[i.id], o = this.mapToItems[i.parent.id]; 52454 o.children || (o.children = []), o.children.push(n), i = i.parent; 52455 } 52456 } 52457 // called by 52458 // 1) change detection (provides cols) and 52459 // 2) groupStage if doing transaction update (doesn't provide cols) 52460 addParentNode(e, t) { 52461 if (!e || e.isRowPinned()) 52462 return; 52463 const i = this.createPathItems(e); 52464 this.linkPathItems(e, i), this.populateColumnsMap(e, t); 52465 } 52466 canSkip(e) { 52467 return this.active && !this.mapToItems[e.id]; 52468 } 52469 getValueColumnsForNode(e, t) { 52470 if (!this.keepingColumns) 52471 return t; 52472 const i = this.nodeIdsToColumns[e.id]; 52473 return t.filter((n) => i[n.getId()]); 52474 } 52475 getNotValueColumnsForNode(e, t) { 52476 if (!this.keepingColumns) 52477 return null; 52478 const i = this.nodeIdsToColumns[e.id]; 52479 return t.filter((n) => !i[n.getId()]); 52480 } 52481}, qoe = "paste", Qoe = class extends he { 52482 constructor() { 52483 super(...arguments), this.beanName = "changeDetectionSvc", this.clientSideRowModel = null; 52484 } 52485 postConstruct() { 52486 const { gos: e, rowModel: t } = this.beans; 52487 $s(e) && (this.clientSideRowModel = t), this.addManagedEventListeners({ cellValueChanged: this.onCellValueChanged.bind(this) }); 52488 } 52489 onCellValueChanged(e) { 52490 const { gos: t, rowRenderer: i } = this.beans; 52491 if (e.source === qoe || t.get("suppressChangeDetection")) 52492 return; 52493 const s = e.node, n = [s], o = this.clientSideRowModel, r = o?.rootNode; 52494 if (r && !s.isRowPinned()) { 52495 const a = t.get("aggregateOnlyChangedColumns"), l = new mv(a, r); 52496 l.addParentNode(s.parent, [e.column]), o.doAggregate(l), l.forEachChangedNodeDepthFirst((c) => { 52497 n.push(c); 52498 }); 52499 } 52500 i.refreshCells({ rowNodes: n }); 52501 } 52502}, Xoe = class extends he {
52503 constructor() { 52504 super(...arguments), this.beanName = "expressionSvc", this.cache = {}; 52505 } 52506 evaluate(e, t) { 52507 if (typeof e == "string") 52508 return this.evaluateExpression(e, t); 52509 Rt(15, { expression: e }); 52510 } 52511 evaluateExpression(e, t) { 52512 try { 52513 return this.createExpressionFunction(e)( 52514 t.value, 52515 t.context, 52516 t.oldValue, 52517 t.newValue, 52518 t.value, 52519 t.node, 52520 t.data, 52521 t.colDef, 52522 t.rowIndex, 52523 t.api, 52524 t.getValue, 52525 t.column, 52526 t.columnGroup 52527 ); 52528 } catch (i) { 52529 return Rt(16, { expression: e, params: t, e: i }), null; 52530 } 52531 } 52532 createExpressionFunction(e) { 52533 const t = this.cache; 52534 if (t[e]) 52535 return t[e]; 52536 const i = this.createFunctionBody(e), s = new Function( 52537 "x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup", 52538 i 52539 ); 52540 return t[e] = s, s; 52541 } 52542 createFunctionBody(e) { 52543 return e.indexOf("return") >= 0 ? e : "return " + e + ";"; 52544 } 52545}, Joe = class extends he { 52546 constructor() { 52547 super(...arguments), this.beanName = "valueCache", this.cacheVersion = 0; 52548 } 52549 postConstruct() { 52550 const e = this.gos; 52551 this.active = e.get("valueCache"), this.neverExpires = e.get("valueCacheNeverExpires"); 52552 } 52553 onDataChanged() { 52554 this.neverExpires || this.expire(); 52555 } 52556 expire() { 52557 this.cacheVersion++; 52558 } 52559 setValue(e, t, i) { 52560 if (this.active) { 52561 const s = this.cacheVersion; 52562 e.__cacheVersion !== s && (e.__cacheVersion = s, e.__cacheData = {}), e.__cacheData[t] = i; 52563 } 52564 } 52565 getValue(e, t) { 52566 if (!(!this.active || e.__cacheVersion !== this.cacheVersion)) 52567 return e.__cacheData[t]; 52568 } 52569}, ere = { 52570 moduleName: "ValueCache", 52571 version: Fe, 52572 beans: [Joe], 52573 apiFunctions: { 52574 expireValueCache: Koe 52575 } 52576}, tre = { 52577 moduleName: "Expression", 52578 version: Fe, 52579 beans: [Xoe] 52580}, ire = { 52581 moduleName: "ChangeDetection", 52582 version: Fe, 52583 beans: [Qoe] 52584}, sre = { 52585 moduleName: "CellApi", 52586 version: Fe, 52587 apiFunctions: { 52588 getCellValue: Zoe 52589 } 52590}, nre = class extends he { 52591 constructor() { 52592 super(...arguments), this.beanName = "valueSvc", this.initialised = !1, this.isSsrm = !1; 52593 } 52594 wireBeans(e) { 52595 this.expressionSvc = e.expressionSvc, this.colModel = e.colModel, this.valueCache = e.valueCache, this.dataTypeSvc = e.dataTypeSvc; 52596 } 52597 postConstruct() { 52598 this.initialised || this.init(); 52599 } 52600 init() { 52601 this.executeValueGetter = this.valueCache ? this.executeValueGetterWithValueCache.bind(this) : this.executeValueGetterWithoutValueCache.bind(this), this.isSsrm = Ag(this.gos), this.cellExpressions = this.gos.get("enableCellExpressions"), this.isTreeData = this.gos.get("treeData"), this.initialised = !0; 52602 const e = (t) => this.callColumnCellValueChangedHandler(t); 52603 this.eventSvc.addEventListener("cellValueChanged", e, !0), this.addDestroyFunc(() => this.eventSvc.removeEventListener("cellValueChanged", e, !0)), this.addManagedPropertyListener("treeData", (t) => this.isTreeData = t.currentValue); 52604 } 52605 /** 52606 * Use this function to get a displayable cell value. 52607 * This hides values in expanded group rows which are instead displayed by the footer row. 52608 */ 52609 getValueForDisplay(e, t) { 52610 const i = t.leafGroup && this.colModel.isPivotMode(), s = t.group && t.expanded && !t.footer && !i, n = this.gos.get("groupSuppressBlankHeader"); 52611 if (!s || n) 52612 return this.getValue(e, t); 52613 let o = !1; 52614 const r = this.gos.get("groupTotalRow"); 52615 typeof r != "function" ? o = !!r : o = !!this.gos.getCallback("groupTotalRow")({ node: this }); 52616 const a = s && o; 52617 return this.getValue(e, t, a); 52618 } 52619 getValue(e, t, i = !1) { 52620 if (this.initialised || this.init(), !t) 52621 return; 52622 const s = e.getColDef(), n = s.field, o = e.getColId(), r = t.data; 52623 let a; 52624 const l = t.groupData && t.groupData[o] !== void 0, c = !i && t.aggData && t.aggData[o] !== void 0, u = this.isSsrm && i && !!e.getColDef().aggFunc, d = this.isSsrm && t.footer && t.field && (e.getColDef().showRowGroup === !0 || e.getColDef().showRowGroup === t.field); 52625 if (this.isTreeData && c ? a = t.aggData[o] : this.isTreeData && s.valueGetter ? a = this.execute
52625ValueGetter(s.valueGetter, r, e, t) : this.isTreeData && n && r ? a = hp(r, n, e.isFieldContainsDots()) : l ? a = t.groupData[o] : c ? a = t.aggData[o] : s.valueGetter ? a = this.executeValueGetter(s.valueGetter, r, e, t) : d ? a = hp(r, t.field, e.isFieldContainsDots()) : n && r && !u && (a = hp(r, n, e.isFieldContainsDots())), this.cellExpressions && typeof a == "string" && a.indexOf("=") === 0) { 52626 const p = a.substring(1); 52627 a = this.executeValueGetter(p, r, e, t); 52628 } 52629 if (a == null) { 52630 const p = this.getOpenedGroup(t, e); 52631 if (p != null) 52632 return p; 52633 } 52634 return a; 52635 } 52636 parseValue(e, t, i, s) { 52637 const n = e.getColDef(), o = n.valueParser; 52638 if (Ie(o)) { 52639 const r = this.gos.addGridCommonParams({ 52640 node: t, 52641 data: t?.data, 52642 oldValue: s, 52643 newValue: i, 52644 colDef: n, 52645 column: e 52646 }); 52647 return typeof o == "function" ? o(r) : this.expressionSvc?.evaluate(o, r); 52648 } 52649 return i; 52650 } 52651 getDeleteValue(e, t) { 52652 return Ie(e.getColDef().valueParser) ? this.parseValue(e, t, "", this.getValueForDisplay(e, t)) ?? null : null; 52653 } 52654 formatValue(e, t, i, s, n = !0) { 52655 let o = null, r; 52656 const a = e.getColDef(); 52657 if (s ? r = s : n && (r = a.valueFormatter), r) { 52658 const l = this.gos.addGridCommonParams({ 52659 value: i, 52660 node: t, 52661 data: t ? t.data : null, 52662 colDef: a, 52663 column: e 52664 }); 52665 typeof r == "function" ? o = r(l) : o = this.expressionSvc ? this.expressionSvc.evaluate(r, l) : null; 52666 } else if (a.refData) 52667 return a.refData[i] || ""; 52668 return o == null && Array.isArray(i) && (o = i.join(", ")), o; 52669 } 52670 getOpenedGroup(e, t) { 52671 if (!this.gos.get("showOpenedGroup") || !t.getColDef().showRowGroup) 52672 return; 52673 const s = t.getColDef().showRowGroup; 52674 let n = e.parent; 52675 for (; n != null; ) { 52676 if (n.rowGroupColumn && (s === !0 || s === n.rowGroupColumn.getColId())) 52677 return n.key; 52678 n = n.parent; 52679 } 52680 } 52681 /** 52682 * Sets the value of a GridCell 52683 * @param rowNode The `RowNode` to be updated 52684 * @param colKey The `Column` to be updated 52685 * @param newValue The new value to be set 52686 * @param eventSource The event source 52687 * @returns `True` if the value has been updated, otherwise`False`. 52688 */ 52689 setValue(e, t, i, s) { 52690 const n = this.colModel.getColDefCol(t); 52691 if (!e || !n) 52692 return !1; 52693 ai(e.data) && (e.data = {}); 52694 const { field: o, valueSetter: r } = n.getColDef(); 52695 if (ai(o) && ai(r)) 52696 return Ae(17), !1; 52697 if (this.dataTypeSvc && !this.dataTypeSvc.checkType(n, i)) 52698 return Ae(135), !1; 52699 const a = this.gos.addGridCommonParams({ 52700 node: e, 52701 data: e.data, 52702 oldValue: this.getValue(n, e), 52703 newValue: i, 52704 colDef: n.getColDef(), 52705 column: n 52706 }); 52707 a.newValue = i; 52708 let l; 52709 if (Ie(r) ? typeof r == "function" ? l = r(a) : l = this.expressionSvc?.evaluate(r, a) : l = this.setValueUsingField(e.data, o, i, n.isFieldContainsDots()), l === void 0 && (l = !0), !l) 52710 return !1; 52711 e.resetQuickFilterAggregateText(), this.valueCache?.onDataChanged(); 52712 const c = this.getValue(n, e); 52713 return this.eventSvc.dispatchEvent({ 52714 type: "cellValueChanged", 52715 event: null, 52716 rowIndex: e.rowIndex, 52717 rowPinned: e.rowPinned, 52718 column: a.column, 52719 colDef: a.colDef, 52720 data: e.data, 52721 node: e, 52722 oldValue: a.oldValue, 52723 newValue: c, 52724 value: c, 52725 source: s 52726 }), !0; 52727 } 52728 callColumnCellValueChangedHandler(e) { 52729 const t = e.colDef.onCellValueChanged; 52730 typeof t == "function" && this.beans.frameworkOverrides.wrapOutgoing(() => { 52731 t({ 52732 node: e.node, 52733 data: e.data, 52734 oldValue: e.oldValue, 52735 newValue: e.newValue, 52736 colDef: e.colDef, 52737 column: e.column, 52738 api: e.api, 52739 context: e.context 52740 }); 52741 }); 52742 } 52743 setValueUsingField(e, t, i, s) { 52744 if (!t) 52745 return !1; 52746 let n = !1; 52747 if (!s) 52748 n = e[t] === i, n || (e[t] = i); 52749 else { 52750 const o = t.split("."); 52751 let r = e; 52752 for (; o.length > 0 && r; ) { 52753 const a = o.shift();
52754 o.length === 0 ? (n = r[a] === i, n || (r[a] = i)) : r = r[a]; 52755 } 52756 } 52757 return !n; 52758 } 52759 executeValueGetterWithValueCache(e, t, i, s) { 52760 const n = i.getColId(), o = this.valueCache.getValue(s, n); 52761 if (o !== void 0) 52762 return o; 52763 const r = this.executeValueGetterWithoutValueCache(e, t, i, s); 52764 return this.valueCache.setValue(s, n, r), r; 52765 } 52766 executeValueGetterWithoutValueCache(e, t, i, s) { 52767 const n = this.gos.addGridCommonParams({ 52768 data: t, 52769 node: s, 52770 column: i, 52771 colDef: i.getColDef(), 52772 getValue: this.getValueCallback.bind(this, s) 52773 }); 52774 let o; 52775 return typeof e == "function" ? o = e(n) : o = this.expressionSvc?.evaluate(e, n), o; 52776 } 52777 getValueCallback(e, t) { 52778 const i = this.colModel.getColDefCol(t); 52779 return i ? this.getValue(i, e) : null; 52780 } 52781 // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col 52782 getKeyForNode(e, t) { 52783 const i = this.getValue(e, t), s = e.getColDef().keyCreator; 52784 let n = i; 52785 if (s) { 52786 const o = this.gos.addGridCommonParams({ 52787 value: i, 52788 colDef: e.getColDef(), 52789 column: e, 52790 node: t, 52791 data: t.data 52792 }); 52793 n = s(o); 52794 } 52795 return typeof n == "string" || n == null || (n = String(n), n === "[object Object]" && Ae(121)), n; 52796 } 52797}, ore = { 52798 moduleName: "CommunityCore", 52799 version: Fe, 52800 beans: [ 52801 toe, 52802 gie, 52803 nne, 52804 YX, 52805 Boe, 52806 Cse, 52807 Zne, 52808 ooe, 52809 UX, 52810 Moe, 52811 xoe, 52812 zoe, 52813 nre, 52814 Jne, 52815 Kne, 52816 eoe, 52817 rne, 52818 Yoe, 52819 Jse, 52820 ene 52821 ], 52822 icons: { 52823 // icon on select dropdowns (select cell editor, charts tool panels) 52824 selectOpen: "small-down", 52825 /** @deprecated v33 */ 52826 smallDown: "small-down", 52827 /** @deprecated v33 */ 52828 colorPicker: "color-picker", 52829 /** @deprecated v33 */ 52830 smallUp: "small-up", 52831 /** @deprecated v33 */ 52832 checkboxChecked: "small-up", 52833 /** @deprecated v33 */ 52834 checkboxIndeterminate: "checkbox-indeterminate", 52835 /** @deprecated v33 */ 52836 checkboxUnchecked: "checkbox-unchecked", 52837 /** @deprecated v33 */ 52838 radioButtonOn: "radio-button-on", 52839 /** @deprecated v33 */ 52840 radioButtonOff: "radio-button-off", 52841 /** @deprecated v33 */ 52842 smallLeft: "small-left", 52843 /** @deprecated v33 */ 52844 smallRight: "small-right" 52845 }, 52846 apiFunctions: { 52847 getGridId: fie, 52848 destroy: mie, 52849 isDestroyed: vie, 52850 getGridOption: yie, 52851 setGridOption: Cie, 52852 updateGridOptions: GN 52853 }, 52854 dependsOn: [ 52855 Zse, 52856 Qie, 52857 nse, 52858 a_, 52859 coe, 52860 wse, 52861 uoe, 52862 _oe, 52863 ire, 52864 doe, 52865 Soe, 52866 Ioe, 52867 Toe, 52868 poe, 52869 sne, 52870 qse, 52871 tre 52872 ] 52873}, TM = class fc { 52874 /** 52875 * @param providedOptions 52876 * @returns Shallow copy of the provided options with global options merged in. 52877 */ 52878 static applyGlobalGridOptions(t) { 52879 if (!fc.gridOptions) 52880 return { ...t }; 52881 let i = {}; 52882 return Ss(i, fc.gridOptions, !0, !0), fc.mergeStrategy === "deep" ? Ss(i, t, !0, !0) : i = { ...i, ...t }, fc.gridOptions.context && (i.context = fc.gridOptions.context), t.context && (fc.mergeStrategy === "deep" && i.context && Ss(t.context, i.context, !0, !0), i.context = t.context), i; 52883 } 52884}; 52885TM.gridOptions = void 0; 52886TM.mergeStrategy = "shallow"; 52887var rre = TM; 52888function are(e, t, i) { 52889 if (!t) 52890 return Rt(11), {}; 52891 const s = i; 52892 let n; 52893 if (!s?.setThemeOnGridDiv) { 52894 const r = document.createElement("div"); 52895 r.style.height = "100%", e.appendChild(r), e = r, n = () => e.remove(); 52896 } 52897 return new cre().create( 52898 e, 52899 t, 52900 (r) => { 52901 const a = new hie(e); 52902 r.createBean(a); 52903 }, 52904 void 0, 52905 i, 52906 n 52907 ); 52908} 52909var lre = 1, cre = class { 52910 create(e, t, i, s, n, o) { 52911 const r = rre.applyGlobalGridOptions(t), a = r.gridId ?? String(lre++), l = r.rowModelType ?? "clientSide", c = this.getRegisteredModules(n, a, l), u = this.createBeansList(l, c, a), d = this.createProvidedBeans(e, r, n); 52912 if (!u) 52913 return; 52914 const p = { 52915 providedBeanInstances: d, 52916 beanClasses: u, 52917 gridId: a, 52918 beanInitComparator: qte, 52919 beanDestroyComparator: Qte, 52920 derivedBeans: [Kte], 52921 destroyCallback: o 52922 }, f = new NJ(p); 52923 return this.registerModuleFeatures(f, c), i(f), f.getBean("syncSvc").start(), s && s(f), f.getBean("gridApi"); 52924 } 52925 getRegisteredModules(e, t, i) { 52926 return Xp(ore, void 0), e?.modules?.forEach((s) => Xp(s, t)), PJ(t, i); 52927 } 52928 registerModuleFeatures(e, t) { 52929 const i = e.getBean("registry"), s = e.getBean("apiFunctionSvc"); 52930 t.forEach((n) => { 52931 i.registerModule(n); 52932 const o = n.apiFunctions;
52933 o && Object.keys(o).forEach((a) => { 52934 s?.addFunction(a, o[a]); 52935 }); 52936 }); 52937 } 52938 createProvidedBeans(e, t, i) { 52939 let s = i ? i.frameworkOverrides : null; 52940 ai(s) && (s = new _N()); 52941 const n = { 52942 gridOptions: t, 52943 eGridDiv: e, 52944 globalListener: i ? i.globalListener : null, 52945 globalSyncListener: i ? i.globalSyncListener : null, 52946 frameworkOverrides: s 52947 }; 52948 return i && i.providedBeanInstances && Object.assign(n, i.providedBeanInstances), n; 52949 } 52950 createBeansList(e, t, i) { 52951 const n = { 52952 clientSide: "ClientSideRowModel", 52953 infinite: "InfiniteRowModel", 52954 serverSide: "ServerSideRowModel", 52955 viewport: "ViewportRowModel" 52956 }[e]; 52957 if (!n) { 52958 Ww(201, { rowModelType: e }, `Unknown rowModelType ${e}.`); 52959 return; 52960 } 52961 if (!lN(n, i, e)) { 52962 Ww( 52963 200, 52964 { 52965 reasonOrId: `rowModelType = '${e}'`, 52966 moduleName: n, 52967 gridScoped: cM(), 52968 gridId: i, 52969 rowModelType: e 52970 }, 52971 `Missing module ${n}Module for rowModelType ${e}. 52972If upgrading from before v33, see ${Md}/upgrading-to-ag-grid-33/#changes-to-modules/` 52973 ); 52974 return; 52975 } 52976 const o = /* @__PURE__ */ new Set(); 52977 return t.forEach((r) => r.beans?.forEach((a) => o.add(a))), Array.from(o); 52978 } 52979}; 52980function kr(e) { 52981 const t = e.rowModel; 52982 return t.getType() === "clientSide" ? t : void 0; 52983} 52984function Qy(e) { 52985 const t = e.rowModel; 52986 return t.getType() === "infinite" ? t : void 0; 52987} 52988function l_(e) { 52989 const t = e.rowModel; 52990 return t.getType() === "serverSide" ? t : void 0; 52991} 52992var ure = [ 52993 "columnEverythingChanged", 52994 "newColumnsLoaded", 52995 "columnPivotModeChanged", 52996 "pivotMaxColumnsExceeded", 52997 "columnRowGroupChanged", 52998 "expandOrCollapseAll", 52999 "columnPivotChanged", 53000 "gridColumnsChanged", 53001 "columnValueChanged", 53002 "columnMoved", 53003 "columnVisible", 53004 "columnPinned", 53005 "columnGroupOpened", 53006 "columnResized", 53007 "displayedColumnsChanged", 53008 "virtualColumnsChanged", 53009 "columnHeaderMouseOver", 53010 "columnHeaderMouseLeave", 53011 "columnHeaderClicked", 53012 "columnHeaderContextMenu", 53013 "asyncTransactionsFlushed", 53014 "rowGroupOpened", 53015 "rowDataUpdated", 53016 "pinnedRowDataChanged", 53017 "rangeSelectionChanged", 53018 "cellSelectionChanged", 53019 "chartCreated", 53020 "chartRangeSelectionChanged", 53021 "chartOptionsChanged", 53022 "chartDestroyed", 53023 "toolPanelVisibleChanged", 53024 "toolPanelSizeChanged", 53025 "modelUpdated", 53026 "cutStart", 53027 "cutEnd", 53028 "pasteStart", 53029 "pasteEnd", 53030 "fillStart", 53031 "fillEnd", 53032 "cellSelectionDeleteStart", 53033 "cellSelectionDeleteEnd", 53034 "rangeDeleteStart", 53035 "rangeDeleteEnd", 53036 "undoStarted", 53037 "undoEnded", 53038 "redoStarted", 53039 "redoEnded", 53040 "cellClicked", 53041 "cellDoubleClicked", 53042 "cellMouseDown", 53043 "cellContextMenu", 53044 "cellValueChanged", 53045 "cellEditRequest", 53046 "rowValueChanged", 53047 "headerFocused", 53048 "cellFocused", 53049 "rowSelected", 53050 "selectionChanged", 53051 "tooltipShow", 53052 "tooltipHide", 53053 "cellKeyDown", 53054 "cellMouseOver", 53055 "cellMouseOut", 53056 "filterChanged", 53057 "filterModified", 53058 "filterOpened", 53059 "advancedFilterBuilderVisibleChanged", 53060 "sortChanged", 53061 "virtualRowRemoved", 53062 "rowClicked", 53063 "rowDoubleClicked", 53064 "gridReady", 53065 "gridPreDestroyed", 53066 "gridSizeChanged", 53067 "viewportChanged", 53068 "firstDataRendered", 53069 "dragStarted", 53070 "dragStopped", 53071 "dragCancelled", 53072 "rowEditingStarted", 53073 "rowEditingStopped", 53074 "cellEditingStarted", 53075 "cellEditingStopped", 53076 "bodyScroll", 53077 "bodyScrollEnd", 53078 "paginationChanged", 53079 "componentStateChanged", 53080 "storeRefreshed", 53081 "stateUpdated", 53082 "columnMenuVisibleChanged", 53083 "contextMenuVisibleChanged", 53084 "rowDragEnter", 53085 "rowDragMove", 53086 "rowDragLeave", 53087 "rowDragEnd", 53088 "rowDragCancel" 53089], dre = [ 53090 "scrollbarWidthChanged", 53091 "keyShortcutChangedCellStart", 53092 "keyShortcutChangedCellEnd", 53093 "pinnedHeightChanged", 53094 "cellFocusCleared", 53095 "fullWidthRowFocused", 53096 "checkboxChanged", 53097 "heightScaleChanged", 53098 "suppressMovableColumns", 53099 "suppressMenuHide", 53100 "suppressFieldDotNotation", 53101 "columnPanelItemDragStart", 53102 "columnPanelItemDragEnd", 53103 "bodyHeightChanged", 53104 "columnContainerWidthChanged", 53105 "displayedColumnsWidthChanged", 53106 "scrollVisibilityChanged", 53107 "scrollGapChanged", 53108 "columnHoverChanged", 53109 "flashCells",
53110 "paginationPixelOffsetChanged", 53111 "displayedRowsChanged", 53112 "leftPinnedWidthChanged", 53113 "rightPinnedWidthChanged", 53114 "rowContainerHeightChanged", 53115 "headerHeightChanged", 53116 "columnGroupHeaderHeightChanged", 53117 "columnHeaderHeightChanged", 53118 "gridStylesChanged", 53119 "storeUpdated", 53120 "filterDestroyed", 53121 "rowDataUpdateStarted", 53122 "rowCountReady", 53123 "advancedFilterEnabledChanged", 53124 "dataTypesInferred", 53125 "fieldValueChanged", 53126 "fieldPickerValueSelected", 53127 "richSelectListRowSelected", 53128 "sideBarUpdated", 53129 "alignedGridScroll", 53130 "alignedGridColumn", 53131 "gridOptionsChanged", 53132 "chartTitleEdit", 53133 "recalculateRowBounds", 53134 "stickyTopOffsetChanged", 53135 "overlayExclusiveChanged", 53136 "beforeRefreshModel" 53137], c_ = [...ure, ...dre], hre = class extends he { 53138 constructor() { 53139 super(...arguments), this.beanName = "localeSvc"; 53140 } 53141 getLocaleTextFunc() { 53142 const e = this.gos, t = e.getCallback("getLocaleText"); 53143 if (t) 53144 return (s, n, o) => t({ 53145 key: s, 53146 defaultValue: n, 53147 variableValues: o 53148 }); 53149 const i = e.get("localeText"); 53150 return (s, n, o) => { 53151 let r = i && i[s]; 53152 if (r && o && o.length) { 53153 let a = 0; 53154 for (; !(a >= o.length || r.indexOf("${variable}") === -1); ) 53155 r = r.replace("${variable}", o[a++]); 53156 } 53157 return r ?? n; 53158 }; 53159 } 53160}, pre = [ 53161 "overlayLoadingTemplate", 53162 "overlayNoRowsTemplate", 53163 "gridId", 53164 "quickFilterText", 53165 "rowModelType", 53166 "editType", 53167 "domLayout", 53168 "clipboardDelimiter", 53169 "rowGroupPanelShow", 53170 "multiSortKey", 53171 "pivotColumnGroupTotals", 53172 "pivotRowTotals", 53173 "pivotPanelShow", 53174 "fillHandleDirection", 53175 "groupDisplayType", 53176 "treeDataDisplayType", 53177 "colResizeDefault", 53178 "tooltipTrigger", 53179 "serverSidePivotResultFieldSeparator", 53180 "columnMenu", 53181 "tooltipShowMode", 53182 "grandTotalRow" 53183 // 'treeDataChildrenField', 53184], gre = [ 53185 "components", 53186 "rowStyle", 53187 "context", 53188 "autoGroupColumnDef", 53189 "localeText", 53190 "icons", 53191 "datasource", 53192 "dragAndDropImageComponentParams", 53193 "serverSideDatasource", 53194 "viewportDatasource", 53195 "groupRowRendererParams", 53196 "aggFuncs", 53197 "fullWidthCellRendererParams", 53198 "defaultColGroupDef", 53199 "defaultColDef", 53200 "defaultCsvExportParams", 53201 "defaultExcelExportParams", 53202 "columnTypes", 53203 "rowClassRules", 53204 "detailCellRendererParams", 53205 "loadingCellRendererParams", 53206 "loadingOverlayComponentParams", 53207 "noRowsOverlayComponentParams", 53208 "popupParent", 53209 "statusBar", 53210 "chartThemeOverrides", 53211 "customChartThemes", 53212 "chartToolPanelsDef", 53213 "dataTypeDefinitions", 53214 "advancedFilterParent", 53215 "advancedFilterBuilderParams", 53216 "initialState", 53217 "autoSizeStrategy", 53218 "selectionColumnDef" 53219], fre = [ 53220 "sortingOrder", 53221 "alignedGrids", 53222 "rowData", 53223 "columnDefs", 53224 "excelStyles", 53225 "pinnedTopRowData", 53226 "pinnedBottomRowData", 53227 "chartThemes", 53228 "rowClass", 53229 "paginationPageSizeSelector" 53230], u_ = [ 53231 "rowHeight", 53232 "detailRowHeight", 53233 "rowBuffer", 53234 "headerHeight", 53235 "groupHeaderHeight", 53236 "groupLockGroupColumns", 53237 "floatingFiltersHeight", 53238 "pivotHeaderHeight", 53239 "pivotGroupHeaderHeight", 53240 "groupDefaultExpanded", 53241 "pivotDefaultExpanded", 53242 "viewportRowModelPageSize", 53243 "viewportRowModelBufferSize", 53244 "autoSizePadding", 53245 "maxBlocksInCache", 53246 "maxConcurrentDatasourceRequests", 53247 "tooltipShowDelay", 53248 "tooltipHideDelay", 53249 "cacheOverflowSize", 53250 "paginationPageSize", 53251 "cacheBlockSize", 53252 "infiniteInitialRowCount", 53253 "serverSideInitialRowCount", 53254 "scrollbarWidth", 53255 "asyncTransactionWaitMillis", 53256 "blockLoadDebounceMillis", 53257 "keepDetailRowsCount", 53258 "undoRedoCellEditingLimit", 53259 "cellFlashDuration", 53260 "cellFadeDuration", 53261 "tabIndex", 53262 "pivotMaxGeneratedColumns" 53263], mre = ["theme", "rowSelection"], vre = [ 53264 "cellSelection", 53265 "sideBar", 53266 "suppressGroupChangesColumnVisibility", 53267 "groupAggFiltering", 53268 "suppressStickyTotalRow", 53269 "groupHideParentOfSingleChild" 53270], d_ = [ 53271 "loadThemeGoogleFonts", 53272 "suppressMakeColumnVisibleAfterUnGroup", 53273 "suppressRowClickSelection", 53274 "suppressCellFocus", 53275 "suppressHeaderFocus", 53276 "suppressHorizontalScroll", 53277 "groupSelectsChildren", 53278 "alwaysShowHorizontalScroll", 53279 "alwaysShowVerticalScroll", 53280 "debug", 53281 "enableBrowserTooltips", 53282 "enableCellExpressions", 53283 "groupSuppressBlankHeader", 53284 "suppressMenuHide", 53285 "suppressRowDeselection", 53286 "unSortIcon", 53287 "suppressMultiSort", 53288 "alwaysMultiSort", 53289 "singleClickEdit", 53290 "suppressLoadingOverlay", 53291 "suppressNoRowsOverlay", 53292 "suppressAutoSize", 53293 "skipHeaderOnAutoSize", 53294 "suppressColumnMoveAnimation", 53295 "suppressMoveWhenColumnDragging", 53296 "suppressMovableColumns", 53297 "suppressFieldDotNotation", 53298 "enableRangeSelection", 53299 "enableRangeHandle", 53300 "enableFillHandle", 53301 "suppressClearOnFillReduction", 53302 "deltaSort", 53303 "suppressTouch", 53304 "allowContextMenuWithControlKey", 53305 "suppressContextMenu", 53306 "suppressDragLeaveHidesColumns", 53307 "suppressRowGroupHidesColumns", 53308 "suppressMiddleClickScrolls", 53309 "suppressPreventDefaultOnMouseWheel", 53310 "suppressCopyRowsToClipboard", 53311 "copyHeadersToClipboard", 53312 "copyGroupHeadersToClipboard", 53313 "pivotMode", 53314 "suppressAggFuncInHeader", 53315 "suppressColumnVirtualisation", 53316 "alwaysAggregateAtRootLevel", 53317 "suppressFocusAfterRefresh", 53318 "functionsReadOnly", 53319 "animateRows", 53320 "groupSelectsFiltered", 53321 "groupRemoveSingleChildren", 53322 "groupRemoveLowestSingleChildren", 53323 "enableRtl", 53324 "suppressClickEdit", 53325 "rowDragEntireRow", 53326 "rowDragManaged", 53327 "suppressRowDrag", 53328 "suppressMoveWhenRowDragging", 53329 "rowDragMultiRow", 53330 "enableGroupEdit", 53331 "embedFullWidthRows", 53332 "suppressPaginationPanel", 53333 "groupHideOpenParents", 53334 "groupAllowUnbalanced", 53335 "pagination", 53336 "paginationAutoPageSize", 53337 "suppressScrollOnNewData", 53338 "suppressScrollWhenPopupsAreOpen", 53339 "purgeClosedRowNodes", 53340 "cacheQuickFilter", 53341 "includeHiddenColumnsInQuickFilter", 53342 "ensureDomOrder", 53343 "accentedSort", 53344 "suppressChangeDetection", 53345 "valueCache", 53346 "valueCacheNeverExpires", 53347 "aggregateOnlyChangedColumns", 53348 "suppressAnimationFrame", 53349 "suppressExcelExport", 53350 "suppressCsvExport", 53351 "includeHiddenColumnsInAdvancedFilter", 53352 "suppressMultiRangeSelection", 53353 "enterNavigatesVerticallyAfterEdit", 53354 "enterNavigatesVertically", 53355 "suppressPropertyNamesCheck", 53356 "rowMultiSelectWithClick", 53357 "suppressRowHoverHighlight", 53358 "suppressRowTransform", 53359 "suppressClipboardPaste", 53360 "suppressLastEmptyLineOnPaste", 53361 "enableCharts", 53362 "suppressMaintainUnsortedOrder", 53363 "enableCellTextSelection", 53364 "suppressBrowserResizeObserver", 53365 "suppressMaxRenderedRowRestriction", 53366 "excludeChildrenWhenTreeDataFiltering", 53367 "tooltipMouseTrack", 53368 "tooltipInteraction", 53369 "keepDetailRows", 53370 "paginateChildRows", 53371 "preventDefaultOnContextMenu", 53372 "undoRedoCellEditing", 53373 "allowDragFromColumnsToolPanel", 53374 "pivotSuppressAutoColumn", 53375 "suppressExpandablePivotGroups", 53376 "debounceVerticalScrollbar", 53377 "detailRowAutoHeight", 53378 "serverSideSortAllLevels", 53379 "serverSideEnableClientSideSort", 53380 "serverSideOnlyRefreshFilteredGroups", 53381 "suppressAggFilteredOnly", 53382 "showOpenedGroup", 53383 "suppressClipboardApi", 53384 "suppressModelUpdateAfterUpdateTransaction", 53385 "stopEditingWhenCellsLoseFocus", 53386 "groupMaintainOrder", 53387 "columnHoverHighlight", 53388 "readOnlyEdit", 53389 "suppressRowVirtualisation", 53390 "enableCellEditingOnBackspace", 53391 "resetRowDataOnUpdate", 53392 "removePivotHeaderRowWhenSingleValueColumn", 53393 "suppressCopySingleCellRanges", 53394 "suppressGroupRowsSticky", 53395 "suppressCutToClipboard", 53396 "rowGroupPanelSuppressSort", 53397 "allowShowChangeAfterFilter", 53398 "enableAdvancedFilter", 53399 "masterDetail", 53400 "treeData", 53401 "reactiveCustomComponents", 53402 "applyQuickFilterBeforePivotOrAgg", 53403 "suppressServerSideFullWidthLoadingRow", 53404 "suppressAdvancedFilterEval", 53405 "loading", 53406 "maintainColumnOrder", 53407 "enableStrictPivotColumnOrder", 53408 "suppressSetFilterByDefault" 53409], yre = [ 53410 "doesExternalFilterPass", 53411 "processPivotResultColDef", 53412 "processPivotResultColGroupDef", 53413 "getBusinessKeyForNode", 53414 "isRowSelectable", 53415 "rowDragText", 53416 "groupRowRenderer", 53417 "dragAndDropImageComponent", 53418 "fullWidthCellRenderer", 53419 "loadingCellRenderer", 53420 "loadingOverlayComponent", 53421 "noRowsOverlayComponent", 53422 "detailCellRenderer", 53423 "quickFilterParser", 53424 "quickFilterMatcher", 53425 "getLocaleText", 53426 "isExternalFilterPresent", 53427 "getRowHeight", 53428 "getRowClass", 53429 "getRowStyle", 53430 "getContextMenuItems", 53431 "getMainMenuItems", 53432 "processRowPostCreate", 53433 "processCellForClipboard", 53434 "getGroupRowAgg", 53435 "isFullWidthRow", 53436 "sendToClipboard",
53437 "focusGridInnerElement", 53438 "navigateToNextHeader", 53439 "tabToNextHeader", 53440 "navigateToNextCell", 53441 "tabToNextCell", 53442 "processCellFromClipboard", 53443 "getDocument", 53444 "postProcessPopup", 53445 "getChildCount", 53446 "getDataPath", 53447 "isRowMaster", 53448 "postSortRows", 53449 "processHeaderForClipboard", 53450 "processUnpinnedColumns", 53451 "processGroupHeaderForClipboard", 53452 "paginationNumberFormatter", 53453 "processDataFromClipboard", 53454 "getServerSideGroupKey", 53455 "isServerSideGroup", 53456 "createChartContainer", 53457 "getChartToolbarItems", 53458 "fillOperation", 53459 "isApplyServerSideTransaction", 53460 "getServerSideGroupLevelParams", 53461 "isServerSideGroupOpenByDefault", 53462 "isGroupOpenByDefault", 53463 "initialGroupOrderComparator", 53464 "loadingCellRendererSelector", 53465 "getRowId", 53466 "chartMenuItems", 53467 "groupTotalRow", 53468 "alwaysPassFilter" 53469], uS = [ 53470 ...fre, 53471 ...gre, 53472 ...pre, 53473 ...u_, 53474 ...yre, 53475 ...d_, 53476 ...vre, 53477 ...mre 53478], Cre = class { 53479 wrap(e, t, i, s) { 53480 const n = this.createWrapper(e, s); 53481 return t?.forEach((o) => { 53482 this.createMethod(n, o, !0); 53483 }), i?.forEach((o) => { 53484 this.createMethod(n, o, !1); 53485 }), n; 53486 } 53487 createMethod(e, t, i) { 53488 e.addMethod(t, this.createMethodProxy(e, t, i)); 53489 } 53490 createMethodProxy(e, t, i) { 53491 return function() { 53492 return e.hasMethod(t) ? e.callMethod(t, arguments) : (i && Ae(49, { methodName: t }), null); 53493 }; 53494 } 53495}, bre = class extends nh { 53496 constructor() { 53497 super( 53498 /* html */ 53499 '<div class="ag-tooltip"></div>' 53500 ); 53501 } 53502 // will need to type params 53503 init(e) { 53504 const { value: t } = e; 53505 this.getGui().textContent = yr(t, !0); 53506 } 53507}; 53508function h_(e) { 53509 const { inputValue: t, allSuggestions: i, hideIrrelevant: s, filterByPercentageOfBestMatch: n, addSequentialWeight: o } = e; 53510 let r = i.map((c, u) => ({ 53511 value: c, 53512 relevance: Sre(t.toLowerCase(), c.toLocaleLowerCase(), o), 53513 idx: u 53514 })); 53515 if (r.sort((c, u) => u.relevance - c.relevance), s && (r = r.filter((c) => c.relevance !== 0)), r.length > 0 && n && n > 0) { 53516 const u = r[0].relevance * n; 53517 r = r.filter((d) => u - d.relevance < 0); 53518 } 53519 const a = [], l = []; 53520 for (const c of r) 53521 a.push(c.value), l.push(c.idx); 53522 return { values: a, indices: l }; 53523} 53524function wre(e) { 53525 const t = [], i = e.length; 53526 for (let s = 1; s <= i; s++) 53527 for (let n = 0; n <= i - s; n++) { 53528 const o = n + s - 1; 53529 t.push(e.slice(n, o + 1)); 53530 } 53531 return t; 53532} 53533function Sre(e, t, i = !1) { 53534 const s = e.replace(/\s/g, ""), n = t.replace(/\s/g, ""), o = s.length, r = n.length, a = new Array(o + 1).fill(null).map(() => new Array(r + 1).fill(0)); 53535 for (let d = 0; d <= o; d += 1) 53536 a[d][0] = d; 53537 for (let d = 0; d <= r; d += 1) 53538 a[0][d] = d; 53539 for (let d = 1; d <= o; d++) 53540 for (let p = 1; p <= r; p++) 53541 s[d - 1] === n[p - 1] ? a[d][p] = a[d - 1][p - 1] : a[d][p] = 1 + Math.min(a[d][p - 1], Math.min(a[d - 1][p], a[d - 1][p - 1])); 53542 const l = a[o][r]; 53543 let u = Math.max(o, r) - l; 53544 if (i) { 53545 const d = wre(s); 53546 for (let p = 0; p < d.length; p++) { 53547 const f = d[p]; 53548 n.indexOf(f) !== -1 && (u += 1, u *= f.length); 53549 } 53550 } 53551 return u; 53552} 53553function xre(e, t) { 53554 if (typeof e != "number") 53555 return ""; 53556 const i = t(), s = i("thousandSeparator", ","), n = i("decimalSeparator", "."); 53557 return e.toString().replace(".", n).replace(/(\d)(?=(\d{3})+(?!\d))/g, `$1${s}`); 53558} 53559var Mre = class extends he { 53560 getFileName(e) { 53561 const t = this.getDefaultFileExtension(); 53562 return (e == null || !e.length) && (e = this.getDefaultFileName()), e.indexOf(".") === -1 ? `${e}.${t}` : e; 53563 } 53564 getData(e) { 53565 const t = this.createSerializingSession(e); 53566 return this.beans.gridSerializer.serialize(t, e); 53567 } 53568 getDefaultFileName() { 53569 return `export.${this.getDefaultFileExtension()}`; 53570 } 53571}, Are = class { 53572 constructor(e) { 53573 this.groupColumns = []; 53574 const { 53575 colModel: t, 53576 rowGroupColsSvc: i, 53577 colNames: s, 53578 valueSvc: n, 53579 gos: o, 53580 processCellCallback: r, 53581 processHeaderCallback: a, 53582 processGroupHeaderCallback: l, 53583 processRowGroupCallback: c 53584 } = e; 53585 this.colModel = t, this.rowGroupColsSvc = i, this.colNames = s, this.valueSvc = n, this.gos = o, this.processCellCallback = r, this.processHeaderCallback = a, this.processGroupHeaderCallback = l, this.processRowGroupCallback = c; 53586 } 53587 prepare(e) { 53588 this.groupColumns = e.filter((t) => !!t.getColDef().showRowGroup); 53589 } 53590 extractHeaderValue(e) { 53591 return this.getHeaderName(this.processHeaderCallback, e) ?? ""; 53592 } 53593 extractRowCellValue(e, t, i, s, n) { 53594 const r = (!this.gos.get("groupHideOpenParents") || n.footer) && this.shouldRenderGroupSummaryCell(n, e, t) ? this.createValueForGroupNode(e, n) : this.valueSvc.getValue(e, n); 53595 return this.processCell({ 53596 accumulatedRowIndex: i, 53597 rowNode: n, 53598 column: e, 53599 value: r, 53600 processCellCallback: this.processCellCallback, 53601 type: s 53602 }); 53603 } 53604 shouldRenderGroupSummaryCell(e, t, i) { 53605 if (!(e.group && !this.gos.get("treeData"))) 53606 return !1; 53607 if (this.groupColumns.indexOf(t) !== -1) { 53608 if (e.groupData?.[t.getId()] !== void 0 || Ag(this.gos) && e.group) 53609 return !0; 53610 if (e.footer && e.level === -1) { 53611 const r = t.getColDef(); 53612 return r == null || r.showRowGroup === !0 || r.showRowGroup === this.rowGroupColsSvc?.columns[0].getId(); 53613 } 53614 } 53615 const o = nM(this.gos, this.colModel.isPivotMode()); 53616 return i === 0 && o; 53617 } 53618 getHeaderName(e, t) { 53619 return e ? e(this.gos.addGridCommonParams({ column: t })) : this.colNames.getDisplayNameForColumn(t, "csv", !0); 53620 } 53621 createValueForGroupNode(e, t) { 53622 if (this.processRowGroupCallback) 53623 return this.processRowGroupCallback(this.gos.addGridCommonParams({ column: e, node: t })); 53624 const i = this.gos.get("treeData"), s = (a) => { 53625 if (i) 53626 return a.key; 53627 const l = a.groupData?.[e.getId()]; 53628 return !l || !a.rowGroupColumn || a.rowGroupColumn.getColDef().useValueFormatterForExport === !1 ? l : this.valueSvc.formatValue(a.rowGroupColumn, a, l) ?? l; 53629 }, n = t.footer, o = [s(t)]; 53630 if (!nX(this.gos)) 53631 for (; t.parent; ) 53632 t = t.parent, o.push(s(t)); 53633 const r = o.reverse().join(" -> "); 53634 return n ? `Total ${r}` : r; 53635 } 53636 processCell(e) { 53637 const { accumulatedRowIndex: t, rowNode: i, column: s, value: n, processCellCallback: o, type: r } = e; 53638 return o ? { 53639 value: o( 53640 this.gos.addGridCommonParams({ 53641 accumulatedRowIndex: t, 53642 column: s, 53643 node: i, 53644 value: n, 53645 type: r, 53646 parseValue: (a) => this.valueSvc.parseValue( 53647 s, 53648 i, 53649 a, 53650 this.valueSvc.getValue(s, i) 53651 ), 53652 formatValue: (a) => this.valueSvc.formatValue(s, i, a) ?? a 53653 }) 53654 ) ?? "" 53655 } : s.getColDef().useValueFormatterForExport !== !1 ? {
53656 value: n ?? "", 53657 valueFormatted: this.valueSvc.formatValue(s, i, n) 53658 } : { value: n ?? "" }; 53659 } 53660}; 53661function Dre(e, t) { 53662 const i = document.defaultView || window; 53663 if (!i) { 53664 Ae(52); 53665 return; 53666 } 53667 const s = document.createElement("a"), n = i.URL.createObjectURL(t); 53668 s.setAttribute("href", n), s.setAttribute("download", e), s.style.display = "none", document.body.appendChild(s), s.dispatchEvent( 53669 new MouseEvent("click", { 53670 bubbles: !1, 53671 cancelable: !0, 53672 view: i 53673 }) 53674 ), document.body.removeChild(s), i.setTimeout(() => { 53675 i.URL.revokeObjectURL(n); 53676 }, 0); 53677} 53678var Ere = { 53679 enableBrowserTooltips: !0, 53680 tooltipTrigger: !0, 53681 tooltipMouseTrack: !0, 53682 tooltipShowMode: !0, 53683 tooltipInteraction: !0, 53684 defaultColGroupDef: !0, 53685 suppressAutoSize: !0, 53686 skipHeaderOnAutoSize: !0, 53687 autoSizeStrategy: !0, 53688 components: !0, 53689 stopEditingWhenCellsLoseFocus: !0, 53690 undoRedoCellEditing: !0, 53691 undoRedoCellEditingLimit: !0, 53692 excelStyles: !0, 53693 cacheQuickFilter: !0, 53694 customChartThemes: !0, 53695 chartThemeOverrides: !0, 53696 chartToolPanelsDef: !0, 53697 loadingCellRendererSelector: !0, 53698 localeText: !0, 53699 keepDetailRows: !0, 53700 keepDetailRowsCount: !0, 53701 detailRowHeight: !0, 53702 detailRowAutoHeight: !0, 53703 tabIndex: !0, 53704 valueCache: !0, 53705 valueCacheNeverExpires: !0, 53706 enableCellExpressions: !0, 53707 suppressTouch: !0, 53708 suppressBrowserResizeObserver: !0, 53709 suppressPropertyNamesCheck: !0, 53710 debug: !0, 53711 dragAndDropImageComponent: !0, 53712 loadingOverlayComponent: !0, 53713 suppressLoadingOverlay: !0, 53714 noRowsOverlayComponent: !0, 53715 paginationPageSizeSelector: !0, 53716 paginateChildRows: !0, 53717 pivotPanelShow: !0, 53718 pivotSuppressAutoColumn: !0, 53719 suppressExpandablePivotGroups: !0, 53720 aggFuncs: !0, 53721 allowShowChangeAfterFilter: !0, 53722 ensureDomOrder: !0, 53723 enableRtl: !0, 53724 suppressColumnVirtualisation: !0, 53725 suppressMaxRenderedRowRestriction: !0, 53726 suppressRowVirtualisation: !0, 53727 rowDragText: !0, 53728 groupLockGroupColumns: !0, 53729 suppressGroupRowsSticky: !0, 53730 rowModelType: !0, 53731 cacheOverflowSize: !0, 53732 infiniteInitialRowCount: !0, 53733 serverSideInitialRowCount: !0, 53734 maxBlocksInCache: !0, 53735 maxConcurrentDatasourceRequests: !0, 53736 blockLoadDebounceMillis: !0, 53737 serverSideOnlyRefreshFilteredGroups: !0, 53738 serverSidePivotResultFieldSeparator: !0, 53739 viewportRowModelPageSize: !0, 53740 viewportRowModelBufferSize: !0, 53741 debounceVerticalScrollbar: !0, 53742 suppressAnimationFrame: !0, 53743 suppressPreventDefaultOnMouseWheel: !0, 53744 scrollbarWidth: !0, 53745 icons: !0, 53746 suppressRowTransform: !0, 53747 gridId: !0, 53748 enableGroupEdit: !0, 53749 initialState: !0, 53750 processUnpinnedColumns: !0, 53751 createChartContainer: !0, 53752 getLocaleText: !0, 53753 getRowId: !0, 53754 reactiveCustomComponents: !0, 53755 columnMenu: !0, 53756 suppressSetFilterByDefault: !0, 53757 getDataPath: !0 53758}, ln = "clientSide", Vs = "serverSide", Au = "infinite", Ire = { 53759 onGroupExpandedOrCollapsed: [ln], 53760 refreshClientSideRowModel: [ln], 53761 isRowDataEmpty: [ln], 53762 forEachLeafNode: [ln], 53763 forEachNodeAfterFilter: [ln], 53764 forEachNodeAfterFilterAndSort: [ln], 53765 resetRowHeights: [ln], 53766 applyTransaction: [ln], 53767 applyTransactionAsync: [ln], 53768 flushAsyncTransactions: [ln], 53769 getBestCostNodeSelection: [ln], 53770 getServerSideSelectionState: [Vs], 53771 setServerSideSelectionState: [Vs], 53772 applyServerSideTransaction: [Vs], 53773 applyServerSideTransactionAsync: [Vs], 53774 applyServerSideRowData: [Vs], 53775 retryServerSideLoads: [Vs], 53776 flushServerSideAsyncTransactions: [Vs], 53777 refreshServerSide: [Vs], 53778 getServerSideGroupLevelState: [Vs], 53779 refreshInfiniteCache: [Au], 53780 purgeInfiniteCache: [Au], 53781 getInfiniteRowCount: [Au], 53782 isLastRowIndexKnown: [Au, Vs], 53783 expandAll: [ln, Vs], 53784 collapseAll: [ln, Vs], 53785 onRowHeightChanged: [ln, Vs], 53786 setRowCount: [Au, Vs], 53787 getCacheBlockState: [Au, Vs] 53788}, Rre = { 53789 showLoadingOverlay: { 53790 version: "v32", 53791 message: '`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).' 53792 }, 53793 clearRangeSelection: { 53794 version: "v32.2", 53795 message: "Use `clearCellSelection` instead." 53796 }, 53797 getInfiniteRowCount: { 53798 version: "v32.2", 53799 old: "getInfiniteRowCount()", 53800 new: "getDisplayedRowCount()" 53801 }, 53802 selectAllFiltered: { 53803 version: "v33", 53804 old: "selectAllFiltered()", 53805 new: 'selectAll("filtered")' 53806 }, 53807 deselectAllFiltered: { 53808 version: "v33", 53809 old: "deselectAllFiltered()", 53810 new: 'deselectAll("filtered")' 53811 }, 53812 selectAllOnCurrentPage: { 53813 version: "v33", 53814 old: "selectAllOnCurrentPage()", 53815 new: 'selectAll("currentPage")' 53816 }, 53817 deselectAllOnCurrentPage: { 53818 version: "v33", 53819 old: "deselectAllOnCurrentPage()", 53820 new: 'deselectAll("currentPage")' 53821 } 53822}; 53823function Tre(e, t, i) { 53824 const s = Rre[e]; 53825 if (s) { 53826 const { version: o, new: r, old: a, message: l } = s, c = a ?? e; 53827 return (...u) => { 53828 const d = r ? `Please use ${r} instead. ` : ""; 53829 return dp(`Since ${o} api.${c} is deprecated. ${d}${l ?? ""}`), t.apply(t, u); 53830 }; 53831 } 53832 const n = Ire[e]; 53833 return n ? (...o) => { 53834 const r = i.rowModel.getType(); 53835 if (!n.includes(r)) { 53836 rd( 53837 `api.${e} can only be called when gridOptions.rowModelType is ${n.join(" or ")}` 53838 ); 53839 return; 53840 } 53841 return t.apply(t, o); 53842 } : t; 53843} 53844var Lre = { 53845 AdvancedFilter: 1, 53846 AllEnterprise: 1, 53847 CellSelection: 1, 53848 Clipboard: 1, 53849 ColumnMenu: 1, 53850 ColumnsToolPanel: 1, 53851 ContextMenu: 1, 53852 ExcelExport: 1, 53853 FiltersToolPanel: 1, 53854 GridCharts: 1, 53855 IntegratedCharts: 1, 53856 GroupFilter: 1, 53857 MasterDetail: 1, 53858 Menu: 1, 53859 MultiFilter: 1, 53860 Pivot: 1, 53861 RangeSelection: 1, 53862 RichSelect: 1, 53863 RowGrouping: 1, 53864 RowGroupingPanel: 1, 53865 ServerSideRowModelApi: 1, 53866 ServerSideRowModel: 1, 53867 SetFilter: 1, 53868 SideBar: 1, 53869 Sparklines: 1, 53870 StatusBar: 1, 53871 TreeData: 1, 53872 ViewportRowModel: 1 53873}, _0 = [ 53874 "TextFilter", 53875 "NumberFilter", 53876 "DateFilter", 53877 "SetFilter", 53878 "MultiFilter", 53879 "GroupFilter", 53880 "CustomFilter" 53881], kre = { 53882 EditCore: [ 53883 "TextEditor", 53884 "NumberEditor", 53885 "DateEditor", 53886 "CheckboxEditor", 53887 "LargeTextEditor", 53888 "SelectEditor", 53889 "RichSelect", 53890 "CustomEditor" 53891 ], 53892 CheckboxCellRenderer: ["AllCommunity"], 53893 ClientSideRowModelHierarchy: ["RowGrouping", "Pivot", "TreeData"], 53894 ColumnFilter: _0, 53895 ColumnGroupHeaderComp: ["AllCommunity"], 53896 ColumnGroup: ["AllCommunity"], 53897 ColumnHeaderComp: ["AllCommunity"], 53898 ColumnMove: ["AllCommunity"], 53899 ColumnResize: ["AllCommunity"], 53900 CommunityCore: ["AllCommunity"], 53901 CsrmSsrmSharedApi: ["ClientSideRowModelApi", "ServerSideRowModelApi"], 53902 EnterpriseCore: ["AllEnterprise"], 53903 FilterCore: [..._0, "QuickFilter", "ExternalFilter", "AdvancedFilter"], 53904 GroupCellRenderer: ["RowGrouping", "Pivot", "TreeData", "MasterDetail", "ServerSideRowModel"], 53905 KeyboardNavigation: ["AllCommunity"], 53906 LoadingCellRenderer: ["ServerSideRowModel"], 53907 MenuCore: ["ColumnMenu", "ContextMenu"], 53908 MenuItem: ["ColumnMenu", "ContextMenu", "MultiFilter", "IntegratedCharts", "ColumnsToolPanel"], 53909 Overlay: ["AllCommunity"], 53910 PinnedColumn: ["AllCommunity"], 53911 SharedAggregation: ["RowGrouping", "Pivot", "TreeData", "ServerSideRowModel"], 53912 SharedDragAndDrop: ["AllCommunity"], 53913 SharedMasterDetail: ["MasterDetail", "ServerSideRowModel"], 53914 SharedMenu: [..._0, "ColumnMenu", "ContextMenu"], 53915 SharedPivot: ["Pivot", "ServerSideRowModel"], 53916 SharedRowGrouping: ["RowGrouping", "ServerSideRowModel"], 53917 SharedRowSelection: ["RowSelection", "ServerSideRowModel"], 53918 SkeletonCellRenderer: ["ServerSideRowModel"], 53919 Sort: ["AllCommunity"], 53920 SsrmInfiniteSharedApi: ["InfiniteRowModel", "ServerSideRowModelApi"], 53921 SharedTreeData: ["TreeData", "ServerSideRowModel"] 53922}, Pre = { 53923 InfiniteRowModel: "infinite", 53924 ClientSideRowModelApi: "clientSide", 53925 ClientSideRowModel: "clientSide", 53926 ServerSideRowModelApi: "serverSide", 53927 ServerSideRowModel: "serverSide", 53928 ViewportRowModel: "viewport" 53929}; 53930function Fre(e, t) { 53931 const i = [];
53932 return (Array.isArray(e) ? e : [e]).forEach((s) => { 53933 const n = kre[s]; 53934 n ? n.forEach((o) => { 53935 const r = Pre[o]; 53936 (!r || r === t) && i.push(o); 53937 }) : i.push(s); 53938 }), i; 53939} 53940var pd = { 53941 agSetColumnFilter: "SetFilter", 53942 agSetColumnFloatingFilter: "SetFilter", 53943 agMultiColumnFilter: "MultiFilter", 53944 agMultiColumnFloatingFilter: "MultiFilter", 53945 agGroupColumnFilter: "GroupFilter", 53946 agGroupColumnFloatingFilter: "GroupFilter", 53947 agGroupCellRenderer: "GroupCellRenderer", 53948 agGroupRowRenderer: "GroupCellRenderer", 53949 agRichSelect: "RichSelect", 53950 agRichSelectCellEditor: "RichSelect", 53951 agDetailCellRenderer: "SharedMasterDetail", 53952 agSparklineCellRenderer: "Sparklines", 53953 agDragAndDropImage: "SharedDragAndDrop", 53954 agColumnHeader: "ColumnHeaderComp", 53955 agColumnGroupHeader: "ColumnGroupHeaderComp", 53956 agSortIndicator: "Sort", 53957 agAnimateShowChangeCellRenderer: "HighlightChanges", 53958 agAnimateSlideCellRenderer: "HighlightChanges", 53959 agLoadingCellRenderer: "LoadingCellRenderer", 53960 agSkeletonCellRenderer: "SkeletonCellRenderer", 53961 agCheckboxCellRenderer: "CheckboxCellRenderer", 53962 agLoadingOverlay: "Overlay", 53963 agNoRowsOverlay: "Overlay", 53964 agTooltipComponent: "Tooltip", 53965 agReadOnlyFloatingFilter: "CustomFilter", 53966 agTextColumnFilter: "TextFilter", 53967 agNumberColumnFilter: "NumberFilter", 53968 agDateColumnFilter: "DateFilter", 53969 agDateInput: "DateFilter", 53970 agTextColumnFloatingFilter: "TextFilter", 53971 agNumberColumnFloatingFilter: "NumberFilter", 53972 agDateColumnFloatingFilter: "DateFilter", 53973 agCellEditor: "TextEditor", 53974 agSelectCellEditor: "SelectEditor", 53975 agTextCellEditor: "TextEditor", 53976 agNumberCellEditor: "NumberEditor", 53977 agDateCellEditor: "DateEditor", 53978 agDateStringCellEditor: "DateEditor", 53979 agCheckboxCellEditor: "CheckboxEditor", 53980 agLargeTextCellEditor: "LargeTextEditor", 53981 agMenuItem: "MenuItem", 53982 agColumnsToolPanel: "ColumnsToolPanel", 53983 agFiltersToolPanel: "FiltersToolPanel", 53984 agAggregationComponent: "StatusBar", 53985 agSelectedRowCountComponent: "StatusBar", 53986 agTotalRowCountComponent: "StatusBar", 53987 agFilteredRowCountComponent: "StatusBar", 53988 agTotalAndFilteredRowCountComponent: "StatusBar" 53989}, Ore = (e) => `import { ModuleRegistry } from 'ag-grid-community'; 53990${e.map( 53991 (i) => `import { ${vv(i)} } from '${Lre[i] ? "ag-grid-enterprise" : "ag-grid-community"}';` 53992).join(` 53993`)} 53994 53995ModuleRegistry.registerModules([ ${e.map(vv).join(", ")} ]); 53996 53997For more info see: ${Md}/modules/`; 53998function vv(e) { 53999 return `${e}Module`; 54000} 54001var hT = ({ 54002 reasonOrId: e, 54003 moduleName: t, 54004 gridScoped: i, 54005 gridId: s, 54006 rowModelType: n, 54007 additionalText: o 54008}) => { 54009 const r = Fre(t, n); 54010 return `Unable to use ${typeof e == "string" ? e : Gre[e]} as ${r.length > 1 ? "one of " + r.map(vv).join(", ") : vv(r[0])} is not registered${i ? " for gridId: " + s : ""}. Check if you have registered the module: 54011${Ore(r)}` + (o ? ` 54012 54013${o}` : ""); 54014}, pT = (e) => `${e} must be initialised with an AG Charts module. One of 'AgChartsCommunityModule' / 'AgChartsEnterpriseModule'. 54015 54016import { AgChartsEnterpriseModule } from 'ag-charts-enterprise'; 54017import { ModuleRegistry } from 'ag-grid-community'; 54018import { ${e} } from 'ag-grid-enterprise'; 54019 54020ModuleRegistry.registerModules([${e}.with(AgChartsEnterpriseModule)]); 54021 `, Nre = (e) => `AG Grid: Unable to use the Clipboard API (navigator.clipboard.${e}()). The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API.`, _re = { 54022 1: () => "`rowData` must be an array", 54023 2: ({ nodeId: e }) => `Duplicate node id '${e}' detected from getRowId callback, this could cause issues in your grid.`, 54024 3: () => "Calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.", 54025 4: ({ id: e }) => `Could not find row id=${e}, data item was not found for this id`, 54026 5: ({ data: e }) => [ 54027 "Could not find data item as object was not found.", 54028 e, 54029 " Consider using getRowId to help the Grid find matching row data" 54030 ], 54031 6: () => "'groupHideOpenParents' only works when specifying specific columns for 'colDef.showRowGroup'", 54032 7: () => "Pivoting is not supported with aligned grids as it may produce different c
vendor: 7,157 bytes, lines 54032-54114
54032olumns in each grid.", 54033 8: ({ key: e }) => `Unknown key for navigation ${e}`, 54034 9: ({ variable: e }) => `No value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`, 54035 10: ({ eventType: e }) => `As of v33, the '${e}' event is deprecated. Use the global 'modelUpdated' event to determine when row children have changed.`, 54036 11: () => "No gridOptions provided to createGrid", 54037 12: ({ colKey: e }) => ["column ", e, " not found"], 54038 13: () => "Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid.", 54039 14: ({ groupPrefix: e }) => `Row IDs cannot start with ${e}, this is a reserved prefix for AG Grid's row grouping feature.`, 54040 15: ({ expression: e }) => ["value should be either a string or a function", e], 54041 16: ({ expression: e, params: t, e: i }) => [ 54042 "Processing of the expression failed", 54043 "Expression = ", 54044 e, 54045 "Params = ", 54046 t, 54047 "Exception = ", 54048 i 54049 ], 54050 17: () => "you need either field or valueSetter set on colDef for editing to work", 54051 18: () => "alignedGrids contains an undefined option.", 54052 19: () => "alignedGrids - No api found on the linked grid.", 54053 20: () => `You may want to configure via a callback to avoid setup race conditions: 54054 "alignedGrids: () => [linkedGrid]"`, 54055 21: () => "pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.", 54056 22: ({ key: e }) => `${e} is an initial property and cannot be updated.`, 54057 23: () => "The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.", 54058 24: () => "row height must be a number if not using standard row model", 54059 25: ({ id: e }) => ["The getRowId callback must return a string. The ID ", e, " is being cast to a string."], 54060 26: ({ fnName: e, preDestroyLink: t }) => `Grid API function ${e}() cannot be called as the grid has been destroyed. 54061 Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. 54062 To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${t}`, 54063 27: ({ fnName: e, module: t }) => `API function '${e}' not registered to module '${t}'`, 54064 28: () => "setRowCount cannot be used while using row grouping.", 54065 29: () => "tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?", 54066 30: ({ toIndex: e }) => [ 54067 "tried to insert columns in invalid location, toIndex = ", 54068 e, 54069 "remember that you should not count the moving columns when calculating the new index" 54070 ], 54071 31: () => "infinite loop in resizeColumnSets", 54072 32: () => "applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.", 54073 33: () => "stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.", 54074 34: ({ key: e }) => `the column type '${e}' is a default column type and cannot be overridden.`, 54075 35: () => "Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type.", 54076 36: ({ t: e }) => "colDef.type '" + e + "' does not correspond to defined gridOptions.columnTypes", 54077 37: () => "Changing the column pinning status is not allowed with domLayout='print'", 54078 38: ({ iconName: e }) => `provided icon '${e}' needs to be a string or a function`, 54079 39: () => "Applying column order broke a group where columns should be married together. Applying new order has been discarded.", 54080 40: ({ e, method: t }) => `${e} 54081${Nre(t)}`, 54082 41: () => "Browser did not allow document.execCommand('copy'). Ensure 'api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons.", 54083 42: () => "Browser does not support document.execCommand('copy') for clipboard operations", 54084 43: ({ iconName: e }) => `As of v33, icon '${e}' is deprecated. Use the icon CSS name instead.`, 54085 44: () => 'Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.', 54086 45: ({ parentCellDataType: e }) => `The data type definition ${e} does not exist.`, 54087 46: () => 'The "baseDataType" property of a data type definition must match that of its parent.', 54088 47: ({ cellDataType: e }) => `Missing data type definition - "${e}"`, 54089 48: ({ property: e }) => `Cell data type is "object" but no Value ${e} has been provided. Please either provide an object data type definition with a Value ${e}, or set "colDef.value${e}"`, 54090 49: ({ methodName: e }) => `Framework component is missing the method ${e}()`, 54091 50: ({ compName: e }) => `Could not find component ${e}, did you forget to configure this component?`, 54092 51: () => "Export cancelled. Export is not allowed as per your configuration.", 54093 52: () => "There is no `window` associated with the current `document`", 54094 53: () => "unknown value type during csv conversion", 54095 54: () => "Could not find document body, it is needed for drag and drop and context menu.", 54096 55: () => "addRowDropZone - A container target needs to be provided", 54097 56: () => "addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.", 54098 57: () => "unable to show popup filter, filter instantiation failed", 54099 58: () => "no values found for select cellEditor", 54100 59: () => "cannot select pinned rows", 54101 60: () => "cannot select node until it has finished loading", 54102 61: () => "since version v32.2.0, rowNode.isFullWidthCell() has been deprecated. Instead check `rowNode.detail` followed by the user provided `isFullWidthRow` grid option.", 54103 62: ({ colId: e }) => `setFilterModel() - no column found for colId: ${e}`, 54104 63: ({ colId: e }) => `setFilterModel() - unable to fully apply model, filtering disabled for colId: ${e}`, 54105 64: ({ colId: e }) => `setFilterModel() - unable to fully apply model, unable to create filter for colId: ${e}`, 54106 65: () => "filter missing setModel method, which is needed for setFilterModel", 54107 66: () => "filter API missing getModel method, which is needed for getFilterModel", 54108 67: () => "Filter is missing isFilterActive() method", 54109 68: () => "Column Filter API methods have been disabled as Advanced Filters are enabled.", 54110 69: ({ guiFromFilter: e }) => `getGui method from filter returned ${e}; it should be a DOM element.`, 54111 70: ({ newFilter: e }) => `Grid option quickFilterText only supports string inputs, received: ${typeof e}`, 54112 71: () => "debounceMs is ignored when apply button is present", 54113 72: ({ keys: e }) => ["ignoring FilterOptionDef as it doesn't contain one of ", e], 54114 73: () =>
54114 "invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'", 54115 74: () => "no filter options for filter", 54116 75: () => "Unknown button type specified", 54117 76: ({ filterModelType: e }) => [ 54118 'Unexpected type of filter "', 54119 e, 54120 '", it looks like the filter was configured with incorrect Filter Options' 54121 ], 54122 77: () => "Filter model is missing 'conditions'", 54123 78: () => 'Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.', 54124 79: () => '"filterParams.maxNumConditions" must be greater than or equal to zero.', 54125 80: () => '"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.', 54126 81: () => '"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".', 54127 82: ({ param: e }) => `DateFilter ${e} is not a number`, 54128 83: () => "DateFilter minValidYear should be <= maxValidYear", 54129 84: () => "DateFilter minValidDate should be <= maxValidDate", 54130 85: () => "DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored.", 54131 86: () => "DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored.", 54132 87: () => "DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.", 54133 88: ({ index: e }) => `Invalid row index for ensureIndexVisible: ${e}`, 54134 89: () => "A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)", 54135 90: () => "datasource is missing getRows method", 54136 91: () => "Filter is missing method doesFilterPass", 54137 92: ({ methodName: e }) => `AnimationFrameService.${e} called but animation frames are off`, 54138 93: () => "cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`", 54139 94: ({ 54140 paginationPageSizeOption: e, 54141 pageSizeSet: t, 54142 pageSizesSet: i, 54143 pageSizeOptions: s 54144 }) => `'paginationPageSize=${e}'${t ? "" : " (default value)"}, but ${e} is not included in${i ? "" : " the default"} paginationPageSizeSelector=[${s.join(", ")}].`, 54145 95: ({ 54146 paginationPageSizeOption: e, 54147 paginationPageSizeSelector: t 54148 }) => `Either set '${t}' to an array that includes ${e} or to 'false' to disable the page size selector.`, 54149 96: ({ id: e, data: t }) => [ 54150 "Duplicate ID", 54151 e, 54152 "found for pinned row with data", 54153 t, 54154 "When `getRowId` is defined, it must return unique IDs for all pinned rows. Use the `rowPinned` parameter." 54155 ], 54156 97: ({ colId: e }) => `cellEditor for column ${e} is missing getGui() method`, 54157 98: () => "popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.", 54158 99: () => "Since v32, `api.hideOverlay()` does not hide the loading overlay when `loading=true`. Set `loading=false` instead.", 54159 100: ({ rowModelType: e }) => `selectAll only available when rowModelType='clientSide', ie not ${e}`, 54160 101: ({ 54161 propertyName: e, 54162 componentName: t, 54163 agGridDefaults: i, 54164 jsComps: s 54165 }) => { 54166 const n = [], o = [ 54167 // Don't include the old names / internals in potential suggestions 54168 ...Object.keys(i).filter( 54169 (a) => !["agCellEditor", "agGroupRowRenderer", "agSortIndicator"].includes(a) 54170 ), 54171 ...Object.keys(s) 54172 ], r = h_({ 54173 inputValue: t, 54174 allSuggestions: o, 54175 hideIrrelevant: !0, 54176 filterByPercentageOfBestMatch: 0.8 54177 }).values; 54178 return n.push( 54179 `Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components. 54180` 54181 ), r.length > 0 && n.push(` Did you mean: [${r.slice(0, 3)}]? 54182`), n.push("If using a custom component check it has been registered correctly."), n; 54183 }, 54184 102: () => "selecting just filtered only works when gridOptions.rowModelType='clientSide'", 54185 103: () => "Invalid selection state. When using client-side row model, the state must conform to `string[]`.", 54186 104: ({ value: e, param: t }) => `Numeric value ${e} passed to ${t} param will be interpreted as ${e} seconds. If this is intentional use "${e}s" to silence this warning.`, 54187 105: ({ e }) => ["chart rendering failed", e], 54188 106: () => `Theming API and Legacy Themes are both used in the same page. A Theming API theme has been provided to the 'theme' grid option, but the file (ag-grid.css) is also included and will cause styling issues. Remove ag-grid.css from the page. See the migration guide: ${Md}/theming-migration/`, 54189 107: ({ key: e, value: t }) => `Invalid value for theme param ${e} - ${t}`, 54190 108: ({ e }) => ["chart update failed", e], 54191 109: ({ aggFuncOrString: e }) => `unrecognised aggregation function ${e}`, 54192 110: () =>
54192 "groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup", 54193 111: () => "Invalid selection state. When `groupSelectsChildren` is enabled, the state must conform to `IServerSideGroupSelectionState`.", 54194 113: () => "Set Filter cannot initialise because you are using a row model that does not contain all rows in the browser. Either use a different filter type, or configure Set Filter such that you provide it with values", 54195 114: ({ component: e }) => `Could not find component with name of ${e}. Is it in Vue.components?`, 54196 115: () => "The provided selection state should be an object.", 54197 116: () => "Invalid selection state. The state must conform to `IServerSideSelectionState`.", 54198 117: () => "selectAll must be of boolean type.", 54199 118: () => "Infinite scrolling must be enabled in order to set the row count.", 54200 119: () => "Unable to instantiate filter", 54201 120: () => "MultiFloatingFilterComp expects MultiFilter as its parent", 54202 121: () => "a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (see AG Grid docs) or b) to toString() on the object to return a key", 54203 122: () => "could not find the document, document is empty", 54204 123: () => "Advanced Filter is only supported with the Client-Side Row Model or Server-Side Row Model.", 54205 124: () => "No active charts to update.", 54206 125: ({ chartId: e }) => `Unable to update chart. No active chart found with ID: ${e}.`, 54207 126: () => "unable to restore chart as no chart model is provided", 54208 127: ({ allRange: e }) => `unable to create chart as ${e ? "there are no columns in the grid" : "no range is selected"}.`, 54209 128: ({ feature: e }) => `${e} is only available if using 'multiRow' selection mode.`, 54210 129: ({ feature: e, rowModel: t }) => `${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`, 54211 130: () => 'cannot multi select unless selection mode is "multiRow"', 54212 131: () => "cannot range select while selecting multiple rows", 54213 132: () => "Row selection features are not available unless `rowSelection` is enabled.", 54214 133: ({ iconName: e }) => `icon '${e}' function should return back a string or a dom object`, 54215 134: ({ iconName: e }) => `Did not find icon '${e}'`, 54216 135: () => "Data type of the new value does not match the cell data type of the column", 54217 136: () => "Unable to update chart as the 'type' is missing. It must be either 'rangeChartUpdate', 'pivotChartUpdate', or 'crossFilterChartUpdate'.", 54218 137: ({ type: e, currentChartType: t }) => `Unable to update chart as a '${e}' update type is not permitted on a ${t}.`, 54219 138: ({ chartType: e }) => `invalid chart type supplied: ${e}`, 54220 139: ({ customThemeName: e }) => `a custom chart theme with the name ${e} has been supplied but not added to the 'chartThemes' list`, 54221 140: ({ name: e }) => `no stock theme exists with the name '${e}' and no custom chart theme with that name was supplied to 'customChartThemes'`, 54222 141: () => "cross filtering with row grouping is not supported.", 54223 142: () => "cross filtering is only supported in the client side row model.", 54224 143: ({ panel: e }) => `'${e}' is not a valid Chart Tool Panel name`, 54225 144: ({ type: e }) => `Invalid charts data panel group name supplied: '${e}'`, 54226 145: ({ group: e }) => `As of v32, only one charts customize panel group can be expanded at a time. '${e}' will not be expanded.`, 54227 146: ({ comp: e }) => `Unable to instantiate component '${e}' as its module hasn't been loaded. Add 'ValidationModule' to see which module is required.`, 54228 147: ({ group: e }) => `Invalid charts customize panel group name supplied: '${e}'`, 54229 148: ({ group: e }) => `invalid chartGroupsDef config '${e}'`, 54230 149: ({ group: e, chartType: t }) => `invalid chartGroupsDef config '${e}.${t}'`, 54231 150: () => "'seriesChartTypes' are required when the 'customCombo' chart type is specified.", 54232 151: ({ chartType: e }) => `invalid chartType '${e}' supplied in 'seriesChartTypes', converting to 'line' instead.`, 54233 152: ({ colId: e }) => `no 'seriesChartType' found for colId = '${e}', defaulting to 'line'.`, 54234 153: ({ chartDataType: e }) => `unexpected chartDataType value '${e}' supplied, instead use 'category', 'series' or 'excluded'`, 54235 154: ({ colId: e }) => `cross filtering requires a 'agSetColumnFilter' or 'agMultiColumnFilter' to be defined on the column with id: ${e}`, 54236 155: ({ option: e }) => `'${e}' is not a valid Chart Toolbar Option`, 54237 156: ({ panel: e }) => `Invalid panel in chartToolPanelsDef.panels: '${e}'`, 54238 157: ({ unrecognisedGroupIds: e }) => ["unable to find group(s) for supplied groupIds:", e], 54239 158: () => "can not expand a column item that does not represent a column group header", 54240 159: () => "Invalid params supplied to createExcelFileForExcel() - `ExcelExportParams.data` is empty.", 54241 160: () => "Export cancelled. Export is not allowed as per your configuration.", 54242 161: () => "The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel
vendor: 5,757 bytes, lines 54242-54310
54242()'", 54243 162: ({ id: e, dataType: t }) => `Unrecognized data type for excel export [${e}.dataType=${t}]`, 54244 163: ({ featureName: e }) => `Excel table export does not work with ${e}. The exported Excel file will not contain any Excel tables. 54245 Please turn off ${e} to enable Excel table exports.`, 54246 164: () => "Unable to add data table to Excel sheet: A table already exists.", 54247 165: () => "Unable to add data table to Excel sheet: Missing required parameters.", 54248 166: ({ unrecognisedGroupIds: e }) => ["unable to find groups for these supplied groupIds:", e], 54249 167: ({ unrecognisedColIds: e }) => ["unable to find columns for these supplied colIds:", e], 54250 168: () => "detailCellRendererParams.template should be function or string", 54251 169: () => 'Reference to eDetailGrid was missing from the details template. Please add data-ref="eDetailGrid" to the template.', 54252 170: ({ providedStrategy: e }) => `invalid cellRendererParams.refreshStrategy = ${e} supplied, defaulting to refreshStrategy = 'rows'.`, 54253 171: () => "could not find detail grid options for master detail, please set gridOptions.detailCellRendererParams.detailGridOptions", 54254 172: () => "could not find getDetailRowData for master / detail, please set gridOptions.detailCellRendererParams.getDetailRowData", 54255 173: ({ group: e }) => `invalid chartGroupsDef config '${e}'`, 54256 174: ({ group: e, chartType: t }) => `invalid chartGroupsDef config '${e}.${t}'`, 54257 175: ({ menuTabName: e, itemsToConsider: t }) => [ 54258 `Trying to render an invalid menu item '${e}'. Check that your 'menuTabs' contains one of `, 54259 t 54260 ], 54261 176: ({ key: e }) => `unknown menu item type ${e}`, 54262 177: () => "valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.", 54263 178: ({ colId: e }) => `column ${e} is not visible`, 54264 179: () => "totalValueGetter should be either a function or a string (expression)", 54265 180: () => "agRichSelectCellEditor requires cellEditorParams.values to be set", 54266 181: () => "agRichSelectCellEditor cannot have `multiSelect` and `allowTyping` set to `true`. AllowTyping has been turned off.", 54267 182: () => 'you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data', 54268 183: () => "Group Column Filter only works on group columns. Please use a different filter.", 54269 184: ({ parentGroupData: e, childNodeData: t }) => ["duplicate group keys for row data, keys should be unique", [e, t]], 54270 185: ({ data: e }) => ["getDataPath() should not return an empty path", [e]], 54271 186: ({ 54272 rowId: e, 54273 rowData: t, 54274 duplicateRowsData: i 54275 }) => ["duplicate group keys for row data, keys should be unique", e, t, ...i], 54276 187: ({ rowId: e, firstData: t, secondData: i }) => [ 54277 `Duplicate node id ${e}. Row IDs are provided via the getRowId() callback. Please modify the getRowId() callback code to provide unique row id values.`, 54278 "first instance", 54279 t, 54280 "second instance", 54281 i 54282 ], 54283 188: () => "getRowId callback must be provided for Server Side Row Model selection to work correctly.", 54284 189: ({ startRow: e }) => `invalid value ${e} for startRow, the value should be >= 0`, 54285 190: ({ rowGroupId: e, data: t }) => [ 54286 "null and undefined values are not allowed for server side row model keys", 54287 e ? `column = ${e}` : "", 54288 "data is ", 54289 t 54290 ], 54291 191: () => "cannot multi select unless selection mode is 'multiRow'", 54292 192: () => "cannot use range selection when multi selecting rows", 54293 193: () => "cannot multi select unless selection mode is 'multiRow'", 54294 194: ({ method: e }) => `calling gridApi.${e}() is only possible when using rowModelType=\`clientSide\`.`, 54295 195: ({ justCurrentPage: e }) => `selecting just ${e ? "current page" : "filtered"} only works when gridOptions.rowModelType='clientSide'`, 54296 196: ({ key: e }) => `Provided ids must be of string type. Invalid id provided: ${e}`, 54297 197: () => "`toggledNodes` must be an array of string ids.", 54298 198: () => "cannot multi select unless selection mode is 'multiRow'", 54299 199: () => "getSelectedNodes and getSelectedRows functions cannot be used with select all functionality with the server-side row model. Use `api.getServerSideSelectionState()` instead.", 54300 200: hT, 54301 201: ({ rowModelType: e }) => `Could not find row model for rowModelType = ${e}`, 54302 202: () => "`getSelectedNodes` and `getSelectedRows` functions cannot be used with `groupSelectsChildren` and the server-side row model. Use `api.getServerSideSelectionState()` instead.", 54303 203: () => "Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.", 54304 204: () => "Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.", 54305 205: ({ duplicateIdText: e }) => `Unable to display rows as duplicate row ids (${e}) were returned by the getRowId callback. Please modify the getRowId callback to provide unique ids.`, 54306 206: () => "getRowId callback must be implemented for transactions to work. Transaction was ignored.", 54307 207: () => 'The Set Filter Parameter "defaultToNothingSelected" value was ignored because it does not work when "excelMode" is used.', 54308 208: () => "Set Filter Value Formatter must return string values. Please ensure the Set Filter Value Formatter returns string values for complex objects.", 54309 209: () => `Set Filter Key Creator is returning null for provided values and provided values are primitives. Please provide complex objects. See ${Md}/filter-set-filter-list/#filter-value-types`, 54310 210: () => "Set Filter has a Key Creator, but provided values are primitives. Did
54310you mean to provide complex objects?", 54311 211: () => "property treeList=true for Set Filter params, but you did not provide a treeListPathGetter or values of type Date.", 54312 212: () => "please review all your toolPanel components, it seems like at least one of them doesn't have an id", 54313 213: () => "Advanced Filter does not work with Filters Tool Panel. Filters Tool Panel has been disabled.", 54314 214: ({ key: e }) => `unable to lookup Tool Panel as invalid key supplied: ${e}`, 54315 215: ({ key: e, defaultByKey: t }) => `the key ${e} is not a valid key for specifying a tool panel, valid keys are: ${Object.keys(t).join(",")}`, 54316 216: ({ name: e }) => `Missing component for '${e}'`, 54317 217: ({ invalidColIds: e }) => ["unable to find grid columns for the supplied colDef(s):", e], 54318 218: ({ property: e, defaultOffset: t }) => `${e} must be a number, the value you provided is not a valid number. Using the default of ${t}px.`, 54319 219: ({ property: e }) => `Property ${e} does not exist on the target object.`, 54320 220: ({ lineDash: e }) => `'${e}' is not a valid 'lineDash' option.`, 54321 221: () => "agAggregationComponent should only be used with the client and server side row model.", 54322 222: () => "agFilteredRowCountComponent should only be used with the client side row model.", 54323 223: () => "agSelectedRowCountComponent should only be used with the client and server side row model.", 54324 224: () => "agTotalAndFilteredRowCountComponent should only be used with the client side row model.", 54325 225: () => "agTotalRowCountComponent should only be used with the client side row model.", 54326 226: () => "viewport is missing init method.", 54327 227: () => "menu item icon must be DOM node or string", 54328 228: ({ menuItemOrString: e }) => `unrecognised menu item ${e}`, 54329 229: ({ index: e }) => ["invalid row index for ensureIndexVisible: ", e], 54330 230: () => "detailCellRendererParams.template is not supported by AG Grid React. To change the template, provide a Custom Detail Cell Renderer. See https://ag-grid.com/react-data-grid/master-detail-custom-detail/", 54331 // @deprecated v32 mark for removal as part of v32 deprecated features 54332 231: () => "As of v32, using custom components with `reactiveCustomComponents = false` is deprecated.", 54333 232: () => "Using both rowData and v-model. rowData will be ignored.", 54334 233: ({ methodName: e }) => `Framework component is missing the method ${e}()`, 54335 234: () => 'Group Column Filter does not work with the colDef property "field". This property will be ignored.', 54336 235: () => 'Group Column Filter does not work with the colDef property "filterValueGetter". This property will be ignored.', 54337 236: () => 'Group Column Filter does not work with the colDef property "filterParams". This property will be ignored.', 54338 237: () => "Group Column Filter does not work with Tree Data enabled. Please disable Tree Data, or use a different filter.", 54339 238: () => "setRowCount can only accept a positive row count.", 54340 239: () => 'Theming API and CSS File Themes are both used in the same page. In v33 we released the Theming API as the new default method of styling the grid. See the migration docs https://www.ag-grid.com/react-data-grid/theming-migration/. Because no value was provided to the `theme` grid option it defaulted to themeQuartz. But the file (ag-grid.css) is also included and will cause styling issues. Either pass the string "legacy" to the theme grid option to use v32 style themes, or remove ag-grid.css from the page to use Theming API.', 54341 240: ({ theme: e }) => `theme grid option must be a Theming API theme object or the string "legacy", received: ${e}`, 54342 241: () => "cannot select multiple rows when rowSelection.mode is set to 'singleRow'", 54343 242: () => "cannot select multiple rows when using rangeSelect", 54344 243: () => "Failed to deserialize state - each provided state object must be an object.", 54345 244: () => "Failed to deserialize state - `selectAllChildren` must be a boolean value or undefined.", 54346 245: () => "Failed to deserialize state - `toggledNodes` must be an array.", 54347 246: () => "Failed to deserialize state - Every `toggledNode` requires an associated string id.", 54348 247: () =>
54348 `Row selection state could not be parsed due to invalid data. Ensure all child state has toggledNodes or does not conform with the parent rule. 54349Please rebuild the selection state and reapply it.`, 54350 248: () => "SetFloatingFilter expects SetFilter as its parent", 54351 249: () => "Must supply a Value Formatter in Set Filter params when using a Key Creator", 54352 250: () => "Must supply a Key Creator in Set Filter params when `treeList = true` on a group column, and Tree Data or Row Grouping is enabled.", 54353 251: ({ chartType: e }) => `AG Grid: Unable to create chart as an invalid chartType = '${e}' was supplied.`, 54354 252: () => `cannot get grid to draw rows when it is in the middle of drawing rows. 54355Your code probably called a grid API method while the grid was in the render stage. 54356To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). 54357To see what part of your code that caused the refresh check this stacktrace.`, 54358 253: ({ version: e }) => ["Illegal version string: ", e], 54359 254: () => "Cannot create chart: no chart themes available.", 54360 255: ({ point: e }) => `Lone surrogate U+${e.toString(16).toUpperCase()} is not a scalar value`, 54361 256: () => "Unable to initialise. See validation error, or load ValidationModule if missing.", 54362 257: () => pT("IntegratedChartsModule"), 54363 258: () => pT("SparklinesModule"), 54364 259: ({ part: e }) => `the argument to theme.withPart must be a Theming API part object, received: ${e}`, 54365 260: ({ 54366 propName: e, 54367 compName: t, 54368 gridScoped: i, 54369 gridId: s, 54370 rowModelType: n 54371 }) => hT({ 54372 reasonOrId: `AG Grid '${e}' component: ${t}`, 54373 moduleName: pd[t], 54374 gridId: s, 54375 gridScoped: i, 54376 rowModelType: n 54377 }), 54378 261: () => "As of v33, `column.isHovered()` is deprecated. Use `api.isColumnHovered(column)` instead.", 54379 262: () => 'As of v33, icon key "smallDown" is deprecated. Use "advancedFilterBuilderSelect" for Advanced Filter Builder dropdown, "selectOpen" for Select cell editor and dropdowns (e.g. Integrated Charts menu), "richSelectOpen" for Rich Select cell editor', 54380 263: () => 'As of v33, icon key "smallLeft" is deprecated. Use "panelDelimiterRtl" for Row Group Panel / Pivot Panel, "subMenuOpenRtl" for sub-menus.', 54381 264: () => 'As of v33, icon key "smallRight" is deprecated. Use "panelDelimiter" for Row Group Panel / Pivot Panel, "subMenuOpen" for sub-menus' 54382}; 54383function Bre(e, t) { 54384 const i = _re[e]; 54385 if (!i) 54386 return [`Missing error text for error id ${e}!`]; 54387 const s = i(t), o = ` 54388See ${LO(e, t)}`; 54389 return Array.isArray(s) ? s.concat(o) : [s, o]; 54390} 54391var Gre = { 54392 1: "Charting Aggregation", 54393 2: "pivotResultFields", 54394 3: "setTooltip" 54395}, zre = () => ({ 54396 checkboxSelection: { version: "32.2", message: "Use `rowSelection.checkboxes` in `GridOptions` instead." }, 54397 headerCheckboxSelection: { 54398 version: "32.2", 54399 message: "Use `rowSelection.headerCheckbox = true` in `GridOptions` instead." 54400 }, 54401 headerCheckboxSelectionFilteredOnly: { 54402 version: "32.2", 54403 message: 'Use `rowSelection.selectAll = "filtered"` in `GridOptions` instead.' 54404 }, 54405 headerCheckboxSelectionCurrentPageOnly: { 54406 version: "32.2", 54407 message: 'Use `rowSelection.selectAll = "currentPage"` in `GridOptions` instead.' 54408 }, 54409 showDisabledCheckboxes: { 54410 version: "32.2", 54411 message: "Use `rowSelection.hideDisabledCheckboxes = true` in `GridOptions` instead." 54412 } 54413}), Hre = () => ({ 54414 aggFunc: { module: "SharedAggregation" }, 54415 autoHeight: { 54416 supportedRowModels: ["clientSide", "serverSide"], 54417 module: "RowAutoHeight" 54418 }, 54419 cellClass: { module: "CellStyle" }, 54420 cellClassRules: { module: "CellStyle" }, 54421 cellEditor: ({ cellEditor: e, editable: t }) => { 54422 if (!t) 54423 return null; 54424 if (typeof e == "string") { 54425 const i = pd[e]; 54426 if (i) 54427 return { module: i }; 54428 } 54429 return { module: "CustomEditor" }; 54430 }, 54431 cellRenderer: ({ cellRenderer: e }) => { 54432 if (typeof e != "string") 54433 return null; 54434 const t = pd[e]; 54435 return t ? { module: t } : null; 54436 }, 54437 cellRendererParams: { 54438 validate: (e) => (e.rowGroup != null || e.rowGroupIndex != null || e.cellRenderer === "agGroupCellRenderer") && "checkbox" in e.cellRendererParams ? 'Since v33.0, `cellRendererParams.checkbox` has been deprecated. Use `rowSelection.checkboxLocation = "autoGroupColumn"` instead.' : null 54439 }, 54440 cellStyle: { module: "CellStyle" }, 54441 children: () => p_(), 54442 columnChooserParams: { 54443 module: "ColumnMenu" 54444 }, 54445 contextMenuItems: { module: "ContextMenu" }, 54446 dndSource: { module: "DragAndDrop" }, 54447 dndSourceOnRowDrag: { module: "DragAndDrop" }, 54448 editable: ({ editable: e, cellEditor: t }) => e && !t ? { 54449 module: "TextEditor" 54450 } : null, 54451 enableCellChangeFlash: { module: "HighlightChanges" }, 54452 enablePivot: { module: "SharedPivot" }, 54453 enableRowGroup: { module: "SharedRowGrouping" }, 54454 enableValue: { module: "SharedAggregation" }, 54455 filter: ({ filter: e }) => { 54456 if (e && typeof e != "string" && typeof e != "boolean") 54457 return { module: "CustomFilter" }; 54458 if (typeof e == "string") { 54459 const t = pd[e]; 54460 if (t) 54461 return { module: t }; 54462 } 54463 return { module: "ColumnFilter" }; 54464 }, 54465 floatingFilter: { module: "ColumnFilter" }, 54466 headerCheckboxSelection: { 54467 supportedRowModels: ["clientSide", "serverSide"], 54468 validate: (e, { rowSelection: t }) => t === "multiple" ? null : "headerCheckboxSelection is only supported with rowSelection=multiple" 54469 }, 54470 headerCheckboxSelectionCurrentPageOnly: { 54471 supportedRowModels: ["clientSide"], 54472 validate: (e, { rowSelection: t }) => t === "multiple" ? null : "headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple" 54473 }, 54474 headerCheckboxSelectionFilteredOnly: { 54475 supportedRowModels: ["clientSide"], 54476 validate: (e, { rowSelection: t }) => t === "multiple" ? null : "headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple" 54477 }, 54478 headerTooltip: { module: "Tooltip" }, 54479 headerValueGetter: { 54480 validate: (e) => { 54481 const t = e.headerValueGetter; 54482 return typeof t == "function" || typeof t == "string" ? null : "headerValueGetter must be a function or a valid string expression"; 54483 } 54484 }, 54485 icons: { 54486 validate: ({ icons: e }) => { 54487 if (e) { 54488 if (e.smallDown) 54489 return vl(262); 54490 if (e.smallLeft) 54491 return vl(263); 54492 if (e.smallRight) 54493 return vl(264); 54494 } 54495 return null; 54496 } 54497 }, 54498 mainMenuItems: { module: "ColumnMenu" }, 54499 menuTabs: (e) => { 54500 const t = ["columnsMenuTab", "generalMenuTab"]; 54501 return e.menuTabs?.some((i) => t.includes(i)) ? { 54502 module: "ColumnMenu" 54503 } : null; 54504 }, 54505 pivot: { module: "SharedPivot" }, 54506 pivotIndex: { module: "SharedPivot" }, 54507 rowDrag: { module: "RowDrag" }, 54508 rowGroup: { module: "SharedRowGrouping" }, 54509 rowGroupIndex: { module: "SharedRowGrouping" }, 54510 sortingOrder: { 54511 validate: (e) => { 54512 const t = e.sortingOrder; 54513 if (Array.isArray(t) && t.length > 0) { 54514 const i = t.filter((s) => !eg.includes(s)); 54515 if (i.length > 0) 54516 return `sortingOrder must be an array with elements from [${eg.map(nv).join()}], currently it includes [${i.map(nv).join()}]`; 54517 } else if (!Array.isArray(t) || t.length <= 0) 54518 return `sortingOrder must be an array with at least one element, currently it's ${t}`; 54519 return null; 54520 } 54521 }, 54522 tooltipField: { module: "Tooltip" }, 54523 tooltipValueGetter: { module: "Tooltip" }, 54524 type: { 54525 validate: (e) => { 54526 const t = e.type; 54527 return t instanceof Array ? t.some((s) => typeof s != "string") ? "if colDef.type is supplied an array it should be of type 'string[]'" : null : typeof t == "string" ? null : "colDef.type should be of type 'string' | 'string[]'"; 54528 } 54529 }, 54530 rowSpan: { 54531 validate: (e, { suppressRowTransform: t }) => t ? null : "colDef.rowSpan requires suppressRowTransform to be enabled." 54532 } 54533}), Vre = { 54534 headerName: void 0, 54535 columnGroupShow: void 0, 54536 headerClass: void 0, 54537 toolPanelClass: void 0, 54538 headerValueGetter: void 0, 54539 pivotKeys: void 0, 54540 groupId: void 0, 54541 colId: void 0, 54542 sort: void 0, 54543 initialSort: void 0, 54544 field: void 0, 54545 type: void 0, 54546 cellDataType: void 0, 54547 tooltipComponent: void 0, 54548 tooltipField: void 0, 54549 headerTooltip: void 0, 54550 cellClass: void 0, 54551 showRowGroup: void 0, 54552 filter: void 0, 54553 initialAggFunc: void 0, 54554 defaultAggFunc: void 0, 54555 aggFunc: void 0, 54556 pinned: void 0, 54557 initialPinned: void 0, 54558 chartDataType: void 0, 54559 cellAriaRole: void 0, 54560 cellEditorPopupPosition: void 0, 54561 headerGroupComponent: void 0, 54562 headerGroupComponentParams: void 0, 54563 cellStyle: void 0, 54564 cellRenderer: void 0, 54565 cellRendererParams: void 0, 54566 cellEditor: void 0, 54567 cellEditorParams: void 0, 54568 filterParams: void 0, 54569 pivotValueColumn: void 0, 54570 headerComponent: void 0, 54571 headerComponentParams: void 0, 54572 floatingFilterComponent: void 0, 54573 floatingFilterComponentParams: void 0, 54574 tooltipComponentParams: void 0, 54575 refData: void 0, 54576 columnChooserParams: void 0, 54577 children: void 0, 54578 sortingOrder: void 0, 54579 allowedAggFuncs: void 0, 54580 menuTabs: void 0, 54581 pivotTotalColumnIds: void 0, 54582 cellClassRules: void 0, 54583 icons: void 0, 54584 sortIndex: void 0, 54585 initialSortIndex: void 0, 54586 flex: void 0, 54587 initialFlex: void 0, 54588 width: void 0, 54589 initialWidth: void 0, 54590 minWidth: void 0, 54591 maxWidth: void 0, 54592 rowGroupIndex: void 0, 54593 initialRowGroupIndex: void 0, 54594 pivotIndex: void 0, 54595 initialPivotIndex: void 0, 54596 suppressColumnsToolPanel: void 0, 54597 suppressFiltersToolPanel: void 0, 54598 openByDefault: void 0, 54599 marryChildren: void 0, 54600 suppressStickyLabel: void 0, 54601 hide: void 0, 54602 initialHide: void 0, 54603 rowGroup: void 0, 54604 initialRowGroup: void 0, 54605 pivot: void 0, 54606 initialPivot: void 0, 54607 checkboxSelection: void 0, 54608 showDisabledCheckboxes: void 0, 54609 headerCheckboxSelection: void 0, 54610 headerCheckboxSelectionFilteredOnly: void 0, 54611 headerCheckboxSelectionCurrentPageOnly: void 0, 54612 suppressHeaderMenuButton: void 0, 54613 suppressMovable: void 0, 54614 lockPosition: void 0, 54615 lockVisible: void 0, 54616 lockPinned: void 0, 54617 unSortIcon: void 0, 54618 suppressSizeToFit: void 0, 54619 suppressAutoSize: void 0, 54620 enableRowGroup: void 0, 54621 enablePivot: void 0, 54622 enableValue: void 0, 54623 editable: void 0, 54624 suppressPaste: void 0, 54625 suppressNavigable: void 0, 54626 enableCellChangeFlash: void 0, 54627 rowDrag: void 0, 54628 dndSource: void 0, 54629 autoHeight: void 0, 54630 wrapText: void 0, 54631 sortable: void 0, 54632 resizable: void 0, 54633 singleClickEdit: void 0, 54634 floatingFilter: void 0, 54635 cellEditorPopup: void 0, 54636 suppressFillHandle: void 0, 54637 wrapHeaderText: void 0, 54638 autoHeaderHeight: void 0, 54639 dndSourceOnRowDrag: void 0, 54640 valueGetter: void 0, 54641 valueSetter: void 0, 54642 filterValueGetter: void 0, 54643 keyCreator: void 0, 54644 valueFormatter: void 0, 54645 valueParser: void 0, 54646 comparator: void 0, 54647 equals: void 0, 54648 pivotComparator: void 0, 54649 suppressKeyboardEvent: void 0, 54650 suppressHeaderKeyboardEvent: void 0, 54651 colSpan: void 0, 54652 rowSpan: void 0, 54653 getQuickFilterText: void 0, 54654 onCellValueChanged: void 0, 54655 onCellClicked: void 0, 54656 onCellDoubleClicked: void 0, 54657 onCellContextMenu: void 0, 54658 rowDragText: void 0, 54659 tooltipValueGetter: void 0, 54660 cellRendererSelector: void 0, 54661 cellEditorSelector: void 0,
54662 suppressSpanHeaderHeight: void 0, 54663 useValueFormatterForExport: void 0, 54664 useValueParserForImport: void 0, 54665 mainMenuItems: void 0, 54666 contextMenuItems: void 0, 54667 suppressFloatingFilterButton: void 0, 54668 suppressHeaderFilterButton: void 0, 54669 suppressHeaderContextMenu: void 0, 54670 loadingCellRenderer: void 0, 54671 loadingCellRendererParams: void 0, 54672 loadingCellRendererSelector: void 0, 54673 context: void 0 54674}, Ure = () => Object.keys(Vre), p_ = () => ({ 54675 objectName: "colDef", 54676 allProperties: Ure(), 54677 docsUrl: "column-properties/", 54678 deprecations: zre(), 54679 validations: Hre() 54680}), Wre = () => ({ 54681 suppressLoadingOverlay: { version: "32", message: "Use `loading`=false instead." }, 54682 enableFillHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." }, 54683 enableRangeHandle: { version: "32.2", message: "Use `cellSelection.handle` instead." }, 54684 enableRangeSelection: { version: "32.2", message: "Use `cellSelection = true` instead." }, 54685 suppressMultiRangeSelection: { 54686 version: "32.2", 54687 message: "Use `cellSelection.suppressMultiRanges` instead." 54688 }, 54689 suppressClearOnFillReduction: { 54690 version: "32.2", 54691 message: "Use `cellSelection.handle.suppressClearOnFillReduction` instead." 54692 }, 54693 fillHandleDirection: { version: "32.2", message: "Use `cellSelection.handle.direction` instead." }, 54694 fillOperation: { version: "32.2", message: "Use `cellSelection.handle.setFillValue` instead." }, 54695 suppressRowClickSelection: { 54696 version: "32.2", 54697 message: "Use `rowSelection.enableClickSelection` instead." 54698 }, 54699 suppressRowDeselection: { version: "32.2", message: "Use `rowSelection.enableClickSelection` instead." }, 54700 rowMultiSelectWithClick: { 54701 version: "32.2", 54702 message: "Use `rowSelection.enableSelectionWithoutKeys` instead." 54703 }, 54704 groupSelectsChildren: { 54705 version: "32.2", 54706 message: 'Use `rowSelection.groupSelects = "descendants"` instead.' 54707 }, 54708 groupSelectsFiltered: { 54709 version: "32.2", 54710 message: 'Use `rowSelection.groupSelects = "filteredDescendants"` instead.' 54711 }, 54712 isRowSelectable: { version: "32.2", message: "Use `selectionOptions.isRowSelectable` instead." }, 54713 suppressCopySingleCellRanges: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." }, 54714 suppressCopyRowsToClipboard: { version: "32.2", message: "Use `rowSelection.copySelectedRows` instead." }, 54715 onRangeSelectionChanged: { version: "32.2", message: "Use `onCellSelectionChanged` instead." }, 54716 onRangeDeleteStart: { version: "32.2", message: "Use `onCellSelectionDeleteStart` instead." }, 54717 onRangeDeleteEnd: { version: "32.2", message: "Use `onCellSelectionDeleteEnd` instead." }, 54718 suppressBrowserResizeObserver: { 54719 version: "32.2", 54720 message: "The grid always uses the browser's ResizeObserver, this grid option has no effect." 54721 }, 54722 onColumnEverythingChanged: { 54723 version: "32.2", 54724 message: "Either use `onDisplayedColumnsChanged` which is fired at the same time, or use one of the more specific column events." 54725 }, 54726 groupRemoveSingleChildren: { 54727 version: "33", 54728 message: "Use `groupHideParentOfSingleChild` instead." 54729 }, 54730 groupRemoveLowestSingleChildren: { 54731 version: "33", 54732 message: 'Use `groupHideParentOfSingleChild: "leafGroupsOnly"` instead.' 54733 }, 54734 suppressRowGroupHidesColumns: { 54735 version: "33", 54736 message: 'Use `suppressGroupChangesColumnVisibility: "suppressHideOnGroup"` instead.' 54737 }, 54738 suppressMakeColumnVisibleAfterUnGroup: { 54739 version: "33", 54740 message: 'Use `suppressGroupChangesColumnVisibility: "suppressShowOnUngroup"` instead.' 54741 }, 54742 unSortIcon: { version: "33", message: "Use `defaultColDef.unSortIcon` instead." }, 54743 sortingOrder: { version: "33", message: "Use `defaultColDef.sortingOrder` instead." }, 54744 suppressPropertyNamesCheck: { 54745 version: "33", 54746 message: "`gridOptions` and `columnDefs` both have a `context` property that should be used for arbitrary user data. This means that column definitions and gridOptions should only contain valid properties making this property redundant." 54747 } 54748}); 54749function or(e, t, i, s = Number.MAX_VALUE) { 54750 return typeof t == "number" || t == null ? t == null || t >= i && t <= s ? null : s === Number.MAX_VALUE ? `${e}: value should be greater than or equal to ${i}` : `${e}: value should be between ${i} and ${s}` : `${e}: value should be a number`; 54751} 54752var jre = () => { 54753 const e = {
54754 alignedGrids: { module: "AlignedGrids" }, 54755 allowContextMenuWithControlKey: { module: "ContextMenu" }, 54756 autoSizePadding: { 54757 validate({ autoSizePadding: i }) { 54758 return or("autoSizePadding", i, 0); 54759 } 54760 }, 54761 autoSizeStrategy: { module: "ColumnAutoSize" }, 54762 cacheBlockSize: { 54763 supportedRowModels: ["serverSide", "infinite"], 54764 validate({ cacheBlockSize: i }) { 54765 return or("cacheBlockSize", i, 1); 54766 } 54767 }, 54768 cacheOverflowSize: { 54769 validate({ cacheOverflowSize: i }) { 54770 return or("cacheOverflowSize", i, 1); 54771 } 54772 }, 54773 cellSelection: { 54774 module: "CellSelection" 54775 }, 54776 columnHoverHighlight: { module: "ColumnHover" }, 54777 datasource: { 54778 supportedRowModels: ["infinite"], 54779 module: "InfiniteRowModel" 54780 }, 54781 doesExternalFilterPass: { module: "ExternalFilter" }, 54782 domLayout: { 54783 validate: (i) => { 54784 const s = i.domLayout, n = ["autoHeight", "normal", "print"]; 54785 return s && !n.includes(s) ? `domLayout must be one of [${n.join()}], currently it's ${s}` : null; 54786 } 54787 }, 54788 editType: { 54789 module: "EditCore" 54790 }, 54791 enableAdvancedFilter: { module: "AdvancedFilter" }, 54792 enableCharts: { module: "IntegratedCharts" }, 54793 enableFillHandle: { 54794 dependencies: { 54795 enableRangeSelection: { required: [!0] } 54796 } 54797 }, 54798 enableRangeHandle: { 54799 dependencies: { 54800 enableRangeSelection: { required: [!0] } 54801 } 54802 }, 54803 enableRangeSelection: { 54804 module: "CellSelection", 54805 dependencies: { 54806 rowDragEntireRow: { required: [!1, void 0] } 54807 } 54808 }, 54809 getContextMenuItems: { module: "ContextMenu" }, 54810 getLocaleText: { module: "Locale" }, 54811 getMainMenuItems: { module: "ColumnMenu" }, 54812 getRowClass: { module: "RowStyle" }, 54813 getRowStyle: { module: "RowStyle" }, 54814 grandTotalRow: { module: "SharedRowGrouping" }, 54815 groupDefaultExpanded: { 54816 supportedRowModels: ["clientSide"] 54817 }, 54818 groupHideOpenParents: { 54819 supportedRowModels: ["clientSide", "serverSide"], 54820 dependencies: { 54821 groupTotalRow: { required: [void 0, "bottom"] }, 54822 treeData: { 54823 required: [void 0, !1], 54824 reason: "Tree Data has values at the group level so it doesn't make sense to hide them." 54825 } 54826 } 54827 }, 54828 groupHideParentOfSingleChild: { 54829 dependencies: { 54830 groupHideOpenParents: { required: [void 0, !1] } 54831 } 54832 }, 54833 groupRemoveLowestSingleChildren: { 54834 dependencies: { 54835 groupHideOpenParents: { required: [void 0, !1] }, 54836 groupRemoveSingleChildren: { required: [void 0, !1] } 54837 } 54838 }, 54839 groupRemoveSingleChildren: { 54840 dependencies: { 54841 groupHideOpenParents: { required: [void 0, !1] }, 54842 groupRemoveLowestSingleChildren: { required: [void 0, !1] } 54843 } 54844 }, 54845 groupSelectsChildren: { 54846 dependencies: { 54847 rowSelection: { required: ["multiple"] } 54848 } 54849 }, 54850 icons: { 54851 validate: ({ icons: i }) => { 54852 if (i) { 54853 if (i.smallDown) 54854 return vl(262); 54855 if (i.smallLeft) 54856 return vl(263); 54857 if (i.smallRight) 54858 return vl(264); 54859 } 54860 return null; 54861 } 54862 }, 54863 infiniteInitialRowCount: { 54864 validate({ infiniteInitialRowCount: i }) { 54865 return or("infiniteInitialRowCount", i, 1); 54866 } 54867 }, 54868 initialGroupOrderComparator: { 54869 supportedRowModels: ["clientSide"] 54870 }, 54871 initialState: { module: "GridState" }, 54872 isExternalFilterPresent: { module: "ExternalFilter" }, 54873 keepDetailRowsCount: { 54874 validate({ keepDetailRowsCount: i }) { 54875 return or("keepDetailRowsCount", i, 1); 54876 } 54877 }, 54878 localeText: { 54879 module: "Locale" 54880 }, 54881 masterDetail: { module: "SharedMasterDetail" }, 54882 pagination: { module: "Pagination" }, 54883 paginationPageSize: { 54884 validate({ paginationPageSize: i }) { 54885 return or("paginationPageSize", i, 1); 54886 } 54887 }, 54888 paginationPageSizeSelector: { 54889 validate: (i) => { 54890 const s = i.paginationPageSizeSelector; 54891 return typeof s == "boolean" || s == null || s.length ? null : `'paginationPageSizeSelector' cannot be an empty array. 54892 If you want to hide the page size selector, set paginationPageSizeSelector to false.`; 54893 } 54894 }, 54895 pinnedTopRowData: { 54896 module: "PinnedRow" 54897 }, 54898 pinnedBottomRowData: { 54899 module: "PinnedRow" 54900 }, 54901 pivotMode: { 54902 dependencies: { 54903 treeData: { 54904 required: [!1, void 0], 54905 reason: "Pivot Mode is not supported with Tree Data." 54906 } 54907 }, 54908 module: "SharedPivot" 54909 }, 54910 pivotPanelShow: { module: "RowGroupingPanel" }, 54911 quickFilterText: { 54912 supportedRowModels: ["clientSide"], 54913 module: "QuickFilter" 54914 }, 54915 rowBuffer: { 54916 validate({ rowBuffer: i }) { 54917 return or("rowBuffer", i, 0); 54918 } 54919 }, 54920 rowClass: { 54921 validate: (i) => typeof i.rowClass == "function" ? "rowClass should not be a function, please use getRowClass instead" : null, 54922 module: "RowStyle" 54923 }, 54924 rowClassRules: { module: "RowStyle" }, 54925 rowData: { 54926 supportedRowModels: ["clientSide"], 54927 module: "ClientSideRowModel" 54928 }, 54929 rowDragManaged: { 54930 supportedRowModels: ["clientSide"], 54931 dependencies: { 54932 treeData: { 54933 required: [!1, void 0] 54934 }, 54935 pagination: { 54936 required: [!1, void 0] 54937 } 54938 }, 54939 module: "RowDrag" 54940 }, 54941 rowGroupPanelShow: { module: "RowGroupingPanel" }, 54942 rowSelection: { 54943 validate({ rowSelection: i }) { 54944 return i && typeof i == "string" ? 'As of version 32.2.1, using `rowSelection` with the values "single" or "multiple" has been deprecated. Use the object value instead.' : i && typeof i != "object" ? "Expected `RowSelectionOptions` object for the `rowSelection` property." : i && i.mode !== "multiRow" && i.mode !== "singleRow" ? `Selection mode "${i.mode}
54944" is invalid. Use one of 'singleRow' or 'multiRow'.` : null; 54945 }, 54946 module: "SharedRowSelection" 54947 }, 54948 rowStyle: { 54949 validate: (i) => { 54950 const s = i.rowStyle; 54951 return s && typeof s == "function" ? "rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead" : null; 54952 }, 54953 module: "RowStyle" 54954 }, 54955 serverSideDatasource: { 54956 supportedRowModels: ["serverSide"], 54957 module: "ServerSideRowModel" 54958 }, 54959 serverSideInitialRowCount: { 54960 supportedRowModels: ["serverSide"], 54961 validate({ serverSideInitialRowCount: i }) { 54962 return or("serverSideInitialRowCount", i, 1); 54963 } 54964 }, 54965 serverSideOnlyRefreshFilteredGroups: { 54966 supportedRowModels: ["serverSide"] 54967 }, 54968 serverSideSortAllLevels: { 54969 supportedRowModels: ["serverSide"] 54970 }, 54971 sideBar: { module: "SideBar" }, 54972 sortingOrder: { 54973 validate: (i) => { 54974 const s = i.sortingOrder; 54975 if (Array.isArray(s) && s.length > 0) { 54976 const n = s.filter((o) => !eg.includes(o)); 54977 if (n.length > 0) 54978 return `sortingOrder must be an array with elements from [${eg.map(nv).join()}], currently it includes [${n.map(nv).join()}]`; 54979 } else if (!Array.isArray(s) || s.length <= 0) 54980 return `sortingOrder must be an array with at least one element, currently it's ${s}`; 54981 return null; 54982 } 54983 }, 54984 statusBar: { module: "StatusBar" }, 54985 tooltipHideDelay: { 54986 validate: (i) => i.tooltipHideDelay && i.tooltipHideDelay < 0 ? "tooltipHideDelay should not be lower than 0" : null 54987 }, 54988 tooltipShowDelay: { 54989 validate: (i) => i.tooltipShowDelay && i.tooltipShowDelay < 0 ? "tooltipShowDelay should not be lower than 0" : null 54990 }, 54991 treeData: { 54992 supportedRowModels: ["clientSide", "serverSide"], 54993 module: "SharedTreeData", 54994 validate: (i) => { 54995 const s = i.rowModelType ?? "clientSide"; 54996 switch (s) { 54997 case "clientSide": { 54998 const n = `treeData requires 'getDataPath' in the ${s} row model.`; 54999 return i.treeDataChildrenField || i.getDataPath ? null : n; 55000 } 55001 case "serverSide": { 55002 const n = `treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${s} row model.`; 55003 return i.isServerSideGroup && i.getServerSideGroupKey ? null : n; 55004 } 55005 } 55006 return null; 55007 } 55008 }, 55009 treeDataChildrenField: { 55010 module: "SharedTreeData" 55011 }, 55012 undoRedoCellEditing: { module: "UndoRedoEdit" }, 55013 valueCache: { module: "ValueCache" }, 55014 viewportDatasource: { 55015 supportedRowModels: ["viewport"], 55016 module: "ViewportRowModel" 55017 }, 55018 viewportRowModelBufferSize: { 55019 validate({ viewportRowModelBufferSize: i }) { 55020 return or("viewportRowModelBufferSize", i, 0); 55021 } 55022 }, 55023 viewportRowModelPageSize: { 55024 validate({ viewportRowModelPageSize: i }) { 55025 return or("viewportRowModelPageSize", i, 1); 55026 } 55027 }, 55028 rowDragEntireRow: { 55029 dependencies: { 55030 cellSelection: { required: [void 0] } 55031 } 55032 } 55033 }, t = {}; 55034 return d_.forEach((i) => { 55035 t[i] = { expectedType: "boolean" }; 55036 }), u_.forEach((i) => { 55037 t[i] = { expectedType: "number" }; 55038 }), Ss(t, e), t; 55039}, $re = () => ({ 55040 objectName: "gridOptions", 55041 allProperties: [...uS, ...c_.map((e) => oM(e))], 55042 propertyExceptions: ["api", "treeDataChildrenField"], 55043 docsUrl: "grid-options/", 55044 deprecations: Wre(), 55045 validations: jre() 55046}), Yre = { 55047 expanded: 1, 55048 contracted: 1, 55049 "tree-closed": 1, 55050 "tree-open": 1, 55051 "tree-indeterminate": 1, 55052 pin: 1, 55053 "eye-slash": 1, 55054 arrows: 1, 55055 left: 1, 55056 right: 1, 55057 group: 1, 55058 aggregation: 1, 55059 pivot: 1, 55060 "not-allowed": 1, 55061 chart: 1, 55062 cross: 1, 55063 cancel: 1, 55064 tick: 1, 55065 first: 1, 55066 previous: 1, 55067 next: 1, 55068 last: 1, 55069 linked: 1, 55070 unlinked: 1, 55071 "color-picker": 1, 55072 loading: 1, 55073 menu: 1, 55074 "menu-alt": 1, 55075 filter: 1, 55076 columns: 1, 55077 maximize: 1, 55078 minimize: 1, 55079 copy: 1, 55080 cut: 1, 55081 paste: 1, 55082 grip: 1, 55083 save: 1, 55084 csv: 1, 55085 excel: 1, 55086 "small-down": 1, 55087 "small-left": 1, 55088 "small-right": 1, 55089 "small-up": 1, 55090 asc: 1, 55091 desc: 1, 55092 none: 1, 55093 up: 1, 55094 down: 1, 55095 plus: 1, 55096 minus: 1, 55097 settings: 1, 55098 "checkbox-checked": 1, 55099 "checkbox-indeterminate": 1, 55100 "checkbox-unchecked": 1, 55101 "radio-button-on": 1, 55102 "radio-button-off": 1, 55103 eye: 1 55104}, Kre = { 55105 chart: "MenuCore", 55106 cancel: "EnterpriseCore", 55107 first: "Pagination", 55108 previous: "Pagination", 55109 next: "Pagination", 55110 last: "Pagination", 55111 linked: "IntegratedCharts", 55112 loadingMenuItems: "MenuCore", 55113 unlinked: "IntegratedCharts", 55114 menu: "ColumnHeaderComp", 55115 legacyMenu: "ColumnMenu", 55116 filter: "ColumnFilter", 55117 filterActive: "ColumnFilter", 55118 filterTab: "ColumnMenu", 55119 filtersToolPanel: "FiltersToolPanel", 55120 columns: ["MenuCore"], 55121 columnsToolPanel: ["ColumnsToolPanel"], 55122 maximize: "EnterpriseCore", 55123 minimize: "EnterpriseCore", 55124 save: "MenuCore", 55125 columnGroupOpened: "ColumnGroupHeaderComp", 55126 columnGroupClosed: "ColumnGroupHeaderComp", 55127 accordionOpen: "EnterpriseCore", 55128 accordionClosed: "EnterpriseCore", 55129 accordionIndeterminate: "EnterpriseCore", 55130 columnSelectClosed: ["ColumnsToolPanel", "ColumnMenu"], 55131 columnSelectOpen: ["ColumnsToolPanel", "ColumnMenu"], 55132 columnSelectIndeterminate: ["ColumnsToolPanel", "ColumnMenu"], 55133 columnMovePin: "SharedDragAndDrop", 55134 columnMoveHide: "SharedDragAndDrop", 55135 columnMoveMove: "SharedDragAndDrop", 55136 columnMoveLeft: "SharedDragAndDrop", 55137 columnMoveRight: "SharedDragAndDrop", 55138 columnMoveGroup: "SharedDragAndDrop", 55139 columnMoveValue: "SharedDragAndDrop", 55140 columnMovePivot: "SharedDragAndDrop", 55141 dropNotAllowed: "SharedDragAndDrop", 55142 groupContracted: "GroupCellRenderer", 55143 groupExpanded: "GroupCellRenderer", 55144 setFilterGroupClosed: "SetFilter", 55145 setFilterGroupOpen: "SetFilter", 55146 setFilterGroupIndeterminate: "SetFilter", 55147 close: "EnterpriseCore", 55148 check: "MenuItem", 55149 colorPicker: "CommunityCore", 55150 groupLoading: "LoadingCellRenderer", 55151 menuAlt: "ColumnHeaderComp", 55152 menuPin: "MenuCore", 55153 menuValue: "MenuCore", 55154 menuAddRowGroup: ["MenuCore", "ColumnsToolPanel"], 55155 menuRemoveRowGroup: ["MenuCore", "ColumnsToolPanel"], 55156 clipboardCopy: "MenuCore", 55157 clipboardCut: "MenuCore", 55158 clipboardPaste: "MenuCore", 55159 pivotPanel: ["ColumnsToolPanel", "RowGroupingPanel"], 55160 rowGroupPanel: ["ColumnsToolPanel", "RowGroupingPanel"], 55161 valuePanel: "ColumnsToolPanel", 55162 columnDrag: "EnterpriseCore", 55163 rowDrag: ["RowDrag", "DragAndDrop"], 55164 csvExport: "MenuCore", 55165 excelExport: "MenuCore", 55166 smallDown: "CommunityCore", 55167 selectOpen: "CommunityCore", 55168 richSelectOpen: "RichSelect", 55169 richSelectRemove: "RichSelect", 55170 smallLeft: "CommunityCore", 55171 smallRight: "CommunityCore", 55172 subMenuOpen: "MenuItem", 55173 subMenuOpenRtl: "MenuItem", 55174 panelDelimiter: "RowGroupingPanel", 55175 panelDelimiterRtl: "RowGroupingPanel", 55176 smallUp: "CommunityCore", 55177 sortAscending: ["MenuCore", "Sort"],
55178 sortDescending: ["MenuCore", "Sort"], 55179 sortUnSort: ["MenuCore", "Sort"], 55180 advancedFilterBuilder: "AdvancedFilter", 55181 advancedFilterBuilderDrag: "AdvancedFilter", 55182 advancedFilterBuilderInvalid: "AdvancedFilter", 55183 advancedFilterBuilderMoveUp: "AdvancedFilter", 55184 advancedFilterBuilderMoveDown: "AdvancedFilter", 55185 advancedFilterBuilderAdd: "AdvancedFilter", 55186 advancedFilterBuilderRemove: "AdvancedFilter", 55187 advancedFilterBuilderSelectOpen: "AdvancedFilter", 55188 chartsMenu: "IntegratedCharts", 55189 chartsMenuEdit: "IntegratedCharts", 55190 chartsMenuAdvancedSettings: "IntegratedCharts", 55191 chartsMenuAdd: "IntegratedCharts", 55192 chartsColorPicker: "IntegratedCharts", 55193 chartsThemePrevious: "IntegratedCharts", 55194 chartsThemeNext: "IntegratedCharts", 55195 chartsDownload: "IntegratedCharts", 55196 checkboxChecked: "CommunityCore", 55197 checkboxIndeterminate: "CommunityCore", 55198 checkboxUnchecked: "CommunityCore", 55199 radioButtonOn: "CommunityCore", 55200 radioButtonOff: "CommunityCore" 55201}, Zre = /* @__PURE__ */ new Set([ 55202 "colorPicker", 55203 "smallUp", 55204 "checkboxChecked", 55205 "checkboxIndeterminate", 55206 "checkboxUnchecked", 55207 "radioButtonOn", 55208 "radioButtonOff", 55209 "smallDown", 55210 "smallLeft", 55211 "smallRight" 55212]), qre = { 55213 pinSubMenu: "PinnedColumn", 55214 pinLeft: "PinnedColumn", 55215 pinRight: "PinnedColumn", 55216 clearPinned: "PinnedColumn", 55217 valueAggSubMenu: "SharedAggregation", 55218 autoSizeThis: "ColumnAutoSize", 55219 autoSizeAll: "ColumnAutoSize", 55220 rowGroup: "SharedRowGrouping", 55221 rowUnGroup: "SharedRowGrouping", 55222 resetColumns: "CommunityCore", 55223 expandAll: ["ClientSideRowModelHierarchy", "ServerSideRowModel"], 55224 contractAll: ["ClientSideRowModelHierarchy", "ServerSideRowModel"], 55225 copy: "Clipboard", 55226 copyWithHeaders: "Clipboard", 55227 copyWithGroupHeaders: "Clipboard", 55228 cut: "Clipboard", 55229 paste: "Clipboard", 55230 export: ["CsvExport", "ExcelExport"], 55231 csvExport: "CsvExport", 55232 excelExport: "ExcelExport", 55233 separator: "CommunityCore", 55234 pivotChart: "IntegratedCharts", 55235 chartRange: "IntegratedCharts", 55236 columnFilter: "ColumnFilter", 55237 columnChooser: "ColumnMenu", 55238 sortAscending: "Sort", 55239 sortDescending: "Sort", 55240 sortUnSort: "Sort" 55241}, Qre = class extends he { 55242 constructor() { 55243 super(...arguments), this.beanName = "validation"; 55244 } 55245 wireBeans(e) { 55246 this.gridOptions = e.gridOptions, $Q(this); 55247 } 55248 postConstruct() { 55249 this.processGridOptions(this.gridOptions); 55250 } 55251 warnOnInitialPropertyUpdate(e, t) { 55252 e === "api" && Ere[t] && Ae(22, { key: t }); 55253 } 55254 processGridOptions(e) { 55255 this.processOptions(e, $re()); 55256 } 55257 validateApiFunction(e, t) { 55258 return Tre(e, t, this.beans); 55259 } 55260 missingUserComponent(e, t, i, s) { 55261 const n = pd[t]; 55262 n ? this.gos.assertModuleRegistered( 55263 n, 55264 `AG Grid '${e}' component: ${t}` 55265 ) : Ae(101, { 55266 propertyName: e, 55267 componentName: t, 55268 agGridDefaults: i, 55269 jsComps: s 55270 }); 55271 } 55272 checkRowEvents(e) { 55273 Jre.has(e) && Ae(10, { eventType: e }); 55274 } 55275 validateIcon(e) { 55276 if (Zre.has(e) && Ae(43, { iconName: e }), Yre[e]) 55277 return; 55278 const t = Kre[e]; 55279 if (t) { 55280 Rt(200, { 55281 reasonOrId: `icon '${e}'`, 55282 moduleName: t, 55283 gridScoped: cM(), 55284 gridId: this.beans.context.getGridId(), 55285 rowModelType: this.gos.get("rowModelType"), 55286 additionalText: "Alternatively, use the CSS icon name directly." 55287 }); 55288 return; 55289 } 55290 Ae(134, { iconName: e }); 55291 } 55292 validateMenuItem(e) { 55293 const t = qre[e]; 55294 t && this.gos.assertModuleRegistered(t, `menu item '${e}'`); 55295 } 55296 isProvidedUserComp(e) { 55297 return !!pd[e]; 55298 } 55299 validateColDef(e, t, i) { 55300 (i || !this.beans.dataTypeSvc?.isColPendingInference(t)) && this.processOptions(e, p_()); 55301 } 55302 processOptions(e, t) { 55303 const { validations: i, deprecations: s, allProperties: n, propertyExceptions: o, objectName: r, docsUrl: a } = t; 55304 n && this.gridOptions.suppressPropertyNamesCheck !== !0 && this.checkProperties( 55305 e, 55306 [...o ?? [], ...Object.keys(s)], 55307 n, 55308 r, 55309 a 55310 ); 55311 const l = /* @__PURE__ */ new Set(), c = (d) => { 55312 const p = i[d]; 55313 if (p) 55314 if (typeof p == "function") { 55315 const f = p(e, this.gridOptions, this.beans); 55316 if (!f) 55317 return; 55318 if ("objectName" in f) { 55319 const m = e[d]; 55320 if (Array.isArray(m)) { 55321 m.forEach((y) => { 55322 this.processOptions(y, f); 55323 }); 55324 return; 55325 } 55326 this.processOptions(e[d], f); 55327 return; 55328 } 55329 return f; 55330 } else 55331 return p; 55332 else return; 55333 };
55334 Object.keys(e).forEach((d) => { 55335 const p = s[d]; 55336 if (p) { 55337 const { message: A, version: I } = p; 55338 l.add(`As of v${I}, ${String(d)} is deprecated. ${A ?? ""}`); 55339 } 55340 const f = e[d]; 55341 if (f == null || f === !1) 55342 return; 55343 const m = c(d); 55344 if (!m) 55345 return; 55346 const { module: y, dependencies: b, validate: C, supportedRowModels: w, expectedType: M } = m; 55347 if (M) { 55348 const A = typeof f; 55349 if (A !== M) { 55350 l.add( 55351 `${String(d)} should be of type '${M}' but received '${A}' (${f}).` 55352 ); 55353 return; 55354 } 55355 } 55356 if (w) { 55357 const A = this.gridOptions.rowModelType ?? "clientSide"; 55358 if (!w.includes(A)) { 55359 l.add( 55360 `${String(d)} is not supported with the '${A}' row model. It is only valid with: ${w.join(", ")}.` 55361 ); 55362 return; 55363 } 55364 } 55365 if (y) { 55366 const A = Array.isArray(y) ? y : [y]; 55367 let I = !0; 55368 if (A.forEach((L) => { 55369 this.gos.assertModuleRegistered(L, String(d)) || (I = !1); 55370 }), !I) 55371 return; 55372 } 55373 if (b) { 55374 const A = this.checkForRequiredDependencies(d, b, e); 55375 if (A) { 55376 l.add(A); 55377 return; 55378 } 55379 } 55380 if (C) { 55381 const A = C(e, this.gridOptions, this.beans); 55382 if (A) { 55383 l.add(A); 55384 return; 55385 } 55386 } 55387 }), l.size > 0 && l.forEach((d) => { 55388 dp(d); 55389 }); 55390 } 55391 checkForRequiredDependencies(e, t, i) { 55392 const n = Object.entries(t).filter(([o, r]) => { 55393 const a = i[o]; 55394 return !r.required.includes(a); 55395 }); 55396 return n.length === 0 ? null : n.map( 55397 ([o, r]) => `'${String(e)}' requires '${o}' to be one of [${r.required.map((a) => a === null ? "null" : a === void 0 ? "undefined" : a).join(", ")}]. ${r.reason ?? ""}` 55398 ).join(` 55399 `); 55400 } 55401 checkProperties(e, t, i, s, n) { 55402 const o = ["__ob__", "__v_skip", "__metadata__"], r = Xre( 55403 Object.getOwnPropertyNames(e), 55404 [...o, ...t, ...i], 55405 i 55406 ); 55407 if (Object.entries(r).forEach(([a, l]) => { 55408 let c = `invalid ${s} property '${a}' did you mean any of these: ${l.slice(0, 8).join(", ")}.`; 55409 i.includes("context") && (c += ` 55410If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`), dp(c); 55411 }), Object.keys(r).length > 0 && n) { 55412 const a = this.beans.frameworkOverrides.getDocLink(n); 55413 dp(`to see all the valid ${s} properties please check: ${a}`); 55414 } 55415 } 55416 getConsoleMessage(e, t) { 55417 return Bre(e, t); 55418 } 55419}; 55420function Xre(e, t, i) { 55421 const s = {}, n = e.filter( 55422 (o) => !t.some((r) => r === o) 55423 ); 55424 return n.length > 0 && n.forEach( 55425 (o) => s[o] = h_({ inputValue: o, allSuggestions: i }).values 55426 ), s; 55427} 55428var Jre = /* @__PURE__ */ new Set([ 55429 "firstChildChanged", 55430 "lastChildChanged", 55431 "childIndexChanged" 55432]), eae = { 55433 moduleName: "Validation", 55434 version: Fe, 55435 beans: [Qre] 55436}; 55437function g_(e) { 55438 e.sibling && (e.sibling.childrenAfterFilter = e.childrenAfterFilter); 55439} 55440var tae = class extends he { 55441 constructor() { 55442 super(...arguments), this.beanName = "filterStage", this.refreshProps = /* @__PURE__ */ new Set(["excludeChildrenWhenTreeDataFiltering"]), this.step = "filter"; 55443 } 55444 wireBeans(e) { 55445 this.filterManager = e.filterManager; 55446 } 55447 execute(e) { 55448 const { changedPath: t } = e; 55449 this.filter(t); 55450 } 55451 filter(e) { 55452 const t = !!this.filterManager?.isChildFilterPresent(); 55453 this.filterNodes(t, e); 55454 } 55455 filterNodes(e, t) { 55456 const i = (s, n) => { 55457 s.hasChildren() && e && !n ? s.childrenAfterFilter = s.childrenAfterGroup.filter((o) => { 55458 const r = o.childrenAfterFilter && o.childrenAfterFilter.length > 0, a = o.data && this.filterManager.doesRowPassFilter({ rowNode: o }); 55459 return r || a; 55460 }) : s.childrenAfterFilter = s.childrenAfterGroup, g_(s); 55461 }; 55462 if (this.doingTreeDataFiltering()) { 55463 const s = (o, r) => { 55464 if (o.childrenAfterGroup) 55465 for (let a = 0; a < o.childrenAfterGroup.length; a++) { 55466 const l = o.childrenAfterGroup[a], c = r || this.filterManager.doesRowPassFilter({ rowNode: l }); 55467 l.childrenAfterGroup ? s(o.childrenAfterGroup[a], c) : i(l, c); 55468 } 55469 i(o, r); 55470 }, n = (o) => s(o, !1); 55471 t.executeFromRootNode(n); 55472 } else { 55473 const s = (n) => i(n, !1); 55474 t.forEachChangedNodeDepthFirst(s, !0); 55475 } 55476 } 55477 doingTreeDataFiltering() { 55478 return this.gos.get("treeData") && !this.gos.get("excludeChildrenWhenTreeDataFiltering"); 55479 } 55480}, iae = class extends CM { 55481 constructor() { 55482 super(...arguments), this.iconCreated = !1; 55483 } 55484 setComp(e, t, i, s, n) { 55485 this.comp = e; 55486 const o = Dg(this, this.beans.context, n); 55487 this.eButtonShowMainFilter = i, this.eFloatingFilterBody = s, this.setGui(t, o), this.setupActive(), this.setupWidth(o), this.setupLeft(o), this.setupHover(o), this.setupFocus(o), this.setupAria(), this.setupFilterButton(), this.setupUserComp(), this.setupSyncWithFilter(o), this.setupUi(), o.addManagedElementListeners(this.eButtonShowMainFilter, { click: this.showParentFilter.bind(this) }), this.setupFilterChangedListener(o), o.addManagedListeners(this.column, { colDefChanged: () => this.onColDefChanged(o) }), o.addDestroyFunc(() => { 55488 this.eButtonShowMainFilter = null, this.eFloatingFilterBody = null, this.userCompDetail
55488s = null, this.clearComponent(); 55489 }); 55490 } 55491 // empty abstract method 55492 resizeHeader() { 55493 } 55494 moveHeader() { 55495 } 55496 setupActive() { 55497 const e = this.column.getColDef(), t = !!e.filter, i = !!e.floatingFilter; 55498 this.active = t && i; 55499 } 55500 setupUi() { 55501 if (this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active), this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body", this.suppressFilterButton), this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body", !this.suppressFilterButton), !this.active || this.iconCreated) 55502 return; 55503 const e = po("filter", this.beans, this.column); 55504 e && (this.iconCreated = !0, this.eButtonShowMainFilter.appendChild(e)); 55505 } 55506 setupFocus(e) { 55507 e.createManagedBean( 55508 new sh(this.eGui, { 55509 shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this), 55510 onTabKeyDown: this.onTabKeyDown.bind(this), 55511 handleKeyDown: this.handleKeyDown.bind(this), 55512 onFocusIn: this.onFocusIn.bind(this) 55513 }) 55514 ); 55515 } 55516 setupAria() { 55517 const e = this.getLocaleTextFunc(); 55518 $y(this.eButtonShowMainFilter, e("ariaFilterMenuOpen", "Open Filter Menu")); 55519 } 55520 onTabKeyDown(e) { 55521 const { beans: t } = this; 55522 if (gi(t) === this.eGui) 55523 return; 55524 const n = iu(t, this.eGui, null, e.shiftKey); 55525 if (n) { 55526 t.headerNavigation?.scrollToColumn(this.column), e.preventDefault(), n.focus(); 55527 return; 55528 } 55529 const o = this.findNextColumnWithFloatingFilter(e.shiftKey); 55530 o && t.focusSvc.focusHeaderPosition({ 55531 headerPosition: { 55532 headerRowIndex: this.rowCtrl.rowIndex, 55533 column: o 55534 }, 55535 event: e 55536 }) && e.preventDefault(); 55537 } 55538 findNextColumnWithFloatingFilter(e) { 55539 const t = this.beans.visibleCols; 55540 let i = this.column; 55541 do 55542 if (i = e ? t.getColBefore(i) : t.getColAfter(i), !i) 55543 break; 55544 while (!i.getColDef().filter || !i.getColDef().floatingFilter); 55545 return i; 55546 } 55547 handleKeyDown(e) { 55548 super.handleKeyDown(e); 55549 const t = this.getWrapperHasFocus(); 55550 switch (e.key) { 55551 case de.UP: 55552 case de.DOWN: 55553 t || e.preventDefault(); 55554 case de.LEFT: 55555 case de.RIGHT: 55556 if (t) 55557 return; 55558 e.stopPropagation(); 55559 case de.ENTER: 55560 t && Gc(this.eGui) && e.preventDefault(); 55561 break; 55562 case de.ESCAPE: 55563 t || this.eGui.focus(); 55564 } 55565 } 55566 onFocusIn(e) { 55567 if (this.eGui.contains(e.relatedTarget)) 55568 return; 55569 const i = !!e.relatedTarget && !e.relatedTarget.classList.contains("ag-floating-filter"), s = !!e.relatedTarget && Ac(e.relatedTarget, "ag-floating-filter"); 55570 if (i && s && e.target === this.eGui) { 55571 const n = this.lastFocusEvent, o = !!(n && n.key === de.TAB); 55572 if (n && o) { 55573 const r = n.shiftKey; 55574 Gc(this.eGui, r); 55575 } 55576 } 55577 this.focusThis(); 55578 } 55579 setupHover(e) { 55580 this.beans.colHover?.addHeaderFilterColumnHoverListener(e, this.comp, this.column, this.eGui); 55581 } 55582 setupLeft(e) { 55583 const t = new yM(this.column, this.eGui, this.beans); 55584 e.createManagedBean(t); 55585 } 55586 setupFilterButton() { 55587 this.suppressFilterButton = !this.beans.menuSvc?.isFloatingFilterButtonEnabled(this.column), this.highlightFilterButtonWhenActive = !_n(this.gos); 55588 } 55589 setupUserComp() { 55590 if (!this.active) 55591 return; 55592 const e = this.beans.filterManager?.getFloatingFilterCompDetails( 55593 this.column, 55594 () => this.showParentFilter() 55595 ); 55596 e && this.setCompDetails(e); 55597 } 55598 setCompDetails(e) { 55599 this.userCompDetails = e, this.comp.setCompDetails(e); 55600 } 55601 showParentFilter() { 55602 const e = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter; 55603 this.beans.menuSvc?.showFilterMenu({ 55604 column: this.column, 55605 buttonElement: e, 55606 containerType: "floatingFilter", 55607 positionBy: "button" 55608 }); 55609 } 55610 setupSyncWithFilter(e) { 55611 if (!this.active) 55612 return; 55613 const { filterManager: t } = this.beans, i = (s) => { 55614 if (s?.source === "filterDestroyed" && !this.isAlive()) 55615 return; 55616 const n = this.comp.getFloatingFilterComp(); 55617 n && n.then((o) => { 55618 if (o) { 55619 const r = t?.getCurrentFloatingFilterParentModel(this.column), a = s ? { 55620 // event can have additional params like `afterDataChange` which need to be passed through 55621 ...s, 55622 columns: s.columns ?? [], 55623 source: s.source === "api" ? "api" : "columnFilter" 55624 } : null; 55625 o.onParentModelChanged(r, a); 55626 } 55627 }); 55628 }; 55629 [this.destroySyncListener] = e.addManagedListeners(this.column, { filterChanged: i }), t?.isFilterActive(this.column) && i(null); 55630 } 55631 setupWidth(e) { 55632 const t = () => { 55633 const i = `${this.column.getActualWidth()}px`; 55634 this.comp.setWidth(i); 55635 }; 55636 e.addManagedListeners(this.column, { widthChanged: t }), t(); 55637 } 55638 setupFilterChangedListener(e) { 55639 this.active && ([this.destroyFilterChangedListener] = e.addManagedListeners(this.column, { 55640 filterChanged: this.updateFilterButton.bind(this) 55641 }), this.updateFilterButton()); 55642 } 55643 updateFilterButton() { 55644 if (!this.suppressFilterButton && this.comp) {
55645 const e = !!this.beans.filterManager?.isFilterAllowed(this.column); 55646 this.comp.setButtonWrapperDisplayed(e), this.highlightFilterButtonWhenActive && e && this.eButtonShowMainFilter.classList.toggle("ag-filter-active", this.column.isFilterActive()); 55647 } 55648 } 55649 onColDefChanged(e) { 55650 const t = this.active; 55651 this.setupActive(); 55652 const i = !t && this.active; 55653 t && !this.active && (this.destroySyncListener(), this.destroyFilterChangedListener()); 55654 const s = this.active ? this.beans.filterManager?.getFloatingFilterCompDetails(this.column, () => this.showParentFilter()) : null, n = this.comp.getFloatingFilterComp(); 55655 !n || !s ? this.updateCompDetails(e, s, i) : n.then((o) => { 55656 !o || this.beans.filterManager?.areFilterCompsDifferent(this.userCompDetails ?? null, s) ? this.updateCompDetails(e, s, i) : this.updateFloatingFilterParams(s); 55657 }); 55658 } 55659 updateCompDetails(e, t, i) { 55660 this.isAlive() && (this.setCompDetails(t), this.setupFilterButton(), this.setupUi(), i && (this.setupSyncWithFilter(e), this.setupFilterChangedListener(e))); 55661 } 55662 updateFloatingFilterParams(e) { 55663 if (!e) 55664 return; 55665 const t = e.params; 55666 this.comp.getFloatingFilterComp()?.then((i) => { 55667 i?.refresh && typeof i.refresh == "function" && i.refresh(t); 55668 }); 55669 } 55670 addResizeAndMoveKeyboardListeners() { 55671 } 55672 destroy() { 55673 super.destroy(), this.destroySyncListener = null, this.destroyFilterChangedListener = null; 55674 } 55675}; 55676function sae(e, t) { 55677 const i = e.colModel.getCol(t); 55678 if (!i) { 55679 Rt(12, { colKey: t }); 55680 return; 55681 } 55682 e.menuSvc?.showColumnMenu({ 55683 column: i, 55684 positionBy: "auto" 55685 }); 55686} 55687function nae(e) { 55688 e.menuSvc?.hidePopupMenu(); 55689} 55690var oae = { 55691 moduleName: "SharedMenu", 55692 version: Fe, 55693 beans: [mte],
55694 apiFunctions: { 55695 showColumnMenu: sae, 55696 hidePopupMenu: nae 55697 } 55698}, rae = 0, aae = 200, lae = class extends he { 55699 constructor() { 55700 super(...arguments), this.beanName = "popupSvc", this.popupList = []; 55701 } 55702 postConstruct() { 55703 this.beans.ctrlsSvc.whenReady(this, (e) => { 55704 this.gridCtrl = e.gridCtrl; 55705 }), this.addManagedEventListeners({ gridStylesChanged: this.handleThemeChange.bind(this) }); 55706 } 55707 getPopupParent() { 55708 const e = this.gos.get("popupParent"); 55709 return e || this.gridCtrl.getGui(); 55710 } 55711 positionPopupForMenu(e) { 55712 const { eventSource: t, ePopup: i } = e, s = this.getPopupIndex(i); 55713 if (s !== -1) { 55714 const f = this.popupList[s]; 55715 f.alignedToElement = t; 55716 } 55717 const n = t.getBoundingClientRect(), o = this.getParentRect(), r = this.keepXYWithinBounds( 55718 i, 55719 n.top - o.top, 55720 0 55721 /* vertical */ 55722 ), a = i.clientWidth > 0 ? i.clientWidth : 200; 55723 i.style.minWidth = `${a}px`; 55724 const c = o.right - o.left - a; 55725 let u; 55726 this.gos.get("enableRtl") ? (u = p(), u < 0 && (u = d(), this.setAlignedStyles(i, "left")), u > c && (u = 0, this.setAlignedStyles(i, "right"))) : (u = d(), u > c && (u = p(), this.setAlignedStyles(i, "right")), u < 0 && (u = 0, this.setAlignedStyles(i, "left"))), i.style.left = `${u}px`, i.style.top = `${r}px`; 55727 function d() { 55728 return n.right - o.left - 2; 55729 } 55730 function p() { 55731 return n.left - o.left - a; 55732 } 55733 } 55734 positionPopupUnderMouseEvent(e) { 55735 const { ePopup: t, nudgeX: i, nudgeY: s, skipObserver: n } = e; 55736 this.positionPopup({ 55737 ePopup: t, 55738 nudgeX: i, 55739 nudgeY: s, 55740 keepWithinBounds: !0, 55741 skipObserver: n, 55742 updatePosition: () => this.calculatePointerAlign(e.mouseEvent), 55743 postProcessCallback: () => this.callPostProcessPopup( 55744 e.type, 55745 e.ePopup, 55746 null, 55747 e.mouseEvent, 55748 e.column, 55749 e.rowNode 55750 ) 55751 }); 55752 } 55753 calculatePointerAlign(e) { 55754 const t = this.getParentRect(); 55755 return { 55756 x: e.clientX - t.left, 55757 y: e.clientY - t.top 55758 }; 55759 } 55760 positionPopupByComponent(e) { 55761 const { 55762 ePopup: t, 55763 nudgeX: i, 55764 nudgeY: s, 55765 keepWithinBounds: n, 55766 eventSource: o, 55767 alignSide: r = "left", 55768 position: a = "over", 55769 column: l, 55770 rowNode: c, 55771 type: u 55772 } = e, d = o.getBoundingClientRect(), p = this.getParentRect(), f = this.getPopupIndex(t); 55773 if (f !== -1) { 55774 const y = this.popupList[f]; 55775 y.alignedToElement = o; 55776 } 55777 const m = () => { 55778 let y = d.left - p.left; 55779 r === "right" && (y -= t.offsetWidth - d.width); 55780 let b; 55781 return a === "over" ? (b = d.top - p.top, this.setAlignedStyles(t, "over")) : (this.setAlignedStyles(t, "under"), this.shouldRenderUnderOrAbove(t, d, p, e.nudgeY || 0) === "under" ? b = d.top - p.top + d.height : b = d.top - t.offsetHeight - (s || 0) * 2 - p.top), { x: y, y: b }; 55782 }; 55783 this.positionPopup({ 55784 ePopup: t, 55785 nudgeX: i, 55786 nudgeY: s, 55787 keepWithinBounds: n, 55788 updatePosition: m, 55789 postProcessCallback: () => this.callPostProcessPopup(u, t, o, null, l, c) 55790 }); 55791 } 55792 shouldRenderUnderOrAbove(e, t, i, s) { 55793 const n = i.bottom - t.bottom, o = t.top - i.top, r = e.offsetHeight + s; 55794 return n > r ? "under" : o > r || o > n ? "above" : "under"; 55795 } 55796 setAlignedStyles(e, t) { 55797 const i = this.getPopupIndex(e); 55798 if (i === -1) 55799 return; 55800 const s = this.popupList[i], { alignedToElement: n } = s; 55801 !n || (["right", "left", "over", "above", "under"].forEach((r) => { 55802 n.classList.remove(`ag-has-popup-positioned-${r}`), e.classList.remove(`ag-popup-positioned-${r}`); 55803 }), !t) || (n.classList.add(`ag-has-popup-positioned-${t}`), e.classList.add(`ag-popup-positioned-${t}`)); 55804 } 55805 callPostProcessPopup(e, t, i, s, n, o) { 55806 const r = this.gos.getCallback("postProcessPopup"); 55807 r && r({ 55808 column: n, 55809 rowNode: o, 55810 ePopup: t, 55811 type: e, 55812 eventSource: i, 55813 mouseEvent: s 55814 }); 55815 } 55816 positionPopup(e) { 55817 const { ePopup: t, keepWithinBounds: i, nudgeX: s, nudgeY: n, skipObserver: o, updatePosition: r } = e, a = { width: 0, height: 0 }, l = (c = !1) => { 55818 let { x: u, y: d } = r(); 55819 c && t.clientWidth === a.width && t.clientHeight === a.height || (a.width = t.clientWidth, a.height = t.clientHeight, s && (u += s), n && (d += n), i && (u = this.keepXYWithinBounds( 55820 t, 55821 u, 55822 1 55823 /* horizontal */ 55824 ), d = this.keepXYWithinBounds( 55825 t, 55826 d, 55827 0 55828 /* vertical */ 55829 )), t.style.left = `${u}px`, t.style.top = `${d}px`, e.postProcessCallback && e.postProcessCallback()); 55830 }; 55831 if (l(), !o) { 55832 const c = zl(this.beans, t, () => l(!0)); 55833 setTimeout(() => c(), aae); 55834 } 55835 } 55836 getActivePopups() { 55837 return this.popupList.map((e) => e.element); 55838 } 55839 getParentRect() { 55840 const e = Ei(this.beans); 55841 let t = this.getPopupParent(); 55842 return t === e.body ? t = e.documentElement : getComputedStyle(t).position === "static" && (t = t.offsetParent), bO(t); 55843 } 55844 keepXYWithinBounds(e, t, i) { 55845 const s = i === 0, n = s ? "clientHeight" : "clientWidth", o = s ? "top" : "left", r = s ? "height" : "width", a = s ? "scrollTop" : "scrollLeft", l = Ei(this.beans), c = l.documentElement, u = this.getPopupParent(), d = e.getBoundingClientRect(), p = u.getBoundingClientRect(), f = l.documentElement.getBoundingClientRect(), m = u === l.body, y = Math.ceil(d[r]); 55846 let C = m ? (s ? CO : Jm)(c) + c[a] : u[n]; 55847 m && (C -= Math.abs(f[o] - p[o])); 55848 const w = C - y; 55849 return Math.min(Math.max(t, 0), Math.abs(w)); 55850 } 55851 addPopup(e) { 55852 const t = Ei(this.beans), { eChild: i, ariaLabel: s, alwaysOnTop: n, positionCallback: o, anchorToElement: r }
55852 = e; 55853 if (!t) 55854 return Ae(122), { hideFunc: () => { 55855 } }; 55856 const a = this.getPopupIndex(i); 55857 if (a !== -1) 55858 return { hideFunc: this.popupList[a].hideFunc }; 55859 this.initialisePopupPosition(i); 55860 const l = this.createPopupWrapper(i, s, !!n), c = this.addEventListenersToPopup({ ...e, wrapperEl: l }); 55861 return o && o(), this.addPopupToPopupList(i, l, c, r), { 55862 hideFunc: c 55863 }; 55864 } 55865 initialisePopupPosition(e) { 55866 const i = this.getPopupParent().getBoundingClientRect(); 55867 Ie(e.style.top) || (e.style.top = `${i.top * -1}px`), Ie(e.style.left) || (e.style.left = `${i.left * -1}px`); 55868 } 55869 createPopupWrapper(e, t, i) { 55870 const s = this.getPopupParent(), n = document.createElement("div"), { environment: o, gos: r } = this.beans; 55871 return o.applyThemeClasses(n), n.classList.add("ag-popup"), e.classList.add(r.get("enableRtl") ? "ag-rtl" : "ag-ltr", "ag-popup-child"), e.hasAttribute("role") || en(e, "dialog"), $y(e, t), n.appendChild(e), s.appendChild(n), i ? this.setAlwaysOnTop(e, !0) : this.bringPopupToFront(e), n; 55872 } 55873 handleThemeChange(e) { 55874 if (e.themeChanged) { 55875 const t = this.beans.environment; 55876 for (const i of this.popupList) 55877 t.applyThemeClasses(i.wrapper); 55878 } 55879 } 55880 addEventListenersToPopup(e) { 55881 const t = this.beans, i = Ei(t), s = this.getPopupParent(), { wrapperEl: n, eChild: o, closedCallback: r, afterGuiAttached: a, closeOnEsc: l, modal: c } = e; 55882 let u = !1; 55883 const d = (y) => { 55884 if (!n.contains(gi(t))) 55885 return; 55886 y.key === de.ESCAPE && !ra(y) && m({ keyboardEvent: y }); 55887 }, p = (y) => m({ mouseEvent: y }), f = (y) => m({ touchEvent: y }), m = (y = {}) => { 55888 const { mouseEvent: b, touchEvent: C, keyboardEvent: w, forceHide: M } = y; 55889 !M && // we don't hide popup if the event was on the child, or any 55890 // children of this child 55891 (this.isEventFromCurrentPopup({ mouseEvent: b, touchEvent: C }, o) || // this method should only be called once. the client can have different 55892 // paths, each one wanting to close, so this method may be called multiple times. 55893 u) || (u = !0, s.removeChild(n), i.removeEventListener("keydown", d), i.removeEventListener("mousedown", p), i.removeEventListener("touchstart", f), i.removeEventListener("contextmenu", p), this.eventSvc.removeEventListener("dragStarted", p), r && r(b || C || w), this.removePopupFromPopupList(o)); 55894 }; 55895 return a && a({ hidePopup: m }), window.setTimeout(() => { 55896 l && i.addEventListener("keydown", d), c && (i.addEventListener("mousedown", p), this.eventSvc.addEventListener("dragStarted", p), i.addEventListener("touchstart", f), i.addEventListener("contextmenu", p)); 55897 }, 0), m; 55898 } 55899 addPopupToPopupList(e, t, i, s) { 55900 this.popupList.push({ 55901 element: e, 55902 wrapper: t, 55903 hideFunc: i, 55904 instanceId: rae++, 55905 isAnchored: !!s 55906 }), s && this.setPopupPositionRelatedToElement(e, s); 55907 } 55908 getPopupIndex(e) { 55909 return this.popupList.findIndex((t) => t.element === e); 55910 } 55911 setPopupPositionRelatedToElement(e, t) { 55912 const i = this.getPopupIndex(e); 55913 if (i === -1) 55914 return; 55915 const s = this.popupList[i]; 55916 if (s.stopAnchoringPromise && s.stopAnchoringPromise.then((o) => o && o()), s.stopAnchoringPromise = void 0, s.isAnchored = !1, !t) 55917 return; 55918 const n = this.keepPopupPositionedRelativeTo({ 55919 element: t, 55920 ePopup: e, 55921 hidePopup: s.hideFunc 55922 }); 55923 return s.stopAnchoringPromise = n, s.isAnchored = !0, n; 55924 } 55925 removePopupFromPopupList(e) { 55926 this.setAlignedStyles(e, null), this.setPopupPositionRelatedToElement(e, null), this.popupList = this.popupList.filter((t) => t.element !== e); 55927 } 55928 keepPopupPositionedRelativeTo(e) { 55929 const t = this.getPopupParent(), i = t.getBoundingClientRect(), { element: s, ePopup: n } = e, o = s.getBoundingClientRect(), r = (d) => parseInt(d.substring(0, d.length - 1), 10), a = (d, p) => { 55930 const f = i[d] - o[d], m = r(n.style[d]); 55931 return { 55932 initialDiff: f, 55933 lastDiff: f, 55934 initial: m, 55935 last: m, 55936 direction: p 55937 }; 55938 }, l = a( 55939 "top", 55940 0 55941 /* vertical */ 55942 ), c = a( 55943 "left", 55944 1 55945 /* horizontal */ 55946 ), u = this.beans.frameworkOverrides; 55947 return new gn((d) => { 55948 u.wrapIncoming(() => { 55949 u.setInterval(() => { 55950 const p = t.getBoundingClientRect(), f = s.getBoundingClientRect(); 55951 if (f.top == 0 && f.left == 0 && f.height == 0 && f.width == 0) { 55952 e.hidePopup(); 55953 return; 55954 } 55955 const y = (b, C) => { 55956 const w = r(n.style[C]); 55957 b.last !== w && (b.initial = w, b.last = w); 55958 const M = p[C] - f[C]; 55959 if (M != b.lastDiff) { 55960 const A = this.keepXYWithinBounds( 55961 n, 55962 b.initial + b.initialDiff - M, 55963 b.direction 55964 ); 55965 n.style[C] = `${A}px`, b.last = A; 55966 } 55967 b.lastDiff = M; 55968 }; 55969 y(l, "top"), y(c, "left"); 55970 }, 200).then((p) => { 55971 d(() => { 55972 p != null && window.clearInterval(p); 55973 }); 55974 }); 55975 }, "popupPositioning"); 55976 }); 55977 } 55978 hasAnchoredPopup() { 55979 return this.popupList.some((e) => e.isAnchored); 55980 } 55981 isEventFromCurrentPopup(e, t) { 55982 const { mouseEvent: i, touchEvent: s } = e, n = i || s; 55983 if (!n) 55984 return !1; 55985 const o = this.getPopupIndex(t); 55986 if (o === -1) 55987 return !1; 55988 for (let r = o; r < this.popupList.length; r++) { 55989 const a = this.popupList[r]; 55990 if (fX(a.element, n)) 55991 return !0; 55992 } 55993 return this.isElementWithinCustomPopup(n.target); 55994 } 55995 isElementWithinCustomPopup(e) { 55996 const t = Ei(this.beans); 55997 for (; e && e !== t.body; ) { 55998 if (e.classList.contains("ag-custom-component-popup") || e.parentElement === null) 55999 return !0; 56000 e = e.parentElement; 56001 } 56002 return !1; 56003 } 56004 getWrapper(e) { 56005 for (; !e.classList.contains("ag-popup") && e.parentElement; ) 56006 e = e.parentElement; 56007 return e.classList.contains("ag-popup") ? e : null; 56008 } 56009 setAlwaysOnTop(e, t) { 56010 const i = this.getWrapper(e); 56011 i && (i.classList.toggle("ag-always-on-top", !!t), t && this.bringPopupToFront(i)); 56012 } 56013 /** @return true if moved */ 56014 bringPopupToFront(e) { 56015 const t = this.getPopupParent(), i = Array.prototype.slice.call(t.querySelectorAll(".ag-popup")), s = i.length, n = this.getWrapper(e); 56016 if (!n || s <= 1 || !t.contains(e)) 56017 return; 56018 const o = [], r = []; 56019 for (const p of i) 56020 p !== n && (p.classList.contains("ag-always-on-top") ? r.push(p) : o.push(p)); 56021 const a = [], l = r.length, d = n.classList.contains("ag-always-on-top") || !l ? [...o, ...r, n] : [...o, n, ...r]; 56022 for (let p = 0; p <= s; p++) { 56023 const f = d[p]; 56024 if (i[p] === d[p] || f === n) 56025 continue; 56026 f.querySelectorAll("div").forEach((y) => { 56027 y.scrollTop !== 0 && a.push([y, y.scrollTop]); 56028 }), p === 0 ? t.insertAdjacentElement("afterbegin", f) : d[p - 1].insertAdjacentElement("afterend", f); 56029 } 56030 for (; a.length; ) { 56031 const p = a.pop(); 56032 p[0].scrollTop = p[1]; 56033 } 56034 } 56035}, Xy = { 56036 moduleName: "Popup", 56037 version: Fe, 56038 beans: [lae] 56039}, cae = ( 56040 /*css*/ 56041 ".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}
56041.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-set-floating-filter-input [disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:1px solid var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}
56041:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}" 56042); 56043function uae(e) { 56044 const t = e.filterManager; 56045 return !!t?.isColumnFilterPresent() || !!t?.isAggregateFilterPresent(); 56046} 56047function dae(e, t) { 56048 return e.filterManager?.getColumnFilterInstance(t) ?? Promise.resolve(void 0); 56049} 56050function hae(e, t) { 56051 const i = e.colModel.getColDefCol(t); 56052 if (i) 56053 return e.filterManager?.destroyFilter(i, "api"); 56054} 56055function pae(e, t) { 56056 e.frameworkOverrides.wrapIncoming(() => e.filterManager?.setFilterModel(t)); 56057} 56058function gae(e) { 56059 return e.filterManager?.getFilterModel() ?? {}; 56060} 56061function fae(e, t) { 56062 return e.filterManager?.getColumnFilterModel(t) ?? null; 56063} 56064function mae(e, t, i) { 56065 return e.filterManager?.setColumnFilterModel(t, i) ?? Promise.resolve(); 56066} 56067function vae(e, t) { 56068 const i = e.colModel.getCol(t); 56069 if (!i) { 56070 Rt(12, { colKey: t }); 56071 return; 56072 } 56073 e.menuSvc?.showFilterMenu({ 56074 column: i, 56075 containerType: "columnFilter", 56076 positionBy: "auto" 56077 }); 56078} 56079var gT = { 56080 january: "January", 56081 february: "February", 56082 march: "March", 56083 april: "April", 56084 may: "May", 56085 june: "June", 56086 july: "July", 56087 august: "August", 56088 september: "September", 56089 october: "October", 56090 november: "November", 56091 december: "December" 56092}, fT = [ 56093 "january", 56094 "february", 56095 "march", 56096 "april", 56097 "may", 56098 "june", 56099 "july", 56100 "august", 56101 "september", 56102 "october", 56103 "november", 56104 "december" 56105]; 56106function yae(e, t) { 56107 return e == null ? -1 : t == null ? 1 : parseFloat(e) - parseFloat(t); 56108} 56109var Cae = class extends he { 56110 constructor() { 56111 super(...arguments), this.beanName = "colFilter", this.allColumnFilters = /* @__PURE__ */ new Map(), this.allColumnListeners = /* @__PURE__ */ new Map(), this.activeAggregateFilters = [], this.activeColumnFilters = [], this.processingFilterChange = !1, this.filterModelUpdateQueue = [], this.columnFilterModelUpdateQueue = []; 56112 } 56113 postConstruct() { 56114 this.addManagedEventListeners({ 56115 gridColumnsChanged: this.onColumnsChanged.bind(this), 56116 beforeRefreshModel: ({ params: e }) => { 56117 (e.rowDataUpdated || e.changedProps?.has("treeData")) && this.onNewRowsLoaded("rowDataUpdated"); 56118 }, 56119 dataTypesInferred: this.processFilterModelUpdateQueue.bind(this) 56120 }), this.initialFilterModel = { 56121 ...this.gos.get("initialState")?.filter?.filterModel ?? {} 56122 }; 56123 } 56124 setFilterModel(e, t = "api") { 56125 const { colModel: i, dataTypeSvc: s, filterManager: n } = this.beans; 56126 if (s?.isPendingInference) { 56127 this.filterModelUpdateQueue.push({ model: e, source: t }); 56128 return; 56129 } 56130 const o = [], r = this.getFilterModel(!0); 56131 if (e) { 56132 const a = new Set(Object.keys(e));
56133 this.allColumnFilters.forEach((l, c) => { 56134 const u = e[c]; 56135 o.push(Zf(l.filterPromise, u)), a.delete(c); 56136 }), a.forEach((l) => { 56137 const c = i.getColDefCol(l) || i.getCol(l); 56138 if (!c) { 56139 Ae(62, { colId: l }); 56140 return; 56141 } 56142 if (!c.isFilterAllowed()) { 56143 Ae(63, { colId: l }); 56144 return; 56145 } 56146 const u = this.getOrCreateFilterWrapper(c); 56147 if (!u) { 56148 Ae(64, { colId: l }); 56149 return; 56150 } 56151 o.push(Zf(u.filterPromise, e[l])); 56152 }); 56153 } else 56154 this.allColumnFilters.forEach((a) => { 56155 o.push(Zf(a.filterPromise, null)); 56156 }); 56157 gn.all(o).then(() => { 56158 const a = this.getFilterModel(!0), l = []; 56159 this.allColumnFilters.forEach((c, u) => { 56160 const d = r ? r[u] : null, p = a ? a[u] : null; 56161 Yp(d, p) || l.push(c.column); 56162 }), l.length > 0 && n?.onFilterChanged({ columns: l, source: t }); 56163 }); 56164 } 56165 getFilterModel(e) { 56166 const t = {}, { 56167 allColumnFilters: i, 56168 initialFilterModel: s, 56169 beans: { colModel: n } 56170 } = this; 56171 return i.forEach((o, r) => { 56172 const a = this.getModelFromFilterWrapper(o); 56173 Ie(a) && (t[r] = a); 56174 }), e || Object.entries(s).forEach(([o, r]) => { 56175 Ie(r) && !i.has(o) && n.getCol(o)?.isFilterAllowed() && (t[o] = r); 56176 }), t; 56177 } 56178 getModelFromFilterWrapper(e) { 56179 const { filter: t } = e; 56180 return t ? typeof t.getModel != "function" ? (Ae(66), null) : t.getModel() : this.getModelFromInitialState(e.column); 56181 } 56182 getModelFromInitialState(e) { 56183 return this.initialFilterModel[e.getColId()] ?? null; 56184 } 56185 isColumnFilterPresent() { 56186 return this.activeColumnFilters.length > 0; 56187 } 56188 isAggregateFilterPresent() { 56189 return !!this.activeAggregateFilters.length; 56190 } 56191 disableColumnFilters() { 56192 const { allColumnFilters: e } = this; 56193 return e.size ? (e.forEach( 56194 (t) => this.disposeFilterWrapper(t, "advancedFilterEnabled") 56195 ), !0) : !1; 56196 } 56197 doAggregateFiltersPass(e, t) { 56198 return this.doColumnFiltersPass(e, t, !0); 56199 } 56200 updateActiveFilters() { 56201 const e = (a) => a ? a.isFilterActive ? a.isFilterActive() : (Ae(67), !1) : !1, { colModel: t, gos: i } = this.beans, s = !!$w(i), n = (a) => { 56202 if (!a.isPrimary()) 56203 return !0; 56204 const c = !t.isPivotActive(); 56205 return !a.isValueActive() || !c ? !1 : t.isPivotMode() ? !0 : s; 56206 }, o = [], r = []; 56207 return this.forEachColumnFilter((a, l) => { 56208 e(a) && (n(l.column) ? o.push(a) : r.push(a)); 56209 }).then(() => { 56210 this.activeAggregateFilters = o, this.activeColumnFilters = r; 56211 }); 56212 } 56213 updateFilterFlagInColumns(e, t) { 56214 return this.forEachColumnFilter( 56215 (i, s) => this.setColFilterActive(s.column, i.isFilterActive(), e, t) 56216 ); 56217 } 56218 forEachColumnFilter(e) { 56219 const t = []; 56220 return this.allColumnFilters.forEach((i) => { 56221 const s = i.filterPromise; 56222 s && t.push(s.then((n) => e(n, i))); 56223 }), gn.all(t); 56224 } 56225 doColumnFiltersPass(e, t, i) { 56226 const { data: s, aggData: n } = e, o = i ? this.activeAggregateFilters : this.activeColumnFilters, r = i ? n : s; 56227 for (let a = 0; a < o.length; a++) { 56228 const l = o[a]; 56229 if (!(l == null || l === t)) { 56230 if (typeof l.doesFilterPass != "function") { 56231 Rt(91); 56232 continue; 56233 } 56234 if (!l.doesFilterPass({ node: e, data: r })) 56235 return !1; 56236 } 56237 } 56238 return !0; 56239 } 56240 // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle 56241 // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens. 56242 // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer) 56243 // which results in React State getting applied in the main application, triggering a useEffect() to 56244 // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was 56245 // getting it's useEffect() triggered in this way. 56246 callOnFilterChangedOutsideRenderCycle(e) { 56247 const { rowRenderer: t, filterManager: i } = this.beans, s = () => { 56248 this.isAlive() && i?.onFilterChanged(e); 56249 }; 56250 t.isRefreshInProgress() ? setTimeout(s, 0) : s(); 56251 } 56252 updateBeforeFilterChanged(e = {}) { 56253 const { filterInstance: t, additionalEventAttributes: i } = e; 56254 return this.updateDependentFilters(), this.updateActiveFilters().then( 56255 () => this.updateFilterFlagInColumns("filterChanged", i).then(() => {
56256 this.allColumnFilters.forEach((s) => { 56257 s.filterPromise && s.filterPromise.then((n) => { 56258 n && n !== t && n.onAnyFilterChanged && n.onAnyFilterChanged(); 56259 }); 56260 }), this.processingFilterChange = !0; 56261 }) 56262 ); 56263 } 56264 updateAfterFilterChanged() { 56265 this.processingFilterChange = !1; 56266 } 56267 isSuppressFlashingCellsBecauseFiltering() { 56268 return !(this.gos.get("allowShowChangeAfterFilter") ?? !1) && this.processingFilterChange; 56269 } 56270 onNewRowsLoaded(e) { 56271 this.forEachColumnFilter((t) => { 56272 t.onNewRowsLoaded?.(); 56273 }).then(() => this.updateFilterFlagInColumns(e, { afterDataChange: !0 })).then(() => this.updateActiveFilters()); 56274 } 56275 createGetValue(e) { 56276 const { filterValueSvc: t, colModel: i } = this.beans; 56277 return (s, n) => { 56278 const o = n ? i.getCol(n) : e; 56279 return o ? t.getValue(o, s) : void 0; 56280 }; 56281 } 56282 isFilterActive(e) { 56283 const { filter: t } = this.cachedFilter(e) ?? {}; 56284 return t ? t.isFilterActive() : this.getModelFromInitialState(e) != null; 56285 } 56286 getOrCreateFilterWrapper(e) { 56287 if (!e.isFilterAllowed()) 56288 return null; 56289 let t = this.cachedFilter(e); 56290 return t || (t = this.createFilterWrapper(e), this.setColumnFilterWrapper(e, t)), t; 56291 } 56292 cachedFilter(e) { 56293 return this.allColumnFilters.get(e.getColId()); 56294 } 56295 getDefaultFilter(e) { 56296 let t; 56297 const { gos: i, dataTypeSvc: s } = this.beans; 56298 if (S0(i)) 56299 t = "agSetColumnFilter"; 56300 else { 56301 const n = s?.getBaseDataType(e); 56302 n === "number" ? t = "agNumberColumnFilter" : n === "date" || n === "dateString" ? t = "agDateColumnFilter" : t = "agTextColumnFilter"; 56303 } 56304 return t; 56305 } 56306 getDefaultFloatingFilter(e) { 56307 let t; 56308 const { gos: i, dataTypeSvc: s } = this.beans; 56309 if (S0(i)) 56310 t = "agSetColumnFloatingFilter"; 56311 else { 56312 const n = s?.getBaseDataType(e); 56313 n === "number" ? t = "agNumberColumnFloatingFilter" : n === "date" || n === "dateString" ? t = "agDateColumnFloatingFilter" : t = "agTextColumnFloatingFilter"; 56314 } 56315 return t; 56316 } 56317 createFilterInstance(e, t) { 56318 const i = this.getDefaultFilter(e), s = e.getColDef(); 56319 let n; 56320 const o = { 56321 ...this.createFilterParams(e, s), 56322 filterModifiedCallback: () => this.filterModifiedCallbackFactory(n, e)(), 56323 filterChangedCallback: (a) => this.filterChangedCallbackFactory(n, e)(a), 56324 doesRowPassOtherFilter: (a) => this.beans.filterManager?.doesRowPassOtherFilters(n, a) ?? !0 56325 }, r = SJ(this.beans.userCompFactory, s, o, i); 56326 return r ? { 56327 filterPromise: () => { 56328 const a = r.newAgStackInstance(); 56329 return a.then((l) => { 56330 n = l, t && (t.filter = l ?? void 0); 56331 }), a; 56332 }, 56333 compDetails: r 56334 } : { filterPromise: null, compDetails: null }; 56335 } 56336 createFilterParams(e, t) { 56337 return this.gos.addGridCommonParams({ 56338 column: e, 56339 colDef: t, 56340 rowModel: this.beans.rowModel, 56341 filterChangedCallback: () => { 56342 }, 56343 filterModifiedCallback: () => { 56344 }, 56345 getValue: this.createGetValue(e), 56346 doesRowPassOtherFilter: () => !0 56347 }); 56348 } 56349 createFilterWrapper(e) { 56350 const t = { 56351 column: e, 56352 filterPromise: null, 56353 compDetails: null 56354 }, { filterPromise: i, compDetails: s } = this.createFilterInstance(e, t); 56355 return t.filterPromise = i?.() ?? null, t.compDetails = s, t; 56356 } 56357 onColumnsChanged() { 56358 const e = [], { colModel: t, filterManager: i } = this.beans; 56359 this.allColumnFilters.forEach((n, o) => { 56360 let r; 56361 n.column.isPrimary() ? r = t.getColDefCol(o) : r = t.getCol(o), !(r && r === n.column) && (e.push(n.column), this.disposeFilterWrapper(n, "columnChanged"), this.disposeColumnListener(o)); 56362 }); 56363 const s = e.every( 56364 (n) => n.getColDef().filter === "agGroupColumnFilter" 56365 ); 56366 e.length > 0 && !s ? i?.onFilterChanged({ columns: e, source: "api" }) : this.updateDependentFilters(); 56367 } 56368 updateDependentFilters() { 56369 this.beans.autoColSvc?.getAutoCols()?.forEach((e) => { 56370 e.getColDef().filter === "agGroupColumnFilter" && this.getOrCreateFilterWrapper(e); 56371 }); 56372 } 56373 // for group filters, can change dynamically whether they are allowed or not 56374 isFilterAllowed(e) { 56375 if (!e.isFilterAllowed()) 56376 return !1; 56377 const { filter: i } = this.allColumnFilters.get(e.getColId()) ?? {}; 56378 return i && typeof i?.isFilterAllowed == "function" ? i.isFilterAllowed() : !0; 56379 }
56380 getFloatingFilterCompDetails(e, t) { 56381 const i = (u) => { 56382 const d = this.getOrCreateFilterWrapper(e)?.filterPromise; 56383 d?.then((p) => { 56384 u(Qp(p)); 56385 }); 56386 }, s = e.getColDef(), n = { 56387 ...this.createFilterParams(e, s), 56388 filterChangedCallback: () => i( 56389 (u) => this.filterChangedCallbackFactory(u, e)() 56390 ) 56391 }, { userCompFactory: o, frameworkOverrides: r } = this.beans, a = RJ( 56392 o, 56393 s, 56394 n 56395 ); 56396 let l = Dee( 56397 r, 56398 s, 56399 () => this.getDefaultFloatingFilter(e) 56400 ); 56401 return l == null && (l = "agReadOnlyFloatingFilter"), EJ(o, s, { 56402 column: e, 56403 filterParams: a, 56404 currentParentModel: () => this.getCurrentFloatingFilterParentModel(e), 56405 parentFilterInstance: i, 56406 showParentFilter: t 56407 }, l); 56408 } 56409 getCurrentFloatingFilterParentModel(e) { 56410 return this.getModelFromFilterWrapper(this.cachedFilter(e) ?? { column: e }); 56411 } 56412 // destroys the filter, so it no longer takes part 56413 destroyFilter(e, t = "api") { 56414 const i = e.getColId(), s = this.allColumnFilters.get(i); 56415 this.disposeColumnListener(i), delete this.initialFilterModel[i], s && (this.disposeFilterWrapper(s, t), this.beans.filterManager?.onFilterChanged({ 56416 columns: [e], 56417 source: "api" 56418 })); 56419 } 56420 disposeColumnListener(e) { 56421 const t = this.allColumnListeners.get(e); 56422 t && (this.allColumnListeners.delete(e), t()); 56423 } 56424 disposeFilterWrapper(e, t) { 56425 e.filterPromise?.then((i) => { 56426 this.destroyBean(i), this.setColFilterActive(e.column, !1, "filterDestroyed"), this.allColumnFilters.delete(e.column.getColId()), this.eventSvc.dispatchEvent({ 56427 type: "filterDestroyed", 56428 source: t, 56429 column: e.column 56430 }); 56431 }); 56432 } 56433 filterModifiedCallbackFactory(e, t) { 56434 return () => { 56435 this.eventSvc.dispatchEvent({ 56436 type: "filterModified", 56437 column: t, 56438 filterInstance: e 56439 }); 56440 }; 56441 } 56442 filterChangedCallbackFactory(e, t) { 56443 return (i) => { 56444 const s = i?.source ?? "columnFilter", n = { 56445 filter: e, 56446 additionalEventAttributes: i, 56447 columns: [t], 56448 source: s 56449 }; 56450 this.callOnFilterChangedOutsideRenderCycle(n); 56451 }; 56452 } 56453 checkDestroyFilter(e) { 56454 const t = this.allColumnFilters.get(e); 56455 if (!t) 56456 return; 56457 const i = t.column, { compDetails: s } = i.isFilterAllowed() ? this.createFilterInstance(i) : { compDetails: null }; 56458 if (this.areFilterCompsDifferent(t.compDetails, s)) { 56459 this.destroyFilter(i, "paramsUpdated"); 56460 return; 56461 } 56462 const n = i.getColDef().filterParams; 56463 if (!t.filterPromise) { 56464 this.destroyFilter(i, "paramsUpdated"); 56465 return; 56466 } 56467 t.filterPromise.then((o) => { 56468 (o?.refresh ? o.refresh({ 56469 ...this.createFilterParams(i, i.getColDef()), 56470 filterModifiedCallback: this.filterModifiedCallbackFactory(o, i), 56471 filterChangedCallback: this.filterChangedCallbackFactory(o, i), 56472 doesRowPassOtherFilter: (a) => this.beans.filterManager?.doesRowPassOtherFilters(o, a) ?? !0, 56473 ...n 56474 }) : !0) === !1 && this.destroyFilter(i, "paramsUpdated"); 56475 }); 56476 } 56477 setColumnFilterWrapper(e, t) { 56478 const i = e.getColId(); 56479 this.allColumnFilters.set(i, t), this.allColumnListeners.set( 56480 i, 56481 this.addManagedListeners(e, { colDefChanged: () => this.checkDestroyFilter(i) })[0] 56482 ); 56483 } 56484 areFilterCompsDifferent(e, t) { 56485 if (!t || !e) 56486 return !0; 56487 const { componentClass: i } = e, { componentClass: s } = t; 56488 return !(i === s || // react hooks returns new wrappers, so check nested render method 56489 i?.render && s?.render && i.render === s.render); 56490 } 56491 hasFloatingFilters() { 56492 return this.beans.colModel.getCols().some((t) => t.getColDef().floatingFilter); 56493 } 56494 getColumnFilterInstance(e) { 56495 return new Promise((t) => { 56496 this.getFilterInstanceImpl(e).then((i) => { 56497 t(Qp(i)); 56498 }); 56499 }); 56500 } 56501 getFilterInstanceImpl(e) { 56502 const t = this.beans.colModel.getColDefCol(e); 56503 return t ? this.getOrCreateFilterWrapper(t)?.filterPromise ?? gn.resolve(null) : gn.resolve(void 0); 56504 } 56505 processFilterModelUpdateQueue() { 56506 this.filterModelUpdateQueue.forEach(({ model: e, source: t }) => this.setFilterModel(e, t)), this.filterModelUpdateQueue = [], this.columnFilterModelUpdateQueue.forEach(({ key: e, model: t, resolve: i }) => { 56507 this.setColumnFilterModel(e, t).then(() => i()); 56508 }), this.columnFilterModelUpdateQueue = []; 56509 } 56510 getColumnFilterModel(e) { 56511 const t = this.getFilterWrapper(e); 56512 return t ? this.getModelFromFilterWrapper(t) : null; 56513 } 56514 setColumnFilterModel(e, t) { 56515 const { colModel: i, dataTypeSvc: s } = this.beans; 56516 if (s?.isPendingInference) { 56517 let a = () => { 56518 }; 56519 const l = new Promise((c) => { 56520 a = c; 56521 }); 56522 return this.columnFilterModelUpdateQueue.push({ key: e, model: t, resolve: a }), l; 56523 } 56524 const n = i.getColDefCol(e), o = n ? this.getOrCreateFilterWrapper(n) : null; 56525 return o ? ((a) => new Promise((l) => { 56526 a.then((c) => l(c)); 56527 }))(Zf(o.filterPromise, t)) : Promise.resolve(); 56528 } 56529 getFilterWrapper(e) { 56530 const t = this.beans.colModel.getColDefCol(e); 56531 return t ? this.cachedFilter(t) ?? null : null; 56532 } 56533 setColDefPropertiesForDataType(e, t, i) { 56534 const s = S0(this.gos), n = this.getLocaleTextFunc(), o = (r) => { 56535 const { filterParams: a } = e; 56536 e.filterParams = typeof a == "object" ? { 56537 ...a, 56538 ...r 56539 } : r; 56540 }; 56541 switch (t.baseDataType) { 56542 case "number": { 56543 s && o({ 56544 comparator: yae 56545 }); 56546 break; 56547 } 56548 case "boolean": { 56549 o(s ? {
56550 valueFormatter: (r) => Ie(r.value) ? n(String(r.value), r.value ? "True" : "False") : n("blanks", "(Blanks)") 56551 } : { 56552 maxNumConditions: 1, 56553 debounceMs: 0, 56554 filterOptions: [ 56555 "empty", 56556 { 56557 displayKey: "true", 56558 displayName: "True", 56559 predicate: (r, a) => a, 56560 numberOfInputs: 0 56561 }, 56562 { 56563 displayKey: "false", 56564 displayName: "False", 56565 predicate: (r, a) => a === !1, 56566 numberOfInputs: 0 56567 } 56568 ] 56569 }); 56570 break; 56571 } 56572 case "date": { 56573 s && o({ 56574 valueFormatter: (r) => { 56575 const a = i(r); 56576 return Ie(a) ? a : n("blanks", "(Blanks)"); 56577 }, 56578 treeList: !0, 56579 treeListFormatter: (r, a) => { 56580 if (a === 1 && r != null) { 56581 const l = fT[Number(r) - 1]; 56582 return n(l, gT[l]); 56583 } 56584 return r ?? n("blanks", "(Blanks)"); 56585 } 56586 }); 56587 break; 56588 } 56589 case "dateString": { 56590 const r = t.dateParser; 56591 o(s ? { 56592 valueFormatter: (a) => { 56593 const l = i(a); 56594 return Ie(l) ? l : n("blanks", "(Blanks)"); 56595 }, 56596 treeList: !0, 56597 treeListPathGetter: (a) => { 56598 const l = r(a ?? void 0); 56599 return l ? [String(l.getFullYear()), String(l.getMonth() + 1), String(l.getDate())] : null; 56600 }, 56601 treeListFormatter: (a, l) => { 56602 if (l === 1 && a != null) { 56603 const c = fT[Number(a) - 1]; 56604 return n(c, gT[c]); 56605 } 56606 return a ?? n("blanks", "(Blanks)"); 56607 } 56608 } : { 56609 comparator: (a, l) => { 56610 const c = r(l); 56611 return l == null || c < a ? -1 : c > a ? 1 : 0; 56612 } 56613 }); 56614 break; 56615 } 56616 case "object": { 56617 s ? o({ 56618 valueFormatter: (r) => { 56619 const a = i(r); 56620 return Ie(a) ? a : n("blanks", "(Blanks)"); 56621 } 56622 }) : e.filterValueGetter = (r) => i({ 56623 column: r.column, 56624 node: r.node, 56625 value: this.beans.valueSvc.getValue(r.column, r.node) 56626 }); 56627 break; 56628 } 56629 } 56630 } 56631 // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event 56632 setColFilterActive(e, t, i, s) { 56633 e.filterActive !== t && (e.filterActive = t, e.dispatchColEvent("filterActiveChanged", i)), e.dispatchColEvent("filterChanged", i, s); 56634 } 56635 destroy() { 56636 super.destroy(), this.allColumnFilters.forEach((e) => this.disposeFilterWrapper(e, "gridDestroyed")), this.allColumnListeners.clear(); 56637 } 56638}; 56639function Zf(e, t) { 56640 return e ? new gn((i) => { 56641 e.then((s) => { 56642 typeof s.setModel != "function" && (Ae(65), i()), (s.setModel(t) || gn.resolve()).then(() => i()); 56643 }); 56644 }) : gn.resolve(); 56645} 56646function bae(e) { 56647 return !!e.filterManager?.isAnyFilterPresent(); 56648} 56649function wae(e, t = "api") { 56650 e.filterManager?.onFilterChanged({ source: t }); 56651} 56652var Sae = class extends he { 56653 constructor() { 56654 super(...arguments), this.beanName = "filterManager", this.advFilterModelUpdateQueue = []; 56655 } 56656 wireBeans(e) { 56657 this.quickFilter = e.quickFilter, this.advancedFilter = e.advancedFilter, this.colFilter = e.colFilter; 56658 } 56659 postConstruct() { 56660 const e = this.refreshFiltersForAggregations.bind(this), t = this.updateAdvFilterColumns.bind(this); 56661 this.addManagedEventListeners({ 56662 columnValueChanged: e, 56663 columnPivotChanged: e, 56664 columnPivotModeChanged: e, 56665 newColumnsLoaded: t, 56666 columnVisible: t, 56667 advancedFilterEnabledChanged: ({ enabled: s }) => this.onAdvFilterEnabledChanged(s), 56668 dataTypesInferred: this.processFilterModelUpdateQueue.bind(this) 56669 }), this.externalFilterPresent = this.isExternalFilterPresentCallback(), this.addManagedPropertyListeners(["isExternalFilterPresent", "doesExternalFilterPass"], () => { 56670 this.onFilterChanged({ source: "api" }); 56671 }), this.updateAggFiltering(), this.addManagedPropertyListener("groupAggFiltering", () => { 56672 this.updateAggFiltering(), this.onFilterChanged(); 56673 }), this.quickFilter && this.addManagedListeners(this.quickFilter, { 56674 quickFilterChanged: () => this.onFilterChanged({ source: "quickFilter" }) 56675 }); 56676 const { gos: i } = this; 56677 this.alwaysPassFilter = i.get("alwaysPassFilter"), this.addManagedPropertyListener("alwaysPassFilter", () => { 56678 this.alwaysPassFilter = i.get("alwaysPassFilter"), this.onFilterChanged({ source: "api" }); 56679 }); 56680 } 56681 isExternalFilterPresentCallback() { 56682 const e = this.gos.getCallback("isExternalFilterPresent"); 56683 return typeof e == "function" && e({}); 56684 } 56685 doesExternalFilterPass(e) { 56686 const t = this.gos.get("doesExternalFilterPass"); 56687 return typeof t == "function" && t(e); 56688 } 56689 setFilterModel(e, t = "api") { 56690 if (this.isAdvFilterEnabled()) { 56691 this.warnAdvFilters(); 56692 return; 56693 } 56694 this.colFilter?.setFilterModel(e, t); 56695 } 56696 getFilterModel() { 56697 return this.colFilter?.getFilterModel() ?? {}; 56698 } 56699 isColumnFilterPresent() { 56700 return !!this.colFilter?.isColumnFilterPresent(); 56701 } 56702 isAggregateFilterPresent() { 56703 return !!this.colFilter?.isAggregateFilterPresent(); 56704 } 56705 isChildFilterPresent() { 56706 return this.isColumnFilterPresent() || this.isQuickFilterPresent() || this.externalFilterPresent || this.isAdvFilterPresent(); 56707 } 56708 isAnyFilterPresent() { 56709 return this.isChildFilterPresent() || this.isAggregateFilterPresent(); 56710 } 56711 isAdvFilterPresent() { 56712 return this.isAdvFilterEnabled() && this.advancedFilter.isFilterPresent(); 56713 } 56714 onAdvFilterEnabledChanged(e) { 56715 e ? this.colFilter?.disableColumnFilters() && this.onFilterChanged({ source: "advancedFilter" }) : this.advancedFilter?.isFilterPresent() && (this.advancedFilter.setModel(null), this.onFilterChanged({ source: "advancedFilter" })); 56716 } 56717 isAdvFilterEnabled() { 56718 return !!this.advancedFilter?.isEnabled(); 56719 } 56720 isAdvFilterHeaderActive() { 56721 return this.isAdvFilterEnabled() && this.advancedFilter.isHeaderActive(); 56722 } 56723 resetQuickFilterCache() { 56724 this.quickFilter?.resetCache(); 56725 } 56726 refreshFiltersForAggregations() { 56727 $w(this.gos) && this.onFilterChanged(); 56728 } 56729 onFilterChanged(e = {}) { 56730 const { source: t, additionalEventAttributes: i, columns: s = [] } = e; 56731 this.externalFilterPresent = this.isExternalFilterPresentCallback(), (this.colFilter ? this.colFilter.updateBeforeFilterChanged(e) : gn.resolve()).then(() => { 56732 const n = { 56733 source: t, 56734 type: "filterChanged", 56735 columns: s 56736 }; 56737 i && Ss(n, i), this.eventSvc.dispatchEvent(n), this.colFilter?.updateAfterFilterChanged(); 56738 }); 56739 } 56740 isSuppressFlashingCellsBecauseFiltering() { 56741 return !!this.colFilter?.isSuppressFlashingCellsBecauseFiltering(); 56742 } 56743 isQuickFilterPresent() { 56744 return !!this.quickFilter?.isFilterPresent(); 56745 } 56746 updateAggFiltering() { 56747 this.aggFiltering = !!$w(this.gos); 56748 } 56749 isAggregateQuickFilterPresent() { 56750 return this.isQuickFilterPresent() && this.shouldApplyQuickFilterAfterAgg(); 56751 } 56752 isNonAggregateQuickFilterPresent() { 56753 return this.isQuickFilterPresent() && !this.shouldApplyQuickFilterAfterAgg(); 56754 } 56755 shouldApplyQuickFilterAfterAgg() { 56756 return (this.aggFiltering || this.beans.colModel.isPivotMode()) && !this.gos.get("applyQuickFilterBeforePivotOrAgg"); 56757 } 56758 doesRowPassOtherFilters(e, t) { 56759 return this.doesRowPassFilter({ rowNode: t, filterInstanceToSkip: e }); 56760 } 56761 doesRowPassAggregateFilters(e) { 56762 const { rowNode: t } = e; 56763 return this.alwaysPassFilter?.(t) ? !0 : !(this.isAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(t) || this.isAggregateFilterPresent() && !this.colFilter.doAggregateFiltersPass(t, e.filterInstanceToSkip)); 56764 } 56765 doesRowPassFilter(e) { 56766 const { rowNode: t } = e; 56767 return this.alwaysPassFilter?.(t) ? !0 : !(this.isNonAggregateQuickFilterPresent() && !this.quickFilter.doesRowPass(t) || this.externalFilterPresent && !this.doesExternalFilterPass(t) || this.isColumnFilterPresent() && !this.colFilter.doColumnFiltersPass(t, e.filterInstanceToSkip) || this.isAdvFilterPresent() && !this.advancedFilter.doesFilterPass(t)); 56768 } 56769 isFilterActive(e) { 56770 return !!this.colFilter?.isFilterActive(e); 56771 } 56772 getOrCreateFilterWrapper(e) { 56773 return this.colFilter?.getOrCreateFilterWrapper(e) ?? null; 56774 } 56775 getDefaultFloatingFilter(e) { 56776 return this.colFilter.getDefaultFloatingFilter(e); 56777 } 56778 createFilterParams(e, t) { 56779 return this.colFilter.createFilterParams(e, t); 56780 } 56781 // for group filters, can change dynamically whether they are allowed or not 56782 isFilterAllowed(e) { 56783 return this.isAdvFilterEnabled() ? !1 : !!this.colFilter?.isFilterAllowed(e); 56784 }
56785 getFloatingFilterCompDetails(e, t) { 56786 return this.colFilter?.getFloatingFilterCompDetails(e, t); 56787 } 56788 getCurrentFloatingFilterParentModel(e) { 56789 return this.colFilter?.getCurrentFloatingFilterParentModel(e); 56790 } 56791 // destroys the filter, so it no longer takes part 56792 destroyFilter(e, t = "api") { 56793 this.colFilter?.destroyFilter(e, t); 56794 } 56795 areFilterCompsDifferent(e, t) { 56796 return !!this.colFilter?.areFilterCompsDifferent(e, t); 56797 } 56798 getAdvFilterModel() { 56799 return this.isAdvFilterEnabled() ? this.advancedFilter.getModel() : null; 56800 } 56801 setAdvFilterModel(e) { 56802 if (this.isAdvFilterEnabled()) { 56803 if (this.beans.dataTypeSvc?.isPendingInference) { 56804 this.advFilterModelUpdateQueue.push(e); 56805 return; 56806 } 56807 this.advancedFilter.setModel(e ?? null), this.onFilterChanged({ source: "advancedFilter" }); 56808 } 56809 } 56810 toggleAdvFilterBuilder(e, t) { 56811 this.isAdvFilterEnabled() && this.advancedFilter.getCtrl().toggleFilterBuilder({ source: t, force: e }); 56812 } 56813 updateAdvFilterColumns() { 56814 this.isAdvFilterEnabled() && this.advancedFilter.updateValidity() && this.onFilterChanged({ source: "advancedFilter" }); 56815 } 56816 hasFloatingFilters() { 56817 return this.isAdvFilterEnabled() ? !1 : !!this.colFilter?.hasFloatingFilters(); 56818 } 56819 getColumnFilterInstance(e) { 56820 return this.isAdvFilterEnabled() ? (this.warnAdvFilters(), Promise.resolve(void 0)) : this.colFilter?.getColumnFilterInstance(e) ?? Promise.resolve(void 0); 56821 } 56822 warnAdvFilters() { 56823 Ae(68); 56824 } 56825 setupAdvFilterHeaderComp(e) { 56826 this.advancedFilter?.getCtrl().setupHeaderComp(e); 56827 } 56828 getHeaderRowCount() { 56829 return this.isAdvFilterHeaderActive() ? 1 : 0; 56830 } 56831 getHeaderHeight() { 56832 return this.isAdvFilterHeaderActive() ? this.advancedFilter.getCtrl().getHeaderHeight() : 0; 56833 } 56834 processFilterModelUpdateQueue() { 56835 this.advFilterModelUpdateQueue.forEach((e) => this.setAdvFilterModel(e)), this.advFilterModelUpdateQueue = []; 56836 } 56837 getColumnFilterModel(e) { 56838 return this.colFilter?.getColumnFilterModel(e); 56839 } 56840 setColumnFilterModel(e, t) { 56841 return this.isAdvFilterEnabled() ? (this.warnAdvFilters(), Promise.resolve()) : this.colFilter?.setColumnFilterModel(e, t) ?? Promise.resolve(); 56842 } 56843 setColDefPropertiesForDataType(e, t, i) { 56844 this.colFilter?.setColDefPropertiesForDataType(e, t, i); 56845 } 56846}, xae = class extends he { 56847 constructor() { 56848 super(...arguments), this.beanName = "filterMenuFactory"; 56849 } 56850 wireBeans(e) { 56851 this.popupSvc = e.popupSvc; 56852 } 56853 hideActiveMenu() { 56854 this.hidePopup?.(); 56855 } 56856 showMenuAfterMouseEvent(e, t, i) { 56857 this.showPopup( 56858 e, 56859 (s) => { 56860 this.popupSvc?.positionPopupUnderMouseEvent({ 56861 column: e, 56862 type: i, 56863 mouseEvent: t, 56864 ePopup: s 56865 }); 56866 }, 56867 i, 56868 t.target, 56869 _n(this.gos) 56870 ); 56871 } 56872 showMenuAfterButtonClick(e, t, i) { 56873 let s = -1, n = "left"; 56874 const o = _n(this.gos); 56875 !o && this.gos.get("enableRtl") && (s = 1, n = "right"); 56876 const r = o ? void 0 : 4 * s, a = o ? void 0 : 4; 56877 this.showPopup( 56878 e, 56879 (l) => { 56880 this.popupSvc?.positionPopupByComponent({ 56881 type: i, 56882 eventSource: t, 56883 ePopup: l, 56884 nudgeX: r, 56885 nudgeY: a, 56886 alignSide: n, 56887 keepWithinBounds: !0, 56888 position: "under", 56889 column: e 56890 }); 56891 }, 56892 i, 56893 t, 56894 o 56895 ); 56896 } 56897 showPopup(e, t, i, s, n) { 56898 const o = e ? this.createBean(new wee(e, "COLUMN_MENU")) : void 0; 56899 if (this.activeMenu = o, !o?.hasFilter() || !e) { 56900 Rt(57); 56901 return; 56902 } 56903 const r = document.createElement("div"); 56904 en(r, "presentation"), r.classList.add("ag-menu"), n || r.classList.add("ag-filter-menu"), [this.tabListener] = this.addManagedElementListeners(r, { 56905 keydown: (m) => this.trapFocusWithin(m, r) 56906 }), r.appendChild(o?.getGui()); 56907 let a; 56908 const l = () => o?.afterGuiDetached(), c = uX(this.gos) ? s ?? this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody : void 0, u = (m) => { 56909 QR(e, !1, "contextMenu"); 56910 const y = m instanceof KeyboardEvent; 56911 this.tabListener && (this.tabListener = this.tabListener()), y && s && Yo(s) && dN(s)?.focu
56911s({ preventScroll: !0 }), l(), this.destroyBean(this.activeMenu), this.dispatchVisibleChangedEvent(!1, i, e); 56912 }, d = this.getLocaleTextFunc(), p = n && i !== "columnFilter" ? d("ariaLabelColumnMenu", "Column Menu") : d("ariaLabelColumnFilter", "Column Filter"), f = this.popupSvc?.addPopup({ 56913 modal: !0, 56914 eChild: r, 56915 closeOnEsc: !0, 56916 closedCallback: u, 56917 positionCallback: () => t(r), 56918 anchorToElement: c, 56919 ariaLabel: p 56920 }); 56921 f && (this.hidePopup = a = f.hideFunc), o.afterInit().then(() => { 56922 t(r), o.afterGuiAttached({ container: i, hidePopup: a }); 56923 }), QR(e, !0, "contextMenu"), this.dispatchVisibleChangedEvent(!0, i, e); 56924 } 56925 trapFocusWithin(e, t) { 56926 e.key !== de.TAB || e.defaultPrevented || iu(this.beans, t, !1, e.shiftKey) || (e.preventDefault(), Gc(t, e.shiftKey)); 56927 } 56928 dispatchVisibleChangedEvent(e, t, i) { 56929 this.eventSvc.dispatchEvent({ 56930 type: "columnMenuVisibleChanged", 56931 visible: e, 56932 switchingTab: !1, 56933 key: t, 56934 column: i ?? null, 56935 columnGroup: null 56936 }); 56937 } 56938 isMenuEnabled(e) { 56939 return e.isFilterAllowed() && (e.getColDef().menuTabs ?? ["filterMenuTab"]).includes("filterMenuTab"); 56940 } 56941 showMenuAfterContextMenuEvent() { 56942 } 56943 destroy() { 56944 this.destroyBean(this.activeMenu), super.destroy(); 56945 } 56946}, Mae = class extends he { 56947 constructor() { 56948 super(...arguments), this.beanName = "filterValueSvc"; 56949 } 56950 getValue(e, t) { 56951 if (!t) 56952 return; 56953 const i = e.getColDef(), { filterValueGetter: s } = i; 56954 return s ? this.executeFilterValueGetter(s, t.data, e, t, i) : this.beans.valueSvc.getValue(e, t); 56955 } 56956 executeFilterValueGetter(e, t, i, s, n) { 56957 const { expressionSvc: o, valueSvc: r } = this.beans, a = this.gos.addGridCommonParams({ 56958 data: t, 56959 node: s, 56960 column: i, 56961 colDef: n, 56962 getValue: r.getValueCallback.bind(r, s) 56963 }); 56964 return typeof e == "function" ? e(a) : o?.evaluate(e, a); 56965 } 56966}, Aae = class extends Tt { 56967 constructor() { 56968 super( 56969 /* html */ 56970 ` 56971 <div class="ag-floating-filter-input" role="presentation"> 56972 <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field> 56973 </div>`, 56974 [Zy] 56975 ), this.eFloatingFilterText = Pe; 56976 } 56977 init(e) { 56978 this.params = e; 56979 const t = this.beans.colNames.getDisplayNameForColumn(e.column, "header", !0); 56980 this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput", "Filter Input")}`); 56981 } 56982 onParentModelChanged(e) { 56983 if (e == null) { 56984 this.eFloatingFilterText.setValue(""); 56985 return; 56986 } 56987 this.params.parentFilterInstance((t) => { 56988 if (t.getModelAsString) { 56989 const i = t.getModelAsString(e); 56990 this.eFloatingFilterText.setValue(i); 56991 } 56992 }); 56993 } 56994 refresh(e) { 56995 this.init(e); 56996 } 56997}, f_ = class { 56998 constructor() { 56999 this.customFilterOptions = {}; 57000 } 57001 init(e, t) { 57002 this.filterOptions = e.filterOptions || t, this.mapCustomOptions(), this.selectDefaultItem(e); 57003 } 57004 mapCustomOptions() { 57005 const { filterOptions: e } = this; 57006 e && e.forEach((t) => { 57007 if (typeof t == "string") 57008 return; 57009 const i = [["displayKey"], ["displayName"], ["predicate", "test"]], s = (n) => n.some((o) => t[o] != null) ? !0 : (Ae(72, { keys: n }), !1); 57010 if (!i.every(s)) { 57011 this.filterOptions = e.filter((n) => n === t) || []; 57012 return; 57013 } 57014 this.customFilterOptions[t.displayKey] = t; 57015 }); 57016 } 57017 selectDefaultItem(e) { 57018 const { filterOptions: t } = this; 57019 if (e.defaultOption) 57020 this.defaultOption = e.defaultOption; 57021 else if (t.length >= 1) { 57022 const i = t[0]; 57023 typeof i == "string" ? this.defaultOption = i : i.displayKey ? this.defaultOption = i.displayKey : Ae(73); 57024 } else 57025 Ae(74); 57026 } 57027 getCustomOption(e) { 57028 return this.customFilterOptions[e]; 57029 } 57030}; 57031function mp(e, t, i) { 57032 return i == null ? e.splice(t) : e.splice(t, i); 57033} 57034function yv(e) { 57035 return e == null || typeof e == "string" && e.trim().length === 0; 57036} 57037function Dae(e) { 57038 return e === "AND" || e === "OR" ? e : "AND"; 57039} 57040function Eae(e, t, i) { 57041 if (e == null) 57042 return; 57043 const { predicate: s } = e; 57044 if (s != null && !t.some((n) => n == null)) 57045 return s(t, i); 57046} 57047function Iae(e, t) { 57048 let i = e.length; 57049 return i > t && (e.splice(t), Ae(78), i = t), i; 57050} 57051var m_ = class extends Aee { 57052 constructor() { 57053 super(...arguments), this.eTypes = [], this.eJoinOperatorPanels = [], this.eJoinOperatorsAnd = [], this.eJoinOperatorsOr = [], this.eConditionBodies = [], this.listener = () => this.onUiChanged(), this.lastUiCompletePosition = null, this.joinOperatorId = 0; 57054 } 57055 getNumberOfInputs(e) { 57056 const t = this.optionsFactory.getCustomOption(e); 57057 if (t) { 57058 const { numberOfInputs: s } = t; 57059 return s ?? 1; 57060 } 57061 return e && ["empty", "notBlank", "blank"].indexOf(e) >= 0 ? 0 : e === "inRange" ? 2 : 1; 57062 } 57063 // floating filter calls this when user applies filter from floating filter 57064 onFloatingFilterChanged(e, t) { 57065 this.setTypeFromFloatingFilter(e), this.setValueFromFloatingFilter(t), this.onUiChanged(!0); 57066 } 57067 setTypeFromFloatingFilter(e) {
57068 this.eTypes.forEach((t, i) => { 57069 const s = i === 0 ? e : this.optionsFactory.defaultOption; 57070 t.setValue(s, !0); 57071 }); 57072 } 57073 getModelFromUi() { 57074 const e = this.getUiCompleteConditions(); 57075 return e.length === 0 ? null : this.maxNumConditions > 1 && e.length > 1 ? { 57076 filterType: this.filterType, 57077 operator: this.getJoinOperator(), 57078 conditions: e 57079 } : e[0]; 57080 } 57081 getConditionTypes() { 57082 return this.eTypes.map((e) => e.getValue()); 57083 } 57084 getConditionType(e) { 57085 return this.eTypes[e].getValue(); 57086 } 57087 getJoinOperator() { 57088 const { eJoinOperatorsOr: e, defaultJoinOperator: t } = this; 57089 return e.length === 0 ? t : e[0].getValue() === !0 ? "OR" : "AND"; 57090 } 57091 areModelsEqual(e, t) { 57092 if (!e && !t) 57093 return !0; 57094 if (!e && t || e && !t) 57095 return !1; 57096 const i = !e.operator, s = !t.operator; 57097 if (!i && s || i && !s) 57098 return !1; 57099 let o; 57100 if (i) { 57101 const r = e, a = t; 57102 o = this.areSimpleModelsEqual(r, a); 57103 } else { 57104 const r = e, a = t; 57105 o = r.operator === a.operator && tu( 57106 r.conditions, 57107 a.conditions, 57108 (l, c) => this.areSimpleModelsEqual(l, c) 57109 ); 57110 } 57111 return o; 57112 } 57113 shouldRefresh(e) { 57114 const t = this.getModel(), i = t ? t.conditions ?? [t] : null, s = e.filterOptions?.map((o) => typeof o == "string" ? o : o.displayKey) ?? this.getDefaultFilterOptions(); 57115 return !(!(!i || i.every((o) => s.find((r) => r === o.type) !== void 0)) || typeof e.maxNumConditions == "number" && i && i.length > e.maxNumConditions); 57116 } 57117 refresh(e) { 57118 return !this.shouldRefresh(e) || !super.refresh(e) ? !1 : (this.setParams(e), this.removeConditionsAndOperators(0), this.createOption(), this.setModel(this.getModel()), !0); 57119 } 57120 setModelIntoUi(e) { 57121 if (e.operator) { 57122 const i = e; 57123 let s = i.conditions; 57124 s == null && (s = [], Ae(77)); 57125 const n = Iae(s, this.maxNumConditions), o = this.getNumConditions(); 57126 if (n < o) 57127 this.removeConditionsAndOperators(n); 57128 else if (n > o) 57129 for (let a = o; a < n; a++) 57130 this.createJoinOperatorPanel(), this.createOption(); 57131 const r = i.operator === "OR"; 57132 this.eJoinOperatorsAnd.forEach((a) => a.setValue(!r, !0)), this.eJoinOperatorsOr.forEach((a) =>
57132 a.setValue(r, !0)), s.forEach((a, l) => { 57133 this.eTypes[l].setValue(a.type, !0), this.setConditionIntoUi(a, l); 57134 }); 57135 } else { 57136 const i = e; 57137 this.getNumConditions() > 1 && this.removeConditionsAndOperators(1), this.eTypes[0].setValue(i.type, !0), this.setConditionIntoUi(i, 0); 57138 } 57139 return this.lastUiCompletePosition = this.getNumConditions() - 1, this.createMissingConditionsAndOperators(), this.onUiChanged(), gn.resolve(); 57140 } 57141 doesFilterPass(e) { 57142 const t = this.getModel(); 57143 if (t == null) 57144 return !0; 57145 const { operator: i } = t, s = []; 57146 if (i) { 57147 const o = t; 57148 s.push(...o.conditions ?? []); 57149 } else 57150 s.push(t); 57151 return s[i && i === "OR" ? "some" : "every"]((o) => this.individualConditionPasses(e, o)); 57152 } 57153 setParams(e) { 57154 super.setParams(e), this.setNumConditions(e), this.defaultJoinOperator = Dae(e.defaultJoinOperator), this.filterPlaceholder = e.filterPlaceholder, this.optionsFactory = new f_(), this.optionsFactory.init(e, this.getDefaultFilterOptions()), this.createFilterListOptions(), this.createOption(), this.createMissingConditionsAndOperators(), this.isReadOnly() && this.eFilterBody.setAttribute("tabindex", "-1"); 57155 } 57156 setNumConditions(e) { 57157 let t = e.maxNumConditions ?? 2; 57158 t < 1 && (Ae(79), t = 1), this.maxNumConditions = t; 57159 let i = e.numAlwaysVisibleConditions ?? 1; 57160 i < 1 && (Ae(80), i = 1), i > t && (Ae(81), i = t), this.numAlwaysVisibleConditions = i; 57161 } 57162 createOption() { 57163 const e = this.createManagedBean(new xM()); 57164 this.eTypes.push(e), e.addCssClass("ag-filter-select"), this.eFilterBody.appendChild(e.getGui()); 57165 const t = this.createValueElement(); 57166 this.eConditionBodies.push(t), this.eFilterBody.appendChild(t), this.putOptionsIntoDropdown(e), this.resetType(e); 57167 const i = this.getNumConditions() - 1; 57168 this.forEachPositionInput(i, (s) => this.resetInput(s)), this.addChangedListeners(e, i); 57169 } 57170 createJoinOperatorPanel() { 57171 const e = document.createElement("div"); 57172 this.eJoinOperatorPanels.push(e), e.classList.add("ag-filter-condition"); 57173 const t = this.createJoinOperator(this.eJoinOperatorsAnd, e, "and"), i = this.createJoinOperator(this.eJoinOperatorsOr, e, "or"); 57174 this.eFilterBody.appendChild(e); 57175 const s = this.eJoinOperatorPanels.length - 1, n = this.joinOperatorId++; 57176 this.resetJoinOperatorAnd(t, s, n), this.resetJoinOperatorOr(i, s, n), this.isReadOnly() || (t.onValueChange(this.listener), i.onValueChange(this.listener)); 57177 } 57178 createJoinOperator(e, t, i) { 57179 const s = this.createManagedBean(new kte()); 57180 e.push(s); 57181 const n = "ag-filter-condition-operator"; 57182 return s.addCssClass(n), s.addCssClass(`${n}-${i}`), t.appendChild(s.getGui()), s; 57183 } 57184 createFilterListOptions() { 57185 this.filterListOptions = this.optionsFactory.filterOptions.map( 57186 (e) => typeof e == "string" ? this.createBoilerplateListOption(e) : this.createCustomListOption(e) 57187 ); 57188 } 57189 putOptionsIntoDropdown(e) { 57190 const { filterListOptions: t } = this; 57191 t.forEach((i) => { 57192 e.addOption(i); 57193 }), e.setDisabled(t.length <= 1); 57194 } 57195 createBoilerplateListOption(e) { 57196 return { value: e, text: this.translate(e) }; 57197 } 57198 createCustomListOption(e) { 57199 const { displayKey: t } = e, i = this.optionsFactory.getCustomOption(e.displayKey); 57200 return { 57201 value: t, 57202 text: i ? this.getLocaleTextFunc()(i.displayKey, i.displayName) : this.translate(t) 57203 }; 57204 } 57205 createBodyTemplate() { 57206 return ""; 57207 } 57208 getAgComponents() { 57209 return []; 57210 } 57211 getCssIdentifier() { 57212 return "simple-filter"; 57213 } 57214 updateUiVisibility() { 57215 const e = this.getJoinOperator(); 57216 this.updateNumConditions(), this.updateConditionStatusesAndValues(this.lastUiCompletePosition, e); 57217 } 57218 updateNumConditions() { 57219 let e = -1, t = !0; 57220 for (let i = 0; i < this.getNumConditions(); i++) 57221 this.isConditionUiComplete(i) ? e = i : t = !1; 57222 if (this.shouldAddNewConditionAtEnd(t)) 57223 this.createJoinOperatorPanel(), this.createOption(); 57224 else {
57225 const i = this.lastUiCompletePosition ?? this.getNumConditions() - 2; 57226 if (e < i) { 57227 this.removeConditionsAndOperators(i + 1); 57228 const s = e + 1, n = i - s; 57229 n > 0 && this.removeConditionsAndOperators(s, n), this.createMissingConditionsAndOperators(); 57230 } 57231 } 57232 this.lastUiCompletePosition = e; 57233 } 57234 updateConditionStatusesAndValues(e, t) { 57235 this.eTypes.forEach((s, n) => { 57236 const o = this.isConditionDisabled(n, e); 57237 s.setDisabled(o || this.filterListOptions.length <= 1), n === 1 && (Wp(this.eJoinOperatorPanels[0], o), this.eJoinOperatorsAnd[0].setDisabled(o), this.eJoinOperatorsOr[0].setDisabled(o)); 57238 }), this.eConditionBodies.forEach((s, n) => { 57239 ui(s, this.isConditionBodyVisible(n)); 57240 }); 57241 const i = (t ?? this.getJoinOperator()) === "OR"; 57242 this.eJoinOperatorsAnd.forEach((s) => { 57243 s.setValue(!i, !0); 57244 }), this.eJoinOperatorsOr.forEach((s) => { 57245 s.setValue(i, !0); 57246 }), this.forEachInput((s, n, o, r) => { 57247 this.setElementDisplayed(s, n < r), this.setElementDisabled(s, this.isConditionDisabled(o, e)); 57248 }), this.resetPlaceholder(); 57249 } 57250 shouldAddNewConditionAtEnd(e) { 57251 return e && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly(); 57252 } 57253 removeConditionsAndOperators(e, t) { 57254 if (e >= this.getNumConditions()) 57255 return; 57256 const { eTypes: i, eConditionBodies: s, eJoinOperatorPanels: n, eJoinOperatorsAnd: o, eJoinOperatorsOr: r } = this; 57257 this.removeComponents(i, e, t), this.removeElements(s, e, t), this.removeValueElements(e, t); 57258 const a = Math.max(e - 1, 0); 57259 this.removeElements(n, a, t), this.removeComponents(o, a, t), this.removeComponents(r, a, t); 57260 } 57261 removeElements(e, t, i) { 57262 mp(e, t, i).forEach((n) => pr(n)); 57263 } 57264 removeComponents(e, t, i) { 57265 mp(e, t, i).forEach((n) => { 57266 pr(n.getGui()), this.destroyBean(n); 57267 }); 57268 } 57269 afterGuiAttached(e) { 57270 if (super.afterGuiAttached(e), this.resetPlaceholder(), !e?.suppressFocus) { 57271 const { eFilterBody: t, eTypes: i } = this; 57272 let s; 57273 if (!this.isReadOnly()) { 57274 const n = this.getInputs(0)[0]; 57275 n instanceof Cc && this.isConditionBodyVisible(0) ? s = n.getInputElement() : s = i[0]?.getFocusableElement(); 57276 } 57277 (s ?? t).focus({ preventScroll: !0 }); 57278 } 57279 } 57280 afterGuiDetached() { 57281 super.afterGuiDetached(); 57282 const e = this.getModel(); 57283 this.resetUiToActiveModel(e); 57284 let t = -1, i = -1, s = !1; 57285 const n = this.getJoinOperator(); 57286 for (let r = this.getNumConditions() - 1; r >= 0; r--) 57287 if (this.isConditionUiComplete(r)) 57288 t === -1 && (t = r, i = r); 57289 else { 57290 const a = r >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(r - 1), l = r < t; 57291 (a || l) && (this.removeConditionsAndOperators(r, 1), s = !0, l && i--); 57292 } 57293 let o = !1; 57294 this.getNumConditions() < this.numAlwaysVisibleConditions && (this.createMissingConditionsAndOperators(), o = !0), this.shouldAddNewConditionAtEnd(i === this.getNumConditions() - 1) && (this.createJoinOperatorPanel(), this.createOption(), o = !0), o && this.updateConditionStatusesAndValues(i, n), s && this.updateJoinOperatorsDisabled(), this.lastUiCompletePosition = i; 57295 } 57296 getPlaceholderText(e, t) { 57297 let i = this.translate(e); 57298 if (typeof this.filterPlaceholder == "function") { 57299 const s = this.eTypes[t].getValue(), n = this.translate(s); 57300 i = this.filterPlaceholder({ 57301 filterOptionKey: s, 57302 filterOption: n, 57303 placeholder: i 57304 }); 57305 } else typeof this.filterPlaceholder == "string" && (i = this.filterPlaceholder); 57306 return i; 57307 } 57308 // allow sub-classes to reset HTML placeholders after UI update. 57309 resetPlaceholder() { 57310 const e = this.getLocaleTextFunc(); 57311 this.forEachInput((t, i, s, n) => { 57312 if (!(t instanceof Cc)) 57313 return; 57314 const o = i === 0 && n > 1 ? "inRangeStart" : i === 0 ? "filterOoo" : "inRangeEnd", r = i === 0 && n > 1 ? e("ariaFilterFromValue", "Filter from value") : i === 0 ? e("ariaFilterValue", "Filter Value") : e("ariaFilterToValue", "Filter to Value"); 57315 t.setInputPlaceholder(this.getPlaceholderText(o, s)), t.setInputAriaLabel(r); 57316 }); 57317 } 57318 // eslint-disable-next-line @typescript-eslint/no-unused-vars 57319 setElementValue(e, t, i) { 57320 e instanceof Cc && e.setValue(t != null ? String(t) : null, !0); 57321 } 57322 setElementDisplayed(e, t) { 57323 e instanceof Tt && ui(e.getGui(), t); 57324 } 57325 setElementDisabled(e, t) { 57326 e instanceof Tt && Wp(e.getGui(), t); 57327 } 57328 attachElementOnChange(e, t) { 57329 e instanceof Cc && e.onValueChange(t); 57330 } 57331 forEachInput(e) {
57332 this.getConditionTypes().forEach((t, i) => { 57333 this.forEachPositionTypeInput(i, t, e); 57334 }); 57335 } 57336 forEachPositionInput(e, t) { 57337 const i = this.getConditionType(e); 57338 this.forEachPositionTypeInput(e, i, t); 57339 } 57340 forEachPositionTypeInput(e, t, i) { 57341 const s = this.getNumberOfInputs(t), n = this.getInputs(e); 57342 for (let o = 0; o < n.length; o++) { 57343 const r = n[o]; 57344 r != null && i(r, o, e, s); 57345 } 57346 } 57347 isConditionDisabled(e, t) { 57348 return this.isReadOnly() ? !0 : e === 0 ? !1 : e > t + 1; 57349 } 57350 isConditionBodyVisible(e) { 57351 const t = this.getConditionType(e); 57352 return this.getNumberOfInputs(t) > 0; 57353 } 57354 // returns true if the UI represents a working filter, eg all parts are filled out. 57355 // eg if text filter and textfield blank then returns false. 57356 isConditionUiComplete(e) { 57357 return !(e >= this.getNumConditions() || this.getConditionType(e) === "empty" || this.getValues(e).some((i) => i == null)); 57358 } 57359 getNumConditions() { 57360 return this.eTypes.length; 57361 } 57362 getUiCompleteConditions() { 57363 const e = []; 57364 for (let t = 0; t < this.getNumConditions(); t++) 57365 this.isConditionUiComplete(t) && e.push(this.createCondition(t)); 57366 return e; 57367 } 57368 createMissingConditionsAndOperators() { 57369 if (!this.isReadOnly()) 57370 for (let e = this.getNumConditions(); e < this.numAlwaysVisibleConditions; e++) 57371 this.createJoinOperatorPanel(), this.createOption(); 57372 } 57373 resetUiToDefaults(e) { 57374 return this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions), this.eTypes.forEach((t) => this.resetType(t)), this.eJoinOperatorsAnd.forEach( 57375 (t, i) => this.resetJoinOperatorAnd(t, i, this.joinOperatorId + i) 57376 ), this.eJoinOperatorsOr.forEach( 57377 (t, i) => this.resetJoinOperatorOr(t, i, this.joinOperatorId + i) 57378 ), this.joinOperatorId++, this.forEachInput((t) => this.resetInput(t)), this.resetPlaceholder(), this.createMissingConditionsAndOperators(), this.lastUiCompletePosition = null, e || this.onUiChanged(), gn.resolve(); 57379 } 57380 resetType(e) { 57381 const i = this.getLocaleTextFunc()("ariaFilteringOperator", "Filtering operator"); 57382 e.setValue(this.optionsFactory.defaultOption, !0).setAriaLabel(i).setDisabled(this.isReadOnly() || this.filterListOptions.length <= 1); 57383 } 57384 resetJoinOperatorAnd(e, t, i) { 57385 this.resetJoinOperator( 57386 e, 57387 t, 57388 this.defaultJoinOperator === "AND", 57389 this.translate("andCondition"), 57390 i 57391 ); 57392 } 57393 resetJoinOperatorOr(e, t, i) { 57394 this.resetJoinOperator( 57395 e, 57396 t, 57397 this.defaultJoinOperator === "OR", 57398 this.translate("orCondition"), 57399 i 57400 ); 57401 } 57402 resetJoinOperator(e, t, i, s, n) { 57403 this.updateJoinOperatorDisabled( 57404 e.setValue(i, !0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${n}`).setLabel(s), 57405 t 57406 ); 57407 } 57408 updateJoinOperatorsDisabled() { 57409 const e = (t, i) => this.updateJoinOperatorDisabled(t, i); 57410 this.eJoinOperatorsAnd.forEach(e), this.eJoinOperatorsOr.forEach(e); 57411 } 57412 updateJoinOperatorDisabled(e, t) { 57413 e.setDisabled(this.isReadOnly() || t > 0); 57414 } 57415 resetInput(e) { 57416 this.setElementValue(e, null), this.setElementDisabled(e, this.isReadOnly()); 57417 } 57418 // puts model values into the UI 57419 setConditionIntoUi(e, t) { 57420 const i = this.mapValuesFromModel(e); 57421 this.forEachInput((s, n, o) => { 57422 o === t && this.setElementValue(s, i[n] != null ? i[n] : null); 57423 }); 57424 } 57425 // after floating filter changes, this sets the 'value' section. this is implemented by the base class 57426 // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class. 57427 setValueFromFloatingFilter(e) { 57428 this.forEachInput((t, i, s) => { 57429 this.setElementValue(t, i === 0 && s === 0 ? e : null, !0); 57430 }); 57431 } 57432 addChangedListeners(e, t) { 57433 this.isReadOnly() || (e.onValueChange(this.listener), this.forEachPositionInput(t, (i) => { 57434 this.attachElementOnChange(i, this.listener); 57435 })); 57436 } 57437 /** returns true if the row passes the said condition */ 57438 individualConditionPasses(e, t) { 57439 const i = this.getCellValue(e.node), s = this.mapValuesFromModel(t), n = this.optionsFactory.getCustomOption(t.type), o = Eae(n, s, i);
57440 return o ?? (i == null ? this.evaluateNullValue(t.type) : this.evaluateNonNullValue(s, i, t, e)); 57441 } 57442 hasInvalidInputs() { 57443 return !1; 57444 } 57445}, v_ = class extends m_ { 57446 setParams(e) { 57447 super.setParams(e), this.scalarFilterParams = e; 57448 } 57449 evaluateNullValue(e) { 57450 const { 57451 includeBlanksInEquals: t, 57452 includeBlanksInNotEqual: i, 57453 includeBlanksInGreaterThan: s, 57454 includeBlanksInLessThan: n, 57455 includeBlanksInRange: o 57456 } = this.scalarFilterParams; 57457 switch (e) { 57458 case "equals": 57459 if (t) 57460 return !0; 57461 break; 57462 case "notEqual": 57463 if (i) 57464 return !0; 57465 break; 57466 case "greaterThan": 57467 case "greaterThanOrEqual": 57468 if (s) 57469 return !0; 57470 break; 57471 case "lessThan": 57472 case "lessThanOrEqual": 57473 if (n) 57474 return !0; 57475 break; 57476 case "inRange": 57477 if (o) 57478 return !0; 57479 break; 57480 case "blank": 57481 return !0; 57482 case "notBlank": 57483 return !1; 57484 } 57485 return !1; 57486 } 57487 evaluateNonNullValue(e, t, i) { 57488 const s = this.comparator(), n = e[0] != null ? s(e[0], t) : 0; 57489 switch (i.type) { 57490 case "equals": 57491 return n === 0; 57492 case "notEqual": 57493 return n !== 0; 57494 case "greaterThan": 57495 return n > 0; 57496 case "greaterThanOrEqual": 57497 return n >= 0; 57498 case "lessThan": 57499 return n < 0; 57500 case "lessThanOrEqual": 57501 return n <= 0; 57502 case "inRange": { 57503 const o = s(e[1], t); 57504 return this.scalarFilterParams.inRangeInclusive ? n >= 0 && o <= 0 : n > 0 && o < 0; 57505 } 57506 case "blank": 57507 return yv(t); 57508 case "notBlank": 57509 return !yv(t); 57510 default: 57511 return Ae(76, { filterModelType: i.type }), !0; 57512 } 57513 } 57514}, y_ = class { 57515 constructor(e, t, i, s, n) { 57516 this.alive = !0, this.context = e, this.eParent = s; 57517 const o = xJ(t, i); 57518 o && o.newAgStackInstance().then((r) => { 57519 if (!this.alive) { 57520 e.destroyBean(r); 57521 return; 57522 } 57523 if (this.dateComp = r, !r) 57524 return; 57525 s.appendChild(r.getGui()), r?.afterGuiAttached?.(); 57526 const { tempValue: a, disabled: l } = this; 57527 a && r.setDate(a), l != null && r.setDisabled?.(l), n?.(this); 57528 }); 57529 } 57530 destroy() { 57531 this.alive = !1, this.dateComp = this.context.destroyBean(this.dateComp); 57532 } 57533 getDate() { 57534 return this.dateComp ? this.dateComp.getDate() : this.tempValue; 57535 } 57536 setDate(e) { 57537 const t = this.dateComp; 57538 t ? t.setDate(e) : this.tempValue = e; 57539 } 57540 setDisabled(e) { 57541 const t = this.dateComp; 57542 t ? t.setDisabled?.(e) : this.disabled = e; 57543 } 57544 setDisplayed(e) { 57545 ui(this.eParent, e); 57546 } 57547 setInputPlaceholder(e) { 57548 this.dateComp?.setInputPlaceholder?.(e); 57549 } 57550 setInputAriaLabel(e) { 57551 this.dateComp?.setInputAriaLabel?.(e); 57552 } 57553 afterGuiAttached(e) { 57554 this.dateComp?.afterGuiAttached?.(e); 57555 } 57556 updateParams(e) { 57557 this.dateComp?.refresh?.(e); 57558 } 57559}, C_ = [ 57560 "equals", 57561 "notEqual", 57562 "lessThan", 57563 "greaterThan", 57564 "inRange", 57565 "blank", 57566 "notBlank" 57567], LM = class { 57568 constructor(e, t, i) { 57569 this.getLocaleTextFunc = e, this.optionsFactory = t, this.valueFormatter = i; 57570 } 57571 // used by: 57572 // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only. 57573 // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only) 57574 getModelAsString(e) { 57575 if (!e) 57576 return null; 57577 const t = e.operator != null, i = this.getLocaleTextFunc(); 57578 if (t) { 57579 const s = e, o = (s.conditions ?? []).map((a) => this.getModelAsString(a)), r = s.operator === "AND" ? "andCondition" : "orCondition"; 57580 return o.join( 57581 ` ${i(r, xN[r])} ` 57582 ); 57583 } else { 57584 if (e.type === "blank" || e.type === "notBlank") 57585 return i(e.type, e.type); 57586 { 57587 const s = e, n = this.optionsFactory.getCustomOption(s.type), { displayKey: o, displayName: r, numberOfInputs: a } = n || {}; 57588 return o && r && a === 0 ? (i(o, r), r) : this.conditionToString(s, n); 57589 } 57590 } 57591 } 57592 updateParams(e) { 57593 this.optionsFactory = e.optionsFactory; 57594 } 57595 formatValue(e) { 57596 const t = this.valueFormatter; 57597 return t ? t(e ?? null) ?? "" : String(e); 57598 } 57599}, b_ = class extends LM { 57600 constructor(e, t, i) { 57601 super(t, i), this.dateFilterParams = e; 57602 } 57603 conditionToString(e, t) { 57604 const { type: i } = e, { numberOfInputs: s } = t || {}, n = i == "inRange" || s === 2, o = fn(e.dateFrom), r = fn(e.dateTo), a = this.dateFilterParams.inRangeFloatingFilterDateFormat; 57605 if (n) { 57606 const l = o !== null ? gp(o, a) : "null", c = r !== null ? gp(r, a) : "null"; 57607 return `${l}-${c}`; 57608 } 57609 return o != null ? gp(o, a) : `${i}`; 57610 } 57611 updateParams(e) { 57612 super.updateParams(e), this.dateFilterParams = e.dateFilterParams; 57613 } 57614}, mT = 1e3, vT = 1 / 0, Rae = class extends v_ { 57615 constructor() { 57616 super("dateFilter"), this.eConditionPanelsFrom = [], this.eConditionPanelsTo = [], this.dateConditionFromComps = [], this.dateConditionToComps = [], this.minValidYear = mT, this.maxValidYear = vT, this.minValidDate = null, this.maxValidDate = null, this.filterType = "date"; 57617 } 57618 afterGuiAttached(e) { 57619 super.afterGuiAttached(e), this.dateConditionFromComps[0].afterGuiAttached(e); 57620 } 57621 mapValuesFromModel(e) { 57622 const { dateFrom: t, dateTo: i, type: s } = e || {}; 57623 return [ 57624 t && fn(t) || null, 57625 i && fn(i) || null 57626 ].slice(0, this.getNumberOfInputs(s)); 57627 } 57628 comparator() { 57629 return this.dateFilterParams.comparator ?? Tae; 57630 } 57631 setParams(e) { 57632 this.dateFilterParams = e, super.setParams(e); 57633 const t = (i, s) => { 57634 if (e[i] != null) 57635 if (isNaN(e[i])) 57636 Ae(82, { param: i }); 57637 else
57638 return e[i] == null ? s : Number(e[i]); 57639 return s; 57640 }; 57641 this.minValidYear = t("minValidYear", mT), this.maxValidYear = t("maxValidYear", vT), this.minValidYear > this.maxValidYear && Ae(83), this.minValidDate = e.minValidDate ? e.minValidDate instanceof Date ? e.minValidDate : fn(e.minValidDate) : null, this.maxValidDate = e.maxValidDate ? e.maxValidDate instanceof Date ? e.maxValidDate : fn(e.maxValidDate) : null, this.minValidDate && this.maxValidDate && this.minValidDate > this.maxValidDate && Ae(84), this.filterModelFormatter = new b_( 57642 this.dateFilterParams, 57643 this.getLocaleTextFunc.bind(this), 57644 this.optionsFactory 57645 ); 57646 } 57647 createDateCompWrapper(e) { 57648 const { userCompFactory: t, context: i } = this.beans, s = new y_( 57649 i, 57650 t, 57651 { 57652 onDateChanged: () => this.onUiChanged(), 57653 filterParams: this.dateFilterParams, 57654 location: "filter" 57655 }, 57656 e 57657 ); 57658 return this.addDestroyFunc(() => s.destroy()), s; 57659 } 57660 setElementValue(e, t) { 57661 e.setDate(t); 57662 } 57663 setElementDisplayed(e, t) { 57664 e.setDisplayed(t); 57665 } 57666 setElementDisabled(e, t) { 57667 e.setDisabled(t); 57668 } 57669 getDefaultFilterOptions() { 57670 return C_; 57671 } 57672 createValueElement() { 57673 const t = Ei(this.beans).createElement("div"); 57674 return t.classList.add("ag-filter-body"), this.createFromToElement(t, this.eConditionPanelsFrom, this.dateConditionFromComps, "from"), this.createFromToElement(t, this.eConditionPanelsTo, this.dateConditionToComps, "to"), t; 57675 } 57676 createFromToElement(e, t, i, s) { 57677 const o = Ei(this.beans).createElement("div"); 57678 o.classList.add(`ag-filter-${s}`), o.classList.add(`ag-filter-date-${s}`), t.push(o), e.appendChild(o), i.push(this.createDateCompWrapper(o)); 57679 } 57680 removeValueElements(e, t) { 57681 this.removeDateComps(this.dateConditionFromComps, e, t), this.removeDateComps(this.dateConditionToComps, e, t), mp(this.eConditionPanelsFrom, e, t), mp(this.eConditionPanelsTo, e, t); 57682 } 57683 removeDateComps(e, t, i) { 57684 mp(e, t, i).forEach((n) => n.destroy()); 57685 } 57686 isValidDateValue(e) { 57687 if (e === null) 57688 return !1; 57689 const { minValidDate: t, maxValidDate: i, minValidYear: s, maxValidYear: n } = this; 57690 if (t) { 57691 if (e < t) 57692 return !1; 57693 } else if (e.getUTCFullYear() < s) 57694 return !1; 57695 if (i) { 57696 if (e > i) 57697 return !1; 57698 } else if (e.getUTCFullYear() > n) 57699 return !1; 57700 return !0; 57701 } 57702 isConditionUiComplete(e) { 57703 if (!super.isConditionUiComplete(e)) 57704 return !1; 57705 let t = !0; 57706 return this.forEachInput((i, s, n, o) => { 57707 n !== e || !t || s >= o || (t = t && this.isValidDateValue(i.getDate())); 57708 }), t; 57709 } 57710 areSimpleModelsEqual(e, t) { 57711 return e.dateFrom === t.dateFrom && e.dateTo === t.dateTo && e.type === t.type; 57712 } 57713 createCondition(e) { 57714 const t = this.getConditionType(e), i = {}, s = this.getValues(e); 57715 return s.length > 0 && (i.dateFrom = yo(s[0])), s.length > 1 && (i.dateTo = yo(s[1])), { 57716 dateFrom: null, 57717 dateTo: null, 57718 filterType: this.filterType, 57719 type: t, 57720 ...i 57721 }; 57722 } 57723 resetPlaceholder() { 57724 const e = this.getLocaleTextFunc(), t = this.translate("dateFormatOoo"), i = e("ariaFilterValue", "Filter Value"); 57725 this.forEachInput((s) => { 57726 s.setInputPlaceholder(t), s.setInputAriaLabel(i); 57727 }); 57728 } 57729 getInputs(e) { 57730 const { dateConditionFromComps: t, dateConditionToComps: i } = this; 57731 return e >= t.length ? [null, null] : [t[e], i[e]]; 57732 } 57733 getValues(e) { 57734 const t = []; 57735 return this.forEachPositionInput(e, (i, s, n, o) => { 57736 s < o && t.push(i.getDate()); 57737 }), t; 57738 } 57739 translate(e) { 57740 return e === "lessThan" ? super.translate("before") : e === "greaterThan" ? super.translate("after") : super.translate(e); 57741 } 57742 getModelAsString(e) { 57743 return this.filterModelFormatter.getModelAsString(e) ?? ""; 57744 } 57745}; 57746function Tae(e, t) { 57747 const i = t; 57748 return t == null || i < e ? -1 : i > e ? 1 : 0; 57749} 57750var w_ = class extends Tt { 57751 constructor() { 57752 super(...arguments), this.defaultDebounceMs = 0; 57753 } 57754 setLastTypeFromModel(e) { 57755 if (!e) { 57756 this.lastType = this.optionsFactory.defaultOption; 57757 return; 57758 } 57759 const t = e.operator; 57760 let i; 57761 t ? i = e.conditions[0] : i = e, this.lastType = i.type; 57762 } 57763 canWeEditAfterModelFromParentFilter(e) { 57764 if (!e) 57765 return this.isTypeEditable(this.lastType); 57766 if (e.operator) 57767 return !1; 57768 const i = e; 57769 return this.isTypeEditable(i.type); 57770 } 57771 init(e) {
57772 this.setSimpleParams(e, !1); 57773 } 57774 setSimpleParams(e, t = !0) { 57775 const i = new f_(); 57776 this.optionsFactory = i, i.init(e.filterParams, this.getDefaultOptions()); 57777 const s = i.defaultOption; 57778 t || (this.lastType = s), this.readOnly = !!e.filterParams.readOnly; 57779 const n = this.isTypeEditable(s); 57780 this.setEditable(n); 57781 } 57782 refresh(e) { 57783 this.setSimpleParams(e); 57784 } 57785 hasSingleInput(e) { 57786 const t = this.optionsFactory.getCustomOption(e)?.numberOfInputs; 57787 return t == null || t == 1; 57788 } 57789 isTypeEditable(e) { 57790 const t = ["inRange", "empty", "blank", "notBlank"]; 57791 return !!e && !this.readOnly && this.hasSingleInput(e) && t.indexOf(e) < 0; 57792 } 57793 getAriaLabel(e) { 57794 return `${this.beans.colNames.getDisplayNameForColumn(e.column, "header", !0)} ${this.getLocaleTextFunc()("ariaFilterInput", "Filter Input")}`; 57795 } 57796}, Lae = class extends w_ { 57797 constructor() { 57798 super( 57799 /* html */ 57800 ` 57801 <div class="ag-floating-filter-input" role="presentation"> 57802 <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field> 57803 <div data-ref="eDateWrapper" style="display: flex;"></div> 57804 </div>`, 57805 [Zy] 57806 ), this.eReadOnlyText = Pe, this.eDateWrapper = Pe; 57807 } 57808 getDefaultOptions() { 57809 return C_; 57810 } 57811 init(e) { 57812 super.init(e), this.params = e, this.filterParams = e.filterParams, this.createDateComponent(), this.filterModelFormatter = new b_( 57813 this.filterParams, 57814 this.getLocaleTextFunc.bind(this), 57815 this.optionsFactory 57816 ); 57817 const t = this.getLocaleTextFunc(); 57818 this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput", "Date Filter Input")); 57819 } 57820 refresh(e) { 57821 super.refresh(e), this.params = e, this.filterParams = e.filterParams; 57822 const t = this.gos.addGridCommonParams(this.getDateComponentParams()); 57823 this.dateComp.updateParams(t), this.filterModelFormatter.updateParams({ 57824 optionsFactory: this.optionsFactory, 57825 dateFilterParams: this.filterParams 57826 }), this.updateCompOnModelChange(e.currentParentModel()); 57827 } 57828 updateCompOnModelChange(e) { 57829 const t = !this.readOnly && this.canWeEditAfterModelFromParentFilter(e); 57830 if (this.setEditable(t), t) { 57831 const i = e ? fn(e.dateFrom) : null; 57832 this.dateComp.setDate(i), this.eReadOnlyText.setValue(""); 57833 } else 57834 this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)), this.dateComp.setDate(null); 57835 } 57836 setEditable(e) { 57837 ui(this.eDateWrapper, e), ui(this.eReadOnlyText.getGui(), !e); 57838 } 57839 onParentModelChanged(e, t) { 57840 t?.afterFloatingFilter || t?.afterDataChange || (super.setLastTypeFromModel(e), this.updateCompOnModelChange(e)); 57841 } 57842 onDateChanged() { 57843 const e = this.dateComp.getDate(), t = yo(e); 57844 this.params.parentFilterInstance((i) => { 57845 if (i) { 57846 const s = fn(t); 57847 i.onFloatingFilterChanged(this.lastType || null, s); 57848 } 57849 }); 57850 } 57851 getDateComponentParams() { 57852 const { filterParams: e, column: t } = this.params, i = dM(e, this.defaultDebounceMs); 57853 return { 57854 onDateChanged: qs(this, this.onDateChanged.bind(this), i), 57855 filterParams: t.getColDef().filterParams, 57856 location: "floatingFilter" 57857 }; 57858 } 57859 createDateComponent() { 57860 const { 57861 beans: { context: e, userCompFactory: t }, 57862 eDateWrapper: i 57863 } = this; 57864 this.dateComp = new y_( 57865 e, 57866 t, 57867 this.getDateComponentParams(), 57868 i, 57869 (s) => { 57870 s.setInputAriaLabel(this.getAriaLabel(this.params)); 57871 } 57872 ), this.addDestroyFunc(() => this.dateComp.destroy()); 57873 } 57874}, kae = class extends Tt { 57875 constructor() { 57876 super( 57877 /* html */ 57878 ` 57879 <div class="ag-filter-filter"> 57880 <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field> 57881 </div>`, 57882 [Zy] 57883 ), this.eDateInput = Pe, this.isApply = !1, this.applyOnFocusOut = !1; 57884 } 57885 init(e) { 57886 this.params = e, this.setParams(e); 57887 const t = this.eDateInput.getInputElement(); 57888 this.addManagedListeners(t, { 57889 // ensures that the input element is focussed when a clear button is clicked, 57890 // unless using safari as there is no clear button and focus does not work properly 57891 mouseDown: () => { 57892 this.eDateInput.isDisabled() || this.usingSafariDatePicker || t.focus({ preventScroll: !0 }); 57893 }, 57894 input: this.handleInput.bind(this, !1), 57895 change: this.handleInput.bind(this, !0), 57896 focusout: this.handleFocusOut.bind(this) 57897 }); 57898 } 57899 handleInput(e, t) { 57900 if (t.target === gi(this.beans) && !this.eDateInput.isDisabled()) { 57901 if (this.isApply) { 57902 this.applyOnFocusOut = !e, e && this.params.onDateChanged(); 57903 return; 57904 } 57905 e || this.params.onDateChanged(); 57906 } 57907 } 57908 handleFocusOut() { 57909 this.applyOnFocusOut && (this.applyOnFocusOut = !1, this.params.onDateChanged()); 57910 } 57911 setParams(e) { 57912 const t = this.eDateInput.getInputElement(), i = this.shouldUseBrowserDatePicker(e); 57913 this.usingSafariDatePicker = i && Jc(), t.type = i ? "date" : "text"; 57914 const { minValidYear: s, maxValidYear: n, minValidDate: o, maxValidDate: r, buttons: a } = e.filterParams || {}; 57915 if (o && s && Ae(85), r && n && Ae(86), o && r) { 57916 const [l, c] = [o, r].map( 57917 (u) => u instanceof Date ? u : fn(u) 57918 ); 57919 l && c && l.getTime() > c.getTime() && Ae(87); 57920 } 57921 o ? o instanceof Date ? t.min = gp(o) : t.min = o : s && (t.min = `${s}-01-01`), r ? r instanceof Date ? t.max = gp(r) : t.max = r : n && (t.max = `${n}-12-31`), this.isApply = e.location === "floatingFilter" && !!a?.includes("apply"); 57922 } 57923 refresh(e) { 57924 this.params = e, this.setParams(e); 57925 } 57926 getDate() { 57927 return fn(this.eDateInput.getValue()); 57928 } 57929 setDate(e) { 57930 this.eDateInput.setValue(yo(e, !1)); 57931 } 57932 setInputPlaceholder(e) { 57933 this.eDateInput.setInputPlaceholder(e); 57934 } 57935 setInputAriaLabel(e) { 57936 this.eDateInput.setAriaLabel(e); 57937 } 57938 setDisabled(e) { 57939 this.eDateInput.setDisabled(e); 57940 } 57941 afterGuiAttached(e) { 57942 (!e || !e.suppressFocus) && this.eDateInput.getInputElement().focus({ preventScroll: !0 }); 57943 } 57944 shouldUseBrowserDatePicker(e) { 57945 return e?.filterParams?.browserDatePicker ?? !0; 57946 } 57947}, S_ = [ 57948 "equals", 57949 "notEqual", 57950 "greaterThan", 57951 "greaterThanOrEqual", 57952 "lessThan", 57953 "lessThanOrEqual", 57954 "inRange", 57955 "blank", 57956 "notBlank" 57957], x_ = class extends LM { 57958 conditionToString(e, t) { 57959 const { numberOfInputs: i } = t || {}, { filter: s, filterTo: n, type: o } = e, r = o == "inRange" || i === 2, a = this.formatValue.bind(this); 57960 return r ? `${a(s)}-${a(n)}` : s != null ? a(s) : `${o}`; 57961 } 57962}; 57963function dS(e) { 57964 const { allowedCharPattern: t } = e ?? {}; 57965 return t ?? null; 57966} 57967var Pae = class extends v_ { 57968 constructor() { 57969 super("numberFilter"), this.eValuesFrom = [], this.eValuesTo = [], this.filterType = "number", this.defaultDebounceMs = 500; 57970 } 57971 refresh(e) { 57972 return this.numberFilterParams.allowedCharPattern !== e.allowedCharPattern ? !1 : super.refresh(e); 57973 } 57974 mapValuesFromModel(e) { 57975 const { filter: t, filterTo: i, type: s } = e || {}; 57976 return [this.processValue(t), this.processValue(i)].slice(0, this.getNumberOfInputs(s)); 57977 } 57978 comparator() { 57979 return (e, t) => e === t ? 0 : e < t ? 1 : -1; 57980 } 57981 setParams(e) { 57982 this.numberFilterParams = e, super.setParams(e), this.filterModelFormatter = new x_( 57983 this.getLocaleTextFunc.bind(this), 57984 this.optionsFactory, 57985 this.numberFilterParams.numberFormatter 57986 ); 57987 } 57988 getDefaultFilterOptions() { 57989 return S_; 57990 } 57991 setElementValue(e, t, i) { 57992 const { numberFormatter: s } = this.numberFilterParams, n = !i && s ? s(t ?? null) : t; 57993 super.setElementValue(e, n); 57994 } 57995 createValueElement() { 57996 const e = dS(this.numberFilterParams), t = document.createElement("div"); 57997 return t.classList.add("ag-filter-body"), en(t, "presentation"), this.createFromToElement(t, this.eValuesFrom, "from", e), this.createFromToElement(t, this.eValuesTo, "to", e), t; 57998 } 57999 createFromToElement(e, t, i, s) { 58000 const n = this.createManagedBean( 58001 s ? new su({ allowedCharPattern: s }) : new SM() 58002 ); 58003 n.addCssClass(`ag-filter-${i}`), n.addCssClass("ag-filter-filter"), t.push(n), e.appendChild(n.getGui()); 58004 } 58005 removeValueElements(e, t) { 58006 const i = (s) => this.removeComponents(s, e, t);
58007 i(this.eValuesFrom), i(this.eValuesTo); 58008 } 58009 getValues(e) { 58010 const t = []; 58011 return this.forEachPositionInput(e, (i, s, n, o) => { 58012 s < o && t.push(this.processValue(this.stringToFloat(i.getValue()))); 58013 }), t; 58014 } 58015 areSimpleModelsEqual(e, t) { 58016 return e.filter === t.filter && e.filterTo === t.filterTo && e.type === t.type; 58017 } 58018 processValue(e) { 58019 return e == null || isNaN(e) ? null : e; 58020 } 58021 stringToFloat(e) { 58022 if (typeof e == "number") 58023 return e; 58024 let t = oa(e); 58025 t != null && t.trim() === "" && (t = null); 58026 const i = this.numberFilterParams.numberParser; 58027 return i ? i(t) : t == null || t.trim() === "-" ? null : parseFloat(t); 58028 } 58029 createCondition(e) { 58030 const t = this.getConditionType(e), i = { 58031 filterType: this.filterType, 58032 type: t 58033 }, s = this.getValues(e); 58034 return s.length > 0 && (i.filter = s[0]), s.length > 1 && (i.filterTo = s[1]), i; 58035 } 58036 getInputs(e) { 58037 const { eValuesFrom: t, eValuesTo: i } = this; 58038 return e >= t.length ? [null, null] : [t[e], i[e]]; 58039 } 58040 getModelAsString(e) { 58041 return this.filterModelFormatter.getModelAsString(e) ?? ""; 58042 } 58043 hasInvalidInputs() { 58044 let e = !1; 58045 return this.forEachInput((t) => { 58046 if (!t.getInputElement().validity.valid) { 58047 e = !0; 58048 return; 58049 } 58050 }), e; 58051 } 58052}, M_ = class extends he { 58053 constructor(e) { 58054 super(), this.params = e, this.eInput = Pe, this.onValueChanged = () => { 58055 }; 58056 } 58057 setupGui(e) { 58058 this.eInput = this.createManagedBean(new su(this.params?.config)); 58059 const t = this.eInput.getGui(); 58060 e.appendChild(t); 58061 const i = (s) => this.onValueChanged(s); 58062 this.addManagedListeners(t, { 58063 input: i, 58064 keydown: i 58065 }); 58066 } 58067 setEditable(e) { 58068 this.eInput.setDisabled(!e); 58069 } 58070 getValue() { 58071 return this.eInput.getValue(); 58072 } 58073 setValue(e, t) { 58074 this.eInput.setValue(e, t); 58075 } 58076 setValueChangedListener(e) { 58077 this.onValueChanged = e; 58078 } 58079 setParams({ ariaLabel: e, autoComplete: t }) { 58080 const { eInput: i } = this; 58081 i.setInputAriaLabel(e), t !== void 0 && i.setAutoComplete(t); 58082 } 58083}; 58084function A_(e) { 58085 const t = e?.trim(); 58086 return t === "" ? e : t; 58087} 58088var D_ = class extends w_ { 58089 constructor() { 58090 super(...arguments), this.eFloatingFilterInputContainer = Pe, this.defaultDebounceMs = 500; 58091 } 58092 postConstruct() { 58093 this.setTemplate( 58094 /* html */ 58095 ` 58096 <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div> 58097 ` 58098 ); 58099 } 58100 onParentModelChanged(e, t) { 58101 t?.afterFloatingFilter || t?.afterDataChange || (this.setLastTypeFromModel(e), this.setEditable(this.canWeEditAfterModelFromParentFilter(e)), this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))); 58102 } 58103 init(e) { 58104 this.setupFloatingFilterInputService(e), super.init(e), this.setTextInputParams(e); 58105 } 58106 setupFloatingFilterInputService(e) { 58107 this.inputSvc = this.createFloatingFilterInputService(e), this.inputSvc.setupGui(this.eFloatingFilterInputContainer); 58108 } 58109 setTextInputParams(e) { 58110 this.params = e; 58111 const t = e.browserAutoComplete ?? !1, { inputSvc: i, defaultDebounceMs: s, readOnly: n } = this; 58112 if (i.setParams({ 58113 ariaLabel: this.getAriaLabel(e), 58114 autoComplete: t 58115 }), this.applyActive = fv(e.filterParams), !n) { 58116 const o = dM(e.filterParams, s), r = qs( 58117 this, 58118 this.syncUpWithParentFilter.bind(this), 58119 o 58120 ); 58121 i.setValueChangedListener(r); 58122 } 58123 } 58124 refresh(e) { 58125 super.refresh(e), this.setTextInputParams(e); 58126 } 58127 recreateFloatingFilterInputService(e) { 58128 const { inputSvc: t } = this, i = t.getValue(); 58129 Is(this.eFloatingFilterInputContainer), this.destroyBean(t), this.setupFloatingFilterInputService(e), t.setValue(i, !0); 58130 } 58131 syncUpWithParentFilter(e) { 58132 const t = e.key === de.ENTER; 58133 if (this.applyActive && !t) 58134 return; 58135 const { inputSvc: i, params: s } = this; 58136 let n = i.getValue(); 58137 s.filterParams.trimInput && (n = A_(n), i.setValue(n, !0)), s.parentFilterInstance((o) => { 58138 o?.onFloatingFilterChanged(this.lastType || null, n || null); 58139 }); 58140 } 58141 setEditable(e) { 58142 this.inputSvc.setEditable(e); 58143 } 58144}, Fae = class extends he {
58145 constructor() { 58146 super(...arguments), this.onValueChanged = () => { 58147 }, this.numberInputActive = !0; 58148 } 58149 setupGui(e) { 58150 this.eNumberInput = this.createManagedBean(new SM()), this.eTextInput = this.createManagedBean(new su()), this.eTextInput.setDisabled(!0); 58151 const t = this.eNumberInput.getGui(), i = this.eTextInput.getGui(); 58152 e.appendChild(t), e.appendChild(i), this.setupListeners(t, (s) => this.onValueChanged(s)), this.setupListeners(i, (s) => this.onValueChanged(s)); 58153 } 58154 setEditable(e) { 58155 this.numberInputActive = e, this.eNumberInput.setDisplayed(this.numberInputActive), this.eTextInput.setDisplayed(!this.numberInputActive); 58156 } 58157 setAutoComplete(e) { 58158 this.eNumberInput.setAutoComplete(e), this.eTextInput.setAutoComplete(e); 58159 } 58160 getValue() { 58161 return this.getActiveInputElement().getValue(); 58162 } 58163 setValue(e, t) { 58164 this.getActiveInputElement().setValue(e, t); 58165 } 58166 getActiveInputElement() { 58167 return this.numberInputActive ? this.eNumberInput : this.eTextInput; 58168 } 58169 setValueChangedListener(e) { 58170 this.onValueChanged = e; 58171 } 58172 setupListeners(e, t) { 58173 this.addManagedListeners(e, { 58174 input: t, 58175 keydown: t 58176 }); 58177 } 58178 setParams(e) { 58179 this.setAriaLabel(e.ariaLabel), e.autoComplete !== void 0 && this.setAutoComplete(e.autoComplete); 58180 } 58181 setAriaLabel(e) { 58182 this.eNumberInput.setInputAriaLabel(e), this.eTextInput.setInputAriaLabel(e); 58183 } 58184}, Oae = class extends D_ { 58185 init(e) { 58186 super.init(e), this.filterModelFormatter = new x_( 58187 this.getLocaleTextFunc.bind(this), 58188 this.optionsFactory, 58189 e.filterParams?.numberFormatter 58190 ); 58191 } 58192 refresh(e) { 58193 dS(e.filterParams) !== this.allowedCharPattern && this.recreateFloatingFilterInputService(e), super.refresh(e), this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory }); 58194 } 58195 getDefaultOptions() { 58196 return S_; 58197 } 58198 createFloatingFilterInputService(e) { 58199 return this.allowedCharPattern = dS(e.filterParams), this.allowedCharPattern ? this.createManagedBean( 58200 new M_({ 58201 config: { allowedCharPattern: this.allowedCharPattern } 58202 }) 58203 ) : this.createManagedBean(new Fae()); 58204 } 58205}, E_ = [ 58206 "contains", 58207 "notContains", 58208 "equals", 58209 "notEqual", 58210 "startsWith", 58211 "endsWith", 58212 "blank", 58213 "notBlank" 58214], I_ = class extends LM { 58215 conditionToString(e, t) { 58216 const { numberOfInputs: i } = t || {}, { filter: s, filterTo: n, type: o } = e; 58217 return o == "inRange" || i === 2 ? `${s}-${n}` : s != null ? `${s}` : `${o}`; 58218 } 58219}, Nae = class extends m_ { 58220 constructor() { 58221 super("textFilter"), this.filterType = "text", this.defaultFormatter = (e) => e, this.defaultLowercaseFormatter = (e) => e == null ? null : e.toString().toLowerCase(), this.defaultMatcher = ({ filterOption: e, value: t, filterText: i }) => { 58222 if (i == null) 58223 return !1; 58224 switch (e) { 58225 case "contains": 58226 return t.indexOf(i) >= 0; 58227 case "notContains": 58228 return t.indexOf(i) < 0; 58229 case "equals": 58230 return t === i; 58231 case "notEqual": 58232 return t != i; 58233 case "startsWith": 58234 return t.indexOf(i) === 0; 58235 case "endsWith": { 58236 const s = t.lastIndexOf(i); 58237 return s >= 0 && s === t.length - i.length; 58238 } 58239 default: 58240 return !1; 58241 } 58242 }, this.eValuesFrom = [], this.eValuesTo = [], this.defaultDebounceMs = 500; 58243 } 58244 setParams(e) { 58245 this.textFilterParams = e, super.setParams(e), this.matcher = e.textMatcher || this.defaultMatcher, this.formatter = e.textFormatter || (e.caseSensitive ? this.defaultFormatter : this.defaultLowercaseFormatter), this.filterModelFormatter = new I_( 58246 this.getLocaleTextFunc.bind(this), 58247 this.optionsFactory 58248 ); 58249 } 58250 createCondition(e) { 58251 const t = this.getConditionType(e), i = { 58252 filterType: this.filterType, 58253 type: t 58254 }, s = this.getValuesWithSideEffects(e, !0); 58255 return s.length > 0 && (i.filter = s[0]), s.length > 1 && (i.filterTo = s[1]), i; 58256 } 58257 areSimpleModelsEqual(e, t) { 58258 return e.filter === t.filter && e.filterTo === t.filterTo && e.type === t.type; 58259 } 58260 getInputs(e) { 58261 const { eValuesFrom: t, eValuesTo: i } = this; 58262 return e >= t.length ? [null, null] : [t[e], i[e]]; 58263 } 58264 getValues(e) { 58265 return this.getValuesWithSideEffects(e, !1); 58266 } 58267 getValuesWithSideEffects(e, t) { 58268 const i = []; 58269 return this.forEachPositionInput(e, (s, n, o, r) => { 58270 if (n < r) { 58271 let a = oa(s.getValue()); 58272 t && this.textFilterParams.trimInput && (a = A_(a) ?? null, s.setValue(a, !0)), i.push(a); 58273 } 58274 }), i; 58275 } 58276 getDefaultFilterOptions() { 58277 return E_; 58278 } 58279 createValueElement() { 58280 const e = document.createElement("div"); 58281 return e.classList.add("ag-filter-body"), en(e, "presentation"), this.createFromToElement(e, this.eValuesFrom, "from"), this.createFromToElement(e, this.eValuesTo, "to"), e; 58282 } 58283 createFromToElement(e, t, i) { 58284 const s = this.createManagedBean(new su()); 58285 s.addCssClass(`ag-filter-${i}`), s.addCssClass("ag-filter-filter"), t.push(s), e.appendChild(s.getGui()); 58286 } 58287 removeValueElements(e, t) { 58288 const i = (s) => this.removeComponents(s, e, t);
58289 i(this.eValuesFrom), i(this.eValuesTo); 58290 } 58291 mapValuesFromModel(e) { 58292 const { filter: t, filterTo: i, type: s } = e || {}; 58293 return [t || null, i || null].slice(0, this.getNumberOfInputs(s)); 58294 } 58295 evaluateNullValue(e) { 58296 return e ? ["notEqual", "notContains", "blank"].indexOf(e) >= 0 : !1; 58297 } 58298 evaluateNonNullValue(e, t, i, s) { 58299 const n = e.map((p) => this.formatter(p)) || [], o = this.formatter(t), { api: r, colDef: a, column: l, context: c, textFormatter: u } = this.textFilterParams; 58300 if (i.type === "blank") 58301 return yv(t); 58302 if (i.type === "notBlank") 58303 return !yv(t); 58304 const d = { 58305 api: r, 58306 colDef: a, 58307 column: l, 58308 context: c, 58309 node: s.node, 58310 data: s.data, 58311 filterOption: i.type, 58312 value: o, 58313 textFormatter: u 58314 }; 58315 return n.some((p) => this.matcher({ ...d, filterText: p })); 58316 } 58317 getModelAsString(e) { 58318 return this.filterModelFormatter.getModelAsString(e) ?? ""; 58319 } 58320}, _ae = class extends D_ { 58321 init(e) { 58322 super.init(e), this.filterModelFormatter = new I_( 58323 this.getLocaleTextFunc.bind(this), 58324 this.optionsFactory 58325 ); 58326 } 58327 refresh(e) { 58328 super.refresh(e), this.filterModelFormatter.updateParams({ optionsFactory: this.optionsFactory }); 58329 } 58330 getDefaultOptions() { 58331 return E_; 58332 } 58333 createFloatingFilterInputService() { 58334 return this.createManagedBean(new M_()); 58335 } 58336}; 58337function Bae(e) { 58338 return !!e.filterManager?.isQuickFilterPresent(); 58339} 58340function Gae(e) { 58341 return e.gos.get("quickFilterText"); 58342} 58343function zae(e) { 58344 e.filterManager?.resetQuickFilterCache(); 58345} 58346var Hae = class extends he { 58347 constructor() { 58348 super(...arguments), this.beanName = "quickFilter", this.quickFilter = null, this.quickFilterParts = null; 58349 } 58350 postConstruct() { 58351 const e = this.resetCache.bind(this), t = this.gos; 58352 this.addManagedEventListeners({ 58353 columnPivotModeChanged: e, 58354 newColumnsLoaded: e, 58355 columnRowGroupChanged: e, 58356 columnVisible: () => { 58357 t.get("includeHiddenColumnsInQuickFilter") || this.resetCache(); 58358 } 58359 }), this.addManagedPropertyListener("quickFilterText", (i) => this.setFilter(i.currentValue)), this.addManagedPropertyListeners( 58360 ["includeHiddenColumnsInQuickFilter", "applyQuickFilterBeforePivotOrAgg"], 58361 () => this.onColumnConfigChanged() 58362 ), this.quickFilter = this.parseFilter(t.get("quickFilterText")), this.parser = t.get("quickFilterParser"), this.matcher = t.get("quickFilterMatcher"), this.setFilterParts(), this.addManagedPropertyListeners(["quickFilterMatcher", "quickFilterParser"], () => this.setParserAndMatcher()); 58363 } 58364 // if we are using autoGroupCols, then they should be included for quick filter. this covers the 58365 // following scenarios: 58366 // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on 58367 // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this 58368 // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping) 58369 refreshCols() { 58370 const { autoColSvc: e, colModel: t, gos: i, pivotResultCols: s } = this.beans, n = t.isPivotMode(), o = e?.getAutoCols(), r = t.getColDefCols(); 58371 let a = (n && !i.get("applyQuickFilterBeforePivotOrAgg") ? s?.getPivotResultCols()?.list : r) ?? []; 58372 o && (a = a.concat(o)), this.colsToUse = i.get("includeHiddenColumnsInQuickFilter") ? a : a.filter((l) => l.isVisible() || l.isRowGroupActive()); 58373 } 58374 isFilterPresent() { 58375 return this.quickFilter !== null; 58376 } 58377 doesRowPass(e) { 58378 const t = this.gos.get("cacheQuickFilter"); 58379 return this.matcher ? this.doesRowPassMatcher(t, e) : this.quickFilterParts.every( 58380 (i) => t ? this.doesRowPassCache(e, i) : this.doesRowPassNoCache(e, i) 58381 ); 58382 } 58383 resetCache() { 58384 this.beans.rowModel.forEachNode((e) => e.quickFilterAggregateText = null); 58385 } 58386 setFilterParts() { 58387 const { quickFilter: e, parser: t } = this; 58388 e ? this.quickFilterParts = t ? t(e) : e.split(" ") : this.quickFilterParts = null; 58389 } 58390 parseFilter(e) { 58391 return Ie(e) ? e.toUpperCase() : null; 58392 } 58393 setFilter(e) { 58394 if (e != null && typeof e != "string") { 58395 Ae(70, { newFilter: e }); 58396 return; 58397 } 58398 const t = this.parseFilter(e); 58399 this.quickFilter !== t && (this.quickFilter = t, this.setFilterParts(), this.dispatchLocalEvent({ type: "quickFilterChanged" })); 58400 } 58401 setParserAndMatcher() { 58402 const e = this.gos.get("quickFilterParser"), t = this.gos.get("quickFilterMatcher"), i = e !== this.parser || t !== this.matcher; 58403 this.parser = e, this.matcher = t, i && (this.setFilterParts(), this.dispatchLocalEvent({ type: "quickFilterChanged" })); 58404 } 58405 onColumnConfigChanged() { 58406 this.refreshCols(), this.resetCache(), this.isFilterPresent() && this.dispatchLocalEvent({ type: "quickFilterChanged" }); 58407 } 58408 doesRowPassNoCache(e, t) { 58409 return this.colsToUse.some((i) => { 58410 const s = this.getTextForColumn(i, e); 58411 return Ie(s) && s.indexOf(t) >= 0; 58412 }); 58413 } 58414 doesRowPassCache(e, t) { 58415 return this.checkGenerateAggText(e), e.quickFilterAggregateText.indexOf(t) >= 0; 58416 } 58417 doesRowPassMatcher(e, t) { 58418 let i; 58419 e ? (this.checkGenerateAggText(t), i = t.quickFilterAggregateText) : i = this.getAggText(t); 58420 const { quickFilterParts: s, matcher: n } = this; 58421 return n(s, i); 58422 } 58423 checkGenerateAggText(e) { 58424 e.quickFilterAggregateText || (e.quickFilterAggregateText = this.getAggText(e)); 58425 } 58426 getTextForColumn(e, t) { 58427 let i = this.beans.filterValueSvc.getValue(e, t); 58428 const s = e.getColDef(); 58429 if (s.getQuickFilterText) { 58430 const n = this.gos.addGridCommonParams({ 58431 value: i, 58432 node: t, 58433 data: t.data, 58434 column: e, 58435 colDef: s 58436 }); 58437 i = s.getQuickFilterText(n); 58438 } 58439 return Ie(i) ? i.toString().toUpperCase() : null; 58440 } 58441 getAggText(e) { 58442 const t = []; 58443 return this.colsToUse.forEach((i) => { 58444 const s = this.getTextForColumn(i, e); 58445 Ie(s) && t.push(s); 58446 }), t.join(` 58447`); 58448 } 58449}, Vae = { 58450 moduleName: "ClientSideRowModelFilter", 58451 version: Fe, 58452 rowModels: ["clientSide"], 58453 beans: [tae] 58454}, kM = { 58455 moduleName: "FilterCore", 58456 version: Fe, 58457 beans: [Sae],
58458 apiFunctions: { 58459 isAnyFilterPresent: bae, 58460 onFilterChanged: wae 58461 }, 58462 css: [cae], 58463 dependsOn: [Vae] 58464}, R_ = { 58465 moduleName: "FilterValue", 58466 version: Fe, 58467 beans: [Mae] 58468}, Jy = { 58469 moduleName: "ColumnFilter", 58470 version: Fe, 58471 beans: [Cae, xae], 58472 dynamicBeans: { headerFilterCellCtrl: iae }, 58473 icons: { 58474 // open filter button - header, floating filter, menu 58475 filter: "filter", 58476 // filter is applied - header (legacy column menu), filter tool panel 58477 filterActive: "filter" 58478 }, 58479 apiFunctions: { 58480 isColumnFilterPresent: uae, 58481 getColumnFilterInstance: dae, 58482 destroyFilter: hae, 58483 setFilterModel: pae, 58484 getFilterModel: gae, 58485 getColumnFilterModel: fae, 58486 setColumnFilterModel: mae, 58487 showColumnFilter: vae 58488 }, 58489 dependsOn: [kM, Xy, R_, oae] 58490}, Uae = { 58491 moduleName: "CustomFilter", 58492 version: Fe, 58493 userComponents: { agReadOnlyFloatingFilter: Aae }, 58494 dependsOn: [Jy] 58495}, Wae = { 58496 moduleName: "TextFilter", 58497 version: Fe, 58498 dependsOn: [Jy], 58499 userComponents: { 58500 agTextColumnFilter: Nae, 58501 agTextColumnFloatingFilter: _ae 58502 } 58503}, jae = { 58504 moduleName: "NumberFilter", 58505 version: Fe, 58506 dependsOn: [Jy], 58507 userComponents: { 58508 agNumberColumnFilter: Pae, 58509 agNumberColumnFloatingFilter: Oae 58510 } 58511}, $ae = { 58512 moduleName: "DateFilter", 58513 version: Fe, 58514 dependsOn: [Jy], 58515 userComponents: { 58516 agDateColumnFilter: Rae, 58517 agDateInput: kae, 58518 agDateColumnFloatingFilter: Lae 58519 } 58520}, Yae = { 58521 moduleName: "QuickFilter", 58522 version: Fe, 58523 rowModels: ["clientSide"], 58524 beans: [Hae], 58525 apiFunctions: { 58526 isQuickFilterPresent: Bae, 58527 getQuickFilter: Gae, 58528 resetQuickFilter: zae 58529 }, 58530 dependsOn: [kM, R_] 58531}, Kae = { 58532 moduleName: "ExternalFilter", 58533 version: Fe, 58534 dependsOn: [kM] 58535}, Wh = class { 58536 constructor(e) { 58537 this.cellValueChanges = e; 58538 } 58539}, B0 = class extends Wh { 58540 constructor(e, t, i, s) { 58541 super(e), this.initialRange = t, this.finalRange = i, this.ranges = s; 58542 } 58543}, Zae = 10, yT = class { 58544 constructor(e) { 58545 this.actionStack = [], this.maxStackSize = e || Zae, this.actionStack = new Array(this.maxStackSize); 58546 } 58547 pop() { 58548 return this.actionStack.pop(); 58549 } 58550 push(e) { 58551 e.cellValueChanges && e.cellValueChanges.length > 0 && (this.actionStack.length === this.maxStackSize && this.actionStack.shift(), this.actionStack.push(e)); 58552 } 58553 clear() { 58554 this.actionStack = []; 58555 } 58556 getCurrentStackSize() { 58557 return this.actionStack.length; 58558 } 58559}, qae = class extends he { 58560 constructor() { 58561 super(...arguments), this.beanName = "undoRedo", this.cellValueChanges = [], this.activeCellEdit = null, this.activeRowEdit = null, this.isPasting = !1, this.isRangeInAction = !1, this.onCellValueChanged = (e) => { 58562 const t = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned }, i = this.activeCellEdit !== null && Qw(this.activeCellEdit, t), s = this.activeRowEdit !== null && gee(this.activeRowEdit, t); 58563 if (!(i || s || this.isPasting || this.isRangeInAction)) 58564 return; 58565 const { rowPinned: o, rowIndex: r, column: a, oldValue: l, value: c } = e, u = { 58566 rowPinned: o, 58567 rowIndex: r, 58568 columnId: a.getColId(), 58569 newValue: c, 58570 oldValue: l 58571 }; 58572 this.cellValueChanges.push(u); 58573 }, this.clearStacks = () => { 58574 this.undoStack.clear(), this.redoStack.clear(); 58575 }; 58576 } 58577 postConstruct() { 58578 const { gos: e, ctrlsSvc: t } = this.beans; 58579 if (!e.get("undoRedoCellEditing")) 58580 return; 58581 const i = e.get("undoRedoCellEditingLimit"); 58582 if (i <= 0) 58583 return; 58584 this.undoStack = new yT(i), this.redoStack = new yT(i), this.addListeners(); 58585 const s = this.clearStacks.bind(this); 58586 this.addManagedEventListeners({ 58587 cellValueChanged: this.onCellValueChanged.bind(this), 58588 // undo / redo is restricted to actual editing so we clear the stacks when other operations are 58589 // performed that change the order of the row / cols. 58590 modelUpdated: (n) => { 58591 n.keepUndoRedoStack || this.clearStacks(); 58592 }, 58593 columnPivotModeChanged: s, 58594 newColumnsLoaded: s, 58595 columnGroupOpened: s, 58596 columnRowGroupChanged: s, 58597 columnMoved: s, 58598 columnPinned: s, 58599 columnVisible: s, 58600 rowDragEnd: s 58601 }), t.whenReady(this, (n) => { 58602 this.gridBodyCtrl = n.gridBodyCtrl; 58603 }); 58604 } 58605 getCurrentUndoStackSize() { 58606 return this.undoStack?.getCurrentStackSize() ?? 0; 58607 } 58608 getCurrentRedoStackSize() { 58609 return this.redoStack?.getCurrentStackSize() ?? 0; 58610 } 58611 undo(e) { 58612 const { eventSvc: t, undoStack: i, redoStack: s } = this; 58613 t.dispatchEvent({ 58614 type: "undoStarted", 58615 source: e 58616 }); 58617 const n = this.undoRedo(i, s, "initialRange", "oldValue", "undo"); 58618 t.dispatchEvent({ 58619 type: "undoEnded", 58620 source: e, 58621 operationPerformed: n 58622 }); 58623 } 58624 redo(e) { 58625 const { eventSvc: t, undoStack: i, redoStack: s } = this; 58626 t.dispatchEvent({ 58627 type: "redoStarted", 58628 source: e 58629 }); 58630 const n = this.undoRedo(s, i, "finalRange", "newValue", "redo"); 58631 t.dispatchEvent({ 58632 type: "redoEnded", 58633 source: e, 58634 operationPerformed: n 58635 }); 58636 } 58637 undoRedo(e, t, i, s, n) { 58638 if (!e) 58639 return !1; 58640 const o = e.pop();
58641 return !o || !o.cellValueChanges ? !1 : (this.processAction( 58642 o, 58643 (r) => r[s], 58644 n 58645 ), o instanceof B0 ? this.processRange(o.ranges || [o[i]]) : this.processCell(o.cellValueChanges), t.push(o), !0); 58646 } 58647 processAction(e, t, i) { 58648 e.cellValueChanges.forEach((s) => { 58649 const { rowIndex: n, rowPinned: o, columnId: r } = s, a = { rowIndex: n, rowPinned: o }, l = Xw(this.beans, a); 58650 l.displayed && l.setDataValue(r, t(s), i); 58651 }); 58652 } 58653 processRange(e) { 58654 let t; 58655 const i = this.beans.rangeSvc; 58656 i.removeAllCellRanges(!0), e.forEach((s, n) => { 58657 if (!s) 58658 return; 58659 const o = s.startRow, r = s.endRow; 58660 n === e.length - 1 && (t = { 58661 rowPinned: o.rowPinned, 58662 rowIndex: o.rowIndex, 58663 columnId: s.startColumn.getColId() 58664 }, this.setLastFocusedCell(t)); 58665 const a = { 58666 rowStartIndex: o.rowIndex, 58667 rowStartPinned: o.rowPinned, 58668 rowEndIndex: r.rowIndex, 58669 rowEndPinned: r.rowPinned, 58670 columnStart: s.startColumn, 58671 columns: s.columns 58672 }; 58673 i.addCellRange(a); 58674 }); 58675 } 58676 processCell(e) { 58677 const t = e[0], { rowIndex: i, rowPinned: s } = t, n = { rowIndex: i, rowPinned: s }, o = Xw(this.beans, n), r = { 58678 rowPinned: t.rowPinned, 58679 rowIndex: o.rowIndex, 58680 columnId: t.columnId 58681 }; 58682 this.setLastFocusedCell(r); 58683 } 58684 setLastFocusedCell(e) { 58685 const { rowIndex: t, columnId: i, rowPinned: s } = e, { colModel: n, focusSvc: o, rangeSvc: r } = this.beans, a = n.getCol(i); 58686 if (!a) 58687 return; 58688 const { scrollFeature: l } = this.gridBodyCtrl; 58689 l.ensureIndexVisible(t), l.ensureColumnVisible(a); 58690 const c = { rowIndex: t, column: a, rowPinned: s }; 58691 o.setFocusedCell({ ...c, forceBrowserFocus: !0 }), r?.setRangeToCell(c); 58692 } 58693 addListeners() { 58694 this.addManagedEventListeners({ 58695 rowEditingStarted: (e) => { 58696 this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned }; 58697 }, 58698 rowEditingStopped: () => { 58699 const e = new Wh(this.cellValueChanges); 58700 this.pushActionsToUndoStack(e), this.activeRowEdit = null; 58701 }, 58702 cellEditingStarted: (e) => { 58703 this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned }; 58704 }, 58705 cellEditingStopped: (e) => { 58706 if (this.activeCellEdit = null, e.valueChanged && !this.activeRowEdit && !this.isPasting && !this.isRangeInAction) { 58707 const i = new Wh(this.cellValueChanges); 58708 this.pushActionsToUndoStack(i); 58709 } 58710 }, 58711 pasteStart: () => { 58712 this.isPasting = !0; 58713 }, 58714 pasteEnd: () => { 58715 const e = new Wh(this.cellValueChanges); 58716 this.pushActionsToUndoStack(e), this.isPasting = !1; 58717 }, 58718 fillStart: () => { 58719 this.isRangeInAction = !0; 58720 }, 58721 fillEnd: (e) => { 58722 const t = new B0(this.cellValueChanges, e.initialRange, e.finalRange); 58723 this.pushActionsToUndoStack(t), this.isRangeInAction = !1; 58724 }, 58725 keyShortcutChangedCellStart: () => { 58726 this.isRangeInAction = !0; 58727 }, 58728 keyShortcutChangedCellEnd: () => { 58729 let e; 58730 const { rangeSvc: t, gos: i } = this.beans; 58731 t && pa(i) ? e = new B0(this.cellValueChanges, void 0, void 0, [ 58732 ...t.getCellRanges() 58733 ]) : e = new Wh(this.cellValueChanges), this.pushActionsToUndoStack(e), this.isRangeInAction = !1; 58734 } 58735 }); 58736 } 58737 pushActionsToUndoStack(e) { 58738 this.undoStack.push(e), this.cellValueChanges = [], this.redoStack.clear(); 58739 } 58740}, Qae = ( 58741 /*css*/ 58742 ".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;width:100%}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}" 58743), Xae = class extends nh { 58744 constructor() { 58745 super( 58746 /* html */ 58747 ` 58748 <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit"> 58749 <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox> 58750 </div>`, 58751 [wM] 58752 ), this.eCheckbox = Pe; 58753 } 58754 init(e) { 58755 this.params = e; 58756 const t = e.value ?? void 0, i = this.eCheckbox; 58757 i.setValue(t), i.getInputElement().setAttribute("tabindex", "-1"), this.setAriaLabel(t), this.addManagedListeners(i, { 58758 fieldValueChanged: (n) => this.setAriaLabel(n.selected) 58759 }); 58760 } 58761 getValue() { 58762 return this.eCheckbox.getValue(); 58763 } 58764 focusIn() { 58765 this.eCheckbox.getFocusableElement().focus(); 58766 } 58767 afterGuiAttached() { 58768 this.params.cellStartedEdit && this.focusIn(); 58769 } 58770 isPopup() { 58771 return !1; 58772 } 58773 setAriaLabel(e) { 58774 const t = this.getLocaleTextFunc(), i = Q1(t, e), s = t("ariaToggleCellValue", "Press SPACE to toggle cell value"); 58775 this.eCheckbox.setInputAriaLabel(`${s} (${i})`); 58776 } 58777}, eC = class extends nh { 58778 constructor(e) { 58779 super( 58780 /* html */ 58781 ` 58782 <div class="ag-cell-edit-wrapper"> 58783 ${e.getTemplate()} 58784 </div>`, 58785 e.getAgComponents() 58786 ), this.cellEditorInput = e, this.eInput = Pe; 58787 } 58788 init(e) { 58789 this.params = e; 58790 const { cellStartedEdit: t, eventKey: i, suppressPreventDefault: s } = e, n = this.eInput; 58791 this.cellEditorInput.init(n, e); 58792 let o, r = !0; 58793 t ? (this.focusAfterAttached = !0, i === de.BACKSPACE || i === de.DELET
58793E ? o = "" : i && i.length === 1 ? s ? r = !1 : o = i : (o = this.cellEditorInput.getStartValue(), i !== de.F2 && (this.highlightAllOnFocus = !0))) : (this.focusAfterAttached = !1, o = this.cellEditorInput.getStartValue()), r && o != null && n.setStartValue(o), this.addManagedElementListeners(n.getGui(), { 58794 keydown: (a) => { 58795 const { key: l } = a; 58796 (l === de.PAGE_UP || l === de.PAGE_DOWN) && a.preventDefault(); 58797 } 58798 }); 58799 } 58800 afterGuiAttached() { 58801 const e = this.getLocaleTextFunc(), t = this.eInput; 58802 if (t.setInputAriaLabel(e("ariaInputEditor", "Input Editor")), !this.focusAfterAttached) 58803 return; 58804 Jc() || t.getFocusableElement().focus(); 58805 const i = t.getInputElement(); 58806 this.highlightAllOnFocus ? i.select() : this.cellEditorInput.setCaret?.(); 58807 } 58808 // gets called when tabbing through cells and in full row edit mode 58809 focusIn() { 58810 const e = this.eInput, t = e.getFocusableElement(), i = e.getInputElement(); 58811 t.focus(), i.select(); 58812 } 58813 getValue() { 58814 return this.cellEditorInput.getValue(); 58815 } 58816 isPopup() { 58817 return !1; 58818 } 58819}, Jae = class { 58820 getTemplate() { 58821 return ( 58822 /* html */ 58823 '<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>' 58824 ); 58825 } 58826 getAgComponents() { 58827 return [ON]; 58828 } 58829 init(e, t) { 58830 this.eInput = e, this.params = t; 58831 const { min: i, max: s, step: n } = t; 58832 i != null && e.setMin(i), s != null && e.setMax(s), n != null && e.setStep(n); 58833 } 58834 getValue() { 58835 const { eInput: e, params: t } = this, i = e.getDate(); 58836 return !Ie(i) && !Ie(t.value) ? t.value : i ?? null; 58837 } 58838 getStartValue() { 58839 const { value: e } = this.params; 58840 if (e instanceof Date) 58841 return yo(e, !1); 58842 } 58843}, ele = class extends eC { 58844 constructor() { 58845 super(new Jae()); 58846 } 58847}, tle = class { 58848 constructor(e) { 58849 this.getDataTypeService = e; 58850 } 58851 getTemplate() { 58852 return ( 58853 /* html */ 58854 '<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>' 58855 ); 58856 } 58857 getAgComponents() { 58858 return [ON]; 58859 } 58860 init(e, t) { 58861 this.eInput = e, this.params = t; 58862 const { min: i, max: s, step: n } = t; 58863 i != null && e.setMin(i), s != null && e.setMax(s), n != null && e.setStep(n); 58864 } 58865 getValue() { 58866 const { params: e, eInput: t } = this, i = this.formatDate(t.getDate()); 58867 return !Ie(i) && !Ie(e.value) ? e.value : e.parseValue(i ?? ""); 58868 } 58869 getStartValue() { 58870 return yo(this.parseDate(this.params.value ?? void 0) ?? null, !1); 58871 } 58872 parseDate(e) { 58873 const t = this.getDataTypeService(); 58874 return t ? t.getDateParserFunction(this.params.column)(e) : fn(e) ?? void 0; 58875 } 58876 formatDate(e) { 58877 const t = this.getDataTypeService(); 58878 return t ? t.getDateFormatterFunction(this.params.column)(e) : yo(e ?? null, !1) ?? void 0; 58879 } 58880}, ile = class extends eC { 58881 constructor() { 58882 super(new tle(() => this.beans.dataTypeSvc)); 58883 } 58884}, sle = class extends nh { 58885 constructor() { 58886 super( 58887 /* html */ 58888 `<div class="ag-large-text"> 58889 <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area> 58890 </div>`, 58891 [Fte] 58892 ), this.eTextArea = Pe; 58893 } 58894 init(e) { 58895 this.params = e, this.focusAfterAttached = e.cellStartedEdit, this.eTextArea.setMaxLength(e.maxLength || 200).setCols(e.cols || 60).setRows(e.rows || 10), e.value != null && this.eTextArea.setValue(e.value.toString(), !0), this.addGuiEventListener("keydown", this.onKeyDown.bind(this)), this.activateTabIndex(); 58896 } 58897 onKeyDown(e) { 58898 const t = e.key; 58899 (t === de.LEFT || t === de.UP || t === de.RIGHT || t === de.DOWN || e.shiftKey && t === de.ENTER) && e.stopPropagation(); 58900 } 58901 afterGuiAttached() { 58902 const e = this.getLocaleTextFunc(); 58903 this.eTextArea.setInputAriaLabel(e("ariaInputEditor", "Input Editor")), this.focusAfterAttached && this.eTextArea.getFocusableElement().focus(); 58904 } 58905 getValue() { 58906 const e = this.eTextArea.getValue(), t = this.params; 58907 return !Ie(e) && !Ie(t.value) ? t.value : t.parseValue(e); 58908 } 58909}, nle = class { 58910 getTemplate() { 58911 return ( 58912 /* html */ 58913 '<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>' 58914 ); 58915 } 58916 getAgComponents() { 58917 return [Ote]; 58918 } 58919 init(e, t) { 58920 this.eInput = e, this.params = t; 58921 const { max: i, min: s, precision: n, step: o } = t; 58922 i != null && e.setMax(i), s != null && e.setMin(s), n != null && e.setPrecision(n), o != null && e.setStep(o);
58923 const r = e.getInputElement(); 58924 t.preventStepping ? e.addManagedElementListeners(r, { keydown: this.preventStepping }) : t.showStepperButtons && r.classList.add("ag-number-field-input-stepper"); 58925 } 58926 preventStepping(e) { 58927 (e.key === de.UP || e.key === de.DOWN) && e.preventDefault(); 58928 } 58929 getValue() { 58930 const { eInput: e, params: t } = this, i = e.getValue(); 58931 if (!Ie(i) && !Ie(t.value)) 58932 return t.value; 58933 let s = t.parseValue(i); 58934 if (s == null) 58935 return s; 58936 if (typeof s == "string") { 58937 if (s === "") 58938 return null; 58939 s = Number(s); 58940 } 58941 return isNaN(s) ? null : s; 58942 } 58943 getStartValue() { 58944 return this.params.value; 58945 } 58946 setCaret() { 58947 Jc() && this.eInput.getInputElement().focus({ preventScroll: !0 }); 58948 } 58949}, ole = class extends eC { 58950 constructor() { 58951 super(new nle()); 58952 } 58953}, rle = class extends nh { 58954 constructor() { 58955 super( 58956 /* html */ 58957 `<div class="ag-cell-edit-wrapper"> 58958 <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select> 58959 </div>`, 58960 [jte] 58961 ), this.eSelect = Pe, this.startedByEnter = !1; 58962 } 58963 wireBeans(e) { 58964 this.valueSvc = e.valueSvc; 58965 } 58966 init(e) { 58967 this.focusAfterAttached = e.cellStartedEdit; 58968 const { eSelect: t, valueSvc: i, gos: s } = this, { values: n, value: o, eventKey: r } = e; 58969 if (ai(n)) { 58970 Ae(58); 58971 return; 58972 } 58973 this.startedByEnter = r != null ? r === de.ENTER : !1; 58974 let a = !1;
58975 n.forEach((d) => { 58976 const p = { value: d }, f = i.formatValue(e.column, null, d), m = f != null; 58977 p.text = m ? f : d, t.addOption(p), a = a || o === d; 58978 }), a ? t.setValue(e.value, !0) : e.values.length && t.setValue(e.values[0], !0); 58979 const { valueListGap: l, valueListMaxWidth: c, valueListMaxHeight: u } = e; 58980 l != null && t.setPickerGap(l), u != null && t.setPickerMaxHeight(u), c != null && t.setPickerMaxWidth(c), s.get("editType") !== "fullRow" && this.addManagedListeners(this.eSelect, { selectedItem: () => e.stopEditing() }); 58981 } 58982 afterGuiAttached() { 58983 this.focusAfterAttached && this.eSelect.getFocusableElement().focus(), this.startedByEnter && setTimeout(() => { 58984 this.isAlive() && this.eSelect.showPicker(); 58985 }); 58986 } 58987 focusIn() { 58988 this.eSelect.getFocusableElement().focus(); 58989 } 58990 getValue() { 58991 return this.eSelect.getValue(); 58992 } 58993 isPopup() { 58994 return !1; 58995 } 58996}, ale = class { 58997 getTemplate() { 58998 return ( 58999 /* html */ 59000 '<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>' 59001 ); 59002 } 59003 getAgComponents() { 59004 return [Zy]; 59005 } 59006 init(e, t) { 59007 this.eInput = e, this.params = t; 59008 const i = t.maxLength; 59009 i != null && e.setMaxLength(i); 59010 } 59011 getValue() { 59012 const { eInput: e, params: t } = this, i = e.getValue(); 59013 return !Ie(i) && !Ie(t.value) ? t.value : t.parseValue(i); 59014 } 59015 getStartValue() { 59016 const e = this.params; 59017 return e.useFormatter || e.column.getColDef().refData ? e.formatValue(e.value) : e.value; 59018 } 59019 setCaret() { 59020 const e = this.eInput, t = e.getValue(), i = Ie(t) && t.length || 0; 59021 i && e.getInputElement().setSelectionRange(i, i); 59022 } 59023}, CT = class extends eC { 59024 constructor() { 59025 super(new ale()); 59026 } 59027}; 59028function lle(e) { 59029 return e.ctrlsSvc.getScrollFeature().getVScrollPosition(); 59030} 59031function cle(e) { 59032 return e.ctrlsSvc.getScrollFeature().getHScrollPosition(); 59033} 59034function T_(e, t, i = "auto") { 59035 e.frameworkOverrides.wrapIncoming( 59036 () => e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t, i), 59037 "ensureVisible" 59038 ); 59039} 59040function L_(e, t, i) { 59041 e.frameworkOverrides.wrapIncoming( 59042 () => e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t, i), 59043 "ensureVisible" 59044 ); 59045} 59046function ule(e, t, i = null) { 59047 e.frameworkOverrides.wrapIncoming( 59048 () => e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t, i), 59049 "ensureVisible" 59050 ); 59051} 59052function dle(e) { 59053 e.undoRedo?.undo("api"); 59054} 59055function hle(e) { 59056 e.undoRedo?.redo("api"); 59057} 59058function ple(e, t = {}) { 59059 const i = []; 59060 return e.rowRenderer.getCellCtrls(t.rowNodes, t.columns).forEach((s) => { 59061 const n = s.comp?.getCellEditor(); 59062 n && i.push(Qp(n)); 59063 }), i; 59064} 59065function gle(e) { 59066 const t = []; 59067 return e.rowRenderer.getAllCellCtrls().forEach((i) => { 59068 if (i.editing) { 59069 const { cellPosition: s } = i; 59070 t.push(s); 59071 } 59072 }), t; 59073} 59074function fle(e, t = !1) { 59075 e.editSvc?.stopAllEditing(t); 59076} 59077function mle(e, t) { 59078 const i = e.colModel.getCol(t.colKey); 59079 if (!i) { 59080 Ae(12, { colKey: t.colKey }); 59081 return; 59082 } 59083 const s = { 59084 rowIndex: t.rowIndex, 59085 rowPinned: t.rowPinned || null, 59086 column: i 59087 }; 59088 t.rowPinned == null && L_(e, t.rowIndex), T_(e, t.colKey); 59089 const o = Ku(e, s); 59090 if (!o) 59091 return; 59092 const { focusSvc: r, gos: a, editSvc: l } = e, c = () => { 59093 const d = gi(e), p = o.eGui; 59094 return d !== p && !!p?.contains(d); 59095 }, u = a.get("stopEditingWhenCellsLoseFocus") && c(); 59096 (u || !r.isCellFocused(s)) && r.setFocusedCell({ 59097 ...s, 59098 forceBrowserFocus: u, 59099 preventScrollOnBrowserFocus: !0 59100 }), l?.startRowOrCellEdit(o, t.key); 59101} 59102function vle(e) { 59103 return e.undoRedo?.getCurrentUndoStackSize() ?? 0; 59104} 59105function yle(e) { 59106 return e.undoRedo?.getCurrentRedoStackSize() ?? 0; 59107} 59108var Cle = class extends nh { 59109 constructor(e) { 59110 super( 59111 /* html */ 59112 '<div class="ag-popup-editor" tabindex="-1"/>' 59113 ), this.params = e; 59114 } 59115 postConstruct() { 59116 Bc(this.gos, this.getGui(), "popupEditorWrapper", !0), this.addKeyDownListener(); 59117 } 59118 addKeyDownListener() { 59119 const e = this.getGui(), t = this.params, i = (s) => { 59120 tS(this.gos, s, t.node, t.column, !0) || t.onKeyDown(s); 59121 }; 59122 this.addManagedElementListeners(e, { keydown: i }); 59123 } 59124}, ble = class extends he {
59125 constructor() { 59126 super(...arguments), this.beanName = "editSvc"; 59127 } 59128 startEditing(e, t = null, i = !1, s = null) { 59129 if (!e.isCellEditable() || e.editing) 59130 return !0; 59131 if (!e.comp) 59132 return e.onCompAttachedFuncs.push(() => { 59133 this.startEditing(e, t, i, s); 59134 }), !0; 59135 const n = this.createCellEditorParams(e, t, i), o = e.column.getColDef(), r = $R(this.beans.userCompFactory, o, n), a = r?.popupFromSelector != null ? r.popupFromSelector : !!o.cellEditorPopup, l = r?.popupPositionFromSelector != null ? r.popupPositionFromSelector : o.cellEditorPopupPosition; 59136 return bT(e, !0, r), e.comp.setEditDetails(r, a, l, this.gos.get("reactiveCustomComponents")), this.eventSvc.dispatchEvent(e.createEvent(s, "cellEditingStarted")), !r?.params?.suppressPreventDefault; 59137 } 59138 /** 59139 * Ends the Cell Editing 59140 * @param cancel `True` if the edit process is being canceled. 59141 * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`. 59142 */ 59143 stopEditing(e, t = !1) { 59144 if (e.onEditorAttachedFuncs = [], !e.editing) 59145 return !1; 59146 const { comp: i, column: s, rowNode: n } = e, { newValue: o, newValueExists: r } = wle(t, i), a = this.beans.valueSvc.getValueForDisplay(s, n); 59147 let l = !1; 59148 return r && (l = Sle(e, a, o, n, s)), bT(e, !1, void 0), i.setEditDetails(), e.updateAndFormatValue(!1), e.refreshCell({ forceRefresh: !0, suppressFlash: !0 }), this.eventSvc.dispatchEvent({ 59149 ...e.createEvent(null, "cellEditingStopped"), 59150 oldValue: a, 59151 newValue: o, 59152 valueChanged: l 59153 }), l; 59154 } 59155 handleColDefChanged(e) { 59156 const t = e.comp?.getCellEditor(); 59157 if (t?.refresh) { 59158 const { eventKey: i, cellStartedEdit: s } = e.editCompDetails.params, n = this.createCellEditorParams(e, i, s), o = e.column.getColDef(), r = $R(this.beans.userCompFactory, o, n); 59159 t.refresh(r.params); 59160 } 59161 } 59162 setFocusOutOnEditor(e) { 59163 if (!e.editing) 59164 return; 59165 const t = e.comp.getCellEditor(); 59166 t && t.focusOut && t.focusOut(); 59167 } 59168 setFocusInOnEditor(e) { 59169 if (!e.editing) 59170 return; 59171 const t = e.comp, i = t.getCellEditor(); 59172 i?.focusIn ? i.focusIn() : (e.focusCell(!0), e.onEditorAttachedFuncs.push(() => t.getCellEditor()?.focusIn?.())); 59173 } 59174 stopEditingAndFocus(e, t = !1, i = !1) { 59175 this.stopRowOrCellEdit(e), e.focusCell(!0), t || this.navigateAfterEdit(i, e.cellPosition); 59176 } 59177 createPopupEditorWrapper(e) { 59178 return new Cle(e); 59179 } 59180 stopAllEditing(e = !1) { 59181 this.beans.rowRenderer.getAllRowCtrls().forEach((t) => this.stopRowEditing(t, e)); 59182 } 59183 stopRowEditing(e, t = !1) { 59184 if (e.stoppingRowEdit) 59185 return; 59186 const i = e.getAllCellCtrls(), s = e.editing; 59187 e.stoppingRowEdit = !0; 59188 let n = !1; 59189 for (const o of i) { 59190 const r = o.stopEditing(t); 59191 s && !t && !n && r && (n = !0); 59192 } 59193 n && this.eventSvc.dispatchEvent(e.createRowEvent("rowValueChanged")), s && this.beans.rowEditSvc?.setEditing(e, !1), e.stoppingRowEdit = !1; 59194 } 59195 addStopEditingWhenGridLosesFocus(e) { 59196 if (!this.gos.get("stopEditingWhenCellsLoseFocus")) 59197 return; 59198 const t = (i) => { 59199 const s = i.relatedTarget; 59200 if (Hw(s) === null) { 59201 this.stopAllEditing(); 59202 return; 59203 } 59204 let n = ( 59205 // see if click came from inside the viewports 59206 e.some((o) => o.contains(s)) && // and also that it's not from a detail grid 59207 mN(this.gos, s) 59208 ); 59209 if (!n) { 59210 const o = this.beans.popupSvc; 59211 n = !!o && (o.getActivePopups().some((r) => r.contains(s)) || o.isElementWithinCustomPopup(s)); 59212 } 59213 n || this.stopAllEditing(); 59214 }; 59215 e.forEach((i) => this.addManagedElementListeners(i, { focusout: t })); 59216 } 59217 setInlineEditingCss(e) { 59218 const t = e.editing || e.getAllCellCtrls().some((i) => i.editing); 59219 e.forEachGui(void 0, (i) => { 59220 i.rowComp.addOrRemoveCssClass("ag-row-inline-editing", t), i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing", !t); 59221 }); 59222 } 59223 isCellEditable(e, t) { 59224 if (t.group) { 59225 if (this.gos.get("treeData")) { 59226 if (!t.data && !this.gos.get("enableGroupEdit")) 59227 return !1; 59228 } else if (!this.gos.get("enableGroupEdit")) 59229 return !1; 59230 } 59231 return e.isColumnFunc(t, e.colDef.editable); 59232 } 59233 // called by rowRenderer when user navigates via tab key 59234 startRowOrCellEdit(e, t, i = null) { 59235 return e.comp ? this.gos.get("editType") === "fullRow" ? this.beans.rowEditSvc?.startEditing(e.rowCtrl, t, e) ?? !0 : this.startEditing(e, t, !0, i) : (e.onCompAttachedFuncs.push(() => { 59236 this.startRowOrCellEdit(e, t, i); 59237 }), !0); 59238 } 59239 // pass in 'true' to cancel the editing. 59240 stopRowOrCellEdit(e, t = !1) { 59241 this.gos.get("editType") === "fullRow" ? this.stopRowEditing(e.rowCtrl, t) : this.stopEditing(e, t); 59242 } 59243 createCellEditorParams(e, t, i) { 59244 const { 59245 column: s, 59246 rowNode: n, 59247 eGui: o, 59248 cellPosition: { rowIndex: r } 59249 } = e, { valueSvc: a, gos: l } = this.beans; 59250 return l.addGridCommonParams({ 59251 value: a.getValueForDisplay(s, n), 59252 eventKey: t, 59253 column: s, 59254 colDef: s.getColDef(), 59255 rowIndex: r, 59256 node: n, 59257 data: n.data, 59258 cellStartedEdit: i, 59259 onKeyDown: e.onKeyDown.bind(e), 59260 stopEditing: e.stopEditingAndFocus.bind(e), 59261 eGridCell: o, 59262 parseValue: (c) => a.parseValue(s, n, c, e.value), 59263 formatValue: e.formatValue.bind(e) 59264 }); 59265 } 59266 navigateAfterEdit(e, t) { 59267 if (this.gos.get("enterNavigatesVerticallyAfterEdit")) { 59268 const s = e ? de.UP : de.DOWN; 59269 this.beans.navigation?.navigateToNextCell(null, s, t, !1); 59270 } 59271 } 59272}; 59273function bT(e, t, i) {
59274 e.editCompDetails = i, e.editing !== t && (e.editing = t); 59275} 59276function wle(e, t) { 59277 const i = { newValueExists: !1 }; 59278 if (e) 59279 return i; 59280 const s = t.getCellEditor(); 59281 return !s || s.isCancelAfterEnd && s.isCancelAfterEnd() ? i : { 59282 newValue: s.getValue(), 59283 newValueExists: !0 59284 }; 59285} 59286function Sle(e, t, i, s, n) { 59287 if (i === t) 59288 return !1; 59289 e.suppressRefreshCell = !0; 59290 const o = s.setDataValue(n, i, "edit"); 59291 return e.suppressRefreshCell = !1, o; 59292} 59293var xle = class extends he { 59294 constructor() { 59295 super(...arguments), this.beanName = "rowEditSvc"; 59296 } 59297 startEditing(e, t = null, i = null, s = null) { 59298 if (e.editing) 59299 return !0; 59300 let n = !0, o = !1; 59301 const { editSvc: r } = this.beans; 59302 return e.getAllCellCtrls().forEach((a) => { 59303 const l = a === i; 59304 l ? n = r?.startEditing(a, t, l, s) ?? !0 : r?.startEditing(a, null, l, s), o || (o = a.editing); 59305 }), o && this.setEditing(e, !0), n; 59306 } 59307 setEditing(e, t) { 59308 e.editing = t, e.forEachGui(void 0, (s) => s.rowComp.addOrRemoveCssClass("ag-row-editing", t)); 59309 const i = t ? e.createRowEvent("rowEditingStarted") : e.createRowEvent("rowEditingStopped"); 59310 this.eventSvc.dispatchEvent(i); 59311 } 59312}, Vl = { 59313 moduleName: "EditCore", 59314 version: Fe, 59315 beans: [ble, xle], 59316 apiFunctions: { 59317 getCellEditorInstances: ple, 59318 getEditingCells: gle, 59319 stopEditing: fle, 59320 startEditingCell: mle 59321 }, 59322 dependsOn: [Xy], 59323 css: [Qae] 59324}, Mle = { 59325 moduleName: "UndoRedoEdit", 59326 version: Fe, 59327 beans: [qae], 59328 apiFunctions: { 59329 undoCellEditing: dle, 59330 redoCellEditing: hle, 59331 getCurrentUndoSize: vle, 59332 getCurrentRedoSize: yle 59333 }, 59334 dependsOn: [Vl] 59335}, Ale = { 59336 moduleName: "TextEditor", 59337 version: Fe, 59338 userComponents: { agCellEditor: CT, agTextCellEditor: CT }, 59339 dependsOn: [Vl] 59340}, Dle = { 59341 moduleName: "NumberEditor", 59342 version: Fe, 59343 userComponents: { 59344 agNumberCellEditor: { 59345 classImp: ole, 59346 params: { 59347 suppressPreventDefault: !0 59348 } 59349 } 59350 }, 59351 dependsOn: [Vl] 59352}, Ele = { 59353 moduleName: "DateEditor", 59354 version: Fe, 59355 userComponents: { 59356 agDateCellEditor: ele, 59357 agDateStringCellEditor: ile 59358 }, 59359 dependsOn: [Vl] 59360}, Ile = { 59361 moduleName: "CheckboxEditor", 59362 version: Fe, 59363 userComponents: { 59364 agCheckboxCellEditor: Xae 59365 }, 59366 dependsOn: [Vl] 59367}, Rle = { 59368 moduleName: "SelectEditor", 59369 version: Fe, 59370 userComponents: { agSelectCellEditor: rle }, 59371 dependsOn: [Vl] 59372}, Tle = { 59373 moduleName: "LargeTextEditor", 59374 version: Fe, 59375 userComponents: { agLargeTextCellEditor: sle }, 59376 dependsOn: [Vl] 59377}, Lle = { 59378 moduleName: "CustomEditor", 59379 version: Fe, 59380 dependsOn: [Vl] 59381}; 59382function kle(e, t) { 59383 if (!t.nodes.every((a) => a.rowPinned ? (Ae(59), !1) : a.id === void 0 ? (Ae(60), !1) : !0)) 59384 return; 59385 const { nodes: s, source: n, newValue: o } = t, r = s; 59386 e.selectionSvc?.setNodesSelected({ nodes: r, source: n ?? "api", newValue: o }); 59387} 59388function Ple(e, t, i = "apiSelectAll") { 59389 e.selectionSvc?.selectAllRowNodes({ source: i, selectAll: t }); 59390} 59391function Fle(e, t, i = "apiSelectAll") { 59392 e.selectionSvc?.deselectAllRowNodes({ source: i, selectAll: t }); 59393} 59394function Ole(e, t = "apiSelectAllFiltered") { 59395 e.selectionSvc?.selectAllRowNodes({ source: t, selectAll: "filtered" }); 59396} 59397function Nle(e, t = "apiSelectAllFiltered") { 59398 e.selectionSvc?.deselectAllRowNodes({ source: t, selectAll: "filtered" }); 59399} 59400function _le(e, t = "apiSelectAllCurrentPage") { 59401 e.selectionSvc?.selectAllRowNodes({ source: t, selectAll: "currentPage" }); 59402} 59403function Ble(e, t = "apiSelectAllCurrentPage") { 59404 e.selectionSvc?.deselectAllRowNodes({ source: t, selectAll: "currentPage" }); 59405} 59406function Gle(e) { 59407 return e.selectionSvc?.getSelectedNodes() ?? []; 59408} 59409function zle(e) { 59410 return e.selectionSvc?.getSelectedRows() ?? []; 59411} 59412var Hle = class extends Lte { 59413 constructor() { 59414 super(...arguments), this.beanName = "selectionSvc", this.selectedNodes = /* @__PURE__ */ new Map(); 59415 } 59416 postConstruct() { 59417 super.postConstruct(); 59418 const { gos: e } = this; 59419 this.mode = rv(e), this.groupSelectsDescendants = Zp(e), this.groupSelectsFiltered = av(e) === "filteredDescendants", this.addManagedPropertyListeners(["groupSelectsChildren", "groupSelectsFiltered", "rowSelection"], () => { 59420 const t = Zp(e), i = rv(e), s = av(e) === "filteredDescendants"; 59421 (t !== this.groupSelectsDescendants || s !== this.groupSelectsFiltered || i !== this.mode) && (this.deselectAllRowNodes({ source: "api" }), this.groupSelectsDescendants = t, this.groupSelectsFiltered = s, this.mode = i); 59422 }), this.addManagedEventListeners({ rowSelected: this.onRowSelected.bind(this) }); 59423 } 59424 destroy() { 59425 super.destroy(), this.resetNodes(); 59426 } 59427 handleSelectionEvent(e, t, i) { 59428 if (this.isRowSelectionBlocked(t)) 59429 return 0; 59430 const s = this.inferNodeSelections(t, e.shiftKey, e.metaKey || e.ctrlKey, i); 59431 return s == null ? 0 : "select" in s ? (s.reset ? this.resetNodes() : this.selectRange(s.deselect, !1, i), this.selectRange(s.select, !0, i)) : this.setNodesSelected({ 59432 nodes: [s.node], 59433 newValue: s.newValue, 59434 clearSelection: s.clearSelection, 59435 event: e, 59436 source: i 59437 }); 59438 } 59439 setNodesSelected({ 59440 newValue: e, 59441 clearSelection: t, 59442 suppressFinishActions: i, 59443 nodes: s, 59444 event: n, 59445 source: o 59446 }) { 59447 if (!Dc(this.gos) && e) 59448 return Ae(132), 0; 59449 if (s.length === 0) 59450 return 0; 59451 if (s.length > 1 && !this.isMultiSelect()) 59452 return Ae(130), 0; 59453 let r = 0; 59454 for (let a = 0; a < s.length; a++) { 59455 const l = s[a], c = l.footer ? l.sibling : l, u = this.groupSelectsFiltered && c.group; 59456 if (c.rowPinned) { 59457 Ae(59); 59458 continue; 59459 } 59460 if (c.id === void 0) { 59461 Ae(60); 59462 continue; 59463 } 59464 u || this.selectRowNode(c, e, n, o) && r++, this.groupSelectsDescendants && c.childrenAfterGroup?.length && (r += this.selectChildren(c, e, o)); 59465 } 59466 return i || (e && (t || !this.isMultiSelect()) && (r += this.clearOtherNodes(s[0], o)), r > 0 && (this.updateGroupsFromChildrenSelections(o), this.dispatchSelectionChanged(o))), r; 59467 } 59468 // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by 59469 // holding down 'shift'. 59470 selectRange(e, t, i) { 59471 let s = 0; 59472 return e.forEach((n) => { 59473 if (n.group && this.groupSelectsDescendants) 59474 return; 59475 this.selectRowNode(n, t, void 0, i) && s++; 59476 }), s > 0 && (this.updateGroupsFromChildrenSelections(i), this.dispatchSelectionChanged(i)), s; 59477 } 59478 selectChildren(e, t, i) { 59479 const s = this.groupSelectsFiltered ? e.childrenAfterAggFilter : e.childrenAfterGroup; 59480 return s ? this.setNodesSelected({ 59481 newValue: t, 59482 clearSelection: !1, 59483 suppressFinishActions: !0, 59484 source: i, 59485 nodes: s 59486 }) : 0; 59487 } 59488 getSelectedNodes() { 59489 return Array.from(this.selectedNodes.values()); 59490 } 59491 getSelectedRows() { 59492 const e = [];
59493 return this.selectedNodes.forEach((t) => e.push(t.data)), e; 59494 } 59495 getSelectionCount() { 59496 return this.selectedNodes.size; 59497 } 59498 /** 59499 * This method is used by the CSRM to remove groups which are being disposed of, 59500 * events do not need fired in this case 59501 */ 59502 filterFromSelection(e) { 59503 const t = /* @__PURE__ */ new Map(); 59504 this.selectedNodes.forEach((i, s) => { 59505 e(i) && t.set(s, i); 59506 }), this.selectedNodes = t; 59507 } 59508 updateGroupsFromChildrenSelections(e, t) { 59509 if (!this.groupSelectsDescendants) 59510 return !1; 59511 const { gos: i, rowModel: s } = this.beans; 59512 if (!$s(i)) 59513 return !1; 59514 const n = s.rootNode; 59515 if (!n) 59516 return !1; 59517 t || (t = new mv(!0, n), t.active = !1); 59518 let o = !1; 59519 return t.forEachChangedNodeDepthFirst((r) => { 59520 if (r !== n) { 59521 const a = this.calculateSelectedFromChildren(r); 59522 o = this.selectRowNode(r, a === null ? !1 : a, void 0, e) || o; 59523 } 59524 }), o; 59525 } 59526 clearOtherNodes(e, t) { 59527 const i = /* @__PURE__ */ new Map(); 59528 let s = 0; 59529 return this.selectedNodes.forEach((n) => { 59530 if (n && n.id !== e.id) { 59531 const o = this.selectedNodes.get(n.id); 59532 s += this.setNodesSelected({ 59533 nodes: [o], 59534 newValue: !1, 59535 clearSelection: !1, 59536 suppressFinishActions: !0, 59537 source: t 59538 }), this.groupSelectsDescendants && n.parent && i.set(n.parent.id, n.parent); 59539 } 59540 }), i.forEach((n) => { 59541 const o = this.calculateSelectedFromChildren(n); 59542 this.selectRowNode(n, o === null ? !1 : o, void 0, t); 59543 }), s; 59544 } 59545 onRowSelected(e) { 59546 const t = e.node; 59547 this.groupSelectsDescendants && t.group || (t.isSelected() ? this.selectedNodes.set(t.id, t) : this.selectedNodes.delete(t.id)); 59548 } 59549 syncInRowNode(e, t) { 59550 this.syncInOldRowNode(e, t), this.syncInNewRowNode(e); 59551 } 59552 createDaemonNode(e) { 59553 if (!e.id) 59554 return; 59555 const t = new Rd(this.beans); 59556 return t.id = e.id, t.data = e.data, t.__daemon = !0, t.__selected = e.__selected, t.level = e.level, t; 59557 } 59558 // if the id has changed for the node, then this means the rowNode 59559 // is getting used for a different data item, which breaks 59560 // our selectedNodes, as the node now is mapped by the old id 59561 // which is inconsistent. so to keep the old node as selected, 59562 // we swap in the clone (with the old id and old data). this means 59563 // the oldNode is effectively a daemon we keep a reference to, 59564 // so if client calls api.getSelectedNodes(), it gets the daemon 59565 // in the result. when the client un-selects, the reference to the 59566 // daemon is removed. the daemon, because it's an oldNode, is not 59567 // used by the grid for rendering, it's a copy of what the node used 59568 // to be like before the id was changed. 59569 syncInOldRowNode(e, t) { 59570 t && e.id !== t.id && this.selectedNodes.get(t.id) == e && this.selectedNodes.set(t.id, t); 59571 } 59572 syncInNewRowNode(e) { 59573 this.selectedNodes.has(e.id) ? (e.__selected = !0, this.selectedNodes.set(e.id, e)) : e.__selected = !1; 59574 } 59575 reset(e) { 59576 const t = this.getSelectionCount(); 59577 this.resetNodes(), t && this.dispatchSelectionChanged(e); 59578 } 59579 resetNodes() { 59580 this.selectedNodes.forEach((e) => { 59581 this.selectRowNode(e, !1); 59582 }), this.selectedNodes.clear(); 59583 } 59584 // returns a list of all nodes at 'best cost' - a feature to be used 59585 // with groups / trees. if a group has all it's children selected, 59586 // then the group appears in the result, but not the children. 59587 // Designed for use with 'children' as the group selection type, 59588 // where groups don't actually appear in the selection normally. 59589 getBestCostNodeSelection() { 59590 const { gos: e, rowModel: t } = this.beans; 59591 if (!$s(e)) 59592 return; 59593 const i = t.getTopLevelNodes(); 59594 if (i === null) 59595 return; 59596 const s = []; 59597 function n(o) { 59598 for (let r = 0, a = o.length; r < a; r++) { 59599 const l = o[r]; 59600 l.isSelected() ? s.push(l) : l.group && l.childrenAfterGroup && n(l.childrenAfterGroup); 59601 } 59602 } 59603 return n(i), s; 59604 } 59605 isEmpty() { 59606 return this.getSelectionCount() === 0; 59607 } 59608 deselectAllRowNodes(e) { 59609 const t = (o) => this.selectRowNode(o.footer ? o.sibling : o, !1, void 0, s), i = $s(this.gos), { source: s, selectAll: n } = e; 59610 if (n === "currentPage" || n === "filtered") { 59611 if (!i) { 59612 Rt(102); 59613 return; 59614 }
59615 this.getNodesToSelect(n).forEach(t); 59616 } else 59617 this.selectedNodes.forEach(t), this.reset(s); 59618 i && this.groupSelectsDescendants && this.updateGroupsFromChildrenSelections(s), this.dispatchSelectionChanged(s); 59619 } 59620 getSelectedCounts(e) { 59621 let t = 0, i = 0; 59622 const s = (n) => { 59623 this.groupSelectsDescendants && n.group || (n.isSelected() ? t++ : n.selectable && i++); 59624 }; 59625 return this.getNodesToSelect(e).forEach(s), { selectedCount: t, notSelectedCount: i }; 59626 } 59627 getSelectAllState(e) { 59628 const { selectedCount: t, notSelectedCount: i } = this.getSelectedCounts(e); 59629 return t === 0 && i === 0 ? !1 : t > 0 && i > 0 ? null : t > 0; 59630 } 59631 hasNodesToSelect(e) { 59632 return this.getNodesToSelect(e).filter((t) => t.selectable).length > 0; 59633 } 59634 /** 59635 * @param selectAll See `MultiRowSelectionOptions.selectAll` 59636 * @returns all nodes including unselectable nodes which are the target of this selection attempt 59637 */ 59638 getNodesToSelect(e) { 59639 if (!this.canSelectAll()) 59640 return []; 59641 const t = []; 59642 if (e === "currentPage") 59643 return this.forEachNodeOnPage((s) => { 59644 if (!s.group) { 59645 t.push(s); 59646 return; 59647 } 59648 if (!s.expanded && !s.footer) { 59649 const n = (o) => { 59650 t.push(o), o.childrenAfterFilter?.length && o.childrenAfterFilter.forEach(n); 59651 }; 59652 n(s); 59653 return; 59654 } 59655 this.groupSelectsDescendants || t.push(s); 59656 }), t; 59657 const i = this.beans.rowModel; 59658 return e === "filtered" ? (i.forEachNodeAfterFilter((s) => { 59659 t.push(s); 59660 }), t) : (i.forEachNode((s) => { 59661 t.push(s); 59662 }), t); 59663 } 59664 forEachNodeOnPage(e) { 59665 const { pageBounds: t, rowModel: i } = this.beans, s = t.getFirstRow(), n = t.getLastRow(); 59666 for (let o = s; o <= n; o++) { 59667 const r = i.getRow(o); 59668 r && e(r); 59669 } 59670 } 59671 selectAllRowNodes(e) { 59672 const { gos: t } = this; 59673 if (!Dc(t)) { 59674 Ae(132); 59675 return; 59676 } 59677 if (aX(t) && !Yy(t)) { 59678 Ae(130); 59679 return; 59680 } 59681 if (!this.canSelectAll()) 59682 return; 59683 const { source: i, selectAll: s } = e; 59684 this.getNodesToSelect(s).forEach((n) => { 59685 this.selectRowNode(n.footer ? n.sibling : n, !0, void 0, i); 59686 }), $s(t) && this.groupSelectsDescendants && this.updateGroupsFromChildrenSelections(i), this.dispatchSelectionChanged(i); 59687 } 59688 getSelectionState() { 59689 const e = []; 59690 return this.selectedNodes.forEach((t) => { 59691 t?.id && e.push(t.id); 59692 }), e.length ? e : null; 59693 } 59694 setSelectionState(e, t) { 59695 if (!Array.isArray(e)) { 59696 Rt(103); 59697 return; 59698 } 59699 const i = new Set(e), s = []; 59700 this.beans.rowModel.forEachNode((n) => { 59701 i.has(n.id) && s.push(n); 59702 }), this.setNodesSelected({ 59703 newValue: !0, 59704 nodes: s, 59705 source: t 59706 }); 59707 } 59708 canSelectAll() { 59709 const { gos: e, rowModel: t } = this.beans; 59710 return $s(e) ? !0 : (Rt(100, { rowModelType: t.getType() }), !1); 59711 } 59712 /** 59713 * Updates the selectable state for a node by invoking isRowSelectable callback. 59714 * If the node is not selectable, it will be deselected. 59715 * 59716 * Callers: 59717 * - property isRowSelectable changed 59718 * - after grouping / treeData via `updateSelectableAfterGrouping` 59719 */ 59720 updateSelectable(e) { 59721 const { gos: t, rowModel: i } = this.beans; 59722 if (!Dc(t)) 59723 return; 59724 const s = "selectableChanged", n = e !== void 0, o = $s(t) && this.groupSelectsDescendants, r = [], a = (l) => { 59725 if (n && !l.group) 59726 return; 59727 if (o && l.group) { 59728 const u = l.childrenAfterGroup?.some((d) => d.selectable) ?? !1; 59729 this.setRowSelectable(l, u, !0); 59730 return; 59731 } 59732 !this.updateRowSelectable(l, !0) && l.isSelected() && r.push(l); 59733 }; 59734 if (o) { 59735 if (e === void 0) { 59736 const l = i.rootNode; 59737 e = l ? new mv(!1, l) : void 0; 59738 } 59739 e?.forEachChangedNodeDepthFirst(a, !n, !n); 59740 } else 59741 i.forEachNode(a); 59742 r.length && this.setNodesSelected({ 59743 nodes: r, 59744 newValue: !1, 59745 source: s 59746 }), !n && o && this.updateGroupsFromChildrenSelections?.(s); 59747 } 59748 // only called by CSRM 59749 updateSelectableAfterGrouping(e) { 59750 this.updateSelectable(e), this.groupSelectsDescendants && this.updateGroupsFromChildrenSelections?.("rowGroupChanged", e) && this.eventSvc.dispatchEvent({ 59751 type: "selectionChanged", 59752 source: "rowGroupChanged" 59753 }); 59754 } 59755}, Vle = { 59756 moduleName: "SharedRowSelection", 59757 version: Fe, 59758 beans: [LX], 59759 apiFunctions: { 59760 setNodesSelected: kle, 59761 selectAll: Ple, 59762 deselectAll: Fle, 59763 selectAllFiltered: Ole, 59764 deselectAllFiltered: Nle, 59765 selectAllOnCurrentPage: _le, 59766 deselectAllOnCurrentPage: Ble, 59767 getSelectedNodes: Gle, 59768 getSelectedRows: zle 59769 } 59770}, Ule = { 59771 moduleName: "RowSelection", 59772 version: Fe, 59773 rowModels: ["clientSide", "infinite", "viewport"], 59774 beans: [Hle], 59775 dependsOn: [Vle] 59776}; 59777function Wle(e) { 59778 e.expansionSvc?.expandAll(!0); 59779} 59780function jle(e) { 59781 e.expansionSvc?.expandAll(!1); 59782} 59783function $le(e) { 59784 const t = kr(e), i = l_(e); 59785 t ? t.onRowHeightChanged() : i && i.onRowHeightChanged(); 59786} 59787function Yle(e, t, i) { 59788 const s = l_(e); 59789 if (s) { 59790 if (e.rowGroupColsSvc?.columns.length === 0) { 59791 if (t < 0) { 59792 Rt(238); 59793 return; 59794 } 59795 s.setRowCount(t, i); 59796 return; 59797 } 59798 Rt(28); 59799 return; 59800 } 59801 const n = Qy(e); 59802 if (n) { 59803 n.setRowCount(t, i); 59804 return; 59805 } 59806} 59807function Kle(e) { 59808 return Ag(e.gos) ? e.rowModel.getBlockStates() : e.rowNodeBlockLoader?.getBlockState() ?? {}; 59809} 59810function Zle(e) { 59811 return e.rowModel.isLastRowIndexKnown(); 59812} 59813var qle = { 59814 moduleName: "CsrmSsrmSharedApi", 59815 version: Fe, 59816 apiFunctions: { 59817 expandAll: Wle, 59818 collapseAll: jle, 59819 onRowHeightChanged: $le 59820 } 59821}, Qle = { 59822 moduleName: "SsrmInfiniteSharedApi", 59823 version: Fe, 59824 apiFunctions: { 59825 setRowCount: Yle, 59826 getCacheBlockState: Kle, 59827 isLastRowIndexKnown: Zle 59828 } 59829}, Xle = class extends he {
59830 constructor() { 59831 super(...arguments), this.beanName = "alignedGridsSvc", this.consuming = !1; 59832 } 59833 getAlignedGridApis() { 59834 let e = this.gos.get("alignedGrids") ?? []; 59835 const t = typeof e == "function"; 59836 return typeof e == "function" && (e = e()), e.map((s) => { 59837 if (!s) { 59838 Rt(18), t || Rt(20); 59839 return; 59840 } 59841 if (this.isGridApi(s)) 59842 return s; 59843 const n = s; 59844 return "current" in n ? n.current?.api : (n.api || Rt(19), n.api); 59845 }).filter((s) => !!s && !s.isDestroyed()); 59846 } 59847 isGridApi(e) { 59848 return !!e && !!e.dispatchEvent; 59849 } 59850 postConstruct() { 59851 const e = this.fireColumnEvent.bind(this); 59852 this.addManagedEventListeners({ 59853 columnMoved: e, 59854 columnVisible: e, 59855 columnPinned: e, 59856 columnGroupOpened: e, 59857 columnResized: e, 59858 bodyScroll: this.fireScrollEvent.bind(this), 59859 alignedGridColumn: ({ event: t }) => this.onColumnEvent(t), 59860 alignedGridScroll: ({ event: t }) => this.onScrollEvent(t) 59861 }); 59862 } 59863 // common logic across all the fire methods 59864 fireEvent(e) { 59865 this.consuming || this.getAlignedGridApis().forEach((t) => { 59866 t.isDestroyed() || t.dispatchEvent(e); 59867 }); 59868 } 59869 // common logic across all consume methods. very little common logic, however extracting 59870 // guarantees consistency across the methods. 59871 onEvent(e) { 59872 this.consuming = !0, e(), this.consuming = !1; 59873 } 59874 fireColumnEvent(e) { 59875 this.fireEvent({ 59876 type: "alignedGridColumn", 59877 event: e 59878 }); 59879 } 59880 fireScrollEvent(e) { 59881 e.direction === "horizontal" && this.fireEvent({ 59882 type: "alignedGridScroll", 59883 event: e 59884 }); 59885 } 59886 onScrollEvent(e) { 59887 this.onEvent(() => { 59888 this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left, !0); 59889 }); 59890 } 59891 extractDataFromEvent(e, t) { 59892 const i = []; 59893 return e.columns ? e.columns.forEach((s) => { 59894 i.push(t(s)); 59895 }) : e.column && i.push(t(e.column)), i; 59896 } 59897 getMasterColumns(e) { 59898 return this.extractDataFromEvent(e, (t) => t); 59899 } 59900 getColumnIds(e) { 59901 return this.extractDataFromEvent(e, (t) => t.getColId()); 59902 } 59903 onColumnEvent(e) { 59904 this.onEvent(() => { 59905 switch (e.type) { 59906 case "columnMoved": 59907 case "columnVisible": 59908 case "columnPinned": 59909 case "columnResized": { 59910 this.processColumnEvent(e); 59911 break; 59912 } 59913 case "columnGroupOpened": { 59914 this.processGroupOpenedEvent(e); 59915 break; 59916 } 59917 case "columnPivotChanged": 59918 Ae(21); 59919 break; 59920 } 59921 }); 59922 } 59923 processGroupOpenedEvent(e) { 59924 const { colGroupSvc: t } = this.beans; 59925 t && e.columnGroups.forEach((i) => { 59926 let s = null; 59927 i && (s = t.getProvidedColGroup(i.getGroupId())), !(i && !s) && t.setColumnGroupOpened(s, i.isExpanded(), "alignedGridChanged"); 59928 }); 59929 } 59930 processColumnEvent(e) { 59931 const t = e.column; 59932 let i = null; 59933 const s = this.beans, { colResize: n, ctrlsSvc: o, colModel: r } = s; 59934 if (t && (i = r.getColDefCol(t.getColId())), t && !i) 59935 return; 59936 const a = this.getMasterColumns(e); 59937 switch (e.type) { 59938 case "columnMoved": 59939 { 59940 const d = e.api.getColumnState().map((p) => ({ colId: p.colId })); 59941 Wo(s, { state: d, applyOrder: !0 }, "alignedGridChanged"); 59942 } 59943 break; 59944 case "columnVisible": 59945 { 59946 const d = e.api.getColumnState().map((p) => ({ colId: p.colId, hide: p.hide })); 59947 Wo(s, { state: d }, "alignedGridChanged"); 59948 } 59949 break; 59950 case "columnPinned": 59951 { 59952 const d = e.api.getColumnState().map((p) => ({ colId: p.colId, pinned: p.pinned })); 59953 Wo(s, { state: d }, "alignedGridChanged"); 59954 } 59955 break; 59956 case "columnResized": { 59957 const u = e, d = {}; 59958 a.forEach((p) => { 59959 d[p.getId()] = { key: p.getColId(), newWidth: p.getActualWidth() }; 59960 }), u.flexColumns?.forEach((p) => { 59961 d[p.getId()] && delete d[p.getId()]; 59962 }), n?.setColumnWidths( 59963 Object.values(d), 59964 !1, 59965 u.finished, 59966 "alignedGridChanged" 59967 ); 59968 break; 59969 } 59970 } 59971 const c = o.getGridBodyCtrl().isVerticalScrollShowing();
59972 this.getAlignedGridApis().forEach((u) => { 59973 u.setGridOption("alwaysShowVerticalScroll", c); 59974 }); 59975 } 59976}, Jle = { 59977 moduleName: "AlignedGrids", 59978 version: Fe, 59979 beans: [Xle] 59980}, ece = class extends Ete { 59981 constructor() { 59982 super(...arguments), this.beanName = "csrmNodeSvc"; 59983 } 59984}, G0 = class { 59985 constructor() { 59986 this.removals = /* @__PURE__ */ new Set(), this.updates = /* @__PURE__ */ new Map(); 59987 } 59988 /** Marks a row as removed. Order of operations is: remove, update, add */ 59989 remove(e) { 59990 this.removals.add(e), this.updates.delete(e); 59991 } 59992 /** Marks a row as updated. Order of operations is: remove, update, add */ 59993 update(e) { 59994 this.updates.has(e) || (this.removals.delete(e), this.updates.set(e, !1)); 59995 } 59996 /** Marks a row as added. Order of operation is: remove, update, add */ 59997 add(e) { 59998 this.removals.delete(e), this.updates.set(e, !0); 59999 } 60000}; 60001function tce(e) { 60002 if (ai(e.childrenAfterSort)) 60003 return; 60004 const t = e.childrenAfterSort; 60005 for (let i = 0; i < t.length; i++) { 60006 const s = t[i], n = i === 0, o = i === e.childrenAfterSort.length - 1; 60007 s.setFirstChild(n), s.lastChild !== o && (s.lastChild = o, s.dispatchRowEvent("lastChildChanged")), s.childIndex !== i && (s.childIndex = i, s.dispatchRowEvent("childIndexChanged")); 60008 } 60009} 60010function k_(e) { 60011 e.sibling && (e.sibling.childrenAfterSort = e.childrenAfterSort), tce(e); 60012} 60013var ice = class extends he { 60014 constructor() { 60015 super(...arguments), this.beanName = "sortStage", this.refreshProps = /* @__PURE__ */ new Set(["postSortRows", "groupDisplayType", "accentedSort"]), this.step = "sort"; 60016 } 60017 execute(e) { 60018 const t = this.beans, i = t.sortSvc.getSortOptions(), s = Ie(i) && i.length > 0, n = s && !!e.changedRowNodes && // in time we can remove this check, so that delta sort is always 60019 // on if transactions are present. it's off for now so that we can 60020 // selectively turn it on and test it with some select users before 60021 // rolling out to everyone. 60022 this.gos.get("deltaSort"), o = i.some(({ column: r }) => hr(t.gos) ? r.isPrimary() && r.isRowGroupActive() : !!r.getColDef().showRowGroup); 60023 this.sort( 60024 t, 60025 i, 60026 s, 60027 n, 60028 e.changedRowNodes, 60029 e.changedPath, 60030 o 60031 ); 60032 } 60033 sort(e, t, i, s, n, o, r) { 60034 const { gos: a, colModel: l, rowGroupColsSvc: c, groupHideOpenParentsSvc: u, rowNodeSorter: d } = e, p = a.get("groupMaintainOrder"), f = l.getCols().some((C) => C.isRowGroupActive()), m = l.isPivotMode(), y = a.getCallback("postSortRows"), b = (C) => { 60035 u?.pullDownGroupDataForHideOpenParents(C.childrenAfterAggFilter, !0); 60036 const w = m && C.leafGroup, M = p && f && !C.leafGroup && !r; 60037 let A; 60038 if (M) { 60039 const L = c?.columns?.[C.level + 1]?.getSort() === null, k = C.childrenAfterAggFilter.slice(0); 60040 if (C.childrenAfterSort && !L) { 60041 const B = {}; 60042 C.childrenAfterSort.forEach((N, W) => { 60043 B[N.id] = W; 60044 }), k.sort( 60045 (N, W) => (B[N.id] ?? 0) - (B[W.id] ?? 0) 60046 ); 60047 } 60048 A = k; 60049 } else !i || w ? A = C.childrenAfterAggFilter.slice(0) : s && n ? A = sce(d, C, n, o, t) : A = d.doFullSort(C.childrenAfterAggFilter, t); 60050 if (C.childrenAfterSort = A, k_(C), y) { 60051 const I = { nodes: C.childrenAfterSort }; 60052 y(I); 60053 } 60054 }; 60055 o?.forEachChangedNodeDepthFirst(b); 60056 } 60057}; 60058function sce(e, t, i, s, n) { 60059 const o = t.childrenAfterAggFilter, r = t.childrenAfterSort; 60060 if (!r) 60061 return e.doFullSort(o, n); 60062 const a = /* @__PURE__ */ new Set(), l = [], c = i.updates; 60063 for (let d = 0, p = o.length; d < p; ++d) { 60064 const f = o[d]; 60065 c.has(f) || s && !s.canSkip(f) ? l.push({ 60066 currentPos: l.length, 60067 rowNode: f 60068 }) : a.add(f.id); 60069 } 60070 const u = r.filter((d) => a.has(d.id)).map((d, p) => ({ currentPos: p, rowNode: d })); 60071 return l.sort((d, p) => e.compareRowNodes(n, d, p)), nce(e, n, l, u); 60072} 60073function nce(e, t, i, s) { 60074 const n = []; 60075 let o = 0, r = 0; 60076 const a = i.length, l = s.length; 60077 for (; o < a && r < l; ) { 60078 const c = i[o], u = s[r], d = e.compareRowNodes(t, c, u); 60079 let p; 60080 d < 0 ? (p = c, ++o) : (p = u, ++r), n.push(p.rowNode); 60081 } 60082 for (; o < a; ) 60083 n.push(i[o++].rowNode); 60084 for (; r < l; ) 60085 n.push(s[r++].rowNode); 60086 return n; 60087} 60088var oce = class extends he {
60089 constructor() { 60090 super(...arguments), this.beanName = "rowModel", this.onRowHeightChanged_debounced = qs(this, this.onRowHeightChanged.bind(this), 100), this.rootNode = null, this.rowsToDisplay = [], this.started = !1, this.shouldSkipSettingDataOnStart = !1, this.isRefreshingModel = !1, this.rowNodesCountReady = !1, this.rowCountReady = !1; 60091 } 60092 wireBeans(e) { 60093 this.colModel = e.colModel, this.valueCache = e.valueCache, this.filterStage = e.filterStage, this.sortStage = e.sortStage, this.flattenStage = e.flattenStage, this.groupStage = e.groupStage, this.aggStage = e.aggStage, this.pivotStage = e.pivotStage, this.filterAggStage = e.filterAggStage; 60094 } 60095 postConstruct() { 60096 this.orderedStages = [ 60097 this.groupStage, 60098 this.filterStage, 60099 this.pivotStage, 60100 this.aggStage, 60101 this.sortStage, 60102 this.filterAggStage, 60103 this.flattenStage 60104 ].filter((i) => !!i); 60105 const e = this.refreshModel.bind(this, { step: "group" }), t = this.refreshModel.bind(this, { 60106 step: "group", 60107 // after cols change, row grouping (the first stage) could of changed 60108 afterColumnsChanged: !0, 60109 keepRenderedRows: !0, 60110 // we want animations cos sorting or filtering could be applied 60111 animate: !this.gos.get("suppressAnimationFrame") 60112 }); 60113 this.addManagedEventListeners({ 60114 newColumnsLoaded: t, 60115 columnRowGroupChanged: e, 60116 columnValueChanged: this.onValueChanged.bind(this), 60117 columnPivotChanged: this.refreshModel.bind(this, { step: "pivot" }), 60118 filterChanged: this.onFilterChanged.bind(this), 60119 sortChanged: this.onSortChanged.bind(this), 60120 columnPivotModeChanged: e, 60121 gridStylesChanged: this.onGridStylesChanges.bind(this), 60122 gridReady: this.onGridReady.bind(this) 60123 }), this.addPropertyListeners(), this.rootNode = new Rd(this.beans), this.initRowManager(); 60124 } 60125 initRowManager() { 60126 const { gos: e, beans: t, nodeManager: i } = this, s = e.get("treeData"), n = e.get("treeDataChildrenField"), o = n || s; 60127 let r; 60128 o && (r = n ? t.csrmChildrenTreeNodeSvc : t.csrmPathTreeNodeSvc), r || (r = t.csrmNodeSvc), i !== r && (i?.deactivate(), this.nodeManager = r), r.activate(this.rootNode); 60129 } 60130 addPropertyListeners() { 60131 const e = [ 60132 "treeData", 60133 "treeDataChildrenField", 60134 ...this.orderedStages.flatMap(({ refreshProps: t }) => [...t]) 60135 ]; 60136 this.addManagedPropertyListeners(e, (t) => { 60137 const i = t.changeSet?.properties; 60138 i && this.onPropChange(i); 60139 }), this.addManagedPropertyListener("rowData", () => this.onPropChange(["rowData"])), this.addManagedPropertyListener("rowHeight", () => this.resetRowHeights()); 60140 } 60141 start() { 60142 this.started = !0, this.shouldSkipSettingDataOnStart ? this.refreshModel({ 60143 step: "group", 60144 newData: !0, 60145 rowDataUpdated: !0 60146 }) : this.setInitialData(); 60147 } 60148 setInitialData() { 60149 this.gos.get("rowData") && (this.shouldSkipSettingDataOnStart = !0, this.onPropChange(["rowData"])); 60150 } 60151 ensureRowHeightsValid(e, t, i, s) { 60152 let n, o = !1; 60153 do { 60154 n = !1; 60155 const r = this.getRowIndexAtPixel(e), a = this.getRowIndexAtPixel(t), l = Math.max(r, i), c = Math.min(a, s); 60156 for (let u = l; u <= c; u++) { 60157 const d = this.getRow(u); 60158 if (d.rowHeightEstimated) { 60159 const p = _c(this.beans, d); 60160 d.setRowHeight(p.height), n = !0, o = !0; 60161 } 60162 } 60163 n && this.setRowTopAndRowIndex(); 60164 } while (n); 60165 return o; 60166 } 60167 onPropChange(e) { 60168 if (!this.rootNode) 60169 return; 60170 const t = this.gos, i = new Set(e), s = { 60171 step: "nothing", 60172 changedProps: i 60173 }, n = i.has("rowData"), o = i.has("treeData"), a = i.has("treeDataChildrenField") || o && !t.get("treeDataChildrenField"); 60174 let l; 60175 if (o && (s.step = "group"), (a || n) && (l = t.get("rowData"), l != null && !Array.isArray(l) && (l = null, Ae(1))), a && (n || (l = this.nodeManager?.extractRowData() ?? l), this.initRowManager()), l && (!a && this.started && !this.isEmpty() && l.length > 0 && t.exists("getRowId") && // this property is a backwards compatibility property, for those who want 60176 // the old behaviour of Row IDs but NOT Immutable Data. 60177 !t.get("resetRowDataOnUpdate") ? (s.keepRenderedRows = !0, s.animate = !this.gos.get("suppressAnimationFrame"), s.changedRowNodes = new G0(), this.nodeManager.setImmutableRowData(s, l)) : (s.step = "group", s.rowDataUpdated = !0, s.newData = !0, this.beans.selectionSvc?.reset("rowDataChanged"), this.rowNodesCountReady = !0, this.nodeManager.setNewRowData(l))), s.step === "nothing") {
60178 for (const { refreshProps: c, step: u } of this.orderedStages) 60179 if (e.some((d) => c.has(d))) { 60180 s.step = u; 60181 break; 60182 } 60183 } 60184 s.step !== "nothing" && this.refreshModel(s); 60185 } 60186 setRowTopAndRowIndex() { 60187 const { beans: e } = this, t = e.environment.getDefaultRowHeight(); 60188 let i = 0; 60189 const s = /* @__PURE__ */ new Set(), n = gs(this.gos, "normal"), o = this.rowsToDisplay; 60190 for (let r = 0, a = o.length; r < a; ++r) { 60191 const l = o[r]; 60192 if (l.id != null && s.add(l.id), l.rowHeight == null) { 60193 const c = _c(e, l, n, t); 60194 l.setRowHeight(c.height, c.estimated); 60195 } 60196 l.setRowTop(i), l.setRowIndex(r), i += l.rowHeight; 60197 } 60198 return s; 60199 } 60200 clearRowTopAndRowIndex(e, t) { 60201 const i = e.active, s = (o) => { 60202 o && o.id != null && !t.has(o.id) && o.clearRowTopAndRowIndex(); 60203 }, n = (o) => { 60204 if (o !== null && (s(o), s(o.detailNode), s(o.sibling), o.hasChildren() && o.childrenAfterGroup)) { 60205 const r = o.level == -1; 60206 i && !r && !o.expanded || o.childrenAfterGroup.forEach(n); 60207 } 60208 }; 60209 n(this.rootNode); 60210 } 60211 // returns false if row was moved, otherwise true 60212 ensureRowsAtPixel(e, t, i = 0) { 60213 const s = this.getRowIndexAtPixel(t), n = this.getRow(s), o = !this.gos.get("suppressAnimationFrame"); 60214 if (n === e[0]) 60215 return !1; 60216 const r = this.rootNode?.allLeafChildren; 60217 return r ? (e.forEach((a) => { 60218 Ko(r, a); 60219 }), e.forEach((a, l) => { 60220 r.splice(Math.max(s + i, 0) + l, 0, a); 60221 }), e.forEach((a, l) => { 60222 a.sourceRowIndex = l; 60223 }), this.refreshModel({ 60224 step: "group", 60225 keepRenderedRows: !0, 60226 animate: o, 60227 rowNodesOrderChanged: !0 60228 // We assume the order changed and we don't need to check if it really did 60229 }), !0) : !1; 60230 } 60231 highlightRowAtPixel(e, t) { 60232 const i = t != null ? this.getRowIndexAtPixel(t) : null, s = i != null ? this.getRow(i) : null; 60233 if (!s || !e || t == null) { 60234 this.clearHighlightedRow(); 60235 return; 60236 } 60237 const n = this.getHighlightPosition(t, s), o = this.isHighlightingCurrentPosition(e, s, n), r = this.lastHighlightedRow != null && this.lastHighlightedRow !== s; 60238 (o || r) && (this.clearHighlightedRow(), o) || (this.setRowNodeHighlighted(s, n), this.lastHighlightedRow = s); 60239 } 60240 setRowNodeHighlighted(e, t) { 60241 e.highlighted !== t && (e.highlighted = t, e.dispatchRowEvent("rowHighlightChanged")); 60242 } 60243 getHighlightPosition(e, t) { 60244 if (!t) { 60245 const n = this.getRowIndexAtPixel(e); 60246 if (t = this.getRow(n || 0), !t) 60247 return "Below"; 60248 } 60249 const { rowTop: i, rowHeight: s } = t; 60250 return e - i < s / 2 ? "Above" : "Below"; 60251 } 60252 getLastHighlightedRowNode() { 60253 return this.lastHighlightedRow; 60254 } 60255 isHighlightingCurrentPosition(e, t, i) { 60256 if (e === t) 60257 return !0; 60258 const s = i === "Above" ? -1 : 1; 60259 return this.getRow(t.rowIndex + s) === e; 60260 } 60261 clearHighlightedRow() { 60262 this.lastHighlightedRow && (this.setRowNodeHighlighted(this.lastHighlightedRow, null), this.lastHighlightedRow = null); 60263 } 60264 isLastRowIndexKnown() { 60265 return !0; 60266 } 60267 getRowCount() { 60268 return this.rowsToDisplay ? this.rowsToDisplay.length : 0; 60269 } 60270 /** 60271 * Returns the number of rows with level === 1 60272 */ 60273 getTopLevelRowCount() { 60274 const e = this.rootNode; 60275 if (!e || this.rowsToDisplay.length === 0) 60276 return 0; 60277 if (this.rowsToDisplay && this.rowsToDisplay[0] === e) 60278 return 1; 60279 const i = e.childrenAfterAggFilter, s = e.sibling ? 1 : 0; 60280 return (i ? i.length : 0) + s; 60281 } 60282 /** 60283 * Get the row display index by the top level index 60284 * top level index is the index of rows with level === 1 60285 */ 60286 getTopLevelRowDisplayedIndex(e) { 60287 const { rootNode: t, rowsToDisplay: i } = this; 60288 if (!t || !i.length || i[0] === t) 60289 return e; 60290 const { childrenAfterSort: n } = t, o = (a) => { 60291 let l = n[a]; 60292 if (this.gos.get("groupHideOpenParents")) 60293 for (; l.expanded && l.childrenAfterSort && l.childrenAfterSort.length > 0; ) 60294 l = l.childrenAfterSort[0]; 60295 return l.rowIndex; 60296 }, { footerSvc: r } = this.beans; 60297 return r ? r.getTopDisplayIndex(i, e, n, o) : o(e); 60298 } 60299 getRowBounds(e) { 60300 const t = this.rowsToDisplay[e]; 60301 return t ? { 60302 rowTop: t.rowTop, 60303 rowHeight: t.rowHeight 60304 } : null; 60305 } 60306 onRowGroupOpened() { 60307 const e = ad(this.gos); 60308 this.refreshModel({ step: "map", keepRenderedRows: !0, animate: e }); 60309 } 60310 onFilterChanged(e) { 60311 if (e.afterDataChange) 60312 return; 60313 const t = ad(this.gos), s = e.columns.length === 0 || e.columns.some((n) =>
60313 n.isPrimary()) ? "filter" : "filter_aggregates"; 60314 this.refreshModel({ step: s, keepRenderedRows: !0, animate: t }); 60315 } 60316 onSortChanged() { 60317 const e = ad(this.gos); 60318 this.refreshModel({ 60319 step: "sort", 60320 keepRenderedRows: !0, 60321 animate: e 60322 }); 60323 } 60324 getType() { 60325 return "clientSide"; 60326 } 60327 onValueChanged() { 60328 this.refreshModel({ step: this.colModel.isPivotActive() ? "pivot" : "aggregate" }); 60329 } 60330 createChangePath(e) { 60331 const t = !e?.length, i = new mv(!1, this.rootNode); 60332 return t && (i.active = !1), i; 60333 } 60334 isSuppressModelUpdateAfterUpdateTransaction(e) { 60335 if (!this.gos.get("suppressModelUpdateAfterUpdateTransaction")) 60336 return !1; 60337 const t = e.rowNodeTransactions; 60338 return t ? !t.some( 60339 (n) => n.add != null && n.add.length > 0 || n.remove != null && n.remove.length > 0 60340 ) : !1; 60341 } 60342 refreshModel(e) { 60343 if (!this.rootNode) 60344 return; 60345 const t = e.rowNodeTransactions, i = e.changedPath ?? (e.changedPath = this.createChangePath(t)); 60346 if (this.nodeManager.refreshModel?.(e), this.eventSvc.dispatchEvent({ type: "beforeRefreshModel", params: e }), !this.started || (e.rowDataUpdated && this.eventSvc.dispatchEvent({ type: "rowDataUpdated" }), this.isRefreshingModel || this.colModel.changeEventsDispatching || this.isSuppressModelUpdateAfterUpdateTransaction(e))) 60347 return; 60348 switch (this.isRefreshingModel = !0, e.step) { 60349 case "group": 60350 this.doRowGrouping( 60351 e.rowNodeTransactions, 60352 e.changedRowNodes, 60353 i, 60354 !!e.rowNodesOrderChanged, 60355 !!e.afterColumnsChanged 60356 ); 60357 case "filter": 60358 this.doFilter(i); 60359 case "pivot": 60360 this.doPivot(i); 60361 case "aggregate": 60362 this.doAggregate(i); 60363 case "filter_aggregates": 60364 this.doFilterAggregates(i); 60365 case "sort": 60366 this.doSort(e.changedRowNodes, i); 60367 case "map": 60368 this.doRowsToDisplay(); 60369 } 60370 const s = this.setRowTopAndRowIndex(); 60371 this.clearRowTopAndRowIndex(i, s), this.isRefreshingModel = !1, this.eventSvc.dispatchEvent({ 60372 type: "modelUpdated", 60373 animate: e.animate, 60374 keepRenderedRows: e.keepRenderedRows, 60375 newData: e.newData, 60376 newPage: !1, 60377 keepUndoRedoStack: e.keepUndoRedoStack 60378 }); 60379 } 60380 isEmpty() { 60381 return !this.rootNode?.allLeafChildren?.length || !this.colModel?.ready; 60382 } 60383 isRowsToRender() { 60384 return this.rowsToDisplay.length > 0; 60385 } 60386 getNodesInRangeForSelection(e, t) { 60387 let i = !1, s = !1; 60388 const n = [], o = Zp(this.gos); 60389 return this.forEachNodeAfterFilterAndSort((r) => { 60390 if (s) 60391 return; 60392 if (i && (r === t || r === e) && (s = !0, r.group && o)) { 60393 n.push(...r.allLeafChildren); 60394 return; 60395 } 60396 if (!i) { 60397 if (r !== t && r !== e) 60398 return; 60399 i = !0; 60400 } 60401 if (!r.group || !o) { 60402 n.push(r); 60403 return; 60404 } 60405 }), n; 60406 } 60407 getTopLevelNodes() { 60408 return this.rootNode?.childrenAfterGroup ?? null; 60409 } 60410 getRow(e) { 60411 return this.rowsToDisplay[e]; 60412 } 60413 isRowPresent(e) { 60414 return this.rowsToDisplay.indexOf(e) >= 0; 60415 } 60416 getRowIndexAtPixel(e) { 60417 const t = this.rowsToDisplay; 60418 if (this.isEmpty() || t.length === 0) 60419 return -1; 60420 let i = 0, s = t.length - 1; 60421 if (e <= 0) 60422 return 0; 60423 if (It(t).rowTop <= e) 60424 return t.length - 1; 60425 let o = -1, r = -1; 60426 for (; ; ) { 60427 const a = Math.floor((i + s) / 2), l = t[a]; 60428 if (this.isRowInPixel(l, e) || (l.rowTop < e ? i = a + 1 : l.rowTop > e && (s = a - 1), o === i && r === s)) 60429 return a; 60430 o = i, r = s; 60431 } 60432 } 60433 isRowInPixel(e, t) { 60434 const i = e.rowTop, s = e.rowTop + e.rowHeight; 60435 return i <= t && s > t; 60436 } 60437 forEachLeafNode(e) { 60438 this.rootNode?.allLeafChildren?.forEach((t, i) => e(t, i)); 60439 } 60440 forEachNode(e, t = !1) { 60441 this.recursivelyWalkNodesAndCallback({ 60442 nodes: [...this.rootNode?.childrenAfterGroup || []], 60443 callback: e, 60444 recursionType: 0, 60445 index: 0, 60446 includeFooterNodes: t 60447 }); 60448 } 60449 forEachNodeAfterFilter(e, t = !1) { 60450 this.recursivelyWalkNodesAndCallback({ 60451 nodes: [...this.rootNode?.childrenAfterAggFilter || []], 60452 callback: e, 60453 recursionType: 1, 60454 index: 0, 60455 includeFooterNodes: t 60456 }); 60457 } 60458 forEachNodeAfterFilterAndSort(e, t = !1) { 60459 this.recursivelyWalkNodesAndCallback({ 60460 nodes: [...this.rootNode?.childrenAfterSort || []], 60461 callback: e, 60462 recursionType: 2, 60463 index: 0, 60464 includeFooterNodes: t 60465 }); 60466 } 60467 forEachPivotNode(e, t = !1) { 60468 const i = this.rootNode; 60469 i && this.recursivelyWalkNodesAndCallback({ 60470 nodes: [i], 60471 callback: e, 60472 recursionType: 3, 60473 index: 0, 60474 includeFooterNodes: t 60475 }); 60476 } 60477 // iterates through each item in memory, and calls the callback function 60478 // nodes - the rowNodes to traverse 60479 // callback - the user provided callback 60480 // recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc 60481 // index - works similar to the index in forEach in javascript's array function 60482 recursivelyWalkNodesAndCallback(e) { 60483 const { nodes: t, callback: i, recursionType: s, includeFooterNodes: n } = e; 60484 let { index: o } = e; 60485 const { footerSvc: r } = this.beans; 60486 r?.addNodes(e, t, i, n, this.rootNode, "top"); 60487 for (let a = 0; a < t.length; a++) { 60488 const l = t[a]; 60489 if (i(l, o++), l.hasChildren() && !l.footer) { 60490 let c = null; 60491 switch (s) { 60492 case 0: 60493 c = l.childrenAfterGroup; 60494 break; 60495 case 1: 60496 c = l.childrenAfterAggFilter; 60497 break; 60498 case 2: 60499 c = l.childrenAfterSort; 60500 break; 60501 case 3: 60502 c = l.leafGroup ? null : l.childrenAfterSort; 60503 break; 60504 } 60505 c && (o = this.recursivelyWalkNodesAndCallback({ 60506 nodes: [...c], 60507 callback: i, 60508 recursionType: s, 60509 index: o, 60510 includeFooterNodes: n 60511 })); 60512 } 60513 } 60514 return r?.addNodes(e, t, i, n, this.rootNode, "bottom"), o; 60515 }
60516 // it's possible to recompute the aggregate without doing the other parts 60517 // + api.refreshClientSideRowModel('aggregate') 60518 doAggregate(e) { 60519 const t = this.rootNode; 60520 t && this.aggStage?.execute({ rowNode: t, changedPath: e }); 60521 } 60522 doFilterAggregates(e) { 60523 const t = this.rootNode; 60524 this.filterAggStage ? this.filterAggStage.execute({ rowNode: t, changedPath: e }) : t.childrenAfterAggFilter = t.childrenAfterFilter; 60525 } 60526 doSort(e, t) { 60527 const { groupHideOpenParentsSvc: i } = this.beans; 60528 this.sortStage ? this.sortStage.execute({ 60529 rowNode: this.rootNode, 60530 changedRowNodes: e, 60531 changedPath: t 60532 }) : t.forEachChangedNodeDepthFirst((s) => { 60533 i?.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter, !0), s.childrenAfterSort = s.childrenAfterAggFilter.slice(0), k_(s); 60534 }), i?.updateGroupDataForHideOpenParents(t); 60535 } 60536 doRowGrouping(e, t, i, s, n) { 60537 const o = this.nodeManager.treeData, r = this.rootNode; 60538 if (!o) { 60539 const a = this.groupStage; 60540 if (a) 60541 a.execute({ 60542 rowNode: r, 60543 changedPath: i, 60544 changedRowNodes: t, 60545 rowNodeTransactions: e, 60546 rowNodesOrderChanged: s, 60547 afterColumnsChanged: n 60548 }); 60549 else { 60550 const l = r.sibling; 60551 r.childrenAfterGroup = r.allLeafChildren, l && (l.childrenAfterGroup = r.childrenAfterGroup), r.updateHasChildren(); 60552 } 60553 } 60554 this.rowNodesCountReady && (this.rowCountReady = !0, this.eventSvc.dispatchEventOnce({ type: "rowCountReady" })); 60555 } 60556 doFilter(e) { 60557 this.filterStage ? this.filterStage.execute({ rowNode: this.rootNode, changedPath: e }) : e.forEachChangedNodeDepthFirst((t) => { 60558 t.childrenAfterFilter = t.childrenAfterGroup, g_(t); 60559 }, !0); 60560 } 60561 doPivot(e) { 60562 this.pivotStage?.execute({ rowNode: this.rootNode, changedPath: e }); 60563 } 60564 getRowNode(e) { 60565 if (typeof e == "string" && e.indexOf(Jw) == 0) { 60566 let i; 60567 return this.forEachNode((s) => { 60568 s.id === e && (i = s); 60569 }), i; 60570 } 60571 return this.nodeManager.getRowNode(e); 60572 } 60573 batchUpdateRowData(e, t) { 60574 if (this.applyAsyncTransactionsTimeout == null) { 60575 this.rowDataTransactionBatch = []; 60576 const i = this.gos.get("asyncTransactionWaitMillis"); 60577 this.applyAsyncTransactionsTimeout = window.setTimeout(() => { 60578 this.isAlive() && this.executeBatchUpdateRowData(); 60579 }, i); 60580 } 60581 this.rowDataTransactionBatch.push({ rowDataTransaction: e, callback: t }); 60582 } 60583 flushAsyncTransactions() { 60584 this.applyAsyncTransactionsTimeout != null && (clearTimeout(this.applyAsyncTransactionsTimeout), this.executeBatchUpdateRowData()); 60585 } 60586 executeBatchUpdateRowData() { 60587 this.valueCache?.onDataChanged(); 60588 const e = [], t = [], i = new G0(); 60589 let s = !1; 60590 this.rowDataTransactionBatch?.forEach((n) => { 60591 this.rowNodesCountReady = !0; 60592 const { rowNodeTransaction: o, rowsInserted: r } = this.nodeManager.updateRowData( 60593 n.rowDataTransaction, 60594 i 60595 ); 60596 r && (s = !0), t.push(o), n.callback && e.push(n.callback.bind(null, o)); 60597 }), this.commitTransactions(t, s, i), e.length > 0 && window.setTimeout(() => { 60598 e.forEach((n) => n()); 60599 }, 0), t.length > 0 && this.eventSvc.dispatchEvent({ 60600 type: "asyncTransactionsFlushed", 60601 results: t 60602 }), this.rowDataTransactionBatch = null, this.applyAsyncTransactionsTimeout = void 0; 60603 } 60604 /** 60605 * Used to apply transaction changes. 60606 * Called by gridApi & rowDragFeature 60607 */ 60608 updateRowData(e) { 60609 this.valueCache?.onDataChanged(), this.rowNodesCountReady = !0; 60610 const t = new G0(), { rowNodeTransaction: i, rowsInserted: s } = this.nodeManager.updateRowData(e, t); 60611 return this.commitTransactions([i], s, t), i; 60612 } 60613 /** 60614 * Common to: 60615 * - executeBatchUpdateRowData (batch transactions) 60616 * - updateRowData (single transaction) 60617 * - setImmutableRowData (generated transaction) 60618 * 60619 * @param rowNodeTrans - the transactions to apply 60620 * @param orderChanged - whether the order of the rows has changed, either via generated transaction or user provided addIndex 60621 */ 60622 commitTransactions(e, t, i) { 60623 this.refreshModel({ 60624 step: "group", 60625 rowDataUpdated: !0, 60626 rowNodeTransactions: e, 60627 rowNodesOrderChanged: t, 60628 keepRenderedRows: !0, 60629 animate: !this.gos.get("suppressAnimationFrame"), 60630 changedRowNodes: i, 60631 changedPath: this.createChangePath(e) 60632 }); 60633 } 60634 doRowsToDisplay() { 60635 const { flattenStage: e, rootNode: t } = this; 60636 let i; 60637 if (e) 60638 i = e.execute({ rowNode: t }); 60639 else { 60640 i = t?.childrenAfterSort ?? []; 60641 for (const s of i) 60642 s.setUiLevel(0); 60643 } 60644 this.rowsToDisplay = i; 60645 } 60646 onRowHeightChanged() { 60647 this.refreshModel({ 60648 step: "map", 60649 keepRenderedRows: !0, 60650 keepUndoRedoStack: !0 60651 }); 60652 } 60653 /** This method is debounced. It is used for row auto-height. If we don't debounce, 60654 * then the Row Models will end up recalculating each row position 60655 * for each row height change and result in the Row Renderer laying out rows. 60656 * This is particularly bad if using print layout, and showing eg 1,000 rows, 60657 * each row will change it's height, causing Row Model to update 1,000 times. 60658 */ 60659 onRowHeightChangedDebounced() { 60660 this.onRowHeightChanged_debounced(); 60661 } 60662 resetRowHeights() { 60663 const e = this.rootNode; 60664 if (!e) 60665 return; 60666 const t = this.resetRowHeightsForAllRowNodes(); 60667 e.setRowHeight(e.rowHeight, !0), e.sibling && e.sibling.setRowHeight(e.sibling.rowHeight, !0), t && this.onRowHeightChanged(); 60668 } 60669 resetRowHeightsForAllRowNodes() { 60670 let e = !1; 60671 return this.forEachNode((t) => { 60672 t.setRowHeight(t.rowHeight, !0); 60673 const i = t.detailNode; 60674 i && i.setRowHeight(i.rowHeight, !0), t.sibling && t.sibling.setRowHeight(t.sibling.rowHeight, !0), e = !0; 60675 }), e; 60676 } 60677 onGridStylesChanges(e) { 60678 if (e.rowHeightChanged) { 60679 if (this.beans.rowAutoHeight?.active) 60680 return; 60681 this.resetRowHeights(); 60682 } 60683 } 60684 onGridReady() { 60685 this.started || this.setInitialData(); 60686 } 60687 isRowDataLoaded() { 60688 return this.rowCountReady; 60689 } 60690 destroy() { 60691 super.destroy(), this.clearHighlightedRow(), this.started = !1, this.rootNode = null, this.nodeManager = null, this.rowDataTransactionBatch = null, this.lastHighlightedRow = null, this.orderedStages = UR, this.rowsToDisplay = UR; 60692 } 60693}; 60694function rce(e) { 60695 e.expansionSvc?.onGroupExpandedOrCollapsed(); 60696} 60697function ace(e, t) { 60698 const i = kr(e); 60699 i && ((!t || t === "everything") && (t = "group"), i.refreshModel({ 60700 step: t,
60701 keepRenderedRows: !0, 60702 animate: !e.gos.get("suppressAnimationFrame") 60703 })); 60704} 60705function lce(e) { 60706 return kr(e)?.isEmpty() ?? !0; 60707} 60708function cce(e, t) { 60709 kr(e)?.forEachLeafNode(t); 60710} 60711function uce(e, t) { 60712 kr(e)?.forEachNodeAfterFilter(t); 60713} 60714function dce(e, t) { 60715 kr(e)?.forEachNodeAfterFilterAndSort(t); 60716} 60717function hce(e) { 60718 if (e.rowAutoHeight?.active) { 60719 Ae(3); 60720 return; 60721 } 60722 kr(e)?.resetRowHeights(); 60723} 60724function pce(e, t) { 60725 return e.frameworkOverrides.wrapIncoming( 60726 () => kr(e)?.updateRowData(t) 60727 ); 60728} 60729function gce(e, t, i) { 60730 e.frameworkOverrides.wrapIncoming( 60731 () => kr(e)?.batchUpdateRowData(t, i) 60732 ); 60733} 60734function fce(e) { 60735 e.frameworkOverrides.wrapIncoming(() => kr(e)?.flushAsyncTransactions()); 60736} 60737function mce(e) { 60738 return e.selectionSvc?.getBestCostNodeSelection(); 60739} 60740var vce = { 60741 moduleName: "ClientSideRowModel", 60742 version: Fe, 60743 rowModels: ["clientSide"], 60744 beans: [ece, oce, ice], 60745 dependsOn: [a_] 60746}, yce = { 60747 moduleName: "ClientSideRowModelApi", 60748 version: Fe, 60749 rowModels: ["clientSide"], 60750 apiFunctions: { 60751 onGroupExpandedOrCollapsed: rce, 60752 refreshClientSideRowModel: ace, 60753 isRowDataEmpty: lce, 60754 forEachLeafNode: cce, 60755 forEachNodeAfterFilter: uce, 60756 forEachNodeAfterFilterAndSort: dce, 60757 resetRowHeights: hce, 60758 applyTransaction: pce, 60759 applyTransactionAsync: gce, 60760 flushAsyncTransactions: fce, 60761 getBestCostNodeSelection: mce 60762 }, 60763 dependsOn: [qle] 60764}, Cce = class extends he { 60765 constructor() { 60766 super(...arguments), this.beanName = "gridSerializer"; 60767 } 60768 wireBeans(e) { 60769 this.visibleCols = e.visibleCols, this.colModel = e.colModel, this.rowModel = e.rowModel, this.pinnedRowModel = e.pinnedRowModel; 60770 } 60771 serialize(e, t = {}) { 60772 const { allColumns: i, columnKeys: s, skipRowGroups: n } = t, o = this.getColumnsToExport( 60773 i, 60774 n, 60775 s 60776 ); 60777 return [ 60778 // first pass, put in the header names of the cols 60779 this.prepareSession(o), 60780 this.prependContent(t), 60781 this.exportColumnGroups(t, o), 60782 this.exportHeaders(t, o), 60783 this.processPinnedTopRows(t, o), 60784 this.processRows(t, o), 60785 this.processPinnedBottomRows(t, o), 60786 this.appendContent(t) 60787 ].reduce((r, a) => a(r), e).parse(); 60788 } 60789 processRow(e, t, i, s) { 60790 const n = t.shouldRowBeSkipped || (() => !1), r = t.rowPositions != null || !!t.onlySelected, a = this.gos.get("groupHideOpenParents") && !r, l = this.colModel.isPivotMode() ? s.leafGroup : !s.group, c = !!s.footer, u = s.allChildrenCount === 1 && s.childrenAfterGroup?.length === 1 && oX(this.gos, s); 60791 if (!l && !c && (t.skipRowGroups || u || a) || t.onlySelected && !s.isSelected() || t.skipPinnedTop && s.rowPinned === "top" || t.skipPinnedBottom && s.rowPinned === "bottom" || s.level === -1 && !l && !c || n(this.gos.addGridCommonParams({ node: s }))) 60792 return; 60793 const f = e.onNewBodyRow(s); 60794 if (i.forEach((m, y) => { 60795 f.onColumn(m, y, s); 60796 }), t.getCustomContentBelowRow) { 60797 const m = t.getCustomContentBelowRow(this.gos.addGridCommonParams({ node: s })); 60798 m && e.addCustomContent(m); 60799 } 60800 } 60801 appendContent(e) { 60802 return (t) => { 60803 const i = e.appendContent; 60804 return i && t.addCustomContent(i), t; 60805 }; 60806 } 60807 prependContent(e) { 60808 return (t) => { 60809 const i = e.prependContent; 60810 return i && t.addCustomContent(i), t; 60811 }; 60812 } 60813 prepareSession(e) { 60814 return (t) => (t.prepare(e), t); 60815 } 60816 exportColumnGroups(e, t) { 60817 return (i) => { 60818 if (!e.skipColumnGroupHeaders) { 60819 const s = new nN(), { colGroupSvc: n } = this.beans, o = n ? n.createColumnGroups({ 60820 columns: t, 60821 idCreator: s, 60822 pinned: null, 60823 isStandaloneStructure: !0 60824 }) : t; 60825 this.recursivelyAddHeaderGroups( 60826 o, 60827 i, 60828 e.processGroupHeaderCallback 60829 ); 60830 } 60831 return i; 60832 }; 60833 } 60834 exportHeaders(e, t) { 60835 return (i) => { 60836 if (!e.skipColumnHeaders) { 60837 const s = i.onNewHeaderRow(); 60838 t.forEach((n, o) => { 60839 s.onColumn(n, o, void 0); 60840 }); 60841 } 60842 return i; 60843 }; 60844 } 60845 processPinnedTopRows(e, t) { 60846 return (i) => { 60847 const s = this.processRow.bind(this, i, e, t); 60848 return e.rowPositions ? e.rowPositions.filter((n) => n.rowPinned === "top").sort((n, o) => n.rowIndex - o.rowIndex).map((n) =>
60848 this.pinnedRowModel?.getPinnedTopRow(n.rowIndex)).forEach(s) : this.pinnedRowModel?.forEachPinnedRow("top", s), i; 60849 }; 60850 } 60851 processRows(e, t) { 60852 return (i) => { 60853 const s = this.rowModel, n = $s(this.gos), o = Ag(this.gos), r = !n && e.onlySelected, a = this.processRow.bind(this, i, e, t), { exportedRows: l = "filteredAndSorted" } = e; 60854 if (e.rowPositions) 60855 return e.rowPositions.filter((c) => c.rowPinned == null).sort((c, u) => c.rowIndex - u.rowIndex).map((c) => s.getRow(c.rowIndex)).forEach(a), i; 60856 if (this.colModel.isPivotMode()) 60857 return n ? s.forEachPivotNode(a, !0) : o ? s.forEachNodeAfterFilterAndSort(a, !0) : s.forEachNode(a), i; 60858 if (e.onlySelectedAllPages || r) { 60859 const c = this.beans.selectionSvc?.getSelectedNodes() ?? []; 60860 this.replicateSortedOrder(c), c.forEach(a); 60861 } else 60862 l === "all" ? s.forEachNode(a) : n || o ? s.forEachNodeAfterFilterAndSort(a, !0) : s.forEachNode(a); 60863 return i; 60864 }; 60865 } 60866 replicateSortedOrder(e) { 60867 const { sortSvc: t, rowNodeSorter: i } = this.beans; 60868 if (!t || !i) 60869 return; 60870 const s = t.getSortOptions(), n = (o, r) => o.rowIndex != null && r.rowIndex != null ? o.rowIndex - r.rowIndex : o.level === r.level ? o.parent?.id === r.parent?.id ? i.compareRowNodes( 60871 s, 60872 { 60873 rowNode: o, 60874 currentPos: o.rowIndex ?? -1 60875 }, 60876 { 60877 rowNode: r, 60878 currentPos: r.rowIndex ?? -1 60879 } 60880 ) : n(o.parent, r.parent) : o.level > r.level ? n(o.parent, r) : n(o, r.parent); 60881 e.sort(n); 60882 } 60883 processPinnedBottomRows(e, t) { 60884 return (i) => { 60885 const s = this.processRow.bind(this, i, e, t); 60886 return e.rowPositions ? e.rowPositions.filter((n) => n.rowPinned === "bottom").sort((n, o) => n.rowIndex - o.rowIndex).map((n) => this.pinnedRowModel?.getPinnedBottomRow(n.rowIndex)).forEach(s) : this.pinnedRowModel?.forEachPinnedRow("bottom", s), i; 60887 }; 60888 } 60889 getColumnsToExport(e = !1, t = !1, i) { 60890 const { colModel: s, gos: n, visibleCols: o } = this, r = s.isPivotMode(); 60891 if (i && i.length) 60892 return s.getColsForKeys(i); 60893 const a = n.get("treeData"); 60894 let l = []; 60895 return e && !r ? l = s.getCols() : l = o.allCols, l = l.filter( 60896 (c) => !vr(c) && (t && !a ? !aM(c) : !0) 60897 ), l; 60898 } 60899 recursivelyAddHeaderGroups(e, t, i) { 60900 const s = []; 60901 e.forEach((n) => { 60902 const o = n;
60903 o.getChildren && o.getChildren().forEach((r) => s.push(r)); 60904 }), e.length > 0 && xi(e[0]) && this.doAddHeaderHeader(t, e, i), s && s.length > 0 && this.recursivelyAddHeaderGroups( 60905 s, 60906 t, 60907 i 60908 ); 60909 } 60910 doAddHeaderHeader(e, t, i) { 60911 const s = e.onNewHeaderGroupingRow(); 60912 let n = 0; 60913 t.forEach((o) => { 60914 const r = o; 60915 let a; 60916 i ? a = i( 60917 this.gos.addGridCommonParams({ 60918 columnGroup: r 60919 }) 60920 ) : a = this.beans.colNames.getDisplayNameForColumnGroup(r, "header"); 60921 const l = r.getLeafColumns().reduce((c, u, d, p) => { 60922 let f = It(c); 60923 return u.getColumnGroupShow() === "open" ? (!f || f[1] != null) && (f = [d], c.push(f)) : f && f[1] == null && (f[1] = d - 1), d === p.length - 1 && f && f[1] == null && (f[1] = d), c; 60924 }, []); 60925 s.onColumn( 60926 r, 60927 a || "", 60928 n++, 60929 r.getLeafColumns().length - 1, 60930 l 60931 ); 60932 }); 60933 } 60934}, bce = { 60935 moduleName: "SharedExport", 60936 version: Fe, 60937 beans: [Cce] 60938}, wT = `\r 60939`, wce = class extends Are { 60940 constructor(e) { 60941 super(e), this.isFirstLine = !0, this.result = ""; 60942 const { suppressQuotes: t, columnSeparator: i } = e; 60943 this.suppressQuotes = t, this.columnSeparator = i; 60944 } 60945 addCustomContent(e) { 60946 e && (typeof e == "string" ? (/^\s*\n/.test(e) || this.beginNewLine(), e = e.replace(/\r?\n/g, wT), this.result += e) : e.forEach((t) => { 60947 this.beginNewLine(), t.forEach((i, s) => { 60948 s !== 0 && (this.result += this.columnSeparator), this.result += this.putInQuotes(i.data.value || ""), i.mergeAcross && this.appendEmptyCells(i.mergeAcross); 60949 }); 60950 })); 60951 } 60952 onNewHeaderGroupingRow() { 60953 return this.beginNewLine(), { 60954 onColumn: this.onNewHeaderGroupingRowColumn.bind(this) 60955 }; 60956 } 60957 onNewHeaderGroupingRowColumn(e, t, i, s) { 60958 i != 0 && (this.result += this.columnSeparator), this.result += this.putInQuotes(t), this.appendEmptyCells(s); 60959 } 60960 appendEmptyCells(e) { 60961 for (let t = 1; t <= e; t++) 60962 this.result += this.columnSeparator + this.putInQuotes(""); 60963 } 60964 onNewHeaderRow() { 60965 return this.beginNewLine(), { 60966 onColumn: this.onNewHeaderRowColumn.bind(this) 60967 }; 60968 } 60969 onNewHeaderRowColumn(e, t) { 60970 t != 0 && (this.result += this.columnSeparator), this.result += this.putInQuotes(this.extractHeaderValue(e)); 60971 } 60972 onNewBodyRow() { 60973 return this.beginNewLine(), { 60974 onColumn: this.onNewBodyRowColumn.bind(this) 60975 }; 60976 } 60977 onNewBodyRowColumn(e, t, i) { 60978 t != 0 && (this.result += this.columnSeparator); 60979 const s = this.extractRowCellValue(e, t, t, "csv", i); 60980 this.result += this.putInQuotes(s.valueFormatted ?? s.value); 60981 } 60982 putInQuotes(e) { 60983 if (this.suppressQuotes) 60984 return e; 60985 if (e == null) 60986 return '""'; 60987 let t; 60988 return typeof e == "string" ? t = e : typeof e.toString == "function" ? t = e.toString() : (Ae(53), t = ""), '"' + t.replace(/"/g, '""') + '"'; 60989 } 60990 parse() { 60991 return this.result; 60992 } 60993 beginNewLine() { 60994 this.isFirstLine || (this.result += wT), this.isFirstLine = !1; 60995 } 60996}, Sce = class extends Mre { 60997 constructor() { 60998 super(...arguments), this.beanName = "csvCreator"; 60999 } 61000 wireBeans(e) { 61001 this.colModel = e.colModel, this.colNames = e.colNames, this.rowGroupColsSvc = e.rowGroupColsSvc, this.valueSvc = e.valueSvc; 61002 } 61003 getMergedParams(e) { 61004 const t = this.gos.get("defaultCsvExportParams"); 61005 return Object.assign({}, t, e); 61006 } 61007 export(e) { 61008 if (this.isExportSuppressed()) { 61009 Ae(51); 61010 return; 61011 } 61012 const t = this.getMergedParams(e), i = this.getData(t), s = new Blob(["\uFEFF", i], { type: "text/plain" }), n = typeof t.fileName == "function" ? t.fileName(this.gos.getGridCommonParams()) : t.fileName; 61013 Dre(this.getFileName(n), s); 61014 } 61015 exportDataAsCsv(e) { 61016 this.export(e); 61017 } 61018 getDataAsCsv(e, t = !1) { 61019 const i = t ? Object.assign({}, e) : this.getMergedParams(e); 61020 return this.getData(i); 61021 } 61022 getDefaultFileExtension() { 61023 return "csv"; 61024 } 61025 createSerializingSession(e) { 61026 const { colModel: t, colNames: i, rowGroupColsSvc: s, valueSvc: n, gos: o } = this, { 61027 processCellCallback: r, 61028 processHeaderCallback: a, 61029 processGroupHeaderCallback: l, 61030 processRowGroupCallback: c, 61031 suppressQuotes: u, 61032 columnSeparator: d 61033 } = e; 61034 return new wce({ 61035 colModel: t, 61036 colNames: i, 61037 valueSvc: n, 61038 gos: o, 61039 processCellCallback: r || void 0, 61040 processHeaderCallback: a || void 0, 61041 processGroupHeaderCallback: l || void 0, 61042 processRowGroupCallback: c || void 0, 61043 suppressQuotes: u || !1, 61044 columnSeparator: d || ",", 61045 rowGroupColsSvc: s 61046 }); 61047 } 61048 isExportSuppressed() { 61049 return this.gos.get("suppressCsvExport"); 61050 } 61051}; 61052function xce(e, t) { 61053 return e.csvCreator?.getDataAsCsv(t); 61054} 61055function Mce(e, t) { 61056 e.csvCreator?.exportDataAsCsv(t); 61057} 61058var Ace = { 61059 moduleName: "CsvExport", 61060 version: Fe, 61061 beans: [Sce],
61062 apiFunctions: { 61063 getDataAsCsv: xce, 61064 exportDataAsCsv: Mce 61065 }, 61066 dependsOn: [bce] 61067}, Dce = class extends he { 61068 constructor(e, t, i) { 61069 super(), this.id = e, this.parentCache = t, this.params = i, this.state = "needsLoading", this.version = 0, this.startRow = e * i.blockSize, this.endRow = this.startRow + i.blockSize; 61070 } 61071 load() { 61072 this.state = "loading", this.loadFromDatasource(); 61073 } 61074 setStateWaitingToLoad() { 61075 this.version++, this.state = "needsLoading"; 61076 } 61077 pageLoadFailed(e) { 61078 this.isRequestMostRecentAndLive(e) && (this.state = "failed"), this.dispatchLocalEvent({ type: "loadComplete" }); 61079 } 61080 pageLoaded(e, t, i) { 61081 this.successCommon(e, { rowData: t, rowCount: i }); 61082 } 61083 isRequestMostRecentAndLive(e) { 61084 const t = e === this.version, i = this.isAlive(); 61085 return t && i; 61086 } 61087 successCommon(e, t) { 61088 this.dispatchLocalEvent({ type: "loadComplete" }), this.isRequestMostRecentAndLive(e) && (this.state = "loaded", this.processServerResult(t)); 61089 } 61090 postConstruct() { 61091 this.rowNodes = []; 61092 const { 61093 params: { blockSize: e, rowHeight: t }, 61094 startRow: i, 61095 beans: s, 61096 rowNodes: n 61097 } = this; 61098 for (let o = 0; o < e; o++) { 61099 const r = i + o, a = new Rd(s); 61100 a.setRowHeight(t), a.uiLevel = 0, a.setRowIndex(r), a.setRowTop(t * r), n.push(a); 61101 } 61102 } 61103 getBlockStateJson() { 61104 const { id: e, startRow: t, endRow: i, state: s } = this; 61105 return { 61106 id: "" + e, 61107 state: { 61108 blockNumber: e, 61109 startRow: t, 61110 endRow: i, 61111 pageStatus: s 61112 } 61113 }; 61114 } 61115 setDataAndId(e, t, i) { 61116 Ie(t) ? e.setDataAndId(t, i.toString()) : e.setDataAndId(void 0, void 0); 61117 } 61118 loadFromDatasource() { 61119 const e = this.createLoadParams(); 61120 if (ai(this.params.datasource.getRows)) { 61121 Ae(90); 61122 return; 61123 } 61124 window.setTimeout(() => { 61125 this.params.datasource.getRows(e); 61126 }, 0); 61127 } 61128 createLoadParams() { 61129 const { 61130 startRow: e, 61131 endRow: t, 61132 version: i, 61133 params: { sortModel: s, filterModel: n }, 61134 gos: o 61135 } = this; 61136 return { 61137 startRow: e, 61138 endRow: t, 61139 successCallback: this.pageLoaded.bind(this, i), 61140 failCallback: this.pageLoadFailed.bind(this, i), 61141 sortModel: s, 61142 filterModel: n, 61143 context: o.getGridCommonParams().context 61144 }; 61145 } 61146 forEachNode(e, t, i) { 61147 this.rowNodes.forEach((s, n) => { 61148 this.startRow + n < i && e(s, t.value++); 61149 }); 61150 } 61151 getRow(e, t = !1) { 61152 t || (this.lastAccessed = this.params.lastAccessedSequence.value++); 61153 const i = e - this.startRow; 61154 return this.rowNodes[i]; 61155 } 61156 processServerResult(e) { 61157 const { rowNodes: t, beans: i } = this; 61158 t.forEach((n, o) => { 61159 const r = e.rowData ? e.rowData[o] : void 0; 61160 !n.id && n.alreadyRendered && r && (t[o] = new Rd(i), t[o].setRowIndex(n.rowIndex), t[o].setRowTop(n.rowTop), t[o].setRowHeight(n.rowHeight), n.clearRowTopAndRowIndex()), this.setDataAndId(t[o], r, this.startRow + o); 61161 }); 61162 const s = e.rowCount != null && e.rowCount >= 0 ? e.rowCount : void 0; 61163 this.parentCache.pageLoaded(this, s); 61164 } 61165 destroy() { 61166 this.rowNodes.forEach((e) => { 61167 e.clearRowTopAndRowIndex(); 61168 }), super.destroy(); 61169 } 61170}, Ece = 2, Ice = class extends he { 61171 constructor(e) { 61172 super(), this.params = e, this.lastRowIndexKnown = !1, this.blocks = {}, this.blockCount = 0, this.rowCount = e.initialRowCount; 61173 } 61174 // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid, 61175 // it will want new pages in the cache as it asks for rows. only when we are inserting / 61176 // removing rows via the api is dontCreatePage set, where we move rows between the pages. 61177 getRow(e, t = !1) { 61178 const i = Math.floor(e / this.params.blockSize); 61179 let s = this.blocks[i]; 61180 if (!s) { 61181 if (t) 61182 return; 61183 s = this.createBlock(i); 61184 } 61185 return s.getRow(e); 61186 } 61187 createBlock(e) { 61188 const t = this.params, i = this.createBean(new Dce(e, this, t)); 61189 return this.blocks[i.id] = i, this.blockCount++, this.purgeBlocksIfNeeded(i), t.rowNodeBlockLoader.addBlock(i), i; 61190 } 61191 // we have this on infinite row model only, not server side row model, 61192 // because for server side, it would leave the children in inconsistent 61193 // state - eg if a node had children, but after the refresh it had data 61194 // for a different row, then the children would be with the wrong row node. 61195 refreshCache() { 61196 if (this.blockCount == 0) { 61197 this.purgeCache(); 61198 return; 61199 }
61200 this.getBlocksInOrder().forEach((t) => t.setStateWaitingToLoad()), this.params.rowNodeBlockLoader.checkBlockToLoad(); 61201 } 61202 destroy() { 61203 this.getBlocksInOrder().forEach((e) => this.destroyBlock(e)), super.destroy(); 61204 } 61205 getRowCount() { 61206 return this.rowCount; 61207 } 61208 isLastRowIndexKnown() { 61209 return this.lastRowIndexKnown; 61210 } 61211 // block calls this, when page loaded 61212 pageLoaded(e, t) { 61213 this.isAlive() && (Ml(this.gos, `InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`), this.checkRowCount(e, t), this.onCacheUpdated()); 61214 } 61215 purgeBlocksIfNeeded(e) { 61216 const t = this.getBlocksInOrder().filter((r) => r != e), i = (r, a) => a.lastAccessed - r.lastAccessed; 61217 t.sort(i); 61218 const s = this.params.maxBlocksInCache > 0, n = s ? this.params.maxBlocksInCache - 1 : null, o = Ece - 1; 61219 t.forEach((r, a) => { 61220 const l = r.state === "needsLoading" && a >= o, c = s ? a >= n : !1; 61221 if (l || c) { 61222 if (this.isBlockCurrentlyDisplayed(r) || this.isBlockFocused(r)) 61223 return; 61224 this.removeBlockFromCache(r); 61225 } 61226 }); 61227 } 61228 isBlockFocused(e) { 61229 const t = this.beans.focusSvc.getFocusCellToUseAfterRefresh(); 61230 if (!t || t.rowPinned != null) 61231 return !1; 61232 const { startRow: i, endRow: s } = e; 61233 return t.rowIndex >= i && t.rowIndex < s; 61234 } 61235 isBlockCurrentlyDisplayed(e) { 61236 const { startRow: t, endRow: i } = e; 61237 return this.beans.rowRenderer.isRangeInRenderedViewport(t, i - 1); 61238 } 61239 removeBlockFromCache(e) { 61240 e && this.destroyBlock(e); 61241 } 61242 checkRowCount(e, t) { 61243 if (typeof t == "number" && t >= 0) 61244 this.rowCount = t, this.lastRowIndexKnown = !0; 61245 else if (!this.lastRowIndexKnown) { 61246 const { blockSize: i, overflowSize: s } = this.params, o = (e.id + 1) * i + s; 61247 this.rowCount < o && (this.rowCount = o); 61248 } 61249 } 61250 setRowCount(e, t) { 61251 this.rowCount = e, Ie(t) && (this.lastRowIndexKnown = t), this.lastRowIndexKnown || this.rowCount % this.params.blockSize === 0 && this.rowCount++, this.onCacheUpdated(); 61252 } 61253 forEachNodeDeep(e) { 61254 const t = { value: 0 }; 61255 this.getBlocksInOrder().forEach((i) => i.forEachNode(e, t, this.rowCount)); 61256 } 61257 getBlocksInOrder() { 61258 const e = (i, s) => i.id - s.id; 61259 return Object.values(this.blocks).sort(e); 61260 } 61261 destroyBlock(e) { 61262 delete this.blocks[e.id], this.destroyBean(e), this.blockCount--, this.params.rowNodeBlockLoader.removeBlock(e); 61263 } 61264 // gets called 1) row count changed 2) cache purged 3) items inserted 61265 onCacheUpdated() { 61266 this.isAlive() && (this.destroyAllBlocksPastVirtualRowCount(), this.eventSvc.dispatchEvent({ 61267 type: "storeUpdated" 61268 })); 61269 } 61270 destroyAllBlocksPastVirtualRowCount() { 61271 const e = []; 61272 this.getBlocksInOrder().forEach((t) => { 61273 t.id * this.params.blockSize >= this.rowCount && e.push(t); 61274 }), e.length > 0 && e.forEach((t) => this.destroyBlock(t)); 61275 } 61276 purgeCache() { 61277 this.getBlocksInOrder().forEach((e) => this.removeBlockFromCache(e)), this.lastRowIndexKnown = !1, this.rowCount === 0 && (this.rowCount = this.params.initialRowCount), this.onCacheUpdated(); 61278 } 61279 getRowNodesInRange(e, t) { 61280 const i = []; 61281 let s = -1, n = !1; 61282 const o = { value: 0 }; 61283 let r = !1; 61284 return this.getBlocksInOrder().forEach((l) => { 61285 if (!r) { 61286 if (n && s + 1 !== l.id) { 61287 r = !0; 61288 return; 61289 } 61290 s = l.id, l.forEachNode( 61291 (c) => { 61292 const u = c === e || c === t; 61293 (n || u) && i.push(c), u && (n = !n); 61294 }, 61295 o, 61296 this.rowCount 61297 ); 61298 } 61299 }), r || n ? [] : i; 61300 } 61301}, Rce = class extends he { 61302 constructor() { 61303 super(...arguments), this.beanName = "rowModel"; 61304 } 61305 getRowBounds(e) { 61306 return { 61307 rowHeight: this.rowHeight, 61308 rowTop: this.rowHeight * e 61309 }; 61310 } 61311 // we don't implement as lazy row heights is not supported in this row model 61312 ensureRowHeightsValid() { 61313 return !1; 61314 } 61315 postConstruct() { 61316 this.gos.get("rowModelType") === "infinite" && (this.rowHeight = Ec(this.beans), this.addEventListeners(), this.addDestroyFunc(() => this.destroyCache())); 61317 } 61318 start() { 61319 this.setDatasource(this.gos.get("datasource")); 61320 } 61321 destroy() { 61322 this.destroyDatasource(), super.destroy(); 61323 } 61324 destroyDatasource() { 61325 this.datasource && (this.destroyBean(this.datasource), this.beans.rowRenderer.datasourceChanged(), this.datasource = null); 61326 } 61327 addEventListeners() { 61328 this.addManagedEventListeners({ 61329 filterChanged: this.reset.bind(this), 61330 sortChanged: this.reset.bind(this), 61331 newColumnsLoaded: this.onColumnEverything.bind(this), 61332 storeUpdated: this.dispatchModelUpdatedEvent.bind(this) 61333 }), this.addManagedPropertyListener("datasource", () => this.setDatasource(this.gos.get("datasource"))), this.addManagedPropertyListener("cacheBlockSize", () => this.resetCache()), this.addManagedPropertyListener("rowHeight", () => { 61334 this.rowHeight = Ec(this.beans), this.cacheParams.rowHeight = this.rowHeight, this.updateRowHeights(); 61335 }); 61336 } 61337 onColumnEverything() { 61338 let e; 61339 this.cacheParams ? e = !Yp(this.cacheParams.sortModel, this.beans.sortSvc?.getSortModel() ?? []) : e = !0, e && this.reset(); 61340 } 61341 getType() { 61342 return "infinite"; 61343 } 61344 setDatasource(e) { 61345 this.destroyDatasource(), this.datasource = e, e && this.reset(); 61346 } 61347 isEmpty() { 61348 return !this.infiniteCache; 61349 } 61350 isRowsToRender() { 61351 return !!this.infiniteCache; 61352 } 61353 getNodesInRangeForSelection(e, t) { 61354 return this.infiniteCache?.getRowNodesInRange(e, t) ?? []; 61355 } 61356 reset() { 61357 if (!this.datasource) 61358 return; 61359 Ad(this.gos) != null || this.beans.selectionSvc?.reset("rowDataChanged"), this.resetCache(); 61360 } 61361 dispatchModelUpdatedEvent() { 61362 this.eventSvc.dispatchEvent({ 61363 type: "modelUpdated", 61364 // not sure if these should all be false - noticed if after implementing, 61365 // maybe they should be true? 61366 newPage: !1, 61367 newPageSize: !1, 61368 newData: !1, 61369 keepRenderedRows: !0, 61370 animate: !1 61371 }); 61372 } 61373 resetCache() { 61374 this.destroyCache(); 61375 const e = this.beans, { filterManager: t, sortSvc: i, rowNodeBlockLoader: s, eventSvc: n, gos: o } = e; 61376 this.cacheParams = { 61377 // the user provided datasource 61378 datasource: this.datasource, 61379 // sort and filter model 61380 filterModel: t?.getFilterModel() ?? {}, 61381 sortModel: i?.getSortModel() ?? [], 61382 rowNodeBlockLoader: s, 61383 // properties - this way we take a snapshot of them, so if user changes any, they will be 61384 // used next time we create a new cache, which is generally after a filter or sort change, 61385 // or a new datasource is set 61386 initialRowCount: o.get("infiniteInitialRowCount"), 61387 maxBlocksInCache: o.get("maxBlocksInCache"), 61388 rowHeight: Ec(e), 61389 // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past 61390 // the current page and request first row of next page 61391 overflowSize: o.get("cacheOverflowSize"), 61392 // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the 61393 // server for one page at a time. so the default if not specified is 100. 61394 blockSize: o.get("cacheBlockSize"), 61395 // the cache could create this, however it is also used by the pages, so handy to create it 61396 // here as the settings are also passed to the pages 61397 lastAccessedSequence: { value: 0 } 61398 }, this.infiniteCache = this.createBean(new Ice(this.cacheParams)), n.dispatchEventOnce({ 61399 type: "rowCountReady" 61400 }), this.dispatchModelUpdatedEvent(); 61401 } 61402 updateRowHeights() { 61403 this.forEachNode((e) => { 61404 e.setRowHeight(this.rowHeight), e.setRowTop(this.rowHeight * e.rowIndex); 61405 }), this.dispatchModelUpdatedEvent(); 61406 } 61407 destroyCache() { 61408 this.infiniteCache = this.destroyBean(this.infiniteCache); 61409 } 61410 getRow(e) { 61411 const t = this.infiniteCache; 61412 if (t && !(e >= t.getRowCount())) 61413 return t.getRow(e); 61414 } 61415 getRowNode(e) { 61416 let t; 61417 return this.forEachNode((i) => { 61418 i.id === e && (t = i); 61419 }), t; 61420 } 61421 forEachNode(e) { 61422 this.infiniteCache?.forEachNodeDeep(e); 61423 } 61424 getTopLevelRowCount() { 61425 return this.getRowCount(); 61426 } 61427 getTopLevelRowDisplayedIndex(e) { 61428 return e; 61429 } 61430 getRowIndexAtPixel(e) { 61431 if (this.rowHeight !== 0) { 61432 const t = Math.floor(e / this.rowHeight), i = this.getRowCount() - 1; 61433 return t > i ? i : t; 61434 } 61435 return 0; 61436 } 61437 getRowCount() { 61438 return this.infiniteCache ? this.infiniteCache.getRowCount() : 0; 61439 } 61440 isRowPresent(e) { 61441 return !!this.getRowNode(e.id); 61442 } 61443 refreshCache() { 61444 this.infiniteCache?.refreshCache(); 61445 } 61446 purgeCache() { 61447 this.infiniteCache?.purgeCache(); 61448 } 61449 // for iRowModel 61450 isLastRowIndexKnown() { 61451 return this.infiniteCache?.isLastRowIndexKnown() ?? !1; 61452 } 61453 setRowCount(e, t) { 61454 this.infiniteCache?.setRowCount(e, t); 61455 } 61456}; 61457function Tce(e) { 61458 Qy(e)?.refreshCache(); 61459} 61460function Lce(e) { 61461 Qy(e)?.purgeCache(); 61462} 61463function kce(e) { 61464 return Qy(e)?.getRowCount(); 61465} 61466var Pce = class extends he {
61467 constructor() { 61468 super(...arguments), this.beanName = "rowNodeBlockLoader", this.activeBlockLoadsCount = 0, this.blocks = [], this.active = !0; 61469 } 61470 postConstruct() { 61471 this.maxConcurrentRequests = rX(this.gos); 61472 const e = this.gos.get("blockLoadDebounceMillis"); 61473 e && e > 0 && (this.checkBlockToLoadDebounce = qs( 61474 this, 61475 this.performCheckBlocksToLoad.bind(this), 61476 e 61477 )); 61478 } 61479 addBlock(e) { 61480 this.blocks.push(e), e.addEventListener("loadComplete", this.loadComplete.bind(this)), this.checkBlockToLoad(); 61481 } 61482 removeBlock(e) { 61483 Ko(this.blocks, e); 61484 } 61485 destroy() { 61486 super.destroy(), this.active = !1; 61487 } 61488 loadComplete() { 61489 this.activeBlockLoadsCount--, this.checkBlockToLoad(); 61490 } 61491 checkBlockToLoad() { 61492 this.checkBlockToLoadDebounce ? this.checkBlockToLoadDebounce() : this.performCheckBlocksToLoad(); 61493 } 61494 performCheckBlocksToLoad() { 61495 if (!this.active) 61496 return; 61497 if (this.printCacheStatus(), this.maxConcurrentRequests != null && this.activeBlockLoadsCount >= this.maxConcurrentRequests) { 61498 Ml(this.gos, "RowNodeBlockLoader - checkBlockToLoad: max loads exceeded"); 61499 return; 61500 } 61501 const e = this.maxConcurrentRequests != null ? this.maxConcurrentRequests - this.activeBlockLoadsCount : 1, t = this.blocks.filter((i) => i.state === "needsLoading").slice(0, e); 61502 this.activeBlockLoadsCount += t.length, t.forEach((i) => i.load()), this.printCacheStatus(); 61503 } 61504 getBlockState() { 61505 const e = {}; 61506 return this.blocks.forEach((t) => { 61507 const { id: i, state: s } = t.getBlockStateJson(); 61508 e[i] = s; 61509 }), e; 61510 } 61511 printCacheStatus() { 61512 Ml( 61513 this.gos, 61514 `RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}` 61515 ); 61516 } 61517}, Fce = { 61518 moduleName: "InfiniteRowModel", 61519 version: Fe, 61520 rowModels: ["infinite"], 61521 apiFunctions: { 61522 refreshInfiniteCache: Tce, 61523 purgeInfiniteCache: Lce, 61524 getInfiniteRowCount: kce 61525 }, 61526 beans: [Rce, Pce], 61527 dependsOn: [Qle] 61528}, Oce = "â", Nce = "â", _ce = class extends Tt { 61529 constructor() { 61530 super(), this.refreshCount = 0; 61531 const e = document.createElement("span"), t = document.createElement("span"); 61532 t.setAttribute("class", "ag-value-change-delta"); 61533 const i = document.createElement("span"); 61534 i.setAttribute("class", "ag-value-change-value"), e.appendChild(t), e.appendChild(i), this.setTemplateFromElement(e); 61535 } 61536 init(e) { 61537 this.eValue = this.queryForHtmlElement(".ag-value-change-value"), this.eDelta = this.queryForHtmlElement(".ag-value-change-delta"), this.refresh(e, !0); 61538 } 61539 showDelta(e, t) { 61540 const i = Math.abs(t), s = e.formatValue(i), n = Ie(s) ? s : i, o = t >= 0, r = this.eDelta; 61541 o ? r.textContent = Oce + n : r.textContent = Nce + n, r.classList.toggle("ag-value-change-delta-up", o), r.classList.toggle("ag-value-change-delta-down", !o); 61542 } 61543 setTimerToRemoveDelta() { 61544 this.refreshCount++; 61545 const e = this.refreshCount; 61546 this.beans.frameworkOverrides.wrapIncoming(() => { 61547 window.setTimeout(() => { 61548 e === this.refreshCount && this.hideDeltaValue(); 61549 }, 2e3); 61550 }); 61551 } 61552 hideDeltaValue() { 61553 this.eValue.classList.remove("ag-value-change-value-highlight"), Is(this.eDelta); 61554 } 61555 refresh(e, t = !1) { 61556 const { value: i, valueFormatted: s } = e, { eValue: n, lastValue: o, beans: r } = this; 61557 if (i === o || (Ie(s) ? n.textContent = s : Ie(i) ? n.textContent = i : Is(n), r.filterManager?.isSuppressFlashingCellsBecauseFiltering())) 61558 return !1; 61559 if (typeof i == "number" && typeof o == "number") { 61560 const a = i - o; 61561 this.showDelta(e, a); 61562 } 61563 return o && n.classList.add("ag-value-change-value-highlight"), t || this.setTimerToRemoveDelta(), this.lastValue = i, !0; 61564 } 61565}, Bce = ( 61566 /*css*/ 61567 ".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}
61567:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}" 61568), Gce = class extends Tt { 61569 constructor() { 61570 super(), this.refreshCount = 0; 61571 const e = document.createElement("span"), t = document.createElement("span"); 61572 t.setAttribute("class", "ag-value-slide-current"), e.appendChild(t), this.setTemplateFromElement(e), this.eCurrent = this.queryForHtmlElement(".ag-value-slide-current"), this.registerCSS(Bce); 61573 } 61574 init(e) { 61575 this.refresh(e, !0); 61576 } 61577 addSlideAnimation() { 61578 this.refreshCount++; 61579 const e = this.refreshCount; 61580 this.ePrevious && this.getGui().removeChild(this.ePrevious); 61581 const { beans: t, eCurrent: i } = this, s = Ei(t).createElement("span"); 61582 s.setAttribute("class", "ag-value-slide-previous ag-value-slide-out"), this.ePrevious = s, s.textContent = i.textContent, this.getGui().insertBefore(s, i), t.frameworkOverrides.wrapIncoming(() => { 61583 window.setTimeout(() => { 61584 e === this.refreshCount && this.ePrevious.classList.add("ag-value-slide-out-end"); 61585 }, 50), window.setTimeout(() => { 61586 e === this.refreshCount && (this.getGui().removeChild(this.ePrevious), this.ePrevious = null); 61587 }, 3e3); 61588 }); 61589 } 61590 refresh(e, t = !1) { 61591 let i = e.value; 61592 if (ai(i) && (i = ""), i === this.lastValue || this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering()) 61593 return !1; 61594 t || this.addSlideAnimation(), this.lastValue = i; 61595 const s = this.eCurrent; 61596 return Ie(e.valueFormatted) ? s.textContent = e.valueFormatted : Ie(e.value) ? s.textContent = i : Is(s), !0; 61597 } 61598}, zce = class extends he { 61599 constructor() { 61600 super(...arguments), this.beanName = "cellFlashSvc"; 61601 } 61602 onFlashCells(e, t) { 61603 if (!e.comp) 61604 return; 61605 const i = hee(e.cellPosition); 61606 t.cells[i] && this.animateCell(e, "highlight"); 61607 } 61608 flashCell(e, t) { 61609 this.animateCell(e, "data-changed", t?.flashDuration, t?.fadeDuration); 61610 } 61611 animateCell(e, t, i, s) { 61612 const n = e.comp; 61613 if (!n) 61614 return; 61615 const { gos: o } = this; 61616 if (i || (i = o.get("cellFlashDuration")), i === 0) 61617 return; 61618 Ie(s) || (s = o.get("cellFadeDuration")); 61619 const r = `ag-cell-${t}`, a = `ag-cell-${t}-animation`; 61620 n.addOrRemoveCssClass(r, !0), n.addOrRemoveCssClass(a, !1); 61621 const { eGui: l } = e; 61622 this.beans.frameworkOverrides.wrapIncoming(() => { 61623 window.setTimeout(() => { 61624 e.isAlive() && (n.addOrRemoveCssClass(r, !1), n.addOrRemoveCssClass(a, !0), l.style.transition = `background-color ${s}ms`, window.setTimeout(() => { 61625 e.isAlive() && (n.addOrRemoveCssClass(a, !1), l.style.transition = ""); 61626 }, s)); 61627 }, i); 61628 }); 61629 } 61630}; 61631function Hce(e, t = {}) { 61632 const { cellFlashSvc: i } = e; 61633 i && e.frameworkOverrides.wrapIncoming(() => { 61634 e.rowRenderer.getCellCtrls(t.rowNodes, t.columns).forEach((s) => i.flashCell(s, t)); 61635 }); 61636} 61637var Vce = { 61638 moduleName: "HighlightChanges", 61639 version: Fe, 61640 beans: [zce], 61641 userComponents: { 61642 agAnimateShowChangeCellRenderer: _ce, 61643 agAnimateSlideCellRenderer: Gce 61644 }, 61645 apiFunctions: { 61646 flashCells: Hce 61647 } 61648}; 61649function Uce(e) { 61650 return e.stateSvc?.getState() ?? {}; 61651} 61652function Wce(e) { 61653 return e = { ...e }, e.version || (e.version = "32.1.0"), e.version === "32.1.0" && (e = jce(e)), e; 61654} 61655function jce(e) { 61656 return e.cellSelection = $ce(e, "rangeSelection"), e; 61657} 61658function $ce(e, t) { 61659 if (e && typeof e == "object") 61660 return e[t]; 61661} 61662var Yce = class extends he { 61663 constructor() { 61664 super(...arguments), this.beanName = "stateSvc", this.updateRowGroupExpansionStateTimer = 0, this.suppressEvents = !0, this.queuedUpdateSources = /* @__PURE__ */ new Set(), this.dispatchStateUpdateEventDebounced = qs(this, () => this.dispatchQueuedStateUpdateEvents(), 0), this.onRowGroupOpenedDebounced = qs( 61665 this, 61666 () => { 61667 this.updateCachedState("rowGroupExpansion", this.getRowGroupExpansionState()); 61668 }, 61669 0 61670 ), this.onRowSelectedDebounced = qs( 61671 this, 61672 () => { 61673 this.staleStateKeys.delete("rowSelection"), this.updateCachedState("rowSelection", this.getRowSelectionState()); 61674 }, 61675 0 61676 ), this.staleStateKeys = /* @__PURE__ */ new Set(); 61677 } 61678 postConstruct() { 61679 this.isClientSideRowModel = $s(this.gos), this.cachedState = this.getInitialState(), this.setCachedStateValue("version", Fe); 61680 const e = this.suppressEventsAndDispatchInitEvent.bind(this); 61681 this.beans.ctrlsSvc.whenReady( 61682 this, 61683 () => e(() => this.setupStateOnGridReady()) 61684 ); 61685 const [t, i, s] = this.addManagedEventListeners({ 61686 newColumnsLoaded: ({ source: n }) => { 61687 n === "gridInitializing" && (t(), e(() => this.setupStateOnColumnsInitialised())); 61688 }, 61689 rowCountReady: () => { 61690 i?.(), e(() => this.setupStateOnRowCountReady()); 61691 }, 61692 firstDataRendered: () => { 61693 s?.(), e(() => this.setupStateOnFirstDataRendered()); 61694 } 61695 }); 61696 } 61697 destroy() { 61698 super.destroy(), clearTimeout(this.updateRowGroupExpansionStateTimer), this.queuedUpdateSources.clear(); 61699 } 61700 getInitialState() { 61701 return Wce(this.gos.get("initialState") ?? {}); 61702 } 61703 getState() { 61704 return this.staleStateKeys.size && this.refreshStaleState(), this.cachedState; 61705 } 61706 setupStateOnGridReady() { 61707 const e = () =>
61707 this.updateCachedState("sideBar", this.getSideBarState()); 61708 e(), this.addManagedEventListeners({ 61709 toolPanelVisibleChanged: e, 61710 sideBarUpdated: e 61711 }); 61712 } 61713 setupStateOnColumnsInitialised() { 61714 const e = this.getInitialState(); 61715 this.setColumnState(e), this.setColumnGroupState(e), this.updateColumnState([ 61716 "aggregation", 61717 "columnOrder", 61718 "columnPinning", 61719 "columnSizing", 61720 "columnVisibility", 61721 "pivot", 61722 "pivot", 61723 "rowGroup", 61724 "sort" 61725 ]), this.updateCachedState("columnGroup", this.getColumnGroupState()); 61726 const t = (i) => () => this.updateColumnState([i]); 61727 this.addManagedEventListeners({ 61728 columnValueChanged: t("aggregation"), 61729 columnMoved: t("columnOrder"), 61730 columnPinned: t("columnPinning"), 61731 columnResized: t("columnSizing"), 61732 columnVisible: t("columnVisibility"), 61733 columnPivotChanged: t("pivot"), 61734 columnPivotModeChanged: t("pivot"), 61735 columnRowGroupChanged: t("rowGroup"), 61736 sortChanged: t("sort"), 61737 newColumnsLoaded: () => this.updateColumnState([ 61738 "aggregation", 61739 "columnOrder", 61740 "columnPinning", 61741 "columnSizing", 61742 "columnVisibility", 61743 "pivot", 61744 "rowGroup", 61745 "sort" 61746 ]), 61747 columnGroupOpened: () => this.updateCachedState("columnGroup", this.getColumnGroupState()) 61748 }); 61749 } 61750 setupStateOnRowCountReady() { 61751 const { 61752 filter: e, 61753 rowGroupExpansion: t, 61754 rowSelection: i, 61755 pagination: s 61756 } = this.getInitialState(); 61757 e && this.setFilterState(e), t && this.setRowGroupExpansionState(t), i && this.setRowSelectionState(i), s && this.setPaginationState(s); 61758 const n = this.updateCachedState.bind(this); 61759 n("filter", this.getFilterState()), n("rowGroupExpansion", this.getRowGroupExpansionState()), n("rowSelection", this.getRowSelectionState()), n("pagination", this.getPaginationState()); 61760 const o = () => { 61761 this.updateRowGroupExpansionStateTimer = 0, n("rowGroupExpansion", this.getRowGroupExpansionState()); 61762 }; 61763 this.addManagedEventListeners({ 61764 filterChanged: () => n("filter", this.getFilterState()), 61765 rowGroupOpened: () => this.onRowGroupOpenedDebounced(), 61766 expandOrCollapseAll: o, 61767 // `groupDefaultExpanded` updates expansion state without an expansion event 61768 columnRowGroupChanged: o, 61769 rowDataUpdated: () => { 61770 this.gos.get("groupDefaultExpanded") !== 0 && (this.updateRowGroupExpansionStateTimer || (this.updateRowGroupExpansionStateTimer = setTimeout(o))); 61771 }, 61772 selectionChanged: () => { 61773 this.staleStateKeys.add("rowSelection"), this.onRowSelectedDebounced(); 61774 }, 61775 paginationChanged: (r) => { 61776 (r.newPage || r.newPageSize) && n("pagination", this.getPaginationState()); 61777 } 61778 }); 61779 } 61780 setupStateOnFirstDataRendered() { 61781 const { 61782 scroll: e, 61783 cellSelection: t, 61784 focusedCell: i, 61785 columnOrder: s 61786 } = this.getInitialState(); 61787 i && this.setFocusedCellState(i), t && this.setCellSelectionState(t), e && this.setScrollState(e), this.setColumnPivotState(!!s?.orderedColIds); 61788 const n = this.updateCachedState.bind(this); 61789 n("sideBar", this.getSideBarState()), n("focusedCell", this.getFocusedCellState()); 61790 const o = this.getRangeSelectionState(); 61791 n("rangeSelection", o), n("cellSelection", o), n("scroll", this.getScrollState()), this.addManagedEventListeners({ 61792 cellFocused: () => n("focusedCell", this.getFocusedCellState()), 61793 cellSelectionChanged: (r) => { 61794 if (r.finished) { 61795 const a = this.getRangeSelectionState(); 61796 n("rangeSelection", a), n("cellSelection", a); 61797 } 61798 }, 61799 bodyScrollEnd: () => n("scroll", this.getScrollState()) 61800 }); 61801 } 61802 getColumnState() { 61803 const e = this.beans, t = e.colModel.isPivotMode(), i = [], s = [], n = [], o = [], r = [], a = [], l = [], c = [], u = []; 61804 let d = 0; 61805 const p = qp(e); 61806 for (let f = 0; f < p.length; f++) { 61807 const { 61808 colId: m, 61809 sort: y, 61810 sortIndex: b, 61811 rowGroup: C, 61812 rowGroupIndex: w, 61813 aggFunc: M, 61814 pivot: A, 61815 pivotIndex: I, 61816 pinned: L, 61817 hide: k, 61818 width: B, 61819 flex: N 61820 } = p[f]; 61821 u.push(m), y && (i[b ?? d++] = { colId: m, sort: y }), C && (s[w ?? 0] = m), typeof M == "string" && n.push({ colId: m, aggFunc: M }), A && (o[I ?? 0] = m), L && (L === "right" ? a : r).push(m), k && l.push(m), (N || B) && c.push({ colId: m, flex: N ?? void 0, width: B }); 61822 } 61823 return { 61824 sort: i.length ? { sortModel: i } : void 0, 61825 rowGroup: s.length ? { groupColIds: s } : void 0, 61826 aggregation: n.length ? { aggregationModel: n } : void 0, 61827 pivot: o.length || t ? { pivotMode: t, pivotColIds: o } : void 0, 61828 columnPinning: r.length || a.length ? { leftColIds: r, rightColIds: a } : void 0, 61829 columnVisibility: l.length ? { hiddenColIds: l } : void 0, 61830 columnSizing: c.length ? { columnSizingModel: c } : void 0, 61831 columnOrder: u.length ? { orderedColIds: u } : void 0 61832 }; 61833 } 61834 setColumnState(e) { 61835 const { 61836 sort: t, 61837 rowGroup: i, 61838 aggregation: s, 61839 pivot: n, 61840 columnPinning: o, 61841 columnVisibility: r, 61842 columnSizing: a, 61843 columnOrder: l, 61844 partialColumnState: c 61845 } = e, u = {}, d = (b) => { 61846 let C = u[b]; 61847 return C || (C = { colId: b }, u[b] = C, C); 61848 }, p = c ? {}
61848 : { 61849 sort: null, 61850 sortIndex: null, 61851 rowGroup: null, 61852 rowGroupIndex: null, 61853 aggFunc: null, 61854 pivot: null, 61855 pivotIndex: null, 61856 pinned: null, 61857 hide: null, 61858 flex: null 61859 }; 61860 t && (t.sortModel.forEach(({ colId: b, sort: C }, w) => { 61861 const M = d(b); 61862 M.sort = C, M.sortIndex = w; 61863 }), p.sort = null, p.sortIndex = null), i && (i.groupColIds.forEach((b, C) => { 61864 const w = d(b); 61865 w.rowGroup = !0, w.rowGroupIndex = C; 61866 }), p.rowGroup = null, p.rowGroupIndex = null), s && (s.aggregationModel.forEach(({ colId: b, aggFunc: C }) => { 61867 d(b).aggFunc = C; 61868 }), p.aggFunc = null), n && (n.pivotColIds.forEach((b, C) => { 61869 const w = d(b); 61870 w.pivot = !0, w.pivotIndex = C; 61871 }), this.gos.updateGridOptions({ 61872 options: { pivotMode: n.pivotMode }, 61873 source: "gridInitializing" 61874 }), p.pivot = null, p.pivotIndex = null), o && (o.leftColIds.forEach((b) => { 61875 d(b).pinned = "left"; 61876 }), o.rightColIds.forEach((b) => { 61877 d(b).pinned = "right"; 61878 }), p.pinned = null), r && (r.hiddenColIds.forEach((b) => { 61879 d(b).hide = !0; 61880 }), p.hide = null), a && (a.columnSizingModel.forEach(({ colId: b, flex: C, width: w }) => { 61881 const M = d(b); 61882 M.flex = C ?? null, M.width = w; 61883 }), p.flex = null); 61884 const f = l?.orderedColIds, m = !!f?.length, y = m ? f.map((b) => d(b)) : Object.values(u); 61885 y.length && (this.columnStates = y, Wo( 61886 this.beans, 61887 { 61888 state: y, 61889 applyOrder: m, 61890 defaultState: p 61891 }, 61892 "gridInitializing" 61893 )); 61894 } 61895 setColumnPivotState(e) { 61896 const t = this.columnStates; 61897 this.columnStates = void 0; 61898 const i = this.columnGroupStates; 61899 this.columnGroupStates = void 0; 61900 const s = this.beans, { pivotResultCols: n, colGroupSvc: o } = s; 61901 if (n?.isPivotResultColsPresent()) { 61902 if (t) { 61903 const r = []; 61904 for (const a of t) 61905 n.getPivotResultCol(a.colId) && r.push(a); 61906 Wo( 61907 s, 61908 { 61909 state: r, 61910 applyOrder: e 61911 }, 61912 "gridInitializing" 61913 ); 61914 } 61915 i && o?.setColumnGroupState(i, "gridInitializing"); 61916 } 61917 } 61918 getColumnGroupState() { 61919 const e = this.beans.colGroupSvc; 61920 if (!e) 61921 return; 61922 const t = e.getColumnGroupState(), i = []; 61923 return t.forEach(({ groupId: s, open: n }) => { 61924 n && i.push(s); 61925 }), i.length ? { openColumnGroupIds: i } : void 0; 61926 } 61927 setColumnGroupState(e) { 61928 const t = this.beans.colGroupSvc; 61929 if (!Object.prototype.hasOwnProperty.call(e, "columnGroup") || !t) 61930 return; 61931 const i = new Set(e.columnGroup?.openColumnGroupIds), n = t.getColumnGroupState().map(({ groupId: o }) => { 61932 const r = i.has(o); 61933 return r && i.delete(o), { 61934 groupId: o, 61935 open: r 61936 }; 61937 }); 61938 i.forEach((o) => { 61939 n.push({ 61940 groupId: o, 61941 open: !0 61942 }); 61943 }), n.length && (this.columnGroupStates = n), t.setColumnGroupState(n, "gridInitializing"); 61944 } 61945 getFilterState() { 61946 const e = this.beans.filterManager; 61947 let t = e?.getFilterModel(); 61948 t && Object.keys(t).length === 0 && (t = void 0); 61949 const i = e?.getAdvFilterModel() ?? void 0; 61950 return t || i ? { filterModel: t, advancedFilterModel: i } : void 0; 61951 } 61952 setFilterState(e) { 61953 const t = this.beans.filterManager, { filterModel: i, advancedFilterModel: s } = e ?? {}; 61954 i && t?.setFilterModel(i, "columnFilter"), s && t?.setAdvFilterModel(s); 61955 } 61956 getRangeSelectionState() { 61957 const e = this.beans.rangeSvc?.getCellRanges().map((t) => { 61958 const { id: i, type: s, startRow: n, endRow: o, columns: r, startColumn: a } = t; 61959 return { 61960 id: i, 61961 type: s, 61962 startRow: n, 61963 endRow: o, 61964 colIds: r.map((l) => l.getColId()), 61965 startColId: a.getColId() 61966 }; 61967 }); 61968 return e?.length ? { cellRanges: e } : void 0; 61969 } 61970 setCellSelectionState(e) { 61971 const { gos: t, rangeSvc: i, colModel: s, visibleCols: n } = this.beans; 61972 if (!pa(t) || !i) 61973 return; 61974 const o = [];
61975 e.cellRanges.forEach((r) => { 61976 const a = []; 61977 if (r.colIds.forEach((c) => { 61978 const u = s.getCol(c); 61979 u && a.push(u); 61980 }), !a.length) 61981 return; 61982 let l = s.getCol(r.startColId); 61983 if (!l) { 61984 const c = n.allCols, u = new Set(a); 61985 l = c.find((d) => u.has(d)); 61986 } 61987 o.push({ 61988 ...r, 61989 columns: a, 61990 startColumn: l 61991 }); 61992 }), i.setCellRanges(o); 61993 } 61994 getScrollState() { 61995 if (!this.isClientSideRowModel) 61996 return; 61997 const e = this.beans.ctrlsSvc.getScrollFeature(), { left: t } = e?.getHScrollPosition() ?? { left: 0 }, { top: i } = e?.getVScrollPosition() ?? { top: 0 }; 61998 return i || t ? { 61999 top: i, 62000 left: t 62001 } : void 0; 62002 } 62003 setScrollState(e) { 62004 if (!this.isClientSideRowModel) 62005 return; 62006 const { top: t, left: i } = e, { frameworkOverrides: s, rowRenderer: n, animationFrameSvc: o, ctrlsSvc: r } = this.beans; 62007 s.wrapIncoming(() => { 62008 r.get("center").setCenterViewportScrollLeft(i), r.getScrollFeature()?.setVerticalScrollPosition(t), n.redraw({ afterScroll: !0 }), o?.flushAllFrames(); 62009 }); 62010 } 62011 getSideBarState() { 62012 return this.beans.sideBar?.comp?.getState(); 62013 } 62014 getFocusedCellState() { 62015 if (!this.isClientSideRowModel) 62016 return; 62017 const e = this.beans.focusSvc.getFocusedCell(); 62018 if (e) { 62019 const { column: t, rowIndex: i, rowPinned: s } = e; 62020 return { 62021 colId: t.getColId(), 62022 rowIndex: i, 62023 rowPinned: s 62024 }; 62025 } 62026 } 62027 setFocusedCellState(e) { 62028 if (!this.isClientSideRowModel) 62029 return; 62030 const { colId: t, rowIndex: i, rowPinned: s } = e, { focusSvc: n, colModel: o } = this.beans; 62031 n.setFocusedCell({ 62032 column: o.getCol(t), 62033 rowIndex: i, 62034 rowPinned: s, 62035 forceBrowserFocus: !0, 62036 preventScrollOnBrowserFocus: !0 62037 }); 62038 } 62039 getPaginationState() { 62040 const { pagination: e, gos: t } = this.beans; 62041 if (!e) 62042 return; 62043 const i = e.getCurrentPage(), s = t.get("paginationAutoPageSize") ? void 0 : e.getPageSize(); 62044 if (!(!i && !s)) 62045 return { page: i, pageSize: s }; 62046 } 62047 setPaginationState(e) { 62048 const { pagination: t, gos: i } = this.beans; 62049 t && (e.pageSize && !i.get("paginationAutoPageSize") && t.setPageSize(e.pageSize, "initialState"), typeof e.page == "number" && t.setPage(e.page)); 62050 } 62051 getRowSelectionState() { 62052 const e = this.beans.selectionSvc; 62053 if (!e) 62054 return; 62055 const t = e.getSelectionState(); 62056 return !t || !Array.isArray(t) && (t.selectAll === !1 || t.selectAllChildren === !1) && !t?.toggledNodes?.length ? void 0 : t; 62057 } 62058 setRowSelectionState(e) { 62059 this.beans.selectionSvc?.setSelectionState(e, "gridInitializing"); 62060 } 62061 getRowGroupExpansionState() { 62062 const { expansionSvc: e, rowModel: t } = this.beans; 62063 if (!e) 62064 return; 62065 const i = []; 62066 return t.forEachNode(({ expanded: s, id: n }) => { 62067 s && n && i.push(n); 62068 }), i.length ? { 62069 expandedRowGroupIds: i 62070 } : void 0; 62071 } 62072 setRowGroupExpansionState(e) { 62073 this.beans.expansionSvc?.expandRows(e.expandedRowGroupIds); 62074 } 62075 updateColumnState(e) { 62076 const t = this.getColumnState(); 62077 let i = !1; 62078 const s = this.cachedState; 62079 Object.entries(t).forEach(([n, o]) => { 62080 Yp(o, s[n]) || (i = !0); 62081 }), this.cachedState = { 62082 ...s, 62083 ...t 62084 }, i && this.dispatchStateUpdateEvent(e); 62085 } 62086 updateCachedState(e, t) { 62087 const i = this.cachedState[e]; 62088 this.setCachedStateValue(e, t), Yp(t, i) || this.dispatchStateUpdateEvent([e]); 62089 } 62090 setCachedStateValue(e, t) { 62091 this.cachedState = { 62092 ...this.cachedState, 62093 [e]: t 62094 }; 62095 } 62096 refreshStaleState() { 62097 const e = this.staleStateKeys; 62098 e.forEach((t) => { 62099 t === "rowSelection" && this.setCachedStateValue(t, this.getRowSelectionState()); 62100 }), e.clear(); 62101 } 62102 dispatchStateUpdateEvent(e) { 62103 this.suppressEvents || (e.forEach((t) => this.queuedUpdateSources.add(t)), this.dispatchStateUpdateEventDebounced()); 62104 } 62105 dispatchQueuedStateUpdateEvents() { 62106 const e = this.queuedUpdateSources, t = Array.from(e); 62107 e.clear(), this.eventSvc.dispatchEvent({ 62108 type: "stateUpdated", 62109 sources: t, 62110 state: this.cachedState 62111 }); 62112 } 62113 suppressEventsAndDispatchInitEvent(e) { 62114 this.suppressEvents = !0; 62115 const t = this.beans.colAnimation; 62116 t?.setSuppressAnimation(!0), e(), setTimeout(() => { 62117 this.suppressEvents = !1, this.queuedUpdateSources.clear(), this.isAlive() && (t?.setSuppressAnimation(!1), this.dispatchStateUpdateEvent(["gridInitializing"])); 62118 }); 62119 } 62120}, Kce = { 62121 moduleName: "GridState", 62122 version: Fe, 62123 beans: [Yce],
62124 apiFunctions: { 62125 getState: Uce 62126 } 62127}; 62128function Zce(e) { 62129 return e.rowModel.isLastRowIndexKnown(); 62130} 62131function qce(e) { 62132 return e.pagination?.getPageSize() ?? 100; 62133} 62134function Qce(e) { 62135 return e.pagination?.getCurrentPage() ?? 0; 62136} 62137function Xce(e) { 62138 return e.pagination?.getTotalPages() ?? 1; 62139} 62140function Jce(e) { 62141 return e.pagination ? e.pagination.getMasterRowCount() : e.rowModel.getRowCount(); 62142} 62143function eue(e) { 62144 e.pagination?.goToNextPage(); 62145} 62146function tue(e) { 62147 e.pagination?.goToPreviousPage(); 62148} 62149function iue(e) { 62150 e.pagination?.goToFirstPage(); 62151} 62152function sue(e) { 62153 e.pagination?.goToLastPage(); 62154} 62155function nue(e, t) { 62156 e.pagination?.goToPage(t); 62157} 62158var oue = class extends he { 62159 constructor() { 62160 super(...arguments), this.beanName = "paginationAutoPageSizeSvc"; 62161 } 62162 postConstruct() { 62163 this.beans.ctrlsSvc.whenReady(this, (e) => { 62164 this.centerRowsCtrl = e.center; 62165 const t = this.checkPageSize.bind(this); 62166 this.addManagedEventListeners({ 62167 bodyHeightChanged: t, 62168 scrollVisibilityChanged: t 62169 }), this.addManagedPropertyListener("paginationAutoPageSize", this.onPaginationAutoSizeChanged.bind(this)), this.checkPageSize(); 62170 }); 62171 } 62172 notActive() { 62173 return !this.gos.get("paginationAutoPageSize") || this.centerRowsCtrl == null; 62174 } 62175 onPaginationAutoSizeChanged() { 62176 this.notActive() ? this.beans.pagination.unsetAutoCalculatedPageSize() : this.checkPageSize(); 62177 } 62178 checkPageSize() { 62179 if (this.notActive()) 62180 return; 62181 const e = this.centerRowsCtrl.viewportSizeFeature.getBodyHeight(); 62182 if (e > 0) { 62183 const t = this.beans, i = () => { 62184 const s = Math.max(Ec(t), 1), n = Math.floor(e / s); 62185 t.pagination.setPageSize(n, "autoCalculated"); 62186 }; 62187 this.isBodyRendered ? qs(this, i, 50)() : (i(), this.isBodyRendered = !0); 62188 } else 62189 this.isBodyRendered = !1; 62190 } 62191}, Lh = "paginationPageSizeSelector", rue = class extends Tt { 62192 constructor() { 62193 super( 62194 /* html */ 62195 '<span class="ag-paging-page-size"></span>' 62196 ), this.hasEmptyOption = !1, this.handlePageSizeItemSelected = () => { 62197 if (!this.selectPageSizeComp) 62198 return; 62199 const e = this.selectPageSizeComp.getValue(); 62200 if (!e) 62201 return; 62202 const t = Number(e); 62203 isNaN(t) || t < 1 || t === this.pagination.getPageSize() || (this.pagination.setPageSize(t, "pageSizeSelector"), this.hasEmptyOption && this.toggleSelectDisplay(!0), this.selectPageSizeComp.getFocusableElement().focus()); 62204 }; 62205 } 62206 wireBeans(e) { 62207 this.pagination = e.pagination; 62208 } 62209 postConstruct() { 62210 this.addManagedPropertyListener(Lh, () => { 62211 this.onPageSizeSelectorValuesChange(); 62212 }), this.addManagedEventListeners({ paginationChanged: (e) => this.handlePaginationChanged(e) }); 62213 } 62214 handlePaginationChanged(e) { 62215 if (!this.selectPageSizeComp || !e?.newPageSize) 62216 return; 62217 const t = this.pagination.getPageSize(); 62218 this.getPageSizeSelectorValues().includes(t) ? this.selectPageSizeComp.setValue(t.toString()) : this.hasEmptyOption ? this.selectPageSizeComp.setValue("") : this.toggleSelectDisplay(!0); 62219 } 62220 toggleSelectDisplay(e) { 62221 this.selectPageSizeComp && !e && this.reset(), e && (this.reloadPageSizesSelector(), this.selectPageSizeComp); 62222 } 62223 reset() { 62224 Is(this.getGui()), this.selectPageSizeComp && (this.selectPageSizeComp = this.destroyBean(this.selectPageSizeComp)); 62225 } 62226 onPageSizeSelectorValuesChange() { 62227 this.selectPageSizeComp && this.shouldShowPageSizeSelector() && this.reloadPageSizesSelector(); 62228 } 62229 shouldShowPageSizeSelector() { 62230 return this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel") && !this.gos.get("paginationAutoPageSize") && this.gos.get(Lh) !== !1; 62231 } 62232 reloadPageSizesSelector() { 62233 const e = this.getPageSizeSelectorValues(), t = this.pagination.getPageSize(), i = !t || !e.includes(t); 62234 if (i) { 62235 const n = this.gos.exists("paginationPageSize"), o = this.gos.get(Lh) !== !0; 62236 Ae(94, { pageSizeSet: n, pageSizesSet: o, pageSizeOptions: e, paginationPageSizeOption: t }), o || Ae(95, { paginationPageSizeOption: t, paginationPageSizeSelector: Lh }), e.unshift(""); 62237 } 62238 const s = String(i ? "" : t); 62239 this.selectPageSizeComp ? (tu(this.pageSizeOptions, e) || (this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)), this.pageSizeOptions = e), this.selectPageSizeComp.setValue(s, !0)) : this.createPageSizeSelectorComp(e, s), this.hasEmptyOption = i; 62240 } 62241 createPageSizeSelectOptions(e) { 62242 return e.map((t) => ({ 62243 value: String(t) 62244 })); 62245 } 62246 createPageSizeSelectorComp(e, t) { 62247 const i = this.getLocaleTextFunc(), s = i("pageSizeSelectorLabel", "Page Size:"), n = i("ariaPageSizeSelectorLabel", "Page Size"); 62248 this.selectPageSizeComp = this.createManagedBean(new xM()).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(n).setLabel(s).onValueChange(() => this.handlePageSizeItemSelected()), this.appendChild(this.selectPageSizeComp); 62249 } 62250 getPageSizeSelectorValues() { 62251 const e = [20, 50, 100], t = this.gos.get(Lh); 62252 return !Array.isArray(t) || !t?.length ? e : [...t].sort((i, s) => i - s); 62253 } 62254 destroy() { 62255 this.toggleSelectDisplay(!1), super.destroy(); 62256 } 62257}, aue = { 62258 selector: "AG-PAGE-SIZE-SELECTOR", 62259 component: rue 62260}, lue = ( 62261 /*css*/ 62262 ".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:max(var(--ag-row-height),22px);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}
62262.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}" 62263), cue = class extends NN { 62264 constructor() { 62265 super(), this.btFirst = Pe, this.btPrevious = Pe, this.btNext = Pe, this.btLast = Pe, this.lbRecordCount = Pe, this.lbFirstRowOnPage = Pe, this.lbLastRowOnPage = Pe, this.lbCurrent = Pe, this.lbTotal = Pe, this.pageSizeComp = Pe, this.previousAndFirstButtonsDisabled = !1, this.nextButtonDisabled = !1, this.lastButtonDisabled = !1, this.areListenersSetup = !1, this.allowFocusInnerElement = !1, this.registerCSS(lue); 62266 } 62267 wireBeans(e) { 62268 this.rowModel = e.rowModel, this.pagination = e.pagination, this.ariaAnnounce = e.ariaAnnounce; 62269 } 62270 postConstruct() { 62271 const e = this.gos.get("enableRtl"); 62272 this.setTemplate(this.getTemplate(), [aue]); 62273 const { btFirst: t, btPrevious: i, btNext: s, btLast: n } = this; 62274 this.activateTabIndex([t, i, s, n]), t.insertAdjacentElement("afterbegin", po(e ? "last" : "first", this.beans)), i.insertAdjacentElement("afterbegin", po(e ? "next" : "previous", this.beans)), s.insertAdjacentElement("afterbegin", po(e ? "previous" : "next", this.beans)), n.insertAdjacentElement("afterbegin", po(e ? "first" : "last", this.beans)), this.addManagedPropertyListener("pagination", this.onPaginationChanged.bind(this)), this.addManagedPropertyListener("suppressPaginationPanel", this.onPaginationChanged.bind(this)), this.addManagedPropertyListeners( 62275 ["paginationPageSizeSelector", "paginationAutoPageSize", "suppressPaginationPanel"], 62276 () => this.onPageSizeRelatedOptionsChange() 62277 ), this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()), this.initialiseTabGuard({ 62278 // prevent tab guard default logic 62279 onTabKeyDown: () => { 62280 }, 62281 focusInnerElement: (o) => { 62282 this.allowFocusInnerElement ? this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(o) : YJ(this.beans, o); 62283 }, 62284 forceFocusOutWhenTabGuardsAreEmpty: !0 62285 }), this.onPaginationChanged(); 62286 } 62287 setAllowFocus(e) { 62288 this.allowFocusInnerElement = e; 62289 } 62290 onPaginationChanged() { 62291 const t = this.gos.get("pagination") && !this.gos.get("suppressPaginationPanel"); 62292 this.setDisplayed(t), t && (this.setupListeners(), this.enableOrDisableButtons(), this.updateLabels(), this.onPageSizeRelatedOptionsChange()); 62293 } 62294 onPageSizeRelatedOptionsChange() { 62295 this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()); 62296 } 62297 setupListeners() { 62298 this.areListenersSetup || (this.addManagedEventListeners({ paginationChanged: this.onPaginationChanged.bind(this) }), [ 62299 { el: this.btFirst, fn: this.onBtFirst.bind(this) }, 62300 { el: this.btPrevious, fn: this.onBtPrevious.bind(this) }, 62301 { el: this.btNext, fn: this.onBtNext.bind(this) }, 62302 { el: this.btLast, fn: this.onBtLast.bind(this) } 62303 ].forEach((e) => { 62304 const { el: t, fn: i } = e; 62305 this.addManagedListeners(t, { 62306 click: i, 62307 keydown: (s) => { 62308 (s.key === de.ENTER || s.key === de.SPACE) && (s.preventDefault(), i()); 62309 } 62310 }); 62311 }), $J(this.beans, this, this.getGui()), this.areListenersSetup = !0); 62312 } 62313 onBtFirst() { 62314 this.previousAndFirstButtonsDisabled || this.pagination.goToFirstPage(); 62315 } 62316 formatNumber(e) { 62317 const t = this.gos.getCallback("paginationNumberFormatter"); 62318 return t ? t({ value: e }) : xre(e, this.getLocaleTextFunc.bind(this)); 62319 } 62320 getTemplate() { 62321 const e = this.getLocaleTextFunc(), t = e("page", "Page"), i = e("to", "to"), s = e("of", "of"), n = e("firstPage", "First Page"), o = e("previousPage", "Previous Page"), r = e("nextPage", "Next Page"), a = e("lastPage", "Last Page"), l = this.getCompId(); 62322 return ( 62323 /* html */ 62324 `<div class="ag-paging-panel ag-unselectable" id="ag-${l}"> 62325 <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector> 62326 <span class="ag-paging-row-summary-panel"> 62327 <span id="ag-${l}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
62328 <span id="ag-${l}-to">${i}</span> 62329 <span id="ag-${l}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span> 62330 <span id="ag-${l}-of">${s}</span> 62331 <span id="ag-${l}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span> 62332 </span> 62333 <span class="ag-paging-page-summary-panel" role="presentation"> 62334 <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div> 62335 <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div> 62336 <span class="ag-paging-description"> 62337 <span id="ag-${l}-start-page">${t}</span> 62338 <span id="ag-${l}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span> 62339 <span id="ag-${l}-of-page">${s}</span> 62340 <span id="ag-${l}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span> 62341 </span> 62342 <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div> 62343 <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div> 62344 </span> 62345 </div>` 62346 ); 62347 } 62348 onBtNext() { 62349 this.nextButtonDisabled || this.pagination.goToNextPage(); 62350 } 62351 onBtPrevious() { 62352 this.previousAndFirstButtonsDisabled || this.pagination.goToPreviousPage(); 62353 } 62354 onBtLast() { 62355 this.lastButtonDisabled || this.pagination.goToLastPage(); 62356 } 62357 enableOrDisableButtons() { 62358 const e = this.pagination.getCurrentPage(), t = this.rowModel.isLastRowIndexKnown(), i = this.pagination.getTotalPages(); 62359 this.previousAndFirstButtonsDisabled = e === 0, this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled), this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled); 62360 const s = this.isZeroPagesToDisplay(), n = e === i - 1; 62361 this.nextButtonDisabled = n || s, this.lastButtonDisabled = !t || s || e === i - 1, this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled), this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled); 62362 } 62363 toggleButtonDisabled(e, t) { 62364 MQ(e, t), e.classList.toggle("ag-disabled", t); 62365 } 62366 isZeroPagesToDisplay() { 62367 const e = this.rowModel.isLastRowIndexKnown(), t = this.pagination.getTotalPages(); 62368 return e && t === 0; 62369 } 62370 updateLabels() { 62371 const e = this.rowModel.isLastRowIndexKnown(), t = this.pagination.getTotalPages(), i = this.pagination.getMasterRowCount(), s = e ? i : null; 62372 if (s === 1) { 62373 const w = this.rowModel.getRow(0); 62374 if (w && w.group && !(w.groupData || w.aggData)) { 62375 this.setTotalLabelsToZero(); 62376 return; 62377 } 62378 } 62379 const n = this.pagination.getCurrentPage(), o = this.pagination.getPageSize(); 62380 let r, a; 62381 this.isZeroPagesToDisplay() ? r = a = 0 : (r = o * n + 1, a = r + o - 1, e && a > s && (a = s)); 62382 const l = r + o - 1, c = !e && i < l, u = this.formatNumber(r); 62383 this.lbFirstRowOnPage.textContent = u; 62384 let d; 62385 const p = this.getLocaleTextFunc(); 62386 c ? d = p("pageLastRowUnknown", "?") : d = this.formatNumber(a), this.lbLastRowOnPage.textContent = d; 62387 const m = t > 0 ? n + 1 : 0, y = this.formatNumber(m); 62388 this.lbCurrent.textContent = y; 62389 let b, C; 62390 if (e) 62391 b = this.formatNumber(t), C = this.formatNumber(s); 62392 else { 62393 const w = p("more", "more"); 62394 b = w, C = w; 62395 } 62396 this.lbTotal.textContent = b, this.lbRecordCount.textContent = C, this.announceAriaStatus(u, d, C, y, b); 62397 } 62398 announceAriaStatus(e, t, i, s, n) { 62399 const o = this.getLocaleTextFunc(), r = o("page", "Page"), a = o("to", "to"), l = o("of", "of"), c = `${e} ${a} ${t} ${l} ${i}`, u = `${r} ${s} ${l} ${n}`; 62400 c !== this.ariaRowStatus && (this.ariaRowStatus = c, this.ariaAnnounce?.announceValue(c, "paginationRow")), u !== this.ariaPageStatus && (this.ariaPageStatus = u, this.ariaAnnounce?.announceValue(u, "paginationPage")); 62401 } 62402 setTotalLabelsToZero() { 62403 const e = this.formatNumber(0); 62404 this.lbFirstRowOnPage.textContent = e, this.lbCurrent.textContent = e, this.lbLastRowOnPage.textContent = e, this.lbTotal.textContent = e, this.lbRecordCount.textContent = e, this.announceAriaStatus(e, e, e, e, e); 62405 } 62406}, uue = { 62407 selector: "AG-PAGINATION", 62408 component: cue 62409}, due = class extends he {
62410 constructor() { 62411 super(...arguments), this.beanName = "pagination", this.currentPage = 0, this.topDisplayedRowIndex = 0, this.bottomDisplayedRowIndex = 0, this.masterRowCount = 0; 62412 } 62413 postConstruct() { 62414 const e = this.gos; 62415 this.active = e.get("pagination"), this.pageSizeFromGridOptions = e.get("paginationPageSize"), this.paginateChildRows = this.isPaginateChildRows(), this.addManagedPropertyListener("pagination", this.onPaginationGridOptionChanged.bind(this)), this.addManagedPropertyListener("paginationPageSize", this.onPageSizeGridOptionChanged.bind(this)); 62416 } 62417 getPaginationSelector() { 62418 return uue; 62419 } 62420 isPaginateChildRows() { 62421 const e = this.gos; 62422 return e.get("groupHideParentOfSingleChild") || // following two properties deprecated v32.3.0 62423 e.get("groupRemoveSingleChildren") || e.get("groupRemoveLowestSingleChildren") ? !0 : e.get("paginateChildRows"); 62424 } 62425 onPaginationGridOptionChanged() { 62426 this.active = this.gos.get("pagination"), this.calculatePages(), this.dispatchPaginationChangedEvent({ keepRenderedRows: !0 }); 62427 } 62428 onPageSizeGridOptionChanged() { 62429 this.setPageSize(this.gos.get("paginationPageSize"), "gridOptions"); 62430 } 62431 goToPage(e) { 62432 const t = this.currentPage; 62433 !this.active || t === e || typeof t != "number" || (this.currentPage = e, this.calculatePages(), this.dispatchPaginationChangedEvent({ newPage: !0 })); 62434 } 62435 isRowPresent(e) { 62436 return e.rowIndex >= this.topDisplayedRowIndex && e.rowIndex <= this.bottomDisplayedRowIndex; 62437 } 62438 getPageForIndex(e) { 62439 return Math.floor(e / this.pageSize); 62440 } 62441 goToPageWithIndex(e) { 62442 if (!this.active) 62443 return; 62444 const t = this.getPageForIndex(e); 62445 this.goToPage(t); 62446 } 62447 isRowInPage(e) { 62448 return this.active ? this.getPageForIndex(e.rowIndex) === this.currentPage : !0; 62449 } 62450 getCurrentPage() { 62451 return this.currentPage; 62452 } 62453 goToNextPage() { 62454 this.goToPage(this.currentPage + 1); 62455 } 62456 goToPreviousPage() { 62457 this.goToPage(this.currentPage - 1); 62458 } 62459 goToFirstPage() { 62460 this.goToPage(0); 62461 } 62462 goToLastPage() { 62463 const e = this.beans.rowModel.getRowCount(), t = Math.floor(e / this.pageSize); 62464 this.goToPage(t); 62465 } 62466 getPageSize() { 62467 return this.pageSize; 62468 } 62469 getTotalPages() { 62470 return this.totalPages; 62471 } 62472 /** This is only for state setting before data has been loaded */ 62473 setPage(e) { 62474 this.currentPage = e; 62475 } 62476 get pageSize() { 62477 return Ie(this.pageSizeAutoCalculated) && this.gos.get("paginationAutoPageSize") ? this.pageSizeAutoCalculated : Ie(this.pageSizeFromPageSizeSelector) ? this.pageSizeFromPageSizeSelector : Ie(this.pageSizeFromInitialState) ? this.pageSizeFromInitialState : Ie(this.pageSizeFromGridOptions) ? this.pageSizeFromGridOptions : this.defaultPageSize; 62478 } 62479 calculatePages() { 62480 this.active ? this.paginateChildRows ? this.calculatePagesAllRows() : this.calculatePagesMasterRowsOnly() : this.calculatedPagesNotActive(), this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex, this.bottomDisplayedRowIndex); 62481 } 62482 unsetAutoCalculatedPageSize() { 62483 if (this.pageSizeAutoCalculated === void 0) 62484 return; 62485 const e = this.pageSizeAutoCalculated; 62486 this.pageSizeAutoCalculated = void 0, this.pageSize !== e && (this.calculatePages(), this.dispatchPaginationChangedEvent({ newPageSize: !0 })); 62487 } 62488 setPageSize(e, t) { 62489 const i = this.pageSize; 62490 switch (t) { 62491 case "autoCalculated": 62492 this.pageSizeAutoCalculated = e; 62493 break; 62494 case "pageSizeSelector": 62495 this.pageSizeFromPageSizeSelector = e, this.currentPage !== 0 && this.goToFirstPage(); 62496 break; 62497 case "initialState": 62498 this.pageSizeFromInitialState = e; 62499 break; 62500 case "gridOptions": 62501 this.pageSizeFromGridOptions = e, this.pageSizeFromInitialState = void 0, this.pageSizeFromPageSizeSelector = void 0, this.currentPage !== 0 && this.goToFirstPage(); 62502 break; 62503 } 62504 i !== this.pageSize && (this.calculatePages(), this.dispatchPaginationChangedEvent({ newPageSize: !0, keepRenderedRows: !0 })); 62505 } 62506 setZeroRows() { 62507 this.masterRowCount = 0, this.topDisplayedRowIndex = 0, this.bottomDis
62507playedRowIndex = -1, this.currentPage = 0, this.totalPages = 0; 62508 } 62509 adjustCurrentPageIfInvalid() { 62510 const e = this.totalPages; 62511 this.currentPage >= e && (this.currentPage = e - 1); 62512 const t = this.currentPage; 62513 (!isFinite(t) || isNaN(t) || t < 0) && (this.currentPage = 0); 62514 } 62515 calculatePagesMasterRowsOnly() { 62516 const e = this.beans.rowModel, t = e.getTopLevelRowCount(); 62517 if (this.masterRowCount = t, t <= 0) { 62518 this.setZeroRows(); 62519 return; 62520 } 62521 const i = this.pageSize, s = t - 1; 62522 this.totalPages = Math.floor(s / i) + 1, this.adjustCurrentPageIfInvalid(); 62523 const n = this.currentPage, o = i * n; 62524 let r = i * (n + 1) - 1; 62525 if (r > s && (r = s), this.topDisplayedRowIndex = e.getTopLevelRowDisplayedIndex(o), r === s) 62526 this.bottomDisplayedRowIndex = e.getRowCount() - 1; 62527 else { 62528 const a = e.getTopLevelRowDisplayedIndex(r + 1); 62529 this.bottomDisplayedRowIndex = a - 1; 62530 } 62531 } 62532 getMasterRowCount() { 62533 return this.masterRowCount; 62534 } 62535 calculatePagesAllRows() { 62536 const e = this.beans.rowModel.getRowCount(); 62537 if (this.masterRowCount = e, e === 0) { 62538 this.setZeroRows(); 62539 return; 62540 } 62541 const { pageSize: t, currentPage: i } = this, s = e - 1; 62542 this.totalPages = Math.floor(s / t) + 1, this.adjustCurrentPageIfInvalid(), this.topDisplayedRowIndex = t * i, this.bottomDisplayedRowIndex = t * (i + 1) - 1, this.bottomDisplayedRowIndex > s && (this.bottomDisplayedRowIndex = s); 62543 } 62544 calculatedPagesNotActive() { 62545 this.setPageSize(void 0, "autoCalculated"), this.totalPages = 1, this.currentPage = 0, this.topDisplayedRowIndex = 0, this.bottomDisplayedRowIndex = this.beans.rowModel.getRowCount() - 1; 62546 } 62547 dispatchPaginationChangedEvent(e) { 62548 const { keepRenderedRows: t = !1, newPage: i = !1, newPageSize: s = !1 } = e; 62549 this.eventSvc.dispatchEvent({ 62550 type: "paginationChanged", 62551 animate: !1, 62552 newData: !1, 62553 newPage: i, 62554 newPageSize: s, 62555 keepRenderedRows: t 62556 }); 62557 } 62558}, hue = { 62559 moduleName: "Pagination", 62560 version: Fe, 62561 beans: [due, oue], 62562 icons: { 62563 // "go to first" button in pagination controls 62564 first: "first", 62565 // "go to previous" button in pagination controls 62566 previous: "previous", 62567 // "go to next" button in pagination controls 62568 next: "next", 62569 // "go to last" button in pagination controls 62570 last: "last" 62571 }, 62572 apiFunctions: { 62573 paginationIsLastPageFound: Zce, 62574 paginationGetPageSize: qce, 62575 paginationGetCurrentPage: Qce, 62576 paginationGetTotalPages: Xce, 62577 paginationGetRowCount: Jce, 62578 paginationGoToNextPage: eue, 62579 paginationGoToPreviousPage: tue, 62580 paginationGoToFirstPage: iue, 62581 paginationGoToLastPage: sue, 62582 paginationGoToPage: nue 62583 }, 62584 dependsOn: [Xy] 62585}; 62586function pue(e, t = {}) { 62587 const i = t ? t.rowNodes : void 0; 62588 e.frameworkOverrides.wrapIncoming(() => e.rowRenderer.redrawRows(i)); 62589} 62590function P_(e, t, i, s, n) { 62591 t && (s && t.parent && t.parent.level !== -1 && P_(e, t.parent, i, s, n), t.setExpanded(i, void 0, n)); 62592} 62593function gue(e, t) { 62594 return e.rowModel.getRowNode(t); 62595} 62596function fue(e, t, i, s) { 62597 e.rowRenderer.addRenderedRowListener(t, i, s); 62598} 62599function mue(e) { 62600 return e.rowRenderer.getRenderedNodes(); 62601} 62602function vue(e, t, i) { 62603 e.rowModel.forEachNode(t, i); 62604} 62605function yue(e) { 62606 return e.rowRenderer.firstRenderedRow; 62607} 62608function Cue(e) { 62609 return e.rowRenderer.lastRenderedRow; 62610} 62611function bue(e, t) { 62612 return e.rowModel.getRow(t); 62613} 62614function wue(e) { 62615 return e.rowModel.getRowCount(); 62616} 62617var F_ = { 62618 moduleName: "RowApi", 62619 version: Fe, 62620 apiFunctions: { 62621 redrawRows: pue, 62622 setRowNodeExpanded: P_, 62623 getRowNode: gue, 62624 addRenderedRowListener: fue, 62625 getRenderedNodes: mue, 62626 forEachNode: vue, 62627 getFirstDisplayedRowIndex: yue, 62628 getLastDisplayedRowIndex: Cue, 62629 getDisplayedRowAtIndex: bue, 62630 getDisplayedRowCount: wue 62631 } 62632}, Sue = { 62633 moduleName: "ScrollApi", 62634 version: Fe, 62635 apiFunctions: { 62636 getVerticalPixelRange: lle, 62637 getHorizontalPixelRange: cle, 62638 ensureColumnVisible: T_, 62639 ensureIndexVisible: L_, 62640 ensureNodeVisible: ule 62641 } 62642}; 62643function xue(e, t, i) { 62644 if (!t) 62645 return; 62646 const s = e.ctrlsSvc.getGridBodyCtrl().eGridBody, n = `aria-${t}`; 62647 i === null ? s.removeAttribute(n) : s.setAttribute(n, i); 62648} 62649function Mue(e, t = {}) { 62650 e.frameworkOverrides.wrapIncoming(() => e.rowRenderer.refreshCells(t)); 62651} 62652function Aue(e) { 62653 e.frameworkOverrides.wrapIncoming( 62654 () =>
62654 e.ctrlsSvc.getHeaderRowContainerCtrls().forEach((t) => t.refresh()) 62655 ); 62656} 62657function Due(e) { 62658 return e.animationFrameSvc?.isQueueEmpty() ?? !0; 62659} 62660function Eue(e) { 62661 e.animationFrameSvc?.flushAllFrames(); 62662} 62663function Iue(e) { 62664 return { 62665 rowHeight: Ec(e), 62666 headerHeight: Eg(e) 62667 }; 62668} 62669function Rue(e, t = {}) { 62670 const i = []; 62671 if (e.rowRenderer.getCellCtrls(t.rowNodes, t.columns).forEach((o) => { 62672 const r = o.getCellRenderer(); 62673 r != null && i.push(Qp(r)); 62674 }), t.columns?.length) 62675 return i; 62676 const s = [], n = lS(t.rowNodes); 62677 return e.rowRenderer.getAllRowCtrls().forEach((o) => { 62678 if (n && !cS(o.rowNode, n) || !o.isFullWidth()) 62679 return; 62680 const r = o.getFullWidthCellRenderers(); 62681 for (let a = 0; a < r.length; a++) { 62682 const l = r[a]; 62683 l != null && s.push(Qp(l)); 62684 } 62685 }), [...s, ...i]; 62686} 62687var Tue = { 62688 moduleName: "RenderApi", 62689 version: Fe, 62690 apiFunctions: { 62691 setGridAriaProperty: xue, 62692 refreshCells: Mue, 62693 refreshHeader: Aue, 62694 isAnimationFrameQueueEmpty: Due, 62695 flushAllAnimationFrames: Eue, 62696 getSizesForCurrentTheme: Iue, 62697 getCellRendererInstances: Rue 62698 } 62699}; 62700function Lue(e, t) { 62701 typeof t == "number" ? e.colAutosize?.sizeColumnsToFit(t, "api") : e.colAutosize?.sizeColumnsToFitGridBody(t); 62702} 62703function kue(e, t, i) { 62704 e.colAutosize?.autoSizeCols({ colKeys: t, skipHeader: i, source: "api" }); 62705} 62706function Pue(e, t) { 62707 e.colAutosize?.autoSizeAllColumns("api", t); 62708} 62709var Fue = class extends he { 62710 constructor() { 62711 super(...arguments), this.beanName = "colAutosize", this.timesDelayed = 0, this.shouldQueueResizeOperations = !1, this.resizeOperationQueue = []; 62712 } 62713 postConstruct() { 62714 this.addManagedEventListeners({ firstDataRendered: () => this.onFirstDataRendered() }); 62715 } 62716 autoSizeCols(e) { 62717 if (this.shouldQueueResizeOperations) { 62718 this.pushResizeOperation(() => this.autoSizeCols(e)); 62719 return; 62720 } 62721 const { colKeys: t, skipHeader: i, skipHeaderGroups: s, stopAtGroup: n, source: o = "api" } = e, { animationFrameSvc: r, renderStatus: a, colModel: l, autoWidthCalc: c, visibleCols: u } = this.beans; 62722 if (r?.flushAllFrames(), this.timesDelayed < 5 && a && !a.areHeaderCellsRendered()) { 62723 this.timesDelayed++, setTimeout(() => { 62724 this.isAlive() && this.autoSizeCols(e); 62725 }); 62726 return; 62727 } 62728 this.timesDelayed = 0; 62729 const d = []; 62730 let p = -1; 62731 const f = i ?? this.gos.get("skipHeaderOnAutoSize"), m = s ?? f; 62732 for (; p !== 0; ) { 62733 p = 0; 62734 const y = []; 62735 t.forEach((b) => { 62736 if (!b) 62737 return; 62738 const C = l.getCol(b); 62739 if (!C || d.indexOf(C) >= 0) 62740 return; 62741 const w = c.getPreferredWidthForColumn(C, f); 62742 if (w > 0) { 62743 const M = Oue(C, w); 62744 C.setActualWidth(M, o), d.push(C), p++; 62745 } 62746 y.push(C); 62747 }), y.length && u.refresh(o); 62748 } 62749 m || this.autoSizeColumnGroupsByColumns(t, o, n), Ed(this.eventSvc, d, !0, "autosizeColumns"); 62750 } 62751 autoSizeColumn(e, t, i) { 62752 e && this.autoSizeCols({ colKeys: [e], skipHeader: i, skipHeaderGroups: !0, source: t }); 62753 } 62754 autoSizeColumnGroupsByColumns(e, t, i) { 62755 const { colModel: s, ctrlsSvc: n } = this.beans, o = /* @__PURE__ */ new Set(); 62756 s.getColsForKeys(e).forEach((c) => { 62757 let u = c.getParent(); 62758 for (; u && u != i; ) 62759 u.isPadding() || o.add(u), u = u.getParent(); 62760 }); 62761 let a; 62762 const l = []; 62763 for (const c of o) { 62764 for (const u of n.getHeaderRowContainerCtrls()) 62765 if (a = u.getHeaderCtrlForColumn(c), a) 62766 break; 62767 a && a.resizeLeafColumnsToFit(t); 62768 } 62769 return l; 62770 } 62771 autoSizeAllColumns(e, t) { 62772 if (this.shouldQueueResizeOperations) { 62773 this.pushResizeOperation(() => this.autoSizeAllColumns(e, t)); 62774 return; 62775 } 62776 const i = this.beans.visibleCols.allCols; 62777 this.autoSizeCols({ colKeys: i, skipHeader: t, source: e }); 62778 } 62779 addColumnAutosize(e, t) { 62780 const i = this.gos.get("skipHeaderOnAutoSize"), s = () => { 62781 this.autoSizeColumn(t, "uiColumnResized", i); 62782 }; 62783 e.addEventListener("dblclick", s); 62784 const n = new Bu(e); 62785 return n.addEventListener("doubleTap", s), () => { 62786 e.removeEventListener("dblclick", s), n.removeEventListener("doubleTap", s), n.destroy(); 62787 }; 62788 } 62789 addColumnGroupResize(e, t, i) { 62790 const s = this.gos.get("skipHeaderOnAutoSize"), n = () => { 62791 const o = [];
62792 t.getDisplayedLeafColumns().forEach((a) => { 62793 a.getColDef().suppressAutoSize || o.push(a.getColId()); 62794 }), o.length > 0 && this.autoSizeCols({ 62795 colKeys: o, 62796 skipHeader: s, 62797 stopAtGroup: t, 62798 source: "uiColumnResized" 62799 }), i(); 62800 }; 62801 return e.addEventListener("dblclick", n), () => e.removeEventListener("dblclick", n); 62802 } 62803 // method will call itself if no available width. this covers if the grid 62804 // isn't visible, but is just about to be visible. 62805 sizeColumnsToFitGridBody(e, t) { 62806 if (!this.isAlive()) 62807 return; 62808 const { ctrlsSvc: i, scrollVisibleSvc: s } = this.beans, n = i.getGridBodyCtrl(), r = n.isVerticalScrollShowing() ? s.getScrollbarWidth() : 0, l = jp(n.eGridBody) - r; 62809 if (l > 0) { 62810 this.sizeColumnsToFit(l, "sizeColumnsToFit", !1, e); 62811 return; 62812 } 62813 t === void 0 ? window.setTimeout(() => { 62814 this.sizeColumnsToFitGridBody(e, 100); 62815 }, 0) : t === 100 ? window.setTimeout(() => { 62816 this.sizeColumnsToFitGridBody(e, 500); 62817 }, 100) : t === 500 ? window.setTimeout(() => { 62818 this.sizeColumnsToFitGridBody(e, -1); 62819 }, 500) : Ae(29); 62820 } 62821 // called from api 62822 sizeColumnsToFit(e, t = "sizeColumnsToFit", i, s) { 62823 if (this.shouldQueueResizeOperations) { 62824 this.pushResizeOperation(() => this.sizeColumnsToFit(e, t, i, s)); 62825 return; 62826 } 62827 const n = {}; 62828 s && s?.columnLimits?.forEach(({ key: f, ...m }) => { 62829 n[typeof f == "string" ? f : f.getColId()] = m; 62830 }); 62831 const o = this.beans.visibleCols.allCols, r = e === Kr(o); 62832 if (e <= 0 || !o.length || r) 62833 return; 62834 const a = [], l = []; 62835 o.forEach((f) => { 62836 f.getColDef().suppressSizeToFit === !0 ? l.push(f) : a.push(f); 62837 }); 62838 const c = a.slice(0); 62839 let u = !1; 62840 const d = (f) => { 62841 Ko(a, f), l.push(f); 62842 }; 62843 for (a.forEach((f) => { 62844 f.resetActualWidth(t); 62845 const m = n?.[f.getId()], y = m?.minWidth ?? s?.defaultMinWidth, b = m?.maxWidth ?? s?.defaultMaxWidth, C = f.getActualWidth(); 62846 typeof y == "number" && C < y ? f.setActualWidth(y, t, !0) : typeof b == "number" && C > b && f.setActualWidth(b, t, !0); 62847 }); !u; ) { 62848 u = !0; 62849 const f = e - Kr(l); 62850 if (f <= 0) 62851 a.forEach((m) => { 62852 const y = n?.[m.getId()]?.minWidth ?? s?.defaultMinWidth; 62853 if (typeof y == "number") { 62854 m.setActualWidth(y, t, !0); 62855 return; 62856 } 62857 m.setActualWidth(m.minWidth, t); 62858 }); 62859 else { 62860 const m = f / Kr(a); 62861 let y = f; 62862 for (let b = a.length - 1; b >= 0; b--) { 62863 const C = a[b], w = n?.[C.getId()], M = w?.minWidth ?? s?.defaultMinWidth, A = w?.maxWidth ?? s?.defaultMaxWidth, I = C.getMinWidth(), L = C.getMaxWidth(), k = typeof M == "number" && M > I ? M : I, B = typeof A == "number" && A < L ? A : L; 62864 let N = Math.round(C.getActualWidth() * m); 62865 N < k ? (N = k, d(C), u = !1) : N > B ? (N = B, d(C), u = !1) : b === 0 && (N = y), C.setActualWidth(N, t, !0), y -= N; 62866 } 62867 } 62868 } 62869 c.forEach((f) => { 62870 f.fireColumnWidthChangedEvent(t); 62871 }); 62872 const p = this.beans.visibleCols; 62873 p.setLeftValues(t), p.updateBodyWidths(), !i && Ed(this.eventSvc, c, !0, t); 62874 } 62875 applyAutosizeStrategy() { 62876 const e = this.gos.get("autoSizeStrategy"); 62877 if (!e) 62878 return; 62879 const { type: t } = e; 62880 setTimeout(() => { 62881 if (t === "fitGridWidth") { 62882 const { columnLimits: i, defaultMinWidth: s, defaultMaxWidth: n } = e, o = i?.map(({ colId: r, minWidth: a, maxWidth: l }) => ({ 62883 key: r, 62884 minWidth: a, 62885 maxWidth: l 62886 })); 62887 this.sizeColumnsToFitGridBody({ 62888 defaultMinWidth: s, 62889 defaultMaxWidth: n, 62890 columnLimits: o 62891 }); 62892 } else t === "fitProvidedWidth" && this.sizeColumnsToFit(e.width, "sizeColumnsToFit"); 62893 }); 62894 } 62895 onFirstDataRendered() { 62896 const e = this.gos.get("autoSizeStrategy"); 62897 if (e?.type !== "fitCellContents") 62898 return; 62899 const { colIds: t, skipHeader: i } = e; 62900 setTimeout(() => { 62901 t ? this.autoSizeCols({ 62902 colKeys: t, 62903 skipHeader: i, 62904 source: "autosizeColumns" 62905 }) : this.autoSizeAllColumns("autosizeColumns", i); 62906 }); 62907 } 62908 processResizeOperations() {
62909 this.shouldQueueResizeOperations = !1, this.resizeOperationQueue.forEach((e) => e()), this.resizeOperationQueue = []; 62910 } 62911 pushResizeOperation(e) { 62912 this.resizeOperationQueue.push(e); 62913 } 62914 destroy() { 62915 this.resizeOperationQueue.length = 0, super.destroy(); 62916 } 62917}; 62918function Oue(e, t) { 62919 const i = e.getMinWidth(); 62920 t < i && (t = i); 62921 const s = e.getMaxWidth(); 62922 return e.isGreaterThanMax(t) && (t = s), t; 62923} 62924var Nue = { 62925 moduleName: "ColumnAutoSize", 62926 version: Fe, 62927 beans: [Fue], 62928 apiFunctions: { 62929 sizeColumnsToFit: Lue, 62930 autoSizeColumns: kue, 62931 autoSizeAllColumns: Pue 62932 }, 62933 dependsOn: [jN] 62934}; 62935function _ue(e) { 62936 return e.pinnedRowModel?.getPinnedTopRowCount() ?? 0; 62937} 62938function Bue(e) { 62939 return e.pinnedRowModel?.getPinnedBottomRowCount() ?? 0; 62940} 62941function Gue(e, t) { 62942 return e.pinnedRowModel?.getPinnedTopRow(t); 62943} 62944function zue(e, t) { 62945 return e.pinnedRowModel?.getPinnedBottomRow(t); 62946} 62947var Hue = class extends he { 62948 constructor() { 62949 super(...arguments), this.beanName = "pinnedRowModel", this.nextId = 0, this.pinnedTopRows = { cache: {}, order: [] }, this.pinnedBottomRows = { cache: {}, order: [] }; 62950 } 62951 postConstruct() { 62952 const e = this.gos; 62953 this.setPinnedRowData(e.get("pinnedTopRowData"), "top"), this.setPinnedRowData(e.get("pinnedBottomRowData"), "bottom"), this.addManagedPropertyListener("pinnedTopRowData", (t) => this.setPinnedRowData(t.currentValue, "top")), this.addManagedPropertyListener("pinnedBottomRowData", (t) => this.setPinnedRowData(t.currentValue, "bottom")), this.addManagedEventListeners({ gridStylesChanged: this.onGridStylesChanges.bind(this) }); 62954 } 62955 isEmpty(e) { 62956 return this.getCache(e).order.length === 0; 62957 } 62958 isRowsToRender(e) { 62959 return !this.isEmpty(e); 62960 } 62961 onGridStylesChanges(e) { 62962 if (e.rowHeightChanged) { 62963 const t = (i) => { 62964 i.setRowHeight(i.rowHeight, !0); 62965 }; 62966 kh(this.pinnedBottomRows, t), kh(this.pinnedTopRows, t); 62967 } 62968 } 62969 ensureRowHeightsValid() { 62970 let e = !1, t = 0; 62971 const i = (s) => { 62972 if (s.rowHeightEstimated) { 62973 const n = _c(this.beans, s); 62974 s.setRowTop(t), s.setRowHeight(n.height), t += n.height, e = !0; 62975 } 62976 }; 62977 return kh(this.pinnedBottomRows, i), t = 0, kh(this.pinnedTopRows, i), this.eventSvc.dispatchEvent({ 62978 type: "pinnedHeightChanged" 62979 }), e; 62980 } 62981 setPinnedRowData(e, t) { 62982 this.updateNodesFromRowData(e, t), this.eventSvc.dispatchEvent({ 62983 type: "pinnedRowDataChanged" 62984 }); 62985 } 62986 /** 62987 * Updates existing RowNode instances and creates new ones if necessary 62988 * 62989 * Setting data as `undefined` will clear row nodes 62990 */ 62991 updateNodesFromRowData(e, t) { 62992 const i = this.getCache(t); 62993 if (e === void 0) { 62994 i.order.length = 0, i.cache = {}; 62995 return; 62996 } 62997 const s = Ad(this.gos), n = t === "top" ? bN : wN, o = new Set(i.order), r = [], a = /* @__PURE__ */ new Set(); 62998 let l = 0, c = -1; 62999 for (const u of e) { 63000 const d = s?.({ data: u, level: 0, rowPinned: t }) ?? n + this.nextId++; 63001 if (a.has(d)) { 63002 Ae(96, { id: d, data: u }); 63003 continue; 63004 } 63005 c++, a.add(d), r.push(d); 63006 const p = vp(i, d); 63007 if (p !== void 0) 63008 p.data !== u && p.setData(u), l += this.setRowTopAndRowIndex(p, l, c), o.delete(d); 63009 else { 63010 const f = new Rd(this.beans); 63011 f.id = d, f.data = u, f.rowPinned = t, l += this.setRowTopAndRowIndex(f, l, c), i.cache[d] = f, i.order.push(d); 63012 } 63013 } 63014 o.forEach((u) => { 63015 vp(i, u)?.clearRowTopAndRowIndex(), delete i.cache[u]; 63016 }), i.order = r; 63017 } 63018 setRowTopAndRowIndex(e, t, i) { 63019 return e.setRowTop(t), e.setRowHeight(_c(this.beans, e).height), e.setRowIndex(i), e.rowHeight; 63020 } 63021 getPinnedTopTotalHeight() { 63022 return ST(this.pinnedTopRows); 63023 } 63024 getPinnedBottomTotalHeight() { 63025 return ST(this.pinnedBottomRows); 63026 } 63027 getPinnedTopRowCount() { 63028 return pS(this.pinnedTopRows); 63029 } 63030 getPinnedBottomRowCount() { 63031 return pS(this.pinnedBottomRows); 63032 } 63033 getPinnedTopRow(e) { 63034 return hS(this.pinnedTopRows, e); 63035 } 63036 getPinnedBottomRow(e) { 63037 return hS(this.pinnedBottomRows, e); 63038 } 63039 getPinnedRowById(e, t) { 63040 return vp(this.getCache(t), e); 63041 } 63042 forEachPinnedRow(e, t) { 63043 return kh(this.getCache(e), t); 63044 } 63045 getCache(e) { 63046 return e === "top" ? this.pinnedTopRows : this.pinnedBottomRows; 63047 } 63048}; 63049function ST(e) { 63050 const t = pS(e); 63051 if (t === 0) 63052 return 0; 63053 const i = hS(e, t - 1); 63054 return i === void 0 ? 0 : i.rowTop + i.rowHeight; 63055} 63056function vp(e, t) { 63057 return e.cache[t]; 63058} 63059function hS(e, t) { 63060 return vp(e, e.order[t]); 63061} 63062function kh(e, t) { 63063 e.order.forEach((i, s) => { 63064 const n = vp(e, i); 63065 n && t(n, s); 63066 }); 63067} 63068function pS(e) { 63069 return e.order.length; 63070} 63071var Vue = { 63072 moduleName: "PinnedRow", 63073 version: Fe, 63074 beans: [Hue],
63075 apiFunctions: { 63076 getPinnedTopRowCount: _ue, 63077 getPinnedBottomRowCount: Bue, 63078 getPinnedTopRow: Gue, 63079 getPinnedBottomRow: zue 63080 } 63081}, Uue = class extends he { 63082 constructor(e, t) { 63083 super(), this.cellCtrl = e, this.staticClasses = [], this.beans = t, this.column = e.column; 63084 } 63085 setComp(e) { 63086 this.cellComp = e, this.applyUserStyles(), this.applyCellClassRules(), this.applyClassesFromColDef(); 63087 } 63088 applyCellClassRules() { 63089 const { column: e, cellComp: t } = this, i = e.colDef, s = i.cellClassRules, n = this.getCellClassParams(e, i); 63090 gM( 63091 this.beans.expressionSvc, 63092 // if current was previous, skip 63093 s === this.cellClassRules ? void 0 : this.cellClassRules, 63094 s, 63095 n, 63096 (o) => t.addOrRemoveCssClass(o, !0), 63097 (o) => t.addOrRemoveCssClass(o, !1) 63098 ), this.cellClassRules = s; 63099 } 63100 applyUserStyles() { 63101 const e = this.column, t = e.colDef, i = t.cellStyle; 63102 if (!i) 63103 return; 63104 let s; 63105 if (typeof i == "function") { 63106 const n = this.getCellClassParams(e, t); 63107 s = i(n); 63108 } else 63109 s = i; 63110 s && this.cellComp.setUserStyles(s); 63111 } 63112 applyClassesFromColDef() { 63113 const { column: e, cellComp: t } = this, i = e.colDef, s = this.getCellClassParams(e, i); 63114 this.staticClasses.forEach((o) => t.addOrRemoveCssClass(o, !1)); 63115 const n = this.beans.cellStyles.getStaticCellClasses(i, s);
63116 this.staticClasses = n, n.forEach((o) => t.addOrRemoveCssClass(o, !0)); 63117 } 63118 getCellClassParams(e, t) { 63119 const { value: i, rowNode: s } = this.cellCtrl; 63120 return this.beans.gos.addGridCommonParams({ 63121 value: i, 63122 data: s.data, 63123 node: s, 63124 colDef: t, 63125 column: e, 63126 rowIndex: s.rowIndex 63127 }); 63128 } 63129}, Wue = class extends he { 63130 constructor() { 63131 super(...arguments), this.beanName = "cellStyles"; 63132 } 63133 processAllCellClasses(e, t, i, s) { 63134 gM( 63135 this.beans.expressionSvc, 63136 void 0, 63137 e.cellClassRules, 63138 t, 63139 i, 63140 s 63141 ), this.processStaticCellClasses(e, t, i); 63142 } 63143 getStaticCellClasses(e, t) { 63144 const { cellClass: i } = e; 63145 if (!i) 63146 return []; 63147 let s; 63148 return typeof i == "function" ? s = i(t) : s = i, typeof s == "string" && (s = [s]), s || []; 63149 } 63150 createCellCustomStyleFeature(e, t) { 63151 return new Uue(e, t); 63152 } 63153 processStaticCellClasses(e, t, i) { 63154 this.getStaticCellClasses(e, t).forEach((n) => { 63155 i(n); 63156 }); 63157 } 63158}, jue = { 63159 moduleName: "CellStyle", 63160 version: Fe, 63161 beans: [Wue] 63162}, $ue = { 63163 moduleName: "RowStyle", 63164 version: Fe, 63165 beans: [Ree] 63166}; 63167function Yue(e, t) { 63168 return !!e.colHover?.isHovered(t); 63169} 63170var Kue = class extends he { 63171 constructor(e, t) { 63172 super(), this.columns = e, this.element = t; 63173 } 63174 postConstruct() { 63175 if (this.gos.get("columnHoverHighlight")) { 63176 const e = this.beans.colHover; 63177 this.addManagedListeners(this.element, { 63178 mouseout: e.clearMouseOver.bind(e), 63179 mouseover: e.setMouseOver.bind(e, this.columns) 63180 }); 63181 } 63182 } 63183}, Zue = "ag-column-hover", que = class extends he { 63184 constructor() { 63185 super(...arguments), this.beanName = "colHover"; 63186 } 63187 setMouseOver(e) { 63188 this.updateState(e); 63189 } 63190 clearMouseOver() { 63191 this.updateState(null); 63192 } 63193 isHovered(e) { 63194 const t = this.selectedColumns; 63195 return !!t && t.indexOf(e) >= 0; 63196 } 63197 addHeaderColumnHoverListener(e, t, i) { 63198 const s = () => { 63199 if (!this.gos.get("columnHoverHighlight")) 63200 return; 63201 const n = this.isHovered(i); 63202 t.addOrRemoveCssClass("ag-column-hover", n); 63203 }; 63204 e.addManagedEventListeners({ columnHoverChanged: s }), s(); 63205 } 63206 onCellColumnHover(e, t) { 63207 if (!t || !this.gos.get("columnHoverHighlight")) 63208 return; 63209 const i = this.isHovered(e); 63210 t.addOrRemoveCssClass(Zue, i); 63211 } 63212 addHeaderFilterColumnHoverListener(e, t, i, s) { 63213 this.createHoverFeature(e, [i], s); 63214 const n = () => { 63215 if (!this.gos.get("columnHoverHighlight")) 63216 return; 63217 const o = this.isHovered(i); 63218 t.addOrRemoveCssClass("ag-column-hover", o); 63219 }; 63220 e.addManagedEventListeners({ columnHoverChanged: n }), n(); 63221 } 63222 createHoverFeature(e, t, i) { 63223 e.createManagedBean(new Kue(t, i)); 63224 } 63225 updateState(e) { 63226 this.selectedColumns = e, this.eventSvc.dispatchEvent({ 63227 type: "columnHoverChanged" 63228 }); 63229 } 63230}, Que = { 63231 moduleName: "ColumnHover", 63232 version: Fe, 63233 beans: [que], 63234 apiFunctions: { 63235 isColumnHovered: Yue 63236 } 63237}, Xue = class extends he { 63238 constructor() { 63239 super(...arguments), this.beanName = "apiEventSvc", this.syncListeners = /* @__PURE__ */ new Map(), this.asyncListeners = /* @__PURE__ */ new Map(), this.syncGlobalListeners = /* @__PURE__ */ new Set(), this.globalListenerPairs = /* @__PURE__ */ new Map(); 63240 } 63241 postConstruct() { 63242 this.wrapSvc = this.beans.frameworkOverrides.createGlobalEventListenerWrapper?.(); 63243 } 63244 addEventListener(e, t) { 63245 const i = this.wrapSvc?.wrap(t) ?? t, s = !fp.has(e), n = s ? this.asyncListeners : this.syncListeners; 63246 n.has(e) || n.set(e, /* @__PURE__ */ new Set()), n.get(e).add(i), this.eventSvc.addEventListener(e, i, s); 63247 } 63248 removeEventListener(e, t) { 63249 const i = this.wrapSvc?.unwrap(t) ?? t, n = !!this.asyncListeners.get(e)?.delete(i); 63250 n || this.syncListeners.get(e)?.delete(i), this.eventSvc.removeEventListener(e, i, n); 63251 } 63252 addGlobalListener(e) { 63253 const t = this.wrapSvc?.wrapGlobal(e) ?? e, i = (o, r) => { 63254 fp.has(o) && t(o, r); 63255 }, s = (o, r) => { 63256 fp.has(o) || t(o, r); 63257 }; 63258 this.globalListenerPairs.set(e, { syncListener: i, asyncListener: s }); 63259 const n = this.eventSvc; 63260 n.addGlobalListener(i, !1), n.addGlobalListener(s, !0); 63261 } 63262 removeGlobalListener(e) { 63263 const { eventSvc: t, wrapSvc: i, globalListenerPairs: s } = this, n = i?.unwrapGlobal(e) ?? e; 63264 if (s.has(n)) { 63265 const { syncListener: r, asyncListener: a } = s.get(n); 63266 t.removeGlobalListener(r, !1), t.removeGlobalListener(a, !0), s.delete(e); 63267 } else 63268 this.syncGlobalListeners.delete(n), t.removeGlobalListener(n, !1); 63269 } 63270 destroyEventListeners(e, t) { 63271 e.forEach((i, s) => {
63272 i.forEach((n) => this.eventSvc.removeEventListener(s, n, t)), i.clear(); 63273 }), e.clear(); 63274 } 63275 destroyGlobalListeners(e, t) { 63276 e.forEach((i) => this.eventSvc.removeGlobalListener(i, t)), e.clear(); 63277 } 63278 destroy() { 63279 super.destroy(), this.destroyEventListeners(this.syncListeners, !1), this.destroyEventListeners(this.asyncListeners, !0), this.destroyGlobalListeners(this.syncGlobalListeners, !1); 63280 const { globalListenerPairs: e, eventSvc: t } = this; 63281 e.forEach(({ syncListener: i, asyncListener: s }) => { 63282 t.removeGlobalListener(i, !1), t.removeGlobalListener(s, !0); 63283 }), e.clear(); 63284 } 63285}; 63286function Jue(e, t, i) { 63287 e.apiEventSvc?.addEventListener(t, i); 63288} 63289function ede(e, t, i) { 63290 e.apiEventSvc?.removeEventListener(t, i); 63291} 63292function tde(e, t) { 63293 e.apiEventSvc?.addGlobalListener(t); 63294} 63295function ide(e, t) { 63296 e.apiEventSvc?.removeGlobalListener(t); 63297} 63298var sde = { 63299 moduleName: "EventApi", 63300 version: Fe, 63301 apiFunctions: { 63302 addEventListener: Jue, 63303 addGlobalListener: tde, 63304 removeEventListener: ede, 63305 removeGlobalListener: ide 63306 }, 63307 beans: [Xue] 63308}, nde = ( 63309 /*css*/ 63310 ".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);white-space:normal}.ag-tooltip,.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}" 63311), ode = class extends he { 63312 constructor() { 63313 super(...arguments), this.beanName = "tooltipSvc"; 63314 } 63315 setupHeaderTooltip(e, t, i, s) { 63316 e && t.destroyBean(e); 63317 const n = E0(this.gos), { column: o, eGui: r } = t, a = o.getColDef(); 63318 !s && n && !a.headerComponent && (s = bm( 63319 () => r.querySelector(".ag-header-cell-text") 63320 )); 63321 const l = { 63322 getColumn: () => o, 63323 getColDef: () => o.getColDef(), 63324 getGui: () => r, 63325 getLocation: () => "header", 63326 getTooltipValue: () => i ?? o.getColDef().headerTooltip, 63327 shouldDisplayTooltip: s 63328 }; 63329 let c = this.createTooltipFeature(l); 63330 return c && (c = t.createBean(c), t.setRefreshFunction("tooltip", () => c.refreshTooltip())), c; 63331 } 63332 setupHeaderGroupTooltip(e, t, i, s) { 63333 e && t.destroyBean(e); 63334 const n = E0(this.gos), { column: o, eGui: r } = t, a = o.getColGroupDef(); 63335 !s && n && !a?.headerGroupComponent && (s = bm( 63336 () => r.querySelector(".ag-header-group-text") 63337 )); 63338 const l = { 63339 getColumn: () => o, 63340 getGui: () => r, 63341 getLocation: () => "headerGroup", 63342 getTooltipValue: () => i ?? (a && a.headerTooltip), 63343 shouldDisplayTooltip: s 63344 }; 63345 a && (l.getColDef = () => a); 63346 const c = this.createTooltipFeature(l); 63347 return c && t.createBean(c); 63348 } 63349 enableCellTooltipFeature(e, t, i) { 63350 const { column: s, rowNode: n } = e, o = () => { 63351 const l = s.getColDef(), c = n.data; 63352 if (l.tooltipField && Ie(c)) 63353 return hp(c, l.tooltipField, s.isTooltipFieldContainsDots()); 63354 const u = l.tooltipValueGetter; 63355 return u ? u( 63356 this.gos.addGridCommonParams({ 63357 location: "cell", 63358 colDef: s.getColDef(), 63359 column: s, 63360 rowIndex: e.cellPosition.rowIndex, 63361 node: n, 63362 data: n.data, 63363 value: e.value, 63364 valueFormatted: e.valueFormatted 63365 }) 63366 ) : null; 63367 }, r = E0(this.gos); 63368 !i && r && !e.isCellRenderer() && (i = bm(() => { 63369 const { eGui: l } = e; 63370 return l.children.length === 0 ? l : l.querySelector(".ag-cell-value"); 63371 })); 63372 const a = { 63373 getColumn: () => s, 63374 getColDef: () => s.getColDef(), 63375 getRowIndex: () => e.cellPosition.rowIndex, 63376 getRowNode: () => n, 63377 getGui: () => e.eGui, 63378 getLocation: () => "cell", 63379 getTooltipValue: t != null ? () => t : o, 63380 // this makes no sense, why is the cell formatted value passed to the tooltip??? 63381 getValueFormatted: () => e.valueFormatted, 63382 shouldDisplayTooltip: i 63383 }; 63384 return this.createTooltipFeature(a, this.beans); 63385 } 63386 refreshRowTooltip(e, t, i, s) { 63387 const n = { 63388 getGui: () => t.getFullWidthElement(), 63389 getTooltipValue: () => i, 63390 getLocation: () => "fullWidthRow", 63391 shouldDisplayTooltip: s 63392 }, o = this.beans, r = o.context; 63393 e && t.destroyBean(e, r); 63394 const a = this.createTooltipFeature(n, o); 63395 return t.createBean(a, r); 63396 } 63397 initCol(e) { 63398 const { colDef: t } = e; 63399 e.tooltipEnabled = Ie(t.tooltipField) || Ie(t.tooltipValueGetter) || Ie(t.tooltipComponent); 63400 } 63401 createTooltipFeature(e, t) { 63402 return this.beans.registry.createDynamicBean("tooltipFeature", !1, e, t); 63403 } 63404}, rde = { 63405 moduleName: "Tooltip", 63406 version: Fe, 63407 beans: [ode], 63408 dynamicBeans: { 63409 tooltipFeature: zte 63410 }, 63411 userComponents: { 63412 agTooltipComponent: bre 63413 }, 63414 dependsOn: [Xy], 63415 css: [nde] 63416}, ade = { 63417 moduleName: "Locale", 63418 version: Fe, 63419 beans: [hre] 63420}, lde = class extends he {
63421 constructor() { 63422 super(...arguments), this.beanName = "rowAutoHeight", this.wasEverActive = !1; 63423 } 63424 setRowAutoHeight(e, t, i) { 63425 e.__autoHeights || (e.__autoHeights = {}), e.__autoHeights[i.getId()] = t, t != null && (e.__checkAutoHeightsDebounced == null && (e.__checkAutoHeightsDebounced = qs(this, this.doCheckAutoHeights.bind(this, e), 1)), e.__checkAutoHeightsDebounced()); 63426 } 63427 checkAutoHeights(e) { 63428 this.wasEverActive && this.doCheckAutoHeights(e); 63429 } 63430 doCheckAutoHeights(e) { 63431 const t = e.__autoHeights; 63432 if (t == null) 63433 return; 63434 let i = !1, s = !0, n = 0; 63435 const { visibleCols: o, colModel: r, colViewport: a, rowModel: l } = this.beans; 63436 o.autoHeightCols.forEach((u) => { 63437 let d = t[u.getId()]; 63438 if (d == null) 63439 if (r.colSpanActive) { 63440 let p = []; 63441 switch (u.getPinned()) { 63442 case "left": 63443 p = o.getLeftColsForRow(e); 63444 break; 63445 case "right": 63446 p = o.getRightColsForRow(e); 63447 break; 63448 case null: 63449 p = a.getColsWithinViewport(e); 63450 break; 63451 } 63452 if (p.includes(u)) { 63453 i = !0; 63454 return; 63455 } 63456 d = -1; 63457 } else { 63458 i = !0; 63459 return; 63460 } 63461 else 63462 s = !1; 63463 d > n && (n = d); 63464 }), !i && ((s || n < 10) && (n = _c(this.beans, e).height), n != e.rowHeight && (e.setRowHeight(n), l.onRowHeightChangedDebounced?.())); 63465 } 63466 setupCellAutoHeight(e, t, i) { 63467 const s = t.parentElement, { rowNode: n, column: o } = e, r = this.beans, a = _c(r, n).height, l = (d) => { 63468 if (e.editing || !e.isAlive() || !i.isAlive()) 63469 return; 63470 const { paddingTop: p, paddingBottom: f, borderBottomWidth: m, borderTopWidth: y } = eu(s), b = p + f + m + y, w = t.offsetHeight + b; 63471 if (d < 5) { 63472 const A = Ei(r), I = !A || !A.contains(t), L = w == 0; 63473 if (I || L) { 63474 window.setTimeout(() => l(d + 1), 0); 63475 return; 63476 } 63477 } 63478 const M = Math.max(w, a); 63479 this.setRowAutoHeight(n, M, o); 63480 }, c = () => l(0); 63481 c(); 63482 const u = zl(r, t, c); 63483 i.addDestroyFunc(() => { 63484 u(), this.setRowAutoHeight(n, void 0, o); 63485 }); 63486 } 63487 setAutoHeightActive(e) { 63488 this.active = e.list.some((t) => t.isVisible() && t.isAutoHeight()), this.active && (this.wasEverActive = !0); 63489 } 63490}, cde = { 63491 moduleName: "RowAutoHeight", 63492 version: Fe, 63493 beans: [lde] 63494}, O_ = { 63495 moduleName: "AllCommunity", 63496 version: Fe, 63497 dependsOn: [ 63498 vce, 63499 Ace, 63500 Fce, 63501 eae, 63502 Ale, 63503 Dle, 63504 Ele, 63505 Ile, 63506 Rle, 63507 Tle, 63508 Lle, 63509 Mle, 63510 Wae, 63511 jae, 63512 $ae, 63513 Uae, 63514 Yae, 63515 Kae, 63516 Kce, 63517 Jle, 63518 hue, 63519 Qse, 63520 F_, 63521 Sue, 63522 Tue, 63523 Nue, 63524 Tie, 63525 Vue, 63526 Ule, 63527 ere, 63528 jue, 63529 Que, 63530 $ue, 63531 sde, 63532 sre, 63533 Vce, 63534 rde, 63535 ade, 63536 cde, 63537 Rie, 63538 yce 63539 ] 63540}, ude = Object.defineProperty, dde = (e, t, i) => t in e ? ude(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, gd = (e, t, i) => dde(e, typeof t != "symbol" ? t + "" : t, i); 63541class tg { 63542 static getComponentDefinition(t, i) { 63543 let s; 63544 return typeof t == "string" ? s = this.searchForComponentInstance(i, t) : s = { extends: Mt({ ...t }) }, s || Rt(114, { component: t }), s.extends ? (s.extends.setup && (s.setup = s.extends.setup), s.extends.props = this.addParamsToProps(s.extends.props)) : s.props = this.addParamsToProps(s.props), s; 63545 } 63546 static addParamsToProps(t) { 63547 return !t || Array.isArray(t) && t.indexOf("params") === -1 ? t = ["params", ...t || []] : typeof t == "object" && !t.params && (t.params = { 63548 type: Object 63549 }), t; 63550 } 63551 static createAndMountComponent(t, i, s, n) { 63552 const o = tg.getComponentDefinition(t, s); 63553 if (!o) 63554 return; 63555 const { vNode: r, destroy: a, el: l } = this.mount( 63556 o, 63557 { params: Object.freeze(i) }, 63558 s, 63559 n || {} 63560 ); 63561 return { 63562 componentInstance: r.component.proxy, 63563 element: l, 63564 destroy: a 63565 }; 63566 } 63567 static mount(t, i, s, n) { 63568 let o = Re(t, i); 63569 o.appContext = { ...s.appContext, provides: n }; 63570 let r = document.createElement("div"); 63571 return _E(o, r), { vNode: o, destroy: () => { 63572 r && _E(null, r), r = null, o = null; 63573 }, el: r }; 63574 } 63575 static searchForComponentInstance(t, i, s = 10, n = !1) { 63576 let o = null, r = 0, a = t.parent; 63577 for (; !o && a && a.components && ++r < s; ) 63578 a.components && a.components[i] && (o = a.components[i]), a = a.parent; 63579 for (r = 0, a = t.parent;
63579 !o && a && a.$options && ++r < s; ) { 63580 const l = a; 63581 l.$options && l.$options.components && l.$options.components[i] ? o = l.$options.components[i] : l[i] && (o = l[i]), a = a.parent; 63582 } 63583 for (r = 0, a = t.parent; !o && a && ++r < s; ) { 63584 if (a.exposed) { 63585 const l = a; 63586 l.exposed && l.exposed[i] ? o = l.exposed[i] : l[i] && (o = l[i]); 63587 } 63588 a = a.parent; 63589 } 63590 if (!o) { 63591 const l = t.appContext.components; 63592 l && l[i] && (o = l[i]); 63593 } 63594 return !o && !n ? (Rt(114, { component: i }), null) : o; 63595 } 63596} 63597class hde extends Cre { 63598 constructor(t, i) { 63599 super(), gd(this, "parent"), gd(this, "provides"), this.parent = t, this.provides = i; 63600 } 63601 createWrapper(t) { 63602 const i = this; 63603 class s extends pde { 63604 init(r) { 63605 super.init(r); 63606 } 63607 hasMethod(r) { 63608 var a, l; 63609 const c = n.getFrameworkComponentInstance(); 63610 return c[r] ? !0 : ((a = c.$.exposed) == null ? void 0 : a[r]) != null || ((l = c.exposed) == null ? void 0 : l[r]) != null || c.$.setupState[r] != null; 63611 } 63612 callMethod(r, a) { 63613 var l, c; 63614 const u = this.getFrameworkComponentInstance(), d = n.getFrameworkComponentInstance(); 63615 if (d[r]) 63616 return d[r].apply(u, a); 63617 { 63618 const p = ((l = u.$.exposed) == null ? void 0 : l[r]) || ((c = u.exposed) == null ? void 0 : c[r]) || u.$.setupState[r]; 63619 return p?.apply(u, a); 63620 } 63621 } 63622 addMethod(r, a) { 63623 n[r] = a; 63624 } 63625 processMethod(r, a) { 63626 return r === "refresh" && (this.getFrameworkComponentInstance().params = a[0]), this.hasMethod(r) ? this.callMethod(r, a) : r === "refresh"; 63627 } 63628 createComponent(r) { 63629 return i.createComponent(t, r); 63630 } 63631 } 63632 const n = new s(); 63633 return n; 63634 } 63635 createComponent(t, i) { 63636 return tg.createAndMountComponent(t, i, this.parent, this.provides); 63637 } 63638 createMethodProxy(t, i, s) { 63639 return function() { 63640 return t.hasMethod(i) ? t.callMethod(i, arguments) : (s && Ae(233, { methodName: i }), null); 63641 }; 63642 } 63643 destroy() { 63644 this.parent = null; 63645 } 63646} 63647class pde { 63648 constructor() { 63649 gd(this, "componentInstance"), gd(this, "element"), gd(this, "unmount"); 63650 } 63651 getGui() { 63652 return this.element; 63653 } 63654 destroy() { 63655 this.getFrameworkComponentInstance() && typeof this.getFrameworkComponentInstance().destroy == "function" && this.getFrameworkComponentInstance().destroy(), this.unmount(); 63656 } 63657 getFrameworkComponentInstance() { 63658 return this.componentInstance; 63659 } 63660 init(t) { 63661 const { componentInstance: i, element: s, destroy: n } = this.createComponent(t); 63662 this.componentInstance = i, this.unmount = n, this.element = s.firstElementChild ?? s; 63663 } 63664} 63665class gde extends _N { 63666 constructor(t) { 63667 super("vue"), gd(this, "parent"), this.parent = t; 63668 } 63669 /* 63670 * vue components are specified in the "components" part of the vue component - as such we need a way to determine 63671 * if a given component is within that context - this method provides this 63672 * Note: This is only really used/necessary with cellRendererSelectors 63673 */ 63674 frameworkComponent(t, i) { 63675 let s = tg.searchForComponentInstance(this.parent, t, 10, !0) ? t : null; 63676 if (!s && i && i[t]) { 63677 const n = i[t]; 63678 s = tg.searchForComponentInstance(this.parent, n, 10, !0) ? n : null; 63679 } 63680 return s; 63681 } 63682 isFrameworkComponent(t) { 63683 return typeof t == "object"; 63684 } 63685} 63686function fde() { 63687 return { 63688 gridOptions: {}, 63689 modules: [], 63690 // @START_DEFAULTS@ 63691 statusBar: void 0, 63692 sideBar: void 0, 63693 suppressContextMenu: void 0, 63694 preventDefaultOnContextMenu: void 0, 63695 allowContextMenuWithControlKey: void 0, 63696 columnMenu: void 0, 63697 suppressMenuHide: void 0, 63698 enableBrowserTooltips: void 0, 63699 tooltipTrigger: void 0, 63700 tooltipShowDelay: void 0, 63701 tooltipHideDelay: void 0, 63702 tooltipMouseTrack: void 0, 63703 tooltipShowMode: void 0, 63704 tooltipInteraction: void 0, 63705 popupParent: void 0, 63706 copyHeadersToClipboard: void 0, 63707 copyGroupHeadersToClipboard: void 0, 63708 clipboardDelimiter: void 0, 63709 suppressCopyRowsToClipboard: void 0, 63710 suppressCopySingleCellRanges: void 0, 63711 suppressLastEmptyLineOnPaste: void 0, 63712 suppressClipboardPaste: void 0, 63713 suppressClipboardApi: void 0, 63714 suppressCutToClipboard: void 0, 63715 columnDefs: void 0, 63716 defaultColDef: void 0, 63717 defaultColGroupDef: void 0, 63718 columnTypes: void 0, 63719 dataTypeDefinitions: void 0, 63720 maintainColumnOrder: void 0, 63721 enableStrictPivotColumnOrder: void 0, 63722 suppressFieldDotNotation: void 0, 63723 headerHeight: void 0, 63724 groupHeaderHeight: void 0, 63725 floatingFiltersHeight: void 0, 63726 pivotHeaderHeight: void 0, 63727 pivotGroupHeaderHeight: void 0, 63728 allowDragFromColumnsToolPanel: void 0, 63729 suppressMovableColumns: void 0, 63730 suppressColumnMoveAnimation: void 0, 63731 suppressMoveWhenColumnDragging: void 0, 63732 suppressDragLeaveHidesColumns: void 0, 63733 suppressGroupChangesColumnVisibility: void 0, 63734 suppressMakeColumnVisibleAfterUnGroup: void 0, 63735 suppressRowGroupHidesColumns: void 0, 63736 colResizeDefault: void 0, 63737 suppressAutoSize: void 0, 63738 autoSizePadding: void 0, 63739 skipHeaderOnAutoSize: void 0, 63740 autoSizeStrategy: void 0, 63741 components: void 0, 63742 editType: void 0, 63743 singleClickEdit: void 0, 63744 suppressClickEdit: void 0, 63745 readOnlyEdit: void 0, 63746 stopEditingWhenCellsLoseFocus: void 0, 63747 enterNavigatesVertically: void 0, 63748 enterNavigatesVerticallyAfterEdit: void 0, 63749 enableCellEditingOnBackspace: void 0, 63750 undoRedoCellEditing: void 0, 63751 undoRedoCellEditingLimit: void 0, 63752 defaultCsvExportParams: void 0, 63753 suppressCsvExport: void 0, 63754 defaultExcelExportParams: void 0, 63755 suppressExcelExport: void 0, 63756 excelStyles: void 0, 63757 quickFilterText: void 0, 63758 cacheQuickFilter: void 0, 63759 includeHiddenColumnsInQuickFilter: void 0, 63760 quickFilterParser: void 0, 63761 quickFilterMatcher: void 0, 63762 applyQuickFilterBeforePivotOrAgg: void 0, 63763 excludeChildrenWhenTreeDataFiltering: void 0, 63764 enableAdvancedFilter: void 0, 63765 alwaysPassFilter: void 0, 63766 includeHiddenColumnsInAdvancedFilter: void 0, 63767 advancedFilterParent: void 0, 63768 advancedFilterBuilderParams: void 0, 63769 suppressAdvancedFilterEval: void 0, 63770 suppressSetFilterByDefault: void 0, 63771 enableCharts: void 0, 63772 chartThemes: void 0, 63773 customChartThemes: void 0, 63774 chartThemeOverrides: void 0, 63775 chartToolPanelsDef: void 0, 63776 chartMenuItems: void 0, 63777 loadingCellRenderer: void 0, 63778 loadingCellRendererParams: void 0, 63779 loadingCellRendererSelector: void 0, 63780 localeText: void 0, 63781 masterDetail: void 0, 63782 keepDetailRows: void 0, 63783 keepDetailRowsCount: void 0, 63784 detailCellRenderer: void 0, 63785 detailCellRendererParams: void 0, 63786 detailRowHeight: void 0, 63787 detailRowAutoHeight: void 0, 63788 context: void 0, 63789 dragAndDropImageComponent: void 0, 63790 dragAndDropImageComponentParams: void 0,
63791 alignedGrids: void 0, 63792 tabIndex: void 0, 63793 rowBuffer: void 0, 63794 valueCache: void 0, 63795 valueCacheNeverExpires: void 0, 63796 enableCellExpressions: void 0, 63797 suppressTouch: void 0, 63798 suppressFocusAfterRefresh: void 0, 63799 suppressBrowserResizeObserver: void 0, 63800 suppressPropertyNamesCheck: void 0, 63801 suppressChangeDetection: void 0, 63802 debug: void 0, 63803 loading: void 0, 63804 overlayLoadingTemplate: void 0, 63805 loadingOverlayComponent: void 0, 63806 loadingOverlayComponentParams: void 0, 63807 suppressLoadingOverlay: void 0, 63808 overlayNoRowsTemplate: void 0, 63809 noRowsOverlayComponent: void 0, 63810 noRowsOverlayComponentParams: void 0, 63811 suppressNoRowsOverlay: void 0, 63812 pagination: void 0, 63813 paginationPageSize: void 0, 63814 paginationPageSizeSelector: void 0, 63815 paginationAutoPageSize: void 0, 63816 paginateChildRows: void 0, 63817 suppressPaginationPanel: void 0, 63818 pivotMode: void 0, 63819 pivotPanelShow: void 0, 63820 pivotMaxGeneratedColumns: void 0, 63821 pivotDefaultExpanded: void 0, 63822 pivotColumnGroupTotals: void 0, 63823 pivotRowTotals: void 0, 63824 pivotSuppressAutoColumn: void 0, 63825 suppressExpandablePivotGroups: void 0, 63826 functionsReadOnly: void 0, 63827 aggFuncs: void 0, 63828 suppressAggFuncInHeader: void 0, 63829 alwaysAggregateAtRootLevel: void 0, 63830 aggregateOnlyChangedColumns: void 0, 63831 suppressAggFilteredOnly: void 0, 63832 removePivotHeaderRowWhenSingleValueColumn: void 0, 63833 animateRows: void 0, 63834 cellFlashDuration: void 0, 63835 cellFadeDuration: void 0, 63836 allowShowChangeAfterFilter: void 0, 63837 domLayout: void 0, 63838 ensureDomOrder: void 0, 63839 enableRtl: void 0, 63840 suppressColumnVirtualisation: void 0, 63841 suppressMaxRenderedRowRestriction: void 0, 63842 suppressRowVirtualisation: void 0, 63843 rowDragManaged: void 0, 63844 suppressRowDrag: void 0, 63845 suppressMoveWhenRowDragging: void 0, 63846 rowDragEntireRow: void 0, 63847 rowDragMultiRow: void 0, 63848 rowDragText: void 0, 63849 fullWidthCellRenderer: void 0, 63850 fullWidthCellRendererParams: void 0, 63851 embedFullWidthRows: void 0, 63852 groupDisplayType: void 0, 63853 groupDefaultExpanded: void 0, 63854 autoGroupColumnDef: void 0, 63855 groupMaintainOrder: void 0, 63856 groupSelectsChildren: void 0, 63857 groupLockGroupColumns: void 0, 63858 groupAggFiltering: void 0, 63859 groupTotalRow: void 0, 63860 grandTotalRow: void 0, 63861 suppressStickyTotalRow: void 0, 63862 groupSuppressBlankHeader: void 0, 63863 groupSelectsFiltered: void 0, 63864 showOpenedGroup: void 0, 63865 groupHideParentOfSingleChild: void 0, 63866 groupRemoveSingleChildren: void 0, 63867 groupRemoveLowestSingleChildren: void 0, 63868 groupHideOpenParents: void 0, 63869 groupAllowUnbalanced: void 0, 63870 rowGroupPanelShow: void 0, 63871 groupRowRenderer: void 0, 63872 groupRowRendererParams: void 0, 63873 treeData: void 0, 63874 rowGroupPanelSuppressSort: void 0, 63875 suppressGroupRowsSticky: void 0, 63876 pinnedTopRowData: void 0, 63877 pinnedBottomRowData: void 0, 63878 rowModelType: void 0, 63879 rowData: void 0, 63880 asyncTransactionWaitMillis: void 0, 63881 suppressModelUpdateAfterUpdateTransaction: void 0, 63882 datasource: void 0, 63883 cacheOverflowSize: void 0, 63884 infiniteInitialRowCount: void 0, 63885 serverSideInitialRowCount: void 0, 63886 suppressServerSideFullWidthLoadingRow: void 0, 63887 cacheBlockSize: void 0, 63888 maxBlocksInCache: void 0, 63889 maxConcurrentDatasourceRequests: void 0, 63890 blockLoadDebounceMillis: void 0, 63891 purgeClosedRowNodes: void 0, 63892 serverSideDatasource: void 0, 63893 serverSideSortAllLevels: void 0, 63894 serverSideEnableClientSideSort: void 0, 63895 serverSideOnlyRefreshFilteredGroups: void 0, 63896 serverSidePivotResultFieldSeparator: void 0, 63897 viewportDatasource: void 0, 63898 viewportRowModelPageSize: void 0, 63899 viewportRowModelBufferSize: void 0, 63900 alwaysShowHorizontalScroll: void 0, 63901 alwaysShowVerticalScroll: void 0, 63902 debounceVerticalScrollbar: void 0, 63903 suppressHorizontalScroll: void 0, 63904 suppressScrollOnNewData: void 0, 63905 suppressScrollWhenPopupsAreOpen: void 0, 63906 suppressAnimationFrame: void 0, 63907 suppressMiddleClickScrolls: void 0, 63908 suppressPreventDefaultOnMouseWheel: void 0, 63909 scrollbarWidth: void 0, 63910 rowSelection: void 0, 63911 cellSelection: void 0, 63912 rowMultiSelectWithClick: void 0, 63913 suppressRowDeselection: void 0, 63914 suppressRowClickSelection: void 0, 63915 suppressCellFocus: void 0, 63916 suppressHeaderFocus: void 0, 63917 selectionColumnDef: void 0, 63918 suppressMultiRangeSelection: void 0, 63919 enableCellTextSelection: void 0, 63920 enableRangeSelection: void 0, 63921 enableRangeHandle: void 0, 63922 enableFillHandle: void 0, 63923 fillHandleDirection: void 0, 63924 suppressClearOnFillReduction: void 0, 63925 sortingOrder: void 0, 63926 accentedSort: void 0, 63927 unSortIcon: void 0, 63928 suppressMultiSort: void 0, 63929 alwaysMultiSort: void 0, 63930 multiSortKey: void 0, 63931 suppressMaintainUnsortedOrder: void 0, 63932 icons: void 0, 63933 rowHeight: void 0, 63934 rowStyle: void 0, 63935 rowClass: void 0, 63936 rowClassRules: void 0, 63937 suppressRowHoverHighlight: void 0, 63938 suppressRowTransform: void 0, 63939 columnHoverHighlight: void 0, 63940 gridId: void 0, 63941 deltaSort: void 0, 63942 treeDataDisplayType: void 0, 63943 enableGroupEdit: void 0, 63944 initialState: void 0, 63945 theme: void 0, 63946 loadThemeGoogleFonts: void 0, 63947 getContextMenuItems: void 0, 63948 getMainMenuItems: void 0, 63949 postProcessPopup: void 0, 63950 processUnpinnedColumns: void 0, 63951 processCellForClipboard: void 0, 63952 processHeaderForClipboard: void 0, 63953 processGroupHeaderForClipboard: void 0, 63954 processCellFromClipboard: void 0, 63955 sendToClipboard: void 0, 63956 processDataFromClipboard: void 0, 63957 isExternalFilterPresent: void 0, 63958 doesExternalFilterPass: void 0, 63959 getChartToolbarItems: void 0, 63960 createChartContainer: void 0, 63961 focusGridInnerElement: void 0, 63962 navigateToNextHeader: void 0, 63963 tabToNextHeader: void 0, 63964 navigateToNextCell: void 0, 63965 tabToNextCell: void 0, 63966 getLocaleText: void 0, 63967 getDocument: void 0, 63968 paginationNumberFormatter: void 0, 63969 getGroupRowAgg: void 0, 63970 isGroupOpenByDefault: void 0, 63971 initialGroupOrderComparator: void 0, 63972 processPivotResultColDef: void 0, 63973 processPivotResultColGroupDef: void 0, 63974 getDataPath: void 0, 63975 getChildCount: void 0, 63976 getServerSideGroupLevelParams: void 0, 63977 isServerSideGroupOpenByDefault: void 0, 63978 isApplyServerSideTransaction: void 0, 63979 isServerSideGroup: void 0, 63980 getServerSideGroupKey: void 0, 63981 getBusinessKeyForNode: void 0, 63982 getRowId: void 0, 63983 resetRowDataOnUpdate: void 0, 63984 processRowPostCreate: void 0, 63985 isRowSelectable: void 0, 63986 isRowMaster: void 0, 63987 fillOperation: void 0, 63988 postSortRows: void 0, 63989 getRowStyle: void 0, 63990 getRowClass: void 0, 63991 getRowHeight: void 0, 63992 isFullWidthRow: void 0, 63993 // @END_DEFAULTS@ 63994 // @START_EVENT_PROPS@ 63995 "onColumn-everything-changed": void 0, 63996 "onNew-columns-loaded": void 0, 63997 "onColumn-pivot-mode-changed": void 0, 63998 "onPivot-max-columns-exceeded": void 0, 63999 "onColumn-row-group-changed": void 0,
64000 "onExpand-or-collapse-all": void 0, 64001 "onColumn-pivot-changed": void 0, 64002 "onGrid-columns-changed": void 0, 64003 "onColumn-value-changed": void 0, 64004 "onColumn-moved": void 0, 64005 "onColumn-visible": void 0, 64006 "onColumn-pinned": void 0, 64007 "onColumn-group-opened": void 0, 64008 "onColumn-resized": void 0, 64009 "onDisplayed-columns-changed": void 0, 64010 "onVirtual-columns-changed": void 0, 64011 "onColumn-header-mouse-over": void 0, 64012 "onColumn-header-mouse-leave": void 0, 64013 "onColumn-header-clicked": void 0, 64014 "onColumn-header-context-menu": void 0, 64015 "onAsync-transactions-flushed": void 0, 64016 "onRow-group-opened": void 0, 64017 "onRow-data-updated": void 0, 64018 "onPinned-row-data-changed": void 0, 64019 "onRange-selection-changed": void 0, 64020 "onCell-selection-changed": void 0, 64021 "onChart-created": void 0, 64022 "onChart-range-selection-changed": void 0, 64023 "onChart-options-changed": void 0, 64024 "onChart-destroyed": void 0, 64025 "onTool-panel-visible-changed": void 0, 64026 "onTool-panel-size-changed": void 0, 64027 "onModel-updated": void 0, 64028 "onCut-start": void 0, 64029 "onCut-end": void 0, 64030 "onPaste-start": void 0, 64031 "onPaste-end": void 0, 64032 "onFill-start": void 0, 64033 "onFill-end": void 0, 64034 "onCell-selection-delete-start": void 0, 64035 "onCell-selection-delete-end": void 0, 64036 "onRange-delete-start": void 0, 64037 "onRange-delete-end": void 0, 64038 "onUndo-started": void 0, 64039 "onUndo-ended": void 0, 64040 "onRedo-started": void 0, 64041 "onRedo-ended": void 0, 64042 "onCell-clicked": void 0, 64043 "onCell-double-clicked": void 0, 64044 "onCell-mouse-down": void 0, 64045 "onCell-context-menu": void 0, 64046 "onCell-value-changed": void 0, 64047 "onCell-edit-request": void 0, 64048 "onRow-value-changed": void 0, 64049 "onHeader-focused": void 0, 64050 "onCell-focused": void 0, 64051 "onRow-selected": void 0, 64052 "onSelection-changed": void 0, 64053 "onTooltip-show": void 0, 64054 "onTooltip-hide": void 0, 64055 "onCell-key-down": void 0, 64056 "onCell-mouse-over": void 0, 64057 "onCell-mouse-out": void 0, 64058 "onFilter-changed": void 0, 64059 "onFilter-modified": void 0, 64060 "onFilter-opened": void 0, 64061 "onAdvanced-filter-builder-visible-changed": void 0, 64062 "onSort-changed": void 0, 64063 "onVirtual-row-removed": void 0, 64064 "onRow-clicked": void 0, 64065 "onRow-double-clicked": void 0, 64066 "onGrid-ready": void 0, 64067 "onGrid-pre-destroyed": void 0, 64068 "onGrid-size-changed": void 0, 64069 "onViewport-changed": void 0, 64070 "onFirst-data-rendered": void 0, 64071 "onDrag-started": void 0, 64072 "onDrag-stopped": void 0, 64073 "onDrag-cancelled": void 0, 64074 "onRow-editing-started": void 0, 64075 "onRow-editing-stopped": void 0, 64076 "onCell-editing-started": void 0, 64077 "onCell-editing-stopped": void 0, 64078 "onBody-scroll": void 0, 64079 "onBody-scroll-end": void 0, 64080 "onPagination-changed": void 0, 64081 "onComponent-state-changed": void 0, 64082 "onStore-refreshed": void 0, 64083 "onState-updated": void 0, 64084 "onColumn-menu-visible-changed": void 0, 64085 "onContext-menu-visible-changed": void 0, 64086 "onRow-drag-enter": void 0, 64087 "onRow-drag-move": void 0, 64088 "onRow-drag-leave": void 0, 64089 "onRow-drag-end": void 0, 64090 "onRow-drag-cancel": void 0 64091 // @END_EVENT_PROPS@ 64092 }; 64093} 64094const mde = (e, t) => { 64095 let i; 64096 return () => { 64097 const s = function() { 64098 e(); 64099 }; 64100 window.clearTimeout(i), i = window.setTimeout(s, t); 64101 }; 64102}; 64103function vde(e) { 64104 return e && e.constructor && e.constructor.toString().substring(0, 5) === "class"; 64105} 64106function Du(e) { 64107 const t = (i) => Array.isArray(i) ? i.map((s) => t(s)) : SL(i) || X6(i) || J6(i) ? t(eU(i)) : i && typeof i == "object" && Object.keys(i).length > 0 ? Object.keys(i).reduce((s, n) => (s[n] = vde(i[n]) ? i[n] : t(i[n]), s), {}) : i; 64108 return t(e); 64109} 64110const yde = { ref: "root" }, N_ = /* @__PURE__ */ Mt({ 64111 __name: "AgGridVue", 64112 props: /* @__PURE__ */ md(/* @__PURE__ */ Q6({ 64113 gridOptions: {}, 64114 modules: {}, 64115 statusBar: {}, 64116 sideBar: { type: [Object, String, Array, Boolean, null] }, 64117 suppressContextMenu: { type: Boolean }, 64118 preventDefaultOnContextMenu: { type: Boolean }, 64119 allowContextMenuWithControlKey: { type: Boolean }, 64120 columnMenu: {}, 64121 suppressMenuHide: { type: Boolean }, 64122 enableBrowserTooltips: { type: Boolean }, 64123 tooltipTrigger: {}, 64124 tooltipShowDelay: {}, 64125 tooltipHideDelay: {}, 64126 tooltipMouseTrack: { type: Boolean }, 64127 tooltipShowMode: {}, 64128 tooltipInteraction: { type: Boolean }, 64129 popupParent: {}, 64130 copyHeadersToClipboard: { type: Boolean }, 64131 copyGroupHeadersToClipboard: { type: Boolean }, 64132 clipboardDelimiter: {}, 64133 suppressCopyRowsToClipboard: { type: Boolean }, 64134 suppressCopySingleCellRanges: { type: Boolean }, 64135 suppressLastEmptyLineOnPaste: { type: Boolean }, 64136 suppressClipboardPaste: { type: Boolean }, 64137 suppressClipboardApi: { type: Boolean }, 64138 suppressCutToClipboard: { type: Boolean }, 64139 columnDefs: {}, 64140 defaultColDef: {}, 64141 defaultColGroupDef: {}, 64142 columnTypes: {}, 64143 dataTypeDefinitions: {}, 64144 maintainColumnOrder: { type: Boolean }, 64145 enableStrictPivotColumnOrder: { type: Boolean }, 64146 suppressFieldDotNotation: { type: Boolean }, 64147 headerHeight: {}, 64148 groupHeaderHeight: {}, 64149 floatingFiltersHeight: {}, 64150 pivotHeaderHeight: {}, 64151 pivotGroupHeaderHeight: {}, 64152 allowDragFromColumnsToolPanel: { type: Boolean }, 64153 suppressMovableColumns: { type: Boolean }, 64154 suppressColumnMoveAnimation: { type: Boolean }, 64155 suppressMoveWhenColumnDragging: { type: Boolean }, 64156 suppressDragLeaveHidesColumns: { type: Boolean }, 64157 suppressGroupChangesColumnVisibility: { type: [Boolean, String] }, 64158 suppressMakeColumnVisibleAfterUnGroup: { type: Boolean }, 64159 suppressRowGroupHidesColumns: { type: Boolean }, 64160 colResizeDefault: {}, 64161 suppressAutoSize: { type: Boolean }, 64162 autoSizePadding: {}, 64163 skipHeaderOnAutoSize: { type: Boolean }, 64164 autoSizeStrategy: {}, 64165 components: {}, 64166 editType: {}, 64167 singleClickEdit: { type: Boolean }, 64168 suppressClickEdit: { type: Boolean }, 64169 readOnlyEdit: { type: Boolean }, 64170 stopEditingWhenCellsLoseFocus: { type: Boolean }, 64171 enterNavigatesVertically: { type: Boolean }, 64172 enterNavigatesVerticallyAfterEdit: { type: Boolean }, 64173 enableCellEditingOnBackspace: { type: Boolean }, 64174 undoRedoCellEditing: { type: Boolean }, 64175 undoRedoCellEditingLimit: {}, 64176 defaultCsvExportParams: {}, 64177 suppressCsvExport: { type: Boolean }, 64178 defaultExcelExportParams: {}, 64179 suppressExcelExport: { type: Boolean }, 64180 excelStyles: {}, 64181 quickFilterText: {}, 64182 cacheQuickFilter: { type: Boolean }, 64183 includeHiddenColumnsInQuickFilter: { type: Boolean }, 64184 quickFilterParser: { type: Function }, 64185 quickFilterMatcher: { type: Function }, 64186 applyQuickFilterBeforePivotOrAgg: { type: Boolean }, 64187 excludeChildrenWhenTreeDataFiltering: { type: Boolean }, 64188 enableAdvancedFilter: { type: Boolean }, 64189 alwaysPassFilter: { type: Function }, 64190 includeHiddenColumnsInAdvancedFilter: { type: Boolean }, 64191 advancedFilterParent: {}, 64192 advancedFilterBuilderParams: {}, 64193 suppressAdvancedFilterEval: { type: Boolean }, 64194 suppressSetFilterByDefault: { type: Boolean }, 64195 enableCharts: { type: Boolean }, 64196 chartThemes: {}, 64197 customChartThemes: {}, 64198 chartThemeOverrides: {}, 64199 chartToolPanelsDef: {}, 64200 chartMenuItems: { type: [Array, Function] }, 64201 loadingCellRenderer: {}, 64202 loadingCellRendererParams: {}, 64203 loadingCellRendererSelector: { type: Function }, 64204 localeText: {}, 64205 masterDetail: { type: Boolean }, 64206 keepDetailRows: { type: Boolean }, 64207 keepDetailRowsCount: {}, 64208 detailCellRenderer: {}, 64209 detailCellRendererParams: {}, 64210 detailRowHeight: {}, 64211 detailRowAutoHeight: { type: Boolean }, 64212 context: {}, 64213 dragAndDropImageComponent: {}, 64214 dragAndDropImageComponentParams: {},
64215 alignedGrids: { type: [Array, Function] }, 64216 tabIndex: {}, 64217 rowBuffer: {}, 64218 valueCache: { type: Boolean }, 64219 valueCacheNeverExpires: { type: Boolean }, 64220 enableCellExpressions: { type: Boolean }, 64221 suppressTouch: { type: Boolean }, 64222 suppressFocusAfterRefresh: { type: Boolean }, 64223 suppressBrowserResizeObserver: { type: Boolean }, 64224 suppressPropertyNamesCheck: { type: Boolean }, 64225 suppressChangeDetection: { type: Boolean }, 64226 debug: { type: Boolean }, 64227 loading: { type: Boolean }, 64228 overlayLoadingTemplate: {}, 64229 loadingOverlayComponent: {}, 64230 loadingOverlayComponentParams: {}, 64231 suppressLoadingOverlay: { type: Boolean }, 64232 overlayNoRowsTemplate: {}, 64233 noRowsOverlayComponent: {}, 64234 noRowsOverlayComponentParams: {}, 64235 suppressNoRowsOverlay: { type: Boolean }, 64236 pagination: { type: Boolean }, 64237 paginationPageSize: {}, 64238 paginationPageSizeSelector: { type: [Array, Boolean] }, 64239 paginationAutoPageSize: { type: Boolean }, 64240 paginateChildRows: { type: Boolean }, 64241 suppressPaginationPanel: { type: Boolean }, 64242 pivotMode: { type: Boolean }, 64243 pivotPanelShow: {}, 64244 pivotMaxGeneratedColumns: {}, 64245 pivotDefaultExpanded: {}, 64246 pivotColumnGroupTotals: {}, 64247 pivotRowTotals: {}, 64248 pivotSuppressAutoColumn: { type: Boolean }, 64249 suppressExpandablePivotGroups: { type: Boolean }, 64250 functionsReadOnly: { type: Boolean }, 64251 aggFuncs: {}, 64252 suppressAggFuncInHeader: { type: Boolean }, 64253 alwaysAggregateAtRootLevel: { type: Boolean }, 64254 aggregateOnlyChangedColumns: { type: Boolean }, 64255 suppressAggFilteredOnly: { type: Boolean }, 64256 removePivotHeaderRowWhenSingleValueColumn: { type: Boolean }, 64257 animateRows: { type: Boolean }, 64258 cellFlashDuration: {}, 64259 cellFadeDuration: {}, 64260 allowShowChangeAfterFilter: { type: Boolean }, 64261 domLayout: {}, 64262 ensureDomOrder: { type: Boolean }, 64263 enableRtl: { type: Boolean }, 64264 suppressColumnVirtualisation: { type: Boolean }, 64265 suppressMaxRenderedRowRestriction: { type: Boolean }, 64266 suppressRowVirtualisation: { type: Boolean }, 64267 rowDragManaged: { type: Boolean }, 64268 suppressRowDrag: { type: Boolean }, 64269 suppressMoveWhenRowDragging: { type: Boolean }, 64270 rowDragEntireRow: { type: Boolean }, 64271 rowDragMultiRow: { type: Boolean }, 64272 rowDragText: { type: Function }, 64273 fullWidthCellRenderer: {}, 64274 fullWidthCellRendererParams: {}, 64275 embedFullWidthRows: { type: Boolean }, 64276 groupDisplayType: {}, 64277 groupDefaultExpanded: {}, 64278 autoGroupColumnDef: {}, 64279 groupMaintainOrder: { type: Boolean }, 64280 groupSelectsChildren: { type: Boolean }, 64281 groupLockGroupColumns: {}, 64282 groupAggFiltering: { type: [Boolean, Function] }, 64283 groupTotalRow: { type: [String, Function] }, 64284 grandTotalRow: {}, 64285 suppressStickyTotalRow: { type: [Boolean, String] }, 64286 groupSuppressBlankHeader: { type: Boolean }, 64287 groupSelectsFiltered: { type: Boolean }, 64288 showOpenedGroup: { type: Boolean }, 64289 groupHideParentOfSingleChild: { type: [Boolean, String] }, 64290 groupRemoveSingleChildren: { type: Boolean }, 64291 groupRemoveLowestSingleChildren: { type: Boolean }, 64292 groupHideOpenParents: { type: Boolean }, 64293 groupAllowUnbalanced: { type: Boolean }, 64294 rowGroupPanelShow: {}, 64295 groupRowRenderer: {}, 64296 groupRowRendererParams: {}, 64297 treeData: { type: Boolean }, 64298 rowGroupPanelSuppressSort: { type: Boolean }, 64299 suppressGroupRowsSticky: { type: Boolean }, 64300 pinnedTopRowData: {}, 64301 pinnedBottomRowData: {}, 64302 rowModelType: {}, 64303 rowData: {}, 64304 asyncTransactionWaitMillis: {}, 64305 suppressModelUpdateAfterUpdateTransaction: { type: Boolean }, 64306 datasource: {}, 64307 cacheOverflowSize: {}, 64308 infiniteInitialRowCount: {}, 64309 serverSideInitialRowCount: {}, 64310 suppressServerSideFullWidthLoadingRow: { type: Boolean }, 64311 cacheBlockSize: {}, 64312 maxBlocksInCache: {}, 64313 maxConcurrentDatasourceRequests: {}, 64314 blockLoadDebounceMillis: {}, 64315 purgeClosedRowNodes: { type: Boolean }, 64316 serverSideDatasource: {}, 64317 serverSideSortAllLevels: { type: Boolean }, 64318 serverSideEnableClientSideSort: { type: Boolean }, 64319 serverSideOnlyRefreshFilteredGroups: { type: Boolean }, 64320 serverSidePivotResultFieldSeparator: {}, 64321 viewportDatasource: {}, 64322 viewportRowModelPageSize: {}, 64323 viewportRowModelBufferSize: {}, 64324 alwaysShowHorizontalScroll: { type: Boolean }, 64325 alwaysShowVerticalScroll: { type: Boolean }, 64326 debounceVerticalScrollbar: { type: Boolean }, 64327 suppressHorizontalScroll: { type: Boolean }, 64328 suppressScrollOnNewData: { type: Boolean }, 64329 suppressScrollWhenPopupsAreOpen: { type: Boolean }, 64330 suppressAnimationFrame: { type: Boolean }, 64331 suppressMiddleClickScrolls: { type: Boolean }, 64332 suppressPreventDefaultOnMouseWheel: { type: Boolean }, 64333 scrollbarWidth: {}, 64334 rowSelection: {}, 64335 cellSelection: { type: [Boolean, Object] },
64336 rowMultiSelectWithClick: { type: Boolean }, 64337 suppressRowDeselection: { type: Boolean }, 64338 suppressRowClickSelection: { type: Boolean }, 64339 suppressCellFocus: { type: Boolean }, 64340 suppressHeaderFocus: { type: Boolean }, 64341 selectionColumnDef: {}, 64342 suppressMultiRangeSelection: { type: Boolean }, 64343 enableCellTextSelection: { type: Boolean }, 64344 enableRangeSelection: { type: Boolean }, 64345 enableRangeHandle: { type: Boolean }, 64346 enableFillHandle: { type: Boolean }, 64347 fillHandleDirection: {}, 64348 suppressClearOnFillReduction: { type: Boolean }, 64349 sortingOrder: {}, 64350 accentedSort: { type: Boolean }, 64351 unSortIcon: { type: Boolean }, 64352 suppressMultiSort: { type: Boolean }, 64353 alwaysMultiSort: { type: Boolean }, 64354 multiSortKey: {}, 64355 suppressMaintainUnsortedOrder: { type: Boolean }, 64356 icons: {}, 64357 rowHeight: {}, 64358 rowStyle: {}, 64359 rowClass: {}, 64360 rowClassRules: {}, 64361 suppressRowHoverHighlight: { type: Boolean }, 64362 suppressRowTransform: { type: Boolean }, 64363 columnHoverHighlight: { type: Boolean }, 64364 gridId: {}, 64365 deltaSort: { type: Boolean }, 64366 treeDataDisplayType: {}, 64367 enableGroupEdit: { type: Boolean }, 64368 initialState: {}, 64369 theme: {}, 64370 loadThemeGoogleFonts: { type: Boolean }, 64371 getContextMenuItems: { type: Function }, 64372 getMainMenuItems: { type: Function }, 64373 postProcessPopup: { type: Function }, 64374 processUnpinnedColumns: { type: Function }, 64375 processCellForClipboard: { type: Function }, 64376 processHeaderForClipboard: { type: Function }, 64377 processGroupHeaderForClipboard: { type: Function }, 64378 processCellFromClipboard: { type: Function }, 64379 sendToClipboard: { type: Function }, 64380 processDataFromClipboard: { type: Function }, 64381 isExternalFilterPresent: { type: Function }, 64382 doesExternalFilterPass: { type: Function }, 64383 getChartToolbarItems: { type: Function }, 64384 createChartContainer: { type: Function }, 64385 focusGridInnerElement: { type: Function }, 64386 navigateToNextHeader: { type: Function }, 64387 tabToNextHeader: { type: Function }, 64388 navigateToNextCell: { type: Function }, 64389 tabToNextCell: { type: Function }, 64390 getLocaleText: { type: Function }, 64391 getDocument: { type: Function }, 64392 paginationNumberFormatter: { type: Function }, 64393 getGroupRowAgg: { type: Function }, 64394 isGroupOpenByDefault: { type: Function }, 64395 initialGroupOrderComparator: { type: Function }, 64396 processPivotResultColDef: { type: Function }, 64397 processPivotResultColGroupDef: { type: Function }, 64398 getDataPath: { type: Function }, 64399 getChildCount: { type: Function }, 64400 getServerSideGroupLevelParams: { type: Function }, 64401 isServerSideGroupOpenByDefault: { type: Function }, 64402 isApplyServerSideTransaction: { type: Function }, 64403 isServerSideGroup: { type: Function }, 64404 getServerSideGroupKey: { type: Function }, 64405 getBusinessKeyForNode: { type: Function }, 64406 getRowId: { type: Function }, 64407 resetRowDataOnUpdate: { type: Boolean }, 64408 processRowPostCreate: { type: Function }, 64409 isRowSelectable: { type: Function }, 64410 isRowMaster: { type: Function }, 64411 fillOperation: { type: Function }, 64412 postSortRows: { type: Function }, 64413 getRowStyle: { type: Function }, 64414 getRowClass: { type: Function }, 64415 getRowHeight: { type: Function }, 64416 isFullWidthRow: { type: Function }, 64417 "onTool-panel-visible-changed": {}, 64418 "onTool-panel-size-changed": {}, 64419 "onColumn-menu-visible-changed": {}, 64420 "onContext-menu-visible-changed": {}, 64421 "onCut-start": {}, 64422 "onCut-end": {}, 64423 "onPaste-start": {}, 64424 "onPaste-end": {}, 64425 "onColumn-visible": {}, 64426 "onColumn-pinned": {}, 64427 "onColumn-resized": {}, 64428 "onColumn-moved": {}, 64429 "onColumn-value-changed": {}, 64430 "onColumn-pivot-mode-changed": {}, 64431 "onColumn-pivot-changed": {}, 64432 "onColumn-group-opened": {}, 64433 "onNew-columns-loaded": {}, 64434 "onGrid-columns-changed": {}, 64435 "onDisplayed-columns-changed": {}, 64436 "onVirtual-columns-changed": {}, 64437 "onColumn-everything-changed": {}, 64438 "onColumn-header-mouse-over": {}, 64439 "onColumn-header-mouse-leave": {}, 64440 "onColumn-header-clicked": {}, 64441 "onColumn-header-context-menu": {}, 64442 "onComponent-state-changed": {}, 64443 "onCell-value-changed": {}, 64444 "onCell-edit-request": {}, 64445 "onRow-value-changed": {}, 64446 "onCell-editing-started": {}, 64447 "onCell-editing-stopped": {}, 64448 "onRow-editing-started": {}, 64449 "onRow-editing-stopped": {}, 64450 "onUndo-started": {}, 64451 "onUndo-ended": {}, 64452 "onRedo-started": {}, 64453 "onRedo-ended": {}, 64454 "onCell-selection-delete-start": {}, 64455 "onCell-selection-delete-end": {}, 64456 "onRange-delete-start": {}, 64457 "onRange-delete-end": {}, 64458 "onFill-start": {}, 64459 "onFill-end": {}, 64460 "onFilter-opened": {}, 64461 "onFilter-changed": {}, 64462 "onFilter-modified": {},
64463 "onAdvanced-filter-builder-visible-changed": {}, 64464 "onChart-created": {}, 64465 "onChart-range-selection-changed": {}, 64466 "onChart-options-changed": {}, 64467 "onChart-destroyed": {}, 64468 "onCell-key-down": {}, 64469 "onGrid-ready": {}, 64470 "onGrid-pre-destroyed": {}, 64471 "onFirst-data-rendered": {}, 64472 "onGrid-size-changed": {}, 64473 "onModel-updated": {}, 64474 "onVirtual-row-removed": {}, 64475 "onViewport-changed": {}, 64476 "onBody-scroll": {}, 64477 "onBody-scroll-end": {}, 64478 "onDrag-started": {}, 64479 "onDrag-stopped": {}, 64480 "onDrag-cancelled": {}, 64481 "onState-updated": {}, 64482 "onPagination-changed": {}, 64483 "onRow-drag-enter": {}, 64484 "onRow-drag-move": {}, 64485 "onRow-drag-leave": {}, 64486 "onRow-drag-end": {}, 64487 "onRow-drag-cancel": {}, 64488 "onColumn-row-group-changed": {}, 64489 "onRow-group-opened": {}, 64490 "onExpand-or-collapse-all": {}, 64491 "onPivot-max-columns-exceeded": {}, 64492 "onPinned-row-data-changed": {}, 64493 "onRow-data-updated": {}, 64494 "onAsync-transactions-flushed": {}, 64495 "onStore-refreshed": {}, 64496 "onHeader-focused": {}, 64497 "onCell-clicked": {}, 64498 "onCell-double-clicked": {}, 64499 "onCell-focused": {}, 64500 "onCell-mouse-over": {}, 64501 "onCell-mouse-out": {}, 64502 "onCell-mouse-down": {}, 64503 "onRow-clicked": {}, 64504 "onRow-double-clicked": {}, 64505 "onRow-selected": {}, 64506 "onSelection-changed": {}, 64507 "onCell-context-menu": {}, 64508 "onRange-selection-changed": {}, 64509 "onCell-selection-changed": {}, 64510 "onTooltip-show": {}, 64511 "onTooltip-hide": {}, 64512 "onSort-changed": {} 64513 }, fde()), { 64514 modelValue: {}, 64515 modelModifiers: {} 64516 }), 64517 emits: /* @__PURE__ */ md(["update:modelValue"], ["update:modelValue"]), 64518 setup(e, { expose: t, emit: i }) { 64519 const s = e, n = K6("root"), o = De(void 0), r = De(!1), a = De(!1), l = De(!1), c = De({}), u = De(null), d = Z6(s); 64520 uS.filter((k) => k != "gridOptions").forEach((k) => { 64521 Gn( 64522 () => d[k], 64523 (B, N) => { 64524 I(k, B); 64525 }, 64526 { deep: !0 } 64527 ); 64528 }); 64529 const p = /* @__PURE__ */ new Set(["rowDataUpdated", "cellValueChanged", "rowValueChanged"]), f = Dv(e, "modelValue"), m = De(!1), y = i; 64530 Gn( 64531 f, 64532 (k, B) => { 64533 r.value && (m.value = !0, I("rowData", Du(k), Du(B))); 64534 }, 64535 { deep: !0 } 64536 ); 64537 const b = mde(() => { 64538 y("update:modelValue", Du(M())); 64539 }, 20), C = (k) => { 64540 l.value && p.has(k) && b(); 64541 }, w = () => f.value || s.rowData || s.gridOptions.rowData, M = () => { 64542 const k = []; 64543 return o?.value.forEachNode((B) => { 64544 k.push(B.data); 64545 }), k; 64546 }, A = (k) => (B) => { 64547 if (a.value) 64548 return; 64549 B === "gridReady" && (l.value = !0); 64550 const N = fp.has(B); 64551 N && !k || !N && k || p.has(B) && (m.value || C(B), m.value = !1); 64552 }, I = (k, B, N) => { 64553 if (r.value) { 64554 let W = B.value || B; 64555 k === "rowData" && W != null && (W = Du(W)), c.value[k] = W, u.value == null && (u.value = window.setTimeout(() => { 64556 u.value = null, hX(c.value, o.value), c.value = {}; 64557 }, 0)); 64558 } 64559 }, L = () => Object.create(Pb().provides); 64560 return Cn(() => { 64561 uM.registerModules([F_]); 64562 const k = new hde(Pb(), L()), B = { 64563 globalListener: A(), 64564 globalSyncListener: A(!0), 64565 frameworkOverrides: new gde(Pb()), 64566 providedBeanInstances: { 64567 frameworkCompWrapper: k 64568 }, 64569 modules: s.modules 64570 }, N = q6( 64571 dX(Du(s.gridOptions), s, [ 64572 ...uS, 64573 ...c_.map((se) => oM(se)) 64574 ]) 64575 ), W = w(); 64576 W !== void 0 && (N.rowData = Du(W)), o.value = are(n.value, N, B), r.value = !0; 64577 }), Nd(() => { 64578 var k; 64579 r.value && ((k = o?.value) == null || k.destroy(), a.value = !0); 64580 }), t({ 64581 api: o 64582 }), (k, B) => (we(), Ne("div", yde, null, 512)); 64583 } 64584}); 64585uM.registerModules([O_]); 64586const Cde = IM.withPart(i_).withParams({ 64587 accentColor: "#1E90FA", 64588 backgroundColor: "#FFFFFF", 64589 borderColor: "#E0E0E0", 64590 borderRadius: "6px", 64591 browserColorScheme: "light", 64592 cellHorizontalPadding: "24px", 64593 cellHorizontalPaddingScale: 1, 64594 checkboxBorderRadius: "3px",
64595 checkboxCheckedBackgroundColor: "#1E90FA", 64596 checkboxCheckedBorderColor: "#1E90FA", 64597 checkboxCheckedShapeColor: "#FFFFFF", 64598 chromeBackgroundColor: "#FFFFFF", 64599 columnBorder: !1, 64600 columnDropCellBackgroundColor: "#FFFFFF", 64601 focusShadow: "#1E90FA80 0px 0px 0px 0px", 64602 fontFamily: ["Mulish", "sans-serif"], 64603 fontSize: "14px", 64604 footerRowBorder: !0, 64605 foregroundColor: "#2D2E30", 64606 headerHeight: 38, 64607 headerBackgroundColor: "#F4F6F8", 64608 headerRowBorder: !1, 64609 headerFontSize: "14px", 64610 headerFontWeight: 700, 64611 headerTextColor: "#2D2E30", 64612 headerVerticalPaddingScale: 0.5, 64613 iconButtonHoverColor: "#EDEEEF", 64614 menuBackgroundColor: "#FFFFFF", 64615 menuBorder: !1, 64616 menuSeparatorColor: "#E0E0E0", 64617 menuTextColor: "#2D2E30", 64618 rowBorder: !0, 64619 rowHeight: "50px", 64620 rowHoverColor: "#F4F6F8", 64621 rowVerticalPaddingScale: 0.75, 64622 selectedRowBackgroundColor: "#E1EBFF", 64623 sideBarBackgroundColor: "#FFFFFF", 64624 sidePanelBorder: !1, 64625 tooltipBackgroundColor: "#2D2E30", 64626 tooltipTextColor: "#FFFFFF", 64627 wrapperBorder: !1, 64628 wrapperBorderRadius: "6px", 64629 headerColumnResizeHandleColor: "#BDBDBD", 64630 headerColumnResizeHandleHeight: "16px", 64631 headerColumnResizeHandleWidth: "1px" 64632}), bde = {}, wde = { id: "frame-loader" }; 64633function Sde(e, t) { 64634 return we(), Ne("div", wde); 64635} 64636const __ = /* @__PURE__ */ ii(bde, [["render", Sde]]), xde = { 64637 key: 0, 64638 class: "loading-state" 64639}, Mde = { 64640 key: 2, 64641 class: "empty-state-container" 64642}, Ade = /* @__PURE__ */ Mt({ 64643 inheritAttrs: !1, 64644 __name: "engagement-grid", 64645 props: { 64646 linkId: {}, 64647 linkClicks: {}, 64648 isLoading: { type: Boolean } 64649 }, 64650 setup(e) { 64651 function t(o) { 64652 return o === void 0 ? "" : new Date(o).toLocaleDateString("en-US", { 64653 year: "numeric", 64654 month: "short", 64655 day: "numeric" 64656 }); 64657 } 64658 const i = e, s = [ 64659 { 64660 field: "timestamp", 64661 headerName: ge.engagementDateColumn, 64662 resizable: !1, 64663 sortable: !1, 64664 valueFormatter: (o) => t(o.value), 64665 cellRenderer: (o) => t(o.value) 64666 }, 64667 { 64668 field: "refSource", 64669 headerName: ge.engagementSourceColumn, 64670 sortable: !1, 64671 resizable: !1, 64672 cellRenderer: (o) => o.value || ge.noData 64673 }, 64674 { 64675 field: "region", 64676 headerName: ge.engagementRegionColumn, 64677 resizable: !1, 64678 sortable: !1, 64679 cellRenderer: (o) => o.value?.charAt(0).toUpperCase() + o.value?.slice(1) || ge.noData 64680 }, 64681 { 64682 field: "city", 64683 headerName: ge.engagementCityColumn, 64684 resizable: !1, 64685 sortable: !1, 64686 cellRenderer: (o) => o.value || ge.noData 64687 }, 64688 { 64689 field: "isMobile", 64690 headerName: ge.engagementMobileDeviceColumn, 64691 sortable: !1, 64692 resizable: !1, 64693 cellRenderer: (o) => o.value ? ge.yes : ge.no 64694 }, 64695 { 64696 field: "referrer", 64697 headerName: ge.engagementReferrerColumn, 64698 sortable: !1, 64699 resizable: !1, 64700 flex: 1, 64701 cellRenderer: (o) => o.value || ge.noData 64702 } 64703 ], n = Qe(() => ({ 64704 theme: Cde, 64705 columnDefs: s, 64706 domLayout: "normal", 64707 suppressCellFocus: !0, 64708 defaultColDef: { resizable: !0 }, 64709 class: "responses-grid", 64710 loading: i.isLoading, 64711 loadingOverlayComponent: __, 64712 popupParent: document.body.querySelector(".table-container") || document.body, 64713 popupPositioning: "under", 64714 alwaysShowHorizontalScroll: !0, 64715 rowData: i.linkClicks, 64716 suppressNoRowsOverlay: !1, 64717 suppressColumnHeaders: i.linkClicks.length === 0 64718 })); 64719 return (o, r) => (we(), Ne("div", { 64720 class: da([ 64721 i.linkClicks.length === 0 ? "clicks-grid-container empty-state" : "clicks-grid-container" 64722 ]) 64723 }, [ 64724 e.isLoading ? (we(), Ne("div", xde, [...r[0] || (r[0] = [ 64725 fe("div", { id: "frame-loader" }, null, -1) 64726 ])])) : e.isLoading ? di("", !0) : (we(), Wt(Z(N_), Ev({ 64727 key: 1, 64728 class: [e.isLoading ? "" : "ag-loaded"] 64729 }, n.value), null, 16, ["class"])), 64730 !e.isLoading && i.linkClicks.length === 0 ? (we(), Ne("div", Mde, [
64731 fe("span", null, ke(Z(ge).noClicks), 1) 64732 ])) : di("", !0) 64733 ], 2)); 64734 } 64735}), Dde = /* @__PURE__ */ ii(Ade, [["__scopeId", "data-v-8a43196c"]]), Ede = { 64736 key: 0, 64737 class: "pagination-controls" 64738}, Ide = { class: "pagination-info" }, Rde = { class: "pagination-buttons" }, Tde = ["disabled"], Lde = { class: "page-numbers" }, kde = ["onClick"], Pde = ["disabled"], Fde = /* @__PURE__ */ Mt({ 64739 __name: "ws-pagination", 64740 props: { 64741 currentPage: {}, 64742 pageSize: {}, 64743 totalCount: {}, 64744 totalPages: {}, 64745 hasNextPage: { type: Boolean }, 64746 hasPreviousPage: { type: Boolean } 64747 }, 64748 emits: ["page-change"], 64749 setup(e, { emit: t }) { 64750 const i = e, s = t, n = Qe(() => i.totalCount > 0 ? (i.currentPage - 1) * i.pageSize + 1 : 0), o = Qe(() => Math.min(i.currentPage * i.pageSize, i.totalCount)), r = Qe(() => { 64751 const l = []; 64752 if (i.totalPages <= 5) 64753 for (let u = 1; u <= i.totalPages; u++) 64754 l.push(u); 64755 else { 64756 const u = Math.max( 64757 1, 64758 i.currentPage - Math.floor(2.5) 64759 ), d = Math.min(i.totalPages, u + 5 - 1); 64760 for (let p = u; p <= d; p++) 64761 l.push(p); 64762 } 64763 return l; 64764 }), a = (l) => { 64765 l >= 1 && l <= i.totalPages && l !== i.currentPage && s("page-change", l); 64766 }; 64767 return (l, c) => e.totalPages > 1 ? (we(), Ne("div", Ede, [ 64768 fe("div", Ide, [ 64769 fe("span", null, ke(Z(ge).showing) + " " + ke(n.value) + "-" + ke(o.value) + " " + ke(Z(ge).of) + " " + ke(e.totalCount) + " " + ke(Z(ge).clicks), 1) 64770 ]), 64771 fe("div", Rde, [ 64772 fe("button", { 64773 class: "pagination-button", 64774 disabled: !e.hasPreviousPage, 64775 onClick: c[0] || (c[0] = (u) => a(e.currentPage - 1)) 64776 }, [...c[2] || (c[2] = [ 64777 fe("span", { class: "fa-light fa-chevron-left" }, null, -1) 64778 ])], 8, Tde), 64779 fe("div", Lde, [ 64780 (we(!0), Ne(yi, null, hs(r.value, (u) => (we(), Ne("button", { 64781 key: u, 64782 class: da(["page-number", { active: u === e.currentPage }]), 64783 onClick: (d) => a(u) 64784 }, ke(u), 11, kde))), 128)) 64785 ]), 64786 fe("button", { 64787 class: "pagination-button", 64788 disabled: !e.hasNextPage, 64789 onClick: c[1] || (c[1] = (u) => a(e.currentPage + 1)) 64790 }, [...c[3] || (c[3] = [ 64791 fe("span", { class: "fa-light fa-chevron-right" }, null, -1) 64792 ])], 8, Pde) 64793 ]) 64794 ])) : di("", !0); 64795 } 64796}), Ode = /* @__PURE__ */ ii(Fde, [["__scopeId", "data-v-36cc1e07"]]), Nde = { class: "engagement-container" }, _de = /* @__PURE__ */ Mt({ 64797 __name: "engagement-container", 64798 props: { 64799 linkId: {} 64800 }, 64801 emits: ["clicks-update"], 64802 setup(e, { emit: t }) { 64803 const i = e, s = t, n = De(1), o = De(50), r = De(0), a = De(0), l = De(!1), c = De(!1), u = De([]), d = De(!0), p = async (m = 1) => { 64804 try { 64805 d.value = !0; 64806 const y = await wt.getLinkClicksSummary({ 64807 linkId: i.linkId, 64808 page: m, 64809 pageSize: o.value 64810 }); 64811 return u.value = y.linkClicks || [], r.value = y.totalCount || 0, a.value = y.totalPages || 0, n.value = y.currentPage || 1, l.value = y.hasNextPage || !1, c.value = y.hasPreviousPage || !1, !0; 64812 } catch (y) { 64813 return console.error("Failed to load link clicks:", y), qt({ 64814 aid: "LINK_CLICKS_LOAD_ERROR", 64815 message: ge.fetchLinkClicksError, 64816 status: ri.Error 64817 }), !1; 64818 } finally { 64819 d.value = !1; 64820 } 64821 }, f = (m) => { 64822 m >= 1 && m <= a.value && m !== n.value && p(m); 64823 }; 64824 return Gn( 64825 () => i.linkId, 64826 () => { 64827 i.linkId && (n.value = 1, p(1)); 64828 } 64829 ), Gn( 64830 r, 64831 (m) => { 64832 s("clicks-update", m); 64833 }, 64834 { immediate: !0 } 64835 ), Cn(async () => { 64836 try { 64837 await wt.init(bc()), await p(1) && gr({ 64838 eventName: "link_clicks_list_load", 64839 metadata: { 64840 label: "link_clicks", 64841 action: "load", 64842 category: es 64843 } 64844 }); 64845 } catch (m) { 64846 console.error("Failed to initialize links gateway:", m); 64847 } 64848 }), (m, y) => (we(), Ne("div", Nde, [ 64849 Re(Dde, { 64850 "link-id": i.linkId, 64851 "link-clicks": u.value, 64852 "is-loading": d.value 64853 }, null, 8, ["link-id", "link-clicks", "is-loading"]), 64854 d.value ? di("", !0) : (we(), Wt(Ode, { 64855 key: 0, 64856 "current-page": n.value, 64857 "page-size": o.value, 64858 "total-count": r.value, 64859 "total-pages": a.value, 64860 "has-next-page": l.value, 64861 "has-previous-page": c.value, 64862 onPageChange: f 64863 }, null, 8, ["current-page", "page-size", "total-count", "total-pages", "has-next-page", "has-previous-page"])) 64864 ])); 64865 } 64866}), Bde = /* @__PURE__ */ ii(_de, [["__scopeId", "data-v-04ab5e81"]]); 64867function In(e, t) { 64868 gr({ eventName: e, metadata: t }); 64869} 64870function Gu(e, t) { 64871 In(e, { 64872 label: t, 64873 action: "click", 64874 category: es 64875 }); 64876} 64877function Gde(e, t) { 64878 In(e, { 64879 label: t, 64880 action: "load", 64881 category: es 64882 }); 64883} 64884function zde(e) { 64885 In("link_created_success", { 64886 label: "add_link", 64887 action: "success", 64888 category: es, 64889 ...e 64890 }); 64891} 64892function Hde(e) { 64893 In("link_updated_success", { 64894 label: "edit_link", 64895 action: "success", 64896 category: es, 64897 ...e 64898 }); 64899} 64900function Vde(e) { 64901 In("link_deleted_success", { 64902 label: "delete_link", 64903 action: "success", 64904 category: es, 64905 ...e 64906 }); 64907} 64908function Ude(e) { 64909 In("link_owner_changed_success", { 64910 label: "change_link_owner", 64911 action: "success", 64912 category: es, 64913 ...e 64914 }); 64915} 64916function Wde(e) { 64917 In("qr_downloaded", { 64918 label: "link_download_qr", 64919 action: "success", 64920 category: es, 64921 format: e 64922 }); 64923}
64924function jde() { 64925 Gde("qr_editor_page_load", "qr_editor"); 64926} 64927function $de(e) { 64928 In("qr_editor_saved", { 64929 label: "qr_editor", 64930 action: "success", 64931 category: es, 64932 ...e 64933 }); 64934} 64935function Yde(e) { 64936 In("link_analytics_tab_changed", { 64937 label: "link_details", 64938 action: "click", 64939 category: es, 64940 tab: e 64941 }); 64942} 64943function B_(e, t) { 64944 In("link_analytics_export_success", { 64945 label: "link_export_report", 64946 action: "success", 64947 category: es, 64948 source: e, 64949 ...t 64950 }); 64951} 64952function Kde(e) { 64953 In("link_analytics_export_failed", { 64954 label: "link_export_report", 64955 action: "error", 64956 category: es, 64957 source: e 64958 }); 64959} 64960function G_(e) { 64961 In("link_copied_success", { 64962 label: "link_get_link", 64963 action: "success", 64964 category: es, 64965 source: e 64966 }); 64967} 64968function z_(e, t) { 64969 In("quota_limit_prompt_shown", { 64970 label: "quota_limit", 64971 action: "load", 64972 category: es, 64973 origin: e, 64974 limit_type: t 64975 }); 64976} 64977function H_(e, t) { 64978 In("quota_limit_prompt_dismissed", { 64979 label: "quota_limit", 64980 action: "click", 64981 category: es, 64982 origin: e, 64983 limit_type: t 64984 }); 64985} 64986const Zde = { class: "sticky" }, qde = { class: "header" }, Qde = /* @__PURE__ */ Mt({ 64987 __name: "link-analytics-page", 64988 setup(e) { 64989 const i = IS().params.linkId, s = De(void 0), n = De(Ih.OVERVIEW), o = De(0), r = [ 64990 { key: Ih.OVERVIEW, title: ge.overviewTabTitle }, 64991 { key: Ih.ENGAGEMENT, title: ge.engagementTabTitle } 64992 ], a = Qe(() => o.value === 0); 64993 async function l() { 64994 try { 64995 const b = (await wt.list({})).links?.find((C) => C.id === i); 64996 b && (s.value = b.title); 64997 } catch (y) { 64998 console.error("Failed to fetch link name", y); 64999 } 65000 } 65001 Cn(async () => { 65002 await wt.init(bc()), await l(), gr({ 65003 eventName: "link_details_page_load", 65004 metadata: { 65005 label: "link_details", 65006 action: "load", 65007 category: es 65008 } 65009 }); 65010 }); 65011 const c = () => { 65012 bl("/v1/links"); 65013 }, u = (y) => { 65014 y !== n.value && Yde(y), n.value = y; 65015 }, d = (y) => { 65016 o.value = y; 65017 }, p = async (y, b = 1, C = []) => { 65018 const w = await wt.getReport({ linkId: y.id, page: b }); 65019 return C = C.concat(w.reportData || []), w.totalEntries && w.totalEntries > b * AL && (C = await p(y, b + 1, C)), C; 65020 }; 65021 function f(y, b) { 65022 const C = ge.csvReportColumnTitles, w = Object.keys(y[0]).map((k) => `"${C[k]}"`).join(",") + ` 65023`, M = y.map((k) => { 65024 if (k.source = k.source == "qr-code" ? ge.qrCodeSource : ge.linkSource, k.dateTime) { 65025 const B = new Date(k.dateTime); 65026 k.dateTime = B.toLocaleDateString("en-GB", { 65027 year: "numeric", 65028 month: "2-digit", 65029 day: "2-digit", 65030 hour12: !1, 65031 hour: "2-digit", 65032 minute: "2-digit", 65033 second: "2-digit" 65034 }); 65035 } 65036 return Object.values(k).map((B) => B === !0 || B === !1 ? B ? ge.yes : ge.no : `"${B}"`).toString(); 65037 }).join(` 65038`), A = new Blob(["\uFEFF" + w + M], { 65039 type: "text/csv;charset=utf-8" 65040 }), I = document.createElement("a"); 65041 I.setAttribute("download", `${b.title}_link_report.csv`); 65042 const L = URL.createObjectURL(A); 65043 I.setAttribute("href", L), I.click(); 65044 } 65045 const m = async () => { 65046 try { 65047 const y = await wt.list({ includeAnalytics: !0 }), b = y.links?.find((I) => I.id === i); 65048 if (!b) return; 65049 const w = (y.clicks || []).find((I) => I.linkId === i); 65050 if (!w || !w.clicks || w.clicks === 0) return; 65051 let M = []; 65052 const A = qt({ 65053 status: ri.Loading, 65054 message: ge.downloadStarted, 65055 aid: "EXPORT_REPORT_STARTED" 65056 }); 65057 M = await p(b, 1, M), A.dismiss(), qt({ 65058 message: ge.downloadCompleted, 65059 aid: "EXPORT_REPORT_COMPLETED" 65060 }), f(M || [], b), B_("analytics_page", { 65061 click_count: String(w.clicks ?? 0) 65062 }); 65063 } catch (y) { 65064 console.error("Failed to export report", y), Kde("analytics_page"), qt({ 65065 message: "Failed to export report", 65066 aid: "EXPORT_REPORT_ERROR", 65067 status: ri.Error 65068 }); 65069 } 65070 }; 65071 return (y, b) => (we(), Ne(yi, null, [ 65072 fe("div", Zde, [ 65073 fe("div", qde, [ 65074 fe("span", { 65075 class: "header-analytics-text", 65076 onClick: c 65077 }, [ 65078 b[0] || (b[0] = fe("span", { class: "fa-light fa-arrow-left" }, null, -1)), 65079 ut(" " + ke(s.value), 1) 65080 ]), 65081 Re(Z(Xs), { 65082 aid: "EXPORT_REPORT_BUTTON", 65083 color: "primary", 65084 size: "sm", 65085 disabled: a.value, 65086 onClick: m 65087 }, { 65088 default: Ve(() => [ 65089 ut(ke(Z(ge).exportReportButton), 1) 65090 ]), 65091 _: 1 65092 }, 8, ["disabled"]) 65093 ]), 65094 Re(xW, { 65095 "tab-items": r, 65096 "selected-tab-key": n.value, 65097 page: "link-analytics",
65098 "show-counter": !0, 65099 onChangeTab: u 65100 }, null, 8, ["selected-tab-key"]) 65101 ]), 65102 n.value === Z(Ih).OVERVIEW ? (we(), Wt(yQ, { 65103 key: 0, 65104 "link-id": Z(i), 65105 onClicksUpdate: d 65106 }, null, 8, ["link-id"])) : n.value === Z(Ih).ENGAGEMENT ? (we(), Wt(Bde, { 65107 key: 1, 65108 "link-id": Z(i), 65109 onClicksUpdate: d 65110 }, null, 8, ["link-id"])) : di("", !0) 65111 ], 64)); 65112 } 65113}), Xde = /* @__PURE__ */ ii(Qde, [["__scopeId", "data-v-c53053ac"]]), Jde = {}, ehe = { class: "links-container" }; 65114function the(e, t) { 65115 const i = xL("RouterView"); 65116 return we(), Ne("div", ehe, [ 65117 Re(i) 65118 ]); 65119} 65120const ihe = /* @__PURE__ */ ii(Jde, [["render", the], ["__scopeId", "data-v-9f854f86"]]), Tg = "ws1/user-gateway", she = Tg + "/user-profile", nhe = Tg + "/organization", ohe = Tg + "/bi-analytics"; 65121var xT; 65122(function(e) { 65123 e.expired = "EXPIRED", e.grace = "GRACE", e.active = "ACTIVE", e.cancelled = "CANCELLED", e.soloPro = "pro", e.soloFree = "free", e.trialActive = "TRIAL-ACTIVE", e.trialExpired = "TRIAL-EXPIRED"; 65124})(xT || (xT = {})); 65125var MT; 65126(function(e) { 65127 e.GATEWAY_ERROR_MISSING_AUTH_DATA = "accountId or userId are missing", e.GATEWAY_ERROR_MISSING_REQUIRED_DATA = "required data is missing", e.GATEWAY_ERROR_INVALID_ACCOUNT_STATE_FOR_ONBOARDING = "invalid account state for onboarding", e.GATEWAY_ERROR_FAILED_TO_CREATE_BILLING_ACCOUNT = "failed to create billing account", e.GATEWAY_ERROR_FAILED_TO_CREATE_SUBSCRIPTION = "failed to create subscription", e.GATEWAY_ERROR_SET_WORKSPACE_FAILED = "set workspace failed", e.BRIDGE_SERVER_ERROR_UPDATE_BASIC_INFO = "update basic info bridge error", e.BRIDGE_SERVER_ERROR_SET_ACCOUNT_TYPE = "set account type bridge error", e.BRIDGE_SERVER_ERROR_COMPLETE_SETUP = "complete setup bridge error", e.BRIDGE_SERVER_ERROR_REMOVE_ORGANIZATION = "remove organization bridge error", e.ORGANIZATION_COUNT_ERROR_REMOVE_ORGANIZATION = "remove organization count of organization less then two", e.BRIDGE_SERVER_ERROR_COMPLETE_SETUP_STAGE = "complete setup stage bridge error", e.SERVER_ERROR_CREATE_ORGANIZATION = "create organization error", e.LIMIT_ERROR_CREATE_ORGANIZATION = "create organization limit error", e.ORGANIZATION_NAME_ALREADY_EXISTS = "organization name already exists", e.SERVER_ERROR_SET_DEFAULT_ORGANIZATION = "set default organization error", e.GATEWAY_ERROR_USER_NOT_FOUND = "user not found"; 65128})(MT || (MT = {})); 65129var AT; 65130(function(e) { 65131 e[e.EXPERIENCE_STATE_UNSPECIFIED = 0] = "EXPERIENCE_STATE_UNSPECIFIED", e[e.STANDARD = 1] = "STANDARD", e[e.GENERATOR_PRO = 2] = "GENERATOR_PRO", e[e.GENERATOR_ORGANIZATION = 3] = "GENERATOR_ORGANIZATION", e[e.STANDARD_WEBMAIL = 4] = "STANDARD_WEBMAIL"; 65132})(AT || (AT = {})); 65133const rhe = [ 65134 "accountBasicInfo", 65135 "getAccountLimits" 65136], ahe = [ 65137 "reportAnonymousUserAnalyticEvent", 65138 "reportRegisteredUserAnalyticEvent" 65139]; 65140var DT; 65141(function(e) { 65142 e[e.MICROSOFT = 0] = "MICROSOFT", e[e.GOOGLE = 1] = "GOOGLE", e[e.OTHER = 2] = "OTHER"; 65143})(DT || (DT = {})); 65144const lhe = [ 65145 "getOrganizationsList", 65146 "removeOrganization", 65147 "createOrganization", 65148 "setDefaultOrganization" 65149]; 65150var ET; 65151(function(e) { 65152 e[e.Success = 0] = "Success", e[e.UserNotFound = 1] = "UserNotFound", e[e.InternalError = 2] = "InternalError", e[e.InvalidRequest = 3] = "InvalidRequest"; 65153})(ET || (ET = {})); 65154var IT; 65155(function(e) { 65156 e[e.Success = 0] = "Success", e[e.EmailAlreadyInUse = 1] = "EmailAlreadyInUse", e[e.InvalidPassword = 2] = "InvalidPassword", e[e.UserNotFound = 3] = "UserNotFound", e[e.InvalidData = 4] = "InvalidData", e[e.InternalError = 5] = "InternalError"; 65157})(IT || (IT = {})); 65158var RT; 65159(function(e) { 65160 e[e.TooExpensive = 0] = "TooExpensive", e[e.CouldntFindTemplateILike = 1] = "CouldntFindTemplateILike", e[e.MissingFeatureCustomizationOption = 2] = "MissingFeatureCustomizationOption", e[e.TooDifficultToUse = 3] = "TooDifficultToUse", e[e.SignatureDidntInsertProperly = 4] = "SignatureDidntInsertProperly", e[e.FoundBetterSolution = 5] = "FoundBetterSolution", e[e.Other = 6] = "Other"; 65161})(RT || (RT = {})); 65162var TT; 65163(function(e) { 65164 e[e.Success = 0] = "Success", e[e.InvalidPassword = 1] = "InvalidPassword", e[e.UserNotFound = 2] = "UserNotFound", e[e.AccessDenied = 3] = "AccessDenied"; 65165})(TT || (TT = {})); 65166const che = [ 65167 "getProfile", 65168 "updateProfile", 65169 "deleteAccount" 65170], uhe = [ 65171 "convertSoloToTeams", 65172 "convertPersonalSignaturesToOrganization" 65173], LT = Il({ 65174 baseRoute: Tg, 65175 methods: rhe, 65176 sdkPackageName: "@msl/user-gateway-sdk", 65177 requireAuth: !0 65178}); 65179Il({ 65180 baseRoute: nhe, 65181 methods: lhe, 65182 sdkPackageName: "@msl/user-gateway-sdk", 65183 requireAuth: !0 65184}); 65185Il({ 65186 baseRoute: she, 65187 methods: che, 65188 sdkPackageName: "@msl/user-gateway-sdk", 65189 requireAuth: !0 65190}); 65191Il({ 65192 baseRoute: Tg, 65193 methods: uhe, 65194 sdkPackageName: "@msl/user-gateway-sdk", 65195 requireAuth: !0 65196}); 65197Il({ 65198 baseRoute: ohe, 65199 methods: ahe, 65200 sdkPackageName: "@msl/user-gateway-sdk", 65201 requireAuth: ["reportRegisteredUserAnalyticEvent"] 65202}); 65203var qf = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; 65204function V_(e) {
65205 return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; 65206} 65207var z0, kT; 65208function dhe() { 65209 if (kT) return z0; 65210 kT = 1, z0 = s; 65211 var e = /^(?:\w+:)?\/\/(\S+)$/, t = /^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/, i = /^[^\s\.]+\.\S{2,}$/; 65212 function s(n) { 65213 if (typeof n != "string") 65214 return !1; 65215 var o = n.match(e); 65216 if (!o) 65217 return !1; 65218 var r = o[1]; 65219 return r ? !!(t.test(r) || i.test(r)) : !1; 65220 } 65221 return z0; 65222} 65223var hhe = dhe(); 65224const PT = /* @__PURE__ */ V_(hhe); 65225var jh = { exports: {} }; 65226var phe = jh.exports, FT; 65227function ghe() { 65228 return FT || (FT = 1, (function(e, t) { 65229 (function() { 65230 var i, s = "4.18.0", n = 200, o = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", r = "Expected a function", a = "Invalid `variable` option passed into `_.template`", l = "Invalid `imports` option passed into `_.template`", c = "__lodash_hash_undefined__", u = 500, d = "__lodash_placeholder__", p = 1, f = 2, m = 4, y = 1, b = 2, C = 1, w = 2, M = 4, A = 8, I = 16, L = 32, k = 64, B = 128, N = 256, W = 512, se = 30, ue = "...", Ce = 800, te = 16, q = 1, $ = 2, T = 3, E = 1 / 0, P = 9007199254740991, G = 17976931348623157e292, _ = NaN, K = 4294967295, ce = K - 1, ae = K >>> 1, be = [ 65231 ["ary", B], 65232 ["bind", C], 65233 ["bindKey", w], 65234 ["curry", A], 65235 ["curryRight", I], 65236 ["flip", W], 65237 ["partial", L], 65238 ["partialRight", k], 65239 ["rearg", N] 65240 ], oe = "[object Arguments]", U = "[object Array]", j = "[object AsyncFunction]", J = "[object Boolean]", ne = "[object Date]", me = "[object DOMException]", V = "[object Error]", X = "[object Function]", H = "[object GeneratorFunction]", Q = "[object Map]", re = "[object Number]", Se = "[object Null]", Le = "[object Object]", ze = "[object Promise]", Ke = "[object Proxy]", st = "[object RegExp]", tt = "[object Set]", Zt = "[object String]", Ot = "[object Symbol]", lt = "[object Undefined]", at = "[object WeakMap]", Ue = "[object WeakSet]", Nt = "[object ArrayBuffer]", _t = "[object DataView]", Xe = "[object Float32Array]", ss = "[object Float64Array]", Wi = "[object Int8Array]", Bi = "[object Int16Array]", Pa = "[object Int32Array]", Pr = "[object Uint8Array]", ks = "[object Uint8ClampedArray]", yC = "[object Uint16Array]", CC = "[object Uint32Array]", l4 = /\b__p \+= '';/g, c4 = /\b(__p \+=) '' \+/g, u4 = /(__e\(.*?\)|\b__t\)) \+\n'';/g, oA = /&(?:amp|lt|gt|quot|#39);/g, rA = /[&<>"']/g, d4 = RegExp(oA.source), h4 = RegExp(rA.source), p4 = /<%-([\s\S]+?)%>/g, g4 = /<%([\s\S]+?)%>/g, aA = /<%=([\s\S]+?)%>/g, f4 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, m4 = /^\w*$/, v4 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, bC = /[\\^$.*+?()[\]{}|]/g, y4 = RegExp(bC.source), wC = /^\s+/, C4 = /\s/, b4 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, w4 = /\{\n\/\* \[wrapped with (.+)\] \*/, S4 = /,? & /, x4 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, lA = /[()=,{}\[\]\/\s]/, M4 = /\\(\\)?/g, A4 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, cA = /\w*$/, D4 = /^[-+]0x[0-9a-f]+$/i, E4 = /^0b[01]+$/i, I4 = /^\[object .+?Constructor\]$/, R4 = /^0o[0-7]+$/i, T4 = /^(?:0|[1-9]\d*)$/, L4 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 5,774 bytes, lines 65240-65439
652407f]/g, Fg = /($^)/, k4 = /['\n\r\u2028\u2029\\]/g, Og = "\\ud800-\\udfff", P4 = "\\u0300-\\u036f", F4 = "\\ufe20-\\ufe2f", O4 = "\\u20d0-\\u20ff", uA = P4 + F4 + O4, dA = "\\u2700-\\u27bf", hA = "a-z\\xdf-\\xf6\\xf8-\\xff", N4 = "\\xac\\xb1\\xd7\\xf7", _4 = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", B4 = "\\u2000-\\u206f", G4 = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", pA = "A-Z\\xc0-\\xd6\\xd8-\\xde", gA = "\\ufe0e\\ufe0f", fA = N4 + _4 + B4 + G4, SC = "['â]", z4 = "[" + Og + "]", mA = "[" + fA + "]", Ng = "[" + uA + "]", vA = "\\d+", H4 = "[" + dA + "]", yA = "[" + hA + "]", CA = "[^" + Og + fA + vA + dA + hA + pA + "]", xC = "\\ud83c[\\udffb-\\udfff]", V4 = "(?:" + Ng + "|" + xC + ")", bA = "[^" + Og + "]", MC = "(?:\\ud83c[\\udde6-\\uddff]){2}", AC = "[\\ud800-\\udbff][\\udc00-\\udfff]", ou = "[" + pA + "]", wA = "\\u200d", SA = "(?:" + yA + "|" + CA + ")", U4 = "(?:" + ou + "|" + CA + ")", xA = "(?:" + SC + "(?:d|ll|m|re|s|t|ve))?", MA = "(?:" + SC + "(?:D|LL|M|RE|S|T|VE))?", AA = V4 + "?", DA = "[" + gA + "]?", W4 = "(?:" + wA + "(?:" + [bA, MC, AC].join("|") + ")" + DA + AA + ")*", j4 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", $4 = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", EA = DA + AA + W4, Y4 = "(?:" + [H4, MC, AC].join("|") + ")" + EA, K4 = "(?:" + [bA + Ng + "?", Ng, MC, AC, z4].join("|") + ")", Z4 = RegExp(SC, "g"), q4 = RegExp(Ng, "g"), DC = RegExp(xC + "(?=" + xC + ")|" + K4 + EA, "g"), Q4 = RegExp([ 65241 ou + "?" + yA + "+" + xA + "(?=" + [mA, ou, "$"].join("|") + ")", 65242 U4 + "+" + MA + "(?=" + [mA, ou + SA, "$"].join("|") + ")", 65243 ou + "?" + SA + "+" + xA, 65244 ou + "+" + MA, 65245 $4, 65246 j4, 65247 vA, 65248 Y4 65249 ].join("|"), "g"), X4 = RegExp("[" + wA + Og + uA + gA + "]"), J4 = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, eB = [ 65250 "Array", 65251 "Buffer", 65252 "DataView", 65253 "Date", 65254 "Error", 65255 "Float32Array", 65256 "Float64Array", 65257 "Function", 65258 "Int8Array", 65259 "Int16Array", 65260 "Int32Array", 65261 "Map", 65262 "Math", 65263 "Object", 65264 "Promise", 65265 "RegExp", 65266 "Set", 65267 "String", 65268 "Symbol", 65269 "TypeError", 65270 "Uint8Array", 65271 "Uint8ClampedArray", 65272 "Uint16Array", 65273 "Uint32Array", 65274 "WeakMap", 65275 "_", 65276 "clearTimeout", 65277 "isFinite", 65278 "parseInt", 65279 "setTimeout" 65280 ], tB = -1, li = {}; 65281 li[Xe] = li[ss] = li[Wi] = li[Bi] = li[Pa] = li[Pr] = li[ks] = li[yC] = li[CC] = !0, li[oe] = li[U] = li[Nt] = li[J] = li[_t] = li[ne] = li[V] = li[X] = li[Q] = li[re] = li[Le] = li[st] = li[tt] = li[Zt] = li[at] = !1; 65282 var ni = {}; 65283 ni[oe] = ni[U] = ni[Nt] = ni[_t] = ni[J] = ni[ne] = ni[Xe] = ni[ss] = ni[Wi] = ni[Bi] = ni[Pa] = ni[Q] = ni[re] = ni[Le] = ni[st] = ni[tt] = ni[Zt] = ni[Ot] = ni[Pr] = ni[ks] = ni[yC] = ni[CC] = !0, ni[V] = ni[X] = ni[at] = !1; 65284 var iB = { 65285 // Latin-1 Supplement block. 65286 Ã: "A", 65287 Ã: "A", 65288 Ã: "A", 65289 Ã: "A", 65290 Ã: "A", 65291 à : "A", 65292 à : "a", 65293 á: "a", 65294 â: "a", 65295 ã: "a", 65296 ä: "a", 65297 Ã¥: "a", 65298 Ã: "C", 65299 ç: "c", 65300 Ã: "D", 65301 ð: "d", 65302 Ã: "E", 65303 Ã: "E", 65304 Ã: "E", 65305 Ã: "E", 65306 è: "e", 65307 é: "e", 65308 ê: "e", 65309 ë: "e", 65310 Ã: "I", 65311 Ã: "I", 65312 Ã: "I", 65313 Ã: "I", 65314 ì: "i", 65315 Ã: "i", 65316 î: "i", 65317 ï: "i", 65318 Ã: "N", 65319 ñ: "n", 65320 Ã: "O", 65321 Ã: "O", 65322 Ã: "O", 65323 Ã: "O", 65324 Ã: "O", 65325 Ã: "O", 65326 ò: "o", 65327 ó: "o", 65328 ô: "o", 65329 õ: "o", 65330 ö: "o", 65331 ø: "o", 65332 Ã: "U", 65333 Ã: "U", 65334 Ã: "U", 65335 Ã: "U", 65336 ù: "u", 65337 ú: "u", 65338 û: "u", 65339 ü: "u", 65340 Ã: "Y", 65341 ý: "y", 65342 ÿ: "y", 65343 Ã: "Ae", 65344 æ: "ae", 65345 Ã: "Th", 65346 þ: "th", 65347 Ã: "ss", 65348 // Latin Extended-A block. 65349 Ä: "A", 65350 Ä: "A", 65351 Ä: "A", 65352 Ä: "a", 65353 Ä: "a", 65354 Ä : "a", 65355 Ä: "C", 65356 Ä: "C", 65357 Ä: "C", 65358 Ä: "C", 65359 Ä: "c", 65360 Ä: "c", 65361 Ä: "c", 65362 Ä: "c", 65363 Ä: "D", 65364 Ä: "D", 65365 Ä: "d", 65366 Ä: "d", 65367 Ä: "E", 65368 Ä: "E", 65369 Ä: "E", 65370 Ä: "E", 65371 Ä: "E", 65372 Ä: "e", 65373 Ä: "e", 65374 Ä: "e", 65375 Ä: "e", 65376 Ä: "e", 65377 Ä: "G", 65378 Ä: "G", 65379 Ä : "G", 65380 Ä¢: "G", 65381 Ä: "g", 65382 Ä: "g", 65383 Ä¡: "g", 65384 Ä£: "g", 65385 Ĥ: "H", 65386 Ħ: "H", 65387 Ä¥: "h", 65388 ħ: "h", 65389 Ĩ: "I", 65390 Ī: "I", 65391 Ĭ: "I", 65392 Ä®: "I", 65393 İ: "I", 65394 Ä©: "i", 65395 Ä«: "i", 65396 Ä: "i", 65397 į: "i", 65398 ı: "i", 65399 Ä´: "J", 65400 ĵ: "j", 65401 Ķ: "K", 65402 Ä·: "k", 65403 ĸ: "k", 65404 Ĺ: "L", 65405 Ä»: "L", 65406 Ľ: "L", 65407 Ä¿: "L", 65408 Å: "L", 65409 ĺ: "l", 65410 ļ: "l", 65411 ľ: "l", 65412 Å: "l", 65413 Å: "l", 65414 Å: "N", 65415 Å : "N", 65416 Å: "N", 65417 Å: "N", 65418 Å: "n", 65419 Å: "n", 65420 Å: "n", 65421 Å: "n", 65422 Å: "O", 65423 Å: "O", 65424 Å: "O", 65425 Å: "o", 65426 Å: "o", 65427 Å: "o", 65428 Å: "R", 65429 Å: "R", 65430 Å: "R", 65431 Å: "r", 65432 Å: "r", 65433 Å: "r", 65434 Å: "S", 65435 Å: "S", 65436 Å: "S", 65437 Å : "S", 65438 Å: "s", 65439 Å: "s",
vendor: 7,011 bytes, lines 65440-65686
65440 Å: "s", 65441 Å¡: "s", 65442 Å¢: "T", 65443 Ť: "T", 65444 Ŧ: "T", 65445 Å£: "t", 65446 Å¥: "t", 65447 ŧ: "t", 65448 Ũ: "U", 65449 Ū: "U", 65450 Ŭ: "U", 65451 Å®: "U", 65452 Ű: "U", 65453 Ų: "U", 65454 Å©: "u", 65455 Å«: "u", 65456 Å: "u", 65457 ů: "u", 65458 ű: "u", 65459 ų: "u", 65460 Å´: "W", 65461 ŵ: "w", 65462 Ŷ: "Y", 65463 Å·: "y", 65464 Ÿ: "Y", 65465 Ź: "Z", 65466 Å»: "Z", 65467 Ž: "Z", 65468 ź: "z", 65469 ż: "z", 65470 ž: "z", 65471 IJ: "IJ", 65472 ij: "ij", 65473 Å: "Oe", 65474 Å: "oe", 65475 Å: "'n", 65476 Å¿: "s" 65477 }, sB = { 65478 "&": "&", 65479 "<": "<", 65480 ">": ">", 65481 '"': """, 65482 "'": "'" 65483 }, nB = { 65484 "&": "&", 65485 "<": "<", 65486 ">": ">", 65487 """: '"', 65488 "'": "'" 65489 }, oB = { 65490 "\\": "\\", 65491 "'": "'", 65492 "\n": "n", 65493 "\r": "r", 65494 "\u2028": "u2028", 65495 "\u2029": "u2029" 65496 }, rB = parseFloat, aB = parseInt, IA = typeof qf == "object" && qf && qf.Object === Object && qf, lB = typeof self == "object" && self && self.Object === Object && self, ls = IA || lB || Function("return this")(), EC = t && !t.nodeType && t, jl = EC && !0 && e && !e.nodeType && e, RA = jl && jl.exports === EC, IC = RA && IA.process, jn = (function() { 65497 try { 65498 var ee = jl && jl.require && jl.require("util").types; 65499 return ee || IC && IC.binding && IC.binding("util"); 65500 } catch { 65501 } 65502 })(), TA = jn && jn.isArrayBuffer, LA = jn && jn.isDate, kA = jn && jn.isMap, PA = jn && jn.isRegExp, FA = jn && jn.isSet, OA = jn && jn.isTypedArray; 65503 function Rn(ee, pe, le) { 65504 switch (le.length) { 65505 case 0: 65506 return ee.call(pe); 65507 case 1: 65508 return ee.call(pe, le[0]); 65509 case 2: 65510 return ee.call(pe, le[0], le[1]); 65511 case 3: 65512 return ee.call(pe, le[0], le[1], le[2]); 65513 } 65514 return ee.apply(pe, le); 65515 } 65516 function cB(ee, pe, le, He) { 65517 for (var nt = -1, Bt = ee == null ? 0 : ee.length; ++nt < Bt; ) { 65518 var ji = ee[nt]; 65519 pe(He, ji, le(ji), ee); 65520 } 65521 return He; 65522 } 65523 function Tn(ee, pe) { 65524 for (var le = -1, He = ee == null ? 0 : ee.length; ++le < He && pe(ee[le], le, ee) !== !1; ) 65525 ; 65526 return ee; 65527 } 65528 function uB(ee, pe) { 65529 for (var le = ee == null ? 0 : ee.length; le-- && pe(ee[le], le, ee) !== !1; ) 65530 ; 65531 return ee; 65532 } 65533 function NA(ee, pe) { 65534 for (var le = -1, He = ee == null ? 0 : ee.length; ++le < He; ) 65535 if (!pe(ee[le], le, ee)) 65536 return !1; 65537 return !0; 65538 } 65539 function Fa(ee, pe) { 65540 for (var le = -1, He = ee == null ? 0 : ee.length, nt = 0, Bt = []; ++le < He; ) { 65541 var ji = ee[le]; 65542 pe(ji, le, ee) && (Bt[nt++] = ji); 65543 } 65544 return Bt; 65545 } 65546 function _g(ee, pe) { 65547 var le = ee == null ? 0 : ee.length; 65548 return !!le && ru(ee, pe, 0) > -1; 65549 } 65550 function RC(ee, pe, le) { 65551 for (var He = -1, nt = ee == null ? 0 : ee.length; ++He < nt; ) 65552 if (le(pe, ee[He])) 65553 return !0; 65554 return !1; 65555 } 65556 function fi(ee, pe) { 65557 for (var le = -1, He = ee == null ? 0 : ee.length, nt = Array(He); ++le < He; ) 65558 nt[le] = pe(ee[le], le, ee); 65559 return nt; 65560 } 65561 function Oa(ee, pe) { 65562 for (var le = -1, He = pe.length, nt = ee.length; ++le < He; ) 65563 ee[nt + le] = pe[le]; 65564 return ee; 65565 } 65566 function TC(ee, pe, le, He) { 65567 var nt = -1, Bt = ee == null ? 0 : ee.length; 65568 for (He && Bt && (le = ee[++nt]); ++nt < Bt; ) 65569 le = pe(le, ee[nt], nt, ee); 65570 return le; 65571 } 65572 function dB(ee, pe, le, He) { 65573 var nt = ee == null ? 0 : ee.length; 65574 for (He && nt && (le = ee[--nt]); nt--; ) 65575 le = pe(le, ee[nt], nt, ee); 65576 return le; 65577 } 65578 function LC(ee, pe) { 65579 for (var le = -1, He = ee == null ? 0 : ee.length; ++le < He; ) 65580 if (pe(ee[le], le, ee)) 65581 return !0; 65582 return !1; 65583 } 65584 var hB = kC("length"); 65585 function pB(ee) { 65586 return ee.split(""); 65587 } 65588 function gB(ee) { 65589 return ee.match(x4) || []; 65590 } 65591 function _A(ee, pe, le) { 65592 var He; 65593 return le(ee, function(nt, Bt, ji) { 65594 if (pe(nt, Bt, ji)) 65595 return He = Bt, !1; 65596 }), He; 65597 } 65598 function Bg(ee, pe, le, He) { 65599 for (var nt = ee.length, Bt = le + (He ? 1 : -1); He ? Bt-- : ++Bt < nt; ) 65600 if (pe(ee[Bt], Bt, ee)) 65601 return Bt; 65602 return -1; 65603 } 65604 function ru(ee, pe, le) { 65605 return pe === pe ? DB(ee, pe, le) : Bg(ee, BA, le); 65606 } 65607 function fB(ee, pe, le, He) { 65608 for (var nt = le - 1, Bt = ee.length; ++nt < Bt; ) 65609 if (He(ee[nt], pe)) 65610 return nt; 65611 return -1; 65612 } 65613 function BA(ee) { 65614 return ee !== ee; 65615 } 65616 function GA(ee, pe) { 65617 var le = ee == null ? 0 : ee.length; 65618 return le ? FC(ee, pe) / le : _; 65619 } 65620 function kC(ee) { 65621 return function(pe) { 65622 return pe == null ? i : pe[ee]; 65623 }; 65624 } 65625 function PC(ee) { 65626 return function(pe) { 65627 return ee == null ? i : ee[pe]; 65628 }; 65629 } 65630 function zA(ee, pe, le, He, nt) { 65631 return nt(ee, function(Bt, ji, Jt) { 65632 le = He ? (He = !1, Bt) : pe(le, Bt, ji, Jt); 65633 }), le; 65634 } 65635 function mB(ee, pe) { 65636 var le = ee.length; 65637 for (ee.sort(pe); le--; ) 65638 ee[le] = ee[le].value; 65639 return ee; 65640 } 65641 function FC(ee, pe) { 65642 for (var le, He = -1, nt = ee.length; ++He < nt; ) { 65643 var Bt = pe(ee[He]); 65644 Bt !== i && (le = le === i ? Bt : le + Bt); 65645 } 65646 return le; 65647 } 65648 function OC(ee, pe) { 65649 for (var le = -1, He = Array(ee); ++le < ee; ) 65650 He[le] = pe(le); 65651 return He; 65652 } 65653 function vB(ee, pe) { 65654 return fi(pe, function(le) { 65655 return [le, ee[le]]; 65656 }); 65657 } 65658 function HA(ee) { 65659 return ee && ee.slice(0, jA(ee) + 1).replace(wC, ""); 65660 } 65661 function Ln(ee) { 65662 return function(pe) { 65663 return ee(pe); 65664 }; 65665 } 65666 function NC(ee, pe) { 65667 return fi(pe, function(le) { 65668 return ee[le]; 65669 }); 65670 } 65671 function rh(ee, pe) { 65672 return ee.has(pe); 65673 } 65674 function VA(ee, pe) { 65675 for (var le = -1, He = ee.length; ++le < He && ru(pe, ee[le], 0) > -1; ) 65676 ; 65677 return le; 65678 } 65679 function UA(ee, pe) { 65680 for (var le = ee.length; le-- && ru(pe, ee[le], 0) > -1; ) 65681 ; 65682 return le; 65683 } 65684 function yB(ee, pe) { 65685 for (var le = ee.length, He = 0; le--; ) 65686 ee[le] === pe && ++He;
vendor: 10,309 bytes, lines 65687-65966
65687 return He; 65688 } 65689 var CB = PC(iB), bB = PC(sB); 65690 function wB(ee) { 65691 return "\\" + oB[ee]; 65692 } 65693 function SB(ee, pe) { 65694 return ee == null ? i : ee[pe]; 65695 } 65696 function au(ee) { 65697 return X4.test(ee); 65698 } 65699 function xB(ee) { 65700 return J4.test(ee); 65701 } 65702 function MB(ee) { 65703 for (var pe, le = []; !(pe = ee.next()).done; ) 65704 le.push(pe.value); 65705 return le; 65706 } 65707 function _C(ee) { 65708 var pe = -1, le = Array(ee.size); 65709 return ee.forEach(function(He, nt) { 65710 le[++pe] = [nt, He]; 65711 }), le; 65712 } 65713 function WA(ee, pe) { 65714 return function(le) { 65715 return ee(pe(le)); 65716 }; 65717 } 65718 function Na(ee, pe) { 65719 for (var le = -1, He = ee.length, nt = 0, Bt = []; ++le < He; ) { 65720 var ji = ee[le]; 65721 (ji === pe || ji === d) && (ee[le] = d, Bt[nt++] = le); 65722 } 65723 return Bt; 65724 } 65725 function Gg(ee) { 65726 var pe = -1, le = Array(ee.size); 65727 return ee.forEach(function(He) { 65728 le[++pe] = He; 65729 }), le; 65730 } 65731 function AB(ee) { 65732 var pe = -1, le = Array(ee.size); 65733 return ee.forEach(function(He) { 65734 le[++pe] = [He, He]; 65735 }), le; 65736 } 65737 function DB(ee, pe, le) { 65738 for (var He = le - 1, nt = ee.length; ++He < nt; ) 65739 if (ee[He] === pe) 65740 return He; 65741 return -1; 65742 } 65743 function EB(ee, pe, le) { 65744 for (var He = le + 1; He--; ) 65745 if (ee[He] === pe) 65746 return He; 65747 return He; 65748 } 65749 function lu(ee) { 65750 return au(ee) ? RB(ee) : hB(ee); 65751 } 65752 function Eo(ee) { 65753 return au(ee) ? TB(ee) : pB(ee); 65754 } 65755 function jA(ee) { 65756 for (var pe = ee.length; pe-- && C4.test(ee.charAt(pe)); ) 65757 ; 65758 return pe; 65759 } 65760 var IB = PC(nB); 65761 function RB(ee) { 65762 for (var pe = DC.lastIndex = 0; DC.test(ee); ) 65763 ++pe; 65764 return pe; 65765 } 65766 function TB(ee) { 65767 return ee.match(DC) || []; 65768 } 65769 function LB(ee) { 65770 return ee.match(Q4) || []; 65771 } 65772 var kB = (function ee(pe) { 65773 pe = pe == null ? ls : cu.defaults(ls.Object(), pe, cu.pick(ls, eB)); 65774 var le = pe.Array, He = pe.Date, nt = pe.Error, Bt = pe.Function, ji = pe.Math, Jt = pe.Object, BC = pe.RegExp, PB = pe.String, $n = pe.TypeError, zg = le.prototype, FB = Bt.prototype, uu = Jt.prototype, Hg = pe["__core-js_shared__"], Vg = FB.toString, Ht = uu.hasOwnProperty, OB = 0, $A = (function() { 65775 var h = /[^.]+$/.exec(Hg && Hg.keys && Hg.keys.IE_PROTO || ""); 65776 return h ? "Symbol(src)_1." + h : ""; 65777 })(), Ug = uu.toString, NB = Vg.call(Jt), _B = ls._, BB = BC( 65778 "^" + Vg.call(Ht).replace(bC, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" 65779 ), Wg = RA ? pe.Buffer : i, _a = pe.Symbol, jg = pe.Uint8Array, YA = Wg ? Wg.allocUnsafe : i, $g = WA(Jt.getPrototypeOf, Jt), KA = Jt.create, ZA = uu.propertyIsEnumerable, Yg = zg.splice, qA = _a ? _a.isConcatSpreadable : i, ah = _a ? _a.iterator : i, $l = _a ? _a.toStringTag : i, Kg = (function() { 65780 try { 65781 var h = Ql(Jt, "defineProperty"); 65782 return h({}, "", {}), h; 65783 } catch { 65784 } 65785 })(), GB = pe.clearTimeout !== ls.clearTimeout && pe.clearTimeout, zB = He && He.now !== ls.Date.now && He.now, HB = pe.setTimeout !== ls.setTimeout && pe.setTimeout, Zg = ji.ceil, qg = ji.floor, GC = Jt.getOwnPropertySymbols, VB = Wg ? Wg.isBuffer : i, QA = pe.isFinite, UB = zg.join, WB = WA(Jt.keys, Jt), $i = ji.max, ms = ji.min, jB = He.now, $B = pe.parseInt, XA = ji.random, YB = zg.reverse, zC = Ql(pe, "DataView"), lh = Ql(pe, "Map"), HC = Ql(pe, "Promise"), du = Ql(pe, "Set"), ch = Ql(pe, "WeakMap"), uh = Ql(Jt, "create"), Qg = ch && new ch(), hu = {}, KB = Xl(zC), ZB = Xl(lh), qB = Xl(HC), QB = Xl(du), XB = Xl(ch), Xg = _a ? _a.prototype : i, dh = Xg ? Xg.valueOf : i, JA = Xg ? Xg.toString : i; 65786 function F(h) { 65787 if (Di(h) && !rt(h) && !(h instanceof bt)) { 65788 if (h instanceof Yn) 65789 return h; 65790 if (Ht.call(h, "__wrapped__")) 65791 return eE(h); 65792 } 65793 return new Yn(h); 65794 } 65795 var pu = /* @__PURE__ */ (function() { 65796 function h() { 65797 } 65798 return function(g) { 65799 if (!bi(g)) 65800 return {}; 65801 if (KA) 65802 return KA(g); 65803 h.prototype = g; 65804 var v = new h(); 65805 return h.prototype = i, v; 65806 }; 65807 })(); 65808 function Jg() { 65809 } 65810 function Yn(h, g) { 65811 this.__wrapped__ = h, this.__actions__ = [], this.__chain__ = !!g, this.__index__ = 0, this.__values__ = i; 65812 } 65813 F.templateSettings = { 65814 /** 65815 * Used to detect `data` property values to be HTML-escaped. 65816 * 65817 * @memberOf _.templateSettings 65818 * @type {RegExp} 65819 */ 65820 escape: p4, 65821 /** 65822 * Used to detect code to be evaluated. 65823 * 65824 * @memberOf _.templateSettings 65825 * @type {RegExp} 65826 */ 65827 evaluate: g4, 65828 /** 65829 * Used to detect `data` property values to inject. 65830 * 65831 * @memberOf _.templateSettings 65832 * @type {RegExp} 65833 */ 65834 interpolate: aA, 65835 /** 65836 * Used to reference the data object in the template text. 65837 * 65838 * @memberOf _.templateSettings 65839 * @type {string} 65840 */ 65841 variable: "", 65842 /** 65843 * Used to import variables into the compiled template. 65844 * 65845 * @memberOf _.templateSettings 65846 * @type {Object} 65847 */ 65848 imports: { 65849 /** 65850 * A reference to the `lodash` function. 65851 * 65852 * @memberOf _.templateSettings.imports 65853 * @type {Function} 65854 */ 65855 _: F 65856 } 65857 }, F.prototype = Jg.prototype, F.prototype.constructor = F, Yn.prototype = pu(Jg.prototype), Yn.prototype.constructor = Yn; 65858 function bt(h) { 65859 this.__wrapped__ = h, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = K, this.__views__ = []; 65860 } 65861 function JB() { 65862 var h = new bt(this.__wrapped__); 65863 return h.__actions__ = nn(this.__actions__), h.__dir__ = this.__dir__, h.__filtered__ = this.__filtered__, h.__iteratees__ = nn(this.__iteratees__), h.__takeCount__ = this.__takeCount__, h.__views__ = nn(this.__views__), h; 65864 } 65865 function eG() { 65866 if (this.__filtered__) { 65867 var h = new bt(this); 65868 h.__dir__ = -1, h.__filtered__ = !0; 65869 } else 65870 h = this.clone(), h.__dir__ *= -1; 65871 return h; 65872 } 65873 function tG() { 65874 var h = this.__wrapped__.value(), g = this.__dir__, v = rt(h), x = g < 0, R = v ? h.length : 0, O = p5(0, R, this.__views__), z = O.start, Y = O.end, ie = Y - z, ve = x ? Y : z - 1, ye = this.__iteratees__, xe = ye.length, Oe = 0, We = ms(ie, this.__takeCount__); 65875 if (!v || !x && R == ie && We == ie) 65876 return xD(h, this.__actions__); 65877 var qe = []; 65878 e: 65879 for (; ie-- && Oe < We; ) { 65880 ve += g; 65881 for (var dt = -1, $e = h[ve]; ++dt < xe; ) { 65882 var yt = ye[dt], xt = yt.iteratee, Fn = yt.type, Os = xt($e); 65883 if (Fn == $) 65884 $e = Os; 65885 else if (!Os) { 65886 if (Fn == q) 65887 continue e; 65888 break e; 65889 } 65890 } 65891 qe[Oe++] = $e; 65892 } 65893 return qe; 65894 } 65895 bt.prototype = pu(Jg.prototype), bt.prototype.constructor = bt; 65896 function Yl(h) { 65897 var g = -1, v = h == null ? 0 : h.length; 65898 for (this.clear(); ++g < v; ) { 65899 var x = h[g]; 65900 this.set(x[0], x[1]); 65901 } 65902 } 65903 function iG() { 65904 this.__data__ = uh ? uh(null) : {}, this.size = 0; 65905 } 65906 function sG(h) { 65907 var g = this.has(h) && delete this.__data__[h]; 65908 return this.size -= g ? 1 : 0, g; 65909 } 65910 function nG(h) { 65911 var g = this.__data__; 65912 if (uh) { 65913 var v = g[h]; 65914 return v === c ? i : v; 65915 } 65916 return Ht.call(g, h) ? g[h] : i; 65917 } 65918 function oG(h) { 65919 var g = this.__data__; 65920 return uh ? g[h] !== i : Ht.call(g, h); 65921 } 65922 function rG(h, g) { 65923 var v = this.__data__; 65924 return this.size += this.has(h) ? 0 : 1, v[h] = uh && g === i ? c : g, this; 65925 } 65926 Yl.prototype.clear = iG, Yl.prototype.delete = sG, Yl.prototype.get = nG, Yl.prototype.has = oG, Yl.prototype.set = rG; 65927 function Fr(h) { 65928 var g = -1, v = h == null ? 0 : h.length; 65929 for (this.clear(); ++g < v; ) { 65930 var x = h[g]; 65931 this.set(x[0], x[1]); 65932 } 65933 } 65934 function aG() { 65935 this.__data__ = [], this.size = 0; 65936 } 65937 function lG(h) { 65938 var g = this.__data__, v = ef(g, h); 65939 if (v < 0) 65940 return !1; 65941 var x = g.length - 1; 65942 return v == x ? g.pop() : Yg.call(g, v, 1), --this.size, !0; 65943 } 65944 function cG(h) { 65945 var g = this.__data__, v = ef(g, h); 65946 return v < 0 ? i : g[v][1]; 65947 } 65948 function uG(h) { 65949 return ef(this.__data__, h) > -1; 65950 } 65951 function dG(h, g) { 65952 var v = this.__data__, x = ef(v, h); 65953 return x < 0 ? (++this.size, v.push([h, g])) : v[x][1] = g, this; 65954 } 65955 Fr.prototype.clear = aG, Fr.prototype.delete = lG, Fr.prototype.get = cG, Fr.prototype.has = uG, Fr.prototype.set = dG; 65956 function Or(h) { 65957 var g = -1, v = h == null ? 0 : h.length; 65958 for (this.clear(); ++g < v; ) { 65959 var x = h[g]; 65960 this.set(x[0], x[1]); 65961 } 65962 } 65963 function hG() { 65964 this.size = 0, this.__data__ = { 65965 hash: new Yl(), 65966 map: new (lh || Fr)(),
vendor: 9,124 bytes, lines 65967-66237
65967 string: new Yl() 65968 }; 65969 } 65970 function pG(h) { 65971 var g = pf(this, h).delete(h); 65972 return this.size -= g ? 1 : 0, g; 65973 } 65974 function gG(h) { 65975 return pf(this, h).get(h); 65976 } 65977 function fG(h) { 65978 return pf(this, h).has(h); 65979 } 65980 function mG(h, g) { 65981 var v = pf(this, h), x = v.size; 65982 return v.set(h, g), this.size += v.size == x ? 0 : 1, this; 65983 } 65984 Or.prototype.clear = hG, Or.prototype.delete = pG, Or.prototype.get = gG, Or.prototype.has = fG, Or.prototype.set = mG; 65985 function Kl(h) { 65986 var g = -1, v = h == null ? 0 : h.length; 65987 for (this.__data__ = new Or(); ++g < v; ) 65988 this.add(h[g]); 65989 } 65990 function vG(h) { 65991 return this.__data__.set(h, c), this; 65992 } 65993 function yG(h) { 65994 return this.__data__.has(h); 65995 } 65996 Kl.prototype.add = Kl.prototype.push = vG, Kl.prototype.has = yG; 65997 function Io(h) { 65998 var g = this.__data__ = new Fr(h); 65999 this.size = g.size; 66000 } 66001 function CG() { 66002 this.__data__ = new Fr(), this.size = 0; 66003 } 66004 function bG(h) { 66005 var g = this.__data__, v = g.delete(h); 66006 return this.size = g.size, v; 66007 } 66008 function wG(h) { 66009 return this.__data__.get(h); 66010 } 66011 function SG(h) { 66012 return this.__data__.has(h); 66013 } 66014 function xG(h, g) { 66015 var v = this.__data__; 66016 if (v instanceof Fr) { 66017 var x = v.__data__; 66018 if (!lh || x.length < n - 1) 66019 return x.push([h, g]), this.size = ++v.size, this; 66020 v = this.__data__ = new Or(x); 66021 } 66022 return v.set(h, g), this.size = v.size, this; 66023 } 66024 Io.prototype.clear = CG, Io.prototype.delete = bG, Io.prototype.get = wG, Io.prototype.has = SG, Io.prototype.set = xG; 66025 function eD(h, g) { 66026 var v = rt(h), x = !v && Jl(h), R = !v && !x && Va(h), O = !v && !x && !R && vu(h), z = v || x || R || O, Y = z ? OC(h.length, PB) : [], ie = Y.length; 66027 for (var ve in h) 66028 (g || Ht.call(h, ve)) && !(z && // Safari 9 has enumerable `arguments.length` in strict mode. 66029 (ve == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. 66030 R && (ve == "offset" || ve == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. 66031 O && (ve == "buffer" || ve == "byteLength" || ve == "byteOffset") || // Skip index properties. 66032 Br(ve, ie))) && Y.push(ve); 66033 return Y; 66034 } 66035 function tD(h) { 66036 var g = h.length; 66037 return g ? h[XC(0, g - 1)] : i; 66038 } 66039 function MG(h, g) { 66040 return gf(nn(h), Zl(g, 0, h.length)); 66041 } 66042 function AG(h) { 66043 return gf(nn(h)); 66044 } 66045 function VC(h, g, v) { 66046 (v !== i && !To(h[g], v) || v === i && !(g in h)) && tr(h, g, v); 66047 } 66048 function hh(h, g, v) { 66049 var x = h[g]; 66050 (!(Ht.call(h, g) && To(x, v)) || v === i && !(g in h)) && tr(h, g, v); 66051 } 66052 function ef(h, g) { 66053 for (var v = h.length; v--; ) 66054 if (To(h[v][0], g)) 66055 return v; 66056 return -1; 66057 } 66058 function DG(h, g, v, x) { 66059 return Ba(h, function(R, O, z) { 66060 g(x, R, v(R), z); 66061 }), x; 66062 } 66063 function iD(h, g) { 66064 return h && sr(g, ns(g), h); 66065 } 66066 function EG(h, g) { 66067 return h && sr(g, rn(g), h); 66068 } 66069 function tr(h, g, v) { 66070 g == "__proto__" && Kg ? Kg(h, g, { 66071 configurable: !0, 66072 enumerable: !0, 66073 value: v, 66074 writable: !0 66075 }) : h[g] = v; 66076 } 66077 function UC(h, g) { 66078 for (var v = -1, x = g.length, R = le(x), O = h == null; ++v < x; ) 66079 R[v] = O ? i : Mb(h, g[v]); 66080 return R; 66081 } 66082 function Zl(h, g, v) { 66083 return h === h && (v !== i && (h = h <= v ? h : v), g !== i && (h = h >= g ? h : g)), h; 66084 } 66085 function Kn(h, g, v, x, R, O) { 66086 var z, Y = g & p, ie = g & f, ve = g & m; 66087 if (v && (z = R ? v(h, x, R, O) : v(h)), z !== i) 66088 return z; 66089 if (!bi(h)) 66090 return h; 66091 var ye = rt(h); 66092 if (ye) { 66093 if (z = f5(h), !Y) 66094 return nn(h, z); 66095 } else { 66096 var xe = vs(h), Oe = xe == X || xe == H; 66097 if (Va(h)) 66098 return DD(h, Y); 66099 if (xe == Le || xe == oe || Oe && !R) { 66100 if (z = ie || Oe ? {} : jD(h), !Y) 66101 return ie ? n5(h, EG(z, h)) : s5(h, iD(z, h)); 66102 } else { 66103 if (!ni[xe]) 66104 return R ? h : {}; 66105 z = m5(h, xe, Y); 66106 } 66107 } 66108 O || (O = new Io()); 66109 var We = O.get(h); 66110 if (We) 66111 return We; 66112 O.set(h, z), bE(h) ? h.forEach(function($e) { 66113 z.add(Kn($e, g, v, $e, h, O)); 66114 }) : yE(h) && h.forEach(function($e, yt) { 66115 z.set(yt, Kn($e, g, v, yt, h, O)); 66116 }); 66117 var qe = ve ? ie ? cb : lb : ie ? rn : ns, dt = ye ? i : qe(h); 66118 return Tn(dt || h, function($e, yt) { 66119 dt && (yt = $e, $e = h[yt]), hh(z, yt, Kn($e, g, v, yt, h, O)); 66120 }), z; 66121 } 66122 function IG(h) { 66123 var g = ns(h); 66124 return function(v) { 66125 return sD(v, h, g); 66126 }; 66127 } 66128 function sD(h, g, v) { 66129 var x = v.length; 66130 if (h == null) 66131 return !x; 66132 for (h = Jt(h); x--; ) { 66133 var R = v[x], O = g[R], z = h[R]; 66134 if (z === i && !(R in h) || !O(z)) 66135 return !1; 66136 } 66137 return !0; 66138 } 66139 function nD(h, g, v) { 66140 if (typeof h != "function") 66141 throw new $n(r); 66142 return Ch(function() { 66143 h.apply(i, v); 66144 }, g); 66145 } 66146 function ph(h, g, v, x) { 66147 var R = -1, O = _g, z = !0, Y = h.length, ie = [], ve = g.length; 66148 if (!Y) 66149 return ie; 66150 v && (g = fi(g, Ln(v))), x ? (O = RC, z = !1) : g.length >= n && (O = rh, z = !1, g = new Kl(g)); 66151 e: 66152 for (; ++R < Y; ) { 66153 var ye = h[R], xe = v == null ? ye : v(ye); 66154 if (ye = x || ye !== 0 ? ye : 0, z && xe === xe) { 66155 for (var Oe = ve; Oe--; ) 66156 if (g[Oe] === xe) 66157 continue e; 66158 ie.push(ye); 66159 } else O(g, xe, x) || ie.push(ye); 66160 } 66161 return ie; 66162 } 66163 var Ba = LD(ir), oD = LD(jC, !0); 66164 function RG(h, g) { 66165 var v = !0; 66166 return Ba(h, function(x, R, O) { 66167 return v = !!g(x, R, O), v; 66168 }), v; 66169 } 66170 function tf(h, g, v) { 66171 for (var x = -1, R = h.length; ++x < R; ) { 66172 var O = h[x], z = g(O); 66173 if (z != null && (Y === i ? z === z && !Pn(z) : v(z, Y))) 66174 var Y = z, ie = O; 66175 } 66176 return ie; 66177 } 66178 function TG(h, g, v, x) { 66179 var R = h.length; 66180 for (v = ct(v), v < 0 && (v = -v > R ? 0 : R + v), x = x === i || x > R ? R : ct(x), x < 0 && (x += R), x = v > x ? 0 : SE(x); v < x; ) 66181 h[v++] = g; 66182 return h; 66183 } 66184 function rD(h, g) { 66185 var v = []; 66186 return Ba(h, function(x, R, O) { 66187 g(x, R, O) && v.push(x); 66188 }), v; 66189 } 66190 function cs(h, g, v, x, R) { 66191 var O = -1, z = h.length; 66192 for (v || (v = y5), R || (R = []); ++O < z; ) { 66193 var Y = h[O]; 66194 g > 0 && v(Y) ? g > 1 ? cs(Y, g - 1, v, x, R) : Oa(R, Y) : x || (R[R.length] = Y); 66195 } 66196 return R; 66197 } 66198 var WC = kD(), aD = kD(!0); 66199 function ir(h, g) { 66200 return h && WC(h, g, ns); 66201 } 66202 function jC(h, g) { 66203 return h && aD(h, g, ns); 66204 } 66205 function sf(h, g) { 66206 return Fa(g, function(v) { 66207 return Gr(h[v]); 66208 }); 66209 } 66210 function ql(h, g) { 66211 g = za(g, h); 66212 for (var v = 0, x = g.length; h != null && v < x; ) 66213 h = h[Ro(g[v++])]; 66214 return v && v == x ? h : i; 66215 } 66216 function lD(h, g, v) { 66217 var x = g(h); 66218 return rt(h) ? x : Oa(x, v(h)); 66219 } 66220 function Ps(h) { 66221 return h == null ? h === i ? lt : Se : $l && $l in Jt(h) ? h5(h) : A5(h); 66222 } 66223 function $C(h, g) { 66224 return h > g; 66225 } 66226 function LG(h, g) { 66227 return h != null && Ht.call(h, g); 66228 } 66229 function kG(h, g) { 66230 return h != null && g in Jt(h); 66231 } 66232 function PG(h, g, v) { 66233 return h >= ms(g, v) && h < $i(g, v); 66234 } 66235 function YC(h, g, v) { 66236 for (var x = v ? RC : _g, R = h[0].length, O = h.length, z = O, Y = le(O), ie = 1 / 0, ve = []; z--; ) { 66237 var ye = h[z];
vendor: 8,186 bytes, lines 66238-66481
66238 z && g && (ye = fi(ye, Ln(g))), ie = ms(ye.length, ie), Y[z] = !v && (g || R >= 120 && ye.length >= 120) ? new Kl(z && ye) : i; 66239 } 66240 ye = h[0]; 66241 var xe = -1, Oe = Y[0]; 66242 e: 66243 for (; ++xe < R && ve.length < ie; ) { 66244 var We = ye[xe], qe = g ? g(We) : We; 66245 if (We = v || We !== 0 ? We : 0, !(Oe ? rh(Oe, qe) : x(ve, qe, v))) { 66246 for (z = O; --z; ) { 66247 var dt = Y[z]; 66248 if (!(dt ? rh(dt, qe) : x(h[z], qe, v))) 66249 continue e; 66250 } 66251 Oe && Oe.push(qe), ve.push(We); 66252 } 66253 } 66254 return ve; 66255 } 66256 function FG(h, g, v, x) { 66257 return ir(h, function(R, O, z) { 66258 g(x, v(R), O, z); 66259 }), x; 66260 } 66261 function gh(h, g, v) { 66262 g = za(g, h), h = ZD(h, g); 66263 var x = h == null ? h : h[Ro(qn(g))]; 66264 return x == null ? i : Rn(x, h, v); 66265 } 66266 function cD(h) { 66267 return Di(h) && Ps(h) == oe; 66268 } 66269 function OG(h) { 66270 return Di(h) && Ps(h) == Nt; 66271 } 66272 function NG(h) { 66273 return Di(h) && Ps(h) == ne; 66274 } 66275 function fh(h, g, v, x, R) { 66276 return h === g ? !0 : h == null || g == null || !Di(h) && !Di(g) ? h !== h && g !== g : _G(h, g, v, x, fh, R); 66277 } 66278 function _G(h, g, v, x, R, O) { 66279 var z = rt(h), Y = rt(g), ie = z ? U : vs(h), ve = Y ? U : vs(g); 66280 ie = ie == oe ? Le : ie, ve = ve == oe ? Le : ve; 66281 var ye = ie == Le, xe = ve == Le, Oe = ie == ve; 66282 if (Oe && Va(h)) { 66283 if (!Va(g)) 66284 return !1; 66285 z = !0, ye = !1; 66286 } 66287 if (Oe && !ye) 66288 return O || (O = new Io()), z || vu(h) ? VD(h, g, v, x, R, O) : u5(h, g, ie, v, x, R, O); 66289 if (!(v & y)) { 66290 var We = ye && Ht.call(h, "__wrapped__"), qe = xe && Ht.call(g, "__wrapped__"); 66291 if (We || qe) { 66292 var dt = We ? h.value() : h, $e = qe ? g.value() : g; 66293 return O || (O = new Io()), R(dt, $e, v, x, O); 66294 } 66295 } 66296 return Oe ? (O || (O = new Io()), d5(h, g, v, x, R, O)) : !1; 66297 } 66298 function BG(h) { 66299 return Di(h) && vs(h) == Q; 66300 } 66301 function KC(h, g, v, x) { 66302 var R = v.length, O = R, z = !x; 66303 if (h == null) 66304 return !O; 66305 for (h = Jt(h); R--; ) { 66306 var Y = v[R]; 66307 if (z && Y[2] ? Y[1] !== h[Y[0]] : !(Y[0] in h)) 66308 return !1; 66309 } 66310 for (; ++R < O; ) { 66311 Y = v[R]; 66312 var ie = Y[0], ve = h[ie], ye = Y[1]; 66313 if (z && Y[2]) { 66314 if (ve === i && !(ie in h)) 66315 return !1; 66316 } else { 66317 var xe = new Io(); 66318 if (x) 66319 var Oe = x(ve, ye, ie, h, g, xe); 66320 if (!(Oe === i ? fh(ye, ve, y | b, x, xe) : Oe)) 66321 return !1; 66322 } 66323 } 66324 return !0; 66325 } 66326 function uD(h) { 66327 if (!bi(h) || b5(h)) 66328 return !1; 66329 var g = Gr(h) ? BB : I4; 66330 return g.test(Xl(h)); 66331 } 66332 function GG(h) { 66333 return Di(h) && Ps(h) == st; 66334 } 66335 function zG(h) { 66336 return Di(h) && vs(h) == tt; 66337 } 66338 function HG(h) { 66339 return Di(h) && bf(h.length) && !!li[Ps(h)]; 66340 } 66341 function dD(h) { 66342 return typeof h == "function" ? h : h == null ? an : typeof h == "object" ? rt(h) ? gD(h[0], h[1]) : pD(h) : FE(h); 66343 } 66344 function ZC(h) { 66345 if (!yh(h)) 66346 return WB(h); 66347 var g = []; 66348 for (var v in Jt(h)) 66349 Ht.call(h, v) && v != "constructor" && g.push(v); 66350 return g; 66351 } 66352 function VG(h) { 66353 if (!bi(h)) 66354 return M5(h); 66355 var g = yh(h), v = []; 66356 for (var x in h) 66357 x == "constructor" && (g || !Ht.call(h, x)) || v.push(x); 66358 return v; 66359 } 66360 function qC(h, g) { 66361 return h < g; 66362 } 66363 function hD(h, g) { 66364 var v = -1, x = on(h) ? le(h.length) : []; 66365 return Ba(h, function(R, O, z) { 66366 x[++v] = g(R, O, z); 66367 }), x; 66368 } 66369 function pD(h) { 66370 var g = db(h); 66371 return g.length == 1 && g[0][2] ? YD(g[0][0], g[0][1]) : function(v) { 66372 return v === h || KC(v, h, g); 66373 }; 66374 } 66375 function gD(h, g) { 66376 return pb(h) && $D(g) ? YD(Ro(h), g) : function(v) { 66377 var x = Mb(v, h); 66378 return x === i && x === g ? Ab(v, h) : fh(g, x, y | b); 66379 }; 66380 } 66381 function nf(h, g, v, x, R) { 66382 h !== g && WC(g, function(O, z) { 66383 if (R || (R = new Io()), bi(O)) 66384 UG(h, g, z, v, nf, x, R); 66385 else { 66386 var Y = x ? x(fb(h, z), O, z + "", h, g, R) : i; 66387 Y === i && (Y = O), VC(h, z, Y); 66388 } 66389 }, rn); 66390 } 66391 function UG(h, g, v, x, R, O, z) { 66392 var Y = fb(h, v), ie = fb(g, v), ve = z.get(ie); 66393 if (ve) { 66394 VC(h, v, ve); 66395 return; 66396 } 66397 var ye = O ? O(Y, ie, v + "", h, g, z) : i, xe = ye === i; 66398 if (xe) { 66399 var Oe = rt(ie), We = !Oe && Va(ie), qe = !Oe && !We && vu(ie); 66400 ye = ie, Oe || We || qe ? rt(Y) ? ye = Y : Li(Y) ? ye = nn(Y) : We ? (xe = !1, ye = DD(ie, !0)) : qe ? (xe = !1, ye = ED(ie, !0)) : ye = [] : bh(ie) || Jl(ie) ? (ye = Y, Jl(Y) ? ye = xE(Y) : (!bi(Y) || Gr(Y)) && (ye = jD(ie))) : xe = !1; 66401 } 66402 xe && (z.set(ie, ye), R(ye, ie, x, O, z), z.delete(ie)), VC(h, v, ye); 66403 } 66404 function fD(h, g) { 66405 var v = h.length; 66406 if (v) 66407 return g += g < 0 ? v : 0, Br(g, v) ? h[g] : i; 66408 } 66409 function mD(h, g, v) { 66410 g.length ? g = fi(g, function(O) { 66411 return rt(O) ? function(z) { 66412 return ql(z, O.length === 1 ? O[0] : O); 66413 } : O; 66414 }) : g = [an]; 66415 var x = -1; 66416 g = fi(g, Ln(Ze())); 66417 var R = hD(h, function(O, z, Y) { 66418 var ie = fi(g, function(ve) { 66419 return ve(O); 66420 }); 66421 return { criteria: ie, index: ++x, value: O }; 66422 }); 66423 return mB(R, function(O, z) { 66424 return i5(O, z, v); 66425 }); 66426 } 66427 function WG(h, g) { 66428 return vD(h, g, function(v, x) { 66429 return Ab(h, x); 66430 }); 66431 } 66432 function vD(h, g, v) { 66433 for (var x = -1, R = g.length, O = {}; ++x < R; ) { 66434 var z = g[x], Y = ql(h, z); 66435 v(Y, z) && mh(O, za(z, h), Y); 66436 } 66437 return O; 66438 } 66439 function jG(h) { 66440 return function(g) { 66441 return ql(g, h); 66442 }; 66443 } 66444 function QC(h, g, v, x) { 66445 var R = x ? fB : ru, O = -1, z = g.length, Y = h; 66446 for (h === g && (g = nn(g)), v && (Y = fi(h, Ln(v))); ++O < z; ) 66447 for (var ie = 0, ve = g[O], ye = v ? v(ve) : ve; (ie = R(Y, ye, ie, x)) > -1; ) 66448 Y !== h && Yg.call(Y, ie, 1), Yg.call(h, ie, 1); 66449 return h; 66450 } 66451 function yD(h, g) { 66452 for (var v = h ? g.length : 0, x = v - 1; v--; ) { 66453 var R = g[v]; 66454 if (v == x || R !== O) { 66455 var O = R; 66456 Br(R) ? Yg.call(h, R, 1) : tb(h, R); 66457 } 66458 } 66459 return h; 66460 } 66461 function XC(h, g) { 66462 return h + qg(XA() * (g - h + 1)); 66463 } 66464 function $G(h, g, v, x) { 66465 for (var R = -1, O = $i(Zg((g - h) / (v || 1)), 0), z = le(O); O--; ) 66466 z[x ? O : ++R] = h, h += v; 66467 return z; 66468 } 66469 function JC(h, g) { 66470 var v = ""; 66471 if (!h || g < 1 || g > P) 66472 return v; 66473 do 66474 g % 2 && (v += h), g = qg(g / 2), g && (h += h); 66475 while (g); 66476 return v; 66477 } 66478 function ft(h, g) { 66479 return mb(KD(h, g, an), h + ""); 66480 } 66481 function YG(h) {
vendor: 5,560 bytes, lines 66482-66643
66482 return tD(yu(h)); 66483 } 66484 function KG(h, g) { 66485 var v = yu(h); 66486 return gf(v, Zl(g, 0, v.length)); 66487 } 66488 function mh(h, g, v, x) { 66489 if (!bi(h)) 66490 return h; 66491 g = za(g, h); 66492 for (var R = -1, O = g.length, z = O - 1, Y = h; Y != null && ++R < O; ) { 66493 var ie = Ro(g[R]), ve = v; 66494 if (ie === "__proto__" || ie === "constructor" || ie === "prototype") 66495 return h; 66496 if (R != z) { 66497 var ye = Y[ie]; 66498 ve = x ? x(ye, ie, Y) : i, ve === i && (ve = bi(ye) ? ye : Br(g[R + 1]) ? [] : {}); 66499 } 66500 hh(Y, ie, ve), Y = Y[ie]; 66501 } 66502 return h; 66503 } 66504 var CD = Qg ? function(h, g) { 66505 return Qg.set(h, g), h; 66506 } : an, ZG = Kg ? function(h, g) { 66507 return Kg(h, "toString", { 66508 configurable: !0, 66509 enumerable: !1, 66510 value: Eb(g), 66511 writable: !0 66512 }); 66513 } : an; 66514 function qG(h) { 66515 return gf(yu(h)); 66516 } 66517 function Zn(h, g, v) { 66518 var x = -1, R = h.length; 66519 g < 0 && (g = -g > R ? 0 : R + g), v = v > R ? R : v, v < 0 && (v += R), R = g > v ? 0 : v - g >>> 0, g >>>= 0; 66520 for (var O = le(R); ++x < R; ) 66521 O[x] = h[x + g]; 66522 return O; 66523 } 66524 function QG(h, g) { 66525 var v; 66526 return Ba(h, function(x, R, O) { 66527 return v = g(x, R, O), !v; 66528 }), !!v; 66529 } 66530 function of(h, g, v) { 66531 var x = 0, R = h == null ? x : h.length; 66532 if (typeof g == "number" && g === g && R <= ae) { 66533 for (; x < R; ) { 66534 var O = x + R >>> 1, z = h[O]; 66535 z !== null && !Pn(z) && (v ? z <= g : z < g) ? x = O + 1 : R = O; 66536 } 66537 return R; 66538 } 66539 return eb(h, g, an, v); 66540 } 66541 function eb(h, g, v, x) { 66542 var R = 0, O = h == null ? 0 : h.length; 66543 if (O === 0) 66544 return 0; 66545 g = v(g); 66546 for (var z = g !== g, Y = g === null, ie = Pn(g), ve = g === i; R < O; ) { 66547 var ye = qg((R + O) / 2), xe = v(h[ye]), Oe = xe !== i, We = xe === null, qe = xe === xe, dt = Pn(xe); 66548 if (z) 66549 var $e = x || qe; 66550 else ve ? $e = qe && (x || Oe) : Y ? $e = qe && Oe && (x || !We) : ie ? $e = qe && Oe && !We && (x || !dt) : We || dt ? $e = !1 : $e = x ? xe <= g : xe < g; 66551 $e ? R = ye + 1 : O = ye; 66552 } 66553 return ms(O, ce); 66554 } 66555 function bD(h, g) { 66556 for (var v = -1, x = h.length, R = 0, O = []; ++v < x; ) { 66557 var z = h[v], Y = g ? g(z) : z; 66558 if (!v || !To(Y, ie)) { 66559 var ie = Y; 66560 O[R++] = z === 0 ? 0 : z; 66561 } 66562 } 66563 return O; 66564 } 66565 function wD(h) { 66566 return typeof h == "number" ? h : Pn(h) ? _ : +h; 66567 } 66568 function kn(h) { 66569 if (typeof h == "string") 66570 return h; 66571 if (rt(h)) 66572 return fi(h, kn) + ""; 66573 if (Pn(h)) 66574 return JA ? JA.call(h) : ""; 66575 var g = h + ""; 66576 return g == "0" && 1 / h == -E ? "-0" : g; 66577 } 66578 function Ga(h, g, v) { 66579 var x = -1, R = _g, O = h.length, z = !0, Y = [], ie = Y; 66580 if (v) 66581 z = !1, R = RC; 66582 else if (O >= n) { 66583 var ve = g ? null : l5(h); 66584 if (ve) 66585 return Gg(ve); 66586 z = !1, R = rh, ie = new Kl(); 66587 } else 66588 ie = g ? [] : Y; 66589 e: 66590 for (; ++x < O; ) { 66591 var ye = h[x], xe = g ? g(ye) : ye; 66592 if (ye = v || ye !== 0 ? ye : 0, z && xe === xe) { 66593 for (var Oe = ie.length; Oe--; ) 66594 if (ie[Oe] === xe) 66595 continue e; 66596 g && ie.push(xe), Y.push(ye); 66597 } else R(ie, xe, v) || (ie !== Y && ie.push(xe), Y.push(ye)); 66598 } 66599 return Y; 66600 } 66601 function tb(h, g) { 66602 g = za(g, h); 66603 var v = -1, x = g.length; 66604 if (!x) 66605 return !0; 66606 for (; ++v < x; ) { 66607 var R = Ro(g[v]); 66608 if (R === "__proto__" && !Ht.call(h, "__proto__") || (R === "constructor" || R === "prototype") && v < x - 1) 66609 return !1; 66610 } 66611 var O = ZD(h, g); 66612 return O == null || delete O[Ro(qn(g))]; 66613 } 66614 function SD(h, g, v, x) { 66615 return mh(h, g, v(ql(h, g)), x); 66616 } 66617 function rf(h, g, v, x) { 66618 for (var R = h.length, O = x ? R : -1; (x ? O-- : ++O < R) && g(h[O], O, h); ) 66619 ; 66620 return v ? Zn(h, x ? 0 : O, x ? O + 1 : R) : Zn(h, x ? O + 1 : 0, x ? R : O); 66621 } 66622 function xD(h, g) { 66623 var v = h; 66624 return v instanceof bt && (v = v.value()), TC(g, function(x, R) { 66625 return R.func.apply(R.thisArg, Oa([x], R.args)); 66626 }, v); 66627 } 66628 function ib(h, g, v) { 66629 var x = h.length; 66630 if (x < 2) 66631 return x ? Ga(h[0]) : []; 66632 for (var R = -1, O = le(x); ++R < x; ) 66633 for (var z = h[R], Y = -1; ++Y < x; ) 66634 Y != R && (O[R] = ph(O[R] || z, h[Y], g, v)); 66635 return Ga(cs(O, 1), g, v); 66636 } 66637 function MD(h, g, v) { 66638 for (var x = -1, R = h.length, O = g.length, z = {}; ++x < R; ) { 66639 var Y = x < O ? g[x] : i; 66640 v(z, h[x], Y); 66641 } 66642 return z; 66643 }
vendor: 24,340 bytes, lines 66644-67365
66644 function sb(h) { 66645 return Li(h) ? h : []; 66646 } 66647 function nb(h) { 66648 return typeof h == "function" ? h : an; 66649 } 66650 function za(h, g) { 66651 return rt(h) ? h : pb(h, g) ? [h] : JD(Vt(h)); 66652 } 66653 var XG = ft; 66654 function Ha(h, g, v) { 66655 var x = h.length; 66656 return v = v === i ? x : v, !g && v >= x ? h : Zn(h, g, v); 66657 } 66658 var AD = GB || function(h) { 66659 return ls.clearTimeout(h); 66660 }; 66661 function DD(h, g) { 66662 if (g) 66663 return h.slice(); 66664 var v = h.length, x = YA ? YA(v) : new h.constructor(v); 66665 return h.copy(x), x; 66666 } 66667 function ob(h) { 66668 var g = new h.constructor(h.byteLength); 66669 return new jg(g).set(new jg(h)), g; 66670 } 66671 function JG(h, g) { 66672 var v = g ? ob(h.buffer) : h.buffer; 66673 return new h.constructor(v, h.byteOffset, h.byteLength); 66674 } 66675 function e5(h) { 66676 var g = new h.constructor(h.source, cA.exec(h)); 66677 return g.lastIndex = h.lastIndex, g; 66678 } 66679 function t5(h) { 66680 return dh ? Jt(dh.call(h)) : {}; 66681 } 66682 function ED(h, g) { 66683 var v = g ? ob(h.buffer) : h.buffer; 66684 return new h.constructor(v, h.byteOffset, h.length); 66685 } 66686 function ID(h, g) { 66687 if (h !== g) { 66688 var v = h !== i, x = h === null, R = h === h, O = Pn(h), z = g !== i, Y = g === null, ie = g === g, ve = Pn(g); 66689 if (!Y && !ve && !O && h > g || O && z && ie && !Y && !ve || x && z && ie || !v && ie || !R) 66690 return 1; 66691 if (!x && !O && !ve && h < g || ve && v && R && !x && !O || Y && v && R || !z && R || !ie) 66692 return -1; 66693 } 66694 return 0; 66695 } 66696 function i5(h, g, v) { 66697 for (var x = -1, R = h.criteria, O = g.criteria, z = R.length, Y = v.length; ++x < z; ) { 66698 var ie = ID(R[x], O[x]); 66699 if (ie) { 66700 if (x >= Y) 66701 return ie; 66702 var ve = v[x]; 66703 return ie * (ve == "desc" ? -1 : 1); 66704 } 66705 } 66706 return h.index - g.index; 66707 } 66708 function RD(h, g, v, x) { 66709 for (var R = -1, O = h.length, z = v.length, Y = -1, ie = g.length, ve = $i(O - z, 0), ye = le(ie + ve), xe = !x; ++Y < ie; ) 66710 ye[Y] = g[Y]; 66711 for (; ++R < z; ) 66712 (xe || R < O) && (ye[v[R]] = h[R]); 66713 for (; ve--; ) 66714 ye[Y++] = h[R++]; 66715 return ye; 66716 } 66717 function TD(h, g, v, x) { 66718 for (var R = -1, O = h.length, z = -1, Y = v.length, ie = -1, ve = g.length, ye = $i(O - Y, 0), xe = le(ye + ve), Oe = !x; ++R < ye; ) 66719 xe[R] = h[R]; 66720 for (var We = R; ++ie < ve; ) 66721 xe[We + ie] = g[ie]; 66722 for (; ++z < Y; ) 66723 (Oe || R < O) && (xe[We + v[z]] = h[R++]); 66724 return xe; 66725 } 66726 function nn(h, g) { 66727 var v = -1, x = h.length; 66728 for (g || (g = le(x)); ++v < x; ) 66729 g[v] = h[v]; 66730 return g; 66731 } 66732 function sr(h, g, v, x) { 66733 var R = !v; 66734 v || (v = {}); 66735 for (var O = -1, z = g.length; ++O < z; ) { 66736 var Y = g[O], ie = x ? x(v[Y], h[Y], Y, v, h) : i; 66737 ie === i && (ie = h[Y]), R ? tr(v, Y, ie) : hh(v, Y, ie); 66738 } 66739 return v; 66740 } 66741 function s5(h, g) { 66742 return sr(h, hb(h), g); 66743 } 66744 function n5(h, g) { 66745 return sr(h, UD(h), g); 66746 } 66747 function af(h, g) { 66748 return function(v, x) { 66749 var R = rt(v) ? cB : DG, O = g ? g() : {}; 66750 return R(v, h, Ze(x, 2), O); 66751 }; 66752 } 66753 function gu(h) { 66754 return ft(function(g, v) { 66755 var x = -1, R = v.length, O = R > 1 ? v[R - 1] : i, z = R > 2 ? v[2] : i; 66756 for (O = h.length > 3 && typeof O == "function" ? (R--, O) : i, z && Fs(v[0], v[1], z) && (O = R < 3 ? i : O, R = 1), g = Jt(g); ++x < R; ) { 66757 var Y = v[x]; 66758 Y && h(g, Y, x, O); 66759 } 66760 return g; 66761 }); 66762 } 66763 function LD(h, g) { 66764 return function(v, x) { 66765 if (v == null) 66766 return v; 66767 if (!on(v)) 66768 return h(v, x); 66769 for (var R = v.length, O = g ? R : -1, z = Jt(v); (g ? O-- : ++O < R) && x(z[O], O, z) !== !1; ) 66770 ; 66771 return v; 66772 }; 66773 } 66774 function kD(h) { 66775 return function(g, v, x) { 66776 for (var R = -1, O = Jt(g), z = x(g), Y = z.length; Y--; ) { 66777 var ie = z[h ? Y : ++R]; 66778 if (v(O[ie], ie, O) === !1) 66779 break; 66780 } 66781 return g; 66782 }; 66783 } 66784 function o5(h, g, v) { 66785 var x = g & C, R = vh(h); 66786 function O() { 66787 var z = this && this !== ls && this instanceof O ? R : h; 66788 return z.apply(x ? v : this, arguments); 66789 } 66790 return O; 66791 } 66792 function PD(h) { 66793 return function(g) { 66794 g = Vt(g); 66795 var v = au(g) ? Eo(g) : i, x = v ? v[0] : g.charAt(0), R = v ? Ha(v, 1).join("") : g.slice(1); 66796 return x[h]() + R; 66797 }; 66798 } 66799 function fu(h) { 66800 return function(g) { 66801 return TC(kE(LE(g).replace(Z4, "")), h, ""); 66802 }; 66803 } 66804 function vh(h) { 66805 return function() { 66806 var g = arguments; 66807 switch (g.length) { 66808 case 0: 66809 return new h(); 66810 case 1: 66811 return new h(g[0]); 66812 case 2: 66813 return new h(g[0], g[1]); 66814 case 3: 66815 return new h(g[0], g[1], g[2]); 66816 case 4: 66817 return new h(g[0], g[1], g[2], g[3]); 66818 case 5: 66819 return new h(g[0], g[1], g[2], g[3], g[4]); 66820 case 6: 66821 return new h(g[0], g[1], g[2], g[3], g[4], g[5]); 66822 case 7: 66823 return new h(g[0], g[1], g[2], g[3], g[4], g[5], g[6]); 66824 } 66825 var v = pu(h.prototype), x = h.apply(v, g); 66826 return bi(x) ? x : v; 66827 }; 66828 } 66829 function r5(h, g, v) { 66830 var x = vh(h); 66831 function R() { 66832 for (var O = arguments.length, z = le(O), Y = O, ie = mu(R); Y--; ) 66833 z[Y] = arguments[Y]; 66834 var ve = O < 3 && z[0] !== ie && z[O - 1] !== ie ? [] : Na(z, ie); 66835 if (O -= ve.length, O < v) 66836 return BD( 66837 h, 66838 g, 66839 lf, 66840 R.placeholder, 66841 i, 66842 z, 66843 ve, 66844 i, 66845 i, 66846 v - O 66847 ); 66848 var ye = this && this !== ls && this instanceof R ? x : h; 66849 return Rn(ye, this, z); 66850 } 66851 return R; 66852 } 66853 function FD(h) { 66854 return function(g, v, x) { 66855 var R = Jt(g); 66856 if (!on(g)) { 66857 var O = Ze(v, 3); 66858 g = ns(g), v = function(Y) { 66859 return O(R[Y], Y, R); 66860 }; 66861 } 66862 var z = h(g, v, x); 66863 return z > -1 ? R[O ? g[z] : z] : i; 66864 }; 66865 } 66866 function OD(h) { 66867 return _r(function(g) { 66868 var v = g.length, x = v, R = Yn.prototype.thru; 66869 for (h && g.reverse(); x--; ) { 66870 var O = g[x]; 66871 if (typeof O != "function") 66872 throw new $n(r); 66873 if (R && !z && hf(O) == "wrapper") 66874 var z = new Yn([], !0); 66875 } 66876 for (x = z ? x : v; ++x < v; ) { 66877 O = g[x]; 66878 var Y = hf(O), ie = Y == "wrapper" ? ub(O) : i; 66879 ie && gb(ie[0]) && ie[1] == (B | A | L | N) && !ie[4].length && ie[9] == 1 ? z = z[hf(ie[0])].apply(z, ie[3]) : z = O.length == 1 && gb(O) ? z[Y]() : z.thru(O); 66880 } 66881 return function() { 66882 var ve = arguments, ye = ve[0]; 66883 if (z && ve.length == 1 && rt(ye)) 66884 return z.plant(ye).value(); 66885 for (var xe = 0, Oe = v ? g[xe].apply(this, ve) : ye; ++xe < v; ) 66886 Oe = g[xe].call(this, Oe); 66887 return Oe; 66888 }; 66889 }); 66890 } 66891 function lf(h, g, v, x, R, O, z, Y, ie, ve) { 66892 var ye = g & B, xe = g & C, Oe = g & w, We = g & (A | I), qe = g & W, dt = Oe ? i : vh(h); 66893 function $e() { 66894 for (var yt = arguments.length, xt = le(yt), Fn = yt; Fn--; ) 66895 xt[Fn] = arguments[Fn]; 66896 if (We) 66897 var Os = mu($e), On = yB(xt, Os); 66898 if (x && (xt = RD(xt, x, R, We)), O && (xt = TD(xt, O, z, We)), yt -= On, We && yt < ve) { 66899 var ki = Na(xt, Os); 66900 return BD( 66901 h, 66902 g, 66903 lf, 66904 $e.placeholder, 66905 v, 66906 xt, 66907 ki, 66908 Y, 66909 ie, 66910 ve - yt 66911 ); 66912 } 66913 var Lo = xe ? v : this, Hr = Oe ? Lo[h] : h; 66914 return yt = xt.length, Y ? xt = D5(xt, Y) : qe && yt > 1 && xt.reverse(), ye && ie < yt && (xt.length = ie), this && this !== ls && this instanceof $e && (Hr = dt || vh(Hr)), Hr.apply(Lo, xt); 66915 } 66916 return $e; 66917 } 66918 function ND(h, g) { 66919 return function(v, x) { 66920 return FG(v, h, g(x), {}); 66921 }; 66922 } 66923 function cf(h, g) { 66924 return function(v, x) { 66925 var R; 66926 if (v === i && x === i) 66927 return g; 66928 if (v !== i && (R = v), x !== i) { 66929 if (R === i) 66930 return x; 66931 typeof v == "string" || typeof x == "string" ? (v = kn(v), x = kn(x)) : (v = wD(v), x = wD(x)), R = h(v, x); 66932 } 66933 return R; 66934 }; 66935 } 66936 function rb(h) { 66937 return _r(function(g) { 66938 return g = fi(g, Ln(Ze())), ft(function(v) { 66939 var x = this; 66940 return h(g, function(R) { 66941 return Rn(R, x, v); 66942 }); 66943 }); 66944 }); 66945 } 66946 function uf(h, g) { 66947 g = g === i ? " " : kn(g); 66948 var v = g.length; 66949 if (v < 2) 66950 return v ? JC(g, h) : g; 66951 var x = JC(g, Zg(h / lu(g))); 66952 return au(g) ? Ha(Eo(x), 0, h).join("") : x.slice(0, h); 66953 } 66954 function a5(h, g, v, x) { 66955 var R = g & C, O = vh(h); 66956 function z() { 66957 for (var Y = -1, ie = arguments.length, ve = -1, ye = x.length, xe = le(ye + ie), Oe = this && this !== ls && this instanceof z ? O : h; ++ve < ye; ) 66958 xe[ve] = x[ve]; 66959 for (; ie--; ) 66960 xe[ve++] = arguments[++Y]; 66961 return Rn(Oe, R ? v : this, xe); 66962 } 66963 return z; 66964 } 66965 function _D(h) { 66966 return function(g, v, x) { 66967 return x && typeof x != "number" && Fs(g, v, x) && (v = x = i), g = zr(g), v === i ? (v = g, g = 0) : v = zr(v), x = x === i ? g < v ? 1 : -1 : zr(x), $G(g, v, x, h); 66968 }; 66969 } 66970 function df(h) { 66971 return function(g, v) { 66972 return typeof g == "string" && typeof v == "string" || (g = Qn(g), v = Qn(v)), h(g, v); 66973 }; 66974 } 66975 function BD(h, g, v, x, R, O, z, Y, ie, ve) { 66976 var ye = g & A, xe = ye ? z : i, Oe = ye ? i : z, We = ye ? O : i, qe = ye ? i : O; 66977 g |= ye ? L : k, g &= ~(ye ? k : L), g & M || (g &= -4); 66978 var dt = [ 66979 h, 66980 g, 66981 R, 66982 We, 66983 xe, 66984 qe, 66985 Oe, 66986 Y, 66987 ie, 66988 ve 66989 ], $e = v.apply(i, dt); 66990 return gb(h) && qD($e, dt), $e.placeholder = x, QD($e, h, g); 66991 } 66992 function ab(h) { 66993 var g = ji[h]; 66994 return function(v, x) { 66995 if (v = Qn(v), x = x == null ? 0 : ms(ct(x), 292), x && QA(v)) { 66996 var R = (Vt(v) + "e").split("e"), O = g(R[0] + "e" + (+R[1] + x)); 66997 return R = (Vt(O) + "e").split("e"), +(R[0] + "e" + (+R[1] - x)); 66998 } 66999 return g(v); 67000 }; 67001 } 67002 var l5 = du && 1 / Gg(new du([, -0]))[1] == E ? function(h) { 67003 return new du(h); 67004 } : Tb; 67005 function GD(h) { 67006 return function(g) { 67007 var v = vs(g); 67008 return v == Q ? _C(g) : v == tt ? AB(g) : vB(g, h(g)); 67009 }; 67010 } 67011 function Nr(h, g, v, x, R, O, z, Y) { 67012 var ie = g & w; 67013 if (!ie && typeof h != "function") 67014 throw new $n(r); 67015 var ve = x ? x.length : 0; 67016 if (ve || (g &= -97, x = R = i), z = z === i ? z : $i(ct(z), 0), Y = Y === i ? Y : ct(Y), ve -= R ? R.length : 0, g & k) { 67017 var ye = x, xe = R; 67018 x = R = i; 67019 } 67020 var Oe = ie ? i : ub(h), We = [ 67021 h, 67022 g, 67023 v, 67024 x, 67025 R, 67026 ye, 67027 xe, 67028 O, 67029 z, 67030 Y 67031 ]; 67032 if (Oe && x5(We, Oe), h = We[0], g = We[1], v = We[2], x = We[3], R = We[4], Y = We[9] = We[9] === i ? ie ? 0 : h.length : $i(We[9] - ve, 0), !Y && g & (A | I) && (g &= -25), !g || g == C) 67033 var qe = o5(h, g, v); 67034 else g == A || g == I ? qe = r5(h, g, Y) : (g == L || g == (C | L)) && !R.length ? qe = a5(h, g, v, x) : qe = lf.apply(i, We); 67035 var dt = Oe ? CD : qD; 67036 return QD(dt(qe, We), h, g); 67037 } 67038 function zD(h, g, v, x) { 67039 return h === i || To(h, uu[v]) && !Ht.call(x, v) ? g : h; 67040 } 67041 function HD(h, g, v, x, R, O) { 67042 return bi(h) && bi(g) && (O.set(g, h), nf(h, g, i, HD, O), O.delete(g)), h; 67043 } 67044 function c5(h) { 67045 return bh(h) ? i : h; 67046 } 67047 function VD(h, g, v, x, R, O) { 67048 var z = v & y, Y = h.length, ie = g.length; 67049 if (Y != ie && !(z && ie > Y)) 67050 return !1; 67051 var ve = O.get(h), ye = O.get(g); 67052 if (ve && ye) 67053 return ve == g && ye == h; 67054 var xe = -1, Oe = !0, We = v & b ? new Kl() : i; 67055 for (O.set(h, g), O.set(g, h); ++xe < Y; ) { 67056 var qe = h[xe], dt = g[xe]; 67057 if (x) 67058 var $e = z ? x(dt, qe, xe, g, h, O) : x(qe, dt, xe, h, g, O); 67059 if ($e !== i) { 67060 if ($e) 67061 continue; 67062 Oe = !1; 67063 break; 67064 } 67065 if (We) { 67066 if (!LC(g, function(yt, xt) { 67067 if (!rh(We, xt) && (qe === yt || R(qe, yt, v, x, O))) 67068 return We.push(xt); 67069 })) { 67070 Oe = !1; 67071 break; 67072 } 67073 } else if (!(qe === dt || R(qe, dt, v, x, O))) { 67074 Oe = !1; 67075 break; 67076 } 67077 } 67078 return O.delete(h), O.delete(g), Oe; 67079 } 67080 function u5(h, g, v, x, R, O, z) { 67081 switch (v) { 67082 case _t: 67083 if (h.byteLength != g.byteLength || h.byteOffset != g.byteOffset) 67084 return !1; 67085 h = h.buffer, g = g.buffer; 67086 case Nt: 67087 return !(h.byteLength != g.byteLength || !O(new jg(h), new jg(g))); 67088 case J: 67089 case ne: 67090 case re: 67091 return To(+h, +g); 67092 case V: 67093 return h.name == g.name && h.message == g.message; 67094 case st: 67095 case Zt: 67096 return h == g + ""; 67097 case Q: 67098 var Y = _C; 67099 case tt: 67100 var ie = x & y; 67101 if (Y || (Y = Gg), h.size != g.size && !ie) 67102 return !1; 67103 var ve = z.get(h); 67104 if (ve) 67105 return ve == g; 67106 x |= b, z.set(h, g); 67107 var ye = VD(Y(h), Y(g), x, R, O, z); 67108 return z.delete(h), ye; 67109 case Ot: 67110 if (dh) 67111 return dh.call(h) == dh.call(g); 67112 } 67113 return !1; 67114 } 67115 function d5(h, g, v, x, R, O) { 67116 var z = v & y, Y = lb(h), ie = Y.length, ve = lb(g), ye = ve.length; 67117 if (ie != ye && !z) 67118 return !1; 67119 for (var xe = ie; xe--; ) { 67120 var Oe = Y[xe]; 67121 if (!(z ? Oe in g : Ht.call(g, Oe))) 67122 return !1; 67123 } 67124 var We = O.get(h), qe = O.get(g); 67125 if (We && qe) 67126 return We == g && qe == h; 67127 var dt = !0; 67128 O.set(h, g), O.set(g, h); 67129 for (var $e = z; ++xe < ie; ) { 67130 Oe = Y[xe]; 67131 var yt = h[Oe], xt = g[Oe]; 67132 if (x) 67133 var Fn = z ? x(xt, yt, Oe, g, h, O) : x(yt, xt, Oe, h, g, O); 67134 if (!(Fn === i ? yt === xt || R(yt, xt, v, x, O) : Fn)) { 67135 dt = !1; 67136 break; 67137 } 67138 $e || ($e = Oe == "constructor"); 67139 } 67140 if (dt && !$e) { 67141 var Os = h.constructor, On = g.constructor; 67142 Os != On && "constructor" in h && "constructor" in g && !(typeof Os == "function" && Os instanceof Os && typeof On == "function" && On instanceof On) && (dt = !1); 67143 } 67144 return O.delete(h), O.delete(g), dt; 67145 } 67146 function _r(h) { 67147 return mb(KD(h, i, sE), h + ""); 67148 } 67149 function lb(h) { 67150 return lD(h, ns, hb); 67151 } 67152 function cb(h) { 67153 return lD(h, rn, UD); 67154 } 67155 var ub = Qg ? function(h) { 67156 return Qg.get(h); 67157 } : Tb; 67158 function hf(h) { 67159 for (var g = h.name + "", v = hu[g], x = Ht.call(hu, g) ? v.length : 0; x--; ) { 67160 var R = v[x], O = R.func; 67161 if (O == null || O == h) 67162 return R.name; 67163 } 67164 return g; 67165 } 67166 function mu(h) { 67167 var g = Ht.call(F, "placeholder") ? F : h; 67168 return g.placeholder; 67169 } 67170 function Ze() { 67171 var h = F.iteratee || Ib; 67172 return h = h === Ib ? dD : h, arguments.length ? h(arguments[0], arguments[1]) : h; 67173 } 67174 function pf(h, g) { 67175 var v = h.__data__; 67176 return C5(g) ? v[typeof g == "string" ? "string" : "hash"] : v.map; 67177 } 67178 function db(h) { 67179 for (var g = ns(h), v = g.length; v--; ) { 67180 var x = g[v], R = h[x]; 67181 g[v] = [x, R, $D(R)]; 67182 } 67183 return g; 67184 } 67185 function Ql(h, g) { 67186 var v = SB(h, g); 67187 return uD(v) ? v : i; 67188 } 67189 function h5(h) { 67190 var g = Ht.call(h, $l), v = h[$l]; 67191 try { 67192 h[$l] = i; 67193 var x = !0; 67194 } catch { 67195 } 67196 var R = Ug.call(h); 67197 return x && (g ? h[$l] = v : delete h[$l]), R; 67198 } 67199 var hb = GC ? function(h) { 67200 return h == null ? [] : (h = Jt(h), Fa(GC(h), function(g) { 67201 return ZA.call(h, g); 67202 })); 67203 } : Lb, UD = GC ? function(h) { 67204 for (var g = []; h; ) 67205 Oa(g, hb(h)), h = $g(h); 67206 return g; 67207 } : Lb, vs = Ps; 67208 (zC && vs(new zC(new ArrayBuffer(1))) != _t || lh && vs(new lh()) != Q || HC && vs(HC.resolve()) != ze || du && vs(new du()) != tt || ch && vs(new ch()) != at) && (vs = function(h) { 67209 var g = Ps(h), v = g == Le ? h.constructor : i, x = v ? Xl(v) : ""; 67210 if (x) 67211 switch (x) { 67212 case KB: 67213 return _t; 67214 case ZB: 67215 return Q; 67216 case qB: 67217 return ze; 67218 case QB: 67219 return tt; 67220 case XB: 67221 return at; 67222 } 67223 return g; 67224 }); 67225 function p5(h, g, v) { 67226 for (var x = -1, R = v.length; ++x < R; ) { 67227 var O = v[x], z = O.size; 67228 switch (O.type) { 67229 case "drop": 67230 h += z; 67231 break; 67232 case "dropRight": 67233 g -= z; 67234 break; 67235 case "take": 67236 g = ms(g, h + z); 67237 break; 67238 case "takeRight": 67239 h = $i(h, g - z); 67240 break; 67241 } 67242 } 67243 return { start: h, end: g }; 67244 } 67245 function g5(h) { 67246 var g = h.match(w4); 67247 return g ? g[1].split(S4) : []; 67248 } 67249 function WD(h, g, v) { 67250 g = za(g, h); 67251 for (var x = -1, R = g.length, O = !1; ++x < R; ) { 67252 var z = Ro(g[x]); 67253 if (!(O = h != null && v(h, z))) 67254 break; 67255 h = h[z]; 67256 } 67257 return O || ++x != R ? O : (R = h == null ? 0 : h.length, !!R && bf(R) && Br(z, R) && (rt(h) || Jl(h))); 67258 } 67259 function f5(h) { 67260 var g = h.length, v = new h.constructor(g); 67261 return g && typeof h[0] == "string" && Ht.call(h, "index") && (v.index = h.index, v.input = h.input), v; 67262 } 67263 function jD(h) { 67264 return typeof h.constructor == "function" && !yh(h) ? pu($g(h)) : {}; 67265 } 67266 function m5(h, g, v) { 67267 var x = h.constructor; 67268 switch (g) { 67269 case Nt: 67270 return ob(h); 67271 case J: 67272 case ne: 67273 return new x(+h); 67274 case _t: 67275 return JG(h, v); 67276 case Xe: 67277 case ss: 67278 case Wi: 67279 case Bi: 67280 case Pa: 67281 case Pr: 67282 case ks: 67283 case yC: 67284 case CC: 67285 return ED(h, v); 67286 case Q: 67287 return new x(); 67288 case re: 67289 case Zt: 67290 return new x(h); 67291 case st: 67292 return e5(h); 67293 case tt: 67294 return new x(); 67295 case Ot: 67296 return t5(h); 67297 } 67298 } 67299 function v5(h, g) { 67300 var v = g.length; 67301 if (!v) 67302 return h; 67303 var x = v - 1; 67304 return g[x] = (v > 1 ? "& " : "") + g[x], g = g.join(v > 2 ? ", " : " "), h.replace(b4, `{ 67305/* [wrapped with ` + g + `] */ 67306`); 67307 } 67308 function y5(h) { 67309 return rt(h) || Jl(h) || !!(qA && h && h[qA]); 67310 } 67311 function Br(h, g) { 67312 var v = typeof h; 67313 return g = g ?? P, !!g && (v == "number" || v != "symbol" && T4.test(h)) && h > -1 && h % 1 == 0 && h < g; 67314 } 67315 function Fs(h, g, v) { 67316 if (!bi(v)) 67317 return !1; 67318 var x = typeof g; 67319 return (x == "number" ? on(v) && Br(g, v.length) : x == "string" && g in v) ? To(v[g], h) : !1; 67320 } 67321 function pb(h, g) { 67322 if (rt(h)) 67323 return !1; 67324 var v = typeof h; 67325 return v == "number" || v == "symbol" || v == "boolean" || h == null || Pn(h) ? !0 : m4.test(h) || !f4.test(h) || g != null && h in Jt(g); 67326 } 67327 function C5(h) { 67328 var g = typeof h; 67329 return g == "string" || g == "number" || g == "symbol" || g == "boolean" ? h !== "__proto__" : h === null; 67330 } 67331 function gb(h) { 67332 var g = hf(h), v = F[g]; 67333 if (typeof v != "function" || !(g in bt.prototype)) 67334 return !1; 67335 if (h === v) 67336 return !0; 67337 var x = ub(v); 67338 return !!x && h === x[0]; 67339 } 67340 function b5(h) { 67341 return !!$A && $A in h; 67342 } 67343 var w5 = Hg ? Gr : kb; 67344 function yh(h) { 67345 var g = h && h.constructor, v = typeof g == "function" && g.prototype || uu; 67346 return h === v; 67347 } 67348 function $D(h) { 67349 return h === h && !bi(h); 67350 } 67351 function YD(h, g) { 67352 return function(v) { 67353 return v == null ? !1 : v[h] === g && (g !== i || h in Jt(v)); 67354 }; 67355 } 67356 function S5(h) { 67357 var g = yf(h, function(x) { 67358 return v.size === u && v.clear(), x; 67359 }), v = g.cache; 67360 return g; 67361 } 67362 function x5(h, g) { 67363 var v = h[1], x = g[1], R = v | x, O = R < (C | w | B), z = x == B && v == A || x == B && v == N && h[7].length <= g[8] || x == (B | N) && g[7].length <= g[8] && v == A; 67364 if (!(O || z)) 67365 return h;
vendor: 16,384 bytes, lines 67366-67854
67366 x & C && (h[2] = g[2], R |= v & C ? 0 : M); 67367 var Y = g[3]; 67368 if (Y) { 67369 var ie = h[3]; 67370 h[3] = ie ? RD(ie, Y, g[4]) : Y, h[4] = ie ? Na(h[3], d) : g[4]; 67371 } 67372 return Y = g[5], Y && (ie = h[5], h[5] = ie ? TD(ie, Y, g[6]) : Y, h[6] = ie ? Na(h[5], d) : g[6]), Y = g[7], Y && (h[7] = Y), x & B && (h[8] = h[8] == null ? g[8] : ms(h[8], g[8])), h[9] == null && (h[9] = g[9]), h[0] = g[0], h[1] = R, h; 67373 } 67374 function M5(h) { 67375 var g = []; 67376 if (h != null) 67377 for (var v in Jt(h)) 67378 g.push(v); 67379 return g; 67380 } 67381 function A5(h) { 67382 return Ug.call(h); 67383 } 67384 function KD(h, g, v) { 67385 return g = $i(g === i ? h.length - 1 : g, 0), function() { 67386 for (var x = arguments, R = -1, O = $i(x.length - g, 0), z = le(O); ++R < O; ) 67387 z[R] = x[g + R]; 67388 R = -1; 67389 for (var Y = le(g + 1); ++R < g; ) 67390 Y[R] = x[R]; 67391 return Y[g] = v(z), Rn(h, this, Y); 67392 }; 67393 } 67394 function ZD(h, g) { 67395 return g.length < 2 ? h : ql(h, Zn(g, 0, -1)); 67396 } 67397 function D5(h, g) { 67398 for (var v = h.length, x = ms(g.length, v), R = nn(h); x--; ) { 67399 var O = g[x]; 67400 h[x] = Br(O, v) ? R[O] : i; 67401 } 67402 return h; 67403 } 67404 function fb(h, g) { 67405 if (!(g === "constructor" && typeof h[g] == "function") && g != "__proto__") 67406 return h[g]; 67407 } 67408 var qD = XD(CD), Ch = HB || function(h, g) { 67409 return ls.setTimeout(h, g); 67410 }, mb = XD(ZG); 67411 function QD(h, g, v) { 67412 var x = g + ""; 67413 return mb(h, v5(x, E5(g5(x), v))); 67414 } 67415 function XD(h) { 67416 var g = 0, v = 0; 67417 return function() { 67418 var x = jB(), R = te - (x - v); 67419 if (v = x, R > 0) { 67420 if (++g >= Ce) 67421 return arguments[0]; 67422 } else 67423 g = 0; 67424 return h.apply(i, arguments); 67425 }; 67426 } 67427 function gf(h, g) { 67428 var v = -1, x = h.length, R = x - 1; 67429 for (g = g === i ? x : g; ++v < g; ) { 67430 var O = XC(v, R), z = h[O]; 67431 h[O] = h[v], h[v] = z; 67432 } 67433 return h.length = g, h; 67434 } 67435 var JD = S5(function(h) { 67436 var g = []; 67437 return h.charCodeAt(0) === 46 && g.push(""), h.replace(v4, function(v, x, R, O) { 67438 g.push(R ? O.replace(M4, "$1") : x || v); 67439 }), g; 67440 }); 67441 function Ro(h) { 67442 if (typeof h == "string" || Pn(h)) 67443 return h; 67444 var g = h + ""; 67445 return g == "0" && 1 / h == -E ? "-0" : g; 67446 } 67447 function Xl(h) { 67448 if (h != null) { 67449 try { 67450 return Vg.call(h); 67451 } catch { 67452 } 67453 try { 67454 return h + ""; 67455 } catch { 67456 } 67457 } 67458 return ""; 67459 } 67460 function E5(h, g) { 67461 return Tn(be, function(v) { 67462 var x = "_." + v[0]; 67463 g & v[1] && !_g(h, x) && h.push(x); 67464 }), h.sort(); 67465 } 67466 function eE(h) { 67467 if (h instanceof bt) 67468 return h.clone(); 67469 var g = new Yn(h.__wrapped__, h.__chain__); 67470 return g.__actions__ = nn(h.__actions__), g.__index__ = h.__index__, g.__values__ = h.__values__, g; 67471 } 67472 function I5(h, g, v) { 67473 (v ? Fs(h, g, v) : g === i) ? g = 1 : g = $i(ct(g), 0); 67474 var x = h == null ? 0 : h.length; 67475 if (!x || g < 1) 67476 return []; 67477 for (var R = 0, O = 0, z = le(Zg(x / g)); R < x; ) 67478 z[O++] = Zn(h, R, R += g); 67479 return z; 67480 } 67481 function R5(h) { 67482 for (var g = -1, v = h == null ? 0 : h.length, x = 0, R = []; ++g < v; ) { 67483 var O = h[g]; 67484 O && (R[x++] = O); 67485 } 67486 return R; 67487 } 67488 function T5() { 67489 var h = arguments.length; 67490 if (!h) 67491 return []; 67492 for (var g = le(h - 1), v = arguments[0], x = h; x--; ) 67493 g[x - 1] = arguments[x]; 67494 return Oa(rt(v) ? nn(v) : [v], cs(g, 1)); 67495 } 67496 var L5 = ft(function(h, g) { 67497 return Li(h) ? ph(h, cs(g, 1, Li, !0)) : []; 67498 }), k5 = ft(function(h, g) { 67499 var v = qn(g); 67500 return Li(v) && (v = i), Li(h) ? ph(h, cs(g, 1, Li, !0), Ze(v, 2)) : []; 67501 }), P5 = ft(function(h, g) { 67502 var v = qn(g); 67503 return Li(v) && (v = i), Li(h) ? ph(h, cs(g, 1, Li, !0), i, v) : []; 67504 }); 67505 function F5(h, g, v) { 67506 var x = h == null ? 0 : h.length; 67507 return x ? (g = v || g === i ? 1 : ct(g), Zn(h, g < 0 ? 0 : g, x)) : []; 67508 } 67509 function O5(h, g, v) { 67510 var x = h == null ? 0 : h.length; 67511 return x ? (g = v || g === i ? 1 : ct(g), g = x - g, Zn(h, 0, g < 0 ? 0 : g)) : []; 67512 } 67513 function N5(h, g) { 67514 return h && h.length ? rf(h, Ze(g, 3), !0, !0) : []; 67515 } 67516 function _5(h, g) { 67517 return h && h.length ? rf(h, Ze(g, 3), !0) : []; 67518 } 67519 function B5(h, g, v, x) { 67520 var R = h == null ? 0 : h.length; 67521 return R ? (v && typeof v != "number" && Fs(h, g, v) && (v = 0, x = R), TG(h, g, v, x)) : []; 67522 } 67523 function tE(h, g, v) { 67524 var x = h == null ? 0 : h.length; 67525 if (!x) 67526 return -1; 67527 var R = v == null ? 0 : ct(v); 67528 return R < 0 && (R = $i(x + R, 0)), Bg(h, Ze(g, 3), R); 67529 } 67530 function iE(h, g, v) { 67531 var x = h == null ? 0 : h.length; 67532 if (!x) 67533 return -1; 67534 var R = x - 1; 67535 return v !== i && (R = ct(v), R = v < 0 ? $i(x + R, 0) : ms(R, x - 1)), Bg(h, Ze(g, 3), R, !0); 67536 } 67537 function sE(h) { 67538 var g = h == null ? 0 : h.length; 67539 return g ? cs(h, 1) : []; 67540 } 67541 function G5(h) { 67542 var g = h == null ? 0 : h.length; 67543 return g ? cs(h, E) : []; 67544 } 67545 function z5(h, g) { 67546 var v = h == null ? 0 : h.length; 67547 return v ? (g = g === i ? 1 : ct(g), cs(h, g)) : []; 67548 } 67549 function H5(h) { 67550 for (var g = -1, v = h == null ? 0 : h.length, x = {}; ++g < v; ) { 67551 var R = h[g]; 67552 tr(x, R[0], R[1]); 67553 } 67554 return x; 67555 } 67556 function nE(h) { 67557 return h && h.length ? h[0] : i; 67558 } 67559 function V5(h, g, v) { 67560 var x = h == null ? 0 : h.length; 67561 if (!x) 67562 return -1; 67563 var R = v == null ? 0 : ct(v); 67564 return R < 0 && (R = $i(x + R, 0)), ru(h, g, R); 67565 } 67566 function U5(h) { 67567 var g = h == null ? 0 : h.length; 67568 return g ? Zn(h, 0, -1) : []; 67569 } 67570 var W5 = ft(function(h) { 67571 var g = fi(h, sb); 67572 return g.length && g[0] === h[0] ? YC(g) : []; 67573 }), j5 = ft(function(h) { 67574 var g = qn(h), v = fi(h, sb); 67575 return g === qn(v) ? g = i : v.pop(), v.length && v[0] === h[0] ? YC(v, Ze(g, 2)) : []; 67576 }), $5 = ft(function(h) { 67577 var g = qn(h), v = fi(h, sb); 67578 return g = typeof g == "function" ? g : i, g && v.pop(), v.length && v[0] === h[0] ? YC(v, i, g) : []; 67579 }); 67580 function Y5(h, g) { 67581 return h == null ? "" : UB.call(h, g); 67582 } 67583 function qn(h) { 67584 var g = h == null ? 0 : h.length; 67585 return g ? h[g - 1] : i; 67586 } 67587 function K5(h, g, v) { 67588 var x = h == null ? 0 : h.length; 67589 if (!x) 67590 return -1; 67591 var R = x; 67592 return v !== i && (R = ct(v), R = R < 0 ? $i(x + R, 0) : ms(R, x - 1)), g === g ? EB(h, g, R) : Bg(h, BA, R, !0); 67593 } 67594 function Z5(h, g) { 67595 return h && h.length ? fD(h, ct(g)) : i; 67596 } 67597 var q5 = ft(oE); 67598 function oE(h, g) { 67599 return h && h.length && g && g.length ? QC(h, g) : h; 67600 } 67601 function Q5(h, g, v) { 67602 return h && h.length && g && g.length ? QC(h, g, Ze(v, 2)) : h; 67603 } 67604 function X5(h, g, v) { 67605 return h && h.length && g && g.length ? QC(h, g, i, v) : h; 67606 } 67607 var J5 = _r(function(h, g) { 67608 var v = h == null ? 0 : h.length, x = UC(h, g); 67609 return yD(h, fi(g, function(R) { 67610 return Br(R, v) ? +R : R; 67611 }).sort(ID)), x; 67612 }); 67613 function ez(h, g) { 67614 var v = []; 67615 if (!(h && h.length)) 67616 return v; 67617 var x = -1, R = [], O = h.length; 67618 for (g = Ze(g, 3); ++x < O; ) { 67619 var z = h[x]; 67620 g(z, x, h) && (v.push(z), R.push(x)); 67621 } 67622 return yD(h, R), v; 67623 } 67624 function vb(h) { 67625 return h == null ? h : YB.call(h); 67626 } 67627 function tz(h, g, v) { 67628 var x = h == null ? 0 : h.length; 67629 return x ? (v && typeof v != "number" && Fs(h, g, v) ? (g = 0, v = x) : (g = g == null ? 0 : ct(g), v = v === i ? x : ct(v)), Zn(h, g, v)) : []; 67630 } 67631 function iz(h, g) { 67632 return of(h, g); 67633 } 67634 function sz(h, g, v) { 67635 return eb(h, g, Ze(v, 2)); 67636 } 67637 function nz(h, g) { 67638 var v = h == null ? 0 : h.length; 67639 if (v) { 67640 var x = of(h, g); 67641 if (x < v && To(h[x], g)) 67642 return x; 67643 } 67644 return -1; 67645 } 67646 function oz(h, g) { 67647 return of(h, g, !0); 67648 } 67649 function rz(h, g, v) { 67650 return eb(h, g, Ze(v, 2), !0); 67651 } 67652 function az(h, g) { 67653 var v = h == null ? 0 : h.length; 67654 if (v) { 67655 var x = of(h, g, !0) - 1; 67656 if (To(h[x], g)) 67657 return x; 67658 } 67659 return -1; 67660 } 67661 function lz(h) { 67662 return h && h.length ? bD(h) : []; 67663 } 67664 function cz(h, g) { 67665 return h && h.length ? bD(h, Ze(g, 2)) : []; 67666 } 67667 function uz(h) { 67668 var g = h == null ? 0 : h.length; 67669 return g ? Zn(h, 1, g) : []; 67670 } 67671 function dz(h, g, v) { 67672 return h && h.length ? (g = v || g === i ? 1 : ct(g), Zn(h, 0, g < 0 ? 0 : g)) : []; 67673 } 67674 function hz(h, g, v) { 67675 var x = h == null ? 0 : h.length; 67676 return x ? (g = v || g === i ? 1 : ct(g), g = x - g, Zn(h, g < 0 ? 0 : g, x)) : []; 67677 } 67678 function pz(h, g) { 67679 return h && h.length ? rf(h, Ze(g, 3), !1, !0) : []; 67680 } 67681 function gz(h, g) { 67682 return h && h.length ? rf(h, Ze(g, 3)) : []; 67683 } 67684 var fz = ft(function(h) { 67685 return Ga(cs(h, 1, Li, !0)); 67686 }), mz = ft(function(h) { 67687 var g = qn(h); 67688 return Li(g) && (g = i), Ga(cs(h, 1, Li, !0), Ze(g, 2)); 67689 }), vz = ft(function(h) { 67690 var g = qn(h); 67691 return g = typeof g == "function" ? g : i, Ga(cs(h, 1, Li, !0), i, g); 67692 }); 67693 function yz(h) { 67694 return h && h.length ? Ga(h) : []; 67695 } 67696 function Cz(h, g) { 67697 return h && h.length ? Ga(h, Ze(g, 2)) : []; 67698 } 67699 function bz(h, g) { 67700 return g = typeof g == "function" ? g : i, h && h.length ? Ga(h, i, g) : []; 67701 } 67702 function yb(h) { 67703 if (!(h && h.length)) 67704 return []; 67705 var g = 0; 67706 return h = Fa(h, function(v) { 67707 if (Li(v)) 67708 return g = $i(v.length, g), !0; 67709 }), OC(g, function(v) { 67710 return fi(h, kC(v)); 67711 }); 67712 } 67713 function rE(h, g) { 67714 if (!(h && h.length)) 67715 return []; 67716 var v = yb(h); 67717 return g == null ? v : fi(v, function(x) { 67718 return Rn(g, i, x); 67719 }); 67720 } 67721 var wz = ft(function(h, g) { 67722 return Li(h) ? ph(h, g) : []; 67723 }), Sz = ft(function(h) { 67724 return ib(Fa(h, Li)); 67725 }), xz = ft(function(h) { 67726 var g = qn(h); 67727 return Li(g) && (g = i), ib(Fa(h, Li), Ze(g, 2)); 67728 }), Mz = ft(function(h) { 67729 var g = qn(h); 67730 return g = typeof g == "function" ? g : i, ib(Fa(h, Li), i, g); 67731 }), Az = ft(yb); 67732 function Dz(h, g) { 67733 return MD(h || [], g || [], hh); 67734 } 67735 function Ez(h, g) { 67736 return MD(h || [], g || [], mh); 67737 } 67738 var Iz = ft(function(h) { 67739 var g = h.length, v = g > 1 ? h[g - 1] : i; 67740 return v = typeof v == "function" ? (h.pop(), v) : i, rE(h, v); 67741 }); 67742 function aE(h) { 67743 var g = F(h); 67744 return g.__chain__ = !0, g; 67745 } 67746 function Rz(h, g) { 67747 return g(h), h; 67748 } 67749 function ff(h, g) { 67750 return g(h); 67751 } 67752 var Tz = _r(function(h) { 67753 var g = h.length, v = g ? h[0] : 0, x = this.__wrapped__, R = function(O) { 67754 return UC(O, h); 67755 }; 67756 return g > 1 || this.__actions__.length || !(x instanceof bt) || !Br(v) ? this.thru(R) : (x = x.slice(v, +v + (g ? 1 : 0)), x.__actions__.push({ 67757 func: ff, 67758 args: [R], 67759 thisArg: i 67760 }), new Yn(x, this.__chain__).thru(function(O) { 67761 return g && !O.length && O.push(i), O; 67762 })); 67763 }); 67764 function Lz() { 67765 return aE(this); 67766 } 67767 function kz() { 67768 return new Yn(this.value(), this.__chain__); 67769 } 67770 function Pz() { 67771 this.__values__ === i && (this.__values__ = wE(this.value())); 67772 var h = this.__index__ >= this.__values__.length, g = h ? i : this.__values__[this.__index__++]; 67773 return { done: h, value: g }; 67774 } 67775 function Fz() { 67776 return this; 67777 } 67778 function Oz(h) { 67779 for (var g, v = this; v instanceof Jg; ) { 67780 var x = eE(v); 67781 x.__index__ = 0, x.__values__ = i, g ? R.__wrapped__ = x : g = x; 67782 var R = x; 67783 v = v.__wrapped__; 67784 } 67785 return R.__wrapped__ = h, g; 67786 } 67787 function Nz() { 67788 var h = this.__wrapped__; 67789 if (h instanceof bt) { 67790 var g = h; 67791 return this.__actions__.length && (g = new bt(this)), g = g.reverse(), g.__actions__.push({ 67792 func: ff, 67793 args: [vb], 67794 thisArg: i 67795 }), new Yn(g, this.__chain__); 67796 } 67797 return this.thru(vb); 67798 } 67799 function _z() { 67800 return xD(this.__wrapped__, this.__actions__); 67801 } 67802 var Bz = af(function(h, g, v) { 67803 Ht.call(h, v) ? ++h[v] : tr(h, v, 1); 67804 }); 67805 function Gz(h, g, v) { 67806 var x = rt(h) ? NA : RG; 67807 return v && Fs(h, g, v) && (g = i), x(h, Ze(g, 3)); 67808 } 67809 function zz(h, g) { 67810 var v = rt(h) ? Fa : rD; 67811 return v(h, Ze(g, 3)); 67812 } 67813 var Hz = FD(tE), Vz = FD(iE); 67814 function Uz(h, g) { 67815 return cs(mf(h, g), 1); 67816 } 67817 function Wz(h, g) { 67818 return cs(mf(h, g), E); 67819 } 67820 function jz(h, g, v) { 67821 return v = v === i ? 1 : ct(v), cs(mf(h, g), v); 67822 } 67823 function lE(h, g) { 67824 var v = rt(h) ? Tn : Ba; 67825 return v(h, Ze(g, 3)); 67826 } 67827 function cE(h, g) { 67828 var v = rt(h) ? uB : oD; 67829 return v(h, Ze(g, 3)); 67830 } 67831 var $z = af(function(h, g, v) { 67832 Ht.call(h, v) ? h[v].push(g) : tr(h, v, [g]); 67833 }); 67834 function Yz(h, g, v, x) { 67835 h = on(h) ? h : yu(h), v = v && !x ? ct(v) : 0; 67836 var R = h.length; 67837 return v < 0 && (v = $i(R + v, 0)), wf(h) ? v <= R && h.indexOf(g, v) > -1 : !!R && ru(h, g, v) > -1; 67838 } 67839 var Kz = ft(function(h, g, v) { 67840 var x = -1, R = typeof g == "function", O = on(h) ? le(h.length) : []; 67841 return Ba(h, function(z) { 67842 O[++x] = R ? Rn(g, z, v) : gh(z, g, v); 67843 }), O; 67844 }), Zz = af(function(h, g, v) { 67845 tr(h, v, g); 67846 }); 67847 function mf(h, g) { 67848 var v = rt(h) ? fi : hD; 67849 return v(h, Ze(g, 3)); 67850 } 67851 function qz(h, g, v, x) { 67852 return h == null ? [] : (rt(g) || (g = g == null ? [] : [g]), v = x ? i : v, rt(v) || (v = v == null ? [] : [v]), mD(h, g, v)); 67853 } 67854 va
vendor: 10,640 bytes, lines 67854-68185
67854r Qz = af(function(h, g, v) { 67855 h[v ? 0 : 1].push(g); 67856 }, function() { 67857 return [[], []]; 67858 }); 67859 function Xz(h, g, v) { 67860 var x = rt(h) ? TC : zA, R = arguments.length < 3; 67861 return x(h, Ze(g, 4), v, R, Ba); 67862 } 67863 function Jz(h, g, v) { 67864 var x = rt(h) ? dB : zA, R = arguments.length < 3; 67865 return x(h, Ze(g, 4), v, R, oD); 67866 } 67867 function eH(h, g) { 67868 var v = rt(h) ? Fa : rD; 67869 return v(h, Cf(Ze(g, 3))); 67870 } 67871 function tH(h) { 67872 var g = rt(h) ? tD : YG; 67873 return g(h); 67874 } 67875 function iH(h, g, v) { 67876 (v ? Fs(h, g, v) : g === i) ? g = 1 : g = ct(g); 67877 var x = rt(h) ? MG : KG; 67878 return x(h, g); 67879 } 67880 function sH(h) { 67881 var g = rt(h) ? AG : qG; 67882 return g(h); 67883 } 67884 function nH(h) { 67885 if (h == null) 67886 return 0; 67887 if (on(h)) 67888 return wf(h) ? lu(h) : h.length; 67889 var g = vs(h); 67890 return g == Q || g == tt ? h.size : ZC(h).length; 67891 } 67892 function oH(h, g, v) { 67893 var x = rt(h) ? LC : QG; 67894 return v && Fs(h, g, v) && (g = i), x(h, Ze(g, 3)); 67895 } 67896 var rH = ft(function(h, g) { 67897 if (h == null) 67898 return []; 67899 var v = g.length; 67900 return v > 1 && Fs(h, g[0], g[1]) ? g = [] : v > 2 && Fs(g[0], g[1], g[2]) && (g = [g[0]]), mD(h, cs(g, 1), []); 67901 }), vf = zB || function() { 67902 return ls.Date.now(); 67903 }; 67904 function aH(h, g) { 67905 if (typeof g != "function") 67906 throw new $n(r); 67907 return h = ct(h), function() { 67908 if (--h < 1) 67909 return g.apply(this, arguments); 67910 }; 67911 } 67912 function uE(h, g, v) { 67913 return g = v ? i : g, g = h && g == null ? h.length : g, Nr(h, B, i, i, i, i, g); 67914 } 67915 function dE(h, g) { 67916 var v; 67917 if (typeof g != "function") 67918 throw new $n(r); 67919 return h = ct(h), function() { 67920 return --h > 0 && (v = g.apply(this, arguments)), h <= 1 && (g = i), v; 67921 }; 67922 } 67923 var Cb = ft(function(h, g, v) { 67924 var x = C; 67925 if (v.length) { 67926 var R = Na(v, mu(Cb)); 67927 x |= L; 67928 } 67929 return Nr(h, x, g, v, R); 67930 }), hE = ft(function(h, g, v) { 67931 var x = C | w; 67932 if (v.length) { 67933 var R = Na(v, mu(hE)); 67934 x |= L; 67935 } 67936 return Nr(g, x, h, v, R); 67937 }); 67938 function pE(h, g, v) { 67939 g = v ? i : g; 67940 var x = Nr(h, A, i, i, i, i, i, g); 67941 return x.placeholder = pE.placeholder, x; 67942 } 67943 function gE(h, g, v) { 67944 g = v ? i : g; 67945 var x = Nr(h, I, i, i, i, i, i, g); 67946 return x.placeholder = gE.placeholder, x; 67947 } 67948 function fE(h, g, v) { 67949 var x, R, O, z, Y, ie, ve = 0, ye = !1, xe = !1, Oe = !0; 67950 if (typeof h != "function") 67951 throw new $n(r); 67952 g = Qn(g) || 0, bi(v) && (ye = !!v.leading, xe = "maxWait" in v, O = xe ? $i(Qn(v.maxWait) || 0, g) : O, Oe = "trailing" in v ? !!v.trailing : Oe); 67953 function We(ki) { 67954 var Lo = x, Hr = R; 67955 return x = R = i, ve = ki, z = h.apply(Hr, Lo), z; 67956 } 67957 function qe(ki) { 67958 return ve = ki, Y = Ch(yt, g), ye ? We(ki) : z; 67959 } 67960 function dt(ki) { 67961 var Lo = ki - ie, Hr = ki - ve, OE = g - Lo; 67962 return xe ? ms(OE, O - Hr) : OE; 67963 } 67964 function $e(ki) { 67965 var Lo = ki - ie, Hr = ki - ve; 67966 return ie === i || Lo >= g || Lo < 0 || xe && Hr >= O; 67967 } 67968 function yt() { 67969 var ki = vf(); 67970 if ($e(ki)) 67971 return xt(ki); 67972 Y = Ch(yt, dt(ki)); 67973 } 67974 function xt(ki) { 67975 return Y = i, Oe && x ? We(ki) : (x = R = i, z); 67976 } 67977 function Fn() { 67978 Y !== i && AD(Y), ve = 0, x = ie = R = Y = i; 67979 } 67980 function Os() { 67981 return Y === i ? z : xt(vf()); 67982 } 67983 function On() { 67984 var ki = vf(), Lo = $e(ki); 67985 if (x = arguments, R = this, ie = ki, Lo) { 67986 if (Y === i) 67987 return qe(ie); 67988 if (xe) 67989 return AD(Y), Y = Ch(yt, g), We(ie); 67990 } 67991 return Y === i && (Y = Ch(yt, g)), z; 67992 } 67993 return On.cancel = Fn, On.flush = Os, On; 67994 } 67995 var lH = ft(function(h, g) { 67996 return nD(h, 1, g); 67997 }), cH = ft(function(h, g, v) { 67998 return nD(h, Qn(g) || 0, v); 67999 }); 68000 function uH(h) { 68001 return Nr(h, W); 68002 } 68003 function yf(h, g) { 68004 if (typeof h != "function" || g != null && typeof g != "function") 68005 throw new $n(r); 68006 var v = function() { 68007 var x = arguments, R = g ? g.apply(this, x) : x[0], O = v.cache; 68008 if (O.has(R)) 68009 return O.get(R); 68010 var z = h.apply(this, x); 68011 return v.cache = O.set(R, z) || O, z; 68012 }; 68013 return v.cache = new (yf.Cache || Or)(), v; 68014 } 68015 yf.Cache = Or; 68016 function Cf(h) { 68017 if (typeof h != "function") 68018 throw new $n(r); 68019 return function() { 68020 var g = arguments; 68021 switch (g.length) { 68022 case 0: 68023 return !h.call(this); 68024 case 1: 68025 return !h.call(this, g[0]); 68026 case 2: 68027 return !h.call(this, g[0], g[1]); 68028 case 3: 68029 return !h.call(this, g[0], g[1], g[2]); 68030 } 68031 return !h.apply(this, g); 68032 }; 68033 } 68034 function dH(h) { 68035 return dE(2, h); 68036 } 68037 var hH = XG(function(h, g) { 68038 g = g.length == 1 && rt(g[0]) ? fi(g[0], Ln(Ze())) : fi(cs(g, 1), Ln(Ze())); 68039 var v = g.length; 68040 return ft(function(x) { 68041 for (var R = -1, O = ms(x.length, v); ++R < O; ) 68042 x[R] = g[R].call(this, x[R]); 68043 return Rn(h, this, x); 68044 }); 68045 }), bb = ft(function(h, g) { 68046 var v = Na(g, mu(bb)); 68047 return Nr(h, L, i, g, v); 68048 }), mE = ft(function(h, g) { 68049 var v = Na(g, mu(mE)); 68050 return Nr(h, k, i, g, v); 68051 }), pH = _r(function(h, g) { 68052 return Nr(h, N, i, i, i, g); 68053 }); 68054 function gH(h, g) { 68055 if (typeof h != "function") 68056 throw new $n(r); 68057 return g = g === i ? g : ct(g), ft(h, g); 68058 } 68059 function fH(h, g) { 68060 if (typeof h != "function") 68061 throw new $n(r); 68062 return g = g == null ? 0 : $i(ct(g), 0), ft(function(v) { 68063 var x = v[g], R = Ha(v, 0, g); 68064 return x && Oa(R, x), Rn(h, this, R); 68065 }); 68066 } 68067 function mH(h, g, v) { 68068 var x = !0, R = !0; 68069 if (typeof h != "function") 68070 throw new $n(r); 68071 return bi(v) && (x = "leading" in v ? !!v.leading : x, R = "trailing" in v ? !!v.trailing : R), fE(h, g, { 68072 leading: x, 68073 maxWait: g, 68074 trailing: R 68075 }); 68076 } 68077 function vH(h) { 68078 return uE(h, 1); 68079 } 68080 function yH(h, g) { 68081 return bb(nb(g), h); 68082 } 68083 function CH() { 68084 if (!arguments.length) 68085 return []; 68086 var h = arguments[0]; 68087 return rt(h) ? h : [h]; 68088 } 68089 function bH(h) { 68090 return Kn(h, m); 68091 } 68092 function wH(h, g) { 68093 return g = typeof g == "function" ? g : i, Kn(h, m, g); 68094 } 68095 function SH(h) { 68096 return Kn(h, p | m); 68097 } 68098 function xH(h, g) { 68099 return g = typeof g == "function" ? g : i, Kn(h, p | m, g); 68100 } 68101 function MH(h, g) { 68102 return g == null || sD(h, g, ns(g)); 68103 } 68104 function To(h, g) { 68105 return h === g || h !== h && g !== g; 68106 } 68107 var AH = df($C), DH = df(function(h, g) { 68108 return h >= g; 68109 }), Jl = cD(/* @__PURE__ */ (function() { 68110 return arguments; 68111 })()) ? cD : function(h) { 68112 return Di(h) && Ht.call(h, "callee") && !ZA.call(h, "callee"); 68113 }, rt = le.isArray, EH = TA ? Ln(TA) : OG; 68114 function on(h) { 68115 return h != null && bf(h.length) && !Gr(h); 68116 } 68117 function Li(h) { 68118 return Di(h) && on(h); 68119 } 68120 function IH(h) { 68121 return h === !0 || h === !1 || Di(h) && Ps(h) == J; 68122 } 68123 var Va = VB || kb, RH = LA ? Ln(LA) : NG; 68124 function TH(h) { 68125 return Di(h) && h.nodeType === 1 && !bh(h); 68126 } 68127 function LH(h) { 68128 if (h == null) 68129 return !0; 68130 if (on(h) && (rt(h) || typeof h == "string" || typeof h.splice == "function" || Va(h) || vu(h) || Jl(h))) 68131 return !h.length; 68132 var g = vs(h); 68133 if (g == Q || g == tt) 68134 return !h.size; 68135 if (yh(h)) 68136 return !ZC(h).length; 68137 for (var v in h) 68138 if (Ht.call(h, v)) 68139 return !1; 68140 return !0; 68141 } 68142 function kH(h, g) { 68143 return fh(h, g); 68144 } 68145 function PH(h, g, v) { 68146 v = typeof v == "function" ? v : i; 68147 var x = v ? v(h, g) : i; 68148 return x === i ? fh(h, g, i, v) : !!x; 68149 } 68150 function wb(h) { 68151 if (!Di(h)) 68152 return !1; 68153 var g = Ps(h); 68154 return g == V || g == me || typeof h.message == "string" && typeof h.name == "string" && !bh(h); 68155 } 68156 function FH(h) { 68157 return typeof h == "number" && QA(h); 68158 } 68159 function Gr(h) { 68160 if (!bi(h)) 68161 return !1; 68162 var g = Ps(h); 68163 return g == X || g == H || g == j || g == Ke; 68164 } 68165 function vE(h) { 68166 return typeof h == "number" && h == ct(h); 68167 } 68168 function bf(h) { 68169 return typeof h == "number" && h > -1 && h % 1 == 0 && h <= P; 68170 } 68171 function bi(h) { 68172 var g = typeof h; 68173 return h != null && (g == "object" || g == "function"); 68174 } 68175 function Di(h) { 68176 return h != null && typeof h == "object"; 68177 } 68178 var yE = kA ? Ln(kA) : BG; 68179 function OH(h, g) { 68180 return h === g || KC(h, g, db(g)); 68181 } 68182 function NH(h, g, v) { 68183 return v = typeof v == "function" ? v : i, KC(h, g, db(g), v); 68184 } 68185 function _H(h) {
vendor: 5,151 bytes, lines 68186-68354
68186 return CE(h) && h != +h; 68187 } 68188 function BH(h) { 68189 if (w5(h)) 68190 throw new nt(o); 68191 return uD(h); 68192 } 68193 function GH(h) { 68194 return h === null; 68195 } 68196 function zH(h) { 68197 return h == null; 68198 } 68199 function CE(h) { 68200 return typeof h == "number" || Di(h) && Ps(h) == re; 68201 } 68202 function bh(h) { 68203 if (!Di(h) || Ps(h) != Le) 68204 return !1; 68205 var g = $g(h); 68206 if (g === null) 68207 return !0; 68208 var v = Ht.call(g, "constructor") && g.constructor; 68209 return typeof v == "function" && v instanceof v && Vg.call(v) == NB; 68210 } 68211 var Sb = PA ? Ln(PA) : GG; 68212 function HH(h) { 68213 return vE(h) && h >= -P && h <= P; 68214 } 68215 var bE = FA ? Ln(FA) : zG; 68216 function wf(h) { 68217 return typeof h == "string" || !rt(h) && Di(h) && Ps(h) == Zt; 68218 } 68219 function Pn(h) { 68220 return typeof h == "symbol" || Di(h) && Ps(h) == Ot; 68221 } 68222 var vu = OA ? Ln(OA) : HG; 68223 function VH(h) { 68224 return h === i; 68225 } 68226 function UH(h) { 68227 return Di(h) && vs(h) == at; 68228 } 68229 function WH(h) { 68230 return Di(h) && Ps(h) == Ue; 68231 } 68232 var jH = df(qC), $H = df(function(h, g) { 68233 return h <= g; 68234 }); 68235 function wE(h) { 68236 if (!h) 68237 return []; 68238 if (on(h)) 68239 return wf(h) ? Eo(h) : nn(h); 68240 if (ah && h[ah]) 68241 return MB(h[ah]()); 68242 var g = vs(h), v = g == Q ? _C : g == tt ? Gg : yu; 68243 return v(h); 68244 } 68245 function zr(h) { 68246 if (!h) 68247 return h === 0 ? h : 0; 68248 if (h = Qn(h), h === E || h === -E) { 68249 var g = h < 0 ? -1 : 1; 68250 return g * G; 68251 } 68252 return h === h ? h : 0; 68253 } 68254 function ct(h) { 68255 var g = zr(h), v = g % 1; 68256 return g === g ? v ? g - v : g : 0; 68257 } 68258 function SE(h) { 68259 return h ? Zl(ct(h), 0, K) : 0; 68260 } 68261 function Qn(h) { 68262 if (typeof h == "number") 68263 return h; 68264 if (Pn(h)) 68265 return _; 68266 if (bi(h)) { 68267 var g = typeof h.valueOf == "function" ? h.valueOf() : h; 68268 h = bi(g) ? g + "" : g; 68269 } 68270 if (typeof h != "string") 68271 return h === 0 ? h : +h; 68272 h = HA(h); 68273 var v = E4.test(h); 68274 return v || R4.test(h) ? aB(h.slice(2), v ? 2 : 8) : D4.test(h) ? _ : +h; 68275 } 68276 function xE(h) { 68277 return sr(h, rn(h)); 68278 } 68279 function YH(h) { 68280 return h ? Zl(ct(h), -P, P) : h === 0 ? h : 0; 68281 } 68282 function Vt(h) { 68283 return h == null ? "" : kn(h); 68284 } 68285 var KH = gu(function(h, g) { 68286 if (yh(g) || on(g)) { 68287 sr(g, ns(g), h); 68288 return; 68289 } 68290 for (var v in g) 68291 Ht.call(g, v) && hh(h, v, g[v]); 68292 }), ME = gu(function(h, g) { 68293 sr(g, rn(g), h); 68294 }), AE = gu(function(h, g, v, x) { 68295 sr(g, rn(g), h, x); 68296 }), xb = gu(function(h, g, v, x) { 68297 sr(g, ns(g), h, x); 68298 }), ZH = _r(UC); 68299 function qH(h, g) { 68300 var v = pu(h); 68301 return g == null ? v : iD(v, g); 68302 } 68303 var QH = ft(function(h, g) { 68304 h = Jt(h); 68305 var v = -1, x = g.length, R = x > 2 ? g[2] : i; 68306 for (R && Fs(g[0], g[1], R) && (x = 1); ++v < x; ) 68307 for (var O = g[v], z = rn(O), Y = -1, ie = z.length; ++Y < ie; ) { 68308 var ve = z[Y], ye = h[ve]; 68309 (ye === i || To(ye, uu[ve]) && !Ht.call(h, ve)) && (h[ve] = O[ve]); 68310 } 68311 return h; 68312 }), XH = ft(function(h) { 68313 return h.push(i, HD), Rn(DE, i, h); 68314 }); 68315 function JH(h, g) { 68316 return _A(h, Ze(g, 3), ir); 68317 } 68318 function eV(h, g) { 68319 return _A(h, Ze(g, 3), jC); 68320 } 68321 function tV(h, g) { 68322 return h == null ? h : WC(h, Ze(g, 3), rn); 68323 } 68324 function iV(h, g) { 68325 return h == null ? h : aD(h, Ze(g, 3), rn); 68326 } 68327 function sV(h, g) { 68328 return h && ir(h, Ze(g, 3)); 68329 } 68330 function nV(h, g) { 68331 return h && jC(h, Ze(g, 3)); 68332 } 68333 function oV(h) { 68334 return h == null ? [] : sf(h, ns(h)); 68335 } 68336 function rV(h) { 68337 return h == null ? [] : sf(h, rn(h)); 68338 } 68339 function Mb(h, g, v) { 68340 var x = h == null ? i : ql(h, g); 68341 return x === i ? v : x; 68342 } 68343 function aV(h, g) { 68344 return h != null && WD(h, g, LG); 68345 } 68346 function Ab(h, g) { 68347 return h != null && WD(h, g, kG); 68348 } 68349 var lV = ND(function(h, g, v) { 68350 g != null && typeof g.toString != "function" && (g = Ug.call(g)), h[g] = v; 68351 }, Eb(an)), cV = ND(function(h, g, v) { 68352 g != null && typeof g.toString != "function" && (g = Ug.call(g)), Ht.call(h, g) ? h[g].push(v) : h[g] = [v]; 68353 }, Ze), uV = ft(gh); 68354 function ns(h) {
vendor: 4,201 bytes, lines 68355-68477
68355 return on(h) ? eD(h) : ZC(h); 68356 } 68357 function rn(h) { 68358 return on(h) ? eD(h, !0) : VG(h); 68359 } 68360 function dV(h, g) { 68361 var v = {}; 68362 return g = Ze(g, 3), ir(h, function(x, R, O) { 68363 tr(v, g(x, R, O), x); 68364 }), v; 68365 } 68366 function hV(h, g) { 68367 var v = {}; 68368 return g = Ze(g, 3), ir(h, function(x, R, O) { 68369 tr(v, R, g(x, R, O)); 68370 }), v; 68371 } 68372 var pV = gu(function(h, g, v) { 68373 nf(h, g, v); 68374 }), DE = gu(function(h, g, v, x) { 68375 nf(h, g, v, x); 68376 }), gV = _r(function(h, g) { 68377 var v = {}; 68378 if (h == null) 68379 return v; 68380 var x = !1; 68381 g = fi(g, function(O) { 68382 return O = za(O, h), x || (x = O.length > 1), O; 68383 }), sr(h, cb(h), v), x && (v = Kn(v, p | f | m, c5)); 68384 for (var R = g.length; R--; ) 68385 tb(v, g[R]); 68386 return v; 68387 }); 68388 function fV(h, g) { 68389 return EE(h, Cf(Ze(g))); 68390 } 68391 var mV = _r(function(h, g) { 68392 return h == null ? {} : WG(h, g); 68393 }); 68394 function EE(h, g) { 68395 if (h == null) 68396 return {}; 68397 var v = fi(cb(h), function(x) { 68398 return [x]; 68399 }); 68400 return g = Ze(g), vD(h, v, function(x, R) { 68401 return g(x, R[0]); 68402 }); 68403 } 68404 function vV(h, g, v) { 68405 g = za(g, h); 68406 var x = -1, R = g.length; 68407 for (R || (R = 1, h = i); ++x < R; ) { 68408 var O = h == null ? i : h[Ro(g[x])]; 68409 O === i && (x = R, O = v), h = Gr(O) ? O.call(h) : O; 68410 } 68411 return h; 68412 } 68413 function yV(h, g, v) { 68414 return h == null ? h : mh(h, g, v); 68415 } 68416 function CV(h, g, v, x) { 68417 return x = typeof x == "function" ? x : i, h == null ? h : mh(h, g, v, x); 68418 } 68419 var IE = GD(ns), RE = GD(rn); 68420 function bV(h, g, v) { 68421 var x = rt(h), R = x || Va(h) || vu(h); 68422 if (g = Ze(g, 4), v == null) { 68423 var O = h && h.constructor; 68424 R ? v = x ? new O() : [] : bi(h) ? v = Gr(O) ? pu($g(h)) : {} : v = {}; 68425 } 68426 return (R ? Tn : ir)(h, function(z, Y, ie) { 68427 return g(v, z, Y, ie); 68428 }), v; 68429 } 68430 function wV(h, g) { 68431 return h == null ? !0 : tb(h, g); 68432 } 68433 function SV(h, g, v) { 68434 return h == null ? h : SD(h, g, nb(v)); 68435 } 68436 function xV(h, g, v, x) { 68437 return x = typeof x == "function" ? x : i, h == null ? h : SD(h, g, nb(v), x); 68438 } 68439 function yu(h) { 68440 return h == null ? [] : NC(h, ns(h)); 68441 } 68442 function MV(h) { 68443 return h == null ? [] : NC(h, rn(h)); 68444 } 68445 function AV(h, g, v) { 68446 return v === i && (v = g, g = i), v !== i && (v = Qn(v), v = v === v ? v : 0), g !== i && (g = Qn(g), g = g === g ? g : 0), Zl(Qn(h), g, v); 68447 } 68448 function DV(h, g, v) { 68449 return g = zr(g), v === i ? (v = g, g = 0) : v = zr(v), h = Qn(h), PG(h, g, v); 68450 } 68451 function EV(h, g, v) { 68452 if (v && typeof v != "boolean" && Fs(h, g, v) && (g = v = i), v === i && (typeof g == "boolean" ? (v = g, g = i) : typeof h == "boolean" && (v = h, h = i)), h === i && g === i ? (h = 0, g = 1) : (h = zr(h), g === i ? (g = h, h = 0) : g = zr(g)), h > g) { 68453 var x = h; 68454 h = g, g = x; 68455 } 68456 if (v || h % 1 || g % 1) { 68457 var R = XA(); 68458 return ms(h + R * (g - h + rB("1e-" + ((R + "").length - 1))), g); 68459 } 68460 return XC(h, g); 68461 } 68462 var IV = fu(function(h, g, v) { 68463 return g = g.toLowerCase(), h + (v ? TE(g) : g); 68464 }); 68465 function TE(h) { 68466 return Db(Vt(h).toLowerCase()); 68467 } 68468 function LE(h) { 68469 return h = Vt(h), h && h.replace(L4, CB).replace(q4, ""); 68470 } 68471 function RV(h, g, v) { 68472 h = Vt(h), g = kn(g); 68473 var x = h.length; 68474 v = v === i ? x : Zl(ct(v), 0, x); 68475 var R = v; 68476 return v -= g.length, v >= 0 && h.slice(v, R) == g; 68477 }
vendor: 7,971 bytes, lines 68478-68706
68478 function TV(h) { 68479 return h = Vt(h), h && h4.test(h) ? h.replace(rA, bB) : h; 68480 } 68481 function LV(h) { 68482 return h = Vt(h), h && y4.test(h) ? h.replace(bC, "\\$&") : h; 68483 } 68484 var kV = fu(function(h, g, v) { 68485 return h + (v ? "-" : "") + g.toLowerCase(); 68486 }), PV = fu(function(h, g, v) { 68487 return h + (v ? " " : "") + g.toLowerCase(); 68488 }), FV = PD("toLowerCase"); 68489 function OV(h, g, v) { 68490 h = Vt(h), g = ct(g); 68491 var x = g ? lu(h) : 0; 68492 if (!g || x >= g) 68493 return h; 68494 var R = (g - x) / 2; 68495 return uf(qg(R), v) + h + uf(Zg(R), v); 68496 } 68497 function NV(h, g, v) { 68498 h = Vt(h), g = ct(g); 68499 var x = g ? lu(h) : 0; 68500 return g && x < g ? h + uf(g - x, v) : h; 68501 } 68502 function _V(h, g, v) { 68503 h = Vt(h), g = ct(g); 68504 var x = g ? lu(h) : 0; 68505 return g && x < g ? uf(g - x, v) + h : h; 68506 } 68507 function BV(h, g, v) { 68508 return v || g == null ? g = 0 : g && (g = +g), $B(Vt(h).replace(wC, ""), g || 0); 68509 } 68510 function GV(h, g, v) { 68511 return (v ? Fs(h, g, v) : g === i) ? g = 1 : g = ct(g), JC(Vt(h), g); 68512 } 68513 function zV() { 68514 var h = arguments, g = Vt(h[0]); 68515 return h.length < 3 ? g : g.replace(h[1], h[2]); 68516 } 68517 var HV = fu(function(h, g, v) { 68518 return h + (v ? "_" : "") + g.toLowerCase(); 68519 }); 68520 function VV(h, g, v) { 68521 return v && typeof v != "number" && Fs(h, g, v) && (g = v = i), v = v === i ? K : v >>> 0, v ? (h = Vt(h), h && (typeof g == "string" || g != null && !Sb(g)) && (g = kn(g), !g && au(h)) ? Ha(Eo(h), 0, v) : h.split(g, v)) : []; 68522 } 68523 var UV = fu(function(h, g, v) { 68524 return h + (v ? " " : "") + Db(g); 68525 }); 68526 function WV(h, g, v) { 68527 return h = Vt(h), v = v == null ? 0 : Zl(ct(v), 0, h.length), g = kn(g), h.slice(v, v + g.length) == g; 68528 } 68529 function jV(h, g, v) { 68530 var x = F.templateSettings; 68531 v && Fs(h, g, v) && (g = i), h = Vt(h), g = xb({}, g, x, zD); 68532 var R = xb({}, g.imports, x.imports, zD), O = ns(R), z = NC(R, O); 68533 Tn(O, function($e) { 68534 if (lA.test($e)) 68535 throw new nt(l); 68536 }); 68537 var Y, ie, ve = 0, ye = g.interpolate || Fg, xe = "__p += '", Oe = BC( 68538 (g.escape || Fg).source + "|" + ye.source + "|" + (ye === aA ? A4 : Fg).source + "|" + (g.evaluate || Fg).source + "|$", 68539 "g" 68540 ), We = "//# sourceURL=" + (Ht.call(g, "sourceURL") ? (g.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++tB + "]") + ` 68541`; 68542 h.replace(Oe, function($e, yt, xt, Fn, Os, On) { 68543 return xt || (xt = Fn), xe += h.slice(ve, On).replace(k4, wB), yt && (Y = !0, xe += `' + 68544__e(` + yt + `) + 68545'`), Os && (ie = !0, xe += `'; 68546` + Os + `; 68547__p += '`), xt && (xe += `' + 68548((__t = (` + xt + `)) == null ? '' : __t) + 68549'`), ve = On + $e.length, $e; 68550 }), xe += `'; 68551`; 68552 var qe = Ht.call(g, "variable") && g.variable; 68553 if (!qe) 68554 xe = `with (obj) { 68555` + xe + ` 68556} 68557`; 68558 else if (lA.test(qe)) 68559 throw new nt(a); 68560 xe = (ie ? xe.replace(l4, "") : xe).replace(c4, "$1").replace(u4, "$1;"), xe = "function(" + (qe || "obj") + `) { 68561` + (qe ? "" : `obj || (obj = {}); 68562`) + "var __t, __p = ''" + (Y ? ", __e = _.escape" : "") + (ie ? `, __j = Array.prototype.join; 68563function print() { __p += __j.call(arguments, '') } 68564` : `; 68565`) + xe + `return __p 68566}`; 68567 var dt = PE(function() { 68568 return Bt(O, We + "return " + xe).apply(i, z); 68569 }); 68570 if (dt.source = xe, wb(dt)) 68571 throw dt; 68572 return dt; 68573 } 68574 function $V(h) { 68575 return Vt(h).toLowerCase(); 68576 } 68577 function YV(h) { 68578 return Vt(h).toUpperCase(); 68579 } 68580 function KV(h, g, v) { 68581 if (h = Vt(h), h && (v || g === i)) 68582 return HA(h); 68583 if (!h || !(g = kn(g))) 68584 return h; 68585 var x = Eo(h), R = Eo(g), O = VA(x, R), z = UA(x, R) + 1; 68586 return Ha(x, O, z).join(""); 68587 } 68588 function ZV(h, g, v) { 68589 if (h = Vt(h), h && (v || g === i)) 68590 return h.slice(0, jA(h) + 1); 68591 if (!h || !(g = kn(g))) 68592 return h; 68593 var x = Eo(h), R = UA(x, Eo(g)) + 1; 68594 return Ha(x, 0, R).join(""); 68595 } 68596 function qV(h, g, v) { 68597 if (h = Vt(h), h && (v || g === i)) 68598 return h.replace(wC, ""); 68599 if (!h || !(g = kn(g))) 68600 return h; 68601 var x = Eo(h), R = VA(x, Eo(g)); 68602 return Ha(x, R).join(""); 68603 } 68604 function QV(h, g) { 68605 var v = se, x = ue; 68606 if (bi(g)) { 68607 var R = "separator" in g ? g.separator : R; 68608 v = "length" in g ? ct(g.length) : v, x = "omission" in g ? kn(g.omission) : x; 68609 } 68610 h = Vt(h); 68611 var O = h.length; 68612 if (au(h)) { 68613 var z = Eo(h); 68614 O = z.length; 68615 } 68616 if (v >= O) 68617 return h; 68618 var Y = v - lu(x); 68619 if (Y < 1) 68620 return x; 68621 var ie = z ? Ha(z, 0, Y).join("") : h.slice(0, Y); 68622 if (R === i) 68623 return ie + x; 68624 if (z && (Y += ie.length - Y), Sb(R)) { 68625 if (h.slice(Y).search(R)) { 68626 var ve, ye = ie; 68627 for (R.global || (R = BC(R.source, Vt(cA.exec(R)) + "g")), R.lastIndex = 0; ve = R.exec(ye); ) 68628 var xe = ve.index; 68629 ie = ie.slice(0, xe === i ? Y : xe); 68630 } 68631 } else if (h.indexOf(kn(R), Y) != Y) { 68632 var Oe = ie.lastIndexOf(R); 68633 Oe > -1 && (ie = ie.slice(0, Oe)); 68634 } 68635 return ie + x; 68636 } 68637 function XV(h) { 68638 return h = Vt(h), h && d4.test(h) ? h.replace(oA, IB) : h; 68639 } 68640 var JV = fu(function(h, g, v) { 68641 return h + (v ? " " : "") + g.toUpperCase(); 68642 }), Db = PD("toUpperCase"); 68643 function kE(h, g, v) { 68644 return h = Vt(h), g = v ? i : g, g === i ? xB(h) ? LB(h) : gB(h) : h.match(g) || []; 68645 } 68646 var PE = ft(function(h, g) { 68647 try { 68648 return Rn(h, i, g); 68649 } catch (v) { 68650 return wb(v) ? v : new nt(v); 68651 } 68652 }), e6 = _r(function(h, g) { 68653 return Tn(g, function(v) { 68654 v = Ro(v), tr(h, v, Cb(h[v], h)); 68655 }), h; 68656 }); 68657 function t6(h) { 68658 var g = h == null ? 0 : h.length, v = Ze(); 68659 return h = g ? fi(h, function(x) { 68660 if (typeof x[1] != "function") 68661 throw new $n(r); 68662 return [v(x[0]), x[1]]; 68663 }) : [], ft(function(x) { 68664 for (var R = -1; ++R < g; ) { 68665 var O = h[R]; 68666 if (Rn(O[0], this, x)) 68667 return Rn(O[1], this, x); 68668 } 68669 }); 68670 } 68671 function i6(h) { 68672 return IG(Kn(h, p)); 68673 } 68674 function Eb(h) { 68675 return function() { 68676 return h; 68677 }; 68678 } 68679 function s6(h, g) { 68680 return h == null || h !== h ? g : h; 68681 } 68682 var n6 = OD(), o6 = OD(!0); 68683 function an(h) { 68684 return h; 68685 } 68686 function Ib(h) { 68687 return dD(typeof h == "function" ? h : Kn(h, p)); 68688 } 68689 function r6(h) { 68690 return pD(Kn(h, p)); 68691 } 68692 function a6(h, g) { 68693 return gD(h, Kn(g, p)); 68694 } 68695 var l6 = ft(function(h, g) { 68696 return function(v) { 68697 return gh(v, h, g); 68698 }; 68699 }), c6 = ft(function(h, g) { 68700 return function(v) { 68701 return gh(h, v, g); 68702 }; 68703 }); 68704 function Rb(h, g, v) { 68705 var x = ns(g), R = sf(g, x); 68706 v == null && !(bi(g) && (R.length || !x.length)) && (v = g, g = h, h
vendor: 9,257 bytes, lines 68706-68834
68706= this, R = sf(g, ns(g))); 68707 var O = !(bi(v) && "chain" in v) || !!v.chain, z = Gr(h); 68708 return Tn(R, function(Y) { 68709 var ie = g[Y]; 68710 h[Y] = ie, z && (h.prototype[Y] = function() { 68711 var ve = this.__chain__; 68712 if (O || ve) { 68713 var ye = h(this.__wrapped__), xe = ye.__actions__ = nn(this.__actions__); 68714 return xe.push({ func: ie, args: arguments, thisArg: h }), ye.__chain__ = ve, ye; 68715 } 68716 return ie.apply(h, Oa([this.value()], arguments)); 68717 }); 68718 }), h; 68719 } 68720 function u6() { 68721 return ls._ === this && (ls._ = _B), this; 68722 } 68723 function Tb() { 68724 } 68725 function d6(h) { 68726 return h = ct(h), ft(function(g) { 68727 return fD(g, h); 68728 }); 68729 } 68730 var h6 = rb(fi), p6 = rb(NA), g6 = rb(LC); 68731 function FE(h) { 68732 return pb(h) ? kC(Ro(h)) : jG(h); 68733 } 68734 function f6(h) { 68735 return function(g) { 68736 return h == null ? i : ql(h, g); 68737 }; 68738 } 68739 var m6 = _D(), v6 = _D(!0); 68740 function Lb() { 68741 return []; 68742 } 68743 function kb() { 68744 return !1; 68745 } 68746 function y6() { 68747 return {}; 68748 } 68749 function C6() { 68750 return ""; 68751 } 68752 function b6() { 68753 return !0; 68754 } 68755 function w6(h, g) { 68756 if (h = ct(h), h < 1 || h > P) 68757 return []; 68758 var v = K, x = ms(h, K); 68759 g = Ze(g), h -= K; 68760 for (var R = OC(x, g); ++v < h; ) 68761 g(v); 68762 return R; 68763 } 68764 function S6(h) { 68765 return rt(h) ? fi(h, Ro) : Pn(h) ? [h] : nn(JD(Vt(h))); 68766 } 68767 function x6(h) { 68768 var g = ++OB; 68769 return Vt(h) + g; 68770 } 68771 var M6 = cf(function(h, g) { 68772 return h + g; 68773 }, 0), A6 = ab("ceil"), D6 = cf(function(h, g) { 68774 return h / g; 68775 }, 1), E6 = ab("floor"); 68776 function I6(h) { 68777 return h && h.length ? tf(h, an, $C) : i; 68778 } 68779 function R6(h, g) { 68780 return h && h.length ? tf(h, Ze(g, 2), $C) : i; 68781 } 68782 function T6(h) { 68783 return GA(h, an); 68784 } 68785 function L6(h, g) { 68786 return GA(h, Ze(g, 2)); 68787 } 68788 function k6(h) { 68789 return h && h.length ? tf(h, an, qC) : i; 68790 } 68791 function P6(h, g) { 68792 return h && h.length ? tf(h, Ze(g, 2), qC) : i; 68793 } 68794 var F6 = cf(function(h, g) { 68795 return h * g; 68796 }, 1), O6 = ab("round"), N6 = cf(function(h, g) { 68797 return h - g; 68798 }, 0); 68799 function _6(h) { 68800 return h && h.length ? FC(h, an) : 0; 68801 } 68802 function B6(h, g) { 68803 return h && h.length ? FC(h, Ze(g, 2)) : 0; 68804 } 68805 return F.after = aH, F.ary = uE, F.assign = KH, F.assignIn = ME, F.assignInWith = AE, F.assignWith = xb, F.at = ZH, F.before = dE, F.bind = Cb, F.bindAll = e6, F.bindKey = hE, F.castArray = CH, F.chain = aE, F.chunk = I5, F.compact = R5, F.concat = T5, F.cond = t6, F.conforms = i6, F.constant = Eb, F.countBy = Bz, F.create = qH, F.curry = pE, F.curryRight = gE, F.debounce = fE, F.defaults = QH, F.defaultsDeep = XH, F.defer = lH, F.delay = cH, F.difference = L5, F.differenceBy = k5, F.differenceWith = P5, F.drop = F5, F.dropRight = O5, F.dropRightWhile = N5, F.dropWhile = _5, F.fill = B5, F.filter = zz, F.flatMap = Uz, F.flatMapDeep = Wz, F.flatMapDepth = jz, F.flatten = sE, F.flattenDeep = G5, F.flattenDepth = z5, F.flip = uH, F.flow = n6, F.flowRight = o6, F.fromPairs = H5, F.functions = oV, F.functionsIn = rV, F.groupBy = $z, F.initial = U5, F.intersection = W5, F.intersectionBy = j5, F.intersectionWith = $5, F.invert = lV, F.invertBy = cV, F.invokeMap = Kz, F.iteratee = Ib, F.keyBy = Zz, F.keys = ns, F.keysIn = rn, F.map = mf, F.mapKeys = dV, F.mapValues = hV, F.matches = r6, F.matchesProperty = a6, F.memoize = yf, F.merge = pV, F.mergeWith = DE, F.method = l6, F.methodOf = c6, F.mixin = Rb, F.negate = Cf, F.nthArg = d6, F.omit = gV, F.omitBy = fV, F.once = dH, F.orderBy = qz, F.over = h6, F.overArgs = hH, F.overEvery = p6, F.overSome = g6, F.partial = bb, F.partialRight = mE, F.partition = Qz, F.pick = mV, F.pickBy = EE, F.property = FE, F.propertyOf = f6, F.pull = q5, F.pullAll = oE, F.pullAllBy = Q5, F.pullAllWith = X5, F.pullAt = J5, F.range = m6, F.rangeRight = v6, F.rearg = pH, F.reject = eH, F.remove = ez, F.rest = gH, F.reverse = vb, F.sampleSize = iH, F.set = yV, F.setWith = CV, F.shuffle = sH, F.slice = tz, F.sortBy = rH, F.sortedUniq = lz, F.sortedUniqBy = cz, F.split = VV, F.spread = fH, F.tail = uz, F.take = dz, F.takeRight = hz, F.takeRightWhile = pz, F.takeWhile = gz, F.tap = Rz, F.throttle = mH, F.thru = ff, F.toArray = wE, F.toPairs = IE, F.toPairsIn = RE, F.toPath = S6, F.toPlainObject = xE, F.transform = bV, F.unary = vH, F.union = fz, F.unionBy = mz, F.unionWith = vz, F.uniq = yz, F.uniqBy = Cz, F.uniqWith = bz, F.unset = wV, F.unzip = yb, F.unzipWith = rE, F.update = SV, F.updateWith = xV, F.values = yu, F.valuesIn = MV, F.without = wz, F.words = kE, F.wrap = yH, F.xor = Sz, F.xorBy = xz, F.xorWith = Mz, F.zip = Az, F.zipObject = Dz, F.zipObjectDeep = Ez, F.zipWith = Iz, F.entries = IE, F.entriesIn = RE, F.extend = ME, F.extendWith = AE, Rb(F, F), F.add = M6, F.attempt = PE, F.camelCase = IV, F.capitalize = TE, F.ceil = A6, F.clamp = AV, F.clone = bH, F.cloneDeep = SH, F.cloneDeepWith = xH, F.cloneWith = wH, F.conformsTo = MH, F.deburr = LE, F.defaultTo = s6, F.divide = D6, F.endsWith = RV, F.eq = To, F.escape = TV, F.escapeRegExp = LV, F.every = Gz, F.find = Hz, F.findIndex = tE, F.findKey = JH, F.findLast = Vz, F.findLastIndex = iE, F.findLastKey = eV, F.floor = E6, F.forEach = lE, F.forEachRight = cE, F.forIn = tV, F.forInRight = iV, F.forOwn = sV, F.forOwnRight = nV, F.get = Mb, F.gt = AH, F.gte = DH, F.has = aV, F.hasIn = Ab, F.head = nE, F.identity = an, F.includes = Yz, F.indexOf = V5, F.inRange = DV, F.invoke = uV, F.isArguments = Jl, F.isArray = rt, F.isArrayBuffer = EH, F.isArrayLike = on, F.isArrayLikeObject = Li, F.isBoolean = IH, F.isBuffer = Va, F.isDate = RH, F.isElement = TH, F.isEmpty = LH, F.isEqual = kH, F.isEqualWith = PH, F.isError = wb, F.isFinite = FH, F.isFunction = Gr, F.isInteger = vE, F.isLength = bf, F.isMap = yE, F.isMatch = OH, F.isMatchWith = NH, F.isNaN = _H, F.isNative = BH, F.isNil = zH, F.isNull = GH, F.isNumber = CE, F.isObject = bi, F.isObjectLike = Di, F.isPlainObject = bh, F.isRegExp = Sb, F.isSafeInteger = HH, F.isSet = bE, F.isString = wf, F.isSymbol = Pn, F.isTypedArray = vu, F.isUndefined = VH, F.isWeakMap = UH, F.isWeakSet = WH, F.join = Y5, F.kebabCase = kV, F.last = qn, F.lastIndexOf = K5, F.lowerCase = PV, F.lowerFirst = FV, F.lt = jH, F.lte = $H, F.max = I6, F.maxBy = R6, F.mean = T6, F.meanBy = L6, F.min = k6, F.minBy = P6, F.stubArray = Lb, F.stubFalse = kb, F.stubObject = y6, F.stubString = C6, F.stubTrue = b6, F.multiply = F6, F.nth = Z5, F.noConflict = u6, F.noop = Tb, F.now = vf, F.pad = OV, F.padEnd = NV, F.padStart = _V, F.parseInt = BV, F.random = EV, F.reduce = Xz, F.reduceRight = Jz, F.repeat = GV, F.replace = zV, F.result = vV, F.round = O6, F.runInContext = ee, F.sample = tH, F.size = nH, F.snakeCase = HV, F.some = oH, F.sortedIndex = iz, F.sortedIndexBy = sz, F.sortedIndexOf = nz, F.sortedLastIndex = oz, F.sortedLastIndexBy = rz, F.sortedLastIndexOf = az, F.startCase = UV, F.startsWith = WV, F.subtract = N6, F.sum = _6, F.sumBy = B6, F.template = jV, F.times = w6, F.toFinite = zr, F.toInteger = ct, F.toLength = SE, F.toLower = $V, F.toNumber = Qn, F.toSafeInteger = YH, F.toString = Vt, F.toUpper = YV, F.trim = KV, F.trimEnd = ZV, F.trimStart = qV, F.truncate = QV, F.unescape = XV, F.uniqueId = x6, F.upperCase = JV, F.upperFirst = Db, F.each = lE, F.eachRight = cE, F.first = nE, Rb(F, (function() { 68806 var h = {}; 68807 return ir(F, function(g, v) { 68808 Ht.call(F.prototype, v) || (h[v] = g); 68809 }), h; 68810 })(), { chain: !1 }), F.VERSION = s, Tn(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(h) { 68811 F[h].placeholder = F; 68812 }), Tn(["drop", "take"], function(h, g) { 68813 bt.prototype[h] = function(v) { 68814 v = v === i ? 1 : $i(ct(v), 0); 68815 var x = this.__filtered__ && !g ? new bt(this) : this.clone(); 68816 return x.__filtered__ ? x.__takeCount__ = ms(v, x.__takeCount__) : x.__views__.push({ 68817 size: ms(v, K), 68818 type: h + (x.__dir__ < 0 ? "Right" : "") 68819 }), x; 68820 }, bt.prototype[h + "Right"] = function(v) { 68821 return this.reverse()[h](v).reverse(); 68822 }; 68823 }), Tn(["filter", "map", "takeWhile"], function(h, g) { 68824 var v = g + 1, x = v == q || v == T; 68825 bt.prototype[h] = function(R) { 68826 var O = this.clone(); 68827 return O.__iteratees__.push({ 68828 iteratee: Ze(R, 3), 68829 type: v 68830 }), O.__filtered__ = O.__filtered__ || x, O; 68831 }; 68832 }), Tn(["head", "last"], function(h, g) { 68833 var v = "take" + (g ? "Right" : ""); 68834 bt.prototype[h] = function() {
68835 return this[v](1).value()[0]; 68836 }; 68837 }), Tn(["initial", "tail"], function(h, g) { 68838 var v = "drop" + (g ? "" : "Right"); 68839 bt.prototype[h] = function() { 68840 return this.__filtered__ ? new bt(this) : this[v](1); 68841 }; 68842 }), bt.prototype.compact = function() { 68843 return this.filter(an); 68844 }, bt.prototype.find = function(h) { 68845 return this.filter(h).head(); 68846 }, bt.prototype.findLast = function(h) { 68847 return this.reverse().find(h); 68848 }, bt.prototype.invokeMap = ft(function(h, g) { 68849 return typeof h == "function" ? new bt(this) : this.map(function(v) { 68850 return gh(v, h, g); 68851 }); 68852 }), bt.prototype.reject = function(h) { 68853 return this.filter(Cf(Ze(h))); 68854 }, bt.prototype.slice = function(h, g) { 68855 h = ct(h); 68856 var v = this; 68857 return v.__filtered__ && (h > 0 || g < 0) ? new bt(v) : (h < 0 ? v = v.takeRight(-h) : h && (v = v.drop(h)), g !== i && (g = ct(g), v = g < 0 ? v.dropRight(-g) : v.take(g - h)), v); 68858 }, bt.prototype.takeRightWhile = function(h) { 68859 return this.reverse().takeWhile(h).reverse(); 68860 }, bt.prototype.toArray = function() { 68861 return this.take(K); 68862 }, ir(bt.prototype, function(h, g) { 68863 var v = /^(?:filter|find|map|reject)|While$/.test(g), x = /^(?:head|last)$/.test(g), R = F[x ? "take" + (g == "last" ? "Right" : "") : g], O = x || /^find/.test(g); 68864 R && (F.prototype[g] = function() { 68865 var z = this.__wrapped__, Y = x ? [1] : arguments, ie = z instanceof bt, ve = Y[0], ye = ie || rt(z), xe = function(yt) { 68866 var xt = R.apply(F, Oa([yt], Y)); 68867 return x && Oe ? xt[0] : xt; 68868 }; 68869 ye && v && typeof ve == "function" && ve.length != 1 && (ie = ye = !1); 68870 var Oe = this.__chain__, We = !!this.__actions__.length, qe = O && !Oe, dt = ie && !We; 68871 if (!O && ye) { 68872 z = dt ? z : new bt(this); 68873 var $e = h.apply(z, Y); 68874 return $e.__actions__.push({ func: ff, args: [xe], thisArg: i }), new Yn($e, Oe); 68875 } 68876 return qe && dt ? h.apply(this, Y) : ($e = this.thru(xe), qe ? x ? $e.value()[0] : $e.value() : $e); 68877 }); 68878 }), Tn(["pop", "push", "shift", "sort", "splice", "unshift"], function(h) { 68879 var g = zg[h], v = /^(?:push|sort|unshift)$/.test(h) ? "tap" : "thru", x = /^(?:pop|shift)$/.test(h); 68880 F.prototype[h] = function() { 68881 var R = arguments; 68882 if (x && !this.__chain__) { 68883 var O = this.value(); 68884 return g.apply(rt(O) ? O : [], R); 68885 } 68886 return this[v](function(z) { 68887 return g.apply(rt(z) ? z : [], R); 68888 }); 68889 }; 68890 }), ir(bt.prototype, function(h, g) { 68891 var v = F[g]; 68892 if (v) { 68893 var x = v.name + ""; 68894 Ht.call(hu, x) || (hu[x] = []), hu[x].push({ name: g, func: v }); 68895 } 68896 }), hu[lf(i, w).name] = [{ 68897 name: "wrapper", 68898 func: i 68899 }], bt.prototype.clone = JB, bt.prototype.reverse = eG, bt.prototype.value = tG, F.prototype.at = Tz, F.prototype.chain = Lz, F.prototype.commit = kz, F.prototype.next = Pz, F.prototype.plant = Oz, F.prototype.reverse = Nz, F.prototype.toJSON = F.prototype.valueOf = F.prototype.value = _z, F.prototype.first = F.prototype.head, ah && (F.prototype[ah] = Fz), F; 68900 }), cu = kB(); 68901 jl ? ((jl.exports = cu)._ = cu, EC._ = cu) : ls._ = cu; 68902 }).call(phe); 68903 })(jh, jh.exports)), jh.exports; 68904} 68905var fhe = ghe(); 68906const U_ = "/v1/purchase/plans?productLine=teams", tC = (e, t = []) => { 68907 const i = new URL(e); 68908 return t.filter(Boolean).forEach((s) => { 68909 const [n, o] = s.split("="); 68910 n && o && i.searchParams.append(n, o); 68911 }), i.href; 68912}, gS = async () => { 68913 z_("links_limit_reached_prompt", "links"); 68914 const e = await SS({ 68915 aid: "LINKS_LIMIT_REACHED_CONFIRM", 68916 header: ge.linksLimitReachedConfirmHeader, 68917 question: ge.linksLimitReachedConfirmDescr, 68918 primaryButtonText: ge.linksLimitReachedConfirmOk, 68919 secondaryButtonText: ge.linksLimitReachedConfirmCancel, 68920 width: "500px" 68921 }); 68922 e === yp.Primary ? (gr({ 68923 eventName: "navigated_to_pricing_page", 68924 metadata: { origin: "links_limit_reached_prompt" } 68925 }), await bl(U_, { newTab: !0 })) : e === yp.Secondary && H_("links_limit_reached_prompt", "links"); 68926}; 68927async function mhe() { 68928 z_("qr_code_limit_reached_prompt", "qr_code"); 68929 const e = await SS({ 68930 aid: "QR_CODE_LIMIT_REACHED_CONFIRM", 68931 header: ge.linksLimitReachedConfirmHeader, 68932 question: ge.qrCodeLimitReachedConfirmDescr, 68933 primaryButtonText: ge.linksLimitReachedConfirmOk, 68934 secondaryButtonText: ge.linksLimitReachedConfirmCancel, 68935 width: "500px" 68936 }); 68937 e === yp.Primary ? (gr({ 68938 eventName: "navigated_to_pricing_page", 68939 metadata: { origin: "qr_code_limit_reached_prompt" } 68940 }), await bl(U_, { newTab: !0 })) : e === yp.Secondary && H_("qr_code_limit_reached_prompt", "qr_code"); 68941} 68942const vhe = (e, t = 600) => fhe.debounce((i) => { 68943 e(i); 68944}, t), yhe = { for: "LINK_DIALOG_URL" }, Che = { for: "LINK_DIALOG_TITLE" }, bhe = { 68945 key: 0, 68946 class: "fa-regular fa-spinner-third animate-spin text-gray-400", 68947 "aria-hidden": "true" 68948}, whe = { class: "link-slug-label-section" }, She = { for: "LINK_DIALOG_URL_PREFIX" }, xhe = { for: "LINK_DIALOG_SLUG" }, Mhe = { class: "link-slug-section" }, Ahe = { class: "link-alerts-section" }, Dhe = { class: "alerts-label" }, Ehe = /* @__PURE__ */ Mt({ 68949 __name: "add-edit-link-dialog", 68950 props: { 68951 dialog: {} 68952 }, 68953 setup(e) { 68954 const t = e, i = De(!1), s = De(!1), n = De(!1), o = De(), r = De(), a = De( 68955 t.dialog.input?.accountData || {} 68956 ), l = De( 68957 t.dialog.input?.customDomainList?.domains?.map( 68958 (E) => ({ 68959 ...E, 68960 domainOptionLabel: E.domainName || "" 68961 }) 68962 ) || [] 68963 ), c = Qe( 68964 () => l.value.filter( 68965 (E) => E.displayOrder !== Bb.displayOrder 68966 ).length > 0 68967 ), u = Qe(() => t.dialog.input?.link ? ge.dialogApplyChangesButton : ge.dialogSaveButton), d = De( 68968 t.dialog.input?.link || { 68969 id: "", 68970 title: "", 68971 redirectUrl: "", 68972 slug: "", 68973 type: "", 68974 domainId: c.value && l.value.find( 68975 (E) => E.displayOrder !== Bb.displayOrder 68976 )?.domainId || lI.domainId 68977 } 68978 ), p = De({ ...d.value }), f = De( 68979 !!d.value.notificationEmails?.length || !!d.value.notificationEmail 68980 ), m = Qe(() => JSON.stringify(d.value) !== JSON.stringify(p.value) || f.value !== (!!d.value.notificationEmails?.length || !!d.value.notificationEmail)), y = Qe(() => !!d.value.id && d.value.type !== "survey" && p.value.redirectUrl?.trim() !== d.value.redirectUrl?.trim()), b = Qe(() => o.value ? !1 : r.value ? !r.value.hasError : !0), C = Qe(() => { 68981 const E = se(d.value.title ?? ""); 68982 return E === !0 ? void 0 : E; 68983 }), w = Qe(() => C.value === void 0), M = d.value.type == "survey" && d.value.redirectUrl ? tC(d.value.redirectUrl, ["source=link"]) : "", A = De(""), I = Qe( 68984 () => d.value.ownerEmail || a.value?.userEmail || "the owner's email" 68985 ); 68986 async function L() { 68987 i.value = !0;
68988 try { 68989 !d.value.title?.trim() && d.value.redirectUrl && PT(d.value.redirectUrl) && await $(d.value.redirectUrl), d.value.id ? await N() : await B(); 68990 } catch (E) { 68991 console.error("error saving link", E); 68992 let P = "Unknown Error"; 68993 E instanceof Error && (P = E.message), P.match(GE.GATEWAY_ERROR_LINK_CREATION_EXCEED_QUOTA) && (t.dialog.close(), await gS()); 68994 } finally { 68995 i.value = !1; 68996 } 68997 } 68998 function k() { 68999 return d.value.title?.trim() || A.value || "Untitled Page"; 69000 } 69001 async function B() { 69002 const E = k(), P = await wt.create({ 69003 link: { 69004 title: E, 69005 redirectUrl: d.value.redirectUrl, 69006 slug: d.value.slug, 69007 domainId: d.value.domainId 69008 }, 69009 shouldSendNotifications: f.value 69010 }); 69011 P.success ? t.dialog.close({ link: P.link, accountData: a.value }) : console.error("create link failed", P.error); 69012 } 69013 async function N() { 69014 const E = k(); 69015 if (y.value) { 69016 const { limitIsReached: G } = await wt.isLimitReached({}); 69017 if (G) { 69018 await gS(); 69019 return; 69020 } 69021 } 69022 const P = await wt.update({ 69023 id: d.value.id, 69024 redirectUrl: d.value.redirectUrl, 69025 title: E, 69026 slug: d.value.slug, 69027 shouldSendNotifications: f.value, 69028 type: d.value.type, 69029 domainId: d.value.domainId 69030 }); 69031 P.success ? t.dialog.close({ link: P.link, accountData: a.value }) : console.error("failed to update link", P.error); 69032 } 69033 async function W(E) { 69034 if (!E) return !0; 69035 if (!xf.isValidSlug(E)) 69036 return xf.getSlugValidationErrorMessage(); 69037 try { 69038 const P = await wt.isSlugExists({ 69039 slug: E, 69040 domainId: d.value.domainId 69041 }); 69042 return !P.exists || d.value.id && P.linkId === d.value.id || ge.slugUniqueMessage; 69043 } catch { 69044 return ge.generalError; 69045 } 69046 } 69047 function se(E) { 69048 const P = E?.trim() || A.value || "Untitled Page"; 69049 return xf.isValidLinkTitle(P) ? !0 : xf.getLinkTitleValidationErrorMessage(); 69050 } 69051 async function ue(E) { 69052 if (n.value = !0, !E) return ge.addUrl; 69053 let P = E.trim(); 69054 if (/^https?:\/\//i.test(P) || (P = "http://" + P), !PT(P)) 69055 return ge.urlIsInvalid; 69056 try { 69057 Ce(P); 69058 } catch { 69059 return ge.urlIsInvalid; 69060 } 69061 if (i.value) 69062 return n.value = !1, !0; 69063 try { 69064 const { exists: G, error: _ } = await T(P); 69065 return G === !1 ? (o.value = _ || ge.generalError, o.value) : (d.value.redirectUrl = P, await $(P), o.value = void 0, !0); 69066 } finally { 69067 n.value = !1; 69068 } 69069 } 69070 function Ce(E) { 69071 const P = new URL(E); 69072 A.value = P.hostname; 69073 } 69074 function te(E) { 69075 return E; 69076 } 69077 function q(E) { 69078 return new DOMParser().parseFromString(E, "text/html").documentElement.textContent || ""; 69079 } 69080 async function $(E) { 69081 if (!(!E.trim() || d.value.title?.trim() || s.value)) { 69082 s.value = !0; 69083 try { 69084 const P = await wt.fetchPageTitle({ url: E }); 69085 P && !P.error && P.title && (d.value.title = q(P.title)); 69086 } finally { 69087 s.value = !1; 69088 } 69089 } 69090 } 69091 async function T(E) { 69092 try { 69093 const P = await wt.isURLDomainExists({ 69094 url: E 69095 }); 69096 return !P || !P.exists ? { 69097 exists: !1, 69098 error: P?.error === GE.GATEWAY_ERROR_UNSAFE_LINK_DETECTED ? ge.unsafeLinkDetected : ge.urlIsBroken 69099 } : { exists: !0 }; 69100 } catch (P) { 69101 return console.error("Error checking URL existence", P, { urlString: E }), { exists: !1, error: ge.generalError }; 69102 } 69103 } 69104 return (E, P) => (we(), Wt(Z(xv), { onSubmit: L }, { 69105 default: Ve(() => [ 69106 Re(Z(Mv), { class: "link-form-section" }, { 69107 default: Ve(() => [ 69108 fe("div", null, [ 69109 fe("label", yhe, ke(Z(ge).urlLabel), 1), 69110 d.value.type === "survey" ? (we(), Wt(Z(Hu), { 69111 key: 0, 69112 "model-value": Z(M), 69113 aid: "LINK_DIALOG_URL", 69114 size: "md", 69115 disabled: !0 69116 }, null, 8, ["model-value"])) : (we(), Wt(Z(Hu), { 69117 key: 1, 69118 ref_key: "urlInputRef", 69119 ref: r, 69120 modelValue: d.value.redirectUrl, 69121 "onUpdate:modelValue": P[0] || (P[0] = (G) => d.value.redirectUrl = G), 69122 aid: "LINK_DIALOG_URL", 69123 debounce: "500", 69124 size: "md", 69125 placeholder: Z(ge).urlPlaceholder, 69126 autofocus: "", 69127 error: o.value, 69128 rules: [ue] 69129 }, null, 8, ["modelValue", "placeholder", "error", "rules"])), 69130 y.value ? (we(), Wt(Z(vL), { 69131 key: 2, 69132 aid: "LINK_DIALOG_URL_QUOTA_WARNING", 69133 class: "mt-2", 69134 open: !0, 69135 type: "warning" 69136 }, { 69137 default: Ve(() => [ 69138 ut(ke(Z(ge).urlChangeQuotaWarning), 1) 69139 ]), 69140 _: 1 69141 })) : di("", !0) 69142 ]), 69143 fe("div", null, [ 69144 fe("label", Che, [ 69145 ut(ke(Z(ge).nameLabel) + " ", 1), 69146 fe("span", null, ke(Z(ge).optionalLabel), 1) 69147 ]), 69148 Re(Z(Hu), { 69149 modelValue: d.value.title, 69150 "onUpdate:modelValue": P[1] || (P[1] = (G) => d.value.title = G), 69151 aid: "LINK_DIALOG_TITLE", 69152 placeholder: Z(ge).titlePlaceholder, 69153 size: "md", 69154 disabled: d.value.type === "survey", 69155 dir: "auto", 69156 error: C.value 69157 }, { 69158 append: Ve(() => [ 69159 s.value ? (we(), Ne("span", bhe)) : di("", !0) 69160 ]), 69161 _: 1 69162 }, 8, ["modelValue", "placeholder", "disabled", "error"]) 69163 ]), 69164 fe("div", null, [ 69165 fe("div", whe, [ 69166 fe("label", She, ke(Z(ge).slugLabelPrefix), 1), 69167 fe("label", xhe, [ 69168 ut(ke(Z(ge).backHalfLabel) + " ", 1), 69169 fe("span", null, ke(Z(ge).optionalLabel), 1) 69170 ]) 69171 ]), 69172 fe("div", Mhe, [ 69173 Re(Z(fd), { 69174 modelValue: d.value.domainId, 69175 "onUpdate:modelValue": P[2] || (P[2] = (G) => d.value.domainId = G), 69176 class: "link-slug-select-input", 69177 aid: "LINK_DIALOG_CUSTOM_DOMAIN", 69178 variant: "outlined", 69179 size: "md", 69180 "option-key": (G) => l.value.find( 69181 (_) => _.domainId === G 69182 )?.domainId || "", 69183 "option-label": (G) => l.value.find( 69184 (_) => _.domainId === G 69185 )?.domainOptionLabel || "", 69186 "update:model-value": (G) => d.value.domainId = G 69187 }, { 69188 default: Ve(() => [ 69189 (we(!0), Ne(yi, null, hs(l.value, (G) => (we(), Wt(Z(ll), { 69190 key: G.domainId, 69191 value: G.domainId, 69192 disabled: !d.value.id && G.domainId === Z(Bb).domainId 69193 }, { 69194 default: Ve(() => [ 69195 ut(ke(G.domainOptionLabel), 1) 69196 ]), 69197 _: 2 69198 }, 1032, ["value", "disabled"]))), 128)) 69199 ]), 69200 _: 1 69201 }, 8, ["modelValue", "option-key", "option-label", "update:model-value"]), 69202 Re(Z(Hu), { 69203 modelValue: d.value.slug, 69204 "onUpdate:modelValue": P[3] || (P[3] = (G) => d.value.slug = G), 69205 aid: "LINK_DIALOG_SLUG", 69206 debounce: "500", 69207 size: "md", 69208 placeholder: Z(ge).slugPlaceholder, 69209 rules: [W] 69210 }, { 69211 prepend: Ve(() => [...P[6] || (P[6] = [ 69212 fe("span", null, "/", -1) 69213 ])]), 69214 _: 1 69215 }, 8, ["modelValue", "placeholder", "rules"]) 69216 ]) 69217 ]), 69218 fe("div", Ahe, [ 69219 fe("div", Dhe, [ 69220 P[7] || (P[7] = ut(" Turn on link alerts ", -1)), 69221 fe("p", null, " Receive email notifications to " + ke(I.value) + " when this link is clicked or when the QR code is scanned. ", 1) 69222 ]), 69223 Re(Z(yL), { 69224 modelValue: f.value, 69225 "onUpdate:modelValue": P[4] || (P[4] = (G) => f.value = G), 69226 aid: "LINK_DIALOG_NOTIFICATIONS_TOGGLE" 69227 }, null, 8, ["modelValue"]) 69228 ]) 69229 ]), 69230 _: 1 69231 }), 69232 Re(Z(Av), null, { 69233 default: Ve(() => [ 69234 Re(Z(Xs), { 69235 label: "Cancel", 69236 color: "gray-500", 69237 variant: "outlined", 69238 aid: "LINK_DIALOG_CANCEL_BUTTON", 69239 onClick: P[5] || (P[5] = (G) => t.dialog.close()) 69240 }), 69241 Re(Z(Xs), { 69242 type: "submit", 69243 color: "primary", 69244 aid: "LINK_DIALOG_SUBMIT_BUTTON", 69245 label: u.value, 69246 loading: i.value, 69247 disabled: !m.value || s.value || !b.value || !w.value || n.value 69248 }, null, 8, ["label", "loading", "disabled"]) 69249 ]), 69250 _: 1 69251 }) 69252 ]), 69253 _: 1 69254 })); 69255 } 69256}), Ihe = /* @__PURE__ */ ii(Ehe, [["__scopeId", "data-v-e5e1a34a"]]); 69257async function Rhe(e, t, i) { 69258 const s = e ? ge.dialogTitleEdit : ge.dialogTitleAdd; 69259 return await Vu({ 69260 aid: (e ? "EDIT" : "ADD") + "_LINK_DIALOG", 69261 headerText: s, 69262 component: Ihe, 69263 showTopSeparator: !0, 69264 input: { link: The(e), accountData: t, customDomainList: i } 69265 }); 69266} 69267function The(e) { 69268 if (e) 69269 return JSON.parse(JSON.stringify(e)); 69270} 69271const Lhe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAo4AAAJZCAMAAAAQ60RFAAACQFBMVEUAAAAovpkYLFQYLlYYL1YgMFAYLVIYLFQYLFIovpkZLVIYLVIikP8ekPoovZkovpqfz/+fz/8ov5sovpmf0P+f0P8muZaf0P8nwZidz/8ov5kYLFIdj/oekPoZLFIovZgYLFIov5oZLFMovpoov5wekPokkfsov5cZLFM
69271aLVMekPoov5sZLFGfz/8bLFQZLFKe0P//z9+fz/8ej/oovpkZLVKe0P8ov5n80d8fkPonvpojkf/90d+dz/+dz/+e0P8ovpoovZr80d/80t+fz//70d8ekPofkPn80t8gj/n/z98zxZn70eAgjvg+iNIwba780t/80t8pvpqfz/9Mp/snv5oqvpkgj/r6z98pvpmf0P/80d/80N9Lp/uf0f8ej/gYMFj90d9Np/wpvpkZLlWez/8pvZkZLlVMpftKp/oeguIZLFWf0f8ZO21MpvtHmuwZLFUZLVYtXJZKpfogj/f///8ovpkYLFIekPqe0P8YLVVvfJX80d9Lpvvj8f+Ox/07nfvH4/46nvur1f1WrPvx+P8sl/tWq/vFy9VSYoA1Rmiczv1yuvxzufzi5ekmOV2q1f0dg+UbUpOLlakZOWoca7zT2N+BwPzV6v5ks/yosL4aRn5ue5Lx8vTFytSpsL5DVHO53P4diu8ccccaNGAZQHSAwf0deNEaWJ1SYX0dd9G3vckaTIkeftuao7NgbogcZbJ9iJ7V6v0bX6dAoPsymvohkfrx8fVHnO4lTH/V6v99iJ0mOmB9iZ8mO2B9iaCq0zemAAAAdXRSTlMAmb/fIBDfQJ9g72Ag34C/IEAf39+/Ep8mgHOAYJ9wTX+gr4Y5gEBAz1DvQJBgMO/vIBCQUo+QMO+/kBDfcGDPz5+AvzBAz69gcBAKcFD7+a+galDCr0MwMO+vkFDjf3BAz59wz7CvkIBg189v36+fkI9QMCALqfsjAAAf0UlEQVR42uzZwQkCMRCG0RTgdqDHzSFXT8veBauwCQ9TviQQESwgc3ivhp98kCkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMD0vhZIoz0uBZLYI24GSRI1IjbFJokj+iA9kKSw9zkqNjmcfYyKTRKj1opNDs8+RcUmh7PF1/YqsNQRP7ZaYKHaZ6jY5DBrPbW9wDL3mHz6sNyotWKTRIt/is0i41Co2OQwaq3YfNi7nxWnoSgM4JfMzR8SfYJCGAIOrQyZhXQhPoArdSO4EsSNulBBFzcEfIiGdtWdzlCRGRD8g76dk+hpL72TpDW3t7ed7wcuFJcf55ue9GQsUa0e0dhgh6qt0dhgh3tZrftobDDtblbvFgIJBtHXetDYYAd6UFgD54ZghNrWWPrA1lWrRzQ22KGhrXG8AGbR13rQ2GCHqq3R2GCJqq3R2GCH6kEhGhvs0NLWODeEVuZWjzg3BHOordHYYId7WSOcG4IRaltj6QNbV32tB40Ndmh4UIjjBTCL2hqNDXaoVo9obLDD37ZGY4Md7mSX0Nhgh+a2xrkhmNXc1jg3BKNefxtlGRobrBDleX4+y2rh3BAMcvLSeFKOSCx9YLvSnBQzNDZsWZAvqCMSxwtgEs8JjUg0NmxNlC8bTz6isWE7DnLVaTFCY4NxNBxV0wkaG5rwKA4Sl83FjhP0Ip933PLUGS9GJM4NQeb6QycUJSl8gfinn/R8t9MHmbYRiXNDIDx2QkF8OY4yL4n9Dlue+hGJxoY5/7AvZJHUs2JZ6KwZSR7mraafsgznhlBmMRRL4ro4kuOuH2RU428jLH1guDz8+sGxNP0GvePE8cSSqMOWp14xQ2Nfd7FY8I4jzq6UDnqJVOicre5Z3kp+fojjhWvNPRF/OT3e+tE7TsLqv8pBdVmzJF9LMUNjX2dB2dDBwGWrSaMkPGYLXhj4a2552kckGvt64YtVtx8m6y4Upf/uVyUfuU1bnvUVF2js68M9DEVv8bdus7XiBbzLBxnV2eQjGvt68MtPyidc00+eJOBrbnnal+M4N9x/7vBffJgG3BNzgbbhSKYTnBvuOT7f16RMhzSgLTqv3/J0GZFo7D02oPA4PtPEjbza4RjknU0nODfcV4f07CXWG3Ln6uHIcx3Gn0dY+uwjSqPDmWY8Yld4kWty/gmNvXcC6SsSRhzkOtByHMcLe4V2hCkzJMq1KmZo7P3xr6n7nJni5ETfiERj74dYVByXmZLmG1DM0Nj7wE1oHWNKkOtGJ9po7D3QE6LPzOH5ppwWFzg33H2x5zJzorowPbqYnI87L8dxbgjrOKgJ468P37MsG02Kcdfnh2hs6DYci18fLv3MSp0jOZ3g3BD+f8vz++GHyo+sQpHsNCKx9IF2vCaMpbKtZaNPxVmHEYnG3i0uMy+oDSO1tY5I0ok2jhd2BxcBZ4bxcCkyFEaprTVGspihsXdFQF9vNCha+jj9gShtrUTy89l/Pj9EY+8C94Qexxh0sLTbIVJb1/tIkdQ2Im/dY2CHiN5KZtCzxjBSW+uMJI1INLblEnHJY0YlFJBQDqPa1vojWcxwbmi1qqvjpbh4TtIbcLYhXNp6E6WtV/Pxy+epphPtOwjk9vmilPpDx1Xek9cPNtPhgbLbaWhr/ZE8LUZobEvFohRe/vGVONL7I3Q7aAkjtfXmIjmd4NzQSslVLwn1BNnEEihqCyO1tdZIqs8PsfSxT18QZ+nnyQUn1Tscpa13x7ZWffk2XX1EorHt4jti7sRd/HNUvj5UorOynylb7/a21h9JGpE4XrAGT8RcGETL+/FB4AniRUyXd2+fv3n8+PHTp09b29pAJM8/obHtEIetPx/6gSCByzbgxo33R0dHr169evny5fPnzx9XOaW27urL1+npSstxNPbWcamnU1aLzwPpM4Pu3XiQEf2RbF+O33zCwCDfEwucsdZA9phhtzNiIJI0ItHYW3EoZJw1Gni0BjLpTkYMRFIekTg3NK03/4RCcWzkBp7LTDvKdLv4en66zoi8+YCBCemJKB27rPrVRamV3xhX2lpvJNtPtNHYpkRlDH3GmM9dZim1rU1E8kxajuPc0JSe6HNmt6Nsg+jdAi3LcSx9DBlYOxXb2tpAJKXnh2hsuzXGeDfaWolk44jEuaG9UsdhjXalrZVI1o9INLal3GHb45mdamtCr7uoPdFGY2/EoGMaQ3EpYQ12rq1bInk+yyo4N9RvKA7ZlfiKOXXom2j1drGt1Uiqy3E0tm6HQlyZR99ZNWL+Cr9aYUfbWnndhfL8EOeGWg1Eaag0sLPGNyScvW7rukjSiMS5oT48pJOYJZ5Y/Ve0xu1X2Tve1kok5RGJxtbGE6V+3XsonDXa+g9794/jNBDFcXxkxmMrQ04QiCJLRDGKSIG24AIgCkRJS4GEBBXF6iFzAaCg4E/FEWjoaICzYYs4mxApdpLV5s3w/VQrbfvTezPPM5OOzh58t96K5MUr+Fw3vBxn0nDWbEv6rwht9wmgSLr11nMX7RVthj6XwO84950t/6cwjtPXSqwi+fULHfto1u060j2XvstH36NZx9WttyLZfD/kuuFx8p0/4Z+6tpN3SF33VibCbr0Zya9NiaRjH8F3xM0u+v1Y61mb6l3i7Nb/PHfx+eMLOvahXNddwEz+KqzZYdKviEbbrTcj+f0x1w2PuKg176yfjbTzvpc3HaLu1hduD19wmeYA1vUoauWi6/5quujbquPt1sP7927evXXjxvQ6S8fjiqPvE1pnu2bgLjXdYurWw+G9mzdvPbzx6Ml1zvRcXnE0XdL5RWbL2Vm5nbtRz4Vj6N369vDeg6YIPpqSwEs37r3is8XGYGiQFHmtcAuzlPS77xVgt749vP+ANnwVSrf/rNDJhjaEaTT3rdfb8PQJCbxKZSLe7COTTd7sR223HtZtmIXgyVmzl7lsmpv9aOrWbRt+RBsOlS3zmayZmVMaMo9BmpWjeV6bj0/8RMAt5jHQY7pzHvOQeQyu1JB5DPR4yDwmEvofhsJ/xM3y8o4BNEilkRlAgUwadGyo4KXmDKDBSGqJATTIpVYYQINcarkBNMhPfh4HoDpCI+IIReZsZaDHmLkj9Cj5KgM9LN+sochCaiMDaJDzlRB6eKklLB6hQiqDkfYfrsb/g6PgAAAAAAKWsb+GGhNm4dDCJiJyZgAF0oE0JgZQYCTkEXoU5BF6pDPyCD2sExH2M1CizeOM+SMUaPPoyCMUsDNhAQk10kJEeAcAWoyEm4XQwy+4WAg9rONRCijCTS6olOUkE2o4EQIJJbw0JgQSCqy+0hBInF4mIgQSWthCWgPWkDi50skSmxoo4NcDyTtnOK02kDwhDiXaQHoDKOATiiMUyXIZXwwkfWqOkY6LZ9egw7Pk1VMTHmvNUn7k4GcyqKBKEvLUxEkj8eYg6csK2gzC3Rd4WXIHlUjSqFKwFwAKaR1SIidV4/cbaPGualwLdahsvZPagSXyWlX7dQ49PryvamMTrCyXNYnpr6xqn86hyYffVVUF/bzneonMTX/Pq6r6+eMcqvyqaqF2639LZGb6S6qqencOXb5VtZCHPWsl0pmWJY5hehtFHP+WSL/6W5KSOIYomjgaY9P1H3913hLH4EQUxxW7OjhOHAMTYxy9LDniGJgY4ziXpTFxDEyMcTQ2d9KgWYcmyjguD47nbGVCE2scjckKSxxDE28cmTsGiDhCEeIIRYgjFCGOf9g5g91GYSAMPzWSL9jBYHMwSLkBRy55gB77dIuBH9s1OJuwSSPt/FptjTMzTJmvHgNVSR8kwpH0QSIcSR8kwpH0QSIcSR8kwpH0QSIcSR8kwpH0QSIcSR8kwvFdGsuyLLKXiZeTVPY6KSllk33/7WmUNfwmHD8VxwtjrM5eppJNKrLXaZzim0zY03CLW2V1bM6toSAcCcfXqLUcOhw5syIcCcffwVEzlmeE4yLC8TdxRK8mHFcRjr+II3r1l49jbUU4Eo7vxhG9WmYbjhDhSDj+Bo7FFL0jHKHPwlFxzh+yBo443BHn3lAdh1KRH0/hCJd09pj3x3GvTuCIVAjH1+DIq0k3dzxMh2aplJBskq6u29JhbVEJO57LYKbBkGVjZeuy4gjnzbdfXHllm+ESrNFsGjd8CTXiGd/o+0K8s8a64Qc4Ft2S6wCfneyvS55FNQfnzsamAEmbXoBjY6+P83epxDjyymokHE+sjrY6WsW90GgGSe59iNrNhUTltP3fw5FL+DbKVW38tjFRbwQf++2cdmCc7w1ZGQaJPRzVjYW5xtkjiDvvNdtOpPugVwc4YrWHP1KBk8NxjSdodTyDowmuYRXhgkufxJEZ5uMopfOtvKot09IPD98va2UZaj1fYydD4yHGUeXM0zWZfeNmv6UjVnm9utjDEf4IDCfg6GikZn0KRzX3Hn8ndN3qWZty7XnqAEfM6ulfXeczjnA11hW1AgR5XU849stBV5rB+iIsfDvRSoBrfWFsaYlxbBcnUYphDWQOsreSU/AloPVZx8bv1SkcNdOtEAOcgKOjkfaOJ29lhFfgdmWAz4wWrtpNEkcYO6TMGhowKDarm8d2EcZB1mv2A8fSrTV8S6BVbjbEsfBOz9vmR/Y35GntEMcOwY5ZDWDS
692717OMIp5xvH1cOR2TW0a3MKRxBSrWtDuwGxK7B7jKJI6aBFBaJ24amqz9qKIET/ENfgxRC4xjHAYaz1F72bGNQKjdZLwYa4dGrUzhK7r5L7XBcaWzpzvokjqhn0I2xhfTBSOCIkcOR+6gPMNcqjBh6YIR7cZA8BsZVhKNPK2yw/fDZLLzlq8MkvlevVydxbPwNgsNR5TON9KDnH+BYbGtSjgsOitxa1qVxNAGOuTtCrbEcORrUdhSV3tUZZHzB2ABHqA+b5HH2BRAMYmKDglBNGsfrLo7dTGNOzx3P44jVBJUtvBL65CVxBCAhUlh5nXkwC5k0jq0zjs4GSkzmScXZDzAsQtpCHDsYPIQjlCvC8QyOUYlb/IgDBa+g9SM4utbdRji6/giVj+A44mxRM4aOsr+Po8TgKRxv9FbmNI7uWU+1fLlm+6vj8AiOw0Oro/gLHNXh6jhGqyN/ZnVEr34Kx/WJFuF4CscQCFW6NUv7TPXB3vHrLo6Igt1oHuHYPrx35EGqxRF8iezTOGLTMD6FoxALj4TjeRyx2xIWHZO4Nw3AK1I4MuWzUgc4xnfWMoEj4pvjO2vt5ZrI/j6OObwexxHvSAnH8ziie3olEkAgwGX0LnmbxPHmV/Ua4ogaVo6XJI7KDqTCLM6mCivkvuGqDrK/jyNHhs/guPJ4JRzP4ohLDWDcm8Pef6+BS6/xWiKBI2AwIA04QpUD+1smcYRxE7yVQcpyHeCE6tYdZZ/GEb36aRzBI+F4EkfwET/eYw3e+krurGQjupylcLSqTGkqr4PB3MdfirIc7CCJI4y7suw0i3C0xFnlohSVfdS+n/19HG226mkcwWNBOJ7EEUwBBVxvJ92Dok3yksAxl84wz0IcUW6nJoFjZFyFOMa/0SN2s7+PI8f9z3M4wkf3hON5HJXGxd4BRvbRpOQJHP3fd6xVgGMcXpciiWOYiyl/4IiODNV8N/v7ONrA11M4gkfC8TSO2RC9+eXtzJSufUjLep4TKqsvl0tnp8bLJIejnR8yvrRJ53uBOdQPc6SOZ8Z+xp3vIm5nzZaLnlPp3dl6O6h/5DoUx9n3Xp44pVU3xwl7dZQT/McMTpOiNG9zTopwPIsj392HK97zyBRz96R6HhUmGemcseKcJ7NPi2MRTIn+ZNSbcGyX5vT/Cr16X4TjW3EUyw6ItC/C8Z04FtX6pJm0L8LxbTiqRrNZfUY6EOH4vtVxoVGXGelIhOObcMRdTP0/38bcF+H4NhxLdumKjJQQ4fjGWxm6hbknwtHq1/9kFGkR4fiHHTu2aRiMwij6yyFCikdAonBHw1RItDRuXhZAKWhYIBtQ0kRiNZwmM3zKO2eGW1053jM5EkSOBJEjQeRIEDkSRI4EkSNB5EgQORJEjgSRI0HkSBA5EqRtjktVnVeytM3xvaouvytRjrUZDc21+VtJ8nWpqmk0tD/U5nslx+epNvPo6LmuTj9HQpzrajd6mopAr6On/VuR5vAy2nraFVGmjpPn5mFeJlIsH48DAAAAAAAAAAAAAAAAAADgn707SE0YCgIwPISamAoJROimINVNI4JuDIIrPUQXXfcMzbuMlG57y6aQthZT+jRjtZ3/O8PPe45MEgAAAAAAAAAAAAAAAAAAzJuvl0mSxHE8qWRZJsDpJOWO+35/labper1V6iLLrgStdKJB0Q3yMAhGxSDqCJpz9Nf/KLUK9SGO55TqKSpy91Ve8IGpA3L0L1XQrHNz6ZqEXdPf32swLPUImky77nsEeawcOR2bRIGrECQ5noEqxh+FA0HtjhyPZxw4LyMOyFpaqlkJtnQGofMV0qN6jqlgZ5j2NBsLyLEFrRhrPYHIihzVXRRvMdLjAfrkqCwauYPMpgLFHIeChn92mGfI0df5xFgJxLySHNX0ctfOtVhX6lmKZfUw3Y7567rUk4hdWzFyXZPjns4zxorxFciMHFuL6gUyjsezyjEWi96HaY5Hcjy5OkaORx0LcmyhFzh1ph/pmpR65mJKvUCmzfQurmaOt2LI5zDNbU2O+/orMTo3s3xbz8lRYYGM2VpJTI4nH6b58XiUHE2832cnRnVdsYscfyvGl2fnJxe7EnL01wvdoTZPjxvnJxS7NHP83y+OemXn3FXchoIwrBjnYgdSpDDGgd2At9hA2FQhkFdIlyJvMsw7nEKnEKgQluzWCGxcbZGXiwZpJK+kJMdHshPrzFcNrj8kz0V/t2Y6AQjQEM9d3khEz0UmOxFAhHVER9HxsjIyO4AUW5AbXAkw+wcHZAeAENuRrbUkRl2mmU58xa0MgI+tyMtadLzMmBEAQl2YmdVoxifPXSTA7IwHZH7lo8pKjW3I3FECzMz6lxfYjRAykvJJqbAFOemRxKgL3eykQERIPALs0YiPnruIjn3LqIPV0bAxZB9DMF3LuBytJwFmLYxfTdGWIK68CwB+BpDvY9KsxjZk7CgBZmdpplnB0scVwA4LHyOqW5BORhKjziOjKn2MN0js6UVd+BhQ/RT56yg6nnHmHWHNx03eV6/JxxXVLcgxuASYtfO8wwEZHgrd2EeVDxt9LHxMqG4i52USYHaOyc6h0I199MlHgBjZR6qbSCSzJEadY8y4J93qPj4C6NJHqutIAq7o2GTcfea9AQCs++gDqHJBQ3UdCRyVALMeD8hUoLki3eo+JgAbREKH3N9UyMNREqN6HTNGR0e1wOqV97YQptVIXCdsboX8cxQd+5GRdaymiX5tKb0G4k+rGLmekACzXmRkdsA+8lK64WOA5kzdflU7HmD2MMKOHI6MSxvqrVnWVob0qp4vFpPJ5Pb29sfd3Zf5fP52NvvmSWLUSbxHS/SGqxWwj/ytYMPHFNsZVFd996yV5XK5WNRMnWWmio4NxiO0Qwdx2SJvAdJ14WPQot4aki3+hiGFobCOprCp3yeTuQSYZTzY7gN5Jc3TnRALH1dU11H4hIHaSDracicBZp73eorWrHklzUtp+uGAe5Ol9DBt9G7tdZxLYpT3Gm3YRpWPvuJhY554AitFtSFDOysTHbvwEi1QCcRY99EH0PnKBQ68lrFgeuWZjl10dD7AbDxFC2gpres+hgCKV4D2Ot5f+7zxf9TxWgLMxjZdDC+laz6mAFvMfST22MqwH40ZE3sdZ64nRr1CO4DUO/Yx1BjxKkb7kLGykPHdACJ5RMdLtTEaGZ90q/kYlEtp5dc2gu7I2E1HtwPMTntVqwgirkNWr/IxoW8FkX2Md6qo3ZLR877b6/jN7cSoz3gKq6NHXlSpV/5d9KHSVWk8iRc3A5HR8xb2OrodYDZGxlhH9nHH6lU+EglaMbrae4l+dXQ7wOzEPmYDRFB9K9j00UcLRsP6fLWDjk4HmI3xNBSwj5wY2vAxxic4KGPWEVvb+NXpxCijtloHvuISICbnDrQjbKqnQ4uX9auhyeh5S2sdl07reI9/ZxuXK+n809Qwnyi2LaV1tMUKl5rpvnR0OcBsjAaQfqWPPoAqfNRtW0CRsaOOLgeY3aAJxz7Sp6n8Veoj1U8QGXOeWbNwOTFqhCYc+xgB7GkFSD76VFtzP6TJjujYB5/QDB1yyPwu3wwq8rH2raDbzXRfOjocYPaAhlQ+BgBBuZKmukJk/J91vIIAsw9oBvuYIA0bI2QfqS4RGUtm9jpOHE6MukFD2McI9wApso9Un8r047Xf1v5i7wxWnQaiMHwItRbdTGTCGAQFd4LRGCS6sDegFURcKILgVS6IuHMfDuQZ9A3ErW9pezW1V4smMxM7yfm/RyhfZ3KSyRfoOBA365bOPn7dvB+49XG7WWOY9qWj4IDZou5Me6J2PVl/+pUrk3qA7B9cstfxruBi1PW6M+1yuKHeg6wDZP/gsr2O1wTrGNW9aH38XFsQCfpakYuOggNmPTbr1sc90VoM0z51FBww66lj6+O3ehfI+Af37HV8JbgY1Wuybn380tfGxS0ShkuiR7COV+v+fK7PgGHas46CA2Y36t5ARgTMhmJW7wIZQ2uiSCtG3a7tkXyADDoOwqK2BMP02IpRY9DxYn0KZJy+jmMImJ2rh+C6bBlRjLImqvuCA2TQcTDO1ximiULVUV7A7DZk/AUCZofmSt0VHCBDwGxwzt3GME2h6iguYEZ0FTISBaqjtIDZhggytiBg5owqnF+2dmSBOzsImP0k5tR5u8YwHaiO4wuYxVySK9chY5g6ji9gtmTjPl3PIeMpoTVRxleMKrka5mMestry0NEPCefkw0cM0wHqOL6AWc6svPgIGSet4/8JmClmPiIPzKK6RWJb/ierNM2yLF6jlDp4omd8xaiMmQ154QoOkNGSz5JrXSVJYowp09bUlVIFdNyPYeac/DCbix+mU+6M3pq6FnWZZQUCZkSa18TkiStz0TJudLQmRsCMYt6Qki9miwuiD5C56IiAGRnekJM/Zhfngofpkq1ZIWCmtv9Mn9y6Gf2+SUfTXxhPMWyNQsAs4x8k5Jlz56/ejKL5mmhx86Kc5JOLjgiY6V8XLiAcHYUGzDJuSQj4IGFrEDDTzFgeJ6zjuAJmJ8xYHkPUUWQxSvEuRwSgo6WO/n+6vCDgjGZbdODFqEF1bLdqbNfQMYiAmeLfWRIIQ0d5xSi1/eEwXXskZ1sqyToWFf9Jrgi4wdYkkgNmx7wPDR+D0FFawMwww8cNYeooK2BWGGb4OAQFW/NBasCsqJjh4yAotsYIDZgpzX8jx+OZg+soKGD2Med/cELgADpKDJip7UiNDXsAYrYmFajjx5w7UULIKegYdsAsrrgrGleQ/1tHYcWolwn3QR9hhYSOA+moTnLuS27wELsnGVtzNICOr4PUMT5J2A5tYhyDHK+OoQXM1Cork5ydSMplvCIwtI4TL0YpzQ7gbK4NS7bm5cR1LIxJkpx9kFclgYETPSICZkW8PNYuJh4vcfmIgJnXRM9qWdm5WGK2RsBsiGLUyuTckwQuImA2WMBMpZp7YHAXHAGzQQNmK
69271oWMZwlTRzEBM2W4CxrbNAJm/yXRk3XYsUuM0pMoRo1AR1IaS+OWaes4joBZyX+jwlUjoRhll+jxf3fMYKOGjpY6+n+0ioeBASR6fOn4fiQ6Usb7SQlMR8fxBMxS3ochEICO4opR+32sCCBgdhAd6Rjvs+4QVKJHXMBsTaH5N2BjIDpKC5idEmOMoTB1lBUw2387XBNAwOyAOhYaW/WWkBI9kgJmO8S4xxOkjoICZmdI3Kbqx/cJIGDmjdhtjnnbPCUQbjFqbDpS4vTNhIfNHQLh6hh2wGwPsdOV4/PmCQEUo/yRu4zV75o3BKCjP1KH5MmdpnlEINxiVJgBs78RO3w8+EnTYJYJWcfQAmYd0PZ79aO1js8IIGDmj5KZK9u9Grs1AmZ+ia3fSHjRbHhMAAEzr0/9X1otjg8aLI8ImPlGMxd298AbLI8ImH1v725WE4fCMI6fbTZ+RKOjGxcRXAmTYaCHcgpj0oDULNLpJjNxIwNzD8J78Q2lhNpqTU9P0/f0PL8L6OrBfPYf08b777pnjvh5RMDMtMk+0D9zJFxcI2Bm1FLrCWFGNYkH1wiYGXOn8zZPQU8o3AtHwMyU6/2V5lV1LRfAsBhl5Rx7QV93jbVbAfzmaEfATNPhGrFHFKN4KBS9tMP1DOb4GTI6ShUCeBWjrAmY6YsSOiXGBTavOdoTMNN0E0s6TTn/rwoImLWoqMd4epBun0IiYNaWKEuoidzlRSJg9vHS9brMJTW3y2NHD9sImH24KFGS3koJJyFg1oqbNGv8+6jKdeHoNTYCZi3a3tJZMnb5bVwEzFoVnRmkyhz9WUTAzADDg5TO3wdHwKx1W0XHJQ7f4OFZjHJhjiLK6ZhYALM5Whcw0xPTC3IrAMUoLeb3KPE6D+b4eWKs0YJilH0BM10lPYUjNcs5Whgw07XDVQwCZnxEkpChQMCMjYweIVePgBkDCQ7VCJjxkTr9KhkCZtwkVMGnPBAw4yFFLwoBM0Yk8hOcA2Z+p3O5Wv3vdru/BoM/X7aJUivRvj30o9fr9/t3y+XVZDIZj8d/gyAYDodvnONmNPpWmc/ns9nsp+f9nk6nnTC8bDDHuXiN7/uLiud5nXqpg2qpX2SOKRE+2dp4qNcHSw2eLVU0MnpY6sXBUsMwbDTHBkut/uK/aqmreqlWzVFIpPRMLVW80+ZhqRth3Mj3LxYLlhGK5xKEmIGPEqeOwMcanyQEPrYkALhI8YQQGMEjGTjvHixBX17/9kMOAAAAAElFTkSuQmCC", khe = /* @__PURE__ */ Mt({ 69272 __name: "delete-link-dialog", 69273 props: { 69274 dialog: {} 69275 }, 69276 setup(e) { 69277 const t = e, i = De(!1), s = De([]); 69278 t.dialog.input && (s.value = t.dialog.input); 69279 const n = Qe( 69280 () => s.value.find((r) => r.type === "survey") 69281 ); 69282 async function o() { 69283 i.value = !0; 69284 const r = [], a = []; 69285 s.value.forEach((u) => { 69286 a.push(u.id || ""), u.type === "survey" && u?.redirectUrl && r.push(u.redirectUrl.split("/").pop() || ""); 69287 }); 69288 const l = { 69289 ids: a, 69290 surveyIds: r.length > 0 && r || [] 69291 }, c = await wt.delete(l); 69292 c.success ? (Vde({ 69293 is_bulk: String(s.value.length > 1) 69294 }), t.dialog.close(c), qt({ 69295 aid: "DELETE_LINK_DIALOG_SUCCESS", 69296 status: ri.Completed, 69297 message: s.value.length > 1 ? ge.deleteLinksSuccess : ge.deleteLinkSuccess 69298 })) : qt({ 69299 aid: "DELETE_LINK_DIALOG_ERROR", 69300 status: ri.Error, 69301 message: s.value.length > 1 ? ge.deleteLinksFailed : ge.deleteLinkFailed 69302 }), i.value = !1; 69303 } 69304 return (r, a) => (we(), Wt(Z(xv), { onSubmit: o }, { 69305 default: Ve(() => [ 69306 Re(Z(Mv), { class: "delete-confirmation-section" }, { 69307 default: Ve(() => [ 69308 ut(ke(Z(ge).dialogTextDelete), 1), 69309 a[1] || (a[1] = fe("br", null, null, -1)), 69310 n.value ? (we(), Wt(Z(vL), { 69311 key: 0, 69312 aid: "DELETE_LINK_DIALOG_ALERT", 69313 open: !0, 69314 type: "warning" 69315 }, { 69316 default: Ve(() => [ 69317 ut(ke(Z(ge).customLinkWarning), 1) 69318 ]), 69319 _: 1 69320 })) : di("", !0), 69321 ut(" " + ke(Z(ge).dialogQuestionDelete), 1) 69322 ]), 69323 _: 1 69324 }), 69325 Re(Z(Av), null, { 69326 default: Ve(() => [ 69327 Re(Z(Xs), { 69328 aid: "LINK_DIALOG_CANCEL_BUTTON", 69329 label: "Cancel", 69330 color: "gray-500", 69331 variant: "outlined", 69332 onClick: a[0] || (a[0] = (l) => t.dialog.close()) 69333 }), 69334 Re(Z(Xs), { 69335 type: "submit", 69336 color: "danger", 69337 aid: "LINK_DIALOG_DELETE_BUTTON", 69338 label: Z(ge).dialogDeleteButton, 69339 loading: i.value 69340 }, null, 8, ["label", "loading"]) 69341 ]), 69342 _: 1 69343 }) 69344 ]), 69345 _: 1 69346 })); 69347 } 69348}), Phe = /* @__PURE__ */ ii(khe, [["__scopeId", "data-v-96e2bd5e"]]); 69349var wm = { exports: {} }, Fhe = wm.exports, OT; 69350function Ohe() { 69351 return OT || (OT = 1, (function(e, t) { 69352 (function(i, s) { 69353 e.exports = s(); 69354 })(Fhe, (() => (() => { 69355 var i = { 873: (r, a) => { 69356 var l, c, u = (function() { 69357 var d = function(te, q) { 69358 var $ = te, T = C[q], E = null, P = 0, G = null, _ = [], K = {}, ce = function(V, X) { 69359 E = (function(H) { 69360 for (var Q = new Array(H), re = 0; re < H; re += 1) { 69361 Q[re] = new Array(H); 69362 for (var Se = 0; Se < H; Se += 1) Q[re][Se] = null; 69363 } 69364 return Q; 69365 })(P = 4 * $ + 17), ae(0, 0), ae(P - 7, 0), ae(0, P - 7), oe(), be(), j(V, X), $ >= 7 && U(V), G == null && (G = ne($, T, _)), J(G, X); 69366 }, ae = function(V, X) { 69367 for (var H = -1; H <= 7; H += 1) if (!(V + H <= -1 || P <= V + H)) for (var Q = -1; Q <= 7; Q += 1) X + Q <= -1 || P <= X + Q || (E[V + H][X + Q] = 0 <= H && H <= 6 && (Q == 0 || Q == 6) || 0 <= Q && Q <= 6 && (H == 0 || H == 6) || 2 <= H && H <= 4 && 2 <= Q && Q <= 4); 69368 }, be = function() { 69369 for (var V = 8; V < P - 8; V += 1) E[V][6] == null && (E[V][6] = V % 2 == 0); 69370 for (var X = 8; X < P - 8; X += 1) E[6][X] == null && (E[6][X] = X % 2 == 0); 69371 }, oe = function() { 69372 for (var V = w.getPatternPosition($), X = 0; X < V.length; X += 1) for (var H = 0; H < V.length; H += 1) { 69373 var Q = V[X], re = V[H]; 69374 if (E[Q][re] == null) for (var Se = -2; Se <= 2; Se += 1) for (var Le = -2; Le <= 2; Le += 1) E[Q + Se][re + Le] = Se == -2 || Se == 2 || Le == -2 || Le == 2 || Se == 0 && Le == 0; 69375 } 69376 }, U = function(V) { 69377 for (var X = w.getBCHTypeNumber($), H = 0; H < 18; H += 1) { 69378 var Q = !V && (X >> H & 1) == 1; 69379 E[Math.floor(H / 3)][H % 3 + P - 8 - 3] = Q; 69380 } 69381 for (H = 0; H < 18; H += 1) Q = !V && (X >> H & 1) == 1, E[H % 3 + P - 8 - 3][Math.floor(H / 3)] = Q; 69382 }, j = function(V, X) { 69383 for (var H = T << 3 | X, Q = w.getBCHTypeInfo(H), re = 0; re < 15; re += 1) { 69384 var Se = !V && (Q >> re & 1) == 1; 69385 re < 6 ? E[re][8] = Se : re < 8 ? E[re + 1][8] = Se : E[P - 15 + re][8] = Se; 69386 } 69387 for (re = 0; re < 15; re += 1) Se = !V && (Q >> re & 1) == 1, re < 8 ? E[8][P - re - 1] = Se : re < 9 ? E[8][15 - re - 1 + 1] = Se : E[8][15 - re - 1] = Se; 69388 E[P - 8][8] = !V; 69389 }, J = function(V, X) { 69390 for (var H = -1, Q = P - 1, re = 7, Se = 0, Le = w.getMaskFunction(X), ze = P - 1; ze > 0; ze -= 2) for (ze == 6 && (ze -= 1); ; ) { 69391 for (var Ke = 0; Ke < 2; Ke += 1) if (E[Q][ze - Ke] == null) { 69392 var st = !1; 69393 Se < V.length && (st = (V[Se] >>> re & 1) == 1), Le(Q, ze - Ke) && (st = !st), E[Q][ze - Ke] = st, (re -= 1) == -1 && (Se += 1, re = 7); 69394 } 69395 if ((Q += H) < 0 || P <= Q) { 69396 Q -= H, H = -H; 69397 break; 69398 } 69399 } 69400 }, ne = function(V, X, H) { 69401 for (var Q = I.getRSBlocks(V, X), re = L(), Se = 0; Se < H.length; Se += 1) { 69402 var Le = H[Se]; 69403 re.put(Le.getMode(), 4), re.put(Le.getLength(), w.getLengthInBits(Le.getMode(), V)), Le.write(re); 69404 } 69405 var ze = 0; 69406 for (Se = 0; Se < Q.length; Se += 1) ze += Q[Se].dataCount; 69407 if (re.getLengthInBits() > 8 * ze) throw "code length overflow. (" + re.getLengthInBits() + ">" + 8 * ze + ")";
vendor: 37,508 bytes, lines 69408-70062
69408 for (re.getLengthInBits() + 4 <= 8 * ze && re.put(0, 4); re.getLengthInBits() % 8 != 0; ) re.putBit(!1); 69409 for (; !(re.getLengthInBits() >= 8 * ze || (re.put(236, 8), re.getLengthInBits() >= 8 * ze)); ) re.put(17, 8); 69410 return (function(Ke, st) { 69411 for (var tt = 0, Zt = 0, Ot = 0, lt = new Array(st.length), at = new Array(st.length), Ue = 0; Ue < st.length; Ue += 1) { 69412 var Nt = st[Ue].dataCount, _t = st[Ue].totalCount - Nt; 69413 Zt = Math.max(Zt, Nt), Ot = Math.max(Ot, _t), lt[Ue] = new Array(Nt); 69414 for (var Xe = 0; Xe < lt[Ue].length; Xe += 1) lt[Ue][Xe] = 255 & Ke.getBuffer()[Xe + tt]; 69415 tt += Nt; 69416 var ss = w.getErrorCorrectPolynomial(_t), Wi = A(lt[Ue], ss.getLength() - 1).mod(ss); 69417 for (at[Ue] = new Array(ss.getLength() - 1), Xe = 0; Xe < at[Ue].length; Xe += 1) { 69418 var Bi = Xe + Wi.getLength() - at[Ue].length; 69419 at[Ue][Xe] = Bi >= 0 ? Wi.getAt(Bi) : 0; 69420 } 69421 } 69422 var Pa = 0; 69423 for (Xe = 0; Xe < st.length; Xe += 1) Pa += st[Xe].totalCount; 69424 var Pr = new Array(Pa), ks = 0; 69425 for (Xe = 0; Xe < Zt; Xe += 1) for (Ue = 0; Ue < st.length; Ue += 1) Xe < lt[Ue].length && (Pr[ks] = lt[Ue][Xe], ks += 1); 69426 for (Xe = 0; Xe < Ot; Xe += 1) for (Ue = 0; Ue < st.length; Ue += 1) Xe < at[Ue].length && (Pr[ks] = at[Ue][Xe], ks += 1); 69427 return Pr; 69428 })(re, Q); 69429 }; 69430 K.addData = function(V, X) { 69431 var H = null; 69432 switch (X = X || "Byte") { 69433 case "Numeric": 69434 H = k(V); 69435 break; 69436 case "Alphanumeric": 69437 H = B(V); 69438 break; 69439 case "Byte": 69440 H = N(V); 69441 break; 69442 case "Kanji": 69443 H = W(V); 69444 break; 69445 default: 69446 throw "mode:" + X; 69447 } 69448 _.push(H), G = null; 69449 }, K.isDark = function(V, X) { 69450 if (V < 0 || P <= V || X < 0 || P <= X) throw V + "," + X; 69451 return E[V][X]; 69452 }, K.getModuleCount = function() { 69453 return P; 69454 }, K.make = function() { 69455 if ($ < 1) { 69456 for (var V = 1; V < 40; V++) { 69457 for (var X = I.getRSBlocks(V, T), H = L(), Q = 0; Q < _.length; Q++) { 69458 var re = _[Q]; 69459 H.put(re.getMode(), 4), H.put(re.getLength(), w.getLengthInBits(re.getMode(), V)), re.write(H); 69460 } 69461 var Se = 0; 69462 for (Q = 0; Q < X.length; Q++) Se += X[Q].dataCount; 69463 if (H.getLengthInBits() <= 8 * Se) break; 69464 } 69465 $ = V; 69466 } 69467 ce(!1, (function() { 69468 for (var Le = 0, ze = 0, Ke = 0; Ke < 8; Ke += 1) { 69469 ce(!0, Ke); 69470 var st = w.getLostPoint(K); 69471 (Ke == 0 || Le > st) && (Le = st, ze = Ke); 69472 } 69473 return ze; 69474 })()); 69475 }, K.createTableTag = function(V, X) { 69476 V = V || 2; 69477 var H = ""; 69478 H += '<table style="', H += " border-width: 0px; border-style: none;", H += " border-collapse: collapse;", H += " padding: 0px; margin: " + (X = X === void 0 ? 4 * V : X) + "px;", H += '">', H += "<tbody>"; 69479 for (var Q = 0; Q < K.getModuleCount(); Q += 1) { 69480 H += "<tr>"; 69481 for (var re = 0; re < K.getModuleCount(); re += 1) H += '<td style="', H += " border-width: 0px; border-style: none;", H += " border-collapse: collapse;", H += " padding: 0px; margin: 0px;", H += " width: " + V + "px;", H += " height: " + V + "px;", H += " background-color: ", H += K.isDark(Q, re) ? "#000000" : "#ffffff", H += ";", H += '"/>'; 69482 H += "</tr>"; 69483 } 69484 return (H += "</tbody>") + "</table>"; 69485 }, K.createSvgTag = function(V, X, H, Q) { 69486 var re = {}; 69487 typeof arguments[0] == "object" && (V = (re = arguments[0]).cellSize, X = re.margin, H = re.alt, Q = re.title), V = V || 2, X = X === void 0 ? 4 * V : X, (H = typeof H == "string" ? { text: H } : H || {}).text = H.text || null, H.id = H.text ? H.id || "qrcode-description" : null, (Q = typeof Q == "string" ? { text: Q } : Q || {}).text = Q.text || null, Q.id = Q.text ? Q.id || "qrcode-title" : null; 69488 var Se, Le, ze, Ke, st = K.getModuleCount() * V + 2 * X, tt = ""; 69489 for (Ke = "l" + V + ",0 0," + V + " -" + V + ",0 0,-" + V + "z ", tt += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', tt += re.scalable ? "" : ' width="' + st + 'px" height="' + st + 'px"', tt += ' viewBox="0 0 ' + st + " " + st + '" ', tt += ' preserveAspectRatio="xMinYMin meet"', tt += Q.text || H.text ? ' role="img" aria-labelledby="' + me([Q.id, H.id].join(" ").trim()) + '"' : "", tt += ">", tt += Q.text ? '<title id="' + me(Q.id) + '">' + me(Q.text) + "</title>" : "", tt += H.text ? '<description id="' + me(H.id) + '">' + me(H.text) + "</description>" : "", tt += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', tt += '<path d="', Le = 0; Le < K.getModuleCount(); Le += 1) for (ze = Le * V + X, Se = 0; Se < K.getModuleCount(); Se += 1) K.isDark(Le, Se) && (tt += "M" + (Se * V + X) + "," + ze + Ke); 69490 return (tt += '" stroke="transparent" fill="black"/>') + "</svg>"; 69491 }, K.createDataURL = function(V, X) { 69492 V = V || 2, X = X === void 0 ? 4 * V : X; 69493 var H = K.getModuleCount() * V + 2 * X, Q = X, re = H - X; 69494 return Ce(H, H, (function(Se, Le) { 69495 if (Q <= Se && Se < re && Q <= Le && Le < re) { 69496 var ze = Math.floor((Se - Q) / V), Ke = Math.floor((Le - Q) / V); 69497 return K.isDark(Ke, ze) ? 0 : 1; 69498 } 69499 return 1; 69500 })); 69501 }, K.createImgTag = function(V, X, H) { 69502 V = V || 2, X = X === void 0 ? 4 * V : X; 69503 var Q = K.getModuleCount() * V + 2 * X, re = ""; 69504 return re += "<img", re += ' src="', re += K.createDataURL(V, X), re += '"', re += ' width="', re += Q, re += '"', re += ' height="', re += Q, re += '"', H && (re += ' alt="', re += me(H), re += '"'), re + "/>"; 69505 }; 69506 var me = function(V) { 69507 for (var X = "", H = 0; H < V.length; H += 1) { 69508 var Q = V.charAt(H); 69509 switch (Q) { 69510 case "<": 69511 X += "<"; 69512 break; 69513 case ">": 69514 X += ">"; 69515 break; 69516 case "&": 69517 X += "&"; 69518 break; 69519 case '"': 69520 X += """; 69521 break; 69522 default: 69523 X += Q; 69524 } 69525 } 69526 return X; 69527 }; 69528 return K.createASCII = function(V, X) { 69529 if ((V = V || 1) < 2) return (function(lt) { 69530 lt = lt === void 0 ? 2 : lt; 69531 var at, Ue, Nt, _t, Xe, ss = 1 * K.getModuleCount() + 2 * lt, Wi = lt, Bi = ss - lt, Pa = { "ââ": "â", "â ": "â", " â": "â", " ": " " }, Pr = { "ââ": "â", "â ": "â", " â": " ", " ": " " }, ks = ""; 69532 for (at = 0; at < ss; at += 2) { 69533 for (Nt = Math.floor((at - Wi) / 1), _t = Math.floor((at + 1 - Wi) / 1), Ue = 0; Ue < ss; Ue += 1) Xe = "â", Wi <= Ue && Ue < Bi && Wi <= at && at < Bi && K.isDark(Nt, Math.floor((Ue - Wi) / 1)) && (Xe = " "), Wi <= Ue && Ue < Bi && Wi <= at + 1 && at + 1 < Bi && K.isDark(_t, Math.floor((Ue - Wi) / 1)) ? Xe += " " : Xe += "â", ks += lt < 1 && at + 1 >= Bi ? Pr[Xe] : Pa[Xe]; 69534 ks += ` 69535`; 69536 } 69537 return ss % 2 && lt > 0 ? ks.substring(0, ks.length - ss - 1) + Array(ss + 1).join("â") : ks.substring(0, ks.length - 1); 69538 })(X); 69539 V -= 1, X = X === void 0 ? 2 * V : X; 69540 var H, Q, re, Se, Le = K.getModuleCount() * V + 2 * X, ze = X, Ke = Le - X, st = Array(V + 1).join("ââ"), tt = Array(V + 1).join(" "), Zt = "", Ot = ""; 69541 for (H = 0; H < Le; H += 1) { 69542 for (re = Math.floor((H - ze) / V), Ot = "", Q = 0; Q < Le; Q += 1) Se = 1, ze <= Q && Q < Ke && ze <= H && H < Ke && K.isDark(re, Math.floor((Q - ze) / V)) && (Se = 0), Ot += Se ? st : tt; 69543 for (re = 0; re < V; re += 1) Zt += Ot + ` 69544`; 69545 } 69546 return Zt.substring(0, Zt.length - 1); 69547 }, K.renderTo2dContext = function(V, X) { 69548 X = X || 2; 69549 for (var H = K.getModuleCount(), Q = 0; Q < H; Q++) for (var re = 0; re < H; re++) V.fillStyle = K.isDark(Q, re) ? "black" : "white", V.fillRect(Q * X, re * X, X, X); 69550 }, K; 69551 }; 69552 d.stringToBytes = (d.stringToBytesFuncs = { default: function(te) { 69553 for (var q = [], $ = 0; $ < te.length; $ += 1) { 69554 var T = te.charCodeAt($); 69555 q.push(255 & T); 69556 } 69557 return q; 69558 } }).default, d.createStringToBytes = function(te, q) { 69559 var $ = (function() { 69560 for (var E = ue(te), P = function() { 69561 var be = E.read(); 69562 if (be == -1) throw "eof"; 69563 return be; 69564 }, G = 0, _ = {}; ; ) { 69565 var K = E.read(); 69566 if (K == -1) break; 69567 var ce = P(), ae = P() << 8 | P(); 69568 _[String.fromCharCode(K << 8 | ce)] = ae, G += 1; 69569 } 69570 if (G != q) throw G + " != " + q; 69571 return _; 69572 })(), T = 63; 69573 return function(E) { 69574 for (var P = [], G = 0; G < E.length; G += 1) { 69575 var _ = E.charCodeAt(G); 69576 if (_ < 128) P.push(_); 69577 else { 69578 var K = $[E.charAt(G)]; 69579 typeof K == "number" ? (255 & K) == K ? P.push(K) : (P.push(K >>> 8), P.push(255 & K)) : P.push(T); 69580 } 69581 } 69582 return P; 69583 }; 69584 }; 69585 var p, f, m, y, b, C = { L: 1, M: 0, Q: 3, H: 2 }, w = (p = [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], f = 1335, m = 7973, b = function(te) { 69586 for (var q = 0; te != 0; ) q += 1, te >>>= 1; 69587 return q; 69588 }, (y = {}).getBCHTypeInfo = function(te) { 69589 for (var q = te << 10; b(q) - b(f) >= 0; ) q ^= f << b(q) - b(f); 69590 return 21522 ^ (te << 10 | q); 69591 }, y.getBCHTypeNumber = function(te) { 69592 for (var q = te << 12; b(q) - b(m) >= 0; ) q ^= m << b(q) - b(m); 69593 return te << 12 | q; 69594 }, y.getPatternPosition = function(te) { 69595 return p[te - 1]; 69596 }, y.getMaskFunction = function(te) { 69597 switch (te) { 69598 case 0: 69599 return function(q, $) { 69600 return (q + $) % 2 == 0; 69601 }; 69602 case 1: 69603 return function(q, $) { 69604 return q % 2 == 0; 69605 }; 69606 case 2: 69607 return function(q, $) { 69608 return $ % 3 == 0; 69609 }; 69610 case 3: 69611 return function(q, $) { 69612 return (q + $) % 3 == 0; 69613 }; 69614 case 4: 69615 return function(q, $) { 69616 return (Math.floor(q / 2) + Math.floor($ / 3)) % 2 == 0; 69617 }; 69618 case 5: 69619 return function(q, $) { 69620 return q * $ % 2 + q * $ % 3 == 0; 69621 }; 69622 case 6: 69623 return function(q, $) { 69624 return (q * $ % 2 + q * $ % 3) % 2 == 0; 69625 }; 69626 case 7: 69627 return function(q, $) { 69628 return (q * $ % 3 + (q + $) % 2) % 2 == 0; 69629 }; 69630 default: 69631 throw "bad maskPattern:" + te; 69632 } 69633 }, y.getErrorCorrectPolynomial = function(te) { 69634 for (var q = A([1], 0), $ = 0; $ < te; $ += 1) q = q.multiply(A([1, M.gexp($)], 0)); 69635 return q; 69636 }, y.getLengthInBits = function(te, q) { 69637 if (1 <= q && q < 10) switch (te) { 69638 case 1: 69639 return 10; 69640 case 2: 69641 return 9; 69642 case 4: 69643 case 8: 69644 return 8; 69645 default: 69646 throw "mode:" + te; 69647 } 69648 else if (q < 27) switch (te) { 69649 case 1: 69650 return 12; 69651 case 2: 69652 return 11; 69653 case 4: 69654 return 16; 69655 case 8: 69656 return 10; 69657 default: 69658 throw "mode:" + te; 69659 } 69660 else { 69661 if (!(q < 41)) throw "type:" + q; 69662 switch (te) { 69663 case 1: 69664 return 14; 69665 case 2: 69666 return 13; 69667 case 4: 69668 return 16; 69669 case 8: 69670 return 12; 69671 default: 69672 throw "mode:" + te; 69673 } 69674 } 69675 }, y.getLostPoint = function(te) { 69676 for (var q = te.getModuleCount(), $ = 0, T = 0; T < q; T += 1) for (var E = 0; E < q; E += 1) { 69677 for (var P = 0, G = te.isDark(T, E), _ = -1; _ <= 1; _ += 1) if (!(T + _ < 0 || q <= T + _)) for (var K = -1; K <= 1; K += 1) E + K < 0 || q <= E + K || _ == 0 && K == 0 || G == te.isDark(T + _, E + K) && (P += 1); 69678 P > 5 && ($ += 3 + P - 5); 69679 } 69680 for (T = 0; T < q - 1; T += 1) for (E = 0; E < q - 1; E += 1) { 69681 var ce = 0; 69682 te.isDark(T, E) && (ce += 1), te.isDark(T + 1, E) && (ce += 1), te.isDark(T, E + 1) && (ce += 1), te.isDark(T + 1, E + 1) && (ce += 1), ce != 0 && ce != 4 || ($ += 3); 69683 } 69684 for (T = 0; T < q; T += 1) for (E = 0; E < q - 6; E += 1) te.isDark(T, E) && !te.isDark(T, E + 1) && te.isDark(T, E + 2) && te.isDark(T, E + 3) && te.isDark(T, E + 4) && !te.isDark(T, E + 5) && te.isDark(T, E + 6) && ($ += 40); 69685 for (E = 0; E < q; E += 1) for (T = 0; T < q - 6; T += 1) te.isDark(T, E) && !te.isDark(T + 1, E) && te.isDark(T + 2, E) && te.isDark(T + 3, E) && te.isDark(T + 4, E) && !te.isDark(T + 5, E) && te.isDark(T + 6, E) && ($ += 40); 69686 var ae = 0; 69687 for (E = 0; E < q; E += 1) for (T = 0; T < q; T += 1) te.isDark(T, E) && (ae += 1); 69688 return $ + Math.abs(100 * ae / q / q - 50) / 5 * 10; 69689 }, y), M = (function() { 69690 for (var te = new Array(256), q = new Array(256), $ = 0; $ < 8; $ += 1) te[$] = 1 << $; 69691 for ($ = 8; $ < 256; $ += 1) te[$] = te[$ - 4] ^ te[$ - 5] ^ te[$ - 6] ^ te[$ - 8]; 69692 for ($ = 0; $ < 255; $ += 1) q[te[$]] = $; 69693 return { glog: function(T) { 69694 if (T < 1) throw "glog(" + T + ")"; 69695 return q[T]; 69696 }, gexp: function(T) { 69697 for (; T < 0; ) T += 255; 69698 for (; T >= 256; ) T -= 255; 69699 return te[T]; 69700 } }; 69701 })(); 69702 function A(te, q) { 69703 if (te.length === void 0) throw te.length + "/" + q; 69704 var $ = (function() { 69705 for (var E = 0; E < te.length && te[E] == 0; ) E += 1; 69706 for (var P = new Array(te.length - E + q), G = 0; G < te.length - E; G += 1) P[G] = te[G + E]; 69707 return P; 69708 })(), T = { getAt: function(E) { 69709 return $[E]; 69710 }, getLength: function() { 69711 return $.length; 69712 }, multiply: function(E) { 69713 for (var P = new Array(T.getLength() + E.getLength() - 1), G = 0; G < T.getLength(); G += 1) for (var _ = 0; _ < E.getLength(); _ += 1) P[G + _] ^= M.gexp(M.glog(T.getAt(G)) + M.glog(E.getAt(_))); 69714 return A(P, 0); 69715 }, mod: function(E) { 69716 if (T.getLength() - E.getLength() < 0) return T; 69717 for (var P = M.glog(T.getAt(0)) - M.glog(E.getAt(0)), G = new Array(T.getLength()), _ = 0; _ < T.getLength(); _ += 1) G[_] = T.getAt(_); 69718 for (_ = 0; _ < E.getLength(); _ += 1) G[_] ^= M.gexp(M.glog(E.getAt(_)) + P); 69719 return A(G, 0).mod(E); 69720 } }; 69721 return T; 69722 } 69723 var I = /* @__PURE__ */ (function() { 69724 var te = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12, 7, 37, 13], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]], q = function(T, E) { 69725 var P = {}; 69726 return P.totalCount = T, P.dataCount = E, P; 69727 }, $ = { getRSBlocks: function(T, E) { 69728 var P = (function(U, j) { 69729 switch (j) { 69730 case C.L: 69731 return te[4 * (U - 1) + 0]; 69732 case C.M: 69733 return te[4 * (U - 1) + 1]; 69734 case C.Q: 69735 return te[4 * (U - 1) + 2]; 69736 case C.H: 69737 return te[4 * (U - 1) + 3]; 69738 default: 69739 return; 69740 } 69741 })(T, E); 69742 if (P === void 0) throw "bad rs block @ typeNumber:" + T + "/errorCorrectionLevel:" + E; 69743 for (var G = P.length / 3, _ = [], K = 0; K < G; K += 1) for (var ce = P[3 * K + 0], ae = P[3 * K + 1], be = P[3 * K + 2], oe = 0; oe < ce; oe += 1) _.push(q(ae, be)); 69744 return _; 69745 } }; 69746 return $; 69747 })(), L = function() { 69748 var te = [], q = 0, $ = { getBuffer: function() { 69749 return te; 69750 }, getAt: function(T) { 69751 var E = Math.floor(T / 8); 69752 return (te[E] >>> 7 - T % 8 & 1) == 1; 69753 }, put: function(T, E) { 69754 for (var P = 0; P < E; P += 1) $.putBit((T >>> E - P - 1 & 1) == 1); 69755 }, getLengthInBits: function() { 69756 return q; 69757 }, putBit: function(T) { 69758 var E = Math.floor(q / 8); 69759 te.length <= E && te.push(0), T && (te[E] |= 128 >>> q % 8), q += 1; 69760 } }; 69761 return $; 69762 }, k = function(te) { 69763 var q = te, $ = { getMode: function() { 69764 return 1; 69765 }, getLength: function(P) { 69766 return q.length; 69767 }, write: function(P) { 69768 for (var G = q, _ = 0; _ + 2 < G.length; ) P.put(T(G.substring(_, _ + 3)), 10), _ += 3; 69769 _ < G.length && (G.length - _ == 1 ? P.put(T(G.substring(_, _ + 1)), 4) : G.length - _ == 2 && P.put(T(G.substring(_, _ + 2)), 7)); 69770 } }, T = function(P) { 69771 for (var G = 0, _ = 0; _ < P.length; _ += 1) G = 10 * G + E(P.charAt(_)); 69772 return G; 69773 }, E = function(P) { 69774 if ("0" <= P && P <= "9") return P.charCodeAt(0) - 48; 69775 throw "illegal char :" + P; 69776 }; 69777 return $; 69778 }, B = function(te) { 69779 var q = te, $ = { getMode: function() { 69780 return 2; 69781 }, getLength: function(E) { 69782 return q.length; 69783 }, write: function(E) { 69784 for (var P = q, G = 0; G + 1 < P.length; ) E.put(45 * T(P.charAt(G)) + T(P.charAt(G + 1)), 11), G += 2; 69785 G < P.length && E.put(T(P.charAt(G)), 6); 69786 } }, T = function(E) { 69787 if ("0" <= E && E <= "9") return E.charCodeAt(0) - 48; 69788 if ("A" <= E && E <= "Z") return E.charCodeAt(0) - 65 + 10; 69789 switch (E) { 69790 case " ": 69791 return 36; 69792 case "$": 69793 return 37; 69794 case "%": 69795 return 38; 69796 case "*": 69797 return 39; 69798 case "+": 69799 return 40; 69800 case "-": 69801 return 41; 69802 case ".": 69803 return 42; 69804 case "/": 69805 return 43; 69806 case ":": 69807 return 44; 69808 default: 69809 throw "illegal char :" + E; 69810 } 69811 }; 69812 return $; 69813 }, N = function(te) { 69814 var q = d.stringToBytes(te); 69815 return { getMode: function() { 69816 return 4; 69817 }, getLength: function($) { 69818 return q.length; 69819 }, write: function($) { 69820 for (var T = 0; T < q.length; T += 1) $.put(q[T], 8); 69821 } }; 69822 }, W = function(te) { 69823 var q = d.stringToBytesFuncs.SJIS; 69824 if (!q) throw "sjis not supported."; 69825 (function() { 69826 var E = q("å"); 69827 if (E.length != 2 || (E[0] << 8 | E[1]) != 38726) throw "sjis not supported."; 69828 })(); 69829 var $ = q(te), T = { getMode: function() { 69830 return 8; 69831 }, getLength: function(E) { 69832 return ~~($.length / 2); 69833 }, write: function(E) { 69834 for (var P = $, G = 0; G + 1 < P.length; ) { 69835 var _ = (255 & P[G]) << 8 | 255 & P[G + 1]; 69836 if (33088 <= _ && _ <= 40956) _ -= 33088; 69837 else { 69838 if (!(57408 <= _ && _ <= 60351)) throw "illegal char at " + (G + 1) + "/" + _; 69839 _ -= 49472; 69840 } 69841 _ = 192 * (_ >>> 8 & 255) + (255 & _), E.put(_, 13), G += 2; 69842 } 69843 if (G < P.length) throw "illegal char at " + (G + 1); 69844 } }; 69845 return T; 69846 }, se = function() { 69847 var te = [], q = { writeByte: function($) { 69848 te.push(255 & $); 69849 }, writeShort: function($) { 69850 q.writeByte($), q.writeByte($ >>> 8); 69851 }, writeBytes: function($, T, E) { 69852 T = T || 0, E = E || $.length; 69853 for (var P = 0; P < E; P += 1) q.writeByte($[P + T]); 69854 }, writeString: function($) { 69855 for (var T = 0; T < $.length; T += 1) q.writeByte($.charCodeAt(T)); 69856 }, toByteArray: function() { 69857 return te; 69858 }, toString: function() { 69859 var $ = ""; 69860 $ += "["; 69861 for (var T = 0; T < te.length; T += 1) T > 0 && ($ += ","), $ += te[T]; 69862 return $ + "]"; 69863 } }; 69864 return q; 69865 }, ue = function(te) { 69866 var q = te, $ = 0, T = 0, E = 0, P = { read: function() { 69867 for (; E < 8; ) { 69868 if ($ >= q.length) { 69869 if (E == 0) return -1; 69870 throw "unexpected end of file./" + E; 69871 } 69872 var _ = q.charAt($); 69873 if ($ += 1, _ == "=") return E = 0, -1; 69874 _.match(/^\s$/) || (T = T << 6 | G(_.charCodeAt(0)), E += 6); 69875 } 69876 var K = T >>> E - 8 & 255; 69877 return E -= 8, K; 69878 } }, G = function(_) { 69879 if (65 <= _ && _ <= 90) return _ - 65; 69880 if (97 <= _ && _ <= 122) return _ - 97 + 26; 69881 if (48 <= _ && _ <= 57) return _ - 48 + 52; 69882 if (_ == 43) return 62; 69883 if (_ == 47) return 63; 69884 throw "c:" + _; 69885 }; 69886 return P; 69887 }, Ce = function(te, q, $) { 69888 for (var T = (function(ae, be) { 69889 var oe = ae, U = be, j = new Array(ae * be), J = { setPixel: function(V, X, H) { 69890 j[X * oe + V] = H; 69891 }, write: function(V) { 69892 V.writeString("GIF87a"), V.writeShort(oe), V.writeShort(U), V.writeByte(128), V.writeByte(0), V.writeByte(0), V.writeByte(0), V.writeByte(0), V.writeByte(0), V.writeByte(255), V.writeByte(255), V.writeByte(255), V.writeString(","), V.writeShort(0), V.writeShort(0), V.writeShort(oe), V.writeShort(U), V.writeByte(0); 69893 var X = ne(2); 69894 V.writeByte(2); 69895 for (var H = 0; X.length - H > 255; ) V.writeByte(255), V.writeBytes(X, H, 255), H += 255; 69896 V.writeByte(X.length - H), V.writeBytes(X, H, X.length - H), V.writeByte(0), V.writeString(";"); 69897 } }, ne = function(V) { 69898 for (var X = 1 << V, H = 1 + (1 << V), Q = V + 1, re = me(), Se = 0; Se < X; Se += 1) re.add(String.fromCharCode(Se)); 69899 re.add(String.fromCharCode(X)), re.add(String.fromCharCode(H)); 69900 var Le, ze, Ke, st = se(), tt = (Le = st, ze = 0, Ke = 0, { write: function(at, Ue) { 69901 if (at >>> Ue) throw "length over"; 69902 for (; ze + Ue >= 8; ) Le.writeByte(255 & (at << ze | Ke)), Ue -= 8 - ze, at >>>= 8 - ze, Ke = 0, ze = 0; 69903 Ke |= at << ze, ze += Ue; 69904 }, flush: function() { 69905 ze > 0 && Le.writeByte(Ke); 69906 } }); 69907 tt.write(X, Q); 69908 var Zt = 0, Ot = String.fromCharCode(j[Zt]); 69909 for (Zt += 1; Zt < j.length; ) { 69910 var lt = String.fromCharCode(j[Zt]); 69911 Zt += 1, re.contains(Ot + lt) ? Ot += lt : (tt.write(re.indexOf(Ot), Q), re.size() < 4095 && (re.size() == 1 << Q && (Q += 1), re.add(Ot + lt)), Ot = lt); 69912 } 69913 return tt.write(re.indexOf(Ot), Q), tt.write(H, Q), tt.flush(), st.toByteArray(); 69914 }, me = function() { 69915 var V = {}, X = 0, H = { add: function(Q) { 69916 if (H.contains(Q)) throw "dup key:" + Q; 69917 V[Q] = X, X += 1; 69918 }, size: function() { 69919 return X; 69920 }, indexOf: function(Q) { 69921 return V[Q]; 69922 }, contains: function(Q) { 69923 return V[Q] !== void 0; 69924 } }; 69925 return H; 69926 }; 69927 return J; 69928 })(te, q), E = 0; E < q; E += 1) for (var P = 0; P < te; P += 1) T.setPixel(P, E, $(P, E)); 69929 var G = se(); 69930 T.write(G); 69931 for (var _ = (function() { 69932 var ae = 0, be = 0, oe = 0, U = "", j = {}, J = function(me) { 69933 U += String.fromCharCode(ne(63 & me)); 69934 }, ne = function(me) { 69935 if (!(me < 0)) { 69936 if (me < 26) return 65 + me; 69937 if (me < 52) return me - 26 + 97; 69938 if (me < 62) return me - 52 + 48; 69939 if (me == 62) return 43; 69940 if (me == 63) return 47; 69941 } 69942 throw "n:" + me; 69943 }; 69944 return j.writeByte = function(me) { 69945 for (ae = ae << 8 | 255 & me, be += 8, oe += 1; be >= 6; ) J(ae >>> be - 6), be -= 6; 69946 }, j.flush = function() { 69947 if (be > 0 && (J(ae << 6 - be), ae = 0, be = 0), oe % 3 != 0) for (var me = 3 - oe % 3, V = 0; V < me; V += 1) U += "="; 69948 }, j.toString = function() { 69949 return U; 69950 }, j; 69951 })(), K = G.toByteArray(), ce = 0; ce < K.length; ce += 1) _.writeByte(K[ce]); 69952 return _.flush(), "data:image/gif;base64," + _; 69953 }; 69954 return d; 69955 })(); 69956 u.stringToBytesFuncs["UTF-8"] = function(d) { 69957 return (function(p) { 69958 for (var f = [], m = 0; m < p.length; m++) { 69959 var y = p.charCodeAt(m); 69960 y < 128 ? f.push(y) : y < 2048 ? f.push(192 | y >> 6, 128 | 63 & y) : y < 55296 || y >= 57344 ? f.push(224 | y >> 12, 128 | y >> 6 & 63, 128 | 63 & y) : (m++, y = 65536 + ((1023 & y) << 10 | 1023 & p.charCodeAt(m)), f.push(240 | y >> 18, 128 | y >> 12 & 63, 128 | y >> 6 & 63, 128 | 63 & y)); 69961 } 69962 return f; 69963 })(d); 69964 }, (c = typeof (l = function() { 69965 return u; 69966 }) == "function" ? l.apply(a, []) : l) === void 0 || (r.exports = c); 69967 } }, s = {}; 69968 function n(r) { 69969 var a = s[r]; 69970 if (a !== void 0) return a.exports; 69971 var l = s[r] = { exports: {} }; 69972 return i[r](l, l.exports, n), l.exports; 69973 } 69974 n.n = (r) => { 69975 var a = r && r.__esModule ? () => r.default : () => r; 69976 return n.d(a, { a }), a; 69977 }, n.d = (r, a) => { 69978 for (var l in a) n.o(a, l) && !n.o(r, l) && Object.defineProperty(r, l, { enumerable: !0, get: a[l] }); 69979 }, n.o = (r, a) => Object.prototype.hasOwnProperty.call(r, a); 69980 var o = {}; 69981 return (() => { 69982 n.d(o, { default: () => q }); 69983 const r = ($) => !!$ && typeof $ == "object" && !Array.isArray($); 69984 function a($, ...T) { 69985 if (!T.length) return $; 69986 const E = T.shift(); 69987 return E !== void 0 && r($) && r(E) ? ($ = Object.assign({}, $), Object.keys(E).forEach(((P) => { 69988 const G = $[P], _ = E[P]; 69989 Array.isArray(G) && Array.isArray(_) ? $[P] = _ : r(G) && r(_) ? $[P] = a(Object.assign({}, G), _) : $[P] = _; 69990 })), a($, ...T)) : $; 69991 } 69992 function l($, T) { 69993 const E = document.createElement("a"); 69994 E.download = T, E.href = $, document.body.appendChild(E), E.click(), document.body.removeChild(E); 69995 } 69996 const c = { L: 0.07, M: 0.15, Q: 0.25, H: 0.3 }; 69997 class u { 69998 constructor({ svg: T, type: E, window: P }) { 69999 this._svg = T, this._type = E, this._window = P; 70000 } 70001 draw(T, E, P, G) { 70002 let _; 70003 switch (this._type) { 70004 case "dots": 70005 _ = this._drawDot; 70006 break; 70007 case "classy": 70008 _ = this._drawClassy; 70009 break; 70010 case "classy-rounded": 70011 _ = this._drawClassyRounded; 70012 break; 70013 case "rounded": 70014 _ = this._drawRounded; 70015 break; 70016 case "extra-rounded": 70017 _ = this._drawExtraRounded; 70018 break; 70019 default: 70020 _ = this._drawSquare; 70021 } 70022 _.call(this, { x: T, y: E, size: P, getNeighbor: G }); 70023 } 70024 _rotateFigure({ x: T, y: E, size: P, rotation: G = 0, draw: _ }) { 70025 var K; 70026 const ce = T + P / 2, ae = E + P / 2; 70027 _(), (K = this._element) === null || K === void 0 || K.setAttribute("transform", `rotate(${180 * G / Math.PI},${ce},${ae})`); 70028 } 70029 _basicDot(T) { 70030 const { size: E, x: P, y: G } = T; 70031 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70032 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "circle"), this._element.setAttribute("cx", String(P + E / 2)), this._element.setAttribute("cy", String(G + E / 2)), this._element.setAttribute("r", String(E / 2)); 70033 } })); 70034 } 70035 _basicSquare(T) { 70036 const { size: E, x: P, y: G } = T; 70037 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70038 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"), this._element.setAttribute("x", String(P)), this._element.setAttribute("y", String(G)), this._element.setAttribute("width", String(E)), this._element.setAttribute("height", String(E)); 70039 } })); 70040 } 70041 _basicSideRounded(T) { 70042 const { size: E, x: P, y: G } = T; 70043 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70044 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("d", `M ${P} ${G}v ${E}h ` + E / 2 + `a ${E / 2} ${E / 2}, 0, 0, 0, 0 ${-E}`); 70045 } })); 70046 } 70047 _basicCornerRounded(T) { 70048 const { size: E, x: P, y: G } = T; 70049 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70050 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("d", `M ${P} ${G}v ${E}h ${E}v ` + -E / 2 + `a ${E / 2} ${E / 2}, 0, 0, 0, ${-E / 2} ${-E / 2}`); 70051 } })); 70052 } 70053 _basicCornerExtraRounded(T) { 70054 const { size: E, x: P, y: G } = T; 70055 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70056 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("d", `M ${P} ${G}v ${E}h ${E}a ${E} ${E}, 0, 0, 0, ${-E} ${-E}`); 70057 } })); 70058 } 70059 _basicCornersRounded(T) { 70060 const { size: E, x: P, y: G } = T; 70061 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70062 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("d", `M ${P} ${G}v ` + E / 2 + `a ${E / 2} ${E / 2}, 0, 0, 0, ${E / 2} ${E / 2}
70062h ` + E / 2 + "v " + -E / 2 + `a ${E / 2} ${E / 2}, 0, 0, 0, ${-E / 2} ${-E / 2}`); 70063 } })); 70064 } 70065 _drawDot({ x: T, y: E, size: P }) { 70066 this._basicDot({ x: T, y: E, size: P, rotation: 0 }); 70067 } 70068 _drawSquare({ x: T, y: E, size: P }) { 70069 this._basicSquare({ x: T, y: E, size: P, rotation: 0 }); 70070 } 70071 _drawRounded({ x: T, y: E, size: P, getNeighbor: G }) { 70072 const _ = G ? +G(-1, 0) : 0, K = G ? +G(1, 0) : 0, ce = G ? +G(0, -1) : 0, ae = G ? +G(0, 1) : 0, be = _ + K + ce + ae; 70073 if (be !== 0) if (be > 2 || _ && K || ce && ae) this._basicSquare({ x: T, y: E, size: P, rotation: 0 }); 70074 else { 70075 if (be === 2) { 70076 let oe = 0; 70077 return _ && ce ? oe = Math.PI / 2 : ce && K ? oe = Math.PI : K && ae && (oe = -Math.PI / 2), void this._basicCornerRounded({ x: T, y: E, size: P, rotation: oe }); 70078 } 70079 if (be === 1) { 70080 let oe = 0; 70081 return ce ? oe = Math.PI / 2 : K ? oe = Math.PI : ae && (oe = -Math.PI / 2), void this._basicSideRounded({ x: T, y: E, size: P, rotation: oe }); 70082 } 70083 } 70084 else this._basicDot({ x: T, y: E, size: P, rotation: 0 }); 70085 } 70086 _drawExtraRounded({ x: T, y: E, size: P, getNeighbor: G }) { 70087 const _ = G ? +G(-1, 0) : 0, K = G ? +G(1, 0) : 0, ce = G ? +G(0, -1) : 0, ae = G ? +G(0, 1) : 0, be = _ + K + ce + ae; 70088 if (be !== 0) if (be > 2 || _ && K || ce && ae) this._basicSquare({ x: T, y: E, size: P, rotation: 0 }); 70089 else { 70090 if (be === 2) { 70091 let oe = 0; 70092 return _ && ce ? oe = Math.PI / 2 : ce && K ? oe = Math.PI : K && ae && (oe = -Math.PI / 2), void this._basicCornerExtraRounded({ x: T, y: E, size: P, rotation: oe }); 70093 } 70094 if (be === 1) { 70095 let oe = 0; 70096 return ce ? oe = Math.PI / 2 : K ? oe = Math.PI : ae && (oe = -Math.PI / 2), void this._basicSideRounded({ x: T, y: E, size: P, rotation: oe }); 70097 } 70098 } 70099 else this._basicDot({ x: T, y: E, size: P, rotation: 0 }); 70100 } 70101 _drawClassy({ x: T, y: E, size: P, getNeighbor: G }) { 70102 const _ = G ? +G(-1, 0) : 0, K = G ? +G(1, 0) : 0, ce = G ? +G(0, -1) : 0, ae = G ? +G(0, 1) : 0; 70103 _ + K + ce + ae !== 0 ? _ || ce ? K || ae ? this._basicSquare({ x: T, y: E, size: P, rotation: 0 }) : this._basicCornerRounded({ x: T, y: E, size: P, rotation: Math.PI / 2 }) : this._basicCornerRounded({ x: T, y: E, size: P, rotation: -Math.PI / 2 }) : this._basicCornersRounded({ x: T, y: E, size: P, rotation: Math.PI / 2 }); 70104 } 70105 _drawClassyRounded({ x: T, y: E, size: P, getNeighbor: G }) { 70106 const _ = G ? +G(-1, 0) : 0, K = G ? +G(1, 0) : 0, ce = G ? +G(0, -1) : 0, ae = G ? +G(0, 1) : 0; 70107 _ + K + ce + ae !== 0 ? _ || ce ? K || ae ? this._basicSquare({ x: T, y: E, size: P, rotation: 0 }) : this._basicCornerExtraRounded({ x: T, y: E, size: P, rotation: Math.PI / 2 }) : this._basicCornerExtraRounded({ x: T, y: E, size: P, rotation: -Math.PI / 2 }) : this._basicCornersRounded({ x: T, y: E, size: P, rotation: Math.PI / 2 }); 70108 } 70109 } 70110 const d = { dot: "dot", square: "square", extraRounded: "extra-rounded" }, p = Object.values(d); 70111 class f { 70112 constructor({ svg: T, type: E, window: P }) { 70113 this._svg = T, this._type = E, this._window = P; 70114 } 70115 draw(T, E, P, G) { 70116 let _; 70117 switch (this._type) { 70118 case d.square: 70119 _ = this._drawSquare; 70120 break; 70121 case d.extraRounded: 70122 _ = this._drawExtraRounded; 70123 break; 70124 default: 70125 _ = this._drawDot; 70126 } 70127 _.call(this, { x: T, y: E, size: P, rotation: G }); 70128 } 70129 _rotateFigure({ x: T, y: E, size: P, rotation: G = 0, draw: _ }) { 70130 var K; 70131 const ce = T + P / 2, ae = E + P / 2; 70132 _(), (K = this._element) === null || K === void 0 || K.setAttribute("transform", `rotate(${180 * G / Math.PI},${ce},${ae})`); 70133 } 70134 _basicDot(T) { 70135 const { size: E, x: P, y: G } = T, _ = E / 7; 70136 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70137 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", `M ${P + E / 2} ${G}a ${E / 2} ${E / 2} 0 1 0 0.1 0zm 0 ${_}a ${E / 2 - _} ${E / 2 - _} 0 1 1 -0.1 0Z`); 70138 } })); 70139 } 70140 _basicSquare(T) { 70141 const { size: E, x: P, y: G } = T, _ = E / 7; 70142 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70143 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", `M ${P} ${G}v ${E}h ${E}v ` + -E + `zM ${P + _} ${G + _}h ` + (E - 2 * _) + "v " + (E - 2 * _) + "h " + (2 * _ - E) + "z"); 70144 } })); 70145 } 70146 _basicExtraRounded(T) { 70147 const { size: E, x: P, y: G } = T, _ = E / 7; 70148 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70149 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "path"), this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", `M ${P} ${G + 2.5 * _}v ` + 2 * _ + `a ${2.5 * _} ${2.5 * _}, 0, 0, 0, ${2.5 * _} ${2.5 * _}h ` + 2 * _ + `a ${2.5 * _} ${2.5 * _}, 0, 0, 0, ${2.5 * _} ${2.5 * -_}v ` + -2 * _ + `a ${2.5 * _} ${2.5 * _}, 0, 0, 0, ${2.5 * -_} ${2.5 * -_}h ` + -2 * _ + `a ${2.5 * _} ${2.5 * _}, 0, 0, 0, ${2.5 * -_} ${2.5 * _}M ${P + 2.5 * _} ${G + _}h ` + 2 * _ + `a ${1.5 * _} ${1.5 * _}, 0, 0, 1, ${1.5 * _} ${1.5 * _}v ` + 2 * _ + `a ${1.5 * _} ${1.5 * _}, 0, 0, 1, ${1.5 * -_} ${1.5 * _}h ` + -2 * _ + `a ${1.5 * _} ${1.5 * _}, 0, 0, 1, ${1.5 * -_} ${1.5 * -_}v ` + -2 * _ + `a ${1.5 * _} ${1.5 * _}, 0, 0, 1, ${1.5 * _} ${1.5 * -_}`); 70150 } })); 70151 } 70152 _drawDot({ x: T, y: E, size: P, rotation: G }) { 70153 this._basicDot({ x: T, y: E, size: P, rotation: G }); 70154 } 70155 _drawSquare({ x: T, y: E, size: P, rotation: G }) { 70156 this._basicSquare({ x: T, y: E, size: P, rotation: G }); 70157 } 70158 _drawExtraRounded({ x: T, y: E, size: P, rotation: G }) { 70159 this._basicExtraRounded({ x: T, y: E, size: P, rotation: G }); 70160 } 70161 } 70162 const m = { dot: "dot", square: "square" }, y = Object.values(m); 70163 class b { 70164 constructor({ svg: T, type: E, window: P }) { 70165 this._svg = T, this._type = E, this._window = P; 70166 } 70167 draw(T, E, P, G) { 70168 let _; 70169 _ = this._type === m.square ? this._drawSquare : this._drawDot, _.call(this, { x: T, y: E, size: P, rotation: G }); 70170 } 70171 _rotateFigure({ x: T, y: E, size: P, rotation: G = 0, draw: _ }) { 70172 var K; 70173 const ce = T + P / 2, ae = E + P / 2; 70174 _(), (K = this._element) === null || K === void 0 || K.setAttribute("transform", `rotate(${180 * G / Math.PI},${ce},${ae})`); 70175 } 70176 _basicDot(T) { 70177 const { size: E, x: P, y: G } = T; 70178 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70179 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "circle"), this._element.setAttribute("cx", String(P + E / 2)), this._element.setAttribute("cy", String(G + E / 2)), this._element.setAttribute("r", String(E / 2)); 70180 } })); 70181 } 70182 _basicSquare(T) { 70183 const { size: E, x: P, y: G } = T; 70184 this._rotateFigure(Object.assign(Object.assign({}, T), { draw: () => { 70185 this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"), this._element.setAttribute("x", String(P)), this._element.setAttribute("y", String(G)), this._element.setAttribute("width", String(E)), this._element.setAttribute("height", Str
vendor: 8,431 bytes, lines 70185-70264
70185ing(E)); 70186 } })); 70187 } 70188 _drawDot({ x: T, y: E, size: P, rotation: G }) { 70189 this._basicDot({ x: T, y: E, size: P, rotation: G }); 70190 } 70191 _drawSquare({ x: T, y: E, size: P, rotation: G }) { 70192 this._basicSquare({ x: T, y: E, size: P, rotation: G }); 70193 } 70194 } 70195 const C = "circle", w = [[1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1]], M = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]]; 70196 class A { 70197 constructor(T, E) { 70198 this._roundSize = (P) => this._options.dotsOptions.roundSize ? Math.floor(P) : P, this._window = E, this._element = this._window.document.createElementNS("http://www.w3.org/2000/svg", "svg"), this._element.setAttribute("width", String(T.width)), this._element.setAttribute("height", String(T.height)), this._element.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), T.dotsOptions.roundSize || this._element.setAttribute("shape-rendering", "crispEdges"), this._element.setAttribute("viewBox", `0 0 ${T.width} ${T.height}`), this._defs = this._window.document.createElementNS("http://www.w3.org/2000/svg", "defs"), this._element.appendChild(this._defs), this._imageUri = T.image, this._instanceId = A.instanceCount++, this._options = T; 70199 } 70200 get width() { 70201 return this._options.width; 70202 } 70203 get height() { 70204 return this._options.height; 70205 } 70206 getElement() { 70207 return this._element; 70208 } 70209 async drawQR(T) { 70210 const E = T.getModuleCount(), P = Math.min(this._options.width, this._options.height) - 2 * this._options.margin, G = this._options.shape === C ? P / Math.sqrt(2) : P, _ = this._roundSize(G / E); 70211 let K = { hideXDots: 0, hideYDots: 0, width: 0, height: 0 }; 70212 if (this._qr = T, this._options.image) { 70213 if (await this.loadImage(), !this._image) return; 70214 const { imageOptions: ce, qrOptions: ae } = this._options, be = ce.imageSize * c[ae.errorCorrectionLevel], oe = Math.floor(be * E * E); 70215 K = (function({ originalHeight: U, originalWidth: j, maxHiddenDots: J, maxHiddenAxisDots: ne, dotSize: me }) { 70216 const V = { x: 0, y: 0 }, X = { x: 0, y: 0 }; 70217 if (U <= 0 || j <= 0 || J <= 0 || me <= 0) return { height: 0, width: 0, hideYDots: 0, hideXDots: 0 }; 70218 const H = U / j; 70219 return V.x = Math.floor(Math.sqrt(J / H)), V.x <= 0 && (V.x = 1), ne && ne < V.x && (V.x = ne), V.x % 2 == 0 && V.x--, X.x = V.x * me, V.y = 1 + 2 * Math.ceil((V.x * H - 1) / 2), X.y = Math.round(X.x * H), (V.y * V.x > J || ne && ne < V.y) && (ne && ne < V.y ? (V.y = ne, V.y % 2 == 0 && V.x--) : V.y -= 2, X.y = V.y * me, V.x = 1 + 2 * Math.ceil((V.y / H - 1) / 2), X.x = Math.round(X.y / H)), { height: X.y, width: X.x, hideYDots: V.y, hideXDots: V.x }; 70220 })({ originalWidth: this._image.width, originalHeight: this._image.height, maxHiddenDots: oe, maxHiddenAxisDots: E - 14, dotSize: _ }); 70221 } 70222 this.drawBackground(), this.drawDots(((ce, ae) => { 70223 var be, oe, U, j, J, ne; 70224 return !(this._options.imageOptions.hideBackgroundDots && ce >= (E - K.hideYDots) / 2 && ce < (E + K.hideYDots) / 2 && ae >= (E - K.hideXDots) / 2 && ae < (E + K.hideXDots) / 2 || !((be = w[ce]) === null || be === void 0) && be[ae] || !((oe = w[ce - E + 7]) === null || oe === void 0) && oe[ae] || !((U = w[ce]) === null || U === void 0) && U[ae - E + 7] || !((j = M[ce]) === null || j === void 0) && j[ae] || !((J = M[ce - E + 7]) === null || J === void 0) && J[ae] || !((ne = M[ce]) === null || ne === void 0) && ne[ae - E + 7]); 70225 })), this.drawCorners(), this._options.image && await this.drawImage({ width: K.width, height: K.height, count: E, dotSize: _ }); 70226 } 70227 drawBackground() { 70228 var T, E, P; 70229 const G = this._element, _ = this._options; 70230 if (G) { 70231 const K = (T = _.backgroundOptions) === null || T === void 0 ? void 0 : T.gradient, ce = (E = _.backgroundOptions) === null || E === void 0 ? void 0 : E.color; 70232 let ae = _.height, be = _.width; 70233 if (K || ce) { 70234 const oe = this._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"); 70235 this._backgroundClipPath = this._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._backgroundClipPath.setAttribute("id", `clip-path-background-color-${this._instanceId}`), this._defs.appendChild(this._backgroundClipPath), !((P = _.backgroundOptions) === null || P === void 0) && P.round && (ae = be = Math.min(_.width, _.height), oe.setAttribute("rx", String(ae / 2 * _.backgroundOptions.round))), oe.setAttribute("x", String(this._roundSize((_.width - be) / 2))), oe.setAttribute("y", String(this._roundSize((_.height - ae) / 2))), oe.setAttribute("width", String(be)), oe.setAttribute("height", String(ae)), this._backgroundClipPath.appendChild(oe), this._createColor({ options: K, color: ce, additionalRotation: 0, x: 0, y: 0, height: _.height, width: _.width, name: `background-color-${this._instanceId}` }); 70236 } 70237 } 70238 } 70239 drawDots(T) { 70240 var E, P; 70241 if (!this._qr) throw "QR code is not defined"; 70242 const G = this._options, _ = this._qr.getModuleCount(); 70243 if (_ > G.width || _ > G.height) throw "The canvas is too small."; 70244 const K = Math.min(G.width, G.height) - 2 * G.margin, ce = G.shape === C ? K / Math.sqrt(2) : K, ae = this._roundSize(ce / _), be = this._roundSize((G.width - _ * ae) / 2), oe = this._roundSize((G.height - _ * ae) / 2), U = new u({ svg: this._element, type: G.dotsOptions.type, window: this._window }); 70245 this._dotsClipPath = this._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), this._dotsClipPath.setAttribute("id", `clip-path-dot-color-${this._instanceId}`), this._defs.appendChild(this._dotsClipPath), this._createColor({ options: (E = G.dotsOptions) === null || E === void 0 ? void 0 : E.gradient, color: G.dotsOptions.color, additionalRotation: 0, x: 0, y: 0, height: G.height, width: G.width, name: `dot-color-${this._instanceId}` }); 70246 for (let j = 0; j < _; j++) for (let J = 0; J < _; J++) T && !T(j, J) || !((P = this._qr) === null || P === void 0) && P.isDark(j, J) && (U.draw(be + J * ae, oe + j * ae, ae, ((ne, me) => !(J + ne < 0 || j + me < 0 || J + ne >= _ || j + me >= _) && !(T && !T(j + me, J + ne)) && !!this._qr && this._qr.isDark(j + me, J + ne))), U._element && this._dotsClipPath && this._dotsClipPath.appendChild(U._element)); 70247 if (G.shape === C) { 70248 const j = this._roundSize((K / ae - _) / 2), J = _ + 2 * j, ne = be - j * ae, me = oe - j * ae, V = [], X = this._roundSize(J / 2); 70249 for (let H = 0; H < J; H++) { 70250 V[H] = []; 70251 for (let Q = 0; Q < J; Q++) H >= j - 1 && H <= J - j && Q >= j - 1 && Q <= J - j || Math.sqrt((H - X) * (H - X) + (Q - X) * (Q - X)) > X ? V[H][Q] = 0 : V[H][Q] = this._qr.isDark(Q - 2 * j < 0 ? Q : Q >= _ ? Q - 2 * j : Q - j, H - 2 * j < 0 ? H : H >= _ ? H - 2 * j : H - j) ? 1 : 0; 70252 } 70253 for (let H = 0; H < J; H++) for (let Q = 0; Q < J; Q++) V[H][Q] && (U.draw(ne + Q * ae, me + H * ae, ae, ((re, Se) => { 70254 var Le; 70255 return !!(!((Le = V[H + Se]) === null || Le === void 0) && Le[Q + re]); 70256 })), U._element && this._dotsClipPath && this._dotsClipPath.appendChild(U._element)); 70257 } 70258 } 70259 drawCorners() { 70260 if (!this._qr) throw "QR code is not defined"; 70261 const T = this._element, E = this._options; 70262 if (!T) throw "Element code is not defined"; 70263 const P = this._qr.getModuleCount(), G = Math.min(E.width, E.height) - 2 * E.margin, _ = E.shape === C ? G / Math.sqrt(2) : G, K = this._roundSize(_ / P), ce = 7 * K, ae = 3 * K, be = this._roundSize((E.width - P * K) / 2), oe = this._roundSize((E.height - P * K) / 2); 70264 [[0, 0, 0], [1, 0, Math.PI / 2], [0, 1, -Math.PI / 2]].forEac
70264h((([U, j, J]) => { 70265 var ne, me, V, X, H, Q, re, Se, Le, ze, Ke, st, tt, Zt; 70266 const Ot = be + U * K * (P - 7), lt = oe + j * K * (P - 7); 70267 let at = this._dotsClipPath, Ue = this._dotsClipPath; 70268 if ((!((ne = E.cornersSquareOptions) === null || ne === void 0) && ne.gradient || !((me = E.cornersSquareOptions) === null || me === void 0) && me.color) && (at = this._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), at.setAttribute("id", `clip-path-corners-square-color-${U}-${j}-${this._instanceId}`), this._defs.appendChild(at), this._cornersSquareClipPath = this._cornersDotClipPath = Ue = at, this._createColor({ options: (V = E.cornersSquareOptions) === null || V === void 0 ? void 0 : V.gradient, color: (X = E.cornersSquareOptions) === null || X === void 0 ? void 0 : X.color, additionalRotation: J, x: Ot, y: lt, height: ce, width: ce, name: `corners-square-color-${U}-${j}-${this._instanceId}` })), ((H = E.cornersSquareOptions) === null || H === void 0 ? void 0 : H.type) && p.includes(E.cornersSquareOptions.type)) { 70269 const Nt = new f({ svg: this._element, type: E.cornersSquareOptions.type, window: this._window }); 70270 Nt.draw(Ot, lt, ce, J), Nt._element && at && at.appendChild(Nt._element); 70271 } else { 70272 const Nt = new u({ svg: this._element, type: ((Q = E.cornersSquareOptions) === null || Q === void 0 ? void 0 : Q.type) || E.dotsOptions.type, window: this._window }); 70273 for (let _t = 0; _t < w.length; _t++) for (let Xe = 0; Xe < w[_t].length; Xe++) !((re = w[_t]) === null || re === void 0) && re[Xe] && (Nt.draw(Ot + Xe * K, lt + _t * K, K, ((ss, Wi) => { 70274 var Bi; 70275 return !!(!((Bi = w[_t + Wi]) === null || Bi === void 0) && Bi[Xe + ss]); 70276 })), Nt._element && at && at.appendChild(Nt._element)); 70277 } 70278 if ((!((Se = E.cornersDotOptions) === null || Se === void 0) && Se.gradient || !((Le = E.cornersDotOptions) === null || Le === void 0) && Le.color) && (Ue = this._window.document.createElementNS("http://www.w3.org/2000/svg", "clipPath"), Ue.setAttribute("id", `clip-path-corners-dot-color-${U}-${j}-${this._instanceId}`), this._defs.appendChild(Ue), this._cornersDotClipPath = Ue, this._createColor({ options: (ze = E.cornersDotOptions) === null || ze === void 0 ? void 0 : ze.gradient, color: (Ke = E.cornersDotOptions) === null || Ke === void 0 ? void 0 : Ke.color, additionalRotation: J, x: Ot + 2 * K, y: lt + 2 * K, height: ae, width: ae, name: `corners-dot-color-${U}-${j}-${this._instanceId}` })), ((st = E.cornersDotOptions) === null || st === void 0 ? void 0 : st.type) && y.includes(E.cornersDotOptions.type)) { 70279 const Nt = new b({ svg: this._element, type: E.cornersDotOptions.type, window: this._window }); 70280 Nt.draw(Ot + 2 * K, lt + 2 * K, ae, J), Nt._element && Ue && Ue.appendChild(Nt._element); 70281 } else { 70282 const Nt = new u({ svg: this._element, type: ((tt = E.cornersDotOptions) === null || tt === void 0 ? void 0 : tt.type) || E.dotsOptions.type, window: this._window }); 70283 for (let _t = 0; _t < M.length; _t++) for (let Xe = 0; Xe < M[_t].length; Xe++) !((Zt = M[_t]) === null || Zt === void 0) && Zt[Xe] && (Nt.draw(Ot + Xe * K, lt + _t * K, K, ((ss, Wi) => { 70284 var Bi; 70285 return !!(!((Bi = M[_t + Wi]) === null || Bi === void 0) && Bi[Xe + ss]); 70286 })), Nt._element && Ue && Ue.appendChild(Nt._element)); 70287 } 70288 })); 70289 } 70290 loadImage() { 70291 return new Promise(((T, E) => { 70292 var P; 70293 const G = this._options; 70294 if (!G.image) return E("Image is not defined"); 70295 if (!((P = G.nodeCanvas) === null || P === void 0) && P.loadImage) G.nodeCanvas.loadImage(G.image).then(((_) => { 70296 var K, ce; 70297 if (this._image = _, this._options.imageOptions.saveAsBlob) { 70298 const ae = (K = G.nodeCanvas) === null || K === void 0 ? void 0 : K.createCanvas(this._image.width, this._image.height); 70299 (ce = ae?.getContext("2d")) === null || ce === void 0 || ce.drawImage(_, 0, 0), this._imageUri = ae?.toDataURL(); 70300 } 70301 T(); 70302 })).catch(E); 70303 else { 70304 const _ = new this._window.Image(); 70305 typeof G.imageOptions.crossOrigin == "string" && (_.crossOrigin = G.imageOptions.crossOrigin), this._image = _, _.onload = async () => { 70306 this._options.imageOptions.saveAsBlob && (this._imageUri = await (async function(K, ce) { 70307 return new Promise(((ae) => { 70308 const be = new ce.XMLHttpRequest(); 70309 be.onload = function() { 70310 const oe = new ce.FileReader(); 70311 oe.onloadend = function() { 70312 ae(oe.result); 70313 }
vendor: 4,659 bytes, lines 70313-70354
70313, oe.readAsDataURL(be.response); 70314 }, be.open("GET", K), be.responseType = "blob", be.send(); 70315 })); 70316 })(G.image || "", this._window)), T(); 70317 }, _.src = G.image; 70318 } 70319 })); 70320 } 70321 async drawImage({ width: T, height: E, count: P, dotSize: G }) { 70322 const _ = this._options, K = this._roundSize((_.width - P * G) / 2), ce = this._roundSize((_.height - P * G) / 2), ae = K + this._roundSize(_.imageOptions.margin + (P * G - T) / 2), be = ce + this._roundSize(_.imageOptions.margin + (P * G - E) / 2), oe = T - 2 * _.imageOptions.margin, U = E - 2 * _.imageOptions.margin, j = this._window.document.createElementNS("http://www.w3.org/2000/svg", "image"); 70323 j.setAttribute("href", this._imageUri || ""), j.setAttribute("xlink:href", this._imageUri || ""), j.setAttribute("x", String(ae)), j.setAttribute("y", String(be)), j.setAttribute("width", `${oe}px`), j.setAttribute("height", `${U}px`), this._element.appendChild(j); 70324 } 70325 _createColor({ options: T, color: E, additionalRotation: P, x: G, y: _, height: K, width: ce, name: ae }) { 70326 const be = ce > K ? ce : K, oe = this._window.document.createElementNS("http://www.w3.org/2000/svg", "rect"); 70327 if (oe.setAttribute("x", String(G)), oe.setAttribute("y", String(_)), oe.setAttribute("height", String(K)), oe.setAttribute("width", String(ce)), oe.setAttribute("clip-path", `url('#clip-path-${ae}')`), T) { 70328 let U; 70329 if (T.type === "radial") U = this._window.document.createElementNS("http://www.w3.org/2000/svg", "radialGradient"), U.setAttribute("id", ae), U.setAttribute("gradientUnits", "userSpaceOnUse"), U.setAttribute("fx", String(G + ce / 2)), U.setAttribute("fy", String(_ + K / 2)), U.setAttribute("cx", String(G + ce / 2)), U.setAttribute("cy", String(_ + K / 2)), U.setAttribute("r", String(be / 2)); 70330 else { 70331 const j = ((T.rotation || 0) + P) % (2 * Math.PI), J = (j + 2 * Math.PI) % (2 * Math.PI); 70332 let ne = G + ce / 2, me = _ + K / 2, V = G + ce / 2, X = _ + K / 2; 70333 J >= 0 && J <= 0.25 * Math.PI || J > 1.75 * Math.PI && J <= 2 * Math.PI ? (ne -= ce / 2, me -= K / 2 * Math.tan(j), V += ce / 2, X += K / 2 * Math.tan(j)) : J > 0.25 * Math.PI && J <= 0.75 * Math.PI ? (me -= K / 2, ne -= ce / 2 / Math.tan(j), X += K / 2, V += ce / 2 / Math.tan(j)) : J > 0.75 * Math.PI && J <= 1.25 * Math.PI ? (ne += ce / 2, me += K / 2 * Math.tan(j), V -= ce / 2, X -= K / 2 * Math.tan(j)) : J > 1.25 * Math.PI && J <= 1.75 * Math.PI && (me += K / 2, ne += ce / 2 / Math.tan(j), X -= K / 2, V -= ce / 2 / Math.tan(j)), U = this._window.document.createElementNS("http://www.w3.org/2000/svg", "linearGradient"), U.setAttribute("id", ae), U.setAttribute("gradientUnits", "userSpaceOnUse"), U.setAttribute("x1", String(Math.round(ne))), U.setAttribute("y1", String(Math.round(me))), U.setAttribute("x2", String(Math.round(V))), U.setAttribute("y2", String(Math.round(X))); 70334 } 70335 T.colorStops.forEach((({ offset: j, color: J }) => { 70336 const ne = this._window.document.createElementNS("http://www.w3.org/2000/svg", "stop"); 70337 ne.setAttribute("offset", 100 * j + "%"), ne.setAttribute("stop-color", J), U.appendChild(ne); 70338 })), oe.setAttribute("fill", `url('#${ae}')`), this._defs.appendChild(U); 70339 } else E && oe.setAttribute("fill", E); 70340 this._element.appendChild(oe); 70341 } 70342 } 70343 A.instanceCount = 0; 70344 const I = A, L = "canvas", k = {}; 70345 for (let $ = 0; $ <= 40; $++) k[$] = $; 70346 const B = { type: L, shape: "square", width: 300, height: 300, data: "", margin: 0, qrOptions: { typeNumber: k[0], mode: void 0, errorCorrectionLevel: "Q" }, imageOptions: { saveAsBlob: !0, hideBackgroundDots: !0, imageSize: 0.4, crossOrigin: void 0, margin: 0 }, dotsOptions: { type: "square", color: "#000", roundSize: !0 }, backgroundOptions: { round: 0, color: "#fff" } }; 70347 function N($) { 70348 const T = Object.assign({}, $); 70349 if (!T.colorStops || !T.colorStops.length) throw "Field 'colorStops' is required in gradient"; 70350 return T.rotation ? T.rotation = Number(T.rotation) : T.rotation = 0, T.colorStops = T.colorStops.map(((E) => Object.assign(Object.assign({}, E), { offset: Number(E.offset) }))), T; 70351 } 70352 function W($) { 70353 const T = Object.assign({}, $); 70354 return T.width = Number(T.width), T.height = Number(T.height), T.margin = Number(T.margin), T.imageOptions = Object.assign(Object.assign({}
70354, T.imageOptions), { hideBackgroundDots: !!T.imageOptions.hideBackgroundDots, imageSize: Number(T.imageOptions.imageSize), margin: Number(T.imageOptions.margin) }), T.margin > Math.min(T.width, T.height) && (T.margin = Math.min(T.width, T.height)), T.dotsOptions = Object.assign({}, T.dotsOptions), T.dotsOptions.gradient && (T.dotsOptions.gradient = N(T.dotsOptions.gradient)), T.cornersSquareOptions && (T.cornersSquareOptions = Object.assign({}, T.cornersSquareOptions), T.cornersSquareOptions.gradient && (T.cornersSquareOptions.gradient = N(T.cornersSquareOptions.gradient))), T.cornersDotOptions && (T.cornersDotOptions = Object.assign({}, T.cornersDotOptions), T.cornersDotOptions.gradient && (T.cornersDotOptions.gradient = N(T.cornersDotOptions.gradient))), T.backgroundOptions && (T.backgroundOptions = Object.assign({}, T.backgroundOptions), T.backgroundOptions.gradient && (T.backgroundOptions.gradient = N(T.backgroundOptions.gradient))), T; 70355 } 70356 var se = n(873), ue = n.n(se); 70357 function Ce($) { 70358 if (!$) throw new Error("Extension must be defined"); 70359 $[0] === "." && ($ = $.substring(1)); 70360 const T = { bmp: "image/bmp", gif: "image/gif", ico: "image/vnd.microsoft.icon", jpeg: "image/jpeg", jpg: "image/jpeg", png: "image/png", svg: "image/svg+xml", tif: "image/tiff", tiff: "image/tiff", webp: "image/webp", pdf: "application/pdf" }[$.toLowerCase()]; 70361 if (!T) throw new Error(`Extension "${$}" is not supported`); 70362 return T; 70363 } 70364 class te { 70365 constructor(T) { 70366 T?.jsdom ? this._window = new T.jsdom("", { resources: "usable" }).window : this._window = window, this._options = T ? W(a(B, T)) : B, this.update(); 70367 } 70368 static _clearContainer(T) { 70369 T && (T.innerHTML = ""); 70370 } 70371 _setupSvg() { 70372 if (!this._qr) return; 70373 const T = new I(this._options, this._window); 70374 this._svg = T.getElement(), this._svgDrawingPromise = T.drawQR(this._qr).then((() => { 70375 var E; 70376 this._svg && ((E = this._extension) === null || E === void 0 || E.call(this, T.getElement(), this._options)); 70377 })); 70378 } 70379 _setupCanvas() { 70380 var T, E; 70381 this._qr && (!((T = this._options.nodeCanvas) === null || T === void 0) && T.createCanvas ? (this._nodeCanvas = this._options.nodeCanvas.createCanvas(this._options.width, this._options.height), this._nodeCanvas.width = this._options.width, this._nodeCanvas.height = this._options.height) : (this._domCanvas = document.createElement("canvas"), this._domCanvas.width = this._options.width, this._domCanvas.height = this._options.height), this._setupSvg(), this._canvasDrawingPromise = (E = this._svgDrawingPromise) === null || E === void 0 ? void 0 : E.then((() => { 70382 var P; 70383 if (!this._svg) return; 70384 const G = this._svg, _ = new this._window.XMLSerializer().serializeToString(G), K = btoa(_), ce = `data:${Ce("svg")};base64,${K}`; 70385 if (!((P = this._options.nodeCanvas) === null || P === void 0) && P.loadImage) return this._options.nodeCanvas.loadImage(ce).then(((ae) => { 70386 var be, oe; 70387 ae.width = this._options.width, ae.height = this._options.height, (oe = (be = this._nodeCanvas) === null || be === void 0 ? void 0 : be.getContext("2d")) === null || oe === void 0 || oe.drawImage(ae, 0, 0); 70388 })); 70389 { 70390 const ae = new this._window.Image(); 70391 return new Promise(((be) => { 70392 ae.onload = () => { 70393 var oe, U; 70394 (U = (oe = this._domCanvas) === null || oe === void 0 ? void 0 : oe.getContext("2d")) === null || U === void 0 || U.drawImage(ae, 0, 0), be(); 70395 }, ae.src = ce; 70396 })); 70397 } 70398 }))); 70399 } 70400 async _getElement(T = "png") { 70401 if (!this._qr) throw "QR code is empty"; 70402 return T.toLowerCase() === "svg" ? (this._svg && this._svgDrawingPromise || this._setupSvg(), await this._svgDrawingPromise, this._svg) : ((this._domCanvas || this._nodeCanvas) && this._canvasDrawingPromise || this._setupCanvas(), await this._canvasDrawingPromise, this._domCanvas || this._nodeCanvas); 70403 } 70404 update(T) { 70405 te._clearContainer(this._container), this._options = T ? W(a(this._options, T)) : this._options, this._options.data && (this._qr = ue()(this._options.qrOptions.typeNumber, this._options.qrOptions.errorCorrectionLevel), this._qr.addData(this._options.data, this._options.qrOptions.mode || (function(E) { 70406 switch (!0) { 70407 case /^[0-9]*$/.test(E): 70408 return "Numeric"; 70409 case /^[0-9A-Z $%*+\-./:]*$/.test(E): 70410 return "Alphanumeric"; 70411 default: 70412 return "Byte"; 70413 } 70414 })(this._options.data)), this._qr.make(), this._options.type === L ? this._setupCanvas() : this._setupSvg(), this.append(this._container)); 70415 } 70416 append(T) { 70417 if (T) { 70418 if (typeof T.appendChild != "function") throw "Container should be a single DOM node"; 70419 this._options.type === L ? this._domCanvas && T.appendChild(this._domCanvas) : this._svg && T.appendChild(this._svg), this._container = T; 70420 } 70421 } 70422 applyExtension(T) { 70423 if (!T) throw "Extension function should be defined."; 70424 this._extension = T, this.update(); 70425 } 70426 deleteExtension() { 70427 this._extension = void 0, this.update(); 70428 } 70429 async getRawData(T = "png") { 70430 if (!this._qr) throw "QR code is empty"; 70431 const E = await this._getElement(T), P = Ce(T); 70432 if (!E) return null; 70433 if (T.toLowerCase() === "svg") { 70434 const G = `<?xml version="1.0" standalone="no"?>\r 70435${new this._window.XMLSerializer().serializeToString(E)}`; 70436 return typeof Blob > "u" || this._options.jsdom ? Buffer.from(G) : new Blob([G], { type: P }); 70437 } 70438 return new Promise(((G) => { 70439 const _ = E; 70440 if ("toBuffer" in _) if (P === "image/png") G(_.toBuffer(P)); 70441 else if (P === "image/jpeg") G(_.toBuffer(P)); 70442 else { 70443 if (P !== "application/pdf") throw Error("Unsupported extension"); 70444 G(_.toBuffer(P)); 70445 } 70446 else "toBlob" in _ && _.toBlob(G, P, 1); 70447 })); 70448 } 70449 async download(T) { 70450 if (!this._qr) throw "QR code is empty"; 70451 if (typeof Blob > "u") throw "Cannot download in Node.js, call getRawData instead."; 70452 let E = "png", P = "qr"; 70453 typeof T == "string" ? (E = T, console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")) : typeof T == "object" && T !== null && (T.name && (P = T.name), T.extension && (E = T.extension)); 70454 const G = await this._getElement(E); 70455 if (G) if (E.toLowerCase() === "svg") { 70456 let _ = new XMLSerializer().serializeToString(G); 70457 _ = `<?xml version="1.0" standalone="no"?>\r 70458` + _, l(`data:${Ce(E)};charset=utf-8,${encodeURIComponent(_)}`, `${P}.svg`); 70459 } else l(G.toDataURL(Ce(E)), `${P}.${E}`); 70460 } 70461 } 70462 const q = te; 70463 })(), o.default; 70464 })())); 70465 })(wm)), wm.exports; 70466} 70467var Nhe = Ohe(); 70468const _he = /* @__PURE__ */ V_(Nhe); 70469var Sm = /* @__PURE__ */ ((e) => (e.jpeg = "jpeg", e.png = "png", e.svg = "svg", e))(Sm || {}), Rc = /* @__PURE__ */ ((e) => (e.Rounded = "rounded", e.Dots = "dots", e.Square = "square", e))(Rc || {}); 70470let Qf = null, Eu = null; 70471async function Bhe() { 70472 return Qf !== null ? Qf : Eu || (Eu = wt.fetchCompanyLogo({}).then((e) => (Qf = e.logo || null, Eu = null, Qf)).catch((e) => { 70473 throw Eu = null, console.error("Failed to fetch company logo:", e), e; 70474 }), Eu); 70475} 70476function Ghe(e) { 70477 return e.trim().startsWith("{{") && e.trim().endsWith("}}"); 70478} 70479function zhe(e) { 70480 const i = e.trim().match(/^{{\s*company\.(\w+)\s*}}$/); 70481 return i ? { 70482 type: "company", 70483 property: i[1] 70484 } : null; 70485} 70486async function Hhe(e) { 70487 const t = zhe(e); 70488 if (t) 70489 try { 70490 return t.type === "company" && t.property === "logo" && await Bhe() || void 0; 70491 } catch (i) { 70492 console.error("Failed to resolve variable:", { 70493 error: i, 70494 variable: e, 70495 varInfo: t,
70496 message: i instanceof Error ? i.message : String(i) 70497 }); 70498 return; 70499 } 70500} 70501async function Vhe(e) { 70502 try { 70503 const t = await wt.proxyImage({ imageUrl: e }); 70504 if (!t.fileContent || !t.mimeType) { 70505 console.error("Invalid response from proxy:", { 70506 imageUrl: e, 70507 hasFileContent: !!t.fileContent, 70508 hasMimeType: !!t.mimeType, 70509 responseKeys: Object.keys(t) 70510 }); 70511 return; 70512 } 70513 const i = Array.isArray(t.fileContent) ? t.fileContent : Object.values(t.fileContent), s = new Blob([new Uint8Array(i)], { 70514 type: t.mimeType 70515 }); 70516 return URL.createObjectURL(s); 70517 } catch (t) { 70518 console.error("Failed to proxy image:", { 70519 error: t, 70520 imageUrl: e 70521 }); 70522 return; 70523 } 70524} 70525async function NT(e) { 70526 if (!e) 70527 return; 70528 let t = e; 70529 if (Ghe(e)) { 70530 const i = await Hhe(e); 70531 if (!i) 70532 return; 70533 t = i; 70534 } 70535 return await Vhe(t); 70536} 70537function W_() { 70538 const e = De(null), t = De(void 0); 70539 async function i(o) { 70540 try { 70541 const { 70542 data: r, 70543 dotsColor: a = "black", 70544 backgroundColor: l = "white", 70545 dotsOptions: c = { 70546 type: Rc.Square 70547 }, 70548 image: u = void 0 70549 } = o; 70550 if (u) { 70551 const d = await NT(u); 70552 d && (t.value = d); 70553 } 70554 return new _he({ 70555 width: aI, 70556 height: aI, 70557 margin: CW, 70558 type: "canvas", 70559 data: r, 70560 dotsOptions: { 70561 color: a, 70562 type: c.type 70563 }, 70564 backgroundOptions: { 70565 color: l 70566 }, 70567 image: t.value, 70568 imageOptions: { 70569 imageSize: 0.4, 70570 hideBackgroundDots: !0 70571 } 70572 }); 70573 } catch (r) { 70574 return console.error(ge.createQRCodeFailed, r), qt({ 70575 status: ri.Error, 70576 message: ge.createQRCodeFailed, 70577 aid: "CREATE_QR_CODE_FAILED" 70578 }), null; 70579 } 70580 } 70581 async function s(o) { 70582 if (!e.value) 70583 return; 70584 const r = {}; 70585 if ((o.dotsColor !== void 0 || o.dotsOptions?.type !== void 0) && (r.dotsOptions = {}, r.dotsOptions.color = o.dotsColor ? o.dotsColor : void 0, r.dotsOptions.type = o.dotsOptions?.type ? o.dotsOptions.type : void 0), o.backgroundColor !== void 0 && (r.backgroundOptions = { 70586 color: o.backgroundColor ? o.backgroundColor : void 0 70587 }), o.image !== void 0) { 70588 t.value && (URL.revokeObjectURL(t.value), t.value = void 0); 70589 const a = await NT(o.image); 70590 a ? (t.value = a, r.image = a, r.imageOptions = { 70591 imageSize: 0.4, 70592 hideBackgroundDots: !0 70593 }) : r.image = void 0; 70594 } 70595 e.value.update(r); 70596 } 70597 function n() { 70598 t.value && (URL.revokeObjectURL(t.value), t.value = void 0); 70599 } 70600 return { 70601 qrCode: e, 70602 createQRCode: i, 70603 updateQRCode: s, 70604 cleanup: n 70605 }; 70606} 70607const Uhe = { class: "text-sm font-medium generate-qr-code-menu-item" }, Whe = /* @__PURE__ */ Mt({ 70608 __name: "generate-qr-dialog", 70609 props: { 70610 dialog: {} 70611 }, 70612 setup(e) { 70613 const t = e, i = De(null), s = De(""), n = De(void 0), o = De(null), { qrCode: r, createQRCode: a, cleanup: l } = W_(); 70614 t.dialog.input && (t.dialog.input.fullShortLinkURL ? s.value = t.dialog.input.fullShortLinkURL : t.dialog.input.redirectUrl && (s.value = t.dialog.input.redirectUrl), t.dialog.input.type && (n.value = t.dialog.input.type), t.dialog.input.qrCodeStylesData && (o.value = t.dialog.input.qrCodeStylesData)); 70615 const c = [ 70616 { 70617 value: Sm.jpeg, 70618 label: ge.downloadOptionJpeg, 70619 icon: "fa-regular fa-file-jpg" 70620 }, 70621 { 70622 value: Sm.png, 70623 label: ge.downloadOptionPng, 70624 icon: "fa-regular fa-file-png" 70625 }, 70626 { 70627 value: Sm.svg, 70628 label: ge.downloadOptionSvg, 70629 icon: "fa-regular fa-file-svg" 70630 } 70631 ], u = async (d) => { 70632 if (!r.value || !t.dialog.input) 70633 return; 70634 const p = d.value, f = `${t.dialog.input.title}.${p}`; 70635 try { 70636 await r.value.download({ extension: p, name: f }), Wde(p); 70637 } catch (m) { 70638 qt({ 70639 status: ri.Error, 70640 message: ge.downloadFailed, 70641 aid: "DOWNLOAD_QR_CODE_FAILED" 70642 }), console.error("Failed to download QR code:", m); 70643 } 70644 }; 70645 return Cn(async () => {
70646 if (t.dialog.input?.id && !o.value) 70647 try { 70648 const { link: m } = await wt.getLinkById({ 70649 id: t.dialog.input.id 70650 }); 70651 if (!m) 70652 throw new Error("Link not found"); 70653 m.fullShortLinkURL && (s.value = m.fullShortLinkURL), m.type && !n.value && (n.value = m.type), m?.qrCodeStylesData && (o.value = m.qrCodeStylesData); 70654 } catch (m) { 70655 qt({ 70656 status: ri.Error, 70657 message: ge.fetchQRCodeStylingDataErrorMessage, 70658 aid: "FETCH_QR_CODE_STYLING_DATA_FAILED" 70659 }), console.error("Failed to fetch QR code styling data:", m); 70660 } 70661 const d = s.value, p = n.value && n.value === "survey", f = d ? tC(d, ["refSource=qr-code", p ? "source=link" : ""]) : ""; 70662 r.value = await a({ 70663 data: f, 70664 dotsColor: o.value?.dotsOptions?.color || "black", 70665 backgroundColor: o.value?.backgroundOptions?.color || "white", 70666 image: o.value?.logo, 70667 dotsOptions: { 70668 type: o.value?.dotsOptions?.type 70669 } 70670 }), r.value && i.value && r.value.append(i.value), t.dialog.input?.id && !t.dialog.input?.qrFirstGeneratedAt && wt.trackQRGeneration({ 70671 linkId: t.dialog.input.id 70672 }); 70673 }), Nd(() => { 70674 l(); 70675 }), (d, p) => (we(), Ne(yi, null, [ 70676 Re(Z(xv), null, { 70677 default: Ve(() => [ 70678 Re(Z(Mv), { class: "link-generate-qr-section" }, { 70679 default: Ve(() => [ 70680 fe("div", { 70681 ref_key: "canvas", 70682 ref: i, 70683 class: "canvas" 70684 }, null, 512) 70685 ]), 70686 _: 1 70687 }) 70688 ]), 70689 _: 1 70690 }), 70691 Re(Z(Av), null, { 70692 default: Ve(() => [ 70693 Re(Z(Xs), { 70694 label: "Cancel", 70695 color: "gray-500", 70696 variant: "outlined", 70697 aid: "GENERATE_QR_CODE_DIALOG_CLOSE_BUTTON", 70698 onClick: p[0] || (p[0] = (f) => t.dialog.close()) 70699 }), 70700 Re(Z(Xs), { 70701 icon: "fa-regular fa-chevron-down", 70702 "icon-end": "", 70703 aid: "GENERATE_QR_CODE_DIALOG_DOWNLOAD_BUTTON" 70704 }, { 70705 default: Ve(() => [ 70706 ut(ke(Z(ge).download) + " ", 1), 70707 Re(Z(xS), { aid: "GENERATE_QR_CODE_DIALOG_DOWNLOAD_MENU" }, { 70708 default: Ve(() => [ 70709 (we(), Ne(yi, null, hs(c, (f) => Re(Z(Za), { 70710 key: `GENERATE_QR_CODE_DIALOG_DOWNLOAD_${f.value}`, 70711 aid: `GENERATE_QR_CODE_DIALOG_DOWNLOAD_${f.value}`, 70712 onClick: (m) => u(f) 70713 }, { 70714 default: Ve(() => [ 70715 fe("div", Uhe, [ 70716 fe("span", { 70717 class: da(f.icon) 70718 }, null, 2), 70719 fe("span", null, ke(f.label), 1) 70720 ]) 70721 ]), 70722 _: 2 70723 }, 1032, ["aid", "onClick"])), 64)) 70724 ]), 70725 _: 1 70726 }) 70727 ]), 70728 _: 1 70729 }) 70730 ]), 70731 _: 1 70732 }) 70733 ], 64)); 70734 } 70735}), _T = /* @__PURE__ */ ii(Whe, [["__scopeId", "data-v-17528252"]]), jhe = /* @__PURE__ */ Mt({ 70736 __name: "select-with-search", 70737 props: /* @__PURE__ */ md({ 70738 aid: {}, 70739 options: {}, 70740 groups: {}, 70741 valueToKeyFn: { type: Function, default: (e) => `${e}` } 70742 }, { 70743 modelValue: { 70744 required: !0 70745 }, 70746 modelModifiers: {} 70747 }), 70748 emits: ["update:modelValue"], 70749 setup(e) { 70750 const t = e, { valueToKeyFn: i } = t, s = (m) => m.map((y) => ({ 70751 text: y.text, 70752 value: y.value, 70753 key: i(y.value) 70754 })), n = Qe(() => t.options ? s(t.options) : []), o = Qe(() => t.groups ? t.groups.map((m) => ({ 70755 name: m.name, 70756 options: s(m.options) 70757 })) : []), r = De(""), a = vhe((m) => { 70758 r.value = m; 70759 }), l = (m, y) => m.length <= 0 ? [] : y.length < 2 ? m : m.filter(({ key: b, text: C }) => C.toLowerCase().indexOf(y) >= 0 ? !0 : b.toLowerCase().indexOf(y) >= 0), c = Qe(() => l(Sf(n), Sf(r).toLowerCase())), u = Qe(() => {
70760 const m = Sf(o); 70761 if (m.length <= 0) 70762 return []; 70763 const y = Sf(r).toLowerCase(); 70764 return m.reduce( 70765 (b, C) => { 70766 const w = l(C.options, y); 70767 return w.length > 0 && b.push({ 70768 name: C.name, 70769 options: w 70770 }), b; 70771 }, 70772 [] 70773 ); 70774 }), d = Qe(() => n.value.reduce( 70775 (m, y) => (m[y.key] = y.text, m), 70776 { "": ge.select } 70777 )), p = Dv(e, "modelValue"), f = (m) => { 70778 p.value = m; 70779 }; 70780 return (m, y) => (we(), Wt(Z(fd), { 70781 aid: t.aid, 70782 "model-value": p.value, 70783 "option-key": Z(i), 70784 "option-label": (b) => d.value[Z(i)(b)], 70785 advanced: "", 70786 "onUpdate:modelValue": f 70787 }, { 70788 default: Ve(() => [ 70789 Re(Z(G6)), 70790 Re(Z(z6), { "disable-teleport": "" }, { 70791 default: Ve(() => [ 70792 Re(Z(H6), { 70793 "model-value": r.value, 70794 "onUpdate:modelValue": Z(a) 70795 }, null, 8, ["model-value", "onUpdate:modelValue"]), 70796 u.value.length > 0 ? (we(!0), Ne(yi, { key: 0 }, hs(u.value, (b) => (we(), Ne(yi, { 70797 key: b.name 70798 }, [ 70799 Re(Z(CL), null, { 70800 default: Ve(() => [ 70801 ut(ke(b.name), 1) 70802 ]), 70803 _: 2 70804 }, 1024), 70805 (we(!0), Ne(yi, null, hs(b.options, (C) => (we(), Wt(Z(ll), { 70806 key: C.key, 70807 value: C.value 70808 }, { 70809 default: Ve(() => [ 70810 ut(ke(C.text), 1) 70811 ]), 70812 _: 2 70813 }, 1032, ["value"]))), 128)) 70814 ], 64))), 128)) : c.value.length > 0 ? (we(), Wt(Z(V6), { key: 1 }, { 70815 default: Ve(() => [ 70816 c.value.length ? (we(!0), Ne(yi, { key: 0 }, hs(c.value, (b) => (we(), Wt(Z(ll), { 70817 key: b.key, 70818 value: b.value 70819 }, { 70820 default: Ve(() => [ 70821 ut(ke(b.text), 1) 70822 ]), 70823 _: 2 70824 }, 1032, ["value"]))), 128)) : di("", !0) 70825 ]), 70826 _: 1 70827 })) : (we(), Wt(Z(ll), { 70828 key: 2, 70829 disabled: "" 70830 }, { 70831 default: Ve(() => [ 70832 ut(ke(Z(ge).noResultsFound), 1) 70833 ]), 70834 _: 1 70835 })) 70836 ]), 70837 _: 1 70838 }) 70839 ]), 70840 _: 1 70841 }, 8, ["aid", "model-value", "option-key", "option-label"])); 70842 } 70843}), $he = { style: { "font-weight": "600" } }, Yhe = { style: { "font-weight": "600" } }, j_ = /* @__PURE__ */ Mt({ 70844 __name: "update-link-owner-dialog", 70845 props: { 70846 dialog: {} 70847 }, 70848 setup(e) { 70849 const t = e, i = De(!1), s = De([]), n = De([]), o = De([]), r = De(""), a = Qe(() => o.value.map((c) => ({ 70850 text: c.employeeEmail || "", 70851 value: c.employeeId || "" 70852 })).sort((c, u) => c.text > u.text ? 1 : -1)); 70853 if (t.dialog.input) { 70854 s.value = t.dialog.input; 70855 const c = /* @__PURE__ */ Object.create(null), u = []; 70856 for (let d = 0; d < s.value.length; d++) { 70857 const p = s.value[d].ownerEmail; 70858 p && !c[p] && (c[p] = !0, u.push(p)); 70859 } 70860 n.value = u; 70861 } 70862 async function l() { 70863 i.value = !0; 70864 try { 70865 const c = o.value.find( 70866 (p) => p.employeeId === r.value 70867 ); 70868 if (!c) 70869 throw new Error("Selected employee not found"); 70870 const u = s.value.map((p) => p.id).filter(Boolean), d = await wt.reassignOwnership({ 70871 linkIds: u, 70872 newOwnerId: r.value, 70873 newOwnerType: "employee", 70874 newOwnerEmail: c.employeeEmail 70875 }); 70876 if (!d.success) 70877 throw new Error(d.error || "Failed to reassign ownership"); 70878 Ude({ 70879 link_count: String(u.length) 70880 }), t.dialog.close({ 70881 success: !0, 70882 updateCount: d.updateCount, 70883 newOwnerEmail: c.employeeEmail, 70884 newOwnerId: r.value, 70885 updatedLinkIds: u 70886 }), qt({ 70887 aid: "LINK_OWNERSHIP_UPDATE_SUCCESS", 70888 message: ge.linkOwnershipUpdateSuccess, 70889 status: ri.Completed 70890 }); 70891 } catch { 70892 i.value = !1, qt({ 70893 aid: "LINK_OWNERSHIP_UPDATE_ERROR", 70894 message: ge.linkOwnershipUpdateFailed, 70895 status: ri.Error 70896 }); 70897 } 70898 } 70899 return Cn(async () => { 70900 const c = await wt.getAccountEmployees({}); 70901 o.value = c.employees?.filter( 70902 (u) => u?.employeeEmail && !n.value.includes(u?.employeeEmail) 70903 ) || []; 70904 }), (c, u) => (we(), Wt(Z(xv), { onSubmit: l }, { 70905 default: Ve(() => [ 70906 Re(Z(Mv), { class: "link-form-section" }, {
70907 default: Ve(() => [ 70908 fe("div", $he, ke(Z(ge).selectedLinks), 1), 70909 (we(!0), Ne(yi, null, hs(n.value, (d, p) => (we(), Ne("div", { 70910 key: `${d}-${p}`, 70911 class: "user-badge", 70912 aid: "USER_BADGE" 70913 }, [ 70914 u[2] || (u[2] = fe("div", { class: "user-badge-icon" }, [ 70915 fe("span", { 70916 class: "fa-light fa-user", 70917 "aria-hidden": "true" 70918 }) 70919 ], -1)), 70920 ut(" " + ke(d), 1) 70921 ]))), 128)), 70922 fe("p", Yhe, ke(Z(ge).selectNewOwner), 1), 70923 Re(jhe, { 70924 modelValue: r.value, 70925 "onUpdate:modelValue": u[0] || (u[0] = (d) => r.value = d), 70926 aid: "SELECT_NEW_OWNER", 70927 options: a.value, 70928 disabled: i.value 70929 }, null, 8, ["modelValue", "options", "disabled"]) 70930 ]), 70931 _: 1 70932 }), 70933 Re(Z(Av), null, { 70934 default: Ve(() => [ 70935 Re(Z(Xs), { 70936 label: "Cancel", 70937 color: "gray-500", 70938 variant: "outlined", 70939 aid: "LINK_DIALOG_CANCEL_BUTTON", 70940 onClick: u[1] || (u[1] = (d) => t.dialog.close()) 70941 }), 70942 Re(Z(Xs), { 70943 type: "submit", 70944 color: "primary", 70945 aid: "LINK_DIALOG_SUBMIT_BUTTON", 70946 label: Z(ge).changeOwner, 70947 loading: i.value, 70948 disabled: i.value || !r.value 70949 }, null, 8, ["label", "loading", "disabled"]) 70950 ]), 70951 _: 1 70952 }) 70953 ]), 70954 _: 1 70955 })); 70956 } 70957}), Khe = ["aid"], Zhe = { class: "clickable-link-name" }, qhe = /* @__PURE__ */ Mt({ 70958 __name: "name-with-actions", 70959 props: { 70960 params: {} 70961 }, 70962 setup(e) { 70963 const { data: t, node: i } = e.params, { id: s, fullShortLinkURL: n, clicks: o, slug: r, type: a } = t, l = De(!1), c = De(!1), u = De(!1), d = De(null); 70964 let p = null; 70965 const f = (I) => { 70966 c.value === !0 && d.value && !d.value.contains(I.target) && (c.value = !1); 70967 }, m = () => { 70968 p = i.rowTop != null ? document.querySelectorAll( 70969 `.ag-row[row-index="${i.rowIndex}"]` 70970 ) : null, p && p.forEach((I) => { 70971 I.addEventListener("mouseenter", () => l.value = !0), I.addEventListener( 70972 "mouseleave", 70973 () => l.value = !1 70974 ); 70975 }); 70976 }, y = () => { 70977 const I = i, L = I.rowTop != null ? document.querySelectorAll(`.ag-row[row-index="${I.rowIndex}"]`) : null; 70978 L && L.forEach((k) => { 70979 k.addEventListener("click", (B) => { 70980 const N = B.target; 70981 N.closest(".ag-selection-checkbox") || N.closest("button") || N.closest('[role="button"]') || N.closest(".ag-menu") || N.closest(".ws-icon-button") || (gr({ 70982 eventName: "link_details_open_click", 70983 metadata: { 70984 label: "link_details", 70985 action: "click", 70986 category: es 70987 } 70988 }), bl(`${Cd}/${s}`)); 70989 }); 70990 }); 70991 }; 70992 tU(() => { 70993 document.removeEventListener("click", f), i && typeof i.rowIndex == "number" && (i.removeEventListener("mouseEnter", b), i.removeEventListener("mouseLeave", C)); 70994 }), Cn(() => { 70995 document.addEventListener("click", f), m(), y(), i && typeof i.rowIndex == "number" && (i.addEventListener("mouseEnter", b), i.addEventListener("mouseLeave", C), e.params.api.addRenderedRowListener( 70996 "virtualRowRemoved", 70997 i.rowIndex, 70998 () => { 70999 i.removeEventListener("mouseEnter", b), i.removeEventListener("mouseLeave", C); 71000 } 71001 )); 71002 }); 71003 const b = () => { 71004 u.value = !0; 71005 }, C = () => { 71006 u.value = !1; 71007 }; 71008 function w(I, L) { 71009 Gu(I, L); 71010 } 71011 function M() { 71012 w("link_customize_qr_click", "link_customize_qr"), bl(`${Cd}/${s}/qr-code`); 71013 } 71014 function A() { 71015 navigator.clipboard.writeText(n), G_("menu"), qt({ 71016 aid: "COPY_LINK_TOAST", 71017 message: ge.linkCopiedToastMessage, 71018 status: ri.Completed 71019 }); 71020 } 71021 return (I, L) => (we(), Ne("div", { 71022 class: da(["name-with-actions-wrapper", { hovered: u.value }]) 71023 }, [ 71024 fe("div", { 71025 aid: "LINK_NAME_" + Z(s), 71026 class: "link-name" 71027 }, [ 71028 fe("span", Zhe, [ 71029 ut(ke(e.params.value) + " ", 1), 71030 Re(Z(ca), { 71031 aid: "LINK_NAME_TOOLTIP_" + Z(s) 71032 }, { 71033 default: Ve(() => [ 71034 ut(ke(e.params.value), 1) 71035 ]), 71036 _: 1 71037 }, 8, ["aid"]) 71038 ]) 71039 ], 8, Khe), 71040 fe("div", { 71041 ref_key: "menuRef", 71042 ref: d, 71043 style: { "margin-right": "10px" } 71044 }, [ 71045 Re(Z(MS), { 71046 aid: "MENU_BUTTON_ICON_" + Z(s), 71047 color: l.value || c.value ? "primary" : "gray-400", 71048 variant: l.value || c.value ? "contained" : "text", 71049 onClick: L[5] || (L[5] = () => c.value = !c.value) 71050 }, { 71051 default: Ve(() => [ 71052 L[6] || (L[6] = fe("span", { class: "fa-solid fa-ellipsis" }, null, -1)), 71053 Re(Z(xS), { 71054 aid: "MENU_BUTTON_MENU_" + Z(s), 71055 anchor: "bottom end", 71056 self: "top end" 71057 }, { 71058 default: Ve(() => [ 71059 Re(Z(Za), { 71060 aid: "MENU_BUTTON_EDIT_" + Z(s), 71061 icon: "fa-light fa-pen", 71062 onClick: L[0] || (L[0] = (k) => e.params.onOpenAddEditLinkDialog(Z(t))) 71063 }, { 71064 default: Ve(() => [ 71065 ut(ke(Z(ge).menuButtonEdit), 1) 71066 ]), 71067 _: 1 71068 }, 8, ["aid"]), 71069 Re(Z(Za), { 71070 aid: "MENU_BUTTON_CHANGE_OWNER_" + Z(s), 71071 icon: "fa-light fa-user", 71072 onClick: L[1] || (L[1] = (k) => e.params.onOpenChangeOwnerDialog(Z(t))) 71073 }, { 71074 default: Ve(() => [ 71075 ut(ke(Z(ge).menuButtonChangeOwner), 1) 71076 ]), 71077 _: 1 71078 }, 8, ["aid"]), 71079 Re(Z(Za), { 71080 aid: "MENU_BUTTON_EXPORT_" + Z(r), 71081 disabled: !Z(o), 71082 icon: "fa-light fa-download", 71083 onClick: L[2] || (L[2] = (k) => e.params.onExportReport(Z(t))) 71084 }, { 71085 default: Ve(() => [ 71086 ut(ke(Z(ge).menuButtonExport) + " ", 1), 71087 Z(o) ? di("", !0) : (we(), Wt(Z(ca), { 71088 key: 0, 71089 aid: "MENU_BUTTON_EXPORT_DISABLED_TOOLTIP" 71090 }, { 71091 default: Ve(() => [ 71092 ut(ke(Z(ge).reportExportDisabledTooltip), 1) 71093 ]), 71094 _: 1 71095 })) 71096 ]), 71097 _: 1 71098 }, 8, ["aid", "disabled"]), 71099 Re(Z(Za), { 71100 aid: "MENU_BUTTON_GENERATE_QR_" + Z(r), 71101 icon: "fa-light fa-qrcode", 71102 onClick: L[3] || (L[3] = (k) => e.params.onGenerateQR( 71103 Z(t), 71104 Z(tC)(Z(n), [ 71105 "refSource=qr-code", 71106 Z(a) === "survey" ? "source=link" : "" 71107 ]) 71108 )) 71109 }, { 71110 default: Ve(() => [ 71111 ut(ke(Z(ge).menuButtonDownloadQR), 1) 71112 ]), 71113 _: 1 71114 }, 8, ["aid"]), 71115 Re(Z(Za), { 71116 aid: "MENU_BUTTON_GENERATE_QR_" + Z(r), 71117 icon: "fa-light fa-paintbrush", 71118 onClick: M 71119 }, { 71120 default: Ve(() => [ 71121 ut(ke(Z(ge).menuButtonCustomizeQR), 1) 71122 ]), 71123 _: 1 71124 }, 8, ["aid"]), 71125 Re(Z(Za), { 71126 aid: "MENU_BUTTON_COPY_LINK_" + Z(r), 71127 icon: "fa-light fa-link-simple", 71128 onClick: A 71129 }, { 71130 default: Ve(() => [ 71131 ut(ke(Z(ge).copyLinkMenuItem), 1) 71132 ]), 71133 _: 1 71134 }, 8, ["aid"]), 71135 Re(Z(Za), { 71136 aid: "MENU_BUTTON_DELETE_" + Z(s), 71137 icon: "fa-light fa-trash-can", 71138 onClick: L[4] || (L[4] = (k) => e.params.onOpenDeleteLinkDialog([Z(t)])) 71139 }, { 71140 default: Ve(() => [ 71141 ut(ke(Z(ge).menuButtonDelete), 1) 71142 ]), 71143 _: 1 71144 }, 8, ["aid"]) 71145 ]), 71146 _: 1 71147 }, 8, ["aid"]) 71148 ]), 71149 _: 1 71150 }, 8, ["aid", "color", "variant"]) 71151 ], 512) 71152 ], 2)); 71153 } 71154}); 71155uM.registerModules([O_]); 71156const Qhe = IM.withPart(i_).withParams({ 71157 accentColor: "#1E90FA", 71158 backgroundColor: "#FFFFFF", 71159 borderColor: "#E0E0E0",
71160 borderRadius: "6px", 71161 browserColorScheme: "light", 71162 cellHorizontalPadding: "18px", 71163 cellHorizontalPaddingScale: 1, 71164 checkboxBorderRadius: "3px", 71165 checkboxCheckedBackgroundColor: "#1E90FA", 71166 checkboxCheckedBorderColor: "#1E90FA", 71167 checkboxCheckedShapeColor: "#FFFFFF", 71168 chromeBackgroundColor: "#FFFFFF", 71169 columnBorder: !1, 71170 columnDropCellBackgroundColor: "#FFFFFF", 71171 focusShadow: "#1E90FA80 0px 0px 0px 0px", 71172 fontFamily: ["Mulish", "sans-serif"], 71173 fontSize: "14px", 71174 footerRowBorder: !0, 71175 foregroundColor: "#2D2E30", 71176 headerHeight: 38, 71177 headerBackgroundColor: "#F4F6F8", 71178 headerRowBorder: !1, 71179 headerFontSize: "14px", 71180 headerFontWeight: 700, 71181 headerTextColor: "#2D2E30", 71182 headerVerticalPaddingScale: 0.5, 71183 menuBackgroundColor: "#FFFFFF", 71184 menuBorder: !1, 71185 menuSeparatorColor: "#E0E0E0", 71186 menuTextColor: "#2D2E30", 71187 rowBorder: !0, 71188 rowHeight: "50px", 71189 rowHoverColor: "#F4F6F8", 71190 rowVerticalPaddingScale: 0.75, 71191 selectedRowBackgroundColor: "#E1EBFF", 71192 sideBarBackgroundColor: "#FFFFFF", 71193 sidePanelBorder: !1, 71194 tooltipBackgroundColor: "#2D2E30", 71195 tooltipTextColor: "#FFFFFF", 71196 wrapperBorder: !1, 71197 wrapperBorderRadius: "6px" 71198}), Xhe = { class: "ws-grid-header" }, Jhe = { class: "relative" }, epe = { class: "pointer-events-none absolute icon-wrapper" }, tpe = { class: "bulk-actions-buttons" }, ipe = /* @__PURE__ */ Mt({ 71199 inheritAttrs: !1, 71200 __name: "ws-grid", 71201 props: { 71202 rowData: {}, 71203 columnDefs: {}, 71204 aid: {}, 71205 customComponents: {}, 71206 noRowsOverlayComponent: {}, 71207 overlayNoRowsTemplate: {}, 71208 loadingOverlayComponent: {}, 71209 overlayLoadingTemplate: {}, 71210 loading: { type: Boolean }, 71211 getRowClass: { type: Function } 71212 }, 71213 emits: ["delete-selected-links", "owner-changed"], 71214 setup(e, { expose: t, emit: i }) { 71215 const s = e, n = Qe(() => ({ 71216 theme: Qhe, 71217 columnDefs: s.columnDefs, 71218 tooltipShowDelay: 500, 71219 rowData: s.rowData, 71220 domLayout: "autoHeight", 71221 suppressCellFocus: !0, 71222 defaultColDef: { resizable: !0 }, 71223 class: "ws-grid", 71224 aid: s.aid, 71225 loading: s.loading, 71226 overlayLoadingTemplate: s.overlayLoadingTemplate, 71227 autoSizeStrategy: { type: "fitGridWidth", skipHeader: !0 }, 71228 noRowsOverlayComponent: s.noRowsOverlayComponent, 71229 overlayNoRowsTemplate: s.overlayNoRowsTemplate, 71230 loadingOverlayComponent: __, 71231 selectionColumnDef: { 71232 maxWidth: 36, 71233 minWidth: 36, 71234 pinned: "left" 71235 }, 71236 rowSelection: { mode: "multiRow", selectAll: "filtered" }, 71237 popupParent: document.body.querySelector(".table-container") || document.body, 71238 popupPositioning: "under", 71239 alwaysShowHorizontalScroll: !0, 71240 getRowClass: s.getRowClass 71241 })), o = i, r = De(null), a = De(null), l = De( 71242 r.value?.api?.getSelectedRows?.() || [] 71243 ), c = De(""); 71244 function u() { 71245 const m = r.value.api.getColumnState().find((y) => y.sort !== null)?.sort || null; 71246 a.value = m; 71247 } 71248 function d() { 71249 o("delete-selected-links", l.value); 71250 } 71251 async function p() { 71252 if (l.value.length === 0) 71253 return; 71254 const m = await Vu({ 71255 aid: "UPDATE_LINK_OWNER_DIALOG", 71256 headerText: ge.changeOwner, 71257 component: j_, 71258 showTopSeparator: !0, 71259 input: l.value 71260 }); 71261 !m || !m.success || (o("owner-changed", m), r.value?.api?.deselectAll()); 71262 } 71263 function f() { 71264 const m = document.querySelector('[aid="WS_GRID_SEARCH_INPUT"]').value; 71265 r.value.api.setGridOption("quickFilterText", m); 71266 } 71267 return Cn(() => { 71268 r.value?.api?.addEventListener("sortChanged", u); 71269 }), t(s.customComponents), (m, y) => (we(), Ne(yi, null, [ 71270 fe("div", Xhe, [ 71271 fe("div", Jhe, [ 71272 Tu(fe("div", null, ke(l.value.length) + " " + ke(Z(ge).selectedOf) + " " + ke(e.rowData.length), 513), [ 71273 [Lu, l.value.length] 71274 ]), 71275 Tu(fe("div", epe, [...y[3] || (y[3] = [ 71276 fe("span", { 71277 class: "fa-regular fa-search text-gray-400", 71278 "aria-hidden": "true" 71279 }, null, -1) 71280 ])], 512), [ 71281 [Lu, !l.value.length] 71282 ]), 71283 Tu(Re(Z(Hu), { 71284 value: c.value, 71285 "onUpdate:value": y[0] || (y[0] = (b) => c.value = b), 71286 class: "link-search-input", 71287 aid: "WS_GRID_SEARCH_INPUT", 71288 placeholder: "Search by name or owner", 71289 size: "sm", 71290 "onUpdate:modelValue": y[1] || (y[1] = (b) => f()) 71291 }, null, 8, ["value"]), [ 71292 [Lu, !l.value.length] 71293 ]) 71294 ]), 71295 fe("div", tpe, [ 71296 Tu(Re(Z(Xs), { 71297 class: "change-owner-button", 71298 aid: "WS_GRID_CHANGE_LINKS_OWNER_BUTTON", 71299 size: "sm", 71300 color: "primary", 71301 variant: "outlined", 71302 onClick: p 71303 }, { 71304 default: Ve(() => [ 71305 ut(ke(Z(ge).changeOwner), 1) 71306 ]), 71307 _: 1 71308 }, 512), [ 71309 [Lu, l.value.length > 0] 71310 ]), 71311 Tu(Re(Z(Xs), { 71312 class: "delete-button", 71313 aid: "WS_GRID_DELETE_SELECTED_LINKS_BUTTON", 71314 size: "sm", 71315 color: "primary", 71316 variant: "outlined", 71317 onClick: d 71318 }, { 71319 default: Ve(() => [ 71320 ut(ke(Z(ge).dialogDeleteButton), 1) 71321 ]), 71322 _: 1 71323 }, 512), [ 71324 [Lu, l.value.length > 0] 71325 ]) 71326 ]) 71327 ]), 71328 Re(Z(N_), Ev({ 71329 ref_key: "gridRef", 71330 ref: r, 71331 class: [ 71332 a.value ? "sorted-" + a.value : "not-sorted", 71333 s.loading ? "" : "ag-loaded" 71334 ] 71335 }, n.value, { 71336 onSelectionChanged: y[2] || (y[2] = (b) => l.value = r.value?.api?.getSelectedRows() || []) 71337 }), null, 16, ["class"]) 71338 ], 64)); 71339 } 71340}), spe = /* @__PURE__ */ ii(ipe, [["__scopeId", "data-v-7d193956"]]), npe = { class: "text-cell" }, ope = { class: "tooltip-content" }, xm = /* @__PURE__ */ Mt({ 71341 __name: "text-cell", 71342 props: { 71343 params: {} 71344 }, 71345 setup(e) { 71346 const t = e, i = t.params.tooltipPrefix || "TEXT_CELL_TOOLTIP", s = De(!1), n = De(null), o = De(!1), r = () => { 71347 n.value && (s.value = n.value.scrollWidth > n.value.clientWidth); 71348 }, a = Qe(() => t.params.value == null ? "" : typeof t.params.value == "string" ? t.params.value : t.params.value.formattedValue || t.params.value), l = Qe(() => t.params.value == null ? "" : typeof t.params.value == "string" ? t.params.value : t.params.value.originalValue || t.params.value.displayValue); 71349 return Cn(async () => { 71350 const { node: c } = t.params, u = c.rowTop != null ? document.querySelectorAll( 71351 `.ag-row[row-index="${c.rowIndex}"]` 71352 ) : null; 71353 u && u.forEach((d) => { 71354 d.addEventListener("mouseenter", () => o.value = !0), d.addEventListener( 71355 "mouseleave", 71356 () => o.value = !1 71357 ); 71358 }), await wL(), r(); 71359 }), (c, u) => (we(), Ne("div", npe, [ 71360 fe("span", { 71361 ref_key: "textRef", 71362 ref: n, 71363 class: "text-content" 71364 }, [ 71365 ut(ke(a.value) + " ", 1), 71366 s.value ? (we(), Wt(Z(ca), { 71367 key: 0, 71368 maxWidth: "400px", 71369 aid: `${Z(i)}_${e.params.value.originalValue || e.params.value}` 71370 }, { 71371 default: Ve(() => [ 71372 fe("div", ope, ke(l.value), 1) 71373 ]), 71374 _: 1 71375 }, 8, ["aid"])) : di("", !0) 71376 ], 512), 71377 iU(c.$slots, "actions", { isHovered: o.value }) 71378 ])); 71379 } 71380}), BT = /* @__PURE__ */ Mt({ 71381 __name: "short-link-cell", 71382 props: { 71383 params: {} 71384 }, 71385 setup(e) { 71386 const t = De("Copy link"), i = Qe(() => typeof e.params.value == "string" ? e.params.value : e.params.value.originalValue || e.params.value.formattedValue || ""), s = async () => { 71387 await navigator.clipboard.writeText(i.value), G_("inline_cell"), t.value = "Copied!", setTimeout(() => { 71388 t.value = "Copy link"; 71389 }, 2e3); 71390 }; 71391 return (n, o) => (we(), Wt(xm, { 71392 params: e.params, 71393 "tooltip-prefix": "SHORT_LINK_TOOLTIP" 71394 }, {
71395 actions: Ve(({ isHovered: r }) => [ 71396 fe("span", { 71397 class: "fa-regular fa-copy copy-icon", 71398 style: Em({ 71399 color: "#1e90fa", 71400 opacity: r ? "1" : "0", 71401 cursor: "pointer", 71402 fontSize: "14px", 71403 paddingLeft: "10px" 71404 }), 71405 onClick: ML(s, ["stop"]) 71406 }, [ 71407 Re(Z(ca), { 71408 aid: `COPY_LINK_TOOLTIP_${i.value}` 71409 }, { 71410 default: Ve(() => [ 71411 ut(ke(t.value), 1) 71412 ]), 71413 _: 1 71414 }, 8, ["aid"]) 71415 ], 4) 71416 ]), 71417 _: 1 71418 }, 8, ["params"])); 71419 } 71420}), rpe = { class: "created-at-cell" }, ape = /* @__PURE__ */ Mt({ 71421 __name: "created-at-cell", 71422 props: { 71423 params: {} 71424 }, 71425 setup(e) { 71426 const t = new Date(e.params.value).toLocaleDateString("en-US", { 71427 year: "numeric", 71428 month: "short", 71429 day: "numeric" 71430 }), i = new Date(e.params.value).toLocaleString("en-US", { 71431 year: "numeric", 71432 month: "short", 71433 day: "numeric", 71434 hour: "numeric", 71435 minute: "2-digit" 71436 }).replace(/AM|PM/, (s) => s.toLowerCase()); 71437 return (s, n) => (we(), Ne("div", rpe, [ 71438 Re(Z(ca), { 71439 aid: `CREATED_AT_TOOLTIP_${e.params.value}`, 71440 "max-width": "400px", 71441 position: "top-right" 71442 }, { 71443 default: Ve(() => [ 71444 ut(ke(Z(ge).lastClickedOn) + ke(Z(i)), 1) 71445 ]), 71446 _: 1 71447 }, 8, ["aid"]), 71448 fe("span", null, ke(Z(t)), 1) 71449 ])); 71450 } 71451}), lpe = { class: "links-page" }, cpe = { class: "header" }, upe = { class: "header-title" }, dpe = { class: "header-text" }, hpe = { 71452 key: 0, 71453 aid: "EMPTY_STATE_CONTAINER", 71454 class: "empty-state-container" 71455}, ppe = ["src"], gpe = { class: "empty-state-header" }, fpe = { class: "empty-state-text" }, mpe = { 71456 key: 1, 71457 class: "table-container" 71458}, vpe = /* @__PURE__ */ Mt({ 71459 __name: "links-page", 71460 setup(e) { 71461 const t = IS(), i = fW(), s = De([]), n = De(!0), o = De(!1), r = De(!1), a = De({}), l = De({}), c = [ 71462 { 71463 field: "title", 71464 headerName: ge.nameLabel, 71465 minWidth: 315, 71466 maxWidth: 315, 71467 pinned: !0, 71468 resizable: !1, 71469 cellRenderer: qhe, 71470 // eslint-disable-next-line @typescript-eslint/no-explicit-any 71471 getQuickFilterText: (N) => N.value, 71472 // eslint-disable-next-line @typescript-eslint/no-explicit-any 71473 cellRendererParams: (N) => ({ 71474 link: N.data, 71475 onOpenAddEditLinkDialog: A, 71476 onOpenDeleteLinkDialog: w, 71477 onOpenChangeOwnerDialog: M, 71478 onExportReport: L, 71479 onGenerateQR: I 71480 }) 71481 }, 71482 { 71483 field: "fullShortLinkURL", 71484 headerName: ge.tableLinkColumn, 71485 minWidth: 200, 71486 cellRenderer: BT, 71487 getQuickFilterText: () => "", 71488 valueFormatter: (N) => { 71489 const W = N.value; 71490 return !W || typeof W != "string" ? W : W.replace(/^https?:\/\//, ""); 71491 }, 71492 useValueFormatterForExport: !1, 71493 cellRendererParams: (N) => ({ 71494 value: { 71495 formattedValue: N.valueFormatted || N.value, 71496 originalValue: N.value 71497 } 71498 }) 71499 }, 71500 { 71501 field: "redirectUrl", 71502 headerName: ge.tableUrlColumn, 71503 cellRenderer: xm, 71504 cellRendererParams: { 71505 tooltipPrefix: "REDIRECT_URL_TOOLTIP" 71506 }, 71507 getQuickFilterText: () => "" 71508 }, 71509 { 71510 field: "ownerEmail", 71511 headerName: ge.tableOwnerColumn, 71512 cellRenderer: xm, 71513 cellRendererParams: { 71514 tooltipPrefix: "OWNER_EMAIL_TOOLTIP" 71515 }, 71516 // eslint-disable-next-line @typescript-eslint/no-explicit-any 71517 getQuickFilterText: (N) => N.value 71518 }, 71519 { 71520 field: "clicks", 71521 headerName: ge.tableClicksColumn, 71522 // eslint-disable-next-line @typescript-eslint/no-explicit-any 71523 cellRenderer: (N) => N.data.clicks > 0 ? N.data.clicks : "No clicks yet", 71524 getQuickFilterText: () => "" 71525 }, 71526 { 71527 field: "createdAt", 71528 headerName: ge.tableCreatedColumn, 71529 resizable: !1, 71530 cellRenderer: ape, 71531 getQuickFilterText: () => "" 71532 } 71533 ], u = Qe(() => ({ 71534 rowData: s.value, 71535 columnDefs: c, 71536 loading: n.value, 71537 customComponents: { 71538 ShortLinkCell: BT, 71539 TextCell: xm 71540 }, 71541 getRowClass: (N) => { 71542 const W = N.data; 71543 if (!W || W.riskStatus !== J0.LINK_RISK_STATUS_BLOCKED) 71544 return ""; 71545 const se = W.riskStatusReason?.trim() || ""; 71546 return se === "INVALID_URL" || se === "BROKEN_URL" ? "link-row--risk-fetch" : "link-row--risk-unsafe"; 71547 }, 71548 autoSizeStrategy: { type: "fitGridWidth", skipHeader: !0 } 71549 })); 71550 async function d() { 71551 const { allowed: N } = await wt.isLinkCreationTrustPolicyAllowed({}); 71552 if (N) return !0; 71553 o.value = !0; 71554 const W = await Z0.verifyEmail(); 71555 return o.value = !1, W ? !0 : (qt({ 71556 aid: "EMAIL_VERIFICATION_FAILED", 71557 message: ge.failedToVerifyEmail, 71558 status: ri.Error 71559 }), !1); 71560 } 71561 async function p() {
71562 try { 71563 a.value = await LT.accountBasicInfo({}); 71564 } catch (N) { 71565 console.error("Failed to fetch account info", N), a.value = {}; 71566 } 71567 } 71568 async function f() { 71569 try { 71570 l.value = await uI.getAvailableDomainList({}); 71571 } catch (N) { 71572 console.error("Failed to fetch custom domain list", N), l.value = {}; 71573 } 71574 } 71575 async function m() { 71576 await Promise.all([ 71577 p(), 71578 f(), 71579 b() 71580 ]); 71581 } 71582 async function y() { 71583 await Promise.allSettled([ 71584 LT.init(bc()), 71585 wt.init(bc()), 71586 uI.init(bc()) 71587 ]); 71588 } 71589 Cn(async () => { 71590 const N = t.query.openModal === "download-url" && t.query.linkId ? t.query.linkId : null; 71591 if (N && i.replace({ query: {} }), await y(), await m(), gr({ 71592 eventName: "links_page_load", 71593 metadata: { 71594 label: "links", 71595 action: "load", 71596 category: "links_page_flow" 71597 } 71598 }), s.value.length === 0 && gr({ 71599 eventName: "empty_state_load", 71600 metadata: { 71601 label: "empty_state", 71602 action: "load", 71603 category: es 71604 } 71605 }), N) 71606 try { 71607 const { link: W } = await wt.getLinkById({ id: N }); 71608 await Vu({ 71609 aid: "GENERATE_QR_DIALOG", 71610 headerText: ge.generateQRDialogHeader, 71611 component: _T, 71612 showTopSeparator: !0, 71613 input: { 71614 id: N, 71615 title: W?.title || "", 71616 fullShortLinkURL: W?.fullShortLinkURL, 71617 type: W?.type, 71618 qrCodeStylesData: W?.qrCodeStylesData 71619 } 71620 }); 71621 } catch (W) { 71622 qt({ 71623 status: ri.Error, 71624 message: ge.openQrDialogFailed, 71625 aid: "OPEN_QR_DIALOG_AFTER_NAVIGATION_FAILED" 71626 }), console.error("Failed to open QR dialog after navigation:", W); 71627 } 71628 }); 71629 const b = async () => { 71630 try { 71631 const N = await wt.list({ 71632 includeAnalytics: !0 71633 }); 71634 s.value = N.links || [], n.value = !1; 71635 const W = N.clicks || []; 71636 s.value.forEach((se) => { 71637 const ue = W.find((Ce) => Ce.linkId === se.id); 71638 se.clicks = ue?.clicks, ue?.lastClick && (se.lastClick = new Date(ue?.lastClick).toLocaleDateString( 71639 "en-US", 71640 { 71641 year: "numeric", 71642 month: "short", 71643 day: "numeric", 71644 hour: "numeric", 71645 minute: "2-digit" 71646 } 71647 )); 71648 }); 71649 } catch { 71650 console.error("Error fetching links. Please try again later."); 71651 } finally { 71652 n.value = !1; 71653 } 71654 }; 71655 async function C(N) { 71656 if (N?.newOwnerEmail && N?.updatedLinkIds) { 71657 const W = new Set(N.updatedLinkIds); 71658 s.value = s.value.map((se) => W.has(se.id) ? { 71659 ...se, 71660 ownerEmail: N.newOwnerEmail, 71661 ownerId: N.newOwnerId 71662 } : se); 71663 } 71664 } 71665 async function w(N) { 71666 N?.length && Gu("delete_link_click", "delete_link"); 71667 const W = await Vu({ 71668 aid: "DELETE_LINK_DIALOG", 71669 headerText: ge.dialogTitleDelete, 71670 component: Phe, 71671 showTopSeparator: !1, 71672 input: N 71673 }); 71674 if (!W) return; 71675 const se = W; 71676 if (se.success && se.deleteCount && se.deleteCount > 0) { 71677 const ue = new Set(N?.map((Ce) => Ce.id)); 71678 s.value = s.value.filter((Ce) => !ue.has(Ce.id)); 71679 } 71680 } 71681 async function M(N) { 71682 Gu("change_link_owner_click", "change_link_owner"); 71683 const W = await Vu({ 71684 aid: "UPDATE_LINK_OWNER_DIALOG", 71685 headerText: ge.changeOwner, 71686 component: j_, 71687 showTopSeparator: !0, 71688 input: [N] 71689 }); 71690 !W || !W.success || await C( 71691 W 71692 ); 71693 } 71694 async function A(N) { 71695 if (!r.value) { 71696 r.value = !0; 71697 try { 71698 const W = N === void 0, se = s.value.length === 0; 71699 if (o.value || (W ? gr({ 71700 eventName: "new_link_creation_start", 71701 metadata: { 71702 label: "add_link", 71703 action: "click", 71704 category: es 71705 } 71706 }) : Gu("edit_link_click", "edit_link"), !await d())) return; 71707 if (W) { 71708 const { limitIsReached: q } = await wt.isLimitReached({}); 71709 if (q) { 71710 await gS(); 71711 return; 71712 } 71713 } 71714 const Ce = await Rhe( 71715 N, 71716 a.value, 71717 l.value 71718 ); 71719 if (!Ce || !Ce.link) return; 71720 const te = Ce.link; 71721 if (W) 71722 s.value.unshift(te), zde({ 71723 source: se ? "empty_state" : "header" 71724 }); 71725 else { 71726 const q = s.value.findIndex(($) => $.id === N?.id); 71727 q !== -1 && (!te.notificationEmails?.length && !te.notificationEmail && (s.value[q].notificationEmails = [], s.value[q].notificationEmail = ""), Object.assign(s.value[q], te)), Hde(); 71728 } 71729 } finally { 71730 r.value = !1; 71731 } 71732 } 71733 } 71734 const I = async (N, W) => { 71735 Gu("link_download_qr_click", "link_download_qr"); 71736 const se = !N.qrFirstGeneratedAt; 71737 if (se) { 71738 const { limitIsReached: Ce } = await wt.isQRGenerationLimitReached( 71739 {} 71740 ); 71741 if (Ce) { 71742 await mhe(); 71743 return; 71744 } 71745 } 71746 const ue = await Vu({ 71747 aid: "GENERATE_QR_DIALOG", 71748 headerText: ge.generateQRDialogHeader, 71749 component: _T, 71750 showTopSeparator: !0, 71751 input: { 71752 fullShortLinkURL: W, 71753 title: N.title, 71754 id: N.id, 71755 type: N.type, 71756 qrFirstGeneratedAt: N.qrFirstGeneratedAt 71757 } 71758 }); 71759 if (se && N.id) { 71760 const Ce = s.value.find((te) =>
71760 te.id === N.id); 71761 Ce && (Ce.qrFirstGeneratedAt = Date.now()); 71762 } 71763 return ue; 71764 }, L = async (N) => { 71765 if (!N.clicks) return; 71766 Gu("link_export_report_click", "link_export_report"); 71767 let W = []; 71768 const se = qt({ 71769 status: ri.Loading, 71770 message: ge.downloadStarted, 71771 aid: "EXPORT_REPORT_STARTED" 71772 }); 71773 try { 71774 W = await k(N, 1, W), se.dismiss(), qt({ 71775 message: ge.downloadCompleted, 71776 aid: "EXPORT_REPORT_COMPLETED" 71777 }), B(W || [], N), B_("grid", { 71778 click_count: String(N.clicks ?? 0) 71779 }); 71780 } catch (ue) { 71781 se.dismiss(), console.error("Failed to export report", ue); 71782 } 71783 }, k = async (N, W = 1, se = []) => { 71784 const ue = await wt.getReport({ linkId: N.id, page: W }); 71785 return se = se.concat(ue.reportData || []), ue.totalEntries && ue.totalEntries > W * AL && (se = await k(N, W + 1, se)), se; 71786 }; 71787 function B(N, W) { 71788 const se = ge.csvReportColumnTitles, ue = Object.keys(N[0]).map((T) => `"${se[T]}"`).join(",") + ` 71789`, Ce = N.map((T) => { 71790 if (T.source = T.source == "qr-code" ? ge.qrCodeSource : ge.linkSource, T.dateTime) { 71791 const E = new Date(T.dateTime); 71792 T.dateTime = E.toLocaleDateString("en-GB", { 71793 year: "numeric", 71794 month: "2-digit", 71795 day: "2-digit", 71796 hour12: !1, 71797 hour: "2-digit", 71798 minute: "2-digit", 71799 second: "2-digit" 71800 }); 71801 } 71802 return Object.values(T).map((E) => E === !0 || E === !1 ? E ? ge.yes : ge.no : `"${E}"`).toString(); 71803 }).join(` 71804`), te = new Blob(["\uFEFF" + ue + Ce], { 71805 type: "text/csv;charset=utf-8" 71806 }), q = document.createElement("a"); 71807 q.setAttribute("download", `${W.title}_link_report.csv`); 71808 const $ = URL.createObjectURL(te); 71809 q.setAttribute("href", $), q.click(); 71810 } 71811 return (N, W) => (we(), Ne("div", lpe, [ 71812 fe("div", cpe, [ 71813 fe("div", upe, [ 71814 fe("span", dpe, ke(Z(ge).header), 1) 71815 ]), 71816 s.value.length ? (we(), Wt(Z(Xs), { 71817 key: 0, 71818 aid: "ADD_LINK_BUTTON", 71819 label: Z(ge).addLink, 71820 size: "sm", 71821 color: "primary", 71822 disabled: o.value || r.value, 71823 onClick: W[0] || (W[0] = (se) => A()) 71824 }, null, 8, ["label", "disabled"])) : di("", !0) 71825 ]), 71826 !s.value.length && !n.value ? (we(), Ne("div", hpe, [ 71827 fe("img", { 71828 class: "empty-state-logo", 71829 alt: "links", 71830 src: Z(Lhe) 71831 }, null, 8, ppe), 71832 fe("span", gpe, ke(Z(ge).emptyStateHeader), 1), 71833 fe("span", fpe, ke(Z(ge).emptyStateText), 1), 71834 Re(Z(Xs), { 71835 aid: "ADD_LINK_EMPTY_STATE_BUTTON", 71836 label: Z(ge).addLink, 71837 color: "primary", 71838 size: "lg", 71839 disabled: o.value || r.value, 71840 onClick: W[1] || (W[1] = (se) => A()) 71841 }, null, 8, ["label", "disabled"]) 71842 ])) : di("", !0), 71843 s.value.length || n.value ? (we(), Ne("div", mpe, [ 71844 Re(spe, Ev(u.value, { 71845 aid: "LINKS_TABLE", 71846 onDeleteSelectedLinks: w, 71847 onOwnerChanged: C 71848 }), null, 16) 71849 ])) : di("", !0) 71850 ])); 71851 } 71852}), ype = /* @__PURE__ */ ii(vpe, [["__scopeId", "data-v-d3a8290d"]]), xs = { 71853 menuButtonQRCode: "QR code", 71854 exit: "Exit", 71855 save: "Save", 71856 qrCodeStylesEdit: "Edit", 71857 colors: "Colors", 71858 logo: "Logo", 71859 uploadPhotoOrLogo: "Upload photo or logo", 71860 imageSizeRequirement: "Image should be at least 100X100px", 71861 failedToProxyImage: "Failed to proxy image", 71862 saveSuccess: "QR code styles saved successfully", 71863 saveError: "Failed to save QR code styles", 71864 fetchError: "Failed to fetch link QR code data", 71865 removeImage: "Remove image", 71866 replaceImage: "Replace image", 71867 uploadError: "Failed to upload logo", 71868 failedToFetchLogos: "Failed to fetch logos", 71869 qrCodeCreationFailed: "Failed to create QR code", 71870 style: "Style", 71871 dotsColorTooltip: "Code color", 71872 backgroundColorTooltip: "Background color" 71873}, Cpe = { class: "header" }, bpe = { class: "header-title" }, wpe = { class: "header-buttons" }, Spe = /* @__PURE__ */ Mt({ 71874 __name: "qr-editor-header", 71875 props: { 71876 hasChanges: { type: Boolean }, 71877 isSaving: { type: Boolean }, 71878 linkName: {} 71879 }, 71880 emits: ["save"], 71881 setup(e, { emit: t }) { 71882 const i = t; 71883 return (s, n) => (we(), Ne("div", Cpe, [ 71884 fe("div", bpe, ke(e.linkName), 1), 71885 fe("div", wpe, [ 71886 Re(Z(Xs), { 71887 label: Z(xs).exit, 71888 variant: "outlined", 71889 size: "sm", 71890 aid: "LAYOUT_EDITOR_HEADER_EXIT_BUTTON", 71891 onClick: n[0] || (n[0] = (o) => Z(bl)(Z(Cd), { reload: !0 })) 71892 }, null, 8, ["label"]), 71893 Re(Z(Xs), { 71894 label: Z(xs).save, 71895 color: "primary", 71896 size: "sm", 71897 disabled: !e.hasChanges || e.isSaving, 71898 aid: "LAYOUT_EDITOR_HEADER_SAVE_BUTTON", 71899 onClick: n[1] || (n[1] = (o) => i("save")) 71900 }, null, 8, ["label", "disabled"]) 71901 ]) 71902 ])); 71903 } 71904}), xpe = /* @__PURE__ */ ii(Spe, [["__scopeId", "data-v-b807d236"]]), Mpe = { class: "layout-preview" }, Ape = { class: "layout-preview-content" }, Dpe = { 71905 key: 0, 71906 class: "loader" 71907}, Epe = /* @__PURE__ */ Mt({ 71908 __name: "layout-preview", 71909 props: { 71910 colors: {}, 71911 fullShortLinkURL: {}, 71912 linkName: {}, 71913 logoUrl: {}, 71914 style: {} 71915 }, 71916 setup(e) { 71917 const t = De(null), i = De(!1), { qrCode: s, createQRCode: n, updateQRCode: o, cleanup: r } = W_(), a = De(void 0), l = e; 71918 return Cn(async () => { 71919 if (i.value = !0, !!t.value) { 71920 t.value.innerHTML = ""; 71921 try { 71922 s.value = await n({ 71923 data: l.fullShortLinkURL, 71924 dotsColor: l.colors.dotsColor || "black", 71925 backgroundColor: l.colors.backgroundColor || "white", 71926 image: l.logoUrl, 71927 dotsOptions: { 71928 type: l.style 71929 } 71930 }), s.value && t.value && (s.value.append(t.value), a.value = l.logoUrl); 71931 } catch (c) { 71932 console.error("Failed to create QR code:", c), qt({ 71933 status: ri.Error, 71934 message: xs.qrCodeCreationFailed, 71935 aid: "CREATE_QR_CODE_PREVIEW_FAILED" 71936 }); 71937 } finally { 71938 i.value = !1; 71939 } 71940 } 71941 }), Gn( 71942 () => [l.colors, l.style, l.logoUrl], 71943 async () => { 71944 if (!s.value || !t.value) 71945 return; 71946 const c = a.value !== l.logoUrl; 71947 await o({ 71948 dotsColor: l.colors.dotsColor || "black", 71949 backgroundColor: l.colors.backgroundColor || "white", 71950 dotsOptions: { 71951 type: l.style 71952 }, 71953 image: l.logoUrl 71954 }), c && (t.value.innerHTML = "", s.value.append(t.value), a.value = l.logoUrl); 71955 }, 71956 { deep: !0 } 71957 ), Nd(() => { 71958 r(); 71959 }), (c, u) => (we(), Ne("div", Mpe, [ 71960 fe("div", Ape, [ 71961 Tu(fe("div", { 71962 ref_key: "canvas", 71963 ref: t, 71964 class: "canvas" 71965 }, null, 512), [ 71966 [Lu, !i.value] 71967 ]), 71968 i.value ? (we(), Ne("div", Dpe, [...u[0] || (u[0] = [ 71969 fe("div", null, [ 71970 fe("span", { 71971 id: "frame-loader", 71972 "aria-hidden": "true" 71973 }) 71974 ], -1) 71975 ])])) : di("", !0) 71976 ]) 71977 ])); 71978 } 71979}), Ipe = /* @__PURE__ */ ii(Epe, [["__scopeId", "data-v-a5ba2d8b"]]), Rpe = { class: "color-picker-input" }, Tpe = { class: "color-picker-input-trigger-container" }, Lpe = ["aid"], kpe = /* @__PURE__ */ Mt({ 71980 __name: "colorpicker-input", 71981 props: { 71982 aid: {}, 71983 modelValue: {} 71984 }, 71985 emits: ["update:modelValue"], 71986 setup(e, { emit: t }) { 71987 const i = e, s = t, n = Qe({ 71988 get: () => i.modelValue, 71989 set: (o) => s("update:modelValue", o) 71990 }); 71991 return (o, r) => (we(), Ne("div", Rpe, [ 71992 fe("div", Tpe, [ 71993 fe("button", { 71994 class: "color-picker-input-trigger", 71995 style: Em(`background-color: ${n.value || "transparent"}`), 71996 aid: `${e.aid}_COLOR_PICKER_TRIGGER` 71997 }, [ 71998 Re(Z(xS), { 71999 aid: `${e.aid}_COLOR_PICKER_TRIGGER_MENU`, 72000 "no-auto-close": "" 72001 }, { 72002 default: Ve(() => [ 72003 Re(Z(U6), { 72004 modelValue: n.value, 72005 "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a), 72006 aid: `${e.aid}_COLOR_PICKER` 72007 }, null, 8, ["modelValue", "aid"]) 72008 ]), 72009 _: 1 72010 }, 8, ["aid"]) 72011 ], 12, Lpe) 72012 ]), 72013 Re(Z(Hu), { 72014 modelValue: n.value, 72015 "onUpdate:modelValue": r[1] || (r[1] = (a) => n.value = a), 72016 size: "xs",
72017 "hide-bottom-space": "", 72018 aid: `${e.aid}_COLOR_PICKER_INPUT` 72019 }, null, 8, ["modelValue", "aid"]) 72020 ])); 72021 } 72022}), Ppe = /* @__PURE__ */ ii(kpe, [["__scopeId", "data-v-8bef74db"]]), eo = { 72023 companyOptionsHeader: "Company", 72024 employeeOptionsHeader: "Employee", 72025 select: "Select", 72026 useVariable: "Use Variable", 72027 editCompanyDetails: "Edit company details", 72028 editEmployeeData: "Edit employee data", 72029 useVariableTooltip: "Auto-populate employee and company details", 72030 companyLogo: "Company Logo", 72031 employeeLogo: "Employee Logo", 72032 employeePhoto: "Employee Photo", 72033 upgradeModal: { 72034 title: "Upgrade to use variables", 72035 message: "Manage all company QR codes using a single template with variables. Automatically populate employee and company details across QR codes.", 72036 continue: "Continue", 72037 cancel: "Cancel" 72038 } 72039}; 72040function fS(e) { 72041 return e.startsWith("{{") && e.endsWith("}}"); 72042} 72043function Ph(e) { 72044 return e.replace(/^{{/, "").replace(/}}$/, "").trim(); 72045} 72046function Fpe(e) { 72047 return fS(e) ? e : `{{ ${e} }}`; 72048} 72049function Ope(e, t = "") { 72050 const i = De(fS(e.value || "")), s = De( 72051 i.value ? "" : Ph(e.value || "") 72052 ), n = Qe({ 72053 get() { 72054 return Ph(e.value || ""); 72055 }, 72056 set(o) { 72057 const r = i.value ? Fpe(o) : Ph(o); 72058 e.value = r, i.value || (s.value = Ph(r)); 72059 } 72060 }); 72061 return Gn(i, (o, r) => { 72062 o && !r ? (s.value = Ph(e.value || ""), e.value = t) : !o && r && (e.value = "", s.value = ""); 72063 }), Gn(e, (o) => { 72064 !i.value && !fS(o || "") && (s.value = o || ""); 72065 }), { 72066 useVariable: i, 72067 localValue: n, 72068 freeTextValue: Qe(() => s.value) 72069 }; 72070} 72071const Npe = { class: "qr-dynamic-input-select" }, _pe = { class: "qr-dynamic-input-select__header" }, Bpe = { class: "qr-dynamic-input-select__label" }, Gpe = { 72072 key: 0, 72073 class: "text-sm font-semibold" 72074}, zpe = { 72075 key: 1, 72076 class: "qr-dynamic-input-select__tooltip" 72077}, Hpe = { class: "qr-dynamic-input-select__toggle" }, Vpe = { class: "qr-dynamic-input-select__toggle-label" }, Upe = { class: "qr-dynamic-input-select__toggle-container" }, Wpe = { class: "qr-dynamic-input-select__toggle-wrapper" }, jpe = ["aria-label", "onKeydown"], $pe = { class: "qr-dynamic-input-select__content" }, Ype = { key: 0 }, Kpe = { class: "row justify-between" }, Zpe = "employee-fields", qpe = "company-fields", Qpe = /* @__PURE__ */ Mt({ 72078 __name: "qr-dynamic-input-select", 72079 props: /* @__PURE__ */ md({ 72080 aid: {}, 72081 label: { default: "" }, 72082 tooltip: { default: "" }, 72083 component: {}, 72084 componentProps: { default: () => ({}) }, 72085 defaultVariable: { default: "" } 72086 }, { 72087 modelValue: { required: !0 }, 72088 modelModifiers: {} 72089 }), 72090 emits: ["update:modelValue"], 72091 setup(e) { 72092 const t = e, i = Dv(e, "modelValue"), s = Z0.isEntitledTo(Zpe) && Z0.isEntitledTo(qpe), n = t.defaultVariable || "", { useVariable: o, localValue: r } = Ope( 72093 i, 72094 n 72095 ); 72096 s || (o.value = !1); 72097 const a = Qe(() => [ 72098 { 72099 header: eo.companyOptionsHeader, 72100 editLinkTooltip: eo.editCompanyDetails, 72101 options: [ 72102 { 72103 label: eo.companyLogo, 72104 value: "company.logo", 72105 aid: "COMPANY_LOGO" 72106 } 72107 ] 72108 } 72109 ]), l = Qe( 72110 () => a.value.reduce( 72111 (d, { options: p = [] }) => p.reduce((f, m) => (f[m.value] = m.label, f), d), 72112 { "": eo.select } 72113 ) 72114 ); 72115 function c(d) { 72116 r.value = d; 72117 } 72118 async function u() { 72119 await SS({ 72120 aid: "UPGRADE_PROMPT", 72121 header: eo.upgradeModal.title, 72122 question: eo.upgradeModal.message, 72123 primaryButtonText: eo.upgradeModal.continue, 72124 secondaryButtonText: eo.upgradeModal.cancel, 72125 width: "420px" 72126 }) === yp.Primary && (gr({ 72127 eventName: "navigated_to_pricing_page", 72128 metadata: { origin: "qr_dynamic_input_select" } 72129 }), bl(rU)); 72130 } 72131 return (d, p) => (we(), Ne("div", Npe, [ 72132 fe("div", _pe, [ 72133 fe("div", Bpe, [ 72134 e.label ? (we(), Ne("span", Gpe, ke(e.label), 1)) : di("", !0), 72135 e.tooltip ? (we(), Ne("span", zpe, ke(e.tooltip), 1)) : di("", !0) 72136 ]), 72137 fe("div", Hpe, [ 72138 fe("span", Vpe, ke(Z(eo).useVariable), 1), 72139 fe("div", Upe, [ 72140 Re(Z(ca), { 72141 aid: `${e.aid}_USE_VARIABLE_TOOLTIP`, 72142 "max-width": "190px", 72143 delay: 300 72144 }, { 72145 default: Ve(() => [ 72146 ut(ke(Z(eo).useVariableTooltip), 1) 72147 ]), 72148 _: 1 72149 }, 8, ["aid"]), 72150 fe("div", Wpe, [ 72151 Re(Z(yL), { 72152 modelValue: Z(o), 72153 "onUpdate:modelValue": p[0] || (p[0] = (f) => SL(o) ? o.value = f : null),
72154 aid: `${e.aid}_TOGGLE`, 72155 "aria-label": Z(eo).useVariable, 72156 "aria-describedby": `${e.aid}_TOGGLE`, 72157 disabled: !Z(s) 72158 }, null, 8, ["modelValue", "aid", "aria-label", "aria-describedby", "disabled"]), 72159 Z(s) ? di("", !0) : (we(), Ne("div", { 72160 key: 0, 72161 class: "qr-dynamic-input-select__toggle-overlay", 72162 role: "button", 72163 tabindex: "0", 72164 "aria-label": Z(eo).upgradeModal.title, 72165 onClick: u, 72166 onKeydown: [ 72167 BE(u, ["enter"]), 72168 BE(ML(u, ["prevent"]), ["space"]) 72169 ] 72170 }, null, 40, jpe)) 72171 ]) 72172 ]) 72173 ]) 72174 ]), 72175 fe("div", $pe, [ 72176 Z(o) ? (we(), Ne("div", Ype, [ 72177 Re(Z(fd), { 72178 "model-value": Z(r), 72179 "option-label": (f) => l.value[f?.trim() ?? ""] ?? l.value[""], 72180 "option-key": (f) => f?.trim() ?? "", 72181 aid: `${e.aid}_SELECT`, 72182 "onUpdate:modelValue": c 72183 }, { 72184 default: Ve(() => [ 72185 (we(!0), Ne(yi, null, hs(a.value, (f) => (we(), Ne(yi, { 72186 key: f.header 72187 }, [ 72188 f.options?.length ? (we(), Ne(yi, { key: 0 }, [ 72189 Re(Z(CL), null, { 72190 default: Ve(() => [ 72191 fe("div", Kpe, [ 72192 fe("span", null, ke(f.header), 1), 72193 Re(Z(MS), { 72194 type: "button", 72195 variant: "text", 72196 size: "sm", 72197 color: "gray-500", 72198 aid: `${e.aid}_EDIT_VARIABLE_BTN`, 72199 class: "edit-macro-category-btn", 72200 onClick: p[1] || (p[1] = () => Z(dU)()) 72201 }, { 72202 default: Ve(() => [ 72203 Re(Z(ca), { 72204 aid: `${e.aid}_EDIT_VARIABLE_BTN_TOOLTIP` 72205 }, { 72206 default: Ve(() => [ 72207 ut(ke(f.editLinkTooltip), 1) 72208 ]), 72209 _: 2 72210 }, 1032, ["aid"]), 72211 p[3] || (p[3] = fe("i", { class: "fa-light fa-pen fa-xs" }, null, -1)) 72212 ]), 72213 _: 2 72214 }, 1032, ["aid"]) 72215 ]) 72216 ]), 72217 _: 2 72218 }, 1024), 72219 (we(!0), Ne(yi, null, hs(f.options, (m) => (we(), Wt(Z(ll), { 72220 key: m.value, 72221 value: m.value, 72222 aid: m.aid 72223 }, { 72224 default: Ve(() => [ 72225 ut(ke(l.value[m.value]), 1) 72226 ]), 72227 _: 2 72228 }, 1032, ["value", "aid"]))), 128)) 72229 ], 64)) : di("", !0) 72230 ], 64))), 128)) 72231 ]), 72232 _: 1 72233 }, 8, ["model-value", "option-label", "option-key", "aid"]) 72234 ])) : (we(), Wt(sU(e.component), Ev({ 72235 key: 1, 72236 modelValue: i.value, 72237 "onUpdate:modelValue": p[2] || (p[2] = (f) => i.value = f) 72238 }, { ...e.componentProps, ...d.$attrs }, nU(d.$attrs)), null, 16, ["modelValue"])) 72239 ]) 72240 ])); 72241 } 72242}), Xpe = /* @__PURE__ */ ii(Qpe, [["__scopeId", "data-v-a26ace59"]]); 72243var Jpe = Object.defineProperty, ege = (e, t, i) => t in e ? Jpe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, PM = (e, t, i) => (ege(e, typeof t != "symbol" ? t + "" : t, i), i); 72244function tge(e) { 72245 let t = (i) => { 72246 var s; 72247 for (let n in i) 72248 ((s = i[n]) == null ? void 0 : s.constructor) === Object && (i[n] = t(i[n])); 72249 return { ...i }; 72250 }; 72251 return t(e); 72252} 72253var $t = class { 72254 constructor(e) { 72255 e.constructor === Object ? this.store = tge(e) : (this._storeIsProxy = !0, this.store = e), this.callbackMap = /* @__PURE__ */ Object.create(null); 72256 } 72257 static warn(e, t) { 72258 console.warn(`Symbiote Data: cannot ${e}. Prop name: ` + t); 72259 } 72260 read(e) { 72261 return !this._storeIsProxy && !this.store.hasOwnProperty(e) ? ($t.warn("read", e), null) : this.store[e]; 72262 } 72263 has(e) { 72264 return this._storeIsProxy ? this.store[e] !== void 0 : this.store.hasOwnProperty(e); 72265 } 72266 add(e, t, i = !1) { 72267 !i && Object.keys(this.store).includes(e) || (this.store[e] = t, this.notify(e)); 72268 } 72269 pub(e, t) { 72270 if (!this._storeIsProxy && !this.store.hasOwnProperty(e)) { 72271 $t.warn("publish", e); 72272 return; 72273 } 72274 this.store[e] = t, this.notify(e); 72275 } 72276 multiPub(e) { 72277 for (let t in e) 72278 this.pub(t, e[t]); 72279 } 72280 notify(e) { 72281 this.callbackMap[e] && this.callbackMap[e].forEach((t) => { 72282 t(this.store[e]); 72283 }); 72284 } 72285 sub(e, t, i = !0) { 72286 return !this._storeIsProxy && !this.store.hasOwnProperty(e) ? ($t.warn("subscribe", e), null) : (this.callbackMap[e] || (this.callbackMap[e] = /* @__PURE__ */ new Set()), this.callbackMap[e].add(t), i && t(this.store[e]), { 72287 remove: () => { 72288 this.callbackMap[e].delete(t), this.callbackMap[e].size || delete this.callbackMap[e]; 72289 }, 72290 callback: t 72291 }); 72292 } 72293 static registerCtx(e, t = /* @__PURE__ */ Symbol()) { 72294 let i = $t.globalStore.get(t); 72295 return i ? console.warn('State: context UID "' + t + '" already in use') : (i = new $t(e), $t.globalStore.set(t, i)), i; 72296 } 72297 static deleteCtx(e) { 72298 $t.globalStore.delete(e); 72299 } 72300 static getCtx(e, t = !0) { 72301 return $t.globalStore.get(e) || (t && console.warn('State: wrong context UID - "' + e + '"'), null); 72302 } 72303}; 72304$t.globalStore = /* @__PURE__ */ new Map(); 72305var mt = Object.freeze({ 72306 BIND_ATTR: "set", 72307 ATTR_BIND_PRFX: "@", 72308 EXT_DATA_CTX_PRFX: "*", 72309 NAMED_DATA_CTX_SPLTR: "/", 72310 CTX_NAME_ATTR: "ctx-name", 72311 CTX_OWNER_ATTR: "ctx-owner", 72312 CSS_CTX_PROP: "--ctx-name", 72313 EL_REF_ATTR: "ref", 72314 AUTO_TAG_PRFX: "sym", 72315 REPEAT_ATTR: "repeat", 72316 REPEAT_ITEM_TAG_ATTR: "repeat-item-tag", 72317 SET_LATER_KEY: "__toSetLater__", 72318 USE_TPL: "use-template", 72319 ROOT_STYLE_ATTR_NAME: "sym-component" 72320}), $_ = "1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm", ige = $_.length - 1, iC = class { 72321 static generate(e = "XXXXXXXXX-XXX") { 72322 let t = ""; 72323 for (let i = 0; i < e.length; i++) 72324 t += e[i] === "-" ? e[i] : $_.charAt(Math.random() * ige); 72325 return t; 72326 } 72327}; 72328function Y_(e, t, i) { 72329 let s = !0, n, o = t.split("."); 72330 return o.forEach((r, a) => { 72331 a < o.length - 1 ? e = e[r] : n = r; 72332 }), e ? e[n] = i : s = !1, s; 72333} 72334function sge(e) { 72335 return e.split("-").map((t, i) => t && i ? t[0].toUpperCase() + t.slice(1) : t).join("").split("_").map((t, i) => t && i ? t.toUpperCase() : t).join(""); 72336} 72337function nge(e, t) { 72338 [...e.querySelectorAll(`[${mt.REPEAT_ATTR}
72338]`)].forEach((i) => { 72339 let s = i.getAttribute(mt.REPEAT_ITEM_TAG_ATTR), n; 72340 if (s && (n = window.customElements.get(s)), !n) { 72341 n = class extends t.BaseComponent { 72342 constructor() { 72343 super(), s || (this.style.display = "contents"); 72344 } 72345 }; 72346 let r = i.innerHTML; 72347 n.template = r, n.reg(s); 72348 } 72349 for (; i.firstChild; ) 72350 i.firstChild.remove(); 72351 let o = i.getAttribute(mt.REPEAT_ATTR); 72352 t.sub(o, (r) => { 72353 if (!r) { 72354 for (; i.firstChild; ) 72355 i.firstChild.remove(); 72356 return; 72357 } 72358 let a = [...i.children], l, c = (u) => { 72359 u.forEach((p, f) => { 72360 if (a[f]) 72361 if (a[f].set$) 72362 setTimeout(() => { 72363 a[f].set$(p); 72364 }); 72365 else 72366 for (let m in p) 72367 a[f][m] = p[m]; 72368 else { 72369 l || (l = new DocumentFragment()); 72370 let m = new n(); 72371 Object.assign(m.init$, p), l.appendChild(m); 72372 } 72373 }), l && i.appendChild(l); 72374 let d = a.slice(u.length, a.length); 72375 for (let p of d) 72376 p.remove(); 72377 }; 72378 if (r.constructor === Array) 72379 c(r); 72380 else if (r.constructor === Object) { 72381 let u = []; 72382 for (let d in r) { 72383 let p = r[d]; 72384 Object.defineProperty(p, "_KEY_", { 72385 value: d, 72386 enumerable: !0 72387 }), u.push(p); 72388 } 72389 c(u); 72390 } else 72391 console.warn("Symbiote repeat data type error:"), console.log(r); 72392 }), i.removeAttribute(mt.REPEAT_ATTR), i.removeAttribute(mt.REPEAT_ITEM_TAG_ATTR); 72393 }); 72394} 72395var GT = "__default__"; 72396function oge(e, t) { 72397 if (t.shadowRoot) 72398 return; 72399 let i = [...e.querySelectorAll("slot")]; 72400 if (!i.length) 72401 return; 72402 let s = {}; 72403 i.forEach((n) => { 72404 let o = n.getAttribute("name") || GT; 72405 s[o] = { 72406 slot: n, 72407 fr: document.createDocumentFragment() 72408 }; 72409 }), t.initChildren.forEach((n) => { 72410 var o; 72411 let r = GT; 72412 n instanceof Element && n.hasAttribute("slot") && (r = n.getAttribute("slot"), n.removeAttribute("slot")), (o = s[r]) == null || o.fr.appendChild(n); 72413 }), Object.values(s).forEach((n) => { 72414 if (n.fr.childNodes.length) 72415 n.slot.parentNode.replaceChild(n.fr, n.slot); 72416 else if (n.slot.childNodes.length) { 72417 let o = document.createDocumentFragment(); 72418 o.append(...n.slot.childNodes), n.slot.parentNode.replaceChild(o, n.slot); 72419 } else 72420 n.slot.remove(); 72421 }); 72422} 72423function rge(e, t) { 72424 [...e.querySelectorAll(`[${mt.EL_REF_ATTR}]`)].forEach((i) => { 72425 let s = i.getAttribute(mt.EL_REF_ATTR); 72426 t.ref[s] = i, i.removeAttribute(mt.EL_REF_ATTR); 72427 }); 72428} 72429function age(e, t) { 72430 [...e.querySelectorAll(`[${mt.BIND_ATTR}]`)].forEach((i) => { 72431 let n = i.getAttribute(mt.BIND_ATTR).split(";"); 72432 [...i.attributes].forEach((o) => { 72433 if (o.name.startsWith("-") && o.value) { 72434 let r = sge(o.name.replace("-", "")); 72435 n.push(r + ":" + o.value), i.removeAttribute(o.name); 72436 } 72437 }), n.forEach((o) => { 72438 if (!o) 72439 return; 72440 let r = o.split(":").map((u) => u.trim()), a = r[0], l; 72441 a.indexOf(mt.ATTR_BIND_PRFX) === 0 && (l = !0, a = a.replace(mt.ATTR_BIND_PRFX, "")); 72442 let c = r[1].split(",").map((u) => u.trim()); 72443 for (let u of c) { 72444 let d; 72445 u.startsWith("!!") ? (d = "double", u = u.replace("!!", "")) : u.startsWith("!") && (d = "single", u = u.replace("!", "")), t.sub(u, (p) => { 72446 d === "double" ? p = !!p : d === "single" && (p = !p), l ? p?.constructor === Boolean ? p ? i.setAttribute(a, "") : i.removeAttribute(a) : i.setAttribute(a, p) : Y_(i, a, p) || (i[mt.SET_LATER_KEY] || (i[mt.SET_LATER_KEY] = /* @__PURE__ */ Object.create(null)), i[mt.SET_LATER_KEY][a] = p); 72447 }); 72448 } 72449 }), i.removeAttribute(mt.BIND_ATTR); 72450 }); 72451} 72452var Mm = "{{", $h = "}}", lge = "skip-text"; 72453function cge(e) { 72454 let t, i = [], s = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { 72455 acceptNode: (n) => { 72456 var o; 72457 return !((o = n.parentElement) != null && o.hasAttribute(lge)) && n.textContent.includes(Mm) && n.textContent.includes($h) && 1; 72458 } 72459 }); 72460 for (; t = s.nextNode(); ) 72461 i.push(t); 72462 return i; 72463} 72464var uge = function(e, t) { 72465 cge(e).forEach((s) => { 72466 let n = [], o; 72467 for (; s.textContent.includes($h); ) 72468 s.textContent.startsWith(Mm) ? (o = s.textContent.indexOf($h) + $h.length, s.splitText(o), n.push(s)) : (o = s.textContent.indexOf(Mm), s.splitText(o)), s = s.nextSibling;
vendor: 1,944 bytes, lines 72469-72515
72469 n.forEach((r) => { 72470 let a = r.textContent.replace(Mm, "").replace($h, ""); 72471 r.textContent = "", t.sub(a, (l) => { 72472 r.textContent = l; 72473 }); 72474 }); 72475 }); 72476}, dge = [nge, oge, rge, age, uge], Cv = "'", kd = '"', hge = /\\([0-9a-fA-F]{1,6} ?)/g; 72477function pge(e) { 72478 return (e[0] === kd || e[0] === Cv) && (e[e.length - 1] === kd || e[e.length - 1] === Cv); 72479} 72480function gge(e) { 72481 return (e[0] === kd || e[0] === Cv) && (e = e.slice(1)), (e[e.length - 1] === kd || e[e.length - 1] === Cv) && (e = e.slice(0, -1)), e; 72482} 72483function fge(e) { 72484 let t = "", i = ""; 72485 for (var s = 0; s < e.length; s++) { 72486 const n = e[s + 1]; 72487 e[s] === "\\" && n === '"' ? (t += '\\"', s++) : e[s] === '"' && i !== "\\" ? t += '\\"' : t += e[s], i = e[s]; 72488 } 72489 return t; 72490} 72491function mge(e) { 72492 let t = e; 72493 pge(e) && (t = gge(t), t = t.replace(hge, (i, s) => String.fromCodePoint(parseInt(s.trim(), 16))), t = t.replaceAll(`\\ 72494`, "\\n"), t = fge(t), t = kd + t + kd); 72495 try { 72496 return JSON.parse(t); 72497 } catch { 72498 throw new Error(`Failed to parse CSS property value: ${t}. Original input: ${e}`); 72499 } 72500} 72501var zT = 0, Iu = null, jr = null, Qa = class extends HTMLElement { 72502 constructor() { 72503 super(), PM(this, "updateCssData", () => { 72504 var e; 72505 this.dropCssDataCache(), (e = this.__boundCssProps) == null || e.forEach((t) => { 72506 let i = this.getCssData(this.__extractCssName(t), !0); 72507 i !== null && this.$[t] !== i && (this.$[t] = i); 72508 }); 72509 }), this.init$ = /* @__PURE__ */ Object.create(null), this.cssInit$ = /* @__PURE__ */ Object.create(null), this.tplProcessors = /* @__PURE__ */ new Set(), this.ref = /* @__PURE__ */ Object.create(null), this.allSubs = /* @__PURE__ */ new Set(), this.pauseRender = !1, this.renderShadow = !1, this.readyToDestroy = !0, this.processInnerHtml = !1, this.allowCustomTemplate = !1, this.ctxOwner = !1; 72510 } 72511 get BaseComponent() { 72512 return Qa; 72513 } 72514 initCallback() { 72515 }
72516 __initCallback() { 72517 var e; 72518 this.__initialized || (this.__initialized = !0, (e = this.initCallback) == null || e.call(this)); 72519 } 72520 render(e, t = this.renderShadow) { 72521 let i; 72522 if ((t || this.constructor.__shadowStylesUrl) && !this.shadowRoot && this.attachShadow({ 72523 mode: "open" 72524 }), this.allowCustomTemplate) { 72525 let n = this.getAttribute(mt.USE_TPL); 72526 if (n) { 72527 let o = this.getRootNode(), r = o?.querySelector(n) || document.querySelector(n); 72528 r ? e = r.content.cloneNode(!0) : console.warn(`Symbiote template "${n}" is not found...`); 72529 } 72530 } 72531 if (this.processInnerHtml) 72532 for (let n of this.tplProcessors) 72533 n(this, this); 72534 if (e || this.constructor.template) { 72535 if (this.constructor.template && !this.constructor.__tpl && (this.constructor.__tpl = document.createElement("template"), this.constructor.__tpl.innerHTML = this.constructor.template), e?.constructor === DocumentFragment) 72536 i = e; 72537 else if (e?.constructor === String) { 72538 let n = document.createElement("template"); 72539 n.innerHTML = e, i = n.content.cloneNode(!0); 72540 } else this.constructor.__tpl && (i = this.constructor.__tpl.content.cloneNode(!0)); 72541 for (let n of this.tplProcessors) 72542 n(i, this); 72543 } 72544 let s = () => { 72545 i && (t && this.shadowRoot.appendChild(i) || this.appendChild(i)), this.__initCallback(); 72546 }; 72547 if (this.constructor.__shadowStylesUrl) { 72548 t = !0; 72549 let n = document.createElement("link"); 72550 n.rel = "stylesheet", n.href = this.constructor.__shadowStylesUrl, n.onload = s, this.shadowRoot.prepe
vendor: 12,681 bytes, lines 72550-72926
72550nd(n); 72551 } else 72552 s(); 72553 } 72554 addTemplateProcessor(e) { 72555 this.tplProcessors.add(e); 72556 } 72557 get autoCtxName() { 72558 return this.__autoCtxName || (this.__autoCtxName = iC.generate(), this.style.setProperty(mt.CSS_CTX_PROP, `'${this.__autoCtxName}'`)), this.__autoCtxName; 72559 } 72560 get cssCtxName() { 72561 return this.getCssData(mt.CSS_CTX_PROP, !0); 72562 } 72563 get ctxName() { 72564 var e; 72565 let t = ((e = this.getAttribute(mt.CTX_NAME_ATTR)) == null ? void 0 : e.trim()) || this.cssCtxName || this.__cachedCtxName || this.autoCtxName; 72566 return this.__cachedCtxName = t, t; 72567 } 72568 get localCtx() { 72569 return this.__localCtx || (this.__localCtx = $t.registerCtx({}, this)), this.__localCtx; 72570 } 72571 get nodeCtx() { 72572 return $t.getCtx(this.ctxName, !1) || $t.registerCtx({}, this.ctxName); 72573 } 72574 static __parseProp(e, t) { 72575 let i, s; 72576 if (e.startsWith(mt.EXT_DATA_CTX_PRFX)) 72577 i = t.nodeCtx, s = e.replace(mt.EXT_DATA_CTX_PRFX, ""); 72578 else if (e.includes(mt.NAMED_DATA_CTX_SPLTR)) { 72579 let n = e.split(mt.NAMED_DATA_CTX_SPLTR); 72580 i = $t.getCtx(n[0]), s = n[1]; 72581 } else 72582 i = t.localCtx, s = e; 72583 return { 72584 ctx: i, 72585 name: s 72586 }; 72587 } 72588 sub(e, t, i = !0) { 72589 let s = (o) => { 72590 this.isConnected && t(o); 72591 }, n = Qa.__parseProp(e, this); 72592 n.ctx.has(n.name) ? this.allSubs.add(n.ctx.sub(n.name, s, i)) : window.setTimeout(() => { 72593 this.allSubs.add(n.ctx.sub(n.name, s, i)); 72594 }); 72595 } 72596 notify(e) { 72597 let t = Qa.__parseProp(e, this); 72598 t.ctx.notify(t.name); 72599 } 72600 has(e) { 72601 let t = Qa.__parseProp(e, this); 72602 return t.ctx.has(t.name); 72603 } 72604 add(e, t, i = !1) { 72605 let s = Qa.__parseProp(e, this); 72606 s.ctx.add(s.name, t, i); 72607 } 72608 add$(e, t = !1) { 72609 for (let i in e) 72610 this.add(i, e[i], t); 72611 } 72612 get $() { 72613 if (!this.__stateProxy) { 72614 let e = /* @__PURE__ */ Object.create(null); 72615 this.__stateProxy = new Proxy(e, { 72616 set: (t, i, s) => { 72617 let n = Qa.__parseProp(i, this); 72618 return n.ctx.pub(n.name, s), !0; 72619 }, 72620 get: (t, i) => { 72621 let s = Qa.__parseProp(i, this); 72622 return s.ctx.read(s.name); 72623 } 72624 }); 72625 } 72626 return this.__stateProxy; 72627 } 72628 set$(e, t = !1) { 72629 for (let i in e) { 72630 let s = e[i]; 72631 t || ![String, Number, Boolean].includes(s?.constructor) ? this.$[i] = s : this.$[i] !== s && (this.$[i] = s); 72632 } 72633 } 72634 get __ctxOwner() { 72635 return this.ctxOwner || this.hasAttribute(mt.CTX_OWNER_ATTR) && this.getAttribute(mt.CTX_OWNER_ATTR) !== "false"; 72636 } 72637 __initDataCtx() { 72638 let e = this.constructor.__attrDesc; 72639 if (e) 72640 for (let t of Object.values(e)) 72641 Object.keys(this.init$).includes(t) || (this.init$[t] = ""); 72642 for (let t in this.init$) 72643 if (t.startsWith(mt.EXT_DATA_CTX_PRFX)) 72644 this.nodeCtx.add(t.replace(mt.EXT_DATA_CTX_PRFX, ""), this.init$[t], this.__ctxOwner); 72645 else if (t.includes(mt.NAMED_DATA_CTX_SPLTR)) { 72646 let i = t.split(mt.NAMED_DATA_CTX_SPLTR), s = i[0].trim(), n = i[1].trim(); 72647 if (s && n) { 72648 let o = $t.getCtx(s, !1); 72649 o || (o = $t.registerCtx({}, s)), o.add(n, this.init$[t]); 72650 } 72651 } else 72652 this.localCtx.add(t, this.init$[t]); 72653 for (let t in this.cssInit$) 72654 this.bindCssData(t, this.cssInit$[t]); 72655 this.__dataCtxInitialized = !0; 72656 } 72657 connectedCallback() { 72658 var e; 72659 if (this.isConnected) { 72660 if (this.__disconnectTimeout && window.clearTimeout(this.__disconnectTimeout), !this.connectedOnce) { 72661 let t = (e = this.getAttribute(mt.CTX_NAME_ATTR)) == null ? void 0 : e.trim(); 72662 if (t && this.style.setProperty(mt.CSS_CTX_PROP, `'${t}'`), this.__initDataCtx(), this[mt.SET_LATER_KEY]) { 72663 for (let i in this[mt.SET_LATER_KEY]) 72664 Y_(this, i, this[mt.SET_LATER_KEY][i]); 72665 delete this[mt.SET_LATER_KEY]; 72666 } 72667 this.initChildren = [...this.childNodes]; 72668 for (let i of dge) 72669 this.addTemplateProcessor(i); 72670 if (this.pauseRender) 72671 this.__initCallback(); 72672 else if (this.constructor.__rootStylesLink) { 72673 let i = this.getRootNode(); 72674 if (!i) 72675 return; 72676 if (i?.querySelector(`link[${mt.ROOT_STYLE_ATTR_NAME}="${this.constructor.is}"]`)) { 72677 this.render(); 72678 return; 72679 } 72680 let n = this.constructor.__rootStylesLink.cloneNode(!0); 72681 n.setAttribute(mt.ROOT_STYLE_ATTR_NAME, this.constructor.is), n.onload = () => { 72682 this.render(); 72683 }, i.nodeType === Node.DOCUMENT_NODE ? i.head.appendChild(n) : i.prepend(n); 72684 } else 72685 this.render(); 72686 } 72687 this.connectedOnce = !0; 72688 } 72689 } 72690 destroyCallback() { 72691 } 72692 disconnectedCallback() { 72693 this.connectedOnce && (this.dropCssDataCache(), this.readyToDestroy && (this.__disconnectTimeout && window.clearTimeout(this.__disconnectTimeout), this.__disconnectTimeout = window.setTimeout(() => { 72694 this.destroyCallback(); 72695 for (let e of this.allSubs) 72696 e.remove(), this.allSubs.delete(e); 72697 for (let e of this.tplProcessors) 72698 this.tplProcessors.delete(e); 72699 jr?.delete(this.updateCssData), jr?.size || (Iu?.disconnect(), Iu = null, jr = null); 72700 }, 100))); 72701 } 72702 static reg(e, t = !1) { 72703 e || (zT++, e = `${mt.AUTO_TAG_PRFX}-${zT}`), this.__tag = e; 72704 let i = window.customElements.get(e); 72705 if (i) { 72706 !t && i !== this && console.warn([ 72707 `Element with tag name "${e}" already registered.`, 72708 `You're trying to override it with another class "${this.name}".`, 72709 "This is most likely a mistake.", 72710 "New element will not be registered." 72711 ].join(` 72712`)); 72713 return; 72714 } 72715 window.customElements.define(e, t ? class extends this { 72716 } : this); 72717 } 72718 static get is() { 72719 return this.__tag || this.reg(), this.__tag; 72720 } 72721 static bindAttributes(e) { 72722 this.observedAttributes = Object.keys(e), this.__attrDesc = e; 72723 } 72724 attributeChangedCallback(e, t, i) { 72725 var s; 72726 if (t === i) 72727 return; 72728 let n = (s = this.constructor.__attrDesc) == null ? void 0 : s[e]; 72729 n ? this.__dataCtxInitialized ? this.$[n] = i : this.init$[n] = i : this[e] = i; 72730 } 72731 getCssData(e, t = !1) { 72732 if (this.__cssDataCache || (this.__cssDataCache = /* @__PURE__ */ Object.create(null)), !Object.keys(this.__cssDataCache).includes(e)) { 72733 this.__computedStyle || (this.__computedStyle = window.getComputedStyle(this)); 72734 let i = this.__computedStyle.getPropertyValue(e).trim(); 72735 try { 72736 this.__cssDataCache[e] = mge(i); 72737 } catch { 72738 !t && console.warn(`CSS Data error: ${e}`), this.__cssDataCache[e] = null; 72739 } 72740 } 72741 return this.__cssDataCache[e]; 72742 } 72743 __extractCssName(e) { 72744 return e.split("--").map((t, i) => i === 0 ? "" : t).join("--"); 72745 } 72746 __initStyleAttrObserver() { 72747 jr || (jr = /* @__PURE__ */ new Set()), jr.add(this.updateCssData), Iu || (Iu = new MutationObserver((e) => { 72748 e[0].type === "attributes" && jr.forEach((t) => { 72749 t(); 72750 }); 72751 }), Iu.observe(document, { 72752 childList: !0, 72753 subtree: !0, 72754 attributes: !0, 72755 attributeFilter: ["style"] 72756 })); 72757 } 72758 bindCssData(e, t = "") { 72759 this.__boundCssProps || (this.__boundCssProps = /* @__PURE__ */ new Set()), this.__boundCssProps.add(e); 72760 let i = this.getCssData(this.__extractCssName(e), !0); 72761 i === null && (i = t), this.add(e, i), this.__initStyleAttrObserver(); 72762 } 72763 dropCssDataCache() { 72764 this.__cssDataCache = null, this.__computedStyle = null; 72765 } 72766 defineAccessor(e, t, i) { 72767 let s = "__" + e; 72768 this[s] = this[e], Object.defineProperty(this, e, { 72769 set: (n) => { 72770 this[s] = n, i ? window.setTimeout(() => { 72771 t?.(n); 72772 }) : t?.(n); 72773 }, 72774 get: () => this[s] 72775 }), this[e] = this[s]; 72776 } 72777 static set shadowStyles(e) { 72778 let t = new Blob([e], { 72779 type: "text/css" 72780 }); 72781 this.__shadowStylesUrl = URL.createObjectURL(t); 72782 } 72783 static set rootStyles(e) { 72784 if (!this.__rootStylesLink) { 72785 let t = new Blob([e], { 72786 type: "text/css" 72787 }), i = URL.createObjectURL(t), s = document.createElement("link"); 72788 s.href = i, s.rel = "stylesheet", this.__rootStylesLink = s; 72789 } 72790 } 72791}, Lg = Qa; 72792PM(Lg, "template"); 72793function FM(e, t) { 72794 for (let i in t) 72795 i.includes("-") ? e.style.setProperty(i, t[i]) : e.style[i] = t[i]; 72796} 72797function vge(e, t) { 72798 for (let i in t) 72799 t[i].constructor === Boolean ? t[i] ? e.setAttribute(i, "") : e.removeAttribute(i) : e.setAttribute(i, t[i]); 72800} 72801function K_(e = { tag: "div" }) { 72802 let t = document.createElement(e.tag); 72803 if (e.attributes && vge(t, e.attributes), e.styles && FM(t, e.styles), e.properties) 72804 for (let i in e.properties) 72805 t[i] = e.properties[i]; 72806 return e.processors && e.processors.forEach((i) => { 72807 i(t); 72808 }), e.children && e.children.forEach((i) => { 72809 let s = K_(i); 72810 t.appendChild(s); 72811 }), t; 72812} 72813var Z_ = "idb-store-ready", yge = "symbiote-db", Cge = "symbiote-idb-update_", bge = class { 72814 _notifyWhenReady(e = null) { 72815 window.dispatchEvent(new CustomEvent(Z_, { 72816 detail: { 72817 dbName: this.name, 72818 storeName: this.storeName, 72819 event: e 72820 } 72821 })); 72822 } 72823 get _updEventName() { 72824 return Cge + this.name; 72825 } 72826 _getUpdateEvent(e) { 72827 return new CustomEvent(this._updEventName, { 72828 detail: { 72829 key: this.name, 72830 newValue: e 72831 } 72832 }); 72833 } 72834 _notifySubscribers(e) { 72835 window.localStorage.removeItem(this.name), window.localStorage.setItem(this.name, e), window.dispatchEvent(this._getUpdateEvent(e)); 72836 } 72837 constructor(e, t) { 72838 this.name = e, this.storeName = t, this.version = 1, this.request = window.indexedDB.open(this.name, this.version), this.request.onupgradeneeded = (i) => { 72839 this.db = i.target.result, this.objStore = this.db.createObjectStore(t, { 72840 keyPath: "_key" 72841 }), this.objStore.transaction.oncomplete = (s) => { 72842 this._notifyWhenReady(s); 72843 }; 72844 }, this.request.onsuccess = (i) => { 72845 this.db = i.target.result, this._notifyWhenReady(i); 72846 }, this.request.onerror = (i) => { 72847 console.error(i); 72848 }, this._subscriptionsMap = {}, this._updateHandler = (i) => { 72849 i.key === this.name && this._subscriptionsMap[i.newValue] && this._subscriptionsMap[i.newValue].forEach(async (n) => { 72850 n(await this.read(i.newValue)); 72851 }); 72852 }, this._localUpdateHandler = (i) => { 72853 this._updateHandler(i.detail); 72854 }, window.addEventListener("storage", this._updateHandler), window.addEventListener(this._updEventName, this._localUpdateHandler); 72855 } 72856 read(e) { 72857 let i = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName).get(e); 72858 return new Promise((s, n) => { 72859 i.onsuccess = (o) => { 72860 var r; 72861 (r = o.target.result) != null && r._value ? s(o.target.result._value) : (s(null), console.warn(`IDB: cannot read "${e}"`)); 72862 }, i.onerror = (o) => { 72863 n(o); 72864 }; 72865 }); 72866 } 72867 write(e, t, i = !1) { 72868 let s = { 72869 _key: e, 72870 _value: t 72871 }, o = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName).put(s); 72872 return new Promise((r, a) => { 72873 o.onsuccess = (l) => { 72874 i || this._notifySubscribers(e), r(l.target.result); 72875 }, o.onerror = (l) => { 72876 a(l); 72877 }; 72878 }); 72879 } 72880 delete(e, t = !1) { 72881 let s = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName).delete(e); 72882 return new Promise((n, o) => { 72883 s.onsuccess = (r) => { 72884 t || this._notifySubscribers(e), n(r); 72885 }, s.onerror = (r) => { 72886 o(r); 72887 }; 72888 }); 72889 } 72890 getAll() { 72891 let t = this.db.transaction(this.storeName, "readwrite").objectStore(this.storeName).getAll(); 72892 return new Promise((i, s) => { 72893 t.onsuccess = (n) => { 72894 let o = n.target.result; 72895 i(o.map((r) => r._value)); 72896 }, t.onerror = (n) => { 72897 s(n); 72898 }; 72899 }); 72900 } 72901 subscribe(e, t) { 72902 this._subscriptionsMap[e] || (this._subscriptionsMap[e] = /* @__PURE__ */ new Set()); 72903 let i = this._subscriptionsMap[e]; 72904 return i.add(t), { 72905 remove: () => { 72906 i.delete(t), i.size || delete this._subscriptionsMap[e]; 72907 } 72908 }; 72909 } 72910 stop() { 72911 window.removeEventListener("storage", this._updateHandler), this._subscriptionsMap = null, q_.clear(this.name); 72912 } 72913}, q_ = class { 72914 static get readyEventName() { 72915 return Z_; 72916 } 72917 static open(e = yge, t = "store") { 72918 let i = e + "/" + t; 72919 return this._reg[i] || (this._reg[i] = new bge(e, t)), this._reg[i]; 72920 } 72921 static clear(e) { 72922 window.indexedDB.deleteDatabase(e); 72923 for (let t in this._reg) 72924 t.split("/")[0] === e && delete this._reg[t]; 72925 } 72926};
72927PM(q_, "_reg", /* @__PURE__ */ Object.create(null)); 72928const Q_ = (e) => { 72929 if (typeof e != "string" || !e) 72930 return ""; 72931 let t = e.trim(); 72932 return t.startsWith("-/") ? t = t.slice(2) : t.startsWith("/") && (t = t.slice(1)), t.endsWith("/") && (t = t.slice(0, t.length - 1)), t; 72933}, OM = (...e) => e.filter((t) => typeof t == "string" && t).map((t) => Q_( 72934 /** @type {String} */ 72935 t 72936)).join("/-/"), Dl = (...e) => { 72937 let t = OM(...e); 72938 return t ? `-/${t}/` : ""; 72939}; 72940function NM(e) { 72941 let t = new URL(e), i = t.pathname + t.search + t.hash, s = i.lastIndexOf("http"), n = i.lastIndexOf("/"), o = ""; 72942 return s >= 0 ? o = i.slice(s) : n >= 0 && (o = i.slice(n + 1)), o; 72943} 72944function X_(e) { 72945 let t = new URL(e), { pathname: i } = t; 72946 const s = i.indexOf("/"), n = i.indexOf("/", s + 1); 72947 return i.substring(s + 1, n); 72948} 72949function J_(e) { 72950 let t = e3(e), i = new URL(t), s = i.pathname.indexOf("/-/"); 72951 return s === -1 ? "" : i.pathname.substring(s).slice(1); 72952} 72953function wge(e) { 72954 return J_(e).split("/-/").filter(Boolean).map((i) => Q_(i)); 72955} 72956function e3(e) { 72957 let t = new URL(e), i = NM(e), s = t3(i) ? i3(i).pathname : i; 72958 return t.pathname = t.pathname.replace(s, ""), t.search = "", t.hash = "", t.toString(); 72959} 72960function t3(e) { 72961 return e.startsWith("http"); 72962} 72963function i3(e) { 72964 let t = new URL(e); 72965 return { 72966 pathname: t.origin + t.pathname || "", 72967 search: t.search || "", 72968 hash: t.hash || "" 72969 }; 72970} 72971const co = (e, t, i) => { 72972 let s = new URL(e3(e)); 72973 if (i = i || NM(e), s.pathname.startsWith("//") && (s.pathname = s.pathname.replace("//", "/")), t3(i)) { 72974 let n = i3(i); 72975 s.pathname = s.pathname + (t || "") + (n.pathname || ""), s.search = n.search, s.hash = n.hash; 72976 } else 72977 s.pathname = s.pathname + (t || "") + (i || ""); 72978 return s.toString(); 72979}, ig = (e, t) => { 72980 let i = new URL(e); 72981 return i.pathname = t + "/", i.toString(); 72982}, El = (e, t = ",") => e.trim().split(t).map((i) => i.trim()).filter((i) => i.length > 0), oo = Object.freeze({ 72983 brightness: 0, 72984 exposure: 0, 72985 gamma: 100, 72986 contrast: 0, 72987 saturation: 0, 72988 vibrance: 0, 72989 warmth: 0, 72990 enhance: 0, 72991 filter: 0, 72992 rotate: 0, 72993 mirror: !1, 72994 flip: !1, 72995 crop: void 0 72996}), s3 = ( 72997 /** @type {const} */ 72998 [ 72999 "enhance", 73000 "brightness", 73001 "exposure", 73002 "gamma", 73003 "contrast", 73004 "saturation", 73005 "vibrance", 73006 "warmth", 73007 "filter", 73008 "mirror", 73009 "flip", 73010 "rotate", 73011 "crop" 73012 ] 73013); 73014function Sge(e, t) { 73015 if (typeof t == "number") { 73016 const i = t; 73017 return oo[e] !== i ? `${e}/${i}` : ""; 73018 } 73019 if (typeof t == "boolean") { 73020 const i = t; 73021 return oo[e] !== i ? `${e}` : ""; 73022 } 73023 if (e === "filter" && t) { 73024 const { name: i, amount: s } = ( 73025 /** @type {NonNullable<import('../types').Transformations['filter']>} */ 73026 t 73027 ); 73028 return oo.filter === s ? "" : `${e}/${i}/${s}`; 73029 } 73030 if (e === "crop" && t) { 73031 let { dimensions: i, coords: s } = ( 73032 /** @type {NonNullable<import('../types').Transformations['crop']>} */ 73033 t 73034 ); 73035 return `${e}/${i.join("x")}/${s.join(",")}`; 73036 } 73037 return ""; 73038} 73039function sC(e) { 73040 return OM( 73041 ...s3.filter( 73042 (t) => typeof e[t] < "u" && e[t] !== null 73043 ).map((t) => { 73044 let i = e[t]; 73045 return Sge(t, i); 73046 }).filter((t) => !!t) 73047 ); 73048} 73049const n3 = OM("format/auto", "progressive/yes"), $r = ([e]) => typeof e < "u" ? Number(e) : void 0, HT = () => !0, xge = ([e, t]) => ({ 73050 name: e, 73051 amount: typeof t < "u" ? Number(t) : 100 73052}), Mge = ([e, t]) => { 73053 if (!/\d+x\d+/.test(e) || !/\d+,\d+/.test(t)) 73054 throw new Error("Crop by aspect ratio, percentage or alignment shortcuts is not supported."); 73055 return ( 73056 /** @type {{ dimensions: [number, number]; coords: [number, number] }} */ 73057 { 73058 dimensions: El(e, "x").map(Number), 73059 coords: El(t).map(Number) 73060 } 73061 ); 73062}, Age = Object.freeze({ 73063 enhance: $r, 73064 brightness: $r, 73065 exposure: $r, 73066 gamma: $r, 73067 contrast: $r, 73068 saturation: $r, 73069 vibrance: $r, 73070 warmth: $r, 73071 filter: xge, 73072 mirror: HT, 73073 flip: HT, 73074 rotate: $r, 73075 crop: Mge 73076}); 73077function Dge(e) { 73078 const t = {}; 73079 for (const i of e) { 73080 const [s, ...n] = i.split("/"); 73081 if (!s3.includes(s)) 73082 continue; 73083 const o = ( 73084 /** @type {(typeof SUPPORTED_OPERATIONS_ORDERED)[number]} */ 73085 s 73086 ), r = Age[o]; 73087 try { 73088 const a = r(n); 73089 t[o] = a; 73090 } catch (a) { 73091 console.warn( 73092 [ 73093 `Failed to parse URL operation "${i}". It will be ignored.`, 73094 a instanceof Error ? `Error message: "${a.message}"` : a, 73095 "If you need this functionality, please feel free to open an issue at https://github.com/uploadcare/blocks/issues/new" 73096 ].join(` 73097`) 73098 ); 73099 } 73100 } 73101 return ( 73102 /** @type {import('../types.js').Transformations} */ 73103 t 73104 ); 73105} 73106const Oi = Object.freeze({ 73107 CROP: "crop", 73108 TUNING: "tuning", 73109 FILTERS: "filters" 73110}), Cr = [Oi.CROP, Oi.TUNING, Oi.FILTERS], Ege = [ 73111 "brightness", 73112 "exposure", 73113 "gamma", 73114 "contrast", 73115 "saturation", 73116 "vibrance", 73117 "warmth", 73118 "enhance" 73119], Ige = [ 73120 "adaris", 73121 "briaril", 73122 "calarel", 73123 "carris", 73124 "cynarel", 73125 "cyren", 73126 "elmet", 73127 "elonni", 73128 "enzana", 73129 "erydark", 73130 "fenralan", 73131 "ferand", 73132 "galen", 73133 "gavin", 73134 "gethriel", 73135 "iorill", 73136 "iothari", 73137 "iselva", 73138 "jadis", 73139 "lavra", 73140 "misiara", 73141 "namala", 73142 "nerion", 73143 "nethari", 73144 "pamaya", 73145 "sarnar", 73146 "sedis", 73147 "sewen", 73148 "sorahel", 73149 "sorlen", 73150 "tarian", 73151 "thellassan", 73152 "varriel", 73153 "varven", 73154 "vevera", 73155 "virkas", 73156 "yedis", 73157 "yllara", 73158 "zatvel", 73159 "zevcen" 73160], Rge = ["rotate", "mirror", "flip"], Pd = Object.freeze({ 73161 brightness: { 73162 zero: oo.brightness, 73163 range: [-100, 100], 73164 keypointsNumber: 2 73165 }, 73166 exposure: { 73167 zero: oo.exposure, 73168 range: [-500, 500], 73169 keypointsNumber: 2 73170 }, 73171 gamma: { 73172 zero: oo.gamma, 73173 range: [0, 1e3], 73174 keypointsNumber: 2 73175 }, 73176 contrast: { 73177 zero: oo.contrast, 73178 range: [-100, 500], 73179 keypointsNumber: 2 73180 }, 73181 saturation: { 73182 zero: oo.saturation, 73183 range: [-100, 500], 73184 keypointsNumber: 1 73185 }, 73186 vibrance: { 73187 zero: oo.vibrance, 73188 range: [-100, 500], 73189 keypointsNumber: 1 73190 }, 73191 warmth: { 73192 zero: oo.warmth, 73193 range: [-100, 100], 73194 keypointsNumber: 1 73195 }, 73196 enhance: { 73197 zero: oo.enhance, 73198 range: [0, 100], 73199 keypointsNumber: 1 73200 }, 73201 filter: { 73202 zero: oo.filter, 73203 range: [0, 100], 73204 keypointsNumber: 1 73205 } 73206}), Tge = (e) => e ? e.split(",").map((t) => t.trim()) : [], _M = (e) => e ? e.join(",") : "", Lge = "https://ucarecdn.com", kge = "https://upload.uploadcare.com", Pge = "https://social.uploadcare.com", yl = { 73207 pubkey: "", 73208 multiple: !0, 73209 multipleMin: 0, 73210 multipleMax: Number.MAX_SAFE_INTEGER, 73211 confirmUpload: !1, 73212 imgOnly: !1, 73213 accept: "", 73214 externalSourcesPreferredTypes: "", 73215 externalSourcesEmbedCss: "", 73216 store: "auto", 73217 cameraMirror: !1, 73218 cameraCapture: "", 73219 sourceList: "local, url, camera, dropbox, gdrive", 73220 cloudImageEditorTabs: _M(Cr), 73221 maxLocalFileSizeBytes: 0, 73222 thumbSize: 76, 73223 showEmptyList: !1, 73224 useLocalImageEditor: !1, 73225 useCloudImageEditor: !0, 73226 removeCopyright: !1, 73227 cropPreset: "", 73228 imageShrink: "", 73229 modalScrollLock: !0, 73230 modalBackdropStrokes: !1, 73231 sourceListWrap: !0, 73232 remoteTabSessionKey: "", 73233 cdnCname: Lge, 73234 baseUrl: kge, 73235 socialBaseUrl: Pge, 73236 secureSignature: "", 73237 secureExpire: "", 73238 secureDeliveryProxy: "", 73239 retryThrottledRequestMaxTimes: 1, 73240 multipartMinFileSize: 26214400, 73241 multipartChunkSize: 5242880, 73242 maxConcurrentRequests: 10, 73243 multipartMaxConcurrentRequests: 4, 73244 multipartMaxAttempts: 3, 73245 checkForUrlDuplicates: !1, 73246 saveUrlForRecurrentUploads: !1, 73247 groupOutput: !1, 73248 userAgentIntegration: "", 73249 debug: !1, 73250 metadata: null, 73251 localeName: "en", 73252 localeDefinitionOverride: null, 73253 secureUploadsExpireThreshold: 600 * 1e3, 73254 secureUploadsSignatureResolver: null, 73255 secureDeliveryProxyUrlResolver: null, 73256 iconHrefResolver: null, 73257 fileValidators: [], 73258 collectionValidators: [], 73259 defaultCameraMode: "photo", 73260 enableAudioRecording: !0, 73261 enableVideoRecording: !0, 73262 maxVideoRecordingDuration: null, 73263 mediaRecorerOptions: null 73264}, Fge = 20, Ni = Object.freeze({ 73265 FILE_ADDED: "file-added", 73266 FILE_REMOVED: "file-removed", 73267 FILE_UPLOAD_START: "file-upload-start", 73268 FILE_UPLOAD_PROGRESS: "file-upload-progress", 73269 FILE_UPLOAD_SUCCESS: "file-upload-success", 73270 FILE_UPLOAD_FAILED: "file-upload-failed", 73271 FILE_URL_CHANGED: "file-url-changed", 73272 MODAL_OPEN: "modal-open", 73273 MODAL_CLOSE: "modal-close", 73274 DONE_CLICK: "done-click", 73275 UPLOAD_CLICK: "upload-click", 73276 ACTIVITY_CHANGE: "activity-change", 73277 COMMON_UPLOAD_START: "common-upload-start", 73278 COMMON_UPLOAD_PROGRESS: "common-upload-progress", 73279 COMMON_UPLOAD_SUCCESS: "common-upload-success", 73280 COMMON_UPLOAD_FAILED: "common-upload-failed", 73281 CHANGE: "change", 73282 GROUP_CREATED: "group-created" 73283}); 73284class Oge { 73285 /** 73286 * @private 73287 * @type {Map<string, number>} 73288 */ 73289 _timeoutStore = /* @__PURE__ */ new Map(); 73290 /** 73291 * @private 73292 * @type {Set<import('../../abstract/Block.js').Block>} 73293 */ 73294 _targets = /* @__PURE__ */ new Set(); 73295 /** 73296 * @private 73297 * @type {((...args: unknown[]) => void) | null} 73298 */ 73299 _debugPrint = null; 73300 /** @param {(...args: unknown[]) => void} debugPrint */ 73301 constructor(t) { 73302 this._debugPrint = t; 73303 } 73304 /** @param {import('../../abstract/Block.js').Block} target */ 73305 bindTarget(t) { 73306 this._targets.add(t); 73307 } 73308 /** @param {import('../../abstract/Block.js').Block} target */ 73309 unbindTarget(t) { 73310 this._targets.delete(t); 73311 } 73312 /** 73313 * @private 73314 * @template {(typeof EventType)[keyof typeof EventType]} T 73315 * @param {T} type 73316 * @param {unknown} [payload] 73317 */ 73318 _dispatch(t, i) { 73319 for (const s of this._targets) 73320 s.dispatchEvent( 73321 new CustomEvent(t, { 73322 detail: i 73323 }) 73324 ); 73325 this._debugPrint?.(() => { 73326 const s = i && typeof i == "object" ? { ...i } : i; 73327 return [`event "${t}"`, s]; 73328 }); 73329 } 73330 /** 73331 * @template {(typeof EventType)[keyof typeof EventType]} T 73332 * @template {boolean | number | undefined} TDebounce 73333 * @param {T} type 73334 * @param {TDebounce extends false | undefined ? unknown : () => unknown} [payload] 73335 * @param {{ debounce?: TDebounce }} [options] 73336 */ 73337 emit(t, i, { debounce: s } = {}) { 73338 if (typeof s != "number" && !s) { 73339 this._dispatch(t, typeof i == "function" ? i() : i); 73340 return; 73341 } 73342 this._timeoutStore.has(t) && window.clearTimeout(this._timeoutStore.get(t)); 73343 const n = typeof s == "number" ? s : Fge, o = window.setTimeout(() => { 73344 this._dispatch(t, typeof i == "function" ? i() : i), this._timeoutStore.delete(t); 73345 }, n); 73346 this._timeoutStore.set(t, o); 73347 } 73348} 73349function wo(e, t) { 73350 let i; 73351 const s = ( 73352 /** @param {...any} args */ 73353 (...n) => { 73354 clearTimeout(i), i = setTimeout(() => e(...n), t); 73355 } 73356 ); 73357 return s.cancel = () => { 73358 clearTimeout(i); 73359 }, /** @type {T & { cancel: () => void }} } */ 73360 s; 73361} 73362const VT = "--uploadcare-blocks-window-height"; 73363class UT { 73364 /** 73365 * @private 73366 * @type {Set<unknown>} 73367 */ 73368 static clientsRegistry = /* @__PURE__ */ new Set(); 73369 /** @private */ 73370 static flush = wo(() => { 73371 document.documentElement.style.setProperty(VT, `${window.innerHeight}px`); 73372 }, 100); 73373 /** 73374 * @param {unknown} client 73375 * @public 73376 */ 73377 static registerClient(t) { 73378 this.clientsRegistry.size === 0 && this.attachTracker(), this.clientsRegistry.add(t); 73379 } 73380 /** 73381 * @param {unknown} client 73382 * @public 73383 */ 73384 static unregisterClient(t) { 73385 this.clientsRegistry.delete(t), this.clientsRegistry.size === 0 && this.detachTracker(); 73386 } 73387 /** @private */ 73388 static attachTracker() { 73389 window.addEventListener("resize", this.flush, { passive: !0, capture: !0 }), this.flush(); 73390 } 73391 /** @private */ 73392 static detachTracker() { 73393 window.removeEventListener("resize", this.flush, { capture: !0 }), document.documentElement.style.removeProperty(VT); 73394 } 73395} 73396const Nge = (e) => { 73397 const t = ( 73398 /** @type {any} */ 73399 new Intl.Locale(e) 73400 ); 73401 let i = "ltr"; 73402 return typeof t.getTextInfo == "function" && t.getTextInfo().direction ? i = t.getTextInfo().direction : "textInfo" in t && t.textInfo?.direction && (i = t.textInfo.direction), i; 73403}, o3 = (e, t) => new Intl.PluralRules(e).select(t), _ge = (e) => e, mS = "{{", r3 = "}}", WT = "plural:"; 73404function vS(e, t, i = {}) { 73405 let { openToken: s = mS, closeToken: n = r3, transform: o = _ge } = i; 73406 for (let r in t) { 73407 let a = t[r]?.toString(); 73408 e = e.replaceAll(s + r + n, typeof a == "string" ? o(a) : a); 73409 } 73410 return e; 73411} 73412function Bge(e) { 73413 const t = []; 73414 let i = e.indexOf(mS); 73415 for (; i !== -1; ) { 73416 const s = e.indexOf(r3, i), n = e.substring(i + 2, s); 73417 if (n.startsWith(WT)) { 73418 const o = e.substring(i + 2, s).replace(WT, ""), r = o.substring(0, o.indexOf("(")), a = o.substring(o.indexOf("(") + 1, o.indexOf(")")); 73419 t.push({ variable: n, pluralKey: r, countVariable: a }); 73420 } 73421 i = e.indexOf(mS, s); 73422 } 73423 return t; 73424} 73425const Gge = ({ element: e, attribute: t, onSuccess: i, onTimeout: s, timeout: n = 300 }) => { 73426 const o = e.getAttribute(t); 73427 if (o !== null) { 73428 i(o); 73429 return; 73430 } 73431 const r = new MutationObserver((c) => { 73432 const u = c[c.length - 1]; 73433 l(u); 73434 }); 73435 r.observe(e, { 73436 attributes: !0, 73437 attributeFilter: [t] 73438 }); 73439 const a = setTimeout(() => { 73440 r.disconnect(), s(); 73441 }, n), l = (c) => { 73442 const u = e.getAttribute(t); 73443 c.type === "attributes" && c.attributeName === t && u !== null && (clearTimeout(a), r.disconnect(), i(u)); 73444 }; 73445}; 73446function jT(e) { 73447 return Object.prototype.toString.call(e) === "[object Object]"; 73448} 73449const zge = /\W|_/g; 73450function Hge(e) { 73451 return e.split(zge).map((t, i) => t.charAt(0)[i > 0 ? "toUpperCase" : "toLowerCase"]() + t.slice(1)).join(""); 73452} 73453function $T(e, { ignoreKeys: t } = { ignoreKeys: [] }) { 73454 return Array.isArray(e) ? e.map((i) => ka(i, { ignoreKeys: t })) : e; 73455} 73456function ka(e, { ignoreKeys: t } = { ignoreKeys: [] }) { 73457 if (Array.isArray(e)) 73458 return $T(e, { ignoreKeys: t }); 73459 if (!jT(e)) 73460 return e; 73461 const i = {}; 73462 for (const s of Object.keys(e)) { 73463 let n = e[s]; 73464 if (t.includes(s)) { 73465 i[s] = n; 73466 continue; 73467 } 73468 jT(n) ? n = ka(n, { ignoreKeys: t }) : Array.isArray(n) && (n = $T(n, { ignoreKeys: t })), i[Hge(s)] = n; 73469 } 73470 return i; 73471} 73472const a3 = (e, t) => new Promise((i) => { 73473 if (t?.aborted) { 73474 i(); 73475 return; 73476 } 73477 const s = () => { 73478 clearTimeout(n), t?.removeEventListener("abort", s), i(); 73479 }, n = setTimeout(s, e); 73480 t?.addEventListener("abort", s, { once: !0 }); 73481}); 73482function l3({ libraryName: e, libraryVersion: t, userAgent: i, publicKey: s = "", integration: n = "" }) { 73483 const o = "JavaScript"; 73484 if (typeof i == "string") 73485 return i; 73486 if (typeof i == "function") 73487 return i({ 73488 publicKey: s, 73489 libraryName: e, 73490 libraryVersion: t, 73491 languageName: o, 73492 integration: n 73493 });
73494 const r = [e, t, s].filter(Boolean).join("/"), a = [o, n].filter(Boolean).join("; "); 73495 return `${r} (${a})`; 73496} 73497const Vge = { 73498 factor: 2, 73499 time: 100 73500}; 73501function Uge(e, t = Vge) { 73502 let i = 0; 73503 function s(n) { 73504 const o = Math.round(t.time * t.factor ** i); 73505 return n({ 73506 attempt: i, 73507 retry: (a) => a3(a ?? o).then(() => (i += 1, s(n))) 73508 }); 73509 } 73510 return s(e); 73511} 73512class BM extends Error { 73513} 73514class kg extends BM { 73515 originalProgressEvent; 73516 constructor(t) { 73517 super(), this.name = "NetworkError", this.message = "Network error", Object.setPrototypeOf(this, kg.prototype), this.originalProgressEvent = t; 73518 } 73519} 73520const GM = (e, t) => { 73521 e && (e.aborted ? Promise.resolve().then(t) : e.addEventListener("abort", () => t(), { once: !0 })); 73522}; 73523class ea extends BM { 73524 isCancel = !0; 73525 constructor(t = "Request canceled") { 73526 super(t), this.name = "CancelError", Object.setPrototypeOf(this, ea.prototype); 73527 } 73528} 73529const Wge = 500, c3 = async ({ check: e, interval: t = Wge, timeout: i, signal: s }) => { 73530 const n = Date.now(), o = () => i === void 0 ? 1 / 0 : i - (Date.now() - n); 73531 for (; ; ) { 73532 if (s?.aborted) 73533 throw new ea("Poll cancelled"); 73534 if (o() <= 0) 73535 throw new ea("Timed out"); 73536 let r; 73537 try { 73538 r = await e(s); 73539 } catch (a) { 73540 throw s?.aborted ? new ea("Poll cancelled") : a; 73541 } 73542 if (s?.aborted) 73543 throw new ea("Poll cancelled"); 73544 if (r) 73545 return r; 73546 await a3(Math.min(t, o()), s); 73547 } 73548}, St = { 73549 baseCDN: "https://ucarecdn.com", 73550 prefixedBaseCDN: "https://ucarecd.net", 73551 baseURL: "https://upload.uploadcare.com", 73552 retryThrottledRequestMaxTimes: 1, 73553 retryNetworkErrorMaxTimes: 3, 73554 multipartMinFileSize: 25 * 1024 * 1024, 73555 // 25 MB 73556 multipartChunkSize: 5 * 1024 * 1024, 73557 // 5 MB 73558 maxConcurrentRequests: 4, 73559 pusherKey: "79ae88bd931ea68464d9" 73560}, nC = "application/octet-stream", u3 = "original", Ul = ({ method: e, url: t, data: i, headers: s = {}, signal: n, onProgress: o }) => new Promise((r, a) => { 73561 const l = new XMLHttpRequest(), c = e?.toUpperCase() || "GET"; 73562 let u = !1; 73563 l.open(c, t, !0), s && Object.entries(s).forEach((d) => { 73564 const [p, f] = d; 73565 typeof f < "u" && !Array.isArray(f) && l.setRequestHeader(p, f); 73566 }), l.responseType = "text", GM(n, () => { 73567 u = !0, l.abort(), a(new ea()); 73568 }), l.onload = () => { 73569 if (l.status != 200) 73570 a(new Error(`Error ${l.status}: ${l.statusText}`)); 73571 else { 73572 const d = { 73573 method: c, 73574 url: t, 73575 data: i, 73576 headers: s || void 0, 73577 signal: n, 73578 onProgress: o 73579 }, p = l.getAllResponseHeaders().trim().split(/[\r\n]+/), f = {}; 73580 p.forEach(function(b) { 73581 const C = b.split(": "), w = C.shift(), M = C.join(": "); 73582 w && typeof w < "u" && (f[w] = M); 73583 }); 73584 const m = l.response, y = l.status; 73585 r({ 73586 request: d, 73587 data: m, 73588 headers: f, 73589 status: y 73590 }); 73591 } 73592 }, l.onerror = (d) => { 73593 u || a(new kg(d)); 73594 }, o && typeof o == "function" && (l.upload.onprogress = (d) => { 73595 d.lengthComputable ? o({ 73596 isComputable: !0, 73597 value: d.loaded / d.total 73598 }) : o({ isComputable: !1 }); 73599 }), i ? l.send(i) : l.send(); 73600}); 73601function jge(e, ...t) { 73602 return e; 73603} 73604const $ge = ({ name: e }) => e ? [e] : [], Yge = jge; 73605var Kge = () => new FormData(); 73606const d3 = (e) => !1, oC = (e) => typeof Blob < "u" && e instanceof Blob, rC = (e) => typeof File < "u" && e instanceof File, aC = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "uri" in e && typeof e.uri == "string", oh = (e) => oC(e) || rC(e) || d3() || aC(e), Zge = (e) => typeof e == "string" || typeof e == "number" || typeof e > "u", qge = (e) => !!e && typeof e == "object" && !Array.isArray(e), Qge = (e) => !!e && typeof e == "object" && "data" in e && oh(e.data); 73607function h3(e, t, i) { 73608 if (Array.isArray(i)) 73609 for (const s of i) 73610 h3(e, `${t}[]`, s); 73611 else if (Qge(i)) { 73612 const { name: s, contentType: n } = i, o = Yge(i.data, s, n ?? nC), r = $ge({ name: s }); 73613 e.push([t, o, ...r]); 73614 } else if (qge(i)) 73615 for (const [s, n] of Object.entries(i)) 73616 typeof n < "u" && e.push([`${t}[${s}
73616]`, String(n)]); 73617 else Zge(i) && i && e.push([t, i.toString()]); 73618} 73619function Xge(e) { 73620 const t = []; 73621 for (const [i, s] of Object.entries(e)) 73622 h3(t, i, s); 73623 return t; 73624} 73625function lC(e) { 73626 const t = Kge(), i = Xge(e); 73627 for (const s of i) { 73628 const [n, o, ...r] = s; 73629 t.append(n, o, ...r); 73630 } 73631 return t; 73632} 73633class yn extends BM { 73634 code; 73635 request; 73636 response; 73637 headers; 73638 constructor(t, i, s, n, o) { 73639 super(), this.name = "UploadError", this.message = t, this.code = i, this.request = s, this.response = n, this.headers = o, Object.setPrototypeOf(this, yn.prototype); 73640 } 73641} 73642const Jge = (e) => { 73643 const t = new URLSearchParams(); 73644 for (const [i, s] of Object.entries(e)) 73645 s && typeof s == "object" && !Array.isArray(s) ? Object.entries(s).filter((n) => n[1] ?? !1).forEach((n) => t.set(`${i}[${n[0]}]`, String(n[1]))) : Array.isArray(s) ? s.forEach((n) => { 73646 t.append(`${i}[]`, n); 73647 }) : typeof s == "string" && s ? t.set(i, s) : typeof s == "number" && t.set(i, s.toString()); 73648 return t.toString(); 73649}, fa = (e, t, i) => { 73650 const s = new URL(e); 73651 return s.pathname = (s.pathname + t).replace("//", "/"), i && (s.search = Jge(i)), s.toString(); 73652}; 73653var efe = "6.21.0"; 73654const tfe = "UploadcareUploadClient", ife = efe; 73655function nu(e) { 73656 return l3({ 73657 libraryName: tfe, 73658 libraryVersion: ife, 73659 ...e 73660 }); 73661} 73662const sfe = "RequestThrottledError", YT = 15e3, nfe = 1e3; 73663function ofe(e) { 73664 const { headers: t } = e || {}; 73665 if (!t || typeof t["retry-after"] != "string") 73666 return YT; 73667 const i = parseInt(t["retry-after"], 10); 73668 return Number.isFinite(i) ? i * 1e3 : YT; 73669} 73670function Wl(e, t) { 73671 const { retryThrottledRequestMaxTimes: i, retryNetworkErrorMaxTimes: s } = t; 73672 return Uge(({ attempt: n, retry: o }) => e().catch((r) => { 73673 if ("response" in r && r?.code === sfe && n < i) 73674 return o(ofe(r)); 73675 if (r instanceof kg && n < s) 73676 return o((n + 1) * nfe); 73677 throw r; 73678 })); 73679} 73680const p3 = (e) => { 73681 let t = ""; 73682 return (oC(e) || rC(e) || aC(e)) && (t = e.type), t || nC; 73683}, g3 = (e) => { 73684 let t = ""; 73685 return rC(e) && e.name ? t = e.name : oC(e) || d3() ? t = "" : aC(e) && e.name && (t = e.name), t || u3; 73686}; 73687function zM(e) { 73688 return typeof e > "u" || e === "auto" ? "auto" : e ? "1" : "0"; 73689} 73690function HM(e) { 73691 return Array.isArray(e) ? e.join(",") : typeof e == "string" ? e : void 0; 73692} 73693function rfe(e, { publicKey: t, fileName: i, contentType: s, baseURL: n = St.baseURL, secureSignature: o, secureExpire: r, store: a, signal: l, onProgress: c, source: u = "local", integration: d, userAgent: p, retryThrottledRequestMaxTimes: f = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: m = St.retryNetworkErrorMaxTimes, metadata: y, tags: b }) { 73694 return Wl(() => Ul({ 73695 method: "POST", 73696 url: fa(n, "/base/", { 73697 jsonerrors: 1 73698 }), 73699 headers: { 73700 "X-UC-User-Agent": nu({ publicKey: t, integration: d, userAgent: p }) 73701 }, 73702 data: lC({ 73703 file: { 73704 data: e, 73705 name: i || g3(e), 73706 contentType: s || p3(e) 73707 }, 73708 UPLOADCARE_PUB_KEY: t, 73709 UPLOADCARE_STORE: zM(a), 73710 signature: o, 73711 expire: r, 73712 source: u, 73713 metadata: y, 73714 tags: HM(b) 73715 }), 73716 signal: l, 73717 onProgress: c 73718 }).then(({ data: C, headers: w, request: M }) => { 73719 const A = ka(JSON.parse(C)); 73720 if ("error" in A) 73721 throw new yn(A.error.content, A.error.errorCode, M, A, w); 73722 return A; 73723 }), { retryNetworkErrorMaxTimes: m, retryThrottledRequestMaxTimes: f }); 73724} 73725var yS; 73726(function(e) { 73727 e.Token = "token", e.FileInfo = "file_info"; 73728})(yS || (yS = {})); 73729function afe(e, { publicKey: t, baseURL: i = St.baseURL, store: s, fileName: n, checkForUrlDuplicates: o, saveUrlForRecurrentUploads: r, secureSignature: a, secureExpire: l, source: c = "url", signal: u, integration: d, userAgent: p, retryThrottledRequestMaxTimes: f = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: m = St.retryNetworkErrorMaxTimes, metadata: y, tags: b }) { 73730 return Wl(() => Ul({ 73731 method: "POST", 73732 headers: { 73733 "X-UC-User-Agent": nu({ publicKey: t, integration: d, userAgent: p }) 73734 }, 73735 url: fa(i, "/from_url/", { 73736 jsonerrors: 1, 73737 pub_key: t, 73738 source_url: e, 73739 store: zM(s), 73740 filename: n, 73741 check_URL_duplicates: o ? 1 : void 0, 73742 save_URL_duplicates: r ? 1 : void 0, 73743 signature: a, 73744 expire: l, 73745 source: c, 73746 metadata: y, 73747 tags: HM(b) 73748 }), 73749 signal: u 73750 }).then(({ data: C, headers: w, request: M }) => { 73751 const A = ka(JSON.parse(C)); 73752 if ("error" in A) 73753 throw new yn(A.error.content, A.error.errorCode, M, A, w); 73754 return A; 73755 }), { retryNetworkErrorMaxTimes: m, retryThrottledRequestMaxTimes: f }); 73756} 73757var pn; 73758(function(e) { 73759 e.Unknown = "unknown", e.Waiting = "waiting", e.Progress = "progress", e.Error = "error", e.Success = "success"; 73760})(pn || (pn = {})); 73761const lfe = (e) => "status" in e && e.status === pn.Error; 73762function cfe(e, { publicKey: t, baseURL: i = St.baseURL, signal: s, integration: n, userAgent: o, retryThrottledRequestMaxTimes: r = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: a = St.retryNetworkErrorMaxTimes } = {}) { 73763 return Wl(() => Ul({ 73764 method: "GET", 73765 headers: t ? { 73766 "X-UC-User-Agent": nu({ 73767 publicKey: t, 73768 integration: n, 73769 userAgent: o 73770 }) 73771 } : void 0, 73772 url: fa(i, "/from_url/status/", { 73773 jsonerrors: 1, 73774 token: e 73775 }), 73776 signal: s 73777 }).then(({ data: l, headers: c, request: u }) => { 73778 const d = ka(JSON.parse(l)); 73779 if ("error" in d && !lfe(d)) 73780 throw new yn(d.error.content, d.error.errorCode, u, d, c); 73781 return d; 73782 }), { retryNetworkErrorMaxTimes: a, retryThrottledRequestMaxTimes: r }); 73783} 73784function ufe(e, { publicKey: t, baseURL: i = St.baseURL, jsonpCallback: s, secureSignature: n, secureExpire: o, signal: r, source: a, integration: l, userAgent: c, retryThrottledRequestMaxTimes: u = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: d = St.retryNetworkErrorMaxTimes }) { 73785 return Wl(() => Ul({ 73786 method: "POST", 73787 headers: { 73788 "X-UC-User-Agent": nu({ publicKey: t, integration: l, userAgent: c }) 73789 }, 73790 url: fa(i, "/group/", { 73791 jsonerrors: 1 73792 }), 73793 data: lC({ 73794 files: e, 73795 callback: s, 73796 pub_key: t, 73797 signature: n, 73798 expire: o, 73799 source: a 73800 }), 73801 signal: r 73802 }).then(({ data: p, headers: f, request: m }) => { 73803 const y = ka(JSON.parse(p)); 73804 if ("error" in y) 73805 throw new yn(y.error.content, y.error.errorCode, m, y, f); 73806 return y; 73807 }), { retryNetworkErrorMaxTimes: d, retryThrottledRequestMaxTimes: u }); 73808} 73809function dfe(e, { publicKey: t, baseURL: i = St.baseURL, signal: s, source: n, integration: o, userAgent: r, retryThrottledRequestMaxTimes: a = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: l = St.retryNetworkErrorMaxTimes }) { 73810 return Wl(() => Ul({ 73811 method: "GET", 73812 headers: { 73813 "X-UC-User-Agent": nu({ publicKey: t, integration: o, userAgent: r }) 73814 }, 73815 url: fa(i, "/info/", { 73816 jsonerrors: 1, 73817 pub_key: t, 73818 file_id: e, 73819 source: n 73820 }), 73821 signal: s 73822 }).then(({ data: c, headers: u, request: d }) => { 73823 const p = ka(JSON.parse(c)); 73824 if ("error" in p) 73825 throw new yn(p.error.content, p.error.errorCode, d, p, u); 73826 return p; 73827 }), { retryThrottledRequestMaxTimes: a, retryNetworkErrorMaxTimes: l }); 73828} 73829function hfe(e, { publicKey: t, contentType: i, fileName: s, multipartChunkSize: n = St.multipartChunkSize, baseURL: o = "", secureSignature: r, secureExpire: a, store: l, signal: c, source: u = "local", integration: d, userAgent: p, retryThrottledRequestMaxTimes: f = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: m = St.retryNetworkErrorMaxTimes, metadata: y, tags: b }) { 73830 return Wl(() => Ul({ 73831 method: "POST", 73832 url: fa(o, "/multipart/start/", { jsonerrors: 1 }), 73833 headers: { 73834 "X-UC-User-Agent": nu({ publicKey: t, integration: d, userAgent: p }) 73835 }, 73836 data: lC({ 73837 filename: s || u3, 73838 size: e, 73839 content_type: i || nC, 73840 part_size: n, 73841 UPLOADCARE_STORE: zM(l), 73842 UPLOADCARE_PUB_KEY: t, 73843 signature: r, 73844 expire: a, 73845 source: u, 73846 metadata: y, 73847 tags: HM(b) 73848 }), 73849 signal: c 73850 }).then(({ data: C, headers: w, request: M }) => { 73851 const A = ka(JSON.parse(C)); 73852 if ("error" in A) 73853 throw new yn(A.error.content, A.error.errorCode, M, A, w); 73854 return A.parts = Object.keys(A.parts).map((I) => A.parts[Number(I)]), A; 73855 }), { retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m }); 73856}
73857function pfe(e, t, { contentType: i, signal: s, onProgress: n, retryThrottledRequestMaxTimes: o = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: r = St.retryNetworkErrorMaxTimes }) { 73858 return Wl(() => Ul({ 73859 method: "PUT", 73860 url: t, 73861 data: e, 73862 // Upload request can't be non-computable because we always know exact size 73863 onProgress: n, 73864 signal: s, 73865 headers: { 73866 "Content-Type": i || nC 73867 } 73868 }).then((a) => (n && n({ 73869 isComputable: !0, 73870 value: 1 73871 }), a)).then(({ status: a }) => ({ code: a })), { 73872 retryThrottledRequestMaxTimes: o, 73873 retryNetworkErrorMaxTimes: r 73874 }); 73875} 73876function gfe(e, { publicKey: t, baseURL: i = St.baseURL, source: s = "local", signal: n, integration: o, userAgent: r, retryThrottledRequestMaxTimes: a = St.retryThrottledRequestMaxTimes, retryNetworkErrorMaxTimes: l = St.retryNetworkErrorMaxTimes }) { 73877 return Wl(() => Ul({ 73878 method: "POST", 73879 url: fa(i, "/multipart/complete/", { jsonerrors: 1 }), 73880 headers: { 73881 "X-UC-User-Agent": nu({ publicKey: t, integration: o, userAgent: r }) 73882 }, 73883 data: lC({ 73884 uuid: e, 73885 UPLOADCARE_PUB_KEY: t, 73886 source: s 73887 }), 73888 signal: n 73889 }).then(({ data: c, headers: u, request: d }) => { 73890 const p = ka(JSON.parse(c)); 73891 if ("error" in p) 73892 throw new yn(p.error.content, p.error.errorCode, d, p, u); 73893 return p; 73894 }), { retryThrottledRequestMaxTimes: a, retryNetworkErrorMaxTimes: l }); 73895} 73896function cC(e, { publicKey: t, baseURL: i, source: s, integration: n, userAgent: o, retryThrottledRequestMaxTimes: r, retryNetworkErrorMaxTimes: a, signal: l, onProgress: c }) { 73897 return c3({ 73898 check: (u) => dfe(e, { 73899 publicKey: t, 73900 baseURL: i, 73901 signal: u, 73902 source: s, 73903 integration: n, 73904 userAgent: o, 73905 retryThrottledRequestMaxTimes: r, 73906 retryNetworkErrorMaxTimes: a 73907 }).then((d) => d.isReady ? (c && c({ isComputable: !0, value: 1 }), d) : !1), 73908 signal: l 73909 }); 73910} 73911const ffe = (e, t) => { 73912 const i = new URL(t); 73913 return i.hostname = `${e}.${i.hostname}`, i.toString().replace(/\/$/, ""); 73914}, mfe = (e) => e.toString(36).slice(0, 10), vfe = (e, t) => { 73915 try { 73916 const i = new URL(e).hostname, s = new URL(t).hostname; 73917 return i === s || i.endsWith(`.${s}`); 73918 } catch { 73919 return !1; 73920 } 73921}, yfe = (e) => { 73922 const t = new DataView(e); 73923 let i = 0n; 73924 for (let s = 0; s < e.byteLength; s += 8) 73925 i = i << 64n | t.getBigUint64(s); 73926 return i; 73927}, Cfe = async (e) => yfe( 73928 await globalThis.crypto.subtle.digest( 73929 "SHA-256", 73930 new TextEncoder().encode(e) 73931 ) 73932), bfe = async (e) => mfe(await Cfe(e)), wfe = async (e, t) => { 73933 const i = await bfe(e); 73934 return ffe(i, t); 73935}, Sfe = (e, t) => wfe(e, t), f3 = ({ publicKey: e, baseCDN: t, prefixedBaseCDN: i = St.prefixedBaseCDN }) => e ? t === void 0 || vfe(t, i) ? Sfe(e, i) : Promise.resolve(t) : Promise.resolve(t ?? St.baseCDN); 73936function xfe(e) { 73937 return "defaultEffects" in e; 73938} 73939class VM { 73940 uuid; 73941 name; 73942 size; 73943 isStored; 73944 isImage; 73945 mimeType; 73946 cdnUrl; 73947 s3Url; 73948 originalFilename; 73949 imageInfo; 73950 videoInfo; 73951 contentInfo; 73952 metadata; 73953 tags; 73954 s3Bucket; 73955 defaultEffects = null; 73956 constructor(t, { baseCDN: i = St.baseCDN, fileName: s } = {}) { 73957 const { uuid: n, s3Bucket: o } = t, r = fa(i, `${n}/`), a = o ? fa(`https://${o}.s3.amazonaws.com/`, `${n}/${t.filename}`) : null; 73958 this.uuid = n, this.name = s || t.filename, this.size = t.size, this.isStored = t.isStored, this.isImage = t.isImage, this.mimeType = t.mimeType, this.cdnUrl = r, this.originalFilename = t.originalFilename, this.imageInfo = t.imageInfo, this.videoInfo = t.videoInfo, this.contentInfo = t.contentInfo, this.metadata = t.metadata || null, this.tags = t.tags || null, this.s3Bucket = o || null, this.s3Url = a, xfe(t) && (this.defaultEffects = t.defaultEffects); 73959 } 73960} 73961const uC = async (e, { publicKey: t, baseCDN: i, prefixedBaseCDN: s, fileName: n }) => { 73962 const o = await f3({ 73963 publicKey: t, 73964 baseCDN: i, 73965 prefixedBaseCDN: s 73966 }); 73967 return new VM(e, { baseCDN: o, fileName: n }); 73968}, Mfe = (e, { publicKey: t, fileName: i, baseURL: s, secureSignature: n, secureExpire: o, store: r, contentType: a, signal: l, onProgress: c, source: u, integration: d, userAgent: p, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, baseCDN: y, prefixedBaseCDN: b, metadata: C, tags: w }) => rfe(e, { 73969 publicKey: t, 73970 fileName: i, 73971 contentType: a, 73972 baseURL: s, 73973 secureSignature: n, 73974 secureExpire: o, 73975 store: r, 73976 signal: l, 73977 onProgress: c, 73978 source: u, 73979 integration: d, 73980 userAgent: p, 73981 retryThrottledRequestMaxTimes: f, 73982 retryNetworkErrorMaxTimes: m, 73983 metadata: C,
73984 tags: w 73985}).then(({ file: M }) => cC(M, { 73986 publicKey: t, 73987 baseURL: s, 73988 source: u, 73989 integration: d, 73990 userAgent: p, 73991 retryThrottledRequestMaxTimes: f, 73992 retryNetworkErrorMaxTimes: m, 73993 onProgress: c, 73994 signal: l 73995})).then((M) => uC(M, { publicKey: t, baseCDN: y, prefixedBaseCDN: b })), Afe = (e, { publicKey: t, fileName: i, baseURL: s, signal: n, onProgress: o, source: r, integration: a, userAgent: l, retryThrottledRequestMaxTimes: c, retryNetworkErrorMaxTimes: u, baseCDN: d, prefixedBaseCDN: p }) => cC(e, { 73996 publicKey: t, 73997 baseURL: s, 73998 signal: n, 73999 onProgress: o, 74000 source: r, 74001 integration: a, 74002 userAgent: l, 74003 retryThrottledRequestMaxTimes: c, 74004 retryNetworkErrorMaxTimes: u 74005}).then((f) => uC(f, { 74006 publicKey: t, 74007 baseCDN: d, 74008 prefixedBaseCDN: p, 74009 fileName: i 74010})), Dfe = (e, { signal: t } = {}) => { 74011 let i = null, s = null; 74012 const n = e.map(() => new AbortController()), o = (r) => () => { 74013 s = r, n.forEach((a, l) => l !== r && a.abort()); 74014 }; 74015 return GM(t, () => { 74016 n.forEach((r) => r.abort()); 74017 }), Promise.all(e.map((r, a) => { 74018 const l = o(a); 74019 return Promise.resolve().then(() => r({ stopRace: l, signal: n[a].signal })).then((c) => (l(), c)).catch((c) => (i = c, null)); 74020 })).then((r) => { 74021 if (s === null) 74022 throw i; 74023 return r[s]; 74024 }); 74025}; 74026var Efe = window.WebSocket; 74027class Ife { 74028 events = /* @__PURE__ */ Object.create({}); 74029 emit(t, i) { 74030 this.events[t]?.forEach((s) => s(i)); 74031 } 74032 on(t, i) { 74033 this.events[t] = this.events[t] || [], this.events[t].push(i); 74034 } 74035 off(t, i) { 74036 i ? this.events[t] = this.events[t].filter((s) => s !== i) : this.events[t] = []; 74037 } 74038} 74039const Rfe = (e, t) => e === "success" ? { status: pn.Success, ...t } : e === "progress" ? { status: pn.Progress, ...t } : { status: pn.Error, ...t }; 74040class Tfe { 74041 key; 74042 disconnectTime; 74043 ws = void 0; 74044 queue = []; 74045 isConnected = !1; 74046 subscribers = 0; 74047 emmitter = new Ife(); 74048 disconnectTimeoutId = null; 74049 constructor(t, i = 3e4) { 74050 this.key = t, this.disconnectTime = i; 74051 } 74052 connect() { 74053 if (this.disconnectTimeoutId && clearTimeout(this.disconnectTimeoutId), !this.isConnected && !this.ws) { 74054 const t = `wss://ws.pusherapp.com/app/${this.key}?protocol=5&client=js&version=1.12.2`; 74055 this.ws = new Efe(t), this.ws.addEventListener("error", (i) => { 74056 this.emmitter.emit("error", new Error(i.message)); 74057 }), this.emmitter.on("connected", () => { 74058 this.isConnected = !0, this.queue.forEach((i) => this.send(i.event, i.data)), this.queue = []; 74059 }), this.ws.addEventListener("message", (i) => { 74060 const s = JSON.parse(i.data.toString()); 74061 switch (s.event) { 74062 case "pusher:connection_established": { 74063 this.emmitter.emit("connected", void 0); 74064 break; 74065 } 74066 case "pusher:ping": { 74067 this.send("pusher:pong", {}); 74068 break; 74069 } 74070 case "progress": 74071 case "success": 74072 case "fail": 74073 this.emmitter.emit(s.channel, Rfe(s.event, JSON.parse(s.data))); 74074 } 74075 }); 74076 } 74077 } 74078 disconnect() { 74079 const t = () => { 74080 this.ws?.close(), this.ws = void 0, this.isConnected = !1; 74081 }; 74082 this.disconnectTime ? this.disconnectTimeoutId = setTimeout(() => { 74083 t(); 74084 }, this.disconnectTime) : t(); 74085 } 74086 send(t, i) { 74087 const s = JSON.stringify({ event: t, data: i }); 74088 this.ws?.send(s); 74089 } 74090 subscribe(t, i) { 74091 this.subscribers += 1, this.connect(); 74092 const s = `task-status-${t}`, n = { 74093 event: "pusher:subscribe", 74094 data: { channel: s } 74095 }; 74096 this.emmitter.on(s, i), this.isConnected ? this.send(n.event, n.data) : this.queue.push(n); 74097 } 74098 unsubscribe(t) { 74099 this.subscribers -= 1; 74100 const i = `task-status-${t}`, s = { 74101 event: "pusher:unsubscribe", 74102 data: { channel: i } 74103 }; 74104 this.emmitter.off(i), this.isConnected ? this.send(s.event, s.data) : this.queue = this.queue.filter((n) => n.data.channel !== i), this.subscribers === 0 && this.disconnect(); 74105 } 74106 onError(t) { 74107 return this.emmitter.on("error", t), () => this.emmitter.off("error", t); 74108 } 74109} 74110let H0 = null; 74111const UM = (e) => { 74112 if (!H0) { 74113 const t = typeof window > "u" ? 0 : 3e4; 74114 H0 = new Tfe(e, t); 74115 } 74116 return H0; 74117}, Lfe = (e) => { 74118 UM(e).connect(); 74119}; 74120function kfe({ token: e, publicKey: t, baseURL: i, integration: s, userAgent: n, retryThrottledRequestMaxTimes: o, retryNetworkErrorMaxTimes: r, onProgress: a, signal: l }) { 74121 return c3({ 74122 check: (c) => cfe(e, { 74123 publicKey: t, 74124 baseURL: i, 74125 integration: s, 74126 userAgent: n, 74127 retryThrottledRequestMaxTimes: o, 74128 retryNetworkErrorMaxTimes: r, 74129 signal: c 74130 }).then((u) => { 74131 switch (u.status) { 74132 case pn.Error: 74133 return new yn(u.error, u.errorCode); 74134 case pn.Waiting: 74135 return !1; 74136 case pn.Unknown: 74137 return new yn(`Token "${e}" was not found.`); 74138 case pn.Progress: 74139 return a && (u.total === "unknown" ? a({ isComputable: !1 }) : a({ 74140 isComputable: !0, 74141 value: u.done / u.total 74142 })), !1; 74143 case pn.Success: 74144 return a && a({ 74145 isComputable: !0, 74146 value: u.done / u.total 74147 }), u; 74148 default: 74149 throw new Error("Unknown status"); 74150 } 74151 }), 74152 signal: l 74153 }); 74154} 74155const Pfe = ({ token: e, pusherKey: t, signal: i, onProgress: s }) => new Promise((n, o) => { 74156 const r = UM(t), a = r.onError(o), l = () => { 74157 a(), r.unsubscribe(e); 74158 }; 74159 GM(i, () => { 74160 l(), o(new ea("pusher cancelled")); 74161 }), r.subscribe(e, (c) => { 74162 switch (c.status) { 74163 case pn.Progress: { 74164 s && (c.total === "unknown" ? s({ isComputable: !1 }) : s({ 74165 isComputable: !0, 74166 value: c.done / c.total 74167 })); 74168 break; 74169 } 74170 case pn.Success: { 74171 l(), s && s({ 74172 isComputable: !0, 74173 value: c.done / c.total 74174 }), n(c); 74175 break; 74176 } 74177 case pn.Error: 74178 l(), o(new yn(c.msg, c.error_code)); 74179 } 74180 }); 74181}), Ffe = (e, { publicKey: t, fileName: i, baseURL: s, baseCDN: n, prefixedBaseCDN: o, checkForUrlDuplicates: r, saveUrlForRecurrentUploads: a, secureSignature: l, secureExpire: c, store: u, signal: d, onProgress: p, source: f, integration: m, userAgent: y, retryThrottledRequestMaxTimes: b, pusherKey: C = St.pusherKey, metadata: w, tags: M }) => Promise.resolve(Lfe(C)).then(() => afe(e, { 74182 publicKey: t, 74183 fileName: i, 74184 baseURL: s, 74185 checkForUrlDuplicates: r, 74186 saveUrlForRecurrentUploads: a, 74187 secureSignature: l, 74188 secureExpire: c, 74189 store: u, 74190 signal: d, 74191 source: f, 74192 integration: m, 74193 userAgent: y, 74194 retryThrottledRequestMaxTimes: b, 74195 metadata: w, 74196 tags: M 74197})).catch((A) => (UM(C)?.disconnect(), Promise.reject(A))).then((A) => A.type === yS.FileInfo ? A : Dfe([ 74198 ({ signal: I }) => kfe({ 74199 token: A.token, 74200 publicKey: t, 74201 baseURL: s, 74202 integration: m, 74203 userAgent: y, 74204 retryThrottledRequestMaxTimes: b, 74205 onProgress: p, 74206 signal: I 74207 }), 74208 ({ signal: I }) => Pfe({ 74209 token: A.token, 74210 pusherKey: C, 74211 signal: I, 74212 onProgress: p 74213 }) 74214], { signal: d })).then((A) => { 74215 if (A instanceof yn) 74216 throw A; 74217 return A; 74218}).then((A) => A.isReady ? A : cC(A.uuid, { 74219 publicKey: t, 74220 baseURL: s, 74221 integration: m, 74222 userAgent: y, 74223 retryThrottledRequestMaxTimes: b, 74224 onProgress: p, 74225 signal: d 74226})).then((A) => uC(A, { publicKey: t, baseCDN: n, prefixedBaseCDN: o })), V0 = /* @__PURE__ */ new WeakMap(), Ofe = async (e) => { 74227 if (V0.has(e)) 74228 return V0.get(e); 74229 const t = await fetch(e.uri).then((i) => i.blob()); 74230 return V0.set(e, t), t; 74231}, m3 = async (e) => { 74232 if (rC(e) || oC(e)) 74233 return e.size; 74234 if (aC(e)) 74235 return (await Ofe(e)).size; 74236 throw new Error("Unknown file type. Cannot determine file size."); 74237}, Nfe = (e, t = St.multipartMinFileSize) => e >= t, v3 = (e) => { 74238 const t = "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}", i = new RegExp(t); 74239 return !oh(e) && i.test(e); 74240}, WM = (e) => { 74241 const t = "^(?:\\w+:)?\\/\\/([^\\s\\.]+\\.\\S{2}
74241|localhost[\\:?\\d]*)\\S*$", i = new RegExp(t); 74242 return !oh(e) && i.test(e); 74243}, _fe = (e, t) => new Promise((i, s) => { 74244 const n = []; 74245 let o = !1, r = t.length; 74246 const a = [...t], l = () => { 74247 const c = t.length - a.length, u = a.shift(); 74248 u && u().then((d) => { 74249 o || (n[c] = d, r -= 1, r ? l() : i(n)); 74250 }).catch((d) => { 74251 o = !0, s(d); 74252 }); 74253 }; 74254 for (let c = 0; c < e; c++) 74255 l(); 74256}), Bfe = (e, t, i, s) => { 74257 const n = s * t, o = Math.min(n + s, i); 74258 return e.slice(n, o); 74259}, Gfe = async (e, t, i) => (s) => Bfe(e, s, t, i), zfe = (e, t, { publicKey: i, contentType: s, onProgress: n, signal: o, integration: r, retryThrottledRequestMaxTimes: a, retryNetworkErrorMaxTimes: l }) => pfe(e, t, { 74260 contentType: s, 74261 onProgress: n, 74262 signal: o, 74263 retryThrottledRequestMaxTimes: a, 74264 retryNetworkErrorMaxTimes: l 74265}), Hfe = async (e, { publicKey: t, fileName: i, fileSize: s, baseURL: n, secureSignature: o, secureExpire: r, store: a, signal: l, onProgress: c, source: u, integration: d, userAgent: p, retryThrottledRequestMaxTimes: f, retryNetworkErrorMaxTimes: m, contentType: y, multipartChunkSize: b = St.multipartChunkSize, maxConcurrentRequests: C = St.maxConcurrentRequests, baseCDN: w, prefixedBaseCDN: M, metadata: A, tags: I }) => { 74266 const L = s ?? await m3(e); 74267 let k; 74268 const B = (N, W) => { 74269 if (!c) 74270 return; 74271 k || (k = Array(N).fill(0)); 74272 const se = (ue) => ue.reduce((Ce, te) => Ce + te, 0); 74273 return (ue) => { 74274 ue.isComputable && (k[W] = ue.value, c({ 74275 isComputable: !0, 74276 value: se(k) / N 74277 })); 74278 }; 74279 }; 74280 return y ||= p3(e), hfe(L, { 74281 publicKey: t, 74282 contentType: y, 74283 fileName: i || g3(e), 74284 baseURL: n, 74285 secureSignature: o, 74286 secureExpire: r, 74287 store: a, 74288 signal: l, 74289 source: u, 74290 integration: d, 74291 userAgent: p, 74292 retryThrottledRequestMaxTimes: f, 74293 retryNetworkErrorMaxTimes: m, 74294 metadata: A, 74295 tags: I, 74296 multipartChunkSize: b 74297 }).then(async ({ uuid: N, parts: W }) => { 74298 const se = await Gfe(e, L, b); 74299 return Promise.all([ 74300 N, 74301 _fe(C, W.map((ue, Ce) => () => zfe(se(Ce), ue, { 74302 publicKey: t, 74303 contentType: y, 74304 onProgress: B(W.length, Ce), 74305 signal: l, 74306 integration: d, 74307 retryThrottledRequestMaxTimes: f, 74308 retryNetworkErrorMaxTimes: m 74309 }))) 74310 ]); 74311 }).then(([N]) => gfe(N, { 74312 publicKey: t, 74313 baseURL: n, 74314 source: u, 74315 integration: d, 74316 userAgent: p, 74317 retryThrottledRequestMaxTimes: f, 74318 retryNetworkErrorMaxTimes: m 74319 })).then((N) => N.isReady ? N : cC(N.uuid, { 74320 publicKey: t, 74321 baseURL: n, 74322 source: u, 74323 integration: d, 74324 userAgent: p, 74325 retryThrottledRequestMaxTimes: f, 74326 retryNetworkErrorMaxTimes: m, 74327 onProgress: c, 74328 signal: l 74329 })).then((N) => uC(N, { publicKey: t, baseCDN: w, prefixedBaseCDN: M })); 74330}; 74331async function y3(e, { 74332 publicKey: t, 74333 fileName: i, 74334 baseURL: s = St.baseURL, 74335 secureSignature: n, 74336 secureExpire: o, 74337 store: r, 74338 signal: a, 74339 onProgress: l, 74340 source: c, 74341 integration: u, 74342 userAgent: d, 74343 retryThrottledRequestMaxTimes: p, 74344 retryNetworkErrorMaxTimes: f, 74345 contentType: m, 74346 multipartMinFileSize: y, 74347 multipartChunkSize: b, 74348 maxConcurrentRequests: C, 74349 // Left undefined on purpose when the caller omits it, so `resolveCdnBase` 74350 // can distinguish "not set" (â prefixed default) from an explicit base 74351 // (â used verbatim, e.g. the legacy `https://ucarecdn.com`). 74352 baseCDN: w, 74353 prefixedBaseCDN: M = St.prefixedBaseCDN, 74354 checkForUrlDuplicates: A, 74355 saveUrlForRecurrentUploads: I, 74356 pusherKey: L, 74357 metadata: k, 74358 tags: B 74359}) { 74360 if (oh(e)) { 74361 const N = await m3(e); 74362 return Nfe(N, y) ? Hfe(e, { 74363 publicKey: t, 74364 contentType: m, 74365 multipartChunkSize: b, 74366 fileSize: N, 74367 fileName: i, 74368 baseURL: s, 74369 secureSignature: n, 74370 secureExpire: o, 74371 store: r, 74372 signal: a, 74373 onProgress: l, 74374 source: c, 74375 integration: u, 74376 userAgent: d, 74377 maxConcurrentRequests: C, 74378 retryThrottledRequestMaxTimes: p, 74379 retryNetworkErrorMaxTimes: f, 74380 baseCDN: w, 74381 prefixedBaseCDN: M, 74382 metadata: k, 74383 tags: B 74384 }) : Mfe(e, { 74385 publicKey: t, 74386 fileName: i, 74387 contentType: m, 74388 baseURL: s, 74389 secureSignature: n, 74390 secureExpire: o, 74391 store: r, 74392 signal: a, 74393 onProgress: l, 74394 source: c, 74395 integration: u, 74396 userAgent: d, 74397 retryThrottledRequestMaxTimes: p, 74398 retryNetworkErrorMaxTimes: f, 74399 baseCDN: w, 74400 prefixedBaseCDN: M, 74401 metadata: k, 74402 tags: B 74403 }); 74404 } 74405 if (WM(e)) 74406 return Ffe(e, { 74407 publicKey: t, 74408 fileName: i, 74409 baseURL: s, 74410 baseCDN: w, 74411 prefixedBaseCDN: M, 74412 checkForUrlDuplicates: A, 74413 saveUrlForRecurrentUploads: I, 74414 secureSignature: n, 74415 secureExpire: o, 74416 store: r, 74417 signal: a, 74418 onProgress: l, 74419 source: c, 74420 integration: u, 74421 userAgent: d, 74422 retryThrottledRequestMaxTimes: p, 74423 pusherKey: L, 74424 metadata: k, 74425 tags: B 74426 }); 74427 if (v3(e)) 74428 return Afe(e, { 74429 publicKey: t, 74430 fileName: i, 74431 baseURL: s, 74432 signal: a, 74433 onProgress: l, 74434 source: c, 74435 integration: u, 74436 userAgent: d, 74437 retryThrottledRequestMaxTimes: p, 74438 retryNetworkErrorMaxTimes: f, 74439 baseCDN: w, 74440 prefixedBaseCDN: M 74441 }); 74442 throw new TypeError(`File uploading from "${e}" is not supported`); 74443} 74444const Vfe = (e, t) => { 74445 try { 74446 const i = new URL(e), s = new URL(t); 74447 return i.protocol = s.protocol, i.hostname = s.hostname, i.port = s.port, i.toString(); 74448 } catch { 74449 return e; 74450 } 74451}; 74452class Ufe { 74453 uuid; 74454 filesCount; 74455 totalSize; 74456 isStored; 74457 isImage; 74458 cdnUrl; 74459 files; 74460 createdAt; 74461 storedAt = null; 74462 constructor(t, { baseCDN: i = St.baseCDN } = {}) { 74463 this.uuid = t.id, this.filesCount = t.filesCount;
74464 const s = t.files.filter(Boolean); 74465 this.totalSize = Object.values(s).reduce((n, o) => n + o.size, 0), this.isStored = !!t.datetimeStored, this.isImage = !!Object.values(s).filter((n) => n.isImage).length, this.cdnUrl = Vfe(t.cdnUrl, i), this.files = s.map((n) => new VM(n, { baseCDN: i })), this.createdAt = t.datetimeCreated, this.storedAt = t.datetimeStored; 74466 } 74467} 74468const Wfe = async (e, { publicKey: t, baseCDN: i, prefixedBaseCDN: s }) => { 74469 const n = await f3({ 74470 publicKey: t, 74471 baseCDN: i, 74472 prefixedBaseCDN: s 74473 }); 74474 return new Ufe(e, { baseCDN: n }); 74475}, jfe = (e) => { 74476 for (const t of e) 74477 if (!oh(t)) 74478 return !1; 74479 return !0; 74480}, $fe = (e) => { 74481 for (const t of e) 74482 if (!v3(t)) 74483 return !1; 74484 return !0; 74485}, Yfe = (e) => { 74486 for (const t of e) 74487 if (!WM(t)) 74488 return !1; 74489 return !0; 74490}; 74491function Kfe(e, { 74492 publicKey: t, 74493 fileName: i, 74494 baseURL: s = St.baseURL, 74495 secureSignature: n, 74496 secureExpire: o, 74497 store: r, 74498 signal: a, 74499 onProgress: l, 74500 source: c, 74501 integration: u, 74502 userAgent: d, 74503 retryThrottledRequestMaxTimes: p, 74504 retryNetworkErrorMaxTimes: f, 74505 contentType: m, 74506 multipartChunkSize: y = St.multipartChunkSize, 74507 // Left undefined on purpose when the caller omits it, so `resolveCdnBase` 74508 // can distinguish "not set" (â prefixed default) from an explicit base 74509 // (â used verbatim, e.g. the legacy `https://ucarecdn.com`). 74510 baseCDN: b, 74511 prefixedBaseCDN: C = St.prefixedBaseCDN, 74512 checkForUrlDuplicates: w, 74513 saveUrlForRecurrentUploads: M, 74514 jsonpCallback: A 74515}) { 74516 if (!jfe(e) && !Yfe(e) && !$fe(e)) 74517 throw new TypeError(`Group uploading from "${e}" is not supported`); 74518 let I, L = !0; 74519 const k = e.length, B = (N, W) => { 74520 if (!l) 74521 return; 74522 I || (I = Array(N).fill(0)); 74523 const se = (ue) => ue.reduce((Ce, te) => Ce + te) / N; 74524 return (ue) => { 74525 if (!ue.isComputable || !L) { 74526 L = !1, l({ isComputable: !1 }); 74527 return; 74528 } 74529 I[W] = ue.value, l({ isComputable: !0, value: se(I) }); 74530 }; 74531 }; 74532 return Promise.all(e.map((N, W) => oh(N) || WM(N) ? y3(N, { 74533 publicKey: t, 74534 fileName: i, 74535 baseURL: s, 74536 secureSignature: n, 74537 secureExpire: o, 74538 store: r, 74539 signal: a, 74540 onProgress: B(k, W), 74541 source: c, 74542 integration: u, 74543 userAgent: d, 74544 retryThrottledRequestMaxTimes: p, 74545 retryNetworkErrorMaxTimes: f, 74546 contentType: m, 74547 multipartChunkSize: y, 74548 baseCDN: b, 74549 prefixedBaseCDN: C, 74550 checkForUrlDuplicates: w, 74551 saveUrlForRecurrentUploads: M 74552 }).then((se) => se.uuid) : N)).then((N) => ufe(N, { 74553 publicKey: t, 74554 baseURL: s, 74555 jsonpCallback: A, 74556 secureSignature: n, 74557 secureExpire: o, 74558 signal: a, 74559 source: c, 74560 integration: u, 74561 userAgent: d, 74562 retryThrottledRequestMaxTimes: p, 74563 retryNetworkErrorMaxTimes: f 74564 }).then((W) => Wfe(W, { publicKey: t, baseCDN: b, prefixedBaseCDN: C })).then((W) => (l && l({ isComputable: !0, value: 1 }), W))); 74565} 74566class Zfe { 74567 _concurrency = 1; 74568 _pending = []; 74569 _running = 0; 74570 _resolvers = /* @__PURE__ */ new Map(); 74571 _rejectors = /* @__PURE__ */ new Map(); 74572 constructor(t) { 74573 this._concurrency = t; 74574 } 74575 /** Run tasks from the queue up to the concurrency limit */ 74576 run() { 74577 const t = this._concurrency - this._running; 74578 for (let i = 0; i < t; i++) { 74579 const s = this._pending.shift(); 74580 if (!s) 74581 return; 74582 const n = this._resolvers.get(s), o = this._rejectors.get(s); 74583 if (!n || !o) 74584 throw new Error("Unexpected behavior: resolver or rejector is undefined"); 74585 this._running += 1, s().finally(() => { 74586 this._resolvers.delete(s), this._rejectors.delete(s), this._running -= 1, this.run(); 74587 }).then((r) => n(r)).catch((r) => o(r)); 74588 } 74589 } 74590 /** 74591 * Add a task to the queue 74592 * 74593 * If you want to add a lot of tasks at once, consider setting `autoRun` to 74594 * false and calling `run()` manually after adding all tasks to avoid multiple 74595 * redundant calls to `run()`. 74596 * 74597 * @param task The task to add 74598 * @param autoRun Whether to automatically run the queue after adding the task 74599 * (default: true) 74600 * @returns A promise that resolves or rejects with the task's result 74601 */ 74602 add(t, { autoRun: i } = { autoRun: !0 }) { 74603 return new Promise((s, n) => { 74604 this._resolvers.set(t, s), this._rejectors.set(t, n), this._pending.push(t), i && this.run(); 74605 }); 74606 } 74607 get pending() { 74608 return this._pending.length; 74609 } 74610 get running() { 74611 return this._running; 74612 } 74613 set concurrency(t) { 74614 this._concurrency = t, this.run(); 74615 } 74616 get concurrency() { 74617 return this._concurrency; 74618 } 74619} 74620const C3 = () => ({}), b3 = (e) => ({ 74621 ...C3(), 74622 "*currentActivity": null, 74623 "*currentActivityParams": {}, 74624 "*history": [], 74625 "*historyBack": null, 74626 "*closeModal": () => { 74627 e.set$({ 74628 "*currentActivity": null, 74629 "*modalActive": !1 74630 }); 74631 } 74632}), w3 = (e) => ({ 74633 ...b3(e), 74634 "*commonProgress": 0, 74635 "*uploadList": [], 74636 "*uploadQueue": new Zfe(1), 74637 /** @type {ReturnType<import('../types').OutputErrorCollection>[]} */ 74638 "*collectionErrors": [], 74639 /** @type {import('../types').OutputCollectionState | null} */ 74640 "*collectionState": null, 74641 /** @type {import('@uploadcare/upload-client').UploadcareGroup | null} */ 74642 "*groupInfo": null, 74643 /** @type {Set<string>} */ 74644 "*uploadTrigger": /* @__PURE__ */ new Set(), 74645 /** @type {import('./SecureUploadsManager.js').SecureUploadsManager | null} */ 74646 "*secureUploadsManager": null 74647}), jM = { 74648 "locale-id": "en", 74649 "social-source-lang": "en", 74650 "upload-file": "Upload file", 74651 "upload-files": "Upload files", 74652 "choose-file": "Choose file", 74653 "choose-files": "Choose files", 74654 "drop-files-here": "Drop files here", 74655 "select-file-source": "Select file source", 74656 selected: "Selected", 74657 upload: "Upload", 74658 "add-more": "Add more", 74659 cancel: "Cancel", 74660 "start-from-cancel": "Cancel", 74661 clear: "Clear", 74662 "camera-shot": "Shot", 74663 "upload-url": "Import", 74664 "upload-url-placeholder": "Paste link here", 74665 "edit-image": "Edit image", 74666 "edit-detail": "Details", 74667 back: "Back", 74668 done: "Done", 74669 ok: "Ok", 74670 "remove-from-list": "Remove", 74671 no: "No", 74672 yes: "Yes", 74673 "confirm-your-action": "Confirm your action", 74674 "are-you-sure": "Are you sure?", 74675 "selected-count": "{{count}} of {{total}} selected", 74676 "select-all": "Select all", 74677 "deselect-all": "Deselect all", 74678 "upload-error": "Upload error", 74679 "validation-error": "Validation error", 74680 "no-files": "No files selected", 74681 browse: "Browse", 74682 "not-uploaded-yet": "Not uploaded yet...", 74683 file__one: "file", 74684 file__other: "files", 74685 error__one: "error", 74686 error__other: "errors", 74687 "header-uploading": "Uploading {{count}} {{plural:file(count)}}", 74688 "header-failed": "{{count}} {{plural:error(count)}}", 74689 "header-succeed": "{{count}} {{plural:file(count)}} uploaded", 74690 "header-total": "{{count}} {{plural:file(count)}} selected", 74691 "src-type-local": "From device", 74692 "src-type-from-url": "From link", 74693 "src-type-camera": "Camera", 74694 "src-type-draw": "Draw", 74695 "src-type-facebook": "Facebook", 74696 "src-type-dropbox": "Dropbox", 74697 "src-type-gdrive": "Google Drive", 74698 "src-type-gphotos": "Google Photos", 74699 "src-type-flickr": "Flickr", 74700 "src-type-vk": "VK", 74701 "src-type-evernote": "Evernote", 74702 "src-type-box": "Box", 74703 "src-type-onedrive": "Onedrive", 74704 "src-type-huddle": "Huddle", 74705 "src-type-other": "Other", 74706 "caption-from-url": "Import from link", 74707 "caption-camera": "Camera", 74708 "caption-draw": "Draw", 74709 "caption-edit-file": "Edit file", 74710 "file-no-name": "No name...", 74711 "toggle-fullscreen": "Toggle fullscreen", 74712 "toggle-guides": "Toggle guides", 74713 rotate: "Rotate",
74714 "flip-vertical": "Flip vertical", 74715 "flip-horizontal": "Flip horizontal", 74716 apply: "Apply", 74717 brightness: "Brightness", 74718 contrast: "Contrast", 74719 saturation: "Saturation", 74720 exposure: "Exposure", 74721 gamma: "Gamma", 74722 vibrance: "Vibrance", 74723 warmth: "Warmth", 74724 enhance: "Enhance", 74725 original: "Original", 74726 resize: "Resize image", 74727 crop: "Crop", 74728 "select-color": "Select color", 74729 text: "Text", 74730 draw: "Draw", 74731 "cancel-edit": "Cancel edit", 74732 "tab-view": "Preview", 74733 "tab-details": "Details", 74734 "file-name": "Name", 74735 "file-size": "Size", 74736 "cdn-url": "CDN URL", 74737 "file-size-unknown": "Unknown", 74738 "camera-permissions-denied": "Camera access denied", 74739 "camera-permissions-prompt": "Please allow access to the camera", 74740 "camera-permissions-request": "Request access", 74741 "files-count-limit-error-title": "Files count limit overflow", 74742 "files-count-limit-error-too-few": "Youâve chosen {{total}} {{plural:file(total)}}. At least {{min}} {{plural:file(min)}} required.", 74743 "files-count-limit-error-too-many": "Youâve chosen too many files. {{max}} {{plural:file(max)}} is maximum.", 74744 "files-max-size-limit-error": "File is too big. Max file size is {{maxFileSize}}.", 74745 "has-validation-errors": "File validation error ocurred. Please, check your files before upload.", 74746 "images-only-accepted": "Only image files are accepted.", 74747 "file-type-not-allowed": "Uploading of these file types is not allowed.", 74748 "some-files-were-not-uploaded": "Some files were not uploaded.", 74749 "file-item-edit-button": "Edit", 74750 "file-item-remove-button": "Remove", 74751 "a11y-editor-tab-filters": "Filters", 74752 "a11y-editor-tab-tuning": "Tuning", 74753 "a11y-editor-tab-crop": "Crop", 74754 "a11y-activity-header-button-close": "Close", 74755 flip: "Flip", 74756 mirror: "Mirror", 74757 "a11y-cloud-editor-apply-filter": "Apply {{name}} filter", 74758 "a11y-cloud-editor-apply-crop": "Apply {{name}} operation", 74759 "a11y-cloud-editor-apply-tuning": "Apply {{name}} tuning", 74760 finished: "Finished", 74761 failed: "Failed", 74762 uploading: "Uploading", 74763 idle: "Idle", 74764 "a11y-file-item-status": "File {{fileName}} in status {{status}}" 74765}, bv = /* @__PURE__ */ new Map(), CS = /* @__PURE__ */ new Map(), S3 = (e, t) => { 74766 bv.has(e) && console.log(`Locale ${e} is already defined. Overwriting...`), bv.set(e, { ...jM, ...t }); 74767}, qfe = (e, t) => { 74768 CS.set(e, t); 74769}, x3 = (e, t) => { 74770 typeof t == "function" ? qfe(e, t) : S3(e, t); 74771}, Qfe = async (e) => { 74772 if (!bv.has(e)) { 74773 if (!CS.has(e)) 74774 throw new Error(`Locale ${e} is not defined`); 74775 const i = await /** @type {LocaleDefinitionResolver} */ 74776 CS.get(e)(); 74777 S3(e, i); 74778 } 74779 return ( 74780 /** @type {LocaleDefinition} */ 74781 bv.get(e) 74782 ); 74783}; 74784x3("en", jM); 74785const Tc = (e) => `*l10n/${e}`, Xfe = "en"; 74786class Jfe { 74787 /** 74788 * @private 74789 * @type {import('./Block.js').Block | null} 74790 */ 74791 _blockInstance = null; 74792 /** @private */ 74793 _localeName = ""; 74794 /** 74795 * @private 74796 * @type {Set<() => void>} 74797 */ 74798 _callbacks = /* @__PURE__ */ new Set(); 74799 /** 74800 * @private 74801 * @type {Map<import('./Block.js').Block, Map<string, () => void>>} 74802 */ 74803 _boundBlocks = /* @__PURE__ */ new Map(); 74804 /** @param {import('./Block.js').Block} blockInstance */ 74805 constructor(t) { 74806 this._blockInstance = t; 74807 for (let [i, s] of Object.entries(jM)) 74808 this._blockInstance.add(Tc(i), s, !1); 74809 setTimeout(() => { 74810 t.subConfigValue("localeName", async (i) => { 74811 if (!this._blockInstance || !i) 74812 return; 74813 this._localeName = i; 74814 const s = await Qfe(i); 74815 if (i !== Xfe && this._localeName !== i) 74816 return; 74817 const n = this._blockInstance.cfg.localeDefinitionOverride?.[i]; 74818 for (const [o, r] of Object.entries(s)) { 74819 const a = n?.[o]; 74820 this._blockInstance.add(Tc(o), a ?? r, !0); 74821 for (const l of this._callbacks) 74822 l(); 74823 } 74824 }), t.subConfigValue("localeDefinitionOverride", (i) => { 74825 if (!i) 74826 return; 74827 const s = i[this._localeName]; 74828 if (s) 74829 for (const [n, o] of Object.entries(s)) { 74830 this._blockInstance?.add(Tc(n), o, !0); 74831 for (const r of this._callbacks) 74832 r(); 74833 } 74834 }); 74835 }); 74836 } 74837 /** 74838 * @param {() => void} callback 74839 * @returns {() => void} 74840 */ 74841 onLocaleChange(t) { 74842 const i = wo(t, 0); 74843 return this._callbacks.add(i), () => { 74844 this._callbacks.delete(i); 74845 }; 74846 } 74847 /** 74848 * @param {import('./Block.js').Block} block 74849 * @param {string} key 74850 * @param {() => void} resolver 74851 */ 74852 bindL10n(t, i, s) { 74853 t.$[i] = s(), this._boundBlocks.has(t) || this._boundBlocks.set(t, /* @__P
74853URE__ */ new Map()), this._boundBlocks.get(t)?.get(i)?.(); 74854 const n = this.onLocaleChange(() => { 74855 t.$[i] = s(); 74856 }); 74857 this._boundBlocks.get(t)?.set(i, n); 74858 } 74859 /** @param {import('./Block.js').Block} block */ 74860 destroyL10nBindings(t) { 74861 const i = this._boundBlocks.get(t); 74862 if (i) { 74863 for (const s of i.values()) 74864 s(); 74865 this._boundBlocks.delete(t); 74866 } 74867 } 74868 destroy() { 74869 this._callbacks.clear(); 74870 } 74871} 74872function eme(e, t) { 74873 [...e.querySelectorAll("[l10n]")].forEach((i) => { 74874 let s = i.getAttribute("l10n"); 74875 if (!s) 74876 return; 74877 let n = "textContent", o = !1; 74878 if (s.includes(":")) { 74879 const l = s.split(":"); 74880 n = l[0], s = l[1], n.startsWith("@") && (n = n.slice(1), o = !0); 74881 } 74882 const r = s; 74883 t.has(r) && t.sub(r, (l) => { 74884 if (!l) 74885 return; 74886 t.l10nProcessorSubs.has(r) || t.l10nProcessorSubs.set(r, /* @__PURE__ */ new Set()); 74887 const c = t.l10nProcessorSubs.get(r); 74888 c?.forEach( 74889 /** @param {{ remove: () => void }} sub */ 74890 (p) => { 74891 p.remove(), c.delete(p), t.allSubs.delete(p); 74892 } 74893 ); 74894 const u = Tc(l).replace("*", ""); 74895 t.nodeCtx.has(u) || t.nodeCtx.add(u, l); 74896 const d = t.nodeCtx.sub(u, () => { 74897 i[ 74898 /** @type {'textContent'} */ 74899 n 74900 ] = t.l10n(l); 74901 }); 74902 c?.add(d), t.allSubs.add(d), i.removeAttribute("l10n"); 74903 }); 74904 const a = Tc(s); 74905 t.has(a) || t.add(a, ""), t.sub(a, () => { 74906 s = /** @type {string} */ 74907 s, o ? i.setAttribute(n, t.l10n(s)) : i[ 74908 /** @type {'textContent'} */ 74909 n 74910 ] = t.l10n(s); 74911 }), i.removeAttribute("l10n"); 74912 }); 74913} 74914const lo = (e) => `*cfg/${e}`, tme = { 74915 button: ["toolbar"], 74916 checkbox: ["toolbar"], 74917 menuitem: ["menu", "menubar"], 74918 option: ["listbox"], 74919 tab: ["tablist"] 74920}; 74921function Fh(e, t) { 74922 t.tabIndex = 0, t.focus(), e.tabIndex = -1; 74923} 74924function U0(e) { 74925 let t = e.role || e.type || e.tagName; 74926 if (!t) return null; 74927 let i = tme[t.toLowerCase()]; 74928 if (!i) return null; 74929 for (let s of i) { 74930 let n = e.closest(`[role=${s}]`); 74931 if (n) return n; 74932 } 74933} 74934function W0(e, t) { 74935 return t.role === "toolbar" ? ime(t) : t.querySelectorAll(`[role=${e.role}]`); 74936} 74937function ime(e) { 74938 return [...e.querySelectorAll("*")].filter((i) => i.role === "button" || i.type === "button" || i.role === "checkbox" || i.type === "checkbox"); 74939} 74940function sme(e) { 74941 let t = e.getAttribute("aria-orientation"); 74942 if (t === "vertical") return !1; 74943 if (t === "horizontal") return !0; 74944 let i = e.role; 74945 return i === "menubar" || i === "tablist" || i === "toolbar"; 74946} 74947function nme(e) { 74948 return (t) => { 74949 let i = !1, s = 300, n = 0, o = ""; 74950 function r(d) { 74951 let p = U0(d.target); 74952 if (!p) { 74953 a(); 74954 return; 74955 } 74956 let f = W0(d.target, p), m = Array.from(f).indexOf(d.target), y = "ArrowDown", b = "ArrowUp"; 74957 if (sme(p) && (t.document.dir === "rtl" ? (y = "ArrowLeft", b = "ArrowRight") : (y = "ArrowRight", b = "ArrowLeft")), d.key === y) 74958 d.preventDefault(), Fh(d.target, f[m + 1] || f[0]); 74959 else if (d.key === b) 74960 d.preventDefault(), Fh(d.target, f[m - 1] || f[f.length - 1]); 74961 else if (d.key === "Home") 74962 d.preventDefault(), Fh(d.target, f[0]); 74963 else if (d.key === "End") 74964 d.preventDefault(), Fh(d.target, f[f.length - 1]); 74965 else if (d.key.length === 1 && p.role !== "tablist") { 74966 let C = Date.now(); 74967 C - n <= s ? o += d.key.toLowerCase() : o = d.key.toLowerCase(), n = C; 74968 let w = Array.from(f).find((M) => M.textContent?.trim()?.toLowerCase()?.startsWith(o)); 74969 w && (d.preventDefault(), Fh(d.target, w)); 74970 } 74971 } 74972 function a() { 74973 i = !1, t.removeEventListener("keydown", r); 74974 } 74975 function l(d) { 74976 let p = U0(d.target); 74977 if (p) { 74978 i || (i = !0, t.addEventListener("keydown", r)); 74979 let f = W0(d.target, p); 74980 for (let m of f) 74981 m !== d.target && m.setAttribute("tabindex", -1); 74982 } else i && a(); 74983 } 74984 function c(d) { 74985 (!d.relatedTarget || d.relatedTarget === t.document) && a(); 74986 } 74987 function u(d) { 74988 let p = U0(d.target); 74989 if (p) { 74990 let f = W0(d.target, p); 74991 for (let m of f) 74992 m !== d.target && m.setAttribute("tabindex", -1); 74993 d.target.setAttribute("tabindex", 0); 74994 } 74995 } 74996 return t.addEventListener("click", u), t.addEventListener("focusin", l), t.addEventListener("focusout", c), () => { 74997 a(), t.removeEventListener("click", u), t.removeEventListener("focusin", l), t.removeEventListener("focusout", c); 74998 }; 74999 }; 75000} 75001function ome() { 75002 return (e) => { 75003 let t, i; 75004 function s(o) { 75005 if (o.target.getAttribute("aria-hidden") === "true") { 75006 t = o.target, t.setAttribute("aria-hidden", "false"), i = t.hidden, i && (t.hidden = !1); 75007 let r = o.target.querySelector(
75008 'a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])' 75009 ); 75010 r && (r.tabIndex = 0); 75011 } 75012 } 75013 function n(o) { 75014 t && t.contains(o.target) && (!o.relatedTarget || !t.contains(o.relatedTarget)) && (o.target.tabIndex = -1, t.setAttribute("aria-hidden", "true"), i && (t.hidden = !0), t = null); 75015 } 75016 return e.addEventListener("keyuxJump", s), e.addEventListener("focusout", n), () => { 75017 e.removeEventListener("keyuxJump", s), e.removeEventListener("focusout", n); 75018 }; 75019 }; 75020} 75021function rme() { 75022 return (e) => { 75023 let t = []; 75024 function i(l) { 75025 let c = e.document.activeElement; 75026 c && c !== e.document.body && t.push(new WeakRef(c)), l.focus({ focusVisible: !0 }); 75027 } 75028 function s() { 75029 let l = t.pop(); 75030 if (!l) { 75031 e.document.activeElement.blur(); 75032 return; 75033 } 75034 let c = l.deref(); 75035 c && c.isConnected ? c.focus() : s(); 75036 } 75037 let n = 0, o; 75038 function r(l) { 75039 clearInterval(o); 75040 let c = l.getAttribute("aria-controls"); 75041 o = setInterval(() => { 75042 if (n++ > 50) { 75043 clearInterval(o); 75044 return; 75045 } 75046 let u = e.document.getElementById(c); 75047 if (u) { 75048 let d = u.querySelector( 75049 'a, button, select, textarea, input:not([type=radio]), [type=radio]:checked, [tabindex]:not([tabindex="-1"])' 75050 ); 75051 d && (clearInterval(o), u.dispatchEvent( 75052 new e.CustomEvent("keyuxJump", { bubbles: !0 }) 75053 ), i(d)); 75054 } 75055 }, 50); 75056 } 75057 function a(l) { 75058 l.target.getAttribute("aria-controls") && l.key === "Enter" && r(l.target), l.key === "Escape" && s(); 75059 } 75060 return e.addEventListener("keydown", a), () => { 75061 e.removeEventListener("keydown", a); 75062 }; 75063 }; 75064} 75065function ame(e) { 75066 let t, i = e.split(" "), s; 75067 function n(a) { 75068 a.key === "Enter" && (a.target.tagName === "BUTTON" || a.target.tagName === "A") && (o(), a.target.classList.add(...i), t = a.target, s = a.target); 75069 } 75070 function o() { 75071 t && t.classList.remove(...i), s = null; 75072 } 75073 function r(a) { 75074 a.clientX === 0 && a.clientY === 0 && s !== a.target && (o(), a.target.classList.add(...i), t = a.target); 75075 } 75076 return (a) => (a.addEventListener("click", r), a.addEventListener("keydown", n), a.addEventListener("keyup", o), () => { 75077 a.removeEventListener("click", r), a.removeEventListener("keydown", n), a.removeEventListener("keyup", o); 75078 }); 75079} 75080function lme(e, t) { 75081 let i = t.map((s) => s(e)); 75082 return () => { 75083 i.forEach((s) => s()); 75084 }; 75085} 75086class cme { 75087 /** 75088 * @private 75089 * @type {Map<Function, (event: Event) => void>} 75090 */ 75091 _listeners = /* @__PURE__ */ new Map(); 75092 /** 75093 * @private 75094 * @type {Node[]} 75095 */ 75096 _scope = []; 75097 /** 75098 * @param {'keydown' | 'keyup'} type 75099 * @param {(event: Event) => void} listener 75100 */ 75101 addEventListener(t, i) { 75102 const s = (n) => { 75103 const o = n.target; 75104 o && this._scope.some((r) => r === n.target || r.contains( 75105 /** @type {Node} */ 75106 o 75107 )) && i(n); 75108 }; 75109 this._listeners.set(i, s), window.addEventListener(t, s); 75110 } 75111 /** 75112 * @param {'keydown' | 'keyup'} type 75113 * @param {(event: {}) => void} listener 75114 */ 75115 removeEventListener(t, i) { 75116 const s = this._listeners.get(i); 75117 s && window.removeEventListener(t, s), this._listeners.delete(i); 75118 } 75119 get CustomEvent() { 75120 return window.CustomEvent; 75121 } 75122 get document() { 75123 return window.document; 75124 } 75125 get navigator() { 75126 return window.navigator; 75127 } 75128 /** @param {Node} scope */ 75129 registerScope(t) { 75130 this._scope.push(t); 75131 } 75132 destroy() { 75133 this._scope = [], this._listeners.forEach((t, i) => { 75134 window.removeEventListener("keydown", t), window.removeEventListener("keyup", t), this._listeners.delete(i); 75135 }); 75136 } 75137} 75138class ume { 75139 /** 75140 * @private 75141 * @type {(() => void) | undefined} 75142 */ 75143 _destroyKeyUX; 75144 /** 75145 * @private 75146 * @type {ScopedMinimalWindow} 75147 */ 75148 _scopedWindow; 75149 constructor() { 75150 this._scopedWindow = new cme(), this._destroyKeyUX = lme(this._scopedWindow, [ 75151 nme(), 75152 ame("is-pressed"), 75153 rme(), 75154 ome() 75155 ]); 75156 } 75157 /** @param {import('./Block.js').Block} scope */ 75158 registerBlock(t) { 75159 this._scopedWindow.registerScope(t); 75160 } 75161 destroy() { 75162 this._destroyKeyUX?.(), this._scopedWindow.destroy(); 75163 } 75164} 75165const dme = "uc-"; 75166class Ti extends Lg { 75167 /** @type {string | null} */ 75168 static StateConsumerScope = null; 75169 /** @type {string[]} */ 75170 static styleAttrs = []; 75171 /** @protected */ 75172 requireCtxName = !1; 75173 /** @type {import('./ActivityBlock.js').ActivityType} */ 75174 activityType = null; 75175 init$ = C3(); 75176 /** 75177 * @param {String} str 75178 * @param {{ [key: string]: string | number }} variables 75179 * @returns {String} 75180 */ 75181 l10n(t, i = {}) { 75182 if (!t) 75183 return ""; 75184 let s = this.$[Tc(t)] || t, n = Bge(s); 75185 for (let r of n) 75186 i[r.variable] = this.pluralize( 75187 r.pluralKey, 75188 Number(i[r.countVariable]) 75189 ); 75190 return vS(s, i); 75191 } 75192 /** 75193 * @private 75194 * @param {string} key 75195 * @param {number} count 75196 * @returns {string} 75197 */ 75198 pluralize(t, i) { 75199 const s = this.l10n("locale-id") || "en", n = o3(s, i); 75200 return this.l10n(`${t}__${n}`); 75201 } 75202 /** 75203 * @param {string} key 75204 * @param {() => void} resolver 75205 * @protected 75206 */ 75207 bindL10n(t, i) { 75208 this.localeManager?.bindL10n(this, t, i); 75209 } 75210 constructor() { 75211 super(), this.l10nProcessorSubs = /* @__PURE__ */ new Map(), this.addTemplateProcessor(eme); 75212 } 75213 /** 75214 * @param {Parameters<import('../blocks/UploadCtxProvider/EventEmitter.js').EventEmitter['emit']>[0]} type 75215 * @param {Parameters<import('../blocks/UploadCtxProvider/EventEmitter.js').EventEmitter['emit']>[1]} [payload] 75216 * @param {Parameters<import('../blocks/UploadCtxProvider/EventEmitter.js').EventEmitter['emit']>[2]} [options] 75217 */ 75218 emit(t, i, s) { 75219 const n = this.has("*eventEmitter") && this.$["*eventEmitter"]; 75220 n && n.emit(t, i, s); 75221 } 75222 /** 75223 * @param {(block: Block) => boolean} callback 75224 * @returns {Boolean} 75225 */ 75226 hasBlockInCtx(t) { 75227 for (let i of this.blocksRegistry) 75228 if (t(i)) 75229 return !0; 75230 return !1; 75231 } 75232 /** 75233 * @param {String} prop 75234 * @param {any} newVal 75235 */ 75236 setOrAddState(t, i) { 75237 this.add$( 75238 { 75239 [t]: i 75240 }, 75241 !0 75242 ); 75243 } 75244 /** @protected */ 75245 connectedCallback() { 75246 /** @type {typeof Block} */
75247 this.constructor.styleAttrs.forEach((i) => { 75248 this.setAttribute(i, ""); 75249 }), this.hasAttribute("retpl") && (this.constructor.template = null, this.processInnerHtml = !0), this.requireCtxName ? Gge({ 75250 element: this, 75251 attribute: "ctx-name", 75252 onSuccess: () => { 75253 super.connectedCallback(); 75254 }, 75255 onTimeout: () => { 75256 console.error("Attribute `ctx-name` is required and it is not set."); 75257 } 75258 }) : super.connectedCallback(), UT.registerClient(this); 75259 } 75260 /** @protected */ 75261 disconnectedCallback() { 75262 super.disconnectedCallback(), UT.unregisterClient(this); 75263 } 75264 /** @protected */ 75265 initCallback() { 75266 this.has("*blocksRegistry") || this.add("*blocksRegistry", /* @__PURE__ */ new Set()), this.$["*blocksRegistry"].add(this), this.has("*eventEmitter") || this.add("*eventEmitter", new Oge(this.debugPrint.bind(this))), this.has("*localeManager") || this.add("*localeManager", new Jfe(this)), this.has("*a11y") || this.add("*a11y", new ume()), this.sub(Tc("locale-id"), (i) => { 75267 const s = Nge(i); 75268 this.style.direction = s === "ltr" ? "" : s; 75269 }); 75270 } 75271 /** 75272 * @private 75273 * @returns {LocaleManager | null} 75274 */ 75275 get localeManager() { 75276 return this.has("*localeManager") ? this.$["*localeManager"] : null; 75277 } 75278 /** 75279 * @returns {A11y | null} 75280 * @protected 75281 */ 75282 get a11y() { 75283 return this.has("*a11y") ? this.$["*a11y"] : null; 75284 } 75285 /** @type {Set<Block>} */ 75286 get blocksRegistry() { 75287 return this.$["*blocksRegistry"]; 75288 } 75289 /** @protected */ 75290 destroyCallback() { 75291 super.destroyCallback(); 75292 let t = this.blocksRegistry; 75293 t?.delete(this), this.localeManager?.destroyL10nBindings(this), this.l10nProcessorSubs = /* @__PURE__ */ new Map(), $t.deleteCtx(this), t?.size === 0 && setTimeout(() => { 75294 this.destroyCtxCallback(); 75295 }, 0); 75296 } 75297 /** 75298 * Called when the last block is removed from the context. Note that inheritors must run their callback before that. 75299 * 75300 * @protected 75301 */ 75302 destroyCtxCallback() { 75303 $t.deleteCtx(this.ctxName), this.localeManager?.destroy(); 75304 } 75305 /** 75306 * @param {String} url 75307 * @returns {Promise<String>} 75308 * @protected 75309 */ 75310 async proxyUrl(t) { 75311 if (this.cfg.secureDeliveryProxy && this.cfg.secureDeliveryProxyUrlResolver && console.warn( 75312 "Both secureDeliveryProxy and secureDeliveryProxyUrlResolver are set. The secureDeliveryProxyUrlResolver will be used." 75313 ), this.cfg.secureDeliveryProxyUrlResolver) 75314 try { 75315 return await this.cfg.secureDeliveryProxyUrlResolver(t, { 75316 uuid: X_(t), 75317 cdnUrlModifiers: J_(t), 75318 fileName: NM(t) 75319 }); 75320 } catch (i) { 75321 return console.error("Failed to resolve secure delivery proxy URL. Falling back to the default URL.", i), t; 75322 } 75323 return this.cfg.secureDeliveryProxy ? vS( 75324 this.cfg.secureDeliveryProxy, 75325 { previewUrl: t }, 75326 { transform: (i) => window.encodeURIComponent(i) } 75327 ) : t; 75328 } 75329 /** @returns {import('../types').ConfigType} } */ 75330 get cfg() { 75331 if (!this.__cfgProxy) { 75332 let t = /* @__PURE__ */ Object.create(null); 75333 this.__cfgProxy = new Proxy(t, { 75334 set: (i, s, n) => { 75335 if (typeof s != "string") 75336 return !1; 75337 const o = lo( 75338 /** @type {keyof import('../types').ConfigType} */ 75339 s 75340 ); 75341 return this.has(o) || this.add(o, yl[ 75342 /** @type {keyof import('../types').ConfigType} */ 75343 s 75344 ]), this.$[o] = n, !0; 75345 }, 75346 /** 75347 * @param {never} obj 75348 * @param {keyof import('../types').ConfigType} key 75349 */ 75350 get: (i, s) => { 75351 const n = lo(s); 75352 return this.has(n) || this.add(n, yl[s]), this.$[lo(s)]; 75353 } 75354 }); 75355 } 75356 return this.__cfgProxy; 75357 } 75358 /** 75359 * @template {keyof import('../types').ConfigType} T 75360 * @param {T} key 75361 * @param {(value: import('../types').ConfigType[T]) => void} callback 75362 */ 75363 subConfigValue(t, i) { 75364 const s = lo(t); 75365 this.has(s) || this.add(s, yl[t]), this.sub(s, i); 75366 } 75367 /** @param {unknown[]} args */ 75368 debugPrint(...t) { 75369 if (!this.cfg.debug) 75370 return; 75371 let i = t; 75372 if (typeof t?.[0] == "function") { 75373 const s = t[0]; 75374 i = s(); 75375 } 75376 console.log(`[${this.ctxName}]`, ...i); 75377 } 75378 /** @param {String} [name] */ 75379 static reg(t) { 75380 if (!t) { 75381 super.reg(); 75382 return; 75383 } 75384 t.startsWith(dme) && super.reg(t); 75385 } 75386} 75387const hme = "<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 24 24' id='uc-icon-about' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.152 14.12v.1h1.523v-.1c.007-.409.053-.752.138-1.028.086-.277.22-.517.405-.72.188-.202.434-.397.735-.586.32-.191.593-.412.82-.66.232-.249.41-.531.533-.847.125-.32.187-.678.187-1.076 0-.579-.137-1.085-.41-1.518a2.717 2.717 0 0 0-1.14-1.018c-.49-.245-1.062-.367-1.71
753875-.367-.597 0-1.142.114-1.636.34-.49.228-.884.564-1.182 1.008-.299.44-.46.98-.485 1.619h1.62c.024-.377.118-.684.282-.922a1.48 1.48 0 0 1 .617-.532c.25-.114.51-.17.784-.17.301 0 .575.063.82.191.248.124.447.302.597.533.149.23.223.504.223.82 0 .263-.05.502-.149.72a1.91 1.91 0 0 1-.405.574 3.48 3.48 0 0 1-.575.453 4.22 4.22 0 0 0-.847.66c-.234.242-.415.558-.543.949-.125.39-.19.916-.197 1.577Zm.053 3.03c.21.206.46.31.75.31.196 0 .374-.049.534-.144a1.1 1.1 0 0 0 .383-.384c.1-.163.15-.343.15-.538a1 1 0 0 0-.32-.746 1.019 1.019 0 0 0-.746-.314c-.291 0-.542.105-.751.314-.21.206-.314.455-.314.746 0 .295.104.547.314.756ZM24 12c0 6.627-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0s12 5.373 12 12Zm-1.5 0c0 5.799-4.701 10.5-10.5 10.5S1.5 17.799 1.5 12 6.201 1.5 12 1.5 22.5 6.201 22.5 12Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-add' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.75 21a.75.75 0 0 1-1.5 0v-8.25H3a.75.75 0 0 1 0-1.5h8.25V3a.75.75 0 0 1 1.5 0v8.25H21a.75.75 0 0 1 0 1.5h-8.25V21Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-arrow-down' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.5 23.03a.75.75 0 0 0 .999 0l9.29-8.276a.75.75 0 0 0-.998-1.12l-8.042 7.164V1.53a.75.75 0 0 0-1.5 0v19.267l-8.04-7.163a.75.75 0 0 0-.998 1.12z
vendor: 15,962 bytes, line 75387
75387'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-back' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M20.251 12a.75.75 0 0 1-.75.75H6.067l5.72 5.85a.75.75 0 1 1-1.072 1.05L4.136 12.92a1.292 1.292 0 0 1 0-1.842l6.579-6.728a.75.75 0 1 1 1.072 1.048l-5.72 5.851H19.5a.75.75 0 0 1 .75.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.6 18.4a1.6 1.6 0 1 1-3.2 0 1.6 1.6 0 0 1 3.2 0zM12 4.5A1.5 1.5 0 0 1 13.5 6v7a1.5 1.5 0 0 1-3 0V6A1.5 1.5 0 0 1 12 4.5z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-badge-success' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m10.5 18.204 7.6-8.183a1.5 1.5 0 0 0-2.2-2.042l-5.4 5.817-2.4-2.586a1.5 1.5 0 1 0-2.2 2.041l4.6 4.953Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-box' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M1.01 4.148a.75.75 0 0 1 .75.75v4.348a4.437 4.437 0 0 1 2.988-1.153c1.734 0 3.23.992 3.978 2.438a4.478 4.478 0 0 1 3.978-2.438c2.49 0 4.488 2.044 4.488 4.543 0 2.5-1.999 4.544-4.488 4.544a4.478 4.478 0 0 1-3.978-2.438 4.478 4.478 0 0 1-3.978 2.438C2.26 17.18.26 15.135.26 12.636V4.898a.75.75 0 0 1 .75-.75Zm.75 8.488c0 1.692 1.348 3.044 2.988 3.044s2.989-1.352 2.989-3.044c0-1.691-1.349-3.043-2.989-3.043S1.76 10.945 1.76 12.636Zm10.944-3.043c-1.64 0-2.988 1.352-2.988 3.043 0 1.692 1.348 3.044 2.988 3.044s2.988-1.352 2.988-3.044c0-1.69-1.348-3.043-2.988-3.043Zm4.328-1.23a.75.75 0 0 1 1.052.128l2.333 2.983 2.333-2.983a.75.75 0 0 1 1.181.924l-2.562 3.277 2.562 3.276a.75.75 0 1 1-1.181.924l-2.333-2.983-2.333 2.983a.75.75 0 1 1-1.181-.924l2.562-3.276-2.562-3.277a.75.75 0 0 1 .129-1.052Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.65 2.55a.75.75 0 0 1 .6-.3h7.5a.75.75 0 0 1 .6.3l2.025 2.7H21a3 3 0 0 1 3 3v10.5a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h2.625zm.975 1.2L6.6 6.45a.75.75 0 0 1-.6.3H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V8.25a1.5 1.5 0 0 0-1.5-1.5h-3a.75.75 0 0 1-.6-.3l-2.025-2.7zm3.375 6a3.375 3.375 0 1 0 0 6.75 3.375 3.375 0 0 0 0-6.75zm-4.875 3.375a4.875 4.875 0 1 1 9.75 0 4.875 4.875 0 0 1-9.75 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-camera-full' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M2 4.667a2 2 0 0 0-2 2V16a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.667a2 2 0 0 0-2-2h-2.667l-2-2.667H6.667l-2 2.667H2Zm8 10a3.667 3.667 0 1 0 0-7.334 3.667 3.667 0 0 0 0 7.334Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-close' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M4.604 4.604a.75.75 0 0 1 1.06 0L12 10.939l6.335-6.335a.75.75 0 1 1 1.061 1.06L13.061 12l6.335 6.335a.75.75 0 1 1-1.06 1.061L12 13.061l-6.335 6.335a.75.75 0 0 1-1.061-1.06L10.939 12 4.604 5.665a.75.75 0 0 1 0-1.061z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-collapse' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3.116 12a.75.75 0 0 1 .75-.75h16.268a.75.75 0 0 1 0 1.5H3.866a.75.75 0 0 1-.75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-default' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-dropbox' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.019 1.92a.75.75 0 0 1 .806 0L12 5.219l5.176-3.297a.75.75 0 0 1 .806 0l5.577 3.553a.75.75 0 0 1 0 1.265l-4.574 2.914 4.574 2.914a.75.75 0 0 1 0 1.265l-5.577 3.554a.75.75 0 0 1-.806 0L12 14.089l-5.175 3.297a.75.75 0 0 1-.806 0L.44 13.833a.75.75 0 0 1 0-1.266l4.575-2.914L.44 6.74a.75.75 0 0 1 0-1.265zm.403 8.616L2.24 13.2l4.182 2.664 4.181-2.664zm6.975 2.664 4.182 2.664L21.76 13.2l-4.181-2.664zm2.776-3.547L12 12.311 7.828 9.653 12 6.995zm1.406-.882 4.181-2.664-4.181-2.664-4.182 2.664zm-6.976-2.664L6.422 3.443 2.24 6.107 6.422 8.77zM5.791 18.544a.75.75 0 0 1 1.035-.23l5.175 3.297 5.175-3.297a.75.75 0 1 1 .806 1.265l-5.578 3.554a.75.75 0 0 1-.806 0L6.02 19.579a.75.75 0 0 1-.23-1.035z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-evernote' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M9.804 2.27v-.048c.055-.263.313-.562.85-.562h.44c.142 0 .325.014.526.033.066.009.124.023.267.06l.13.032h.002c.319.079.515.275.644.482a1.461 1.461 0 0 1 .16.356l.004.012a.75.75 0 0 0 .603.577l1.191.207a1988.512 1988.512 0 0 0 2.332.402c.512.083 1.1.178 1.665.442.64.3 1.19.795 1.376 1.77.548 2.931.657 5.829.621 8a39.233 39.233 0 0 1-.125 2.602 17.518 17.518 0 0 1-.092.849.735.735 0 0 0-.024.112c-.378 2.705-1.269 3.796-2.04 4.27-.746.457-1.53.451-2.217.447h-.192c-.46 0-1.073-.23-1.581-.635-.518-.412-.763-.87-.763-1.217 0-.45.188-.688.355-.786.161-.095.436-.137.796.087a.75.75 0 1 0 .792-1.274c-.766-.476-1.64-.52-2.345-.108-.7.409-1.098 1.188-1.098 2.08 0 .996.634 1.84 1.329 2.392.704.56 1.638.96 2.515.96l.185.002c.667.009 1.874.025 3.007-.67 1.283-.786 2.314-2.358 2.733-5.276a4.213 4.213 0 0 0 .056-.335c.023-.184.051-.445.079-.772.055-.655.111-1.585.13-2.704.037-2.234-.074-5.239-.647-8.301v-.002c-.294-1.544-1.233-2.391-2.215-2.85-.777-.363-1.623-.496-2.129-.576a8.872 8.872 0 0 1-.25-.041l-.006-.001-1.99-.345-.761-.132a2.93 2.93 0 0 0-.182-.338A2.532 2.532 0 0 0 12.379.329l-.091-.023a3.967 3.967 0 0 0-.493-.103L11.769.2a7.846 7.846 0 0 0-.675-.04h-.44c-.733 0-1.368.284-1.795.742L2.416 7.431c-.468.428-.751 1.071-.751 1.81 0 .02 0 .041.003.062l.003.034c.017.21.038.468.096.796.107.715.275 1.47.391 1.994.029.13.055.245.075.342l.002.008c.258 1.141.641 1.94.978 2.466.168.263.323.456.444.589a2.808 2.808 0 0 0 .192.194c1.536 1.562 3.713 2.196 5.731 2.08.13-.005.35-.032.537-.073a2.627 2.627 0 0 0 .652-.24c.425-.26.75-.661.992-1.046.184-.294.342-.61.473-.915a3.8 3.8 0 0 0 .627.493 5.022 5.022 0 0 0 1.97.709l.023.002.018.003.11.016c.088.014.205.035.325.058l.056.014c.088.022.164.04.235.061a1.736 1.736 0 0 1 .145.048l.03.014c.765.34 1.302 1.09 1.302 1.871a.75.75 0 0 0 1.5 0c0-1.456-.964-2.69-2.18-3.235a3.595 3.595 0 0 0-.679-.217l-.063-.015a10.616 10.616 0 0 0-.606-.105l-.02-.003-.03-.003h-.002a3.542 3.542 0 0 1-1.331-.485c-.471-.298-.788-.692-.828-1.234a.75.75 0 0 0-1.48-.106l-.001.003-.004.017a8.23 8.23 0 0 1-.092.352 9.963 9.963 0 0 1-.298.892c-.132.34-.29.68-.47.966-.174.276-.339.454-.478.549a1.178 1.178 0 0 1-.221.072 1.949 1.949 0 0 1-.241.036h-.013l-.032.002c-1.684.1-3.423-.437-4.604-1.65a.746.746 0 0 0-.053-.05L4.84 14.6a1.348 1.348 0 0 1-.07-.073 2.99 2.99 0 0 1-.293-.392c-.242-.379-.558-1.014-.778-1.985a54.1 54.1 0 0 0-.083-.376 27.494 27.494 0 0 1-.367-1.872l-.003-.02a6.791 6.791 0 0 1-.08-.67c.004-.277.086-.475.2-.609l.067-.067a.63.63 0 0 1 .292-.145h.05c.18 0 1.095.055 2.013.115l1.207.08.534.037a.747.747 0 0 0 .052.002c.782 0 1.349-.206 1.759-.585l.005-.005c.553-.52.622-1.225.622-1.76V6.24l-.026-.565A774.97 774.97 0 0 1 9.885 4.4c-.042-.961-.081-1.939-.081-2.13ZM4.995 6.953a251.126 251.126 0 0 1 2.102.137l.508.035c.48-.004.646-.122.715-.185.07-.068.146-.209.147-.649l-.024-.548a791.69 791.69 0 0 1-.095-2.187L4.995 6.953Zm16.122 9.996Zm-5.479-5.323a.75.75 0 0 0 1.014.31 2.04 2.04 0 0 1 .304-.089 1.84 1.84 0 0 1 .544-.039c.215.023.321.06.37.085.033.016.039.026.047.04a.75.75 0 0 0 1.289-.767c-.337-.567-.906-.783-1.552-.85a3.334 3.334 0 0 0-1.002.062c-.27.056-.531.14-.705.234a.75.75 0 0 0-.31 1.014Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-expand' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m12 8.337-8.47 8.47a.75.75 0 0 1-1.06-1.06l8.605-8.606a1.29 1.29 0 0 1 1.85 0l8.605 8.605a.75.75 0 1 1-1.06 1.06L12 8.338Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-external-source-placeholder' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-facebook' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12 1.5C6.201 1.5 1.5 6.201 1.5 12c0 4.943 3.416 9.089 8.016 10.204v-6.108H7.383a.75.75 0 0 1-.75-.75v-3.281a.75.75 0 0 1 .75-.75h2.133V9.393c0-.958.225-2.511 1.38-3.65 1.194-1.177 3.174-1.718 6.254-1.056a.75.75 0 0 1 .592.733v2.754a.75.75 0 0 1-.75.75c-.692 0-1.203.026-1.584.082-.387.057-.578.137-.675.202-.109.073-.237.205-.237 1.029v1.078h2.39a.75.75 0 0 1 .742.866l-.516 3.281a.75.75 0 0 1-.74.634h-1.876v6.106C19.09 21.082 22.5 16.939 22.5 12c0-5.799-4.701-10.5-10.5-10.5zM0 12C0 5.373 5.373 0 12 0s12 5.373 12 12c0 5.995-4.395 10.961-10.138 11.856a.75.75 0 0 1-.866-.74v-7.77a.75.75 0 0 1 .75-.75h1.984l.28-1.781h-2.264a.75.75 0 0 1-.75-.75v-1.828c0-.829.089-1.729.9-2.274.363-.244.807-.37 1.293-.441a9.623 9.623 0 0 1 1.053-.086V6.04c-2.41-.405-3.645.132-4.293.771-.737.728-.933 1.793-.933 2.582v2.672a.75.75 0 0 1-.75.75H8.133v1.78h2.133a.75.75 0 0 1 .75.75v7.772a.75.75 0 0 1-.865.741C4.4 22.968 0 18 0 12z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M2.895 1.201c0-.473.383-.857.857-.857h8.4c.227 0 .445.09.606.251l8.4 8.4c.16.16.25.379.25.606v13.2a.857.857 0 0 1-.856.857h-16.8a.857.857 0 0 1-.857-.857zm1.714.857v19.886h15.085V10.458h-7.542a.857.857 0 0 1-.858-.857V2.058zm8.4 1.213 5.473 5.473H13.01z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-flickr' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M5.959 7.926c-2.298 0-4.14 1.834-4.14 4.073 0 2.241 1.842 4.075 4.14 4.075 2.302 0 4.145-1.834 4.145-4.075 0-2.238-1.843-4.073-4.145-4.073Zm-5.64 4.073c0-3.086 2.533-5.573 5.64-5.573 3.11 0 5.645 2.486 5.645 5.573 0 3.089-2.535 5.575-5.645 5.575-3.107 0-5.64-2.487-5.64-5.575Zm18.07-4.073c-2.301 0-4.144 1.835-4.144 4.073 0 2.24 1.843 4.075 4.145 4.075 2.299 0 4.141-1.834 4.141-4.075 0-2.239-1.842-4.073-4.141-4.073Zm-5.644 4.073c0-3.087 2.535-5.573 5.645-5.573 3.108 0 5.641 2.487 5.641 5.573 0 3.088-2.533 5.575-5.641 5.575-3.11 0-5.645-2.486-5.645-5.575Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gdrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M7.736 1.818a.75.75 0 0 1 .647-.37h7.587a.75.75 0 0 1 .655.383l7.233 12.946a.75.75 0 0 1-.003.737l-3.794 6.66a.75.75 0 0 1-.651.378H4.59a.75.75 0 0 1-.651-.378l-3.794-6.66a.75.75 0 0 1 .005-.75zm.64 1.876L1.663 15.148l2.93 5.145 6.655-11.581zm3.736 6.526-2.398 4.173H14.5zm4.116 4.173h5.697L15.53 2.947H9.677zm5.685 1.5H8.852l-2.966 5.16h13.088z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-gphotos' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M12.51 0c-.702 0-1.272.57-1.272 1.273V7.35A6.381 6.381 0 0 0 0 11.489c0 .703.57 1.273 1.273 1.273H7.35A6.381 6.381 0 0 0 11.488 24c.704 0 1.274-.57 1.274-1.273V16.65A6.381 6.381 0 0 0 24 12.51c0-.703-.57-1.273-1.273-1.273H16.65A6.381 6.381 0 0 0 12.511 0Zm.252 11.232V1.53a4.857 4.857 0 0 1 0 9.702Zm-1.53.006H1.53a4.857 4.857 0 0 1 9.702 0Zm1.536 1.524a4.857 4.857 0 0 0 9.702 0h-9.702Zm-6.136 4.857c0-2.598 2.04-4.72 4.606-4.85v9.7a4.857 4.857 0 0 1-4.606-4.85Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-huddle' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.204 2.002c-.252.23-.357.486-.357.67V21.07c0 .15.084.505.313.812.208.28.499.477.929.477.519 0 .796-.174.956-.365.178-.212.286-.535.286-.924v-.013l.117-6.58c.004-1.725 1.419-3.883 3.867-3.883 1.33 0 2.332.581 2.987 1.364.637.762.95 1.717.95 2.526v6.47c0 .392.11.751.305.995.175.22.468.41 1.008.41.52 0 .816-.198 1.002-.437.207-.266.31-.633.31-.969V14.04c0-2.81-1.943-5.108-4.136-5.422a5.971 5.971 0 0 0-3.183.41c-.912.393-1.538.96-1.81 1.489a.75.75 0 0 1-1.417-.344v-7.5c0-.587-.47-1.031-1.242-1.031-.315 0-.638.136-.885.36ZM5.194.892A2.844 2.844 0 0 1 7.09.142c1.328 0 2.742.867 2.742 2.53v5.607a6.358 6.358 0 0 1 1.133-.629 7.47 7.47 0 0 1 3.989-.516c3.056.436 5.425 3.482 5.425 6.906v6.914c0 .602-.177 1.313-.627 1.89-.47.605-1.204 1.016-2.186 1.016-.96 0-1.698-.37-2.179-.973-.46-.575-.633-1.294-.633-1.933v-6.469c0-.456-.19-1.071-.602-1.563-.394-.471-.986-.827-1.836-.827-1.447 0-2.367 1.304-2.367 2.39v.014l-.117 6.58c-.001.64-.177 1.333-.637 1.881-.48.57-1.2.9-2.105.9-.995 0-1.7-.5-2.132-1.081-.41-.552-.61-1.217-.61-1.708V2.672c0-.707.366-1.341.847-1.78Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-info' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-local' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M3 3.75a1.5 1.5 0 0 0-1.5 1.5v13.5a1.5 1.5 0 0 0 1.5 1.5h18a1.5 1.5 0 0 0 1.5-1.5V9A1.5 1.5 0 0 0 21 7.5h-9a.75.75 0 0 1-.643-.364L9.325 3.75zm-3 1.5a3 3 0 0 1 3-3h6.75a.75.75 0 0 1 .643.364L12.425 6H21a3 3 0 0 1 3 3v9.75a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0v6.469a4.5 4.5 0 1 1-9 0V4.781Zm4.5-3a3 3 0 0 0-3 3v6.469a3 3 0 1 0 6 0V4.781a3 3 0 0 0-3-3Zm-8.156 8.11a.75.75 0 0 1 .75.75 7.406 7.406 0 1 0 14.812 0 .75.75 0 0 1 1.5 0 8.907 8.907 0 0 1-8.156 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.907 8.907 0 0 1-8.156-8.875.75.75 0 0 1 .75-.75Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-microphone-mute' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M7.5 4.781a4.5 4.5 0 0 1 9 0V6l3.524-3.524a.75.75 0 1 1 1.061 1.06L5.036 19.585a.75.75 0 0 1-1.06-1.06l1.656-1.657a8.88 8.88 0 0 1-2.538-6.227.75.75 0 0 1 1.5 0c0 2.009.8 3.83 2.1 5.166l1.771-1.772A4.483 4.483 0 0 1 7.5 11.25V4.781Zm2.037 8.182L15 7.5V4.781a3 3 0 1 0-6 0v6.469c0 .637.198 1.227.537 1.713Zm10.62-3.072a.75.75 0 0 1 .75.75 8.907 8.907 0 0 1-8.157 8.875v2.703h3.258a.75.75 0 1 1 0 1.5H7.992a.75.75 0 0 1 0-1.5h3.258v-2.703a8.855 8.855 0 0 1-3.035-.811.75.75 0 1 1 .638-1.358 7.406 7.406 0 0 0 10.553-6.707.75.75 0 0 1 .75-.75ZM15 10.81a.75.75 0 0 1 1.5 0v.439a4.5 4.5 0 0 1-5 4.473.75.75 0 1 1 .166-1.491A3 3 0 0 0 15 11.25v-.44Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-
75387onedrive' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13.616 4.147a7.689 7.689 0 0 0-7.642 3.285A6.299 6.299 0 0 0 1.455 17.3c.684.894 2.473 2.658 5.17 2.658h12.141c.95 0 1.882-.256 2.697-.743.815-.486 1.514-1.247 1.964-2.083a5.26 5.26 0 0 0-3.713-7.612 7.69 7.69 0 0 0-6.098-5.373ZM3.34 17.15c.674.63 1.761 1.308 3.284 1.308h12.142a3.76 3.76 0 0 0 2.915-1.383l-7.494-4.489L3.34 17.15Zm10.875-6.25 2.47-1.038a5.239 5.239 0 0 1 1.427-.389 6.19 6.19 0 0 0-10.3-1.952 6.338 6.338 0 0 1 2.118.813l4.285 2.567Zm4.55.033c-.512 0-1.019.104-1.489.307l-.006.003-1.414.594 6.521 3.906a3.76 3.76 0 0 0-3.357-4.8l-.254-.01ZM4.097 9.617A4.799 4.799 0 0 1 6.558 8.9c.9 0 1.84.25 2.587.713l3.4 2.037-10.17 4.28a4.799 4.799 0 0 1 1.721-6.312Z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-pause' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' d='M1 0h2.5v10H1zM6.5 0H9v10H6.5z'/></symbol><symbol fill='none' viewBox='0 0 10 10' id='uc-icon-play' xmlns='http://www.w3.org/2000/svg'><path d='m1 0 9 5-9 5V0Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-remove-file' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.955 3.3A2.969 2.969 0 0 0 8.998 6h5.914a2.97 2.97 0 0 0-2.957-2.7zM16.416 6a4.47 4.47 0 0 0-8.922 0h-2.32a.755.755 0 0 0-.111.008H3.075a.75.75 0 1 0 0 1.5h1.35V19.35a2.85 2.85 0 0 0 2.85 2.85h9.45a2.85 2.85 0 0 0 2.85-2.85V7.508h1.35a.75.75 0 0 0 0-1.5h-1.989A.754.754 0 0 0 18.825 6zM5.925 7.508V19.35a1.35 1.35 0 0 0 1.35 1.35h9.45a1.35 1.35 0 0 0 1.35-1.35V7.508z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-select' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='m7 10 5 5 5-5H7Z'/></symbol><symbol fill='none' viewBox='0 0 20 20' id='uc-icon-square' xmlns='http://www.w3.org/2000/svg'><rect width='20' height='20' rx='4' fill='#fff'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M11.501.392a.75.75 0 0 1 .998 0l6.704 5.972a.75.75 0 0 1-.998 1.12l-5.455-4.86v13.439a.75.75 0 0 1-1.5 0V2.625l-5.454 4.86a.75.75 0 1 1-.998-1.12zM.857 16.73a.75.75 0 0 1 .75.75v4.914h20.786v-4.914a.75.75 0 0 1 1.5 0v5.664a.75.75 0 0 1-.75.75H.857a.75.75 0 0 1-.75-.75v-5.664a.75.75 0 0 1 .75-.75z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-upload-error' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2Z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-url' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M19.11 3.67c-1.71-1.709-4.578-1.682-6.408.148l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221C14.018.381 17.836.276 20.17 2.61l1.22 1.22c2.335 2.334 2.23 6.153-.147 8.529l-2.22 2.22a.75.75 0 0 1-1.062-1.06l2.222-2.221c1.83-1.83 1.856-4.698.147-6.408zm-3.36 4.58a.75.75 0 0 1 0 1.06l-6.439 6.44a.75.75 0 0 1-1.06-1.06l6.439-6.44a.75.75 0 0 1 1.06 0zM6.04 9.42a.75.75 0 0 1 0 1.061l-2.222 2.222c-1.83 1.83-1.856 4.698-.147 6.407l1.22 1.22c1.71 1.71 4.578 1.683 6.408-.147l2.221-2.221a.75.75 0 1 1 1.06 1.06l-2.22 2.222c-2.377 2.376-6.195 2.481-8.53.147l-1.22-1.22c-2.334-2.334-2.228-6.153.148-8.53l2.221-2.22a.75.75 0 0 1 1.06 0z'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-video-camera' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' clip-rule='evenodd' d='M0 6.75a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v1.078L22.873 5A.75.75 0 0 1 24 5.648v12.704a.75.75 0 0 1-1.123.65L18 16.207v1.043a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V6.75Zm18 7.728 4.5 2.58V6.95L18 9.562v4.916ZM16.5 6.75a1.5 1.5 0 0 0-1.5-1.5H3a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h12a1.5 1.5 0 0 0 1.5-1.5V6.75Z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-video-camera-full' xmlns='http://www.w3.org/2000/svg'><path d='M2 3.333a2 2 0 0 0-2 2v9.334a2 2 0 0 0 2 2h10.938a2 2 0 0 0 2-2v-2.013L20 15.646V4.354l-5.063 3.03v-2.05a2 2 0 0 0-2-2H2Z' fill='currentColor'/></symbol><symbol viewBox='0 0 24 24' id='uc-icon-vk' xmlns='http://www.w3.org/2000/svg'><path fill='currentColor' fill-rule='evenodd' d='M6.341 3.27a10.5 10.5 0 0 1 5.834-1.77.75.75 0 0 0 0-1.5 12 12 0 1 0 12 12 .75.75 0 0 0-1.5 0A10.5 10.5 0 1 1 6.34 3.27Zm14.145 1.48a.75.75 0 1 0-1.06-1.062L9.925 13.19V7.95a.75.75 0 1 0-1.5 0V15c0 .414.336.75.75.75h7.05a.75.75 0 0 0 0-1.5h-5.24l9.501-9.5Z'/></symbol></svg>"; 75388class dC extends Ti {
75389 static styleAttrs = ["uc-wgt-common"]; 75390 requireCtxName = !0; 75391 init$ = w3(this); 75392 _template = null; 75393 initCallback() { 75394 super.initCallback(), this.a11y?.registerBlock(this); 75395 } 75396 static set template(t) { 75397 this._template = hme + t + /** HTML */ 75398 "<slot></slot>"; 75399 } 75400 static get template() { 75401 return this._template; 75402 } 75403} 75404const KT = "active", Oh = "___ACTIVITY_IS_ACTIVE___"; 75405class gt extends Ti { 75406 /** @protected */ 75407 historyTracked = !1; 75408 init$ = b3(this); 75409 _debouncedHistoryFlush = wo(this._historyFlush.bind(this), 10); 75410 /** @private */ 75411 _deactivate() { 75412 let t = gt._activityCallbacks.get(this); 75413 this[Oh] = !1, this.removeAttribute(KT), t?.deactivateCallback?.(); 75414 } 75415 /** @private */ 75416 _activate() { 75417 let t = gt._activityCallbacks.get(this); 75418 this.$["*historyBack"] = this.historyBack.bind(this), this[Oh] = !0, this.setAttribute(KT, ""), t?.activateCallback?.(), this._debouncedHistoryFlush(), this.emit(Ni.ACTIVITY_CHANGE, { 75419 activity: this.activityType 75420 }); 75421 } 75422 /** @protected */ 75423 initCallback() { 75424 super.initCallback(), this.hasAttribute("current-activity") && this.sub("*currentActivity", (t) => { 75425 this.setAttribute("current-activity", t); 75426 }), this.activityType && (this.hasAttribute("activity") || this.setAttribute("activity", this.activityType), this.sub("*currentActivity", (t) => { 75427 try { 75428 this.activityType !== t && this[Oh] ? this._deactivate() : this.activityType === t && !this[Oh] && this._activate(); 75429 } catch (i) { 75430 console.error(`Error in activity "${this.activityType}". `, i), this.$["*currentActivity"] = this.$["*history"][this.$["*history"].length - 1] ?? null; 75431 } 75432 t || (this.$["*history"] = []); 75433 }), this.has("*modalActive") && this.sub("*modalActive", (t) => { 75434 !t && this.activityType === this.$["*currentActivity"] && (this.$["*currentActivity"] = null); 75435 })); 75436 } 75437 /** @private */ 75438 _historyFlush() { 75439 let t = this.$["*history"]; 75440 t && (t.length > 10 && (t = t.slice(t.length - 11, t.length - 1)), this.historyTracked && t[t.length - 1] !== this.activityType && t.push(this.activityType), this.$["*history"] = t); 75441 } 75442 /** @private */ 75443 _isActivityRegistered() { 75444 return this.activityType && gt._activityCallbacks.has(this); 75445 } 75446 /** 75447 * @private 75448 * @type {Map< 75449 * ActivityBlock, 75450 * { activateCallback: (() => void) | undefined; deactivateCallback: (() => void) | undefined } 75451 * >} 75452 */ 75453 static _activityCallbacks = /* @__PURE__ */ new Map(); 75454 get isActivityActive() { 75455 return this[Oh]; 75456 } 75457 get couldOpenActivity() { 75458 return !0; 75459 } 75460 /** 75461 * TODO: remove name argument 75462 * 75463 * @param {String} name 75464 * @param {Object} [options] 75465 * @param {() => void} [options.onActivate] 75466 * @param {() => void} [options.onDeactivate] 75467 */ 75468 registerActivity(t, i = {}) { 75469 const { onActivate: s, onDeactivate: n } = i; 75470 gt._activityCallbacks.set(this, { 75471 activateCallback: s, 75472 deactivateCallback: n 75473 }); 75474 } 75475 unregisterActivity() { 75476 this.isActivityActive && this._deactivate(), gt._activityCallbacks.delete(this); 75477 } 75478 /** @protected */ 75479 destroyCallback() { 75480 super.destroyCallback(), this._isActivityRegistered() && this.unregisterActivity(); 75481 const t = this.$["*currentActivity"]; 75482 [...this.blocksRegistry].find( 75483 (s) => s instanceof gt && s.activityType === t 75484 ) || (this.$["*currentActivity"] = null, this.setOrAddState("*modalActive", !1)); 75485 } 75486 get activityKey() { 75487 return this.ctxName + this.activityType; 75488 } 75489 /** @type {ActivityParamsMap[keyof ActivityParamsMap]} */ 75490 get activityParams() { 75491 return this.$["*currentActivityParams"]; 75492 } 75493 /** @type {String} */ 75494 get initActivity() { 75495 return this.getCssData("--cfg-init-activity"); 75496 } 75497 /** @type {String} */ 75498 get doneActivity() { 75499 return this.getCssData("--cfg-done-activity"); 75500 } 75501 historyBack() { 75502 let t = this.$["*history"]; 75503 if (t) { 75504 let i = t.pop(); 75505 for (; i === this.activityType; ) 75506 i = t.pop(); 75507 let s = !!i; 75508 i && (s = /** @type {ActivityBlock} */ 75509 [...this.blocksRegistry].find((o) => o.activityType === i)?.couldOpenActivity ?? !1), i = s ? i : void 0, this.$["*currentActivity"] = i, this.$["*history"] = t, i || this.setOrAddState("*modalActive", !1); 75510 } 75511 } 75512} 75513gt.activities = Object.freeze({ 75514 START_FROM: "start-from", 75515 CAMERA: "camera", 75516 DRAW: "draw",
75517 UPLOAD_LIST: "upload-list", 75518 URL: "url", 75519 CLOUD_IMG_EDIT: "cloud-image-edit", 75520 EXTERNAL: "external" 75521}); 75522const pme = 20, bS = 24, Yh = 34, M3 = 3, ur = M3 / 2, uc = 1, Xf = 100 / 3, vt = 1, ZT = 24, gme = 6; 75523function zu(e, t) { 75524 for (let i in t) e.setAttributeNS(null, i, t[i].toString()); 75525} 75526function Fo(e, t = {}) { 75527 let i = document.createElementNS("http://www.w3.org/2000/svg", e); 75528 return zu(i, t), i; 75529} 75530function fme(e, t, i) { 75531 let { x: s, y: n, width: o, height: r } = e, a = t.includes("w") ? 0 : 1, l = t.includes("n") ? 0 : 1, c = [-1, 1][a], u = [-1, 1][l], d = [ 75532 s + a * o + ur * c, 75533 n + l * r + ur * u - bS * i * u 75534 ], p = [s + a * o + ur * c, n + l * r + ur * u], f = [ 75535 s + a * o - bS * i * c + ur * c, 75536 n + l * r + ur * u 75537 ]; 75538 return { 75539 d: `M ${d[0]} ${d[1]} L ${p[0]} ${p[1]} L ${f[0]} ${f[1]}`, 75540 center: p 75541 }; 75542} 75543function mme(e, t, i) { 75544 let { x: s, y: n, width: o, height: r } = e, a = ["n", "s"].includes(t) ? 0.5 : { w: 0, e: 1 }[ 75545 /** @type {Extract<import('./types.js').Direction, 'w' | 'e'>} */ 75546 t 75547 ], l = ["w", "e"].includes(t) ? 0.5 : { n: 0, s: 1 }[ 75548 /** @type {Extract<import('./types.js').Direction, 'n' | 's'>} */ 75549 t 75550 ], c = [-1, 1][a], u = [-1, 1][l], d, p; 75551 ["n", "s"].includes(t) ? (d = [s + a * o - Yh * i / 2, n + l * r + ur * u], p = [s + a * o + Yh * i / 2, n + l * r + ur * u]) : (d = [s + a * o + ur * c, n + l * r - Yh * i / 2], p = [s + a * o + ur * c, n + l * r + Yh * i / 2]); 75552 let f = `M ${d[0]} ${d[1]} L ${p[0]} ${p[1]}`, m = [p[0] - (p[0] - d[0]) / 2, p[1] - (p[1] - d[1]) / 2]; 75553 return { d: f, center: m }; 75554} 75555function vme(e) { 75556 return e === "" ? "move" : ["e", "w"].includes(e) ? "ew-resize" : ["n", "s"].includes(e) ? "ns-resize" : ["nw", "se"].includes(e) ? "nwse-resize" : "nesw-resize"; 75557} 75558function yme({ rect: e, delta: [t, i], imageBox: s }) { 75559 return wv( 75560 { 75561 ...e, 75562 x: e.x + t, 75563 y: e.y + i 75564 }, 75565 s 75566 ); 75567} 75568function wv(e, t) { 75569 let { x: i } = e, { y: s } = e; 75570 return e.x < t.x ? i = t.x : e.x + e.width > t.x + t.width && (i = t.x + t.width - e.width), e.y < t.y ? s = t.y : e.y + e.height > t.y + t.height && (s = t.y + t.height - e.height), { 75571 ...e, 75572 x: i, 75573 y: s 75574 }; 75575} 75576function Cme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75577 const [, n] = t; 75578 let { y: o, width: r, height: a } = e; 75579 o += n, a -= n, i && (r = a * i); 75580 let l = e.x + e.width / 2 - r / 2; 75581 return o <= s.y && (o = s.y, a = e.y + e.height - o, i && (r = a * i, l = e.x + e.width / 2 - r / 2)), l <= s.x && (l = s.x, o = e.y + e.height - a), l + r >= s.x + s.width && (l = Math.max(s.x, s.x + s.width - r), r = s.x + s.width - l, i && (a = r / i), o = e.y + e.height - a), a < vt && (a = vt, i && (r = a * i, l = e.x + e.width / 2 - r / 2), o = e.y + e.height - a), r < vt && (r = vt, i && (a = r / i, l = e.x + e.width / 2 - r / 2), o = e.y + e.height - a), { x: l, y: o, width: r, height: a }; 75582} 75583function bme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75584 const [n] = t; 75585 let { x: o, width: r, height: a } = e; 75586 o += n, r -= n, i && (a = r / i); 75587 let l = e.y + e.height / 2 - a / 2; 75588 return o <= s.x && (o = s.x, r = e.x + e.width - o, i && (a = r / i, l = e.y + e.height / 2 - a / 2)), l <= s.y && (l = s.y, o = e.x + e.width - r), l + a >= s.y + s.height && (l = Math.max(s.y, s.y + s.height - a), a = s.y + s.height - l, i && (r = a * i), o = e.x + e.width - r), a < vt && (a = vt, i && (r = a * i), l = e.y + e.height / 2 - a / 2, o = e.x + e.width - r), r < vt && (r = vt, i && (a = r / i), l = e.y + e.height / 2 - a / 2, o = e.x + e.width - r), { x: o, y: l, width: r, height: a }; 75589} 75590function wme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75591 const [, n] = t; 75592 let { y: o, width: r, height: a } = e; 75593 a += n, i && (r = a * i); 75594 let l = e.x + e.width / 2 - r / 2; 75595 return o + a >= s.y + s.height && (a = s.y + s.height - o, i && (r = a * i), l = e.x + e.width / 2 - r / 2), l <= s.x && (l = s.x, o = e.y), l + r >= s.x + s.width && (l = Math.max(s.x, s.x + s.width - r), r = s.x + s.width - l, i && (a = r / i), o = e.y), a < vt && (a = vt, i && (r = a * i), l = e.x + e.width / 2 - r / 2), r < vt && (r = vt, i && (a = r / i), l = e.x + e.width / 2 - r / 2), { x: l, y: o, width: r, height: a }; 75596} 75597function Sme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75598 const [n] = t; 75599 let { x: o, width: r, height: a } = e; 75600 r += n, i && (a = r / i); 75601 let l = e.y + e.height / 2 - a / 2; 75602 return o + r >= s.x + s.width && (r = s.x + s.width - o, i && (a = r / i), l = e.y + e.height / 2 - a / 2), l <= s.y && (l = s.y, o = e.x), l + a >= s.y + s.height && (l = Math.max(s.y, s.y + s.height - a), a = s.y + s.height - l, i && (r = a * i), o = e.x), a < vt && (a = vt, i && (r = a * i), l = e.y + e.height / 2 - a / 2), r < vt && (r = vt, i && (a = r / i), l = e.y + e.height / 2 - a / 2), { x: o, y: l, width: r, height: a }; 75603} 75604function xme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75605 let [n, o] = t, { x: r, y: a, width: l, height: c } = e; 75606 return r + n < s.x && (n = s.x - r), a + o < s.y && (o = s.y - a), r += n, l -= n, a += o, c
vendor: 4,269 bytes, lines 75606-75690
75606-= o, i && Math.abs(l / c) > i ? (o = l / i - c, c += o, a -= o, a <= s.y && (c = c - (s.y - a), l = c * i, r = e.x + e.width - l, a = s.y)) : i && (n = c * i - l, l = l + n, r -= n, r <= s.x && (l = l - (s.x - r), c = l / i, r = s.x, a = e.y + e.height - c)), c < vt && (c = vt, i && (l = c * i), r = e.x + e.width - l, a = e.y + e.height - c), l < vt && (l = vt, i && (c = l / i), r = e.x + e.width - l, a = e.y + e.height - c), { x: r, y: a, width: l, height: c }; 75607} 75608function Mme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75609 let [n, o] = t, { x: r, y: a, width: l, height: c } = e; 75610 return r + l + n > s.x + s.width && (n = s.x + s.width - r - l), a + o < s.y && (o = s.y - a), l += n, a += o, c -= o, i && Math.abs(l / c) > i ? (o = l / i - c, c += o, a -= o, a <= s.y && (c = c - (s.y - a), l = c * i, r = e.x, a = s.y)) : i && (n = c * i - l, l += n, r + l >= s.x + s.width && (l = s.x + s.width - r, c = l / i, r = s.x + s.width - l, a = e.y + e.height - c)), c < vt && (c = vt, i && (l = c * i), a = e.y + e.height - c), l < vt && (l = vt, i && (c = l / i), a = e.y + e.height - c), { x: r, y: a, width: l, height: c }; 75611} 75612function Ame({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75613 let [n, o] = t, { x: r, y: a, width: l, height: c } = e; 75614 return r + n < s.x && (n = s.x - r), a + c + o > s.y + s.height && (o = s.y + s.height - a - c), r += n, l -= n, c += o, i && Math.abs(l / c) > i ? (o = l / i - c, c += o, a + c >= s.y + s.height && (c = s.y + s.height - a, l = c * i, r = e.x + e.width - l, a = s.y + s.height - c)) : i && (n = c * i - l, l += n, r -= n, r <= s.x && (l = l - (s.x - r), c = l / i, r = s.x, a = e.y)), c < vt && (c = vt, i && (l = c * i), r = e.x + e.width - l), l < vt && (l = vt, i && (c = l / i), r = e.x + e.width - l), { x: r, y: a, width: l, height: c }; 75615} 75616function Dme({ rect: e, delta: t, aspectRatio: i, imageBox: s }) { 75617 let [n, o] = t, { x: r, y: a, width: l, height: c } = e; 75618 return r + l + n > s.x + s.width && (n = s.x + s.width - r - l), a + c + o > s.y + s.height && (o = s.y + s.height - a - c), l += n, c += o, i && Math.abs(l / c) > i ? (o = l / i - c, c += o, a + c >= s.y + s.height && (c = s.y + s.height - a, l = c * i, r = e.x, a = s.y + s.height - c)) : i && (n = c * i - l, l += n, r + l >= s.x + s.width && (l = s.x + s.width - r, c = l / i, r = s.x + s.width - l, a = e.y)), c < vt && (c = vt, i && (l = c * i)), l < vt && (l = vt, i && (c = l / i)), { x: r, y: a, width: l, height: c }; 75619} 75620function Eme({ direction: e, ...t }) { 75621 switch (e) { 75622 case "n": 75623 return Cme(t); 75624 case "w": 75625 return bme(t); 75626 case "s": 75627 return wme(t); 75628 case "e": 75629 return Sme(t); 75630 case "nw": 75631 return xme(t); 75632 case "ne": 75633 return Mme(t); 75634 case "sw": 75635 return Ame(t); 75636 case "se": 75637 return Dme(t); 75638 default: 75639 return t.rect; 75640 } 75641} 75642function Ime(e, [t, i]) { 75643 return e.x <= t && t <= e.x + e.width && e.y <= i && i <= e.y + e.height; 75644} 75645function Rme(e, t) { 75646 return e.x >= t.x && e.y >= t.y && e.x + e.width <= t.x + t.width && e.y + e.height <= t.y + t.height; 75647} 75648function Tme(e, t) { 75649 return Math.abs(e.width / e.height - t) < 0.1; 75650} 75651function Nh({ width: e, height: t }, i) { 75652 let s = i / 90 % 2 !== 0; 75653 return { width: s ? t : e, height: s ? e : t }; 75654} 75655function Lme(e, t, i) { 75656 const s = e / t; 75657 let n, o; 75658 s > i ? (n = Math.round(t * i), o = t) : (n = e, o = Math.round(e / i)); 75659 const r = Math.round((e - n) / 2), a = Math.round((t - o) / 2); 75660 return r + n > e && (n = e - r), a + o > t && (o = t - a), { x: r, y: a, width: n, height: o }; 75661} 75662function Am(e) { 75663 return { 75664 x: Math.round(e.x), 75665 y: Math.round(e.y), 75666 width: Math.round(e.width), 75667 height: Math.round(e.height) 75668 }; 75669} 75670function Qu(e, t, i) { 75671 return Math.min(Math.max(e, t), i); 75672} 75673const A3 = (e) => { 75674 if (!e) return []; 75675 const [t, i] = e.split(":").map(Number); 75676 if (!Number.isFinite(t) || !Number.isFinite(i)) { 75677 console.error(`Invalid crop preset: ${e}`); 75678 return; 75679 } 75680 return [{ type: "aspect-ratio", width: t, height: i }]; 75681}, hC = "blocks", pC = "1.12.0"; 75682function kme(e) { 75683 return l3({ 75684 ...e, 75685 libraryName: hC, 75686 libraryVersion: pC 75687 }); 75688} 75689const qT = (e) => Math.floor(e / 1e3), Pme = (e, { threshold: t }) => { 75690 const { secureExpire: i }
75690 = e, s = qT(Date.now()), n = Number(i), o = qT(t); 75691 return s + o >= n; 75692}; 75693class Fme { 75694 /** 75695 * @private 75696 * @type {import('./UploaderBlock.js').UploaderBlock} 75697 */ 75698 _block; 75699 /** 75700 * @private 75701 * @type {import('../types').SecureUploadsSignatureAndExpire | null} 75702 */ 75703 _secureToken = null; 75704 /** @param {import('./UploaderBlock.js').UploaderBlock} block */ 75705 constructor(t) { 75706 this._block = t; 75707 } 75708 /** 75709 * @private 75710 * @param {unknown[]} args 75711 */ 75712 _debugPrint(...t) { 75713 this._block.debugPrint("[secure-uploads]", ...t); 75714 } 75715 /** @returns {Promise<import('../types').SecureUploadsSignatureAndExpire | null>} */ 75716 async getSecureToken() { 75717 const { secureSignature: t, secureExpire: i, secureUploadsSignatureResolver: s } = this._block.cfg; 75718 if ((t || i) && s && console.warn( 75719 "Both secureSignature/secureExpire and secureUploadsSignatureResolver are set. secureUploadsSignatureResolver will be used." 75720 ), s) { 75721 if (!this._secureToken || Pme(this._secureToken, { threshold: this._block.cfg.secureUploadsExpireThreshold })) { 75722 this._secureToken ? this._debugPrint("Secure signature is expired. Resolving a new one...") : this._debugPrint("Secure signature is not set yet."); 75723 try { 75724 const n = await s(); 75725 n ? !n.secureSignature || !n.secureExpire ? console.error("Secure signature resolver returned an invalid result:", n) : (this._debugPrint("Secure signature resolved:", n), this._debugPrint( 75726 "Secure signature will expire in", 75727 new Date(Number(n.secureExpire) * 1e3).toISOString() 75728 ), this._secureToken = n) : (this._debugPrint("Secure signature resolver returned nothing."), this._secureToken = null); 75729 } catch (n) { 75730 console.error("Secure signature resolving failed. Falling back to the previous one.", n); 75731 } 75732 } 75733 return this._secureToken; 75734 } 75735 return t && i ? (this._debugPrint("Secure signature and expire are set. Using them...", { 75736 secureSignature: t, 75737 secureExpire: i 75738 }), { 75739 secureSignature: t, 75740 secureExpire: i 75741 }) : null; 75742 } 75743} 75744const QT = "[Typed State] Wrong property name: ", Ome = "[Typed State] Wrong property type: "; 75745class Nme { 75746 /** 75747 * @param {Object<string, { type: any; value: any; nullable?: Boolean }>} typedSchema 75748 * @param {String} [ctxName] 75749 */ 75750 constructor(t, i) { 75751 this.__typedSchema = t, this.__ctxId = i || iC.generate(), this.__schema = Object.keys(t).reduce((s, n) => (s[n] = t[n].value, s), {}), this.__data = $t.registerCtx(this.__schema, this.__ctxId); 75752 } 75753 /** @returns {String} */ 75754 get uid() { 75755 return this.__ctxId; 75756 } 75757 /** 75758 * @param {String} prop 75759 * @param {any} value 75760 */ 75761 setValue(t, i) { 75762 if (!this.__typedSchema.hasOwnProperty(t)) { 75763 console.warn(QT + t); 75764 return; 75765 } 75766 let s = this.__typedSchema[t]; 75767 if (i?.constructor === s.type || i instanceof s.type || s.nullable && i === null) { 75768 this.__data.pub(t, i); 75769 return; 75770 } 75771 console.warn(Ome + t); 75772 } 75773 /** @param {Object<string, any>} updObj */ 75774 setMultipleValues(t) { 75775 for (let i in t) 75776 this.setValue(i, t[i]); 75777 } 75778 /** @param {String} prop */ 75779 getValue(t) { 75780 if (!this.__typedSchema.hasOwnProperty(t)) { 75781 console.warn(QT + t); 75782 return; 75783 } 75784 return this.__data.read(t); 75785 } 75786 /** 75787 * @param {String} prop 75788 * @param {(newVal: any) => void} handler 75789 */ 75790 subscribe(t, i) { 75791 return this.__data.sub(t, i); 75792 } 75793 remove() { 75794 $t.deleteCtx(this.__ctxId); 75795 } 75796} 75797class _me { 75798 /** 75799 * @param {Object} options 75800 * @param {Object<string, { type: any; value: any }>} options.typedSchema 75801 * @param {String[]} [options.watchList] 75802 * @param {(list: string[], added: Set<any>, removed: Set<any>) => void} [options.handler] 75803 * @param {String} [options.ctxName] 75804 */ 75805 constructor(t) { 75806 this.__typedSchema = t.typedSchema, this.__ctxId = t.ctxName || iC.generate(), this.__data = $t.registerCtx({}, this.__ctxId), this.__watchList = t.watchList || [], this.__subsMap = /* @__PURE__ */ Object.create(null), this.__propertyObservers = /* @__PURE__ */ new Set(), this.__collectionObservers = /* @__PURE__ */ new Set(), this.__items = /* @__PURE__ */ new Set(), this.__removed = /* @__PURE__ */ new Set(), this.__added = /* @__PURE__ */ new Set(); 75807 let i = /* @__PURE__ */ Object.create(null); 75808 this.__notifyObservers = (s, n) => { 75809 this.__observeTimeout && window.clearTimeout(this.__observeTimeout), i[s] || (i[s] = /* @__PURE__ */ new Set()), i[s].add(n), this.__observeTimeout = window.setTimeout(() => { 75810 Object.keys(i).length !== 0 && (this.__propertyObservers.forEac
75810h((o) => { 75811 o({ ...i }); 75812 }), i = /* @__PURE__ */ Object.create(null)); 75813 }); 75814 }; 75815 } 75816 notify() { 75817 this.__notifyTimeout && window.clearTimeout(this.__notifyTimeout), this.__notifyTimeout = window.setTimeout(() => { 75818 let t = new Set(this.__added), i = new Set(this.__removed); 75819 this.__added.clear(), this.__removed.clear(); 75820 for (const s of this.__collectionObservers) 75821 s?.([...this.__items], t, i); 75822 }); 75823 } 75824 /** @param {(list: string[], added: Set<any>, removed: Set<any>) => void} handler */ 75825 observeCollection(t) { 75826 return this.__collectionObservers.add(t), this.__items.size > 0 && this.notify(), () => { 75827 this.unobserveCollection(t); 75828 }; 75829 } 75830 /** @param {Function} handler */ 75831 unobserveCollection(t) { 75832 this.__collectionObservers?.delete(t); 75833 } 75834 /** 75835 * @param {Object<string, any>} init 75836 * @returns {string} 75837 */ 75838 add(t) { 75839 let i = new Nme(this.__typedSchema); 75840 for (let s in t) 75841 i.setValue(s, t[s]); 75842 return this.__items.add(i.uid), this.notify(), this.__data.add(i.uid, i), this.__added.add(i), this.__watchList.forEach((s) => { 75843 this.__subsMap[i.uid] || (this.__subsMap[i.uid] = []), this.__subsMap[i.uid].push( 75844 i.subscribe(s, () => { 75845 this.__notifyObservers(s, i.uid); 75846 }) 75847 ); 75848 }), i.uid; 75849 } 75850 /** 75851 * @param {String} id 75852 * @returns {TypedData} 75853 */ 75854 read(t) { 75855 return this.__data.read(t); 75856 } 75857 /** 75858 * @param {String} id 75859 * @param {String} propName 75860 * @returns {any} 75861 */ 75862 readProp(t, i) { 75863 return this.read(t).getValue(i); 75864 } 75865 /** 75866 * @template T 75867 * @param {String} id 75868 * @param {String} propName 75869 * @param {T} value 75870 */ 75871 publishProp(t, i, s) { 75872 this.read(t).setValue(i, s); 75873 } 75874 /** @param {String} id */ 75875 remove(t) { 75876 this.__removed.add(this.__data.read(t)), this.__items.delete(t), this.notify(), this.__data.pub(t, null), delete this.__subsMap[t]; 75877 } 75878 clearAll() { 75879 this.__items.forEach((t) => { 75880 this.remove(t); 75881 }); 75882 } 75883 /** @param {Function} handler */ 75884 observeProperties(t) { 75885 return this.__propertyObservers.add(t), () => { 75886 this.unobserveProperties(t); 75887 }; 75888 } 75889 /** @param {Function} handler */ 75890 unobserveProperties(t) { 75891 this.__propertyObservers?.delete(t); 75892 } 75893 /** 75894 * @param {(item: TypedData) => Boolean} checkFn 75895 * @returns {String[]} 75896 */ 75897 findItems(t) { 75898 let i = []; 75899 return this.__items.forEach((s) => { 75900 let n = this.read(s); 75901 t(n) && i.push(s); 75902 }), i; 75903 } 75904 items() { 75905 return [...this.__items]; 75906 } 75907 get size() { 75908 return this.__items.size; 75909 } 75910 destroy() { 75911 $t.deleteCtx(this.__ctxId), this.__propertyObservers = null, this.__collectionObservers = null; 75912 for (let t in this.__subsMap) 75913 this.__subsMap[t].forEach((i) => { 75914 i.remove(); 75915 }), delete this.__subsMap[t]; 75916 } 75917} 75918const gC = Object.freeze({ 75919 FACEBOOK: "facebook", 75920 DROPBOX: "dropbox", 75921 GDRIVE: "gdrive", 75922 GPHOTOS: "gphotos", 75923 FLICKR: "flickr", 75924 VK: "vk", 75925 EVERNOTE: "evernote", 75926 BOX: "box", 75927 ONEDRIVE: "onedrive", 75928 HUDDLE: "huddle" 75929}), bs = Object.freeze({ 75930 LOCAL: "local", 75931 DROP_AREA: "drop-area", 75932 CAMERA: "camera", 75933 EXTERNAL: "external", 75934 API: "js-api", 75935 URL: "url", 75936 DRAW: "draw", 75937 ...gC 75938}), $M = [ 75939 "image/*", 75940 "image/heif", 75941 "image/heif-sequence", 75942 "image/heic", 75943 "image/heic-sequence", 75944 "image/avif", 75945 "image/avif-sequence", 75946 ".heif", 75947 ".heifs", 75948 ".heic", 75949 ".heics", 75950 ".avif", 75951 ".avifs" 75952], D3 = (e) => e ? e.filter((t) => typeof t == "string").map((t) => El(t)).flat() : [], E3 = (e, t) => t.some((i) => i.endsWith("*") ? (i = i.replace("*", ""), e.startsWith(i)) : e === i), Bme = (e, t) => t.some((i) => i.startsWith(".") ? e.toLowerCase().endsWith(i.toLowerCase()) : !1), Gme = (e) => { 75953 let t = e?.type; 75954 return t ? E3(t, $M) : !1; 75955}, zme = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i, Hme = new RegExp(`^/?(${zme.source})(?:/(-/(?:[^/]+/)+)?([^/]*))?$`, "i"), Vme = ({ url: e, cdnBase: t }) => { 75956 const i = new URL(t), s = new URL(e); 75957 if (i.host !== s.host) 75958 return null; 75959 const [, n, o, r] = Hme.exec(s.pathname); 75960 return { 75961 uuid: n, 75962 cdnUrlModifiers: o || "", 75963 filename: r || null 75964 }; 75965}, Ume = (e) => { 75966 const t = /* @__PURE__ */ new Map(); 75967 return ( 75968 /** @type {T} */ 75969 ((...i) => { 75970 const s = JSON.stringify(i); 75971 if (t.has(s)) 75972 return t.get(s); 75973 const n = e(...i); 75974 return t.set(s, n), n; 75975 }) 75976 ); 75977}, XT = /* @__PURE__ */ new Set(); 75978function Wme(e) {
75979 XT.has(e) || (XT.add(e), console.warn(e)); 75980} 75981function jme(e) { 75982 let t = !1; 75983 return setTimeout(() => { 75984 t = !0; 75985 }, 0), (s) => ( 75986 /** @type {T} */ 75987 ((...n) => (t && Wme(e), s(...n))) 75988 ); 75989} 75990function $me(e) { 75991 const t = { 75992 /** @returns {number} */ 75993 progress: () => e.$["*commonProgress"], 75994 /** @returns {ReturnType<import('../types').OutputErrorFile>[]} */ 75995 errors: () => e.$["*collectionErrors"], 75996 /** @returns {import('@uploadcare/upload-client').UploadcareGroup | null} */ 75997 group: () => e.$["*groupInfo"], 75998 totalCount: () => e.uploadCollection.size, 75999 failedCount: () => i.failedEntries.length, 76000 successCount: () => i.successEntries.length, 76001 uploadingCount: () => i.uploadingEntries.length, 76002 status: () => i.isFailed ? "failed" : i.isUploading ? "uploading" : i.isSuccess ? "success" : "idle", 76003 isSuccess: () => i.allEntries.length > 0 && i.errors.length === 0 && i.successEntries.length === i.allEntries.length, 76004 isUploading: () => i.allEntries.some((n) => n.status === "uploading"), 76005 isFailed: () => i.errors.length > 0 || i.failedEntries.length > 0, 76006 allEntries: () => e.getOutputData(), 76007 successEntries: () => i.allEntries.filter((n) => n.status === "success"), 76008 failedEntries: () => i.allEntries.filter((n) => n.status === "failed"), 76009 uploadingEntries: () => i.allEntries.filter((n) => n.status === "uploading"), 76010 idleEntries: () => i.allEntries.filter((n) => n.status === "idle") 76011 }, i = ( 76012 /** @type {import('../index.js').OutputCollectionState<TCollectionStatus, TGroupFlag>} */ 76013 /** @type {unknown} */ 76014 {} 76015 ), s = jme( 76016 "You're trying to access the OutputCollectionState asynchronously. In this case, the data you retrieve will be newer than it was when the OutputCollectionState was created or when the event was dispatched. If you want to retain the state at a specific moment in time, you should use the spread operator like this: `{...outputCollectionState}` or `{...e.detail}`" 76017 ); 76018 for (const [n, o] of Object.entries(t)) { 76019 const r = ( 76020 /** @type {keyof typeof getters} */ 76021 n 76022 ), l = Ume(s( 76023 /** @type {(typeof getters)[name]} */ 76024 o 76025 )); 76026 Object.defineProperty(i, r, { 76027 get: l, 76028 enumerable: !0 76029 }); 76030 } 76031 return i; 76032} 76033class Yme { 76034 /** 76035 * @private 76036 * @type {import('./UploaderBlock.js').UploaderBlock} 76037 */ 76038 _ctx; 76039 /** @param {import('./UploaderBlock.js').UploaderBlock} ctx */ 76040 constructor(t) { 76041 this._ctx = t; 76042 } 76043 /** @private */ 76044 get _uploadCollection() { 76045 return this._ctx.uploadCollection; 76046 } 76047 get cfg() { 76048 return this._ctx.cfg; 76049 } 76050 get l10n() { 76051 return this._ctx.l10n.bind(this._ctx); 76052 } 76053 /** 76054 * TODO: Probably we should not allow user to override `source` property 76055 * 76056 * @param {string} url 76057 * @param {{ silent?: boolean; fileName?: string; source?: string }} [options] 76058 * @returns {import('../types').OutputFileEntry<'idle'>} 76059 */ 76060 addFileFromUrl = (t, { silent: i, fileName: s, source: n } = {}) => { 76061 const o = this._uploadCollection.add({ 76062 externalUrl: t, 76063 fileName: s ?? null, 76064 silent: i ?? !1, 76065 source: n ?? bs.API 76066 }); 76067 return this.getOutputItem(o); 76068 }; 76069 /** 76070 * @param {string} uuid 76071 * @param {{ silent?: boolean; fileName?: string; source?: string }} [options] 76072 * @returns {import('../types').OutputFileEntry<'idle'>} 76073 */ 76074 addFileFromUuid = (t, { silent: i, fileName: s, source: n } = {}) => { 76075 const o = this._uploadCollection.add({ 76076 uuid: t, 76077 fileName: s ?? null, 76078 silent: i ?? !1, 76079 source: n ?? bs.API 76080 }); 76081 return this.getOutputItem(o); 76082 }; 76083 /** 76084 * @param {string} cdnUrl 76085 * @param {{ silent?: boolean; fileName?: string; source?: string }} [options] 76086 * @returns {import('../types').OutputFileEntry<'idle'>} 76087 */ 76088 addFileFromCdnUrl = (t, { silent: i, fileName: s, source: n } = {}) => { 76089 const o = Vme({ url: t, cdnBase: this.cfg.cdnCname }); 76090 if (!o) 76091 throw new Error("Invalid CDN URL"); 76092 const r = this._uploadCollection.add({ 76093 uuid: o.uuid, 76094 cdnUrl: t, 76095 cdnUrlModifiers: o.cdnUrlModifiers, 76096 fileName: s ?? o.filename ?? null, 76097 silent: i ?? !1, 76098 source: n ?? bs.API 76099 }); 76100 return this.getOutputItem(r); 76101 }; 76102 /** 76103 * @param {File} file 76104 * @param {{ silent?: boolean; fileName?: string; source?: string; fullPath?: string }} [options] 76105 * @returns {import('../types').OutputFileEntry<'idle'>} 76106 */ 76107 addFileFromObject = (t, { silent: i, fileName: s, source: n, fullPath: o } = {}) => { 76108 const r = this._uploadCollection.add({ 76109 file: t, 76110 isImage: Gme(t), 76111 mimeType: t.type, 76112 fileName: s ?? t.name, 76113 fileSize: t.size, 76114 silent: i ?? !1, 76115 source: n ?? bs.API, 76116 fullPath: o ?? null 76117 }); 76118 return this.getOutputItem(r); 76119 }; 76120 /** @param {string} internalId */ 76121 removeFileByInternalId = (t) => { 76122 if (!this._uploadCollection.read(t)) 76123 throw new Error(`File with internalId ${t} not found`); 76124 this._uploadCollection.remove(t); 76125 }; 76126 removeAllFiles() { 76127 this._uploadCollection.clearAll(); 76128 } 76129 uploadAll = () => { 76130 const t = this._uploadCollection.items().filter((i) => { 76131 const s = this._uploadCollection.read(i); 76132 return !s.getValue("isRemoved") && !s.getValue("isUploading") && !s.getValue("fileInfo"); 76133 }); 76134 t.length !== 0 && (this._ctx.$["*uploadTrigger"] = new Set(t), this._ctx.emit( 76135 Ni.COMMON_UPLOAD_START, 76136 /** @type {import('../types').OutputCollectionState<'uploading'>} */ 76137 this.getOutputCollectionState() 76138 )); 76139 };
76140 /** @param {{ captureCamera?: boolean }} options */ 76141 openSystemDialog = (t = {}) => { 76142 const i = _M( 76143 D3([this.cfg.accept ?? "", ...this.cfg.imgOnly ? $M : []]) 76144 ); 76145 this.cfg.accept && this.cfg.imgOnly && console.warn( 76146 "There could be a mistake.\nBoth `accept` and `imgOnly` parameters are set.\nThe value of `accept` will be concatenated with the internal image mime types list." 76147 ); 76148 const s = "uploadcare-file-input", n = document.createElement("input"); 76149 n.setAttribute(s, ""), FM(n, { 76150 opacity: 0, 76151 height: 0, 76152 width: 0, 76153 visibility: "hidden" 76154 }), n.type = "file", n.multiple = this.cfg.multiple, t.captureCamera ? (n.capture = this.cfg.cameraCapture, n.accept = this.cfg.enableVideoRecording ? ["image/*", "video/*"].join(",") : "image/*") : n.accept = i, n.addEventListener( 76155 "change", 76156 () => { 76157 n.files && ([...n.files].forEach( 76158 (o) => this.addFileFromObject(o, { source: t.captureCamera ? bs.CAMERA : bs.LOCAL }) 76159 ), this._ctx.$["*currentActivity"] = gt.activities.UPLOAD_LIST, this._ctx.setOrAddState("*modalActive", !0), n.remove()); 76160 }, 76161 { 76162 once: !0 76163 } 76164 ), document.querySelectorAll(`[${s}]`).forEach((o) => o.remove()), document.body.appendChild(n), n.dispatchEvent(new MouseEvent("click")); 76165 }; 76166 /** 76167 * @template {import('../types').OutputFileStatus} TStatus 76168 * @param {string} entryId 76169 * @returns {import('../types/exported.js').OutputFileEntry<TStatus>} 76170 */ 76171 getOutputItem = (t) => { 76172 const i = ( 76173 /** @type {import('./uploadEntrySchema.js').UploadEntry} */ 76174 $t.getCtx(t).store 76175 ), s = i.fileInfo; 76176 let n = i.isRemoved ? "removed" : i.errors.length > 0 ? "failed" : i.fileInfo ? "success" : i.isUploading ? "uploading" : "idle"; 76177 return { 76178 uuid: s?.uuid ?? i.uuid ?? null, 76179 internalId: t, 76180 name: s?.originalFilename ?? i.fileName, 76181 size: s?.size ?? i.fileSize, 76182 isImage: s?.isImage ?? i.isImage, 76183 mimeType: s?.mimeType ?? i.mimeType, 76184 file: i.file, 76185 externalUrl: i.externalUrl, 76186 cdnUrlModifiers: i.cdnUrlModifiers, 76187 cdnUrl: i.cdnUrl ?? s?.cdnUrl ?? null, 76188 fullPath: i.fullPath, 76189 uploadProgress: i.uploadProgress, 76190 fileInfo: s ?? null, 76191 metadata: i.metadata ?? s?.metadata ?? null, 76192 isSuccess: n === "success", 76193 isUploading: n === "uploading", 76194 isFailed: n === "failed", 76195 isRemoved: n === "removed", 76196 errors: ( 76197 /** @type {import('../types/exported.js').OutputFileEntry['errors']} */ 76198 i.errors 76199 ), 76200 status: n, 76201 source: i?.source 76202 }; 76203 }; 76204 /** @template {import('../types').OutputCollectionStatus} TStatus */ 76205 getOutputCollectionState = () => ( 76206 /** @type {ReturnType<typeof buildOutputCollectionState<TStatus>>} */ 76207 $me(this._ctx) 76208 ); 76209 /** @param {Boolean} [force] */ 76210 initFlow = (t = !1) => { 76211 if (this._uploadCollection.size > 0 && !t) 76212 this._ctx.set$({ 76213 "*currentActivity": gt.activities.UPLOAD_LIST 76214 }), this._ctx.setOrAddState("*modalActive", !0); 76215 else if (this._sourceList?.length === 1) { 76216 const i = this._sourceList[0]; 76217 if (i === "local") { 76218 this._ctx.$["*currentActivity"] = gt.activities.UPLOAD_LIST, this.openSystemDialog(); 76219 return; 76220 } 76221 const s = this._ctx.$["*blocksRegistry"], n = (r) => "type" in r && r.type === i; 76222 [...s].find(n)?.activate(), this._ctx.$["*currentActivity"] && this._ctx.setOrAddState("*modalActive", !0); 76223 } else 76224 this._ctx.set$({ 76225 "*currentActivity": gt.activities.START_FROM 76226 }), this._ctx.setOrAddState("*modalActive", !0); 76227 }; 76228 doneFlow = () => { 76229 this._ctx.set$({ 76230 "*currentActivity": this._ctx.doneActivity, 76231 "*history": this._ctx.doneActivity ? [this._ctx.doneActivity] : [] 76232 }), this._ctx.$["*currentActivity"] || this._ctx.setOrAddState("*modalActive", !1); 76233 }; 76234 /** 76235 * @type {<T extends import('./ActivityBlock.js').ActivityType>( 76236 * activityType: T, 76237 * ...params: T extends keyof import('./ActivityBlock.js').ActivityParamsMap 76238 * ? [import('./ActivityBlock.js').ActivityParamsMap[T]] 76239 * : T extends import('./ActivityBlock.js').RegisteredActivityType 76240 * ? [undefined?] 76241 * : [any?] 76242 * ) => void} 76243 */ 76244 setCurrentActivity = (t, i = void 0) => { 76245 if (this._ctx.hasBlockInCtx((s) => s.activityType === t)) { 76246 this._ctx.set$({ 76247 "*currentActivityParams": i ?? {}, 76248 "*currentActivity": t 76249 }); 76250 return; 76251 } 76252 console.warn(`Activity type "${t}" not found in the context`); 76253 }; 76254 /** @returns {import('./ActivityBlock.js').ActivityType} */ 76255 getCurrentActivity = () => this._ctx.$["*currentActivity"]; 76256 /** @param {boolean} opened */ 76257 setModalState = (t) => { 76258 if (t && !this._ctx.$["*currentActivity"]) { 76259 console.warn(`Can't open modal without current activity. Please use "setCurrentActivity" method first.`); 76260 return; 76261 } 76262 this._ctx.setOrAddState("*modalActive", t); 76263 }; 76264 /** 76265 * @private 76266 * @type {string[]} 76267 */ 76268 get _sourceList() { 76269 let t = []; 76270 return this.cfg.sourceList && (t = El(this.cfg.sourceList)), t; 76271 } 76272} 76273const Kme = (e, t) => { 76274 const i = t.cfg.imgOnly, s = e.isImage; 76275 if (!(!i || s) && !(!e.fileInfo && e.externalUrl) && !(!e.fileInfo && !e.mimeType)) 76276 return { 76277 type: "NOT_AN_IMAGE", 76278 message: t.l10n("images-only-accepted"), 76279 payload: { entry: e } 76280 }; 76281}, Zme = (e, t) => { 76282 const i = t.cfg.imgOnly, s = t.cfg.accept, n = D3([...i ? $M : [], s]); 76283 if (!n.length) return; 76284 const o = e.mimeType, r = e.name; 76285 if (!o || !r) 76286 return; 76287 const a = E3(o, n), l = Bme(r, n); 76288 if (!a && !l) 76289 return { 76290 type: "FORBIDDEN_FILE_TYPE", 76291 message: t.l10n("file-type-not-allowed"), 76292 payload: { entry: e } 76293 }; 76294}, rr = 1e3, dc = Object.freeze({ 76295 AUTO: "auto", 76296 BYTE: "byte", 76297 KB: "kb", 76298 MB: "mb", 76299 GB: "gb", 76300 TB: "tb", 76301 PB: "pb" 76302}), _h = (e) =>
76302 Math.ceil(e * 100) / 100, qme = (e, t = dc.AUTO) => { 76303 const i = t === dc.AUTO; 76304 if (t === dc.BYTE || i && e < rr ** 1) { 76305 const s = ( 76306 /** @type {Extract<import('./getPluralForm').PluralForm, 'one' | 'other'>} */ 76307 o3("en-US", e) 76308 ), n = { 76309 one: "byte", 76310 other: "bytes" 76311 }[s]; 76312 return `${e} ${n}`; 76313 } 76314 return t === dc.KB || i && e < rr ** 2 ? `${_h(e / rr ** 1)} KB` : t === dc.MB || i && e < rr ** 3 ? `${_h(e / rr ** 2)} MB` : t === dc.GB || i && e < rr ** 4 ? `${_h(e / rr ** 3)} GB` : t === dc.TB || i && e < rr ** 5 ? `${_h(e / rr ** 4)} TB` : `${_h(e / rr ** 5)} PB`; 76315}, Qme = (e, t) => { 76316 const i = t.cfg.maxLocalFileSizeBytes, s = e.size; 76317 if (i && s && s > i) 76318 return { 76319 type: "FILE_SIZE_EXCEEDED", 76320 message: t.l10n("files-max-size-limit-error", { maxFileSize: qme(i) }), 76321 payload: { entry: e } 76322 }; 76323}, Xme = (e, t) => { 76324 const { internalId: i } = e, n = t._uploadCollection.read(i)?.getValue("uploadError"); 76325 if (!n) 76326 return; 76327 if (n instanceof yn) 76328 return { 76329 type: "UPLOAD_ERROR", 76330 message: n.message, 76331 payload: { 76332 entry: e, 76333 error: n 76334 } 76335 }; 76336 if (n instanceof kg) 76337 return { 76338 type: "NETWORK_ERROR", 76339 message: n.message, 76340 payload: { 76341 entry: e, 76342 error: n 76343 } 76344 }; 76345 const o = n instanceof Error ? n : new Error("Unknown error", { cause: n }); 76346 return { 76347 type: "UNKNOWN_ERROR", 76348 message: o.message, 76349 payload: { 76350 entry: e, 76351 error: o 76352 } 76353 }; 76354}, Jme = (e, t) => { 76355 if (e.failedCount > 0) 76356 return { 76357 type: "SOME_FILES_HAS_ERRORS", 76358 message: t.l10n("some-files-were-not-uploaded") 76359 }; 76360}, eve = (e, t) => { 76361 const i = e.totalCount, s = t.cfg.multiple ? t.cfg.multipleMin : 0, n = t.cfg.multiple ? t.cfg.multipleMax : 1; 76362 if (s && i < s) 76363 return { 76364 type: "TOO_FEW_FILES", 76365 message: t.l10n("files-count-limit-error-too-few", { 76366 min: s, 76367 max: n, 76368 total: i 76369 }), 76370 payload: { 76371 total: i, 76372 min: s, 76373 max: n 76374 } 76375 }; 76376 if (n && i > n) 76377 return { 76378 type: "TOO_MANY_FILES", 76379 message: t.l10n("files-count-limit-error-too-many", { 76380 min: s, 76381 max: n, 76382 total: i 76383 }), 76384 payload: { 76385 total: i, 76386 min: s, 76387 max: n 76388 } 76389 }; 76390}, Jf = { 76391 file: "File validator execution has failed", 76392 collection: "Collection validator execution has failed", 76393 message: "Missing message. We recommend adding message: value." 76394}; 76395class tve { 76396 /** 76397 * @private 76398 * @type {import('./UploaderBlock.js').UploaderBlock} 76399 */ 76400 _blockInstance; 76401 /** @type {FuncFileValidator[]} */ 76402 _fileValidators = [Kme, Zme, Qme, Xme]; 76403 /** @type {FuncCollectionValidator[]} */ 76404 _collectionValidators = [eve, Jme]; 76405 /** @param {import('./UploaderBlock.js').UploaderBlock} blockInstance */ 76406 constructor(t) { 76407 this._blockInstance = t, this._uploadCollection = this._blockInstance.uploadCollection; 76408 const i = () => { 76409 this.runFileValidators(), this.runCollectionValidators(); 76410 }; 76411 this._blockInstance.subConfigValue("maxLocalFileSizeBytes", i), this._blockInstance.subConfigValue("multipleMin", i), this._blockInstance.subConfigValue("multipleMax", i), this._blockInstance.subConfigValue("multiple", i), this._blockInstance.subConfigValue("imgOnly", i), this._blockInstance.subConfigValue("accept", i); 76412 } 76413 /** @param {string[]} [entryIds] */ 76414 runFileValidators(t) { 76415 const i = t ?? this._uploadCollection.items(); 76416 for (const s of i) { 76417 const n = this._uploadCollection.read(s); 76418 n && this._runFileValidatorsForEntry(n); 76419 } 76420 } 76421 runCollectionValidators() { 76422 const t = this._blockInstance.api.getOutputCollectionState(), i = []; 76423 for (const s of [ 76424 ...this._collectionValidators, 76425 ...this._addCustomTypeToValidators(this._blockInstance.cfg.collectionValidators) 76426 ]) 76427 try { 76428 const n = s(t, this._blockInstance.api); 76429 if (!n) 76430 continue; 76431 n && (i.push(n), n.message || console.warn(Jf.message)); 76432 } catch (n) { 76433 console.warn(Jf.collection, n); 76434 } 76435 this._blockInstance.$["*collectionErrors"] = i, i.length > 0 && this._blockInstance.emit( 76436 Ni.COMMON_UPLOAD_FAILED, 76437 () => ( 76438 /** @type {import('../types').OutputCollectionState<'failed'>} */ 76439 this._blockInstance.api.getOutputCollectionState() 76440 ), 76441 { debounce: !0 } 76442 ); 76443 } 76444 /** 76445 * @private 76446 * @param {import('./TypedData.js').TypedData}
76446 entry 76447 */ 76448 _runFileValidatorsForEntry(t) { 76449 const i = this._blockInstance.api.getOutputItem(t.uid), s = []; 76450 for (const n of [ 76451 ...this._fileValidators, 76452 ...this._addCustomTypeToValidators(this._blockInstance.cfg.fileValidators) 76453 ]) 76454 try { 76455 const o = n(i, this._blockInstance.api); 76456 if (!o) 76457 continue; 76458 o && (s.push(o), o.message || console.warn(Jf.message)); 76459 } catch (o) { 76460 console.warn(Jf.file, o); 76461 } 76462 t.setValue("errors", s); 76463 } 76464 /** 76465 * @template T 76466 * @param {T[]} validators 76467 * @returns {T[]} 76468 */ 76469 _addCustomTypeToValidators(t) { 76470 return t.map((i) => (...s) => { 76471 const n = i(...s); 76472 return n ? { ...n, type: "CUSTOM_ERROR" } : void 0; 76473 }); 76474 } 76475} 76476const ive = Object.freeze({ 76477 file: { 76478 type: File, 76479 value: null 76480 }, 76481 externalUrl: { 76482 type: String, 76483 value: null 76484 }, 76485 fileName: { 76486 type: String, 76487 value: null, 76488 nullable: !0 76489 }, 76490 fileSize: { 76491 type: Number, 76492 value: null, 76493 nullable: !0 76494 }, 76495 lastModified: { 76496 type: Number, 76497 value: Date.now() 76498 }, 76499 uploadProgress: { 76500 type: Number, 76501 value: 0 76502 }, 76503 uuid: { 76504 type: String, 76505 value: null 76506 }, 76507 isImage: { 76508 type: Boolean, 76509 value: !1 76510 }, 76511 mimeType: { 76512 type: String, 76513 value: null, 76514 nullable: !0 76515 }, 76516 ctxName: { 76517 type: String, 76518 value: null 76519 }, 76520 cdnUrl: { 76521 type: String, 76522 value: null 76523 }, 76524 cdnUrlModifiers: { 76525 type: String, 76526 value: null 76527 }, 76528 fileInfo: { 76529 type: VM, 76530 value: null 76531 }, 76532 isUploading: { 76533 type: Boolean, 76534 value: !1 76535 }, 76536 abortController: { 76537 type: AbortController, 76538 value: null, 76539 nullable: !0 76540 }, 76541 thumbUrl: { 76542 type: String, 76543 value: null, 76544 nullable: !0 76545 }, 76546 silent: { 76547 type: Boolean, 76548 value: !1 76549 }, 76550 source: { 76551 type: String, 76552 value: !1, 76553 nullable: !0 76554 }, 76555 fullPath: { 76556 type: String, 76557 value: null, 76558 nullable: !0 76559 }, 76560 metadata: { 76561 type: Object, 76562 value: null, 76563 nullable: !0 76564 }, 76565 errors: { 76566 type: Array, 76567 value: [] 76568 }, 76569 uploadError: { 76570 type: Error, 76571 value: null, 76572 nullable: !0 76573 }, 76574 isRemoved: { 76575 type: Boolean, 76576 value: !1 76577 } 76578}); 76579class fs extends gt { 76580 /** @protected */ 76581 couldBeCtxOwner = !1; 76582 /** @private */ 76583 isCtxOwner = !1; 76584 init$ = w3(this); 76585 /** @private */ 76586 get hasCtxOwner() { 76587 return this.hasBlockInCtx((t) => t instanceof fs ? t.isCtxOwner && t.isConnected && t !== this : !1); 76588 } 76589 /** @protected */ 76590 initCallback() { 76591 if (super.initCallback(), !this.has("*uploadCollection")) { 76592 let t = new _me({ 76593 typedSchema: ive, 76594 watchList: ["uploadProgress", "uploadError", "fileInfo", "errors", "cdnUrl", "isUploading"] 76595 }); 76596 this.add("*uploadCollection", t); 76597 } 76598 this.has("*publicApi") || this.add("*publicApi", new Yme(this)), this.has("*validationManager") || this.add("*validationManager", new tve(this)), !this.hasCtxOwner && this.couldBeCtxOwner && this.initCtxOwner(); 76599 } 76600 /** 76601 * @returns {ValidationManager} 76602 * @protected 76603 */ 76604 get validationManager() { 76605 if (!this.has("*validationManager")) 76606 throw new Error("Unexpected error: ValidationManager is not initialized"); 76607 return this.$["*validationManager"]; 76608 } 76609 /** @returns {UploaderPublicApi} */ 76610 get api() { 76611 if (!this.has("*publicApi")) 76612 throw new Error("Unexpected error: UploaderPublicApi is not initialized"); 76613 return this.$["*publicApi"]; 76614 } 76615 getAPI() { 76616 return this.api; 76617 } 76618 /** @returns {TypedCollection} */ 76619 get uploadCollection() { 76620 if (!this.has("*uploadCollection")) 76621 throw new Error("Unexpected error: TypedCollection is not initialized"); 76622 return this.$["*uploadCollection"]; 76623 } 76624 /** @protected */ 76625 destroyCtxCallback() { 76626 this._unobserveCollectionProperties?.(), this._unobserveCollection?.(), this.uploadCollection.destroy(), this.$["*uploadCollection"] = null, super.destroyCtxCallback(); 76627 } 76628 /** @private */ 76629 initCtxOwner() { 76630 this.isCtxOwner = !0, this._unobserveCollection = this.uploadCollection.observeCollection(this._handleCollectionUpdate), this._unobserveCollectionProperties = this.uploadCollection.observeProperties( 76631 this._handleCollectionPropertiesUpdate 76632 ), this.subConfigValue("maxConcurrentRequests", (t) => { 76633 this.$["*uploadQueue"].concurrency = Number(t) || 1; 76634 }), this.$["*secureUploadsManager"] || (this.$["*secureUploadsManager"] = new Fme(this)), this.has("*modalActive") && this.sub("*modalActive", (t) => { 76635 t && !this.$["*currentActivity"] && (this.$["*modalActive"] = !1); 76636 }); 76637 } 76638 /** 76639 * @private 76640 * @param {import('../types').OutputCollectionState} collectionState 76641 */ 76642 async _createGroup(t) { 76643 const i = await this.getUploadClientOptions(), s = t.allEntries.map((a) => a.uuid + (a.cdnUrlModifiers ? `/${a.cdnUrlModifiers}` : "")), n = new AbortController(), o = await Kfe(s, { ...i, signal: n.signal }); 76644 if (this.$["*collectionState"] !== t) { 76645 n.abort(); 76646 return; 76647 } 76648 this.$["*groupInfo"] = o; 76649 const r = ( 76650 /** @type {import('../types').OutputCollectionState<'success', 'has-group'>} */ 76651 this.api.getOutputCollectionState() 76652 );
76653 this.emit(Ni.GROUP_CREATED, r), this.emit(Ni.CHANGE, () => this.api.getOutputCollectionState(), { debounce: !0 }), this.$["*collectionState"] = r; 76654 } 76655 /** @private */ 76656 _flushOutputItems = wo(async () => { 76657 if (this.getOutputData().length !== this.uploadCollection.size) 76658 return; 76659 const i = this.api.getOutputCollectionState(); 76660 this.$["*collectionState"] = i, this.emit(Ni.CHANGE, () => this.api.getOutputCollectionState(), { debounce: !0 }), this.cfg.groupOutput && i.totalCount > 0 && i.status === "success" && this._createGroup(i); 76661 }, 300); 76662 /** 76663 * @private 76664 * @type {Parameters<import('./TypedCollection.js').TypedCollection['observeCollection']>[0]} 76665 * @param {Set<import('./TypedData.js').TypedData>} removed 76666 */ 76667 _handleCollectionUpdate = (t, i, s) => { 76668 (i.size || s.size) && (this.$["*groupInfo"] = null), this.validationManager.runFileValidators(), this.validationManager.runCollectionValidators(); 76669 for (const n of i) 76670 n.getValue("silent") || this.emit(Ni.FILE_ADDED, this.api.getOutputItem(n.uid)); 76671 for (const n of s) 76672 this.$["*uploadTrigger"].delete(n.uid), n.getValue("abortController")?.abort(), n.setMultipleValues({ 76673 isRemoved: !0, 76674 abortController: null, 76675 isUploading: !1, 76676 uploadProgress: 0 76677 }), URL.revokeObjectURL(n?.getValue("thumbUrl")), this.emit(Ni.FILE_REMOVED, this.api.getOutputItem(n.uid)); 76678 this.$["*uploadList"] = t.map((n) => ({ uid: n })), this._flushCommonUploadProgress(), this._flushOutputItems(); 76679 }; 76680 /** 76681 * @private 76682 * @param {Record<keyof import('./uploadEntrySchema.js').UploadEntry, Set<string>>} changeMap 76683 */ 76684 _handleCollectionPropertiesUpdate = (t) => { 76685 this._flushOutputItems(); 76686 const i = this.uploadCollection, s = [ 76687 ...new Set( 76688 Object.entries(t).filter(([n]) => ["uploadError", "fileInfo"].includes(n)).map(([, n]) => [...n]).flat() 76689 ) 76690 ]; 76691 if (s.length > 0 && setTimeout(() => { 76692 this.validationManager.runFileValidators(s); 76693 }), t.uploadProgress) { 76694 for (const n of t.uploadProgress) { 76695 const { isUploading: o, silent: r } = $t.getCtx(n).store; 76696 o && !r && this.emit(Ni.FILE_UPLOAD_PROGRESS, this.api.getOutputItem(n)); 76697 } 76698 this._flushCommonUploadProgress(); 76699 } 76700 if (t.isUploading) 76701 for (const n of t.isUploading) { 76702 const { isUploading: o, silent: r } = $t.getCtx(n).store; 76703 o && !r && this.emit(Ni.FILE_UPLOAD_START, this.api.getOutputItem(n)); 76704 } 76705 if (t.fileInfo) { 76706 for (const n of t.fileInfo) { 76707 const { fileInfo: o, silent: r } = $t.getCtx(n).store; 76708 o && !r && this.emit(Ni.FILE_UPLOAD_SUCCESS, this.api.getOutputItem(n)); 76709 } 76710 this.cfg.cropPreset && this.setInitialCrop(); 76711 } 76712 if (t.errors) { 76713 for (const r of t.errors) { 76714 const { errors: a } = $t.getCtx(r).store; 76715 a.length >
76715 0 && (this.emit(Ni.FILE_UPLOAD_FAILED, this.api.getOutputItem(r)), this.emit( 76716 Ni.COMMON_UPLOAD_FAILED, 76717 () => ( 76718 /** @type {import('../types').OutputCollectionState<'failed'>} */ 76719 this.api.getOutputCollectionState() 76720 ), 76721 { debounce: !0 } 76722 )); 76723 } 76724 const n = i.findItems((r) => !!r.getValue("fileInfo")), o = i.findItems((r) => r.getValue("errors").length > 0); 76725 i.size > 0 && o.length === 0 && i.size === n.length && this.$["*collectionErrors"].length === 0 && this.emit( 76726 Ni.COMMON_UPLOAD_SUCCESS, 76727 /** @type {import('../types').OutputCollectionState<'success'>} */ 76728 this.api.getOutputCollectionState() 76729 ); 76730 } 76731 t.cdnUrl && ([...t.cdnUrl].filter((o) => !!this.uploadCollection.read(o)?.getValue("cdnUrl")).forEach((o) => { 76732 this.emit(Ni.FILE_URL_CHANGED, this.api.getOutputItem(o)); 76733 }), this.$["*groupInfo"] = null); 76734 }; 76735 /** @private */ 76736 _flushCommonUploadProgress = () => { 76737 let t = 0; 76738 const s = [...this.$["*uploadTrigger"]].filter((o) => !!this.uploadCollection.read(o));
76739 s.forEach((o) => { 76740 const r = this.uploadCollection.readProp(o, "uploadProgress"); 76741 t += r; 76742 }); 76743 const n = s.length ? Math.round(t / s.length) : 0; 76744 this.$["*commonProgress"] !== n && (this.$["*commonProgress"] = n, this.emit( 76745 Ni.COMMON_UPLOAD_PROGRESS, 76746 /** @type {import('../types').OutputCollectionState<'uploading'>} */ 76747 this.api.getOutputCollectionState() 76748 )); 76749 }; 76750 /** @private */ 76751 setInitialCrop() { 76752 const t = A3(this.cfg.cropPreset); 76753 if (t) { 76754 const [i] = t, s = this.uploadCollection.findItems( 76755 (n) => n.getValue("fileInfo") && n.getValue("isImage") && !n.getValue("cdnUrlModifiers")?.includes("/crop/") 76756 ).map((n) => this.uploadCollection.read(n)); 76757 for (const n of s) { 76758 const o = n.getValue("fileInfo"), { width: r, height: a } = o.imageInfo, l = i.width / i.height, c = Lme(r, a, l), u = Dl( 76759 `crop/${c.width}x${c.height}/${c.x},${c.y}`, 76760 "preview" 76761 ); 76762 n.setMultipleValues({ 76763 cdnUrlModifiers: u, 76764 cdnUrl: co(n.getValue("cdnUrl"), u) 76765 }), this.uploadCollection.size === 1 && this.cfg.useCloudImageEditor && this.hasBlockInCtx((d) => d.activityType === gt.activities.CLOUD_IMG_EDIT) && (this.$["*currentActivityParams"] = { 76766 internalId: n.uid 76767 }, this.$["*currentActivity"] = gt.activities.CLOUD_IMG_EDIT); 76768 } 76769 } 76770 } 76771 /** 76772 * @param {string} entryId 76773 * @protected 76774 */ 76775 async getMetadataFor(t) { 76776 const i = this.cfg.metadata || void 0; 76777 if (typeof i == "function") { 76778 const s = this.api.getOutputItem(t); 76779 return await i(s); 76780 } 76781 return i; 76782 } 76783 /** 76784 * @returns {Promise<import('@uploadcare/upload-client').FileFromOptions>} 76785 * @protected 76786 */ 76787 async getUploadClientOptions() { 76788 const i = await this.$["*secureUploadsManager"].getSecureToken().catch(() => null); 76789 return { 76790 store: this.cfg.store, 76791 publicKey: this.cfg.pubkey, 76792 baseCDN: this.cfg.cdnCname, 76793 baseURL: this.cfg.baseUrl, 76794 userAgent: kme, 76795 integration: this.cfg.userAgentIntegration, 76796 secureSignature: i?.secureSignature, 76797 secureExpire: i?.secureExpire, 76798 retryThrottledRequestMaxTimes: this.cfg.retryThrottledRequestMaxTimes, 76799 multipartMinFileSize: this.cfg.multipartMinFileSize, 76800 multipartChunkSize: this.cfg.multipartChunkSize, 76801 maxConcurrentRequests: this.cfg.multipartMaxConcurrentRequests, 76802 multipartMaxAttempts: this.cfg.multipartMaxAttempts, 76803 checkForUrlDuplicates: !!this.cfg.checkForUrlDuplicates, 76804 saveUrlForRecurrentUploads: !!this.cfg.saveUrlForRecurrentUploads 76805 }; 76806 } 76807 /** @returns {import('../types/exported.js').OutputFileEntry[]} */ 76808 getOutputData() { 76809 return this.uploadCollection.items().map((s) => this.api.getOutputItem(s)); 76810 } 76811} 76812fs.extSrcList = Object.freeze({ 76813 ...gC 76814}); 76815fs.sourceTypes = Object.freeze({ 76816 ...bs 76817}); 76818const fC = (e) => e.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)?.map((t) => t.toLowerCase()).join("-"), Yi = (e) => String(e), to = (e) => { 76819 const t = Number(e); 76820 if (Number.isNaN(t)) 76821 throw new Error(`Invalid number: "${e}"`); 76822 return t; 76823}, mi = (e) => { 76824 if (typeof e > "u" || e === null) return !1; 76825 if (typeof e == "boolean") return e; 76826 if (e === "true" || e === "") return !0; 76827 if (e === "false") return !1; 76828 throw new Error(`Invalid boolean: "${e}"`); 76829}, sve = (e) => e === "auto" ? e : mi(e), nve = (e) => { 76830 const t = Yi(e); 76831 if (t !== "user" && t !== "environment" && t !== "") 76832 throw new Error(`Invalid "cameraCapture" value: "${t}"`); 76833 return t; 76834}, ove = (e) => { 76835 const t = Yi(e); 76836 if (t !== "photo" && t !== "video") 76837 throw new Error(`Invalid "CameraTab" value: "${t}"`); 76838 return t; 76839}, rve = (e) => { 76840 if (typeof e == "object" && !Array.isArray(e) || typeof e == "function") 76841 return ( 76842 /** @type {import('../../types').MetadataCallback} */ 76843 e 76844 ); 76845 throw new Error("Invalid metadata value. Must be an object or function."); 76846}, JT = (e) => { 76847 if (typeof e == "object") 76848 return ( 76849 /** @type {T} */ 76850 e 76851 ); 76852 throw new Error("Invalid value. Must be an object."); 76853}, j0 = (e) => { 76854 if (typeof e == "function") 76855 return ( 76856 /** @type {T} */ 76857 e 76858 ); 76859 throw new Error("Invalid value. Must be a function."); 76860}, eL = (e) => { 76861 if (Array.isArray(e)) 76862 return ( 76863 /** @type {T} */ 76864 e 76865 );
76866 throw new Error("Must be an array."); 76867}, ave = { 76868 pubkey: Yi, 76869 multiple: mi, 76870 multipleMin: to, 76871 multipleMax: to, 76872 confirmUpload: mi, 76873 imgOnly: mi, 76874 accept: Yi, 76875 externalSourcesPreferredTypes: Yi, 76876 externalSourcesEmbedCss: Yi, 76877 store: sve, 76878 cameraMirror: mi, 76879 cameraCapture: nve, 76880 sourceList: Yi, 76881 maxLocalFileSizeBytes: to, 76882 thumbSize: to, 76883 showEmptyList: mi, 76884 useLocalImageEditor: mi, 76885 useCloudImageEditor: mi, 76886 cloudImageEditorTabs: Yi, 76887 removeCopyright: mi, 76888 cropPreset: Yi, 76889 imageShrink: Yi, 76890 modalScrollLock: mi, 76891 modalBackdropStrokes: mi, 76892 sourceListWrap: mi, 76893 remoteTabSessionKey: Yi, 76894 cdnCname: Yi, 76895 baseUrl: Yi, 76896 socialBaseUrl: Yi, 76897 secureSignature: Yi, 76898 secureExpire: Yi, 76899 secureDeliveryProxy: Yi, 76900 retryThrottledRequestMaxTimes: to, 76901 multipartMinFileSize: to, 76902 multipartChunkSize: to, 76903 maxConcurrentRequests: to, 76904 multipartMaxConcurrentRequests: to, 76905 multipartMaxAttempts: to, 76906 checkForUrlDuplicates: mi, 76907 saveUrlForRecurrentUploads: mi, 76908 groupOutput: mi, 76909 userAgentIntegration: Yi, 76910 debug: mi, 76911 localeName: Yi, 76912 metadata: rve, 76913 secureUploadsExpireThreshold: to, 76914 localeDefinitionOverride: ( 76915 /** @type {typeof asObject<import('../../types').LocaleDefinitionOverride>} */ 76916 JT 76917 ), 76918 secureUploadsSignatureResolver: ( 76919 /** @type {typeof asFunction<import('../../types').SecureUploadsSignatureResolver>} */ 76920 j0 76921 ), 76922 secureDeliveryProxyUrlResolver: ( 76923 /** @type {typeof asFunction<import('../../types').SecureDeliveryProxyUrlResolver>} */ 76924 j0 76925 ), 76926 iconHrefResolver: ( 76927 /** @type {typeof asFunction<import('../../types').IconHrefResolver>} */ 76928 j0 76929 ), 76930 fileValidators: ( 76931 /** @type {typeof asArray<import('../../types').FileValidators>} */ 76932 eL 76933 ), 76934 collectionValidators: ( 76935 /** @type {typeof asArray<import('../../types').CollectionValidators>} */ 76936 eL 76937 ), 76938 defaultCameraMode: ove, 76939 enableAudioRecording: mi, 76940 enableVideoRecording: mi, 76941 mediaRecorerOptions: JT, 76942 maxVideoRecordingDuration: to 76943}, lve = (e, t) => { 76944 if (!(typeof t > "u" || t === null)) 76945 try { 76946 return ave[e](t); 76947 } catch (i) { 76948 return console.error(`Invalid value for config key "${e}".`, i), yl[e]; 76949 } 76950}, YM = ( 76951 /** @type {(keyof import('../../types').ConfigType)[]} */ 76952 [ 76953 // "debug" option should go first to be able to print debug messages from the very beginning 76954 .../* @__PURE__ */ new Set(["debug", ...Object.keys(yl)]) 76955 ] 76956), cve = [ 76957 "metadata", 76958 "localeDefinitionOverride", 76959 "secureUploadsSignatureResolver", 76960 "secureDeliveryProxyUrlResolver", 76961 "iconHrefResolver", 76962 "fileValidators", 76963 "collectionValidators", 76964 "mediaRecorerOptions" 76965], uve = (e) => cve.includes(e), Fd = ( 76966 /** @type {(keyof import('../../types').ConfigPlainType)[]} */ 76967 YM.filter((e) => !uve(e)) 76968), dve = ( 76969 /** @type {Record<keyof import('../../types').ConfigAttributesType, keyof import('../../types').ConfigPlainType>} */ 76970 { 76971 ...Object.fromEntries(Fd.map((e) => [fC(e), e])), 76972 ...Object.fromEntries(Fd.map((e) => [e.toLowerCase(), e])) 76973 } 76974), hve = ( 76975 /** @type {Record<keyof import('../../types').ConfigAttributesType, string>} */ 76976 { 76977 ...Object.fromEntries(Fd.map((e) => [fC(e), lo(e)])), 76978 ...Object.fromEntries(Fd.map((e) => [e.toLowerCase(), lo(e)])) 76979 } 76980), tL = (e) => "__" + e; 76981class KM extends Ti { 76982 requireCtxName = !0; 76983 constructor() { 76984 super(), this.init$ = { 76985 ...this.init$, 76986 ...Object.fromEntries( 76987 Object.entries(yl).map(([t, i]) => [ 76988 lo( 76989 /** @type {keyof import('../../types').ConfigType} */ 76990 t 76991 ), 76992 i 76993 ]) 76994 ) 76995 }; 76996 } 76997 /** 76998 * @private 76999 * @param {keyof import('../../types').ConfigType} key 77000 * @param {unknown} value 77001 */ 77002 _flushValueToAttribute(t, i) { 77003 if (Fd.includes(t)) { 77004 const s = [.../* @__PURE__ */ new Set([fC(t), t.toLowerCase()])]; 77005 for (const n of s) 77006 typeof i > "u" || i === null ? this.removeAttribute(n) : this.getAttribute(n) !== i.toString() && this.setAttribute(n, i.toString()); 77007 } 77008 } 77009 /** 77010 * @private 77011 * @param {keyof import('../../types').ConfigType} key 77012 * @param {unknown} value 77013 */ 77014 _flushValueToState(t, i) { 77015 this.$[lo(t)] !== i && (typeof i > "u" || i === null ? this.$[lo(t)] = yl[t] : this.$[lo(t)] = i); 77016 } 77017 /** 77018 * @private 77019 * @param {keyof import('../../types').ConfigType} key 77020 * @param {unknown} value 77021 */ 77022 _setValue(t, i) { 77023 const s = ( 77024 /** @type {typeof this & any} */ 77025 this 77026 ), n = lve(t, i), o = tL(t);
77027 s[o] !== n && (this._assertSameValueDifferentReference(t, s[o], n), s[o] = n, this._flushValueToAttribute(t, n), this._flushValueToState(t, n), this.debugPrint(`[uc-config] "${t}"`, n)); 77028 } 77029 /** 77030 * @private 77031 * @param {keyof import('../../types').ConfigType} key 77032 */ 77033 _getValue(t) { 77034 const i = ( 77035 /** @type {typeof this & any} */ 77036 this 77037 ), s = tL(t); 77038 return i[s]; 77039 } 77040 /** 77041 * @param {string} key 77042 * @param {unknown} previousValue 77043 * @param {unknown} nextValue 77044 */ 77045 _assertSameValueDifferentReference(t, i, s) { 77046 this.cfg.debug && s !== i && typeof s == "object" && typeof i == "object" && JSON.stringify(s) === JSON.stringify(i) && (console.warn( 77047 `[uc-config] Option "${t}" value is the same as the previous one but the reference is different` 77048 ), console.warn( 77049 "[uc-config] You should avoid changing the reference of the object to prevent unnecessary calculations" 77050 ), console.warn(`[uc-config] "${t}" previous value:`, i), console.warn(`[uc-config] "${t}" new value:`, s)); 77051 } 77052 initCallback() { 77053 super.initCallback(); 77054 const t = ( 77055 /** @type {typeof this & any} */ 77056 this 77057 ); 77058 for (const i of Fd) 77059 this.sub( 77060 lo(i), 77061 (s) => { 77062 this._setValue(i, s); 77063 }, 77064 !1 77065 ); 77066 for (const i of YM) { 77067 const s = t[i] ?? this.$[lo(i)]; 77068 s !== yl[i] && this._setValue(i, s), Object.defineProperty(this, i, { 77069 /** @param {unknown} value */ 77070 set: (n) => { 77071 this._setValue(i, n); 77072 }, 77073 get: () => this._getValue(i) 77074 }); 77075 } 77076 } 77077 /** 77078 * @param {keyof typeof attrStateMapping} name 77079 * @param {string} oldVal 77080 * @param {string} newVal 77081 */ 77082 attributeChangedCallback(t, i, s) { 77083 if (i === s) return; 77084 const n = ( 77085 /** @type {typeof this & any} */ 77086 this 77087 ), o = dve[t]; 77088 n[o] = s; 77089 } 77090} 77091KM.bindAttributes(hve); 77092for (const e of YM) 77093 KM.prototype[e] = void 0; 77094const pve = ( 77095 /** @type {Config} */ 77096 /** @type {unknown} */ 77097 KM 77098); 77099class ZM extends Ti { 77100 constructor() { 77101 super(), this.init$ = { 77102 ...this.init$, 77103 name: "", 77104 href: "" 77105 }; 77106 } 77107 initCallback() { 77108 super.initCallback(), this.sub("name", (t) => { 77109 if (!t) 77110 return; 77111 let i = `#uc-icon-${t}`; 77112 this.subConfigValue("iconHrefResolver", (s) => { 77113 s && (i = s(t) ?? i), this.$.href = i; 77114 }); 77115 }); 77116 } 77117} 77118ZM.template = /* HTML */ 77119` 77120 <svg ref="svg" xmlns="http://www.w3.org/2000/svg"> 77121 <use set="@href: href;"></use> 77122 </svg> 77123`; 77124ZM.bindAttributes({ 77125 name: "name" 77126}); 77127const gve = (e) => [...new Set(e)], fve = (e) => Object.entries(e).filter(([t, i]) => i !== void 0 && i !== "").map(([t, i]) => t === "cdn-operations" || t === "analytics" ? i : `${t}/${i}`), mve = "https://ucarecdn.com", Sv = Object.freeze({ 77128 "dev-mode": {}, 77129 pubkey: {}, 77130 uuid: {}, 77131 src: {}, 77132 // alt: {}, 77133 // 'placeholder-src': {}, // available via CSS 77134 lazy: { 77135 default: 1 77136 }, 77137 intersection: {}, 77138 breakpoints: { 77139 // '200, 300, 400' 77140 }, 77141 "cdn-cname": { 77142 default: mve 77143 }, 77144 "proxy-cname": {}, 77145 "secure-delivery-proxy": {}, 77146 "hi-res-support": { 77147 default: 1 77148 }, 77149 "ultra-res-support": {}, 77150 // ? 77151 format: {}, 77152 "cdn-operations": {}, 77153 progressive: {}, 77154 quality: {}, 77155 "is-background-for": {}, 77156 "is-preview-blur": { 77157 default: 1 77158 } 77159}), Kh = "--uc-img-", iL = "unresolved", em = 2, tm = 3, sL = !window.location.host.trim() || window.location.host.includes(":") || window.location.hostname.includes("localhost"), nL = 3e3, oL = 5e3, rL = Object.freeze({ 77160 PREVIEW: "PREVIEW", 77161 MAIN: "MAIN" 77162}), I3 = /* @__PURE__ */ Object.create(null); 77163for (let e in Sv) 77164 I3[Kh + e] = Sv[e]?.default || ""; 77165class vve extends Lg { 77166 cssInit$ = I3; 77167 /** 77168 * @param {String} key 77169 * @returns {any} 77170 */ 77171 $$(t) { 77172 return this.$[Kh + t]; 77173 } 77174 /** @param {Object<String, String | Number>} kvObj */ 77175 set$$(t) { 77176 for (let i in t) 77177 this.$[Kh + i] = t[i]; 77178 } 77179 /** 77180 * @param {String} key 77181 * @param {(val: any) => void} kbFn 77182 */ 77183 sub$$(t, i) { 77184 this.sub(Kh + t, (s) => { 77185 s === null || s === "" || i(s); 77186 }); 77187 } 77188 analyticsParams() { 77189 return `-/@clib/${hC}/${pC}/uc-img/`; 77190 } 77191 initAttributes(t) {
77192 [...this.attributes].forEach((i) => { 77193 Sv[i.name] || t.setAttribute(i.name, i.value); 77194 }); 77195 } 77196 /** 77197 * @param {HTMLElement} el 77198 * @param {() => void} cbkFn 77199 */ 77200 initIntersection(t, i) { 77201 let s = { 77202 root: null, 77203 rootMargin: "0px" 77204 }; 77205 this._isnObserver = new IntersectionObserver((n) => { 77206 n.forEach((o) => { 77207 o.isIntersecting && (i(), this._isnObserver.unobserve(t)); 77208 }); 77209 }, s), this._isnObserver.observe(t), this._observed || (this._observed = /* @__PURE__ */ new Set()), this._observed.add(t); 77210 } 77211 destroyCallback() { 77212 super.destroyCallback(), this._isnObserver && (this._observed.forEach((t) => { 77213 this._isnObserver.unobserve(t); 77214 }), this._isnObserver = null), $t.deleteCtx(this); 77215 } 77216 static get observedAttributes() { 77217 return Object.keys(Sv); 77218 } 77219 attributeChangedCallback(t, i, s) { 77220 window.setTimeout(() => { 77221 this.$[Kh + t] = s; 77222 }); 77223 } 77224} 77225class yve extends vve { 77226 _img = new Image(); 77227 _imgPreview = new Image(); 77228 /** 77229 * @private 77230 * @param {String} src 77231 */ 77232 _fmtAbs(t) { 77233 return !t.includes("//") && !sL && (t = new URL(t, document.baseURI).href), t; 77234 } 77235 /** 77236 * Validate size 77237 * 77238 * @param {String} [size] 77239 * @returns {String | Number} 77240 */ 77241 _validateSize(t) { 77242 if (t?.trim() !== "") { 77243 let i = t.match(/\d+/)[0], s = t.match(/[a-zA-Z]+/)[0]; 77244 const n = parseInt(i, 10); 77245 if (Number(n) > oL && this.hasFormatJPG) 77246 return oL + s; 77247 if (Number(n) > nL && !this.hasFormatJPG) 77248 return nL + s; 77249 } 77250 return t; 77251 } 77252 /** 77253 * Image operations 77254 * 77255 * @param {String} [size] 77256 * @param {String} [blur] 77257 */ 77258 _getCdnModifiers(t, i) { 77259 const s = { 77260 format: this.$$("format"), 77261 quality: this.$$("quality"), 77262 resize: this._validateSize(t), 77263 blur: i, 77264 "cdn-operations": this.$$("cdn-operations"), 77265 analytics: this.analyticsParams() 77266 }; 77267 return Dl(...fve(s)); 77268 } 77269 /** 77270 * @private 77271 * @param {String} [size] 77272 * @param {String} [blur] 77273 * @returns {any} 77274 */ 77275 _getUrlBase(t = "", i = "") { 77276 if (this.$$("src").startsWith("data:") || this.$$("src").startsWith("blob:")) 77277 return this.$$("src"); 77278 if (sL && this.$$("src") && !this.$$("src").includes("//")) 77279 return this._proxyUrl(this.$$("src")); 77280 let s = this._getCdnModifiers(t, i); 77281 if (this.$$("src").startsWith(this.$$("cdn-cname"))) 77282 return co(this.$$("src"), s); 77283 if (this.$$("cdn-cname") && this.$$("uuid")) 77284 return this._proxyUrl( 77285 co( 77286 // 77287 ig(this.$$("cdn-cname"), this.$$("uuid")), 77288 s 77289 ) 77290 ); 77291 if (this.$$("uuid")) 77292 return this._proxyUrl( 77293 co( 77294 // 77295 ig(this.$$("cdn-cname"), this.$$("uuid")), 77296 s 77297 ) 77298 ); 77299 if (this.$$("proxy-cname")) 77300 return this._proxyUrl( 77301 co( 77302 // 77303 this.$$("proxy-cname"), 77304 s, 77305 this._fmtAbs(this.$$("src")) 77306 ) 77307 ); 77308 if (this.$$("pubkey")) 77309 return this._proxyUrl( 77310 co( 77311 // 77312 `https://${this.$$("pubkey")}.ucr.io/`, 77313 s, 77314 this._fmtAbs(this.$$("src")) 77315 ) 77316 ); 77317 } 77318 /** 77319 * @private 77320 * @param {String} url 77321 * @returns {String} 77322 */ 77323 _proxyUrl(t) { 77324 return this.$$("secure-delivery-proxy") ? vS( 77325 this.$$("secure-delivery-proxy"), 77326 { previewUrl: t }, 77327 { transform: (s) => window.encodeURIComponent(s) } 77328 ) : t; 77329 } 77330 /** 77331 * @param {HTMLElement} el 77332 * @param {Number} [k] 77333 * @param {Boolean} [wOnly] 77334 */ 77335 _getElSize(t, i = 1, s = !0) { 77336 let n = t.getBoundingClientRect(), o = i * Math.round(n.width), r = s ? "" : i * Math.round(n.height); 77337 return o || r ? `${o || ""}x${r || ""}` : null; 77338 } 77339 /** @param {HTMLImageElement} img */ 77340 _setupEventProxy(t) { 77341 let i = (n) => { 77342 n.stopPropagation(); 77343 let o = new Event(n.type, n); 77344 this.dispatchEvent(o); 77345 }, s = ["load", "error"]; 77346 for (let n of s) 77347 t.addEventListener(n, i); 77348 } 77349 /** @type {HTMLImageElement} */ 77350 get img() { 77351 return this.hasPreviewImage || (this._setupConfigForImage({ elNode: this._img }), this.appendChild(this._img)), this._img; 77352 } 77353 get currentImg() { 77354 return this.hasPreviewImage ? { 77355 type: rL.PREVIEW, 77356 img: this._imgPreview 77357 } : { 77358 type: rL.MAIN, 77359 img: this.img 77360 }; 77361 } 77362 get hasPreviewImage() { 77363 return this.$$("is-preview-blur"); 77364 } 77365 get bgSelector() { 77366 return this.$$("is-background-for"); 77367 } 77368 get breakpoints() { 77369 if (this.$$("breakpoints")) { 77370 const t = El(this.$$("breakpoints")); 77371 return gve(t.map((i) => parseInt(i, 10))); 77372 } else 77373 return null; 77374 } 77375 get hasFormatJPG() { 77376 return this.$$("format").toLowerCase() === "jpeg"; 77377 } 77378 /** @param {HTMLElement} el */ 77379 renderBg(t) { 77380 let i = /* @__PURE__ */ new Set(); 77381 i.add(`url("${this._getUrlBase(this._getElSize(t))}") 1x`), this.$$("hi-res-support") && i.add(`url("${this._getUrlBase(this._getElSize(t, em))}") ${em}x`), this.$$("ultra-res-support") && i.add(`url("${this._getUrlBase(this._getElSize(t, tm))}") ${tm}x`); 77382 let s = `image-set(${[...i].join(", ")})`; 77383 t.style.setProperty("background-image", s), t.style.setProperty("background-image", "-webkit-" + s); 77384 } 77385 getSrcset() { 77386 let t = /* @__PURE__ */ new Set();
77387 return this.breakpoints ? this.breakpoints.forEach((i) => { 77388 t.add(this._getUrlBase(i + "x") + ` ${this._validateSize(i + "w")}`), this.$$("hi-res-support") && t.add(this._getUrlBase(i * em + "x") + ` ${this._validateSize(i * em + "w")}`), this.$$("ultra-res-support") && t.add(this._getUrlBase(i * tm + "x") + ` ${this._validateSize(i * tm + "w")}`); 77389 }) : (t.add(this._getUrlBase(this._getElSize(this.currentImg.img)) + " 1x"), this.$$("hi-res-support") && t.add(this._getUrlBase(this._getElSize(this.currentImg.img, 2)) + " 2x"), this.$$("ultra-res-support") && t.add(this._getUrlBase(this._getElSize(this.currentImg.img, 3)) + " 3x")), [...t].join(); 77390 } 77391 getSrc() { 77392 return this._getUrlBase(); 77393 } 77394 get srcUrlPreview() { 77395 return this._getUrlBase("100x", "100"); 77396 } 77397 renderBackground() { 77398 [...document.querySelectorAll(this.bgSelector)].forEach((t) => { 77399 this.$$("intersection") ? this.initIntersection(t, () => { 77400 this.renderBg(t); 77401 }) : this.renderBg(t); 77402 }); 77403 } 77404 _appendURL({ elNode: t, src: i, srcset: s }) { 77405 i && (t.src = i), s && (t.srcset = s); 77406 } 77407 _setupConfigForImage({ elNode: t }) { 77408 this._setupEventProxy(t), this.initAttributes(t); 77409 } 77410 loaderImage({ src: t, srcset: i, elNode: s }) { 77411 return new Promise((n, o) => { 77412 this._setupConfigForImage({ elNode: s }), s.setAttribute(iL, ""), s.addEventListener("load", () => { 77413 s.removeAttribute(iL), n(s); 77414 }), s.addEventListener("error", () => { 77415 o(!1); 77416 }), this._appendURL({ 77417 elNode: s, 77418 src: t, 77419 srcset: i 77420 }); 77421 }); 77422 } 77423 async renderImage() { 77424 if (this.$$("intersection")) { 77425 this.hasPreviewImage && (this._setupConfigForImage({ elNode: this._imgPreview }), this.appendChild(this._imgPreview)), this.initIntersection(this.currentImg.img, async () => { 77426 this.hasPreviewImage && (this._imgPreview.src = this.srcUrlPreview); 77427 try { 77428 await this.loaderImage({ 77429 src: this.getSrc(), 77430 srcset: this.getSrcset(), 77431 elNode: this._img 77432 }), this.hasPreviewImage && await this._imgPreview.remove(), this.appendChild(this._img); 77433 } catch { 77434 this.hasPreviewImage && await this._imgPreview?.remove(), this.appendChild(this._img); 77435 } 77436 }); 77437 return; 77438 } 77439 try { 77440 this.hasPreviewImage && (await this.loaderImage({ 77441 src: this.srcUrlPreview, 77442 elNode: this._imgPreview 77443 }), this.appendChild(this._imgPreview)), await this.loaderImage({ 77444 src: this.getSrc(), 77445 srcset: this.getSrcset(), 77446 elNode: this._img 77447 }), this.hasPreviewImage && await this._imgPreview?.remove(), this.appendChild(this._img); 77448 } catch { 77449 this.hasPreviewImage && await this._imgPreview?.remove(), this.appendChild(this._img); 77450 } 77451 } 77452 init() { 77453 this.bgSelector ? this.renderBackground() : this.renderImage(); 77454 } 77455} 77456class Cve extends yve { 77457 initCallback() { 77458 super.initCallback(), this.sub$$("src", () => { 77459 this.init(); 77460 }), this.sub$$("uuid", () => { 77461 this.init(); 77462 }), this.sub$$("lazy", (t) => { 77463 !this.$$("is-background-for") && !this.$$("is-preview-blur") && (this.img.loading = t ? "lazy" : "eager"); 77464 }); 77465 } 77466} 77467class qM extends fs { 77468 static styleAttrs = [...super.styleAttrs, "uc-simple-btn"]; 77469 couldBeCtxOwner = !0; 77470 constructor() { 77471 super(), this.init$ = { 77472 ...this.init$, 77473 withDropZone: !0, 77474 onClick: () => { 77475 this.api.initFlow(); 77476 }, 77477 "button-text": "" 77478 }; 77479 } 77480 initCallback() { 77481 super.initCallback(), this.defineAccessor( 77482 "dropzone", 77483 /** @param {unknown} val */ 77484 (t) => { 77485 typeof t > "u" || (this.$.withDropZone = mi(t)); 77486 } 77487 ), this.subConfigValue("multiple", (t) => { 77488 this.$["button-text"] = t ? "upload-files" : "upload-file"; 77489 }); 77490 } 77491} 77492qM.template = /* HTML */ 77493` 77494 <uc-drop-area set="@disabled: !withDropZone"> 77495 <button type="button" set="onclick: onClick"> 77496 <uc-icon name="upload"></uc-icon> 77497 <span l10n="button-text"></span> 77498 <slot></slot> 77499 <div class="uc-visual-drop-area" l10n="drop-files-here"></div> 77500 </button> 77501 </uc-drop-area> 77502`; 77503qM.bindAttributes({ 77504 // @ts-expect-error TODO: we need to update symbiote types 77505 dropzone: null 77506}); 77507class R3 extends gt { 77508 historyTracked = !0; 77509 /** @type {import('../../abstract/ActivityBlock.js').ActivityType} */ 77510 activityType = "start-from"; 77511 initCallback() { 77512 super.initCallback(), this.registerActivity(this.activityType); 77513 } 77514} 77515R3.template = /* HTML */ 77516' <div class="uc-content"><slot></slot></div> '; 77517function bve(e) { 77518 return new Promise((t) => { 77519 typeof window.FileReader != "function" && t(!1); 77520 try { 77521 let i = new FileReader(); 77522 i.onerror = () => { 77523 t(!0); 77524 }; 77525 let s = (n) => { 77526 n.type !== "loadend" && i.abort(), t(!1); 77527 }; 77528 i.onloadend = s, i.onprogress = s, i.readAsDataURL(e); 77529 } catch { 77530 t(!1); 77531 } 77532 }); 77533} 77534function wve(e, t) { 77535 return new Promise((i) => { 77536 let s = 0; 77537 const n = [], o = (a) => { 77538 a || (console.warn("Unexpectedly received empty content entry", { scope: "drag-and-drop" }), i(null)), a.isFile ? (s++, a.file((l) => { 77539 s--; 77540 const c = new File([l], l.name, { type: l.type || t }); 77541 n.push({ 77542 type: "file", 77543 file: c, 77544 fullPath: a.fullPath 77545 }), s === 0 && i(n); 77546 })) : a.isDirectory && r( 77547 /** @type {FileSystemDirectoryEntry} */ 77548 a.createReader() 77549 ); 77550 }; 77551 let r = (a) => { 77552 s++, a.readEntries((l) => { 77553 s--; 77554 for (let c of l) 77555 o(c); 77556 s === 0 && i(n); 77557 }); 77558 }; 77559 o(e); 77560 }); 77561} 77562function Sve(e) { 77563 const t = [], i = []; 77564 for (let s = 0; s < e.items.length; s++) { 77565 let n = e.items[s]; 77566 if (n) 77567 if (n.kind === "file") { 77568 const o = n.type; 77569 if (typeof n.webkitGetAsEntry == "function" || typeof /** @type {any} */ 77570 n.getAsEntry == "function") { 77571 let a = typeof n.webkitGetAsEntry == "function" ? n.webkitGetAsEntry() : ( 77572 /** @type {any} */ 77573 n.getAsEntry() 77574 ); 77575 i.push( 77576 wve(a, o).then((l) => { 77577 l && t.push(...l); 77578 }) 77579 ); 77580 continue; 77581 } 77582 const r = n.getAsFile(); 77583 r && i.push( 77584 bve(r).then((a) => { 77585 a || t.push({ 77586 type: "file", 77587 file: r 77588 }); 77589 }) 77590 ); 77591 }
77591 else n.kind === "string" && n.type.match("^text/uri-list") && i.push( 77592 new Promise((o) => { 77593 n.getAsString((r) => { 77594 t.push({ 77595 type: "url", 77596 url: r 77597 }), o(void 0); 77598 }); 77599 }) 77600 ); 77601 } 77602 return Promise.all(i).then(() => t); 77603} 77604const dn = { 77605 ACTIVE: 0, 77606 INACTIVE: 1, 77607 NEAR: 2, 77608 OVER: 3 77609}; 77610let aL = ["focus"], xve = 100, $0 = /* @__PURE__ */ new Map(); 77611function Mve(e, t) { 77612 let i = Math.max(Math.min(e[0], t.x + t.width), t.x), s = Math.max(Math.min(e[1], t.y + t.height), t.y); 77613 return Math.sqrt((e[0] - i) * (e[0] - i) + (e[1] - s) * (e[1] - s)); 77614} 77615function lL(e) { 77616 let t = 0, i = document.body, s = /* @__PURE__ */ new Set(), n = (m) => s.add(m), o = dn.INACTIVE, r = (m) => { 77617 e.shouldIgnore() && m !== dn.INACTIVE || (o !== m && s.forEach((y) => y(m)), o = m); 77618 }, a = () => t > 0; 77619 n((m) => e.onChange(m)); 77620 let l = () => { 77621 t = 0, r(dn.INACTIVE); 77622 }, c = () => { 77623 t += 1, o === dn.INACTIVE && r(dn.ACTIVE); 77624 }, u = () => { 77625 t -= 1, a() || r(dn.INACTIVE); 77626 }, d = (m) => { 77627 m.preventDefault(), t = 0, r(dn.INACTIVE); 77628 }, p = (m) => { 77629 if (e.shouldIgnore()) 77630 return; 77631 a() || (t += 1); 77632 let y = [m.x, m.y], b = e.element.getBoundingClientRect(), C = Math.floor(Mve(y, b)), w = C < xve, M = m.composedPath().includes(e.element); 77633 $0.set(e.element, C); 77634 let A = Math.min(...$0.values()) === C; 77635 M && A ? (m.preventDefault(), r(dn.OVER)) : r(w && A ? dn.NEAR : dn.ACTIVE); 77636 }, f = async (m) => { 77637 if (e.shouldIgnore()) 77638 return; 77639 m.preventDefault(); 77640 let y = await Sve(m.dataTransfer); 77641 e.onItems(y), r(dn.INACTIVE); 77642 }; 77643 return i.addEventListener("drop", d), i.addEventListener("dragleave", u), i.addEventListener("dragenter", c), i.addEventListener("dragover", p), e.element.addEventListener("drop", f), aL.forEach((m) => { 77644 window.addEventListener(m, l); 77645 }), () => { 77646 $0.delete(e.element), i.removeEventListener("drop", d), i.removeEventListener("dragleave", u), i.removeEventListener("dragenter", c), i.removeEventListener("dragover", p), e.element.removeEventListener("drop", f), aL.forEach((m) => { 77647 window.removeEventListener(m, l); 77648 }); 77649 }; 77650} 77651const T3 = "uc-drop-area", Ru = `${T3}/registry`; 77652class QM extends fs { 77653 static styleAttrs = [...super.styleAttrs, "uc-drop-area"]; 77654 constructor() { 77655 super(), this.init$ = { 77656 ...this.init$, 77657 state: dn.INACTIVE, 77658 withIcon: !1, 77659 isClickable: !1, 77660 isFullscreen: !1, 77661 isEnabled: !0, 77662 isVisible: !0, 77663 text: "", 77664 [Ru]: null 77665 }; 77666 } 77667 isActive() { 77668 if (!this.$.isEnabled) 77669 return !1; 77670 const t = this.getBoundingClientRect(), i = t.width > 0 && t.height > 0, s = t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth), n = window.getComputedStyle(this), o = n.visibility !== "hidden" && n.display !== "none"; 77671 return i && o && s; 77672 } 77673 initCallback() { 77674 super.initCallback(), this.bindL10n("text", () => this.l10n("drop-files-here")), this.$[Ru] || (this.$[Ru] = /* @__PURE__ */ new Set()), this.$[Ru].add(this), this.defineAccessor( 77675 "disabled", 77676 /** @param {unknown} value */ 77677 (i) => { 77678 this.set$({ isEnabled: !mi(i) }); 77679 } 77680 ), this.defineAccessor( 77681 "clickable", 77682 /** @param {unknown} value */ 77683 (i) => { 77684 this.set$({ isClickable: mi(i) }); 77685 } 77686 ), this.defineAccessor( 77687 "with-icon", 77688 /** @param {unknown} value */ 77689 (i) => { 77690 this.set$({ withIcon: mi(i) }); 77691 } 77692 ), this.defineAccessor( 77693 "fullscreen", 77694 /** @param {unknown} value */ 77695 (i) => { 77696 this.set$({ isFullscreen: mi(i) }); 77697 } 77698 ), this.defineAccessor( 77699 "text", 77700 /** @param {unknown} value */ 77701 (i) => { 77702 typeof i == "string" ? this.bindL10n("text", () => this.l10n(i) || i) : this.bindL10n("text", () => this.l10n("drop-files-here")); 77703 } 77704 ), this._destroyDropzone = lL({ 77705 element: this, 77706 shouldIgnore: () => this._shouldIgnore(), 77707 /** @param {DropzoneState} state */ 77708 onChange: (i) => { 77709 this.$.state = i; 77710 }, 77711 /** @param {import('./getDropItems.js').DropItem[]} items */ 77712 onItems: (i) => { 77713 i.length && (i.forEach((s) => { 77714 s.type === "url" ? this.api.addFileFromUrl(s.url, { source: bs.DROP_AREA }) : s.type === "file" && this.api.addFileFromObject(s.file, { source: bs.DROP_AREA, fullPath: s.fullPath }); 77715 }), this.uploadCollection.size && (this.set$({ 77716 "*currentActivity": gt.activities.UPLOAD_LIST 77717 }), this.setOrAddState("*modalActive", !0))); 77718 } 77719 }); 77720 let t = this.ref["content-wrapper"]; 77721 t && (this._destroyContentWrapperDropzone = lL({ 77722 element: t, 77723 /** @param {DropzoneState} state */ 77724 onChange: (i) => { 77725 const s = Object.entries(dn).find(([, n]) => n === i)?.[0].toLowerCase(); 77726 s && t.setAttribute("drag-state", s); 77727 }, 77728 onItems: () => { 77729 }, 77730 shouldIgnore: () => this._shouldIgnore() 77731 })), this.sub("state", (i) => { 77732 const s = Object.entries(dn).find(([, n]) => n === i)?.[0].toLowerCase(); 77733 s && this.setAttribute("drag-state", s); 77734 }), this.subConfigValue("sourceList", (i) => { 77735 const s = El(i); 77736 this.$.isEnabled = s.includes(bs.LOCAL), this.$.isVisible = this.$.isEnabled || !this.querySelector("[data-default-slot]"); 77737 }), this.sub("isVisible", (i) => { 77738 this.toggleAttribute("hidden", !i); 77739 }), this.sub("isClickable", (i) => { 77740 this.toggleAttribute("clickable", i); 77741 }), this.$.isClickable && (this._onAreaClicked = (i) => { 77742 i.type === "keydown" ? (i.code === "Space" || i.code === "Enter") && this.api.openSystemDialog() : i.type === "click" && this.api.openSystemDialog(); 77743 }, this.addEventListener("keydown", this._onAreaClicked), this.addEventListener("click", this._onAreaClicked)); 77744 } 77745 /** 77746 * Ignore drop events if there are other visible drop areas on the page 77747 * 77748 * @private 77749 * @returns {Boolean} 77750 */ 77751 _shouldIgnore() { 77752 return !this.$.isEnabled || !this._couldHandleFiles() ? !0 : this.$.isFullscreen ? [...this.$[Ru]].filter((s) => s !== this).filter((s) => s.isActive()).length > 0 : !1; 77753 } 77754 /** @private */
77755 _couldHandleFiles() { 77756 let t = this.cfg.multiple, i = this.cfg.multipleMax, s = this.uploadCollection.size; 77757 return !(t && i && s >= i || !t && s > 0); 77758 } 77759 destroyCallback() { 77760 super.destroyCallback(); 77761 const t = this.$[Ru]; 77762 t && (t.delete(this), t.size === 0 && $t.deleteCtx(T3)), this._destroyDropzone?.(), this._destroyContentWrapperDropzone?.(), this._onAreaClicked && (this.removeEventListener("keydown", this._onAreaClicked), this.removeEventListener("click", this._onAreaClicked)); 77763 } 77764} 77765QM.template = /* HTML */ 77766` 77767 <slot> 77768 <div data-default-slot hidden></div> 77769 <div ref="content-wrapper" class="uc-content-wrapper" set="@hidden: !isVisible"> 77770 <div class="uc-icon-container" set="@hidden: !withIcon"> 77771 <uc-icon name="default"></uc-icon> 77772 <uc-icon name="arrow-down"></uc-icon> 77773 </div> 77774 <span class="uc-text">{{text}}</span> 77775 </div> 77776 </slot> 77777`; 77778QM.bindAttributes({ 77779 // @ts-expect-error TODO: fix types inside symbiote 77780 "with-icon": null, 77781 // @ts-expect-error TODO: fix types inside symbiote 77782 clickable: null, 77783 // @ts-expect-error TODO: fix types inside symbiote 77784 text: null, 77785 // @ts-expect-error TODO: fix types inside symbiote 77786 fullscreen: null, 77787 // @ts-expect-error TODO: fix types inside symbiote 77788 disabled: null 77789}); 77790const Ave = "src-type-"; 77791class XM extends fs { 77792 couldBeCtxOwner = !0; 77793 /** @type {string | undefined} */ 77794 type = void 0; 77795 /** 77796 * @private 77797 * @type {Record<string, TConfig>} 77798 */ 77799 _registeredTypes = {}; 77800 constructor() { 77801 super(), this.init$ = { 77802 ...this.init$, 77803 iconName: "default", 77804 "src-type": "" 77805 }; 77806 } 77807 initTypes() { 77808 this.registerType({ 77809 type: bs.LOCAL, 77810 activate: () => (this.api.openSystemDialog(), !1) 77811 }), this.registerType({ 77812 type: bs.URL, 77813 activity: gt.activities.URL, 77814 textKey: "from-url" 77815 }), this.registerType({ 77816 type: bs.CAMERA, 77817 activity: gt.activities.CAMERA, 77818 activate: () => { 77819 const t = "capture" in document.createElement("input"); 77820 return t && this.api.openSystemDialog({ captureCamera: !0 }), !t; 77821 } 77822 }), this.registerType({ 77823 type: "draw", 77824 activity: gt.activities.DRAW, 77825 icon: "edit-draw" 77826 }); 77827 for (let t of Object.values(gC)) 77828 this.registerType({ 77829 type: t, 77830 activity: gt.activities.EXTERNAL, 77831 activityParams: { 77832 externalSourceType: t 77833 } 77834 }); 77835 } 77836 initCallback() { 77837 super.initCallback(), this.initTypes(), this.defineAccessor( 77838 "type", 77839 /** @param {string} val */ 77840 (t) => { 77841 t && this.applyType(t); 77842 } 77843 ); 77844 } 77845 /** @param {TConfig} typeConfig */ 77846 registerType(t) { 77847 this._registeredTypes[t.type] = t; 77848 } 77849 /** @param {string} type */ 77850 getType(t) { 77851 return this._registeredTypes[t]; 77852 } 77853 activate() { 77854 if (!this.type) 77855 return; 77856 const t = this._registeredTypes[this.type], { activity: i, activate: s, activityParams: n = {} } = t; 77857 (s ? s() : i) && this.set$({ 77858 "*currentActivityParams": n, 77859 "*currentActivity": i 77860 }); 77861 } 77862 /** @param {string} type */ 77863 applyType(t) { 77864 const i = this._registeredTypes[t]; 77865 if (!i) { 77866 console.warn("Unsupported source type: " + t); 77867 return; 77868 } 77869 const { textKey: s = t, icon: n = t } = i; 77870 this.$["src-type"] = `${Ave}${s}`, this.$.iconName = n, this.onclick = () => { 77871 this.activate(); 77872 }; 77873 } 77874} 77875XM.template = /* HTML */ 77876` 77877 <button type="button"> 77878 <uc-icon set="@name: iconName"></uc-icon> 77879 <div class="uc-txt" l10n="src-type"></div> 77880 </button> 77881`; 77882XM.bindAttributes({ 77883 // @ts-expect-error symbiote types bug 77884 type: null 77885}); 77886class Dve extends Ti { 77887 initCallback() { 77888 super.initCallback(), this.subConfigValue("sourceList", (t) => { 77889 let i = El(t), s = ""; 77890 i.forEach((n) => { 77891 if (n === "instagram") { 77892 console.error( 77893 "Instagram source was removed because the Instagram Basic Display API hasn't been available since December 4, 2024. Official statement, see here:https://developers.facebook.com/blog/post/2024/09/04/update-on-instagram-basic-display-api/?locale=en_US" 77894 ); 77895 return; 77896 } 77897 s += /* HTML */ 77898 `<uc-source-btn type="${n}"></uc-source-btn>`; 77899 }), this.cfg.sourceListWrap ? this.innerHTML = s : this.outerHTML = s; 77900 }); 77901 } 77902} 77903const mC = () => { 77904 const e = []; 77905 return { 77906 stack: e, 77907 promiseReadJpegChunks: (i) => new Promise((s, n) => { 77908 let o = 2; 77909 const r = (c, u) => { 77910 const d = new FileReader(); 77911 d.addEventListener("load", () => { 77912 u(new DataView(d.result)); 77913 }), d.addEventListener("error", (p) => { 77914 n(`Reader error: ${p}`); 77915 }), d.readAsArrayBuffer(c); 77916 }, a = () => r(i.slice(o, o + 128), (c) => { 77917 let u, d, p; 77918 for (u = d = 0, p = c.byteLength; p >= 0 ? d < p : d > p; u = p >= 0 ? ++d : --d) 77919 if (c.getUint8(u) === 255) { 77920 o += u; 77921 break; 77922 } 77923 l(); 77924 }), l = () => { 77925 const c = o; 77926 return r(i.slice(o, o += 4), (u) => { 77927 if (u.byteLength !== 4 || u.getUint8(0) !== 255) { 77928 n("Corrupted"); 77929 return; 77930 } 77931 const d = u.getUint8(1); 77932 if (d === 218) { 77933 s(!0); 77934 return; 77935 } 77936 const p = u.getUint16(2) - 2; 77937 return r(i.slice(o, o += p), (f) => { 77938 if (f.byteLength !== p) { 77939 n("Corrupted"); 77940 return; 77941 } 77942 e.push({ startPos: c, length: p, marker: d, view: f }), a(); 77943 }); 77944 }); 77945 }; 77946 FileReader && DataView || n("Not Support"), r(i.slice(0, 2), (c) => { 77947 c.getUint16(0) !== 65496 && n("Not jpeg"), a(); 77948 }); 77949 }) 77950 }; 77951}, Eve = async (e) => { 77952 const t = [], { promiseReadJpegChunks: i, stack: s } = mC();
77953 return await i(e), s.forEach(({ marker: n, view: o }) => { 77954 n === 226 && // check for "ICC_PROFILE\0" 77955 o.getUint32(0) === 1229144927 && o.getUint32(4) === 1347571526 && o.getUint32(8) === 1229735168 && t.push(o); 77956 }), t; 77957}, L3 = async (e, t, i) => { 77958 { 77959 const s = [], n = [], { promiseReadJpegChunks: o, stack: r } = mC(); 77960 await o(e), r.forEach((c) => { 77961 if (c.marker === t) 77962 return s.push(c.startPos), n.push(c.length); 77963 }); 77964 const a = [e.slice(0, 2)]; 77965 for (const c of i) { 77966 const u = new DataView(new ArrayBuffer(4)); 77967 u.setUint16(0, 65280 + t), u.setUint16(2, c.byteLength + 2), a.push(u.buffer), a.push(c); 77968 } 77969 let l = 2; 77970 for (let c = 0; c < s.length; c++) 77971 s[c] > l && a.push(e.slice(l, s[c])), l = s[c] + n[c] + 4; 77972 return a.push(e.slice(l, e.size)), new Blob(a, { 77973 type: e.type 77974 }); 77975 } 77976}, Ive = 226, k3 = (e, t) => L3(e, Ive, t.map((i) => i.buffer)), Rve = async (e) => { 77977 try { 77978 return await k3(e, []); 77979 } catch (t) { 77980 throw new Error(`Failed to strip ICC profile: ${t}`); 77981 } 77982}, Tve = (e, t, i) => new Promise((s, n) => { 77983 const o = (r) => { 77984 if (!r) { 77985 n("Failed to convert canvas to blob"); 77986 return; 77987 } 77988 s(r); 77989 }; 77990 e.toBlob(o, t, i), e.width = e.height = 1; 77991}), sg = () => { 77992 const e = document.createElement("canvas"), t = e.getContext("2d"); 77993 return { 77994 canvas: e, 77995 ctx: t 77996 }; 77997}, Lve = (e) => { 77998 const { ctx: i, canvas: s } = sg(); 77999 s.width = s.height = 50, i.drawImage(e, 0, 0, 50, 50); 78000 const n = i.getImageData(0, 0, 50, 50).data; 78001 s.width = s.height = 1; 78002 for (let o = 3; o < n.length; o += 4) 78003 if (n[o] < 254) 78004 return !0; 78005 return !1; 78006}, kve = async (e) => { 78007 let t = null; 78008 const { promiseReadJpegChunks: i, stack: s } = mC(); 78009 return await i(e), s.forEach(({ marker: n, view: o }) => { 78010 if (!t && n === 225 && o.byteLength >= 14 && // check for "Exif\0" 78011 o.getUint32(0) === 1165519206 && o.getUint16(4) === 0) { 78012 t = o; 78013 return; 78014 } 78015 }), t; 78016}, Pve = "data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k="; 78017let im; 78018const Fve = () => new Promise((e) => { 78019 if (im !== void 0) 78020 e(im); 78021 else { 78022 const t = new Image(); 78023 t.addEventListener("load", () => { 78024 im = t.naturalWidth < t.naturalHeight, t.src = "//:0", e(im); 78025 }), t.src = Pve; 78026 } 78027}), Ove = (e, t) => { 78028 let i, s, n, o; 78029 if (!e || e.byteLength < 14 || e.getUint32(0) !== 1165519206 || e.getUint16(4) !== 0) 78030 return; 78031 if (e.getUint16(6) === 18761) 78032 s = !0; 78033 else if (e.getUint16(6) === 19789) 78034 s = !1; 78035 else 78036 return; 78037 if (e.getUint16(8, s) !== 42) 78038 return; 78039 n = 8 + e.getUint32(10, s); 78040 const r = e.getUint16(n - 2, s); 78041 for (i = 0, o = r; o >= 0 ? i < o : i > o; o >= 0 ? ++i : --i) { 78042 if (e.byteLength < n + 10) 78043 return; 78044 e.getUint16(n, s) === 274 && t(n + 8, s), n += 12; 78045 } 78046}, Nve = (e, t) => { 78047 Ove(e, (i, s) => e.setUint16(i, t, s)); 78048}, _ve = async (e, t, i) => (i && Nve(t, 1), L3(e, 225, [t.buffer])), Bve = (e, t) => new Promise((i, s) => { 78049 t && (e.src = t), e.complete ? i(e) : (e.addEventListener("load", () => { 78050 i(e); 78051 }), e.addEventListener("error", () => { 78052 s(new Error("Failed to load image. Probably not an image.")); 78053 })); 78054}), Gve = (e) => Bve(new Image(), e), zve = [ 78055 1, 78056 // L (black-white) 78057 3 78058 // RGB 78059], Hve = [ 78060 192, 78061 // ("SOF0", "Baseline DCT", SOF) 78062 193, 78063 // ("SOF1", "Extended Sequential DCT", SOF) 78064 194, 78065 // ("SOF2", "Progressive DCT", SOF) 78066 195, 78067 // ("SOF3", "Spatial lossless", SOF) 78068 197, 78069 // ("SOF5", "Differential sequential DCT", SOF) 78070 198, 78071 // ("SOF6", "Differential progressive DCT", SOF) 78072 199, 78073 // ("SOF7", "Differential spatial", SOF) 78074 201, 78075 // ("SOF9", "Extended sequential DCT (AC)", SOF) 78076 202, 78077 // ("SOF10", "Progressive DCT (AC)", SOF) 78078 203, 78079 // ("SOF11", "Spatial lossless DCT (AC)", SOF) 78080 205, 78081 // ("SOF13", "Differential sequential DCT (AC)", SOF) 78082 206, 78083 // ("SOF14", "Differential progressive DCT (AC)", SOF) 78084 207 78085 // ("SOF15", "Differential spatial (AC)", SOF) 78086], cL = { 78087 squareSide: [ 78088 // Safari (iOS < 9, ram >= 256) 78089 // We are supported mobile safari < 9 since widget v2, by 5 Mpx limit 78090 // so it's better to continue support despite the absence of this browser in the support table 78091 Math.floor(Math.sqrt(5 * 1e3 * 1e3)), 78092 // IE Mobile (Windows Phone 8.x) 78093 // Safari (iOS >= 9) 78094 4096, 78095 // IE 9 (Win) 78096 8192, 78097 // Firefox 63 (Mac, Win) 78098 11180, 78099 // Chrome 68 (Android 6) 78100 10836, 78101 // Chrome 68 (Android 5) 78102 11402, 78103 // Chrome 68 (Android 7.1-9) 78104 14188, 78105 // Chrome 70 (Mac, Win) 78106 // Chrome 68 (Android 4.4) 78107 // Edge 17 (Win) 78108 // Safari 7-12 (Mac) 78109 16384 78110 ], 78111 dimension: [ 78112 // IE Mobile (Windows Phone 8.x) 78113 4096, 78114 // IE 9 (Win) 78115 8192, 78116 // Edge 17 (Win) 78117 // IE11 (Win) 78118 16384, 78119 // Chrome 70 (Mac, Win) 78120 // Chrome 68 (Android 4.4-9) 78121 // Firefox 63 (Mac, Win) 78122 32767, 78123 // Chrome 83 (Mac, Win) 78124 // Safari 7-12 (Mac) 78125 // Safari (iOS 9-12)
78126 // Actually Safari has a much bigger limits - 4194303 of width and 8388607 of height, 78127 // but we will not use them 78128 65535 78129 ] 78130}, Vve = async (e) => { 78131 let t = !1; 78132 const { promiseReadJpegChunks: i, stack: s } = mC(); 78133 return await i(e).then(() => (s.forEach(({ marker: n, view: o }) => { 78134 if (!t && Hve.indexOf(n) >= 0) { 78135 const r = o.getUint8(5); 78136 zve.indexOf(r) < 0 && (t = !0); 78137 } 78138 }), t)).catch(() => t); 78139}, P3 = (e, t) => { 78140 const i = {}; 78141 return (...s) => { 78142 const n = t(s, i); 78143 return n in i ? i[n] : i[n] = e(...s); 78144 }; 78145}, F3 = (e, t) => { 78146 const [i] = e, s = Object.keys(t).map((n) => parseInt(n, 10)).sort((n, o) => n - o); 78147 for (let n = 0; n < s.length; n++) { 78148 const o = s[n], r = !!t[o]; 78149 if (o > i && r || o < i && !r) 78150 return o; 78151 } 78152 return i; 78153}, al = { 78154 R: 55, 78155 G: 110, 78156 B: 165, 78157 A: 255 78158}, Uve = `rgba(${al.R}, ${al.G}, ${al.B}, ${al.A / 255})`, O3 = (e, t) => { 78159 try { 78160 const i = [e - 1, t - 1, 1, 1], { canvas: s, ctx: n } = sg(); 78161 s.width = 1, s.height = 1; 78162 const { canvas: o, ctx: r } = sg(); 78163 o.width = e, o.height = t, r && (r.fillStyle = Uve, r.fillRect(...i), n.drawImage(o, e - 1, t - 1, 1, 1, 0, 0, 1, 1)); 78164 const a = n && n.getImageData(0, 0, 1, 1).data; 78165 let l = !1; 78166 return a && (l = a[0] === al.R && a[1] === al.G && a[2] === al.B && a[3] === al.A), o.width = o.height = 1, l; 78167 } catch { 78168 return console.error(`Failed to test for max canvas size of ${e}x${t}.`), !1; 78169 } 78170}; 78171function N3(e) { 78172 return (...t) => new Promise((i) => { 78173 setTimeout(() => { 78174 const s = e(...t); 78175 i(s); 78176 }, 0); 78177 }); 78178} 78179const Wve = N3(P3(O3, F3)), jve = N3(P3(O3, F3)), _3 = async (e, t) => { 78180 const i = cL.squareSide.find((r) => r * r >= e * t), s = cL.dimension.find((r) => r >= e && r >= t); 78181 if (!i || !s) 78182 throw new Error("Not supported"); 78183 const [n, o] = await Promise.all([ 78184 Wve(i, i), 78185 jve(s, 1) 78186 ]); 78187 if (n && o) 78188 return !0; 78189 throw new Error("Not supported"); 78190}, B3 = async (e, t, i) => { 78191 try { 78192 const { ctx: s, canvas: n } = sg(); 78193 return n.width = t, n.height = i, s.imageSmoothingQuality = "high", s.drawImage(e, 0, 0, t, i), e instanceof HTMLImageElement && (e.src = "//:0"), e instanceof HTMLCanvasElement && (e.width = e.height = 1), n; 78194 } catch (s) { 78195 throw new Error("Canvas resize error", { cause: s }); 78196 } 78197}, $ve = ({ img: e, targetW: t, targetH: i }) => B3(e, t, i), Yve = function({ sourceW: e, targetW: t, targetH: i, step: s }) { 78198 const n = []; 78199 let o = t, r = i; 78200 do 78201 n.push([o, r]), o = Math.round(o / s), r = Math.round(r / s); 78202 while (o < e * s); 78203 return n.reverse(); 78204}, Kve = ({ img: e, sourceW: t, targetW: i, targetH: s, step: n }) => { 78205 const o = Yve({ sourceW: t, targetW: i, targetH: s, step: n }); 78206 return o.reduce((r, [a, l], c) => r.then((u) => _3(a, l).then(() => B3(u, a, l)).catch(() => { 78207 if (c === o.length - 1) 78208 throw new Error("Not supported"); 78209 return u; 78210 })), Promise.resolve(e)); 78211}, Zve = () => /iPad|iPhone|iPod/.test(navigator.platform) ? !0 : navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), qve = navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && /MacIntel/.test(navigator.platform), Y0 = 0.71, Qve = (e, t) => { 78212 if (e.width * Y0 * e.height * Y0 < t.size) 78213 throw new Error("Not required"); 78214 const i = e.width, s = e.height, n = i / s, o = Math.floor(Math.sqrt(t.size * n)), r = Math.floor(t.size / Math.sqrt(t.size * n)); 78215 return _3(o, r).then(() => { 78216 const { ctx: a } = sg(); 78217 return "imageSmoothingQuality" in a && !Zve() && !qve ? $ve({ img: e, targetW: o, targetH: r }) : Kve({ img: e, sourceW: i, targetW: o, targetH: r, step: Y0 }); 78218 }).catch(() => Promise.reject("Not supported")); 78219}, Xve = async (e, t) => { 78220 try { 78221 if (await Vve(e)) 78222 throw new Error("Should skipped"); 78223 const s = await Promise.allSettled([ 78224 kve(e), 78225 Fve(), 78226 Eve(e) 78227 ]), o = !s.some((y) => y.status === "rejected"), [r, a, l] = s, c = await Rve(e).catch(() => e), u = await Gve(URL.createObjectURL(c)); 78228 URL.revokeObjectURL(u.src); 78229 const d = await Qve(u, t); 78230 let p = "image/jpeg", f = t?.quality || 0.8; 78231 !o && Lve(d) && (p = "image/png", f = void 0); 78232 let m = await Tve(d, p, f); 78233 if (o && r.status === "fulfilled" && r.value) { 78234 const y = r.value, b = a.status === "fulfilled" ? a.value : !1; 78235 m = await _ve(m, y, b); 78236 } 78237 return o && l.status === "fulfilled" && l.value.length > 0 && (m = await k3(m, l.value)), m; 78238 } catch (i) { 78239 let s; 78240 throw i instanceof Error && (s = i.message), typeof i == "string" && (s = i), new Error(`Failed to shrink image. ${s ? `Message: "${s}".` : ""}`, { cause: i }); 78241 } 78242}; 78243function Jve(e) { 78244 let t = new Blob([e], { 78245 type: "image/svg+xml" 78246 }); 78247 return URL.createObjectURL(t); 78248} 78249function uL(e = "hsl(209, 21%, 65%)", t = 32, i = 32) { 78250 return Jve( 78251 /*svg*/ 78252 ` 78253 <svg width="${t}" height="${i}" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"> 78254 <path fill-rule="evenodd" fill="${e}" d="M9.68848 8.70068C9.68848 8.42454 9.91233 8.20068 10.1885 8.20068H15.0885C15.2211 8.20068 15.3483 8.25336 15.442 8.34713L20.342 13.2471C20.4358 13.3409 20.4885 13.4681 20.4885 13.6007V21.3007C20.4885 21.5768 20.2646 21.8007 19.9885 21.8007H10.1885C9.91233 21.8007 9.68848 21.5768 9.68848 21.3007V8.70068ZM10.6885 9.20068V20.8007H19.4885V14.1007L15.0885 14.1007C14.8123 14.1007 14.5885 13.8768 14.5885 13.6007L14.5885 9.20068H10.6885ZM15.5885 9.90779L18.7814 13.1007L15.5885 13.1007L15.5885 9.90779Z"/> 78255 </svg> 78256 ` 78257 ); 78258} 78259function eye(e, t = 40) { 78260 if (e.type === "image/svg+xml") 78261 return URL.createObjectURL(e); 78262 let i = document.createElement("canvas"), s = i.getContext("2d"), n = new Image(), o = new Promise((r, a) => { 78263 n.onload = () => { 78264 let l = n.height / n.width; 78265 l > 1 ? (i.width = t, i.height = t * l) : (i.height = t, i.width = t / l), s.fillStyle = "rgb(240, 240, 240)", s.fillRect(0, 0, i.width, i.height), s.drawImage(n, 0, 0, i.width, i.height), i.toBlob((c) => { 78266 if (!c) { 78267 a(); 78268 return; 78269 } 78270 let u = URL.createObjectURL(c); 78271 r(u); 78272 }); 78273 }, n.onerror = (l) => { 78274 a(l); 78275 }; 78276 }); 78277 return n.src = URL.createObjectURL(e), o; 78278} 78279const dL = 16384, tye = /^([0-9]+)x([0-9]+)(?:\s+(\d{1,2}|100)%)?$/i, iye = (e) => { 78280 const t = tye.exec(e?.toLocaleLowerCase()) || []; 78281 if (!t.length) 78282 return !1; 78283 const i = t[1] * t[2], s = dL * dL; 78284 return i > s ? (console.warn(
78285 `Shrinked size can not be larger than ${Math.floor(s / 1e3 / 1e3)}MP. You have set ${t[1]}x${t[2]} (${Math.ceil(i / 1e3 / 100) / 10}MP).` 78286 ), !1) : { 78287 quality: t[3] ? t[3] / 100 : void 0, 78288 size: i 78289 }; 78290}, io = Object.freeze({ 78291 FINISHED: /* @__PURE__ */ Symbol("FINISHED"), 78292 FAILED: /* @__PURE__ */ Symbol("FAILED"), 78293 UPLOADING: /* @__PURE__ */ Symbol("UPLOADING"), 78294 IDLE: /* @__PURE__ */ Symbol("IDLE") 78295}); 78296class Lc extends fs { 78297 couldBeCtxOwner = !0; 78298 pauseRender = !0; 78299 /** @private */ 78300 _entrySubs = /* @__PURE__ */ new Set(); 78301 /** 78302 * @private 78303 * @type {any} TODO: Add types for upload entry 78304 */ 78305 _entry = null; 78306 /** @private */ 78307 _isIntersecting = !1; 78308 /** @private */ 78309 _debouncedGenerateThumb = wo(this._generateThumbnail.bind(this), 100); 78310 /** @private */ 78311 _debouncedCalculateState = wo(this._calculateState.bind(this), 100); 78312 /** @private */ 78313 _renderedOnce = !1; 78314 constructor() { 78315 super(), this.init$ = { 78316 ...this.init$, 78317 uid: "", 78318 itemName: "", 78319 errorText: "", 78320 thumbUrl: "", 78321 progressValue: 0, 78322 progressVisible: !1, 78323 badgeIcon: "", 78324 isFinished: !1, 78325 isFailed: !1, 78326 isUploading: !1, 78327 isFocused: !1, 78328 isEditable: !1, 78329 state: io.IDLE, 78330 ariaLabelStatusFile: "", 78331 onEdit: () => { 78332 this.$["*currentActivityParams"] = { 78333 internalId: this._entry.uid 78334 }, this.$["*currentActivity"] = gt.activities.CLOUD_IMG_EDIT; 78335 }, 78336 onRemove: () => { 78337 this.uploadCollection.remove(this.$.uid); 78338 }, 78339 onUpload: () => { 78340 this.upload(); 78341 } 78342 }; 78343 } 78344 _reset() { 78345 for (let t of this._entrySubs) 78346 t.remove(); 78347 this._debouncedGenerateThumb.cancel(), this._debouncedCalculateState.cancel(), this._entrySubs = /* @__PURE__ */ new Set(), this._entry = null; 78348 } 78349 /** 78350 * @private 78351 * @param {IntersectionObserverEntry[]} entries 78352 */ 78353 _observerCallback(t) { 78354 let [i] = t; 78355 this._isIntersecting = i.isIntersecting, i.isIntersecting && !this._renderedOnce && (this.render(), this._renderedOnce = !0), i.intersectionRatio === 0 ? this._debouncedGenerateThumb.cancel() : this._debouncedGenerateThumb(); 78356 } 78357 /** @private */ 78358 _calculateState() { 78359 if (!this._entry) 78360 return; 78361 let t = this._entry, i = io.IDLE; 78362 t.getValue("errors").length > 0 ? i = io.FAILED : t.getValue("isUploading") ? i = io.UPLOADING : t.getValue("fileInfo") && (i = io.FINISHED), this.$.state = i; 78363 } 78364 /** @private */ 78365 async _generateThumbnail() { 78366 if (!this._entry) 78367 return; 78368 let t = this._entry; 78369 if (t.getValue("fileInfo") && t.getValue("isImage")) { 78370 let i = this.cfg.thumbSize, s = await this.proxyUrl( 78371 co( 78372 ig(this.cfg.cdnCname, this._entry.getValue("uuid")), 78373 Dl(t.getValue("cdnUrlModifiers"), `scale_crop/${i}x${i}/center`) 78374 ) 78375 ), n = t.getValue("thumbUrl"); 78376 n !== s && (t.setValue("thumbUrl", s), n?.startsWith("blob:") && URL.revokeObjectURL(n)); 78377 return; 78378 } 78379 if (!t.getValue("thumbUrl")) 78380 if (t.getValue("file")?.type.includes("image")) 78381 try { 78382 let i = await eye(t.getValue("file"), this.cfg.thumbSize); 78383 t.setValue("thumbUrl", i); 78384 } catch { 78385 let s = window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground"); 78386 t.setValue("thumbUrl", uL(s)); 78387 } 78388 else { 78389 let i = window.getComputedStyle(this).getPropertyValue("--uc-muted-foreground"); 78390 t.setValue("thumbUrl", uL(i)); 78391 } 78392 } 78393 /** 78394 * @private 78395 * @param {string} prop 78396 * @param {(value: any) => void} handler 78397 */ 78398 _subEntry(t, i) { 78399 let s = this._entry.subscribe( 78400 t, 78401 /** @param {any} value */ 78402 (n) => { 78403 this.isConnected && i(n); 78404 } 78405 ); 78406 this._entrySubs.add(s); 78407 } 78408 /** 78409 * @private 78410 * @param {String} id 78411 */ 78412 _handleEntryId(t) { 78413 this._reset(); 78414 let i = this.uploadCollection?.read(t); 78415 this._entry = i, i && (this._subEntry("uploadProgress", (s) => { 78416 this.$.progressValue = s; 78417 }), this._subEntry("fileName", (s) => { 78418 this.$.itemName = s || i.getValue("externalUrl") || this.l10n("file-no-name"), this._debouncedCalculateState(); 78419 }), this._subEntry("externalUrl", (s) => { 78420 this.$.itemName = i.getValue("fileName") || s || this.l10n("file-no-name"); 78421 }), this._subEntry("fileInfo", (s) => { 78422 this._debouncedCalculateState(), s && this._isIntersecting && this._debouncedGenerateThumb(); 78423 }), this._subEntry("cdnUrlModifiers", () => { 78424 this._isIntersecting && this._debouncedGenerateThumb(); 78425 }), this._subEntry("thumbUrl", (s) => { 78426 this.$.thumbUrl = s ? `url(${s})` : ""; 78427 }), this._subEntry("errors", () => this._debouncedCalculateState()), this._subEntry("isUploading", () => this._debouncedCalculateState()), this._subEntry("fileSize", () => this._debouncedCalculateState()), this._subEntry("mimeType", () => this._debouncedCalculateState()), this._subEntry("isImage", () => this._debouncedCalculateState()), this._isIntersecting && this._debouncedGenerateThumb()); 78428 } 78429 initCallback() { 78430 super.initCallback(), this.sub("uid", (t) => { 78431 this._handleEntryId(t); 78432 }), this.sub("state", (t) => { 78433 this._handleState(t); 78434 }), this.subConfigValue("useCloudImageEditor", () => this._debouncedCalculateState()), this.onclick = () => {
78435 Lc.activeInstances.forEach((t) => { 78436 t === this ? t.setAttribute("focused", "") : t.removeAttribute("focused"); 78437 }); 78438 }, this.sub( 78439 "*uploadTrigger", 78440 /** @param {Set<string>} itemsToUpload */ 78441 (t) => { 78442 t.has(this._entry.uid) && setTimeout(() => this.isConnected && this.upload()); 78443 } 78444 ), Lc.activeInstances.add(this); 78445 } 78446 /** @param {(typeof FileItemState)[keyof typeof FileItemState]} state */ 78447 _handleState(t) { 78448 t === io.FAILED ? this.$.badgeIcon = "badge-error" : t === io.FINISHED && (this.$.badgeIcon = "badge-success"), t === io.UPLOADING ? this.$.isFocused = !1 : this.$.progressValue = 0, this.set$({ 78449 isFailed: t === io.FAILED, 78450 isUploading: t === io.UPLOADING, 78451 isFinished: t === io.FINISHED, 78452 progressVisible: t === io.UPLOADING, 78453 isEditable: this.cfg.useCloudImageEditor && this._entry?.getValue("isImage") && this._entry?.getValue("cdnUrl"), 78454 errorText: this._entry.getValue("errors")?.[0]?.message, 78455 ariaLabelStatusFile: this.l10n("a11y-file-item-status", { 78456 fileName: this._entry?.getValue("fileName"), 78457 status: this.l10n(t?.description?.toLocaleLowerCase() ?? "").toLocaleLowerCase() 78458 }) 78459 }); 78460 } 78461 destroyCallback() { 78462 super.destroyCallback(), Lc.activeInstances.delete(this), this._reset(); 78463 } 78464 connectedCallback() { 78465 super.connectedCallback(), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), { 78466 threshold: [0, 1] 78467 }), this._observer.observe(this); 78468 } 78469 disconnectedCallback() { 78470 super.disconnectedCallback(), this._debouncedGenerateThumb.cancel(), this._observer?.disconnect(); 78471 } 78472 _settingsOfShrink() { 78473 return iye(this.cfg.imageShrink); 78474 } 78475 /** 78476 * @private 78477 * @param {File} file 78478 */ 78479 _processShrink(t) { 78480 return Xve(t, this._settingsOfShrink()); 78481 } 78482 async upload() { 78483 let t = this._entry; 78484 if (!this.uploadCollection.read(t.uid) || t.getValue("fileInfo") || t.getValue("isUploading") || t.getValue("errors").length > 0) 78485 return; 78486 const i = this.cfg.multiple ? this.cfg.multipleMax : 1; 78487 if (!(i && this.uploadCollection.size > i)) { 78488 this._debouncedCalculateState(), t.setValue("isUploading", !0), t.setValue("errors", []); 78489 try { 78490 let s = new AbortController(); 78491 t.setValue("abortController", s); 78492 const n = async () => { 78493 let r = t.getValue("file"); 78494 r && this.cfg.imageShrink && (r = await this._processShrink(r).catch(() => r)); 78495 const a = r || t.getValue("externalUrl") || t.getValue("uuid"), c = { 78496 ...await this.getUploadClientOptions(), 78497 fileName: t.getValue("fileName"), 78498 source: t.getValue("source"), 78499 onProgress: (u) => { 78500 if (u.isComputable) { 78501 let d = u.value * 100; 78502 t.setValue("uploadProgress", d); 78503 } 78504 }, 78505 signal: s.signal, 78506 metadata: await this.getMetadataFor(t.uid) 78507 }; 78508 return this.debugPrint("upload options", a, c), y3(a, c); 78509 }; 78510 let o = await this.$["*uploadQueue"].add(n); 78511 t.setMultipleValues({ 78512 fileInfo: o, 78513 isUploading: !1, 78514 fileName: o.originalFilename, 78515 fileSize: o.size, 78516 isImage: o.isImage, 78517 mimeType: o.contentInfo?.mime?.mime ?? o.mimeType, 78518 uuid: o.uuid, 78519 cdnUrl: t.getValue("cdnUrl") ?? o.cdnUrl, 78520 cdnUrlModifiers: t.getValue("cdnUrlModifiers") ?? "", 78521 uploadProgress: 100, 78522 source: t.getValue("source") ?? null 78523 }), t === this._entry && this._debouncedCalculateState(); 78524 } catch (s) { 78525 s instanceof ea && s.isCancel ? t.setMultipleValues({ 78526 isUploading: !1, 78527 uploadProgress: 0 78528 }) : t.setMultipleValues({ 78529 isUploading: !1, 78530 uploadProgress: 0, 78531 uploadError: s 78532 }), t === this._entry && this._debouncedCalculateState(); 78533 } 78534 } 78535 } 78536} 78537Lc.template = /* HTML */ 78538` 78539 <div class="uc-inner" set="@finished: isFinished; @uploading: isUploading; @failed: isFailed; @focused: isFocused"> 78540 <div class="uc-thumb" set="style.backgroundImage: thumbUrl"> 78541 <div class="uc-badge"> 78542 <uc-icon set="@name: badgeIcon"></uc-icon> 78543 </div> 78544 </div> 78545 <div aria-live="polite" class="uc-file-name-wrapper" set="@aria-label:ariaLabelStatusFile;">
78546 <span class="uc-file-name" set="@title: itemName">{{itemName}}</span> 78547 <span class="uc-file-error" set="@hidden: !errorText">{{errorText}}</span> 78548 </div> 78549 <div class="uc-file-actions"> 78550 <button 78551 type="button" 78552 l10n="@title:file-item-edit-button" 78553 class="uc-edit-btn uc-mini-btn" 78554 set="onclick: onEdit; @hidden: !isEditable" 78555 > 78556 <uc-icon name="edit-file"></uc-icon> 78557 </button> 78558 <button 78559 type="button" 78560 l10n="@title:file-item-remove-button" 78561 class="uc-remove-btn uc-mini-btn" 78562 set="onclick: onRemove;" 78563 > 78564 <uc-icon name="remove-file"></uc-icon> 78565 </button> 78566 <button type="button" class="uc-upload-btn uc-mini-btn" set="onclick: onUpload;"> 78567 <uc-icon name="upload"></uc-icon> 78568 </button> 78569 </div> 78570 <uc-progress-bar class="uc-progress-bar" set="value: progressValue; visible: progressVisible;"> </uc-progress-bar> 78571 </div> 78572`; 78573Lc.activeInstances = /* @__PURE__ */ new Set(); 78574class G3 extends Ti { 78575 static styleAttrs = [...super.styleAttrs, "uc-modal"]; 78576 static StateConsumerScope = "modal"; 78577 constructor() { 78578 super(), this.init$ = { 78579 ...this.init$, 78580 "*modalActive": !1, 78581 isOpen: !1, 78582 closeClicked: this._handleDialogClose 78583 }; 78584 } 78585 _handleBackdropClick = () => { 78586 this._closeDialog(); 78587 }; 78588 _closeDialog = () => { 78589 this.setOrAddState("*modalActive", !1); 78590 }; 78591 _handleDialogClose = () => { 78592 this._closeDialog(); 78593 }; 78594 /** @param {Event} e */ 78595 _handleDialogMouseDown = (t) => { 78596 this._mouseDownTarget = t.target; 78597 }; 78598 /** @param {Event} e */ 78599 _handleDialogMouseUp = (t) => { 78600 t.target === this.ref.dialog && t.target === this._mouseDownTarget && this._closeDialog(); 78601 }; 78602 show() { 78603 this.ref.dialog.showModal ? this.ref.dialog.showModal() : this.ref.dialog.setAttribute("open", ""); 78604 } 78605 hide() { 78606 this.ref.dialog.close ? this.ref.dialog.close() : this.ref.dialog.removeAttribute("open"); 78607 } 78608 initCallback() { 78609 super.initCallback(), this.ref.dialog.addEventListener("close", this._handleDialogClose), this.ref.dialog.addEventListener("mousedown", this._handleDialogMouseDown), this.ref.dialog.addEventListener("mouseup", this._handleDialogMouseUp), this.sub("*modalActive", (t) => { 78610 this.$.isOpen !== t && (this.$.isOpen = t), t && this.cfg.modalScrollLock ? document.body.style.overflow = "hidden" : document.body.style.overflow = ""; 78611 }), this.subConfigValue("modalBackdropStrokes", (t) => { 78612 t ? this.setAttribute("strokes", "") : this.removeAttribute("strokes"); 78613 }), this.sub("isOpen", (t) => { 78614 t ? (this.show(), this.setAttribute("aria-modal", "true")) : (this.hide(), this.setAttribute("aria-modal", "false")); 78615 }); 78616 } 78617 destroyCallback() { 78618 super.destroyCallback(), document.body.style.overflow = "", this._mouseDownTarget = void 0, this.ref.dialog.removeEventListener("close", this._handleDialogClose), this.ref.dialog.removeEventListener("mousedown", this._handleDialogMouseDown), this.ref.dialog.removeEventListener("mouseup", this._handleDialogMouseUp); 78619 } 78620} 78621G3.template = /* HTML */ 78622` 78623 <dialog ref="dialog"> 78624 <slot></slot> 78625 </dialog> 78626`; 78627const z3 = (e, t) => { 78628 let i, s, n; 78629 const o = (...r) => { 78630 i ? (clearTimeout(s), s = setTimeout( 78631 () => { 78632 Date.now() - n >= t && (e(...r), n = Date.now()); 78633 }, 78634 Math.max(t - (Date.now() - n), 0) 78635 )) : (e(...r), n = Date.now(), i = !0); 78636 }; 78637 return Object.defineProperty(o, "cancel", { 78638 configurable: !1, 78639 writable: !1, 78640 enumerable: !1, 78641 value: () => { 78642 clearTimeout(s); 78643 } 78644 }), /** @type {T & { readonly cancel: () => void }} */ 78645 /** @type {unknown} */ 78646 o; 78647}; 78648class H3 extends fs { 78649 // Context owner should have access to CSS l10n 78650 // TODO: We need to move away l10n from CSS 78651 couldBeCtxOwner = !0; 78652 historyTracked = !0; 78653 activityType = gt.activities.UPLOAD_LIST; 78654 constructor() { 78655 super(), this.init$ = { 78656 ...this.init$, 78657 doneBtnVisible: !1, 78658 doneBtnEnabled: !1, 78659 uploadBtnVisible: !1, 78660 addMoreBtnVisible: !1, 78661 addMoreBtnEnabled: !1, 78662 headerText: "", 78663 commonErrorMessage: "", 78664 hasFiles: !1, 78665 onAdd: () => { 78666 this.api.initFlow(!0); 78667 }, 78668 onUpload: () => {
78669 this.emit(Ni.UPLOAD_CLICK), this.api.uploadAll(), this._throttledHandleCollectionUpdate(); 78670 }, 78671 onDone: () => { 78672 this.emit(Ni.DONE_CLICK, this.api.getOutputCollectionState()), this.api.doneFlow(); 78673 }, 78674 onCancel: () => { 78675 this.uploadCollection.clearAll(); 78676 } 78677 }; 78678 } 78679 /** @private */ 78680 _throttledHandleCollectionUpdate = z3(() => { 78681 this.isConnected && (this._updateUploadsState(), !this.couldOpenActivity && this.$["*currentActivity"] === this.activityType && this.historyBack()); 78682 }, 300); 78683 /** @private */ 78684 _updateUploadsState() { 78685 const t = this.api.getOutputCollectionState(), i = { 78686 total: t.totalCount, 78687 succeed: t.successCount, 78688 uploading: t.uploadingCount, 78689 failed: t.failedCount 78690 }, s = !t.errors.some( 78691 (d) => d.type === "TOO_MANY_FILES" || d.type === "TOO_FEW_FILES" 78692 ), n = t.errors.some((d) => d.type === "TOO_MANY_FILES"), o = t.totalCount === (this.cfg.multiple ? this.cfg.multipleMax : 1), r = i.failed === 0 && t.errors.length === 0; 78693 let a = !1, l = !1, c = !1; 78694 if (i.total - i.succeed - i.uploading - i.failed > 0 && s) 78695 a = !0; 78696 else { 78697 l = !0; 78698 const d = this.cfg.groupOutput ? !!t.group : !0; 78699 c = i.total === i.succeed && s && r && d; 78700 } 78701 this.set$({ 78702 doneBtnVisible: l, 78703 doneBtnEnabled: c, 78704 uploadBtnVisible: a, 78705 addMoreBtnEnabled: i.total === 0 || !n && !o, 78706 addMoreBtnVisible: !o || this.cfg.multiple 78707 }), this.bindL10n("headerText", () => this._getHeaderText(i)); 78708 } 78709 /** 78710 * @private 78711 * @param {Summary} summary 78712 */ 78713 _getHeaderText(t) { 78714 const i = (s) => { 78715 const n = t[s]; 78716 return this.l10n(`header-${s}`, { 78717 count: n 78718 }); 78719 }; 78720 return t.uploading > 0 ? i("uploading") : t.failed > 0 ? i("failed") : t.succeed > 0 ? i("succeed") : i("total"); 78721 } 78722 get couldOpenActivity() { 78723 return this.cfg.showEmptyList || this.uploadCollection.size > 0; 78724 } 78725 initCallback() { 78726 super.initCallback(), this.registerActivity(this.activityType), this.subConfigValue("multiple", this._throttledHandleCollectionUpdate), this.subConfigValue("multipleMin", this._throttledHandleCollectionUpdate), this.subConfigValue("multipleMax", this._throttledHandleCollectionUpdate), this.sub("*groupInfo", (t) => { 78727 t && this._throttledHandleCollectionUpdate(); 78728 }), this.sub("*currentActivity", (t) => { 78729 !this.couldOpenActivity && t === this.activityType && (this.$["*currentActivity"] = this.initActivity); 78730 }), this.uploadCollection.observeProperties(this._throttledHandleCollectionUpdate), this.sub( 78731 "*uploadList", 78732 (t) => { 78733 this._throttledHandleCollectionUpdate(), this.set$({ 78734 hasFiles: t.length > 0 78735 }), this.cfg.confirmUpload || this.api.uploadAll(); 78736 }, 78737 !1 78738 ), this.sub( 78739 "*collectionErrors", 78740 /** @param {import('../../types').OutputError<import('../../types').OutputCollectionErrorType>[]} errors */ 78741 (t) => { 78742 const i = t.filter((s) => s.type !== "SOME_FILES_HAS_ERRORS")[0]; 78743 if (!i) { 78744 this.set$({ 78745 commonErrorMessage: null 78746 }); 78747 return; 78748 } 78749 this.set$({ 78750 commonErrorMessage: i.message 78751 }); 78752 } 78753 ); 78754 } 78755 destroyCallback() { 78756 super.destroyCallback(), this.uploadCollection.unobserveProperties(this._throttledHandleCollectionUpdate); 78757 } 78758} 78759H3.template = /* HTML */ 78760` 78761 <uc-activity-header> 78762 <span aria-live="polite" class="uc-header-text">{{headerText}}</span> 78763 <button 78764 type="button" 78765 class="uc-mini-btn uc-close-btn" 78766 set="onclick: *closeModal" 78767 l10n="@title:a11y-activity-header-button-close" 78768 > 78769 <uc-icon name="close"></uc-icon> 78770 </button> 78771 </uc-activity-header> 78772 78773 <div class="uc-no-files" set="@hidden: hasFiles"> 78774 <slot name="empty"><span l10n="no-files"></span></slot> 78775 </div> 78776 78777 <div class="uc-files" repeat="*uploadList" repeat-item-tag="uc-file-item"></div> 78778 78779 <div class="uc-common-error" set="@hidden: !commonErrorMessage; textContent: commonErrorMessage;"></div> 78780 78781 <div class="uc-toolbar"> 78782 <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel;" l10n="clear"></button> 78783 <div class="uc-toolbar-spacer"></div> 78784 <button 78785 type="button" 78786 class="uc-add-more-btn uc-secondary-btn"
78787 set="onclick: onAdd; @disabled: !addMoreBtnEnabled; @hidden: !addMoreBtnVisible" 78788 > 78789 <uc-icon name="add"></uc-icon><span l10n="add-more"></span> 78790 </button> 78791 <button 78792 type="button" 78793 class="uc-upload-btn uc-primary-btn" 78794 set="@hidden: !uploadBtnVisible; onclick: onUpload;" 78795 l10n="upload" 78796 ></button> 78797 <button 78798 type="button" 78799 class="uc-done-btn uc-primary-btn" 78800 set="@hidden: !doneBtnVisible; onclick: onDone; @disabled: !doneBtnEnabled" 78801 l10n="done" 78802 ></button> 78803 </div> 78804 78805 <uc-drop-area ghost></uc-drop-area> 78806`; 78807class V3 extends fs { 78808 couldBeCtxOwner = !0; 78809 activityType = gt.activities.URL; 78810 init$ = { 78811 ...this.init$, 78812 importDisabled: !0, 78813 onUpload: (t) => { 78814 t.preventDefault(); 78815 let i = this.ref.input.value; 78816 this.api.addFileFromUrl(i, { source: bs.URL }), this.$["*currentActivity"] = gt.activities.UPLOAD_LIST; 78817 }, 78818 onCancel: () => { 78819 this.historyBack(); 78820 }, 78821 onInput: (t) => { 78822 let i = ( 78823 /** @type {HTMLInputElement} */ 78824 t.target.value 78825 ); 78826 this.set$({ importDisabled: !i }); 78827 } 78828 }; 78829 initCallback() { 78830 super.initCallback(), this.registerActivity(this.activityType, { 78831 onActivate: () => { 78832 this.ref.input.value = "", this.ref.input.focus(); 78833 } 78834 }); 78835 } 78836} 78837V3.template = /* HTML */ 78838` 78839 <uc-activity-header> 78840 <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back"> 78841 <uc-icon name="back"></uc-icon> 78842 </button> 78843 <div> 78844 <uc-icon name="url"></uc-icon> 78845 <span l10n="caption-from-url"></span> 78846 </div> 78847 <button 78848 type="button" 78849 class="uc-mini-btn uc-close-btn" 78850 set="onclick: *closeModal" 78851 l10n="@title:a11y-activity-header-button-close" 78852 > 78853 <uc-icon name="close"></uc-icon> 78854 </button> 78855 </uc-activity-header> 78856 <form class="uc-content"> 78857 <input placeholder="https://" class="uc-url-input" type="text" ref="input" set="oninput: onInput" /> 78858 <button 78859 type="submit" 78860 class="uc-url-upload-btn uc-primary-btn" 78861 set="onclick: onUpload; @disabled: importDisabled" 78862 l10n="upload-url" 78863 ></button> 78864 </form> 78865`; 78866const sye = () => typeof navigator.permissions < "u", nye = { 78867 width: { 78868 ideal: 1920 78869 }, 78870 height: { 78871 ideal: 1080 78872 }, 78873 frameRate: { 78874 ideal: 30 78875 } 78876}, hL = ["camera", "microphone"]; 78877function sm(e) { 78878 const t = Math.floor(e / 60).toString().padStart(2, "0"), i = Math.floor(e % 60).toString().padStart(2, "0"); 78879 return `${t}:${i}`; 78880} 78881const pL = "image/jpeg", gL = "video/webm"; 78882class oi extends fs { 78883 couldBeCtxOwner = !0; 78884 activityType = gt.activities.CAMERA; 78885 /** @private */ 78886 _unsubPermissions = null; 78887 /** @type {BlobPart[]} */ 78888 _chunks = []; 78889 /** @type {MediaRecorder | null} */ 78890 _mediaRecorder = null; 78891 /** @type {MediaStream | null} */ 78892 _stream = null; 78893 /** @type {string | null} */ 78894 _selectedAudioId = null; 78895 /** @type {string | null} */ 78896 _selectedCameraId = null; 78897 constructor() { 78898 super(), this.init$ = { 78899 ...this.init$, 78900 video: null, 78901 videoTransformCss: null, 78902 videoHidden: !0, 78903 messageHidden: !0, 78904 requestBtnHidden: sye(), 78905 cameraSelectOptions: null, 78906 cameraSelectHidden: !0, 78907 l10nMessage: "", 78908 // This is refs 78909 switcher: null, 78910 panels: null, 78911 timer: null, 78912 timerHidden: !0, 78913 cameraHidden: !0, 78914 cameraActionsHidden: !0, 78915 audioSelectOptions: null, 78916 audioSelectHidden: !0, 78917 audioSelectDisabled: !0, 78918 audioToggleMicorphoneHidden: !0, 78919 tabCameraHidden: !0, 78920 tabVideoHidden: !0, 78921 currentIcon: "camera-full", 78922 currentTimelineIcon: "play", 78923 toggleMicorphoneIcon: "microphone", 78924 /** @type {Number} */ 78925 _startTime: 0, 78926 /** @type {Number} */ 78927 _elapsedTime: 0, 78928 _animationFrameId: null, 78929 mutableClassButton: "uc-shot-btn uc-camera-action", 78930 /** @param {Event} e */ 78931 onCameraSelectChange: (t) => { 78932 this._selectedCameraId = t.target.value, this._capture(); 78933 }, 78934 /** @param {Event} e */ 78935 onAudioSelectChange: (t) => { 78936 this._selectedAudioId = t.target.value, this._capture(); 78937 }, 78938 onCancel: () => { 78939 this.historyBack(); 78940 }, 78941 onShot: () => this._shot(), 78942 onRequestPermissions: () => this._capture(), 78943 /** General method for photo and video capture */ 78944 onStartCamera: () => this._chooseActionWithCamera(), 78945 onStartRecording: () => this._startRecording(), 78946 onStopRecording: () => this._stopRecording(), 78947 onToggleRecording: () => this._toggleRecording(), 78948 onToggleAudio: () => this._toggleEnableAudio(), 78949 onRetake: () => this._retake(), 78950 onAccept: () => this._accept(), 78951 /** @param {MouseEvent} e */ 78952 onClickTab: (t) => { 78953 const i = ( 78954 /** @type {HTMLElement} */ 78955 t.currentTarget.getAttribute("data-id") 78956 ); 78957 i && this._handleActiveTab( 78958 /** @type {CameraTabId} */ 78959 i 78960 ); 78961 } 78962 }; 78963 } 78964 _chooseActionWithCamera = () => { 78965 if (this._activeTab === oi.types.PHOTO && this._shot(), this._activeTab === oi.types.VIDEO) { 78966 if (this._mediaRecorder?.state === "recording") { 78967 this._stopRecording(); 78968 return; 78969 } 78970 this._startRecording(); 78971 } 78972 }; 78973 _updateTimer = () => { 78974 const t = Math.floor((performance.now() - this.$._startTime + this.$._elapsedTime) / 1e3); 78975 if (typeof this.cfg.maxVideoRecordingDuration == "number" && this.cfg.maxVideoRecordingDuration > 0) { 78976 const i = this.cfg.maxVideoRecordingDuration - t; 78977 if (i <= 0) { 78978 this.ref.timer.textContent = sm(i), this._stopRecording(); 78979 return; 78980 } 78981 this.ref.timer.textContent = sm(i); 78982 } else 78983 this.ref.timer.textContent = sm(t); 78984 this._animationFrameId = requestAnimationFrame(this._updateTimer); 78985 }; 78986 _startTimer = () => { 78987 this.$._startTime = performance.now(), this.$._elapsedTime = 0, this._updateTimer(); 78988 }; 78989 _stopTimer = () => { 78990 this._animationFrameId && cancelAnimationFrame(this._animationFrameId); 78991 }; 78992 _startTimeline = () => { 78993 const t = this.ref.video.currentTime, i = this.ref.video.duration; 78994 this.ref.line.style.transform = `scaleX(${t / i})`, this.ref.timer.textContent = sm(t), this._animationFrameId = requestAnimationFrame(this._startTimeline); 78995 }; 78996 _stopTimeline = () => { 78997 this._animationFrameId && cancelAnimationFrame(this._animationFrameId); 78998 }; 78999 _startRecording = () => { 79000 try { 79001 this._chunks = [], this._options = { 79002 ...this.cfg.mediaRecorerOptions 79003 }; 79004 const { mimeType: t } = this.cfg.mediaRecorerOptions || {};
79005 t && MediaRecorder.isTypeSupported(t) ? this._options.mimeType = t : MediaRecorder.isTypeSupported(gL) ? this._options.mimeType = gL : this._options.mimeType = "video/mp4", this._stream && (this._mediaRecorder = new MediaRecorder(this._stream, this._options), this._mediaRecorder.start(), this._mediaRecorder.addEventListener("dataavailable", (i) => { 79006 this._chunks.push(i.data); 79007 }), this._startTimer(), this.classList.add("uc-recording"), this._setCameraState(oi.events.PLAY)); 79008 } catch (t) { 79009 console.error("Failed to start recording", t); 79010 } 79011 }; 79012 /** @private */ 79013 _stopRecording = () => { 79014 this._mediaRecorder?.addEventListener("stop", () => { 79015 this._previewVideo(), this._stopTimer(), this._setCameraState(oi.events.STOP); 79016 }), this._mediaRecorder?.stop(), this.classList.remove("uc-recording"); 79017 }; 79018 /** This method is used to toggle recording pause/resume */ 79019 _toggleRecording = () => { 79020 this._mediaRecorder?.state !== "recording" && (!this.ref.video.paused && !this.ref.video.ended && this.ref.video.readyState > 2 ? this.ref.video.pause() : this.ref.video.paused && this.ref.video.play()); 79021 }; 79022 _toggleEnableAudio = () => { 79023 this._stream?.getAudioTracks().forEach((t) => { 79024 t.enabled = !t.enabled, this.$.toggleMicorphoneIcon = t.enabled ? "microphone" : "microphone-mute", this.$.audioSelectDisabled = !t.enabled; 79025 }); 79026 }; 79027 /** 79028 * Previewing the video that was recorded on the camera 79029 * 79030 * @private 79031 */ 79032 _previewVideo = () => { 79033 try { 79034 const t = new Blob(this._chunks, { 79035 type: this._mediaRecorder?.mimeType 79036 }), i = URL.createObjectURL(t); 79037 this.ref.video.muted = !1, this.ref.video.volume = 1, this.$.video = null, this.ref.video.src = i, this.ref.video.addEventListener("play", () => { 79038 this._startTimeline(), this.set$({ 79039 currentTimelineIcon: "pause" 79040 }); 79041 }), this.ref.video.addEventListener("pause", () => { 79042 this.set$({ 79043 currentTimelineIcon: "play" 79044 }), this._stopTimeline(); 79045 }); 79046 } catch (t) { 79047 console.error("Failed to preview video", t); 79048 } 79049 }; 79050 _retake = () => { 79051 this._setCameraState(oi.events.RETAKE), this._activeTab === oi.types.VIDEO && (this.$.video = this._stream, this.ref.video.muted = !0), this.ref.video.play(); 79052 }; 79053 _accept = () => { 79054 if (this._setCameraState(oi.events.ACCEPT), this._activeTab === oi.types.PHOTO) { 79055 this._canvas?.toBlob((n) => { 79056 const o = this._createFile("camera", "jpeg", pL, n); 79057 this._toSend(o); 79058 }, pL); 79059 return; 79060 } 79061 const t = new Blob(this._chunks, { 79062 type: this._mediaRecorder?.mimeType 79063 }), i = this._guessExtensionByMime(this._mediaRecorder?.mimeType), s = this._createFile("video", i, `video/${i}`, t); 79064 this._toSend(s), this._chunks = []; 79065 }; 79066 /** @param {CameraStatus} status */ 79067 _handlePhoto = (t) => { 79068 t === oi.events.SHOT && this.set$({ 79069 tabVideoHidden: !0, 79070 cameraHidden: !0, 79071 tabCameraHidden: !0, 79072 cameraActionsHidden: !1, 79073 cameraSelectHidden: !0 79074 }), (t === oi.events.RETAKE || t === oi.events.ACCEPT) && this.set$({ 79075 tabVideoHidden: !this.cfg.enableVideoRecording, 79076 cameraHidden: !1, 79077 tabCameraHidden: !1, 79078 cameraActionsHidden: !0, 79079 cameraSelectHidden: this.cameraDevices.length <= 1 79080 }); 79081 }; 79082 /** @param {CameraStatus} status */ 79083 _handleVideo = (t) => { 79084 t === oi.events.PLAY && this.set$({ 79085 timerHidden: !1, 79086 tabCameraHidden: !0, 79087 cameraSelectHidden: !0, 79088 audioSelectHidden: !0, 79089 currentTimelineIcon: "pause", 79090 currentIcon: "square", 79091 mutableClassButton: "uc-shot-btn uc-camera-action uc-stop-record" 79092 }), t === oi.events.STOP && this.set$({ 79093 timerHidden: !1, 79094 cameraHidden: !0, 79095 audioToggleMicorphoneHidden: !0, 79096 cameraActionsHidden: !1 79097 }), (t === oi.events.RETAKE || t === oi.events.ACCEPT) && this.set$({ 79098 timerHidden: !0, 79099 tabCameraHidden: !1, 79100 cameraHidden: !1, 79101 cameraActionsHidden: !0, 79102 audioToggleMicorphoneHidden: !this.cfg.enableAudioRecording, 79103 currentIcon: "video-camera-full",
79104 mutableClassButton: "uc-shot-btn uc-camera-action", 79105 audioSelectHidden: !this.cfg.enableAudioRecording || this.audioDevices.length <= 1, 79106 cameraSelectHidden: this.cameraDevices.length <= 1 79107 }); 79108 }; 79109 /** 79110 * @private 79111 * @param {CameraStatus} status 79112 */ 79113 _setCameraState = (t) => { 79114 this._activeTab === oi.types.PHOTO && (t === "shot" || t === "retake" || t === "accept") && this._handlePhoto(t), this._activeTab === oi.types.VIDEO && (t === "play" || t === "stop" || t === "retake" || t === "accept" || t === "pause" || t === "resume") && this._handleVideo(t); 79115 }; 79116 /** @private */ 79117 _shot() { 79118 if (this._setCameraState("shot"), this._canvas = document.createElement("canvas"), this._ctx = this._canvas.getContext("2d"), !this._ctx) 79119 throw new Error("Failed to get canvas context"); 79120 this._canvas.height = this.ref.video.videoHeight, this._canvas.width = this.ref.video.videoWidth, this.cfg.cameraMirror && (this._ctx.translate(this._canvas.width, 0), this._ctx.scale(-1, 1)), this._ctx.drawImage(this.ref.video, 0, 0), this.ref.video.pause(); 79121 } 79122 /** 79123 * @private 79124 * @param {CameraTabId} tabId 79125 */ 79126 _handleActiveTab = (t) => { 79127 this.ref.switcher.querySelectorAll("button").forEach((i) => { 79128 i.classList.toggle("uc-active", i.getAttribute("data-id") === t); 79129 }), t === oi.types.PHOTO && this.set$({ 79130 currentIcon: "camera-full", 79131 audioSelectHidden: !0, 79132 audioToggleMicorphoneHidden: !0 79133 }), t === oi.types.VIDEO && this.set$({ 79134 currentTimelineIcon: "play", 79135 currentIcon: "video-camera-full", 79136 audioSelectHidden: !this.cfg.enableAudioRecording || this.audioDevices.length <= 1, 79137 audioToggleMicorphoneHidden: !this.cfg.enableAudioRecording 79138 }), this._activeTab = t; 79139 }; 79140 /** 79141 * @param {'camera' | 'video'} type 79142 * @param {'jpeg' | 'webm'} ext 79143 * @param {String} format 79144 * @param {Blob} blob 79145 */ 79146 _createFile = (t, i, s, n) => { 79147 const o = Date.now(), r = `${t}-${o}.${i}`; 79148 return new File([n], r, { 79149 lastModified: o, 79150 type: s 79151 }); 79152 }; 79153 /** @param {String | undefined} mime */ 79154 _guessExtensionByMime(t) { 79155 const i = { 79156 mp4: "mp4", 79157 ogg: "ogg", 79158 webm: "webm", 79159 quicktime: "mov", 79160 "x-matroska": "mkv" 79161 }; 79162 if (t === "") 79163 return "webm"; 79164 if (t && (t = t.split("/"), t?.[0] === "video")) { 79165 t = t.slice(1).join("/"); 79166 const s = t?.split(";")[0]; 79167 if (i[s]) 79168 return i[s]; 79169 } 79170 return "avi"; 79171 } 79172 /** 79173 * The send file to the server 79174 * 79175 * @param {File} file 79176 */ 79177 _toSend = (t) => { 79178 this.api.addFileFromObject(t, { source: bs.CAMERA }), this.set$({ 79179 "*currentActivity": gt.activities.UPLOAD_LIST 79180 }); 79181 }; 79182 /** 79183 * @private 79184 * @param {'granted' | 'denied' | 'prompt'} state 79185 */ 79186 _setPermissionsState = wo((t) => { 79187 this.classList.toggle("uc-initialized", t === "granted"); 79188 const i = this._activeTab === oi.types.VIDEO && this.cfg.enableAudioRecording, s = this._activeTab === oi.types.PHOTO ? "camera-full" : "video-camera-full"; 79189 t === "granted" ? this.set$({ 79190 videoHidden: !1, 79191 cameraHidden: !1, 79192 tabCameraHidden: !1, 79193 messageHidden: !0, 79194 timerHidden: !0, 79195 currentIcon: s, 79196 audioToggleMicorphoneHidden: !i, 79197 audioSelectHidden: !i 79198 }) : t === "prompt" ? (this.$.l10nMessage = "camera-permissions-prompt", this.set$({ 79199 videoHidden: !0, 79200 cameraHidden: !0, 79201 tabCameraHidden: !0, 79202 messageHidden: !1 79203 }), this._stopCapture()) : (this.$.l10nMessage = "camera-permissions-denied", this.set$({ 79204 videoHidden: !0, 79205 messageHidden: !1, 79206 tabCameraHidden: !1, 79207 tabVideoHidden: !this.cfg.enableVideoRecording, 79208 cameraActionsHidden: !0, 79209 mutableClassButton: "uc-shot-btn uc-camera-action" 79210 }), this._stopCapture()); 79211 }, 300); 79212 _makeStreamInactive = () => { 79213 if (!this._stream) return !1; 79214 const t = this._stream?.getAudioTracks(), i = this._stream?.getVideoTracks(); 79215 t.forEach((s) => s.stop()), i.forEach((s) => s.stop()); 79216 }; 79217 _stopCapture = () => { 79218 this._capturing && (this.ref.video.volume = 0, this.$.video?.getTracks()[0].stop(), this.$.video = null, this._makeStreamInactive(), this._stopTimer(), this._capturing = !1); 79219 }; 79220 _capture = async () => { 79221 const t = { 79222 video: nye, 79223 audio: this.cfg.enableAudioRecording ? {} : !1 79224 }; 79225 this._selectedCameraId && (t.video = { 79226 deviceId: { 79227 exact: this._selectedCameraId 79228 } 79229 }), this._selectedAudioId && this.cfg.enableAudioRecording && (t.audio = { 79230 deviceId: { 79231 exact: this._selectedAudioId 79232 } 79233 }), this.ref.video.volume = 0; 79234 try { 79235 this._setPermissionsState("prompt"), this._stream = await navigator.mediaDevices.getUserMedia(t), this._stream.addEventListener("inactive", () => { 79236 this._setPermissionsState("denied"); 79237 }), this.$.video = this._stream, this._capturing = !0, this._setPermissionsState("granted"); 79238 } catch (i) { 79239 this._setPermissionsState("denied"), console.log("Failed to capture camera", i); 79240 } 79241 }; 79242 _handlePermissionsChange = () => { 79243 this._capture(); 79244 }; 79245 _permissionAccess = async () => { 79246 try { 79247 for (const t of hL) 79248 this[`${t}Response`] = await navigator.permissions.query({ name: t }), this[`${t}Response`].addEventListener("change", this._handlePermissionsChange); 79249 } catch (t) { 79250 console.log("Failed to use permissions API. Fallback to manual request mode.", t), this._capture(); 79251 } 79252 }; 79253 _getPermission = () => { 79254 }; 79255 _requestDeviceAccess = async () => { 79256 try { 79257 await navigator.mediaDevices.getUserMedia({ video: !0, audio: this.cfg.enableAudioRecording }), await this._getDevices(), navigator.mediaDevices.addEventListener("devicechange", this._getDevices); 79258 } catch (t) { 79259 console.log("Failed to get user media", t); 79260 } 79261 }; 79262 _getDevices = async () => { 79263 try { 79264 const t = await navigator.mediaDevices.enumerateDevices(); 79265 this.cameraDevices = t.filter((i) => i.kind === "videoinput").map((i, s) => ({ 79266 text: i.label.trim() || `${this.l10n("caption-camera")} ${s + 1}`, 79267 value: i.deviceId 79268 })), this.audioDevices = this.cfg.enableAudioRecording && t.filter((i) => i.kind === "audioinput").map((i) => ({ 79269 text: i.label.trim(), 79270 value: i.deviceId 79271 })), this.cameraDevices.length > 1 && this.set$({ 79272 cameraSelectOptions: this.cameraDevices, 79273 cameraSelectHidden: !1 79274 }), this._selectedCameraId = this.cameraDevices[0]?.value, this.audioDevices.length > 1 && this.set$({ 79275 audioSelectOptions: this.audioDevices, 79276 audioSelectHidden: !1 79277 }), this._selectedAudioId = this.audioDevices[0]?.value; 79278 } catch (t) { 79279 console.log("Failed to get devices", t); 79280 } 79281 }; 79282 _onActivate = async () => { 79283 await this._permissionAccess(), await this._requestDeviceAccess(), await this._capture(); 79284 }; 79285 _onDeactivate = async () => { 79286 this._unsubPermissions && this._unsubPermissions(), window.chrome || this._setPermissionsState("denied"), this._stopCapture(); 79287 }; 79288 initCallback() { 79289 super.initCallback(), this.registerActivity(this.activityType, { 79290 onActivate: this._onActivate, 79291 onDeactivate: this._onDeactivate 79292 }), this.subConfigValue("cameraMirror", (t) => { 79293 this.$.videoTransformCss = t ? "scaleX(-1)" : null; 79294 }), this.subConfigValue("enableAudioRecording", (t) => { 79295 this.$.audioToggleMicorphoneHidden = !t, this.$.audioSelectDisabled = !t; 79296 }), this.subConfigValue("enableVideoRecording", (t) => { 79297 this.$.tabVideoHidden = !t; 79298 }), this.subConfigValue("defaultCameraMode", (t) => { 79299 if (this.cfg.enableVideoRecording) { 79300 this._handleActiveTab(t); 79301 return; 79302 } 79303 this._handleActiveTab("photo"); 79304 }); 79305 } 79306 _destroy() { 79307 for (const t of hL) 79308 this[`${t}Response`]?.removeEventListener("change", this._handlePermissionsChange); 79309 navigator.mediaDevices?.removeEventListener("devicechange", this._getDevices); 79310 } 79311 async destroyCallback() { 79312 super.destroyCallback(), this._destroy(); 79313 } 79314} 79315oi.types = Object.freeze({ 79316 PHOTO: "photo", 79317 VIDEO: "video" 79318}); 79319oi.events = Object.freeze({ 79320 IDLE: "idle", 79321 SHOT: "shot", 79322 PLAY: "play", 79323 PAUSE: "pause", 79324 RESUME: "resume", 79325 STOP: "stop", 79326 RETAKE: "retake", 79327 ACCEPT: "accept" 79328}); 79329oi.template = /* HTML */ 79330` 79331 <uc-activity-header> 79332 <button type="button" class="uc-mini-btn" set="onclick: *historyBack" l10n="@title:back"> 79333 <uc-icon name="back"></uc-icon> 79334 </button> 79335 <div set="@hidden: !cameraSelectHidden"> 79336 <uc-icon name="camera"></uc-icon>
79337 <span l10n="caption-camera"></span> 79338 </div> 79339 <uc-select 79340 class="uc-camera-select" 79341 set="$.options: cameraSelectOptions; @hidden: cameraSelectHidden; onchange: onCameraSelectChange" 79342 > 79343 </uc-select> 79344 <button 79345 type="button" 79346 class="uc-mini-btn uc-close-btn" 79347 set="onclick: *closeModal" 79348 l10n="@title:a11y-activity-header-button-close" 79349 > 79350 <uc-icon name="close"></uc-icon> 79351 </button> 79352 </uc-activity-header> 79353 <div class="uc-content"> 79354 <video 79355 muted 79356 autoplay 79357 playsinline 79358 set="srcObject: video; style.transform: videoTransformCss; @hidden: videoHidden" 79359 ref="video" 79360 ></video> 79361 <div class="uc-message-box" set="@hidden: messageHidden"> 79362 <span l10n="l10nMessage"></span> 79363 <button 79364 type="button" 79365 set="onclick: onRequestPermissions; @hidden: requestBtnHidden" 79366 l10n="camera-permissions-request" 79367 ></button> 79368 </div> 79369 </div> 79370 79371 <div class="uc-controls"> 79372 <div ref="switcher" class="uc-switcher" set="@hidden:!timerHidden"> 79373 <button 79374 data-id="photo" 79375 type="button" 79376 class="uc-switch uc-mini-btn" 79377 set="onclick: onClickTab; @hidden: tabCameraHidden" 79378 > 79379 <uc-icon name="camera"></uc-icon> 79380 </button> 79381 <button 79382 data-id="video" 79383 type="button" 79384 class="uc-switch uc-mini-btn" 79385 set="onclick: onClickTab; @hidden: tabVideoHidden" 79386 > 79387 <uc-icon name="video-camera"></uc-icon> 79388 </button> 79389 </div> 79390 79391 <button class="uc-secondary-btn uc-recording-timer" set="@hidden:timerHidden; onclick: onToggleRecording"> 79392 <uc-icon set="@name: currentTimelineIcon"></uc-icon> 79393 <span ref="timer"> 00:00 </span> 79394 <span ref="line" class="uc-line"></span> 79395 </button> 79396 79397 <div class="uc-camera-actions uc-camera-action" set="@hidden: cameraActionsHidden"> 79398 <button type="button" class="uc-secondary-btn" set="onclick: onRetake">Retake</button> 79399 <button type="button" class="uc-primary-btn" set="onclick: onAccept">Accept</button> 79400 </div> 79401 79402 <button 79403 type="button" 79404 class="uc-shot-btn uc-camera-action" 79405 set="onclick: onStartCamera; @class: mutableClassButton; @hidden: cameraHidden;" 79406 > 79407 <uc-icon set="@name: currentIcon"></uc-icon> 79408 </button> 79409 79410 <div class="uc-select"> 79411 <button class="uc-mini-btn uc-btn-microphone" set="onclick: onToggleAudio; @hidden: audioToggleMicorphoneHidden;"> 79412 <uc-icon set="@name:toggleMicorphoneIcon"></uc-icon> 79413 </button> 79414 79415 <uc-select 79416 class="uc-audio-select" 79417 set="$.options: audioSelectOptions; onchange: onAudioSelectChange; @hidden: audioSelectHidden; @disabled: audioSelectDisabled" 79418 > 79419 </uc-select> 79420 </div> 79421 </div> 79422`; 79423class U3 extends fs { 79424 requireCtxName = !0; 79425 initCallback() { 79426 super.initCallback(), this.$["*eventEmitter"].bindTarget(this); 79427 } 79428 destroyCallback() { 79429 super.destroyCallback(), this.$["*eventEmitter"].unbindTarget(this); 79430 } 79431} 79432U3.EventType = Ni; 79433const oye = ( 79434 /** @type {UploadCtxProvider} */ 79435 /** @type {unknown} */ 79436 U3 79437); 79438class W3 extends fs { 79439 init$ = { 79440 ...this.init$, 79441 visible: !1, 79442 value: 0, 79443 "*commonProgress": 0 79444 }; 79445 initCallback() { 79446 super.initCallback(), this._unobserveCollection = this.uploadCollection.observeProperties(() => { 79447 let t = this.uploadCollection.items().some((i) => this.uploadCollection.read(i).getValue("isUploading")); 79448 this.$.visible = t; 79449 }), this.sub("visible", (t) => { 79450 t ? this.setAttribute("active", "") : this.removeAttribute("active"); 79451 }), this.sub("*commonProgress", (t) => { 79452 this.$.value = t; 79453 }); 79454 } 79455 destroyCallback() { 79456 super.destroyCallback(), this._unobserveCollection?.(); 79457 } 79458} 79459W3.template = /* HTML */ 79460' <uc-progress-bar set="visible: visible; value: value"></uc-progress-bar> '; 79461class j3 extends Ti { 79462 /** @type {Number} */ 79463 _value = 0; 79464 init$ = { 79465 ...this.init$, 79466 width: 0, 79467 opacity: 0 79468 }; 79469 initCallback() { 79470 super.initCallback(), this.defineAccessor("value", (t) => { 79471 if (t === void 0) 79472 return; 79473 const i = this._value; 79474 if (this._value = t, t === 0 && i > 0) { 79475 this.ref.line.addEventListener("transitionend", () => { 79476 this.style.setProperty("--l-width", this._value.toString()); 79477 }); 79478 return; 79479 } 79480 this.style.setProperty("--l-width", this._value.toString()); 79481 }), this.defineAccessor("visible", (t) => { 79482 this.ref.line.classList.toggle("uc-progress--hidden", !t); 79483 }); 79484 } 79485} 79486j3.template = /* HTML */ 79487' <div ref="line" class="uc-progress"></div> '; 79488const Od = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="; 79489function $3(...e) { 79490 return e.reduce((t, i) => { 79491 if (typeof i == "string") 79492 return t[i] = !0, t; 79493 for (let s of Object.keys(i)) 79494 t[s] = i[s]; 79495 return t; 79496 }, {}); 79497} 79498function jo(...e) { 79499 let t = $3(...e); 79500 return Object.keys(t).reduce((i, s) => (t[s] && i.push(s), i), []).join(" "); 79501} 79502function rye(e, ...t) { 79503 let i = $3(...t); 79504 for (let s of Object.keys(i)) 79505 e.classList.toggle(s, i[s]); 79506} 79507const aye = (e) => { 79508 if (!e) return Cr; 79509 const t = Tge(e).filter((i) =>
vendor: 4,087 bytes, lines 79509-79582
79509 Cr.includes(i)); 79510 return t.length === 0 ? Cr : t; 79511}; 79512function lye(e) { 79513 return { 79514 "*originalUrl": null, 79515 "*faderEl": null, 79516 "*cropperEl": null, 79517 "*imgEl": null, 79518 "*imgContainerEl": null, 79519 "*networkProblems": !1, 79520 "*imageSize": null, 79521 /** @type {import('./types.js').Transformations} */ 79522 "*editorTransformations": {}, 79523 /** @type {import('./types.js').CropPresetList} */ 79524 "*cropPresetList": [], 79525 "*tabList": Cr, 79526 "*tabId": Oi.CROP, 79527 entry: null, 79528 extension: null, 79529 editorMode: !1, 79530 modalCaption: "", 79531 isImage: !1, 79532 msg: "", 79533 src: Od, 79534 fileType: "", 79535 showLoader: !1, 79536 // options 79537 uuid: null, 79538 cdnUrl: null, 79539 cropPreset: "", 79540 tabs: _M(Cr), 79541 "presence.networkProblems": !1, 79542 "presence.modalCaption": !0, 79543 "presence.editorToolbar": !1, 79544 "presence.viewerToolbar": !0, 79545 // TODO: beware of wrong ctx in case of element re-creation: 79546 "*on.retryNetwork": () => { 79547 let t = e.querySelectorAll("img"); 79548 for (let i of t) { 79549 let s = i.src; 79550 i.src = Od, i.src = s; 79551 } 79552 e.$["*networkProblems"] = !1; 79553 }, 79554 /** @param {import('./types.js').Transformations} transformations */ 79555 "*on.apply": (t) => { 79556 if (!t) 79557 return; 79558 let i = e.$["*originalUrl"], s = Dl(sC(t), "preview"), n = co(i, s), o = { 79559 originalUrl: i, 79560 cdnUrlModifiers: s, 79561 cdnUrl: n, 79562 transformations: t 79563 }; 79564 e.dispatchEvent( 79565 new CustomEvent("apply", { 79566 detail: o, 79567 bubbles: !0, 79568 composed: !0 79569 }) 79570 ), e.remove(); 79571 }, 79572 "*on.cancel": () => { 79573 e.remove(), e.dispatchEvent( 79574 new CustomEvent("cancel", { 79575 bubbles: !0, 79576 composed: !0 79577 }) 79578 ); 79579 } 79580 }; 79581} 79582const cye = "<svg width='0' height='0' style='position:absolute'><symbol viewBox='0 0 20 20' id='uc-icon-brightness' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M15 10a5 5 0 0 1-5 5m5-5a5 5 0 0 0-5-5m5 5h-5m0 5a5 5 0 0 1 0-10m0 10V5m0 15v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05m-.626 2.45H10m4.324 5H10'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-closeMax' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8.232 10 3.585 5.353l1.768-1.768L10 8.232l4.648-4.647 1.767 1.768L11.768 10l4.647 4.648-1.767 1.767L10 11.768l-4.647 4.647-1.768-1.767L8.232 10Z' clip-rule='evenodd'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-contrast' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 10a8 8 0 1 0 16 0 8 8 0 1 0-16 0m8-8v16m8-8h-8m7.598 2.5H10m6.24 2.5H10m7.6-7.5H10M16.242 5H10'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-crop' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M20 14H7.005C6.45 14 6 13.55 6 12.995V0M0 6h13.067c.515 0 .933.418.933.933V20M14.5.4 13 2l1.5 1.6M13 2h2a3 3 0 0 1 3 3v2M5.5 19.6 7 18l-1.5-1.6M7 18H5a3 3 0 0 1-3-3v-2'/></symbol><symbol fill='currentColor' viewBox='0 0 20 20' id='uc-icon-done' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='m18.057 6.333-9.365 9.125a1.25 1.25 0 0 1-1.768-.023L1.92 10.296l1.791-1.744 4.132 4.243 8.47-8.253 1.744 1.79Z' clip-rule='evenodd'/></symbol><symbol fill='currentColor' viewBox='0 0 25 24' id='uc-icon-edit-file' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M18.558 2.804a.78.78 0 0 0-.557.235l-.008.007-2.472 2.46 3.847 3.848 2.46-2.473.004-.003a.78.78 0 0 0 0-1.108l-.004-.003-2.712-2.728a.78.78 0 0 0-.558-.235Zm-.248 7.613-3.852-3.852-8.93 8.887-1.516 5.41 5.41-1.515 8.888-8.93Zm-.636-8.934a2.28 2.28 0 0 1 2.512.505l2.702 2.717.002.002a2.278 2.278 0 0 1 0 3.234l-.002.002-12.541 12.602a.75.75 0 0 1-.33.193l-6.884 1.928a.75.75 0 0 1-.925-.924l1.928-6.885a.75.75 0 0 1 .193-.33l12.603-12.54a2.28 2.28 0 0 1 .742-.504Z' clip-rule='evenodd'/></symbol>
79582<symbol viewBox='0 0 20 20' id='uc-icon-enhance' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19 13h-2m0 0a4 4 0 0 1-4-4m4 4a4 4 0 0 0-4 4m0-8V7m0 2a4 4 0 0 1-4 4m-2 0h2m0 0a4 4 0 0 1 4 4m0 0v2M8 8.5H6.5m0 0a2 2 0 0 1-2-2m2 2a2 2 0 0 0-2 2m0-4V5m0 1.5a2 2 0 0 1-2 2M1 8.5h1.5m0 0a2 2 0 0 1 2 2m0 0V12M12 3h-1m0 0a1 1 0 0 1-1-1m1 1a1 1 0 0 0-1 1m0-2V1m0 1a1 1 0 0 1-1 1M8 3h1m0 0a1 1 0 0 1 1 1m0 0v1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-exposure' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M10 20v-3M2.93 2.929 5.05 5.05M0 10h3m-.07 7.071 2.12-2.121M10 0v3m7.07 14.071-2.12-2.121M20 10h-3m.07-7.071L14.95 5.05M5 10a5 5 0 1 0 10 0 5 5 0 1 0-10 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-filters' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M4.5 6.5a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m-3.5 6a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0m7 0a5.5 5.5 0 1 0 11 0 5.5 5.5 0 1 0-11 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-flip' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M19.6 5 18 3.5 16.4 5m3.2 10L18 16.5 16.4 15M18 3.523v12.954M3.3 8.5h10.654c.301 0 .415-.395.159-.554L3.459 1.286A.3.3 0 0 0 3 1.542V8.2a.3.3 0 0 0 .3.3zm0 3h10.654c.301 0 .415.395.159.554l-10.654 6.66A.3.3 0 0 1 3 18.458v-6.66a.3.3 0 0 1 .3-.3z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-gamma' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M17 3C9 6 2.5 11.5 2.5 17.5m0 0h1m-1 0v-1m14 1h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3 0h1m-3-14v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1m0 3v-1'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-mirror' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M5 .4 3.5 2 5 3.6M15 .4 16.5 2 15 3.6M3.52 2h12.957M8.5 16.7V6.046c0-.301-.394-.415-.554-.159L1.287 16.541a.3.3 0 0 0 .255.459H8.2a.3.3 0 0 0 .3-.3zm3 0V6.046c0-.301.395-.415.555-.159l6.659 10.654a.3.3 0 0 1-.255.459H11.8a.3.3 0 0 1-.3-.3z'/></symbol><symbol viewBox='0 0 40 40' id='uc-icon-original' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.5' d='M0 40 40 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-rotate' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M13.5.4 12 2l1.5 1.6M12.023 2H14.4A3.6 3.6 0 0 1 18 5.6V8M4 17h9a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-sad' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M2 17c4.418-4 11.582-4 16 0M16.5 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-11 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-saturation' xmlns='http://www.w3.org/2000/svg'><defs><linearGradient id='puc-icon-id__a' x1='10.001' y1='1' x2='10.001' y2='19' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs><circle cx='10.001' cy='10' r='9' transform='rotate(90 10 10)' fill='url(#puc-icon-id__a)'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-slider' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M0 10h11m0 0a2 2 0 1 0 4 0m-4 0a2 2 0 1 1 4 0m0 0h5'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-tuning' xmlns='http://www.w3.org/2000/svg'><path stroke-linejoin='round' fill='none' stroke='currentColor' stroke-width='1.2' d='M8 10h11M1 10h4M1 4.5h11m3 0h4m-18 11h11m3 0h4m-7-11a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0M5 10a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0m7 5.5a1.5 1.5 0 1 0 3 0 1.5 1.5 0 1 0-3 0'/></symbol><symbol viewBox='0 0 20 20' id='uc-icon-vibrance' xmlns='http://www.w3.org/2000/svg'><path d='M2.125 5.64A8.96 8.96 0 0 0 1.001 10a8.96 8.96 0 0 0 1.124 4.36V5.64z' fill='url(#suc-icon-id__a)'/>
79582<path d='M2.875 15.499V4.502a9.053 9.053 0 0 1 1.75-1.72v14.437a9.05 9.05 0 0 1-1.75-1.72z' fill='url(#suc-icon-id__b)'/><path d='M5.375 17.722c.548.33 1.134.601 1.75.809V1.469a8.956 8.956 0 0 0-1.75.81v15.443z' fill='url(#suc-icon-id__c)'/><path d='M7.875 1.253v17.495c.564.136 1.15.22 1.75.244V1.008a9 9 0 0 0-1.75.245z' fill='url(#suc-icon-id__d)'/><path d='M10.375 1.008v17.984a9 9 0 0 0 1.75-.244V1.252a9 9 0 0 0-1.75-.244z' fill='url(#suc-icon-id__e)'/><path d='M12.875 1.469V18.53a8.957 8.957 0 0 0 1.75-.808V2.277a8.957 8.957 0 0 0-1.75-.808z' fill='url(#suc-icon-id__f)'/><path d='M15.375 2.78v14.44a9.053 9.053 0 0 0 1.75-1.72v-11a9.054 9.054 0 0 0-1.75-1.72z' fill='url(#suc-icon-id__g)'/><path d='M17.875 5.638v8.724A8.959 8.959 0 0 0 19.001 10a8.96 8.96 0 0 0-1.126-4.362z' fill='url(#suc-icon-id__h)'/><defs><linearGradient id='suc-icon-id__a' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__b' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__c' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__d' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__e' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__f' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__g' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient><linearGradient id='suc-icon-id__h' x1='19.001' y1='10' x2='1.001' y2='10' gradientUnits='userSpaceOnUse'><stop stop-color='#DE15FF'/><stop offset='.203' stop-color='#0029FF'/><stop offset='.479' stop-color='#2AE4F0'/><stop offset='.604' stop-color='#15EF11'/><stop offset='.75' stop-color='#FAE528'/><stop offset='1' stop-color='#EB2A2A'/></linearGradient></defs></symbol><symbol viewBox='0 0 20 20' id='uc-icon-warmth' xmlns='http://www.w3.org/2000/svg'><path d='m7.5 13.05.429.42.171-.175v-.244h-.6zm5 0h-.6v.245l.172.175.428-.42zM8.1 3.5c0-1.05.85-1.9 1.9-1.9V.4a3.1 3.1 0 0 0-3.1 3.1h1.2zm0 9.55V3.5H6.9v9.55h1.2zm-1 2.45c0-.79.315-1.506.829-2.03l-.858-.84A4.088 4.088 0 0 0 5.9 15.5h1.2zm2.9 2.9a2.9 2.9 0 0 1-2.9-2.9H5.9a4.1 4.1 0 0 0 4.1 4.1v-1.2zm2.9-2.9a2.9 2.9 0 0 1-2.9 2.9v1.2a4.1 4.1 0 0 0 4.1-4.1h-1.2zm-.829-2.03c.514.524.829 1.24.829 2.03h1.2c0-1.117-.447-2.13-1.171-2.87l-.858.84zM11.9 3.5v9.55h1.2V3.5h-1.2zM10 1.6c1.05 0 1.9.85 1.9 1.9h1.2A3.1 3.1 0 0 0 10 .4v1.2z' fill='currentColor'/><path d='M10 14V8' stroke='currentColor' stroke-width='1.2' stroke-linecap='round'/><path d='M14 3h3m-3 3h3m-3 3h3m-8 6.5a1 1 0 1 0 2 0 1 1 0 1 0-2 0' stroke='currentColor' stroke-width='1.2'/></symbol></svg>", uye = ( 79583 /* HTML */ 79584 ` 79585 ${cye} 79586 <div class="uc-wrapper uc-wrapper_desktop"> 79587 <uc-presence-toggle class="uc-network_problems_splash" set="visible: presence.networkProblems;"> 79588 <div class="uc-network_problems_content"> 79589 <div class="uc-network_problems_icon"> 79590 <uc-icon name="sad"></uc-icon> 79591 </div> 79592 <div class="uc-network_problems_text">Network error</div> 79593 </div> 79594 <div class="uc-network_problems_footer"> 79595 <uc-btn-ui theme="primary" text="Retry" set="onclick: *on.retryNetwork"></uc-btn-ui> 79596 </div> 79597 </uc-presence-toggle> 79598 <div class="uc-viewport"> 79599 <div class="uc-file_type_outer"> 79600 <div class="uc-file_type">{{fileType}}</div> 79601 </div> 79602 <div class="uc-image_container" ref="img-container-el"> 79603 <img src="${Od}" class="uc-image uc-image_visible_from_editor" ref="img-el" /> 79604 <uc-editor-image-cropper ref="cropper-el"></uc-editor-image-cropper> 79605 <uc-editor-image-fader ref="fader-el"></uc-editor-image-fader> 79606 </div> 79607 <div class="uc-info_pan">{{msg}}</div> 79608 </div> 79609 <div class="uc-toolbar"> 79610 <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui> 79611 <div class="uc-toolbar_content uc-toolbar_content__editor"> 79612 <uc-editor-toolbar></uc-editor-toolbar> 79613 </div> 79614 </div> 79615 </div> 79616` 79617); 79618class Pg extends Ti { 79619 ctxOwner = !0;
79620 static styleAttrs = ["uc-cloud-image-editor"]; 79621 constructor() { 79622 super(), this.init$ = { 79623 ...this.init$, 79624 ...lye(this) 79625 }; 79626 } 79627 /** @private */ 79628 _debouncedShowLoader = wo(this._showLoader.bind(this), 300); 79629 /** 79630 * @private 79631 * @param {boolean} show 79632 */ 79633 _showLoader(t) { 79634 this.$.showLoader = t; 79635 } 79636 /** 79637 * To proper work, we need non-zero size the element. So, we'll wait for it. 79638 * 79639 * @private 79640 * @returns {Promise<void>} 79641 */ 79642 _waitForSize() { 79643 return new Promise((i, s) => { 79644 const n = setTimeout(() => { 79645 s(new Error("[cloud-image-editor] timeout waiting for non-zero container size")); 79646 }, 3e3), o = new ResizeObserver(([r]) => { 79647 r.contentRect.width > 0 && r.contentRect.height > 0 && (i(), clearTimeout(n), o.disconnect()); 79648 }); 79649 o.observe(this); 79650 }); 79651 } 79652 initCallback() { 79653 super.initCallback(), this.$["*faderEl"] = this.ref["fader-el"], this.$["*cropperEl"] = this.ref["cropper-el"], this.$["*imgContainerEl"] = this.ref["img-container-el"], this.initEditor(); 79654 } 79655 async updateImage() { 79656 if (this.isConnected) { 79657 if (await this._waitForSize(), this.$.cdnUrl) { 79658 const t = X_(this.$.cdnUrl), i = ig(this.$.cdnUrl, t); 79659 if (i === this.$["*originalUrl"]) 79660 return; 79661 this.$["*originalUrl"] = i; 79662 const s = wge(this.$.cdnUrl), n = Dge(s); 79663 this.$["*editorTransformations"] = n; 79664 } else if (this.$.uuid) { 79665 const t = ig(this.cfg.cdnCname, this.$.uuid); 79666 if (t === this.$["*originalUrl"]) 79667 return; 79668 this.$["*originalUrl"] = t, this.$["*editorTransformations"] = {}; 79669 } else 79670 throw new Error("No UUID nor CDN URL provided"); 79671 this.$["*tabId"] === Oi.CROP ? this.$["*cropperEl"].deactivate({ reset: !0 }) : this.$["*faderEl"].deactivate(); 79672 try { 79673 const t = await this.proxyUrl(co(this.$["*originalUrl"], Dl("json"))), i = await fetch(t).then((o) => o.json()), { width: s, height: n } = ( 79674 /** @type {{ width: number; height: number }} */ 79675 i 79676 ); 79677 this.$["*imageSize"] = { width: s, height: n }, this.$["*tabId"] === Oi.CROP ? this.$["*cropperEl"].activate(this.$["*imageSize"]) : this.$["*faderEl"].activate({ url: this.$["*originalUrl"] }); 79678 } catch (t) { 79679 t && console.error("Failed to load image info", t); 79680 } 79681 } 79682 } 79683 async initEditor() { 79684 try { 79685 await this._waitForSize(); 79686 } catch (t) { 79687 this.isConnected && console.error(t.message); 79688 return; 79689 } 79690 this.ref["img-el"].addEventListener("load", () => { 79691 this._imgLoading = !1, this._debouncedShowLoader(!1), this.$.src !== Od && (this.$["*networkProblems"] = !1); 79692 }), this.ref["img-el"].addEventListener("error", () => { 79693 this._imgLoading = !1, this._debouncedShowLoader(!1), this.$["*networkProblems"] = !0; 79694 }), this.sub("src", (t) => { 79695 let i = this.ref["img-el"]; 79696 i.src !== t && (this._imgLoading = !0, i.src = t || Od); 79697 }), this.sub("cropPreset", (t) => { 79698 this.$["*cropPresetList"] = A3(t); 79699 }), this.sub( 79700 "tabs", 79701 /** @param {string} val */ 79702 (t) => { 79703 this.$["*tabList"] = aye(t); 79704 } 79705 ), this.sub("*tabId", (t) => { 79706 this.ref["img-el"].className = jo("uc-image", { 79707 "uc-image_hidden_to_cropper": t === Oi.CROP, 79708 "uc-image_hidden_effects": t !== Oi.CROP 79709 }); 79710 }), this.classList.add("uc-editor_ON"), this.sub("*networkProblems", (t) => { 79711 this.$["presence.networkProblems"] = t, this.$["presence.modalCaption"] = !t; 79712 }), this.sub( 79713 "*editorTransformations", 79714 (t) => { 79715 if (Object.keys(t).length === 0) 79716 return; 79717 let i = this.$["*originalUrl"], s = Dl(sC(t), "preview"), n = co(i, s), o = { 79718 originalUrl: i, 79719 cdnUrlModifiers: s, 79720 cdnUrl: n, 79721 transformations: t 79722 }; 79723 this.dispatchEvent( 79724 new CustomEvent("change", { 79725 detail: o, 79726 bubbles: !0, 79727 composed: !0 79728 }) 79729 ); 79730 }, 79731 !1 79732 ), this.sub("uuid", (t) => t && this.updateImage()), this.sub("cdnUrl", (t) => t && this.updateImage()); 79733 } 79734} 79735Pg.template = uye; 79736Pg.bindAttributes({ 79737 uuid: "uuid", 79738 "cdn-url": "cdnUrl", 79739 "crop-preset": "cropPreset", 79740 tabs: "tabs" 79741}); 79742class Y3 extends Ti { 79743 constructor() { 79744 super(), this.init$ = { 79745 ...this.init$, 79746 dragging: !1 79747 }, this._handlePointerUp = this._handlePointerUp_.bind(this), this._handlePointerMove = this._handlePointerMove_.bind(this), this._handleSvgPointerMove = this._handleSvgPointerMove_.bind(this); 79748 } 79749 /** 79750 * @private 79751 * @param {import('./types.js').Direction} direction 79752 */ 79753 _shouldThumbBeDisabled(t) { 79754 let i = this.$["*imageBox"]; 79755 if (!i) 79756 return; 79757 if (t === "" && i.height <= vt && i.width <= vt) 79758 return !0; 79759 let s = i.height <= vt && (t.includes("n") || t.includes("s")), n = i.width <= vt && (t.includes("e") || t.includes("w")); 79760 return s || n; 79761 } 79762 /** @private */ 79763 _createBackdrop() { 79764 let t = this.$["*cropBox"]; 79765 if (!t) 79766 return; 79767 let { x: i, y: s, width: n, height: o } = t, r = this.ref["svg-el"], a = Fo("mask", { id: "backdrop-mask" }), l = Fo("rect", { 79768 x: 0, 79769 y: 0, 79770 width: "100%", 79771 height: "100%", 79772 fill: "white" 79773 }), c = Fo("rect", { 79774 x: i, 79775 y: s, 79776 width: n, 79777 height: o, 79778 fill: "black" 79779 }); 79780 a.appendChild(l), a.appendChild(c); 79781 let u = Fo("rect", { 79782 x: 0, 79783 y: 0, 79784 width: "100%", 79785 height: "100%", 79786 fill: "var(--color-image-background)", 79787 "fill-opacity": 0.85, 79788 mask: "url(#backdrop-mask)" 79789 }); 79790 r.appendChild(u), r.appendChild(a), this._backdropMask = a, this._backdropMaskInner = c; 79791 } 79792 /** 79793 * @private Super Tricky workaround for the chromium bug See 79794 * https://bugs.chromium.org/p/chromium/issues/detail?id=330815 79795 */ 79796 _resizeBackdrop() { 79797 this._backdropMask && (this._backdropMask.style.display = "none", window.requestAnimationFrame(() => { 79798 this._backdropMask && (this._backdropMask.style.display = "block"); 79799 })); 79800 } 79801 /** @private */ 79802 _updateBackdrop() { 79803 let t = this.$["*cropBox"]; 79804 if (!t) 79805 return; 79806 let { x: i, y: s, width: n, height: o } = t; 79807 this._backdropMaskInner && zu(this._backdropMaskInner, { x: i, y: s, width: n, height: o }); 79808 } 79809 /** @private */ 79810 _updateFrame() { 79811 let t = this.$["*cropBox"];
79812 if (!(!t || !this._frameGuides || !this._frameThumbs)) { 79813 for (let i of Object.values(this._frameThumbs)) { 79814 let { direction: s, pathNode: n, interactionNode: o, groupNode: r } = i, a = s === "", l = s.length === 2, { x: c, y: u, width: d, height: p } = t; 79815 if (a) 79816 zu(o, { 79817 x: c, 79818 y: u, 79819 width: d, 79820 height: p 79821 }); 79822 else { 79823 const m = Qu( 79824 Math.min(d, p) / (bS * 2 + Yh) / 2, 79825 0, 79826 1 79827 ); 79828 let { d: y, center: b } = l ? fme(t, s, m) : mme( 79829 t, 79830 /** @type {Extract<import('./types.js').Direction, 'n' | 's' | 'w' | 'e'>} */ 79831 s, 79832 m 79833 ); 79834 const C = Math.max( 79835 ZT * Qu(Math.min(d, p) / ZT / 3, 0, 1), 79836 gme 79837 ); 79838 zu(o, { 79839 x: b[0] - C, 79840 y: b[1] - C, 79841 width: C * 2, 79842 height: C * 2 79843 }), zu(n, { d: y }); 79844 } 79845 let f = this._shouldThumbBeDisabled(s); 79846 r.setAttribute( 79847 "class", 79848 jo("uc-thumb", { 79849 "uc-thumb--hidden": f, 79850 "uc-thumb--visible": !f 79851 }) 79852 ); 79853 } 79854 zu(this._frameGuides, { 79855 x: t.x - uc * 0.5, 79856 y: t.y - uc * 0.5, 79857 width: t.width + uc, 79858 height: t.height + uc 79859 }); 79860 } 79861 } 79862 /** 79863 * @param {import('./types.js').FrameThumbs} frameThumbs 79864 * @param {import('./types.js').Direction} direction 79865 */ 79866 _createThumb(t, i) { 79867 let s = Fo("g"); 79868 s.classList.add("uc-thumb"), s.setAttribute("with-effects", ""); 79869 let n = Fo("rect", { 79870 fill: "transparent" 79871 }), o = Fo("path", { 79872 stroke: "currentColor", 79873 fill: "none", 79874 "stroke-width": M3 79875 }); 79876 s.appendChild(o), s.appendChild(n), t[i] = { 79877 direction: i, 79878 pathNode: o, 79879 interactionNode: n, 79880 groupNode: s 79881 }, i === "" && (s.style.cursor = "move"), n.addEventListener("pointerdown", this._handlePointerDown.bind(this, i)); 79882 } 79883 /** @private */ 79884 _createThumbs() { 79885 const t = {}; 79886 for (let i = 0; i < 3; i++) 79887 for (let s = 0; s < 3; s++) { 79888 let n = ( 79889 /** @type {import('./types.js').Direction} */ 79890 `${["n", "", "s"][i]}${["w", "", "e"][s]}` 79891 ); 79892 n !== "" && this._createThumb(t, n); 79893 } 79894 return this._createThumb(t, ""), t; 79895 } 79896 /** @private */ 79897 _createGuides() { 79898 let t = Fo("svg"), i = Fo("rect", { 79899 x: 0, 79900 y: 0, 79901 width: "100%", 79902 height: "100%", 79903 fill: "none", 79904 stroke: "currentColor", 79905 "stroke-width": uc, 79906 "stroke-opacity": 0.5 79907 }); 79908 t.appendChild(i); 79909 for (let s = 1; s <= 2; s++) { 79910 let n = Fo("line", { 79911 x1: `${Xf * s}%`, 79912 y1: "0%", 79913 x2: `${Xf * s}%`, 79914 y2: "100%", 79915 stroke: "currentColor", 79916 "stroke-width": uc, 79917 "stroke-opacity": 0.3 79918 }); 79919 t.appendChild(n); 79920 } 79921 for (let s = 1; s <= 2; s++) { 79922 let n = Fo("line", { 79923 x1: "0%", 79924 y1: `${Xf * s}%`, 79925 x2: "100%", 79926 y2: `${Xf * s}%`, 79927 stroke: "currentColor", 79928 "stroke-width": uc, 79929 "stroke-opacity": 0.3 79930 }); 79931 t.appendChild(n); 79932 } 79933 return t.classList.add("uc-guides", "uc-guides--semi-hidden"), t; 79934 } 79935 /** @private */ 79936 _createFrame() { 79937 let t = this.ref["svg-el"], i = document.createDocumentFragment(), s = this._createGuides(); 79938 i.appendChild(s); 79939 let n = this._createThumbs(); 79940 for (let { groupNode: o } of Object.values(n)) 79941 i.appendChild(o); 79942 t.appendChild(i), this._frameThumbs = n, this._frameGuides = s; 79943 } 79944 /** 79945 * @private 79946 * @param {import('./types.js').Direction} direction 79947 * @param {PointerEvent} e 79948 */ 79949 _handlePointerDown(t, i) { 79950 if (!this._frameThumbs) return; 79951 let s = this._frameThumbs[t]; 79952 if (this._shouldThumbBeDisabled(t)) 79953 return; 79954 let n = this.$["*cropBox"], { x: o, y: r } = this.ref["svg-el"].getBoundingClientRect(), a = i.x - o, l = i.y - r; 79955 this.$.dragging = !0, this._draggingThumb = s, this._dragStartPoint = [a, l], this._dragStartCrop = { ...n }; 79956 } 79957 /** 79958 * @private 79959 * @param {PointerEvent} e 79960 */ 79961 _handlePointerUp_(t) {
79962 this._updateCursor(), this.$.dragging && (t.stopPropagation(), t.preventDefault(), this.$.dragging = !1); 79963 } 79964 /** 79965 * @private 79966 * @param {PointerEvent} e 79967 */ 79968 _handlePointerMove_(t) { 79969 if (!this.$.dragging || !this._dragStartPoint || !this._draggingThumb) 79970 return; 79971 t.stopPropagation(), t.preventDefault(); 79972 let i = this.ref["svg-el"], { x: s, y: n } = i.getBoundingClientRect(), o = t.x - s, r = t.y - n, a = o - this._dragStartPoint[0], l = r - this._dragStartPoint[1], { direction: c } = this._draggingThumb; 79973 const u = this._calcCropBox(c, [a, l]); 79974 u && (this.$["*cropBox"] = u); 79975 } 79976 /** 79977 * @private 79978 * @param {import('./types.js').Direction} direction 79979 * @param {[Number, Number]} delta 79980 */ 79981 _calcCropBox(t, i) { 79982 const [s, n] = i; 79983 let o = this.$["*imageBox"], r = ( 79984 /** @type {import('./types.js').Rectangle} */ 79985 this._dragStartCrop ?? this.$["*cropBox"] 79986 ); 79987 const a = this.$["*cropPresetList"]?.[0], l = a ? a.width / a.height : void 0; 79988 if (t === "" ? r = yme({ rect: r, delta: [s, n], imageBox: o }) : r = Eme({ rect: r, delta: [s, n], direction: t, aspectRatio: l, imageBox: o }), !Object.values(r).every((c) => Number.isFinite(c) && c >= 0)) { 79989 console.error("CropFrame is trying to create invalid rectangle", { 79990 payload: r 79991 }); 79992 return; 79993 } 79994 return wv(Am(r), this.$["*imageBox"]); 79995 } 79996 /** 79997 * @private 79998 * @param {PointerEvent} e 79999 */ 80000 _handleSvgPointerMove_(t) { 80001 if (!this._frameThumbs) return; 80002 let i = Object.values(this._frameThumbs).find((s) => { 80003 if (this._shouldThumbBeDisabled(s.direction)) 80004 return !1; 80005 let o = s.interactionNode.getBoundingClientRect(), r = { 80006 x: o.x, 80007 y: o.y, 80008 width: o.width, 80009 height: o.height 80010 }; 80011 return Ime(r, [t.x, t.y]); 80012 }); 80013 this._hoverThumb = i, this._updateCursor(); 80014 } 80015 /** @private */ 80016 _updateCursor() { 80017 let t = this._hoverThumb; 80018 this.ref["svg-el"].style.cursor = t ? vme(t.direction) : "initial"; 80019 } 80020 /** @private */ 80021 _render() { 80022 this._updateBackdrop(), this._updateFrame(); 80023 } 80024 /** @param {boolean} visible */ 80025 toggleThumbs(t) { 80026 this._frameThumbs && Object.values(this._frameThumbs).map(({ groupNode: i }) => i).forEach((i) => { 80027 i.setAttribute( 80028 "class", 80029 jo("uc-thumb", { 80030 "uc-thumb--hidden": !t, 80031 "uc-thumb--visible": t 80032 }) 80033 ); 80034 }); 80035 } 80036 initCallback() { 80037 super.initCallback(), this._createBackdrop(), this._createFrame(), this.sub("*imageBox", () => { 80038 this._resizeBackdrop(), window.requestAnimationFrame(() => { 80039 this._render(); 80040 }); 80041 }), this.sub("*cropBox", (t) => { 80042 t && (this._guidesHidden = t.height <= vt || t.width <= vt, window.requestAnimationFrame(() => { 80043 this._render(); 80044 })); 80045 }), this.sub("dragging", (t) => { 80046 this._frameGuides && this._frameGuides.setAttribute( 80047 "class", 80048 jo({ 80049 "uc-guides--hidden": this._guidesHidden, 80050 "uc-guides--visible": !this._guidesHidden && t, 80051 "uc-guides--semi-hidden": !this._guidesHidden && !t 80052 }) 80053 ); 80054 }), this.ref["svg-el"].addEventListener("pointermove", this._handleSvgPointerMove, !0), document.addEventListener("pointermove", this._handlePointerMove, !0), document.addEventListener("pointerup", this._handlePointerUp, !0); 80055 } 80056 destroyCallback() { 80057 super.destroyCallback(), document.removeEventListener("pointermove", this._handlePointerMove), document.removeEventListener("pointerup", this._handlePointerUp); 80058 } 80059} 80060Y3.template = /* HTML */ 80061' <svg class="uc-svg" ref="svg-el" xmlns="http://www.w3.org/2000/svg"></svg> '; 80062class vC extends Ti { 80063 init$ = { 80064 ...this.init$, 80065 active: !1, 80066 title: "", 80067 icon: "", 80068 "on.click": null, 80069 "title-prop": "" 80070 }; 80071 initCallback() { 80072 super.initCallback(), this._titleEl = this.ref["title-el"], this._iconEl = this.ref["icon-el"], this.sub("title", (t) => { 80073 this._titleEl && (this._titleEl.style.display = t ? "block" : "none"); 80074 }), this.sub("active", (t) => {
80075 this.className = jo({ 80076 "uc-active": t, 80077 "uc-not_active": !t 80078 }); 80079 }), this.sub("on.click", (t) => { 80080 this.onclick = t; 80081 }); 80082 } 80083} 80084vC.template = /* HTML */ 80085` 80086 <button type="button" role="option" l10n="@title:title-prop"> 80087 <uc-icon set="@name: icon;"></uc-icon> 80088 <div class="uc-title" ref="title-el">{{title}}</div> 80089 </button> 80090`; 80091function dye(e) { 80092 let t = e + 90; 80093 return t = t >= 360 ? 0 : t, t; 80094} 80095function hye(e, t) { 80096 return e === "rotate" ? dye(t) : ["mirror", "flip"].includes(e) ? !t : null; 80097} 80098class K3 extends vC { 80099 initCallback() { 80100 super.initCallback(), this.defineAccessor("operation", (t) => { 80101 t && (this._operation = t, this.$.icon = t, this.bindL10n( 80102 "title-prop", 80103 () => this.l10n("a11y-cloud-editor-apply-crop", { 80104 name: this.l10n(t).toLowerCase() 80105 }) 80106 )); 80107 }), this.$["on.click"] = () => { 80108 let t = this.$["*cropperEl"].getValue(this._operation), i = hye(this._operation, t); 80109 this.$["*cropperEl"].setValue(this._operation, i); 80110 }; 80111 } 80112} 80113const Bh = { 80114 FILTER: "filter", 80115 COLOR_OPERATION: "color_operation" 80116}, Cl = "original"; 80117class Z3 extends Ti { 80118 init$ = { 80119 ...this.init$, 80120 disabled: !1, 80121 min: 0, 80122 max: 100, 80123 value: 0, 80124 defaultValue: 0, 80125 zero: 0, 80126 "on.input": (t) => { 80127 this.$["*faderEl"].set(t), this.$.value = t; 80128 } 80129 }; 80130 /** 80131 * @param {String} operation 80132 * @param {String} [filter] 80133 */ 80134 setOperation(t, i) { 80135 this._controlType = t === "filter" ? Bh.FILTER : Bh.COLOR_OPERATION, this._operation = t, this._iconName = t, this._title = t.toUpperCase(), this._filter = i, this._initializeValues(), this.$["*faderEl"].activate({ 80136 url: this.$["*originalUrl"], 80137 operation: this._operation, 80138 value: this._filter === Cl ? void 0 : this.$.value, 80139 filter: this._filter === Cl ? void 0 : this._filter, 80140 fromViewer: !1 80141 }); 80142 } 80143 /** @private */ 80144 _initializeValues() { 80145 let { range: t, zero: i } = Pd[this._operation], [s, n] = t; 80146 this.$.min = s, this.$.max = n, this.$.zero = i; 80147 let o = this.$["*editorTransformations"][this._operation]; 80148 if (this._controlType === Bh.FILTER) { 80149 let r = n; 80150 if (o) { 80151 let { name: a, amount: l } = o; 80152 r = a === this._filter ? l : n; 80153 } 80154 this.$.value = r, this.$.defaultValue = r; 80155 } 80156 if (this._controlType === Bh.COLOR_OPERATION) { 80157 let r = typeof o < "u" ? o : i; 80158 this.$.value = r, this.$.defaultValue = r; 80159 } 80160 } 80161 apply() { 80162 let t; 80163 this._controlType === Bh.FILTER ? this._filter === Cl ? t = null : t = { name: this._filter, amount: this.$.value } : t = this.$.value; 80164 let i = { 80165 ...this.$["*editorTransformations"], 80166 [this._operation]: t 80167 }; 80168 this.$["*editorTransformations"] = i; 80169 } 80170 cancel() { 80171 this.$["*faderEl"].deactivate({ hide: !1 }); 80172 } 80173 initCallback() { 80174 super.initCallback(), this.sub("*originalUrl", (t) => { 80175 this._originalUrl = t; 80176 }), this.sub("value", (t) => { 80177 let i = `${this._filter || this._operation} ${t}`; 80178 this.$["*operationTooltip"] = i; 80179 }); 80180 } 80181} 80182Z3.template = /* HTML */ 80183` 80184 <uc-slider-ui 80185 ref="slider-el" 80186 set="disabled: disabled; min: min; max: max; defaultValue: defaultValue; zero: zero; onInput: on.input;" 80187 ></uc-slider-ui> 80188`; 80189function JM(e) { 80190 let t = new Image(); 80191 return { promise: new Promise((n, o) => { 80192 t.src = e, t.onload = n, t.onerror = o; 80193 }), image: t, cancel: () => { 80194 t.naturalWidth === 0 && (t.src = Od); 80195 } }; 80196} 80197function wS(e) { 80198 let t = []; 80199 for (let o of e) { 80200 let r = JM(o); 80201 t.push(r); 80202 } 80203 let i = t.map((o) => o.image); 80204 return { promise: Promise.allSettled(t.map((o) => o.promise)), images: i, cancel: () => { 80205 t.forEach((o) => { 80206 o.cancel(); 80207 }); 80208 } }; 80209} 80210class eA extends vC { 80211 constructor() { 80212 super(), this.init$ = { 80213 ...this.init$, 80214 active: !1, 80215 title: "", 80216 icon: "", 80217 isOriginal: !1, 80218 iconSize: "20", 80219 "on.click": null 80220 }; 80221 } 80222 _previewSrc() { 80223 let t = parseInt(window.getComputedStyle(this).getPropertyValue("--l-base-min-width"), 10), i = window.devicePixelRatio, s = Math.ceil(i * t), n = i >= 2 ? "lightest" : "normal", o = 100, r = { ...this.$["*editorTransformations"] }; 80224 return r[this._operation] = this._filter !== Cl ? { 80225 name: this._filter, 80226 amount: o 80227 } : void 0, co( 80228 this._originalUrl, 80229 Dl( 80230 n3, 80231 sC(r), 80232 `quality/${n}`, 80233 `scale_crop/${s}x${s}/center` 80234 ) 80235 ); 80236 } 80237 /** 80238 * @param {IntersectionObserverEntry[]} entries 80239 * @param {IntersectionObserver} observer 80240 */ 80241 async _observerCallback(t, i) { 80242 if (t[0].isIntersecting) { 80243 let n = await this.proxyUrl(this._previewSrc()), o = this.ref["preview-el"], { promise: r, cancel: a } = JM(n); 80244 this._cancelPreload = a, r.catch((l) => { 80245 this.$["*networkProblems"] = !0, console.error("Failed to load image", { error: l }); 80246 }).finally(() => { 80247 o.style.backgroundImage = `url(${n})`, o.setAttribute("loaded", ""), i.unobserve(this); 80248 }); 80249 } else 80250 this._cancelPreload?.(); 80251 } 80252 initCallback() { 80253 super.initCallback(), this.$["on.click"] = () => { 80254 this.$.active ? this.$.isOriginal || (this.$["*sliderEl"].setOperation(this._operation, this._filter), this.$["*showSlider"] = !0) : (this.$["*sliderEl"].setOperation(this._operation, this._filter), this.$["*sliderEl"].apply()), this.$["*currentFilter"] = this._filter; 80255 }, this.defineAccessor( 80256 "filter", 80257 /** @param {string} filter */ 80258 (i) => { 80259 this._operation = "filter", this._filter = i, this.$.isOriginal = i === Cl, this.$.icon = this.$.isOriginal ? "original" : "slider", this.bindL10n( 80260 "title-prop", 80261 () => this.l10n("a11y-cloud-editor-apply-filter", { 80262 name: i.toLowerCase() 80263 }) 80264 ); 80265 } 80266 ), this._observer = new window.IntersectionObserver(this._observerCallback.bind(this), { 80267 threshold: [0, 1] 80268 }); 80269 let t = this.$["*originalUrl"]; 80270 this._originalUrl = t, this.$.isOriginal ? this.ref["icon-el"].classList.add("uc-original-icon") : this._observer.observe(this), this.sub("*currentFilter", (i) => { 80271 this.$.active = i && i === this._filter; 80272 }), this.sub("isOriginal", (i) => { 80273 this.$.iconSize = i ? 40 : 20; 80274 }), this.sub("active", (i) => { 80275 if (this.$.isOriginal) 80276 return; 80277 let s = this.ref["icon-el"]; 80278 s.style.opacity = i ? "1" : "0"; 80279 let n = this.ref["preview-el"]; 80280 i ? n.style.opacity = "0" : n.style.backgroundImage && (n.style.opacity = "1"); 80281 }), this.sub("*networkProblems", async (i) => { 80282 if (!i) { 80283 let s = await this.proxyUrl(this._previewSrc()), n = this.ref["preview-el"]; 80284 n.style.backgroundImage && (n.style.backgroundImage = "none", n.style.backgroundImage = `url(${s})`); 80285 } 80286 }); 80287 } 80288 destroyCallback() { 80289 super.destroyCallback(), this._observer?.disconnect(), this._cancelPreload?.(); 80290 } 80291} 80292eA.template = /* HTML */ 80293` 80294 <button type="button" role="option" l10n="@title:title-prop"> 80295 <div class="uc-preview" ref="preview-el"></div> 80296 <uc-icon ref="icon-el" set="@name: icon; @size: iconSize;"></uc-icon> 80297 </button> 80298`; 80299class q3 extends vC { 80300 /** 80301 * @private 80302 * @type {String} 80303 */ 80304 _operation = ""; 80305 initCallback() { 80306 super.initCallback(), this.$["on.click"] = (t) => { 80307 this.$["*sliderEl"].setOperation(this._operation), this.$["*showSlider"] = !0, this.$["*currentOperation"] = this._operation; 80308 }, this.defineAccessor("operation", (t) => { 80309 t && (this._operation = t, this.$.icon = t, this.bindL10n( 80310 "title-prop", 80311 () => this.l10n("a11y-cloud-editor-apply-tuning", { 80312 name: this.l10n(t).toLowerCase() 80313 }) 80314 ), this.bindL10n("title", () => this.l10n(t))); 80315 }), this.sub("*editorTransformations", (t) => { 80316 if (!this._operation) 80317 return; 80318 let { zero: i } = Pd[this._operation], s = t[this._operation], n = typeof s < "u" ? s !== i : !1; 80319 this.$.active = n; 80320 }); 80321 } 80322} 80323function pye(e, t) { 80324 let i = {}; 80325 for (let s of t) { 80326 let n = e[s]; 80327 (e.hasOwnProperty(s) || n !== void 0) && (i[s] = n); 80328 } 80329 return i; 80330} 80331function tA(e, t, i) { 80332 let n = window.devicePixelRatio, o = Math.min(Math.ceil(t * n), 3e3), r = n >= 2 ? "lightest" : "normal"; 80333 return co( 80334 e, 80335 Dl( 80336 n3, 80337 sC(i), 80338 `quality/${r}`, 80339 `stretch/off/-/resize/${o}x`, 80340 `@clib/${hC}/${pC}/uc-cloud-image-editor/` 80341 ) 80342 ); 80343} 80344function gye(e) { 80345 return e ? [
vendor: 4,159 bytes, lines 80346-80449
80346 ({ dimensions: i, coords: s }) => [...i, ...s].every((n) => Number.isInteger(n) && Number.isFinite(n)), 80347 ({ dimensions: i, coords: s }) => i.every((n) => n > 0) && s.every((n) => n >= 0) 80348 ].every((i) => i(e)) : !0; 80349} 80350class Q3 extends Ti { 80351 ctxOwner = !0; 80352 constructor() { 80353 super(), this.init$ = { 80354 ...this.init$, 80355 image: null, 80356 "*padding": pme, 80357 /** @type {Operations} */ 80358 "*operations": { 80359 rotate: 0, 80360 mirror: !1, 80361 flip: !1 80362 }, 80363 /** @type {import('./types.js').Rectangle} */ 80364 "*imageBox": { 80365 x: 0, 80366 y: 0, 80367 width: 0, 80368 height: 0 80369 }, 80370 /** @type {import('./types.js').Rectangle} */ 80371 "*cropBox": { 80372 x: 0, 80373 y: 0, 80374 width: 0, 80375 height: 0 80376 } 80377 }, this._commitDebounced = wo(this._commit.bind(this), 300), this._handleResizeThrottled = z3(this._handleResize.bind(this), 100), this._imageSize = { width: 0, height: 0 }; 80378 } 80379 /** @private */ 80380 _handleResize() { 80381 !this.isConnected || !this._isActive || (this._initCanvas(), this._syncTransformations(), this._alignImage(), this._alignCrop(), this._draw()); 80382 } 80383 /** @private */ 80384 _syncTransformations() { 80385 let t = this.$["*editorTransformations"], i = pye(t, Object.keys(this.$["*operations"])), s = { ...this.$["*operations"], ...i }; 80386 this.$["*operations"] = s; 80387 } 80388 /** @private */ 80389 _initCanvas() { 80390 let t = this.ref["canvas-el"], i = t.getContext("2d"), s = this.offsetWidth, n = this.offsetHeight, o = window.devicePixelRatio; 80391 t.style.width = `${s}px`, t.style.height = `${n}px`, t.width = s * o, t.height = n * o, i?.scale(o, o), this._canvas = t, this._ctx = i; 80392 } 80393 /** @private */ 80394 _alignImage() { 80395 if (!this._isActive || !this.$.image) 80396 return; 80397 let t = this.$.image, i = this.$["*padding"], s = this.$["*operations"], { rotate: n } = s, o = { width: this.offsetWidth, height: this.offsetHeight }, r = Nh({ width: t.naturalWidth, height: t.naturalHeight }, n), a; 80398 if (r.width > o.width - i * 2 || r.height > o.height - i * 2) { 80399 let l = r.width / r.height, c = o.width / o.height; 80400 if (l > c) { 80401 let u = o.width - i * 2, d = u / l, p = 0 + i, f = i + (o.height - i * 2) / 2 - d / 2; 80402 a = { x: p, y: f, width: u, height: d }; 80403 } else { 80404 let u = o.height - i * 2, d = u * l, p = i + (o.width - i * 2) / 2 - d / 2, f = 0 + i; 80405 a = { x: p, y: f, width: d, height: u }; 80406 } 80407 } else { 80408 let { width: l, height: c } = r, u = i + (o.width - i * 2) / 2 - l / 2, d = i + (o.height - i * 2) / 2 - c / 2; 80409 a = { x: u, y: d, width: l, height: c }; 80410 } 80411 this.$["*imageBox"] = Am(a); 80412 } 80413 /** @private */ 80414 _alignCrop() { 80415 let t = this.$["*cropBox"], i = this.$["*imageBox"], s = this.$["*operations"], { rotate: n } = s, o = this.$["*editorTransformations"].crop, { width: r, x: a, y: l } = this.$["*imageBox"]; 80416 if (o) { 80417 let { 80418 dimensions: [d, p], 80419 coords: [f, m] 80420 } = o, { width: y } = Nh(this._imageSize, n), b = r / y; 80421 t = wv( 80422 Am({ 80423 x: a + f * b, 80424 y: l + m * b, 80425 width: d * b, 80426 height: p * b 80427 }), 80428 this.$["*imageBox"] 80429 ); 80430 } 80431 const c = this.$["*cropPresetList"]?.[0], u = c ? c.width / c.height : void 0; 80432 if (!Rme(t, i) || u && !Tme(t, u)) { 80433 const d = i.width / i.height; 80434 let p = i.width, f = i.height; 80435 u && (d > u ? p = Math.min(i.height * u, i.width) : f = Math.min(i.width / u, i.height)), t = { 80436 x: i.x + i.width / 2 - p / 2, 80437 y: i.y + i.height / 2 - f / 2, 80438 width: p, 80439 height: f 80440 }; 80441 } 80442 this.$["*cropBox"] = wv(Am(t), this.$["*imageBox"]); 80443 } 80444 /** @private */ 80445 _drawImage() { 80446 let t = this._ctx; 80447 if (!t) return; 80448 let i = this.$.image, s = this.$["*imageBox"], n = this.$["*operations"], { mirror: o, flip: r, rotate: a } = n, l = Nh({ width: s.width, height: s.height }, a); 80449 t.save(), t.translate(s.x + s.width / 2, s.y + s.height / 2), t.rotate(a * Math.PI * -1 / 180), t.scale(o ? -1 : 1, r ? -1 : 1), t.drawImage(i, -l.width / 2, -l.height / 2, l.width, l.height), t.restore(
80449); 80450 } 80451 /** @private */ 80452 _draw() { 80453 if (!this._isActive || !this.$.image || !this._canvas || !this._ctx) 80454 return; 80455 let t = this._canvas; 80456 this._ctx.clearRect(0, 0, t.width, t.height), this._drawImage(); 80457 } 80458 /** 80459 * @private 80460 * @param {{ fromViewer?: boolean }} options 80461 */ 80462 _animateIn({ fromViewer: t }) { 80463 this.$.image && (this.ref["frame-el"].toggleThumbs(!0), this._transitionToImage(), setTimeout(() => { 80464 this.className = jo({ 80465 "uc-active_from_viewer": t, 80466 "uc-active_from_editor": !t, 80467 "uc-inactive_to_editor": !1 80468 }); 80469 })); 80470 } 80471 /** 80472 * @private 80473 * @returns {NonNullable<import('./types.js').Transformations['crop']>['dimensions']} 80474 */ 80475 _getCropDimensions() { 80476 let t = this.$["*cropBox"], i = this.$["*imageBox"], s = this.$["*operations"], { rotate: n } = s, { width: o, height: r } = i, { width: a, height: l } = Nh(this._imageSize, n), { width: c, height: u } = t, d = o / a, p = r / l; 80477 return [ 80478 Qu(Math.round(c / d), 1, a), 80479 Qu(Math.round(u / p), 1, l) 80480 ]; 80481 } 80482 /** 80483 * @private 80484 * @returns {import('./types.js').Transformations['crop']} 80485 */ 80486 _getCropTransformation() { 80487 let t = this.$["*cropBox"], i = this.$["*imageBox"], s = this.$["*operations"], { rotate: n } = s, { width: o, height: r, x: a, y: l } = i, { width: c, height: u } = Nh(this._imageSize, n), { x: d, y: p } = t, f = o / c, m = r / u, y = this._getCropDimensions(), b = { 80488 dimensions: y, 80489 coords: ( 80490 /** @type {[Number, Number]} */ 80491 [ 80492 Qu(Math.round((d - a) / f), 0, c - y[0]), 80493 Qu(Math.round((p - l) / m), 0, u - y[1]) 80494 ] 80495 ) 80496 }; 80497 if (!gye(b)) { 80498 console.error("Cropper is trying to create invalid crop object", { 80499 payload: b 80500 }); 80501 return; 80502 } 80503 if (!(y[0] === c && y[1] === u)) 80504 return b; 80505 } 80506 /** @private */ 80507 _commit() { 80508 if (!this.isConnected || !this._imageSize) 80509 return; 80510 let t = this.$["*operations"], { rotate: i, mirror: s, flip: n } = t, o = this._getCropTransformation(), a = { 80511 ...this.$["*editorTransformations"], 80512 crop: o, 80513 rotate: i, 80514 mirror: s, 80515 flip: n 80516 }; 80517 this.$["*editorTransformations"] = a; 80518 } 80519 /** 80520 * @param {String} operation 80521 * @param {Number} value 80522 * @returns {void} 80523 */ 80524 setValue(t, i) { 80525 this.$["*operations"] = { 80526 ...this.$["*operations"], 80527 [t]: i 80528 }, this._isActive && (this._alignImage(), this._alignCrop(), this._draw()); 80529 } 80530 /** 80531 * @param {keyof Operations} operation 80532 * @returns {Number | boolean} 80533 */ 80534 getValue(t) { 80535 return this.$["*operations"][t]; 80536 } 80537 /** 80538 * @param {import('./types.js').ImageSize} imageSize 80539 * @param {{ fromViewer?: boolean }} options 80540 */ 80541 async activate(t, { fromViewer: i } = {}) { 80542 if (!this._isActive) { 80543 this._isActive = !0, this._imageSize = t, this.removeEventListener("transitionend", this._reset); 80544 try { 80545 this.$.image = await this._waitForImage(this.$["*originalUrl"], this.$["*editorTransformations"]), this._syncTransformations(), this._animateIn({ fromViewer: i }); 80546 } catch (s) { 80547 console.error("Failed to activate cropper", { error: s }); 80548 } 80549 this._observer = new ResizeObserver(([s]) => { 80550 s.contentRect.width > 0 && s.contentRect.height > 0 && this._isActive && this.$.image && this._handleResizeThrottled(); 80551 }), this._observer.observe(this); 80552 } 80553 } 80554 deactivate({ reset: t = !1 } = {}) { 80555 this._isActive && (!t && this._commit(), this._isActive = !1, this._transitionToCrop(), this.className = jo({ 80556 "uc-active_from_viewer": !1, 80557 "uc-active_from_editor": !1, 80558 "uc-inactive_to_editor": !0 80559 }), this.ref["frame-el"].toggleThumbs(!1), this.addEventListener("transitionend", this._reset, { once: !0 }), this._observer?.disconnect()); 80560 } 80561 /** @private */ 80562 _transitionToCrop() { 80563 let t = this._getCropDimensions(), i = Math.min(this.offsetWidth, t[0]) / this.$["*cropBox"].width, s = Math.min(this.offsetHeight, t[1]) / this.$["*cropBox"].height, n = Math.min(i, s), o = this.$["*cropBox"].x + this.$["*cropBox"].width / 2, r = this.$["*cropBox"].y + this.$["*cropBox"].height / 2; 80564 this.style.transform = `scale(${n}) translate(${(this.offsetWidth / 2 - o) / n}px, ${(this.offsetHeight / 2 - r) / n}px)`, this.style.transformOrigin = `${o}px ${r}px`; 80565 } 80566 /** @private */ 80567 _transitionToImage() { 80568 let t = this.$["*cropBox"].x + this.$["*cropBox"].width / 2, i = this.$["*cropBox"].y + this.$["*cropBox"].height / 2; 80569 this.style.transform = "scale(1)", this.style.transformOrigin = `${t}px ${i}px`; 80570 } 80571 /** @private */ 80572 _reset() { 80573 this._isActive || (this.$.image = null); 80574 } 80575 /** 80576 * @private 80577 * @param {String} originalUrl 80578 * @param {import('./types.js').Transformations} transformations 80579 * @returns {Promise<HTMLImageElement>} 80580 */ 80581 async _waitForImage(t, i) { 80582 let s = this.offsetWidth; 80583 i = { 80584 ...i, 80585 crop: void 0, 80586 rotate: void 0, 80587 flip: void 0, 80588 mirror: void 0 80589 }; 80590 let n = await this.proxyUrl(tA(t, s, i)), { promise: o, cancel: r, image: a } = JM(n), l = this._handleImageLoading(n); 80591 return a.addEventListener("load", l, { once: !0 }), a.addEventListener("error", l, { once: !0 }), this._cancelPreload?.(), this._cancelPreload = r, o.then(() => a).catch((c) => (console.error("Failed to load image", { error: c }), this.$["*networkProblems"] = !0, Promise.resolve(a))); 80592 } 80593 /** 80594 * @private 80595 * @param {String} src 80596 * @returns {() => void} Destructor 80597 */ 80598 _handleImageLoading(t) { 80599 let i = "crop", s = this.$["*loadingOperations"];
vendor: 5,884 bytes, lines 80600-80777
80600 return s.get(i) || s.set(i, /* @__PURE__ */ new Map()), s.get(i).get(t) || (s.set(i, s.get(i).set(t, !0)), this.$["*loadingOperations"] = s), () => { 80601 s?.get(i)?.has(t) && (s.get(i).delete(t), this.$["*loadingOperations"] = s); 80602 }; 80603 } 80604 initCallback() { 80605 super.initCallback(), this.sub("*imageBox", () => { 80606 this._draw(); 80607 }), this.sub("*cropBox", () => { 80608 this.$.image && this._commitDebounced(); 80609 }), this.sub("*cropPresetList", () => { 80610 this._alignCrop(); 80611 }), setTimeout(() => { 80612 this.sub("*networkProblems", (t) => { 80613 t || this._isActive && this.activate(this._imageSize, { fromViewer: !1 }); 80614 }); 80615 }, 0); 80616 } 80617 destroyCallback() { 80618 super.destroyCallback(), this._observer?.disconnect(); 80619 } 80620} 80621Q3.template = /* HTML */ 80622` 80623 <canvas class="uc-canvas" ref="canvas-el"></canvas> 80624 <uc-crop-frame ref="frame-el"></uc-crop-frame> 80625`; 80626function fL(e, t, i) { 80627 let s = Array(i); 80628 i--; 80629 for (let n = i; n >= 0; n--) 80630 s[n] = Math.ceil((n * t + (i - n) * e) / i); 80631 return s; 80632} 80633function fye(e) { 80634 return e.reduce( 80635 (t, i, s) => s < e.length - 1 ? [...t, [i, e[s + 1]]] : t, 80636 [] 80637 ); 80638} 80639function mye(e, t, i) { 80640 let s = fye(e).find(([n, o]) => n <= t && t <= o); 80641 return e.map((n) => { 80642 let o = Math.abs(s[0] - s[1]), r = Math.abs(t - s[0]) / o; 80643 return s[0] === n ? t > i ? 1 : 1 - r : s[1] === n ? t >= i ? r : 1 : 0; 80644 }); 80645} 80646function vye(e, t) { 80647 return e.map((i, s) => i < t ? e.length - s : s); 80648} 80649function mL(e, t) { 80650 let i = Pd[e].keypointsNumber, { range: s, zero: n } = Pd[e]; 80651 return [.../* @__PURE__ */ new Set([...fL(s[0], n, i + 1), ...fL(n, s[1], i + 1), n, t])].sort( 80652 (o, r) => o - r 80653 ); 80654} 80655class yye extends Ti { 80656 constructor() { 80657 super(), this._isActive = !1, this._hidden = !0, this._addKeypointDebounced = wo(this._addKeypoint.bind(this), 600), this.classList.add("uc-inactive_to_cropper"); 80658 } 80659 /** 80660 * @private 80661 * @param {String} src 80662 * @returns {() => void} Destructor 80663 */ 80664 _handleImageLoading(t) { 80665 let i = this._operation, s = this.$["*loadingOperations"]; 80666 return s.get(i) || s.set(i, /* @__PURE__ */ new Map()), s.get(i).get(t) || (s.set(i, s.get(i).set(t, !0)), this.$["*loadingOperations"] = s), () => { 80667 s?.get(i)?.has(t) && (s.get(i).delete(t), this.$["*loadingOperations"] = s); 80668 }; 80669 } 80670 /** @private */ 80671 _flush() { 80672 window.cancelAnimationFrame(this._raf), this._raf = window.requestAnimationFrame(() => { 80673 for (let t of this._keypoints) { 80674 let { image: i } = t; 80675 i && (i.style.opacity = t.opacity.toString(), i.style.zIndex = t.zIndex.toString()); 80676 } 80677 }); 80678 } 80679 /** 80680 * @private 80681 * @param {Object} options 80682 * @param {String} [options.url] 80683 * @param {String} [options.filter] 80684 * @param {String} [options.operation] 80685 * @param {Number} [options.value] 80686 * @returns {Promise<String>} 80687 */ 80688 async _imageSrc({ url: t = this._url, filter: i = this._filter, operation: s, value: n } = {}) { 80689 let o = { ...this._transformations }; 80690 s && (o[s] = i ? { name: i, amount: n } : n); 80691 let r = this.offsetWidth; 80692 return await this.proxyUrl(tA(t, r, o)); 80693 } 80694 /** 80695 * @private 80696 * @param {String} operation 80697 * @param {Number} value 80698 * @returns {Promise<Keypoint>} 80699 */ 80700 async _constructKeypoint(t, i) { 80701 return { 80702 src: await this._imageSrc({ operation: t, value: i }), 80703 image: null, 80704 opacity: 0, 80705 zIndex: 0, 80706 value: i 80707 }; 80708 } 80709 /** 80710 * Check if current operation and filter equals passed ones 80711 * 80712 * @private 80713 * @param {String} operation 80714 * @param {String} [filter] 80715 * @returns {Boolean} 80716 */ 80717 _isSame(t, i) { 80718 return this._operation === t && this._filter === i; 80719 } 80720 /** 80721 * @private 80722 * @param {String} operation 80723 * @param {String | null} filter 80724 * @param {Number} value 80725 */ 80726 async _addKeypoint(t, i, s) { 80727 let n = () => !this._isSame(t, i) || this._value !== s || !!this._keypoints.find((l) => l.value === s); 80728 if (n()) 80729 return; 80730 let o = await this._constructKeypoint(t, s), r = new Image(); 80731 r.src = o.src; 80732 let a = this._handleImageLoading(o.src); 80733 r.addEventListener("load", a, { once: !0 }), r.addEventListener("error", a, { once: !0 }), o.image = r, r.classList.add("uc-fader-image"), r.addEventListener( 80734 "load", 80735 () => { 80736 if (n()) 80737 return; 80738 let l = this._keypoints, c = l.findIndex((d) => d.value > s), u = c < l.length ? l[c].image : null; 80739 !this._container || u && !this._container.contains(u) || (l.splice(c, 0, o), this._container.insertBefore(r, u), this._update(t, s)); 80740 }, 80741 { once: !0 } 80742 ), r.addEventListener( 80743 "error", 80744 () => { 80745 this.$["*networkProblems"] = !0; 80746 }, 80747 { once: !0 } 80748 ); 80749 } 80750 /** @param {String | Number} value */ 80751 set(t) { 80752 t = typeof t == "string" ? parseInt(t, 10) : t, this._update(this._operation, t), this._addKeypointDebounced(this._operation, this._filter, t); 80753 } 80754 /** 80755 * @private 80756 * @param {String} operation 80757 * @param {Number} value 80758 */ 80759 _update(t, i) { 80760 this._operation = t, this._value = i; 80761 let { zero: s } = Pd[t], n = this._keypoints.map((a) => a.value), o = mye(n, i, s), r = vye(n, s); 80762 for (let [a, l] of Object.entries(this._keypoints)) 80763 l.opacity = o[a], l.zIndex = r[a]; 80764 this._flush(); 80765 } 80766 /** @private */ 80767 _createPreviewImage() { 80768 let t = new Image(); 80769 return t.classList.add("uc-fader-image", "uc-fader-image--preview"), t.style.opacity = "0", t; 80770 } 80771 /** @private */ 80772 async _initNodes() { 80773 let t = document.createDocumentFragment(); 80774 this._previewImage = this._previewImage || this._createPreviewImage(), !this.contains(this._previewImage) && t.appendChild(this._previewImage); 80775 let i = document.createElement("div"); 80776 t.appendChild(i); 80777 let s = this._keypoints.map((c) => c.src), { images: n, promise: o, cancel: r }
80777 = wS(s); 80778 n.forEach((c) => { 80779 let u = this._handleImageLoading(c.src); 80780 c.addEventListener("load", u), c.addEventListener("error", u); 80781 }), this._cancelLastImages = () => { 80782 r(), this._cancelLastImages = void 0; 80783 }; 80784 let a = this._operation, l = this._filter; 80785 await o, this._isActive && this._isSame(a, l) && (this._container && this._container.remove(), this._container = i, this._keypoints.forEach((c, u) => { 80786 let d = n[u]; 80787 d.classList.add("uc-fader-image"), c.image = d, this._container.appendChild(d); 80788 }), this.appendChild(t), this._flush()); 80789 } 80790 /** @param {import('./types.js').Transformations} transformations */ 80791 async setTransformations(t) { 80792 if (this._transformations = t, this._previewImage) { 80793 let i = await this._imageSrc(), s = this._handleImageLoading(i); 80794 this._previewImage.src = i, this._previewImage.addEventListener("load", s, { once: !0 }), this._previewImage.addEventListener("error", s, { once: !0 }), this._previewImage.style.opacity = "1", this._previewImage.addEventListener( 80795 "error", 80796 () => { 80797 this.$["*networkProblems"] = !0; 80798 }, 80799 { once: !0 } 80800 ); 80801 } 80802 } 80803 /** 80804 * @param {object} options 80805 * @param {String} options.url 80806 * @param {String} options.operation 80807 * @param {Number} options.value 80808 * @param {String} [options.filter] 80809 */ 80810 async preload({ url: t, filter: i, operation: s, value: n }) { 80811 this._cancelBatchPreload && this._cancelBatchPreload(); 80812 let o = mL(s, n), r = await Promise.all(o.map((l) => this._imageSrc({ url: t, filter: i, operation: s, value: l }))), { cancel: a } = wS(r); 80813 this._cancelBatchPreload = a; 80814 } 80815 /** @private */ 80816 _setOriginalSrc(t) { 80817 let i = this._previewImage || this._createPreviewImage(); 80818 if (!this.contains(i) && this.appendChild(i), this._previewImage = i, i.src === t) { 80819 i.style.opacity = "1", i.style.transform = "scale(1)", this.className = jo({ 80820 "uc-active_from_viewer": this._fromViewer, 80821 "uc-active_from_cropper": !this._fromViewer, 80822 "uc-inactive_to_cropper": !1 80823 }); 80824 return; 80825 } 80826 i.style.opacity = "0"; 80827 let s = this._handleImageLoading(t); 80828 i.addEventListener("error", s, { once: !0 }), i.src = t, i.addEventListener( 80829 "load", 80830 () => { 80831 s(), i && (i.style.opacity = "1", i.style.transform = "scale(1)", this.className = jo({ 80832 "uc-active_from_viewer": this._fromViewer, 80833 "uc-active_from_cropper": !this._fromViewer, 80834 "uc-inactive_to_cropper": !1 80835 })); 80836 }, 80837 { once: !0 } 80838 ), i.addEventListener( 80839 "error", 80840 () => { 80841 this.$["*networkProblems"] = !0; 80842 }, 80843 { once: !0 } 80844 ); 80845 } 80846 /** 80847 * @param {object} options 80848 * @param {String} options.url 80849 * @param {String} [options.operation] 80850 * @param {Number} [options.value] 80851 * @param {String} [options.filter] 80852 * @param {Boolean} [options.fromViewer] 80853 */ 80854 async activate({ url: t, operation: i, value: s, filter: n, fromViewer: o }) { 80855 if (this._isActive = !0, this._hidden = !1, this._url = t, this._operation = i || "initial", this._value = s, this._filter = n, this._fromViewer = o, typeof s != "number" && !n) { 80856 let a = await this._imageSrc({ operation: i, value: s }); 80857 this._setOriginalSrc(a), this._container && this._container.remove(); 80858 return; 80859 } 80860 this._keypoints = await Promise.all( 80861 mL(i, s).map((a) => this._constructKeypoint(i, a)) 80862 ), this._update(i, s), this._initNodes(); 80863 } 80864 /** @param {{ hide?: Boolean }} options */ 80865 deactivate({ hide: t = !0 } = {}) { 80866 this._isActive = !1, this._cancelLastImages && this._cancelLastImages(), this._cancelBatchPreload && this._cancelBatchPreload(), t && !this._hidden ? (this._hidden = !0, this._previewImage && (this._previewImage.style.transform = "scale(1)"), this.className = jo({ 80867 "uc-active_from_viewer": !1, 80868 "uc-active_from_cropper": !1, 80869 "uc-inactive_to_cropper": !0 80870 }), this.addEventListener( 80871 "transitionend", 80872 () => { 80873 this._container && this._container.remove(); 80874 }, 80875 { once: !0 } 80876 )) : this._container && this._container.remove(); 80877 } 80878} 80879const Cye = 1; 80880class X3 extends Ti { 80881 initCallback() { 80882 super.initCallback(), this.addEventListener( 80883 "wheel", 80884 (t) => { 80885 t.preventDefault(); 80886 let { deltaY: i, deltaX: s } = t; 80887 Math.abs(s) > Cye ? this.scrollLeft += s : this.scrollLeft += i; 80888 }, 80889 { 80890 passive: !1 80891 } 80892 ), this.addEventListener("scroll", () => { 80893 }, {
80894 passive: !0 80895 }); 80896 } 80897} 80898X3.template = /* HTML */ 80899" <slot></slot> "; 80900function bye(e) { 80901 return ( 80902 /* HTML */ 80903 ` 80904 <uc-presence-toggle 80905 class="uc-tab-toggle" 80906 set="visible: presence.tabToggle.${e}; styles: presence.tabToggleStyles;" 80907 > 80908 <uc-btn-ui 80909 theme="tab" 80910 ref="tab-toggle-${e}" 80911 data-id="${e}" 80912 icon="${e}" 80913 set="onclick: on.clickTab; aria-role:tab_role; aria-controls:tab_${e}; title-prop: a11y-editor-tab-${e}" 80914 > 80915 </uc-btn-ui> 80916 </uc-presence-toggle> 80917 ` 80918 ); 80919} 80920function wye(e) { 80921 return ( 80922 /* HTML */ 80923 ` 80924 <uc-presence-toggle 80925 id="tab_${e}" 80926 class="uc-tab-content" 80927 set="visible: presence.tabContent.${e}; styles: presence.tabContentStyles" 80928 > 80929 <uc-editor-scroller hidden-scrollbar> 80930 <div class="uc-controls-list_align"> 80931 <div 80932 role="listbox" 80933 aria-orientation="horizontal" 80934 class="uc-controls-list_inner" 80935 ref="controls-list-${e}" 80936 ></div> 80937 </div> 80938 </uc-editor-scroller> 80939 </uc-presence-toggle> 80940 ` 80941 ); 80942} 80943class J3 extends Ti { 80944 constructor() { 80945 super(), this.init$ = { 80946 ...this.init$, 80947 "*sliderEl": null, 80948 /** @type {import('./types.js').LoadingOperations} */ 80949 "*loadingOperations": /* @__PURE__ */ new Map(), 80950 "*showSlider": !1, 80951 "*currentFilter": Cl, 80952 "*currentOperation": null, 80953 showLoader: !1, 80954 filters: Ige, 80955 colorOperations: Ege, 80956 cropOperations: Rge, 80957 "*operationTooltip": null, 80958 "presence.mainToolbar": !0, 80959 "presence.subToolbar": !1, 80960 "presence.tabToggles": !0, 80961 "presence.tabContent.crop": !1, 80962 "presence.tabContent.tuning": !1, 80963 "presence.tabContent.filters": !1, 80964 "presence.tabToggle.crop": !0, 80965 "presence.tabToggle.tuning": !0, 80966 "presence.tabToggle.filters": !0, 80967 "presence.subTopToolbarStyles": { 80968 hidden: "uc-sub-toolbar--top-hidden", 80969 visible: "uc-sub-toolbar--visible" 80970 }, 80971 "presence.subBottomToolbarStyles": { 80972 hidden: "uc-sub-toolbar--bottom-hidden", 80973 visible: "uc-sub-toolbar--visible" 80974 }, 80975 "presence.tabContentStyles": { 80976 hidden: "uc-tab-content--hidden", 80977 visible: "uc-tab-content--visible" 80978 }, 80979 "presence.tabToggleStyles": { 80980 hidden: "uc-tab-toggle--hidden", 80981 visible: "uc-tab-toggle--visible" 80982 }, 80983 "presence.tabTogglesStyles": { 80984 hidden: "uc-tab-toggles--hidden", 80985 visible: "uc-tab-toggles--visible" 80986 }, 80987 "on.cancel": () => { 80988 this._cancelPreload?.(), this.$["*on.cancel"](); 80989 }, 80990 "on.apply": () => { 80991 this.$["*on.apply"](this.$["*editorTransformations"]); 80992 }, 80993 "on.applySlider": () => { 80994 this.ref["slider-el"].apply(), this._onSliderClose(); 80995 }, 80996 "on.cancelSlider": () => { 80997 this.ref["slider-el"].cancel(), this._onSliderClose(); 80998 }, 80999 /** @param {MouseEvent} e */ 81000 "on.clickTab": (t) => { 81001 const i = ( 81002 /** @type {HTMLElement} */ 81003 t.currentTarget.getAttribute("data-id") 81004 ); 81005 i && this._activateTab(i, { fromViewer: !1 }); 81006 }, 81007 tab_role: "tab", 81008 [`tab_${Oi.TUNING}`]: `tab_${Oi.TUNING}`, 81009 [`tab_${Oi.CROP}`]: `tab_${Oi.CROP}`, 81010 [`tab_${Oi.FILTERS}`]: `tab_${Oi.FILTERS}`, 81011 cancel: "cancel", 81012 apply: "apply", 81013 "a11y-editor-tab-filters": "a11y-editor-tab-filters", 81014 "a11y-editor-tab-tuning": "a11y-editor-tab-tuning", 81015 "a11y-editor-tab-crop": "a11y-editor-tab-crop" 81016 }, this._debouncedShowLoader = wo(this._showLoader.bind(this), 500); 81017 } 81018 /** @private */ 81019 _onSliderClose() { 81020 this.$["*showSlider"] = !1, this.$["*tabId"] === Oi.TUNING && this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible", !1); 81021 } 81022 /** 81023 * @private 81024 * @param {String} operation 81025 */ 81026 _createOperationControl(t) { 81027 let i = new q3(); 81028 return i.operation = t, i; 81029 } 81030 /** 81031 * @private 81032 * @param {String} filter 81033 */ 81034 _createFilterControl(t) { 81035 let i = new eA(); 81036 return i.filter = t, i; 81037 } 81038 /** 81039 * @private 81040 * @param {String} operation 81041 */ 81042 _createToggleControl(t) { 81043 let i = new K3(); 81044 return i.operation = t, i; 81045 } 81046 /** 81047 * @private 81048 * @param {String} tabId 81049 */ 81050 _renderControlsList(t) { 81051 let i = this.ref[`controls-list-${t}`], s = document.createDocumentFragment(); 81052 t === Oi.CROP ? this.$.cropOperations.forEach( 81053 /** @param {string} operation */ 81054 (n) => { 81055 let o = this._createToggleControl(n); 81056 s.appendChild(o); 81057 }
81058 ) : t === Oi.FILTERS ? [Cl, ...this.$.filters].forEach((n) => { 81059 let o = this._createFilterControl(n); 81060 s.appendChild(o); 81061 }) : t === Oi.TUNING && this.$.colorOperations.forEach( 81062 /** @param {string} operation */ 81063 (n) => { 81064 let o = this._createOperationControl(n); 81065 s.appendChild(o); 81066 } 81067 ), [...s.children].forEach((n, o) => { 81068 o === s.childNodes.length - 1 && n.classList.add("uc-controls-list_last-item"); 81069 }), i.innerHTML = "", i.appendChild(s); 81070 } 81071 /** 81072 * @private 81073 * @param {String} id 81074 * @param {{ fromViewer?: Boolean }} options 81075 */ 81076 _activateTab(t, { fromViewer: i }) { 81077 this.$["*tabId"] = t, t === Oi.CROP ? (this.$["*faderEl"].deactivate(), this.$["*cropperEl"].activate(this.$["*imageSize"], { fromViewer: i })) : (this.$["*faderEl"].activate({ url: this.$["*originalUrl"], fromViewer: i }), this.$["*cropperEl"].deactivate()); 81078 for (let s of Cr) { 81079 let n = s === t, o = this.ref[`tab-toggle-${s}`]; 81080 o.active = n, n ? (this._renderControlsList(t), this._syncTabIndicator()) : this._unmountTabControls(s), this.$[`presence.tabContent.${s}`] = n; 81081 } 81082 } 81083 /** 81084 * @private 81085 * @param {String} tabId 81086 */ 81087 _unmountTabControls(t) { 81088 let i = this.ref[`controls-list-${t}`]; 81089 i && (i.innerHTML = ""); 81090 } 81091 /** @private */ 81092 _syncTabIndicator() { 81093 let t = this.ref[`tab-toggle-${this.$["*tabId"]}`], i = this.ref["tabs-indicator"]; 81094 i.style.transform = `translateX(${t.offsetLeft}px)`; 81095 } 81096 /** @private */ 81097 async _preloadEditedImage() { 81098 if (this.$["*imgContainerEl"] && this.$["*originalUrl"]) { 81099 let t = this.$["*imgContainerEl"].offsetWidth, i = await this.proxyUrl(tA(this.$["*originalUrl"], t, this.$["*editorTransformations"])); 81100 this._cancelPreload?.(); 81101 let { cancel: s } = wS([i]); 81102 this._cancelPreload = () => { 81103 s(), this._cancelPreload = void 0; 81104 }; 81105 } 81106 } 81107 /** 81108 * @private 81109 * @param {boolean} show 81110 */ 81111 _showLoader(t) { 81112 this.$.showLoader = t; 81113 } 81114 _updateInfoTooltip = wo(() => { 81115 const t = this.$["*editorTransformations"], i = this.$["*currentOperation"]; 81116 let s = "", n = !1; 81117 if (this.$["*tabId"] === Oi.FILTERS) 81118 if (n = !0, this.$["*currentFilter"] && t?.filter?.name === this.$["*currentFilter"]) { 81119 let o = t?.filter?.amount || 100; 81120 s = this.$["*currentFilter"] + " " + o; 81121 } else 81122 s = this.l10n(Cl); 81123 else if (this.$["*tabId"] === Oi.TUNING && i) { 81124 n = !0; 81125 let o = t?.[i] || Pd[i].zero; 81126 s = this.l10n(i) + " " + o; 81127 } 81128 n && (this.$["*operationTooltip"] = s), this.ref["tooltip-el"].classList.toggle("uc-info-tooltip_visible", n); 81129 }, 0); 81130 initCallback() { 81131 super.initCallback(), this.$["*sliderEl"] = this.ref["slider-el"], this.sub("*imageSize", (t) => { 81132 t && setTimeout(() => { 81133 this._activateTab(this.$["*tabId"], { fromViewer: !0 }); 81134 }, 0); 81135 }), this.sub("*editorTransformations", (t) => { 81136 let i = t?.filter?.name; 81137 this.$["*currentFilter"] !== i && (this.$["*currentFilter"] = i); 81138 }), this.sub("*currentFilter", () => { 81139 this._updateInfoTooltip(); 81140 }), this.sub("*currentOperation", () => { 81141 this._updateInfoTooltip(); 81142 }), this.sub("*tabId", () => { 81143 this._updateInfoTooltip(); 81144 }), this.sub("*originalUrl", () => { 81145 this.$["*faderEl"] && this.$["*faderEl"].deactivate(); 81146 }), this.sub("*editorTransformations", (t) => { 81147 this._preloadEditedImage(), this.$["*faderEl"] && this.$["*faderEl"].setTransformations(t); 81148 }), this.sub("*loadingOperations", (t) => { 81149 let i = !1; 81150 for (let [, s] of t.entries()) { 81151 if (i) 81152 break; 81153 for (let [, n] of s.entries()) 81154 if (n) { 81155 i = !0; 81156 break; 81157 } 81158 } 81159 this._debouncedShowLoader(i); 81160 }), this.sub("*showSlider", (t) => { 81161 this.$["presence.subToolbar"] = t, this.$["presence.mainToolbar"] = !t; 81162 }), this.sub("*tabList", (t) => { 81163 this.$["presence.tabToggles"] = t.length > 1; 81164 for (const i of Cr) { 81165 this.$[`presence.tabToggle.${i}`] = t.includes(i); 81166 const s = this.ref[`tab-toggle-${i}`]; 81167 s.style.gridColumn = t.indexOf(i) + 1; 81168 } 81169 t.includes(this.$["*tabId"]) || this._activateTab(t[0], { fromViewer: !1 }); 81170 }), this._updateInfoTooltip(); 81171 } 81172} 81173J3.template = /* HTML */ 81174` 81175 <uc-line-loader-ui set="active: showLoader"></uc-line-loader-ui> 81176 <div class="uc-info-tooltip_container"> 81177 <div class="uc-info-tooltip_wrapper"> 81178 <div ref="tooltip-el" class="uc-info-tooltip uc-info-tooltip_hidden">{{*operationTooltip}}</div> 81179 </div> 81180 </div> 81181 <div class="uc-toolbar-container"> 81182 <uc-presence-toggle 81183 role="tablist" 81184 class="uc-sub-toolbar"
81185 set="visible: presence.mainToolbar; styles: presence.subTopToolbarStyles" 81186 > 81187 <div class="uc-tab-content-row">${Cr.map(wye).join("")}</div> 81188 <div class="uc-controls-row"> 81189 <uc-presence-toggle 81190 class="uc-tab-toggles" 81191 set="visible: presence.tabToggles; styles: presence.tabTogglesStyles" 81192 > 81193 <div ref="tabs-indicator" class="uc-tab-toggles_indicator"></div> 81194 ${Cr.map(bye).join("")} 81195 </uc-presence-toggle> 81196 <uc-btn-ui style="order: -1" theme="secondary-icon" icon="closeMax" set="onclick: on.cancel; title-prop:cancel"> 81197 </uc-btn-ui> 81198 <uc-btn-ui theme="primary-icon" icon="done" set="onclick: on.apply; title-prop:apply"> </uc-btn-ui> 81199 </div> 81200 </uc-presence-toggle> 81201 <uc-presence-toggle 81202 class="uc-sub-toolbar" 81203 set="visible: presence.subToolbar; styles: presence.subBottomToolbarStyles" 81204 > 81205 <div class="uc-slider"> 81206 <uc-editor-slider ref="slider-el"></uc-editor-slider> 81207 </div> 81208 <div class="uc-controls-row"> 81209 <uc-btn-ui theme="secondary" set="onclick: on.cancelSlider" l10n="@text:cancel"> </uc-btn-ui> 81210 <uc-btn-ui theme="primary" set="onclick: on.applySlider" l10n="@text:apply"> </uc-btn-ui> 81211 </div> 81212 </uc-presence-toggle> 81213 </div> 81214`; 81215class iA extends Ti { 81216 constructor() { 81217 super(), this._iconReversed = !1, this._iconSingle = !1, this._iconHidden = !1, this.init$ = { 81218 ...this.init$, 81219 text: "", 81220 icon: "", 81221 iconCss: this._iconCss(), 81222 theme: null, 81223 "aria-role": "", 81224 "aria-controls": "", 81225 "title-prop": "" 81226 }, this.defineAccessor("active", (t) => { 81227 t ? this.setAttribute("active", "") : this.removeAttribute("active"); 81228 }); 81229 } 81230 _iconCss() { 81231 return jo("uc-icon", { 81232 "uc-icon_left": !this._iconReversed, 81233 "uc-icon_right": this._iconReversed, 81234 "uc-icon_hidden": this._iconHidden, 81235 "uc-icon_single": this._iconSingle 81236 }); 81237 } 81238 initCallback() { 81239 super.initCallback(), this.sub("icon", (t) => { 81240 this._iconSingle = !this.$.text, this._iconHidden = !t, this.$.iconCss = this._iconCss(); 81241 }), this.sub("theme", (t) => { 81242 t !== "custom" && (this.className = `uc-${t}`); 81243 }), this.sub("text", (t) => { 81244 this._iconSingle = !1; 81245 }), this.hasAttribute("theme") || this.setAttribute("theme", "default"), this.defineAccessor("aria-role", (t) => { 81246 this.$["aria-role"] = t || ""; 81247 }), this.defineAccessor("aria-controls", (t) => { 81248 this.$["aria-controls"] = t || ""; 81249 }), this.defineAccessor("title-prop", (t) => { 81250 this.$["title-prop"] = t || ""; 81251 }); 81252 } 81253 set reverse(t) { 81254 this.hasAttribute("reverse") ? (this.style.flexDirection = "row-reverse", this._iconReversed = !0) : (this._iconReversed = !1, this.style.flexDirection = null); 81255 } 81256} 81257iA.bindAttributes({ text: "text", icon: "icon", reverse: "reverse", theme: "theme" }); 81258iA.template = /* HTML */ 81259` 81260 <button type="button" set="@role:aria-role; @aria-controls: aria-controls;" l10n="@title:title-prop"> 81261 <uc-icon set="className: iconCss; @name: icon; @hidden: !icon"></uc-icon> 81262 <div class="uc-text">{{text}}</div> 81263 </button> 81264`; 81265class e4 extends Ti { 81266 constructor() { 81267 super(), this._active = !1, this._handleTransitionEndRight = () => { 81268 let t = this.ref["line-el"]; 81269 t.style.transition = "initial", t.style.opacity = "0", t.style.transform = "translateX(-101%)", this._active && this._start(); 81270 }; 81271 } 81272 initCallback() { 81273 super.initCallback(), this.defineAccessor("active", (t) => { 81274 typeof t == "boolean" && (t ? this._start() : this._stop()); 81275 }); 81276 } 81277 _start() { 81278 this._active = !0; 81279 let { width: t } = this.getBoundingClientRect(), i = this.ref["line-el"]; 81280 i.style.transition = "transform 1s", i.style.opacity = "1", i.style.transform = `translateX(${t}px)`, i.addEventListener("transitionend", this._handleTransitionEndRight, { 81281 once: !0 81282 }); 81283 } 81284 _stop() { 81285 this._active = !1; 81286 } 81287} 81288e4.template = /* HTML */ 81289` 81290 <div class="uc-inner"> 81291 <div class="uc-line" ref="line-el"></div> 81292 </div> 81293`; 81294const nm = { 81295 transition: "uc-transition", 81296 visible: "uc-visible", 81297 hidden: "uc-hidden" 81298}; 81299class t4 extends Ti { 81300 constructor() { 81301 super(), this._visible = !1, this._visibleStyle = nm.visible, this._hiddenStyle = nm.hidden, this._externalTransitions = !1, this.defineAccessor("styles", (t) => { 81302 t && (this._externalTransitions = !0, this._visibleStyle = t.visible, this._hiddenStyle = t.hidden); 81303 }), this.defineAccessor("visible", (t) => { 81304 typeof t == "boolean" && (this._visible = t, this._handleVisible()); 81305 }); 81306 } 81307 _handleVisible() { 81308 this.style.visibility = this._visible ? "inherit" : "hidden", rye(this, { 81309 [nm.transition]: !this._externalTransitions, 81310 [this._visibleStyle]: this._visible, 81311 [this._hiddenStyle]: !this._visible 81312 }), this.setAttribute("aria-hidden", this._visible ? "false" : "true"); 81313 } 81314 initCallback() { 81315 super.initCallback(), this.classList.toggle("uc-initial", !0), this._externalTransitions || this.classList.add(nm.transition), this._handleVisible(), setTimeout(() => { 81316 this.classList.toggle("uc-initial", !1); 81317 }, 0); 81318 } 81319} 81320t4.template = /* HTML */ 81321"<slot></slot> "; 81322class i4 extends Ti { 81323 init$ = { 81324 ...this.init$, 81325 disabled: !1, 81326 min: 0, 81327 max: 100, 81328 onInput: null, 81329 onChange: null, 81330 defaultValue: null, 81331 "on.sliderInput": () => { 81332 let t = parseInt(this.ref["input-el"].value, 10);
81333 this._updateValue(t), this.$.onInput && this.$.onInput(t); 81334 }, 81335 "on.sliderChange": () => { 81336 let t = parseInt(this.ref["input-el"].value, 10); 81337 this.$.onChange && this.$.onChange(t); 81338 } 81339 }; 81340 constructor() { 81341 super(), this.setAttribute("with-effects", ""); 81342 } 81343 initCallback() { 81344 super.initCallback(), this.defineAccessor("disabled", (i) => { 81345 this.$.disabled = i; 81346 }), this.defineAccessor("min", (i) => { 81347 this.$.min = i; 81348 }), this.defineAccessor("max", (i) => { 81349 this.$.max = i; 81350 }), this.defineAccessor("defaultValue", (i) => { 81351 this.$.defaultValue = i, this.ref["input-el"].value = i, this._updateValue(i); 81352 }), this.defineAccessor("zero", (i) => { 81353 this._zero = i; 81354 }), this.defineAccessor("onInput", (i) => { 81355 i && (this.$.onInput = i); 81356 }), this.defineAccessor("onChange", (i) => { 81357 i && (this.$.onChange = i); 81358 }), this._updateSteps(), this._observer = new ResizeObserver(() => { 81359 this._updateSteps(); 81360 let i = parseInt(this.ref["input-el"].value, 10); 81361 this._updateValue(i); 81362 }), this._observer.observe(this), this._thumbSize = parseInt(window.getComputedStyle(this).getPropertyValue("--l-thumb-size"), 10), setTimeout(() => { 81363 let i = parseInt(this.ref["input-el"].value, 10); 81364 this._updateValue(i); 81365 }, 0), this.sub("disabled", (i) => { 81366 let s = this.ref["input-el"]; 81367 i ? s.setAttribute("disabled", "disabled") : s.removeAttribute("disabled"); 81368 }); 81369 let t = this.ref["input-el"]; 81370 t.addEventListener("focus", () => { 81371 this.style.setProperty("--color-effect", "var(--hover-color-rgb)"); 81372 }), t.addEventListener("blur", () => { 81373 this.style.setProperty("--color-effect", "var(--idle-color-rgb)"); 81374 }); 81375 } 81376 _updateValue(t) { 81377 this._updateZeroDot(t); 81378 let { width: i } = this.getBoundingClientRect(), o = 100 / (this.$.max - this.$.min) * (t - this.$.min) * (i - this._thumbSize) / 100; 81379 window.requestAnimationFrame(() => { 81380 this.ref["thumb-el"].style.transform = `translateX(${o}px)`; 81381 }); 81382 } 81383 _updateZeroDot(t) { 81384 if (!this._zeroDotEl) 81385 return; 81386 t === this._zero ? this._zeroDotEl.style.opacity = "0" : this._zeroDotEl.style.opacity = "1"; 81387 let { width: i } = this.getBoundingClientRect(), o = 100 / (this.$.max - this.$.min) * (this._zero - this.$.min) * (i - this._thumbSize) / 100; 81388 window.requestAnimationFrame(() => { 81389 this._zeroDotEl.style.transform = `translateX(${o}px)`; 81390 }); 81391 } 81392 _updateSteps() { 81393 let i = this.ref["steps-el"], { width: s } = i.getBoundingClientRect(), n = Math.ceil(s / 2), o = Math.ceil(n / 15) - 2; 81394 if (this._stepsCount === o) 81395 return; 81396 let r = document.createDocumentFragment(), a = document.createElement("div"), l = document.createElement("div"); 81397 a.className = "uc-minor-step", l.className = "uc-border-step", r.appendChild(l); 81398 for (let u = 0; u < o; u++) 81399 r.appendChild(a.cloneNode()); 81400 r.appendChild(l.cloneNode()); 81401 for (let u = 0; u < o; u++) 81402 r.appendChild(a.cloneNode()); 81403 r.appendChild(l.cloneNode()); 81404 let c = document.createElement("div"); 81405 c.className = "uc-zero-dot", r.appendChild(c), this._zeroDotEl = c, i.innerHTML = "", i.appendChild(r), this._stepsCount = o; 81406 } 81407 destroyCallback() { 81408 super.destroyCallback(), this._observer?.disconnect(); 81409 } 81410} 81411i4.template = /* HTML */ 81412` 81413 <div class="uc-steps" ref="steps-el"></div> 81414 <div ref="thumb-el" class="uc-thumb"></div> 81415 <input 81416 class="uc-input" 81417 type="range" 81418 ref="input-el" 81419 set="oninput: on.sliderInput; onchange: on.sliderChange; @min: min; @max: max; @value: defaultValue;" 81420 /> 81421`; 81422class Sye extends fs { 81423 couldBeCtxOwner = !0; 81424 activityType = gt.activities.CLOUD_IMG_EDIT; 81425 /** 81426 * @private 81427 * @type {import('../../abstract/TypedData.js').TypedData | undefined} 81428 */ 81429 _entry; 81430 /** 81431 * @private 81432 * @type {CloudImageEditorBlock | undefined} 81433 */ 81434 _instance; 81435 /** @type {ActivityParams} */ 81436 get activityParams() { 81437 const t = super.activityParams; 81438 if ("internalId" in t) 81439 return t; 81440 throw new Error("Cloud Image Editor activity params not found"); 81441 } 81442 initCallback() { 81443 super.initCallback(), this.registerActivity(this.activityType, { 81444 onActivate: () => this.mountEditor(), 81445 onDeactivate: () => this.unmountEditor() 81446 }), this.subConfigValue("cropPreset", (t) => { 81447 this._instance && this._instance.getAttribute("crop-preset") !== t && this._instance.setAttribute("crop-preset", t); 81448 }), this.subConfigValue("cloudImageEditorTabs", (t) => { 81449 this._instance && this._instance.getAttribute("tabs") !== t && this._instance.setAttribute("tabs", t); 81450 }); 81451 } 81452 /** @param {CustomEvent<import('../CloudImageEditor/src/types.js').ApplyResult>} e */ 81453 handleApply(t) { 81454 if (!this._entry) 81455 return; 81456 let i = t.detail; 81457 this._entry.setMultipleValues({ 81458 cdnUrl: i.cdnUrl, 81459 cdnUrlModifiers: i.cdnUrlModifiers 81460 }), this.historyBack(); 81461 } 81462 handleCancel() { 81463 this.historyBack(); 81464 } 81465 mountEditor() { 81466 const { internalId: t } = this.activityParams; 81467 if (this._entry = this.uploadCollection.read(t), !this._entry) 81468 throw new Error(`Entry with internalId "${t}" not found`); 81469 const i = this._entry.getValue("cdnUrl"); 81470 if (!i) 81471 throw new Error(`Entry with internalId "${t}" hasn't uploaded yet`); 81472 const s = new Pg(), n = this.cfg.cropPreset, o = this.cfg.cloudImageEditorTabs; 81473 s.setAttribute("ctx-name", this.ctxName), s.setAttribute("cdn-url", i), n && s.setAttribute("crop-preset", n), o && s.setAttribute("tabs", o), s.addEventListener("apply", (r) => { 81474 const a = ( 81475 /** @type {CustomEvent<import('../CloudImageEditor/src/types.js').ApplyResult>} */ 81476 r 81477 ); 81478 this.handleApply(a), this.debugPrint('editor event "apply"', a.detail); 81479 }), s.addEventListener("cancel", (r) => { 81480 const a = ( 81481 /** @type {CustomEvent<void>} */ 81482 r 81483 ); 81484 this.handleCancel(), this.debugPrint('editor event "cancel"', a.detail); 81485 }), s.addEventListener("change", (r) => { 81486 const a = ( 81487 /** @type {CustomEvent<import('../CloudImageEditor/src/types.js').ChangeResult>} */ 81488 r 81489 ); 81490 this.debugPrint('editor event "change"', a.detail); 81491 }), this.innerHTML = "", this.appendChild(s), this._instance = s; 81492 } 81493 unmountEditor() { 81494 this._instance = void 0, this._entry = void 0, this.innerHTML = ""; 81495 } 81496} 81497const xye = function(e) { 81498 return e.replace(/[\\-\\[]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 81499}, Mye = function(e, t = "i") { 81500 const i = e.split("*").map(xye); 81501 return new RegExp("^" + i.join(".+") + "$", t); 81502}; 81503function Aye(e, t) { 81504 return window.getComputedStyle(e).getPropertyValue(t).trim(); 81505} 81506const Dye = ( 81507 /** @type {(keyof import('./types.js').ThemeDefinition)[]} */ 81508 [ 81509 "--uc-font-family", 81510 "--uc-font-size", 81511 "--uc-line-height", 81512 "--uc-button-size", 81513 "--uc-preview-size", 81514 "--uc-input-size", 81515 "--uc-padding", 81516 "--uc-radius", 81517 "--uc-transition", 81518 "--uc-background", 81519 "--uc-foreground", 81520 "--uc-primary", 81521 "--uc-primary-hover", 81522 "--uc-primary-transparent", 81523 "--uc-primary-foreground", 81524 "--uc-secondary", 81525 "--uc-secondary-hover", 81526 "--uc-secondary-foreground", 81527 "--uc-muted", 81528 "--uc-muted-foreground", 81529 "--uc-destructive", 81530 "--uc-destructive-foreground", 81531 "--uc-border" 81532 ] 81533); 81534function Eye(e) { 81535 return Dye.reduce( 81536 (t, i) => { 81537 const s = Aye(e, i); 81538 return s && (t[i] = s), t; 81539 },
81540 /** @type {Record<keyof import('./types.js').ThemeDefinition, string>} */ 81541 {} 81542 ); 81543} 81544const Iye = ["selected-files-change"], Rye = (e) => !e || typeof e != "object" ? !1 : "type" in e && Iye.includes( 81545 /** @type {import('./types').InputMessageType} */ 81546 e.type 81547); 81548class Tye { 81549 /** @type {Map<string, Set<import('./types').InputMessageHandler<import('./types').InputMessageType>>>} */ 81550 _handlerMap = /* @__PURE__ */ new Map(); 81551 /** @type {Window} */ 81552 _context; 81553 /** @param {Window} context */ 81554 constructor(t) { 81555 this._context = t, window.addEventListener("message", this._handleMessage); 81556 } 81557 /** @param {MessageEvent} e */ 81558 _handleMessage = (t) => { 81559 if (t.source !== this._context) 81560 return; 81561 const i = t.data; 81562 if (!Rye(i)) 81563 return; 81564 const s = this._handlerMap.get(i.type); 81565 if (s) 81566 for (const n of s) 81567 n(i); 81568 }; 81569 /** 81570 * @template {import('./types').InputMessageType} T 81571 * @param {T} type 81572 * @param {import('./types').InputMessageHandler<T>} handler 81573 */ 81574 on(t, i) { 81575 const s = this._handlerMap.get(t) ?? /* @__PURE__ */ new Set(); 81576 this._handlerMap.has(t) || this._handlerMap.set(t, s), s.add( 81577 /** @type {import('./types').InputMessageHandler<import('./types').InputMessageType>} */ 81578 i 81579 ); 81580 } 81581 /** @param {import('./types').OutputMessage} message */ 81582 send(t) { 81583 this._context.postMessage(t, "*"); 81584 } 81585 destroy() { 81586 window.removeEventListener("message", this._handleMessage); 81587 } 81588} 81589function Lye(e) { 81590 let t = []; 81591 for (let [i, s] of Object.entries(e)) 81592 s == null || typeof s == "string" && s.length === 0 || t.push(`${i}=${encodeURIComponent(s)}`); 81593 return t.join("&"); 81594} 81595class s4 extends fs { 81596 couldBeCtxOwner = !0; 81597 activityType = gt.activities.EXTERNAL; 81598 constructor() { 81599 super(), this.init$ = { 81600 ...this.init$, 81601 activityIcon: "", 81602 activityCaption: "", 81603 /** @type {import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']} */ 81604 selectedList: [], 81605 total: 0, 81606 isSelectionReady: !1, 81607 isDoneBtnEnabled: !1, 81608 couldSelectAll: !1, 81609 couldDeselectAll: !1, 81610 showSelectionStatus: !1, 81611 counterText: "", 81612 doneBtnTextClass: "uc-hidden", 81613 onDone: () => { 81614 for (const t of this.$.selectedList) { 81615 const i = this.extractUrlFromSelectedFile(t), { filename: s } = t, { externalSourceType: n } = this.activityParams; 81616 this.api.addFileFromUrl(i, { fileName: s, source: n }); 81617 } 81618 this.$["*currentActivity"] = gt.activities.UPLOAD_LIST; 81619 }, 81620 onCancel: () => { 81621 this.historyBack(); 81622 }, 81623 onSelectAll: () => { 81624 this._messageBridge?.send({ type: "select-all" }); 81625 }, 81626 onDeselectAll: () => { 81627 this._messageBridge?.send({ type: "deselect-all" }); 81628 } 81629 }; 81630 } 81631 /** @type {ActivityParams} */ 81632 get activityParams() { 81633 const t = super.activityParams; 81634 if ("externalSourceType" in t) 81635 return t; 81636 throw new Error("External Source activity params not found"); 81637 } 81638 initCallback() { 81639 super.initCallback(), this.registerActivity(this.activityType, { 81640 onActivate: () => { 81641 let { externalSourceType: t } = ( 81642 /** @type {ActivityParams} */ 81643 this.activityParams 81644 ); 81645 if (!t) { 81646 this.$["*currentActivity"] = null, this.setOrAddState("*modalActive", !1), console.error(`Param "externalSourceType" is required for activity "${this.activityType}"`); 81647 return; 81648 } 81649 this.set$({ 81650 activityCaption: `${t?.[0].toUpperCase()}${t?.slice(1)}`, 81651 activityIcon: t 81652 }), this.mountIframe(); 81653 } 81654 }), this.sub("*currentActivityParams", (t) => { 81655 this.isActivityActive && (this.unmountIframe(), this.mountIframe()); 81656 }), this.sub("*currentActivity", (t) => { 81657 t !== this.activityType && this.unmountIframe(); 81658 }), this.subConfigValue("multiple", (t) => { 81659 this.$.showSelectionStatus = t; 81660 }), this.subConfigValue("localeName", (t) => { 81661 this.setupL10n(); 81662 }), this.subConfigValue("externalSourcesEmbedCss", (t) => { 81663 this.applyEmbedCss(t); 81664 }); 81665 } 81666 /** 81667 * @private 81668 * @param {NonNullable<import('./types.js').InputMessageMap['selected-files-change']['selectedFiles']>[number]} selectedFile 81669 */ 81670 extractUrlFromSelectedFile(t) { 81671 if (t.alternatives) { 81672 const i = El(this.cfg.externalSourcesPreferredTypes); 81673 for (const s of i) { 81674 const n = Mye(s); 81675 for (const [o, r] of Object.entries(t.alternatives)) 81676 if (n.test(o)) 81677 return r; 81678 } 81679 } 81680 return t.url; 81681 } 81682 /** 81683 * @private 81684 * @param {import('./types.js').InputMessageMap['selected-files-change']} message 81685 */ 81686 async handleSelectedFilesChange(t) { 81687 if (this.cfg.multiple !== t.isMultipleMode) { 81688 console.error("Multiple mode mismatch"); 81689 return; 81690 } 81691 this.bindL10n( 81692 "counterText", 81693 () => this.l10n("selected-count", { 81694 count: t.selectedCount, 81695 total: t.total 81696 }) 81697 ), this.set$({ 81698 doneBtnTextClass: t.isReady ? "" : "uc-hidden", 81699 isSelectionReady: t.isReady, 81700 isDoneBtnEnabled: t.isReady && t.selectedFiles.length > 0, 81701 showSelectionStatus: t.isMultipleMode && t.total > 0, 81702 couldSelectAll: t.selectedCount < t.total, 81703 couldDeselectAll: t.selectedCount === t.total, 81704 selectedList: t.selectedFiles 81705 }); 81706 } 81707 /** @private */ 81708 handleIframeLoad() { 81709 this.applyEmbedCss(this.cfg.externalSourcesEmbedCss), this.applyTheme(), this.setupL10n(); 81710 } 81711 /** @private */ 81712 applyTheme() { 81713 this._messageBridge?.send({ 81714 type: "set-theme-definition", 81715 theme: Eye(this) 81716 }); 81717 } 81718 /** 81719 * @private 81720 * @param {string} css 81721 */ 81722 applyEmbedCss(t) { 81723 this._messageBridge?.send({ 81724 type: "set-embed-css", 81725 css: t 81726 }); 81727 } 81728 /** @private */ 81729 setupL10n() { 81730 this._messageBridge?.send({ 81731 type: "set-locale-definition", 81732 localeDefinition: this.cfg.localeName 81733 }); 81734 } 81735 /** @private */ 81736 remoteUrl() { 81737 const { pubkey: t, remoteTabSessionKey: i, socialBaseUrl: s, multiple: n } = this.cfg, { externalSourceType: o } = this.activityParams, a = { 81738 lang: this.l10n("social-source-lang")?.split("-")?.[0] || "en", 81739 public_key: t, 81740 images_only: "false", 81741 session_key: i, 81742 wait_for_theme: !0, 81743 multiple: n.toString() 81744 }, l = new URL(`/window4/${o}`, s); 81745 return l.search = Lye(a), l.toString(); 81746 } 81747 /** @private */ 81748 mountIframe() { 81749 let t = K_({ 81750 tag: "iframe", 81751 attributes: { 81752 src: this.remoteUrl(), 81753 marginheight: 0, 81754 marginwidth: 0, 81755 frameborder: 0, 81756 allowTransparency: !0 81757 } 81758 }); 81759 t.addEventListener("load", this.handleIframeLoad.bind(this)), this.ref.iframeWrapper.innerHTML = "", this.ref.iframeWrapper.appendChild(t), t.contentWindow && (this._messageBridge?.destroy(), this._messageBridge = new Tye(t.contentWindow), this._messageBridge.on("selected-files-change", this.handleSelectedFilesChange.bind(this)), this.resetSelectionStatus()); 81760 } 81761 /** @private */ 81762 unmountIframe() { 81763 this._messageBridge?.destroy(), this._messageBridge = void 0, this.ref.iframeWrapper.innerHTML = "", this.resetSelectionStatus(); 81764 } 81765 /** @private */ 81766 resetSelectionStatus() { 81767 this.set$({ 81768 selectedList: [], 81769 total: 0, 81770 isDoneBtnEnabled: !1, 81771 couldSelectAll: !1, 81772 couldDeselectAll: !1, 81773 showSelectionStatus: !1 81774 }); 81775 } 81776} 81777s4.template = /* HTML */ 81778` 81779 <uc-activity-header> 81780 <button 81781 type="button" 81782 class="uc-mini-btn uc-close-btn"
81783 set="onclick: *historyBack" 81784 l10n="@title:a11y-activity-header-button-close" 81785 > 81786 <uc-icon name="close"></uc-icon> 81787 </button> 81788 </uc-activity-header> 81789 <div class="uc-content"> 81790 <div ref="iframeWrapper" class="uc-iframe-wrapper"></div> 81791 <div class="uc-toolbar"> 81792 <button type="button" class="uc-cancel-btn uc-secondary-btn" set="onclick: onCancel" l10n="cancel"></button> 81793 <div set="@hidden: !showSelectionStatus" class="uc-selection-status-box"> 81794 <span>{{counterText}}</span> 81795 <button type="button" set="onclick: onSelectAll; @hidden: !couldSelectAll" l10n="select-all"></button> 81796 <button type="button" set="onclick: onDeselectAll; @hidden: !couldDeselectAll" l10n="deselect-all"></button> 81797 </div> 81798 <button type="button" class="uc-done-btn uc-primary-btn" set="onclick: onDone; @disabled: !isDoneBtnEnabled;"> 81799 <uc-spinner set="@hidden: isSelectionReady"></uc-spinner> 81800 <span l10n="done" set="@class: doneBtnTextClass"></span> 81801 </button> 81802 </div> 81803 </div> 81804`; 81805class kye extends fs { 81806 requireCtxName = !0; 81807 _createValidationInput() { 81808 const t = document.createElement("input"); 81809 return t.type = "text", t.name = this.ctxName, t.required = this.cfg.multipleMin > 0, t.tabIndex = -1, FM(t, { 81810 opacity: 0, 81811 height: 0, 81812 width: 0 81813 }), t; 81814 } 81815 initCallback() { 81816 super.initCallback(), this._validationInputElement = this._createValidationInput(), this.appendChild(this._validationInputElement), this.sub( 81817 "*collectionState", 81818 (t) => { 81819 { 81820 if (this._dynamicInputsContainer || (this._dynamicInputsContainer = document.createElement("div"), this.appendChild(this._dynamicInputsContainer)), !this._validationInputElement) { 81821 const o = this._createValidationInput(); 81822 this.appendChild(o), this._validationInputElement = o; 81823 } 81824 if (this._dynamicInputsContainer.innerHTML = "", t.status === "uploading" || t.status === "idle") { 81825 this._validationInputElement.value = "", this._validationInputElement.setCustomValidity(""); 81826 return; 81827 } 81828 if (t.status === "failed") { 81829 const o = t.errors[0]?.message; 81830 this._validationInputElement.value = "", this._validationInputElement.setCustomValidity(o); 81831 return; 81832 } 81833 const i = t.group ? t.group : null; 81834 if (i) { 81835 this._validationInputElement.value = i.cdnUrl, this._validationInputElement.setCustomValidity(""); 81836 return; 81837 } 81838 const s = t.allEntries.map((o) => o.cdnUrl); 81839 if (!this.cfg.multiple && s.length === 1) { 81840 this._validationInputElement.value = s[0], this._validationInputElement.setCustomValidity(""); 81841 return; 81842 } 81843 this._validationInputElement.remove(), this._validationInputElement = null; 81844 const n = new DocumentFragment(); 81845 for (let o of s) { 81846 const r = document.createElement("input"); 81847 r.type = "hidden", r.name = `${this.ctxName}[]`, r.value = o, n.appendChild(r); 81848 } 81849 this._dynamicInputsContainer.replaceChildren(n); 81850 } 81851 }, 81852 !1 81853 ); 81854 } 81855} 81856class Pye extends gt { 81857} 81858class n4 extends Ti { 81859 init$ = { 81860 ...this.init$, 81861 currentText: "", 81862 options: [], 81863 selectHtml: "", 81864 onSelect: (t) => { 81865 t.preventDefault(), t.stopPropagation(), this.value = this.ref.select.value, this.$.currentText = this.$.options.find((i) => i.value == this.value)?.text || "", this.dispatchEvent(new Event("change")); 81866 } 81867 }; 81868 initCallback() { 81869 super.initCallback(), this.sub("options", (t) => { 81870 this.$.currentText = t?.[0]?.text || ""; 81871 let i = ""; 81872 t?.forEach((s) => { 81873 i += /* HTML */ 81874 `<option value="${s.value}">${s.text}</option>`; 81875 }), this.$.selectHtml = i; 81876 }); 81877 } 81878} 81879n4.template = /* HTML */ 81880' <select ref="select" set="innerHTML: selectHtml; onchange: onSelect"></select> '; 81881class Fye extends Ti { 81882 initCallback() { 81883 super.initCallback(), this.subConfigValue( 81884 "removeCopyright", 81885 /** @param {number} value */ 81886 (t) => { 81887 this.toggleAttribute("hidden", !!t); 81888 } 81889 ); 81890 } 81891 static template = ( 81892 /* HTML */ 81893 ` 81894 <a 81895 href="https://uploadcare.com/?utm_source=copyright&utm_medium=referral&utm_campaign=v4" 81896 target="_blank noopener" 81897 class="uc-credits" 81898 >Powered by Uploadcare</a 81899 > 81900 ` 81901 ); 81902} 81903class o4 extends Lg { 81904} 81905o4.template = /* HTML */ 81906' <div class="uc-spinner"></div> '; 81907class sA extends dC { 81908 static styleAttrs = [...super.styleAttrs, "uc-file-uploader-regular"]; 81909 constructor() { 81910 super(), this.init$ = { 81911 ...this.init$, 81912 isHidden: !1 81913 }; 81914 } 81915 initCallback() { 81916 super.initCallback(), this.defineAccessor( 81917 "headless", 81918 /** @param {unknown} value */ 81919 (t) => { 81920 this.set$({ isHidden: mi(t) }); 81921 } 81922 ), this.sub( 81923 "*modalActive", 81924 (t) => {
81925 this._lastModalActive !== t && this.emit(t ? Ni.MODAL_OPEN : Ni.MODAL_CLOSE, void 0, { debounce: !0 }), this._lastModalActive = t; 81926 }, 81927 !1 81928 ); 81929 } 81930} 81931sA.template = /* HTML */ 81932` 81933 <uc-simple-btn set="@hidden: isHidden"></uc-simple-btn> 81934 81935 <uc-modal strokes block-body-scrolling> 81936 <uc-start-from> 81937 <uc-drop-area with-icon clickable></uc-drop-area> 81938 <uc-source-list wrap></uc-source-list> 81939 <button type="button" l10n="start-from-cancel" class="uc-secondary-btn" set="onclick: *historyBack"></button> 81940 <uc-copyright></uc-copyright> 81941 </uc-start-from> 81942 <uc-upload-list></uc-upload-list> 81943 <uc-camera-source></uc-camera-source> 81944 <uc-url-source></uc-url-source> 81945 <uc-external-source></uc-external-source> 81946 <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity> 81947 </uc-modal> 81948`; 81949sA.bindAttributes({ 81950 // @ts-expect-error TODO: fix types inside symbiote 81951 headless: null 81952}); 81953class r4 extends dC { 81954 static styleAttrs = [...super.styleAttrs, "uc-file-uploader-minimal"]; 81955 initCallback() { 81956 super.initCallback(); 81957 const t = this.ref.uBlock; 81958 this.sub("*currentActivity", (i) => { 81959 i || (this.$["*currentActivity"] = t.initActivity || gt.activities.START_FROM); 81960 }), this.sub("*uploadList", (i) => { 81961 i?.length > 0 ? this.$["*currentActivity"] = gt.activities.UPLOAD_LIST : this.$["*currentActivity"] = t.initActivity || gt.activities.START_FROM; 81962 }), this.subConfigValue("sourceList", (i) => { 81963 i !== "local" && (this.cfg.sourceList = "local"); 81964 }), this.subConfigValue("confirmUpload", (i) => { 81965 i !== !1 && (this.cfg.confirmUpload = !1); 81966 }); 81967 } 81968} 81969r4.template = /* HTML */ 81970` 81971 <uc-start-from> 81972 <uc-drop-area tabindex="0" clickable l10n="choose-file"></uc-drop-area> 81973 <uc-copyright></uc-copyright> 81974 </uc-start-from> 81975 <uc-upload-list ref="uBlock"></uc-upload-list> 81976`; 81977class a4 extends dC { 81978 static styleAttrs = [...super.styleAttrs, "uc-file-uploader-inline"]; 81979 constructor() { 81980 super(), this.init$ = { 81981 ...this.init$, 81982 couldCancel: !1, 81983 cancel: () => { 81984 this.couldHistoryBack ? this.$["*historyBack"]() : this.couldShowList && (this.$["*currentActivity"] = gt.activities.UPLOAD_LIST); 81985 } 81986 }; 81987 } 81988 get couldHistoryBack() { 81989 const t = this.$["*history"]; 81990 return t.length > 1 && t[t.length - 1] !== gt.activities.START_FROM; 81991 } 81992 get couldShowList() { 81993 return this.cfg.showEmptyList || this.$["*uploadList"].length > 0; 81994 } 81995 initCallback() { 81996 super.initCallback(); 81997 const t = this.ref.uBlock; 81998 this.sub("*currentActivity", (i) => { 81999 i || (this.$["*currentActivity"] = t.initActivity || gt.activities.START_FROM); 82000 }), this.sub("*uploadList", (i) => { 82001 i?.length > 0 && this.$["*currentActivity"] === (t.initActivity || gt.activities.START_FROM) && (this.$["*currentActivity"] = gt.activities.UPLOAD_LIST); 82002 }), this.sub("*history", () => { 82003 this.$.couldCancel = this.couldHistoryBack || this.couldShowList; 82004 }); 82005 } 82006} 82007a4.template = /* HTML */ 82008` 82009 <uc-start-from> 82010 <uc-drop-area with-icon clickable></uc-drop-area> 82011 <uc-source-list wrap></uc-source-list> 82012 <button 82013 type="button" 82014 l10n="start-from-cancel" 82015 class="uc-cancel-btn uc-secondary-btn" 82016 set="onclick: cancel; @hidden: !couldCancel" 82017 ></button> 82018 <uc-copyright></uc-copyright> 82019 </uc-start-from> 82020 <uc-upload-list ref="uBlock"></uc-upload-list> 82021 <uc-camera-source></uc-camera-source> 82022 <uc-url-source></uc-url-source> 82023 <uc-external-source></uc-external-source> 82024 <uc-cloud-image-editor-activity></uc-cloud-image-editor-activity> 82025`; 82026class Oye extends Pg { 82027 static styleAttrs = [...super.styleAttrs, "uc-wgt-common"]; 82028 initCallback() { 82029 super.initCallback(), this.a11y?.registerBlock(this); 82030 } 82031} 82032function nA(e) { 82033 for (let t in e) { 82034 let i = [...t].reduce((s, n) => (n.toUpperCase() === n && (n = "-" + n.toLowerCase()), s += n), ""); 82035 i.startsWith("-") && (i = i.replace("-", "")), i.startsWith("uc-") || (i = "uc-" + i), e[t].reg && e[t].reg(i); 82036 } 82037} 82038const K0 = "UC"; 82039async function Nye(e, t = !1) { 82040 return new Promise((i, s) => { 82041 if (typeof document != "object") { 82042 i(null); 82043 return; 82044 } 82045 if (typeof window == "object" && window[K0]) { 82046 i(window[K0]); 82047 return; 82048 } 82049 let n = document.createElement("script"); 82050 n.async = !0, n.src = e, n.onerror = () => { 82051 s(); 82052 }, n.onload = () => { 82053 let o = window[K0]; 82054 t && nA(o), i(o); 82055 }, document.head.appendChild(n); 82056 }); 82057} 82058const _ye = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ 82059 __proto__: null, 82060 ActivityBlock: gt, 82061 ActivityHeader: Pye, 82062 BaseComponent: Lg, 82063 Block: Ti, 82064 BtnUi: iA, 82065 CameraSource: oi, 82066 CloudImageEditor: Oye, 82067 CloudImageEditorActivity: Sye, 82068 CloudImageEditorBlock: Pg, 82069 Config: pve, 82070 Copyright: Fye, 82071 CropFrame: Y3, 82072 Data: $t, 82073 DropArea: QM, 82074 EditorCropButtonControl: K3, 82075 EditorFilterControl: eA, 82076 EditorImageCropper: Q3, 82077 EditorImageFader: yye, 82078 EditorOperationControl: q3, 82079 EditorScroller: X3, 82080 EditorSlider: Z3, 82081 EditorToolbar: J3, 82082 ExternalSource: s4, 82083 ExternalUploadSource: gC, 82084 FileItem: Lc, 82085 FileUploaderInline: a4, 82086 FileUploaderMinimal: r4, 82087 FileUploaderRegular: sA, 82088 FormInput: kye, 82089 Icon: ZM, 82090 Img: Cve, 82091 LineLoaderUi: e4, 82092 Modal: G3, 82093 PACKAGE_NAME: hC,
82094 PACKAGE_VERSION: pC, 82095 PresenceToggle: t4, 82096 ProgressBar: j3, 82097 ProgressBarCommon: W3, 82098 Select: n4, 82099 SimpleBtn: qM, 82100 SliderUi: i4, 82101 SolutionBlock: dC, 82102 SourceBtn: XM, 82103 SourceList: Dve, 82104 Spinner: o4, 82105 StartFrom: R3, 82106 UID: iC, 82107 UploadCtxProvider: oye, 82108 UploadList: H3, 82109 UploadSource: bs, 82110 UploaderBlock: fs, 82111 UrlSource: V3, 82112 defineComponents: nA, 82113 defineLocale: x3, 82114 loadFileUploaderFrom: Nye, 82115 toKebabCase: fC 82116}, Symbol.toStringTag, { value: "Module" })), Bye = ["ctx-name", "pubkey"], Gye = ["ctx-name"], zye = ["ctx-name"], Hye = { class: "qr-image-uploader_empty-state_content" }, Vye = { class: "qr-image-uploader_empty-state_title" }, Uye = { class: "qr-image-uploader_empty-state_subtitle" }, Wye = { 82117 key: 1, 82118 class: "qr-image-uploader_image-wrapper" 82119}, jye = ["src"], $ye = { class: "qr-image-uploader_image-wrapper-action-buttons column justify-between" }, Yye = /* @__PURE__ */ Mt({ 82120 __name: "qr-image-uploader", 82121 props: /* @__PURE__ */ md({ 82122 ctxName: {} 82123 }, { 82124 modelValue: { required: !0 }, 82125 modelModifiers: {} 82126 }), 82127 emits: /* @__PURE__ */ md(["remove"], ["update:modelValue"]), 82128 setup(e, { emit: t }) { 82129 nA(_ye); 82130 const i = "c1d6ce04c47e2145d20b", s = Dv(e, "modelValue"), n = e, o = De(null), r = De(), a = De(null), l = t, c = Qe(() => s.value || ""); 82131 function u() { 82132 o.value?.getAPI().initFlow(); 82133 } 82134 function d() { 82135 o.value?.getAPI()?.removeAllFiles(), l("remove"); 82136 } 82137 const p = [ 82138 { 82139 aid: "QR_IMAGE_UPLOADER_REMOVE_IMAGE", 82140 icon: "fa-light fa-trash-can fa-sm", 82141 tooltip: xs.removeImage || "Remove image", 82142 onClick: d 82143 }, 82144 { 82145 aid: "QR_IMAGE_UPLOADER_REPLACE_IMAGE", 82146 icon: "fa-light fa-arrows-rotate fa-sm", 82147 tooltip: xs.replaceImage || "Replace image", 82148 onClick: u 82149 } 82150 ]; 82151 async function f(b) { 82152 r.value = b.detail.mimeType; 82153 } 82154 async function m(b) { 82155 const C = b.detail.successEntries[0]; 82156 try { 82157 const w = await wt.uploadQRCodeLogo({ 82158 uuid: C.uuid, 82159 cdnUrl: C.cdnUrl, 82160 imageFormat: C.fileInfo.imageInfo?.format || "" 82161 }); 82162 if (!w.imageUrl) 82163 throw new Error("Invalid response from upload"); 82164 s.value = w.imageUrl, o.value?.getAPI().removeAllFiles(); 82165 } catch (w) { 82166 throw qt({ 82167 aid: "QR_CODE_LOGO_UPLOAD_ERROR", 82168 message: xs.uploadError || "Failed to upload logo", 82169 status: ri.Error 82170 }), w; 82171 } 82172 } 82173 function y() { 82174 o.value?.getAPI().removeAllFiles(); 82175 } 82176 return Cn(() => { 82177 o.value && (o.value.addEventListener("file-added", f), o.value.addEventListener("done-click", m), o.value.addEventListener("modal-close", y)); 82178 }), Nd(() => { 82179 o.value && (o.value.removeEventListener("file-added", f), o.value.removeEventListener("done-click", m), o.value.removeEventListener("modal-close", y), a.value && (o.value.removeEventListener( 82180 "file-upload-success", 82181 a.value 82182 ), a.value = null)); 82183 }), (b, C) => (we(), Ne("div", { 82184 class: da({ 82185 "qr-image-uploader": !0, 82186 "with-image": c.value 82187 }) 82188 }, [ 82189 fe("uc-config", { 82190 "ctx-name": n.ctxName, 82191 pubkey: Z(i), 82192 multiple: "false", 82193 "img-only": "true", 82194 "source-list": "local, url, dropbox, gdrive", 82195 "max-local-file-size-bytes": "10485760", 82196 "use-cloud-image-editor": !0 82197 }, null, 8, Bye), 82198 fe("uc-upload-ctx-provider", { 82199 ref_key: "uploaderCtx", 82200 ref: o, 82201 "ctx-name": n.ctxName 82202 }, null, 8, Gye), 82203 fe("uc-file-uploader-regular", { 82204 "ctx-name": n.ctxName, 82205 headless: "true", 82206 class: "uc-light", 82207 "preview-step": !0, 82208 crop: !0, 82209 tabs: ["file", "url", "camera"] 82210 }, null, 8, zye), 82211 c.value ? (we(), Ne("div", Wye, [ 82212 fe("img", { 82213 src: c.value, 82214 alt: "Uploaded image", 82215 class: "uploaded-image", 82216 onClick: u 82217 }, null, 8, jye), 82218 fe("div", $ye, [ 82219 (we(), Ne(yi, null, hs(p, (w) => Re(Z(MS), { 82220 key: w.icon, 82221 variant: "text", 82222 color: "gray-400", 82223 size: "sm", 82224 aid: w.aid, 82225 onClick: w.onClick 82226 }, { 82227 default: Ve(() => [ 82228 fe("i", { 82229 class: da(w.icon) 82230 }, null, 2), 82231 Re(Z(ca), { 82232 aid: `${w.aid}_TOOLTIP` 82233 }, { 82234 default: Ve(() => [ 82235 ut(ke(w.tooltip), 1) 82236 ]), 82237 _: 2 82238 }, 1032, ["aid"]) 82239 ]), 82240 _: 2 82241 }, 1032, ["aid", "onClick"])), 64)) 82242 ]) 82243 ])) : (we(), Ne("div", { 82244 key: 0, 82245 class: "qr-image-uploader_empty-state",
82246 aid: "QR_IMAGE_UPLOADER_ADD_IMAGE", 82247 onClick: u 82248 }, [ 82249 fe("div", Hye, [ 82250 fe("span", Vye, [ 82251 C[0] || (C[0] = fe("span", { class: "fa-light fa-circle-plus icon" }, null, -1)), 82252 ut(" " + ke(Z(xs).uploadPhotoOrLogo), 1) 82253 ]), 82254 fe("span", Uye, ke(Z(xs).imageSizeRequirement), 1) 82255 ]) 82256 ])) 82257 ], 2)); 82258 } 82259}), Kye = /* @__PURE__ */ ii(Yye, [["__scopeId", "data-v-b102a3fb"]]), Dm = [ 82260 { 82261 key: "dotsColor", 82262 defaultValue: "black", 82263 tooltip: xs.dotsColorTooltip 82264 }, 82265 { 82266 key: "backgroundColor", 82267 defaultValue: "white", 82268 tooltip: xs.backgroundColorTooltip 82269 } 82270], Zye = { class: "side-panel" }, qye = { class: "side-panel-header" }, Qye = { class: "side-panel-content" }, Xye = { class: "side-panel-section" }, Jye = { class: "side-panel-section" }, eCe = { class: "side-panel-section-title" }, tCe = { class: "edit-section-colors" }, iCe = { class: "side-panel-section" }, sCe = { class: "side-panel-section-title" }, nCe = { class: "edit-section-style" }, oCe = ["onClick"], rCe = /* @__PURE__ */ Mt({ 82271 __name: "side-panel", 82272 props: { 82273 colors: {}, 82274 logoUrl: {}, 82275 style: {} 82276 }, 82277 emits: ["update:logo", "update:color", "update:style"], 82278 setup(e, { emit: t }) { 82279 const i = e, s = t, n = { 82280 key: "QR_CODE_LOGO_UPLOADER", 82281 "ctx-name": "qr-code-logo-uploader" 82282 }, o = [ 82283 { 82284 key: Rc.Square, 82285 label: "Square", 82286 image: "fa-kit fa-qr-square" 82287 }, 82288 { 82289 key: Rc.Rounded, 82290 label: "Rounded", 82291 image: "fa-kit fa-qr-round" 82292 }, 82293 { 82294 key: Rc.Dots, 82295 label: "Dots", 82296 image: "fa-kit fa-qr-dots" 82297 } 82298 ], r = Qe({ 82299 get() { 82300 return i.logoUrl || ""; 82301 }, 82302 set(d) { 82303 s("update:logo", d); 82304 } 82305 }); 82306 function a() { 82307 s("update:logo", ""); 82308 } 82309 function l(d, p) { 82310 s("update:color", d, p); 82311 } 82312 function c(d) { 82313 s("update:style", d); 82314 } 82315 function u(d) { 82316 return `QR_CODE_COLOR_${d + 1}`; 82317 } 82318 return (d, p) => (we(), Ne("div", Zye, [ 82319 fe("span", qye, ke(Z(xs).qrCodeStylesEdit), 1), 82320 fe("div", Qye, [ 82321 fe("div", Xye, [ 82322 Re(Xpe, { 82323 modelValue: r.value, 82324 "onUpdate:modelValue": p[0] || (p[0] = (f) => r.value = f), 82325 component: Kye, 82326 label: Z(xs).logo, 82327 "component-props": n, 82328 aid: "QR_CODE_LOGO", 82329 onRemove: a 82330 }, null, 8, ["modelValue", "label"]) 82331 ]), 82332 p[1] || (p[1] = fe("div", { class: "separator" }, null, -1)), 82333 fe("div", Jye, [ 82334 fe("span", eCe, ke(Z(xs).colors), 1), 82335 fe("div", tCe, [ 82336 (we(!0), Ne(yi, null, hs(Z(Dm), (f, m) => (we(), Ne("div", { 82337 key: f.key 82338 }, [ 82339 Re(Z(ca), { 82340 aid: `${u(m)}_COLOR_PICKER_TOOLTIP`, 82341 size: "sm", 82342 position: "top" 82343 }, { 82344 default: Ve(() => [ 82345 ut(ke(f.tooltip), 1) 82346 ]), 82347 _: 2 82348 }, 1032, ["aid"]), 82349 Re(Ppe, { 82350 "model-value": i.colors[f.key], 82351 tooltip: f.tooltip, 82352 aid: u(m), 82353 "onUpdate:modelValue": (y) => l(f.key, y) 82354 }, null, 8, ["model-value", "tooltip", "aid", "onUpdate:modelValue"]) 82355 ]))), 128)) 82356 ]) 82357 ]), 82358 p[2] || (p[2] = fe("div", { class: "separator" }, null, -1)), 82359 fe("div", iCe, [ 82360 fe("span", sCe, ke(Z(xs).style), 1), 82361 fe("div", nCe, [ 82362 (we(), Ne(yi, null, hs(o, (f) => fe("div", { 82363 key: f.key, 82364 class: da(["edit-section-style-item", { 82365 "edit-section-style-item--selected": f.key === i.style 82366 }]), 82367 onClick: (m) => c(f.key) 82368 }, [ 82369 fe("i", { 82370 class: da(f.image) 82371 }, null, 2) 82372 ], 10, oCe)), 64)) 82373 ]) 82374 ]) 82375 ]) 82376 ])); 82377 } 82378}), aCe = /* @__PURE__ */ ii(rCe, [["__scopeId", "data-v-f80ad0d3"]]), lCe = { class: "editor" }, cCe = { class: "editor_header" }, uCe = { 82379 key: 0, 82380 class: "main-loader" 82381}, dCe = { 82382 key: 1, 82383 class: "editor-root" 82384}, hCe = /* @__PURE__ */ Mt({ 82385 __name: "qr-code-editor-page", 82386 setup(e) { 82387 const i = IS().params.linkId, s = De(""), n = De(""), o = De(!1), r = De(!1), a = De(!1), l = De(""), c = De(""), u = De(Rc.Square), d = De(Rc.Square), p = De( 82388 Object.fromEntries( 82389 Dm.map((I) => [I.key, I.defaultValue]) 82390 ) 82391 ), f = bL( 82392 Object.fromEntries( 82393 Dm.map((I) => [I.key, I.defaultValue]) 82394 ) 82395 ), m = Qe(() => { 82396 const I = Dm.some((B) => f[B.key] !== p.value[B.key]), L = l.value !== c.value, k = u.value !== d.value; 82397 return I || L || k; 82398 }); 82399 function y(I, L) { 82400 f[I] = L; 82401 } 82402 function b(I) { 82403 l.value = I; 82404 } 82405 function C(I) { 82406 u.value = I; 82407 } 82408 function w(I) { 82409 if (I) { 82410 if (I.dotsOptions?.color && (f.dotsColor = I.dotsOptions.color, p.value.dotsColor = I.dotsOptions.color), I.backgroundOptions?.color && (f.backgroundColor = I.backgroundOptions.color, p.value.backgroundColor = I.backgroundOptions.color), I.dotsOptions?.type) { 82411 const L = I.dotsOptions.type; 82412 u.value = L, d.value = L; 82413 } 82414 I.logo && (l.value = I.logo, c.value = I.logo); 82415 } 82416 } 82417 function M() { 82418 return { 82419 dotsOptions: { 82420 color: f.dotsColor, 82421 type: u.value 82422 }, 82423 backgroundOptions: { 82424 color: f.backgroundColor 82425 }, 82426 logo: l.value || void 0 82427 }; 82428 } 82429 async function A() { 82430 if (!(!m.value || r.value)) { 82431 r.value = !0; 82432 try { 82433 const I = M(); 82434 await wt.update({ 82435 id: i, 82436 qrCodeStylesData: I 82437 }), a.value = !0, p.value.dotsColor = f.dotsColor, p.value.backgroundColor = f.backgroundColor, c.value = l.value, d.value = u.value, Fb(), $de({ 82438 has_logo: String(!!l.value) 82439 }), await bl( 82440 `${Cd}?openModal=download-url&linkId=${i}` 82441 ); 82442 } catch (I) { 82443 qt({ 82444 message: xs.saveError, 82445 status: ri.Error, 82446 aid: "SAVE_QR_CODE_STYLES_FAILED" 82447 }), console.error("Failed to save QR code styles:", { 82448 error: I, 82449 qrCodeStylesData: M() 82450 }); 82451 } finally { 82452 r.value = !1; 82453 } 82454 } 82455 } 82456 return Cn(async () => { 82457 o.value = !0;
82458 try { 82459 await wt.init(bc()); 82460 const { link: I } = await wt.getLinkById({ id: i }); 82461 if (I) { 82462 const L = I.type === "survey"; 82463 s.value = tC(I?.fullShortLinkURL || "", [ 82464 "refSource=qr-code", 82465 L ? "source=link" : "" 82466 ]) || "", n.value = I.title || "", I.qrCodeStylesData && (w(I.qrCodeStylesData), a.value = !0); 82467 } 82468 } catch (I) { 82469 qt({ 82470 message: xs.fetchError, 82471 status: ri.Error, 82472 aid: "FETCH_LINK_QR_CODE_DATA_FAILED" 82473 }), console.error("Failed to fetch link QR code data", I); 82474 } finally { 82475 o.value = !1, jde(); 82476 } 82477 }), UE.value = VE.Hidden, HE.value = zE.Hidden, Gn( 82478 () => m.value, 82479 (I) => { 82480 I ? oU() : Fb(); 82481 } 82482 ), Nd(() => { 82483 HE.value = zE.Shown, UE.value = VE.FullView, Fb(); 82484 }), (I, L) => (we(), Ne("div", lCe, [ 82485 fe("div", cCe, [ 82486 Re(xpe, { 82487 "has-changes": m.value, 82488 "is-saving": r.value, 82489 "link-name": n.value, 82490 onSave: A 82491 }, null, 8, ["has-changes", "is-saving", "link-name"]) 82492 ]), 82493 o.value ? (we(), Ne("div", uCe, [...L[0] || (L[0] = [ 82494 fe("div", null, [ 82495 fe("span", { 82496 id: "frame-loader", 82497 "aria-hidden": "true" 82498 }) 82499 ], -1) 82500 ])])) : (we(), Ne("div", dCe, [ 82501 Re(aCe, { 82502 colors: f, 82503 "logo-url": l.value, 82504 style: Em(u.value), 82505 "onUpdate:color": y, 82506 "onUpdate:logo": b, 82507 "onUpdate:style": C 82508 }, null, 8, ["colors", "logo-url", "style"]), 82509 s.value ? (we(), Wt(Ipe, { 82510 key: 0, 82511 colors: f, 82512 fullShortLinkURL: s.value, 82513 linkName: n.value, 82514 logoUrl: l.value, 82515 style: Em(u.value) 82516 }, null, 8, ["colors", "fullShortLinkURL", "linkName", "logoUrl", "style"])) : di("", !0) 82517 ])) 82518 ])); 82519 } 82520}), pCe = /* @__PURE__ */ ii(hCe, [["__scopeId", "data-v-43db2d9b"]]), gCe = [ 82521 { 82522 path: Cd, 82523 component: ihe, 82524 children: [ 82525 { 82526 name: "links", 82527 path: "", 82528 component: ype 82529 }, 82530 { 82531 name: "link-analytics", 82532 path: ":linkId", 82533 component: Xde 82534 } 82535 ] 82536 }, 82537 { 82538 name: "link-qr-code-management", 82539 path: `${Cd}/:linkId/qr-code`, 82540 component: pCe 82541 } 82542], fCe = pW({ 82543 history: VU(""), 82544 routes: gCe 82545}), mCe = {}; 82546function vCe(e, t) { 82547 const i = xL("RouterView"); 82548 return we(), Wt(i); 82549} 82550const yCe = /* @__PURE__ */ ii(mCe, [["render", vCe]]), { bootstrap: OCe, mount: NCe, unmount: _Ce } = j6({ 82551 name: "links", 82552 mainComponent: yCe, 82553 targetElement: "#content", 82554 includeCss: !0, 82555 viteCdnPrefix: "/assets-ws1/1790849113105", 82556 handleVueApp: (e) => { 82557 W6(e), e.use(fCe); 82558 } 82559}); 82560export { 82561 OCe as bootstrap, 82562 NCe as mount, 82563 _Ce as unmount 82564}; 82565//# sourceMappingURL=links-mfe.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.