@yuneta/gobj-ui 7.27.22 → 7.27.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17941,8 +17941,8 @@ function load_json(gobj) {
17941
17941
  yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
17942
17942
  return;
17943
17943
  }
17944
- Promise.resolve(graph.zoomTo(1)).then(() => {
17945
- if (!yui_graph_center_on(graph, priv.anchor_id)) yui_graph_center_on(graph, root_id);
17944
+ Promise.resolve(graph.zoomTo(1)).then(async () => {
17945
+ if (!(priv.anchor_id ? await yui_graph_center_on(graph, priv.anchor_id) : false)) await yui_graph_center_on(graph, root_id);
17946
17946
  priv.last_zoom = 1;
17947
17947
  yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
17948
17948
  });
@@ -23677,6 +23677,60 @@ function describe_js_gobj(target_gobj, is_root) {
23677
23677
  }
23678
23678
  return d;
23679
23679
  }
23680
+ /************************************************************
23681
+ * A descriptor from ONE node of the `view-gobj-tree` answer
23682
+ * of a backend yuno.
23683
+ *
23684
+ * `shortname` is the key the node hangs from in that answer;
23685
+ * the node itself repeats it, so the argument is only the
23686
+ * fallback for a filtered answer that dropped the field.
23687
+ ************************************************************/
23688
+ function describe_backend_node(shortname, node, is_root) {
23689
+ if (!node || typeof node !== "object") return null;
23690
+ let flags = Array.isArray(node.gobj_flags) ? node.gobj_flags : [];
23691
+ let has = (flag) => flags.indexOf(flag) !== -1;
23692
+ let d = {
23693
+ gclass: node.gclass || "",
23694
+ name: node.name || "",
23695
+ shortname: node.shortname || shortname || "",
23696
+ fullname: node.fullname || "",
23697
+ parent: node.parent || "",
23698
+ state: node.state || "",
23699
+ running: !!node.running,
23700
+ playing: !!node.playing,
23701
+ service: !!node.service || has("gobj_flag_service") || has("gobj_flag_default_service"),
23702
+ volatil: !!node.volatil || has("gobj_flag_volatil"),
23703
+ pure_child: has("gobj_flag_pure_child"),
23704
+ disabled: !!node.disabled,
23705
+ bottom_gobj: node.bottom_gobj || "",
23706
+ commands: !!node.commands,
23707
+ gobj_flags: flags,
23708
+ gobj_trace_level: Array.isArray(node.gobj_trace_level) ? node.gobj_trace_level : [],
23709
+ is_yuno: is_root !== void 0 ? !!is_root : has("gobj_flag_yuno"),
23710
+ children: []
23711
+ };
23712
+ let children = node.children && typeof node.children === "object" ? node.children : null;
23713
+ if (children) for (let key of Object.keys(children)) {
23714
+ let cd = describe_backend_node(key, children[key], false);
23715
+ if (cd) d.children.push(cd);
23716
+ }
23717
+ return d;
23718
+ }
23719
+ /************************************************************
23720
+ * The whole `view-gobj-tree` answer -> the root descriptor.
23721
+ *
23722
+ * That answer is a dict of ONE key (the shortname of the gobj
23723
+ * the command was asked about) even though it is shaped as a
23724
+ * dict all the way down. Returns null for anything else, and
23725
+ * the caller reports it: an empty tree and a malformed answer
23726
+ * must not look the same.
23727
+ ************************************************************/
23728
+ function describe_backend_tree(data) {
23729
+ if (!data || typeof data !== "object" || Array.isArray(data)) return null;
23730
+ let keys = Object.keys(data);
23731
+ if (keys.length === 0) return null;
23732
+ return describe_backend_node(keys[0], data[keys[0]], true);
23733
+ }
23680
23734
  /******************************
23681
23735
  * Readouts
23682
23736
  ******************************/
@@ -23709,6 +23763,7 @@ function node_badge_keys(d) {
23709
23763
  if (d.disabled) badges.push("disabled");
23710
23764
  if (d.bottom_gobj) badges.push("bottom");
23711
23765
  if (d.commands) badges.push("commands");
23766
+ if (Array.isArray(d.gobj_trace_level) && d.gobj_trace_level.length > 0) badges.push("traces");
23712
23767
  return badges;
23713
23768
  }
23714
23769
  /************************************************************
@@ -23746,7 +23801,8 @@ function node_labels(t) {
23746
23801
  "pure child": t("pure child"),
23747
23802
  "disabled": t("disabled"),
23748
23803
  "bottom": t("bottom"),
23749
- "commands": t("commands")
23804
+ "commands": t("commands"),
23805
+ "traces": t("traces")
23750
23806
  },
23751
23807
  field: {
23752
23808
  gclass: t("gclass"),
@@ -23795,6 +23851,82 @@ function node_info_rows(d, t) {
23795
23851
  if (kids > 0) rows.push([f.children, d.is_collapsed ? kids + " " + f.collapsed : String(kids)]);
23796
23852
  return rows;
23797
23853
  }
23854
+ /******************************
23855
+ * Trace levels
23856
+ ******************************/
23857
+ /************************************************************
23858
+ * The rows of the TRACES block of a backend gobj, one per
23859
+ * level it can trace: the gclass' own levels first (the ones
23860
+ * that are about this gobj), then the global ones.
23861
+ *
23862
+ * `d` is the descriptor (its `gobj_trace_level` is what the
23863
+ * gobj traces NOW, whatever the reason). `info` is what the
23864
+ * host fetched for its gclass:
23865
+ *
23866
+ * gclass_levels {name: description} info-gclass-trace
23867
+ * global_levels {name: description} info-global-trace
23868
+ * gclass_on [name, ...] get-gclass-trace
23869
+ * global_on [name, ...] get-global-trace
23870
+ *
23871
+ * `get-gclass-trace` answers the gclass' levels OR'ed with the
23872
+ * global ones (gobj_get_gclass_trace_level), so a level on in
23873
+ * both is counted as global: that is the one that would still
23874
+ * hold it on if the gclass let go.
23875
+ *
23876
+ * Each row says, for the two columns of the block:
23877
+ *
23878
+ * gobj_on, gobj_locked the gobj traces it; locked when
23879
+ * that comes from its gclass or
23880
+ * from the global level -- turning
23881
+ * the gobj's own bit off would not
23882
+ * stop it
23883
+ * gclass_on, gclass_locked every gobj of the gclass traces
23884
+ * it; locked when it is global
23885
+ * origin "global" | "gclass" | ""
23886
+ ************************************************************/
23887
+ function trace_rows(d, info) {
23888
+ let rows = [];
23889
+ if (!d || !info) return rows;
23890
+ let list = (x) => Array.isArray(x) ? x : [];
23891
+ let now = list(d.gobj_trace_level);
23892
+ let global_on = list(info.global_on);
23893
+ let gclass_on = list(info.gclass_on);
23894
+ let seen = {};
23895
+ let add = (group, levels) => {
23896
+ if (!levels || typeof levels !== "object") return;
23897
+ for (let level of Object.keys(levels)) {
23898
+ if (seen[level]) continue;
23899
+ seen[level] = true;
23900
+ let by_global = global_on.indexOf(level) >= 0;
23901
+ let by_gclass = !by_global && gclass_on.indexOf(level) >= 0;
23902
+ rows.push({
23903
+ level,
23904
+ description: String(levels[level] || ""),
23905
+ group,
23906
+ gobj_on: now.indexOf(level) >= 0 || by_global || by_gclass,
23907
+ gobj_locked: by_global || by_gclass,
23908
+ gclass_on: by_global || by_gclass,
23909
+ gclass_locked: by_global,
23910
+ origin: by_global ? "global" : by_gclass ? "gclass" : ""
23911
+ });
23912
+ }
23913
+ };
23914
+ add("gclass", info.gclass_levels);
23915
+ add("global", info.global_levels);
23916
+ return rows;
23917
+ }
23918
+ /************************************************************
23919
+ * The levels a scope holds ON ITS OWN -- what "remove the
23920
+ * traces" of that scope has to turn off. Not the locked ones:
23921
+ * they are held by a wider scope, and turning them off here
23922
+ * would change nothing.
23923
+ ************************************************************/
23924
+ function own_trace_levels(rows, scope) {
23925
+ let out = [];
23926
+ for (let r of rows || []) if (scope === "gobj" && r.gobj_on && !r.gobj_locked) out.push(r.level);
23927
+ else if (scope === "gclass" && r.gclass_on && !r.gclass_locked) out.push(r.level);
23928
+ return out;
23929
+ }
23798
23930
  //#endregion
23799
23931
  //#region src/gclass_describe.js
23800
23932
  /***********************************************************************
@@ -24183,7 +24315,42 @@ function is_mobile$3() {
24183
24315
  /***********************************************************************
24184
24316
  * c_yui_gobj_tree_js.js
24185
24317
  *
24186
- * Hierarchical tree graph (G6) of the gobj tree of the own yuno.
24318
+ * Hierarchical tree graph (G6) of the gobj tree of a yuno.
24319
+ *
24320
+ * Two sources (`source`):
24321
+ *
24322
+ * - "local" (default): the yuno of THIS browser, read live.
24323
+ * - "remote": a BACKEND yuno. The view cannot ask a backend
24324
+ * anything -- it has no transport, and which link reaches
24325
+ * the yuno is the host's business -- so it publishes what
24326
+ * it WANTS and the host answers with the data:
24327
+ *
24328
+ * out EV_TREE_WANTED {} Refresh pressed
24329
+ * in EV_LOAD_TREE {tree} the `view-gobj-tree` answer
24330
+ * out EV_TRACE_INFO_WANTED {gclass} a card was opened
24331
+ * in EV_TRACE_INFO {gclass, gclass_levels, global_levels,
24332
+ * gclass_on, global_on, error}
24333
+ * out EV_SET_TRACE_LEVEL {scope: "gobj"|"gclass", gobj,
24334
+ * gclass, levels: [...], set}
24335
+ * out EV_GCLASS_WANTED {gclass} the gclass button
24336
+ * in EV_GCLASS_DESCRIPTION {gclass, description}
24337
+ *
24338
+ * The host loads the FIRST tree on its own (it opened the
24339
+ * view); the view asks again only when Refresh is pressed.
24340
+ * After a trace is set the host loads the tree and the
24341
+ * trace info again: the card the reader is on stays open.
24342
+ *
24343
+ * In "remote" the popover of a card has a TRACES block: one
24344
+ * row per level (the gclass' own, then the global ones), a
24345
+ * checkbox for THIS gobj (`set-gobj-trace`) and one for every
24346
+ * gobj of its gclass (`set-gclass-trace`). A level that is on
24347
+ * for the gclass, or globally, is shown on and locked in the
24348
+ * gobj column, with where it comes from: it cannot be turned
24349
+ * off from one gobj. A gclass level is saved by the yuno and
24350
+ * survives a restart; a gobj level lasts until the yuno ends.
24351
+ *
24352
+ * The output events are published ONLY in "remote", so a host
24353
+ * of a local tree (the Frontend view) declares none of them.
24187
24354
  *
24188
24355
  * Copyright (c) 2025-2026, ArtGins.
24189
24356
  * All Rights Reserved.
@@ -24199,6 +24366,8 @@ var attrs_table$9 = [
24199
24366
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
24200
24367
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Container element"),
24201
24368
  SDATA(data_type_t.DTP_STRING, "canvas_id", 0, "", "Canvas ID"),
24369
+ SDATA(data_type_t.DTP_STRING, "source", 0, "local", "Whose tree: local (this browser yuno, read live) | remote (a backend yuno, loaded by the host with EV_LOAD_TREE)"),
24370
+ SDATA(data_type_t.DTP_STRING, "yuno_name", 0, "", "remote: the name the yuno is shown by (the gclass window says it before the gclass)"),
24202
24371
  SDATA(data_type_t.DTP_STRING, "wide", 0, "40px", "Height of header. 40px and not 36: it is what an untouched Bulma control measures, so the find box stood 4px taller than every button beside it, and it is what the third graph of the family (C_YUI_TREEDB_GRAPH) uses"),
24203
24372
  SDATA(data_type_t.DTP_STRING, "layout", 0, "vertical-compact", "Current layout key"),
24204
24373
  SDATA(data_type_t.DTP_INTEGER, "collapse_threshold", 0, 10, "Auto-collapse a node whose direct children exceed this number. 0 disables auto-collapse."),
@@ -24230,16 +24399,23 @@ function restore_view_state(gobj) {
24230
24399
  let graph = priv.graph;
24231
24400
  let state = load_view_state(gobj);
24232
24401
  if (!graph || !state) return false;
24402
+ let zoom = Number.isFinite(state.zoom) && state.zoom > 0 ? state.zoom : null;
24403
+ let position = Array.isArray(state.position) && state.position.length >= 2 && Number.isFinite(state.position[0]) && Number.isFinite(state.position[1]) ? [state.position[0], state.position[1]] : null;
24404
+ if ((zoom !== null || position !== null) && !camera_shows_a_card(gobj, zoom, position)) {
24405
+ log_warning(`${gobj_short_name(gobj)}: the saved view shows none of the ${Object.keys(priv.node_by_id || {}).length} gobjs, framed again`);
24406
+ zoom = null;
24407
+ position = null;
24408
+ }
24233
24409
  let done = false;
24234
24410
  priv.restoring = true;
24235
24411
  try {
24236
- if (Number.isFinite(state.zoom) && state.zoom > 0) {
24237
- graph.zoomTo(state.zoom);
24238
- priv.last_zoom = state.zoom;
24412
+ if (zoom !== null) {
24413
+ graph.zoomTo(zoom);
24414
+ priv.last_zoom = zoom;
24239
24415
  done = true;
24240
24416
  }
24241
- if (Array.isArray(state.position) && state.position.length >= 2 && Number.isFinite(state.position[0]) && Number.isFinite(state.position[1])) {
24242
- graph.translateTo([state.position[0], state.position[1]]);
24417
+ if (position !== null) {
24418
+ graph.translateTo(position);
24243
24419
  done = true;
24244
24420
  }
24245
24421
  if (state.anchor) {
@@ -24257,6 +24433,30 @@ function restore_view_state(gobj) {
24257
24433
  yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
24258
24434
  return done;
24259
24435
  }
24436
+ function camera_shows_a_card(gobj, zoom, position) {
24437
+ let priv = gobj.priv;
24438
+ let graph = priv.graph;
24439
+ let ids = Object.keys(priv.node_by_id || {});
24440
+ if (!graph || !ids.length) return true;
24441
+ try {
24442
+ let size = graph.getSize();
24443
+ let c = graph.getCanvasCenter();
24444
+ let z = zoom !== null ? zoom : graph.getZoom();
24445
+ let t = position !== null ? position : graph.getPosition();
24446
+ let w = size[0];
24447
+ let h = size[1];
24448
+ if (!(w > 0 && h > 0) || !(z > 0)) return true;
24449
+ for (let id of ids) {
24450
+ let n = graph.getElementPosition(id);
24451
+ let vx = (n[0] - c[0]) * z + t[0] + c[0];
24452
+ let vy = (n[1] - c[1]) * z + t[1] + c[1];
24453
+ if (vx >= 0 && vx <= w && vy >= 0 && vy <= h) return true;
24454
+ }
24455
+ } catch (e) {
24456
+ return true;
24457
+ }
24458
+ return false;
24459
+ }
24260
24460
  function save_view_state(gobj) {
24261
24461
  let priv = gobj.priv;
24262
24462
  let graph = priv.graph;
@@ -24267,8 +24467,9 @@ function save_view_state(gobj) {
24267
24467
  anchor: priv.anchor_state === "on" ? priv.anchor_name : ""
24268
24468
  };
24269
24469
  let camera = null;
24470
+ let has_nodes = !!priv.node_by_id && Object.keys(priv.node_by_id).length > 0;
24270
24471
  try {
24271
- camera = camera_of(graph.getZoom(), graph.getPosition());
24472
+ camera = has_nodes ? camera_of(graph.getZoom(), graph.getPosition()) : null;
24272
24473
  } catch (e) {}
24273
24474
  if (!camera) {
24274
24475
  let old = load_view_state(gobj);
@@ -24323,7 +24524,10 @@ var PRIVATE_DATA$9 = {
24323
24524
  anchor_state: "off",
24324
24525
  restoring: false,
24325
24526
  restored: false,
24326
- last_zoom: 1
24527
+ last_zoom: 1,
24528
+ remote_root: null,
24529
+ trace_info: {},
24530
+ trace_pending: false
24327
24531
  };
24328
24532
  var __gclass__$9 = null;
24329
24533
  var __layout_registered__ = false;
@@ -25380,8 +25584,10 @@ function load_tree(gobj) {
25380
25584
  let priv = gobj.priv;
25381
25585
  let graph = priv.graph;
25382
25586
  if (!graph) return;
25383
- let root = describe_js_gobj(gobj_yuno(), true);
25587
+ let remote = is_remote(gobj);
25588
+ let root = remote ? priv.remote_root : describe_js_gobj(gobj_yuno(), true);
25384
25589
  if (!root) {
25590
+ if (remote) return;
25385
25591
  log_error(`${gobj_short_name(gobj)}: no yuno to draw`);
25386
25592
  return;
25387
25593
  }
@@ -25415,8 +25621,8 @@ function load_tree(gobj) {
25415
25621
  priv.restored = true;
25416
25622
  if (restore_view_state(gobj)) return;
25417
25623
  }
25418
- Promise.resolve(graph.zoomTo(1)).then(() => {
25419
- if (!yui_graph_center_on(graph, priv.anchor_id)) yui_graph_center_on(graph, root_id);
25624
+ Promise.resolve(graph.zoomTo(1)).then(async () => {
25625
+ if (!(priv.anchor_id ? await yui_graph_center_on(graph, priv.anchor_id) : false)) await yui_graph_center_on(graph, root_id);
25420
25626
  priv.last_zoom = 1;
25421
25627
  yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
25422
25628
  });
@@ -25516,6 +25722,309 @@ function render_popover_body(gobj, node_data) {
25516
25722
  <span style="color:var(--bulma-text-strong, #1A1A1A); word-break:break-all;">${escapeHtml(String(value))}</span>
25517
25723
  </div>
25518
25724
  `).join("");
25725
+ if (is_remote(gobj)) $body.appendChild(build_traces_block(gobj, node_data));
25726
+ }
25727
+ /************************************************************
25728
+ * Whose tree this is.
25729
+ ************************************************************/
25730
+ function is_remote(gobj) {
25731
+ return gobj_read_str_attr(gobj, "source") === "remote";
25732
+ }
25733
+ /************************************************************
25734
+ * The TRACES block of a backend gobj's popover.
25735
+ *
25736
+ * Two columns of checkboxes, THIS gobj and every gobj of its
25737
+ * gclass, one row per level (trace_rows() in the model says
25738
+ * what each row holds). A box is an action: its change is
25739
+ * sent to the FSM, which publishes it to the host, and the
25740
+ * block stays locked until the host has loaded what the
25741
+ * backend says now -- the box shows the backend's state, not
25742
+ * the click.
25743
+ ************************************************************/
25744
+ var TRACES_NOTE_STYLE = "color:var(--bulma-text-weak, #6B7280); margin:4px 0;";
25745
+ var TRACES_CELL_STYLE = "padding:1px 4px; text-align:center;";
25746
+ function build_traces_block(gobj, d) {
25747
+ let priv = gobj.priv;
25748
+ let info = priv.trace_info[d.gclass] || null;
25749
+ let kids = [[
25750
+ "div",
25751
+ {
25752
+ class: "GOBJ_TREE_TRACES_HEAD",
25753
+ i18n: "traces",
25754
+ style: "font-weight:700; margin:8px 0 2px 0; padding-top:6px; border-top:1px solid var(--bulma-border-weak, #E5E7EB);"
25755
+ },
25756
+ t("traces")
25757
+ ]];
25758
+ if (!info) {
25759
+ kids.push([
25760
+ "div",
25761
+ {
25762
+ class: "GOBJ_TREE_TRACES_NOTE",
25763
+ i18n: "loading",
25764
+ style: TRACES_NOTE_STYLE
25765
+ },
25766
+ t("loading")
25767
+ ]);
25768
+ return createElement2([
25769
+ "div",
25770
+ { class: "GOBJ_TREE_TRACES" },
25771
+ kids
25772
+ ]);
25773
+ }
25774
+ if (info.error) {
25775
+ kids.push([
25776
+ "div",
25777
+ {
25778
+ class: "GOBJ_TREE_TRACES_ERROR",
25779
+ style: "color:var(--bulma-danger, #dc2626); margin:4px 0;"
25780
+ },
25781
+ text_node(info.error)
25782
+ ]);
25783
+ return createElement2([
25784
+ "div",
25785
+ { class: "GOBJ_TREE_TRACES" },
25786
+ kids
25787
+ ]);
25788
+ }
25789
+ let rows = trace_rows(d, info);
25790
+ let pending = !!priv.trace_pending;
25791
+ let trs = [];
25792
+ let group = "";
25793
+ for (let r of rows) {
25794
+ if (r.group !== group) {
25795
+ group = r.group;
25796
+ let $label = group === "gclass" ? text_node(d.gclass) : createElement2([
25797
+ "span",
25798
+ { i18n: "global" },
25799
+ t("global")
25800
+ ]);
25801
+ trs.push([
25802
+ "tr",
25803
+ { class: "GOBJ_TREE_TRACES_GROUP" },
25804
+ [[
25805
+ "td",
25806
+ {
25807
+ colspan: 3,
25808
+ style: "padding:4px 4px 1px 4px; font-weight:600; color:var(--bulma-text-weak, #6B7280);"
25809
+ },
25810
+ [$label]
25811
+ ]]
25812
+ ]);
25813
+ }
25814
+ let origin = null;
25815
+ if (r.origin === "global") origin = [
25816
+ "span",
25817
+ {
25818
+ class: "GOBJ_TREE_TRACES_ORIGIN",
25819
+ i18n: "global",
25820
+ style: "margin-left:6px; color:var(--bulma-text-weak, #6B7280);"
25821
+ },
25822
+ t("global")
25823
+ ];
25824
+ else if (r.origin === "gclass") origin = [
25825
+ "span",
25826
+ {
25827
+ class: "GOBJ_TREE_TRACES_ORIGIN",
25828
+ i18n: "gclass",
25829
+ style: "margin-left:6px; color:var(--bulma-text-weak, #6B7280);"
25830
+ },
25831
+ t("gclass")
25832
+ ];
25833
+ let $level = createElement2([
25834
+ "td",
25835
+ {
25836
+ class: "GOBJ_TREE_TRACES_LEVEL",
25837
+ style: "padding:1px 4px; word-break:break-all;"
25838
+ },
25839
+ []
25840
+ ]);
25841
+ $level.appendChild(text_node(r.level));
25842
+ if (origin) $level.appendChild(createElement2(origin));
25843
+ $level.setAttribute("title", r.description);
25844
+ trs.push([
25845
+ "tr",
25846
+ { class: "GOBJ_TREE_TRACES_ROW" },
25847
+ [
25848
+ $level,
25849
+ [
25850
+ "td",
25851
+ { style: TRACES_CELL_STYLE },
25852
+ [trace_checkbox(gobj, "gobj", r.level, r.gobj_on, pending || r.gobj_locked)]
25853
+ ],
25854
+ [
25855
+ "td",
25856
+ { style: TRACES_CELL_STYLE },
25857
+ [trace_checkbox(gobj, "gclass", r.level, r.gclass_on, pending || r.gclass_locked)]
25858
+ ]
25859
+ ]
25860
+ ]);
25861
+ }
25862
+ kids.push([
25863
+ "table",
25864
+ {
25865
+ class: "GOBJ_TREE_TRACES_TABLE",
25866
+ style: "width:100%; border-collapse:collapse;"
25867
+ },
25868
+ [[
25869
+ "thead",
25870
+ {},
25871
+ [[
25872
+ "tr",
25873
+ {},
25874
+ [
25875
+ [
25876
+ "th",
25877
+ {
25878
+ i18n: "level",
25879
+ style: "padding:1px 4px; text-align:left;"
25880
+ },
25881
+ t("level")
25882
+ ],
25883
+ [
25884
+ "th",
25885
+ {
25886
+ i18n: "this gobj",
25887
+ style: TRACES_CELL_STYLE
25888
+ },
25889
+ t("this gobj")
25890
+ ],
25891
+ [
25892
+ "th",
25893
+ {
25894
+ i18n: "all of the gclass",
25895
+ style: TRACES_CELL_STYLE
25896
+ },
25897
+ t("all of the gclass")
25898
+ ]
25899
+ ]
25900
+ ]]
25901
+ ], [
25902
+ "tbody",
25903
+ {},
25904
+ trs
25905
+ ]]
25906
+ ]);
25907
+ kids.push([
25908
+ "div",
25909
+ {
25910
+ class: "GOBJ_TREE_TRACES_NOTE",
25911
+ i18n: "gclass traces survive a restart, gobj traces end with the yuno",
25912
+ style: TRACES_NOTE_STYLE
25913
+ },
25914
+ t("gclass traces survive a restart, gobj traces end with the yuno")
25915
+ ]);
25916
+ let none_gobj = pending || own_trace_levels(rows, "gobj").length === 0;
25917
+ let none_gclass = pending || own_trace_levels(rows, "gclass").length === 0;
25918
+ let btn_style = "padding:0 8px; height:22px; font-size:11px; white-space:nowrap;";
25919
+ let clear = (scope) => {
25920
+ return { click: (evt) => {
25921
+ evt.stopPropagation();
25922
+ gobj_send_event(gobj, "EV_TRACES_CLEARED", { scope }, gobj);
25923
+ } };
25924
+ };
25925
+ let $clear_gobj = createElement2([
25926
+ "button",
25927
+ {
25928
+ type: "button",
25929
+ class: "GOBJ_TREE_TRACES_CLEAR_GOBJ button is-small",
25930
+ style: btn_style,
25931
+ i18n: "remove the traces of this gobj",
25932
+ title: t("remove the traces of this gobj"),
25933
+ "data-i18n-title": "remove the traces of this gobj",
25934
+ "aria-label": t("remove the traces of this gobj"),
25935
+ "data-i18n-aria-label": "remove the traces of this gobj"
25936
+ },
25937
+ t("remove the traces of this gobj"),
25938
+ clear("gobj")
25939
+ ]);
25940
+ let $clear_gclass = createElement2([
25941
+ "button",
25942
+ {
25943
+ type: "button",
25944
+ class: "GOBJ_TREE_TRACES_CLEAR_GCLASS button is-small",
25945
+ style: btn_style,
25946
+ i18n: "remove the traces of the gclass",
25947
+ title: t("remove the traces of the gclass"),
25948
+ "data-i18n-title": "remove the traces of the gclass",
25949
+ "aria-label": t("remove the traces of the gclass"),
25950
+ "data-i18n-aria-label": "remove the traces of the gclass"
25951
+ },
25952
+ t("remove the traces of the gclass"),
25953
+ clear("gclass")
25954
+ ]);
25955
+ $clear_gobj.disabled = none_gobj;
25956
+ $clear_gclass.disabled = none_gclass;
25957
+ kids.push([
25958
+ "div",
25959
+ {
25960
+ class: "GOBJ_TREE_TRACES_TOOLS",
25961
+ style: "display:flex; flex-wrap:wrap; gap:4px; margin-top:4px;"
25962
+ },
25963
+ [$clear_gobj, $clear_gclass]
25964
+ ]);
25965
+ return createElement2([
25966
+ "div",
25967
+ { class: "GOBJ_TREE_TRACES" },
25968
+ kids
25969
+ ]);
25970
+ }
25971
+ function trace_checkbox(gobj, scope, level, on, locked) {
25972
+ let $cb = null;
25973
+ if (scope === "gobj") $cb = createElement2(["input", {
25974
+ type: "checkbox",
25975
+ class: "GOBJ_TREE_TRACE_GOBJ",
25976
+ title: t("this gobj"),
25977
+ "data-i18n-title": "this gobj",
25978
+ "aria-label": t("this gobj"),
25979
+ "data-i18n-aria-label": "this gobj"
25980
+ }]);
25981
+ else $cb = createElement2(["input", {
25982
+ type: "checkbox",
25983
+ class: "GOBJ_TREE_TRACE_GCLASS",
25984
+ title: t("all of the gclass"),
25985
+ "data-i18n-title": "all of the gclass",
25986
+ "aria-label": t("all of the gclass"),
25987
+ "data-i18n-aria-label": "all of the gclass"
25988
+ }]);
25989
+ $cb.setAttribute("data-level", level);
25990
+ $cb.checked = !!on;
25991
+ $cb.disabled = !!locked;
25992
+ $cb.addEventListener("change", (evt) => {
25993
+ evt.stopPropagation();
25994
+ gobj_send_event(gobj, "EV_TRACE_TOGGLED", {
25995
+ scope,
25996
+ level,
25997
+ set: !!evt.target.checked
25998
+ }, gobj);
25999
+ });
26000
+ return $cb;
26001
+ }
26002
+ /************************************************************
26003
+ * Rebuild the graph and leave the popover where it was, on
26004
+ * the same gobj -- by full name, the node ids are new. A
26005
+ * reader who just ticked a trace is still reading that card.
26006
+ ************************************************************/
26007
+ function reload_keeping_popover(gobj, opts) {
26008
+ let priv = gobj.priv;
26009
+ let $popover = priv.$popover;
26010
+ let keep = priv.popover_node && $popover && $popover.style.display === "block" ? priv.popover_node.full_name : null;
26011
+ let left = $popover ? $popover.style.left : "";
26012
+ let top = $popover ? $popover.style.top : "";
26013
+ refresh_tree(gobj, opts);
26014
+ if (!keep || !priv.node_by_id) return;
26015
+ for (let id of Object.keys(priv.node_by_id)) {
26016
+ let d = priv.node_by_id[id];
26017
+ if (d.full_name === keep) {
26018
+ priv.popover_node = d;
26019
+ priv.$popover_title.textContent = d.short_name || d.gclass + (d.name ? "^" + d.name : "");
26020
+ priv.$popover_title.title = priv.$popover_title.textContent;
26021
+ render_popover_body(gobj, d);
26022
+ $popover.style.left = left;
26023
+ $popover.style.top = top;
26024
+ $popover.style.display = "block";
26025
+ return;
26026
+ }
26027
+ }
25519
26028
  }
25520
26029
  /************************************************************
25521
26030
  * Show popover next to the click position.
@@ -25840,6 +26349,10 @@ function ac_find_nodes$2(gobj, event, kw, src) {
25840
26349
  }
25841
26350
  function ac_refresh$3(gobj, event, kw, src) {
25842
26351
  save_view_state(gobj);
26352
+ if (is_remote(gobj)) {
26353
+ gobj_publish_event(gobj, "EV_TREE_WANTED", {});
26354
+ return 0;
26355
+ }
25843
26356
  refresh_tree(gobj);
25844
26357
  return 0;
25845
26358
  }
@@ -26099,6 +26612,7 @@ function ac_node_click$3(gobj, event, kw, src) {
26099
26612
  let client_x = kw.client_x || 0;
26100
26613
  let client_y = kw.client_y || 0;
26101
26614
  show_popover(gobj, node_data, client_x, client_y);
26615
+ if (is_remote(gobj)) gobj_publish_event(gobj, "EV_TRACE_INFO_WANTED", { gclass: node_data.gclass });
26102
26616
  return 0;
26103
26617
  }
26104
26618
  /************************************************************
@@ -26153,23 +26667,45 @@ function ac_hide$5(gobj, event, kw, src) {
26153
26667
  * first rather than stacking windows nobody closes.
26154
26668
  ************************************************************/
26155
26669
  function ac_open_gclass(gobj, event, kw, src) {
26156
- let priv = gobj.priv;
26157
- let node_data = priv.popover_node;
26670
+ let node_data = gobj.priv.popover_node;
26158
26671
  if (!node_data || !node_data.gclass) {
26159
26672
  log_error(`${gobj_short_name(gobj)}: EV_OPEN_GCLASS with no node`);
26160
26673
  return -1;
26161
26674
  }
26675
+ if (is_remote(gobj)) {
26676
+ gobj_publish_event(gobj, "EV_GCLASS_WANTED", { gclass: node_data.gclass });
26677
+ return 0;
26678
+ }
26679
+ open_gclass_window(gobj, node_data.gclass, null, node_data.state || "");
26680
+ return 0;
26681
+ }
26682
+ /************************************************************
26683
+ * remote: the `view-gclass` answer the host fetched.
26684
+ ************************************************************/
26685
+ function ac_gclass_description(gobj, event, kw, src) {
26686
+ let priv = gobj.priv;
26687
+ if (!kw || !kw.gclass || !kw.description || typeof kw.description !== "object") {
26688
+ log_error(`${gobj_short_name(gobj)}: EV_GCLASS_DESCRIPTION without a gclass description`);
26689
+ return -1;
26690
+ }
26691
+ let d = priv.popover_node;
26692
+ open_gclass_window(gobj, kw.gclass, kw.description, d && d.gclass === kw.gclass ? d.state || "" : "");
26693
+ return 0;
26694
+ }
26695
+ function open_gclass_window(gobj, gclass, description, state) {
26696
+ let priv = gobj.priv;
26162
26697
  close_gclass_view(priv.gclass_view);
26163
26698
  priv.gclass_view = null;
26164
- priv.gclass_view = open_gclass_view(gobj, node_data.gclass, {
26165
- title_prefix: gobj_yuno_name() || "",
26166
- current_state: node_data.state || "",
26699
+ let opts = {
26700
+ title_prefix: is_remote(gobj) ? gobj_read_str_attr(gobj, "yuno_name") || "" : gobj_yuno_name() || "",
26701
+ current_state: state,
26167
26702
  on_close: () => {
26168
26703
  if (gobj_is_destroying(gobj)) return;
26169
26704
  gobj_send_event(gobj, "EV_GCLASS_CLOSED", {}, gobj);
26170
26705
  }
26171
- });
26172
- return 0;
26706
+ };
26707
+ if (description) opts.description = description;
26708
+ priv.gclass_view = open_gclass_view(gobj, gclass, opts);
26173
26709
  }
26174
26710
  /************************************************************
26175
26711
  * The reader dismissed the gclass window (its own ✕).
@@ -26183,6 +26719,99 @@ function ac_gclass_closed(gobj, event, kw, src) {
26183
26719
  return 0;
26184
26720
  }
26185
26721
  /************************************************************
26722
+ * remote: the host loaded the tree (`view-gobj-tree`).
26723
+ *
26724
+ * The first one is framed like any opening; the next ones
26725
+ * keep the camera and the card the reader is on.
26726
+ ************************************************************/
26727
+ function ac_load_tree(gobj, event, kw, src) {
26728
+ let priv = gobj.priv;
26729
+ if (!is_remote(gobj)) {
26730
+ log_error(`${gobj_short_name(gobj)}: EV_LOAD_TREE on a tree whose source is not remote`);
26731
+ return -1;
26732
+ }
26733
+ let root = describe_backend_tree(kw && kw.tree);
26734
+ if (!root) {
26735
+ log_warning(`${gobj_short_name(gobj)}: what was loaded is not a view-gobj-tree answer`);
26736
+ return -1;
26737
+ }
26738
+ let first = !priv.remote_root;
26739
+ priv.remote_root = root;
26740
+ priv.trace_pending = false;
26741
+ reload_keeping_popover(gobj, first ? {} : { preserve_view: true });
26742
+ return 0;
26743
+ }
26744
+ /************************************************************
26745
+ * remote: the trace levels of a gclass, as the backend has
26746
+ * them now (or why they could not be read).
26747
+ ************************************************************/
26748
+ function ac_trace_info(gobj, event, kw, src) {
26749
+ let priv = gobj.priv;
26750
+ if (!kw || !kw.gclass) {
26751
+ log_error(`${gobj_short_name(gobj)}: EV_TRACE_INFO without a gclass`);
26752
+ return -1;
26753
+ }
26754
+ let list = (x) => Array.isArray(x) ? x : [];
26755
+ priv.trace_info[kw.gclass] = {
26756
+ gclass_levels: kw.gclass_levels || {},
26757
+ global_levels: kw.global_levels || {},
26758
+ gclass_on: list(kw.gclass_on),
26759
+ global_on: list(kw.global_on),
26760
+ error: kw.error || ""
26761
+ };
26762
+ priv.trace_pending = false;
26763
+ let d = priv.popover_node;
26764
+ if (d && d.gclass === kw.gclass && priv.$popover && priv.$popover.style.display === "block") render_popover_body(gobj, d);
26765
+ return 0;
26766
+ }
26767
+ /************************************************************
26768
+ * A box of the TRACES block was ticked or cleared.
26769
+ ************************************************************/
26770
+ function ac_trace_toggled(gobj, event, kw, src) {
26771
+ let d = gobj.priv.popover_node;
26772
+ if (!is_remote(gobj) || !d) {
26773
+ log_error(`${gobj_short_name(gobj)}: a trace set with no backend card open`);
26774
+ return -1;
26775
+ }
26776
+ if (!kw.level || kw.scope !== "gobj" && kw.scope !== "gclass") {
26777
+ log_error(`${gobj_short_name(gobj)}: a trace set of no level or scope: '${kw.scope}' '${kw.level}'`);
26778
+ return -1;
26779
+ }
26780
+ set_trace_levels(gobj, d, kw.scope, [kw.level], !!kw.set);
26781
+ return 0;
26782
+ }
26783
+ /************************************************************
26784
+ * "Remove the traces" of the gobj or of its gclass: every
26785
+ * level that scope holds on its own.
26786
+ ************************************************************/
26787
+ function ac_traces_cleared(gobj, event, kw, src) {
26788
+ let priv = gobj.priv;
26789
+ let d = priv.popover_node;
26790
+ if (!is_remote(gobj) || !d) {
26791
+ log_error(`${gobj_short_name(gobj)}: traces removed with no backend card open`);
26792
+ return -1;
26793
+ }
26794
+ let levels = own_trace_levels(trace_rows(d, priv.trace_info[d.gclass]), kw.scope);
26795
+ if (!levels.length) {
26796
+ log_error(`${gobj_short_name(gobj)}: no ${kw.scope} trace of ${d.full_name} to remove`);
26797
+ return -1;
26798
+ }
26799
+ set_trace_levels(gobj, d, kw.scope, levels, false);
26800
+ return 0;
26801
+ }
26802
+ function set_trace_levels(gobj, d, scope, levels, set) {
26803
+ let priv = gobj.priv;
26804
+ priv.trace_pending = true;
26805
+ render_popover_body(gobj, d);
26806
+ gobj_publish_event(gobj, "EV_SET_TRACE_LEVEL", {
26807
+ scope,
26808
+ gobj: d.full_name,
26809
+ gclass: d.gclass,
26810
+ levels,
26811
+ set
26812
+ });
26813
+ }
26814
+ /************************************************************
26186
26815
  * The app switched language.
26187
26816
  *
26188
26817
  * A rebuild, not a re-translation: the words live inside the
@@ -26213,28 +26842,7 @@ function create_gclass$9(gclass_name) {
26213
26842
  log_error(`GClass ALREADY created: ${gclass_name}`);
26214
26843
  return -1;
26215
26844
  }
26216
- __gclass__$9 = gclass_create(gclass_name, [
26217
- ["EV_FIND_NODES", 0],
26218
- ["EV_REFRESH", 0],
26219
- ["EV_THEME", 0],
26220
- ["EV_CHANGE_LAYOUT", 0],
26221
- ["EV_TOGGLE_COLLAPSE", 0],
26222
- ["EV_EXPAND_ALL", 0],
26223
- ["EV_COLLAPSE_ALL", 0],
26224
- ["EV_ZOOM_IN", 0],
26225
- ["EV_ZOOM_OUT", 0],
26226
- ["EV_ZOOM_RESET", 0],
26227
- ["EV_CENTER", 0],
26228
- ["EV_NODE_CLICK", 0],
26229
- ["EV_TOGGLE_ANCHOR", 0],
26230
- ["EV_CENTER_ANCHOR", 0],
26231
- ["EV_RESIZE", 0],
26232
- ["EV_SHOW", 0],
26233
- ["EV_HIDE", 0],
26234
- ["EV_OPEN_GCLASS", 0],
26235
- ["EV_GCLASS_CLOSED", 0],
26236
- ["EV_LANGUAGE_CHANGED", 0]
26237
- ], [["ST_IDLE", [
26845
+ const states = [["ST_IDLE", [
26238
26846
  [
26239
26847
  "EV_FIND_NODES",
26240
26848
  ac_find_nodes$2,
@@ -26334,8 +26942,65 @@ function create_gclass$9(gclass_name) {
26334
26942
  "EV_LANGUAGE_CHANGED",
26335
26943
  ac_language_changed$5,
26336
26944
  null
26945
+ ],
26946
+ [
26947
+ "EV_LOAD_TREE",
26948
+ ac_load_tree,
26949
+ null
26950
+ ],
26951
+ [
26952
+ "EV_TRACE_INFO",
26953
+ ac_trace_info,
26954
+ null
26955
+ ],
26956
+ [
26957
+ "EV_TRACE_TOGGLED",
26958
+ ac_trace_toggled,
26959
+ null
26960
+ ],
26961
+ [
26962
+ "EV_TRACES_CLEARED",
26963
+ ac_traces_cleared,
26964
+ null
26965
+ ],
26966
+ [
26967
+ "EV_GCLASS_DESCRIPTION",
26968
+ ac_gclass_description,
26969
+ null
26337
26970
  ]
26338
- ]]], gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
26971
+ ]]];
26972
+ const event_types = [
26973
+ ["EV_FIND_NODES", 0],
26974
+ ["EV_REFRESH", 0],
26975
+ ["EV_THEME", 0],
26976
+ ["EV_CHANGE_LAYOUT", 0],
26977
+ ["EV_TOGGLE_COLLAPSE", 0],
26978
+ ["EV_EXPAND_ALL", 0],
26979
+ ["EV_COLLAPSE_ALL", 0],
26980
+ ["EV_ZOOM_IN", 0],
26981
+ ["EV_ZOOM_OUT", 0],
26982
+ ["EV_ZOOM_RESET", 0],
26983
+ ["EV_CENTER", 0],
26984
+ ["EV_NODE_CLICK", 0],
26985
+ ["EV_TOGGLE_ANCHOR", 0],
26986
+ ["EV_CENTER_ANCHOR", 0],
26987
+ ["EV_RESIZE", 0],
26988
+ ["EV_SHOW", 0],
26989
+ ["EV_HIDE", 0],
26990
+ ["EV_OPEN_GCLASS", 0],
26991
+ ["EV_GCLASS_CLOSED", 0],
26992
+ ["EV_LANGUAGE_CHANGED", 0],
26993
+ ["EV_LOAD_TREE", 0],
26994
+ ["EV_TRACE_INFO", 0],
26995
+ ["EV_TRACE_TOGGLED", 0],
26996
+ ["EV_TRACES_CLEARED", 0],
26997
+ ["EV_GCLASS_DESCRIPTION", 0],
26998
+ ["EV_TREE_WANTED", event_flag_t.EVF_OUTPUT_EVENT],
26999
+ ["EV_TRACE_INFO_WANTED", event_flag_t.EVF_OUTPUT_EVENT],
27000
+ ["EV_SET_TRACE_LEVEL", event_flag_t.EVF_OUTPUT_EVENT],
27001
+ ["EV_GCLASS_WANTED", event_flag_t.EVF_OUTPUT_EVENT]
27002
+ ];
27003
+ __gclass__$9 = gclass_create(gclass_name, event_types, states, gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
26339
27004
  if (!__gclass__$9) return -1;
26340
27005
  return 0;
26341
27006
  }
@@ -42844,8 +43509,8 @@ function _objectWithoutProperties(e, t) {
42844
43509
  /*!
42845
43510
  * @antv/g-lite
42846
43511
  * @description A core module for rendering engine implements DOM API.
42847
- * @version 2.7.0
42848
- * @date 12/24/2025, 11:55:20 AM
43512
+ * @version 2.7.2
43513
+ * @date 10/16/2026, 2:34:22 AM
42849
43514
  * @author AntVis
42850
43515
  * @docs https://g.antv.antgroup.com/
42851
43516
  */
@@ -43316,12 +43981,13 @@ function getAngle(angle) {
43316
43981
  }
43317
43982
  var $vec3$3 = create$3();
43318
43983
  function createVec3(x) {
43984
+ var _x$, _x$2, _x$3, _x$4;
43319
43985
  var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
43320
43986
  var z = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
43321
43987
  var clone$2 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
43322
43988
  if (Array.isArray(x) && x.length === 3) return clone$2 ? clone(x) : copy$3($vec3$3, x);
43323
43989
  if (isNumber(x)) return clone$2 ? fromValues$2(x, y, z) : set$3($vec3$3, x, y, z);
43324
- return clone$2 ? fromValues$2(x[0], x[1] || y, x[2] || z) : set$3($vec3$3, x[0], x[1] || y, x[2] || z);
43990
+ return clone$2 ? fromValues$2(x[0], (_x$ = x[1]) !== null && _x$ !== void 0 ? _x$ : y, (_x$2 = x[2]) !== null && _x$2 !== void 0 ? _x$2 : z) : set$3($vec3$3, x[0], (_x$3 = x[1]) !== null && _x$3 !== void 0 ? _x$3 : y, (_x$4 = x[2]) !== null && _x$4 !== void 0 ? _x$4 : z);
43325
43991
  }
43326
43992
  var DEG_RAD = Math.PI / 180;
43327
43993
  function deg2rad(deg) {
@@ -49580,7 +50246,7 @@ var FederatedEvent = /*#__PURE__*/ function() {
49580
50246
  }
49581
50247
  ]);
49582
50248
  }();
49583
- var FederatedMouseEvent = /*#__PURE__*/ function(_ref) {
50249
+ var FederatedMouseEvent = /*#__PURE__*/ function(_FederatedEvent) {
49584
50250
  function FederatedMouseEvent() {
49585
50251
  var _this;
49586
50252
  _classCallCheck(this, FederatedMouseEvent);
@@ -49616,7 +50282,7 @@ var FederatedMouseEvent = /*#__PURE__*/ function(_ref) {
49616
50282
  _this.screen = new Point();
49617
50283
  return _this;
49618
50284
  }
49619
- _inherits(FederatedMouseEvent, _ref);
50285
+ _inherits(FederatedMouseEvent, _FederatedEvent);
49620
50286
  return _createClass(FederatedMouseEvent, [
49621
50287
  {
49622
50288
  key: "clientX",
@@ -54269,9 +54935,18 @@ var PrepareRendererPlugin = /*#__PURE__*/ function() {
54269
54935
  renderingService.dirty();
54270
54936
  };
54271
54937
  var handleBoundsChanged = function handleBoundsChanged(e) {
54272
- var _this$mutationRecords;
54273
54938
  var records = e.detail;
54274
- (_this$mutationRecords = _this.mutationRecords).push.apply(_this$mutationRecords, _toConsumableArray(records));
54939
+ var _iterator = _createForOfIteratorHelper(records), _step;
54940
+ try {
54941
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
54942
+ var record = _step.value;
54943
+ _this.mutationRecords.push(record);
54944
+ }
54945
+ } catch (err) {
54946
+ _iterator.e(err);
54947
+ } finally {
54948
+ _iterator.f();
54949
+ }
54275
54950
  renderingService.dirty();
54276
54951
  };
54277
54952
  var handleMounted = function handleMounted(e) {
@@ -55272,8 +55947,8 @@ PERFORMANCE OF THIS SOFTWARE.
55272
55947
  /*!
55273
55948
  * @antv/g
55274
55949
  * @description A core module for rendering engine implements DOM API.
55275
- * @version 6.3.1
55276
- * @date 12/24/2025, 11:55:39 AM
55950
+ * @version 6.3.3
55951
+ * @date 10/16/2026, 2:34:40 AM
55277
55952
  * @author AntVis
55278
55953
  * @docs https://g.antv.antgroup.com/
55279
55954
  */
@@ -62435,74 +63110,43 @@ var Animation = /*#__PURE__*/ function() {
62435
63110
  /**
62436
63111
  * https://github.com/gre/bezier-easing
62437
63112
  * BezierEasing - use bezier curve for transition easing function
62438
- * by Gaëtan Renaudeau 2014 - 2015 – MIT License
63113
+ * by Gaëtan Renaudeau 2014 - 2026 – MIT License
62439
63114
  */
62440
- var NEWTON_ITERATIONS = 4;
62441
- var NEWTON_MIN_SLOPE = .001;
62442
- var SUBDIVISION_PRECISION = 1e-7;
62443
- var SUBDIVISION_MAX_ITERATIONS = 10;
62444
- var kSplineTableSize = 11;
62445
- var kSampleStepSize = 1 / (kSplineTableSize - 1);
62446
- var float32ArraySupported = typeof Float32Array === "function";
62447
- var A = function A(aA1, aA2) {
62448
- return 1 - 3 * aA2 + 3 * aA1;
62449
- };
62450
- var B = function B(aA1, aA2) {
62451
- return 3 * aA2 - 6 * aA1;
62452
- };
62453
- var C = function C(aA1) {
62454
- return 3 * aA1;
62455
- };
62456
- var calcBezier = function calcBezier(aT, aA1, aA2) {
62457
- return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
62458
- };
62459
- var getSlope = function getSlope(aT, aA1, aA2) {
62460
- return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1);
62461
- };
62462
- var binarySubdivide = function binarySubdivide(aX, aA, aB, mX1, mX2) {
62463
- var currentX;
62464
- var currentT;
62465
- var i = 0;
62466
- do {
62467
- currentT = aA + (aB - aA) / 2;
62468
- currentX = calcBezier(currentT, mX1, mX2) - aX;
62469
- if (currentX > 0) aB = currentT;
62470
- else aA = currentT;
62471
- } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
62472
- return currentT;
62473
- };
62474
- var newtonRaphsonIterate = function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
62475
- for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
62476
- var currentSlope = getSlope(aGuessT, mX1, mX2);
62477
- if (currentSlope === 0) return aGuessT;
62478
- var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
62479
- aGuessT -= currentX / currentSlope;
62480
- }
62481
- return aGuessT;
63115
+ var solveTForX = function solveTForX(x, a, b, c) {
63116
+ var j = 1 / Math.max(c, Math.sqrt(x));
63117
+ var k = x * j;
63118
+ var l = k * j;
63119
+ var s = c * j;
63120
+ var q = b * l;
63121
+ var m = s * s + q;
63122
+ var h = -s * (s * s + 1.5 * q) - a * k * l;
63123
+ var D = h * h - m * m * m;
63124
+ var v;
63125
+ if (m === 0 || D > 1e-12 * h * h) {
63126
+ var U = -Math.cbrt(h < 0 ? h - Math.sqrt(D) : h + Math.sqrt(D));
63127
+ v = U + m / U || 0;
63128
+ } else {
63129
+ var r = Math.sqrt(m);
63130
+ v = 2 * r * Math.cos(Math.acos(Math.max(-1, Math.min(1, -h / (m * r)))) / 3);
63131
+ }
63132
+ return Math.min(1, k / (v + s));
62482
63133
  };
62483
63134
  var bezier = function bezier(mX1, mY1, mX2, mY2) {
62484
63135
  if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) throw new Error("bezier x values must be in [0, 1] range");
62485
63136
  if (mX1 === mY1 && mX2 === mY2) return function(t) {
62486
63137
  return t;
62487
63138
  };
62488
- var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
62489
- for (var i = 0; i < kSplineTableSize; ++i) sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
62490
- var getTForX = function getTForX(aX) {
62491
- var intervalStart = 0;
62492
- var currentSample = 1;
62493
- var lastSample = kSplineTableSize - 1;
62494
- for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) intervalStart += kSampleStepSize;
62495
- --currentSample;
62496
- var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
62497
- var guessForT = intervalStart + dist * kSampleStepSize;
62498
- var initialSlope = getSlope(guessForT, mX1, mX2);
62499
- if (initialSlope >= NEWTON_MIN_SLOPE) return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
62500
- if (initialSlope === 0) return guessForT;
62501
- return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
62502
- };
63139
+ var a = (3 * mX1 - 3 * mX2 + 1) / 2;
63140
+ var b = mX2 - 2 * mX1;
63141
+ var c = mX1;
63142
+ var ay = 3 * mY1 - 3 * mY2 + 1;
63143
+ var by = 3 * (mY2 - 2 * mY1);
63144
+ var cy = 3 * mY1;
62503
63145
  return function(t) {
62504
- if (t === 0 || t === 1) return t;
62505
- return calcBezier(getTForX(t), mY1, mY2);
63146
+ if (t <= 0) return 0;
63147
+ if (t >= 1) return 1;
63148
+ var u = solveTForX(t, a, b, c);
63149
+ return ((ay * u + by) * u + cy) * u;
62506
63150
  };
62507
63151
  };
62508
63152
  var convertToDash = function convertToDash(str) {
@@ -63244,9 +63888,11 @@ var AnimationTimeline = /*#__PURE__*/ function() {
63244
63888
  if (t < Number(_this.currentTime)) t = Number(_this.currentTime);
63245
63889
  _this.animations.sort(compareAnimations);
63246
63890
  _this.animations = _this.tick(t, true, _this.animations)[0];
63891
+ _this.updateAnimationsPromises();
63247
63892
  processing.forEach(function(entry) {
63248
63893
  entry[1](t);
63249
63894
  });
63895
+ _this.updateAnimationsPromises();
63250
63896
  _this.applyPendingEffects();
63251
63897
  };
63252
63898
  this.document = document;
@@ -63356,18 +64002,13 @@ var AnimationTimeline = /*#__PURE__*/ function() {
63356
64002
  {
63357
64003
  key: "requestAnimationFrame",
63358
64004
  value: function requestAnimationFrame(f) {
63359
- var _this3 = this;
63360
- return this.rAF(function(x) {
63361
- _this3.updateAnimationsPromises();
63362
- f(x);
63363
- _this3.updateAnimationsPromises();
63364
- });
64005
+ return this.rAF(f);
63365
64006
  }
63366
64007
  },
63367
64008
  {
63368
64009
  key: "tick",
63369
64010
  value: function tick(t, isAnimationFrame, updatingAnimations) {
63370
- var _this4 = this, _this$pendingEffects, _this$pendingEffects2;
64011
+ var _this3 = this, _this$pendingEffects, _this$pendingEffects2;
63371
64012
  this.inTick = true;
63372
64013
  this.hasRestartedThisFrame = false;
63373
64014
  this.currentTime = t;
@@ -63385,7 +64026,7 @@ var AnimationTimeline = /*#__PURE__*/ function() {
63385
64026
  newPendingEffects.push(animation.effect);
63386
64027
  animation.markTarget();
63387
64028
  }
63388
- if (animation._needsTick) _this4.ticking = true;
64029
+ if (animation._needsTick) _this3.ticking = true;
63389
64030
  var alive = animation._inEffect || animation._needsTick;
63390
64031
  animation._inTimeline = alive;
63391
64032
  if (alive) activeAnimations.push(animation);