@syidax/advanced 0.0.0-stage → 1.0.1
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/LICENSE.md +360 -0
- package/NOTICE.md +8554 -0
- package/README.md +28 -2
- package/dist/advanced/advanced.esm.js +1 -0
- package/dist/advanced/index.esm.js +1 -0
- package/dist/advanced/p-047a8d2a.entry.js +1 -0
- package/dist/advanced/p-0d722333.entry.js +1 -0
- package/dist/advanced/p-10092cd7.entry.js +1 -0
- package/dist/advanced/p-3bfe768d.entry.js +1 -0
- package/dist/advanced/p-3c0e11bb.entry.js +1 -0
- package/dist/advanced/p-425cc46f.entry.js +1 -0
- package/dist/advanced/p-46a30369.entry.js +1 -0
- package/dist/advanced/p-4729eab2.entry.js +1 -0
- package/dist/advanced/p-4CjYGJmq.js +1 -0
- package/dist/advanced/p-4c936a0b.entry.js +1 -0
- package/dist/advanced/p-4d4d7a4e.entry.js +1 -0
- package/dist/advanced/p-52ccaa06.entry.js +2 -0
- package/dist/advanced/p-5a331221.entry.js +1 -0
- package/dist/advanced/p-5a901d75.entry.js +1 -0
- package/dist/advanced/p-5fe7ccff.entry.js +1 -0
- package/dist/advanced/p-6cc14adc.entry.js +1 -0
- package/dist/advanced/p-754e1389.entry.js +1 -0
- package/dist/advanced/p-7953cc9e.entry.js +1 -0
- package/dist/advanced/p-81391f84.entry.js +1 -0
- package/dist/advanced/p-84491b0f.entry.js +1 -0
- package/dist/advanced/p-84631cf9.entry.js +1 -0
- package/dist/advanced/p-87416587.entry.js +1 -0
- package/dist/advanced/p-89b3d2c2.entry.js +1 -0
- package/dist/advanced/p-8d7b586a.entry.js +1 -0
- package/dist/advanced/p-9d1f8f10.entry.js +1 -0
- package/dist/advanced/p-AzDRbG7D.js +1 -0
- package/dist/advanced/p-B6K1arcd.js +1 -0
- package/dist/advanced/p-BKZM2o7w.js +1 -0
- package/dist/advanced/p-BVmDGX0a.js +1 -0
- package/dist/advanced/p-BYBaMhHn.js +1 -0
- package/dist/advanced/p-Bl66fnTv.js +1 -0
- package/dist/advanced/p-Brtcd7ZV.js +1 -0
- package/dist/advanced/p-BsBcTKjx.js +1 -0
- package/dist/advanced/p-BwM4aW0R.js +1 -0
- package/dist/advanced/p-BwtrZuf8.js +1 -0
- package/dist/advanced/p-C-xxpQIO.js +1 -0
- package/dist/advanced/p-C0f63Npv.js +1 -0
- package/dist/advanced/p-C1RaN8eG.js +1 -0
- package/dist/advanced/p-C1vfsnDY.js +1 -0
- package/dist/advanced/p-C374wsaF.js +1 -0
- package/dist/advanced/p-CFyLRM--.js +1 -0
- package/dist/advanced/p-CIwqM40T.js +1 -0
- package/dist/advanced/p-CKEqyWf8.js +1 -0
- package/dist/advanced/p-CMRCw_kT.js +4 -0
- package/dist/advanced/p-CTrT2jn4.js +1 -0
- package/dist/advanced/p-C_2TIPHD.js +1 -0
- package/dist/advanced/p-CitzwxIw.js +1 -0
- package/dist/advanced/p-D4a88iaH.js +7 -0
- package/dist/advanced/p-D5aEHK78.js +1 -0
- package/dist/advanced/p-D6sPnRDQ.js +1 -0
- package/dist/advanced/p-D8Cooryu.js +1 -0
- package/dist/advanced/p-DChj4qx2.js +1 -0
- package/dist/advanced/p-DEKAlpFE.js +1 -0
- package/dist/advanced/p-DO6vGxJP.js +1 -0
- package/dist/advanced/p-DQ1RB1XB.js +1 -0
- package/dist/advanced/p-DQuL1Twl.js +1 -0
- package/dist/advanced/p-DTZUbymc.js +1 -0
- package/dist/advanced/p-DUELYDa7.js +1 -0
- package/dist/advanced/p-DXJS1EXW.js +1 -0
- package/dist/advanced/p-DYKIyOfR.js +1 -0
- package/dist/advanced/p-Dd9TQ3qQ.js +1 -0
- package/dist/advanced/p-DdNwMQsx.js +1 -0
- package/dist/advanced/p-Dl9apb8A.js +1 -0
- package/dist/advanced/p-DogpgTFv.js +1 -0
- package/dist/advanced/p-Dx-FsUbT.js +1 -0
- package/dist/advanced/p-Dz9vozhJ.js +1 -0
- package/dist/advanced/p-EXuVQfpl.js +1 -0
- package/dist/advanced/p-HAy9hTj2.js +1 -0
- package/dist/advanced/p-I8kmugWt.js +1 -0
- package/dist/advanced/p-S3uzYKsD.js +1 -0
- package/dist/advanced/p-WQSantHg.js +1 -0
- package/dist/advanced/p-Yjd8T1ZK.js +1 -0
- package/dist/advanced/p-_AFoWkvk.js +1 -0
- package/dist/advanced/p-aafa98ca.entry.js +1 -0
- package/dist/advanced/p-ab6a2087.entry.js +1 -0
- package/dist/advanced/p-aed71cba.entry.js +1 -0
- package/dist/advanced/p-e0549f37.entry.js +1 -0
- package/dist/advanced/p-ea07ff0e.entry.js +1 -0
- package/dist/advanced/p-ee62b647.entry.js +1 -0
- package/dist/advanced/p-f5148ac0.entry.js +1 -0
- package/dist/advanced/p-f8102c9d.entry.js +1 -0
- package/dist/advanced/p-f87fee01.entry.js +1 -0
- package/dist/advanced/p-gsi3BtH2.js +1 -0
- package/dist/advanced/p-kJe8wHkN.js +1 -0
- package/dist/advanced/p-nxlSIIWU.js +1 -0
- package/dist/advanced/p-smFnxv_V.js +1 -0
- package/dist/advanced/p-x7RF8NVg.js +1 -0
- package/dist/advanced/p-zrH7aO3p.js +1 -0
- package/dist/assets/style/advanced.css +1 -0
- package/dist/assets/style/board.css +0 -0
- package/dist/assets/style/chart.css +1 -0
- package/dist/assets/style/grid.css +0 -0
- package/dist/cjs/_syidax-chart-build-tier-De_XDaQO.js +1 -0
- package/dist/cjs/advanced.cjs.js +1 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +1 -0
- package/dist/cjs/auto-labels-biCCU4IR.js +1 -0
- package/dist/cjs/axis-label-thinning-xlRYEkLr.js +1 -0
- package/dist/cjs/brand-logo-CJN4NV6G.js +1 -0
- package/dist/cjs/brand-mark-default-DvQHU2qS.js +1 -0
- package/dist/cjs/brush-interaction-DLBwLxOH.js +1 -0
- package/dist/cjs/cartesian-contract-BVApIzMy.js +1 -0
- package/dist/cjs/cartesian-frame-interaction-w1OfXe9B.js +1 -0
- package/dist/cjs/cartesian-series-contract-IfUitFYk.js +1 -0
- package/dist/cjs/cf-builder-chunk-D6ajo9Mh.js +1 -0
- package/dist/cjs/chart-brand-CEKOnWyE.js +1 -0
- package/dist/cjs/chart-brand-license-COyo1Vbl.js +1 -0
- package/dist/cjs/chart-element-loader-BGPJwN21.js +1 -0
- package/dist/cjs/chart-license-bridge-DAODso1A.js +1 -0
- package/dist/cjs/chart-streaming-gate-DX4tlXCx.js +1 -0
- package/dist/cjs/column-stack-BbD_lcgG.js +1 -0
- package/dist/cjs/component-runtime-chunk-BCXKlIzs.js +1 -0
- package/dist/cjs/connector-8ebOKxbI.js +1 -0
- package/dist/cjs/contracts-CtPI2qPw.js +1 -0
- package/dist/cjs/data-zoom-model-DWEnQJnh.js +1 -0
- package/dist/cjs/data-zoom-target-BO1_-I0t.js +1 -0
- package/dist/cjs/device-pixel-box-COQLb1eD.js +1 -0
- package/dist/cjs/drawing-export-CdJsjlzv.js +1 -0
- package/dist/cjs/engine-swap-license-BYrMn26A.js +1 -0
- package/dist/cjs/errors-DNua3ZWy.js +1 -0
- package/dist/cjs/grid-import-chunk-BlBvP3p6.js +1 -0
- package/dist/cjs/grid-license-session-BRxDNKOX.js +7 -0
- package/dist/cjs/index-BS2KctDY.js +1 -0
- package/dist/cjs/index-CKeHnO3Q.js +5 -0
- package/dist/cjs/index.cjs.js +1 -0
- package/dist/cjs/interpolate-BWPQ5Hyd.js +1 -0
- package/dist/cjs/legend-CbjQG1uh.js +1 -0
- package/dist/cjs/legend-interaction-Cc6htppF.js +1 -0
- package/dist/cjs/live-object-model-CjPqHT6U.js +1 -0
- package/dist/cjs/loader.cjs.js +1 -0
- package/dist/cjs/number-Dq6GiQsL.js +1 -0
- package/dist/cjs/parse-CoFqMZ-2.js +1 -0
- package/dist/cjs/pie-animator-Bvgo8ICN.js +1 -0
- package/dist/cjs/pie-geometry-d5pwtOxJ.js +1 -0
- package/dist/cjs/point-context-menu-CWB4nv9m.js +1 -0
- package/dist/cjs/resolve-Cti85ZtE.js +1 -0
- package/dist/cjs/row-drag-chunk-kA4TVsmj.js +1 -0
- package/dist/cjs/row-layout-chunk-CyH-tG1Y.js +1 -0
- package/dist/cjs/safe-formatter-B0DDURao.js +1 -0
- package/dist/cjs/scheme-KzZHS7kW.js +1 -0
- package/dist/cjs/standard-engine-status-C4zMZsEh.js +1 -0
- package/dist/cjs/stream-interp-CVi5SGFf.js +1 -0
- package/dist/cjs/sy-area-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-bar-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-bubble-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-chart.cjs.entry.js +2 -0
- package/dist/cjs/sy-column-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-data-zoom.cjs.entry.js +1 -0
- package/dist/cjs/sy-dot-plot-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-dumbbell-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-funnel-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-gauge-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-grid.sy-grid-standard-BNEY4YEK.js +4 -0
- package/dist/cjs/sy-grid_2.cjs.entry.js +1 -0
- package/dist/cjs/sy-histogram-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-item-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-line-chart-path-Cfasx_t5.js +1 -0
- package/dist/cjs/sy-line-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-lollipop-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-marimekko-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-navigator.cjs.entry.js +1 -0
- package/dist/cjs/sy-pareto-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-pictorial-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-pie-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-polar-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-radar-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-scatter-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-stem-leaf-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-tilemap.cjs.entry.js +1 -0
- package/dist/cjs/sy-tornado-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-variwide-chart.cjs.entry.js +1 -0
- package/dist/cjs/sy-visual-map.cjs.entry.js +1 -0
- package/dist/cjs/sy-wafer-correlation.cjs.entry.js +1 -0
- package/dist/cjs/sy-wafer-map.cjs.entry.js +1 -0
- package/dist/cjs/sy-wafer-stack.cjs.entry.js +1 -0
- package/dist/cjs/sy-word-cloud.cjs.entry.js +1 -0
- package/dist/cjs/sy-yield-zone-chart.cjs.entry.js +1 -0
- package/dist/cjs/types-jSXHeK-g.js +1 -0
- package/dist/cjs/viewport-zoom-h9w4q7XJ.js +1 -0
- package/dist/cjs/visual-map-binding-Ddnoet7F.js +1 -0
- package/dist/cjs/wafer-stack-1qlPI-im.js +1 -0
- package/dist/cjs/wafer-value-CZzFL0S-.js +1 -0
- package/dist/cjs/zoom-interaction-C3K9MKr2.js +1 -0
- package/dist/cjs/zoom-window-oCyi6HPg.js +1 -0
- package/dist/collection/collection-manifest.json +213 -0
- package/dist/collection/components/_shared/brand/brand-decision.js +1 -0
- package/dist/collection/components/_shared/brand/brand-export-default.js +1 -0
- package/dist/collection/components/_shared/brand/brand-export.js +1 -0
- package/dist/collection/components/_shared/brand/brand-integrity.js +1 -0
- package/dist/collection/components/_shared/brand/brand-lockup-default.js +1 -0
- package/dist/collection/components/_shared/brand/brand-logo.js +1 -0
- package/dist/collection/components/_shared/brand/brand-mark-default.js +1 -0
- package/dist/collection/components/_shared/brand/brand-mark.js +1 -0
- package/dist/collection/components/_shared/brand/index.js +1 -0
- package/dist/collection/components/_shared/brand/types.js +1 -0
- package/dist/collection/components/chart/_shared/core/a11y/a11y.js +1 -0
- package/dist/collection/components/chart/_shared/core/a11y/contrast.js +1 -0
- package/dist/collection/components/chart/_shared/core/a11y/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/action/action-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/action/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/adapter/animatable-mark.js +1 -0
- package/dist/collection/components/chart/_shared/core/adapter/deferred-pro-renderer.js +1 -0
- package/dist/collection/components/chart/_shared/core/adapter/gpu-availability.js +1 -0
- package/dist/collection/components/chart/_shared/core/adapter/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/adapter/streamable-series.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/flip.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/heatmap-animator.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/interruptible.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/morph-paint-order.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/scene3d-exit.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/stream-interp.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/transition.js +1 -0
- package/dist/collection/components/chart/_shared/core/animation/tween.js +1 -0
- package/dist/collection/components/chart/_shared/core/annotation/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/auto-labels.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/axis-base.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/category-axis.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/label-collision.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/linear-axis.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/log-axis.js +1 -0
- package/dist/collection/components/chart/_shared/core/axis/time-axis.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/brand-placement.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand-config.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand-export.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand-host.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand-lazy.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand-palette.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand-theme.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/chart-brand.js +1 -0
- package/dist/collection/components/chart/_shared/core/brand/license/chart-brand-license.js +1 -0
- package/dist/collection/components/chart/_shared/core/brush/brush-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/brush/brush-geometry.js +1 -0
- package/dist/collection/components/chart/_shared/core/brush/brush-interaction.js +1 -0
- package/dist/collection/components/chart/_shared/core/brush/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/heatmap-color.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/interpolate.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/named-colors.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/parse.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/resolve.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/rgba.js +1 -0
- package/dist/collection/components/chart/_shared/core/color/scheme.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/bar3d-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/box-plot-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/bubble-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/calendar-heatmap-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/candlestick-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/cartesian-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/cartesian-series-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/chord-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/dendrogram-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/density-map-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/error-bar-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/flow-lines-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/gantt-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/geo-map-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/geo-map-features-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/heatmap-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/icicle-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/network-graph-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/parallel-coordinates-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/sankey-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/scatter3d-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/scene3d-camera-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/scene3d-chart-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/scene3d-lighting-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/scene3d-orbit-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/spectrogram-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/sunburst-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/surface3d-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/theme-river-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/treemap-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/contract/waterfall-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/crosshair/category-snap.js +1 -0
- package/dist/collection/components/chart/_shared/core/crosshair/crosshair.js +1 -0
- package/dist/collection/components/chart/_shared/core/crosshair/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/data/dataset.js +1 -0
- package/dist/collection/components/chart/_shared/core/data/encode.js +1 -0
- package/dist/collection/components/chart/_shared/core/data/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/data/transforms.js +1 -0
- package/dist/collection/components/chart/_shared/core/data/values-attribute.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-cursor.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-export.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-hit.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-interaction.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-measure.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-projection.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/drawing-tools.js +1 -0
- package/dist/collection/components/chart/_shared/core/drawing/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/engine/resolve-chart-engine.js +1 -0
- package/dist/collection/components/chart/_shared/core/engine/types.js +1 -0
- package/dist/collection/components/chart/_shared/core/event/hit-test.js +1 -0
- package/dist/collection/components/chart/_shared/core/event/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/event/point-context-menu.js +1 -0
- package/dist/collection/components/chart/_shared/core/event/pointer.js +1 -0
- package/dist/collection/components/chart/_shared/core/export/chart-export.js +2 -0
- package/dist/collection/components/chart/_shared/core/export/data-table.js +1 -0
- package/dist/collection/components/chart/_shared/core/export/html-overlay.js +1 -0
- package/dist/collection/components/chart/_shared/core/export/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/export/svg-fonts.js +1 -0
- package/dist/collection/components/chart/_shared/core/financial-bars.js +1 -0
- package/dist/collection/components/chart/_shared/core/format/datetime.js +1 -0
- package/dist/collection/components/chart/_shared/core/format/duration.js +1 -0
- package/dist/collection/components/chart/_shared/core/format/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/format/number.js +1 -0
- package/dist/collection/components/chart/_shared/core/format/safe-formatter.js +1 -0
- package/dist/collection/components/chart/_shared/core/graph/strongly-connected.js +1 -0
- package/dist/collection/components/chart/_shared/core/hover/highlight.js +1 -0
- package/dist/collection/components/chart/_shared/core/hover/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/axis-label-thinning.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/cartesian-frame-interaction.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/cartesian-frame.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/cartesian-render-domain.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/device-pixel-box.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/frame.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/label-geometry.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/label-obstacle-index.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/legend-interaction.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/legend.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/plot-area.js +1 -0
- package/dist/collection/components/chart/_shared/core/layout/title.js +1 -0
- package/dist/collection/components/chart/_shared/core/license/chart-license-bridge.js +1 -0
- package/dist/collection/components/chart/_shared/core/license/chart-license-features.js +1 -0
- package/dist/collection/components/chart/_shared/core/license/chart-license-notice.js +1 -0
- package/dist/collection/components/chart/_shared/core/limits/point-cap.js +1 -0
- package/dist/collection/components/chart/_shared/core/loading/chart-build-tier.js +1 -0
- package/dist/collection/components/chart/_shared/core/loading/chart-element-loader.js +1 -0
- package/dist/collection/components/chart/_shared/core/loading/chart-load-controller.js +1 -0
- package/dist/collection/components/chart/_shared/core/loading/chart-type-rows.js +1 -0
- package/dist/collection/components/chart/_shared/core/loading/chart-type-table.js +1 -0
- package/dist/collection/components/chart/_shared/core/loading/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/locale/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/locale/locale.js +1 -0
- package/dist/collection/components/chart/_shared/core/math/ease.js +1 -0
- package/dist/collection/components/chart/_shared/core/math/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/math/primitives.js +1 -0
- package/dist/collection/components/chart/_shared/core/math/stat.js +1 -0
- package/dist/collection/components/chart/_shared/core/menu/context-menu.js +1 -0
- package/dist/collection/components/chart/_shared/core/menu/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/numeric/quickselect.js +1 -0
- package/dist/collection/components/chart/_shared/core/numeric/safe-numeric.js +1 -0
- package/dist/collection/components/chart/_shared/core/progressive/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/progressive/progressive-draw.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/band.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/diverging.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/linear.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/log.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/ordinal.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/point.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/pow.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/quantile.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/quantize.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/sequential.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/symlog.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/threshold.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/tick-strategy.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/time-tick-strategy.js +1 -0
- package/dist/collection/components/chart/_shared/core/scale/time.js +1 -0
- package/dist/collection/components/chart/_shared/core/spatial/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/spatial/kdtree.js +1 -0
- package/dist/collection/components/chart/_shared/core/spatial/kernel.js +1 -0
- package/dist/collection/components/chart/_shared/core/spatial/quadtree.js +1 -0
- package/dist/collection/components/chart/_shared/core/state/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/state/state-model.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/batch-flush-runtime.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/batch-flush.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/category-upserts.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/frame-budget.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/keyed-object-stream-runtime.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/keyed-object-stream.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/ring-buffer-runtime.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/ring-buffer.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/stream-source.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/time-window-runtime.js +1 -0
- package/dist/collection/components/chart/_shared/core/stream/time-window.js +1 -0
- package/dist/collection/components/chart/_shared/core/theme/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/theme/theme.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/card-a11y.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/cell-tooltip-controller.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/connector.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/formatter.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/tooltip-engine.js +1 -0
- package/dist/collection/components/chart/_shared/core/tooltip/tooltip-transfer.js +1 -0
- package/dist/collection/components/chart/_shared/core/types.js +1 -0
- package/dist/collection/components/chart/_shared/core/visual-map/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/visual-map/visual-map-binding.js +1 -0
- package/dist/collection/components/chart/_shared/core/visual-map/visual-map-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/crosshair-sync.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/index.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/viewport-zoom.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/zoom-connect.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/zoom-contract.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/zoom-drag.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/zoom-host.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/zoom-interaction.js +1 -0
- package/dist/collection/components/chart/_shared/core/zoom/zoom-window.js +1 -0
- package/dist/collection/components/chart/_shared/render/canvas.js +1 -0
- package/dist/collection/components/chart/_shared/render/index.js +1 -0
- package/dist/collection/components/chart/_shared/render/series.js +1 -0
- package/dist/collection/components/chart/area-chart/core/animation/animator.js +1 -0
- package/dist/collection/components/chart/area-chart/core/animation/easing.js +1 -0
- package/dist/collection/components/chart/area-chart/core/animation/index.js +1 -0
- package/dist/collection/components/chart/area-chart/core/animation/path-morph.js +1 -0
- package/dist/collection/components/chart/area-chart/core/area-chart-core.js +1 -0
- package/dist/collection/components/chart/area-chart/core/area-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/area-chart/core/pattern-kind.js +1 -0
- package/dist/collection/components/chart/area-chart/core/streaming/index.js +1 -0
- package/dist/collection/components/chart/area-chart/core/streaming/ring-buffer-runtime.js +1 -0
- package/dist/collection/components/chart/area-chart/core/streaming/ring-buffer.js +1 -0
- package/dist/collection/components/chart/area-chart/core/streaming/stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/area-chart/core/streaming/stream-source.js +1 -0
- package/dist/collection/components/chart/area-chart/core/types.js +1 -0
- package/dist/collection/components/chart/area-chart/core/visual-regression/baseline.js +1 -0
- package/dist/collection/components/chart/area-chart/core/visual-regression/dom-snapshot.js +1 -0
- package/dist/collection/components/chart/area-chart/core/visual-regression/stream-frame-snapshot.js +1 -0
- package/dist/collection/components/chart/area-chart/engines/standard/area-chart-standard-renderer.js +1 -0
- package/dist/collection/components/chart/area-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/area-chart/engines/standard/sy-area-chart-path.js +1 -0
- package/dist/collection/components/chart/area-chart/index.js +1 -0
- package/dist/collection/components/chart/area-chart/sy-area-chart.css +1 -0
- package/dist/collection/components/chart/area-chart/sy-area-chart.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/animation/animator.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/animation/baseline-grow.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/animation/easing.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/animation/index.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/animation/path-morph.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/bar-border.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/bar-chart-core.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/bar-layout.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/bar-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/streaming/index.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/streaming/ring-buffer-runtime.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/streaming/ring-buffer.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/streaming/stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/streaming/stream-source.js +1 -0
- package/dist/collection/components/chart/bar-chart/core/types.js +1 -0
- package/dist/collection/components/chart/bar-chart/engines/standard/bar-chart-standard-renderer.js +1 -0
- package/dist/collection/components/chart/bar-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/bar-chart/engines/standard/sy-bar-chart-path.js +1 -0
- package/dist/collection/components/chart/bar-chart/index.js +1 -0
- package/dist/collection/components/chart/bar-chart/sy-bar-chart.css +1 -0
- package/dist/collection/components/chart/bar-chart/sy-bar-chart.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-chart-core.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-color.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-data.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-geometry.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-morph.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-pack.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-projection.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/bubble-stream-source.js +1 -0
- package/dist/collection/components/chart/bubble-chart/core/types.js +1 -0
- package/dist/collection/components/chart/bubble-chart/engines/standard/bubble-standard-renderer.js +1 -0
- package/dist/collection/components/chart/bubble-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/bubble-chart/index.js +1 -0
- package/dist/collection/components/chart/bubble-chart/sy-bubble-chart.css +1 -0
- package/dist/collection/components/chart/bubble-chart/sy-bubble-chart.js +1 -0
- package/dist/collection/components/chart/column-chart/core/animation/animator.js +1 -0
- package/dist/collection/components/chart/column-chart/core/animation/easing.js +1 -0
- package/dist/collection/components/chart/column-chart/core/animation/index.js +1 -0
- package/dist/collection/components/chart/column-chart/core/animation/path-morph.js +1 -0
- package/dist/collection/components/chart/column-chart/core/column-border.js +1 -0
- package/dist/collection/components/chart/column-chart/core/column-chart-core.js +1 -0
- package/dist/collection/components/chart/column-chart/core/column-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/column-chart/core/column-stack.js +1 -0
- package/dist/collection/components/chart/column-chart/core/streaming/index.js +1 -0
- package/dist/collection/components/chart/column-chart/core/streaming/ring-buffer-runtime.js +1 -0
- package/dist/collection/components/chart/column-chart/core/streaming/ring-buffer.js +1 -0
- package/dist/collection/components/chart/column-chart/core/streaming/stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/column-chart/core/streaming/stream-source.js +1 -0
- package/dist/collection/components/chart/column-chart/core/types.js +1 -0
- package/dist/collection/components/chart/column-chart/engines/standard/column-chart-standard-renderer.js +1 -0
- package/dist/collection/components/chart/column-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/column-chart/engines/standard/sy-column-chart-path.js +1 -0
- package/dist/collection/components/chart/column-chart/index.js +1 -0
- package/dist/collection/components/chart/column-chart/sy-column-chart.css +1 -0
- package/dist/collection/components/chart/column-chart/sy-column-chart.js +1 -0
- package/dist/collection/components/chart/data-zoom/core/data-zoom-model.js +1 -0
- package/dist/collection/components/chart/data-zoom/core/data-zoom-target.js +1 -0
- package/dist/collection/components/chart/data-zoom/sy-data-zoom.css +1 -0
- package/dist/collection/components/chart/data-zoom/sy-data-zoom.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/core/dot-plot-animator.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/core/dot-plot-chart-core.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/core/dot-plot-geometry.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/core/dot-plot-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/core/dot-plot-stream-source.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/core/types.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/index.js +1 -0
- package/dist/collection/components/chart/dot-plot-chart/sy-dot-plot-chart.css +1 -0
- package/dist/collection/components/chart/dot-plot-chart/sy-dot-plot-chart.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/dumbbell-animator.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/dumbbell-chart-core.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/dumbbell-data.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/dumbbell-geometry.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/dumbbell-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/dumbbell-stream-source.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/core/types.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/index.js +1 -0
- package/dist/collection/components/chart/dumbbell-chart/sy-dumbbell-chart.css +1 -0
- package/dist/collection/components/chart/dumbbell-chart/sy-dumbbell-chart.js +1 -0
- package/dist/collection/components/chart/facade-types.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/funnel-animator.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/funnel-chart-core.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/funnel-geometry.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/funnel-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/funnel-stream-source.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/funnel-tooltip.js +1 -0
- package/dist/collection/components/chart/funnel-chart/core/types.js +1 -0
- package/dist/collection/components/chart/funnel-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/funnel-chart/index.js +1 -0
- package/dist/collection/components/chart/funnel-chart/sy-funnel-chart.css +1 -0
- package/dist/collection/components/chart/funnel-chart/sy-funnel-chart.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/gauge-animator.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/gauge-chart-core.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/gauge-geometry.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/gauge-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/gauge-stream-source.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/gauge-tooltip.js +1 -0
- package/dist/collection/components/chart/gauge-chart/core/types.js +1 -0
- package/dist/collection/components/chart/gauge-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/gauge-chart/index.js +1 -0
- package/dist/collection/components/chart/gauge-chart/sy-gauge-chart.css +1 -0
- package/dist/collection/components/chart/gauge-chart/sy-gauge-chart.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-animator.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-binning.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-chart-core.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-measure.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/histogram-stream-source.js +1 -0
- package/dist/collection/components/chart/histogram-chart/core/types.js +1 -0
- package/dist/collection/components/chart/histogram-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/histogram-chart/index.js +1 -0
- package/dist/collection/components/chart/histogram-chart/sy-histogram-chart.css +1 -0
- package/dist/collection/components/chart/histogram-chart/sy-histogram-chart.js +1 -0
- package/dist/collection/components/chart/item-chart/core/item-chart-core.js +1 -0
- package/dist/collection/components/chart/item-chart/core/item-geometry.js +1 -0
- package/dist/collection/components/chart/item-chart/core/item-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/item-chart/core/item-stream-source.js +1 -0
- package/dist/collection/components/chart/item-chart/core/item-tooltip.js +1 -0
- package/dist/collection/components/chart/item-chart/core/types.js +1 -0
- package/dist/collection/components/chart/item-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/item-chart/index.js +1 -0
- package/dist/collection/components/chart/item-chart/sy-item-chart.css +1 -0
- package/dist/collection/components/chart/item-chart/sy-item-chart.js +1 -0
- package/dist/collection/components/chart/line-chart/core/animation/animator.js +1 -0
- package/dist/collection/components/chart/line-chart/core/animation/easing.js +1 -0
- package/dist/collection/components/chart/line-chart/core/animation/index.js +1 -0
- package/dist/collection/components/chart/line-chart/core/animation/path-morph.js +1 -0
- package/dist/collection/components/chart/line-chart/core/event/hit-test.js +1 -0
- package/dist/collection/components/chart/line-chart/core/event/index.js +1 -0
- package/dist/collection/components/chart/line-chart/core/license/engine-swap-license.js +1 -0
- package/dist/collection/components/chart/line-chart/core/line-chart-core.js +1 -0
- package/dist/collection/components/chart/line-chart/core/pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/line-chart/core/streaming/index.js +1 -0
- package/dist/collection/components/chart/line-chart/core/streaming/ring-buffer-runtime.js +1 -0
- package/dist/collection/components/chart/line-chart/core/streaming/ring-buffer.js +1 -0
- package/dist/collection/components/chart/line-chart/core/streaming/stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/line-chart/core/streaming/stream-source.js +1 -0
- package/dist/collection/components/chart/line-chart/core/types.js +1 -0
- package/dist/collection/components/chart/line-chart/core/visual-regression/baseline.js +1 -0
- package/dist/collection/components/chart/line-chart/core/visual-regression/dom-snapshot.js +1 -0
- package/dist/collection/components/chart/line-chart/core/visual-regression/stream-frame-snapshot.js +1 -0
- package/dist/collection/components/chart/line-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/line-chart/engines/standard/line-chart-standard-renderer.js +1 -0
- package/dist/collection/components/chart/line-chart/engines/standard/sy-line-chart-path.js +1 -0
- package/dist/collection/components/chart/line-chart/index.js +1 -0
- package/dist/collection/components/chart/line-chart/sy-line-chart.css +1 -0
- package/dist/collection/components/chart/line-chart/sy-line-chart.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/core/lollipop-animator.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/core/lollipop-chart-core.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/core/lollipop-geometry.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/core/lollipop-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/core/lollipop-stream-source.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/core/types.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/index.js +1 -0
- package/dist/collection/components/chart/lollipop-chart/sy-lollipop-chart.css +1 -0
- package/dist/collection/components/chart/lollipop-chart/sy-lollipop-chart.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/core/marimekko-animator.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/core/marimekko-chart-core.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/core/marimekko-geometry.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/core/marimekko-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/core/marimekko-stream-source.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/core/types.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/index.js +1 -0
- package/dist/collection/components/chart/marimekko-chart/sy-marimekko-chart.css +1 -0
- package/dist/collection/components/chart/marimekko-chart/sy-marimekko-chart.js +1 -0
- package/dist/collection/components/chart/navigator/core/navigator-preview.js +1 -0
- package/dist/collection/components/chart/navigator/sy-navigator.css +1 -0
- package/dist/collection/components/chart/navigator/sy-navigator.js +1 -0
- package/dist/collection/components/chart/pareto-chart/core/pareto-animator.js +1 -0
- package/dist/collection/components/chart/pareto-chart/core/pareto-chart-core.js +1 -0
- package/dist/collection/components/chart/pareto-chart/core/pareto-geometry.js +1 -0
- package/dist/collection/components/chart/pareto-chart/core/pareto-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/pareto-chart/core/pareto-stream-source.js +1 -0
- package/dist/collection/components/chart/pareto-chart/core/types.js +1 -0
- package/dist/collection/components/chart/pareto-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/pareto-chart/index.js +1 -0
- package/dist/collection/components/chart/pareto-chart/sy-pareto-chart.css +1 -0
- package/dist/collection/components/chart/pareto-chart/sy-pareto-chart.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/path-bounds.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/pictorial-animator.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/pictorial-chart-core.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/pictorial-geometry.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/pictorial-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/pictorial-stream-source.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/core/types.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/index.js +1 -0
- package/dist/collection/components/chart/pictorial-chart/sy-pictorial-chart.css +1 -0
- package/dist/collection/components/chart/pictorial-chart/sy-pictorial-chart.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-animator.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-chart-core.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-flip.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-geometry.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-labels.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-leader-lines.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-stream-source.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/pie-tooltip.js +1 -0
- package/dist/collection/components/chart/pie-chart/core/types.js +1 -0
- package/dist/collection/components/chart/pie-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/pie-chart/index.js +1 -0
- package/dist/collection/components/chart/pie-chart/license/chart-streaming-gate.js +1 -0
- package/dist/collection/components/chart/pie-chart/license/standard-engine-status.js +1 -0
- package/dist/collection/components/chart/pie-chart/sy-pie-chart.css +1 -0
- package/dist/collection/components/chart/pie-chart/sy-pie-chart.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-chart-core.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-geometry.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-pro-records.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-sector-bounds.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-stream-source.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/polar-tooltip.js +1 -0
- package/dist/collection/components/chart/polar-chart/core/types.js +1 -0
- package/dist/collection/components/chart/polar-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/polar-chart/index.js +1 -0
- package/dist/collection/components/chart/polar-chart/sy-polar-chart.css +1 -0
- package/dist/collection/components/chart/polar-chart/sy-polar-chart.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-animator.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-chart-core.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-crosshair.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-geometry.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-stream-source.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/radar-tooltip.js +1 -0
- package/dist/collection/components/chart/radar-chart/core/types.js +1 -0
- package/dist/collection/components/chart/radar-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/radar-chart/index.js +1 -0
- package/dist/collection/components/chart/radar-chart/sy-radar-chart.css +1 -0
- package/dist/collection/components/chart/radar-chart/sy-radar-chart.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/animation/easing.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/animation/index.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/animation/scatter-animator.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/perf.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/scatter-chart-core.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/scatter-draw-signature.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/scatter-pro-renderer-loader.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/streaming/index.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/streaming/scatter-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/streaming/scatter-stream-source.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/types.js +1 -0
- package/dist/collection/components/chart/scatter-chart/core/visual-map.js +1 -0
- package/dist/collection/components/chart/scatter-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/scatter-chart/engines/standard/scatter-chart-standard-renderer.js +1 -0
- package/dist/collection/components/chart/scatter-chart/engines/standard/sy-scatter-chart-path.js +1 -0
- package/dist/collection/components/chart/scatter-chart/index.js +1 -0
- package/dist/collection/components/chart/scatter-chart/sy-scatter-chart.css +1 -0
- package/dist/collection/components/chart/scatter-chart/sy-scatter-chart.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/core/stem-leaf-core.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/core/stem-leaf-model.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/core/stem-leaf-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/core/stem-leaf-stream-source.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/core/stem-leaf-tooltip.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/core/types.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/index.js +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/sy-stem-leaf-chart.css +1 -0
- package/dist/collection/components/chart/stem-leaf-chart/sy-stem-leaf-chart.js +1 -0
- package/dist/collection/components/chart/sy-chart.css +1 -0
- package/dist/collection/components/chart/sy-chart.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/tilemap-core.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/tilemap-geometry.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/tilemap-legend.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/tilemap-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/tilemap-stream-source.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/tilemap-tooltip.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/core/types.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/index.js +1 -0
- package/dist/collection/components/chart/tilemap-chart/sy-tilemap.css +1 -0
- package/dist/collection/components/chart/tilemap-chart/sy-tilemap.js +1 -0
- package/dist/collection/components/chart/tornado-chart/core/tornado-animator.js +1 -0
- package/dist/collection/components/chart/tornado-chart/core/tornado-chart-core.js +1 -0
- package/dist/collection/components/chart/tornado-chart/core/tornado-geometry.js +1 -0
- package/dist/collection/components/chart/tornado-chart/core/tornado-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/tornado-chart/core/tornado-stream-source.js +1 -0
- package/dist/collection/components/chart/tornado-chart/core/types.js +1 -0
- package/dist/collection/components/chart/tornado-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/tornado-chart/index.js +1 -0
- package/dist/collection/components/chart/tornado-chart/sy-tornado-chart.css +1 -0
- package/dist/collection/components/chart/tornado-chart/sy-tornado-chart.js +1 -0
- package/dist/collection/components/chart/variwide-chart/core/types.js +1 -0
- package/dist/collection/components/chart/variwide-chart/core/variwide-animator.js +1 -0
- package/dist/collection/components/chart/variwide-chart/core/variwide-chart-core.js +1 -0
- package/dist/collection/components/chart/variwide-chart/core/variwide-geometry.js +1 -0
- package/dist/collection/components/chart/variwide-chart/core/variwide-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/variwide-chart/core/variwide-stream-source.js +1 -0
- package/dist/collection/components/chart/variwide-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/variwide-chart/index.js +1 -0
- package/dist/collection/components/chart/variwide-chart/sy-variwide-chart.css +1 -0
- package/dist/collection/components/chart/variwide-chart/sy-variwide-chart.js +1 -0
- package/dist/collection/components/chart/visual-map/sy-visual-map.css +1 -0
- package/dist/collection/components/chart/visual-map/sy-visual-map.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/types.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-animator.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-bin.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-correlation.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-defect.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-die-index.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-geometry.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-legend.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-map-core.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-render.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-shot.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-stack.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-stream-source.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-value.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/core/wafer-yield-zone.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/index.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/sy-wafer-correlation.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/sy-wafer-map.css +1 -0
- package/dist/collection/components/chart/wafer-map-chart/sy-wafer-map.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/sy-wafer-stack.js +1 -0
- package/dist/collection/components/chart/wafer-map-chart/sy-yield-zone-chart.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/types.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/word-cloud-core.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/word-layout.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/word-measure.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/word-stream-source-runtime.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/word-stream-source.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/core/word-tooltip.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/engines/standard/index.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/index.js +1 -0
- package/dist/collection/components/chart/word-cloud-chart/sy-word-cloud.css +1 -0
- package/dist/collection/components/chart/word-cloud-chart/sy-word-cloud.js +1 -0
- package/dist/collection/components/dynamic-source.js +1 -0
- package/dist/collection/components/grid/core/a11y/aria-grid.js +1 -0
- package/dist/collection/components/grid/core/a11y/audit-checklist.js +1 -0
- package/dist/collection/components/grid/core/a11y/contrast.js +1 -0
- package/dist/collection/components/grid/core/a11y/screen-reader-transcript.js +1 -0
- package/dist/collection/components/grid/core/a11y/snapshot.js +1 -0
- package/dist/collection/components/grid/core/api/base-types.js +1 -0
- package/dist/collection/components/grid/core/api/contracts.js +1 -0
- package/dist/collection/components/grid/core/api/index.js +1 -0
- package/dist/collection/components/grid/core/api/live-object-model.js +1 -0
- package/dist/collection/components/grid/core/audit/audit-export.js +1 -0
- package/dist/collection/components/grid/core/audit/audit-log.js +1 -0
- package/dist/collection/components/grid/core/brand/grid-brand.js +2 -0
- package/dist/collection/components/grid/core/build-tier.js +1 -0
- package/dist/collection/components/grid/core/cell/cell-class-rules.js +1 -0
- package/dist/collection/components/grid/core/cell/cell-style.js +1 -0
- package/dist/collection/components/grid/core/cell/expression-runtime.js +1 -0
- package/dist/collection/components/grid/core/cell/index.js +1 -0
- package/dist/collection/components/grid/core/cell/renderer-registry.js +1 -0
- package/dist/collection/components/grid/core/cell/value-formatter.js +1 -0
- package/dist/collection/components/grid/core/cell/value-getter.js +1 -0
- package/dist/collection/components/grid/core/cell-cycle.js +1 -0
- package/dist/collection/components/grid/core/cell-flash/cell-flash.js +1 -0
- package/dist/collection/components/grid/core/cell-tooltip/hover-delay.js +1 -0
- package/dist/collection/components/grid/core/cell-tooltip/index.js +1 -0
- package/dist/collection/components/grid/core/cell-tooltip/tooltip-text.js +1 -0
- package/dist/collection/components/grid/core/chart-link/chart-bridge-types-probe.js +1 -0
- package/dist/collection/components/grid/core/clipboard/parse.js +1 -0
- package/dist/collection/components/grid/core/clipboard/paste-plan.js +1 -0
- package/dist/collection/components/grid/core/clipboard/serialize.js +1 -0
- package/dist/collection/components/grid/core/collab-css.js +1 -0
- package/dist/collection/components/grid/core/collab-loader.js +1 -0
- package/dist/collection/components/grid/core/collab-mentions.js +1 -0
- package/dist/collection/components/grid/core/collab-types.js +1 -0
- package/dist/collection/components/grid/core/column/column-auto-size.js +1 -0
- package/dist/collection/components/grid/core/column/column-groups.js +1 -0
- package/dist/collection/components/grid/core/column/column-pin.js +1 -0
- package/dist/collection/components/grid/core/column/column-reorder.js +1 -0
- package/dist/collection/components/grid/core/column/column-resize.js +1 -0
- package/dist/collection/components/grid/core/column/column-sort.js +1 -0
- package/dist/collection/components/grid/core/column/column-state.js +1 -0
- package/dist/collection/components/grid/core/column/column-visibility.js +1 -0
- package/dist/collection/components/grid/core/column/index.js +1 -0
- package/dist/collection/components/grid/core/component/async-value-source.js +1 -0
- package/dist/collection/components/grid/core/component/component-runtime-chunk.js +1 -0
- package/dist/collection/components/grid/core/component/contracts.js +1 -0
- package/dist/collection/components/grid/core/component/editor-adapter.js +1 -0
- package/dist/collection/components/grid/core/component/editor-facade-controller.js +1 -0
- package/dist/collection/components/grid/core/component/editor-validation-presentation.js +1 -0
- package/dist/collection/components/grid/core/component/filter-adapter.js +1 -0
- package/dist/collection/components/grid/core/component/filter-facade-controller.js +1 -0
- package/dist/collection/components/grid/core/component/framework-bridge.js +1 -0
- package/dist/collection/components/grid/core/component/index.js +1 -0
- package/dist/collection/components/grid/core/component/popup-placement.js +1 -0
- package/dist/collection/components/grid/core/component/registry.js +1 -0
- package/dist/collection/components/grid/core/component/renderer-adapter.js +1 -0
- package/dist/collection/components/grid/core/component/renderer-controller.js +1 -0
- package/dist/collection/components/grid/core/component/rich-select-editor.js +1 -0
- package/dist/collection/components/grid/core/component/runtime.js +1 -0
- package/dist/collection/components/grid/core/conditional-format/cf-builder-chunk.js +1 -0
- package/dist/collection/components/grid/core/conditional-format/cf-builder.js +1 -0
- package/dist/collection/components/grid/core/conditional-format/conditional-format.js +1 -0
- package/dist/collection/components/grid/core/context-menu/clipboard.js +1 -0
- package/dist/collection/components/grid/core/context-menu/index.js +1 -0
- package/dist/collection/components/grid/core/context-menu/menu.js +1 -0
- package/dist/collection/components/grid/core/context-menu/types.js +1 -0
- package/dist/collection/components/grid/core/edit/checkbox-editor-render.js +1 -0
- package/dist/collection/components/grid/core/edit/checkbox-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/date-editor-render.js +1 -0
- package/dist/collection/components/grid/core/edit/date-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/date-picker.js +1 -0
- package/dist/collection/components/grid/core/edit/index.js +1 -0
- package/dist/collection/components/grid/core/edit/large-text-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/number-editor-render.js +1 -0
- package/dist/collection/components/grid/core/edit/number-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/prospective-edit.js +1 -0
- package/dist/collection/components/grid/core/edit/row-edit.js +1 -0
- package/dist/collection/components/grid/core/edit/select-editor-render.js +1 -0
- package/dist/collection/components/grid/core/edit/select-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/text-editor-render.js +1 -0
- package/dist/collection/components/grid/core/edit/text-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/textarea-editor-render.js +1 -0
- package/dist/collection/components/grid/core/edit/textarea-editor.js +1 -0
- package/dist/collection/components/grid/core/edit/transaction-api.js +1 -0
- package/dist/collection/components/grid/core/edit/transaction.js +1 -0
- package/dist/collection/components/grid/core/edit/undo-redo.js +1 -0
- package/dist/collection/components/grid/core/empty-state-cycle.js +1 -0
- package/dist/collection/components/grid/core/event/index.js +1 -0
- package/dist/collection/components/grid/core/event/row-click.js +1 -0
- package/dist/collection/components/grid/core/export/csv.js +1 -0
- package/dist/collection/components/grid/core/export/index.js +1 -0
- package/dist/collection/components/grid/core/filter/advanced-query.js +1 -0
- package/dist/collection/components/grid/core/filter/condition-builder.js +1 -0
- package/dist/collection/components/grid/core/filter/date.js +1 -0
- package/dist/collection/components/grid/core/filter/filter-ui-types.js +1 -0
- package/dist/collection/components/grid/core/filter/number.js +1 -0
- package/dist/collection/components/grid/core/filter/quick-filter.js +1 -0
- package/dist/collection/components/grid/core/filter/text.js +1 -0
- package/dist/collection/components/grid/core/filter-cycle.js +1 -0
- package/dist/collection/components/grid/core/floating/index.js +1 -0
- package/dist/collection/components/grid/core/floating/positioning.js +1 -0
- package/dist/collection/components/grid/core/formula-acceleration-loader.js +1 -0
- package/dist/collection/components/grid/core/formula-text.js +1 -0
- package/dist/collection/components/grid/core/grid-core.js +1 -0
- package/dist/collection/components/grid/core/hover/row.js +1 -0
- package/dist/collection/components/grid/core/import/csv/index.js +1 -0
- package/dist/collection/components/grid/core/import/csv/parse-csv.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/cell-ref.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/errors.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/formula.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/grid-import-chunk.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/index.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/inflate.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/merged-cells.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/number-format.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/parse-xlsx.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/pick-sheet.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/shared-strings.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/sheet-streaming.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/sheet.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/styles.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/workbook.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/xml-parser.js +1 -0
- package/dist/collection/components/grid/core/import/xlsx/zip-reader.js +1 -0
- package/dist/collection/components/grid/core/license/grid-acceleration-port.js +3 -0
- package/dist/collection/components/grid/core/license/grid-feature.js +1 -0
- package/dist/collection/components/grid/core/license/grid-license-facade.js +4 -0
- package/dist/collection/components/grid/core/license/grid-license-runtime.js +1 -0
- package/dist/collection/components/grid/core/license/grid-license-session.js +1 -0
- package/dist/collection/components/grid/core/license/grid-license.js +5 -0
- package/dist/collection/components/grid/core/license/grid-method-route.js +1 -0
- package/dist/collection/components/grid/core/license/grid-method-table.js +1 -0
- package/dist/collection/components/grid/core/loader/chunk-contract.js +1 -0
- package/dist/collection/components/grid/core/loader/chunk-loader.js +1 -0
- package/dist/collection/components/grid/core/loading-cycle.js +1 -0
- package/dist/collection/components/grid/core/locale/messages.js +1 -0
- package/dist/collection/components/grid/core/locale/presets.js +1 -0
- package/dist/collection/components/grid/core/locale/resolve.js +1 -0
- package/dist/collection/components/grid/core/numeric/safe-numeric.js +1 -0
- package/dist/collection/components/grid/core/pagination-cycle.js +1 -0
- package/dist/collection/components/grid/core/pipeline/comparator-default.js +1 -0
- package/dist/collection/components/grid/core/pipeline/engine-rows-memo.js +1 -0
- package/dist/collection/components/grid/core/pipeline/filter.js +1 -0
- package/dist/collection/components/grid/core/pipeline/paginate.js +1 -0
- package/dist/collection/components/grid/core/pipeline/pipeline.js +1 -0
- package/dist/collection/components/grid/core/pipeline/sort.js +1 -0
- package/dist/collection/components/grid/core/pipeline/types.js +1 -0
- package/dist/collection/components/grid/core/pivot/combination-warnings.js +1 -0
- package/dist/collection/components/grid/core/pro-chunk-sources.js +1 -0
- package/dist/collection/components/grid/core/pro-engine-loader.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/engine-precedence.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-chunk-backstop.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-chunk-features.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-clipboard-policy.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-declarations.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-engine-license.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-formula-freeze.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-freeze-work.js +1 -0
- package/dist/collection/components/grid/core/pro-gate/grid-pro-gate.js +2 -0
- package/dist/collection/components/grid/core/pro-gate/grid-state-requirements.js +1 -0
- package/dist/collection/components/grid/core/rbac/cell-access.js +1 -0
- package/dist/collection/components/grid/core/row-drag/drag-safety.js +1 -0
- package/dist/collection/components/grid/core/row-drag/drop-zones.js +1 -0
- package/dist/collection/components/grid/core/row-drag/reorder.js +1 -0
- package/dist/collection/components/grid/core/row-drag/row-drag-chunk.js +1 -0
- package/dist/collection/components/grid/core/row-drag/row-drag-facade.js +1 -0
- package/dist/collection/components/grid/core/row-drag/unmanaged-drag.js +1 -0
- package/dist/collection/components/grid/core/row-layout/aligned-grids-facade.js +1 -0
- package/dist/collection/components/grid/core/row-layout/aligned-grids.js +1 -0
- package/dist/collection/components/grid/core/row-layout/col-span.js +1 -0
- package/dist/collection/components/grid/core/row-layout/full-width-facade.js +1 -0
- package/dist/collection/components/grid/core/row-layout/full-width-rows.js +1 -0
- package/dist/collection/components/grid/core/row-layout/pinned-row-policy.js +1 -0
- package/dist/collection/components/grid/core/row-layout/pinned-rows-facade.js +1 -0
- package/dist/collection/components/grid/core/row-layout/pinned-rows.js +1 -0
- package/dist/collection/components/grid/core/row-layout/row-layout-chunk.js +1 -0
- package/dist/collection/components/grid/core/row-layout/row-layout-facade.js +1 -0
- package/dist/collection/components/grid/core/row-layout/row-span.js +1 -0
- package/dist/collection/components/grid/core/row-layout/span-interaction.js +1 -0
- package/dist/collection/components/grid/core/row-markers.js +1 -0
- package/dist/collection/components/grid/core/row-model/block-cache.js +1 -0
- package/dist/collection/components/grid/core/row-model/client-side.js +1 -0
- package/dist/collection/components/grid/core/row-model/datasource.js +1 -0
- package/dist/collection/components/grid/core/row-model/index.js +1 -0
- package/dist/collection/components/grid/core/row-model/infinite.js +1 -0
- package/dist/collection/components/grid/core/row-model/placeholder-row.js +1 -0
- package/dist/collection/components/grid/core/row-model/viewport-adapters.js +1 -0
- package/dist/collection/components/grid/core/selection/canonical-ranges.js +1 -0
- package/dist/collection/components/grid/core/selection/checkbox-column.js +1 -0
- package/dist/collection/components/grid/core/selection/range-bounds.js +1 -0
- package/dist/collection/components/grid/core/selection/row.js +1 -0
- package/dist/collection/components/grid/core/side-bar/side-bar.js +1 -0
- package/dist/collection/components/grid/core/snapshot/snapshot-diff.js +1 -0
- package/dist/collection/components/grid/core/snapshot/snapshot.js +1 -0
- package/dist/collection/components/grid/core/sort-cycle.js +1 -0
- package/dist/collection/components/grid/core/sort-model.js +1 -0
- package/dist/collection/components/grid/core/spreadsheet-text.js +1 -0
- package/dist/collection/components/grid/core/state/canonical.js +1 -0
- package/dist/collection/components/grid/core/state/contracts.js +1 -0
- package/dist/collection/components/grid/core/state/filter-handlers.js +1 -0
- package/dist/collection/components/grid/core/state/find-state.js +1 -0
- package/dist/collection/components/grid/core/state/grid-state.js +1 -0
- package/dist/collection/components/grid/core/state/migrate.js +1 -0
- package/dist/collection/components/grid/core/state/ownership.js +1 -0
- package/dist/collection/components/grid/core/state/persistence.js +1 -0
- package/dist/collection/components/grid/core/state/slices/columns.js +1 -0
- package/dist/collection/components/grid/core/state/slices/filter.js +1 -0
- package/dist/collection/components/grid/core/state/slices/rows.js +1 -0
- package/dist/collection/components/grid/core/state/slices/ui.js +1 -0
- package/dist/collection/components/grid/core/state/state-events.js +1 -0
- package/dist/collection/components/grid/core/state/validate.js +1 -0
- package/dist/collection/components/grid/core/status-bar/status-bar.js +1 -0
- package/dist/collection/components/grid/core/sync/array.js +1 -0
- package/dist/collection/components/grid/core/sync/collab-bridge.js +1 -0
- package/dist/collection/components/grid/core/sync/id.js +1 -0
- package/dist/collection/components/grid/core/sync/text.js +1 -0
- package/dist/collection/components/grid/core/sync/undo-manager.js +1 -0
- package/dist/collection/components/grid/core/theme/apply.js +1 -0
- package/dist/collection/components/grid/core/theme/presets.js +1 -0
- package/dist/collection/components/grid/core/theme/tokens.js +1 -0
- package/dist/collection/components/grid/core/types.js +1 -0
- package/dist/collection/components/grid/core/utils/structural.js +1 -0
- package/dist/collection/components/grid/core/validation/validation.js +1 -0
- package/dist/collection/components/grid/core/virtualizer/cell-virtualizer.js +1 -0
- package/dist/collection/components/grid/core/virtualizer/column-virtualizer.js +1 -0
- package/dist/collection/components/grid/core/virtualizer/index.js +1 -0
- package/dist/collection/components/grid/core/virtualizer/row-virtualizer.js +1 -0
- package/dist/collection/components/grid/core/visual-regression/baseline.js +1 -0
- package/dist/collection/components/grid/core/visual-regression/dom-snapshot.js +1 -0
- package/dist/collection/components/grid/core/visual-regression/real-dom-canonicalise.js +1 -0
- package/dist/collection/components/grid/core/vnode-factory.js +1 -0
- package/dist/collection/components/grid/engines/standard/index.js +1 -0
- package/dist/collection/components/grid/engines/standard/sy-grid-standard.css +1 -0
- package/dist/collection/components/grid/engines/standard/sy-grid-standard.js +1 -0
- package/dist/collection/components/grid/index.js +1 -0
- package/dist/collection/components/grid/sy-grid.css +1 -0
- package/dist/collection/components/grid/sy-grid.js +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/license/base64url.js +1 -0
- package/dist/collection/license/certificate.js +1 -0
- package/dist/collection/license/constants.js +1 -0
- package/dist/collection/license/context.js +1 -0
- package/dist/collection/license/deployment.js +1 -0
- package/dist/collection/license/diagnostic-constants.js +1 -0
- package/dist/collection/license/discovery.js +1 -0
- package/dist/collection/license/errors.js +1 -0
- package/dist/collection/license/evaluate.js +1 -0
- package/dist/collection/license/failure.js +1 -0
- package/dist/collection/license/fetch-license.js +1 -0
- package/dist/collection/license/generated/chart-features.generated.js +1 -0
- package/dist/collection/license/generated/core-features.generated.js +1 -0
- package/dist/collection/license/generated/feature-map.generated.js +1 -0
- package/dist/collection/license/generated/grid-features.generated.js +1 -0
- package/dist/collection/license/generated/products.generated.js +1 -0
- package/dist/collection/license/index.js +1 -0
- package/dist/collection/license/json.js +1 -0
- package/dist/collection/license/jws.js +1 -0
- package/dist/collection/license/registry.js +1 -0
- package/dist/collection/license/release.generated.js +1 -0
- package/dist/collection/license/runtime.js +1 -0
- package/dist/collection/license/subtle.js +1 -0
- package/dist/collection/license/timers.js +1 -0
- package/dist/collection/license/timestamp.js +1 -0
- package/dist/collection/license/trust-keys.generated.js +1 -0
- package/dist/collection/license/trust-store.js +1 -0
- package/dist/collection/license/types.js +1 -0
- package/dist/collection/license/verify.js +1 -0
- package/dist/collection/license/watch.js +1 -0
- package/dist/collection/utils/story-template.js +1 -0
- package/dist/components/chart-types.d.ts +112 -0
- package/dist/components/chart-types.js +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-4CjYGJmq.js +1 -0
- package/dist/components/p-B2xXnkZp.js +1 -0
- package/dist/components/p-B3gMdXEP.js +1 -0
- package/dist/components/p-BEKrg3SG.js +1 -0
- package/dist/components/p-BKZM2o7w.js +1 -0
- package/dist/components/p-BMJUs2xT.js +1 -0
- package/dist/components/p-BPmwlQtL.js +1 -0
- package/dist/components/p-BVmDGX0a.js +1 -0
- package/dist/components/p-BXmzh2Uk.js +1 -0
- package/dist/components/p-BY5ObKGD.js +1 -0
- package/dist/components/p-BYBaMhHn.js +1 -0
- package/dist/components/p-BjWO1Np_.js +7 -0
- package/dist/components/p-BsBcTKjx.js +1 -0
- package/dist/components/p-BwM4aW0R.js +1 -0
- package/dist/components/p-BwtrZuf8.js +1 -0
- package/dist/components/p-C0f63Npv.js +1 -0
- package/dist/components/p-C1RaN8eG.js +1 -0
- package/dist/components/p-C374wsaF.js +1 -0
- package/dist/components/p-C3jLZ9n2.js +1 -0
- package/dist/components/p-C4HtF7VM.js +1 -0
- package/dist/components/p-C7iceRLc.js +1 -0
- package/dist/components/p-CChSqEEO.js +1 -0
- package/dist/components/p-CHzVSIZc.js +1 -0
- package/dist/components/p-COVKN1k-.js +1 -0
- package/dist/components/p-COqnXkRL.js +1 -0
- package/dist/components/p-CTw0rE8p.js +1 -0
- package/dist/components/p-C_2TIPHD.js +1 -0
- package/dist/components/p-CgUI9S4_.js +1 -0
- package/dist/components/p-Cr85dazN.js +1 -0
- package/dist/components/p-CsYy63Zk.js +1 -0
- package/dist/components/p-D0Zr5HHA.js +1 -0
- package/dist/components/p-D3LVx-JL.js +1 -0
- package/dist/components/p-D5aEHK78.js +1 -0
- package/dist/components/p-D5noTyYE.js +1 -0
- package/dist/components/p-D7cSRpbb.js +1 -0
- package/dist/components/p-D8Cooryu.js +1 -0
- package/dist/components/p-DC8q69mD.js +1 -0
- package/dist/components/p-DH8K7zqB.js +1 -0
- package/dist/components/p-DO6vGxJP.js +1 -0
- package/dist/components/p-DQ1RB1XB.js +1 -0
- package/dist/components/p-DTZUbymc.js +1 -0
- package/dist/components/p-DaxJ0D3O.js +1 -0
- package/dist/components/p-DhcQQtwn.js +1 -0
- package/dist/components/p-DlE5rQTs.js +1 -0
- package/dist/components/p-DmhWH-SN.js +1 -0
- package/dist/components/p-DovcCKwV.js +1 -0
- package/dist/components/p-Dx-FsUbT.js +1 -0
- package/dist/components/p-EXuVQfpl.js +1 -0
- package/dist/components/p-GI1Zoo93.js +1 -0
- package/dist/components/p-Qu4itcma.js +1 -0
- package/dist/components/p-S3uzYKsD.js +1 -0
- package/dist/components/p-WQSantHg.js +1 -0
- package/dist/components/p-kJe8wHkN.js +1 -0
- package/dist/components/p-rwo1tgqX.js +1 -0
- package/dist/components/package.json +1 -0
- package/dist/components/sy-area-chart.d.ts +8 -0
- package/dist/components/sy-area-chart.js +1 -0
- package/dist/components/sy-bar-chart.d.ts +8 -0
- package/dist/components/sy-bar-chart.js +1 -0
- package/dist/components/sy-bubble-chart.d.ts +8 -0
- package/dist/components/sy-bubble-chart.js +1 -0
- package/dist/components/sy-chart.d.ts +8 -0
- package/dist/components/sy-chart.js +1 -0
- package/dist/components/sy-column-chart.d.ts +8 -0
- package/dist/components/sy-column-chart.js +1 -0
- package/dist/components/sy-data-zoom.d.ts +8 -0
- package/dist/components/sy-data-zoom.js +1 -0
- package/dist/components/sy-dot-plot-chart.d.ts +8 -0
- package/dist/components/sy-dot-plot-chart.js +1 -0
- package/dist/components/sy-dumbbell-chart.d.ts +8 -0
- package/dist/components/sy-dumbbell-chart.js +1 -0
- package/dist/components/sy-funnel-chart.d.ts +8 -0
- package/dist/components/sy-funnel-chart.js +1 -0
- package/dist/components/sy-gauge-chart.d.ts +8 -0
- package/dist/components/sy-gauge-chart.js +1 -0
- package/dist/components/sy-grid-standard.d.ts +8 -0
- package/dist/components/sy-grid-standard.js +1 -0
- package/dist/components/sy-grid.d.ts +8 -0
- package/dist/components/sy-grid.js +4 -0
- package/dist/components/sy-histogram-chart.d.ts +8 -0
- package/dist/components/sy-histogram-chart.js +1 -0
- package/dist/components/sy-item-chart.d.ts +8 -0
- package/dist/components/sy-item-chart.js +1 -0
- package/dist/components/sy-line-chart.d.ts +8 -0
- package/dist/components/sy-line-chart.js +1 -0
- package/dist/components/sy-lollipop-chart.d.ts +8 -0
- package/dist/components/sy-lollipop-chart.js +1 -0
- package/dist/components/sy-marimekko-chart.d.ts +8 -0
- package/dist/components/sy-marimekko-chart.js +1 -0
- package/dist/components/sy-navigator.d.ts +8 -0
- package/dist/components/sy-navigator.js +1 -0
- package/dist/components/sy-pareto-chart.d.ts +8 -0
- package/dist/components/sy-pareto-chart.js +1 -0
- package/dist/components/sy-pictorial-chart.d.ts +8 -0
- package/dist/components/sy-pictorial-chart.js +1 -0
- package/dist/components/sy-pie-chart.d.ts +8 -0
- package/dist/components/sy-pie-chart.js +1 -0
- package/dist/components/sy-polar-chart.d.ts +8 -0
- package/dist/components/sy-polar-chart.js +1 -0
- package/dist/components/sy-radar-chart.d.ts +8 -0
- package/dist/components/sy-radar-chart.js +1 -0
- package/dist/components/sy-scatter-chart.d.ts +8 -0
- package/dist/components/sy-scatter-chart.js +1 -0
- package/dist/components/sy-stem-leaf-chart.d.ts +8 -0
- package/dist/components/sy-stem-leaf-chart.js +1 -0
- package/dist/components/sy-tilemap.d.ts +8 -0
- package/dist/components/sy-tilemap.js +1 -0
- package/dist/components/sy-tornado-chart.d.ts +8 -0
- package/dist/components/sy-tornado-chart.js +1 -0
- package/dist/components/sy-variwide-chart.d.ts +8 -0
- package/dist/components/sy-variwide-chart.js +1 -0
- package/dist/components/sy-visual-map.d.ts +8 -0
- package/dist/components/sy-visual-map.js +1 -0
- package/dist/components/sy-wafer-correlation.d.ts +8 -0
- package/dist/components/sy-wafer-correlation.js +1 -0
- package/dist/components/sy-wafer-map.d.ts +8 -0
- package/dist/components/sy-wafer-map.js +1 -0
- package/dist/components/sy-wafer-stack.d.ts +8 -0
- package/dist/components/sy-wafer-stack.js +1 -0
- package/dist/components/sy-word-cloud.d.ts +8 -0
- package/dist/components/sy-word-cloud.js +1 -0
- package/dist/components/sy-yield-zone-chart.d.ts +8 -0
- package/dist/components/sy-yield-zone-chart.js +1 -0
- package/dist/esm/_syidax-chart-build-tier-C374wsaF.js +1 -0
- package/dist/esm/advanced.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +1 -0
- package/dist/esm/auto-labels-DYKIyOfR.js +1 -0
- package/dist/esm/axis-label-thinning-S3uzYKsD.js +1 -0
- package/dist/esm/brand-logo-BXzIll5N.js +1 -0
- package/dist/esm/brand-mark-default-AzDRbG7D.js +1 -0
- package/dist/esm/brush-interaction-Dz9vozhJ.js +1 -0
- package/dist/esm/cartesian-contract-DogpgTFv.js +1 -0
- package/dist/esm/cartesian-frame-interaction-BC4761vn.js +1 -0
- package/dist/esm/cartesian-series-contract-zrH7aO3p.js +1 -0
- package/dist/esm/cf-builder-chunk-BqLdIDeK.js +1 -0
- package/dist/esm/chart-brand-_HhzGz4E.js +1 -0
- package/dist/esm/chart-brand-license-2N_At2Bk.js +1 -0
- package/dist/esm/chart-element-loader-DdX3JJh2.js +1 -0
- package/dist/esm/chart-license-bridge-BuvMRxsm.js +1 -0
- package/dist/esm/chart-streaming-gate-CXnkXyxT.js +1 -0
- package/dist/esm/column-stack-C61nYCOk.js +1 -0
- package/dist/esm/component-runtime-chunk-BDJ-kk9r.js +1 -0
- package/dist/esm/connector-C0f63Npv.js +1 -0
- package/dist/esm/contracts-Dx-FsUbT.js +1 -0
- package/dist/esm/data-zoom-model-C76mzN9Y.js +1 -0
- package/dist/esm/data-zoom-target-Dd9TQ3qQ.js +1 -0
- package/dist/esm/device-pixel-box-BKZM2o7w.js +1 -0
- package/dist/esm/drawing-export-BYBaMhHn.js +1 -0
- package/dist/esm/engine-swap-license-CwIR5SyJ.js +1 -0
- package/dist/esm/errors-DUELYDa7.js +1 -0
- package/dist/esm/grid-import-chunk-4CjYGJmq.js +1 -0
- package/dist/esm/grid-license-session-ChWa3h9U.js +7 -0
- package/dist/esm/index-D6-RUOhD.js +1 -0
- package/dist/esm/index-DChj4qx2.js +5 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/interpolate-D5aEHK78.js +1 -0
- package/dist/esm/legend-BwM4aW0R.js +1 -0
- package/dist/esm/legend-interaction-BVmDGX0a.js +1 -0
- package/dist/esm/live-object-model-BsBcTKjx.js +1 -0
- package/dist/esm/loader.js +1 -0
- package/dist/esm/number-D8Cooryu.js +1 -0
- package/dist/esm/parse-EXuVQfpl.js +1 -0
- package/dist/esm/pie-animator-DQ1RB1XB.js +1 -0
- package/dist/esm/pie-geometry-C1RaN8eG.js +1 -0
- package/dist/esm/point-context-menu-B6K1arcd.js +1 -0
- package/dist/esm/resolve-CitzwxIw.js +1 -0
- package/dist/esm/row-drag-chunk-DorjnyoH.js +1 -0
- package/dist/esm/row-layout-chunk-HmpHDcvM.js +1 -0
- package/dist/esm/safe-formatter-DO6vGxJP.js +1 -0
- package/dist/esm/scheme-BwtrZuf8.js +1 -0
- package/dist/esm/standard-engine-status-mIwM2Z1u.js +1 -0
- package/dist/esm/stream-interp-DTZUbymc.js +1 -0
- package/dist/esm/sy-area-chart.entry.js +1 -0
- package/dist/esm/sy-bar-chart.entry.js +1 -0
- package/dist/esm/sy-bubble-chart.entry.js +1 -0
- package/dist/esm/sy-chart.entry.js +2 -0
- package/dist/esm/sy-column-chart.entry.js +1 -0
- package/dist/esm/sy-data-zoom.entry.js +1 -0
- package/dist/esm/sy-dot-plot-chart.entry.js +1 -0
- package/dist/esm/sy-dumbbell-chart.entry.js +1 -0
- package/dist/esm/sy-funnel-chart.entry.js +1 -0
- package/dist/esm/sy-gauge-chart.entry.js +1 -0
- package/dist/esm/sy-grid.sy-grid-standard-BXtFit4h.js +4 -0
- package/dist/esm/sy-grid_2.entry.js +1 -0
- package/dist/esm/sy-histogram-chart.entry.js +1 -0
- package/dist/esm/sy-item-chart.entry.js +1 -0
- package/dist/esm/sy-line-chart-path-CIwqM40T.js +1 -0
- package/dist/esm/sy-line-chart.entry.js +1 -0
- package/dist/esm/sy-lollipop-chart.entry.js +1 -0
- package/dist/esm/sy-marimekko-chart.entry.js +1 -0
- package/dist/esm/sy-navigator.entry.js +1 -0
- package/dist/esm/sy-pareto-chart.entry.js +1 -0
- package/dist/esm/sy-pictorial-chart.entry.js +1 -0
- package/dist/esm/sy-pie-chart.entry.js +1 -0
- package/dist/esm/sy-polar-chart.entry.js +1 -0
- package/dist/esm/sy-radar-chart.entry.js +1 -0
- package/dist/esm/sy-scatter-chart.entry.js +1 -0
- package/dist/esm/sy-stem-leaf-chart.entry.js +1 -0
- package/dist/esm/sy-tilemap.entry.js +1 -0
- package/dist/esm/sy-tornado-chart.entry.js +1 -0
- package/dist/esm/sy-variwide-chart.entry.js +1 -0
- package/dist/esm/sy-visual-map.entry.js +1 -0
- package/dist/esm/sy-wafer-correlation.entry.js +1 -0
- package/dist/esm/sy-wafer-map.entry.js +1 -0
- package/dist/esm/sy-wafer-stack.entry.js +1 -0
- package/dist/esm/sy-word-cloud.entry.js +1 -0
- package/dist/esm/sy-yield-zone-chart.entry.js +1 -0
- package/dist/esm/types-x7RF8NVg.js +1 -0
- package/dist/esm/viewport-zoom-WQSantHg.js +1 -0
- package/dist/esm/visual-map-binding-DiSr3bTW.js +1 -0
- package/dist/esm/wafer-stack-Bg3YP3SU.js +1 -0
- package/dist/esm/wafer-value-BntCdxpN.js +1 -0
- package/dist/esm/zoom-interaction-DIwGXfJu.js +1 -0
- package/dist/esm/zoom-window-D6sPnRDQ.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/license/base64url.d.ts +3 -0
- package/dist/license/base64url.js +1 -0
- package/dist/license/certificate.d.ts +48 -0
- package/dist/license/certificate.js +1 -0
- package/dist/license/constants.d.ts +38 -0
- package/dist/license/constants.js +1 -0
- package/dist/license/context.d.ts +6 -0
- package/dist/license/context.js +1 -0
- package/dist/license/deployment.d.ts +9 -0
- package/dist/license/deployment.js +1 -0
- package/dist/license/diagnostic-constants.d.ts +7 -0
- package/dist/license/diagnostic-constants.js +1 -0
- package/dist/license/discovery.d.ts +10 -0
- package/dist/license/discovery.js +1 -0
- package/dist/license/errors.d.ts +47 -0
- package/dist/license/errors.js +1 -0
- package/dist/license/evaluate.d.ts +19 -0
- package/dist/license/evaluate.js +1 -0
- package/dist/license/failure.d.ts +11 -0
- package/dist/license/failure.js +1 -0
- package/dist/license/fetch-license.d.ts +12 -0
- package/dist/license/fetch-license.js +1 -0
- package/dist/license/generated/chart-features.generated.d.ts +2244 -0
- package/dist/license/generated/chart-features.generated.js +1 -0
- package/dist/license/generated/core-features.generated.d.ts +349 -0
- package/dist/license/generated/core-features.generated.js +1 -0
- package/dist/license/generated/feature-map.generated.d.ts +4 -0
- package/dist/license/generated/feature-map.generated.js +1 -0
- package/dist/license/generated/grid-features.generated.d.ts +3681 -0
- package/dist/license/generated/grid-features.generated.js +1 -0
- package/dist/license/generated/products.generated.d.ts +26 -0
- package/dist/license/generated/products.generated.js +1 -0
- package/dist/license/index.d.ts +15 -0
- package/dist/license/index.js +1 -0
- package/dist/license/json.d.ts +4 -0
- package/dist/license/json.js +1 -0
- package/dist/license/jws.d.ts +9 -0
- package/dist/license/jws.js +1 -0
- package/dist/license/registry.d.ts +37 -0
- package/dist/license/registry.js +1 -0
- package/dist/license/release.generated.d.ts +6 -0
- package/dist/license/release.generated.js +1 -0
- package/dist/license/runtime.d.ts +27 -0
- package/dist/license/runtime.js +1 -0
- package/dist/license/subtle.d.ts +5 -0
- package/dist/license/subtle.js +1 -0
- package/dist/license/timers.d.ts +6 -0
- package/dist/license/timers.js +1 -0
- package/dist/license/timestamp.d.ts +1 -0
- package/dist/license/timestamp.js +1 -0
- package/dist/license/trust-keys.generated.d.ts +3 -0
- package/dist/license/trust-keys.generated.js +1 -0
- package/dist/license/trust-store.d.ts +6 -0
- package/dist/license/trust-store.js +1 -0
- package/dist/license/types.d.ts +85 -0
- package/dist/license/types.js +1 -0
- package/dist/license/verify.d.ts +30 -0
- package/dist/license/verify.js +1 -0
- package/dist/license/watch.d.ts +18 -0
- package/dist/license/watch.js +1 -0
- package/dist/types/components/_shared/brand/brand-decision.d.ts +3 -0
- package/dist/types/components/_shared/brand/brand-export-default.d.ts +32 -0
- package/dist/types/components/_shared/brand/brand-export.d.ts +34 -0
- package/dist/types/components/_shared/brand/brand-integrity.d.ts +2 -0
- package/dist/types/components/_shared/brand/brand-lockup-default.d.ts +5 -0
- package/dist/types/components/_shared/brand/brand-logo.d.ts +22 -0
- package/dist/types/components/_shared/brand/brand-mark-default.d.ts +52 -0
- package/dist/types/components/_shared/brand/brand-mark.d.ts +22 -0
- package/dist/types/components/_shared/brand/index.d.ts +5 -0
- package/dist/types/components/_shared/brand/types.d.ts +41 -0
- package/dist/types/components/chart/_shared/core/a11y/a11y.d.ts +16 -0
- package/dist/types/components/chart/_shared/core/a11y/contrast.d.ts +24 -0
- package/dist/types/components/chart/_shared/core/a11y/index.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/action/action-contract.d.ts +29 -0
- package/dist/types/components/chart/_shared/core/action/index.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/adapter/animatable-mark.d.ts +51 -0
- package/dist/types/components/chart/_shared/core/adapter/deferred-pro-renderer.d.ts +8 -0
- package/dist/types/components/chart/_shared/core/adapter/gpu-availability.d.ts +10 -0
- package/dist/types/components/chart/_shared/core/adapter/index.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/adapter/streamable-series.d.ts +18 -0
- package/dist/types/components/chart/_shared/core/animation/flip.d.ts +65 -0
- package/dist/types/components/chart/_shared/core/animation/heatmap-animator.d.ts +27 -0
- package/dist/types/components/chart/_shared/core/animation/index.d.ts +4 -0
- package/dist/types/components/chart/_shared/core/animation/interruptible.d.ts +48 -0
- package/dist/types/components/chart/_shared/core/animation/morph-paint-order.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/animation/scene3d-exit.d.ts +24 -0
- package/dist/types/components/chart/_shared/core/animation/stream-interp.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/animation/transition.d.ts +83 -0
- package/dist/types/components/chart/_shared/core/animation/tween.d.ts +16 -0
- package/dist/types/components/chart/_shared/core/annotation/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/axis/auto-labels.d.ts +21 -0
- package/dist/types/components/chart/_shared/core/axis/axis-base.d.ts +40 -0
- package/dist/types/components/chart/_shared/core/axis/category-axis.d.ts +24 -0
- package/dist/types/components/chart/_shared/core/axis/index.d.ts +7 -0
- package/dist/types/components/chart/_shared/core/axis/label-collision.d.ts +34 -0
- package/dist/types/components/chart/_shared/core/axis/linear-axis.d.ts +23 -0
- package/dist/types/components/chart/_shared/core/axis/log-axis.d.ts +25 -0
- package/dist/types/components/chart/_shared/core/axis/time-axis.d.ts +25 -0
- package/dist/types/components/chart/_shared/core/brand/brand-placement.d.ts +29 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand-config.d.ts +12 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand-export.d.ts +20 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand-host.d.ts +30 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand-lazy.d.ts +6 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand-palette.d.ts +7 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand-theme.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/brand/chart-brand.d.ts +13 -0
- package/dist/types/components/chart/_shared/core/brand/license/chart-brand-license.d.ts +20 -0
- package/dist/types/components/chart/_shared/core/brush/brush-contract.d.ts +101 -0
- package/dist/types/components/chart/_shared/core/brush/brush-geometry.d.ts +61 -0
- package/dist/types/components/chart/_shared/core/brush/brush-interaction.d.ts +63 -0
- package/dist/types/components/chart/_shared/core/brush/index.d.ts +6 -0
- package/dist/types/components/chart/_shared/core/color/heatmap-color.d.ts +28 -0
- package/dist/types/components/chart/_shared/core/color/index.d.ts +5 -0
- package/dist/types/components/chart/_shared/core/color/interpolate.d.ts +33 -0
- package/dist/types/components/chart/_shared/core/color/named-colors.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/color/parse.d.ts +8 -0
- package/dist/types/components/chart/_shared/core/color/resolve.d.ts +20 -0
- package/dist/types/components/chart/_shared/core/color/rgba.d.ts +6 -0
- package/dist/types/components/chart/_shared/core/color/scheme.d.ts +43 -0
- package/dist/types/components/chart/_shared/core/contract/bar3d-contract.d.ts +140 -0
- package/dist/types/components/chart/_shared/core/contract/box-plot-contract.d.ts +138 -0
- package/dist/types/components/chart/_shared/core/contract/bubble-contract.d.ts +118 -0
- package/dist/types/components/chart/_shared/core/contract/calendar-heatmap-contract.d.ts +77 -0
- package/dist/types/components/chart/_shared/core/contract/candlestick-contract.d.ts +204 -0
- package/dist/types/components/chart/_shared/core/contract/cartesian-contract.d.ts +186 -0
- package/dist/types/components/chart/_shared/core/contract/cartesian-series-contract.d.ts +270 -0
- package/dist/types/components/chart/_shared/core/contract/chord-contract.d.ts +183 -0
- package/dist/types/components/chart/_shared/core/contract/dendrogram-contract.d.ts +168 -0
- package/dist/types/components/chart/_shared/core/contract/density-map-contract.d.ts +115 -0
- package/dist/types/components/chart/_shared/core/contract/error-bar-contract.d.ts +98 -0
- package/dist/types/components/chart/_shared/core/contract/flow-lines-contract.d.ts +138 -0
- package/dist/types/components/chart/_shared/core/contract/gantt-contract.d.ts +358 -0
- package/dist/types/components/chart/_shared/core/contract/geo-map-contract.d.ts +367 -0
- package/dist/types/components/chart/_shared/core/contract/geo-map-features-contract.d.ts +42 -0
- package/dist/types/components/chart/_shared/core/contract/heatmap-contract.d.ts +94 -0
- package/dist/types/components/chart/_shared/core/contract/icicle-contract.d.ts +141 -0
- package/dist/types/components/chart/_shared/core/contract/index.d.ts +15 -0
- package/dist/types/components/chart/_shared/core/contract/network-graph-contract.d.ts +271 -0
- package/dist/types/components/chart/_shared/core/contract/parallel-coordinates-contract.d.ts +274 -0
- package/dist/types/components/chart/_shared/core/contract/sankey-contract.d.ts +189 -0
- package/dist/types/components/chart/_shared/core/contract/scatter3d-contract.d.ts +124 -0
- package/dist/types/components/chart/_shared/core/contract/scene3d-camera-contract.d.ts +27 -0
- package/dist/types/components/chart/_shared/core/contract/scene3d-chart-contract.d.ts +29 -0
- package/dist/types/components/chart/_shared/core/contract/scene3d-lighting-contract.d.ts +42 -0
- package/dist/types/components/chart/_shared/core/contract/scene3d-orbit-contract.d.ts +38 -0
- package/dist/types/components/chart/_shared/core/contract/spectrogram-contract.d.ts +82 -0
- package/dist/types/components/chart/_shared/core/contract/sunburst-contract.d.ts +145 -0
- package/dist/types/components/chart/_shared/core/contract/surface3d-contract.d.ts +150 -0
- package/dist/types/components/chart/_shared/core/contract/theme-river-contract.d.ts +167 -0
- package/dist/types/components/chart/_shared/core/contract/treemap-contract.d.ts +138 -0
- package/dist/types/components/chart/_shared/core/contract/waterfall-contract.d.ts +96 -0
- package/dist/types/components/chart/_shared/core/crosshair/category-snap.d.ts +20 -0
- package/dist/types/components/chart/_shared/core/crosshair/crosshair.d.ts +65 -0
- package/dist/types/components/chart/_shared/core/crosshair/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/data/dataset.d.ts +42 -0
- package/dist/types/components/chart/_shared/core/data/encode.d.ts +40 -0
- package/dist/types/components/chart/_shared/core/data/index.d.ts +4 -0
- package/dist/types/components/chart/_shared/core/data/transforms.d.ts +106 -0
- package/dist/types/components/chart/_shared/core/data/values-attribute.d.ts +4 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-contract.d.ts +240 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-cursor.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-export.d.ts +11 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-hit.d.ts +12 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-interaction.d.ts +79 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-measure.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-projection.d.ts +35 -0
- package/dist/types/components/chart/_shared/core/drawing/drawing-tools.d.ts +68 -0
- package/dist/types/components/chart/_shared/core/drawing/index.d.ts +14 -0
- package/dist/types/components/chart/_shared/core/engine/resolve-chart-engine.d.ts +25 -0
- package/dist/types/components/chart/_shared/core/engine/types.d.ts +44 -0
- package/dist/types/components/chart/_shared/core/event/hit-test.d.ts +37 -0
- package/dist/types/components/chart/_shared/core/event/index.d.ts +3 -0
- package/dist/types/components/chart/_shared/core/event/point-context-menu.d.ts +22 -0
- package/dist/types/components/chart/_shared/core/event/pointer.d.ts +25 -0
- package/dist/types/components/chart/_shared/core/export/chart-export.d.ts +37 -0
- package/dist/types/components/chart/_shared/core/export/data-table.d.ts +22 -0
- package/dist/types/components/chart/_shared/core/export/html-overlay.d.ts +61 -0
- package/dist/types/components/chart/_shared/core/export/index.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/export/svg-fonts.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/financial-bars.d.ts +29 -0
- package/dist/types/components/chart/_shared/core/format/datetime.d.ts +14 -0
- package/dist/types/components/chart/_shared/core/format/duration.d.ts +10 -0
- package/dist/types/components/chart/_shared/core/format/index.d.ts +3 -0
- package/dist/types/components/chart/_shared/core/format/number.d.ts +15 -0
- package/dist/types/components/chart/_shared/core/format/safe-formatter.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/graph/strongly-connected.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/hover/highlight.d.ts +37 -0
- package/dist/types/components/chart/_shared/core/hover/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/index.d.ts +16 -0
- package/dist/types/components/chart/_shared/core/layout/axis-label-thinning.d.ts +19 -0
- package/dist/types/components/chart/_shared/core/layout/cartesian-frame-interaction.d.ts +56 -0
- package/dist/types/components/chart/_shared/core/layout/cartesian-frame.d.ts +119 -0
- package/dist/types/components/chart/_shared/core/layout/cartesian-render-domain.d.ts +14 -0
- package/dist/types/components/chart/_shared/core/layout/device-pixel-box.d.ts +13 -0
- package/dist/types/components/chart/_shared/core/layout/frame.d.ts +54 -0
- package/dist/types/components/chart/_shared/core/layout/index.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/layout/label-geometry.d.ts +19 -0
- package/dist/types/components/chart/_shared/core/layout/label-obstacle-index.d.ts +35 -0
- package/dist/types/components/chart/_shared/core/layout/legend-interaction.d.ts +39 -0
- package/dist/types/components/chart/_shared/core/layout/legend.d.ts +81 -0
- package/dist/types/components/chart/_shared/core/layout/plot-area.d.ts +83 -0
- package/dist/types/components/chart/_shared/core/layout/title.d.ts +55 -0
- package/dist/types/components/chart/_shared/core/license/chart-license-bridge.d.ts +46 -0
- package/dist/types/components/chart/_shared/core/license/chart-license-features.d.ts +13 -0
- package/dist/types/components/chart/_shared/core/license/chart-license-notice.d.ts +24 -0
- package/dist/types/components/chart/_shared/core/limits/point-cap.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/loading/chart-build-tier.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/loading/chart-element-loader.d.ts +51 -0
- package/dist/types/components/chart/_shared/core/loading/chart-load-controller.d.ts +51 -0
- package/dist/types/components/chart/_shared/core/loading/chart-type-rows.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/loading/chart-type-table.d.ts +33 -0
- package/dist/types/components/chart/_shared/core/loading/index.d.ts +6 -0
- package/dist/types/components/chart/_shared/core/locale/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/locale/locale.d.ts +39 -0
- package/dist/types/components/chart/_shared/core/math/ease.d.ts +31 -0
- package/dist/types/components/chart/_shared/core/math/index.d.ts +3 -0
- package/dist/types/components/chart/_shared/core/math/primitives.d.ts +11 -0
- package/dist/types/components/chart/_shared/core/math/stat.d.ts +15 -0
- package/dist/types/components/chart/_shared/core/menu/context-menu.d.ts +24 -0
- package/dist/types/components/chart/_shared/core/menu/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/numeric/quickselect.d.ts +4 -0
- package/dist/types/components/chart/_shared/core/numeric/safe-numeric.d.ts +17 -0
- package/dist/types/components/chart/_shared/core/progressive/index.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/progressive/progressive-draw.d.ts +31 -0
- package/dist/types/components/chart/_shared/core/scale/band.d.ts +27 -0
- package/dist/types/components/chart/_shared/core/scale/diverging.d.ts +19 -0
- package/dist/types/components/chart/_shared/core/scale/index.d.ts +15 -0
- package/dist/types/components/chart/_shared/core/scale/linear.d.ts +28 -0
- package/dist/types/components/chart/_shared/core/scale/log.d.ts +30 -0
- package/dist/types/components/chart/_shared/core/scale/ordinal.d.ts +12 -0
- package/dist/types/components/chart/_shared/core/scale/point.d.ts +23 -0
- package/dist/types/components/chart/_shared/core/scale/pow.d.ts +31 -0
- package/dist/types/components/chart/_shared/core/scale/quantile.d.ts +14 -0
- package/dist/types/components/chart/_shared/core/scale/quantize.d.ts +20 -0
- package/dist/types/components/chart/_shared/core/scale/sequential.d.ts +17 -0
- package/dist/types/components/chart/_shared/core/scale/symlog.d.ts +30 -0
- package/dist/types/components/chart/_shared/core/scale/threshold.d.ts +13 -0
- package/dist/types/components/chart/_shared/core/scale/tick-strategy.d.ts +16 -0
- package/dist/types/components/chart/_shared/core/scale/time-tick-strategy.d.ts +32 -0
- package/dist/types/components/chart/_shared/core/scale/time.d.ts +30 -0
- package/dist/types/components/chart/_shared/core/spatial/index.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/spatial/kdtree.d.ts +5 -0
- package/dist/types/components/chart/_shared/core/spatial/kernel.d.ts +12 -0
- package/dist/types/components/chart/_shared/core/spatial/quadtree.d.ts +8 -0
- package/dist/types/components/chart/_shared/core/state/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/state/state-model.d.ts +18 -0
- package/dist/types/components/chart/_shared/core/stream/batch-flush-runtime.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/stream/batch-flush.d.ts +44 -0
- package/dist/types/components/chart/_shared/core/stream/category-upserts.d.ts +9 -0
- package/dist/types/components/chart/_shared/core/stream/frame-budget.d.ts +37 -0
- package/dist/types/components/chart/_shared/core/stream/index.d.ts +5 -0
- package/dist/types/components/chart/_shared/core/stream/keyed-object-stream-runtime.d.ts +10 -0
- package/dist/types/components/chart/_shared/core/stream/keyed-object-stream.d.ts +19 -0
- package/dist/types/components/chart/_shared/core/stream/ring-buffer-runtime.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/stream/ring-buffer.d.ts +30 -0
- package/dist/types/components/chart/_shared/core/stream/stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/stream/stream-source.d.ts +40 -0
- package/dist/types/components/chart/_shared/core/stream/time-window-runtime.d.ts +2 -0
- package/dist/types/components/chart/_shared/core/stream/time-window.d.ts +21 -0
- package/dist/types/components/chart/_shared/core/theme/index.d.ts +1 -0
- package/dist/types/components/chart/_shared/core/theme/theme.d.ts +21 -0
- package/dist/types/components/chart/_shared/core/tooltip/card-a11y.d.ts +5 -0
- package/dist/types/components/chart/_shared/core/tooltip/cell-tooltip-controller.d.ts +139 -0
- package/dist/types/components/chart/_shared/core/tooltip/connector.d.ts +18 -0
- package/dist/types/components/chart/_shared/core/tooltip/formatter.d.ts +44 -0
- package/dist/types/components/chart/_shared/core/tooltip/index.d.ts +3 -0
- package/dist/types/components/chart/_shared/core/tooltip/tooltip-engine.d.ts +90 -0
- package/dist/types/components/chart/_shared/core/tooltip/tooltip-transfer.d.ts +11 -0
- package/dist/types/components/chart/_shared/core/types.d.ts +51 -0
- package/dist/types/components/chart/_shared/core/visual-map/index.d.ts +4 -0
- package/dist/types/components/chart/_shared/core/visual-map/visual-map-binding.d.ts +50 -0
- package/dist/types/components/chart/_shared/core/visual-map/visual-map-contract.d.ts +125 -0
- package/dist/types/components/chart/_shared/core/zoom/crosshair-sync.d.ts +18 -0
- package/dist/types/components/chart/_shared/core/zoom/index.d.ts +16 -0
- package/dist/types/components/chart/_shared/core/zoom/viewport-zoom.d.ts +33 -0
- package/dist/types/components/chart/_shared/core/zoom/zoom-connect.d.ts +44 -0
- package/dist/types/components/chart/_shared/core/zoom/zoom-contract.d.ts +93 -0
- package/dist/types/components/chart/_shared/core/zoom/zoom-drag.d.ts +13 -0
- package/dist/types/components/chart/_shared/core/zoom/zoom-host.d.ts +58 -0
- package/dist/types/components/chart/_shared/core/zoom/zoom-interaction.d.ts +91 -0
- package/dist/types/components/chart/_shared/core/zoom/zoom-window.d.ts +74 -0
- package/dist/types/components/chart/_shared/render/canvas.d.ts +11 -0
- package/dist/types/components/chart/_shared/render/index.d.ts +6 -0
- package/dist/types/components/chart/_shared/render/series.d.ts +46 -0
- package/dist/types/components/chart/area-chart/core/animation/animator.d.ts +23 -0
- package/dist/types/components/chart/area-chart/core/animation/easing.d.ts +2 -0
- package/dist/types/components/chart/area-chart/core/animation/index.d.ts +3 -0
- package/dist/types/components/chart/area-chart/core/animation/path-morph.d.ts +2 -0
- package/dist/types/components/chart/area-chart/core/area-chart-core.d.ts +45 -0
- package/dist/types/components/chart/area-chart/core/area-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/area-chart/core/pattern-kind.d.ts +11 -0
- package/dist/types/components/chart/area-chart/core/streaming/index.d.ts +2 -0
- package/dist/types/components/chart/area-chart/core/streaming/ring-buffer-runtime.d.ts +2 -0
- package/dist/types/components/chart/area-chart/core/streaming/ring-buffer.d.ts +11 -0
- package/dist/types/components/chart/area-chart/core/streaming/stream-source-runtime.d.ts +5 -0
- package/dist/types/components/chart/area-chart/core/streaming/stream-source.d.ts +27 -0
- package/dist/types/components/chart/area-chart/core/types.d.ts +121 -0
- package/dist/types/components/chart/area-chart/core/visual-regression/baseline.d.ts +4 -0
- package/dist/types/components/chart/area-chart/core/visual-regression/dom-snapshot.d.ts +14 -0
- package/dist/types/components/chart/area-chart/core/visual-regression/stream-frame-snapshot.d.ts +5 -0
- package/dist/types/components/chart/area-chart/engines/standard/area-chart-standard-renderer.d.ts +11 -0
- package/dist/types/components/chart/area-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/area-chart/engines/standard/sy-area-chart-path.d.ts +94 -0
- package/dist/types/components/chart/area-chart/index.d.ts +3 -0
- package/dist/types/components/chart/area-chart/sy-area-chart.d.ts +448 -0
- package/dist/types/components/chart/bar-chart/core/animation/animator.d.ts +23 -0
- package/dist/types/components/chart/bar-chart/core/animation/baseline-grow.d.ts +12 -0
- package/dist/types/components/chart/bar-chart/core/animation/easing.d.ts +2 -0
- package/dist/types/components/chart/bar-chart/core/animation/index.d.ts +4 -0
- package/dist/types/components/chart/bar-chart/core/animation/path-morph.d.ts +2 -0
- package/dist/types/components/chart/bar-chart/core/bar-border.d.ts +37 -0
- package/dist/types/components/chart/bar-chart/core/bar-chart-core.d.ts +44 -0
- package/dist/types/components/chart/bar-chart/core/bar-layout.d.ts +34 -0
- package/dist/types/components/chart/bar-chart/core/bar-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/bar-chart/core/streaming/index.d.ts +2 -0
- package/dist/types/components/chart/bar-chart/core/streaming/ring-buffer-runtime.d.ts +2 -0
- package/dist/types/components/chart/bar-chart/core/streaming/ring-buffer.d.ts +11 -0
- package/dist/types/components/chart/bar-chart/core/streaming/stream-source-runtime.d.ts +5 -0
- package/dist/types/components/chart/bar-chart/core/streaming/stream-source.d.ts +27 -0
- package/dist/types/components/chart/bar-chart/core/types.d.ts +80 -0
- package/dist/types/components/chart/bar-chart/engines/standard/bar-chart-standard-renderer.d.ts +34 -0
- package/dist/types/components/chart/bar-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/bar-chart/engines/standard/sy-bar-chart-path.d.ts +29 -0
- package/dist/types/components/chart/bar-chart/index.d.ts +5 -0
- package/dist/types/components/chart/bar-chart/sy-bar-chart.d.ts +431 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-chart-core.d.ts +24 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-color.d.ts +18 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-data.d.ts +41 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-geometry.d.ts +14 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-morph.d.ts +15 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-pack.d.ts +26 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-projection.d.ts +37 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-stream-source-runtime.d.ts +3 -0
- package/dist/types/components/chart/bubble-chart/core/bubble-stream-source.d.ts +7 -0
- package/dist/types/components/chart/bubble-chart/core/types.d.ts +39 -0
- package/dist/types/components/chart/bubble-chart/engines/standard/bubble-standard-renderer.d.ts +29 -0
- package/dist/types/components/chart/bubble-chart/engines/standard/index.d.ts +1 -0
- package/dist/types/components/chart/bubble-chart/index.d.ts +10 -0
- package/dist/types/components/chart/bubble-chart/sy-bubble-chart.d.ts +285 -0
- package/dist/types/components/chart/column-chart/core/animation/animator.d.ts +23 -0
- package/dist/types/components/chart/column-chart/core/animation/easing.d.ts +2 -0
- package/dist/types/components/chart/column-chart/core/animation/index.d.ts +3 -0
- package/dist/types/components/chart/column-chart/core/animation/path-morph.d.ts +2 -0
- package/dist/types/components/chart/column-chart/core/column-border.d.ts +16 -0
- package/dist/types/components/chart/column-chart/core/column-chart-core.d.ts +47 -0
- package/dist/types/components/chart/column-chart/core/column-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/column-chart/core/column-stack.d.ts +49 -0
- package/dist/types/components/chart/column-chart/core/streaming/index.d.ts +2 -0
- package/dist/types/components/chart/column-chart/core/streaming/ring-buffer-runtime.d.ts +2 -0
- package/dist/types/components/chart/column-chart/core/streaming/ring-buffer.d.ts +11 -0
- package/dist/types/components/chart/column-chart/core/streaming/stream-source-runtime.d.ts +5 -0
- package/dist/types/components/chart/column-chart/core/streaming/stream-source.d.ts +27 -0
- package/dist/types/components/chart/column-chart/core/types.d.ts +79 -0
- package/dist/types/components/chart/column-chart/engines/standard/column-chart-standard-renderer.d.ts +11 -0
- package/dist/types/components/chart/column-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/column-chart/engines/standard/sy-column-chart-path.d.ts +29 -0
- package/dist/types/components/chart/column-chart/index.d.ts +3 -0
- package/dist/types/components/chart/column-chart/sy-column-chart.d.ts +457 -0
- package/dist/types/components/chart/data-zoom/core/data-zoom-model.d.ts +54 -0
- package/dist/types/components/chart/data-zoom/core/data-zoom-target.d.ts +11 -0
- package/dist/types/components/chart/data-zoom/sy-data-zoom.d.ts +64 -0
- package/dist/types/components/chart/dot-plot-chart/core/dot-plot-animator.d.ts +27 -0
- package/dist/types/components/chart/dot-plot-chart/core/dot-plot-chart-core.d.ts +10 -0
- package/dist/types/components/chart/dot-plot-chart/core/dot-plot-geometry.d.ts +50 -0
- package/dist/types/components/chart/dot-plot-chart/core/dot-plot-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/dot-plot-chart/core/dot-plot-stream-source.d.ts +34 -0
- package/dist/types/components/chart/dot-plot-chart/core/types.d.ts +42 -0
- package/dist/types/components/chart/dot-plot-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/dot-plot-chart/index.d.ts +3 -0
- package/dist/types/components/chart/dot-plot-chart/sy-dot-plot-chart.d.ts +215 -0
- package/dist/types/components/chart/dumbbell-chart/core/dumbbell-animator.d.ts +27 -0
- package/dist/types/components/chart/dumbbell-chart/core/dumbbell-chart-core.d.ts +10 -0
- package/dist/types/components/chart/dumbbell-chart/core/dumbbell-data.d.ts +12 -0
- package/dist/types/components/chart/dumbbell-chart/core/dumbbell-geometry.d.ts +38 -0
- package/dist/types/components/chart/dumbbell-chart/core/dumbbell-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/dumbbell-chart/core/dumbbell-stream-source.d.ts +36 -0
- package/dist/types/components/chart/dumbbell-chart/core/types.d.ts +48 -0
- package/dist/types/components/chart/dumbbell-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/dumbbell-chart/index.d.ts +3 -0
- package/dist/types/components/chart/dumbbell-chart/sy-dumbbell-chart.d.ts +237 -0
- package/dist/types/components/chart/facade-types.d.ts +167 -0
- package/dist/types/components/chart/funnel-chart/core/funnel-animator.d.ts +27 -0
- package/dist/types/components/chart/funnel-chart/core/funnel-chart-core.d.ts +10 -0
- package/dist/types/components/chart/funnel-chart/core/funnel-geometry.d.ts +38 -0
- package/dist/types/components/chart/funnel-chart/core/funnel-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/funnel-chart/core/funnel-stream-source.d.ts +29 -0
- package/dist/types/components/chart/funnel-chart/core/funnel-tooltip.d.ts +57 -0
- package/dist/types/components/chart/funnel-chart/core/types.d.ts +78 -0
- package/dist/types/components/chart/funnel-chart/engines/standard/index.d.ts +69 -0
- package/dist/types/components/chart/funnel-chart/index.d.ts +8 -0
- package/dist/types/components/chart/funnel-chart/sy-funnel-chart.d.ts +232 -0
- package/dist/types/components/chart/gauge-chart/core/gauge-animator.d.ts +49 -0
- package/dist/types/components/chart/gauge-chart/core/gauge-chart-core.d.ts +10 -0
- package/dist/types/components/chart/gauge-chart/core/gauge-geometry.d.ts +61 -0
- package/dist/types/components/chart/gauge-chart/core/gauge-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/gauge-chart/core/gauge-stream-source.d.ts +28 -0
- package/dist/types/components/chart/gauge-chart/core/gauge-tooltip.d.ts +65 -0
- package/dist/types/components/chart/gauge-chart/core/types.d.ts +156 -0
- package/dist/types/components/chart/gauge-chart/engines/standard/index.d.ts +110 -0
- package/dist/types/components/chart/gauge-chart/index.d.ts +7 -0
- package/dist/types/components/chart/gauge-chart/sy-gauge-chart.d.ts +296 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-animator.d.ts +27 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-binning.d.ts +30 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-chart-core.d.ts +19 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-measure.d.ts +21 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/histogram-chart/core/histogram-stream-source.d.ts +32 -0
- package/dist/types/components/chart/histogram-chart/core/types.d.ts +97 -0
- package/dist/types/components/chart/histogram-chart/engines/standard/index.d.ts +23 -0
- package/dist/types/components/chart/histogram-chart/index.d.ts +6 -0
- package/dist/types/components/chart/histogram-chart/sy-histogram-chart.d.ts +255 -0
- package/dist/types/components/chart/item-chart/core/item-chart-core.d.ts +10 -0
- package/dist/types/components/chart/item-chart/core/item-geometry.d.ts +13 -0
- package/dist/types/components/chart/item-chart/core/item-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/item-chart/core/item-stream-source.d.ts +28 -0
- package/dist/types/components/chart/item-chart/core/item-tooltip.d.ts +68 -0
- package/dist/types/components/chart/item-chart/core/types.d.ts +81 -0
- package/dist/types/components/chart/item-chart/engines/standard/index.d.ts +37 -0
- package/dist/types/components/chart/item-chart/index.d.ts +7 -0
- package/dist/types/components/chart/item-chart/sy-item-chart.d.ts +276 -0
- package/dist/types/components/chart/line-chart/core/animation/animator.d.ts +23 -0
- package/dist/types/components/chart/line-chart/core/animation/easing.d.ts +2 -0
- package/dist/types/components/chart/line-chart/core/animation/index.d.ts +3 -0
- package/dist/types/components/chart/line-chart/core/animation/path-morph.d.ts +2 -0
- package/dist/types/components/chart/line-chart/core/event/hit-test.d.ts +22 -0
- package/dist/types/components/chart/line-chart/core/event/index.d.ts +1 -0
- package/dist/types/components/chart/line-chart/core/license/engine-swap-license.d.ts +100 -0
- package/dist/types/components/chart/line-chart/core/line-chart-core.d.ts +43 -0
- package/dist/types/components/chart/line-chart/core/pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/line-chart/core/streaming/index.d.ts +2 -0
- package/dist/types/components/chart/line-chart/core/streaming/ring-buffer-runtime.d.ts +2 -0
- package/dist/types/components/chart/line-chart/core/streaming/ring-buffer.d.ts +46 -0
- package/dist/types/components/chart/line-chart/core/streaming/stream-source-runtime.d.ts +5 -0
- package/dist/types/components/chart/line-chart/core/streaming/stream-source.d.ts +29 -0
- package/dist/types/components/chart/line-chart/core/types.d.ts +127 -0
- package/dist/types/components/chart/line-chart/core/visual-regression/baseline.d.ts +4 -0
- package/dist/types/components/chart/line-chart/core/visual-regression/dom-snapshot.d.ts +14 -0
- package/dist/types/components/chart/line-chart/core/visual-regression/stream-frame-snapshot.d.ts +5 -0
- package/dist/types/components/chart/line-chart/engines/standard/index.d.ts +1 -0
- package/dist/types/components/chart/line-chart/engines/standard/line-chart-standard-renderer.d.ts +12 -0
- package/dist/types/components/chart/line-chart/engines/standard/sy-line-chart-path.d.ts +49 -0
- package/dist/types/components/chart/line-chart/index.d.ts +2 -0
- package/dist/types/components/chart/line-chart/sy-line-chart.d.ts +509 -0
- package/dist/types/components/chart/lollipop-chart/core/lollipop-animator.d.ts +27 -0
- package/dist/types/components/chart/lollipop-chart/core/lollipop-chart-core.d.ts +10 -0
- package/dist/types/components/chart/lollipop-chart/core/lollipop-geometry.d.ts +37 -0
- package/dist/types/components/chart/lollipop-chart/core/lollipop-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/lollipop-chart/core/lollipop-stream-source.d.ts +34 -0
- package/dist/types/components/chart/lollipop-chart/core/types.d.ts +20 -0
- package/dist/types/components/chart/lollipop-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/lollipop-chart/index.d.ts +3 -0
- package/dist/types/components/chart/lollipop-chart/sy-lollipop-chart.d.ts +194 -0
- package/dist/types/components/chart/marimekko-chart/core/marimekko-animator.d.ts +27 -0
- package/dist/types/components/chart/marimekko-chart/core/marimekko-chart-core.d.ts +10 -0
- package/dist/types/components/chart/marimekko-chart/core/marimekko-geometry.d.ts +41 -0
- package/dist/types/components/chart/marimekko-chart/core/marimekko-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/marimekko-chart/core/marimekko-stream-source.d.ts +34 -0
- package/dist/types/components/chart/marimekko-chart/core/types.d.ts +32 -0
- package/dist/types/components/chart/marimekko-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/marimekko-chart/index.d.ts +3 -0
- package/dist/types/components/chart/marimekko-chart/sy-marimekko-chart.d.ts +224 -0
- package/dist/types/components/chart/navigator/core/navigator-preview.d.ts +42 -0
- package/dist/types/components/chart/navigator/sy-navigator.d.ts +51 -0
- package/dist/types/components/chart/pareto-chart/core/pareto-animator.d.ts +27 -0
- package/dist/types/components/chart/pareto-chart/core/pareto-chart-core.d.ts +10 -0
- package/dist/types/components/chart/pareto-chart/core/pareto-geometry.d.ts +37 -0
- package/dist/types/components/chart/pareto-chart/core/pareto-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/pareto-chart/core/pareto-stream-source.d.ts +34 -0
- package/dist/types/components/chart/pareto-chart/core/types.d.ts +28 -0
- package/dist/types/components/chart/pareto-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/pareto-chart/index.d.ts +3 -0
- package/dist/types/components/chart/pareto-chart/sy-pareto-chart.d.ts +218 -0
- package/dist/types/components/chart/pictorial-chart/core/path-bounds.d.ts +9 -0
- package/dist/types/components/chart/pictorial-chart/core/pictorial-animator.d.ts +27 -0
- package/dist/types/components/chart/pictorial-chart/core/pictorial-chart-core.d.ts +10 -0
- package/dist/types/components/chart/pictorial-chart/core/pictorial-geometry.d.ts +36 -0
- package/dist/types/components/chart/pictorial-chart/core/pictorial-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/pictorial-chart/core/pictorial-stream-source.d.ts +34 -0
- package/dist/types/components/chart/pictorial-chart/core/types.d.ts +21 -0
- package/dist/types/components/chart/pictorial-chart/engines/standard/index.d.ts +3 -0
- package/dist/types/components/chart/pictorial-chart/index.d.ts +4 -0
- package/dist/types/components/chart/pictorial-chart/sy-pictorial-chart.d.ts +232 -0
- package/dist/types/components/chart/pie-chart/core/pie-animator.d.ts +36 -0
- package/dist/types/components/chart/pie-chart/core/pie-chart-core.d.ts +12 -0
- package/dist/types/components/chart/pie-chart/core/pie-flip.d.ts +21 -0
- package/dist/types/components/chart/pie-chart/core/pie-geometry.d.ts +44 -0
- package/dist/types/components/chart/pie-chart/core/pie-labels.d.ts +40 -0
- package/dist/types/components/chart/pie-chart/core/pie-leader-lines.d.ts +15 -0
- package/dist/types/components/chart/pie-chart/core/pie-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/pie-chart/core/pie-stream-source.d.ts +28 -0
- package/dist/types/components/chart/pie-chart/core/pie-tooltip.d.ts +66 -0
- package/dist/types/components/chart/pie-chart/core/types.d.ts +142 -0
- package/dist/types/components/chart/pie-chart/engines/standard/index.d.ts +27 -0
- package/dist/types/components/chart/pie-chart/index.d.ts +10 -0
- package/dist/types/components/chart/pie-chart/license/chart-streaming-gate.d.ts +77 -0
- package/dist/types/components/chart/pie-chart/license/standard-engine-status.d.ts +9 -0
- package/dist/types/components/chart/pie-chart/sy-pie-chart.d.ts +278 -0
- package/dist/types/components/chart/polar-chart/core/polar-chart-core.d.ts +19 -0
- package/dist/types/components/chart/polar-chart/core/polar-geometry.d.ts +45 -0
- package/dist/types/components/chart/polar-chart/core/polar-pro-records.d.ts +55 -0
- package/dist/types/components/chart/polar-chart/core/polar-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/polar-chart/core/polar-sector-bounds.d.ts +8 -0
- package/dist/types/components/chart/polar-chart/core/polar-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/polar-chart/core/polar-stream-source.d.ts +32 -0
- package/dist/types/components/chart/polar-chart/core/polar-tooltip.d.ts +68 -0
- package/dist/types/components/chart/polar-chart/core/types.d.ts +141 -0
- package/dist/types/components/chart/polar-chart/engines/standard/index.d.ts +64 -0
- package/dist/types/components/chart/polar-chart/index.d.ts +9 -0
- package/dist/types/components/chart/polar-chart/sy-polar-chart.d.ts +319 -0
- package/dist/types/components/chart/radar-chart/core/radar-animator.d.ts +27 -0
- package/dist/types/components/chart/radar-chart/core/radar-chart-core.d.ts +10 -0
- package/dist/types/components/chart/radar-chart/core/radar-crosshair.d.ts +29 -0
- package/dist/types/components/chart/radar-chart/core/radar-geometry.d.ts +67 -0
- package/dist/types/components/chart/radar-chart/core/radar-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/radar-chart/core/radar-stream-source.d.ts +29 -0
- package/dist/types/components/chart/radar-chart/core/radar-tooltip.d.ts +57 -0
- package/dist/types/components/chart/radar-chart/core/types.d.ts +104 -0
- package/dist/types/components/chart/radar-chart/engines/standard/index.d.ts +84 -0
- package/dist/types/components/chart/radar-chart/index.d.ts +8 -0
- package/dist/types/components/chart/radar-chart/sy-radar-chart.d.ts +262 -0
- package/dist/types/components/chart/scatter-chart/core/animation/easing.d.ts +2 -0
- package/dist/types/components/chart/scatter-chart/core/animation/index.d.ts +2 -0
- package/dist/types/components/chart/scatter-chart/core/animation/scatter-animator.d.ts +31 -0
- package/dist/types/components/chart/scatter-chart/core/perf.d.ts +15 -0
- package/dist/types/components/chart/scatter-chart/core/scatter-chart-core.d.ts +34 -0
- package/dist/types/components/chart/scatter-chart/core/scatter-draw-signature.d.ts +16 -0
- package/dist/types/components/chart/scatter-chart/core/scatter-pro-renderer-loader.d.ts +3 -0
- package/dist/types/components/chart/scatter-chart/core/streaming/index.d.ts +1 -0
- package/dist/types/components/chart/scatter-chart/core/streaming/scatter-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/scatter-chart/core/streaming/scatter-stream-source.d.ts +28 -0
- package/dist/types/components/chart/scatter-chart/core/types.d.ts +125 -0
- package/dist/types/components/chart/scatter-chart/core/visual-map.d.ts +68 -0
- package/dist/types/components/chart/scatter-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/scatter-chart/engines/standard/scatter-chart-standard-renderer.d.ts +29 -0
- package/dist/types/components/chart/scatter-chart/engines/standard/sy-scatter-chart-path.d.ts +30 -0
- package/dist/types/components/chart/scatter-chart/index.d.ts +5 -0
- package/dist/types/components/chart/scatter-chart/sy-scatter-chart.d.ts +438 -0
- package/dist/types/components/chart/stem-leaf-chart/core/stem-leaf-core.d.ts +10 -0
- package/dist/types/components/chart/stem-leaf-chart/core/stem-leaf-model.d.ts +36 -0
- package/dist/types/components/chart/stem-leaf-chart/core/stem-leaf-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/stem-leaf-chart/core/stem-leaf-stream-source.d.ts +32 -0
- package/dist/types/components/chart/stem-leaf-chart/core/stem-leaf-tooltip.d.ts +65 -0
- package/dist/types/components/chart/stem-leaf-chart/core/types.d.ts +39 -0
- package/dist/types/components/chart/stem-leaf-chart/engines/standard/index.d.ts +33 -0
- package/dist/types/components/chart/stem-leaf-chart/index.d.ts +7 -0
- package/dist/types/components/chart/stem-leaf-chart/sy-stem-leaf-chart.d.ts +220 -0
- package/dist/types/components/chart/sy-chart.d.ts +1552 -0
- package/dist/types/components/chart/tilemap-chart/core/tilemap-core.d.ts +10 -0
- package/dist/types/components/chart/tilemap-chart/core/tilemap-geometry.d.ts +44 -0
- package/dist/types/components/chart/tilemap-chart/core/tilemap-legend.d.ts +32 -0
- package/dist/types/components/chart/tilemap-chart/core/tilemap-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/tilemap-chart/core/tilemap-stream-source.d.ts +28 -0
- package/dist/types/components/chart/tilemap-chart/core/tilemap-tooltip.d.ts +67 -0
- package/dist/types/components/chart/tilemap-chart/core/types.d.ts +80 -0
- package/dist/types/components/chart/tilemap-chart/engines/standard/index.d.ts +40 -0
- package/dist/types/components/chart/tilemap-chart/index.d.ts +7 -0
- package/dist/types/components/chart/tilemap-chart/sy-tilemap.d.ts +266 -0
- package/dist/types/components/chart/tornado-chart/core/tornado-animator.d.ts +27 -0
- package/dist/types/components/chart/tornado-chart/core/tornado-chart-core.d.ts +10 -0
- package/dist/types/components/chart/tornado-chart/core/tornado-geometry.d.ts +35 -0
- package/dist/types/components/chart/tornado-chart/core/tornado-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/tornado-chart/core/tornado-stream-source.d.ts +34 -0
- package/dist/types/components/chart/tornado-chart/core/types.d.ts +28 -0
- package/dist/types/components/chart/tornado-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/tornado-chart/index.d.ts +3 -0
- package/dist/types/components/chart/tornado-chart/sy-tornado-chart.d.ts +202 -0
- package/dist/types/components/chart/variwide-chart/core/types.d.ts +27 -0
- package/dist/types/components/chart/variwide-chart/core/variwide-animator.d.ts +27 -0
- package/dist/types/components/chart/variwide-chart/core/variwide-chart-core.d.ts +10 -0
- package/dist/types/components/chart/variwide-chart/core/variwide-geometry.d.ts +37 -0
- package/dist/types/components/chart/variwide-chart/core/variwide-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/variwide-chart/core/variwide-stream-source.d.ts +36 -0
- package/dist/types/components/chart/variwide-chart/engines/standard/index.d.ts +2 -0
- package/dist/types/components/chart/variwide-chart/index.d.ts +3 -0
- package/dist/types/components/chart/variwide-chart/sy-variwide-chart.d.ts +207 -0
- package/dist/types/components/chart/visual-map/sy-visual-map.d.ts +121 -0
- package/dist/types/components/chart/wafer-map-chart/core/types.d.ts +56 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-animator.d.ts +30 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-bin.d.ts +24 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-correlation.d.ts +20 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-defect.d.ts +26 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-die-index.d.ts +30 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-geometry.d.ts +78 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-legend.d.ts +35 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-map-core.d.ts +10 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-render.d.ts +29 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-shot.d.ts +33 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-stack.d.ts +24 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-stream-source-runtime.d.ts +3 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-stream-source.d.ts +12 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-value.d.ts +35 -0
- package/dist/types/components/chart/wafer-map-chart/core/wafer-yield-zone.d.ts +25 -0
- package/dist/types/components/chart/wafer-map-chart/engines/standard/index.d.ts +40 -0
- package/dist/types/components/chart/wafer-map-chart/index.d.ts +17 -0
- package/dist/types/components/chart/wafer-map-chart/sy-wafer-correlation.d.ts +41 -0
- package/dist/types/components/chart/wafer-map-chart/sy-wafer-map.d.ts +302 -0
- package/dist/types/components/chart/wafer-map-chart/sy-wafer-stack.d.ts +37 -0
- package/dist/types/components/chart/wafer-map-chart/sy-yield-zone-chart.d.ts +33 -0
- package/dist/types/components/chart/word-cloud-chart/core/types.d.ts +87 -0
- package/dist/types/components/chart/word-cloud-chart/core/word-cloud-core.d.ts +10 -0
- package/dist/types/components/chart/word-cloud-chart/core/word-layout.d.ts +39 -0
- package/dist/types/components/chart/word-cloud-chart/core/word-measure.d.ts +6 -0
- package/dist/types/components/chart/word-cloud-chart/core/word-stream-source-runtime.d.ts +2 -0
- package/dist/types/components/chart/word-cloud-chart/core/word-stream-source.d.ts +35 -0
- package/dist/types/components/chart/word-cloud-chart/core/word-tooltip.d.ts +67 -0
- package/dist/types/components/chart/word-cloud-chart/engines/standard/index.d.ts +53 -0
- package/dist/types/components/chart/word-cloud-chart/index.d.ts +8 -0
- package/dist/types/components/chart/word-cloud-chart/sy-word-cloud.d.ts +249 -0
- package/dist/types/components/dynamic-source.d.ts +7 -0
- package/dist/types/components/grid/core/a11y/aria-grid.d.ts +57 -0
- package/dist/types/components/grid/core/a11y/audit-checklist.d.ts +48 -0
- package/dist/types/components/grid/core/a11y/contrast.d.ts +13 -0
- package/dist/types/components/grid/core/a11y/screen-reader-transcript.d.ts +53 -0
- package/dist/types/components/grid/core/a11y/snapshot.d.ts +58 -0
- package/dist/types/components/grid/core/api/base-types.d.ts +15 -0
- package/dist/types/components/grid/core/api/contracts.d.ts +2104 -0
- package/dist/types/components/grid/core/api/index.d.ts +3 -0
- package/dist/types/components/grid/core/api/live-object-model.d.ts +186 -0
- package/dist/types/components/grid/core/audit/audit-export.d.ts +29 -0
- package/dist/types/components/grid/core/audit/audit-log.d.ts +70 -0
- package/dist/types/components/grid/core/brand/grid-brand.d.ts +12 -0
- package/dist/types/components/grid/core/build-tier.d.ts +3 -0
- package/dist/types/components/grid/core/cell/cell-class-rules.d.ts +57 -0
- package/dist/types/components/grid/core/cell/cell-style.d.ts +36 -0
- package/dist/types/components/grid/core/cell/expression-runtime.d.ts +29 -0
- package/dist/types/components/grid/core/cell/index.d.ts +5 -0
- package/dist/types/components/grid/core/cell/renderer-registry.d.ts +55 -0
- package/dist/types/components/grid/core/cell/value-formatter.d.ts +42 -0
- package/dist/types/components/grid/core/cell/value-getter.d.ts +59 -0
- package/dist/types/components/grid/core/cell-cycle.d.ts +19 -0
- package/dist/types/components/grid/core/cell-flash/cell-flash.d.ts +4 -0
- package/dist/types/components/grid/core/cell-tooltip/hover-delay.d.ts +15 -0
- package/dist/types/components/grid/core/cell-tooltip/index.d.ts +2 -0
- package/dist/types/components/grid/core/cell-tooltip/tooltip-text.d.ts +16 -0
- package/dist/types/components/grid/core/chart-link/chart-bridge-types-probe.d.ts +12 -0
- package/dist/types/components/grid/core/chart-link/chart-bridge.d.ts +79 -0
- package/dist/types/components/grid/core/chart-link/chart-cross-filter.d.ts +99 -0
- package/dist/types/components/grid/core/chart-link/chart-events.d.ts +245 -0
- package/dist/types/components/grid/core/chart-link/chart-instances.d.ts +217 -0
- package/dist/types/components/grid/core/chart-link/chart-link-chunk.d.ts +185 -0
- package/dist/types/components/grid/core/chart-link/chart-menu.d.ts +154 -0
- package/dist/types/components/grid/core/chart-link/chart-model.d.ts +176 -0
- package/dist/types/components/grid/core/chart-link/chart-multi.d.ts +178 -0
- package/dist/types/components/grid/core/chart-link/chart-pivot.d.ts +152 -0
- package/dist/types/components/grid/core/chart-link/chart-sync.d.ts +157 -0
- package/dist/types/components/grid/core/clipboard/parse.d.ts +2 -0
- package/dist/types/components/grid/core/clipboard/paste-plan.d.ts +25 -0
- package/dist/types/components/grid/core/clipboard/serialize.d.ts +12 -0
- package/dist/types/components/grid/core/collab-css.d.ts +2 -0
- package/dist/types/components/grid/core/collab-loader.d.ts +10 -0
- package/dist/types/components/grid/core/collab-mentions.d.ts +8 -0
- package/dist/types/components/grid/core/collab-types.d.ts +157 -0
- package/dist/types/components/grid/core/column/column-auto-size.d.ts +20 -0
- package/dist/types/components/grid/core/column/column-groups.d.ts +24 -0
- package/dist/types/components/grid/core/column/column-pin.d.ts +15 -0
- package/dist/types/components/grid/core/column/column-reorder.d.ts +66 -0
- package/dist/types/components/grid/core/column/column-resize.d.ts +75 -0
- package/dist/types/components/grid/core/column/column-sort.d.ts +20 -0
- package/dist/types/components/grid/core/column/column-state.d.ts +44 -0
- package/dist/types/components/grid/core/column/column-visibility.d.ts +28 -0
- package/dist/types/components/grid/core/column/index.d.ts +6 -0
- package/dist/types/components/grid/core/component/async-value-source.d.ts +38 -0
- package/dist/types/components/grid/core/component/component-runtime-chunk.d.ts +34 -0
- package/dist/types/components/grid/core/component/contracts.d.ts +189 -0
- package/dist/types/components/grid/core/component/editor-adapter.d.ts +101 -0
- package/dist/types/components/grid/core/component/editor-facade-controller.d.ts +172 -0
- package/dist/types/components/grid/core/component/editor-validation-presentation.d.ts +6 -0
- package/dist/types/components/grid/core/component/filter-adapter.d.ts +107 -0
- package/dist/types/components/grid/core/component/filter-facade-controller.d.ts +118 -0
- package/dist/types/components/grid/core/component/framework-bridge.d.ts +17 -0
- package/dist/types/components/grid/core/component/index.d.ts +12 -0
- package/dist/types/components/grid/core/component/popup-placement.d.ts +29 -0
- package/dist/types/components/grid/core/component/registry.d.ts +39 -0
- package/dist/types/components/grid/core/component/renderer-adapter.d.ts +17 -0
- package/dist/types/components/grid/core/component/renderer-controller.d.ts +88 -0
- package/dist/types/components/grid/core/component/rich-select-editor.d.ts +16 -0
- package/dist/types/components/grid/core/component/runtime.d.ts +90 -0
- package/dist/types/components/grid/core/conditional-format/cf-builder-chunk.d.ts +19 -0
- package/dist/types/components/grid/core/conditional-format/cf-builder.d.ts +23 -0
- package/dist/types/components/grid/core/conditional-format/conditional-format.d.ts +32 -0
- package/dist/types/components/grid/core/context-menu/clipboard.d.ts +9 -0
- package/dist/types/components/grid/core/context-menu/index.d.ts +3 -0
- package/dist/types/components/grid/core/context-menu/menu.d.ts +6 -0
- package/dist/types/components/grid/core/context-menu/types.d.ts +22 -0
- package/dist/types/components/grid/core/edit/autocomplete-editor.d.ts +21 -0
- package/dist/types/components/grid/core/edit/batch-edit.d.ts +237 -0
- package/dist/types/components/grid/core/edit/checkbox-editor-render.d.ts +27 -0
- package/dist/types/components/grid/core/edit/checkbox-editor.d.ts +10 -0
- package/dist/types/components/grid/core/edit/date-editor-render.d.ts +35 -0
- package/dist/types/components/grid/core/edit/date-editor.d.ts +26 -0
- package/dist/types/components/grid/core/edit/date-picker.d.ts +27 -0
- package/dist/types/components/grid/core/edit/index.d.ts +2 -0
- package/dist/types/components/grid/core/edit/large-text-editor.d.ts +20 -0
- package/dist/types/components/grid/core/edit/number-editor-render.d.ts +37 -0
- package/dist/types/components/grid/core/edit/number-editor.d.ts +27 -0
- package/dist/types/components/grid/core/edit/prospective-edit.d.ts +42 -0
- package/dist/types/components/grid/core/edit/row-edit.d.ts +303 -0
- package/dist/types/components/grid/core/edit/select-editor-render.d.ts +60 -0
- package/dist/types/components/grid/core/edit/select-editor.d.ts +19 -0
- package/dist/types/components/grid/core/edit/text-editor-render.d.ts +31 -0
- package/dist/types/components/grid/core/edit/text-editor.d.ts +13 -0
- package/dist/types/components/grid/core/edit/textarea-editor-render.d.ts +35 -0
- package/dist/types/components/grid/core/edit/textarea-editor.d.ts +19 -0
- package/dist/types/components/grid/core/edit/transaction-api.d.ts +41 -0
- package/dist/types/components/grid/core/edit/transaction.d.ts +39 -0
- package/dist/types/components/grid/core/edit/undo-redo.d.ts +55 -0
- package/dist/types/components/grid/core/empty-state-cycle.d.ts +8 -0
- package/dist/types/components/grid/core/event/index.d.ts +1 -0
- package/dist/types/components/grid/core/event/row-click.d.ts +34 -0
- package/dist/types/components/grid/core/export/csv.d.ts +30 -0
- package/dist/types/components/grid/core/export/grid-pdf-export.d.ts +41 -0
- package/dist/types/components/grid/core/export/index.d.ts +3 -0
- package/dist/types/components/grid/core/filter/advanced-query.d.ts +1 -0
- package/dist/types/components/grid/core/filter/condition-builder.d.ts +21 -0
- package/dist/types/components/grid/core/filter/date.d.ts +13 -0
- package/dist/types/components/grid/core/filter/filter-ui-types.d.ts +35 -0
- package/dist/types/components/grid/core/filter/multi.d.ts +22 -0
- package/dist/types/components/grid/core/filter/number.d.ts +11 -0
- package/dist/types/components/grid/core/filter/quick-filter.d.ts +11 -0
- package/dist/types/components/grid/core/filter/set.d.ts +24 -0
- package/dist/types/components/grid/core/filter/text.d.ts +10 -0
- package/dist/types/components/grid/core/filter-cycle.d.ts +32 -0
- package/dist/types/components/grid/core/floating/index.d.ts +1 -0
- package/dist/types/components/grid/core/floating/positioning.d.ts +24 -0
- package/dist/types/components/grid/core/formula/workbook-binding.d.ts +54 -0
- package/dist/types/components/grid/core/formula/workbook-reference.d.ts +37 -0
- package/dist/types/components/grid/core/formula/workbook-registry.d.ts +86 -0
- package/dist/types/components/grid/core/formula-acceleration-loader.d.ts +12 -0
- package/dist/types/components/grid/core/formula-text.d.ts +1 -0
- package/dist/types/components/grid/core/grid-core.d.ts +20 -0
- package/dist/types/components/grid/core/grouping/display-types.d.ts +165 -0
- package/dist/types/components/grid/core/grouping/group-selection.d.ts +165 -0
- package/dist/types/components/grid/core/hover/row.d.ts +8 -0
- package/dist/types/components/grid/core/import/csv/index.d.ts +1 -0
- package/dist/types/components/grid/core/import/csv/parse-csv.d.ts +30 -0
- package/dist/types/components/grid/core/import/xlsx/cell-ref.d.ts +11 -0
- package/dist/types/components/grid/core/import/xlsx/errors.d.ts +9 -0
- package/dist/types/components/grid/core/import/xlsx/formula.d.ts +4 -0
- package/dist/types/components/grid/core/import/xlsx/grid-import-chunk.d.ts +3 -0
- package/dist/types/components/grid/core/import/xlsx/index.d.ts +26 -0
- package/dist/types/components/grid/core/import/xlsx/inflate.d.ts +2 -0
- package/dist/types/components/grid/core/import/xlsx/merged-cells.d.ts +9 -0
- package/dist/types/components/grid/core/import/xlsx/number-format.d.ts +16 -0
- package/dist/types/components/grid/core/import/xlsx/parse-xlsx.d.ts +34 -0
- package/dist/types/components/grid/core/import/xlsx/pick-sheet.d.ts +2 -0
- package/dist/types/components/grid/core/import/xlsx/shared-strings.d.ts +2 -0
- package/dist/types/components/grid/core/import/xlsx/sheet-streaming.d.ts +11 -0
- package/dist/types/components/grid/core/import/xlsx/sheet.d.ts +31 -0
- package/dist/types/components/grid/core/import/xlsx/styles.d.ts +21 -0
- package/dist/types/components/grid/core/import/xlsx/workbook.d.ts +22 -0
- package/dist/types/components/grid/core/import/xlsx/xml-parser.d.ts +15 -0
- package/dist/types/components/grid/core/import/xlsx/zip-reader.d.ts +28 -0
- package/dist/types/components/grid/core/license/grid-acceleration-port.d.ts +13 -0
- package/dist/types/components/grid/core/license/grid-feature.d.ts +40 -0
- package/dist/types/components/grid/core/license/grid-license-facade.d.ts +50 -0
- package/dist/types/components/grid/core/license/grid-license-runtime.d.ts +2 -0
- package/dist/types/components/grid/core/license/grid-license-session.d.ts +85 -0
- package/dist/types/components/grid/core/license/grid-license.d.ts +40 -0
- package/dist/types/components/grid/core/license/grid-method-route.d.ts +7 -0
- package/dist/types/components/grid/core/license/grid-method-table.d.ts +7 -0
- package/dist/types/components/grid/core/loader/chunk-contract.d.ts +95 -0
- package/dist/types/components/grid/core/loader/chunk-loader.d.ts +62 -0
- package/dist/types/components/grid/core/loading-cycle.d.ts +14 -0
- package/dist/types/components/grid/core/locale/messages.d.ts +13 -0
- package/dist/types/components/grid/core/locale/presets.d.ts +8 -0
- package/dist/types/components/grid/core/locale/resolve.d.ts +12 -0
- package/dist/types/components/grid/core/notes/cell-notes.d.ts +47 -0
- package/dist/types/components/grid/core/numeric/safe-numeric.d.ts +10 -0
- package/dist/types/components/grid/core/pagination-cycle.d.ts +15 -0
- package/dist/types/components/grid/core/pipeline/aggregate.d.ts +30 -0
- package/dist/types/components/grid/core/pipeline/comparator-default.d.ts +1 -0
- package/dist/types/components/grid/core/pipeline/engine-rows-memo.d.ts +10 -0
- package/dist/types/components/grid/core/pipeline/filter.d.ts +9 -0
- package/dist/types/components/grid/core/pipeline/group.d.ts +32 -0
- package/dist/types/components/grid/core/pipeline/index.d.ts +25 -0
- package/dist/types/components/grid/core/pipeline/master-detail.d.ts +7 -0
- package/dist/types/components/grid/core/pipeline/multi-group.d.ts +22 -0
- package/dist/types/components/grid/core/pipeline/paginate.d.ts +12 -0
- package/dist/types/components/grid/core/pipeline/pipeline.d.ts +3 -0
- package/dist/types/components/grid/core/pipeline/pivot-columns.d.ts +15 -0
- package/dist/types/components/grid/core/pipeline/pivot-panel.d.ts +135 -0
- package/dist/types/components/grid/core/pipeline/pivot.d.ts +52 -0
- package/dist/types/components/grid/core/pipeline/sort.d.ts +10 -0
- package/dist/types/components/grid/core/pipeline/tree.d.ts +32 -0
- package/dist/types/components/grid/core/pipeline/types.d.ts +11 -0
- package/dist/types/components/grid/core/pivot/combination-warnings.d.ts +4 -0
- package/dist/types/components/grid/core/pivot/secondary-columns.d.ts +153 -0
- package/dist/types/components/grid/core/pro-chunk-sources.d.ts +4 -0
- package/dist/types/components/grid/core/pro-engine-loader.d.ts +4 -0
- package/dist/types/components/grid/core/pro-gate/engine-precedence.d.ts +16 -0
- package/dist/types/components/grid/core/pro-gate/grid-chunk-backstop.d.ts +5 -0
- package/dist/types/components/grid/core/pro-gate/grid-chunk-features.d.ts +2 -0
- package/dist/types/components/grid/core/pro-gate/grid-clipboard-policy.d.ts +8 -0
- package/dist/types/components/grid/core/pro-gate/grid-declarations.d.ts +25 -0
- package/dist/types/components/grid/core/pro-gate/grid-engine-license.d.ts +23 -0
- package/dist/types/components/grid/core/pro-gate/grid-formula-freeze.d.ts +15 -0
- package/dist/types/components/grid/core/pro-gate/grid-freeze-work.d.ts +38 -0
- package/dist/types/components/grid/core/pro-gate/grid-pro-gate.d.ts +51 -0
- package/dist/types/components/grid/core/pro-gate/grid-state-requirements.d.ts +21 -0
- package/dist/types/components/grid/core/pro-panels/column-menu.d.ts +38 -0
- package/dist/types/components/grid/core/rbac/cell-access.d.ts +12 -0
- package/dist/types/components/grid/core/row-drag/drag-safety.d.ts +268 -0
- package/dist/types/components/grid/core/row-drag/drop-zones.d.ts +266 -0
- package/dist/types/components/grid/core/row-drag/reorder.d.ts +12 -0
- package/dist/types/components/grid/core/row-drag/reparent-facade.d.ts +64 -0
- package/dist/types/components/grid/core/row-drag/row-drag-chunk.d.ts +5 -0
- package/dist/types/components/grid/core/row-drag/row-drag-facade.d.ts +293 -0
- package/dist/types/components/grid/core/row-drag/unmanaged-drag.d.ts +262 -0
- package/dist/types/components/grid/core/row-layout/aligned-grids-facade.d.ts +61 -0
- package/dist/types/components/grid/core/row-layout/aligned-grids.d.ts +154 -0
- package/dist/types/components/grid/core/row-layout/col-span.d.ts +147 -0
- package/dist/types/components/grid/core/row-layout/full-width-facade.d.ts +63 -0
- package/dist/types/components/grid/core/row-layout/full-width-rows.d.ts +261 -0
- package/dist/types/components/grid/core/row-layout/pinned-row-policy.d.ts +142 -0
- package/dist/types/components/grid/core/row-layout/pinned-rows-facade.d.ts +72 -0
- package/dist/types/components/grid/core/row-layout/pinned-rows.d.ts +116 -0
- package/dist/types/components/grid/core/row-layout/row-layout-chunk.d.ts +11 -0
- package/dist/types/components/grid/core/row-layout/row-layout-facade.d.ts +143 -0
- package/dist/types/components/grid/core/row-layout/row-span.d.ts +102 -0
- package/dist/types/components/grid/core/row-layout/span-interaction.d.ts +140 -0
- package/dist/types/components/grid/core/row-markers.d.ts +19 -0
- package/dist/types/components/grid/core/row-model/block-cache.d.ts +46 -0
- package/dist/types/components/grid/core/row-model/client-side.d.ts +10 -0
- package/dist/types/components/grid/core/row-model/datasource.d.ts +16 -0
- package/dist/types/components/grid/core/row-model/index.d.ts +1 -0
- package/dist/types/components/grid/core/row-model/infinite.d.ts +1 -0
- package/dist/types/components/grid/core/row-model/placeholder-row.d.ts +9 -0
- package/dist/types/components/grid/core/row-model/server-datasource-lifecycle.d.ts +80 -0
- package/dist/types/components/grid/core/row-model/server-group-selection.d.ts +123 -0
- package/dist/types/components/grid/core/row-model/server-pivot-results.d.ts +234 -0
- package/dist/types/components/grid/core/row-model/server-refresh.d.ts +63 -0
- package/dist/types/components/grid/core/row-model/server-selection.d.ts +76 -0
- package/dist/types/components/grid/core/row-model/server-side-retry.d.ts +37 -0
- package/dist/types/components/grid/core/row-model/server-side.d.ts +109 -0
- package/dist/types/components/grid/core/row-model/server-store-events.d.ts +160 -0
- package/dist/types/components/grid/core/row-model/server-store-inspection.d.ts +80 -0
- package/dist/types/components/grid/core/row-model/server-store-routes.d.ts +142 -0
- package/dist/types/components/grid/core/row-model/server-transaction-queue.d.ts +96 -0
- package/dist/types/components/grid/core/row-model/server-transactions.d.ts +29 -0
- package/dist/types/components/grid/core/row-model/ssrm-ops-chunk.d.ts +93 -0
- package/dist/types/components/grid/core/row-model/ssrm-selection-facade.d.ts +49 -0
- package/dist/types/components/grid/core/row-model/ssrm-selection.d.ts +107 -0
- package/dist/types/components/grid/core/row-model/viewport-adapters.d.ts +45 -0
- package/dist/types/components/grid/core/row-model/viewport.d.ts +37 -0
- package/dist/types/components/grid/core/selection/canonical-ranges.d.ts +59 -0
- package/dist/types/components/grid/core/selection/checkbox-column.d.ts +28 -0
- package/dist/types/components/grid/core/selection/fill-gestures.d.ts +26 -0
- package/dist/types/components/grid/core/selection/fill-handle.d.ts +78 -0
- package/dist/types/components/grid/core/selection/fill-series.d.ts +57 -0
- package/dist/types/components/grid/core/selection/fill-transaction.d.ts +111 -0
- package/dist/types/components/grid/core/selection/fill-values.d.ts +29 -0
- package/dist/types/components/grid/core/selection/range-bounds.d.ts +2 -0
- package/dist/types/components/grid/core/selection/range.d.ts +32 -0
- package/dist/types/components/grid/core/selection/row.d.ts +31 -0
- package/dist/types/components/grid/core/side-bar/side-bar.d.ts +12 -0
- package/dist/types/components/grid/core/snapshot/snapshot-diff.d.ts +21 -0
- package/dist/types/components/grid/core/snapshot/snapshot.d.ts +24 -0
- package/dist/types/components/grid/core/sort-cycle.d.ts +13 -0
- package/dist/types/components/grid/core/sort-model.d.ts +15 -0
- package/dist/types/components/grid/core/spreadsheet-text.d.ts +7 -0
- package/dist/types/components/grid/core/state/canonical.d.ts +9 -0
- package/dist/types/components/grid/core/state/contracts.d.ts +42 -0
- package/dist/types/components/grid/core/state/filter-handlers.d.ts +34 -0
- package/dist/types/components/grid/core/state/find-state.d.ts +11 -0
- package/dist/types/components/grid/core/state/grid-state.d.ts +61 -0
- package/dist/types/components/grid/core/state/migrate.d.ts +21 -0
- package/dist/types/components/grid/core/state/ownership.d.ts +2 -0
- package/dist/types/components/grid/core/state/persistence.d.ts +21 -0
- package/dist/types/components/grid/core/state/slices/columns.d.ts +55 -0
- package/dist/types/components/grid/core/state/slices/filter.d.ts +45 -0
- package/dist/types/components/grid/core/state/slices/rows.d.ts +73 -0
- package/dist/types/components/grid/core/state/slices/ui.d.ts +77 -0
- package/dist/types/components/grid/core/state/state-events.d.ts +50 -0
- package/dist/types/components/grid/core/state/validate.d.ts +9 -0
- package/dist/types/components/grid/core/status-bar/status-bar.d.ts +18 -0
- package/dist/types/components/grid/core/status-bar/status-panels.d.ts +11 -0
- package/dist/types/components/grid/core/sync/array.d.ts +44 -0
- package/dist/types/components/grid/core/sync/clock.d.ts +32 -0
- package/dist/types/components/grid/core/sync/collab-bridge.d.ts +28 -0
- package/dist/types/components/grid/core/sync/doc.d.ts +35 -0
- package/dist/types/components/grid/core/sync/id.d.ts +11 -0
- package/dist/types/components/grid/core/sync/map.d.ts +33 -0
- package/dist/types/components/grid/core/sync/text.d.ts +11 -0
- package/dist/types/components/grid/core/sync/undo-manager.d.ts +23 -0
- package/dist/types/components/grid/core/theme/apply.d.ts +12 -0
- package/dist/types/components/grid/core/theme/presets.d.ts +9 -0
- package/dist/types/components/grid/core/theme/tokens.d.ts +13 -0
- package/dist/types/components/grid/core/tree/reparent.d.ts +159 -0
- package/dist/types/components/grid/core/tree/tree-data-chunk.d.ts +4 -0
- package/dist/types/components/grid/core/tree/tree-data.d.ts +19 -0
- package/dist/types/components/grid/core/types.d.ts +247 -0
- package/dist/types/components/grid/core/utils/structural.d.ts +2 -0
- package/dist/types/components/grid/core/validation/validation.d.ts +24 -0
- package/dist/types/components/grid/core/virtualizer/cell-virtualizer.d.ts +1 -0
- package/dist/types/components/grid/core/virtualizer/column-virtualizer.d.ts +14 -0
- package/dist/types/components/grid/core/virtualizer/index.d.ts +1 -0
- package/dist/types/components/grid/core/virtualizer/row-virtualizer.d.ts +52 -0
- package/dist/types/components/grid/core/visual-regression/baseline.d.ts +2 -0
- package/dist/types/components/grid/core/visual-regression/dom-snapshot.d.ts +14 -0
- package/dist/types/components/grid/core/visual-regression/real-dom-canonicalise.d.ts +1 -0
- package/dist/types/components/grid/core/vnode-factory.d.ts +1 -0
- package/dist/types/components/grid/engines/standard/index.d.ts +1 -0
- package/dist/types/components/grid/engines/standard/sy-grid-standard.d.ts +24 -0
- package/dist/types/components/grid/index.d.ts +21 -0
- package/dist/types/components/grid/sy-grid.d.ts +2136 -0
- package/dist/types/components.d.ts +10597 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/license/base64url.d.ts +3 -0
- package/dist/types/license/certificate.d.ts +48 -0
- package/dist/types/license/constants.d.ts +38 -0
- package/dist/types/license/context.d.ts +6 -0
- package/dist/types/license/deployment.d.ts +9 -0
- package/dist/types/license/diagnostic-constants.d.ts +7 -0
- package/dist/types/license/discovery.d.ts +10 -0
- package/dist/types/license/errors.d.ts +47 -0
- package/dist/types/license/evaluate.d.ts +19 -0
- package/dist/types/license/failure.d.ts +11 -0
- package/dist/types/license/fetch-license.d.ts +12 -0
- package/dist/types/license/generated/chart-features.generated.d.ts +2244 -0
- package/dist/types/license/generated/core-features.generated.d.ts +349 -0
- package/dist/types/license/generated/feature-map.generated.d.ts +4 -0
- package/dist/types/license/generated/grid-features.generated.d.ts +3681 -0
- package/dist/types/license/generated/products.generated.d.ts +26 -0
- package/dist/types/license/index.d.ts +15 -0
- package/dist/types/license/json.d.ts +4 -0
- package/dist/types/license/jws.d.ts +9 -0
- package/dist/types/license/registry.d.ts +37 -0
- package/dist/types/license/release.generated.d.ts +6 -0
- package/dist/types/license/runtime.d.ts +27 -0
- package/dist/types/license/subtle.d.ts +5 -0
- package/dist/types/license/timers.d.ts +6 -0
- package/dist/types/license/timestamp.d.ts +1 -0
- package/dist/types/license/trust-keys.generated.d.ts +3 -0
- package/dist/types/license/trust-store.d.ts +6 -0
- package/dist/types/license/types.d.ts +85 -0
- package/dist/types/license/verify.d.ts +30 -0
- package/dist/types/license/watch.d.ts +18 -0
- package/dist/types/stencil-public-runtime.d.ts +1356 -0
- package/dist/types/utils/story-template.d.ts +17 -0
- package/loader/cdn.js +1 -0
- package/loader/chart-scope.d.ts +21 -0
- package/loader/chart-scope.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +13 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +1 -0
- package/package.json +108 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var index=require("./index-CKeHnO3Q.js");var errors=require("./errors-DNua3ZWy.js");var brandMarkDefault=require("./brand-mark-default-DvQHU2qS.js");function syntaxError(code,pos,token){return new Error(`SG-EXPR-${code} pos=${pos}${token===void 0?"":` token="${token}"`}`)}function warnGridExpression(code,field,row,detail,cause){const message=`[Syidax] sy-grid: SG-EXPR-${code} field="${field}" row=${row}${detail===void 0?"":` ${detail}`}`;if(cause===void 0)console.warn(message);else console.warn(message,cause)}function isWhitespace$1(c){return c===" "||c===" "||c==="\n"||c==="\r"||c==="\f"||c==="\v"}function isIdentStart(c){if(c==="_"||c==="$")return true;const code=c.charCodeAt(0);return code>=65&&code<=90||code>=97&&code<=122}function isIdentCont(c){if(isIdentStart(c))return true;const code=c.charCodeAt(0);return code>=48&&code<=57}function isDigit(c){const code=c.charCodeAt(0);return code>=48&&code<=57}function tokenize(src,allowRuleOperators){const tokens=[];const len=src.length;let i=0;while(i<len){const c=src[i];if(isWhitespace$1(c)){i++;continue}if(isDigit(c)){const start=i;while(i<len&&isDigit(src[i]))i++;if(i<len&&src[i]==="."){i++;while(i<len&&isDigit(src[i]))i++}const slice=src.slice(start,i);const value=Number(slice);if(!Number.isFinite(value)){throw syntaxError("NUM",start,slice)}tokens.push({kind:"number",value,pos:start});continue}if(c==='"'||c==="'"){const start=i;const quote=c;i++;const lit=[];while(i<len&&src[i]!==quote){lit.push(src[i]);i++}if(i>=len){throw syntaxError("QUOTE",start,quote)}i++;tokens.push({kind:"string",value:lit.join(""),pos:start});continue}if(isIdentStart(c)){const start=i;while(i<len&&isIdentCont(src[i]))i++;tokens.push({kind:"identifier",name:src.slice(start,i),pos:start});continue}if(allowRuleOperators){const next=i+1<len?src[i+1]:"";if(c==="="&&next==="="){tokens.push({kind:"cmp",op:"==",pos:i});i+=2;continue}if(c==="!"&&next==="="){tokens.push({kind:"cmp",op:"!=",pos:i});i+=2;continue}if(c===">"&&next==="="){tokens.push({kind:"cmp",op:">=",pos:i});i+=2;continue}if(c==="<"&&next==="="){tokens.push({kind:"cmp",op:"<=",pos:i});i+=2;continue}if(c===">"||c==="<"){tokens.push({kind:"cmp",op:c,pos:i});i++;continue}if(c==="&"&&next==="&"){tokens.push({kind:"logic",op:"&&",pos:i});i+=2;continue}if(c==="|"&&next==="|"){tokens.push({kind:"logic",op:"||",pos:i});i+=2;continue}}if(c==="+"||c==="-"||c==="*"||c==="/"){tokens.push({kind:"op",op:c,pos:i});i++;continue}if(c==="("){tokens.push({kind:"lparen",pos:i});i++;continue}if(c===")"){tokens.push({kind:"rparen",pos:i});i++;continue}if(c===".")throw syntaxError("PROP",i,c);if(c==="["||c==="]")throw syntaxError("BRACKET",i,c);if(c==="=")throw syntaxError("ASSIGN",i,c);if(c==="<"||c===">")throw syntaxError("CMP",i,c);if(c==="|"||c==="&"||c==="^"||c==="~"){throw syntaxError("BITWISE",i,c)}if(c==="!")throw syntaxError("NOT",i,c);if(c==="?"||c===":")throw syntaxError("TERNARY",i,c);if(c===",")throw syntaxError("COMMA",i,c);if(c===";")throw syntaxError("STMT",i,c);if(c==="`")throw syntaxError("TEMPLATE",i,c);if(c==="%")throw syntaxError("MOD",i,c);throw syntaxError("CHAR",i,c)}return tokens}function peek(state){return state.pos<state.tokens.length?state.tokens[state.pos]:null}function consume(state){const token=state.tokens[state.pos];state.pos++;return token}function parseExpr(state){return parseOr(state)}function parseOr(state){let left=parseAnd(state);while(true){const token=peek(state);if(token===null||token.kind!=="logic"||token.op!=="||")break;consume(state);left={kind:"binary",op:"||",left,right:parseAnd(state)}}return left}function parseAnd(state){let left=parseComparison(state);while(true){const token=peek(state);if(token===null||token.kind!=="logic"||token.op!=="&&")break;consume(state);left={kind:"binary",op:"&&",left,right:parseComparison(state)}}return left}function parseComparison(state){const left=parseAdd(state);const token=peek(state);if(token===null||token.kind!=="cmp")return left;consume(state);const right=parseAdd(state);const next=peek(state);if(next!==null&&next.kind==="cmp"){throw syntaxError("CHAIN",next.pos,next.op)}return{kind:"binary",op:token.op,left,right}}function parseAdd(state){let left=parseMul(state);while(true){const token=peek(state);if(token===null||token.kind!=="op"||token.op!=="+"&&token.op!=="-"){break}consume(state);left={kind:"binary",op:token.op,left,right:parseMul(state)}}return left}function parseMul(state){let left=parseUnary(state);while(true){const token=peek(state);if(token===null||token.kind!=="op"||token.op!=="*"&&token.op!=="/"){break}consume(state);left={kind:"binary",op:token.op,left,right:parseUnary(state)}}return left}function parseUnary(state){const token=peek(state);if(token!==null&&token.kind==="op"&&token.op==="-"){consume(state);return{kind:"unary",op:"-",operand:parseUnary(state)}}return parsePrimary(state)}function parsePrimary(state){const token=peek(state);if(token===null)throw syntaxError("END",state.end);if(token.kind==="number"){consume(state);return{kind:"number",value:token.value}}if(token.kind==="string"){consume(state);return{kind:"string",value:token.value}}if(token.kind==="identifier"){consume(state);const next=peek(state);if(next!==null&&next.kind==="lparen"){throw syntaxError("CALL",next.pos,token.name)}state.identifiers.add(token.name);return{kind:"identifier",name:token.name}}if(token.kind==="lparen"){consume(state);const inner=parseExpr(state);const close=peek(state);if(close===null||close.kind!=="rparen"){throw syntaxError("RPAREN",close===null?state.end:close.pos,close===null?")":describeToken(close))}consume(state);return{kind:"group",inner}}throw syntaxError("TOKEN",token.pos,describeToken(token))}function describeToken(token){if(token.kind==="op"||token.kind==="cmp"||token.kind==="logic"){return token.op}if(token.kind==="lparen")return"(";if(token.kind==="rparen")return")";if(token.kind==="number")return String(token.value);if(token.kind==="string")return`"${token.value}"`;return token.name}function parseGridExpression(expr,allowRuleOperators){if(typeof expr!=="string")throw syntaxError("TYPE",0);if(expr.trim().length===0)throw syntaxError("EMPTY",0);const tokens=tokenize(expr,allowRuleOperators);if(tokens.length===0)throw syntaxError("EMPTY",0);const state={tokens,pos:0,identifiers:new Set,end:expr.length};const ast=parseExpr(state);if(state.pos<tokens.length){const trailing=tokens[state.pos];throw syntaxError("TRAIL",trailing.pos,describeToken(trailing))}return{ast,identifiers:Array.from(state.identifiers)}}function evaluateGridExpression(ast,getIdentifier){if(ast.kind==="number")return ast.value;if(ast.kind==="string")return ast.value;if(ast.kind==="identifier")return getIdentifier(ast.name);if(ast.kind==="group")return evaluateGridExpression(ast.inner,getIdentifier);if(ast.kind==="unary"){return-Number(evaluateGridExpression(ast.operand,getIdentifier))}const op=ast.op;if(op==="&&"){const left2=evaluateGridExpression(ast.left,getIdentifier);return left2?evaluateGridExpression(ast.right,getIdentifier):left2}if(op==="||"){const left2=evaluateGridExpression(ast.left,getIdentifier);return left2?left2:evaluateGridExpression(ast.right,getIdentifier)}const left=evaluateGridExpression(ast.left,getIdentifier);const right=evaluateGridExpression(ast.right,getIdentifier);if(op==="+"){return typeof left==="string"||typeof right==="string"?String(left)+String(right):Number(left)+Number(right)}if(op==="-")return Number(left)-Number(right);if(op==="*")return Number(left)*Number(right);if(op==="/")return Number(left)/Number(right);if(op==="==")return left===right;if(op==="!=")return left!==right;if(op===">")return Number(left)>Number(right);if(op==="<")return Number(left)<Number(right);if(op===">=")return Number(left)>=Number(right);return Number(left)<=Number(right)}const WARN_PREFIX$3="[Syidax] sy-grid:";function isSafeFieldPathSegment(segment){return segment.length>0&&segment!=="__proto__"&&segment!=="prototype"&&segment!=="constructor"}function parseSafeFieldPath(path){if(typeof path!=="string"||path.length===0)return null;const segments=path.split(".");return segments.every(isSafeFieldPathSegment)?segments:null}function isFieldPathContainer(value){if(value===null||typeof value!=="object")return false;if(Array.isArray(value))return true;const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}function arrayIndexForSegment(segment){const index2=+segment>>>0;return index2<4294967295&&String(index2)===segment?index2:null}function cloneContainerWithOwnValue(container,segment,value){if(Array.isArray(container)){const clone2=container.slice();clone2[+segment]=value;return clone2}const clone={...container,[segment]:value};Object.setPrototypeOf(clone,Object.getPrototypeOf(container));return clone}function readOwnFieldPath(row,path){if(typeof path!=="string"||path.length===0)return void 0;if(path.indexOf(".")===-1){return isSafeFieldPathSegment(path)&&row!==null&&typeof row==="object"&&Object.hasOwn(row,path)?row[path]:void 0}const segments=parseSafeFieldPath(path);if(segments===null)return void 0;let current=row;for(const segment of segments){if(current===null||typeof current!=="object"||!Object.hasOwn(current,segment)){return void 0}current=current[segment]}return current}function setOwnFieldPathImmutable(root,path,value){const segments=parseSafeFieldPath(path);if(segments===null||!isFieldPathContainer(root))return root;const chain=[root];for(let index2=0;index2<segments.length-1;index2++){const current2=chain[index2];const segment=segments[index2];if(Array.isArray(current2)&&arrayIndexForSegment(segment)===null||!Object.hasOwn(current2,segment)){return root}const next=current2[segment];if(!isFieldPathContainer(next))return root;chain.push(next)}const current=chain[chain.length-1];const leaf=segments[segments.length-1];if(Array.isArray(current)){const arrayIndex=arrayIndexForSegment(leaf);if(arrayIndex===null||arrayIndex>current.length)return root}let nextValue=value;for(let index2=chain.length-1;index2>=0;index2--){nextValue=cloneContainerWithOwnValue(chain[index2],segments[index2],nextValue)}return nextValue}function parseValueGetterExpression(expr){return parseGridExpression(expr,false)}function evaluateExpression(ast,getIdentifier){return evaluateGridExpression(ast,getIdentifier)}function resolveCellValue(input){if(input==null||typeof input!=="object"){console.warn(`${WARN_PREFIX$3} resolveCellValue called with non-object input.`);return null}const row=input.row;if(row==null||typeof row!=="object"){console.warn(`${WARN_PREFIX$3} resolveCellValue: row is not an object.`);return null}const fieldKey=typeof input.field==="string"&&input.field.length>0?input.field:input.colId;if(typeof fieldKey!=="string"||fieldKey.length===0){console.warn(`${WARN_PREFIX$3} resolveCellValue: colId / field is empty.`);return null}const valueGetter=input.valueGetter;if(valueGetter===void 0||valueGetter===null){return readOwnFieldPath(row,fieldKey)}const inFlight=input.inFlight??new Set;const seededFieldKey=!inFlight.has(fieldKey);if(seededFieldKey)inFlight.add(fieldKey);const getOther=input.getOtherValue;function getValue(otherColId){if(typeof otherColId!=="string"||otherColId.length===0){return void 0}if(inFlight.has(otherColId)){warnGridExpression("VG-CYCLE",otherColId,input.rowIndex);return null}inFlight.add(otherColId);try{if(typeof getOther==="function"){return getOther(otherColId)}return readOwnFieldPath(row,otherColId)}finally{inFlight.delete(otherColId)}}try{if(typeof valueGetter==="function"){const params={data:row,node:{rowIndex:input.rowIndex,rowId:input.rowId},colId:fieldKey,getValue,colDef:input.colDef,rowIndex:input.rowIndex,context:input.context,api:input.api};try{return valueGetter(params)}catch(err){warnGridExpression("VG-FN",fieldKey,input.rowIndex,void 0,err);return null}}if(typeof valueGetter==="string"){let parsed;try{parsed=parseValueGetterExpression(valueGetter)}catch(err){const msg=err instanceof Error?err.message:String(err);warnGridExpression("VG-PARSE",fieldKey,input.rowIndex,msg);return null}const lookup=name=>getValue(name);try{return evaluateExpression(parsed.ast,lookup)}catch(err){warnGridExpression("VG-EVAL",fieldKey,input.rowIndex,void 0,err);return null}}warnGridExpression("VG-TYPE",fieldKey,input.rowIndex);return readOwnFieldPath(row,fieldKey)}finally{if(seededFieldKey)inFlight.delete(fieldKey)}}const WARN_PREFIX$2="[Syidax] sy-grid:";const DEFAULT_LOCALE="en";function parseValueFormatterTemplate(template){if(typeof template!=="string"){return{segments:[{kind:"literal",text:""}]}}const segments=[];const len=template.length;let i=0;let literalStart=0;while(i<len){if(template[i]==="{"&&i+1<len&&template[i+1]==="{"){if(i>literalStart){segments.push({kind:"literal",text:template.slice(literalStart,i)})}const slotStart=i;i+=2;let close=-1;for(let j=i;j+1<len;j++){if(template[j]==="}"&&template[j+1]==="}"){close=j;break}}if(close<0){console.warn(`${WARN_PREFIX$2} valueFormatter template missing closing "}}" starting at ${slotStart}.`);segments.push({kind:"literal",text:template.slice(slotStart)});return{segments}}const inner=template.slice(i,close);segments.push(parseInterpolation(inner));i=close+2;literalStart=i;continue}i++}if(literalStart<len){segments.push({kind:"literal",text:template.slice(literalStart)})}if(segments.length===0){segments.push({kind:"literal",text:""})}return{segments}}function parseInterpolation(body){const parts=body.split("|").map(s=>s.trim());const varName=parts[0]??"";const pipes=[];for(let p=1;p<parts.length;p++){const segment=parts[p];if(segment.length===0)continue;const colonIdx=segment.indexOf(":");if(colonIdx<0){pipes.push({name:segment,args:[]});continue}const name=segment.slice(0,colonIdx).trim();const argRaw=segment.slice(colonIdx+1);const args=[argRaw];pipes.push({name,args})}return{kind:"interp",varName,pipes}}function applyOnePipe(value,pipe,locale,warnedKeys){const name=pipe.name;const arg0=pipe.args.length>0?pipe.args[0]:void 0;if(name==="upper"){return coerceToString$1(value).toUpperCase()}if(name==="lower"){return coerceToString$1(value).toLowerCase()}if(name==="trim"){return coerceToString$1(value).trim()}if(name==="round"){if(value===null||value===void 0)return"";const n=parsePipeIntArg(arg0,0,name,warnedKeys);const num=Number(value);if(!Number.isFinite(num)){return coerceToString$1(value)}return num.toFixed(n)}if(name==="percent"){if(value===null||value===void 0)return"";const n=parsePipeIntArg(arg0,0,name,warnedKeys);const num=Number(value);if(!Number.isFinite(num)){return coerceToString$1(value)}return(num*100).toFixed(n)+"%"}if(name==="currency"){if(value===null||value===void 0)return"";const code=typeof arg0==="string"&&arg0.length>0?arg0:"USD";const num=Number(value);if(!Number.isFinite(num)){return coerceToString$1(value)}try{return new Intl.NumberFormat(locale,{style:"currency",currency:code}).format(num)}catch(err){const key=`currency:${code}`;if(!warnedKeys.has(key)){warnedKeys.add(key);console.warn(`${WARN_PREFIX$2} valueFormatter currency pipe rejected code "${code}":`,err)}return num.toFixed(2)}}if(name==="date"){const fmt=typeof arg0==="string"&&arg0.length>0?arg0:"YYYY-MM-DD";return formatDateValue(value,fmt)}if(name==="default"){if(isEmptyValue(value)){return typeof arg0==="string"?arg0:""}return value}if(!warnedKeys.has(`unknown:${name}`)){warnedKeys.add(`unknown:${name}`);console.warn(`${WARN_PREFIX$2} valueFormatter unknown pipe "${name}"; skipping.`)}return value}function parsePipeIntArg(arg,defaultN,pipeName,warnedKeys){if(arg===void 0)return defaultN;const trimmed=arg.trim();if(trimmed.length===0)return defaultN;const n=Number(trimmed);if(!Number.isFinite(n)){const key=`arg:${pipeName}:${trimmed}`;if(!warnedKeys.has(key)){warnedKeys.add(key);console.warn(`${WARN_PREFIX$2} valueFormatter "${pipeName}" arg "${trimmed}" is not a number; using ${defaultN}.`)}return defaultN}const floored=Math.floor(n);if(floored<0)return 0;if(floored>100)return 100;return floored}function formatDateValue(value,fmt){const d=toDate(value);if(d===null)return coerceToString$1(value);const Y=String(d.getFullYear()).padStart(4,"0");const M=String(d.getMonth()+1).padStart(2,"0");const D=String(d.getDate()).padStart(2,"0");const H=String(d.getHours()).padStart(2,"0");const m=String(d.getMinutes()).padStart(2,"0");const s=String(d.getSeconds()).padStart(2,"0");return fmt.replace(/YYYY/g,Y).replace(/MM/g,M).replace(/DD/g,D).replace(/HH/g,H).replace(/mm/g,m).replace(/ss/g,s)}function toDate(value){if(value instanceof Date){return Number.isFinite(value.getTime())?value:null}if(typeof value==="number"){const d=new Date(value);return Number.isFinite(d.getTime())?d:null}if(typeof value==="string"){const t2=Date.parse(value);if(!Number.isFinite(t2))return null;return new Date(t2)}return null}function isEmptyValue(value){if(value===null||value===void 0)return true;if(typeof value==="string"&&value.length===0)return true;return false}function coerceToString$1(value){if(value===null||value===void 0)return"";if(typeof value==="string")return value;return String(value)}function renderParsedTemplate(parsed,value,locale,warnedKeys){const out=[];for(let i=0;i<parsed.segments.length;i++){const seg=parsed.segments[i];if(seg.kind==="literal"){out.push(seg.text);continue}if(seg.varName==="value"){out.push(applyPipesWithSharedWarnBudget(value,seg.pipes,locale,warnedKeys));continue}const key=`var:${seg.varName}`;if(!warnedKeys.has(key)){warnedKeys.add(key);console.warn(`${WARN_PREFIX$2} valueFormatter unknown variable "${seg.varName}".`)}out.push(reconstructInterpolation(seg))}return out.join("")}function applyPipesWithSharedWarnBudget(value,pipes,locale,warnedKeys){let cur=value;for(let i=0;i<pipes.length;i++){cur=applyOnePipe(cur,pipes[i],locale,warnedKeys)}return coerceToString$1(cur)}function reconstructInterpolation(seg){const parts=[seg.varName];for(let i=0;i<seg.pipes.length;i++){const p=seg.pipes[i];parts.push(p.args.length>0?`${p.name}:${p.args.join(":")}`:p.name)}return`{{${parts.join(" | ")}}}`}function formatCellValue(input){if(input==null||typeof input!=="object"){console.warn(`${WARN_PREFIX$2} formatCellValue called with non-object input.`);return""}const value=input.value;const valueFormatter=input.valueFormatter;const locale=typeof input.locale==="string"&&input.locale.length>0?input.locale:DEFAULT_LOCALE;if(valueFormatter===void 0||valueFormatter===null){return value==null?"":String(value)}if(typeof valueFormatter==="function"){try{const result=valueFormatter({value,data:input.row,node:{rowIndex:input.rowIndex},colId:input.colId,locale,context:input.context,api:input.api});return typeof result==="string"?result:coerceToString$1(result)}catch(err){console.warn(`${WARN_PREFIX$2} valueFormatter for "${input.colId}" threw on row ${input.rowIndex}:`,err);return value==null?"":String(value)}}if(typeof valueFormatter==="string"){if(valueFormatter.indexOf("{{")<0){return valueFormatter}const parsed=parseValueFormatterTemplate(valueFormatter);const warnedKeys=new Set;return renderParsedTemplate(parsed,value,locale,warnedKeys)}console.warn(`${WARN_PREFIX$2} valueFormatter for "${input.colId}" is not a function / string; ignoring.`);return value==null?"":String(value)}const LEADING_CONTROL=/^[\u0000-\u001f\u007f-\u009f]/;const FORMULA_AFTER_IGNORABLE_PREFIX=/^[\s\u0000-\u001f\u007f-\u009f\ufeff]*[=+\-@\uff1d\uff0b\uff0d\uff20]/;function hasSpreadsheetFormulaPrefix(value){if(typeof value!=="string"||value.length===0)return false;return LEADING_CONTROL.test(value)||FORMULA_AFTER_IGNORABLE_PREFIX.test(value)}function isTextualSpreadsheetValue(value){if(value===null||value===void 0)return false;if(typeof value==="string")return true;if(typeof value==="number"||typeof value==="bigint"||typeof value==="boolean")return false;if(value instanceof Date)return false;return true}function neutralizeSpreadsheetText(value,options={}){const text=typeof value==="string"?value:String(value??"");const textual=options.textual??isTextualSpreadsheetValue(value);if(options.escapeFormulae===false||!textual||!hasSpreadsheetFormulaPrefix(text))return text;return`'${text}`}const DEFAULT_DELIMITER=",";const DEFAULT_LINE_TERMINATOR="\r\n";const UTF8_BOM="\uFEFF";function getDataAsCsv(options){if(options==null||typeof options!=="object"){return{csv:"",rowCount:0,columnCount:0}}const columns=Array.isArray(options.columns)?options.columns:[];const rows=Array.isArray(options.rows)?options.rows:[];const delimiter=typeof options.delimiter==="string"&&options.delimiter.length>0?options.delimiter:DEFAULT_DELIMITER;const lineTerminator=typeof options.lineTerminator==="string"&&options.lineTerminator.length>0?options.lineTerminator:DEFAULT_LINE_TERMINATOR;const includeHeaders=options.includeHeaders!==false;const locale=typeof options.locale==="string"&&options.locale.length>0?options.locale:"en";const blankForNullish=options.blankForNullish!==false;const escapeFormulae=options.escapeFormulae!==false;const lines=[];if(includeHeaders){const headerCells=[];for(let c=0;c<columns.length;c++){const col=columns[c];const header=typeof col.headerName==="string"&&col.headerName.length>0?col.headerName:col.field;headerCells.push(escapeFormulae?escapeCsvSpreadsheetCell(header,delimiter):escapeCsvField(header,delimiter))}lines.push(headerCells.join(delimiter))}for(let r=0;r<rows.length;r++){const row=rows[r];const cells=[];for(let c=0;c<columns.length;c++){const col=columns[c];const raw=resolveCellValue({row,rowIndex:r,colId:col.field,field:col.field,valueGetter:col.valueGetter});const formatted=col.valueFormatter?formatCellValue({value:raw,row,rowIndex:r,colId:col.field,valueFormatter:col.valueFormatter,locale}):coerceForCsv(raw,blankForNullish);const textual=col.valueFormatter!=null||isTextualSpreadsheetValue(raw);cells.push(escapeFormulae&&textual?escapeCsvSpreadsheetCell(formatted,delimiter):escapeCsvField(formatted,delimiter))}lines.push(cells.join(delimiter))}const body=lines.join(lineTerminator);const csv=options.bom===true?UTF8_BOM+body:body;return{csv,rowCount:rows.length,columnCount:columns.length}}function escapeCsvField(value,delimiter,forceQuote=false){if(typeof value!=="string")value=String(value??"");if(value.length===0&&!forceQuote)return"";let needsQuote=forceQuote;if(value.indexOf(delimiter)>=0)needsQuote=true;else if(value.indexOf('"')>=0)needsQuote=true;else if(value.indexOf("\n")>=0||value.indexOf("\r")>=0)needsQuote=true;if(!needsQuote)return value;return`"${value.replace(/"/g,'""')}"`}function escapeCsvSpreadsheetCell(value,delimiter){const text=typeof value==="string"?value:String(value??"");const neutralized=neutralizeSpreadsheetText(text);return escapeCsvField(neutralized,delimiter,neutralized!==text)}function coerceForCsv(value,blankForNullish){if(value===null||value===void 0)return blankForNullish?"":String(value);if(typeof value==="string")return value;if(value instanceof Date){const t2=value.getTime();return Number.isFinite(t2)?value.toISOString():""}return String(value)}function detectPastedValue(raw){const trimmed=raw.trim();if(trimmed==="")return raw;const lower=trimmed.toLowerCase();if(lower==="true")return true;if(lower==="false")return false;if(/^-?0\d/.test(trimmed))return raw;if(/^-?\d+(\.\d+)?([eE][+-]?\d+)?$/.test(trimmed)){if(significantDigits(trimmed)>15)return raw;const num=Number(trimmed);if(Number.isFinite(num))return num}if(/^-?\d{1,3}(,\d{3})+(\.\d+)?$/.test(trimmed)){const plain=trimmed.replace(/,/g,"");if(significantDigits(plain)>15)return raw;const num=Number(plain);if(Number.isFinite(num))return num}return raw}function significantDigits(numericText){const mantissa=numericText.replace(/^[+-]/,"").split(/[eE]/)[0].replace(".","").replace(/^0+/,"");return mantissa.length}function parseTsv(text){if(text==="")return[];const src=text.endsWith("\r\n")?text.slice(0,-2):text.endsWith("\n")||text.endsWith("\r")?text.slice(0,-1):text;if(src==="")return[];const rows=[];let row=[];let cell="";let i=0;const n=src.length;while(i<n){const ch=src[i];if(cell===""&&ch==='"'){i++;while(i<n){const q=src[i];if(q==='"'){if(src[i+1]==='"'){cell+='"';i+=2;continue}i++;break}cell+=q;i++}continue}if(ch===" "){row.push(cell);cell="";i++;continue}if(ch==="\n"||ch==="\r"){row.push(cell);rows.push(row);row=[];cell="";i+=ch==="\r"&&src[i+1]==="\n"?2:1;continue}cell+=ch;i++}row.push(cell);rows.push(row);return rows}const CANDIDATE_DELIMITERS=[",",";"," ","|"];function detectDelimiter(text){if(typeof text!=="string"||text==="")return",";let best=",";let bestScore=-1;for(const delim of CANDIDATE_DELIMITERS){const rows=parseCsv(text,{delimiter:delim}).slice(0,10);if(rows.length===0)continue;const freq=new Map;for(const r of rows)freq.set(r.length,(freq.get(r.length)??0)+1);let modeCount=0;let modeRows=0;for(const[cols,n]of freq){if(cols<2)continue;if(n>modeRows||n===modeRows&&cols>modeCount){modeRows=n;modeCount=cols}}if(modeCount<2)continue;const score=modeRows*100+modeCount;if(score>bestScore){bestScore=score;best=delim}}return best}function parseCsv(text,options={}){if(typeof text!=="string"||text==="")return[];const delimiter=options.delimiter&&options.delimiter.length>0?options.delimiter:",";let src=text;if(src.endsWith("\r\n"))src=src.slice(0,-2);else if(src.endsWith("\n")||src.endsWith("\r"))src=src.slice(0,-1);if(src==="")return[];const rows=[];let row=[];let cell="";let i=0;const n=src.length;const dLen=delimiter.length;const matchesDelimiter=pos=>{if(dLen===1)return src[pos]===delimiter;return src.startsWith(delimiter,pos)};while(i<n){const ch=src[i];if(cell===""&&ch==='"'){i++;while(i<n){const q=src[i];if(q==='"'){if(src[i+1]==='"'){cell+='"';i+=2;continue}i++;break}cell+=q;i++}continue}if(matchesDelimiter(i)){row.push(cell);cell="";i+=dLen;continue}if(ch==="\r"||ch==="\n"){row.push(cell);rows.push(row);row=[];cell="";i+=ch==="\r"&&src[i+1]==="\n"?2:1;continue}cell+=ch;i++}row.push(cell);rows.push(row);return rows}function inferColumnTypes(dataRows,columnCount){const types=[];for(let c=0;c<columnCount;c++){let sawValue=false;let allNumber=true;let allBoolean=true;for(const row of dataRows){const raw=row[c];if(raw===void 0||raw.trim()==="")continue;sawValue=true;const detected=detectPastedValue(raw);if(typeof detected!=="number")allNumber=false;if(typeof detected!=="boolean")allBoolean=false;if(!allNumber&&!allBoolean)break}types.push(!sawValue?"string":allNumber?"number":allBoolean?"boolean":"string")}return types}function fieldFromHeader(header,index2,seen){let base=header.trim().replace(/\s+/g,"_").replace(/[^\w]/g,"");if(base===""||/^\d/.test(base))base=base===""?`col${index2+1}`:`col_${base}`;let field=base;let n=2;while(seen.has(field))field=`${base}_${n++}`;seen.add(field);return field}function csvToGrid(text,options={}){const delimiter=options.delimiter&&options.delimiter.length>0?options.delimiter:detectDelimiter(text);const matrix=parseCsv(text,{delimiter});if(matrix.length===0)return{columns:[],rowData:[],delimiter};const hasHeader=options.hasHeader!==false;const columnCount=matrix.reduce((max,r)=>Math.max(max,r.length),0);const headerRow=hasHeader?matrix[0]:[];const dataRows=hasHeader?matrix.slice(1):matrix;const types=inferColumnTypes(dataRows,columnCount);const seen=new Set;const columns=[];for(let c=0;c<columnCount;c++){const headerName=hasHeader?headerRow[c]?.trim()||`Column ${c+1}`:`Column ${c+1}`;columns.push({field:fieldFromHeader(hasHeader?headerRow[c]??`col${c+1}`:`col${c+1}`,c,seen),headerName,type:types[c]})}const rowData=dataRows.map(row=>{const obj={};for(let c=0;c<columnCount;c++){const col=columns[c];const raw=row[c];if(raw===void 0||col.type!=="string"&&raw.trim()===""){obj[col.field]=col.type==="string"?raw??"":null;continue}if(raw===""){obj[col.field]=col.type==="string"?"":null;continue}obj[col.field]=col.type==="number"?(()=>{const v=detectPastedValue(raw);return typeof v==="number"?v:raw})():col.type==="boolean"?(()=>{const v=detectPastedValue(raw);return typeof v==="boolean"?v:raw})():raw}return obj});return{columns,rowData,delimiter}}const DEFAULT_CONTEXT_MENU_LOCALE={copyCell:"Copy cell",copyRow:"Copy row",exportCsv:"Export CSV"};function buildContextMenuItems(ctx,options={}){if(ctx==null||typeof ctx!=="object")return[];const locale={...DEFAULT_CONTEXT_MENU_LOCALE,...options.locale??{}};const rows=Array.isArray(ctx.rows)?ctx.rows:[];const hasRow=rows.length>0&&Number.isFinite(ctx.rowIndex)&&ctx.rowIndex>=0&&ctx.rowIndex<rows.length;const hasCell=hasRow&&typeof ctx.field==="string"&&ctx.field.length>0;const items=[];items.push({id:"copy-cell",label:locale.copyCell,disabled:!hasCell});items.push({id:"copy-row",label:locale.copyRow,disabled:!hasRow});items.push({id:"separator-1",label:"",separator:true});items.push({id:"export-csv",label:locale.exportCsv,disabled:rows.length===0});return items}async function copyTextToClipboard(text){if(typeof text!=="string")text=String(text??"");const clipboard=globalThis.navigator?.clipboard;if(clipboard&&typeof clipboard.writeText==="function"){try{await clipboard.writeText(text);return true}catch{return false}}return false}function getCellTooltipText(options){if(!options||typeof options!=="object")return"";const{row,rowIndex,column,displayedText,isOverflowing,locale,context,api}=options;if(!column||typeof column.field!=="string")return"";const tooltipField=typeof column.tooltipField==="string"&&column.tooltipField.length>0?column.tooltipField:void 0;if(column.tooltipValueGetter||tooltipField){const raw=resolveCellValue({row,rowIndex,colId:tooltipField??column.field,field:tooltipField??column.field,valueGetter:column.tooltipValueGetter??(tooltipField?void 0:column.valueGetter),colDef:column,context,api});return coerceToString(raw)}if(isOverflowing===true){return resolveFormattedText(row,rowIndex,column,locale,displayedText,context,api)}return""}function resolveFormattedText(row,rowIndex,column,locale,displayedText,context,api){if(typeof displayedText==="string"&&displayedText.length>0)return displayedText;const raw=resolveCellValue({row,rowIndex,colId:column.field,field:column.field,valueGetter:column.valueGetter,colDef:column,context,api});if(column.valueFormatter){return formatCellValue({value:raw,row,rowIndex,colId:column.field,valueFormatter:column.valueFormatter,locale:locale??"en",context,api})}return coerceToString(raw)}function coerceToString(value){if(value===null||value===void 0)return"";if(typeof value==="string")return value;return String(value)}const DEFAULT_SHOW_MS=400;const DEFAULT_HIDE_MS=100;function createHoverDelay(options){const showMs=Number.isFinite(options.showMs)&&options.showMs>=0?options.showMs:DEFAULT_SHOW_MS;const hideMs=Number.isFinite(options.hideMs)&&options.hideMs>=0?options.hideMs:DEFAULT_HIDE_MS;const schedule=options.schedule??((fn,ms)=>setTimeout(fn,ms));const cancel=options.cancel??(h=>clearTimeout(h));let state="idle";let timer=null;let pendingTarget=null;function clear(){if(timer!==null){cancel(timer);timer=null}}return{get state(){return state},enter(target){const previousTarget=pendingTarget;pendingTarget=target;if(state==="shown"){clear();state="shown";if(previousTarget!==target)options.onShow(target);return}if(state==="pending-hide"){clear();state="shown";if(previousTarget!==target)options.onShow(target);return}clear();state="pending-show";timer=schedule(()=>{timer=null;state="shown";const t2=pendingTarget;if(t2!==null)options.onShow(t2)},showMs)},leave(){if(state==="idle")return;if(state==="pending-show"){clear();state="idle";pendingTarget=null;return}clear();state="pending-hide";timer=schedule(()=>{timer=null;state="idle";pendingTarget=null;options.onHide()},hideMs)},cancel(){clear();state="idle";pendingTarget=null}}}const DEFAULT_DRAG_THRESHOLD_PX=5;const DEFAULT_DOUBLE_CLICK_THRESHOLD_MS=400;function getMouseButton(event){const b=event?.button;if(b===0)return"left";if(b===1)return"middle";if(b===2)return"right";return"other"}function pickModifierFlags(event){return{ctrl:event?.ctrlKey===true,shift:event?.shiftKey===true,meta:event?.metaKey===true,alt:event?.altKey===true}}function pixelDistanceExceedsDragThreshold(downX,downY,upX,upY,threshold=DEFAULT_DRAG_THRESHOLD_PX){if(!Number.isFinite(downX)||!Number.isFinite(downY))return false;if(!Number.isFinite(upX)||!Number.isFinite(upY))return false;const dx=upX-downX;const dy=upY-downY;return dx*dx+dy*dy>threshold*threshold}function classifyRowClick(input){const dragThreshold=Number.isFinite(input.dragThresholdPx)?input.dragThresholdPx:DEFAULT_DRAG_THRESHOLD_PX;const dblThreshold=Number.isFinite(input.doubleClickThresholdMs)?input.doubleClickThresholdMs:DEFAULT_DOUBLE_CLICK_THRESHOLD_MS;const button=getMouseButton(input.upEvent);const modifiers=pickModifierFlags(input.upEvent);const dragged=pixelDistanceExceedsDragThreshold(input.downEvent.clientX??0,input.downEvent.clientY??0,input.upEvent.clientX??0,input.upEvent.clientY??0,dragThreshold);const doubleClick=typeof input.lastClickAt==="number"&&Number.isFinite(input.lastClickAt)&&input.timestamp-input.lastClickAt<=dblThreshold;return{button,modifiers,doubleClick,dragged}}const ORDER=["bottom","top","right","left"];function computeFloatingPosition(input){const offset=Number.isFinite(input.offset)?input.offset:4;const flip=input.flip!==false;const preferred=input.preferred??"bottom";const order=flip?[preferred,...ORDER.filter(p=>p!==preferred)]:[preferred];for(let i=0;i<order.length;i++){const place=order[i];const pos=placeAt(input.anchor,input.floating,place,offset);if(fits(pos,input.floating,input.viewport)){return{x:pos.x,y:pos.y,placement:place}}}const fallback=placeAt(input.anchor,input.floating,preferred,offset);const clamped=clampToViewport(fallback,input.floating,input.viewport);return{x:clamped.x,y:clamped.y,placement:preferred}}function placeAt(anchor,floating,placement,offset){const anchorCx=anchor.x+anchor.width/2;const anchorCy=anchor.y+anchor.height/2;if(placement==="top"){return{x:anchorCx-floating.width/2,y:anchor.y-floating.height-offset}}if(placement==="bottom"){return{x:anchorCx-floating.width/2,y:anchor.y+anchor.height+offset}}if(placement==="left"){return{x:anchor.x-floating.width-offset,y:anchorCy-floating.height/2}}return{x:anchor.x+anchor.width+offset,y:anchorCy-floating.height/2}}function fits(pos,floating,viewport){if(pos.x<viewport.x)return false;if(pos.y<viewport.y)return false;if(pos.x+floating.width>viewport.x+viewport.width)return false;if(pos.y+floating.height>viewport.y+viewport.height)return false;return true}function clampToViewport(pos,floating,viewport){const maxX=viewport.x+viewport.width-floating.width;const maxY=viewport.y+viewport.height-floating.height;return{x:Math.max(viewport.x,Math.min(pos.x,maxX)),y:Math.max(viewport.y,Math.min(pos.y,maxY))}}function gridProUnavailableReason(){return"Pro engine not included in this build"}function gridEngineTag(){return"sy-grid-standard"}const GRID_BUILD_TIER="community";const importGridLicenseRuntime=()=>Promise.resolve().then(function(){return require("./index-BS2KctDY.js")});const GRID_METHOD_TABLE_SOURCE="advanced-filter:getConditionFilter! getConditionPresets! setConditionFilter setConditionPresets;batch-editing:cancelBatchEdit! commitBatchEdit getPendingBatchCells! isBatchEditing! stageBatchCell startBatchEdit;cell-notes:addCellComment closeCellCommentPanel! deleteCellComment getCellComments! openCellCommentPanel setCellCommentResolved;collaboration:connectCollabRoom disconnectCollabRoom! getCollaborators! getSyncStatus!;context-menu:getContextMenuItems!;excel-export:exportDataAsExcel getDataAsExcel;fill-handle:fillRange;formulas:applySpillFormula clearSpillFormula disconnectWorkbook! flushWorkbookPropagation getSpillReport! getWorkbookBinding! getWorkbookIntegrityReport! getWorkbookPropagationState! getWorkbookSnapshotReport! reconnectWorkbook undoSpillTransaction;integrated-charts:activateChartToolPanelItem applyChartCrossFilter closeChartToolPanel!chart-link createRangeChart destroyChart!chart-link exportChartImage getChartAccessibleSummary!chart-link getChartFleetReport!chart-link getChartMenuModel!chart-link getChartModels!chart-link getChartRefs!chart-link getChartToolPanelReport!chart-link openChartToolPanel resetChartCrossFilter!chart-link restoreChartModels syncCharts updateChart;master-detail:collapseAllDetailRows! expandAllDetailRows setDetailRowExpanded;pdf-export:exportDataAsPdf getDataAsPdf;pivot:getPivotCombinationReport!group-pivot getPivotSecondaryColumns! setPivotColumns setValueColumns;range-clipboard:copyRangeToClipboard pasteFromClipboard;range-selection:clearCellRanges! getCanonicalRanges! getCellRanges! setCanonicalRanges;row-grouping:collapseAllRowGroups expandAllRowGroups getDisplayRowInfo!group-pivot getGroupCheckStates!group-pivot getRegisteredAggFuncNames! registerAggFunc setRowGroupExpanded unregisterAggFunc;server-side-row-model:applyServerSideTransaction applyServerSideTransactionAsync auditServerPivotResultColumns! flushServerSideAsyncTransactions getServerGroupSelectionState!ssrm-ops getServerPivotResultColumns! getServerSideSelectionState!ssrm-ops getServerSideStoreState! refreshServerSide selectAllServerSide selectServerGroupChildren setServerGroupSelectionState setServerSideSelectionState;tool-panels:closeToolPanel! getOpenedToolPanel! openToolPanel;tree-data:collapseAllTreeNodes expandAllTreeNodes reparentRows setTreeNodeExpanded;wasm-acceleration:getActiveTier!";function parseGridMethodTable(source){const out=new Map;for(const group of source.split(";")){const[feature,list]=group.split(":");for(const item of list.split(" ")){const[name,chunks]=item.split("!");out.set(name,{feature:`grid.${feature}`,open:chunks===void 0?null:chunks===""?[]:chunks.split("+")})}}return out}const GRID_METHOD_TABLE=parseGridMethodTable(GRID_METHOD_TABLE_SOURCE);const TAG="sy-grid";const brandView=mode=>({attrs:{class:brandMarkDefault.BRAND_MARK_CLASS,"aria-hidden":"true",[brandMarkDefault.BRAND_ATTR]:mode,[brandMarkDefault.BRAND_PRODUCT_ATTR]:"grid",...mode==="pending"?{hidden:"hidden"}:{}},image:null});const GRID_DEFAULT_BRAND_VIEW=brandView("default");class GridLicenseFacade{grid;loadLayer;prefetchRuntime;session=null;loading=null;failed=false;prefetched=false;detached=false;asked=new Set;reported=new Set;lastRefused;constructor(grid,loadLayer=()=>Promise.resolve().then(function(){return require("./grid-license-session-BRxDNKOX.js")}),prefetchRuntime=importGridLicenseRuntime){this.grid=grid;this.loadLayer=loadLayer;this.prefetchRuntime=prefetchRuntime}get layer(){return this.session}get state(){return this.failed?"load-failed":"pending"}load(feature,retry=false){if(this.session!==null)return Promise.resolve(this.session);if(feature!==void 0){this.asked.add(feature);if(!this.prefetched){this.prefetched=true;this.prefetchRuntime().catch(()=>void 0)}}if(this.loading===null&&(!this.failed||retry)){this.failed=false;this.loading=this.loadLayer().then(layer=>{const session=layer.createGridLicenseSession(this.grid);for(const asked of this.asked)session.gate.displayState(asked);this.asked.clear();if(this.detached)session.detach();this.session=session;return session},()=>{this.failed=true;return null}).then(session=>{this.loading=null;this.grid.licenseRenderTick+=1;return session})}return this.loading??Promise.resolve(this.session)}ask(feature){if(this.session===null)void this.load(feature);return this.session}refusal(feature,member,code,quiet=false){const error=new errors.SyidaxLicenseError({code,product:"grid",feature,state:"pending",tag:TAG,method:member,reason:code==="load-failed"?"license layer unavailable":void 0});if(quiet||this.detached)return error;this.lastRefused=feature;try{errors.dispatchLicenseEvent(this.grid.host,errors.LICENSE_FEATURE_REFUSED_EVENT,{product:"grid",feature,state:"pending",code,tag:TAG,...member!==void 0?{method:member}:{}})}catch{}errors.warnLicenseOnce(`${TAG}
|
|
2
|
+
${feature}
|
|
3
|
+
pending`,error.message);this.grid.licenseRenderTick+=1;return error}noteFailed(feature,member,action){const key=`${feature}
|
|
4
|
+
${action}`;if(!this.failed||this.reported.has(key))return;this.reported.add(key);void Promise.resolve().then(()=>this.refusal(feature,member,"load-failed"))}allowed(feature,member){const session=this.ask(feature);if(session!==null)return session.gate.allowed(feature,member);this.noteFailed(feature,member,"inert");return false}workAllowed(feature,member){const session=this.ask(feature);if(session!==null)return session.gate.workAllowed(feature,member);this.noteFailed(feature,member,"refused");return false}newWorkAllowed(feature,member){return this.allowed(feature,member)&&this.workAllowed(feature,member)}moduleAvailable(feature,member,chunkId,available){if(available)return true;this.session?.gate.moduleAvailable(feature,member,chunkId,false);return false}displayState(feature){const session=this.ask(feature);return session!==null?session.gate.displayState(feature):this.state}frozen(feature){return this.session?.gate.frozen(feature)??false}entitled(feature){return this.session?.gate.entitled(feature)??false}lost(feature){return this.session?.gate.lost(feature)??false}live(feature){return this.session?.gate.license().liveState(feature)==="valid"}awaiting(features){if(features.length===0)return false;for(const feature of features)this.ask(feature);return this.session!==null?this.session.gate.awaiting(features):!this.failed}async settle(features){if(features.length===0)return;const session=await this.load(features[0],true);await session?.gate.settle(features)}refuseRequest(features,member){if(features.length===0)return[];const session=this.ask(features[0]);if(session!==null)return session.gate.refuseRequest(features,member);for(const feature of features)this.ask(feature);return[...new Set(features)].map(feature=>this.refusal(feature,member,this.failed?"load-failed":"license-pending"))}async admitAny(features,member){if(features.length===0)return;const session=await this.load(features[0],true);if(session===null)throw this.refusal(features[0],member,"load-failed");return session.gate.admitAny(features,member)}admitChunk(chunkId,features){if(features.length===0)return void 0;if(this.session!==null)return this.session.gate.admitChunk(chunkId,features);return this.load(features[0],true).then(session=>{if(session===null)throw this.refusal(features[0],`chunk:${chunkId}`,"load-failed");return session.gate.admitChunk(chunkId,features)})}async method(name,isLoaded,steps){const entry=GRID_METHOD_TABLE.get(name);const early=steps.validate?.();if(early)return early.result;if(entry?.open?.every(isLoaded)){let computed;try{const module=steps.load?await steps.load():void 0;computed=await steps.exec(module,()=>void 0)}catch(error){throw this.session!==null?this.session.gate.moduleFailure(error,entry.feature,name):error}return steps.publish?steps.publish(computed):computed}const session=await this.load(entry?.feature,true);if(session===null){if(entry===void 0)throw new TypeError(`${TAG}: not a Grid Pro method: ${name}`);throw this.refusal(entry.feature,name,"load-failed")}return session.gate.method(name,isLoaded,{...steps,validate:void 0})}refusalError(feature,member){return this.session!==null?this.session.gate.refusalError(feature,member):this.refusal(feature,member,this.failed?"load-failed":"license-pending",true)}attributes(){if(this.session!==null)return this.session.gate.attributes();if(this.asked.size===0&&this.lastRefused===void 0)return{};return{[errors.LICENSE_ATTR.state]:this.state,[errors.LICENSE_ATTR.feature]:[...this.asked].sort()[0],[errors.LICENSE_ATTR.refused]:this.lastRefused}}afterRender(){this.session?.afterRender()}rebind(){this.detached=false;this.session?.gate.rebind()}detach(){this.detached=true;this.session?.detach()}brandView(value){if(this.session!==null)return this.session.brandView(value);void this.load();return this.failed?GRID_DEFAULT_BRAND_VIEW:brandView("pending")}brandChanged(){this.session?.brandChanged()}brandImageFailed(src){this.session?.brandImageFailed(src)}}const issued=new WeakSet;function createGridAccelerationPort(allowed){const listeners=new Set;const port=Object.freeze({allowed:()=>allowed()===true,watch(listener){listeners.add(listener);return()=>{listeners.delete(listener)}}});issued.add(port);return{port,notify(){for(const listener of[...listeners]){try{listener()}catch(error){const report=globalThis.reportError;if(typeof report==="function")report(error)}}}}}const GRID_PRO_CHUNK_FEATURES=Object.freeze(Object.assign(Object.create(null),{"batch-edit":Object.freeze(["grid.batch-editing"]),"chart-link":Object.freeze(["grid.integrated-charts"]),collab:Object.freeze(["grid.collaboration"]),"export-pdf":Object.freeze(["grid.pdf-export"]),"export-xlsx":Object.freeze(["grid.excel-export"]),fill:Object.freeze(["grid.fill-handle"]),"formula-acceleration":Object.freeze(["grid.formulas","grid.wasm-acceleration"]),"formula-core":Object.freeze(["grid.formulas"]),"formula-engine":Object.freeze(["grid.formulas","grid.wasm-acceleration"]),"formula-wasm":Object.freeze(["grid.wasm-acceleration"]),"formula-worker":Object.freeze(["grid.wasm-acceleration"]),"group-pivot":Object.freeze(["grid.pivot","grid.row-grouping"]),"master-detail":Object.freeze(["grid.master-detail"]),pivot:Object.freeze(["grid.pivot"]),"pro-filters":Object.freeze(["grid.advanced-filter","grid.multi-filter","grid.set-filter"]),"pro-panels":Object.freeze(["grid.batch-editing","grid.cell-notes","grid.column-menu","grid.context-menu","grid.find","grid.status-bar","grid.tool-panels"]),"range-selection":Object.freeze(["grid.range-clipboard","grid.range-selection"]),"rich-select":Object.freeze(["grid.rich-select"]),"ssrm-ops":Object.freeze(["grid.server-side-row-model"]),"tree-data":Object.freeze(["grid.tree-data"]),"viewport-row-model":Object.freeze(["grid.viewport-row-model"]),"workbook-ops":Object.freeze(["grid.formulas"])}));function gridChunkProFeatureSets(ids){const out=[];if(!Array.isArray(ids))return out;const seen=new Set;for(const id of ids){if(typeof id!=="string"||seen.has(id))continue;const features=GRID_PRO_CHUNK_FEATURES[id];if(features===void 0||features.length===0)continue;seen.add(id);out.push(features)}return out}function gridEngineArriving(facts){return facts.allowed&&facts.inBuild&&true&&!facts.frozen}function gridPivotWinsOnArrival(facts){return facts.pivotArriving&&!facts.treeActive&&!facts.treeArriving&&!facts.serverActive&&!facts.windowedActive&&!facts.viewportArriving}function columnEntryIndexes(state){const out=new Map;const slice=state?.slices?.columns;const entries=Array.isArray(slice?.entries)?slice.entries:[];entries.forEach((entry,index2)=>{if(entry!==null&&typeof entry==="object"&&typeof entry.colId==="string"&&!out.has(entry.colId)){out.set(entry.colId,index2)}});return out}function scanGridStateProRequirements(plan,state){const out=[];if(!plan.ok)return out;const applied=new Set(plan.appliedSlices);const add=(feature,path,detail)=>{out.push({feature,path,detail})};const columns=plan.columns;if(columns!==null&&applied.has("columns")){const indexes=columnEntryIndexes(state);for(const field of columns.rowGroupFields){const index2=indexes.get(field);add("grid.row-grouping",index2===void 0?"$/slices/columns/entries":`$/slices/columns/entries/${index2}/rowGroupIndex`,`row grouping by "${field}"`)}if(columns.pivotMode===true)add("grid.pivot","$/slices/columns/pivotMode","pivot mode")}const filter=plan.filter;if(filter!==null&&applied.has("filter"))out.push(...scanFilterProRequirements(filter,"$/slices/filter"));const rows=plan.rows;if(rows!==null){if(applied.has("rowGrouping")&&rows.collapsedGroupRoutes.length>0){add("grid.row-grouping","$/slices/rowGrouping/collapsedGroupRoutes","collapsed row groups")}if(applied.has("pivot")&&rows.pivotCollapsedGroupRoutes.length>0){add("grid.pivot","$/slices/pivot/collapsedGroupRoutes","collapsed pivot groups")}if(applied.has("expansion")&&rows.collapsedTreeNodePaths.length>0){add("grid.tree-data","$/slices/expansion/collapsedTreeNodePaths","collapsed tree nodes")}if(applied.has("expansion")&&rows.expandedDetailRowIds.length>0){add("grid.master-detail","$/slices/expansion/expandedDetailRowIds","expanded detail rows")}if(applied.has("selection")&&rows.ranges.length>0){add("grid.range-selection","$/slices/selection/ranges","cell ranges")}}const ui=plan.ui;if(plan.find&&applied.has("find"))add("grid.find","$/slices/find","find query and options");if(ui!==null&&applied.has("sideBar")&&ui.immediate.sideBar.openPanelId!==null){add("grid.tool-panels","$/slices/sideBar/openPanelId",`open tool panel "${ui.immediate.sideBar.openPanelId}"`)}return out}function scanFilterProRequirements(filter,root){const out=[];for(const[column,active]of Object.entries(filter.builtIn)){const entry=active;const path=`${root}/builtIn/${column}`;if(entry?.kind==="set"){out.push({feature:"grid.set-filter",path,detail:`set filter on "${column}"`})}else if(entry?.kind==="multi"){out.push({feature:"grid.multi-filter",path,detail:`multi filter on "${column}"`});const parts=Array.isArray(entry.spec?.parts)?entry.spec.parts:[];if(parts.some(part=>part?.kind==="set"))out.push({feature:"grid.set-filter",path,detail:`set filter part on "${column}"`})}}if(filter.conditionTree!==null){out.push({feature:"grid.advanced-filter",path:`${root}/conditionTree`,detail:"advanced filter condition tree"})}return out}function gridStateRequirementFeatures(requirements){const out=[];for(const requirement of requirements){if(!out.includes(requirement.feature))out.push(requirement.feature)}return out}function licenseCause(refused){if(refused.code==="license-pending")return"license verification pending";if(refused.code==="load-failed")return"license runtime unavailable";if(refused.code==="disposed")return"the grid was disconnected";return`license state: ${refused.state}`}function gridStateLicenseIssues(requirements,refused){const byFeature=new Map(refused.map(entry=>[entry.feature,entry]));const out=[];for(const requirement of requirements){const refusal=byFeature.get(requirement.feature);if(refusal===void 0)continue;out.push({code:"not-entitled",path:requirement.path,detail:`${requirement.detail} needs the Grid Pro feature "${requirement.feature}" (${licenseCause(refusal)})`})}return out}const GRID_PRO_FILTER_FEATURES=new Set(["grid.set-filter","grid.multi-filter","grid.advanced-filter"]);function gridProFilterRequirements(requirements){return requirements.filter(requirement=>GRID_PRO_FILTER_FEATURES.has(requirement.feature))}function gridStateModuleIssues(requirements,cause,chunkId){const why=cause==="module-missing"?"not in this build":"the module failed to load";return requirements.map(requirement=>({code:"not-entitled",path:requirement.path,detail:`${requirement.detail} needs the Grid Pro module '${chunkId}' of "${requirement.feature}" (${cause}: ${why})`}))}function refusedGridStatePlan(plan,licenseIssues){return{...plan,ok:false,issues:[...plan.issues,...licenseIssues],appliedSlices:[],columns:null,filter:null,rows:null,ui:null}}function pasteNeedsRangeClipboard(matrix){if(matrix.length>1)return true;return matrix.length===1&&matrix[0].length>1}function copyNeedsRangeClipboard(bounds){if(bounds.length>1)return true;if(bounds.length===0)return false;const[only]=bounds;return only.top!==only.bottom||only.left!==only.right}class GridFormulaFreeze{heldBack=false;edited=new WeakMap;get held(){return this.heldBack}holdRebuild(){this.heldBack=true}holdEdit(row,field){this.heldBack=true;let fields=this.edited.get(row);if(fields===void 0){fields=new Set;this.edited.set(row,fields)}fields.add(field)}showsRaw(sheet,field,row){if(!this.heldBack)return false;if(this.edited.get(row)?.has(field)===true)return true;return sheet.cellCoordinate(field,row)===null}reset(){this.heldBack=false;this.edited=new WeakMap}}class GridHeldDeclaration{feature;same;applied=null;heldBack=false;constructor(feature,same){this.feature=feature;this.same=same}get held(){return this.heldBack}get current(){return this.applied}resolve(declared,license){if(declared===null){this.applied=null;this.heldBack=false;return null}const applied=this.applied;if(applied!==null&&this.same(declared,applied)){this.heldBack=false;return declared}if(!license.entitled(this.feature)){this.heldBack=true;return applied}this.applied=declared;this.heldBack=false;return declared}clear(){this.applied=null;this.heldBack=false}resume(license){if(!this.heldBack||!license.entitled(this.feature))return false;this.heldBack=false;return true}}class GridHeldInits{held=new Map;hold(key,feature){this.held.set(key,feature)}drop(key){this.held.delete(key)}has(key){return this.held.has(key)}release(license){const released=[];for(const[key,feature]of[...this.held]){if(!license.entitled(feature))continue;this.held.delete(key);released.push(key)}return released}}const GRID_COLLAB_FEATURE="grid.collaboration";class GridCollabFreeze{stoppedByLicense=false;get stopped(){return this.stoppedByLicense}holdJoin(){this.stoppedByLicense=true}onLicenseChange(license,stream){if(!stream.running()||!license.lost(GRID_COLLAB_FEATURE))return false;stream.stop();this.stoppedByLicense=true;return true}resume(license,stream){if(!this.stoppedByLicense||!license.entitled(GRID_COLLAB_FEATURE))return false;this.stoppedByLicense=false;if(!stream.roomDeclared()||stream.running())return false;stream.rejoin();return true}reset(){this.stoppedByLicense=false}}function pickEngine(opts){if(opts.requested==="standard")return{tier:"standard"};const proUnavailableReason=opts.proUnavailableReason??"Pro engine unavailable";if(opts.requested==="pro"){const reason=proUnavailableReason;if(opts.onUnavailable==="error"){throw new Error(`[Syidax] sy-grid: Pro engine unavailable — ${reason}`)}console.warn(`[Syidax] sy-grid: Pro engine unavailable, falling back to Standard (${reason}).`);return{tier:"standard",fallbackReason:reason}}const rowCount=Number.isFinite(opts.rowCount)&&opts.rowCount>=0?opts.rowCount:0;const threshold=Number.isFinite(opts.proThreshold)&&opts.proThreshold>0?opts.proThreshold:1e5;if(rowCount>=threshold){const reason=proUnavailableReason;console.info(`[Syidax] sy-grid: auto mode wanted Pro for ${rowCount.toLocaleString()} rows (threshold ${threshold.toLocaleString()}) but Pro is unavailable — ${reason}. Staying on Standard.`);return{tier:"standard",fallbackReason:reason}}return{tier:"standard"}}function sortAndFilter(rows,sort,filter){let result=rows;if(filter?.query){const q=filter.query.toLowerCase();result=result.filter(row=>{for(const key in row){const v=row[key];if(typeof v==="string"&&v.toLowerCase().includes(q))return true;if(typeof v==="number"&&String(v).includes(q))return true}return false})}if(sort){const{column,direction}=sort;const sign=direction==="asc"?1:-1;result=[...result].sort((a,b)=>{const av=a[column];const bv=b[column];if(av==null&&bv==null)return 0;if(av==null)return 1;if(bv==null)return-1;if(av<bv)return-1*sign;if(av>bv)return 1*sign;return 0})}return result}const decided=(decision,awaitingLicense=false)=>({kind:"decided",decision,awaitingLicense});function planGridEngine(request,readLicense){const base={requested:request.requested,rowCount:request.rowCount,proThreshold:request.proThreshold,onUnavailable:request.onUnavailable};{return decided(pickEngine({...base,proUnavailableReason:request.buildReason}))}}const GRID_CHUNK_CONTRACT_VERSION="1.22.0";const DEFAULT_CHUNK_TIMEOUT_MS=15e3;const CHUNK_AUTO_RETRY=Object.freeze({reason:"network",maxAttempts:2,delayMs:250});const GRID_CHUNK_PLAN=Object.freeze({contractVersion:GRID_CHUNK_CONTRACT_VERSION,entries:Object.freeze([Object.freeze({id:"batch-edit",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:4096,countsTowardFirstUsePayload:true}),Object.freeze({id:"chart-link",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:28672,countsTowardFirstUsePayload:true}),Object.freeze({id:"collab",kind:"esm",tier:"pro",family:"collabGovernance",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:20480,countsTowardFirstUsePayload:true}),Object.freeze({id:"component-runtime",kind:"esm",tier:"community",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:29696,countsTowardFirstUsePayload:true}),Object.freeze({id:"conditional-format",kind:"esm",tier:"community",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:3072,countsTowardFirstUsePayload:true}),Object.freeze({id:"export-pdf",kind:"esm",tier:"pro",family:"export",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:20480,countsTowardFirstUsePayload:true}),Object.freeze({id:"export-xlsx",kind:"esm",tier:"pro",family:"export",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:16384,countsTowardFirstUsePayload:true}),Object.freeze({id:"fill",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:11264,countsTowardFirstUsePayload:true}),Object.freeze({id:"formula-acceleration",kind:"esm",tier:"pro",family:"formula",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:33792,countsTowardFirstUsePayload:true}),Object.freeze({id:"formula-core",kind:"esm",tier:"pro",family:"formula",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:25600,countsTowardFirstUsePayload:true}),Object.freeze({id:"formula-engine",kind:"wasm",tier:"pro",family:"formula",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:106496,countsTowardFirstUsePayload:true}),Object.freeze({id:"formula-wasm",kind:"wasm",tier:"pro",family:"formula",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:20480,countsTowardFirstUsePayload:true}),Object.freeze({id:"formula-worker",kind:"worker",tier:"pro",family:"formula",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:12288,countsTowardFirstUsePayload:true}),Object.freeze({id:"group-pivot",kind:"esm",tier:"pro",family:"pivot",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:14336,countsTowardFirstUsePayload:true}),Object.freeze({id:"import-xlsx",kind:"esm",tier:"community",family:"export",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:12288,countsTowardFirstUsePayload:true}),Object.freeze({id:"live-api",kind:"esm",tier:"community",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:4096,countsTowardFirstUsePayload:true}),Object.freeze({id:"master-detail",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:1024,countsTowardFirstUsePayload:true}),Object.freeze({id:"pivot",kind:"esm",tier:"pro",family:"pivot",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:6144,countsTowardFirstUsePayload:true}),Object.freeze({id:"pro-filters",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:5120,countsTowardFirstUsePayload:true}),Object.freeze({id:"pro-panels",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:11264,countsTowardFirstUsePayload:true}),Object.freeze({id:"range-selection",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:2048,countsTowardFirstUsePayload:true}),Object.freeze({id:"rich-select",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:3072,countsTowardFirstUsePayload:true}),Object.freeze({id:"row-drag",kind:"esm",tier:"community",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:24576,countsTowardFirstUsePayload:true}),Object.freeze({id:"row-layout",kind:"esm",tier:"community",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:24576,countsTowardFirstUsePayload:true}),Object.freeze({id:"ssrm-ops",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:17408,countsTowardFirstUsePayload:true}),Object.freeze({id:"tree-data",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:7168,countsTowardFirstUsePayload:true}),Object.freeze({id:"viewport-row-model",kind:"esm",tier:"pro",family:"base",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:1024,countsTowardFirstUsePayload:true}),Object.freeze({id:"workbook-ops",kind:"esm",tier:"pro",family:"formula",contractVersion:GRID_CHUNK_CONTRACT_VERSION,budgetGzipBytes:36864,countsTowardFirstUsePayload:true})])});function canRequestChunk(buildTier,entry){if(entry.tier==="pro"&&buildTier!=="pro"){return{ok:false,reason:"tier-unavailable"}}return{ok:true}}function classifyChunkFailure(error,context={}){if(context.aborted===true)return"aborted";if(context.timedOut===true)return"timeout";if(context.integrityMismatch===true)return"integrity";if(typeof context.httpStatus==="number"&&context.httpStatus>0&&context.httpStatus!==200){return"network"}if(context.online===false)return"offline";const name=error instanceof Error?error.name:"";const message=error instanceof Error?error.message:typeof error==="string"?error:"";if(name==="AbortError")return"aborted";if(/content security policy|blocked:csp|csp/i.test(message)||name==="EvalError")return"csp";if(error instanceof SyntaxError)return"invalid-module";if(name==="TypeError"&&/failed to fetch|import|network|load/i.test(message))return"network";return"unknown"}function chunkRetryDecision(reason,attempt){if(reason===CHUNK_AUTO_RETRY.reason&&attempt<CHUNK_AUTO_RETRY.maxAttempts){return{retry:true,delayMs:CHUNK_AUTO_RETRY.delayMs}}return{retry:false,delayMs:0}}class GridChunkLoadError extends Error{chunkId;reason;httpStatus;constructor(chunkId,reason,message,httpStatus){super(message);this.name="GridChunkLoadError";this.chunkId=chunkId;this.reason=reason;this.httpStatus=httpStatus}}const defaultDelay=ms=>new Promise(resolve=>setTimeout(resolve,ms));async function defaultSha256Hex(bytes){const subtle=globalThis.crypto?.subtle;if(subtle===void 0)throw new GridChunkLoadError("formula-wasm","integrity","crypto");const digest=await subtle.digest("SHA-256",bytes.slice().buffer);return[...new Uint8Array(digest)].map(byte=>byte.toString(16).padStart(2,"0")).join("")}function createGridChunkLoader(options){const manifest=options.manifest??GRID_CHUNK_PLAN;const timeoutMs=options.timeoutMs??DEFAULT_CHUNK_TIMEOUT_MS;const now=options.now??(()=>Date.now());const delay=options.delay??defaultDelay;const sha256Hex=options.sha256Hex??defaultSha256Hex;const emit=detail=>{try{options.emit?.(detail)}catch{}};const cache=new Map;const attempts=new Map;let generationCounter=0;let disposed=false;const entryFor=id=>manifest.entries.find(candidate=>candidate.id===id);const settleWaiter=(waiter,settle)=>{if(waiter.settled)return;waiter.settled=true;if(waiter.signal!==void 0&&waiter.onAbort!==void 0){waiter.signal.removeEventListener("abort",waiter.onAbort)}settle()};const failWaiters=(attempt,error)=>{for(const waiter of[...attempt.waiters]){settleWaiter(waiter,()=>waiter.reject(error))}attempt.waiters.clear()};const resolveWaiters=(attempt,value)=>{for(const waiter of[...attempt.waiters]){settleWaiter(waiter,()=>waiter.resolve(value))}attempt.waiters.clear()};async function fetchVerifiedBytes(id,entry,source,signal){if(entry.integrity===void 0){throw new GridChunkLoadError(id,"integrity","manifest")}const fetchBytes=source.fetchBytes??(async(url2,fetchSignal)=>{const response=await fetch(url2,{signal:fetchSignal});if(!response.ok){throw new GridChunkLoadError(id,"network","http",response.status)}return{bytes:new Uint8Array(await response.arrayBuffer()),httpStatus:response.status}});const url=typeof source.url==="function"?source.url():source.url;const result=await fetchBytes(url,signal);if(result.bytes.byteLength!==entry.integrity.byteLength){throw new GridChunkLoadError(id,"integrity",`size:${result.bytes.byteLength}:${entry.integrity.byteLength}`)}const digest=await sha256Hex(result.bytes);if(digest!==entry.integrity.sha256){throw new GridChunkLoadError(id,"integrity","hash")}return result.bytes}async function runSingleAttempt(id,entry,source,attempt,attemptNumber){emit({chunkId:id,kind:entry.kind,tier:entry.tier,phase:"loading",attempt:attemptNumber});let timedOut=false;const signal=attempt.abortController.signal;let onAbort=null;const abortPromise=new Promise((_resolve,reject)=>{onAbort=()=>reject(new GridChunkLoadError(id,timedOut?"timeout":"aborted",timedOut?`timeout:${timeoutMs}:${attemptNumber}`:"aborted"));signal.addEventListener("abort",onAbort,{once:true})});const timeoutHandle=setTimeout(()=>{timedOut=true;attempt.abortController.abort()},timeoutMs);try{const work=source.kind==="wasm"?fetchVerifiedBytes(id,entry,source,signal):source.load();void work.then(()=>void 0,()=>void 0);const value=await Promise.race([work,abortPromise]);return value}catch(error){if(error instanceof GridChunkLoadError)throw error;const online=typeof navigator!=="undefined"&&typeof navigator.onLine==="boolean"?navigator.onLine:void 0;const reason=classifyChunkFailure(error,{timedOut,aborted:attempt.abortController.signal.aborted,online});const message=error instanceof Error?error.message:String(error);throw new GridChunkLoadError(id,reason,`${reason}:${message}`)}finally{clearTimeout(timeoutHandle);if(onAbort!==null)signal.removeEventListener("abort",onAbort)}}async function runAttempts(id,entry,source,attempt){const startedAt=now();let attemptNumber=1;for(;;){try{const value=await runSingleAttempt(id,entry,source,attempt,attemptNumber);if(attempts.get(id)!==attempt)return;cache.set(id,value);attempts.delete(id);emit({chunkId:id,kind:entry.kind,tier:entry.tier,phase:"loaded",attempt:attemptNumber,durationMs:Math.max(0,now()-startedAt)});resolveWaiters(attempt,value);return}catch(error){const loadError=error instanceof GridChunkLoadError?error:new GridChunkLoadError(id,"unknown","failed");if(attempts.get(id)!==attempt)return;const retry=chunkRetryDecision(loadError.reason,attemptNumber);if(retry.retry){attemptNumber+=1;if(retry.delayMs>0)await delay(retry.delayMs);if(attempts.get(id)!==attempt)return;continue}attempts.delete(id);emit({chunkId:id,kind:entry.kind,tier:entry.tier,phase:"failed",attempt:attemptNumber,durationMs:Math.max(0,now()-startedAt),reason:loadError.reason,message:loadError.message,httpStatus:loadError.httpStatus});failWaiters(attempt,loadError);return}}}const makeWaiter=(attempt,signal)=>new Promise((resolve,reject)=>{const waiter={resolve,reject,signal,settled:false};if(signal!==void 0){if(signal.aborted){waiter.settled=true;reject(new GridChunkLoadError(attemptChunkId(attempt),"aborted","caller"));return}waiter.onAbort=()=>{attempt.waiters.delete(waiter);settleWaiter(waiter,()=>reject(new GridChunkLoadError(attemptChunkId(attempt),"aborted","caller")))};signal.addEventListener("abort",waiter.onAbort,{once:true})}attempt.waiters.add(waiter)});const attemptIds=new WeakMap;const attemptChunkId=attempt=>attemptIds.get(attempt)??"collab";function load(id,opts={}){if(disposed){return Promise.reject(new GridChunkLoadError(id,"aborted","disposed"))}if(cache.has(id))return Promise.resolve(cache.get(id));const running=attempts.get(id);if(running!==void 0)return makeWaiter(running,opts.signal);const entry=entryFor(id);if(entry===void 0){return Promise.reject(new GridChunkLoadError(id,"unknown","undeclared"))}const decision=canRequestChunk(options.tier,entry);if(!decision.ok){const error=new GridChunkLoadError(id,decision.reason??"tier-unavailable",`tier:${options.tier}`);emit({chunkId:id,kind:entry.kind,tier:entry.tier,phase:"failed",attempt:0,reason:error.reason,message:error.message});return Promise.reject(error)}const source=options.sources[id];if(source===void 0){const error=new GridChunkLoadError(id,"unknown","source");emit({chunkId:id,kind:entry.kind,tier:entry.tier,phase:"failed",attempt:0,reason:error.reason,message:error.message});return Promise.reject(error)}generationCounter+=1;const attempt={generation:generationCounter,waiters:new Set,abortController:new AbortController};attemptIds.set(attempt,id);attempts.set(id,attempt);const waiter=makeWaiter(attempt,opts.signal);void runAttempts(id,entry,source,attempt);return waiter}async function preload(ids){await Promise.allSettled(ids.map(id=>load(id)))}function dispose(){if(disposed)return;disposed=true;for(const[id,attempt]of[...attempts.entries()]){attempt.abortController.abort();attempts.delete(id);failWaiters(attempt,new GridChunkLoadError(id,"aborted","disposed"))}}function stats(){let waiters=0;for(const attempt of attempts.values())waiters+=attempt.waiters.size;return{cached:[...cache.keys()],inFlight:[...attempts.keys()],waiters,disposed}}return{load,preload,isLoaded:id=>cache.has(id),stats,dispose}}function gridProChunkFeatures(chunkId){return typeof chunkId==="string"?GRID_PRO_CHUNK_FEATURES[chunkId]:void 0}function guardGridChunkLoader(inner,admit){const load=(id,opts)=>{const features=gridProChunkFeatures(id);if(features===void 0||features.length===0||inner.isLoaded(id))return inner.load(id,opts);const stats=inner.stats();if(stats.disposed||stats.inFlight.includes(id))return inner.load(id,opts);let admission;try{admission=admit(id,features)}catch(error){return Promise.reject(error)}if(admission===void 0)return inner.load(id,opts);return admission.then(()=>{if(opts?.signal?.aborted===true)throw new GridChunkLoadError(id,"aborted","caller");return inner.load(id,opts)})};return{load,async preload(ids){await Promise.allSettled(ids.map(id=>load(id)))},isLoaded:id=>inner.isLoaded(id),stats:()=>inner.stats(),dispose:()=>inner.dispose()}}const GRID_PRO_PROP_DECLARATION_SOURCE="advanced-filter:conditionBuilder;collaboration:collaborationRoom realtimeUrl collabUserName collabUserColor collabPersistence=indexeddb collabPresence- collabConflictUi-;context-menu:contextMenu contextMenuItemsCallback;column-menu:columnMenu columnMenuItems;find:find;cell-notes:cellNotes cellNotesAdapter;batch-editing:batchEditToolbar;fill-handle:enableFillHandle fillHandleAxes fillHandleMode;formulas:formulas formulaBar showFormulas workbookId sheetName;master-detail:masterDetail detailRowHeight!160 detailCellRenderer detailGridOptions getDetailRowData detailNestingLevel!0;pdf-export:pdfFontUrl pdfAutoFont-;pivot:pivotMode pivotRowGroupColumns pivotColumns pivotValueColumns pivotAggFuncs pivotSubtotals!off pivotGrandTotal!bottom pivotPanelShow=always|onlyWhenPivoting pivotPanel;range-selection:rangeSelection;row-grouping:groupBy groupPanel;server-side-row-model:serverSideDatasource serverSideGroupCols serverSideTransactionWaitMs;status-bar:statusBar;tool-panels:sideBar;tree-data:getDataPath treeIdField treeParentField treeLabelField;viewport-row-model:viewportDatasource;wasm-acceleration:engine=pro proThreshold!100000 unavailable=error";function parseGridProPropDeclarations(source){const out=[];for(const group of source.split(";")){const[feature,list]=group.split(":");for(const item of list.split(" ")){const match=/^([A-Za-z]+)(?:(-)|!(.+)|=(.+))?$/.exec(item);if(match===null)throw new TypeError(`grid Pro declaration table: bad entry "${item}"`);const[,prop,never,notDefault,oneOf]=match;const rule=never!==void 0?{kind:"never"}:notDefault!==void 0?{kind:"not-default",value:notDefault}:oneOf!==void 0?{kind:"one-of",values:oneOf.split("|")}:{kind:"present"};out.push({prop,feature:`grid.${feature}`,rule})}}return out}const GRID_PRO_PROP_DECLARATIONS=parseGridProPropDeclarations(GRID_PRO_PROP_DECLARATION_SOURCE);function present(value){if(value===void 0||value===null||value===false||value==="")return false;return!(Array.isArray(value)&&value.length===0)}function gridProValueDeclares(rule,value){switch(rule.kind){case"never":return false;case"present":return present(value);case"not-default":return present(value)&&String(value)!==rule.value;case"one-of":return(typeof value==="string"||typeof value==="number")&&rule.values.includes(String(value))}}function gridDeclaredProProps(read){const out=[];for(const{prop,feature,rule}of GRID_PRO_PROP_DECLARATIONS){if(gridProValueDeclares(rule,read(prop)))out.push([feature,prop])}return out}const GRID_DECLARATION_CHUNKS=Object.freeze({"grid.advanced-filter":"pro-filters","grid.context-menu":"pro-panels","grid.column-menu":"pro-panels","grid.find":"pro-panels","grid.cell-notes":"pro-panels","grid.batch-editing":"pro-panels","grid.fill-handle":"fill","grid.formulas":"formula-core","grid.master-detail":"master-detail","grid.pivot":"group-pivot","grid.range-selection":"range-selection","grid.row-grouping":"group-pivot","grid.server-side-row-model":"ssrm-ops","grid.status-bar":"pro-panels","grid.tool-panels":"pro-panels","grid.tree-data":"tree-data","grid.viewport-row-model":"viewport-row-model"});function gridProChunkSources(){return null}function cloneOwnProperties(source,target,clone){for(const key of Reflect.ownKeys(source)){if(Array.isArray(source)&&key==="length")continue;const descriptor=Object.getOwnPropertyDescriptor(source,key);if(descriptor===void 0)continue;if("value"in descriptor)descriptor.value=clone(descriptor.value);Object.defineProperty(target,key,descriptor)}}function structuralClone(value){const seen=new Map;const clone=input=>{if(input===null||typeof input!=="object"&&typeof input!=="function")return input;if(typeof input==="function")return input;const cached=seen.get(input);if(cached!==void 0)return cached;if(input instanceof Date){const out2=new Date(input.getTime());seen.set(input,out2);return out2}if(input instanceof RegExp){const out2=new RegExp(input.source,input.flags);out2.lastIndex=input.lastIndex;seen.set(input,out2);return out2}if(input instanceof ArrayBuffer){const out2=input.slice(0);seen.set(input,out2);return out2}if(ArrayBuffer.isView(input)){const clonedBuffer=clone(input.buffer);let out2;if(input instanceof DataView){out2=new DataView(clonedBuffer,input.byteOffset,input.byteLength)}else{const TypedArray=input.constructor;out2=new TypedArray(clonedBuffer,input.byteOffset,input.length)}seen.set(input,out2);return out2}if(input instanceof Map){const out2=new Map;seen.set(input,out2);for(const[key,item]of input)out2.set(clone(key),clone(item));return out2}if(input instanceof Set){const out2=new Set;seen.set(input,out2);for(const item of input)out2.add(clone(item));return out2}if(Array.isArray(input)){const out2=new Array(input.length);seen.set(input,out2);cloneOwnProperties(input,out2,clone);return out2}const out=Object.create(Object.getPrototypeOf(input));seen.set(input,out);cloneOwnProperties(input,out,clone);return out};return clone(value)}function bytesEqual(a,b){if(a.byteLength!==b.byteLength)return false;const left=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);const right=new Uint8Array(b.buffer,b.byteOffset,b.byteLength);for(let i=0;i<left.length;i+=1){if(left[i]!==right[i])return false}return true}function structuralEqual(a,b){const leftToRight=new Map;const rightToLeft=new Map;const equal=(left,right)=>{if(Object.is(left,right))return true;if(left===null||right===null||typeof left!=="object"||typeof right!=="object")return false;const mappedRight=leftToRight.get(left);if(mappedRight!==void 0)return mappedRight===right;const mappedLeft=rightToLeft.get(right);if(mappedLeft!==void 0)return mappedLeft===left;leftToRight.set(left,right);rightToLeft.set(right,left);if(left instanceof Date||right instanceof Date){return left instanceof Date&&right instanceof Date&&Object.is(left.getTime(),right.getTime())}if(left instanceof RegExp||right instanceof RegExp){return left instanceof RegExp&&right instanceof RegExp&&left.source===right.source&&left.flags===right.flags&&left.lastIndex===right.lastIndex}if(left instanceof ArrayBuffer||right instanceof ArrayBuffer){return left instanceof ArrayBuffer&&right instanceof ArrayBuffer&&bytesEqual(new Uint8Array(left),new Uint8Array(right))}if(ArrayBuffer.isView(left)||ArrayBuffer.isView(right)){return ArrayBuffer.isView(left)&&ArrayBuffer.isView(right)&&left.constructor===right.constructor&&bytesEqual(left,right)}if(left instanceof Map||right instanceof Map){if(!(left instanceof Map)||!(right instanceof Map)||left.size!==right.size)return false;const l=left.entries();const r=right.entries();for(let next=l.next(),other=r.next();!next.done&&!other.done;next=l.next(),other=r.next()){if(!equal(next.value[0],other.value[0])||!equal(next.value[1],other.value[1]))return false}return true}if(left instanceof Set||right instanceof Set){if(!(left instanceof Set)||!(right instanceof Set)||left.size!==right.size)return false;const l=left.values();const r=right.values();for(let next=l.next(),other=r.next();!next.done&&!other.done;next=l.next(),other=r.next()){if(!equal(next.value,other.value))return false}return true}if(Object.getPrototypeOf(left)!==Object.getPrototypeOf(right))return false;const leftKeys=Reflect.ownKeys(left);const rightKeys=Reflect.ownKeys(right);if(leftKeys.length!==rightKeys.length)return false;for(const key of leftKeys){if(!Object.prototype.hasOwnProperty.call(right,key))return false;const leftDescriptor=Object.getOwnPropertyDescriptor(left,key);const rightDescriptor=Object.getOwnPropertyDescriptor(right,key);if(leftDescriptor===void 0||rightDescriptor===void 0)return false;if(leftDescriptor.enumerable!==rightDescriptor.enumerable||leftDescriptor.configurable!==rightDescriptor.configurable||"writable"in leftDescriptor&&leftDescriptor.writable!==rightDescriptor.writable)return false;if("value"in leftDescriptor){if(!("value"in rightDescriptor)||!equal(leftDescriptor.value,rightDescriptor.value))return false}else if("value"in rightDescriptor||leftDescriptor.get!==rightDescriptor.get||leftDescriptor.set!==rightDescriptor.set)return false}return true};return equal(a,b)}const DEFAULT_MAX=1e3;function normalizeMaxEntries(value){const floored=Number.isFinite(value)?Math.floor(value):0;return floored>0?floored:DEFAULT_MAX}class AuditLog{maxEntries;now;buf=[];seqCounter=0;recordedCount=0;constructor(options={}){this.maxEntries=normalizeMaxEntries(options.maxEntries??DEFAULT_MAX);this.now=options.now??Date.now}record(input){this.seqCounter+=1;this.recordedCount+=1;const entry=structuralClone({...input,seq:this.seqCounter,ts:input.ts??this.now()});this.buf.push(entry);if(this.buf.length>this.maxEntries)this.buf.splice(0,this.buf.length-this.maxEntries);return structuralClone(entry)}entries(filter){if(filter===void 0)return structuralClone(this.buf);const kinds=filter.kind===void 0?null:new Set(Array.isArray(filter.kind)?filter.kind:[filter.kind]);const sources=filter.source===void 0?null:new Set(Array.isArray(filter.source)?filter.source:[filter.source]);return structuralClone(this.buf.filter(e=>(kinds===null||kinds.has(e.kind))&&(sources===null||sources.has(e.source))&&(filter.sinceSeq===void 0||e.seq>=filter.sinceSeq)&&(filter.sinceTs===void 0||e.ts>=filter.sinceTs)))}size(){return this.buf.length}totalRecorded(){return this.recordedCount}last(){return this.buf.length>0?structuralClone(this.buf[this.buf.length-1]):null}resize(maxEntries){this.maxEntries=normalizeMaxEntries(maxEntries);if(this.buf.length>this.maxEntries)this.buf.splice(0,this.buf.length-this.maxEntries)}clear(){this.buf=[]}}function reportPolicyError(onError,error){if(typeof onError!=="function")return;try{onError(error)}catch{}}function invalidPolicyReturn(value){const kind=value===null?"null":typeof value;return new TypeError(`Cell access policy must return the synchronous literal boolean true; received ${kind}.`)}function resolveCellReadable(params,policy,onError){if(policy===null||policy===void 0)return true;if(typeof policy!=="function"){reportPolicyError(onError,new TypeError("Cell access policy must be a function, null, or undefined."));return false}let result;try{result=policy(params)}catch(err){reportPolicyError(onError,err);return false}if(result===true)return true;if(result instanceof Promise)void result.catch(()=>void 0);if(result!==false)reportPolicyError(onError,invalidPolicyReturn(result));return false}function maskCellValue(value,readable,mask){return readable?value:mask}function resolveCellEditable(params,policy,onError){return resolveCellReadable(params,policy,onError)}const isBlank$1=v=>v===null||v===void 0||v==="";function asNumber$1(v){if(typeof v==="number")return Number.isFinite(v)?v:null;if(typeof v==="string"&&v.trim()!==""){const n=Number(v);return Number.isFinite(n)?n:null}return null}function asText(v,caseSensitive){const s=v===null||v===void 0?"":String(v);return caseSensitive===true?s:s.toLowerCase()}function looseEquals(a,b,caseSensitive){const an=asNumber$1(a);const bn=asNumber$1(b);if(an!==null&&bn!==null)return an===bn;return asText(a,caseSensitive)===asText(b,caseSensitive)}function evaluateCfCondition(cond,value){if(cond===null||typeof cond!=="object")return false;switch(cond.type){case"blank":return isBlank$1(value);case"notBlank":return!isBlank$1(value);case"equals":return looseEquals(value,cond.value,cond.caseSensitive);case"notEquals":return!looseEquals(value,cond.value,cond.caseSensitive);case"greaterThan":case"greaterThanOrEqual":case"lessThan":case"lessThanOrEqual":{const a=asNumber$1(value);const b=asNumber$1(cond.value);if(a===null||b===null)return false;if(cond.type==="greaterThan")return a>b;if(cond.type==="greaterThanOrEqual")return a>=b;if(cond.type==="lessThan")return a<b;return a<=b}case"between":{const a=asNumber$1(value);const lo=asNumber$1(cond.value);const hi=asNumber$1(cond.value2);if(a===null||lo===null||hi===null)return false;const low=Math.min(lo,hi);const high=Math.max(lo,hi);return a>=low&&a<=high}case"contains":return isBlank$1(value)?false:asText(value,cond.caseSensitive).includes(asText(cond.value,cond.caseSensitive));case"notContains":return isBlank$1(value)?true:!asText(value,cond.caseSensitive).includes(asText(cond.value,cond.caseSensitive));case"startsWith":return isBlank$1(value)?false:asText(value,cond.caseSensitive).startsWith(asText(cond.value,cond.caseSensitive));case"endsWith":return isBlank$1(value)?false:asText(value,cond.caseSensitive).endsWith(asText(cond.value,cond.caseSensitive));default:return false}}function ruleMatches(rule,ctx){if(rule===null||typeof rule!=="object"||rule.condition===void 0)return false;if(rule.field!==void 0&&rule.field!==ctx.field)return false;return evaluateCfCondition(rule.condition,ctx.value)}function evaluateConditionalFormats(rules,ctx){if(!Array.isArray(rules)||rules.length===0)return null;let merged=null;for(const rule of rules){if(!ruleMatches(rule,ctx))continue;merged={...merged??{},...rule.style??{}};if(rule.stopIfTrue===true)break}return merged}const HEX=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;const FUNC=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-z%.,\s/]+\)$/i;const NAMED=/^[a-z]+$/i;function isSafeCssColor(value){if(typeof value!=="string")return false;const v=value.trim();if(v===""||v.length>64)return false;if(/[;{}]|url\(|expression|\/\*|<|>/i.test(v))return false;return HEX.test(v)||FUNC.test(v)||NAMED.test(v)}function cfStyleToCss(style){const css={};if(style===null||style===void 0)return css;if(isSafeCssColor(style.backgroundColor))css["background-color"]=style.backgroundColor;if(isSafeCssColor(style.color))css["color"]=style.color;if(style.fontWeight==="bold"||style.fontWeight==="normal")css["font-weight"]=style.fontWeight;if(style.fontStyle==="italic"||style.fontStyle==="normal")css["font-style"]=style.fontStyle;if(style.textDecoration==="underline"||style.textDecoration==="line-through"||style.textDecoration==="none"){css["text-decoration"]=style.textDecoration}return css}function resolveConditionalFormatCss(rules,ctx){return cfStyleToCss(evaluateConditionalFormats(rules,ctx))}const VALID$1={valid:true};const isBlank=v=>v===null||v===void 0||v==="";function asNumber(v){if(typeof v==="number")return Number.isFinite(v)?v:null;if(typeof v==="string"&&v.trim()!==""){const n=Number(v);return Number.isFinite(n)?n:null}return null}function defaultMessage(rule){switch(rule.type){case"required":return"Required";case"number":return"Must be a number";case"integer":return"Must be a whole number";case"min":return`Must be ≥ ${String(rule.value)}`;case"max":return`Must be ≤ ${String(rule.value)}`;case"range":return`Must be between ${String(rule.value)} and ${String(rule.value2)}`;case"minLength":return`Must be at least ${String(rule.value)} characters`;case"maxLength":return`Must be at most ${String(rule.value)} characters`;case"pattern":return"Invalid format";case"oneOf":return`Must be one of: ${(rule.values??[]).join(", ")}`;case"custom":return"Invalid value";default:return"Invalid value"}}function asLength(v){const n=asNumber(v);return n!==null&&Number.isInteger(n)&&n>=0?n:null}function invalidResult(rule,message){return{valid:false,ruleType:rule.type,message:message??rule.message??defaultMessage(rule)}}function rulePasses(rule,value,data){if(rule.type==="required")return!isBlank(value);if(isBlank(value))return true;switch(rule.type){case"number":return asNumber(value)!==null;case"integer":{const n=asNumber(value);return n!==null&&Number.isInteger(n)}case"min":{const n=asNumber(value);const b=asNumber(rule.value);return n!==null&&b!==null&&n>=b}case"max":{const n=asNumber(value);const b=asNumber(rule.value);return n!==null&&b!==null&&n<=b}case"range":{const n=asNumber(value);const lo=asNumber(rule.value);const hi=asNumber(rule.value2);if(n===null||lo===null||hi===null)return false;return n>=Math.min(lo,hi)&&n<=Math.max(lo,hi)}case"minLength":case"maxLength":{const length=asLength(rule.value);if(length===null)return false;return rule.type==="minLength"?String(value).length>=length:String(value).length<=length}case"pattern":{const src=typeof rule.pattern==="string"?rule.pattern:typeof rule.value==="string"?rule.value:null;if(src===null)return false;try{return new RegExp(src).test(String(value))}catch{return false}}case"oneOf":return Array.isArray(rule.values)&&rule.values.some(v=>v===value||String(v)===String(value));case"custom":if(typeof rule.validator!=="function")return false;try{return rule.validator(value,data)===true}catch{return false}default:return false}}function evaluateValidationRule(rule,ctx){if(rule===null||typeof rule!=="object")return VALID$1;if(rule.type==="custom"&&typeof rule.validator==="function"&&!isBlank(ctx.value)){let out;try{out=rule.validator(ctx.value,ctx.data)}catch{return invalidResult(rule)}if(out===true)return VALID$1;return invalidResult(rule,typeof out==="string"?out:void 0)}return rulePasses(rule,ctx.value,ctx.data)?VALID$1:invalidResult(rule)}function evaluateValidation(rules,ctx){if(!Array.isArray(rules)||rules.length===0)return VALID$1;for(const rule of rules){if(rule.field!==ctx.field)continue;const res=evaluateValidationRule(rule,ctx);if(!res.valid)return res}return VALID$1}const DEFAULT_MAX_SNAPSHOTS=20;function normalizeSnapshotCap(value){const floored=Number.isFinite(value)?Math.floor(value):0;return floored>0?floored:DEFAULT_MAX_SNAPSHOTS}function deepCloneRows(rows){if(typeof structuredClone==="function"){try{return structuredClone(rows)}catch{}}return structuralClone(rows)}function createSnapshot(rows,meta){return{id:meta.id,name:meta.name,ts:meta.ts,rows:deepCloneRows(rows)}}function snapshotMeta(snap){return{id:snap.id,name:snap.name,ts:snap.ts,rowCount:snap.rows.length}}function addSnapshot(list,snap,maxSnapshots){const next=[...list,snap];const cap=normalizeSnapshotCap(maxSnapshots);return next.length>cap?next.slice(next.length-cap):next}function removeSnapshot(list,id){return list.filter(s=>s.id!==id)}function getSnapshot(list,id){return list.find(s=>s.id===id)??null}function defaultRowId(row,index2){const r=row;if(r!==null&&typeof r==="object"&&"id"in r&&r.id!==void 0&&r.id!==null)return r.id;return`__index_${index2}`}function isValidRowId$2(value){return typeof value==="string"&&value.length>0||typeof value==="number"&&Number.isFinite(value)}function displayRowId(value){if(typeof value==="string")return JSON.stringify(value);return Object.is(value,-0)?"-0":String(value)}function indexRows(rows,side,getRowId){const rowsById=new Map;const firstIndexById=new Map;for(let index2=0;index2<rows.length;index2+=1){let id;try{id=getRowId(rows[index2],index2)}catch(cause){const error=new Error(`Snapshot diff ${side} row ${index2} id resolver threw.`);error.cause=cause;throw error}if(!isValidRowId$2(id)){throw new TypeError(`Snapshot diff ${side} row ${index2} has an invalid row id; expected a non-empty string or finite number.`)}if(rowsById.has(id)){throw new Error(`Snapshot diff ${side} rows ${firstIndexById.get(id)} and ${index2} share duplicate row id ${displayRowId(id)}.`)}rowsById.set(id,rows[index2]);firstIndexById.set(id,index2)}return rowsById}function fieldKeys(a,b){const keys=new Set;for(const k of Object.keys(a))keys.add(k);for(const k of Object.keys(b))keys.add(k);return[...keys]}function rowFieldChanges(before,after){const out=[];for(const field of fieldKeys(before,after)){if(!structuralEqual(before[field],after[field])){out.push({field,before:structuralClone(before[field]),after:structuralClone(after[field])})}}return out}function diffSnapshots(before,after,getRowId=defaultRowId){const beforeById=indexRows(before,"before",getRowId);const afterById=indexRows(after,"after",getRowId);const added=[];const removed=[];const changed=[];for(const[id,afterRow]of afterById){const beforeRow=beforeById.get(id);if(beforeRow===void 0){added.push(structuralClone(afterRow));continue}const fields=rowFieldChanges(beforeRow,afterRow);if(fields.length>0)changed.push({rowId:structuralClone(id),fields})}for(const[id,beforeRow]of beforeById){if(!afterById.has(id))removed.push(structuralClone(beforeRow))}return{added,removed,changed,summary:{added:added.length,removed:removed.length,changed:changed.length}}}const VALID=Object.freeze({valid:true});function rejected(input,reason,oldValue,value,validation=VALID,action="keep"){return{kind:"rejected",reason,action,previousRow:input.previousRow,oldValue,value,validation}}function planProspectiveEdit(input){const oldValue=readOwnFieldPath(input.previousRow,input.field);let value=input.rawDraft;if(input.parse!==void 0){try{value=input.parse(input.rawDraft,oldValue,structuralClone(input.previousRow))}catch{return rejected(input,"parser-threw",oldValue,input.rawDraft)}}let nextRow;if(input.set!==void 0){nextRow=structuralClone(input.previousRow);let accepted;try{accepted=input.set(nextRow,value,oldValue)}catch{return rejected(input,"setter-threw",oldValue,value)}if(accepted===false){return rejected(input,"setter-rejected",oldValue,value)}if(!structuralEqual(readOwnFieldPath(nextRow,input.field),value)){return rejected(input,"setter-did-not-apply",oldValue,value)}}else{nextRow=setOwnFieldPathImmutable(input.previousRow,input.field,value);if(nextRow===input.previousRow&&!structuralEqual(oldValue,value)){return rejected(input,"unsafe-field",oldValue,value)}}if(input.identity!==void 0){let beforeIdentity;let afterIdentity;try{beforeIdentity=input.identity(structuralClone(input.previousRow));afterIdentity=input.identity(structuralClone(nextRow))}catch{return rejected(input,"identity-threw",oldValue,value)}if(!Object.is(beforeIdentity,afterIdentity)){return rejected(input,"identity-changed",oldValue,value)}}let validation=VALID;if(input.validate!==void 0){try{validation=input.validate(value,structuralClone(nextRow))}catch{validation={valid:false,message:"Validation failed"}}}if(!validation.valid&&input.invalidMode!=="allow"){return rejected(input,"validation-failed",oldValue,value,validation,input.invalidMode==="revert"?"revert":"keep")}const base={previousRow:input.previousRow,nextRow,oldValue,value,validation};return structuralEqual(input.previousRow,nextRow)?{kind:"unchanged",...base}:{kind:"accepted",...base}}const AUDIT_CSV_COLUMNS=["seq","ts","kind","source","txId","rowId","field","oldValue","newValue","added","updated","removed","selectedCount","addedIds","removedIds","action","undoDepth","redoDepth"];function childPath(path,key){if(typeof key==="number")return`${path}[${key}]`;return/^[A-Za-z_$][\w$]*$/.test(key)?`${path}.${key}`:`${path}[${JSON.stringify(key)}]`}function normalizeAuditJsonValue(value){const ancestors=new Map;const normalize=(input,path)=>{if(input===null||typeof input==="string"||typeof input==="boolean")return input;if(typeof input==="number"){if(Number.isFinite(input))return input;return`[Number:${Number.isNaN(input)?"NaN":input>0?"Infinity":"-Infinity"}]`}if(typeof input==="bigint")return`[BigInt:${input.toString()}]`;if(typeof input==="undefined")return"[Undefined]";if(typeof input==="symbol")return`[Symbol:${input.description??""}]`;if(typeof input==="function")return`[Function:${input.name||"anonymous"}]`;if(typeof input!=="object")return"[Unsupported:Value]";const circularPath=ancestors.get(input);if(circularPath!==void 0)return`[Circular:${circularPath}]`;if(input instanceof Date)return Number.isNaN(input.getTime())?null:input.toISOString();if(input instanceof RegExp)return`[RegExp:${input.toString()}]`;ancestors.set(input,path);try{if(input instanceof ArrayBuffer){return{$type:"ArrayBuffer",bytes:Array.from(new Uint8Array(input))}}if(ArrayBuffer.isView(input)){return{$type:input.constructor.name,bytes:Array.from(new Uint8Array(input.buffer,input.byteOffset,input.byteLength))}}if(input instanceof Map){return{$type:"Map",entries:Array.from(input.entries(),([key,item],index2)=>[normalize(key,`${path}.entries[${index2}][0]`),normalize(item,`${path}.entries[${index2}][1]`)])}}if(input instanceof Set){return{$type:"Set",items:Array.from(input.values(),(item,index2)=>normalize(item,`${path}.items[${index2}]`))}}if(input instanceof Error){return{$type:input.name||"Error",message:input.message}}if(Array.isArray(input)){const out2=new Array(input.length);for(let i=0;i<input.length;i+=1){try{out2[i]=normalize(input[i],childPath(path,i))}catch{out2[i]="[Unserializable:ArrayItem]"}}return out2}const out=Object.create(null);let keys;try{keys=Object.keys(input)}catch{return"[Unserializable:Object]"}if(keys.length===0&&Object.getPrototypeOf(input)!==Object.prototype){return`[Unsupported:${input.constructor?.name??"Object"}]`}for(const key of keys){try{out[key]=normalize(input[key],childPath(path,key))}catch{out[key]="[Unserializable:Property]"}}return out}finally{ancestors.delete(input)}};return normalize(value,"$")}function cellString(value){if(value===null||value===void 0)return"";const normalized=normalizeAuditJsonValue(value);return typeof normalized==="object"&&normalized!==null?JSON.stringify(normalized):String(normalized)}function columnValue(entry,col){return entry[col]}function auditEntriesToCsv(entries,options={}){const delimiter=options.delimiter??",";const newline=options.newline??"\r\n";const lines=[];if(options.header!==false){lines.push(AUDIT_CSV_COLUMNS.map(c=>escapeCsvSpreadsheetCell(c,delimiter)).join(delimiter))}for(const entry of entries){const cells=AUDIT_CSV_COLUMNS.map(col=>escapeCsvSpreadsheetCell(cellString(columnValue(entry,col)),delimiter));lines.push(cells.join(delimiter))}return lines.join(newline)}function auditEntriesToJson(entries,pretty=false){return JSON.stringify(normalizeAuditJsonValue(entries),null,pretty?2:void 0)}const INT32_MIN=-2147483648;const INT32_MAX=2147483647;const INT32_MIN_BIG=-2147483648n;const INT32_MAX_BIG=2147483647n;const INTEGER_STRING_RE=/^[+-]?\d+$/;function isWithinInt32(value){if(typeof value==="bigint")return value>=INT32_MIN_BIG&&value<=INT32_MAX_BIG;return Number.isFinite(value)&&value>=INT32_MIN&&value<=INT32_MAX}function normalizeNumericInput(input){if(typeof input==="number"){if(!Number.isFinite(input))return null;if(Number.isInteger(input)&&!isWithinInt32(input))return BigInt(input);return input}if(typeof input==="bigint"){return isWithinInt32(input)?Number(input):input}if(typeof input==="string"){const trimmed=input.trim();if(trimmed.length===0)return null;if(INTEGER_STRING_RE.test(trimmed)){const big=BigInt(trimmed);return isWithinInt32(big)?Number(big):big}const parsed=Number(trimmed);if(!Number.isFinite(parsed))return null;if(Number.isInteger(parsed)&&!isWithinInt32(parsed))return BigInt(parsed);return parsed}return null}function toPublicNumeric(value){if(typeof value==="bigint"){return isWithinInt32(value)?Number(value):value}if(Number.isInteger(value)&&!isWithinInt32(value))return BigInt(value);return value}const EMPTY_META=Object.freeze({});function freezePipelineState(state){Object.freeze(state.source);Object.freeze(state.rows);Object.freeze(state.meta);return Object.freeze(state)}function runPipeline(source,stages){const initialRows=[...source];let state=freezePipelineState({source:initialRows,rows:initialRows,stage:"source",meta:EMPTY_META});for(const stage of stages){const next=stage.run(state);const normalised=next.source===initialRows?next:{...next,source:initialRows};state=freezePipelineState(normalised)}return state}function createFilterStage(input){const filters=input.filters;const filterIds=Object.freeze(filters.map(f=>f.id));const filterCount=filters.length;const predicates=filters.map(f=>f.predicate);return{name:"filtered",run(state){const sliced=state.rows.slice();let outRows;if(filterCount===0){outRows=sliced}else{outRows=[];for(let i=0;i<sliced.length;i++){const row=sliced[i];let passes=true;for(let j=0;j<predicates.length;j++){if(!predicates[j](row)){passes=false;break}}if(passes)outRows.push(row)}}return{source:state.source,rows:outRows,stage:"filtered",meta:{...state.meta,filterCount,filterIds}}}}}function createMultiSortStage(specs){const keys=specs.map(spec=>({field:spec.field,direction:spec.direction,sign:spec.direction==="desc"?-1:1,compare:spec.comparator??compareDefault,getValue:spec.valueGetter??(row=>readOwnFieldPath(row,spec.field))}));const sortModel=keys.map(key=>({field:key.field,direction:key.direction}));return{name:"sorted",run(state){const sorted=state.rows.slice();if(keys.length>0){sorted.sort((a,b)=>{for(let k=0;k<keys.length;k++){const key=keys[k];const va=key.getValue(a);const vb=key.getValue(b);const aNullish=isNullish$2(va);const bNullish=isNullish$2(vb);if(aNullish&&bNullish)continue;if(aNullish)return 1;if(bNullish)return-1;const cmp=key.sign*key.compare(va,vb);if(cmp!==0)return cmp}return 0})}return{source:state.source,rows:sorted,stage:"sorted",meta:{...state.meta,sortModel}}}}}function isNullish$2(value){if(value===null||value===void 0)return true;if(typeof value==="number"&&Number.isNaN(value))return true;if(value instanceof Date&&Number.isNaN(value.getTime()))return true;return false}function compareDefault(a,b){const aNullish=isNullish$2(a);const bNullish=isNullish$2(b);if(aNullish&&bNullish)return 0;if(aNullish)return 1;if(bNullish)return-1;const ta=typeof a;const tb=typeof b;if((ta==="number"||ta==="bigint")&&(tb==="number"||tb==="bigint")){const na=a;const nb=b;if(na<nb)return-1;if(na>nb)return 1;return 0}if(ta!==tb)return ta<tb?-1:1;switch(ta){case"number":return comparePrimitive$1(a,b);case"string":{const sa=a;const sb=b;if(sa<sb)return-1;if(sa>sb)return 1;return 0}case"boolean":return a===b?0:a?1:-1;case"object":{if(a instanceof Date&&b instanceof Date){return comparePrimitive$1(a.getTime(),b.getTime())}return 0}default:return 0}}function comparePrimitive$1(a,b){if(a<b)return-1;if(a>b)return 1;return 0}function createPaginateStage(spec){const pageSize=spec.pageSize;if(typeof pageSize!=="number"||!Number.isFinite(pageSize)||!Number.isInteger(pageSize)||pageSize<1){throw new RangeError("pageSize must be a positive integer")}const requestedPageIndex=spec.pageIndex;return{name:"paginated",run(state){const totalRows=state.rows.length;const pageCount=Math.max(1,Math.ceil(totalRows/pageSize));let clampedPageIndex=requestedPageIndex;if(typeof clampedPageIndex!=="number"||!Number.isFinite(clampedPageIndex)){console.warn("pageIndex must be a finite number, defaulting to 0");clampedPageIndex=0}else if(!Number.isInteger(clampedPageIndex)){const floored=Math.floor(clampedPageIndex);console.warn(`pageIndex must be an integer, flooring ${clampedPageIndex} to ${floored}`);clampedPageIndex=floored}if(clampedPageIndex<0){console.warn("pageIndex must be ≥ 0, clamped to 0");clampedPageIndex=0}else if(clampedPageIndex>=pageCount){clampedPageIndex=pageCount-1}const start=clampedPageIndex*pageSize;const end=start+pageSize;const sliced=state.rows.slice(start,end);const pagination={totalRows,pageCount,pageIndex:clampedPageIndex,pageSize};return{source:state.source,rows:sliced,stage:"paginated",meta:{...state.meta,pagination}}}}}function defaultComparator(a,b){const aNullish=isNullish$1(a);const bNullish=isNullish$1(b);if(aNullish&&bNullish)return 0;if(aNullish)return 1;if(bNullish)return-1;const ta=typeof a;const tb=typeof b;if((ta==="number"||ta==="bigint")&&(tb==="number"||tb==="bigint")){const na=a;const nb=b;if(na<nb)return-1;if(na>nb)return 1;return 0}if(ta!==tb){return ta<tb?-1:1}switch(ta){case"number":return comparePrimitive(a,b);case"string":{const sa=a;const sb=b;if(sa<sb)return-1;if(sa>sb)return 1;return 0}case"boolean":return a===b?0:a?1:-1;case"object":{if(a instanceof Date&&b instanceof Date){return comparePrimitive(a.getTime(),b.getTime())}return 0}default:return 0}}function isNullish$1(value){if(value===null||value===void 0)return true;if(typeof value==="number"&&Number.isNaN(value))return true;if(value instanceof Date&&Number.isNaN(value.getTime()))return true;return false}function comparePrimitive(a,b){if(a<b)return-1;if(a>b)return 1;return 0}function sameEngineRowsInputs(a,b){if(a===b)return true;const aKeys=Object.keys(a);const bKeys=Object.keys(b);if(aKeys.length!==bKeys.length)return false;for(const key of aKeys){if(!Object.prototype.hasOwnProperty.call(b,key))return false;if(a[key]!==b[key]){return false}}return true}function resolveEngineRows(prev,inputs,skipPaginate,compute){const reuse=prev!==null&&sameEngineRowsInputs(prev.inputs,inputs);const state=reuse?prev:{inputs};const cached=skipPaginate?state.skipPaginated:state.paginated;if(cached!==void 0)return{state,rows:cached};const rows=compute();if(skipPaginate)state.skipPaginated=rows;else state.paginated=rows;return{state,rows}}const BLANK_GROUP_KEY=" __sy_blank__";function isGroupMarkerRow(row){return row!==null&&typeof row==="object"&&row.__syGroupRow===true}function isAggregatedGroupMarkerRow(row){return row!==null&&typeof row==="object"&&row.__syGroupRow===true&&typeof row.aggregates==="object"&&row.aggregates!==null}function isGroupFooterRow(row){return row!==null&&typeof row==="object"&&row.__syGroupFooter===true}function foldGroupKey(raw){if(raw===null||raw===void 0)return null;if(typeof raw==="number"&&Number.isNaN(raw))return null;if(raw instanceof Date){const ms=raw.getTime();return Number.isNaN(ms)?null:raw.toISOString()}return String(raw)}function isTreeNodeRow(row){return row!==null&&typeof row==="object"&&row.__syTreeRow===true}const TREE_PATH_KEY_SEPARATOR="";function foldTreePathKey(path){return path.join(TREE_PATH_KEY_SEPARATOR)}function isDetailRow(row){return row!==null&&typeof row==="object"&&row.__syDetailRow===true}function isPivotRowGroupMarker(row){return typeof row==="object"&&row!==null&&row.__syPivotRow===true}function isPivotGrandTotalRow(row){return typeof row==="object"&&row!==null&&row.__syPivotGrandTotal===true}function frameSegmentPath(segments){const separator=String.fromCharCode(31);let out="";for(const segment of segments)out+=`${segment.length}${separator}${segment}`;return out}const PIVOT_ROW_HEADER_COL_ID="__sy_pivot_rowheader__";function isPivotColumnId(field){return typeof field==="string"&&field.startsWith("__sy_pivot__")}const DEFAULT_BLOCK_SIZE=100;function blockNumberForRow(rowIndex,blockSize){return Math.floor(rowIndex/blockSize)}function blockBounds(blockNumber,blockSize){const startRow=blockNumber*blockSize;return{startRow,endRow:startRow+blockSize}}function clampBlockSize(size){if(typeof size==="number"&&Number.isInteger(size)&&size>=1)return size;return DEFAULT_BLOCK_SIZE}function clampMaxBlocks(max){if(max===null||max===void 0)return null;if(Number.isInteger(max)&&max>=1)return max;return null}function createInfiniteCache(config){return{blocks:{},blockSize:clampBlockSize(config?.blockSize),maxBlocks:clampMaxBlocks(config?.maxBlocks),rowCount:0,lastRowKnown:false,accessSeq:0}}function virtualRowCount(state){if(state.lastRowKnown)return state.rowCount;return Math.max(state.rowCount+1,1)}function blocksForRange(startRow,endRow,blockSize){const out=[];if(endRow<=startRow)return out;const first=blockNumberForRow(Math.max(0,startRow),blockSize);const last=blockNumberForRow(Math.max(0,endRow-1),blockSize);for(let b=first;b<=last;b++)out.push(b);return out}function lookupRow(state,rowIndex){if(rowIndex<0)return{status:"missing"};const block=state.blocks[blockNumberForRow(rowIndex,state.blockSize)];if(block===void 0)return{status:"missing"};if(block.status==="loading")return{status:"loading"};if(block.status==="failed")return{status:"failed"};const rows=block.rows;if(rows===null)return{status:"missing"};const offset=rowIndex-block.blockNumber*state.blockSize;if(offset<0||offset>=rows.length)return{status:"missing"};return{status:"loaded",row:rows[offset]}}function blocksToLoadForRange(state,startRow,endRow,includeFailed=false){return blocksForRange(startRow,endRow,state.blockSize).filter(b=>{const block=state.blocks[b];if(block===void 0)return true;if(block.status==="failed")return includeFailed;return false})}function markBlockLoading(state,blockNumber){const existing=state.blocks[blockNumber];if(existing!==void 0&&existing.status==="loading")return state;const accessSeq=state.accessSeq+1;return{...state,accessSeq,blocks:{...state.blocks,[blockNumber]:{blockNumber,status:"loading",rows:null,lastAccess:accessSeq}}}}function applyBlockSuccess(state,blockNumber,rows,lastRow=null){const accessSeq=state.accessSeq+1;const blockEnd=blockNumber*state.blockSize+rows.length;let rowCount=state.rowCount;let lastRowKnown=state.lastRowKnown;if(typeof lastRow==="number"&&lastRow>=0){rowCount=lastRow;lastRowKnown=true}else if(rows.length<state.blockSize){rowCount=blockEnd;lastRowKnown=true}else if(!state.lastRowKnown){rowCount=Math.max(state.rowCount,blockEnd)}const next={...state,accessSeq,rowCount,lastRowKnown,blocks:{...state.blocks,[blockNumber]:{blockNumber,status:"loaded",rows,lastAccess:accessSeq}}};return evictOverflow(next)}function applyBlockFailure(state,blockNumber){const existing=state.blocks[blockNumber];if(existing!==void 0&&existing.status==="failed")return state;const accessSeq=state.accessSeq+1;return{...state,accessSeq,blocks:{...state.blocks,[blockNumber]:{blockNumber,status:"failed",rows:null,lastAccess:accessSeq}}}}function touchRange(state,startRow,endRow){const nums=blocksForRange(startRow,endRow,state.blockSize).filter(b=>state.blocks[b]!==void 0);if(nums.length===0)return state;let accessSeq=state.accessSeq;const blocks={...state.blocks};for(const b of nums){accessSeq+=1;blocks[b]={...blocks[b],lastAccess:accessSeq}}return{...state,accessSeq,blocks}}function evictOverflow(state){if(state.maxBlocks===null)return state;const loaded=Object.values(state.blocks).filter(b=>b.status==="loaded");const overflow=loaded.length-state.maxBlocks;if(overflow<=0)return state;const victims=loaded.slice().sort((a,b)=>a.lastAccess-b.lastAccess).slice(0,overflow);const blocks={...state.blocks};for(const v of victims)delete blocks[v.blockNumber];return{...state,blocks}}function makeLoadingPlaceholderRow(rowIndex,status){return{__syLoadingRow:true,rowIndex,status}}function isLoadingPlaceholderRow(row){return typeof row==="object"&&row!==null&&row.__syLoadingRow===true}function materializeInfiniteRows(cache){const count=virtualRowCount(cache);const out=new Array(count);for(let i=0;i<count;i++){const hit=lookupRow(cache,i);out[i]=hit.status==="loaded"?hit.row:makeLoadingPlaceholderRow(i,hit.status)}return out}function beginRowDrag(sourceIndex){return{sourceIndex,overIndex:sourceIndex,position:"below"}}function updateRowDragOver(state,overIndex,position){if(state.overIndex===overIndex&&state.position===position)return state;return{sourceIndex:state.sourceIndex,overIndex,position}}function computeInsertionIndex(overIndex,position){if(overIndex===null)return null;return position==="above"?overIndex:overIndex+1}function dropInsertionIndex(state){return computeInsertionIndex(state.overIndex,state.position)}function isNoopDrop(sourceIndex,insertionIndex){if(insertionIndex===null)return true;return insertionIndex===sourceIndex||insertionIndex===sourceIndex+1}function reorderRows(rows,sourceIndex,insertionIndex){if(!Number.isInteger(sourceIndex)||sourceIndex<0||sourceIndex>=rows.length){return rows}if(insertionIndex===null)return rows;const insert=insertionIndex<0?0:insertionIndex>rows.length?rows.length:insertionIndex;if(isNoopDrop(sourceIndex,insert))return rows;const next=rows.slice();const[moved]=next.splice(sourceIndex,1);const adjusted=insert>sourceIndex?insert-1:insert;next.splice(adjusted,0,moved);return next}function cellFlashKey(rowIndex,field){return`${rowIndex}::${field}`}function addFlash(set,key){if(set.has(key))return set;const next=new Set(set);next.add(key);return next}function removeFlash(set,key){if(!set.has(key))return set;const next=new Set(set);next.delete(key);return next}function hasFlash(set,key){return set.has(key)}const DEFAULT_OVERSCAN=3;const EMPTY_RESULT=Object.freeze({startIndex:0,endIndex:0,paddingTop:0,paddingBottom:0,totalHeight:0,visibleCount:0});function safeNonNegativeInt(value,fallback=0){if(typeof value!=="number")return fallback;if(!Number.isFinite(value))return fallback;if(value<=0)return fallback===0?0:Math.max(0,Math.floor(fallback));return Math.floor(value)}function safeNonNegativeFloat(value,fallback=0){if(typeof value!=="number"||!Number.isFinite(value))return fallback;if(value<=0)return 0;return value}function computeVirtualWindow(options){const{rowHeight}=options;if(typeof rowHeight!=="number"||!Number.isFinite(rowHeight)||rowHeight<=0){throw new RangeError(`[Syidax] computeVirtualWindow: rowHeight must be a finite positive number, got ${rowHeight}.`)}const totalRows=safeNonNegativeInt(options.totalRows);if(totalRows===0)return EMPTY_RESULT;const viewportHeight=safeNonNegativeFloat(options.viewportHeight);const totalHeight=totalRows*rowHeight;if(viewportHeight===0){return{startIndex:0,endIndex:0,paddingTop:0,paddingBottom:totalHeight,totalHeight,visibleCount:0}}const overscan=safeNonNegativeInt(options.overscan??DEFAULT_OVERSCAN);const maxScrollTop=Math.max(0,totalHeight-viewportHeight);const rawScrollTop=safeNonNegativeFloat(options.scrollTop);const scrollTop=Math.min(rawScrollTop,maxScrollTop);const firstVisible=Math.floor(scrollTop/rowHeight);const lastVisible=Math.ceil((scrollTop+viewportHeight)/rowHeight);const startIndex=Math.max(0,firstVisible-overscan);const endIndex=Math.min(totalRows,lastVisible+overscan);const paddingTop=startIndex*rowHeight;const paddingBottom=(totalRows-endIndex)*rowHeight;const visibleCount=Math.max(0,endIndex-startIndex);return{startIndex,endIndex,paddingTop,paddingBottom,totalHeight,visibleCount}}function attachVirtualScroll(container,options,onChange){if(!container||typeof container.addEventListener!=="function"){throw new TypeError("[Syidax] attachVirtualScroll: container must be an element with addEventListener.")}if(typeof onChange!=="function"){throw new TypeError("[Syidax] attachVirtualScroll: onChange must be a function.")}const raf=typeof requestAnimationFrame==="function"?cb=>requestAnimationFrame(cb):cb=>setTimeout(cb,16);const cancelRaf=typeof cancelAnimationFrame==="function"?handle=>cancelAnimationFrame(handle):handle=>clearTimeout(handle);let pending=null;let detached=false;const fire=()=>{if(detached)return;let result;try{result=computeVirtualWindow({...options,scrollTop:typeof container.scrollTop==="number"?container.scrollTop:0})}catch(err){console.error("[Syidax] attachVirtualScroll: compute failed:",err);return}try{onChange(result)}catch(err){console.error("[Syidax] attachVirtualScroll: onChange handler threw:",err)}};const handler=()=>{if(detached)return;if(pending!==null)return;pending=raf(()=>{pending=null;fire()})};container.addEventListener("scroll",handler,{passive:true});fire();return()=>{if(detached)return;detached=true;container.removeEventListener("scroll",handler);if(pending!==null){cancelRaf(pending);pending=null}}}const DEFAULT_ESTIMATED_ROW_HEIGHT=30;const EMPTY_VARIABLE_RESULT=Object.freeze({startIndex:0,endIndex:0,paddingTop:0,paddingBottom:0,totalHeight:0,visibleCount:0});function safeHeight(raw,estimated){if(typeof raw!=="number")return estimated;if(!Number.isFinite(raw))return estimated;if(raw<=0)return estimated;return raw}function binarySearchRowAtOffset(target,totalRows,getOffset){if(totalRows<=0)return 0;if(target<=0)return 0;let lo=0;let hi=totalRows;while(lo<hi){const mid=lo+hi>>>1;const offset=getOffset(mid);if(offset<=target){lo=mid+1}else{hi=mid}}return Math.max(0,lo-1)}function binarySearchFirstRowBelowOffset(target,totalRows,getOffset){if(totalRows<=0)return 0;if(target<=0)return 0;let lo=0;let hi=totalRows;while(lo<hi){const mid=lo+hi>>>1;const offset=getOffset(mid);if(offset<target){lo=mid+1}else{hi=mid}}return lo}function computeVariableVirtualWindow(options){if(typeof options.rowHeight!=="function"){throw new TypeError("[Syidax] computeVariableVirtualWindow: rowHeight must be a function (index) => number.")}const totalRows=safeNonNegativeInt(options.totalRows);if(totalRows===0)return EMPTY_VARIABLE_RESULT;const estimatedRaw=options.estimatedRowHeight;const estimated=typeof estimatedRaw==="number"&&Number.isFinite(estimatedRaw)&&estimatedRaw>0?estimatedRaw:DEFAULT_ESTIMATED_ROW_HEIGHT;const offsets=new Float64Array(totalRows+1);let acc=0;for(let i=0;i<totalRows;i++){const h=safeHeight(options.rowHeight(i),estimated);offsets[i]=acc;acc+=h}offsets[totalRows]=acc;const totalHeight=acc;const viewportHeight=safeNonNegativeFloat(options.viewportHeight);if(viewportHeight===0){return{startIndex:0,endIndex:0,paddingTop:0,paddingBottom:totalHeight,totalHeight,visibleCount:0}}const overscan=safeNonNegativeInt(options.overscan??DEFAULT_OVERSCAN);const maxScrollTop=Math.max(0,totalHeight-viewportHeight);const rawScrollTop=safeNonNegativeFloat(options.scrollTop);const scrollTop=Math.min(rawScrollTop,maxScrollTop);const getOffset=i=>offsets[i];const firstVisible=binarySearchRowAtOffset(scrollTop,totalRows,getOffset);const bottomTarget=scrollTop+viewportHeight;const lastVisible=binarySearchFirstRowBelowOffset(bottomTarget,totalRows,getOffset);const startIndex=Math.max(0,firstVisible-overscan);const endIndex=Math.min(totalRows,lastVisible+overscan);const paddingTop=offsets[startIndex];const paddingBottom=totalHeight-offsets[endIndex];const visibleCount=Math.max(0,endIndex-startIndex);return{startIndex,endIndex,paddingTop,paddingBottom,totalHeight,visibleCount}}function createRowHeightCache(estimatedRowHeight=DEFAULT_ESTIMATED_ROW_HEIGHT){const estimated=typeof estimatedRowHeight==="number"&&Number.isFinite(estimatedRowHeight)&&estimatedRowHeight>0?estimatedRowHeight:DEFAULT_ESTIMATED_ROW_HEIGHT;const heights=new Map;const offsetCache=new Map;let highWater=0;offsetCache.set(0,0);const getHeight=index2=>{if(typeof index2!=="number"||!Number.isFinite(index2)||index2<0){return estimated}const i=Math.floor(index2);const measured=heights.get(i);if(measured===void 0)return estimated;return measured};const setHeight=(index2,px)=>{if(typeof index2!=="number"||!Number.isFinite(index2)||index2<0)return;const i=Math.floor(index2);const safe=safeHeight(px,estimated);const prev=heights.get(i);if(prev===safe)return;heights.set(i,safe);if(highWater>i){for(let k=i+1;k<=highWater;k++){offsetCache.delete(k)}highWater=i}};const reset=()=>{heights.clear();offsetCache.clear();offsetCache.set(0,0);highWater=0};const getOffset=index2=>{if(typeof index2!=="number"||!Number.isFinite(index2)||index2<=0){return 0}const target=Math.floor(index2);const cached=offsetCache.get(target);if(cached!==void 0)return cached;let acc=offsetCache.get(highWater)??0;for(let i=highWater;i<target;i++){acc+=getHeight(i);offsetCache.set(i+1,acc)}if(target>highWater)highWater=target;return acc};const getTotalHeight=totalRows=>{const n=safeNonNegativeInt(totalRows);return getOffset(n)};const findRowAtOffset=(y,totalRows)=>{const n=safeNonNegativeInt(totalRows);if(n===0)return 0;if(typeof y!=="number"||!Number.isFinite(y)||y<=0)return 0;getOffset(n);const row=binarySearchRowAtOffset(y,n,i=>offsetCache.get(i)??getOffset(i));return Math.min(n-1,row)};return{getHeight,setHeight,reset,getOffset,getTotalHeight,findRowAtOffset}}function computeCachedVariableWindow(cache,options){const totalRows=safeNonNegativeInt(options.totalRows);if(totalRows===0)return EMPTY_VARIABLE_RESULT;const totalHeight=cache.getTotalHeight(totalRows);const viewportHeight=safeNonNegativeFloat(options.viewportHeight);if(viewportHeight===0){return{startIndex:0,endIndex:0,paddingTop:0,paddingBottom:totalHeight,totalHeight,visibleCount:0}}const overscan=safeNonNegativeInt(options.overscan??DEFAULT_OVERSCAN);const maxScrollTop=Math.max(0,totalHeight-viewportHeight);const rawScrollTop=safeNonNegativeFloat(options.scrollTop);const scrollTop=Math.min(rawScrollTop,maxScrollTop);const firstVisible=cache.findRowAtOffset(scrollTop,totalRows);const bottomTarget=scrollTop+viewportHeight;const rowAtBottom=cache.findRowAtOffset(bottomTarget,totalRows);const lastVisible=cache.getOffset(rowAtBottom)>=bottomTarget?rowAtBottom:rowAtBottom+1;const startIndex=Math.max(0,firstVisible-overscan);const endIndex=Math.min(totalRows,lastVisible+overscan);const paddingTop=cache.getOffset(startIndex);const paddingBottom=Math.max(0,totalHeight-cache.getOffset(endIndex));const visibleCount=Math.max(0,endIndex-startIndex);return{startIndex,endIndex,paddingTop,paddingBottom,totalHeight,visibleCount}}function nextSortDirection(current){if(current===null)return"asc";if(current==="asc")return"desc";return null}function cycleActiveSort(prev,field){if(!prev||prev.field!==field){return{field,direction:"asc"}}const nextDir=nextSortDirection(prev.direction);if(nextDir===null)return null;return{field,direction:nextDir}}function pickInitialActiveSort(columns){for(const col of columns){if(!col||typeof col.field!=="string"||!col.field)continue;if(col.sortable===false)continue;if(col.sort==="asc"||col.sort==="desc"){return{field:col.field,direction:col.sort}}}return null}function cycleSortModel(prev,field,mode){const existing=prev.find(entry=>entry.field===field)??null;if(mode==="replace"){const next=cycleActiveSort(existing?{field:existing.field,direction:existing.direction}:null,field);return next===null?[]:[{field:next.field,direction:next.direction}]}if(existing===null){return[...prev,{field,direction:"asc"}]}const nextDirection=nextSortDirection(existing.direction);if(nextDirection===null){return prev.filter(entry=>entry.field!==field)}return prev.map(entry=>entry.field===field?{field,direction:nextDirection}:entry)}function seedInitialSortModel(columns,opts){if(!opts.multi){const single=pickInitialActiveSort(columns);return single===null?[]:[{field:single.field,direction:single.direction}]}const seeds=[];const seen=new Set;for(let position=0;position<columns.length;position++){const col=columns[position];if(!col||typeof col.field!=="string"||!col.field)continue;if(col.sortable===false)continue;if(col.sort!=="asc"&&col.sort!=="desc")continue;if(seen.has(col.field))continue;seen.add(col.field);seeds.push({entry:{field:col.field,direction:col.sort},sortIndex:typeof col.sortIndex==="number"&&Number.isFinite(col.sortIndex)?col.sortIndex:Number.POSITIVE_INFINITY,position})}seeds.sort((a,b)=>a.sortIndex-b.sortIndex||a.position-b.position);return seeds.map(seed=>seed.entry)}function sortModelsEqual(a,b){if(a.length!==b.length)return false;for(let i=0;i<a.length;i++){if(a[i].field!==b[i].field||a[i].direction!==b[i].direction)return false}return true}function normalizeSortModel(model){if(!Array.isArray(model))return[];const out=[];const seen=new Set;for(const raw of model){if(!raw||typeof raw!=="object")continue;const field=raw.field;const direction=raw.direction;if(typeof field!=="string"||field==="")continue;if(direction!=="asc"&&direction!=="desc")continue;if(seen.has(field))continue;seen.add(field);out.push({field,direction})}return out}function setActiveFilter(map,filter){return{...map,[filter.field]:filter}}function clearActiveFilter(map,field){if(!(field in map))return{...map};const{[field]:_drop,...rest}=map;return rest}function withFilterTarget(spec,field,valueGetter){return{...spec,field,...valueGetter?{valueGetter}:{}}}function retargetMultiPart(part,field,valueGetter){switch(part.kind){case"text":return{kind:"text",spec:withFilterTarget(part.spec,field,valueGetter)};case"number":return{kind:"number",spec:withFilterTarget(part.spec,field,valueGetter)};case"date":return{kind:"date",spec:withFilterTarget(part.spec,field,valueGetter)};case"set":return{kind:"set",spec:withFilterTarget(part.spec,field,valueGetter)};default:{return part}}}function retargetActiveFilter(filter,field,valueGetter){switch(filter.kind){case"text":return{kind:"text",field,spec:withFilterTarget(filter.spec,field,valueGetter)};case"number":return{kind:"number",field,spec:withFilterTarget(filter.spec,field,valueGetter)};case"date":return{kind:"date",field,spec:withFilterTarget(filter.spec,field,valueGetter)};case"set":return{kind:"set",field,spec:withFilterTarget(filter.spec,field,valueGetter)};case"multi":return{kind:"multi",field,spec:{...filter.spec,field,parts:filter.spec.parts.map(part=>retargetMultiPart(part,field,valueGetter))}};default:{return filter}}}const DEFAULT_PAGE_SIZE=25;const DEFAULT_PAGE_SIZE_OPTIONS=[10,25,50,100];function resolvePageCount(meta){if(!meta)return 1;if(!Number.isFinite(meta.pageCount))return 1;return Math.max(1,Math.floor(meta.pageCount))}function goToPage(active,pageIndex,meta){let next=pageIndex;if(typeof next!=="number"||!Number.isFinite(next))next=0;if(!Number.isInteger(next))next=Math.floor(next);const pageCount=resolvePageCount(meta);if(next<0)next=0;if(next>pageCount-1)next=pageCount-1;if(next===active.pageIndex)return active;return{pageIndex:next,pageSize:active.pageSize}}function nextPage(active,meta){const pageCount=resolvePageCount(meta);if(active.pageIndex>=pageCount-1)return active;return{pageIndex:active.pageIndex+1,pageSize:active.pageSize}}function prevPage(active,meta){if(active.pageIndex<=0)return active;return{pageIndex:active.pageIndex-1,pageSize:active.pageSize}}function changePageSize(active,pageSize,meta){if(typeof pageSize!=="number"||!Number.isFinite(pageSize)||!Number.isInteger(pageSize)||pageSize<1){throw new RangeError("pageSize must be a positive integer")}if(pageSize===active.pageSize)return active;const firstVisibleRow=active.pageIndex*active.pageSize;const totalRows=meta?meta.totalRows:null;let nextPageIndex=Math.floor(firstVisibleRow/pageSize);if(totalRows!=null){const newPageCount=Math.max(1,Math.ceil(totalRows/pageSize));if(nextPageIndex>newPageCount-1)nextPageIndex=newPageCount-1}if(nextPageIndex<0)nextPageIndex=0;return{pageIndex:nextPageIndex,pageSize}}function visiblePageNumbers(pageIndex,pageCount,options){const siblingCount=toNonNegativeInteger(options?.siblingCount,1);const boundaryCount=toNonNegativeInteger(options?.boundaryCount,1);pageCount=toNonNegativeInteger(pageCount,0);if(pageCount<=0)return[];const requestedPage=Number.isFinite(pageIndex)?Math.floor(pageIndex)+1:1;const current=Math.min(Math.max(requestedPage,1),pageCount);const totalSlots=boundaryCount*2+siblingCount*2+3;if(pageCount<=totalSlots){const all=[];for(let i=1;i<=pageCount;i++)all.push(i);return all}const startBoundary=[];for(let i=1;i<=Math.min(boundaryCount,pageCount);i++){startBoundary.push(i)}const endBoundary=[];for(let i=Math.max(pageCount-boundaryCount+1,1);i<=pageCount;i++){endBoundary.push(i)}const siblingsStart=Math.max(Math.min(current-siblingCount,pageCount-boundaryCount-siblingCount*2-1),boundaryCount+2);const siblingsEnd=Math.min(Math.max(current+siblingCount,boundaryCount+siblingCount*2+2),pageCount-boundaryCount-1);const items=[...startBoundary];if(siblingsStart>boundaryCount+2){items.push("ellipsis")}else if(boundaryCount+1<pageCount-boundaryCount){items.push(boundaryCount+1)}for(let i=siblingsStart;i<=siblingsEnd;i++){items.push(i)}if(siblingsEnd<pageCount-boundaryCount-1){items.push("ellipsis")}else if(pageCount-boundaryCount>boundaryCount){items.push(pageCount-boundaryCount)}items.push(...endBoundary);return items}function toNonNegativeInteger(value,fallback){if(value===void 0||!Number.isFinite(value))return fallback;return Math.max(0,Math.floor(value))}function createTextFilter(spec){const{field,op,value,caseSensitive=false,trim=false,valueGetter}=spec;const getValue=valueGetter?valueGetter:row=>readOwnFieldPath(row,field);const normalizedFilter=normalizeString(value,trim,caseSensitive);const filterIsEmpty=normalizedFilter==="";return row=>{if(filterIsEmpty){if(op==="contains"||op==="startsWith"||op==="endsWith")return true;if(op==="notContains")return false}const raw=getValue(row);if(isNullish(raw)){return op==="equals"&&filterIsEmpty}const rowValue=normalizeRowValue(raw,trim,caseSensitive);switch(op){case"contains":return filterIsEmpty||rowValue.includes(normalizedFilter);case"notContains":return!(filterIsEmpty||rowValue.includes(normalizedFilter));case"equals":return rowValue===normalizedFilter;case"notEqual":return rowValue!==normalizedFilter;case"startsWith":return filterIsEmpty||rowValue.startsWith(normalizedFilter);case"endsWith":return filterIsEmpty||rowValue.endsWith(normalizedFilter);default:{return false}}}}function normalizeRowValue(raw,trim,caseSensitive){let asString;if(typeof raw==="string"){asString=raw}else if(raw instanceof Date){asString=raw.toISOString()}else{asString=String(raw)}return normalizeString(asString,trim,caseSensitive)}function normalizeString(input,trim,caseSensitive){let out=input;if(trim)out=out.trim();if(!caseSensitive)out=out.toLowerCase();return out}function isNullish(value){if(value===null||value===void 0)return true;if(typeof value==="number"&&Number.isNaN(value))return true;if(value instanceof Date&&Number.isNaN(value.getTime()))return true;return false}function createNumberFilter(spec){const{field,op,value,valueGetter}=spec;const getValue=valueGetter?valueGetter:row=>readOwnFieldPath(row,field);const isRangeOp=op==="between"||op==="notBetween";let singleFilter=Number.NaN;let loFilter=Number.NEGATIVE_INFINITY;let hiFilter=Number.POSITIVE_INFINITY;let rangeIsEmpty=false;if(isRangeOp){if(Array.isArray(value)&&value.length===2){const[lo,hi]=value;loFilter=isNullishNumber(lo)?Number.NEGATIVE_INFINITY:lo;hiFilter=isNullishNumber(hi)?Number.POSITIVE_INFINITY:hi;rangeIsEmpty=loFilter>hiFilter}else{loFilter=Number.NEGATIVE_INFINITY;hiFilter=Number.POSITIVE_INFINITY}}else{singleFilter=typeof value==="number"||typeof value==="bigint"?value:Number.NaN}const singleFilterIsEmpty=!isRangeOp&&typeof singleFilter==="number"&&Number.isNaN(singleFilter);const rangeFilterIsEmpty=isRangeOp&&loFilter===Number.NEGATIVE_INFINITY&&hiFilter===Number.POSITIVE_INFINITY;return row=>{if(singleFilterIsEmpty){if(op==="equals"||op==="gt"||op==="gte"||op==="lt"||op==="lte"){return true}if(op==="notEqual")return false}if(rangeFilterIsEmpty){if(op==="between")return true;if(op==="notBetween")return false}const raw=getValue(row);const rowNumber=coerceToNumber(raw);if(rowNumber===null){return false}switch(op){case"equals":return sameNumeric(rowNumber,singleFilter);case"notEqual":return!sameNumeric(rowNumber,singleFilter);case"gt":return rowNumber>singleFilter;case"gte":return rowNumber>=singleFilter;case"lt":return rowNumber<singleFilter;case"lte":return rowNumber<=singleFilter;case"between":if(rangeIsEmpty)return false;return rowNumber>=loFilter&&rowNumber<=hiFilter;case"notBetween":if(rangeIsEmpty)return true;return rowNumber<loFilter||rowNumber>hiFilter;default:{return false}}}}function coerceToNumber(raw){if(typeof raw==="number"){return Number.isNaN(raw)?null:raw}if(typeof raw==="bigint"){return raw}if(typeof raw==="string"){const trimmed=raw.trim();if(trimmed==="")return null;if(/^[+-]?\d+$/.test(trimmed)){const big=BigInt(trimmed);return big>=-2147483648n&&big<=2147483647n?Number(big):big}const parsed=Number(trimmed);return Number.isNaN(parsed)?null:parsed}if(typeof raw==="boolean"){return raw?1:0}if(raw instanceof Date){const ms=raw.getTime();return Number.isNaN(ms)?null:ms}return null}function sameNumeric(a,b){if(typeof a==="number"&&typeof b==="number")return a===b;return!(a<b)&&!(a>b)}function isNullishNumber(n){if(n===null||n===void 0)return true;if(typeof n==="number"&&Number.isNaN(n))return true;return false}const MS_PER_DAY=864e5;function createDateFilter(spec){const{field,op,value,valueGetter,granularity="utc"}=spec;const getValue=valueGetter?valueGetter:row=>readOwnFieldPath(row,field);const truncate=granularity==="day"?truncateToUtcDay:identity;const isRangeOp=op==="between"||op==="notBetween";let singleFilter=null;let loFilter=Number.NEGATIVE_INFINITY;let hiFilter=Number.POSITIVE_INFINITY;let rangeIsEmpty=false;if(isRangeOp){if(Array.isArray(value)&&value.length===2){const lo=coerceToEpochMs(value[0]);const hi=coerceToEpochMs(value[1]);loFilter=lo===null?Number.NEGATIVE_INFINITY:truncate(lo);hiFilter=hi===null?Number.POSITIVE_INFINITY:truncate(hi);rangeIsEmpty=loFilter>hiFilter}else{loFilter=Number.NEGATIVE_INFINITY;hiFilter=Number.POSITIVE_INFINITY}}else{const ms=coerceToEpochMs(value);singleFilter=ms===null?null:truncate(ms)}const singleFilterIsEmpty=!isRangeOp&&singleFilter===null;const rangeFilterIsEmpty=isRangeOp&&loFilter===Number.NEGATIVE_INFINITY&&hiFilter===Number.POSITIVE_INFINITY;return row=>{if(singleFilterIsEmpty){if(op==="equals"||op==="before"||op==="after"||op==="onOrBefore"||op==="onOrAfter"){return true}if(op==="notEqual")return false}if(rangeFilterIsEmpty){if(op==="between")return true;if(op==="notBetween")return false}const raw=getValue(row);const rowMs=coerceToEpochMs(raw);if(rowMs===null){return false}const rowValue=truncate(rowMs);switch(op){case"equals":return rowValue===singleFilter;case"notEqual":return rowValue!==singleFilter;case"before":return rowValue<singleFilter;case"after":return rowValue>singleFilter;case"onOrBefore":return rowValue<=singleFilter;case"onOrAfter":return rowValue>=singleFilter;case"between":if(rangeIsEmpty)return false;return rowValue>=loFilter&&rowValue<=hiFilter;case"notBetween":if(rangeIsEmpty)return true;return rowValue<loFilter||rowValue>hiFilter;default:{return false}}}}function coerceToEpochMs(raw){if(raw instanceof Date){const ms=raw.getTime();return Number.isNaN(ms)?null:ms}if(typeof raw==="number"){return Number.isFinite(raw)?raw:null}if(typeof raw==="string"){const ms=new Date(raw).getTime();return Number.isNaN(ms)?null:ms}return null}function truncateToUtcDay(ms){return Math.floor(ms/MS_PER_DAY)*MS_PER_DAY}function identity(ms){return ms}function compileQuickFilterRegex(value,caseSensitive){if(typeof value!=="string"||value.trim()==="")return null;try{return new RegExp(value,caseSensitive?"":"i")}catch{return null}}function createQuickFilter(spec){const{value,caseSensitive=false,trim=true,fields,valueGetter,wordMode="and",mode="text"}=spec;const fieldListEarly=fields&&fields.length>0?fields.slice():null;const useGetterEarly=typeof valueGetter==="function";if(mode==="regex"){const re=compileQuickFilterRegex(value,caseSensitive);if(re===null){return _row=>{return true}}return row=>{if(row===null||row===void 0)return false;const cells=resolveCells(row,fieldListEarly,useGetterEarly,valueGetter);if(cells===null)return false;for(let c=0;c<cells.length;c++){if(re.test(normalizeCellValue(cells[c],trim,true)))return true}return false}}const normalizedValue=caseSensitive?value:value.toLowerCase();const trimmedValue=normalizedValue.trim();if(trimmedValue===""){return _row=>{return true}}const words=trimmedValue.split(/\s+/).filter(w=>w.length>0);if(words.length===0){return _row=>{return true}}return row=>{if(row===null||row===void 0)return false;const cells=resolveCells(row,fieldListEarly,useGetterEarly,valueGetter);if(cells===null)return false;const cellStrings=new Array(cells.length);for(let i=0;i<cells.length;i++){cellStrings[i]=normalizeCellValue(cells[i],trim,caseSensitive)}if(wordMode==="or"){for(let w=0;w<words.length;w++){const word=words[w];for(let c=0;c<cellStrings.length;c++){if(cellStrings[c].includes(word))return true}}return false}for(let w=0;w<words.length;w++){const word=words[w];let found=false;for(let c=0;c<cellStrings.length;c++){if(cellStrings[c].includes(word)){found=true;break}}if(!found)return false}return true}}function resolveCells(row,fieldList,useGetter,valueGetter){if(useGetter&&valueGetter){let cells;try{cells=valueGetter(row)}catch{return null}return Array.isArray(cells)?cells:null}if(fieldList){const out=new Array(fieldList.length);for(let i=0;i<fieldList.length;i++){out[i]=readOwnFieldPath(row,fieldList[i])}return out}if(typeof row==="object")return Object.values(row);return[row]}function normalizeCellValue(raw,trim,caseSensitive){let asString;if(raw===null||raw===void 0){asString=""}else if(typeof raw==="number"){if(Number.isNaN(raw)){asString=""}else{asString=String(raw)}}else if(typeof raw==="boolean"){asString=raw?"true":"false"}else if(typeof raw==="string"){asString=raw}else if(raw instanceof Date){const ms=raw.getTime();asString=Number.isNaN(ms)?"":raw.toISOString()}else{try{asString=String(raw)}catch{asString=""}}if(trim)asString=asString.trim();if(!caseSensitive)asString=asString.toLowerCase();return asString}const CONDITION_TREE_MAX_DEPTH=8;const LEAF_OP_TABLE={text:{contains:true,notContains:true,equals:true,notEqual:true,startsWith:true,endsWith:true},number:{equals:true,notEqual:true,gt:true,gte:true,lt:true,lte:true,between:true,notBetween:true},date:{equals:true,notEqual:true,before:true,after:true,onOrBefore:true,onOrAfter:true,between:true,notBetween:true}};function validateConditionNode(node){const errors2=[];const warnings=[];const visit=(candidate,path,depth)=>{if(candidate===null||typeof candidate!=="object"){errors2.push(`${path}: not an object`);return}const group=candidate;if(group.op!==void 0||group.children!==void 0){if(group.op!=="and"&&group.op!=="or"){errors2.push(`${path}: group op must be 'and' | 'or'`);return}if(!Array.isArray(group.children)){errors2.push(`${path}: group children must be an array`);return}if(depth>=CONDITION_TREE_MAX_DEPTH){errors2.push(`${path}: exceeds max depth ${CONDITION_TREE_MAX_DEPTH}`);return}if(group.children.length===0){warnings.push(`${path}: empty group (universal match — prune before persisting)`)}group.children.forEach((child,i)=>visit(child,`${path}.${i}`,depth+1));return}const leaf=candidate;if(leaf.kind!=="text"&&leaf.kind!=="number"&&leaf.kind!=="date"&&leaf.kind!=="set"){errors2.push(`${path}: leaf kind must be text | number | date | set`);return}const kind=leaf.kind;if(leaf.spec===null||typeof leaf.spec!=="object"){errors2.push(`${path}: leaf spec missing`);return}const field=leaf.spec.field;if(typeof field!=="string"||field===""){errors2.push(`${path}: leaf spec.field must be a non-empty string`)}if(kind==="set"){const values=leaf.spec.values;if(values!==null&&!Array.isArray(values)){errors2.push(`${path}: set leaf spec.values must be null or an array`)}}else{const validOps=LEAF_OP_TABLE[kind];const op=leaf.spec.op;if(typeof op!=="string"||validOps[op]!==true){const shown=typeof op==="string"?`'${op}'`:String(op);errors2.push(`${path}: ${kind} leaf op ${shown} is not one of ${Object.keys(validOps).join("|")}`)}}};visit(node,"root",1);return{ok:errors2.length===0,errors:errors2,warnings}}class ConditionTreeParseError extends Error{problems;constructor(problems){super(`condition tree parse failed: ${problems.join("; ")}`);this.name="ConditionTreeParseError";this.problems=problems}}function serializeConditionTree(node){return JSON.stringify(node,(_key,value)=>typeof value==="bigint"?{__sy_bigint__:value.toString()}:value)}function parseConditionTree(json){let raw;try{raw=JSON.parse(json,(_key,value)=>{if(value&&typeof value==="object"&&typeof value.__sy_bigint__==="string"){return BigInt(value.__sy_bigint__)}return value})}catch(err){throw new ConditionTreeParseError([`invalid JSON: ${err.message}`])}const validation=validateConditionNode(raw);if(!validation.ok){throw new ConditionTreeParseError(validation.errors)}return raw}const DEFAULT_PINNED_COLUMN_WIDTH=150;function effectivePinSide(col,overrides){const field=typeof col.field==="string"?col.field:"";if(field!==""&&overrides&&overrides.has(field)){const side=overrides.get(field);return side==="left"||side==="right"?side:null}return col.pinned==="left"||col.pinned==="right"?col.pinned:null}function partitionColumnsByPin(cols,overrides){const left=[];const middle=[];const right=[];for(const col of cols){const side=effectivePinSide(col,overrides);if(side==="left"){left.push(col)}else if(side==="right"){right.push(col)}else{middle.push(col)}}return{left,middle,right}}function applyColumnPinning(cols,overrides){const partition=partitionColumnsByPin(cols,overrides);return[...partition.left,...partition.middle,...partition.right]}function computePinnedOffsets(pinnedCols,side,widthOf,baseOffset){const out=new Map;const widthAt=col=>{const width=widthOf(col);return typeof width==="number"&&Number.isFinite(width)&&width>0?width:DEFAULT_PINNED_COLUMN_WIDTH};if(side==="left"){let offset2=baseOffset;for(const col of pinnedCols){if(typeof col.field==="string"&&col.field!=="")out.set(col.field,offset2);offset2+=widthAt(col)}return out}let offset=baseOffset;for(let i=pinnedCols.length-1;i>=0;i--){const col=pinnedCols[i];if(typeof col.field==="string"&&col.field!=="")out.set(col.field,offset);offset+=widthAt(col)}return out}function isColumnGroupDef(def){return Array.isArray(def.children)}function flattenColumnDefs(defs){const out=[];const visit=nodes=>{for(const node of nodes){if(node===null||node===void 0)continue;if(isColumnGroupDef(node)){visit(node.children)}else{out.push(node)}}};visit(defs);return out}function groupHasToggle(group){for(const child of group.children){if(child===null||child===void 0)continue;const show=child.columnGroupShow;if(show==="open"||show==="closed")return true}return false}function visibleGroupLeaves(defs,collapsedGroupIds){const out=[];const visit=(nodes,parentOpen,path)=>{nodes.forEach((node,index2)=>{if(node===null||node===void 0)return;const show=node.columnGroupShow;if(parentOpen!==null){if(show==="open"&&!parentOpen)return;if(show==="closed"&&parentOpen)return}const nodePath=path===""?String(index2):`${path}.${index2}`;if(isColumnGroupDef(node)){const id=node.groupId??nodePath;visit(node.children,!collapsedGroupIds.has(id),nodePath);return}out.push(node)})};visit(defs,null,"");return out}function columnGroupDepth(defs){let depth=0;const visit=(nodes,level)=>{for(const node of nodes){if(node===null||node===void 0||!isColumnGroupDef(node))continue;if(level+1>depth)depth=level+1;visit(node.children,level+1)}};visit(defs,0);return depth}function computeHeaderGroupRows(defs,effectiveLeafFields,collapsedGroupIds){const depth=columnGroupDepth(defs);if(depth===0)return[];const ancestry=new Map;const visit=(nodes,chain,path)=>{nodes.forEach((node,index2)=>{if(node===null||node===void 0)return;const nodePath=path===""?String(index2):`${path}.${index2}`;if(isColumnGroupDef(node)){visit(node.children,[...chain,{ref:node,id:node.groupId??nodePath}],nodePath);return}const field=node.field;if(typeof field!=="string"||field===""||ancestry.has(field))return;ancestry.set(field,chain)})};visit(defs,[],"");const rows=[];for(let level=0;level<depth;level++){const row=[];let current=null;let currentKey=null;for(const field of effectiveLeafFields){const ancestor=ancestry.get(field)?.[level];const key=ancestor?`g:${ancestor.id}`:"null";if(current!==null&&key===currentKey){current.leaves.push(field);continue}current=ancestor?{label:ancestor.ref.headerName,leaves:[field],groupId:ancestor.id,collapsible:groupHasToggle(ancestor.ref),open:!(collapsedGroupIds?.has(ancestor.id)??false)}:{label:null,leaves:[field]};currentKey=key;row.push(current)}rows.push(row)}return rows}function computeColumnWindow(input){const widths=input.widths;const total=widths.length;const overscan=input.overscan??3;if(total===0){return{start:0,end:0,leadingPx:0,trailingPx:0,total:0}}const viewStart=Math.max(0,input.scrollLeft);const viewEnd=viewStart+Math.max(0,input.viewportWidth);let start=0;let x=0;while(start<total&&x+widths[start]<=viewStart){x+=widths[start];start++}let end=start;let x2=x;while(end<total&&x2<viewEnd){x2+=widths[end];end++}start=Math.max(0,start-overscan);end=Math.min(total,end+overscan);if(start>=total)start=Math.max(0,total-1);if(end<=start)end=Math.min(total,start+1);let leadingPx=0;for(let i=0;i<start;i++)leadingPx+=widths[i];let trailingPx=0;for(let i=end;i<total;i++)trailingPx+=widths[i];return{start,end,leadingPx,trailingPx,total}}function pickEmptyState(inputs){if(inputs.loading===true)return"loading";const sourceCount=normalizeCount(inputs.sourceRowCount);if(sourceCount<=0)return"no-data";const displayCount=normalizeCount(inputs.displayRowCount);if(displayCount<=0&&inputs.hasActiveFilters===true){return"no-matches"}return"none"}function normalizeCount(raw){if(typeof raw!=="number"||!Number.isFinite(raw))return 0;if(raw<0)return 0;return Math.floor(raw)}const DEFAULT_MIN_LOADING_DURATION_MS=200;function isLoadingActive(inputs){if(inputs.mode==="off")return false;const external=inputs.externalLoading===true;if(inputs.mode==="auto"){return external||inputs.asyncInFlight===true}return external}function createLoadingDebouncer(minDurationMs=DEFAULT_MIN_LOADING_DURATION_MS){const floor=normalizeMinDuration(minDurationMs);let effective=false;let firstTrueAt=null;return{update(rawLoading,now){if(rawLoading===true){if(!effective){effective=true;firstTrueAt=isFiniteNumber(now)?now:0}return effective}if(!effective){return false}if(floor<=0){effective=false;firstTrueAt=null;return false}const start=firstTrueAt??(isFiniteNumber(now)?now:0);const nowSafe=isFiniteNumber(now)?now:start;if(nowSafe-start>=floor){effective=false;firstTrueAt=null;return false}return true},remaining(now){if(!effective||floor<=0||firstTrueAt===null)return 0;const nowSafe=isFiniteNumber(now)?now:firstTrueAt;return Math.max(0,floor-(nowSafe-firstTrueAt))},clear(){effective=false;firstTrueAt=null}}}function normalizeMinDuration(raw){const value=typeof raw==="number"?raw:Number(raw);if(!Number.isFinite(value)||value<0)return 0;return value}function isFiniteNumber(n){return typeof n==="number"&&Number.isFinite(n)}function safeCount(raw){if(typeof raw!=="number"||!Number.isFinite(raw))return 0;if(raw<=0)return 0;return Math.floor(raw)}function isValid(active,rowCount,colCount){if(!active)return false;if(typeof active.rowIndex!=="number"||typeof active.colIndex!=="number")return false;if(!Number.isInteger(active.rowIndex)||!Number.isInteger(active.colIndex))return false;if(active.rowIndex<0||active.colIndex<0)return false;if(active.rowIndex>=rowCount||active.colIndex>=colCount)return false;return true}function moveCell(active,direction,rowCount,colCount){const rows=safeCount(rowCount);const cols=safeCount(colCount);if(rows===0||cols===0)return null;if(!isValid(active,rows,cols)){return{rowIndex:0,colIndex:0}}switch(direction){case"up":if(active.rowIndex<=0)return active;return{rowIndex:active.rowIndex-1,colIndex:active.colIndex};case"down":if(active.rowIndex>=rows-1)return active;return{rowIndex:active.rowIndex+1,colIndex:active.colIndex};case"left":if(active.colIndex<=0)return active;return{rowIndex:active.rowIndex,colIndex:active.colIndex-1};case"right":if(active.colIndex>=cols-1)return active;return{rowIndex:active.rowIndex,colIndex:active.colIndex+1};default:{return active}}}function clampCell(active,rowCount,colCount){const rows=safeCount(rowCount);const cols=safeCount(colCount);if(rows===0||cols===0)return null;if(!active)return null;if(typeof active.rowIndex!=="number"||typeof active.colIndex!=="number"||!Number.isFinite(active.rowIndex)||!Number.isFinite(active.colIndex)){return null}let nextRow=Math.floor(active.rowIndex);let nextCol=Math.floor(active.colIndex);if(nextRow<0)nextRow=0;if(nextCol<0)nextCol=0;if(nextRow>=rows)nextRow=rows-1;if(nextCol>=cols)nextCol=cols-1;if(nextRow===active.rowIndex&&nextCol===active.colIndex){return active}return{rowIndex:nextRow,colIndex:nextCol}}function homeCell(active,colCount){const cols=safeCount(colCount);if(cols===0)return null;if(!active||typeof active.rowIndex!=="number"||!Number.isInteger(active.rowIndex)||active.rowIndex<0){return{rowIndex:0,colIndex:0}}if(active.colIndex===0)return active;return{rowIndex:active.rowIndex,colIndex:0}}function endCell(active,colCount){const cols=safeCount(colCount);if(cols===0)return null;const lastCol=cols-1;if(!active||typeof active.rowIndex!=="number"||!Number.isInteger(active.rowIndex)||active.rowIndex<0){return{rowIndex:0,colIndex:lastCol}}if(active.colIndex===lastCol)return active;return{rowIndex:active.rowIndex,colIndex:lastCol}}function homeGridCell(rowCount,colCount){const rows=safeCount(rowCount);const cols=safeCount(colCount);if(rows===0||cols===0)return null;return{rowIndex:0,colIndex:0}}function endGridCell(rowCount,colCount){const rows=safeCount(rowCount);const cols=safeCount(colCount);if(rows===0||cols===0)return null;return{rowIndex:rows-1,colIndex:cols-1}}function pageCell(active,direction,pageSize,rowCount,colCount){const rows=safeCount(rowCount);const cols=safeCount(colCount);if(rows===0||cols===0)return null;const safePage=safeCount(pageSize);if(!isValid(active,rows,cols)){if(direction==="down")return{rowIndex:0,colIndex:0};return{rowIndex:rows-1,colIndex:cols-1}}if(safePage===0)return active;let nextRow;if(direction==="down"){nextRow=active.rowIndex+safePage;if(nextRow>rows-1)nextRow=rows-1}else{nextRow=active.rowIndex-safePage;if(nextRow<0)nextRow=0}if(nextRow===active.rowIndex)return active;return{rowIndex:nextRow,colIndex:active.colIndex}}function moveCellWithWrap(active,direction,rowCount,colCount){const rows=safeCount(rowCount);const cols=safeCount(colCount);if(rows===0||cols===0)return null;if(!isValid(active,rows,cols)){return{rowIndex:0,colIndex:0}}if(direction==="up"||direction==="down"){return moveCell(active,direction,rows,cols)}if(direction==="right"){if(active.colIndex<cols-1){return{rowIndex:active.rowIndex,colIndex:active.colIndex+1}}if(active.rowIndex<rows-1){return{rowIndex:active.rowIndex+1,colIndex:0}}return active}if(active.colIndex>0){return{rowIndex:active.rowIndex,colIndex:active.colIndex-1}}if(active.rowIndex>0){return{rowIndex:active.rowIndex-1,colIndex:cols-1}}return active}const defaultTokens=Object.freeze({"--sy-grid-bg":"#ffffff","--sy-grid-viewport-bg":"#ffffff","--sy-grid-toolbar-bg":"#ffffff","--sy-grid-border":"#e5e7eb","--sy-grid-toolbar-border":"#e5e7eb","--sy-grid-text":"#111827","--sy-grid-text-muted":"#6b7280","--sy-grid-header-bg":"#f9fafb","--sy-grid-header-bg-hover":"#f3f4f6","--sy-grid-header-border":"#e5e7eb","--sy-grid-header-color":"#111827","--sy-grid-header-font-weight":"600","--sy-grid-row-height":"32px","--sy-grid-row-bg-odd":"#ffffff","--sy-grid-row-bg-even":"#f9fafb","--sy-grid-row-border":"#f3f4f6","--sy-grid-row-color":"#111827","--sy-grid-row-bg-hover":"rgba(37, 99, 235, 0.06)","--sy-grid-row-bg-selected":"rgba(37, 99, 235, 0.12)","--sy-grid-cell-padding-x":"12px","--sy-grid-cell-font-size":"13px","--sy-grid-cell-editor-bg":"#ffffff","--sy-grid-cell-editor-color":"#111827","--sy-grid-cell-editor-border":"#2563eb","--sy-grid-cell-editor-shadow":"inset 0 0 0 1px rgba(37, 99, 235, 0.22)","--sy-grid-active-cell-outline":"#2563eb","--sy-grid-active-row-bg":"rgba(37, 99, 235, 0.08)","--sy-grid-viewport-focus-outline":"#2563eb","--sy-grid-scrollbar-thumb":"rgba(15, 23, 42, 0.18)","--sy-grid-scrollbar-track":"transparent","--sy-grid-sort-indicator-color":"#9ca3af","--sy-grid-sort-indicator-active-color":"#2563eb","--sy-grid-filter-icon-color":"currentColor","--sy-grid-filter-icon-active-color":"#2563eb","--sy-grid-filter-dropdown-bg":"#ffffff","--sy-grid-filter-dropdown-color":"#111827","--sy-grid-filter-dropdown-border":"#e5e7eb","--sy-grid-filter-dropdown-shadow":"0 8px 20px rgba(15, 23, 42, 0.12)","--sy-grid-filter-button-primary-bg":"#2563eb","--sy-grid-filter-button-primary-color":"#ffffff","--sy-grid-quick-filter-input-bg":"#ffffff","--sy-grid-quick-filter-input-color":"#111827","--sy-grid-quick-filter-input-border":"#d1d5db","--sy-grid-quick-filter-input-placeholder":"#9ca3af","--sy-grid-quick-filter-input-focus":"#2563eb","--sy-grid-quick-filter-clear-color":"#6b7280","--sy-grid-quick-filter-clear-hover":"rgba(15, 23, 42, 0.08)","--sy-grid-pagination-bg":"#f9fafb","--sy-grid-pagination-color":"#111827","--sy-grid-pagination-border":"#e5e7eb","--sy-grid-pagination-active-bg":"#2563eb","--sy-grid-pagination-active-color":"#ffffff","--sy-grid-pagination-disabled-color":"#9ca3af","--sy-grid-pagination-hover-bg":"rgba(15, 23, 42, 0.06)","--sy-grid-empty-state-bg":"rgba(255, 255, 255, 0.92)","--sy-grid-empty-state-color":"#4b5563","--sy-grid-empty-state-icon-color":"#9ca3af","--sy-grid-empty-state-action-bg":"#2563eb","--sy-grid-empty-state-action-color":"#ffffff","--sy-grid-loading-backdrop":"rgba(255, 255, 255, 0.7)","--sy-grid-loading-spinner-color":"#2563eb","--sy-grid-loading-message-color":"#4b5563"});function isGridTokenName(name){return Object.prototype.hasOwnProperty.call(defaultTokens,name)}const alpineTokens=Object.freeze({"--sy-grid-bg":"#ffffff","--sy-grid-viewport-bg":"#ffffff","--sy-grid-toolbar-bg":"#ffffff","--sy-grid-border":"#e5e7eb","--sy-grid-toolbar-border":"#e5e7eb","--sy-grid-text":"#111827","--sy-grid-text-muted":"#6b7280","--sy-grid-header-bg":"#f9fafb","--sy-grid-header-bg-hover":"#f3f4f6","--sy-grid-header-border":"#e5e7eb","--sy-grid-header-color":"#111827","--sy-grid-header-font-weight":"600","--sy-grid-row-height":"32px","--sy-grid-row-bg-odd":"#ffffff","--sy-grid-row-bg-even":"#f9fafb","--sy-grid-row-border":"#f3f4f6","--sy-grid-row-color":"#111827","--sy-grid-row-bg-hover":"rgba(37, 99, 235, 0.06)","--sy-grid-row-bg-selected":"rgba(37, 99, 235, 0.12)","--sy-grid-cell-padding-x":"12px","--sy-grid-cell-font-size":"13px","--sy-grid-cell-editor-bg":"#ffffff","--sy-grid-cell-editor-color":"#111827","--sy-grid-cell-editor-border":"#2563eb","--sy-grid-cell-editor-shadow":"inset 0 0 0 1px rgba(37, 99, 235, 0.22)","--sy-grid-active-cell-outline":"#2563eb","--sy-grid-active-row-bg":"rgba(37, 99, 235, 0.08)","--sy-grid-viewport-focus-outline":"#2563eb","--sy-grid-sort-indicator-active-color":"#2563eb","--sy-grid-filter-icon-active-color":"#2563eb","--sy-grid-filter-button-primary-bg":"#2563eb","--sy-grid-quick-filter-input-focus":"#2563eb","--sy-grid-pagination-active-bg":"#2563eb","--sy-grid-empty-state-action-bg":"#2563eb","--sy-grid-loading-spinner-color":"#2563eb"});const balhamTokens=Object.freeze({"--sy-grid-bg":"#ffffff","--sy-grid-viewport-bg":"#ffffff","--sy-grid-toolbar-bg":"#f4f6f8","--sy-grid-border":"#bdc3c7","--sy-grid-toolbar-border":"#bdc3c7","--sy-grid-text":"#000000","--sy-grid-text-muted":"#5c6671","--sy-grid-header-bg":"#e2e9eb","--sy-grid-header-bg-hover":"#d2d9db","--sy-grid-header-border":"#9ea7ad","--sy-grid-header-color":"#000000","--sy-grid-header-font-weight":"700","--sy-grid-row-height":"28px","--sy-grid-row-bg-odd":"#ffffff","--sy-grid-row-bg-even":"#fcfdfe","--sy-grid-row-border":"#dde2e4","--sy-grid-row-color":"#000000","--sy-grid-row-bg-hover":"rgba(33, 150, 243, 0.08)","--sy-grid-row-bg-selected":"rgba(33, 150, 243, 0.18)","--sy-grid-cell-padding-x":"8px","--sy-grid-cell-font-size":"12px","--sy-grid-cell-editor-bg":"#ffffff","--sy-grid-cell-editor-color":"#000000","--sy-grid-cell-editor-border":"#0091ea","--sy-grid-cell-editor-shadow":"inset 0 0 0 1px rgba(0, 145, 234, 0.22)","--sy-grid-active-cell-outline":"#0091ea","--sy-grid-active-row-bg":"rgba(0, 145, 234, 0.10)","--sy-grid-viewport-focus-outline":"#0091ea","--sy-grid-sort-indicator-color":"#7e8a91","--sy-grid-sort-indicator-active-color":"#0091ea","--sy-grid-filter-icon-active-color":"#0091ea","--sy-grid-filter-button-primary-bg":"#0091ea","--sy-grid-quick-filter-input-focus":"#0091ea","--sy-grid-pagination-bg":"#e2e9eb","--sy-grid-pagination-border":"#bdc3c7","--sy-grid-pagination-active-bg":"#0091ea","--sy-grid-empty-state-action-bg":"#0091ea","--sy-grid-loading-spinner-color":"#0091ea"});const darkAlpineTokens=Object.freeze({"--sy-grid-bg":"#0f172a","--sy-grid-viewport-bg":"#111827","--sy-grid-toolbar-bg":"#111827","--sy-grid-border":"#374151","--sy-grid-toolbar-border":"#374151","--sy-grid-text":"#f3f4f6","--sy-grid-text-muted":"#9ca3af","--sy-grid-header-bg":"#1f2937","--sy-grid-header-bg-hover":"#283447","--sy-grid-header-border":"#374151","--sy-grid-header-color":"#f3f4f6","--sy-grid-row-bg-odd":"#111827","--sy-grid-row-bg-even":"#1f2937","--sy-grid-row-border":"#374151","--sy-grid-row-color":"#f3f4f6","--sy-grid-row-bg-hover":"rgba(96, 165, 250, 0.12)","--sy-grid-row-bg-selected":"rgba(96, 165, 250, 0.22)","--sy-grid-active-cell-outline":"#60a5fa","--sy-grid-active-row-bg":"rgba(96, 165, 250, 0.16)","--sy-grid-viewport-focus-outline":"#60a5fa","--sy-grid-cell-editor-bg":"#0f172a","--sy-grid-cell-editor-color":"#f3f4f6","--sy-grid-cell-editor-border":"#60a5fa","--sy-grid-cell-editor-shadow":"inset 0 0 0 1px rgba(96, 165, 250, 0.34)","--sy-grid-sort-indicator-color":"#6b7280","--sy-grid-sort-indicator-active-color":"#60a5fa","--sy-grid-filter-icon-active-color":"#60a5fa","--sy-grid-filter-dropdown-bg":"#1f2937","--sy-grid-filter-dropdown-color":"#f3f4f6","--sy-grid-filter-dropdown-border":"#374151","--sy-grid-filter-dropdown-shadow":"0 8px 20px rgba(0, 0, 0, 0.45)","--sy-grid-filter-button-primary-bg":"#60a5fa","--sy-grid-filter-button-primary-color":"#0f172a","--sy-grid-quick-filter-input-bg":"#1f2937","--sy-grid-quick-filter-input-color":"#f3f4f6","--sy-grid-quick-filter-input-border":"#374151","--sy-grid-quick-filter-input-placeholder":"#6b7280","--sy-grid-quick-filter-input-focus":"#60a5fa","--sy-grid-quick-filter-clear-color":"#9ca3af","--sy-grid-quick-filter-clear-hover":"rgba(255, 255, 255, 0.08)","--sy-grid-pagination-bg":"#111827","--sy-grid-pagination-color":"#f3f4f6","--sy-grid-pagination-border":"#374151","--sy-grid-pagination-active-bg":"#60a5fa","--sy-grid-pagination-active-color":"#0f172a","--sy-grid-pagination-disabled-color":"#4b5563","--sy-grid-pagination-hover-bg":"rgba(255, 255, 255, 0.06)","--sy-grid-empty-state-bg":"rgba(17, 24, 39, 0.9)","--sy-grid-empty-state-color":"#d1d5db","--sy-grid-empty-state-icon-color":"#6b7280","--sy-grid-empty-state-action-bg":"#60a5fa","--sy-grid-empty-state-action-color":"#0f172a","--sy-grid-loading-backdrop":"rgba(17, 24, 39, 0.7)","--sy-grid-loading-spinner-color":"#60a5fa","--sy-grid-loading-message-color":"#d1d5db","--sy-grid-scrollbar-thumb":"rgba(255, 255, 255, 0.18)"});const darkBalhamTokens=Object.freeze({"--sy-grid-bg":"#0d1117","--sy-grid-viewport-bg":"#161b22","--sy-grid-toolbar-bg":"#161b22","--sy-grid-border":"#30363d","--sy-grid-toolbar-border":"#30363d","--sy-grid-text":"#e6edf3","--sy-grid-text-muted":"#8b949e","--sy-grid-header-bg":"#21262d","--sy-grid-header-bg-hover":"#2d333b","--sy-grid-header-border":"#30363d","--sy-grid-header-color":"#e6edf3","--sy-grid-row-bg-odd":"#161b22","--sy-grid-row-bg-even":"#1b2129","--sy-grid-row-border":"#30363d","--sy-grid-row-color":"#e6edf3","--sy-grid-row-bg-hover":"rgba(56, 139, 253, 0.12)","--sy-grid-row-bg-selected":"rgba(56, 139, 253, 0.22)","--sy-grid-active-cell-outline":"#58a6ff","--sy-grid-active-row-bg":"rgba(56, 139, 253, 0.16)","--sy-grid-viewport-focus-outline":"#58a6ff","--sy-grid-cell-editor-bg":"#0d1117","--sy-grid-cell-editor-color":"#e6edf3","--sy-grid-cell-editor-border":"#58a6ff","--sy-grid-cell-editor-shadow":"inset 0 0 0 1px rgba(88, 166, 255, 0.34)","--sy-grid-sort-indicator-color":"#6e7681","--sy-grid-sort-indicator-active-color":"#58a6ff","--sy-grid-filter-icon-active-color":"#58a6ff","--sy-grid-filter-dropdown-bg":"#1b2129","--sy-grid-filter-dropdown-color":"#e6edf3","--sy-grid-filter-dropdown-border":"#30363d","--sy-grid-filter-dropdown-shadow":"0 8px 20px rgba(0, 0, 0, 0.55)","--sy-grid-filter-button-primary-bg":"#58a6ff","--sy-grid-filter-button-primary-color":"#0d1117","--sy-grid-quick-filter-input-bg":"#1b2129","--sy-grid-quick-filter-input-color":"#e6edf3","--sy-grid-quick-filter-input-border":"#30363d","--sy-grid-quick-filter-input-placeholder":"#6e7681","--sy-grid-quick-filter-input-focus":"#58a6ff","--sy-grid-quick-filter-clear-color":"#8b949e","--sy-grid-quick-filter-clear-hover":"rgba(255, 255, 255, 0.06)","--sy-grid-pagination-bg":"#161b22","--sy-grid-pagination-color":"#e6edf3","--sy-grid-pagination-border":"#30363d","--sy-grid-pagination-active-bg":"#58a6ff","--sy-grid-pagination-active-color":"#0d1117","--sy-grid-pagination-disabled-color":"#484f58","--sy-grid-pagination-hover-bg":"rgba(255, 255, 255, 0.06)","--sy-grid-empty-state-bg":"rgba(13, 17, 23, 0.9)","--sy-grid-empty-state-color":"#c9d1d9","--sy-grid-empty-state-icon-color":"#6e7681","--sy-grid-empty-state-action-bg":"#58a6ff","--sy-grid-empty-state-action-color":"#0d1117","--sy-grid-loading-backdrop":"rgba(13, 17, 23, 0.7)","--sy-grid-loading-spinner-color":"#58a6ff","--sy-grid-loading-message-color":"#c9d1d9","--sy-grid-scrollbar-thumb":"rgba(255, 255, 255, 0.18)"});function isGridThemePresetName(name){return name==="alpine"||name==="balham"||name==="alpine-dark"||name==="balham-dark"}const MAX_EXTENDS_DEPTH$1=16;function presetOverrides$1(name){switch(name){case"alpine":return alpineTokens;case"balham":return balhamTokens;case"alpine-dark":return{...alpineTokens,...darkAlpineTokens};case"balham-dark":return{...balhamTokens,...darkBalhamTokens}}}function flattenTheme(theme,depth){if(theme==null){return{}}if(typeof theme==="string"){if(isGridThemePresetName(theme)){return presetOverrides$1(theme)}console.warn("theme:name",theme);return presetOverrides$1("alpine")}if(typeof theme==="object"){if(depth>=MAX_EXTENDS_DEPTH$1){console.warn("theme:depth",MAX_EXTENDS_DEPTH$1);return{}}const baseOverrides=flattenTheme(theme.extends??"alpine",depth+1);const own={};if(theme.tokens){for(const key of Object.keys(theme.tokens)){if(!isGridTokenName(key)){console.warn("theme:token",key);continue}const value=theme.tokens[key];if(typeof value==="string"){own[key]=value}}}return{...baseOverrides,...own}}console.warn("theme:type",typeof theme);return presetOverrides$1("alpine")}function resolveTheme(theme){const overrides=flattenTheme(theme,0);const out={...defaultTokens};for(const key of Object.keys(overrides)){if(!isGridTokenName(key))continue;const value=overrides[key];if(typeof value==="string"){out[key]=value}}return out}function themeDataAttribute(theme){if(theme==null)return void 0;if(typeof theme==="string"){return isGridThemePresetName(theme)?theme:"alpine"}if(typeof theme==="object")return"custom";return"alpine"}function applyTheme(host,theme){if(!host)return;const style=host.style;if(!style||typeof style.setProperty!=="function")return;const resolved=resolveTheme(theme);for(const key of Object.keys(resolved)){style.setProperty(key,resolved[key])}}const defaultMessages=Object.freeze({"toolbar.quickFilterPlaceholder":"Filter…","toolbar.quickFilterAriaLabel":"Quick filter","toolbar.quickFilterClearAriaLabel":"Clear quick filter","pagination.previousPage":"Previous page","pagination.nextPage":"Next page","pagination.navAriaLabel":"Pagination","pagination.rowsLabel":"Rows","pagination.rowsPerPageAriaLabel":"Rows per page","pagination.pageOf":"Page {{current}} of {{total}}","pagination.rangeOf":"{{start}}-{{end}} of {{total}}","filter.operatorLabel":"Operator","filter.valueLabel":"Value","filter.fromLabel":"From","filter.toLabel":"To","filter.dateLabel":"Date","filter.granularityLabel":"Granularity","filter.granularityUtcOption":"UTC timestamp","filter.granularityDayOption":"Day (UTC midnight)","filter.caseSensitiveLabel":"Case sensitive","filter.valuePlaceholder":"filter value","filter.numberPlaceholder":"number","filter.numberLowPlaceholder":"lo (blank = -∞)","filter.numberHighPlaceholder":"hi (blank = +∞)","filter.applyButton":"Apply","filter.clearButton":"Clear","filter.cancelButton":"Cancel","filter.setSearchPlaceholder":"Search values","filter.setSelectAllLabel":"(Select all)","filter.setBlanksLabel":"(Blanks)","filter.setNoMatches":"No values match","filter.headerRowOpen":"All","filter.headerRowSelected":"{{count}} selected","filter.headerRowParts":"{{count}} conditions","conditionBuilder.title":"Advanced filter","conditionBuilder.activeBadge":"ON","conditionBuilder.matchAll":"ALL conditions (AND)","conditionBuilder.matchAny":"ANY condition (OR)","conditionBuilder.addRule":"+ Condition","conditionBuilder.addGroup":"+ Group","conditionBuilder.remove":"Remove","conditionBuilder.empty":"No conditions — the grid is unfiltered","conditionBuilder.presetsLabel":"Presets","conditionBuilder.presetPlaceholder":"Preset name","conditionBuilder.savePreset":"Save","conditionBuilder.deletePreset":"Delete preset","group.footerLabel":"{{label}} total","group.panelPlaceholder":"Drag a column here to group by it","group.panelRemove":"Stop grouping by {{column}}","pivotPanel.title":"Pivot","pivotPanel.mode":"Pivot mode","pivotPanel.availableFields":"Available Fields","pivotPanel.rowGroups":"Row Groups","pivotPanel.columnLabels":"Column Labels","pivotPanel.values":"Values","pivotPanel.noFields":"No fields","pivotPanel.moveTo":"Move to...","pivotPanel.moveField":"Move {{field}}","pivotPanel.aggregation":"Aggregation for {{field}}","pivotPanel.moveUp":"Move {{field}} up","pivotPanel.moveDown":"Move {{field}} down","pivotPanel.remove":"Remove {{field}}","pivotPanel.changed":"{{field}} moved to {{lane}}","detail.toggleLabel":"Toggle detail for {{id}}","statusBar.ariaLabel":"Status bar","statusBar.totalRows":"Rows: {{count}}","statusBar.filteredRows":"Filtered: {{count}}","statusBar.totalAndFilteredRows":"Rows: {{filtered}} of {{total}}","statusBar.selectedRows":"Selected: {{count}}","statusBar.aggCount":"Count: {{count}}","statusBar.aggSum":"Sum: {{sum}}","statusBar.aggAvg":"Avg: {{avg}}","sideBar.ariaLabel":"Side bar","sideBar.columnsLabel":"Columns","sideBar.filtersLabel":"Filters","sideBar.closeLabel":"Close panel","sideBar.noActiveFilters":"No active filters","sideBar.searchColumns":"Search columns","sideBar.searchFilters":"Search filters","filter.op.contains":"contains","filter.op.notContains":"not contains","filter.op.equals":"equals","filter.op.notEqual":"not equal","filter.op.startsWith":"starts with","filter.op.endsWith":"ends with","filter.op.greaterThan":"greater than","filter.op.greaterOrEqual":"greater or equal","filter.op.lessThan":"less than","filter.op.lessOrEqual":"less or equal","filter.op.between":"between","filter.op.notBetween":"not between","filter.op.before":"before","filter.op.after":"after","filter.op.onOrBefore":"on or before","filter.op.onOrAfter":"on or after","empty.noData":"No data to display","empty.noMatches":"No rows match your filters","empty.clearFiltersAction":"Clear filters","loading.message":"Loading…","header.filterLabel":"Filter {{column}}","header.pageLabel":"Page {{page}}","sort.ascendingTooltip":"Sort ascending","sort.descendingTooltip":"Sort descending","sort.removeTooltip":"Remove sort","comments.title":"Comments","comments.empty":"No comments yet","comments.placeholder":"Write a comment…","comments.add":"Comment","comments.resolve":"Resolve","comments.reopen":"Reopen","comments.delete":"Delete","comments.anonymous":"Anonymous","comments.close":"Close comments","collab.conflictOverridden":"Your edit to {{column}} (row {{row}}) was replaced by {{user}}","collab.anotherUser":"another user","watermark.fallbackToStandard":"Syidax — fell back to standard engine","a11y.gridLabel":"Data grid","a11y.filterButton":"Filter column","a11y.paginationPrev":"Previous page","a11y.paginationNext":"Next page","a11y.paginationPageSize":"Rows per page","a11y.quickFilterLabel":"Search rows","a11y.selectRowCheckbox":"Select row","a11y.selectAllCheckbox":"Select all visible rows","a11y.cellEditingHint":"Editing cell {{row}}, {{column}}. Press Enter to save, Escape to cancel.","a11y.cellEditorAriaLabel":"Cell editor for {{column}}, row {{row}}","a11y.rowDragHandle":"Drag to reorder row {{row}}","a11y.fillHandle":"Fill handle: drag or use arrow keys to fill from row {{row}}","pivot.subtotalLabel":"{{label}} total","editor.numberConstraintViolation":"Value must be {{constraint}} {{value}}.","editor.dateConstraintViolation":"Date must be {{constraint}} {{value}}.","editor.dateInvalidFormat":"Date must be in YYYY-MM-DD format.","editor.selectPlaceholder":"Choose…","editor.selectExpand":"Open options","editor.selectCollapse":"Close options","editor.checkboxAriaLabelOn":"Checked","editor.checkboxAriaLabelOff":"Unchecked","editor.checkboxAriaLabelMixed":"Mixed","editor.textareaCommitHint":"Press Shift+Enter or Tab to save, Escape to cancel.","editor.largeTextSave":"OK","editor.largeTextCancel":"Cancel","rowModel.loadingRow":"Loading…","rowModel.retry":"Retry","csvImport.button":"Import CSV","csvImport.title":"Import CSV","csvImport.firstRowHeader":"First row is a header","csvImport.delimiter":"Delimiter","csvImport.delimiterAuto":"Auto","csvImport.cancel":"Cancel","csvImport.import":"Import"});function isMessageKey(key){return Object.prototype.hasOwnProperty.call(defaultMessages,key)}const localeKeys=Object.keys(defaultMessages);function defineLocale(values){const locale={};for(let index2=0;index2<localeKeys.length;index2+=1){locale[localeKeys[index2]]=values[index2]}return Object.freeze(locale)}const enLocale=Object.freeze({});const koLocale=defineLocale(["검색…","빠른 검색","검색어 지우기","이전 페이지","다음 페이지","페이지 이동","행","페이지당 행 수","{{current}} / {{total}} 페이지","{{start}}-{{end}} / 총 {{total}}","연산자","값","시작","끝","날짜","단위","UTC 타임스탬프","일 단위 (UTC 자정)","대소문자 구분","필터 값","숫자","하한 (빈 값 = -∞)","상한 (빈 값 = +∞)","적용","지우기","취소","값 검색","(전체 선택)","(빈 값)","일치하는 값이 없습니다","전체","{{count}}개 선택","조건 {{count}}개","고급 필터","적용 중","모든 조건 일치 (AND)","하나 이상 일치 (OR)","+ 조건","+ 그룹","제거","조건 없음 — 필터가 적용되지 않습니다","프리셋","프리셋 이름","저장","프리셋 삭제","{{label}} 소계","여기로 열을 드래그하여 그룹화","{{column}} 그룹화 해제","피벗","피벗 모드","사용 가능한 필드","행 그룹","열 레이블","값","필드 없음","이동 대상...","{{field}} 이동","{{field}} 집계 방식","{{field}} 위로 이동","{{field}} 아래로 이동","{{field}} 제거","{{field}}: {{lane}}으로 이동","{{id}} 상세 전환","상태 표시줄","행: {{count}}","필터됨: {{count}}","행: {{total}}개 중 {{filtered}}개","선택됨: {{count}}","개수: {{count}}","합계: {{sum}}","평균: {{avg}}","사이드 바","컬럼","필터","패널 닫기","활성 필터 없음","컬럼 검색","필터 검색","포함","포함 안함","같음","같지 않음","시작 문자열","끝 문자열","초과","이상","미만","이하","범위 내","범위 밖","이전","이후","이전 또는 같음","이후 또는 같음","표시할 데이터가 없습니다","필터 조건에 맞는 행이 없습니다","필터 지우기","불러오는 중…","{{column}} 필터","{{page}} 페이지","오름차순 정렬","내림차순 정렬","정렬 해제","코멘트","아직 코멘트가 없습니다","코멘트를 입력하세요…","등록","해결","다시 열기","삭제","익명","코멘트 닫기","{{column}}(행 {{row}}) 편집이 {{user}}의 값으로 대체되었습니다","다른 사용자","Syidax — 표준 엔진으로 전환됨","데이터 그리드","컬럼 필터","이전 페이지로","다음 페이지로","한 페이지에 표시할 행 수","행 검색","행 선택","보이는 모든 행 선택","{{row}}행, {{column}}열 편집 중입니다. Enter 키로 저장하고 Esc 키로 취소합니다.","{{row}}행 {{column}} 셀 편집기","{{row}}행을 드래그하여 순서 변경","채우기 핸들: 드래그하거나 화살표 키로 {{row}}행부터 채우기","{{label}} 합계","값은 {{constraint}} {{value}} 이어야 합니다.","날짜는 {{constraint}} {{value}} 이어야 합니다.","날짜는 YYYY-MM-DD 형식이어야 합니다.","선택…","옵션 열기","옵션 닫기","선택됨","선택 해제됨","혼합","Shift+Enter 또는 Tab 키로 저장하고, Esc 키로 취소합니다.","확인","취소","불러오는 중…","다시 시도","CSV 가져오기","CSV 가져오기","첫 행을 헤더로 사용","구분자","자동","취소","가져오기"]);const jaLocale=defineLocale(["検索…","クイック検索","検索をクリア","前のページ","次のページ","ページネーション","行","1ページあたりの行数","{{current}} / {{total}} ページ","{{start}}-{{end}} / 全 {{total}} 件","演算子","値","開始","終了","日付","粒度","UTC タイムスタンプ","日単位 (UTC 0時)","大文字小文字を区別","フィルター値","数値","下限 (空欄 = -∞)","上限 (空欄 = +∞)","適用","クリア","キャンセル","値を検索","(すべて選択)","(空白)","一致する値がありません","すべて","{{count}}件選択","条件{{count}}件","高度なフィルター","適用中","すべての条件に一致 (AND)","いずれかに一致 (OR)","+ 条件","+ グループ","削除","条件なし — フィルターは適用されません","プリセット","プリセット名","保存","プリセット削除","{{label}} 小計","ここに列をドラッグしてグループ化","{{column}} のグループ化を解除","ピボット","ピボットモード","使用可能なフィールド","行グループ","列ラベル","値","フィールドなし","移動先...","{{field}} を移動","{{field}} の集計","{{field}} を上へ移動","{{field}} を下へ移動","{{field}} を削除","{{field}}: {{lane}} に移動","{{id}} の詳細を切替","ステータスバー","行: {{count}}","フィルター済み: {{count}}","行: {{total}}件中{{filtered}}件","選択: {{count}}","件数: {{count}}","合計: {{sum}}","平均: {{avg}}","サイドバー","列","フィルター","パネルを閉じる","有効なフィルターなし","列を検索","フィルターを検索","含む","含まない","一致","一致しない","前方一致","後方一致","より大きい","以上","より小さい","以下","範囲内","範囲外","以前","以降","その日以前","その日以降","表示するデータがありません","フィルター条件に一致する行がありません","フィルターをクリア","読み込み中…","{{column}} のフィルター","{{page}} ページ","昇順で並べ替え","降順で並べ替え","並べ替えを解除","コメント","コメントはまだありません","コメントを入力…","投稿","解決","再オープン","削除","匿名","コメントを閉じる","{{column}}(行 {{row}})の編集は{{user}}の値に置き換えられました","別のユーザー","Syidax — 標準エンジンにフォールバックしました","データ グリッド","列を絞り込む","前のページへ","次のページへ","1ページに表示する行数","行を検索","行を選択","表示中のすべての行を選択","{{row}}行 {{column}}列を編集中です。Enter で保存、Esc でキャンセルします。","{{row}}行 {{column}} のセル エディター","{{row}}行をドラッグして並べ替え","フィルハンドル: ドラッグまたは矢印キーで{{row}}行から入力","{{label}} 合計","値は {{constraint}} {{value}} である必要があります。","日付は {{constraint}} {{value}} である必要があります。","日付は YYYY-MM-DD 形式である必要があります。","選択…","オプションを開く","オプションを閉じる","チェック済み","チェックなし","混在","Shift+Enter または Tab で保存、Esc でキャンセルします。","確定","キャンセル","読み込み中…","再試行","CSV読み込み","CSVインポート","先頭行をヘッダーにする","区切り文字","自動","キャンセル","インポート"]);function isGridLocalePresetName(name){return name==="en"||name==="ko"||name==="ja"}const MAX_EXTENDS_DEPTH=16;function presetOverrides(name){switch(name){case"en":return enLocale;case"ko":return koLocale;case"ja":return jaLocale}}function flattenLocale(locale,depth){if(locale==null){return{}}if(typeof locale==="string"){if(isGridLocalePresetName(locale)){return presetOverrides(locale)}console.warn("locale:name",locale);return presetOverrides("en")}if(typeof locale==="object"){if(depth>=MAX_EXTENDS_DEPTH){console.warn("locale:depth",MAX_EXTENDS_DEPTH);return{}}const baseOverrides=flattenLocale(locale.extends??"en",depth+1);const own={};if(locale.messages){for(const key of Object.keys(locale.messages)){if(!isMessageKey(key)){console.warn("locale:message",key);continue}const value=locale.messages[key];if(typeof value==="string"){own[key]=value}}}return{...baseOverrides,...own}}console.warn("locale:type",typeof locale);return presetOverrides("en")}function resolveLocale(locale){const overrides=flattenLocale(locale,0);const out={...defaultMessages};for(const key of Object.keys(overrides)){if(!isMessageKey(key))continue;const value=overrides[key];if(typeof value==="string"){out[key]=value}}return out}function formatMessage(template,vars){if(typeof template!=="string")return"";if(!vars||Object.keys(vars).length===0)return template;return template.replace(/\{\{(\w+)\}\}/g,(match,name)=>{if(!Object.prototype.hasOwnProperty.call(vars,name)){return match}const value=vars[name];if(value===void 0||value===null)return match;return String(value)})}function t(messages,key,vars){const template=messages[key];if(typeof template!=="string")return key;return formatMessage(template,vars)}function coerceIndex(value){if(typeof value!=="number")return 0;if(!Number.isFinite(value))return 0;if(value<0)return 0;return Math.floor(value)}function coerceCount(value){if(typeof value!=="number")return 0;if(!Number.isFinite(value))return 0;if(value<0)return 0;return Math.floor(value)}function gridRootAttrs(input){return{role:input.tree===true?"treegrid":"grid","aria-rowcount":String(coerceCount(input.rowCount)),"aria-colcount":String(coerceCount(input.colCount)),"aria-busy":input.busy===true?"true":"false"}}function headerRowGroupAttrs(){return{role:"rowgroup"}}function bodyRowGroupAttrs(){return{role:"rowgroup"}}function headerRowAttrs(groupDepth=0){return{role:"row","aria-rowindex":coerceIndex(groupDepth)+1}}function bodyRowAttrs(rowIndex,options){const headerOffset=options&&typeof options.headerOffset==="number"?coerceIndex(options.headerOffset):0;const out={role:"row","aria-rowindex":coerceIndex(rowIndex)+2+headerOffset};if(options&&typeof options.isSelected==="boolean"){out["aria-selected"]=options.isSelected?"true":"false"}if(options&&options.emitRowIndex===true){out["data-row-index"]=String(coerceIndex(rowIndex))}return out}function ariaSortFromDirection(direction){if(direction==="asc")return"ascending";if(direction==="desc")return"descending";return"none"}function columnHeaderAttrs(input){return{role:"columnheader","aria-colindex":coerceIndex(input.colIndex)+1,"aria-sort":ariaSortFromDirection(input.sortDirection),"aria-label":typeof input.label==="string"?input.label:""}}function gridCellAttrs(input){return{role:"gridcell","aria-colindex":coerceIndex(input.colIndex)+1,tabindex:input.isActive===true?0:-1}}function isValidRowId$1(id){if(typeof id==="string")return id.length>0;if(typeof id==="number")return Number.isFinite(id);return false}function warnInvalidRowId$1(callerName){console.warn(`[Syidax] sy-grid: ${callerName} ignored invalid rowId.`)}function createSelectionState(mode){const safeMode=mode==="single"||mode==="multi"||mode==="none"?mode:"none";if(safeMode!==mode){console.warn(`[Syidax] sy-grid: unknown rowSelection mode "${String(mode)}", falling back to "none".`)}return{mode:safeMode,selectedRowIds:new Set}}function selectRow(state,rowId){if(!isValidRowId$1(rowId)){warnInvalidRowId$1("selectRow");return state}if(state.mode==="none")return state;if(state.mode==="single"){if(state.selectedRowIds.size===1&&state.selectedRowIds.has(rowId)){return state}const next2=new Set([rowId]);return{mode:state.mode,selectedRowIds:next2}}if(state.selectedRowIds.has(rowId))return state;const next=new Set(state.selectedRowIds);next.add(rowId);return{mode:state.mode,selectedRowIds:next}}function deselectRow(state,rowId){if(!isValidRowId$1(rowId)){warnInvalidRowId$1("deselectRow");return state}if(!state.selectedRowIds.has(rowId))return state;const next=new Set(state.selectedRowIds);next.delete(rowId);return{mode:state.mode,selectedRowIds:next}}function toggleRow(state,rowId){if(!isValidRowId$1(rowId)){warnInvalidRowId$1("toggleRow");return state}if(state.selectedRowIds.has(rowId)){return deselectRow(state,rowId)}return selectRow(state,rowId)}function clearSelection(state){if(state.selectedRowIds.size===0)return state;return{mode:state.mode,selectedRowIds:new Set}}function setSelectionMode(state,newMode){const safeMode=newMode==="single"||newMode==="multi"||newMode==="none"?newMode:"none";if(safeMode!==newMode){console.warn(`[Syidax] sy-grid: unknown rowSelection mode "${String(newMode)}", falling back to "none".`)}if(safeMode===state.mode){return state}if(safeMode==="none"){if(state.selectedRowIds.size===0){return{mode:"none",selectedRowIds:state.selectedRowIds}}return{mode:"none",selectedRowIds:new Set}}if(safeMode==="single"&&state.selectedRowIds.size>1){const iter=state.selectedRowIds.values();const first=iter.next();const next=new Set;if(!first.done)next.add(first.value);return{mode:"single",selectedRowIds:next}}return{mode:safeMode,selectedRowIds:state.selectedRowIds}}function selectRowsBatch(state,rowIds){if(!Array.isArray(rowIds)||rowIds.length===0)return state;if(state.mode==="none")return state;if(state.mode==="single"){let first;for(const candidate of rowIds){if(isValidRowId$1(candidate)){first=candidate;break}}if(rowIds.length>1){console.warn("[Syidax] sy-grid: selectRowsBatch in single mode kept only the first id.")}if(first===void 0){warnInvalidRowId$1("selectRowsBatch");return state}return selectRow(state,first)}let next=null;for(const id of rowIds){if(!isValidRowId$1(id)){warnInvalidRowId$1("selectRowsBatch");continue}if(state.selectedRowIds.has(id)&&next===null)continue;if(next===null){next=new Set(state.selectedRowIds)}next.add(id)}if(next===null)return state;return{mode:state.mode,selectedRowIds:next}}function deselectRowsBatch(state,rowIds){if(!Array.isArray(rowIds)||rowIds.length===0)return state;if(state.selectedRowIds.size===0){for(const id of rowIds){if(!isValidRowId$1(id)){warnInvalidRowId$1("deselectRowsBatch")}}return state}let next=null;for(const id of rowIds){if(!isValidRowId$1(id)){warnInvalidRowId$1("deselectRowsBatch");continue}if(!state.selectedRowIds.has(id))continue;if(next===null){next=new Set(state.selectedRowIds)}next.delete(id)}if(next===null)return state;return{mode:state.mode,selectedRowIds:next}}function headerCheckboxState(state,visibleRowIds){if(!Array.isArray(visibleRowIds)||visibleRowIds.length===0){return"none"}let selectedCount=0;let consideredCount=0;for(const id of visibleRowIds){if(!isValidRowId$1(id))continue;consideredCount++;if(state.selectedRowIds.has(id))selectedCount++}if(consideredCount===0)return"none";if(selectedCount===0)return"none";if(selectedCount===consideredCount)return"all";return"partial"}function findAnchorIndex(visibleRowIds,anchorRowId){if(anchorRowId===null)return null;if(!Array.isArray(visibleRowIds)||visibleRowIds.length===0)return null;if(!isValidRowId$1(anchorRowId))return null;for(let i=0;i<visibleRowIds.length;i++){if(visibleRowIds[i]===anchorRowId)return i}return null}function selectRange(input){const{state,visibleRowIds,anchorRowId,targetRowId}=input;const additive=input.additive===true;if(state.mode==="none")return state;if(!isValidRowId$1(targetRowId)){warnInvalidRowId$1("selectRange");return state}if(state.mode==="single"){return selectRow(state,targetRowId)}if(anchorRowId===null){return selectRow(state,targetRowId)}if(!Array.isArray(visibleRowIds)||visibleRowIds.length===0){console.warn("[Syidax] sy-grid: selectRange called with empty visibleRowIds, treating as plain click.");return selectRow(state,targetRowId)}const anchorIndex=findAnchorIndex(visibleRowIds,anchorRowId);if(anchorIndex===null){console.warn("[Syidax] sy-grid: selectRange anchor not visible, treating as plain click.");return selectRow(state,targetRowId)}let targetIndex=-1;for(let i=0;i<visibleRowIds.length;i++){if(visibleRowIds[i]===targetRowId){targetIndex=i;break}}if(targetIndex===-1){console.warn("[Syidax] sy-grid: selectRange target not in visibleRowIds, dropping.");return state}const lo=Math.min(anchorIndex,targetIndex);const hi=Math.max(anchorIndex,targetIndex);const rangeIds=[];for(let i=lo;i<=hi;i++){const id=visibleRowIds[i];if(isValidRowId$1(id))rangeIds.push(id)}if(rangeIds.length===0)return state;if(additive){let next=null;for(const id of rangeIds){if(state.selectedRowIds.has(id))continue;if(next===null){next=new Set(state.selectedRowIds)}next.add(id)}if(next===null)return state;return{mode:state.mode,selectedRowIds:next}}if(state.selectedRowIds.size===rangeIds.length){let identical=true;for(const id of rangeIds){if(!state.selectedRowIds.has(id)){identical=false;break}}if(identical)return state}return{mode:state.mode,selectedRowIds:new Set(rangeIds)}}function diffSelection(prev,next){const added=[];const removed=[];for(const id of next.selectedRowIds){if(!prev.selectedRowIds.has(id))added.push(id)}for(const id of prev.selectedRowIds){if(!next.selectedRowIds.has(id))removed.push(id)}return{addedIds:added,removedIds:removed}}const SELECTION_CHECKBOX_COLUMN=Object.freeze({kind:"selection-checkbox",width:40,field:"__sy_selection__",sortable:false,resizable:false,filter:false});function headerCheckboxAttrs(state,ariaLabel){const ariaChecked=state==="all"?"true":state==="partial"?"mixed":"false";const safeLabel=typeof ariaLabel==="string"&&ariaLabel.length>0?ariaLabel:"Select all visible rows";return{role:"checkbox","aria-checked":ariaChecked,"aria-label":safeLabel,tabindex:0}}function bodyCheckboxAttrs(isSelected,ariaLabel){const safeLabel=typeof ariaLabel==="string"&&ariaLabel.length>0?ariaLabel:"Select row";return{role:"checkbox","aria-checked":isSelected?"true":"false","aria-label":safeLabel,tabindex:0}}function isCheckboxToggleKey(event){if(event===null||event===void 0)return false;if(typeof event!=="object")return false;const key=event.key;if(typeof key!=="string")return false;return key===" "||key==="Spacebar"||key==="Enter"}function escapeTsvCell(raw,options={}){const text=neutralizeSpreadsheetText(raw,options);if(!/[\t\n\r"]/.test(text))return text;return`"${text.replace(/"/g,'""')}"`}function serializeBoundsToTsv(bounds,cellText,includeRow=()=>true,options={}){const lines=[];for(let row=bounds.top;row<=bounds.bottom;row++){if(!includeRow(row))continue;const cells=[];for(let col=bounds.left;col<=bounds.right;col++){cells.push(escapeTsvCell(cellText(row,col),options))}lines.push(cells.join(" "))}return lines.join("\n")}function serializeManyBoundsToTsv(list,cellText,includeRow=()=>true,options={}){const blocks=list.map(bounds=>serializeBoundsToTsv(bounds,cellText,includeRow,options)).filter(block=>block!=="");return blocks.join("\n")}function planPaste(matrix,top,left,ctx){const changes=[];let applied=0;let skipped=0;let displayRow=top;for(const line of matrix){while(displayRow<ctx.rowCount&&ctx.dataRowAt(displayRow)===null)displayRow++;if(displayRow>=ctx.rowCount){skipped+=line.length;continue}const row=ctx.dataRowAt(displayRow);const proto=Object.getPrototypeOf(row);const writableRow=proto===Object.prototype||proto===null;for(let j=0;j<line.length;j++){const col=ctx.colAt(left+j);if(!writableRow||col===void 0||col.editable!==true||col.computed){skipped++;continue}let value;try{value=ctx.coerce(line[j],left+j,row)}catch{skipped++;continue}applied++;const oldValue=readOwnFieldPath(row,col.field);if(!Object.is(oldValue,value)){changes.push({displayRow,colIndex:left+j,field:col.field,row,oldValue,newValue:value})}}displayRow++}return{changes,applied,skipped}}const STATUS_PANEL_IDS=Object.freeze(["totalRows","filteredRows","totalAndFilteredRows","selectedRows","aggregation"]);const ALIGNS=Object.freeze(["left","center","right"]);const DEFAULT_STATUS_PANELS=Object.freeze([{panel:"totalAndFilteredRows",align:"left"},{panel:"selectedRows",align:"right"},{panel:"aggregation",align:"right"}]);function resolveStatusBar(input){if(input===false||input===null||input===void 0)return null;if(input===true)return{panels:DEFAULT_STATUS_PANELS,invalid:[]};if(typeof input!=="object"){return{panels:DEFAULT_STATUS_PANELS,invalid:[`statusBar value "${String(input)}" is not boolean/object`]}}const panelsInput=input.panels;if(!Array.isArray(panelsInput)){return{panels:DEFAULT_STATUS_PANELS,invalid:["statusBar.panels is not an array"]}}const panels=[];const invalid=[];for(const entry of panelsInput){if(entry===null||typeof entry!=="object"){invalid.push(String(entry));continue}const id=entry.panel;if(typeof id!=="string"||!STATUS_PANEL_IDS.includes(id)){invalid.push(String(id));continue}const alignRaw=entry.align;const align=typeof alignRaw==="string"&&ALIGNS.includes(alignRaw)?alignRaw:"left";panels.push({panel:id,align})}return{panels,invalid}}const SIDE_BAR_PANEL_IDS=Object.freeze(["columns","filters"]);const DEFAULT_SIDE_BAR_PANELS=Object.freeze([{id:"columns"},{id:"filters"}]);function isPanelId(value){return typeof value==="string"&&SIDE_BAR_PANEL_IDS.includes(value)}function resolveSideBar(input){if(input===false||input===null||input===void 0)return null;if(input===true)return{panels:DEFAULT_SIDE_BAR_PANELS,defaultOpen:null,invalid:[]};if(typeof input==="string"){if(isPanelId(input))return{panels:[{id:input}],defaultOpen:input,invalid:[]};return{panels:DEFAULT_SIDE_BAR_PANELS,defaultOpen:null,invalid:[input]}}if(typeof input!=="object"){return{panels:DEFAULT_SIDE_BAR_PANELS,defaultOpen:null,invalid:[`sideBar value "${String(input)}" is not boolean/string/object`]}}const panelsInput=input.panels;const invalid=[];let panels;if(Array.isArray(panelsInput)){panels=[];const seen=new Set;for(const entry of panelsInput){const id=entry!==null&&typeof entry==="object"?entry.id:entry;if(!isPanelId(id)){invalid.push(String(id));continue}if(seen.has(id))continue;seen.add(id);panels.push({id})}}else if(panelsInput===void 0){panels=[...DEFAULT_SIDE_BAR_PANELS]}else{invalid.push("sideBar.panels is not an array");panels=[...DEFAULT_SIDE_BAR_PANELS]}const defaultOpenRaw=input.defaultOpen;let defaultOpen=null;if(defaultOpenRaw!==void 0&&defaultOpenRaw!==null){if(isPanelId(defaultOpenRaw)&&panels.some(p=>p.id===defaultOpenRaw)){defaultOpen=defaultOpenRaw}else{invalid.push(`defaultOpen: ${String(defaultOpenRaw)}`)}}return{panels,defaultOpen,invalid}}function normalizeRange(range){return{top:Math.min(range.anchorRow,range.focusRow),left:Math.min(range.anchorCol,range.focusCol),bottom:Math.max(range.anchorRow,range.focusRow),right:Math.max(range.anchorCol,range.focusCol)}}const sanitizeIndex=raw=>Number.isFinite(raw)?Math.max(0,Math.floor(raw)):0;const sanitizeCell=cell=>{const row=sanitizeIndex(cell.row);const col=sanitizeIndex(cell.col);return row===cell.row&&col===cell.col?cell:{row,col}};function addCanonicalRange(set,anchor,focus){const cleanAnchor=sanitizeCell(anchor);const range={id:set.nextId,anchor:cleanAnchor,focus:focus===void 0?cleanAnchor:sanitizeCell(focus)};return{set:{ranges:[...set.ranges,range],nextId:set.nextId+1},changes:[{kind:"added",id:range.id,range}]}}function toLegacyRanges(set){return set.ranges.map(range=>({anchorRow:range.anchor.row,anchorCol:range.anchor.col,focusRow:range.focus.row,focusCol:range.focus.col}))}const ROW_EDIT_ROW_KINDS=Object.freeze(["normal","pinned-top","pinned-bottom","group","master","detail","ssrm-loaded","ssrm-unloaded"]);const ROW_EDIT_SUPPORT=Object.freeze({"normal":"editable","pinned-top":"editable","pinned-bottom":"editable","group":"read-only-row","master":"editable","detail":"editable","ssrm-loaded":"editable","ssrm-unloaded":"unsupported"});const ROW_EDIT_STOP_REASONS=Object.freeze(["enter","tab","escape","blur","mouse","api","replacement","virtual-scroll","disconnect"]);const ROW_EDIT_STOP_ROUTES=Object.freeze({"enter":"commit","tab":"commit","escape":"cancel","blur":"blur-policy","mouse":"blur-policy","api":"commit","replacement":"cancel","virtual-scroll":"cancel","disconnect":"cancel"});const EMPTY_PENDING=new Map;const NO_REJECTED=Object.freeze([]);const NO_ACCEPTED=Object.freeze([]);const isValidKeyPart=part=>typeof part==="string"&&part.length>0||typeof part==="number"&&Number.isFinite(part);const isValidCoord$1=raw=>typeof raw==="number"&&Number.isInteger(raw)&&raw>=0;const supportFor=rowKind=>ROW_EDIT_ROW_KINDS.includes(rowKind)?ROW_EDIT_SUPPORT[rowKind]:"unsupported";const normalizeReason=reason=>ROW_EDIT_STOP_REASONS.includes(reason)?reason:"api";const resolveRoute=(reason,stopOnBlur)=>{const route=ROW_EDIT_STOP_ROUTES[reason];if(route!=="blur-policy")return route;return stopOnBlur==="cancel"?"cancel":"commit"};const isThenable=value=>typeof value==="object"&&value!==null&&typeof value.then==="function";const verdictAllows=verdict=>typeof verdict==="object"&&verdict!==null&&verdict.ok===true;const stagedInColumnOrder=session=>{const cells=[];for(let index2=0;index2<session.editableColIds.length;index2+=1){const cell=session.pending.get(index2);if(cell!==void 0)cells.push(cell)}return cells};const gateCell=(rowId,cell,context)=>{const rbac=context.rbac??null;if(rbac!==null&&rbac(rowId,cell.colId)!=="allow")return"rbac";const validate=context.validate??null;if(validate!==null){let verdict;try{verdict=validate(rowId,cell.colId,cell.value)}catch{return"validation"}if(!verdictAllows(verdict))return"validation"}return null};const normalizeRowVerdict=verdict=>{if(verdictAllows(verdict))return{ok:true};const shaped=typeof verdict==="object"&&verdict!==null&&!isThenable(verdict)?verdict:{};const cellReasons=typeof shaped.cellReasons==="object"&&shaped.cellReasons!==null?shaped.cellReasons:null;const rowReason=typeof shaped.rowReason==="string"?shaped.rowReason:null;return{cellReasons,rowReason}};const rejectionsFromRowVerdict=(invalid,rowId,staged)=>{if(invalid.cellReasons===null)return NO_REJECTED;const rejected2=[];for(const cell of staged){const reason=invalid.cellReasons[`${cell.colId}`];if(typeof reason==="string"){rejected2.push({rowId,colId:cell.colId,colIndex:cell.colIndex,reason:"validation",detail:reason})}}return rejected2.length===0?NO_REJECTED:rejected2};const sealRowPlan=input=>{const{mutationId,status,session}=input;const readCurrent=input.readCurrent??(()=>void 0);const commitWrites=[];const undoWrites=[];const recordWrites=[];const oldRow={};const newRow={};const events=[{type:"rowEditStart",detail:{mutationId,sessionId:session.sessionId,rowId:session.rowId,rowKind:session.rowKind,displayRow:session.displayRow,stagedCount:input.stagedCount}}];for(const cell of input.accepted){const oldValue=readCurrent(session.rowId,cell.colId);events.push({type:"cellValueChanged",detail:{mutationId,rowId:session.rowId,colId:cell.colId,colIndex:cell.colIndex,oldValue,newValue:cell.value,excludedReason:null}});commitWrites.push({rowId:session.rowId,colId:cell.colId,colIndex:cell.colIndex,value:cell.value,oldValue});undoWrites.push({rowId:session.rowId,colId:cell.colId,colIndex:cell.colIndex,value:oldValue});recordWrites.push({rowId:session.rowId,colId:cell.colId,colIndex:cell.colIndex,oldValue,newValue:cell.value});oldRow[`${cell.colId}`]=oldValue;newRow[`${cell.colId}`]=cell.value}if(status==="committed"){events.push({type:"rowValueChanged",detail:{mutationId,rowId:session.rowId,writtenCount:commitWrites.length,oldRow,newRow}})}const endDetail=status==="cancelled"?{mutationId,status,writtenCount:0,rejectedCells:input.rejectedCells,reason:input.cancel?.reason,droppedCount:input.cancel?.droppedCount??0}:{mutationId,status,writtenCount:commitWrites.length,rejectedCells:input.rejectedCells};events.push({type:"rowEditEnd",detail:endDetail});return{status,mutationId,events,commit:{writes:commitWrites},undo:{writes:undoWrites},rejectedCells:input.rejectedCells,mutationRecord:{mutationId,kind:"row-edit",sessionId:session.sessionId,rowId:session.rowId,rowKind:session.rowKind,writes:recordWrites,rejectedCells:input.rejectedCells,timestampSlot:null}}};const foldCommit=(session,context)=>{const staged=stagedInColumnOrder(session);const gateRejectedList=[];for(const cell of staged){const reason=gateCell(session.rowId,cell,context);if(reason!==null){gateRejectedList.push({rowId:session.rowId,colId:cell.colId,colIndex:cell.colIndex,reason,detail:null})}}const gateRejected=gateRejectedList.length===0?NO_REJECTED:gateRejectedList;if(gateRejected.length>0||!context.validateRow){return{staged,gateRejected,rowVerdictRaw:{ok:true},rowThrew:false}}const entries=staged.map(cell=>({colId:cell.colId,colIndex:cell.colIndex,value:cell.value,oldValue:cell.oldValue}));try{return{staged,gateRejected,rowVerdictRaw:context.validateRow(session.rowId,entries),rowThrew:false}}catch{return{staged,gateRejected,rowVerdictRaw:null,rowThrew:true}}};function createRowEditState(){return{session:null,nextSessionId:1}}function isRowEditing(state){return state.session!==null}function startRowEdit(state,input){if(state.session!==null){return{state,result:{kind:"ignored",ignored:"row-edit-live"}}}const colIds=Array.isArray(input.editableColIds)?input.editableColIds:null;const validCols=colIds!==null&&colIds.length>0&&colIds.every(isValidKeyPart)&&new Set(colIds).size===colIds.length;if(!isValidKeyPart(input.rowId)||!isValidCoord$1(input.displayRow)||!validCols){return{state,result:{kind:"ignored",ignored:"invalid-row"}}}const support=supportFor(input.rowKind);if(support!=="editable"){return{state,result:{kind:"ignored",ignored:"row-not-editable",rowKind:input.rowKind,support}}}const editableColIds=Object.freeze([...colIds]);const startIndex=input.startColId===void 0?0:editableColIds.findIndex(colId=>colId===input.startColId);const session={sessionId:state.nextSessionId,rowId:input.rowId,displayRow:input.displayRow,rowKind:input.rowKind,editableColIds,activeColIndex:startIndex>=0?startIndex:0,pending:EMPTY_PENDING};return{state:{session,nextSessionId:state.nextSessionId+1},result:{kind:"started",session}}}function stageRowCell(state,colId,value,oldValue){const session=state.session;if(session===null){return{state,staged:{kind:"ignored",ignored:"no-row-edit"}}}const colIndex=session.editableColIds.findIndex(id=>id===colId);if(colIndex<0){return{state,staged:{kind:"ignored",ignored:"column-not-editable"}}}const existing=session.pending.get(colIndex)??null;const cell=existing===null?{colId:session.editableColIds[colIndex],colIndex,value,oldValue}:{...existing,value};const pending=new Map(session.pending);pending.set(colIndex,cell);return{state:{session:{...session,pending},nextSessionId:state.nextSessionId},staged:{kind:"staged",cell,replaced:existing!==null}}}function stopRowEdit(state,context){const session=state.session;if(session===null){return{state,result:{kind:"ignored",ignored:"no-row-edit"}}}const reason=normalizeReason(context.reason);const route=resolveRoute(reason,context.stopOnBlur);const mutationId=context.mintMutationId();const terminated={session:null,nextSessionId:state.nextSessionId};if(route==="cancel"){const droppedCount=session.pending.size;const plan2=sealRowPlan({status:"cancelled",mutationId,session,stagedCount:droppedCount,accepted:NO_ACCEPTED,rejectedCells:NO_REJECTED,cancel:{reason,droppedCount}});return{state:terminated,result:{kind:"cancelled",reason,plan:plan2,droppedCount}}}const fold=foldCommit(session,context);if(fold.gateRejected.length>0){const plan2=sealRowPlan({status:"rejected",mutationId,session,stagedCount:fold.staged.length,accepted:NO_ACCEPTED,rejectedCells:fold.gateRejected});return{state,result:{kind:"rejected",reason,plan:plan2,rowInvalid:null}}}const rowVerdict=fold.rowThrew?normalizeRowVerdict(null):normalizeRowVerdict(fold.rowVerdictRaw);if(!("ok"in rowVerdict)){const plan2=sealRowPlan({status:"rejected",mutationId,session,stagedCount:fold.staged.length,accepted:NO_ACCEPTED,rejectedCells:rejectionsFromRowVerdict(rowVerdict,session.rowId,fold.staged)});return{state,result:{kind:"rejected",reason,plan:plan2,rowInvalid:rowVerdict}}}const plan=sealRowPlan({status:"committed",mutationId,session,stagedCount:fold.staged.length,accepted:fold.staged,rejectedCells:NO_REJECTED,readCurrent:context.readCurrent});return{state:terminated,result:{kind:"committed",reason,plan}}}function isValidRowId(id){if(typeof id==="string")return id.length>0;if(typeof id==="number")return Number.isFinite(id);return false}function warnInvalidRowId(callerName){console.warn(`[Syidax] sy-grid: ${callerName} ignored invalid rowId.`)}function createHoverState(){return{hoveredRowId:null}}function setHoveredRow(state,rowId){if(rowId===null){return clearHoveredRow(state)}if(!isValidRowId(rowId)){warnInvalidRowId("setHoveredRow");return state}if(state.hoveredRowId===rowId)return state;return{hoveredRowId:rowId}}function clearHoveredRow(state){if(state.hoveredRowId===null)return state;return{hoveredRowId:null}}function isValidCoord(n){return typeof n==="number"&&Number.isFinite(n)&&Number.isInteger(n)&&n>=0}function warnEdit(callerName,reason){console.warn(`[Syidax] sy-grid: ${callerName} ${reason}`)}function normaliseMeta(meta,callerName){if(meta===void 0)return{};if(meta===null||typeof meta!=="object"||Array.isArray(meta)){warnEdit(callerName,"received malformed meta; coerced to {}.");return{}}return{...meta}}function createEditStore(){return{active:null,nextId:1}}function beginEdit(store,options){const{rowIndex,colIndex,originalValue,meta}=options;if(!isValidCoord(rowIndex)||!isValidCoord(colIndex)){warnEdit("beginEdit","ignored invalid coords.");return store}if(store.active!==null){warnEdit("beginEdit","while another transaction is pending; ignoring.");return store}const tx={rowIndex,colIndex,originalValue,draftValue:originalValue,phase:"pending",id:store.nextId,meta:normaliseMeta(meta,"beginEdit")};return{active:tx,nextId:store.nextId}}function setDraft(store,draftValue){if(store.active===null){warnEdit("setDraft","called with no active transaction; ignoring.");return store}if(store.active.phase!=="pending"){warnEdit("setDraft",`called on a transaction in phase '${store.active.phase}'; ignoring.`);return store}if(store.active.draftValue===draftValue)return store;const next={...store.active,draftValue};return{active:next,nextId:store.nextId}}function commitEdit(store){if(store.active===null)return store;if(store.active.phase!=="pending")return store;const next={...store.active,phase:"committed"};return{active:next,nextId:store.nextId}}function cancelEdit(store){if(store.active===null)return store;if(store.active.phase!=="pending")return store;const next={...store.active,phase:"cancelled"};return{active:next,nextId:store.nextId}}function clearEdit(store){if(store.active===null)return store;if(store.active.phase==="pending"){warnEdit("clearEdit","called on a 'pending' transaction; resolve it first.");return store}return{active:null,nextId:store.nextId+1}}let TX_COUNTER=0;function allocateTxId(){TX_COUNTER=TX_COUNTER+1;return TX_COUNTER}function warnTx(callerName,reason){console.warn(`[Syidax] sy-grid: ${callerName} ${reason}`)}function asArray(input){return Array.isArray(input)?input:[]}function resolveId(row,getRowId){if(row===null||row===void 0||typeof row!=="object"){return{ok:false,reason:"row is not an object"}}const fn=getRowId??(r=>r["id"]);let id;try{id=fn(row)}catch{warnTx("applyRowTransaction","getRowId threw; row rejected.");return{ok:false,reason:"getRowId threw"}}if(typeof id==="string"&&id.length>0)return{ok:true,id};if(typeof id==="number"&&Number.isFinite(id))return{ok:true,id};return{ok:false,reason:"missing id"}}function runValidate(row,validate){if(typeof validate!=="function")return{valid:true};let result;try{result=validate(row)}catch{warnTx("applyRowTransaction","validate threw; row rejected.");return{valid:false,reason:"validate threw"}}if(result===null||typeof result!=="object")return{valid:true};if(result.valid===false){return{valid:false,reason:typeof result.reason==="string"&&result.reason.length>0?result.reason:"invalid"}}return{valid:true}}function resolveAddIndex(addIndex,length){if(typeof addIndex!=="number"||!Number.isFinite(addIndex))return length;if(!Number.isInteger(addIndex))return length;if(addIndex<0)return length;if(addIndex>length)return length;return addIndex}function applyRowTransaction(rows,transaction,options={}){TX_COUNTER=TX_COUNTER+1;const txId=TX_COUNTER;const timestamp=Date.now();const baseRows=Array.isArray(rows)?rows.slice():[];const added=[];const updated=[];const removed=[];const rejected2=[];if(transaction===null||transaction===void 0){warnTx("applyRowTransaction","received null/undefined transaction; no-op.");return{rows:baseRows,added,updated,removed,rejected:rejected2,meta:{txId,timestamp}}}const{getRowId,validate}=options;const removeList=asArray(transaction.remove);const updateList=asArray(transaction.update);const addList=asArray(transaction.add);const idToIndex=new Map;for(let i=0;i<baseRows.length;i++){const r=baseRows[i];const idResult=resolveId(r,getRowId);if(idResult.ok)idToIndex.set(idResult.id,i)}let working=baseRows;if(removeList.length>0){const removeIndices=[];const seenRemove=new Set;for(let i=0;i<removeList.length;i++){const entry=removeList[i];const idResult=resolveId(entry,getRowId);if(!idResult.ok){const reason=idResult.reason;rejected2.push({kind:"remove",row:entry,reason:reason==="missing id"?"remove missing id":reason});continue}if(seenRemove.has(idResult.id)){rejected2.push({kind:"remove",row:entry,reason:"duplicate id"});continue}const idx=idToIndex.get(idResult.id);if(idx===void 0){rejected2.push({kind:"remove",row:entry,reason:"unknown id"});continue}seenRemove.add(idResult.id);removeIndices.push(idx)}if(removeIndices.length>0){const sortedAsc=removeIndices.slice().sort((a,b)=>a-b);for(let i=0;i<sortedAsc.length;i++){const at=sortedAsc[i];removed.push({row:working[at],index:at})}const next=working.slice();const sortedDesc=removeIndices.slice().sort((a,b)=>b-a);for(let i=0;i<sortedDesc.length;i++){next.splice(sortedDesc[i],1)}working=next;idToIndex.clear();for(let i=0;i<working.length;i++){const r=working[i];const idResult=resolveId(r,getRowId);if(idResult.ok)idToIndex.set(idResult.id,i)}}}if(updateList.length>0){let mutated=false;const next=working.slice();for(let i=0;i<updateList.length;i++){const patch=updateList[i];if(patch===null||patch===void 0||typeof patch!=="object"){rejected2.push({kind:"update",row:patch,reason:"update missing id"});continue}const idResult=resolveId(patch,getRowId);if(!idResult.ok){const reason=idResult.reason;rejected2.push({kind:"update",row:patch,reason:reason==="missing id"?"update missing id":reason});continue}const idx=idToIndex.get(idResult.id);if(idx===void 0){rejected2.push({kind:"update",row:patch,reason:"unknown id"});continue}const previous=next[idx];const merged={...previous,...patch};const v=runValidate(merged,validate);if(!v.valid){const reason=v.reason;rejected2.push({kind:"update",row:patch,reason});continue}next[idx]=merged;updated.push({row:merged,previous,index:idx});mutated=true}if(mutated)working=next}if(addList.length>0){const addIndex=resolveAddIndex(transaction.addIndex,working.length);const seenAddIds=new Set;const accepted=[];for(let i=0;i<addList.length;i++){const row=addList[i];const idResult=resolveId(row,getRowId);if(!idResult.ok){const reason=idResult.reason;rejected2.push({kind:"add",row,reason});continue}if(idToIndex.has(idResult.id)||seenAddIds.has(idResult.id)){rejected2.push({kind:"add",row,reason:"duplicate id"});continue}const v=runValidate(row,validate);if(!v.valid){const reason=v.reason;rejected2.push({kind:"add",row,reason});continue}seenAddIds.add(idResult.id);accepted.push({row,id:idResult.id})}if(accepted.length>0){const next=working.slice();for(let i=0;i<accepted.length;i++){const at=addIndex+i;next.splice(at,0,accepted[i].row);added.push({row:accepted[i].row,index:at})}working=next}}return{rows:working,added,updated,removed,rejected:rejected2,meta:{txId,timestamp}}}function invertTransactionResult(result){const inverse={};if(result.added.length>0){inverse.remove=result.added.map(entry=>entry.row)}if(result.removed.length>0){const sorted=result.removed.slice().sort((a,b)=>a.index-b.index);inverse.add=sorted.map(entry=>entry.row);inverse.addIndex=sorted[0].index}if(result.updated.length>0){inverse.update=result.updated.map(entry=>entry.previous)}return inverse}const DEFAULT_MAX_DEPTH=100;let UNDO_ID_COUNTER=0;function warnUndo(callerName,reason){console.warn(`[Syidax] sy-grid: ${callerName} ${reason}`)}function resolveMaxDepth(input){if(typeof input!=="number")return DEFAULT_MAX_DEPTH;if(!Number.isFinite(input))return DEFAULT_MAX_DEPTH;if(input<=0)return DEFAULT_MAX_DEPTH;if(!Number.isInteger(input))return DEFAULT_MAX_DEPTH;return input}function resolveNow(input){return typeof input==="function"?input:()=>Date.now()}function isValidTransaction(input){return input!==null&&input!==void 0&&typeof input==="object"}function createUndoRedoStack(opts={}){const maxDepth=resolveMaxDepth(opts.maxDepth);const now=resolveNow(opts.now);const undoStack=[];const redoStack=[];const listeners=new Set;function emit(event){const snapshot=Array.from(listeners);for(let i=0;i<snapshot.length;i++){const listener=snapshot[i];try{listener(event)}catch{warnUndo("undo-redo","subscriber threw; continuing.")}}}function getDepth(){return{undo:undoStack.length,redo:redoStack.length}}function record(forward,inverse,label){if(!isValidTransaction(forward)||!isValidTransaction(inverse)){warnUndo("record","received null/undefined transaction; rejected.");return}UNDO_ID_COUNTER=UNDO_ID_COUNTER+1;const entry={forward,inverse,label,timestamp:now(),id:UNDO_ID_COUNTER};undoStack.push(entry);while(undoStack.length>maxDepth){undoStack.shift()}if(redoStack.length>0)redoStack.length=0;emit({kind:"recorded",entry,depth:getDepth()})}function undo(){if(undoStack.length===0)return null;const entry=undoStack.pop();redoStack.push(entry);emit({kind:"undone",entry,depth:getDepth()});return entry}function redo(){if(redoStack.length===0)return null;const entry=redoStack.pop();undoStack.push(entry);emit({kind:"redone",entry,depth:getDepth()});return entry}function peek2(){return{undoTop:undoStack.length>0?undoStack[undoStack.length-1]:null,redoTop:redoStack.length>0?redoStack[redoStack.length-1]:null}}function canUndo(){return undoStack.length>0}function canRedo(){return redoStack.length>0}function clear(){if(undoStack.length===0&&redoStack.length===0)return;undoStack.length=0;redoStack.length=0;emit({kind:"cleared"})}function subscribe(listener){if(typeof listener!=="function"){warnUndo("subscribe","listener is not a function; ignored.");return()=>void 0}listeners.add(listener);return()=>{listeners.delete(listener)}}return{record,undo,redo,peek:peek2,canUndo,canRedo,clear,getDepth,subscribe}}function createColumnResizeController(opts={}){const DEFAULT_MIN_WIDTH=0;const DEFAULT_MAX_WIDTH=Number.POSITIVE_INFINITY;function resolveMinWidth(input){if(typeof input!=="number")return DEFAULT_MIN_WIDTH;if(!Number.isFinite(input))return DEFAULT_MIN_WIDTH;if(input<0)return DEFAULT_MIN_WIDTH;return input}function resolveMaxWidth(input){if(typeof input!=="number")return DEFAULT_MAX_WIDTH;if(Number.isNaN(input))return DEFAULT_MAX_WIDTH;if(input<=0)return DEFAULT_MAX_WIDTH;return input}function resolveNow2(input){return typeof input==="function"?input:()=>Date.now()}const minWidth=resolveMinWidth(opts.minWidth);const maxWidth=resolveMaxWidth(opts.maxWidth);const now=resolveNow2(opts.now);let active=null;const startedListeners=new Set;const movedListeners=new Set;const committedListeners=new Set;const cancelledListeners=new Set;function warnResize(callerName,reason){console.warn(`[Syidax] sy-grid: column-resize ${callerName} ${reason}`)}function clampWidth(width,lo,hi){let w=width;if(w<lo)w=lo;if(w>hi)w=hi;return w}function isFiniteNumber2(input){return typeof input==="number"&&Number.isFinite(input)}function resolvePerCallMin(input){if(input===void 0)return null;if(typeof input!=="number"||!Number.isFinite(input)||input<0){warnResize("start","received invalid per-call minWidth; using controller default.");return null}return input}function resolvePerCallMax(input){if(input===void 0)return null;if(typeof input!=="number"||!Number.isFinite(input)||input<=0){warnResize("start","received invalid per-call maxWidth; using controller default.");return null}return input}function emitStarted(event){const snapshot=Array.from(startedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnResize("emit","subscriber on 'started' threw; continuing.")}}}function emitMoved(event){const snapshot=Array.from(movedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnResize("emit","subscriber on 'moved' threw; continuing.")}}}function emitCommitted(event){const snapshot=Array.from(committedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnResize("emit","subscriber on 'committed' threw; continuing.")}}}function emitCancelled(event){const snapshot=Array.from(cancelledListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnResize("emit","subscriber on 'cancelled' threw; continuing.")}}}function start(input){let colId=input.colId;if(colId===null||colId===void 0){warnResize("start",'received null/undefined colId; coerced to "<unknown>".');colId="<unknown>"}let startWidth=input.startWidth;if(!isFiniteNumber2(startWidth)||startWidth<0){warnResize("start","received non-finite/negative startWidth; coerced to 0.");startWidth=0}let startX=input.startX;if(!isFiniteNumber2(startX)){warnResize("start","received non-finite startX; coerced to 0.");startX=0}const perCallMin=resolvePerCallMin(input.minWidth);const perCallMax=resolvePerCallMax(input.maxWidth);let effectiveMin=perCallMin===null?minWidth:perCallMin;let effectiveMax=perCallMax===null?maxWidth:perCallMax;if(effectiveMin>effectiveMax){warnResize("start","minWidth > maxWidth; dropping both per-call overrides.");effectiveMin=minWidth;effectiveMax=maxWidth}const initialWidth=clampWidth(startWidth,effectiveMin,effectiveMax);active={colId,startWidth:initialWidth,startX,lastX:startX,currentWidth:initialWidth,effectiveMin,effectiveMax,wasClamped:false};emitStarted({colId,startWidth:initialWidth,startX,timestamp:now()})}function move(input){if(active===null){warnResize("move","called with no active drag; ignored.");return null}let x=input.x;if(!isFiniteNumber2(x)){warnResize("move","received non-finite x; falling back to lastX.");x=active.lastX}const delta=x-active.startX;const rawWidth=active.startWidth+delta;const nextWidth=clampWidth(rawWidth,active.effectiveMin,active.effectiveMax);const wasClamped=nextWidth!==rawWidth;active.lastX=x;active.currentWidth=nextWidth;active.wasClamped=wasClamped;emitMoved({colId:active.colId,width:nextWidth,x,wasClamped});return{colId:active.colId,width:nextWidth,wasClamped}}function commit(){if(active===null)return null;const result={colId:active.colId,oldWidth:active.startWidth,newWidth:active.currentWidth};const colId=active.colId;active=null;emitCommitted({colId,oldWidth:result.oldWidth,newWidth:result.newWidth,timestamp:now()});return result}function cancel(){if(active===null)return null;const result={colId:active.colId,oldWidth:active.startWidth};const colId=active.colId;active=null;emitCancelled({colId,oldWidth:result.oldWidth,timestamp:now()});return result}function revert(){if(active===null)return null;const result={colId:active.colId,startWidth:active.startWidth};const colId=active.colId;const oldWidth=active.startWidth;active=null;emitCancelled({colId,oldWidth,timestamp:now()});return result}function isActive(){return active!==null}function getActive(){if(active===null)return null;return{colId:active.colId,startWidth:active.startWidth,currentWidth:active.currentWidth,wasClamped:active.wasClamped,effectiveMin:active.effectiveMin,effectiveMax:active.effectiveMax}}function subscribe(channel,listener){if(typeof listener!=="function"){warnResize("subscribe","listener is not a function; ignored.");return()=>void 0}if(channel==="started"){const set=startedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="moved"){const set=movedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="committed"){const set=committedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="cancelled"){const set=cancelledListeners;set.add(listener);return()=>{set.delete(listener)}}warnResize("subscribe",`unknown channel "${String(channel)}"; ignored.`);return()=>void 0}return{start,move,commit,cancel,revert,isActive,getActive,subscribe}}function createColumnReorderController(opts={}){let active=null;const startedListeners=new Set;const movedListeners=new Set;const committedListeners=new Set;const cancelledListeners=new Set;function warnReorder(callerName,reason){console.warn(`[Syidax] sy-grid: column-reorder ${callerName} ${reason}`)}function clampIndex(value,length){let i=Math.trunc(value);if(i<0)i=0;if(i>length-1)i=length-1;return i}function isFiniteNumber2(input){return typeof input==="number"&&Number.isFinite(input)}function reorderArray(source,from,to){const out=source.slice();const[picked]=out.splice(from,1);out.splice(to,0,picked);return out}function emitStarted(event){const snapshot=Array.from(startedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnReorder("emit","subscriber on 'started' threw; continuing.")}}}function emitMoved(event){const snapshot=Array.from(movedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnReorder("emit","subscriber on 'moved' threw; continuing.")}}}function emitCommitted(event){const snapshot=Array.from(committedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnReorder("emit","subscriber on 'committed' threw; continuing.")}}}function emitCancelled(event){const snapshot=Array.from(cancelledListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnReorder("emit","subscriber on 'cancelled' threw; continuing.")}}}function start(input){if(!Array.isArray(input.columnIds)){warnReorder("start","received non-array columnIds; ignored.");return}if(input.columnIds.length===0){warnReorder("start","received empty columnIds; ignored.");return}const snapshot=input.columnIds.slice();const originIndex=snapshot.indexOf(input.colId);if(originIndex===-1){warnReorder("start","colId not found in columnIds; ignored.");return}active={colId:input.colId,originIndex,currentIndex:originIndex,columnIds:snapshot};emitStarted({kind:"started",colId:input.colId,originIndex})}function move(input){if(active===null){warnReorder("move","called with no active drag; ignored.");return null}if(!isFiniteNumber2(input.targetIndex)){warnReorder("move","received non-finite targetIndex; ignored.");return null}const clamped=clampIndex(input.targetIndex,active.columnIds.length);const from=active.currentIndex;if(clamped===from)return null;active.currentIndex=clamped;emitMoved({kind:"moved",colId:active.colId,fromIndex:from,toIndex:clamped});return{fromIndex:from,toIndex:clamped}}function commit(){if(active===null)return null;const colId=active.colId;const originIndex=active.originIndex;const finalIndex=active.currentIndex;const orderBefore=active.columnIds;const orderAfter=finalIndex===originIndex?orderBefore.slice():reorderArray(orderBefore,originIndex,finalIndex);active=null;emitCommitted({kind:"committed",colId,originIndex,finalIndex,orderBefore,orderAfter});return{colId,originIndex,finalIndex,orderBefore,orderAfter}}function cancel(){if(active===null)return null;const result={colId:active.colId,originIndex:active.originIndex};const colId=active.colId;const originIndex=active.originIndex;active=null;emitCancelled({kind:"cancelled",colId,originIndex});return result}function isActive(){return active!==null}function getActive(){if(active===null)return null;return{draggedColId:active.colId,originIndex:active.originIndex,currentIndex:active.currentIndex,columnIdsAtStart:active.columnIds}}function subscribe(channel,listener){if(typeof listener!=="function"){warnReorder("subscribe","listener is not a function; ignored.");return()=>void 0}if(channel==="started"){const set=startedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="moved"){const set=movedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="committed"){const set=committedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="cancelled"){const set=cancelledListeners;set.add(listener);return()=>{set.delete(listener)}}warnReorder("subscribe",`unknown channel "${String(channel)}"; ignored.`);return()=>void 0}return{start,move,commit,cancel,isActive,getActive,subscribe}}function createColumnVisibilityController(opts={}){const hidden=new Set;const changedListeners=new Set;const resetListeners=new Set;function warnVisibility(callerName,reason){console.warn(`[Syidax] sy-grid: column-visibility ${callerName} ${reason}`)}function isLikelyValidColId(input){return typeof input==="string"&&input.length>0}function snapshotHidden(){return new Set(hidden)}function emitChanged(event){const snapshot=Array.from(changedListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnVisibility("emit","subscriber on 'changed' threw; continuing.")}}}function emitReset(event){const snapshot=Array.from(resetListeners);for(let i=0;i<snapshot.length;i++){try{snapshot[i](event)}catch{warnVisibility("emit","subscriber on 'reset' threw; continuing.")}}}function hide(colId){if(!isLikelyValidColId(colId)){warnVisibility("hide",`received non-string colId "${String(colId)}"; ignored.`);return}if(hidden.has(colId))return;hidden.add(colId);emitChanged({kind:"changed",colId,hidden:true,hiddenIds:snapshotHidden()})}function show(colId){if(!isLikelyValidColId(colId)){warnVisibility("show",`received non-string colId "${String(colId)}"; ignored.`);return}if(!hidden.has(colId))return;hidden.delete(colId);emitChanged({kind:"changed",colId,hidden:false,hiddenIds:snapshotHidden()})}function toggle(colId){if(!isLikelyValidColId(colId)){warnVisibility("toggle",`received non-string colId "${String(colId)}"; ignored.`);return hidden.has(colId)}const wasHidden=hidden.has(colId);if(wasHidden){hidden.delete(colId);emitChanged({kind:"changed",colId,hidden:false,hiddenIds:snapshotHidden()});return false}hidden.add(colId);emitChanged({kind:"changed",colId,hidden:true,hiddenIds:snapshotHidden()});return true}function setHidden(colIds){if(!Array.isArray(colIds)){warnVisibility("setHidden","received non-array input; ignored.");return}const nextSet=new Set;let skipped=0;for(let i=0;i<colIds.length;i++){const id=colIds[i];if(!isLikelyValidColId(id)){skipped++;continue}nextSet.add(id)}if(skipped>0){warnVisibility("setHidden",`skipped ${skipped} non-string entr${skipped===1?"y":"ies"} in input.`)}const newlyHidden=[];for(const id of nextSet){if(!hidden.has(id))newlyHidden.push(id)}const newlyShown=[];for(const id of hidden){if(!nextSet.has(id))newlyShown.push(id)}if(newlyHidden.length===0&&newlyShown.length===0){return}for(let i=0;i<newlyHidden.length;i++){const id=newlyHidden[i];hidden.add(id);emitChanged({kind:"changed",colId:id,hidden:true,hiddenIds:snapshotHidden()})}for(let i=0;i<newlyShown.length;i++){const id=newlyShown[i];hidden.delete(id);emitChanged({kind:"changed",colId:id,hidden:false,hiddenIds:snapshotHidden()})}}function reset(){if(hidden.size===0)return;hidden.clear();emitReset({kind:"reset",hiddenIds:snapshotHidden()})}function isHidden(colId){return hidden.has(colId)}function getHidden(){return snapshotHidden()}function subscribe(channel,listener){if(typeof listener!=="function"){warnVisibility("subscribe","listener is not a function; ignored.");return()=>void 0}if(channel==="changed"){const set=changedListeners;set.add(listener);return()=>{set.delete(listener)}}if(channel==="reset"){const set=resetListeners;set.add(listener);return()=>{set.delete(listener)}}warnVisibility("subscribe",`unknown channel "${String(channel)}"; ignored.`);return()=>void 0}return{hide,show,toggle,setHidden,reset,isHidden,getHidden,subscribe}}function measureAutoSizeWidth(input,opts={}){const DEFAULT_PADDING=16;let warnedThisCall=false;function warnAutoSize(reason){if(warnedThisCall)return;warnedThisCall=true;console.warn(`[Syidax] sy-grid: column-auto-size measureAutoSizeWidth ${reason}`)}let headerText;if(typeof input.headerText==="string"){headerText=input.headerText}else if(input.headerText===void 0||input.headerText===null){headerText=""}else{warnAutoSize(`received non-string headerText (${typeof input.headerText}); coerced to "".`);headerText=""}let cellTexts;if(Array.isArray(input.cellTexts)){cellTexts=input.cellTexts.map(entry=>typeof entry==="string"?entry:String(entry??""))}else if(input.cellTexts===void 0||input.cellTexts===null){cellTexts=[]}else{warnAutoSize(`received non-array cellTexts (${typeof input.cellTexts}); coerced to [].`);cellTexts=[]}let padding;const rawPadding=opts.padding;if(rawPadding===void 0){padding=DEFAULT_PADDING}else if(typeof rawPadding==="number"&&Number.isFinite(rawPadding)&&rawPadding>=0){padding=rawPadding}else{warnAutoSize(`received non-finite/negative padding (${String(rawPadding)}); using default ${DEFAULT_PADDING}.`);padding=DEFAULT_PADDING}function isFinitePositive(n){return typeof n==="number"&&Number.isFinite(n)&&n>0}function isFiniteNonNegative(n){return typeof n==="number"&&Number.isFinite(n)&&n>=0}let effectiveMin=0;if(isFiniteNonNegative(opts.minWidth)){effectiveMin=opts.minWidth}else if(isFiniteNonNegative(input.colMin)){effectiveMin=input.colMin}let effectiveMax=Number.POSITIVE_INFINITY;if(isFinitePositive(opts.maxWidth)){effectiveMax=opts.maxWidth}else if(isFinitePositive(input.colMax)){effectiveMax=input.colMax}const rawMeasureText=input.measureText;let safeMeasure;if(typeof rawMeasureText==="function"){safeMeasure=text=>{try{const w=rawMeasureText(text);if(typeof w==="number"&&Number.isFinite(w)&&w>=0)return w;warnAutoSize(`measureText returned non-finite/negative value; treating as 0.`);return 0}catch{warnAutoSize(`measureText threw on input; treating as 0.`);return 0}}}else{warnAutoSize(`received missing/non-function measureText; every measurement falls back to 0.`);safeMeasure=()=>0}let measuredWidth=safeMeasure(headerText);for(let i=0;i<cellTexts.length;i++){const w=safeMeasure(cellTexts[i]);if(w>measuredWidth)measuredWidth=w}const paddedWidth=measuredWidth+padding;let finalWidth=paddedWidth;if(effectiveMin<=effectiveMax){if(finalWidth<effectiveMin)finalWidth=effectiveMin;if(finalWidth>effectiveMax)finalWidth=effectiveMax}const wasClamped=paddedWidth!==finalWidth;return{measuredWidth,paddedWidth,finalWidth,wasClamped}}function createColumnSortController(){function toAriaSort(direction){if(direction==="asc")return"ascending";if(direction==="desc")return"descending";return"none"}function getIndicatorState(fieldOrId,activeSort){if(activeSort!==null&&activeSort.field===fieldOrId){return{direction:activeSort.direction,isActive:true,sortIndex:null,ariaSort:toAriaSort(activeSort.direction)}}return{direction:null,isActive:false,sortIndex:null,ariaSort:"none"}}function getModelIndicatorState(fieldOrId,sortModel){for(let i=0;i<sortModel.length;i++){if(sortModel[i].field===fieldOrId){return{direction:sortModel[i].direction,isActive:true,sortIndex:sortModel.length>1?i+1:null,ariaSort:toAriaSort(sortModel[i].direction)}}}return{direction:null,isActive:false,sortIndex:null,ariaSort:"none"}}function getNextSort(fieldOrId,activeSort){if(activeSort===null){return{field:fieldOrId,direction:"asc"}}if(activeSort.field!==fieldOrId){return{field:fieldOrId,direction:"asc"}}if(activeSort.direction==="asc"){return{field:fieldOrId,direction:"desc"}}return null}function ariaLabel(direction,label,sortIndex,totalKeys){const priority=typeof sortIndex==="number"&&typeof totalKeys==="number"&&totalKeys>1?`, sort priority ${sortIndex} of ${totalKeys}`:"";if(direction===null){return`Sort by ${label}`}if(direction==="asc"){return`Sorted ascending by ${label}${priority}, click to sort descending`}return`Sorted descending by ${label}${priority}, click to unsort`}return{getIndicatorState,getModelIndicatorState,getNextSort,ariaLabel}}function computeColumnState(input){function resolveFieldOrder(fields,columnOrder){if(columnOrder===null){return fields.slice()}const fieldSet=new Set(fields);const out=[];for(let i=0;i<columnOrder.length;i++){const f=columnOrder[i];if(fieldSet.has(f)){out.push(f);fieldSet.delete(f)}}for(const remaining of fieldSet){out.push(remaining)}return out}function buildOrderIndex(fields,columnOrder){if(columnOrder===null)return null;const fieldSet=new Set(fields);const map=new Map;let compactIndex=0;for(let i=0;i<columnOrder.length;i++){const field=columnOrder[i];if(!fieldSet.has(field)||map.has(field))continue;map.set(field,compactIndex);compactIndex+=1}return map}function resolveSortModel(sortModel2,activeSort){if(sortModel2!==void 0)return sortModel2;return activeSort===null?[]:[activeSort]}function buildEntry(field,columnWidths,orderIndex2,columnHidden,sortModel2,pinnedSides){const width=columnWidths.has(field)?columnWidths.get(field):null;const order=orderIndex2!==null?orderIndex2.has(field)?orderIndex2.get(field):null:null;const hidden=columnHidden.has(field);let sortIndex=null;for(let i=0;i<sortModel2.length;i++){if(sortModel2[i].field===field){sortIndex=i;break}}const isSorted=sortIndex!==null;const sortDirection=isSorted?sortModel2[sortIndex].direction:null;const pinned=pinnedSides!==void 0?pinnedSides.get(field)??null:null;return{field,width,order,hidden,sortDirection,isSorted,sortIndex,pinned}}const orderedFields=resolveFieldOrder(input.fields,input.columnOrder);const orderIndex=buildOrderIndex(input.fields,input.columnOrder);const sortModel=resolveSortModel(input.sortModel,input.activeSort);const entries=[];for(let i=0;i<orderedFields.length;i++){entries.push(buildEntry(orderedFields[i],input.columnWidths,orderIndex,input.columnHidden,sortModel,input.pinnedSides))}return entries}function computeApplyColumnState(state,opts){function buildWidths(entries){const map=new Map;for(let i=0;i<entries.length;i++){const e=entries[i];map.set(e.field,e.width)}return map}function buildVisibility(entries){const map=new Map;for(let i=0;i<entries.length;i++){map.set(entries[i].field,entries[i].hidden)}return map}function buildOrder(entries,applyOrder){if(!applyOrder)return null;const ordered=[];const unordered=[];for(let i=0;i<entries.length;i++){const e=entries[i];if(e.order!==null){ordered.push({field:e.field,order:e.order})}else{unordered.push(e.field)}}ordered.sort((a,b)=>a.order-b.order);return[...ordered.map(o=>o.field),...unordered]}function buildSortModel(entries){const sorted=[];const seen=new Set;for(let i=0;i<entries.length;i++){const e=entries[i];if(!e.isSorted||e.sortDirection===null||seen.has(e.field))continue;seen.add(e.field);sorted.push({field:e.field,direction:e.sortDirection,sortIndex:typeof e.sortIndex==="number"&&Number.isFinite(e.sortIndex)?e.sortIndex:Number.POSITIVE_INFINITY,position:i})}sorted.sort((a,b)=>a.sortIndex-b.sortIndex||a.position-b.position);return sorted.map(s=>({field:s.field,direction:s.direction}))}function buildPinned(entries){const map=new Map;for(let i=0;i<entries.length;i++){const e=entries[i];if(!("pinned"in e)||e.pinned===void 0)continue;map.set(e.field,e.pinned==="left"||e.pinned==="right"?e.pinned:null)}return map}const sortModel=buildSortModel(state);return{widths:buildWidths(state),visibility:buildVisibility(state),order:buildOrder(state,opts?.applyOrder),activeSort:sortModel.length>0?sortModel[0]:null,sortModel,pinned:buildPinned(state)}}const SY_GRID_STATE_VERSION="sy-grid-state/1.0.0";const SY_GRID_STATE_SLICE_KEYS=Object.freeze(["columns","filter","rowGrouping","pivot","expansion","selection","focus","scroll","pagination","pinnedRows","sideBar","find"]);const MAX_GRID_STATE_DEPTH=32;const issue=(path,kind,detail)=>({path,kind,detail});function isPlainObject(value){const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}function canonicalizeInto(value,path,depth,seen,issues){if(value===null)return null;switch(typeof value){case"string":case"boolean":return value;case"number":if(!Number.isFinite(value)){issues.push(issue(path,"non-finite-number",`${value} is not JSON-serializable`));return null}return value===0?0:value;case"bigint":issues.push(issue(path,"bigint","bigint is not JSON-serializable"));return null;case"function":issues.push(issue(path,"function","functions cannot be part of grid state"));return null;case"symbol":issues.push(issue(path,"symbol","symbols cannot be part of grid state"));return null;case"undefined":issues.push(issue(path,"undefined-in-array","undefined is not JSON-serializable"));return null}const objectValue=value;if(depth>=MAX_GRID_STATE_DEPTH){issues.push(issue(path,"excessive-depth",`nesting exceeds ${MAX_GRID_STATE_DEPTH} levels`));return null}if(seen.has(objectValue)){issues.push(issue(path,"circular-reference","value references itself"));return null}if(Array.isArray(objectValue)){seen.add(objectValue);const result2=[];for(let index2=0;index2<objectValue.length;index2+=1){const slot=`${path}/${index2}`;if(!Object.hasOwn(objectValue,index2)||objectValue[index2]===void 0){issues.push(issue(slot,"undefined-in-array","arrays may not contain undefined holes"));continue}result2.push(canonicalizeInto(objectValue[index2],slot,depth+1,seen,issues))}seen.delete(objectValue);return result2}if(!isPlainObject(objectValue)){const name=objectValue.constructor?.name??"unknown";issues.push(issue(path,"unsupported-object",`${name} instances are not plain serializable objects`));return null}seen.add(objectValue);const record=objectValue;const result={};for(const key of Object.keys(record).sort()){if(record[key]===void 0)continue;if(key==="__proto__"){issues.push(issue(`${path}/${key}`,"unsupported-object","prototype-pollution key rejected"));continue}result[key]=canonicalizeInto(record[key],`${path}/${key}`,depth+1,seen,issues)}seen.delete(objectValue);return result}function canonicalizeGridStateValue(value){const issues=[];const canonical=canonicalizeInto(value,"$",0,new WeakSet,issues);return issues.length>0?{value:null,issues}:{value:canonical,issues}}const VERSION_PATTERN=/^sy-grid-state\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u;function parseGridStateVersion(value){if(typeof value!=="string")return null;const match=value.match(VERSION_PATTERN);if(!match)return null;return{major:Number(match[1]),minor:Number(match[2]),patch:Number(match[3])}}const CURRENT_VERSION=(()=>{const parsed=parseGridStateVersion(SY_GRID_STATE_VERSION);if(!parsed){throw new TypeError("SY_GRID_STATE_VERSION must satisfy the version pattern")}return parsed})();const KNOWN_SLICES=new Set(SY_GRID_STATE_SLICE_KEYS);const isRecord$5=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);function validateGridStateEnvelope(value,options={}){const unknownSlices=options.unknownSlices??"reject";const issues=[];if(!isRecord$5(value)){return{ok:false,state:null,issues:[{code:"not-an-object",path:"$",detail:"grid state must be a plain object envelope"}]}}const version=value.version;if(version===void 0){issues.push({code:"missing-version",path:"$/version",detail:"grid state must declare its version"})}else{const parsed=parseGridStateVersion(version);if(!parsed){issues.push({code:"malformed-version",path:"$/version",detail:`"${String(version)}" does not match sy-grid-state/<major>.<minor>.<patch>`})}else if(parsed.major>CURRENT_VERSION.major){issues.push({code:"newer-major-version",path:"$/version",detail:`state major ${parsed.major} is newer than runtime major ${CURRENT_VERSION.major}`})}}const slices=value.slices;if(slices===void 0){issues.push({code:"missing-slices",path:"$/slices",detail:"grid state must carry a slices object (empty is allowed)"})}else if(!isRecord$5(slices)){issues.push({code:"malformed-slices",path:"$/slices",detail:"slices must be a plain object keyed by slice name"})}const canonicalSlices={};if(isRecord$5(slices)){const presentKeys=Object.keys(slices);for(const key of presentKeys){if(!KNOWN_SLICES.has(key)){issues.push({code:"unknown-slice",path:`$/slices/${key}`,detail:unknownSlices==="reject"?`unknown slice "${key}" rejected by policy`:`unknown slice "${key}" reported and ignored by policy`});continue}if(slices[key]===void 0)continue;const canonical=canonicalizeGridStateValue(slices[key]);if(canonical.issues.length>0){for(const serializability of canonical.issues){issues.push({code:"non-serializable",path:`$/slices/${key}${serializability.path.slice(1)}`,detail:`${serializability.kind}: ${serializability.detail}`})}continue}canonicalSlices[key]=canonical.value}}const fatal=issues.some(entry=>entry.code!=="unknown-slice"||unknownSlices==="reject");if(fatal){return{ok:false,state:null,issues}}const ordered={};for(const key of SY_GRID_STATE_SLICE_KEYS){if(key in canonicalSlices)ordered[key]=canonicalSlices[key]}return{ok:true,state:{version,slices:ordered},issues}}const indexOfField=(fields,field)=>{if(!fields)return null;const index2=fields.indexOf(field);return index2<0?null:index2};function captureColumnsSlice(input){const base=computeColumnState(input);const entries=base.map(entry=>({colId:entry.field,width:entry.width,order:entry.order,hidden:entry.hidden,pinned:entry.pinned??null,sort:entry.isSorted&&entry.sortDirection!==null?{direction:entry.sortDirection,index:typeof entry.sortIndex==="number"?entry.sortIndex:0}:null,aggFunc:input.aggFuncs?.get(entry.field)??null,rowGroupIndex:indexOfField(input.rowGroupFields,entry.field),pivotRowGroupIndex:indexOfField(input.pivotRowGroupFields,entry.field),pivotIndex:indexOfField(input.pivotFields,entry.field),valueIndex:indexOfField(input.valueFields,entry.field)}));return{entries,collapsedGroupIds:[...input.collapsedGroupIds??[]].sort(),pivotMode:input.pivotMode??false}}const byIndex=(entries,read)=>entries.map((entry,position)=>({entry,position,index:read(entry)})).filter(item=>item.index!==null).sort((left,right)=>left.index-right.index||left.position-right.position).map(item=>item.entry.colId);function applyColumnsSlice(slice,liveFields,options={}){const liveSet=new Set(liveFields);const sliceIds=new Set;const known=[];const missingColumns=[];for(const entry of slice.entries){if(sliceIds.has(entry.colId))continue;sliceIds.add(entry.colId);if(liveSet.has(entry.colId))known.push(entry);else missingColumns.push(entry.colId)}const newColumns=liveFields.filter(field=>!sliceIds.has(field));const columnEntries=known.map(entry=>({field:entry.colId,width:entry.width,order:entry.order,hidden:entry.hidden,sortDirection:entry.sort?.direction??null,isSorted:entry.sort!==null,sortIndex:entry.sort?.index??null,pinned:entry.pinned}));const aggFuncs=new Map;for(const entry of known)aggFuncs.set(entry.colId,entry.aggFunc);const computed=computeApplyColumnState(columnEntries,{applyOrder:options.applyOrder??true});const pristineOrder=known.length>0&&known.every(entry=>entry.order===null);const columnState=pristineOrder?{...computed,order:null}:computed;return{columnState,aggFuncs,rowGroupFields:byIndex(known,entry=>entry.rowGroupIndex),pivotRowGroupFields:byIndex(known,entry=>entry.pivotRowGroupIndex),pivotMode:slice.pivotMode,pivotFields:byIndex(known,entry=>entry.pivotIndex),valueFields:byIndex(known,entry=>entry.valueIndex),collapsedGroupIds:[...slice.collapsedGroupIds].sort(),report:{missingColumns,newColumns}}}const isRecord$4=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);const isNullableString=value=>value===null||typeof value==="string";const isNullableInteger=value=>value===null||typeof value==="number"&&Number.isInteger(value)&&value>=0;function validateColumnsSlice(value){const issues=[];if(!isRecord$4(value)){return[{path:"$",detail:"columns slice must be an object"}]}if(!Array.isArray(value.entries)){issues.push({path:"$/entries",detail:"entries must be an array"})}else{const seen=new Set;value.entries.forEach((entry,index2)=>{const path=`$/entries/${index2}`;if(!isRecord$4(entry)){issues.push({path,detail:"entry must be an object"});return}if(typeof entry.colId!=="string"||entry.colId.length===0){issues.push({path:`${path}/colId`,detail:"colId must be a non-empty string"})}else if(seen.has(entry.colId)){issues.push({path:`${path}/colId`,detail:`duplicate colId "${entry.colId}"`})}else{seen.add(entry.colId)}if(entry.width!==null&&(typeof entry.width!=="number"||!Number.isFinite(entry.width)||entry.width<0)){issues.push({path:`${path}/width`,detail:"width must be null or a non-negative finite number"})}if(!isNullableInteger(entry.order)){issues.push({path:`${path}/order`,detail:"order must be null or a non-negative integer"})}if(typeof entry.hidden!=="boolean"){issues.push({path:`${path}/hidden`,detail:"hidden must be a boolean"})}if(entry.pinned!==null&&entry.pinned!=="left"&&entry.pinned!=="right"){issues.push({path:`${path}/pinned`,detail:'pinned must be null, "left", or "right"'})}if(entry.sort!==null){if(!isRecord$4(entry.sort)||entry.sort.direction!=="asc"&&entry.sort.direction!=="desc"||!Number.isInteger(entry.sort.index)||entry.sort.index<0){issues.push({path:`${path}/sort`,detail:"sort must be null or { direction: asc|desc, index: >=0 }"})}}if(!isNullableString(entry.aggFunc)){issues.push({path:`${path}/aggFunc`,detail:"aggFunc must be null or a string"})}for(const key of["rowGroupIndex","pivotRowGroupIndex","pivotIndex","valueIndex"]){if(!isNullableInteger(entry[key])){issues.push({path:`${path}/${key}`,detail:`${key} must be null or a non-negative integer`})}}})}if(!Array.isArray(value.collapsedGroupIds)||value.collapsedGroupIds.some(id=>typeof id!=="string"||id.length===0)){issues.push({path:"$/collapsedGroupIds",detail:"collapsedGroupIds must be an array of non-empty strings"})}if(typeof value.pivotMode!=="boolean"){issues.push({path:"$/pivotMode",detail:"pivotMode must be a boolean"})}return issues}const FILTER_KINDS=new Set(["text","number","date","set","multi"]);function captureFilterSlice(input){const issues=[];const builtIn={};for(const field of Object.keys(input.activeFilters).sort()){const filter=input.activeFilters[field];const canonical=canonicalizeGridStateValue(filter);if(canonical.issues.length>0){for(const violation of canonical.issues){issues.push({path:`$/builtIn/${field}${violation.path.slice(1)}`,detail:`built-in filter not serializable (${violation.kind}): ${violation.detail}`})}continue}builtIn[field]=canonical.value}let customModels=null;if(input.customModels!==null){customModels={};for(const colId of Object.keys(input.customModels).sort()){const canonical=canonicalizeGridStateValue(input.customModels[colId]);if(canonical.issues.length>0){for(const violation of canonical.issues){issues.push({path:`$/customModels/${colId}${violation.path.slice(1)}`,detail:`custom filter model not serializable (${violation.kind}): ${violation.detail}`})}continue}customModels[colId]=canonical.value}}for(const error of input.customModelErrors??[]){issues.push({path:"$/customModels",detail:`facade snapshot error: ${error}`})}let conditionTree=null;if(input.conditionTree!==null){try{conditionTree=serializeConditionTree(input.conditionTree)}catch(error){issues.push({path:"$/conditionTree",detail:`condition tree failed to serialize: ${error instanceof Error?error.message:String(error)}`})}}return{slice:{builtIn,customModels,quickFilter:input.quickFilter,conditionTree,externalFilterActive:input.externalFilterActive},issues}}const isRecord$3=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);function applyFilterSlice(slice,context){const liveFields=new Set(context.fields);const builtIn={};const unknownBuiltInColumns=[];const invalidBuiltIn=[];for(const colId of Object.keys(slice.builtIn).sort()){const entry=slice.builtIn[colId];if(!liveFields.has(colId)){unknownBuiltInColumns.push(colId);continue}if(!isRecord$3(entry)||typeof entry.kind!=="string"||!FILTER_KINDS.has(entry.kind)||entry.field!==colId||!isRecord$3(entry.spec)){invalidBuiltIn.push({path:`$/builtIn/${colId}`,detail:"entry must be an ActiveFilter whose field matches its column id"});continue}builtIn[colId]=entry}const customModels={};const unavailableCustomFilters=[];for(const colId of Object.keys(slice.customModels??{}).sort()){if(context.customFilterColumnIds.has(colId)){customModels[colId]=slice.customModels[colId]}else{unavailableCustomFilters.push(colId)}}let conditionTree=null;let conditionTreeError=null;if(slice.conditionTree!==null){try{const parsed=parseConditionTree(slice.conditionTree);const validation=validateConditionNode(parsed);if(validation.ok){conditionTree=parsed}else{conditionTreeError=validation.errors.join("; ")}}catch(error){conditionTreeError=error instanceof Error?error.message:String(error)}}return{builtIn,customModels,quickFilter:slice.quickFilter,conditionTree,report:{unknownBuiltInColumns,invalidBuiltIn,unavailableCustomFilters,conditionTreeError,externalFilterWasActive:slice.externalFilterActive}}}function validateFilterSlice(value){const issues=[];if(!isRecord$3(value)){return[{path:"$",detail:"filter slice must be an object"}]}if(!isRecord$3(value.builtIn)){issues.push({path:"$/builtIn",detail:"builtIn must be an object keyed by column id"})}if(value.customModels!==null&&!isRecord$3(value.customModels)){issues.push({path:"$/customModels",detail:"customModels must be null or an object keyed by column id"})}if(value.quickFilter!==null&&typeof value.quickFilter!=="string"){issues.push({path:"$/quickFilter",detail:"quickFilter must be null or a string"})}if(value.conditionTree!==null&&typeof value.conditionTree!=="string"){issues.push({path:"$/conditionTree",detail:"conditionTree must be null or a condition wire string"})}if(typeof value.externalFilterActive!=="boolean"){issues.push({path:"$/externalFilterActive",detail:"externalFilterActive must be a boolean"})}return issues}function compareRowIds(left,right){const leftIsNumber=typeof left==="number";const rightIsNumber=typeof right==="number";if(leftIsNumber&&rightIsNumber)return left-right;if(leftIsNumber)return-1;if(rightIsNumber)return 1;return left<right?-1:left>right?1:0}const sortedStrings=values=>[...values].sort();const sortedIds=values=>[...values].sort(compareRowIds);function captureRowsSlices(input){return{rowGrouping:{collapsedGroupRoutes:sortedStrings(input.collapsedGroupRoutes)},pivot:{collapsedGroupRoutes:sortedStrings(input.pivotCollapsedGroupRoutes)},expansion:{collapsedTreeNodePaths:sortedStrings(input.collapsedTreeNodePaths),expandedDetailRowIds:sortedIds(input.expandedDetailRowIds)},selection:{rows:{mode:input.rowSelection.mode,ids:sortedIds(input.rowSelection.selectedRowIds)},ranges:input.cellRanges.map(range=>({...range}))}}}const splitIds=(ids,live)=>{if(live===null){return{applied:[...ids],missing:[],unverified:[...ids]}}const applied=[];const missing=[];for(const id of ids)(live.has(id)?applied:missing).push(id);return{applied,missing,unverified:[]}};const splitPaths=(paths,live)=>{if(live===null){return{applied:[...paths],missing:[],unverified:[...paths]}}const applied=[];const missing=[];for(const path of paths)(live.has(path)?applied:missing).push(path);return{applied,missing,unverified:[]}};const rangeInBounds=(range,rowCount,columnCount)=>[range.anchorRow,range.focusRow].every(row=>row>=0&&row<rowCount)&&[range.anchorCol,range.focusCol].every(col=>col>=0&&col<columnCount);function applyRowsSlices(slices,context){const detail=splitIds(slices.expansion.expandedDetailRowIds,context.liveRowIds);const selected=splitIds(slices.selection.rows.ids,context.liveRowIds);const tree=splitPaths(slices.expansion.collapsedTreeNodePaths,context.liveTreeNodePaths);const ranges=[];const droppedRanges=[];for(const range of slices.selection.ranges){if(rangeInBounds(range,context.rowCount,context.columnCount)){ranges.push({...range})}else{droppedRanges.push({...range})}}return{collapsedGroupRoutes:[...slices.rowGrouping.collapsedGroupRoutes],pivotCollapsedGroupRoutes:[...slices.pivot.collapsedGroupRoutes],collapsedTreeNodePaths:tree.applied,expandedDetailRowIds:detail.applied,selection:{mode:slices.selection.rows.mode,ids:selected.applied},ranges,report:{missingDetailRowIds:detail.missing,unverifiedDetailRowIds:detail.unverified,missingSelectedRowIds:selected.missing,unverifiedSelectedRowIds:selected.unverified,missingTreeNodePaths:tree.missing,unverifiedTreeNodePaths:tree.unverified,deferredPivotRoutes:context.pivotModeActive?[]:[...slices.pivot.collapsedGroupRoutes],droppedRanges}}}const isRecord$2=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);const isRowId$1=value=>typeof value==="string"&&value.length>0||typeof value==="number"&&Number.isFinite(value);const validateStringArray=(value,path,issues)=>{if(!Array.isArray(value)||value.some(entry=>typeof entry!=="string")){issues.push({path,detail:"must be an array of strings"})}};const validateIdArray=(value,path,issues)=>{if(!Array.isArray(value)||value.some(entry=>!isRowId$1(entry))){issues.push({path,detail:"must be an array of non-empty-string or finite-number row ids"})}};function validateRowGroupingSlice(value){if(!isRecord$2(value))return[{path:"$",detail:"rowGrouping slice must be an object"}];const issues=[];validateStringArray(value.collapsedGroupRoutes,"$/collapsedGroupRoutes",issues);return issues}function validatePivotSlice(value){if(!isRecord$2(value))return[{path:"$",detail:"pivot slice must be an object"}];const issues=[];validateStringArray(value.collapsedGroupRoutes,"$/collapsedGroupRoutes",issues);return issues}function validateExpansionSlice(value){if(!isRecord$2(value))return[{path:"$",detail:"expansion slice must be an object"}];const issues=[];validateStringArray(value.collapsedTreeNodePaths,"$/collapsedTreeNodePaths",issues);validateIdArray(value.expandedDetailRowIds,"$/expandedDetailRowIds",issues);return issues}function validateSelectionSlice(value){if(!isRecord$2(value))return[{path:"$",detail:"selection slice must be an object"}];const issues=[];if(!isRecord$2(value.rows)){issues.push({path:"$/rows",detail:"rows must be an object"})}else{if(value.rows.mode!=="none"&&value.rows.mode!=="single"&&value.rows.mode!=="multi"){issues.push({path:"$/rows/mode",detail:"mode must be none, single, or multi"})}validateIdArray(value.rows.ids,"$/rows/ids",issues)}if(!Array.isArray(value.ranges)){issues.push({path:"$/ranges",detail:"ranges must be an array"})}else{value.ranges.forEach((range,index2)=>{if(!isRecord$2(range)||["anchorRow","anchorCol","focusRow","focusCol"].some(key=>typeof range[key]!=="number"||!Number.isInteger(range[key])||range[key]<0)){issues.push({path:`$/ranges/${index2}`,detail:"range must carry non-negative integer anchor/focus row and column indices"})}})}return issues}const DEFAULT_UI_PAGINATION=Object.freeze({pageIndex:0,pageSize:25});function captureUiSlices(input){return{focus:{activeCell:input.activeCell===null?null:{rowIndex:input.activeCell.rowIndex,colIndex:input.activeCell.colIndex}},scroll:{top:Math.max(0,input.scrollTop),left:Math.max(0,input.scrollLeft)},pagination:input.pagination===null?DEFAULT_UI_PAGINATION:{pageIndex:input.pagination.pageIndex,pageSize:input.pagination.pageSize},sideBar:{openPanelId:input.openPanelId},pinnedRows:input.pinnedRows===void 0?{topRowIds:[],bottomRowIds:[]}:{topRowIds:[...input.pinnedRows.topRowIds],bottomRowIds:[...input.pinnedRows.bottomRowIds]}}}function planUiRestore(slices,context){const unavailable=[];let focus=slices.focus;if(focus.activeCell!==null&&(focus.activeCell.rowIndex>=context.rowCount||focus.activeCell.colIndex>=context.columnCount)){unavailable.push({slice:"focus",path:"$/focus/activeCell",reason:`active cell (${focus.activeCell.rowIndex}, ${focus.activeCell.colIndex}) is outside the ${context.rowCount}x${context.columnCount} display`});focus={activeCell:null}}const pinnedRequested=slices.pinnedRows.topRowIds.length>0||slices.pinnedRows.bottomRowIds.length>0;if(!context.pinnedRowsSupported&&pinnedRequested){unavailable.push({slice:"pinnedRows",path:"$/pinnedRows",reason:"pinned top/bottom rows are not supported by this build (Phase F Day 65 feature)"})}return{immediate:{sideBar:slices.sideBar,pagination:slices.pagination},afterData:{scroll:slices.scroll,focus,pinnedRows:context.pinnedRowsSupported&&pinnedRequested?slices.pinnedRows:null},unavailable}}const isRecord$1=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);const nonNegativeInteger=value=>typeof value==="number"&&Number.isInteger(value)&&value>=0;const nonNegativeFinite=value=>typeof value==="number"&&Number.isFinite(value)&&value>=0;const isRowId=value=>typeof value==="string"&&value.length>0||typeof value==="number"&&Number.isFinite(value);function validateFocusSlice(value){if(!isRecord$1(value))return[{path:"$",detail:"focus slice must be an object"}];if(value.activeCell===null)return[];if(!isRecord$1(value.activeCell)||!nonNegativeInteger(value.activeCell.rowIndex)||!nonNegativeInteger(value.activeCell.colIndex)){return[{path:"$/activeCell",detail:"activeCell must be null or non-negative integer indices"}]}return[]}function validateScrollSlice(value){if(!isRecord$1(value))return[{path:"$",detail:"scroll slice must be an object"}];const issues=[];if(!nonNegativeFinite(value.top))issues.push({path:"$/top",detail:"top must be a non-negative number"});if(!nonNegativeFinite(value.left))issues.push({path:"$/left",detail:"left must be a non-negative number"});return issues}function validatePaginationSlice(value){if(!isRecord$1(value))return[{path:"$",detail:"pagination slice must be an object"}];const issues=[];if(!nonNegativeInteger(value.pageIndex)){issues.push({path:"$/pageIndex",detail:"pageIndex must be a non-negative integer"})}if(!nonNegativeInteger(value.pageSize)||value.pageSize===0){issues.push({path:"$/pageSize",detail:"pageSize must be a positive integer"})}return issues}function validateSideBarSlice(value){if(!isRecord$1(value))return[{path:"$",detail:"sideBar slice must be an object"}];if(value.openPanelId!==null&&value.openPanelId!=="columns"&&value.openPanelId!=="filters"){return[{path:"$/openPanelId",detail:'openPanelId must be null, "columns", or "filters"'}]}return[]}function validatePinnedRowsSlice(value){if(!isRecord$1(value))return[{path:"$",detail:"pinnedRows slice must be an object"}];const issues=[];for(const key of["topRowIds","bottomRowIds"]){if(!Array.isArray(value[key])||value[key].some(id=>!isRowId(id))){issues.push({path:`$/${key}`,detail:`${key} must be an array of row ids`})}}return issues}function validateFindSlice(value){if(value===null||typeof value!=="object"||Array.isArray(value)){return[{path:"$",detail:"find slice must be an object"}]}const issues=[];const record=value;if(typeof record.query!=="string"){issues.push({path:"$/query",detail:"query must be a string"})}if(typeof record.caseSensitive!=="boolean"){issues.push({path:"$/caseSensitive",detail:"caseSensitive must be a boolean"})}if(record.scope!=="visible"&&record.scope!=="all"){issues.push({path:"$/scope",detail:'scope must be "visible" or "all"'})}if(record.displayValues!==void 0&&typeof record.displayValues!=="boolean")issues.push({path:"$/displayValues",detail:"displayValues must be a boolean"});return issues}function buildGridState(input){const columns=captureColumnsSlice(input.columns);const filter=captureFilterSlice(input.filter);const rows=captureRowsSlices(input.rows);const ui=captureUiSlices(input.ui);const validation=validateGridStateEnvelope({version:SY_GRID_STATE_VERSION,slices:{columns,filter:filter.slice,rowGrouping:rows.rowGrouping,pivot:rows.pivot,expansion:rows.expansion,selection:rows.selection,focus:ui.focus,scroll:ui.scroll,pagination:ui.pagination,pinnedRows:ui.pinnedRows,sideBar:ui.sideBar,...input.find===void 0?{}:{find:input.find}}});if(!validation.ok||validation.state===null){throw new TypeError(`grid state capture produced an invalid envelope: ${validation.issues.map(issue2=>`${issue2.path} ${issue2.detail}`).join("; ")}`)}return{state:validation.state,issues:filter.issues}}const SLICE_VALIDATORS={columns:validateColumnsSlice,filter:validateFilterSlice,rowGrouping:validateRowGroupingSlice,pivot:validatePivotSlice,expansion:validateExpansionSlice,selection:validateSelectionSlice,focus:validateFocusSlice,scroll:validateScrollSlice,pagination:validatePaginationSlice,pinnedRows:validatePinnedRowsSlice,sideBar:validateSideBarSlice,find:validateFindSlice};const EMPTY_ROWS={rowGrouping:{collapsedGroupRoutes:[]},pivot:{collapsedGroupRoutes:[]},expansion:{collapsedTreeNodePaths:[],expandedDetailRowIds:[]},selection:{rows:{mode:"none",ids:[]},ranges:[]}};const EMPTY_UI={focus:{activeCell:null},scroll:{top:0,left:0},pagination:{pageIndex:0,pageSize:25},sideBar:{openPanelId:null},pinnedRows:{topRowIds:[],bottomRowIds:[]}};function planGridStateApply(value,contexts,options={}){const envelope=validateGridStateEnvelope(value,{unknownSlices:"report-and-ignore"});const issues=[...envelope.issues];if(!envelope.ok||envelope.state===null){return{ok:false,issues,requestedAbsentSlices:[],unrestorableSlices:[],appliedSlices:[],columns:null,filter:null,rows:null,ui:null}}const state=envelope.state;const present2=SY_GRID_STATE_SLICE_KEYS.filter(key=>key in state.slices);const requested=options.slices===void 0?present2:SY_GRID_STATE_SLICE_KEYS.filter(key=>options.slices?.includes(key));const requestedAbsentSlices=requested.filter(key=>!present2.includes(key));const selected=new Set(requested.filter(key=>present2.includes(key)));const unrestorableSlices=[];if(selected.has("find")&&contexts.findAvailable!==true){selected.delete("find");unrestorableSlices.push("find")}for(const key of selected){for(const issue2 of SLICE_VALIDATORS[key](state.slices[key])){issues.push({code:"non-serializable",path:`$/slices/${key}${issue2.path.slice(1)}`,detail:issue2.detail})}}const fatal=issues.some(issue2=>issue2.code!=="unknown-slice");if(fatal){return{ok:false,issues,requestedAbsentSlices,unrestorableSlices,appliedSlices:[],columns:null,filter:null,rows:null,ui:null}}const columns=selected.has("columns")?applyColumnsSlice(state.slices.columns,contexts.liveFields,{applyOrder:options.applyOrder??true}):null;const filter=selected.has("filter")?applyFilterSlice(state.slices.filter,contexts.filter):null;const rowsSelected=["rowGrouping","pivot","expansion","selection"].filter(key=>selected.has(key));const rows=rowsSelected.length>0?applyRowsSlices({rowGrouping:selected.has("rowGrouping")?state.slices.rowGrouping:EMPTY_ROWS.rowGrouping,pivot:selected.has("pivot")?state.slices.pivot:EMPTY_ROWS.pivot,expansion:selected.has("expansion")?state.slices.expansion:EMPTY_ROWS.expansion,selection:selected.has("selection")?state.slices.selection:EMPTY_ROWS.selection},contexts.rows):null;const uiSelected=["focus","scroll","pagination","pinnedRows","sideBar"].filter(key=>selected.has(key));const ui=uiSelected.length>0?planUiRestore({focus:selected.has("focus")?state.slices.focus:EMPTY_UI.focus,scroll:selected.has("scroll")?state.slices.scroll:EMPTY_UI.scroll,pagination:selected.has("pagination")?state.slices.pagination:EMPTY_UI.pagination,sideBar:selected.has("sideBar")?state.slices.sideBar:EMPTY_UI.sideBar,pinnedRows:selected.has("pinnedRows")?state.slices.pinnedRows:EMPTY_UI.pinnedRows},contexts.ui):null;return{ok:true,issues,requestedAbsentSlices,unrestorableSlices,appliedSlices:[...selected].sort(),...selected.has("find")?{find:state.slices.find}:{},columns,filter,rows,ui}}function summarizeGridStatePlan(plan,afterDataPending){return{ok:plan.ok,issues:plan.issues,appliedSlices:plan.appliedSlices,requestedAbsentSlices:plan.requestedAbsentSlices,unrestorableSlices:plan.unrestorableSlices,columns:plan.columns?.report??null,filter:plan.filter?.report??null,rows:plan.rows?.report??null,uiUnavailable:plan.ui?.unavailable??[],afterDataPending,appliedMigrations:[],droppedSlices:[]}}const isRecord=value=>value!==null&&typeof value==="object"&&!Array.isArray(value);const versionBelow=(left,boundary)=>{const[major,minor,patch]=boundary.split(".").map(Number);if(left.major!==major)return left.major<major;if(left.minor!==minor)return left.minor<minor;return left.patch<patch};const GRID_STATE_MIGRATIONS=Object.freeze([{id:"v0.8-flat-bags-to-v0.9-slices",untilVersion:"0.9.0",migrate(value,context){const slices=isRecord(value.slices)?{...value.slices}:{};if("columnState"in slices){slices.columns=slices.columnState;delete slices.columnState}if("filterState"in slices){slices.filter=slices.filterState;delete slices.filterState}if("panels"in slices){context.dropSlice("panels","the 0.8 panels bag has no modern equivalent");delete slices.panels}return{...value,version:"sy-grid-state/0.9.0",slices}}},{id:"v0.9-to-v1.0-envelope",untilVersion:"1.0.0",migrate(value){return{...value,version:SY_GRID_STATE_VERSION}}}]);function migrateGridState(value,migrations=GRID_STATE_MIGRATIONS){const failure=(issues,applied2=[],dropped2=[])=>({ok:false,state:null,issues,appliedMigrations:applied2,droppedSlices:dropped2});if(!isRecord(value)){return failure([{code:"not-an-object",path:"$",detail:"grid state must be a plain object envelope"}])}const parsed=parseGridStateVersion(value.version);if(!parsed){return failure([{code:"malformed-version",path:"$/version",detail:`"${String(value.version)}" does not match sy-grid-state/<major>.<minor>.<patch>`}])}if("slices"in value&&!isRecord(value.slices)){return failure([{code:"malformed-slices",path:"$/slices",detail:"slices must be a plain object keyed by slice name"}])}const current=parseGridStateVersion(SY_GRID_STATE_VERSION);if(current&&parsed.major>current.major){return failure([{code:"newer-major-version",path:"$/version",detail:`state major ${parsed.major} is newer than runtime major ${current.major}; refusing to migrate backwards`}])}const applied=[];const dropped=[];const context={dropSlice(slice,reason){dropped.push({slice,reason})}};let working={...value};for(const step of migrations){const version=parseGridStateVersion(working.version);if(!version||!versionBelow(version,step.untilVersion))continue;let next;try{next=step.migrate(working,context)}catch(error){return failure([{code:"non-serializable",path:"$",detail:`migration ${step.id} threw: ${error instanceof Error?error.message:String(error)}`}],applied,dropped)}if(!isRecord(next)||!parseGridStateVersion(next.version)){return failure([{code:"malformed-version",path:"$/version",detail:`migration ${step.id} produced an invalid envelope version`}],applied,dropped)}working=next;applied.push(step.id)}const validation=validateGridStateEnvelope(working,{unknownSlices:"report-and-ignore"});if(!validation.ok||validation.state===null){return failure(validation.issues.map(issue2=>({...issue2,detail:applied.length>0?`${issue2.detail} (after ${applied[applied.length-1]})`:issue2.detail})),applied,dropped)}return{ok:true,state:{version:SY_GRID_STATE_VERSION,slices:validation.state.slices},issues:validation.issues,appliedMigrations:applied,droppedSlices:dropped}}const STATE_ATOM_SLICES=Object.freeze({columnWidths:"columns",columnOrder:"columns",columnHidden:"columns",columnPinned:"columns",activeSortModel:"columns",collapsedGroups:"columns",columnDefs:"columns",groupBy:"columns",pivotMode:"columns",pivotRowGroupColumns:"columns",pivotColumns:"columns",pivotValueColumns:"columns",activeFilters:"filter",quickFilterValue:"filter",activeConditionTree:"filter",lifecycleFilterVersion:"filter",collapsedRowGroups:"rowGrouping",pivotCollapsedRowGroups:"pivot",collapsedTreeNodes:"expansion",expandedDetailRows:"expansion",selectionState:"selection",rangeState:"selection",activeCell:"focus",hScrollLeft:"scroll",scrollTop:"scroll",activePagination:"pagination",openToolPanelId:"sideBar"});function createStateChangeTracker(){let previous=null;return{diff(current){const before=previous;previous=current;if(before===null)return[];const changed=new Set;for(const key of Object.keys(STATE_ATOM_SLICES)){if(!Object.is(before[key],current[key])){changed.add(STATE_ATOM_SLICES[key])}}return[...changed].sort()}}}function createStateEventCoalescer(){const slices=new Set;const sources=new Set;let batches=0;let finalized=false;return{note(changed,source="interactive"){if(finalized||changed.length===0)return false;const hadPending=batches>0;for(const key of changed)slices.add(key);sources.add(source);batches+=1;return!hadPending},hasPending(){return batches>0},takeFlush(){if(finalized||batches===0)return null;const flush={changedSlices:[...slices].sort(),sources:[...sources].sort(),coalescedBatches:batches};slices.clear();sources.clear();batches=0;return flush},finalizeOnce(){if(finalized)return false;finalized=true;return true},isFinalized(){return finalized}}}const PIVOT_WARNING_GROUP_BY="pivot mode and group-by are mutually exclusive; pivot wins.";const PIVOT_WARNING_VIEWPORT_INFINITE="[SG:PIVOT] viewport/infinite; server wins";const PIVOT_WARNING_TREE_DATA="pivot mode and tree data are mutually exclusive; tree data wins.";const PIVOT_WARNING_MASTER_DETAIL="pivot mode and master-detail are mutually exclusive; pivot wins.";function createTextEditorState(initialValue){const seed=initialValue==null?"":String(initialValue);return{value:seed,composing:false,selectionStart:null,selectionEnd:null}}function applyInputValue$1(state,newValue){if(newValue===state.value)return state;return{value:newValue,composing:state.composing,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd}}function applyCompositionStart$3(state){if(state.composing)return state;return{value:state.value,composing:true,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd}}function applyCompositionEnd$3(state,finalValue){if(!state.composing&&finalValue===state.value)return state;return{value:finalValue,composing:false,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd}}function applySelectionChange$2(state,start,end){if(state.selectionStart===start&&state.selectionEnd===end)return state;return{value:state.value,composing:state.composing,selectionStart:start,selectionEnd:end}}function shouldCommitOnKey$5(state,key){if(state.composing)return false;return key==="Enter"||key==="Tab"}function shouldCancelOnKey$5(_state,key){return key==="Escape"}const TEXT_EDITOR_CLASS="sy-grid__cell-editor sy-grid__cell-editor--text";function buildTextEditorProps(input){const{state,rowIndex,colIndex,ariaLabel,ariaDescribedBy,onInput,interceptKeyDown,onCompositionStart,onCompositionEnd,onCommit,onCancel,onBlur}=input;const handleKeyDown=event=>{event.stopPropagation();if(interceptKeyDown?.(event)===true)return;if(shouldCommitOnKey$5(state,event.key)){event.preventDefault();onCommit();return}if(shouldCancelOnKey$5(state,event.key)){event.preventDefault();onCancel();return}};const handleInput=event=>{const target=event.target;if(target===null)return;const value=typeof target.value==="string"?target.value:"";const start=target.selectionStart??null;const end=target.selectionEnd??null;onInput(value,start,end)};const handleCompositionEnd=event=>{const target=event.target;const finalValue=target!==null&&typeof target.value==="string"?target.value:state.value;onCompositionEnd(finalValue)};return{type:"text",value:state.value,class:TEXT_EDITOR_CLASS,"data-row-index":rowIndex,"data-col-index":colIndex,"aria-label":ariaLabel,"aria-describedby":ariaDescribedBy,onInput:handleInput,onCompositionStart,onCompositionEnd:handleCompositionEnd,onKeyDown:handleKeyDown,onBlur}}const STEP_TOLERANCE=1e-9;function parseNumberText(text,constraints){const trimmed=text.trim();if(trimmed===""){if(constraints?.nullable===true||constraints?.allowEmpty===true){return{value:null,violation:null}}return{value:null,violation:"min"}}const STRICT_NUMERIC=/^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;if(!STRICT_NUMERIC.test(trimmed)){return{value:null,violation:"min"}}let parsed;if(/^-?\d+$/.test(trimmed)){const big=BigInt(trimmed);parsed=big>=-2147483648n&&big<=2147483647n?Number(big):big}else{const asNumber2=Number(trimmed);if(!Number.isFinite(asNumber2)){return{value:null,violation:"min"}}parsed=Number.isInteger(asNumber2)&&(asNumber2>2147483647||asNumber2<-2147483648)?BigInt(asNumber2):asNumber2}if(constraints?.min!==void 0&&parsed<constraints.min){return{value:parsed,violation:"min"}}if(constraints?.max!==void 0&&parsed>constraints.max){return{value:parsed,violation:"max"}}if(constraints?.step!==void 0&&constraints.step>0){const anchor=constraints.min??0;if(typeof parsed==="bigint"){if(Number.isInteger(anchor)&&Number.isInteger(constraints.step)){const remainder=(parsed-BigInt(anchor))%BigInt(constraints.step);if(remainder!==0n){return{value:parsed,violation:"step"}}}else{const stepCount=(Number(parsed)-anchor)/constraints.step;if(Math.abs(stepCount-Math.round(stepCount))>STEP_TOLERANCE){return{value:parsed,violation:"step"}}}}else{const offset=parsed-anchor;const stepCount=offset/constraints.step;const rounded=Math.round(stepCount);if(Math.abs(stepCount-rounded)>STEP_TOLERANCE){return{value:parsed,violation:"step"}}}}return{value:parsed,violation:null}}function createNumberEditorState(initialValue,constraints){if(initialValue===null||initialValue===void 0){const{value:value2,violation:violation2}=parseNumberText("",constraints);return{rawText:"",parsedValue:value2,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation2}}if(typeof initialValue!=="bigint"&&(typeof initialValue!=="number"||!Number.isFinite(initialValue))){const{value:value2,violation:violation2}=parseNumberText("",constraints);return{rawText:"",parsedValue:value2,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation2}}const rawText=String(initialValue);const{value,violation}=parseNumberText(rawText,constraints);return{rawText,parsedValue:value,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation}}function applyInputText$1(state,newText,constraints){if(newText===state.rawText)return state;const{value,violation}=parseNumberText(newText,constraints);return{rawText:newText,parsedValue:value,composing:state.composing,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd,constraintViolation:violation}}function applyCompositionStart$2(state){if(state.composing)return state;return{rawText:state.rawText,parsedValue:state.parsedValue,composing:true,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd,constraintViolation:state.constraintViolation}}function applyCompositionEnd$2(state,finalText,constraints){if(!state.composing&&finalText===state.rawText)return state;const{value,violation}=parseNumberText(finalText,constraints);return{rawText:finalText,parsedValue:value,composing:false,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd,constraintViolation:violation}}function applySelectionChange$1(state,start,end){if(state.selectionStart===start&&state.selectionEnd===end)return state;return{rawText:state.rawText,parsedValue:state.parsedValue,composing:state.composing,selectionStart:start,selectionEnd:end,constraintViolation:state.constraintViolation}}function shouldCommitOnKey$4(state,key){if(state.composing)return false;if(key!=="Enter"&&key!=="Tab")return false;if(state.constraintViolation!==null)return false;return true}function shouldCancelOnKey$4(_state,key){return key==="Escape"}const NUMBER_EDITOR_CLASS="sy-grid__cell-editor sy-grid__cell-editor--number";const NUMBER_EDITOR_INVALID_CLASS="sy-grid__cell-editor--invalid";function buildNumberEditorProps(input){const{state,rowIndex,colIndex,ariaLabel,ariaDescribedBy,constraints,onInput,onCompositionStart,onCompositionEnd,onCommit,onCancel,onBlur}=input;const handleKeyDown=event=>{event.stopPropagation();if(shouldCommitOnKey$4(state,event.key)){event.preventDefault();onCommit();return}if(shouldCancelOnKey$4(state,event.key)){event.preventDefault();onCancel();return}};const handleInput=event=>{const target=event.target;if(target===null)return;const value=typeof target.value==="string"?target.value:"";const start=safeNumberInputSelection(target,"selectionStart");const end=safeNumberInputSelection(target,"selectionEnd");onInput(value,start,end)};const handleCompositionEnd=event=>{const target=event.target;const finalText=target!==null&&typeof target.value==="string"?target.value:state.rawText;onCompositionEnd(finalText)};const inputmode=constraints?.decimals===0?"numeric":"decimal";const step=constraints?.step!==void 0&&constraints.step>0?constraints.step:"any";const isInvalid=state.constraintViolation!==null;const className=isInvalid?`${NUMBER_EDITOR_CLASS} ${NUMBER_EDITOR_INVALID_CLASS}`:NUMBER_EDITOR_CLASS;return{type:"number",inputmode,min:constraints?.min,max:constraints?.max,step,value:state.rawText,class:className,"data-row-index":rowIndex,"data-col-index":colIndex,"aria-label":ariaLabel,"aria-describedby":ariaDescribedBy,"aria-invalid":isInvalid?"true":"false",onInput:handleInput,onCompositionStart,onCompositionEnd:handleCompositionEnd,onKeyDown:handleKeyDown,onBlur}}function safeNumberInputSelection(target,key){try{return target[key]??null}catch{return null}}const STRICT_ISO_DATE=/^(\d{4})-(\d{2})-(\d{2})$/;function coerceBound$1(bound){if(bound===void 0)return null;if(bound instanceof Date){if(Number.isNaN(bound.getTime()))return null;return new Date(Date.UTC(bound.getUTCFullYear(),bound.getUTCMonth(),bound.getUTCDate()))}if(typeof bound==="string"){const m=STRICT_ISO_DATE.exec(bound.trim());if(m===null)return null;const year=Number(m[1]);const month=Number(m[2]);const day=Number(m[3]);if(month<1||month>12)return null;if(day<1||day>31)return null;const dt=new Date(Date.UTC(year,month-1,day));if(Number.isNaN(dt.getTime()))return null;if(dt.getUTCFullYear()!==year||dt.getUTCMonth()!==month-1||dt.getUTCDate()!==day){return null}return dt}return null}function parseDateText(text,constraints){const trimmed=text.trim();if(trimmed===""){if(constraints?.nullable===true||constraints?.allowEmpty===true){return{value:null,violation:null}}return{value:null,violation:"invalid"}}const m=STRICT_ISO_DATE.exec(trimmed);if(m===null){return{value:null,violation:"invalid"}}const year=Number(m[1]);const month=Number(m[2]);const day=Number(m[3]);if(month<1||month>12){return{value:null,violation:"invalid"}}if(day<1||day>31){return{value:null,violation:"invalid"}}const dt=new Date(Date.UTC(year,month-1,day));if(Number.isNaN(dt.getTime())){return{value:null,violation:"invalid"}}if(dt.getUTCFullYear()!==year||dt.getUTCMonth()!==month-1||dt.getUTCDate()!==day){return{value:null,violation:"invalid"}}const minDt=coerceBound$1(constraints?.min);if(minDt!==null&&dt.getTime()<minDt.getTime()){return{value:dt,violation:"min"}}const maxDt=coerceBound$1(constraints?.max);if(maxDt!==null&&dt.getTime()>maxDt.getTime()){return{value:dt,violation:"max"}}return{value:dt,violation:null}}function formatDateAsISO(dt){if(Number.isNaN(dt.getTime()))return"";const year=String(dt.getUTCFullYear()).padStart(4,"0");const month=String(dt.getUTCMonth()+1).padStart(2,"0");const day=String(dt.getUTCDate()).padStart(2,"0");return`${year}-${month}-${day}`}function createDateEditorState(initialValue,constraints){if(initialValue===null||initialValue===void 0){const{value:value2,violation:violation2}=parseDateText("",constraints);return{rawText:"",parsedDate:value2,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation2}}if(initialValue instanceof Date){if(Number.isNaN(initialValue.getTime())){const{value:value3,violation:violation3}=parseDateText("",constraints);return{rawText:"",parsedDate:value3,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation3}}const iso=formatDateAsISO(initialValue);const{value:value2,violation:violation2}=parseDateText(iso,constraints);return{rawText:iso,parsedDate:value2,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation2}}if(typeof initialValue==="string"){const{value:value2,violation:violation2}=parseDateText(initialValue,constraints);return{rawText:initialValue,parsedDate:value2,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation2}}const{value,violation}=parseDateText("",constraints);return{rawText:"",parsedDate:value,composing:false,selectionStart:null,selectionEnd:null,constraintViolation:violation}}function applyInputText(state,newText,constraints){if(newText===state.rawText)return state;const{value,violation}=parseDateText(newText,constraints);return{rawText:newText,parsedDate:value,composing:state.composing,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd,constraintViolation:violation}}function applyCompositionStart$1(state){if(state.composing)return state;return{rawText:state.rawText,parsedDate:state.parsedDate,composing:true,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd,constraintViolation:state.constraintViolation}}function applyCompositionEnd$1(state,finalText,constraints){if(!state.composing&&finalText===state.rawText)return state;const{value,violation}=parseDateText(finalText,constraints);return{rawText:finalText,parsedDate:value,composing:false,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd,constraintViolation:violation}}function applySelectionChange(state,start,end){if(state.selectionStart===start&&state.selectionEnd===end)return state;return{rawText:state.rawText,parsedDate:state.parsedDate,composing:state.composing,selectionStart:start,selectionEnd:end,constraintViolation:state.constraintViolation}}function shouldCommitOnKey$3(state,key){if(state.composing)return false;if(key!=="Enter"&&key!=="Tab")return false;if(state.constraintViolation!==null)return false;return true}function shouldCancelOnKey$3(_state,key){return key==="Escape"}function coerceBoundToISO(bound){if(bound===void 0)return void 0;if(bound instanceof Date){if(Number.isNaN(bound.getTime()))return void 0;const year=String(bound.getUTCFullYear()).padStart(4,"0");const month=String(bound.getUTCMonth()+1).padStart(2,"0");const day=String(bound.getUTCDate()).padStart(2,"0");return`${year}-${month}-${day}`}if(typeof bound==="string"){const trimmed=bound.trim();const match=/^(\d{4})-(\d{2})-(\d{2})$/.exec(trimmed);if(match!==null){const year=Number(match[1]);const month=Number(match[2]);const day=Number(match[3]);if(month<1||month>12||day<1||day>31){return void 0}const date=new Date(Date.UTC(year,month-1,day));if(date.getUTCFullYear()===year&&date.getUTCMonth()===month-1&&date.getUTCDate()===day){return trimmed}}}return void 0}const DATE_EDITOR_CLASS="sy-grid__cell-editor sy-grid__cell-editor--date";const DATE_EDITOR_INVALID_CLASS="sy-grid__cell-editor--invalid";function buildDateEditorProps(input){const{state,rowIndex,colIndex,ariaLabel,ariaDescribedBy,constraints,onInput,onCompositionStart,onCompositionEnd,onCommit,onCancel,onBlur}=input;const handleKeyDown=event=>{event.stopPropagation();if(shouldCommitOnKey$3(state,event.key)){event.preventDefault();onCommit();return}if(shouldCancelOnKey$3(state,event.key)){event.preventDefault();onCancel();return}};const handleInput=event=>{const target=event.target;if(target===null)return;const value=typeof target.value==="string"?target.value:"";let start=null;let end=null;try{start=target.selectionStart??null;end=target.selectionEnd??null}catch{start=null;end=null}onInput(value,start,end)};const handleCompositionEnd=event=>{const target=event.target;const finalText=target!==null&&typeof target.value==="string"?target.value:state.rawText;onCompositionEnd(finalText)};const isInvalid=state.constraintViolation!==null;const className=isInvalid?`${DATE_EDITOR_CLASS} ${DATE_EDITOR_INVALID_CLASS}`:DATE_EDITOR_CLASS;return{type:"date",min:coerceBoundToISO(constraints?.min),max:coerceBoundToISO(constraints?.max),value:state.rawText,class:className,"data-row-index":rowIndex,"data-col-index":colIndex,"aria-label":ariaLabel,"aria-describedby":ariaDescribedBy,"aria-invalid":isInvalid?"true":"false",onInput:handleInput,onCompositionStart,onCompositionEnd:handleCompositionEnd,onKeyDown:handleKeyDown,onBlur}}function utcDate(year,month0,day){return new Date(Date.UTC(year,month0,day))}function toISO(date){const y=String(date.getUTCFullYear()).padStart(4,"0");const m=String(date.getUTCMonth()+1).padStart(2,"0");const d=String(date.getUTCDate()).padStart(2,"0");return`${y}-${m}-${d}`}function parseISO(iso){if(typeof iso!=="string")return null;const m=/^(\d{4})-(\d{2})-(\d{2})$/.exec(iso.trim());if(m===null)return null;const y=Number(m[1]);const mo=Number(m[2]);const d=Number(m[3]);if(mo<1||mo>12||d<1||d>31)return null;const date=utcDate(y,mo-1,d);if(date.getUTCMonth()!==mo-1||date.getUTCDate()!==d)return null;return date}function coerceBound(bound){if(bound instanceof Date)return Number.isNaN(bound.getTime())?null:utcDate(bound.getUTCFullYear(),bound.getUTCMonth(),bound.getUTCDate());return parseISO(bound??null)}function isSameDay(a,b){if(a===null||b===null)return false;return a.getUTCFullYear()===b.getUTCFullYear()&&a.getUTCMonth()===b.getUTCMonth()&&a.getUTCDate()===b.getUTCDate()}function isDisabledDay(date,min,max){if(min!==null&&date.getTime()<min.getTime())return true;if(max!==null&&date.getTime()>max.getTime())return true;return false}function createCalendarState(initial,fallback){const selected=initial instanceof Date?Number.isNaN(initial.getTime())?null:initial:parseISO(initial??null);const anchor=selected??fallback;return{month:anchor.getUTCMonth(),year:anchor.getUTCFullYear(),selected}}function stepMonth(state,delta){if(delta===0)return state;const total=state.year*12+state.month+delta;const year=Math.floor(total/12);const month=(total%12+12)%12;return{month,year,selected:state.selected}}function showMonth(state,year,month0){if(state.year===year&&state.month===month0)return state;return{month:month0,year,selected:state.selected}}function selectDay(_state,date){return{month:date.getUTCMonth(),year:date.getUTCFullYear(),selected:date}}function buildMonthMatrix(state,weekStart=0){const first=utcDate(state.year,state.month,1);const firstWeekday=first.getUTCDay();const lead=(firstWeekday-weekStart+7)%7;const start=utcDate(state.year,state.month,1-lead);const weeks=[];const cursor=start;for(let w=0;w<6;w++){const week=[];for(let d=0;d<7;d++){const cell=utcDate(cursor.getUTCFullYear(),cursor.getUTCMonth(),cursor.getUTCDate());week.push({date:cell,iso:toISO(cell),day:cell.getUTCDate(),inMonth:cell.getUTCMonth()===state.month});cursor.setUTCDate(cursor.getUTCDate()+1)}weeks.push(week)}return weeks}function addMonthsClamped(date,delta){const totalM=date.getUTCFullYear()*12+date.getUTCMonth()+delta;const year=Math.floor(totalM/12);const month0=(totalM%12+12)%12;const daysInMonth=new Date(Date.UTC(year,month0+1,0)).getUTCDate();return utcDate(year,month0,Math.min(date.getUTCDate(),daysInMonth))}function navigateCalendarDay(iso,action,weekStart=0){const date=parseISO(iso);if(date===null)return null;const addDays=n=>utcDate(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate()+n);switch(action){case"left":return toISO(addDays(-1));case"right":return toISO(addDays(1));case"up":return toISO(addDays(-7));case"down":return toISO(addDays(7));case"pageup":return toISO(addMonthsClamped(date,-1));case"pagedown":return toISO(addMonthsClamped(date,1));case"home":return toISO(addDays(-(((date.getUTCDay()-weekStart)%7+7)%7)));case"end":return toISO(addDays(6-((date.getUTCDay()-weekStart)%7+7)%7));default:return iso}}function clampISOToBounds(iso,min,max){const date=parseISO(iso);if(date===null)return iso;if(min!==null&&date.getTime()<min.getTime())return toISO(min);if(max!==null&&date.getTime()>max.getTime())return toISO(max);return iso}const MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"];const WEEKDAY_INITIALS=["S","M","T","W","T","F","S"];function findOptionIndex(options,value){if(value===null||value===void 0)return-1;for(let i=0;i<options.length;i++){if(options[i].value===value)return i}return-1}function createSelectEditorState(initialValue,options){if(initialValue===null||initialValue===void 0){return{value:null,options,open:false,highlightedIndex:null}}const idx=findOptionIndex(options,initialValue);if(idx===-1){console.warn(`[Syidax] sy-grid: select editor initialValue "${String(initialValue)}" not in options.`);return{value:null,options,open:false,highlightedIndex:null}}return{value:options[idx].value,options,open:false,highlightedIndex:idx}}function applyOptionPick(state,optionIndex){if(!Number.isInteger(optionIndex)||optionIndex<0||optionIndex>=state.options.length){console.warn(`[Syidax] sy-grid: select editor applyOptionPick called with invalid index ${String(optionIndex)}.`);return state}const opt=state.options[optionIndex];if(opt.disabled===true){console.warn(`[Syidax] sy-grid: select editor applyOptionPick rejected disabled option "${String(opt.value)}".`);return state}return{value:opt.value,options:state.options,open:false,highlightedIndex:null}}function applyHighlightChange(state,direction){const len=state.options.length;if(len===0)return state;let cursor;if(state.highlightedIndex===null){cursor=direction===1?-1:len}else{cursor=state.highlightedIndex}for(let i=0;i<len;i++){cursor=(cursor+direction+len)%len;if(state.options[cursor].disabled!==true){if(cursor===state.highlightedIndex)return state;return{value:state.value,options:state.options,open:state.open,highlightedIndex:cursor}}}return state}function applyDropdownToggle(state,opening){const target=opening===void 0?!state.open:opening;if(target===state.open)return state;let nextHighlight=state.highlightedIndex;if(target===true&&nextHighlight===null&&state.value!==null){const idx=findOptionIndex(state.options,state.value);if(idx!==-1)nextHighlight=idx}return{value:state.value,options:state.options,open:target,highlightedIndex:nextHighlight}}function shouldCommitOnKey$2(state,key){if(key==="Tab")return true;if(key!=="Enter")return false;if(!state.open)return false;if(state.highlightedIndex===null)return false;const opt=state.options[state.highlightedIndex];if(opt===void 0)return false;if(opt.disabled===true)return false;return true}function shouldCancelOnKey$2(state,key){if(key!=="Escape")return false;return state.open===false}function shouldCloseDropdownOnKey(state,key){if(key!=="Escape")return false;return state.open===true}const SELECT_TRIGGER_CLASS="sy-grid__cell-editor sy-grid__cell-editor--select";const SELECT_LISTBOX_CLASS="sy-grid__select-listbox";const SELECT_OPTION_CLASS="sy-grid__select-option";function listboxId(rowIndex,colIndex){return`sy-grid-select-list-${rowIndex}-${colIndex}`}function optionId(rowIndex,colIndex,optionIndex){return`sy-grid-select-opt-${rowIndex}-${colIndex}-${optionIndex}`}function highlightedLabel(state){if(state.highlightedIndex!==null){const opt=state.options[state.highlightedIndex];if(opt!==void 0)return opt.label}if(state.value!==null){for(let i=0;i<state.options.length;i++){if(state.options[i].value===state.value)return state.options[i].label}}return""}function buildSelectTriggerProps(input){const{state,rowIndex,colIndex,ariaLabel,onToggle,onKeyDown,onBlur}=input;const handleKeyDown=event=>{event.stopPropagation();if(event.key==="Enter"||event.key==="ArrowUp"||event.key==="ArrowDown"||event.key===" "||event.key==="Spacebar"||event.key==="Escape"){event.preventDefault()}onKeyDown(event.key)};return{type:"button",class:SELECT_TRIGGER_CLASS,label:highlightedLabel(state),"aria-expanded":state.open?"true":"false","aria-haspopup":"listbox","aria-controls":state.open?listboxId(rowIndex,colIndex):void 0,"aria-label":ariaLabel,"data-row-index":rowIndex,"data-col-index":colIndex,onClick:onToggle,onKeyDown:handleKeyDown,onBlur}}function buildSelectListboxProps(input){const{state,rowIndex,colIndex,ariaLabel}=input;const activeId=state.highlightedIndex!==null?optionId(rowIndex,colIndex,state.highlightedIndex):void 0;return{role:"listbox",id:listboxId(rowIndex,colIndex),class:SELECT_LISTBOX_CLASS,"aria-activedescendant":activeId,"aria-label":ariaLabel,tabindex:-1}}function buildSelectOptionProps(input){const{state,optionIndex,rowIndex,colIndex,onPick}=input;const opt=state.options[optionIndex];const isHighlighted=state.highlightedIndex===optionIndex;const isDisabled=opt?.disabled===true;let cls=SELECT_OPTION_CLASS;if(isHighlighted)cls+=" sy-grid__select-option--highlighted";if(isDisabled)cls+=" sy-grid__select-option--disabled";return{role:"option",id:optionId(rowIndex,colIndex,optionIndex),class:cls,"aria-selected":isHighlighted?"true":"false","aria-disabled":isDisabled?"true":void 0,label:opt?.label??"",onClick:()=>{if(isDisabled)return;onPick(optionIndex)}}}function createCheckboxEditorState(initialValue){if(initialValue===true||initialValue===false){return{value:initialValue,indeterminate:false}}return{value:false,indeterminate:true}}function applyToggle(state){return{value:!state.value,indeterminate:false}}function shouldCommitOnKey$1(state,key){return key==="Enter"||key==="Tab"}function shouldCancelOnKey$1(state,key){return key==="Escape"}function shouldToggleOnKey(state,key){return key===" "}const CHECKBOX_EDITOR_CLASS="sy-grid__cell-editor sy-grid__cell-editor--checkbox";const CHECKBOX_INDETERMINATE_CLASS="sy-grid__cell-editor--indeterminate";function buildCheckboxEditorProps(input){const{state,rowIndex,colIndex,ariaLabel,onToggle,onCommit,onCancel,onBlur}=input;const cls=state.indeterminate?`${CHECKBOX_EDITOR_CLASS} ${CHECKBOX_INDETERMINATE_CLASS}`:CHECKBOX_EDITOR_CLASS;const ariaChecked=state.indeterminate?"mixed":state.value?"true":"false";const handleKeyDown=event=>{if(shouldCommitOnKey$1(state,event.key)){event.stopPropagation();if(event.key==="Enter")event.preventDefault();onCommit();return}if(shouldCancelOnKey$1(state,event.key)){event.stopPropagation();event.preventDefault();onCancel();return}if(shouldToggleOnKey(state,event.key)){event.stopPropagation();event.preventDefault();onToggle();return}};const handleChange=event=>{onToggle()};return{type:"checkbox",checked:state.value,class:cls,"data-row-index":rowIndex,"data-col-index":colIndex,"aria-label":ariaLabel,"aria-checked":ariaChecked,onChange:handleChange,onKeyDown:handleKeyDown,onBlur}}function applyIndeterminateToInput(el,state){if(el===null)return;el.indeterminate=state.indeterminate}function createTextareaEditorState(initialValue){const seed=typeof initialValue==="string"?initialValue:"";return{value:seed,composing:false,selectionStart:null,selectionEnd:null}}function applyInputValue(state,newValue,selectionStart,selectionEnd){const nextStart=selectionStart===void 0?state.selectionStart:selectionStart;const nextEnd=selectionEnd===void 0?state.selectionEnd:selectionEnd;if(newValue===state.value&&nextStart===state.selectionStart&&nextEnd===state.selectionEnd){return state}return{value:newValue,composing:state.composing,selectionStart:nextStart,selectionEnd:nextEnd}}function applyCompositionStart(state){if(state.composing)return state;return{value:state.value,composing:true,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd}}function applyCompositionEnd(state,finalValue){if(!state.composing&&finalValue===state.value)return state;return{value:finalValue,composing:false,selectionStart:state.selectionStart,selectionEnd:state.selectionEnd}}function shouldCommitOnKey(state,key,modifiers){if(state.composing)return false;if(key==="Tab")return true;if(key==="Enter"){return modifiers.shiftKey||modifiers.ctrlKey||modifiers.metaKey}return false}function shouldCancelOnKey(state,key){return key==="Escape"}function shouldInsertNewlineOnKey(state,key,modifiers){if(state.composing)return false;if(key!=="Enter")return false;return!modifiers.shiftKey&&!modifiers.ctrlKey&&!modifiers.metaKey}const TEXTAREA_EDITOR_CLASS="sy-grid__cell-editor sy-grid__cell-editor--textarea";const TEXTAREA_DEFAULT_ROWS=3;function buildTextareaEditorProps(input){const{state,rowIndex,colIndex,ariaLabel,ariaDescribedBy,rows,onInput,onCompositionStart,onCompositionEnd,onCommit,onCancel,onBlur}=input;const visibleRows=typeof rows==="number"&&Number.isFinite(rows)&&rows>0?Math.floor(rows):TEXTAREA_DEFAULT_ROWS;const handleKeyDown=event=>{const modifiers={shiftKey:event.shiftKey===true,ctrlKey:event.ctrlKey===true,metaKey:event.metaKey===true};if(shouldCommitOnKey(state,event.key,modifiers)){event.stopPropagation();event.preventDefault();onCommit();return}if(shouldCancelOnKey(state,event.key)){event.stopPropagation();event.preventDefault();onCancel();return}if(shouldInsertNewlineOnKey(state,event.key,modifiers)){event.stopPropagation();return}event.stopPropagation()};const handleInput=event=>{const target=event.target;if(target===null)return;const value=typeof target.value==="string"?target.value:"";const start=target.selectionStart??null;const end=target.selectionEnd??null;onInput(value,start,end)};const handleCompositionEnd=event=>{const target=event.target;const finalValue=target!==null&&typeof target.value==="string"?target.value:state.value;onCompositionEnd(finalValue)};return{value:state.value,rows:visibleRows,class:TEXTAREA_EDITOR_CLASS,"data-row-index":rowIndex,"data-col-index":colIndex,"aria-label":ariaLabel,"aria-multiline":"true","aria-describedby":ariaDescribedBy,onInput:handleInput,onCompositionStart,onCompositionEnd:handleCompositionEnd,onKeyDown:handleKeyDown,onBlur}}const DEFAULT_LARGE_TEXT_ROWS=10;const DEFAULT_LARGE_TEXT_COLS=60;const DEFAULT_LARGE_TEXT_MAX_LENGTH=200;const ROWS_MIN=1;const ROWS_MAX=100;const COLS_MIN=1;const COLS_MAX=200;function isPositiveInt(value){return typeof value==="number"&&Number.isInteger(value)&&value>0}function clampInt(n,lo,hi){return n<lo?lo:n>hi?hi:n}function codePointLength(value){if(typeof value!=="string")return 0;let count=0;for(const _ of value)count++;return count}function resolveLargeTextConfig(input){const rows=isPositiveInt(input.rows)?clampInt(input.rows,ROWS_MIN,ROWS_MAX):DEFAULT_LARGE_TEXT_ROWS;const cols=isPositiveInt(input.cols)?clampInt(input.cols,COLS_MIN,COLS_MAX):DEFAULT_LARGE_TEXT_COLS;let maxLength;if(input.maxLength===void 0||input.maxLength===null){maxLength=DEFAULT_LARGE_TEXT_MAX_LENGTH}else if(input.maxLength===0){maxLength=null}else if(isPositiveInt(input.maxLength)){maxLength=input.maxLength}else{maxLength=DEFAULT_LARGE_TEXT_MAX_LENGTH}return{rows,cols,maxLength}}function clampValueToMaxLength(value,maxLength){const str=typeof value==="string"?value:"";if(maxLength===null)return{value:str,clamped:false};const points=Array.from(str);if(points.length<=maxLength)return{value:str,clamped:false};return{value:points.slice(0,maxLength).join(""),clamped:true}}function exceedsMaxLength(value,maxLength){if(maxLength===null)return false;return codePointLength(value)>maxLength}function charCountLabel(value,maxLength){const count=codePointLength(value);return maxLength===null?String(count):`${count} / ${maxLength}`}function normalizeRenderOutput(output){if(output===null||typeof output!=="object")return{kind:"invalid"};const candidate=output;const cls=typeof candidate.class==="string"?candidate.class:"";if(candidate.kind==="text"){return{kind:"text",text:typeof candidate.text==="string"?candidate.text:"",class:cls}}if(candidate.kind==="html"){return{kind:"html",html:typeof candidate.html==="string"?candidate.html:"",class:cls}}if(candidate.kind==="vnode"){return{kind:"vnode",vnode:candidate.vnode}}return{kind:"invalid"}}const FALLBACK_TEXT="—";const DEFAULT_CURRENCY="USD";const DEFAULT_TRUE_LABEL="✓";const DEFAULT_FALSE_LABEL="";const BUILTIN_NAMES=["text","number","currency","percent","date","boolean","link","progressBar","sparkline","miniChart","image","icon"];function readMetaString(meta,key,fallback){if(!meta)return fallback;const raw=meta[key];if(typeof raw==="string"&&raw.length>0)return raw;return fallback}function readMetaNumber(meta,key,fallback){if(!meta)return fallback;const raw=meta[key];if(typeof raw==="number"&&Number.isFinite(raw))return raw;return fallback}function clampNumber(n,lo,hi){return n<lo?lo:n>hi?hi:n}function readMetaNumberFormat(meta,key){if(!meta)return void 0;const raw=meta[key];if(raw&&typeof raw==="object"){return raw}return void 0}function readMetaDateFormat(meta,key){if(!meta)return void 0;const raw=meta[key];if(raw&&typeof raw==="object"){return raw}return void 0}function toFiniteOrNaN(v){if(typeof v==="number")return Number.isFinite(v)?v:NaN;if(typeof v==="string"){const t2=v.trim();if(t2==="")return NaN;const n=Number(t2);return Number.isFinite(n)?n:NaN}if(typeof v==="bigint"){const n=Number(v);return Number.isFinite(n)?n:NaN}return NaN}function coerceNumberArray(value){if(Array.isArray(value)){return value.map(toFiniteOrNaN).filter(v=>Number.isFinite(v))}if(typeof value==="string"&&value.trim().length>0){const text=value.trim();if(text.startsWith("[")){try{const parsed=JSON.parse(text);if(Array.isArray(parsed))return parsed.map(toFiniteOrNaN).filter(v=>Number.isFinite(v))}catch{}}return text.split(",").map(s=>s.trim()).filter(s=>s.length>0).map(toFiniteOrNaN).filter(v=>Number.isFinite(v))}return[]}function safeString(v){try{return String(v)}catch{return""}}function coerceFiniteNumber(value){if(typeof value==="number"&&Number.isFinite(value))return value;if(typeof value==="string"&&value.trim().length>0){const parsed=Number(value);if(Number.isFinite(parsed))return parsed}return null}function coerceDate(value){if(value instanceof Date){if(Number.isFinite(value.getTime()))return value;return null}if(typeof value==="string"&&value.length>0){const parsed=new Date(value);if(Number.isFinite(parsed.getTime()))return parsed}if(typeof value==="number"&&Number.isFinite(value)){const parsed=new Date(value);if(Number.isFinite(parsed.getTime()))return parsed}return null}function escapeHtml(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function escapeAttr(s){return escapeHtml(s)}function isUnsafeUrl(url){return/^\s*(?:javascript|data|vbscript)\s*:/i.test(url)}function isUnsafeImageUrl(url){const trimmed=url.replace(/^\s+/,"");if(/^(?:javascript|vbscript)\s*:/i.test(trimmed))return true;if(/^data\s*:/i.test(trimmed))return!/^data\s*:\s*image\//i.test(trimmed);return false}function builtinText(input){if(typeof input.formatted==="string"){return{kind:"text",text:input.formatted}}if(input.value==null)return{kind:"text",text:""};return{kind:"text",text:safeString(input.value)}}function builtinNumber(input){const n=coerceFiniteNumber(input.value);if(n===null)return{kind:"text",text:FALLBACK_TEXT};const opts=readMetaNumberFormat(input.meta,"numberFormat");try{const formatter=new Intl.NumberFormat(void 0,opts);return{kind:"text",text:formatter.format(n)}}catch{return{kind:"text",text:String(n)}}}function builtinCurrency(input){const n=coerceFiniteNumber(input.value);if(n===null)return{kind:"text",text:FALLBACK_TEXT};const overrides=readMetaNumberFormat(input.meta,"numberFormat");const currency=readMetaString(input.meta,"currency",DEFAULT_CURRENCY);const opts={style:"currency",currency,...overrides??{}};try{const formatter=new Intl.NumberFormat(void 0,opts);return{kind:"text",text:formatter.format(n)}}catch{return{kind:"text",text:String(n)}}}function builtinPercent(input){const n=coerceFiniteNumber(input.value);if(n===null)return{kind:"text",text:FALLBACK_TEXT};const overrides=readMetaNumberFormat(input.meta,"numberFormat");const opts={style:"percent",...overrides??{}};try{const formatter=new Intl.NumberFormat(void 0,opts);return{kind:"text",text:formatter.format(n)}}catch{return{kind:"text",text:String(n)}}}function builtinDate(input){const d=coerceDate(input.value);if(d===null)return{kind:"text",text:FALLBACK_TEXT};const opts=readMetaDateFormat(input.meta,"dateFormat");try{const formatter=new Intl.DateTimeFormat(void 0,opts);return{kind:"text",text:formatter.format(d)}}catch{return{kind:"text",text:d.toISOString()}}}function builtinBoolean(input){const v=input.value;if(v===true){return{kind:"text",text:readMetaString(input.meta,"trueLabel",DEFAULT_TRUE_LABEL)}}if(v===false){return{kind:"text",text:readMetaString(input.meta,"falseLabel",DEFAULT_FALSE_LABEL)}}return{kind:"text",text:FALLBACK_TEXT}}function builtinLink(input){const hrefField=readMetaString(input.meta,"hrefField","");if(hrefField.length===0){return builtinText(input)}const row=input.row;if(!row||typeof row!=="object"){return builtinText(input)}const rawHref=row[hrefField];if(typeof rawHref!=="string"||rawHref.length===0){return builtinText(input)}if(isUnsafeUrl(rawHref)){return builtinText(input)}const labelSource=typeof input.formatted==="string"?input.formatted:input.value==null?"":safeString(input.value);const label=labelSource.length>0?labelSource:rawHref;const html=`<a href="${escapeAttr(rawHref)}">${escapeHtml(label)}</a>`;return{kind:"html",html}}function builtinProgressBar(input){const n=coerceFiniteNumber(input.value);if(n===null)return{kind:"text",text:FALLBACK_TEXT};const min=readMetaNumber(input.meta,"min",0);const max=readMetaNumber(input.meta,"max",100);const span=max-min;const pct=span===0?n>=max?100:0:clampNumber((n-min)/span*100,0,100);const width=Math.round(pct*10)/10;const showLabel=input.meta?.showLabel!==false;const label=typeof input.formatted==="string"&&input.formatted.length>0?input.formatted:`${Math.round(pct)}%`;const barClass=readMetaString(input.meta,"barClass","");const fillClass=barClass.length>0?`sy-grid__cell-progress-fill ${escapeAttr(barClass)}`:"sy-grid__cell-progress-fill";const wrapStyle="display:flex;align-items:center;gap:6px;width:100%;min-width:0";const trackStyle="position:relative;flex:1 1 auto;min-width:0;height:8px;border-radius:4px;overflow:hidden;background:var(--sy-grid-progress-track,rgba(15,23,42,0.1))";const fillStyle=`width:${width}%;height:100%;border-radius:4px;background:var(--sy-grid-progress-fill,var(--sy-color-primary,#2563eb))`;const labelStyle="flex:0 0 auto;font-size:11px;color:var(--sy-grid-text-muted,#6b7280);font-variant-numeric:tabular-nums";const labelHtml=showLabel?`<span class="sy-grid__cell-progress-label" style="${labelStyle}">${escapeHtml(label)}</span>`:"";const html=`<div class="sy-grid__cell-progress" style="${wrapStyle}" role="progressbar" aria-valuenow="${escapeAttr(String(n))}" aria-valuemin="${escapeAttr(String(min))}" aria-valuemax="${escapeAttr(String(max))}"><div class="sy-grid__cell-progress-track" style="${trackStyle}"><div class="${fillClass}" style="${fillStyle}"></div></div>${labelHtml}</div>`;return{kind:"html",html}}const SPARKLINE_TYPES=["line","area","column","pie","stock"];function builtinSparkline(input){const values=coerceNumberArray(input.value);if(values.length===0)return{kind:"text",text:FALLBACK_TEXT};const typeRaw=readMetaString(input.meta,"type","line");const type=SPARKLINE_TYPES.includes(typeRaw)?typeRaw:"line";const width=readMetaNumber(input.meta,"width",100);const height=readMetaNumber(input.meta,"height",28);const color=readMetaString(input.meta,"color","");const showValue=input.meta?.showValue===true;const attrs=[`values="${escapeAttr(values.join(","))}"`,`type="${escapeAttr(type)}"`,`width="${width}"`,`height="${height}"`,color.length>0?`color="${escapeAttr(color)}"`:"",showValue?"show-value":""].filter(a=>a.length>0).join(" ");return{kind:"html",html:`<sy-sparkline-chart ${attrs}></sy-sparkline-chart>`}}function builtinMiniChart(input){const values=coerceNumberArray(input.value);if(values.length===0)return{kind:"text",text:FALLBACK_TEXT};const type=readMetaString(input.meta,"type","line")==="bar"?"bar":"line";const width=readMetaNumber(input.meta,"width",100);const height=readMetaNumber(input.meta,"height",28);const color=escapeAttr(readMetaString(input.meta,"color","#2563eb"));const pad=2;const innerW=Math.max(1,width-pad*2);const innerH=Math.max(1,height-pad*2);const min=Math.min(...values);const max=Math.max(...values);const flat=max===min;const normOf=v=>flat?.5:(v-min)/(max-min);const yOf=v=>pad+innerH-normOf(v)*innerH;let inner;if(type==="bar"){const slot=innerW/values.length;const barW=Math.max(1,slot*.7);inner=values.map((v,i)=>{const barH=Math.max(1.5,normOf(v)*innerH);const x=pad+i*slot+(slot-barW)/2;const y=pad+innerH-barH;return`<rect x="${x.toFixed(1)}" y="${y.toFixed(1)}" width="${barW.toFixed(1)}" height="${barH.toFixed(1)}" fill="${color}" rx="0.5"></rect>`}).join("")}else if(values.length===1){inner=`<circle cx="${(pad+innerW/2).toFixed(1)}" cy="${yOf(values[0]).toFixed(1)}" r="1.75" fill="${color}"></circle>`}else{const xOf=i=>pad+i/(values.length-1)*innerW;const points=values.map((v,i)=>`${xOf(i).toFixed(1)},${yOf(v).toFixed(1)}`).join(" ");inner=`<polyline points="${points}" fill="none" stroke="${color}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></polyline>`}const label=escapeAttr(`chart: ${values.join(", ")}`);const html=`<svg class="sy-grid__cell-minichart" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" role="img" aria-label="${label}">${inner}</svg>`;return{kind:"html",html}}function builtinImage(input){const raw=input.value;const url=typeof raw==="string"?raw.trim():"";if(url.length===0||isUnsafeImageUrl(url))return builtinText(input);const altField=readMetaString(input.meta,"altField","");const altRaw=altField.length>0&&input.row&&typeof input.row==="object"?input.row[altField]:"";const alt=escapeAttr(typeof altRaw==="string"?altRaw:"");const width=readMetaNumber(input.meta,"width",0);const height=readMetaNumber(input.meta,"height",0);const rounded=input.meta?.rounded===true;const sizeAttrs=`${width>0?` width="${width}"`:""}${height>0?` height="${height}"`:""}`;const style=rounded?`max-width:100%;max-height:100%;object-fit:cover;vertical-align:middle;border-radius:9999px`:`max-width:100%;max-height:100%;object-fit:contain;vertical-align:middle`;return{kind:"html",html:`<img src="${escapeAttr(url)}" alt="${alt}"${sizeAttrs} loading="lazy" style="${style}">`}}function builtinIcon(input){const raw=input.value;const map=input.meta?.map;const key=raw==null?"":safeString(raw);let glyph=key;if(map&&typeof map==="object"&&key.length>0){const mapped=map[key];if(typeof mapped==="string")glyph=mapped}if(glyph.length===0)return{kind:"text",text:FALLBACK_TEXT};const title=readMetaString(input.meta,"title","");const titleAttr=title.length>0?` title="${escapeAttr(title)}" aria-label="${escapeAttr(title)}"`:"";if(/^(https?:)?\/\//i.test(glyph)&&!isUnsafeUrl(glyph)){const size2=readMetaNumber(input.meta,"size",16);return{kind:"html",html:`<img src="${escapeAttr(glyph)}" alt="${escapeAttr(title)}" width="${size2}" height="${size2}" loading="lazy" style="vertical-align:middle">`}}const color=readMetaString(input.meta,"color","");const size=readMetaNumber(input.meta,"size",0);const style=`${color.length>0?`color:${escapeAttr(color)};`:""}${size>0?`font-size:${size}px;`:""}line-height:1`;return{kind:"html",html:`<span class="sy-grid__cell-icon"${titleAttr} style="${style}">${escapeHtml(glyph)}</span>`}}function buildBuiltinEntries(){return[["text",builtinText],["number",builtinNumber],["currency",builtinCurrency],["percent",builtinPercent],["date",builtinDate],["boolean",builtinBoolean],["link",builtinLink],["progressBar",builtinProgressBar],["sparkline",builtinSparkline],["miniChart",builtinMiniChart],["image",builtinImage],["icon",builtinIcon]]}function createRendererRegistry(opts={}){const map=new Map;if(opts.includeBuiltins!==false){for(const[name,renderer]of buildBuiltinEntries()){map.set(name,renderer)}}function register(name,renderer){if(typeof name!=="string"||name.trim().length===0){console.warn("[sy-grid] renderer-registry.register: name must be a non-empty string.");return false}if(typeof renderer!=="function"){console.warn(`[sy-grid] renderer-registry.register("${name}"): renderer must be a function.`);return false}if(map.has(name)){console.warn(`[sy-grid] renderer-registry.register("${name}"): name already registered; use replace() to overwrite.`);return false}map.set(name,renderer);return true}function replace(name,renderer){if(typeof name!=="string"||name.trim().length===0)return false;if(typeof renderer!=="function")return false;if(!map.has(name))return false;map.set(name,renderer);return true}function unregister(name){if(typeof name!=="string")return false;if(!map.has(name))return false;map.delete(name);return true}function get(name){if(typeof name!=="string")return null;const found=map.get(name);return found??null}function has(name){if(typeof name!=="string")return false;return map.has(name)}function list(){return Array.from(map.keys())}function clear(){map.clear()}return{register,replace,unregister,get,has,list,clear}}const BUILTIN_RENDERER_NAMES=BUILTIN_NAMES;function isFormulaText(value){if(typeof value!=="string")return false;const s=value.trimStart();return s.length>1&&s[0]==="="}const WARN_PREFIX$1="[Syidax] sy-grid:";function isWhitespace(c){return c===" "||c===" "||c==="\n"||c==="\r"||c==="\f"||c==="\v"}function parseCellClassRuleExpression(expr){return parseGridExpression(expr,true)}function evaluateCellClassRule(rule,params){if(typeof rule==="function"){try{return Boolean(rule(params))}catch(err){warnGridExpression("RULE-FN",params.colId,params.node.rowIndex,void 0,err);return false}}if(typeof rule==="string"){let parsed;try{parsed=parseCellClassRuleExpression(rule)}catch(err){const msg=err instanceof Error?err.message:String(err);warnGridExpression("RULE-PARSE",params.colId,params.node.rowIndex,msg);return false}const lookup=name=>{if(name==="value")return params.value;const data=params.data;if(data===null||data===void 0||typeof data!=="object"){return void 0}return data[name]};try{return Boolean(evaluateGridExpression(parsed.ast,lookup))}catch(err){warnGridExpression("RULE-EVAL",params.colId,params.node.rowIndex,void 0,err);return false}}warnGridExpression("RULE-TYPE",params.colId,params.node.rowIndex);return false}function isValidClassName(name){if(typeof name!=="string")return false;if(name.length===0)return false;for(let i=0;i<name.length;i++){if(isWhitespace(name[i]))return false}return true}function splitOnWhitespace(s){const out=[];let buf="";for(let i=0;i<s.length;i++){const c=s[i];if(isWhitespace(c)){if(buf.length>0){out.push(buf);buf=""}continue}buf+=c}if(buf.length>0)out.push(buf);return out}function applyCellClassRules(input){if(input==null||typeof input!=="object"){console.warn(`${WARN_PREFIX$1} applyCellClassRules called with non-object input.`);return""}const params={value:input.value,data:input.row,node:{rowIndex:input.rowIndex},colId:input.colId,formatted:input.formatted,colDef:input.colDef,context:input.context,api:input.api};const seen=new Set;const out=[];const warnedKeys=new Set;const base=input.cellClass;if(base!==void 0&&base!==null){if(typeof base==="function"){let result;try{result=base(params)}catch(err){if(!warnedKeys.has("__cellClass_fn")){warnedKeys.add("__cellClass_fn");console.warn(`${WARN_PREFIX$1} cellClass function threw on column "${input.colId}":`,err)}result=""}if(typeof result==="string"&&result.length>0){const tokens=splitOnWhitespace(result);for(let i=0;i<tokens.length;i++){pushIfValid(tokens[i],seen,out,warnedKeys,input.colId)}}else if(result!==""&&typeof result!=="string"){if(!warnedKeys.has("__cellClass_fn_shape")){warnedKeys.add("__cellClass_fn_shape");console.warn(`${WARN_PREFIX$1} cellClass function on column "${input.colId}" returned non-string; ignoring.`)}}}else if(typeof base==="string"){const tokens=splitOnWhitespace(base);for(let i=0;i<tokens.length;i++){pushIfValid(tokens[i],seen,out,warnedKeys,input.colId)}}else if(Array.isArray(base)){for(let i=0;i<base.length;i++){const entry=base[i];if(typeof entry==="string"){pushIfValid(entry,seen,out,warnedKeys,input.colId)}else{if(!warnedKeys.has("__cellClass_array_shape")){warnedKeys.add("__cellClass_array_shape");console.warn(`${WARN_PREFIX$1} cellClass array on column "${input.colId}" contains non-string; ignoring.`)}}}}else{if(!warnedKeys.has("__cellClass_shape")){warnedKeys.add("__cellClass_shape");console.warn(`${WARN_PREFIX$1} cellClass on column "${input.colId}" must be string | string[] | function; ignoring.`)}}}const rules=input.cellClassRules;if(rules!==void 0&&rules!==null&&typeof rules==="object"){const keys=Object.keys(rules);for(let i=0;i<keys.length;i++){const className=keys[i];if(!isValidClassName(className)){const warnKey=`name:${className}`;if(!warnedKeys.has(warnKey)){warnedKeys.add(warnKey);console.warn(`${WARN_PREFIX$1} cellClassRules class name on column "${input.colId}" is empty / contains whitespace; skipping.`)}continue}const rule=rules[className];if(rule===void 0||rule===null){const warnKey=`null:${className}`;if(!warnedKeys.has(warnKey)){warnedKeys.add(warnKey);console.warn(`${WARN_PREFIX$1} cellClassRules rule for "${className}" on column "${input.colId}" is null; skipping.`)}continue}const matched=evaluateCellClassRule(rule,params);if(matched){if(!seen.has(className)){seen.add(className);out.push(className)}}}}else if(rules!==void 0&&rules!==null){if(!warnedKeys.has("__rules_shape")){warnedKeys.add("__rules_shape");console.warn(`${WARN_PREFIX$1} cellClassRules on column "${input.colId}" must be an object; ignoring.`)}}return out.join(" ")}function pushIfValid(name,seen,out,warnedKeys,colId){if(!isValidClassName(name)){const warnKey=`name:${name}`;if(!warnedKeys.has(warnKey)){warnedKeys.add(warnKey);console.warn(`${WARN_PREFIX$1} cellClass entry on column "${colId}" is empty / contains whitespace; skipping ("${name}").`)}return}if(seen.has(name))return;seen.add(name);out.push(name)}const WARN_PREFIX="[Syidax] sy-grid:";const CAMEL_CSS_KEY=/^[a-z][a-zA-Z0-9-]*$/;const KEBAB_CSS_KEY=/^-?[a-z][a-z0-9-]*$/;function validateCssKey(key){if(typeof key!=="string")return false;if(key.length===0)return false;return CAMEL_CSS_KEY.test(key)||KEBAB_CSS_KEY.test(key)}function coerceCssValue(value){if(typeof value==="string"){if(value.length===0)return null;return value}if(typeof value==="number"){if(!Number.isFinite(value))return null;return String(value)}return null}function applyObjectSpec(spec,acc,warnedKeys,colId){const keys=Object.keys(spec);for(let i=0;i<keys.length;i++){const key=keys[i];if(!validateCssKey(key)){const warnKey=`key:${key}`;if(!warnedKeys.has(warnKey)){warnedKeys.add(warnKey);console.warn(`${WARN_PREFIX} cellStyle key on column "${colId}" is not a valid CSS property name; skipping ("${key}").`)}continue}const raw=spec[key];const coerced=coerceCssValue(raw);if(coerced===null){const warnKey=`value:${key}`;if(!warnedKeys.has(warnKey)){warnedKeys.add(warnKey);console.warn(`${WARN_PREFIX} cellStyle value on column "${colId}" key "${key}" is not a finite string / number; skipping.`)}continue}acc[key]=coerced}}function applyFunctionSpec(fn,params,acc,warnedKeys,colId){let result;try{result=fn(params)}catch(err){if(!warnedKeys.has("__fn_throw")){warnedKeys.add("__fn_throw");console.warn(`${WARN_PREFIX} cellStyle function on column "${colId}" threw:`,err)}return}if(result===null||result===void 0){return}if(typeof result!=="object"||Array.isArray(result)){if(!warnedKeys.has("__fn_shape")){warnedKeys.add("__fn_shape");console.warn(`${WARN_PREFIX} cellStyle function on column "${colId}" must return an object / null / undefined; ignoring.`)}return}applyObjectSpec(result,acc,warnedKeys,colId)}function applyArraySpec(arr,params,acc,warnedKeys,colId){for(let i=0;i<arr.length;i++){const entry=arr[i];if(entry===null||entry===void 0){continue}if(typeof entry==="function"){applyFunctionSpec(entry,params,acc,warnedKeys,colId);continue}if(Array.isArray(entry)){applyArraySpec(entry,params,acc,warnedKeys,colId);continue}if(typeof entry==="object"){applyObjectSpec(entry,acc,warnedKeys,colId);continue}if(!warnedKeys.has(`__arr_entry:${i}`)){warnedKeys.add(`__arr_entry:${i}`);console.warn(`${WARN_PREFIX} cellStyle array entry on column "${colId}" must be object / function / array; ignoring (index ${i}).`)}}}function applyCellStyle(input){const empty={style:{},meta:{kind:"none",appliedKeys:0}};if(input===null||input===void 0||typeof input!=="object"){console.warn(`${WARN_PREFIX} applyCellStyle called with non-object input.`);return empty}const spec=input.cellStyle;if(spec===void 0||spec===null){return empty}const colId=typeof input.colId==="string"?input.colId:"";const params={value:input.value,data:input.row,node:{rowIndex:input.rowIndex},colId,formatted:input.formatted,colDef:input.colDef,context:input.context,api:input.api};const acc={};const warnedKeys=new Set;let kind="none";if(typeof spec==="function"){kind="function";applyFunctionSpec(spec,params,acc,warnedKeys,colId)}else if(Array.isArray(spec)){kind="array";applyArraySpec(spec,params,acc,warnedKeys,colId)}else if(typeof spec==="object"){kind="object";applyObjectSpec(spec,acc,warnedKeys,colId)}else{console.warn(`${WARN_PREFIX} cellStyle on column "${colId}" must be object / function / array; ignoring.`);return empty}return{style:acc,meta:{kind,appliedKeys:Object.keys(acc).length}}}const syGridCss=()=>`.sc-sy-grid-h{display:block;position:relative;--sy-grid-bg: #ffffff;--sy-grid-border: #e5e7eb;--sy-grid-text: #111827;--sy-grid-text-muted: #6b7280;--sy-grid-sort-indicator-color: #9ca3af;--sy-grid-sort-indicator-active-color: var(--sy-color-primary, #2563eb);--sy-grid-header-bg: #f9fafb;--sy-grid-header-bg-hover: #f3f4f6;--sy-grid-header-border: #e5e7eb;--sy-grid-header-color: #111827;--sy-grid-header-font-weight: 600;--sy-grid-filter-icon-color: currentColor;--sy-grid-filter-icon-active-color: var(--sy-color-primary, #2563eb);--sy-grid-filter-dropdown-bg: #ffffff;--sy-grid-filter-dropdown-color: #111827;--sy-grid-filter-dropdown-border: #e5e7eb;--sy-grid-filter-dropdown-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);--sy-grid-filter-button-primary-bg: var(--sy-color-primary, #2563eb);--sy-grid-filter-button-primary-color: #ffffff;--sy-grid-pagination-bg: #f9fafb;--sy-grid-pagination-color: #111827;--sy-grid-pagination-border: #e5e7eb;--sy-grid-pagination-active-bg: var(--sy-color-primary, #2563eb);--sy-grid-pagination-active-color: #ffffff;--sy-grid-pagination-disabled-color: #9ca3af;--sy-grid-pagination-hover-bg: rgba(15, 23, 42, 0.06);--sy-grid-row-height: 32px;--sy-grid-row-bg-odd: #ffffff;--sy-grid-row-bg-even: #f9fafb;--sy-grid-row-border: #f3f4f6;--sy-grid-row-color: #111827;--sy-grid-row-bg-hover: rgba(37, 99, 235, 0.06);--sy-grid-row-bg-selected: rgba(37, 99, 235, 0.12);--sy-grid-viewport-bg: #ffffff;--sy-grid-cell-padding-x: 12px;--sy-grid-cell-font-size: 13px;--sy-grid-cell-editor-bg: #ffffff;--sy-grid-cell-editor-color: #111827;--sy-grid-cell-editor-border: var(--sy-color-primary, #2563eb);--sy-grid-cell-editor-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);--sy-grid-scrollbar-thumb: rgba(15, 23, 42, 0.18);--sy-grid-scrollbar-track: transparent;--sy-grid-toolbar-bg: #ffffff;--sy-grid-toolbar-border: #e5e7eb;--sy-grid-quick-filter-input-bg: #ffffff;--sy-grid-quick-filter-input-color: #111827;--sy-grid-quick-filter-input-border: #d1d5db;--sy-grid-quick-filter-input-placeholder: #9ca3af;--sy-grid-quick-filter-input-focus: var(--sy-color-primary, #2563eb);--sy-grid-quick-filter-clear-color: #6b7280;--sy-grid-quick-filter-clear-hover: rgba(15, 23, 42, 0.08);--sy-grid-empty-state-bg: rgba(255, 255, 255, 0.92);--sy-grid-empty-state-color: #4b5563;--sy-grid-empty-state-icon-color: #9ca3af;--sy-grid-empty-state-action-bg: var(--sy-color-primary, #2563eb);--sy-grid-empty-state-action-color: #ffffff;--sy-grid-loading-backdrop: rgba(255, 255, 255, 0.7);--sy-grid-loading-spinner-color: var(--sy-color-primary, #2563eb);--sy-grid-loading-message-color: #4b5563;--sy-grid-tooltip-bg: #111827;--sy-grid-tooltip-color: #ffffff;--sy-grid-tooltip-border: rgba(255, 255, 255, 0.12);--sy-grid-tooltip-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);--sy-grid-active-cell-outline: var(--sy-color-primary, #2563eb);--sy-grid-active-row-bg: rgba(37, 99, 235, 0.08);--sy-grid-viewport-focus-outline: var(--sy-color-primary, #2563eb)}[data-theme=dark].sc-sy-grid-h{--sy-grid-filter-dropdown-bg: #1f2937;--sy-grid-filter-dropdown-color: #f3f4f6;--sy-grid-filter-dropdown-border: #374151;--sy-grid-filter-dropdown-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);--sy-grid-pagination-bg: #111827;--sy-grid-pagination-color: #f3f4f6;--sy-grid-pagination-border: #374151;--sy-grid-pagination-disabled-color: #4b5563;--sy-grid-pagination-hover-bg: rgba(255, 255, 255, 0.06);--sy-grid-row-bg-odd: #111827;--sy-grid-row-bg-even: #1f2937;--sy-grid-row-border: #374151;--sy-grid-row-color: #f3f4f6;--sy-grid-row-bg-hover: rgba(96, 165, 250, 0.12);--sy-grid-row-bg-selected: rgba(96, 165, 250, 0.22);--sy-grid-viewport-bg: #111827;--sy-grid-toolbar-bg: #111827;--sy-grid-toolbar-border: #374151;--sy-grid-quick-filter-input-bg: #1f2937;--sy-grid-quick-filter-input-color: #f3f4f6;--sy-grid-quick-filter-input-border: #374151;--sy-grid-quick-filter-input-placeholder: #6b7280;--sy-grid-quick-filter-clear-color: #9ca3af;--sy-grid-quick-filter-clear-hover: rgba(255, 255, 255, 0.08);--sy-grid-empty-state-bg: rgba(17, 24, 39, 0.9);--sy-grid-empty-state-color: #d1d5db;--sy-grid-empty-state-icon-color: #6b7280;--sy-grid-loading-backdrop: rgba(17, 24, 39, 0.7);--sy-grid-loading-spinner-color: #60a5fa;--sy-grid-loading-message-color: #d1d5db;--sy-grid-active-cell-outline: #60a5fa;--sy-grid-active-row-bg: rgba(96, 165, 250, 0.16);--sy-grid-viewport-focus-outline: #60a5fa;--sy-grid-cell-editor-bg: #0f172a;--sy-grid-cell-editor-color: #f3f4f6;--sy-grid-cell-editor-border: #60a5fa;--sy-grid-cell-editor-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.34);--sy-grid-tooltip-bg: #f9fafb;--sy-grid-tooltip-color: #111827;--sy-grid-tooltip-border: rgba(148, 163, 184, 0.35);--sy-grid-tooltip-shadow: 0 10px 24px rgba(0, 0, 0, 0.45)}.sy-grid__watermark.sc-sy-grid{position:absolute;top:4px;right:6px;font-size:10px;line-height:1;padding:2px 6px;background:var(--sy-grid-bg, rgba(255, 255, 255, 0.85));border:1px solid var(--sy-grid-border, #e5e7eb);border-radius:999px;color:var(--sy-grid-text-muted, #6b7280);pointer-events:none;z-index:2}.sy-grid__brand-strip.sc-sy-grid{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:36px;margin:0;padding:2px 8px;line-height:0;pointer-events:none;user-select:none;-webkit-user-select:none}.sy-grid__brand.sc-sy-grid{display:block;box-sizing:content-box;margin:0;padding:0;border:0;background:none;line-height:0;color:var(--sy-grid-text, #111827);opacity:1;pointer-events:none;user-select:none;-webkit-user-select:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}.sy-grid__brand[hidden].sc-sy-grid{display:none !important}.sy-grid__brand[data-sy-brand=custom].sc-sy-grid{opacity:1}.sy-grid__brand.sc-sy-grid > svg.sc-sy-grid{display:block;width:auto;height:32px;aspect-ratio:118/32;pointer-events:none}.sy-grid__brand.sc-sy-grid > img.sc-sy-grid{display:block;width:auto;height:auto;max-width:120px;max-height:32px;pointer-events:none}@media print{.sy-grid__brand-strip.sc-sy-grid{display:flex !important;visibility:visible !important}.sy-grid__brand.sc-sy-grid:not([hidden]){display:block !important;visibility:visible !important}}@media(forced-colors: active){.sy-grid__brand.sc-sy-grid{color:CanvasText}}.sy-grid__header.sc-sy-grid{display:flex;align-items:stretch;background:var(--sy-grid-header-bg, #f9fafb);border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb);color:var(--sy-grid-header-color, #111827);font-weight:var(--sy-grid-header-font-weight, 600);font-size:13px;user-select:none}.sy-grid__header-rowgroup.sc-sy-grid{position:relative;z-index:3}.sy-grid__header-clip.sc-sy-grid{overflow:hidden}.sy-grid__header-cell--pinned-left.sc-sy-grid, .sy-grid__header-filter-cell--pinned-left.sc-sy-grid, .sy-grid__header-cell--pinned-right.sc-sy-grid, .sy-grid__header-filter-cell--pinned-right.sc-sy-grid{background:var(--sy-grid-header-bg, #f9fafb)}.sy-grid__cell--pinned-left.sc-sy-grid, .sy-grid__cell--pinned-right.sc-sy-grid{background:inherit}.sy-grid__header-cell--pinned-left-last.sc-sy-grid, .sy-grid__header-filter-cell--pinned-left-last.sc-sy-grid, .sy-grid__cell--pinned-left-last.sc-sy-grid{box-shadow:2px 0 4px -1px rgba(15,23,42,.18)}.sy-grid__header-cell--pinned-right-first.sc-sy-grid, .sy-grid__header-filter-cell--pinned-right-first.sc-sy-grid, .sy-grid__cell--pinned-right-first.sc-sy-grid{box-shadow:-2px 0 4px -1px rgba(15,23,42,.18)}.sy-grid__header-group-row.sc-sy-grid{display:flex;align-items:stretch;width:max-content;min-width:100%;background:var(--sy-grid-header-bg, #f9fafb);border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb);font-weight:var(--sy-grid-header-font-weight, 600);font-size:12px;color:var(--sy-grid-header-color, #111827);user-select:none}.sy-grid__header-group-cell.sc-sy-grid{display:flex;align-items:center;justify-content:center;padding:4px var(--sy-grid-cell-padding-x, 12px);box-sizing:border-box;overflow:hidden;border-right:1px solid var(--sy-grid-header-border, #e5e7eb);background:var(--sy-grid-header-bg, #f9fafb)}.sy-grid__header-group-cell.sc-sy-grid:last-child{border-right:none}.sy-grid__header-group-cell--filler.sc-sy-grid{border-right-color:rgba(0,0,0,0)}.sy-grid__header-group-label.sc-sy-grid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__header-group-toggle.sc-sy-grid{flex:0 0 auto;margin-left:6px;width:18px;height:18px;padding:0;line-height:1;font-size:11px;border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:4px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:inherit;cursor:pointer}.sy-grid__header-group-toggle.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-header-bg-hover, rgba(0, 0, 0, 0.06))}.sy-grid__group-row.sc-sy-grid{background:var(--sy-grid-header-bg, #f9fafb);font-weight:600}.sy-grid__group-row-cell.sc-sy-grid{display:flex;align-items:center;gap:8px;flex:1 1 auto;min-width:0;padding:0 var(--sy-grid-cell-padding-x, 12px);position:sticky;left:0;max-width:100%}.sy-grid__group-row-toggle.sc-sy-grid{flex:0 0 auto;width:20px;height:20px;padding:0;line-height:1;font-size:11px;border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:4px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:inherit;cursor:pointer}.sy-grid__group-row-toggle.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-header-bg-hover, rgba(0, 0, 0, 0.06))}.sy-grid__group-row-label.sc-sy-grid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__group-row-count.sc-sy-grid{flex:0 0 auto;opacity:.6;font-weight:400}.sy-grid__group-agg-cell.sc-sy-grid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__group-agg-cell--first.sc-sy-grid{display:flex;align-items:center;gap:8px;min-width:0}.sy-grid__group-agg-cell--agg.sc-sy-grid{font-weight:600;font-variant-numeric:tabular-nums}.sy-grid__group-footer-row.sc-sy-grid{background:var(--sy-grid-header-bg, #f9fafb);border-top:1px solid var(--sy-grid-header-border, #e5e7eb);font-size:12px}.sy-grid__group-footer-cell.sc-sy-grid{opacity:.85;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__group-footer-cell--agg.sc-sy-grid{font-weight:600;font-variant-numeric:tabular-nums}.sy-grid__tree-cell.sc-sy-grid{display:flex;align-items:center;gap:6px;min-width:0}.sy-grid__tree-indent.sc-sy-grid{flex:0 0 auto}.sy-grid__tree-toggle.sc-sy-grid{flex:0 0 auto;width:20px;height:20px;padding:0;line-height:1;font-size:11px;border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:4px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:inherit;cursor:pointer}.sy-grid__tree-toggle.sc-sy-grid:disabled{cursor:default;opacity:.5}.sy-grid__tree-toggle-spacer.sc-sy-grid{flex:0 0 auto;width:20px}.sy-grid__tree-label.sc-sy-grid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.sy-grid__tree-row--filler.sc-sy-grid .sy-grid__tree-label.sc-sy-grid{font-weight:400;opacity:.6;font-style:italic}.sy-grid__pivot-row--subtotal.sc-sy-grid{background:var(--sy-grid-subtotal-row-bg, rgba(0, 0, 0, 0.03));font-weight:600}.sy-grid__tree-count.sc-sy-grid{flex:0 0 auto;opacity:.6;font-weight:400}.sy-grid__detail-toggle.sc-sy-grid{flex:0 0 auto;width:20px;height:20px;margin-right:6px;padding:0;line-height:1;font-size:11px;vertical-align:middle;border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:4px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:inherit;cursor:pointer}.sy-grid__detail-toggle.sc-sy-grid:disabled{cursor:default;opacity:.5}.sy-grid__detail-row.sc-sy-grid{background:var(--sy-grid-detail-bg, #fbfcfd);border-top:1px solid var(--sy-grid-header-border, #e5e7eb);border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb)}.sy-grid__pinned-band.sc-sy-grid{position:relative;flex:0 0 auto;z-index:2;background:var(--sy-grid-pinned-row-bg, #f8fafc);outline:none}.sy-grid__pinned-band--top.sc-sy-grid{border-bottom:2px solid var(--sy-grid-pinned-row-border, #cbd5e1)}.sy-grid__pinned-band--bottom.sc-sy-grid{border-top:2px solid var(--sy-grid-pinned-row-border, #cbd5e1)}.sy-grid__pinned-clip.sc-sy-grid{overflow:hidden}.sy-grid__pinned-window.sc-sy-grid{position:relative}.sy-grid__row--pinned.sc-sy-grid{font-weight:var(--sy-grid-pinned-row-font-weight, 600)}.sy-grid__pinned-band.sc-sy-grid:focus-visible .sy-grid__cell--active.sc-sy-grid, .sy-grid__pinned-band.sc-sy-grid:focus .sy-grid__cell--active.sc-sy-grid{box-shadow:inset 0 0 0 2px var(--sy-grid-focus-ring, #2563eb)}.sy-grid__full-width-row.sc-sy-grid{display:flex;align-items:stretch;background:var(--sy-grid-full-width-bg, #ffffff);border-bottom:1px solid var(--sy-grid-row-border, #e5e7eb)}.sy-grid__full-width-cell.sc-sy-grid{display:block;padding:0;overflow:hidden;box-sizing:border-box}.sy-grid__full-width-host.sc-sy-grid{height:100%;width:100%}.sy-grid__full-width-row.sy-grid__row--active.sc-sy-grid .sy-grid__full-width-cell.sc-sy-grid{box-shadow:inset 0 0 0 2px var(--sy-grid-focus-ring, #2563eb)}.sy-grid__detail-cell.sc-sy-grid{display:block;flex:1 1 auto;min-width:0;height:100%;padding:10px var(--sy-grid-cell-padding-x, 12px);position:sticky;left:0;max-width:100%;overflow:auto}.sy-grid__detail-shell.sc-sy-grid{font-size:12px}.sy-grid__detail-fields.sc-sy-grid{display:grid;grid-template-columns:max-content 1fr;gap:2px 16px;margin:0}.sy-grid__detail-fields.sc-sy-grid dt.sc-sy-grid{font-weight:600;opacity:.7}.sy-grid__detail-fields.sc-sy-grid dd.sc-sy-grid{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__viewport--range-dragging.sc-sy-grid{user-select:none}.sy-grid__cell--in-range.sc-sy-grid{background:var(--sy-grid-range-bg, rgba(37, 99, 235, 0.08))}.sy-grid__cell--in-range.sy-grid__cell--pinned-left.sc-sy-grid, .sy-grid__cell--in-range.sy-grid__cell--pinned-right.sc-sy-grid{background:var(--sy-grid-range-bg-opaque, #e9effc)}.sy-grid__cell--in-range.sc-sy-grid::after{content:"";position:absolute;inset:0;pointer-events:none;border:0 solid var(--sy-color-primary, #2563eb)}.sy-grid__cell--range-top.sc-sy-grid::after{border-top-width:1px}.sy-grid__cell--range-bottom.sc-sy-grid::after{border-bottom-width:1px}.sy-grid__cell--range-left.sc-sy-grid::after{border-left-width:1px}.sy-grid__cell--range-right.sc-sy-grid::after{border-right-width:1px}.sy-grid__col-spacer.sc-sy-grid{flex:0 0 auto;pointer-events:none}.sy-grid__header.sc-sy-grid, .sy-grid__header-filter-row.sc-sy-grid, .sy-grid__row.sc-sy-grid{width:max-content;min-width:100%}.sy-grid__header-cell.sc-sy-grid{display:flex;align-items:center;flex:1 1 0;padding:6px var(--sy-grid-cell-padding-x, 12px);box-sizing:border-box;cursor:default;border-right:1px solid rgba(0,0,0,0);outline:none;position:relative;overflow:hidden}.sy-grid__header-cell.sc-sy-grid:last-child{border-right:none}.sy-grid__header-cell.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-sort-indicator-active-color);outline-offset:-2px}.sy-grid__col-resize-handle.sc-sy-grid{position:absolute;top:0;right:0;bottom:0;width:8px;cursor:col-resize;background:rgba(0,0,0,0);user-select:none;touch-action:none;z-index:2}.sy-grid__column-resize-guide.sc-sy-grid{position:absolute;top:0;bottom:0;width:2px;background:var(--sy-grid-sort-indicator-active-color, rgba(0, 122, 255, 0.4));pointer-events:none;z-index:4}.sy-grid__header-cell--reorderable.sc-sy-grid{cursor:grab;touch-action:none}.sy-grid__header-cell--dragging.sc-sy-grid{opacity:.5;cursor:grabbing}.sy-grid__header-cell--dragging.sc-sy-grid > *.sc-sy-grid{pointer-events:none}.sy-grid__column-reorder-preview.sc-sy-grid{position:fixed;display:flex;align-items:center;box-sizing:border-box;padding:6px var(--sy-grid-cell-padding-x, 12px);border:1px solid var(--sy-grid-sort-indicator-active-color, #2563eb);border-radius:4px;background:var(--sy-grid-header-bg, #f9fafb);color:var(--sy-grid-header-color, #111827);box-shadow:0 8px 24px rgba(15,23,42,.18);font-size:13px;font-weight:var(--sy-grid-header-font-weight, 600);opacity:.92;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;transform:translate3d(0, 0, 0);z-index:2147483647}.sy-grid__column-reorder-preview-label.sc-sy-grid{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__header-cell--hidden.sc-sy-grid, .sy-grid__cell--hidden.sc-sy-grid{display:none}.sy-grid__header-cell--auto-sizable.sc-sy-grid{cursor:pointer}.sy-grid__header-cell--controls-hidden.sc-sy-grid .sy-grid__sort-indicator.sc-sy-grid, .sy-grid__header-cell--controls-hidden.sc-sy-grid .sy-grid__filter-icon.sc-sy-grid{display:none}.sy-grid__header-cell--sortable.sc-sy-grid{cursor:pointer}.sy-grid__header-cell--sortable.sc-sy-grid:hover{background:var(--sy-grid-header-bg-hover)}.sy-grid__header-label.sc-sy-grid{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__sort-indicator.sc-sy-grid{margin-left:6px;font-size:10px;line-height:1;color:var(--sy-grid-sort-indicator-color);opacity:0;transition:opacity 120ms ease;flex:0 0 auto}.sy-grid__header-cell--sortable.sc-sy-grid:hover .sy-grid__sort-indicator.sc-sy-grid, .sy-grid__header-cell--sortable.sc-sy-grid:focus-visible .sy-grid__sort-indicator.sc-sy-grid{opacity:.6}.sy-grid__sort-indicator--active.sc-sy-grid{color:var(--sy-grid-sort-indicator-active-color);opacity:1 !important}.sy-grid__sort-icon.sc-sy-grid{width:10px;height:10px;flex-shrink:0;fill:currentColor;opacity:1;transition:opacity .15s}.sy-grid__sort-icon--inactive.sc-sy-grid{opacity:.3}.sy-grid__sort-order.sc-sy-grid{margin-left:2px;font-size:9px;font-weight:600;line-height:1;color:var(--sy-grid-sort-indicator-active-color);opacity:.85;flex:0 0 auto;transform:translateY(-1px)}.sy-grid__filter-icon.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;margin-left:4px;padding:2px;width:18px;height:18px;border:none;background:rgba(0,0,0,0);color:var(--sy-grid-filter-icon-color);opacity:.45;cursor:pointer;border-radius:3px;transition:opacity 120ms ease,background 120ms ease,color 120ms ease;flex:0 0 auto}.sy-grid__filter-icon.sc-sy-grid:hover, .sy-grid__filter-icon.sc-sy-grid:focus-visible{opacity:1;background:rgba(15,23,42,.06)}.sy-grid__filter-icon.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-filter-icon-active-color);outline-offset:1px}.sy-grid__filter-icon--active.sc-sy-grid{color:var(--sy-grid-filter-icon-active-color);opacity:1}.sy-grid__filter-icon--open.sc-sy-grid{opacity:1;background:rgba(15,23,42,.08)}.sy-grid__filter-icon-svg.sc-sy-grid{display:block;pointer-events:none}.sy-grid__header-cell--filtered.sc-sy-grid .sy-grid__header-label.sc-sy-grid{font-weight:700}.sy-grid__filter-dropdown.sc-sy-grid{position:absolute;top:0;left:0;min-width:220px;padding:12px;background:var(--sy-grid-filter-dropdown-bg);color:var(--sy-grid-filter-dropdown-color);border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:6px;box-shadow:var(--sy-grid-filter-dropdown-shadow);z-index:1000;font-weight:400;font-size:12px;cursor:default;user-select:text}.sy-grid__filter-form.sc-sy-grid{display:flex;flex-direction:column;gap:8px}.sy-grid__filter-row.sc-sy-grid{display:flex;flex-direction:column;gap:4px}.sy-grid__filter-row--inline.sc-sy-grid{flex-direction:row;align-items:center;gap:6px}.sy-grid__filter-label.sc-sy-grid{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:inherit;opacity:.75}.sy-grid__filter-label--inline.sc-sy-grid{text-transform:none;letter-spacing:0;font-weight:400;font-size:12px;opacity:1}.sy-grid__filter-op.sc-sy-grid, .sy-grid__filter-input.sc-sy-grid{width:100%;padding:5px 7px;font-size:12px;font-family:inherit;color:inherit;background:var(--sy-grid-filter-dropdown-bg);border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:4px;box-sizing:border-box}.sy-grid__filter-op.sc-sy-grid:focus, .sy-grid__filter-input.sc-sy-grid:focus{outline:none;border-color:var(--sy-grid-filter-icon-active-color);box-shadow:0 0 0 2px rgba(37,99,235,.18)}.sy-grid__condition-builder.sc-sy-grid{display:flex;flex-direction:column;gap:8px;padding:10px 12px;margin-bottom:8px;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:6px;background:var(--sy-grid-header-bg, #f9fafb);font-size:12px}.sy-grid__condition-builder-head.sc-sy-grid{display:flex;align-items:center;gap:8px}.sy-grid__condition-builder-title.sc-sy-grid{font-weight:600}.sy-grid__condition-builder-badge.sc-sy-grid{padding:1px 6px;border-radius:8px;font-size:10px;font-weight:600;color:#fff;background:var(--sy-grid-sort-indicator-active-color, #2563eb)}.sy-grid__condition-builder-hint.sc-sy-grid{font-size:11px;opacity:.7}.sy-grid__builder-group.sc-sy-grid{display:flex;flex-direction:column;gap:6px;padding:8px;border:1px dashed var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:6px;background:var(--sy-grid-filter-dropdown-bg, #fff)}.sy-grid__builder-group--root.sc-sy-grid{border-style:solid}.sy-grid__builder-group-head.sc-sy-grid{display:flex;align-items:center;gap:6px}.sy-grid__builder-rule.sc-sy-grid{display:flex;align-items:center;gap:6px}.sy-grid__builder-rule.sc-sy-grid .sy-grid__builder-field.sc-sy-grid, .sy-grid__builder-rule.sc-sy-grid .sy-grid__builder-rule-op.sc-sy-grid{flex:0 0 auto;max-width:160px}.sy-grid__builder-rule.sc-sy-grid .sy-grid__builder-value.sc-sy-grid{flex:1 1 120px;min-width:80px}.sy-grid__builder-remove.sc-sy-grid{flex:0 0 auto;width:20px;height:20px;padding:0;line-height:1;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:4px;background:rgba(0,0,0,0);color:inherit;cursor:pointer}.sy-grid__builder-remove.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-header-bg-hover, rgba(0, 0, 0, 0.06))}.sy-grid__builder-empty.sc-sy-grid{font-size:11px;opacity:.6;padding:2px 0}.sy-grid__builder-set-chip.sc-sy-grid{display:flex;align-items:center;gap:6px;padding:3px 8px;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:10px;background:var(--sy-grid-header-bg, #f9fafb);align-self:flex-start;max-width:100%}.sy-grid__builder-set-chip.sc-sy-grid .sy-grid__builder-set-chip-text.sc-sy-grid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__builder-presets.sc-sy-grid{display:flex;flex-direction:column;gap:4px;border-top:1px dashed var(--sy-grid-filter-dropdown-border, #d1d5db);padding-top:8px}.sy-grid__builder-presets-row.sc-sy-grid{display:flex;gap:6px}.sy-grid__builder-presets-row.sc-sy-grid .sy-grid__builder-preset-name.sc-sy-grid{flex:1 1 160px;min-width:100px}.sy-grid__builder-presets-list.sc-sy-grid{display:flex;flex-wrap:wrap;gap:6px}.sy-grid__builder-preset.sc-sy-grid{display:inline-flex;align-items:center;gap:4px;padding:2px 4px 2px 0;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:10px;background:var(--sy-grid-filter-dropdown-bg, #fff)}.sy-grid__builder-preset-load.sc-sy-grid{border:none;background:rgba(0,0,0,0);padding:2px 4px 2px 8px;font-size:12px;color:inherit;cursor:pointer}.sy-grid__builder-preset-load.sc-sy-grid:hover:not(:disabled){text-decoration:underline}.sy-grid__builder-add-row.sc-sy-grid{display:flex;gap:6px}.sy-grid__header-filter-row.sc-sy-grid{display:flex;align-items:stretch;background:var(--sy-grid-header-bg, #f9fafb);border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb)}.sy-grid__header-filter-cell.sc-sy-grid{display:flex;align-items:center;flex:1 1 0;padding:4px var(--sy-grid-cell-padding-x, 12px);box-sizing:border-box;min-width:0}.sy-grid__header-filter-input.sc-sy-grid{width:100%;min-width:0;box-sizing:border-box;padding:3px 6px;font-size:12px;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:4px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:inherit}.sy-grid__header-filter-summary.sc-sy-grid{width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 6px;font-size:12px;text-align:left;border:1px dashed var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:4px;background:rgba(0,0,0,0);color:inherit;cursor:pointer}.sy-grid__header-filter-summary.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-header-bg-hover, rgba(0, 0, 0, 0.04))}.sy-grid__filter-set-body.sc-sy-grid, .sy-grid__filter-scalar-body.sc-sy-grid{display:flex;flex-direction:column;gap:8px}.sy-grid__filter-multi-section.sc-sy-grid + .sy-grid__filter-multi-section.sc-sy-grid{border-top:1px solid var(--sy-grid-border-color, rgba(0, 0, 0, 0.12));padding-top:8px}.sy-grid__filter-set-select-all.sc-sy-grid{padding-bottom:4px;border-bottom:1px solid var(--sy-grid-border-color, rgba(0, 0, 0, 0.12))}.sy-grid__filter-set-list.sc-sy-grid{max-height:180px;overflow-y:auto;display:flex;flex-direction:column;gap:2px;margin:4px 0}.sy-grid__filter-set-item.sc-sy-grid{display:flex;align-items:center;gap:6px}.sy-grid__filter-set-item.sc-sy-grid .sy-grid__filter-label--inline.sc-sy-grid{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__filter-set-count.sc-sy-grid{flex:0 0 auto;font-size:11px;opacity:.6;font-variant-numeric:tabular-nums}.sy-grid__filter-set-empty.sc-sy-grid{padding:8px 4px;font-size:12px;opacity:.6}.sy-grid__filter-actions.sc-sy-grid{display:flex;gap:6px;justify-content:flex-end;margin-top:4px}.sy-grid__filter-button.sc-sy-grid{padding:5px 10px;font-size:12px;font-family:inherit;border-radius:4px;cursor:pointer;border:1px solid var(--sy-grid-filter-dropdown-border);background:rgba(0,0,0,0);color:inherit}.sy-grid__filter-button.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-filter-icon-active-color);outline-offset:1px}.sy-grid__filter-button--primary.sc-sy-grid{background:var(--sy-grid-filter-button-primary-bg);color:var(--sy-grid-filter-button-primary-color);border-color:var(--sy-grid-filter-button-primary-bg)}.sy-grid__filter-button--primary.sc-sy-grid:hover{filter:brightness(0.95)}.sy-grid__filter-button--secondary.sc-sy-grid:hover{background:rgba(15,23,42,.06)}.sy-grid__pagination.sc-sy-grid{display:flex;align-items:center;flex:0 0 auto;gap:6px;padding:6px 8px;background:var(--sy-grid-pagination-bg);color:var(--sy-grid-pagination-color);border-top:1px solid var(--sy-grid-pagination-border);font-size:12px;user-select:none}.sy-grid__status-bar.sc-sy-grid{display:flex;align-items:center;flex:0 0 auto;gap:12px;padding:4px 8px;background:var(--sy-grid-pagination-bg);color:var(--sy-grid-pagination-color);border-top:1px solid var(--sy-grid-pagination-border);font-size:12px;user-select:none}.sy-grid__status-section.sc-sy-grid{display:inline-flex;align-items:center;gap:12px;min-width:0}.sy-grid__status-section--center.sc-sy-grid{flex:1 1 auto;justify-content:center}.sy-grid__status-section--right.sc-sy-grid{margin-left:auto;justify-content:flex-end}.sy-grid__status-panel.sc-sy-grid{white-space:nowrap}.sy-grid__main.sc-sy-grid{display:flex;align-items:stretch;flex:1 1 auto;min-height:0}.sy-grid__main.sc-sy-grid .sy-grid__body.sc-sy-grid, .sy-grid__main.sc-sy-grid .sy-grid__grid.sc-sy-grid{flex:1 1 auto;min-width:0}[style*=height].sc-sy-grid-h .sy-grid__main.sc-sy-grid, [style*=height].sc-sy-grid-h .sy-grid__main.sc-sy-grid{flex:1 1 0;min-height:0}.sy-grid__side-bar.sc-sy-grid{display:flex;align-items:stretch;flex:0 0 auto;border-left:1px solid var(--sy-grid-border);background:var(--sy-grid-header-bg)}.sy-grid__formula-bar.sc-sy-grid{display:flex;align-items:center;gap:6px;flex:0 0 auto;padding:3px 6px;border-bottom:1px solid var(--sy-grid-border);background:var(--sy-grid-header-bg);font-size:13px}.sy-grid__formula-bar.sc-sy-grid .sy-grid__formula-bar-ref.sc-sy-grid{flex:0 0 auto;min-width:96px;max-width:200px;padding:2px 6px;border:1px solid var(--sy-grid-border);border-radius:3px;background:var(--sy-grid-bg);color:#374151;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sy-grid__formula-bar.sc-sy-grid .sy-grid__formula-bar-fx.sc-sy-grid{flex:0 0 auto;font-style:italic;color:#6b7280;padding:0 2px}.sy-grid__formula-bar.sc-sy-grid .sy-grid__formula-bar-input-wrap.sc-sy-grid{position:relative;flex:1 1 auto;min-width:0}.sy-grid__formula-bar.sc-sy-grid .sy-grid__formula-bar-input.sc-sy-grid{width:100%;box-sizing:border-box;font:inherit;font-family:Consolas,"SFMono-Regular",monospace;padding:3px 6px;border:1px solid var(--sy-grid-border);border-radius:3px;background:var(--sy-grid-bg);color:inherit}.sy-grid__formula-bar.sc-sy-grid .sy-grid__formula-bar-input.sc-sy-grid:focus{outline:2px solid var(--sy-grid-focus, #2563eb);outline-offset:-1px}.sy-grid__formula-bar.sc-sy-grid .sy-grid__formula-bar-input.sc-sy-grid:disabled{background:var(--sy-grid-header-bg);color:#9ca3af}.sy-grid__formula-suggest.sc-sy-grid{position:absolute;top:calc(100% + 2px);left:0;z-index:30;margin:0;padding:3px;list-style:none;min-width:220px;max-height:240px;overflow-y:auto;border:1px solid var(--sy-grid-border);border-radius:4px;background:var(--sy-grid-bg);box-shadow:0 6px 16px rgba(15,23,42,.12)}.sy-grid__formula-suggest-option.sc-sy-grid{display:flex;align-items:baseline;gap:8px;padding:4px 8px;border-radius:3px;cursor:pointer;font-family:Consolas,"SFMono-Regular",monospace;font-size:12.5px}.sy-grid__formula-suggest-option.sc-sy-grid:hover{background:var(--sy-grid-row-hover-bg, #f1f5f9)}.sy-grid__formula-suggest-option--active.sc-sy-grid{background:var(--sy-grid-selected-bg, #e0ecff)}.sy-grid__formula-suggest-paren.sc-sy-grid{color:#9ca3af;font-size:11px}.sy-grid__tool-panel.sc-sy-grid{display:flex;flex-direction:column;width:240px;min-width:0;border-right:1px solid var(--sy-grid-border);background:var(--sy-grid-bg)}.sy-grid__tool-panel-header.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;flex:0 0 auto;padding:6px 10px;border-bottom:1px solid var(--sy-grid-border);font-size:12px;font-weight:600;color:var(--sy-grid-text)}.sy-grid__tool-panel-close.sc-sy-grid{font:inherit;font-size:12px;border:none;background:none;cursor:pointer;padding:2px 4px;color:var(--sy-grid-text-muted)}.sy-grid__tool-panel-close.sc-sy-grid:hover{color:var(--sy-grid-text)}.sy-grid__tool-panel-body.sc-sy-grid{flex:1 1 auto;overflow:auto;padding:8px 10px;font-size:12px;color:var(--sy-grid-text)}.sy-grid__tool-panel-list.sc-sy-grid{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px}.sy-grid__tool-panel-item.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;gap:8px}.sy-grid__tool-panel-item--hidden.sc-sy-grid{color:var(--sy-grid-text-muted);text-decoration:line-through}.sy-grid__tool-panel-badge.sc-sy-grid{font-size:10px;padding:0 6px;border-radius:8px;border:1px solid var(--sy-grid-border);background:var(--sy-grid-header-bg);color:var(--sy-grid-text-muted)}.sy-grid__tool-panel-empty.sc-sy-grid{margin:0;color:var(--sy-grid-text-muted)}.sy-grid__tool-panel-columns.sc-sy-grid{display:flex;flex-direction:column;gap:6px}.sy-grid__tool-panel-search.sc-sy-grid{font:inherit;font-size:12px;padding:3px 6px;border:1px solid var(--sy-grid-border);border-radius:4px;background:var(--sy-grid-bg);color:var(--sy-grid-text)}.sy-grid__tool-panel-selectall.sc-sy-grid, .sy-grid__tool-panel-check.sc-sy-grid{display:flex;align-items:center;gap:6px;cursor:pointer}.sy-grid__tool-panel-selectall.sc-sy-grid input.sc-sy-grid, .sy-grid__tool-panel-check.sc-sy-grid input.sc-sy-grid{margin:0;cursor:pointer}.sy-grid__tool-panel-selectall.sc-sy-grid{padding-bottom:4px;border-bottom:1px solid var(--sy-grid-border);color:var(--sy-grid-text-muted)}.sy-grid__tool-panel-empty-row.sc-sy-grid{color:var(--sy-grid-text-muted)}.sy-grid__tool-panel-filters.sc-sy-grid{display:flex;flex-direction:column;gap:6px}.sy-grid__tool-panel-filter-open.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;font:inherit;font-size:12px;text-align:left;border:none;background:none;cursor:pointer;padding:2px 4px;border-radius:3px;color:var(--sy-grid-text)}.sy-grid__tool-panel-filter-open.sc-sy-grid:hover{background:var(--sy-grid-header-bg-hover)}.sy-grid__tool-panel-filter-open[aria-expanded=true].sc-sy-grid{background:var(--sy-grid-header-bg-hover)}.sy-grid__tool-panel-item--active.sc-sy-grid > .sy-grid__tool-panel-filter-open.sc-sy-grid, .sy-grid__tool-panel-item--active.sc-sy-grid{font-weight:600}.sy-grid__cell-html.sc-sy-grid{display:block;width:100%;min-width:0}.sy-grid__tool-panel-clear-all.sc-sy-grid{align-self:flex-start;font:inherit;font-size:11px;margin-top:4px;padding:3px 10px;border:1px solid var(--sy-grid-border);border-radius:4px;background:var(--sy-grid-bg);color:var(--sy-grid-text);cursor:pointer}.sy-grid__tool-panel-clear-all.sc-sy-grid:hover{background:var(--sy-grid-header-bg-hover)}.sy-grid__side-bar-strip.sc-sy-grid{display:flex;flex-direction:column;gap:2px;padding:4px 0;width:28px;flex:0 0 auto}.sy-grid__side-bar-button.sc-sy-grid{font:inherit;font-size:11px;border:none;background:none;cursor:pointer;color:var(--sy-grid-text-muted);writing-mode:vertical-rl;padding:10px 5px;border-left:2px solid rgba(0,0,0,0);user-select:none}.sy-grid__side-bar-button.sc-sy-grid:hover{color:var(--sy-grid-text)}.sy-grid__side-bar-button--active.sc-sy-grid{color:var(--sy-color-primary, #2563eb);border-left-color:var(--sy-color-primary, #2563eb);background:var(--sy-grid-bg)}.sy-grid__page-numbers.sc-sy-grid{display:inline-flex;align-items:center;gap:2px}.sy-grid__pagination-button.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:26px;padding:0 8px;font-size:12px;font-family:inherit;color:inherit;background:rgba(0,0,0,0);border:1px solid var(--sy-grid-pagination-border);border-radius:4px;cursor:pointer}.sy-grid__pagination-button.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-pagination-hover-bg)}.sy-grid__pagination-button.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-pagination-active-bg);outline-offset:1px}.sy-grid__pagination-button.sc-sy-grid:disabled{cursor:not-allowed;opacity:.45;color:var(--sy-grid-pagination-disabled-color)}.sy-grid__page-number--active.sc-sy-grid, .sy-grid__pagination-button[data-active=true].sc-sy-grid{background:var(--sy-grid-pagination-active-bg);color:var(--sy-grid-pagination-active-color);border-color:var(--sy-grid-pagination-active-bg)}.sy-grid__page-number--active.sc-sy-grid:hover:not(:disabled), .sy-grid__pagination-button[data-active=true].sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-pagination-active-bg);filter:brightness(0.95)}.sy-grid__page-ellipsis.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:26px;color:var(--sy-grid-pagination-disabled-color)}.sy-grid__page-info.sc-sy-grid{margin-left:auto;margin-right:4px;font-variant-numeric:tabular-nums;color:inherit;opacity:.85}.sy-grid__page-size-label.sc-sy-grid{display:inline-flex;align-items:center;gap:6px}.sy-grid__page-size-text.sc-sy-grid{font-size:11px;text-transform:uppercase;letter-spacing:.04em;opacity:.75}.sy-grid__page-size.sc-sy-grid{height:26px;padding:0 6px;font-size:12px;font-family:inherit;color:inherit;background:var(--sy-grid-pagination-bg);border:1px solid var(--sy-grid-pagination-border);border-radius:4px}.sy-grid__page-size.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-pagination-active-bg);outline-offset:1px}.sy-grid__body.sc-sy-grid{position:relative;display:flex;flex:1 1 auto;flex-direction:column;min-height:0;min-width:0}.sy-grid__grid.sc-sy-grid{position:relative;display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.sy-grid__viewport.sc-sy-grid{position:relative;overflow:auto;flex:1 1 auto;min-height:240px;background:var(--sy-grid-viewport-bg, #ffffff);contain:strict}.sy-grid__viewport.sc-sy-grid::-webkit-scrollbar{width:10px;height:10px}.sy-grid__viewport.sc-sy-grid::-webkit-scrollbar-track{background:var(--sy-grid-scrollbar-track, transparent)}.sy-grid__viewport.sc-sy-grid::-webkit-scrollbar-thumb{background:var(--sy-grid-scrollbar-thumb, rgba(15, 23, 42, 0.18));border-radius:4px}[style*=height].sc-sy-grid-h, [style*=height].sc-sy-grid-h{display:flex;flex-direction:column;min-height:0}[style*=height].sc-sy-grid-h .sy-grid__body.sc-sy-grid, [style*=height].sc-sy-grid-h .sy-grid__grid.sc-sy-grid, [style*=height].sc-sy-grid-h .sy-grid__body.sc-sy-grid, [style*=height].sc-sy-grid-h .sy-grid__grid.sc-sy-grid{flex:1 1 0;min-height:0}[style*=height].sc-sy-grid-h .sy-grid__viewport.sc-sy-grid, [style*=height].sc-sy-grid-h .sy-grid__viewport.sc-sy-grid{flex:1 1 0;height:0;min-height:0}.sy-grid--column-defs.sc-sy-grid{display:flex;flex-direction:column}.sy-grid__row-spacer.sc-sy-grid{position:relative;width:100%;box-sizing:border-box}.sy-grid__row-window.sc-sy-grid{position:static;width:100%}.sy-grid__row-window--flat.sc-sy-grid{position:static;width:100%}.sy-grid__row.sc-sy-grid{display:flex;align-items:stretch;width:max-content;min-width:100%;border-bottom:1px solid var(--sy-grid-row-border, #f3f4f6);color:var(--sy-grid-row-color, #111827);font-size:var(--sy-grid-cell-font-size, 13px);box-sizing:border-box}.sy-grid__row.sc-sy-grid:hover{background:var(--sy-grid-row-bg-hover, rgba(37, 99, 235, 0.06))}.sy-grid__row--odd.sc-sy-grid{background:var(--sy-grid-row-bg-odd, #ffffff)}.sy-grid__row--even.sc-sy-grid{background:var(--sy-grid-row-bg-even, #f9fafb)}.sy-grid__cell.sc-sy-grid{flex:1 1 0;position:relative;padding:0 var(--sy-grid-cell-padding-x, 12px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;font-variant-numeric:tabular-nums}.sy-grid__cell--row-span.sc-sy-grid{align-self:flex-start;background:var(--sy-grid-span-cell-bg, inherit)}.sy-grid__span-cover.sc-sy-grid{flex:0 0 auto;pointer-events:none}.sy-grid__row--auto-height.sc-sy-grid{height:auto}.sy-grid__row--auto-height.sc-sy-grid .sy-grid__cell.sc-sy-grid{line-height:1.45;padding-top:7px;padding-bottom:7px}.sy-grid__cell--wrap.sc-sy-grid{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;word-break:break-word}.sy-grid__cell--formula.sc-sy-grid::after{content:"";position:absolute;top:0;right:0;border-width:0 5px 5px 0;border-style:solid;border-color:rgba(0,0,0,0) var(--sy-grid-formula-marker, #14b8a6) rgba(0,0,0,0) rgba(0,0,0,0);pointer-events:none}.sy-grid__cell--formula-error.sc-sy-grid{color:var(--sy-grid-formula-error, #dc2626);font-family:Consolas,"SFMono-Regular",monospace;font-size:12.5px}.sy-grid__cell--formula-error.sc-sy-grid::after{border-color:rgba(0,0,0,0) var(--sy-grid-formula-error, #dc2626) rgba(0,0,0,0) rgba(0,0,0,0)}.sy-grid__cell--invalid.sc-sy-grid{background:var(--sy-grid-invalid-bg, rgba(220, 38, 38, 0.08));box-shadow:inset 0 0 0 1.5px var(--sy-grid-invalid-border, #dc2626)}.sy-grid__cell--invalid.sc-sy-grid::before{content:"";position:absolute;top:0;right:0;border-style:solid;border-width:0 6px 6px 0;border-color:rgba(0,0,0,0) var(--sy-grid-invalid-border, #dc2626) rgba(0,0,0,0) rgba(0,0,0,0)}.sy-grid__cell--commented.sc-sy-grid::before{content:"";position:absolute;top:0;right:0;border-width:0 7px 7px 0;border-style:solid;border-color:rgba(0,0,0,0) var(--sy-grid-comment-marker, #f59e0b) rgba(0,0,0,0) rgba(0,0,0,0);pointer-events:none;z-index:1}.sy-grid__cell--commented-resolved.sc-sy-grid::before{border-color:rgba(0,0,0,0) var(--sy-grid-comment-marker-resolved, #94a3b8) rgba(0,0,0,0) rgba(0,0,0,0)}.sy-grid__comment-panel.sc-sy-grid{width:280px;background:var(--sy-grid-bg, #ffffff);border:1px solid var(--sy-grid-border-color, #e2e8f0);border-radius:6px;box-shadow:0 6px 20px rgba(15,23,42,.14);font-size:12.5px;color:var(--sy-grid-text, #1e293b)}.sy-grid__comment-panel-header.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;padding:8px 10px 6px;font-weight:600}.sy-grid__comment-panel-close.sc-sy-grid{border:none;background:none;font-size:15px;line-height:1;padding:2px 4px;cursor:pointer;color:var(--sy-grid-text-muted, #64748b)}.sy-grid__comment-panel-close.sc-sy-grid:hover{color:var(--sy-grid-text, #1e293b)}.sy-grid__comment-panel-list.sc-sy-grid{max-height:200px;overflow-y:auto;padding:0 10px}.sy-grid__comment.sc-sy-grid{padding:6px 0;border-top:1px solid var(--sy-grid-border-color, #eef2f7)}.sy-grid__comment--reply.sc-sy-grid{padding-left:14px}.sy-grid__comment--resolved.sc-sy-grid{opacity:.55}.sy-grid__comment--resolved.sc-sy-grid .sy-grid__comment-text.sc-sy-grid{text-decoration:line-through}.sy-grid__comment-empty.sc-sy-grid{padding:10px 0;color:var(--sy-grid-text-muted, #94a3b8)}.sy-grid__comment-meta.sc-sy-grid{display:flex;align-items:center;gap:6px;margin-bottom:2px}.sy-grid__comment-author-dot.sc-sy-grid{width:8px;height:8px;border-radius:50%;flex:none}.sy-grid__comment-author.sc-sy-grid{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__comment-time.sc-sy-grid{color:var(--sy-grid-text-muted, #94a3b8);font-size:11px;margin-right:auto}.sy-grid__comment-action.sc-sy-grid{border:none;background:none;padding:0 2px;font-size:11px;cursor:pointer;color:var(--sy-grid-accent, #2563eb)}.sy-grid__comment-action--delete.sc-sy-grid{color:var(--sy-grid-text-muted, #94a3b8)}.sy-grid__comment-action--delete.sc-sy-grid:hover{color:var(--sy-grid-formula-error, #dc2626)}.sy-grid__comment-text.sc-sy-grid{white-space:pre-wrap;overflow-wrap:anywhere}.sy-grid__comment-mention.sc-sy-grid{color:var(--sy-grid-accent, #2563eb);font-weight:600;background:var(--sy-grid-mention-bg, rgba(37, 99, 235, 0.08));border-radius:3px;padding:0 2px}.sy-grid__comment-mention--self.sc-sy-grid{color:var(--sy-grid-mention-self, #b45309);background:var(--sy-grid-mention-self-bg, rgba(245, 158, 11, 0.18))}.sy-grid__comment-compose.sc-sy-grid{display:flex;gap:6px;align-items:flex-end;padding:8px 10px 10px;border-top:1px solid var(--sy-grid-border-color, #eef2f7)}.sy-grid__comment-input.sc-sy-grid{flex:1;resize:none;font:inherit;font-size:12.5px;padding:5px 7px;border:1px solid var(--sy-grid-border-color, #cbd5e1);border-radius:4px}.sy-grid__comment-input.sc-sy-grid:focus{outline:none;border-color:var(--sy-grid-accent, #2563eb)}.sy-grid__comment-add.sc-sy-grid{height:27px;padding:0 10px;font:inherit;font-size:12px;border:none;border-radius:4px;background:var(--sy-grid-accent, #2563eb);color:#fff;cursor:pointer}.sy-grid__comment-add.sc-sy-grid:hover{background:var(--sy-grid-accent-strong, #1d4ed8)}.sy-grid__toolbar-button.sc-sy-grid{height:28px;padding:0 12px;font:inherit;font-size:13px;color:var(--sy-grid-header-color, #111827);background:var(--sy-grid-filter-dropdown-bg, #fff);border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:4px;cursor:pointer}.sy-grid__toolbar-button.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-header-bg-hover, rgba(0, 0, 0, 0.06))}.sy-grid__toolbar-button.sc-sy-grid:disabled{opacity:.5;cursor:default}.sy-grid__toolbar-button--primary.sc-sy-grid{color:#fff;background:var(--sy-grid-sort-indicator-active-color, #2563eb);border-color:var(--sy-grid-sort-indicator-active-color, #2563eb)}.sy-grid__toolbar-button--primary.sc-sy-grid:hover:not(:disabled){filter:brightness(0.95);background:var(--sy-grid-sort-indicator-active-color, #2563eb)}.sy-grid__csv-wizard-overlay.sc-sy-grid{position:fixed;inset:0;z-index:2147483646;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,.35)}.sy-grid__csv-wizard.sc-sy-grid{display:flex;flex-direction:column;gap:12px;max-width:min(680px,92vw);max-height:84vh;padding:16px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:var(--sy-grid-row-color, #111827);border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:8px;box-shadow:0 18px 48px rgba(15,23,42,.28);font-size:13px}.sy-grid__csv-wizard-head.sc-sy-grid{display:flex;align-items:baseline;gap:10px}.sy-grid__csv-wizard-head.sc-sy-grid .sy-grid__csv-wizard-file.sc-sy-grid{color:var(--sy-grid-sort-indicator-color, #6b7280);font-size:12px}.sy-grid__csv-wizard-controls.sc-sy-grid{display:flex;align-items:center;gap:18px;flex-wrap:wrap}.sy-grid__csv-wizard-check.sc-sy-grid, .sy-grid__csv-wizard-delim.sc-sy-grid{display:inline-flex;align-items:center;gap:6px}.sy-grid__csv-wizard-preview.sc-sy-grid{overflow:auto;border:1px solid var(--sy-grid-header-border, #e5e7eb);border-radius:4px}.sy-grid__csv-wizard-preview.sc-sy-grid table.sc-sy-grid{border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}.sy-grid__csv-wizard-preview.sc-sy-grid th.sc-sy-grid, .sy-grid__csv-wizard-preview.sc-sy-grid td.sc-sy-grid{padding:4px 8px;text-align:left;white-space:nowrap;border-bottom:1px solid var(--sy-grid-row-border, #f3f4f6)}.sy-grid__csv-wizard-preview.sc-sy-grid th.sc-sy-grid{background:var(--sy-grid-header-bg, #f9fafb);font-weight:600}.sy-grid__csv-wizard-actions.sc-sy-grid{display:flex;justify-content:flex-end;gap:8px}.sy-grid__toolbar.sc-sy-grid{display:flex;align-items:center;gap:8px;padding:6px 8px;background:var(--sy-grid-toolbar-bg);border-bottom:1px solid var(--sy-grid-toolbar-border);flex:0 0 auto}.sy-grid__quick-filter.sc-sy-grid{position:relative;display:inline-flex;align-items:center;flex:1 1 280px;max-width:360px}.sy-grid__quick-filter-input.sc-sy-grid{width:100%;height:28px;padding:4px 28px 4px 10px;font-family:inherit;font-size:13px;color:var(--sy-grid-quick-filter-input-color);background:var(--sy-grid-quick-filter-input-bg);border:1px solid var(--sy-grid-quick-filter-input-border);border-radius:4px;box-sizing:border-box;outline:none;transition:border-color 120ms ease,box-shadow 120ms ease}.sy-grid__quick-filter-input.sc-sy-grid::placeholder{color:var(--sy-grid-quick-filter-input-placeholder);opacity:1}.sy-grid__quick-filter-input.sc-sy-grid::-webkit-search-cancel-button, .sy-grid__quick-filter-input.sc-sy-grid::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.sy-grid__quick-filter-input.sc-sy-grid:focus{border-color:var(--sy-grid-quick-filter-input-focus);box-shadow:0 0 0 2px rgba(37,99,235,.18)}.sy-grid__quick-filter-clear.sc-sy-grid{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;background:rgba(0,0,0,0);color:var(--sy-grid-quick-filter-clear-color);font-size:12px;line-height:1;cursor:pointer;border-radius:3px;transition:background 120ms ease,color 120ms ease}.sy-grid__quick-filter-clear.sc-sy-grid:hover, .sy-grid__quick-filter-clear.sc-sy-grid:focus-visible{background:var(--sy-grid-quick-filter-clear-hover);color:inherit}.sy-grid__quick-filter-clear.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-quick-filter-input-focus);outline-offset:1px}.sy-grid__empty-state.sc-sy-grid{position:absolute;top:var(--sy-grid-empty-state-inset-top, 0px);left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px 16px;background:var(--sy-grid-empty-state-bg);color:var(--sy-grid-empty-state-color);text-align:center;pointer-events:auto;z-index:2}.sy-grid__empty-state-live.sc-sy-grid{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;pointer-events:none}.sy-grid__empty-state-icon.sc-sy-grid{font-size:32px;line-height:1;color:var(--sy-grid-empty-state-icon-color);user-select:none}.sy-grid__empty-state-message.sc-sy-grid{font-size:13px;font-weight:500;max-width:320px}.sy-grid__empty-state-action.sc-sy-grid{margin-top:4px;padding:6px 14px;font-size:12px;font-family:inherit;font-weight:600;border:none;border-radius:4px;cursor:pointer;background:var(--sy-grid-empty-state-action-bg);color:var(--sy-grid-empty-state-action-color);transition:filter 120ms ease}.sy-grid__empty-state-action.sc-sy-grid:hover{filter:brightness(0.95)}.sy-grid__empty-state-action.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-empty-state-action-bg);outline-offset:2px}.sy-grid__empty-state--loading.sc-sy-grid .sy-grid__empty-state-icon.sc-sy-grid{animation:sy-grid-empty-state-spin 1.6s linear infinite}@keyframes sy-grid-empty-state-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.sy-grid__empty-state--loading.sc-sy-grid{background:var(--sy-grid-loading-backdrop);color:var(--sy-grid-loading-message-color)}.sy-grid__empty-state--loading.sc-sy-grid .sy-grid__empty-state-message.sc-sy-grid{color:var(--sy-grid-loading-message-color)}.sy-grid__loading-spinner.sc-sy-grid{width:36px;height:36px;position:relative;color:var(--sy-grid-loading-spinner-color);display:inline-block}.sy-grid__loading-spinner-bar.sc-sy-grid{position:absolute;top:0;left:50%;width:3px;height:9px;margin-left:-1.5px;border-radius:1.5px;background:currentColor;transform-origin:50% 18px;animation:sy-grid-loading-spinner-fade 1s linear infinite}.sy-grid__loading-spinner-bar--1.sc-sy-grid{transform:rotate(0deg);animation-delay:-0.875s}.sy-grid__loading-spinner-bar--2.sc-sy-grid{transform:rotate(45deg);animation-delay:-0.75s}.sy-grid__loading-spinner-bar--3.sc-sy-grid{transform:rotate(90deg);animation-delay:-0.625s}.sy-grid__loading-spinner-bar--4.sc-sy-grid{transform:rotate(135deg);animation-delay:-0.5s}.sy-grid__loading-spinner-bar--5.sc-sy-grid{transform:rotate(180deg);animation-delay:-0.375s}.sy-grid__loading-spinner-bar--6.sc-sy-grid{transform:rotate(225deg);animation-delay:-0.25s}.sy-grid__loading-spinner-bar--7.sc-sy-grid{transform:rotate(270deg);animation-delay:-0.125s}.sy-grid__loading-spinner-bar--8.sc-sy-grid{transform:rotate(315deg);animation-delay:0s}@keyframes sy-grid-loading-spinner-fade{0%{opacity:1}50%{opacity:.35}100%{opacity:.15}}.sy-grid__empty-state--loading.sc-sy-grid slot[name=loading-spinner].sc-sy-grid{display:flex;align-items:center;justify-content:center}.sy-grid__viewport.sc-sy-grid:focus{outline:none}.sy-grid__viewport.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-viewport-focus-outline);outline-offset:-2px}.sy-grid__viewport--active-cell.sc-sy-grid:focus, .sy-grid__viewport--active-cell.sc-sy-grid:focus-visible{outline:none}.sy-grid__row--active.sc-sy-grid{background:var(--sy-grid-active-row-bg)}.sy-grid__row--selected.sc-sy-grid, .sy-grid__row--selected.sy-grid__row--active.sc-sy-grid, .sy-grid__row--selected.sc-sy-grid:hover{background:var(--sy-grid-row-bg-selected)}[data-row-hover-mode=stateful].sc-sy-grid-h .sy-grid__row.sc-sy-grid:hover{background:inherit}[data-row-hover-mode=stateful].sc-sy-grid-h .sy-grid__row--hovered.sc-sy-grid{background:var(--sy-grid-row-bg-hover)}[data-row-hover-mode=stateful].sc-sy-grid-h .sy-grid__row--selected.sy-grid__row--hovered.sc-sy-grid{background:var(--sy-grid-row-bg-selected)}[data-row-hover-mode=off].sc-sy-grid-h .sy-grid__row.sc-sy-grid:hover{background:inherit}.sy-grid__header-cell--selection.sc-sy-grid, .sy-grid__cell--selection.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;padding:0}.sy-grid__selection-checkbox.sc-sy-grid{display:inline-block;flex:0 0 18px;width:18px;height:18px;aspect-ratio:1/1;box-sizing:border-box;border:1px solid var(--sy-grid-row-border, #d4d4d4);border-radius:3px;background:var(--sy-grid-row-bg, #fff);cursor:pointer;position:relative}.sy-grid__selection-checkbox--checked.sc-sy-grid{background:var(--sy-grid-row-bg-selected, rgba(37, 99, 235, 0.85));border-color:var(--sy-grid-row-bg-selected, rgba(37, 99, 235, 0.85))}.sy-grid__selection-checkbox--checked.sc-sy-grid::after{content:"";position:absolute;top:2px;left:5px;width:4px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}.sy-grid__selection-checkbox--mixed.sc-sy-grid::after{content:"";position:absolute;top:7px;left:3px;width:10px;height:2px;background:var(--sy-grid-row-bg-selected, rgba(37, 99, 235, 0.85))}.sy-grid__cell--active.sc-sy-grid{outline:2px solid var(--sy-grid-active-cell-outline);outline-offset:-2px}.sy-grid__cell--active.sc-sy-grid:focus, .sy-grid__cell--active.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-active-cell-outline);outline-offset:-2px}.sy-grid__cell--editing.sc-sy-grid{padding:0;position:relative;background:var(--sy-grid-cell-editor-bg, #ffffff);color:var(--sy-grid-cell-editor-color, inherit);box-shadow:var(--sy-grid-cell-editor-shadow, inset 0 0 0 1px rgba(37, 99, 235, 0.22))}.sy-grid__cell-editor.sc-sy-grid{box-sizing:border-box;width:100%;height:100%;padding:0 var(--sy-grid-cell-padding-x, 12px);font:inherit;color:var(--sy-grid-cell-editor-color, inherit);background:var(--sy-grid-cell-editor-bg, #ffffff);border:1px solid var(--sy-grid-cell-editor-border, var(--sy-grid-active-cell-outline, #2563eb));outline:none}.sy-grid__cell-editor.sc-sy-grid:focus, .sy-grid__cell-editor.sc-sy-grid:focus-visible{outline:none}.sy-grid__cell-editor--number.sc-sy-grid{text-align:right}.sy-grid__cell-editor--invalid.sc-sy-grid{box-shadow:inset 0 -2px 0 #dc2626}@layer sy-grid-lifecycle-components{sy-grid .sy-grid__cell-component-host,sy-grid .sy-grid__cell-editor-component-host,sy-grid .sy-grid__floating-filter-host{box-sizing:border-box;min-width:0;font:inherit;color:inherit}sy-grid .sy-grid__cell-component-host{display:flex;align-items:center;width:100%;height:100%;min-height:0;overflow:hidden;line-height:inherit;text-align:inherit;white-space:inherit;text-overflow:inherit}sy-grid .sy-grid__cell-component-host>*{min-width:0;max-width:100%}sy-grid .sy-grid__cell-editor-component-host{position:relative;display:flex;align-items:stretch;width:100%;height:100%;min-height:100%;overflow:hidden;background:var(--sy-grid-cell-editor-bg, #ffffff);line-height:inherit}sy-grid .sy-grid__cell-editor-component-host>*{flex:1 1 auto;width:100%;min-width:0;max-width:100%;height:100%;box-sizing:border-box}sy-grid .sy-grid__cell-editor-component-host:focus-within{box-shadow:var(--sy-grid-cell-editor-shadow, inset 0 0 0 1px rgba(37, 99, 235, 0.22))}sy-grid .sy-grid__cell-editor-component-host[aria-invalid=true],.sy-grid__cell-editor-component-popup[aria-invalid=true]{outline:2px solid var(--sy-color-danger, #b91c1c);outline-offset:-2px}sy-grid .sy-grid__cell-editor-component-host>.sy-grid__cell-editor-validation,.sy-grid__cell-editor-component-popup>.sy-grid__cell-editor-validation{z-index:2;box-sizing:border-box;width:100%;height:auto;min-height:20px;max-height:50%;overflow:auto;padding:3px 8px;color:var(--sy-color-danger, #b91c1c);background:var(--sy-grid-invalid-bg, rgba(220, 38, 38, 0.1));border-top:1px solid currentColor;font:inherit;font-size:11px;font-weight:600;line-height:1.3;pointer-events:none}sy-grid .sy-grid__cell-editor-component-host>.sy-grid__cell-editor-validation{position:absolute;right:0;bottom:0;left:0;flex:0 0 auto}.sy-grid__cell-editor-component-popup>.sy-grid__cell-editor-validation{position:sticky;bottom:0}.sy-grid__cell-editor-component-popup{position:fixed;z-index:var(--sy-grid-component-popup-z-index, 1100);box-sizing:border-box;min-width:min(220px,100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto;overscroll-behavior:contain;background:var(--sy-grid-filter-dropdown-bg, #ffffff);color:var(--sy-grid-filter-dropdown-color, #111827);border:1px solid var(--sy-grid-filter-dropdown-border, #e5e7eb);border-radius:6px;box-shadow:var(--sy-grid-filter-dropdown-shadow, 0 8px 20px rgba(15, 23, 42, 0.12));font:inherit;font-size:var(--sy-grid-cell-font-size, 13px);isolation:isolate}.sy-grid__cell-editor-component-popup:focus-within{outline:2px solid var(--sy-grid-active-cell-outline, #2563eb);outline-offset:1px}.sy-grid__rich-editor{display:grid;grid-template-rows:auto minmax(0, 1fr) auto;width:min(320px,100vw - 18px);min-width:min(220px,100vw - 18px);max-width:100%;max-height:min(360px,100vh - 18px);box-sizing:border-box;overflow:hidden;background:var(--sy-grid-filter-dropdown-bg, #ffffff);color:var(--sy-grid-filter-dropdown-color, #111827);border:1px solid var(--sy-grid-filter-dropdown-border, #e5e7eb);border-radius:6px;box-shadow:var(--sy-grid-filter-dropdown-shadow, 0 8px 20px rgba(15, 23, 42, 0.12));font:inherit}.sy-grid__cell-editor-component-popup>.sy-grid__rich-editor{width:100%;min-width:0;border:0;border-radius:inherit;box-shadow:none}.sy-grid__rich-editor-input{width:100%;height:34px;min-width:0;box-sizing:border-box;padding:0 10px;color:inherit;background:var(--sy-grid-cell-editor-bg, #ffffff);border:0;border-bottom:1px solid var(--sy-grid-filter-dropdown-border, #e5e7eb);border-radius:0;outline:none;font:inherit;caret-color:var(--sy-grid-active-cell-outline, #2563eb)}.sy-grid__rich-editor-input::placeholder{color:var(--sy-grid-text-muted, #6b7280);opacity:.75}.sy-grid__rich-editor-input:focus,.sy-grid__rich-editor-input:focus-visible{border-bottom-color:var(--sy-grid-active-cell-outline, #2563eb);box-shadow:inset 0 -2px 0 var(--sy-grid-active-cell-outline, #2563eb);outline:none}.sy-grid__rich-editor-options{min-height:34px;max-height:240px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:4px 0;background:inherit}.sy-grid__rich-editor-options[aria-busy=true]{min-height:48px;cursor:progress;opacity:.58;background:linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.16), transparent),var(--sy-grid-filter-dropdown-bg, #ffffff)}.sy-grid__rich-editor-option{display:block;min-width:0;padding:7px 10px;box-sizing:border-box;overflow-wrap:anywhere;color:inherit;cursor:pointer;user-select:none}.sy-grid__rich-editor-option:hover:not([aria-disabled=true]),.sy-grid__rich-editor-option[data-highlighted=true]{background:var(--sy-grid-row-bg-hover, rgba(37, 99, 235, 0.06))}.sy-grid__rich-editor-option[data-highlighted=true]{box-shadow:inset 2px 0 0 var(--sy-grid-active-cell-outline, #2563eb)}.sy-grid__rich-editor-option[aria-selected=true]{color:var(--sy-grid-filter-icon-active-color, #2563eb);font-weight:600}.sy-grid__rich-editor-option[aria-disabled=true]{opacity:.48;cursor:not-allowed}.sy-grid__rich-editor-status{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:25px;box-sizing:border-box;padding:4px 8px;color:var(--sy-grid-text-muted, #6b7280);background:var(--sy-grid-header-bg, #f9fafb);border-top:1px solid var(--sy-grid-filter-dropdown-border, #e5e7eb);font-size:11px;line-height:1.35}.sy-grid__rich-editor-status:empty{display:none}.sy-grid__rich-editor-status:has(.sy-grid__rich-editor-retry){color:var(--sy-color-danger, #b91c1c);background:var(--sy-grid-invalid-bg, rgba(220, 38, 38, 0.08))}.sy-grid__rich-editor-retry{flex:0 0 auto;min-height:24px;padding:2px 9px;color:inherit;background:var(--sy-grid-filter-dropdown-bg, #ffffff);border:1px solid currentColor;border-radius:4px;font:inherit;font-weight:600;cursor:pointer}.sy-grid__rich-editor-retry:hover{filter:brightness(0.96)}.sy-grid__rich-editor-retry:focus-visible{outline:2px solid currentColor;outline-offset:1px}@media(pointer: coarse),(any-pointer: coarse){.sy-grid__rich-editor-input{height:44px;min-height:44px}.sy-grid__rich-editor-option{display:flex;align-items:center;min-height:44px}.sy-grid__rich-editor-retry{min-width:44px;min-height:44px}}sy-grid .sy-grid__custom-filter-host{display:block;width:min(320px,100vw - 40px);min-width:min(196px,100vw - 40px);max-width:100%;max-height:min(480px,100vh - 48px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;color:inherit;font:inherit;font-weight:400;user-select:text}sy-grid .sy-grid__custom-filter-host>*{width:100%;min-width:0;max-width:100%;box-sizing:border-box}sy-grid .sy-grid__floating-filter-host{display:flex;align-items:center;width:100%;height:100%;overflow:hidden;line-height:normal}sy-grid .sy-grid__floating-filter-host>*{flex:1 1 auto;width:100%;min-width:0;max-width:100%;box-sizing:border-box;color:inherit;font:inherit}@media(forced-colors: active){.sy-grid__cell-editor-component-popup,.sy-grid__rich-editor{border-color:CanvasText;box-shadow:none}.sy-grid__rich-editor-option[data-highlighted=true]{outline:2px solid Highlight;outline-offset:-2px}.sy-grid__rich-editor-option[aria-selected=true]{color:Highlight}.sy-grid__rich-editor-retry{border-color:ButtonText}sy-grid .sy-grid__cell-editor-component-host>.sy-grid__cell-editor-validation,.sy-grid__cell-editor-component-popup>.sy-grid__cell-editor-validation{color:CanvasText;background:Canvas;border-color:CanvasText}}}.sy-grid__cell-editor--select.sc-sy-grid{text-align:left;display:flex;align-items:center;justify-content:space-between;cursor:pointer}.sy-grid__cell-editor--select.sc-sy-grid::after{content:"▾";margin-left:8px;opacity:.6;flex:0 0 auto}.sy-grid__select-placeholder.sc-sy-grid{opacity:.55}.sy-grid__select-listbox.sc-sy-grid{position:absolute;z-index:30;left:0;top:100%;min-width:100%;max-height:240px;overflow-y:auto;background:var(--sy-grid-filter-dropdown-bg);color:var(--sy-grid-filter-dropdown-color);border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:4px;box-shadow:var(--sy-grid-filter-dropdown-shadow);padding:4px 0;outline:none}.sy-grid__select-option.sc-sy-grid{display:block;padding:6px 12px;cursor:pointer;user-select:none}.sy-grid__select-option--highlighted.sc-sy-grid{background:var(--sy-grid-row-bg-hover)}.sy-grid__select-option--disabled.sc-sy-grid{opacity:.5;cursor:not-allowed}.sy-grid__autocomplete.sc-sy-grid{position:relative;width:100%;height:100%}.sy-grid__autocomplete-input.sc-sy-grid{width:100%;height:100%;box-sizing:border-box;padding:0 var(--sy-grid-cell-padding-x, 12px);border:1px solid var(--sy-color-primary, #2563eb);background:var(--sy-grid-bg, #fff);color:var(--sy-grid-text, #111827);font:inherit;outline:none}.sy-grid__autocomplete-listbox.sc-sy-grid{max-height:240px;overflow-y:auto;background:var(--sy-grid-filter-dropdown-bg);color:var(--sy-grid-filter-dropdown-color);border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:4px;box-shadow:var(--sy-grid-filter-dropdown-shadow);padding:4px 0}.sy-grid__autocomplete-option.sc-sy-grid{display:block;padding:6px 12px;cursor:pointer;user-select:none;white-space:nowrap}.sy-grid__autocomplete-option--active.sc-sy-grid{background:var(--sy-grid-row-bg-hover)}.sy-grid__autocomplete-option--disabled.sc-sy-grid{opacity:.5;cursor:not-allowed}.sy-grid__autocomplete-empty.sc-sy-grid{padding:6px 12px;color:var(--sy-grid-text-muted, #6b7280)}.sy-grid__date-calendar.sc-sy-grid{width:max-content;background:var(--sy-grid-filter-dropdown-bg);color:var(--sy-grid-filter-dropdown-color);border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:6px;box-shadow:var(--sy-grid-filter-dropdown-shadow);padding:8px;font:inherit;user-select:none}.sy-grid__date-calendar-header.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.sy-grid__date-calendar-title.sc-sy-grid{flex:1;text-align:center;font-weight:600;font-size:.875rem}.sy-grid__date-calendar-nav.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:1px solid rgba(0,0,0,0);border-radius:4px;background:rgba(0,0,0,0);color:inherit;font:inherit;line-height:1;cursor:pointer}.sy-grid__date-calendar-nav.sc-sy-grid:hover{background:var(--sy-grid-row-bg-hover)}.sy-grid__date-calendar-nav.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:1px}.sy-grid__date-calendar-week.sc-sy-grid{display:grid;grid-template-columns:repeat(7, 1fr)}.sy-grid__date-calendar-week--head.sc-sy-grid{margin-bottom:2px}.sy-grid__date-calendar-weekday.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;height:24px;font-size:.75rem;font-weight:600;color:var(--sy-grid-text-muted, #6b7280)}.sy-grid__date-calendar-day.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:1px solid rgba(0,0,0,0);border-radius:4px;background:rgba(0,0,0,0);color:inherit;font:inherit;font-size:.8125rem;cursor:pointer}.sy-grid__date-calendar-day.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-row-bg-hover)}.sy-grid__date-calendar-day.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:-1px}.sy-grid__date-calendar-day--outside.sc-sy-grid{color:var(--sy-grid-text-muted, #9ca3af);opacity:.6}.sy-grid__date-calendar-day--today.sc-sy-grid:not(.sy-grid__date-calendar-day--selected){border-color:var(--sy-color-primary, #2563eb)}.sy-grid__date-calendar-day--focused.sc-sy-grid:not(.sy-grid__date-calendar-day--selected){outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:-2px}.sy-grid__date-calendar-day--selected.sc-sy-grid{background:var(--sy-color-primary, #2563eb);color:#fff;font-weight:600}.sy-grid__date-calendar-day.sc-sy-grid:disabled{opacity:.35;cursor:not-allowed}.sy-grid__large-text-anchor.sc-sy-grid{position:absolute;inset:0;pointer-events:none}.sy-grid__large-text.sc-sy-grid{display:flex;flex-direction:column;background:var(--sy-grid-filter-dropdown-bg);color:var(--sy-grid-filter-dropdown-color);border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:6px;box-shadow:var(--sy-grid-filter-dropdown-shadow);padding:6px;font:inherit}.sy-grid__large-text-input.sc-sy-grid{width:100%;box-sizing:border-box;resize:both;padding:6px 8px;border:1px solid var(--sy-color-primary, #2563eb);border-radius:4px;background:var(--sy-grid-bg, #fff);color:var(--sy-grid-text, #111827);font:inherit;line-height:1.4;outline:none}.sy-grid__large-text-footer.sc-sy-grid{display:flex;align-items:center;gap:8px;margin-top:6px}.sy-grid__large-text-hint.sc-sy-grid{flex:1;min-width:0;font-size:.75rem;color:var(--sy-grid-text-muted, #6b7280)}.sy-grid__large-text-count.sc-sy-grid{font-size:.75rem;font-variant-numeric:tabular-nums;color:var(--sy-grid-text-muted, #6b7280)}.sy-grid__large-text-count--over.sc-sy-grid{color:var(--sy-color-danger, #dc2626);font-weight:600}.sy-grid__large-text-btn.sc-sy-grid{padding:3px 10px;border:1px solid var(--sy-grid-filter-dropdown-border);border-radius:4px;background:rgba(0,0,0,0);color:inherit;font:inherit;font-size:.8125rem;cursor:pointer}.sy-grid__large-text-btn.sc-sy-grid:hover{background:var(--sy-grid-row-bg-hover)}.sy-grid__large-text-btn.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:1px}.sy-grid__large-text-btn--primary.sc-sy-grid{background:var(--sy-color-primary, #2563eb);border-color:var(--sy-color-primary, #2563eb);color:#fff}.sy-grid__large-text-btn--primary.sc-sy-grid:hover{background:var(--sy-color-primary-strong, #1d4ed8)}.sy-grid__cell-editor--checkbox.sc-sy-grid{width:auto;height:auto;padding:0;margin:auto;cursor:pointer;background:revert;border:revert}.sy-grid__cell-editor--checkbox.sc-sy-grid:focus, .sy-grid__cell-editor--checkbox.sc-sy-grid:focus-visible{outline:revert}.sy-grid__cell-editor--indeterminate.sc-sy-grid{outline:1px dashed var(--sy-grid-cell-editor-indeterminate-outline, #888);outline-offset:1px}.sy-grid__drag-live.sc-sy-grid{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.sy-grid__row-drag-handle--unmanaged.sc-sy-grid:focus-visible{outline:2px solid var(--sy-grid-focus-ring, #2563eb);outline-offset:1px;border-radius:3px}.sy-grid__row-drag-handle.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;width:18px;height:100%;margin-right:6px;vertical-align:middle;color:var(--sy-grid-text-muted, #9ca3af);cursor:grab;user-select:none}.sy-grid__row-drag-handle.sc-sy-grid:hover{color:var(--sy-grid-text, #374151)}.sy-grid__row-drag-handle.sc-sy-grid:active{cursor:grabbing}.sy-grid__row-drag-grip.sc-sy-grid{font-size:1rem;line-height:1;letter-spacing:-2px;pointer-events:none}.sy-grid__row--drag-source.sc-sy-grid{opacity:.45}.sy-grid__row--drop-above.sc-sy-grid{box-shadow:inset 0 2px 0 0 var(--sy-color-primary, #2563eb)}.sy-grid__row--drop-below.sc-sy-grid{box-shadow:inset 0 -2px 0 0 var(--sy-color-primary, #2563eb)}.sy-grid__fill-handle.sc-sy-grid{position:absolute;right:-1px;bottom:-1px;width:9px;height:9px;background:var(--sy-color-primary, #2563eb);border:1px solid var(--sy-grid-bg, #ffffff);border-radius:1px;cursor:crosshair;z-index:3;padding:0}.sy-grid__fill-handle.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:1px}.sy-grid__cell--fill-preview.sc-sy-grid{background:color-mix(in srgb, var(--sy-color-primary, #2563eb) 7%, transparent)}.sy-grid__cell--fill-preview.sc-sy-grid::before{content:"";position:absolute;inset:0;pointer-events:none;border:0 dashed var(--sy-color-primary, #2563eb);z-index:2}.sy-grid__cell--fill-preview-top.sc-sy-grid::before{border-top-width:2px}.sy-grid__cell--fill-preview-bottom.sc-sy-grid::before{border-bottom-width:2px}.sy-grid__cell--fill-preview-left.sc-sy-grid::before{border-left-width:2px}.sy-grid__cell--fill-preview-right.sc-sy-grid::before{border-right-width:2px}.sy-grid__cell--fill-reduce-clear.sc-sy-grid{background:color-mix(in srgb, #6b7280 18%, transparent);text-decoration:line-through}.sy-grid__row--drop-into.sc-sy-grid{box-shadow:inset 0 0 0 2px var(--sy-color-primary, #2563eb);background:color-mix(in srgb, var(--sy-color-primary, #2563eb) 10%, transparent)}.sy-grid__pivot-panel.sc-sy-grid{display:flex;flex-direction:column;flex:0 0 auto;min-width:0;border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb);background:var(--sy-grid-bg, #fff);color:var(--sy-grid-text, #111827);font:inherit;font-size:12px;letter-spacing:0}.sy-grid__pivot-panel-header.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;min-height:32px;padding:4px 10px;box-sizing:border-box;border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb);background:var(--sy-grid-header-bg, #f9fafb)}.sy-grid__pivot-panel-header.sc-sy-grid h2.sc-sy-grid{margin:0;font:inherit;font-size:12px;font-weight:600;letter-spacing:0}.sy-grid__pivot-panel-mode.sc-sy-grid{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer}.sy-grid__pivot-panel-mode.sc-sy-grid input.sc-sy-grid{margin:0}.sy-grid__pivot-panel-status.sc-sy-grid{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sy-grid__pivot-panel-lanes.sc-sy-grid{display:grid;grid-template-columns:repeat(4, minmax(340px, 1fr));width:100%;min-width:0;max-height:220px;overflow:auto}.sy-grid__pivot-panel-lane.sc-sy-grid{min-width:0;min-height:78px;padding:0 8px 8px;box-sizing:border-box;border-right:1px solid var(--sy-grid-header-border, #e5e7eb);background:var(--sy-grid-bg, #fff)}.sy-grid__pivot-panel-lane.sc-sy-grid:last-child{border-right:0}.sy-grid__pivot-panel-lane-title.sc-sy-grid{position:sticky;top:0;z-index:1;margin:0 -8px 6px;padding:5px 8px;border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb);background:var(--sy-grid-header-bg, #f9fafb);color:var(--sy-grid-text-muted, #6b7280);font:inherit;font-size:11px;font-weight:600;letter-spacing:0}.sy-grid__pivot-panel-list.sc-sy-grid{display:flex;flex-direction:column;gap:4px;min-height:32px}.sy-grid__pivot-panel-empty.sc-sy-grid{display:flex;align-items:center;min-height:28px;color:var(--sy-grid-text-muted, #9ca3af)}.sy-grid__pivot-panel-field.sc-sy-grid{display:flex;align-items:center;gap:4px;min-width:0;min-height:30px;padding:3px 4px;box-sizing:border-box;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:4px;background:var(--sy-grid-header-bg, #f9fafb);cursor:grab}.sy-grid__pivot-panel-field.sc-sy-grid:active{cursor:grabbing}.sy-grid__pivot-panel-field.sc-sy-grid:focus-within{border-color:var(--sy-color-primary, #2563eb);box-shadow:inset 0 0 0 1px var(--sy-color-primary, #2563eb)}.sy-grid__pivot-panel-grip.sc-sy-grid{flex:0 0 10px;width:10px;overflow:hidden;color:var(--sy-grid-text-muted, #6b7280);line-height:1;letter-spacing:0;user-select:none}.sy-grid__pivot-panel-field-label.sc-sy-grid{flex:1 1 72px;min-width:48px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sy-grid__pivot-panel-destination.sc-sy-grid, .sy-grid__pivot-panel-aggregation.sc-sy-grid{flex:0 1 auto;width:auto;max-width:104px;min-height:22px;padding:1px 3px;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:3px;background:var(--sy-grid-bg, #fff);color:var(--sy-grid-text, #111827);font:inherit;font-size:11px;letter-spacing:0}.sy-grid__pivot-panel-aggregation.sc-sy-grid{max-width:66px}.sy-grid__pivot-panel-actions.sc-sy-grid{display:inline-grid;grid-template-columns:repeat(3, 22px);flex:0 0 66px}.sy-grid__pivot-panel-actions.sc-sy-grid button.sc-sy-grid{width:22px;height:22px;padding:0;border:0;border-radius:3px;background:rgba(0,0,0,0);color:var(--sy-grid-text-muted, #6b7280);font:inherit;font-size:12px;line-height:22px;text-align:center;cursor:pointer}.sy-grid__pivot-panel-actions.sc-sy-grid button.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-header-bg-hover, #eef2f7);color:var(--sy-grid-text, #111827)}.sy-grid__pivot-panel-actions.sc-sy-grid button.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:-2px}.sy-grid__pivot-panel-actions.sc-sy-grid button.sc-sy-grid:disabled{opacity:.35;cursor:default}.sy-grid__group-panel.sc-sy-grid{display:flex;align-items:center;gap:8px;min-height:34px;padding:4px 12px;box-sizing:border-box;border-bottom:1px solid var(--sy-grid-header-border, #e5e7eb);background:var(--sy-grid-header-bg, #f9fafb);font:inherit;font-size:.8125rem}.sy-grid__group-panel--drop-active.sc-sy-grid{background:var(--sy-grid-row-bg-hover, #eef2ff);box-shadow:inset 0 0 0 2px var(--sy-color-primary, #2563eb)}.sy-grid__group-panel-placeholder.sc-sy-grid{color:var(--sy-grid-text-muted, #9ca3af);font-style:italic;user-select:none}.sy-grid__group-panel-chip.sc-sy-grid{display:inline-flex;align-items:center;gap:6px;padding:2px 4px 2px 10px;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:12px;background:var(--sy-grid-bg, #fff);color:var(--sy-grid-text, #111827)}.sy-grid__context-menu.sc-sy-grid{min-width:160px;max-width:280px;padding:4px 0;background:var(--sy-grid-filter-dropdown-bg, #fff);color:var(--sy-grid-filter-dropdown-color, #111827);border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:6px;box-shadow:var(--sy-grid-filter-dropdown-shadow, 0 8px 24px rgba(15, 23, 42, 0.18));font:inherit;font-size:.8125rem;user-select:none}.sy-grid__cf-builder.sc-sy-grid{width:380px;max-width:calc(100vw - 48px);padding:10px 12px 12px;background:var(--sy-grid-filter-dropdown-bg, #fff);color:var(--sy-grid-filter-dropdown-color, #111827);border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:8px;box-shadow:var(--sy-grid-filter-dropdown-shadow, 0 8px 24px rgba(15, 23, 42, 0.18));font:inherit;font-size:.8125rem}.sy-grid__cf-builder-head.sc-sy-grid{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.sy-grid__cf-builder-title.sc-sy-grid{font-weight:600}.sy-grid__cf-builder-close.sc-sy-grid, .sy-grid__cf-remove.sc-sy-grid{border:none;background:rgba(0,0,0,0);cursor:pointer;color:#64748b;padding:2px 6px;border-radius:4px}.sy-grid__cf-builder-close.sc-sy-grid:hover, .sy-grid__cf-remove.sc-sy-grid:hover{background:rgba(15,23,42,.08)}.sy-grid__cf-rule.sc-sy-grid{display:flex;align-items:center;gap:4px;margin-bottom:6px;flex-wrap:wrap}.sy-grid__cf-field.sc-sy-grid, .sy-grid__cf-condition.sc-sy-grid, .sy-grid__cf-value.sc-sy-grid, .sy-grid__cf-value2.sc-sy-grid{padding:4px 6px;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:4px;font:inherit;font-size:.78rem;min-width:0}.sy-grid__cf-value.sc-sy-grid, .sy-grid__cf-value2.sc-sy-grid{width:56px}.sy-grid__cf-bg.sc-sy-grid{width:28px;height:26px;padding:0;border:1px solid var(--sy-grid-filter-dropdown-border, #d1d5db);border-radius:4px;cursor:pointer}.sy-grid__cf-bold.sc-sy-grid{display:inline-flex;align-items:center;gap:2px;font-weight:700}.sy-grid__cf-add.sc-sy-grid{margin-top:4px;padding:5px 10px;border:1px dashed var(--sy-grid-filter-dropdown-border, #9ca3af);border-radius:6px;background:rgba(0,0,0,0);cursor:pointer;font:inherit;font-size:.78rem;color:inherit}.sy-grid__cf-add.sc-sy-grid:hover{background:rgba(15,23,42,.05)}.sy-grid__toolbar-button--active.sc-sy-grid{background:var(--sy-grid-toolbar-button-active-bg, #e0e7ff);border-color:var(--sy-grid-toolbar-button-active-border, #a5b4fc)}.sy-grid__context-menu-item.sc-sy-grid{display:flex;align-items:center;gap:8px;width:100%;padding:6px 14px;border:none;background:rgba(0,0,0,0);color:inherit;font:inherit;text-align:left;cursor:pointer}.sy-grid__context-menu-item.sc-sy-grid:hover:not(:disabled){background:var(--sy-grid-row-bg-hover, #eef2ff)}.sy-grid__context-menu-item.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:-2px}.sy-grid__context-menu-item--disabled.sc-sy-grid, .sy-grid__context-menu-item.sc-sy-grid:disabled{color:var(--sy-grid-text-muted, #9ca3af);cursor:not-allowed}.sy-grid__context-menu-icon.sc-sy-grid{width:16px;text-align:center;flex:none}.sy-grid__context-menu-separator.sc-sy-grid{height:1px;margin:4px 0;background:var(--sy-grid-header-border, #e5e7eb)}.sy-grid__cell--flash.sc-sy-grid{animation:sy-grid-cell-flash .9s ease-out}@keyframes sy-grid-cell-flash{0%{background-color:var(--sy-grid-cell-flash-color, rgba(34, 197, 94, 0.4))}100%{background-color:rgba(0,0,0,0)}}@media(prefers-reduced-motion: reduce){.sy-grid__cell--flash.sc-sy-grid{animation:none}}.sy-grid__cell--conflict-flash.sc-sy-grid{animation:sy-grid-cell-conflict-flash 1.5s ease-out}@keyframes sy-grid-cell-conflict-flash{0%{background-color:var(--sy-grid-conflict-flash-color, rgba(220, 38, 38, 0.35))}60%{background-color:var(--sy-grid-conflict-flash-color, rgba(220, 38, 38, 0.35))}100%{background-color:rgba(0,0,0,0)}}.sy-grid__conflict-toast.sc-sy-grid{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);z-index:46;max-width:min(90%,480px);padding:7px 14px;border-radius:6px;background:var(--sy-grid-conflict-toast-bg, rgba(15, 23, 42, 0.92));color:var(--sy-grid-conflict-toast-text, #f8fafc);font-size:12.5px;line-height:1.4;box-shadow:0 4px 14px rgba(15,23,42,.25);pointer-events:none;animation:sy-grid-conflict-toast-in .18s ease-out}@keyframes sy-grid-conflict-toast-in{from{opacity:0;transform:translateX(-50%) translateY(6px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}.sy-grid__conflict-toast--raised.sc-sy-grid{bottom:56px}@media(prefers-reduced-motion: reduce){.sy-grid__cell--conflict-flash.sc-sy-grid, .sy-grid__conflict-toast.sc-sy-grid{animation:none}}.sy-grid__group-panel-chip-remove.sc-sy-grid{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;padding:0;border:none;border-radius:9999px;background:rgba(0,0,0,0);color:var(--sy-grid-text-muted, #6b7280);font:inherit;font-size:.95rem;line-height:1;cursor:pointer}.sy-grid__group-panel-chip-remove.sc-sy-grid:hover{background:var(--sy-color-danger, #dc2626);color:#fff}.sy-grid__group-panel-chip-remove.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-primary, #2563eb);outline-offset:1px}.sy-grid__row--loading.sc-sy-grid{cursor:default}.sy-grid__loading-cell.sc-sy-grid{display:flex;align-items:center;width:100%;padding:0 var(--sy-grid-cell-padding-x, 12px);overflow:hidden}.sy-grid__skeleton.sc-sy-grid{display:block;flex:1;min-width:0}.sy-grid__skeleton-bar.sc-sy-grid{display:block;height:12px;width:60%;border-radius:6px;background:linear-gradient(90deg, var(--sy-grid-skeleton-base, #e5e7eb) 25%, var(--sy-grid-skeleton-highlight, #f3f4f6) 37%, var(--sy-grid-skeleton-base, #e5e7eb) 63%);background-size:400% 100%;animation:sy-grid-skeleton-shimmer 1.4s ease infinite}@keyframes sy-grid-skeleton-shimmer{0%{background-position:100% 50%}100%{background-position:0 50%}}@media(prefers-reduced-motion: reduce){.sy-grid__skeleton-bar.sc-sy-grid{animation:none}}.sy-grid__loading-failed-msg.sc-sy-grid{display:inline-flex;align-items:center;gap:8px;color:var(--sy-color-danger, #dc2626);font-size:.8125rem}.sy-grid__loading-retry.sc-sy-grid{padding:2px 10px;border:1px solid var(--sy-color-danger, #dc2626);border-radius:4px;background:rgba(0,0,0,0);color:var(--sy-color-danger, #dc2626);font:inherit;font-size:.8125rem;cursor:pointer}.sy-grid__loading-retry.sc-sy-grid:hover{background:var(--sy-color-danger, #dc2626);color:#fff}.sy-grid__loading-retry.sc-sy-grid:focus-visible{outline:2px solid var(--sy-color-danger, #dc2626);outline-offset:1px}.sy-grid__cell-editor--textarea.sc-sy-grid{width:100%;min-height:var(--sy-grid-row-height, 36px);resize:vertical;line-height:inherit;vertical-align:top;font-family:inherit}.sy-grid__cell-editor-hint.sc-sy-grid{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}`;const SSRM_INACTIVE="server-side row model is not active";const SSRM_NEEDS_ROW_ID="server-side transactions require getRowId";const WORKBOOK_INACTIVE="the workbook surface is inactive (formulas off or no live binding)";function normalizeCsvFileName(fileName){const fallback="export.csv";const raw=typeof fileName==="string"&&fileName.trim()?fileName.trim():fallback;const safe=raw.replace(/[\\/:*?"<>|]+/g,"-");return/\.csv$/i.test(safe)?safe:`${safe}.csv`}const activeGridEditorsByDocument=new WeakMap;const focusedGridEditorByDocument=new WeakMap;const SY_GRID_DATE_CALENDAR_ID="sy-grid-date-calendar";const SY_GRID_ACTIVE_CELL_ID="sy-grid-active-cell";const SY_GRID_TOOLTIP_ID="sy-grid-cell-tooltip";const CELL_FLASH_DURATION_MS=900;const MAX_DETAIL_NESTING=5;const FORMULA_ASYNC_SEED_ROWS=2e4;const FORMULA_SEED_REVEAL_MS=250;const RENDER_OVERSCAN=12;const COLUMN_WINDOW_AUTO_THRESHOLD=20;let alignedMemberSeq=0;let gridProChunkSourcesMemo;function gridProChunkSourcesOnce(){if(gridProChunkSourcesMemo===void 0)gridProChunkSourcesMemo=gridProChunkSources();return gridProChunkSourcesMemo}function gridProChunkInBuild(chunkId){return gridProChunkSourcesOnce()?.[chunkId]!==void 0}function filterModelRefusedReport(issues){return{unknownBuiltInColumns:[],invalidBuiltIn:issues.map(({path,detail})=>({path,detail})),unavailableCustomFilters:[],conditionTreeError:null,externalFilterWasActive:false}}const GRID_PRO_ENGINE_NOT_IN_BUILD="Pro engine not included in this build";const SyGrid=class{constructor(hostRef){index.registerInstance(this,hostRef);this.queryComplete=index.createEvent(this,"queryComplete",7);this.sortChanged=index.createEvent(this,"sortChanged",7);this.filterChanged=index.createEvent(this,"filterChanged",7);this.filterModified=index.createEvent(this,"filterModified",7);this.conditionFilterChanged=index.createEvent(this,"conditionFilterChanged",7);this.conditionPresetsChanged=index.createEvent(this,"conditionPresetsChanged",7);this.columnGroupToggled=index.createEvent(this,"columnGroupToggled",7);this.rowGroupToggled=index.createEvent(this,"rowGroupToggled",7);this.treeNodeToggled=index.createEvent(this,"treeNodeToggled",7);this.detailRowToggled=index.createEvent(this,"detailRowToggled",7);this.detailRowCreated=index.createEvent(this,"detailRowCreated",7);this.detailRowDestroyed=index.createEvent(this,"detailRowDestroyed",7);this.rangeSelectionChanged=index.createEvent(this,"rangeSelectionChanged",7);this.toolPanelToggled=index.createEvent(this,"toolPanelToggled",7);this.csvImported=index.createEvent(this,"csvImported",7);this.clipboardCopied=index.createEvent(this,"clipboardCopied",7);this.clipboardPasted=index.createEvent(this,"clipboardPasted",7);this.paginationChanged=index.createEvent(this,"paginationChanged",7);this.quickFilterChanged=index.createEvent(this,"quickFilterChanged",7);this.emptyStateActionClicked=index.createEvent(this,"emptyStateActionClicked",7);this.activeCellChanged=index.createEvent(this,"activeCellChanged",7);this.cellClicked=index.createEvent(this,"cellClicked",7);this.cellDoubleClicked=index.createEvent(this,"cellDoubleClicked",7);this.rowClicked=index.createEvent(this,"rowClicked",7);this.cellEditingRequested=index.createEvent(this,"cellEditingRequested",7);this.cellEditingCancelled=index.createEvent(this,"cellEditingCancelled",7);this.cellEditingCommitted=index.createEvent(this,"cellEditingCommitted",7);this.formulaEvaluated=index.createEvent(this,"formulaEvaluated",7);this.formulaError=index.createEvent(this,"formulaError",7);this.workbookBindingChanged=index.createEvent(this,"workbookBindingChanged",7);this.workbookBindingError=index.createEvent(this,"workbookBindingError",7);this.chunkLoading=index.createEvent(this,"chunkLoading",7);this.chunkLoaded=index.createEvent(this,"chunkLoaded",7);this.chunkLoadFailed=index.createEvent(this,"chunkLoadFailed",7);this.componentError=index.createEvent(this,"componentError",7);this.rowDataChanged=index.createEvent(this,"rowDataChanged",7);this.cellValueChanged=index.createEvent(this,"cellValueChanged",7);this.rowMoved=index.createEvent(this,"rowMoved",7);this.rowGroupChanged=index.createEvent(this,"rowGroupChanged",7);this.pivotPanelChanged=index.createEvent(this,"pivotPanelChanged",7);this.pivotChanged=index.createEvent(this,"pivotChanged",7);this.pivotModeChanged=index.createEvent(this,"pivotModeChanged",7);this.contextMenuItemClicked=index.createEvent(this,"contextMenuItemClicked",7);this.remoteEditApplied=index.createEvent(this,"remoteEditApplied",7);this.presenceChanged=index.createEvent(this,"presenceChanged",7);this.collabConflictResolved=index.createEvent(this,"collabConflictResolved",7);this.collaboratorJoined=index.createEvent(this,"collaboratorJoined",7);this.collaboratorLeft=index.createEvent(this,"collaboratorLeft",7);this.syncStatusChanged=index.createEvent(this,"syncStatusChanged",7);this.cellCommentsChanged=index.createEvent(this,"cellCommentsChanged",7);this.commentMentioned=index.createEvent(this,"commentMentioned",7);this.auditLogChanged=index.createEvent(this,"auditLogChanged",7);this.conditionalFormatsChanged=index.createEvent(this,"conditionalFormatsChanged",7);this.cellValidationFailed=index.createEvent(this,"cellValidationFailed",7);this.snapshotCaptured=index.createEvent(this,"snapshotCaptured",7);this.snapshotRestored=index.createEvent(this,"snapshotRestored",7);this.xlsxImported=index.createEvent(this,"xlsxImported",7);this.historyChanged=index.createEvent(this,"historyChanged",7);this.columnResized=index.createEvent(this,"columnResized",7);this.columnReordered=index.createEvent(this,"columnReordered",7);this.columnVisibilityChanged=index.createEvent(this,"columnVisibilityChanged",7);this.selectionChanged=index.createEvent(this,"selectionChanged",7);this.rowHoverChanged=index.createEvent(this,"rowHoverChanged",7);this.themeChanged=index.createEvent(this,"themeChanged",7);this.localeChanged=index.createEvent(this,"localeChanged",7);this.gridObjectChanged=index.createEvent(this,"gridObjectChanged",7);this.stateUpdated=index.createEvent(this,"stateUpdated",7);this.preDestroyed=index.createEvent(this,"preDestroyed",7);this.batchEditStart=index.createEvent(this,"batchEditStart",7);this.batchEditEnd=index.createEvent(this,"batchEditEnd",7);this.rowValueChanged=index.createEvent(this,"rowValueChanged",7);this.rowEditStart=index.createEvent(this,"rowEditStart",7);this.rowEditStop=index.createEvent(this,"rowEditStop",7);this.fillStart=index.createEvent(this,"fillStart",7);this.fillEnd=index.createEvent(this,"fillEnd",7);this.pivotCombinationConflict=index.createEvent(this,"pivotCombinationConflict",7);this.pivotColumnsChanged=index.createEvent(this,"pivotColumnsChanged",7);this.serverStoreUpdated=index.createEvent(this,"serverStoreUpdated",7);this.rowDragEnter=index.createEvent(this,"rowDragEnter",7);this.rowDragMove=index.createEvent(this,"rowDragMove",7);this.rowDragLeave=index.createEvent(this,"rowDragLeave",7);this.rowDragEnd=index.createEvent(this,"rowDragEnd",7);this.rowDragCancel=index.createEvent(this,"rowDragCancel",7);this.rowsTransferred=index.createEvent(this,"rowsTransferred",7);this.spanConflict=index.createEvent(this,"spanConflict",7);this.treeReparented=index.createEvent(this,"treeReparented",7);this.pinnedRowsChanged=index.createEvent(this,"pinnedRowsChanged",7);this.rowLayoutRefused=index.createEvent(this,"rowLayoutRefused",7);this.workbookValuesPropagated=index.createEvent(this,"workbookValuesPropagated",7);this.chartCreated=index.createEvent(this,"chartCreated",7);this.chartRangeChanged=index.createEvent(this,"chartRangeChanged",7);this.chartOptionsChanged=index.createEvent(this,"chartOptionsChanged",7);this.chartDestroyed=index.createEvent(this,"chartDestroyed",7)}get host(){return index.getElement(this)}rowData;columnDefs;context;components;externalFilter;componentTimeoutMs=5e3;csvImport=false;pdfFontUrl;pdfAutoFont=true;formulas=false;showFormulas=false;formulaBar=false;workbookId;sheetName;defaultColDef;theme="alpine";height;locale="en";pagination=false;pageSize=DEFAULT_PAGE_SIZE;pageSizeOptions=DEFAULT_PAGE_SIZE_OPTIONS;rowHeight=32;rowHeightFn;virtualScroll=true;quickFilter=false;quickFilterText="";quickFilterPlaceholder;quickFilterMode="and";quickFilterRegex=false;quickFilterDebounce=150;showEmptyState=true;emptyMessage;noMatchesMessage;clearFiltersLabel;loading=false;loadingMessage;loadingMode="manual";minLoadingDuration=DEFAULT_MIN_LOADING_DURATION_MS;datasource;cacheBlockSize=100;maxBlocksInCache;serverSideDatasource;serverSideGroupCols;serverSideTransactionWaitMs;viewportDatasource;rowDragManaged=false;spanExportMode="origin-once";rowDragMultiRow=false;rowDragText;cellChangeFlash=false;enableCellChangeFlash=false;contextMenu=false;columnMenu=false;find=false;cellNotes=false;cellNotesAdapter;batchEditToolbar=false;columnMenuItems;contextMenuItemsCallback;keyboardNavigation=true;rowSelection="none";getRowId;selectionCheckbox=false;showSelectionCheckbox=false;shiftClickAdditive=false;rowHover="css-only";resizableColumns=false;reorderableColumns=false;columnHiding=false;hideableColumns=false;autoSizeOnDoubleClick=true;multiSort=false;enableMultiSort=false;headerFilterRow=false;conditionBuilder=false;virtualizeColumns;groupBy;pivotMode=false;pivotRowGroupColumns;pivotColumns;pivotValueColumns;pivotAggFuncs;pivotSubtotals="off";pivotGrandTotal="bottom";pivotPanelShow="never";pivotPanel=false;groupPanel=false;getDataPath;treeIdField;treeParentField;treeLabelField;masterDetail=false;detailRowHeight=160;detailCellRenderer;detailGridOptions;getDetailRowData;detailNestingLevel=0;rangeSelection=false;clipboardEscapeFormulae=true;statusBar;sideBar;rows=[];columns=[];maxRendered=200;engine="auto";proThreshold=1e5;unavailable="fallback";brandLogo;collaborationRoom;realtimeUrl;collabUserName;collabUserColor;collabPresence=true;collabConflictUi=true;auditLog=false;auditLogMax=1e3;canReadCell;maskedCellValue="•••";canEditCell;conditionalFormats;conditionalFormatUi=false;validationRules;invalidEditMode="allow";maxSnapshots=20;collabPersistence="none";queryComplete;sortChanged;filterChanged;filterModified;conditionFilterChanged;conditionPresetsChanged;columnGroupToggled;rowGroupToggled;treeNodeToggled;detailRowToggled;detailRowCreated;detailRowDestroyed;rangeSelectionChanged;toolPanelToggled;csvImported;clipboardCopied;clipboardPasted;paginationChanged;quickFilterChanged;emptyStateActionClicked;activeCellChanged;cellClicked;cellDoubleClicked;rowClicked;cellEditingRequested;cellEditingCancelled;cellEditingCommitted;formulaEvaluated;formulaError;workbookBindingChanged;workbookBindingError;chunkLoading;chunkLoaded;chunkLoadFailed;componentError;rowDataChanged;cellValueChanged;rowMoved;rowGroupChanged;pivotPanelChanged;pivotChanged;pivotModeChanged;contextMenuItemClicked;remoteEditApplied;presenceChanged;collabConflictResolved;collaboratorJoined;collaboratorLeft;syncStatusChanged;cellCommentsChanged;commentMentioned;auditLogChanged;conditionalFormatsChanged;cellValidationFailed;snapshotCaptured;snapshotRestored;xlsxImported;historyChanged;columnResized;columnReordered;columnVisibilityChanged;selectionChanged;rowHoverChanged;themeChanged;localeChanged;gridObjectChanged;stateUpdated;preDestroyed;liveObjectModel=null;liveObjectModelPromise=null;liveMutationDepth=0;warnedLiveDuplicateRowIds=false;warnedLiveInvalidRowIds=false;warnedLiveDuplicateColumnIds=false;warnedLiveDuplicateColumnGroupIds=false;liveRowHeights=new Map;liveRowSnapshotCache=null;activeTier="standard";fallbackReason;formulaSheet=null;formulaCore=null;formulaCoreLoading=null;formulaCoreArmed(){if(this.formulaCore!==null)return this.formulaCore;if(!this.proModuleAvailable("grid.formulas","formulas","formula-core"))return null;const inFlight=this.formulaCoreLoading;if(inFlight!==null&&inFlight===this.chunkLoader&&!inFlight.stats().disposed)return null;const loader=this.getChunkLoader();this.formulaCoreLoading=loader;void loader.load("formula-core").then(module=>{if(this.formulaCoreLoading===loader)this.formulaCoreLoading=null;this.formulaCore=module;if(this.formulas===true)this.rebuildFormulaSheet();const pendingReason=this.workbookBindingPendingReason;this.workbookBindingPendingReason=null;if(pendingReason!==null&&!this.hasDisconnected&&this.host?.isConnected!==false){this.syncWorkbookBinding(pendingReason)}},()=>{if(this.formulaCoreLoading===loader)this.formulaCoreLoading=null});return null}workbookBindingHooks={onChange:detail=>{this.syncWorkbookBindingHostState(detail.binding);this.workbookBindingChanged.emit(detail)},onError:detail=>{this.host?.setAttribute?.("data-workbook-error",detail.code);this.workbookBindingError.emit(detail)},onValid:binding=>{this.syncWorkbookBindingHostState(binding);this.host?.removeAttribute?.("data-workbook-error");this.syncWorkbookOps(false)}};workbookBindingControllerRef=null;workbookBindingPendingReason=null;workbookBindingController={current:()=>this.workbookBinding()?.current()??null,currentRegistration:()=>this.workbookBinding()?.currentRegistration()??null,disconnect:reason=>{const controller=this.workbookBinding();if(controller!==null)return controller.disconnect(reason);this.workbookBindingHooks.onValid(null);return false},sync:input=>{const controller=this.workbookBinding();if(controller!==null)return controller.sync(input);if(input.enabled&&(input.workbookId!=null||input.sheetName!=null)){this.workbookBindingPendingReason??=input.reason??"property-change";return null}this.workbookBindingHooks.onValid(null);return null},reconnect:input=>{const controller=this.workbookBinding();if(controller!==null)return controller.reconnect(input);this.workbookBindingHooks.onValid(null);return null}};workbookBinding(){const core=this.formulaCore;if(this.workbookBindingControllerRef===null&&core!==null){this.workbookBindingControllerRef=new core.WorkbookBindingController(this,this.workbookBindingHooks)}return this.workbookBindingControllerRef}formulaVersion=0;resolvedMessages=resolveLocale("en");activeSortModel=[];get activeSort(){return this.activeSortModel.length>0?{field:this.activeSortModel[0].field,direction:this.activeSortModel[0].direction}:null}activeFilters={};activeConditionTree=null;builderDraft={type:"group",op:"and",children:[]};builderFocusKey=null;conditionPresets=[];presetNameDraft="";columnPinned=new Map;dropdownAnchor=null;bodyScrollbarWidth=0;hScrollLeft=0;collapsedGroups=new Set;collapsedRowGroups=new Set;pivotCollapsedRowGroups=new Set;customAggFuncs=new Map;warnedAggFuncs=new Set;warnedLargeTextSeed=new Set;collapsedTreeNodes=new Set;warnedTreeGroupConflict=false;warnedGroupDetailUnstable=false;expandedDetailRows=new Set;rangeState={ranges:[],dragging:null};contextMenuState=null;contextMenuEl=null;contextMenuFocused=false;contextMenuReturnFocus=null;cfBuilderOpen=false;cfDraftRules=[];flashingCells=new Set;flashTimers=new Map;rowDragState=null;rowDragCleanup=null;rowLayoutVersion=0;rowLayoutChunk=null;rowLayoutState=null;rowLayoutFrame=null;rowLayoutKickSeq=0;spanConflictSignature=null;pinnedRowsFacade=null;pinnedRowsVersion=0;pinnedFocus=null;renderingPinnedBand=null;pendingPinnedRows=null;fullWidthFacade=null;fullWidthVersion=0;fullWidthRefusalSignature=null;lastBodyRenderWindow=null;rowDragBinding=null;unmanagedDragTarget=null;unmanagedDragSource=null;dragLive={polite:"",assertive:""};columnDragOverGroupPanel=false;pivotPanelAnnouncement="";pivotPanelFocusField=null;pivotPanelFocusControl="destination";groupPanelEl=null;openFilterField=null;filterForm=null;filterDropdownEl=null;filterDropdownReturnFocus=null;filterDropdownFocused=false;activePagination={pageIndex:0,pageSize:DEFAULT_PAGE_SIZE};latestPaginatedMeta=null;quickFilterValue="";effectiveLoading=false;activeCell=null;formulaBarDraft=null;cellTooltip=null;cellTooltipDelay=createHoverDelay({showMs:400,hideMs:100,onShow:target=>this.showCellTooltip(target),onHide:()=>{this.cellTooltip=null}});headerTooltipDelay=createHoverDelay({showMs:400,hideMs:100,onShow:target=>this.showHeaderTooltip(target),onHide:()=>{this.cellTooltip=null}});editingCell=null;editStore=createEditStore();editCommitInProgress=false;incrementalRowDataAssignment=null;sourceRowIndexCache=null;warnedIdentityEdit=false;warnedUnbackedValueSetter=false;undoRedoStack=createUndoRedoStack();undoRedoUnsubscribe=null;collabSession=null;collabGlue=null;chunkLoader=null;componentManager=null;componentManagerPromise=null;editorFacade=null;componentPopupPlacement=null;componentEditorValidationPresenter=null;filterFacade=null;componentManagerEpoch=0;componentManagerFailureReportedEpoch=-1;componentRegistryRevision=0;localGridComponentRegistrations=new Map;lifecycleEditorVersion=0;lifecycleEditorRef=null;lifecycleEditorCell=null;lifecycleEditorAttachTask=null;lifecycleEditorHost=null;lifecycleEditorSequence=0;lifecycleEditorRequestRevision=0;lifecycleEditorRequestTask=Promise.resolve();lifecycleEditorQueuedRequestRevision=null;lifecycleEditorStartTask=null;lifecycleEditorAttachmentReady=null;lifecycleEditorAttachedWrapper=null;lifecycleEditorValidationPresentation=null;lifecycleEditorPopupReposition=null;lifecycleEditorNavigationTarget=null;lifecycleFilterVersion=0;componentFilterReconcileSequence=0;componentFilterReconcileTask=null;componentFilterPeerNotificationTask=null;componentFilterPeerNotificationRevision=0;componentFilterReconcileInputs=null;componentFilterRevision=0;componentFilterReadyRevision=-1;componentFilterValueGetters=new Map;componentFilterModels=new Map;componentFilterDesiredIds=new Set;componentRecentlyDestroyedFilters=new Set;componentFilterChangeBatchDepth=0;componentFilterRemoteChangePending=false;componentFilterRemoteFlushRevision=0;componentFilterRestorePending=false;componentFilterHosts=new Map;componentFloatingFilterHosts=new Map;componentFilterHostRefs=new Map;externalFilterApplied=null;externalFilterRevision=0;externalFilterReadyRevision=-1;componentRemoteFilterErrors=new Set;componentRowTokens=new WeakMap;componentRowTokenSequence=0;componentIdentityIndex=null;componentIdentityReportedErrors=new Set;pendingComponentIdentityErrors=[];queueComponentIdentityError(signature,message){if(this.componentIdentityReportedErrors.has(signature))return;this.componentIdentityReportedErrors.add(signature);this.pendingComponentIdentityErrors.push({code:"INVALID_INSTANCE",phase:"lookup",componentKind:"renderer",retryable:false,cause:new Error(message)})}isPivotSubtotalDisplayRow(row){return row!==null&&typeof row==="object"&&row.__syPivotSubtotal===true}componentIdentityRow(row){if(isTreeNodeRow(row)){return row.row!==null&&typeof row.row==="object"?row.row:null}if(isPivotRowGroupMarker(row)||isPivotGrandTotalRow(row)||this.isPivotSubtotalDisplayRow(row))return row;if(isGroupMarkerRow(row)||isGroupFooterRow(row)||isDetailRow(row)||isLoadingPlaceholderRow(row)){return null}return row}componentObjectToken(row){const existing=this.componentRowTokens.get(row);if(existing!==void 0)return existing;const token=`object-${++this.componentRowTokenSequence}`;this.componentRowTokens.set(row,token);return token}ensureComponentIdentityIndex(){if(this.componentIdentityIndex!==null){return this.componentIdentityIndex}const displayRows=this.getDisplayRows();const rowOccurrences=new WeakMap;const uniqueRows=[];const seenRows=new WeakSet;for(const displayRow of displayRows){const row=this.componentIdentityRow(displayRow);if(row===null||typeof row!=="object")continue;rowOccurrences.set(row,(rowOccurrences.get(row)??0)+1);if(!seenRows.has(row)){seenRows.add(row);uniqueRows.push(row)}}const rowIdsByObject=new WeakMap;const rowsById=new Map;for(const row of uniqueRows){if((rowOccurrences.get(row)??0)!==1){rowIdsByObject.set(row,null);this.queueComponentIdentityError(`duplicate-object:${this.componentObjectToken(row)}`,"A lifecycle renderer row appeared more than once in the display model; the instance was not mounted.");continue}let rowId;if(typeof this.getRowId!=="function"){rowId=this.componentObjectToken(row)}else{let getRowIdThrew=false;try{const candidate=this.getRowId(row);rowId=typeof candidate==="string"&&candidate.trim().length>0||typeof candidate==="number"&&Number.isFinite(candidate)?candidate:null}catch{getRowIdThrew=true;rowId=null;this.queueComponentIdentityError(`get-row-id-throw:${this.componentObjectToken(row)}`,"getRowId threw while resolving a lifecycle renderer identity; the instance was not mounted.")}if(rowId===null&&!getRowIdThrew){this.queueComponentIdentityError(`invalid-row-id:${this.componentObjectToken(row)}`,"getRowId must return a non-empty string or a finite number for lifecycle renderer identity.")}}rowIdsByObject.set(row,rowId);if(rowId!==null){const matches=rowsById.get(rowId);if(matches===void 0)rowsById.set(rowId,[row]);else matches.push(row)}}const rowIds=new Set;for(const[rowId,rows]of rowsById){if(rows.length===1){rowIds.add(rowId);continue}for(const row of rows)rowIdsByObject.set(row,null);this.queueComponentIdentityError(`duplicate-row-id:${typeof rowId}:${String(rowId)}`,`getRowId returned duplicate lifecycle renderer identity "${String(rowId)}"; all colliding instances were not mounted.`)}const columnsById=new Map;for(const column of this.effectiveColumns()){const candidate=column.colId??column.field;if(typeof candidate!=="string"||candidate.trim().length===0){this.queueComponentIdentityError(`invalid-col-id:${String(candidate)}`,"A lifecycle renderer column id must be a non-empty string.");continue}columnsById.set(candidate,(columnsById.get(candidate)??0)+1)}const colIds=new Set;for(const[colId,count]of columnsById){if(count===1)colIds.add(colId);else{this.queueComponentIdentityError(`duplicate-col-id:${colId}`,`Column id "${colId}" is duplicated; colliding lifecycle renderer instances were not mounted.`)}}this.componentIdentityIndex={rowIdsByObject,rowIds,colIds};return this.componentIdentityIndex}componentRowId(row){if(row===null||typeof row!=="object")return null;return this.ensureComponentIdentityIndex().rowIdsByObject.get(row)??null}componentColumnId(col){const candidate=col.colId??col.field;if(typeof candidate!=="string")return null;return this.ensureComponentIdentityIndex().colIds.has(candidate)?candidate:null}componentLogicalCellExists=identity2=>{const index2=this.ensureComponentIdentityIndex();return index2.colIds.has(identity2.colId)&&index2.rowIds.has(identity2.rowId)};componentFacadeIdentity(rowId,colId){if(!(typeof rowId==="string"&&rowId.trim().length>0||typeof rowId==="number"&&Number.isFinite(rowId))||typeof colId!=="string"||colId.trim().length===0){return null}return{rowId,colId}}componentRendererCellKey(rowId,colId){try{return`cell:${JSON.stringify([rowId,colId])}`}catch{return"cell:unavailable"}}sameComponentIdentity(left,right){return left.rowId===right.rowId&&left.colId===right.colId}releaseFocusedLifecycleRenderer(){this.lifecycleRendererFocusSequence+=1;const focused=this.focusedLifecycleRenderer;this.focusedLifecycleRenderer=null;if(focused===null||this.componentManager===null)return;this.componentManager.renderer.focusOut(focused.identity,focused.generation)}activeLifecycleRendererIdentity(){const active=this.activeCell;if(active===null)return null;const displayRow=this.getDisplayRows()[active.rowIndex];const col=this.effectiveColumns()[active.colIndex];if(displayRow===void 0||col===void 0)return null;if(this.lifecycleRendererDeclaration(col)===null)return null;const row=this.componentIdentityRow(displayRow);if(row===null)return null;const rowId=this.componentRowId(row);const colId=this.componentColumnId(col);return rowId===null||colId===null?null:{rowId,colId}}focusActiveLifecycleRenderer(){const manager=this.componentManager;const identity2=this.activeLifecycleRendererIdentity();if(manager===null||identity2===null||!this.gridOwnsDocumentFocus()){this.releaseFocusedLifecycleRenderer();return}const discovery=manager.renderer.lookup(identity2);if(discovery.status!=="mounted"){this.releaseFocusedLifecycleRenderer();return}if(this.focusedLifecycleRenderer!==null&&this.sameComponentIdentity(this.focusedLifecycleRenderer.identity,identity2)&&this.focusedLifecycleRenderer.generation===discovery.generation){return}const releaseSequence=this.lifecycleRendererFocusSequence;this.releaseFocusedLifecycleRenderer();if(this.lifecycleRendererFocusSequence!==releaseSequence+1){return}const focusSequence=++this.lifecycleRendererFocusSequence;if(manager.renderer.focusIn(identity2,discovery.generation)&&focusSequence===this.lifecycleRendererFocusSequence&&manager===this.componentManager){this.focusedLifecycleRenderer={identity:identity2,generation:discovery.generation}}else if(focusSequence!==this.lifecycleRendererFocusSequence){manager.renderer.focusOut(identity2,discovery.generation)}}emitComponentError(error){if(!this.host?.isConnected)return;this.componentError.emit({code:error.code,phase:error.phase,componentKind:error.componentKind,componentName:error.componentName,mountKey:error.mountKey,generation:error.generation,retryable:error.retryable,cause:error.cause})}componentFilterExecutionMode(){if(this.serverSideModeActive()||this.viewportModeActive()){return"server"}return this.infiniteModeActive()?"infinite":"client"}invalidateComponentFilterRuntime(){this.componentFilterRevision+=1;this.componentFilterReadyRevision=-1;this.componentFilterReconcileInputs=null;this.componentFilterReconcileSequence+=1;this.componentRemoteFilterErrors.clear();if(this.componentFilterExecutionMode()!=="client"){if(this.componentFilterChangeBatchDepth>0){this.componentFilterRemoteChangePending=true}else{this.infiniteModelInputsChanged()}}}async runComponentFilterChangeBatch(operation){const managerEpoch=this.componentManagerEpoch;this.componentFilterChangeBatchDepth+=1;try{return await operation()}finally{if(managerEpoch===this.componentManagerEpoch){this.componentFilterChangeBatchDepth-=1;if(this.componentFilterChangeBatchDepth===0&&this.componentFilterRemoteChangePending){this.componentFilterRemoteChangePending=false;this.infiniteModelInputsChanged();this.componentFilterRemoteFlushRevision+=1}}}}externalFilterRuntimeReady(){return this.externalFilter==null||this.externalFilterReadyRevision===this.externalFilterRevision&&Object.is(this.externalFilterApplied,this.externalFilter)&&this.filterFacade?.getExternalFilter()!==null}handleComponentFilterChanged(colId,source,model){const hadPrevious=this.componentFilterModels.has(colId);const previous=this.componentFilterModels.get(colId);this.componentFilterModels.set(colId,model);this.componentRemoteFilterErrors.clear();this.lifecycleFilterVersion+=1;if(this.componentFilterExecutionMode()!=="client"){if(this.componentFilterChangeBatchDepth>0){this.componentFilterRemoteChangePending=true}else{this.infiniteModelInputsChanged()}}if(this.host?.isConnected){this.filterChanged.emit({field:colId,filter:null,activeMap:{...this.activeFilters},customModel:model,...hadPrevious?{previousCustomModel:previous}:{},source:source==="ui"?"component":source})}}scheduleLifecycleFilterPeerNotification(){this.componentFilterPeerNotificationRevision+=1;if(this.componentFilterPeerNotificationTask!==null)return;if(this.filterFacade===null)return;const task=Promise.resolve().then(async()=>{let processedRevision=-1;while(processedRevision!==this.componentFilterPeerNotificationRevision){const facade=this.filterFacade;if(facade===null||!this.host?.isConnected)return;const targetRevision=this.componentFilterPeerNotificationRevision;await facade.onAnyFilterChanged();if(facade!==this.filterFacade||!this.host?.isConnected)return;processedRevision=targetRevision;this.lifecycleFilterVersion+=1}}).catch(()=>void 0).finally(()=>{if(this.componentFilterPeerNotificationTask===task){this.componentFilterPeerNotificationTask=null}});this.componentFilterPeerNotificationTask=task}async getComponentManager(requestingKind="renderer"){if(this.componentManager!==null)return this.componentManager;if(this.componentManagerPromise!==null){return this.componentManagerPromise}const epoch=this.componentManagerEpoch;const task=this.getChunkLoader().load("component-runtime").then(async loaded=>{const module=loaded;const manager=module.createGridComponentManager({timeoutMs:this.componentTimeoutMs,onError:error=>{if(epoch===this.componentManagerEpoch){this.emitComponentError(error)}},onExternalFilterAvailable:()=>{if(epoch!==this.componentManagerEpoch||!this.host?.isConnected){return}this.externalFilterReadyRevision=-1;this.componentFilterReconcileInputs=null;void this.reconcileComponentFilters()},renderer:{isHostConnected:host=>epoch===this.componentManagerEpoch&&Boolean(this.host?.isConnected)&&(!("isConnected"in host)||host.isConnected),logicalExists:identity2=>epoch===this.componentManagerEpoch&&Boolean(this.host?.isConnected)&&this.componentLogicalCellExists(identity2),fallback:()=>({kind:"text",text:"—"})}});for(const registration of this.localGridComponentRegistrations.values()){manager.register("local",registration.kind,registration.name,registration.definition)}if(epoch!==this.componentManagerEpoch||!this.host?.isConnected){await manager.disconnect();throw new DOMException("Grid component runtime load was superseded.","AbortError")}const editorFacade=module.createGridEditorFacadeController({manager,onError:error=>{if(epoch===this.componentManagerEpoch){this.emitComponentError(error)}}});const filterFacade=module.createGridFilterFacadeController({manager,getContext:()=>this.context,executionMode:()=>this.componentFilterExecutionMode(),onFilterChanged:({colId,source,model})=>{if(epoch!==this.componentManagerEpoch||!this.host?.isConnected||!this.componentFilterDesiredIds.has(colId)){return}this.handleComponentFilterChanged(colId,source,model)},onFilterModified:colId=>{if(epoch!==this.componentManagerEpoch||!this.host?.isConnected){return}this.filterModified.emit({field:colId,source:"component"})},onError:error=>{if(epoch===this.componentManagerEpoch){this.emitComponentError(error)}}});const desiredExternal=this.externalFilter??null;const externalRevision=this.externalFilterRevision;const installedExternal=await filterFacade.setExternalFilter(desiredExternal);const externalRefresh=desiredExternal===null||installedExternal===null?null:await filterFacade.refreshExternalFilter(this.context);if(epoch!==this.componentManagerEpoch||!this.host?.isConnected){await editorFacade.disconnect();await filterFacade.disconnect();await manager.disconnect();throw new DOMException("Grid component runtime load was superseded.","AbortError")}this.editorFacade=editorFacade;this.filterFacade=filterFacade;this.componentEditorValidationPresenter=module.renderGridEditorValidation;if(externalRevision===this.externalFilterRevision&&Object.is(desiredExternal,this.externalFilter??null)&&(desiredExternal===null||installedExternal!==null)){this.externalFilterApplied=desiredExternal;if(desiredExternal===null||externalRefresh?.status==="refreshed"){this.externalFilterReadyRevision=externalRevision}}this.componentPopupPlacement=module.placeGridEditorPopup;this.lifecycleFilterVersion+=1;this.componentManager=manager;return manager});this.componentManagerPromise=task.then(manager=>manager,error=>{if(epoch===this.componentManagerEpoch){this.componentManagerPromise=null;if(!(error!==null&&typeof error==="object"&&"name"in error&&error.name==="AbortError")&&this.componentManagerFailureReportedEpoch!==epoch){this.componentManagerFailureReportedEpoch=epoch;this.emitComponentError({code:"LAZY_LOAD_FAILED",phase:"lazy-load",componentKind:requestingKind,retryable:true,cause:error})}}throw error});return this.componentManagerPromise}disposeComponentManager(){this.clearLifecycleEditorValidation();this.unregisterLifecycleEditorDocumentOwner();this.releaseFocusedLifecycleRenderer();const preservedModels=this.filterFacade?.getSerializableModels();if(preservedModels!==void 0){for(const[colId,model]of Object.entries(preservedModels.models)){this.componentFilterModels.set(colId,model)}}this.componentFilterRestorePending=this.componentFilterModels.size>0;this.componentFilterReconcileSequence+=1;this.componentFilterReconcileInputs=null;this.componentFilterReconcileTask=null;this.componentFilterPeerNotificationTask=null;this.componentFilterPeerNotificationRevision+=1;this.componentFilterReadyRevision=-1;this.componentFilterChangeBatchDepth=0;this.componentFilterRemoteChangePending=false;this.componentFilterHosts.clear();this.componentFloatingFilterHosts.clear();this.componentFilterHostRefs.clear();this.lifecycleEditorRequestRevision+=1;this.lifecycleEditorQueuedRequestRevision=null;this.lifecycleEditorRequestTask=Promise.resolve();this.lifecycleEditorStartTask=null;this.componentManagerEpoch+=1;const manager=this.componentManager;const pending=this.componentManagerPromise;const editorFacade=this.editorFacade;const filterFacade=this.filterFacade;this.componentManager=null;this.componentManagerPromise=null;this.editorFacade=null;this.filterFacade=null;this.componentPopupPlacement=null;this.componentEditorValidationPresenter=null;this.lifecycleEditorRef=null;this.lifecycleEditorCell=null;this.lifecycleEditorNavigationTarget=null;this.lifecycleEditorHost=null;this.lifecycleEditorAttachTask=null;this.componentFilterValueGetters.clear();this.externalFilterApplied=null;this.externalFilterReadyRevision=-1;if(manager!==null){void Promise.all([editorFacade?.disconnect(),filterFacade?.disconnect()]).then(()=>manager.disconnect());return}if(pending!==null){void pending.then(loaded=>loaded.disconnect(),()=>void 0)}}getChunkLoader(){if(this.chunkLoader===null||this.chunkLoader.stats().disposed){const sources={"component-runtime":{kind:"esm",load:()=>Promise.resolve().then(function(){return require("./component-runtime-chunk-BCXKlIzs.js")})},"import-xlsx":{kind:"esm",load:()=>Promise.resolve().then(function(){return require("./grid-import-chunk-BlBvP3p6.js")})},"live-api":{kind:"esm",load:()=>Promise.resolve().then(function(){return require("./live-object-model-CjPqHT6U.js")})},"row-layout":{kind:"esm",load:()=>Promise.resolve().then(function(){return require("./row-layout-chunk-CyH-tG1Y.js")})},"row-drag":{kind:"esm",load:()=>Promise.resolve().then(function(){return require("./row-drag-chunk-kA4TVsmj.js")})},"conditional-format":{kind:"esm",load:()=>Promise.resolve().then(function(){return require("./cf-builder-chunk-D6ajo9Mh.js")})}};const proSources=gridProChunkSourcesOnce();if(proSources!==null)Object.assign(sources,proSources);this.chunkLoader=guardGridChunkLoader(createGridChunkLoader({tier:GRID_BUILD_TIER,sources,emit:detail=>{if(detail.phase==="loading")this.chunkLoading.emit(detail);else if(detail.phase==="loaded")this.chunkLoaded.emit(detail);else this.chunkLoadFailed.emit(detail)}}),(chunkId,features)=>this.proGate().admitChunk(chunkId,features))}return this.chunkLoader}async loadExportXlsxChunk(){return await this.getChunkLoader().load("export-xlsx")}async loadExportPdfChunk(){return await this.getChunkLoader().load("export-pdf")}async loadImportXlsxChunk(){return await this.getChunkLoader().load("import-xlsx")}collabOverlayEl=null;collabRowIndexCache=null;auditTrail=null;canReadWarned=false;canEditWarned=false;snapshotStore=[];snapshotCounter=0;syncAuditTrail(){if(this.auditLog){if(this.auditTrail===null)this.auditTrail=new AuditLog({maxEntries:this.auditLogMax})}else{this.auditTrail=null}}onAuditLogChange(){this.syncAuditTrail()}onAuditLogMaxChange(){this.auditTrail?.resize(this.auditLogMax)}onCanReadCellChange(){this.canReadWarned=false;this.cellTooltip=null;this.formulaSuggest=null;if(this.chartLinkRuntimeRef!==null){this.chartLinkGeneration+=1;this.chartLinkRuntimeRef.syncCharts("edit")}}onCanEditCellChange(){this.canEditWarned=false}onMaxSnapshotsChange(){const cap=normalizeSnapshotCap(this.maxSnapshots);if(this.snapshotStore.length>cap)this.snapshotStore=this.snapshotStore.slice(this.snapshotStore.length-cap)}currentAuditRows(){const out=new Map;const rows=this.rowData??[];rows.forEach((row,rowIndex)=>{if(row===null||typeof row!=="object")return;out.set(this.collabRowId(row,rowIndex),{data:row,rowIndex})});return out}auditEntriesForPublicRead(entries){if(!this.readPolicyConfigured())return entries;const rows=this.currentAuditRows();const columns=new Map(this.resolvedColumnDefs().map(col=>[col.field,col]));return entries.map(entry=>{if(entry.kind!=="cell")return entry;const context=rows.get(entry.rowId);const col=columns.get(entry.field);if(context===void 0||col===void 0){return{...entry,oldValue:this.maskedCellValue,newValue:this.maskedCellValue}}const data=context.data;const rowIndex=context.rowIndex;return{...entry,oldValue:this.applyReadMask(entry.oldValue,data,rowIndex,col),newValue:this.applyReadMask(entry.newValue,data,rowIndex,col)}})}recordAudit(input){if(this.auditTrail===null)return;const entry=this.auditTrail.record(input);this.auditLogChanged.emit({entry:this.auditEntriesForPublicRead([entry])[0]})}fireRowDataChanged(detail,options={}){for(const entry of detail.removed){this.liveRowHeights.delete(this.collabRowId(entry.row,entry.index))}this.rowDataChanged.emit(detail);if(options.publishLiveObjects!==false){const addedById=new Map(detail.added.map(entry=>[this.collabRowId(entry.row,entry.index),entry]));const removedById=new Map(detail.removed.map(entry=>[this.collabRowId(entry.row,entry.index),entry]));const replacedIds=new Set([...addedById.keys()].filter(id=>removedById.has(id)));this.publishLiveObjectChanges([...detail.added.filter(entry=>!replacedIds.has(this.collabRowId(entry.row,entry.index))).map(entry=>["row",this.collabRowId(entry.row,entry.index),"dataChanged","rowData",{txId:detail.txId,before:void 0,after:entry.row,data:entry.row}]),...detail.updated.map(entry=>["row",this.collabRowId(entry.row,entry.index),"dataChanged","rowData",{txId:detail.txId,before:entry.previous,after:entry.row,data:entry.row}]),...detail.removed.filter(entry=>!replacedIds.has(this.collabRowId(entry.row,entry.index))).map(entry=>["row",this.collabRowId(entry.row,entry.index),"dataChanged","rowData",{txId:detail.txId,before:entry.row,after:void 0,data:entry.row}]),...[...replacedIds].map(id=>{const before=removedById.get(id).row;const after=addedById.get(id).row;return["row",id,"dataChanged","rowData",{txId:detail.txId,before,after,data:after}]})])}if(this.auditTrail!==null){const source=detail.origin==="clipboard"?"clipboard":detail.source??"local";this.recordAudit({kind:"rows",source,txId:detail.txId,added:detail.added.length,updated:detail.updated.length,removed:detail.removed.length})}}fireSelectionChanged(detail,source="ui"){this.selectionChanged.emit(detail);this.publishLiveObjectChanges([...detail.addedIds.map(id=>["row",id,"selectionChanged",source,{before:false,after:true}]),...detail.removedIds.map(id=>["row",id,"selectionChanged",source,{before:true,after:false}])]);if(this.auditTrail!==null&&detail.addedIds.length+detail.removedIds.length>0){this.recordAudit({kind:"selection",source:"local",selectedCount:detail.selectedRowIds.length,addedIds:[...detail.addedIds],removedIds:[...detail.removedIds]})}}async getAuditLog(filter){return this.auditTrail===null?[]:this.auditEntriesForPublicRead(this.auditTrail.entries(filter))}async clearAuditLog(){this.auditTrail?.clear()}async getAuditLogAsCsv(filter){return auditEntriesToCsv(await this.getAuditLog(filter))}async getAuditLogAsJson(filter,pretty=false){return auditEntriesToJson(await this.getAuditLog(filter),pretty)}async exportAuditLogAsCsv(fileName,filter){this.downloadTextFile(await this.getAuditLogAsCsv(filter),fileName??"audit-log.csv","text/csv;charset=utf-8")}async exportAuditLogAsJson(fileName,filter){this.downloadTextFile(await this.getAuditLogAsJson(filter,true),fileName??"audit-log.json","application/json;charset=utf-8")}downloadTextFile(text,fileName,mime){const doc=this.host?.ownerDocument??document;const view=doc.defaultView??window;const blob=new Blob([text],{type:mime});const url=view.URL.createObjectURL(blob);const anchor=doc.createElement("a");anchor.href=url;anchor.download=fileName;anchor.style.display="none";doc.body.appendChild(anchor);anchor.click();anchor.remove();view.setTimeout(()=>view.URL.revokeObjectURL(url),0)}cellCommentIndex=new Map;commentIndexKey(rowId,field){return`${rowId}${field}`}cellCommentBadge(row,rowIndex,field){if(this.cellCommentIndex.size===0)return null;return this.cellCommentBadgeFor(this.collabRowId(row,rowIndex),field)}cellCommentBadgeFor(rowId,field){if(rowId===null||this.cellCommentIndex.size===0)return null;const entry=this.cellCommentIndex.get(this.commentIndexKey(rowId,field));if(entry===void 0||entry.count===0)return null;return{unresolved:entry.unresolved>0}}seenCommentIds=new Set;conflictFlashCells=new Set;collabConflictToast=null;conflictFlashTimers=new Map;conflictToastTimer=null;clearConflictUi(){for(const t2 of this.conflictFlashTimers.values())clearTimeout(t2);this.conflictFlashTimers.clear();if(this.conflictToastTimer!==null){clearTimeout(this.conflictToastTimer);this.conflictToastTimer=null}if(this.conflictFlashCells.size>0)this.conflictFlashCells=new Set;if(this.collabConflictToast!==null)this.collabConflictToast=null}commentPanel=null;commentPanelAnchor=null;commentPanelOffscreen=false;commentPanelThread=[];commentPanelInputEl=null;commentPanelRowIndex=-1;openCommentPanelAt(rowId,field){if(this.collabSession===null)return;if(!this.commentWriteAllowed("openCellCommentPanel"))return;this.commentPanel={rowId:String(rowId),field};this.commentPanelRowIndex=-1;this.commentPanelOffscreen=false;this.commentPanelThread=this.collabSession.getCellComments?.(rowId,field)??[]}closeCommentPanel(){this.commentPanel=null;this.commentPanelAnchor=null;this.commentPanelOffscreen=false;this.commentPanelRowIndex=-1;this.commentPanelThread=[]}async openCellCommentPanel(rowId,field){return this.proMethod("openCellCommentPanel",{load:()=>this.cellNotesModule(),exec:()=>void 0,publish:()=>this.openCommentPanelAt(rowId,field)})}async closeCellCommentPanel(){return this.proRun("closeCellCommentPanel",()=>this.closeCommentPanel())}commentWriteAllowed(member){return this.proWorkAllowed("grid.cell-notes",member)}columnWidths=new Map;columnResizeController=createColumnResizeController();minimumColumnWidth=1;interactiveColumnMinWidth=24;compactHeaderControlsWidth=72;columnResizePointerId=null;columnResizeEscHandler=null;columnResizeHandleEl=null;columnResizeGuide=null;columnResizeGuideStartX=null;columnResizeGuideStartWidth=null;columnOrder=null;columnReorderController=createColumnReorderController();columnReorderPointerId=null;columnReorderEscHandler=null;columnReorderDocPointerMoveHandler=null;columnReorderDocPointerUpHandler=null;columnReorderDocPointerCancelHandler=null;columnReorderHeaderEl=null;columnReorderHeaderRowEl=null;columnReorderPreviewEl=null;columnReorderStartRects=[];columnReorderStartPointerX=0;columnReorderPointerToRightEdge=0;columnReorderPointerOffsetX=0;columnReorderPointerOffsetY=0;columnHidden=new Set;columnVisibilityController=createColumnVisibilityController();columnVisibilityChangedUnsubscribe=null;columnVisibilityResetUnsubscribe=null;columnVisibilityForwardSuppressed=false;columnVisibilityEventSource="api";withColumnVisibilitySource(source,action){const previous=this.columnVisibilityEventSource;this.columnVisibilityEventSource=source;try{return action()}finally{this.columnVisibilityEventSource=previous}}sortController=createColumnSortController();autoSizeCanvasCache=new Map;textEditorState=null;numberEditorState=null;dateEditorState=null;calendarState=null;calendarFocusedIso=null;calendarKbdNavigated=false;calendarAnchor=null;selectEditorState=null;selectTriggerEl=null;autocompleteEditorState=null;autocompleteInputEl=null;autocompleteAnchor=null;richSelect=null;richSelectArming=false;richSelectTick=0;richSelectArmed(){if(this.richSelect===null&&!gridProChunkInBuild("rich-select"))return null;if(this.richSelect===null&&!this.richSelectArming){this.richSelectArming=true;void this.getChunkLoader().load("rich-select").then(chunk=>{this.richSelect=chunk;this.richSelectTick+=1}).catch(()=>{this.richSelectArming=false})}return this.richSelect}armRichSelect(){if(this.richSelect!==null||this.richSelectArming)return;if(!this.effectiveColumns().some(col=>col.cellEditor==null&&col.editor==="autocomplete"))return;if(this.proAllowed("grid.rich-select","columnDefs")&&this.proModuleAvailable("grid.rich-select","columnDefs","rich-select")){this.richSelectArmed()}}checkboxEditorState=null;checkboxEditorEl=null;textareaEditorState=null;textareaEditorEl=null;largeTextConfig=null;largeTextAnchor=null;largeTextAnchorEl=null;cellRendererRegistry=createRendererRegistry();cellRendererVersion=0;cellRendererWarnedFields=new Set;pendingLifecycleRenderers=new Map;lifecycleRendererReconcileSequence=0;lifecycleRendererPresentationVersion=0;lifecycleRendererPresentations=new Map;rendererPresentationsByCoordinate=new Map;focusedLifecycleRenderer=null;lifecycleRendererFocusSequence=0;textEditorEl=null;selectionState=createSelectionState("none");rangeAnchorRowId=null;hoverState=createHoverState();pendingHoverRowId=null;hoverRafHandle=null;viewportMouseMoveHandler=null;viewportMouseLeaveHandler=null;viewportHoverEl=null;viewportSize=null;scrollTop=0;virtualWindow=null;virtualWindowRowCount=0;virtualWindowViewportHeight=0;columnWindowLive=false;scrollPassViewportHeight=null;virtualWindowDetailSet=null;rowHeightCache=null;lastMeasuredRowsRef=null;lastMeasuredLayoutSig="";measuringAutoHeight=false;autoHeightRenderMode=false;autoHeightVersion=0;csvWizard=null;csvFileInputEl=null;csvImportButtonEl=null;csvWizardEl=null;csvWizardFocused=false;detachVirtualScroll=null;resizeObserver=null;viewportEl=null;infiniteCache=null;serverSideState=null;ssrmSelection=null;ssrmSelectionProjection=null;ssrmProjectionSource=null;viewportState=null;viewportGen=0;serverDisplayRowsCache=null;cachedPivot=null;serverSideGen=0;lastServerFetchWindow=null;ssrmRegistry=null;ssrmEpoch=0;ssrmRegistryEpoch=-1;ssrmRuntime=null;ssrmRefreshFloors=new Map;ssrmDiscardedStaleLandings=0;serverPivotResultsStale=false;lastFetchedWindow=null;infiniteCacheGen=0;quickFilterDebounceTimer=null;loadingDebouncer=createLoadingDebouncer(DEFAULT_MIN_LOADING_DURATION_MS);loadingDebounceTimer=null;pendingScrollIntoView=null;quickFilterPendingValue="";quickFilterInputEl=null;async getApi(){await this.ensureLiveObjects();return this.host}async getColumn(columnId){return(await this.ensureLiveObjects()).getColumn(columnId)}async getColumns(){return(await this.ensureLiveObjects()).getColumns()}async getColumnGroup(groupId){return(await this.ensureLiveObjects()).getColumnGroup(groupId)}async getColumnGroups(){return(await this.ensureLiveObjects()).getColumnGroups()}async getRow(rowId){return(await this.ensureLiveObjects()).getRow(rowId)}async getDisplayedRowAtIndex(index2){return(await this.ensureLiveObjects()).getDisplayedRowAtIndex(index2)}async forEachRow(callback){(await this.ensureLiveObjects()).forEachRow(callback)}async forEachDisplayedRow(callback){(await this.ensureLiveObjects()).forEachDisplayedRow(callback)}async ensureLiveObjects(){if(this.liveObjectModel!==null){this.liveObjectModel.reconcile();return this.liveObjectModel}this.liveObjectModelPromise??=this.getChunkLoader().load("live-api").then(module=>{const{GridLiveObjectModel}=module;let columnGraph=null;this.liveObjectModel=new GridLiveObjectModel({isConnected:()=>this.host?.isConnected!==false,columns:()=>(columnGraph=this.liveColumnSnapshotGraph()).columns,columnGroups:()=>{const groups=(columnGraph??this.liveColumnSnapshotGraph()).groups;columnGraph=null;return groups},rows:()=>this.liveRowSnapshotGraph().rows,mutate:(mutation,signal)=>this.applyLiveMutation(mutation,signal),emitGridEvent:event=>this.gridObjectChanged.emit(event),mintMutationId:this.mintGridMutationId,columnFilter:{getModel:colId=>this.getColumnFilterModel(colId),setModel:(colId,model)=>this.setColumnFilterModel(colId,model)}});return this.liveObjectModel}).catch(error=>{this.liveObjectModelPromise=null;throw error});return this.liveObjectModelPromise}publishLiveObjectChange(kind,id,type,source,detail={}){this.publishLiveObjectChanges([[kind,id,type,source,detail]])}publishLiveObjectChanges(changes){if(this.liveMutationDepth>0||changes.length===0)return;this.liveObjectModel?.publishBatch(changes.map(([kind,id,type,source,detail])=>({kind,id,type,source,detail})))}publishLiveRowExpansions(before,source){if(before.length===0)return;const graph=this.liveRowSnapshotGraph();this.publishLiveObjectChanges(before.flatMap(previous=>{const after=graph.byId.get(previous.id);return after===void 0||after.expanded===previous.expanded?[]:[["row",previous.id,"expandedChanged",source,{before:previous.expanded,after:after.expanded,data:after.data??void 0}]]}))}resolveGridCellValue(input){return resolveCellValue({...input,context:this.context,api:this.host})}formatGridCellValue(input){return formatCellValue({...input,context:this.context,api:this.host})}liveColumnId(column){return typeof column.colId==="string"&&column.colId.length>0?column.colId:column.field}liveColumnSnapshotGraph(){const definitions=this.columnDefsSource();const resolvedByDefinition=new Map;const declaredColumns=[];const columnIdCounts=new Map;const groupIdCounts=new Map;const scan=(nodes,path)=>{nodes.forEach((node,index2)=>{const nodePath=path===""?String(index2):`${path}.${index2}`;if(isColumnGroupDef(node)){const id2=node.groupId??nodePath;groupIdCounts.set(id2,(groupIdCounts.get(id2)??0)+1);scan(node.children,nodePath);return}const resolved=this.resolveColDef(node);if(resolved===null)return;resolvedByDefinition.set(node,resolved);declaredColumns.push(resolved);const id=this.liveColumnId(resolved);columnIdCounts.set(id,(columnIdCounts.get(id)??0)+1)})};scan(definitions,"");const duplicateColumnIds=new Set([...columnIdCounts].filter(([,count])=>count>1).map(([id])=>id));const duplicateGroupIds=new Set([...groupIdCounts].filter(([,count])=>count>1).map(([id])=>id));if(duplicateColumnIds.size>0&&!this.warnedLiveDuplicateColumnIds){this.warnedLiveDuplicateColumnIds=true;console.warn(`[SG:LIVE:COL] dup=${duplicateColumnIds.size}; omit`)}if(duplicateGroupIds.size>0&&!this.warnedLiveDuplicateColumnGroupIds){this.warnedLiveDuplicateColumnGroupIds=true;console.warn(`[SG:LIVE:GROUP] dup=${duplicateGroupIds.size}; omit`)}const declared=duplicateColumnIds.size===0?declaredColumns:declaredColumns.filter(column=>!duplicateColumnIds.has(this.liveColumnId(column)));const groups=[];const parentByColumn=new Map;const visibleIds=new Set(this.effectiveColumns().map(column=>this.liveColumnId(column)));const visit=(nodes,parentId,path)=>{const leafIds=[];const childIds=[];nodes.forEach((node,index2)=>{const nodePath=path===""?String(index2):`${path}.${index2}`;if(!isColumnGroupDef(node)){const resolved=resolvedByDefinition.get(node);if(resolved===void 0)return;const id2=this.liveColumnId(resolved);if(duplicateColumnIds.has(id2))return;if(parentId!==null)parentByColumn.set(id2,parentId);leafIds.push(id2);childIds.push({kind:"column",id:id2});return}const id=node.groupId??nodePath;const valid=!duplicateGroupIds.has(id);const descendants=visit(node.children,valid?id:parentId,nodePath);const leaves=descendants.leafIds;if(!valid){leafIds.push(...leaves);childIds.push(...descendants.childIds);return}groups.push({id,definition:node,childIds:descendants.childIds,leafIds:leaves,parentId,expanded:!this.collapsedGroups.has(id),padding:!groupHasToggle(node),displayed:leaves.some(leafId=>visibleIds.has(leafId))});leafIds.push(...leaves);childIds.push({kind:"columnGroup",id})});return{leafIds,childIds}};visit(definitions,null,"");const columns=declared.map(column=>{const id=this.liveColumnId(column);const field=column.field;const sortIndex=this.activeSortModel.findIndex(entry=>entry.field===field);return{id,definition:column,actualWidth:this.resolveEffectiveColumnWidth(field),visible:visibleIds.has(id),pinned:this.pinSideOf(column),sort:sortIndex<0?null:{direction:this.activeSortModel[sortIndex].direction,index:sortIndex},aggFunc:typeof column.aggFunc==="string"?column.aggFunc:null,pivotActive:this.pivotModeActive()&&(this.pivotValueColumns??[]).includes(field),parentId:parentByColumn.get(id)??null}});return{columns,groups}}liveRowSnapshotGraph(){const displayed=this.getDisplayRows();const externalKind=this.serverSideModeActive()?"server":this.viewportModeActive()?"viewport":this.infiniteModeActive()?"infinite":null;const inputs=[...Object.values(this.engineRowsInputs()),displayed,this.selectionState.selectedRowIds,externalKind,this.serverSideDatasource,this.serverSideGroupCols,this.serverSideState,this.viewportDatasource,this.viewportState,this.datasource,this.infiniteCache];const cached=this.liveRowSnapshotCache;if(cached!==null&&sameEngineRowsInputs(cached.inputs,inputs)){return cached.graph}const source=externalKind===null?this.rowData??[]:[];const usedIds=new Set;const duplicateIds=new Set;const resolvePublicId=(row,fallbackIndex,allowFallback)=>{let value;if(typeof this.getRowId!=="function"){if(!allowFallback)return null;value=fallbackIndex}else{try{value=this.getRowId(row)}catch{}}const valid=typeof value==="string"&&value.length>0||typeof value==="number"&&Number.isFinite(value);if(!valid){if(!this.warnedLiveInvalidRowIds){this.warnedLiveInvalidRowIds=true;console.warn("[SG:LIVE:ROW] bad id/throw; omit")}return null}const id=value;if(usedIds.has(id))duplicateIds.add(id);else usedIds.add(id);return id};const entityRows=externalKind===null?source:displayed;const publicIds=entityRows.map((row,index2)=>row!==null&&typeof row==="object"&&(externalKind===null||!this.isSentinelDisplayRow(row))?resolvePublicId(row,index2,externalKind===null):null);if(duplicateIds.size>0&&!this.warnedLiveDuplicateRowIds){this.warnedLiveDuplicateRowIds=true;console.warn(`[SG:LIVE:ROW] dup=${duplicateIds.size}; omit`)}const rows=[];const byId=new Map;const syntheticIds=new Map;const syntheticId=(kind,logicalKey)=>{const mapKey=`${kind}\0${logicalKey}`;const existing=syntheticIds.get(mapKey);if(existing!==void 0)return existing;const base=`\0sy-grid:${kind}:${logicalKey}`;let id=base;let collision=0;while(usedIds.has(id))id=`${base}#${++collision}`;usedIds.add(id);syntheticIds.set(mapKey,id);return id};const publicIdKey=id=>typeof id==="number"?`number:${String(id)}`:`string:${id}`;const add=(id,patch)=>{const existing=byId.get(id);if(existing)return existing;const snapshot={id,sourceIndex:null,displayIndex:null,data:null,parentId:null,childIds:[],group:false,leaf:false,master:false,detail:false,level:0,route:[],selected:false,expanded:false,...patch};byId.set(id,snapshot);rows.push(snapshot);return snapshot};const show=(snapshot,index2)=>{snapshot.displayIndex=index2};const appendChild=(parentId,childId)=>{if(parentId===null)return;const parent=byId.get(parentId);if(!parent||parent.childIds.includes(childId))return;parent.childIds=[...parent.childIds,childId]};const sourceSnapshotsByObject=new WeakMap;const sourceSnapshotByObject=row=>sourceSnapshotsByObject.get(row)??null;const master=this.masterDetailActive();const serverFlat=externalKind==="server"?this.serverSideFlatten():[];const externalSnapshots=[];entityRows.forEach((row,index2)=>{if(row===null||typeof row!=="object"||externalKind!==null&&this.isSentinelDisplayRow(row))return;const explicitId=publicIds[index2];if(explicitId!==null&&duplicateIds.has(explicitId))return;if(explicitId===null&&externalKind===null)return;const serverRow=serverFlat[index2];const id=explicitId??syntheticId(externalKind,serverRow?.kind==="leaf"?`${serverRow.parentPath}\0${serverRow.childIndex}`:String(index2));const snapshot=add(id,{data:row,leaf:true,selected:this.selectionState.selectedRowIds.has(id)});if(externalKind===null){snapshot.sourceIndex=index2;snapshot.master=master;snapshot.expanded=this.expandedDetailRows.has(id);sourceSnapshotsByObject.set(row,sourceSnapshotsByObject.has(row)?null:snapshot)}else{show(snapshot,index2);externalSnapshots[index2]=snapshot}});const treeSurface=this.treeSurface();const groupFields=treeSurface===null?this.effectiveGroupFields():null;const groupIdentity=marker=>{const level=marker.level??0;const route=(marker.groupKeys??[marker.key===null?BLANK_GROUP_KEY:String(marker.key)]).map(String);return{id:syntheticId("group",`${level}:${frameSegmentPath(route)}`),route,level,expandKey:marker.key}};const treeIdByPath=new Map;const treeSnapshot=(data,route,group,level,expanded)=>{const pathKey=foldTreePathKey(route);const dataSnapshot=data&&typeof data==="object"?sourceSnapshotByObject(data):null;const id=dataSnapshot?.id??syntheticId("tree",pathKey);const parentPath=route.length>1?foldTreePathKey(route.slice(0,-1)):null;const parentId=parentPath===null?null:treeIdByPath.get(parentPath)??(externalKind==="server"?syntheticId("tree",parentPath):null);const snapshot=dataSnapshot??add(id,{data});snapshot.parentId=parentId;snapshot.group=group;snapshot.leaf=!group;snapshot.level=level;snapshot.route=route;snapshot.expanded=expanded;appendChild(parentId,snapshot.id);if(!treeIdByPath.has(pathKey))treeIdByPath.set(pathKey,snapshot.id);return snapshot};if(treeSurface!==null){const{createTreeDataStage}=this.treeDataEngine();const logical=runPipeline(source,[createTreeDataStage({getDataPath:treeSurface.getDataPath,getRowLabel:treeSurface.getRowLabel,getSegmentLabel:treeSurface.getSegmentLabel})]).rows;for(const entry of logical){if(!isTreeNodeRow(entry))continue;const route=entry.path.map(String);const pathKey=foldTreePathKey(route);treeSnapshot(entry.row,route,entry.hasChildren,entry.depth,!this.collapsedTreeNodes.has(pathKey))}}else if(groupFields!==null){const{createGroupStage,createMultiGroupStage}=this.groupPivotEngine();const stage=groupFields.length>=2?createMultiGroupStage({groupFields}):createGroupStage({field:groupFields[0]});const logical=runPipeline(source,[stage]).rows;const stack=[];for(const entry of logical){if(isGroupMarkerRow(entry)){const identity2=groupIdentity(entry);stack.length=identity2.level;const parentId2=identity2.level>0?stack[identity2.level-1]??null:null;const snapshot2=add(identity2.id,{parentId:parentId2,group:true,level:identity2.level,route:identity2.route,expandKey:identity2.expandKey,expanded:identity2.expandKey===null?!this.collapsedRowGroups.has(BLANK_GROUP_KEY):!this.collapsedRowGroups.has(identity2.expandKey)});snapshot2.parentId=parentId2;appendChild(parentId2,snapshot2.id);stack[identity2.level]=snapshot2.id;continue}if(this.isSentinelDisplayRow(entry))continue;const snapshot=sourceSnapshotByObject(entry);if(!snapshot)continue;const parentId=stack.length>0?stack[stack.length-1]:null;snapshot.parentId=parentId;snapshot.level=stack.length;appendChild(parentId,snapshot.id)}}displayed.forEach((row,displayIndex)=>{if(isGroupMarkerRow(row)){const identity2=groupIdentity(row);const snapshot2=byId.get(identity2.id);if(snapshot2){show(snapshot2,displayIndex);snapshot2.expanded=row.expanded}return}if(isTreeNodeRow(row)){const route=row.path.map(String);const snapshot2=treeSnapshot(row.row,route,row.hasChildren,row.depth,row.expanded);show(snapshot2,displayIndex);return}if(isDetailRow(row)){const parent=byId.get(row.forId);if(!parent)return;const id=syntheticId("detail",publicIdKey(row.forId));const snapshot2=add(id,{parentId:row.forId,detail:true,level:parent.level+1,route:[String(row.forId)],expanded:true});show(snapshot2,displayIndex);appendChild(row.forId,snapshot2.id);return}if(this.isSentinelDisplayRow(row))return;const snapshot=externalSnapshots[displayIndex]??sourceSnapshotByObject(row);if(!snapshot)return;show(snapshot,displayIndex);const serverRow=serverFlat[displayIndex];if(serverRow?.kind==="leaf"&&serverRow.groupKeys.length>0){const route=serverRow.groupKeys.map(String);const parentId=syntheticId("tree",foldTreePathKey(route));if(byId.has(parentId)){snapshot.parentId=parentId;snapshot.level=route.length;snapshot.route=route;appendChild(parentId,snapshot.id)}}});const graph={rows,byId};this.liveRowSnapshotCache={inputs,graph};return graph}liveRowsForPublication(match){return this.liveMutationDepth>0||this.liveObjectModel===null?[]:this.liveRowSnapshotGraph().rows.filter(match)}async applyLiveMutation(mutation,signal){if(signal.aborted)return this.cancelledLiveMutation();this.liveMutationDepth+=1;try{const result=await this.applyLiveMutationUnchecked(mutation,signal);return signal.aborted?this.cancelledLiveMutation(result.eventType):result}finally{this.liveMutationDepth-=1}}cancelledLiveMutation(eventType="dataChanged"){return{applied:false,eventType}}async completeLiveMutation(eventType,before,signal,commit,readAfter,equal=Object.is){if(signal.aborted)return this.cancelledLiveMutation(eventType);await commit();if(signal.aborted)return this.cancelledLiveMutation(eventType);const after=await readAfter();return signal.aborted?this.cancelledLiveMutation(eventType):{applied:!equal(before,after),eventType,before,after}}liveWritableColumn(field){const candidates=flattenColumnDefs(this.columnDefs??[]).map(candidate=>this.resolveColDef(candidate)).filter(candidate=>candidate!==null&&candidate.field===field);if(candidates.length!==1)return null;const column=candidates[0];return column.editable===true&&typeof column.valueGetter!=="function"&&typeof column.valueGetter!=="string"&&typeof column.formula!=="string"?column:null}liveRowWriteAllowed(snapshot,previous,next,requestedField){const rowIndex=snapshot.displayIndex??snapshot.sourceIndex??0;if(requestedField!==void 0){const column=this.liveWritableColumn(requestedField);return column!==null&&this.passesEditPolicy(rowIndex,column,previous)}const keys=new Set([...Object.keys(previous),...Object.keys(next)]);for(const key of keys){if(Object.is(previous[key],next[key]))continue;if(key.includes("."))return false;const column=this.liveWritableColumn(key);if(column===null||!this.passesEditPolicy(rowIndex,column,previous))return false}return true}async applyLiveMutationUnchecked(mutation,signal){if(mutation.kind==="column"){const liveColumn=this.liveColumnSnapshotGraph().columns.find(column=>column.id===mutation.id);const field2=liveColumn?.definition.field??null;if(field2===null)return{applied:false,eventType:"dataChanged"};if(mutation.type==="setWidth"){return this.completeLiveMutation("widthChanged",await this.getColumnWidth(field2),signal,()=>this.setColumnWidth(field2,mutation.value),()=>this.getColumnWidth(field2))}if(mutation.type==="setVisible"){const before3=!this.columnHidden.has(field2);return this.completeLiveMutation("visibilityChanged",before3,signal,()=>mutation.value?this.showColumn(field2):this.hideColumn(field2),()=>!this.columnHidden.has(field2))}if(mutation.type==="setPinned"){return this.completeLiveMutation("pinnedChanged",await this.getColumnPinned(field2),signal,()=>this.setColumnPinned(field2,mutation.value),()=>this.getColumnPinned(field2))}if(mutation.type==="setSort"){const before3=this.activeSortModel.map(entry=>({...entry}));const next2=mutation.multi?[...before3.filter(entry=>entry.field!==field2),...mutation.value?[{field:field2,direction:mutation.value}]:[]]:mutation.value?[{field:field2,direction:mutation.value}]:[];return this.completeLiveMutation("sortChanged",before3,signal,()=>this.setSortModel(next2),()=>this.activeSortModel.map(entry=>({...entry})),sortModelsEqual)}const before2=liveColumn?.aggFunc??null;if(before2===mutation.value||this.pivotModeActive()){return{applied:false,eventType:"aggregationChanged",before:before2,after:before2}}const update=nodes=>nodes.map(node=>{if(isColumnGroupDef(node))return{...node,children:update([...node.children])};return this.liveColumnId(node)===mutation.id?{...node,aggFunc:mutation.value??void 0}:node});this.columnDefs=update([...this.columnDefs??[]]);return{applied:true,eventType:"aggregationChanged",before:before2,after:mutation.value}}if(mutation.kind==="columnGroup"){const before2=!this.collapsedGroups.has(mutation.id);return this.completeLiveMutation("expandedChanged",before2,signal,()=>this.setColumnGroupOpened(mutation.id,mutation.value),()=>!this.collapsedGroups.has(mutation.id))}const snapshot=this.liveRowSnapshotGraph().byId.get(mutation.id);if(!snapshot||snapshot.sourceIndex===null&&mutation.type!=="setExpanded"){return{applied:false,eventType:"dataChanged"}}if(mutation.type==="setSelected"){const before2=this.selectionState.selectedRowIds.has(mutation.id);const next2=new Set(this.selectionState.selectedRowIds);if(mutation.value)next2.add(mutation.id);else next2.delete(mutation.id);if(signal.aborted)return this.cancelledLiveMutation("selectionChanged");await this.selectRows([...next2]);if(signal.aborted)return this.cancelledLiveMutation("selectionChanged");const after2=this.selectionState.selectedRowIds.has(mutation.id);return{applied:before2!==after2,eventType:"selectionChanged",before:before2,after:after2,data:snapshot.data??void 0}}if(mutation.type==="setExpanded"){const before2=snapshot.expanded;if(snapshot.group&&(this.treeSurface()!==null||this.serverSideModeActive())&&snapshot.route.length>0){await this.setTreeNodeExpanded(snapshot.route,mutation.value)}else if(snapshot.group&&snapshot.expandKey!==void 0){await this.setRowGroupExpanded(snapshot.expandKey,mutation.value)}else if(snapshot.master){await this.setDetailRowExpanded(mutation.id,mutation.value)}else{return{applied:false,eventType:"expandedChanged",before:before2,after:before2}}if(signal.aborted)return this.cancelledLiveMutation("expandedChanged");const after2=this.liveRowSnapshotGraph().byId.get(mutation.id)?.expanded??before2;return{applied:before2!==after2,eventType:"expandedChanged",before:before2,after:after2,data:snapshot.data??void 0}}if(this.serverSideModeActive()||snapshot.data===null||snapshot.sourceIndex===null){return{applied:false,eventType:"dataChanged"}}if(mutation.type==="setHeight"){const before2=this.liveRowHeights.get(mutation.id)??null;if(mutation.value===null)this.liveRowHeights.delete(mutation.id);else this.liveRowHeights.set(mutation.id,mutation.value);this.rowHeightCache?.reset();this.recomputeVirtualWindow();return{applied:before2!==mutation.value,eventType:"heightChanged",before:before2,after:mutation.value,data:snapshot.data}}if(mutation.type==="focus"||mutation.type==="startEditing"){if(snapshot.displayIndex===null)return{applied:false,eventType:mutation.type==="focus"?"focused":"editingStarted"};const columns=this.effectiveColumns();const colIndex=mutation.field===void 0?0:columns.findIndex(column=>column.field===mutation.field||this.liveColumnId(column)===mutation.field);if(colIndex<0)return{applied:false,eventType:mutation.type==="focus"?"focused":"editingStarted"};if(mutation.type==="startEditing"&&this.liveWritableColumn(columns[colIndex].field)===null){return{applied:false,eventType:"editingStarted",field:columns[colIndex].field,data:snapshot.data}}this.commitActiveCell({rowIndex:snapshot.displayIndex,colIndex});const applied2=mutation.type==="focus"?true:await this.requestCellEdit(snapshot.displayIndex,colIndex,"api",null);return{applied:applied2,eventType:mutation.type==="focus"?"focused":"editingStarted",field:columns[colIndex]?.field,data:snapshot.data}}if(mutation.type!=="setData"&&mutation.type!=="updateData"&&mutation.type!=="setValue"){return{applied:false,eventType:"dataChanged"}}const previous=snapshot.data;const next=mutation.type==="setData"?{...mutation.value}:mutation.type==="updateData"?{...previous,...mutation.value}:setOwnFieldPathImmutable(previous,mutation.field,mutation.value);const field=mutation.type==="setValue"?mutation.field:void 0;const eventType=field===void 0?"dataChanged":"valueChanged";const before=field===void 0?previous:readOwnFieldPath(previous,field);let canUseTransaction=false;if(typeof this.getRowId==="function"){try{canUseTransaction=Object.is(this.getRowId(next),snapshot.id)}catch{canUseTransaction=false}}if(next===previous||!this.liveRowWriteAllowed(snapshot,previous,next,field)||!canUseTransaction){return{applied:false,eventType,before,after:before,field,data:previous}}const result=await this.applyTransaction({update:[next]},"live-row-ref");if(signal.aborted)return this.cancelledLiveMutation(eventType);const applied=result.updated.length===1;const after=applied?result.updated[0].row:previous;return{applied,eventType,before,after:field===void 0?after:readOwnFieldPath(after,field),field,data:after}}setupInternalSubscriptions(){if(this.undoRedoUnsubscribe===null){this.undoRedoUnsubscribe=this.undoRedoStack.subscribe(event=>{if(event.kind==="cleared"){this.historyChanged.emit({kind:"cleared",depth:{undo:0,redo:0}});this.recordAudit({kind:"history",source:"local",action:"cleared",undoDepth:0,redoDepth:0});return}this.historyChanged.emit({kind:event.kind,depth:event.depth,label:event.entry.label});this.recordAudit({kind:"history",source:event.kind==="undone"?"undo":event.kind==="redone"?"redo":"local",action:event.kind,label:event.entry.label,undoDepth:event.depth.undo,redoDepth:event.depth.redo})})}if(this.columnVisibilityChangedUnsubscribe===null){this.columnVisibilityChangedUnsubscribe=this.columnVisibilityController.subscribe("changed",event=>{this.columnHidden=new Set(event.hiddenIds);this.alignedNotify();if(this.columnVisibilityForwardSuppressed)return;this.columnVisibilityChanged.emit({colId:event.colId,hidden:event.hidden,hiddenIds:Array.from(event.hiddenIds)});const column=this.resolvedColumnDefs().find(candidate=>candidate.field===event.colId||this.liveColumnId(candidate)===event.colId);this.publishLiveObjectChange("column",column?this.liveColumnId(column):event.colId,"visibilityChanged",this.columnVisibilityEventSource,{before:event.hidden,after:!event.hidden})})}if(this.columnVisibilityResetUnsubscribe===null){this.columnVisibilityResetUnsubscribe=this.columnVisibilityController.subscribe("reset",event=>{const previouslyHidden=new Set(this.columnHidden);this.columnHidden=new Set(event.hiddenIds);this.alignedNotify();if(this.columnVisibilityForwardSuppressed)return;this.columnVisibilityChanged.emit({colId:"*",hidden:false,hiddenIds:Array.from(event.hiddenIds)});this.publishLiveObjectChanges(this.resolvedColumnDefs().filter(column=>previouslyHidden.has(column.field)&&!event.hiddenIds.has(column.field)).map(column=>["column",this.liveColumnId(column),"visibilityChanged",this.columnVisibilityEventSource,{before:false,after:true}]))})}}proGateRef=null;licenseRevision=0;licenseRenderTick=0;proGate(){if(this.proGateRef===null)this.proGateRef=new GridLicenseFacade(this);return this.proGateRef}engineAwaitingLicense=false;proAllowed(feature,member){return this.proGate().allowed(feature,member)}proWorkAllowed(feature,member){return this.proGate().workAllowed(feature,member)}proNewWorkAllowed(feature,member){return this.proGate().newWorkAllowed(feature,member)}proModuleAvailable(feature,member,chunkId){return this.proGate().moduleAvailable(feature,member,chunkId,gridProChunkInBuild(chunkId))}proUiChunks=Object.freeze({});proUiChunksArming=new Set;proUiChunkTick=0;proUiChunk(chunkId,feature,member){if(!this.proModuleAvailable(feature,member,chunkId))return null;return this.proUiChunks[chunkId]??null}armProUiChunk(chunkId,feature,member){if(!this.proModuleAvailable(feature,member,chunkId))return;if(this.proUiChunks[chunkId]!==void 0||this.proUiChunksArming.has(chunkId))return;if(this.proGate().frozen(feature))return;this.proUiChunksArming.add(chunkId);void this.getChunkLoader().load(chunkId).then(module=>{this.proUiChunksArming.delete(chunkId);this.acceptProUiChunk(chunkId,module)},()=>{this.proUiChunksArming.delete(chunkId)})}armProUiChunks(){if(!this.usingColumnDefsApi())return;if(this.conditionBuilder&&this.proAllowed("grid.advanced-filter","conditionBuilder")){this.armProUiChunk("pro-filters","grid.advanced-filter","conditionBuilder")}if(this.activeConditionTree&&this.proAllowed("grid.advanced-filter","setConditionFilter")){this.armProUiChunk("pro-filters","grid.advanced-filter","setConditionFilter")}const filterKind=this.declaredProFilterKind();if(filterKind!==null){this.armProUiChunk("pro-filters",filterKind==="set"?"grid.set-filter":"grid.multi-filter","columnDefs")}if(this.contextMenu===true&&this.proAllowed("grid.context-menu","contextMenu")){this.armProUiChunk("pro-panels","grid.context-menu","contextMenu")}if(this.columnMenu===true&&this.proAllowed("grid.column-menu","columnMenu")){this.armProUiChunk("pro-panels","grid.column-menu","columnMenu")}if(this.find===true&&this.proAllowed("grid.find","find")){this.armProUiChunk("pro-panels","grid.find","find")}if(this.sideBarSpec()!==null)this.armProUiChunk("pro-panels","grid.tool-panels","sideBar");if(this.cellNotes&&this.proAllowed("grid.cell-notes","cellNotes"))this.armProUiChunk("pro-panels","grid.cell-notes","cellNotes");if(this.batchEditToolbar&&this.proAllowed("grid.batch-editing","batchEditToolbar"))this.armProUiChunk("pro-panels","grid.batch-editing","batchEditToolbar");if(this.statusBarSpec()!==null)this.armProUiChunk("pro-panels","grid.status-bar","statusBar");if(this.rangeSelection===true&&this.proAllowed("grid.range-selection","rangeSelection")){this.armProUiChunk("range-selection","grid.range-selection","rangeSelection")}}declaredProFilterKind(){for(const col of this.effectiveColumns()){const kind=this.filterUiKind(col.filter);if(kind==="set"||kind==="multi")return kind}for(const filter of Object.values(this.activeFilters)){if(filter.kind==="set"&&this.filterKindAllowed("set",true))return"set";if(filter.kind==="multi"&&this.filterKindAllowed("multi",filter.spec.parts.some(part=>part.kind==="set")))return"multi"}return null}async loadProUiChunk(chunkId){const resident=this.proUiChunks[chunkId];if(resident!==void 0)return resident;const module=await this.getChunkLoader().load(chunkId);this.acceptProUiChunk(chunkId,module);return module}loadProFiltersChunk(){return this.loadProUiChunk("pro-filters")}loadProPanelsChunk(){return this.loadProUiChunk("pro-panels")}loadRangeSelectionChunk(){return this.loadProUiChunk("range-selection")}acceptProUiChunk(chunkId,module){if(this.proUiChunks[chunkId]!==void 0||module===void 0)return;this.proUiChunks=Object.freeze({...this.proUiChunks,[chunkId]:module});if(chunkId==="range-selection")this.clampRangesAfterChange();if(!this.hasDisconnected){if(chunkId==="ssrm-ops"&&this.serverSideState===null&&this.serverSideModeActive()){this.initServerSide();this.recomputeVirtualWindow()}if(chunkId==="viewport-row-model"&&this.viewportState===null&&this.viewportModeActive()){this.initViewport();this.recomputeVirtualWindow()}}this.proUiChunkTick+=1}armProEngineChunks(){if(!this.usingColumnDefsApi())return;if(this.groupByDeclared()&&this.proAllowed("grid.row-grouping","groupBy"))this.armGroupPivotChunkForGrouping();if(this.groupPanel===true&&this.groupPanelActive())this.armGroupPivotChunkForGrouping();if(this.pivotMode===true&&this.pivotAxesDeclared()&&this.proAllowed("grid.pivot","pivotMode"))this.ensureGroupPivotChunkArmed();const treeMember=this.treeDeclaredMember();if(treeMember!==null&&this.proAllowed("grid.tree-data",treeMember))this.armProUiChunk("tree-data","grid.tree-data",treeMember);if(this.masterDetail===true&&this.proAllowed("grid.master-detail","masterDetail")){this.armProUiChunk("master-detail","grid.master-detail","masterDetail")}if(this.serverSideDatasource!=null&&this.proAllowed("grid.server-side-row-model","serverSideDatasource")){this.armProUiChunk("ssrm-ops","grid.server-side-row-model","serverSideDatasource")}if(this.viewportDatasource!=null&&this.proAllowed("grid.viewport-row-model","viewportDatasource")){this.armProUiChunk("viewport-row-model","grid.viewport-row-model","viewportDatasource")}}groupByDeclared(){if(!this.usingColumnDefsApi())return false;const raw=this.groupBy;return(Array.isArray(raw)?raw:[raw]).some(f=>typeof f==="string"&&f.trim()!=="")}treeDeclaredMember(){if(typeof this.getDataPath==="function")return"getDataPath";const idField=this.treeIdField;const parentField=this.treeParentField;return typeof idField==="string"&&idField!==""&&typeof parentField==="string"&&parentField!==""?"treeIdField":null}armGroupPivotChunkForGrouping(){if(this.groupPivotChunkModule!==null||this.groupPivotChunkArming)return;if(this.proGate().frozen("grid.row-grouping"))return;this.ensureGroupPivotChunkArmed()}async residentGroupPivotChunk(){const chunk=await this.loadGroupPivotChunk();if(this.groupPivotChunkModule===null){this.groupPivotChunkModule=chunk;this.groupPivotChunkTick+=1}return chunk}engineArriving(feature,member,chunkId,resident){if(resident||!gridProChunkInBuild(chunkId))return false;return gridEngineArriving({allowed:this.proAllowed(feature,member),inBuild:true,frozen:this.proGate().frozen(feature)})}treeEngineArriving(){if(!this.usingColumnDefsApi())return false;const member=this.treeDeclaredMember();return member!==null&&this.engineArriving("grid.tree-data",member,"tree-data",this.proUiChunks["tree-data"]!==void 0)}viewportEngineArriving(){return this.viewportDatasource!=null&&this.usingColumnDefsApi()&&this.viewportState===null&&this.engineArriving("grid.viewport-row-model","viewportDatasource","viewport-row-model",this.proUiChunks["viewport-row-model"]!==void 0)}pivotWinsOnArrival(){if(this.pivotMode!==true||!this.pivotAxesDeclared())return false;if(!this.engineArriving("grid.pivot","pivotMode","group-pivot",this.groupPivotChunkModule!==null))return false;return gridPivotWinsOnArrival({pivotArriving:true,treeActive:this.treeSurface()!==null,treeArriving:this.treeEngineArriving(),serverActive:this.serverSideModeActive(),windowedActive:this.viewportState!==null||this.infiniteCache!==null,viewportArriving:this.viewportEngineArriving()})}async groupEngineStep(){if(this.groupPivotChunkModule===null&&this.groupByDeclared())await this.residentGroupPivotChunk()}async treeEngineStep(){if(this.proUiChunks["tree-data"]===void 0&&this.treeDeclaredMember()!==null)await this.loadProUiChunk("tree-data")}async masterDetailEngineStep(){if(this.proUiChunks["master-detail"]===void 0&&this.masterDetail===true&&this.usingColumnDefsApi()){await this.loadProUiChunk("master-detail")}}residentEngine(chunk,chunkId){if(chunk===null||chunk===void 0)throw new Error(`[SG:G8] the '${chunkId}' Pro engine is not resident`);return chunk}groupPivotEngine(){return this.residentEngine(this.groupPivotChunkModule,"group-pivot")}treeDataEngine(){return this.residentEngine(this.proUiChunks["tree-data"],"tree-data")}masterDetailEngine(){return this.residentEngine(this.proUiChunks["master-detail"],"master-detail")}ssrmEngine(){return this.residentEngine(this.proUiChunks["ssrm-ops"],"ssrm-ops")}viewportEngine(){return this.residentEngine(this.proUiChunks["viewport-row-model"],"viewport-row-model")}proFiltersHost(){return this}proPanelsHost(){return this}columnMenuHost(){return this}findHost(){return this}notesHost(){return this}batchUiHost(){return this}renderNotesToolbar(){if(!this.cellNotes||!this.proAllowed("grid.cell-notes","cellNotes"))return null;return this.proUiChunk("pro-panels","grid.cell-notes","cellNotes")?.renderNotesToolbar(this.notesHost())??null}renderBatchToolbar(){if(!this.batchEditToolbar||!this.proAllowed("grid.batch-editing","batchEditToolbar"))return null;return this.proUiChunk("pro-panels","grid.batch-editing","batchEditToolbar")?.renderBatchToolbar(this.batchUiHost())??null}renderFindToolbar(){if(!this.find||!this.proAllowed("grid.find","find"))return null;return this.proUiChunk("pro-panels","grid.find","find")?.renderFindToolbar(this.findHost())??null}renderColumnMenuButton(col){if(!this.columnMenu||!this.proAllowed("grid.column-menu","columnMenu"))return null;return this.proUiChunk("pro-panels","grid.column-menu","columnMenu")?.renderColumnMenuButton(this.columnMenuHost(),col)??null}rangeSelectionHost(){return this}auditProDeclarations(){const declared=gridDeclaredProProps(prop=>this[prop]);for(const[feature,member]of declared){if(!this.proAllowed(feature,member))continue;const chunkId=GRID_DECLARATION_CHUNKS[feature];if(chunkId!==void 0)this.proModuleAvailable(feature,member,chunkId);if(member==="engine"){this.proGate().moduleAvailable(feature,member,"sy-grid-pro",gridProUnavailableReason()!==GRID_PRO_ENGINE_NOT_IN_BUILD)}}}proMethod(method,steps){return this.proGate().method(method,chunk=>this.proRuntimeResident(chunk),steps)}proRun(method,body){return this.proMethod(method,{exec:()=>void 0,publish:body})}proRuntimeResident(chunk){if(chunk==="chart-link")return this.chartLinkRuntimeRef!==null;const loader=this.chunkLoader;return loader!==null&&!loader.stats().disposed&&loader.isLoaded(chunk)}licenseHostAttributes(){return this.proGateRef?.attributes()??{}}licenseSafePoint(){return this.editStore.active===null&&this.editingCell===null&&this.rowEditState.session===null}initialStateLicenseFeatures=null;formulaFreeze=new GridFormulaFreeze;pivotRecomputeHeld=false;viewportFeedHeld=false;heldLicenseInits=new GridHeldInits;collabFreeze=new GridCollabFreeze;retireLostFormulaAcceleration(){const gate=this.proGateRef;if(gate===null||this.formulaDualEngine===null||this.formulas!==true)return;if(!gate.lost("grid.wasm-acceleration")||gate.frozen("grid.formulas"))return;this.rebuildFormulaSheet()}accelerationPortRef=null;accelerationPort(){this.accelerationPortRef??=createGridAccelerationPort(()=>this.proGateRef?.live("grid.wasm-acceleration")===true);return this.accelerationPortRef.port}notifyAccelerationPort(){this.accelerationPortRef?.notify()}onBrandLogoChange(){this.proGateRef?.brandChanged()}renderBrand(){const value=this.brandLogo;const view=value===void 0||value===null||value===""?GRID_DEFAULT_BRAND_VIEW:this.proGate().brandView(value);if(view?.attrs["data-sy-brand"]!=="default")brandMarkDefault.releaseBrandIntegrity(this.host);if(view===null)return null;const image=view.image;return index.h("div",{class:"sy-grid__brand-strip","aria-hidden":"true",ref:node=>{if(view.attrs["data-sy-brand"]==="default")brandMarkDefault.protectDefaultBrand(this.host,node,{display:"flex","min-height":"36px","align-items":"center","justify-content":"flex-end",padding:"2px 8px",flex:"0 0 auto","box-sizing":"border-box","pointer-events":"none"})}},index.h("span",{key:`brand-${view.attrs["data-sy-brand"]}`,...view.attrs,class:`${view.attrs.class} sy-grid__brand`},image!==null?index.h("img",{...image,onError:()=>this.proGateRef?.brandImageFailed(image.src)}):view.attrs.hidden!==void 0?null:index.h("svg",{viewBox:`0 0 ${brandMarkDefault.BRAND_LOCKUP_WIDTH} ${brandMarkDefault.BRAND_LOCKUP_HEIGHT}`,width:String(brandMarkDefault.BRAND_LOCKUP_WIDTH),height:String(brandMarkDefault.BRAND_LOCKUP_HEIGHT),fill:"currentColor","aria-hidden":"true",focusable:"false"},index.h("path",{"data-sy-brand-symbol":"",d:brandMarkDefault.BRAND_LOCKUP_SYMBOL_PATH}),index.h("path",{"data-sy-brand-wordmark":"",d:brandMarkDefault.BRAND_LOCKUP_WORDMARK_PATH}))))}componentWillLoad(){this.proGate();this.validateColumnDefs();if((this.pinnedTopRowData?.length??0)>0||(this.pinnedBottomRowData?.length??0)>0){this.pendingPinnedRows={input:this.pinnedRowsFromProps(),source:"prop"}}this.syncRowLayout();this.syncRowDrag();if(this.alignedDeclared())this.syncAlignedGrids();this.seedInitialSortFromColumnDefs();this.seedInitialPagination();this.seedInitialQuickFilter();this.reEvaluateEngine();this.rebuildFormulaSheet();this.syncWorkbookBinding("initial");this.syncAuditTrail();if(this.datasource!=null)this.initInfiniteCache();if(this.serverSideDatasource!=null)this.initServerSide();if(this.viewportDatasource!=null)this.initViewport();this.loadingDebouncer=createLoadingDebouncer(this.minLoadingDuration);this.updateLoadingState();applyTheme(this.host,this.theme);this.resolvedMessages=resolveLocale(this.locale);this.selectionState=createSelectionState(this.rowSelection);this.openToolPanelId=this.sideBarSpec()?.defaultOpen??null;this.applyInitialGridState();this.setupInternalSubscriptions();this.columnVisibilityForwardSuppressed=true;try{const initialDefs=this.resolvedColumnDefs();for(let i=0;i<initialDefs.length;i++){const col=initialDefs[i];const flag=col.hidden===true||col.hidden===void 0&&col.hide===true;if(flag)this.columnVisibilityController.hide(col.field)}}finally{this.columnVisibilityForwardSuppressed=false}}onThemeChanged(){applyTheme(this.host,this.theme);this.themeChanged.emit({theme:this.theme,resolvedTokens:{...resolveTheme(this.theme)}})}onLocaleChanged(){this.resolvedMessages=resolveLocale(this.locale);this.localeChanged.emit({locale:this.locale,resolvedMessages:{...this.resolvedMessages}})}onRowSelectionModeChanged(){const previous=this.selectionState;const next=setSelectionMode(previous,this.rowSelection);this.rangeAnchorRowId=null;if(next===previous)return;this.selectionState=next;const diff=diffSelection(previous,next);if(diff.addedIds.length===0&&diff.removedIds.length===0)return;this.fireSelectionChanged({mode:next.mode,selectedRowIds:Array.from(next.selectedRowIds),addedIds:diff.addedIds,removedIds:diff.removedIds},"state")}seedInitialQuickFilter(){const raw=this.quickFilterText;this.quickFilterValue=typeof raw==="string"?raw:"";this.quickFilterPendingValue=this.quickFilterValue}seedInitialPagination(){const requested=this.pageSize;if(typeof requested!=="number"||!Number.isFinite(requested)||!Number.isInteger(requested)||requested<1){console.warn(`[SG:PAGE] bad=${requested}; use=${DEFAULT_PAGE_SIZE}`);this.activePagination={pageIndex:0,pageSize:DEFAULT_PAGE_SIZE};return}this.activePagination={pageIndex:0,pageSize:requested}}onPageSizeChange(newValue){if(typeof newValue!=="number"||!Number.isFinite(newValue)||!Number.isInteger(newValue)||newValue<1){console.warn(`[SG:PAGE] bad=${newValue}; ignore`);return}if(newValue===this.activePagination.pageSize)return;this.activePagination=changePageSize(this.activePagination,newValue,this.latestPaginatedMeta);if(this.host?.isConnected){this.resetVirtualScrollPosition();this.recomputeVirtualWindow()}}onColumnDefsChanged(){this.invalidateComponentFilterRuntime();this.liveObjectModel?.reconcile("definitions-replaced");this.syncRowLayout();this.syncRowDrag();if(this.rowLayoutState!==null&&this.rowLayoutChunk!==null){this.rowLayoutChunk.invalidateRowLayout(this.rowLayoutState,"columns")}if(!this.host?.isConnected)return;this.clampActiveCellAfterChange();this.clampRangesAfterChange()}onExternalFilterInputsChanged(){this.externalFilterRevision+=1;this.externalFilterReadyRevision=-1;this.invalidateComponentFilterRuntime();if(this.host?.isConnected)void this.reconcileComponentFilters()}onLifecycleComponentDefinitionsChanged(){this.invalidateComponentFilterRuntime();if(this.host?.isConnected)void this.reconcileComponentFilters()}hasStableLiveRowIds(value){if(!Array.isArray(value)||value.length===0)return true;if(typeof this.getRowId!=="function")return false;const ids=new Set;for(const row of value){try{const id=this.getRowId(row);if(!(typeof id==="string"&&id.length>0||typeof id==="number"&&Number.isFinite(id))||ids.has(id))return false;ids.add(id)}catch{return false}}return true}onGetRowIdChanged(){this.liveRowHeights.clear();this.componentIdentityIndex=null;this.componentIdentityReportedErrors.clear();if(this.lifecycleRendererPresentations.size>0){this.lifecycleRendererPresentations.clear();this.lifecycleRendererPresentationVersion+=1}this.disposeComponentManager();if(this.liveObjectModel===null)return;this.liveObjectModel.invalidateRows("data-replaced");this.liveObjectModel.reconcile()}onKeyboardNavigationChanged(newValue){if(newValue===false){this.invalidateLifecycleEditorRequests();if(this.editorFacade!==null&&this.editorFacade.lookup().status!=="idle"){void this.editorFacade.stop("api",{cancel:true})}if(this.activeCell!==null){this.commitActiveCell(null,{scrollIntoView:false})}if(this.editingCell!==null){this.editingCell=null;this.unregisterLifecycleEditorDocumentOwner()}if(this.editStore.active!==null){const cancelled=cancelEdit(this.editStore);this.editStore=clearEdit(cancelled)}if(this.textEditorState!==null)this.textEditorState=null;if(this.numberEditorState!==null)this.numberEditorState=null;if(this.dateEditorState!==null)this.dateEditorState=null;if(this.calendarState!==null)this.calendarState=null;if(this.calendarFocusedIso!==null)this.calendarFocusedIso=null;if(this.calendarAnchor!==null)this.calendarAnchor=null;if(this.autocompleteAnchor!==null)this.autocompleteAnchor=null;if(this.largeTextConfig!==null)this.largeTextConfig=null;if(this.largeTextAnchor!==null)this.largeTextAnchor=null;if(this.largeTextAnchorEl!==null)this.largeTextAnchorEl=null;if(this.selectEditorState!==null)this.selectEditorState=null;if(this.checkboxEditorState!==null)this.checkboxEditorState=null;if(this.textareaEditorState!==null)this.textareaEditorState=null;if(this.autocompleteEditorState!==null)this.autocompleteEditorState=null;this.textEditorEl=null;this.selectTriggerEl=null;this.autocompleteInputEl=null;this.checkboxEditorEl=null;this.textareaEditorEl=null}}reEvaluateEngine(_newValue,oldValue,propName){if(propName==="rowData"&&this.rowLayoutState!==null&&this.rowLayoutChunk!==null){this.rowLayoutChunk.invalidateRowLayout(this.rowLayoutState,"data")}const incrementalCellEdit=propName==="rowData"&&Array.isArray(_newValue)&&_newValue===this.incrementalRowDataAssignment;if(propName==="rowData"&&!incrementalCellEdit){this.sourceRowIndexCache=null}if((propName==="rowData"||propName==="rows")&&this.filterFacade!==null){const facade=this.filterFacade;void facade.onNewRowsLoaded().then(()=>{if(facade!==this.filterFacade||!this.host?.isConnected)return;this.lifecycleFilterVersion+=1})}if(incrementalCellEdit)return;const rowCount=this.rowData?.length??this.rows?.length??0;const plan=planGridEngine({requested:this.engine,rowCount,proThreshold:this.proThreshold,onUnavailable:this.unavailable,buildReason:gridProUnavailableReason()});if(plan.kind==="throw")throw this.proGate().refusalError("grid.wasm-acceleration","engine");if(plan.awaitingLicense)this.engineAwaitingLicense=true;const decision=plan.decision;this.activeTier=decision.tier;this.fallbackReason=decision.fallbackReason;if(this.host?.isConnected){if(propName==="rowData"||propName==="rows"){if(typeof this.getRowId!=="function"){this.liveRowHeights.clear()}else if(Array.isArray(_newValue)&&this.liveRowHeights.size>0){const retainedIds=new Set;for(const row of _newValue){if(row===null||typeof row!=="object")continue;try{const id=this.getRowId(row);if(typeof id==="string"&&id.length>0||typeof id==="number"&&Number.isFinite(id))retainedIds.add(id)}catch{}}for(const id of this.liveRowHeights.keys()){if(!retainedIds.has(id))this.liveRowHeights.delete(id)}}if(this.liveObjectModel!==null&&(!this.hasStableLiveRowIds(oldValue)||!this.hasStableLiveRowIds(_newValue))){this.liveObjectModel.invalidateRows("data-replaced");this.liveObjectModel.reconcile()}else{this.liveObjectModel?.reconcile("data-replaced")}this.resetVirtualScrollPosition();this.detailRowDataCache?.clear();this.detailRowLoading?.clear()}this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()}}rebuildFormulaSheet(newValue,_oldValue,propName){if(propName==="rowData"&&Array.isArray(newValue)&&newValue===this.incrementalRowDataAssignment){return}if(this.formulas!==true||!this.proAllowed("grid.formulas","formulas")){this.unregisterFormulaWasmEventTarget();this.formulaSheet=null;this.formulaUpgradeToken++;this.formulaSeedToken++;this.formulaSheetSeeding=false;this.disposeFormulaDualEngine();this.formulaFreeze.reset();return}if(this.proGate().frozen("grid.formulas")){this.formulaFreeze.holdRebuild();this.formulaVersion++;return}this.formulaFreeze.reset();const formulaCore=this.formulaCoreArmed();if(formulaCore===null){this.unregisterFormulaWasmEventTarget();this.formulaSheet=null;this.formulaUpgradeToken++;this.formulaSeedToken++;this.formulaSheetSeeding=false;this.disposeFormulaDualEngine();return}const{GridFormulaSheet}=formulaCore;this.ensureFormulaAccelerationProvider();if(this.formulaSheet===null||this.formulaDualEngine!==null){this.disposeFormulaDualEngine();this.formulaSheet=new GridFormulaSheet}const leafCols=flattenColumnDefs(this.columnDefs??[]);const rowCount=Array.isArray(this.rowData)?this.rowData.length:0;this.formulaUpgradeToken++;const seedToken=++this.formulaSeedToken;if(rowCount>=FORMULA_ASYNC_SEED_ROWS){const sheet=this.formulaSheet;this.formulaSheetSeeding=true;let lastRevealAt=0;void sheet.rebuildAsync(leafCols,this.rowData,{shouldAbort:()=>seedToken!==this.formulaSeedToken||this.formulaSheet!==sheet||this.formulas!==true||this.formulaWorkHeld(),onProgress:()=>{if(seedToken!==this.formulaSeedToken||this.formulaSheet!==sheet)return;const now=performance.now();if(now-lastRevealAt<FORMULA_SEED_REVEAL_MS)return;lastRevealAt=now;this.formulaVersion++}}).then(completed=>{if(!completed||seedToken!==this.formulaSeedToken||this.formulaSheet!==sheet)return;this.formulaSheetSeeding=false;this.formulaVersion++;this.scheduleFormulaUpgradeKick();this.syncWorkbookOps(true)})}else{this.formulaSheetSeeding=false;this.formulaSheet.rebuild(leafCols,this.rowData);this.syncWorkbookOps(true)}this.formulaVersion++;this.host?.setAttribute("data-formula-engine","js");if(rowCount<FORMULA_ASYNC_SEED_ROWS)this.scheduleFormulaUpgradeKick()}formulaSeedToken=0;formulaSheetSeeding=false;scheduleFormulaUpgradeKick(){if(this.formulas===true&&!this.proAllowed("grid.formulas","formulas"))return;const scheduledSeedToken=this.formulaSeedToken;let kicked=false;const kick=()=>{if(kicked)return;kicked=true;if(scheduledSeedToken!==this.formulaSeedToken)return;void this.upgradeFormulaSheet(++this.formulaUpgradeToken)};if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>requestAnimationFrame(()=>kick()));setTimeout(kick,250)}else{setTimeout(kick,0)}}onWorkbookBindingInputsChanged(){if(this.hasDisconnected||this.host?.isConnected===false)return;this.syncWorkbookBinding("property-change")}async getWorkbookBinding(){return this.proRun("getWorkbookBinding",()=>this.workbookBindingController.current())}async reconnectWorkbook(){const reconnect=enabled=>this.workbookBindingController.reconnect({enabled,workbookId:this.workbookId,sheetName:this.sheetName,reason:"method",throwOnError:true});if(this.formulas!==true)return reconnect(false);return this.proMethod("reconnectWorkbook",{load:()=>this.loadFormulaCore(),exec:()=>null,publish:()=>reconnect(this.proAllowed("grid.formulas","formulas"))})}async loadFormulaCore(){if(this.formulaCore!==null)return this.formulaCore;const core=await this.getChunkLoader().load("formula-core");this.formulaCore=core;return core}async disconnectWorkbook(){return this.proRun("disconnectWorkbook",()=>this.workbookBindingController.disconnect("method"))}syncWorkbookBinding(reason){return this.workbookBindingController.sync({enabled:this.formulas===true&&this.proAllowed("grid.formulas","formulas"),workbookId:this.workbookId,sheetName:this.sheetName,reason})}syncWorkbookBindingHostState(binding){const values=[["data-workbook-id",binding?.workbookId],["data-workbook-key",binding?.workbookKey],["data-sheet-name",binding?.sheetName],["data-sheet-id",binding?.sheetId],["data-workbook-registration-id",binding?.registrationId]];for(const[name,value]of values){if(value===void 0)this.host?.removeAttribute?.(name);else this.host?.setAttribute?.(name,String(value))}}formulaUpgradeToken=0;formulaDualEngine=null;formulaAccelerationLoad=null;formulaAccelerationReadyGeneration=0;formulaWasmEventTargetBridge=null;formulaWasmAllowed(){const allowed=this.proAllowed("grid.wasm-acceleration","formulas")&&this.proWorkAllowed("grid.wasm-acceleration","formulas");if(!allowed&&this.proGate().displayState("grid.wasm-acceleration")==="pending")this.formulaWasmAwaitingLicense=true;return allowed}formulaWasmAwaitingLicense=false;registerFormulaWasmEventTarget(){{return}}unregisterFormulaWasmEventTarget(){const bridge=this.formulaWasmEventTargetBridge;this.formulaWasmEventTargetBridge=null;if(bridge===null)return;try{bridge.unregister(this.host)}catch{}}ensureFormulaAccelerationProvider(){return}disposeFormulaDualEngine(){const engine=this.formulaDualEngine;this.formulaDualEngine=null;if(engine===null)return;try{engine.dispose()}catch{}}async upgradeFormulaSheet(token){return}onFormulaEngineReady=()=>{this.formulaAccelerationReadyGeneration+=1;if(this.formulas===true){this.registerFormulaWasmEventTarget();this.rebuildFormulaSheet()}};validateColumnDefs(){if(!this.columnDefs)return;flattenColumnDefs(this.columnDefs).forEach((col,i)=>{if(!col||typeof col.field!=="string"||!col.field){console.warn(`[SG:COLDEF] index=${i}; no field; skip`,col)}})}multiSortActive(){return this.multiSort===true||this.enableMultiSort===true}seedInitialSortFromColumnDefs(){this.activeSortModel=seedInitialSortModel(this.resolvedColumnDefs(),{multi:this.multiSortActive()})}applySortModel(next,source="ui"){const previousModel=[...this.activeSortModel];const previous=this.activeSort;this.activeSortModel=next;const primary=next.length>0?next[0]:null;this.sortChanged.emit({field:primary?primary.field:null,direction:primary?primary.direction:null,previous,sortModel:[...next],previousModel});const beforeByField=new Map(previousModel.map((entry,index2)=>[entry.field,{direction:entry.direction,index:index2}]));const afterByField=new Map(next.map((entry,index2)=>[entry.field,{direction:entry.direction,index:index2}]));const changedFields=new Set([...beforeByField.keys(),...afterByField.keys()]);this.publishLiveObjectChanges([...changedFields].flatMap(field=>{const before=beforeByField.get(field)??null;const after=afterByField.get(field)??null;if(structuralEqual(before,after))return[];const column=this.resolvedColumnDefs().find(candidate=>candidate.field===field);return[["column",column?this.liveColumnId(column):field,"sortChanged",source,{before,after}]]}))}onMultiSortFlagChange(){if(!this.multiSortActive()&&this.activeSortModel.length>1){this.applySortModel([this.activeSortModel[0]],"state")}}async sortBy(column,direction){if(this.usingColumnDefsApi()){const col=this.resolvedColumnDefs().find(candidate=>candidate.field===column)??this.pivotSourceSortColumn(column);if(!col||col.sortable===false)return;const next=direction===void 0?cycleSortModel(this.activeSortModel,column,"replace"):direction===null?this.activeSortModel.filter(entry=>entry.field!==column):[{field:column,direction}];this.applySortModel(next,"api");return}const inner=this.innerEngine();await inner?.sortBy?.(column,direction)}async setSortModel(model){if(!this.usingColumnDefsApi())return;const sortableFields=new Set(this.resolvedColumnDefs().filter(col=>col.sortable!==false&&typeof col.field==="string"&&col.field!=="").map(col=>col.field));for(const col of this.declaredColumnDefs()){if(this.pivotSourceSortColumn(col.field)!==null&&col.sortable!==false&&typeof col.field==="string"&&col.field!==""){sortableFields.add(col.field)}}const next=normalizeSortModel(model).filter(entry=>sortableFields.has(entry.field));if(sortModelsEqual(next,this.activeSortModel))return;this.applySortModel(next,"api")}async getSortModel(){return this.activeSortModel.map(entry=>({...entry}))}async setQuery(query){const inner=this.innerEngine();await inner?.setQuery?.(query)}async getActiveTier(){return this.proRun("getActiveTier",()=>this.activeTier)}innerEngine(){return this.host.querySelector(this.activeTag())}activeTag(){return gridEngineTag()}handleQueryComplete=event=>{const detail=event.detail;this.queryComplete.emit({...detail,tier:this.activeTier})};usingColumnDefsApi(){return!!(this.columnDefs&&this.columnDefs.length>0)}resolveColDef(col){if(!col)return null;const hasField=typeof col.field==="string"&&col.field!=="";const hasColId=typeof col.colId==="string"&&col.colId!=="";if(!hasField&&!hasColId)return null;return{...this.defaultColDef??{},...col}}columnDefsSource(){if(this.serverSidePivotModeActive()){const secondary=this.serverSidePivotColumnDefs();if(secondary.length>0)return secondary}if(this.pivotModeActive()&&!this.pivotComputing){const pivot=this.pivotComputation();if(pivot!==null){const{generatePivotColumnDefs}=this.groupPivotEngine();return generatePivotColumnDefs(pivot.meta)}}return this.columnDefs}pivotComputing=false;resolvedColumnDefs(){if(!this.usingColumnDefsApi())return[];return visibleGroupLeaves(this.columnDefsSource(),this.collapsedGroups).map(c=>this.resolveColDef(c)).filter(c=>c!==null)}onPivotConfigChange(){if(this.pivotCollapsedRowGroups.size>0)this.pivotCollapsedRowGroups=new Set;if(this.serverSideModeActive()){this.initServerSide();this.scrollTop=0;if(this.viewportEl!==null)this.viewportEl.scrollTop=0;this.recomputeVirtualWindow()}}pivotModeActive(){const requested=this.pivotMode===true&&this.pivotAxesDeclared();if(!requested)return false;if(!this.proAllowed("grid.pivot","pivotMode"))return false;if(this.cachedPivot===null&&this.proGate().frozen("grid.pivot")){this.pivotRecomputeHeld=true;return false}if(this.groupPivotChunkModule===null)return false;if(this.treeSurface()!==null||this.treeEngineArriving()){this.notePivotConflict("treeData","yields","other",PIVOT_WARNING_TREE_DATA,false);return false}if(this.serverSideModeActive())return false;if(this.viewportState!==null||this.infiniteCache!==null){this.notePivotConflict(this.viewportState!==null?"viewport":"infinite","yields","other",PIVOT_WARNING_VIEWPORT_INFINITE,false);return false}if(this.viewportEngineArriving()){this.notePivotConflict("viewport","yields","other",PIVOT_WARNING_VIEWPORT_INFINITE,false);return false}if(!this.warnedPivotConflicts.has("rowGrouping")&&this.effectiveGroupFields()!==null){this.notePivotConflict("rowGrouping","superseded","pivot",PIVOT_WARNING_GROUP_BY,true)}if(this.masterDetail===true&&this.usingColumnDefsApi()&&this.proAllowed("grid.master-detail","masterDetail")){this.notePivotConflict("masterDetail","yields","pivot",PIVOT_WARNING_MASTER_DETAIL,true)}return true}pivotAxesDeclared(){return this.usingColumnDefsApi()&&Array.isArray(this.pivotRowGroupColumns)&&this.pivotRowGroupColumns.length>0&&Array.isArray(this.pivotColumns)&&this.pivotColumns.length>0&&Array.isArray(this.pivotValueColumns)&&this.pivotValueColumns.length>0}warnedPivotConflicts=new Set;pendingPivotConflicts=[];notePivotConflict(feature,support,winner,warning,pivotActive){if(this.warnedPivotConflicts.has(feature))return;this.warnedPivotConflicts.add(feature);console.warn(warning);this.pendingPivotConflicts.push({feature,support,winner,warning,pivotActive})}resolvePivotAggFuncs(){const{resolveAggFunc}=this.groupPivotEngine();const out={};for(const vc of this.pivotValueColumns??[]){const name=this.pivotAggFuncs?.[vc];const resolved=typeof name==="string"&&name!==""?resolveAggFunc(name,this.customAggFuncs):null;out[vc]=resolved??"sum"}return out}pivotComputation(){if(!this.pivotModeActive()){this.cachedPivot=null;return null}const sig=[this.rowData,this.pivotRowGroupColumns,this.pivotColumns,this.pivotValueColumns,this.pivotAggFuncs,this.customAggFuncs,this.pivotCollapsedRowGroups,this.activeFilters,this.activeConditionTree,this.quickFilter,this.quickFilterValue,this.quickFilterMode,this.quickFilterRegex,this.activeSortModel,this.licenseRevision,this.proUiChunks,this.columnDefs,this.defaultColDef];const cached=this.cachedPivot;if(cached!==null&&cached.sig.length===sig.length&&cached.sig.every((v,i)=>v===sig[i])){return cached.value}if(cached!==null&&this.proGate().frozen("grid.pivot")){this.pivotRecomputeHeld=true;return cached.value}const spec={rowGroupColumns:this.pivotRowGroupColumns,pivotColumns:this.pivotColumns,valueColumns:this.pivotValueColumns,aggFuncs:this.resolvePivotAggFuncs(),collapsedRowGroupKeys:this.pivotCollapsedRowGroups};this.pivotComputing=true;try{const source=this.rowData??[];const prepStages=this.buildFilterStages();const sortStage=this.buildSortStage(this.pivotSourceSortModel());if(sortStage!==null)prepStages.push(sortStage);const prepared=prepStages.length===0?source:runPipeline(source,prepStages).rows;const{computePivot}=this.groupPivotEngine();const value=computePivot(prepared,spec);this.cachedPivot={sig,value};return value}finally{this.pivotComputing=false}}aggregationSpecs(){const{resolveAggFunc}=this.groupPivotEngine();const out=[];for(const col of this.declaredColumnDefs()){if(typeof col.field!=="string"||col.field==="")continue;const name=col.aggFunc;if(typeof name!=="string"||name==="")continue;const agg=resolveAggFunc(name,this.customAggFuncs);if(agg===null){if(!this.warnedAggFuncs.has(name)){this.warnedAggFuncs.add(name);console.warn(`[SG:AGG] bad name=${name} field=${col.field}; skip`)}continue}out.push({field:col.field,agg})}return out}async registerAggFunc(name,fn){return this.proRun("registerAggFunc",()=>{if(typeof name!=="string"||name.trim()===""||typeof fn!=="function"){console.warn("[SG:AGG] bad name/fn");return}const next=new Map(this.customAggFuncs);next.set(name,fn);this.warnedAggFuncs.delete(name);this.customAggFuncs=next})}async unregisterAggFunc(name){return this.proRun("unregisterAggFunc",()=>{if(!this.customAggFuncs.has(name))return;const next=new Map(this.customAggFuncs);next.delete(name);this.customAggFuncs=next})}async getRegisteredAggFuncNames(){return this.proRun("getRegisteredAggFuncNames",()=>[...this.customAggFuncs.keys()])}declaredColumnDefs(){if(!this.usingColumnDefsApi())return[];return flattenColumnDefs(this.columnDefs).map(c=>this.resolveColDef(c)).filter(c=>c!==null)}effectiveGroupFields(){const raw=this.groupBy;const list=(Array.isArray(raw)?raw:[raw]).filter(f=>typeof f==="string"&&f.trim()!=="");if(list.length===0)return this.groupDeclaration.resolve(null,this.proGate());if(!this.proAllowed("grid.row-grouping","groupBy")){this.groupDeclaration.clear();return null}if(this.groupPivotChunkModule===null)return null;if(this.treeEngineArriving())return null;const fields=[...new Set(list)];const declared=new Set(this.declaredColumnDefs().map(col=>col.field));return this.groupDeclaration.resolve(fields.every(f=>declared.has(f))?fields:null,this.proGate())}groupDeclaration=new GridHeldDeclaration("grid.row-grouping",(a,b)=>a.length===b.length&&a.every((field,i)=>field===b[i]));effectiveGroupBy(){return this.effectiveGroupFields()?.[0]??null}onGroupByChange(newValue){const switchesOff=(Array.isArray(newValue)?newValue:[newValue]).every(f=>typeof f!=="string"||f.trim()==="");if(switchesOff||this.groupDeclaration.current===null||this.proGate().entitled("grid.row-grouping")){this.collapsedRowGroups=new Set}if(!this.usingColumnDefsApi())return;const declared=new Set(this.declaredColumnDefs().map(col=>col.field));const fields=(Array.isArray(newValue)?newValue:[newValue]).filter(f=>typeof f==="string"&&f.trim()!=="");for(const f of fields){if(!declared.has(f)){console.warn(`[SG:GROUP] bad field=${f}; disable`)}}}currentGroupKeys(){const field=this.effectiveGroupBy();if(field===null)return null;const keys=new Set;const source=this.rowData??[];for(const row of source){const key=foldGroupKey(readOwnFieldPath(row,field));keys.add(key===null?BLANK_GROUP_KEY:key)}return keys}currentMultiGroupKeys(fields){const keys=new Set;const source=this.rowData??[];for(const row of source){const segs=fields.map(f=>foldGroupKey(readOwnFieldPath(row,f))??BLANK_GROUP_KEY);for(let d=0;d<segs.length;d++)keys.add(frameSegmentPath(segs.slice(0,d+1)))}return keys}async setRowGroupExpanded(key,expanded){return this.proMethod("setRowGroupExpanded",{load:()=>this.groupEngineStep(),exec:()=>void 0,publish:()=>this.applyRowGroupExpanded(key,expanded,"api")})}async applyRowGroupExpanded(key,expanded,source){const fields=this.effectiveGroupFields();if(fields===null)return;if(fields.length>=2){if(typeof key!=="string"||!this.currentMultiGroupKeys(fields).has(key)){console.warn(`[SG:GROUP] bad key=${key}`);return}const wasCollapsed=this.collapsedRowGroups.has(key);if(expanded!==wasCollapsed)return;const liveBefore2=this.liveRowsForPublication(row=>row.group&&row.expandKey===key);const next2=new Set(this.collapsedRowGroups);if(expanded)next2.delete(key);else next2.add(key);this.collapsedRowGroups=next2;this.rowGroupToggled.emit({key,expanded});this.publishLiveRowExpansions(liveBefore2,source);return}const validKeys=this.currentGroupKeys();if(validKeys===null)return;const foldedKey=key===null?BLANK_GROUP_KEY:key;if(!validKeys.has(foldedKey)){console.warn(`[SG:GROUP] bad key=${key}`);return}const isCollapsed=this.collapsedRowGroups.has(foldedKey);if(expanded!==isCollapsed)return;const liveBefore=this.liveRowsForPublication(row=>row.group&&row.expandKey===key);const next=new Set(this.collapsedRowGroups);if(expanded){next.delete(foldedKey)}else{next.add(foldedKey)}this.collapsedRowGroups=next;this.rowGroupToggled.emit({key,expanded});this.publishLiveRowExpansions(liveBefore,source)}async expandAllRowGroups(){return this.proMethod("expandAllRowGroups",{load:()=>this.groupEngineStep(),exec:()=>void 0,publish:()=>{if(this.collapsedRowGroups.size===0)return;const multi=(this.effectiveGroupFields()?.length??0)>=2;const reopened=[...this.collapsedRowGroups];const reopenedSet=new Set(reopened);const liveBefore=this.liveRowsForPublication(row=>row.group&&row.expandKey!==void 0&&reopenedSet.has(multi?String(row.expandKey):row.expandKey===null?BLANK_GROUP_KEY:String(row.expandKey)));this.collapsedRowGroups=new Set;for(const k of reopened){this.rowGroupToggled.emit({key:multi?k:k===BLANK_GROUP_KEY?null:k,expanded:true})}this.publishLiveRowExpansions(liveBefore,"api")}})}async collapseAllRowGroups(){return this.proMethod("collapseAllRowGroups",{load:()=>this.groupEngineStep(),exec:()=>void 0,publish:()=>{const fields=this.effectiveGroupFields();if(fields===null)return;const multi=fields.length>=2;const keys=multi?this.currentMultiGroupKeys(fields):this.currentGroupKeys();if(keys===null)return;const previous=this.collapsedRowGroups;const liveBefore=this.liveRowsForPublication(row=>row.group&&row.expandKey!==void 0&&keys.has(multi?String(row.expandKey):row.expandKey===null?BLANK_GROUP_KEY:String(row.expandKey))&&!previous.has(multi?String(row.expandKey):row.expandKey===null?BLANK_GROUP_KEY:String(row.expandKey)));this.collapsedRowGroups=keys;for(const k of keys){if(previous.has(k))continue;this.rowGroupToggled.emit({key:multi?k:k===BLANK_GROUP_KEY?null:k,expanded:false})}this.publishLiveRowExpansions(liveBefore,"api")}})}treeSurfaceCache=null;treeSurface(){if(typeof this.getDataPath==="function"){if(!this.proAllowed("grid.tree-data","getDataPath"))return this.inertTreeDeclaration();if(this.proUiChunks["tree-data"]===void 0)return null;return this.treeSurfaceOf(this.treeDeclaration.resolve({getDataPath:this.getDataPath},this.proGate()))}const idField=this.treeIdField;const parentField=this.treeParentField;if(typeof idField!=="string"||idField===""||typeof parentField!=="string"||parentField===""){this.treeDeclaration.resolve(null,this.proGate());return null}if(!this.proAllowed("grid.tree-data","treeIdField"))return this.inertTreeDeclaration();if(this.proUiChunks["tree-data"]===void 0)return null;return this.treeSurfaceOf(this.treeDeclaration.resolve({idField,parentField,labelField:this.treeLabelField},this.proGate()))}treeDeclaration=new GridHeldDeclaration("grid.tree-data",(a,b)=>a.getDataPath===b.getDataPath&&a.idField===b.idField&&a.parentField===b.parentField&&a.labelField===b.labelField);inertTreeDeclaration(){this.treeDeclaration.clear();return null}treeSurfaceOf(config){if(config===null)return null;const fn=config.getDataPath;if(typeof fn==="function")return{getDataPath:row=>fn(row)};const{idField,parentField,labelField}=config;if(typeof idField!=="string"||typeof parentField!=="string")return null;const source=this.rowData??[];const cached=this.treeSurfaceCache;if(cached!==null&&cached.rowData===source&&cached.idField===idField&&cached.parentField===parentField&&cached.labelField===labelField){return cached.surface}const{buildPathsFromParentIds}=this.treeDataEngine();const{pathOf,labelOf,segmentLabelOf}=buildPathsFromParentIds(source,{getId:row=>readOwnFieldPath(row,idField),getParentId:row=>readOwnFieldPath(row,parentField),getLabel:typeof labelField==="string"&&labelField!==""?row=>readOwnFieldPath(row,labelField):void 0});const surface={getDataPath:pathOf,getRowLabel:labelOf,getSegmentLabel:segmentLabelOf};this.treeSurfaceCache={rowData:source,idField,parentField,labelField,surface};return surface}treeRowComparator(){const model=this.activeSortModel;if(!model||model.length===0)return void 0;return(a,b)=>{for(const entry of model){const av=a===null?void 0:readOwnFieldPath(a,entry.field);const bv=b===null?void 0:readOwnFieldPath(b,entry.field);const cmp=defaultComparator(av,bv);if(cmp!==0)return entry.direction==="desc"?-cmp:cmp}return 0}}currentTreeParentKeys(){const surface=this.treeSurface();if(surface===null)return null;const keys=new Set;const source=this.rowData??[];for(const row of source){const path=surface.getDataPath(row);const valid=Array.isArray(path)&&path.length>0&&path.every(seg=>typeof seg==="string"&&seg!==""&&!seg.includes(TREE_PATH_KEY_SEPARATOR));if(!valid)continue;for(let len=1;len<path.length;len++){keys.add(foldTreePathKey(path.slice(0,len)))}}return keys}onTreeSurfaceChange(){this.collapsedTreeNodes=new Set;this.warnedTreeGroupConflict=false;this.treeSurfaceCache=null}async setTreeNodeExpanded(path,expanded){return this.proMethod("setTreeNodeExpanded",{load:()=>this.treeEngineStep(),exec:()=>void 0,publish:()=>this.applyTreeNodeExpanded(path,expanded,"api")})}async applyTreeNodeExpanded(path,expanded,source){if(this.serverSideState!==null){if(!Array.isArray(path)||path.length===0)return;const{serialiseGroupPath,toggleGroupExpanded}=this.ssrmEngine();const serverKey=serialiseGroupPath(path);const isExpanded=this.serverSideState.expanded.has(serverKey);if(isExpanded!==expanded){this.serverSideState=toggleGroupExpanded(this.serverSideState,path);this.lastServerFetchWindow=null;this.recomputeVirtualWindow()}return}const parentKeys=this.currentTreeParentKeys();if(parentKeys===null)return;if(!Array.isArray(path)||path.length===0)return;const key=foldTreePathKey(path);if(!parentKeys.has(key)){console.warn(`[SG:TREE] bad path=[${path.join(" / ")}]`);return}const isCollapsed=this.collapsedTreeNodes.has(key);if(expanded!==isCollapsed)return;const liveBefore=this.liveRowsForPublication(row=>row.group&&row.route.length===path.length&&row.route.every((segment,index2)=>segment===path[index2]));const next=new Set(this.collapsedTreeNodes);if(expanded){next.delete(key)}else{next.add(key)}this.collapsedTreeNodes=next;this.treeNodeToggled.emit({path:[...path],expanded});this.publishLiveRowExpansions(liveBefore,source)}async expandAllTreeNodes(){return this.proMethod("expandAllTreeNodes",{load:()=>this.treeEngineStep(),exec:()=>void 0,publish:()=>{if(this.collapsedTreeNodes.size===0)return;const reopened=[...this.collapsedTreeNodes];const reopenedSet=new Set(reopened);const liveBefore=this.liveRowsForPublication(row=>row.group&&reopenedSet.has(foldTreePathKey(row.route)));this.collapsedTreeNodes=new Set;for(const key of reopened){this.treeNodeToggled.emit({path:key.split(TREE_PATH_KEY_SEPARATOR),expanded:true})}this.publishLiveRowExpansions(liveBefore,"api")}})}async collapseAllTreeNodes(){return this.proMethod("collapseAllTreeNodes",{load:()=>this.treeEngineStep(),exec:()=>void 0,publish:()=>{const keys=this.currentTreeParentKeys();if(keys===null)return;const previous=this.collapsedTreeNodes;const liveBefore=this.liveRowsForPublication(row=>{const key=foldTreePathKey(row.route);return row.group&&keys.has(key)&&!previous.has(key)});this.collapsedTreeNodes=keys;for(const key of keys){if(previous.has(key))continue;this.treeNodeToggled.emit({path:key.split(TREE_PATH_KEY_SEPARATOR),expanded:false})}this.publishLiveRowExpansions(liveBefore,"api")}})}detailRowHeightPx(){const raw=this.detailRowHeight;return typeof raw==="number"&&Number.isFinite(raw)&&raw>=40?Math.floor(raw):160}masterDetailActive(){if(this.masterDetail!==true||!this.usingColumnDefsApi())return false;if(!this.proAllowed("grid.master-detail","masterDetail"))return false;if(this.proUiChunks["master-detail"]===void 0)return false;if(this.pivotMode===true&&this.pivotWinsOnArrival())return false;return!(this.pivotMode===true&&this.pivotModeActive())}currentMasterIds(){void this.getDisplayRows();return this.lastMasterIds}async setDetailRowExpanded(rowId,expanded){return this.proMethod("setDetailRowExpanded",{load:()=>this.masterDetailEngineStep(),exec:()=>void 0,publish:()=>this.applyDetailRowExpanded(rowId,expanded,"api")})}async applyDetailRowExpanded(rowId,expanded,source){if(!this.masterDetailActive())return;if(expanded&&!this.currentMasterIds().has(rowId)&&!this.allFilteredMasterIds().has(rowId)){console.warn(`[SG:DETAIL] bad id=${rowId}`);return}const isExpanded=this.expandedDetailRows.has(rowId);if(expanded===isExpanded)return;const liveBefore=this.liveRowsForPublication(row=>row.id===rowId&&row.master);const next=new Set(this.expandedDetailRows);if(expanded){next.add(rowId)}else{next.delete(rowId)}this.expandedDetailRows=next;if(!expanded)this.detailRowDataCache.delete(rowId);this.detailRowToggled.emit({rowId,expanded});this.publishLiveRowExpansions(liveBefore,source)}masterRowsById(){const rows=this.engineRows({skipPaginate:true});const map=new Map;for(let i=0;i<rows.length;i++){const id=this.masterIdAt(rows[i],i);if(id!==void 0&&!map.has(id))map.set(id,rows[i])}return map}masterIdAt(row,absoluteIndex){if(row===null||typeof row!=="object")return void 0;if(typeof this.getRowId==="function")return this.extractRowId(row,absoluteIndex);if(isGroupMarkerRow(row)||isGroupFooterRow(row)||isTreeNodeRow(row)||isDetailRow(row))return void 0;return absoluteIndex}allFilteredMasterIds(){const rows=this.engineRows({skipPaginate:true});const ids=new Set;for(let i=0;i<rows.length;i++){const id=this.masterIdAt(rows[i],i);if(id!==void 0)ids.add(id)}return ids}async expandAllDetailRows(){return this.proMethod("expandAllDetailRows",{load:()=>this.masterDetailEngineStep(),exec:()=>void 0,publish:()=>{if(!this.masterDetailActive())return;const ids=this.allFilteredMasterIds();const previous=this.expandedDetailRows;const next=new Set(previous);for(const id of ids)next.add(id);if(next.size===previous.size)return;const liveBefore=this.liveRowsForPublication(row=>row.master&&ids.has(row.id)&&!previous.has(row.id));this.expandedDetailRows=next;for(const id of ids){if(previous.has(id))continue;this.detailRowToggled.emit({rowId:id,expanded:true})}this.publishLiveRowExpansions(liveBefore,"api")}})}async collapseAllDetailRows(){return this.proRun("collapseAllDetailRows",()=>{if(this.expandedDetailRows.size===0)return;const closed=[...this.expandedDetailRows];const closedSet=new Set(closed);const liveBefore=this.liveRowsForPublication(row=>row.master&&closedSet.has(row.id));this.expandedDetailRows=new Set;for(const id of closed){this.detailRowDataCache.delete(id);this.detailRowToggled.emit({rowId:id,expanded:false})}this.publishLiveRowExpansions(liveBefore,"api")})}lastMasterIds=new Set;mountedDetailIds=new Set;detailRowIds=new WeakMap;withDetailRows(rows){if(!this.masterDetailActive())return rows;const meta=this.latestPaginatedMeta;const indexOffset=this.pagination&&meta!==null?meta.pageIndex*meta.pageSize:0;const ids=new WeakMap;const masterIds=new Set;for(let i=0;i<rows.length;i++){const row=rows[i];const id=this.masterIdAt(row,indexOffset+i);if(id===void 0)continue;ids.set(row,id);masterIds.add(id)}this.detailRowIds=ids;this.lastMasterIds=masterIds;if(this.expandedDetailRows.size===0)return rows;const{insertDetailRows}=this.masterDetailEngine();return insertDetailRows(rows,this.expandedDetailRows,row=>ids.get(row))}async setColumnGroupOpened(groupId,open){return this.applyColumnGroupOpened(groupId,open,"api")}async applyColumnGroupOpened(groupId,open,source){if(typeof groupId!=="string"||groupId==="")return;const isCollapsed=this.collapsedGroups.has(groupId);if(open!==isCollapsed)return;const next=new Set(this.collapsedGroups);if(open){next.delete(groupId)}else{next.add(groupId)}this.collapsedGroups=next;this.columnGroupToggled.emit({groupId,open});this.publishLiveObjectChange("columnGroup",groupId,"expandedChanged",source,{before:!open,after:open})}headerGroupDepth(){if(!this.usingColumnDefsApi())return 0;return columnGroupDepth(this.columnDefsSource())}bodyAriaRowIndex(rowIndex){if(this.renderingPinnedBand==="top")return rowIndex+2+this.headerGroupDepth();if(this.renderingPinnedBand==="bottom"){return rowIndex+2+this.headerGroupDepth()+this.pinnedTopCount()+this.getDisplayRows().length}return rowIndex+2+this.headerGroupDepth()+this.pinnedTopCount()}engineColumns(){if(this.usingColumnDefsApi()){return this.resolvedColumnDefs().filter(c=>typeof c.field==="string"&&c.field!=="").map(c=>({key:c.field,label:c.headerName??c.field,width:c.width}))}return this.columns}engineRows(options){const skipPaginate=options?.skipPaginate===true;const{state,rows}=resolveEngineRows(this.engineRowsMemo,this.engineRowsInputs(),skipPaginate,()=>this.computeEngineRows(skipPaginate));this.engineRowsMemo=state;return rows}engineRowsMemo=null;engineRowsInputs(){return{rowData:this.rowData,rows:this.rows,columnDefs:this.columnDefs,defaultColDef:this.defaultColDef,collapsedGroups:this.collapsedGroups,quickFilter:this.quickFilter,quickFilterValue:this.quickFilterValue,quickFilterMode:this.quickFilterMode,quickFilterRegex:this.quickFilterRegex,activeFilters:this.activeFilters,activeConditionTree:this.activeConditionTree,lifecycleFilterVersion:this.lifecycleFilterVersion,statusBar:this.statusBar,activeSortModel:this.activeSortModel,getDataPath:this.getDataPath,treeIdField:this.treeIdField,treeParentField:this.treeParentField,treeLabelField:this.treeLabelField,collapsedTreeNodes:this.collapsedTreeNodes,groupBy:this.groupBy,collapsedRowGroups:this.collapsedRowGroups,customAggFuncs:this.customAggFuncs,pivotMode:this.pivotMode,pivotRowGroupColumns:this.pivotRowGroupColumns,pivotColumns:this.pivotColumns,pivotValueColumns:this.pivotValueColumns,pivotAggFuncs:this.pivotAggFuncs,pivotCollapsedRowGroups:this.pivotCollapsedRowGroups,pivotSubtotals:this.pivotSubtotals,pivotGrandTotal:this.pivotGrandTotal,groupPivotChunkModule:this.groupPivotChunkModule,pagination:this.pagination,activePagination:this.activePagination,masterDetail:this.masterDetail,getRowId:this.getRowId,expandedDetailRows:this.expandedDetailRows,formulaSheet:this.formulaSheet,formulaVersion:this.formulaVersion,licenseRevision:this.licenseRevision,proUiChunks:this.proUiChunks}}formulaFieldGetter(field){const sheet=this.formulaSheet;if(this.formulas!==true||sheet===null||!sheet.active)return void 0;if(sheet.isCalculatedField(field)){return row=>sheet.calculatedDisplay(field,row)}return row=>{const raw=readOwnFieldPath(row,field);return isFormulaText(raw)?this.formulaCellDisplay(sheet,raw,field,row):raw}}formulaAwareConditionNode(node){if(this.formulas!==true||this.formulaSheet===null||!this.formulaSheet.active)return node;const walk=n=>{if("children"in n&&Array.isArray(n.children)){const group=n;return{...group,children:group.children.map(walk)}}const leaf=n;if(typeof leaf?.spec?.field!=="string"||leaf.spec.valueGetter!==void 0)return n;const getter=this.formulaFieldGetter(leaf.spec.field);if(getter===void 0)return n;return{...leaf,spec:{...leaf.spec,valueGetter:getter}}};return walk(node)}buildFilterStages(){const stages=[];const lifecycleFilter=this.filterFacade;const configuredLifecycleFilters=this.configuredLifecycleFilterCount();const lifecycleStats=lifecycleFilter?.stats();const lifecycleReady=lifecycleFilter!==null&&lifecycleStats!==void 0&&this.componentFilterReadyRevision===this.componentFilterRevision&&lifecycleStats.columns===configuredLifecycleFilters&&lifecycleStats.mountedFilters===configuredLifecycleFilters&&this.externalFilterRuntimeReady();if((configuredLifecycleFilters>0||this.externalFilter!=null)&&this.componentFilterExecutionMode()==="client"){stages.push(createFilterStage({filters:[{id:"__lifecycle__",predicate:row=>lifecycleReady&&lifecycleFilter!==null&&lifecycleFilter.doesPass(row,"client")}]}))}const activeQuickFilterValue=typeof this.quickFilterValue==="string"?this.quickFilterValue:"";if(this.quickFilter&&activeQuickFilterValue.trim()!==""){const quickTarget=this.quickFilterTarget();const predicate=createQuickFilter({value:activeQuickFilterValue,wordMode:this.quickFilterMode,fields:quickTarget.fields,valueGetter:quickTarget.valueGetter,mode:this.quickFilterRegex===true?"regex":"text"});stages.push(createFilterStage({filters:[{id:"__quick__",predicate}]}))}const activeFilterList=Object.values(this.activeFilters);const conditionFilters=this.activeConditionTree&&this.proAllowed("grid.advanced-filter","setConditionFilter")?this.proUiChunk("pro-filters","grid.advanced-filter","setConditionFilter"):null;const conditionEntry=this.activeConditionTree&&conditionFilters!==null?[{id:"__condition__",predicate:conditionFilters.createConditionFilter(this.formulaAwareConditionNode(this.activeConditionTree))}]:[];const sourceFilters=activeFilterList.map(f=>{const predicate=this.buildSourcePredicate(f);return predicate===null?null:{id:f.field,predicate}}).filter(entry=>entry!==null);if(sourceFilters.length>0||conditionEntry.length>0){stages.push(createFilterStage({filters:[...sourceFilters,...conditionEntry]}))}return stages}columnFilterValueGetter(col){if(!col)return void 0;if(col.valueGetter===void 0||col.valueGetter===null){return this.formulaFieldGetter(col.field)}const resolvedColId=col.colId??col.field;const valueGetter=col.valueGetter;return row=>this.resolveGridCellValue({row,rowIndex:-1,colId:resolvedColId,field:col.field,valueGetter,colDef:col})}targetForColumnField(field,columns){const col=columns.find(candidate=>candidate.field===field);return{field,valueGetter:this.columnFilterValueGetter(col)}}pivotSourceTargetsForFilter(field){if(!this.pivotModeActive())return null;if(isPivotColumnId(field))return[];if(field===PIVOT_ROW_HEADER_COL_ID){const declared=this.declaredColumnDefs();return(this.pivotRowGroupColumns??[]).filter(candidate=>typeof candidate==="string"&&candidate!=="").map(candidate=>this.targetForColumnField(candidate,declared))}return[this.targetForColumnField(field,this.declaredColumnDefs())]}sourceTargetsForFilter(field){const pivotTargets=this.pivotSourceTargetsForFilter(field);if(pivotTargets!==null)return pivotTargets;return[this.targetForColumnField(field,this.resolvedColumnDefs())]}buildPredicateForTarget(filter,target){return this.buildPredicate(retargetActiveFilter(filter,target.field,target.valueGetter))}buildSourcePredicate(filter){const targets=this.sourceTargetsForFilter(filter.field);if(targets.length===0)return null;const predicates=targets.map(target=>this.buildPredicateForTarget(filter,target));if(predicates.length===1)return predicates[0];return row=>predicates.some(predicate=>predicate(row))}setFilterCatalogueRows(field){if(!this.pivotModeActive()||!isPivotColumnId(field)){return this.rowData??[]}const pivot=this.pivotComputation();if(pivot===null)return[];return[...pivot.markers,...pivot.grandTotal!==null?[pivot.grandTotal]:[]]}setFilterCatalogueTarget(field){if(this.pivotModeActive()&&isPivotColumnId(field)){return{rows:this.setFilterCatalogueRows(field),target:this.targetForColumnField(field,this.effectiveColumns())}}const targets=this.sourceTargetsForFilter(field);return{rows:this.setFilterCatalogueRows(field),target:targets[0]??{field}}}declaredColumnFieldSet(){return new Set(this.declaredColumnDefs().map(col=>col.field).filter(field=>typeof field==="string"&&field!==""))}isPivotDisplaySortField(field){return field===PIVOT_ROW_HEADER_COL_ID||isPivotColumnId(field)}pivotSourceSortColumn(field){if(!this.pivotModeActive()||this.pivotComputation()===null)return null;if(this.isPivotDisplaySortField(field))return null;return this.declaredColumnDefs().find(col=>col.field===field)??null}pivotSourceSortModel(){const declared=this.declaredColumnFieldSet();return this.activeSortModel.filter(entry=>declared.has(entry.field)&&!this.isPivotDisplaySortField(entry.field)).map(entry=>({...entry}))}pivotDisplaySortModel(){return this.activeSortModel.filter(entry=>this.isPivotDisplaySortField(entry.field)).map(entry=>({...entry}))}isSortNullish(value){if(value===null||value===void 0)return true;if(typeof value==="number"&&Number.isNaN(value))return true;if(value instanceof Date&&Number.isNaN(value.getTime()))return true;return false}pivotDisplaySortValue(row,field,cols){if(field===PIVOT_ROW_HEADER_COL_ID)return row.label;const col=cols.find(candidate=>candidate.field===field);if(!col)return null;const resolvedColId=col.colId??col.field;return this.resolveGridCellValue({row,rowIndex:-1,colId:resolvedColId,field:col.field,valueGetter:col.valueGetter,colDef:col})}comparePivotMarkersForDisplay(a,b,model,cols){for(const entry of model){const av=this.pivotDisplaySortValue(a,entry.field,cols);const bv=this.pivotDisplaySortValue(b,entry.field,cols);const aNullish=this.isSortNullish(av);const bNullish=this.isSortNullish(bv);if(aNullish&&bNullish)continue;if(aNullish)return 1;if(bNullish)return-1;const cmp=(entry.direction==="desc"?-1:1)*defaultComparator(av,bv);if(cmp!==0)return cmp}return 0}sortPivotMarkersForDisplay(markers,cols){const model=this.pivotDisplaySortModel();if(model.length===0)return[...markers];const byParent=new Map;for(const marker of markers){const parentKey=frameSegmentPath(marker.groupKeys.slice(0,-1));const bucket=byParent.get(parentKey);if(bucket)bucket.push(marker);else byParent.set(parentKey,[marker])}const sorted=[];const append=parentKey=>{const siblings=[...byParent.get(parentKey)??[]];siblings.sort((a,b)=>this.comparePivotMarkersForDisplay(a,b,model,cols));for(const marker of siblings){sorted.push(marker);if(marker.expanded)append(marker.key)}};append("");return sorted}pivotDisplayFilterPredicates(cols){if(!this.pivotModeActive())return[];const predicates=[];for(const filter of Object.values(this.activeFilters)){if(!isPivotColumnId(filter.field))continue;const target=this.targetForColumnField(filter.field,cols);predicates.push(this.buildPredicateForTarget(filter,target))}return predicates}filterPivotMarkersForDisplay(markers,cols){const predicates=this.pivotDisplayFilterPredicates(cols);if(predicates.length===0)return[...markers];return markers.filter(marker=>{for(const predicate of predicates){if(!predicate(marker))return false}return true})}buildSortStage(model=this.activeSortModel){if(model.length===0)return null;return createMultiSortStage(model.map(entry=>({field:entry.field,direction:entry.direction,valueGetter:this.formulaFieldGetter(entry.field)})))}computeEngineRows(skipPaginate){if(this.usingColumnDefsApi()){if(this.pivotModeActive()){const pivot=this.pivotComputation();const pivotCols=pivot===null?[]:this.effectiveColumns();const pivotMarkers=pivot===null?[]:this.sortPivotMarkersForDisplay(this.filterPivotMarkersForDisplay(pivot.markers,pivotCols),pivotCols);let rows=pivot===null?[]:[...pivotMarkers,...pivot.grandTotal!==null?[pivot.grandTotal]:[]];if(pivot!==null&&(this.pivotSubtotals!=="off"||this.pivotGrandTotal!=="bottom")){const chunk=this.ensureGroupPivotChunkArmed();if(chunk!==null){rows=chunk.composePivotDisplayRows(pivot,pivotMarkers,this.pivotSubtotals,this.pivotGrandTotal)}}if(skipPaginate)return rows;if(!this.pagination){this.maybeUpdatePaginatedMeta(null);return rows}const out2=runPipeline(rows,[createPaginateStage({pageIndex:this.activePagination.pageIndex,pageSize:this.activePagination.pageSize})]);this.maybeUpdatePaginatedMeta(out2.meta.pagination??null);return[...out2.rows]}const source=this.rowData??[];const stages=[];stages.push(...this.buildFilterStages());if(!skipPaginate&&this.statusBarSpec()!==null){stages.push({name:"filtered",run:state=>{this.lastFilteredDataRowCount=state.rows.length;return state}})}const sortStage=this.buildSortStage();if(sortStage!==null)stages.push(sortStage);const treeSurface=this.treeSurface();if(treeSurface!==null&&this.effectiveGroupBy()!==null&&!this.warnedTreeGroupConflict){this.warnedTreeGroupConflict=true;console.warn("tree data and group-by are mutually exclusive; tree wins.")}if(treeSurface!==null){const{createTreeDataStage}=this.treeDataEngine();stages.push(createTreeDataStage({getDataPath:treeSurface.getDataPath,getRowLabel:treeSurface.getRowLabel,getSegmentLabel:treeSurface.getSegmentLabel,collapsedKeys:this.collapsedTreeNodes,compareRows:this.treeRowComparator()}))}const groupFields=treeSurface!==null?null:this.effectiveGroupFields();if(groupFields!==null){if(!this.warnedGroupDetailUnstable&&this.masterDetailActive()&&typeof this.getRowId!=="function"){this.warnedGroupDetailUnstable=true;console.warn("[SG:DETAIL] an open detail can disappear when a group collapses.")}const aggSpecs=this.aggregationSpecs();const{createAggregateStage,createGroupStage,createMultiGroupStage,insertGroupFooters,pruneCollapsedGroups}=this.groupPivotEngine();if(groupFields.length>=2){stages.push(createMultiGroupStage({groupFields,aggSpecs,collapsedKeys:this.collapsedRowGroups}))}else if(aggSpecs.length>0){stages.push(createGroupStage({field:groupFields[0]}));stages.push(createAggregateStage({specs:aggSpecs}));stages.push({name:"grouped",run:state=>({source:state.source,rows:insertGroupFooters(pruneCollapsedGroups(state.rows,this.collapsedRowGroups,BLANK_GROUP_KEY)),stage:"grouped",meta:state.meta})})}else{stages.push(createGroupStage({field:groupFields[0],collapsedKeys:this.collapsedRowGroups}))}}if(this.pagination&&!skipPaginate){stages.push(createPaginateStage({pageIndex:this.activePagination.pageIndex,pageSize:this.activePagination.pageSize}))}if(stages.length===0){if(!skipPaginate)this.maybeUpdatePaginatedMeta(null);return skipPaginate?[...source]:this.withDetailRows(source)}const out=runPipeline(source,stages);if(skipPaginate)return[...out.rows];const pageMeta=out.meta.pagination??null;this.maybeUpdatePaginatedMeta(pageMeta);return this.withDetailRows([...out.rows])}return this.rowData??this.rows}maybeUpdatePaginatedMeta(meta){const prev=this.latestPaginatedMeta;const unchanged=prev===meta||prev!==null&&meta!==null&&prev.totalRows===meta.totalRows&&prev.pageCount===meta.pageCount&&prev.pageIndex===meta.pageIndex&&prev.pageSize===meta.pageSize;if(!unchanged)this.latestPaginatedMeta=meta;if(meta&&(meta.pageIndex!==this.activePagination.pageIndex||meta.pageSize!==this.activePagination.pageSize)){this.activePagination={pageIndex:meta.pageIndex,pageSize:meta.pageSize}}}quickFilterFieldList(){const cols=this.pivotModeActive()?this.declaredColumnDefs():this.resolvedColumnDefs();if(cols.length===0)return void 0;return cols.map(c=>c.field)}quickFilterTarget(){const cols=this.pivotModeActive()?this.declaredColumnDefs():this.resolvedColumnDefs();const fields=this.quickFilterFieldList();if(!fields||cols.length===0)return{};return{fields,valueGetter:row=>cols.map(col=>{const getter=this.columnFilterValueGetter(col);return getter?getter(row):readOwnFieldPath(row,col.field)})}}buildPredicate(filter){const withFormula=spec=>{if(spec.valueGetter!==void 0)return spec;const getter=this.formulaFieldGetter(spec.field);return getter===void 0?spec:{...spec,valueGetter:getter}};switch(filter.kind){case"text":return createTextFilter(withFormula(filter.spec));case"number":return createNumberFilter(withFormula(filter.spec));case"date":return createDateFilter(withFormula(filter.spec));case"set":{if(!this.filterKindAllowed("set",true))return()=>true;const filters=this.proFilterKindChunk("set");if(filters===null)return()=>true;return filters.createSetFilter(withFormula(filter.spec))}case"multi":{if(!this.filterKindAllowed("multi",filter.spec.parts.some(part=>part.kind==="set")))return()=>true;const filters=this.proFilterKindChunk("multi");if(filters===null)return()=>true;const getter=this.formulaFieldGetter(filter.spec.field);if(getter===void 0)return filters.createMultiFilter(filter.spec);const parts=filter.spec.parts.map(part=>part.spec.valueGetter!==void 0?part:{...part,spec:{...part.spec,valueGetter:getter}});return filters.createMultiFilter({...filter.spec,parts})}default:{return()=>true}}}hostStyle(){if(this.height==null)return void 0;const value=typeof this.height==="number"?`${this.height}px`:this.height;return{height:value}}handleHeaderClick=(col,event)=>{if(col.sortable===false)return;if(this.effectiveLoading)return;const mode=this.multiSortActive()&&event?.shiftKey===true?"append":"replace";this.applySortModel(cycleSortModel(this.activeSortModel,col.field,mode))};builtInFilterDecl(filter){if(filter===void 0)return void 0;if(filter===true)return"text";if(filter===false)return false;if(Array.isArray(filter)){return filter}return filter==="text"||filter==="number"||filter==="date"||filter==="set"?filter:void 0}offeredFilterUiKind(filter){const kind=this.filterUiKind(filter);return kind!==null&&this.proFilterKindReady(kind)?kind:null}filterUiKind(filter){filter=this.builtInFilterDecl(filter);if(filter===void 0)return null;if(filter===false)return null;if(Array.isArray(filter)){const kinds=this.declaredFilterKinds(filter);if(kinds.length===0)return null;const kind=kinds.length===1?kinds[0]:"multi";return this.filterKindAllowed(kind,kinds.includes("set"))?kind:null}if(filter==="text"||filter==="number"||filter==="date")return filter;if(filter==="set")return this.filterKindAllowed("set",true)?"set":null;return"text"}proFilterKindChunk(kind){return this.proUiChunk("pro-filters",kind==="set"?"grid.set-filter":"grid.multi-filter","columnDefs")??null}proFilterKindReady(kind){return kind==="set"||kind==="multi"?this.proFilterKindChunk(kind)!==null:true}filterKindAllowed(kind,hasSetPart){if(kind==="set")return this.proAllowed("grid.set-filter","columnDefs");if(kind!=="multi")return true;const multi=this.proAllowed("grid.multi-filter","columnDefs");const set=!hasSetPart||this.proAllowed("grid.set-filter","columnDefs");return multi&&set}declaredFilterKinds(decl){const out=[];for(const kind of decl){if(kind==="text"||kind==="number"||kind==="date"||kind==="set"){out.push(kind)}}return out}defaultFormForKind(field,kind){if(kind==="set"){const catalogue=this.setFilterCatalogueTarget(field);const catalogueRows=this.maskRowsForRead(catalogue.rows,this.resolvedColumnDefs());const filters=this.proUiChunks["pro-filters"];const items=filters!==void 0?filters.collectSetFilterValues(catalogueRows,catalogue.target):[];const selected=new Set;for(const item of items)selected.add(item.key);return{field,kind,op:"in",value1:"",value2:"",caseSensitive:false,granularity:"utc",setItems:items,setSelected:selected,setSearch:""}}return{field,kind,op:kind==="text"?"contains":"equals",value1:"",value2:"",caseSensitive:false,granularity:"utc"}}formFromMultiPart(field,part){if(part.kind==="set"){const base=this.defaultFormForKind(field,"set");const values=part.spec.values;const selected=new Set;if(values===null){for(const item of base.setItems??[])selected.add(item.key)}else{for(const key of values)selected.add(key)}return{...base,setSelected:selected}}return this.formStateFromActive({kind:part.kind,field,spec:part.spec})}buildInitialForm(field,kind,decl){const existing=this.activeFilters[field];if(kind==="multi"){const kinds=Array.isArray(decl)?this.declaredFilterKinds(decl):[];const activeParts=existing&&existing.kind==="multi"?existing.spec.parts:[];const subForms=kinds.map(partKind=>{const activePart=activeParts.find(part=>part.kind===partKind);return activePart?this.formFromMultiPart(field,activePart):this.defaultFormForKind(field,partKind)});return{field,kind,op:"multi",value1:"",value2:"",caseSensitive:false,granularity:"utc",subForms}}if(kind==="set"){const base=this.defaultFormForKind(field,"set");const active=existing&&existing.kind==="set"?existing.spec.values:null;if(active!==null){const selected=new Set;for(const key of active)selected.add(key);return{...base,setSelected:selected}}return base}if(existing&&existing.kind===kind){return this.formStateFromActive(existing)}return this.defaultFormForKind(field,kind)}formStateFromActive(filter){if(filter.kind==="text"){return{field:filter.field,kind:"text",op:filter.spec.op,value1:filter.spec.value??"",value2:"",caseSensitive:filter.spec.caseSensitive??false,granularity:"utc"}}if(filter.kind==="number"){const v2=filter.spec.value;const isRange2=filter.spec.op==="between"||filter.spec.op==="notBetween";return{field:filter.field,kind:"number",op:filter.spec.op,value1:isRange2&&Array.isArray(v2)?this.numberToInputValue(v2[0]):this.numberToInputValue(v2),value2:isRange2&&Array.isArray(v2)?this.numberToInputValue(v2[1]):"",caseSensitive:false,granularity:"utc"}}if(filter.kind==="set"){return this.buildInitialForm(filter.field,"set")}if(filter.kind==="multi"){return{field:filter.field,kind:"multi",op:"multi",value1:"",value2:"",caseSensitive:false,granularity:"utc",subForms:filter.spec.parts.map(part=>this.formFromMultiPart(filter.field,part))}}const v=filter.spec.value;const isRange=filter.spec.op==="between"||filter.spec.op==="notBetween";return{field:filter.field,kind:"date",op:filter.spec.op,value1:isRange&&Array.isArray(v)?this.dateValueToInput(v[0]):this.dateValueToInput(v),value2:isRange&&Array.isArray(v)?this.dateValueToInput(v[1]):"",caseSensitive:false,granularity:filter.spec.granularity??"utc"}}numberToInputValue(n){if(n===void 0||n===null||typeof n==="number"&&Number.isNaN(n))return"";return String(n)}dateValueToInput(v){if(v==null)return"";if(v instanceof Date){const ms=v.getTime();if(Number.isNaN(ms))return"";return v.toISOString().slice(0,10)}if(typeof v==="number"){const ms=v;if(!Number.isFinite(ms))return"";return new Date(ms).toISOString().slice(0,10)}if(typeof v==="string"){if(/^\d{4}-\d{2}-\d{2}/.test(v))return v.slice(0,10);return v}return""}handleFilterIconClick=(col,event)=>{event.stopPropagation();this.toggleFilterDropdown(col,event.currentTarget)};computeFilterDropdownAnchor(anchorEl){const rect=anchorEl?.getBoundingClientRect?.();const hostRect=this.host?.getBoundingClientRect?.();if(!rect||!hostRect)return null;const estimatedWidth=260;const padding=4;const maxX=Math.max(padding,hostRect.width-estimatedWidth-padding);return{x:Math.min(Math.max(rect.left-hostRect.left,padding),maxX),y:Math.max(rect.bottom-hostRect.top+4,padding)}}toggleFilterDropdown(col,anchorEl){if(this.effectiveLoading&&this.openFilterField!==col.field)return;const lifecycleFilter=this.lifecycleFilterDeclaration(col);const declaration=lifecycleFilter===null?this.builtInFilterDecl(col.filter):void 0;const kind=lifecycleFilter===null?this.offeredFilterUiKind(declaration):null;if(lifecycleFilter===null&&!kind)return;if(this.openFilterField===col.field){this.closeFilterDropdown();return}this.dropdownAnchor=this.computeFilterDropdownAnchor(anchorEl);this.openFilterField=col.field;this.filterForm=lifecycleFilter===null&&kind!==null?this.buildInitialForm(col.field,kind,declaration):null;this.filterDropdownReturnFocus=anchorEl;this.filterDropdownFocused=false}closeFilterDropdown(restoreFocus=true){if(this.openFilterField===null)return;const openColumn=this.resolvedColumnDefs().find(col=>col.field===this.openFilterField);if(openColumn!==void 0&&this.lifecycleFilterDeclaration(openColumn)!==null){const colId=this.componentFilterColumnId(openColumn);const host=this.componentFilterHosts.get(colId);if(host!==void 0){this.releaseComponentFilterHost(colId,host,false)}else{void this.filterFacade?.detachFilterGui(colId)}}this.openFilterField=null;this.filterForm=null;this.dropdownAnchor=null;this.filterDropdownFocused=false;const target=this.filterDropdownReturnFocus;this.filterDropdownReturnFocus=null;if(!restoreFocus)return;if(target!==null&&typeof target.focus==="function"&&this.host?.contains(target)){target.focus()}else if(this.viewportEl&&typeof this.viewportEl.focus==="function"){this.viewportEl.focus({preventScroll:true})}}maybeFocusFilterDropdown(){if(this.openFilterField===null||this.filterDropdownFocused)return;const dropdown=this.filterDropdownEl;if(dropdown===null)return;this.filterDropdownFocused=true;const first=dropdown.querySelector("input, select, button:not([disabled])");(first??dropdown).focus()}updateFilterForm=patch=>{if(!this.filterForm)return;if(this.effectiveLoading)return;this.filterForm={...this.filterForm,...patch}};patchForm(subIndex,patch){if(subIndex===null){this.updateFilterForm(patch);return}if(!this.filterForm?.subForms||this.effectiveLoading)return;const subForms=this.filterForm.subForms.map((sub,i)=>i===subIndex?{...sub,...patch}:sub);this.updateFilterForm({subForms})}formAt(subIndex){if(!this.filterForm)return null;if(subIndex===null)return this.filterForm;return this.filterForm.subForms?.[subIndex]??null}setFormSelectsAll(form){if(!form.setItems||!form.setSelected)return true;for(const item of form.setItems){if(!form.setSelected.has(item.key))return false}return true}subFormIsInactive(form){if(form.kind==="set")return this.setFormSelectsAll(form);if(form.kind==="text"){return form.value1===""&&(form.op==="contains"||form.op==="startsWith"||form.op==="endsWith")}const isRange=form.op==="between"||form.op==="notBetween";return isRange?form.value1.trim()===""&&form.value2.trim()==="":form.value1.trim()===""}multiFormActiveParts(form){const parts=[];for(const sub of form.subForms??[]){if(this.subFormIsInactive(sub))continue;const active=this.buildActiveFilterFromForm(sub);if(!active||active.kind==="multi")continue;parts.push({kind:active.kind,spec:active.spec})}return parts}buildActiveFilterFromForm(form){if(form.kind==="multi"){const parts=this.multiFormActiveParts(form);if(parts.length===0)return null;const spec2={field:form.field,parts};return{kind:"multi",field:form.field,spec:spec2}}if(form.kind==="set"){const spec2={field:form.field,values:form.setSelected?[...form.setSelected]:null};return{kind:"set",field:form.field,spec:spec2}}if(form.kind==="text"){const spec2={field:form.field,op:form.op,value:form.value1,caseSensitive:form.caseSensitive};return{kind:"text",field:form.field,spec:spec2}}if(form.kind==="number"){const op2=form.op;const isRange2=op2==="between"||op2==="notBetween";const v1=form.value1.trim()===""?Number.NaN:normalizeNumericInput(form.value1)??Number.NaN;const v2=form.value2.trim()===""?Number.NaN:normalizeNumericInput(form.value2)??Number.NaN;const spec2={field:form.field,op:op2,value:isRange2?[v1,v2]:v1};return{kind:"number",field:form.field,spec:spec2}}const op=form.op;const isRange=op==="between"||op==="notBetween";const spec={field:form.field,op,value:isRange?[form.value1,form.value2]:form.value1,granularity:form.granularity};return{kind:"date",field:form.field,spec}}handleFilterApply=()=>{if(!this.filterForm)return;if(this.effectiveLoading)return;if(this.filterForm.kind==="set"&&this.setFormSelectsAll(this.filterForm)){this.handleFilterClear();return}if(this.filterForm.kind==="multi"&&this.multiFormActiveParts(this.filterForm).length===0){this.handleFilterClear();return}const filter=this.buildActiveFilterFromForm(this.filterForm);if(!filter){this.closeFilterDropdown();return}if(!this.filterApplyAllowed(filter))return;const nextMap=setActiveFilter(this.activeFilters,filter);this.activeFilters=nextMap;this.filterChanged.emit({field:filter.field,filter,activeMap:nextMap});this.scheduleLifecycleFilterPeerNotification();this.closeFilterDropdown();this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()};filterApplyAllowed(filter){if(filter.kind==="set")return this.proNewWorkAllowed("grid.set-filter","columnDefs");if(filter.kind!=="multi")return true;if(!this.proNewWorkAllowed("grid.multi-filter","columnDefs"))return false;return!filter.spec.parts.some(part=>part.kind==="set")||this.proNewWorkAllowed("grid.set-filter","columnDefs")}handleFilterClear=()=>{if(!this.filterForm)return;if(this.effectiveLoading)return;const field=this.filterForm.field;const nextMap=clearActiveFilter(this.activeFilters,field);this.activeFilters=nextMap;this.filterChanged.emit({field,filter:null,activeMap:nextMap});this.scheduleLifecycleFilterPeerNotification();this.closeFilterDropdown();this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()};handleFilterCancel=()=>{this.closeFilterDropdown()};handleDocumentLifecycleEditorKeyDown=event=>{if(event.isComposing||event.key!=="Escape"&&event.key!=="Esc"){return}if(!this.ownsLifecycleEditorDocumentEvent(event)||this.editingCell===null&&this.lifecycleEditorQueuedRequestRevision===null){return}const facade=this.editorFacade;const facadeEngaged=facade!==null&&facade.lookup().status!=="idle";if(!facadeEngaged&&this.lifecycleEditorQueuedRequestRevision===null){return}event.preventDefault();event.stopImmediatePropagation();if(facadeEngaged){this.invalidateLifecycleEditorRequests();void facade.stop("escape",{cancel:true});return}void this.cancelActiveEdit()};handleDocumentClick=event=>{if(this.contextMenuState!==null){const t2=event.target;if(t2?.closest?.(".sy-grid__context-menu")===null||t2?.closest===void 0){this.closeContextMenu()}}if(this.commentPanel!==null){const t2=event.target;const inside=t2!==null&&typeof t2.closest==="function"&&(t2.closest(".sy-grid__comment-panel")!==null||this.host!==void 0&&this.host.contains(t2));if(!inside)this.closeCommentPanel()}if(this.selectEditorState!==null&&this.selectEditorState.open){const rawTarget=event.target;const targetEl=rawTarget!==null&&typeof rawTarget==="object"&&"closest"in rawTarget&&typeof rawTarget.closest==="function"?rawTarget:null;const insideTrigger=targetEl!==null&&targetEl.closest(".sy-grid__cell-editor--select")!==null;const insideListbox=targetEl!==null&&targetEl.closest(".sy-grid__select-listbox")!==null;if(!insideTrigger&&!insideListbox){const next=applyDropdownToggle(this.selectEditorState,false);if(next!==this.selectEditorState)this.selectEditorState=next}}const editorLookup=this.editorFacade?.lookup();if(editorLookup?.status==="mounted"){const target2=event.target;const targetNode=target2!==null&&typeof target2==="object"&&"nodeType"in target2?target2:null;const insideGui=targetNode!==null&&editorLookup.gui.contains(targetNode);const insideCell=targetNode!==null&&editorLookup.params.cellElement?.contains(targetNode)===true;if(!insideGui&&!insideCell){this.invalidateLifecycleEditorRequests();void this.editorFacade?.handleMouseStop()}}else if(editorLookup?.status==="starting"){const target2=event.target;const targetNode=target2!==null&&typeof target2==="object"&&"nodeType"in target2?target2:null;const cell=this.lifecycleEditorCell;const cellElement=cell===null?void 0:this.lifecycleEditorCellElement(cell.rowIndex,cell.colIndex);if(targetNode===null||cellElement===void 0||!cellElement.contains(targetNode)){this.invalidateLifecycleEditorRequests();void this.editorFacade?.handleMouseStop()}}else if(this.lifecycleEditorCell!==null&&this.editingCell!==null){const target2=event.target;const targetNode=target2!==null&&typeof target2==="object"&&"nodeType"in target2?target2:null;const cellElement=this.lifecycleEditorCellElement(this.lifecycleEditorCell.rowIndex,this.lifecycleEditorCell.colIndex);if(targetNode===null||cellElement===void 0||!cellElement.contains(targetNode)){void this.cancelActiveEdit()}}if(!this.openFilterField)return;const target=event.target;if(target&&this.host.contains(target)){const inDropdown=target.closest?.(".sy-grid__filter-dropdown");const inIcon=target.closest?.(".sy-grid__filter-icon");if(inDropdown||inIcon)return}this.closeFilterDropdown(false)};handleWindowKeyDown(event){if(event.key==="Escape"&&this.openFilterField){this.closeFilterDropdown()}if(event.key==="Escape"&&this.contextMenuState!==null){this.closeContextMenu()}if(event.key==="Escape"&&this.csvWizard!==null){event.stopPropagation();this.cancelCsvWizard()}}commitPagination(next,source){const previous=this.activePagination;if(next===previous)return;if(next.pageIndex===previous.pageIndex&&next.pageSize===previous.pageSize){return}this.activePagination=next;this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange();const meta=this.latestPaginatedMeta;const totalRows=meta?.totalRows??0;const pageCount=meta?Math.max(1,Math.ceil(totalRows/next.pageSize)):1;this.paginationChanged.emit({pageIndex:next.pageIndex,pageSize:next.pageSize,pageCount,totalRows,previous})}handleGoToPage=pageIndex=>{if(!this.pagination)return;if(this.effectiveLoading)return;const next=goToPage(this.activePagination,pageIndex,this.latestPaginatedMeta);this.commitPagination(next,"go")};handlePrevPage=()=>{if(!this.pagination)return;if(this.effectiveLoading)return;const next=prevPage(this.activePagination);this.commitPagination(next,"prev")};handleNextPage=()=>{if(!this.pagination)return;if(this.effectiveLoading)return;const next=nextPage(this.activePagination,this.latestPaginatedMeta);this.commitPagination(next,"next")};handlePageSizeChange=rawValue=>{if(!this.pagination)return;if(this.effectiveLoading)return;const value=typeof rawValue==="number"?rawValue:Number(rawValue);if(typeof value!=="number"||!Number.isFinite(value)||!Number.isInteger(value)||value<1){console.warn(`[SG:PAGE] bad selection=${rawValue}`);return}const next=changePageSize(this.activePagination,value,this.latestPaginatedMeta);this.commitPagination(next,"size")};handlePaginationKeyDown=event=>{if(event.key==="ArrowLeft"){const target=event.target;if(target&&target.tagName==="SELECT")return;event.preventDefault();this.handlePrevPage()}else if(event.key==="ArrowRight"){const target=event.target;if(target&&target.tagName==="SELECT")return;event.preventDefault();this.handleNextPage()}};onQuickFilterTextPropChanged(newValue){const next=typeof newValue==="string"?newValue:"";const committedChanged=next!==this.quickFilterValue;const pendingChanged=next!==this.quickFilterPendingValue;if(!committedChanged&&!pendingChanged)return;this.cancelQuickFilterDebounce();if(committedChanged){this.quickFilterValue=next}this.quickFilterPendingValue=next;this.syncQuickFilterInputValue(next);if(committedChanged&&this.host?.isConnected){this.resetVirtualScrollPosition();this.recomputeVirtualWindow()}}onQuickFilterConfigChanged(){if(!this.host?.isConnected)return;this.resetVirtualScrollPosition();this.recomputeVirtualWindow()}onLoadingChanged(){this.updateLoadingState();if(!this.host?.isConnected)return;this.recomputeVirtualWindow()}onLoadingModeChanged(newValue,oldValue){if(newValue==="off"&&oldValue!=="off"){this.loadingDebouncer.clear();this.cancelLoadingDebounce()}this.updateLoadingState()}onMinLoadingDurationChanged(){this.loadingDebouncer.clear();this.cancelLoadingDebounce();this.loadingDebouncer=createLoadingDebouncer(this.minLoadingDuration);this.updateLoadingState()}updateLoadingState(){const raw=isLoadingActive({externalLoading:this.loading===true,mode:this.loadingMode??"manual"});const now=this.nowMs();const next=this.loadingDebouncer.update(raw,now);if(next!==this.effectiveLoading){this.effectiveLoading=next}this.cancelLoadingDebounce();if(next===true&&raw===false){const remaining=this.loadingDebouncer.remaining(now);this.loadingDebounceTimer=setTimeout(()=>{this.loadingDebounceTimer=null;const tickRaw=isLoadingActive({externalLoading:this.loading===true,mode:this.loadingMode??"manual"});const tickNext=this.loadingDebouncer.update(tickRaw,this.nowMs());if(tickNext!==this.effectiveLoading){this.effectiveLoading=tickNext;if(this.host?.isConnected){this.recomputeVirtualWindow()}}},remaining)}}cancelLoadingDebounce(){if(this.loadingDebounceTimer!==null){clearTimeout(this.loadingDebounceTimer);this.loadingDebounceTimer=null}}nowMs(){if(typeof performance!=="undefined"&&typeof performance.now==="function"){return performance.now()}return Date.now()}cancelQuickFilterDebounce(){if(this.quickFilterDebounceTimer!==null){clearTimeout(this.quickFilterDebounceTimer);this.quickFilterDebounceTimer=null}}commitQuickFilterValue(rawNext){const next=typeof rawNext==="string"?rawNext:"";const previous=this.quickFilterValue;this.quickFilterPendingValue=next;this.syncQuickFilterInputValue(next);if(next===previous)return;this.quickFilterValue=next;this.quickFilterChanged.emit({value:next,previous});this.scheduleLifecycleFilterPeerNotification();this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()}handleQuickFilterInput=event=>{const target=event.target;if(!target)return;if(this.effectiveLoading){target.value=this.quickFilterValue;return}const next=target.value;this.quickFilterPendingValue=next;const debounce=this.normalizedQuickFilterDebounce();if(debounce<=0){this.cancelQuickFilterDebounce();this.commitQuickFilterValue(next);return}this.cancelQuickFilterDebounce();this.quickFilterDebounceTimer=setTimeout(()=>{this.quickFilterDebounceTimer=null;this.commitQuickFilterValue(this.quickFilterPendingValue)},debounce)};handleQuickFilterKeyDown=event=>{if(this.effectiveLoading){if(event.key==="Escape"||event.key==="Enter"){event.preventDefault();this.syncQuickFilterInputValue(this.quickFilterValue)}return}if(event.key==="Escape"){event.preventDefault();this.cancelQuickFilterDebounce();const target=event.target;if(target)target.value="";this.commitQuickFilterValue("")}else if(event.key==="Enter"){event.preventDefault();this.cancelQuickFilterDebounce();this.commitQuickFilterValue(this.quickFilterPendingValue)}};handleQuickFilterClear=()=>{if(this.effectiveLoading)return;this.cancelQuickFilterDebounce();this.commitQuickFilterValue("")};normalizedQuickFilterDebounce(){const raw=this.quickFilterDebounce;const value=typeof raw==="number"?raw:Number(raw);if(!Number.isFinite(value))return 150;return Math.max(0,Math.floor(value))}syncQuickFilterInputValue(value){if(this.quickFilterInputEl&&this.quickFilterInputEl.value!==value){this.quickFilterInputEl.value=value}}shouldRenderQuickFilterToolbar(){return this.quickFilter===true&&this.usingColumnDefsApi()}hasAnyActiveFilter(){if(Object.keys(this.activeFilters).length>0)return true;const quick=typeof this.quickFilterValue==="string"?this.quickFilterValue:"";if(this.quickFilter===true&&quick.trim()!=="")return true;return false}resolveEmptyStateKind(){if(!this.usingColumnDefsApi())return"none";if(this.showEmptyState!==true)return"none";if(this.serverSideState!==null){const root=this.serverSideState.nodes[""];return root!==void 0&&root.lastRowKnown&&root.rowCount===0?"no-data":"none"}if(this.viewportState!==null){return this.viewportState.countReported&&this.viewportState.rowCount===0?"no-data":"none"}if(this.infiniteCache!==null){const cache=this.infiniteCache;return cache.lastRowKnown&&cache.rowCount===0?"no-data":"none"}const sourceRowCount=this.rowData?.length??0;const displayRowCount=this.getDisplayRows().length;return pickEmptyState({sourceRowCount,displayRowCount,loading:this.effectiveLoading===true,hasActiveFilters:this.hasAnyActiveFilter()})}handleEmptyStateClearFilters=()=>{const kind=this.resolveEmptyStateKind();const fields=Object.keys(this.activeFilters);if(fields.length>0){let currentMap=this.activeFilters;for(const field of fields){currentMap=clearActiveFilter(currentMap,field);this.filterChanged.emit({field,filter:null,activeMap:currentMap})}this.activeFilters=currentMap;this.scheduleLifecycleFilterPeerNotification()}const quickValue=typeof this.quickFilterValue==="string"?this.quickFilterValue:"";const quickPending=typeof this.quickFilterPendingValue==="string"?this.quickFilterPendingValue:"";const quickDomValue=this.quickFilterInputEl?.value??"";if(this.quickFilter===true&&(quickValue!==""||quickPending!==""||quickDomValue!=="")){this.cancelQuickFilterDebounce();this.commitQuickFilterValue("")}this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.emptyStateActionClicked.emit({kind,action:"clear-filters"})};normalizedPageSizeOptions(){const raw=Array.isArray(this.pageSizeOptions)?this.pageSizeOptions:DEFAULT_PAGE_SIZE_OPTIONS;const seen=new Set;const options=[];for(const option of raw){const value=Number(option);if(!Number.isFinite(value)||!Number.isInteger(value)||value<1){continue}if(seen.has(value))continue;seen.add(value);options.push(value)}const activeSize=this.activePagination.pageSize;if(options.length===0){options.push(activeSize);return options}if(!seen.has(activeSize)){options.push(activeSize);options.sort((a,b)=>a-b)}return options}activeColCount(){return this.resolvedColumnDefs().length}renderedColumnCount(){return this.resolvedColumnDefs().length+this.checkboxColumnOffset()}activeRowCount(){if(!this.usingColumnDefsApi())return 0;return this.getDisplayRows().length}isKeyboardNavEnabled(){if(!this.usingColumnDefsApi())return false;if(this.keyboardNavigation===false)return false;if(this.effectiveLoading)return false;if(this.openFilterField!==null)return false;return true}commitActiveCell(next,options={}){const previous=this.activeCell;if(previous===next)return;if(previous&&next&&previous.rowIndex===next.rowIndex&&previous.colIndex===next.colIndex){return}this.releaseFocusedLifecycleRenderer();this.activeCell=next;this.formulaBarDraft=null;this.formulaSuggest=null;if(options.scrollIntoView!==false&&next){this.pendingScrollIntoView=next}else if(next===null){this.pendingScrollIntoView=null}this.activeCellChanged.emit({active:next,previous});if(next!==null&&this.liveObjectModel!==null){const row=this.liveObjectModel.getDisplayedRowAtIndex(next.rowIndex);const column=this.resolvedColumnDefs()[next.colIndex];if(row){this.publishLiveObjectChange("row",row.id,"focused","ui",{before:previous,after:next,field:column?.field,data:row.getData()??void 0})}}}focusOutsideGridRoot(reverse){const doc=this.host.ownerDocument;if(!doc)return false;const gridRoot=this.host.querySelector(".sy-grid__grid");const boundary=gridRoot??this.viewportEl??this.host;const selector=["a[href]","button","input","select","textarea","[tabindex]"].join(",");const candidates=Array.from(doc.querySelectorAll(selector));const before=[];const after=[];const DOCUMENT_POSITION_PRECEDING=2;const DOCUMENT_POSITION_FOLLOWING=4;for(const el of candidates){if(boundary.contains(el))continue;if(!this.isFocusableForGridEscape(el))continue;const pos=boundary.compareDocumentPosition(el);if((pos&DOCUMENT_POSITION_PRECEDING)!==0)before.push(el);else if((pos&DOCUMENT_POSITION_FOLLOWING)!==0)after.push(el)}const target=reverse?before[before.length-1]:after[0];if(!target)return false;try{target.focus({preventScroll:true})}catch{target.focus()}this.releaseFocusedLifecycleRenderer();return true}gridOwnsDocumentFocus(){const activeElement=this.host.ownerDocument?.activeElement;return activeElement!==null&&activeElement!==void 0&&(activeElement===this.host||this.host.contains(activeElement))}isFocusableForGridEscape(el){if(el.hasAttribute("disabled"))return false;if(el.getAttribute("aria-disabled")==="true")return false;const tabIndexAttr=el.getAttribute("tabindex");if(tabIndexAttr!==null&&Number(tabIndexAttr)<0)return false;const view=el.ownerDocument.defaultView;if(view){const style=view.getComputedStyle(el);if(style.display==="none"||style.visibility==="hidden")return false}return typeof el.focus==="function"}handleViewportKeyDown=event=>{const kbTarget=event.target;if(kbTarget!==null&&kbTarget.closest!==void 0&&kbTarget.closest(".sy-grid__selection-checkbox")!==null){const hit=this.dgRow(event);if(hit!==null&&!this.isSentinelDisplayRow(hit.row)){this.handleBodyCheckboxKeyDown(hit.row,hit.rowIndex,event);if(event.defaultPrevented)return}}if(!this.isKeyboardNavEnabled())return;const rowCount=this.activeRowCount();const colCount=this.activeColCount();if(rowCount===0||colCount===0)return;if((event.ctrlKey||event.metaKey)&&(event.key==="c"||event.key==="C")&&this.editStore.active===null){if(!copyNeedsRangeClipboard(this.normalizedRanges())&&this.hostTextSelected())return;event.preventDefault();void this.copySelectionToClipboard();return}switch(event.key){case"ArrowUp":{event.preventDefault();if(event.shiftKey&&this.rangeSelectionActive()){this.extendRangeByKeyboard("up",rowCount,colCount);return}if(!event.shiftKey&&this.enterPinnedBandFromBody("up"))return;const next=this.spanAwareMove("up",this.skipDetailRows(moveCell(this.activeCell,"up",rowCount,colCount),"up",rowCount,colCount));this.commitActiveCell(next);return}case"ArrowDown":{event.preventDefault();if(event.shiftKey&&this.rangeSelectionActive()){this.extendRangeByKeyboard("down",rowCount,colCount);return}if(!event.shiftKey&&this.enterPinnedBandFromBody("down"))return;const next=this.spanAwareMove("down",this.skipDetailRows(moveCell(this.activeCell,"down",rowCount,colCount),"down",rowCount,colCount));this.commitActiveCell(next);return}case"ArrowLeft":{event.preventDefault();if(this.activeCell!==null&&this.isFullWidthDisplayRow(this.activeCell.rowIndex))return;if(event.shiftKey&&this.rangeSelectionActive()){this.extendRangeByKeyboard("left",rowCount,colCount);return}const activeRow=this.activeCell!==null?this.getDisplayRows()[this.activeCell.rowIndex]:void 0;if(isGroupMarkerRow(activeRow)&&activeRow.expanded){void this.applyRowGroupExpanded(activeRow.key,false,"ui");return}if(isTreeNodeRow(activeRow)&&activeRow.hasChildren&&activeRow.expanded){void this.applyTreeNodeExpanded(activeRow.path,false,"ui");return}const next=this.spanAwareMove("left",moveCellWithWrap(this.activeCell,"left",rowCount,colCount));this.commitActiveCell(next);return}case"ArrowRight":{event.preventDefault();if(this.activeCell!==null&&this.isFullWidthDisplayRow(this.activeCell.rowIndex))return;if(event.shiftKey&&this.rangeSelectionActive()){this.extendRangeByKeyboard("right",rowCount,colCount);return}const activeRow=this.activeCell!==null?this.getDisplayRows()[this.activeCell.rowIndex]:void 0;if(isGroupMarkerRow(activeRow)&&!activeRow.expanded){void this.applyRowGroupExpanded(activeRow.key,true,"ui");return}if(isTreeNodeRow(activeRow)&&activeRow.hasChildren&&!activeRow.expanded){void this.applyTreeNodeExpanded(activeRow.path,true,"ui");return}const next=this.spanAwareMove("right",moveCellWithWrap(this.activeCell,"right",rowCount,colCount));this.commitActiveCell(next);return}case"Tab":{if(this.focusOutsideGridRoot(event.shiftKey)){event.preventDefault()}return}case"Enter":{if(this.activeCell===null)return;if(this.editingCell===null&&this.editType==="fullRow"){const sessionRowId=this.rowEditSessionRowId();if(sessionRowId!==null&&this.activeCellRowId()===sessionRowId){event.preventDefault();void this.finishRowEditSession("commit");return}}event.preventDefault();const rows=this.getDisplayRows();const row=rows[this.activeCell.rowIndex];const col=this.resolvedColumnDefs()[this.activeCell.colIndex];if(row===void 0||!col)return;if(this.isFullWidthDisplayRow(this.activeCell.rowIndex)){const rowEl=this.viewportEl?.querySelector?.(`.sy-grid__full-width-row[data-row-index="${this.activeCell.rowIndex}"]`);const focusable=rowEl?.querySelector?.('.sy-grid__full-width-host a[href], .sy-grid__full-width-host button, .sy-grid__full-width-host input, .sy-grid__full-width-host select, .sy-grid__full-width-host textarea, .sy-grid__full-width-host [tabindex]:not([tabindex="-1"])');if(focusable!==null&&focusable!==void 0){try{focusable.focus({preventScroll:true})}catch{focusable.focus()}}return}if(isGroupMarkerRow(row)){void this.applyRowGroupExpanded(row.key,!row.expanded,"ui");return}if(isTreeNodeRow(row)){if(row.hasChildren){void this.applyTreeNodeExpanded(row.path,!row.expanded,"ui")}else if(row.row!==null){this.cellClicked.emit({row:row.row,rowIndex:this.activeCell.rowIndex,colIndex:this.activeCell.colIndex,field:col.field})}return}if(isGroupFooterRow(row)||isDetailRow(row))return;if(isLoadingPlaceholderRow(row))return;this.cellClicked.emit({row,rowIndex:this.activeCell.rowIndex,colIndex:this.activeCell.colIndex,field:col.field});if(col.editable===true&&this.passesEditPolicy(this.activeCell.rowIndex,col,row)){this.beginCellEdit(this.activeCell.rowIndex,this.activeCell.colIndex,"keyboard",event)}return}case"Escape":{if(this.editingCell!==null){event.preventDefault();if(this.editorFacade!==null&&this.editorFacade.lookup().status!=="idle"){this.invalidateLifecycleEditorRequests();void this.editorFacade.stop("escape",{cancel:true});return}const cancelled=this.editingCell;this.invalidateLifecycleEditorRequests();this.editingCell=null;this.unregisterLifecycleEditorDocumentOwner();this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelled.rowIndex,colIndex:cancelled.colIndex});return}if(this.editType==="fullRow"&&this.rowEditSessionRowId()!==null){event.preventDefault();void this.finishRowEditSession("cancel");return}if(this.rangeState.ranges.length>0||this.rangeState.dragging!==null){event.preventDefault();void this.clearCellRanges();return}if(this.activeCell===null)return;event.preventDefault();this.commitActiveCell(null);return}case"Home":{event.preventDefault();const useGridJump=event.ctrlKey||event.metaKey;const next=useGridJump?homeGridCell(rowCount,colCount):homeCell(this.activeCell,colCount);this.commitActiveCell(this.skipDetailRows(next,"down",rowCount,colCount));return}case"End":{event.preventDefault();const useGridJump=event.ctrlKey||event.metaKey;const next=useGridJump?endGridCell(rowCount,colCount):endCell(this.activeCell,colCount);this.commitActiveCell(this.skipDetailRows(next,"up",rowCount,colCount));return}case"PageUp":{event.preventDefault();const pageSize=this.viewportRowCount();const next=pageCell(this.activeCell,"up",pageSize,rowCount,colCount);this.commitActiveCell(this.skipDetailRows(next,"up",rowCount,colCount));return}case"PageDown":{event.preventDefault();const pageSize=this.viewportRowCount();const next=pageCell(this.activeCell,"down",pageSize,rowCount,colCount);this.commitActiveCell(this.skipDetailRows(next,"down",rowCount,colCount));return}case"F2":{if(this.activeCell===null)return;if(event.shiftKey){const rows=this.getDisplayRows();const row=rows[this.activeCell.rowIndex];const field=this.resolvedColumnDefs()[this.activeCell.colIndex]?.field;if(row!==void 0&&row!==null&&typeof row==="object"&&typeof field==="string"&&this.collabSession!==null){event.preventDefault();this.openCommentPanelAt(this.collabRowId(row,this.activeCell.rowIndex),field)}return}if(this.beginCellEdit(this.activeCell.rowIndex,this.activeCell.colIndex,"keyboard",event)){event.preventDefault()}return}case" ":case"Spacebar":{if(this.activeCell===null||!this.masterDetailActive())return;const spaceRow=this.getDisplayRows()[this.activeCell.rowIndex];if(spaceRow===void 0||spaceRow===null||typeof spaceRow!=="object")return;const detailId=this.detailRowIds.get(spaceRow);if(detailId===void 0)return;event.preventDefault();void this.applyDetailRowExpanded(detailId,!this.expandedDetailRows.has(detailId),"ui");return}default:return}};viewportRowCount(){const measured=this.viewportSize?.height;let height;if(typeof measured==="number"&&Number.isFinite(measured)&&measured>0){height=measured}else{height=this.estimatedViewportHeight()}const rowH=this.uniformRowHeight();if(!Number.isFinite(rowH)||rowH<=0)return 1;const rows=Math.floor(height/rowH);return rows>0?rows:1}handleCellMouseClick=(row,rowIndex,colIndex,field,event)=>{if(!this.usingColumnDefsApi())return;if(this.effectiveLoading)return;const intent=this.classifyCellClick(rowIndex,field,event);this.cellClicked.emit({row,rowIndex,colIndex,field,button:intent.button,modifiers:intent.modifiers,doubleClick:intent.doubleClick,dragged:intent.dragged});if(intent.doubleClick){this.cellDoubleClicked.emit({row,rowIndex,colIndex,field,button:intent.button,modifiers:intent.modifiers})}this.emitRowClicked(row,rowIndex,event);if(!(this.rangeSelectionActive()&&event?.shiftKey)){this.applyRowClickSelection(row,rowIndex,event)}if(this.keyboardNavigation===false)return;this.commitActiveCell({rowIndex,colIndex},{scrollIntoView:false});if(this.viewportEl&&document.activeElement!==this.viewportEl){this.viewportEl.focus({preventScroll:true})}if(intent.doubleClick){this.beginCellEdit(rowIndex,colIndex,"mouse",event??null)}const plainClick=!intent.dragged&&!intent.doubleClick&&intent.button==="left"&&!intent.modifiers.ctrl&&!intent.modifiers.shift&&!intent.modifiers.meta&&!intent.modifiers.alt;if(plainClick){if(this.cellCommentBadge(row,rowIndex,field)!==null){this.openCommentPanelAt(this.collabRowId(row,rowIndex),field)}else if(this.commentPanel!==null){this.closeCommentPanel()}}};lastCellClickedAt;lastCellClickedKey;lastCellMouseDown;lastRowMouseDown;lastRowClickedAt;lastRowClickedIndex;rangeSelectionActive(){return this.rangeSelection===true&&this.usingColumnDefsApi()&&this.proAllowed("grid.range-selection","rangeSelection")&&this.proUiChunk("range-selection","grid.range-selection","rangeSelection")!=null}rowReorderEnabled(){return this.rowDragManaged===true&&this.usingColumnDefsApi()&&this.infiniteCache===null&&this.pagination!==true&&this.activeSortModel.length===0&&Object.keys(this.activeFilters).length===0&&this.activeConditionTree===null&&(this.quickFilterValue??"")===""&&this.effectiveGroupFields()===null&&this.treeSurface()===null&&!this.masterDetailActive()}cellChangeFlashActive(){return this.cellChangeFlash===true||this.enableCellChangeFlash===true}flashCell(rowIndex,field){if(!this.cellChangeFlashActive()||typeof window==="undefined")return;if(typeof field!=="string"||field==="")return;const key=cellFlashKey(rowIndex,field);const existing=this.flashTimers.get(key);if(existing!==void 0)clearTimeout(existing);const next=addFlash(this.flashingCells,key);if(next!==this.flashingCells)this.flashingCells=next;const timer=setTimeout(()=>{this.flashTimers.delete(key);const cleared=removeFlash(this.flashingCells,key);if(cleared!==this.flashingCells)this.flashingCells=cleared},CELL_FLASH_DURATION_MS);this.flashTimers.set(key,timer)}handleRowDragStart(displayIndex,event){if(!this.rowReorderEnabled()||event.button!==0)return;if(typeof document==="undefined")return;event.preventDefault();event.stopPropagation();this.rowDragState=beginRowDrag(displayIndex);const onMove=e=>this.handleRowDragMove(e);const onUp=e=>this.handleRowDragEnd(e);document.addEventListener("mousemove",onMove,true);document.addEventListener("mouseup",onUp,true);this.rowDragCleanup=()=>{document.removeEventListener("mousemove",onMove,true);document.removeEventListener("mouseup",onUp,true);this.rowDragCleanup=null}}handleRowDragMove(event){if(this.rowDragState===null)return;const hit=this.rowIndexAtPoint(event.clientX,event.clientY);const next=hit===null?updateRowDragOver(this.rowDragState,null,"below"):updateRowDragOver(this.rowDragState,hit.index,hit.position);if(next!==this.rowDragState)this.rowDragState=next}handleRowDragEnd(_event){const state=this.rowDragState;if(this.rowDragCleanup)this.rowDragCleanup();this.rowDragState=null;if(state===null)return;const source=this.rowData??[];const insertion=dropInsertionIndex(state);const reordered=reorderRows(source,state.sourceIndex,insertion);if(reordered===source)return;const movedRow=source[state.sourceIndex];const toIndex=reordered.indexOf(movedRow);this.rowData=reordered;this.rowMoved.emit({fromIndex:state.sourceIndex,toIndex,row:movedRow})}rowIndexAtPoint(x,y){if(typeof document==="undefined")return null;const el=document.elementFromPoint(x,y);const rowEl=el?.closest(".sy-grid__row[data-row-index]");if(rowEl===null||this.host!==void 0&&!this.host.contains(rowEl))return null;const idx=Number(rowEl.getAttribute("data-row-index"));if(!Number.isInteger(idx))return null;const rect=rowEl.getBoundingClientRect();const position=y<rect.top+rect.height/2?"above":"below";return{index:idx,position}}renderRowDragHandle(rowIndex,col){if(col.rowDrag!==true)return null;const managed=this.rowReorderEnabled();const unmanaged=!managed&&this.unmanagedRowDragEnabled();if(!managed&&!unmanaged)return null;const label=t(this.resolvedMessages,"a11y.rowDragHandle",{row:rowIndex+1});return index.h("span",{class:{"sy-grid__row-drag-handle":true,"sy-grid__row-drag-handle--unmanaged":unmanaged},role:"button","aria-label":label,title:label,tabindex:unmanaged?0:void 0,"data-row-drag-handle":unmanaged?"unmanaged":"managed",onPointerDown:unmanaged?event=>this.handleUnmanagedDragPointerDown(rowIndex,event):void 0,onKeyDown:unmanaged?event=>this.handleUnmanagedDragKeyDown(rowIndex,event):void 0},index.h("span",{class:"sy-grid__row-drag-grip","aria-hidden":"true"},"⠿"))}rowDragDropClass(rowIndex){const state=this.rowDragState;if(state!==null){const isTarget=state.overIndex===rowIndex;return{dragging:state.sourceIndex===rowIndex,above:isTarget&&state.position==="above",below:isTarget&&state.position==="below",into:false}}const target=this.unmanagedDragTarget;const own=target!==null&&this.rowDragBinding!==null&&target.zoneId===this.rowDragBinding.zoneId&&target.rowIndex===rowIndex;return{dragging:this.unmanagedDragSource===rowIndex,above:own&&target!==null&&target.position==="above",below:own&&target!==null&&target.position==="below",into:own&&target!==null&&target.position==="into"}}normalizedRanges(){return this.rangeState.ranges.map(normalizeRange)}emitRangeChange(){this.rangeSelectionChanged.emit({ranges:this.normalizedRanges()})}isSentinelDisplayRow(row){return isGroupMarkerRow(row)||isGroupFooterRow(row)||isTreeNodeRow(row)||isDetailRow(row)||isLoadingPlaceholderRow(row)||isPivotRowGroupMarker(row)||isPivotGrandTotalRow(row)||this.isPivotSubtotalDisplayRow(row)}handleRangeDragStart(rowIndex,colIndex,event){if(!this.rangeSelectionActive())return;this.proUiChunks["range-selection"]?.handleRangeDragStart(this.rangeSelectionHost(),rowIndex,colIndex,event)}extendRangeByKeyboard(direction,rowCount,colCount){this.proUiChunks["range-selection"]?.extendRangeByKeyboard(this.rangeSelectionHost(),direction,rowCount,colCount)}handleRangeDragEnter(rowIndex,colIndex,event){if(this.rangeState.dragging===null)return;this.proUiChunks["range-selection"]?.handleRangeDragEnter(this.rangeSelectionHost(),rowIndex,colIndex,event)}finishRangeDrag=()=>{if(this.rangeState.dragging===null)return;this.proUiChunks["range-selection"]?.finishRangeDrag(this.rangeSelectionHost())};rangeCellClasses(rowIndex,colIndex){const chunk=this.proUiChunks["range-selection"];return chunk===void 0?{}:chunk.rangeCellClasses(this.rangeSelectionHost(),rowIndex,colIndex)}onRangeSelectionChange(newValue){if(newValue===true)return;document.removeEventListener("mouseup",this.finishRangeDrag);if(this.rangeState.ranges.length>0||this.rangeState.dragging!==null){this.rangeState={ranges:[],dragging:null};this.emitRangeChange()}}clampRangesAfterChange(){if(this.rangeState.ranges.length===0&&this.rangeState.dragging===null)return;this.proUiChunks["range-selection"]?.clampRangesAfterChange(this.rangeSelectionHost())}copyableDataRowAt(rows,rowIndex){const row=rows[rowIndex];if(row===void 0||row===null)return null;if(isTreeNodeRow(row)){return row.filler||row.row===null||row.row===void 0?null:row.row}if(this.isSentinelDisplayRow(row))return null;return row}readPolicyConfigured(){return this.canReadCell!==null&&this.canReadCell!==void 0}editPolicyConfigured(){return this.canEditCell!==null&&this.canEditCell!==void 0}isCellReadable(rawValue,row,rowIndex,col){const policy=this.canReadCell;if(policy===null||policy===void 0)return true;return resolveCellReadable({rowIndex,field:col.field,colId:col.colId??col.field,data:row,value:rawValue},policy,err=>{if(this.canReadWarned)return;this.canReadWarned=true;console.warn("[SG:POLICY] read bad; mask fail-closed",err)})}applyReadMask(rawValue,row,rowIndex,col){if(!this.readPolicyConfigured())return rawValue;return maskCellValue(rawValue,this.isCellReadable(rawValue,row,rowIndex,col),this.maskedCellValue)}passesEditPolicy(rowIndex,col,row){if(this.readPolicyConfigured()&&!this.isCellReadable(this.rawFieldValue(row,rowIndex,col),row,rowIndex,col)){return false}const policy=this.canEditCell;if(policy===null||policy===void 0)return true;return resolveCellEditable({rowIndex,field:col.field,colId:col.colId??col.field,data:row,value:this.rawFieldValue(row,rowIndex,col)},policy,err=>{if(this.canEditWarned)return;this.canEditWarned=true;console.warn("[SG:POLICY] edit bad; block fail-closed",err)})}passesEditPolicyAt(rowIndex,colIndex){if(!this.readPolicyConfigured()&&!this.editPolicyConfigured())return true;const col=this.effectiveColumns()[colIndex];const row=this.getDisplayRows()[rowIndex];if(!col||row===void 0||row===null||typeof row!=="object")return true;return this.passesEditPolicy(rowIndex,col,row)}validateCell(row,rowIndex,col){if(this.validationRules===void 0||this.validationRules.length===0)return{valid:true};return evaluateValidation(this.validationRules,{field:col.field,value:this.rawFieldValue(row,rowIndex,col),data:row})}async getValidationErrors(){if(this.validationRules===void 0||this.validationRules.length===0)return[];const rows=this.getDisplayRows();const cols=this.resolvedColumnDefs();const out=[];for(let r=0;r<rows.length;r++){const row=rows[r];if(row===void 0||row===null||typeof row!=="object"||this.isSentinelDisplayRow(row))continue;const data=row;for(const col of cols){if(typeof col.field!=="string"||col.field==="")continue;const rawValue=this.rawFieldValue(data,r,col);if(this.readPolicyConfigured()&&!this.isCellReadable(rawValue,data,r,col))continue;const res=this.validateCell(data,r,col);if(!res.valid){out.push({rowIndex:r,rowId:this.extractRowId(row,r),field:col.field,value:rawValue,message:res.message??"Invalid value"})}}}return out}async captureSnapshot(name){const id=`snap-${++this.snapshotCounter}`;const label=typeof name==="string"&&name.trim()!==""?name.trim():`Snapshot ${this.snapshotCounter}`;const rows=this.rowData??[];const snap=createSnapshot(rows,{id,name:label,ts:Date.now()});this.snapshotStore=addSnapshot(this.snapshotStore,snap,this.maxSnapshots);this.snapshotCaptured.emit({id,name:label,rowCount:snap.rows.length});return id}async listSnapshots(){return this.snapshotStore.map(s=>snapshotMeta(s))}async deleteSnapshot(id){const before=this.snapshotStore.length;this.snapshotStore=removeSnapshot(this.snapshotStore,id);return this.snapshotStore.length<before}snapshotRowIdentity(row,index2){if(typeof this.getRowId==="function"){return this.getRowId(row)}const id=row.id;return id===void 0||id===null?`__index_${index2}`:id}snapshotRowById(rows,rowId){for(let rowIndex=0;rowIndex<rows.length;rowIndex+=1){if(structuralEqual(this.snapshotRowIdentity(rows[rowIndex],rowIndex),rowId)){return{data:rows[rowIndex],rowIndex}}}return null}snapshotRowByValue(rows,target){for(let rowIndex=0;rowIndex<rows.length;rowIndex+=1){if(structuralEqual(rows[rowIndex],target)){return{data:rows[rowIndex],rowIndex}}}return null}snapshotDiffForPublicRead(diff,before,after){if(!this.readPolicyConfigured())return diff;const columns=this.resolvedColumnDefs();const byField=new Map(columns.map(col=>[col.field,col]));const maskRow=(detached,context)=>{const policyData=context?.data??detached;const rowIndex=context?.rowIndex??-1;return this.maskDeniedFields(detached,rowIndex,columns,policyData)};return{added:diff.added.map(row=>maskRow(row,this.snapshotRowByValue(after,row))),removed:diff.removed.map(row=>maskRow(row,this.snapshotRowByValue(before,row))),changed:diff.changed.map(change=>{const beforeContext=this.snapshotRowById(before,change.rowId);const afterContext=this.snapshotRowById(after,change.rowId);return{rowId:change.rowId,fields:change.fields.map(field=>{const col=byField.get(field.field)??{field:field.field};return{field:field.field,before:this.applyReadMask(field.before,beforeContext?.data??null,beforeContext?.rowIndex??-1,col),after:this.applyReadMask(field.after,afterContext?.data??null,afterContext?.rowIndex??-1,col)}})}}),summary:{...diff.summary}}}async diffSnapshots(idA,idB){const before=getSnapshot(this.snapshotStore,idA)?.rows??[];const after=idB===void 0?this.rowData??[]:getSnapshot(this.snapshotStore,idB)?.rows??[];const rowId=typeof this.getRowId==="function"?row=>this.getRowId(row):void 0;const rawDiff=diffSnapshots(before,after,rowId);return this.snapshotDiffForPublicRead(rawDiff,before,after)}async restoreSnapshot(id){const snap=getSnapshot(this.snapshotStore,id);if(snap===null)return false;const current=this.rowData??[];const restored=deepCloneRows(snap.rows);const idOf=(row,index2)=>{let value;try{if(typeof this.getRowId==="function"){value=this.getRowId(row)}else{const candidate=row.id;value=candidate===null||candidate===void 0?`__i${index2}`:candidate}}catch{return null}if(typeof value==="string"&&value.length>0)return value;if(typeof value==="number"&&Number.isFinite(value))return value;return null};const indexRows2=rows=>{const indexed=new Map;for(let index2=0;index2<rows.length;index2+=1){const row=rows[index2];const rowId=idOf(row,index2);if(rowId===null||indexed.has(rowId))return null;indexed.set(rowId,{row,index:index2})}return indexed};const currentById=indexRows2(current);const restoredById=indexRows2(restored);if(currentById===null||restoredById===null){console.warn("[SG:SNAPSHOT] bad/dup row id; reject");return false}const added=[];const updated=[];for(const[rowId,entry]of restoredById){const previous=currentById.get(rowId);if(previous===void 0)added.push(entry);else if(!structuralEqual(previous.row,entry.row)){updated.push({row:entry.row,previous:previous.row,index:entry.index})}}const removed=[];for(const[rowId,entry]of currentById){if(!restoredById.has(rowId))removed.push(entry)}this.rowData=restored;this.fireRowDataChanged({added,updated,removed,rejected:[],txId:allocateTxId(),source:"local"});this.snapshotRestored.emit({id:snap.id,name:snap.name,rowCount:restored.length});return true}rawFieldValue(row,rowIndex,col){return this.resolveGridCellValue({row,rowIndex,colId:col.colId??col.field,field:col.field,valueGetter:col.valueGetter,colDef:col})}maskDeniedFields(row,rowIndex,columns,policyData=row,policyRowIndex=rowIndex){let clone={...row};for(const col of columns){if(!this.isCellReadable(this.rawFieldValue(policyData,rowIndex,col),policyData,policyRowIndex,col)){clone=setOwnFieldPathImmutable(clone,col.field,this.maskedCellValue)}}return clone}maskRowsForRead(rows,columns){if(!this.readPolicyConfigured())return rows;return rows.map((row,i)=>this.maskDeniedFields(row,i,columns,row,-1))}cellDisplayText(rowIndex,colIndex,rows,cols){const row=this.copyableDataRowAt(rows,rowIndex);if(row===null)return"";const col=cols[colIndex];if(!col)return"";const rawValue=this.cellRawValue(row,rowIndex,col);if(this.readPolicyConfigured()&&!this.isCellReadable(rawValue,row,rowIndex,col)){return this.maskedCellValue}const formatterRow=this.readPolicyConfigured()?this.maskDeniedFields(row,rowIndex,cols):row;const value=this.readPolicyConfigured()&&(typeof col.valueGetter==="function"||typeof col.valueGetter==="string")?this.resolveGridCellValue({row:formatterRow,rowIndex,colId:col.colId??col.field,field:col.field,valueGetter:col.valueGetter,colDef:col}):rawValue;if(col.valueFormatter!==void 0&&col.valueFormatter!==null){return this.formatGridCellValue({value,row:formatterRow,rowIndex,colId:col.colId??col.field,valueFormatter:col.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef:col})}return value==null?"":value}formulaCellDisplay(sheet,raw,field,row){return this.formulaFreeze.showsRaw(sheet,field,row)?raw:sheet.computeDisplay(raw,field,row)}formulaWorkHeld(){const gate=this.proGateRef;if(gate===null||this.formulas!==true||!gate.frozen("grid.formulas"))return false;this.formulaFreeze.holdRebuild();return true}cellRawValue(row,rowIndex,col){const resolvedColId=col.colId??col.field;let value=this.resolveGridCellValue({row,rowIndex,colId:resolvedColId,field:col.field,valueGetter:col.valueGetter,colDef:col});if(this.formulaSheet!==null&&this.formulaSheet.isCalculatedField(col.field)){return this.showFormulas===true?col.formula??"":this.formulaSheet.calculatedDisplay(col.field,row)}if(this.formulaSheetSeeding&&isFormulaText(value)){if(this.showFormulas===true)return value;return this.formulaSheet!==null&&this.formulaSheet.canRevealDuringSeed(value,row)?this.formulaSheet.computeDisplay(value,col.field,row):""}if(this.formulaSheet!==null&&this.formulaSheet.active&&isFormulaText(value)){value=this.showFormulas===true?value:this.formulaCellDisplay(this.formulaSheet,value,col.field,row)}return value}async writeClipboardText(text){try{if(typeof navigator!=="undefined"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(text);return true}}catch{}const prevFocus=this.host.shadowRoot?.activeElement??document.activeElement;const area=document.createElement("textarea");area.value=text;area.style.position="fixed";area.style.opacity="0";document.body.appendChild(area);area.select();let ok=false;try{ok=document.execCommand("copy")}catch{ok=false}finally{area.remove();if(prevFocus!==null&&typeof prevFocus.focus==="function")prevFocus.focus()}return ok}async copySelectionToClipboard(){if(!this.usingColumnDefsApi())return false;let ranges=this.normalizedRanges();if(copyNeedsRangeClipboard(ranges)){const gate=this.proGate();if(gate.awaiting(["grid.range-clipboard"]))await gate.settle(["grid.range-clipboard"]);if(gate.refuseRequest(["grid.range-clipboard"],"copy").length>0)ranges=[];else if(!this.proModuleAvailable("grid.range-clipboard","copy","range-selection"))ranges=[]}const boundsList=ranges.length>0?ranges:this.activeCell!==null?[{top:this.activeCell.rowIndex,left:this.activeCell.colIndex,bottom:this.activeCell.rowIndex,right:this.activeCell.colIndex}]:[];if(boundsList.length===0)return false;const rows=this.getDisplayRows();const cols=this.effectiveColumns();const text=serializeManyBoundsToTsv(boundsList,(r,c)=>this.spanAwareCellText(r,c,rows,cols),r=>this.copyableDataRowAt(rows,r)!==null,{escapeFormulae:this.clipboardEscapeFormulae});if(text==="")return false;if(!await this.writeClipboardText(text)){console.warn("[SG:CLIP] no write; copy fails");return false}this.clipboardCopied.emit({text,ranges:boundsList});return true}hostTextSelected(){try{const selection=typeof document!=="undefined"?document.getSelection():null;if(selection===null||selection.isCollapsed||selection.rangeCount===0)return false;const{anchorNode,focusNode}=selection;return anchorNode!==null&&focusNode!==null&&this.host.contains(anchorNode)&&this.host.contains(focusNode)}catch{return false}}async getCellRanges(){return this.proRun("getCellRanges",()=>this.normalizedRanges())}async copyRangeToClipboard(){return this.proMethod("copyRangeToClipboard",{load:()=>this.loadRangeSelectionChunk(),exec:()=>void 0,publish:()=>this.copySelectionToClipboard()})}coercePastedValue(raw,col,row){if(typeof col.valueParser==="function"){try{return col.valueParser({value:raw,oldValue:readOwnFieldPath(row,col.field),field:col.field,row,colDef:col,context:this.context,api:this.host})}catch{return raw}}if(col.editor==="text")return raw;return detectPastedValue(raw)}pasteUndoWarned=false;undoableRowId(row){const fn=this.getRowId??(r=>r["id"]);try{const id=fn(row);if(typeof id==="string"&&id.length>0)return id;if(typeof id==="number"&&Number.isFinite(id))return id}catch{}return null}commitPastePlan(plan){if(plan.changes.length===0)return[];const source=this.rowData??[];const sourceIndex=new Map;for(let i=0;i<source.length;i++)sourceIndex.set(source[i],i);const byRow=new Map;for(const change of plan.changes){const bucket=byRow.get(change.row);if(bucket===void 0)byRow.set(change.row,[change]);else bucket.push(change)}const editPolicy=this.editPolicyConfigured()||this.readPolicyConfigured();const colIndexByField=editPolicy?new Map(this.resolvedColumnDefs().map((cd,i)=>[cd.field,i])):null;const next=source.slice();const updatedEntries=[];for(const[rowObj,cells]of byRow){const idx=sourceIndex.get(rowObj);if(idx===void 0)continue;let merged={...rowObj};let applied=0;for(const c of cells){if(editPolicy&&colIndexByField!==null){const cIdx=colIndexByField.get(c.field);const col=cIdx===void 0?void 0:this.resolvedColumnDefs()[cIdx];if(col===void 0||!this.passesEditPolicy(idx,col,rowObj)){continue}}const updated=setOwnFieldPathImmutable(merged,c.field,c.newValue);if(updated===merged)continue;merged=updated;applied++}if(applied===0)continue;next[idx]=merged;updatedEntries.push({row:merged,previous:rowObj,index:idx})}if(updatedEntries.length===0)return[];this.rowData=next;const pasteTxId=allocateTxId();this.fireRowDataChanged({added:[],updated:updatedEntries,removed:[],rejected:[],txId:pasteTxId,source:"local",origin:"clipboard"});const changes=this.emitCellValueChanges(updatedEntries,"local","clipboard",pasteTxId);this.recordPasteUndo(updatedEntries);return changes}recordPasteUndo(updatedEntries){const forward=[];const inverse=[];for(const u of updatedEntries){if(this.undoableRowId(u.previous)===null){if(!this.pasteUndoWarned){this.pasteUndoWarned=true;console.warn("[SG:CLIP] no row id; paste not undoable")}return}forward.push({...u.row});inverse.push({...u.previous})}this.undoRedoStack.record({update:forward},{update:inverse},"clipboard-paste")}applyClipboardText(text,parsed){if(!this.usingColumnDefsApi())return false;const ranges=this.normalizedRanges();const origin=ranges.length>0?{top:ranges[0].top,left:ranges[0].left}:this.activeCell!==null?{top:this.activeCell.rowIndex,left:this.activeCell.colIndex}:null;if(origin===null)return false;const matrix=parsed??parseTsv(text);if(matrix.length===0)return false;if(pasteNeedsRangeClipboard(matrix)&&this.proGate().refuseRequest(["grid.range-clipboard"],"paste").length>0){return false}if(pasteNeedsRangeClipboard(matrix)&&!this.proModuleAvailable("grid.range-clipboard","paste","range-selection")){return false}const rows=this.getDisplayRows();const cols=this.effectiveColumns();const plan=planPaste(matrix,origin.top,origin.left,{rowCount:rows.length,dataRowAt:i=>{const row=rows[i];if(row===void 0||row===null||this.isSentinelDisplayRow(row))return null;return row},colAt:c=>{const col=cols[c];return col===void 0?void 0:{field:col.field,editable:col.editable===true,computed:typeof col.valueGetter==="function"||typeof col.valueGetter==="string"}},coerce:(raw,c,row)=>this.coercePastedValue(raw,cols[c],row)});const changes=this.commitPastePlan(plan);const applied=changes.length;this.clipboardPasted.emit({applied,skipped:plan.skipped+Math.max(0,plan.applied-applied),top:origin.top,left:origin.left,changes});return applied>0}handleViewportPaste=event=>{if(!this.usingColumnDefsApi())return;if(this.editStore.active!==null)return;const text=event.clipboardData?.getData("text/plain")??"";if(text==="")return;event.preventDefault();const matrix=parseTsv(text);if(pasteNeedsRangeClipboard(matrix)&&this.proGate().awaiting(["grid.range-clipboard"])){void this.proGate().settle(["grid.range-clipboard"]).then(()=>{if(!this.hasDisconnected&&this.editStore.active===null)this.applyClipboardText(text,matrix)});return}this.applyClipboardText(text,matrix)};async pasteFromClipboard(){return this.proMethod("pasteFromClipboard",{load:()=>this.loadRangeSelectionChunk(),exec:async()=>{try{return await navigator.clipboard.readText()}catch{console.warn("[SG:CLIP] no read; skip paste");return null}},publish:text=>text===null?false:this.applyClipboardText(text)})}async clearCellRanges(){return this.proRun("clearCellRanges",()=>{if(this.rangeState.ranges.length===0&&this.rangeState.dragging===null)return;this.rangeState={ranges:[],dragging:null};this.emitRangeChange()})}handleCellMouseDown=(rowIndex,field,event)=>{if(!this.usingColumnDefsApi())return;if(this.effectiveLoading)return;const snapshot=this.snapshotMouseEvent(event);this.lastCellMouseDown={key:this.cellClickKey(rowIndex,field),event:snapshot};this.lastRowMouseDown={rowIndex,event:snapshot}};classifyCellClick(rowIndex,field,event){const now=typeof performance!=="undefined"&&typeof performance.now==="function"?performance.now():Date.now();const key=this.cellClickKey(rowIndex,field);const upEvent=this.snapshotMouseEvent(event);const downEvent=this.lastCellMouseDown?.key===key?this.lastCellMouseDown.event:upEvent;const intent=classifyRowClick({downEvent,upEvent,timestamp:now,lastClickAt:this.lastCellClickedKey===key?this.lastCellClickedAt:void 0});if(this.lastCellMouseDown?.key===key)this.lastCellMouseDown=void 0;this.lastCellClickedAt=now;this.lastCellClickedKey=key;return intent}emitRowClicked(row,rowIndex,event){const now=typeof performance!=="undefined"&&typeof performance.now==="function"?performance.now():Date.now();const upEvent=this.snapshotMouseEvent(event);const downEvent=this.lastRowMouseDown?.rowIndex===rowIndex?this.lastRowMouseDown.event:upEvent;const intent=classifyRowClick({downEvent,upEvent,timestamp:now,lastClickAt:this.lastRowClickedIndex===rowIndex?this.lastRowClickedAt:void 0});this.rowClicked.emit({row,rowIndex,button:intent.button,modifiers:intent.modifiers,doubleClick:intent.doubleClick,dragged:intent.dragged});if(this.lastRowMouseDown?.rowIndex===rowIndex)this.lastRowMouseDown=void 0;this.lastRowClickedAt=now;this.lastRowClickedIndex=rowIndex}cellClickKey(rowIndex,field){return`${rowIndex}:${field}`}snapshotMouseEvent(event){if(!event)return{};return{button:event.button,ctrlKey:event.ctrlKey,shiftKey:event.shiftKey,metaKey:event.metaKey,altKey:event.altKey,clientX:event.clientX,clientY:event.clientY}}applyRowClickSelection(row,rowIndex,event){if(this.selectionState.mode==="none")return;const id=this.extractRowId(row,rowIndex);if(id===void 0)return;const isShift=event?event.shiftKey===true:false;const isCtrl=event?event.ctrlKey===true||event.metaKey===true:false;if(this.serverSideModeActive()){this.ssrmSelGesture(f=>f.rowGesture(rowIndex,String(id),isShift?"range":isCtrl?"toggle":"select-only"));return}const previous=this.selectionState;let next;let updateAnchor;if(isShift){const visibleRowIds=this.collectVisibleRowIds();if(this.rangeAnchorRowId!==null&&findAnchorIndex(visibleRowIds,this.rangeAnchorRowId)===null){this.rangeAnchorRowId=null}next=selectRange({state:previous,visibleRowIds,anchorRowId:this.rangeAnchorRowId,targetRowId:id,additive:this.shiftClickAdditive===true});updateAnchor=false}else if(isCtrl){next=toggleRow(previous,id);updateAnchor=false}else{next=selectRow(previous,id);updateAnchor=true}if(updateAnchor)this.rangeAnchorRowId=id;if(next===previous)return;this.selectionState=next;const diff=diffSelection(previous,next);if(diff.addedIds.length===0&&diff.removedIds.length===0)return;this.fireSelectionChanged({mode:next.mode,selectedRowIds:Array.from(next.selectedRowIds),addedIds:diff.addedIds,removedIds:diff.removedIds})}applyRowToggleSelection(row,rowIndex){if(this.selectionState.mode==="none")return;if(this.serverSideModeActive()&&isTreeNodeRow(row)){const check=this.ssrmSelectionProjection?.groupChecks.get(row.key)??null;this.ssrmSelGesture(f=>f.write({kind:"group-children",groupKeys:row.path,action:check==="checked"?"deselect":"select"}));return}const id=this.extractRowId(row,rowIndex);if(id===void 0)return;if(this.serverSideModeActive()){this.ssrmSelGesture(f=>f.rowGesture(rowIndex,String(id),"toggle"));return}const previous=this.selectionState;const next=toggleRow(previous,id);this.rangeAnchorRowId=id;if(next===previous)return;this.selectionState=next;const diff=diffSelection(previous,next);if(diff.addedIds.length===0&&diff.removedIds.length===0)return;this.fireSelectionChanged({mode:next.mode,selectedRowIds:Array.from(next.selectedRowIds),addedIds:diff.addedIds,removedIds:diff.removedIds})}extractRowId(row,rowIndex){if(this.isSentinelDisplayRow(row))return void 0;const fn=this.getRowId;if(typeof fn==="function"){try{const id=fn(row);if(typeof id==="string"&&id.length>0)return id;if(typeof id==="number"&&Number.isFinite(id))return id;console.warn("getRowId returned an invalid value; selection for this row was ignored.");return void 0}catch(err){console.warn("getRowId threw; selection for this row was ignored:",err);return void 0}}if(this.masterDetail===true){const frozen=this.detailRowIds.get(row);if(frozen!==void 0)return frozen}return rowIndex}selectionCheckboxActive(){return this.selectionCheckbox===true||this.showSelectionCheckbox===true}columnHidingActive(){return this.columnHiding===true||this.hideableColumns===true}shouldRenderCheckboxColumn(){return this.selectionCheckboxActive()&&this.selectionState.mode==="multi"&&this.usingColumnDefsApi()}checkboxColumnOffset(){return this.shouldRenderCheckboxColumn()?1:0}collectVisibleRowIds(){const rows=this.getDisplayRows();const out=[];for(let i=0;i<rows.length;i++){const row=rows[i];if(this.isSentinelDisplayRow(row))continue;const id=this.extractRowId(row,i);if(id!==void 0)out.push(id)}return out}handleHeaderCheckboxClick=event=>{if(event){event.stopPropagation();event.preventDefault()}if(!this.shouldRenderCheckboxColumn())return;if(this.serverSideModeActive()){this.ssrmSelGesture(f=>f.write({kind:"header",headerState:this.ssrmSelectionProjection?.headerState??"none"}));return}const ids=this.collectVisibleRowIds();const previous=this.selectionState;const headerState=headerCheckboxState(previous,ids);const next=headerState==="all"?deselectRowsBatch(previous,ids):selectRowsBatch(previous,ids);if(next===previous)return;this.selectionState=next;const diff=diffSelection(previous,next);if(diff.addedIds.length===0&&diff.removedIds.length===0)return;this.fireSelectionChanged({mode:next.mode,selectedRowIds:Array.from(next.selectedRowIds),addedIds:diff.addedIds,removedIds:diff.removedIds})};handleHeaderCheckboxKeyDown=event=>{if(!isCheckboxToggleKey(event))return;event.preventDefault();event.stopPropagation();this.handleHeaderCheckboxClick()};handleBodyCheckboxClick=(row,rowIndex,event)=>{if(event){event.stopPropagation()}this.applyRowToggleSelection(row,rowIndex)};handleBodyCheckboxKeyDown=(row,rowIndex,event)=>{if(!isCheckboxToggleKey(event))return;event.preventDefault();event.stopPropagation();this.applyRowToggleSelection(row,rowIndex)};resolveHoverRowIdFromTarget(target){const el=target;if(!el||typeof el.closest!=="function")return null;const rowEl=el.closest("[data-row-index]");if(!rowEl)return null;const raw=rowEl.getAttribute("data-row-index");if(raw===null)return null;const parsed=Number.parseInt(raw,10);if(!Number.isFinite(parsed)||parsed<0)return null;if(!this.usingColumnDefsApi()){const rows2=this.engineRows();return parsed<rows2.length?parsed:null}const rows=this.getDisplayRows();if(parsed>=rows.length)return null;const row=rows[parsed];if(!row)return null;const id=this.extractRowId(row,parsed);return id===void 0?null:id}applyHoverTransition(nextId){if(this.rowHover==="off")return;const prevState=this.hoverState;const nextState=setHoveredRow(prevState,nextId);if(nextState===prevState)return;const previousRowId=prevState.hoveredRowId;this.hoverState=nextState;if(this.rowHover!=="stateful")return;this.pendingHoverRowId=nextState.hoveredRowId;if(this.hoverRafHandle!==null)return;const schedule=typeof requestAnimationFrame==="function"?requestAnimationFrame:cb=>setTimeout(()=>cb(0),16);this.hoverRafHandle=schedule(()=>{this.hoverRafHandle=null;const flushedId=this.pendingHoverRowId;this.rowHoverChanged.emit({hoveredRowId:flushedId,previousRowId})})}hoverListenerTarget(){if(this.usingColumnDefsApi()){return this.host?.querySelector?.(".sy-grid__viewport")}return this.host??null}setupHoverListener(){if(this.rowHover==="off")return;const el=this.hoverListenerTarget();if(!el)return;if(this.viewportHoverEl===el&&this.viewportMouseMoveHandler!==null){return}this.teardownHoverListener();this.viewportHoverEl=el;this.viewportMouseMoveHandler=event=>{const id=this.resolveHoverRowIdFromTarget(event.target);this.applyHoverTransition(id)};this.viewportMouseLeaveHandler=_event=>{this.applyHoverTransition(null)};el.addEventListener("mousemove",this.viewportMouseMoveHandler);el.addEventListener("mouseleave",this.viewportMouseLeaveHandler)}maybeReattachHoverListener(){if(this.rowHover==="off")return;const el=this.hoverListenerTarget();if(el===this.viewportHoverEl)return;this.teardownHoverListener();this.setupHoverListener()}teardownHoverListener(){if(this.viewportHoverEl){if(this.viewportMouseMoveHandler){this.viewportHoverEl.removeEventListener("mousemove",this.viewportMouseMoveHandler)}if(this.viewportMouseLeaveHandler){this.viewportHoverEl.removeEventListener("mouseleave",this.viewportMouseLeaveHandler)}}this.viewportHoverEl=null;this.viewportMouseMoveHandler=null;this.viewportMouseLeaveHandler=null;if(this.hoverRafHandle!==null){const cancel=typeof cancelAnimationFrame==="function"?cancelAnimationFrame:handle=>clearTimeout(handle);cancel(this.hoverRafHandle);this.hoverRafHandle=null}this.pendingHoverRowId=null}dgHover=null;dgRow(event){const target=event.target;if(target===null||target.closest===void 0)return null;const rowEl=target.closest(".sy-grid__row[data-row-index]");if(rowEl===null)return null;if(rowEl.closest(".sy-grid__viewport")!==event.currentTarget)return null;const rowIndex=Number.parseInt(rowEl.getAttribute("data-row-index")??"",10);if(!Number.isFinite(rowIndex)||rowIndex<0)return null;const rows=this.getDisplayRows();if(rowIndex>=rows.length)return null;return{rowEl,rowIndex,row:rows[rowIndex]}}dgCell(event){const hit=this.dgRow(event);if(hit===null||this.isSentinelDisplayRow(hit.row))return null;const target=event.target;const el=target.closest(".sy-grid__cell");if(el===null||!hit.rowEl.contains(el))return null;const field=el.getAttribute("data-field");const colIndex=Number.parseInt(el.getAttribute("data-col-index")??"",10);if(field===null||!Number.isFinite(colIndex)||colIndex<0)return null;const active=this.editStore.active;if(active!==null&&active.rowIndex===hit.rowIndex&&active.colIndex===colIndex&&target!==el)return null;return{row:hit.row,rowIndex:hit.rowIndex,cell:{el,field,colIndex}}}handleViewportMouseDown=event=>{const hit=this.dgRow(event);if(hit===null)return;if(event.target.closest(".sy-grid__row-drag-handle")!==null){this.handleRowDragStart(hit.rowIndex,event);if(event.defaultPrevented)return}const g=this.dgCell(event);if(g===null)return;this.handleRangeDragStart(g.rowIndex,g.cell.colIndex,event);this.handleCellMouseDown(g.rowIndex,g.cell.field,event)};handleViewportClick=event=>{const hit=this.dgRow(event);if(hit===null)return;const target=event.target;const{rowEl,rowIndex,row}=hit;if(rowEl.classList.contains("sy-grid__full-width-row")){if(target.closest(".sy-grid__full-width-host")===null||target.classList.contains("sy-grid__full-width-host")){this.commitActiveCell({rowIndex,colIndex:this.activeCell?.colIndex??0})}return}if(target.closest(".sy-grid__group-row-toggle")!==null){if(isGroupMarkerRow(row))void this.applyRowGroupExpanded(row.key,!row.expanded,"ui");return}if(target.closest(".sy-grid__tree-toggle")!==null){if(isPivotRowGroupMarker(row))this.togglePivotRowGroup(row.key);else if(isTreeNodeRow(row)&&row.hasChildren){void this.applyTreeNodeExpanded(row.path,!row.expanded,"ui")}return}if(target.closest(".sy-grid__loading-retry")!==null){if(isLoadingPlaceholderRow(row)){void(this.serverSideState!==null?this.retryServerBlock(row.rowIndex):this.retryInfiniteBlock(row.rowIndex))}return}if(isTreeNodeRow(row)){const el=target.closest(".sy-grid__cell");const colIndex=el!==null&&rowEl.contains(el)?Number.parseInt(el.getAttribute("data-col-index")??"",10):NaN;if(!Number.isFinite(colIndex)||colIndex<0)return;this.handleTreeCellClick(event,row,rowIndex,colIndex,this.effectiveColumns()[colIndex]);return}if(this.isSentinelDisplayRow(row))return;if(target.closest(".sy-grid__detail-toggle")!==null){const id=this.detailRowIds.get(row);if(id!==void 0){event.stopPropagation();void this.applyDetailRowExpanded(id,!this.expandedDetailRows.has(id),"ui")}return}if(target.closest(".sy-grid__selection-checkbox")!==null){this.handleBodyCheckboxClick(row,rowIndex,event);return}const g=this.dgCell(event);if(g===null)return;this.handleCellMouseClick(g.row,g.rowIndex,g.cell.colIndex,g.cell.field,event)};handleViewportContextMenu=event=>{if(this.contextMenu!==true||!this.proNewWorkAllowed("grid.context-menu","contextMenu"))return;const g=this.dgCell(event);if(g===null)return;this.openContextMenu(g.rowIndex,g.cell.field,event)};handleViewportHover=event=>{const prev=this.dgHover;if(event.type==="mouseout"){if(prev===null)return;const related=event.relatedTarget;if(related!==null&&prev.cell.el.contains(related))return;this.dgHover=null;this.handleCellTooltipLeave();return}const g=this.dgCell(event);if(g!==null&&prev!==null&&prev.cell.el===g.cell.el)return;if(prev!==null){this.dgHover=null;this.handleCellTooltipLeave()}if(g!==null){this.dgHover=g;this.handleRangeDragEnter(g.rowIndex,g.cell.colIndex,event);this.dgTooltipEnter(g)}};handleViewportFocus=event=>{if(event.type==="focusout"){const next=event.relatedTarget;const nextNode=next!==null&&typeof next==="object"&&"nodeType"in next?next:null;if(nextNode===null||!this.host.contains(nextNode)){this.releaseFocusedLifecycleRenderer()}}else{void Promise.resolve().then(()=>{if(this.host?.isConnected&&this.gridOwnsDocumentFocus()){this.focusActiveLifecycleRenderer()}})}const g=this.dgCell(event);if(g===null||g.cell.el!==event.target)return;if(event.type==="focusin")this.dgTooltipEnter(g);else this.handleCellTooltipLeave()};dgTooltipEnter(g){const cols=this.effectiveColumns();const col=cols[g.cell.colIndex];if(col===void 0)return;const cellEl=g.cell.el;const callbackRow=this.readPolicyConfigured()?this.maskDeniedFields(g.row,g.rowIndex,this.resolvedColumnDefs()):g.row;let displayedText;if(this.lifecycleRendererDeclaration(col)!==null||this.resolveCellRenderer(col)!==null){displayedText=(cellEl.textContent??"").trim()}else{const text=this.cellDisplayText(g.rowIndex,g.cell.colIndex,this.getDisplayRows(),cols);displayedText=text==null?"":String(text)}this.cellTooltipDelay.enter({row:callbackRow,rowIndex:g.rowIndex,colIndex:g.cell.colIndex,field:col.field,column:col,cell:cellEl,displayedText,isOverflowing:cellEl.scrollWidth>cellEl.clientWidth||cellEl.scrollHeight>cellEl.clientHeight})}maybeScrollActiveCellIntoView(){const target=this.pendingScrollIntoView;if(!target)return;this.pendingScrollIntoView=null;const viewport=this.viewportEl;if(!viewport)return;const cellSelector=`.sy-grid__row[data-row-index="${target.rowIndex}"] > .sy-grid__cell:nth-child(${target.colIndex+1+this.checkboxColumnOffset()})`;const cellEl=viewport.querySelector(cellSelector);if(cellEl&&typeof cellEl.scrollIntoView==="function"){try{cellEl.scrollIntoView({block:"nearest",inline:"nearest"});return}catch{}}const rowH=this.uniformRowHeight();let rowTop=target.rowIndex*rowH;if(this.masterDetailActive()&&this.expandedDetailRows.size>0){const rows=this.getDisplayRows();const extra=this.detailRowHeightPx()-rowH;let detailsAbove=0;const limit=Math.min(target.rowIndex,rows.length);for(let i=0;i<limit;i++){if(isDetailRow(rows[i]))detailsAbove++}rowTop+=detailsAbove*extra}const rowBottom=rowTop+rowH;const viewTop=viewport.scrollTop;const viewBottom=viewTop+viewport.clientHeight;if(rowTop<viewTop){viewport.scrollTop=rowTop}else if(rowBottom>viewBottom){viewport.scrollTop=rowBottom-viewport.clientHeight}}skipDetailRows(cell,direction,rowCount,colCount){if(cell===null||!this.masterDetailActive()||this.expandedDetailRows.size===0)return cell;const rows=this.getDisplayRows();let current=cell;let guard=rows.length+1;while(current!==null&&isDetailRow(rows[current.rowIndex])&&guard-- >0){const stepped=moveCell(current,direction,rowCount,colCount);if(stepped===null||stepped.rowIndex===current.rowIndex){const reversed=moveCell(current,direction==="down"?"up":"down",rowCount,colCount);current=reversed!==null&&reversed.rowIndex!==current.rowIndex?reversed:null;break}current=stepped}return current}clampActiveCellAfterChange(){if(!this.usingColumnDefsApi()){if(this.activeCell!==null)this.commitActiveCell(null,{scrollIntoView:false});return}const rowCount=this.activeRowCount();const colCount=this.activeColCount();const next=clampCell(this.activeCell,rowCount,colCount);if(next===this.activeCell)return;this.commitActiveCell(next,{scrollIntoView:false})}componentDidLoad(){document.addEventListener("mousedown",this.handleDocumentClick,true);document.addEventListener("keydown",this.handleDocumentLifecycleEditorKeyDown,true);globalThis.addEventListener?.("syidax-grid-formula-engine-ready",this.onFormulaEngineReady);this.setupVirtualizer();this.setupHoverListener();this.kickCollabConnect()}connectedCallback(){if(!this.hasDisconnected)return;this.hasDisconnected=false;globalThis.addEventListener?.("syidax-grid-formula-engine-ready",this.onFormulaEngineReady);this.ensureFormulaAccelerationProvider();if(this.formulas===true&&this.formulaDualEngine===null&&typeof globalThis.SYIDAX_GRID_FORMULA_ACCELERATION_FACTORY==="function"){this.scheduleFormulaUpgradeKick()}document.addEventListener("mousedown",this.handleDocumentClick,true);document.addEventListener("keydown",this.handleDocumentLifecycleEditorKeyDown,true);this.setupInternalSubscriptions();if(this.viewportDatasource!=null){this.initViewport();this.recomputeVirtualWindow()}this.syncWorkbookBinding("dom-reconnect");this.proGateRef?.rebind();if(this.formulas===true&&this.formulaSheet===null&&this.formulaCore===null)this.rebuildFormulaSheet();this.kickCollabConnect();this.liveObjectModel?.reconcile();this.invalidateComponentFilterRuntime();this.lifecycleFilterVersion+=1;this.lifecycleRendererPresentationVersion+=1;void this.reconcileComponentFilters();if(this.masterDetailActive()&&this.expandedDetailRows.size>0)this.detailDataVersion++}hasDisconnected=false;handoffLifecycleRendererFocus(rowIndex,colIndex,target){if(target==="grid-before"||target==="grid-after"){this.focusOutsideGridRoot(target==="grid-before");return}const current={rowIndex,colIndex};const next=target==="next-cell"?moveCellWithWrap(current,"right",this.activeRowCount(),this.activeColCount()):target==="previous-cell"?moveCellWithWrap(current,"left",this.activeRowCount(),this.activeColCount()):current;if(next!==null&&next.rowIndex===current.rowIndex&&next.colIndex===current.colIndex&&target!=="cell"){this.focusOutsideGridRoot(target==="previous-cell");return}this.commitActiveCell(next,{scrollIntoView:true});this.viewportEl?.focus({preventScroll:true})}lifecycleFilterDeclaration(col){const declaration=col.filter;if(declaration===void 0||declaration===null||declaration===true||declaration===false||Array.isArray(declaration)){return null}if(typeof declaration==="string"){const name=declaration.trim();if(name===""||name==="text"||name==="number"||name==="date"||name==="set"){return null}return name}return declaration}componentFilterColumnId(col){const candidate=col.colId??col.field;return typeof candidate==="string"?candidate.trim():""}configuredLifecycleFilterCount(){return this.effectiveColumns().reduce((count,col)=>count+(this.lifecycleFilterDeclaration(col)===null?0:1),0)}componentFilterValueGetter(col){const colId=this.componentFilterColumnId(col);const cached=this.componentFilterValueGetters.get(colId);if(cached!==void 0){cached.column=col;return cached.getValue}const binding={column:col,getValue:()=>void 0};const getValue=data=>{const current=binding.column;const row=data;const formulaGetter=this.formulaFieldGetter(current.field);if(current.valueGetter===void 0||current.valueGetter===null){return formulaGetter===void 0?readOwnFieldPath(row,current.field):formulaGetter(row)}return this.resolveGridCellValue({row,rowIndex:-1,colId,field:current.field,valueGetter:current.valueGetter,colDef:current})};binding.getValue=getValue;this.componentFilterValueGetters.set(colId,binding);return getValue}componentFilterIsActive(colId){return this.filterFacade?.isFilterActive(colId)??false}sameComponentFilterInputs(left,right){if(left===null||left.length!==right.length)return false;for(let index2=0;index2<left.length;index2+=1){if(!Object.is(left[index2],right[index2]))return false}return true}reconcileComponentFilters(){const columns=this.effectiveColumns().map(col=>{const filter=this.lifecycleFilterDeclaration(col);if(filter===null)return null;return{col,colId:this.componentFilterColumnId(col),filter}}).filter(entry=>entry!==null);const retainedIds=new Set(columns.map(({colId})=>colId));this.componentFilterDesiredIds=retainedIds;const retainedFloatingIds=new Set(columns.filter(({col})=>col.floatingFilterComponent!=null).map(({colId})=>colId));for(const[colId,host]of this.componentFilterHosts){if(!retainedIds.has(colId)){this.releaseComponentFilterHost(colId,host,false)}}for(const[colId,host]of this.componentFloatingFilterHosts){if(!retainedFloatingIds.has(colId)){this.releaseComponentFilterHost(colId,host,true)}}for(const key of this.componentFilterHostRefs.keys()){const separator=key.indexOf("\0");const kind=separator<0?"":key.slice(0,separator);const colId=separator<0?key:key.slice(separator+1);if(kind==="filter"&&!retainedIds.has(colId)||kind==="floating"&&!retainedFloatingIds.has(colId)){this.componentFilterHostRefs.delete(key)}}for(const key of this.componentFilterValueGetters.keys()){if(!retainedIds.has(key))this.componentFilterValueGetters.delete(key)}for(const key of this.componentFilterModels.keys()){if(!retainedIds.has(key))this.componentFilterModels.delete(key)}if(this.componentFilterModels.size===0){this.componentFilterRestorePending=false}for(const key of this.componentRecentlyDestroyedFilters){if(!retainedIds.has(key)){this.componentRecentlyDestroyedFilters.delete(key)}}const existingFacade=this.filterFacade;if(columns.length===0&&this.externalFilter==null&&(existingFacade===null||existingFacade.stats().columns===0&&existingFacade.getExternalFilter()===null)){this.componentFilterReadyRevision=this.componentFilterRevision;return this.componentFilterReconcileTask??Promise.resolve()}const inputs=[this.componentFilterRevision,this.externalFilterRevision,this.components,this.context,this.defaultColDef,this.formulaVersion,this.componentFilterExecutionMode(),this.externalFilter];for(const{col,colId,filter}of columns){inputs.push(colId,filter,col.floatingFilterComponent,col.field,col.valueGetter)}if(this.sameComponentFilterInputs(this.componentFilterReconcileInputs,inputs)){return this.componentFilterReconcileTask??Promise.resolve()}this.componentFilterReconcileInputs=inputs;const sequence=++this.componentFilterReconcileSequence;const filterRevision=this.componentFilterRevision;const externalRevision=this.externalFilterRevision;const task=(async()=>{if(this.filterFacade===null){await this.getComponentManager("filter")}const facade=this.filterFacade;if(facade===null||sequence!==this.componentFilterReconcileSequence||!this.host?.isConnected){return}const columnReconcileTask=facade.reconcileColumns(columns.map(({col,colId,filter})=>({colId,filter,floatingFilter:col.floatingFilterComponent,getValue:this.componentFilterValueGetter(col),local:this.components,version:this.formulaVersion,resolutionVersion:this.componentRegistryRevision})));let changed=false;let externalChanged=false;let externalInstallUnavailable=false;let remoteInvalidationFlushedByRestore=false;const desiredExternal=this.externalFilter??null;const externalSourceChanged=!Object.is(this.externalFilterApplied,desiredExternal);const externalRefreshRequired=desiredExternal!==null&&this.externalFilterReadyRevision!==externalRevision;if(externalSourceChanged||externalRefreshRequired){this.externalFilterReadyRevision=-1;if(externalSourceChanged){const installedExternal=await facade.setExternalFilter(desiredExternal);if(sequence!==this.componentFilterReconcileSequence||externalRevision!==this.externalFilterRevision||!Object.is(desiredExternal,this.externalFilter??null)||!this.host?.isConnected){return}if(desiredExternal!==null&&installedExternal===null){externalInstallUnavailable=true}else{this.externalFilterApplied=desiredExternal;changed=true;externalChanged=true}}if(desiredExternal!==null&&!externalInstallUnavailable){const refreshed=await facade.refreshExternalFilter(this.context);if(sequence!==this.componentFilterReconcileSequence||externalRevision!==this.externalFilterRevision||!Object.is(desiredExternal,this.externalFilter??null)||!this.host?.isConnected){return}if(refreshed?.status==="refreshed"){this.externalFilterReadyRevision=externalRevision;changed=true;externalChanged=true}}else{this.externalFilterReadyRevision=externalRevision}}else if(desiredExternal===null){this.externalFilterReadyRevision=externalRevision}if(sequence!==this.componentFilterReconcileSequence||filterRevision!==this.componentFilterRevision||!this.host?.isConnected){return}const result=await columnReconcileTask;if(sequence!==this.componentFilterReconcileSequence||filterRevision!==this.componentFilterRevision||!this.host?.isConnected){return}changed=changed||result.mounted.length>0||result.refreshed.length>0||result.destroyed.length>0;if(this.componentFilterRestorePending){let restoreStale=false;const restoreModels={};for(const[colId,model]of this.componentFilterModels){if(retainedIds.has(colId))restoreModels[colId]=model}let restoreResults;const remoteFlushRevision=this.componentFilterRemoteFlushRevision;await this.runComponentFilterChangeBatch(async()=>{restoreResults=await facade.setFilterModels(restoreModels,{clearUnspecified:false,source:"restore"});if(sequence!==this.componentFilterReconcileSequence||filterRevision!==this.componentFilterRevision||!this.host?.isConnected){restoreStale=true}});remoteInvalidationFlushedByRestore=this.componentFilterRemoteFlushRevision!==remoteFlushRevision;if(restoreStale)return;const restoredAll=restoreResults?.every(result2=>result2.status==="ok")??false;if((restoreResults?.length??0)>0)changed=true;if(restoredAll)this.componentFilterRestorePending=false}for(const[colId,host]of this.componentFilterHosts){if(!retainedIds.has(colId)||!host.isConnected)continue;const attached=await facade.attachFilterGui(colId,host);if(sequence!==this.componentFilterReconcileSequence||filterRevision!==this.componentFilterRevision||!this.host?.isConnected){return}if(attached.status==="attached")changed=true}for(const[colId,host]of this.componentFloatingFilterHosts){if(!retainedFloatingIds.has(colId)||!host.isConnected)continue;const attached=await facade.attachFloatingFilterGui(colId,host);if(sequence!==this.componentFilterReconcileSequence||filterRevision!==this.componentFilterRevision||!this.host?.isConnected){return}if(attached.status==="attached")changed=true}const stats=facade.stats();if(result.errors.length===0&&stats.columns===columns.length&&stats.mountedFilters===columns.length){if(this.componentFilterReadyRevision!==filterRevision){changed=true}this.componentFilterReadyRevision=filterRevision}else{this.componentFilterReadyRevision=-1}if(changed){this.componentRemoteFilterErrors.clear();this.lifecycleFilterVersion+=1;if(this.componentFilterExecutionMode()!=="client"&&!remoteInvalidationFlushedByRestore){this.infiniteModelInputsChanged()}}if(externalChanged){this.scheduleLifecycleFilterPeerNotification()}})().catch(()=>{if(sequence!==this.componentFilterReconcileSequence||filterRevision!==this.componentFilterRevision){return}this.componentFilterReconcileInputs=null;this.componentFilterReadyRevision=-1}).finally(()=>{if(this.componentFilterReconcileTask===task){this.componentFilterReconcileTask=null}});this.componentFilterReconcileTask=task;return task}componentFilterHostMap(floating){return floating?this.componentFloatingFilterHosts:this.componentFilterHosts}releaseComponentFilterHost(colId,host,floating){const hosts=this.componentFilterHostMap(floating);if(hosts.get(colId)!==host)return;hosts.delete(colId);const facade=this.filterFacade;if(facade===null)return;void(floating?facade.detachFloatingFilterGui(colId):facade.detachFilterGui(colId))}claimComponentFilterHost(colId,host,floating){const hosts=this.componentFilterHostMap(floating);const previous=hosts.get(colId);if(previous===host)return;if(previous!==void 0){this.releaseComponentFilterHost(colId,previous,floating)}hosts.set(colId,host);this.attachComponentFilterHost(colId,host,floating)}componentFilterHostRef(colId,floating){const key=`${floating?"floating":"filter"}\0${colId}`;const existing=this.componentFilterHostRefs.get(key);if(existing!==void 0)return existing;let ownedHost=null;const callback=host=>{if(host===void 0||host===null){if(ownedHost!==null){this.releaseComponentFilterHost(colId,ownedHost,floating);ownedHost=null}return}if(ownedHost!==null&&ownedHost!==host){this.releaseComponentFilterHost(colId,ownedHost,floating)}ownedHost=host;this.claimComponentFilterHost(colId,host,floating)};this.componentFilterHostRefs.set(key,callback);return callback}attachComponentFilterHost(colId,host,floating){void(async()=>{await this.reconcileComponentFilters();await this.getComponentManager("filter");const facade=this.filterFacade;if(facade===null||!host.isConnected||this.componentFilterHostMap(floating).get(colId)!==host){return}if(floating){await facade.attachFloatingFilterGui(colId,host)}else{const result=await facade.attachFilterGui(colId,host);if((result.status==="mounted"||result.status==="attached"||result.status==="already-attached")&&host.isConnected){this.filterDropdownFocused=false;this.maybeFocusFilterDropdown()}}})().catch(()=>void 0)}reconcileLifecycleRenderers(){const requests=[...this.pendingLifecycleRenderers.values()];const sequence=++this.lifecycleRendererReconcileSequence;const existingManager=this.componentManager;if(requests.length===0&&existingManager===null)return;void(async()=>{const manager=existingManager??await this.getComponentManager();const active=[];const activeKeys=new Set;let presentationChanged=false;await Promise.all(requests.map(async request=>{const requestKey=JSON.stringify([request.identity.rowId,request.identity.colId]);const requestIsCurrent=()=>sequence===this.lifecycleRendererReconcileSequence&&request.host.isConnected&&this.pendingLifecycleRenderers.get(requestKey)===request;if(!requestIsCurrent())return;try{const resolved=await manager.resolve({kind:"renderer",...request.componentName===void 0?{}:{name:request.componentName},...request.definition===void 0?{}:{definition:request.definition},local:this.components});if(!requestIsCurrent())return;const cellElement=request.host.closest(".sy-grid__cell")??request.host;const requestOwnsCell=()=>requestIsCurrent()&&(request.host.closest(".sy-grid__cell")??request.host)===cellElement;const result=await manager.renderer.render({identity:request.identity,host:request.host,componentName:request.componentName,source:resolved.definition,params:{value:request.value,row:request.paramsRow,rowIndex:request.rowIndex,colIndex:request.colIndex,colId:request.identity.colId,formatted:request.formatted,valueFormatted:request.formatted,meta:request.meta,context:this.context,cellElement,setTooltip:value=>{if(!requestOwnsCell())return;if(value===null){cellElement.removeAttribute("title")}else{cellElement.title=value}},handoffFocus:target=>{if(!requestOwnsCell())return;this.handoffLifecycleRendererFocus(request.rowIndex,request.colIndex,target)}}});if(!requestOwnsCell()||result.status==="stale"){return}active.push(request.identity);activeKeys.add(requestKey);presentationChanged=this.updateLifecycleRendererPresentation(requestKey,result.status==="failed"?{classNames:[]}:this.rendererPresentationFromOutput(result.gui))||presentationChanged}catch(error){if(!requestIsCurrent())return;request.host.textContent="—";presentationChanged=this.updateLifecycleRendererPresentation(requestKey,{classNames:[]})||presentationChanged;if(error!==null&&typeof error==="object"&&"code"in error&&"phase"in error&&"componentKind"in error&&"retryable"in error){this.emitComponentError(error)}}}));if(sequence!==this.lifecycleRendererReconcileSequence)return;for(const key of this.lifecycleRendererPresentations.keys()){if(!activeKeys.has(key)){this.lifecycleRendererPresentations.delete(key);presentationChanged=true}}if(this.focusedLifecycleRenderer!==null&&!active.some(identity2=>this.sameComponentIdentity(identity2,this.focusedLifecycleRenderer.identity))){this.releaseFocusedLifecycleRenderer()}await manager.renderer.reconcileMounted(active);if(sequence!==this.lifecycleRendererReconcileSequence)return;this.focusActiveLifecycleRenderer();if(presentationChanged){this.lifecycleRendererPresentationVersion+=1}})().catch(()=>{if(sequence!==this.lifecycleRendererReconcileSequence)return;let presentationChanged=false;for(const request of requests){if(request.host.isConnected)request.host.textContent="—";const key=JSON.stringify([request.identity.rowId,request.identity.colId]);presentationChanged=this.updateLifecycleRendererPresentation(key,{classNames:[]})||presentationChanged}if(presentationChanged){this.lifecycleRendererPresentationVersion+=1}this.releaseFocusedLifecycleRenderer()})}componentDidRender(){if(this.pendingComponentIdentityErrors.length>0){const errors2=this.pendingComponentIdentityErrors;this.pendingComponentIdentityErrors=[];for(const error of errors2)this.emitComponentError(error)}this.notifyPivotColumnModel();if(this.fullWidthFacade!==null)this.reconcileFullWidthMounts();if(this.pendingAlignedScroll!==null&&this.viewportEl!==null){const target=this.pendingAlignedScroll;this.alignedApplying=true;try{this.viewportEl.scrollLeft=target}finally{this.alignedApplying=false}if(Math.abs(this.viewportEl.scrollLeft-target)<=.5){this.pendingAlignedScroll=null;this.hScrollLeft=target;this.syncHeaderHorizontalScroll(target)}}const spanFrame=this.rowLayoutFrame;if(spanFrame!==null&&spanFrame.configured){const active=this.activeCell;if(active!==null&&spanFrame.covers(active.rowIndex)){const cell=spanFrame.cellAt(active.rowIndex,active.colIndex);if(cell.kind==="covered"){this.commitActiveCell({rowIndex:cell.origin.rowIndex,colIndex:cell.origin.colIndex})}}const signature=this.rowLayoutChunk?.spanConflictSignature(spanFrame.conflicts)??null;if(signature!==null&&signature!==this.spanConflictSignature){this.spanConflictSignature=signature;this.spanConflict.emit({conflicts:spanFrame.conflicts,renderRange:spanFrame.renderRange})}else if(signature===null){this.spanConflictSignature=null}}if(this.pendingPivotConflicts.length>0){const conflicts=this.pendingPivotConflicts;this.pendingPivotConflicts=[];for(const conflict of conflicts)this.pivotCombinationConflict.emit(conflict)}this.proGateRef?.afterRender();this.liveObjectModel?.reconcile();this.scrollPassViewportHeight=null;this.ensureVirtualizerAttached();this.measureAutoHeightRows();this.maybeApplyPendingStateUiRestore();this.noteStateAtomsAfterRender();this.maybeScrollActiveCellIntoView();this.maybeReattachHoverListener();this.maybeFocusActiveTextEditor();this.attachLifecycleEditor();this.lifecycleEditorPopupReposition?.recalculate();this.maybeFocusCsvWizard();this.maybeFocusContextMenu();this.maybeFocusFilterDropdown();this.maybeFocusBuilder();this.maybeRestorePivotPanelFocus();this.syncTooltipPortal();this.syncCalendarAnchor();this.syncAutocompleteAnchor();this.syncFormulaSuggestAnchor();this.syncLargeTextAnchor();this.collabGlue?.syncCommentPanelAnchor(this);this.reconcileComponentFilters();this.maybeFetchInfiniteBlocks();this.maybeFetchServerBlocks();this.maybeUpdateViewportRange();this.reconcileDetailMounts();this.reconcileLifecycleRenderers();this.syncEmptyStateOverlayInset()}emptyStateOverlayRendered=false;emptyStateOverlayInset=null;syncEmptyStateOverlayInset(){const body=this.host?.querySelector?.(".sy-grid__body");if(body===null||body===void 0)return;if(!this.emptyStateOverlayRendered){if(this.emptyStateOverlayInset!==null){this.emptyStateOverlayInset=null;body.style.removeProperty("--sy-grid-empty-state-inset-top")}return}const viewport=this.host.querySelector(".sy-grid__viewport");if(viewport===null)return;const inset=Math.max(0,Math.round(viewport.getBoundingClientRect().top-body.getBoundingClientRect().top));if(inset===this.emptyStateOverlayInset)return;this.emptyStateOverlayInset=inset;body.style.setProperty("--sy-grid-empty-state-inset-top",`${inset}px`)}reconcileDetailMounts(){if(!this.masterDetailActive()){if(this.mountedDetailIds.size===0&&this.detailRowDataCache.size===0)return;const torn=[...this.mountedDetailIds];this.mountedDetailIds=new Set;this.detailRowLoading.clear();this.detailRowDataCache.clear();for(const rowId of torn)this.detailRowDestroyed.emit({rowId});return}const{desiredMountedDetails,reconcileMountedDetails}=this.masterDetailEngine();const desired=desiredMountedDetails(this.expandedDetailRows,this.lastMasterIds);const result=reconcileMountedDetails(this.mountedDetailIds,desired,[...this.expandedDetailRows]);if(result.stable)return;this.mountedDetailIds=result.mounted;if(result.created.length>0){const byId=this.masterRowsById();for(const rowId of result.created){this.detailRowCreated.emit({rowId,master:byId.get(rowId)??null})}}for(const rowId of result.destroyed){this.detailRowLoading.delete(rowId);this.detailRowDestroyed.emit({rowId})}}measureAutoHeightRows(){if(this.measuringAutoHeight)return;if(!this.autoHeightActive())return;const cache=this.rowHeightCache;if(cache===null)return;const rowEls=this.host?.querySelectorAll?.(".sy-grid__row[data-row-index]");if(!rowEls||rowEls.length===0)return;let changed=false;rowEls.forEach(el=>{const raw=el.dataset.rowIndex;const idx=raw!=null?Number(raw):NaN;if(!Number.isInteger(idx)||idx<0)return;const measured=el.offsetHeight;if(!Number.isFinite(measured)||measured<=0)return;if(Math.abs(cache.getHeight(idx)-measured)>.5){cache.setHeight(idx,measured);changed=true}});if(!changed)return;this.measuringAutoHeight=true;try{this.recomputeVirtualWindow();this.autoHeightVersion++}finally{this.measuringAutoHeight=false}}syncLargeTextAnchor(){if(typeof window==="undefined")return;if(this.largeTextConfig===null||this.textareaEditorState===null||this.largeTextAnchorEl===null){if(this.largeTextAnchor!==null)this.largeTextAnchor=null;return}const rect=this.largeTextAnchorEl.getBoundingClientRect();const next={x:Math.round(rect.left),y:Math.round(rect.bottom+2),width:Math.round(rect.width)};const cur=this.largeTextAnchor;if(cur===null||cur.x!==next.x||cur.y!==next.y||cur.width!==next.width){this.largeTextAnchor=next}}syncCalendarAnchor(){if(typeof window==="undefined")return;if(this.calendarState===null||this.dateEditorState===null||this.textEditorEl===null){if(this.calendarAnchor!==null)this.calendarAnchor=null;return}const rect=this.textEditorEl.getBoundingClientRect();const next={x:Math.round(rect.left),y:Math.round(rect.bottom+2),width:Math.round(rect.width)};const cur=this.calendarAnchor;if(cur===null||cur.x!==next.x||cur.y!==next.y||cur.width!==next.width){this.calendarAnchor=next}}syncAutocompleteAnchor(){if(typeof window==="undefined")return;if(this.autocompleteEditorState===null||this.autocompleteInputEl===null){if(this.autocompleteAnchor!==null)this.autocompleteAnchor=null;return}const rect=this.autocompleteInputEl.getBoundingClientRect();const next={x:Math.round(rect.left),y:Math.round(rect.bottom+2),width:Math.round(rect.width)};const cur=this.autocompleteAnchor;if(cur===null||cur.x!==next.x||cur.y!==next.y||cur.width!==next.width){this.autocompleteAnchor=next}}maybeFocusActiveTextEditor(){if(this.editStore.active===null)return;if(typeof document==="undefined")return;if(this.selectEditorState!==null){const triggerEl=this.selectTriggerEl;if(triggerEl===null)return;if(document.activeElement===triggerEl)return;try{triggerEl.focus()}catch{}return}if(this.checkboxEditorState!==null){const checkboxEl=this.checkboxEditorEl;if(checkboxEl===null)return;applyIndeterminateToInput(checkboxEl,this.checkboxEditorState);if(document.activeElement===checkboxEl)return;try{checkboxEl.focus()}catch{}return}if(this.textareaEditorState!==null){const taEl=this.textareaEditorEl;if(taEl===null)return;if(document.activeElement===taEl)return;try{taEl.focus();if(this.largeTextConfig!==null){const end=taEl.value.length;taEl.setSelectionRange(end,end)}else{taEl.select()}}catch{}return}const editorEl=this.textEditorEl;if(editorEl===null)return;if(this.textEditorState===null&&this.numberEditorState===null&&this.dateEditorState===null){return}if(document.activeElement===editorEl)return;try{editorEl.focus();if(this.dateEditorState===null){editorEl.select()}}catch{}}disconnectedCallback(){brandMarkDefault.releaseBrandIntegrity(this.host);if(this.fullWidthFacade!==null){this.fullWidthFacade.dispose();this.fullWidthFacade=null}this.finalizeBatchEditOnDisconnect();this.emitPreDestroyedOnce();this.hasDisconnected=true;this.liveObjectModel?.invalidateAll("disconnected");this.workbookBindingController.disconnect("dom-disconnect");this.teardownChartLink();if(this.alignedFacade!==null){this.alignedFacade.dispose();this.alignedFacade=null}this.fillBinding?.dispose();this.fillBinding=null;if(this.rowEditState.session!==null){void this.finishRowEditSession("cancel")}this.unregisterFormulaWasmEventTarget();globalThis.removeEventListener?.("syidax-grid-formula-engine-ready",this.onFormulaEngineReady);document.removeEventListener("mousedown",this.handleDocumentClick,true);document.removeEventListener("keydown",this.handleDocumentLifecycleEditorKeyDown,true);document.removeEventListener("mouseup",this.finishRangeDrag);if(this.rowDragCleanup)this.rowDragCleanup();this.teardownUnmanagedDrag(true);for(const timer of this.flashTimers.values())clearTimeout(timer);this.flashTimers.clear();this.clearConflictUi();this.collabConnectGen++;this.collabSession?.disconnect();this.collabSession=null;this.teardownSsrmRuntime();this.chunkLoader?.dispose();this.chunkLoader=null;this.proGateRef?.detach();this.formulaAccelerationLoad=null;this.disposeComponentManager();this.viewportGen+=1;this.viewportDatasource?.destroy?.();this.detailFetchToken++;this.detailRowLoading.clear();this.detailRowDataCache.clear();if(this.mountedDetailIds.size>0){const mounted=[...this.mountedDetailIds];this.mountedDetailIds=new Set;for(const rowId of mounted)this.detailRowDestroyed.emit({rowId})}this.teardownVirtualizer();this.cancelQuickFilterDebounce();this.quickFilterInputEl=null;this.proUiChunks["pro-panels"]?.closeColumnMenu(this.columnMenuHost(),false);this.proUiChunks["pro-panels"]?.disposeFindUi(this.findHost());this.proUiChunks["pro-panels"]?.disposeNotesUi(this.notesHost());this.proUiChunks["pro-panels"]?.disposeBatchUi(this.batchUiHost());this.cancelLoadingDebounce();this.loadingDebouncer.clear();this.teardownHoverListener();this.cellTooltipDelay.cancel();this.headerTooltipDelay.cancel();this.cellTooltip=null;this.teardownTooltipPortal();if(this.undoRedoUnsubscribe){this.undoRedoUnsubscribe();this.undoRedoUnsubscribe=null}if(this.columnResizeController.isActive()||this.columnResizeEscHandler!==null){this.cancelColumnResize()}if(this.columnReorderController.isActive()||this.columnReorderEscHandler!==null){this.cancelColumnReorder()}if(this.columnVisibilityChangedUnsubscribe){this.columnVisibilityChangedUnsubscribe();this.columnVisibilityChangedUnsubscribe=null}if(this.columnVisibilityResetUnsubscribe){this.columnVisibilityResetUnsubscribe();this.columnVisibilityResetUnsubscribe=null}}onRowHoverModeChanged(){this.teardownHoverListener();this.setupHoverListener();if(this.rowHover!=="stateful"){const prev=this.hoverState;const next=clearHoveredRow(prev);if(next!==prev){this.hoverState=next}this.pendingHoverRowId=null}}onVirtualizationInputsChanged(){if(!this.host?.isConnected)return;this.teardownVirtualizer();this.setupVirtualizer()}onVirtualizationMetricsChanged(){if(!this.host?.isConnected)return;this.recomputeVirtualWindow()}setupVirtualizer(){if(!this.usingColumnDefsApi())return;if(!this.virtualScroll)return;const el=this.host?.querySelector?.(".sy-grid__viewport");if(!el)return;this.viewportEl=el;if(typeof ResizeObserver==="function"){this.resizeObserver=new ResizeObserver(entries=>{const entry=entries[0];if(!entry)return;const rect=entry.contentRect;const next={width:rect.width,height:rect.height};const prev=this.viewportSize;this.bodyScrollbarWidth=el.offsetWidth-el.clientWidth;if(prev&&prev.width===next.width&&prev.height===next.height)return;this.viewportSize=next;this.recomputeVirtualWindow()});this.resizeObserver.observe(el)}else{const rect=el.getBoundingClientRect();this.viewportSize={width:rect.width,height:rect.height}}this.bodyScrollbarWidth=el.offsetWidth-el.clientWidth;this.detachVirtualScroll=attachVirtualScroll(el,{totalRows:this.getDisplayRows().length,rowHeight:this.uniformRowHeight(),viewportHeight:this.estimatedViewportHeight(),overscan:DEFAULT_OVERSCAN},_result=>{this.scrollTop=el.scrollTop;this.syncHeaderHorizontalScroll(el.scrollLeft);this.alignedNotify();if((this.virtualizeColumns===true||this.columnWindowLive)&&this.hScrollLeft!==el.scrollLeft){this.hScrollLeft=el.scrollLeft;this.alignedNotify()}this.recomputeVirtualWindow()})}syncHeaderHorizontalScroll(scrollLeft){const clip=this.host?.querySelector?.(".sy-grid__header-clip");if(clip&&clip.scrollLeft!==scrollLeft)clip.scrollLeft=scrollLeft;if(this.pinnedRowsFacade!==null&&this.pinnedRowsFacade.count()>0){const bands=this.host?.querySelectorAll?.(".sy-grid__pinned-clip");bands?.forEach(band=>{if(band.scrollLeft!==scrollLeft)band.scrollLeft=scrollLeft})}}teardownVirtualizer(){if(this.detachVirtualScroll){this.detachVirtualScroll();this.detachVirtualScroll=null}if(this.resizeObserver){this.resizeObserver.disconnect();this.resizeObserver=null}this.viewportEl=null}ensureVirtualizerAttached(){if(!this.usingColumnDefsApi()||!this.virtualScroll)return;const el=this.host?.querySelector?.(".sy-grid__viewport");if(!el||this.viewportEl===el)return;this.teardownVirtualizer();this.setupVirtualizer()}recomputeVirtualWindow(){const rows=this.getDisplayRows();const viewportHeight=this.scrollPassViewportHeight??this.estimatedViewportHeight();this.scrollPassViewportHeight=viewportHeight;let next=this.computeVirtualWindowForRows(rows,viewportHeight);const maxScrollTop=next===null?0:Math.max(0,next.totalHeight-viewportHeight);const rawScrollTop=Number.isFinite(this.scrollTop)?Math.max(0,this.scrollTop):0;const clampedScrollTop=Math.min(rawScrollTop,maxScrollTop);if(clampedScrollTop!==this.scrollTop){this.scrollTop=clampedScrollTop;if(this.viewportEl&&Math.abs(this.viewportEl.scrollTop-clampedScrollTop)>.5){this.viewportEl.scrollTop=clampedScrollTop}next=this.computeVirtualWindowForRows(rows,viewportHeight)}const current=this.virtualWindow;if(next!==null&¤t!==null&&this.virtualWindowRowCount===rows.length&&this.virtualWindowViewportHeight===viewportHeight&&this.virtualWindowDetailSet===this.expandedDetailRows&¤t.totalHeight===next.totalHeight&&next.startIndex>=current.startIndex&&next.endIndex<=current.endIndex){return}this.virtualWindowRowCount=rows.length;this.virtualWindowViewportHeight=viewportHeight;this.virtualWindowDetailSet=this.expandedDetailRows;this.virtualWindow=next===null?null:this.computeVirtualWindowForRows(rows,viewportHeight,RENDER_OVERSCAN)}uniformRowHeight(){const raw=this.rowHeight;if(typeof raw!=="number"||!Number.isFinite(raw)||raw<=0)return 32;return raw}estimatedViewportHeight(){const live=this.viewportEl?.clientHeight;const hostBudget=this.estimatedViewportHeightFromHost();if(typeof live==="number"&&Number.isFinite(live)&&live>0&&hostBudget!==null){return Math.max(live,hostBudget)}if(typeof live==="number"&&Number.isFinite(live)&&live>0){return live}if(hostBudget!==null){return hostBudget}const measured=this.viewportSize?.height;if(typeof measured==="number"&&Number.isFinite(measured)&&measured>0){return measured}if(typeof this.height==="number"&&Number.isFinite(this.height)&&this.height>0){return this.height}if(typeof this.height==="string"){const match=this.height.trim().match(/^(\d+(?:\.\d+)?)px$/);if(match){const px=Number(match[1]);if(Number.isFinite(px)&&px>0)return px}}return 240}estimatedViewportHeightFromHost(){const hostHeight=this.measuredHostHeight();if(hostHeight===null)return null;const toolbar=this.host?.querySelector?.(".sy-grid__toolbar");const header=this.host?.querySelector?.(".sy-grid__header-rowgroup");const pagination=this.host?.querySelector?.(".sy-grid__pagination");const branding=this.host?.querySelector?.(".sy-grid__brand-strip");let bandsHeight=0;if(this.pinnedRowsFacade!==null&&this.pinnedRowsFacade.count()>0){const bands=this.host?.querySelectorAll?.(".sy-grid__pinned-band");bands?.forEach(band=>{bandsHeight+=this.elementHeight(band)})}const chromeHeight=this.elementHeight(toolbar)+this.elementHeight(header)+this.elementHeight(pagination)+this.elementHeight(branding)+bandsHeight;const available=hostHeight-chromeHeight;return Number.isFinite(available)&&available>0?available:null}measuredHostHeight(){const live=this.host?.clientHeight;if(typeof live==="number"&&Number.isFinite(live)&&live>0){return live}if(typeof this.height==="number"&&Number.isFinite(this.height)&&this.height>0){return this.height}if(typeof this.height==="string"){const match=this.height.trim().match(/^(\d+(?:\.\d+)?)px$/);if(match){const px=Number(match[1]);if(Number.isFinite(px)&&px>0)return px}}return null}elementHeight(el){const height=el?.offsetHeight;return typeof height==="number"&&Number.isFinite(height)&&height>0?height:0}rowHeightForIndex(fn,index2,row,fallback){if(isDetailRow(row))return this.detailRowHeightPx();if(isGroupMarkerRow(row)||isGroupFooterRow(row)||isTreeNodeRow(row))return fallback;if(isLoadingPlaceholderRow(row))return fallback;if(row!==void 0){const liveHeight=this.liveRowHeights.get(this.collabRowId(row,index2));if(liveHeight!==void 0)return liveHeight}try{return this.safeRowHeightSample(fn(index2,row),fallback)}catch(err){console.warn(`[SG:ROW] height error row=${index2}; use=${fallback}px`,err);return fallback}}autoHeightActive(){if(!this.virtualScroll)return false;if(typeof this.rowHeightFn==="function")return false;const cols=this.effectiveColumns();for(let i=0;i<cols.length;i++){if(cols[i]?.autoHeight===true)return true}return false}rowHeightLayoutSignature(){const cols=this.effectiveColumns();let sig="";for(let i=0;i<cols.length;i++){const c=cols[i];if(!c)continue;const w=this.columnWidths.get(c.field)??c.width??"";sig+=`${c.field}:${w}|`}const vw=this.viewportEl?.clientWidth??this.viewportSize?.width??0;return`${sig}#${Math.round(vw)}`}ensureRowHeightCacheFor(rows){if(this.rowHeightCache===null){this.rowHeightCache=createRowHeightCache(this.uniformRowHeight());this.lastMeasuredRowsRef=null;this.lastMeasuredLayoutSig=""}const sig=this.rowHeightLayoutSignature();if(this.lastMeasuredRowsRef!==rows||this.lastMeasuredLayoutSig!==sig){this.rowHeightCache.reset();this.lastMeasuredRowsRef=rows;this.lastMeasuredLayoutSig=sig}return this.rowHeightCache}computeVirtualWindowForRows(rows,viewportHeight,overscan=DEFAULT_OVERSCAN){const totalRows=rows.length;if(totalRows===0)return null;const uniform=this.uniformRowHeight();const fn=this.rowHeightFn;const fullWidth=this.fullWidthDeclared()?this.fullWidth():null;const fullWidthHeight=fullWidth===null?null:i=>fullWidth.isFullWidthRow(i)?fullWidth.heightAt(i,uniform):null;if(typeof fn==="function"){return computeVariableVirtualWindow({totalRows,rowHeight:i=>fullWidthHeight?.(i)??this.rowHeightForIndex(fn,i,rows[i],uniform),viewportHeight,scrollTop:this.scrollTop,overscan})}if(this.autoHeightActive()){const cache=this.ensureRowHeightCacheFor(rows);return computeCachedVariableWindow(cache,{totalRows,viewportHeight,scrollTop:this.scrollTop,overscan})}if(this.masterDetailActive()&&this.expandedDetailRows.size>0){const detailPx=this.detailRowHeightPx();return computeVariableVirtualWindow({totalRows,rowHeight:i=>fullWidthHeight?.(i)??(isDetailRow(rows[i])?detailPx:uniform),viewportHeight,scrollTop:this.scrollTop,overscan})}if(fullWidthHeight!==null&&fullWidth!==null&&fullWidth.layout().fullWidthRows.length>0){return computeVariableVirtualWindow({totalRows,rowHeight:i=>fullWidthHeight(i)??uniform,viewportHeight,scrollTop:this.scrollTop,overscan})}return computeVirtualWindow({totalRows,rowHeight:uniform,viewportHeight,scrollTop:this.scrollTop,overscan})}getDisplayRows(){if(!this.usingColumnDefsApi())return[];if(this.serverSideState!==null){return this.memoizedServerRows(this.serverSideState,()=>this.materializeServerSideRows())}if(this.viewportState!==null){return this.memoizedServerRows(this.viewportState,()=>this.viewportEngine().materializeViewportRows(this.viewportState))}if(this.infiniteCache!==null){return this.memoizedServerRows(this.infiniteCache,()=>materializeInfiniteRows(this.infiniteCache))}this.serverDisplayRowsCache=null;return this.engineRows()}memoizedServerRows(key,build){const cache=this.serverDisplayRowsCache;if(cache!==null&&cache.key===key)return cache.rows;const rows=build();this.serverDisplayRowsCache={key,rows};return rows}serverSideModeActive(){return this.serverSideDatasource!=null&&this.usingColumnDefsApi()&&this.proAllowed("grid.server-side-row-model","serverSideDatasource")&&this.proModuleAvailable("grid.server-side-row-model","serverSideDatasource","ssrm-ops")}serverSidePivotModeActive(){return this.serverSideModeActive()&&this.pivotMode===true&&this.proAllowed("grid.pivot","pivotMode")}normalizeServerSideFields(value){if(!Array.isArray(value))return[];const seen=new Set;const fields=[];for(const candidate of value){if(typeof candidate!=="string"||candidate===""||seen.has(candidate))continue;seen.add(candidate);fields.push(candidate)}return fields}serverSideRowGroupFields(){let source=this.serverSideGroupCols;if(this.serverSidePivotModeActive()&&Array.isArray(this.pivotRowGroupColumns)){source=this.pivotRowGroupColumns}return this.normalizeServerSideFields(source)}serverSideColumnField(column){if(typeof column==="string")return column===""?null:column;if(column===void 0||column===null)return null;for(const candidate of[column.field,column.colId,column.id]){if(typeof candidate==="string"&&candidate!=="")return candidate}return null}serverSideColumnDescriptor(field,aggFunc){const source=this.declaredColumnDefs().find(column=>column.field===field||column.colId===field);const sourceField=source?.field??field;const colId=source?.colId??sourceField;return{id:colId,colId,field:sourceField,displayName:source?.headerName??sourceField,...typeof aggFunc==="string"&&aggFunc!==""?{aggFunc}:{}}}serverSideRequestColumns(){const rowGroupCols=this.serverSideRowGroupFields().map(field=>this.serverSideColumnDescriptor(field));if(!this.serverSidePivotModeActive()){const valueCols2=this.declaredColumnDefs().filter(column=>typeof column.aggFunc==="string"&&column.aggFunc!=="").map(column=>this.serverSideColumnDescriptor(column.field,column.aggFunc));return{rowGroupCols,pivotCols:[],valueCols:valueCols2}}const pivotCols=this.normalizeServerSideFields(this.pivotColumns).map(field=>this.serverSideColumnDescriptor(field));const valueCols=this.normalizeServerSideFields(this.pivotValueColumns).map(field=>{const source=this.declaredColumnDefs().find(column=>column.field===field);const aggFunc=this.pivotAggFuncs?.[field]??source?.aggFunc??"sum";return this.serverSideColumnDescriptor(field,aggFunc)});return{rowGroupCols,pivotCols,valueCols}}isServerSidePivotResultColumn(value){if(value===null||typeof value!=="object"||Array.isArray(value))return false;try{const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}catch{return false}}serverSidePivotResultColumnDef(column,index2,path,depth,budget){if(depth>12||budget.count>=512||!this.isServerSidePivotResultColumn(column))return null;budget.count+=1;const children=[];if(Array.isArray(column.children)){for(let childIndex=0;childIndex<column.children.length;childIndex+=1){const child=this.serverSidePivotResultColumnDef(column.children[childIndex],childIndex,`${path}.${index2}`,depth+1,budget);if(child!==null)children.push(child)}}const colId=typeof column.colId==="string"&&column.colId!==""?column.colId:void 0;const field=typeof column.field==="string"&&column.field!==""?column.field:colId;let headerName=field??colId??"Pivot";if(typeof column.headerName==="string"&&column.headerName!=="")headerName=column.headerName;if(children.length>0){return{headerName,groupId:colId??field??`server-pivot-${path}.${index2}`,children}}if(field===void 0)return null;const def={field,headerName};if(colId!==void 0)def.colId=colId;for(const key of["width","minWidth","maxWidth","flex"]){const value=column[key];if(typeof value==="number"&&Number.isFinite(value)&&value>0)def[key]=value}if(column.pinned==="left"||column.pinned==="right"){def.pinned=column.pinned}if(typeof column.sortable==="boolean")def.sortable=column.sortable;if(typeof column.resizable==="boolean")def.resizable=column.resizable;return def}serverSidePivotColumnDefs(){if(!this.serverSidePivotModeActive())return[];const declared=this.declaredColumnDefs();const rowGroupDefs=[];for(const field of this.serverSideRowGroupFields()){const source=declared.find(column=>column.field===field||column.colId===field);if(source===void 0){rowGroupDefs.push({field,headerName:field})}else{rowGroupDefs.push({...source,field:source.field})}}const state=this.serverSideState;if(state===null)return rowGroupDefs;const rich=[];const budget={count:0};for(let index2=0;index2<state.pivotResultColumns.length&&budget.count<512;index2+=1){const resolved=this.serverSidePivotResultColumnDef(state.pivotResultColumns[index2],index2,"root",0,budget);if(resolved!==null)rich.push(resolved)}let generated=rich;if(rich.length===0&&state.pivotResultFields.length>0){const remaining=Math.max(0,512-budget.count);generated=state.pivotResultFields.slice(0,remaining).map(field=>({field,headerName:field}))}if(generated.length===0)return rowGroupDefs;const rowFields=new Set(rowGroupDefs.map(column=>column.field));return[...rowGroupDefs,...generated.filter(column=>Array.isArray(column.children)||!rowFields.has(column.field))]}serverGroupKeyOf=(row,level)=>{const cols=this.serverSideState?.rowGroupCols??[];const field=this.serverSideColumnField(cols[level]);const v=field!==null?readOwnFieldPath(row,field):void 0;return v==null?"":String(v)};serverSideFlatten(){const state=this.serverSideState;if(state===null)return[];return this.ssrmEngine().flattenServerSide(state,this.serverGroupKeyOf)}materializeServerSideRows(){if(this.ssrmSelection!==null&&this.ssrmProjectionSource!==this.serverSideState){this.ssrmSelGesture(f=>f.reproject())}const{serialiseGroupPath}=this.ssrmEngine();return this.serverSideFlatten().map((r,idx)=>{if(r.kind==="loading")return makeLoadingPlaceholderRow(idx,r.status??"loading");if(r.kind==="leaf")return r.data??{};const path=r.groupKeys;const last=path.length>0?path[path.length-1]:"";const childNode=this.serverSideState?.nodes[serialiseGroupPath(path)];const leafCount=childNode!==void 0&&childNode.lastRowKnown?childNode.rowCount:-1;return{__syTreeRow:true,path,key:serialiseGroupPath(path),label:last===""?this.resolvedMessages["filter.setBlanksLabel"]:last,depth:r.level,row:r.data,filler:false,hasChildren:true,leafCount,expanded:r.expanded}})}maybeFetchServerBlocks(){const state=this.serverSideState;if(state===null||this.serverSideDatasource==null||!this.serverSideModeActive())return;if(!this.proWorkAllowed("grid.server-side-row-model","serverSideDatasource"))return;const flat=this.serverSideFlatten();const win=this.virtualWindow;const start=win!==null?win.startIndex:0;const end=win!==null?win.endIndex:Math.min(flat.length||state.blockSize,state.blockSize);const filterModel=this.infiniteFilterModel();if(filterModel===null){this.lastServerFetchWindow=null;return}const prev=this.lastServerFetchWindow;if(prev!==null&&prev.start===start&&prev.end===end)return;this.lastServerFetchWindow={start,end};const{markServerBlockLoading,serverBlocksToLoad,touchServerSideVisible}=this.ssrmEngine();const touched=touchServerSideVisible(state,flat,start,end);if(touched!==state)this.serverSideState=touched;const requests=serverBlocksToLoad(touched,flat,start,end);if(requests.length===0)return;let next=touched;for(const req of requests)next=markServerBlockLoading(next,req.path,req.blockNumber);this.serverSideState=next;for(const req of requests){this.dispatchServerBlock(req.path,req.groupKeys,req.blockNumber,req.startRow,req.endRow,filterModel)}}dispatchServerBlock(path,groupKeys,blockNumber,startRow,endRow,filterModel){const ds=this.serverSideDatasource;const state=this.serverSideState;if(ds==null||state===null)return;const{applyServerBlockFailure,applyServerBlockSuccess}=this.ssrmEngine();const gen=this.serverSideGen;const floor=this.ssrmRefreshFloors.get(path)??0;const landingStale=()=>{if(gen!==this.serverSideGen||this.serverSideState===null)return true;if((this.ssrmRefreshFloors.get(path)??0)!==floor){this.ssrmDiscardedStaleLandings+=1;return true}return false};ds.getRows({groupKeys,pivotMode:state.pivotMode,rowGroupCols:[...state.rowGroupCols],pivotCols:[...state.pivotCols],valueCols:[...state.valueCols],startRow,endRow,sortModel:this.infiniteSortModel(),filterModel,quickFilter:this.infiniteQuickFilter(),conditionModel:this.infiniteConditionModel()},result=>{if(landingStale())return;const before=this.serverSideState;const next=applyServerBlockSuccess(before,path,blockNumber,result);if(path===""&&(next.pivotResultFields!==before.pivotResultFields||next.pivotResultColumns!==before.pivotResultColumns)){this.serverPivotResultsStale=false}this.serverSideState=next;this.lastServerFetchWindow=null;this.recomputeVirtualWindow()},()=>{if(landingStale())return;this.serverSideState=applyServerBlockFailure(this.serverSideState,path,blockNumber)})}retryServerBlock(displayIndex){const state=this.serverSideState;if(state===null||this.serverSideDatasource==null)return;if(!this.proWorkAllowed("grid.server-side-row-model","serverSideDatasource"))return;const row=this.serverSideFlatten()[displayIndex];if(row===void 0||row.kind!=="loading"||row.status!=="failed")return;const filterModel=this.infiniteFilterModel();if(filterModel===null)return;const blockNumber=Math.floor(row.childIndex/state.blockSize);this.serverSideState=this.ssrmEngine().markServerBlockLoading(state,row.parentPath,blockNumber);this.lastServerFetchWindow=null;this.dispatchServerBlock(row.parentPath,[...row.groupKeys],blockNumber,blockNumber*state.blockSize,(blockNumber+1)*state.blockSize,filterModel)}initServerSide(){if(this.serverSideDatasource!=null&&(!this.proAllowed("grid.server-side-row-model","serverSideDatasource")||!this.proWorkAllowed("grid.server-side-row-model","serverSideDatasource"))){if(this.proGate().displayState("grid.server-side-row-model")==="valid"){this.heldLicenseInits.hold("server-side","grid.server-side-row-model")}return}this.heldLicenseInits.drop("server-side");this.serverSideGen+=1;if(this.serverSideDatasource!=null&&!this.proModuleAvailable("grid.server-side-row-model","serverSideDatasource","ssrm-ops")){return}if(this.serverSideDatasource!=null&&this.proUiChunks["ssrm-ops"]===void 0)return;this.lastServerFetchWindow=null;this.teardownSsrmRuntime();this.ssrmEpoch+=1;this.ssrmRefreshFloors.clear();this.serverPivotResultsStale=false;if(this.serverSideDatasource==null){if(this.serverSideState!==null)this.serverSideState=null;return}const request=this.serverSideRequestColumns();const{createServerSideState}=this.ssrmEngine();this.serverSideState=createServerSideState({pivotMode:this.serverSidePivotModeActive(),rowGroupCols:request.rowGroupCols,pivotCols:request.pivotCols,valueCols:request.valueCols,blockSize:this.cacheBlockSize,maxBlocks:typeof this.maxBlocksInCache==="number"?this.maxBlocksInCache:null})}serverSideDatasourceChanged(){this.liveObjectModel?.invalidateRows("data-replaced");this.initServerSide()}serverSideGroupColsChanged(){this.liveObjectModel?.invalidateRows("data-replaced");this.initServerSide()}viewportModeActive(){return this.viewportDatasource!=null&&this.usingColumnDefsApi()&&this.proAllowed("grid.viewport-row-model","viewportDatasource")}initViewport(){this.viewportGen+=1;const gen=this.viewportGen;const ds=this.viewportDatasource;if(ds==null){this.heldLicenseInits.drop("viewport");if(this.viewportState!==null)this.viewportState=null;return}if(!this.proAllowed("grid.viewport-row-model","viewportDatasource")||!this.proWorkAllowed("grid.viewport-row-model","viewportDatasource")){if(this.proGate().displayState("grid.viewport-row-model")==="valid"){this.heldLicenseInits.hold("viewport","grid.viewport-row-model")}return}this.heldLicenseInits.drop("viewport");const viewportChunk=this.proUiChunks["viewport-row-model"];if(viewportChunk===void 0)return;const{applyViewportRowData,createViewportState,setViewportRowCount}=viewportChunk;this.viewportState=createViewportState();const feedFrozen=()=>{if(!this.proGate().frozen("grid.viewport-row-model"))return false;this.viewportFeedHeld=true;return true};ds.init({setRowCount:count=>{if(gen!==this.viewportGen||this.viewportState===null)return;if(feedFrozen())return;this.viewportState=setViewportRowCount(this.viewportState,count);this.recomputeVirtualWindow()},setRowData:(startIndex,rows)=>{if(gen!==this.viewportGen||this.viewportState===null)return;if(feedFrozen())return;const safeRows=Array.isArray(rows)?rows:[];this.viewportState=applyViewportRowData(this.viewportState,startIndex,safeRows)}})}viewportDatasourceChanged(_value,oldValue){oldValue?.destroy?.();this.liveObjectModel?.invalidateRows("data-replaced");this.initViewport();this.recomputeVirtualWindow()}maybeUpdateViewportRange(){const state=this.viewportState;const ds=this.viewportDatasource;if(state===null||ds==null||!this.viewportModeActive())return;if(!this.proWorkAllowed("grid.viewport-row-model","viewportDatasource"))return;if(this.serverSideModeActive())return;const win=this.virtualWindow;const firstVisible=win!==null?win.startIndex:0;const lastVisible=(win!==null?win.endIndex:Math.min(state.rowCount,1))-1;const{applyViewportRange,viewportRangeToRequest}=this.viewportEngine();const req=viewportRangeToRequest(state,firstVisible,lastVisible,0);if(req===null)return;if(req.firstRow===state.requestedFirst&&req.lastRow===state.requestedLast)return;const filterModel=this.infiniteFilterModel();if(filterModel===null)return;this.viewportState=applyViewportRange(state,req.firstRow,req.lastRow);ds.setViewportRange(req.firstRow,req.lastRow,{sortModel:this.infiniteSortModel(),filterModel,...this.infiniteQuickFilter()===void 0?{}:{quickFilter:this.infiniteQuickFilter()},...this.infiniteConditionModel()===void 0?{}:{advancedFilterModel:this.infiniteConditionModel()}})}infiniteModeActive(){return this.datasource!=null&&this.usingColumnDefsApi()}initInfiniteCache(){this.infiniteCacheGen+=1;this.lastFetchedWindow=null;if(this.datasource==null){if(this.infiniteCache!==null)this.infiniteCache=null;return}this.infiniteCache=createInfiniteCache({blockSize:this.cacheBlockSize,maxBlocks:typeof this.maxBlocksInCache==="number"?this.maxBlocksInCache:null})}datasourceChanged(){this.liveObjectModel?.invalidateRows("data-replaced");this.initInfiniteCache()}maybeFetchInfiniteBlocks(){if(this.infiniteCache===null||!this.infiniteModeActive())return;if(this.serverSideModeActive()||this.viewportModeActive())return;const win=this.virtualWindow;const startRow=win!==null?win.startIndex:0;const endRow=win!==null?win.endIndex:this.effectiveBlockSize();const prev=this.lastFetchedWindow;if(prev!==null&&prev.startRow===startRow&&prev.endRow===endRow)return;this.lastFetchedWindow={startRow,endRow};this.requestInfiniteBlocks(startRow,endRow)}effectiveBlockSize(){return this.infiniteCache!==null?this.infiniteCache.blockSize:this.cacheBlockSize}requestInfiniteBlocks(startRow,endRow,includeFailed=false){const cache=this.infiniteCache;const ds=this.datasource;if(cache===null||ds==null)return;let next=touchRange(cache,startRow,endRow);const toLoad=blocksToLoadForRange(next,startRow,endRow,includeFailed);if(toLoad.length===0){if(next!==cache)this.infiniteCache=next;return}const filterModel=this.infiniteFilterModel();if(filterModel===null){this.lastFetchedWindow=null;return}for(const block of toLoad)next=markBlockLoading(next,block);this.infiniteCache=next;const gen=this.infiniteCacheGen;const blockSize=next.blockSize;const sortModel=this.infiniteSortModel();const quickFilter=this.infiniteQuickFilter();const conditionModel=this.infiniteConditionModel();for(const block of toLoad){const bounds=blockBounds(block,blockSize);ds.getRows({startRow:bounds.startRow,endRow:bounds.endRow,sortModel,filterModel,quickFilter,conditionModel,success:(rows,lastRow)=>this.onInfiniteBlockSuccess(block,rows,lastRow,gen),fail:()=>this.onInfiniteBlockFailure(block,gen)})}}infiniteSortModel(){return this.activeSortModel.map(entry=>({colId:entry.field,sort:entry.direction}))}infiniteFilterModel(){const customCount=this.configuredLifecycleFilterCount();if(this.externalFilter!=null){if(!this.externalFilterRuntimeReady())return null;const external=this.filterFacade?.getExternalFilter();if(external===null||external===void 0)return null;const present2=external.isPresent();if(external.getPredicateError()!==null)return null;if(present2){const signature="remote-external-filter";if(!this.componentRemoteFilterErrors.has(signature)){this.componentRemoteFilterErrors.add(signature);this.emitComponentError({code:"MODEL_FAILED",phase:"model",componentKind:"filter",retryable:false,cause:new Error("External filter predicates cannot be serialized for a remote row model.")})}return null}}if(customCount===0)return{...this.licensedActiveFilters()};if(this.componentFilterReadyRevision!==this.componentFilterRevision){return null}const facade=this.filterFacade;const stats=facade?.stats();if(facade===null||stats===void 0||stats.columns!==customCount||stats.mountedFilters!==customCount){return null}const snapshot=facade.getSerializableModels();if(snapshot.errors.length>0)return null;return{...this.licensedActiveFilters(),...snapshot.models}}licensedActiveFilters(){let out=null;for(const[key,filter]of Object.entries(this.activeFilters)){if(filter.kind!=="set"&&filter.kind!=="multi")continue;const allowed=filter.kind==="set"?this.filterKindAllowed("set",true):this.filterKindAllowed("multi",filter.spec.parts.some(part=>part.kind==="set"));if(allowed)continue;if(out===null)out={...this.activeFilters};delete out[key]}return out??this.activeFilters}infiniteQuickFilter(){return typeof this.quickFilterValue==="string"&&this.quickFilterValue!==""?this.quickFilterValue:void 0}infiniteConditionModel(){if(this.activeConditionTree==null)return void 0;return this.proAllowed("grid.advanced-filter","setConditionFilter")?this.activeConditionTree:void 0}infiniteModelInputsChanged(){if(this.serverSideModeActive()){this.initServerSide();if(this.viewportEl)this.viewportEl.scrollTop=0;this.scrollTop=0;this.recomputeVirtualWindow();return}if(this.viewportModeActive()&&this.viewportState!==null){this.viewportState=this.viewportEngine().purgeViewport(this.viewportState);if(this.viewportEl)this.viewportEl.scrollTop=0;this.scrollTop=0;this.recomputeVirtualWindow();return}if(!this.infiniteModeActive())return;this.initInfiniteCache();if(this.viewportEl)this.viewportEl.scrollTop=0;this.scrollTop=0;this.recomputeVirtualWindow()}onInfiniteBlockSuccess(block,rows,lastRow,gen){if(gen!==this.infiniteCacheGen||this.infiniteCache===null)return;const safeRows=Array.isArray(rows)?rows:[];const lr=typeof lastRow==="number"?lastRow:null;this.infiniteCache=applyBlockSuccess(this.infiniteCache,block,safeRows,lr)}onInfiniteBlockFailure(block,gen){if(gen!==this.infiniteCacheGen||this.infiniteCache===null)return;this.infiniteCache=applyBlockFailure(this.infiniteCache,block)}retryInfiniteBlock(rowIndex){if(this.infiniteCache===null)return;const blockSize=this.infiniteCache.blockSize;const start=Math.floor(rowIndex/blockSize)*blockSize;this.lastFetchedWindow=null;this.requestInfiniteBlocks(start,start+blockSize,true)}async refreshInfiniteCache(){if(!this.infiniteModeActive())return;this.liveObjectModel?.invalidateRows("data-replaced");this.initInfiniteCache()}async refreshRowHeights(){if(this.rowHeightCache!==null)this.rowHeightCache.reset();this.lastMeasuredRowsRef=null;this.lastMeasuredLayoutSig="";this.recomputeVirtualWindow();this.autoHeightVersion++}async scrollToTop(){if(this.viewportEl)this.viewportEl.scrollTop=0;this.scrollTop=0;this.recomputeVirtualWindow()}async selectRows(ids){if(!Array.isArray(ids))return;if(this.serverSideModeActive()){(await this.ssrmSel()).replaceWithIds(ids.map(String));return}const previous=this.selectionState;let working=clearSelection(previous);for(const id of ids){working=selectRow(working,id)}this.rangeAnchorRowId=null;if(working===previous)return;this.selectionState=working;const diff=diffSelection(previous,working);if(diff.addedIds.length===0&&diff.removedIds.length===0)return;this.fireSelectionChanged({mode:working.mode,selectedRowIds:Array.from(working.selectedRowIds),addedIds:diff.addedIds,removedIds:diff.removedIds},"api")}async getSelectedRowIds(){return Array.from(this.selectionState.selectedRowIds)}async applyTransaction(transaction,label,opts){const editSource=opts?.source??"local";const sourceRows=this.rowData??[];const result=applyRowTransaction(sourceRows,transaction,{getRowId:this.getRowId});if(this.liveObjectModel!==null&&result.added.length>0&&result.removed.length>0){const removedIds=new Set(result.removed.map(entry=>this.collabRowId(entry.row,entry.index)));const reusedIds=new Set(result.added.map(entry=>this.collabRowId(entry.row,entry.index)).filter(id=>removedIds.has(id)));for(const id of reusedIds){this.liveObjectModel.invalidateRow(id,"data-replaced")}}this.rowData=result.rows;this.fireRowDataChanged({added:result.added,updated:result.updated,removed:result.removed,rejected:result.rejected,txId:result.meta.txId,source:editSource,origin:opts?.origin});const changes=this.emitCellValueChanges(result.updated,editSource,opts?.origin,result.meta.txId);if(editSource==="remote")this.remoteEditApplied.emit({changes,origin:opts?.origin});const mutated=result.added.length+result.updated.length+result.removed.length;if(mutated>0&&editSource!=="remote"){const inverse=invertTransactionResult(result);this.undoRedoStack.record(transaction,inverse,label)}return result}emitCellValueChanges(updated,source,origin,txId,options={}){const cols=this.resolvedColumnDefs();const changes=[];const auditSource=origin==="clipboard"?"clipboard":source;for(const u of updated){const rowId=this.collabRowId(u.row,u.index);for(let c=0;c<cols.length;c+=1){const field=cols[c]?.field;if(typeof field!=="string"||field.length===0)continue;const oldValue=this.publicNumericValue(readOwnFieldPath(u.previous,field));const newValue=this.publicNumericValue(readOwnFieldPath(u.row,field));if(Object.is(oldValue,newValue))continue;const displayRowIndex=options.displayRowIndex??u.index;const detail={rowIndex:displayRowIndex,sourceRowIndex:u.index,colIndex:c,field,rowId,oldValue,newValue,data:u.row,context:this.context,source,origin,txId};changes.push(detail);this.cellValueChanged.emit(detail);if(this.auditTrail!==null){this.recordAudit({kind:"cell",source:auditSource,rowId,field,oldValue,newValue,txId})}this.flashCell(displayRowIndex,field)}}return changes}collabRowId(row,index2){const fn=this.getRowId;if(fn){try{const id=fn(row);if(id!==void 0&&id!==null)return id}catch{}}return index2}async undo(){const entry=this.undoRedoStack.undo();if(entry===null)return false;const source=this.rowData??[];const result=applyRowTransaction(source,entry.inverse,{getRowId:this.getRowId});this.rowData=result.rows;this.fireRowDataChanged({added:result.added,updated:result.updated,removed:result.removed,rejected:result.rejected,txId:result.meta.txId,source:"undo"});this.emitCellValueChanges(result.updated,"undo",void 0,result.meta.txId);return true}async redo(){const entry=this.undoRedoStack.redo();if(entry===null)return false;const source=this.rowData??[];const result=applyRowTransaction(source,entry.forward,{getRowId:this.getRowId});this.rowData=result.rows;this.fireRowDataChanged({added:result.added,updated:result.updated,removed:result.removed,rejected:result.rejected,txId:result.meta.txId,source:"redo"});this.emitCellValueChanges(result.updated,"redo",void 0,result.meta.txId);return true}async clearHistory(){this.undoRedoStack.clear()}async connectCollabRoom(opts){const room=this.collaborationRoom;const pending={session:null};try{return await this.proMethod("connectCollabRoom",{validate:()=>{if(this.collabSession!==null)return{result:this.collabSession.getStatus()};if(room===void 0||room.length===0)return{result:"offline"};return void 0},load:async()=>{throw new GridChunkLoadError("collab","unknown","source")},exec:gen=>gen,publish:gen=>{const session=pending.session;pending.session=null;if(gen!==this.collabConnectGen||this.collaborationRoom!==room||this.collabSession!==null){session?.disconnect();return this.collabSession!==null?this.collabSession.getStatus():"offline"}this.collabSession=session;return this.collabSession!==null?this.collabSession.getStatus():"offline"}})}finally{pending.session?.disconnect()}}kickCollabConnect(){if(!this.collaborationRoom||this.collabSession!==null||this.hasDisconnected)return;if(!this.proAllowed("grid.collaboration","collaborationRoom"))return;if(!this.proWorkAllowed("grid.collaboration","collaborationRoom")){this.collabFreeze.holdJoin();return}void this.connectCollabRoom().catch(()=>void 0)}async preloadChunks(ids){for(const features of gridChunkProFeatureSets(ids)){await this.proGate().admitAny(features,"preloadChunks")}await this.getChunkLoader().preload(ids)}collabConnectGen=0;onCollaborationRoomChange(){this.collabConnectGen++;this.collabSession?.disconnect();this.collabSession=null;this.closeCommentPanel();this.cellCommentIndex=new Map;this.seenCommentIds=new Set;this.clearConflictUi();if(this.collaborationRoom)this.kickCollabConnect()}async disconnectCollabRoom(){return this.proRun("disconnectCollabRoom",()=>{this.collabFreeze.reset();this.collabConnectGen++;this.collabSession?.disconnect();this.collabSession=null;this.closeCommentPanel();this.cellCommentIndex=new Map;this.seenCommentIds=new Set;this.clearConflictUi()})}async getSyncStatus(){return this.proRun("getSyncStatus",()=>this.collabSession!==null?this.collabSession.getStatus():"offline")}async getCollaborators(){return this.proRun("getCollaborators",()=>this.collabSession!==null?this.collabSession.getCollaborators():[])}async addCellComment(rowId,field,text,parentId){return this.proMethod("addCellComment",{load:()=>this.cellNotesModule(),exec:()=>void 0,publish:()=>this.collabSession?.addCellComment?.(rowId,field,text,parentId)??null})}async cellNotesModule(){throw new GridChunkLoadError("collab","unknown","source")}async getCellComments(rowId,field){return this.proRun("getCellComments",()=>this.collabSession?.getCellComments?.(rowId,field)??[])}async setCellCommentResolved(rowId,field,commentId,resolved){return this.proMethod("setCellCommentResolved",{load:()=>this.cellNotesModule(),exec:()=>void 0,publish:()=>this.collabSession?.setCellCommentResolved?.(rowId,field,commentId,resolved)??false})}async deleteCellComment(rowId,field,commentId){return this.proMethod("deleteCellComment",{load:()=>this.cellNotesModule(),exec:()=>void 0,publish:()=>this.collabSession?.deleteCellComment?.(rowId,field,commentId)??false})}async getDataAsCsv(options={}){return this.createCsvExportResult(options)}async exportDataAsCsv(options={}){const result=this.createCsvExportResult(options);this.downloadCsvFile(result.csv,options.fileName);return result}createCsvExportResult(options={}){const sourceColumns=this.columnDefs??[];const visibleColumns=[];for(let i=0;i<sourceColumns.length;i++){const c=sourceColumns[i];if(c.hidden===true||c.hide===true)continue;visibleColumns.push({field:c.field,headerName:c.headerName,valueGetter:c.valueGetter,valueFormatter:c.valueFormatter})}const sourceRows=this.maskRowsForRead(this.rowData??[],this.resolvedColumnDefs());return getDataAsCsv({...options,columns:visibleColumns,rows:sourceRows})}downloadCsvFile(csv,fileName){const doc=this.host?.ownerDocument??document;const view=doc.defaultView??window;const blob=new Blob([csv],{type:"text/csv;charset=utf-8"});const url=view.URL.createObjectURL(blob);const anchor=doc.createElement("a");anchor.href=url;anchor.download=normalizeCsvFileName(fileName);anchor.style.display="none";doc.body.appendChild(anchor);anchor.click();anchor.remove();view.setTimeout(()=>view.URL.revokeObjectURL(url),0)}async getDataAsExcel(options={}){return this.proMethod("getDataAsExcel",{load:()=>this.loadExportXlsxChunk(),exec:()=>this.createExcelBytes(options)})}async exportDataAsExcel(options={}){return this.proMethod("exportDataAsExcel",{load:()=>this.loadExportXlsxChunk(),exec:()=>this.createExcelBytes(options),publish:bytes=>this.downloadXlsxFile(bytes,options.fileName)})}async createExcelBytes(options){const{buildXlsxWorkbook,gridColumnsToWorkbook,cfStyleToXlsx}=await this.loadExportXlsxChunk();const sourceColumns=this.columnDefs??[];const columnKeys=options.columnKeys;const cols=[];for(const c of sourceColumns){if(c.hidden===true||c.hide===true)continue;if(columnKeys&&!columnKeys.includes(c.field))continue;const live=this.columnWidths.get(c.field);const width=typeof live==="number"?live:typeof c.width==="number"?c.width:void 0;cols.push({field:c.field,headerName:c.headerName,width})}let rows;if(options.onlySelected===true&&this.selectionState.mode!=="none"){const selected=this.selectionState.selectedRowIds;rows=[];this.getDisplayRows().forEach((r,displayIndex)=>{const id=this.extractRowId(r,displayIndex);if(id!==void 0&&selected.has(id))rows.push(r)})}else{rows=(this.rowData??[]).slice()}const includeHeaders=options.skipHeaders!==true;const headerShift=includeHeaders?1:0;const sheet=this.formulaSheet;const formulaCore=this.formulaCore;const preserveFormulas=this.formulas===true&&sheet!==null&&sheet.active&&options.onlySelected!==true&&formulaCore!==null;const sourceColumnByField=new Map(sourceColumns.map(col=>[col.field,col]));const maskedRowCache=[];const rowForExportExtensions=(row,rowIndex)=>{const rawRow=row;if(!this.readPolicyConfigured())return rawRow;const cached=maskedRowCache[rowIndex];if(cached!==void 0)return cached;const masked=this.maskDeniedFields(rawRow,rowIndex,sourceColumns,rawRow,-1);maskedRowCache[rowIndex]=masked;return masked};const cacheValue=v=>{if(v===null||v===void 0)return null;if(typeof v==="number"&&Number.isFinite(v)||typeof v==="boolean")return v;return String(v)};const wb=gridColumnsToWorkbook({columns:cols,rows,sheetName:options.sheetName,includeHeaders,getCellValue:(row,col,rowIndex)=>{const rawRow=row;const extensionRow=rowForExportExtensions(row,rowIndex);const colDef=sourceColumnByField.get(col.field);const withCf=(base,cfValue)=>{if(this.conditionalFormats===void 0||this.conditionalFormats.length===0)return base;const cf=evaluateConditionalFormats(this.conditionalFormats,{field:col.field,value:cfValue});const style=cfStyleToXlsx(cf);if(style===null)return base;return typeof base==="object"&&base!==null?{...base,style}:{value:base,style}};if(colDef!==void 0&&!this.isCellReadable(this.rawFieldValue(rawRow,rowIndex,colDef),rawRow,-1,colDef)){return withCf(this.maskedCellValue,this.maskedCellValue)}if(preserveFormulas){if(typeof colDef?.formula==="string"&&sheet.isCalculatedField(col.field)){const anchored=formulaCore.anchorFormulaToRow(colDef.formula,rowIndex+1+headerShift);const v=cacheValue(sheet.calculatedDisplay(col.field,row));return withCf({value:v,formula:anchored.replace(/^=/,"")},v)}const raw=readOwnFieldPath(row,col.field);if(isFormulaText(raw)){const shifted=formulaCore.shiftFormulaRows(String(raw),headerShift);const v=cacheValue(this.formulaCellDisplay(sheet,String(raw),col.field,row));return withCf({value:v,formula:shifted.replace(/^=/,"")},v)}}const cellVal=this.excelCellValue(extensionRow,col,colDef,rowIndex);return withCf(cellVal,cellVal)}});return buildXlsxWorkbook(wb)}excelCellValue(row,col,colDef,rowIndex){const colId=colDef?.colId??col.field;let value=this.resolveGridCellValue({row,rowIndex,colId,field:col.field,valueGetter:colDef?.valueGetter,colDef});if(value===null||value===void 0)return null;if(typeof value==="number")return Number.isFinite(value)?value:String(value);if(typeof value==="boolean")return value;if(colDef?.valueFormatter!==void 0&&colDef?.valueFormatter!==null){try{return this.formatGridCellValue({value,row,rowIndex,colId,valueFormatter:colDef.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef})}catch{}}return String(value)}downloadXlsxFile(bytes,fileName){const doc=this.host?.ownerDocument??document;const view=doc.defaultView??window;const blobBytes=new ArrayBuffer(bytes.byteLength);new Uint8Array(blobBytes).set(bytes);const blob=new Blob([blobBytes],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});const url=view.URL.createObjectURL(blob);const base=typeof fileName==="string"&&fileName.trim()!==""?fileName.trim():"export.xlsx";const anchor=doc.createElement("a");anchor.href=url;anchor.download=/\.xlsx$/i.test(base)?base:`${base}.xlsx`;anchor.style.display="none";doc.body.appendChild(anchor);anchor.click();anchor.remove();view.setTimeout(()=>view.URL.revokeObjectURL(url),0)}async importCsvText(text,options={}){return this.applyCsvImport(text,options)}applyCsvImport(text,options){const parsed=csvToGrid(text,{delimiter:options.delimiter,hasHeader:options.hasHeader});this.columnDefs=parsed.columns.map(c=>({field:c.field,headerName:c.headerName}));this.rowData=parsed.rowData;const detail={rowCount:parsed.rowData.length,columnCount:parsed.columns.length};this.csvImported.emit(detail);return detail}openCsvFilePicker=()=>{this.csvFileInputEl?.click()};handleCsvFileChosen=event=>{const input=event.target;const file=input?.files?.[0];if(!file)return;const reader=new FileReader;reader.onload=()=>{const text=typeof reader.result==="string"?reader.result:"";this.csvWizard={text,fileName:file.name,hasHeader:true,delimiter:"auto"}};reader.readAsText(file);if(input)input.value=""};updateCsvWizard(patch){if(this.csvWizard===null)return;this.csvWizard={...this.csvWizard,...patch}}cancelCsvWizard=()=>{this.csvWizard=null;this.restoreCsvWizardFocus()};confirmCsvWizard=()=>{const w=this.csvWizard;if(w===null)return;this.applyCsvImport(w.text,{delimiter:w.delimiter==="auto"?void 0:w.delimiter,hasHeader:w.hasHeader});this.csvWizard=null;this.restoreCsvWizardFocus()};restoreCsvWizardFocus(){this.csvWizardFocused=false;const btn=this.csvImportButtonEl;if(btn!==null&&typeof btn.focus==="function")btn.focus()}maybeFocusCsvWizard(){if(this.csvWizard===null||this.csvWizardFocused)return;const dialog=this.csvWizardEl;if(dialog===null)return;this.csvWizardFocused=true;const first=dialog.querySelector('input, select, button:not([disabled]), [tabindex]:not([tabindex="-1"])');(first??dialog).focus()}handleCsvWizardKeyDown=event=>{if(event.key!=="Tab")return;const dialog=this.csvWizardEl;if(dialog===null)return;const focusables=Array.from(dialog.querySelectorAll('input, select, button:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(el=>el.offsetParent!==null||el===dialog);if(focusables.length===0)return;const first=focusables[0];const last=focusables[focusables.length-1];const active=this.host.shadowRoot?.activeElement??document.activeElement;if(event.shiftKey&&active===first){event.preventDefault();last.focus()}else if(!event.shiftKey&&active===last){event.preventDefault();first.focus()}};async getDataAsPdf(options={}){return this.proMethod("getDataAsPdf",{load:()=>this.loadExportPdfChunk(),exec:async(pdf,check)=>{const input=await this.createPdfExportInput(pdf,options);check();return pdf.getDataAsPdf(input)}})}async exportDataAsPdf(options={}){const doc=this.host?.ownerDocument??document;return this.proMethod("exportDataAsPdf",{load:()=>this.loadExportPdfChunk(),exec:async(pdf,check)=>{const input=await this.createPdfExportInput(pdf,options);check();return{pdf,input,result:pdf.getDataAsPdf(input)}},publish:({pdf,input,result})=>{pdf.downloadPdfResult(result,input.fileName,doc);return result}})}async createPdfExportInput(pdf,options={}){const columns=this.collectExportColumns();const rows=this.collectExportRows();const input={...options,columns,rows};return this.withAutoPdfFont(pdf,input,columns,rows,options)}async withAutoPdfFont(pdf,input,columns,rows,options){if(input.fontBytes||options.autoFont===false||this.pdfAutoFont===false)return input;const texts=this.collectPdfFontProbeTexts(input,columns,rows);if(!pdf.needsEmbeddedPdfFont(texts))return input;const resolved=await pdf.resolveBrowserPdfFont({texts,fontUrl:options.fontUrl??this.pdfFontUrl,fontBaseName:input.fontBaseName});if(!resolved){throw new Error("sy-grid PDF export contains text outside PDF Standard 14 fonts. Set `pdf-font-url`/`fontUrl` to an app-hosted TTF/OTF, or allow browser local-font access, so the PDF can embed the required glyphs.")}return{...input,fontBytes:resolved.bytes,fontBaseName:input.fontBaseName??resolved.name}}collectPdfFontProbeTexts(options,columns,rows){const texts=[options.title??"",options.footer??"","Page 0123456789 of total"];for(const col of columns)texts.push(col.headerName??col.field);for(let r=0;r<rows.length;r++){const row=rows[r];for(const col of columns){const value=readOwnFieldPath(row,col.field);if(value!==null&&value!==void 0)texts.push(String(value))}}return texts}collectExportColumns(){const sourceColumns=this.columnDefs??[];const visible=[];for(let i=0;i<sourceColumns.length;i++){const c=sourceColumns[i];if(c.hidden===true||c.hide===true)continue;visible.push({field:c.field,headerName:c.headerName,width:typeof c.width==="number"&&c.width>0?c.width:void 0,valueGetter:c.valueGetter,valueFormatter:c.valueFormatter})}return visible}collectExportRows(){return this.maskRowsForRead((this.rowData??[]).slice(),this.resolvedColumnDefs())}async importDataFromXlsx(source,options={}){const xlsx=await this.loadImportXlsxChunk();const result=await xlsx.parseXlsx(source);const target=xlsx.pickXlsxSheet(result,options.sheetName);if(target){const snapshotOptions={preserveFormulas:this.formulas===true,...options.snapshot};const snapshot=xlsx.xlsxSheetToRowData(target,result.styles,snapshotOptions);this.xlsxImported.emit({sheetName:target.meta.name,snapshot,workbookSheetCount:result.workbook.sheets.length})}return result}async getContextMenuItems(target){return this.proRun("getContextMenuItems",()=>{const rows=this.rowData??[];return buildContextMenuItems({rowIndex:target?.rowIndex??-1,field:target?.field,rows})})}buildContextMenuCtx(rowIndex,field){const rows=this.rowData??[];const columns=this.columnDefs??[];return{rowIndex,field,row:rows[rowIndex],rows,columns}}openContextMenu(rowIndex,field,event){if(this.contextMenu!==true||!this.usingColumnDefsApi())return;if(!this.proNewWorkAllowed("grid.context-menu","contextMenu"))return;const panels=this.proUiChunks["pro-panels"];if(panels===void 0)return;event.preventDefault();event.stopPropagation();const ctx=this.buildContextMenuCtx(rowIndex,field);const items=panels.contextMenuItemsFor(this.proPanelsHost(),ctx);if(!Array.isArray(items)||items.length===0)return;const estWidth=200;const estHeight=items.length*32+12;const vw=typeof window!=="undefined"?window.innerWidth:1024;const vh=typeof window!=="undefined"?window.innerHeight:768;const x=Math.min(event.clientX,Math.max(0,vw-estWidth));const y=Math.min(event.clientY,Math.max(0,vh-estHeight));const active=this.host?.shadowRoot?.activeElement??document.activeElement;this.contextMenuReturnFocus=active&&this.host?.contains(active)?active:null;this.contextMenuFocused=false;this.contextMenuState={x,y,items,ctx}}closeContextMenu(){if(this.contextMenuState===null)return;this.contextMenuState=null;this.contextMenuFocused=false;const target=this.contextMenuReturnFocus;this.contextMenuReturnFocus=null;if(target!==null&&typeof target.focus==="function"&&this.host?.contains(target)){target.focus()}}maybeFocusContextMenu(){if(this.contextMenuState===null||this.contextMenuFocused)return;const menu=this.contextMenuEl;if(menu===null)return;this.contextMenuFocused=true;const items=this.enabledContextMenuItems(menu);if(items.length>0)items[0].focus();else menu.focus()}enabledContextMenuItems(menu){return Array.from(menu.querySelectorAll(".sy-grid__context-menu-item:not([disabled])"))}handleContextMenuKeyDown=event=>{const menu=this.contextMenuEl;if(menu===null)return;const key=event.key;if(key==="Tab"){event.preventDefault();this.closeContextMenu();return}if(key!=="ArrowDown"&&key!=="ArrowUp"&&key!=="Home"&&key!=="End")return;event.preventDefault();const items=this.enabledContextMenuItems(menu);if(items.length===0)return;const active=this.host?.shadowRoot?.activeElement??document.activeElement;const current=items.findIndex(el=>el===active);let next;if(key==="Home")next=0;else if(key==="End")next=items.length-1;else if(key==="ArrowDown")next=current<0?0:(current+1)%items.length;else next=current<0?items.length-1:(current-1+items.length)%items.length;items[next].focus()};renderCsvWizard(){const w=this.csvWizard;if(w===null)return null;const messages=this.resolvedMessages;let preview={columns:[],rows:[]};try{const parsed=csvToGrid(w.text,{delimiter:w.delimiter==="auto"?void 0:w.delimiter,hasHeader:w.hasHeader});preview={columns:parsed.columns.slice(0,12),rows:parsed.rowData.slice(0,5)}}catch{}return index.h("div",{class:"sy-grid__csv-wizard-overlay",role:"dialog","aria-modal":"true","aria-label":messages["csvImport.title"],tabindex:"-1",ref:el=>{this.csvWizardEl=el??null},onKeyDown:this.handleCsvWizardKeyDown},index.h("div",{class:"sy-grid__csv-wizard"},index.h("div",{class:"sy-grid__csv-wizard-head"},index.h("strong",null,messages["csvImport.title"]),index.h("span",{class:"sy-grid__csv-wizard-file"},w.fileName)),index.h("div",{class:"sy-grid__csv-wizard-controls"},index.h("label",{class:"sy-grid__csv-wizard-check"},index.h("input",{type:"checkbox",checked:w.hasHeader,onChange:e=>this.updateCsvWizard({hasHeader:e.target.checked})}),messages["csvImport.firstRowHeader"]),index.h("label",{class:"sy-grid__csv-wizard-delim"},messages["csvImport.delimiter"],index.h("select",{onChange:e=>this.updateCsvWizard({delimiter:e.target.value})},index.h("option",{value:"auto",selected:w.delimiter==="auto"},messages["csvImport.delimiterAuto"]),index.h("option",{value:",",selected:w.delimiter===","},","),index.h("option",{value:";",selected:w.delimiter===";"},";"),index.h("option",{value:" ",selected:w.delimiter===" "},"Tab"),index.h("option",{value:"|",selected:w.delimiter==="|"},"|")))),index.h("div",{class:"sy-grid__csv-wizard-preview"},index.h("table",null,index.h("thead",null,index.h("tr",null,preview.columns.map(c=>index.h("th",null,c.headerName)))),index.h("tbody",null,preview.rows.map(row=>index.h("tr",null,preview.columns.map(c=>index.h("td",null,String(readOwnFieldPath(row,c.field)??"")))))))),index.h("div",{class:"sy-grid__csv-wizard-actions"},index.h("button",{type:"button",class:"sy-grid__toolbar-button",onClick:this.cancelCsvWizard},messages["csvImport.cancel"]),index.h("button",{type:"button",class:"sy-grid__toolbar-button sy-grid__toolbar-button--primary",disabled:preview.columns.length===0,onClick:this.confirmCsvWizard},messages["csvImport.import"]))))}cfBuilder=null;toggleCfBuilder=()=>{void this.getChunkLoader().load("conditional-format").then(chunk=>{this.cfBuilder=chunk;this.cfBuilder.toggleCfBuilder(this)}).catch(()=>void 0)};renderConditionalFormatBuilder(){return this.cfBuilderOpen&&this.cfBuilder!==null?this.cfBuilder.renderConditionalFormatBuilder(this,index.h):null}renderContextMenu(){const panels=this.contextMenu===true&&this.usingColumnDefsApi()&&this.proAllowed("grid.context-menu","contextMenu")?this.proUiChunk("pro-panels","grid.context-menu","contextMenu"):null;if(panels==null||this.contextMenuState===null)return null;return panels.renderContextMenu(this.proPanelsHost())}async copyCellAt(rowIndex,field){const rows=this.getDisplayRows();const columns=this.effectiveColumns();if(rowIndex<0||rowIndex>=rows.length)return false;const colIndex=columns.findIndex(column=>column.field===field);if(colIndex<0||this.copyableDataRowAt(rows,rowIndex)===null)return false;const text=escapeTsvCell(this.cellDisplayText(rowIndex,colIndex,rows,columns),{escapeFormulae:this.clipboardEscapeFormulae});return copyTextToClipboard(text)}async copyRowAt(rowIndex){const rows=this.getDisplayRows();const columns=this.effectiveColumns();if(rowIndex<0||rowIndex>=rows.length)return false;const tsv=serializeManyBoundsToTsv([{top:rowIndex,left:0,bottom:rowIndex,right:columns.length-1}],(row,col)=>this.cellDisplayText(row,col,rows,columns),row=>this.copyableDataRowAt(rows,row)!==null,{escapeFormulae:this.clipboardEscapeFormulae});if(tsv==="")return false;return copyTextToClipboard(tsv)}async getCellTooltipText(target){const rows=this.getDisplayRows();const columns=this.effectiveColumns();if(!target||target.rowIndex<0||target.rowIndex>=rows.length)return"";const column=columns.find(c=>c.field===target.field);if(!column)return"";const displayedRow=rows[target.rowIndex];let sourceRow=isPivotRowGroupMarker(displayedRow)||isPivotGrandTotalRow(displayedRow)||this.isPivotSubtotalDisplayRow(displayedRow)?displayedRow:this.copyableDataRowAt(rows,target.rowIndex);if(sourceRow===null)return"";if(this.readPolicyConfigured()){const col=column;const raw=this.cellRawValue(sourceRow,target.rowIndex,col);if(!this.isCellReadable(raw,sourceRow,target.rowIndex,col)){return this.maskedCellValue}sourceRow=this.maskDeniedFields(sourceRow,target.rowIndex,columns)}return getCellTooltipText({row:sourceRow,rowIndex:target.rowIndex,column,displayedText:target.displayedText,isOverflowing:target.isOverflowing,locale:typeof this.locale==="string"?this.locale:"en",context:this.context,api:this.host})}async getUndoRedoDepth(){return this.undoRedoStack.getDepth()}async setColumnWidth(colId,width){if(typeof colId!=="string"||colId.length===0){console.warn("[SG:COL] width bad id; reject");return}if(typeof width!=="number"||!Number.isFinite(width)){console.warn("[SG:COL] width nonfinite; reject");return}const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===colId);let clamped=width;const lo=this.resolveProgrammaticColumnMinWidth(col);const hi=this.resolveColumnMaxWidth(col,lo);if(clamped<lo){console.warn(`[SG:COL] width=${width} id=${colId} <min=${lo}; clamp`);clamped=lo}else if(clamped>hi){console.warn(`[SG:COL] width=${width} id=${colId} >max=${hi}; clamp`);clamped=hi}const oldWidth=this.resolveEffectiveColumnWidth(colId);const next=new Map(this.columnWidths);next.set(colId,clamped);this.columnWidths=next;this.alignedNotify();this.columnResized.emit({colId,oldWidth:oldWidth??clamped,newWidth:clamped,wasClamped:false});if(!Object.is(oldWidth,clamped)){this.publishLiveObjectChange("column",col?this.liveColumnId(col):colId,"widthChanged","api",{before:oldWidth,after:clamped})}}async resetColumnWidth(colId){if(typeof colId!=="string"||colId.length===0){console.warn("[SG:COL] reset width bad id; reject");return}const live=this.columnWidths.get(colId);if(typeof live!=="number"){return}const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===colId);const fallback=col&&typeof col.width==="number"?col.width:null;const next=new Map(this.columnWidths);next.delete(colId);this.columnWidths=next;this.alignedNotify();if(fallback===null||fallback!==live){this.columnResized.emit({colId,oldWidth:live,newWidth:fallback??live,wasClamped:false})}this.publishLiveObjectChange("column",col?this.liveColumnId(col):colId,"widthChanged","api",{before:live,after:fallback})}async getColumnWidth(colId){if(typeof colId!=="string"||colId.length===0)return null;const live=this.columnWidths.get(colId);if(typeof live==="number")return live;const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===colId);if(!col||typeof col.width!=="number")return null;return col.width}resolveEffectiveColumnWidth(colId){const live=this.columnWidths.get(colId);if(typeof live==="number")return live;const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===colId);if(!col||typeof col.width!=="number")return null;return col.width}resolveProgrammaticColumnMinWidth(col){if(col&&typeof col.minWidth==="number"&&Number.isFinite(col.minWidth)&&col.minWidth>=0){return Math.max(this.minimumColumnWidth,col.minWidth)}return this.minimumColumnWidth}resolveInteractiveColumnMinWidth(col){return Math.max(this.interactiveColumnMinWidth,this.resolveProgrammaticColumnMinWidth(col))}resolveColumnMaxWidth(col,minWidth){if(col&&typeof col.maxWidth==="number"&&Number.isFinite(col.maxWidth)&&col.maxWidth>=minWidth){return col.maxWidth}return Number.POSITIVE_INFINITY}columnLayoutStyle(col){const style={};const colKey=col.colId??col.field;const liveWidth=this.columnWidths.get(colKey);const effectiveWidth=typeof liveWidth==="number"?liveWidth:col.width;if(effectiveWidth!=null){const width=`${effectiveWidth}px`;style.width=width;style.flex=`0 0 ${width}`}else if(col.flex!=null){style.flex=`${col.flex} 1 0`}if(col.minWidth!=null)style.minWidth=`${col.minWidth}px`;if(col.maxWidth!=null)style.maxWidth=`${col.maxWidth}px`;return style}shouldHideHeaderControls(col){const colKey=col.colId??col.field;const liveWidth=this.columnWidths.get(colKey);const effectiveWidth=typeof liveWidth==="number"?liveWidth:typeof col.width==="number"?col.width:null;return effectiveWidth!==null&&effectiveWidth<this.compactHeaderControlsWidth}columnResizeGuideXFromHandle(handleEl){const grid=this.host.querySelector(".sy-grid__grid");const cell=handleEl?.parentElement??null;if(!grid||!cell||typeof grid.getBoundingClientRect!=="function"){return null}const gridRect=grid.getBoundingClientRect();const cellRect=cell.getBoundingClientRect();const x=cellRect.right-gridRect.left;return Number.isFinite(x)?x:null}columnResizeWidthFromHandle(handleEl){const cell=handleEl?.parentElement??null;if(!cell||typeof cell.getBoundingClientRect!=="function")return null;const width=cell.getBoundingClientRect().width;return Number.isFinite(width)&&width>0?width:null}showColumnResizeGuide(colId,handleEl){const x=this.columnResizeGuideXFromHandle(handleEl);if(x===null)return;if(this.columnResizeGuide?.colId===colId&&this.columnResizeGuide.x===x)return;this.columnResizeGuide={colId,x}}hideColumnResizeGuide(colId){if(this.columnResizeController.isActive())return;if(this.columnResizeGuide?.colId!==colId)return;this.columnResizeGuide=null}handleColumnResizePointerDown(event,colId){event.preventDefault();event.stopPropagation();const handleEl=event.currentTarget;this.showColumnResizeGuide(colId,handleEl);const startWidth=this.resolveEffectiveColumnWidth(colId)??this.columnResizeWidthFromHandle(handleEl)??0;this.columnResizeGuideStartX=this.columnResizeGuide?.colId===colId?this.columnResizeGuide.x:this.columnResizeGuideXFromHandle(handleEl);this.columnResizeGuideStartWidth=startWidth;const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===colId);const colMin=this.resolveInteractiveColumnMinWidth(col);const colMax=this.resolveColumnMaxWidth(col,colMin);this.columnResizeController.start({colId,startWidth,startX:event.clientX,minWidth:colMin,maxWidth:Number.isFinite(colMax)?colMax:void 0});if(handleEl&&typeof handleEl.setPointerCapture==="function"){try{handleEl.setPointerCapture(event.pointerId)}catch{}}this.columnResizePointerId=event.pointerId;this.columnResizeHandleEl=handleEl;if(typeof document!=="undefined"&&document.body){document.body.style.cursor="col-resize"}const escHandler=ev=>{if(ev.key==="Escape"&&this.columnResizeController.isActive()){ev.preventDefault();this.cancelColumnResize()}};this.columnResizeEscHandler=escHandler;if(typeof document!=="undefined"){document.addEventListener("keydown",escHandler,true)}}handleColumnResizePointerMove(event){if(!this.columnResizeController.isActive())return;const result=this.columnResizeController.move({x:event.clientX});if(result===null)return;const next=new Map(this.columnWidths);next.set(result.colId,result.width);this.columnWidths=next;this.alignedNotify();if(this.columnResizeGuide?.colId===result.colId&&this.columnResizeGuideStartX!==null&&this.columnResizeGuideStartWidth!==null){this.columnResizeGuide={colId:result.colId,x:this.columnResizeGuideStartX+(result.width-this.columnResizeGuideStartWidth)}}}handleColumnResizePointerUp(_event){if(!this.columnResizeController.isActive())return;this.commitColumnResize()}handleColumnResizePointerCancel(_event){if(!this.columnResizeController.isActive())return;this.cancelColumnResize()}commitColumnResize(){const active=this.columnResizeController.getActive();const wasClamped=active!==null&&active.wasClamped===true;const result=this.columnResizeController.commit();if(result!==null){const next=new Map(this.columnWidths);next.set(result.colId,result.newWidth);this.columnWidths=next;this.alignedNotify();this.columnResized.emit({colId:result.colId,oldWidth:result.oldWidth,newWidth:result.newWidth,wasClamped});const column=this.resolvedColumnDefs().find(candidate=>candidate.field===result.colId);this.publishLiveObjectChange("column",column?this.liveColumnId(column):result.colId,"widthChanged","ui",{before:result.oldWidth,after:result.newWidth})}this.teardownColumnResizeDrag()}cancelColumnResize(){const result=this.columnResizeController.revert();if(result!==null){const next=new Map(this.columnWidths);const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===result.colId);if(col&&col.width===result.startWidth){next.delete(result.colId)}else{next.set(result.colId,result.startWidth)}this.columnWidths=next;this.alignedNotify()}this.teardownColumnResizeDrag()}teardownColumnResizeDrag(){if(this.columnResizeHandleEl&&this.columnResizePointerId!==null){try{if(typeof this.columnResizeHandleEl.releasePointerCapture==="function"){this.columnResizeHandleEl.releasePointerCapture(this.columnResizePointerId)}}catch{}}this.columnResizePointerId=null;this.columnResizeHandleEl=null;this.columnResizeGuide=null;this.columnResizeGuideStartX=null;this.columnResizeGuideStartWidth=null;if(this.columnResizeEscHandler&&typeof document!=="undefined"){document.removeEventListener("keydown",this.columnResizeEscHandler,true)}this.columnResizeEscHandler=null;if(typeof document!=="undefined"&&document.body){document.body.style.cursor=""}}applyColumnOrder(source){const order=this.columnOrder;if(order===null)return source;const byField=new Map(source.map(c=>[c.field,c]));const out=[];for(let i=0;i<order.length;i++){const col=byField.get(order[i]);if(col){out.push(col);byField.delete(order[i])}}if(byField.size>0){for(const col of byField.values()){out.push(col)}}return out}effectiveColumns(){return this.applyColumnVisibility(applyColumnPinning(this.applyColumnOrder(this.resolvedColumnDefs()),this.columnPinned))}pinSideOf(col){return effectivePinSide(col,this.columnPinned)}pinnedWidthOf=col=>{const key=col.colId??col.field;const live=this.columnWidths.get(key);if(typeof live==="number")return live;return typeof col.width==="number"?col.width:null};totalColumnsWidthPx(){let total=this.shouldRenderCheckboxColumn()?SELECTION_CHECKBOX_COLUMN.width:0;for(const col of this.effectiveColumns()){const width=this.pinnedWidthOf(col);if(width===null)return null;total+=width}return total}pinnedOffsetsContext(cols,checkboxOffset){const leftCols=cols.filter(col=>this.pinSideOf(col)==="left");const rightCols=cols.filter(col=>this.pinSideOf(col)==="right");if(leftCols.length===0&&rightCols.length===0)return null;const left=leftCols.length>0?computePinnedOffsets(leftCols,"left",this.pinnedWidthOf,checkboxOffset):null;const right=rightCols.length>0?computePinnedOffsets(rightCols,"right",this.pinnedWidthOf,0):null;return{left,right,lastLeft:leftCols.length>0?leftCols[leftCols.length-1].field:void 0,firstRight:rightCols.length>0?rightCols[0].field:void 0}}async setColumnPinned(field,side){const column=this.resolvedColumnDefs().find(col=>col.field===field);if(!column){console.warn(`[SG:COL] pin bad field=${field}; reject`);return}if(side!=="left"&&side!=="right"&&side!==null){console.warn(`[SG:COL] pin bad side=${String(side)}; reject`);return}const before=this.pinSideOf(column);if(before===side)return;const next=new Map(this.columnPinned);next.set(field,side);this.columnPinned=next;this.alignedNotify();this.publishLiveObjectChange("column",this.liveColumnId(column),"pinnedChanged","api",{before,after:side})}async getColumnPinned(field){const col=this.resolvedColumnDefs().find(c=>c.field===field);return col?this.pinSideOf(col):null}effectiveColumnIds(){return applyColumnPinning(this.applyColumnOrder(this.resolvedColumnDefs()),this.columnPinned).map(c=>c.field)}async setColumnOrder(orderedColIds){if(!Array.isArray(orderedColIds)){console.warn("[SG:COL] order not array; reject");return}const currentIds=this.effectiveColumnIds();if(orderedColIds.length!==currentIds.length){console.warn(`[SG:COL] order count=${orderedColIds.length}/${currentIds.length}; reject`);return}const known=new Set(currentIds);const seen=new Set;for(let i=0;i<orderedColIds.length;i++){const id=orderedColIds[i];if(typeof id!=="string"||!known.has(id)){console.warn(`[SG:COL] order bad id=${String(id)}; reject`);return}if(seen.has(id)){console.warn(`[SG:COL] order dup id=${id}; reject`);return}seen.add(id)}let changed=false;let firstChangedColId=null;for(let i=0;i<orderedColIds.length;i++){if(orderedColIds[i]!==currentIds[i]){changed=true;if(firstChangedColId===null)firstChangedColId=orderedColIds[i]}}const orderBefore=currentIds.slice();const orderAfter=orderedColIds.slice();this.columnOrder=orderAfter.slice();this.alignedNotify();if(changed&&firstChangedColId!==null){const originIndex=orderBefore.indexOf(firstChangedColId);const finalIndex=orderAfter.indexOf(firstChangedColId);this.columnReordered.emit({colId:firstChangedColId,originIndex,finalIndex,orderBefore,orderAfter})}}async getColumnOrder(){return this.effectiveColumnIds()}guardHideableColumns(method){if(!this.columnHidingActive()){console.warn(`[SG:COL] hide=${method}; flag off; ignore`);return false}return true}applyColumnVisibility(source){const hiddenSet=this.columnHidden;if(hiddenSet.size===0)return source;return source.filter(c=>!hiddenSet.has(c.field))}async hideColumn(colId){if(!this.guardHideableColumns("hideColumn"))return;this.columnVisibilityController.hide(colId)}async showColumn(colId){if(!this.guardHideableColumns("showColumn"))return;this.columnVisibilityController.show(colId)}async toggleColumnVisibility(colId){if(!this.guardHideableColumns("toggleColumnVisibility")){return this.columnVisibilityController.isHidden(colId)}return this.columnVisibilityController.toggle(colId)}async setHiddenColumns(colIds){if(!this.guardHideableColumns("setHiddenColumns"))return;this.columnVisibilityController.setHidden(colIds)}async resetColumnVisibility(){if(!this.guardHideableColumns("resetColumnVisibility"))return;this.columnVisibilityController.reset()}async getHiddenColumns(){return Array.from(this.columnVisibilityController.getHidden())}async autoSizeColumn(colId){if(typeof colId!=="string"||colId.length===0){console.warn("[SG:COL] auto bad id; reject");return null}if(this.resizableColumns!==true){console.warn("[SG:COL] auto flag off; reject");return null}const cols=this.resolvedColumnDefs();const col=cols.find(c=>c.field===colId);if(!col){console.warn(`[SG:COL] auto bad id=${colId}; reject`);return null}const result=this.computeAutoSizeWidth(col);if(result===null||!(result.finalWidth>0))return null;await this.setColumnWidth(colId,result.finalWidth);return result.finalWidth}async autoSizeAllColumns(){if(this.resizableColumns!==true){console.warn("[SG:COL] auto-all flag off; reject");return}const cols=this.effectiveColumns();for(let i=0;i<cols.length;i++){const col=cols[i];if(typeof col.field!=="string"||col.field.length===0)continue;if(col.resizable===false)continue;await this.autoSizeColumn(col.field)}}async getColumnState(){const pinnedSides=new Map;for(const col of this.resolvedColumnDefs()){if(typeof col.field!=="string"||col.field==="")continue;const side=this.pinSideOf(col);if(side)pinnedSides.set(col.field,side)}return computeColumnState({fields:this.resolvedColumnDefs().map(c=>c.field).filter(Boolean),columnWidths:this.columnWidths,columnOrder:this.columnOrder,columnHidden:this.columnHidden,activeSort:null,sortModel:this.activeSortModel,pinnedSides})}async applyColumnState(state,opts){const result=computeApplyColumnState(state,opts);const stateFields=new Set;for(let i=0;i<state.length;i++){stateFields.add(state[i].field)}for(const[field,width]of result.widths){if(width===null){await this.resetColumnWidth(field)}else{await this.setColumnWidth(field,width)}}for(const[field,hidden]of result.visibility){if(hidden){await this.hideColumn(field)}else{await this.showColumn(field)}}if(result.order!==null){const currentIds=this.effectiveColumnIds();const currentSet=new Set(currentIds);const seen=new Set;const nextOrder=[];for(let i=0;i<result.order.length;i++){const field=result.order[i];if(!currentSet.has(field)||seen.has(field))continue;nextOrder.push(field);seen.add(field)}for(let i=0;i<currentIds.length;i++){const field=currentIds[i];if(!seen.has(field)){nextOrder.push(field);seen.add(field)}}await this.setColumnOrder(nextOrder)}const sortableFields=new Set(this.resolvedColumnDefs().filter(col=>col.sortable!==false&&typeof col.field==="string"&&col.field!=="").map(col=>col.field));const restored=result.sortModel.filter(entry=>sortableFields.has(entry.field)).map(entry=>({...entry}));const restoredFields=new Set(restored.map(entry=>entry.field));for(const entry of this.activeSortModel){if(!stateFields.has(entry.field)&&!restoredFields.has(entry.field)){restored.push({...entry})}}if(!sortModelsEqual(restored,this.activeSortModel)){this.applySortModel(restored,"state")}for(const[field,side]of result.pinned){await this.setColumnPinned(field,side)}}initialState;pendingStateUiRestore=null;pendingStateUiSlices=new Set;gridStateCaptureInput(){const pinnedSides=new Map;const aggFuncs=new Map;for(const col of this.resolvedColumnDefs()){if(typeof col.field!=="string"||col.field==="")continue;const side=this.pinSideOf(col);if(side)pinnedSides.set(col.field,side);if(typeof col.aggFunc==="string"&&col.aggFunc!==""){aggFuncs.set(col.field,col.aggFunc)}}const groupBy=this.groupBy;const rowGroupFields=typeof groupBy==="string"?groupBy===""?[]:[groupBy]:Array.isArray(groupBy)?groupBy.filter(field=>typeof field==="string"&&field!==""):[];const facadeSnapshot=this.filterFacade?.getSerializableModels()??null;return{find:this.proUiChunks["pro-panels"]?.captureFindUi(this.findHost()),columns:{fields:this.resolvedColumnDefs().map(c=>c.field).filter(Boolean),columnWidths:this.columnWidths,columnOrder:this.columnOrder,columnHidden:this.columnHidden,activeSort:null,sortModel:this.activeSortModel,pinnedSides,aggFuncs,rowGroupFields,pivotRowGroupFields:this.pivotRowGroupColumns??[],pivotMode:this.pivotMode===true,pivotFields:this.pivotColumns??[],valueFields:this.pivotValueColumns??[],collapsedGroupIds:this.collapsedGroups},filter:{activeFilters:this.activeFilters,customModels:facadeSnapshot?.models??null,customModelErrors:facadeSnapshot?.errors?.map(error=>String(error))??[],quickFilter:this.quickFilterValue===""?null:this.quickFilterValue,conditionTree:this.activeConditionTree,externalFilterActive:this.externalFilter!=null},rows:{collapsedGroupRoutes:this.collapsedRowGroups,pivotCollapsedGroupRoutes:this.pivotCollapsedRowGroups,collapsedTreeNodePaths:this.collapsedTreeNodes,expandedDetailRowIds:this.expandedDetailRows,rowSelection:this.selectionState,cellRanges:this.rangeState.ranges},ui:{activeCell:this.activeCell,scrollTop:this.scrollTop,scrollLeft:this.hScrollLeft,pagination:this.activePagination,openPanelId:this.openToolPanelId,pinnedRows:this.pinnedRowsFacade!==null?this.pinnedRowsFacade.toSlice():void 0}}}async getState(){return buildGridState(this.gridStateCaptureInput()).state}async setState(state,options){this.initialStateLicenseFeatures=null;const migration=migrateGridState(state);if(!migration.ok||migration.state===null){return{ok:false,issues:migration.issues,appliedSlices:[],requestedAbsentSlices:[],unrestorableSlices:[],columns:null,filter:null,rows:null,uiUnavailable:[],afterDataPending:false,appliedMigrations:migration.appliedMigrations,droppedSlices:migration.droppedSlices}}const notApplied=refusedPlan=>({...summarizeGridStatePlan(refusedPlan,false),appliedMigrations:migration.appliedMigrations,droppedSlices:migration.droppedSlices});let plan=planGridStateApply(migration.state,this.gridStateApplyContexts(),options);if(!plan.ok)return notApplied(plan);let requirements=scanGridStateProRequirements(plan,migration.state);if(requirements.length>0){if(this.proGate().awaiting(gridStateRequirementFeatures(requirements))){await this.proGate().settle(gridStateRequirementFeatures(requirements));plan=planGridStateApply(migration.state,this.gridStateApplyContexts(),options);if(!plan.ok)return notApplied(plan);requirements=scanGridStateProRequirements(plan,migration.state)}const refused=this.proGate().refuseRequest(gridStateRequirementFeatures(requirements),"setState");if(refused.length>0){return notApplied(refusedGridStatePlan(plan,gridStateLicenseIssues(requirements,refused)))}const moduleStep=await this.proFiltersModuleStep(requirements,"setState");if(moduleStep.issues.length>0)return notApplied(refusedGridStatePlan(plan,moduleStep.issues));if(moduleStep.awaited){plan=planGridStateApply(migration.state,this.gridStateApplyContexts(),options);if(!plan.ok)return notApplied(plan);requirements=scanGridStateProRequirements(plan,migration.state);const refusedAgain=this.proGate().refuseRequest(gridStateRequirementFeatures(requirements),"setState");if(refusedAgain.length>0){return notApplied(refusedGridStatePlan(plan,gridStateLicenseIssues(requirements,refusedAgain)))}}}await this.executeGridStatePlan(plan);this.noteStateBatchSource("restore",plan.appliedSlices);return{...summarizeGridStatePlan(plan,this.pendingStateUiRestore!==null),appliedMigrations:migration.appliedMigrations,droppedSlices:migration.droppedSlices}}gridStateApplyContexts(){const fields=this.resolvedColumnDefs().map(c=>c.field).filter(Boolean);if(this.pivotModeActive()&&this.pivotComputation()!==null){for(const col of this.declaredColumnDefs()){if(typeof col.field==="string"&&col.field!==""&&!fields.includes(col.field)){fields.push(col.field)}}}const customFilterColumnIds=this.filterFacade===null?new Set:new Set(fields);const displayRows=this.getDisplayRows();const remote=this.componentFilterExecutionMode()!=="client";let liveRowIds=null;if(!remote){const ids=new Set;const source=Array.isArray(this.rowData)?this.rowData:[];for(const row of source){const id=this.undoableRowId(row);if(id!==null)ids.add(id)}liveRowIds=ids}return{liveFields:fields,findAvailable:this.find===true,filter:{fields,customFilterColumnIds},rows:{liveRowIds,liveTreeNodePaths:null,pivotModeActive:this.pivotMode===true,rowCount:displayRows.length,columnCount:this.effectiveColumns().length},ui:{rowCount:displayRows.length,columnCount:this.effectiveColumns().length,pinnedRowsSupported:true}}}async executeGridStatePlan(plan){const applied=new Set(plan.appliedSlices);if(plan.find)this.proUiChunks["pro-panels"].restoreFindUi(this.findHost(),plan.find);const columns=plan.columns;if(columns&&applied.has("columns")){for(const[field,width]of columns.columnState.widths){if(width===null)await this.resetColumnWidth(field);else await this.setColumnWidth(field,width)}for(const[field,hidden]of columns.columnState.visibility){if(hidden)await this.hideColumn(field);else await this.showColumn(field)}if(columns.columnState.order!==null){await this.setColumnOrder([...columns.columnState.order])}const sortableFields=new Set(this.resolvedColumnDefs().filter(col=>col.sortable!==false&&typeof col.field==="string"&&col.field!=="").map(col=>col.field));const restoredSort=columns.columnState.sortModel.filter(entry=>sortableFields.has(entry.field)).map(entry=>({...entry}));if(!sortModelsEqual(restoredSort,this.activeSortModel)){this.applySortModel(restoredSort,"state")}for(const[field,side]of columns.columnState.pinned){await this.setColumnPinned(field,side)}if(columns.aggFuncs.size>0&&Array.isArray(this.columnDefs)){let aggChanged=false;const nextDefs=this.columnDefs.map(def=>{if(!("field"in def)||typeof def.field!=="string")return def;if(!columns.aggFuncs.has(def.field))return def;const want=columns.aggFuncs.get(def.field)??null;const current=typeof def.aggFunc==="string"&&def.aggFunc!==""?def.aggFunc:null;if(current===want)return def;aggChanged=true;return{...def,aggFunc:want??void 0}});if(aggChanged)this.columnDefs=nextDefs}this.groupBy=columns.rowGroupFields.length>0?[...columns.rowGroupFields]:void 0;this.pivotMode=columns.pivotMode;this.pivotRowGroupColumns=columns.pivotRowGroupFields.length>0?[...columns.pivotRowGroupFields]:void 0;this.pivotColumns=columns.pivotFields.length>0?[...columns.pivotFields]:void 0;this.pivotValueColumns=columns.valueFields.length>0?[...columns.valueFields]:void 0;this.collapsedGroups=new Set(columns.collapsedGroupIds)}const filter=plan.filter;if(filter&&applied.has("filter")){this.activeFilters={...filter.builtIn};this.quickFilterValue=filter.quickFilter??"";this.activeConditionTree=filter.conditionTree;const customModelIds=Object.keys(filter.customModels);if(customModelIds.length>0&&this.filterFacade!==null){await this.filterFacade.setFilterModels(filter.customModels,{clearUnspecified:false,source:"restore"})}}const rows=plan.rows;if(rows){if(applied.has("rowGrouping")){this.collapsedRowGroups=new Set(rows.collapsedGroupRoutes)}if(applied.has("pivot")){this.pivotCollapsedRowGroups=new Set(rows.pivotCollapsedGroupRoutes)}if(applied.has("expansion")){this.collapsedTreeNodes=new Set(rows.collapsedTreeNodePaths);this.expandedDetailRows=new Set(rows.expandedDetailRowIds)}if(applied.has("selection")){const previous=this.selectionState;const next={mode:rows.selection.mode,selectedRowIds:new Set(rows.selection.ids)};this.rangeAnchorRowId=null;this.selectionState=next;const diff=diffSelection(previous,next);if(diff.addedIds.length>0||diff.removedIds.length>0){this.fireSelectionChanged({mode:next.mode,selectedRowIds:Array.from(next.selectedRowIds),addedIds:diff.addedIds,removedIds:diff.removedIds},"api")}this.rangeState={ranges:rows.ranges.map(range=>({...range})),dragging:null}}}const ui=plan.ui;if(ui){if(applied.has("sideBar")){this.openToolPanelId=ui.immediate.sideBar.openPanelId}if(applied.has("pagination")){this.activePagination={pageIndex:ui.immediate.pagination.pageIndex,pageSize:ui.immediate.pagination.pageSize}}const wantsAfterData=applied.has("scroll")||applied.has("focus")||applied.has("pinnedRows")&&ui.afterData.pinnedRows!==null;if(wantsAfterData){this.pendingStateUiRestore=ui.afterData;this.pendingStateUiSlices=new Set(["scroll","focus","pinnedRows"].filter(key=>applied.has(key)));this.maybeApplyPendingStateUiRestore()}}}maybeApplyPendingStateUiRestore(){const pending=this.pendingStateUiRestore;if(pending===null)return;if(this.getDisplayRows().length===0)return;this.pendingStateUiRestore=null;if(this.pendingStateUiSlices.has("scroll")){if(this.viewportEl){this.viewportEl.scrollTop=pending.scroll.top;this.viewportEl.scrollLeft=pending.scroll.left}this.scrollTop=pending.scroll.top;this.hScrollLeft=pending.scroll.left;this.alignedNotify();this.recomputeVirtualWindow()}if(this.pendingStateUiSlices.has("focus")){this.activeCell=pending.focus.activeCell===null?null:{rowIndex:pending.focus.activeCell.rowIndex,colIndex:pending.focus.activeCell.colIndex}}if(this.pendingStateUiSlices.has("pinnedRows")&&pending.pinnedRows!==null){void this.restorePinnedRowsSlice(pending.pinnedRows)}this.pendingStateUiSlices=new Set}async restorePinnedRowsSlice(slice){if(this.rowLayoutChunk===null){try{await this.rowLayout()}catch{return}}const facade=this.pinnedRows();if(facade===null)return;const outcome=facade.restoreSlice({topRowIds:[...slice.topRowIds],bottomRowIds:[...slice.bottomRowIds]});if(outcome.status==="applied"||outcome.dropped.length>0){this.pinnedRowsVersion+=1;this.pinnedRowsChanged.emit({changes:outcome.changes,top:outcome.top,bottom:outcome.bottom,source:"state-restore"});this.recomputeVirtualWindow()}for(const dropped of outcome.dropped){this.rowLayoutRefused.emit({area:"pinned-rows",feature:"state-restore",reason:"unknown-id",detail:`pinned id ${String(dropped)} is not backed by the current data; skipped, not fabricated`,rowIndex:null,colIndex:null})}}async getFilterModel(){return captureFilterSlice(this.gridStateCaptureInput().filter).slice}async setFilterModel(model){const target=model??{builtIn:{},customModels:{},quickFilter:null,conditionTree:null,externalFilterActive:false};const shapeIssues=validateFilterSlice(target);if(shapeIssues.length>0){return{unknownBuiltInColumns:[],invalidBuiltIn:shapeIssues,unavailableCustomFilters:[],conditionTreeError:null,externalFilterWasActive:false}}const licenseRequirements=scanFilterProRequirements(applyFilterSlice(target,this.gridStateApplyContexts().filter),"$");if(licenseRequirements.length>0){const refusal=await this.filterModelLicenseRefusal(target,licenseRequirements);if(refusal!==null)return refusal;const admitted=scanFilterProRequirements(applyFilterSlice(target,this.gridStateApplyContexts().filter),"$");const moduleStep=await this.proFiltersModuleStep(admitted,"setFilterModel");if(moduleStep.issues.length>0)return filterModelRefusedReport(moduleStep.issues);if(moduleStep.awaited){const again=await this.filterModelLicenseRefusal(target,admitted);if(again!==null)return again}}const contexts=this.gridStateApplyContexts();const applied=applyFilterSlice(target,contexts.filter);const previousMap=this.activeFilters;this.activeFilters={...applied.builtIn};const touched=new Set([...Object.keys(previousMap),...Object.keys(applied.builtIn)]);for(const field of[...touched].sort()){const before=previousMap[field]??null;const after=applied.builtIn[field]??null;if(before===after)continue;this.filterChanged.emit({field,filter:after,activeMap:this.activeFilters})}this.quickFilterValue=applied.quickFilter??"";this.activeConditionTree=applied.conditionTree;if(this.filterFacade!==null){await this.filterFacade.setFilterModels(applied.customModels,{clearUnspecified:true,source:"api"})}this.noteStateBatchSource("api",["filter"]);return applied.report}async filterModelLicenseRefusal(target,initial){let requirements=initial;if(this.proGate().awaiting(gridStateRequirementFeatures(requirements))){await this.proGate().settle(gridStateRequirementFeatures(requirements));requirements=scanFilterProRequirements(applyFilterSlice(target,this.gridStateApplyContexts().filter),"$")}const refused=this.proGate().refuseRequest(gridStateRequirementFeatures(requirements),"setFilterModel");if(refused.length===0)return null;return filterModelRefusedReport(gridStateLicenseIssues(requirements,refused))}async proFiltersModuleStep(requirements,member){let awaited=false;const steps=[{chunk:"pro-filters",needed:gridProFilterRequirements(requirements)},{chunk:"pro-panels",needed:requirements.filter(entry=>entry.feature==="grid.find")}];for(const{chunk,needed}of steps){if(needed.length===0||this.proUiChunks[chunk]!==void 0)continue;if(!gridProChunkInBuild(chunk)){for(const feature of gridStateRequirementFeatures(needed))this.proModuleAvailable(feature,member,chunk);return{issues:gridStateModuleIssues(needed,"module-missing",chunk),awaited}}awaited=true;try{if(chunk==="pro-filters")await this.loadProFiltersChunk();else this.proUiChunks={...this.proUiChunks,"pro-panels":await this.getChunkLoader().load("pro-panels")}}catch{const refused=this.proGate().refuseRequest(gridStateRequirementFeatures(needed),member);return{issues:refused.length>0?gridStateLicenseIssues(needed,refused):gridStateModuleIssues(needed,"load-failed",chunk),awaited}}}return{issues:[],awaited}}gridMutationSequence=0;mintGridMutationId=()=>{this.gridMutationSequence+=1;return`grid-mutation-${this.gridMutationSequence}`};canonicalSelection=null;canonicalMirror=null;editType="cell";rowEditSessionRowId(){return this.rowEditState.session?.rowId??null}activeCellRowId(){if(this.activeCell===null)return null;const row=this.getDisplayRows()[this.activeCell.rowIndex];if(row===void 0||row===null)return null;return this.undoableRowId(row)}batchCommitState=null;batchEdit=null;async loadBatchEditChunk(){const chunk=await this.getChunkLoader().load("batch-edit");this.batchEdit=chunk;return chunk}batchLive(){return this.batchEdit!==null&&this.batchCommitState!==null&&this.batchEdit.isBatchEditing(this.batchCommitState.batch)}batchPendingCells(){return this.batchEdit&&this.batchCommitState?this.batchEdit.pendingBatchCells(this.batchCommitState.batch):[]}rowEditState=createRowEditState();batchEditStart;batchEditEnd;rowValueChanged;rowEditStart;rowEditStop;ensureCanonicalSelection(){const live=this.rangeState.ranges;if(this.canonicalSelection!==null&&this.canonicalMirror===live){return this.canonicalSelection}let set={ranges:[],nextId:this.canonicalSelection?.nextId??1};for(const range of live){set=addCanonicalRange(set,{row:range.anchorRow,col:range.anchorCol},{row:range.focusRow,col:range.focusCol}).set}this.canonicalSelection=set;this.canonicalMirror=live;return set}async getCanonicalRanges(){return this.proRun("getCanonicalRanges",()=>[...this.ensureCanonicalSelection().ranges])}async setCanonicalRanges(ranges){return this.proMethod("setCanonicalRanges",{validate:()=>Array.isArray(ranges)?void 0:{result:[]},load:()=>this.loadRangeSelectionChunk(),exec:()=>void 0,publish:()=>{const previous=this.ensureCanonicalSelection();const changes=[];for(const range of previous.ranges){changes.push({kind:"removed",id:range.id,range})}let set={ranges:[],nextId:previous.nextId};for(const range of ranges){if(range===null||typeof range!=="object")continue;const applied=addCanonicalRange(set,{row:range.anchorRow,col:range.anchorCol},{row:range.focusRow,col:range.focusCol});set=applied.set;changes.push(...applied.changes)}this.canonicalSelection=set;this.rangeState={ranges:toLegacyRanges(set),dragging:null};this.canonicalMirror=this.rangeState.ranges;this.emitRangeChange();return changes}})}rowByStableId(rowId){const rows=this.rowData??[];let found=null;for(const row of rows){if(this.undoableRowId(row)!==rowId)continue;if(found!==null)return null;found=row}return found}displayIndexOfRow(row){const rows=this.getDisplayRows();for(let i=0;i<rows.length;i++){if(rows[i]===row)return i}return-1}storedCellValue(rowId,colId){const row=this.rowByStableId(rowId);return row===null?void 0:readOwnFieldPath(row,colId)}identityRbacVerdict(rowId,colId){const row=this.rowByStableId(rowId);if(row===null)return"deny";const col=this.resolvedColumnDefs().find(entry=>entry.field===colId);if(col===void 0)return"deny";return this.passesEditPolicy(this.displayIndexOfRow(row),col,row)?"allow":"deny"}identityValidationVerdict(rowId,colId,newValue){const row=this.rowByStableId(rowId);const verdict=evaluateValidation(this.validationRules??[],{field:colId,value:newValue,rowIndex:row===null?-1:this.displayIndexOfRow(row),data:row??{}});return verdict.valid===false?{ok:false,reason:verdict.message}:{ok:true}}editGatesConfigured(){return this.editPolicyConfigured()||this.readPolicyConfigured()}validationRulesConfigured(){return this.validationRules!==void 0&&this.validationRules.length>0}async applyIdentityWrites(writes,label,origin){if(writes.length===0)return[];const patches=new Map;const missing=new Set;for(const write of writes){let patch=patches.get(write.rowId);if(patch===void 0){const row=this.rowByStableId(write.rowId);if(row===null){missing.add(write.rowId);continue}patch={...row}}patches.set(write.rowId,setOwnFieldPathImmutable(patch,write.colId,write.value))}if(patches.size>0){const result=await this.applyTransaction({update:[...patches.values()]},label,{source:"local",origin});for(const rejectedEntry of result.rejected){if(rejectedEntry.kind!=="update")continue;const id=this.undoableRowId(rejectedEntry.row);if(id!==null)missing.add(id)}}return[...missing]}toPublicRejectedCell(rowId,colId,reason,detail){return{rowId,colId:String(colId),reason,detail}}emitBatchLedgerStart(plan){const start=plan.events[0];if(start===void 0||start.type!=="batchEditStart")return;this.batchEditStart.emit({mutationId:start.detail.mutationId,sessionId:start.detail.sessionId,stagedCount:start.detail.stagedCount})}emitBatchLedgerEnd(plan){const end=plan.events[plan.events.length-1];if(end===void 0||end.type!=="batchEditEnd")return;const detail={mutationId:end.detail.mutationId,status:end.detail.status,writtenCount:end.detail.writtenCount,rejectedCells:end.detail.rejectedCells.map(cell=>this.toPublicRejectedCell(cell.rowId,cell.colId,cell.reason,null))};if(end.detail.reason!==void 0){detail.reason=end.detail.reason}if(end.detail.droppedCount!==void 0){detail.droppedCount=end.detail.droppedCount}this.batchEditEnd.emit(detail)}async startBatchEdit(options){return this.proMethod("startBatchEdit",{validate:()=>this.editType==="fullRow"||this.editingCell!==null?{result:false}:void 0,load:()=>this.loadBatchEditChunk(),exec:batch=>batch,publish:batch=>{const out=batch.guardedStartBatchEdit(this.batchCommitState??batch.createBatchCommitState(),options);this.batchCommitState=out.state;this.proUiChunkTick++;return out.result.kind==="started"||out.result.kind==="joined"}})}async isBatchEditing(){return this.proRun("isBatchEditing",()=>this.batchLive())}async stageBatchCell(rowId,colId,value){const resolve=()=>{const row=this.rowByStableId(rowId);if(row===null)return null;const colIndex=this.resolvedColumnDefs().findIndex(col=>col.field===colId);return colIndex<0?null:{row,colIndex}};return this.proMethod("stageBatchCell",{validate:()=>resolve()===null?{result:false}:void 0,load:()=>this.loadBatchEditChunk(),exec:batch=>batch,publish:batch=>{const target=resolve();if(target===null)return false;const{row,colIndex}=target;const out=batch.guardedStageBatchCell(this.batchCommitState??batch.createBatchCommitState(),{row:this.displayIndexOfRow(row),col:colIndex,rowId,colId,value,oldValue:readOwnFieldPath(row,colId)});this.batchCommitState=out.state;this.proUiChunkTick++;return out.staged.kind==="staged"}})}async getPendingBatchCells(){return this.proRun("getPendingBatchCells",()=>(this.batchEdit===null||this.batchCommitState===null?[]:this.batchEdit.pendingBatchCells(this.batchCommitState.batch)).map(cell=>({rowId:cell.rowId,colId:String(cell.colId),value:cell.value,oldValue:cell.oldValue,sequence:cell.sequence})))}async cancelBatchEdit(){return this.proRun("cancelBatchEdit",()=>{if(this.batchEdit===null||this.batchCommitState===null)return 0;const out=this.batchEdit.cancelBatchEditWithLedger(this.batchCommitState,{mintMutationId:this.mintGridMutationId,reason:"api"});this.batchCommitState=out.state;this.proUiChunkTick++;if(out.result.kind!=="cancelled")return 0;this.emitBatchLedgerStart(out.result.plan);this.emitBatchLedgerEnd(out.result.plan);return out.result.droppedCount})}async commitBatchEdit(options){const partialInvalid=options?.partialInvalid??(options?.atomicity==="best-effort"?"commit-valid":"reject-all");const none=()=>({status:"none",mutationId:null,writtenCount:0,rejectedCells:[],transactionRejectedRowIds:[],sessionOpen:this.batchLive()});return this.proMethod("commitBatchEdit",{validate:()=>this.batchLive()?void 0:{result:Promise.resolve(none())},load:()=>this.loadBatchEditChunk(),exec:batch=>batch.commitBatchEditAsync(this.batchCommitState,{mintMutationId:this.mintGridMutationId,readCurrent:(rowId,colId)=>this.storedCellValue(rowId,String(colId)),rbac:this.editGatesConfigured()?(rowId,colId)=>this.identityRbacVerdict(rowId,String(colId)):null,validate:this.validationRulesConfigured()?(rowId,colId,newValue)=>this.identityValidationVerdict(rowId,String(colId),newValue):null,partialInvalid}),publish:async out=>{if(out.kind!=="settled"){return none()}this.batchCommitState=out.state;const plan=out.plan;this.emitBatchLedgerStart(plan);const transactionRejectedRowIds=await this.applyIdentityWrites(plan.commit.writes.map(write=>({rowId:write.rowId,colId:String(write.colId),value:write.value})),"batch-edit","batch-edit");this.emitBatchLedgerEnd(plan);return{status:plan.status,mutationId:plan.mutationId,writtenCount:plan.commit.writes.length,rejectedCells:plan.rejectedCells.map(cell=>this.toPublicRejectedCell(cell.rowId,cell.colId,cell.reason,null)),transactionRejectedRowIds,sessionOpen:this.batchLive()}}})}finalizeBatchEditOnDisconnect(){if(this.batchEdit===null||this.batchCommitState===null)return;const out=this.batchEdit.finalizeBatchOnDisconnect(this.batchCommitState.batch,{mintMutationId:this.mintGridMutationId});if(out.state!==this.batchCommitState.batch){this.batchCommitState={batch:out.state,inFlight:null}}if(out.result.kind==="cancelled"){this.emitBatchLedgerStart(out.result.plan);this.emitBatchLedgerEnd(out.result.plan)}}rowEditKindOf(row){if(this.infiniteModeActive())return"ssrm-loaded";if(this.masterDetail===true)return"master";return"normal"}async startRowEdit(rowId){if(isRowEditing(this.rowEditState))return false;const row=this.rowByStableId(rowId);if(row===null)return false;const displayRow=this.displayIndexOfRow(row);if(displayRow<0)return false;const editableColIds=this.resolvedColumnDefs().filter(col=>col.editable===true&&typeof col.field==="string"&&col.field!=="").map(col=>col.field);const out=startRowEdit(this.rowEditState,{rowId,displayRow,editableColIds,rowKind:this.rowEditKindOf(row)});this.rowEditState=out.state;if(out.result.kind==="started"){this.rowEditStart.emit({rowId,editableColumns:[...editableColIds]});return true}return false}async stopRowEdit(reason){const idleReport={status:"none",mutationId:null,writtenCount:0,rejectedCells:[],rowInvalid:null,droppedCount:0,transactionRejectedRowIds:[]};if(!isRowEditing(this.rowEditState))return idleReport;const out=stopRowEdit(this.rowEditState,{reason:reason==="cancel"?"escape":"api",mintMutationId:this.mintGridMutationId,readCurrent:(rowId,colId)=>this.storedCellValue(rowId,String(colId)),rbac:this.editGatesConfigured()?(rowId,colId)=>this.identityRbacVerdict(rowId,String(colId)):null,validate:this.validationRulesConfigured()?(rowId,colId,newValue)=>this.identityValidationVerdict(rowId,String(colId),newValue):null});this.rowEditState=out.state;if(out.result.kind==="ignored")return idleReport;const plan=out.result.plan;const transactionRejectedRowIds=plan.status==="committed"?await this.applyIdentityWrites(plan.commit.writes.map(write=>({rowId:write.rowId,colId:String(write.colId),value:write.value})),"row-edit","row-edit"):[];if(plan.status==="committed"){for(const entry of plan.events){if(entry.type!=="rowValueChanged")continue;this.rowValueChanged.emit({mutationId:entry.detail.mutationId,rowId:entry.detail.rowId,writtenCount:entry.detail.writtenCount,oldRow:entry.detail.oldRow,newRow:entry.detail.newRow})}}return{status:plan.status,mutationId:plan.mutationId,writtenCount:plan.commit.writes.length,rejectedCells:plan.rejectedCells.map(cell=>this.toPublicRejectedCell(cell.rowId,cell.colId,cell.reason,cell.detail)),rowInvalid:out.result.kind==="rejected"?out.result.rowInvalid:null,droppedCount:out.result.kind==="cancelled"?out.result.droppedCount:0,transactionRejectedRowIds}}async stageRowEditCell(colId,value){const session=this.rowEditState.session;if(session===null)return false;const oldValue=this.storedCellValue(session.rowId,colId);const out=stageRowCell(this.rowEditState,colId,value,oldValue);this.rowEditState=out.state;return out.staged.kind==="staged"}async finishRowEditSession(reason){const rowId=this.rowEditSessionRowId();if(rowId===null)return;const report=await this.stopRowEdit(reason);if(report.status==="none")return;this.rowEditStop.emit({rowId,status:report.status,writtenCount:report.writtenCount,reason})}async getStateCaptureReport(){return{issues:buildGridState(this.gridStateCaptureInput()).issues}}enableFillHandle;fillHandleAxes;fillHandleMode;fillPreview=null;fillBinding=null;onEnableFillHandleChanged(value){if(value!==true){this.fillBinding?.dispose();this.fillPreview=null}}fillHandleActive(){return this.enableFillHandle===true&&this.rangeSelectionActive()&&this.usingColumnDefsApi()&&this.proAllowed("grid.fill-handle","enableFillHandle")&&this.proModuleAvailable("grid.fill-handle","enableFillHandle","fill")}fillHandleCellAt(rowIndex,colIndex){if(!this.fillHandleActive())return false;const ranges=this.ensureCanonicalSelection().ranges;const last=ranges[ranges.length-1];if(last===void 0)return false;return rowIndex===Math.max(last.anchor.row,last.focus.row)&&colIndex===Math.max(last.anchor.col,last.focus.col)}fillPreviewClasses(rowIndex,colIndex){const plan=this.fillPreview;if(plan===null)return{};const out={};const target=plan.target;if(target!==null&&rowIndex>=target.top&&rowIndex<=target.bottom&&colIndex>=target.left&&colIndex<=target.right){out["sy-grid__cell--fill-preview"]=true;out["sy-grid__cell--fill-preview-top"]=rowIndex===target.top;out["sy-grid__cell--fill-preview-left"]=colIndex===target.left;out["sy-grid__cell--fill-preview-bottom"]=rowIndex===target.bottom;out["sy-grid__cell--fill-preview-right"]=colIndex===target.right}if(plan.mode==="reduce"&&plan.clearedCells!==void 0){for(const cleared of plan.clearedCells){if(cleared.row===rowIndex&&cleared.col===colIndex){out["sy-grid__cell--fill-reduce-clear"]=true;break}}}return out}fillPolicyClosures(){const rows=this.getDisplayRows();const cols=this.resolvedColumnDefs();const rowIdAt=row=>{const data=rows[row];return data===void 0?null:this.undoableRowId(data)};const colIdAt=col=>{const field=cols[col]?.field;return typeof field==="string"&&field!==""?field:null};const readRaw=(row,col)=>{const data=rows[row];const field=colIdAt(col);return data===void 0||field===null?void 0:readOwnFieldPath(data,field)};const cellPolicy=(row,col)=>cols[col]?.editable!==true||colIdAt(col)===null?"readonly":rowIdAt(row)===null?"protected":"writable";const rbac=this.editGatesConfigured()?(row,col)=>{const rowId=rowIdAt(row);const colId=colIdAt(col);return rowId!==null&&colId!==null?this.identityRbacVerdict(rowId,colId):"deny"}:null;const validate=this.validationRulesConfigured()?(row,col,value)=>{const rowId=rowIdAt(row);const colId=colIdAt(col);return rowId!==null&&colId!==null?this.identityValidationVerdict(rowId,colId,value):{ok:false}}:null;return{rows,cols,rowIdAt,colIdAt,readRaw,cellPolicy,rbac,validate}}async applyFillPlan(plan,source,sourceRangeId){const{rowIdAt,colIdAt}=this.fillPolicyClosures();const start=plan.events[0];if(start!==void 0&&start.type==="fillStart"){this.fillStart.emit(start.detail)}const transactionRejectedRowIds=plan.status==="committed"?await this.applyIdentityWrites(plan.commit.writes.flatMap(write=>{const rowId=rowIdAt(write.row);const colId=colIdAt(write.col);return rowId!==null&&colId!==null?[{rowId,colId,value:write.value}]:[]}),"fill-range","fill-range"):[];const end=plan.events[plan.events.length-1];let resultingRange=source;if(end!==void 0&&end.type==="fillEnd"){resultingRange=end.detail.resultingRange;this.fillEnd.emit(end.detail)}if(plan.status==="committed"){const canonicalRanges=this.ensureCanonicalSelection().ranges;const index2=sourceRangeId===0?-1:canonicalRanges.findIndex(range=>range.id===sourceRangeId);const ranges=this.rangeState.ranges;const kept=index2===-1||index2>=ranges.length?ranges.slice():[...ranges.slice(0,index2),...ranges.slice(index2+1)];this.rangeState={...this.rangeState,ranges:[...kept,{anchorRow:resultingRange.top,anchorCol:resultingRange.left,focusRow:resultingRange.bottom,focusCol:resultingRange.right}],dragging:null};this.emitRangeChange()}return{resultingRange,transactionRejectedRowIds}}cellAtFillPoint(x,y){if(typeof document==="undefined")return null;const under=document.elementFromPoint(x,y);if(under===null||!this.host.contains(under))return null;const cell=under.closest(".sy-grid__cell[data-col-index]");const rowEl=under.closest(".sy-grid__row[data-row-index]");if(cell===null||rowEl===null)return null;const row=Number(rowEl.getAttribute("data-row-index"));const col=Number(cell.getAttribute("data-col-index"));return Number.isInteger(row)&&Number.isInteger(col)?{row,col}:null}armFillHandle(){if(this.fillBinding!==null)return Promise.resolve(this.fillBinding);if(!this.proWorkAllowed("grid.fill-handle","enableFillHandle"))return Promise.resolve(null);return this.fillHandle().catch(()=>null)}async fillHandle(){if(this.fillBinding!==null)return this.fillBinding;const chunk=await this.loadFillChunk();if(this.fillBinding===null){this.fillBinding=chunk.bindFillHandleElement(this)}return this.fillBinding}writeFillPreview(plan){this.fillPreview=plan}applyFillPlanFromGesture(transaction,geometry,sourceRangeId){if(!this.proWorkAllowed("grid.fill-handle","enableFillHandle"))return;void this.applyFillPlan(transaction,geometry.source,sourceRangeId)}handleFillHandlePointerDown(rowIndex,colIndex,event){if(!this.fillHandleActive()||event.button!==0)return;event.preventDefault();event.stopPropagation();const seed={row:rowIndex,col:colIndex};if(this.fillBinding!==null){this.fillBinding.pointerDown(seed,event.pointerId);return}let pointerLive=true;const settle=done=>{if(done.pointerId!==event.pointerId)return;pointerLive=false;document.removeEventListener("pointerup",settle);document.removeEventListener("pointercancel",settle)};document.addEventListener("pointerup",settle);document.addEventListener("pointercancel",settle);void this.armFillHandle().then(binding=>{document.removeEventListener("pointerup",settle);document.removeEventListener("pointercancel",settle);if(pointerLive&&binding!==null)binding.pointerDown(seed,event.pointerId)})}handleFillHandleDoubleClick(event){if(!this.fillHandleActive())return;event.preventDefault();event.stopPropagation();void this.armFillHandle().then(binding=>binding?.doubleClick())}handleFillHandleKeyDown(event){if(!this.fillHandleActive())return;if(event.key!=="Enter"&&event.key!=="Escape"&&!event.key.startsWith("Arrow"))return;event.preventDefault();event.stopPropagation();void this.armFillHandle().then(binding=>binding?.keyboard(event.key))}renderFillHandle(rowIndex,colIndex){if(!this.fillHandleCellAt(rowIndex,colIndex))return null;if(this.fillBinding===null)void this.armFillHandle();return index.h("span",{class:"sy-grid__fill-handle",role:"button",tabindex:0,"aria-label":t(this.resolvedMessages,"a11y.fillHandle",{row:rowIndex+1}),"data-fill-handle":"true",onPointerDown:event=>this.handleFillHandlePointerDown(rowIndex,colIndex,event),onDblClick:event=>this.handleFillHandleDoubleClick(event),onKeyDown:event=>this.handleFillHandleKeyDown(event)})}fillStart;fillEnd;async loadFillChunk(){return await this.getChunkLoader().load("fill")}async fillRange(options){const none={status:"none",mutationId:null,writtenCount:0,rejectedCells:[],resultingRange:null,transactionRejectedRowIds:[]};const boundsOf=range=>({top:Math.min(range.anchor.row,range.focus.row),left:Math.min(range.anchor.col,range.focus.col),bottom:Math.max(range.anchor.row,range.focus.row),right:Math.max(range.anchor.col,range.focus.col)});const resolveSource=()=>{const canonical=this.ensureCanonicalSelection();if(options.source!==void 0&&options.source!==null&&typeof options.source==="object"){const explicit=options.source;const match=canonical.ranges.find(range=>{const bounds=boundsOf(range);return bounds.top===explicit.top&&bounds.left===explicit.left&&bounds.bottom===explicit.bottom&&bounds.right===explicit.right});return{source:explicit,sourceRangeId:match!==void 0?match.id:0}}if(canonical.ranges.length>0){const last=canonical.ranges[canonical.ranges.length-1];return{source:boundsOf(last),sourceRangeId:last.id}}return null};return this.proMethod("fillRange",{validate:()=>options===null||typeof options!=="object"||options.to===null||typeof options.to!=="object"||resolveSource()===null?{result:Promise.resolve(none)}:void 0,load:()=>this.loadFillChunk(),exec:chunk=>{const resolved=resolveSource();if(resolved===null)return null;const{source,sourceRangeId}=resolved;const closures=this.fillPolicyClosures();const{rows,cols}=closures;const outcome=chunk.runApiFill({source,to:options.to,sourceRangeId,rowCount:rows.length,colCount:cols.length,mode:options.mode,formatted:options.formatted,atomicity:options.atomicity,formulaPolicy:options.formulaPolicy,allowedDirections:options.allowedDirections,pattern:options.pattern??null,setFillValue:options.setFillValue??null,mintMutationId:this.mintGridMutationId,readRaw:closures.readRaw,formatCell:(row,col)=>String(this.cellDisplayText(row,col,rows,cols)),cellPolicy:closures.cellPolicy,rbac:closures.rbac,validate:closures.validate});return{plan:outcome.plan,source,sourceRangeId}},publish:async computed=>{if(computed===null)return none;const{plan,source,sourceRangeId}=computed;if(plan===null)return none;const applied=await this.applyFillPlan(plan,source,sourceRangeId);return{status:plan.status,mutationId:plan.mutationId,writtenCount:plan.commit.writes.length,rejectedCells:plan.rejectedCells,resultingRange:applied.resultingRange,transactionRejectedRowIds:applied.transactionRejectedRowIds}}})}pivotCombinationConflict;pivotColumnsChanged;async loadGroupPivotChunk(){return await this.getChunkLoader().load("group-pivot")}groupPivotChunkModule=null;groupPivotChunkArming=false;ensureGroupPivotChunkArmed(){if(this.groupPivotChunkModule!==null)return this.groupPivotChunkModule;if(!gridProChunkInBuild("group-pivot"))return null;if(!this.groupPivotChunkArming&&this.proGate().frozen("grid.pivot"))return null;if(!this.groupPivotChunkArming){this.groupPivotChunkArming=true;void this.loadGroupPivotChunk().then(chunk=>{this.groupPivotChunkModule=chunk;this.groupPivotChunkTick+=1}).catch(()=>{this.groupPivotChunkArming=false})}return null}groupPivotChunkTick=0;pivotModelGlue=null;notifyPivotColumnModel(){const pivot=this.pivotModeActive()?this.pivotComputation():null;if(pivot===null){this.pivotModelGlue=null;return}const chunk=this.ensureGroupPivotChunkArmed();if(chunk===null)return;if(this.pivotModelGlue===null){this.pivotModelGlue=chunk.createPivotModelGlue(detail=>this.pivotColumnsChanged.emit(detail))}this.pivotModelGlue.notify(pivot.meta)}async getDisplayRowInfo(index2){return this.proMethod("getDisplayRowInfo",{exec:async()=>{const row=this.getDisplayRows()[index2];if(row===void 0)return null;const chunk=await this.loadGroupPivotChunk();return chunk.describeDisplayRow(row,index2)}})}async getPivotCombinationReport(){return this.proMethod("getPivotCombinationReport",{exec:async()=>{const requested=this.pivotMode===true&&this.usingColumnDefsApi()&&Array.isArray(this.pivotRowGroupColumns)&&this.pivotRowGroupColumns.length>0&&Array.isArray(this.pivotColumns)&&this.pivotColumns.length>0&&Array.isArray(this.pivotValueColumns)&&this.pivotValueColumns.length>0;const chunk=await this.loadGroupPivotChunk();return chunk.describePivotCombination(this.detectedPivotFeatures(),requested)}})}detectedPivotFeatures(){const active=[];if(this.treeSurface()!==null)active.push("treeData");if(this.effectiveGroupFields()!==null)active.push("rowGrouping");if(this.masterDetail===true&&this.usingColumnDefsApi())active.push("masterDetail");if(this.serverSideModeActive())active.push("serverSide");if(this.viewportState!==null)active.push("viewport");if(this.infiniteCache!==null)active.push("infinite");if(this.pagination===true)active.push("pagination");if(this.quickFilterValue!=="")active.push("quickFilter");if(Object.keys(this.activeFilters).length>0||this.activeConditionTree!==null){active.push("columnFilter")}if(this.activeSortModel.length>0)active.push("sort");if(this.rowReorderEnabled()||this.unmanagedRowDragEnabled())active.push("rowDrag");if(this.effectiveColumns().some(col=>typeof col.rowSpan==="function"))active.push("rowSpan");if(this.effectiveColumns().some(col=>typeof col.colSpan==="function"))active.push("colSpan");if(this.pinnedRowsDeclared()||this.pinnedRowsFacade!==null&&this.pinnedRowsFacade.count()>0)active.push("pinnedRows");if(this.fullWidthDeclared())active.push("fullWidthRows");return active}async getPivotSecondaryColumns(){return this.proMethod("getPivotSecondaryColumns",{exec:async()=>{const pivot=this.pivotComputation();if(pivot===null)return null;const chunk=await this.loadGroupPivotChunk();return chunk.describeSecondaryColumns(pivot.meta)}})}async getGroupCheckStates(options){return this.proMethod("getGroupCheckStates",{exec:async()=>{const scope=options?.descendantScope==="all"?"all":"filtered";const reason=this.groupCheckStatesRefusal();const chunk=await this.loadGroupPivotChunk();if(reason!==null){return chunk.refuseGroupCheckStates(reason,scope)}const rows=this.computeEngineRows(true);const ids=new Map;for(let i=0;i<rows.length;i++){const id=this.extractRowId(rows[i],i);if(id!==void 0)ids.set(rows[i],String(id))}const selected=new Set;for(const id of this.selectionState.selectedRowIds)selected.add(String(id));return chunk.describeGroupCheckStates(rows,row=>ids.get(row)??"",{kind:"explicit",ids:selected},scope)}})}groupCheckStatesRefusal(){const active=this.detectedPivotFeatures();if(active.includes("treeData"))return"tree-data";if(active.includes("serverSide")||active.includes("viewport")||active.includes("infinite")){return"server-side"}if(this.pivotModeActive())return"pivot-mode";if(!active.includes("rowGrouping"))return"not-grouped";if(this.collapsedRowGroups.size>0)return"collapsed-groups";return typeof this.getRowId==="function"?null:"no-row-id"}serverStoreUpdated;rowDragEnter;rowDragMove;rowDragLeave;rowDragEnd;rowDragCancel;rowsTransferred;unmanagedRowDragEnabled(){return this.rowDragManaged!==true&&this.usingColumnDefsApi()&&this.effectiveColumns().some(col=>col.rowDrag===true)}rowDrag(){if(this.rowDragBinding!==null)return Promise.resolve(this.rowDragBinding);return this.getChunkLoader().load("row-drag").then(module=>{const chunk=module;if(this.rowDragBinding===null){this.rowDragBinding=chunk.bindRowDragElement(this)}return this.rowDragBinding})}syncRowDrag(){if(this.rowDragBinding===null&&this.unmanagedRowDragEnabled())this.rowDrag().catch(()=>void 0)}paintDragTarget(target,source){this.unmanagedDragTarget=target;this.unmanagedDragSource=source}announceDrag(announcement){this.dragLive=announcement.politeness==="assertive"?{polite:this.dragLive.polite,assertive:announcement.text}:{polite:announcement.text,assertive:this.dragLive.assertive}}emitDrag(event){const emitter=this[event.kind];if(emitter!==void 0&&typeof emitter.emit==="function")emitter.emit(event.detail)}writeRows(rows){this.rowData=rows}handleUnmanagedDragPointerDown(rowIndex,event){if(!this.unmanagedRowDragEnabled()||event.button!==0||typeof document==="undefined")return;event.preventDefault();event.stopPropagation();void this.rowDrag().then(binding=>binding.pointerDown(rowIndex,event))}handleUnmanagedDragKeyDown(rowIndex,event){const key=event.key;if(key!==" "&&key!=="Enter"&&key!=="Escape"&&!key.startsWith("Arrow")&&key!=="Home"&&key!=="End"&&key!=="PageUp"&&key!=="PageDown")return;event.preventDefault();event.stopPropagation();void this.rowDrag().then(binding=>binding.keyDown(rowIndex,event))}teardownUnmanagedDrag(disposeFacade){if(this.rowDragBinding===null)return;this.rowDragBinding.teardown(disposeFacade);if(disposeFacade){this.rowDragBinding=null;this.unmanagedDragTarget=null;this.unmanagedDragSource=null}}renderDragLiveRegions(){if(!this.unmanagedRowDragEnabled()&&this.dragLive.polite===""&&this.dragLive.assertive==="")return null;return[index.h("div",{class:"sy-grid__drag-live",role:"status","aria-live":"polite","aria-atomic":"true"},this.dragLive.polite),index.h("div",{class:"sy-grid__drag-live",role:"alert","aria-live":"assertive","aria-atomic":"true"},this.dragLive.assertive)]}async startRowDrag(input){if(!this.unmanagedRowDragEnabled()){return{status:"refused",reason:"not-enabled",detail:"no column declares rowDrag under an unmanaged grid (row-drag-managed is on, or the grid is not on the columnDefs API)"}}return(await this.rowDrag()).startFromApi(input??{})}async getRowDragSession(){if(this.rowDragBinding===null){return{enabled:this.unmanagedRowDragEnabled(),loaded:false,gesture:null,session:null,report:null,events:[],residue:[],keyboard:null,zones:[],lastAutoScroll:null}}return{loaded:true,...this.rowDragBinding.facade.session()}}async registerDropZone(input){return(await this.rowDrag()).registerZone(input)}async unregisterDropZone(zoneId){return this.rowDragBinding===null?false:this.rowDragBinding.unregisterZone(zoneId)}async getDropZones(){return(await this.rowDrag()).facade.zones()}async getDragSafetyReport(){return(await this.rowDrag()).facade.safety()}spanConflict;spansDeclared(){return this.usingColumnDefsApi()&&this.effectiveColumns().some(col=>typeof col.rowSpan==="function"||typeof col.colSpan==="function")}rowLayout(){if(this.rowLayoutChunk!==null&&this.rowLayoutState!==null){return Promise.resolve({chunk:this.rowLayoutChunk,state:this.rowLayoutState})}const seq=++this.rowLayoutKickSeq;return this.getChunkLoader().load("row-layout").then(module=>{const chunk=module;if(this.rowLayoutChunk===null){this.rowLayoutChunk=chunk;this.rowLayoutState=chunk.createRowLayoutState();if(seq===this.rowLayoutKickSeq)this.rowLayoutVersion+=1}return{chunk:this.rowLayoutChunk,state:this.rowLayoutState}})}syncRowLayout(){if(this.rowLayoutChunk===null&&(this.spansDeclared()||this.pinnedRowsDeclared()||this.fullWidthDeclared())){this.rowLayout().then(()=>{this.syncPinnedRows();if(this.fullWidthDeclared()){this.fullWidthVersion+=1;this.recomputeVirtualWindow()}}).catch(()=>void 0)}else if(this.rowLayoutChunk!==null){this.syncPinnedRows()}}alignedGrids;alignedFacade=null;alignedApplying=false;alignedMemberIdMinted=null;pendingAlignedScroll=null;onAlignedGridsChanged(){this.syncAlignedGrids()}alignedDeclared(){const input=this.alignedGrids;if(input===null||input===void 0)return false;if(typeof input==="string")return input.length>0;if(Array.isArray(input))return input.length>0;return typeof input.group==="string"&&input.group.length>0}alignedMemberId(){if(this.alignedMemberIdMinted===null){alignedMemberSeq+=1;this.alignedMemberIdMinted=this.host.id!==""?this.host.id:`sy-grid-aligned-${alignedMemberSeq}`}return this.alignedMemberIdMinted}syncAlignedGrids(){if(!this.alignedDeclared()){this.alignedFacade?.configure(null);return}this.rowLayout().then(()=>{const input=this.alignedGrids;if(typeof input==="string")void this.setAlignedGrids({group:input});else if(input!==null&&input!==void 0)void this.setAlignedGrids(input)}).catch(()=>void 0)}ensureAlignedFacade(chunk){if(this.alignedFacade===null){this.alignedFacade=chunk.createAlignedGridsFacade({memberId:()=>this.alignedMemberId(),snapshot:()=>this.alignedSnapshot(),apply:projection=>this.applyAlignedProjection(projection)})}return this.alignedFacade}alignedSnapshot(){const ordered=applyColumnPinning(this.applyColumnOrder(this.resolvedColumnDefs()),this.columnPinned);const hidden=this.columnHidden;const columns=ordered.map(col=>{const key=String(col.colId??col.field);const live=this.columnWidths.get(key);const width=typeof live==="number"?live:typeof col.width==="number"?col.width:0;return{colId:key,width,visible:!hidden.has(col.field),pinned:this.pinSideOf(col)}});return{columns,scrollLeft:this.viewportEl?.scrollLeft??this.hScrollLeft}}applyAlignedProjection(projection){this.alignedApplying=true;try{const byKey=new Map;for(const col of this.resolvedColumnDefs()){byKey.set(String(col.colId??col.field),col)}const widths=new Map(this.columnWidths);const pinned=new Map(this.columnPinned);const order=[];for(const column of projection.columns){const def=byKey.get(column.colId);if(def===void 0)continue;order.push(def.field);if(column.width>0)widths.set(column.colId,column.width);pinned.set(def.field,column.pinned);const hiddenNow=this.columnHidden.has(def.field);if(column.visible===hiddenNow){if(column.visible)this.columnVisibilityController.show(def.field);else this.columnVisibilityController.hide(def.field)}}this.columnWidths=widths;this.columnPinned=pinned;if(order.length>0)this.columnOrder=order;if(this.viewportEl!==null&&Math.abs(this.viewportEl.scrollLeft-projection.scrollLeft)>.5){this.viewportEl.scrollLeft=projection.scrollLeft;this.pendingAlignedScroll=Math.abs(this.viewportEl.scrollLeft-projection.scrollLeft)>.5?projection.scrollLeft:null}this.hScrollLeft=projection.scrollLeft;this.syncHeaderHorizontalScroll(projection.scrollLeft);this.recomputeVirtualWindow()}finally{this.alignedApplying=false}}alignedNotify(){if(this.alignedApplying||this.alignedFacade===null)return;this.alignedFacade.notify()}async setAlignedGrids(input){const module=await this.rowLayout();const facade=this.ensureAlignedFacade(module.chunk);return await module.chunk.runSetAlignedGrids(facade,input,`aligned:${this.alignedMemberId()}`)}async getAlignedGrids(){if(this.alignedFacade===null){return{configured:false,group:null,memberId:this.alignedMemberId(),members:[],generation:0,alignedColumns:[],canonical:null,mismatches:[],stats:null}}return this.alignedFacade.publicReport()}treeReparented;reparentIdMapsCache=null;treeIdLinkageActive(){return typeof this.getDataPath!=="function"&&typeof this.treeIdField==="string"&&this.treeIdField!==""&&typeof this.treeParentField==="string"&&this.treeParentField!==""&&this.serverSideState===null&&this.usingColumnDefsApi()}treeRowId(row){const field=this.treeIdField;if(typeof field!=="string"||field==="")return null;const raw=readOwnFieldPath(row,field);return raw===void 0||raw===null||raw===""?null:String(raw)}treeRowParentId(row){const field=this.treeParentField;if(typeof field!=="string"||field==="")return null;const raw=readOwnFieldPath(row,field);return raw===void 0||raw===null||raw===""?null:String(raw)}treeRowWithParent(row,parentId){const field=this.treeParentField;if(!field.includes("."))return{...row,[field]:parentId};const parts=field.split(".");const clone={...row};let cursor=clone;for(let i=0;i<parts.length-1;i+=1){const key=parts[i];const nested=cursor[key];cursor[key]=typeof nested==="object"&&nested!==null?{...nested}:{};cursor=cursor[key]}cursor[parts[parts.length-1]]=parentId;return clone}reparentIdMaps(){const surface=this.treeSurface();if(surface===null||!this.treeIdLinkageActive())return null;const rows=this.rowData??[];const idField=this.treeIdField;const parentField=this.treeParentField;const cached=this.reparentIdMapsCache;if(cached!==null&&cached.rows===rows&&cached.idField===idField&&cached.parentField===parentField){return{idToPath:cached.idToPath,idToKey:cached.idToKey}}const idToPath=new Map;const idToKey=new Map;for(const row of rows){const id=this.treeRowId(row);if(id===null||idToPath.has(id))continue;const path=surface.getDataPath(row);idToPath.set(id,path);idToKey.set(id,foldTreePathKey(path))}this.reparentIdMapsCache={rows,idField,parentField,idToPath,idToKey};return{idToPath,idToKey}}reparentHost(){if(!this.treeIdLinkageActive())return null;return{rows:()=>this.rowData??[],idLinkageActive:()=>this.treeIdLinkageActive()&&this.proGate().entitled("grid.tree-data"),idOf:row=>this.treeRowId(row),parentIdOf:row=>this.treeRowParentId(row),withParent:(row,parentId)=>this.treeRowWithParent(row,parentId),hiddenIds:()=>null,isExpanded:nodeId=>{const maps=this.reparentIdMaps();const key=maps?.idToKey.get(nodeId);return key===void 0?false:!this.collapsedTreeNodes.has(key)},collapsedIdsSnapshot:()=>{const maps=this.reparentIdMaps();const collapsed=new Set;if(maps===null)return collapsed;for(const[id,key]of maps.idToKey){if(this.collapsedTreeNodes.has(key))collapsed.add(id)}return collapsed},setExpanded:(nodeId,expanded)=>{const maps=this.reparentIdMaps();const path=maps?.idToPath.get(nodeId);if(path!==void 0)void this.applyTreeNodeExpanded(path,expanded,"ui")},writeRows:rows=>this.writeRows(rows),emitReparented:detail=>this.treeReparented.emit(detail)}}reparentFacadeFactory(){const chunk=this.proUiChunks["tree-data"];if(chunk===void 0||this.treeSurface()===null)return null;return chunk.createReparentFacade}dragRowIdOf(row,index2){if(isTreeNodeRow(row)){if(row.filler||row.row===null)return void 0;const viaHost=this.extractRowId(row.row,index2);return viaHost!==void 0?viaHost:this.treeRowId(row.row)??void 0}return this.extractRowId(row,index2)}reparentNodeAt(rowIndex){const rows=this.getDisplayRows();const row=rows[rowIndex];if(row===void 0)return null;if(isTreeNodeRow(row)){return row.filler||row.row===null?null:this.treeRowId(row.row)}return this.treeRowId(row)}rowBandRatio(rowIndex,y){const el=this.host.querySelector(`.sy-grid__row[data-row-index="${rowIndex}"]`);if(el===null)return null;const rect=el.getBoundingClientRect();if(!(rect.height>0))return null;return Math.min(1,Math.max(0,(y-rect.top)/rect.height))}async reparentRows(request){const refusal={status:"refused",reason:"not-id-linkage",detail:"reparent needs the id-linkage tree surface (tree-id-field + tree-parent-field) on client-side rows",entries:[]};return this.proMethod("reparentRows",{validate:()=>this.treeIdLinkageActive()?void 0:{result:refusal},load:async()=>{await this.treeEngineStep();return this.rowDrag()},exec:binding=>binding,publish:binding=>{const facade=binding.reparentFacade();return facade===null?refusal:facade.reparent(request,"api")}})}isFullWidthRow;fullWidthCellRenderer;fullWidthRowHeight;onFullWidthConfigChanged(){this.fullWidthFacade?.invalidate();this.fullWidthVersion+=1;this.recomputeVirtualWindow();this.syncRowLayout()}fullWidthDeclared(){return typeof this.isFullWidthRow==="function"&&this.usingColumnDefsApi()}fullWidth(){if(this.fullWidthFacade!==null)return this.fullWidthFacade;if(this.rowLayoutChunk===null||!this.fullWidthDeclared())return null;this.fullWidthFacade=this.rowLayoutChunk.createFullWidthFacade({rows:()=>this.getDisplayRows(),columns:()=>this.effectiveColumns(),rowIdOf:(row,index2)=>{if(typeof this.getRowId==="function"){const id=this.extractRowId(row,index2);if(id!==void 0)return id}return index2},classify:row=>isDetailRow(row)?"detail":isGroupMarkerRow(row)?"group":isGroupFooterRow(row)?"group-footer":isLoadingPlaceholderRow(row)?"loading":null,isFullWidth:()=>{const predicate=this.isFullWidthRow;if(typeof predicate!=="function")return void 0;return params=>predicate({row:params.row,rowIndex:params.index,builtInKind:params.builtInKind})===true},renderer:()=>this.fullWidthCellRenderer,declaredHeight:()=>this.fullWidthRowHeight,containerOf:col=>{const side=this.pinSideOf(col);return side==="left"?"left":side==="right"?"right":"middle"},uniformHeight:()=>this.uniformRowHeight(),onRendererError:(error,phase,key)=>{this.rowLayoutRefused.emit({area:"full-width-rows",feature:`renderer-${phase}`,reason:"renderer-threw",detail:`${key}: ${error instanceof Error?error.message:String(error)}`,rowIndex:null,colIndex:null})}});return this.fullWidthFacade}fullWidthEntryAt(rowIndex){const facade=this.fullWidthDeclared()?this.fullWidth():null;if(facade===null)return null;const entry=facade.entryAt(rowIndex);return entry!==null&&entry.kind==="full-width"?entry:null}isFullWidthDisplayRow(rowIndex){return this.fullWidthEntryAt(rowIndex)!==null}reconcileFullWidthMounts(){const facade=this.fullWidthFacade;if(facade===null||!this.fullWidthDeclared())return;const window2=this.lastBodyRenderWindow??{startIndex:0,endIndex:this.getDisplayRows().length};const{mounts}=facade.reconcile(window2.startIndex,window2.endIndex);for(const mount of mounts){const host=this.host?.querySelector?.(`.sy-grid__full-width-host[data-full-width-key="${CSS.escape(mount.key)}"]`);if(host===null||host===void 0)continue;if(mount.gui.parentElement!==host){host.textContent="";host.appendChild(mount.gui)}}const signature=facade.refusalSignature();if(signature!==this.fullWidthRefusalSignature){this.fullWidthRefusalSignature=signature;for(const refusal of facade.refusals()){this.rowLayoutRefused.emit({area:"full-width-rows",feature:"layout",reason:refusal.reason,detail:`${refusal.requested} → ${refusal.applied}: ${refusal.detail}`,rowIndex:refusal.rowIndex,colIndex:null})}}}renderFullWidthRow(row,rowIndex,entry,rowHeightPx){const cols=this.effectiveColumns();const renderCheckboxCol=this.shouldRenderCheckboxColumn();const columnOffset=renderCheckboxCol?1:0;const active=this.activeCell;const isActiveRow=active!==null&&active.rowIndex===rowIndex;const heightPx=entry.height>0?entry.height:rowHeightPx;const totalWidth=this.totalColumnsWidthPx();const viewportWidth=this.viewportSize?.width??0;const widthOf=(startCol,endCol)=>{let width=0;for(let index2=startCol;index2<endCol;index2+=1){const col=cols[index2];if(col===void 0)continue;width+=this.pinnedWidthOf(col)}return width};const drag=this.rowDragDropClass(rowIndex);return index.h("div",{class:{"sy-grid__row":true,"sy-grid__full-width-row":true,[`sy-grid__full-width-row--${entry.mode}`]:true,"sy-grid__row--odd":rowIndex%2===1,"sy-grid__row--even":rowIndex%2===0,"sy-grid__row--active":isActiveRow,"sy-grid__row--drag-source":drag.dragging,"sy-grid__row--drop-above":drag.above,"sy-grid__row--drop-below":drag.below,"sy-grid__row--drop-into":drag.into},...bodyRowAttrs(rowIndex,{headerOffset:this.headerGroupDepth()+this.pinnedTopCount()}),"data-row-index":rowIndex,"data-full-width-row":entry.mode,"data-full-width-kind":entry.rowKind,style:{height:`${heightPx}px`,minWidth:entry.mode==="full-width"&&totalWidth>0?`${Math.max(totalWidth,viewportWidth)}px`:void 0}},entry.segments.map((segment,segmentIndex)=>{const isFirst=segmentIndex===0;const isActive=isActiveRow&&isFirst;const segmentStyle={height:`${heightPx}px`};if(entry.mode==="embedded"){const width=widthOf(segment.startCol,segment.endCol);segmentStyle.width=`${width}px`;segmentStyle.flex=`0 0 ${width}px`;segmentStyle.maxWidth=`${width}px`;if(segment.container==="left"){segmentStyle.position="sticky";segmentStyle.left="0px";segmentStyle.zIndex="1"}if(segment.container==="right"){segmentStyle.position="sticky";segmentStyle.right="0px";segmentStyle.zIndex="1"}}else if(viewportWidth>0){const capped=Math.min(viewportWidth,Math.max(totalWidth,viewportWidth));segmentStyle.position="sticky";segmentStyle.left="0px";segmentStyle.width=`${capped}px`;segmentStyle.flex=`0 0 ${capped}px`;segmentStyle.maxWidth=`${capped}px`}return index.h("div",{key:segment.mountKey,class:{"sy-grid__cell":true,"sy-grid__full-width-cell":true,"sy-grid__cell--active":isActive},...gridCellAttrs({colIndex:segment.startCol+columnOffset+1-1,isActive}),"aria-colspan":segment.colSpan,id:isActive?SY_GRID_ACTIVE_CELL_ID:void 0,"aria-selected":isActive?"true":void 0,"data-full-width-segment":segment.container??"all",style:segmentStyle},index.h("div",{class:"sy-grid__full-width-host","data-full-width-key":segment.mountKey}))}))}async getFullWidthRowInfo(rowIndex){if(!this.fullWidthDeclared()){return rowIndex===void 0?{declared:false,loaded:false,rowCount:this.getDisplayRows().length,fullWidthCount:0,mountCount:0,refusals:[],predicateCalls:0}:null}if(this.rowLayoutChunk===null){try{await this.rowLayout()}catch{}}const facade=this.fullWidth();if(facade===null){return rowIndex===void 0?{declared:true,loaded:false,rowCount:this.getDisplayRows().length,fullWidthCount:0,mountCount:0,refusals:[],predicateCalls:0}:null}if(rowIndex===void 0){const layout=facade.layout();const report=facade.report();return{declared:true,loaded:true,rowCount:layout.rowCount,fullWidthCount:report.fullWidthCount,mountCount:report.mountCount,refusals:layout.refusals.map(refusal=>({reason:refusal.reason,rowIndex:refusal.rowIndex,rowId:refusal.rowId,requested:refusal.requested,applied:refusal.applied,detail:refusal.detail})),predicateCalls:layout.predicateCalls}}const entry=facade.entryAt(rowIndex);if(entry===null)return null;if(entry.kind==="cells"){return{rowIndex,kind:"cells",rowId:entry.rowId,mode:null,height:null,heightSource:null,segments:[],mounted:false}}return{rowIndex,kind:"full-width",rowId:entry.rowId,mode:entry.mode,height:entry.height,heightSource:entry.heightSource,segments:entry.segments.map(segment=>({container:segment.container,startCol:segment.startCol,endCol:segment.endCol,colSpan:segment.colSpan,mountKey:segment.mountKey})),mounted:entry.segments.every(segment=>facade.guiFor(segment.mountKey)!==null)}}pinnedTopRowData;pinnedBottomRowData;pinnedRowsChanged;rowLayoutRefused;onPinnedRowDataChanged(){this.pendingPinnedRows={input:this.pinnedRowsFromProps(),source:"prop"};this.syncRowLayout()}pinnedRowsDeclared(){return(this.pinnedTopRowData?.length??0)>0||(this.pinnedBottomRowData?.length??0)>0||this.pendingPinnedRows!==null}pinnedRowId(row,section,index2){if(typeof this.getRowId==="function"){const id=this.extractRowId(row,index2);if(id!==void 0)return id}return`__pinned-${section}-${index2}`}pinnedRowsFromProps(){const top=(this.pinnedTopRowData??[]).map((row,index2)=>({id:this.pinnedRowId(row,"top",index2),data:row}));const bottom=(this.pinnedBottomRowData??[]).map((row,index2)=>({id:this.pinnedRowId(row,"bottom",index2),data:row}));return{top,bottom}}pinnedRows(){if(this.pinnedRowsFacade!==null)return this.pinnedRowsFacade;if(this.rowLayoutChunk===null)return null;this.pinnedRowsFacade=this.rowLayoutChunk.createPinnedRowsFacade({displayRows:()=>this.getDisplayRows(),sourceRows:()=>this.rowData??[],rowIdOf:typeof this.getRowId==="function"?row=>this.extractRowId(row,-1):null});return this.pinnedRowsFacade}syncPinnedRows(){const facade=this.pinnedRows();const pending=this.pendingPinnedRows;if(facade===null||pending===null)return;this.pendingPinnedRows=null;this.applyPinnedRows(facade,pending.input,pending.source)}applyPinnedRows(facade,input,source){const outcome=facade.setPinned({top:input.top??[],bottom:input.bottom??[]});if(outcome.status==="applied"){this.pinnedRowsVersion+=1;if(this.pinnedFocus!==null){const rows=facade.rows(this.pinnedFocus.band);if(this.pinnedFocus.sectionIndex>=rows.length)this.pinnedFocus=null}this.pinnedRowsChanged.emit({changes:outcome.changes,top:outcome.top,bottom:outcome.bottom,source});this.recomputeVirtualWindow()}return outcome}pinnedTopCount(){return this.pinnedRowsFacade?.rows("top").length??0}pinnedBottomCount(){return this.pinnedRowsFacade?.rows("bottom").length??0}refusePinnedRowFeature(feature,rowIndex,colIndex){const facade=this.pinnedRowsFacade;if(facade===null)return false;const decision=facade.policy(feature);if(decision.support!=="unsupported")return false;this.rowLayoutRefused.emit({area:"pinned-rows",feature,reason:decision.reason,detail:decision.detail,rowIndex,colIndex});return true}enterPinnedBandFromBody(direction){const facade=this.pinnedRowsFacade;const active=this.activeCell;if(facade===null||active===null||facade.count()===0)return false;const rowCount=this.activeRowCount();const atEdge=direction==="up"?active.rowIndex===0:active.rowIndex===rowCount-1;if(!atEdge)return false;const nav=facade.navigate(null,active.rowIndex,direction,1);if(nav===null||!nav.moved||nav.target.kind!=="band")return false;this.focusPinnedBandCell(nav.target.band,nav.target.sectionIndex,active.colIndex);return true}focusPinnedBandCell(band,sectionIndex,colIndex){const cols=this.effectiveColumns();const col=Math.min(Math.max(0,colIndex),Math.max(0,cols.length-1));this.pinnedFocus={band,sectionIndex,colIndex:col};void Promise.resolve().then(()=>{const el=this.host?.querySelector?.(`.sy-grid__pinned-band[data-pinned-band="${band}"]`);if(el!==null&&el!==void 0&&typeof el.focus==="function"&&this.host.ownerDocument?.activeElement!==el){try{el.focus({preventScroll:true})}catch{el.focus()}}})}leavePinnedBand(target){this.pinnedFocus=null;if(target!==null)this.commitActiveCell(target);const viewport=this.viewportEl;if(viewport!==null&&typeof viewport.focus==="function"){try{viewport.focus({preventScroll:true})}catch{viewport.focus()}}}handlePinnedBandClick=event=>{const target=event.target;const rowEl=target?.closest?.(".sy-grid__row--pinned");if(rowEl===null||rowEl===void 0)return;const section=rowEl.getAttribute("data-pinned-section")==="bottom"?"bottom":"top";const sectionIndex=Number(rowEl.getAttribute("data-pinned-row-index"));const cellEl=target?.closest?.(".sy-grid__cell[data-col-index]");const colIndex=cellEl!==null&&cellEl!==void 0?Number(cellEl.getAttribute("data-col-index")):0;if(!Number.isInteger(sectionIndex))return;this.focusPinnedBandCell(section,sectionIndex,Number.isInteger(colIndex)?colIndex:0)};handlePinnedBandFocusOut=event=>{const next=event.relatedTarget;const band=event.currentTarget;if(band!==null&&next!==null&&band.contains(next))return;if(this.pinnedFocus!==null&&(next===null||!band?.contains(next)))this.pinnedFocus=null};handlePinnedBandKeyDown=event=>{const facade=this.pinnedRowsFacade;const focus=this.pinnedFocus;if(facade===null||focus===null)return;const colCount=this.effectiveColumns().length;const rows=facade.rows(focus.band);const move=direction=>{const nav=facade.navigate(focus,null,direction,this.viewportRowCount());if(nav===null||!nav.moved)return;if(nav.target.kind==="center"){this.leavePinnedBand({rowIndex:nav.target.rowIndex,colIndex:focus.colIndex});return}this.focusPinnedBandCell(nav.target.band,nav.target.sectionIndex,focus.colIndex)};if((event.ctrlKey||event.metaKey)&&(event.key==="c"||event.key==="C")){event.preventDefault();const row=rows[focus.sectionIndex];if(row===void 0)return;const text=this.cellDisplayText(0,focus.colIndex,[row.data],this.effectiveColumns());void this.writeClipboardText(text==null?"":String(text));return}switch(event.key){case"ArrowUp":event.preventDefault();move("up");return;case"ArrowDown":event.preventDefault();move("down");return;case"Home":event.preventDefault();if(event.ctrlKey||event.metaKey)move("home");else this.focusPinnedBandCell(focus.band,focus.sectionIndex,0);return;case"End":event.preventDefault();if(event.ctrlKey||event.metaKey)move("end");else this.focusPinnedBandCell(focus.band,focus.sectionIndex,colCount-1);return;case"PageUp":event.preventDefault();move("page-up");return;case"PageDown":event.preventDefault();move("page-down");return;case"ArrowLeft":event.preventDefault();this.focusPinnedBandCell(focus.band,focus.sectionIndex,Math.max(0,focus.colIndex-1));return;case"ArrowRight":event.preventDefault();this.focusPinnedBandCell(focus.band,focus.sectionIndex,Math.min(colCount-1,focus.colIndex+1));return;case"Escape":event.preventDefault();this.leavePinnedBand(null);return;case"F2":case"Enter":case"Delete":case"Backspace":event.preventDefault();this.refusePinnedRowFeature(event.key==="Delete"||event.key==="Backspace"?"row-edit":"cell-edit",focus.sectionIndex,focus.colIndex);return;default:if(event.key.length===1&&!event.ctrlKey&&!event.metaKey&&!event.altKey){event.preventDefault();this.refusePinnedRowFeature("cell-edit",focus.sectionIndex,focus.colIndex)}}};async setPinnedRows(input){const wanted={top:[...input?.top??[]],bottom:[...input?.bottom??[]]};if(this.rowLayoutChunk===null){this.pendingPinnedRows={input:wanted,source:"api"};await this.rowLayout()}const facade=this.pinnedRows();if(facade===null){return{status:"refused",changes:[],rejected:[{reason:"not-loaded",id:null,detail:"the row-layout chunk did not load"}],top:[],bottom:[]}}this.pendingPinnedRows=null;return this.applyPinnedRows(facade,wanted,"api")}async getPinnedRows(){const facade=this.pinnedRowsFacade;const centerCount=this.getDisplayRows().length;if(facade===null){return{loaded:false,top:[],bottom:[],count:0,displayCount:centerCount,centerCount,dangling:[],idCollisions:[],stableRowIds:typeof this.getRowId==="function",policy:[]}}const report=facade.report();return{loaded:true,top:facade.rows("top"),bottom:facade.rows("bottom"),count:facade.count(),displayCount:report.displayCount,centerCount:report.centerCount,dangling:facade.dangling(),idCollisions:report.idCollisions,stableRowIds:typeof this.getRowId==="function",policy:[...report.supported,...report.delegated,...report.unsupported]}}async getPinnedRowInfo(displayIndex){const facade=this.pinnedRowsFacade;const centerCount=this.getDisplayRows().length;if(facade===null){if(!Number.isInteger(displayIndex)||displayIndex<0||displayIndex>=centerCount)return null;return{displayIndex,band:"center",index:displayIndex,row:null,policy:[]}}const address=facade.address(displayIndex);if(address===null)return null;const report=facade.report();const policy=[...report.supported,...report.delegated,...report.unsupported];if(address.band==="center"){return{displayIndex,band:"center",index:address.centerIndex??displayIndex-facade.rows("top").length,row:null,policy}}return{displayIndex,band:address.band,index:address.sectionIndex??0,row:address.row,policy}}rowLayoutHostView(rows,uniform,rowHeightFn){return this.rowLayoutChunk.rowLayoutHostView(this,rows,uniform,rowHeightFn)}buildRowLayoutFrame(rows,window2,uniform,rowHeightFn){if(this.rowLayoutChunk===null||this.rowLayoutState===null||!this.spansDeclared())return null;return this.rowLayoutChunk.buildRowLayoutFrame(this.rowLayoutState,this.rowLayoutHostView(rows,uniform,rowHeightFn),window2)}spanAwareMove(direction,fallback){if(this.rowLayoutChunk===null)return fallback;return this.rowLayoutChunk.spanAwareMove(this.rowLayoutFrame,this.activeCell,direction,fallback)}spanAwareCellText(r,c,rows,cols){if(this.rowLayoutChunk===null)return this.cellDisplayText(r,c,rows,cols);return this.rowLayoutChunk.spanAwareCellText(this.rowLayoutFrame,this.spanExportMode,r,c,(rr,cc)=>this.cellDisplayText(rr,cc,rows,cols))}async getRowSpan(colId){if(!this.usingColumnDefsApi())return null;const{chunk,state}=await this.rowLayout();const rows=this.getDisplayRows();const report=chunk.rowSpanReport(state,this.rowLayoutHostView(rows,this.uniformRowHeight(),this.rowHeightFn),String(colId));return report}async getCellSpan(rowIndex,colId){if(!this.usingColumnDefsApi())return null;const{chunk,state}=await this.rowLayout();const rows=this.getDisplayRows();const info=chunk.cellSpanInfo(state,this.rowLayoutHostView(rows,this.uniformRowHeight(),this.rowHeightFn),Number(rowIndex),String(colId));return info}async getSpanInteraction(query){const{chunk,state}=await this.rowLayout();const rows=this.getDisplayRows();const win=this.virtualWindow;return chunk.spanInteractionFor(state,this.rowLayoutHostView(rows,this.uniformRowHeight(),this.rowHeightFn),this.rowLayoutFrame,win===null?{startIndex:0,endIndex:rows.length}:{startIndex:win.startIndex,endIndex:win.endIndex},this.spanExportMode,query)}async loadSsrmOpsChunk(){const chunk=await this.getChunkLoader().load("ssrm-ops");this.acceptProUiChunk("ssrm-ops",chunk);return chunk}ssrmDeclared(){return this.serverSideDatasource!=null&&this.usingColumnDefsApi()}async ssrmOps(){if(!this.serverSideModeActive())return null;if(this.serverSideState===null&&this.proUiChunks["ssrm-ops"]===void 0&&this.proGate().entitled("grid.server-side-row-model")){await this.loadSsrmOpsChunk()}if(!this.serverSideModeActive()||this.serverSideState===null)return null;const chunk=await this.loadSsrmOpsChunk();return{chunk,registry:this.advanceSsrmRegistryWith(chunk)}}advanceSsrmRegistryWith(chunk){const advance=chunk.advanceSsrmRegistry(this.ssrmRegistry,this.ssrmRegistryEpoch!==this.ssrmEpoch,this.serverSideState,"sy-grid-ssrm");this.ssrmRegistry=advance.registry;this.ssrmRegistryEpoch=this.ssrmEpoch;if(this.ssrmRuntime!==null)this.ssrmRuntime.trackStores(advance.registry);return advance.registry}ensureSsrmRuntime(chunk){if(this.ssrmRuntime!==null)return this.ssrmRuntime;const getRowId=this.getRowId;if(typeof getRowId!=="function")return null;const runtime=chunk.createSsrmRuntime({mintMutationId:this.mintGridMutationId,onEvent:event=>{if(event.type!=="storeUpdated")return;this.serverStoreUpdated.emit(event.detail)},waitMs:typeof this.serverSideTransactionWaitMs==="number"?this.serverSideTransactionWaitMs:void 0,getRowId:row=>String(getRowId(row)),getGroupKey:this.serverGroupKeyOf,getState:()=>({registry:this.advanceSsrmRegistryWith(chunk),ssrm:this.serverSideState}),commitState:next=>{this.ssrmRegistry=next.registry;this.serverSideState=next.ssrm}});if(this.ssrmRegistry!==null)runtime.trackStores(this.ssrmRegistry);this.ssrmRuntime=runtime;return runtime}teardownSsrmRuntime(){if(this.ssrmRuntime===null)return;this.ssrmRuntime.destroy();this.ssrmRuntime=null}async ssrmSel(){const chunk=await this.loadSsrmOpsChunk();return chunk.ssrmSelectionFacade(this,chunk)}ssrmSelGesture(apply){void this.ssrmSel().then(apply,()=>void 0)}async ssrmOpsGated(){if(this.ssrmDeclared()&&!gridProChunkInBuild("ssrm-ops"))await this.loadSsrmOpsChunk();return this.ssrmOps()}ssrmGroupCheckAttrs(groupKey){const check=this.ssrmSelectionProjection?.groupChecks.get(groupKey);if(check===void 0)return null;const attrs=bodyCheckboxAttrs(check==="checked",this.resolvedMessages["a11y.selectRowCheckbox"]);return index.h("span",{class:{"sy-grid__selection-checkbox":true,"sy-grid__selection-checkbox--checked":check==="checked","sy-grid__selection-checkbox--mixed":check==="indeterminate"},role:attrs.role,"aria-checked":check==="indeterminate"?"mixed":attrs["aria-checked"],"aria-label":attrs["aria-label"],tabindex:attrs.tabindex})}async getServerSideSelectionState(){return this.proMethod("getServerSideSelectionState",{load:()=>this.ssrmSel(),exec:sel=>sel.read("flat")})}async getServerGroupSelectionState(){return this.proMethod("getServerGroupSelectionState",{load:()=>this.ssrmSel(),exec:sel=>sel.read("group")})}async setServerSideSelectionState(input){return this.proMethod("setServerSideSelectionState",{load:()=>this.ssrmSel(),exec:sel=>sel,publish:sel=>sel.set("flat",input)})}async setServerGroupSelectionState(input){return this.proMethod("setServerGroupSelectionState",{load:()=>this.ssrmSel(),exec:sel=>sel,publish:sel=>sel.set("group",input)})}async selectAllServerSide(action="select"){return this.proMethod("selectAllServerSide",{load:()=>this.ssrmSel(),exec:sel=>sel,publish:sel=>sel.selectAll(action)})}async selectServerGroupChildren(groupKeys,action="select"){return this.proMethod("selectServerGroupChildren",{load:()=>this.ssrmSel(),exec:sel=>sel,publish:sel=>sel.groupChildren(groupKeys,action)})}ssrmRefusedTxn(status,transaction){const rows=[];if(transaction){if(Array.isArray(transaction.add))rows.push(...transaction.add);if(Array.isArray(transaction.update))rows.push(...transaction.update);if(Array.isArray(transaction.remove))rows.push(...transaction.remove)}const none=[];return{status,storeId:"",added:[],updated:[],removed:[],unresolved:rows,aggregateStaleStoreIds:none,regroupOwedRowIds:none,closedStoreIds:none,droppedNodePaths:none,droppedExpandedPaths:none,issue:status==="no-row-id"?SSRM_NEEDS_ROW_ID:SSRM_INACTIVE}}async refreshServerSide(input){const mode=input?.mode==="purge"?"purge":"soft";const inactive=()=>{const none=[];return{status:"not-server-side",storeId:"",mode,reloadedStoreIds:none,closedStoreIds:none,recreatedStoreIds:none,abortedStoreIds:none,rescuedLoadingBlocks:0,generation:-1,issue:SSRM_INACTIVE}};return this.proMethod("refreshServerSide",{validate:()=>this.ssrmDeclared()?void 0:{result:inactive()},load:()=>this.ssrmOpsGated(),exec:ops=>ops,publish:ops=>{if(ops===null)return inactive();const outcome=ops.chunk.runServerSideRefresh(ops.registry,this.serverSideState,{route:Array.isArray(input?.route)?input.route:[],mode});this.ssrmRegistry=outcome.registry;if(outcome.result.status==="accepted"){this.serverSideState=outcome.ssrm;for(const path of outcome.floorPaths){this.ssrmRefreshFloors.set(path,outcome.generation)}if(outcome.routePath===""&&(outcome.ssrm.pivotResultFields.length>0||outcome.ssrm.pivotResultColumns.length>0)){this.serverPivotResultsStale=true}const runtime=this.ssrmRuntime;if(runtime!==null){runtime.hub.recordStoreClosed(outcome.result.closedStoreIds);for(const record of outcome.recreatedRecords)runtime.hub.trackStore(record)}this.lastServerFetchWindow=null;this.recomputeVirtualWindow()}return ops.chunk.publicServerRefreshResult(outcome)}})}async applyServerSideTransaction(transaction){return this.proMethod("applyServerSideTransaction",{validate:()=>this.ssrmDeclared()?void 0:{result:this.ssrmRefusedTxn("not-server-side",transaction)},load:()=>this.ssrmOpsGated(),exec:ops=>ops,publish:ops=>{if(ops===null)return this.ssrmRefusedTxn("not-server-side",transaction);const runtime=this.ensureSsrmRuntime(ops.chunk);if(runtime===null)return this.ssrmRefusedTxn("no-row-id",transaction);const getRowId=this.getRowId;const application=ops.chunk.applyServerStoreTransaction(ops.registry,this.serverSideState,{route:Array.isArray(transaction?.route)?transaction.route:[],add:transaction?.add,addIndex:transaction?.addIndex,update:transaction?.update,remove:transaction?.remove},{getRowId:row=>String(getRowId(row)),getGroupKey:this.serverGroupKeyOf});this.ssrmRegistry=application.registry;this.serverSideState=application.ssrm;runtime.recordEffectiveTransaction(application,application.registry);return ops.chunk.publicServerTransactionResult(application)}})}async applyServerSideTransactionAsync(transaction,onSettle){const inactive=()=>({status:"not-server-side",txnId:-1,issue:SSRM_INACTIVE});return this.proMethod("applyServerSideTransactionAsync",{validate:()=>this.ssrmDeclared()?void 0:{result:inactive()},load:()=>this.ssrmOpsGated(),exec:ops=>ops,publish:ops=>{if(ops===null)return inactive();const runtime=this.ensureSsrmRuntime(ops.chunk);if(runtime===null){return{status:"no-row-id",txnId:-1,issue:SSRM_NEEDS_ROW_ID}}const chunk=ops.chunk;const enqueue=runtime.queue.enqueue({route:Array.isArray(transaction?.route)?transaction.route:[],add:transaction?.add,addIndex:transaction?.addIndex,update:transaction?.update,remove:transaction?.remove},typeof onSettle==="function"?disposition=>onSettle(chunk.publicServerTransactionSettlement(disposition)):void 0);if(enqueue.status==="queued")return{status:"queued",txnId:enqueue.txnId,issue:""};return{status:"refused-destroyed",txnId:-1,issue:enqueue.detail}}})}async flushServerSideAsyncTransactions(){const empty=()=>({status:"empty",batchId:-1,settledCount:0,issue:""});const idle=()=>this.ssrmRuntime===null||!this.serverSideModeActive()||this.serverSideState===null;return this.proMethod("flushServerSideAsyncTransactions",{validate:()=>this.ssrmRuntime===null||!this.ssrmDeclared()?{result:empty()}:void 0,exec:()=>void 0,publish:()=>{const runtime=this.ssrmRuntime;if(runtime===null||idle())return empty();const outcome=runtime.queue.flush();if(outcome.status==="flushed"){return{status:"flushed",batchId:outcome.batch.batchId,settledCount:outcome.batch.dispositions.length,issue:""}}if(outcome.status==="empty")return empty();return{status:outcome.reason==="reentrant"?"refused-reentrant":"refused-destroyed",batchId:-1,settledCount:0,issue:outcome.detail}}})}async getServerSideStoreState(){return this.proMethod("getServerSideStoreState",{exec:async()=>{const ops=await this.ssrmOps();if(ops===null)return null;const inspection=ops.chunk.inspectServerState(ops.registry,this.serverSideState);return{...inspection,discardedStaleLandings:this.ssrmDiscardedStaleLandings}}})}async getServerPivotResultColumns(){return this.proMethod("getServerPivotResultColumns",{exec:async()=>{const ops=await this.ssrmOps();if(ops===null)return null;return ops.chunk.describeServerPivotResultColumns(this.serverSideState,this.serverPivotResultsStale)}})}async auditServerPivotResultColumns(colIds){return this.proMethod("auditServerPivotResultColumns",{exec:async()=>{const ops=await this.ssrmOps();if(ops===null)return null;const ids=Array.isArray(colIds)?colIds.filter(id=>typeof id==="string"):[];return ops.chunk.auditServerPivotResultColumns(this.serverSideState,this.serverPivotResultsStale,ids)}})}workbookValuesPropagated;workbookOpsChunk=null;workbookOpsEnrollment=null;workbookOpsKickSeq=0;workbookOpsHostBag=null;workbookOpsHost(){if(this.workbookOpsHostBag!==null)return this.workbookOpsHostBag;const bag={getRegistration:()=>this.workbookBindingController.currentRegistration(),getEngine:()=>this.formulas===true&&this.formulaSheet!==null?this.formulaSheet.workbookEngine():null,getFields:()=>flattenColumnDefs(this.columnDefs??[]).map(col=>col&&typeof col.field==="string"&&col.field.length>0?col.field:null),getRows:()=>Array.isArray(this.rowData)?this.rowData:[],isSheetSeeding:()=>this.formulaSheetSeeding,mintMutationId:this.mintGridMutationId,canEditCell:()=>this.canEditCell??null,writeCell:async(rowIndex,field,value,mutationId)=>{const rows=Array.isArray(this.rowData)?this.rowData:[];const row=rows[rowIndex];if(row===null||row===void 0||typeof row!=="object")return"unaddressable";const result=await this.applyTransaction({update:[{...row,[field]:value}]},"workbook-spill",{source:"local",origin:{kind:"workbook-spill",mutationId}});return result.updated.length===1?"written":"unaddressable"},getRowIdFn:()=>this.getRowId??null,onPropagated:detail=>{this.formulaVersion++;this.workbookValuesPropagated.emit(detail)},onSpillMutated:()=>{this.formulaVersion++}};this.workbookOpsHostBag=bag;return bag}async loadWorkbookOpsChunk(){return await this.getChunkLoader().load("workbook-ops")}workbookOpsInactiveReason(){if(this.formulas!==true)return"formulas-off";if(this.workbookBindingController.current()===null)return"not-bound";return null}enrollWorkbookOpsWith(chunk,resync){const formulaCore=this.formulaCore;if(formulaCore===null)return null;this.workbookOpsChunk=chunk;this.workbookOpsEnrollment=chunk.enrollWorkbookGrid(formulaCore.gridSharedWorkbookRegistry(),this.workbookOpsEnrollment,this.workbookOpsHost(),{resync});return this.workbookOpsEnrollment}syncWorkbookOps(resync){const seq=++this.workbookOpsKickSeq;if(this.workbookOpsInactiveReason()!==null){this.teardownWorkbookOps();return}const chunk=this.workbookOpsChunk;if(chunk!==null){this.enrollWorkbookOpsWith(chunk,resync);return}void this.loadWorkbookOpsChunk().then(loaded=>{if(seq!==this.workbookOpsKickSeq||this.workbookOpsInactiveReason()!==null)return;this.enrollWorkbookOpsWith(loaded,false)}).catch(()=>{})}teardownWorkbookOps(){const enrollment=this.workbookOpsEnrollment;this.workbookOpsEnrollment=null;if(enrollment!==null&&this.workbookOpsChunk!==null){this.workbookOpsChunk.unenrollWorkbookGrid(enrollment)}}async workbookOps(){this.assertWorkbookModules(this.formulas===true&&this.proGate().entitled("grid.formulas"));if(this.workbookOpsInactiveReason()!==null)return null;const chunk=this.workbookOpsChunk??await this.loadWorkbookOpsChunk();const enrollment=this.enrollWorkbookOpsWith(chunk,false);return enrollment===null?null:{chunk,enrollment}}async workbookOpsChunkIfActive(){this.assertWorkbookModules(this.formulas===true);if(this.workbookOpsInactiveReason()!==null)return null;return this.workbookOpsChunk??await this.loadWorkbookOpsChunk()}assertWorkbookModules(required){if(!required)return;for(const chunk of["formula-core","workbook-ops"]){if(!gridProChunkInBuild(chunk))throw new GridChunkLoadError(chunk,"unknown","source")}}workbookOpsEnrolled(chunk){if(chunk===null||this.workbookOpsInactiveReason()!==null)return null;const enrollment=this.enrollWorkbookOpsWith(chunk,false);return enrollment===null?null:{chunk,enrollment}}recordWorkbookOpsCommit(field,row,rawValue){const chunk=this.workbookOpsChunk;const enrollment=this.workbookOpsEnrollment;const sheet=this.formulaSheet;if(chunk===null||enrollment===null||sheet===null)return;const cell=sheet.cellCoordinate(field,row);if(cell===null)return;chunk.recordWorkbookCommit(enrollment,cell.col,cell.row,rawValue)}async getWorkbookPropagationState(){return this.proMethod("getWorkbookPropagationState",{exec:async()=>{const ops=await this.workbookOps();if(ops===null)return this.workbookInactiveState();return ops.chunk.workbookPropagationState(ops.enrollment)}})}wbInactiveReason(){return this.workbookOpsInactiveReason()??"not-bound"}workbookInactiveState(){return{status:"inactive",reason:this.wbInactiveReason(),workbookId:"",sheetName:"",workbookKey:-1,sheetId:-1,registrationId:-1,generation:-1,registeredFormulaCells:0,registrationFailures:[],lastPublication:null,hubTrackedFormulas:0,hubCyclicCells:0,issue:WORKBOOK_INACTIVE}}async flushWorkbookPropagation(){const inactive=()=>({status:"inactive",reason:this.wbInactiveReason(),transactionCount:0,generations:[],issue:WORKBOOK_INACTIVE});return this.proMethod("flushWorkbookPropagation",{validate:()=>this.formulas===true?void 0:{result:inactive()},load:()=>this.workbookOpsChunkIfActive(),exec:chunk=>chunk,publish:chunk=>{const ops=this.workbookOpsEnrolled(chunk);if(ops===null)return inactive();return ops.chunk.flushWorkbook(ops.enrollment)}})}async getWorkbookSnapshotReport(){return this.proMethod("getWorkbookSnapshotReport",{exec:async()=>{const ops=await this.workbookOps();if(ops===null){return{status:"inactive",reason:this.wbInactiveReason(),workbookKey:-1,sheetId:-1,registrationId:-1,generation:-1,snapshotHash:"",cells:[],issue:WORKBOOK_INACTIVE}}return ops.chunk.workbookSnapshotReport(ops.enrollment)}})}async getWorkbookIntegrityReport(){return this.proMethod("getWorkbookIntegrityReport",{exec:async()=>{const ops=await this.workbookOps();if(ops===null){return{status:"inactive",reason:this.wbInactiveReason(),cyclicCells:0,cycleDependentCells:0,unprovenCells:0,provenAcyclicCells:0,sheetVerdicts:[],publishingCycleCells:0,issue:WORKBOOK_INACTIVE}}return ops.chunk.workbookIntegrityReport(ops.enrollment)}})}async applySpillFormula(input){return this.proMethod("applySpillFormula",{validate:()=>this.formulas===true?void 0:{result:this.spillInactiveResult(input)},load:()=>this.workbookOpsChunkIfActive(),exec:chunk=>chunk,publish:chunk=>{const ops=this.workbookOpsEnrolled(chunk);if(ops===null)return this.spillInactiveResult(input);return ops.chunk.applyWorkbookSpill(ops.enrollment,input?.col,input?.row,input?.source)}})}spillInactiveResult(input){return{status:"refused",reason:"workbook-inactive",mutationId:null,anchor:{col:Number(input?.col??-1),row:Number(input?.row??-1)},rows:0,cols:0,collisions:[],blockingCell:null,reconciledEmptyCells:0,unpaintedCells:0,rangeHash:"",stateHash:"",issue:WORKBOOK_INACTIVE}}async clearSpillFormula(target){const inactive=()=>({status:"refused",reason:"workbook-inactive",mutationId:null,anchor:{col:Number(target?.col??-1),row:Number(target?.row??-1)},issue:WORKBOOK_INACTIVE});return this.proMethod("clearSpillFormula",{validate:()=>this.formulas===true?void 0:{result:inactive()},load:()=>this.workbookOpsChunkIfActive(),exec:chunk=>chunk,publish:chunk=>{const ops=this.workbookOpsEnrolled(chunk);if(ops===null)return inactive();return ops.chunk.clearWorkbookSpill(ops.enrollment,target?.col,target?.row)}})}async undoSpillTransaction(mutationId){const inactive=()=>({status:"refused",reason:"workbook-inactive",mutationId:mutationId??null,appliedWrites:0,issue:WORKBOOK_INACTIVE});return this.proMethod("undoSpillTransaction",{validate:()=>this.formulas===true?void 0:{result:inactive()},load:()=>this.workbookOpsChunkIfActive(),exec:chunk=>chunk,publish:chunk=>{const ops=this.workbookOpsEnrolled(chunk);if(ops===null)return inactive();return ops.chunk.undoWorkbookSpill(ops.enrollment,mutationId)}})}async getSpillReport(){return this.proMethod("getSpillReport",{exec:async()=>{const ops=await this.workbookOps();if(ops===null){return{status:"refused",reason:"workbook-inactive",engineLane:"none",anchors:[],overlaps:[],stateHash:"",issue:WORKBOOK_INACTIVE}}return ops.chunk.workbookSpillReport(ops.enrollment)}})}chartCreated;chartRangeChanged;chartOptionsChanged;chartDestroyed;chartLinkChunk=null;chartLinkRuntimeRef=null;chartLinkGeneration=1;chartLinkHostBag=null;chartLinkPermissionState={readOnly:false,canCreate:true,canEditProperties:true};async loadChartLinkChunk(){return await this.getChunkLoader().load("chart-link")}applyChartLinkFilterModel(model){this.activeFilters={...model};this.scheduleLifecycleFilterPeerNotification();this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()}chartLinkRows(){const rows=this.getDisplayRows();const columns=this.applyColumnOrder(this.resolvedColumnDefs());return rows.map((row,index2)=>{const data=isPivotRowGroupMarker(row)||isPivotGrandTotalRow(row)||this.isPivotSubtotalDisplayRow(row)?row:this.copyableDataRowAt(rows,index2);if(data===null)return{};const callbackRow=this.readPolicyConfigured()?this.maskDeniedFields(data,index2,columns):data;const flat={...callbackRow};for(const col of columns){if(typeof col.field!=="string"||col.field==="")continue;const raw=this.rawFieldValue(data,index2,col);flat[col.field]=this.isCellReadable(raw,data,index2,col)?this.cellRawValue(col.valueGetter?callbackRow:data,index2,col):this.maskedCellValue}return flat})}chartLinkHost(){if(this.chartLinkHostBag!==null)return this.chartLinkHostBag;const bag={hostElement:()=>this.host,rawColumns:()=>this.applyColumnOrder(this.resolvedColumnDefs()),hiddenColumns:()=>this.columnHidden,pinnedColumns:()=>this.columnPinned,rawRows:()=>this.chartLinkRows(),rowIdOf:()=>this.getRowId??null,generation:()=>this.chartLinkGeneration,canonicalRanges:()=>this.ensureCanonicalSelection().ranges,filterModel:()=>this.activeFilters,applyFilterModel:model=>this.applyChartLinkFilterModel(model),permissions:()=>({...this.chartLinkPermissionState,readOnly:this.chartLinkPermissionState.readOnly||!this.proGate().entitled("grid.integrated-charts")}),pivotModel:()=>{if(!this.chartLinkChunk)return null;if(this.serverSidePivotModeActive()&&this.serverSideState){const report=this.ssrmEngine().describeServerPivotResultColumns(this.serverSideState,this.serverPivotResultsStale);return this.chartLinkChunk.chartLinkServerPivotModel(report,this.serverSideRowGroupFields()[0]??null)}const pivot=this.pivotModeActive()?this.pivotComputation():null;return pivot?this.chartLinkChunk.chartLinkPivotModel(this.groupPivotEngine().describeSecondaryColumns(pivot.meta)):null},pivotRowKind:index2=>{const row=this.getDisplayRows()[index2];return isLoadingPlaceholderRow(row)?"unloaded":isPivotGrandTotalRow(row)?"grand-total":this.isPivotSubtotalDisplayRow(row)?"subtotal":"data"},emitEvent:event=>{const detail=event;if(event.type==="created")this.chartCreated.emit(detail);else if(event.type==="rangeChanged")this.chartRangeChanged.emit(detail);else if(event.type==="optionsChanged")this.chartOptionsChanged.emit(detail);else this.chartDestroyed.emit(detail)}};this.chartLinkHostBag=bag;return bag}async chartLinkRuntime(){if(this.chartLinkRuntimeRef!==null)return this.chartLinkRuntimeRef;const chunk=this.chartLinkChunk??await this.loadChartLinkChunk();this.chartLinkChunk=chunk;this.chartLinkRuntimeRef??=chunk.createChartLinkRuntime(this.chartLinkHost());return this.chartLinkRuntimeRef}async createRangeChart(params){return this.proMethod("createRangeChart",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>runtime.createChart(params)})}async updateChart(chartId,patch){return this.proMethod("updateChart",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>runtime.updateChart(chartId,patch)})}async destroyChart(chartId){return this.proMethod("destroyChart",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.destroyChart(chartId)})}async getChartRefs(){return this.proMethod("getChartRefs",{load:()=>this.chartLinkRuntime(),exec:runtime=>[...runtime.charts()]})}async syncCharts(mutation="edit"){return this.proMethod("syncCharts",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>{this.chartLinkGeneration+=1;return runtime.syncCharts(mutation)}})}async getChartMenuModel(permissions){return this.proMethod("getChartMenuModel",{load:()=>this.chartLinkRuntime(),exec:runtime=>{if(permissions!==void 0)this.chartLinkPermissionState=permissions;return runtime.menuModel()}})}async openChartToolPanel(permissions){return this.proMethod("openChartToolPanel",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>{if(permissions!==void 0)this.chartLinkPermissionState=permissions;return runtime.openToolPanel()}})}async closeChartToolPanel(){return this.proMethod("closeChartToolPanel",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.closeToolPanel()})}async getChartToolPanelReport(){return this.proMethod("getChartToolPanelReport",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.panelReport()})}async activateChartToolPanelItem(){return this.proMethod("activateChartToolPanelItem",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>runtime.panelActivate()})}async getChartModels(){return this.proMethod("getChartModels",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.captureModels()})}async restoreChartModels(envelope){return this.proMethod("restoreChartModels",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>runtime.restoreModels(envelope)})}async exportChartImage(chartId,request){return this.proMethod("exportChartImage",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.exportChart(chartId,request)})}async applyChartCrossFilter(chartId,colId,action,categories){return this.proMethod("applyChartCrossFilter",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime,publish:runtime=>runtime.crossFilter(chartId,colId,action,categories)})}async resetChartCrossFilter(){return this.proMethod("resetChartCrossFilter",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.resetCrossFilter()})}async getChartAccessibleSummary(chartId){return this.proMethod("getChartAccessibleSummary",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.accessibleSummary(chartId)})}async getChartFleetReport(){return this.proMethod("getChartFleetReport",{load:()=>this.chartLinkRuntime(),exec:runtime=>runtime.fleetReport()})}teardownChartLink(){const runtime=this.chartLinkRuntimeRef;this.chartLinkRuntimeRef=null;runtime?.disconnect()}stateChangeTracker=createStateChangeTracker();stateEventCoalescer=createStateEventCoalescer();stateUpdatedFlushScheduled=false;stateAtomSnapshot(){const snapshot={columnWidths:this.columnWidths,columnOrder:this.columnOrder,columnHidden:this.columnHidden,columnPinned:this.columnPinned,activeSortModel:this.activeSortModel,collapsedGroups:this.collapsedGroups,columnDefs:this.columnDefs,groupBy:this.groupBy,pivotMode:this.pivotMode,pivotRowGroupColumns:this.pivotRowGroupColumns,pivotColumns:this.pivotColumns,pivotValueColumns:this.pivotValueColumns,activeFilters:this.activeFilters,quickFilterValue:this.quickFilterValue,activeConditionTree:this.activeConditionTree,lifecycleFilterVersion:this.lifecycleFilterVersion,collapsedRowGroups:this.collapsedRowGroups,pivotCollapsedRowGroups:this.pivotCollapsedRowGroups,collapsedTreeNodes:this.collapsedTreeNodes,expandedDetailRows:this.expandedDetailRows,selectionState:this.selectionState,rangeState:this.rangeState,activeCell:this.activeCell,hScrollLeft:this.hScrollLeft,scrollTop:this.scrollTop,activePagination:this.activePagination,openToolPanelId:this.openToolPanelId};return snapshot}noteStateAtomsAfterRender(){const changed=this.stateChangeTracker.diff(this.stateAtomSnapshot());if(changed.length===0)return;this.stateEventCoalescer.note(changed);this.scheduleStateUpdatedFlush()}noteStateBatchSource(source,slices){if(slices.length===0)return;this.stateEventCoalescer.note(slices,source);this.scheduleStateUpdatedFlush()}scheduleStateUpdatedFlush(){if(this.stateUpdatedFlushScheduled||this.stateEventCoalescer.isFinalized())return;this.stateUpdatedFlushScheduled=true;const flush=()=>{this.stateUpdatedFlushScheduled=false;this.flushStateUpdated()};if(typeof requestAnimationFrame==="function")requestAnimationFrame(flush);else setTimeout(flush,0)}flushStateUpdated(){const pending=this.stateEventCoalescer.takeFlush();if(pending===null)return;this.stateUpdated.emit({changedSlices:[...pending.changedSlices],sources:[...pending.sources],coalescedBatches:pending.coalescedBatches})}emitPreDestroyedOnce(){if(this.stateEventCoalescer.isFinalized())return;this.flushStateUpdated();if(!this.stateEventCoalescer.finalizeOnce())return;const built=buildGridState(this.gridStateCaptureInput());const detail={state:built.state,captureIssues:built.issues};this.preDestroyed.emit(detail)}applyInitialGridState(){if(this.initialState===void 0||this.initialState===null)return;const migration=migrateGridState(this.initialState);if(!migration.ok||migration.state===null){console.warn("[SG:STATE] initialState rejected by migration:",migration.issues.map(issue2=>`${issue2.path} ${issue2.detail}`).join("; "));return}const plan=planGridStateApply(migration.state,this.gridStateApplyContexts());if(!plan.ok){console.warn("[SG:STATE] initialState rejected:",plan.issues.map(issue2=>`${issue2.path} ${issue2.detail}`).join("; "));return}const requirements=scanGridStateProRequirements(plan,migration.state);if(requirements.length>0){const features=gridStateRequirementFeatures(requirements);if(this.proGate().awaiting(features)){this.initialStateLicenseFeatures=features;return}const refused=this.proGate().refuseRequest(features,"initialState");if(refused.length>0){console.warn("[SG:STATE] initialState rejected (license):",gridStateLicenseIssues(requirements,refused).map(issue2=>`${issue2.path} ${issue2.detail}`).join("; "));return}const filterNeeds=gridProFilterRequirements(requirements);if(filterNeeds.length>0&&!gridProChunkInBuild("pro-filters")){for(const feature of gridStateRequirementFeatures(filterNeeds))this.proModuleAvailable(feature,"initialState","pro-filters");console.warn("[SG:STATE] initialState rejected (module-missing):",gridStateModuleIssues(filterNeeds,"module-missing","pro-filters").map(issue2=>`${issue2.path} ${issue2.detail}`).join("; "));return}}if(plan.find){void this.proFiltersModuleStep(requirements,"initialState").then(async step=>{if(!this.host.isConnected||step.issues.length>0)return;const current=planGridStateApply(migration.state,this.gridStateApplyContexts());if(!current.ok)return;const currentRequirements=scanGridStateProRequirements(current,migration.state);if(this.proGate().refuseRequest(gridStateRequirementFeatures(currentRequirements),"initialState").length>0)return;await this.executeGridStatePlan(current);this.noteStateBatchSource("initial-state",current.appliedSlices);this.reEvaluateEngine()}).catch(error=>console.warn("[SG:STATE] initialState failed:",error));return}void this.executeGridStatePlan(plan);this.noteStateBatchSource("initial-state",plan.appliedSlices);this.reEvaluateEngine()}computeAutoSizeWidth(col){const headerText=typeof col.headerName==="string"&&col.headerName.length>0?col.headerName:col.field;const cellTexts=this.harvestVisibleCellTexts(col);const font=this.resolveAutoSizeFont();const measureText=text=>this.measureTextPx(text,font);const opts={};const colMin=this.resolveInteractiveColumnMinWidth(col);const colMax=this.resolveColumnMaxWidth(col,colMin);return measureAutoSizeWidth({headerText,cellTexts,colMin,colMax:Number.isFinite(colMax)?colMax:void 0,measureText},opts)}resolveAutoSizeFont(){return"14px sans-serif"}harvestVisibleCellTexts(col){const rows=this.getDisplayRows();const colId=col.field;const out=new Array(rows.length);for(let i=0;i<rows.length;i++){const row=rows[i];const extensionRow=this.readPolicyConfigured()?this.maskDeniedFields(row,i,this.resolvedColumnDefs()):row;let value;try{value=this.resolveGridCellValue({row:extensionRow,rowIndex:i,colId,field:colId,valueGetter:col.valueGetter,colDef:col})}catch{value=extensionRow[colId]}if(this.readPolicyConfigured()&&!this.isCellReadable(this.rawFieldValue(row,i,col),row,i,col))value=this.maskedCellValue;let text;if(col.valueFormatter!==void 0&&col.valueFormatter!==null){try{text=this.formatGridCellValue({value,row:extensionRow,rowIndex:i,colId,valueFormatter:col.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef:col})}catch{text=value==null?"":String(value)}}else if(value==null){text=""}else{text=String(value)}out[i]=text}return out}measureTextPx(text,font){let ctx=this.autoSizeCanvasCache.get(font)??null;if(ctx===null){ctx=this.createAutoSizeContext(font);if(ctx!==null)this.autoSizeCanvasCache.set(font,ctx)}if(ctx===null)return 0;try{const metrics=ctx.measureText(text);const w=metrics.width;return typeof w==="number"&&Number.isFinite(w)&&w>=0?w:0}catch{return 0}}createAutoSizeContext(font){try{if(typeof OffscreenCanvas!=="undefined"){const off=new OffscreenCanvas(1,1);const ctx=off.getContext("2d");if(ctx!==null){ctx.font=font;return ctx}}}catch{}try{if(typeof document!=="undefined"&&typeof document.createElement==="function"){const canvas=document.createElement("canvas");const ctx=canvas.getContext("2d");if(ctx!==null){ctx.font=font;return ctx}}}catch{}return null}handleColumnReorderPointerDown(event,colId){event.preventDefault();event.stopPropagation();const columnIds=this.effectiveColumnIds();this.columnReorderController.start({colId,columnIds});if(!this.columnReorderController.isActive())return;const headerEl=event.currentTarget;this.startColumnReorderPreview(colId,headerEl,event.clientX,event.clientY);if(headerEl&&typeof headerEl.setPointerCapture==="function"){try{headerEl.setPointerCapture(event.pointerId)}catch{}}this.columnReorderPointerId=event.pointerId;this.columnReorderHeaderEl=headerEl;this.columnReorderHeaderRowEl=headerEl?.parentElement;this.columnReorderStartRects=this.captureColumnReorderStartRects();this.columnReorderStartPointerX=event.clientX;this.attachColumnReorderDocumentListeners();if(typeof document!=="undefined"&&document.body){document.body.style.cursor="grabbing"}const escHandler=ev=>{if(ev.key==="Escape"&&this.columnReorderController.isActive()){ev.preventDefault();this.cancelColumnReorder()}};this.columnReorderEscHandler=escHandler;if(typeof document!=="undefined"){document.addEventListener("keydown",escHandler,true)}}attachColumnReorderDocumentListeners(){if(typeof document==="undefined")return;this.detachColumnReorderDocumentListeners();const matchesPointer=event=>this.columnReorderPointerId===null||event.pointerId===this.columnReorderPointerId;this.columnReorderDocPointerMoveHandler=event=>{if(!matchesPointer(event))return;this.handleColumnReorderPointerMove(event)};this.columnReorderDocPointerUpHandler=event=>{if(!matchesPointer(event))return;this.handleColumnReorderPointerUp(event)};this.columnReorderDocPointerCancelHandler=event=>{if(!matchesPointer(event))return;this.handleColumnReorderPointerCancel(event)};document.addEventListener("pointermove",this.columnReorderDocPointerMoveHandler,true);document.addEventListener("pointerup",this.columnReorderDocPointerUpHandler,true);document.addEventListener("pointercancel",this.columnReorderDocPointerCancelHandler,true)}detachColumnReorderDocumentListeners(){if(typeof document==="undefined")return;if(this.columnReorderDocPointerMoveHandler){document.removeEventListener("pointermove",this.columnReorderDocPointerMoveHandler,true)}if(this.columnReorderDocPointerUpHandler){document.removeEventListener("pointerup",this.columnReorderDocPointerUpHandler,true)}if(this.columnReorderDocPointerCancelHandler){document.removeEventListener("pointercancel",this.columnReorderDocPointerCancelHandler,true)}this.columnReorderDocPointerMoveHandler=null;this.columnReorderDocPointerUpHandler=null;this.columnReorderDocPointerCancelHandler=null}captureColumnReorderStartRects(){const rowEl=this.columnReorderHeaderRowEl;if(!rowEl)return[];const children=Array.from(rowEl.children);const dataCells=children.filter(el=>!el.classList.contains("sy-grid__header-cell--selection"));return dataCells.map(el=>{const rect=el.getBoundingClientRect();return{left:rect.left,right:rect.right}})}computeReorderTargetIndex(clientX){const active=this.columnReorderController.getActive();if(active===null)return null;const rects=this.columnReorderStartRects;if(rects.length===0)return null;const originIndex=Math.max(0,Math.min(active.originIndex,rects.length-1));let targetIndex=originIndex;const movingRight=clientX>this.columnReorderStartPointerX;const rightProbeX=movingRight?clientX+this.columnReorderPointerToRightEdge:clientX;for(let i=originIndex+1;i<rects.length;i++){if(rightProbeX<rects[i].left)break;targetIndex=i}for(let i=originIndex-1;i>=0;i--){if(clientX>rects[i].right)break;targetIndex=i}return targetIndex}handleColumnReorderPointerMove(event){if(!this.columnReorderController.isActive())return;this.updateColumnReorderPreview(event.clientX,event.clientY);const overPanel=this.groupPanelActive()&&this.pointerOverGroupPanel(event.clientX,event.clientY);if(overPanel!==this.columnDragOverGroupPanel)this.columnDragOverGroupPanel=overPanel;if(overPanel)return;const targetIndex=this.computeReorderTargetIndex(event.clientX);if(targetIndex===null)return;const result=this.columnReorderController.move({targetIndex});if(result===null)return;const active=this.columnReorderController.getActive();if(active===null)return;const live=active.columnIdsAtStart.slice();const[picked]=live.splice(active.originIndex,1);live.splice(active.currentIndex,0,picked);this.columnOrder=live.slice();this.alignedNotify()}handleColumnReorderPointerUp(_event){if(!this.columnReorderController.isActive())return;if(this.columnDragOverGroupPanel){const colId=this.columnReorderController.getActive()?.draggedColId??null;this.cancelColumnReorder();this.columnDragOverGroupPanel=false;if(colId!==null)this.setGroupByFromPanel(colId);return}if(this.reorderableColumns!==true){this.cancelColumnReorder();return}this.commitColumnReorder()}pointerOverGroupPanel(x,y){const el=this.groupPanelEl;if(el===null)return false;const r=el.getBoundingClientRect();return x>=r.left&&x<=r.right&&y>=r.top&&y<=r.bottom}setGroupByFromPanel(field){if(this.groupBy===field)return;if(!this.proNewWorkAllowed("grid.row-grouping","groupPanel"))return;this.groupBy=field;this.rowGroupChanged.emit({groupBy:field})}clearGroupByFromPanel(){if(this.groupBy===void 0||this.groupBy==="")return;this.groupBy=void 0;this.rowGroupChanged.emit({groupBy:null})}handleColumnReorderPointerCancel(_event){if(!this.columnReorderController.isActive())return;this.cancelColumnReorder()}commitColumnReorder(){const result=this.columnReorderController.commit();if(result!==null){const orderAfter=result.orderAfter.slice();this.columnOrder=orderAfter.slice();this.alignedNotify();if(result.finalIndex!==result.originIndex){this.columnReordered.emit({colId:result.colId,originIndex:result.originIndex,finalIndex:result.finalIndex,orderBefore:result.orderBefore,orderAfter:result.orderAfter})}}this.teardownColumnReorderDrag()}cancelColumnReorder(){const active=this.columnReorderController.getActive();if(active!==null){this.columnOrder=active.columnIdsAtStart.slice();this.alignedNotify()}this.columnReorderController.cancel();this.teardownColumnReorderDrag()}teardownColumnReorderDrag(){if(this.columnReorderHeaderEl&&this.columnReorderPointerId!==null){try{if(typeof this.columnReorderHeaderEl.releasePointerCapture==="function"){this.columnReorderHeaderEl.releasePointerCapture(this.columnReorderPointerId)}}catch{}}this.columnReorderPointerId=null;this.columnReorderHeaderEl=null;this.columnReorderHeaderRowEl=null;if(this.columnDragOverGroupPanel)this.columnDragOverGroupPanel=false;this.columnReorderStartRects=[];this.columnReorderStartPointerX=0;this.columnReorderPointerToRightEdge=0;this.detachColumnReorderDocumentListeners();this.removeColumnReorderPreview();this.columnReorderPointerOffsetX=0;this.columnReorderPointerOffsetY=0;if(this.columnReorderEscHandler&&typeof document!=="undefined"){document.removeEventListener("keydown",this.columnReorderEscHandler,true)}this.columnReorderEscHandler=null;if(typeof document!=="undefined"&&document.body){document.body.style.cursor=""}}async setHoveredRow(rowId){this.applyHoverTransition(rowId)}async getHoveredRowId(){return this.hoverState.hoveredRowId}async getActiveEditTransaction(){return this.editStore.active}async commitActiveEdit(){const facade=this.editorFacade;if(facade!==null&&facade.lookup().status!=="idle"){const result=await facade.stop("api");return result.status==="committed"}return this.commitEditTransaction()}async cancelActiveEdit(){const hadQueuedRequest=this.invalidateLifecycleEditorRequests();const facade=this.editorFacade;const active=this.editStore.active;if(facade!==null&&facade.lookup().status!=="idle"){const result=await facade.stop("api",{cancel:true});return hadQueuedRequest||result.status==="cancelled"||result.status==="cancelled-before-start"}if(active===null)return hadQueuedRequest;if(active.phase!=="pending")return hadQueuedRequest;const rowIndex=this.editingCell?.rowIndex??active.rowIndex;const colIndex=this.editingCell?.colIndex??active.colIndex;this.editingCell=null;this.unregisterLifecycleEditorDocumentOwner();this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex,colIndex});return true}async registerCellRenderer(name,renderer){if(typeof name!=="string"||name.trim().length===0){return this.cellRendererRegistry.register(name,renderer)}if(typeof renderer!=="function"){return this.cellRendererRegistry.register(name,renderer)}const ok=this.cellRendererRegistry.register(name,renderer);if(ok){this.cellRendererVersion=this.cellRendererVersion+1}return ok}async listRegisteredCellRenderers(){return this.cellRendererRegistry.list()}async unregisterCellRenderer(name){if(typeof name!=="string")return false;if(BUILTIN_RENDERER_NAMES.indexOf(name)>=0)return false;const ok=this.cellRendererRegistry.unregister(name);if(ok){this.cellRendererVersion=this.cellRendererVersion+1}return ok}async registerGridComponent(scope,kind,name,definition){const manager=await this.getComponentManager(kind);manager.register(scope,kind,name,definition);if(scope==="local"){this.localGridComponentRegistrations.set(`${kind}\0${name.trim()}`,{kind,name:name.trim(),definition})}this.componentRegistryRevision+=1;if(kind==="filter"||kind==="floatingFilter"){this.invalidateComponentFilterRuntime()}this.lifecycleRendererPresentationVersion+=1}async replaceGridComponent(scope,kind,name,definition){const manager=await this.getComponentManager(kind);manager.replace(scope,kind,name,definition);if(scope==="local"){this.localGridComponentRegistrations.set(`${kind}\0${name.trim()}`,{kind,name:name.trim(),definition})}this.componentRegistryRevision+=1;if(kind==="filter"||kind==="floatingFilter"){this.invalidateComponentFilterRuntime()}this.lifecycleRendererPresentationVersion+=1}async unregisterGridComponent(scope,kind,name){const manager=await this.getComponentManager(kind);const removed=manager.unregister(scope,kind,name);if(removed){if(scope==="local"){this.localGridComponentRegistrations.delete(`${kind}\0${name.trim()}`)}this.componentRegistryRevision+=1;if(kind==="filter"||kind==="floatingFilter"){this.invalidateComponentFilterRuntime()}this.lifecycleRendererPresentationVersion+=1}return removed}async getRegisteredGridComponentNames(scope,kind){const manager=await this.getComponentManager(kind);return manager.list(scope,kind)}async getCellRendererInstance(rowId,colId){const identity2=this.componentFacadeIdentity(rowId,colId);const manager=this.componentManager;if(identity2===null){return{status:"unavailable",key:this.componentRendererCellKey(rowId,colId)}}if(manager===null){return{status:"unavailable",key:this.componentRendererCellKey(identity2.rowId,identity2.colId)}}return manager.renderer.lookup(identity2)}async destroyCellRendererInstance(rowId,colId){const identity2=this.componentFacadeIdentity(rowId,colId);const manager=this.componentManager;if(identity2===null||manager===null)return false;const discovery=manager.renderer.lookup(identity2);if(discovery.status!=="mounted")return false;if(this.focusedLifecycleRenderer!==null&&this.sameComponentIdentity(this.focusedLifecycleRenderer.identity,identity2)&&this.focusedLifecycleRenderer.generation===discovery.generation){this.releaseFocusedLifecycleRenderer()}const destroyed=await manager.renderer.destroy(identity2,discovery.generation);if(destroyed){if(this.focusedLifecycleRenderer!==null&&this.sameComponentIdentity(this.focusedLifecycleRenderer.identity,identity2)&&this.focusedLifecycleRenderer.generation===discovery.generation){this.focusedLifecycleRenderer=null;this.lifecycleRendererFocusSequence+=1}const key=JSON.stringify([identity2.rowId,identity2.colId]);if(this.lifecycleRendererPresentations.delete(key)){this.lifecycleRendererPresentationVersion+=1}}return destroyed}async focusCellRendererInstance(rowId,colId,direction){const identity2=this.componentFacadeIdentity(rowId,colId);const manager=this.componentManager;if(identity2===null||manager===null||direction!=="in"&&direction!=="out"){return false}const discovery=manager.renderer.lookup(identity2);if(discovery.status!=="mounted")return false;let focusSequence=null;const outSequence=this.lifecycleRendererFocusSequence;if(direction==="in"){const releaseSequence=this.lifecycleRendererFocusSequence;this.releaseFocusedLifecycleRenderer();if(this.lifecycleRendererFocusSequence!==releaseSequence+1){return false}focusSequence=++this.lifecycleRendererFocusSequence}const focused=direction==="in"?manager.renderer.focusIn(identity2,discovery.generation):manager.renderer.focusOut(identity2,discovery.generation);if(!focused)return false;if(direction==="in"){if(focusSequence!==this.lifecycleRendererFocusSequence||manager!==this.componentManager){manager.renderer.focusOut(identity2,discovery.generation);return false}this.focusedLifecycleRenderer={identity:identity2,generation:discovery.generation}}else if(outSequence===this.lifecycleRendererFocusSequence&&this.focusedLifecycleRenderer!==null&&this.sameComponentIdentity(this.focusedLifecycleRenderer.identity,identity2)){this.focusedLifecycleRenderer=null;this.lifecycleRendererFocusSequence+=1}return true}async getCellEditorInstance(){const lookup=this.editorFacade?.lookup();if(lookup===void 0||lookup.status!=="mounted")return null;return this.componentManager?.editor.runtime.lookup(lookup.ref.key)??null}async getColumnFilterInstance(columnId){await this.reconcileComponentFilters();const lookup=this.filterFacade?.lookupFilterInstance(columnId);return lookup?.status==="mounted"?lookup.instance:null}async getColumnFilterModel(columnId){await this.reconcileComponentFilters();const result=await this.filterFacade?.getFilterModel(columnId);return result?.status==="ok"?result.value:null}async setColumnFilterModel(columnId,model){await this.reconcileComponentFilters();const result=await this.filterFacade?.setFilterModel(columnId,model,"api");return result?.status==="ok"}async onFilterChanged(){await this.reconcileComponentFilters();const facade=this.filterFacade;if(facade===null)return;await this.runComponentFilterChangeBatch(()=>facade.synchronizeFilterModels("api"))}async refreshExternalFilter(){if(this.externalFilter==null)return false;this.externalFilterRevision+=1;this.externalFilterReadyRevision=-1;this.invalidateComponentFilterRuntime();await this.reconcileComponentFilters();return this.externalFilterRuntimeReady()}async destroyColumnFilter(columnId){await this.reconcileComponentFilters();const facade=this.filterFacade;if(facade===null)return false;const model=await facade.getFilterModel(columnId);if(model.status==="ok"){this.componentFilterModels.set(columnId,model.value)}const destroyed=await facade.destroyFilter(columnId);if(destroyed){this.componentRecentlyDestroyedFilters.add(columnId);this.componentFilterRestorePending=true;this.invalidateComponentFilterRuntime();this.lifecycleFilterVersion+=1}return destroyed}async recreateColumnFilter(columnId,options={}){const recentlyDestroyed=this.componentRecentlyDestroyedFilters.delete(columnId);const preservedModel=recentlyDestroyed?this.componentFilterModels.get(columnId):void 0;const hadPreservedModel=recentlyDestroyed&&this.componentFilterModels.has(columnId);if(recentlyDestroyed&&options.preserveModel===false){this.componentFilterModels.delete(columnId);this.componentFilterRestorePending=this.componentFilterModels.size>0}await this.reconcileComponentFilters();const facade=this.filterFacade;if(facade===null)return false;if(recentlyDestroyed&&facade.lookupFilterInstance(columnId).status==="mounted"){if(options.preserveModel===false){const cleared=await facade.setFilterModel(columnId,null,"api");if(cleared.status==="ok"&&hadPreservedModel&&preservedModel!==null&&!this.componentFilterModels.has(columnId)){this.componentFilterModels.set(columnId,preservedModel);this.handleComponentFilterChanged(columnId,"api",null)}return cleared.status==="ok"}return true}const result=await facade.recreateFilter(columnId,options);const recreated=result.status==="mounted"||result.status==="attached"||result.status==="already-attached";if(recreated)this.lifecycleFilterVersion+=1;return recreated}lifecycleEditorCellElement(rowIndex,colIndex){return this.host?.querySelector(`.sy-grid__row[data-row-index="${rowIndex}"] .sy-grid__cell[data-col-index="${colIndex}"]`)??void 0}registerLifecycleEditorDocumentOwner(){const doc=this.host?.ownerDocument;if(doc===void 0)return;let participants=activeGridEditorsByDocument.get(doc);if(participants===void 0){participants=new Map;activeGridEditorsByDocument.set(doc,participants)}participants.set(this,{contains:target=>{const ViewNode=doc.defaultView?.Node;if(ViewNode===void 0||!(target instanceof ViewNode)){return false}return this.host.contains(target)||this.lifecycleEditorAttachedWrapper?.contains(target)===true}})}focusLifecycleEditorDocumentOwner(){const doc=this.host?.ownerDocument;if(doc!==void 0&&activeGridEditorsByDocument.get(doc)?.has(this)===true){focusedGridEditorByDocument.set(doc,this)}}unregisterLifecycleEditorDocumentOwner(){const doc=this.host?.ownerDocument;if(doc===void 0)return;const participants=activeGridEditorsByDocument.get(doc);participants?.delete(this);if(participants?.size===0)activeGridEditorsByDocument.delete(doc);if(focusedGridEditorByDocument.get(doc)===this){focusedGridEditorByDocument.delete(doc)}}ownsLifecycleEditorDocumentEvent(event){const doc=this.host?.ownerDocument;if(doc===void 0)return false;const participants=activeGridEditorsByDocument.get(doc);if(participants===void 0||!participants.has(this))return false;const candidates=typeof event.composedPath==="function"?event.composedPath():[event.target];for(const candidate of candidates){for(const[owner,participant]of participants){if(participant.contains(candidate))return owner===this}}const activeElement=doc.activeElement;if(activeElement!==null){for(const[owner,participant]of participants){if(participant.contains(activeElement))return owner===this}}const focusedOwner=focusedGridEditorByDocument.get(doc);if(focusedOwner!==void 0)return focusedOwner===this;return participants.size===1}waitForLifecycleEditorAttachment(key){this.lifecycleEditorAttachmentReady?.settle(false);let settle;const task=new Promise(resolve=>{let settled=false;settle=attached=>{if(settled)return;settled=true;resolve(attached)}});this.lifecycleEditorAttachmentReady={key,task,settle};return task}settleLifecycleEditorAttachment(key,attached){const pending=this.lifecycleEditorAttachmentReady;if(pending===null||key!==void 0&&pending.key!==key)return;this.lifecycleEditorAttachmentReady=null;pending.settle(attached)}clearLifecycleEditorValidation(key,generation){const owned=this.lifecycleEditorValidationPresentation;if(owned===null||key!==void 0&&owned.ref.key!==key||generation!==void 0&&owned.ref.generation!==generation){return}this.lifecycleEditorValidationPresentation=null;owned.presentation.clear()}currentLifecycleEditorValidationTarget(ref,editorStore){try{if(this.editStore!==editorStore||editorStore.active===null||editorStore.active.phase!=="pending"||!this.host?.isConnected||this.lifecycleEditorRef?.key!==ref.key||this.lifecycleEditorRef.generation!==ref.generation||this.lifecycleEditorNavigationTarget?.key!==ref.key){return null}const target=this.resolveQueuedCellEditTarget(this.lifecycleEditorNavigationTarget.target,false);const column=target===null?void 0:this.effectiveColumns()[target.colIndex];const lookup=this.editorFacade?.lookup();const wrapper=this.lifecycleEditorAttachedWrapper;if(target===null||column===void 0||lookup?.status!=="mounted"||lookup.ref.key!==ref.key||lookup.ref.generation!==ref.generation||!lookup.attached||wrapper===null||!wrapper.isConnected||!wrapper.contains(lookup.gui)){return null}return{wrapper,rowIndex:target.rowIndex,field:column.field}}catch{return null}}reportLifecycleEditorInvalidBlock(notification,editorStore){const result=notification.result;const ref=notification.ref;if(ref===void 0||result.status!=="invalid"||result.mode!=="block"||notification.transactionOutcome!=="retained"){return}const target=this.currentLifecycleEditorValidationTarget(ref,editorStore);if(target===null){this.clearLifecycleEditorValidation(ref.key,ref.generation);return}const message=result.errors[0]?.message??"Invalid value";this.clearLifecycleEditorValidation();const presentation=this.componentEditorValidationPresenter?.(target.wrapper,message)??null;if(presentation!==null){this.lifecycleEditorValidationPresentation={ref,presentation}}const confirmed=this.currentLifecycleEditorValidationTarget(ref,editorStore);if(confirmed===null||confirmed.wrapper!==target.wrapper){this.clearLifecycleEditorValidation(ref.key,ref.generation);return}this.cellValidationFailed.emit({rowIndex:confirmed.rowIndex,field:confirmed.field,value:result.value,message})}resetLifecycleEditorPresentation(key){const ownedKey=this.lifecycleEditorRef?.key??this.lifecycleEditorNavigationTarget?.key;if(key!==void 0&&ownedKey!==void 0&&ownedKey!==key)return;this.clearLifecycleEditorValidation(key);this.settleLifecycleEditorAttachment(key,false);this.lifecycleEditorRef=null;this.lifecycleEditorCell=null;if(key===void 0||this.lifecycleEditorNavigationTarget?.key===key){this.lifecycleEditorNavigationTarget=null}this.lifecycleEditorHost=null;this.lifecycleEditorAttachTask=null;this.lifecycleEditorAttachedWrapper=null;this.lifecycleEditorPopupReposition=null;this.unregisterLifecycleEditorDocumentOwner();this.lifecycleEditorVersion+=1}invalidateLifecycleEditorRequests(){const hadQueuedRequest=this.lifecycleEditorQueuedRequestRevision!==null;this.lifecycleEditorRequestRevision+=1;this.lifecycleEditorQueuedRequestRevision=null;return hadQueuedRequest}handleLifecycleEditorStop(notification,editorStore,rowIndex,colIndex){if(notification.result.status==="invalid"&¬ification.result.mode==="block"){this.reportLifecycleEditorInvalidBlock(notification,editorStore)}else if(notification.ref!==void 0){this.clearLifecycleEditorValidation(notification.ref.key,notification.ref.generation)}if(notification.transactionOutcome==="retained"){if(this.editStore!==editorStore&¬ification.ref!==void 0&&this.lifecycleEditorRef?.key===notification.key){this.invalidateLifecycleEditorRequests();void this.editorFacade?.stop("api",{cancel:true})}return}if(notification.transactionOutcome==="cancelled"&&this.editStore===editorStore&&editorStore.active!==null&&editorStore.active.phase==="pending"){this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex,colIndex})}if(notification.terminal){if(notification.transactionOutcome==="cancelled"&¬ification.reason!=="replacement"){this.invalidateLifecycleEditorRequests()}this.resetLifecycleEditorPresentation(notification.key);if(notification.reason==="enter"||notification.reason==="escape"||notification.reason==="api"){queueMicrotask(()=>{if(!this.host?.isConnected||this.editorFacade?.lookup().status!=="idle"){return}this.viewportEl?.focus({preventScroll:true});this.focusActiveLifecycleRenderer()})}}}beginLifecycleEditor(rowIndex,colIndex,row,col,originalValue,startedBy,event){const editorStore=this.editStore;const colId=this.componentFilterColumnId(col)||String(col.field);const key=`editor:${++this.lifecycleEditorSequence}:${JSON.stringify([rowIndex,colId])}`;let rowId=null;try{rowId=this.editRowIdentity(row)}catch{rowId=null}const navigationTarget={row,rowId,colId};this.lifecycleEditorNavigationTarget={key,target:navigationTarget};this.lifecycleEditorCell={rowIndex,colIndex};this.lifecycleEditorRef=null;this.lifecycleEditorHost=null;this.lifecycleEditorVersion+=1;const resolveCurrentCell=(requireEditable=true)=>{if(this.editStore!==editorStore||this.lifecycleEditorNavigationTarget?.key!==key){return null}return this.resolveQueuedCellEditTarget(navigationTarget,requireEditable)};let componentRuntimeLoaded=false;return(async()=>{await this.getComponentManager("editor");componentRuntimeLoaded=true;const facade=this.editorFacade;if(facade===null||this.editStore!==editorStore||!this.host?.isConnected){this.resetLifecycleEditorPresentation(key);return false}const currentCell=resolveCurrentCell();const currentRow=currentCell===null?void 0:this.getDisplayRows()[currentCell.rowIndex];const currentCol=currentCell===null?void 0:this.effectiveColumns()[currentCell.colIndex];const currentValue=currentRow!==void 0&¤tRow!==null&&typeof currentRow==="object"&¤tCol!==void 0?readOwnFieldPath(currentRow,currentCol.field):void 0;if(currentCell===null||currentRow===void 0||currentRow===null||typeof currentRow!=="object"||currentCol?.cellEditor==null||!structuralEqual(currentValue,originalValue)){this.handleLifecycleEditorStop({key,ref:void 0,reason:"replacement",origin:"lifecycle",result:{status:"cancelled-before-start",key},transactionOutcome:"cancelled",terminal:true},editorStore,currentCell?.rowIndex??rowIndex,currentCell?.colIndex??colIndex);return false}this.lifecycleEditorCell=currentCell;const callbackRow=this.readPolicyConfigured()?this.maskDeniedFields(currentRow,currentCell.rowIndex,this.resolvedColumnDefs()):currentRow;const result=await facade.begin({key,declaration:currentCol.cellEditor,local:this.components,params:{value:currentValue,data:callbackRow,rowIndex:currentCell.rowIndex,colId,cellElement:this.lifecycleEditorCellElement(currentCell.rowIndex,currentCell.colIndex),startedBy,event,context:this.context},invalidMode:this.invalidEditMode,canCommit:()=>resolveCurrentCell()!==null,commitPrepared:value=>{const currentCell2=resolveCurrentCell();return currentCell2!==null&&this.commitPreparedCellEdit("editor",currentCell2.rowIndex,currentCell2.colIndex,value,originalValue,true,editorStore)},onStopResult:notification=>{const currentCell2=resolveCurrentCell(false);this.handleLifecycleEditorStop(notification,editorStore,currentCell2?.rowIndex??rowIndex,currentCell2?.colIndex??colIndex)}});if(this.editStore!==editorStore||!this.host?.isConnected){if(result.status==="started"){await facade.destroy(result.ref)}this.resetLifecycleEditorPresentation(key);return false}if(result.status==="started"){this.lifecycleEditorRef=result.ref;const attached=this.waitForLifecycleEditorAttachment(key);this.lifecycleEditorVersion+=1;const didAttach=await attached;const lookup=facade.lookup();return didAttach&&this.editStore===editorStore&&this.lifecycleEditorRef?.key===result.ref.key&&this.lifecycleEditorRef.generation===result.ref.generation&&lookup.status==="mounted"&&lookup.attached}if(result.status==="failed"||result.status==="stale"||result.status==="blocked-by-active"){this.handleLifecycleEditorStop({key,ref:void 0,reason:"replacement",origin:"lifecycle",result:result.status==="failed"?{status:"failed",key,generation:0,error:result.error}:{status:"cancelled-before-start",key},transactionOutcome:"cancelled",terminal:true},editorStore,rowIndex,colIndex)}return false})().catch(cause=>{if(componentRuntimeLoaded){this.emitComponentError({code:"CREATE_FAILED",phase:"create",componentKind:"editor",mountKey:key,retryable:true,cause})}this.handleLifecycleEditorStop({key,ref:void 0,reason:"replacement",origin:"lifecycle",result:{status:"cancelled-before-start",key},transactionOutcome:"cancelled",terminal:true},editorStore,rowIndex,colIndex);return false})}lifecycleEditorPlacement(cellElement,gui,preferred){const placement=this.componentPopupPlacement;const doc=this.host?.ownerDocument??document;const root=doc.documentElement;const anchor=cellElement?.getBoundingClientRect()??{left:0,top:0,right:0,bottom:0,width:0,height:0};const guiRect=gui.getBoundingClientRect();if(placement===null){return{position:"fixed",placement:preferred,left:anchor.left,top:preferred==="under"?anchor.bottom+4:anchor.top,width:Math.max(anchor.width,guiRect.width),maxWidth:root.clientWidth,maxHeight:root.clientHeight}}const direction=this.host.getAttribute("dir")??doc.documentElement.getAttribute("dir")??"ltr";return placement(anchor,{width:guiRect.width,height:guiRect.height},{left:0,top:0,right:root.clientWidth,bottom:root.clientHeight,width:root.clientWidth,height:root.clientHeight},{preferred,rtl:direction.toLowerCase()==="rtl",touch:doc.defaultView?.matchMedia?.("(pointer: coarse)").matches===true})}applyLifecycleEditorPlacement(wrapper,placement){wrapper.style.position=placement.position;wrapper.style.left=`${placement.left}px`;wrapper.style.top=`${placement.top}px`;wrapper.style.width=`${placement.width}px`;wrapper.style.maxWidth=`${placement.maxWidth}px`;wrapper.style.maxHeight=`${placement.maxHeight}px`;wrapper.dataset.placement=placement.placement}lifecycleEditorDomHost(){return{calculatePopupPlacement:({gui,preferred,cellElement})=>this.lifecycleEditorPlacement(cellElement,gui,preferred),attach:({ref,gui,mode,placement,cellElement})=>{const doc=this.host.ownerDocument;const wrapper=mode==="inline"?this.lifecycleEditorHost:doc.createElement("div");if(wrapper===null||!wrapper.isConnected&&mode==="inline"){throw new Error("Lifecycle editor inline host is detached.")}if(mode==="popup"){wrapper.className="sy-grid__cell-editor-component-popup";wrapper.dataset.componentKey=ref.key;const hostStyle=doc.defaultView?.getComputedStyle(this.host);if(hostStyle!==void 0){for(let index2=0;index2<hostStyle.length;index2+=1){const property=hostStyle.item(index2);if(!property.startsWith("--sy-"))continue;wrapper.style.setProperty(property,hostStyle.getPropertyValue(property))}wrapper.dir=hostStyle.direction==="rtl"?"rtl":"ltr";wrapper.style.fontFamily=hostStyle.fontFamily}doc.body.appendChild(wrapper)}wrapper.replaceChildren(gui);this.lifecycleEditorAttachedWrapper=wrapper;const currentCellElement=()=>{const target=this.lifecycleEditorNavigationTarget?.key===ref.key?this.lifecycleEditorNavigationTarget.target:null;if(target===null){return cellElement?.isConnected?cellElement:void 0}const resolved=this.resolveQueuedCellEditTarget(target,false);return resolved===null?void 0:this.lifecycleEditorCellElement(resolved.rowIndex,resolved.colIndex)};const recalculate=()=>{if(mode!=="popup"||!wrapper.isConnected)return;const anchor=currentCellElement();if(anchor===void 0||!anchor.isConnected){this.invalidateLifecycleEditorRequests();void this.editorFacade?.stop("virtual-scroll",{cancel:true});return}this.applyLifecycleEditorPlacement(wrapper,this.lifecycleEditorPlacement(anchor,gui,placement?.placement==="above"?"under":placement?.placement??"over"))};let popupResizeObserver=null;let popupRepositionFrame=null;const scheduleRecalculate=()=>{const view=doc.defaultView;if(mode!=="popup"||view===null||popupRepositionFrame!==null){return}popupRepositionFrame=view.requestAnimationFrame(()=>{popupRepositionFrame=null;recalculate()})};if(mode==="popup"){const anchor=currentCellElement();if(anchor===void 0||!anchor.isConnected){throw new Error("Lifecycle editor target cell is detached.")}this.applyLifecycleEditorPlacement(wrapper,this.lifecycleEditorPlacement(anchor,gui,placement?.placement==="above"?"under":placement?.placement??"over"));const ResizeObserverCtor=doc.defaultView?.ResizeObserver;if(ResizeObserverCtor!==void 0){popupResizeObserver=new ResizeObserverCtor(scheduleRecalculate);popupResizeObserver.observe(gui)}}const onKeyDown=keyboardEvent=>{keyboardEvent.stopPropagation();const facade=this.editorFacade;if(facade===null)return;if(keyboardEvent.isComposing!==true&&(keyboardEvent.key==="Enter"||keyboardEvent.key==="Tab"||keyboardEvent.key==="Escape"||keyboardEvent.key==="Esc")){this.invalidateLifecycleEditorRequests()}const navigationTarget=this.lifecycleEditorNavigationTarget?.key===ref.key?this.lifecycleEditorNavigationTarget.target:null;void facade.handleKey({key:keyboardEvent.key,shiftKey:keyboardEvent.shiftKey,isComposing:keyboardEvent.isComposing,preventDefault:()=>keyboardEvent.preventDefault()}).then(result=>{if(!result.handled||result.navigation===void 0||facade.lookup().status!=="idle"){return}const resolved=navigationTarget===null?null:this.resolveQueuedCellEditTarget(navigationTarget,false);if(resolved===null)return;this.handoffLifecycleRendererFocus(resolved.rowIndex,resolved.colIndex,result.navigation)})};const onFocusIn=()=>{this.focusLifecycleEditorDocumentOwner();this.editorFacade?.focusIn(ref)};const onFocusOut=focusEvent=>{const next=focusEvent.relatedTarget;if(next instanceof Node&&wrapper.contains(next))return;this.editorFacade?.focusOut(ref);void this.editorFacade?.handleBlur()};const stopPropagation=mouseEvent=>mouseEvent.stopPropagation();const onMouseDown=mouseEvent=>{mouseEvent.stopPropagation();const target=mouseEvent.target;if(target!==null&&target.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')===null){mouseEvent.preventDefault()}};wrapper.addEventListener("keydown",onKeyDown);wrapper.addEventListener("focusin",onFocusIn);wrapper.addEventListener("focusout",onFocusOut);wrapper.addEventListener("mousedown",onMouseDown);wrapper.addEventListener("click",stopPropagation);if(mode==="popup"){doc.defaultView?.addEventListener("resize",recalculate);doc.addEventListener("scroll",recalculate,true);this.lifecycleEditorPopupReposition={key:ref.key,recalculate}}const cleanup=()=>{this.clearLifecycleEditorValidation(ref.key,ref.generation);wrapper.removeEventListener("keydown",onKeyDown);wrapper.removeEventListener("focusin",onFocusIn);wrapper.removeEventListener("focusout",onFocusOut);wrapper.removeEventListener("mousedown",onMouseDown);wrapper.removeEventListener("click",stopPropagation);doc.defaultView?.removeEventListener("resize",recalculate);doc.removeEventListener("scroll",recalculate,true);popupResizeObserver?.disconnect();popupResizeObserver=null;if(popupRepositionFrame!==null&&doc.defaultView!==null){doc.defaultView.cancelAnimationFrame(popupRepositionFrame);popupRepositionFrame=null}if(this.lifecycleEditorAttachedWrapper===wrapper){this.lifecycleEditorAttachedWrapper=null}if(this.lifecycleEditorPopupReposition?.key===ref.key){this.lifecycleEditorPopupReposition=null}};return{wrapper,gui,mode,cleanup}},detach:attachment=>{attachment.cleanup();if(attachment.gui.parentNode===attachment.wrapper){attachment.wrapper.removeChild(attachment.gui)}if(attachment.mode==="popup"){attachment.wrapper.remove()}}}}attachLifecycleEditor(){const facade=this.editorFacade;const storedCell=this.lifecycleEditorCell;if(storedCell===null)return;const logicalTarget=this.lifecycleEditorNavigationTarget?.target;const cell=logicalTarget===void 0?storedCell:this.resolveQueuedCellEditTarget(logicalTarget,false);if(cell===null){if(facade===null)void this.cancelActiveEdit();else{this.invalidateLifecycleEditorRequests();void facade.stop("virtual-scroll",{cancel:true})}return}if(cell.rowIndex!==storedCell.rowIndex||cell.colIndex!==storedCell.colIndex){this.lifecycleEditorCell=cell}const cellElement=this.lifecycleEditorCellElement(cell.rowIndex,cell.colIndex);if(cellElement===void 0||!cellElement.isConnected){if(facade===null)void this.cancelActiveEdit();else{this.invalidateLifecycleEditorRequests();void facade.stop("virtual-scroll",{cancel:true})}return}if(facade===null)return;const lookup=facade.lookup();if(lookup.status==="starting"){return}const ref=this.lifecycleEditorRef;if(ref===null||lookup.status!=="mounted")return;const host=this.lifecycleEditorHost;if(host===null||!host.isConnected){this.invalidateLifecycleEditorRequests();void facade.stop("virtual-scroll",{cancel:true});return}if(this.lifecycleEditorAttachTask!==null)return;const key=ref.key;const task=facade.attach(ref,this.lifecycleEditorDomHost()).then(result=>{this.settleLifecycleEditorAttachment(key,result.status==="attached")}).catch(()=>{this.settleLifecycleEditorAttachment(key,false)}).finally(()=>{if(this.lifecycleEditorAttachTask===task){this.lifecycleEditorAttachTask=null}});this.lifecycleEditorAttachTask=task}richSelectDeclared(col){const declaration=col.cellEditor;if(declaration!==null&&declaration!==void 0){return typeof declaration==="object"&&declaration.type==="rich-select"}return col.editor==="autocomplete"}editableCellTarget(rowIndex,colIndex){const row=this.getDisplayRows()[rowIndex];const col=this.effectiveColumns()[colIndex];if(row===void 0||row===null||col===void 0||col.editable!==true){return null}if(this.richSelectDeclared(col)&&!this.proAllowed("grid.rich-select","columnDefs")){return null}if(col.cellEditor==null&&col.editor==="autocomplete"&&this.richSelectArmed()===null){this.proModuleAvailable("grid.rich-select","columnDefs","rich-select");return null}if(isGroupMarkerRow(row)||isGroupFooterRow(row)||isTreeNodeRow(row)||isDetailRow(row)||isLoadingPlaceholderRow(row)){return null}if(!this.passesEditPolicy(rowIndex,col,row)){return null}return{row,col}}queuedCellEditTarget(rowIndex,colIndex){const target=this.editableCellTarget(rowIndex,colIndex);if(target===null)return null;let rowId=null;try{rowId=this.editRowIdentity(target.row)}catch{rowId=null}return{row:target.row,rowId,colId:this.componentFilterColumnId(target.col)}}resolveQueuedCellEditTarget(target,requireEditable=true){const columns=this.effectiveColumns();let colIndex=-1;for(let index2=0;index2<columns.length;index2+=1){if(this.componentFilterColumnId(columns[index2])!==target.colId){continue}if(colIndex>=0)return null;colIndex=index2}if(colIndex<0)return null;const rows=this.getDisplayRows();const matches=[];for(let rowIndex2=0;rowIndex2<rows.length;rowIndex2+=1){const row=rows[rowIndex2];if(row===null||typeof row!=="object")continue;if(target.rowId===null){if(row===target.row)matches.push(rowIndex2);continue}try{if(Object.is(this.editRowIdentity(row),target.rowId)){matches.push(rowIndex2)}}catch{}}if(matches.length!==1)return null;const rowIndex=matches[0];return requireEditable&&this.editableCellTarget(rowIndex,colIndex)===null?null:{rowIndex,colIndex}}beginCellEdit(rowIndex,colIndex,startedBy="api",event=null){const spanAccess=this.rowLayoutFrame?.access("edit",rowIndex,colIndex)??null;if(spanAccess!==null&&spanAccess.redirected){rowIndex=spanAccess.origin.rowIndex;colIndex=spanAccess.origin.colIndex}if(this.isFullWidthDisplayRow(rowIndex)){this.rowLayoutRefused.emit({area:"full-width-rows",feature:"cell-edit",reason:"full-width-row",detail:`row ${rowIndex} is a full-width row; its renderer owns the content`,rowIndex,colIndex});return false}if(this.editableCellTarget(rowIndex,colIndex)===null)return false;if(this.editStore.active!==null||this.editorFacade!==null&&this.editorFacade.lookup().status!=="idle"){void this.requestCellEdit(rowIndex,colIndex,startedBy,event);return true}return this.beginCellEditNow(rowIndex,colIndex,startedBy,event)}requestCellEdit(rowIndex,colIndex,startedBy="api",event=null){const target=this.queuedCellEditTarget(rowIndex,colIndex);if(target===null){return Promise.resolve(false)}const revision=++this.lifecycleEditorRequestRevision;this.lifecycleEditorQueuedRequestRevision=revision;const run=async()=>{if(revision!==this.lifecycleEditorRequestRevision)return false;const facade=this.editorFacade;if(facade!==null&&facade.lookup().status!=="idle"){await facade.stop("replacement");if(revision!==this.lifecycleEditorRequestRevision)return false;if(facade.lookup().status!=="idle"||this.editStore.active!==null){return false}}else if(this.editStore.active!==null){if(!this.commitEditTransaction())return false}if(revision!==this.lifecycleEditorRequestRevision)return false;const resolved=this.resolveQueuedCellEditTarget(target);if(resolved===null)return false;const requested=this.beginCellEditNow(resolved.rowIndex,resolved.colIndex,startedBy,event);if(!requested)return false;const lifecycleStart=this.lifecycleEditorStartTask;return lifecycleStart===null?true:await lifecycleStart};const result=this.lifecycleEditorRequestTask.then(run,run);this.lifecycleEditorRequestTask=result.then(()=>void 0,()=>void 0);void result.then(()=>{if(this.lifecycleEditorQueuedRequestRevision===revision){this.lifecycleEditorQueuedRequestRevision=null}},()=>{if(this.lifecycleEditorQueuedRequestRevision===revision){this.lifecycleEditorQueuedRequestRevision=null}});return result}beginCellEditNow(rowIndex,colIndex,startedBy="api",event=null){const target=this.editableCellTarget(rowIndex,colIndex);if(target===null)return false;const{row,col}=target;const originalValue=readOwnFieldPath(row,col.field);const didBegin=this.beginEditTransaction(rowIndex,colIndex,originalValue);if(!didBegin)return false;this.editingCell={rowIndex,colIndex};this.registerLifecycleEditorDocumentOwner();this.cellEditingRequested.emit({row,rowIndex,colIndex,field:col.field});if(this.editType==="fullRow"){const targetRowId=this.undoableRowId(row);if(targetRowId!==null){const sessionRowId=this.rowEditSessionRowId();if(sessionRowId!==null&&sessionRowId!==targetRowId){void this.finishRowEditSession("commit").then(()=>{if(this.rowEditSessionRowId()===null)void this.startRowEdit(targetRowId)})}else if(sessionRowId===null){void this.startRowEdit(targetRowId)}}}const liveRow=this.liveObjectModel?.getDisplayedRowAtIndex(rowIndex);const publishEditingStarted=()=>{if(!liveRow)return;this.publishLiveObjectChange("row",liveRow.id,"editingStarted","ui",{field:col.field,data:row})};this.lifecycleEditorStartTask=null;if(col.cellEditor!=null){const task=this.beginLifecycleEditor(rowIndex,colIndex,row,col,originalValue,startedBy,event);this.lifecycleEditorStartTask=task;void task.then(started=>{if(started)publishEditingStarted()});void task.finally(()=>{if(this.lifecycleEditorStartTask===task){this.lifecycleEditorStartTask=null}})}else{publishEditingStarted()}return true}beginEditTransaction(rowIndex,colIndex,originalValue){const next=beginEdit(this.editStore,{rowIndex,colIndex,originalValue});if(next===this.editStore)return false;this.editStore=next;const cols=this.effectiveColumns();const col=cols[colIndex];this.largeTextConfig=null;this.largeTextAnchor=null;this.largeTextAnchorEl=null;if(col?.cellEditor!=null){this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.calendarState=null;this.calendarFocusedIso=null;this.calendarAnchor=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null;this.autocompleteAnchor=null;this.textEditorEl=null;this.selectTriggerEl=null;this.autocompleteInputEl=null;this.checkboxEditorEl=null;this.textareaEditorEl=null;return true}const editorType=col?.editor??"text";if(editorType==="number"){const constraints=this.numberConstraintsFromColumn(col);const seed=typeof originalValue==="number"&&Number.isFinite(originalValue)?originalValue:null;this.numberEditorState=createNumberEditorState(seed,constraints);this.textEditorState=null;this.dateEditorState=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null}else if(editorType==="date"){const constraints=this.dateConstraintsFromColumn(col);const seed=originalValue instanceof Date||typeof originalValue==="string"?originalValue:null;this.dateEditorState=createDateEditorState(seed,constraints);const now=new Date;const today=utcDate(now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate());this.calendarState=createCalendarState(seed,today);const focusSeed=this.calendarState.selected??today;this.calendarFocusedIso=clampISOToBounds(toISO(focusSeed),coerceBound(constraints?.min??null),coerceBound(constraints?.max??null));this.calendarKbdNavigated=false;this.textEditorState=null;this.numberEditorState=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null}else if(editorType==="select"){const opts=this.selectOptionsFromColumn(col);const seed=originalValue===null||originalValue===void 0?null:originalValue;this.selectEditorState=createSelectEditorState(seed,opts);this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null}else if(editorType==="checkbox"){const seed=originalValue===true||originalValue===false?originalValue:null;this.checkboxEditorState=createCheckboxEditorState(seed);this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.selectEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null}else if(editorType==="textarea"||editorType==="largeText"){const seed=typeof originalValue==="string"?originalValue:null;this.textareaEditorState=createTextareaEditorState(seed);if(editorType==="largeText"){const config=resolveLargeTextConfig({rows:typeof col.rows==="number"?col.rows:void 0,cols:typeof col.cols==="number"?col.cols:void 0,maxLength:typeof col.maxLength==="number"?col.maxLength:void 0});this.largeTextConfig=config;if(typeof seed==="string"&&exceedsMaxLength(seed,config.maxLength)&&!this.warnedLargeTextSeed.has(col.field)){this.warnedLargeTextSeed.add(col.field);console.warn(`[SG:TEXT] field=${col.field} length>${config.maxLength}; keep`)}}else{this.largeTextConfig=null}this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.selectEditorState=null;this.checkboxEditorState=null;this.autocompleteEditorState=null}else if(editorType==="autocomplete"){const opts=this.selectOptionsFromColumn(col);const seed=originalValue===null||originalValue===void 0?null:originalValue;this.autocompleteEditorState=this.richSelect?.createAutocompleteState(seed,opts)??null;this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null}else{this.textEditorState=createTextEditorState(originalValue);this.numberEditorState=null;this.dateEditorState=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null}return true}selectOptionsFromColumn(col){if(!col)return[];const raw=col.options;if(!Array.isArray(raw))return[];return raw}numberConstraintsFromColumn(col){if(!col)return void 0;const c={};let hasAny=false;if(typeof col.min==="number"&&Number.isFinite(col.min)){c.min=col.min;hasAny=true}if(typeof col.max==="number"&&Number.isFinite(col.max)){c.max=col.max;hasAny=true}if(typeof col.step==="number"&&Number.isFinite(col.step)){c.step=col.step;hasAny=true}if(typeof col.decimals==="number"&&Number.isFinite(col.decimals)){c.decimals=col.decimals;hasAny=true}if(col.nullable===true||col.allowEmpty===true){c.nullable=true;hasAny=true}return hasAny?c:void 0}dateConstraintsFromColumn(col){if(!col)return void 0;const c={};let hasAny=false;if(col.min instanceof Date||typeof col.min==="string"){c.min=col.min;hasAny=true}if(col.max instanceof Date||typeof col.max==="string"){c.max=col.max;hasAny=true}if(col.nullable===true||col.allowEmpty===true){c.nullable=true;hasAny=true}if(col.storeAs==="iso"||col.storeAs==="date"){c.storeAs=col.storeAs;hasAny=true}return hasAny?c:void 0}cancelEditTransaction(){const cancelled=cancelEdit(this.editStore);if(cancelled===this.editStore)return;this.unregisterLifecycleEditorDocumentOwner();this.editStore=clearEdit(cancelled);if(this.formulaSuggest!==null&&this.formulaSuggest.target==="cell")this.formulaSuggest=null;this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.calendarState=null;this.calendarFocusedIso=null;this.calendarAnchor=null;this.autocompleteAnchor=null;this.largeTextConfig=null;this.largeTextAnchor=null;this.largeTextAnchorEl=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null;this.textEditorEl=null;this.selectTriggerEl=null;this.autocompleteInputEl=null;this.checkboxEditorEl=null;this.textareaEditorEl=null}sourceIndexForDisplayRow(row,sourceRows){let cache=this.sourceRowIndexCache;if(cache===null||cache.rows!==sourceRows){const byObject=new WeakMap;for(let index3=0;index3<sourceRows.length;index3+=1){const candidate=sourceRows[index3];if(candidate===null||typeof candidate!=="object")continue;byObject.set(candidate,byObject.has(candidate)?-1:index3)}cache={rows:sourceRows,byObject};this.sourceRowIndexCache=cache}const index2=cache.byObject.get(row);return index2!==void 0&&index2>=0&&sourceRows[index2]===row?index2:null}editRowIdentity(row){if(typeof this.getRowId==="function"){const id2=this.getRowId(row);if(typeof id2==="string"&&id2.length>0)return id2;if(typeof id2==="number"&&Number.isFinite(id2))return id2;throw new Error("getRowId returned an invalid edit identity")}const id=row["id"];if(typeof id==="string"&&id.length>0)return id;if(typeof id==="number"&&Number.isFinite(id))return id;return null}resolveCellEditTarget(displayRowIndex,colIndex){const col=this.effectiveColumns()[colIndex];const displayRow=this.getDisplayRows()[displayRowIndex];if(col===void 0||col.editable!==true||typeof col.valueGetter==="function"||typeof col.valueGetter==="string"||typeof col.formula==="string"||displayRow===void 0||displayRow===null||typeof displayRow!=="object"||this.isSentinelDisplayRow(displayRow)){return null}const proto=Object.getPrototypeOf(displayRow);if(proto!==Object.prototype&&proto!==null)return null;if(!this.passesEditPolicy(displayRowIndex,col,displayRow)){return null}const sourceRows=this.rowData??[];const sourceIndex=this.sourceIndexForDisplayRow(displayRow,sourceRows);return{displayRowIndex,colIndex,col,displayRow,sourceRows,sourceIndex,sourceRow:sourceIndex===null?null:sourceRows[sourceIndex]}}prepareGridCellEdit(displayRowIndex,colIndex,rawDraft,expectedOriginal,checkOriginal){const target=this.resolveCellEditTarget(displayRowIndex,colIndex);if(target===null){return{kind:"rejected",reason:"invalid-target",action:"keep",target:null,result:null}}const previousRow=target.sourceRow??target.displayRow;const currentValue=readOwnFieldPath(previousRow,target.col.field);if(checkOriginal&&!structuralEqual(currentValue,expectedOriginal)){return{kind:"rejected",reason:"stale-target",action:"keep",target,result:null}}if(target.sourceRow===null&&typeof target.col.valueSetter==="function"){return{kind:"rejected",reason:"unbacked-value-setter",action:"keep",target,result:null}}const parser=typeof target.col.valueParser==="function"&&typeof rawDraft==="string"?(draft,oldValue,row)=>target.col.valueParser({value:draft,oldValue,field:target.col.field,row,colDef:target.col,context:this.context,api:this.host}):void 0;const setter=typeof target.col.valueSetter==="function"?(candidate,value,oldValue)=>target.col.valueSetter({newValue:value,oldValue,field:target.col.field,data:candidate,colDef:target.col,context:this.context,api:this.host,rowIndex:target.displayRowIndex,sourceRowIndex:target.sourceIndex??void 0,colId:target.col.colId??target.col.field}):void 0;const result=planProspectiveEdit({previousRow,field:target.col.field,rawDraft,parse:parser,set:setter,identity:row=>this.editRowIdentity(row),validate:(value,candidate)=>evaluateValidation(this.validationRules,{field:target.col.field,value,data:candidate}),invalidMode:this.invalidEditMode});if(result.kind==="rejected"){return{kind:"rejected",reason:result.reason,action:result.action,target,result}}return result.kind==="accepted"?{kind:"accepted",target,result}:{kind:"unchanged",target,result}}cellEditTargetStillCurrent(target){if(target.sourceIndex!==null){return this.rowData===target.sourceRows&&target.sourceRows[target.sourceIndex]===target.sourceRow}return this.getDisplayRows()[target.displayRowIndex]===target.displayRow}finalizeCommittedEditor(previous){if(this.editStore!==previous)return false;const committed=commitEdit(previous);if(committed===previous)return false;this.editingCell=null;this.unregisterLifecycleEditorDocumentOwner();this.editStore=clearEdit(committed);if(this.formulaSuggest!==null&&this.formulaSuggest.target==="cell")this.formulaSuggest=null;this.textEditorState=null;this.numberEditorState=null;this.dateEditorState=null;this.calendarState=null;this.calendarFocusedIso=null;this.calendarAnchor=null;this.autocompleteAnchor=null;this.largeTextConfig=null;this.largeTextAnchor=null;this.largeTextAnchorEl=null;this.selectEditorState=null;this.checkboxEditorState=null;this.textareaEditorState=null;this.autocompleteEditorState=null;this.textEditorEl=null;this.selectTriggerEl=null;this.autocompleteInputEl=null;this.checkboxEditorEl=null;this.textareaEditorEl=null;return true}reportRejectedCellEdit(prepared,surface){const target=prepared.target;const validation=prepared.result?.validation;if(target!==null&&validation!==void 0&&!validation.valid){this.cellValidationFailed.emit({rowIndex:target.displayRowIndex,field:target.col.field,value:prepared.result?.value,message:validation.message??"Invalid value"});if(prepared.action==="revert"&&surface==="editor"){this.cellEditingCancelled.emit({rowIndex:target.displayRowIndex,colIndex:target.colIndex})}}if((prepared.reason==="identity-changed"||prepared.reason==="identity-threw")&&!this.warnedIdentityEdit){this.warnedIdentityEdit=true;console.warn("[SG:EDIT] row identity changes are rejected so undo and collaboration remain addressable.")}if(prepared.reason==="unbacked-value-setter"&&!this.warnedUnbackedValueSetter){this.warnedUnbackedValueSetter=true;console.warn("[SG:EDIT] valueSetter requires a client rowData-backed display row; edit rejected.")}if(prepared.reason==="setter-did-not-apply"){console.warn("[SG:EDIT] valueSetter must synchronously apply newValue to its field; edit rejected.")}}commitPreparedCellEdit(surface,displayRowIndex,colIndex,rawDraft,expectedOriginal,checkOriginal,editorStore){if(this.editCommitInProgress)return false;this.editCommitInProgress=true;try{const prepared=this.prepareGridCellEdit(displayRowIndex,colIndex,rawDraft,expectedOriginal,checkOriginal);if(prepared.kind==="rejected"){if(prepared.action==="revert"&&surface==="editor"){this.editingCell=null;this.cancelEditTransaction()}this.reportRejectedCellEdit(prepared,surface);if(prepared.action==="revert"&&surface==="formula-bar"){this.formulaBarDraft=null;this.formulaSuggest=null}return false}if(!this.cellEditTargetStillCurrent(prepared.target))return false;if(this.batchLive()){const{target}=prepared;const rowId2=this.undoableRowId(target.displayRow);if(!this.proNewWorkAllowed("grid.batch-editing","stageBatchCell")||rowId2===null||target.sourceRow===null||this.rowByStableId(rowId2)!==target.sourceRow||typeof target.col.valueSetter==="function")return false;const staged=this.batchEdit.guardedStageBatchCell(this.batchCommitState,{row:target.displayRowIndex,col:target.colIndex,rowId:rowId2,colId:target.col.field,value:prepared.result.value,oldValue:readOwnFieldPath(target.sourceRow,target.col.field)});if(staged.staged.kind!=="staged")return false;if(surface==="editor"&&(editorStore===null||!this.finalizeCommittedEditor(editorStore)))return false;if(surface==="formula-bar"){this.formulaBarDraft=null;this.formulaSuggest=null}this.batchCommitState=staged.state;this.proUiChunkTick++;this.viewportEl?.focus({preventScroll:true});return true}if(surface==="editor"){if(editorStore===null||!this.finalizeCommittedEditor(editorStore))return false}else{this.formulaBarDraft=null;this.formulaSuggest=null}if(surface==="editor"&&this.editType==="fullRow"){const sessionRowId=this.rowEditSessionRowId();const targetRow=prepared.target.displayRow;if(sessionRowId!==null&&this.undoableRowId(targetRow)===sessionRowId){const staged=stageRowCell(this.rowEditState,prepared.target.col.field,prepared.result.value,expectedOriginal);this.rowEditState=staged.state;this.viewportEl?.focus({preventScroll:true});return staged.staged.kind==="staged"}}const validation=prepared.result.validation;if(!validation.valid){this.cellValidationFailed.emit({rowIndex:prepared.target.displayRowIndex,field:prepared.target.col.field,value:prepared.result.value,message:validation.message??"Invalid value"})}let txId;let canonicalCellEventEmitted=false;let liveValueChanges=[];let committedRow=prepared.target.displayRow;if(prepared.kind==="accepted"&&prepared.target.sourceIndex!==null){const sourceIndex=prepared.target.sourceIndex;const sourceRow=prepared.target.sourceRow;const updated=prepared.result.nextRow;const nextRows=prepared.target.sourceRows.slice();nextRows[sourceIndex]=updated;txId=allocateTxId();const cache=this.sourceRowIndexCache;if(cache!==null&&cache.rows===prepared.target.sourceRows){cache.byObject.set(updated,sourceIndex);cache.rows=nextRows}this.incrementalRowDataAssignment=nextRows;try{this.rowData=nextRows}finally{this.incrementalRowDataAssignment=null}const previous=deepCloneRows([sourceRow])[0];const entry={row:updated,previous,index:sourceIndex};this.fireRowDataChanged({added:[],updated:[entry],removed:[],rejected:[],txId,source:"local",origin:surface},{publishLiveObjects:false});const changes=this.emitCellValueChanges([entry],"local",surface,txId,{displayRowIndex:prepared.target.displayRowIndex});canonicalCellEventEmitted=changes.length>0;liveValueChanges=changes;if(this.undoableRowId(previous)!==null){const forward=deepCloneRows([updated])[0];this.undoRedoStack.record({update:[forward]},{update:[previous]},"cell-edit")}committedRow=updated;this.applyFormulaEdit(prepared.target.displayRowIndex,prepared.target.colIndex,prepared.result.value,updated,sourceRow)}else if(prepared.kind==="accepted"){this.applyFormulaEdit(prepared.target.displayRowIndex,prepared.target.colIndex,prepared.result.value,prepared.target.displayRow)}const rowId=prepared.target.sourceIndex===null?this.extractRowId(committedRow,prepared.target.displayRowIndex):this.collabRowId(committedRow,prepared.target.sourceIndex);this.cellEditingCommitted.emit({rowIndex:prepared.target.displayRowIndex,sourceRowIndex:prepared.target.sourceIndex??void 0,colIndex:prepared.target.colIndex,rowId,field:prepared.target.col.field,originalValue:expectedOriginal,draftValue:prepared.result.value,dataWritten:canonicalCellEventEmitted,changed:prepared.kind==="accepted",txId,surface});this.publishLiveObjectChanges(liveValueChanges.map(change=>["row",change.rowId,"valueChanged","ui",{txId,field:change.field,before:change.oldValue,after:change.newValue,data:change.data}]));return true}finally{this.editCommitInProgress=false}}commitEditTransaction(){const previous=this.editStore;if(this.editCommitInProgress||previous.active===null||previous.active.phase!=="pending")return false;if(this.numberEditorState!==null&&this.numberEditorState.constraintViolation!==null||this.dateEditorState!==null&&this.dateEditorState.constraintViolation!==null){return false}const tx=previous.active;let draftToCommit;if(this.numberEditorState!==null){draftToCommit=this.numberEditorState.parsedValue}else if(this.dateEditorState!==null){const col=this.effectiveColumns()[tx.colIndex];const parsed=this.dateEditorState.parsedDate;if(parsed===null){draftToCommit=null}else if((col?.storeAs??"date")==="iso"){const year=String(parsed.getUTCFullYear()).padStart(4,"0");const month=String(parsed.getUTCMonth()+1).padStart(2,"0");const day=String(parsed.getUTCDate()).padStart(2,"0");draftToCommit=`${year}-${month}-${day}`}else{draftToCommit=parsed}}else if(this.selectEditorState!==null){draftToCommit=this.selectEditorState.value}else if(this.checkboxEditorState!==null){draftToCommit=this.checkboxEditorState.value}else if(this.textareaEditorState!==null){draftToCommit=this.textareaEditorState.value}else if(this.autocompleteEditorState!==null){draftToCommit=this.autocompleteEditorState.value}else{draftToCommit=tx.draftValue}return this.commitPreparedCellEdit("editor",tx.rowIndex,tx.colIndex,draftToCommit,tx.originalValue,true,previous)}applyFormulaEdit(rowIndex,colIndex,draftValue,row,previousRow){if(this.formulaSheet===null||this.formulas!==true)return;const col=this.effectiveColumns()[colIndex];if(!col||row===null||typeof row!=="object")return;if(previousRow!==void 0&&previousRow!==row){this.formulaSheet.replaceRowIdentity(previousRow,row)}if(this.proGate().frozen("grid.formulas")){this.formulaFreeze.holdEdit(row,col.field);this.formulaVersion++;this.focusActiveLifecycleRenderer();return}if(this.formulaDualEngine!==null&&this.proGate().lost("grid.wasm-acceleration")){this.retireLostFormulaAcceleration();if(this.formulaSheet===null||this.formulaSheetSeeding){this.formulaVersion++;this.focusActiveLifecycleRenderer();return}}const update=this.formulaSheet.updateCell(col.field,row,draftValue);this.formulaVersion++;this.recordWorkbookOpsCommit(col.field,row,draftValue);if(update.isFormula){const formula=String(draftValue);const value=this.publicNumericValue(update.value);this.formulaEvaluated.emit({rowIndex,colIndex,field:col.field,formula,value});const error=this.formulaCore?.formulaErrorInfo(value)??null;if(error!==null){this.formulaError.emit({rowIndex,colIndex,field:col.field,formula,type:error.type,description:error.description})}}this.focusActiveLifecycleRenderer()}publicNumericValue(value){return typeof value==="number"||typeof value==="bigint"?toPublicNumeric(value):value}activeCellContext(){if(this.activeCell===null)return null;const{rowIndex,colIndex}=this.activeCell;const col=this.effectiveColumns()[colIndex];const row=this.getDisplayRows()[rowIndex];if(!col||row===void 0||row===null||typeof row!=="object"||this.isSentinelDisplayRow(row))return null;const editable=col.editable===true&&typeof col.valueGetter!=="function"&&typeof col.valueGetter!=="string"&&typeof col.formula!=="string"&&this.passesEditPolicy(rowIndex,col,row);return{row,col,rowIndex,colIndex,editable}}activeCellRawText(){const ctx=this.activeCellContext();if(ctx===null)return"";const raw=readOwnFieldPath(ctx.row,ctx.col.field);if(this.readPolicyConfigured()&&!this.isCellReadable(this.rawFieldValue(ctx.row,ctx.rowIndex,ctx.col),ctx.row,ctx.rowIndex,ctx.col))return this.maskedCellValue;return raw===null||raw===void 0?"":String(raw)}activeCellRefLabel(){const ctx=this.activeCellContext();if(ctx===null)return"";return`${ctx.col.headerName??ctx.col.field} · ${ctx.rowIndex+1}`}commitFormulaBar(){if(this.formulaBarDraft===null)return;const ctx=this.activeCellContext();const draft=this.formulaBarDraft;if(ctx===null||!ctx.editable){this.formulaBarDraft=null;this.formulaSuggest=null;return}const originalValue=readOwnFieldPath(ctx.row,ctx.col.field);this.commitPreparedCellEdit("formula-bar",ctx.rowIndex,ctx.colIndex,draft,originalValue,false,null)}formulaSuggest=null;formulaSuggestAnchor=null;updateFormulaSuggest(target,text,caret){const names=this.formulaSheet?.functionNames()??[];const core=this.formulaCore;const state=names.length>0&&core!==null?core.suggestFunctions(text,caret,names):null;this.formulaSuggest=state===null?null:{target,...state,activeIndex:0}}handleSuggestKeyIntercept(event,apply){const open=this.formulaSuggest;if(open===null)return false;if(event.key==="ArrowDown"||event.key==="ArrowUp"){event.preventDefault();const delta=event.key==="ArrowDown"?1:-1;const count=open.suggestions.length;this.formulaSuggest={...open,activeIndex:(open.activeIndex+delta+count)%count};return true}if(event.key==="Enter"||event.key==="Tab"){event.preventDefault();apply(open.suggestions[open.activeIndex]);return true}if(event.key==="Escape"){event.preventDefault();this.formulaSuggest=null;return true}return false}applyFormulaSuggestion(input,name){const suggest=this.formulaSuggest;const core=this.formulaCore;if(suggest===null||core===null)return;const caret=input.selectionStart??input.value.length;const out=core.applySuggestion(input.value,caret,suggest,name);this.formulaBarDraft=out.text;this.formulaSuggest=null;input.value=out.text;input.setSelectionRange(out.caret,out.caret);input.focus()}applyCellSuggestion(name){const input=this.textEditorEl;const suggest=this.formulaSuggest;const core=this.formulaCore;if(input===null||suggest===null||core===null)return;const caret=input.selectionStart??input.value.length;const out=core.applySuggestion(input.value,caret,suggest,name);if(this.textEditorState!==null){let next=applyInputValue$1(this.textEditorState,out.text);next=applySelectionChange$2(next,out.caret,out.caret);if(next!==this.textEditorState)this.textEditorState=next}if(this.editStore.active!==null){const nextStore=setDraft(this.editStore,out.text);if(nextStore!==this.editStore)this.editStore=nextStore}this.formulaSuggest=null;input.value=out.text;input.setSelectionRange(out.caret,out.caret);input.focus()}syncFormulaSuggestAnchor(){if(typeof window==="undefined")return;if(this.formulaSuggest===null||this.formulaSuggest.target!=="cell"||this.textEditorEl===null||this.host===void 0){if(this.formulaSuggestAnchor!==null)this.formulaSuggestAnchor=null;return}const rect=this.textEditorEl.getBoundingClientRect();const hostRect=this.host.getBoundingClientRect();const next={x:Math.round(rect.left-hostRect.left),y:Math.round(rect.bottom+2-hostRect.top),width:Math.round(rect.width)};const cur=this.formulaSuggestAnchor;if(cur===null||cur.x!==next.x||cur.y!==next.y||cur.width!==next.width){this.formulaSuggestAnchor=next}}renderFormulaBar(){if(this.formulaBar!==true||this.formulas!==true||!this.usingColumnDefsApi())return null;if(!this.proAllowed("grid.formulas","formulaBar"))return null;if(!this.proModuleAvailable("grid.formulas","formulaBar","formula-core"))return null;const ctx=this.activeCellContext();const readable=ctx!==null&&(!this.readPolicyConfigured()||this.isCellReadable(this.rawFieldValue(ctx.row,ctx.rowIndex,ctx.col),ctx.row,ctx.rowIndex,ctx.col));const value=readable?this.formulaBarDraft??this.activeCellRawText():this.maskedCellValue;const disabled=ctx===null||!ctx.editable||this.effectiveLoading;const suggest=readable&&this.formulaSuggest!==null&&this.formulaSuggest.target==="bar"?this.formulaSuggest:null;return index.h("div",{class:"sy-grid__formula-bar",role:"group","aria-label":"Formula bar"},index.h("span",{class:"sy-grid__formula-bar-ref","data-formula-ref":true},this.activeCellRefLabel()||"—"),index.h("span",{class:"sy-grid__formula-bar-fx","aria-hidden":"true"},"fx"),index.h("div",{class:"sy-grid__formula-bar-input-wrap"},index.h("input",{type:"text",class:"sy-grid__formula-bar-input","data-formula-bar-input":true,value,disabled,role:"combobox","aria-label":"Active cell formula or value","aria-autocomplete":"list","aria-expanded":suggest!==null?"true":"false","aria-controls":"sy-grid-formula-suggest","aria-activedescendant":suggest!==null?`sy-grid-formula-suggest-${suggest.activeIndex}`:void 0,onInput:event=>{const input=event.target;this.formulaBarDraft=input.value;this.updateFormulaSuggest("bar",input.value,input.selectionStart??input.value.length)},onKeyDown:event=>{const input=event.target;if(this.handleSuggestKeyIntercept(event,name=>this.applyFormulaSuggestion(input,name)))return;if(event.key==="Enter"){event.preventDefault();this.commitFormulaBar()}else if(event.key==="Escape"){event.preventDefault();this.formulaBarDraft=null;input.blur()}},onBlur:()=>{this.formulaBarDraft=null;this.formulaSuggest=null}}),suggest!==null&&index.h("ul",{class:"sy-grid__formula-suggest",id:"sy-grid-formula-suggest",role:"listbox","aria-label":"Formula functions"},suggest.suggestions.map((name,i)=>index.h("li",{key:name,id:`sy-grid-formula-suggest-${i}`,class:{"sy-grid__formula-suggest-option":true,"sy-grid__formula-suggest-option--active":i===suggest.activeIndex},role:"option","aria-selected":i===suggest.activeIndex?"true":"false",onMouseDown:event=>{event.preventDefault();const input=event.currentTarget.closest(".sy-grid__formula-bar-input-wrap")?.querySelector("input");if(input)this.applyFormulaSuggestion(input,name)}},index.h("span",{class:"sy-grid__formula-suggest-name"},name),index.h("span",{class:"sy-grid__formula-suggest-paren","aria-hidden":"true"},"(…)"))))))}renderCellFormulaSuggest(){const suggest=this.formulaSuggest;const anchor=this.formulaSuggestAnchor;if(suggest===null||suggest.target!=="cell"||anchor===null)return null;return index.h("ul",{class:"sy-grid__formula-suggest sy-grid__formula-suggest--cell",id:"sy-grid-formula-suggest",role:"listbox","aria-label":"Formula functions",style:{position:"absolute",left:`${anchor.x}px`,top:`${anchor.y}px`,minWidth:`${Math.max(180,anchor.width)}px`,zIndex:"40"}},suggest.suggestions.map((name,i)=>index.h("li",{key:name,id:`sy-grid-formula-suggest-${i}`,class:{"sy-grid__formula-suggest-option":true,"sy-grid__formula-suggest-option--active":i===suggest.activeIndex},role:"option","aria-selected":i===suggest.activeIndex?"true":"false",onMouseDown:event=>{event.preventDefault();this.applyCellSuggestion(name)}},index.h("span",{class:"sy-grid__formula-suggest-name"},name),index.h("span",{class:"sy-grid__formula-suggest-paren","aria-hidden":"true"},"(…)"))))}resetVirtualScrollPosition(){this.scrollTop=0;if(this.viewportEl){this.viewportEl.scrollTop=0}}pivotPanelVisible(){if(this.pivotPanel===true||this.pivotPanelShow==="always")return this.proAllowed("grid.pivot","pivotPanel");return this.pivotPanelShow==="onlyWhenPivoting"&&this.pivotMode===true&&this.proAllowed("grid.pivot","pivotPanelShow")}groupPanelActive(){return this.groupPanel===true&&this.proAllowed("grid.row-grouping","groupPanel")}async setPivotColumns(columns){return this.proMethod("setPivotColumns",{load:()=>this.loadGroupPivotChunk(),exec:chunk=>chunk,publish:chunk=>chunk.applyPivotPanelAxis(this,"pivotColumns",columns)})}async setValueColumns(columns){return this.proMethod("setValueColumns",{load:()=>this.loadGroupPivotChunk(),exec:chunk=>chunk,publish:chunk=>chunk.applyPivotPanelAxis(this,"valueColumns",columns)})}maybeRestorePivotPanelFocus(){if(this.pivotPanelFocusField!==null)this.groupPivotChunkModule?.restorePivotPanelFocus(this)}renderPivotPanel(){if(!this.pivotPanelVisible()||!this.usingColumnDefsApi())return null;const chunk=this.ensureGroupPivotChunkArmed();return chunk===null?null:chunk.renderPivotPanel(this,index.h)}renderGroupPanel(){if(this.groupPanel!==true||!this.usingColumnDefsApi())return null;if(!this.groupPanelActive())return null;const chunk=this.groupPivotChunkModule;if(chunk===null)return null;return chunk.renderGroupPanel(this,index.h,{dropActive:this.columnDragOverGroupPanel,ref:el=>{this.groupPanelEl=el},clear:()=>this.clearGroupByFromPanel()})}renderHeader(){const cols=this.effectiveColumns();if(cols.length===0)return null;const renderCheckboxCol=this.shouldRenderCheckboxColumn();const columnOffset=renderCheckboxCol?1:0;const reorderActive=this.columnReorderController.getActive();const draggedColId=reorderActive?.draggedColId??null;const checkboxOffset=renderCheckboxCol?SELECTION_CHECKBOX_COLUMN.width:0;const pinCtx=this.pinnedOffsetsContext(cols,checkboxOffset);const lastPinnedLeft=pinCtx?.lastLeft;const firstPinnedRight=pinCtx?.firstRight;const colWindow=this.columnWindowContext(cols,checkboxOffset);return index.h("div",{...headerRowGroupAttrs(),class:"sy-grid__header-rowgroup"},index.h("div",{class:"sy-grid__header-clip"},this.renderHeaderGroupRows(cols,pinCtx,colWindow,renderCheckboxCol),index.h("div",{class:"sy-grid__header",...headerRowAttrs(this.headerGroupDepth())},renderCheckboxCol&&this.renderHeaderCheckboxCell(pinCtx?.left!=null),cols.map((col,colIndex)=>{if(colWindow&&colWindow.culled(colIndex))return null;const isSortable=col.sortable!==false&&typeof col.field==="string"&&col.field!=="";const sortState=col.field?this.sortController.getModelIndicatorState(col.field,this.activeSortModel):{direction:null,isActive:false,sortIndex:null};const isActive=sortState.isActive;const direction=sortState.direction;const headerLabel=col.headerName??col.field;const sortAriaLabel=isSortable?this.sortController.ariaLabel(sortState.direction,headerLabel??"",sortState.sortIndex,this.activeSortModel.length):headerLabel??"";const headerAttrs=columnHeaderAttrs({colIndex:colIndex+columnOffset,sortDirection:direction,label:isSortable?sortAriaLabel:headerLabel??""});const lifecycleFilter=col.field?this.lifecycleFilterDeclaration(col):null;const filterKind=col.field&&lifecycleFilter===null?this.offeredFilterUiKind(col.filter):null;const hasFilterUi=filterKind!==null||lifecycleFilter!==null;const lifecycleColId=this.componentFilterColumnId(col);const isFilterActive=lifecycleFilter!==null?this.componentFilterIsActive(lifecycleColId):hasFilterUi&&!!(col.field&&this.activeFilters[col.field]);const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"4","header");const hideHeaderControls=this.shouldHideHeaderControls(col);const hasVisibleFilterUi=hasFilterUi&&!hideHeaderControls;const isDropdownOpen=hasVisibleFilterUi&&!!(col.field&&this.openFilterField===col.field);const isFilterButtonDisabled=this.effectiveLoading&&!isDropdownOpen;const showResizeHandle=this.resizableColumns===true&&col.resizable!==false;const enableAutoSizeDblClick=this.resizableColumns===true&&col.resizable!==false&&this.autoSizeOnDoubleClick!==false;const isReorderable=this.reorderableColumns===true&&col.reorderable!==false;const isHeaderDraggable=isReorderable||this.groupPanelActive();const isBeingDragged=draggedColId===col.field;const sortTooltip=isSortable?direction==="asc"?this.resolvedMessages["sort.descendingTooltip"]:direction==="desc"?this.resolvedMessages["sort.removeTooltip"]:this.resolvedMessages["sort.ascendingTooltip"]:void 0;const headerCellNode=index.h("div",{key:col.field,class:{"sy-grid__header-cell":true,"sy-grid__header-cell--sortable":isSortable,"sy-grid__header-cell--sorted":isActive,"sy-grid__header-cell--filtered":isFilterActive,"sy-grid__header-cell--controls-hidden":hideHeaderControls,"sy-grid__header-cell--locked":this.effectiveLoading,"sy-grid__header-cell--reorderable":isReorderable,"sy-grid__header-cell--dragging":isBeingDragged,"sy-grid__header-cell--auto-sizable":enableAutoSizeDblClick,"sy-grid__header-cell--pinned-left":pin.pinnedLeft,"sy-grid__header-cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__header-cell--pinned-right":pin.pinnedRight,"sy-grid__header-cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight},...headerAttrs,"data-field":col.field,"data-sort-index":sortState.sortIndex!==null?String(sortState.sortIndex):void 0,tabindex:isSortable&&!this.effectiveLoading?0:-1,"aria-disabled":this.effectiveLoading?"true":void 0,"aria-describedby":this.cellTooltip!==null&&this.cellTooltip.rowIndex===-1&&this.cellTooltip.field===col.field?SY_GRID_TOOLTIP_ID:void 0,title:sortTooltip,style:Object.keys(cellStyle).length>0?cellStyle:void 0,onClick:isSortable?event=>this.handleHeaderClick(col,event):void 0,onDblClick:enableAutoSizeDblClick&&!this.effectiveLoading?event=>{event.stopPropagation();void this.autoSizeColumn(col.field)}:void 0,onKeyDown:isSortable?event=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();this.handleHeaderClick(col,event)}}:void 0,onPointerDown:isHeaderDraggable&&!this.effectiveLoading?event=>{this.handleColumnReorderPointerDown(event,col.field)}:void 0,onMouseEnter:event=>this.handleHeaderTooltipEnter(event,col),onMouseLeave:()=>this.handleHeaderTooltipLeave(),onFocus:event=>this.handleHeaderTooltipEnter(event,col),onBlur:()=>this.handleHeaderTooltipLeave()},index.h("span",{class:"sy-grid__header-label"},col.headerName??col.field),this.renderColumnMenuButton(col),isSortable&&!hideHeaderControls&&index.h("span",{class:{"sy-grid__sort-indicator":true,"sy-grid__sort-indicator--active":isActive},"aria-hidden":"true"},isActive&&direction==="asc"&&index.h("svg",{class:"sy-grid__sort-icon",viewBox:"0 0 10 10","aria-hidden":"true"},index.h("path",{d:"M5 2 L9 8 L1 8 Z"})),isActive&&direction==="desc"&&index.h("svg",{class:"sy-grid__sort-icon",viewBox:"0 0 10 10","aria-hidden":"true"},index.h("path",{d:"M5 8 L9 2 L1 2 Z"})),isActive&&sortState.sortIndex!==null&&index.h("span",{class:"sy-grid__sort-order"},sortState.sortIndex),!isActive&&index.h("svg",{class:"sy-grid__sort-icon sy-grid__sort-icon--inactive",viewBox:"0 0 10 14","aria-hidden":"true"},index.h("path",{d:"M5 1 L8 5 L2 5 Z"}),index.h("path",{d:"M5 13 L8 9 L2 9 Z"}))),hasVisibleFilterUi&&index.h("button",{type:"button",class:{"sy-grid__filter-icon":true,"sy-grid__filter-icon--active":isFilterActive,"sy-grid__filter-icon--open":isDropdownOpen},"aria-label":t(this.resolvedMessages,"header.filterLabel",{column:col.headerName??col.field}),"aria-haspopup":"dialog","aria-expanded":isDropdownOpen?"true":"false","aria-controls":isDropdownOpen?"sy-grid-filter-dropdown":void 0,"data-active":isFilterActive?"true":"false",disabled:isFilterButtonDisabled,onClick:event=>this.handleFilterIconClick(col,event),onKeyDown:event=>{if(event.key==="Enter"||event.key===" "){event.preventDefault();event.stopPropagation();this.handleFilterIconClick(col,event)}}},index.h("svg",{class:"sy-grid__filter-icon-svg",width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true"},index.h("path",{d:"M2 3h12l-4.5 5.5V13l-3 1.5V8.5L2 3z"}))),showResizeHandle&&index.h("span",{class:"sy-grid__col-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":`Resize ${col.headerName??col.field}`,"data-field":col.field,onPointerDown:event=>this.handleColumnResizePointerDown(event,col.field),onPointerEnter:event=>this.showColumnResizeGuide(col.field,event.currentTarget),onPointerLeave:()=>this.hideColumnResizeGuide(col.field),onPointerMove:event=>this.handleColumnResizePointerMove(event),onPointerUp:event=>this.handleColumnResizePointerUp(event),onPointerCancel:event=>this.handleColumnResizePointerCancel(event),onClick:event=>event.stopPropagation()}));return this.withColumnSpacers(headerCellNode,colIndex,colWindow,`h-${col.field}`)})),this.headerFilterRow&&this.renderHeaderFilterRow(cols,renderCheckboxCol,pinCtx,lastPinnedLeft,firstPinnedRight,colWindow)))}renderHeaderGroupRows(cols,pinCtx,colWindow,renderCheckboxCol){const depth=this.headerGroupDepth();if(depth===0)return null;const defs=this.columnDefsSource();let leftCount=0;while(leftCount<cols.length&&this.pinSideOf(cols[leftCount])==="left")leftCount++;let rightCount=0;while(rightCount<cols.length-leftCount&&this.pinSideOf(cols[cols.length-1-rightCount])==="right"){rightCount++}const leftFields=cols.slice(0,leftCount).map(c=>c.field);const rightFields=rightCount>0?cols.slice(cols.length-rightCount).map(c=>c.field):[];const renderedMiddleFields=[];for(let i=leftCount;i<cols.length-rightCount;i++){if(!colWindow||!colWindow.culled(i))renderedMiddleFields.push(cols[i].field)}const leftRows=computeHeaderGroupRows(defs,leftFields,this.collapsedGroups);const midRows=computeHeaderGroupRows(defs,renderedMiddleFields,this.collapsedGroups);const rightRows=computeHeaderGroupRows(defs,rightFields,this.collapsedGroups);const segmentWidth=seg=>{let width=0;const byField=new Map(cols.map(c=>[c.field,c]));for(const leaf of seg.leaves){const col=byField.get(leaf);width+=(col?this.pinnedWidthOf(col):null)??DEFAULT_PINNED_COLUMN_WIDTH}return width};const segCell=(seg,side,level,index$1)=>{const width=segmentWidth(seg);const style={width:`${width}px`,flex:`0 0 ${width}px`};if(side==="left"&&pinCtx?.left){style.position="sticky";style.left=`${pinCtx.left.get(seg.leaves[0])??0}px`;style.zIndex="4"}else if(side==="right"&&pinCtx?.right){const anchor=seg.leaves[seg.leaves.length-1];style.position="sticky";style.right=`${(pinCtx.right.get(anchor)??0)+this.bodyScrollbarWidth}px`;style.zIndex="4"}const isFiller=seg.label===null;return index.h("div",{key:`${level}-${side??"m"}-${index$1}-${seg.groupId??"filler"}`,class:{"sy-grid__header-group-cell":true,"sy-grid__header-group-cell--filler":isFiller,"sy-grid__header-group-cell--pinned":side!==null},role:isFiller?void 0:"columnheader","aria-colspan":isFiller?void 0:seg.leaves.length,"aria-hidden":isFiller?"true":void 0,"data-group-id":seg.groupId,style},seg.label!==null&&index.h("span",{class:"sy-grid__header-group-label"},seg.label),seg.collapsible===true&&seg.groupId!==void 0&&index.h("button",{type:"button",class:"sy-grid__header-group-toggle","aria-expanded":seg.open===true?"true":"false","aria-label":`${seg.label??""}`.trim(),disabled:this.effectiveLoading,onClick:event=>{event.stopPropagation();void this.applyColumnGroupOpened(seg.groupId,!(seg.open===true),"ui")}},seg.open===true?"⏵":"⏷"))};const rows=[];for(let level=0;level<depth;level++){rows.push(index.h("div",{class:"sy-grid__header-group-row",role:"row","aria-rowindex":level+1,key:`grouprow-${level}`},renderCheckboxCol&&index.h("div",{class:"sy-grid__header-group-cell sy-grid__header-group-cell--filler","aria-hidden":"true",style:pinCtx?.left?{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,flex:`0 0 ${SELECTION_CHECKBOX_COLUMN.width}px`,position:"sticky",left:"0px",zIndex:"4"}:{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,flex:`0 0 ${SELECTION_CHECKBOX_COLUMN.width}px`}}),(leftRows[level]??[]).map((seg,i)=>segCell(seg,"left",level,i)),colWindow&&colWindow.leadingPx>0&&this.renderColumnSpacer(colWindow.leadingPx,`g${level}-lead`),(midRows[level]??[]).map((seg,i)=>segCell(seg,null,level,i)),colWindow&&colWindow.trailingPx>0&&this.renderColumnSpacer(colWindow.trailingPx,`g${level}-trail`),(rightRows[level]??[]).map((seg,i)=>segCell(seg,"right",level,i))))}return rows}columnWindowContext(cols,checkboxOffset){const ctx=this.columnWindowContextInner(cols,checkboxOffset);this.columnWindowLive=ctx!==null;return ctx}columnWindowEnabled(leafCount){if(this.virtualizeColumns===true)return true;if(this.virtualizeColumns===false)return false;return leafCount>=COLUMN_WINDOW_AUTO_THRESHOLD}columnWindowContextInner(cols,checkboxOffset){if(!this.columnWindowEnabled(cols.length))return null;let leftCount=0;while(leftCount<cols.length&&this.pinSideOf(cols[leftCount])==="left")leftCount++;let rightCount=0;while(rightCount<cols.length-leftCount&&this.pinSideOf(cols[cols.length-1-rightCount])==="right"){rightCount++}const middleCount=cols.length-leftCount-rightCount;if(middleCount===0)return null;let pinnedLeftPx=checkboxOffset;for(let i=0;i<leftCount;i++){pinnedLeftPx+=this.pinnedWidthOf(cols[i])??DEFAULT_PINNED_COLUMN_WIDTH}let pinnedRightPx=0;for(let i=0;i<rightCount;i++){pinnedRightPx+=this.pinnedWidthOf(cols[cols.length-1-i])??DEFAULT_PINNED_COLUMN_WIDTH}const widths=[];for(let i=0;i<middleCount;i++){const width=this.pinnedWidthOf(cols[leftCount+i]);if(width===null)return null;widths.push(width)}const viewportWidth=(this.viewportSize?.width??0)-pinnedLeftPx-pinnedRightPx;if(viewportWidth<=0)return null;const win=computeColumnWindow({widths,scrollLeft:this.hScrollLeft,viewportWidth});const firstRendered=leftCount+win.start;const lastRendered=leftCount+win.end-1;return{culled:absIndex=>absIndex>=leftCount&&absIndex<leftCount+middleCount&&(absIndex<firstRendered||absIndex>lastRendered),firstRendered,lastRendered,leadingPx:win.leadingPx,trailingPx:win.trailingPx}}renderColumnSpacer(px,key){return index.h("div",{key,class:"sy-grid__col-spacer","aria-hidden":"true",style:{width:`${px}px`,flex:`0 0 ${px}px`}})}withColumnSpacers(cell,absIndex,colWindow,keyPrefix){if(!colWindow)return cell;const parts=[cell];if(absIndex===colWindow.firstRendered&&colWindow.leadingPx>0){parts.unshift(this.renderColumnSpacer(colWindow.leadingPx,`${keyPrefix}-lead`))}if(absIndex===colWindow.lastRendered&&colWindow.trailingPx>0){parts.push(this.renderColumnSpacer(colWindow.trailingPx,`${keyPrefix}-trail`))}return parts.length===1?cell:parts}applyPinnedStyle(col,cellStyle,pinCtx,zIndex,surface){const none={pinnedLeft:false,pinnedRight:false};if(!pinCtx)return none;const side=this.pinSideOf(col);if(side==="left"&&pinCtx.left){cellStyle.position="sticky";cellStyle.left=`${pinCtx.left.get(col.field)??0}px`;cellStyle.zIndex=zIndex;return{pinnedLeft:true,pinnedRight:false}}if(side==="right"&&pinCtx.right){const compensation=surface==="header"?this.bodyScrollbarWidth:0;cellStyle.position="sticky";cellStyle.right=`${(pinCtx.right.get(col.field)??0)+compensation}px`;cellStyle.zIndex=zIndex;return{pinnedLeft:false,pinnedRight:true}}return none}renderConditionBuilder(){const filters=this.proUiChunk("pro-filters","grid.advanced-filter","conditionBuilder");return filters==null?null:filters.renderConditionBuilder(this.proFiltersHost())}renderHeaderFilterRow(cols,renderCheckboxCol,pinCtx,lastPinnedLeft,firstPinnedRight,colWindow=null){const locked=this.effectiveLoading;const messages=this.resolvedMessages;const checkboxSticky=pinCtx?.left!=null;return index.h("div",{class:"sy-grid__header-filter-row",role:"row"},renderCheckboxCol&&index.h("div",{class:{"sy-grid__header-filter-cell":true,"sy-grid__header-filter-cell--spacer":true,"sy-grid__header-filter-cell--pinned-left":checkboxSticky},role:"gridcell",style:checkboxSticky?{position:"sticky",left:"0px",zIndex:"4"}:void 0}),cols.map((col,colIndex)=>{if(colWindow&&colWindow.culled(colIndex))return null;const lifecycleFilter=col.field?this.lifecycleFilterDeclaration(col):null;const hasLifecycleFloating=lifecycleFilter!==null&&col.floatingFilterComponent!==void 0&&col.floatingFilterComponent!==null;const kind=col.field&&lifecycleFilter===null?this.offeredFilterUiKind(col.filter):null;const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"4","header");const active=col.field?this.activeFilters[col.field]:void 0;const ariaLabel=t(messages,"header.filterLabel",{column:col.headerName??col.field??""});let body=null;if(hasLifecycleFloating){const colId=this.componentFilterColumnId(col);body=index.h("div",{class:"sy-grid__floating-filter-host","data-col-id":colId,ref:this.componentFilterHostRef(colId,true)})}else if(kind==="text"||kind==="number"||kind==="date"){const isRange=active!==void 0&&active.kind===kind&&(active.spec.op==="between"||active.spec.op==="notBetween");if(isRange){body=index.h("button",{type:"button",class:"sy-grid__header-filter-summary",disabled:locked,onClick:event=>this.handleFilterIconClick(col,event),"aria-label":ariaLabel},this.floatingFilterSummary(active))}else{const value=active!==void 0&&active.kind===kind?this.floatingFilterValue(active):"";body=index.h("input",{class:"sy-grid__header-filter-input",type:kind==="number"?"number":kind==="date"?"date":"search",value,placeholder:kind==="number"?messages["filter.numberPlaceholder"]:kind==="date"?void 0:messages["filter.valuePlaceholder"],readOnly:locked,"aria-label":ariaLabel,onInput:e=>this.handleFloatingFilterInput(col,kind,e.target.value)})}}else if(kind==="set"||kind==="multi"){body=index.h("button",{type:"button",class:"sy-grid__header-filter-summary",disabled:locked,onClick:event=>this.handleFilterIconClick(col,event),"aria-label":ariaLabel},this.floatingFilterSummary(active))}const filterCellNode=index.h("div",{key:col.field,class:{"sy-grid__header-filter-cell":true,"sy-grid__header-filter-cell--pinned-left":pin.pinnedLeft,"sy-grid__header-filter-cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__header-filter-cell--pinned-right":pin.pinnedRight,"sy-grid__header-filter-cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight},role:"gridcell","data-field":col.field,style:Object.keys(cellStyle).length>0?cellStyle:void 0},body);return this.withColumnSpacers(filterCellNode,colIndex,colWindow,`f-${col.field}`)}))}floatingFilterValue(active){if(active.kind==="text")return active.spec.value??"";if(active.kind==="number"){const v=active.spec.value;return Array.isArray(v)?"":this.numberToInputValue(v)}if(active.kind==="date"){const v=active.spec.value;return Array.isArray(v)?"":this.dateValueToInput(v)}return""}floatingFilterSummary(active){const messages=this.resolvedMessages;if(!active)return messages["filter.headerRowOpen"];if(active.kind==="set"){const values=active.spec.values;return values===null?messages["filter.headerRowOpen"]:t(messages,"filter.headerRowSelected",{count:String(values.length)})}if(active.kind==="multi"){return t(messages,"filter.headerRowParts",{count:String(active.spec.parts.length)})}const v=active.spec.value;const pair=Array.isArray(v)?`${v[0]??""}–${v[1]??""}`:String(v??"");return`${messages[`filter.op.${active.spec.op}`]??active.spec.op} ${pair}`}handleFloatingFilterInput(col,kind,rawValue){if(this.effectiveLoading||!col.field)return;const field=col.field;const existing=this.activeFilters[field];if(rawValue.trim()===""){if(existing!==void 0)this.applyFilterDirect(field,null);return}let filter;if(kind==="text"){const op=existing?.kind==="text"?existing.spec.op:"contains";const caseSensitive=existing?.kind==="text"?existing.spec.caseSensitive??false:false;filter={kind:"text",field,spec:{field,op,value:rawValue,caseSensitive}}}else if(kind==="number"){const op=existing?.kind==="number"&&!Array.isArray(existing.spec.value)?existing.spec.op:"equals";const value=normalizeNumericInput(rawValue)??Number.NaN;filter={kind:"number",field,spec:{field,op,value}}}else{const op=existing?.kind==="date"&&!Array.isArray(existing.spec.value)?existing.spec.op:"equals";const granularity=existing?.kind==="date"?existing.spec.granularity??"utc":"utc";filter={kind:"date",field,spec:{field,op,value:rawValue,granularity}}}this.applyFilterDirect(field,filter)}applyFilterDirect(field,filter){const nextMap=filter===null?clearActiveFilter(this.activeFilters,field):setActiveFilter(this.activeFilters,filter);this.activeFilters=nextMap;this.filterChanged.emit({field,filter,activeMap:nextMap});this.scheduleLifecycleFilterPeerNotification();this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()}async setConditionFilter(model){return this.proMethod("setConditionFilter",{load:()=>this.loadProFiltersChunk(),exec:filters=>filters,publish:filters=>{if(model===null){this.builderDraft={type:"group",op:"and",children:[]};this.applyConditionTree(null);return}const validation=validateConditionNode(model);if(!validation.ok){console.warn("setConditionFilter rejected:",validation.errors);return}const copy=parseConditionTree(serializeConditionTree(model));this.builderDraft=filters.treeToBuilderDraft(this.proFiltersHost(),copy);this.applyConditionTree(copy)}})}async getConditionFilter(){return this.proRun("getConditionFilter",()=>this.activeConditionTree?parseConditionTree(serializeConditionTree(this.activeConditionTree)):null)}applyConditionTree(tree){this.activeConditionTree=tree;this.conditionFilterChanged.emit({model:tree});this.scheduleLifecycleFilterPeerNotification();this.resetVirtualScrollPosition();this.recomputeVirtualWindow();this.clampActiveCellAfterChange();this.clampRangesAfterChange()}maybeFocusBuilder(){const key=this.builderFocusKey;if(key===null)return;this.builderFocusKey=null;const host=this.host;if(host==null)return;const btn=host.querySelector(`[data-builder-add="${key}"]`);if(btn!=null&&typeof btn.focus==="function")btn.focus()}handleBuilderApply=()=>{if(this.effectiveLoading)return;if(!this.proNewWorkAllowed("grid.advanced-filter","conditionBuilder"))return;const filters=this.proUiChunks["pro-filters"];if(filters===void 0)return;const tree=filters.builderDraftToTree(this.proFiltersHost(),this.builderDraft);this.applyConditionTree(tree)};handleBuilderClear=()=>{if(this.effectiveLoading)return;this.builderDraft={type:"group",op:"and",children:[]};this.applyConditionTree(null)};async setConditionPresets(presets){return this.proRun("setConditionPresets",()=>{const next=[];for(const preset of Array.isArray(presets)?presets:[]){if(!preset||typeof preset.name!=="string"||preset.name.trim()==="")continue;if(typeof preset.json!=="string")continue;try{parseConditionTree(preset.json)}catch{continue}if(next.some(p=>p.name===preset.name))continue;next.push({name:preset.name,json:preset.json})}this.conditionPresets=next})}async getConditionPresets(){return this.proRun("getConditionPresets",()=>this.conditionPresets.map(p=>({...p})))}emitPresetsChanged(){this.conditionPresetsChanged.emit({presets:this.conditionPresets.map(p=>({...p}))})}handlePresetSave=()=>{if(this.effectiveLoading)return;if(!this.proNewWorkAllowed("grid.advanced-filter","conditionBuilder"))return;const filters=this.proUiChunks["pro-filters"];if(filters===void 0)return;const name=this.presetNameDraft.trim();const tree=filters.builderDraftToTree(this.proFiltersHost(),this.builderDraft);if(name===""||tree===null)return;const json=serializeConditionTree(tree);const others=this.conditionPresets.filter(p=>p.name!==name);this.conditionPresets=[...others,{name,json}];this.presetNameDraft="";this.emitPresetsChanged()};handlePresetLoad(preset){if(this.effectiveLoading)return;if(!this.proNewWorkAllowed("grid.advanced-filter","conditionBuilder"))return;const filters=this.proUiChunks["pro-filters"];if(filters===void 0)return;let tree;try{tree=parseConditionTree(preset.json)}catch(err){console.warn(`[SG:FILTER] bad preset=${preset.name}`,err);return}this.builderDraft=filters.treeToBuilderDraft(this.proFiltersHost(),tree);this.applyConditionTree(tree)}handlePresetDelete(name){if(this.effectiveLoading)return;this.conditionPresets=this.conditionPresets.filter(p=>p.name!==name);this.emitPresetsChanged()}renderSetFilterBody(form,subIndex){const filters=this.proUiChunks["pro-filters"];return filters===void 0?null:filters.renderSetFilterBody(this.proFiltersHost(),form,subIndex)}renderFilterFormActions(locked){const messages=this.resolvedMessages;return index.h("div",{class:"sy-grid__filter-actions"},index.h("button",{type:"button",class:"sy-grid__filter-button sy-grid__filter-button--secondary",disabled:locked,onClick:this.handleFilterClear},messages["filter.clearButton"]),index.h("button",{type:"button",class:"sy-grid__filter-button sy-grid__filter-button--secondary",onClick:this.handleFilterCancel},messages["filter.cancelButton"]),index.h("button",{type:"button",class:"sy-grid__filter-button sy-grid__filter-button--primary",disabled:locked,onClick:this.handleFilterApply},messages["filter.applyButton"]))}renderFilterDropdown(){if(!this.usingColumnDefsApi())return null;if(this.openFilterField===null)return null;const col=this.resolvedColumnDefs().find(c=>c.field===this.openFilterField);const lifecycleFilter=col===void 0?null:this.lifecycleFilterDeclaration(col);if(this.filterForm===null&&lifecycleFilter===null)return null;const dialogLabel=t(this.resolvedMessages,"header.filterLabel",{column:col?.headerName??col?.field??this.openFilterField});return index.h("div",{id:"sy-grid-filter-dropdown",class:"sy-grid__filter-dropdown",role:"dialog","aria-label":dialogLabel,tabindex:"-1",ref:el=>{this.filterDropdownEl=el??null},style:{position:"absolute",left:`${this.dropdownAnchor?.x??0}px`,top:`${this.dropdownAnchor?.y??0}px`,zIndex:"1000"},onClick:event=>event.stopPropagation(),onMouseDown:event=>event.stopPropagation()},lifecycleFilter!==null&&col!==void 0?index.h("div",{class:"sy-grid__custom-filter-host","data-col-id":this.componentFilterColumnId(col),ref:this.componentFilterHostRef(this.componentFilterColumnId(col),false)}):this.renderFilterDropdownForm(this.filterForm))}renderFilterDropdownForm(form){const locked=this.effectiveLoading;if(form.kind==="multi"){return index.h("div",{class:"sy-grid__filter-form sy-grid__filter-form--multi"},(form.subForms??[]).map((sub,i)=>index.h("div",{class:"sy-grid__filter-multi-section",key:`${sub.kind}-${i}`},sub.kind==="set"?this.renderSetFilterBody(sub,i):this.renderScalarFilterBody(sub,i))),this.renderFilterFormActions(locked))}if(form.kind==="set"){return index.h("div",{class:"sy-grid__filter-form sy-grid__filter-form--set"},this.renderSetFilterBody(form,null),this.renderFilterFormActions(locked))}return index.h("div",{class:"sy-grid__filter-form"},this.renderScalarFilterBody(form,null),this.renderFilterFormActions(locked))}renderScalarFilterBody(form,subIndex){const isRangeOp=form.op==="between"||form.op==="notBetween";const locked=this.effectiveLoading;const messages=this.resolvedMessages;return index.h("div",{class:"sy-grid__filter-scalar-body"},index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},messages["filter.operatorLabel"]),index.h("select",{class:"sy-grid__filter-op",disabled:locked,onChange:e=>this.patchForm(subIndex,{op:e.target.value})},this.filterOpOptions(form.kind,form.op))),form.kind==="text"&&index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},messages["filter.valueLabel"]),index.h("input",{class:"sy-grid__filter-input",type:"text",value:form.value1,placeholder:messages["filter.valuePlaceholder"],readOnly:locked,"aria-disabled":locked?"true":void 0,onInput:e=>this.patchForm(subIndex,{value1:e.target.value})})),form.kind==="number"&&index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},isRangeOp?messages["filter.fromLabel"]:messages["filter.valueLabel"]),index.h("input",{class:"sy-grid__filter-input",type:"number",value:form.value1,placeholder:isRangeOp?messages["filter.numberLowPlaceholder"]:messages["filter.numberPlaceholder"],readOnly:locked,"aria-disabled":locked?"true":void 0,onInput:e=>this.patchForm(subIndex,{value1:e.target.value})})),form.kind==="number"&&isRangeOp&&index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},messages["filter.toLabel"]),index.h("input",{class:"sy-grid__filter-input",type:"number",value:form.value2,placeholder:messages["filter.numberHighPlaceholder"],readOnly:locked,"aria-disabled":locked?"true":void 0,onInput:e=>this.patchForm(subIndex,{value2:e.target.value})})),form.kind==="date"&&index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},isRangeOp?messages["filter.fromLabel"]:messages["filter.dateLabel"]),index.h("input",{class:"sy-grid__filter-input",type:"date",value:form.value1,readOnly:locked,"aria-disabled":locked?"true":void 0,onInput:e=>this.patchForm(subIndex,{value1:e.target.value})})),form.kind==="date"&&isRangeOp&&index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},messages["filter.toLabel"]),index.h("input",{class:"sy-grid__filter-input",type:"date",value:form.value2,readOnly:locked,"aria-disabled":locked?"true":void 0,onInput:e=>this.patchForm(subIndex,{value2:e.target.value})})),form.kind==="text"&&index.h("label",{class:"sy-grid__filter-row sy-grid__filter-row--inline"},index.h("input",{type:"checkbox",checked:form.caseSensitive,disabled:locked,onChange:e=>this.patchForm(subIndex,{caseSensitive:e.target.checked})}),index.h("span",{class:"sy-grid__filter-label sy-grid__filter-label--inline"},messages["filter.caseSensitiveLabel"])),form.kind==="date"&&index.h("label",{class:"sy-grid__filter-row"},index.h("span",{class:"sy-grid__filter-label"},messages["filter.granularityLabel"]),index.h("select",{class:"sy-grid__filter-op",disabled:locked,onChange:e=>this.patchForm(subIndex,{granularity:e.target.value})},index.h("option",{value:"utc",selected:form.granularity==="utc"},messages["filter.granularityUtcOption"]),index.h("option",{value:"day",selected:form.granularity==="day"},messages["filter.granularityDayOption"]))))}filterOpOptions(kind,currentOp){const messages=this.resolvedMessages;const opts=kind==="text"?[["contains",messages["filter.op.contains"]],["notContains",messages["filter.op.notContains"]],["equals",messages["filter.op.equals"]],["notEqual",messages["filter.op.notEqual"]],["startsWith",messages["filter.op.startsWith"]],["endsWith",messages["filter.op.endsWith"]]]:kind==="number"?[["equals",messages["filter.op.equals"]],["notEqual",messages["filter.op.notEqual"]],["gt",messages["filter.op.greaterThan"]],["gte",messages["filter.op.greaterOrEqual"]],["lt",messages["filter.op.lessThan"]],["lte",messages["filter.op.lessOrEqual"]],["between",messages["filter.op.between"]],["notBetween",messages["filter.op.notBetween"]]]:[["equals",messages["filter.op.equals"]],["notEqual",messages["filter.op.notEqual"]],["before",messages["filter.op.before"]],["after",messages["filter.op.after"]],["onOrBefore",messages["filter.op.onOrBefore"]],["onOrAfter",messages["filter.op.onOrAfter"]],["between",messages["filter.op.between"]],["notBetween",messages["filter.op.notBetween"]]];return opts.map(([value,label])=>index.h("option",{value,selected:currentOp===value},label))}openToolPanelId=null;columnsPanelSearch="";filtersPanelSearch="";sideBarWarned=false;sideBarSpec(){const resolved=resolveSideBar(this.sideBar);if(resolved!==null&&!this.proAllowed("grid.tool-panels","sideBar"))return null;if(resolved!==null&&resolved.invalid.length>0&&!this.sideBarWarned){this.sideBarWarned=true;console.warn(`sideBar declaration has invalid entries: ${resolved.invalid.join(", ")}`)}return resolved}onSideBarChanged(){const spec=this.sideBarSpec();if(spec===null){this.openToolPanelId=null;return}const stillDeclared=this.openToolPanelId!==null&&spec.panels.some(p=>p.id===this.openToolPanelId);if(stillDeclared)return;this.openToolPanelId=spec.defaultOpen}async openToolPanel(id){const declared=()=>resolveSideBar(this.sideBar)?.panels.some(p=>p.id===id)===true;return this.proMethod("openToolPanel",{validate:()=>declared()?void 0:{result:false},load:()=>this.loadProPanelsChunk(),exec:()=>void 0,publish:()=>{const spec=this.sideBarSpec();if(spec===null||!spec.panels.some(p=>p.id===id))return false;if(this.openToolPanelId!==id){this.openToolPanelId=id;this.toolPanelToggled.emit({id,open:true})}return true}})}async closeToolPanel(){return this.proRun("closeToolPanel",()=>{const open=this.openToolPanelId;if(open===null)return;this.openToolPanelId=null;this.toolPanelToggled.emit({id:open,open:false})})}async getOpenedToolPanel(){return this.proRun("getOpenedToolPanel",()=>this.openToolPanelId)}renderSideBar(){if(!this.usingColumnDefsApi()||this.sideBarSpec()===null)return null;const panels=this.proUiChunk("pro-panels","grid.tool-panels","sideBar");return panels==null?null:panels.renderSideBar(this.proPanelsHost())}lastFilteredDataRowCount=null;statusBarWarned=false;statusBarSpec(){const resolved=resolveStatusBar(this.statusBar);if(resolved!==null&&!this.proAllowed("grid.status-bar","statusBar"))return null;if(resolved!==null&&resolved.invalid.length>0&&!this.statusBarWarned){this.statusBarWarned=true;console.warn(`statusBar declaration has invalid entries: ${resolved.invalid.join(", ")}`)}return resolved}renderStatusBar(){if(!this.usingColumnDefsApi()||this.statusBarSpec()===null)return null;const panels=this.proUiChunk("pro-panels","grid.status-bar","statusBar");return panels==null?null:panels.renderStatusBar(this.proPanelsHost())}renderPaginationBar(){if(!this.pagination)return null;if(!this.usingColumnDefsApi())return null;const meta=this.latestPaginatedMeta;const pageIndex=this.activePagination.pageIndex;const pageSize=this.activePagination.pageSize;const totalRows=meta?.totalRows??0;const pageCount=meta?.pageCount??1;const start=totalRows===0?0:pageIndex*pageSize+1;const end=Math.min(totalRows,(pageIndex+1)*pageSize);const pageSizeOptions=this.normalizedPageSizeOptions();const isFirst=pageIndex<=0;const isLast=pageIndex>=pageCount-1;const numbers=visiblePageNumbers(pageIndex,pageCount);const locked=this.effectiveLoading;const messages=this.resolvedMessages;return index.h("div",{class:{"sy-grid__pagination":true,"sy-grid__pagination--locked":locked},role:"navigation","aria-label":messages["pagination.navAriaLabel"],"aria-disabled":locked?"true":void 0,onKeyDown:this.handlePaginationKeyDown},index.h("button",{type:"button",class:"sy-grid__pagination-button sy-grid__pagination-button--prev","aria-label":messages["a11y.paginationPrev"],disabled:isFirst||locked,onClick:this.handlePrevPage},"‹"),index.h("span",{class:"sy-grid__page-numbers"},numbers.map((entry,i)=>{if(entry==="ellipsis"){return index.h("span",{key:`ellipsis-${i}`,class:"sy-grid__page-ellipsis","aria-hidden":"true"},"…")}const targetIndex=entry-1;const isActive=targetIndex===pageIndex;return index.h("button",{key:`page-${entry}`,type:"button",class:{"sy-grid__pagination-button":true,"sy-grid__page-number":true,"sy-grid__page-number--active":isActive},"data-active":isActive?"true":"false","aria-current":isActive?"page":void 0,"aria-label":t(messages,"header.pageLabel",{page:entry}),disabled:locked,onClick:()=>this.handleGoToPage(targetIndex)},entry)})),index.h("button",{type:"button",class:"sy-grid__pagination-button sy-grid__pagination-button--next","aria-label":messages["a11y.paginationNext"],disabled:isLast||locked,onClick:this.handleNextPage},"›"),index.h("span",{class:"sy-grid__page-info","aria-live":"polite"},t(messages,"pagination.rangeOf",{start,end,total:totalRows})),index.h("label",{class:"sy-grid__page-size-label"},index.h("span",{class:"sy-grid__page-size-text"},messages["pagination.rowsLabel"]),index.h("select",{class:"sy-grid__page-size","aria-label":messages["a11y.paginationPageSize"],disabled:locked,onChange:event=>this.handlePageSizeChange(event.target.value)},pageSizeOptions.map(opt=>index.h("option",{value:String(opt),selected:opt===pageSize},opt)))))}renderHeaderCheckboxCell(stickyLeft=false){const ids=this.collectVisibleRowIds();const headerState=headerCheckboxState(this.selectionState,ids);const ariaLabel=this.resolvedMessages["a11y.selectAllCheckbox"];const attrs=headerCheckboxAttrs(headerState,ariaLabel);const cellStyle={width:`${SELECTION_CHECKBOX_COLUMN.width}px`};if(stickyLeft){cellStyle.position="sticky";cellStyle.left="0px";cellStyle.zIndex="4"}const headerAttrs=columnHeaderAttrs({colIndex:0,sortDirection:null,label:ariaLabel});return index.h("div",{class:{"sy-grid__header-cell":true,"sy-grid__header-cell--selection":true,"sy-grid__header-cell--locked":this.effectiveLoading},...headerAttrs,"data-field":SELECTION_CHECKBOX_COLUMN.field,style:cellStyle},index.h("span",{class:{"sy-grid__selection-checkbox":true,"sy-grid__selection-checkbox--checked":headerState==="all","sy-grid__selection-checkbox--mixed":headerState==="partial"},role:attrs.role,"aria-checked":attrs["aria-checked"],"aria-label":attrs["aria-label"],tabindex:attrs.tabindex,onClick:this.handleHeaderCheckboxClick,onKeyDown:this.handleHeaderCheckboxKeyDown}))}renderBodyCheckboxCell(isSelected,stickyLeft=false){const ariaLabel=this.resolvedMessages["a11y.selectRowCheckbox"];const attrs=bodyCheckboxAttrs(isSelected,ariaLabel);const cellStyle={width:`${SELECTION_CHECKBOX_COLUMN.width}px`};if(stickyLeft){cellStyle.position="sticky";cellStyle.left="0px";cellStyle.zIndex="1"}return index.h("div",{class:{"sy-grid__cell":true,"sy-grid__cell--selection":true,"sy-grid__cell--pinned-left":stickyLeft},...gridCellAttrs({colIndex:0,isActive:false}),"data-field":SELECTION_CHECKBOX_COLUMN.field,"data-col-index":-1,style:cellStyle},index.h("span",{class:{"sy-grid__selection-checkbox":true,"sy-grid__selection-checkbox--checked":isSelected},role:attrs.role,"aria-checked":attrs["aria-checked"],"aria-label":attrs["aria-label"],tabindex:attrs.tabindex}))}lifecycleRendererDeclaration(col){const raw=col.cellRenderer;if(raw===void 0||raw===null||typeof raw==="function"){return null}if(typeof raw==="string"){return this.cellRendererRegistry.get(raw)===null?{componentName:raw}:null}if(typeof raw==="object"){return{definition:raw}}return null}rendererPresentationCoordinateKey(rowIndex,colIndex){return`${rowIndex}:${colIndex}`}rendererPresentationFromOutput(output){if(output===null||typeof output!=="object"){return{classNames:[]}}const candidate=output;if(candidate.kind!=="text"&&candidate.kind!=="html"&&candidate.kind!=="vnode"){return{classNames:[]}}const classNames=typeof candidate.class==="string"?[...new Set(candidate.class.split(/\s+/).filter(Boolean))]:[];return{classNames,...typeof candidate.title==="string"?{title:candidate.title}:{}}}sameRendererPresentation(left,right){if(left===void 0){return right.classNames.length===0&&right.title===void 0}return left.title===right.title&&left.classNames.length===right.classNames.length&&left.classNames.every((className,index2)=>className===right.classNames[index2])}updateLifecycleRendererPresentation(requestKey,presentation){const previous=this.lifecycleRendererPresentations.get(requestKey);if(this.sameRendererPresentation(previous,presentation))return false;if(presentation.classNames.length===0&&presentation.title===void 0){return this.lifecycleRendererPresentations.delete(requestKey)}this.lifecycleRendererPresentations.set(requestKey,presentation);return true}recordRendererPresentation(rowIndex,colIndex,presentation){if(presentation.classNames.length===0&&presentation.title===void 0){return}this.rendererPresentationsByCoordinate.set(this.rendererPresentationCoordinateKey(rowIndex,colIndex),presentation)}rendererPresentationAt(rowIndex,colIndex){return this.rendererPresentationsByCoordinate.get(this.rendererPresentationCoordinateKey(rowIndex,colIndex))}rendererPresentationClasses(presentation){if(presentation===void 0||presentation.classNames.length===0){return{}}return presentation.classNames.reduce((classes,className)=>{classes[className]=true;return classes},{})}renderLifecycleRenderer(declaration,rowIndex,colIndex,col,identityRow,paramsRow,value,formatted){const rowId=this.componentRowId(identityRow);const colId=this.componentColumnId(col);if(rowId===null||colId===null)return"—";const identity2={rowId,colId};const requestKey=JSON.stringify([identity2.rowId,identity2.colId]);const presentation=this.lifecycleRendererPresentations.get(requestKey);if(presentation!==void 0){this.recordRendererPresentation(rowIndex,colIndex,presentation)}return index.h("span",{class:"sy-grid__cell-component-host","data-component-kind":"renderer","data-component-key":requestKey,ref:element=>{if(element===void 0||element===null)return;this.pendingLifecycleRenderers.set(requestKey,{identity:identity2,host:element,...declaration.componentName===void 0?{}:{componentName:declaration.componentName},...declaration.definition===void 0?{}:{definition:declaration.definition},paramsRow,value,rowIndex,colIndex,formatted,meta:col.cellRendererMeta})}})}resolveCellRenderer(col){const raw=col.cellRenderer;if(raw===void 0||raw===null)return null;if(typeof raw==="function"){return raw}if(typeof raw==="string"){const found=this.cellRendererRegistry.get(raw);if(found!==null)return found;if(!this.cellRendererWarnedFields.has(col.field)){this.cellRendererWarnedFields.add(col.field);console.warn(`[cellRenderer] field=${col.field} missing=${raw}; names=${this.cellRendererRegistry.list().join(", ")}`)}return null}if(!this.cellRendererWarnedFields.has(col.field)){this.cellRendererWarnedFields.add(col.field);console.warn(`[cellRenderer] field=${col.field} bad type=${typeof raw}; text fallback`)}return null}renderCellContent(rowIndex,colIndex,col,row,value,maskedCallbackRow){const lifecycle=this.lifecycleRendererDeclaration(col);const renderer=lifecycle===null?this.resolveCellRenderer(col):null;if(lifecycle===null&&renderer===null)return null;const rendererRow=maskedCallbackRow??(this.readPolicyConfigured()?this.maskDeniedFields(row,rowIndex,this.resolvedColumnDefs()):row);const formatted=col.valueFormatter!==void 0&&col.valueFormatter!==null?this.formatGridCellValue({value,row:rendererRow,rowIndex,colId:col.colId??col.field,valueFormatter:col.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef:col}):void 0;if(lifecycle!==null){return this.renderLifecycleRenderer(lifecycle,rowIndex,colIndex,col,row,rendererRow,value,formatted)}if(renderer===null)return null;const input={value,row:rendererRow,rowIndex,colIndex,colId:col.field,formatted,meta:col.cellRendererMeta};let output;try{output=renderer(input)}catch(err){if(!this.cellRendererWarnedFields.has(col.field)){this.cellRendererWarnedFields.add(col.field);console.warn(`[cellRenderer] error field=${col.field} row=${rowIndex}:`,err)}return"—"}if(!output||typeof output!=="object"){if(!this.cellRendererWarnedFields.has(col.field)){this.cellRendererWarnedFields.add(col.field);const reportedShape=output===null?"null":typeof output;console.warn(`[cellRenderer] field=${col.field} bad shape=${reportedShape}; fallback`)}return"—"}if(output.kind==="text"){this.recordRendererPresentation(rowIndex,colIndex,this.rendererPresentationFromOutput(output));return typeof output.text==="string"?output.text:""}if(output.kind==="html"){this.recordRendererPresentation(rowIndex,colIndex,this.rendererPresentationFromOutput(output));const html=typeof output.html==="string"?output.html:"";return index.h("span",{class:"sy-grid__cell-html",innerHTML:html})}if(output.kind==="vnode"){this.recordRendererPresentation(rowIndex,colIndex,this.rendererPresentationFromOutput(output));return output.vnode}if(!this.cellRendererWarnedFields.has(col.field)){this.cellRendererWarnedFields.add(col.field);console.warn(`[cellRenderer] field=${col.field} bad kind=${output.kind}; fallback`)}return"—"}renderEditorForCell(rowIndex,colIndex,col){if(this.editStore.active===null)return null;const tx=this.editStore.active;const lifecycleTarget=this.lifecycleEditorNavigationTarget?.target;let lifecycleCell=null;if(lifecycleTarget!==void 0){if(this.componentFilterColumnId(col)!==lifecycleTarget.colId){return null}const candidateRow=this.getDisplayRows()[rowIndex];if(candidateRow===void 0||candidateRow===null||typeof candidateRow!=="object"){return null}let candidateMatches=lifecycleTarget.rowId===null?candidateRow===lifecycleTarget.row:false;if(lifecycleTarget.rowId!==null){try{candidateMatches=Object.is(this.editRowIdentity(candidateRow),lifecycleTarget.rowId)}catch{candidateMatches=false}}if(!candidateMatches)return null;lifecycleCell=this.resolveQueuedCellEditTarget(lifecycleTarget,false);if(lifecycleCell===null||lifecycleCell.rowIndex!==rowIndex||lifecycleCell.colIndex!==colIndex){return null}this.lifecycleEditorCell=lifecycleCell}else if(tx.rowIndex!==rowIndex||tx.colIndex!==colIndex){return null}if(col.editable!==true)return null;if(!this.passesEditPolicyAt(rowIndex,colIndex))return null;if(lifecycleTarget!==void 0){if(col.cellEditor==null)return null;const lifecycleKey=this.lifecycleEditorNavigationTarget?.key;if(lifecycleKey===void 0)return null;let claimedLifecycleHost=null;if(this.lifecycleEditorCell===null||this.lifecycleEditorCell.rowIndex!==rowIndex||this.lifecycleEditorCell.colIndex!==colIndex){return null}return index.h("div",{class:"sy-grid__cell-editor-component-host","data-component-kind":"editor","data-component-state":this.lifecycleEditorRef===null?"starting":"mounted",ref:host=>{const element=host??null;if(element===null){if(this.lifecycleEditorHost===claimedLifecycleHost){this.lifecycleEditorHost=null}return}if(this.lifecycleEditorNavigationTarget?.key!==lifecycleKey){return}claimedLifecycleHost=element;this.lifecycleEditorHost=element}})}const editorType=col.editor??"text";if(editorType==="number"){return this.renderNumberEditorForCell(rowIndex,colIndex,col)}if(editorType==="date"){return this.renderDateEditorForCell(rowIndex,colIndex,col)}if(editorType==="select"){return this.renderSelectEditorForCell(rowIndex,colIndex,col)}if(editorType==="autocomplete"){return this.richSelect?.renderAutocompleteEditor(this,index.h,rowIndex,colIndex,col)??null}if(editorType==="checkbox"){return this.renderCheckboxEditorForCell(rowIndex,colIndex,col)}if(editorType==="textarea"){return this.renderTextareaEditorForCell(rowIndex,colIndex,col)}if(editorType==="largeText"){return this.renderLargeTextEditorForCell(rowIndex,colIndex,col)}return this.renderTextEditorForCell(rowIndex,colIndex,col)}renderTextEditorForCell(rowIndex,colIndex,col){if(this.textEditorState===null)return null;const ariaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"a11y.cellEditingHint",{column:col.headerName??col.field,row:rowIndex+1});const props=buildTextEditorProps({state:this.textEditorState,rowIndex,colIndex,ariaLabel,ariaDescribedBy:hintId,interceptKeyDown:this.formulas===true?event=>this.handleSuggestKeyIntercept(event,name=>this.applyCellSuggestion(name)):void 0,onInput:(value,start,end)=>{if(this.textEditorState===null)return;const nextEditor=applyInputValue$1(this.textEditorState,value);if(nextEditor!==this.textEditorState)this.textEditorState=nextEditor;const cursored=applySelectionChange$2(this.textEditorState,start,end);if(cursored!==this.textEditorState)this.textEditorState=cursored;if(this.formulas===true)this.updateFormulaSuggest("cell",value,start??value.length);if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,value);if(nextStore!==this.editStore)this.editStore=nextStore},onCompositionStart:()=>{if(this.textEditorState===null)return;const next=applyCompositionStart$3(this.textEditorState);if(next!==this.textEditorState)this.textEditorState=next},onCompositionEnd:finalValue=>{if(this.textEditorState===null)return;const next=applyCompositionEnd$3(this.textEditorState,finalValue);if(next!==this.textEditorState)this.textEditorState=next;if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,finalValue);if(nextStore!==this.editStore)this.editStore=nextStore},onCommit:()=>{this.commitEditTransaction()},onCancel:()=>{const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol})},onBlur:()=>{if(this.editStore.active===null)return;if(this.editStore.active.phase!=="pending")return;this.commitEditTransaction()}});return index.h(index.h.Fragment,null,index.h("input",{ref:el=>{this.textEditorEl=el??null},type:props.type,value:props.value,class:props.class,"data-row-index":props["data-row-index"],"data-col-index":props["data-col-index"],"aria-label":props["aria-label"],"aria-describedby":props["aria-describedby"],onInput:props.onInput,onCompositionstart:props.onCompositionStart,onCompositionend:props.onCompositionEnd,onKeyDown:props.onKeyDown,onBlur:props.onBlur}),index.h("span",{id:hintId,class:"sy-grid__cell-editor-hint","aria-live":"polite","aria-atomic":"true"},hint))}renderNumberEditorForCell(rowIndex,colIndex,col){if(this.numberEditorState===null)return null;const constraints=this.numberConstraintsFromColumn(col);const ariaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"a11y.cellEditingHint",{column:col.headerName??col.field,row:rowIndex+1});let violationMessage="";const violation=this.numberEditorState.constraintViolation;if(violation!==null&&constraints!==void 0){const bound=violation==="min"?constraints.min:violation==="max"?constraints.max:constraints.step;if(typeof bound==="number"&&Number.isFinite(bound)){const constraintLabel=violation==="min"?"at least":violation==="max"?"at most":"a multiple of";violationMessage=t(this.resolvedMessages,"editor.numberConstraintViolation",{constraint:constraintLabel,value:String(bound)})}}const props=buildNumberEditorProps({state:this.numberEditorState,rowIndex,colIndex,ariaLabel,ariaDescribedBy:hintId,constraints,onInput:(text,start,end)=>{if(this.numberEditorState===null)return;const nextEditor=applyInputText$1(this.numberEditorState,text,constraints);if(nextEditor!==this.numberEditorState)this.numberEditorState=nextEditor;const cursored=applySelectionChange$1(this.numberEditorState,start,end);if(cursored!==this.numberEditorState)this.numberEditorState=cursored;if(this.editStore.active===null)return;const draft=this.numberEditorState.parsedValue;const nextStore=setDraft(this.editStore,draft);if(nextStore!==this.editStore)this.editStore=nextStore},onCompositionStart:()=>{if(this.numberEditorState===null)return;const next=applyCompositionStart$2(this.numberEditorState);if(next!==this.numberEditorState)this.numberEditorState=next},onCompositionEnd:finalText=>{if(this.numberEditorState===null)return;const next=applyCompositionEnd$2(this.numberEditorState,finalText,constraints);if(next!==this.numberEditorState)this.numberEditorState=next;if(this.editStore.active===null)return;const draft=this.numberEditorState.parsedValue;const nextStore=setDraft(this.editStore,draft);if(nextStore!==this.editStore)this.editStore=nextStore},onCommit:()=>{this.commitEditTransaction()},onCancel:()=>{const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol})},onBlur:()=>{if(this.editStore.active===null)return;if(this.editStore.active.phase!=="pending")return;if(this.numberEditorState!==null&&this.numberEditorState.constraintViolation!==null){return}this.commitEditTransaction()}});return index.h(index.h.Fragment,null,index.h("input",{ref:el=>{this.textEditorEl=el??null},type:props.type,inputMode:props.inputmode,min:props.min,max:props.max,step:props.step,value:props.value,class:props.class,"data-row-index":props["data-row-index"],"data-col-index":props["data-col-index"],"aria-label":props["aria-label"],"aria-describedby":props["aria-describedby"],"aria-invalid":props["aria-invalid"],onInput:props.onInput,onCompositionstart:props.onCompositionStart,onCompositionend:props.onCompositionEnd,onKeyDown:props.onKeyDown,onBlur:props.onBlur}),index.h("span",{id:hintId,class:"sy-grid__cell-editor-hint","aria-live":"polite","aria-atomic":"true"},violationMessage!==""?`${hint} ${violationMessage}`:hint))}pickCalendarDay(iso,constraints){if(this.dateEditorState===null||this.calendarState===null)return;const date=parseISO(iso);if(date===null)return;this.calendarState=selectDay(this.calendarState,date);const nextEditor=applyInputText(this.dateEditorState,iso,constraints);this.dateEditorState=nextEditor;if(this.editStore.active!==null){const nextStore=setDraft(this.editStore,this.dateEditorState.parsedDate);if(nextStore!==this.editStore)this.editStore=nextStore}if(this.dateEditorState.constraintViolation===null)this.commitEditTransaction()}stepCalendarMonth(delta){if(this.calendarState===null)return;const next=stepMonth(this.calendarState,delta);if(next===this.calendarState)return;this.calendarState=next;if(this.calendarFocusedIso!==null){const focused=parseISO(this.calendarFocusedIso);if(focused!==null){const daysInMonth=new Date(Date.UTC(next.year,next.month+1,0)).getUTCDate();const day=Math.min(focused.getUTCDate(),daysInMonth);this.calendarFocusedIso=toISO(utcDate(next.year,next.month,day))}}}handleCalendarKeyNav(event,constraints){if(this.calendarState===null||this.calendarFocusedIso===null)return false;if(event.key==="Enter"){if(!this.calendarKbdNavigated)return false;this.pickCalendarDay(this.calendarFocusedIso,constraints);return true}const NAV={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",PageUp:"pageup",PageDown:"pagedown",Home:"home",End:"end"};const action=NAV[event.key];if(action===void 0)return false;const moved=navigateCalendarDay(this.calendarFocusedIso,action);if(moved===null)return false;const min=coerceBound(constraints?.min??null);const max=coerceBound(constraints?.max??null);const clamped=clampISOToBounds(moved,min,max);this.calendarFocusedIso=clamped;this.calendarKbdNavigated=true;const focusDate=parseISO(clamped);if(focusDate!==null){const next=showMonth(this.calendarState,focusDate.getUTCFullYear(),focusDate.getUTCMonth());if(next!==this.calendarState)this.calendarState=next}return true}renderActiveDateCalendar(){if(this.calendarState===null||this.calendarAnchor===null)return null;const active=this.editStore.active;if(active===null)return null;const cols=this.effectiveColumns();const col=cols[active.colIndex];if(!col)return null;return this.renderDateCalendar(this.dateConstraintsFromColumn(col))}renderDateCalendar(constraints){if(this.calendarState===null)return null;const cal=this.calendarState;const min=coerceBound(constraints?.min??null);const max=coerceBound(constraints?.max??null);const weeks=buildMonthMatrix(cal);const now=new Date;const today=utcDate(now.getUTCFullYear(),now.getUTCMonth(),now.getUTCDate());const heading=`${MONTH_NAMES[cal.month]} ${cal.year}`;const stop=event=>{event.preventDefault();event.stopPropagation()};const anchor=this.calendarAnchor;return index.h("div",{class:"sy-grid__date-calendar",id:SY_GRID_DATE_CALENDAR_ID,role:"dialog","aria-label":heading,style:anchor?{position:"fixed",left:`${anchor.x}px`,top:`${anchor.y}px`,minWidth:`${anchor.width}px`,zIndex:"1000"}:void 0,onMouseDown:stop,onClick:event=>event.stopPropagation()},index.h("div",{class:"sy-grid__date-calendar-header"},index.h("button",{type:"button",key:"cal-prev",class:"sy-grid__date-calendar-nav","aria-label":"Previous month",onMouseDown:event=>{event.preventDefault();event.stopPropagation()},onClick:event=>{event.stopPropagation();this.stepCalendarMonth(-1)}},"‹"),index.h("span",{class:"sy-grid__date-calendar-title","aria-live":"polite"},heading),index.h("button",{type:"button",key:"cal-next",class:"sy-grid__date-calendar-nav","aria-label":"Next month",onMouseDown:event=>{event.preventDefault();event.stopPropagation()},onClick:event=>{event.stopPropagation();this.stepCalendarMonth(1)}},"›")),index.h("div",{class:"sy-grid__date-calendar-grid",role:"group","aria-label":heading},index.h("div",{class:"sy-grid__date-calendar-week sy-grid__date-calendar-week--head","aria-hidden":"true"},WEEKDAY_INITIALS.map((w,i)=>index.h("span",{class:"sy-grid__date-calendar-weekday",key:`wd-${i}`},w))),weeks.map((week,wi)=>index.h("div",{class:"sy-grid__date-calendar-week",key:`wk-${wi}`},week.map(cell=>{const disabled=isDisabledDay(cell.date,min,max);const selected=isSameDay(cell.date,cal.selected);const isToday=isSameDay(cell.date,today);const isKbdFocused=cell.iso===this.calendarFocusedIso;return index.h("button",{type:"button",key:cell.iso,id:`sy-grid-cal-day-${cell.iso}`,class:{"sy-grid__date-calendar-day":true,"sy-grid__date-calendar-day--outside":!cell.inMonth,"sy-grid__date-calendar-day--selected":selected,"sy-grid__date-calendar-day--today":isToday,"sy-grid__date-calendar-day--focused":isKbdFocused},"aria-pressed":selected?"true":"false","aria-current":isToday?"date":void 0,"aria-label":cell.iso,disabled,"data-iso":cell.iso,onMouseDown:event=>{event.preventDefault();event.stopPropagation()},onClick:event=>{event.stopPropagation();this.pickCalendarDay(cell.iso,constraints)}},cell.day)})))))}renderDateEditorForCell(rowIndex,colIndex,col){if(this.dateEditorState===null)return null;const constraints=this.dateConstraintsFromColumn(col);const ariaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"a11y.cellEditingHint",{column:col.headerName??col.field,row:rowIndex+1});let violationMessage="";const violation=this.dateEditorState.constraintViolation;if(violation==="min"||violation==="max"){const bound=violation==="min"?constraints?.min:constraints?.max;const boundISO=(()=>{if(bound instanceof Date&&!Number.isNaN(bound.getTime())){const year=String(bound.getUTCFullYear()).padStart(4,"0");const month=String(bound.getUTCMonth()+1).padStart(2,"0");const day=String(bound.getUTCDate()).padStart(2,"0");return`${year}-${month}-${day}`}if(typeof bound==="string")return bound;return null})();if(boundISO!==null){const constraintLabel=violation==="min"?"on or after":"on or before";violationMessage=t(this.resolvedMessages,"editor.dateConstraintViolation",{constraint:constraintLabel,value:boundISO})}}else if(violation==="invalid"){violationMessage=t(this.resolvedMessages,"editor.dateInvalidFormat")}const props=buildDateEditorProps({state:this.dateEditorState,rowIndex,colIndex,ariaLabel,ariaDescribedBy:hintId,constraints,onInput:(text,start,end)=>{if(this.dateEditorState===null)return;const nextEditor=applyInputText(this.dateEditorState,text,constraints);if(nextEditor!==this.dateEditorState)this.dateEditorState=nextEditor;const cursored=applySelectionChange(this.dateEditorState,start,end);if(cursored!==this.dateEditorState)this.dateEditorState=cursored;if(this.editStore.active===null)return;const draft=this.dateEditorState.parsedDate;const nextStore=setDraft(this.editStore,draft);if(nextStore!==this.editStore)this.editStore=nextStore},onCompositionStart:()=>{if(this.dateEditorState===null)return;const next=applyCompositionStart$1(this.dateEditorState);if(next!==this.dateEditorState)this.dateEditorState=next},onCompositionEnd:finalText=>{if(this.dateEditorState===null)return;const next=applyCompositionEnd$1(this.dateEditorState,finalText,constraints);if(next!==this.dateEditorState)this.dateEditorState=next;if(this.editStore.active===null)return;const draft=this.dateEditorState.parsedDate;const nextStore=setDraft(this.editStore,draft);if(nextStore!==this.editStore)this.editStore=nextStore},onCommit:()=>{this.commitEditTransaction()},onCancel:()=>{const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol})},onBlur:()=>{if(this.editStore.active===null)return;if(this.editStore.active.phase!=="pending")return;if(this.dateEditorState!==null&&this.dateEditorState.constraintViolation!==null){return}this.commitEditTransaction()}});return index.h(index.h.Fragment,null,index.h("input",{ref:el=>{this.textEditorEl=el??null},type:"text",inputMode:"numeric",autoComplete:"off",value:props.value,class:props.class,"data-row-index":props["data-row-index"],"data-col-index":props["data-col-index"],"aria-label":props["aria-label"],"aria-describedby":props["aria-describedby"],"aria-invalid":props["aria-invalid"],"aria-haspopup":"dialog","aria-controls":this.calendarState!==null?SY_GRID_DATE_CALENDAR_ID:void 0,"aria-expanded":this.calendarState!==null?"true":"false","aria-activedescendant":this.calendarState!==null&&this.calendarFocusedIso!==null?`sy-grid-cal-day-${this.calendarFocusedIso}`:void 0,onInput:event=>{props.onInput(event);this.calendarKbdNavigated=false},onCompositionstart:props.onCompositionStart,onCompositionend:props.onCompositionEnd,onKeyDown:event=>{if(this.calendarState!==null&&this.handleCalendarKeyNav(event,constraints)){event.preventDefault();event.stopPropagation();return}props.onKeyDown(event)},onBlur:props.onBlur}),index.h("span",{id:hintId,class:"sy-grid__cell-editor-hint","aria-live":"polite","aria-atomic":"true"},violationMessage!==""?`${hint} ${violationMessage}`:hint))}renderSelectEditorForCell(rowIndex,colIndex,col){if(this.selectEditorState===null)return null;const state=this.selectEditorState;const ariaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"a11y.cellEditingHint",{column:col.headerName??col.field,row:rowIndex+1});const placeholder=t(this.resolvedMessages,"editor.selectPlaceholder");const expandLabel=t(this.resolvedMessages,state.open?"editor.selectCollapse":"editor.selectExpand");const triggerProps=buildSelectTriggerProps({state,rowIndex,colIndex,ariaLabel:`${ariaLabel} — ${expandLabel}`,onToggle:()=>{if(this.selectEditorState===null)return;const next=applyDropdownToggle(this.selectEditorState);if(next!==this.selectEditorState)this.selectEditorState=next},onKeyDown:key=>{if(this.selectEditorState===null)return;const cur=this.selectEditorState;if(shouldCommitOnKey$2(cur,key)){if(key==="Enter"&&cur.open&&cur.highlightedIndex!==null){const picked=applyOptionPick(cur,cur.highlightedIndex);if(picked!==cur)this.selectEditorState=picked}if(this.editStore.active!==null){const draft=this.selectEditorState.value;const nextStore=setDraft(this.editStore,draft);if(nextStore!==this.editStore)this.editStore=nextStore}this.commitEditTransaction();return}if(shouldCloseDropdownOnKey(cur,key)){const next=applyDropdownToggle(cur,false);if(next!==cur)this.selectEditorState=next;return}if(shouldCancelOnKey$2(cur,key)){const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol});return}if(key==="Enter"&&!cur.open){const next=applyDropdownToggle(cur,true);if(next!==cur)this.selectEditorState=next;return}if(key==="ArrowDown"||key==="ArrowUp"){let s=cur;if(!s.open){const opened=applyDropdownToggle(s,true);if(opened!==s){s=opened;this.selectEditorState=opened}}const moved=applyHighlightChange(s,key==="ArrowDown"?1:-1);if(moved!==s)this.selectEditorState=moved;return}if(key==="Home"||key==="End"){let s=cur;if(!s.open){const opened=applyDropdownToggle(s,true);if(opened!==s){s=opened;this.selectEditorState=opened}}const reset={value:s.value,options:s.options,open:s.open,highlightedIndex:null};const moved=applyHighlightChange(reset,key==="End"?-1:1);if(moved!==this.selectEditorState)this.selectEditorState=moved;return}},onBlur:()=>void 0});const listboxProps=state.open?buildSelectListboxProps({state,rowIndex,colIndex,ariaLabel:`${col.headerName??col.field} options`}):null;return index.h(index.h.Fragment,null,index.h("button",{ref:el=>{this.selectTriggerEl=el??null},type:triggerProps.type,class:triggerProps.class,"aria-haspopup":triggerProps["aria-haspopup"],"aria-expanded":triggerProps["aria-expanded"],"aria-controls":triggerProps["aria-controls"],"aria-label":triggerProps["aria-label"],"aria-describedby":hintId,"data-row-index":triggerProps["data-row-index"],"data-col-index":triggerProps["data-col-index"],onClick:triggerProps.onClick,onKeyDown:triggerProps.onKeyDown,onBlur:triggerProps.onBlur},triggerProps.label!==""?triggerProps.label:index.h("span",{class:"sy-grid__select-placeholder"},placeholder)),listboxProps!==null?index.h("div",{role:listboxProps.role,id:listboxProps.id,class:listboxProps.class,"aria-activedescendant":listboxProps["aria-activedescendant"],"aria-label":listboxProps["aria-label"],tabindex:listboxProps.tabindex},state.options.map((_opt,optIdx)=>{const optProps=buildSelectOptionProps({state,optionIndex:optIdx,rowIndex,colIndex,onPick:idx=>{if(this.selectEditorState===null)return;const picked=applyOptionPick(this.selectEditorState,idx);if(picked===this.selectEditorState)return;this.selectEditorState=picked;if(this.editStore.active!==null){const nextStore=setDraft(this.editStore,picked.value);if(nextStore!==this.editStore)this.editStore=nextStore}this.commitEditTransaction()}});return index.h("div",{key:optIdx,role:optProps.role,id:optProps.id,class:optProps.class,"aria-selected":optProps["aria-selected"],"aria-disabled":optProps["aria-disabled"],onMouseDown:event=>{event.preventDefault();optProps.onClick()}},optProps.label)})):null,index.h("span",{id:hintId,class:"sy-grid__cell-editor-hint","aria-live":"polite","aria-atomic":"true"},hint))}renderCheckboxEditorForCell(rowIndex,colIndex,col){if(this.checkboxEditorState===null)return null;const state=this.checkboxEditorState;const baseAriaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const stateLabel=t(this.resolvedMessages,state.indeterminate?"editor.checkboxAriaLabelMixed":state.value?"editor.checkboxAriaLabelOn":"editor.checkboxAriaLabelOff");const ariaLabel=`${baseAriaLabel} — ${stateLabel}`;const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"a11y.cellEditingHint",{column:col.headerName??col.field,row:rowIndex+1});const props=buildCheckboxEditorProps({state,rowIndex,colIndex,ariaLabel,onToggle:()=>{if(this.checkboxEditorState===null)return;const next=applyToggle(this.checkboxEditorState);if(next!==this.checkboxEditorState)this.checkboxEditorState=next;if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,next.value);if(nextStore!==this.editStore)this.editStore=nextStore},onCommit:()=>{this.commitEditTransaction()},onCancel:()=>{const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol})},onBlur:()=>{if(this.editStore.active===null)return;if(this.editStore.active.phase!=="pending")return;this.commitEditTransaction()}});return index.h(index.h.Fragment,null,index.h("input",{ref:el=>{this.checkboxEditorEl=el??null},type:props.type,checked:props.checked,class:props.class,"data-row-index":props["data-row-index"],"data-col-index":props["data-col-index"],"aria-label":props["aria-label"],"aria-checked":props["aria-checked"],"aria-describedby":hintId,onChange:props.onChange,onKeyDown:props.onKeyDown,onBlur:props.onBlur}),index.h("span",{id:hintId,class:"sy-grid__cell-editor-hint","aria-live":"polite","aria-atomic":"true"},hint))}renderTextareaEditorForCell(rowIndex,colIndex,col){if(this.textareaEditorState===null)return null;const ariaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"editor.textareaCommitHint");const props=buildTextareaEditorProps({state:this.textareaEditorState,rowIndex,colIndex,ariaLabel,ariaDescribedBy:hintId,rows:typeof col.rows==="number"?col.rows:void 0,onInput:(value,start,end)=>{if(this.textareaEditorState===null)return;const nextEditor=applyInputValue(this.textareaEditorState,value,start,end);if(nextEditor!==this.textareaEditorState){this.textareaEditorState=nextEditor}if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,value);if(nextStore!==this.editStore)this.editStore=nextStore},onCompositionStart:()=>{if(this.textareaEditorState===null)return;const next=applyCompositionStart(this.textareaEditorState);if(next!==this.textareaEditorState)this.textareaEditorState=next},onCompositionEnd:finalValue=>{if(this.textareaEditorState===null)return;const next=applyCompositionEnd(this.textareaEditorState,finalValue);if(next!==this.textareaEditorState)this.textareaEditorState=next;if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,finalValue);if(nextStore!==this.editStore)this.editStore=nextStore},onCommit:()=>{this.commitEditTransaction()},onCancel:()=>{const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol})},onBlur:()=>{if(this.editStore.active===null)return;if(this.editStore.active.phase!=="pending")return;this.commitEditTransaction()}});return index.h(index.h.Fragment,null,index.h("textarea",{ref:el=>{this.textareaEditorEl=el??null},value:props.value,rows:props.rows,class:props.class,"data-row-index":props["data-row-index"],"data-col-index":props["data-col-index"],"aria-label":props["aria-label"],"aria-multiline":props["aria-multiline"],"aria-describedby":props["aria-describedby"],onInput:props.onInput,onCompositionstart:props.onCompositionStart,onCompositionend:props.onCompositionEnd,onKeyDown:props.onKeyDown,onBlur:props.onBlur}),index.h("span",{id:hintId,class:"sy-grid__cell-editor-hint","aria-live":"polite","aria-atomic":"true"},hint))}renderLargeTextEditorForCell(_rowIndex,_colIndex,_col){if(this.textareaEditorState===null||this.largeTextConfig===null)return null;return index.h("span",{class:"sy-grid__large-text-anchor","aria-hidden":"true",ref:el=>{this.largeTextAnchorEl=el??null}})}renderActiveLargeTextEditor(){if(this.textareaEditorState===null||this.largeTextConfig===null||this.largeTextAnchor===null){return null}const active=this.editStore.active;if(active===null)return null;const cols=this.effectiveColumns();const col=cols[active.colIndex];if(!col)return null;const rowIndex=active.rowIndex;const colIndex=active.colIndex;const config=this.largeTextConfig;const maxLength=config.maxLength;const ariaLabel=t(this.resolvedMessages,"a11y.cellEditorAriaLabel",{column:col.headerName??col.field,row:rowIndex+1});const hintId=`sy-grid-cell-editor-hint-${rowIndex}-${colIndex}`;const countId=`sy-grid-large-text-count-${rowIndex}-${colIndex}`;const hint=t(this.resolvedMessages,"editor.textareaCommitHint");const props=buildTextareaEditorProps({state:this.textareaEditorState,rowIndex,colIndex,ariaLabel,ariaDescribedBy:hintId,rows:config.rows,onInput:(value,start,end)=>{if(this.textareaEditorState===null)return;const{value:capped}=clampValueToMaxLength(value,maxLength);const caretStart=start===null?null:Math.min(start,capped.length);const caretEnd=end===null?null:Math.min(end,capped.length);const nextEditor=applyInputValue(this.textareaEditorState,capped,caretStart,caretEnd);if(nextEditor!==this.textareaEditorState)this.textareaEditorState=nextEditor;if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,capped);if(nextStore!==this.editStore)this.editStore=nextStore},onCompositionStart:()=>{if(this.textareaEditorState===null)return;const next=applyCompositionStart(this.textareaEditorState);if(next!==this.textareaEditorState)this.textareaEditorState=next},onCompositionEnd:finalValue=>{if(this.textareaEditorState===null)return;const{value:capped}=clampValueToMaxLength(finalValue,maxLength);const next=applyCompositionEnd(this.textareaEditorState,capped);if(next!==this.textareaEditorState)this.textareaEditorState=next;if(this.editStore.active===null)return;const nextStore=setDraft(this.editStore,capped);if(nextStore!==this.editStore)this.editStore=nextStore},onCommit:()=>{this.commitEditTransaction()},onCancel:()=>{this.cancelLargeTextEdit()},onBlur:()=>{if(this.editStore.active===null)return;if(this.editStore.active.phase!=="pending")return;this.commitEditTransaction()}});const anchor=this.largeTextAnchor;const countLabel=charCountLabel(this.textareaEditorState.value,maxLength);const cancelLabel=t(this.resolvedMessages,"editor.largeTextCancel");const saveLabel=t(this.resolvedMessages,"editor.largeTextSave");const holdFocus=event=>{event.preventDefault();event.stopPropagation()};return index.h("div",{class:"sy-grid__large-text",role:"dialog","aria-label":ariaLabel,style:{position:"fixed",left:`${anchor.x}px`,top:`${anchor.y}px`,minWidth:`${anchor.width}px`,zIndex:"1000"},onMouseDown:holdFocus,onClick:event=>event.stopPropagation(),onKeyDown:event=>{if(event.key==="Tab"){event.preventDefault();this.cycleLargeTextFocus(event.shiftKey)}}},index.h("textarea",{ref:el=>{this.textareaEditorEl=el??null},class:"sy-grid__large-text-input",value:props.value,rows:props.rows,cols:config.cols,"data-row-index":props["data-row-index"],"data-col-index":props["data-col-index"],"aria-label":props["aria-label"],"aria-multiline":props["aria-multiline"],"aria-describedby":maxLength!==null?`${hintId} ${countId}`:hintId,onInput:props.onInput,onCompositionstart:props.onCompositionStart,onCompositionend:props.onCompositionEnd,onKeyDown:event=>{if(event.key==="Tab"){event.preventDefault();event.stopPropagation();this.cycleLargeTextFocus(event.shiftKey);return}props.onKeyDown(event)},onBlur:event=>{const next=event.relatedTarget;const dialog=this.host?.querySelector(".sy-grid__large-text");if(next!==null&&dialog!=null&&dialog.contains(next))return;props.onBlur()}}),index.h("div",{class:"sy-grid__large-text-footer",onMouseDown:holdFocus},index.h("span",{id:hintId,class:"sy-grid__large-text-hint","aria-live":"polite"},hint),index.h("span",{id:countId,class:{"sy-grid__large-text-count":true,"sy-grid__large-text-count--over":maxLength!==null&&exceedsMaxLength(this.textareaEditorState.value,maxLength)}},countLabel),index.h("button",{type:"button",class:"sy-grid__large-text-btn",onMouseDown:holdFocus,onClick:()=>this.cancelLargeTextEdit()},cancelLabel),index.h("button",{type:"button",class:"sy-grid__large-text-btn sy-grid__large-text-btn--primary",onMouseDown:holdFocus,onClick:()=>this.commitEditTransaction()},saveLabel)))}cycleLargeTextFocus(backwards){const dialog=this.host?.querySelector(".sy-grid__large-text");if(dialog==null)return;const focusables=Array.from(dialog.querySelectorAll("textarea, button:not([disabled])")).filter(el=>el.offsetParent!==null);if(focusables.length===0)return;const active=this.host?.shadowRoot?.activeElement??document.activeElement;const idx=focusables.findIndex(el=>el===active);let next;if(idx<0)next=0;else if(backwards)next=(idx-1+focusables.length)%focusables.length;else next=(idx+1)%focusables.length;focusables[next].focus()}cancelLargeTextEdit(){const active=this.editStore.active;if(active===null||active.phase!=="pending")return;const cancelledRow=active.rowIndex;const cancelledCol=active.colIndex;this.editingCell=null;this.cancelEditTransaction();this.cellEditingCancelled.emit({rowIndex:cancelledRow,colIndex:cancelledCol})}handleCellTooltipLeave(){this.cellTooltipDelay.leave()}handleHeaderTooltipEnter(event,column){const el=event.currentTarget;if(!el)return;const explicit=typeof column.headerTooltip==="string"?column.headerTooltip.trim():"";const labelEl=el.querySelector(".sy-grid__header-label");const measured=labelEl??el;const displayedText=(labelEl?.textContent??column.headerName??column.field??"").trim();const isOverflowing=measured.scrollWidth>measured.clientWidth+1;if(explicit===""&&!isOverflowing)return;this.headerTooltipDelay.enter({column,headerEl:el,displayedText,isOverflowing})}handleHeaderTooltipLeave(){this.headerTooltipDelay.leave()}showHeaderTooltip(target){const explicit=typeof target.column.headerTooltip==="string"?target.column.headerTooltip.trim():"";const text=explicit!==""?explicit:target.isOverflowing?target.displayedText:"";if(!text){this.cellTooltip=null;return}const rect=target.headerEl.getBoundingClientRect();const floatingWidth=Math.min(360,Math.max(120,text.length*7+24));const floatingHeight=text.length>70?56:36;const viewport={x:0,y:0,width:typeof window==="undefined"?1024:window.innerWidth,height:typeof window==="undefined"?768:window.innerHeight};const position=computeFloatingPosition({anchor:{x:rect.left,y:rect.top,width:rect.width,height:rect.height},floating:{width:floatingWidth,height:floatingHeight},viewport,preferred:"top",offset:8});this.cellTooltip={text,x:position.x,y:position.y,placement:position.placement,rowIndex:-1,field:typeof target.column.field==="string"?target.column.field:""}}showCellTooltip(target){const text=getCellTooltipText({row:target.row,rowIndex:target.rowIndex,column:target.column,displayedText:target.displayedText,isOverflowing:target.isOverflowing,locale:typeof this.locale==="string"?this.locale:"en",context:this.context,api:this.host});if(!text){this.cellTooltip=null;return}const rect=target.cell.getBoundingClientRect();const floatingWidth=Math.min(360,Math.max(120,text.length*7+24));const floatingHeight=text.length>70?56:36;const viewport={x:0,y:0,width:typeof window==="undefined"?1024:window.innerWidth,height:typeof window==="undefined"?768:window.innerHeight};const position=computeFloatingPosition({anchor:{x:rect.left,y:rect.top,width:rect.width,height:rect.height},floating:{width:floatingWidth,height:floatingHeight},viewport,preferred:"top",offset:8});this.cellTooltip={text,x:position.x,y:position.y,placement:position.placement,rowIndex:target.rowIndex,field:target.field}}tooltipPortalEl=null;syncTooltipPortal(){if(typeof document==="undefined")return;const want=this.cellTooltip;if(!want){if(this.tooltipPortalEl?.parentNode)this.tooltipPortalEl.parentNode.removeChild(this.tooltipPortalEl);this.tooltipPortalEl=null;return}if(!this.tooltipPortalEl){const el2=document.createElement("div");el2.setAttribute("role","tooltip");el2.id=SY_GRID_TOOLTIP_ID;const cs=typeof window!=="undefined"?window.getComputedStyle(this.host):null;const tooltipBg=cs?.getPropertyValue("--sy-grid-tooltip-bg").trim()||"#111827";const tooltipColor=cs?.getPropertyValue("--sy-grid-tooltip-color").trim()||"#ffffff";const tooltipBorder=cs?.getPropertyValue("--sy-grid-tooltip-border").trim()||"rgba(255,255,255,0.12)";const tooltipShadow=cs?.getPropertyValue("--sy-grid-tooltip-shadow").trim()||"0 10px 24px rgba(15,23,42,0.18)";Object.assign(el2.style,{position:"fixed",zIndex:"2147483647",maxWidth:"360px",padding:"7px 9px",boxSizing:"border-box",border:`1px solid ${tooltipBorder}`,borderRadius:"4px",background:tooltipBg,color:tooltipColor,boxShadow:tooltipShadow,font:"12px/1.35 system-ui, -apple-system, sans-serif",whiteSpace:"normal",overflowWrap:"anywhere",pointerEvents:"none",margin:"0"});document.body.appendChild(el2);this.tooltipPortalEl=el2}const el=this.tooltipPortalEl;el.className=`sy-grid__cell-tooltip sy-grid__cell-tooltip--${want.placement}`;el.dataset.rowIndex=String(want.rowIndex);el.dataset.field=want.field;el.style.left=`${want.x}px`;el.style.top=`${want.y}px`;el.textContent=want.text}teardownTooltipPortal(){if(this.tooltipPortalEl?.parentNode)this.tooltipPortalEl.parentNode.removeChild(this.tooltipPortalEl);this.tooltipPortalEl=null}renderCellTooltip(){return null}renderGroupRow(marker,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow){const messages=this.resolvedMessages;const level=marker.level??0;const isBlank2=marker.key===null||marker.groupKeys!==void 0&&marker.groupKeys[marker.groupKeys.length-1]===BLANK_GROUP_KEY;const label=isBlank2?messages["filter.setBlanksLabel"]:marker.label;const ariaLevel=marker.level!==void 0?marker.level+1:void 0;const aggregates=isAggregatedGroupMarkerRow(marker)?marker.aggregates:null;const aggregated=aggregates!==null&&Object.keys(aggregates).length>0;const rowClass={"sy-grid__row":true,"sy-grid__group-row":true,"sy-grid__group-row--collapsed":!marker.expanded};const rowStyle={height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`};const caption=[level>0?index.h("span",{class:"sy-grid__tree-indent",style:{width:`${level*16}px`}}):null,index.h("button",{type:"button",class:"sy-grid__group-row-toggle","aria-expanded":marker.expanded?"true":"false","aria-label":label,disabled:this.effectiveLoading},marker.expanded?"⏷":"⏵"),index.h("span",{class:"sy-grid__group-row-label"},label),index.h("span",{class:"sy-grid__group-row-count"},"(",marker.count.toLocaleString(),")")];if(!aggregated){const colCount=this.renderedColumnCount();const totalWidth=this.totalColumnsWidthPx();return index.h("div",{class:rowClass,role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"aria-expanded":marker.expanded?"true":"false","aria-level":ariaLevel,"data-row-index":rowIndex,"data-group-key":marker.key??"",style:totalWidth!==null?{...rowStyle,width:`${totalWidth}px`}:rowStyle},index.h("div",{class:"sy-grid__group-row-cell",role:"gridcell","aria-colindex":1,"aria-colspan":colCount},caption))}const lastPinnedLeft=pinCtx?.lastLeft;const firstPinnedRight=pinCtx?.firstRight;return index.h("div",{class:rowClass,role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"aria-expanded":marker.expanded?"true":"false","aria-level":ariaLevel,"data-row-index":rowIndex,"data-group-key":marker.key??"",style:rowStyle},renderCheckboxCol&&index.h("div",{class:{"sy-grid__cell":true,"sy-grid__cell--selection":true,"sy-grid__cell--pinned-left":pinCtx?.left!=null},role:"gridcell",style:pinCtx?.left!=null?{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,position:"sticky",left:"0px",zIndex:"1"}:{width:`${SELECTION_CHECKBOX_COLUMN.width}px`}}),cols.map((col,colIndex)=>{if(colWindow&&colWindow.culled(colIndex))return null;const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"1","body");const hasAgg=Object.prototype.hasOwnProperty.call(aggregates,col.field);const cellNode=index.h("div",{key:col.field,class:{"sy-grid__cell":true,"sy-grid__group-agg-cell":true,"sy-grid__group-agg-cell--first":colIndex===0,"sy-grid__group-agg-cell--agg":colIndex!==0&&hasAgg,"sy-grid__cell--pinned-left":pin.pinnedLeft,"sy-grid__cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__cell--pinned-right":pin.pinnedRight,"sy-grid__cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight},...gridCellAttrs({colIndex:colIndex+(renderCheckboxCol?1:0),isActive:false}),"data-field":col.field,style:cellStyle},colIndex===0?caption:hasAgg?this.formatAggValue(aggregates[col.field]):"");return this.withColumnSpacers(cellNode,colIndex,colWindow,`gm-${marker.key??"blank"}-${col.field}`)}))}formatAggValue(value,locale){if(value===null||value===void 0)return"";const loc=locale??(typeof this.locale==="string"?this.locale:"en");if(typeof value==="number"){return Number.isInteger(value)?value.toLocaleString(loc):value.toLocaleString(loc,{maximumFractionDigits:2})}if(typeof value==="bigint")return value.toLocaleString(loc);if(value instanceof Date)return value.toISOString();return String(value)}renderGroupFooterRow(footer,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow){const messages=this.resolvedMessages;const displayLabel=footer.key===null?messages["filter.setBlanksLabel"]:footer.label;const footerLabel=t(messages,"group.footerLabel",{label:displayLabel});const lastPinnedLeft=pinCtx?.lastLeft;const firstPinnedRight=pinCtx?.firstRight;return index.h("div",{class:"sy-grid__row sy-grid__group-footer-row",role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"data-row-index":rowIndex,"data-group-key":footer.key??"",style:{height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`}},renderCheckboxCol&&index.h("div",{class:{"sy-grid__cell":true,"sy-grid__cell--selection":true,"sy-grid__cell--pinned-left":pinCtx?.left!=null},role:"gridcell",style:pinCtx?.left!=null?{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,position:"sticky",left:"0px",zIndex:"1"}:{width:`${SELECTION_CHECKBOX_COLUMN.width}px`}}),cols.map((col,colIndex)=>{if(colWindow&&colWindow.culled(colIndex))return null;const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"1","body");const hasAgg=Object.prototype.hasOwnProperty.call(footer.aggregates,col.field);const aggText=hasAgg?this.formatAggValue(footer.aggregates[col.field]):"";const content=colIndex===0?hasAgg&&aggText!==""?`${footerLabel} ${aggText}`:footerLabel:aggText;const cellNode=index.h("div",{key:col.field,class:{"sy-grid__cell":true,"sy-grid__group-footer-cell":true,"sy-grid__group-footer-cell--agg":hasAgg,"sy-grid__cell--pinned-left":pin.pinnedLeft,"sy-grid__cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__cell--pinned-right":pin.pinnedRight,"sy-grid__cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight},...gridCellAttrs({colIndex:colIndex+(renderCheckboxCol?1:0),isActive:false}),"data-field":col.field,style:cellStyle},content);return this.withColumnSpacers(cellNode,colIndex,colWindow,`gf-${footer.key??"blank"}-${col.field}`)}))}renderPivotRow(row,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow){const lastPinnedLeft=pinCtx?.lastLeft;const firstPinnedRight=pinCtx?.firstRight;const isMarker=isPivotRowGroupMarker(row);const isSubtotal=this.isPivotSubtotalDisplayRow(row);const subtotal=row;const marker=row;const level=isMarker?marker.level:isSubtotal?subtotal.level:0;const hasChildren=isMarker?marker.hasChildren:false;const expanded=isMarker?marker.expanded:true;const key=isMarker?marker.key:isSubtotal?`${subtotal.key}::subtotal-${subtotal.placement}`:"__sy_pivot_grandtotal__";const label=isSubtotal?t(this.resolvedMessages,"pivot.subtotalLabel",{label:subtotal.label}):row.label;const active=this.activeCell;const isActiveRow=active!==null&&active.rowIndex===rowIndex;return index.h("div",{class:{"sy-grid__row":true,"sy-grid__pivot-row":true,"sy-grid__pivot-row--grand-total":!isMarker&&!isSubtotal,"sy-grid__pivot-row--subtotal":isSubtotal,"sy-grid__pivot-row--collapsed":hasChildren&&!expanded,"sy-grid__row--active":isActiveRow},role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"aria-level":level+1,"aria-expanded":hasChildren?expanded?"true":"false":void 0,"data-row-index":rowIndex,"data-pivot-key":key,style:{height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`}},renderCheckboxCol&&index.h("div",{class:{"sy-grid__cell":true,"sy-grid__cell--selection":true,"sy-grid__cell--pinned-left":pinCtx?.left!=null},role:"gridcell",style:pinCtx?.left!=null?{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,position:"sticky",left:"0px",zIndex:"1"}:{width:`${SELECTION_CHECKBOX_COLUMN.width}px`}}),cols.map((col,colIndex)=>{if(colWindow&&colWindow.culled(colIndex))return null;const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"1","body");const isRowHeaderCol=col.field===PIVOT_ROW_HEADER_COL_ID;let content;if(isRowHeaderCol){content=[index.h("span",{class:"sy-grid__tree-indent",style:{width:`${level*16}px`}}),hasChildren?index.h("button",{type:"button",class:"sy-grid__tree-toggle","aria-expanded":expanded?"true":"false","aria-label":label},expanded?"⏷":"⏵"):index.h("span",{class:"sy-grid__tree-toggle-spacer"}),index.h("span",{class:"sy-grid__tree-label"},label)]}else{const resolvedColId=col.colId??col.field;const value=this.applyReadMask(this.resolveGridCellValue({row,rowIndex,colId:resolvedColId,field:col.field,valueGetter:col.valueGetter,colDef:col}),row,rowIndex,col);const rendered=this.renderCellContent(rowIndex,colIndex,col,row,value);content=rendered!==null?rendered:col.valueFormatter!==void 0&&col.valueFormatter!==null?this.formatGridCellValue({value,row,rowIndex,colId:resolvedColId,valueFormatter:col.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef:col}):value==null?"":String(value)}const rendererPresentation=this.rendererPresentationAt(rowIndex,colIndex);const cellNode=index.h("div",{key:col.field,class:{"sy-grid__cell":true,"sy-grid__pivot-cell":true,"sy-grid__tree-cell":isRowHeaderCol,"sy-grid__cell--pinned-left":pin.pinnedLeft,"sy-grid__cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__cell--pinned-right":pin.pinnedRight,"sy-grid__cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight,...this.rendererPresentationClasses(rendererPresentation)},role:"gridcell","data-field":col.field,title:rendererPresentation?.title,style:cellStyle},content);return this.withColumnSpacers(cellNode,colIndex,colWindow,`pv-${key}-${col.field}`)}))}togglePivotRowGroup(key){const next=new Set(this.pivotCollapsedRowGroups);if(next.has(key))next.delete(key);else next.add(key);this.pivotCollapsedRowGroups=next}renderTreeNodeRow(node,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow){const lastPinnedLeft=pinCtx?.lastLeft;const firstPinnedRight=pinCtx?.firstRight;const dataRow=node.row;const active=this.activeCell;const isActiveRow=active!==null&&active.rowIndex===rowIndex;const drag=this.rowDragDropClass(rowIndex);return index.h("div",{class:{"sy-grid__row":true,"sy-grid__tree-row":true,"sy-grid__tree-row--filler":node.filler,"sy-grid__tree-row--collapsed":node.hasChildren&&!node.expanded,"sy-grid__row--active":isActiveRow,"sy-grid__row--drag-source":drag.dragging,"sy-grid__row--drop-above":drag.above,"sy-grid__row--drop-below":drag.below,"sy-grid__row--drop-into":drag.into},role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"aria-level":node.depth+1,"aria-expanded":node.hasChildren?node.expanded?"true":"false":void 0,"data-row-index":rowIndex,"data-tree-key":node.key,"data-tree-depth":node.depth,style:{height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`}},renderCheckboxCol&&index.h("div",{class:{"sy-grid__cell":true,"sy-grid__cell--selection":true,"sy-grid__cell--pinned-left":pinCtx?.left!=null},role:"gridcell",style:pinCtx?.left!=null?{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,position:"sticky",left:"0px",zIndex:"1"}:{width:`${SELECTION_CHECKBOX_COLUMN.width}px`}},this.ssrmGroupCheckAttrs(node.key)),cols.map((col,colIndex)=>{if(colWindow&&colWindow.culled(colIndex))return null;const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"1","body");let content;if(colIndex===0){content=[node.filler?null:this.renderRowDragHandle(rowIndex,col),index.h("span",{class:"sy-grid__tree-indent",style:{width:`${node.depth*16}px`}}),node.hasChildren?index.h("button",{type:"button",class:"sy-grid__tree-toggle","aria-expanded":node.expanded?"true":"false","aria-label":node.label,disabled:this.effectiveLoading},node.expanded?"⏷":"⏵"):index.h("span",{class:"sy-grid__tree-toggle-spacer"}),index.h("span",{class:"sy-grid__tree-label"},node.label),node.hasChildren&&node.leafCount>=0?index.h("span",{class:"sy-grid__tree-count"},"(",node.leafCount.toLocaleString(),")"):null]}else if(dataRow!==null){const resolvedColId=col.colId??col.field;const value=this.applyReadMask(this.resolveGridCellValue({row:dataRow,rowIndex,colId:resolvedColId,field:col.field,valueGetter:col.valueGetter,colDef:col}),dataRow,rowIndex,col);const rendered=this.renderCellContent(rowIndex,colIndex,col,dataRow,value);content=rendered!==null?rendered:col.valueFormatter!==void 0&&col.valueFormatter!==null?this.formatGridCellValue({value,row:dataRow,rowIndex,colId:resolvedColId,valueFormatter:col.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef:col}):value==null?"":String(value)}else{content=""}const isActiveCell=isActiveRow&&active!==null&&active.colIndex===colIndex;const rendererPresentation=this.rendererPresentationAt(rowIndex,colIndex);const cellNode=index.h("div",{key:col.field,class:{"sy-grid__cell":true,"sy-grid__tree-cell":colIndex===0,"sy-grid__cell--active":isActiveCell,"sy-grid__cell--pinned-left":pin.pinnedLeft,"sy-grid__cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__cell--pinned-right":pin.pinnedRight,"sy-grid__cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight,...this.rendererPresentationClasses(rendererPresentation)},...gridCellAttrs({colIndex:colIndex+(renderCheckboxCol?1:0),isActive:isActiveCell}),id:isActiveCell?SY_GRID_ACTIVE_CELL_ID:void 0,"data-field":col.field,"data-col-index":colIndex,title:rendererPresentation?.title,style:cellStyle},content);return this.withColumnSpacers(cellNode,colIndex,colWindow,`tn-${node.key}-${col.field}`)}))}handleTreeCellClick(event,node,rowIndex,colIndex,col){const target=event.target;if(target?.closest?.(".sy-grid__tree-toggle"))return;this.commitActiveCell({rowIndex,colIndex});if(node.row!==null){this.cellClicked.emit({row:node.row,rowIndex,colIndex,field:col.field})}}renderDetailToggle(row){const id=this.detailRowIds.get(row);if(id===void 0)return null;const expanded=this.expandedDetailRows.has(id);return index.h("button",{type:"button",class:"sy-grid__detail-toggle","aria-expanded":expanded?"true":"false","aria-label":t(this.resolvedMessages,"detail.toggleLabel",{id:String(id)}),disabled:this.effectiveLoading},expanded?"⏷":"⏵")}detailRendererWarned=false;renderDetailContent(detail){const master=detail.master;const renderer=this.detailCellRenderer;if(typeof renderer==="function"){let output=null;let threw=false;try{output=renderer({row:master,rowId:detail.forId})}catch(err){threw=true;if(!this.detailRendererWarned){this.detailRendererWarned=true;console.warn("[detailCellRenderer] error; shell fallback:",err)}}if(!threw){const normalized=normalizeRenderOutput(output);if(normalized.kind==="text"){return index.h("div",{class:`sy-grid__detail-custom ${normalized.class}`},normalized.text)}if(normalized.kind==="html"){return index.h("div",{class:`sy-grid__detail-custom ${normalized.class}`,innerHTML:normalized.html})}if(normalized.kind==="vnode"){return normalized.vnode}if(!this.detailRendererWarned){this.detailRendererWarned=true;console.warn("[detailCellRenderer] bad shape; shell fallback")}}}if(this.detailGridOptions&&typeof this.getDetailRowData==="function"&&this.detailNestingLevel<MAX_DETAIL_NESTING){return this.renderDetailGrid(detail,this.detailGridOptions)}const entries=Object.entries(master).filter(([,v])=>typeof v!=="object"||v===null);return index.h("div",{class:"sy-grid__detail-shell"},index.h("dl",{class:"sy-grid__detail-fields"},entries.map(([key,value])=>[index.h("dt",null,key),index.h("dd",null,value===null||value===void 0?"—":String(value))])))}renderDetailGrid(detail,opts){return index.h("sy-grid",{key:`detail-grid-${detail.forId}`,class:"sy-grid__detail-grid",ref:el=>{if(el)this.configureDetailGrid(el,detail,opts)}})}configureDetailGrid(el,detail,opts){const{rows,loading}=this.resolveDetailChildRows(detail);const child=el;child.columnDefs=opts.columnDefs;child.rowData=rows;child.loading=loading;child.height=opts.height??"200px";child.masterDetail=opts.masterDetail===true;child.getDetailRowData=opts.getDetailRowData;child.detailGridOptions=opts.detailGridOptions;child.detailNestingLevel=this.detailNestingLevel+1;if(opts.detailRowHeight!==void 0)child.detailRowHeight=opts.detailRowHeight;child.pagination=opts.pagination===true;if(opts.pageSize!==void 0)child.pageSize=opts.pageSize;child.formulas=opts.formulas===true;if(opts.showFormulas!==void 0)child.showFormulas=opts.showFormulas}resolveDetailChildRows(detail){const forId=detail.forId;const cached=this.detailRowDataCache.get(forId);if(cached!==void 0)return{rows:cached,loading:false};if(this.detailRowLoading.has(forId))return{rows:[],loading:true};if(!this.proWorkAllowed("grid.master-detail","getDetailRowData"))return{rows:[],loading:false};let result;try{result=this.getDetailRowData({row:detail.master,rowId:forId})}catch(err){this.warnDetailData(err);this.detailRowDataCache.set(forId,[]);return{rows:[],loading:false}}if(result!==null&&typeof result.then==="function"){const token=++this.detailFetchToken;this.detailRowLoading.set(forId,token);Promise.resolve(result).then(rows2=>this.settleDetailRows(forId,Array.isArray(rows2)?rows2:[],token),err=>{this.warnDetailData(err);this.settleDetailRows(forId,[],token)});return{rows:[],loading:true}}const rows=Array.isArray(result)?result:[];this.detailRowDataCache.set(forId,rows);return{rows,loading:false}}settleDetailRows(forId,rows,token){if(this.detailRowLoading.get(forId)!==token)return;this.detailRowLoading.delete(forId);if(!this.mountedDetailIds.has(forId)&&!(this.expandedDetailRows.has(forId)&&this.lastMasterIds.has(forId)))return;this.detailRowDataCache.set(forId,rows);this.detailDataVersion++}warnDetailData(err){if(this.detailGridDataWarned)return;this.detailGridDataWarned=true;console.warn("[SG:DETAIL] getDetailRowData failed; empty grid:",err)}detailRowDataCache=new Map;detailRowLoading=new Map;detailFetchToken=0;detailDataVersion=0;detailGridDataWarned=false;renderPinnedBand(section){const facade=this.pinnedRowsFacade;if(facade===null)return null;const rows=facade.rows(section);if(rows.length===0)return null;const uniform=this.uniformRowHeight();const totalWidth=this.totalColumnsWidthPx();const cellHost=this.pinnedBandCellHost();this.renderingPinnedBand=section;try{return index.h("div",{class:{"sy-grid__pinned-band":true,[`sy-grid__pinned-band--${section}`]:true},...bodyRowGroupAttrs(),tabindex:-1,"data-pinned-band":section,"data-pinned-count":rows.length,onKeyDown:this.handlePinnedBandKeyDown,onClick:this.handlePinnedBandClick,onFocusout:this.handlePinnedBandFocusOut},index.h("div",{class:"sy-grid__pinned-clip"},index.h("div",{class:"sy-grid__pinned-window",style:{minWidth:totalWidth>0?`${totalWidth}px`:void 0}},rows.map((pinned,sectionIndex)=>this.renderPinnedBandRow(pinned.data,pinned.id,section,sectionIndex,uniform,cellHost)))))}finally{this.renderingPinnedBand=null}}pinnedBandCellHost(){const locale=typeof this.locale==="string"?this.locale:"en";const colIdOf=col=>col.colId??col.field;const valueOf=(row,sectionIndex,col)=>this.resolveGridCellValue({row,rowIndex:sectionIndex,colId:colIdOf(col),field:col.field,valueGetter:col.valueGetter,colDef:col});return{rawValue:valueOf,readable:(raw,row,sectionIndex,col)=>!this.readPolicyConfigured()||this.isCellReadable(raw,row,sectionIndex,col),maskedValue:this.maskedCellValue,maskedRow:(row,sectionIndex)=>this.readPolicyConfigured()?this.maskDeniedFields(row,sectionIndex,this.resolvedColumnDefs()):row,value:valueOf,format:(value,row,sectionIndex,col)=>this.formatGridCellValue({value,row,rowIndex:sectionIndex,colId:colIdOf(col),valueFormatter:col.valueFormatter,locale,colDef:col}),classRules:(value,formatted,row,sectionIndex,col)=>applyCellClassRules({value,formatted,row,rowIndex:sectionIndex,colId:col.field,cellClassRules:col.cellClassRules,cellClass:col.cellClass,colDef:col,context:this.context,api:this.host}),styleRules:(value,formatted,row,sectionIndex,col)=>applyCellStyle({value,formatted,row,rowIndex:sectionIndex,colId:col.field,cellStyle:col.cellStyle,colDef:col,context:this.context,api:this.host}).style}}renderPinnedBandRow(row,id,section,sectionIndex,rowHeightPx,cellHost){const chunk=this.rowLayoutChunk;const cols=this.effectiveColumns();const renderCheckboxCol=this.shouldRenderCheckboxColumn();const checkboxOffset=renderCheckboxCol?SELECTION_CHECKBOX_COLUMN.width:0;const pinCtx=this.pinnedOffsetsContext(cols,checkboxOffset);const columnOffset=renderCheckboxCol?1:0;const focus=this.pinnedFocus;const isFocusRow=focus!==null&&focus.band===section&&focus.sectionIndex===sectionIndex;return index.h("div",{key:`pinned-${section}-${String(id)}`,class:{"sy-grid__row":true,"sy-grid__row--pinned":true,[`sy-grid__row--pinned-${section}`]:true,"sy-grid__row--odd":sectionIndex%2===1,"sy-grid__row--even":sectionIndex%2===0,"sy-grid__row--active":isFocusRow},...bodyRowAttrs(sectionIndex,{isSelected:void 0,headerOffset:section==="top"?this.headerGroupDepth():this.headerGroupDepth()+this.pinnedTopCount()+this.getDisplayRows().length}),"data-pinned-row-index":sectionIndex,"data-pinned-row-id":String(id),"data-pinned-section":section,style:{height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`}},renderCheckboxCol&&index.h("div",{class:"sy-grid__cell sy-grid__cell--checkbox sy-grid__cell--pinned-band-blank",role:"gridcell","aria-colindex":1,style:{width:`${SELECTION_CHECKBOX_COLUMN.width}px`,flex:`0 0 ${SELECTION_CHECKBOX_COLUMN.width}px`}}),cols.map((col,colIndex)=>{const cellStyle=this.columnLayoutStyle(col);const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,"1","body");const paint=chunk.paintPinnedBandCell(cellHost,row,sectionIndex,col);for(const[key,cssValue]of Object.entries(paint.style))cellStyle[key]=cssValue;const isFocusCell=isFocusRow&&focus!==null&&focus.colIndex===colIndex;return index.h("div",{key:col.field,class:{"sy-grid__cell":true,"sy-grid__cell--pinned-band":true,"sy-grid__cell--active":isFocusCell,"sy-grid__cell--pinned-left":pin.pinnedLeft,"sy-grid__cell--pinned-right":pin.pinnedRight,...paint.classes},...gridCellAttrs({colIndex:colIndex+columnOffset,isActive:isFocusCell}),id:isFocusCell?SY_GRID_ACTIVE_CELL_ID:void 0,"aria-selected":isFocusCell?"true":void 0,"data-field":col.field,"data-col-index":colIndex,style:Object.keys(cellStyle).length>0?cellStyle:void 0},paint.display)}))}renderDetailRow(detail,rowIndex){const heightPx=this.detailRowHeightPx();const colCount=this.renderedColumnCount();const totalWidth=this.totalColumnsWidthPx();return index.h("div",{class:"sy-grid__row sy-grid__detail-row",role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"data-row-index":rowIndex,"data-detail-for":String(detail.forId),style:{height:`${heightPx}px`,lineHeight:"normal",...totalWidth!==null?{width:`${totalWidth}px`}:{}}},index.h("div",{class:"sy-grid__detail-cell",role:"gridcell","aria-colindex":1,"aria-colspan":colCount,style:totalWidth!==null&&this.viewportSize!==null?{width:`${Math.min(totalWidth,this.viewportSize.width)}px`,flex:`0 0 ${Math.min(totalWidth,this.viewportSize.width)}px`}:void 0},this.renderDetailContent(detail)))}renderLoadingRow(row,rowIndex,rowHeightPx,columnCount){const failed=row.status==="failed";const retryLabel=t(this.resolvedMessages,"rowModel.retry");const loadingLabel=t(this.resolvedMessages,"rowModel.loadingRow");return index.h("div",{class:{"sy-grid__row":true,"sy-grid__row--loading":true,"sy-grid__row--loading-failed":failed},role:"row","aria-rowindex":this.bodyAriaRowIndex(rowIndex),"aria-busy":failed?"false":"true","data-row-index":rowIndex,"data-loading-status":row.status,style:{height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`}},index.h("div",{class:"sy-grid__cell sy-grid__loading-cell",role:"gridcell","aria-colspan":String(Math.max(1,columnCount))},failed?index.h("span",{class:"sy-grid__loading-failed-msg"},index.h("span",{class:"sy-grid__loading-failed-icon","aria-hidden":"true"},"⚠"),index.h("button",{type:"button",class:"sy-grid__loading-retry"},retryLabel)):index.h("span",{class:"sy-grid__skeleton","aria-label":loadingLabel,role:"img"},index.h("span",{class:"sy-grid__skeleton-bar"}))))}renderRow(row,rowIndex,rowHeightPx){const cols=this.effectiveColumns();const active=this.activeCell;const renderCheckboxCol=this.shouldRenderCheckboxColumn();const checkboxOffset=renderCheckboxCol?SELECTION_CHECKBOX_COLUMN.width:0;const pinCtx=this.pinnedOffsetsContext(cols,checkboxOffset);const lastPinnedLeft=pinCtx?.lastLeft;const firstPinnedRight=pinCtx?.firstRight;const colWindow=this.columnWindowContext(cols,checkboxOffset);const rowCommentId=this.cellCommentIndex.size>0||this.conflictFlashCells.size>0?this.collabRowId(row,rowIndex):null;if(isGroupMarkerRow(row)){return this.renderGroupRow(row,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow)}if(isGroupFooterRow(row)){return this.renderGroupFooterRow(row,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow)}if(isTreeNodeRow(row)){return this.renderTreeNodeRow(row,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow)}if(isDetailRow(row)){return this.renderDetailRow(row,rowIndex)}if(isLoadingPlaceholderRow(row)){return this.renderLoadingRow(row,rowIndex,rowHeightPx,cols.length+(renderCheckboxCol?1:0))}if(isPivotRowGroupMarker(row)||isPivotGrandTotalRow(row)||this.isPivotSubtotalDisplayRow(row)){return this.renderPivotRow(row,rowIndex,rowHeightPx,cols,renderCheckboxCol,pinCtx,colWindow)}const fullWidthEntry=this.fullWidthEntryAt(rowIndex);if(fullWidthEntry!==null){return this.renderFullWidthRow(row,rowIndex,fullWidthEntry,rowHeightPx)}const columnOffset=renderCheckboxCol?1:0;const spanFrame=this.rowLayoutFrame!==null&&this.rowLayoutFrame.configured&&this.rowLayoutFrame.covers(rowIndex)?this.rowLayoutFrame:null;const isActiveRow=active!==null&&active.rowIndex===rowIndex;const selectionMode=this.selectionState.mode;let isSelectedRow;let rowId;if(selectionMode!=="none"){rowId=this.extractRowId(row,rowIndex);isSelectedRow=rowId!==void 0&&this.selectionState.selectedRowIds.has(rowId)}let isHoveredRow=false;if(this.rowHover!=="off"){const hoverId=rowId!==void 0?rowId:this.extractRowId(row,rowIndex);isHoveredRow=hoverId!==void 0&&this.hoverState.hoveredRowId===hoverId}const autoHeight=this.autoHeightRenderMode;const style=autoHeight?{minHeight:`${rowHeightPx}px`}:{height:`${rowHeightPx}px`,lineHeight:`${rowHeightPx}px`};const masterId=this.masterDetailActive()?this.detailRowIds.get(row):void 0;const drag=this.rowDragDropClass(rowIndex);const callbackRow=this.readPolicyConfigured()?this.maskDeniedFields(row,rowIndex,this.resolvedColumnDefs()):row;return index.h("div",{class:{"sy-grid__row":true,"sy-grid__row--odd":rowIndex%2===1,"sy-grid__row--even":rowIndex%2===0,"sy-grid__row--auto-height":autoHeight,"sy-grid__row--active":isActiveRow,"sy-grid__row--selected":isSelectedRow===true,"sy-grid__row--hovered":this.rowHover==="stateful"&&isHoveredRow,"sy-grid__row--drag-source":drag.dragging,"sy-grid__row--drop-above":drag.above,"sy-grid__row--drop-below":drag.below,"sy-grid__row--drop-into":drag.into},...bodyRowAttrs(rowIndex,{isSelected:isSelectedRow,headerOffset:this.headerGroupDepth()+this.pinnedTopCount()}),"aria-expanded":masterId!==void 0?this.expandedDetailRows.has(masterId)?"true":"false":void 0,"data-row-index":rowIndex,"data-selected":isSelectedRow===true?"true":void 0,"data-hovered":isHoveredRow?"true":void 0,style},renderCheckboxCol&&this.renderBodyCheckboxCell(isSelectedRow===true,pinCtx?.left!=null),cols.map((col,colIndex)=>{const spanCell=spanFrame!==null?spanFrame.cellAt(rowIndex,colIndex):null;if(spanCell!==null&&spanCell.kind==="covered"){if(spanCell.origin.rowIndex!==rowIndex){return this.withColumnSpacers(index.h("div",{key:`cover-${String(col.field)}`,class:"sy-grid__col-spacer sy-grid__span-cover","aria-hidden":"true","data-span-cover-field":col.field,"data-span-origin-row":spanCell.origin.rowIndex,style:this.columnLayoutStyle(col)}),colIndex,colWindow,`b-${rowIndex}-${String(col.field)}`)}return null}if(colWindow&&spanCell===null&&colWindow.culled(colIndex))return null;const cellStyle=this.columnLayoutStyle(col);const spanOrigin=spanCell!==null&&spanCell.kind==="origin"?spanCell:null;if(spanOrigin!==null){if(spanOrigin.rowSpan>1&&spanOrigin.heightPx!==null){cellStyle.height=`${spanOrigin.heightPx}px`;cellStyle.lineHeight=`${rowHeightPx}px`}if(spanOrigin.colSpan>1){if(spanOrigin.widthPx!==null){cellStyle.width=`${spanOrigin.widthPx}px`;cellStyle.flex=`0 0 ${spanOrigin.widthPx}px`}else if(spanOrigin.flexGrow!==null){delete cellStyle.width;cellStyle.flex=`${spanOrigin.flexGrow} 1 0`}delete cellStyle.maxWidth}}const pin=this.applyPinnedStyle(col,cellStyle,pinCtx,spanFrame!==null?"2":"1","body");if(spanOrigin!==null&&!pin.pinnedLeft&&!pin.pinnedRight)cellStyle.zIndex="1";const showResizeHandle=this.resizableColumns===true&&col.resizable!==false;const resolvedColId=col.colId??col.field;const rawValue=this.resolveGridCellValue({row,rowIndex,colId:resolvedColId,field:col.field,valueGetter:col.valueGetter,colDef:col});const cellReadable=!this.readPolicyConfigured()||this.isCellReadable(rawValue,row,rowIndex,col);let value=cellReadable?this.resolveGridCellValue({row:callbackRow,rowIndex,colId:resolvedColId,field:col.field,valueGetter:col.valueGetter,colDef:col}):this.maskedCellValue;let formulaText=null;let formulaTitle;let formulaError=null;if(cellReadable&&this.formulaSheet!==null&&this.formulaSheet.isCalculatedField(col.field)){formulaText=col.formula??"";const computed=this.formulaSheet.calculatedDisplay(col.field,row);formulaError=this.formulaCore?.formulaErrorInfo(computed)??null;formulaTitle=formulaError!==null?`${formulaText} → ${formulaError.type} — ${formulaError.description}`:`${formulaText} = ${computed===null||computed===void 0?"":computed} (calculated column)`;value=this.showFormulas===true?formulaText:computed}else if(cellReadable&&this.formulaSheetSeeding&&isFormulaText(value)&&(this.formulaSheet===null||!this.formulaSheet.canRevealDuringSeed(value,row))){formulaText=value;value=this.showFormulas===true?value:""}else if(cellReadable&&this.formulaSheet!==null&&(this.formulaSheet.active||this.formulaSheetSeeding)&&isFormulaText(value)){formulaText=value;const computed=this.formulaCellDisplay(this.formulaSheet,value,col.field,row);formulaError=this.formulaCore?.formulaErrorInfo(computed)??null;formulaTitle=formulaError!==null?`${value} → ${formulaError.type} — ${formulaError.description}`:`${value} = ${computed===null||computed===void 0?"":computed}`;value=this.showFormulas===true?value:computed}const rendered=this.renderCellContent(rowIndex,colIndex,col,row,value,callbackRow);const display=rendered!==null?rendered:col.valueFormatter!==void 0&&col.valueFormatter!==null?this.formatGridCellValue({value,row:callbackRow,rowIndex,colId:resolvedColId,valueFormatter:col.valueFormatter,locale:typeof this.locale==="string"?this.locale:"en",colDef:col}):value==null?"":String(value);const isActiveCell=isActiveRow&&active!==null&&active.colIndex===colIndex;const field=col.field;const rendererPresentation=this.rendererPresentationAt(rowIndex,colIndex);const editor=this.renderEditorForCell(rowIndex,colIndex,col);const customCellClasses=applyCellClassRules({value,formatted:typeof display==="string"?display:void 0,row:callbackRow,rowIndex,colId:col.field,cellClassRules:col.cellClassRules,cellClass:col.cellClass,colDef:col,context:this.context,api:this.host});const columnCellStyleResult=applyCellStyle({value,formatted:typeof display==="string"?display:void 0,row:callbackRow,rowIndex,colId:col.field,cellStyle:col.cellStyle,colDef:col,context:this.context,api:this.host});if(columnCellStyleResult.meta.appliedKeys>0){const userStyle=columnCellStyleResult.style;const userKeys=Object.keys(userStyle);for(let k=0;k<userKeys.length;k++){cellStyle[userKeys[k]]=userStyle[userKeys[k]]}}if(this.conditionalFormats!==void 0&&this.conditionalFormats.length>0){const cfCss=resolveConditionalFormatCss(this.conditionalFormats,{field:col.field,value});const cfKeys=Object.keys(cfCss);for(let k=0;k<cfKeys.length;k++){cellStyle[cfKeys[k]]=cfCss[cfKeys[k]]}}const commentBadge=this.cellCommentBadgeFor(rowCommentId,field);const validation=cellReadable?this.validateCell(row,rowIndex,col):{valid:true};const bodyCellNode=index.h("div",{key:field,class:{"sy-grid__cell":true,"sy-grid__cell--invalid":!validation.valid,"sy-grid__cell--active":isActiveCell,"sy-grid__cell--editing":editor!==null,"sy-grid__cell--formula":formulaText!==null,"sy-grid__cell--formula-error":formulaError!==null,"sy-grid__cell--commented":commentBadge!==null,"sy-grid__cell--commented-resolved":commentBadge!==null&&!commentBadge.unresolved,"sy-grid__cell--conflict-flash":rowCommentId!==null&&this.conflictFlashCells.size>0&&this.conflictFlashCells.has(this.commentIndexKey(rowCommentId,field)),"sy-grid__cell--wrap":col.wrapText===true||col.autoHeight===true,"sy-grid__cell--flash":this.cellChangeFlashActive()&&hasFlash(this.flashingCells,cellFlashKey(rowIndex,field)),"sy-grid__cell--pinned-left":pin.pinnedLeft,"sy-grid__cell--pinned-left-last":pin.pinnedLeft&&col.field===lastPinnedLeft,"sy-grid__cell--pinned-right":pin.pinnedRight,"sy-grid__cell--pinned-right-first":pin.pinnedRight&&col.field===firstPinnedRight,"sy-grid__cell--row-span":spanOrigin!==null&&spanOrigin.rowSpan>1,"sy-grid__cell--col-span":spanOrigin!==null&&spanOrigin.colSpan>1,...this.rangeSelectionActive()?this.rangeCellClasses(rowIndex,colIndex):{},...this.fillPreview!==null?this.fillPreviewClasses(rowIndex,colIndex):{},...customCellClasses.length>0?customCellClasses.split(" ").reduce((acc,cls)=>{acc[cls]=true;return acc},{}):{},...this.rendererPresentationClasses(rendererPresentation)},title:validation.valid?rendererPresentation?.title??formulaTitle:validation.message,"data-formula":formulaText!==null?formulaText:void 0,"data-invalid":validation.valid?void 0:"true","data-validation-message":validation.valid?void 0:validation.message,"aria-invalid":validation.valid?void 0:"true",...gridCellAttrs({colIndex:colIndex+columnOffset,isActive:isActiveCell}),"aria-rowspan":spanOrigin!==null&&spanOrigin.rowSpan>1?spanOrigin.rowSpan:void 0,"aria-colspan":spanOrigin!==null&&spanOrigin.colSpan>1?spanOrigin.colSpan:void 0,"data-row-span":spanOrigin!==null&&spanOrigin.rowSpan>1?spanOrigin.rowSpan:void 0,"data-col-span":spanOrigin!==null&&spanOrigin.colSpan>1?spanOrigin.colSpan:void 0,id:isActiveCell?SY_GRID_ACTIVE_CELL_ID:void 0,"data-field":field,"data-col-index":colIndex,"aria-selected":isActiveCell?"true":void 0,"aria-describedby":this.cellTooltip!==null&&this.cellTooltip.rowIndex===rowIndex&&this.cellTooltip.field===field?SY_GRID_TOOLTIP_ID:void 0,style:Object.keys(cellStyle).length>0?cellStyle:void 0},colIndex===0&&this.masterDetailActive()&&this.renderDetailToggle(row),this.renderRowDragHandle(rowIndex,col),editor!==null?editor:this.find&&this.proUiChunks["pro-panels"]?this.proUiChunks["pro-panels"].highlightFindCell(this.findHost(),rowIndex,field,display):display,this.fillHandleActive()&&this.renderFillHandle(rowIndex,colIndex),showResizeHandle&&index.h("span",{class:"sy-grid__col-resize-handle sy-grid__col-resize-handle--body","aria-hidden":"true","data-field":field,onPointerDown:event=>this.handleColumnResizePointerDown(event,field),onPointerEnter:event=>this.showColumnResizeGuide(field,event.currentTarget),onPointerLeave:()=>this.hideColumnResizeGuide(field),onPointerMove:event=>this.handleColumnResizePointerMove(event),onPointerUp:event=>this.handleColumnResizePointerUp(event),onPointerCancel:event=>this.handleColumnResizePointerCancel(event),onClick:event=>event.stopPropagation()}));return this.withColumnSpacers(bodyCellNode,colIndex,colWindow,`b-${rowIndex}-${String(field)}`)}))}renderColumnDefsBody(){this.cellRendererWarnedFields.clear();const rows=this.getDisplayRows();const totalRows=rows.length;const rowHeightFn=this.rowHeightFn;const uniform=this.uniformRowHeight();this.autoHeightRenderMode=this.autoHeightActive();const viewportHeight=this.estimatedViewportHeight();const cachedWinValid=this.virtualWindow!==null&&this.virtualWindowRowCount===totalRows&&this.virtualWindowViewportHeight===viewportHeight&&this.virtualWindowDetailSet===this.expandedDetailRows;const win=this.virtualScroll?cachedWinValid?this.virtualWindow:this.computeVirtualWindowForRows(rows,viewportHeight,RENDER_OVERSCAN):null;this.rowLayoutFrame=this.buildRowLayoutFrame(rows,win===null?{startIndex:0,endIndex:totalRows}:{startIndex:win.startIndex,endIndex:win.endIndex},uniform,rowHeightFn);const spanFrame=this.rowLayoutFrame;const viewportInlineStyle={["--sy-grid-row-height"]:`${uniform}px`};const navEnabled=this.keyboardNavigation!==false;const viewportTabIndex=navEnabled?0:void 0;const activeCellRendered=this.activeCell!==null&&(!this.virtualScroll||win===null||this.activeCell.rowIndex>=win.startIndex&&this.activeCell.rowIndex<win.endIndex);const viewportActiveDescendant=navEnabled&&activeCellRendered?SY_GRID_ACTIVE_CELL_ID:void 0;const viewportPaste=navEnabled?this.handleViewportPaste:void 0;const viewportClass={"sy-grid__viewport":true,"sy-grid__viewport--active-cell":this.activeCell!==null,"sy-grid__viewport--range-dragging":this.rangeState.dragging!==null};if(!this.virtualScroll||win===null||totalRows===0){return index.h("div",{class:viewportClass,...bodyRowGroupAttrs(),style:viewportInlineStyle,tabindex:viewportTabIndex,"aria-activedescendant":viewportActiveDescendant,onKeyDown:this.handleViewportKeyDown,onPaste:viewportPaste,onMouseDown:this.handleViewportMouseDown,onClick:this.handleViewportClick,onContextMenu:this.handleViewportContextMenu,onMouseOver:this.handleViewportHover,onMouseOut:this.handleViewportHover,onFocusin:this.handleViewportFocus,onFocusout:this.handleViewportFocus},index.h("div",{class:"sy-grid__row-window sy-grid__row-window--flat"},rows.map((row,idx)=>{const h=typeof rowHeightFn==="function"?this.rowHeightForIndex(rowHeightFn,idx,row,uniform):uniform;return this.renderRow(row,idx,h)})))}const renderStart=spanFrame!==null&&spanFrame.configured?spanFrame.renderRange.startIndex:win.startIndex;const renderEnd=spanFrame!==null&&spanFrame.configured?spanFrame.renderRange.endIndex:win.endIndex;this.lastBodyRenderWindow={startIndex:renderStart,endIndex:renderEnd};const visibleRows=rows.slice(renderStart,renderEnd);const totalHeight=win.totalHeight;let paddingTop=win.paddingTop;let paddingBottom=win.paddingBottom;if(spanFrame!==null&&spanFrame.configured&&this.rowLayoutChunk!==null){const widened=this.rowLayoutChunk.widenedPadding(this.rowLayoutHostView(rows,uniform,rowHeightFn),spanFrame);paddingTop=Math.max(0,paddingTop-widened.top);paddingBottom=Math.max(0,paddingBottom-widened.bottom)}return index.h("div",{class:viewportClass,...bodyRowGroupAttrs(),style:viewportInlineStyle,tabindex:viewportTabIndex,"aria-activedescendant":viewportActiveDescendant,onKeyDown:this.handleViewportKeyDown,onPaste:viewportPaste,onMouseDown:this.handleViewportMouseDown,onClick:this.handleViewportClick,onContextMenu:this.handleViewportContextMenu,onMouseOver:this.handleViewportHover,onMouseOut:this.handleViewportHover,onFocusin:this.handleViewportFocus,onFocusout:this.handleViewportFocus},index.h("div",{class:"sy-grid__row-spacer",style:{height:`${totalHeight}px`,paddingTop:`${paddingTop}px`,paddingBottom:`${paddingBottom}px`}},index.h("div",{class:"sy-grid__row-window"},visibleRows.map((row,idx)=>{const absoluteIndex=renderStart+idx;const h=typeof rowHeightFn==="function"?this.rowHeightForIndex(rowHeightFn,absoluteIndex,row,uniform):uniform;return this.renderRow(row,absoluteIndex,h)}))))}startColumnReorderPreview(colId,headerEl,clientX,clientY){this.removeColumnReorderPreview();if(typeof document==="undefined"||!document.body||!headerEl||typeof headerEl.getBoundingClientRect!=="function"){return}const rect=headerEl.getBoundingClientRect();this.columnReorderPointerOffsetX=clientX-rect.left;this.columnReorderPointerOffsetY=clientY-rect.top;this.columnReorderPointerToRightEdge=Math.max(0,rect.right-clientX);const col=this.resolvedColumnDefs().find(c=>c.field===colId);const label=col?.headerName??col?.field??colId;const computed=typeof getComputedStyle==="function"?getComputedStyle(headerEl):null;const preview=document.createElement("div");preview.className="sy-grid__column-reorder-preview";preview.setAttribute("aria-hidden","true");preview.dataset.field=colId;preview.textContent=label;const padding=computed!==null?`${computed.paddingTop} ${computed.paddingRight} ${computed.paddingBottom} ${computed.paddingLeft}`:"6px 12px";Object.assign(preview.style,{position:"fixed",left:`${rect.left}px`,top:`${rect.top}px`,width:`${rect.width}px`,height:`${rect.height}px`,display:"flex",alignItems:"center",boxSizing:"border-box",padding,border:"1px solid var(--sy-color-primary, #2563eb)",borderRadius:"4px",background:computed?.backgroundColor||"#f9fafb",color:computed?.color||"#111827",boxShadow:"0 8px 24px rgba(15, 23, 42, 0.18)",fontSize:computed?.fontSize||"13px",fontWeight:computed?.fontWeight||"600",opacity:"0.92",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",zIndex:"2147483647"});document.body.appendChild(preview);this.columnReorderPreviewEl=preview}updateColumnReorderPreview(clientX,clientY){const preview=this.columnReorderPreviewEl;if(preview===null)return;preview.style.left=`${clientX-this.columnReorderPointerOffsetX}px`;preview.style.top=`${clientY-this.columnReorderPointerOffsetY}px`}removeColumnReorderPreview(){const preview=this.columnReorderPreviewEl;if(preview!==null){preview.remove();this.columnReorderPreviewEl=null}}renderColumnResizeGuide(){const guide=this.columnResizeGuide;if(guide===null)return null;const left=Math.max(0,guide.x-1);return index.h("div",{class:"sy-grid__column-resize-guide","data-field":guide.colId,"aria-hidden":"true",style:{left:`${left}px`}})}safeRowHeightSample(raw,fallback){if(typeof raw!=="number"||!Number.isFinite(raw)||raw<=0)return fallback;return raw}renderToolbar(){const showQuickFilter=this.shouldRenderQuickFilterToolbar();const showCfButton=this.conditionalFormatUi===true;if(!showQuickFilter&&this.csvImport!==true&&!showCfButton)return null;const value=this.quickFilterValue;const hasValue=value!=="";const locked=this.effectiveLoading;const messages=this.resolvedMessages;return index.h("div",{class:"sy-grid__toolbar",role:"search"},showCfButton&&index.h("button",{type:"button",class:{"sy-grid__toolbar-button":true,"sy-grid__toolbar-button--active":this.cfBuilderOpen},"aria-pressed":this.cfBuilderOpen?"true":"false","data-cf-open":true,onClick:this.toggleCfBuilder},"조건부 서식"),this.csvImport===true&&index.h("div",{class:"sy-grid__toolbar-import"},index.h("button",{type:"button",class:"sy-grid__toolbar-button",disabled:locked,onClick:this.openCsvFilePicker,ref:el=>{this.csvImportButtonEl=el??null}},messages["csvImport.button"]),index.h("input",{type:"file",accept:".csv,text/csv",class:"sy-grid__csv-file-input",style:{display:"none"},ref:el=>{this.csvFileInputEl=el},onChange:this.handleCsvFileChosen})),showQuickFilter&&index.h("div",{class:"sy-grid__quick-filter"},index.h("input",{class:"sy-grid__quick-filter-input",type:"search",defaultValue:value,placeholder:this.quickFilterPlaceholder??messages["toolbar.quickFilterPlaceholder"],"aria-label":messages["a11y.quickFilterLabel"],autoComplete:"off",spellcheck:false,readOnly:locked,"aria-disabled":locked?"true":void 0,ref:el=>{this.quickFilterInputEl=el},onInput:this.handleQuickFilterInput,onKeyDown:this.handleQuickFilterKeyDown}),hasValue&&index.h("button",{type:"button",class:"sy-grid__quick-filter-clear","aria-label":messages["toolbar.quickFilterClearAriaLabel"],disabled:locked,onClick:this.handleQuickFilterClear},"✕")))}emptyStateMessage(kind){const messages=this.resolvedMessages;if(kind==="loading")return this.loadingMessage??messages["loading.message"];if(kind==="no-matches")return this.noMatchesMessage??messages["empty.noMatches"];return this.emptyMessage??messages["empty.noData"]}renderEmptyState(kind){if(kind==="none")return null;const isLoading=kind==="loading";const isNoMatches=kind==="no-matches";const messages=this.resolvedMessages;const message=this.emptyStateMessage(kind);const canClearFilters=isNoMatches&&this.hasAnyActiveFilter();return index.h("div",{class:{"sy-grid__empty-state":true,"sy-grid__empty-state--loading":isLoading,"sy-grid__empty-state--no-data":kind==="no-data","sy-grid__empty-state--no-matches":isNoMatches},"data-kind":kind},isLoading?this.renderLoadingSpinner():index.h("span",{class:"sy-grid__empty-state-icon","aria-hidden":"true"},isNoMatches?"🔍":"📭"),index.h("span",{class:"sy-grid__empty-state-message"},message),canClearFilters&&index.h("button",{type:"button",class:"sy-grid__empty-state-action",onClick:this.handleEmptyStateClearFilters},this.clearFiltersLabel??messages["empty.clearFiltersAction"]))}renderEmptyStateLiveRegion(kind){return index.h("div",{class:"sy-grid__empty-state-live",role:"status","aria-live":"polite","aria-busy":kind==="loading"?"true":"false","data-empty-state-live":kind},kind==="none"?"":this.emptyStateMessage(kind))}renderLoadingSpinner(){return index.h("slot",{name:"loading-spinner"},index.h("span",{class:"sy-grid__loading-spinner",role:"presentation","aria-hidden":"true"},[1,2,3,4,5,6,7,8].map(i=>index.h("span",{key:`bar-${i}`,class:`sy-grid__loading-spinner-bar sy-grid__loading-spinner-bar--${i}`}))))}localeDataAttribute(){const locale=this.locale;if(locale==null)return void 0;if(typeof locale==="string"){return locale==="en"||locale==="ko"||locale==="ja"?locale:"en"}if(typeof locale==="object")return"custom";return"en"}render(){this.pendingLifecycleRenderers=new Map;this.componentIdentityIndex=null;this.rendererPresentationsByCoordinate=new Map;const Tag=this.activeTag();const columnDefsMode=this.usingColumnDefsApi();this.auditProDeclarations();if(columnDefsMode)this.armRichSelect();if(columnDefsMode)this.armProUiChunks();if(columnDefsMode)this.armProEngineChunks();const engineMessages=this.resolvedMessages;const columnDefsGridAttrs=columnDefsMode?gridRootAttrs({rowCount:this.getDisplayRows().length+this.pinnedTopCount()+this.pinnedBottomCount()+(this.headerFilterRow?2:1)+this.headerGroupDepth(),colCount:this.renderedColumnCount(),busy:this.effectiveLoading===true,tree:this.treeSurface()!==null}):null;return index.h(index.Host,{key:"c3dc67eb20e2e71748307f5017b4f99480eaebd4",...this.licenseHostAttributes(),"data-theme":themeDataAttribute(this.theme),"data-locale":this.localeDataAttribute(),"data-row-hover-mode":this.rowHover,"data-quick-filter":this.quickFilterValue||void 0,"data-page-index":this.pagination?String(this.activePagination.pageIndex):void 0,"data-page-size":this.pagination?String(this.activePagination.pageSize):void 0,"data-total-rows":this.pagination?String(this.latestPaginatedMeta?.totalRows??0):void 0,"data-focus-region":this.activeCell==null?void 0:this.activeCell.rowIndex<0?"header":"body",class:{"sy-grid--column-defs":columnDefsMode},style:this.hostStyle()},this.renderToolbar(),this.renderFindToolbar(),this.renderNotesToolbar(),this.renderBatchToolbar(),this.proUiChunks["pro-panels"]?.renderColumnMenu(this.columnMenuHost()),columnDefsMode&&this.renderFormulaBar(),columnDefsMode&&this.renderCellFormulaSuggest(),columnDefsMode&&this.conditionBuilder&&this.proAllowed("grid.advanced-filter","conditionBuilder")&&this.renderConditionBuilder(),columnDefsMode?(()=>{const emptyStateKind=this.resolveEmptyStateKind();this.emptyStateOverlayRendered=emptyStateKind!=="none";const bodyEl=index.h("div",{class:"sy-grid__body"},index.h("div",{class:"sy-grid__grid",...columnDefsGridAttrs,"aria-label":this.resolvedMessages["a11y.gridLabel"]},this.renderPivotPanel(),this.renderGroupPanel(),this.renderHeader(),this.renderPinnedBand("top"),this.renderColumnDefsBody(),this.renderPinnedBand("bottom"),this.renderColumnResizeGuide()),this.renderEmptyState(emptyStateKind),this.renderEmptyStateLiveRegion(emptyStateKind),this.renderDragLiveRegions());const sideBarEl=this.renderSideBar();return sideBarEl===null?bodyEl:index.h("div",{class:"sy-grid__main"},bodyEl,sideBarEl)})():[index.h(Tag,{rows:this.engineRows(),columns:this.engineColumns(),"max-rendered":this.maxRendered,messages:engineMessages,selectedRowIds:this.selectionState.mode==="none"?void 0:this.selectionState.selectedRowIds,rowHover:this.rowHover,hoveredRowId:this.hoverState.hoveredRowId,onQueryComplete:this.handleQueryComplete,syidaxAccelerationPort:this.accelerationPort()})],this.renderStatusBar(),this.renderPaginationBar(),this.renderBrand(),this.renderFilterDropdown(),this.renderActiveDateCalendar(),this.richSelect?.renderAutocompleteListbox(this,index.h),this.renderActiveLargeTextEditor(),this.renderConditionalFormatBuilder(),this.renderContextMenu(),this.renderCsvWizard(),this.renderCellTooltip(),columnDefsMode&&this.collabGlue?.renderCommentPanel(this,index.h),this.collabConflictToast!==null&&index.h("div",{key:"25d5149a6f3ef9171c5ba34f5e0d42244741db08",class:{"sy-grid__conflict-toast":true,"sy-grid__conflict-toast--raised":this.pagination===true||this.statusBarSpec()!==null},"data-collab-conflict-toast":true,role:"status"},this.collabConflictToast),index.h("div",{key:"e2ae332f636df8ff6baf6ea71befd92bfdcfb30c",class:"sy-grid__collab-overlay",ref:el=>this.collabOverlayEl=el??null,style:{position:"absolute",inset:"0",overflow:"hidden","pointer-events":"none","z-index":"30"}}),this.fallbackReason&&index.h("span",{key:"f60030fa6875c34ac33ee923d30c1a88b51074ac",class:"sy-grid__watermark",title:this.fallbackReason},this.resolvedMessages["watermark.fallbackToStandard"]))}static get watchers(){return{"auditLog":[{"onAuditLogChange":0}],"auditLogMax":[{"onAuditLogMaxChange":0}],"canReadCell":[{"onCanReadCellChange":0}],"maskedCellValue":[{"onCanReadCellChange":0}],"canEditCell":[{"onCanEditCellChange":0}],"maxSnapshots":[{"onMaxSnapshotsChange":0}],"brandLogo":[{"onBrandLogoChange":0}],"theme":[{"onThemeChanged":0}],"locale":[{"onLocaleChanged":0}],"rowSelection":[{"onRowSelectionModeChanged":0}],"pageSize":[{"onPageSizeChange":0}],"columnDefs":[{"onColumnDefsChanged":0},{"rebuildFormulaSheet":0},{"onVirtualizationInputsChanged":0}],"externalFilter":[{"onExternalFilterInputsChanged":0}],"context":[{"onExternalFilterInputsChanged":0}],"components":[{"onLifecycleComponentDefinitionsChanged":0}],"defaultColDef":[{"onLifecycleComponentDefinitionsChanged":0}],"formulaVersion":[{"onLifecycleComponentDefinitionsChanged":0}],"getRowId":[{"onGetRowIdChanged":0}],"keyboardNavigation":[{"onKeyboardNavigationChanged":0}],"rowData":[{"reEvaluateEngine":0},{"rebuildFormulaSheet":0}],"rows":[{"reEvaluateEngine":0}],"engine":[{"reEvaluateEngine":0}],"proThreshold":[{"reEvaluateEngine":0}],"formulas":[{"rebuildFormulaSheet":0},{"onWorkbookBindingInputsChanged":0}],"workbookId":[{"onWorkbookBindingInputsChanged":0}],"sheetName":[{"onWorkbookBindingInputsChanged":0}],"multiSort":[{"onMultiSortFlagChange":0}],"enableMultiSort":[{"onMultiSortFlagChange":0}],"pivotMode":[{"onPivotConfigChange":0}],"pivotRowGroupColumns":[{"onPivotConfigChange":0}],"pivotColumns":[{"onPivotConfigChange":0}],"pivotValueColumns":[{"onPivotConfigChange":0}],"pivotAggFuncs":[{"onPivotConfigChange":0}],"groupBy":[{"onGroupByChange":0}],"treeIdField":[{"onTreeSurfaceChange":0}],"treeParentField":[{"onTreeSurfaceChange":0}],"quickFilterText":[{"onQuickFilterTextPropChanged":0}],"quickFilter":[{"onQuickFilterConfigChanged":0}],"quickFilterMode":[{"onQuickFilterConfigChanged":0}],"loading":[{"onLoadingChanged":0}],"loadingMode":[{"onLoadingModeChanged":0}],"minLoadingDuration":[{"onMinLoadingDurationChanged":0}],"rangeSelection":[{"onRangeSelectionChange":0}],"rowHover":[{"onRowHoverModeChanged":0}],"virtualScroll":[{"onVirtualizationInputsChanged":0}],"rowHeight":[{"onVirtualizationMetricsChanged":0}],"rowHeightFn":[{"onVirtualizationMetricsChanged":0}],"serverSideDatasource":[{"serverSideDatasourceChanged":0}],"serverSideGroupCols":[{"serverSideGroupColsChanged":0}],"viewportDatasource":[{"viewportDatasourceChanged":0}],"datasource":[{"datasourceChanged":0}],"activeSortModel":[{"infiniteModelInputsChanged":0}],"activeFilters":[{"infiniteModelInputsChanged":0}],"activeConditionTree":[{"infiniteModelInputsChanged":0}],"quickFilterValue":[{"infiniteModelInputsChanged":0}],"collaborationRoom":[{"onCollaborationRoomChange":0}],"enableFillHandle":[{"onEnableFillHandleChanged":0}],"alignedGrids":[{"onAlignedGridsChanged":0}],"isFullWidthRow":[{"onFullWidthConfigChanged":0}],"fullWidthCellRenderer":[{"onFullWidthConfigChanged":0}],"fullWidthRowHeight":[{"onFullWidthConfigChanged":0}],"pinnedTopRowData":[{"onPinnedRowDataChanged":0}],"pinnedBottomRowData":[{"onPinnedRowDataChanged":0}],"sideBar":[{"onSideBarChanged":0}]}}};SyGrid.style=syGridCss();const syGridStandardCss=()=>`.sc-sy-grid-standard-h{display:block;background:var(--sy-grid-bg, var(--background-default, #fff));border:1px solid var(--sy-grid-border, var(--border-default, #e5e7eb));border-radius:4px;overflow:hidden;font-size:var(--sy-grid-cell-font-size, 13px);color:var(--sy-grid-text, var(--text-default, #111827))}.sy-grid__toolbar.sc-sy-grid-standard{display:flex;gap:12px;align-items:center;padding:8px 12px;background:var(--sy-grid-toolbar-bg, var(--sy-grid-bg, #fff));border-bottom:1px solid var(--sy-grid-toolbar-border, var(--border-default, #e5e7eb))}.sy-grid__filter.sc-sy-grid-standard{flex:0 0 200px;padding:4px 8px;background:var(--sy-grid-quick-filter-input-bg, #fff);color:var(--sy-grid-quick-filter-input-color, inherit);border:1px solid var(--sy-grid-quick-filter-input-border, #d1d5db);border-radius:4px;font:inherit}.sy-grid__stat.sc-sy-grid-standard,.sy-grid__truncated.sc-sy-grid-standard{color:var(--sy-grid-text-muted, #6b7280);font-size:12px}.sy-grid__stat.sc-sy-grid-standard{font-variant-numeric:tabular-nums}.sy-grid__scroll.sc-sy-grid-standard{max-height:360px;overflow:auto}.sy-grid__table.sc-sy-grid-standard{width:100%;border-collapse:collapse}.sy-grid__table.sc-sy-grid-standard th.sc-sy-grid-standard,.sy-grid__table.sc-sy-grid-standard td.sc-sy-grid-standard{padding:6px var(--sy-grid-cell-padding-x, 12px);text-align:left;border-bottom:1px solid var(--sy-grid-row-border, #f3f4f6)}.sy-grid__table.sc-sy-grid-standard thead.sc-sy-grid-standard th.sc-sy-grid-standard{position:sticky;top:0;background:var(--sy-grid-header-bg, #f9fafb);color:var(--sy-grid-header-color, inherit);cursor:pointer;user-select:none;font-weight:var(--sy-grid-header-font-weight, 600);z-index:1}.sy-grid__table.sc-sy-grid-standard thead.sc-sy-grid-standard th.sc-sy-grid-standard:hover{background:var(--sy-grid-header-bg-hover, #f3f4f6)}.sy-grid__table.sc-sy-grid-standard tbody.sc-sy-grid-standard tr.sc-sy-grid-standard:nth-child(odd){background:var(--sy-grid-row-bg-odd, #fff)}.sy-grid__table.sc-sy-grid-standard tbody.sc-sy-grid-standard tr.sc-sy-grid-standard:nth-child(even){background:var(--sy-grid-row-bg-even, #fafbfc)}.sy-grid__table.sc-sy-grid-standard tbody.sc-sy-grid-standard tr.sc-sy-grid-standard:hover{background:var(--sy-grid-row-bg-hover, #fafbfc)}[data-row-hover-mode=stateful].sc-sy-grid-standard-h .sy-grid__table.sc-sy-grid-standard tbody.sc-sy-grid-standard tr.sc-sy-grid-standard:hover,[data-row-hover-mode=off].sc-sy-grid-standard-h .sy-grid__table.sc-sy-grid-standard tbody.sc-sy-grid-standard tr.sc-sy-grid-standard:hover{background:inherit}[data-row-hover-mode=stateful].sc-sy-grid-standard-h .sy-grid__table.sc-sy-grid-standard tbody.sc-sy-grid-standard tr.sy-grid__row--hovered.sc-sy-grid-standard{background:var(--sy-grid-row-bg-hover, #fafbfc)}.sy-grid__sort-arrow.sc-sy-grid-standard{margin-left:6px;font-size:10px;color:var(--sy-grid-sort-indicator-color, #6b7280)}.sy-grid__truncated.sc-sy-grid-standard{padding:8px var(--sy-grid-cell-padding-x, 12px);background:var(--sy-grid-row-bg-even, #fafbfc);border-top:1px solid var(--sy-grid-border, var(--border-default, #e5e7eb))}`;const SyGridStandard=class{constructor(hostRef){index.registerInstance(this,hostRef);this.queryComplete=index.createEvent(this,"queryComplete",7)}rows=[];columns=[];maxRendered=200;messages;selectedRowIds;rowHover="css-only";hoveredRowId=null;cellEditorOverride;cellRenderResolver;queryComplete;sort=null;query="";projected=[];lastComputeMs=0;componentWillLoad(){this.recompute()}async sortBy(column,direction){if(direction===null){this.sort=null}else if(direction!==void 0){this.sort={column,direction}}else if(this.sort?.column!==column){this.sort={column,direction:"asc"}}else if(this.sort.direction==="asc"){this.sort={column,direction:"desc"}}else{this.sort=null}this.recompute()}async setQuery(query){this.query=query;this.recompute()}async getProjected(){return[...this.projected]}recompute(){const start=performance.now();const projected=sortAndFilter(this.rows,this.sort,{query:this.query});this.projected=projected;this.lastComputeMs=performance.now()-start;this.queryComplete.emit({totalRows:projected.length,visibleRows:projected.slice(0,this.maxRendered),computeMs:this.lastComputeMs})}render(){const projected=this.projected;const visible=projected.slice(0,this.maxRendered);const truncated=projected.length>this.maxRendered;const messages=this.messages;const rootAttrs=gridRootAttrs({rowCount:projected.length+1,colCount:this.columns.length,busy:false});return index.h(index.Host,{key:"h","data-row-hover-mode":this.rowHover},index.h("div",{key:"t",class:"sy-grid__toolbar"},index.h("input",{key:"f",class:"sy-grid__filter",type:"search",placeholder:messages?.["toolbar.quickFilterPlaceholder"]??"Filter…","aria-label":messages?.["a11y.quickFilterLabel"]??"Search rows",value:this.query,onInput:event=>void this.setQuery(event.target.value)}),index.h("span",{key:"s",class:"sy-grid__stat"},projected.length.toLocaleString()," / ",this.rows.length.toLocaleString()," rows · ",this.lastComputeMs.toFixed(2)," ms · main-thread")),index.h("div",{key:"v",class:"sy-grid__scroll",tabindex:"0"},index.h("table",{key:"g",class:"sy-grid__table",...rootAttrs,"aria-label":messages?.["a11y.gridLabel"]??"Data grid"},index.h("thead",{key:"d"},index.h("tr",{key:"r",...headerRowAttrs()},this.columns.map((col,colIndex)=>{const sortDir=this.sort?.column===col.key?this.sort.direction:null;return index.h("th",{key:col.key,...columnHeaderAttrs({colIndex,sortDirection:sortDir,label:col.label}),style:col.width?{width:`${col.width}px`}:void 0,onClick:()=>void this.sortBy(col.key)},index.h("span",null,col.label),this.sort?.column===col.key&&index.h("span",{class:"sy-grid__sort-arrow"},sortDir==="asc"?"▲":"▼"))}))),index.h("tbody",{key:"b"},visible.map((row,i)=>{const isSelected=this.selectedRowIds?.has(i);const isHovered=this.rowHover!=="off"&&this.hoveredRowId===i;return index.h("tr",{key:i,class:{"sy-grid__row--selected":isSelected===true,"sy-grid__row--hovered":this.rowHover==="stateful"&&isHovered},"data-selected":isSelected===true?"true":void 0,"data-hovered":isHovered?"true":void 0,...bodyRowAttrs(i,{isSelected,emitRowIndex:true})},this.columns.map((col,colIndex)=>{const content=this.cellEditorOverride?.(i,colIndex)??this.cellRenderResolver?.(i,colIndex)??String(row[col.key]??"");return index.h("td",{key:col.key,...gridCellAttrs({colIndex,isActive:false})},content)}))}))),truncated&&index.h("div",{key:"m",class:"sy-grid__truncated"},"… ",(projected.length-this.maxRendered).toLocaleString()," more rows hidden (max-rendered=",this.maxRendered,")")))}static get watchers(){return{"rows":[{"recompute":0}],"columns":[{"recompute":0}]}}};SyGridStandard.style=syGridStandardCss();exports.GRID_BUILD_TIER=GRID_BUILD_TIER;exports.GRID_METHOD_TABLE=GRID_METHOD_TABLE;exports.SyGrid=SyGrid;exports.SyGridStandard=SyGridStandard;exports.computeInsertionIndex=computeInsertionIndex;exports.importGridLicenseRuntime=importGridLicenseRuntime;exports.isNoopDrop=isNoopDrop;exports.isSafeCssColor=isSafeCssColor;exports.reorderRows=reorderRows;exports.updateRowDragOver=updateRowDragOver;exports.validatePinnedRowsSlice=validatePinnedRowsSlice;
|