@gridsheet/preact-core 2.0.5 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -506,21 +506,17 @@ const isXSheetFocused = (store) => {
506
506
  };
507
507
  const getCellRectPositions = (table, { y, x }) => {
508
508
  var _a, _b;
509
- let { width, height } = table.getRectSize({
510
- top: 1,
511
- left: 1,
512
- bottom: y,
513
- right: x
514
- });
515
- width += table.headerWidth;
516
- height += table.headerHeight;
517
- const w = ((_a = table.getCellByPoint({ y: 0, x }, "SYSTEM")) == null ? void 0 : _a.width) || DEFAULT_WIDTH;
518
- const h2 = ((_b = table.getCellByPoint({ y, x: 0 }, "SYSTEM")) == null ? void 0 : _b.height) || DEFAULT_HEIGHT;
509
+ const colCell = table.getCellByPoint({ y: 0, x }, "SYSTEM");
510
+ const rowCell = table.getCellByPoint({ y, x: 0 }, "SYSTEM");
511
+ const left = ((_a = colCell == null ? void 0 : colCell.system) == null ? void 0 : _a.offsetLeft) ?? 0;
512
+ const top = ((_b = rowCell == null ? void 0 : rowCell.system) == null ? void 0 : _b.offsetTop) ?? 0;
513
+ const w = (colCell == null ? void 0 : colCell.width) || DEFAULT_WIDTH;
514
+ const h2 = (rowCell == null ? void 0 : rowCell.height) || DEFAULT_HEIGHT;
519
515
  return {
520
- top: height,
521
- left: width,
522
- bottom: height + h2,
523
- right: width + w,
516
+ top,
517
+ left,
518
+ bottom: top + h2,
519
+ right: left + w,
524
520
  width: w,
525
521
  height: h2
526
522
  };
@@ -7889,26 +7885,46 @@ class Table {
7889
7885
  return (this.wire.cellHead++).toString(36);
7890
7886
  }
7891
7887
  getRectSize({ top, left, bottom, right }) {
7892
- var _a, _b;
7893
- let width = 0, height = 0;
7894
- for (let x = left || 1; x < right; x++) {
7895
- width += ((_a = this.getCellByPoint({ y: 0, x }, "SYSTEM")) == null ? void 0 : _a.width) || DEFAULT_WIDTH;
7896
- }
7897
- for (let y = top || 1; y < bottom; y++) {
7898
- height += ((_b = this.getCellByPoint({ y, x: 0 }, "SYSTEM")) == null ? void 0 : _b.height) || DEFAULT_HEIGHT;
7899
- }
7888
+ var _a, _b, _c, _d;
7889
+ const l = left || 1;
7890
+ const t = top || 1;
7891
+ const colRightCell = this.getCellByPoint({ y: 0, x: right }, "SYSTEM");
7892
+ const colLeftCell = this.getCellByPoint({ y: 0, x: l }, "SYSTEM");
7893
+ const rowBottomCell = this.getCellByPoint({ y: bottom, x: 0 }, "SYSTEM");
7894
+ const rowTopCell = this.getCellByPoint({ y: t, x: 0 }, "SYSTEM");
7895
+ const rw = ((_a = colRightCell == null ? void 0 : colRightCell.system) == null ? void 0 : _a.offsetLeft) ?? 0;
7896
+ const lw = ((_b = colLeftCell == null ? void 0 : colLeftCell.system) == null ? void 0 : _b.offsetLeft) ?? 0;
7897
+ const rh = ((_c = rowBottomCell == null ? void 0 : rowBottomCell.system) == null ? void 0 : _c.offsetTop) ?? 0;
7898
+ const th = ((_d = rowTopCell == null ? void 0 : rowTopCell.system) == null ? void 0 : _d.offsetTop) ?? 0;
7899
+ const width = Math.max(0, rw - lw);
7900
+ const height = Math.max(0, rh - th);
7900
7901
  return { width, height };
7901
7902
  }
7902
7903
  setTotalSize() {
7903
- const { bottom, right } = this.area;
7904
- const { width, height } = this.getRectSize({
7905
- top: 1,
7906
- left: 1,
7907
- bottom: bottom + 1,
7908
- right: right + 1
7909
- });
7910
- this.totalWidth = width + this.headerWidth;
7911
- this.totalHeight = height + this.headerHeight;
7904
+ const numCols = this.getNumCols();
7905
+ const numRows = this.getNumRows();
7906
+ const headerW = this.headerWidth;
7907
+ const headerH = this.headerHeight;
7908
+ let accW = 0;
7909
+ for (let x = 1; x <= numCols; x++) {
7910
+ const cell = this.getCellByPoint({ y: 0, x }, "SYSTEM");
7911
+ const w = (cell == null ? void 0 : cell.width) || DEFAULT_WIDTH;
7912
+ if (cell == null ? void 0 : cell.system) {
7913
+ cell.system.offsetLeft = headerW + accW;
7914
+ }
7915
+ accW += w;
7916
+ }
7917
+ this.totalWidth = headerW + accW;
7918
+ let accH = 0;
7919
+ for (let y = 1; y <= numRows; y++) {
7920
+ const cell = this.getCellByPoint({ y, x: 0 }, "SYSTEM");
7921
+ const h2 = (cell == null ? void 0 : cell.height) || DEFAULT_HEIGHT;
7922
+ if (cell == null ? void 0 : cell.system) {
7923
+ cell.system.offsetTop = headerH + accH;
7924
+ }
7925
+ accH += h2;
7926
+ }
7927
+ this.totalHeight = headerH + accH;
7912
7928
  }
7913
7929
  refresh(relocate = false, resize = false) {
7914
7930
  this.incrementVersion();
@@ -9264,7 +9280,7 @@ const safePreventDefault = (e) => {
9264
9280
  e.preventDefault();
9265
9281
  }
9266
9282
  };
9267
- const Cell = memo(({ y, x, operationStyle }) => {
9283
+ const Cell = memo(({ y, x }) => {
9268
9284
  const rowId = y2r(y);
9269
9285
  const colId = x2c(x);
9270
9286
  const address = `${colId}${rowId}`;
@@ -9500,8 +9516,7 @@ const Cell = memo(({ y, x, operationStyle }) => {
9500
9516
  "data-address": address,
9501
9517
  className: `gs-cell ${among(selectingArea, { y, x }) ? "gs-selecting" : ""} ${pointed ? "gs-choosing" : ""} ${editing ? "gs-editing" : ""}`,
9502
9518
  style: {
9503
- ...cell == null ? void 0 : cell.style,
9504
- ...operationStyle
9519
+ ...cell == null ? void 0 : cell.style
9505
9520
  },
9506
9521
  onContextMenu,
9507
9522
  onDoubleClick,
@@ -10077,6 +10092,260 @@ const HeaderCellLeft = memo(({ y }) => {
10077
10092
  }
10078
10093
  );
10079
10094
  });
10095
+ const COLOR_POINTED = "#0077ff";
10096
+ const COLOR_SELECTED = "#0077ff";
10097
+ const SELECTING_FILL = "rgba(0, 128, 255, 0.2)";
10098
+ const COLOR_COPYING = "#0077ff";
10099
+ const COLOR_CUTTING = "#0077ff";
10100
+ const SEARCH_MATCHING_BACKGROUND = "rgba(0, 200, 100, 0.2)";
10101
+ const COLOR_SEARCH_MATCHING = "#00aa78";
10102
+ const COLOR_AUTOFILL = "#444444";
10103
+ const HEADER_COLORS = {
10104
+ light: {
10105
+ selecting: "rgba(0, 0, 0, 0.1)",
10106
+ choosing: "rgba(0, 0, 0, 0.2)",
10107
+ thSelecting: "rgba(0, 0, 0, 0.55)"
10108
+ },
10109
+ dark: {
10110
+ selecting: "rgba(255, 255, 255, 0.08)",
10111
+ choosing: "rgba(255, 255, 255, 0.18)",
10112
+ thSelecting: "rgba(255, 255, 255, 0.4)"
10113
+ }
10114
+ };
10115
+ const fillRect = (ctx, x, y, width, height, color) => {
10116
+ ctx.fillStyle = color;
10117
+ ctx.fillRect(x, y, width, height);
10118
+ };
10119
+ const drawRect = (ctx, x, y, width, height, color, lineWidth = 2, dashPattern = [], fillColor) => {
10120
+ if (fillColor) {
10121
+ ctx.fillStyle = fillColor;
10122
+ ctx.fillRect(x, y, width, height);
10123
+ }
10124
+ ctx.strokeStyle = color;
10125
+ ctx.lineWidth = lineWidth;
10126
+ ctx.setLineDash(dashPattern);
10127
+ ctx.strokeRect(x + lineWidth / 2, y + lineWidth / 2, width - lineWidth, height - lineWidth);
10128
+ ctx.setLineDash([]);
10129
+ };
10130
+ const drawAreaRectViewport = (ctx, table, scrollTop, scrollLeft, viewW, viewH, area, color, lineWidth = 2, dashPattern = [], fillColor) => {
10131
+ const { top, left, bottom, right } = area;
10132
+ if (top === -1 || left === -1 || bottom === -1 || right === -1) {
10133
+ return;
10134
+ }
10135
+ const topLeft = getCellRectPositions(table, { y: top, x: left });
10136
+ const bottomRight = getCellRectPositions(table, { y: bottom, x: right });
10137
+ const x1 = topLeft.left - scrollLeft;
10138
+ const y1 = topLeft.top - scrollTop;
10139
+ const x2 = bottomRight.right - scrollLeft;
10140
+ const y2 = bottomRight.bottom - scrollTop;
10141
+ if (x2 < 0 || x1 > viewW || y2 < 0 || y1 > viewH) {
10142
+ return;
10143
+ }
10144
+ drawRect(ctx, x1, y1, x2 - x1, y2 - y1, color, lineWidth, dashPattern, fillColor);
10145
+ };
10146
+ const CellStateOverlay = ({ refs = {} }) => {
10147
+ const { store } = useContext(Context);
10148
+ const {
10149
+ tableReactive,
10150
+ tabularRef,
10151
+ choosing,
10152
+ selectingZone,
10153
+ matchingCells,
10154
+ matchingCellIndex,
10155
+ autofillDraggingTo,
10156
+ topHeaderSelecting,
10157
+ leftHeaderSelecting,
10158
+ mode,
10159
+ dragging
10160
+ } = store;
10161
+ const table = tableReactive.current;
10162
+ const canvasRef = useRef(null);
10163
+ const rafIdRef = useRef(0);
10164
+ const storeRef = useRef(store);
10165
+ storeRef.current = store;
10166
+ const drawCanvas = useCallback(() => {
10167
+ if (!table || !tabularRef.current || !canvasRef.current) {
10168
+ return;
10169
+ }
10170
+ const canvas = canvasRef.current;
10171
+ const ctx = canvas.getContext("2d");
10172
+ if (!ctx) {
10173
+ return;
10174
+ }
10175
+ const container = tabularRef.current;
10176
+ const dpr = window.devicePixelRatio || 1;
10177
+ const w = container.clientWidth;
10178
+ const h2 = container.clientHeight;
10179
+ if (canvas.width !== w * dpr || canvas.height !== h2 * dpr) {
10180
+ canvas.style.width = `${w}px`;
10181
+ canvas.style.height = `${h2}px`;
10182
+ canvas.width = w * dpr;
10183
+ canvas.height = h2 * dpr;
10184
+ }
10185
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
10186
+ ctx.clearRect(0, 0, w, h2);
10187
+ const { wire } = table;
10188
+ const scrollTop = container.scrollTop;
10189
+ const scrollLeft = container.scrollLeft;
10190
+ const headerW = table.headerWidth;
10191
+ const headerH = table.headerHeight;
10192
+ ctx.save();
10193
+ ctx.beginPath();
10194
+ ctx.rect(headerW, headerH, w - headerW, h2 - headerH);
10195
+ ctx.clip();
10196
+ const selectingArea = zoneToArea(selectingZone);
10197
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h2, selectingArea, COLOR_SELECTED, 1, [], SELECTING_FILL);
10198
+ if (autofillDraggingTo) {
10199
+ const autofill = new Autofill(storeRef.current, autofillDraggingTo);
10200
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h2, autofill.wholeArea, COLOR_AUTOFILL, 1, [5, 5]);
10201
+ }
10202
+ {
10203
+ const { y, x } = choosing;
10204
+ if (y !== -1 && x !== -1) {
10205
+ const pos = getCellRectPositions(table, { y, x });
10206
+ const vx = pos.left - scrollLeft;
10207
+ const vy = pos.top - scrollTop;
10208
+ drawRect(ctx, vx, vy, pos.width, pos.height, COLOR_POINTED, 2, []);
10209
+ }
10210
+ }
10211
+ const { copyingSheetId, copyingZone, cutting } = wire;
10212
+ if (table.sheetId === copyingSheetId) {
10213
+ const copyingArea = zoneToArea(copyingZone);
10214
+ const color = cutting ? COLOR_CUTTING : COLOR_COPYING;
10215
+ const dashPattern = cutting ? [4, 4] : [6, 4];
10216
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h2, copyingArea, color, 2.5, dashPattern);
10217
+ }
10218
+ Object.entries(refs).forEach(([ref, i]) => {
10219
+ const palette = COLOR_PALETTE[i % COLOR_PALETTE.length];
10220
+ try {
10221
+ const refArea = table.rangeToArea(ref);
10222
+ drawAreaRectViewport(ctx, table, scrollTop, scrollLeft, w, h2, refArea, palette, 2, [5, 5]);
10223
+ } catch (e) {
10224
+ }
10225
+ });
10226
+ matchingCells.forEach((address, index) => {
10227
+ const { y, x } = a2p(address);
10228
+ const pos = getCellRectPositions(table, { y, x });
10229
+ const vx = pos.left - scrollLeft;
10230
+ const vy = pos.top - scrollTop;
10231
+ if (vx + pos.width < 0 || vx > w || vy + pos.height < 0 || vy > h2) {
10232
+ return;
10233
+ }
10234
+ const isCurrentMatch = index === matchingCellIndex;
10235
+ drawRect(
10236
+ ctx,
10237
+ vx,
10238
+ vy,
10239
+ pos.width,
10240
+ pos.height,
10241
+ isCurrentMatch ? COLOR_SEARCH_MATCHING : "transparent",
10242
+ isCurrentMatch ? 2 : 0,
10243
+ [],
10244
+ SEARCH_MATCHING_BACKGROUND
10245
+ );
10246
+ });
10247
+ ctx.restore();
10248
+ const headerColors = HEADER_COLORS[mode] || HEADER_COLORS.light;
10249
+ const numCols = table.getNumCols();
10250
+ const numRows = table.getNumRows();
10251
+ for (let x = 1; x <= numCols; x++) {
10252
+ let color = null;
10253
+ if (between({ start: selectingZone.startX, end: selectingZone.endX }, x)) {
10254
+ color = topHeaderSelecting ? headerColors.thSelecting : headerColors.selecting;
10255
+ }
10256
+ if (choosing.x === x) {
10257
+ color = headerColors.choosing;
10258
+ }
10259
+ if (!color) {
10260
+ continue;
10261
+ }
10262
+ const pos = getCellRectPositions(table, { y: 1, x });
10263
+ const left = pos.left - scrollLeft;
10264
+ if (left + pos.width < headerW || left > w) {
10265
+ continue;
10266
+ }
10267
+ fillRect(ctx, left, 0, pos.width, headerH, color);
10268
+ }
10269
+ for (let y = 1; y <= numRows; y++) {
10270
+ let color = null;
10271
+ if (between({ start: selectingZone.startY, end: selectingZone.endY }, y)) {
10272
+ color = leftHeaderSelecting ? headerColors.thSelecting : headerColors.selecting;
10273
+ }
10274
+ if (choosing.y === y) {
10275
+ color = headerColors.choosing;
10276
+ }
10277
+ if (!color) {
10278
+ continue;
10279
+ }
10280
+ const pos = getCellRectPositions(table, { y, x: 1 });
10281
+ const top = pos.top - scrollTop;
10282
+ if (top + pos.height < headerH || top > h2) {
10283
+ continue;
10284
+ }
10285
+ fillRect(ctx, 0, top, headerW, pos.height, color);
10286
+ }
10287
+ }, [
10288
+ table,
10289
+ tabularRef,
10290
+ choosing,
10291
+ selectingZone,
10292
+ matchingCells,
10293
+ matchingCellIndex,
10294
+ autofillDraggingTo,
10295
+ topHeaderSelecting,
10296
+ leftHeaderSelecting,
10297
+ mode,
10298
+ dragging,
10299
+ refs
10300
+ ]);
10301
+ const scheduleDrawCanvas = useCallback(() => {
10302
+ cancelAnimationFrame(rafIdRef.current);
10303
+ rafIdRef.current = requestAnimationFrame(drawCanvas);
10304
+ }, [drawCanvas]);
10305
+ const handleScroll = useCallback(() => {
10306
+ drawCanvas();
10307
+ }, [drawCanvas]);
10308
+ useEffect(() => {
10309
+ scheduleDrawCanvas();
10310
+ return () => cancelAnimationFrame(rafIdRef.current);
10311
+ }, [scheduleDrawCanvas]);
10312
+ useEffect(() => {
10313
+ const container = tabularRef.current;
10314
+ if (!container) {
10315
+ return;
10316
+ }
10317
+ container.addEventListener("scroll", handleScroll);
10318
+ return () => {
10319
+ container.removeEventListener("scroll", handleScroll);
10320
+ };
10321
+ }, [tabularRef, handleScroll]);
10322
+ return /* @__PURE__ */ jsx(
10323
+ "div",
10324
+ {
10325
+ style: {
10326
+ position: "sticky",
10327
+ top: 0,
10328
+ left: 0,
10329
+ width: 0,
10330
+ height: 0,
10331
+ overflow: "visible",
10332
+ pointerEvents: "none",
10333
+ zIndex: 10
10334
+ },
10335
+ children: /* @__PURE__ */ jsx(
10336
+ "canvas",
10337
+ {
10338
+ ref: canvasRef,
10339
+ className: "gs-cell-state-overlay",
10340
+ style: {
10341
+ pointerEvents: "none",
10342
+ display: "block"
10343
+ }
10344
+ }
10345
+ )
10346
+ }
10347
+ );
10348
+ };
10080
10349
  const Tabular = () => {
10081
10350
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
10082
10351
  const [palette, setPalette] = useState({});
@@ -10177,13 +10446,13 @@ const Tabular = () => {
10177
10446
  }
10178
10447
  setVirtualized(virtualize(table, tabularRef.current));
10179
10448
  }, [tabularRef.current, tableReactive, (_a = mainRef.current) == null ? void 0 : _a.clientHeight, (_b = mainRef.current) == null ? void 0 : _b.clientWidth]);
10449
+ const mergedRefs = {
10450
+ ...palette,
10451
+ ...table ? table.wire.paletteBySheetName[table.sheetName] : {}
10452
+ };
10180
10453
  if (!table || !table.wire.ready) {
10181
10454
  return null;
10182
10455
  }
10183
- const operationStyles = useOperationStyles(store, {
10184
- ...palette,
10185
- ...table.wire.paletteBySheetName[table.sheetName]
10186
- });
10187
10456
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
10188
10457
  "div",
10189
10458
  {
@@ -10195,7 +10464,7 @@ const Tabular = () => {
10195
10464
  ref: tabularRef,
10196
10465
  onMouseMove: handleMouseMove,
10197
10466
  onScroll: handleScroll,
10198
- children: /* @__PURE__ */ jsx(
10467
+ children: /* @__PURE__ */ jsxs(
10199
10468
  "div",
10200
10469
  {
10201
10470
  className: "gs-tabular-inner",
@@ -10203,204 +10472,73 @@ const Tabular = () => {
10203
10472
  width: table.totalWidth + 1,
10204
10473
  height: table.totalHeight + 1
10205
10474
  },
10206
- children: /* @__PURE__ */ jsxs("table", { className: `gs-table`, children: [
10207
- /* @__PURE__ */ jsx("thead", { className: "gs-thead", style: { height: table.headerHeight }, children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10208
- /* @__PURE__ */ jsx(
10209
- "th",
10210
- {
10211
- className: "gs-th gs-th-left gs-th-top",
10212
- style: { position: "sticky", width: table.headerWidth, height: table.headerHeight },
10213
- onClick: handleSelectAllClick,
10214
- children: /* @__PURE__ */ jsx("div", { className: "gs-th-inner", children: /* @__PURE__ */ jsx(
10215
- ScrollHandle,
10216
- {
10217
- className: leftHeaderSelecting || topHeaderSelecting ? "gs-hidden" : "",
10218
- style: { position: "absolute" },
10219
- horizontal: leftHeaderSelecting ? 0 : -1,
10220
- vertical: topHeaderSelecting ? 0 : -1
10221
- }
10222
- ) })
10223
- }
10224
- ),
10225
- /* @__PURE__ */ jsx(
10226
- "th",
10227
- {
10228
- className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left",
10229
- style: { width: ((_c = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _c.left) ?? 1 }
10230
- }
10231
- ),
10232
- (_e = (_d = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (x) => /* @__PURE__ */ jsx(HeaderCellTop, { x }, x)),
10233
- /* @__PURE__ */ jsx(
10234
- "th",
10235
- {
10236
- className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right",
10237
- style: { width: (_f = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _f.right }
10238
- }
10239
- )
10240
- ] }) }),
10241
- /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-adjuster", children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10242
- /* @__PURE__ */ jsx(
10243
- "th",
10244
- {
10245
- className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`,
10246
- style: { height: ((_g = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _g.top) ?? 1 }
10247
- }
10248
- ),
10249
- /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }),
10250
- (_h = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _h.map((x) => /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }, x)),
10251
- /* @__PURE__ */ jsx("th", { className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical` })
10252
- ] }) }),
10253
- /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-data", children: (_i = virtualized == null ? void 0 : virtualized.ys) == null ? void 0 : _i.map((y) => {
10254
- var _a2;
10255
- return /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10256
- /* @__PURE__ */ jsx(HeaderCellLeft, { y }),
10257
- /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left" }),
10258
- (_a2 = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _a2.map((x) => /* @__PURE__ */ jsx(Cell, { y, x, operationStyle: operationStyles[p2a({ y, x })] }, x)),
10259
- /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right" })
10260
- ] }, y);
10261
- }) })
10262
- ] })
10475
+ children: [
10476
+ /* @__PURE__ */ jsx(CellStateOverlay, { refs: mergedRefs }),
10477
+ /* @__PURE__ */ jsxs("table", { className: `gs-table`, children: [
10478
+ /* @__PURE__ */ jsx("thead", { className: "gs-thead", style: { height: table.headerHeight }, children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10479
+ /* @__PURE__ */ jsx(
10480
+ "th",
10481
+ {
10482
+ className: "gs-th gs-th-left gs-th-top",
10483
+ style: { position: "sticky", width: table.headerWidth, height: table.headerHeight },
10484
+ onClick: handleSelectAllClick,
10485
+ children: /* @__PURE__ */ jsx("div", { className: "gs-th-inner", children: /* @__PURE__ */ jsx(
10486
+ ScrollHandle,
10487
+ {
10488
+ className: leftHeaderSelecting || topHeaderSelecting ? "gs-hidden" : "",
10489
+ style: { position: "absolute" },
10490
+ horizontal: leftHeaderSelecting ? 0 : -1,
10491
+ vertical: topHeaderSelecting ? 0 : -1
10492
+ }
10493
+ ) })
10494
+ }
10495
+ ),
10496
+ /* @__PURE__ */ jsx(
10497
+ "th",
10498
+ {
10499
+ className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left",
10500
+ style: { width: ((_c = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _c.left) ?? 1 }
10501
+ }
10502
+ ),
10503
+ (_e = (_d = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _d.map) == null ? void 0 : _e.call(_d, (x) => /* @__PURE__ */ jsx(HeaderCellTop, { x }, x)),
10504
+ /* @__PURE__ */ jsx(
10505
+ "th",
10506
+ {
10507
+ className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right",
10508
+ style: { width: (_f = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _f.right }
10509
+ }
10510
+ )
10511
+ ] }) }),
10512
+ /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-adjuster", children: /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10513
+ /* @__PURE__ */ jsx(
10514
+ "th",
10515
+ {
10516
+ className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical`,
10517
+ style: { height: ((_g = virtualized == null ? void 0 : virtualized.adjuster) == null ? void 0 : _g.top) ?? 1 }
10518
+ }
10519
+ ),
10520
+ /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }),
10521
+ (_h = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _h.map((x) => /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-vertical" }, x)),
10522
+ /* @__PURE__ */ jsx("th", { className: `gs-adjuster gs-adjuster-horizontal gs-adjuster-vertical` })
10523
+ ] }) }),
10524
+ /* @__PURE__ */ jsx("tbody", { className: "gs-table-body-data", children: (_i = virtualized == null ? void 0 : virtualized.ys) == null ? void 0 : _i.map((y) => {
10525
+ var _a2;
10526
+ return /* @__PURE__ */ jsxs("tr", { className: "gs-row", children: [
10527
+ /* @__PURE__ */ jsx(HeaderCellLeft, { y }),
10528
+ /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-left" }),
10529
+ (_a2 = virtualized == null ? void 0 : virtualized.xs) == null ? void 0 : _a2.map((x) => /* @__PURE__ */ jsx(Cell, { y, x }, x)),
10530
+ /* @__PURE__ */ jsx("td", { className: "gs-adjuster gs-adjuster-horizontal gs-adjuster-horizontal-right" })
10531
+ ] }, y);
10532
+ }) })
10533
+ ] })
10534
+ ]
10263
10535
  }
10264
10536
  )
10265
10537
  }
10266
10538
  ) });
10267
10539
  };
10268
- const BORDER_POINTED = "solid 2px #0077ff";
10269
- const BORDER_SELECTED = "solid 1px #0077ff";
10270
- const BORDER_CUTTING = "dotted 2px #0077ff";
10271
- const BORDER_COPYING = "dashed 2px #0077ff";
10272
- const SEARCH_MATCHING_BACKGROUND = "rgba(0,200,100,.2)";
10273
- const SEARCH_MATCHING_BORDER = "solid 2px #00aa78";
10274
- const AUTOFILL_BORDER = "dashed 1px #444444";
10275
- const useOperationStyles = (store, refs) => {
10276
- const cellStyles = {};
10277
- const updateStyle = (point, style) => {
10278
- const address = p2a(point);
10279
- cellStyles[address] = cellStyles[address] || {};
10280
- Object.assign(cellStyles[address], style);
10281
- };
10282
- const {
10283
- choosing,
10284
- selectingZone,
10285
- matchingCells,
10286
- matchingCellIndex,
10287
- tableReactive,
10288
- autofillDraggingTo,
10289
- editingAddress
10290
- } = store;
10291
- const table = tableReactive.current;
10292
- if (!table) {
10293
- return {};
10294
- }
10295
- const { wire } = table;
10296
- const { copyingSheetId, copyingZone, cutting } = wire;
10297
- const editingAnywhere = !!(wire.editingAddress || editingAddress);
10298
- {
10299
- const { top, left, bottom, right } = zoneToArea(selectingZone);
10300
- if (!editingAnywhere) {
10301
- for (let y = top; y <= bottom; y++) {
10302
- updateStyle({ y, x: left - 1 }, { borderRight: BORDER_SELECTED });
10303
- updateStyle({ y, x: left }, { borderLeft: BORDER_SELECTED });
10304
- updateStyle({ y, x: right }, { borderRight: BORDER_SELECTED });
10305
- updateStyle({ y, x: right + 1 }, { borderLeft: BORDER_SELECTED });
10306
- }
10307
- for (let x = left; x <= right; x++) {
10308
- updateStyle({ y: top - 1, x }, { borderBottom: BORDER_SELECTED });
10309
- updateStyle({ y: top, x }, { borderTop: BORDER_SELECTED });
10310
- updateStyle({ y: bottom, x }, { borderBottom: BORDER_SELECTED });
10311
- updateStyle({ y: bottom + 1, x }, { borderTop: BORDER_SELECTED });
10312
- }
10313
- }
10314
- }
10315
- if (autofillDraggingTo) {
10316
- const autofill = new Autofill(store, autofillDraggingTo);
10317
- const { top, left, bottom, right } = autofill.wholeArea;
10318
- for (let y = top; y <= bottom; y++) {
10319
- updateStyle({ y, x: left - 1 }, { borderRight: AUTOFILL_BORDER });
10320
- updateStyle({ y, x: left }, { borderLeft: AUTOFILL_BORDER });
10321
- updateStyle({ y, x: right }, { borderRight: AUTOFILL_BORDER });
10322
- updateStyle({ y, x: right + 1 }, { borderLeft: AUTOFILL_BORDER });
10323
- }
10324
- for (let x = left; x <= right; x++) {
10325
- updateStyle({ y: top - 1, x }, { borderBottom: AUTOFILL_BORDER });
10326
- updateStyle({ y: top, x }, { borderTop: AUTOFILL_BORDER });
10327
- updateStyle({ y: bottom, x }, { borderBottom: AUTOFILL_BORDER });
10328
- updateStyle({ y: bottom + 1, x }, { borderTop: AUTOFILL_BORDER });
10329
- }
10330
- }
10331
- {
10332
- const { y, x } = choosing;
10333
- updateStyle(
10334
- { y, x },
10335
- {
10336
- borderLeft: BORDER_POINTED,
10337
- borderRight: BORDER_POINTED,
10338
- borderTop: BORDER_POINTED,
10339
- borderBottom: BORDER_POINTED
10340
- }
10341
- );
10342
- updateStyle({ y, x: x - 1 }, { borderRight: BORDER_POINTED });
10343
- updateStyle({ y, x: x + 1 }, { borderLeft: BORDER_POINTED });
10344
- updateStyle({ y: y - 1, x }, { borderBottom: BORDER_POINTED });
10345
- updateStyle({ y: y + 1, x }, { borderTop: BORDER_POINTED });
10346
- }
10347
- if (table.sheetId === copyingSheetId) {
10348
- const borderStyle = cutting ? BORDER_CUTTING : BORDER_COPYING;
10349
- const { top, left, bottom, right } = zoneToArea(copyingZone);
10350
- for (let y = top; y <= bottom; y++) {
10351
- updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });
10352
- updateStyle({ y, x: left }, { borderLeft: borderStyle });
10353
- updateStyle({ y, x: right }, { borderRight: borderStyle });
10354
- updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });
10355
- }
10356
- for (let x = left; x <= right; x++) {
10357
- updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });
10358
- updateStyle({ y: top, x }, { borderTop: borderStyle });
10359
- updateStyle({ y: bottom, x }, { borderBottom: borderStyle });
10360
- updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });
10361
- }
10362
- }
10363
- Object.entries(refs).forEach(([ref, i]) => {
10364
- const palette = COLOR_PALETTE[i % COLOR_PALETTE.length];
10365
- const borderStyle = `dashed 2px ${palette}`;
10366
- const { top, left, bottom, right } = table.rangeToArea(ref);
10367
- for (let y = top; y <= bottom; y++) {
10368
- updateStyle({ y, x: left - 1 }, { borderRight: borderStyle });
10369
- updateStyle({ y, x: left }, { borderLeft: borderStyle });
10370
- updateStyle({ y, x: right }, { borderRight: borderStyle });
10371
- updateStyle({ y, x: right + 1 }, { borderLeft: borderStyle });
10372
- }
10373
- for (let x = left; x <= right; x++) {
10374
- updateStyle({ y: top - 1, x }, { borderBottom: borderStyle });
10375
- updateStyle({ y: top, x }, { borderTop: borderStyle });
10376
- updateStyle({ y: bottom, x }, { borderBottom: borderStyle });
10377
- updateStyle({ y: bottom + 1, x }, { borderTop: borderStyle });
10378
- }
10379
- });
10380
- matchingCells.forEach((address) => {
10381
- const { y, x } = a2p(address);
10382
- updateStyle({ y, x }, { backgroundColor: SEARCH_MATCHING_BACKGROUND });
10383
- });
10384
- if (matchingCells.length > 0) {
10385
- const { y, x } = a2p(matchingCells[matchingCellIndex]);
10386
- updateStyle(
10387
- { y, x },
10388
- {
10389
- borderLeft: SEARCH_MATCHING_BORDER,
10390
- borderRight: SEARCH_MATCHING_BORDER,
10391
- borderTop: SEARCH_MATCHING_BORDER,
10392
- borderBottom: SEARCH_MATCHING_BORDER
10393
- }
10394
- );
10395
- updateStyle({ y, x: x - 1 }, { borderRight: SEARCH_MATCHING_BORDER });
10396
- updateStyle({ y, x: x + 1 }, { borderLeft: SEARCH_MATCHING_BORDER });
10397
- updateStyle({ y: y - 1, x }, { borderBottom: SEARCH_MATCHING_BORDER });
10398
- updateStyle({ y: y + 1, x }, { borderTop: SEARCH_MATCHING_BORDER });
10399
- }
10400
- return cellStyles;
10401
- };
10402
- const LAST_MODIFIED = 1753483021;
10403
- const CSS = `.gs-root1{display:inline-block;position:relative;border-spacing:0;width:fit-content;max-width:100%;overflow:auto;font-family:"SF Pro Text","SF Pro Icons","Helvetica Neue",Helvetica,Arial,Meiryo,sans-serif;visibility:hidden;opacity:0}.gs-root1.gs-initialized{visibility:visible;opacity:1;transition:opacity .2s ease-in-out}.gs-root1 .gs-main{flex:1;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.gs-root1 .gs-resizing{width:100%;height:100%;position:absolute;background-color:rgba(0,127,255,.08);top:0;left:0;z-index:2}.gs-root1 .gs-line-horizontal{width:100%}.gs-root1 .gs-line-vertical{height:100%}.gs-root1 .gs-line{position:relative;top:0;left:0;border:dotted 1px #07f;box-sizing:border-box}.gs-root1 .gs-line span{font-size:10px;padding:3px;background-color:#07f;color:#fff;margin:0;position:absolute;top:0;left:0}.gs-root1 .gs-scroll-handle{width:100%;height:100%;cursor:cell}.gs-hidden{visibility:hidden;position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;z-index:-1}.gs-fixed{position:fixed;top:0;left:0;z-index:1}.gs-root1[data-mode=light]{background-color:#e2e2e2;color:#000}.gs-root1[data-mode=light] .gs-main{background-color:#e2e2e2;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd}.gs-root1[data-mode=light] .gs-tabular{background-color:#e2e2e2}.gs-root1[data-mode=light] .gs-formula-bar{background-color:#efefef}.gs-root1[data-mode=light] .gs-formula-bar-editor-inner{color:#555}.gs-root1[data-mode=light] .gs-cell{border-top:solid 1px #ddd;border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-adjuster{background-color:#ddd}.gs-root1[data-mode=light] .gs-tabular-inner{background-color:#f7f7f7}.gs-root1[data-mode=light] .gs-th{background-color:#efefef;color:#666}.gs-root1[data-mode=light] .gs-th.gs-selecting{background-color:#d2d2d2}.gs-root1[data-mode=light] .gs-th.gs-choosing{background-color:#bbb}.gs-root1[data-mode=light] .gs-th.gs-th-selecting{background-color:#555;color:#fff}.gs-root1[data-mode=light] .gs-th-top{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-top .gs-th-inner{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left .gs-th-inner{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-search-bar{color:rgba(0,0,0,.3)}.gs-editor[data-mode=light].gs-editing textarea{caret-color:#000000}.gs-editor[data-mode=light].gs-editing .gs-editor-hl{background-color:#f7f7f7;color:#000}.gs-editor[data-mode=light] .gs-editor-options{color:#000;background-color:#f7f7f7;border:solid 1px #ddd}.gs-root1[data-mode=dark]{background-color:#5a5a5a;color:#eee}.gs-root1[data-mode=dark] .gs-main{background-color:#3f3f3f;border-right:solid 1px #5a5a5a;border-bottom:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-tabular{background-color:#3f3f3f}.gs-root1[data-mode=dark] .gs-formula-bar{background-color:#4f4f4f}.gs-root1[data-mode=dark] .gs-formula-bar-editor-inner{color:#bbb}.gs-root1[data-mode=dark] .gs-cell{border-top:solid 1px #5a5a5a;border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-adjuster{background-color:#5a5a5a}.gs-root1[data-mode=dark] .gs-tabular-inner{background-color:#212121}.gs-root1[data-mode=dark] .gs-large-editor textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-th{background-color:#4f4f4f;color:#eee}.gs-root1[data-mode=dark] .gs-th.gs-selecting{background-color:#606060}.gs-root1[data-mode=dark] .gs-th.gs-choosing{background-color:#777}.gs-root1[data-mode=dark] .gs-th.gs-th-selecting{background-color:#aaa;color:#444}.gs-root1[data-mode=dark] .gs-th-top{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-top .gs-th-inner{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left .gs-th-inner{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-search-bar textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-search-bar{color:rgba(255,255,255,.3)}.gs-editor[data-mode=dark].gs-editing textarea{caret-color:#eeeeee}.gs-editor[data-mode=dark].gs-editing .gs-editor-hl{background-color:#212121;color:#eee}.gs-editor[data-mode=dark] .gs-editor-options{color:#eee;background-color:#5a5a5a;border:solid 1px #5a5a5a}.gs-cell{transition:border-color .2s ease;padding:0;margin:0;box-sizing:border-box;position:relative;font-size:13px;letter-spacing:1px;line-height:24px;cursor:cell;user-select:none;-webkit-user-select:none;-moz-user-select:none}.gs-cell .gs-cell-inner-wrap.gs-selecting{background-color:rgba(0,128,255,.2)}.gs-cell.gs-copying textarea:focus{outline:solid 1px #0077ff}.gs-cell.gs-selecting{z-index:1}.gs-cell.gs-selecting .gs-cell-inner{background-color:rgba(0,128,255,.2)}.gs-cell.gs-selecting .gs-cell-label{display:block}.gs-cell.gs-choosing{margin-top:-1px;margin-left:-1px;z-index:1}.gs-cell.gs-choosing.gs-editing{color:transparent}.gs-cell.gs-choosing .gs-cell-label{display:block}.gs-cell .gs-formula-error-triangle{position:absolute;top:0;right:0;border-top:3px solid rgba(200,0,0,.9);border-right:3px solid rgba(200,0,0,.9);border-bottom:3px solid transparent;border-left:3px solid transparent;z-index:1}.gs-cell .gs-cell-label{font-size:8px;font-weight:400;font-style:normal;font-family:math,monospace,serif;letter-spacing:1px;line-height:14px;position:absolute;top:0;right:0;background-color:rgba(0,128,255,.2);color:rgba(255,255,255,.6);padding:0 2px;display:none;opacity:.7}.gs-cell .gs-cell-inner-wrap{width:100%;height:100%;position:absolute;top:0;left:0}.gs-cell .gs-cell-inner{width:100%;height:100%;overflow:hidden;display:flex;box-sizing:border-box;border:none!important}.gs-cell .gs-cell-rendered{overflow:hidden;white-space:pre-wrap;cursor:cell;word-wrap:break-word;word-break:break-all;padding:0 2px;width:100%;height:100%}.gs-cell .gs-cell-rendered>*{position:relative}.gs-cell .gs-cell-rendered>.backface{z-index:0}.gs-cell .gs-autofill-drag{background-color:#07f;position:absolute;width:7px;height:7px;bottom:0;right:0;margin-right:-3.5px;margin-bottom:-3.5px;cursor:crosshair;z-index:1}.gs-th[data-x="1"] .gs-th-inner-wrap{border-left:none}.gs-th[data-y="1"] .gs-th-inner-wrap{border-top:none}.gs-cell[data-x="1"]{border-left:none}.gs-cell[data-y="1"]{border-top:none}.gs-contextmenu-modal{width:100%;height:100vh;z-index:3}.gs-contextmenu{z-index:3;position:fixed;background-color:#fff;padding:5px 0;border-radius:5px;box-shadow:rgba(60,64,67,.3) 0 1px 2px 0,rgba(60,64,67,.15) 0 1px 3px 1px}.gs-contextmenu ul{min-width:250px;color:#555;margin:0;padding:0}.gs-contextmenu li{padding:5px 10px;list-style-type:none;display:flex}.gs-contextmenu li.gs-enabled{cursor:pointer}.gs-contextmenu li.gs-enabled:hover{background-color:#eee}.gs-contextmenu li.gs-disabled{opacity:.5;cursor:not-allowed}.gs-contextmenu li.gs-menu-divider{background-color:#aaa;margin:10px 0;padding:0;height:1px}.gs-contextmenu li .gs-menu-name{flex:1;font-size:15px;letter-spacing:1px}.gs-contextmenu li .gs-menu-shortcut{font-size:10px;line-height:20px;color:#999}.gs-contextmenu li .gs-menu-shortcut:before{content:"( "}.gs-contextmenu li .gs-menu-shortcut:after{content:" )"}.gs-contextmenu li .gs-menu-shortcut .gs-menu-underline{text-decoration:underline}.gs-editor-hl{padding:0 2px!important;position:absolute;font-family:monospace,Arial;font-size:12px;line-height:24px;letter-spacing:1px}.gs-formula-bar-editor-inner{position:relative;display:table-cell}.gs-editor{opacity:0;z-index:-1}.gs-editor .gs-editor-inner{position:relative}.gs-editor .gs-editor-hl{box-sizing:content-box;border:solid 2px #07f;margin:-2px -1px}.gs-editor textarea{width:100%;padding:0 2px!important;position:absolute;font-size:12px;font-family:monospace,Arial;line-height:24px;letter-spacing:1px;top:0;left:0;border:none;outline:0;background-color:transparent;color:transparent;resize:none;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;overflow:hidden;cursor:default;white-space:pre;height:auto}.gs-editor.gs-editing{z-index:3;opacity:1}.gs-editor.gs-editing .gs-cell-label{pointer-events:none;font-family:math,monospace,serif;position:absolute;top:0;right:0;margin-top:-15px;margin-right:-2px;padding:0 2px;font-size:10px;background-color:rgba(0,119,255,.75);color:#fff;z-index:1}.gs-formula-bar{width:100%;position:relative;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box}.gs-formula-bar .gs-selecting-address{display:table-cell;vertical-align:middle;width:60px;color:rgba(200,200,200);font-size:13px;text-align:center}.gs-formula-bar .gs-fx{display:table-cell;vertical-align:middle;width:30px;color:rgba(200,200,200);font-style:italic;font-family:cursive;text-align:center;border-left:solid 1px rgba(128,128,128,.5);font-size:15px}.gs-formula-bar .gs-editor-hl{z-index:0;overflow-y:auto;box-sizing:border-box;white-space:pre-wrap;word-break:break-all}.gs-formula-bar textarea{position:relative;z-index:1;width:100%;vertical-align:bottom;color:transparent;border:none;background-color:transparent;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;resize:vertical;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all}.gs-token-type-INVALID_REF{color:red}.gs-token-type-VALUE.gs-token-entity-type-boolean,.gs-token-type-VALUE.gs-token-entity-type-number{color:#39f}.gs-token-type-VALUE.gs-token-entity-type-string{color:#090}.gs-editor-options{padding:0;box-shadow:0 2px 8px rgba(0,0,0,.25);border:1px solid rgba(128,128,128,.2);border-radius:4px}.gs-editor-option{cursor:pointer;list-style:none;padding:5px;font-size:12px}.gs-editor-option:hover{background-color:rgba(128,128,128,.1)}.gs-editor-option-selected{background-color:rgba(128,128,128,.2)}.gs-adjuster{padding:0}.gs-table{margin:0}.gs-tabular{overflow:auto;display:block;box-sizing:border-box;overscroll-behavior-x:contain}.gs-tabular-inner>table{table-layout:fixed;border-collapse:collapse;border-spacing:0}.gs-th{z-index:2;padding:0;position:sticky;font-size:13px;font-weight:400;box-sizing:border-box;vertical-align:top}.gs-th .gs-resizer{position:absolute;border-color:transparent;box-sizing:border-box;z-index:2}.gs-th .gs-resizer:hover{background-color:#07f}.gs-th .gs-resizer.gs-protected{display:none}.gs-th-inner{height:100%;box-sizing:border-box;vertical-align:middle;overflow:hidden;display:flex;align-items:center;justify-content:center}.gs-th-inner-wrap{height:100%;box-sizing:border-box;background-color:transparent}.gs-th-top{top:0;overflow:hidden}.gs-th-top .gs-resizer{top:0;right:0;width:3px;cursor:e-resize}.gs-th-top .gs-resizer.gs-dragging{border-right-style:dotted;height:1000000px!important;cursor:e-resize}.gs-th-left{left:0;overflow:hidden;min-width:30px;border-top:solid 1px #ddd}.gs-th-left .gs-resizer{left:0;bottom:0;height:3px;cursor:n-resize}.gs-th-left .gs-resizer.gs-dragging{border-bottom-style:dotted;width:1000000px!important;cursor:n-resize}.gs-th-top.gs-th-left{top:0;left:0;z-index:3;border:none!important}.gs-search-bar{width:100%;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box;background-color:rgba(200,50,0,.2)}.gs-search-bar.gs-search-found{background-color:rgba(0,200,100,.2)}.gs-search-bar .gs-search-bar-inner{vertical-align:middle;border-left:solid 1px rgba(128,128,128,.5)}.gs-search-bar .gs-search-bar-icon{border-left:solid 1px rgba(128,128,128,.3);display:table-cell;vertical-align:middle;width:30px}.gs-search-bar textarea{background-color:transparent;border:none;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all;display:table-cell;vertical-align:middle;width:100%;resize:none}.gs-search-progress{display:table-cell;color:#999;font-size:13px;width:60px;vertical-align:middle;white-space:nowrap;text-align:center}.gs-search-close{display:table-cell;cursor:pointer;vertical-align:middle;width:24px}.gs-search-casesensitive{display:table-cell;cursor:pointer;vertical-align:middle;width:30px}.gs-search-casesensitive span{font-size:14px;padding:0 3px}.gs-search-casesensitive span.gs-search-casesensitive-on{color:#07f;background-color:rgba(200,200,255,.5);border-radius:3px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}`;
10540
+ const LAST_MODIFIED = 1770663713;
10541
+ const CSS = `.gs-root1{display:inline-block;position:relative;border-spacing:0;width:fit-content;max-width:100%;line-height:normal;overflow:auto;font-family:"SF Pro Text","SF Pro Icons","Helvetica Neue",Helvetica,Arial,Meiryo,sans-serif;visibility:hidden;opacity:0}.gs-root1.gs-initialized{visibility:visible;opacity:1;transition:opacity .2s ease-in-out}.gs-root1 .gs-main{flex:1;max-width:100%;overflow:hidden;position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.gs-root1 .gs-resizing{width:100%;height:100%;position:absolute;background-color:rgba(0,127,255,.08);top:0;left:0;z-index:2}.gs-root1 .gs-line-horizontal{width:100%}.gs-root1 .gs-line-vertical{height:100%}.gs-root1 .gs-line{position:relative;top:0;left:0;border:dotted 1px #07f;box-sizing:border-box}.gs-root1 .gs-line span{font-size:10px;padding:3px;background-color:#07f;color:#fff;margin:0;position:absolute;top:0;left:0}.gs-root1 .gs-scroll-handle{width:100%;height:100%;cursor:cell}.gs-hidden{visibility:hidden;position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;z-index:-1}.gs-fixed{position:fixed;top:0;left:0;z-index:1}.gs-root1[data-mode=light]{background-color:#e2e2e2;color:#000}.gs-root1[data-mode=light] .gs-main{background-color:#e2e2e2;border-right:solid 1px #ddd;border-bottom:solid 1px #ddd}.gs-root1[data-mode=light] .gs-tabular{background-color:#e2e2e2}.gs-root1[data-mode=light] .gs-formula-bar{background-color:#efefef}.gs-root1[data-mode=light] .gs-formula-bar-editor-inner{color:#555}.gs-root1[data-mode=light] .gs-cell{border-top:solid 1px #ddd;border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-adjuster{background-color:#ddd}.gs-root1[data-mode=light] .gs-tabular-inner{background-color:#f7f7f7}.gs-root1[data-mode=light] .gs-th{background-color:#efefef;color:#666}.gs-root1[data-mode=light] .gs-th-top{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-top .gs-th-inner{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left{border-top:solid 1px #ddd}.gs-root1[data-mode=light] .gs-th-left .gs-th-inner{border-left:solid 1px #ddd}.gs-root1[data-mode=light] .gs-search-bar{color:rgba(0,0,0,.3)}.gs-editor[data-mode=light].gs-editing textarea{caret-color:#000000}.gs-editor[data-mode=light].gs-editing .gs-editor-hl{background-color:#f7f7f7;color:#000}.gs-editor[data-mode=light] .gs-editor-options{color:#000;background-color:#f7f7f7;border:solid 1px #ddd}.gs-root1[data-mode=dark]{background-color:#5a5a5a;color:#eee}.gs-root1[data-mode=dark] .gs-main{background-color:#3f3f3f;border-right:solid 1px #5a5a5a;border-bottom:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-tabular{background-color:#3f3f3f}.gs-root1[data-mode=dark] .gs-formula-bar{background-color:#4f4f4f}.gs-root1[data-mode=dark] .gs-formula-bar-editor-inner{color:#bbb}.gs-root1[data-mode=dark] .gs-cell{border-top:solid 1px #5a5a5a;border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-adjuster{background-color:#5a5a5a}.gs-root1[data-mode=dark] .gs-tabular-inner{background-color:#212121}.gs-root1[data-mode=dark] .gs-large-editor textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-th{background-color:#4f4f4f;color:#eee}.gs-root1[data-mode=dark] .gs-th-top{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-top .gs-th-inner{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left{border-top:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-th-left .gs-th-inner{border-left:solid 1px #5a5a5a}.gs-root1[data-mode=dark] .gs-search-bar textarea{color:#eee;caret-color:#eeeeee}.gs-root1[data-mode=dark] .gs-search-bar{color:rgba(255,255,255,.3)}.gs-editor[data-mode=dark].gs-editing textarea{caret-color:#eeeeee}.gs-editor[data-mode=dark].gs-editing .gs-editor-hl{background-color:#212121;color:#eee}.gs-editor[data-mode=dark] .gs-editor-options{color:#eee;background-color:#5a5a5a;border:solid 1px #5a5a5a}.gs-cell{transition:border-color .2s ease;padding:0;margin:0;box-sizing:border-box;position:relative;font-size:13px;letter-spacing:1px;line-height:24px;cursor:cell;user-select:none;-webkit-user-select:none;-moz-user-select:none}.gs-cell.gs-copying textarea:focus{outline:solid 1px #0077ff}.gs-cell.gs-selecting{z-index:1}.gs-cell.gs-selecting .gs-cell-label{display:block}.gs-cell.gs-choosing{margin-top:-1px;margin-left:-1px;z-index:1}.gs-cell.gs-choosing.gs-editing{color:transparent}.gs-cell.gs-choosing .gs-cell-label{display:block}.gs-cell .gs-formula-error-triangle{position:absolute;top:0;right:0;border-top:3px solid rgba(200,0,0,.9);border-right:3px solid rgba(200,0,0,.9);border-bottom:3px solid transparent;border-left:3px solid transparent;z-index:1}.gs-cell .gs-cell-label{font-size:8px;font-weight:400;font-style:normal;font-family:math,monospace,serif;letter-spacing:1px;line-height:14px;position:absolute;top:0;right:0;background-color:rgba(0,128,255,.2);color:rgba(255,255,255,.6);padding:0 2px;display:none;opacity:.7}.gs-cell .gs-cell-inner-wrap{width:100%;height:100%;position:absolute;top:0;left:0}.gs-cell .gs-cell-inner{width:100%;height:100%;overflow:hidden;display:flex;box-sizing:border-box;border:none!important}.gs-cell .gs-cell-rendered{overflow:hidden;white-space:pre-wrap;cursor:cell;word-wrap:break-word;word-break:break-all;padding:0 2px;width:100%;height:100%}.gs-cell .gs-cell-rendered>*{position:relative}.gs-cell .gs-cell-rendered>.backface{z-index:0}.gs-cell .gs-autofill-drag{background-color:#07f;position:absolute;width:7px;height:7px;bottom:0;right:0;margin-right:-3.5px;margin-bottom:-3.5px;cursor:crosshair;z-index:1}.gs-th[data-x="1"] .gs-th-inner-wrap{border-left:none}.gs-th[data-y="1"] .gs-th-inner-wrap{border-top:none}.gs-cell[data-x="1"]{border-left:none}.gs-cell[data-y="1"]{border-top:none}.gs-contextmenu-modal{width:100%;height:100vh;z-index:3}.gs-contextmenu{z-index:3;position:fixed;background-color:#fff;padding:5px 0;border-radius:5px;box-shadow:rgba(60,64,67,.3) 0 1px 2px 0,rgba(60,64,67,.15) 0 1px 3px 1px}.gs-contextmenu ul{min-width:250px;color:#555;margin:0;padding:0}.gs-contextmenu li{padding:5px 10px;list-style-type:none;display:flex}.gs-contextmenu li.gs-enabled{cursor:pointer}.gs-contextmenu li.gs-enabled:hover{background-color:#eee}.gs-contextmenu li.gs-disabled{opacity:.5;cursor:not-allowed}.gs-contextmenu li.gs-menu-divider{background-color:#aaa;margin:10px 0;padding:0;height:1px}.gs-contextmenu li .gs-menu-name{flex:1;font-size:15px;letter-spacing:1px}.gs-contextmenu li .gs-menu-shortcut{font-size:10px;line-height:20px;color:#999}.gs-contextmenu li .gs-menu-shortcut:before{content:"( "}.gs-contextmenu li .gs-menu-shortcut:after{content:" )"}.gs-contextmenu li .gs-menu-shortcut .gs-menu-underline{text-decoration:underline}.gs-editor-hl{padding:0 2px!important;position:absolute;font-family:monospace,Arial;font-size:12px;line-height:24px;letter-spacing:1px}.gs-formula-bar-editor-inner{position:relative;display:table-cell}.gs-editor{opacity:0;z-index:-1}.gs-editor .gs-editor-inner{position:relative}.gs-editor .gs-editor-hl{box-sizing:content-box;border:solid 2px #07f;margin:-2px -1px}.gs-editor textarea{width:100%;padding:0 2px!important;position:absolute;font-size:12px;font-family:monospace,Arial;line-height:24px;letter-spacing:1px;top:0;left:0;border:none;outline:0;background-color:transparent;color:transparent;resize:none;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;overflow:hidden;cursor:default;white-space:pre;height:auto}.gs-editor.gs-editing{z-index:11;opacity:1}.gs-editor.gs-editing .gs-cell-label{pointer-events:none;font-family:math,monospace,serif;position:absolute;top:0;right:0;margin-top:-15px;margin-right:-2px;padding:0 2px;font-size:10px;background-color:rgba(0,119,255,.75);color:#fff;z-index:1}.gs-formula-bar{width:100%;position:relative;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box}.gs-formula-bar .gs-selecting-address{display:table-cell;vertical-align:middle;width:60px;color:rgba(200,200,200);font-size:13px;text-align:center}.gs-formula-bar .gs-fx{display:table-cell;vertical-align:middle;width:30px;color:rgba(200,200,200);font-style:italic;font-family:cursive;text-align:center;border-left:solid 1px rgba(128,128,128,.5);font-size:15px}.gs-formula-bar .gs-editor-hl{z-index:0;overflow-y:auto;box-sizing:border-box;white-space:pre-wrap;word-break:break-all}.gs-formula-bar textarea{position:relative;z-index:1;width:100%;vertical-align:bottom;color:transparent;border:none;background-color:transparent;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;resize:vertical;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all}.gs-token-type-INVALID_REF{color:red}.gs-token-type-VALUE.gs-token-entity-type-boolean,.gs-token-type-VALUE.gs-token-entity-type-number{color:#39f}.gs-token-type-VALUE.gs-token-entity-type-string{color:#090}.gs-editor-options{padding:0;box-shadow:0 2px 8px rgba(0,0,0,.25);border:1px solid rgba(128,128,128,.2);border-radius:4px}.gs-editor-option{cursor:pointer;list-style:none;padding:5px;font-size:12px}.gs-editor-option:hover{background-color:rgba(128,128,128,.1)}.gs-editor-option-selected{background-color:rgba(128,128,128,.2)}.gs-adjuster{padding:0}.gs-table{margin:0}.gs-tabular{overflow:auto;display:block;box-sizing:border-box;overscroll-behavior:none;position:relative}.gs-tabular-inner>table{table-layout:fixed;border-collapse:collapse;border-spacing:0}.gs-th{z-index:2;padding:0;position:sticky;font-size:13px;font-weight:400;box-sizing:border-box;vertical-align:top}.gs-th .gs-resizer{position:absolute;border-color:transparent;box-sizing:border-box;z-index:2}.gs-th .gs-resizer:hover{background-color:#07f}.gs-th .gs-resizer.gs-protected{display:none}.gs-th-inner{height:100%;box-sizing:border-box;vertical-align:middle;overflow:hidden;display:flex;align-items:center;justify-content:center}.gs-th-inner-wrap{height:100%;box-sizing:border-box;background-color:transparent}.gs-th-top{top:0;overflow:hidden}.gs-th-top .gs-resizer{top:0;right:0;width:3px;cursor:e-resize}.gs-th-top .gs-resizer.gs-dragging{border-right-style:dotted;height:1000000px!important;cursor:e-resize}.gs-th-left{left:0;overflow:hidden;min-width:30px;border-top:solid 1px #ddd}.gs-th-left .gs-resizer{left:0;bottom:0;height:3px;cursor:n-resize}.gs-th-left .gs-resizer.gs-dragging{border-bottom-style:dotted;width:1000000px!important;cursor:n-resize}.gs-th-top.gs-th-left{top:0;left:0;z-index:3;border:none!important}.gs-search-bar{width:100%;display:table;align-items:center;justify-content:center;border-top:solid 1px rgba(128,128,128,.3);border-left:solid 1px rgba(128,128,128,.3);border-right:solid 1px rgba(128,128,128,.3);box-sizing:border-box;background-color:rgba(200,50,0,.2)}.gs-search-bar.gs-search-found{background-color:rgba(0,200,100,.2)}.gs-search-bar .gs-search-bar-inner{vertical-align:middle;border-left:solid 1px rgba(128,128,128,.5)}.gs-search-bar .gs-search-bar-icon{border-left:solid 1px rgba(128,128,128,.3);display:table-cell;vertical-align:middle;width:30px}.gs-search-bar textarea{background-color:transparent;border:none;padding:0 2px;box-sizing:border-box;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;font-size:12px;font-family:monospace,Arial;height:24px;line-height:24px;min-height:24px;letter-spacing:1px;caret-color:rgba(128,128,128);white-space:pre-wrap;word-break:break-all;display:table-cell;vertical-align:middle;width:100%;resize:none}.gs-search-progress{display:table-cell;color:#999;font-size:13px;width:60px;vertical-align:middle;white-space:nowrap;text-align:center}.gs-search-close{display:table-cell;cursor:pointer;vertical-align:middle;width:24px}.gs-search-casesensitive{display:table-cell;cursor:pointer;vertical-align:middle;width:30px}.gs-search-casesensitive span{font-size:14px;padding:0 3px}.gs-search-casesensitive span.gs-search-casesensitive-on{color:#07f;background-color:rgba(200,200,255,.5);border-radius:3px}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}`;
10404
10542
  const embedStyle = () => {
10405
10543
  if (typeof window === "undefined") {
10406
10544
  return;